From 159763861e15fce2006b1830ebdb646c5ad52d0c Mon Sep 17 00:00:00 2001 From: alecpl Date: Wed, 3 Aug 2011 11:35:36 +0000 Subject: - Display current user name in page title if devel_mode=true --- program/include/rcube_json_output.php | 6 +++++- program/include/rcube_template.php | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/program/include/rcube_json_output.php b/program/include/rcube_json_output.php index efb672888..40a7b2a5e 100644 --- a/program/include/rcube_json_output.php +++ b/program/include/rcube_json_output.php @@ -75,7 +75,11 @@ class rcube_json_output */ public function set_pagetitle($title) { - $name = $this->config->get('product_name'); + if ($this->config->get('devel_mode') && !empty($_SESSION['username'])) + $name = $_SESSION['username']; + else + $name = $this->config->get('product_name'); + $this->command('set_pagetitle', empty($name) ? $title : $name.' :: '.$title); } diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php index a672c5058..6228e7659 100755 --- a/program/include/rcube_template.php +++ b/program/include/rcube_template.php @@ -748,7 +748,12 @@ class rcube_template extends rcube_html_page $content = Q($this->get_pagetitle()); } else if ($object == 'pagetitle') { - $title = !empty($this->config['product_name']) ? $this->config['product_name'].' :: ' : ''; + if (!empty($this->config['devel_mode']) && !empty($_SESSION['username'])) + $title = $_SESSION['username'].' :: '; + else if (!empty($this->config['product_name'])) + $title = $this->config['product_name'].' :: '; + else + $title = ''; $title .= $this->get_pagetitle(); $content = Q($title); } -- cgit v1.2.3