Update of /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_templatedropdown
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28720/plugins/serendipity_plugin_templatedropdown
Modified Files:
serendipity_plugin_templatedropdown.php
Log Message:
immediately show plugin defaults in configuration screen instead of leaving
everything blank.
!!!!PLEASE TEST!!!!
Index: serendipity_plugin_templatedropdown.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_templatedropdown/serendipity_plugin_templatedropdown.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- serendipity_plugin_templatedropdown.php 3 Mar 2004 08:18:00 -0000 1.1
+++ serendipity_plugin_templatedropdown.php 22 Jun 2004 13:45:50 -0000 1.2
@@ -27,7 +27,7 @@
// Register (multiple) dependencies. KEY is the name of the depending plugin. VALUE is a mode of either 'remove' or 'keep'.
// If the mode 'remove' is set, removing the plugin results in a removal of the depending plugin. 'Keep' meens to
// not touch the depending plugin.
- $this->dependencies = array('serendipity_event_templatechooser' => 'remove');
+ $this->dependencies = array('serendipity_event_templatechooser' => 'remove');
}
function introspect_config_item($name, &$propbag)
@@ -37,18 +37,22 @@
$propbag->add('type', 'string');
$propbag->add('name', TITLE);
$propbag->add('description', TITLE);
+ $propbag->add('default', '');
break;
+
case 'show_submit':
$propbag->add('type', 'boolean');
$propbag->add('name', PLUGIN_TEMPLATEDROPDOWN_SUBMIT);
$propbag->add('description', PLUGIN_TEMPLATEDROPDOWN_SUBMIT_DESC);
+ $propbag->add('default', 'false');
break;
+
default:
return false;
}
return true;
}
-
+
function generate_content(&$title) {
global $serendipity;
$title = $this->get_config('title', $title);
@@ -64,7 +68,7 @@
$uri['path'] = str_replace($serendipity['serendipityHTTPPath'], '', $uri['path']);
$url = $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?' . $uri['path'] . $qst;
$url = str_replace($serendipity['indexFile'] . '&', '', $url); // Kill possible looped repitions which could occur
-
+
echo '<form id="theme_chooser" action="' . $url . '" method="post">';
echo '<select name="user_template" onchange="document.getElementById(\'theme_chooser\').submit();">';
foreach (serendipity_fetchTemplates() as $template) {
@@ -73,7 +77,7 @@
}
echo '</select>';
- if ($this->get_config('show_submit', $title) == 'true') {
+ if ($this->get_config('show_submit', 'false') == 'true') {
echo '<input type="submit" name="submit" value="' . GO . '" size="4" />';
}
echo '</form>';
|