alecpl
2008-06-15 e58df3adc9b4182c232c94178d024bb4a89c2290
program/include/rcube_template.php
@@ -32,7 +32,6 @@
{
    var $app;
    var $config;
    var $task = '';
    var $framed = false;
    var $pagetitle = '';
    var $env = array();
@@ -56,7 +55,13 @@
        $this->config = $this->app->config->all();
        
        //$this->framed = $framed;
        $this->task = $task;
        $this->set_env('task', $task);
   // load the correct skin (in case user-defined)
   if (empty($this->config['skin']) || !is_readable('skins/'.$this->config['skin']))
       $this->config['skin'] = $this->config['default_skin'];
   $this->config['skin_path'] = 'skins/'.$this->config['skin'];
        // add common javascripts
        $javascript = 'var '.JS_OBJECT_NAME.' = new rcube_webmail();';
@@ -103,6 +108,27 @@
        $this->pagetitle = $title;
    }
    /**
     * Set skin
     */
    public function set_skin($skin)
    {
   if (!empty($skin) && is_dir('skins/'.$skin) && is_readable('skins/'.$skin))
       $this->config['skin_path'] = 'skins/'.$skin;
    }
    /**
     * Check if a specific template exists
     *
     * @param string Template name
     * @return boolean True if template exists
     */
    public function template_exists($name)
    {
   $filename = $this->config['skin_path'] . '/templates/' . $name . '.html';
   return (is_file($filename) && is_readable($filename));
    }
    /**
     * Register a template object handler
@@ -542,7 +568,7 @@
                    return $ver;
                }
                if ($object=='pagetitle') {
                    $task  = $this->task;
                    $task  = $this->env['task'];
                    $title = !empty($this->config['product_name']) ? $this->config['product_name'].' :: ' : '';
                    if (!empty($this->pagetitle)) {