| | |
| | | /** |
| | | * Constructor |
| | | */ |
| | | public function __construct(&$config, $task) |
| | | public function __construct($task) |
| | | { |
| | | $this->task = $task; |
| | | $this->config = $config; |
| | | $this->config = rcmail::get_instance()->config; |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public function set_pagetitle($title) |
| | | { |
| | | // ignore |
| | | $name = $this->config->get('product_name'); |
| | | $this->command('set_pagetitle', JQ(empty($name) ? $title : $name.' :: '.$title)); |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | $arg_list = func_get_args(); |
| | | foreach ($arg_list as $i => $name) { |
| | | $this->texts[$name] = rcube::gettext($name); |
| | | $this->texts[$name] = rcube_label($name); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | $this->command( |
| | | 'display_message', |
| | | rcube::gettext(array('name' => $message, 'vars' => $vars)), |
| | | rcube_label(array('name' => $message, 'vars' => $vars)), |
| | | $type |
| | | ); |
| | | } |
| | |
| | | */ |
| | | private function get_js_commands() |
| | | { |
| | | $out = 'this.set_env('.json_serialize($this->env).");\n"; |
| | | $out = ''; |
| | | |
| | | if (sizeof($this->env)) |
| | | $out .= 'this.set_env('.json_serialize($this->env).");\n"; |
| | | |
| | | foreach($this->texts as $name => $text) { |
| | | $out .= sprintf("this.add_label('%s', '%s');\n", $name, JQ($text)); |
| | |
| | | implode(',', $args) |
| | | ); |
| | | } |
| | | |
| | | |
| | | return $out; |
| | | } |
| | | } |