--- mambo/branches/4.6/administrator/components/com_menus/admin.menus.php 2006/01/26 20:11:56 194 +++ mambo/branches/4.6/administrator/components/com_menus/admin.menus.php 2006/05/14 21:46:22 510 @@ -1,12 +1,14 @@ parent; $list = @$children[$pt] ? $children[$pt] : array(); array_push( $list, $v ); @@ -225,7 +234,7 @@ case 'newsfeed_link': $edit = 'index2.php?option=com_newsfeeds&task=edit&hidemainmenu=1A&id=' . $mitem->componentid; - $list[$i]->descrip = 'Edit this Newsfeed'; + $list[$i]->descrip = 'Edit this News Feed'; $mitem->link .= '&Itemid='. $mitem->id; break; @@ -655,7 +664,7 @@ $curr->load( $id ); $curr->id = NULL; if ( !$curr->store() ) { - echo "\n"; + echo "\n"; exit(); } $cidref[] = array($id, $curr->id); @@ -676,7 +685,7 @@ $curr->menutype = $menu; $curr->ordering = '9999'; if ( !$curr->store() ) { - echo "\n"; + echo "\n"; exit(); } $curr->updateOrder( "menutype='". $curr->menutype ."' AND parent='". $curr->parent ."'" ); @@ -708,15 +717,12 @@ function saveOrder( &$cid, $menutype ) { global $database; - - $total = count( $cid ); $order = mosGetParam( $_POST, 'order', array(0) ); $row = new mosMenu( $database ); - $conditions = array(); - + $parents = array(); // update ordering values - for( $i=0; $i < $total; $i++ ) { - $row->load( $cid[$i] ); + foreach ($cid as $i=>$ciditem) { + $row->load( $ciditem ); if ($row->ordering != $order[$i]) { $row->ordering = $order[$i]; if (!$row->store()) { @@ -724,21 +730,12 @@ exit(); } // remember to updateOrder this group - $condition = "menutype = '$menutype' AND parent = '$row->parent' AND published >= 0"; - $found = false; - foreach ( $conditions as $cond ) - if ($cond[1]==$condition) { - $found = true; - break; - } // if - if (!$found) $conditions[] = array($row->id, $condition); - } // for - } // for - + $parents[$row->parent] = $row->id; + } + } // execute updateOrder for each group - foreach ( $conditions as $cond ) { - $row->load( $cond[0] ); - $row->updateOrder( $cond[1] ); + foreach ($parents as $parent=>$rowid) { + $row->updateOrder("menutype = '$menutype' AND parent = '$parent' AND published >= 0"); } // foreach $msg = T_('New ordering saved');