From f645ce169e11339d45cbc0b5b4cf6154346fd4c7 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Mon, 15 Sep 2008 10:53:57 -0400
Subject: [PATCH] Redesign of the identities settings + add config option to disable multiple identities

---
 program/include/rcube_template.php |   50 +++++++++++++++++++++++++++++---------------------
 1 files changed, 29 insertions(+), 21 deletions(-)

diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php
index 4441b0a..98e29e7 100755
--- a/program/include/rcube_template.php
+++ b/program/include/rcube_template.php
@@ -106,6 +106,28 @@
         $this->pagetitle = $title;
     }
 
+
+    /**
+     * Getter for the current page title
+     *
+     * @return string The page title
+     */
+    public function get_pagetitle()
+    {
+        if (!empty($this->pagetitle)) {
+            $title = $this->pagetitle;
+        }
+        else if ($this->env['task'] == 'login') {
+            $title = rcube_label(array('name' => 'welcome', 'vars' => array('product' => $this->config['product_name'])));
+        }
+        else {
+            $title = ucfirst($this->env['task']);
+        }
+        
+        return $title;
+    }
+
+
     /**
      * Set skin
      */
@@ -357,13 +379,7 @@
             implode(',', $args)
             );
         }
-        // add command to set page title
-        if ($this->ajax_call && !empty($this->pagetitle)) {
-            $out .= sprintf(
-                "this.set_pagetitle('%s');\n",
-                JQ((!empty($this->config['product_name']) ? $this->config['product_name'].' :: ' : '') . $this->pagetitle)
-            );
-        }
+        
         return $out;
     }
 
@@ -455,13 +471,13 @@
         $condition = preg_replace(
             array(
                 '/session:([a-z0-9_]+)/i',
-                '/config:([a-z0-9_]+)/i',
+                '/config:([a-z0-9_]+)(:([a-z0-9_]+))?/i',
                 '/env:([a-z0-9_]+)/i',
                 '/request:([a-z0-9_]+)/ie'
             ),
             array(
                 "\$_SESSION['\\1']",
-                "\$this->config['\\1']",
+                "\$this->app->config->get('\\1',get_boolean('\\3'))",
                 "\$this->env['\\1']",
                 "get_input_value('\\1', RCUVE_INPUT_GPC)"
             ),
@@ -591,20 +607,12 @@
                     }
                     return $ver;
                 }
+                if ($object=='steptitle') {
+                  return Q($this->get_pagetitle());
+                }
                 if ($object=='pagetitle') {
-                    $task  = $this->env['task'];
                     $title = !empty($this->config['product_name']) ? $this->config['product_name'].' :: ' : '';
-
-                    if (!empty($this->pagetitle)) {
-                        $title .= $this->pagetitle;
-                    }
-                    else if ($task == 'login') {
-                        $title = rcube_label(array('name' => 'welcome', 'vars' => array('product' => $this->config['product_name'])));
-                    }
-                    else {
-                        $title .= ucfirst($task);
-                    }
-
+                    $title .= $this->get_pagetitle();
                     return Q($title);
                 }
                 break;

--
Gitblit v1.9.1