From 985cf2bb062eb77610485ddec9924be2f784f2ea Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 29 Jul 2009 11:05:06 -0400
Subject: [PATCH] Set min-width for countcontrols
---
program/include/rcube_plugin_api.php | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/program/include/rcube_plugin_api.php b/program/include/rcube_plugin_api.php
index 381b36f..b05758a 100644
--- a/program/include/rcube_plugin_api.php
+++ b/program/include/rcube_plugin_api.php
@@ -39,7 +39,8 @@
private $objectsmap = array();
private $template_contents = array();
- private $required_plugins = array('filesystem_attachments');
+ private $required_plugins = array('filesystem_attachments');
+ private $active_hook = false;
/**
* This implements the 'singleton' design pattern
@@ -179,6 +180,7 @@
public function exec_hook($hook, $args = array())
{
$args += array('abort' => false);
+ $this->active_hook = $hook;
foreach ((array)$this->handlers[$hook] as $callback) {
$ret = call_user_func($callback, $args);
@@ -189,6 +191,7 @@
break;
}
+ $this->active_hook = false;
return $args;
}
@@ -257,6 +260,19 @@
}
}
+
+ /**
+ * Check if a plugin hook is currently processing.
+ * Mainly used to prevent loops and recursion.
+ *
+ * @param string Hook to check (optional)
+ * @return boolean True if any/the given hook is currently processed, otherwise false
+ */
+ public function is_processing($hook = null)
+ {
+ return $this->active_hook && (!$hook || $this->active_hook == $hook);
+ }
+
/**
* Include a plugin script file in the current HTML page
*/
--
Gitblit v1.9.1