| 116 |
; |
; |
| 117 |
$database->setQuery( $query ); |
$database->setQuery( $query ); |
| 118 |
$unpublished = $database->loadObjectList(); |
$unpublished = $database->loadObjectList(); |
| 119 |
|
if (!$unpublished) $unpublished = array(); |
| 120 |
|
|
| 121 |
// Query to get trash menu item counts |
// Query to get trash menu item counts |
| 122 |
$query = "SELECT a.menutype, count( a.menutype ) as num" |
$query = "SELECT a.menutype, count( a.menutype ) as num" |
| 127 |
; |
; |
| 128 |
$database->setQuery( $query ); |
$database->setQuery( $query ); |
| 129 |
$trash = $database->loadObjectList(); |
$trash = $database->loadObjectList(); |
| 130 |
|
if (!$trash) $trash = array(); |
| 131 |
|
|
| 132 |
for( $i = 0; $i < $total; $i++ ) { |
for( $i = 0; $i < $total; $i++ ) { |
| 133 |
// adds published count |
// adds published count |
| 204 |
// block to stop renaming of 'mainmenu' menutype |
// block to stop renaming of 'mainmenu' menutype |
| 205 |
if ( $old_menutype == 'mainmenu' ) { |
if ( $old_menutype == 'mainmenu' ) { |
| 206 |
if ( $menutype <> 'mainmenu' ) { |
if ( $menutype <> 'mainmenu' ) { |
| 207 |
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"; |
| 208 |
exit; |
exit; |
| 209 |
} |
} |
| 210 |
} |
} |
| 217 |
$database->setQuery( $query ); |
$database->setQuery( $query ); |
| 218 |
$menus = $database->loadResultArray(); |
$menus = $database->loadResultArray(); |
| 219 |
foreach ( $menus as $menu ) { |
foreach ( $menus as $menu ) { |
| 220 |
$params = mosParseParams( $menu ); |
$pparser = new mosParameters($menu); |
| 221 |
|
$params = $pparser->getParams(); |
| 222 |
if ( $params->menutype == $menutype ) { |
if ( $params->menutype == $menutype ) { |
| 223 |
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"; |
| 224 |
exit; |
exit; |
| 225 |
} |
} |
| 226 |
} |
} |
| 255 |
exit(); |
exit(); |
| 256 |
} |
} |
| 257 |
|
|
| 258 |
$msg = 'New Menu created [ '. $menutype .' ]'; |
$msg = sprintf(T_('New Menu created [ %s ]'), $menutype); |
| 259 |
break; |
break; |
| 260 |
|
|
| 261 |
default: |
default: |
| 273 |
$row->load( $module ); |
$row->load( $module ); |
| 274 |
|
|
| 275 |
$save = 0; |
$save = 0; |
| 276 |
$params = mosParseParams( $row->params ); |
$pparser = new mosParameters($row->params); |
| 277 |
|
$params = $pparser->getParams(); |
| 278 |
if ( $params->menutype == $old_menutype ) { |
if ( $params->menutype == $old_menutype ) { |
| 279 |
$params->menutype = $menutype; |
$params->menutype = $menutype; |
| 280 |
$save = 1; |
$save = 1; |
| 309 |
$database->query(); |
$database->query(); |
| 310 |
} |
} |
| 311 |
|
|
| 312 |
$msg = 'Menu Items & Modules updated'; |
$msg = T_('Menu Items & Modules updated'); |
| 313 |
break; |
break; |
| 314 |
} |
} |
| 315 |
|
|
| 323 |
global $database; |
global $database; |
| 324 |
|
|
| 325 |
if ( $type == 'mainmenu' ) { |
if ( $type == 'mainmenu' ) { |
| 326 |
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"; |
| 327 |
exit(); |
exit(); |
| 328 |
} |
} |
| 329 |
|
|
| 348 |
foreach ( $mods as $module ) { |
foreach ( $mods as $module ) { |
| 349 |
$row = new mosModule( $database ); |
$row = new mosModule( $database ); |
| 350 |
$row->load( $module ); |
$row->load( $module ); |
| 351 |
|
$pparser = new mosParameters($row->params); |
| 352 |
$params = mosParseParams( $row->params ); |
$params = $pparser->getParams(); |
| 353 |
if ( $params->menutype == $type ) { |
if ( $params->menutype == $type ) { |
| 354 |
$mid[] = $module; |
$mid[] = $module; |
| 355 |
} |
} |
| 373 |
global $database; |
global $database; |
| 374 |
|
|
| 375 |
if ( $type == 'mainmenu' ) { |
if ( $type == 'mainmenu' ) { |
| 376 |
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"; |
| 377 |
exit(); |
exit(); |
| 378 |
} |
} |
| 379 |
|
|
| 461 |
$database->setQuery( $query ); |
$database->setQuery( $query ); |
| 462 |
$menus = $database->loadResultArray(); |
$menus = $database->loadResultArray(); |
| 463 |
foreach ( $menus as $menu ) { |
foreach ( $menus as $menu ) { |
| 464 |
$params = mosParseParams( $menu ); |
$pparser = new mosParameters($menu); |
| 465 |
|
$params = $pparser->getParams(); |
| 466 |
if ( $params->menutype == $menu_name ) { |
if ( $params->menutype == $menu_name ) { |
| 467 |
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"; |
| 468 |
exit; |
exit; |
| 469 |
} |
} |
| 470 |
} |
} |
| 524 |
exit(); |
exit(); |
| 525 |
} |
} |
| 526 |
|
|
| 527 |
$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); |
| 528 |
mosRedirect( 'index2.php?option=' . $option, $msg ); |
mosRedirect( 'index2.php?option=' . $option, $msg ); |
| 529 |
} |
} |
| 530 |
|
|