From f7bfa7123b986612619c116ea435c187dc4fccd2 Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 26 Jan 2016 13:58:12 +0100 Subject: [PATCH] consistent plugin usage - superuser 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_superuser.php | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/plugins/serendipity_plugin_superuser/serendipity_plugin_superuser.php b/plugins/serendipity_plugin_superuser/serendipity_plugin_superuser.php index f20118c8..3d748bc8 100644 --- a/plugins/serendipity_plugin_superuser/serendipity_plugin_superuser.php +++ b/plugins/serendipity_plugin_superuser/serendipity_plugin_superuser.php @@ -1,6 +1,11 @@ add('description', ALLOWS_YOU_BLAHBLAH); $propbag->add('stackable', false); $propbag->add('author', 'Serendipity Team'); - $propbag->add('version', '1.0'); + $propbag->add('version', '1.1'); $propbag->add('configuration', array('https')); $propbag->add('groups', array('FRONTEND_FEATURES')); } - function generate_content(&$title) - { - global $serendipity; - - $title = $this->title; - if ($this->get_config('https', 'false') == 'true') { - $base = str_replace('http://', 'https://', $serendipity['baseURL']); - } else { - $base = $serendipity['serendipityHTTPPath']; - } - - $link = $base . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] .'?/' : '') . PATH_ADMIN; - $text = (($_SESSION['serendipityAuthedUser'] === true) ? SUPERUSER_OPEN_ADMIN : SUPERUSER_OPEN_LOGIN); - echo ''. $text .''; - } - function introspect_config_item($name, &$propbag) { switch($name) { @@ -45,6 +34,23 @@ class serendipity_plugin_superuser extends serendipity_plugin { } return true; } + + function generate_content(&$title) + { + global $serendipity; + + $title = $this->title; + if (serendipity_db_bool($this->get_config('https', 'false'))) { + $base = str_replace('http://', 'https://', $serendipity['baseURL']); + } else { + $base = $serendipity['serendipityHTTPPath']; + } + + $link = $base . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] .'?/' : '') . PATH_ADMIN; + $text = (($_SESSION['serendipityAuthedUser'] === true) ? SUPERUSER_OPEN_ADMIN : SUPERUSER_OPEN_LOGIN); + echo ''. $text .''; + } + } ?> \ No newline at end of file