From e303d7433d03ab139653742ae93ff4790459da1b Mon Sep 17 00:00:00 2001 From: Matthias Mees Date: Sat, 21 Sep 2013 09:13:47 +0200 Subject: [PATCH] Switch karma plugin options to core config groups. The karma plugin had its own solution for config option groups in tabs which didn't work well with the refactored 2.0 backend. We have a solution for config groups in the core; it now uses this for better backend consistency. References #54 --- .../serendipity_event_karma.php | 98 +++++++++---------- 1 file changed, 48 insertions(+), 50 deletions(-) diff --git a/plugins/serendipity_event_karma/serendipity_event_karma.php b/plugins/serendipity_event_karma/serendipity_event_karma.php index 4ab172fa..93a51122 100644 --- a/plugins/serendipity_event_karma/serendipity_event_karma.php +++ b/plugins/serendipity_event_karma/serendipity_event_karma.php @@ -64,22 +64,20 @@ class serendipity_event_karma extends serendipity_event $propbag->add('groups', array('STATISTICS')); $propbag->add('configuration', array( // Functionality options - 'options_tab', - 'karma_active', + 'karma_active', 'karma_active_registered', - 'extended_only', - 'max_karmatime', - 'max_votetime', - 'max_entrytime', + 'extended_only', + 'max_karmatime', + 'max_votetime', + 'max_entrytime', 'min_disp_votes', - 'visits_active', - 'track_visits_of_loggedin_users', + 'visits_active', + 'track_visits_of_loggedin_users', 'min_disp_visits', - 'exits_active', + 'exits_active', 'logging', 'ajax', // Appearance options - 'appearance_tab', 'alignment', 'rate_with_words', 'textual_msg', @@ -88,7 +86,6 @@ class serendipity_event_karma extends serendipity_event 'preview_bg', 'base_image', // Text/Language options - 'text_tab', 'rate_msg', 'curr_msg', 'rate_best', @@ -101,51 +98,52 @@ class serendipity_event_karma extends serendipity_event 'text_okay', 'text_poor', 'text_vile', - // Close divs - 'end_tabs', )); + $propbag->add('config_groups', array( + PLUGIN_KARMA_TAB_OPTIONS => array( + 'karma_active', + 'karma_active_registered', + 'extended_only', + 'max_karmatime', + 'max_votetime', + 'max_entrytime', + 'min_disp_votes', + 'visits_active', + 'track_visits_of_loggedin_users', + 'min_disp_visits', + 'exits_active', + 'logging', + 'ajax', + ), + PLUGIN_KARMA_TAB_APPEARANCE => array( + 'alignment', + 'rate_with_words', + 'textual_msg', + 'textual_current', + 'textual_visits', + 'preview_bg', + 'base_image', + ), + PLUGIN_KARMA_TAB_TEXT => array( + 'rate_msg', + 'curr_msg', + 'rate_best', + 'rate_good', + 'rate_okay', + 'rate_poor', + 'rate_vile', + 'text_best', + 'text_good', + 'text_okay', + 'text_poor', + 'text_vile', + ) + )); } function introspect_config_item($name, &$propbag) { switch($name) { - // Top of tab bar - case 'options_tab': - $propbag->add('type', 'content'); - $propbag->add('default', ' - -' . PLUGIN_KARMA_TAB_OPTIONS . ' | -' . PLUGIN_KARMA_TAB_APPEARANCE . ' | -' . PLUGIN_KARMA_TAB_TEXT . ' - -
-' . PLUGIN_KARMA_TAB_OPTIONS . '
-'); - break; - case 'appearance_tab': - $propbag->add('type', 'content'); - $propbag->add('default', ' - -
-
-' . PLUGIN_KARMA_TAB_APPEARANCE . '
-'); - break; - case 'text_tab': - $propbag->add('type', 'content'); - $propbag->add('default', ' - -
-
-' . PLUGIN_KARMA_TAB_TEXT . '
-'); - break; - case 'end_tabs': - $propbag->add('type', 'content'); - $propbag->add('default', ' -
-'); - break; // Oldest entry age still valid for unrestricted voting case 'max_entrytime': $propbag->add('type', 'string');