Changeset 874
- Timestamp:
- 03/13/09 18:53:39 (14 years ago)
- bzr:base-revision:
- svn-v4:b35155ea-a742-4b26-8089-0891bb790021:plugins/gallery/trunk:869
- bzr:committer:
- dsls <dsls@kissifrott>
- bzr:mapping-version:
- v4
- bzr:repository-uuid:
- b35155ea-a742-4b26-8089-0891bb790021
- bzr:revision-id:
- dsls@kissifrott-20090313164312-pmhf3cn7dk8y1adu
- bzr:revno:
- 22
- bzr:revprop:branch-nick:
- gallery
- bzr:root:
- plugins/gallery/trunk
- bzr:timestamp:
- 2009-03-13 17:43:12.414999962 +0100
- bzr:user-agent:
- bzr1.12+bzr-svn0.5.0
- Location:
- plugins/gallery/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/gallery/trunk/_public_tpl.php
r857 r874 21 21 $core->tpl->addValue('GalleryAttachmentThumbURL',array('tplGallery','GalleryAttachmentThumbURL')); 22 22 $core->tpl->addValue('GalleryFeedURL',array('tplGallery','GalleryFeedURL')); 23 $core->tpl->addValue('GalleryThemeParam',array('tplGallery','GalleryThemeParam')); 23 24 24 25 /* Galleries items management */ … … 270 271 } 271 272 273 public static function GalleryThemeParam($attr) 274 { 275 global $_ctx; 276 $f = $GLOBALS['core']->tpl->getFilters($attr); 277 $querychar=($GLOBALS['core']->blog->settings->url_scan == 'path_info')?'?':'&'; 278 return '<?php if (!is_null($_GET["theme"])): echo "'. 279 $querychar.'theme=".html::escapeHTML($_GET["theme"]);endif;?>'; 280 } 281 272 282 public static function GalleryItemMeta($attr) 273 283 { -
plugins/gallery/trunk/_public_urlhandlers.php
r860 r874 72 72 $GLOBALS['_ctx']->gal_params = $gal_params; 73 73 $GLOBALS['_ctx']->gallery_url = $GLOBALS['_ctx']->posts->post_url; 74 $GLOBALS['_ctx']->gallery_theme = $theme;75 74 $GLOBALS['_ctx']->comment_preview = new ArrayObject(); 76 75 $GLOBALS['_ctx']->comment_preview['content'] = ''; … … 97 96 $post_id = $GLOBALS['_ctx']->posts->post_id; 98 97 $post_password = $GLOBALS['_ctx']->posts->post_password; 98 $wished=null; 99 if (isset($_GET['theme'])) 100 $wished=html::escapeHTML($_GET['theme']); 99 101 if ($themetoset) { 100 $theme = $GLOBALS['core']->gallery->getGalTheme($GLOBALS["_ctx"]->posts); 101 $GLOBALS['_ctx']->gallery_theme = $theme; 102 $theme = $GLOBALS['core']->gallery->getGalTheme($GLOBALS["_ctx"]->posts,'gal',$wished); 102 103 } 104 105 $GLOBALS['_ctx']->gallery_theme = $theme; 103 106 104 107 -
plugins/gallery/trunk/class.dc.gallery.php
r869 r874 89 89 } 90 90 91 public function getGalTheme ($gal,$context='gal') { 91 /** 92 * getGalTheme 93 * 94 * Retrieves gallery theme from gallery metadata 95 * Theme can be different according to context 96 * a wished theme can be specified, but it will be checked before 97 * 98 * @param record $gal the gallery record 99 * @param string $context context to fetch theme from (integ, gal) 100 * @param string $wished wished theme (theme switcher, for instance) 101 * @access public 102 * @return string the gallery theme name 103 */ 104 public function getGalTheme ($gal,$context='gal',$wished=null) { 105 if ($wished != null) { 106 if ($this->themeExists($wished)) 107 return $wished; 108 } 92 109 $meta = $this->core->meta->getMetaArray($gal->post_meta); 93 110 if ($context == 'gal') { … … 1214 1231 1215 1232 /** 1233 * themeExists 1234 * 1235 * checks whether a gallery theme exists. 1236 * 1237 * @param string $theme the theme to check 1238 * @access public 1239 * @return boolean true if theme exits, false otherwise. 1240 */ 1241 public function themeExists($theme) { 1242 $galtheme=basename($theme); 1243 if ($galtheme == "gal_feed") 1244 return false; 1245 $themes_dir = path::fullFromRoot($this->core->blog->settings->gallery_themes_path,DC_ROOT); 1246 $theme_path = $themes_dir.'/gal_'.$galtheme; 1247 return file_exists($theme_path) && is_dir($theme_path); 1248 } 1249 1250 /** 1216 1251 * fillGalleryContext 1217 1252 * -
plugins/gallery/trunk/default-templates/gal_simple/gallery_item.html
r857 r874 10 10 <tpl:GalleryPagination> 11 11 <p class="pagination"> 12 <tpl:PaginationIf start="0"><a href="{{tpl:PaginationURL offset="-1"}}" class="next">« {{tpl:lang previous images}}12 <tpl:PaginationIf start="0"><a href="{{tpl:PaginationURL offset="-1"}}{{tpl:GalleryThemeParam}}" class="next">« {{tpl:lang previous images}} 13 13 </a> - </tpl:PaginationIf> 14 14 {{tpl:lang page}} {{tpl:PaginationCurrent}} {{tpl:lang of}} {{tpl:PaginationCounter}} 15 <tpl:PaginationIf end="0"> - <a href="{{tpl:PaginationURL offset="+1"}}" class="prev">15 <tpl:PaginationIf end="0"> - <a href="{{tpl:PaginationURL offset="+1"}}{{tpl:GalleryThemeParam}}" class="prev"> 16 16 {{tpl:lang next images}} »</a></tpl:PaginationIf> 17 17
Note: See TracChangeset
for help on using the changeset viewer.