Source for file components.menu.html.php

Documentation is available at components.menu.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. /** ensure this file is being included by a parent file */
  10. defined'_VALID_MOS' or die'Direct Access to this location is not allowed.' );
  11.  
  12. /**
  13. * Writes the edit form for new and existing content item
  14. *
  15. * A new record is defined when <var>$row</var> is passed with the <var>id</var>
  16. * property set to 0.
  17. */
  18.  
  19.  
  20.     function edit&$menu&$components&$lists&$params$option {
  21.         global $mosConfig_live_site;
  22.  
  23.         if $menu->id {
  24.             $title '[ '$lists['componentname'.' ]';
  25.         else {
  26.             $title '';
  27.         }
  28.         ?>
  29.         <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
  30.         <script language="javascript" type="text/javascript">
  31.         function submitbutton(pressbutton) {
  32.             var form = document.adminForm;
  33.             if (pressbutton == 'cancel') {
  34.                 submitform( pressbutton );
  35.                 return;
  36.             }
  37.  
  38.             var comp_links = new Array;
  39.             <?php
  40.             foreach ($components as $row{
  41.                 ?>
  42.                 comp_links[ <?php echo $row->value;?> ] = 'index.php?<?php echo addslashes$row->link );?>';
  43.                 <?php
  44.             }
  45.             ?>
  46.             if ( form.id.value == 0 ) {
  47.                 var comp_id = getSelectedValue( 'adminForm', 'componentid' );
  48.                 form.link.value = comp_links[comp_id];
  49.             } else {
  50.                 form.link.value = comp_links[form.componentid.value];
  51.             }
  52.  
  53.             if ( trim( form.name.value ) == "" ){
  54.                 alert( "<?php echo T_('Item must have a name')?>" );
  55.             } else if (form.componentid.value == ""){
  56.                 alert( "<?php echo T_('Please select a Component')?>" );
  57.             } else {
  58.                 submitform( pressbutton );
  59.             }
  60.         }
  61.         </script>
  62.  
  63.         <form action="index2.php" method="post" name="adminForm">
  64.  
  65.         <table class="adminheading">
  66.         <tr>
  67.             <th>
  68.             <?php echo $menu->id T_('Edit'T_('Add');?> <?php printf(T_('Menu Item :: Component <small><small>%s</small></small>')$title?>
  69.             </th>
  70.         </tr>
  71.         </table>
  72.  
  73.         <table width="100%">
  74.         <tr valign="top">
  75.             <td width="60%">
  76.                 <table class="adminform">
  77.                 <tr>
  78.                     <th colspan="2">
  79.                     <?php echo T_('Details')?>
  80.                     </th>
  81.                 </tr>
  82.                 <tr>
  83.                     <td width="10%" align="right"><?php echo T_('Name:')?></td>
  84.                     <td width="80%">
  85.                     <input class="inputbox" type="text" name="name" size="50" maxlength="100" value="<?php echo htmlspecialchars$menu->nameENT_QUOTES )?>" />
  86.                     </td>
  87.                 </tr>
  88.                 <tr>
  89.                     <td valign="top" align="right"><?php echo T_('Component:')?></td>
  90.                     <td>
  91.                     <?php echo $lists['componentid']?>
  92.                     </td>
  93.                 </tr>
  94.                 <tr>
  95.                     <td width="10%" align="right"><?php echo T_('Url:')?></td>
  96.                     <td width="80%">
  97.                     <?php echo $lists['link']?>
  98.                     </td>
  99.                 </tr>
  100.                 <tr>
  101.                     <td align="right"><?php echo T_('Parent Item:')?></td>
  102.                     <td>
  103.                     <?php echo $lists['parent'];?>
  104.                     </td>
  105.                 </tr>
  106.  
  107.                 <tr>
  108.                     <td valign="top" align="right"><?php echo T_('Ordering:')?></td>
  109.                     <td>
  110.                     <?php echo $lists['ordering']?>
  111.                     </td>
  112.                 </tr>
  113.                 <tr>
  114.                     <td valign="top" align="right"><?php echo T_('Access Level:')?></td>
  115.                     <td>
  116.                     <?php echo $lists['access']?>
  117.                     </td>
  118.                 </tr>
  119.                 <tr>
  120.                     <td valign="top" align="right"><?php echo T_('Published:')?></td>
  121.                     <td>
  122.                     <?php echo $lists['published']?>
  123.                     </td>
  124.                 </tr>
  125.                 <tr>
  126.                     <td colspan="2">&nbsp;</td>
  127.                 </tr>
  128.                 </table>
  129.             </td>
  130.             <td width="40%">
  131.                 <table class="adminform">
  132.                 <tr>
  133.                     <th>
  134.                     <?php echo T_('Parameters')?>
  135.                     </th>
  136.                 </tr>
  137.                 <tr>
  138.                     <td>
  139.                     <?php
  140.                     if ($menu->id{
  141.                         echo $params->render();
  142.                     else {
  143.                         ?>
  144.                         <strong><?php echo T_('Parameter list will be available once you save this New menu item')?></strong>
  145.                         <?php
  146.                     }
  147.                     ?>
  148.                     </td>
  149.                 </tr>
  150.                 </table>
  151.             </td>
  152.         </tr>
  153.         </table>
  154.  
  155.         <input type="hidden" name="option" value="<?php echo $option;?>" />
  156.         <input type="hidden" name="id" value="<?php echo $menu->id?>" />
  157.         <input type="hidden" name="link" value="" />
  158.         <input type="hidden" name="menutype" value="<?php echo $menu->menutype?>" />
  159.         <input type="hidden" name="type" value="<?php echo $menu->type?>" />
  160.         <input type="hidden" name="task" value="" />
  161.         <input type="hidden" name="hidemainmenu" value="0" />
  162.         </form>
  163.         <script language="Javascript" src="<?php echo $mosConfig_live_site;?>/includes/js/overlib_mini.js"></script>
  164.         <?php
  165.     }
  166.  
  167. }
  168. ?>

Documentation generated on Mon, 05 May 2008 16:18:04 +0400 by phpDocumentor 1.4.0