Feature 1533: Allow activation or deactivation of download icon.

Add display configuration for picture properties.

git-svn-id: http://piwigo.org/svn/trunk@5304 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
patdenice 2010-03-24 00:39:34 +00:00
commit 151920ed09
10 changed files with 200 additions and 10 deletions

View file

@ -89,6 +89,19 @@ $display_checkboxes = array(
'picture_navigation_thumb',
);
$display_info_checkboxes = array(
'author',
'created_on',
'posted_on',
'dimensions',
'file',
'filesize',
'tags',
'categories',
'visits',
'average_rate',
);
//------------------------------ verification and registration of modifications
if (isset($_POST['submit']) and !is_adviser())
{
@ -151,6 +164,12 @@ if (isset($_POST['submit']) and !is_adviser())
{
$_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true';
}
foreach( $display_info_checkboxes as $checkbox)
{
$_POST['picture_informations'][$checkbox] =
empty($_POST['picture_informations'][$checkbox])? false : true;
}
$_POST['picture_informations'] = addslashes(serialize($_POST['picture_informations']));
break;
}
}
@ -333,6 +352,13 @@ switch ($page['section'])
true
);
}
$template->append(
'display',
array(
'picture_informations' => unserialize($conf['picture_informations'])
),
true
);
break;
}
}

View file

@ -128,7 +128,8 @@ FIELDSET#historyConf SPAN.property,
FIELDSET#commentsConf SPAN.property,
FIELDSET#uploadConf SPAN.property,
FIELDSET#indexDisplayConf SPAN.property,
FIELDSET#pictureDisplayConf SPAN.property {
FIELDSET#pictureDisplayConf SPAN.property,
FIELDSET#pictureInfoConf SPAN.property {
float: right;
text-align: left;
}
@ -137,7 +138,8 @@ FIELDSET#historyConf INPUT,
FIELDSET#commentsConf INPUT,
FIELDSET#uploadConf INPUT,
FIELDSET#indexDisplayConf INPUT,
FIELDSET#pictureDisplayConf INPUT {
FIELDSET#pictureDisplayConf INPUT,
FIELDSET#pictureInfoConf INPUT {
float: none;
}
@ -151,14 +153,16 @@ FIELDSET#mainConf TEXTAREA.description {
FIELDSET#mainConfCheck SPAN.property,
FIELDSET#historyConf SPAN.property,
FIELDSET#indexDisplayConf SPAN.property,
FIELDSET#pictureDisplayConf SPAN.property {
FIELDSET#pictureDisplayConf SPAN.property,
FIELDSET#pictureInfoConf SPAN.property {
width: 90%;
}
FIELDSET#mainConfCheck INPUT,
FIELDSET#historyConf INPUT,
FIELDSET#commentsConf INPUT,
FIELDSET#indexDisplayConf INPUT,
FIELDSET#pictureDisplayConf INPUT {
FIELDSET#pictureDisplayConf INPUT,
FIELDSET#pictureInfoConf INPUT {
margin-left: 5%;
}
FIELDSET#uploadConf SELECT {

View file

