mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-29 04:39:56 +03:00
fixes #428, ability to hide "sizes" icon on index.php or picture.php
This commit is contained in:
parent
1d5279e4a8
commit
b0ae23e34d
6 changed files with 82 additions and 19 deletions
|
@ -86,10 +86,12 @@ $display_checkboxes = array(
|
||||||
'index_posted_date_icon',
|
'index_posted_date_icon',
|
||||||
'index_created_date_icon',
|
'index_created_date_icon',
|
||||||
'index_slideshow_icon',
|
'index_slideshow_icon',
|
||||||
|
'index_sizes_icon',
|
||||||
'index_new_icon',
|
'index_new_icon',
|
||||||
'picture_metadata_icon',
|
'picture_metadata_icon',
|
||||||
'picture_slideshow_icon',
|
'picture_slideshow_icon',
|
||||||
'picture_favorite_icon',
|
'picture_favorite_icon',
|
||||||
|
'picture_sizes_icon',
|
||||||
'picture_download_icon',
|
'picture_download_icon',
|
||||||
'picture_navigation_icons',
|
'picture_navigation_icons',
|
||||||
'picture_navigation_thumb',
|
'picture_navigation_thumb',
|
||||||
|
|
|
@ -65,6 +65,14 @@
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<label class="font-checkbox">
|
||||||
|
<span class="icon-check"></span>
|
||||||
|
<input type="checkbox" name="index_sizes_icon" {if ($display.index_sizes_icon)}checked="checked"{/if}>
|
||||||
|
{'Activate icon "%s"'|translate:('Photo sizes'|translate|@ucfirst)}
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<label>
|
<label>
|
||||||
{'Number of albums per page'|translate}
|
{'Number of albums per page'|translate}
|
||||||
|
@ -109,6 +117,14 @@
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<label class="font-checkbox">
|
||||||
|
<span class="icon-check"></span>
|
||||||
|
<input type="checkbox" name="picture_sizes_icon" {if ($display.picture_sizes_icon)}checked="checked"{/if}>
|
||||||
|
{'Activate icon "%s"'|translate:('Photo sizes'|translate|@ucfirst)}
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<label class="font-checkbox">
|
<label class="font-checkbox">
|
||||||
<span class="icon-check"></span>
|
<span class="icon-check"></span>
|
||||||
|
|
|
@ -321,6 +321,9 @@ if ( empty($page['is_external']) )
|
||||||
if ( !empty($page['items']) )
|
if ( !empty($page['items']) )
|
||||||
{
|
{
|
||||||
include(PHPWG_ROOT_PATH.'include/category_default.inc.php');
|
include(PHPWG_ROOT_PATH.'include/category_default.inc.php');
|
||||||
|
|
||||||
|
if ($conf['index_sizes_icon'])
|
||||||
|
{
|
||||||
$url = add_url_params(
|
$url = add_url_params(
|
||||||
duplicate_index_url(),
|
duplicate_index_url(),
|
||||||
array('display' => '')
|
array('display' => '')
|
||||||
|
@ -343,6 +346,7 @@ if ( empty($page['is_external']) )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// slideshow
|
// slideshow
|
||||||
// execute after init thumbs in order to have all picture informations
|
// execute after init thumbs in order to have all picture informations
|
||||||
|
|
|
@ -65,3 +65,5 @@ INSERT INTO piwigo_config (param,value) VALUES ('original_resize_maxheight','201
|
||||||
INSERT INTO piwigo_config (param,value) VALUES ('original_resize_quality','95');
|
INSERT INTO piwigo_config (param,value) VALUES ('original_resize_quality','95');
|
||||||
INSERT INTO piwigo_config (param,value) VALUES ('mobile_theme',null);
|
INSERT INTO piwigo_config (param,value) VALUES ('mobile_theme',null);
|
||||||
INSERT INTO piwigo_config (param,value) VALUES ('mail_theme','clear');
|
INSERT INTO piwigo_config (param,value) VALUES ('mail_theme','clear');
|
||||||
|
INSERT INTO piwigo_config (param,value) VALUES ('picture_sizes_icon','true');
|
||||||
|
INSERT INTO piwigo_config (param,value) VALUES ('index_sizes_icon','true');
|
36
install/db/151-database.php
Normal file
36
install/db/151-database.php
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
<?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 = 'add "picture_sizes_icon" and "index_sizes_icon" parameters';
|
||||||
|
|
||||||
|
conf_update_param('index_sizes_icon', 'true');
|
||||||
|
conf_update_param('picture_sizes_icon', 'true');
|
||||||
|
|
||||||
|
echo "\n".$upgrade_description."\n";
|
||||||
|
|
||||||
|
?>
|
|
@ -186,6 +186,9 @@ function default_picture_content($content, $element_info)
|
||||||
continue;
|
continue;
|
||||||
$added[$url] = 1;
|
$added[$url] = 1;
|
||||||
$show_original &= !($derivative->same_as_source());
|
$show_original &= !($derivative->same_as_source());
|
||||||
|
|
||||||
|
// in case we do not display the sizes icon, we only add the selected size to unique_derivatives
|
||||||
|
if ($conf['picture_sizes_icon'] or $type == $deriv_type)
|
||||||
$unique_derivatives[$type]= $derivative;
|
$unique_derivatives[$type]= $derivative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue