Changeset ca18a90 in github


Ignore:
Timestamp:
Apr 12, 2011 5:16:01 AM (2 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
12dac491
Parents:
23b4955
Message:
  • Fix bug where template name without plugin prefix was used in render_page hook (the same fix for deprecated_templates)
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r23b4955 rca18a90  
    22=========================== 
    33 
     4- Fix bug where template name without plugin prefix was used in render_page hook 
    45- Fix handling of debug_level=4 in ajax requests (#1487831) 
    56- Support 'abort' and 'result' response in 'preferences_save' hook, add error handling 
  • program/include/rcube_template.php

    r79cd6ce rca18a90  
    369369    { 
    370370        $skin_path = $this->config['skin_path']; 
    371         $plugin = false; 
     371        $plugin    = false; 
     372        $realname  = $name; 
     373        $temp      = explode('.', $name, 2); 
    372374        $this->plugin_skin_path = null; 
    373375 
    374         $temp = explode(".", $name, 2); 
    375376        if (count($temp) > 1) { 
    376             $plugin = $temp[0]; 
    377             $name = $temp[1]; 
    378             $skin_dir = $plugin . '/skins/' . $this->config['skin']; 
     377            $plugin    = $temp[0]; 
     378            $name      = $temp[1]; 
     379            $skin_dir  = $plugin . '/skins/' . $this->config['skin']; 
    379380            $skin_path = $this->plugin_skin_path = $this->app->plugins->dir . $skin_dir; 
    380             if (!is_dir($skin_path)) {  // fallback to default skin 
     381 
     382            // fallback to default skin 
     383            if (!is_dir($skin_path)) { 
    381384                $skin_dir = $plugin . '/skins/default'; 
    382385                $skin_path = $this->plugin_skin_path = $this->app->plugins->dir . $skin_dir; 
     
    386389        $path = "$skin_path/templates/$name.html"; 
    387390 
    388         if (!is_readable($path) && $this->deprecated_templates[$name]) { 
    389             $path = "$skin_path/templates/".$this->deprecated_templates[$name].".html"; 
     391        if (!is_readable($path) && $this->deprecated_templates[$realname]) { 
     392            $path = "$skin_path/templates/".$this->deprecated_templates[$realname].".html"; 
    390393            if (is_readable($path)) 
    391394                raise_error(array('code' => 502, 'type' => 'php', 
    392395                    'file' => __FILE__, 'line' => __LINE__, 
    393                     'message' => "Using deprecated template '".$this->deprecated_templates[$name]."' in ".$this->config['skin_path']."/templates. Please rename to '".$name."'"), 
     396                    'message' => "Using deprecated template '".$this->deprecated_templates[$realname] 
     397                        ."' in ".$this->config['skin_path']."/templates. Please rename to '".$realname."'"), 
    394398                true, false); 
    395399        } 
     
    402406                'line' => __LINE__, 
    403407                'file' => __FILE__, 
    404                 'message' => 'Error loading template for '.$name 
     408                'message' => 'Error loading template for '.$realname 
    405409                ), true, true); 
    406410            return false; 
     
    418422 
    419423        // trigger generic hook where plugins can put additional content to the page 
    420         $hook = $this->app->plugins->exec_hook("render_page", array('template' => $name, 'content' => $output)); 
     424        $hook = $this->app->plugins->exec_hook("render_page", array('template' => $realname, 'content' => $output)); 
    421425 
    422426        // add debug console 
Note: See TracChangeset for help on using the changeset viewer.