Annotation of /mambo/branches/4.6/administrator/components/com_menus/toolbar.menus.php
Parent Directory
|
Revision Log
Revision 3 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | * @version $Id: toolbar.menus.php,v 1.3 2005/11/11 10:07:35 eliasan Exp $ | ||
| 4 : | * @package Mambo | ||
| 5 : | * @subpackage Menus | ||
| 6 : | * @copyright (C) 2000 - 2005 Miro International Pty Ltd | ||
| 7 : | * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||
| 8 : | * Mambo is Free Software | ||
| 9 : | */ | ||
| 10 : | |||
| 11 : | /** ensure this file is being included by a parent file */ | ||
| 12 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 13 : | |||
| 14 : | require_once( $mainframe->getPath( 'toolbar_html' ) ); | ||
| 15 : | require_once( $mainframe->getPath( 'toolbar_default' ) ); | ||
| 16 : | |||
| 17 : | switch ($task) { | ||
| 18 : | case 'new': | ||
| 19 : | TOOLBAR_menus::_NEW(); | ||
| 20 : | break; | ||
| 21 : | |||
| 22 : | case 'movemenu': | ||
| 23 : | TOOLBAR_menus::_MOVEMENU(); | ||
| 24 : | break; | ||
| 25 : | |||
| 26 : | case 'copymenu': | ||
| 27 : | TOOLBAR_menus::_COPYMENU(); | ||
| 28 : | break; | ||
| 29 : | |||
| 30 : | case 'edit': | ||
| 31 : | $cid = mosGetParam( $_POST, 'cid', array(0) ); | ||
| 32 : | if (!is_array( $cid )) { | ||
| 33 : | $cid = array(0); | ||
| 34 : | } | ||
| 35 : | $path = $mosConfig_absolute_path .'/administrator/components/com_menus/'; | ||
| 36 : | |||
| 37 : | if ( $cid[0] ) { | ||
| 38 : | $query = "SELECT type FROM #__menu WHERE id = $cid[0]"; | ||
| 39 : | $database->setQuery( $query ); | ||
| 40 : | $type = $database->loadResult(); | ||
| 41 : | $item_path = $path . $type .'/'. $type .'.menubar.php'; | ||
| 42 : | |||
| 43 : | if ( $type ) { | ||
| 44 : | if ( file_exists( $item_path ) ) { | ||
| 45 : | require_once( $item_path ); | ||
| 46 : | } else { | ||
| 47 : | TOOLBAR_menus::_EDIT($type); | ||
| 48 : | } | ||
| 49 : | } else { | ||
| 50 : | echo $database->stderr(); | ||
| 51 : | } | ||
| 52 : | } else { | ||
| 53 : | $type = mosGetParam( $_REQUEST, 'type', null ); | ||
| 54 : | $item_path = $path . $type .'/'. $type .'.menubar.php'; | ||
| 55 : | |||
| 56 : | if ( $type ) { | ||
| 57 : | if ( file_exists( $item_path ) ) { | ||
| 58 : | require_once( $item_path ); | ||
| 59 : | } else { | ||
| 60 : | TOOLBAR_menus::_EDIT($type); | ||
| 61 : | } | ||
| 62 : | } else { | ||
| 63 : | TOOLBAR_menus::_EDIT($type); | ||
| 64 : | } | ||
| 65 : | } | ||
| 66 : | break; | ||
| 67 : | |||
| 68 : | default: | ||
| 69 : | $type = trim( mosGetParam( $_REQUEST, 'type', null ) ); | ||
| 70 : | $item_path = $path . $type .'/'. $type .'.menubar.php'; | ||
| 71 : | |||
| 72 : | if ( $type ) { | ||
| 73 : | if ( file_exists( $item_path ) ) { | ||
| 74 : | require_once( $item_path ); | ||
| 75 : | } else { | ||
| 76 : | TOOLBAR_menus::_DEFAULT(); | ||
| 77 : | } | ||
| 78 : | } else { | ||
| 79 : | TOOLBAR_menus::_DEFAULT(); | ||
| 80 : | } | ||
| 81 : | break; | ||
| 82 : | } | ||
| 83 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

