This following modification will make the ability to switch your site menu from Horizontal to Vertical and vice-versa easily in websites that generated with PHP Report Maker. Because of PHP Report Maker still allowing you to use one of the two menu layout (whether Horizontal or Vertical) in one occasion, then you have to re-generate your script files using PHP Reprot Maker after adjusting the related setting from Graphical extension (for registered users only).
After implementing template customization below, no need to re-generate your script files each time you want to switch it from one to another. Simply adjust the related constant in the configuration file, then your site menu will turn to the new layout as you want to. Don't you like it?
[hidepost]
-
Open your \Script\rpt-config.php file, and find this code:
// General
before that line, please insert the following code:
// Begin of modification Supports for Horizontal and Vertical Menu, by Masino Sinaga, December 2, 2012 define("MSR_MENU_HORIZONTAL", TRUE, TRUE); // Set the second parameter to TRUE if you want to use horizontal (default), or FALSE if you want vertical menu. // End of modification Supports for Horizontal and Vertical Menu, by Masino Sinaga, December 2, 2012 -
Open your \extensions\Graphical\rpt-menu.php file, and find this code:
<!--## if (bHorizMenu) { ##--> var RootMenu = new YAHOO.widget.MenuBar("RootMenu", { autosubmenudisplay: true, hidedelay: 750, lazyload: true }); <!--## } else { ##--> var RootMenu = new YAHOO.widget.Menu("RootMenu", { position: "static", hidedelay: 750, lazyload: true }); <!--## } ##-->then replace it with the following code:
<?php if (MSR_MENU_HORIZONTAL) { // Begin of modification Supports for Horizontal and Vertical Menu, by Masino Sinaga, December 2, 2012 ?> var RootMenu = new YAHOO.widget.MenuBar("RootMenu", { autosubmenudisplay: true, hidedelay: 750, lazyload: true }); <?php } else { ?> var RootMenu = new YAHOO.widget.Menu("RootMenu", { position: "static", hidedelay: 750, lazyload: true }); <?php } // End of modification Supports for Horizontal and Vertical Menu, by Masino Sinaga, December 2, 2012 ?> -
Open your \extensions\Graphical\rpt-menucfg.php file, and find this code:
<!--## if (bVertMenu) { ##--> define("EWR_MENUBAR_CLASSNAME", "yuimenu", TRUE); define("EWR_MENUBAR_ITEM_CLASSNAME", "yuimenuitem", TRUE); define("EWR_MENUBAR_ITEM_LABEL_CLASSNAME", "yuimenuitemlabel", TRUE); <!--## } ##--> <!--## if (bHorizMenu) { ##--> define("EWR_MENUBAR_CLASSNAME", "yuimenubar yuimenubarnav", TRUE); define("EWR_MENUBAR_ITEM_CLASSNAME", "yuimenubaritem", TRUE); define("EWR_MENUBAR_ITEM_LABEL_CLASSNAME", "yuimenubaritemlabel", TRUE); <!--## } ##-->then replace it with the following code:
if (MSR_MENU_HORIZONTAL) { // Begin of modification Supports for Horizontal and Vertical Menu, by Masino Sinaga, December 2, 2012 define("EWR_MENUBAR_CLASSNAME", "yuimenubar yuimenubarnav", TRUE); define("EWR_MENUBAR_ITEM_CLASSNAME", "yuimenubaritem", TRUE); define("EWR_MENUBAR_ITEM_LABEL_CLASSNAME", "yuimenubaritemlabel", TRUE); } else { define("EWR_MENUBAR_CLASSNAME", "yuimenu", TRUE); define("EWR_MENUBAR_ITEM_CLASSNAME", "yuimenuitem", TRUE); define("EWR_MENUBAR_ITEM_LABEL_CLASSNAME", "yuimenuitemlabel", TRUE); } // End of modification Supports for Horizontal and Vertical Menu, by Masino Sinaga, December 2, 2012 -
Open your \Script\rpt-menuext.php file, and find this code:
<!--## if (bHorizMenu) { ##--> <div class="ewMenuRow"> <!--## } ##--> <!--## if (bVertMenu) { ##--> <!-- content (begin) --> <table cellspacing="0" class="ewContentTable"> <tr> <td class="ewMenuColumn"> <!-- left column (begin) --> <!--## } ##--> <!--##=SYSTEMFUNCTIONS.IncludeFile("rptmenu","")##--> <!--## if (bHorizMenu) { ##--> </div> <!-- content (begin) --> <table cellspacing="0" class="ewContentTable"> <tr> <!--## } ##--> <!--## if (bVertMenu) { ##--> <!-- left column (end) --> </td> <!--## } ##-->then replace it with the following code:
<?php if (MSR_MENU_HORIZONTAL) { // Begin of modification Supports for Horizontal and Vertical Menu, by Masino Sinaga, December 2, 2012 ?> <div class="ewMenuRow"> <?php } else { // modification Supports for Horizontal and Vertical Menu, by Masino Sinaga, December 2, 2012 ?> <!-- content (begin) --> <!-- content (begin) --> <table cellspacing="0" class="ewContentTable"> <tr> <td class="ewMenuColumn"> <!-- left column (begin) --> <?php } // modification Supports for Horizontal and Vertical Menu, by Masino Sinaga, December 2, 2012 ?> <!--##=SYSTEMFUNCTIONS.IncludeFile("rptmenu","")##--> <?php if (MSR_MENU_HORIZONTAL) { // modification Supports for Horizontal and Vertical Menu, by Masino Sinaga, December 2, 2012 ?> </div> <!-- content (begin) --> <table cellspacing="0" class="ewContentTable"> <tr> <?php } else { // modification Supports for Horizontal and Vertical Menu, by Masino Sinaga, December 2, 2012 ?> <!-- left column (end) --> </td> <?php } // End of modification Supports for Horizontal and Vertical Menu, by Masino Sinaga, December 2, 2012 ?> - Finally, re-generate your script files using PHP Report Maker as usual.
-
Since the default menu layout is Horizontal, then if you want to switch it to Vertical, simply adjust the following code in your ewcfg9.php file:
define("MSR_MENU_HORIZONTAL", TRUE, TRUE);become:
define("MSR_MENU_HORIZONTAL", FALSE, TRUE);
[/hidepost]
[…] PHP Report Maker Home » PHP Report Maker » Optimizing Main Table Width in Websites that Generated by PHP Report Maker 6.0.0 Switching Menu from Horizontal to Vertical and Vice Versa Easily Using PHP Report Maker 6.0.0 […]