Source for file admin.menumanager.html.php

Documentation is available at admin.menumanager.html.php

  1. <?php
  2. /**
  3. @package Mambo
  4. @subpackage Menus
  5. @copyright  Refer to copyright.php
  6. @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
  7. @author Mambo Foundation Inc see README.php
  8. */
  9.  
  10. /** ensure this file is being included by a parent file */
  11. defined'_VALID_MOS' or die'Direct Access to this location is not allowed.' );
  12.  
  13. /**
  14. * HTML class for all menumanager component output
  15. */
  16.     /**
  17.     * Writes a list of the menumanager items
  18.     */
  19.     function show $option$menus$pageNav {
  20.         global $mosConfig_live_site;
  21.         ?>
  22.         <script language="javascript" type="text/javascript">
  23.         function menu_listItemTask( id, task, option ) {
  24.             var f = document.adminForm;
  25.             cb = eval( 'f.' + id );
  26.             if (cb) {
  27.                 cb.checked = true;
  28.                 submitbutton(task);
  29.             }
  30.             return false;
  31.         }
  32.         </script>
  33.  
  34.         <form action="index2.php" method="post" name="adminForm">
  35.         <table class="adminheading">
  36.         <tr>
  37.             <th class="menus">
  38.             <?php echo T_('Menu Manager')?>
  39.             </th>
  40.         </tr>
  41.         </table>
  42.  
  43.         <table class="adminlist">
  44.         <tr>
  45.             <th width="20">#</th>
  46.             <th width="20px">
  47.             </th>
  48.             <th class="title" nowrap="nowrap">
  49.             <?php echo T_('Menu Name')?>
  50.             </th>
  51.             <th width="5%" nowrap="nowrap">
  52.             <?php echo T_('Menu Items')?>
  53.             </th>
  54.             <th width="10%">
  55.             <?php echo T_('# Published')?>
  56.             </th>
  57.             <th width="15%">
  58.             <?php echo T_('# Unpublished')?>
  59.             </th>
  60.             <th width="15%">
  61.             <?php echo T_('# Trash')?>
  62.             </th>
  63.             <th width="15%">
  64.             <?php echo T_('# Modules')?>
  65.             </th>
  66.         </tr>
  67.         <?php
  68.         $k 0;
  69.         $i 0;
  70.         $start 0;
  71.         if ($pageNav->limitstart)
  72.             $start $pageNav->limitstart;
  73.         $count count($menus)-$start;
  74.         if ($pageNav->limit)
  75.             if ($count $pageNav->limit)
  76.                 $count $pageNav->limit;
  77.         for ($m $start$m $start+$count$m++{
  78.             $menu $menus[$m];
  79.             $link     'index2.php?option=com_menumanager&task=edit&hidemainmenu=1&menu='$menu->type;
  80.             $linkA     'index2.php?option=com_menus&menutype='$menu->type;
  81.             ?>
  82.             <tr class="<?php echo "row"$k?>">
  83.                 <td align="center" width="30px">
  84.                 <?php echo $i $pageNav->limitstart;?>
  85.                 </td>
  86.                 <td width="30px" align="center">
  87.                 <input type="checkbox" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $menu->type?>" onclick="isChecked(this.checked);" />
  88.                 </td>
  89.                 <td>
  90.                 <a href="<?php echo $link?>" title="<?php echo T_('Edit Menu Name')?>">
  91.                 <?php echo $menu->type?>
  92.                 </a>
  93.                 </td>
  94.                 <td align="center">
  95.                 <a href="<?php echo $linkA?>" title="<?php echo T_('Edit Menu Items')?>">
  96.                 <img src="<?php echo $mosConfig_live_site?>/includes/js/ThemeOffice/mainmenu.png" border="0"/>
  97.                 </a>
  98.                 </td>
  99.                 <td align="center">
  100.                 <?php
  101.                 echo $menu->published;
  102.                 ?>
  103.                 </td>
  104.                 <td align="center">
  105.                 <?php
  106.                 echo $menu->unpublished;
  107.                 ?>
  108.                 </td>
  109.                 <td align="center">
  110.                 <?php
  111.                 echo $menu->trash;
  112.                 ?>
  113.                 </td>
  114.                 <td align="center">
  115.                 <?php
  116.                 echo $menu->modules;
  117.                 ?>
  118.                 </td>
  119.             </tr>
  120.             <?php
  121.             $k $k;
  122.             $i++;
  123.         }
  124.         ?>
  125.         </table>
  126.         <?php echo $pageNav->getListFooter()?>
  127.  
  128.         <input type="hidden" name="option" value="<?php echo $option?>" />
  129.         <input type="hidden" name="task" value="" />
  130.         <input type="hidden" name="boxchecked" value="0" />
  131.         <input type="hidden" name="hidemainmenu" value="0" />
  132.         </form>
  133.         <?php
  134.     }
  135.  
  136.  
  137.     /**
  138.     * writes a form to take the name of the menu you would like created
  139.     * @param option    display options for the form
  140.     */
  141.     function edit &$row$option {
  142.         global $mosConfig_live_site;
  143.  
  144.         $new $row->menutype 1;
  145.         ?>
  146.         <script language="javascript" type="text/javascript">
  147.         function submitbutton(pressbutton) {
  148.             var form = document.adminForm;
  149.  
  150.             if (pressbutton == 'savemenu') {
  151.                 if ( form.menutype.value == '' ) {
  152.                     alert( '<?php echo T_('Please enter a menu name')?>' );
  153.                     form.menutype.focus();
  154.                     return;
  155.                 }
  156.                 <?php
  157.                 if $new {
  158.                     ?>
  159.                     if ( form.title.value == '' ) {
  160.                         alert( '<?php echo T_('Please enter a module name for your menu')?>' );
  161.                         form.title.focus();
  162.                         return;
  163.                     }
  164.                     <?php
  165.                 }
  166.                 ?>
  167.                 submitform( 'savemenu' );
  168.             } else {
  169.                 submitform( pressbutton );
  170.             }
  171.         }
  172.         </script>
  173.         <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
  174.         <form action="index2.php" method="post" name="adminForm">
  175.         <table class="adminheading">
  176.         <tr>
  177.             <th class="menus">
  178.             <?php echo T_('Menu Details')?>
  179.             </th>
  180.         </tr>
  181.         </table>
  182.  
  183.         <table class="adminform">
  184.         <tr height="45px;">
  185.             <td width="100px" align="left">
  186.             <strong><?php echo T_('Menu Name:')?></strong>
  187.             </td>
  188.             <td>
  189.             <input class="inputbox" type="text" name="menutype" size="30" value="<?php echo isset$row->menutype $row->menutype ''?>" />
  190.             <?php
  191.             $tip T_('This is the identification name used by mambo to identify this menu within the code - it must be unique. It is recommended that you do not have any spaces in your Menu Name');
  192.             echo mosToolTip$tip );
  193.             ?>
  194.             </td>
  195.         </tr>
  196.         <?php
  197.         if $new {
  198.             ?>
  199.             <tr>
  200.                 <td width="100px" align="left" valign="top">
  201.                 <strong><?php echo T_('Module Title:')?></strong>
  202.                 </td>
  203.                 <td>
  204.                 <input class="inputbox" type="text" name="title" size="30" value="<?php echo $row->title $row->title '';?>" />
  205.                 <?php
  206.                 $tip T_('Title of the mod_mainmenu module required to show this Menu');
  207.                 echo mosToolTip$tip );
  208.                 ?>
  209.                 <br/><br/><br/>
  210.                 <strong>
  211.  
  212.                 * <?php echo T_('A new mod_mainmenu module, with the Title you have entered above will automatically be created when you save this menu.')?> *
  213.                 <br/><br/>
  214.                 <?php echo T_('Parameters for the module created are to be edited through the "Modules Manager [site]": Modules -> Site Modules')?>
  215.                 </strong>
  216.                 </td>
  217.             </tr>
  218.             <?php
  219.         }
  220.         ?>
  221.         <tr>
  222.             <td colspan="2">
  223.             </td>
  224.         </tr>
  225.         </table>
  226.         <br /><br />
  227.  
  228.         <script language="Javascript" src="<?php echo $mosConfig_live_site?>/includes/js/overlib_mini.js"></script>
  229.         <?php
  230.         if $new {
  231.             ?>
  232.             <input type="hidden" name="id" value="<?php echo $row->id?>" />
  233.             <input type="hidden" name="iscore" value="<?php echo $row->iscore?>" />
  234.             <input type="hidden" name="published" value="<?php echo $row->published?>" />
  235.             <input type="hidden" name="position" value="<?php echo $row->position?>" />
  236.             <input type="hidden" name="module" value="mod_mainmenu" />
  237.             <input type="hidden" name="params" value="<?php echo $row->params?>" />
  238.             <?php
  239.         }
  240.         ?>
  241.  
  242.         <input type="hidden" name="new" value="<?php echo $new?>" />
  243.         <input type="hidden" name="old_menutype" value="<?php echo $row->menutype?>" />
  244.         <input type="hidden" name="option" value="<?php echo $option?>" />
  245.         <input type="hidden" name="task" value="savemenu" />
  246.         <input type="hidden" name="boxchecked" value="0" />
  247.         </form>
  248.         <?php
  249.         }
  250.  
  251.  
  252.     /**
  253.     * A delete confirmation page
  254.     * Writes list of the items that have been selected for deletion
  255.     */
  256.     function showDelete$option$type$items$modules {
  257.         ?>
  258.         <form action="index2.php" method="post" name="adminForm">
  259.         <table class="adminheading">
  260.         <tr>
  261.             <th>
  262.             <?php printf(T_('Delete Menu: %s')$type?>
  263.             </th>
  264.         </tr>
  265.         </table>
  266.  
  267.         <br />
  268.         <table class="adminform">
  269.         <tr>
  270.             <td width="3%"></td>
  271.             <td align="left" valign="top" width="20%">
  272.             <?php
  273.             if $modules {
  274.                 ?>
  275.                 <strong><?php echo T_('Module(s) being Deleted:')?></strong>
  276.                 <ol>
  277.                 <?php
  278.                 foreach $modules as $module {
  279.                     ?>
  280.                     <li>
  281.                     <font color="#000066">
  282.                     <strong>
  283.                     <?php echo $module->title?>
  284.                     </strong>
  285.                     </font>
  286.                     </li>
  287.                     <input type="hidden" name="cid[]" value="<?php echo $module->id?>" />
  288.                     <?php
  289.                 }
  290.                 ?>
  291.                 </ol>
  292.                 <?php
  293.             }
  294.             ?>
  295.             </td>
  296.             <td align="left" valign="top" width="25%">
  297.             <strong><?php echo T_('Menu Items being Deleted:')?></strong>
  298.             <br />
  299.             <ol>
  300.             <?php
  301.             if (is_array($items)) {
  302.             foreach $items as $item {
  303.                 ?>
  304.                 <li>
  305.                 <font color="#000066">
  306.                 <?php echo $item->name?>
  307.                 </font>
  308.                 </li>
  309.                 <input type="hidden" name="mids[]" value="<?php echo $item->id?>" />
  310.                 <?php
  311.             }
  312.             }
  313.             ?>
  314.             </ol>
  315.             </td>
  316.             <td>
  317.             * <?php echo T_('This will <span style="font-weight:bold;color:#FF0000">Delete</span> this Menu, <br />ALL its Menu Items and the Module(s) associated with it')?>  *
  318.             <br /><br /><br />
  319.             <div style="border: 1px dotted gray; width: 70px; padding: 10px; margin-left: 100px;">
  320.             <a class="toolbar" href="javascript:if (confirm('<?php echo T_('Are you sure you want to Delete this menu? \nThis will Delete the Menu, its Items and the Module(s).')?>')){ submitbutton('deletemenu');}" onmouseout="MM_swapImgRestore();"  onmouseover="MM_swapImage('remove','','images/delete_f2.png',1);">
  321.             <img name="remove" src="images/delete.png" alt="<?php echo T_('Delete')?>" border="0" align="middle" />
  322.             &nbsp;<?php echo T_('Delete')?>
  323.             </a>
  324.             </div>
  325.             </td>
  326.         </tr>
  327.         <tr>
  328.             <td>&nbsp;</td>
  329.         </tr>
  330.         </table>
  331.         <br /><br />
  332.  
  333.         <input type="hidden" name="option" value="<?php echo $option;?>" />
  334.         <input type="hidden" name="task" value="" />
  335.         <input type="hidden" name="type" value="<?php echo $type?>" />
  336.         <input type="hidden" name="boxchecked" value="1" />
  337.         </form>
  338.         <?php
  339.     }
  340.  
  341.  
  342.     /**
  343.     * A copy confirmation page
  344.     * Writes list of the items that have been selected for copy
  345.     */
  346.     function showCopy$option$type$items {
  347.     ?>
  348.         <script language="javascript" type="text/javascript">
  349.         function submitbutton(pressbutton) {
  350.             if (pressbutton == 'copymenu') {
  351.                 if ( document.adminForm.menu_name.value == '' ) {
  352.                     alert( '<?php echo T_('Please enter a name for the copy of the Menu')?>' );
  353.                     return;
  354.                 } else if ( document.adminForm.module_name.value == '' ) {
  355.                     alert( '<?php echo T_('Please enter a name for the new Module')?>' );
  356.                     return;
  357.                 } else {
  358.                     submitform( 'copymenu' );
  359.                 }
  360.             } else {
  361.                 submitform( pressbutton );
  362.             }
  363.         }
  364.         </script>
  365.         <form action="index2.php" method="post" name="adminForm">
  366.         <table class="adminheading">
  367.         <tr>
  368.             <th>
  369.             <?php echo T_('Copy Menu')?>
  370.             </th>
  371.         </tr>
  372.         </table>
  373.  
  374.         <br />
  375.         <table class="adminform">
  376.         <tr>
  377.             <td width="3%"></td>
  378.             <td align="left" valign="top" width="30%">
  379.             <strong><?php echo T_('New Menu Name:')?></strong>
  380.             <br />
  381.             <input class="inputbox" type="text" name="menu_name" size="30" value="" />
  382.             <br /><br /><br />
  383.             <strong><?php echo T_('New Module Name:')?></strong>
  384.             <br />
  385.             <input class="inputbox" type="text" name="module_name" size="30" value="" />
  386.             <br /><br />
  387.             </td>
  388.             <td align="left" valign="top" width="25%">
  389.             <strong>
  390.             <?php echo T_('Menu being copied:')?>
  391.             </strong>
  392.             <br />
  393.             <font color="#000066">
  394.             <strong>
  395.             <?php echo $type?>
  396.             </strong>
  397.             </font>
  398.             <br /><br />
  399.             <strong>
  400.             <?php echo T_('Menu Items being copied:')?>
  401.             </strong>
  402.             <br />
  403.             <ol>
  404.             <?php
  405.             foreach $items as $item {
  406.                 ?>
  407.                 <li>
  408.                 <font color="#000066">
  409.                 <?php echo $item->name?>
  410.                 </font>
  411.                 </li>
  412.                 <input type="hidden" name="mids[]" value="<?php echo $item->id?>" />
  413.                 <?php
  414.             }
  415.             ?>
  416.             </ol>
  417.             </td>
  418.             <td valign="top">
  419.             </td>
  420.         </tr>
  421.         <tr>
  422.             <td>&nbsp;</td>
  423.         </tr>
  424.         </table>
  425.         <br /><br />
  426.  
  427.         <input type="hidden" name="option" value="<?php echo $option;?>" />
  428.         <input type="hidden" name="task" value="" />
  429.         <input type="hidden" name="type" value="<?php echo $type?>" />
  430.         </form>
  431.         <?php
  432.     }
  433. }
  434. ?>

Documentation generated on Mon, 05 May 2008 16:15:30 +0400 by phpDocumentor 1.4.0