diff options
author | alecpl <alec@alec.pl> | 2011-01-16 19:42:40 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-01-16 19:42:40 +0000 |
commit | 68d2d541002017dae51127aa05af58d19916655b (patch) | |
tree | 0fa9953196a9dc94d048d954dbd7482ef4140e7a /program/include | |
parent | 88007cf0602434d73a21b475a151b80a9002e6da (diff) |
- Move action files map from index.php to steps' func.inc files
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/rcmail.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php index aa9f56426..7c8d4fc33 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -115,6 +115,7 @@ class rcmail private $texts; private $books = array(); + private $action_map = array(); /** @@ -1322,6 +1323,33 @@ class rcmail setcookie($name, $value, $exp, $cookie['path'], $cookie['domain'], rcube_https_check(), true); } -} + /** + * Registers action aliases for current task + * + * @param array $map Alias-to-filename hash array + */ + public function register_action_map($map) + { + if (is_array($map)) { + foreach ($map as $idx => $val) { + $this->action_map[$idx] = $val; + } + } + } + + /** + * Returns current action filename + * + * @param array $map Alias-to-filename hash array + */ + public function get_action_file() + { + if (!empty($this->action_map[$this->action])) { + return $this->action_map[$this->action]; + } + + return strtr($this->action, '-', '_') . '.inc'; + } +} |