@ -103,7 +103,6 @@
</fieldset>
{/if}
{if isset($comments)}
<fieldset id="commentsConf">
<legend></legend>
@ -129,7 +128,6 @@
</label>
</li>
<li>
<label>
<span class="property">{'Email admins when a valid comment is entered'|@translate}</span>
@ -289,6 +287,88 @@
</li>
</ul>
</fieldset>
<fieldset id="pictureInfoConf">
<legend>{'Photo Properties'|@translate}</legend>
<ul>
<li>
<label>
<span class="property">{'Author'|@translate}</span>
<input type="checkbox" name="picture_informations[author]" {if ($display.picture_informations.author)}checked="checked"{/if}>
</label>
</li>
<li>
<label>
<span class="property">{'Created on'|@translate}</span>
<input type="checkbox" name="picture_informations[created_on]" {if ($display.picture_informations.created_on)}checked="checked"{/if}>
</label>
</li>
<li>
<label>
<span class="property">{'Posted on'|@translate}</span>
<input type="checkbox" name="picture_informations[posted_on]" {if ($display.picture_informations.posted_on)}checked="checked"{/if}>
</label>
</li>
<li>
<label>
<span class="property">{'Dimensions'|@translate}</span>
<input type="checkbox" name="picture_informations[dimensions]" {if ($display.picture_informations.dimensions)}checked="checked"{/if}>
</label>
</li>
<li>
<label>
<span class="property">{'File'|@translate}</span>
<input type="checkbox" name="picture_informations[file]" {if ($display.picture_informations.file)}checked="checked"{/if}>
</label>
</li>
<li>
<label>
<span class="property">{'Filesize'|@translate}</span>
<input type="checkbox" name="picture_informations[filesize]" {if ($display.picture_informations.filesize)}checked="checked"{/if}>
</label>
</li>
<li>
<label>
<span class="property">{'Tags'|@translate}</span>
<input type="checkbox" name="picture_informations[tags]" {if ($display.picture_informations.tags)}checked="checked"{/if}>
</label>
</li>
<li>
<label>
<span class="property">{'Categories'|@translate}</span>
<input type="checkbox" name="picture_informations[categories]" {if ($display.picture_informations.categories)}checked="checked"{/if}>
</label>
</li>
<li>
<label>
<span class="property">{'Visits'|@translate}</span>
<input type="checkbox" name="picture_informations[visits]" {if ($display.picture_informations.visits)}checked="checked"{/if}>
</label>
</li>
<li>
<label>
<span class="property">{'Average rate'|@translate}</span>
<input type="checkbox" name="picture_informations[average_rate]" {if ($display.picture_informations.average_rate)}checked="checked"{/if}>
</label>
</li>
<li>
<label>
<span class="property">{'Privacy level'|@translate} ({'available for administrators only'|@translate})</span>
<input type="checkbox" name="picture_informations[privacy_level]" {if ($display.picture_informations.privacy_level)}checked="checked"{/if}>
</label>
</li>
</ul>
</fieldset>
{/if}
{if !isset($default)}

View file

@ -41,8 +41,15 @@ INSERT INTO piwigo_config (param,value,comment) VALUES ('index_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_download_icon','true','Display download 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_config (param,value,comment)
VALUES (
'picture_informations',
'a:11:{s:6:"author";b:1;s:10:"created_on";b:1;s:9:"posted_on";b:1;s:10:"dimensions";b:1;s:4:"file";b:1;s:8:"filesize";b:1;s:4:"tags";b:1;s:10:"categories";b:1;s:6:"visits";b:1;s:12:"average_rate";b:1;s:13:"privacy_level";b:1;}',
'Information displayed on picture page'
);
INSERT INTO piwigo_themes (id, name) VALUES ('Sylvia', 'Sylvia');
INSERT INTO piwigo_themes (id, name) VALUES ('clear', 'clear');

View file

@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based picture gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2009 Piwigo Team http://piwigo.org |
// | Copyright(C) 2008-2010 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 |
// +-----------------------------------------------------------------------+

View file

@ -0,0 +1,49 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based picture gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2010 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 for picture properties.';
$query = '
INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
VALUES
("picture_download_icon","true","Display download icon on picture page"),
(
"picture_informations",
"a:11:{s:6:\"author\";b:1;s:10:\"created_on\";b:1;s:9:\"posted_on\";b:1;s:10:\"dimensions\";b:1;s:4:\"file\";b:1;s:8:\"filesize\";b:1;s:4:\"tags\";b:1;s:10:\"categories\";b:1;s:6:\"visits\";b:1;s:12:\"average_rate\";b:1;s:13:\"privacy_level\";b:1;}",
"Information displayed on picture page"
)
;';
pwg_query($query);
echo
"\n"
. $upgrade_description
."\n"
;
?>

View file

@ -748,4 +748,5 @@ $lang['Activate Navigation Bar'] = 'Activate Navigation Bar';
$lang['Activate Navigation Thumbnails'] = 'Activate Navigation Thumbnails';
$lang['Activate icon "%s"'] = 'Activate icon "%s"';
$lang['Activate field "%s"'] = 'Activate field "%s"';
$lang['Photo Properties'] = 'Photo Properties';
?>

View file

@ -722,6 +722,7 @@ $lang['Activate Navigation Bar'] = 'Activer la barre de navigation';
$lang['Activate Navigation Thumbnails'] = 'Activer les miniatures de navigation';
$lang['Activate icon "%s"'] = 'Activer l\'icone "%s"';
$lang['Activate field "%s"'] = 'Activer le champ "%s"';
$lang['Photo Properties'] = 'Propriétés de la photo';
$lang['Active Themes'] = 'Thèmes activés';
$lang['Add write access to the "%s" directory'] = 'Ajoutez l\'accès en écriture pour le répertoire "%s"';

View file

@ -657,10 +657,13 @@ foreach (array('first','previous','next','last', 'current') as $which_image)
'U_IMG' =>
add_url_params(
$picture[$which_image]['url'], $slideshow_url_params),
'U_DOWNLOAD' => @$picture['current']['download_url'],
)
)
);
if ($conf['picture_download_icon'] and !empty($picture['current']['download_url']))
{
$template->append($which_image, array('U_DOWNLOAD' => $picture['current']['download_url']), true);
}
}
}
@ -918,6 +921,7 @@ $infos['INFO_VISITS'] = $picture['current']['hit'];
$infos['INFO_FILE'] = $picture['current']['file'];
$template->assign($infos);
$template->assign('display_info', unserialize($conf['picture_informations']));
// related tags
$tags = get_common_tags( array($page['image_id']), -1);

