diff options
-rw-r--r-- | admin/configuration.php | 39 | ||||
-rw-r--r-- | admin/themes/default/default-layout.css | 16 | ||||
-rw-r--r-- | admin/themes/default/template/admin.tpl | 3 | ||||
-rw-r--r-- | admin/themes/default/template/configuration.tpl | 89 | ||||
-rw-r--r-- | include/menubar.inc.php | 2 | ||||
-rw-r--r-- | index.php | 51 | ||||
-rw-r--r-- | install/config.sql | 11 | ||||
-rw-r--r-- | install/db/87-database.php | 54 | ||||
-rw-r--r-- | language/en_UK/admin.lang.php | 6 | ||||
-rw-r--r-- | language/fr_FR/admin.lang.php | 6 | ||||
-rw-r--r-- | picture.php | 10 | ||||
-rw-r--r-- | themes/default/template/picture.tpl | 4 | ||||
-rw-r--r-- | themes/default/template/picture_nav_buttons.tpl | 4 |
13 files changed, 263 insertions, 32 deletions
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} <dt class="rdion"><span>{'Configuration'|@translate} </span></dt> <dd> <ul> - <li><a href="{$U_CONFIG_GENERAL}">{'General'|@translate}</a></li> - <li><a href="{$U_CONFIG_DISPLAY}">{'Default display'|@translate}</a></li> + <li><a href="{$U_CONFIG_GENERAL}">{'Options'|@translate}</a></li> <li><a href="{$U_CONFIG_MENUBAR}">{'Menu'|@translate}</a></li> <li><a href="{$U_CONFIG_EXTENTS}">{'Templates'|@translate}</a></li> <li><a href="{$U_CONFIG_THEMES}">{'Themes'|@translate}</a></li> diff --git a/admin/themes/default/template/configuration.tpl b/admin/themes/default/template/configuration.tpl index 9d7e3008d..82b80f8c3 100644 --- a/admin/themes/default/template/configuration.tpl +++ b/admin/themes/default/template/configuration.tpl @@ -202,6 +202,95 @@ {$PROFILE_CONTENT} {/if} +{if isset($display)} +<fieldset id="indexDisplayConf"> + <legend>{'Main Page'|@translate}</legend> + <ul> + <li> + <label> + <span class="property">{'display only recently posted images'|@translate|@ucfirst}</span> + <input type="checkbox" name="menubar_filter_icon" {if ($display.menubar_filter_icon)}checked="checked"{/if}> + </label> + </li> + + <li> + <label> + <span class="property">{'Sort order'|@translate}</span> + <input type="checkbox" name="index_sort_order_input" {if ($display.index_sort_order_input)}checked="checked"{/if}> + </label> + </li> + + <li> + <label> + <span class="property">{'display all elements in all sub-categories'|@translate|@ucfirst}</span> + <input type="checkbox" name="index_flat_icon" {if ($display.index_flat_icon)}checked="checked"{/if}> + </label> + </li> + + <li> + <label> + <span class="property">{'display a calendar by posted date'|@translate|@ucfirst}</span> + <input type="checkbox" name="index_posted_date_icon" {if ($display.index_posted_date_icon)}checked="checked"{/if}> + </label> + </li> + + <li> + <label> + <span class="property">{'display a calendar by creation date'|@translate|@ucfirst}</span> + <input type="checkbox" name="index_created_date_icon" {if ($display.index_created_date_icon)}checked="checked"{/if}> + </label> + </li> + + <li> + <label> + <span class="property">{'slideshow'|@translate|@ucfirst}</span> + <input type="checkbox" name="index_slideshow_icon" {if ($display.index_slideshow_icon)}checked="checked"{/if}> + </label> + </li> + </ul> +</fieldset> + +<fieldset id="pictureDisplayConf"> + <legend>{'Photo Page'|@translate}</legend> + <ul> + <li> + <label> + <span class="property">{'Show file metadata'|@translate}</span> + <input type="checkbox" name="picture_metadata_icon" {if ($display.picture_metadata_icon)}checked="checked"{/if}> + </label> + </li> + + <li> + <label> + <span class="property">{'slideshow'|@translate}</span> + <input type="checkbox" name="picture_slideshow_icon" {if ($display.picture_slideshow_icon)}checked="checked"{/if}> + </label> + </li> + + <li> + <label> + <span class="property">{'add this image to your favorites'|@translate|@ucfirst}</span> + <input type="checkbox" name="picture_favorite_icon" {if ($display.picture_favorite_icon)}checked="checked"{/if}> + </label> + </li> + + <li> + <label> + <span class="property">{'Navigation Bar'|@translate|@ucfirst}</span> + <input type="checkbox" name="picture_navigation_icons" {if ($display.picture_navigation_icons)}checked="checked"{/if}> + </label> + </li> + + <li> + <label> + <span class="property">{'Navigation Thumbnails'|@translate|@ucfirst}</span> + <input type="checkbox" name="picture_navigation_thumb" {if ($display.picture_navigation_thumb)}checked="checked"{/if}> + </label> + </li> + </ul> +</fieldset> +{/if} + {if !isset($default)} <p> <input class="submit" type="submit" name="submit" value="{'Submit'|@translate}" {$TAG_INPUT_ENABLED}> diff --git a/include/menubar.inc.php b/include/menubar.inc.php index 39da47ada..27de0d5ef 100644 --- a/include/menubar.inc.php +++ b/include/menubar.inc.php @@ -79,7 +79,7 @@ function initialize_menu() //-------------------------------------------------------------- categories $block = $menu->get_block('mbCategories'); //------------------------------------------------------------------------ filter - if (!empty($conf['filter_pages']) and get_filter_page_value('used')) + if ($conf['menubar_filter_icon'] and !empty($conf['filter_pages']) and get_filter_page_value('used')) { if ($filter['enabled']) { @@ -107,7 +107,7 @@ if (isset($page['flat']) or isset($page['chronology_field'])) ); } -if (!isset($page['flat']) and 'categories' == $page['section']) +if ($conf['index_flat_icon'] and !isset($page['flat']) and 'categories' == $page['section']) { $template->assign( 'U_MODE_FLAT', @@ -123,16 +123,21 @@ if (!isset($page['chronology_field'])) 'chronology_style' => 'monthly', 'chronology_view' => 'list', ); - $template->assign( - 'U_MODE_CREATED', - duplicate_index_url( $chronology_params, array('start', 'flat') ) - ); - - $chronology_params['chronology_field'] = 'posted'; - $template->assign( - 'U_MODE_POSTED', - duplicate_index_url( $chronology_params, array('start', 'flat') ) - ); + if ($conf['index_created_date_icon']) + { + $template->assign( + 'U_MODE_CREATED', + duplicate_index_url( $chronology_params, array('start', 'flat') ) + ); + } + if ($conf['index_posted_date_icon']) + { + $chronology_params['chronology_field'] = 'posted'; + $template->assign( + 'U_MODE_POSTED', + duplicate_index_url( $chronology_params, array('start', 'flat') ) + ); + } } else { @@ -144,14 +149,17 @@ else { $chronology_field = 'created'; } - $url = duplicate_index_url( - array('chronology_field'=>$chronology_field ), - array('chronology_date', 'start', 'flat') - ); - $template->assign( - 'U_MODE_'.strtoupper($chronology_field), - $url - ); + if ($conf['index_'.$chronology_field.'_date_icon']) + { + $url = duplicate_index_url( + array('chronology_field'=>$chronology_field ), + array('chronology_date', 'start', 'flat') + ); + $template->assign( + 'U_MODE_'.strtoupper($chronology_field), + $url + ); + } } if ('search' == $page['section']) @@ -218,7 +226,8 @@ if ( $page['section']=='search' and $page['start']==0 and // navigation bar $template->assign( 'navbar', $page['navigation_bar'] ); -if ( count($page['items']) > 0 +if ( $conf['index_sort_order_input'] + and count($page['items']) > 0 and $page['section'] != 'most_visited' and $page['section'] != 'best_rated') { @@ -278,7 +287,7 @@ if (!empty($page['cat_slideshow_url'])) { redirect($page['cat_slideshow_url']); } - else + elseif ($conf['index_slideshow_icon']) { $template->assign('U_SLIDESHOW', $page['cat_slideshow_url']); } diff --git a/install/config.sql b/install/config.sql index 3f807a6bb..ad638325b 100644 --- a/install/config.sql +++ b/install/config.sql @@ -32,6 +32,17 @@ INSERT INTO piwigo_config (param,value,comment) VALUES ('upload_link_everytime', INSERT INTO piwigo_config (param,value,comment) VALUES ('upload_user_access',2 /*ACCESS_CLASSIC*/,'User access level to upload'); INSERT INTO piwigo_config (param,value,comment) VALUES ('extents_for_templates','a:0:{}','Actived template-extension(s)'); INSERT INTO piwigo_config (param,value,comment) VALUES ('blk_menubar','','Menubar options'); +INSERT INTO piwigo_config (param,value,comment) VALUES ('menubar_filter_icon','true','Display filter icon'); +INSERT INTO piwigo_config (param,value,comment) VALUES ('index_sort_order_input','true','Display image order selection list'); +INSERT INTO piwigo_config (param,value,comment) VALUES ('index_flat_icon','true','Display flat icon'); +INSERT INTO piwigo_config (param,value,comment) VALUES ('index_posted_date_icon','true','Display calendar by posted date'); +INSERT INTO piwigo_config (param,value,comment) VALUES ('index_created_date_icon','true','Display calendar by creation date icon'); +INSERT INTO piwigo_config (param,value,comment) VALUES ('index_slideshow_icon','true','Display slideshow icon'); +INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_metadata_icon','true','Display metadata icon on picture page'); +INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_slideshow_icon','true','Display slideshow icon on picture page'); +INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_favorite_icon','true','Display favorite icon on picture page'); +INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_navigation_icons','true','Display navigation icons on picture page'); +INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_navigation_thumb','true','Display navigation thumbnails on picture page'); INSERT INTO piwigo_themes (id, name) VALUES ('Sylvia', 'Sylvia'); INSERT INTO piwigo_themes (id, name) VALUES ('clear', 'clear'); diff --git a/install/db/87-database.php b/install/db/87-database.php new file mode 100644 index 000000000..d5d188eb2 --- /dev/null +++ b/install/db/87-database.php @@ -0,0 +1,54 @@ +<?php +// +-----------------------------------------------------------------------+ +// | Piwigo - a PHP based picture gallery | +// +-----------------------------------------------------------------------+ +// | Copyright(C) 2008-2009 Piwigo Team http://piwigo.org | +// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | +// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | +// +-----------------------------------------------------------------------+ +// | This program is free software; you can redistribute it and/or modify | +// | it under the terms of the GNU General Public License as published by | +// | the Free Software Foundation | +// | | +// | This program is distributed in the hope that it will be useful, but | +// | WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | +// | General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | +// | USA. | +// +-----------------------------------------------------------------------+ + +if (!defined("PHPWG_ROOT_PATH")) +{ + die('Hacking attempt!'); +} + +$upgrade_description = 'Add display configuration options.'; + +$query = ' +INSERT INTO '.CONFIG_TABLE.' (param,value,comment) + VALUES + ("menubar_filter_icon","true","Display filter icon"), + ("index_sort_order_input","true","Display image order selection list"), + ("index_flat_icon","true","Display flat icon"), + ("index_posted_date_icon","true","Display calendar by posted date"), + ("index_created_date_icon","true","Display calendar by creation date icon"), + ("index_slideshow_icon","true","Display slideshow icon"), + ("picture_metadata_icon","true","Display metadata icon on picture page"), + ("picture_slideshow_icon","true","Display slideshow icon on picture page"), + ("picture_favorite_icon","true","Display favorite icon on picture page"), + ("picture_navigation_icons","true","Display navigation icons on picture page"), + ("picture_navigation_thumb","true","Display navigation thumbnails on picture page") +;'; + +pwg_query($query); + +echo +"\n" +. $upgrade_description +."\n" +; +?>
\ No newline at end of file diff --git a/language/en_UK/admin.lang.php b/language/en_UK/admin.lang.php index 65fa2023f..973793ec7 100644 --- a/language/en_UK/admin.lang.php +++ b/language/en_UK/admin.lang.php @@ -679,4 +679,10 @@ $lang['Add New Theme'] = "Add New Theme"; $lang['Forbid this theme to users'] = "Forbid this theme to users"; $lang['Set as default theme for unregistered and new users'] = "Set as default theme for unregistered and new users"; $lang['unknown'] = 'unknown'; + +$lang['Guest Settings'] = 'Guest Settings'; +$lang['Main Page'] = 'Main Page'; +$lang['Photo Page'] = 'Photo Page'; +$lang['Navigation Bar'] = 'Navigation Bar'; +$lang['Navigation Thumbnails'] = 'Navigation Thumbnails'; ?>
\ No newline at end of file diff --git a/language/fr_FR/admin.lang.php b/language/fr_FR/admin.lang.php index c3a9727d3..132bfd2ff 100644 --- a/language/fr_FR/admin.lang.php +++ b/language/fr_FR/admin.lang.php @@ -678,4 +678,10 @@ $lang['Add New Theme'] = "Ajouter un thème"; $lang['Forbid this theme to users'] = "Interdire ce thème aux utilisateurs"; $lang['Set as default theme for unregistered and new users'] = "Thème par défaut pour les invités et les nouveaux utilisateurs"; $lang['unknown'] = 'inconnu'; + +$lang['Guest Settings'] = 'Paramètres invité'; +$lang['Main Page'] = 'Page Principale'; +$lang['Photo Page'] = 'Page de la Photo'; +$lang['Navigation Bar'] = 'Barre de navigation'; +$lang['Navigation Thumbnails'] = 'Miniatures de navigation'; ?>
\ No newline at end of file diff --git a/picture.php b/picture.php index 6edbb6ca0..289839e7a 100644 --- a/picture.php +++ b/picture.php @@ -716,7 +716,7 @@ if ($page['slideshow']) } $template->assign('slideshow', $tpl_slideshow ); } -else +elseif ($conf['picture_slideshow_icon']) { $template->assign( array( @@ -739,10 +739,16 @@ $template->assign( 'U_HOME' => make_index_url(), 'U_UP' => $url_up, - 'U_METADATA' => $url_metadata, + 'DISPLAY_NAV_BUTTONS' => $conf['picture_navigation_icons'], + 'DISPLAY_NAV_THUMB' => $conf['picture_navigation_thumb'] ) ); +if ($conf['picture_metadata_icon']) +{ + $template->assign('U_METADATA', $url_metadata); +} + //------------------------------------------------------- upper menu management diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl index e5dd470e9..84dd8e43f 100644 --- a/themes/default/template/picture.tpl +++ b/themes/default/template/picture.tpl @@ -46,7 +46,9 @@ {if isset($U_SLIDESHOW_STOP) } <a href="{$U_SLIDESHOW_STOP}" title="{'stop the slideshow'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/stop_slideshow.png" class="button" alt="{'stop the slideshow'|@translate}"></a> {/if} + {if isset($U_METADATA) } <a href="{$U_METADATA}" title="{'Show file metadata'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/metadata.png" class="button" alt="metadata"></a> + {/if} {if isset($current.U_DOWNLOAD) } <a href="{$current.U_DOWNLOAD}" title="{'download'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/save.png" class="button" alt="{'download'|@translate}"></a> {/if} @@ -98,6 +100,7 @@ y.callService( </div> +{if $DISPLAY_NAV_THUMB} {if isset($previous) } <a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'Previous'|@translate} : {$previous.TITLE}" rel="prev"> <img src="{$previous.THUMB_SRC}" alt="{$previous.TITLE}"> @@ -108,6 +111,7 @@ y.callService( <img src="{$next.THUMB_SRC}" alt="{$next.TITLE}"> </a> {/if} +{/if} <table id="standard" class="infoTable" summary="{'Some info about this picture'|@translate}"> <tr id="Author"> diff --git a/themes/default/template/picture_nav_buttons.tpl b/themes/default/template/picture_nav_buttons.tpl index 06b236a88..f0e1300b5 100644 --- a/themes/default/template/picture_nav_buttons.tpl +++ b/themes/default/template/picture_nav_buttons.tpl @@ -1,5 +1,6 @@ <div class="navButtons"> - + +{if $DISPLAY_NAV_BUTTONS and !isset($slideshow)} {if isset($last)} <a class="navButton" href="{$last.U_IMG}" title="{'Last'|@translate} : {$last.TITLE}" rel="last"><img src="{$ROOT_URL}{$themeconf.icon_dir}/last.png" class="button" alt="{'Last'|@translate}"></a> {else} @@ -58,6 +59,7 @@ <a class="navButton"> <img src="{$ROOT_URL}{$themeconf.icon_dir}/inc_period_unactive.png" class="button" alt=""></a> {/if} {/if} +{/if} </div> |