From 35dda08e8e90ce05dbcb9bfa6e9a186b121d3fdf Mon Sep 17 00:00:00 2001
From: floridave
Date: Thu, 26 Jul 2012 13:05:13 -0600
Subject: [PATCH 01/13] Update 3.0/themes/browny_wind/views/page.html.php
update view to be compatible with G3.0.4
---
3.0/themes/browny_wind/views/page.html.php | 103 +++++++++++----------
1 file changed, 52 insertions(+), 51 deletions(-)
diff --git a/3.0/themes/browny_wind/views/page.html.php b/3.0/themes/browny_wind/views/page.html.php
index 5e4040bd..8ea75ea5 100644
--- a/3.0/themes/browny_wind/views/page.html.php
+++ b/3.0/themes/browny_wind/views/page.html.php
@@ -1,50 +1,44 @@
+
-
+html_attributes() ?> xml:lang="en" lang="en">
+ $theme->start_combining("script,css") ?>
if ($page_title): ?>
= $page_title ?>
else: ?>
if ($theme->item()): ?>
- if ($theme->item()->is_album()): ?>
- = t("Browse Album :: %album_title", array("album_title" => $theme->item()->title)) ?>
- elseif ($theme->item()->is_photo()): ?>
- = t("Photo :: %photo_title", array("photo_title" => $theme->item()->title)) ?>
- else: ?>
- = t("Movie :: %movie_title", array("movie_title" => $theme->item()->title)) ?>
- endif ?>
+ = html::purify($theme->item()->title) ?>
elseif ($theme->tag()): ?>
- = t("Browse Tag :: %tag_title", array("tag_title" => $theme->tag()->name)) ?>
+ = t("Photos tagged with %tag_title", array("tag_title" => $theme->tag()->name)) ?>
else: /* Not an item, not a tag, no page_title specified. Help! */ ?>
- = t("Gallery") ?>
+ = html::purify(item::root()->title) ?>
endif ?>
endif ?>
- " type="image/x-icon" />
- = $theme->css("yui/reset-fonts-grids.css") ?>
- = $theme->css("superfish/css/superfish.css") ?>
- = $theme->css("themeroller/ui.base.css") ?>
- = $theme->css("screen.css") ?>
-
+ "
+ type="image/x-icon" />
+ " />
if ($theme->page_type == "collection"): ?>
- if ($thumb_proportion != 1): ?>
+ if (($thumb_proportion = $theme->thumb_proportion($theme->item())) != 1): ?>
$new_width = round($thumb_proportion * 213) ?>
$new_height = round($thumb_proportion * 240) ?>
-
+
endif ?>
endif ?>
+
+ = $theme->script("json2-min.js") ?>
= $theme->script("jquery.js") ?>
= $theme->script("jquery.form.js") ?>
= $theme->script("jquery-ui.js") ?>
@@ -57,9 +51,8 @@
= $theme->script("gallery.dialog.js") ?>
= $theme->script("superfish/js/superfish.js") ?>
= $theme->script("jquery.localscroll.js") ?>
- = $theme->script("ui.init.js") ?>
- /* These are page specific, but if we put them before $theme->head() they get combined */ ?>
+ /* These are page specific but they get combined */ ?>
if ($theme->page_subtype == "photo"): ?>
= $theme->script("jquery.scrollTo.js") ?>
= $theme->script("gallery.show_full_size.js") ?>
@@ -68,6 +61,26 @@
endif ?>
= $theme->head() ?>
+
+ /* Theme specific CSS/JS goes last so that it can override module CSS/JS */ ?>
+ = $theme->script("ui.init.js") ?>
+ = $theme->css("yui/reset-fonts-grids.css") ?>
+ = $theme->css("superfish/css/superfish.css") ?>
+ = $theme->css("themeroller/ui.base.css") ?>
+ = $theme->css("screen.css") ?>
+ if (locales::is_rtl()): ?>
+ = $theme->css("screen-rtl.css") ?>
+ endif; ?>
+
+
+
+ = $theme->get_combined("css") ?>
+
+
+ = $theme->get_combined("script") ?>
body_attributes() ?>>
@@ -80,7 +93,7 @@
= $header_text ?>
else: ?>
for_html_attr() ?>">
- for_html_attr() ?>" src="= $theme->url("images/logo.png") ?>" />
+ for_html_attr() ?>" src="= url::file("lib/images/logo.png") ?>" />
endif ?>
= $theme->user_menu() ?>
@@ -95,28 +108,16 @@
= $theme->header_bottom() ?>
- if ($theme->item() && !empty($parents)): ?>
+ if (!empty($breadcrumbs)): ?>
endif ?>
@@ -150,4 +151,4 @@
= $theme->page_bottom() ?>
-
+
\ No newline at end of file
From 91efff1a4595cc3fd66810afad92dab0013c6d60 Mon Sep 17 00:00:00 2001
From: floridave
Date: Thu, 26 Jul 2012 13:05:13 -0600
Subject: [PATCH 02/13] Update 3.0/themes/browny_wind/views/page.html.php
update view to be compatible with G3.0.4
Conflicts:
3.0/themes/browny_wind/views/page.html.php
---
3.0/themes/browny_wind/views/page.html.php | 39 ++++++++--------------
1 file changed, 14 insertions(+), 25 deletions(-)
diff --git a/3.0/themes/browny_wind/views/page.html.php b/3.0/themes/browny_wind/views/page.html.php
index f0ee5b5f..c3e212c5 100644
--- a/3.0/themes/browny_wind/views/page.html.php
+++ b/3.0/themes/browny_wind/views/page.html.php
@@ -1,4 +1,5 @@
+
html_attributes() ?> xml:lang="en" lang="en">
@@ -10,11 +11,11 @@
= $page_title ?>
else: ?>
if ($theme->item()): ?>
- = $theme->item()->title ?>
+ = html::purify($theme->item()->title) ?>
elseif ($theme->tag()): ?>
= t("Photos tagged with %tag_title", array("tag_title" => $theme->tag()->name)) ?>
else: /* Not an item, not a tag, no page_title specified. Help! */ ?>
- = item::root()->title ?>
+ = html::purify(item::root()->title) ?>
endif ?>
endif ?>
@@ -24,7 +25,7 @@
" />
if ($theme->page_type == "collection"): ?>
- if ($thumb_proportion != 1): ?>
+ if (($thumb_proportion = $theme->thumb_proportion($theme->item())) != 1): ?>
$new_width = round($thumb_proportion * 213) ?>
$new_height = round($thumb_proportion * 240) ?>
+ if (!module::get_var("th_pear4gallery3", "hide_logo")): ?>
+ if (module::get_var("gallery", "logo_path")) {
+ $logo_url = url::file(module::get_var("th_pear4gallery3", "logo_path"));
+ } else {
+ $logo_url = $theme->url("icons/pear_logo_sml.png");
+ } ?>
+
endif ?>
- if (!module::get_var("th_pear4gallery3", "hide_logo")): ?> endif ?>
endif ?>
diff --git a/views/search.html.php b/views/search.html.php
index 3436a00c..cf7d99f1 100644
--- a/views/search.html.php
+++ b/views/search.html.php
@@ -1,48 +1,18 @@
- // @todo Set hover on AlbumGrid list items ?>
-
-
-
-
= t("Search results") ?>
-
- if (count($items)): ?>
-
- = $theme->paginator() ?>
-
- else: ?>
+
+ if (count($items)): ?>
+ /* Treat dynamic pages just lite album pages. */ ?>
+ $children = $items ?>
+ $v = new View("album.html");
+ $v->set_global("children", $items);// = $items;
+ print $v;?>
+ else: ?>
- = t("No results found for %term", array("term" => $q)) ?>
+ = t("No results found for %term", array("term" => $q)) ?>
-
- endif; ?>
-
+ endif; ?>
diff --git a/views/thumbs.html.php b/views/thumbs.html.php
index 716ad657..fe61e065 100644
--- a/views/thumbs.html.php
+++ b/views/thumbs.html.php
@@ -6,7 +6,7 @@
if ($i > 50) break; ?>
$item_class = "g-photo"; ?>
if ($child->is_album()): ?>
- $item_class = "g-album\" onclick=\"window.location='".$child->url()."/'+getAlbumHash(skimimg);"; ?>
+ $item_class = "g-album\" onclick=\"window.location='".$child->url()."/'+getAlbumHash((typeof skimimg === 'undefined') ? 0 : skimimg);"; ?>
endif ?>
$img_class = "g-thumbnail"; ?>
if ($child->is_photo()): ?>
@@ -55,9 +55,7 @@ endif;
$item_no = ($page*$page_size)-$page_size; ?>
foreach ($children as $i => $child): ?>
if(!($child->is_album() || $child->is_movie())): ?>
-slideshowImages[= $item_no++ ?>] = (['= $child->resize_url() ?>', '= $child->id ?>', '= $child->width ?>','= $child->height ?>', '= htmlentities($child->title, ENT_QUOTES) ?>', ' if (access::can("view_full", $child)) print "true" ?>', '= $child->url() ?>']);
- else: ?>
- $item_no++ ?>
+slideshowImages[= $item_no++ ?>] = (['= $child->resize_url() ?>', '= $child->id ?>', '= $child->resize_width ?>','= $child->resize_height ?>', '= htmlentities($child->title, ENT_QUOTES) ?>', ' if (access::can("view_full", $child)) print "true" ?>', '= $child->url() ?>']);
endif ?>
endforeach ?>
= $javaScript ?>
From 6f6a980336c3f1fb8120da0ae33f08c08fcdde52 Mon Sep 17 00:00:00 2001
From: Fredrik Erlandsson
Date: Fri, 17 Aug 2012 10:03:01 +0200
Subject: [PATCH 04/13] Squashed '3.0/themes/pear4gallery3/' changes from
f6e42a9..0d77c91
0d77c91 Version up to 3.5.3
24b2bdd better support for g-site-status
f3d705e added description of skimm_lim=0 to theme_options
git-subtree-dir: 3.0/themes/pear4gallery3
git-subtree-split: 0d77c91bab4e8cc231cab576763d0c1c5427d084
---
admin/controllers/admin_theme_options.php | 2 +-
css/pear.css | 8 ++++----
js/pear.js | 1 +
theme.info | 2 +-
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/admin/controllers/admin_theme_options.php b/admin/controllers/admin_theme_options.php
index 3da1f39d..13baf395 100644
--- a/admin/controllers/admin_theme_options.php
+++ b/admin/controllers/admin_theme_options.php
@@ -120,7 +120,7 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
->label(t("Google analytics code."))
->value(module::get_var("th_pear4gallery3", "ga_code"));
$group->input("skimm_lim")
- ->label(t("Limit amount of thumbs in album skimming"))
+ ->label(t("Limit amount of thumbs in album skimming (set to 0 to disable)"))
->value(module::get_var("th_pear4gallery3", "skimm_lim", "50"));
/* Advanced Options - Mosaic page ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
diff --git a/css/pear.css b/css/pear.css
index 9648799b..74e8d51b 100644
--- a/css/pear.css
+++ b/css/pear.css
@@ -161,12 +161,11 @@ outline: medium none;
#mosaicTable {
position: fixed;
- top: 45px;
bottom: 40px;
overflow: hidden;
left: 0;
right: 0;
- margin-top: 5px;
+ margin: 0;
}
#mosaicDetail {
@@ -181,6 +180,7 @@ outline: medium none;
margin: 0 auto;
width: 100%;
position: absolute;
+ padding: 5px 0;
}
#mosaicImg {
@@ -213,8 +213,8 @@ outline: medium none;
}
#toggleSidebar {
position: absolute;
- z-index: 1;
- top: 2px;
+ z-index: 101;
+ top: 1px;
left: -18px;
}
diff --git a/js/pear.js b/js/pear.js
index 67f054ac..aa7c0854 100644
--- a/js/pear.js
+++ b/js/pear.js
@@ -201,6 +201,7 @@ function mosaicResize() {
myHeight = myHeight - $('#g-site-status').outerHeight(true) - $('#paginator').outerHeight(true);
myHeight -= 138;
$('#g-header').css('top', $('#gsNavBar').outerHeight(true) + $('#g-site-status').outerHeight(true) - 4);
+ $('#mosaicTable, #sidebarContainer').css('top', $('#gsNavBar').outerHeight(true) + $('#g-site-status').outerHeight(true) - 2 );
if ($('#g-movie').length) {
myHeight += 18;
diff --git a/theme.info b/theme.info
index 67d9e1a2..f3c9f0f5 100644
--- a/theme.info
+++ b/theme.info
@@ -1,6 +1,6 @@
name = ".Pear Theme"
description = "A theme with the intention to mimic Apples mobile me gallery."
-version = 3.5.2
+version = 3.5.3
author = "Fredrik Erlandsson "
site = 1
admin = 0
From 96304ae2aaf153d169b9ca4dbaf8f30b135dc6ed Mon Sep 17 00:00:00 2001
From: Fredrik Erlandsson
Date: Fri, 17 Aug 2012 10:17:03 +0200
Subject: [PATCH 05/13] Squashed '3.0/themes/pear4gallery3/' changes from
0d77c91..af5f903
af5f903 better support for g-action-status Version 3.5.4
git-subtree-dir: 3.0/themes/pear4gallery3
git-subtree-split: af5f90342ee2a55d014d4580ef412a256f7e25e5
---
js/pear.js | 2 +-
theme.info | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/js/pear.js b/js/pear.js
index aa7c0854..104c8099 100644
--- a/js/pear.js
+++ b/js/pear.js
@@ -201,7 +201,7 @@ function mosaicResize() {
myHeight = myHeight - $('#g-site-status').outerHeight(true) - $('#paginator').outerHeight(true);
myHeight -= 138;
$('#g-header').css('top', $('#gsNavBar').outerHeight(true) + $('#g-site-status').outerHeight(true) - 4);
- $('#mosaicTable, #sidebarContainer').css('top', $('#gsNavBar').outerHeight(true) + $('#g-site-status').outerHeight(true) - 2 );
+ $('#mosaicTable, #sidebarContainer').css('top', $('#gsNavBar').outerHeight(true) + $('#g-site-status').outerHeight(true) + $('#g-action-status').outerHeight(true) - 2 );
if ($('#g-movie').length) {
myHeight += 18;
diff --git a/theme.info b/theme.info
index f3c9f0f5..f39ad00b 100644
--- a/theme.info
+++ b/theme.info
@@ -1,6 +1,6 @@
name = ".Pear Theme"
description = "A theme with the intention to mimic Apples mobile me gallery."
-version = 3.5.3
+version = 3.5.4
author = "Fredrik Erlandsson "
site = 1
admin = 0
From 91df191c28fdf0aeaff1125eab96f4bfb748969e Mon Sep 17 00:00:00 2001
From: Fredrik Erlandsson
Date: Fri, 17 Aug 2012 10:28:42 +0200
Subject: [PATCH 06/13] Squashed '3.0/themes/pear4gallery3/' changes from
af5f903..51c6af4
51c6af4 layout fixes
git-subtree-dir: 3.0/themes/pear4gallery3
git-subtree-split: 51c6af48bf333028d770f70b5441a57092565ecc
---
css/pear.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/css/pear.css b/css/pear.css
index 74e8d51b..b58f545e 100644
--- a/css/pear.css
+++ b/css/pear.css
@@ -85,7 +85,7 @@ h2 {
position: fixed;
top: 44px;
width: 100%;
- z-index: 50;
+ z-index: 150;
}
/*Menu*/
.sf-menu li:hover, .sf-menu li.sfHover, .sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
From 1cd9f66665e61be4de6110be75e8b94bb446733a Mon Sep 17 00:00:00 2001
From: Jason Hardin
Date: Sat, 1 Sep 2012 19:18:56 -0700
Subject: [PATCH 07/13] Removed error with test.com, added pinterest support
and the support for only module and block page display.
---
.../controllers/admin_social_share.php | 23 +++++-
.../helpers/social_share_block.php | 57 ++++++++-------
.../helpers/social_share_installer.php | 71 ++++++++++---------
.../helpers/social_share_theme.php | 37 +++++-----
3.0/modules/social_share/module.info | 2 +-
.../social_share/views/facebook_like.html.php | 1 -
.../social_share/views/pinterest.html.php | 13 ++++
7 files changed, 127 insertions(+), 77 deletions(-)
create mode 100644 3.0/modules/social_share/views/pinterest.html.php
diff --git a/3.0/modules/social_share/controllers/admin_social_share.php b/3.0/modules/social_share/controllers/admin_social_share.php
index 7c2aac32..cf330fcc 100644
--- a/3.0/modules/social_share/controllers/admin_social_share.php
+++ b/3.0/modules/social_share/controllers/admin_social_share.php
@@ -42,6 +42,8 @@ class Admin_Social_Share_Controller extends Admin_Controller {
module::set_var("social_share", "google_enabled", $form->google_settings->google_enabled->value);
module::set_var("social_share", "google_size", $form->google_settings->google_size->value);
module::set_var("social_share", "google_annotation", $form->google_settings->google_annotation->value);
+ module::set_var("social_share", "pinterest_enabled", $form->pinterest_settings->pinterest_enabled->value);
+ module::set_var("social_share", "pinterest_count_location", $form->pinterest_settings->pinterest_count_location->value);
module::set_var("social_share", "twitter_enabled", $form->twitter_settings->twitter_enabled->value);
module::set_var("social_share", "twitter_count_location", $form->twitter_settings->twitter_count_location->value);
module::set_var("social_share", "twitter_size", $form->twitter_settings->twitter_size->value);
@@ -62,6 +64,12 @@ class Admin_Social_Share_Controller extends Admin_Controller {
private function _get_form() {
$form = new Forge("admin/social_share/handler", "", "post", array("id" => "g-admin-form"));
+/// General Settings
+ $group_general = $form->group("general_settings")->label(t("General Settings"));
+ $group_general->checkbox("general_impage_only")->label(t("Display the enabled buttons on image and movie pages only"))
+ ->checked(module::get_var("social_share", "general_impage_only", true) == 1);
+
+/// Facebook settings
$group_facebook_share = $form->group("facebook_share_settings")->label(t("Facebook Share Button Settings"));
$group_facebook_share->checkbox("facebook_share_enabled")->label(t("Display the button"))
->checked(module::get_var("social_share", "facebook_share_enabled", false) == 1);
@@ -107,7 +115,8 @@ class Admin_Social_Share_Controller extends Admin_Controller {
"button_count" => t("Button count"),
"box_count" => t("Box count")))
->selected(module::get_var("social_share", "facebook_like_layout"));
-
+
+/// Google settings
$group_google = $form->group("google_settings")->label(t("Google+ +1 Button Settings"));
$group_google->checkbox("google_enabled")->label(t("Display the button"))
->checked(module::get_var("social_share", "google_enabled", false) == 1);
@@ -125,6 +134,18 @@ class Admin_Social_Share_Controller extends Admin_Controller {
"none" => t("None")))
->selected(module::get_var("social_share", "google_annotation"));
+/// Pinterest settings
+ $group_pinterest = $form->group("pinterest_settings")->label(t("Pinterest Pinit Settings"));
+ $group_pinterest->checkbox("pinterest_enabled")->label(t("Display the button"))
+ ->checked(module::get_var("social_share", "pinterest_enabled", false) == 1);
+ $group_pinterest->dropdown("pinterest_count_location")
+ ->label(t("Tweet count location"))
+ ->options(array("horizontal" => t("Horizontal"),
+ "vertical" => t("Vertical"),
+ "none" => t("None")))
+ ->selected(module::get_var("social_share", "pinterest_count_location"));
+
+/// Twitter settings
$group_twitter = $form->group("twitter_settings")->label(t("Twitter Tweet Settings"));
$group_twitter->checkbox("twitter_enabled")->label(t("Display the button"))
->checked(module::get_var("social_share", "twitter_enabled", false) == 1);
diff --git a/3.0/modules/social_share/helpers/social_share_block.php b/3.0/modules/social_share/helpers/social_share_block.php
index 6f592da3..4f4829d0 100644
--- a/3.0/modules/social_share/helpers/social_share_block.php
+++ b/3.0/modules/social_share/helpers/social_share_block.php
@@ -18,30 +18,37 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class social_share_block_Core {
- static function get_site_list() {
- return array(
- "social_share" => t("Social Share"));
- }
+ static function get_site_list() {
+ return array("social_share" => t("Social Share"));
+ }
- static function get($block_id, $theme) {
-
- $block = new Block();
- $block->css_id = "g-social-share";
- $block->title = 'Share With Friends';
- $block->content = '';
- if(module::get_var("social_share", "facebook_share_enabled")){
- $block->content .= new View("facebook_share.html");
- }
- if(module::get_var("social_share", "facebook_like_enabled")){
- $block->content .= new View("facebook_like.html");
- }
- if(module::get_var("social_share", "google_enabled")){
- $block->content .= new View("google.html");
- }
- if(module::get_var("social_share", "twitter_enabled")){
- $block->content .= new View("twitter.html");
- }
-
- return $block;
- }
+ static function get($block_id, $theme) {
+ /// Check if the user wants to show the block on all pages or just the image and movie page types.
+ $impageonly = module::get_var("social_share", "general_impage_only");
+ $showblock = !$impageonly || ($impageonly && ($theme->page_subtype == "photo") || ($theme->page_subtype == "movie"));
+
+ if ($showblock){
+ $block = new Block();
+ $block->css_id = "g-social-share";
+ $block->title = 'Share With Friends';
+ $block->content = '';
+ if(module::get_var("social_share", "facebook_share_enabled")){
+ $block->content .= new View("facebook_share.html");
+ }
+ if(module::get_var("social_share", "facebook_like_enabled")){
+ $block->content .= new View("facebook_like.html");
+ }
+ if(module::get_var("social_share", "google_enabled")){
+ $block->content .= new View("google.html");
+ }
+ if(module::get_var("social_share", "pinterest_enabled")){
+ $block->content .= new View("pinterest.html");
+ }
+ if(module::get_var("social_share", "twitter_enabled")){
+ $block->content .= new View("twitter.html");
+ }
+
+ return $block;
+ }
+ }
}
\ No newline at end of file
diff --git a/3.0/modules/social_share/helpers/social_share_installer.php b/3.0/modules/social_share/helpers/social_share_installer.php
index 153589c1..8fe06371 100644
--- a/3.0/modules/social_share/helpers/social_share_installer.php
+++ b/3.0/modules/social_share/helpers/social_share_installer.php
@@ -18,39 +18,46 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class social_share_installer {
- static function deactivate() {
- module::clear_var("social_share", "facebook_share_enabled");
- module::clear_var("social_share", "facebook_share_layout");
- module::clear_var("social_share", "facebook_share_link_text");
- module::clear_var("social_share", "facebook_like_enabled");
- module::clear_var("social_share", "facebook_like_appId");
- module::clear_var("social_share", "facebook_like_adminId");
- module::clear_var("social_share", "facebook_like_site_name");
- module::clear_var("social_share", "facebook_like_code_type");
- module::clear_var("social_share", "facebook_like_show_faces");
- module::clear_var("social_share", "facebook_like_send");
- module::clear_var("social_share", "facebook_like_action");
- module::clear_var("social_share", "facebook_like_layout");
- module::clear_var("social_share", "google_enabled");
- module::clear_var("social_share", "google_size");
- module::clear_var("social_share", "google_annotation");
- module::clear_var("social_share", "twitter_enabled");
- module::clear_var("social_share", "twitter_count_location");
- module::clear_var("social_share", "twitter_size");
- }
- static function upgrade($version) {
- if ($version < 1) {
- module::set_version("social_share", $version = 1);
+ static function deactivate() {
+ module::clear_var("social_share", "general_impage_only");
+ module::clear_var("social_share", "facebook_share_enabled");
+ module::clear_var("social_share", "facebook_share_layout");
+ module::clear_var("social_share", "facebook_share_link_text");
+ module::clear_var("social_share", "facebook_like_enabled");
+ module::clear_var("social_share", "facebook_like_appId");
+ module::clear_var("social_share", "facebook_like_adminId");
+ module::clear_var("social_share", "facebook_like_site_name");
+ module::clear_var("social_share", "facebook_like_code_type");
+ module::clear_var("social_share", "facebook_like_show_faces");
+ module::clear_var("social_share", "facebook_like_send");
+ module::clear_var("social_share", "facebook_like_action");
+ module::clear_var("social_share", "facebook_like_layout");
+ module::clear_var("social_share", "google_enabled");
+ module::clear_var("social_share", "google_size");
+ module::clear_var("social_share", "google_annotation");
+ module::clear_var("social_share", "pinterest_enabled");
+ module::clear_var("social_share", "pinterest_count_location");
+ module::clear_var("social_share", "twitter_enabled");
+ module::clear_var("social_share", "twitter_count_location");
+ module::clear_var("social_share", "twitter_size");
}
+ static function upgrade($version) {
+ if ($version < 1) {
+ module::set_version("social_share", $version = 1);
+ }
- if ($version < 2) {
- module::set_var("social_share", "facebook_share_enabled", module::get_var("social_share", "facebook"));
- module::clear_var("social_share", "facebook");
- module::set_var("social_share", "google_enabled", module::get_var("social_share", "google"));
- module::clear_var("social_share", "google");
- module::set_var("social_share", "twitter_enabled", module::get_var("social_share", "twitter"));
- module::clear_var("social_share", "twitter");
- module::set_version("social_share", $version = 2);
+ if ($version < 2) {
+ module::set_var("social_share", "facebook_share_enabled", module::get_var("social_share", "facebook"));
+ module::clear_var("social_share", "facebook");
+ module::set_var("social_share", "google_enabled", module::get_var("social_share", "google"));
+ module::clear_var("social_share", "google");
+ module::set_var("social_share", "twitter_enabled", module::get_var("social_share", "twitter"));
+ module::clear_var("social_share", "twitter");
+ module::set_version("social_share", $version = 2);
+ }
+
+ if ($version < 3) {
+ module::set_version("social_share", $version = 3);
+ }
}
- }
}
\ No newline at end of file
diff --git a/3.0/modules/social_share/helpers/social_share_theme.php b/3.0/modules/social_share/helpers/social_share_theme.php
index 02a2542c..9a8ec958 100644
--- a/3.0/modules/social_share/helpers/social_share_theme.php
+++ b/3.0/modules/social_share/helpers/social_share_theme.php
@@ -18,21 +18,24 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class social_share_theme_Core {
- static function head($theme) {
- if ($theme->item()) {
- $item = $theme->item();
- $url = $item->thumb_url(true);
- $appId = module::get_var("social_share", "facebook_like_appId");
- $adminId = module::get_var("social_share", "facebook_like_adminId");
- $site_name = module::get_var("social_share", "facebook_like_site_name");
- $selfURL = url::abs_current(true);
- return "\t
- title\"/>
-
-
-
-
- ";
- }
- }
+ static function head($theme) {
+ $impageonly = module::get_var("social_share", "general_impage_only");
+ $showblock = !$impageonly || ($impageonly && ($theme->page_subtype == "photo") || ($theme->page_subtype == "movie"));
+
+ if ($showblock && $theme->item()) {
+ $item = $theme->item();
+ $url = $item->thumb_url(true);
+ $appId = module::get_var("social_share", "facebook_like_appId");
+ $adminId = module::get_var("social_share", "facebook_like_adminId");
+ $site_name = module::get_var("social_share", "facebook_like_site_name");
+ $selfURL = url::abs_current(true);
+ return "\t
+ title\"/>
+
+
+
+
+ ";
+ }
+ }
}
\ No newline at end of file
diff --git a/3.0/modules/social_share/module.info b/3.0/modules/social_share/module.info
index 288bdf7d..fd1f963a 100644
--- a/3.0/modules/social_share/module.info
+++ b/3.0/modules/social_share/module.info
@@ -1,6 +1,6 @@
name = "Social Share"
description = "Adds links to share the page to social media sites in the sidebar."
-version = 2
+version = 3
author_name = "jasonhardin"
author_url = "http://codex.gallery2.org/User:psychoph"
info_url = "http://codex.gallery2.org/Gallery3:Modules:social_share"
diff --git a/3.0/modules/social_share/views/facebook_like.html.php b/3.0/modules/social_share/views/facebook_like.html.php
index a831607e..5758472f 100644
--- a/3.0/modules/social_share/views/facebook_like.html.php
+++ b/3.0/modules/social_share/views/facebook_like.html.php
@@ -46,7 +46,6 @@ if (module::get_var("social_share", "facebook_like_send")) {
-
diff --git a/3.0/modules/social_share/views/pinterest.html.php b/3.0/modules/social_share/views/pinterest.html.php
new file mode 100644
index 00000000..59d3d66f
--- /dev/null
+++ b/3.0/modules/social_share/views/pinterest.html.php
@@ -0,0 +1,13 @@
+item()) {
+ $item = $theme->item();
+ $media = $item->thumb_url(true);
+?>
+
+">
+
+
+
\ No newline at end of file
From f87cc87ebd0ad500ec90d6b7dbc8617c41f67f74 Mon Sep 17 00:00:00 2001
From: Jason Hardin
Date: Sat, 1 Sep 2012 20:21:31 -0700
Subject: [PATCH 08/13] Fixed pinerest to work and facebook like. THere were
mistakes in facebook that it was not using action. In general settings i was
not storing the page setting.
---
.../controllers/admin_social_share.php | 6 ++++--
.../social_share/views/facebook_like.html.php | 8 +++-----
.../social_share/views/facebook_share.html.php | 4 ++--
.../social_share/views/pinterest.html.php | 17 +++++++++--------
4 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/3.0/modules/social_share/controllers/admin_social_share.php b/3.0/modules/social_share/controllers/admin_social_share.php
index cf330fcc..3f247cff 100644
--- a/3.0/modules/social_share/controllers/admin_social_share.php
+++ b/3.0/modules/social_share/controllers/admin_social_share.php
@@ -27,6 +27,7 @@ class Admin_Social_Share_Controller extends Admin_Controller {
$form = $this->_get_form();
if ($form->validate()) {
+ module::set_var("social_share", "general_impage_only", $form->general_settings->general_impage_only->value);
module::set_var("social_share", "facebook_share_enabled", $form->facebook_share_settings->facebook_share_enabled->value);
module::set_var("social_share", "facebook_share_layout", $form->facebook_share_settings->facebook_share_layout->value);
module::set_var("social_share", "facebook_share_link_text", $form->facebook_share_settings->facebook_share_link_text->value);
@@ -69,7 +70,7 @@ class Admin_Social_Share_Controller extends Admin_Controller {
$group_general->checkbox("general_impage_only")->label(t("Display the enabled buttons on image and movie pages only"))
->checked(module::get_var("social_share", "general_impage_only", true) == 1);
-/// Facebook settings
+/// Facebook share settings
$group_facebook_share = $form->group("facebook_share_settings")->label(t("Facebook Share Button Settings"));
$group_facebook_share->checkbox("facebook_share_enabled")->label(t("Display the button"))
->checked(module::get_var("social_share", "facebook_share_enabled", false) == 1);
@@ -81,7 +82,8 @@ class Admin_Social_Share_Controller extends Admin_Controller {
->selected(module::get_var("social_share", "facebook_share_layout"));
$group_facebook_share->input("facebook_share_link_text")->label(t('Enter the text to place next to the Facebook icon.'))
->value(module::get_var("social_share", "facebook_share_link_text", "Share"));
-
+
+/// Facebook like settings
$group_facebook_like = $form->group("facebook_like_settings")->label(t("Facebook Like Button Settings"));
$group_facebook_like->checkbox("facebook_like_enabled")->label(t("Display the button"))
->checked(module::get_var("social_share", "facebook_like_enabled", false) == 1);
diff --git a/3.0/modules/social_share/views/facebook_like.html.php b/3.0/modules/social_share/views/facebook_like.html.php
index 5758472f..a2c28ad1 100644
--- a/3.0/modules/social_share/views/facebook_like.html.php
+++ b/3.0/modules/social_share/views/facebook_like.html.php
@@ -17,7 +17,6 @@ if (module::get_var("social_share", "facebook_like_send")) {
$send = "false";
}
?>
-
@@ -28,14 +27,13 @@ if (module::get_var("social_share", "facebook_like_send")) {
&show_faces== $show_faces ?>
&width=180
&locale== locales::cookie_locale(); ?>
-&action== $layout ?>
+&action== $action ?>
&colorscheme=light&height== $hite; ?>" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:180px; height:= $hite; ?>px;" allowTransparency="true">
\ No newline at end of file
diff --git a/3.0/modules/social_share/views/pinterest.html.php b/3.0/modules/social_share/views/pinterest.html.php
index 59d3d66f..8d40d42a 100644
--- a/3.0/modules/social_share/views/pinterest.html.php
+++ b/3.0/modules/social_share/views/pinterest.html.php
@@ -1,13 +1,14 @@
item()) {
+ $url = urlencode(url::abs_current(true));
$item = $theme->item();
- $media = $item->thumb_url(true);
+ $media = urlencode($item->thumb_url(true));
+ $description=urlencode($item->description);
?>
-
-">
-
-
+
\ No newline at end of file
From c70576ed61e770b1480ea251af092e6a445e5e7c Mon Sep 17 00:00:00 2001
From: Jason Hardin
Date: Sat, 1 Sep 2012 20:56:55 -0700
Subject: [PATCH 09/13] Fixing the x2po issues in google.
---
3.0/modules/social_share/views/google.html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/3.0/modules/social_share/views/google.html.php b/3.0/modules/social_share/views/google.html.php
index f928a358..f6bb2642 100644
--- a/3.0/modules/social_share/views/google.html.php
+++ b/3.0/modules/social_share/views/google.html.php
@@ -11,7 +11,7 @@
(function() {
var po = document.createElement('script');
po.type = 'text/javascript';
- x2po.async = true;
+ po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
From b519a8fb1808190fdd58d3e718ccd29ea21530ee Mon Sep 17 00:00:00 2001
From: floridave
Date: Mon, 10 Sep 2012 18:04:55 -0600
Subject: [PATCH 10/13] Update 3.0/modules/author/helpers/author_block.php
Update so module will work with dynamic modules.
---
3.0/modules/author/helpers/author_block.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/3.0/modules/author/helpers/author_block.php b/3.0/modules/author/helpers/author_block.php
index 71f479e1..d7477055 100644
--- a/3.0/modules/author/helpers/author_block.php
+++ b/3.0/modules/author/helpers/author_block.php
@@ -24,6 +24,9 @@ class author_block_Core {
static function get($block_id, $theme) {
$item = $theme->item;
+ if (!$item) {
+ return;
+ }
if ($block_id != 'author' || $item->is_album() ) {
return '';
}
From 0e16587bc4be76e6653d4815255a30071357e773 Mon Sep 17 00:00:00 2001
From: floridave
Date: Thu, 13 Sep 2012 20:32:26 -0600
Subject: [PATCH 11/13] Update 3.0/modules/author/helpers/author_block.php
Rwatcher updated to work with recent versions.
---
3.0/modules/author/helpers/author_block.php | 46 ++++++++++++---------
1 file changed, 26 insertions(+), 20 deletions(-)
diff --git a/3.0/modules/author/helpers/author_block.php b/3.0/modules/author/helpers/author_block.php
index d7477055..bae1139a 100644
--- a/3.0/modules/author/helpers/author_block.php
+++ b/3.0/modules/author/helpers/author_block.php
@@ -23,29 +23,35 @@ class author_block_Core {
}
static function get($block_id, $theme) {
+ $block = "";
+
$item = $theme->item;
- if (!$item) {
- return;
+
+ if ((!isset($theme->item)) || ($item->is_album())) {
+ return;
}
- if ($block_id != 'author' || $item->is_album() ) {
- return '';
+
+ switch ($block_id) {
+ case "author":
+ $record = ORM::factory("author_record")->where("item_id", "=", $item->id)->find();
+
+ $byline = "";
+ if ($record->loaded()) {
+ $byline = $record->author;
+ }
+
+ if ($byline == '') {
+ $byline = author::fix($item);
+ }
+
+ $block = new Block();
+ $block->css_id = "g-author";
+ $block->content = new View("author_block.html");
+ $block->content->author = $byline;
+
+ break;
}
- $record = db::build()
- ->select("author")
- ->from("author_records")
- ->where("item_id", "=", $item->id)
- ->execute()
- ->current();
-
- $byline = $record->author;
- if ($byline == '') {
- $byline = author::fix($item);
- }
-
- $block = new Block();
- $block->content = new View("author_block.html");
- $block->content->author = $byline;
-
return $block;
+
}
}
From d32f9cb53e90a4961f359cc8ebd64c56bc1497a6 Mon Sep 17 00:00:00 2001
From: Chris Chiappa
Date: Wed, 26 Sep 2012 16:01:14 -0400
Subject: [PATCH 12/13] Fix bad variable assignment & some typos
---
.../carousel/controllers/admin_carousel.php | 14 +++++++-------
3.0/modules/carousel/views/admin_carousel.html.php | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/3.0/modules/carousel/controllers/admin_carousel.php b/3.0/modules/carousel/controllers/admin_carousel.php
index 0852ec3f..7740f691 100644
--- a/3.0/modules/carousel/controllers/admin_carousel.php
+++ b/3.0/modules/carousel/controllers/admin_carousel.php
@@ -100,14 +100,14 @@ class Admin_Carousel_Controller extends Admin_Controller {
$shortrange["$key"] = sprintf("%.1f", (float)$i / 2);
}
if (module::get_var("carousel", "autoscroll") == true) {
- $disableme == "false";
+ $disableme = "false";
} else {
- $disableme == "true";
+ $disableme = "true";
}
$form = new Forge("admin/carousel/handler", "", "post", array("id" => "g-admin-form"));
$group = $form->group("carousel")->label(t("General carousel settings"));
- $group->checkbox("circular")->label(t('Enable the carousel to be circular so it starts over again from the beggining.'))
+ $group->checkbox("circular")->label(t('Enable the carousel to be circular so it starts over again from the beginning.'))
->checked(module::get_var("carousel", "circular", "0"));
$group->checkbox("autoscroll")->label(t('Carousel should auto scroll. Toggle value to change settings below.'))
->onClick("toggle()")
@@ -135,7 +135,7 @@ class Admin_Carousel_Controller extends Admin_Controller {
$group->dropdown("visible2")->label(t('Enter number of thumbs to show. (height of carousel)'))
->options($shortrange)
->selected(module::get_var("carousel", "visible2", "1"));
- $group->dropdown("quantity2")->label(t("Choose the toal quantity of thumbs in recent carousel."))
+ $group->dropdown("quantity2")->label(t("Choose the total quantity of thumbs in recent carousel."))
->options($range)
->selected(module::get_var("carousel", "quantity2", "25"));
$group->checkbox("onalbum2")->label(t("Show on album & collection pages"))
@@ -152,7 +152,7 @@ class Admin_Carousel_Controller extends Admin_Controller {
$group->dropdown("visible3")->label(t('Enter number of thumbs to show. (height of carousel)'))
->options($shortrange)
->selected(module::get_var("carousel", "visible3", "1"));
- $group->dropdown("quantity3")->label(t("Choose the toal quantity of thumbs in popular carousel."))
+ $group->dropdown("quantity3")->label(t("Choose the total quantity of thumbs in popular carousel."))
->options($range)
->selected(module::get_var("carousel", "quantity3", "25"));
$group->checkbox("onalbum3")->label(t("Show on album & collection pages"))
@@ -169,7 +169,7 @@ class Admin_Carousel_Controller extends Admin_Controller {
$group->dropdown("visible")->label(t('Enter number of thumbs to show. (height of carousel)'))
->options($shortrange)
->selected(module::get_var("carousel", "visible", "1"));
- $group->dropdown("quantity")->label(t("Choose the toal quantity of thumbs in random carousel."))
+ $group->dropdown("quantity")->label(t("Choose the total quantity of thumbs in random carousel."))
->options($range)
->selected(module::get_var("carousel", "quantity", "25"));
$group->checkbox("onalbum")->label(t("Show on album & collection pages"))
@@ -180,4 +180,4 @@ class Admin_Carousel_Controller extends Admin_Controller {
$form->submit("submit")->value(t("Save"));
return $form;
}
-}
\ No newline at end of file
+}
diff --git a/3.0/modules/carousel/views/admin_carousel.html.php b/3.0/modules/carousel/views/admin_carousel.html.php
index 8c3197e2..7fe533e4 100644
--- a/3.0/modules/carousel/views/admin_carousel.html.php
+++ b/3.0/modules/carousel/views/admin_carousel.html.php
@@ -18,6 +18,6 @@ window.onload=toggle;
= t("Notes:") ?>
= t("Navigation buttons are hard to style and clutter the user interface.
- Use mouse wheel to scroll thought the images.") ?>
+ Use mouse wheel to scroll through the images.") ?>
From afd6a99580376bf7530c56102c24426626eea4de Mon Sep 17 00:00:00 2001
From: Chris Chiappa
Date: Thu, 27 Sep 2012 22:21:00 -0400
Subject: [PATCH 13/13] Update per Bharat's request
---
3.0/modules/carousel/views/admin_carousel.html.php | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/3.0/modules/carousel/views/admin_carousel.html.php b/3.0/modules/carousel/views/admin_carousel.html.php
index 7fe533e4..775a088d 100644
--- a/3.0/modules/carousel/views/admin_carousel.html.php
+++ b/3.0/modules/carousel/views/admin_carousel.html.php
@@ -17,7 +17,10 @@ window.onload=toggle;
= t("Notes:") ?>
-
= t("Navigation buttons are hard to style and clutter the user interface.
- Use mouse wheel to scroll through the images.") ?>
+
+ = t("Navigation buttons are hard to style and clutter the user interface.") ?>
+
+ = t("Use mouse wheel to scroll through the images.") ?>
+