From 6875291b551bc0680a06ea8b448ab2155f35c3de Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Tue, 19 Aug 2008 10:56:03 +0000 Subject: [PATCH] Use sequencing widget for entryrproperties plugin to allow shuffling the order of displayed elements --- docs/NEWS | 4 + .../lang_en.inc.php | 3 + .../serendipity_event_entryproperties.php | 385 +++++++++++------- 3 files changed, 239 insertions(+), 153 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index 9515e354..993fb37b 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,10 @@ Version 1.4 () ------------------------------------------------------------------------ + * Enhance entryproperties plugin to use sequencing widget: Allows + you to configure which fields you want to see in the 'Edit Entry' + panel for "Advanced Options". (garvinhicking) + * Propagate a 'article_count' smarty variable for each category in the category sidebar plugin, when article counting is enabled. (garvinhicking) diff --git a/plugins/serendipity_event_entryproperties/lang_en.inc.php b/plugins/serendipity_event_entryproperties/lang_en.inc.php index 116ef0a5..37d6918c 100644 --- a/plugins/serendipity_event_entryproperties/lang_en.inc.php +++ b/plugins/serendipity_event_entryproperties/lang_en.inc.php @@ -39,3 +39,6 @@ @define('PLUGIN_EVENT_ENTRYPROPERTIES_DISABLE_MARKUP', 'Disable Markup plugins for this entry:'); @define('PLUGIN_EVENT_ENTRYPROPERTIES_EXTJOINS', 'Use extended database lookups'); @define('PLUGIN_EVENT_ENTRYPROPERTIES_EXTJOINS_DESC', 'If enabled, additional SQL queries will be issued to be able to use sticky entries, hidden entries and removed entries from the frontpage. If those are not needed, disabling this feature can improve performance.'); + +@define('PLUGIN_EVENT_ENTRYPROPERTIES_SEQUENCE', 'Entry editing screen'); +@define('PLUGIN_EVENT_ENTRYPROPERTIES_SEQUENCE_DESC', 'Here you can choose, which elements and in which order the plugin should show its input fields in the entry editing process.'); \ No newline at end of file diff --git a/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php b/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php index 60e6dfe2..72a796b8 100644 --- a/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php +++ b/plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php @@ -26,7 +26,7 @@ class serendipity_event_entryproperties extends serendipity_event $propbag->add('description', PLUGIN_EVENT_ENTRYPROPERTIES_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Garvin Hicking'); - $propbag->add('version', '1.17'); + $propbag->add('version', '1.20'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', @@ -53,7 +53,7 @@ class serendipity_event_entryproperties extends serendipity_event 'frontend_configure' => true )); $propbag->add('groups', array('BACKEND_EDITOR')); - $propbag->add('configuration', array('cache', 'use_groups', 'use_users', 'use_ext_joins', 'default_read', 'customfields')); + $propbag->add('configuration', array('cache', 'sequence', 'use_groups', 'use_users', 'use_ext_joins', 'default_read', 'customfields')); } function introspect_config_item($name, &$propbag) @@ -106,6 +106,29 @@ class serendipity_event_entryproperties extends serendipity_event $propbag->add('description', PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_DESC); $propbag->add('default', 'true'); break; + + case 'sequence': + $propbag->add('type', 'sequence'); + $propbag->add('name', PLUGIN_EVENT_ENTRYPROPERTIES_SEQUENCE); + $propbag->add('description', PLUGIN_EVENT_ENTRYPROPERTIES_SEQUENCE_DESC); + $propbag->add('checkable', true); + + $values = array( + 'sticky' => array('display' => PLUGIN_EVENT_ENTRYPROPERTIES_STICKYPOSTS), + 'frontpage' => array('display' => PLUGIN_EVENT_ENTRYPROPERTIES_NO_FRONTPAGE), + 'hiderss' => array('display' => PLUGIN_EVENT_ENTRYPROPERTIES_HIDERSS), + 'access' => array('display' => PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS), + 'password' => array('display' => PASSWORD), + 'groups' => array('display' => PERM_READ . ': ' . GROUP), + 'authors' => array('display' => PERM_READ . ': ' . AUTHOR), + 'author' => array('display' => AUTHOR), + 'markup' => array('display' => PLUGIN_EVENT_ENTRYPROPERTIES_DISABLE_MARKUP), + 'customfields' => array('display' => PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS), + ); + $propbag->add('values', $values); + $propbag->add('default', 'sticky,frontpage,hiderss,access,password,groups,authors,author,markup,customfields'); + break; + } return true; } @@ -239,6 +262,206 @@ class serendipity_event_entryproperties extends serendipity_event } + function showBackend($element, $is_sticky, $no_frontpage, $hiderss, $access_values, $access, $password, $use_groups, $access_groups, $use_users, $access_users, $more = array()) { + global $serendipity; + + switch($element) { + case 'sticky': +?> +
+ /> + +
+ +
+ /> + +
+ +
+ /> + +
+ +
:
+
+ $radio_value) { +?> + /> + + +
+ +
:
+
+ +
+ +
' . GROUP . ''; ?>
+ + + +
'; + } + return true; + + case 'author': +?> +
:
+
+ +
+ +
+
+
+ +
+
+ +
+ get_config('customfields')); + if (!empty($fields)) { + $fields = explode(',', $fields); + } + if (is_array($fields) && count($fields) > 0) { ?> +
+ :
+ ' . sprintf(PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC3, 'serendipity_admin.php?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]=' . $this->instance); ?>
+
+ + + + + + + + +
+
+ +
+
-
- /> - -
-
- /> - -
-
- /> - -
+ -
- :
-
- $radio_value) { -?> - /> - -get_config('sequence')); + foreach($elements AS $element) { + $this->showBackend($element, $is_sticky, $no_frontpage, $hiderss, $access_values, $access, $password, $use_groups, $access_groups, $use_users, $access_users, $more); } ?> -
-
- :
-
- -
- -
- - -'; - } -?> -
-
- :
-
- -
- -
-
-
-
- -
-
- -
- get_config('customfields')); - if (!empty($fields)) { - $fields = explode(',', $fields); - } - if (is_array($fields) && count($fields) > 0) { ?> -
- :
- ' . sprintf(PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC3, 'serendipity_admin.php?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]=' . $this->instance); ?>
-
- - - - - - - - -
-
- -
-