Changeset 1848 in ExiteCMS


Ignore:
Timestamp:
10/14/08 15:32:59 (3 years ago)
Author:
hverton
Message:

fixed not working theme template override function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/theme_functions.php

    r1802 r1848  
    255255            } 
    256256 
     257            // store the current template directories, we need to restore them later 
     258            $td = $template->template_dir; 
     259 
    257260            //if this is a module template... 
    258261            $tpl_parts = explode(".", $panel['template']); 
    259262            if ($tpl_parts[0] == "modules") { 
    260                 // store the current template directories, we need to restore them later 
    261                 $td = $template->template_dir; 
    262263                $template->template_dir = array_merge(array(PATH_MODULES.$tpl_parts[1].'/templates'), $template->template_dir); 
    263             } else { 
    264                 // we shouldn't get here 
    265264            } 
    266265         
     
    268267            $tpl_parts = explode(".", $panel['template']); 
    269268            if ($tpl_parts[0] == "admin" && $tpl_parts[1] == "tools") { 
    270                 // store the current template directories, we need to restore them later 
    271                 $td = $template->template_dir; 
    272269                $template->template_dir = array_merge(array(PATH_ADMIN.'tools/templates'), $template->template_dir); 
    273             } else { 
    274                 // we shouldn't get here 
    275270            } 
    276271         
    277272            // if a template is defined, get the last modified date, and load the template 
    278273            if (isset($panel['template'])) { 
     274                // add the theme template directory as first template directory 
     275                $template->template_dir = array_merge(array(PATH_THEME.'templates/templates'), $template->template_dir); 
    279276                // get the timestamp of the template, and update the last update timestamp if newer 
    280277                $ts = $template->template_timestamp($panel['template']); 
     
    285282            } 
    286283             
    287             // restore the template direcory if needed 
    288             if (isset($td) && is_array($td)) $template->template_dir = $td; 
     284            // restore the template direcory 
     285            $template->template_dir = $td; 
    289286        } 
    290287    } 
Note: See TracChangeset for help on using the changeset viewer.