diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-04-26 16:33:22 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-04-26 16:33:22 +0000 |
| commit | b2787b5920d4d4efbb39f94a1f4e2f52cb676dd1 (patch) | |
| tree | 70a9a41f2b3b29d85387538f654307b2853eb4a1 /roundcubemail/program/include/rcmail.php | |
| parent | 687ffe2013521f0ef6a3d6d69578fe111594b7b3 (diff) | |
Allow plugins to define their own tasks + add 'domain' parameter for rcube_template::button()
git-svn-id: https://svn.roundcube.net/trunk@2427 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcmail.php')
| -rw-r--r-- | roundcubemail/program/include/rcmail.php | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/roundcubemail/program/include/rcmail.php b/roundcubemail/program/include/rcmail.php index 603ac335a..e660e52c5 100644 --- a/roundcubemail/program/include/rcmail.php +++ b/roundcubemail/program/include/rcmail.php @@ -91,7 +91,7 @@ class rcmail } // set task and action properties - $this->set_task(strip_quotes(get_input_value('_task', RCUBE_INPUT_GPC))); + $this->set_task(get_input_value('_task', RCUBE_INPUT_GPC)); $this->action = asciiwords(get_input_value('_action', RCUBE_INPUT_GPC)); // connect to database @@ -145,14 +145,12 @@ class rcmail */ public function set_task($task) { - if (!in_array($task, self::$main_tasks)) - $task = 'mail'; - - $this->task = $task; - $this->comm_path = $this->url(array('task' => $task)); + $task = asciiwords($task); + $this->task = $task ? $task : 'mail'; + $this->comm_path = $this->url(array('task' => $this->task)); if ($this->output) - $this->output->set_env('task', $task); + $this->output->set_env('task', $this->task); } @@ -936,11 +934,8 @@ class rcmail { if (!is_array($p)) $p = array('_action' => @func_get_arg(0)); - - $task = $p['_task'] ? $p['_task'] : $p['task']; - if (!$task || !in_array($task, rcmail::$main_tasks)) - $task = $this->task; - + + $task = $p['_task'] ? $p['_task'] : ($p['task'] ? $p['task'] : $this->task); $p['_task'] = $task; unset($p['task']); |
