[ Index ]

PHP Cross Reference of Mambo 4.6.5

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

title

Body

[close]

/administrator/components/com_menus/content_section/ -> content_section.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 content_section_menu_html {
  27  
  28  	function editSection( &$menu, &$lists, &$params, $option ) {
  29          global $mosConfig_live_site;
  30          ?>
  31          <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
  32          <script type="text/javascript">
  33  		function submitbutton(pressbutton) {
  34              if (pressbutton == 'cancel') {
  35                  submitform( pressbutton );
  36                  return;
  37              }
  38              var form = document.adminForm;
  39              <?php
  40              if ( !$menu->id ) {
  41                  ?>
  42                  if ( getSelectedValue( 'adminForm', 'componentid' ) < 1 ) {
  43                      alert( '<?php echo T_('You must select a Section'); ?>' );
  44                      return;
  45                  }
  46  
  47                  form.link.value = "index.php?option=com_content&task=section&id=" + form.componentid.value;
  48                  if ( form.name.value == '' ) {
  49                      form.name.value = form.componentid.options[form.componentid.selectedIndex].text;
  50                  }
  51                  submitform( pressbutton );
  52                  <?php
  53              } else {
  54                  ?>
  55                  if ( form.name.value == '' ) {
  56                      alert( '<?php echo T_('This Menu item must have a title'); ?>' );
  57                  } else {
  58                      submitform( pressbutton );
  59                  }
  60                  <?php
  61              }
  62              ?>
  63  
  64  
  65          }
  66          </script>
  67          <form action="index2.php" method="post" name="adminForm">
  68  
  69          <table class="adminheading">
  70          <tr>
  71              <th>
  72              <?php echo $menu->id ? T_('Edit') : T_('Add');?> <?php echo T_('Menu Item :: Table - Content Section'); ?>
  73              </th>
  74          </tr>
  75          </table>
  76  
  77          <table width="100%">
  78          <tr valign="top">
  79              <td width="60%">
  80                  <table class="adminform">
  81                  <tr>
  82                      <th colspan="3">
  83                      <?php echo T_('Details'); ?>
  84                      </th>
  85                  </tr>
  86                  <tr>
  87                      <td width="10%" align="right" valign="top"><?php echo T_('Name:'); ?></td>
  88                      <td width="200px">
  89                      <input type="text" name="name" size="30" maxlength="100" class="inputbox" value="<?php echo $menu->name; ?>"/>
  90                      </td>
  91                      <td>
  92                      <?php
  93                      if ( !$menu->id ) {
  94                          echo mosToolTip( T_('If you leave this blank the Section name will be automatically used') );
  95                      }
  96                      ?>
  97                      </td>
  98                  </tr>
  99                  <tr>
 100                      <td align="right" valign="top"><?php echo T_('Section:'); ?></td>
 101                      <td colspan="2">
 102                      <?php echo $lists['componentid']; ?>
 103                      </td>
 104                  </tr>
 105                  <tr>
 106                      <td align="right"><?php echo T_('Url:'); ?></td>
 107                      <td colspan="2">
 108                      <?php echo $lists['link']; ?>
 109                      </td>
 110                  </tr>
 111                  <tr>
 112                      <td align="right"><?php echo T_('Parent Item:'); ?></td>
 113                      <td colspan="2">
 114                      <?php echo $lists['parent'];?>
 115                      </td>
 116                  </tr>
 117                  <tr>
 118                      <td valign="top" align="right"><?php echo T_('Ordering:'); ?></td>
 119                      <td colspan="2">
 120                      <?php echo $lists['ordering']; ?>
 121                      </td>
 122                  </tr>
 123                  <tr>
 124                      <td valign="top" align="right"><?php echo T_('Access Level:'); ?></td>
 125                      <td colspan="2">
 126                      <?php echo $lists['access']; ?>
 127                      </td>
 128                  </tr>
 129                  <tr>
 130                      <td valign="top" align="right"><?php echo T_('Published:'); ?></td>
 131                      <td colspan="2">
 132                      <?php echo $lists['published']; ?>
 133                      </td>
 134                  </tr>
 135                  <tr>
 136                      <td colspan="3">&nbsp;</td>
 137                  </tr>
 138                  </table>
 139              </td>
 140              <td width="40%">
 141                  <table class="adminform">
 142                  <tr>
 143                      <th>
 144                      <?php echo T_('Parameters'); ?>
 145                      </th>
 146                  </tr>
 147                  <tr>
 148                      <td>
 149                      <?php echo $params->render();?>
 150                      </td>
 151                  </tr>
 152                  </table>
 153              </td>
 154          </tr>
 155          </table>
 156  
 157          <input type="hidden" name="option" value="<?php echo $option;?>" />
 158          <input type="hidden" name="id" value="<?php echo $menu->id; ?>" />
 159          <input type="hidden" name="menutype" value="<?php echo $menu->menutype; ?>" />
 160          <input type="hidden" name="type" value="<?php echo $menu->type; ?>" />
 161          <input type="hidden" name="task" value="" />
 162          <input type="hidden" name="hidemainmenu" value="0" />
 163          </form>
 164          <script src="<?php echo $mosConfig_live_site;?>/includes/js/overlib_mini.js" type="text/javascript"></script>
 165          <?php
 166      }
 167  }
 168  ?>