alecpl
2008-06-13 712b30dd2de49763f68ee6c8f7b8b24bdadb19d9
program/include/rcube_template.php
@@ -534,7 +534,12 @@
                    return Q($name);
                }
                if ($object=='version') {
                    return (string)RCMAIL_VERSION;
                    $ver = (string)RCMAIL_VERSION;
                    if (is_file(INSTALL_PATH . '.svn/entries')) {
                        if (preg_match('/Revision:\s(\d+)/', @shell_exec('svn info'), $regs))
                          $ver .= ' [SVN r'.$regs[1].']';
                    }
                    return $ver;
                }
                if ($object=='pagetitle') {
                    $task  = $this->task;
@@ -755,7 +760,7 @@
                array(
                    'style', 'class', 'id', 'width',
                    'height', 'border', 'hspace',
                    'vspace', 'align', 'alt',
                    'vspace', 'align', 'alt', 'tabindex'
                )
            );
            $btn_content = sprintf('<img src="%s"%s />', $this->abs_url($attrib['image']), $attrib_str);
@@ -766,7 +771,7 @@
        }
        else if ($attrib['type']=='link') {
            $btn_content = $attrib['label'] ? $attrib['label'] : $attrib['command'];
            $link_attrib = array('href', 'onclick', 'title', 'id', 'class', 'style');
            $link_attrib = array('href', 'onclick', 'title', 'id', 'class', 'style', 'tabindex');
        }
        else if ($attrib['type']=='input') {
            $attrib['type'] = 'button';
@@ -779,7 +784,7 @@
                $attrib,
                array(
                    'type', 'value', 'onclick',
                    'id', 'class', 'style'
                    'id', 'class', 'style', 'tabindex'
                )
            );
            $out = sprintf('<input%s disabled="disabled" />', $attrib_str);
@@ -829,7 +834,6 @@
     */
    public function current_username($attrib)
    {
        global $USER;
        static $username;
        // alread fetched
@@ -838,14 +842,11 @@
        }
        // get e-mail address form default identity
        if ($sql_arr = $USER->get_identity()) {
          $s_username = $sql_arr['email'];
        }
        else if (strstr($_SESSION['username'], '@')) {
            $username = $_SESSION['username'];
        if ($sql_arr = $this->app->user->get_identity()) {
            $username = $sql_arr['email'];
        }
        else {
            $username = $_SESSION['username'].'@'.$_SESSION['imap_host'];
            $username = $this->app->user->get_username();
        }
        return $username;