[ Index ]

PHP Cross Reference of Mambo 4.6.5

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

title

Body

[close]

/administrator/components/com_modules/ -> toolbar.modules.html.php (source)

   1  <?php
   2  /**
   3  * @package Mambo
   4  * @subpackage Modules
   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 a New module
  20      */
  21     
  22      function _NEW()    {
  23          mosMenuBar::startTable();
  24          mosMenuBar::preview( 'modulewindow' );
  25          mosMenuBar::spacer();
  26          mosMenuBar::save();
  27          mosMenuBar::spacer();
  28          mosMenuBar::apply();
  29          mosMenuBar::spacer();
  30          mosMenuBar::cancel();
  31          mosMenuBar::spacer();
  32          mosMenuBar::help( 'new' );
  33          mosMenuBar::endTable();
  34      }
  35  
  36      /**
  37      * Draws the menu for Editing an existing module
  38      */
  39      function _EDIT( $cur_template, $publish ) {
  40          global $id;
  41  
  42          mosMenuBar::startTable();
  43          mosMenuBar::preview( 'modulewindow' );
  44          mosMenuBar::spacer();
  45          mosMenuBar::save();
  46          mosMenuBar::spacer();
  47          mosMenuBar::apply();
  48          mosMenuBar::spacer();
  49          if ( $id ) {
  50              // for existing content items the button is renamed `close`
  51              mosMenuBar::cancel( 'cancel', T_('Close') );
  52          } else {
  53              mosMenuBar::cancel();
  54          }
  55          mosMenuBar::spacer();
  56  
  57          $result = '';
  58          if ($_POST) {
  59              $cid = (int) $GLOBALS['cid'][0];
  60          } else {
  61              $cid = (int) $_GET['id'];
  62          }
  63          $database =& mamboDatabase::getInstance();
  64          // @RawSQLUse, trivial_implementation, SELECT, CONCEPT
  65          $database->setQuery('select module from #__modules where id = '.$cid);
  66          $result = substr($database->loadResult(), 4);
  67  
  68          mosMenuBar::help( $result ? $result : 'edit' );
  69          mosMenuBar::endTable();
  70      }
  71      function _DEFAULT() {
  72          mosMenuBar::startTable();
  73          mosMenuBar::publishList();
  74          mosMenuBar::spacer();
  75          mosMenuBar::unpublishList();
  76          mosMenuBar::spacer();
  77          mosMenuBar::custom( 'copy', 'copy.png', 'copy_f2.png', T_('Copy'), true );
  78          mosMenuBar::spacer();
  79          mosMenuBar::addNewX();
  80          mosMenuBar::spacer();
  81          mosMenuBar::editListX();
  82          mosMenuBar::spacer();
  83          mosMenuBar::deleteList();
  84          mosMenuBar::spacer();
  85          mosMenuBar::help( 'admin.manager' );
  86          mosMenuBar::endTable();
  87      }
  88  }
  89  ?>