1
0

Merge pull request #2 from gallery/master

Retrofit gallery/gallery3-contrib into mikemayer67/gallery3-contrib (master)
This commit is contained in:
Mike Mayer 2012-10-18 22:37:42 -07:00
commit b0c2a60c8c
23 changed files with 290 additions and 213 deletions

View File

@ -23,26 +23,35 @@ class author_block_Core {
} }
static function get($block_id, $theme) { static function get($block_id, $theme) {
$block = "";
$item = $theme->item; $item = $theme->item;
if ($block_id != 'author' || $item->is_album() ) {
return '';
}
$record = db::build()
->select("author")
->from("author_records")
->where("item_id", "=", $item->id)
->execute()
->current();
$byline = $record->author; if ((!isset($theme->item)) || ($item->is_album())) {
if ($byline == '') { return;
$byline = author::fix($item);
} }
$block = new Block(); switch ($block_id) {
$block->content = new View("author_block.html"); case "author":
$block->content->author = $byline; $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;
}
return $block; return $block;
} }
} }

View File

@ -100,14 +100,14 @@ class Admin_Carousel_Controller extends Admin_Controller {
$shortrange["$key"] = sprintf("%.1f", (float)$i / 2); $shortrange["$key"] = sprintf("%.1f", (float)$i / 2);
} }
if (module::get_var("carousel", "autoscroll") == true) { if (module::get_var("carousel", "autoscroll") == true) {
$disableme == "false"; $disableme = "false";
} else { } else {
$disableme == "true"; $disableme = "true";
} }
$form = new Forge("admin/carousel/handler", "", "post", array("id" => "g-admin-form")); $form = new Forge("admin/carousel/handler", "", "post", array("id" => "g-admin-form"));
$group = $form->group("carousel")->label(t("General carousel settings")); $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")); ->checked(module::get_var("carousel", "circular", "0"));
$group->checkbox("autoscroll")->label(t('Carousel should auto scroll. Toggle value to change settings below.')) $group->checkbox("autoscroll")->label(t('Carousel should auto scroll. Toggle value to change settings below.'))
->onClick("toggle()") ->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)')) $group->dropdown("visible2")->label(t('Enter number of thumbs to show. (height of carousel)'))
->options($shortrange) ->options($shortrange)
->selected(module::get_var("carousel", "visible2", "1")); ->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) ->options($range)
->selected(module::get_var("carousel", "quantity2", "25")); ->selected(module::get_var("carousel", "quantity2", "25"));
$group->checkbox("onalbum2")->label(t("Show on album & collection pages")) $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)')) $group->dropdown("visible3")->label(t('Enter number of thumbs to show. (height of carousel)'))
->options($shortrange) ->options($shortrange)
->selected(module::get_var("carousel", "visible3", "1")); ->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) ->options($range)
->selected(module::get_var("carousel", "quantity3", "25")); ->selected(module::get_var("carousel", "quantity3", "25"));
$group->checkbox("onalbum3")->label(t("Show on album & collection pages")) $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)')) $group->dropdown("visible")->label(t('Enter number of thumbs to show. (height of carousel)'))
->options($shortrange) ->options($shortrange)
->selected(module::get_var("carousel", "visible", "1")); ->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) ->options($range)
->selected(module::get_var("carousel", "quantity", "25")); ->selected(module::get_var("carousel", "quantity", "25"));
$group->checkbox("onalbum")->label(t("Show on album & collection pages")) $group->checkbox("onalbum")->label(t("Show on album & collection pages"))

View File

