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


Ignore:
Timestamp:
12/25/07 17:32:57 (4 years ago)
Author:
hverton
Message:

added support for multiple panels per module
updated English locale file
update dbsetup_include.php
files in the template cache now have a more logical name
after login, check if the user theme exists before selecting it. If not, fall back to the site default. If this theme doesn't exist either, terminate with an error message
new CSS tag for optgroups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/administration/modules.php

    r1166 r1182  
    8484 
    8585            // 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"; 
    100106            } 
    101107 
     
    213219            if ($link_url{0} == "/") $link_url = substr($link_url,1); 
    214220             
    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            } 
    217243 
    218244            // if this panel doesn't exist (anymore), use the default menu panel 
    219245            $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"; 
    221247 
    222248            // check if we have a menu entry for this link 
     
    334360 
    335361            // 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            } 
    337383 
    338384            // if the panel doesn't exist, use the default menu panel 
    339385            $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"; 
    341387 
    342388            // check if the menu link is already defined 
Note: See TracChangeset for help on using the changeset viewer.