From 99ea373eb7686d901ee83960b5da4d31c7f6e9fc Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 26 Jan 2016 13:56:25 +0100 Subject: [PATCH] consistent plugin usage - templatedropdown this and followup commits touches: class method parenthesis "\n{\n \n}\n", case break switches, consistent boolean usage, append css to eventData and other cleanups --- .../serendipity_plugin_templatedropdown.php | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/plugins/serendipity_plugin_templatedropdown/serendipity_plugin_templatedropdown.php b/plugins/serendipity_plugin_templatedropdown/serendipity_plugin_templatedropdown.php index 55ce7b98..a3f38efc 100644 --- a/plugins/serendipity_plugin_templatedropdown/serendipity_plugin_templatedropdown.php +++ b/plugins/serendipity_plugin_templatedropdown/serendipity_plugin_templatedropdown.php @@ -1,8 +1,13 @@ -add('description', PLUGIN_TEMPLATEDROPDOWN_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Evan Nemerson'); - $propbag->add('version', '1.2'); + $propbag->add('version', '1.3'); $propbag->add('requirements', array( - 'serendipity' => '0.8', + 'serendipity' => '1.6', 'smarty' => '2.6.7', 'php' => '4.1.0' )); @@ -46,33 +51,35 @@ class serendipity_plugin_templatedropdown extends serendipity_plugin { break; default: - return false; + return false; } return true; } - function generate_content(&$title) { + function generate_content(&$title) + { global $serendipity; $title = $this->get_config('title', $this->title); $url = serendipity_currentURL(true); - echo '
'; - echo ''."\n"; foreach (serendipity_fetchTemplates() as $template) { if ($template == 'default-php' || $template == 'default-xml') continue; $templateInfo = serendipity_fetchTemplateInfo($template); - echo ''; + echo ' \n"; } - echo ''; + echo "\n"; - if ($this->get_config('show_submit', 'false') == 'true') { - echo ''; + if (serendipity_db_bool($this->get_config('show_submit', 'false'))) { + echo ''."\n"; } - echo '
'; + echo "\n"; } + } /* vim: set sts=4 ts=4 expandtab : */ -?> +?> \ No newline at end of file