thomascube
2008-07-28 0ece58dfaffa79fe86d9e981f39d4902736fe67d
program/include/rcube_template.php
@@ -57,8 +57,8 @@
        //$this->framed = $framed;
        $this->set_env('task', $task);
   // load the correct skin (in case user-defined)
   $this->set_skin($this->config['skin']);
        // load the correct skin (in case user-defined)
        $this->set_skin($this->config['skin']);
        // add common javascripts
        $javascript = 'var '.JS_OBJECT_NAME.' = new rcube_webmail();';
@@ -110,13 +110,13 @@
     */
    public function set_skin($skin)
    {
   if (!empty($skin) && is_dir('skins/'.$skin) && is_readable('skins/'.$skin))
       $skin_path = 'skins/'.$skin;
   else
       $skin_path = $this->config['skin_path'] ? $this->config['skin_path'] : 'skins/default';
   $this->app->config->set('skin_path', $skin_path);
   $this->config['skin_path'] = $skin_path;
        if (!empty($skin) && is_dir('skins/'.$skin) && is_readable('skins/'.$skin))
            $skin_path = 'skins/'.$skin;
        else
            $skin_path = $this->config['skin_path'] ? $this->config['skin_path'] : 'skins/default';
        $this->app->config->set('skin_path', $skin_path);
        $this->config['skin_path'] = $skin_path;
    }
    /**
@@ -127,9 +127,9 @@
     */
    public function template_exists($name)
    {
   $filename = $this->config['skin_path'] . '/templates/' . $name . '.html';
        $filename = $this->config['skin_path'] . '/templates/' . $name . '.html';
   return (is_file($filename) && is_readable($filename));
        return (is_file($filename) && is_readable($filename));
    }
    /**
@@ -218,13 +218,27 @@
     * @uses   self::$js_commands
     * @uses   self::$object_handlers
     */
    public public function reset()
    public function reset()
    {
        $this->env = array();
        $this->js_env = array();
        $this->js_commands = array();
        $this->object_handlers = array();
        parent::reset();
    }
    /**
     * Redirect to a certain url
     *
     * @param mixed Either a string with the action or url parameters as key-value pairs
     * @see rcmail::url()
     */
    public function redirect($p = array())
    {
        $location = $this->app->url($p);
        header('Location: ' . $location);
        exit;
    }
@@ -894,8 +908,8 @@
        $_SESSION['temp'] = true;
        $input_user   = new html_inputfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30, 'autocomplete' => 'off'));
        $input_pass   = new html_passwordfield(array('name' => '_pass', 'id' => 'rcmloginpwd', 'size' => 30));
        $input_user   = new html_inputfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30) + $attrib);
        $input_pass   = new html_passwordfield(array('name' => '_pass', 'id' => 'rcmloginpwd', 'size' => 30) + $attrib);
        $input_action = new html_hiddenfield(array('name' => '_action', 'value' => 'login'));
        $input_host   = null;
@@ -912,7 +926,7 @@
                }
            }
        }
        else if (!strlen($default_host)) {
        else if (empty($default_host)) {
            $input_host = new html_inputfield(array('name' => '_host', 'id' => 'rcmloginhost', 'size' => 30));
        }
@@ -923,7 +937,7 @@
        $table = new html_table(array('cols' => 2));
        $table->add('title', html::label('rcmloginuser', Q(rcube_label('username'))));
        $table->add(null, $input_user->show(get_input_value('_user', RCUVE_INPUT_POST)));
        $table->add(null, $input_user->show(get_input_value('_user', RCUBE_INPUT_POST)));
        $table->add('title', html::label('rcmloginpwd', Q(rcube_label('password'))));
        $table->add(null, $input_pass->show());
@@ -931,7 +945,7 @@
        // add host selection row
        if (is_object($input_host)) {
            $table->add('title', html::label('rcmloginhost', Q(rcube_label('server'))));
            $table->add(null, $input_host->show(get_input_value('_host', RCUVE_INPUT_POST)));
            $table->add(null, $input_host->show(get_input_value('_host', RCUBE_INPUT_POST)));
        }
        $out = $input_action->show();