$result=db_query('SELECT m.*, me.disabled FROM {menu} m LEFT JOIN {menu_edit} me ON m.path = me.path WHERE visible = 1 OR (disabled = 1 AND admin = 0) ORDER BY mleft');
$result=db_query('SELECT m.*, me.disabled FROM {menu} m LEFT JOIN {menu_custom} me ON m.path = me.path WHERE visible = 1 OR (disabled = 1 AND admin = 0) ORDER BY mleft');
$map=arg();
$rows=array();
while($item=db_fetch_object($result)){
...
...
@@ -201,17 +220,17 @@ function menu_overview() {
*/
functionmenu_flip_item($visible,$mid,$path=NULL){
if(isset($mid)){
$parent=menu_get_item_by_mid($mid);
$item=menu_get_item_by_mid($mid);
}
elseif(isset($path)){
$parent=menu_get_item($path);
$item=menu_get_item($path);
}
if(isset($parent)&&$parent->access){
$result=db_query('SELECT * FROM {menu} WHERE %d <= mleft AND mright <= %d',$parent->mleft,$parent->mright);
if(isset($item)&&$item->access){
$result=db_query('SELECT child.*, parent.path AS parent_path FROM {menu} child INNER JOIN {menu} parent ON child.pid = parent.mid WHERE %d <= child.mleft AND child.mright <= %d',$item->mleft,$item->mright);
while($item=db_fetch_object($result)){
$update_result=db_query("UPDATE {menu_edit} SET disabled = %d WHERE path = '%s'",!$visible,$item->path);
$update_result=db_query("UPDATE {menu_custom} SET disabled = %d WHERE path = '%s'",!$visible,$item->path);
$sql='SELECT m.*, me.disabled FROM {menu} m LEFT JOIN {menu_edit} me ON m.path = me.path WHERE (m.visible = 1 OR (me.disabled = 1 AND me.admin = 0))';
$sql='SELECT m.*, me.disabled FROM {menu} m LEFT JOIN {menu_custom} me ON m.path = me.path WHERE (m.visible = 1 OR (me.disabled = 1 AND me.admin = 0))';
if(!$mid){
$params=array();
}
...
...
@@ -398,11 +417,11 @@ function menu_edit_item_save($edit) {
$parent=$edit['pid']?db_result(db_query('SELECT path FROM {menu} WHERE mid = %d',$edit['pid'])):'';
$t_args=array('%title'=>$edit['title']);
if(!empty($edit['original_path'])&&db_num_rows(db_query("SELECT * FROM {menu_edit} WHERE path='%s'",$edit['original_path']))){
db_query("UPDATE {menu_edit} SET parent = '%s', title = '%s', description = '%s', weight = %d, type = %d, path = '%s' WHERE path = '%s'",$parent,$edit['title'],$edit['description'],$edit['weight'],$edit['type'],isset($edit['path'])?$edit['path']:$edit['original_path'],$edit['original_path']);
if(!empty($edit['original_path'])&&db_num_rows(db_query("SELECT * FROM {menu_custom} WHERE path='%s'",$edit['original_path']))){
db_query("UPDATE {menu_custom} SET parent = '%s', title = '%s', description = '%s', weight = %d, type = %d, path = '%s' WHERE path = '%s'",$parent,$edit['title'],$edit['description'],$edit['weight'],$edit['type'],isset($edit['path'])?$edit['path']:$edit['original_path'],$edit['original_path']);