Add extra plugin configuration possiblities via plugin hook
authorgarvinhicking <garvinhicking>
Wed, 11 Jan 2006 12:23:59 +0000 (12:23 +0000)
committergarvinhicking <garvinhicking>
Wed, 11 Jan 2006 12:23:59 +0000 (12:23 +0000)
include/functions_plugins_admin.inc.php

index 1deb46715f481d8f323026b833fe78513a8d5897..44fefffc72a91622af17b81bed3cd492e95b5bcb 100644 (file)
@@ -322,8 +322,8 @@ function serendipity_plugin_config(&$plugin, &$bag, &$name, &$desc, &$config_nam
         $per_row  = null;\r
 \r
         $is_multi_select = false;\r
-\r
-        switch ($cbag->get('type')) {\r
+        $ctype    = $cbag->get('type');\r
+        switch ($ctype) {\r
             case 'seperator':\r
 ?>\r
         <tr>\r
@@ -494,6 +494,20 @@ function serendipity_plugin_config(&$plugin, &$bag, &$name, &$desc, &$config_nam
             case 'hidden':\r
                 ?><tr><td colspan="2"><input class="direction_<?php echo $lang_direction; ?>" type="hidden" name="serendipity[<?php echo $postKey; ?>][<?php echo $config_item; ?>]" value="<?php echo $cbag->get('value'); ?>" /></td></tr><?php\r
                 break;\r
+            \r
+            default:\r
+                // Unknown configuration key. Let the plugin handle it.\r
+                $addData = func_get_args();\r
+                $eventData = array(\r
+                    'config_item' => $config_item,\r
+                    'cbag'        => $cbag,\r
+                    'plugin'      => $plugin,\r
+                    'value'       => $value,\r
+                    'bag'         => $bag,\r
+                    'postKey'     => $postKey\r
+                );\r
+                serendipity_plugin_api::hook_event('backend_pluginconfig_' . $ctype, $eventData, $addData);\r
+                break;\r
         }\r
     }\r
 \r