Changeset 1158 in ExiteCMS for trunk/administration/modules.php
- Timestamp:
- 12/03/07 21:40:54 (4 years ago)
- File:
-
- 1 edited
-
trunk/administration/modules.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/administration/modules.php
r1151 r1158 43 43 $module = stripinput($_GET['module']); 44 44 45 // check if it exists, if so, bail out 46 if (dbrows($result)) fallback(FUSION_SELF.$aidlink); 47 45 48 // load the module installer 46 49 include PATH_MODULES.$module."/module_installer.php"; … … 83 86 $link_panel = ($mod_link['panel'] != "" ? ($mod_link['panel']."_") : "").'menu_panel'; 84 87 85 // if the panel doesn't exist, use the default menu panel88 // check if this panel is installed 86 89 $result = dbquery("SELECT panel_id FROM ".$db_prefix."panels WHERE panel_filename = '$link_panel'"); 87 if (dbrows($result) == 0) $link_panel = "main_menu_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 } 100 } 88 101 89 102 // determine the next order in the menu for this link … … 91 104 92 105 // add the new link 93 $result = dbquery("INSERT INTO ".$db_prefix."site_links (link_name, link_url, link_visibility, link_position, link_window, link_order, panel_name) 94 VALUES ('".$mod_link['name']."', '$link_url', '".$mod_link['visibility']."', '1', '0', '$link_order', '$link_panel')"); 106 switch ($settings['sitelinks_localisation']) { 107 case "multiple": 108 $result = dbquery("SELECT * FROM ".$db_prefix."locale WHERE locale_active = '1'"); 109 while ($data = dbarray($result)) { 110 $result = dbquery("INSERT INTO ".$db_prefix."site_links (link_name, link_locale, link_url, link_visibility, link_position, link_window, link_order, panel_name) 111 VALUES ('".$mod_link['name']."', '".$data['locale_code']."', '$link_url', '".$mod_link['visibility']."', '1', '0', '$link_order', '$link_panel')"); 112 } 113 break; 114 default: 115 $result = dbquery("INSERT INTO ".$db_prefix."site_links (link_name, link_url, link_visibility, link_position, link_window, link_order, panel_name) 116 VALUES ('".$mod_link['name']."', '$link_url', '".$mod_link['visibility']."', '1', '0', '$link_order', '$link_panel')"); 117 } 95 118 } 96 119 } … … 154 177 if (!isNum($id)) fallback(FUSION_SELF.$aidlink); 155 178 156 // check if it exists179 // get the module data 157 180 $result = dbquery("SELECT * FROM ".$db_prefix."modules WHERE mod_id='$id'"); 158 if (!$result) fallback(FUSION_SELF.$aidlink);159 160 // get the module data161 181 $data = dbarray($result); 162 182 … … 204 224 205 225 // and if so, remove it and adjust the link order 206 if (dbrows($result2) == "1") {226 if (dbrows($result2)) { 207 227 $data2 = dbarray($result2); 208 228 $result = dbquery("UPDATE ".$db_prefix."site_links SET link_order=link_order-1 WHERE panel_name = '$link_panel' AND link_order>'".$data2['link_order']."'");
Note: See TracChangeset
for help on using the changeset viewer.
