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
This commit is contained in:
patdenice
2010-03-23 21:19:55 +00:00
parent 8b816a18f4
commit c4fd9f9141
13 changed files with 263 additions and 32 deletions
+38 -1
View File
@@ -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
+12 -4
View File
@@ -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 {
+1 -2
View File
@@ -81,8 +81,7 @@ jQuery().ready(function(){ldelim}
<dt class="rdion"><span>{'Configuration'|@translate}&nbsp;</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>
@@ -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}>
+1 -1
View File
@@ -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'])
{
+30 -21
View File
@@ -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']);
}
+11
View File
@@ -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');
+54
View File
@@ -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"
;
?>
+6
View File
@@ -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';
?>
+6
View File
@@ -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';
?>
+8 -2
View File
@@ -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
+4
View File
@@ -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">
@@ -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}
@@ -57,6 +58,7 @@
{else}
<a class="navButton"> <img src="{$ROOT_URL}{$themeconf.icon_dir}/inc_period_unactive.png" class="button" alt=""></a>
{/if}
{/if}
{/if}
</div>