Fixes #273 (Add ui option to display or not the date of an album)

This commit is contained in:
Teatek 2019-01-28 17:15:52 +01:00 committed by Pierrick Le Gall
parent 743d31c9e0
commit 1907e678b8
6 changed files with 70 additions and 4 deletions

View file

@ -90,6 +90,7 @@ $display_checkboxes = array(
'index_new_icon', 'index_new_icon',
'index_edit_icon', 'index_edit_icon',
'index_caddie_icon', 'index_caddie_icon',
'display_fromto',
'picture_metadata_icon', 'picture_metadata_icon',
'picture_slideshow_icon', 'picture_slideshow_icon',
'picture_favorite_icon', 'picture_favorite_icon',

View file

@ -106,6 +106,14 @@
</label> </label>
</li> </li>
<li>
<label class="font-checkbox">
<span class="icon-check"></span>
<input type="checkbox" name="display_fromto" {if ($display.display_fromto)}checked="checked"{/if}>
{'Display category date'|translate}
</label>
</li>
<li> <li>
<label> <label>
{'Number of albums per page'|translate} {'Number of albums per page'|translate}

View file

@ -199,10 +199,6 @@ $conf['header_notes'] = array();
// show_thumbnail_caption : on thumbnails page, show thumbnail captions ? // show_thumbnail_caption : on thumbnails page, show thumbnail captions ?
$conf['show_thumbnail_caption'] = true; $conf['show_thumbnail_caption'] = true;
// display_fromto: display the date creation bounds of a
// category.
$conf['display_fromto'] = false;
// allow_random_representative : do you wish Piwigo to search among // allow_random_representative : do you wish Piwigo to search among
// categories elements a new representative at each reload ? // categories elements a new representative at each reload ?
// //

View file

@ -69,6 +69,7 @@ INSERT INTO piwigo_config (param,value) VALUES ('picture_sizes_icon','true');
INSERT INTO piwigo_config (param,value) VALUES ('index_sizes_icon','true'); INSERT INTO piwigo_config (param,value) VALUES ('index_sizes_icon','true');
INSERT INTO piwigo_config (param,value) VALUES ('index_edit_icon','true'); INSERT INTO piwigo_config (param,value) VALUES ('index_edit_icon','true');
INSERT INTO piwigo_config (param,value) VALUES ('index_caddie_icon','true'); INSERT INTO piwigo_config (param,value) VALUES ('index_caddie_icon','true');
INSERT INTO piwigo_config (param,value) VALUES ('display_fromto','false');
INSERT INTO piwigo_config (param,value) VALUES ('picture_edit_icon','true'); INSERT INTO piwigo_config (param,value) VALUES ('picture_edit_icon','true');
INSERT INTO piwigo_config (param,value) VALUES ('picture_caddie_icon','true'); INSERT INTO piwigo_config (param,value) VALUES ('picture_caddie_icon','true');
INSERT INTO piwigo_config (param,value) VALUES ('picture_representative_icon','true'); INSERT INTO piwigo_config (param,value) VALUES ('picture_representative_icon','true');

View file

@ -0,0 +1,59 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2016 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 = 'Show date of a category';
function value_display_fromto()
{
$file = PHPWG_ROOT_PATH.'local/config/config.inc.php';
if (file_exists($file))
{
$conf = array();
include($file);
if (isset($conf['display_fromto']) and $conf['display_fromto'])
{
return 'true';
}
}
return 'false';
}
$value = value_display_fromto();
$query = '
INSERT INTO '.PREFIX_TABLE.'config (param,value,comment)
VALUES (\'display_fromto\',\''.$value.'\', \''.$upgrade_description.'\')
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View file

@ -1015,3 +1015,4 @@ $lang['With no checksum'] = 'With no checksum';
$lang['Compute %d missing checksums'] = 'Compute %d missing checksums'; $lang['Compute %d missing checksums'] = 'Compute %d missing checksums';
$lang['checksums to add'] = 'checksums to add'; $lang['checksums to add'] = 'checksums to add';
$lang['Synchronization in progress'] = 'Synchronization in progress'; $lang['Synchronization in progress'] = 'Synchronization in progress';
$lang['Display category date'] = 'Display category date';