Changeset 1182 in ExiteCMS for trunk/includes/theme_functions.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/includes/theme_functions.php

    r1158 r1182  
    4949        // set the compile ID for this website/theme (themes can have different templates!) 
    5050        if (isset($userdata['user_theme']) && $userdata['user_theme'] != "Default") { 
    51             $this->compile_id = $_SERVER['SERVER_NAME'].".".$userdata['user_theme']; 
     51            $this->compile_id = $_SERVER['SERVER_NAME']."~".$userdata['user_theme']; 
    5252        } else { 
    53             $this->compile_id = $_SERVER['SERVER_NAME'].".".$settings['theme']; 
     53            $this->compile_id = $_SERVER['SERVER_NAME']."~".$settings['theme']; 
    5454        } 
    5555         
     
    8484        $_return = $auto_base . DIRECTORY_SEPARATOR; 
    8585 
    86         if(isset($auto_id)) { 
    87             // make auto_id safe for directory names 
    88             $auto_id = str_replace('%7C',$_compile_dir_sep,(urlencode($auto_id))); 
    89         } 
    90  
    9186        if(isset($auto_source)) { 
    9287            // make source name safe for filename 
     
    9590                $auto_source = md5($auto_source); 
    9691            } 
    97             $_crc32 = sprintf('%08X', crc32($auto_source)); 
    98             // prepend %% to avoid name conflicts with 
    99             // with $params['auto_id'] names 
    100             $_crc32 = substr($_crc32, 0, 2) . $_compile_dir_sep . 
    101                       substr($_crc32, 0, 3) . $_compile_dir_sep . $_crc32; 
     92            $_return .= $auto_source."~"; 
    10293        } 
    103         return $_return.(isset($auto_source)?($auto_source."."):"").(isset($auto_id)?($auto_id."."):"").(isset($_crc32)?$_crc32:""); 
     94 
     95        if(isset($auto_id)) { 
     96            // make auto_id safe for directory names 
     97            $auto_id = str_replace('%7C',$_compile_dir_sep,(urlencode($auto_id))); 
     98            $auto_id = str_replace('%7E','~',$auto_id); 
     99            $_return .= $auto_id; 
     100        } 
     101 
     102        return $_return; 
    104103    } 
    105104 
     
    357356                $_panel['type'] = $column; 
    358357                $_panel['title'] = $p_data['panel_name']; 
    359                 $_panel['name'] = 'modules.'.$p_data['panel_filename']; 
    360358                $_panel['panel_type'] = $p_data['panel_type']; 
    361359                switch($p_data['panel_type']) { 
    362360                    case "file": 
    363                         $_panel['template'] = 'modules.'.$p_data['panel_filename'].".tpl"; 
    364                         $_panel['panel_code'] = PATH_MODULES.$p_data['panel_filename']."/".$p_data['panel_filename'].".php"; 
     361                        // check for module directory for backward compatibility 
     362                        if (@is_dir(PATH_MODULES.$p_data['panel_filename'])) { 
     363                            $_panel['name'] = 'modules.'.$p_data['panel_filename']; 
     364                            $_panel['template'] = 'modules.'.$p_data['panel_filename'].".tpl"; 
     365                            $_panel['panel_code'] = PATH_MODULES.$p_data['panel_filename']."/".$p_data['panel_filename'].".php"; 
     366                        } else { 
     367                            $_panel['template'] = 'modules.'.substr(basename($p_data['panel_filename']),0,-4).".tpl"; 
     368                            $_panel['name'] = 'modules.'.substr(basename($p_data['panel_filename']),0,-4); 
     369                            $_panel['panel_code'] = PATH_MODULES.$p_data['panel_filename']; 
     370                        } 
    365371                        break; 
    366372                    case "dynamic": 
Note: See TracChangeset for help on using the changeset viewer.