[ Index ]

PHP Cross Reference of Mambo 4.6.5

[ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/administrator/components/com_menus/components/ -> components.menu.html.php (source)

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