Changeset 1281 in ExiteCMS for trunk/administration/modules.php
- Timestamp:
- 02/14/08 15:10:07 (4 years ago)
- File:
-
- 1 edited
-
trunk/administration/modules.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/administration/modules.php
r1182 r1281 44 44 45 45 // check if it exists, if so, bail out 46 if (dbrows($result)) fallback(FUSION_SELF.$aidlink); 46 $result = dbquery("SELECT * FROM ".$db_prefix."modules WHERE mod_folder='$module'"); 47 if (dbrows($result) || !is_dir(PATH_MODULES.$module)) fallback(FUSION_SELF.$aidlink); 47 48 48 49 // load the module installer … … 95 96 if (dbrows($result)) { 96 97 $data = dbarray($result); 97 $link_panel = $data['panel_filename'];98 $link_panel = substr($data['panel_filename'],0,strpos($data['panel_filename'], "/")); 98 99 } else { 99 100 // if still not found, fall back to the CMS default 100 $link_panel = "main_menu_panel/main_menu_panel.php"; 101 } 101 $link_panel = "main_menu_panel"; 102 } 103 } else { 104 $link_panel = $mod_link['panel']; 102 105 } 103 106 } else { 104 107 // use the CMS default 105 $link_panel = "main_menu_panel /main_menu_panel.php";108 $link_panel = "main_menu_panel"; 106 109 } 107 110 … … 218 221 $link_url = str_replace("../","",MODULES).$mod_folder."/".$mod_link['url']; 219 222 if ($link_url{0} == "/") $link_url = substr($link_url,1); 220 223 221 224 // determine to which menu panel this link needs to be added 222 225 if (isset($mod_link['panel']) && $mod_link['panel'] != "") { … … 231 234 if (dbrows($result)) { 232 235 $data = dbarray($result); 233 $link_panel = $data['panel_filename'];236 $link_panel = substr($data['panel_filename'],0,strpos($data['panel_filename'], "/")); 234 237 } else { 235 238 // if still not found, fall back to the CMS default 236 $link_panel = "main_menu_panel/main_menu_panel.php"; 237 } 239 $link_panel = "main_menu_panel"; 240 } 241 } else { 242 $link_panel = $mod_link['panel']; 238 243 } 239 244 } else { 240 245 // use the CMS default 241 $link_panel = "main_menu_panel/main_menu_panel.php"; 242 } 243 244 // if this panel doesn't exist (anymore), use the default menu panel 245 $result = dbquery("SELECT panel_id FROM ".$db_prefix."panels WHERE panel_filename = '$link_panel'"); 246 if (dbrows($result) == 0) $link_panel = "main_menu_panel/main_menu_panel.php"; 246 $link_panel = "main_menu_panel"; 247 } 247 248 248 249 // check if we have a menu entry for this link … … 371 372 if (dbrows($result)) { 372 373 $data = dbarray($result); 373 $link_panel = $data['panel_filename'];374 $link_panel = substr($data['panel_filename'],0,strpos($data['panel_filename'], "/")); 374 375 } else { 375 376 // if still not found, fall back to the CMS default 376 $link_panel = "main_menu_panel/main_menu_panel.php"; 377 } 377 $link_panel = "main_menu_panel"; 378 } 379 } else { 380 $link_panel = $mod_link['panel']; 378 381 } 379 382 } else { 380 383 // use the CMS default 381 $link_panel = "main_menu_panel /main_menu_panel.php";384 $link_panel = "main_menu_panel"; 382 385 } 383 386 … … 391 394 // determine the next order in the menu for this link 392 395 $link_order = dbresult(dbquery("SELECT MAX(link_order) FROM ".$db_prefix."site_links WHERE panel_name = '$link_panel'"),0) + 1; 393 396 394 397 // add the new link 395 $result = dbquery("INSERT INTO ".$db_prefix."site_links (link_name, link_url, link_visibility, link_position, link_window, link_order, panel_name) 396 VALUES ('".$mod_link['name']."', '$link_url', '".$mod_link['visibility']."', '1', '0', '$link_order', '$link_panel')"); 398 switch ($settings['sitelinks_localisation']) { 399 case "multiple": 400 $result = dbquery("SELECT * FROM ".$db_prefix."locale WHERE locale_active = '1'"); 401 while ($data = dbarray($result)) { 402 $result = dbquery("INSERT INTO ".$db_prefix."site_links (link_name, link_locale, link_url, link_visibility, link_position, link_window, link_order, panel_name) 403 VALUES ('".$mod_link['name']."', '".$data['locale_code']."', '$link_url', '".$mod_link['visibility']."', '1', '0', '$link_order', '$link_panel')"); 404 } 405 break; 406 default: 407 $result = dbquery("INSERT INTO ".$db_prefix."site_links (link_name, link_url, link_visibility, link_position, link_window, link_order, panel_name) 408 VALUES ('".$mod_link['name']."', '$link_url', '".$mod_link['visibility']."', '1', '0', '$link_order', '$link_panel')"); 409 } 410 397 411 } else { 398 412 // do nothing
Note: See TracChangeset
for help on using the changeset viewer.
