Changeset 5293


Ignore:
Timestamp:
03/23/10 22:19:55 (10 years ago)
Author:
patdenice
Message:

Feature 1533: Change "General" by "Options" in Configuration menu.
Change "Default Display" tab by "Guest Settings" tab.
Add display tab in Configuration/Option menu.

Allow to activate/deactivate a lot of display features:

On main page:
# Display only recently posted images
# Sort order
# Display all elements in all sub-categories
# Display a calendar by posted date
# Display a calendar by creation date
# Slideshow

On photo page:
# Show file metadata
# slideshow
# Add this image to your favorites
# Navigation Bar
# Navigation Thumbnails

Location:
trunk
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/configuration.php

    r5196 r5293  
    7676  ); 
    7777 
     78$display_checkboxes = array( 
     79    'menubar_filter_icon', 
     80    'index_sort_order_input', 
     81    'index_flat_icon', 
     82    'index_posted_date_icon', 
     83    'index_created_date_icon', 
     84    'index_slideshow_icon', 
     85    'picture_metadata_icon', 
     86    'picture_slideshow_icon', 
     87    'picture_favorite_icon', 
     88    'picture_navigation_icons', 
     89    'picture_navigation_thumb', 
     90  ); 
     91 
    7892//------------------------------ verification and registration of modifications 
    7993if (isset($_POST['submit']) and !is_adviser()) 
     
    130144    { 
    131145      // Never go here 
     146      break; 
     147    } 
     148    case 'display' : 
     149    { 
     150      foreach( $display_checkboxes as $checkbox) 
     151      { 
     152        $_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true'; 
     153      } 
    132154      break; 
    133155    } 
     
    175197// TabSheet initialization 
    176198$tabsheet->add('main', l10n('Main'), $conf_link.'main'); 
     199$tabsheet->add('display', l10n('Display'), $conf_link.'display'); 
    177200$tabsheet->add('history', l10n('History'), $conf_link.'history'); 
    178201$tabsheet->add('comments', l10n('Comments'), $conf_link.'comments'); 
    179202$tabsheet->add('upload', l10n('Upload'), $conf_link.'upload'); 
    180 $tabsheet->add('default', l10n('Default display'), $conf_link.'default'); 
     203$tabsheet->add('default', l10n('Guest Settings'), $conf_link.'default'); 
    181204// TabSheet selection 
    182205$tabsheet->select($page['section']); 
     
    299322    break; 
    300323  } 
     324  case 'display' : 
     325  { 
     326    foreach ($display_checkboxes as $checkbox) 
     327    { 
     328      $template->append( 
     329          'display', 
     330          array( 
     331            $checkbox => $conf[$checkbox] 
     332            ), 
     333          true 
     334        ); 
     335    } 
     336    break; 
     337  } 
    301338} 
    302339 
  • trunk/admin/themes/default/default-layout.css

    r5284 r5293  
    127127FIELDSET#historyConf SPAN.property, 
    128128FIELDSET#commentsConf SPAN.property, 
    129 FIELDSET#uploadConf SPAN.property { 
     129FIELDSET#uploadConf SPAN.property, 
     130FIELDSET#indexDisplayConf SPAN.property, 
     131FIELDSET#pictureDisplayConf SPAN.property { 
    130132        float: right; 
    131133        text-align: left; 
     
    134136FIELDSET#historyConf INPUT, 
    135137FIELDSET#commentsConf INPUT, 
    136 FIELDSET#uploadConf INPUT { 
     138FIELDSET#uploadConf INPUT, 
     139FIELDSET#indexDisplayConf INPUT, 
     140FIELDSET#pictureDisplayConf INPUT { 
    137141        float: none; 
    138142} 
     
    146150 
    147151FIELDSET#mainConfCheck SPAN.property, 
    148 FIELDSET#historyConf SPAN.property { 
     152FIELDSET#historyConf SPAN.property, 
     153FIELDSET#indexDisplayConf SPAN.property, 
     154FIELDSET#pictureDisplayConf SPAN.property { 
    149155        width: 90%; 
    150156} 
    151157FIELDSET#mainConfCheck INPUT, 
    152158FIELDSET#historyConf INPUT, 
    153 FIELDSET#commentsConf INPUT { 
     159FIELDSET#commentsConf INPUT, 
     160FIELDSET#indexDisplayConf INPUT, 
     161FIELDSET#pictureDisplayConf INPUT { 
    154162        margin-left: 5%; 
    155163} 
  • trunk/admin/themes/default/template/admin.tpl

    r5284 r5293  
    8282    <dd> 
    8383      <ul> 
    84         <li><a href="{$U_CONFIG_GENERAL}">{'General'|@translate}</a></li> 
    85         <li><a href="{$U_CONFIG_DISPLAY}">{'Default display'|@translate}</a></li> 
     84        <li><a href="{$U_CONFIG_GENERAL}">{'Options'|@translate}</a></li> 
    8685        <li><a href="{$U_CONFIG_MENUBAR}">{'Menu'|@translate}</a></li> 
    8786        <li><a href="{$U_CONFIG_EXTENTS}">{'Templates'|@translate}</a></li> 
  • trunk/admin/themes/default/template/configuration.tpl

    r5284 r5293  
    201201{if isset($default)} 
    202202{$PROFILE_CONTENT} 
     203{/if} 
     204 
     205{if isset($display)} 
     206<fieldset id="indexDisplayConf"> 
     207  <legend>{'Main Page'|@translate}</legend> 
     208  <ul> 
     209    <li> 
     210      <label> 
     211        <span class="property">{'display only recently posted images'|@translate|@ucfirst}</span> 
     212        <input type="checkbox" name="menubar_filter_icon" {if ($display.menubar_filter_icon)}checked="checked"{/if}> 
     213      </label> 
     214    </li> 
     215 
     216    <li> 
     217      <label> 
     218        <span class="property">{'Sort order'|@translate}</span> 
     219        <input type="checkbox" name="index_sort_order_input" {if ($display.index_sort_order_input)}checked="checked"{/if}> 
     220      </label> 
     221    </li> 
     222 
     223    <li> 
     224      <label> 
     225        <span class="property">{'display all elements in all sub-categories'|@translate|@ucfirst}</span> 
     226        <input type="checkbox" name="index_flat_icon" {if ($display.index_flat_icon)}checked="checked"{/if}> 
     227      </label> 
     228    </li> 
     229 
     230    <li> 
     231      <label> 
     232        <span class="property">{'display a calendar by posted date'|@translate|@ucfirst}</span> 
     233        <input type="checkbox" name="index_posted_date_icon" {if ($display.index_posted_date_icon)}checked="checked"{/if}> 
     234      </label> 
     235    </li> 
     236 
     237    <li> 
     238      <label> 
     239        <span class="property">{'display a calendar by creation date'|@translate|@ucfirst}</span> 
     240        <input type="checkbox" name="index_created_date_icon" {if ($display.index_created_date_icon)}checked="checked"{/if}> 
     241      </label> 
     242    </li> 
     243 
     244    <li> 
     245      <label> 
     246        <span class="property">{'slideshow'|@translate|@ucfirst}</span> 
     247        <input type="checkbox" name="index_slideshow_icon" {if ($display.index_slideshow_icon)}checked="checked"{/if}> 
     248      </label> 
     249    </li> 
     250  </ul> 
     251</fieldset> 
     252 
     253<fieldset id="pictureDisplayConf"> 
     254  <legend>{'Photo Page'|@translate}</legend> 
     255  <ul> 
     256    <li> 
     257      <label> 
     258        <span class="property">{'Show file metadata'|@translate}</span> 
     259        <input type="checkbox" name="picture_metadata_icon" {if ($display.picture_metadata_icon)}checked="checked"{/if}> 
     260      </label> 
     261    </li> 
     262 
     263    <li> 
     264      <label> 
     265        <span class="property">{'slideshow'|@translate}</span> 
     266        <input type="checkbox" name="picture_slideshow_icon" {if ($display.picture_slideshow_icon)}checked="checked"{/if}> 
     267      </label> 
     268    </li> 
     269 
     270    <li> 
     271      <label> 
     272        <span class="property">{'add this image to your favorites'|@translate|@ucfirst}</span> 
     273        <input type="checkbox" name="picture_favorite_icon" {if ($display.picture_favorite_icon)}checked="checked"{/if}> 
     274      </label> 
     275    </li> 
     276 
     277    <li> 
     278      <label> 
     279        <span class="property">{'Navigation Bar'|@translate|@ucfirst}</span> 
     280        <input type="checkbox" name="picture_navigation_icons" {if ($display.picture_navigation_icons)}checked="checked"{/if}> 
     281      </label> 
     282    </li> 
     283 
     284    <li> 
     285      <label> 
     286        <span class="property">{'Navigation Thumbnails'|@translate|@ucfirst}</span> 
     287        <input type="checkbox" name="picture_navigation_thumb" {if ($display.picture_navigation_thumb)}checked="checked"{/if}> 
     288      </label> 
     289    </li> 
     290  </ul> 
     291</fieldset> 
    203292{/if} 
    204293 
  • trunk/include/menubar.inc.php

    r5196 r5293  
    8080  $block = $menu->get_block('mbCategories'); 
    8181//------------------------------------------------------------------------ filter 
    82   if (!empty($conf['filter_pages']) and get_filter_page_value('used')) 
     82  if ($conf['menubar_filter_icon'] and !empty($conf['filter_pages']) and get_filter_page_value('used')) 
    8383  { 
    8484    if ($filter['enabled']) 
  • trunk/index.php

    r5196 r5293  
    108108} 
    109109 
    110 if (!isset($page['flat']) and 'categories' == $page['section']) 
     110if ($conf['index_flat_icon'] and !isset($page['flat']) and 'categories' == $page['section']) 
    111111{ 
    112112  $template->assign( 
     
    124124          'chronology_view' => 'list', 
    125125      ); 
    126   $template->assign( 
    127     'U_MODE_CREATED', 
    128     duplicate_index_url( $chronology_params, array('start', 'flat') ) 
    129     ); 
    130  
    131   $chronology_params['chronology_field'] = 'posted'; 
    132   $template->assign( 
    133     'U_MODE_POSTED', 
    134     duplicate_index_url( $chronology_params, array('start', 'flat') ) 
    135     ); 
     126  if ($conf['index_created_date_icon']) 
     127  { 
     128    $template->assign( 
     129      'U_MODE_CREATED', 
     130      duplicate_index_url( $chronology_params, array('start', 'flat') ) 
     131      ); 
     132  } 
     133  if ($conf['index_posted_date_icon']) 
     134  { 
     135    $chronology_params['chronology_field'] = 'posted'; 
     136    $template->assign( 
     137      'U_MODE_POSTED', 
     138      duplicate_index_url( $chronology_params, array('start', 'flat') ) 
     139      ); 
     140  } 
    136141} 
    137142else 
     
    145150    $chronology_field = 'created'; 
    146151  } 
    147   $url = duplicate_index_url( 
    148             array('chronology_field'=>$chronology_field ), 
    149             array('chronology_date', 'start', 'flat') 
    150           ); 
    151   $template->assign( 
    152       'U_MODE_'.strtoupper($chronology_field), 
    153       $url 
    154     ); 
     152  if ($conf['index_'.$chronology_field.'_date_icon']) 
     153  { 
     154    $url = duplicate_index_url( 
     155              array('chronology_field'=>$chronology_field ), 
     156              array('chronology_date', 'start', 'flat') 
     157            ); 
     158    $template->assign( 
     159        'U_MODE_'.strtoupper($chronology_field), 
     160        $url 
     161      ); 
     162  } 
    155163} 
    156164 
     
    219227$template->assign( 'navbar', $page['navigation_bar'] ); 
    220228 
    221 if ( count($page['items']) > 0 
     229if ( $conf['index_sort_order_input'] 
     230    and count($page['items']) > 0 
    222231    and $page['section'] != 'most_visited' 
    223232    and $page['section'] != 'best_rated') 
     
    279288    redirect($page['cat_slideshow_url']); 
    280289  } 
    281   else 
     290  elseif ($conf['index_slideshow_icon']) 
    282291  { 
    283292    $template->assign('U_SLIDESHOW', $page['cat_slideshow_url']); 
  • trunk/install/config.sql

    r5253 r5293  
    3333INSERT INTO piwigo_config (param,value,comment) VALUES ('extents_for_templates','a:0:{}','Actived template-extension(s)'); 
    3434INSERT INTO piwigo_config (param,value,comment) VALUES ('blk_menubar','','Menubar options'); 
     35INSERT INTO piwigo_config (param,value,comment) VALUES ('menubar_filter_icon','true','Display filter icon'); 
     36INSERT INTO piwigo_config (param,value,comment) VALUES ('index_sort_order_input','true','Display image order selection list'); 
     37INSERT INTO piwigo_config (param,value,comment) VALUES ('index_flat_icon','true','Display flat icon'); 
     38INSERT INTO piwigo_config (param,value,comment) VALUES ('index_posted_date_icon','true','Display calendar by posted date'); 
     39INSERT INTO piwigo_config (param,value,comment) VALUES ('index_created_date_icon','true','Display calendar by creation date icon'); 
     40INSERT INTO piwigo_config (param,value,comment) VALUES ('index_slideshow_icon','true','Display slideshow icon'); 
     41INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_metadata_icon','true','Display metadata icon on picture page'); 
     42INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_slideshow_icon','true','Display slideshow icon on picture page'); 
     43INSERT 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_navigation_icons','true','Display navigation icons on picture page'); 
     45INSERT INTO piwigo_config (param,value,comment) VALUES ('picture_navigation_thumb','true','Display navigation thumbnails on picture page'); 
    3546 
    3647INSERT INTO piwigo_themes (id, name) VALUES ('Sylvia', 'Sylvia'); 
  • trunk/language/en_UK/admin.lang.php

    r5215 r5293  
    680680$lang['Set as default theme for unregistered and new users'] = "Set as default theme for unregistered and new users"; 
    681681$lang['unknown'] = 'unknown'; 
     682 
     683$lang['Guest Settings'] = 'Guest Settings'; 
     684$lang['Main Page'] = 'Main Page'; 
     685$lang['Photo Page'] = 'Photo Page'; 
     686$lang['Navigation Bar'] = 'Navigation Bar'; 
     687$lang['Navigation Thumbnails'] = 'Navigation Thumbnails'; 
    682688?> 
  • trunk/language/fr_FR/admin.lang.php

    r5215 r5293  
    679679$lang['Set as default theme for unregistered and new users'] = "Thème par défaut pour les invités et les nouveaux utilisateurs"; 
    680680$lang['unknown'] = 'inconnu'; 
     681 
     682$lang['Guest Settings'] = 'Paramètres invité'; 
     683$lang['Main Page'] = 'Page Principale'; 
     684$lang['Photo Page'] = 'Page de la Photo'; 
     685$lang['Navigation Bar'] = 'Barre de navigation'; 
     686$lang['Navigation Thumbnails'] = 'Miniatures de navigation'; 
    681687?> 
  • trunk/picture.php

    r5196 r5293  
    717717  $template->assign('slideshow', $tpl_slideshow ); 
    718718} 
    719 else 
     719elseif ($conf['picture_slideshow_icon']) 
    720720{ 
    721721  $template->assign( 
     
    740740    'U_HOME' => make_index_url(), 
    741741    'U_UP' => $url_up, 
    742     'U_METADATA' => $url_metadata, 
     742    'DISPLAY_NAV_BUTTONS' => $conf['picture_navigation_icons'], 
     743    'DISPLAY_NAV_THUMB' => $conf['picture_navigation_thumb'] 
    743744    ) 
    744745  ); 
     746 
     747if ($conf['picture_metadata_icon']) 
     748{ 
     749  $template->assign('U_METADATA', $url_metadata); 
     750} 
    745751 
    746752 
  • trunk/themes/default/template/picture.tpl

    r5207 r5293  
    4747      <a href="{$U_SLIDESHOW_STOP}" title="{'stop the slideshow'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/stop_slideshow.png" class="button" alt="{'stop the slideshow'|@translate}"></a> 
    4848    {/if} 
     49    {if isset($U_METADATA) } 
    4950      <a href="{$U_METADATA}" title="{'Show file metadata'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/metadata.png" class="button" alt="metadata"></a> 
     51    {/if} 
    5052    {if isset($current.U_DOWNLOAD) } 
    5153      <a href="{$current.U_DOWNLOAD}" title="{'download'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/save.png" class="button" alt="{'download'|@translate}"></a> 
     
    99101</div> 
    100102 
     103{if $DISPLAY_NAV_THUMB} 
    101104{if isset($previous) } 
    102105<a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'Previous'|@translate} : {$previous.TITLE}" rel="prev"> 
     
    108111  <img src="{$next.THUMB_SRC}" alt="{$next.TITLE}"> 
    109112</a> 
     113{/if} 
    110114{/if} 
    111115 
  • trunk/themes/default/template/picture_nav_buttons.tpl

    r5115 r5293  
    11  <div class="navButtons"> 
    2    
     2 
     3{if $DISPLAY_NAV_BUTTONS and !isset($slideshow)} 
    34{if isset($last)} 
    45  <a class="navButton" href="{$last.U_IMG}" title="{'Last'|@translate} : {$last.TITLE}" rel="last"><img src="{$ROOT_URL}{$themeconf.icon_dir}/last.png" class="button" alt="{'Last'|@translate}"></a> 
     
    5960  {/if} 
    6061{/if} 
     62{/if} 
    6163 
    6264  </div> 
Note: See TracChangeset for help on using the changeset viewer.