Changeset 31043


Ignore:
Timestamp:
Mar 19, 2015, 7:31:56 AM (9 years ago)
Author:
SergeD
Message:

version 1.2.22 - see changelog for details

Location:
extensions/greydragon
Files:
3 added
12 edited

Legend:

Unmodified
Added
Removed
  • extensions/greydragon/admin/admin.inc.php

    r30900 r31043  
    6565endif;
    6666
    67 $packlist = array();
    68 $packroot = $themeroot . 'css/colorpack/';
    69 foreach (scandir($packroot) as $pack_name):
    70   if (file_exists($packroot . "$pack_name/styles.css")):
    71     if ($pack_name[0] == "."):
    72       continue;
    73     endif;
    74     $packlist[] = $pack_name;
    75   endif;
    76 endforeach;
     67$packlist = $themeCore->getColorPackList();
    7768
    7869// Ensure default values are set
  • extensions/greydragon/admin/admin.tpl

    r30900 r31043  
    102102      </li>
    103103      <li><label><span class="graphicalCheckbox {if $options.p_animated_menu=="on"}icon-check{else}icon-check-empty{/if}">&nbsp;</span><input name="p_animated_menu" id="p_animated_menu" type="checkbox" value="on" {if $options.p_animated_menu=="on"}checked="checked"{/if}>{'Animate Menu'|@translate}</label></li>
     104      <li><label><span class="graphicalCheckbox {if $options.p_main_menu_close=="on"}icon-check{else}icon-check-empty{/if}">&nbsp;</span><input name="p_main_menu_close" id="p_main_menu_close" type="checkbox" value="on" {if $options.p_main_menu_close=="on"}checked="checked"{/if}>{'Auto Close Popup Menu on Refresh'|@translate}</label></li>
    104105      <li>
    105106        <select id="p_credits" name="p_credits">
  • extensions/greydragon/admin/help.inc.tpl

    r30900 r31043  
    1212
    1313    <li><h3>{'General Settings'|@translate}</h3>
    14       <p>{'To add logo specify <b>Logo Image</b>. Recommended logo height is 80px. If you need bigger space for your logo, CSS adjustments
    15         would have to be made. In addition to Logo you can specify <b>Header Text</b>.'|@translate}</p>
    16       <p>{'Supported macros'|@translate}:
     14      <p>{'<b>Logo Image</b> - optional - path to image used as gallery logo. Recommended logo height is 80px. If you need bigger space for your logo, CSS
     15        adjustments would have to be made'|@translate}<br>
     16      {'<b>Header Text</b> - optional - Text to be added in header area next to Logo'|@translate}<br>
     17      {'Supported macros'|@translate}:
    1718        <ul><li>%gallery_title% - {'Gallery title'|@translate}</li>
    1819        </ul>
    19       </p>
    20       <p>{'<b>Footer Text</b> allows adding simple text as a row in the footer below menu links and Site\'s credits.'|@translate}</p>
    21       <p>{'Important feature of the theme is a support for Color Packs which is managed by <b>Color Pack</b> Option. It allows changing colors, styles,
    22         theme for the pages. By default theme includes 3 color packs: slateblue, blackhawk, whitehawk, but you could be easily extend the list by
    23         creating copy of one of the existing colorpack folders and then adjusting colors.'|@translate}</p>
     20      <p>{'If neither Logo Image or Header Text are set, header region would collapse'|@translate}<br>
     21      {'<b>Footer Text</b> allows adding content in the footer below menu links and Site\'s credits.'|@translate}</p>
     22      <p>{'<b>Color Pack</b> - select color pack to be used with the theme. It allows changing colors, styles, theme for the pages. By default theme includes
     23        4 color packs: blackhawk, greydragon, slateblue, and whitehawk, but you could extend the list by creating copy of one of the existing colorpack
     24        folders and adjusting managed styles.'|@translate}</p>
    2425    </li>
    2526
     
    3233        <li>{'Add Thumb shadow for gdThumb: Set margin between thumbs to 10-14px. Modify shadow color to match your theme<br>&nbsp;&nbsp;&nbsp;.gdthumb { box-shadow: 6px 6px 3px #888888; }'|@translate}</li>
    3334        <li>{'Remove Root link in page\'s breadcrumbs: set $conf[\'level_separator\'] = \'\'; and apply CSS<br>&nbsp;&nbsp;&nbsp;.browsePath a:first-child { display: none; }<br>&nbsp;&nbsp;&nbsp;.browsePath a:after { content: " :: "; }'|@translate}</li>
     35        <li>{'Change height of the footer to accomodate larger <b>Footer Text</b> content<br>&nbsp;&nbsp;&nbsp;#g-footer { min-height: 5em !important; }'|@translate}</li>
     36        <li>{'Center <b>Footer Text</b> content<br>&nbsp;&nbsp;&nbsp;.g-footer-bottomleft { text-align: center; }'|@translate}</li>
    3437      </ul></li>
    3538
  • extensions/greydragon/changelog.txt

    r30902 r31043  
    1818
    1919=== Changelog ===
     20version 1.2.22 *
     21+ Added Photo metadata tab targets in picture.tpl (see template for positioning): {*GD_META_ICO*}, {*GD_META_TXT*}, {*GD_META_CONTENT*}
     22+ Picture tab "classic" content moved into external templates picture_tab_ico.tpl, picture_tab_txt.tpl, picture_tab_content.tpl
     23+ Added support for gd_get_metadata content trigger
     24  You can add custom content for picture meta tabs
     25    Ex: add_event_handler('gd_get_metadata', 'my_get_tab_metadata');
     26        function greydragon_get_tab_metadata($metadata) { return $metadata; }
     27        where each array element represents the tab
     28          $metadata[] = array(
     29             "id"         => unique id of the tab
     30             "icon_class" => class to be used to render icon tabs
     31             "title"      => tab or menu block title
     32             "content"    => block content
     33             "target"     => optional, rendering target - "left", "top", "right", "bottom", not supported, reserved for future use
     34             "combine"    => combine_css or combine_js reference block
     35           );
     36  Prior to rendering $metadata is processed and converted in appropriate construct to be used by the theme
     37  See ShareThis plugin for more details
     38+ Tab switch logic in Photo page optimized to allow management of dynamic tabs introduced by 3rd party plugins
     39+ Improved presentation and content alignment of Tags tab in picture page
     40+ Added support for auto-close of popup menu on navigation or refresh - Auto Close Popup Menu on Refresh
     41+ Help improvements
     42- Fixed issue with missing colorpack setting when theme is first installed and settings are not set yet
     43- Fixed issue with number of undefined theme params (unused at this time)
     44- Fixed issue with missing enumerator for $footer_elements in footer.tpl
     45
    2046version 1.1.21
    2147- Another attempt to fix issue with root url associated with gallery logo was not referring to the sites root properly when installed as sub-folder
  • extensions/greydragon/css/styles.css

    r30783 r31043  
    331331
    332332#TagsTable { width: 600px; min-height: 5.5em; }
    333 #Tags { background-position: right 0 bottom 2px; }
     333#tab-tags #TagsTable { width: 100%; min-width: 400px; z-index: 1; }
     334// #Tags { background: none; }
     335#Tags td.value { position: relative; vertical-align: top; }
     336#Tags div.tags-edit-marker { position: absolute; right: 0; bottom: 0; }
  • extensions/greydragon/include/greydragon.class.php

    r30902 r31043  
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    44
    5 define('GDTHEME_VERSION', '1.1.21');
     5define('GDTHEME_VERSION', '1.2.22');
    66
    77define("QUOTES_NONE",   FALSE);
     
    3636
    3737    return array(
    38       "p_version"          => array("value" => "",       "quotes" => QUOTES_NONE),
     38      "p_version"          => array("value" => "",           "quotes" => QUOTES_NONE),
    3939
    4040      // General Settings
    41       "p_logo_path"        => array("value" => null,     "quotes" => QUOTES_NONE),
    42       "p_header"           => array("value" => null,     "quotes" => QUOTES_LAZY),
    43       "p_footer"           => array("value" => null,     "quotes" => QUOTES_LAZY),
    44       "p_colorpack"        => array("value" => null,    "quotes" => QUOTES_NONE),
    45 
    46       "p_favicon_ico"      => array("value" => null,     "quotes" => QUOTES_NONE),
    47       "p_favicon_png"      => array("value" => null,     "quotes" => QUOTES_NONE),
    48       "p_favicon_gif"      => array("value" => null,     "quotes" => QUOTES_NONE),
    49       "p_favicon_apple"    => array("value" => null,     "quotes" => QUOTES_NONE),
    50       "p_favicon_noshine"  => array("value" => "off",    "quotes" => QUOTES_NONE),
     41      "p_logo_path"        => array("value" => null,         "quotes" => QUOTES_NONE),
     42      "p_header"           => array("value" => null,         "quotes" => QUOTES_LAZY),
     43      "p_footer"           => array("value" => null,         "quotes" => QUOTES_LAZY),
     44      "p_colorpack"        => array("value" => "greydragon", "quotes" => QUOTES_NONE),
     45
     46      "p_favicon_ico"      => array("value" => null,         "quotes" => QUOTES_NONE),
     47      "p_favicon_png"      => array("value" => "",         "quotes" => QUOTES_NONE),
     48      "p_favicon_gif"      => array("value" => "",         "quotes" => QUOTES_NONE),
     49      "p_favicon_apple"    => array("value" => "",         "quotes" => QUOTES_NONE),
     50      "p_favicon_noshine"  => array("value" => "off",        "quotes" => QUOTES_NONE),
    5151   
    5252      // Advanced Options - General
    53       "p_main_menu"        => array("value" => "closed", "quotes" => QUOTES_NONE), // static, closed, opened, top, header-bottom, header-top, disabled
    54       "p_animated_menu"    => array("value" => "off",    "quotes" => QUOTES_NONE),
    55 
    56       "p_lowertext"        => array("value" => "off",    "quotes" => QUOTES_NONE),
    57       "p_credits"          => array("value" => "off",    "quotes" => QUOTES_NONE),
    58       "p_nogenerator"      => array("value" => "off",    "quotes" => QUOTES_NONE),
    59       "p_hideabout"        => array("value" => "off",    "quotes" => QUOTES_NONE),
    60       "p_adminemail"       => array("value" => "off",    "quotes" => QUOTES_NONE),
    61       "p_nocounter"        => array("value" => "off",    "quotes" => QUOTES_NONE),
     53      "p_main_menu"        => array("value" => "closed",     "quotes" => QUOTES_NONE), // static, closed, opened, top, header-bottom, header-top, disabled
     54      "p_animated_menu"    => array("value" => "off",        "quotes" => QUOTES_NONE),
     55      "p_main_menu_close"  => array("value" => "off",        "quotes" => QUOTES_NONE),
     56
     57      "p_lowertext"        => array("value" => "off",        "quotes" => QUOTES_NONE),
     58      "p_credits"          => array("value" => "off",        "quotes" => QUOTES_NONE),
     59      "p_nogenerator"      => array("value" => "off",        "quotes" => QUOTES_NONE),
     60      "p_hideabout"        => array("value" => "off",        "quotes" => QUOTES_NONE),
     61      "p_adminemail"       => array("value" => "off",        "quotes" => QUOTES_NONE),
     62      "p_nocounter"        => array("value" => "off",        "quotes" => QUOTES_NONE),
    6263
    6364      // Advanced Options - Photo Page
    6465      "p_pict_tab_mode"    => array("value" => "txt-tab-open", "quotes" => QUOTES_NONE),
    65       "p_pict_tab_default" => array("value" => "desc",   "quotes" => QUOTES_NONE),
    66       "p_pict_tab_anim"    => array("value" => "off",    "quotes" => QUOTES_NONE),
    67       "p_pict_tab_exif"    => array("value" => "on",     "quotes" => QUOTES_NONE),
     66      "p_pict_tab_default" => array("value" => "desc",       "quotes" => QUOTES_NONE),
     67      "p_pict_tab_anim"    => array("value" => "off",        "quotes" => QUOTES_NONE),
     68      "p_pict_tab_exif"    => array("value" => "on",         "quotes" => QUOTES_NONE),
    6869
    6970      // Advanced Options - Root Page
     
    412413  }
    413414
     415  public function getColorPackList() {
     416    $themeroot = './themes/' . basename(dirname(dirname(__FILE__))) . '/';
     417
     418    $packlist = array();
     419    $packroot = $themeroot . 'css/colorpack/';
     420    foreach (scandir($packroot) as $pack_name):
     421      if (file_exists($packroot . "$pack_name/styles.css")):
     422        if ($pack_name[0] == "."):
     423          continue;
     424        endif;
     425        $packlist[] = $pack_name;
     426      endif;
     427    endforeach;
     428    return $packlist;
     429  }
     430
    414431}
    415432
  • extensions/greydragon/js/theme.menu.js

    r30783 r31043  
    66      pcontent=jQuery("#content");
    77
    8   // static, opened, closed, disabled
     8  // static, opened, closed, disabled, force_hide
    99
    1010  function hideMenu(delay) {
     
    5252
    5353    if (menubar.length == 1 && p_main_menu != "disabled" && p_main_menu != 'header-bottom') {
    54       if (jQuery.cookie('side-menu') == undefined) {
    55         if (p_main_menu == 'opened') {
    56           jQuery.cookie('side-menu', 'visible', {path: "/"});
    57         }else{
    58           jQuery.cookie('side-menu', 'hidden', {path: "/"});
     54      if (p_main_menu == "force_hide") {
     55        jQuery.cookie('side-menu', 'hidden', {path: "/"});
     56      }else{
     57        if (jQuery.cookie('side-menu') == undefined) {
     58          if (p_main_menu == 'opened') {
     59            jQuery.cookie('side-menu', 'visible', {path: "/"});
     60          }else{
     61            jQuery.cookie('side-menu', 'hidden', {path: "/"});
     62          }
    5963        }
    6064      }
  • extensions/greydragon/js/theme.photo.js

    r30741 r31043  
    5555
    5656  jQuery(function(){
     57    if ($('#TagsTable #Tags').css('background-image') == "none") {
     58      $('#TagsTable #Tags .tags-edit-marker').hide();
     59    }else{
     60      $('#TagsTable #Tags .tags-edit-marker').show();
     61      $('#TagsTable #Tags').css("background", "none");
     62    }
     63
    5764    if ($('#image-metadata-ico').length) {
    58       $("#image-metadata-ico .meta-desc").colorbox({ inline:true, href:"div#tab-desc", className:"image-metadata-overlay", speed:200, opacity:0.6 });
    59       $("#image-metadata-ico .meta-info").colorbox({ inline:true, href:"div#tab-meta", className:"image-metadata-overlay", speed:200, opacity:0.6 });
    60       $("#image-metadata-ico .meta-exif").colorbox({ inline:true, href:"div#tab-exif", className:"image-metadata-overlay", speed:200, opacity:0.6 });
    61       $("#image-metadata-ico .meta-tags").colorbox({ inline:true, href:"div#tab-tags", className:"image-metadata-overlay", speed:200, opacity:0.6 });
    62       $("#image-metadata-ico .meta-comment").colorbox({ inline:true, href:"div#tab-comment", className:"image-metadata-overlay", speed:200, opacity:0.6, width: "1200px" });
    63       $("#image-metadata-ico .meta-cart").colorbox({ inline:true, href:"div#tab-cart", className:"image-metadata-overlay", speed:200, opacity:0.6, width: "600px" });
     65      $("#image-metadata-ico>ul>li").each(function() {
     66        var el = $(this);
     67        var classNames = el.attr('class').split(" ");
     68        if (classNames.length > 0) {
     69          var classMeta = classNames[0].split("-");
     70          if ((classMeta.length == 2) && (classMeta[0] == "meta")) {
     71            var metaTag = classMeta[1];
     72            if (metaTag == "info")    { var _href = "div#tab-meta"; } else { var _href = "div#tab-" + metaTag; }
     73            if (metaTag == "comment") { var _width = "1200px"; } else if (metaTag == "cart") { _width = "600px"; } else { var _width = false; }
     74           
     75            el.colorbox({ inline:true, href: _href, className:"image-metadata-overlay", speed:200, opacity:0.6, width: _width });
     76          }
     77        }
     78      });
    6479    }else{
    6580      setCurrentTab();
  • extensions/greydragon/template/footer.tpl

    r30643 r31043  
    22  <ul class="g-inline g-link-list g-footer-topleft">
    33    {if isset($U_PROFILE)}<li class="dot">&middot;&nbsp;</li><li><a href="{$U_PROFILE}" title="{'My Profile'|@translate}" rel="nofollow">{$USERNAME}</a></li>{/if}
    4 {*    {if isset($U_LOGIN)}<li class="dot">&middot;&nbsp;</li><li><a href="{if $U_LOGIN|strstr:"?"}{$U_LOGIN}&redirect={$smarty.server.REQUEST_URI|escape:'urlpathinfo'}{else}{$U_LOGIN}?redirect={$smarty.server.REQUEST_URI|escape:'url'}{/if}" rel="nofollow">{'Login'|@translate}</a></li>{/if}
    5 *}
    64    {if isset($U_LOGIN)}<li class="dot">&middot;&nbsp;</li><li><a href="{$U_LOGIN}" rel="nofollow">{'Login'|@translate}</a></li>{/if}
    75    {if isset($U_REGISTER)}<li class="dot">&middot;&nbsp;</li><li><a href="{$U_REGISTER}" rel="nofollow">{'Register'|@translate}</a></li>{/if}
     
    119    {if ($greydragon.p_hideabout == 'off')}<li class="dot">&middot;&nbsp;</li><li><a href="{$PHPWG_ROOT_PATH}/about.php">About</a></li>{/if}
    1210  </ul>
    13   {if isset($greydragon.p_footer)}
     11  {if isset($greydragon.p_footer) || isset($footer_elements)}
    1412  <div class="g-footer-bottomleft">
    15     {$greydragon.p_footer}
     13    {if isset($greydragon.p_footer)} {$greydragon.p_footer} {/if}
     14    {if isset($footer_elements)}
     15      {foreach from=$footer_elements item=elt}
     16        {$elt}
     17      {/foreach}
     18    {/if}
    1619  </div>
    1720  {/if}
  • extensions/greydragon/template/header.tpl

    r30900 r31043  
    7373{if $includeMenu=="on"}
    7474  {combine_script id='greydragon.scripts' load='footer' require='jquery' path='themes/greydragon/js/theme.menu.js' order=100}
    75   {if isset({$greydragon.p_main_menu})}
    76     var p_main_menu = "{$greydragon.p_main_menu}";
     75  {if $greydragon.p_main_menu_close == "on"}
     76  var p_main_menu = "force_hide";
     77  {elseif isset({$greydragon.p_main_menu})}
     78  var p_main_menu = "{$greydragon.p_main_menu}";
    7779  {else}
    78     var p_main_menu = "hidden";
     80  var p_main_menu = "hidden";
    7981  {/if}
    8082  var p_animated_menu = "{$greydragon.p_animated_menu}";
     
    100102
    101103{get_combined_scripts load='header'}
     104
    102105<!--[if lt IE 7]>
    103106<script type="text/javascript" src="{$ROOT_URL}themes/default/js/pngfix.js"></script>
  • extensions/greydragon/template/picture.tpl

    r30741 r31043  
    147147<div id="image-metadata-ico" {if $DISPLAY_NAV_THUMB}class="nav-thumb-margin"{/if}>
    148148  <ul class="image-metadata-ico">
    149     {if isset( $COMMENT_IMG )}<li class="meta-desc{if $ico_mode=="on"} glyphicon glyphicon-eye-open{/if}{if $def_tab == 'desc'} active{/if}">{if $ico_mode=="off"}{'Description'|@translate}{/if}</li>{/if}
    150     <li class="meta-info {if $ico_mode=="on"} glyphicon glyphicon-info-sign{/if}{if $def_tab == 'info'} active{/if}">{if $ico_mode=="off"}{'Info'|@translate}{/if}</li>
    151     {if isset($metadata)}<li class="meta-exif{if $ico_mode=="on"} glyphicon glyphicon-camera{/if}{if $def_tab == 'exif'} active{/if}">{if $ico_mode=="off"}{'Exif'|@translate}{/if}</li>{/if}
    152     {if ($display_info.tags && (isset($related_tags) || ($greydragon.hasUserTags)))}<li class="meta-tags{if $ico_mode=="on"} glyphicon glyphicon-tags{/if}{if $def_tab == 'tags'} active{/if}" >{if $ico_mode=="off"}{'Tags'|@translate}{/if}</li>{/if}
    153     {if isset($COMMENT_COUNT)}<li class="meta-comment{if $ico_mode=="on"} glyphicon glyphicon-comment{/if}{if $def_tab == 'comments'} active{/if}">{if $ico_mode=="off"}{$COMMENT_COUNT|@translate_dec:'%d comment':'%d comments'}{else}&nbsp;{$COMMENT_COUNT}{/if}</li>{/if}
    154     {if isset($ppppp_e_mail)}<li class="meta-cart{if $ico_mode=="on"} glyphicon glyphicon-shopping-cart{/if}{if $def_tab == 'cart'} active{/if}" >{if $ico_mode=="off"}{'Cart'|@translate}{/if}</li>{/if}
     149    {include file='picture_tab_ico.tpl'}
     150    {*GD_META_ICO*}
    155151  </ul>
    156152</div>
     
    165161{if $greydragon.p_pict_tab_mode !== "hide" && $overlay_mode == "off"}
    166162<ul class="image-metadata">
    167   {if isset( $COMMENT_IMG )}<li class="{if $ico_mode=="on"}glyphicon glyphicon-eye-open{/if}{if $def_tab == 'desc'} active{/if}" rel="tab-desc">{if $ico_mode=="off"}{'Description'|@translate}{/if}</li>{/if}
    168   <li class="{if $ico_mode=="on"}glyphicon glyphicon-info-sign{/if}{if $def_tab == 'info'} active{/if}" rel="tab-meta">{if $ico_mode=="off"}{'Info'|@translate}{/if}</li>
    169   {if isset($metadata)}<li class="{if $ico_mode=="on"}glyphicon glyphicon-camera{/if}{if $def_tab == 'exif'} active{/if}" rel="tab-exif">{if $ico_mode=="off"}{'Exif'|@translate}{/if}</li>{/if}
    170   {if ($display_info.tags && (isset($related_tags) || ($greydragon.hasUserTags)))}<li class="{if $ico_mode=="on"}glyphicon glyphicon-tags{/if}{if $def_tab == 'tags'} active{/if}" rel="tab-tags">{if $ico_mode=="off"}{'Tags'|@translate}{/if}</li>{/if}
    171   {if isset($COMMENT_COUNT)}<li class="{if $ico_mode=="on"}glyphicon glyphicon-comment{/if}{if $def_tab == 'comments'} active{/if}" rel="tab-comment">{if $ico_mode=="off"}{$COMMENT_COUNT|@translate_dec:'%d comment':'%d comments'}{else}&nbsp;{$COMMENT_COUNT}{/if}</li>{/if}
    172   {if isset($ppppp_e_mail)}<li class="{if $ico_mode=="on"}glyphicon glyphicon-shopping-cart{/if}{if $def_tab == 'cart'} active{/if}" rel="tab-cart">{if $ico_mode=="off"}{'Cart'|@translate}{/if}</li>{/if}
     163  {include file='picture_tab_txt.tpl'}
     164  {*GD_META_TXT*}
    173165  <li id="image-metadata-toggle" class="glyphicon {if $greydragon.p_pict_tab_mode == "txt-tab-close" || $greydragon.p_pict_tab_mode == "ico-tab-close"}glyphicon-chevron-down{else}glyphicon-chevron-up{/if}" ></li>
    174166</ul>
     
    176168{if $greydragon.p_pict_tab_mode !== "hide"}
    177169<div class="image-metadata-tabs{if $overlay_mode=="on"} overlay{/if}" {if $greydragon.p_pict_tab_mode == "txt-tab-close" || $greydragon.p_pict_tab_mode == "ico-tab-close" || $overlay_mode=="on"}style="display: none;"{/if}>
    178   {if isset( $COMMENT_IMG )}
    179   <div id="tab-desc" class="image-metadata-tab">
    180     {$COMMENT_IMG}
    181   </div>
    182   {/if}
    183 
    184   <div id="tab-meta" class="image-metadata-tab">
    185     <dl id="standard" class="imageInfoTable dl-horizontal">
    186     {strip}
    187       {if $display_info.author and isset($INFO_AUTHOR)}
    188       <dt id="Author" class="imageInfo">{'Author'|@translate}</dt>
    189       <dd>{$INFO_AUTHOR}</dd>
    190       {/if}
    191       {if $display_info.created_on and isset($INFO_CREATION_DATE)}
    192       <dt id="datecreate">{'Created on'|@translate}</dt>
    193       <dd>{$INFO_CREATION_DATE}</dd>
    194       {/if}
    195       {if $display_info.posted_on}
    196       <dt id="datepost">{'Posted on'|@translate}</dt>
    197       <dd>{$INFO_POSTED_DATE}</dd>
    198       {/if}
    199       {if $display_info.dimensions and isset($INFO_DIMENSIONS)}
    200       <dt id="Dimensions">{'Dimensions'|@translate}</dt>
    201       <dd>{$INFO_DIMENSIONS}</dd>
    202       {/if}
    203       {if $display_info.file}
    204       <dt id="File">{'File'|@translate}</dt>
    205       <dd>{$INFO_FILE}</dd>
    206       {/if}
    207       {if $display_info.filesize and isset($INFO_FILESIZE)}
    208       <dt id="Filesize">{'Filesize'|@translate}</dt>
    209       <dd>{$INFO_FILESIZE}</dd>
    210       {/if}
    211       {if $display_info.categories and isset($related_categories)}
    212       <dt id="Categories">{'Albums'|@translate}</dt>
    213       <dd>
    214         <ul>
    215           {foreach from=$related_categories item=cat}
    216           <li>{$cat}</li>
    217           {/foreach}
    218         </ul>
    219       </dd>
    220       {/if}
    221       {if $display_info.visits}
    222       <dt id="Visits">{'Visits'|@translate}</dt>
    223       <dd>{$INFO_VISITS}</dd>
    224       {/if}
    225       {if $display_info.rating_score and isset($rate_summary)}
    226       <dt id="Average">{'Rating score'|@translate}</dt>
    227       <dd>
    228         {if $rate_summary.count}
    229         <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:'%d rate':'%d rates'})</span>
    230         {else}
    231         <span id="ratingScore">{'no rate'|@translate}</span> <span id="ratingCount"></span>
    232         {/if}
    233       </dd>
    234       {/if}
    235 
    236       {if isset($rating)}
    237       <dt id="rating" >
    238         <span id="updateRate">{if isset($rating.USER_RATE)}{'Update your rating'|@translate}{else}{'Rate this photo'|@translate}{/if}</span>
    239       </dt>
    240       <dd>
    241         <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
    242           {foreach from=$rating.marks item=mark name=rate_loop}
    243             {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
    244             <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}">
    245             {else}
    246             <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}">
    247             {/if}
    248           {/foreach}
    249           {strip}{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
    250             {combine_script id='rating' load='async' require='core.scripts' path='themes/default/js/rating.js'}
    251             {footer_script}
    252               var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[];
    253               _pwgRatingAutoQueue.push( {ldelim}rootUrl: '{$ROOT_URL}', image_id: {$current.id},
    254                 onSuccess : function(rating) {ldelim}
    255                   var e = document.getElementById("updateRate");
    256                   if (e) e.innerHTML = "{'Update your rating'|@translate|@escape:'javascript'}";
    257                   e = document.getElementById("ratingScore");
    258                   if (e) e.innerHTML = rating.score;
    259                   e = document.getElementById("ratingCount");
    260                   if (e) {ldelim}
    261                     if (rating.count == 1) {ldelim}
    262                       e.innerHTML = "({'%d rate'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
    263                     } else {ldelim}
    264                       e.innerHTML = "({'%d rates'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
    265                     }
    266                   {rdelim}
    267               {rdelim}{rdelim} );
    268             {/footer_script}
    269           {/strip}
    270         </form>
    271       </dd>
    272       {/if}
    273 
    274       {if $display_info.privacy_level and isset($available_permission_levels)}
    275       <dt id="Privacy">{'Who can see this photo?'|@translate}</dt>
    276       <dd>
    277         <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a>
    278 {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
    279 {footer_script require='jquery'}{strip}
    280   function setPrivacyLevel(id, level){
    281     (new PwgWS('{$ROOT_URL}')).callService(
    282       "pwg.images.setPrivacyLevel", { image_id:id, level:level},
    283         {
    284           method: "POST",
    285           onFailure: function(num, text) { alert(num + " " + text); },
    286           onSuccess: function(result) {
    287           jQuery('#privacyLevelBox .switchCheck').css('visibility','hidden');
    288           jQuery('#switchLevel'+level).prev('.switchCheck').css('visibility','visible');
    289           jQuery('#privacyLevelLink').text(jQuery('#switchLevel'+level).text());
    290         }
    291       }
    292     );
    293   }
    294   (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox");
    295 {/strip}{/footer_script}
    296         <div id="privacyLevelBox" class="switchBox" style="display:none">
    297           {foreach from=$available_permission_levels item=label key=level}
    298             <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>&#x2714; </span>
    299             <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br>
    300           {/foreach}
    301         </div>
    302       </dd>
    303       {/if}
    304     {/strip}
    305     </dl>
    306   </div>
    307 
    308   {if isset($metadata)}
    309   <div id="tab-exif" class="image-metadata-tab">
    310     <dl id="Metadata" class="imageInfoTable dl-horizontal">
    311     {foreach from=$metadata item=meta}
    312       {foreach from=$meta.lines item=value key=label}
    313         <dt>{$label}</dt>
    314         <dd>{$value}</dd>
    315       {/foreach}
    316     {/foreach}
    317     </dl>
    318   </div>
    319   {/if}
    320 
    321   {if ($display_info.tags && (isset($related_tags) || ($greydragon.hasUserTags)))}
    322   <div id="tab-tags" class="image-metadata-tab">
    323     {if ($greydragon.hasUserTags)}<table id="TagsTable"><tr id="Tags" ><td class="label"></td><td class="value">{/if}
    324     {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach}
    325     {if ($greydragon.hasUserTags)}</td></tr></table>{/if}
    326   </div>
    327   {/if}
    328 
    329   {if isset($COMMENT_COUNT)}
    330   <div id="tab-comment" class="image-metadata-tab">
    331     <div id="comments" {if (!isset($comment_add) && ($COMMENT_COUNT == 0))}class="noCommentContent"{else}class="commentContent"{/if}>
    332       <div id="pictureComments">
    333         {if isset($comment_add)}
    334         <div id="commentAdd">
    335           <h4>{'Add a comment'|@translate}</h4>
    336           <form method="post" action="{$comment_add.F_ACTION}" id="addComment">
    337             {if $comment_add.SHOW_AUTHOR}
    338             <p><label for="author">{'Author'|@translate}{if $comment_add.AUTHOR_MANDATORY} ({'mandatory'|@translate}){/if} :</label></p>
    339             <p><input type="text" name="author" id="author" value="{$comment_add.AUTHOR}"></p>
    340             {/if}
    341             {if $comment_add.SHOW_EMAIL}
    342             <p><label for="email">{'Email address'|@translate}{if $comment_add.EMAIL_MANDATORY} ({'mandatory'|@translate}){/if} :</label></p>
    343             <p><input type="text" name="email" id="email" value="{$comment_add.EMAIL}"></p>
    344             {/if}
    345             <p><label for="website_url">{'Website'|@translate} :</label></p>
    346             <p><input type="text" name="website_url" id="website_url" value="{$comment_add.WEBSITE_URL}"></p>
    347             <p><label for="contentid">{'Comment'|@translate} ({'mandatory'|@translate}) :</label></p>
    348             <p><textarea name="content" id="contentid" rows="5" cols="50">{$comment_add.CONTENT}</textarea></p>
    349             <p><input type="hidden" name="key" value="{$comment_add.KEY}">
    350             <input type="submit" value="{'Submit'|@translate}"></p>
    351           </form>
    352         </div>
    353         {else}
    354           {if ($COMMENT_COUNT == 0)}<p>{'No Comments Allowed'|@translate}</p>{/if}
    355         {/if}
    356         {if isset($comments)}
    357         <div id="pictureCommentList">
    358           {if (($COMMENT_COUNT > 2) || !empty($navbar))}
    359           <div id="pictureCommentNavBar">
    360             {if $COMMENT_COUNT > 2}
    361             <a href="{$COMMENTS_ORDER_URL}#comments" rel="nofollow" class="commentsOrder">{$COMMENTS_ORDER_TITLE}</a>
    362             {/if}
    363             {if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
    364           </div>
    365           {/if}
    366           {include file='comment_list.tpl'}
    367         </div>
    368         {/if}
    369       </div>
    370     </div>
    371   </div>
    372   {/if}
    373 
    374   {if isset($ppppp_e_mail)}
    375   <div id="tab-cart" class="image-metadata-tab">
    376     {if isset($COMMENT_IMG)}
    377     {/if}
    378   </div>
    379   {/if}
     170  {include file='picture_tab_content.tpl'}
     171  {*GD_META_CONTENT*}
    380172</div>
    381173{/if}
    382174</div>
     175{* if isset($greydragon.image_preload)}
     176<div id="image_urls" style="display:none;">
     177  {foreach from=$U_IMGNEXT item=u_img key=id}
     178    {if isset($u_img)}<div class="next{$id} preload">{$u_img}</div>{/if}
     179  {/foreach}
     180</div>
     181{ /if *}
     182
    383183{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
  • extensions/greydragon/themeconf.inc.php

    r30902 r31043  
    22/*
    33Theme Name: GreyDragon
    4 Version: 1.1.21
     4Version: 1.2.22
    55Description: GreyDragon Theme
    66Theme URI: http://piwigo.org/ext/extension_view.php?eid=775
     
    1111if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    1212
    13 require_once( PHPWG_THEMES_PATH . 'greydragon/include/greydragon.class.php');
    14 require_once( PHPWG_THEMES_PATH . 'greydragon/admin/upgrade.inc.php');
     13define('GDTHEME_ID',   basename(dirname(__FILE__)));
     14if (!defined('GDTHEME_PATH')):
     15  define('GDTHEME_PATH', PHPWG_THEMES_PATH . GDTHEME_ID . '/');
     16endif;
     17require_once( GDTHEME_PATH . 'include/greydragon.class.php');
     18require_once( GDTHEME_PATH . 'admin/upgrade.inc.php');
    1519
    1620$themeCore = greyDragonCore::Instance(GDTHEME_VERSION);
     
    2933
    3034  $themeCore = greyDragonCore::Instance();
     35
    3136  if ($themeCore->hasCustomFavicon() || $themeCore->hasOption("p_header") || $themeCore->hasOption('page_banner', TRUE)):
    3237    add_event_handler('render_page_banner', 'greydragon_render_header');
    3338  endif;
    3439  if ($themeCore->getOption("p_nocounter") == "on"):
    35     add_event_handler('loc_end_index', 'no_breadcrumb_counter');
     40    add_event_handler('loc_end_index', 'greydragon_nobreadcrumb_counter');
    3641  endif;
    3742  if ($themeCore->getOption("p_pict_tab_exif") == "off"):
     
    4247
    4348  $template->assign('greydragon', $themeCore->getConfig());
     49
     50  // Allow dynamic addition of metadata tabs content
     51  add_event_handler('loc_begin_picture', 'greydragon_picture_handler');
     52
     53}
     54
     55function greydragon_picture_handler() {
     56  global $template;
     57
     58  $template->set_prefilter('picture', 'greydragon_prepare_meta');
     59}
     60
     61function greydragon_prepare_meta($tpl_source, &$smarty) {
     62  // metadata array
     63  // each tab represented by respected sub array
     64  // sub array need to include
     65  //   "id"         = unique id of the tab
     66  //   "icon_class" = class to be used to render icon tabs
     67  //   "title"      = tab or menu block title
     68  //   "content"    = block content
     69  //   "target"     = optional, rendering target - "left", "top", "right", "bottom", not supported, reserved for future use
     70  //   "combine"    = combine_css or combine_js reference block
     71  //
     72  // prior to rendering, each element would be processed and converted into tab content in picture.tpl
     73
     74  $metadata = array();
     75  $metadata = trigger_change('gd_get_metadata', $metadata);
     76
     77  $meta_icon = "";
     78  $meta_text = "";
     79  $meta_content = "";
     80
     81  foreach ($metadata as $item):
     82
     83    $id            = $item["id"];
     84    $icon_class    = $item["icon_class"];
     85    $title         = $item["title"];
     86    $block_content = $item["content"];
     87    $combine       = $item["combine"];
     88    $no_overlay    = $item["no_overlay"];
     89
     90    if ($no_overlay):
     91      $meta_icon .= '<li class="ico-btn btn-' . $id . '">' . $block_content . '</li>';
     92    else:
     93      $meta_icon .= '<li class="meta-' . $id . '{if $ico_mode=="on"} ' . $icon_class . '{/if}{if $def_tab == "' . $id . '"} active{/if}" >{if $ico_mode=="off"}' . $title . '{/if}</li>';
     94    endif;
     95
     96    $meta_text .= '<li class="{if $ico_mode=="on"}' . $icon_class . '{/if}{if $def_tab == "' . $id . '"} active{/if}" rel="tab-' . $id . '">{if $ico_mode=="off"}' . $title . '{/if}</li>';
     97    if (isset($combine)):
     98      $meta_content .= '{strip}' . $combine . '{strip}';
     99    endif;
     100    $meta_content .= '<div id="tab-' . $id . '" class="image-metadata-tab">' . $block_content . '</div>';
     101  endforeach;
     102
     103  $content  = $tpl_source;
     104  if ($meta_icon):
     105    $pattern  = '#{\*GD_META_ICO\*}#';
     106    $replace  = $meta_icon . "{*GD_META_ICO*}";
     107    $content  = preg_replace($pattern, $replace, $content, 1);
     108  endif;
     109  if ($meta_text):
     110    $pattern  = '#{\*GD_META_TXT\*}#';
     111    $replace  = $meta_text . "{*GD_META_TXT*}";
     112    $content  = preg_replace($pattern, $replace, $content, 1);
     113  endif;
     114  if ($meta_content):
     115    $pattern  = '#{\*GD_META_CONTENT\*}#';
     116    $replace  = $meta_content . "{*GD_META_CONTENT*}";
     117    $content  = preg_replace($pattern, $replace, $content, 1);
     118  endif;
     119  return $content;
    44120}
    45121
     
    49125}
    50126
    51 function no_breadcrumb_counter() {
     127function greydragon_nobreadcrumb_counter() {
    52128  global $template;
    53129
Note: See TracChangeset for help on using the changeset viewer.