Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
menu.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * For TEST widget menu Calendar
9  *
10  * @author Anakeen 2005
11  * @version $Id: menu.php,v 1.2 2005/11/24 13:47:51 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage
15  */
16 /**
17  */
18 ?>
19 <html>
20 
21 <head>
22 <script type="text/javascript" src="/test/mcallib.js"></script>
23 <script type="text/javascript" src="/test/mcalmenu.js"></script>
24 </head>
25 <body>
26 <script type="text/javascript">
27 
28 function testMenu() {
29  alert('Dans la sonction');
30 }
31  // label : ...
32  // status : 0: hidden, 1:Inactif, 2:Actif
33  // type : 0 : title 1 : menu item 2 : separator
34  // icon : icon relative path
35 
36  // onmouse : 0 : none 1 onclick 2 on shiftclick 3 : on ctrl-click
37 
38  // amode : 0:display event action 1=http 2=javascript
39  // atarget : target for http (like target for <a>)
40  // ascript : url (http) or fonction (javascript)
41  // aevent : 0 : none, 1 :reload event; 2 : delete event, 3 reload calendar
42 
43  var m1 = [
44  { label:"titre du menu", status:1, type:0 },
45  { label:"item 1", desc:'Avec un description plus longue', status:1, type:1, eaction:0, icon:"defico.png", amode:0, atarget:"_blanck", ascript:"http://127.0.0.1", aevent:0 },
46  { label:"item 2", desc:'Avec un description plus longue', status:2, type : 1, eaction : 0, icon : "defico.png", amode:0, atarget:"_blanck", ascript:"http://127.0.0.1/", aevent:0 },
47  { type : 2 },
48  { label : "item 3", desc:'Avec un description plus longue', status : 2, type : 1, eaction : 0, amode:0, atarget:"_blanck", ascript:"http://127.0.0.1/?", aevent:0 },
49  { label : "item 4", desc:'Avec un description plus longue', onmouse:1, status : 2, type : 1, eaction : 0, icon : "defico.png", amode:1, atarget:"_blanck", ascript:testMenu, aevent:0 },
50  ];
51 var m2 = [
52  { label:"Menu2", status:1, type:0 },
53  { label : "item 1", desc:'Avec un description plus longue', status : 2, type : 1, eaction : 0, amode:0, atarget:"_blanck", ascript:"http://127.0.0.1/?", aevent:0 },
54  { label : "item 2", desc:'Avec un description plus longue', status : 2, type : 1, eaction : 0, amode:0, atarget:"_blanck", ascript:"http://127.0.0.1/?", aevent:0 },
55  { label : "item 3", desc:'Avec un description plus longue', status : 2, type : 1, eaction : 0, icon : "defico.png", amode:1, atarget:"_blanck", ascript:testMenu, aevent:0 },
56  { label : "item 4", desc:'Avec un description plus longue', status : 2, type : 1, eaction : 0, icon : "defico.png", amode:1, atarget:"_blanck", ascript:testMenu, aevent:0 },
57  { type : 2 },
58  { label : "item 5", desc:'Avec un description plus longue', status : 2, type : 1, eaction : 0, amode:0, atarget:"_blanck", ascript:"http://127.0.0.1/?", aevent:0 },
59  { label : "item 6", desc:'Avec un description plus longue', status : 2, type : 1, eaction : 0, icon : "defico.png", amode:1, atarget:"_blanck", ascript:testMenu, aevent:0 },
60  { label : "item 7", desc:'Avec un description plus longue', status : 1, type : 1, eaction : 0, icon : "defico.png", amode:0, atarget:"_blanck", ascript:"http://127.0.0.1", aevent:0 },
61  { label : "item 8", desc:'Avec un description plus longue', status : 2, type : 1, eaction : 0, icon : "defico.png", amode:0, atarget:"_blanck", ascript:"http://127.0.0.1/", aevent:0 },
62  ];
63 
64 var mt1 = new MCalMenu('ev1', m1); mt1.create();
65 //mt1.attachToElt('mev1');
66 var mt2 = new MCalMenu('ev2', m2);
67 mt2.setColor('#000081', '#E9E3FF', '', '#C2C5F9', 'white', '#000081');
68 mt2.create();
69 mt2.attachToElt('mev2');
70 </script>
71  <div id="mev1" style="position:absolute; z-index:100; left:100; top:100; width:100; height:100; background:blue" oncontextmenu="MCalMenu.showMenu(event, mt1.menuId)">Click</div>
72  <div id="mev2" style="position:absolute; z-index:100; left:300; top:100; width:100; height:100; background:blue">Click</div>
73 
74 <script type="text/javascript">
75 mt2.attachToElt('mev2');
76 </script>
77 </body>
78 </html>
← centre documentaire © anakeen - published under CC License - Dynacase