| 2 |
/** |
/** |
| 3 |
* @package Mambo |
* @package Mambo |
| 4 |
* @subpackage Categories |
* @subpackage Categories |
|
* @copyright Refer to copyright.php |
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
|
| 5 |
* @author Mambo Foundation Inc see README.php |
* @author Mambo Foundation Inc see README.php |
| 6 |
|
* @copyright Mambo Foundation Inc. |
| 7 |
|
* See COPYRIGHT.php for copyright notices and details. |
| 8 |
|
* @license GNU/GPL Version 2, see LICENSE.php |
| 9 |
|
* Mambo is free software; you can redistribute it and/or |
| 10 |
|
* modify it under the terms of the GNU General Public License |
| 11 |
|
* as published by the Free Software Foundation; version 2 of the License. |
| 12 |
*/ |
*/ |
| 13 |
|
|
| 14 |
/** ensure this file is being included by a parent file */ |
/** ensure this file is being included by a parent file */ |
| 20 |
// get parameters from the URL or submitted form |
// get parameters from the URL or submitted form |
| 21 |
$section = mosGetParam( $_REQUEST, 'section', 'content' ); |
$section = mosGetParam( $_REQUEST, 'section', 'content' ); |
| 22 |
$cid = mosGetParam( $_REQUEST, 'cid', array(0) ); |
$cid = mosGetParam( $_REQUEST, 'cid', array(0) ); |
| 23 |
if (!is_array( $cid )) { |
if (!$cid) $id = mosGetParam( $_REQUEST, 'id', 0 ); |
|
$cid = array(0); |
|
|
} |
|
| 24 |
|
|
| 25 |
switch ($task) { |
switch ($task) { |
| 26 |
case 'new': |
case 'new': |
| 195 |
; |
; |
| 196 |
$database->setQuery( $query ); |
$database->setQuery( $query ); |
| 197 |
$rows = $database->loadObjectList(); |
$rows = $database->loadObjectList(); |
| 198 |
|
if ($rows) { |
| 199 |
|
foreach($rows as $row) { |
| 200 |
|
$row->name = htmlspecialchars( str_replace( '&', '&', $row->name ) ); |
| 201 |
|
$row->title = htmlspecialchars( str_replace( '&', '&', $row->title ) ); |
| 202 |
|
} |
| 203 |
|
} |
| 204 |
if ($database->getErrorNum()) { |
if ($database->getErrorNum()) { |
| 205 |
echo $database->stderr(); |
echo $database->stderr(); |
| 206 |
return; |
return; |
| 862 |
} |
} |
| 863 |
} |
} |
| 864 |
// execute updateOrder for each group |
// execute updateOrder for each group |
| 865 |
foreach ($sections as $section=>$rowid) { |
foreach ($sections as $sectionid=>$rowid) { |
| 866 |
$row->updateOrder("section='$section'"); |
$row->updateOrder("section='$sectionid'"); |
| 867 |
} // foreach |
} // foreach |
| 868 |
$msg = T_('New ordering saved'); |
$msg = T_('New ordering saved'); |
| 869 |
mosRedirect( 'index2.php?option=com_categories§ion='. $section, $msg ); |
mosRedirect( 'index2.php?option=com_categories§ion='. $section, $msg ); |