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

