aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/widgets.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-05 16:08:42 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-05 16:08:42 +0000
commit36ef345eb6425106f061fb866d9fa66d051e16df (patch)
tree53fb2bd05f8b5e2010f9e3d1e93075ad7071ec1e /engine/lib/widgets.php
parent5571ca5b350fd1735f13af7ddfbb88afa6befb0c (diff)
downloadelgg-36ef345eb6425106f061fb866d9fa66d051e16df.tar.gz
elgg-36ef345eb6425106f061fb866d9fa66d051e16df.tar.bz2
Merged 5530:5604 from 1.7 to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@5622 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/widgets.php')
-rw-r--r--engine/lib/widgets.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php
index a450d6223..7884f263a 100644
--- a/engine/lib/widgets.php
+++ b/engine/lib/widgets.php
@@ -254,7 +254,6 @@ function add_widget($user_guid, $handler, $context, $order = 0, $column = 1, $ac
* @param string $position A comma-separated list of positions on the page (side or main) where this widget is allowed (default: "side,main")
* @return true|false Depending on success
*/
-
function add_widget_type($handler, $name, $description, $context = "all", $multiple = false, $positions = "side,main") {
if (!empty($handler) && !empty($name)) {
global $CONFIG;
@@ -283,6 +282,27 @@ function add_widget_type($handler, $name, $description, $context = "all", $multi
}
/**
+ * Remove a widget type
+ *
+ * @param string $handler The identifier for the widget handler
+ */
+function remove_widget_type($handler) {
+ global $CONFIG;
+
+ if (!isset($CONFIG->widgets)) {
+ return;
+ }
+
+ if (!isset($CONFIG->widgets->handlers)) {
+ return;
+ }
+
+ if (isset($CONFIG->widgets->handlers[$handler])) {
+ unset($CONFIG->widgets->handlers[$handler]);
+ }
+}
+
+/**
* Determines whether or not widgets with the specified handler have been defined
*
* @param string $handler The widget handler identifying string