From 75a5c3554a8a4d7f88c4abecb155566c74c30afc Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 25 Nov 2013 03:00:49 -0500
Subject: [PATCH] Add possibility to overwrite a label/message in Roundcube's language package (#1489433)
---
program/lib/Roundcube/rcube_plugin_api.php | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/program/lib/Roundcube/rcube_plugin_api.php b/program/lib/Roundcube/rcube_plugin_api.php
index 33f04ea..ad01255 100644
--- a/program/lib/Roundcube/rcube_plugin_api.php
+++ b/program/lib/Roundcube/rcube_plugin_api.php
@@ -35,8 +35,9 @@
public $url = 'plugins/';
public $task = '';
public $output;
- public $handlers = array();
- public $allowed_prefs = array();
+ public $handlers = array();
+ public $allowed_prefs = array();
+ public $allowed_session_prefs = array();
protected $plugins = array();
protected $tasks = array();
@@ -167,10 +168,11 @@
* Load the specified plugin
*
* @param string Plugin name
+ * @param boolean Force loading of the plugin even if it doesn't match the filter
*
* @return boolean True on success, false if not loaded or failure
*/
- public function load_plugin($plugin_name)
+ public function load_plugin($plugin_name, $force = false)
{
static $plugins_dir;
@@ -196,7 +198,7 @@
// check inheritance...
if (is_subclass_of($plugin, 'rcube_plugin')) {
// ... task, request type and framed mode
- if ((!$plugin->task || preg_match('/^('.$plugin->task.')$/i', $this->task))
+ if (($force || !$plugin->task || preg_match('/^('.$plugin->task.')$/i', $this->task))
&& (!$plugin->noajax || (is_object($this->output) && $this->output->type == 'html'))
&& (!$plugin->noframe || empty($_REQUEST['_framed']))
) {
@@ -403,7 +405,7 @@
$args = $ret + $args;
}
- if ($args['abort']) {
+ if ($args['break']) {
break;
}
}
--
Gitblit v1.9.1