Changeset 5304


Ignore:
Timestamp:
Mar 24, 2010, 1:39:34 AM (14 years ago)
Author:
patdenice
Message:

Feature 1533: Allow activation or deactivation of download icon.
Add display configuration for picture properties.

Location:
trunk
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r5293 r5304  
    9090  );
    9191
     92$display_info_checkboxes = array(
     93    'author',
     94    'created_on',
     95    'posted_on',
     96    'dimensions',
     97    'file',
     98    'filesize',
     99    'tags',
     100    'categories',
     101    'visits',
     102    'average_rate',
     103  );
     104
    92105//------------------------------ verification and registration of modifications
    93106if (isset($_POST['submit']) and !is_adviser())
     
    152165        $_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true';
    153166      }
     167      foreach( $display_info_checkboxes as $checkbox)
     168      {
     169        $_POST['picture_informations'][$checkbox] =
     170          empty($_POST['picture_informations'][$checkbox])? false : true;
     171      }
     172      $_POST['picture_informations'] = addslashes(serialize($_POST['picture_informations']));
    154173      break;
    155174    }
     
    334353        );
    335354    }
     355    $template->append(
     356        'display',
     357        array(
     358          'picture_informations' => unserialize($conf['picture_informations'])
     359          ),
     360        true
     361      );
    336362    break;
    337363  }
  • trunk/admin/themes/default/default-layout.css

    r5293 r5304  
    129129FIELDSET#uploadConf SPAN.property,
    130130FIELDSET#indexDisplayConf SPAN.property,
    131 FIELDSET#pictureDisplayConf SPAN.property {
     131FIELDSET#pictureDisplayConf SPAN.property,
     132FIELDSET#pictureInfoConf SPAN.property {
    132133        float: right;
    133134        text-align: left;
     
    138139FIELDSET#uploadConf INPUT,
    139140FIELDSET#indexDisplayConf INPUT,
    140 FIELDSET#pictureDisplayConf INPUT {
     141FIELDSET#pictureDisplayConf INPUT,
     142FIELDSET#pictureInfoConf INPUT {
    141143        float: none;
    142144}
     
    152154FIELDSET#historyConf SPAN.property,
    153155FIELDSET#indexDisplayConf SPAN.property,
    154 FIELDSET#pictureDisplayConf SPAN.property {
     156FIELDSET#pictureDisplayConf SPAN.property,
     157FIELDSET#pictureInfoConf SPAN.property {
    155158        width: 90%;
    156159}
     
    159162FIELDSET#commentsConf INPUT,
    160163FIELDSET#indexDisplayConf INPUT,
    161 FIELDSET#pictureDisplayConf INPUT {
     164FIELDSET#pictureDisplayConf INPUT,
     165FIELDSET#pictureInfoConf INPUT {
    162166        margin-left: 5%;
    163167}
  • trunk/admin/themes/default/template/configuration.tpl

    r5298 r5304  
    104104{/if}
    105105
    106 
    107106{if isset($comments)}
    108107<fieldset id="commentsConf">
     
    130129    </li>
    131130
    132 
    133131    <li>
    134132      <label>
     
    286284        <span class="property">{'Activate Navigation Thumbnails'|@translate}</span>
    287285        <input type="checkbox" name="picture_navigation_thumb" {if ($display.picture_navigation_thumb)}checked="checked"{/if}>
     286      </label>
     287    </li>
     288  </ul>
     289</fieldset>
     290
     291<fieldset id="pictureInfoConf">
     292  <legend>{'Photo Properties'|@translate}</legend>
     293  <ul>
     294    <li>
     295      <label>
     296        <span class="property">{'Author'|@translate}</span>
     297        <input type="checkbox" name="picture_informations[author]" {if ($display.picture_informations.author)}checked="checked"{/if}>
     298      </label>
     299    </li>
     300
     301    <li>
     302      <label>
     303        <span class="property">{'Created on'|@translate}</span>
     304        <input type="checkbox" name="picture_informations[created_on]" {if ($display.picture_informations.created_on)}checked="checked"{/if}>
     305      </label>
     306    </li>
     307
     308    <li>
     309      <label>
     310        <span class="property">{'Posted on'|@translate}</span>
     311        <input type="checkbox" name="picture_informations[posted_on]" {if ($display.picture_informations.posted_on)}checked="checked"{/if}>
     312      </label>
     313    </li>
     314
     315    <li>
     316      <label>
     317        <span class="property">{'Dimensions'|@translate}</span>
     318        <input type="checkbox" name="picture_informations[dimensions]" {if ($display.picture_informations.dimensions)}checked="checked"{/if}>
     319      </label>
     320    </li>
     321
     322    <li>
     323      <label>
     324        <span class="property">{'File'|@translate}</span>
     325        <input type="checkbox" name="picture_informations[file]" {if ($display.picture_informations.file)}checked="checked"{/if}>
     326      </label>
     327    </li>
     328
     329    <li>
     330      <label>
     331        <span class="property">{'Filesize'|@translate}</span>
     332        <input type="checkbox" name="picture_informations[filesize]" {if ($display.picture_informations.filesize)}checked="checked"{/if}>
     333      </label>
     334    </li>
     335
     336    <li>
     337      <label>
     338        <span class="property">{'Tags'|@translate}</span>
     339        <input type="checkbox" name="picture_informations[tags]" {if ($display.picture_informations.tags)}checked="checked"{/if}>
     340      </label>
     341    </li>
     342
     343    <li>
     344      <label>
     345        <span class="property">{'Categories'|@translate}</span>
     346        <input type="checkbox" name="picture_informations[categories]" {if ($display.picture_informations.categories)}checked="checked"{/if}>
     347      </label>
     348    </li>
     349
     350    <li>
     351      <label>
     352        <span class="property">{'Visits'|@translate}</span>
     353        <input type="checkbox" name="picture_informations[visits]" {if ($display.picture_informations.visits)}checked="checked"{/if}>
     354      </label>
     355    </li>
     356
     357    <li>
     358      <label>
     359        <span class="property">{'Average rate'|@translate}</span>
     360        <input type="checkbox" name="picture_informations[average_rate]" {if ($display.picture_informations.average_rate)}checked="checked"{/if}>
     361      </label>
     362    </li>
     363
     364    <li>
     365      <label>
     366        <span class="property">{'Privacy level'|@translate} ({'available for administrators only'|@translate})</span>
     367        <input type="checkbox" name="picture_informations[privacy_level]" {if ($display.picture_informations.privacy_level)}checked="checked"{/if}>
    288368      </label>
    289369    </li>
  • trunk/install/config.sql

    r5293 r5304  
    4242INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_slideshow_icon','true','Display slideshow icon on picture page');
    4343INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_favorite_icon','true','Display favorite icon on picture page');
     44INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_download_icon','true','Display download icon on picture page');
    4445INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_navigation_icons','true','Display navigation icons on picture page');
    4546INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_navigation_thumb','true','Display navigation thumbnails on picture page');
     47INSERT INTO piwigo_config (param,value,comment)
     48  VALUES (
     49    'picture_informations',
     50    '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;}',
     51    'Information displayed on picture page'
     52  );
    4653
    4754INSERT INTO piwigo_themes (id, name) VALUES ('Sylvia', 'Sylvia');
  • trunk/install/db/87-database.php

    r5293 r5304  
    33// | Piwigo - a PHP based picture gallery                                  |
    44// +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
     5// | Copyright(C) 2008-2010 Piwigo Team                  http://piwigo.org |
    66// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
    77// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
  • trunk/language/en_UK/admin.lang.php

    r5302 r5304  
    749749$lang['Activate icon "%s"'] = 'Activate icon "%s"';
    750750$lang['Activate field "%s"'] = 'Activate field "%s"';
     751$lang['Photo Properties'] = 'Photo Properties';
    751752?>
  • trunk/language/fr_FR/admin.lang.php

    r5302 r5304  
    723723$lang['Activate icon "%s"'] = 'Activer l\'icone "%s"';
    724724$lang['Activate field "%s"'] = 'Activer le champ "%s"';
     725$lang['Photo Properties'] = 'Propriétés de la photo';
    725726
    726727$lang['Active Themes'] = 'Thèmes activés';
  • trunk/picture.php

    r5293 r5304  
    658658            add_url_params(
    659659              $picture[$which_image]['url'], $slideshow_url_params),
    660           'U_DOWNLOAD' => @$picture['current']['download_url'],
    661660          )
    662661        )
    663662      );
     663    if ($conf['picture_download_icon'] and !empty($picture['current']['download_url']))
     664    {
     665      $template->append($which_image, array('U_DOWNLOAD' => $picture['current']['download_url']), true);
     666    }
    664667  }
    665668}
     
    919922
    920923$template->assign($infos);
     924$template->assign('display_info', unserialize($conf['picture_informations']));
    921925
    922926// related tags
  • trunk/themes/default/template/picture.tpl

    r5293 r5304  
    115115
    116116<table id="standard" class="infoTable" summary="{'Some info about this picture'|@translate}">
     117  {if $display_info.author}
    117118  <tr id="Author">
    118119    <td class="label">{'Author'|@translate}</td>
    119120    <td class="value">{if isset($INFO_AUTHOR)}{$INFO_AUTHOR}{else}{'N/A'|@translate}{/if}</td>
    120121  </tr>
     122  {/if}
     123  {if $display_info.created_on}
    121124  <tr id="datecreate">
    122125    <td class="label">{'Created on'|@translate}</td>
    123126    <td class="value">{if isset($INFO_CREATION_DATE)}{$INFO_CREATION_DATE}{else}{'N/A'|@translate}{/if}</td>
    124127  </tr>
     128  {/if}
     129  {if $display_info.posted_on}
    125130  <tr id="datepost">
    126131    <td class="label">{'Posted on'|@translate}</td>
    127132    <td class="value">{$INFO_POSTED_DATE}</td>
    128133  </tr>
     134  {/if}
     135  {if $display_info.dimensions}
    129136  <tr id="Dimensions">
    130137    <td class="label">{'Dimensions'|@translate}</td>
    131138    <td class="value">{if isset($INFO_DIMENSIONS)}{$INFO_DIMENSIONS}{else}{'N/A'|@translate}{/if}</td>
    132139  </tr>
     140  {/if}
     141  {if $display_info.file}
    133142  <tr id="File">
    134143    <td class="label">{'File'|@translate}</td>
    135144    <td class="value">{$INFO_FILE}</td>
    136145  </tr>
     146  {/if}
     147  {if $display_info.filesize}
    137148  <tr id="Filesize">
    138149    <td class="label">{'Filesize'|@translate}</td>
    139150    <td class="value">{if isset($INFO_FILESIZE)}{$INFO_FILESIZE}{else}{'N/A'|@translate}{/if}</td>
    140151  </tr>
     152  {/if}
     153  {if $display_info.tags}
    141154  <tr id="Tags">
    142155    <td class="label">{'Tags'|@translate}</td>
     
    148161    </td>
    149162  </tr>
     163  {/if}
     164  {if $display_info.categories}
    150165  <tr id="Categories">
    151166    <td class="label">{'Categories'|@translate}</td>
     
    160175    </td>
    161176  </tr>
     177  {/if}
     178  {if $display_info.visits}
    162179  <tr id="Visits">
    163180    <td class="label">{'Visits'|@translate}</td>
    164181    <td class="value">{$INFO_VISITS}</td>
    165182  </tr>
    166 
    167 {if isset($rate_summary) }
     183  {/if}
     184
     185{if $display_info.average_rate and isset($rate_summary) }
    168186        <tr id="Average">
    169187                <td class="label">{'Average rate'|@translate}</td>
     
    207225{/if}
    208226
    209 {if isset($available_permission_levels) }
     227{if $display_info.privacy_level and isset($available_permission_levels) }
    210228        <tr id="Privacy">
    211229                <td class="label">{'Privacy level'|@translate}:</td>
Note: See TracChangeset for help on using the changeset viewer.