View file

@ -114,30 +114,43 @@ y.callService(
{/if}
<table id="standard" class="infoTable" summary="{'Some info about this picture'|@translate}">
{if $display_info.author}
<tr id="Author">
<td class="label">{'Author'|@translate}</td>
<td class="value">{if isset($INFO_AUTHOR)}{$INFO_AUTHOR}{else}{'N/A'|@translate}{/if}</td>
</tr>
{/if}
{if $display_info.created_on}
<tr id="datecreate">
<td class="label">{'Created on'|@translate}</td>
<td class="value">{if isset($INFO_CREATION_DATE)}{$INFO_CREATION_DATE}{else}{'N/A'|@translate}{/if}</td>
</tr>
{/if}
{if $display_info.posted_on}
<tr id="datepost">
<td class="label">{'Posted on'|@translate}</td>
<td class="value">{$INFO_POSTED_DATE}</td>
</tr>
{/if}
{if $display_info.dimensions}
<tr id="Dimensions">
<td class="label">{'Dimensions'|@translate}</td>
<td class="value">{if isset($INFO_DIMENSIONS)}{$INFO_DIMENSIONS}{else}{'N/A'|@translate}{/if}</td>
</tr>
{/if}
{if $display_info.file}
<tr id="File">
<td class="label">{'File'|@translate}</td>
<td class="value">{$INFO_FILE}</td>
</tr>
{/if}
{if $display_info.filesize}
<tr id="Filesize">
<td class="label">{'Filesize'|@translate}</td>
<td class="value">{if isset($INFO_FILESIZE)}{$INFO_FILESIZE}{else}{'N/A'|@translate}{/if}</td>
</tr>
{/if}
{if $display_info.tags}
<tr id="Tags">
<td class="label">{'Tags'|@translate}</td>
<td class="value">
@ -147,6 +160,8 @@ y.callService(
{/if}
</td>
</tr>
{/if}
{if $display_info.categories}
<tr id="Categories">
<td class="label">{'Categories'|@translate}</td>
<td class="value">
@ -159,12 +174,15 @@ y.callService(
{/if}
</td>
</tr>
{/if}
{if $display_info.visits}
<tr id="Visits">
<td class="label">{'Visits'|@translate}</td>
<td class="value">{$INFO_VISITS}</td>
</tr>
{/if}
{if isset($rate_summary) }
{if $display_info.average_rate and isset($rate_summary) }
<tr id="Average">
<td class="label">{'Average rate'|@translate}</td>
<td class="value" id="ratingSummary">
@ -206,7 +224,7 @@ y.callService(
</tr>
{/if}
{if isset($available_permission_levels) }
{if $display_info.privacy_level and isset($available_permission_levels) }
<tr id="Privacy">
<td class="label">{'Privacy level'|@translate}:</td>
<td class="value">