| 1 |
<?php |
<?php |
| 2 |
/** |
/** |
| 3 |
* @version $Id: admin.menumanager.php,v 1.1 2005/07/22 01:52:39 eddieajau Exp $ |
* @package Mambo Open Source |
|
* @package Mambo |
|
| 4 |
* @subpackage Menus |
* @subpackage Menus |
| 5 |
* @copyright (C) 2000 - 2005 Miro International Pty Ltd |
* @copyright (C) 2005 - 2006 Mambo Foundation Inc. |
| 6 |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
| 7 |
|
* |
| 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 |
* Mambo is Free Software |
* Mambo is Free Software |
| 11 |
*/ |
*/ |
| 12 |
|
|
| 15 |
|
|
| 16 |
// ensure user has access to this function |
// ensure user has access to this function |
| 17 |
if (!$acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_menumanager' )) { |
if (!$acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_menumanager' )) { |
| 18 |
mosRedirect( 'index2.php', _NOT_AUTH ); |
mosRedirect( 'index2.php', T_('You are not authorized to view this resource.') ); |
| 19 |
} |
} |
| 20 |
|
|
| 21 |
require_once( $mainframe->getPath( 'admin_html' ) ); |
require_once( $mainframe->getPath( 'admin_html' ) ); |
| 206 |
// block to stop renaming of 'mainmenu' menutype |
// block to stop renaming of 'mainmenu' menutype |
| 207 |
if ( $old_menutype == 'mainmenu' ) { |
if ( $old_menutype == 'mainmenu' ) { |
| 208 |
if ( $menutype <> 'mainmenu' ) { |
if ( $menutype <> 'mainmenu' ) { |
| 209 |
echo "<script> alert('You cannot rename the \'mainmenu\' Menu as this will disrupt the proper operation of Mambo'); window.history.go(-1); </script>\n"; |
echo "<script> alert('".T_('You cannot rename the "mainmenu" Menu as this will disrupt the proper operation of Mambo')."'); window.history.go(-1); </script>\n"; |
| 210 |
exit; |
exit; |
| 211 |
} |
} |
| 212 |
} |
} |
| 222 |
$pparser = new mosParameters($menu); |
$pparser = new mosParameters($menu); |
| 223 |
$params = $pparser->getParams(); |
$params = $pparser->getParams(); |
| 224 |
if ( $params->menutype == $menutype ) { |
if ( $params->menutype == $menutype ) { |
| 225 |
echo "<script> alert('A menu already exists with that name - you must enter a unique Menu Name'); window.history.go(-1); </script>\n"; |
echo "<script> alert('".T_('A menu already exists with that name - you must enter a unique Menu Name')."'); window.history.go(-1); </script>\n"; |
| 226 |
exit; |
exit; |
| 227 |
} |
} |
| 228 |
} |
} |
| 257 |
exit(); |
exit(); |
| 258 |
} |
} |
| 259 |
|
|
| 260 |
$msg = 'New Menu created [ '. $menutype .' ]'; |
$msg = sprintf(T_('New Menu created [ %s ]'), $menutype); |
| 261 |
break; |
break; |
| 262 |
|
|
| 263 |
default: |
default: |
| 311 |
$database->query(); |
$database->query(); |
| 312 |
} |
} |
| 313 |
|
|
| 314 |
$msg = 'Menu Items & Modules updated'; |
$msg = T_('Menu Items & Modules updated'); |
| 315 |
break; |
break; |
| 316 |
} |
} |
| 317 |
|
|
| 325 |
global $database; |
global $database; |
| 326 |
|
|
| 327 |
if ( $type == 'mainmenu' ) { |
if ( $type == 'mainmenu' ) { |
| 328 |
echo "<script> alert('You cannot delete the \'mainmenu\' menu as it is core menu'); window.history.go(-1); </script>\n"; |
echo "<script> alert('".T_('You cannot delete the "mainmenu" menu as it is a core menu')."'); window.history.go(-1); </script>\n"; |
| 329 |
exit(); |
exit(); |
| 330 |
} |
} |
| 331 |
|
|
| 375 |
global $database; |
global $database; |
| 376 |
|
|
| 377 |
if ( $type == 'mainmenu' ) { |
if ( $type == 'mainmenu' ) { |
| 378 |
echo "<script> alert('You cannot delete the \'mainmenu\' menu as it is core menu'); window.history.go(-1); </script>\n"; |
echo "<script> alert('".T_('You cannot delete the "mainmenu" menu as it is a core menu')."'); window.history.go(-1); </script>\n"; |
| 379 |
exit(); |
exit(); |
| 380 |
} |
} |
| 381 |
|
|
| 466 |
$pparser = new mosParameters($menu); |
$pparser = new mosParameters($menu); |
| 467 |
$params = $pparser->getParams(); |
$params = $pparser->getParams(); |
| 468 |
if ( $params->menutype == $menu_name ) { |
if ( $params->menutype == $menu_name ) { |
| 469 |
echo "<script> alert('A menu already exists with that name - you must enter a unique Menu Name'); window.history.go(-1); </script>\n"; |
echo "<script> alert('".T_('A menu with that name already exists - you must enter a unique Menu Name')."'); window.history.go(-1); </script>\n"; |
| 470 |
exit; |
exit; |
| 471 |
} |
} |
| 472 |
} |
} |
| 526 |
exit(); |
exit(); |
| 527 |
} |
} |
| 528 |
|
|
| 529 |
$msg = 'Copy of Menu `'. $type .'` created, consisting of '. $total .' items'; |
$msg = sprintf(Tn_('Copy of Menu `%s` created, consisting of %d item', 'Copy of Menu `%s` created, consisting of %d items', $total), $type, $total); |
| 530 |
mosRedirect( 'index2.php?option=' . $option, $msg ); |
mosRedirect( 'index2.php?option=' . $option, $msg ); |
| 531 |
} |
} |
| 532 |
|
|