Changeset 1616
- Timestamp:
- 10/21/09 11:53:57 (4 years ago)
- Location:
- plugins/gallery/trunk
- Files:
-
- 6 edited
-
_define.php (modified) (1 diff)
-
_install.php (modified) (2 diffs)
-
_prepend.php (modified) (1 diff)
-
_public_urlhandlers.php (modified) (10 diffs)
-
class.dc.gallery.integration.php (modified) (3 diffs)
-
options.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/gallery/trunk/_define.php
r1589 r1616 16 16 /* Description*/ "Image Gallery for Dotclear2", 17 17 /* Author */ "Bruno Hondelatte", 18 /* Version */ '0. 3.7',18 /* Version */ '0.4alpha', 19 19 /* Permissions */ 'usage,contentadmin' 20 20 ); -
plugins/gallery/trunk/_install.php
r987 r1616 24 24 function putGlobalSetting($id,$value,$type=null,$label=null,$value_change=true) { 25 25 global $core; 26 $old_value = $core->blog->settings->g et($id);26 $old_value = $core->blog->settings->gallery->get($id); 27 27 if ($old_value === null) 28 $core->blog->settings-> put($id,$value,$type,$label,$value_change,true);28 $core->blog->settings->gallery->put($id,$value,$type,$label,$value_change,true); 29 29 else 30 $core->blog->settings-> put($id,$old_value,$type,$label,$value_change,true);30 $core->blog->settings->gallery->put($id,$old_value,$type,$label,$value_change,true); 31 31 } 32 32 $themes_re = "#(.*)themes$#"; 33 if (preg_match($themes_re,$core->blog->settings-> themes_path)) {34 $gal_default_themes_path = preg_replace("#(.*)themes$#","$1plugins/gallery/default-templates",$core->blog->settings-> themes_path);33 if (preg_match($themes_re,$core->blog->settings->system->themes_path)) { 34 $gal_default_themes_path = preg_replace("#(.*)themes$#","$1plugins/gallery/default-templates",$core->blog->settings->system->themes_path); 35 35 } else { 36 36 $gal_default_themes_path = 'plugins/gallery/default-templates'; 37 37 } 38 $core->blog->settings-> setNamespace('gallery');38 $core->blog->settings->addNamespace('gallery'); 39 39 putGlobalSetting('gallery_galleries_url_prefix','galleries','string','Gallery lists URL prefix'); 40 40 putGlobalSetting('gallery_gallery_url_prefix','gallery','string','Galleries URL prefix'); … … 64 64 65 65 if ($core->blog->settings->gallery_default_theme == 'default') { 66 $core->blog->settings-> put('gallery_default_theme','simple','string','Default theme to use', true, true);66 $core->blog->settings->gallery->put('gallery_default_theme','simple','string','Default theme to use', true, true); 67 67 } 68 68 -
plugins/gallery/trunk/_prepend.php
r629 r1616 22 22 23 23 /* URL Handlers for galleries lists, galleries and images */ 24 if ($core->blog->settings->gallery _enabled) {25 $core->url->register('gal',$core->blog->settings->gallery _gallery_url_prefix,'^'26 .$core->blog->settings->gallery _gallery_url_prefix.'/(.+)$',array('urlGallery','gallery'));27 $core->url->register('galleries',$core->blog->settings->gallery _galleries_url_prefix,'^'28 .$core->blog->settings->gallery _galleries_url_prefix.'(.*)$',array('urlGallery','galleries'));29 $core->url->register('galitem',$core->blog->settings->gallery _image_url_prefix,'^'30 .$core->blog->settings->gallery _image_url_prefix.'/(.+)$',array('urlGallery','image'));24 if ($core->blog->settings->gallery->gallery_enabled) { 25 $core->url->register('gal',$core->blog->settings->gallery->gallery_gallery_url_prefix,'^' 26 .$core->blog->settings->gallery->gallery_gallery_url_prefix.'/(.+)$',array('urlGallery','gallery')); 27 $core->url->register('galleries',$core->blog->settings->gallery->gallery_galleries_url_prefix,'^' 28 .$core->blog->settings->gallery->gallery_galleries_url_prefix.'(.*)$',array('urlGallery','galleries')); 29 $core->url->register('galitem',$core->blog->settings->gallery->gallery_image_url_prefix,'^' 30 .$core->blog->settings->gallery->gallery_image_url_prefix.'/(.+)$',array('urlGallery','image')); 31 31 $core->url->register('galtheme','gallerytheme','^gallerytheme/(.+/.+)$',array('urlGalleryProxy','galtheme')); 32 32 -
plugins/gallery/trunk/_public_urlhandlers.php
r1472 r1616 50 50 $params['post_id'] = $m[3]; 51 51 } elseif ($args != '') { 52 //$page=$GLOBALS['core']->blog->settings->gallery _default_theme.'/gallery.html';52 //$page=$GLOBALS['core']->blog->settings->gallery->gallery_default_theme.'/gallery.html'; 53 53 $page='gallery.html'; 54 54 $params['post_url'] = $args; … … 151 151 if ($content != '') 152 152 { 153 if ($GLOBALS['core']->blog->settings-> wiki_comments) {153 if ($GLOBALS['core']->blog->settings->system->wiki_comments) { 154 154 $GLOBALS['core']->initWikiComment(); 155 155 } else { … … 179 179 $cur->comment_content = $content; 180 180 $cur->post_id = $GLOBALS['_ctx']->posts->post_id; 181 $cur->comment_status = $GLOBALS['core']->blog->settings-> comments_pub ? 1 : -1;181 $cur->comment_status = $GLOBALS['core']->blog->settings->system->comments_pub ? 1 : -1; 182 182 $cur->comment_ip = http::realIP(); 183 183 … … 237 237 $GLOBALS['core']->meta = new dcMeta($GLOBALS['core']);; 238 238 $GLOBALS['core']->gallery = new dcGallery($GLOBALS['core']); 239 $GLOBALS['_ctx']->nb_entry_per_page= $GLOBALS['core']->blog->settings->gallery _nb_galleries_per_page;240 self::serveThemeDocument('gal_'.$GLOBALS['core']->blog->settings->gallery _default_theme,'/galleries.html');239 $GLOBALS['_ctx']->nb_entry_per_page= $GLOBALS['core']->blog->settings->gallery->gallery_nb_galleries_per_page; 240 self::serveThemeDocument('gal_'.$GLOBALS['core']->blog->settings->gallery->gallery_default_theme,'/galleries.html'); 241 241 } 242 242 … … 251 251 $params['post_id'] = $m[3]; 252 252 } elseif ($args != '') { 253 $theme=$GLOBALS['core']->blog->settings->gallery _default_theme;253 $theme=$GLOBALS['core']->blog->settings->gallery->gallery_default_theme; 254 254 $page='image.html'; 255 255 $params['post_url'] = $args; … … 311 311 $theme = $meta['galtheme'][0]; 312 312 } else { 313 $theme=$GLOBALS['core']->blog->settings->gallery _default_theme;313 $theme=$GLOBALS['core']->blog->settings->gallery->gallery_default_theme; 314 314 } 315 315 } elseif ($theme != '') { 316 $theme=$GLOBALS['core']->blog->settings->gallery _default_theme;316 $theme=$GLOBALS['core']->blog->settings->gallery->gallery_default_theme; 317 317 } 318 318 $GLOBALS['_ctx']->gallery_theme=$theme; … … 361 361 if ($content != '') 362 362 { 363 if ($GLOBALS['core']->blog->settings-> wiki_comments) {363 if ($GLOBALS['core']->blog->settings->system->wiki_comments) { 364 364 $GLOBALS['core']->initWikiComment(); 365 365 } else { … … 389 389 $cur->comment_content = $content; 390 390 $cur->post_id = $GLOBALS['_ctx']->posts->post_id; 391 $cur->comment_status = $GLOBALS['core']->blog->settings-> comments_pub ? 1 : -1;391 $cur->comment_status = $GLOBALS['core']->blog->settings->system->comments_pub ? 1 : -1; 392 392 $cur->comment_ip = http::realIP(); 393 393 … … 526 526 return; 527 527 } 528 $full_path = path::fullFromRoot($GLOBALS['core']->blog->settings->gallery _themes_path.'/gal_'.$theme.'/'.$res,DC_ROOT);528 $full_path = path::fullFromRoot($GLOBALS['core']->blog->settings->gallery->gallery_themes_path.'/gal_'.$theme.'/'.$res,DC_ROOT); 529 529 if (!file_exists($full_path)) { 530 $full_path = path::fullFromRoot($GLOBALS['core']->blog->settings->gallery _themes_path.'/gal_simple/'.$res,DC_ROOT);530 $full_path = path::fullFromRoot($GLOBALS['core']->blog->settings->gallery->gallery_themes_path.'/gal_simple/'.$res,DC_ROOT); 531 531 $theme="simple"; 532 532 } … … 541 541 header('Content-Type: '.$type); 542 542 header('Content-Length: '.filesize($full_path)); 543 if ($type != "text/css" || $GLOBALS['core']->blog->settings-> url_scan == 'path_info') {543 if ($type != "text/css" || $GLOBALS['core']->blog->settings->system->url_scan == 'path_info') { 544 544 readfile($full_path); 545 545 } else { -
plugins/gallery/trunk/class.dc.gallery.integration.php
r1351 r1616 35 35 $this->type_mode_bind=array(); 36 36 if (function_exists('json_decode') && 37 $this->core->blog->settings->gallery _supported_modes) {38 $this->supported_modes = json_decode($this->core->blog->settings->gallery _supported_modes);37 $this->core->blog->settings->gallery->gallery_supported_modes) { 38 $this->supported_modes = json_decode($this->core->blog->settings->gallery->gallery_supported_modes); 39 39 } else { 40 40 $this->supported_modes = self::$default_supported_modes; … … 47 47 48 48 public function load() { 49 if ($this->core->blog->settings->gallery _integrations != "") {50 $integ = @unserialize(base64_decode($this->core->blog->settings->gallery _integrations));49 if ($this->core->blog->settings->gallery->gallery_integrations != "") { 50 $integ = @unserialize(base64_decode($this->core->blog->settings->gallery->gallery_integrations)); 51 51 if ($integ === false) 52 52 $integ = array(); … … 58 58 59 59 public function save() { 60 $this->core->blog->settings-> setNamespace('gallery');61 $this->core->blog->settings-> put('gallery_integrations',60 $this->core->blog->settings->addNamespace('gallery'); 61 $this->core->blog->settings->gallery->put('gallery_integrations', 62 62 @base64_encode(serialize($this->integrations)),'string', 63 63 'Gallery integrations'); -
plugins/gallery/trunk/options.php
r869 r1616 21 21 function setSettings() { 22 22 global $core; 23 $galleries_url_prefix = $core->blog->settings->gallery _galleries_url_prefix;24 $gallery_url_prefix = $core->blog->settings->gallery _gallery_url_prefix;25 $image_url_prefix = $core->blog->settings->gallery _image_url_prefix;26 //$images_url_prefix = $core->blog->settings->gallery _images_url_prefix;27 //$browser_url_prefix = $core->blog->settings->gallery _browser_url_prefix;28 $default_theme = $core->blog->settings->gallery _default_theme;29 $default_integ_theme = $core->blog->settings->gallery _default_integ_theme;30 $nb_images_per_page = $core->blog->settings->gallery _nb_images_per_page;31 $nb_galleries_per_page = $core->blog->settings->gallery _nb_galleries_per_page;32 $gallery_new_items_default = $core->blog->settings->gallery _new_items_default;33 $gallery_galleries_sort = $core->blog->settings->gallery _galleries_sort;34 $gallery_galleries_order = $core->blog->settings->gallery _galleries_order;35 $gallery_galleries_orderbycat = $core->blog->settings->gallery _galleries_orderbycat;36 $gallery_entries_include_galleries = $core->blog->settings->gallery _entries_include_galleries;37 $gallery_entries_include_images = $core->blog->settings->gallery _entries_include_images;38 $gallery_enabled = $core->blog->settings->gallery _enabled;39 40 $core->blog->settings-> setNamespace('gallery');41 $core->blog->settings-> put('gallery_galleries_url_prefix',$galleries_url_prefix);42 $core->blog->settings-> put('gallery_gallery_url_prefix',$gallery_url_prefix);43 $core->blog->settings-> put('gallery_image_url_prefix',$image_url_prefix);44 //$core->blog->settings-> put('gallery_images_url_prefix',$images_url_prefix,'string','Filtered Images URL prefix');45 //$core->blog->settings-> put('gallery_browser_url_prefix',$browser_url_prefix,'string','Browser URL prefix');46 $core->blog->settings-> put('gallery_default_theme',$default_theme);47 $core->blog->settings-> put('gallery_default_integ_theme',$default_integ_theme);48 $core->blog->settings-> put('gallery_nb_images_per_page',$nb_images_per_page);49 $core->blog->settings-> put('gallery_nb_galleries_per_page',$nb_galleries_per_page);50 $core->blog->settings-> put('gallery_new_items_default',$gallery_new_items_default);51 $core->blog->settings-> put('gallery_galleries_sort',$gallery_galleries_sort);52 $core->blog->settings-> put('gallery_galleries_order',$gallery_galleries_order);53 $core->blog->settings-> put('gallery_galleries_orderbycat',$gallery_galleries_orderbycat);54 $core->blog->settings-> put('gallery_entries_include_images',$gallery_entries_include_images);55 $core->blog->settings-> put('gallery_entries_include_galleries',$gallery_entries_include_galleries);56 $core->blog->settings-> put('gallery_enabled',$gallery_enabled);57 http::redirect('plugin.php?p=gallery&m=options&upd=1'); 58 } 59 60 $defaults=$core->blog->settings->gallery _new_items_default;61 $c_nb_img=$core->blog->settings->gallery _nb_images_per_page;62 $c_nb_gal=$core->blog->settings->gallery _nb_galleries_per_page;63 $c_sort=$core->blog->settings->gallery _galleries_sort;64 $c_order=$core->blog->settings->gallery _galleries_order;65 $c_orderbycat=$core->blog->settings->gallery _galleries_orderbycat;66 $c_gals_prefix=$core->blog->settings->gallery _galleries_url_prefix;67 $c_gal_prefix=$core->blog->settings->gallery _gallery_url_prefix;68 $c_img_prefix=$core->blog->settings->gallery _image_url_prefix;69 $c_admin_gals_sortby=$core->blog->settings->gallery _admin_gals_sortby;70 $c_admin_gals_order=$core->blog->settings->gallery _admin_gals_order;71 $c_admin_items_sortby=$core->blog->settings->gallery _admin_items_sortby;72 $c_admin_items_order=$core->blog->settings->gallery _admin_items_order;73 $c_default_theme=$core->blog->settings->gallery _default_theme;74 $c_default_integ_theme=$core->blog->settings->gallery _default_integ_theme;23 $galleries_url_prefix = $core->blog->settings->gallery->gallery_galleries_url_prefix; 24 $gallery_url_prefix = $core->blog->settings->gallery->gallery_gallery_url_prefix; 25 $image_url_prefix = $core->blog->settings->gallery->gallery_image_url_prefix; 26 //$images_url_prefix = $core->blog->settings->gallery->gallery_images_url_prefix; 27 //$browser_url_prefix = $core->blog->settings->gallery->gallery_browser_url_prefix; 28 $default_theme = $core->blog->settings->gallery->gallery_default_theme; 29 $default_integ_theme = $core->blog->settings->gallery->gallery_default_integ_theme; 30 $nb_images_per_page = $core->blog->settings->gallery->gallery_nb_images_per_page; 31 $nb_galleries_per_page = $core->blog->settings->gallery->gallery_nb_galleries_per_page; 32 $gallery_new_items_default = $core->blog->settings->gallery->gallery_new_items_default; 33 $gallery_galleries_sort = $core->blog->settings->gallery->gallery_galleries_sort; 34 $gallery_galleries_order = $core->blog->settings->gallery->gallery_galleries_order; 35 $gallery_galleries_orderbycat = $core->blog->settings->gallery->gallery_galleries_orderbycat; 36 $gallery_entries_include_galleries = $core->blog->settings->gallery->gallery_entries_include_galleries; 37 $gallery_entries_include_images = $core->blog->settings->gallery->gallery_entries_include_images; 38 $gallery_enabled = $core->blog->settings->gallery->gallery_enabled; 39 40 $core->blog->settings->addNamespace('gallery'); 41 $core->blog->settings->gallery->put('gallery_galleries_url_prefix',$galleries_url_prefix); 42 $core->blog->settings->gallery->put('gallery_gallery_url_prefix',$gallery_url_prefix); 43 $core->blog->settings->gallery->put('gallery_image_url_prefix',$image_url_prefix); 44 //$core->blog->settings->gallery->put('gallery_images_url_prefix',$images_url_prefix,'string','Filtered Images URL prefix'); 45 //$core->blog->settings->gallery->put('gallery_browser_url_prefix',$browser_url_prefix,'string','Browser URL prefix'); 46 $core->blog->settings->gallery->put('gallery_default_theme',$default_theme); 47 $core->blog->settings->gallery->put('gallery_default_integ_theme',$default_integ_theme); 48 $core->blog->settings->gallery->put('gallery_nb_images_per_page',$nb_images_per_page); 49 $core->blog->settings->gallery->put('gallery_nb_galleries_per_page',$nb_galleries_per_page); 50 $core->blog->settings->gallery->put('gallery_new_items_default',$gallery_new_items_default); 51 $core->blog->settings->gallery->put('gallery_galleries_sort',$gallery_galleries_sort); 52 $core->blog->settings->gallery->put('gallery_galleries_order',$gallery_galleries_order); 53 $core->blog->settings->gallery->put('gallery_galleries_orderbycat',$gallery_galleries_orderbycat); 54 $core->blog->settings->gallery->put('gallery_entries_include_images',$gallery_entries_include_images); 55 $core->blog->settings->gallery->put('gallery_entries_include_galleries',$gallery_entries_include_galleries); 56 $core->blog->settings->gallery->put('gallery_enabled',$gallery_enabled); 57 http::redirect('plugin.php?p=gallery&m=options&upd=1'); 58 } 59 60 $defaults=$core->blog->settings->gallery->gallery_new_items_default; 61 $c_nb_img=$core->blog->settings->gallery->gallery_nb_images_per_page; 62 $c_nb_gal=$core->blog->settings->gallery->gallery_nb_galleries_per_page; 63 $c_sort=$core->blog->settings->gallery->gallery_galleries_sort; 64 $c_order=$core->blog->settings->gallery->gallery_galleries_order; 65 $c_orderbycat=$core->blog->settings->gallery->gallery_galleries_orderbycat; 66 $c_gals_prefix=$core->blog->settings->gallery->gallery_galleries_url_prefix; 67 $c_gal_prefix=$core->blog->settings->gallery->gallery_gallery_url_prefix; 68 $c_img_prefix=$core->blog->settings->gallery->gallery_image_url_prefix; 69 $c_admin_gals_sortby=$core->blog->settings->gallery->gallery_admin_gals_sortby; 70 $c_admin_gals_order=$core->blog->settings->gallery->gallery_admin_gals_order; 71 $c_admin_items_sortby=$core->blog->settings->gallery->gallery_admin_items_sortby; 72 $c_admin_items_order=$core->blog->settings->gallery->gallery_admin_items_order; 73 $c_default_theme=$core->blog->settings->gallery->gallery_default_theme; 74 $c_default_integ_theme=$core->blog->settings->gallery->gallery_default_integ_theme; 75 75 76 76 if (!empty($_POST['enable_plugin'])) { 77 $core->blog->settings-> setNamespace('gallery');78 $core->blog->settings-> put('gallery_enabled',true,'boolean');77 $core->blog->settings->addNamespace('gallery'); 78 $core->blog->settings->gallery->put('gallery_enabled',true,'boolean'); 79 79 setSettings(); 80 80 http::redirect('plugin.php?p=gallery'); 81 81 } elseif (!empty($_POST['disable_plugin'])) { 82 $core->blog->settings-> setNamespace('gallery');83 $core->blog->settings-> put('gallery_enabled',false,'boolean');82 $core->blog->settings->addNamespace('gallery'); 83 $core->blog->settings->gallery->put('gallery_enabled',false,'boolean'); 84 84 setSettings(); 85 85 http::redirect('plugin.php?p=gallery'); … … 94 94 95 95 $gallery_new_items_default=implode('',$items_default); 96 $core->blog->settings-> setNamespace('gallery');97 $core->blog->settings-> put('gallery_new_items_default',$gallery_new_items_default,'string','Default options for new items management');96 $core->blog->settings->addNamespace('gallery'); 97 $core->blog->settings->gallery->put('gallery_new_items_default',$gallery_new_items_default,'string','Default options for new items management'); 98 98 $defaults=$gallery_new_items_default; 99 99 http::redirect('plugin.php?p=gallery&m=options&upd=1'); … … 110 110 $c_default_theme = !empty($_POST['default_theme'])?$_POST['default_theme']:$c_default_theme; 111 111 $c_default_integ_theme = !empty($_POST['default_integ_theme'])?$_POST['default_integ_theme']:$c_default_integ_theme; 112 $core->blog->settings-> setNamespace('gallery');113 $core->blog->settings-> put('gallery_nb_images_per_page',$c_nb_img);114 $core->blog->settings-> put('gallery_nb_galleries_per_page',$c_nb_gal);115 $core->blog->settings-> put('gallery_galleries_sort',$c_sort);116 $core->blog->settings-> put('gallery_galleries_order',$c_order);117 $core->blog->settings-> put('gallery_galleries_orderbycat',$c_orderbycat);118 $core->blog->settings-> put('gallery_admin_gals_sortby',$c_admin_gals_sortby);119 $core->blog->settings-> put('gallery_admin_gals_order',$c_admin_gals_order);120 $core->blog->settings-> put('gallery_admin_items_sortby',$c_admin_items_sortby);121 $core->blog->settings-> put('gallery_admin_items_order',$c_admin_items_order);122 $core->blog->settings-> put('gallery_default_theme',$c_default_theme);123 $core->blog->settings-> put('gallery_default_integ_theme',$c_default_integ_theme);112 $core->blog->settings->addNamespace('gallery'); 113 $core->blog->settings->gallery->put('gallery_nb_images_per_page',$c_nb_img); 114 $core->blog->settings->gallery->put('gallery_nb_galleries_per_page',$c_nb_gal); 115 $core->blog->settings->gallery->put('gallery_galleries_sort',$c_sort); 116 $core->blog->settings->gallery->put('gallery_galleries_order',$c_order); 117 $core->blog->settings->gallery->put('gallery_galleries_orderbycat',$c_orderbycat); 118 $core->blog->settings->gallery->put('gallery_admin_gals_sortby',$c_admin_gals_sortby); 119 $core->blog->settings->gallery->put('gallery_admin_gals_order',$c_admin_gals_order); 120 $core->blog->settings->gallery->put('gallery_admin_items_sortby',$c_admin_items_sortby); 121 $core->blog->settings->gallery->put('gallery_admin_items_order',$c_admin_items_order); 122 $core->blog->settings->gallery->put('gallery_default_theme',$c_default_theme); 123 $core->blog->settings->gallery->put('gallery_default_integ_theme',$c_default_integ_theme); 124 124 $core->blog->triggerBlog(); 125 125 http::redirect('plugin.php?p=gallery&m=options&upd=1'); … … 140 140 $c_gal_prefix = !empty($_POST['gallery_prefix'])?$_POST['gallery_prefix']:$c_gal_prefix; 141 141 $c_img_prefix = !empty($_POST['images_prefix'])?$_POST['images_prefix']:$c_img_prefix; 142 $core->blog->settings-> setNamespace('gallery');142 $core->blog->settings->addNamespace('gallery'); 143 143 $core->blog->settings->put('gallery_galleries_url_prefix',$c_gals_prefix); 144 144 $core->blog->settings->put('gallery_gallery_url_prefix',$c_gal_prefix); … … 211 211 $order_combo = array(__('Ascending') => 'asc', 212 212 __('Descending') => 'desc' ); 213 if (is_null($core->blog->settings->gallery _enabled) || !$core->blog->settings->gallery_enabled) {213 if (is_null($core->blog->settings->gallery->gallery_enabled) || !$core->blog->settings->gallery->gallery_enabled) { 214 214 $public_ok = is_dir($core->blog->public_path); 215 215
Note: See TracChangeset
for help on using the changeset viewer.