[ Index ]

PHP Cross Reference of Mambo 4.6.5

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

title

Body

[close]

/administrator/components/com_mambots/ -> toolbar.mambots.html.php (source)

   1  <?php
   2  /**
   3  * @package Mambo
   4  * @subpackage Mambots
   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  class TOOLBAR_modules {
  18      /**
  19      * Draws the menu for Editing an existing module
  20      */
  21      function _EDIT() {
  22          global $id;
  23  
  24          mosMenuBar::startTable();
  25          mosMenuBar::save();
  26          mosMenuBar::spacer();
  27          mosMenuBar::apply();
  28          mosMenuBar::spacer();
  29          if ( $id ) {
  30              // for existing content items the button is renamed `close`
  31              mosMenuBar::cancel( 'cancel', T_('Close') );
  32          } else {
  33              mosMenuBar::cancel();
  34          }
  35          mosMenuBar::spacer();
  36          if ($GLOBALS['task'] == 'new') {
  37              mosMenuBar::help( 'new' );
  38          } else {
  39              if ($_POST) {
  40                  $cid = (int) $GLOBALS['cid'][0];
  41              } else {
  42                  $cid = (int) $_GET['id'];
  43              }
  44              $database =& mamboDatabase::getInstance();
  45              // @RawSQLUse, trivial_implementation, SELECT
  46              $database->setQuery('select element from #__mambots where id = '.$cid);
  47              $result = $database->loadResult();
  48              mosMenuBar::help( $result ? $result : 'edit' );
  49          }
  50          mosMenuBar::endTable();
  51      }
  52  
  53      function _DEFAULT() {
  54          mosMenuBar::startTable();
  55          mosMenuBar::publishList();
  56          mosMenuBar::spacer();
  57          mosMenuBar::unpublishList();
  58          mosMenuBar::spacer();
  59          mosMenuBar::addNewX();
  60          mosMenuBar::spacer();
  61          mosMenuBar::editListX();
  62          mosMenuBar::spacer();
  63          mosMenuBar::deleteList();
  64          mosMenuBar::spacer();
  65          mosMenuBar::help( 'manager' );
  66          mosMenuBar::endTable();
  67      }
  68  }
  69  ?>