Changeset 1182 in ExiteCMS for trunk/administration/modules.php
- Timestamp:
- 12/25/07 17:32:57 (4 years ago)
- File:
-
- 1 edited
-
trunk/administration/modules.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/administration/modules.php
r1166 r1182 84 84 85 85 // determine to which menu panel this link needs to be added 86 $link_panel = ($mod_link['panel'] != "" ? ($mod_link['panel']."_") : "").'menu_panel'; 87 88 // check if this panel is installed 89 $result = dbquery("SELECT panel_id FROM ".$db_prefix."panels WHERE panel_filename = '$link_panel'"); 90 if (dbrows($result) == 0) { 91 // if the panel doesn't exist, try to find another menu panel (if multiple are installed, pick the first one in the ordered list) 92 $result = dbquery("SELECT panel_filename FROM ".$db_prefix."panels WHERE panel_filename LIKE '%_menu_panel' ORDER BY panel_order LIMIT 1"); 93 if (dbrows($result)) { 94 $data = dbarray($result); 95 $link_panel = $data['panel_filename']; 96 } else { 97 // if still not found, fall back to the CMS default 98 $link_panel = "main_menu_panel"; 99 } 86 if (isset($mod_link['panel']) && $mod_link['panel'] != "") { 87 if (substr($mod_link['panel'],-4) != ".php") { 88 $link_panel = $mod_link['panel']."/".$mod_link['panel'].".php"; 89 } 90 // check if this panel is installed 91 $result = dbquery("SELECT panel_id FROM ".$db_prefix."panels WHERE panel_filename = '$link_panel'"); 92 if (dbrows($result) == 0) { 93 // if the panel doesn't exist, try to find another menu panel (if multiple are installed, pick the first one in the ordered list) 94 $result = dbquery("SELECT panel_filename FROM ".$db_prefix."panels WHERE panel_filename LIKE '%_menu_panel.php' ORDER BY panel_order LIMIT 1"); 95 if (dbrows($result)) { 96 $data = dbarray($result); 97 $link_panel = $data['panel_filename']; 98 } else { 99 // if still not found, fall back to the CMS default 100 $link_panel = "main_menu_panel/main_menu_panel.php"; 101 } 102 } 103 } else { 104 // use the CMS default 105 $link_panel = "main_menu_panel/main_menu_panel.php"; 100 106 } 101 107 … … 213 219 if ($link_url{0} == "/") $link_url = substr($link_url,1); 214 220 215 // determine to which menu panel this link has been added 216 $link_panel = ($mod_link['panel'] != "" ? ($mod_link['panel']."_") : "").'menu_panel'; 221 // determine to which menu panel this link needs to be added 222 if (isset($mod_link['panel']) && $mod_link['panel'] != "") { 223 if (substr($mod_link['panel'],-4) != ".php") { 224 $link_panel = $mod_link['panel']."/".$mod_link['panel'].".php"; 225 } 226 // check if this panel is installed 227 $result = dbquery("SELECT panel_id FROM ".$db_prefix."panels WHERE panel_filename = '$link_panel'"); 228 if (dbrows($result) == 0) { 229 // if the panel doesn't exist, try to find another menu panel (if multiple are installed, pick the first one in the ordered list) 230 $result = dbquery("SELECT panel_filename FROM ".$db_prefix."panels WHERE panel_filename LIKE '%_menu_panel.php' ORDER BY panel_order LIMIT 1"); 231 if (dbrows($result)) { 232 $data = dbarray($result); 233 $link_panel = $data['panel_filename']; 234 } else { 235 // if still not found, fall back to the CMS default 236 $link_panel = "main_menu_panel/main_menu_panel.php"; 237 } 238 } 239 } else { 240 // use the CMS default 241 $link_panel = "main_menu_panel/main_menu_panel.php"; 242 } 217 243 218 244 // if this panel doesn't exist (anymore), use the default menu panel 219 245 $result = dbquery("SELECT panel_id FROM ".$db_prefix."panels WHERE panel_filename = '$link_panel'"); 220 if (dbrows($result) == 0) $link_panel = "main_menu_panel ";246 if (dbrows($result) == 0) $link_panel = "main_menu_panel/main_menu_panel.php"; 221 247 222 248 // check if we have a menu entry for this link … … 334 360 335 361 // determine to which menu panel this link needs to be added 336 $link_panel = ($mod_link['panel'] != "" ? ($mod_link['panel']."_") : "").'menu_panel'; 362 if (isset($mod_link['panel']) && $mod_link['panel'] != "") { 363 if (substr($mod_link['panel'],-4) != ".php") { 364 $link_panel = $mod_link['panel']."/".$mod_link['panel'].".php"; 365 } 366 // check if this panel is installed 367 $result = dbquery("SELECT panel_id FROM ".$db_prefix."panels WHERE panel_filename = '$link_panel'"); 368 if (dbrows($result) == 0) { 369 // if the panel doesn't exist, try to find another menu panel (if multiple are installed, pick the first one in the ordered list) 370 $result = dbquery("SELECT panel_filename FROM ".$db_prefix."panels WHERE panel_filename LIKE '%_menu_panel.php' ORDER BY panel_order LIMIT 1"); 371 if (dbrows($result)) { 372 $data = dbarray($result); 373 $link_panel = $data['panel_filename']; 374 } else { 375 // if still not found, fall back to the CMS default 376 $link_panel = "main_menu_panel/main_menu_panel.php"; 377 } 378 } 379 } else { 380 // use the CMS default 381 $link_panel = "main_menu_panel/main_menu_panel.php"; 382 } 337 383 338 384 // if the panel doesn't exist, use the default menu panel 339 385 $result = dbquery("SELECT panel_id FROM ".$db_prefix."panels WHERE panel_filename = '$link_panel'"); 340 if (dbrows($result) == 0) $link_panel = "main_menu_panel ";386 if (dbrows($result) == 0) $link_panel = "main_menu_panel/main_menu_panel.php"; 341 387 342 388 // check if the menu link is already defined
Note: See TracChangeset
for help on using the changeset viewer.
