Changeset 1158 in ExiteCMS for trunk/administration/modules.php


Ignore:
Timestamp:
12/03/07 21:40:54 (4 years ago)
Author:
hverton
Message:

added a locale type selection per module
fixed typo from 404handler.php
updated English language pack
fixed not being able to move a post to a thread in the same forum.post.move.tpl
getusergroups() now returns the array ordered by name
upgraded tiny_mce to version 2.1.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/administration/modules.php

    r1151 r1158  
    4343    $module = stripinput($_GET['module']); 
    4444 
     45    // check if it exists, if so, bail out 
     46    if (dbrows($result)) fallback(FUSION_SELF.$aidlink); 
     47 
    4548    // load the module installer 
    4649    include PATH_MODULES.$module."/module_installer.php"; 
     
    8386            $link_panel = ($mod_link['panel'] != "" ? ($mod_link['panel']."_") : "").'menu_panel'; 
    8487 
    85             // if the panel doesn't exist, use the default menu panel 
     88            // check if this panel is installed 
    8689            $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            } 
    88101 
    89102            // determine the next order in the menu for this link 
     
    91104 
    92105            // 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            } 
    95118        } 
    96119    } 
     
    154177    if (!isNum($id)) fallback(FUSION_SELF.$aidlink); 
    155178     
    156     // check if it exists 
     179    // get the module data 
    157180    $result = dbquery("SELECT * FROM ".$db_prefix."modules WHERE mod_id='$id'"); 
    158     if (!$result)  fallback(FUSION_SELF.$aidlink); 
    159  
    160     // get the module data 
    161181    $data = dbarray($result); 
    162182 
     
    204224 
    205225            // and if so, remove it and adjust the link order 
    206             if (dbrows($result2) == "1") { 
     226            if (dbrows($result2)) { 
    207227                $data2 = dbarray($result2); 
    208228                $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.