Changeset 30900
- Timestamp:
- Jan 23, 2015, 7:53:13 PM (9 years ago)
- Location:
- extensions/greydragon
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/greydragon/admin/admin.inc.php
r30783 r30900 34 34 35 35 $config_min = $themeCore->getConfig(FALSE); 36 37 36 $conf['greydragon'] = serialize($config_min); 38 37 conf_update_param('greydragon', pwg_db_real_escape_string($conf['greydragon'])); -
extensions/greydragon/admin/admin.tpl
r30643 r30900 28 28 <label> 29 29 <span class="graphicalCheckbox {if $options.hasMinVer=="yes"}icon-check success{else}icon-check-empty error{/if}"></span> 30 <input name="vercheck" disabled="1" type="checkbox" checked="checked" value="1"> 31 {'Piwigo 2.6.3+ Core Installed'|@translate} 30 <input name="vercheck" disabled="1" type="checkbox" checked="checked" value="1">{'Piwigo 2.6.3+ Core Installed'|@translate} 32 31 </label> 33 32 </li> … … 35 34 <label> 36 35 <span class="graphicalCheckbox {if $options.hasAP=="yes"}icon-check success{else}icon-check-empty error{/if}"></span> 37 <input name="addpagescheck" disabled="1" type="checkbox" checked="checked" value="1"> 38 {'Additional Pages'|@translate} {'Installed'|@translate} 36 <input name="addpagescheck" disabled="1" type="checkbox" checked="checked" value="1">{'Additional Pages'|@translate} {'Installed'|@translate} 39 37 </label> 40 38 </li> … … 42 40 <label> 43 41 <span class="graphicalCheckbox {if $options.hasED=="yes"}icon-check success{else}icon-check-empty error{/if}"></span> 44 <input name="extdesccheck" disabled="1" type="checkbox" checked="checked" value="1"> 45 {'Extended Description'|@translate} {'Installed'|@translate} 42 <input name="extdesccheck" disabled="1" type="checkbox" checked="checked" value="1">{'Extended Description'|@translate} {'Installed'|@translate} 46 43 </label> 47 44 </li> … … 54 51 <label> 55 52 <span class="graphicalCheckbox icon-check {if $options.hasGT=="yes"}icon-check success{else}icon-check-empty error{/if}"></span> 56 <input name="vercheck" disabled="1" type="checkbox" checked="checked" value="1"> 57 <a href="http://piwigo.org/ext/extension_view.php?eid=771" target=_blank>{'gdThumb'|@translate}</a> {'Installed'|@translate} 53 <input name="vercheck" disabled="1" type="checkbox" checked="checked" value="1"><a href="http://piwigo.org/ext/extension_view.php?eid=771" target=_blank>{'gdThumb'|@translate}</a> {'Installed'|@translate} 58 54 </label> 59 55 </li> … … 61 57 <label> 62 58 <span class="graphicalCheckbox icon-check {if $options.hasAT=="yes"}icon-check success{else}icon-check-empty error{/if}"></span> 63 <input name="vercheck" disabled="1" type="checkbox" checked="checked" value="1"> 64 <a href="http://piwigo.org/ext/extension_view.php?eid=720" target=_blank>{'Admin Tools'|@translate}</a> {'Installed'|@translate} 59 <input name="vercheck" disabled="1" type="checkbox" checked="checked" value="1"><a href="http://piwigo.org/ext/extension_view.php?eid=720" target=_blank>{'Admin Tools'|@translate}</a> {'Installed'|@translate} 65 60 </label> 66 61 </li> … … 71 66 <ul> 72 67 <li><input id="p_logo_path" name="p_logo_path" type="text" value="{$options.p_logo_path}"><label for="p_logo_path">{'Logo Image'|@translate}</label> 73 <li><input id="p_favicon_path" name="p_favicon_path" type="text" value="{$options.p_favicon_path}"><label for="p_favicon_path">{'URL (or relative path) to your favicon.ico'|@translate}</label>74 {*75 <li><input id="p_apple_path" name="p_apple_path" type="text" value="{$options.p_apple_path}"><label for="p_apple_path">{'URL (or relative path) to your Apple Touch icon'|@translate}</label>76 *}77 68 <li><input id="p_header" name="p_header" type="text" value="{$options.p_header|escape:"html"}"><label for="p_header">{'Header Text'|@translate}</label> 78 69 <li><input id="p_footer" name="p_footer" type="text" value="{$options.p_footer|escape:"html"}"><label for="p_footer">{'Footer Text'|@translate}</label> 79 70 <li> 80 71 <select id="p_colorpack" name="p_colorpack" adisabled="1"> 81 {foreach from=$colorpackArr item=name} 82 <option {if $options.p_colorpack == $name}selected="selected"{/if} value="{$name}">{$name}</option> 83 {/foreach} 84 <!-- <option selected="selected" value="slateblue">slateblue</option> --> 72 {foreach from=$colorpackArr item=name}<option {if $options.p_colorpack == $name}selected="selected"{/if} value="{$name}">{$name}</option>{/foreach} 85 73 </select> 86 74 <label for="p_colorpack">{'Color Pack'|@translate}</label> 87 75 </li> 76 </ul> 77 </fieldset> 78 <fieldset> 79 <legend>{'General Settings - All In One Favicon'|@translate}</legend> 80 <ul> 81 <li><input id="p_favicon_ico" name="p_favicon_ico" type="text" value="{$options.p_favicon_ico}"><label for="p_favicon_ico">{'URL to your favicon.ico'|@translate}</label> 82 <li><input id="p_favicon_apple" name="p_favicon_apple" type="text" value="{$options.p_favicon_apple}"><label for="p_favicon_apple">{'URL to your Apple Touch icon (60x60)'|@translate}</label> 83 <li><label><span class="graphicalCheckbox {if $options.p_favicon_noshine=="on"}icon-check{else}icon-check-empty{/if}"> </span><input name="p_favicon_noshine" id="p_favicon_noshine" type="checkbox" value="on" {if $options.p_favicon_noshine=="on"}checked="checked"{/if}>{'Do not add reflective shine to Apple Touch Icon'|@translate}</label></li> 88 84 </ul> 89 85 </fieldset> -
extensions/greydragon/admin/css/styles.css
r30484 r30900 40 40 41 41 .content fieldset { position: relative; overflow: hidden; padding: 0 1em 0 1em; background: #FFF; } 42 .content legend { position: absolute; left: 0px; width: 100%; padding: 0.4em 0.8em; border-bottom: #dfdfdf 1px solid; 43 background-image: -ms-linear-gradient(bottom, #D5E6F2 0%, #FFFFFF 40%, #FFFFFF 60%, #D5E6F2 100%); 44 background-image: -moz-linear-gradient(bottom, #D5E6F2 0%, #FFFFFF 40%, #FFFFFF 60%, #D5E6F2 100%); 45 background-image: -o-linear-gradient(bottom, #D5E6F2 0%, #FFFFFF 40%, #FFFFFF 60%, #D5E6F2 100%); 46 background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #D5E6F2), color-stop(.4, #FFFFFF), color-stop(0.6, #FFFFFF), color-stop(1, #D5E6F2)); 47 background-image: -webkit-linear-gradient(bottom, #D5E6F2 0%, #FFFFFF 40%, #FFFFFF 60%, #D5E6F2 100%); 48 background-image: linear-gradient(to top, #D5E6F2 0%, #FFFFFF 40%, #FFFFFF 60%, #D5E6F2 100%); 49 background-repeat: no-repeat; 50 } 42 .content legend { position: absolute; left: 0px; width: 100%; padding: 0.4em 0.8em; background: #D5E6F2; } 51 43 52 44 .content fieldset ul { margin-top: 34px; padding-left: 0; } … … 94 86 #helpContent li { margin-top: 2px; margin-bottom: 2px; } 95 87 #helpContent ul ul { margin-top: 0; list-style: square outside; padding-left: 3em; } 88 #helpContent table { margin-left: 0; margin-right: 0; } 89 #helpContent th { padding-right: 3em; text-align: left; } 96 90 97 91 #cboxContent { background-color: #FFF; } -
extensions/greydragon/admin/help.inc.tpl
r30643 r30900 3 3 <ul> 4 4 <li><h3>{'Prerequisites'|@translate}</h3> 5 <p><b> REQUIREMENTS NEED TO BE MET FOR THE THEME TO FUNCTION PROPERLY.</b><br>6 Please refer to information on the left.5 <p><b>{'REQUIREMENTS NEED TO BE MET FOR THE THEME TO FUNCTION PROPERLY.'|@translate}</b><br> 6 {'Please refer to information on the left.'|@translate} 7 7 </p></li> 8 8 9 <li><h3>{'Suggestions'|@translate}</h3> 9 <p>Optional plugins found to be usefull in everyday usage. 10 </p></li> 10 <p>{'Optional plugins found to be usefull in everyday usage.'|@translate}</p> 11 </li> 12 11 13 <li><h3>{'General Settings'|@translate}</h3> 12 <p>To add logo specify <b>Logo Image</b>. Recommended logo height is 80px. If you need bigger space for your logo, CSS adjustments 13 would have to be made. In addition to Logo you can specify <b>Header Text</b>.<br> 14 <b>Footer Text</b> allows adding simple text as a row in the footer below menu links and Site's credits. 15 <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, 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}: 17 <ul><li>%gallery_title% - {'Gallery title'|@translate}</li> 18 </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, 16 22 theme for the pages. By default theme includes 3 color packs: slateblue, blackhawk, whitehawk, but you could be easily extend the list by 17 creating copy of one of the existing colorpack folders and then adjusting colors. 18 </p></li> 23 creating copy of one of the existing colorpack folders and then adjusting colors.'|@translate}</p> 24 </li> 25 19 26 <li><h3>{'Advanced Options - Custom CSS'|@translate}</h3> 20 <p> This option allows fine tune Theme's styles to better suit your personal taste.</p>21 <p> Few examples:</p>27 <p>{'This option allows fine tune Theme\'s styles to better suit your personal taste.'|@translate}</p> 28 <p>{'Few examples:'|@translate}</p> 22 29 <ul> 23 <li> Remove fixed width:<br> body { width: auto;}</li>24 <li> Remove fixed width but keep min-width:<br> body { width: auto; min-width: 1270px;}</li>25 <li> Add Thumb shadow for gdThumb: Set margin between thumbs to 10-14px. Modify shadow color to match your theme<br> .gdthumb { box-shadow: 6px 6px 3px #888888;}</li>26 <li> Remove Root link in page's breadcrumbs: set $conf['level_separator'] = ''; and apply CSS<br> .browsePath a:first-child { display: none; }<br> .browsePath a:after { content: " :: ";}</li>30 <li>{'Remove fixed width:<br> body { width: auto; }'|@translate}</li> 31 <li>{'Remove fixed width but keep min-width:<br> body { width: auto; min-width: 1270px; }'|@translate}</li> 32 <li>{'Add Thumb shadow for gdThumb: Set margin between thumbs to 10-14px. Modify shadow color to match your theme<br> .gdthumb { box-shadow: 6px 6px 3px #888888; }'|@translate}</li> 33 <li>{'Remove Root link in page\'s breadcrumbs: set $conf[\'level_separator\'] = \'\'; and apply CSS<br> .browsePath a:first-child { display: none; }<br> .browsePath a:after { content: " :: "; }'|@translate}</li> 27 34 </ul></li> 35 36 <li><h3>{'Favicon Tips'|@translate}</h3> 37 <p>{'For URLs please use absolute or relative path including filename'|@translate}</p> 38 <p>{'Additional Information'|@translate}</p> 39 <table> 40 <tr><th>{'Favicon Wiki'|@translate}</th><td>{'<a href="http://en.wikipedia.org/wiki/Favicon" target="_blank">Wikipedia</a> - read more about Favicon types and sizes'|@translate}</td></tr> 41 <tr><th>{'Favicon Generator'|@translate}</th><td>{'<a href="http://www.html-kit.com/favicon/" target="_blank">HTML Kit</a> - Favicon generator'|@translate}</td></tr> 42 <tr><th>{'Favicon CC editor'|@translate}</th><td>{'<a href="http://www.favicon.cc/" target="_blank">Favicon CC</a> - Simple Favicon editor'|@translate}</td></tr> 43 <tr><th>{'Favicon validator'|@translate}</th><td>{'<a href="http://www.html-kit.com/favicon/validator" target="_blank">HTML Kit</a> - Validate Favicon for browser compatiblity'|@translate}</td></tr> 44 <tr><th>{'Apple Touch Icon HowTo'|@translate}</th><td>{'<a href="http://developer.apple.com/library/safari/#documentation/appleapplications/reference/safariwebcontent/ConfiguringWebApplications/ConfiguringWebApplications.html" target="_blank">Apple</a> - How-to on how to create a PNG to use as an Apple Touch Icon'|@translate}</td></tr> 45 </table> 46 </li> 28 47 </ul> 48 </fieldset> -
extensions/greydragon/changelog.txt
r30783 r30900 18 18 19 19 === Changelog === 20 version 1.1.20 21 + ADMIN: Added support for various Favicon types including Apple Touch 22 + Added versioning for Theme settings for easier maintenance 23 + Localization added for Admin Help area 24 + Added support for %gallery_title% in header text/page banner 25 - Fixed issue with root url associated with gallery logo was not refering to the sites root properly when installed as sub-folder 26 20 27 version 1.1.19 21 28 + custom.css location moved to local/greydragon/ to comply with PWG guidelines. File should be automatically created when theme is updated. … … 93 100 - Admin: added auto-hide for Info messages (10 seconds) 94 101 95 version 1.0.9 - firstrelease102 version 1.0.9 - official release 96 103 + Admin: "Admin Tools" plugin added as recommended 97 104 + Admin: "gdThumb" plugin added as recommended -
extensions/greydragon/include/greydragon.class.php
r30783 r30900 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 5 define('GDTHEME_VERSION', '1.1. 19');5 define('GDTHEME_VERSION', '1.1.20'); 6 6 7 7 define("QUOTES_NONE", FALSE); … … 36 36 37 37 return array( 38 "p_version" => array("value" => "", "quotes" => QUOTES_NONE), 39 38 40 // General Settings 39 41 "p_logo_path" => array("value" => null, "quotes" => QUOTES_NONE), 40 "p_favicon_path" => array("value" => null, "quotes" => QUOTES_NONE),41 "p_apple_path" => array("value" => null, "quotes" => QUOTES_NONE),42 42 "p_header" => array("value" => null, "quotes" => QUOTES_LAZY), 43 43 "p_footer" => array("value" => null, "quotes" => QUOTES_LAZY), 44 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), 45 51 46 52 // Advanced Options - General … … 80 86 private function loadConfig($ver = '') { 81 87 global $conf, $pwg_loaded_plugins; 88 82 89 $this->themeConfigMin = unserialize($conf['greydragon']); 83 90 $this->themeConfigMin["version"] = $ver; … … 88 95 89 96 private function validateDefault($config) { 97 98 // Check version, perform update if necessary 99 if (!isset($config["p_version"]) || ($this->themeConfigMin["version"] !== $config["p_version"])): 100 101 if (isset($config["p_favicon_path"])): 102 $config["p_favicon_ico"] = $config["p_favicon_path"]; 103 unset($config["p_favicon_path"]); 104 endif; 105 endif; 106 90 107 $theme_default_settings = $this->getDefaults(); 91 108 92 109 foreach ($theme_default_settings as $key => $value): 93 if ( $value["value"]):110 if (isset($value["value"])): 94 111 if (array_key_exists($key, $config)): 95 112 else: … … 100 117 101 118 // Populate some system settings 102 103 119 $url_root = get_root_url(); 104 120 $config['U_SITE_ADMIN'] = $url_root . 'admin.php?page='; … … 120 136 return $this->themeConfig; 121 137 else: 122 return $this->themeConfigMin; 138 $config = $this->themeConfigMin; 139 $config['p_version'] = GDTHEME_VERSION; 140 return $config; 123 141 endif; 124 142 } … … 187 205 if ((isset($_POST["p_reset"])) && ($_POST["p_reset"] == "on")): 188 206 // Reset theme settings 189 conf_update_param('greydragon', pwg_db_real_escape_string(serialize(array()))); 207 $config = array(); 208 conf_update_param('greydragon', pwg_db_real_escape_string(serialize($config))); 190 209 load_conf_from_db(); 191 210 $this->loadConfig(); … … 216 235 else: 217 236 return (array_key_exists($name, $this->themeConfig)); 237 endif; 238 } 239 240 public function deleteOption($name, $isGlobal = FALSE) { 241 global $conf; 242 243 if ($isGlobal): 244 if (array_key_exists($name, $conf) && isset($conf[$name])): 245 unset($conf[$name]); 246 endif; 247 else: 248 if (array_key_exists($name, $this->themeConfig)): 249 unset($this->themeConfig[$name]); 250 endif; 218 251 endif; 219 252 } … … 235 268 endif; 236 269 endif; 270 } 271 272 public function hasCustomFavicon() { 273 return ($this->hasOption("p_logo_path")); 274 } 275 276 public function update($old_version, $new_version) { 277 $this->prepareCustomCSS(); 278 } 279 280 public function uninstall() { 281 // delete configuration 282 $this->deleteCustomCSS(); 283 284 conf_delete_param('greydragon'); 237 285 } 238 286 … … 290 338 } 291 339 292 public function getHeader() { 293 $content = ""; 340 public function getURLRoot() { 294 341 $root_base = get_root_url(); 295 342 if ($root_base): … … 297 344 $root_base = '/'; 298 345 endif; 346 return $root_base; 347 } 348 349 public function getHeader() { 350 global $conf; 351 352 $content = ""; 353 $root_base = $this->getURLRoot(); 299 354 300 355 if ($this->hasOption('p_logo_path')): … … 302 357 endif; 303 358 if ($this->hasOption('p_header')): 304 $ content .= '<a title="Home" id="g-header-text" href="' . $root_base . '">' . $this->getOption('p_header') . '</a>';359 $p_header = $this->getOption('p_header'); 305 360 elseif ($this->hasOption('page_banner', TRUE)): 306 $content .= '<a title="Home" id="g-header-text" href="' . $root_base . '">' . $this->getOption('page_banner', TRUE) . '</a>'; 307 endif; 361 $p_header = $this->getOption('page_banner', TRUE); 362 else: 363 $p_header = ""; 364 endif; 365 $p_header = trim(str_replace('%gallery_title%', $conf['gallery_title'], $p_header)); 366 if (strlen($p_header) > 0): 367 $content .= '<a title="Home" id="g-header-text" href="{$U_HOME}">' . $p_header . '</a>'; 368 endif; 308 369 309 370 return $content; -
extensions/greydragon/maintain.class.php
r30783 r30900 6 6 class greydragon_maintain extends PluginMaintain { 7 7 8 private $dir;9 8 private $themeCore; 10 9 … … 13 12 14 13 $this->themeCore = greyDragonCore::Instance(GDTHEME_VERSION); 15 $this->dir = PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'greydragon/';16 14 } 17 15 … … 20 18 */ 21 19 function install($plugin_version, &$errors=array()) { 22 $this->themeCore-> prepareCustomCSS();20 $this->themeCore->update("0.0", $plugin_version); 23 21 } 24 22 … … 27 25 */ 28 26 function update($old_version, $new_version, &$errors=array()) { 29 $this-> install($new_version, $errors);27 $this->themeCore->update($old_version, $new_version); 30 28 } 31 29 … … 34 32 */ 35 33 function uninstall() { 36 // delete configuration 37 conf_delete_param('greydragon'); 38 39 $this->themeCore->deleteCustomCSS(); 34 $this->themeCore->uninstall(); 40 35 } 41 36 } -
extensions/greydragon/template/header.tpl
r30783 r30900 21 21 {/if} 22 22 <title>{if $PAGE_TITLE!=l10n('Home') && $PAGE_TITLE!=$GALLERY_TITLE}{$PAGE_TITLE} | {/if}{$GALLERY_TITLE}</title> 23 {if $greydragon.p_favicon_path} 24 <link rel="shortcut icon" type="image/x-icon" href="{$ROOT_URL}{$greydragon.p_favicon_path}"> 25 {else} 26 <link rel="shortcut icon" type="image/x-icon" href="{$ROOT_URL}{$themeconf.icon_dir}/favicon.ico"> 27 {/if} 23 {if $greydragon.p_favicon_ico}<link href="{$ROOT_URL}{$greydragon.p_favicon_ico}" rel="shortcut icon" type="image/x-icon"> 24 {else}<link href="{$ROOT_URL}{$themeconf.icon_dir}/favicon.ico" rel="shortcut icon" type="image/x-icon">{/if} 25 {if $greydragon.p_favicon_png}<link href="{$ROOT_URL}{$greydragon.p_favicon_png}" rel="icon" type="image/png">{/if} 26 {if $greydragon.p_favicon_gif}<link href="{$ROOT_URL}{$greydragon.p_favicon_gif}" rel="icon" type="image/gif">{/if} 27 {if $greydragon.p_favicon_apple}{if $greydragon.p_favicon_noshine == "on"}<link href="{$ROOT_URL}{$greydragon.p_favicon_apple}" rel="apple-touch-icon-precomposed"> 28 {else}<link href="{$ROOT_URL}{$greydragon.p_favicon_apple}" rel="apple-touch-icon">{/if}{/if} 29 28 30 <link rel="start" title="{'Home'|@translate}" href="{$U_HOME}" > 29 31 <link rel="search" title="{'Search'|@translate}" href="{$ROOT_URL}search.php" > -
extensions/greydragon/themeconf.inc.php
r30783 r30900 2 2 /* 3 3 Theme Name: GreyDragon 4 Version: 1.1. 194 Version: 1.1.20 5 5 Description: GreyDragon Theme 6 6 Theme URI: http://piwigo.org/ext/extension_view.php?eid=775 … … 29 29 30 30 $themeCore = greyDragonCore::Instance(); 31 if ($themeCore->has Option("p_logo_path") || $themeCore->hasOption("p_header") || $themeCore->hasOption('page_banner', TRUE)):31 if ($themeCore->hasCustomFavicon() || $themeCore->hasOption("p_header") || $themeCore->hasOption('page_banner', TRUE)): 32 32 add_event_handler('render_page_banner', 'greydragon_render_header'); 33 33 endif;
Note: See TracChangeset
for help on using the changeset viewer.