From c4fd9f91412e5be9d9c426d18ea260ae970e96d4 Mon Sep 17 00:00:00 2001 From: patdenice Date: Tue, 23 Mar 2010 21:19:55 +0000 Subject: Feature 1533: Change "General" by "Options" in Configuration menu. Change "Default Display" tab by "Guest Settings" tab. Add display tab in Configuration/Option menu. Allow to activate/deactivate a lot of display features: On main page: # Display only recently posted images # Sort order # Display all elements in all sub-categories # Display a calendar by posted date # Display a calendar by creation date # Slideshow On photo page: # Show file metadata # slideshow # Add this image to your favorites # Navigation Bar # Navigation Thumbnails git-svn-id: http://piwigo.org/svn/trunk@5293 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/configuration.php | 39 ++++++++++- admin/themes/default/default-layout.css | 16 +++-- admin/themes/default/template/admin.tpl | 3 +- admin/themes/default/template/configuration.tpl | 89 +++++++++++++++++++++++++ include/menubar.inc.php | 2 +- index.php | 51 ++++++++------ install/config.sql | 11 +++ install/db/87-database.php | 54 +++++++++++++++ language/en_UK/admin.lang.php | 6 ++ language/fr_FR/admin.lang.php | 6 ++ picture.php | 10 ++- themes/default/template/picture.tpl | 4 ++ themes/default/template/picture_nav_buttons.tpl | 4 +- 13 files changed, 263 insertions(+), 32 deletions(-) create mode 100644 install/db/87-database.php diff --git a/admin/configuration.php b/admin/configuration.php index 433397554..b8dc57433 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -75,6 +75,20 @@ $comments_checkboxes = array( 'email_admin_on_comment_deletion' ); +$display_checkboxes = array( + 'menubar_filter_icon', + 'index_sort_order_input', + 'index_flat_icon', + 'index_posted_date_icon', + 'index_created_date_icon', + 'index_slideshow_icon', + 'picture_metadata_icon', + 'picture_slideshow_icon', + 'picture_favorite_icon', + 'picture_navigation_icons', + 'picture_navigation_thumb', + ); + //------------------------------ verification and registration of modifications if (isset($_POST['submit']) and !is_adviser()) { @@ -131,6 +145,14 @@ if (isset($_POST['submit']) and !is_adviser()) // Never go here break; } + case 'display' : + { + foreach( $display_checkboxes as $checkbox) + { + $_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true'; + } + break; + } } // updating configuration if no error found @@ -174,10 +196,11 @@ $template->set_filename('config', 'configuration.tpl'); $tabsheet = new tabsheet(); // TabSheet initialization $tabsheet->add('main', l10n('Main'), $conf_link.'main'); +$tabsheet->add('display', l10n('Display'), $conf_link.'display'); $tabsheet->add('history', l10n('History'), $conf_link.'history'); $tabsheet->add('comments', l10n('Comments'), $conf_link.'comments'); $tabsheet->add('upload', l10n('Upload'), $conf_link.'upload'); -$tabsheet->add('default', l10n('Default display'), $conf_link.'default'); +$tabsheet->add('default', l10n('Guest Settings'), $conf_link.'default'); // TabSheet selection $tabsheet->select($page['section']); // Assign tabsheet to template @@ -298,6 +321,20 @@ switch ($page['section']) $template->assign('default', array()); break; } + case 'display' : + { + foreach ($display_checkboxes as $checkbox) + { + $template->append( + 'display', + array( + $checkbox => $conf[$checkbox] + ), + true + ); + } + break; + } } //----------------------------------------------------------- sending html code diff --git a/admin/themes/default/default-layout.css b/admin/themes/default/default-layout.css index 499e11e20..aa9f4fae1 100644 --- a/admin/themes/default/default-layout.css +++ b/admin/themes/default/default-layout.css @@ -126,14 +126,18 @@ FORM#categoryPermissions LI { FIELDSET#mainConfCheck SPAN.property, FIELDSET#historyConf SPAN.property, FIELDSET#commentsConf SPAN.property, -FIELDSET#uploadConf SPAN.property { +FIELDSET#uploadConf SPAN.property, +FIELDSET#indexDisplayConf SPAN.property, +FIELDSET#pictureDisplayConf SPAN.property { float: right; text-align: left; } FIELDSET#mainConfCheck INPUT, FIELDSET#historyConf INPUT, FIELDSET#commentsConf INPUT, -FIELDSET#uploadConf INPUT { +FIELDSET#uploadConf INPUT, +FIELDSET#indexDisplayConf INPUT, +FIELDSET#pictureDisplayConf INPUT { float: none; } @@ -145,12 +149,16 @@ FIELDSET#mainConf TEXTAREA.description { } FIELDSET#mainConfCheck SPAN.property, -FIELDSET#historyConf SPAN.property { +FIELDSET#historyConf SPAN.property, +FIELDSET#indexDisplayConf SPAN.property, +FIELDSET#pictureDisplayConf SPAN.property { width: 90%; } FIELDSET#mainConfCheck INPUT, FIELDSET#historyConf INPUT, -FIELDSET#commentsConf INPUT { +FIELDSET#commentsConf INPUT, +FIELDSET#indexDisplayConf INPUT, +FIELDSET#pictureDisplayConf INPUT { margin-left: 5%; } FIELDSET#uploadConf SELECT { diff --git a/admin/themes/default/template/admin.tpl b/admin/themes/default/template/admin.tpl index dca3cda6c..23da23182 100644 --- a/admin/themes/default/template/admin.tpl +++ b/admin/themes/default/template/admin.tpl @@ -81,8 +81,7 @@ jQuery().ready(function(){ldelim}
{'Configuration'|@translate}