mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 11:19:55 +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_created_date_icon',
|
||||
'index_slideshow_icon',
|
||||
'index_sizes_icon',
|
||||
'index_new_icon',
|
||||
'picture_metadata_icon',
|
||||
'picture_slideshow_icon',
|
||||
'picture_favorite_icon',
|
||||
'picture_sizes_icon',
|
||||
'picture_download_icon',
|
||||
'picture_navigation_icons',
|
||||
'picture_navigation_thumb',
|
||||
|
|
|
@ -65,6 +65,14 @@
|
|||
</label>
|
||||
</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>
|
||||
<label>
|
||||
{'Number of albums per page'|translate}
|
||||
|
@ -109,6 +117,14 @@
|
|||
</label>
|
||||
</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>
|
||||
<label class="font-checkbox">
|
||||
<span class="icon-check"></span>
|
||||
|
|
40
index.php
40
index.php
|
@ -321,26 +321,30 @@ if ( empty($page['is_external']) )
|
|||
if ( !empty($page['items']) )
|
||||
{
|
||||
include(PHPWG_ROOT_PATH.'include/category_default.inc.php');
|
||||
$url = add_url_params(
|
||||
duplicate_index_url(),
|
||||
array('display' => '')
|
||||
);
|
||||
|
||||
$selected_type = $template->get_template_vars('derivative_params')->type;
|
||||
$template->clear_assign( 'derivative_params' );
|
||||
$type_map = ImageStdParams::get_defined_type_map();
|
||||
unset($type_map[IMG_XXLARGE], $type_map[IMG_XLARGE]);
|
||||
|
||||
foreach($type_map as $params)
|
||||
|
||||
if ($conf['index_sizes_icon'])
|
||||
{
|
||||
$template->append(
|
||||
'image_derivatives',
|
||||
array(
|
||||
'DISPLAY' => l10n($params->type),
|
||||
'URL' => $url.$params->type,
|
||||
'SELECTED' => ($params->type == $selected_type ? true:false),
|
||||
)
|
||||
$url = add_url_params(
|
||||
duplicate_index_url(),
|
||||
array('display' => '')
|
||||
);
|
||||
|
||||
$selected_type = $template->get_template_vars('derivative_params')->type;
|
||||
$template->clear_assign( 'derivative_params' );
|
||||
$type_map = ImageStdParams::get_defined_type_map();
|
||||
unset($type_map[IMG_XXLARGE], $type_map[IMG_XLARGE]);
|
||||
|
||||
foreach($type_map as $params)
|
||||
{
|
||||
$template->append(
|
||||
'image_derivatives',
|
||||
array(
|
||||
'DISPLAY' => l10n($params->type),
|
||||
'URL' => $url.$params->type,
|
||||
'SELECTED' => ($params->type == $selected_type ? true:false),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 ('mobile_theme',null);
|
||||
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,7 +186,10 @@ function default_picture_content($content, $element_info)
|
|||
continue;
|
||||
$added[$url] = 1;
|
||||
$show_original &= !($derivative->same_as_source());
|
||||
$unique_derivatives[$type]= $derivative;
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
global $page, $template;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue