Update of /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_eventwrapper
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28720/plugins/serendipity_plugin_eventwrapper
Modified Files:
serendipity_plugin_eventwrapper.php
Log Message:
immediately show plugin defaults in configuration screen instead of leaving
everything blank.
!!!!PLEASE TEST!!!!
Index: serendipity_plugin_eventwrapper.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_eventwrapper/serendipity_plugin_eventwrapper.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- serendipity_plugin_eventwrapper.php 3 Apr 2004 17:36:18 -0000 1.2
+++ serendipity_plugin_eventwrapper.php 22 Jun 2004 13:45:48 -0000 1.3
@@ -8,7 +8,7 @@
@define('PLUGIN_EVENT_WRAPPER_PLUGINDESC', 'Wählen Sie das Event-Plugin aus, für das die Ausgabe dargestellt werden soll');
@define('PLUGIN_EVENT_WRAPPER_TITLEDESC', 'Geben Sie den Titel für die Sidebar an. Die Eingabe eines leeren Titels zeigt den des Event-Plugins an.');
break;
-
+
case 'en':
case 'es':
default:
@@ -28,10 +28,10 @@
function introspect(&$propbag)
{
global $serendipity;
-
+
$propbag->add('name', PLUGIN_EVENT_WRAPPER_NAME);
$propbag->add('description', PLUGIN_EVENT_WRAPPER_DESC);
-
+
$propbag->add('configuration', array('event_plugin', 'title'));
}
@@ -39,7 +39,7 @@
function introspect_config_item($name, &$propbag)
{
global $serendipity;
-
+
switch($name) {
case 'event_plugin':
$plugins = serendipity_plugin_api::get_event_plugins();
@@ -50,17 +50,19 @@
$select[$plugname] = $plugarray['t'];
}
}
-
+
$propbag->add('type', 'select');
$propbag->add('name', PLUGIN_EVENT_WRAPPER_PLUGIN);
$propbag->add('description', PLUGIN_EVENT_WRAPPER_PLUGINDESC);
$propbag->add('select_values', $select);
+ $propbag->add('default', 'false');
break;
case 'title':
$propbag->add('type', 'string');
$propbag->add('name', TITLE);
$propbag->add('description', PLUGIN_EVENT_WRAPPER_TITLEDESC);
+ $propbag->add('default', '');
break;
default:
@@ -73,12 +75,17 @@
{
$bag = new serendipity_property_bag;
$this->introspect($bag);
- $wrap = &serendipity_plugin_api::get_event_plugins($this->get_config('event_plugin'));
+ $plug = $this->get_config('event_plugin', 'false');
+ if ($plug == 'false') {
+ return;
+ }
+
+ $wrap = &serendipity_plugin_api::get_event_plugins($plug);
$faketitle = '';
if (is_object($wrap)) {
$wrap->generate_content($faketitle);
}
-
+
if ($this->get_config('title') != '') {
$title = $this->get_config('title');
} else {
|