@ -17,7 +17,10 @@ window.onload=toggle;
<div class="g-block"> <div class="g-block">
<hr /> <hr />
<h3><?= t("Notes:") ?></h3> <h3><?= t("Notes:") ?></h3>
<p><?= t("Navigation buttons are hard to style and clutter the user interface.<br /> <p>
Use mouse wheel to scroll thought the images.") ?></p> <?= t("Navigation buttons are hard to style and clutter the user interface.") ?>
<br />
<?= t("Use mouse wheel to scroll through the images.") ?>
</p>
</div> </div>
</div> </div>

View File

@ -27,6 +27,7 @@ class Admin_Social_Share_Controller extends Admin_Controller {
$form = $this->_get_form(); $form = $this->_get_form();
if ($form->validate()) { 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_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_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); module::set_var("social_share", "facebook_share_link_text", $form->facebook_share_settings->facebook_share_link_text->value);
@ -42,6 +43,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_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_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", "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_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_count_location", $form->twitter_settings->twitter_count_location->value);
module::set_var("social_share", "twitter_size", $form->twitter_settings->twitter_size->value); module::set_var("social_share", "twitter_size", $form->twitter_settings->twitter_size->value);
@ -62,6 +65,12 @@ class Admin_Social_Share_Controller extends Admin_Controller {
private function _get_form() { private function _get_form() {
$form = new Forge("admin/social_share/handler", "", "post", array("id" => "g-admin-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 share settings
$group_facebook_share = $form->group("facebook_share_settings")->label(t("Facebook Share Button 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")) $group_facebook_share->checkbox("facebook_share_enabled")->label(t("Display the button"))
->checked(module::get_var("social_share", "facebook_share_enabled", false) == 1); ->checked(module::get_var("social_share", "facebook_share_enabled", false) == 1);
@ -74,6 +83,7 @@ class Admin_Social_Share_Controller extends Admin_Controller {
$group_facebook_share->input("facebook_share_link_text")->label(t('Enter the text to place next to the Facebook icon.')) $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")); ->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 = $form->group("facebook_like_settings")->label(t("Facebook Like Button Settings"));
$group_facebook_like->checkbox("facebook_like_enabled")->label(t("Display the button")) $group_facebook_like->checkbox("facebook_like_enabled")->label(t("Display the button"))
->checked(module::get_var("social_share", "facebook_like_enabled", false) == 1); ->checked(module::get_var("social_share", "facebook_like_enabled", false) == 1);
@ -108,6 +118,7 @@ class Admin_Social_Share_Controller extends Admin_Controller {
"box_count" => t("Box count"))) "box_count" => t("Box count")))
->selected(module::get_var("social_share", "facebook_like_layout")); ->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 = $form->group("google_settings")->label(t("Google+ +1 Button Settings"));
$group_google->checkbox("google_enabled")->label(t("Display the button")) $group_google->checkbox("google_enabled")->label(t("Display the button"))
->checked(module::get_var("social_share", "google_enabled", false) == 1); ->checked(module::get_var("social_share", "google_enabled", false) == 1);
@ -125,6 +136,18 @@ class Admin_Social_Share_Controller extends Admin_Controller {
"none" => t("None"))) "none" => t("None")))
->selected(module::get_var("social_share", "google_annotation")); ->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 = $form->group("twitter_settings")->label(t("Twitter Tweet Settings"));
$group_twitter->checkbox("twitter_enabled")->label(t("Display the button")) $group_twitter->checkbox("twitter_enabled")->label(t("Display the button"))
->checked(module::get_var("social_share", "twitter_enabled", false) == 1); ->checked(module::get_var("social_share", "twitter_enabled", false) == 1);

View File

@ -18,30 +18,37 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
class social_share_block_Core { class social_share_block_Core {
static function get_site_list() { static function get_site_list() {
return array( return array("social_share" => t("Social Share"));
"social_share" => t("Social Share")); }
}
static function get($block_id, $theme) { 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"));
$block = new Block(); if ($showblock){
$block->css_id = "g-social-share"; $block = new Block();
$block->title = 'Share With Friends'; $block->css_id = "g-social-share";
$block->content = ''; $block->title = 'Share With Friends';
if(module::get_var("social_share", "facebook_share_enabled")){ $block->content = '';
$block->content .= new View("facebook_share.html"); 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", "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", "google_enabled")){
} $block->content .= new View("google.html");
if(module::get_var("social_share", "twitter_enabled")){ }
$block->content .= new View("twitter.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; return $block;
} }
}
} }

View File

@ -18,39 +18,46 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
class social_share_installer { class social_share_installer {
static function deactivate() { static function deactivate() {
module::clear_var("social_share", "facebook_share_enabled"); module::clear_var("social_share", "general_impage_only");
module::clear_var("social_share", "facebook_share_layout"); module::clear_var("social_share", "facebook_share_enabled");
module::clear_var("social_share", "facebook_share_link_text"); module::clear_var("social_share", "facebook_share_layout");
module::clear_var("social_share", "facebook_like_enabled"); module::clear_var("social_share", "facebook_share_link_text");
module::clear_var("social_share", "facebook_like_appId"); module::clear_var("social_share", "facebook_like_enabled");
module::clear_var("social_share", "facebook_like_adminId"); module::clear_var("social_share", "facebook_like_appId");
module::clear_var("social_share", "facebook_like_site_name"); module::clear_var("social_share", "facebook_like_adminId");
module::clear_var("social_share", "facebook_like_code_type"); module::clear_var("social_share", "facebook_like_site_name");
module::clear_var("social_share", "facebook_like_show_faces"); module::clear_var("social_share", "facebook_like_code_type");
module::clear_var("social_share", "facebook_like_send"); module::clear_var("social_share", "facebook_like_show_faces");
module::clear_var("social_share", "facebook_like_action"); module::clear_var("social_share", "facebook_like_send");
module::clear_var("social_share", "facebook_like_layout"); module::clear_var("social_share", "facebook_like_action");
module::clear_var("social_share", "google_enabled"); module::clear_var("social_share", "facebook_like_layout");
module::clear_var("social_share", "google_size"); module::clear_var("social_share", "google_enabled");
module::clear_var("social_share", "google_annotation"); module::clear_var("social_share", "google_size");
module::clear_var("social_share", "twitter_enabled"); module::clear_var("social_share", "google_annotation");
module::clear_var("social_share", "twitter_count_location"); module::clear_var("social_share", "pinterest_enabled");
module::clear_var("social_share", "twitter_size"); module::clear_var("social_share", "pinterest_count_location");
} module::clear_var("social_share", "twitter_enabled");
static function upgrade($version) { module::clear_var("social_share", "twitter_count_location");
if ($version < 1) { module::clear_var("social_share", "twitter_size");
module::set_version("social_share", $version = 1);
} }
static function upgrade($version) {
if ($version < 1) {
module::set_version("social_share", $version = 1);
}
if ($version < 2) { if ($version < 2) {
module::set_var("social_share", "facebook_share_enabled", module::get_var("social_share", "facebook")); module::set_var("social_share", "facebook_share_enabled", module::get_var("social_share", "facebook"));
module::clear_var("social_share", "facebook"); module::clear_var("social_share", "facebook");
module::set_var("social_share", "google_enabled", module::get_var("social_share", "google")); module::set_var("social_share", "google_enabled", module::get_var("social_share", "google"));
module::clear_var("social_share", "google"); module::clear_var("social_share", "google");
module::set_var("social_share", "twitter_enabled", module::get_var("social_share", "twitter")); module::set_var("social_share", "twitter_enabled", module::get_var("social_share", "twitter"));
module::clear_var("social_share", "twitter"); module::clear_var("social_share", "twitter");
module::set_version("social_share", $version = 2); module::set_version("social_share", $version = 2);
}
if ($version < 3) {
module::set_version("social_share", $version = 3);
}
} }
}
} }

View File

@ -18,21 +18,24 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
class social_share_theme_Core { class social_share_theme_Core {
static function head($theme) { static function head($theme) {
if ($theme->item()) { $impageonly = module::get_var("social_share", "general_impage_only");
$item = $theme->item(); $showblock = !$impageonly || ($impageonly && ($theme->page_subtype == "photo") || ($theme->page_subtype == "movie"));
$url = $item->thumb_url(true);
$appId = module::get_var("social_share", "facebook_like_appId"); if ($showblock && $theme->item()) {
$adminId = module::get_var("social_share", "facebook_like_adminId"); $item = $theme->item();
$site_name = module::get_var("social_share", "facebook_like_site_name"); $url = $item->thumb_url(true);
$selfURL = url::abs_current(true); $appId = module::get_var("social_share", "facebook_like_appId");
return "\t<meta property=\"og:image\" content=\"$url\"/> $adminId = module::get_var("social_share", "facebook_like_adminId");
<meta property=\"og:title\" content=\"$item->title\"/> $site_name = module::get_var("social_share", "facebook_like_site_name");
<meta property=\"og:type\" content=\"article\"/> $selfURL = url::abs_current(true);
<meta property=\"og:url\" content=\"$selfURL\"/> return "\t<meta property=\"og:image\" content=\"$url\"/>
<meta property=\"og:site_name\" content=\"$site_name\"/> <meta property=\"og:title\" content=\"$item->title\"/>
<meta property=\"fb:app_id\" content=\"$appId\"/> <meta property=\"og:type\" content=\"article\"/>
<meta property=\"fb:admins\" content=\"$adminId\"/>"; <meta property=\"og:url\" content=\"$selfURL\"/>
} <meta property=\"og:site_name\" content=\"$site_name\"/>
} <meta property=\"fb:app_id\" content=\"$appId\"/>
<meta property=\"fb:admins\" content=\"$adminId\"/>";
}
}
} }

View File

@ -1,6 +1,6 @@
name = "Social Share" name = "Social Share"
description = "Adds links to share the page to social media sites in the sidebar." description = "Adds links to share the page to social media sites in the sidebar."
version = 2 version = 3
author_name = "jasonhardin" author_name = "jasonhardin"
author_url = "http://codex.gallery2.org/User:psychoph" author_url = "http://codex.gallery2.org/User:psychoph"
info_url = "http://codex.gallery2.org/Gallery3:Modules:social_share" info_url = "http://codex.gallery2.org/Gallery3:Modules:social_share"

View File

@ -17,7 +17,6 @@ if (module::get_var("social_share", "facebook_like_send")) {
$send = "false"; $send = "false";
} }
?> ?>
<div class="g-social_share-facebook_like"> <div class="g-social_share-facebook_like">
<?php if ($codeType == 'iframe'){ ?> <?php if ($codeType == 'iframe'){ ?>
@ -28,14 +27,13 @@ if (module::get_var("social_share", "facebook_like_send")) {
&amp;show_faces=<?= $show_faces ?> &amp;show_faces=<?= $show_faces ?>
&amp;width=180 &amp;width=180
&amp;locale=<?= locales::cookie_locale(); ?> &amp;locale=<?= locales::cookie_locale(); ?>
&amp;action=<?= $layout ?> &amp;action=<?= $action ?>
&amp;colorscheme=light&amp;height=<?= $hite; ?>" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:180px; height:<?= $hite; ?>px;" allowTransparency="true"> &amp;colorscheme=light&amp;height=<?= $hite; ?>" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:180px; height:<?= $hite; ?>px;" allowTransparency="true">
</iframe> </iframe>
<?php } else { ?> <?php } else { ?>
<div id="fb-root"></div> <div id="fb-root"></div>
<script>(function(d, s, id) { <script>(function(d, s, id) {
window.FB = null;FB=null;// this is needed for the facebook share button being on.
var js, fjs = d.getElementsByTagName(s)[0]; var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return; if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id; js = d.createElement(s); js.id = id;
@ -45,12 +43,11 @@ if (module::get_var("social_share", "facebook_like_send")) {
<?php if($codeType == 'xfbml'){?> <?php if($codeType == 'xfbml'){?>
<fb:like href="<?= $selfURL; ?>" send="<?= $send ?>" width="180" show_faces="<?= $show_faces ?>" layout="<?= $layout?>" action="<?= $layout ?>"></fb:like> <fb:like href="<?= $selfURL; ?>" send="<?= $send ?>" width="180" show_faces="<?= $show_faces ?>" layout="<?= $layout?>" action="<?= $action ?>"></fb:like>
<fb:like href="http://test.com" send="true" width="180" show_faces="false"></fb:like>
<?php } else { ?> <?php } else { ?>
<div class="fb-like" data-href="<?= $selfURL; ?>" data-send="<?= $send ?>" data-layout="<?= $layout?>" data-width="180" data-show-faces="<?= $show_faces ?>" data-action="<?= $layout ?>"></div> <div class="fb-like" data-href="<?= $selfURL; ?>" data-send="<?= $send ?>" data-layout="<?= $layout?>" data-width="180" data-show-faces="<?= $show_faces ?>" data-action="<?= $action ?>"></div>
<?php } <?php }
} }

View File

@ -1,5 +1,5 @@
<?php defined("SYSPATH") or die("No direct script access.") ?> <?php defined("SYSPATH") or die("No direct script access.")?>
<div class="g-social_share-facebook_share"> <div class="g-social_share-facebook_share">
<a id="facebookicon" name="fb_share" type="<?= module::get_var("social_share", "facebook_share_layout") ?>"><?= module::get_var("social_share", "facebook_share_link_text") ?></a> <a id="facebookicon" name="fb_share" type="<?= module::get_var("social_share", "facebook_share_layout") ?>"></a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
</div> </div>

View File

@ -11,7 +11,7 @@
(function() { (function() {
var po = document.createElement('script'); var po = document.createElement('script');
po.type = 'text/javascript'; po.type = 'text/javascript';
x2po.async = true; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js'; po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})(); })();

View File

@ -0,0 +1,14 @@
<?php defined("SYSPATH") or die("No direct script access.");
if ($theme->item()) {
$url = urlencode(url::abs_current(true));
$item = $theme->item();
$media = urlencode($item->thumb_url(true));
$description=urlencode($item->description);
?>
<div class="g-social_share-pinterest_pinit">
<a href="http://pinterest.com/pin/create/button/?url=<?= $url; ?>&media=<?= $media; ?>&description=<?= $description; ?>" class="pin-it-button" count-layout="<?= module::get_var("social_share", "pinterest_count_location") ?>">
<img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" />
</a>
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
</div>
<?php } ?>

View File

@ -1,4 +1,5 @@
<?php defined("SYSPATH") or die("No direct script access.") ?> <?php defined("SYSPATH") or die("No direct script access.") ?>
<?php header("X-Frame-Options: SAMEORIGIN"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?= $theme->html_attributes() ?> xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" <?= $theme->html_attributes() ?> xml:lang="en" lang="en">
@ -10,11 +11,11 @@
<?= $page_title ?> <?= $page_title ?>
<? else: ?> <? else: ?>
<? if ($theme->item()): ?> <? if ($theme->item()): ?>
<?= $theme->item()->title ?> <?= html::purify($theme->item()->title) ?>
<? elseif ($theme->tag()): ?> <? elseif ($theme->tag()): ?>
<?= t("Photos tagged with %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! */ ?> <? else: /* Not an item, not a tag, no page_title specified. Help! */ ?>
<?= item::root()->title ?> <?= html::purify(item::root()->title) ?>
<? endif ?> <? endif ?>
<? endif ?> <? endif ?>
</title> </title>
@ -24,7 +25,7 @@
<link rel="apple-touch-icon-precomposed" <link rel="apple-touch-icon-precomposed"
href="<?= url::file(module::get_var("gallery", "apple_touch_icon_url")) ?>" /> href="<?= url::file(module::get_var("gallery", "apple_touch_icon_url")) ?>" />
<? if ($theme->page_type == "collection"): ?> <? 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_width = round($thumb_proportion * 213) ?>
<? $new_height = round($thumb_proportion * 240) ?> <? $new_height = round($thumb_proportion * 240) ?>
<style type="text/css"> <style type="text/css">
@ -92,7 +93,7 @@
<?= $header_text ?> <?= $header_text ?>
<? else: ?> <? else: ?>
<a id="g-logo" class="g-left" href="<?= item::root()->url() ?>" title="<?= t("go back to the Gallery home")->for_html_attr() ?>"> <a id="g-logo" class="g-left" href="<?= item::root()->url() ?>" title="<?= t("go back to the Gallery home")->for_html_attr() ?>">
<img alt="<?= t("Gallery logo: Your photos on your web site")->for_html_attr() ?>" src="<?= url::file("lib/images/logo.png") ?>" /> <img width="107" height="48" alt="<?= t("Gallery logo: Your photos on your web site")->for_html_attr() ?>" src="<?= url::file("lib/images/logo.png") ?>" />
</a> </a>
<? endif ?> <? endif ?>
<?= $theme->user_menu() ?> <?= $theme->user_menu() ?>
@ -107,28 +108,16 @@
<?= $theme->header_bottom() ?> <?= $theme->header_bottom() ?>
</div> </div>
<? if ($theme->item() && !empty($parents)): ?> <? if (!empty($breadcrumbs)): ?>
<ul class="g-breadcrumbs"> <ul class="g-breadcrumbs">
<? $i = 0 ?> <? foreach ($breadcrumbs as $breadcrumb): ?>
<? foreach ($parents as $parent): ?> <li class="<?= $breadcrumb->last ? "g-active" : "" ?>
<li<? if ($i == 0) print " class=\"g-first\"" ?>> <?= $breadcrumb->first ? "g-first" : "" ?>">
<? // Adding ?show=<id> causes Gallery3 to display the page <? if (!$breadcrumb->last): ?> <a href="<?= $breadcrumb->url ?>"><? endif ?>
// containing that photo. For now, we just do it for <?= html::purify(text::limit_chars($breadcrumb->title, module::get_var("gallery", "visible_title_length"))) ?>
// the immediate parent so that when you go back up a <? if (!$breadcrumb->last): ?></a><? endif ?>
// level you're on the right page. ?> </li>
<a href="<?= $parent->url($parent->id == $theme->item()->parent_id ?
"show={$theme->item()->id}" : null) ?>">
<? // limit the title length to something reasonable (defaults to 15) ?>
<?= html::purify(text::limit_chars($parent->title,
module::get_var("gallery", "visible_title_length"))) ?>
</a>
</li>
<? $i++ ?>
<? endforeach ?> <? endforeach ?>
<li class="g-active<? if ($i == 0) print " g-first" ?>">
<?= html::purify(text::limit_chars($theme->item()->title,
module::get_var("gallery", "visible_title_length"))) ?>
</li>
</ul> </ul>
<? endif ?> <? endif ?>
</div> </div>

View File

@ -84,7 +84,7 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
->value(module::get_var("gallery", "appletouchicon_url")); ->value(module::get_var("gallery", "appletouchicon_url"));
$group->input("logo_path") $group->input("logo_path")
->label(t("URL (relative path) to custom logo")) ->label(t("URL (relative path) to custom logo"))
->value(module::get_var("gallery", "logo_path")); ->value(module::get_var("th_pear4gallery3", "logo_path"));
$group->input("slideshow_time") $group->input("slideshow_time")
->label(t("Slideshow timeout (in ms)")) ->label(t("Slideshow timeout (in ms)"))
->value(module::get_var("th_pear4gallery3", "slideshow_time", "5000")); ->value(module::get_var("th_pear4gallery3", "slideshow_time", "5000"));
@ -120,7 +120,7 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
->label(t("<a href=\"http://www.google.com/analytics/\">Google analytics</a> code.")) ->label(t("<a href=\"http://www.google.com/analytics/\">Google analytics</a> code."))
->value(module::get_var("th_pear4gallery3", "ga_code")); ->value(module::get_var("th_pear4gallery3", "ga_code"));
$group->input("skimm_lim") $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")); ->value(module::get_var("th_pear4gallery3", "skimm_lim", "50"));
/* Advanced Options - Mosaic page ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ /* Advanced Options - Mosaic page ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
@ -140,6 +140,13 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
"scale" => t("Shrink and grow an element"), "scale" => t("Shrink and grow an element"),
"none" => t("Disable effects (faster switching)"))) "none" => t("Disable effects (faster switching)")))
->selected(module::get_var("th_pear4gallery3", "mosaic_effect", "blind")); ->selected(module::get_var("th_pear4gallery3", "mosaic_effect", "blind"));
/* Advanced Options - Photo settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
$group = $form->group("edit_theme_adv_photo")->label(t("Advanced Options - Photo settings"));
$group->input("resize_size")
->label(t("Photo resize size (800 is default)"))
->value(module::get_var("gallery", "resize_size", "800"));
/* /*
$group->dropdown("photo_descmode") $group->dropdown("photo_descmode")
->label(t("Description Display Mode")) ->label(t("Description Display Mode"))
@ -258,8 +265,10 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
message::success(t("Theme details are reset")); message::success(t("Theme details are reset"));
else: else:
// * General Settings **************************************************** // * General Settings ****************************************************
$old_resize_size = module::get_var("gallery", "resize_size", 800);
module::set_var("gallery", "resize_size", filter_var($form->edit_theme_adv_photo->resize_size->value, FILTER_VALIDATE_INT, array('options' => array('default' => 800, 'min_range' => 640))));
$resize_size = 800; $resize_size = module::get_var("gallery", "resize_size", 800);
$build_resize = $form->maintenance->build_resize->value; $build_resize = $form->maintenance->build_resize->value;
$build_thumbs = $form->maintenance->build_thumbs->value; $build_thumbs = $form->maintenance->build_thumbs->value;
@ -271,7 +280,7 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
endif; endif;
$purge_cache = $form->maintenance->purge_cache->value; $purge_cache = $form->maintenance->purge_cache->value;
if ($build_resize): if ($build_resize || $old_resize_size != $resize_size):
graphics::remove_rule("gallery", "resize", "gallery_graphics::resize"); graphics::remove_rule("gallery", "resize", "gallery_graphics::resize");
graphics::add_rule("gallery", "resize", "gallery_graphics::resize", graphics::add_rule("gallery", "resize", "gallery_graphics::resize",
array("width" => $resize_size, "height" => $resize_size, "master" => Image::AUTO), 100); array("width" => $resize_size, "height" => $resize_size, "master" => Image::AUTO), 100);
@ -297,7 +306,7 @@ class Admin_Theme_Options_Controller extends Admin_Controller {
module::set_var("gallery", "page_size", 50); module::set_var("gallery", "page_size", 50);
module::set_var("gallery", "favicon_url", $form->edit_theme->favicon->value); module::set_var("gallery", "favicon_url", $form->edit_theme->favicon->value);
module::set_var("gallery", "appletouchicon_url", $form->edit_theme->appletouchicon->value); module::set_var("gallery", "appletouchicon_url", $form->edit_theme->appletouchicon->value);
module::set_var("gallery", "logo_path", $form->edit_theme->logo_path->value); $this->save_item_state("logo_path", $form->edit_theme->logo_path->value, $form->edit_theme->logo_path->value);
$this->save_item_state("slideshow_time", $form->edit_theme->slideshow_time->value != 5000, filter_var($form->edit_theme->slideshow_time->value, FILTER_VALIDATE_INT, array('options' => array('default' => 5000, 'min_range' => 1000)))); $this->save_item_state("slideshow_time", $form->edit_theme->slideshow_time->value != 5000, filter_var($form->edit_theme->slideshow_time->value, FILTER_VALIDATE_INT, array('options' => array('default' => 5000, 'min_range' => 1000))));

View File

@ -24,7 +24,8 @@ class Pear_Controller extends Controller {
if(module::is_active("facebook_comment")) { if(module::is_active("facebook_comment")) {
$v = new Theme_View("facebook_comment.html", "other", "comment-fragment"); $v = new Theme_View("facebook_comment.html", "other", "comment-fragment");
$v->url = $item->url(); $v->url = $item->abs_url();
$v->title = $item->title;
print $v; print $v;
} else { } else {
$comments = ORM::factory("comment") $comments = ORM::factory("comment")
@ -42,7 +43,7 @@ class Pear_Controller extends Controller {
public function about($id){ public function about($id){
$item = ORM::factory("item", $id); $item = ORM::factory("item", $id);
access::required("view", $item); access::required("view", $item);
$v = new Theme_View("about.html"); $v = new Theme_View("about.html","","");
$v->item = $item; $v->item = $item;
$details = array(array("caption" => "Title", "value" => $item->title)); $details = array(array("caption" => "Title", "value" => $item->title));
if ( $item->description != $item->title) { if ( $item->description != $item->title) {

View File

@ -85,7 +85,7 @@ h2 {
position: fixed; position: fixed;
top: 44px; top: 44px;
width: 100%; width: 100%;
z-index: 50; z-index: 150;
} }
/*Menu*/ /*Menu*/
.sf-menu li:hover, .sf-menu li.sfHover, .sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active { .sf-menu li:hover, .sf-menu li.sfHover, .sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
@ -161,12 +161,11 @@ outline: medium none;
#mosaicTable { #mosaicTable {
position: fixed; position: fixed;
top: 45px;
bottom: 40px; bottom: 40px;
overflow: hidden; overflow: hidden;
left: 0; left: 0;
right: 0; right: 0;
margin-top: 5px; margin: 0;
} }
#mosaicDetail { #mosaicDetail {
@ -181,6 +180,7 @@ outline: medium none;
margin: 0 auto; margin: 0 auto;
width: 100%; width: 100%;
position: absolute; position: absolute;
padding: 5px 0;
} }
#mosaicImg { #mosaicImg {
@ -204,6 +204,7 @@ outline: medium none;
} }
#sidebarContainer { #sidebarContainer {
width: 221px;
position: fixed; position: fixed;
right: 0; right: 0;
overflow: none; overflow: none;
@ -212,8 +213,8 @@ outline: medium none;
} }
#toggleSidebar { #toggleSidebar {
position: absolute; position: absolute;
z-index: 1; z-index: 101;
top: 2px; top: 1px;
left: -18px; left: -18px;
} }
@ -313,7 +314,7 @@ bottom: 0;
#logoButton { #logoButton {
display: block; display: block;
z-index: 100; z-index: 100;
background: transparent url('../icons/pear_logo_sml.png') no-repeat center center; background: transparent no-repeat center center;
width: 40px; width: 40px;
height: 40px; height: 40px;
border: 0; border: 0;

View File

@ -9,6 +9,7 @@ var pear = {defaultView: "grid",
slideshowTimeout: 5000, slideshowTimeout: 5000,
currentImg: 0, currentImg: 0,
hovering: false, hovering: false,
redirected: false,
mosaicEffect: "" }; mosaicEffect: "" };
function thumbPadding() { function thumbPadding() {
@ -49,6 +50,9 @@ function scaleIt(v, sliding) {
} }
function thumbLoad(index) { function thumbLoad(index) {
//Reindex the slideshowImages array.
slideshowImages = slideshowImages.filter(function (i) { return i != undefined});
//Load non skimming thumbs //Load non skimming thumbs
$('.g-thumbnail').each( function() { $(this).attr('src', thumbImages[$(this).attr('id')]); }); $('.g-thumbnail').each( function() { $(this).attr('src', thumbImages[$(this).attr('id')]); });
//Load skimming thumbs //Load skimming thumbs
@ -57,7 +61,12 @@ function thumbLoad(index) {
//Re-initiate all fancyness. //Re-initiate all fancyness.
if (pear.currentView === 'mosaic') { $('p.giTitle,div.giInfo').hide(); } else { $('p.giTitle,div.giInfo').show(); } if (pear.currentView === 'mosaic') { $('p.giTitle,div.giInfo').hide(); } else { $('p.giTitle,div.giInfo').show(); }
scaleIt($('#imgSlider').slider('value')); scaleIt($('#imgSlider').slider('value'));
$('.g-item:not(.g-hover-item)').each(function (index) { $(this).unbind('click'); if ($(this).is('.g-photo')) { $(this).click(function () { if (pear.currentView === 'mosaic') { swatchImg(index); } else { focusImage(index); } }); }}); $('.g-photo:not(.g-hover-item)').each(function (index) {
$(this).unbind('click');
$(this).click(function () {
if (pear.currentView === 'mosaic') { swatchImg(index); }
else { focusImage(index); } });
});
// Apply jQuery UI icon and hover styles to context menus // Apply jQuery UI icon and hover styles to context menus
if ($(".g-context-menu").length) { if ($(".g-context-menu").length) {
$(".g-context-menu li").addClass("ui-state-default"); $(".g-context-menu li").addClass("ui-state-default");
@ -192,6 +201,7 @@ function mosaicResize() {
myHeight = myHeight - $('#g-site-status').outerHeight(true) - $('#paginator').outerHeight(true); myHeight = myHeight - $('#g-site-status').outerHeight(true) - $('#paginator').outerHeight(true);
myHeight -= 138; myHeight -= 138;
$('#g-header').css('top', $('#gsNavBar').outerHeight(true) + $('#g-site-status').outerHeight(true) - 4); $('#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) + $('#g-action-status').outerHeight(true) - 2 );
if ($('#g-movie').length) { if ($('#g-movie').length) {
myHeight += 18; myHeight += 18;
@ -308,6 +318,8 @@ function swatchImg(imageId) {
} }
pear.currentImg = imageId; pear.currentImg = imageId;
//Image count.
if (!pear.redirected) { $.get(slideshowImages[pear.currentImg][6]); pear.redirected = false;}
if (pear.currentView === 'mosaic') { if (pear.currentView === 'mosaic') {
$('#imageTitle').each(function (i) {$(this).html("<h2></h2>"); $(this).attr("savedH", $(this).height()); }); $('#imageTitle').each(function (i) {$(this).html("<h2></h2>"); $(this).attr("savedH", $(this).height()); });
@ -362,7 +374,7 @@ function showHoverView() {
pear.hideHoverViewHandler = setTimeout(hideHoverView, 3000); pear.hideHoverViewHandler = setTimeout(hideHoverView, 3000);
} }
function focusImage(id, redirected) { function focusImage(id) {
if (id < 0 || id >= slideshowImages.length) { if (id < 0 || id >= slideshowImages.length) {
if ( navigation.next !== '') { if ( navigation.next !== '') {
$.get(navigation.next,{ ajax: '1'},function (data) { $.get(navigation.next,{ ajax: '1'},function (data) {
@ -377,10 +389,9 @@ function focusImage(id, redirected) {
pear.detailView = true; pear.detailView = true;
swatchImg(id); swatchImg(id);
$('#play_detail,#pause_detail').addClass('hidden'); $('#play_detail,#pause_detail').addClass('hidden');
$('.g-block-content').hide();
$('#detailView').fadeIn('slow'); $('#detailView').fadeIn('slow');
showHoverView(); showHoverView();
//Image count.
//if (!redirected) { $.get(slideshowImages[pear.currentImg][6]); }
} }
function checkCookie() { function checkCookie() {
@ -440,6 +451,7 @@ function startSlideshow() {
slideShowMode = true; slideShowMode = true;
$('#play_detail').addClass('hidden'); $('#play_detail').addClass('hidden');
$('#pause_detail').removeClass('hidden'); $('#pause_detail').removeClass('hidden');
$('.g-block-content').hide();
$('#detailView').fadeIn('slow'); $('#detailView').fadeIn('slow');
showHoverView(); showHoverView();
pear.slideShowId = pear.currentImg; pear.slideShowId = pear.currentImg;
@ -510,6 +522,7 @@ function startImageFlow() {
function hideDetailView() { function hideDetailView() {
$('#detailView').hide(); $('#detailView').hide();
$('.g-block-content').show();
pear.slideShowMode = pear.detailView = false; pear.slideShowMode = pear.detailView = false;
if (pear.slideShowHandler !== null) { clearTimeout(pear.slideShowHandler); } if (pear.slideShowHandler !== null) { clearTimeout(pear.slideShowHandler); }
pear.slideShowHandler = null; pear.slideShowHandler = null;
@ -563,10 +576,11 @@ function pearInit(options) {
if (h.bgcolor !== undefined) { if (h.bgcolor !== undefined) {
pear.currentBg = h.bgcolor; pear.currentBg = h.bgcolor;
} }
pear.redirected = (h.redirected === 'true');
if (h.viewMode !== undefined) { if (h.viewMode !== undefined) {
if (h.viewMode === 'detail') { if (h.viewMode === 'detail') {
pear.currentView = pear.defaultView; pear.currentView = pear.defaultView;
focusImage(pear.currentImg, h.redirected); focusImage(pear.currentImg);
} }
pear.currentView = h.viewMode; pear.currentView = h.viewMode;
} }
@ -594,7 +608,7 @@ function pearInit(options) {
} }
setKeys(); setKeys();
thumbLoad(); setTimeout(thumbLoad, 1);
$('#gridContainer').endlessScroll({ fireOnce: true, bottomPixels: 200, callback: function(p) { loadMore(); } }); $('#gridContainer').endlessScroll({ fireOnce: true, bottomPixels: 200, callback: function(p) { loadMore(); } });
$('#gridContainer').trigger('scroll'); $('#gridContainer').trigger('scroll');

View File

@ -1,6 +1,6 @@
name = ".Pear Theme" name = ".Pear Theme"
description = "A theme with the intention to mimic Apples mobile me gallery." description = "A theme with the intention to mimic Apples mobile me gallery."
version = 3.4.1 version = 3.5.4
author = "Fredrik Erlandsson <fredrik.e@gmail.com>" author = "Fredrik Erlandsson <fredrik.e@gmail.com>"
site = 1 site = 1
admin = 0 admin = 0

View File

@ -56,5 +56,7 @@ $(window).load(function () {
</div> </div>
</div> </div>
<? endif ?> <? endif ?>
<? if(($theme->item())): ?>
<?= $theme->album_bottom() ?> <?= $theme->album_bottom() ?>
<? endif ?>

View File

@ -1,5 +1,6 @@
<?php defined("SYSPATH") or die("No direct script access.") ?> <?php defined("SYSPATH") or die("No direct script access.") ?>
<div class="g-facebook-comment-block"> <div class="g-facebook-comment-block">
<h1>Facebook comments for <?= $title?></h1>
<div id="fb-root"></div> <div id="fb-root"></div>
<script> <script>
(function(d, s, id) { (function(d, s, id) {
@ -10,7 +11,15 @@
fjs.parentNode.insertBefore(js, fjs); fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk')); }(document, 'script', 'facebook-jssdk'));
</script> </script>
<fb:comments href="<?=$url?>" num_posts="5" width="478" colorscheme="dark"> </fb:comments> <fb:comments href="<?if(isset($url)) { print $url; } else { print url::abs_current(); }?>"
num_posts="5" width="478" colorscheme="dark"> </fb:comments>
</div> </div>
<script>FB.XFBML.parse(document.getElementById('g-dialog'));</script> <script>
if (typeof(FB) != 'undefined') {
FB.XFBML.parse(document.getElementById('g-dialog'));
}
setTimeout(function () {
$("#g-dialog").removeClass("g-loading-small");
}, 10);
</script>

View File

@ -1,6 +1,12 @@
<?php defined("SYSPATH") or die("No direct script access.") ?> <?php defined("SYSPATH") or die("No direct script access.") ?>
<? <?
if (isset($_GET['ajax'])) { if (isset($_GET['ajax'])) {
if ($theme->page_subtype == "search") {
$v = new View("thumbs.html");
$v->children = $content->items;
print $v;
die(0);
}
echo new View("thumbs.html"); echo new View("thumbs.html");
die(0); die(0);
} }
@ -9,8 +15,19 @@ if (isset($_GET['ajax'])) {
foreach (end($parents)->viewable()->children() as $i => $child) foreach (end($parents)->viewable()->children() as $i => $child)
if(!($child->is_album() || $child->is_movie())) if(!($child->is_album() || $child->is_movie()))
if($child->url() == $_SERVER['REQUEST_URI']) { if($child->url() == $_SERVER['REQUEST_URI']) {
header("HTTP/1.1 302 Found"); ?>
header("Location: ".end($parents)->url()."#img=$i&viewMode=detail&redirected=true"); <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?= $theme->html_attributes() ?> xml:lang="en" lang="en">
<head>
<title>Photo page</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="refresh" content="1;url=<?=end($parents)->url()?>#img=<?=$i?>&amp;viewMode=detail&amp;redirected=true" />
<?= $theme->head() ?>
</head>
<body>Page moved <a href="<?=end($parents)->url()?>#img=<?=$i?>&amp;viewMode=detail&amp;redirected=true">here</a>.</body>
</html>
<?
die(0); die(0);
}?> }?>
<? endif ?> <? endif ?>
@ -131,7 +148,7 @@ if (isset($_GET['ajax'])) {
<? if (!module::get_var("th_pear4gallery3", "show_breadcrumbs")) break; ?> <? if (!module::get_var("th_pear4gallery3", "show_breadcrumbs")) break; ?>
<? endforeach ?> <? endforeach ?>
<? elseif (!($theme->item() && $theme->item()->id == item::root()->id)): ?> <? elseif (!($theme->item() && $theme->item()->id == item::root()->id)): ?>
<button class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all" onclick="window.location='<?= item::root()->url() ?>' + getAlbumHash(0);"> <span class="ui-button-text"><?= html::purify(text::limit_chars($parent->title, module::get_var("gallery", "visible_title_length"))) ?></span> </button> <button class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all" onclick="window.location='<?= item::root()->url() ?>' + getAlbumHash(0);"> <span class="ui-button-text"><?= html::purify(text::limit_chars(item::root()->title, module::get_var("gallery", "visible_title_length"))) ?></span> </button>
<? endif ?> <? endif ?>
</div> </div>
<? if ($theme->item()): ?> <? if ($theme->item()): ?>
@ -208,10 +225,14 @@ if (isset($_GET['ajax'])) {
<div class="clear"></div> <div class="clear"></div>
<? endif ?> <? endif ?>
</div> </div>
<? if (module::get_var("gallery", "logo_path")): ?> <? if (!module::get_var("th_pear4gallery3", "hide_logo")): ?>
<style type="text/css">#logoButton { background-image: url("<?= module::get_var("gallery", "logo_path") ?>"); }</style> <? 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");
} ?>
<button id="logoButton" style="background-image: url('<?= $logo_url ?>') !important"></button>
<? endif ?> <? endif ?>
<? if (!module::get_var("th_pear4gallery3", "hide_logo")): ?><button id="logoButton"></button><? endif ?>
</div> </div>
<? endif ?> <? endif ?>
</body> </body>

View File

@ -1,48 +1,18 @@
<?php defined("SYSPATH") or die("No direct script access.") ?> <?php defined("SYSPATH") or die("No direct script access.") ?>
<? // @todo Set hover on AlbumGrid list items ?> <script>
<form action="<?= url::site("/search") ?>" id="g-search-form" class="g-short-form"> $(function() {
<fieldset> $('#g-search').attr('value', '<?=$q?>');
<legend> $('.pearTitle').html("Search results for \"<?=$q?>\"");
<?= t("Search") ?> });
</legend> </script>
<ul> <? if (count($items)): ?>
<li> <?/* Treat dynamic pages just lite album pages. */ ?>
<label for="q"><?= t("Search the gallery") ?></label> <? $children = $items ?>
<input name="q" id="q" type="text" value="<?= html::clean_attribute($q) ?>" class="text" /> <? $v = new View("album.html");
</li> $v->set_global("children", $items);// = $items;
<li> print $v;?>
<input type="submit" value="<?= t("Search")->for_html_attr() ?>" class="submit" /> <? else: ?>
</li>
</ul>
</fieldset>
</form>
<div id="g-search-results">
<h1><?= t("Search results") ?></h1>
<? if (count($items)): ?>
<ul id="g-album-grid" class="ui-helper-clearfix">
<? foreach ($items as $item): ?>
<? $item_class = $item->is_album() ? "g-album" : "g-photo" ?>
<li class="g-item <?= $item_class ?>">
<a href="<?= $item->url() ?>">
<?= $item->thumb_img() ?>
<p>
<?= html::purify(text::limit_chars($item->title, 32, "")) ?>
</p>
<div>
<?= nl2br(html::purify(text::limit_chars($item->description, 64, ""))) ?>
</div>
</a>
</li>
<? endforeach ?>
</ul>
<?= $theme->paginator() ?>
<? else: ?>
<p> <p>
<?= t("No results found for <b>%term</b>", array("term" => $q)) ?> <?= t("No results found for <b>%term</b>", array("term" => $q)) ?>
</p> </p>
<? endif; ?>
<? endif; ?>
</div>

View File

@ -6,7 +6,7 @@
<? if ($i > 50) break; ?> <? if ($i > 50) break; ?>
<? $item_class = "g-photo"; ?> <? $item_class = "g-photo"; ?>
<? if ($child->is_album()): ?> <? 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 ?> <? endif ?>
<? $img_class = "g-thumbnail"; ?> <? $img_class = "g-thumbnail"; ?>
<? if ($child->is_photo()): ?> <? if ($child->is_photo()): ?>
@ -55,9 +55,7 @@ endif;
<? $item_no = ($page*$page_size)-$page_size; ?> <? $item_no = ($page*$page_size)-$page_size; ?>
<? foreach ($children as $i => $child): ?> <? foreach ($children as $i => $child): ?>
<? if(!($child->is_album() || $child->is_movie())): ?> <? 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() ?>']); 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() ?>']);
<? else: ?>
<? $item_no++ ?>
<? endif ?> <? endif ?>
<? endforeach ?> <? endforeach ?>
<?= $javaScript ?> <?= $javaScript ?>