| | |
| | | public $task = ''; |
| | | public $output; |
| | | public $handlers = array(); |
| | | public $allowed_prefs = array(); |
| | | |
| | | protected $plugins = array(); |
| | | protected $tasks = array(); |
| | |
| | | $plugin->init(); |
| | | $this->plugins[$plugin_name] = $plugin; |
| | | } |
| | | |
| | | if (!empty($plugin->allowed_prefs)) { |
| | | $this->allowed_prefs = array_merge($this->allowed_prefs, $plugin->allowed_prefs); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * Register this plugin to be responsible for a specific task |
| | | * |
| | | * @param string $task Task name (only characters [a-z0-9_.-] are allowed) |
| | | * @param string $task Task name (only characters [a-z0-9_-] are allowed) |
| | | * @param string $owner Plugin name that registers this action |
| | | */ |
| | | public function register_task($task, $owner) |
| | |
| | | return true; |
| | | } |
| | | |
| | | if ($task != asciiwords($task)) { |
| | | if ($task != asciiwords($task, true)) { |
| | | rcube::raise_error(array('code' => 526, 'type' => 'php', |
| | | 'file' => __FILE__, 'line' => __LINE__, |
| | | 'message' => "Invalid task name: $task." |