[ Index ]

PHP Cross Reference of Mambo 4.6.5

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

title

Body

[close]

/administrator/components/com_modules/ -> toolbar.modules.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  /** 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  require_once( $mainframe->getPath( 'toolbar_html' ) );
  21  switch ($task) {
  22  
  23      case 'editA':
  24      case 'edit':
  25          $cid = mosGetParam( $_POST, 'cid', 0 );
  26          if ( !is_array( $cid ) ){
  27              $mid = mosGetParam( $_POST, 'id', 0 );;
  28          } else {
  29              $mid = $cid[0];
  30          }
  31          
  32          $published = 0;
  33          if ( $mid ) {
  34              // @RawSQLUse, trivial_implementation, SELECT
  35              $query = "SELECT published FROM #__modules WHERE id='$mid'";
  36              $database->setQuery( $query );
  37              $published = $database->loadResult();
  38          }
  39          $cur_template = $mainframe->getTemplate();
  40          TOOLBAR_modules::_EDIT( $cur_template, $published );
  41          break;
  42  
  43      case 'new':
  44          TOOLBAR_modules::_NEW();
  45          break;
  46  
  47      default:
  48          TOOLBAR_modules::_DEFAULT();
  49          break;
  50  }
  51  ?>