Source for file hvmenu-defs.php

Documentation is available at hvmenu-defs.php

  1. <?php
  2. /* ******************************************************************** */
  3. /* CATALYST PHP Source Code */
  4. /* -------------------------------------------------------------------- */
  5. /* This program is free software; you can redistribute it and/or modify */
  6. /* it under the terms of the GNU General Public License as published by */
  7. /* the Free Software Foundation; either version 2 of the License, or */
  8. /* (at your option) any later version. */
  9. /* */
  10. /* This program is distributed in the hope that it will be useful, */
  11. /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
  12. /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
  13. /* GNU General Public License for more details. */
  14. /* */
  15. /* You should have received a copy of the GNU General Public License */
  16. /* along with this program; if not, write to: */
  17. /* The Free Software Foundation, Inc., 59 Temple Place, Suite 330, */
  18. /* Boston, MA 02111-1307 USA */
  19. /* -------------------------------------------------------------------- */
  20. /* */
  21. /* Filename: hvmenu-defs.php */
  22. /* Author: Paul Waite */
  23. /* Description: Definitions for a Javascript-based multi-level menu. */
  24. /* The system creates a semi-static config file in a */
  25. /* dynamic manner and the javascript content is generated */
  26. /* from that. The semi-static file (menu-vars.js) is only */
  27. /* rebuilt when either the stylesheet or the menu data in */
  28. /* the database is changed. The stylesheet should contain */
  29. /* .menu and .submenu classes as per the default Axyl */
  30. /* installation. */
  31. /* */
  32. /* ******************************************************************** */
  33. /** @package menu */
  34. include_once("menu-defs.php");
  35.  
  36. // ----------------------------------------------------------------------
  37. /**
  38. * The HV Menu Javascript variables file. This file is
  39. * dynamically generated by this class.
  40. * @access private
  41. */
  42. define("MENU_VARS_FILE", "menu_vars.js");
  43. /**
  44. * HVMenu class
  45. * This module is being retained for legacy applications which still use
  46. * the core javascript system (version 5.41) which was written by
  47. * Ger Versluis 24 December 2001.
  48. * @deprecated HVmenu javascript no longer packaged with Axyl. Use Xmenu instead.
  49. * @package menu
  50. */
  51. class HVmenu extends RenderableObject {
  52. // Public
  53. /** Menu name eg: 'main' */
  54.  
  55. var $menu_name = "";
  56. /** Menu language */
  57.  
  58. var $language = 0;
  59. /** Name of stylesheet file to get menu styles from */
  60.  
  61. var $stylesheet = "";
  62.  
  63. // Private
  64. /** Unique database menu ID
  65. @access private */
  66. var $menu_id = 0;
  67. /** Path to menu variables file - theme aware
  68. @access private */
  69. var $menuvarsfile = "";
  70. /** WWW menu URL - theme aware
  71. @access private */
  72. var $menuhref = "";
  73. /** Positioned relatively, or not
  74. @access private */
  75. var $relative_positioned = false;
  76. /** Level of menu to render
  77. @access private */
  78. var $menu_level = 0;
  79. /** Width of all menu items in pixels
  80. @access private */
  81. var $item_width = 150;
  82. /** Height of menu items in pixels
  83. @access private */
  84. var $item_height = 18;
  85. // ....................................................................
  86. /**
  87. * Constructor
  88. * Create the HV menu object.
  89. * @param string $menu_name Menu name
  90. * @param object $webpage Webpage object that this menu is being created for
  91. * @param string $stylsheet Name of stylesheet file to reference for menu styles
  92. * @param integer $lang Optional language variant of this menu (zero = default)
  93. */
  94. function HVmenu($menu_name="main", $webpage=false, $stylesheet="", $lang=-1) {
  95. global $RESPONSE;
  96. $this->menu_name = $menu_name;
  97. // Set the menu language..
  98. if ($lang != -1) {
  99. $this->language = $lang;
  100. }
  101. elseif ($webpage !== false && $webpage->multilang && isset($webpage->languages[0])) {
  102. $this->language = $webpage->languages[0];
  103. }
  104. elseif (isset($RESPONSE) && $RESPONSE->multilang && isset($RESPONSE->languages[0])) {
  105. $this->language = $RESPONSE->languages[0];
  106. }
  107. // Get menu, fall back to default if not found..
  108. $tryagain = true;
  109. do {
  110. $tryagain = ($this->language != 0);
  111. $q = "SELECT menu_id";
  112. $q .= " FROM ax_menu";
  113. $q .= " WHERE menu_name='" . addslashes($this->menu_name) . "'";
  114. $q .= " AND lang_id=$this->language";
  115. $mID = dbrecordset($q);
  116. if ($mID->hasdata) {
  117. $tryagain = false;
  118. }
  119. else {
  120. debugbr("menu language not found ($this->language): falling back to default", DBG_DEBUG);
  121. $this->language = 0;
  122. }
  123. } while ($tryagain);
  124.  
  125. if ($mID->hasdata) {
  126. $this->menu_id = $mID->field("menu_id");
  127. }
  128. if ($webpage) {
  129. $this->stylesheet = $webpage->site_docroot . $webpage->head->stylesheet;
  130. global $CMDIR;
  131. $this->menuvarsfile = $webpage->site_docroot . "$CMDIR/" . $webpage->theme . "_" . MENU_VARS_FILE;
  132. $this->menuhref = "$CMDIR/" . $webpage->theme . "_" . MENU_VARS_FILE;
  133. $this->display_in_webpage($webpage);
  134. }
  135. // Over-ridden stylesheet to use..
  136. if ($stylesheet != "") {
  137. $this->stylesheet = $webpage->site_docroot . "/" . $stylesheet;
  138. }
  139. } // HVmenu
  140. // ....................................................................
  141. /**
  142. * Requires build
  143. * Check if the database records containing the menu
  144. * have been modified since the last modification time
  145. * of the menu vars file. Returns true if so.
  146. * @return bool True if menu requires build (config has been changed)
  147. * @access private
  148. */
  149. function requires_build() {
  150. // First check existence and file timestamp of the
  151. // menu setup file that is used by the system..
  152. if (!file_exists($this->menuvarsfile)) {
  153. debugbr("rebuilding: vars file absent", DBG_DEBUG);
  154. return true;
  155. }
  156. clearstatcache();
  157. $mvarmod_ts = filemtime($this->menuvarsfile);
  158. $mvarmod_dt = timestamp_to_datetime($mvarmod_ts);
  159.  
  160. // Now check file mod time vs database mod times..
  161. $q = "SELECT COUNT(*) AS tot FROM ax_menu";
  162. $q .= " WHERE menu_id='$this->menu_id'";
  163. $q .= " AND last_modified > '$mvarmod_dt'";
  164. $modQ = dbrecordset($q);
  165. if ($modQ->field("tot") > 0) {
  166. return true;
  167. }
  168. $q = "SELECT COUNT(*) AS tot FROM ax_menuoption";
  169. $q .= " WHERE menu_id='$this->menu_id'";
  170. $q .= " AND last_modified > '$mvarmod_dt'";
  171. $modQ = dbrecordset($q);
  172. if ($modQ->field("tot") > 0) {
  173. return true;
  174. }
  175. // If stylesheet file is provided, then check against
  176. // that also, since this influences things like fonts
  177. // and colours etc..
  178. if ($this->stylesheet != "") {
  179. $stylemod_ts = filemtime($this->stylesheet);
  180. if ($stylemod_ts > $mvarmod_ts) {
  181. return true;
  182. }
  183. }
  184. // If we got here, no need to build..
  185. return false;
  186. } // requires build
  187. // ....................................................................
  188. /**
  189. * Display in webpage
  190. * Inserts the javascript necessary to embed the menu into a given webpage.
  191. * NB: Normally the webpage passed in here is $RESPONSE.
  192. * @param object $webpage Webpage object that this menu is being created for
  193. */
  194. function display_in_webpage($webpage) {
  195. global $LIBDIR;
  196. $webpage->head->add_scriptsrc($this->menuhref);
  197. $webpage->head->add_script("var TargetLoc='menu_$this->menu_id';\n");
  198. $webpage->head->add_script($this->menu_structure());
  199. $webpage->body->add_script("function Go(){return;}\n");
  200. $webpage->body->add_scriptsrc("$LIBDIR/js/menu_com.js");
  201. } // display_in_webpage
  202. // ....................................................................
  203. /**
  204. * This renders the field as HTML.
  205. * Inserts the HTML DIV tag which the HVmenu will use to position
  206. * itself to. The name of the DIV is taken from the unique menu ID,
  207. * and corresponds to the TargetLoc variable defined above..
  208. * @return string The menu anchor point (DIV) as HTML.
  209. */
  210. function html() {
  211. // Always build menu variables file if required..
  212. if ($this->requires_build()) {
  213. $this->build();
  214. }
  215. if ($this->relative_positioned) {
  216. return "<div id=\"menu_$this->menu_id\" style=\"position:relative;\"></div>";
  217. }
  218. else {
  219. return "<div id=\"menu_$this->menu_id\"></div>";
  220. }
  221. } // html
  222. // ....................................................................
  223. /**
  224. * Build menu config
  225. * Build the static menu_vars.js file which is used to set menu
  226. * look and feel, driven by the given stylesheet. This is a physical
  227. * file which gets (re-)built and saved to disk.
  228. * @access private
  229. */
  230. function build() {
  231. global $RESPONSE;
  232. global $LIBDIR;
  233. // Get fonts and colours etc. If this stylesheet is undefined or
  234. // doesn't exist on disk, then we should still be able to generate
  235. // the vars below, but will get the defaults in each case..
  236. $ss = new stylesheet($this->stylesheet);
  237. // Read in all the style settings..
  238. $FontLowColor = defaulted($ss->style("menu", "color"), "#efefef");
  239. $LowBgColor = defaulted($ss->style("menu", "background-color"), "black");
  240. $FontHighColor = defaulted($ss->style("menu_highlight", "color"), "white");
  241. $HighBgColor = defaulted($ss->style("menu_highlight", "background-color"), "grey");
  242. $BorderColor = defaulted($ss->style("menu", "border-color"), "black");
  243. $MenuTextCentered = defaulted($ss->style("menu", "text-align"), "left");
  244. $MenuCentered = defaulted($ss->style("menu", "menu-align"), "left");
  245. $MenuVerticalCentered = defaulted($ss->style("menu", "menu-vertical-align"), "top");
  246. $FontFamily = defaulted($ss->style("menu", "font-family"), "arial");
  247. $FontSubLowColor = defaulted($ss->style("submenu", "color"), "#efefef");
  248. $LowSubBgColor = defaulted($ss->style("submenu", "background-color"), "black");
  249. $FontSubHighColor = defaulted($ss->style("submenu_highlight", "color"), "white");
  250. $HighSubBgColor = defaulted($ss->style("submenu_highlight", "background-color"), "grey");
  251. $BorderSubColor = defaulted($ss->style("submenu", "border-color"), "black");
  252.  
  253. // Elements with superfluous bits to be removed..
  254. $val = defaulted($ss->style("menu", "menu-frame"), "self");
  255. $FirstLineFrame = str_replace("'", "", $val);
  256. $val = defaulted($ss->style("menu", "submenu-frame"), "self");
  257. $SecLineFrame = str_replace("'", "", $val);
  258. $val = defaulted($ss->style("menu", "content-frame"), "self");
  259. $DocTargetFrame = str_replace("'", "", $val);
  260. $val = defaulted($ss->style("menu", "margin-top"), "0");
  261. $StartTop = str_replace("px", "", $val);
  262. $val = defaulted($ss->style("menu", "margin-left"), "0");
  263. $StartLeft = str_replace("px", "", $val);
  264. $val = defaulted($ss->style("menu", "vertical-correction"), "0");
  265. $VerCorrect = str_replace("px", "", $val);
  266. $val = defaulted($ss->style("menu", "horizontal-correction"), "0");
  267. $HorCorrect = str_replace("px", "", $val);
  268. $val = defaulted($ss->style("menu", "padding-left"), "0");
  269. $LeftPaddng = str_replace("px", "", $val);
  270. $val = defaulted($ss->style("menu", "padding-top"), "0");
  271. $TopPaddng = str_replace("px", "", $val);
  272. $val = defaulted($ss->style("menu", "font-size"), "8");
  273. $FontSize = str_replace("pt", "", $val);
  274. $val = defaulted($ss->style("menu", "disappear-delay"), "100");
  275. $DisappearDelay = str_replace("ms", "", $val);
  276. $val = defaulted($ss->style("menu", "border-width"), "1");
  277. $BorderWidth = str_replace("px", "", $val);
  278. $val = defaulted($ss->style("menu", "item-spacing"), "0");
  279. $BorderBtwnElmnts = str_replace("px", "", $val);
  280.  
  281. // Real Numbers..
  282. $ChildOverlap = defaulted($ss->style("menu", "child-overlap"), "0.2");
  283. if ($ChildOverlap > 1.0) $ChildOverlap = 1.0;
  284. if ($ChildOverlap < 0.0) $ChildOverlap = 0.0;
  285.  
  286. $ChildVerticalOverlap = defaulted($ss->style("menu", "child-vertical-overlap"), "0.2");
  287. if ($ChildVerticalOverlap > 1.0) $ChildVerticalOverlap = 1.0;
  288. if ($ChildVerticalOverlap < 0.0) $ChildVerticalOverlap = 0.0;
  289. $ChildVerticalOverlap = (1.0 - $ChildVerticalOverlap);
  290.  
  291. // Integers, Logicals, et al..
  292. $val = defaulted($ss->style("menu", "font-weight"), "normal");
  293. if ($val == "bold") $FontBold = "1";
  294. else $FontBold = "0";
  295.  
  296. $val = defaulted($ss->style("menu", "font-style"), "normal");
  297. if ($val == "italic") $FontItalic = "1";
  298. else $FontItalic = "0";
  299.  
  300. $val = defaulted($ss->style("menu", "orientation"), "horizontal");
  301. if ($val == "horizontal") $FirstLineHorizontal = "1";
  302. else $FirstLineHorizontal = "0";
  303.  
  304. $val = defaulted($ss->style("menu", "frames-columns"), "no");
  305. if ($val == "yes") $MenuFramesVertical = "1";
  306. else $MenuFramesVertical = "0";
  307.  
  308. $val = defaulted($ss->style("menu", "takeover-background-color"), "no");
  309. if ($val == "yes") $TakeOverBgColor = "1";
  310. else $TakeOverBgColor = "0";
  311.  
  312. $val = defaulted($ss->style("menu", "hide-top"), "no");
  313. if ($val == "yes") $HideTop = "1";
  314. else $HideTop = "0";
  315.  
  316. $val = defaulted($ss->style("menu", "wrap"), "no");
  317. if ($val == "yes") $MenuWrap = "1";
  318. else $MenuWrap = "0";
  319.  
  320. $val = defaulted($ss->style("menu", "wrap"), "no");
  321. if ($val == "yes") $MenuWrap = "1";
  322. else $MenuWrap = "0";
  323.  
  324. $val = defaulted($ss->style("menu", "right-to-left"), "yes");
  325. if ($val == "yes") $RightToLeft = "1";
  326. else $RightToLeft = "0";
  327.  
  328. $val = defaulted($ss->style("menu", "unfold-on-click"), "no");
  329. if ($val == "yes") $UnfoldsOnClick = "1";
  330. else $UnfoldsOnClick = "0";
  331.  
  332. $val = defaulted($ss->style("menu", "debug"), "no");
  333. if ($val == "yes") $WebMasterCheck = "1";
  334. else $WebMasterCheck = "0";
  335.  
  336. $val = defaulted($ss->style("menu", "show-arrows"), "no");
  337. if ($val == "yes") $ShowArrow = "1";
  338. else $ShowArrow = "0";
  339.  
  340. $val = defaulted($ss->style("menu", "show-status"), "no");
  341. if ($val == "yes") $ShowStatus = "1";
  342. else $ShowStatus = "0";
  343.  
  344. // This can take values: 'url' or 'description'. It determines
  345. // what is shown in the browser status bar..
  346. $StatusContent = defaulted($ss->style("menu", "status-content"), "url");
  347.  
  348. $val = defaulted($ss->style("menu", "keep-highlight"), "no");
  349. if ($val == "yes") $KeepHilite = "1";
  350. else $KeepHilite = "0";
  351.  
  352. $val = defaulted($ss->style("menu", "relative-positioned"), "no");
  353. if ($val == "yes") $this->relative_positioned = true;
  354. else $this->relative_positioned = false;
  355.  
  356. // Write the variables file out..
  357. $newMV = new outputfile($this->menuvarsfile);
  358. if ($newMV->opened) {
  359. $newMV->writeln("//HVMENU (c)2001 Ger Versluis");
  360. $newMV->writeln("var LowBgColor='$LowBgColor';");
  361. $newMV->writeln("var LowSubBgColor='$LowSubBgColor';");
  362. $newMV->writeln("var HighBgColor='$HighBgColor';");
  363. $newMV->writeln("var HighSubBgColor='$HighSubBgColor';");
  364. $newMV->writeln("var FontLowColor='$FontLowColor';");
  365. $newMV->writeln("var FontSubLowColor='$FontSubLowColor';");
  366. $newMV->writeln("var FontHighColor='$FontHighColor';");
  367. $newMV->writeln("var FontSubHighColor='$FontSubHighColor';");
  368. $newMV->writeln("var BorderColor='$BorderColor';");
  369. $newMV->writeln("var BorderSubColor='$BorderSubColor';");
  370. $newMV->writeln("var BorderWidth=$BorderWidth;");
  371. $newMV->writeln("var BorderBtwnElmnts=$BorderBtwnElmnts;");
  372. $newMV->writeln("var FontFamily='$FontFamily';");
  373. $newMV->writeln("var FontSize='$FontSize';");
  374. $newMV->writeln("var FontBold=$FontBold;");
  375. $newMV->writeln("var FontItalic=$FontItalic;");
  376. $newMV->writeln("var MenuTextCentered='$MenuTextCentered';");
  377. $newMV->writeln("var MenuCentered='$MenuCentered';");
  378. $newMV->writeln("var MenuVerticalCentered='$MenuVerticalCentered';");
  379. $newMV->writeln("var ChildOverlap=$ChildOverlap;");
  380. $newMV->writeln("var ChildVerticalOverlap=$ChildVerticalOverlap;");
  381. $newMV->writeln("var StartTop=$StartTop;");
  382. $newMV->writeln("var StartLeft=$StartLeft;");
  383. $newMV->writeln("var VerCorrect=$VerCorrect;");
  384. $newMV->writeln("var HorCorrect=$HorCorrect;");
  385. $newMV->writeln("var LeftPaddng=$LeftPaddng;");
  386. $newMV->writeln("var TopPaddng=$TopPaddng;");
  387. $newMV->writeln("var FirstLineHorizontal=$FirstLineHorizontal;");
  388. $newMV->writeln("var MenuFramesVertical=$MenuFramesVertical;");
  389. $newMV->writeln("var DisappearDelay=$DisappearDelay;");
  390. $newMV->writeln("var TakeOverBgColor=$TakeOverBgColor;");
  391. $newMV->writeln("var FirstLineFrame='$FirstLineFrame';");
  392. $newMV->writeln("var SecLineFrame='$SecLineFrame';");
  393. $newMV->writeln("var DocTargetFrame='$DocTargetFrame';");
  394. $newMV->writeln("var HideTop=$HideTop;");
  395. $newMV->writeln("var MenuWrap=$MenuWrap;");
  396. $newMV->writeln("var RightToLeft=$RightToLeft;");
  397. $newMV->writeln("var UnfoldsOnClick=$UnfoldsOnClick;");
  398. $newMV->writeln("var WebMasterCheck=$WebMasterCheck;");
  399. $newMV->writeln("var ShowArrow=$ShowArrow;");
  400. $newMV->writeln("var ShowStatus=$ShowStatus;");
  401. $newMV->writeln("var StatusContent='$StatusContent';");
  402. $newMV->writeln("var KeepHilite=$KeepHilite;");
  403. $newMV->writeln("var Arrws=['$LIBDIR/img/_tri.gif',5,10,'$LIBDIR/img/_tridown.gif',10,5,'$LIBDIR/img/_trileft.gif',5,10];");
  404. $newMV->writeln("function BeforeStart(){return}");
  405. $newMV->writeln("function AfterBuild(){return}");
  406. $newMV->writeln("function BeforeFirstOpen(){return}");
  407. $newMV->writeln("function AfterCloseAll(){return}");
  408. // Finish up..
  409. $newMV->closefile();
  410. } // newMV file opened
  411. } // build
  412. // ....................................................................
  413. /**
  414. * Menu structure
  415. * This function returns a set of Javascript array definitions which
  416. * should be put into the page which will be hosting the menu. Note
  417. * that this will be built for each user, since each user has a
  418. * unique auth_code which might be a part of the menu..
  419. * @return string Javascript var definitions for menu structure
  420. * @access private
  421. */
  422. function menu_structure() {
  423. global $RESPONSE;
  424. // Menu Tree
  425. // MenuX=new Array(
  426. // Text to show,
  427. // Link,
  428. // background image (optional),
  429. // number of sub elements,
  430. // height,
  431. // width
  432. // );
  433. // For rollover images set "Text to show" to:
  434. // "rollover:Image1.jpg:Image2.jpg"
  435. $js = "";
  436. $q = "SELECT *";
  437. $q .= " FROM ax_menu m, ax_menuoption mo";
  438. $q .= " WHERE m.menu_id=$this->menu_id";
  439. $q .= " AND mo.menu_id=m.menu_id";
  440. $q .= " AND m.active=TRUE";
  441. $q .= " AND mo.active=TRUE";
  442. $q .= " ORDER BY mo.menu_level,mo.display_order,mo.parent_id";
  443. $item = dbrecordset($q);
  444. if ($item->hasdata) {
  445. $topcount = 0;
  446. do {
  447. $mopid = $item->field("menuoption_id");
  448. $mnu_ugroups = $item->field("user_groups");
  449. $mnu_usertype = $item->field("user_type");
  450. if ($mnu_ugroups == "" || $RESPONSE->ismemberof_group_in($mnu_ugroups)) {
  451. if ($mnu_usertype == "" || ($RESPONSE->user_type == $mnu_usertype)) {
  452. $parent_id = $item->field("parent_id");
  453. $menu_level = $item->field("menu_level");
  454. $label = $item->field("label");
  455. $description = $item->field("description");
  456. $action = $item->field("action");
  457. $authcode = $item->istrue("auth_code");
  458. $width = $item->field("width");
  459. $height = $item->field("height");
  460. $is_parent = $item->istrue("is_parent");
  461. if ($menu_level == 0) {
  462. $topcount += 1;
  463. $mno_top[$topcount] = $mopid;
  464. }
  465. $mno_details[$mopid] = "$label|$description|$action|" . ($authcode ? "t" : "f") . "|$width|$height";
  466. $mno_level[$mopid] = $menu_level;
  467. $mno_parent[$mopid] = $parent_id;
  468. if ($parent_id != "") {
  469. if (isset($mno_children[$parent_id])) {
  470. $mno_children[$parent_id] .= "|";
  471. }
  472. $mno_children[$parent_id] .= $mopid;
  473. }
  474. } // user type check
  475. } // memberof
  476. } while ($item->get_next());
  477.  
  478. // Number of top-level items..
  479. $js .= "var NoOffFirstLineMenus=$topcount;\n";
  480.  
  481. if (is_array( $mno_top )) {
  482. while (list($item_no, $mopid) = each($mno_top)) {
  483. $prefix = "$item_no";
  484. $js .= HVmenu_entry($prefix, $mopid, $mno_children, $mno_details);
  485. }
  486. }
  487. } // hasdata
  488. return $js;
  489. } // menu_structure
  490.  
  491. } // HVmenu class
  492. // ----------------------------------------------------------------------
  493.  
  494. /**
  495. * Recursively produce HVmenu definition entries. These array
  496. * definitions define the menu structure in terms of the actual
  497. * menus and their sub-menus. This routine produces a single
  498. * menu-option definition, but will recursively call all child
  499. * (sub-menu) definitions.
  500. @param string $prefix The existing menu level prefix
  501. @param string $mopid Menu option ID
  502. @param string $mno_children List of children IDs of a menu option
  503. @param string $mno_details Menu option details
  504. @access private
  505. */
  506. function HVmenu_entry($prefix, $mopid, $mno_children, $mno_details) {
  507. global $RESPONSE;
  508. $childcount = 0;
  509. $js = "";
  510. if (isset($mno_children[$mopid]) && $mno_children[$mopid] != "") {
  511. $childoptions = explode("|", $mno_children[$mopid]);
  512. $childcount = count($childoptions);
  513. $pfxcount = 1;
  514. foreach ($childoptions as $childmopid) {
  515. $childprefix = $prefix . "_" . $pfxcount;
  516. $js .= HVmenu_entry($childprefix, $childmopid, $mno_children, $mno_details);
  517. $pfxcount += 1;
  518. }
  519. }
  520. // Now finally write this current menu option to file..
  521. $details = explode("|", $mno_details[$mopid]);
  522. $label = $details[0];
  523. if ($label == MENU_ITEM_SPACER) {
  524. $label = "";
  525. }
  526. $description = $details[1];
  527. $action = $details[2];
  528. $authcode = $details[3];
  529. $width = $details[4];
  530. $height = $details[5];
  531. if ($authcode == "t") {
  532. if (strstr($action, "?")) $action .= "&";
  533. else $action .= "?";
  534. $action .= "auth_code=" . $RESPONSE->get_auth_code();
  535. }
  536. // Make menu entry..
  537. $js .= "Menu" . $prefix . "=new Array(\"$label\",\"$action\",\"$description\",\"\",$childcount,$height,$width);\n";
  538. // Return the javascript..
  539. return $js;
  540. }
  541.  
  542. // ----------------------------------------------------------------------
  543. ?>

Documentation generated by phpDocumentor 1.3.0RC3