From: garvinhicking Date: Mon, 15 May 2006 08:46:18 +0000 (+0000) Subject: Added possibility to enabled/disable installed event plugins X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7a2182bd453c5d1b7e993a801b8171cae3bdee7a;p=s9y.git Added possibility to enabled/disable installed event plugins --- diff --git a/docs/NEWS b/docs/NEWS index dc70000..81e8ca4 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,9 @@ Version 1.1-alpha5() ------------------------------------------------------------------------ + * Added possibility to hide/temporarily disable Event plugins + (garvinhicking) + * Added "plugin_api_extension" class, which contains some helper methods for future use, like re-ordering DB items or checking valid emails. (Falk Döring) diff --git a/include/functions_plugins_admin.inc.php b/include/functions_plugins_admin.inc.php index 756310a..225f3b9 100644 --- a/include/functions_plugins_admin.inc.php +++ b/include/functions_plugins_admin.inc.php @@ -59,22 +59,14 @@ function show_plugins($event_only = false)   - - -   - '; + $place = placement_box('serendipity[placement][' . $plugin_data['name'] . ']', $plugin_data['placement'], $is_plugin_editable, true); $event_only_uri = '&serendipity[event_plugin]=true'; } else { $place = placement_box('serendipity[placement][' . $plugin_data['name'] . ']', $plugin_data['placement'], $is_plugin_editable); @@ -165,9 +157,7 @@ function show_plugins($event_only = false)
- - @@ -243,18 +233,30 @@ function ownership($authorid, $name, $is_plugin_owner = false) { * @param string plugin name * @param string current position of the plugin * @param boolean Toggle whether a plugin is editable (depends on authorid and permissions) + * @param boolean Toggle whether a plugin is an event plugin * @return string HTML code for placement select box */ -function placement_box($name, $val, $is_plugin_editable = false) +function placement_box($name, $val, $is_plugin_editable = false, $is_event = false) { static $opts = array( 'left' => LEFT, 'right' => RIGHT, 'hide' => HIDDEN - ); + ); + + static $event_opts = array( + 'event' => PLUGIN_ACTIVE, + 'eventh' => PLUGIN_INACTIVE, + ); + if ($is_event) { + $gopts =& $event_opts; + } else { + $gopts = &$opts; + } + $x = "\n