1
0

Merge branch 'master' of git://github.com/rWatcher/gallery3-contrib

This commit is contained in:
Bharat Mediratta 2011-05-17 22:30:39 -07:00
commit 6b4211096f
34 changed files with 2984 additions and 370 deletions

View File

@ -65,6 +65,14 @@ class exif_gps_installer {
site_status::clear("exif_gps_needs_exif");
}
static function can_activate() {
$messages = array();
if (!module::is_active("exif")) {
$messages["warn"][] = t("The EXIF_GPS module requires the EXIF module.");
}
return $messages;
}
static function uninstall() {
// Delete the GPS table before uninstalling.
$db = Database::instance();

View File

@ -0,0 +1,199 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<!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>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<? $theme->start_combining("script,css") ?>
<title>
<? if ($page_title): ?>
<?= $page_title ?>
<? else: ?>
<? if ($theme->item()): ?>
<?= $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 ?>
<? endif ?>
<? endif ?>
</title>
<link rel="shortcut icon"
href="<?= url::file(module::get_var("gallery", "favicon_url")) ?>"
type="image/x-icon" />
<? if ($theme->page_type == "collection"): ?>
<? if ($thumb_proportion != 1): ?>
<? $new_width = round($thumb_proportion * 213) ?>
<? $new_height = round($thumb_proportion * 240) ?>
<style type="text/css">
.g-view #g-content #g-album-grid .g-item {
width: <?= $new_width ?>px;
height: <?= $new_height ?>px;
/* <?= $thumb_proportion ?> */
}
</style>
<? endif ?>
<? endif ?>
<?= $theme->script("json2-min.js") ?>
<?= $theme->script("jquery.js") ?>
<?= $theme->script("jquery.form.js") ?>
<?= $theme->script("jquery-ui.js") ?>
<?= $theme->script("gallery.common.js") ?>
<? /* MSG_CANCEL is required by gallery.dialog.js */ ?>
<script type="text/javascript">
var MSG_CANCEL = <?= t('Cancel')->for_js() ?>;
</script>
<?= $theme->script("gallery.ajax.js") ?>
<?= $theme->script("gallery.dialog.js") ?>
<?= $theme->script("superfish/js/superfish.js") ?>
<?= $theme->script("jquery.localscroll.js") ?>
<? /* 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") ?>
<? elseif ($theme->page_subtype == "movie"): ?>
<?= $theme->script("flowplayer.js") ?>
<? 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") ?>
<? if (module::get_var("theme_clean_canvas", "color_variant") == "dark" ): ?>
<?= $theme->css("dark/themeroller/ui.base.css") ?>
<?= $theme->css("dark/screen_colors.css") ?>
<?= $theme->css("dark/screen_candy.css") ?>
<? else: ?>
<?= $theme->css("clean/themeroller/ui.base.css") ?>
<?= $theme->css("clean/screen_colors.css") ?>
<?= $theme->css("clean/screen_candy.css") ?>
<? endif ?>
<?= $theme->css("screen_layout_base.css") ?>
<?= $theme->css("screen_fonts.css") ?>
<? if (module::get_var("theme_clean_canvas", "wide")): ?>
<?= $theme->css("screen_layout_wide.css") ?>
<? else: ?>
<?= $theme->css("screen_layout_fixed.css") ?>
<? endif ?>
<!--[if lte IE 8]>
<link rel="stylesheet" type="text/css" href="<?= $theme->url("css/fix-ie.css") ?>"
media="screen,print,projection" />
<![endif]-->
<!-- LOOKING FOR YOUR JAVASCRIPT? It's all been combined into the link below -->
<?= $theme->get_combined("script") ?>
<!-- LOOKING FOR YOUR CSS? It's all been combined into the link below -->
<?= $theme->get_combined("css") ?>
</head>
<body <?= $theme->body_attributes() ?>>
<?= $theme->page_top() ?>
<? if (module::get_var("theme_clean_canvas", "wide")): ?>
<div id="doc3" class="yui-t5 g-view">
<? else: ?>
<div id="doc4" class="yui-t5 g-view">
<? endif ?>
<?= $theme->site_status() ?>
<div id="g-header" class="ui-helper-clearfix">
<div id="g-banner">
<? if ($header_text = module::get_var("gallery", "header_text")): ?>
<?= $header_text ?>
<? else: ?>
<a id="g-logo" class="g-left" href="<?= item::root()->url() ?>" title="<?= t("go back to the Gallery home")->for_html_attr() ?>">
<img width="128" height="44" alt="<?= t("Gallery logo: Your photos on your web site")->for_html_attr() ?>" src="<?= $theme->url("images/canvaslogo.png") ?>" />
</a>
<? endif ?>
<?= $theme->user_menu() ?>
<?= $theme->header_top() ?>
<div id="g-banner-languages">
<? $locales = locales::installed(); ?>
<? if (count($locales) > 1 ) { ?>
<? foreach ($locales as $locale => $display_name) { ?>
<? $locales[$locale] = SafeString::of_safe_html($display_name); ?>
<? } ?>
<? $lang_content = new View("user_languages_block.html"); ?>
<? $lang_content->installed_locales = array_merge(array("" => t("« none »")), $locales); ?>
<? $lang_content->selected = (string) locales::cookie_locale(); ?>
<?= $lang_content ?>
<? } ?>
</div>
<!-- hide the menu until after the page has loaded, to minimize menu flicker -->
<div id="g-site-menu" style="visibility: hidden">
<?= $theme->site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?>
</div>
<script type="text/javascript"> $(document).ready(function() { $("#g-site-menu").css("visibility", "visible"); }) </script>
<?= $theme->header_bottom() ?>
</div>
<? // The following code was modifed to allow module-defined breadcrumbs.
// Everything else in this file is a copy of the default page.html.php file.
?>
<? if (!empty($breadcrumbs)): ?>
<ul class="g-breadcrumbs">
<? $i = 0 ?>
<? foreach ($breadcrumbs as $breadcrumb): ?>
<li<? if ($i == 0) print " class=\"g-first\"" ?>>
<!-- Adding ?show=<id> causes Gallery3 to display the page
containing that photo. For now, we just do it for
the immediate parent so that when you go back up a
level you're on the right page. -->
<? if ($breadcrumb->url) : ?>
<a href="<?= $breadcrumb->url ?>"><?= html::purify($breadcrumb->title) ?></a>
<? else : ?>
<?= html::purify($breadcrumb->title) ?>
<? endif ?>
</li>
<? $i++ ?>
<? endforeach ?>
</ul>
<? endif ?>
<? // End modified code ?>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div id="g-content" class="yui-g">
<?= $theme->messages() ?>
<?= $content ?>
</div>
</div>
</div>
<? if (!($theme->item() && !empty($parents))): ?>
<style type="text/css">
/* No breadcrums, position adaption for sidebar needed */
#g-sidebar
{
top: 6px;
}
</style>
<? endif ?>
<div id="g-sidebar" class="yui-b">
<? if ($theme->page_subtype != "login"): ?>
<?= new View("sidebar.html") ?>
<? endif ?>
</div>
</div>
<div id="g-footer" class="ui-helper-clearfix">
<?= $theme->footer() ?>
<? if ($footer_text = module::get_var("gallery", "footer_text")): ?>
<?= $footer_text ?>
<? endif ?>
<? if (module::get_var("gallery", "show_credits")): ?>
<ul id="g-credits" class="g-inline">
<?= $theme->credits() ?>
</ul>
<? endif ?>
</div>
</div>
<?= $theme->page_bottom() ?>
</body>
</html>

View File

@ -0,0 +1,297 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Grey Dragon Theme - a custom theme for Gallery 3
* This theme was designed and built by Serguei Dosyukov, whose blog you will find at http://blog.dragonsoft.us
* Copyright (C) 2009-2011 Serguei Dosyukov
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General
* Public License as published by the Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<? $theme->load_sessioninfo(); ?>
<!-- <?= $theme->themename ?> v.<?= $theme->themeversion ?> (ColorPack: <?= $theme->colorpack ?>) - Copyright (c) 2009-2011 Serguei Dosyukov - All Rights Reserved -->
<html xmlns="http://www.w3.org/1999/xhtml" <?= $theme->html_attributes() ?> xml:lang="en" lang="en" <?= ($theme->is_rtl)? "dir=rtl" : null; ?> >
<?
$item = $theme->item();
if (($theme->enable_pagecache) and (isset($item))):
// Page will expire in 60 seconds
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 60).'GMT');
header("Cache-Control: public");
header("Cache-Control: post-check=3600, pre-check=43200", false);
header("Content-Type: text/html; charset=UTF-8");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
endif;
?>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<? $theme->start_combining("script,css") ?>
<? if ($page_title): ?>
<? $_title = $page_title ?>
<? else: ?>
<? if ($theme->item()): ?>
<? $_title = $theme->bb2html($theme->item()->title, 2); ?>
<? elseif ($theme->tag()): ?>
<? $_title = t("Photos tagged with %tag_title", array("tag_title" => $theme->bb2html($theme->tag()->name, 2))) ?>
<? else: /* Not an item, not a tag, no page_title specified. Help! */ ?>
<? $_title = $theme->bb2html(item::root()->title, 2); ?>
<? endif ?>
<? endif ?>
<title><?= $_title ?></title>
<? if ($theme->disable_seosupport): ?>
<meta name="robots" content="noindex, nofollow, noarchive" />
<meta name="googlebot" content="noindex, nofollow, noarchive, nosnippet, noodp, noimageindex, notranslate" />
<meta name="slurp" content="noindex, nofollow, noarchive, nosnippet, noodp, noydir" />
<meta name="msnbot" content="noindex, nofollow, noarchive, nosnippet, noodp" />
<meta name="teoma" content="noindex, nofollow, noarchive" />
<? endif; ?>
<? if ($theme->blendpagetrans): ?>
<meta http-equiv="Page-Enter" content="blendTrans(Duration=0.5)" />
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0.5)" />
<? endif; ?>
<!-- Internet Explorer 9 Meta tags : Start -->
<meta name="application-name" content="<?= $_title; ?>" />
<meta name="msapplication-tooltip" content="<?= t("Start"); ?> <?= $_title; ?>" />
<meta name="msapplication-starturl" content="<?= item::root()->url() ?>" />
<? if ($theme->allow_root_page): ?>
<meta name="msapplication-task" content="name=<?= t("Gallery") ?>: <?= t("Root Page") ?>; action-uri=<?= item::root()->url(); ?>?root=yes; icon-uri=favicon.ico" />
<meta name="msapplication-task" content="name=<?= t("Gallery") ?>: <?= t("Root Album") ?>; action-uri=<?= item::root()->url(); ?>?root=no; icon-uri=favicon.ico" />
<? else: ?>
<meta name="msapplication-task" content="name=<?= t("Gallery") ?>: <?= t("Root Album") ?>; action-uri=<?= item::root()->url(); ?>; icon-uri=favicon.ico" />
<? endif; ?>
<? if (identity::active_user()->admin): ?>
<meta name="msapplication-task-separator" content="gallery3-greydragon" />
<meta name="msapplication-task" content="name=<?= t("Admin") ?>: <?= t("Dashboard") ?>; action-uri=<?= url::site("admin"); ?>; icon-uri=favicon.ico" />
<? endif; ?>
<!-- Internet Explorer 9 Meta tags : End -->
<link rel="shortcut icon" href="<?= $theme->favicon ?>" type="image/x-icon" />
<? if ($theme->appletouchicon): ?>
<link rel="apple-touch-icon" href="<?= $theme->appletouchicon; ?>"/>
<? endif; ?>
<?= $theme->script("json2-min.js") ?>
<?= $theme->script("jquery.js") ?>
<?= $theme->script("jquery.form.js") ?>
<?= $theme->script("jquery-ui.js") ?>
<?= $theme->script("gallery.common.js") ?>
<? /* MSG_CANCEL is required by gallery.dialog.js */ ?>
<script type="text/javascript">
var MSG_CANCEL = <?= t('Cancel')->for_js() ?>;
</script>
<?= $theme->script("gallery.ajax.js"); ?>
<?= $theme->script("gallery.dialog.js"); ?>
<? /* These are page specific but they get combined */ ?>
<? if ($theme->page_subtype == "photo"): ?>
<?= $theme->script("jquery.scrollTo.js"); ?>
<? elseif ($theme->page_subtype == "movie"): ?>
<?= $theme->script("flowplayer.js") ?>
<? endif ?>
<?= $theme->head() ?>
<? /* Theme specific CSS/JS goes last so that it can override module CSS/JS */ ?>
<?= $theme->script("animation.js"); ?>
<?= $theme->script("ui.support.js"); ?>
<?= $theme->theme_css_inject(); ?>
<!-- LOOKING FOR YOUR CSS? It's all been combined into the link below -->
<?= $theme->get_combined("css"); ?>
<?= $theme->css_link("colorpacks/" . $theme->colorpack . "/colors.css", FALSE); ?>
<?= $theme->css_link("framepacks/" . $theme->framepack . "/frame.css", FALSE); ?>
<? if ($theme->custom_css_path != ""): ?>
<?= $theme->css_link($theme->custom_css_path, TRUE); ?>
<? endif; ?>
<!-- LOOKING FOR YOUR JAVASCRIPT? It's all been combined into the link below -->
<?= $theme->get_combined("script") ?>
<!--[if IE 6]>
<link rel="stylesheet" href="<?= $theme->url("css/old_ie.css") ?>" type="text/css" media="screen,print,projection" />
<![endif]-->
<? if ($theme->thumb_inpage): ?>
<style type="text/css"> #g-column-bottom #g-thumbnav-block, #g-column-top #g-thumbnav-block { display: none; } </style>
<? endif; ?>
</head>
<? if ($theme->item()): ?>
<? $item = $theme->item(); ?>
<? else: ?>
<? $item = item::root(); ?>
<? endif; ?>
<body <?= $theme->body_attributes() ?><?= ($theme->show_root_page)? ' id="g-rootpage"' : null; ?> <?= ($theme->is_rtl)? "class=\"rtl\"" : null; ?> >
<?= $theme->page_top() ?>
<?= $theme->site_status() ?>
<? if (((!$user->guest) or ($theme->show_guest_menu)) and ($theme->mainmenu_position == "bar")): ?>
<style type="text/css"> html { margin-top: 30px !important; } </style>
<div id="g-site-menu" class="g-<?= $theme->mainmenu_position; ?>">
<?= $theme->site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?>
</div>
<? endif ?>
<div id="g-header">
<?= $theme->header_top() ?>
<? if ($header_text = module::get_var("gallery", "header_text")): ?>
<span id="g-header-text"><?= $theme->bb2html($header_text, 1) ?></span>
<? else: ?>
<a id="g-logo" href="<?= item::root()->url() ?><?= ($theme->allow_root_page)? "?root=yes" : null; ?>" 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="<?= $theme->logopath ?>" />
</a>
<? endif ?>
<? if (((!$user->guest) or ($theme->show_guest_menu)) and ($theme->mainmenu_position != "bar")): ?>
<div id="g-site-menu" class="g-<?= $theme->mainmenu_position; ?>">
<?= $theme->site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?>
</div>
<? endif ?>
<?= $theme->messages() ?>
<?= $theme->header_bottom() ?>
<? if ($theme->loginmenu_position == "header"): ?>
<?= $theme->user_menu() ?>
<? endif ?>
<?
// Custom rWatcher code, based on the breadcrumb menu function.
// The rest of this file is the original page.html.php file from the Grey Dragon theme.
?>
<? if (empty($breadcrumbs)): ?>
<?= $theme->breadcrumb_menu($theme, null); ?>
<? else: ?>
<?
$breadcrumb_content = "";
if ($this->breadcrumbs_position == "hide"):
else:
$limit_title_length = module::get_var("gallery", "visible_title_length", 999);
$breadcrumb_content .= '<ul class="g-breadcrumbs g-' . module::get_var("th_greydragon", "breadcrumbs_position", "default") . '">';
$i = 0;
foreach ($breadcrumbs as $breadcrumb):
if ($breadcrumb->url):
$breadcrumb_content .= '<li ' . (($i == 0)? " class=\"g-first\"" : null) . '>';
$breadcrumb_content .= '<a href="' . $breadcrumb->url . '">';
$breadcrumb_content .= text::limit_chars($theme->bb2html(html::purify($breadcrumb->title), 2), $limit_title_length);
$breadcrumb_content .= '</a></li>';
else:
$breadcrumb_content .= '<li class="g-active ' . (($i == 0)? " g-first" : null) . '">' . text::limit_chars($theme->bb2html(html::purify($breadcrumb->title), 2), $limit_title_length) . '</li>';
endif;
$i++;
endforeach;
$breadcrumb_content .= '</ul>';
endif;
print $breadcrumb_content;
// End Edit.
?>
<? endif; ?>
<?= $theme->custom_header(); ?>
</div>
<? if (($theme->page_subtype != "login") and ($theme->page_subtype != "reauthenticate") and ($theme->sidebarvisible == "top")): ?>
<div id="g-column-top">
<?= new View("sidebar.html") ?>
</div>
<? endif; ?>
<div id="g-main">
<div id="g-main-in">
<? if (!$theme->show_root_page): ?>
<?= $theme->sidebar_menu($item->url()) ?>
<div id="g-view-menu" class="g-buttonset<?= ($theme->sidebarallowed != "any")? " g-buttonset-shift" : null; ?>">
<? if ($page_subtype == "album"): ?>
<?= $theme->album_menu() ?>
<? elseif ($page_subtype == "photo") : ?>
<?= $theme->photo_menu() ?>
<? elseif ($page_subtype == "movie") : ?>
<?= $theme->movie_menu() ?>
<? elseif ($page_subtype == "tag") : ?>
<?= $theme->tag_menu() ?>
<? endif ?>
</div>
<? endif; ?>
<? switch ($theme->sidebarvisible):
case "left":
echo '<div id="g-column-left">';
$closediv = TRUE;
break;
case "none":
case "top":
case "bottom":
if (($theme->thumb_inpage) and ($page_subtype == "photo")):
echo '<div id="g-column-right">';
$closediv = TRUE;
else:
$closediv = FALSE;
endif;
break;
default:
echo '<div id="g-column-right">';
$closediv = TRUE;
break;
endswitch; ?>
<? if (($theme->page_subtype != "login") and ($theme->page_subtype != "reauthenticate")): ?>
<? if (($theme->sidebarvisible == "none") or ($theme->sidebarvisible == "bottom") or ($theme->sidebarvisible == "top")): ?>
<? if (($theme->thumb_inpage) and ($page_subtype == "photo")): ?>
<?= '<div class="g-toolbar"><h1>&nbsp;</h1></div>'; ?>
<?= $theme->get_block_html("thumbnav"); ?>
<? endif; ?>
<? else: ?>
<?= new View("sidebar.html") ?>
<? endif; ?>
<? endif ?>
<?= ($closediv)? "</div>" : null; ?>
<? switch ($theme->sidebarvisible):
case "left":
echo '<div id="g-column-centerright">';
break;
case "none":
case "top":
case "bottom":
if (($theme->thumb_inpage) and ($page_subtype == "photo")):
echo '<div id="g-column-centerleft">';
else:
echo '<div id="g-column-centerfull">';
endif;
break;
default:
echo '<div id="g-column-centerleft">';
break;
endswitch;
if ($theme->show_root_page):
echo new View("rootpage.html");
else:
echo $content;
endif; ?>
</div>
</div>
</div>
<? if (($theme->page_subtype != "login") and ($theme->page_subtype != "reauthenticate") and ($theme->sidebarvisible == "bottom")): ?>
<div id="g-column-bottom">
<?= new View("sidebar.html") ?>
</div>
<? endif; ?>
<div id="g-footer">
<?= $theme->footer() ?>
<? if ($footer_text = module::get_var("gallery", "footer_text")): ?>
<span id="g-footer-text"><?= $theme->bb2html($footer_text, 1) ?></span>
<? endif ?>
<?= $theme->credits() ?>
<ul id="g-footer-rightside"><li><?= $theme->copyright ?></li></ul>
<? if ($theme->loginmenu_position == "default"): ?>
<?= $theme->user_menu() ?>
<? endif ?>
<?= $theme->custom_footer(); ?>
</div>
<?= $theme->page_bottom() ?>
</body>
</html>

View File

@ -0,0 +1,209 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Grey Dragon Theme - a custom theme for Gallery 3
* This theme was designed and built by Serguei Dosyukov, whose blog you will find at http://blog.dragonsoft.us
* Copyright (C) 2009-2011 Serguei Dosyukov
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General
* Public License as published by the Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
?>
<?
// This is a generic paginator for album, photo and movie pages. Depending on the page type,
// there are different sets of variables available. With this data, you can make a paginator
// that lets you say "You're viewing photo 5 of 35", or "You're viewing photos 10 - 18 of 37"
// for album views.
//
// Available variables for all page types:
// $page_type - "collection", "item", or "other"
// $page_subtype - "album", "movie", "photo", "tag", etc.
// $previous_page_url - the url to the previous page, if there is one
// $next_page_url - the url to the next page, if there is one
// $total - the total number of photos in this album
//
// Available for the "collection" page types:
// $page - what page number we're on
// $max_pages - the maximum page number
// $page_size - the page size
// $first_page_url - the url to the first page, or null if we're on the first page
// $last_page_url - the url to the last page, or null if we're on the last page
// $first_visible_position - the position number of the first visible photo on this page
// $last_visible_position - the position number of the last visible photo on this page
//
// Available for "item" page types:
// $position - the position number of this photo
//
?>
<?
$_pagelist = array();
// rWatcher Mod
if (isset($dynamic_siblings)):
$current_page = $position;
$total_pages = count($dynamic_siblings);
$siblings = $dynamic_siblings;
for ($i = 1; $i <= $total_pages; $i++):
if ($page_type == "item") {
$_pagelist[$i] = url::site("tag_albums/show/" . $siblings[$i-1]->id . "/" . $tag_id . "/" . $album_id);
} elseif ($page_type == "") {
}
endfor;
else:
// End rWatcher Mod.
switch ($page_type) {
case "collection":
if (isset($item)):
$parent = $item->parent();
endif;
$current_page = $page;
$total_pages = $max_pages;
// Prepare page url list
for ($i = 1; $i <= $total_pages; $i++):
$_pagelist[$i] = url::site(url::merge(array("page" => $i)));
endfor;
break;
case "item":
if (isset($item)):
$parent = $item->parent();
endif;
$current_page = $position;
$total_pages = $total;
if (isset($parent)):
$siblings = $parent->children();
for ($i = 1; $i <= $total; $i++):
$_pagelist[$i] = $siblings[$i-1]->url();
endfor;
endif;
break;
default:
$current_page = 1;
$total_pages = 1;
$_pagelist[1] = url::site();
break;
}
// rWatcher Mod
endif;
// End rWatcher Mod.
if ($total_pages <= 1):
$pagination_msg = "&nbsp;";
else:
$pagination_msg = t("Page:") . ' ';
if ($total_pages < 13):
for ($i = 1; $i <= $total_pages; $i++):
if ($i == $current_page):
$pagination_msg .= '<span>' . t($i) . '</span>';
else:
$pagination_msg .= '<span><a href="' . $_pagelist[$i] . '" title="' . t("Page") . ' ' . t($i) . '">' . t($i) . '</a></span>';
endif;
if ($i < $total_pages):
$pagination_msg .= '&middot;';
endif;
endfor;
elseif ($current_page < 9):
for ($i = 1; $i <= 10; $i++):
if ($i == $current_page):
$pagination_msg .= '<span>' . t($i) . '</span>';
else:
$pagination_msg .= '<span><a href="' . $_pagelist[$i] . '" title="' . t("Page") . ' ' . t($i) . '">' . t($i) . '</a></span>';
endif;
if ($i < 10):
$pagination_msg .= '&middot;';
endif;
endfor;
$pagination_msg .= '&hellip;';
$pagination_msg .= '<span><a href="' . $_pagelist[$total_pages - 1] . '" title="' . t("Page") . ' ' . t($total_pages - 1) . '">' . t($total_pages - 1) . '</a></span>';
$pagination_msg .= '&middot;';
$pagination_msg .= '<span><a href="' . $_pagelist[$total_pages] . '" title="' . t("Page") . ' ' . t($total_pages) . '">' . t($total_pages) . '</a></span>';
elseif ($current_page > $total_pages - 8):
$pagination_msg .= '<span><a href="' . $_pagelist[1] . '" title="' . t("Page") . ' ' . t(1) . '">' . t(1) . '</a></span>';
$pagination_msg .= '&middot;';
$pagination_msg .= '<span><a href="' . $_pagelist[2] . '" title="' . t("Page") . ' ' . t(2) . '">' . t(2) . '</a></span>';
$pagination_msg .= '&hellip;';
for ($i = $total_pages - 9; $i <= $total_pages; $i++):
if ($i == $current_page):
$pagination_msg .= '<span>' . t($i) . '</span>';
else:
$pagination_msg .= '<span><a href="' . $_pagelist[$i] . '" title="' . t("Page") . ' ' . t($i) . '">' . t($i) . '</a></span>';
endif;
if ($i < $total_pages):
$pagination_msg .= '&middot;';
endif;
endfor;
else:
$pagination_msg .= '<span><a href="' . $_pagelist[1] . '" title="' . t("Page") . ' ' . t(1) . '">' . t(1) . '</a></span>';
$pagination_msg .= '&middot;';
$pagination_msg .= '<span><a href="' . $_pagelist[2] . '" title="' . t("Page") . ' ' . t(2) . '">' . t(2) . '</a></span>';
$pagination_msg .= '&hellip;';
for ($i = $current_page - 5; $i <= $current_page + 5; $i++):
if ($i == $current_page):
$pagination_msg .= '<span>' . t($i) . '</span>';
else:
$pagination_msg .= '<span><a href="' . $_pagelist[$i] . '" title="' . t("Page") . ' ' . t($i) . '">' . t($i) . '</a></span>';
endif;
if ($i < $current_page + 5):
$pagination_msg .= '&middot;';
endif;
endfor;
$pagination_msg .= '&hellip;';
$pagination_msg .= '<span><a href="' . $_pagelist[$total_pages - 1] . '" title="' . t("Page") . ' ' . t($total_pages - 1) . '">' . t($total_pages - 1) . '</a></span>';
$pagination_msg .= '&middot;';
$pagination_msg .= '<span><a href="' . $_pagelist[$total_pages] . '" title="' . t("Page") . ' ' . t($total_pages) . '">' . t($total_pages) . '</a></span>';
endif;
endif;
?>
<ul class="g-paginator">
<li class="g-pagination"><?= $pagination_msg ?></li>
<li class="g-navigation">
<? if ($current_page > 1): ?>
<a title="<?= t("first") ?>" id="g-navi-first" href="<?= $_pagelist[1] ?>"><span class="ui-icon ui-icon-first">&nbsp;</span></a>
<? else: ?>
<span class="ui-icon ui-icon-first-d">&nbsp;</span>
<? endif ?>
<? if (isset($previous_page_url)): ?>
<a title="<?= t("previous") ?>" id="g-navi-prev" href="<?= $previous_page_url ?>"><span class="ui-icon ui-icon-prev">&nbsp;</span></a>
<? else: ?>
<span class="ui-icon ui-icon-prev-d">&nbsp;</span>
<? endif ?>
<? // rWatcher Mod. ?>
<? if (isset($parent_url)): ?>
<a title="<?= t("up") ?>" id="g-navi-parent" href="<?= $parent_url ?>"><span class="ui-icon ui-icon-parent">&nbsp;</span></a>
<? elseif (isset($parent)): ?>
<a title="<?= t("up") ?>" id="g-navi-parent" href="<?= $parent->url() ?>"><span class="ui-icon ui-icon-parent">&nbsp;</span></a>
<? else: ?>
<span class="ui-icon ui-icon-parent-d">&nbsp;</span>
<? endif ?>
<? // End rWatcher Mod. ?>
<? if (isset($next_page_url)): ?>
<a title="<?= t("next") ?>" class="ui-right" id="g-navi-next" href="<?= $next_page_url ?>"><span class="ui-icon ui-icon-next">&nbsp;</span></a>
<? else: ?>
<span class="ui-icon ui-icon-next-d">&nbsp;</span>
<? endif ?>
<? if ($current_page < $total_pages): ?>
<a title="<?= t("last") ?>" class="ui-right" id="g-navi-last" href="<?= $_pagelist[$total_pages] ?>"><span class="ui-icon ui-icon-last">&nbsp;</span></a>
<? else: ?>
<span class="ui-icon ui-icon-last-d">&nbsp;</span>
<? endif ?>
</li>
</ul>

View File

@ -0,0 +1,122 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Grey Dragon Theme - a custom theme for Gallery 3
* This theme was designed and built by Serguei Dosyukov, whose blog you will find at http://blog.dragonsoft.us
* Copyright (C) 2009-2011 Serguei Dosyukov
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General
* Public License as published by the Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
?>
<?
if ($theme->desc_allowbbcode):
$_description = $theme->bb2html($item->description, 1);
else:
$_description = nl2br(html::purify($item->description));
endif;
if ($theme->is_photometa_visible):
$_description .= '<ul class="g-metadata">' . $theme->thumb_info($item) . '</ul>';
endif;
switch ($theme->photo_popupbox):
case "preview":
$include_list = FALSE;
$include_single = TRUE;
break;
case "none":
$include_list = FALSE;
$include_single = FALSE;
break;
default:
$include_list = TRUE;
$include_single = TRUE;
break;
endswitch;
?>
<div id="g-item">
<? $_title = $theme->bb2html(html::purify($item->title), 1); ?>
<div id="g-info">
<h1><?= $_title ?></h1>
</div>
<?= $theme->add_paginator("top"); ?>
<?= $theme->photo_top() ?>
<? if (($theme->photo_descmode == "top") and ($_description)): ?>
<div id="g-info"><div class="g-description"><?= $_description ?></div></div>
<? endif; ?>
<div id="g-photo">
<?= $theme->resize_top($item) ?>
<? $_resizewidth = $item->resize_width;
// rWatcher Modification.
$siblings = "";
if (isset($dynamic_siblings)) {
$siblings = $dynamic_siblings;
} else {
$siblings = $item->parent()->children();
}
// End rWatcher Modification
?>
<div class="g-resize" style="margin-left: -<?= intval($_resizewidth / 2); ?>px; ">
<? $script = "<script type=\"text/javascript\">\n";
$script .= " if (document.images) {\n";
for ($i = 0; ($i <= count($siblings) - 1); $i++):
if ($siblings[$i]->rand_key == $item->rand_key): ?>
<a style="<?= ($siblings[$i]->rand_key == $item->rand_key)? "display: static;" : "display: none;"; ?>" title="<?= $theme->bb2html(html::purify($item->title), 2) ?>" <?= ($include_single)? "class=\"g-sb-preview\"" : "target=_blank;"; ?> <?= ($include_list)? "rel=\"g-preview\"" : null; ?> href="<?= (access::can("view_full", $item))? $item->file_url() : $item->resize_url(); ?>">
<?= $item->resize_img(array("id" => "g-photo-id-{$item->id}", "class" => "g-resize", "alt" => $_title)) ?>
</a>
<? if ($i < count($siblings) - 1):
$script .= " var image_preload_n = new Image();\n image_preload_n.src = \"" . $siblings[$i+1]->resize_url() . "\";\n";
endif;
if ($i > 0):
$script .= " var image_preload_p = new Image();\n image_preload_p.src = \"" . $siblings[$i-1]->resize_url() . "\";\n";
endif;
else:
if ($include_list): ?>
<? if (!$siblings[$i]->is_album()): ?>
<a title="<?= $theme->bb2html(html::purify($siblings[$i]->title), 2) ?>" class="g-sb-preview g-hide" rel="g-preview" href="<?= (access::can("view_full", $siblings[$i]))? $siblings[$i]->file_url() : $siblings[$i]->resize_url(); ?>">&nbsp;</a>
<? endif; ?>
<? endif; ?>
<? endif; ?>
<? endfor; ?>
<? $script .= " }\n</script>\n"; ?>
<? $_align = "";
if ($_description):
switch ($theme->photo_descmode):
case "overlay_top":
$_align = "g-align-top";
break;
case "overlay_bottom":
$_align = "g-align-bottom";
break;
default:
break;
endswitch;
endif; ?>
<? if ($_align): ?>
<span class="g-more <?= $_align ?>"><?= t("More") ?></span>
<div class="g-description <?= $_align; ?>" style="width: <?= $_resizewidth - 20; ?>px;" >
<strong><?= $_title ?></strong>
<?= $_description ?>
</div>
<? endif ?>
</div>
<?= $theme->resize_bottom($item) ?>
</div>
<? if (($theme->photo_descmode == "bottom") and ($_description)): ?>
<div id="g-info"><div class="g-description"><?= $_description ?></div></div>
<? endif; ?>
<?= $theme->add_paginator("bottom"); ?>
<?= $theme->photo_bottom() ?>
</div>
<?= $script ?>

View File

@ -0,0 +1,135 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<?
// The g-info block was taken from album.html.php and $theme->album_top() was changed to $theme->dynamic_top().
// $item->title and $item->description have been changed to $title and $description.
//
// The g-album-grid block was also taken from album.html.php. The section for uploading new photos to an empty album
// has been removed. Also, $theme->context_menu has been removed as well (it was crashing the page).
?>
<div id="g-album-header">
<?= $theme->dynamic_top() ?>
<h1><?= $theme->bb2html(html::purify($title), 1) ?></h1>
</div>
<?= $theme->add_paginator("top"); ?>
<? if (($theme->album_descmode == "top") and ($description)): ?>
<div id="g-info"><div class="g-description"><?= $theme->bb2html(html::purify($description), 1) ?></div></div>
<? endif; ?>
<? if (isset($filter_text) && (module::get_var("tag_albums", "tag_index_filter"))): ?>
<div id="g-tags-filter">
<br/ >
<center><?= $filter_text; ?></center>
</div>
<? endif ?>
<div class="g-album-grid-container">
<ul id="g-album-grid" class="<?= $theme->get_grid_column_class(); ?>">
<? if (count($children)): ?>
<? foreach ($children as $i => $child): ?>
<?
// This code is based on grey dragon's get_thumb_element function.
$thumb_item = $child;
$is_portrait = ($thumb_item->thumb_height > $thumb_item->thumb_width);
$item_class = $child->is_album() ? "g-album" : "g-photo";
$content = '<li id="g-item-id-' . $child->id . '" class="g-item ' . $item_class . ' ' . $theme->thumb_type;
if ($child->is_album()):
$_thumb_descmode = $theme->thumb_descmode_a;
else:
$_thumb_descmode = $theme->thumb_descmode;
endif;
$content .= ($_thumb_descmode == "bottom")? " g-expanded" : " g-default";
$content .= ($is_portrait)? " g-portrait" : " g-landscape";
$content .= '">' . $theme->thumb_top($child);
if ($theme->thumb_topalign):
$_shift = "";
else:
if (($theme->crop_factor == 1) and (!$is_portrait)):
$_shift = 'style="margin-top: ' . intval(($theme->_thumb_size_y - $thumb_item->thumb_height) / 2) . 'px;"';
else:
if (($theme->crop_factor > 0) and ($is_portrait)):
$_shift = 'style="margin-top: -' . intval(($thumb_item->thumb_height - $theme->_thumb_size_y) / 2) . 'px;"';
else:
$_shift = "";
endif;
endif;
endif;
// $ss = 'z-index: 22; opacity: 1; -ms-transform: rotate(' . (-15 + rand(0, 31)) . 'deg);'; style="' . $ss . '"
$content .= '<div class="g-thumbslide"><p class="g-thumbcrop">';
$content .= '<a '. $_shift . ' class="g-thumblink" href="' . $child->url() . '">';
if ($thumb_item->has_thumb()):
$content .= $thumb_item->thumb_img();
else:
$content .= '<img title="No Image" alt="No Image" src="' . $theme->url("images/missing-img.png") . '"/>';
endif;
$content .= '</a></p>';
if (($theme->thumb_metamode != "hide") and ($_thumb_descmode == "overlay_bottom")):
$_thumb_metamode = "merged";
else:
$_thumb_metamode = $theme->thumb_metamode;
endif;
if (($_thumb_descmode == "overlay") or ($_thumb_descmode == "overlay_top") or ($_thumb_descmode == "overlay_bottom")):
$content .= '<ul class="g-description ';
if ($_thumb_descmode == "overlay_top"):
$content .= 'g-overlay-top';
endif;
if ($_thumb_descmode == "overlay_bottom"):
$content .= 'g-overlay-bottom';
endif;
$content .= '"><li class="g-title">' . $theme->bb2html(html::purify($child->title), 2) . '</li>';
if ($_thumb_metamode == "merged"):
$content .= $theme->thumb_info($child);
endif;
$content .= '</ul>';
endif;
if (($_thumb_metamode == "default") and ($_thumb_descmode != "overlay_bottom")):
$content .= '<ul class="g-metadata">' . $theme->thumb_info($child) . '</ul>';
endif;
if ($_thumb_descmode == "bottom"):
$content .= '<ul class="g-description">';
$content .= '<li class="g-title">' . $theme->bb2html(html::purify($child->title), 2) . '</li>';
if ($_thumb_metamode == "merged"):
$content .= $theme->thumb_info($child);
endif;
$content .= '</ul>';
endif;
/*
if ($addcontext):
$_text = $this->context_menu($child, "#g-item-id-{$child->id} .g-thumbnail");
$content .= (stripos($_text, '<li>'))? $_text : null;
endif;
*/
$content .= '</div>';
$content .= $theme->thumb_bottom($child);
$content .= '</li>';
print $content;
// End rWatcher Edit.
?>
<? endforeach ?>
<? else: ?>
<li><?= t("There aren't any photos here yet!") ?></li>
<? endif; ?>
</ul>
</div>
<?= $theme->dynamic_bottom() ?>
<? if (($theme->album_descmode == "bottom") and ($description)): ?>
<div id="g-info"><div class="g-description"><?= $theme->bb2html(html::purify($description), 1) ?></div></div>
<? endif; ?>
<?= $theme->add_paginator("bottom"); ?>

View File

@ -36,6 +36,17 @@ class Admin_Tag_Albums_Controller extends Admin_Controller {
array("id" => "g-tag-albums-admin-form"));
$tag_albums_tagsort_group = $form->group("Tag_Albums_Tag_Sort")->label(t("\"All Tags\" Album Preferences"));
$tag_albums_tagsort_group->input("tag_page_title")
->label(t("Page Title"))
->value(module::get_var("tag_albums", "tag_page_title"));
$tag_albums_tagsort_group->dropdown("tag_index")
->label(t("Tag album's index should display:"))
->options(
array("default" => "(default) Individual Tag Albums",
"tagcloudpage" => "Tag Cloud Page Module",
"alltags" => "All Tags Module"))
->selected(module::get_var("tag_albums", "tag_index"));
$tag_albums_tagsort_group->dropdown("tag_sort_by")
->label(t("Sort \"All Tags\" Albums By:"))
->options(
@ -50,6 +61,14 @@ class Admin_Tag_Albums_Controller extends Admin_Controller {
"DESC" => "Descending"))
->selected(module::get_var("tag_albums", "tag_sort_direction"));
$tag_index_scope_options["tag_index_scope"] = Array(t("Use tag album index setting for \"*\" albums as well?"), module::get_var("tag_albums", "tag_index_scope"));
$tag_albums_tagsort_group->checklist("tag_index_scope")
->options($tag_index_scope_options);
$tag_index_filter_options["tag_index_filter"] = Array(t("Display filter links on \"All Tags\" album pages?"), module::get_var("tag_albums", "tag_index_filter"));
$tag_albums_tagsort_group->checklist("tag_index_filter")
->options($tag_index_filter_options);
$tag_albums_tagitemsort_group = $form->group("Tag_Albums_Tag_Item_Sort")->label(t("\"All Tags\" Sub-Album Preferences"));
$tag_albums_tagitemsort_group->dropdown("subalbum_sort_by")
->label(t("Sort Contents of Sub-Albums By:"))
@ -82,12 +101,16 @@ class Admin_Tag_Albums_Controller extends Admin_Controller {
$form = $this->_get_admin_form();
if ($form->validate()) {
Kohana_Log::add("error",print_r($form,1));
module::set_var("tag_albums", "tag_page_title", $form->Tag_Albums_Tag_Sort->tag_page_title->value);
module::set_var("tag_albums", "tag_index", $form->Tag_Albums_Tag_Sort->tag_index->value);
module::set_var("tag_albums", "tag_index_scope", count($form->Tag_Albums_Tag_Sort->tag_index_scope->value));
module::set_var("tag_albums", "tag_index_filter", count($form->Tag_Albums_Tag_Sort->tag_index_filter->value));
module::set_var("tag_albums", "tag_sort_by", $form->Tag_Albums_Tag_Sort->tag_sort_by->value);
module::set_var("tag_albums", "tag_sort_direction", $form->Tag_Albums_Tag_Sort->tag_sort_direction->value);
module::set_var("tag_albums", "subalbum_sort_by", $form->Tag_Albums_Tag_Item_Sort->subalbum_sort_by->value);
module::set_var("tag_albums", "subalbum_sort_direction", $form->Tag_Albums_Tag_Item_Sort->subalbum_sort_direction->value);
message::success(t("Your settings have been saved."));
url::redirect("admin/tag_albums");
}

View File

@ -34,7 +34,7 @@ class tag_albums_Controller extends Controller {
// If it does exist, and is set to *, load a list of all tags.
if ($album_tags[0]->tags == "*") {
$this->index($id);
$this->index($id, "");
} else {
// Otherwise, populate this page with the specified items.
@ -58,12 +58,23 @@ class tag_albums_Controller extends Controller {
}
$album_tags_search_type = $album_tags[0]->search_type;
// Figure out how many items are in this "virtual album"
$count = $this->_count_records($tag_ids, $album_tags_search_type, true);
// Figure out how many items to display on each page.
$page_size = module::get_var("gallery", "page_size", 9);
// If this page was reached from a breadcrumb, figure out what page to load from the show id.
$show = Input::instance()->get("show");
if ($show) {
$child = ORM::factory("item", $show);
$index = $this->_get_position($child->$sort_page_field, $child->id, $tag_ids, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, true);
if ($index) {
$page = ceil($index / $page_size);
url::redirect("tag_albums/album/" . $id . "?page=$page");
}
}
// Figure out how many items are in this "virtual album"
$count = $this->_count_records($tag_ids, $album_tags_search_type, true);
// Figure out which page # the visitor is on and
// don't allow the visitor to go below page 1.
$page = Input::instance()->get("page", 1);
@ -86,8 +97,10 @@ class tag_albums_Controller extends Controller {
$tag_children = $this->_get_records($tag_ids, $page_size, $offset, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, true);
$children = Array();
foreach ($tag_children as $one_child) {
$child_tag = new Tag_Albums_Item($one_child->name, url::site("tag_albums/show/" . $one_child->id . "/0/" . $id), $one_child->type);
$child_tag = new Tag_Albums_Item($one_child->title, url::site("tag_albums/show/" . $one_child->id . "/0/" . $id), $one_child->type);
$child_tag->id = $one_child->id;
$child_tag->view_count = $one_child->view_count;
$child_tag->owner = identity::lookup_user($one_child->owner_id);
if ($one_child->has_thumb()) {
$child_tag->set_thumb($one_child->thumb_url(), $one_child->thumb_width, $one_child->thumb_height);
}
@ -114,17 +127,20 @@ class tag_albums_Controller extends Controller {
$parent_item = ORM::factory("item", $parent_item->parent_id);
}
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, $parent_item->url());
$tag_album_breadcrumbs[1]->url .= "?show=" . $album->id;
$tag_album_breadcrumbs = array_reverse($tag_album_breadcrumbs, true);
// Set up and display the actual page.
$template = new Theme_View("page.html", "collection", "Tag Albums");
$parent_album = ORM::factory("item", $album->parent_id);
$template = new Theme_View("calpage.html", "collection", "Tag Albums");
$template->page_title = $page_title;
$template->set_global("page", $page);
$template->set_global("page_size", $page_size);
$template->set_global("max_pages", $max_pages);
$template->set_global("children", $children);
$template->set_global("children_count", $count);
$template->content = new View("tag_albums.html");
$template->set_global("parent_url", $parent_album->url()); // Used by Grey Dragon.
$template->content = new View("tag_albums_album.html");
$template->content->title = $page_title;
$template->content->description = $page_description;
$template->set_global("breadcrumbs", $tag_album_breadcrumbs);
@ -132,9 +148,27 @@ class tag_albums_Controller extends Controller {
}
}
public function index($id) {
public function filter($id, $filter) {
// Display the index page, but only show albums for
// tags whose name begins with $filter.
$this->index($id, $filter);
}
public function index($id, $filter) {
// Load a page containing sub-albums for each tag in the gallery.
// Check to see if the user has overridden default behavior, and act accordingly.
if ((module::get_var("tag_albums", "tag_index_scope", "false")) || ($id == "")) {
$tag_album_index_type = module::get_var("tag_albums", "tag_index", "default");
if (($tag_album_index_type == "tagcloudpage") && (module::is_active("tag_cloud_page"))) {
url::redirect("tag_cloud_page/");
return;
} elseif (($tag_album_index_type == "alltags") && (module::is_active("all_tags"))) {
url::redirect("all_tags/");
return;
}
}
// If an ID was specified, make sure it's valid.
$album_tags = ORM::factory("tags_album_id")
->where("id", "=", $id)
@ -146,7 +180,7 @@ class tag_albums_Controller extends Controller {
// Inherit permissions, title and description from the album that linked to this page,
// if available, if not use the root album and some default values.
$album = "";
$page_title = t("All Tags");
$page_title = module::get_var("tag_albums", "tag_page_title", "All Tags");
$page_description = "";
if ($id == "") {
$album = ORM::factory("item", 1);
@ -165,6 +199,40 @@ class tag_albums_Controller extends Controller {
// Figure out how many items to display on each page.
$page_size = module::get_var("gallery", "page_size", 9);
// If this page was reached from a breadcrumb, figure out what page to load from the show id.
$show = Input::instance()->get("show");
if ($show) {
$child = ORM::factory("tag", $show);
$comp = "";
if (!strcasecmp($sort_page_direction, "DESC")) {
$comp = ">";
} else {
$comp = "<";
}
$index = ORM::factory("tag")
->where($sort_page_field, $comp, $child->$sort_page_field)
->order_by("tags." . $sort_page_field, $sort_page_direction)
->count_all();
$tag_model = ORM::factory("tag")
->where($sort_page_field, "=", $child->$sort_page_field)
->order_by("tags." . $sort_page_field, $sort_page_direction)
->find_all();
foreach ($tag_model as $one_tag) {
$index++;
if ($one_tag->id == $show) {
break;
}
}
if ($index) {
$page = ceil($index / $page_size);
if ($id == "") {
url::redirect("tag_albums/?page=$page");
} else {
url::redirect("tag_albums/album/" . $id . "?page=$page");
}
}
}
// Figure out which page # the visitor is on and
// don't allow the visitor to go below page 1.
$page = Input::instance()->get("page", 1);
@ -177,8 +245,21 @@ class tag_albums_Controller extends Controller {
// Determine the total number of items,
// for page numbering purposes.
$all_tags_count = ORM::factory("tag")
->count_all();
$all_tags_count_model = ORM::factory("tag");
if ($filter != "") {
if ($filter == "NUM") {
$all_tags_count_model->open();
$all_tags_count_model->where("tags.name", "LIKE", "0%");
$counter = 1;
while ($counter < 10) {
$all_tags_count_model->or_where("tags.name", "LIKE", ($counter++) . "%");
}
$all_tags_count_model->close();
} else {
$all_tags_count_model->where("tags.name", "LIKE", $filter . "%");
}
}
$all_tags_count = $all_tags_count_model->count_all();
// Figure out what the highest page number is.
$max_pages = ceil($all_tags_count / $page_size);
@ -189,9 +270,22 @@ class tag_albums_Controller extends Controller {
}
// Figure out which items to display on this page.
$display_tags = ORM::factory("tag")
->order_by("tags." . $sort_page_field, $sort_page_direction)
->find_all($page_size, $offset);
$display_tags_model = ORM::factory("tag");
if ($filter != "") {
if ($filter == "NUM") {
$display_tags_model->open();
$display_tags_model->where("tags.name", "LIKE", "0%");
$counter = 1;
while ($counter < 10) {
$display_tags_model->or_where("tags.name", "LIKE", ($counter++) . "%");
}
$display_tags_model->close();
} else {
$display_tags_model->where("tags.name", "LIKE", $filter . "%");
}
}
$display_tags_model->order_by("tags." . $sort_page_field, $sort_page_direction);
$display_tags = $display_tags_model->find_all($page_size, $offset);
// Set up the previous and next page buttons.
if ($page > 1) {
@ -224,32 +318,38 @@ class tag_albums_Controller extends Controller {
// Set up breadcrumbs.
$tag_album_breadcrumbs = Array();
$parent_url = "";
if ($id != "") {
$counter = 0;
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($album->title, "");
$parent_item = ORM::factory("item", $album->parent_id);
$parent_url = $parent_item->url();
while ($parent_item->id != 1) {
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, $parent_item->url());
$parent_item = ORM::factory("item", $parent_item->parent_id);
}
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, $parent_item->url());
$tag_album_breadcrumbs[1]->url .= "?show=" . $album->id;
$tag_album_breadcrumbs = array_reverse($tag_album_breadcrumbs, true);
} else {
$parent_url = item::root()->url();
$tag_album_breadcrumbs[0] = new Tag_Albums_Breadcrumb(item::root()->title, item::root()->url());
$tag_album_breadcrumbs[1] = new Tag_Albums_Breadcrumb($page_title, "");
}
// Set up and display the actual page.
$template = new Theme_View("page.html", "collection", "Tag Albums");
$template = new Theme_View("calpage.html", "collection", "Tag Albums");
$template->page_title = $page_title;
$template->set_global("page", $page);
$template->set_global("page_size", $page_size);
$template->set_global("max_pages", $max_pages);
$template->set_global("children", $children);
$template->set_global("children_count", $all_tags_count);
$template->content = new View("tag_albums.html");
$template->set_global("parent_url", $parent_url); // Used by Grey Dragon.
$template->content = new View("tag_albums_album.html");
$template->content->title = $page_title;
$template->content->description = $page_description;
$template->content->filter_text = $this->_get_filter_html($id, $filter);
$template->set_global("breadcrumbs", $tag_album_breadcrumbs);
print $template;
}
@ -275,6 +375,17 @@ class tag_albums_Controller extends Controller {
// Figure out how many items to display on each page.
$page_size = module::get_var("gallery", "page_size", 9);
// If this page was reached from a breadcrumb, figure out what page to load from the show id.
$show = Input::instance()->get("show");
if ($show) {
$child = ORM::factory("item", $show);
$index = $this->_get_position($child->$sort_page_field, $child->id, Array($id), "items." . $sort_page_field, $sort_page_direction, "OR", true);
if ($index) {
$page = ceil($index / $page_size);
url::redirect("tag_albums/tag/" . $id . "/" . $album_id . "?page=$page");
}
}
// Figure out which page # the visitor is on and
// don't allow the visitor to go below page 1.
$page = Input::instance()->get("page", 1);
@ -303,8 +414,10 @@ class tag_albums_Controller extends Controller {
// Create an array of "fake" items to display on the page.
$children = Array();
foreach ($tag_children as $one_child) {
$child_tag = new Tag_Albums_Item($one_child->name, url::site("tag_albums/show/" . $one_child->id . "/" . $id . "/" . $album_id), $one_child->type);
$child_tag = new Tag_Albums_Item($one_child->title, url::site("tag_albums/show/" . $one_child->id . "/" . $id . "/" . $album_id), $one_child->type);
$child_tag->id = $one_child->id;
$child_tag->view_count = $one_child->view_count;
$child_tag->owner = identity::lookup_user($one_child->owner_id);
if ($one_child->has_thumb()) {
$child_tag->set_thumb($one_child->thumb_url(), $one_child->thumb_width, $one_child->thumb_height);
}
@ -326,6 +439,7 @@ class tag_albums_Controller extends Controller {
// Set up breadcrumbs for the page.
$tag_album_breadcrumbs = Array();
$parent_url = "";
if ($album_id != "") {
$counter = 0;
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($display_tag->name, "");
@ -333,27 +447,39 @@ class tag_albums_Controller extends Controller {
if ($album_tags[0]->tags != "*") {
$parent_item = ORM::factory("item", $parent_item->parent_id);
}
$parent_url = $parent_item->url(); // Used by Grey Dragon.
while ($parent_item->id != 1) {
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, $parent_item->url());
$parent_item = ORM::factory("item", $parent_item->parent_id);
}
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, $parent_item->url());
if ((module::get_var("tag_albums", "tag_index_scope", "false")) && (module::get_var("tag_albums", "tag_index", "default") != "default")) {
$tag_album_breadcrumbs[1]->url = url::site("tag_albums/album/" . $album_id);
} else {
$tag_album_breadcrumbs[1]->url = url::site("tag_albums/album/" . $album_id) . "?show=" . $id;
}
$tag_album_breadcrumbs = array_reverse($tag_album_breadcrumbs, true);
} else {
$parent_url = url::site("tag_albums/");
$tag_album_breadcrumbs[0] = new Tag_Albums_Breadcrumb(item::root()->title, item::root()->url());
$tag_album_breadcrumbs[1] = new Tag_Albums_Breadcrumb("All Tags", url::site("tag_albums/"));
if (module::get_var("tag_albums", "tag_index", "default") == "default") {
$tag_album_breadcrumbs[1] = new Tag_Albums_Breadcrumb(module::get_var("tag_albums", "tag_page_title", "All Tags"), url::site("tag_albums/") . "?show=" . $id);
} else {
$tag_album_breadcrumbs[1] = new Tag_Albums_Breadcrumb(module::get_var("tag_albums", "tag_page_title", "All Tags"), url::site("tag_albums/"));
}
$tag_album_breadcrumbs[2] = new Tag_Albums_Breadcrumb($display_tag->name, "");
}
// Set up and display the actual page.
$template = new Theme_View("page.html", "collection", "Tag Albums");
$template = new Theme_View("calpage.html", "collection", "Tag Albums");
$template->page_title = $display_tag->name;
$template->set_global("page", $page);
$template->set_global("page_size", $page_size);
$template->set_global("max_pages", $max_pages);
$template->set_global("children", $children);
$template->set_global("children_count", $count);
$template->content = new View("tag_albums.html");
$template->set_global("parent_url", $parent_url); // Used by Grey Dragon.
$template->content = new View("tag_albums_album.html");
$template->content->title = $display_tag->name;
$template->set_global("breadcrumbs", $tag_album_breadcrumbs);
print $template;
@ -375,6 +501,7 @@ class tag_albums_Controller extends Controller {
$display_tag = ORM::factory("tag", $tag_id);
$item = ORM::factory("item", $item_id);
access::required("view", $item);
$parent_url = "";
// Figure out sort order from module preferences.
$sort_page_field = "";
@ -394,19 +521,21 @@ class tag_albums_Controller extends Controller {
$previous_item = "";
$next_item = "";
$position = 0;
$dynamic_siblings = "";
if ($tag_id > 0) {
$sibling_count = $this->_count_records(Array($tag_id), "OR", false);
$position = $this->_get_position($item->$sort_page_field, $item->id, Array($tag_id), "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type);
$position = $this->_get_position($item->$sort_page_field, $item->id, Array($tag_id), "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
if ($position > 1) {
$previous_item_object = $this->_get_records(Array($tag_id), 1, $position-2, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
if (count($previous_item_object) > 0) {
$previous_item = new Tag_Albums_Item($previous_item_object[0]->name, url::site("tag_albums/show/" . $previous_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $previous_item_object[0]->type);
$previous_item = new Tag_Albums_Item($previous_item_object[0]->title, url::site("tag_albums/show/" . $previous_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $previous_item_object[0]->type);
}
}
$next_item_object = $this->_get_records(Array($tag_id), 1, $position, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
if (count($next_item_object) > 0) {
$next_item = new Tag_Albums_Item($next_item_object[0]->name, url::site("tag_albums/show/" . $next_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $next_item_object[0]->type);
$next_item = new Tag_Albums_Item($next_item_object[0]->title, url::site("tag_albums/show/" . $next_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $next_item_object[0]->type);
}
$dynamic_siblings = $this->_get_records(Array($tag_id), null, null, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
} else {
$tag_ids = Array();
foreach (explode(",", $album_tags[0]->tags) as $tag_name) {
@ -417,17 +546,18 @@ class tag_albums_Controller extends Controller {
}
$album_tags_search_type = $album_tags[0]->search_type;
$sibling_count = $this->_count_records($tag_ids, $album_tags_search_type, false);
$position = $this->_get_position($item->$sort_page_field, $item->id, $tag_ids, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type);
$position = $this->_get_position($item->$sort_page_field, $item->id, $tag_ids, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
if ($position > 1) {
$previous_item_object = $this->_get_records($tag_ids, 1, $position-2, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
if (count($previous_item_object) > 0) {
$previous_item = new Tag_Albums_Item($previous_item_object[0]->name, url::site("tag_albums/show/" . $previous_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $previous_item_object[0]->type);
$previous_item = new Tag_Albums_Item($previous_item_object[0]->title, url::site("tag_albums/show/" . $previous_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $previous_item_object[0]->type);
}
}
$next_item_object = $this->_get_records($tag_ids, 1, $position, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
if (count($next_item_object) > 0) {
$next_item = new Tag_Albums_Item($next_item_object[0]->name, url::site("tag_albums/show/" . $next_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $next_item_object[0]->type);
$next_item = new Tag_Albums_Item($next_item_object[0]->title, url::site("tag_albums/show/" . $next_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $next_item_object[0]->type);
}
$dynamic_siblings = $this->_get_records($tag_ids, null, null, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
}
// Set up breadcrumbs
@ -439,45 +569,67 @@ class tag_albums_Controller extends Controller {
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($display_tag->name, url::site("tag_albums/tag/" . $display_tag->id . "/" . $album_id));
}
$parent_item = ORM::factory("item", $album_tags[0]->album_id);
if ($album_tags[0]->tags == "*") {
$parent_url = url::site("tag_albums/tag/" . $display_tag->id . "/" . $album_id);
} else {
$parent_url = $parent_item->url();
}
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, url::site("tag_albums/album/" . $album_id));
$parent_item = ORM::factory("item", $parent_item->parent_id);
while ($parent_item->id != 1) {
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, $parent_item->url());
$parent_item = ORM::factory("item", $parent_item->parent_id);
}
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, $parent_item->url());
$tag_album_breadcrumbs[1]->url .= "?show=" . $item->id;
$tag_album_breadcrumbs = array_reverse($tag_album_breadcrumbs, true);
} else {
$tag_album_breadcrumbs[0] = new Tag_Albums_Breadcrumb(item::root()->title, item::root()->url());
$tag_album_breadcrumbs[1] = new Tag_Albums_Breadcrumb("All Tags", url::site("tag_albums/"));
$tag_album_breadcrumbs[2] = new Tag_Albums_Breadcrumb($display_tag->name, url::site("tag_albums/tag/" . $display_tag->id));
$tag_album_breadcrumbs[1] = new Tag_Albums_Breadcrumb(module::get_var("tag_albums", "tag_page_title", "All Tags"), url::site("tag_albums/"));
$tag_album_breadcrumbs[2] = new Tag_Albums_Breadcrumb($display_tag->name, url::site("tag_albums/tag/" . $display_tag->id) . "?show=" . $item->id);
$tag_album_breadcrumbs[3] = new Tag_Albums_Breadcrumb($item->title, "");
$parent_url = url::site("tag_albums/tag/" . $display_tag->id);
}
// Increase the items view count.
$item->increment_view_count();
// Load the page.
if ($item->is_photo()) {
$template = new Theme_View("page.html", "item", "photo");
$template = new Theme_View("calpage.html", "item", "photo");
$template->page_title = $item->title;
$template->set_global("children", Array());
$template->set_global("item", $item);
$template->set_global("previous_item", $previous_item);
$template->set_global("next_item", $next_item);
$template->set_global("is_tagalbum_page", true); // used for grey dragon
$template->set_global("tag_id", $tag_id); // used for grey dragon
$template->set_global("album_id", $album_id); // used for grey dragon
$template->set_global("parent_url", $parent_url); // Used by Grey Dragon.
$template->set_global("dynamic_siblings", $dynamic_siblings); // Used by Grey Dragon.
$template->set_global("children_count", 0);
$template->set_global("position", $position);
$template->set_global("sibling_count", $sibling_count);
$template->content = new View("tag_albums_photo.html");
$template->content = new View("photo.html");
$template->content->title = $item->title;
$template->set_global("breadcrumbs", $tag_album_breadcrumbs);
print $template;
} elseif ($item->is_movie()) {
$template = new Theme_View("page.html", "item", "movie");
$template = new Theme_View("calpage.html", "item", "movie");
$template->page_title = $item->title;
$template->set_global("children", Array());
$template->set_global("item", $item);
$template->set_global("previous_item", $previous_item);
$template->set_global("next_item", $next_item);
$template->set_global("is_tagalbum_page", true); // used for grey dragon
$template->set_global("tag_id", $tag_id); // used for grey dragon
$template->set_global("album_id", $album_id); // used for grey dragon
$template->set_global("parent_url", $parent_url); // Used by Grey Dragon.
$template->set_global("dynamic_siblings", $dynamic_siblings); // Used by Grey Dragon.
$template->set_global("children_count", 0);
$template->set_global("position", $position);
$template->set_global("sibling_count", $sibling_count);
$template->content = new View("tag_albums_movie.html");
$template->content = new View("movie.html");
$template->content->title = $item->title;
$template->set_global("breadcrumbs", $tag_album_breadcrumbs);
print $template;
@ -487,7 +639,7 @@ class tag_albums_Controller extends Controller {
}
}
private function _get_position($item_title, $item_id, $tag_ids, $sort_field, $sort_direction, $search_type) {
private function _get_position($item_title, $item_id, $tag_ids, $sort_field, $sort_direction, $search_type, $include_albums) {
// Determine an item's position within a virtual album.
// Convert ASC/DESC to < or > characters.
@ -514,7 +666,9 @@ class tag_albums_Controller extends Controller {
$counter++;
}
$items_model->close();
$items_model->and_where("items.type", "!=", "album");
if ($include_albums == false) {
$items_model->and_where("items.type", "!=", "album");
}
$items_model->and_where($sort_field, $comp, $item_title);
$items_model->order_by($sort_field, $sort_direction);
$items_model->group_by("items.id");
@ -543,7 +697,9 @@ class tag_albums_Controller extends Controller {
$counter++;
}
$items_model->close();
$items_model->and_where("items.type", "!=", "album");
if ($include_albums == false) {
$items_model->and_where("items.type", "!=", "album");
}
$items_model->and_where($sort_field, "=", $item_title);
$items_model->order_by($sort_field, $sort_direction);
$items_model->group_by("items.id");
@ -570,6 +726,10 @@ class tag_albums_Controller extends Controller {
// higher then they should be. So instead, I'm manually selecting each column that I need.
$items_model->select("items.id");
$items_model->select("items.name");
$items_model->select("items.title");
$items_model->select("items.view_count");
$items_model->select("items.owner_id");
$items_model->select("items.rand_key");
$items_model->select("items.type");
$items_model->select("items.thumb_width");
$items_model->select("items.thumb_height");
@ -599,6 +759,41 @@ class tag_albums_Controller extends Controller {
return $items_model->find_all($page_size, $offset);
}
private function _get_filter_html($album_id, $str_filter) {
// Generate HTML to display filter links on the index page.
// Make sure $album_id is set.
if ($album_id == "") {
$album_id = 0;
}
// Generate the links.
$str_html = "Filter: ";
if ($str_filter != "") {
if ($album_id > 0) {
$str_html .= "<a href=\"" . url::site("tag_albums/album/" . $album_id) . "\">(All)</a> ";
} else {
$str_html .= "<a href=\"" . url::site("tag_albums/") . "\">(All)</a> ";
}
}
if ($str_filter == "NUM") {
$str_html .= "# ";
} else {
$str_html .= "<a href=\"" . url::site("tag_albums/filter/" . $album_id . "/NUM") . "\">#</a> ";
}
foreach(range('A','Z') as $letter) {
if ($letter == $str_filter) {
$str_html .= $letter . " ";
} else {
$str_html .= "<a href=\"" . url::site("tag_albums/filter/" . $album_id . "/" . $letter) . "\">";
$str_html .= $letter . "</a> ";
}
}
// Return the HTML.
return $str_html;
}
private function _count_records($tag_ids, $search_type, $include_albums) {
// Count the number of viewable items for the designated tag(s)
// and return that number.

View File

@ -34,11 +34,23 @@ class tag_albums_installer {
module::set_var("tag_albums", "tag_sort_direction", "ASC");
module::set_var("tag_albums", "subalbum_sort_by", "title");
module::set_var("tag_albums", "subalbum_sort_direction", "ASC");
module::set_var("tag_albums", "tag_index", "default");
module::set_var("tag_albums", "tag_index_scope", "0");
module::set_var("tag_albums", "tag_index_filter", "0");
// Set the module's version number.
module::set_version("tag_albums", 1);
module::set_version("tag_albums", 2);
}
static function upgrade($version) {
if ($version == 1) {
module::set_var("tag_albums", "tag_index", "default");
module::set_var("tag_albums", "tag_index_scope", "0");
module::set_var("tag_albums", "tag_index_filter", "0");
module::set_version("tag_albums", 2);
}
}
static function deactivate() {
site_status::clear("tag_albums_needs_tag");
}

View File

@ -25,6 +25,9 @@ class Tag_Albums_Item_Core {
public $thumb_width = 0;
public $thumb_height = 0;
public $item_type = "";
public $type = "";
public $view_count = 0;
public $owner;
public function is_album() {
if ($this->item_type == "album") {
@ -106,5 +109,6 @@ class Tag_Albums_Item_Core {
$this->title = $new_title;
$this->url = $new_url;
$this->item_type = $new_type;
$this->type = $new_type;
}
}

View File

@ -1,6 +1,6 @@
name = "Tag Albums"
description = "Creates dynamic albums based on tags."
version = 1
version = 2
author_name = "rWatcher"
author_url = "http://codex.gallery2.org/User:RWatcher"
info_url = "http://codex.gallery2.org/Gallery3:Modules:tag_albums"

View File

@ -0,0 +1,164 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<!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>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<? $theme->start_combining("script,css") ?>
<title>
<? if ($page_title): ?>
<?= $page_title ?>
<? else: ?>
<? if ($theme->item()): ?>
<?= $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 ?>
<? endif ?>
<? endif ?>
</title>
<link rel="shortcut icon"
href="<?= url::file(module::get_var("gallery", "favicon_url")) ?>"
type="image/x-icon" />
<? if ($theme->page_type == "collection"): ?>
<? if ($thumb_proportion != 1): ?>
<? $new_width = round($thumb_proportion * 213) ?>
<? $new_height = round($thumb_proportion * 240) ?>
<style type="text/css">
.g-view #g-content #g-album-grid .g-item {
width: <?= $new_width ?>px;
height: <?= $new_height ?>px;
/* <?= $thumb_proportion ?> */
}
</style>
<? endif ?>
<? endif ?>
<?= $theme->script("json2-min.js") ?>
<?= $theme->script("jquery.js") ?>
<?= $theme->script("jquery.form.js") ?>
<?= $theme->script("jquery-ui.js") ?>
<?= $theme->script("gallery.common.js") ?>
<? /* MSG_CANCEL is required by gallery.dialog.js */ ?>
<script type="text/javascript">
var MSG_CANCEL = <?= t('Cancel')->for_js() ?>;
</script>
<?= $theme->script("gallery.ajax.js") ?>
<?= $theme->script("gallery.dialog.js") ?>
<?= $theme->script("superfish/js/superfish.js") ?>
<?= $theme->script("jquery.localscroll.js") ?>
<? /* 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") ?>
<? elseif ($theme->page_subtype == "movie"): ?>
<?= $theme->script("flowplayer.js") ?>
<? 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 lte IE 8]>
<link rel="stylesheet" type="text/css" href="<?= $theme->url("css/fix-ie.css") ?>"
media="screen,print,projection" />
<![endif]-->
<!-- LOOKING FOR YOUR JAVASCRIPT? It's all been combined into the link below -->
<?= $theme->get_combined("script") ?>
<!-- LOOKING FOR YOUR CSS? It's all been combined into the link below -->
<?= $theme->get_combined("css") ?>
</head>
<body <?= $theme->body_attributes() ?>>
<?= $theme->page_top() ?>
<div id="doc4" class="yui-t5 g-view">
<?= $theme->site_status() ?>
<div id="g-header" class="ui-helper-clearfix">
<div id="g-banner">
<? if ($header_text = module::get_var("gallery", "header_text")): ?>
<?= $header_text ?>
<? else: ?>
<a id="g-logo" class="g-left" href="<?= item::root()->url() ?>" title="<?= t("go back to the Gallery home")->for_html_attr() ?>">
<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>
<? endif ?>
<?= $theme->user_menu() ?>
<?= $theme->header_top() ?>
<!-- hide the menu until after the page has loaded, to minimize menu flicker -->
<div id="g-site-menu" style="visibility: hidden">
<?= $theme->site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?>
</div>
<script type="text/javascript"> $(document).ready(function() { $("#g-site-menu").css("visibility", "visible"); }) </script>
<?= $theme->header_bottom() ?>
</div>
<? // The following code was modifed to allow module-defined breadcrumbs.
// Everything else in this file is a copy of the default page.html.php file.
?>
<? if (!empty($breadcrumbs)): ?>
<ul class="g-breadcrumbs">
<? $i = 0 ?>
<? foreach ($breadcrumbs as $breadcrumb): ?>
<li<? if ($i == 0) print " class=\"g-first\"" ?>>
<!-- Adding ?show=<id> causes Gallery3 to display the page
containing that photo. For now, we just do it for
the immediate parent so that when you go back up a
level you're on the right page. -->
<? if ($breadcrumb->url) : ?>
<a href="<?= $breadcrumb->url ?>"><?= html::purify($breadcrumb->title) ?></a>
<? else : ?>
<?= html::purify($breadcrumb->title) ?>
<? endif ?>
</li>
<? $i++ ?>
<? endforeach ?>
</ul>
<? endif ?>
<? // End modified code ?>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div id="g-content" class="yui-g">
<?= $theme->messages() ?>
<?= $content ?>
</div>
</div>
</div>
<div id="g-sidebar" class="yui-b">
<? if ($theme->page_subtype != "login"): ?>
<?= new View("sidebar.html") ?>
<? endif ?>
</div>
</div>
<div id="g-footer" class="ui-helper-clearfix">
<?= $theme->footer() ?>
<? if ($footer_text = module::get_var("gallery", "footer_text")): ?>
<?= $footer_text ?>
<? endif ?>
<? if (module::get_var("gallery", "show_credits")): ?>
<ul id="g-credits" class="g-inline">
<?= $theme->credits() ?>
</ul>
<? endif ?>
</div>
</div>
<?= $theme->page_bottom() ?>
</body>
</html>

View File

@ -1,37 +1,23 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="g-header" class="ui-helper-clearfix">
<? // The following code was modifed to allow module-defined breadcrumbs.
// Everything else in this file is a copy of the default page.html.php file.
?>
<? if (!empty($breadcrumbs)): ?>
<ul class="g-breadcrumbs">
<? $i = 0 ?>
<? foreach ($breadcrumbs as $breadcrumb): ?>
<li<? if ($i == 0) print " class=\"g-first\"" ?>>
<!-- Adding ?show=<id> causes Gallery3 to display the page
containing that photo. For now, we just do it for
the immediate parent so that when you go back up a
level you're on the right page. -->
<? if ($breadcrumb->url) : ?>
<a href="<?= $breadcrumb->url ?>"><?= html::purify($breadcrumb->title) ?></a>
<? else : ?>
<?= html::purify($breadcrumb->title) ?>
<? endif ?>
</li>
<? $i++ ?>
<? endforeach ?>
</ul>
<? endif ?>
<? // End modified code ?>
</div>
<?
// The g-info block was taken from album.html.php and $theme->album_top() was changed to $theme->dynamic_top().
// $item->title and $item->description have been changed to $title and $description.
//
// The g-album-grid block was also taken from album.html.php. The section for uploading new photos to an empty album
// has been removed. Also, $theme->context_menu has been removed as well (it was crashing the page).
?>
<div id="g-info">
<?= $theme->dynamic_top() ?>
<?= $theme->dynamic_top() ?>
<h1><?= html::purify($title) ?></h1>
<div class="g-description"><?= nl2br(html::purify($description)) ?></div>
</div>
<? if (isset($filter_text) && (module::get_var("tag_albums", "tag_index_filter"))): ?>
<div id="g-tags-filter">
<br/ >
<center><?= $filter_text; ?></center>
</div>
<? endif ?>
<ul id="g-album-grid" class="ui-helper-clearfix">
<? if (count($children)): ?>

View File

@ -1,44 +0,0 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="g-header" class="ui-helper-clearfix">
<? // The following code was modifed to allow module-defined breadcrumbs.
// Everything else in this file is a copy of the default page.html.php file.
?>
<? if (!empty($breadcrumbs)): ?>
<ul class="g-breadcrumbs">
<? $i = 0 ?>
<? foreach ($breadcrumbs as $breadcrumb): ?>
<li<? if ($i == 0) print " class=\"g-first\"" ?>>
<!-- Adding ?show=<id> causes Gallery3 to display the page
containing that photo. For now, we just do it for
the immediate parent so that when you go back up a
level you're on the right page. -->
<? if ($breadcrumb->url) : ?>
<a href="<?= $breadcrumb->url ?>"><?= html::purify($breadcrumb->title) ?></a>
<? else : ?>
<?= html::purify($breadcrumb->title) ?>
<? endif ?>
</li>
<? $i++ ?>
<? endforeach ?>
</ul>
<? endif ?>
<? // End modified code ?>
</div>
<div id="g-item">
<?= $theme->photo_top() ?>
<?= $theme->paginator() ?>
<div id="g-movie" class="ui-helper-clearfix">
<?= $theme->resize_top($item) ?>
<?= $item->movie_img(array("class" => "g-movie", "id" => "g-item-id-{$item->id}")) ?>
<?= $theme->resize_bottom($item) ?>
</div>
<div id="g-info">
<h1><?= html::purify($item->title) ?></h1>
<div><?= nl2br(html::purify($item->description)) ?></div>
</div>
<?= $theme->photo_bottom() ?>
</div>

View File

@ -1,75 +0,0 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="g-header" class="ui-helper-clearfix">
<? // The following code was modifed to allow module-defined breadcrumbs.
// Everything else in this file is a copy of the default page.html.php file.
?>
<? if (!empty($breadcrumbs)): ?>
<ul class="g-breadcrumbs">
<? $i = 0 ?>
<? foreach ($breadcrumbs as $breadcrumb): ?>
<li<? if ($i == 0) print " class=\"g-first\"" ?>>
<!-- Adding ?show=<id> causes Gallery3 to display the page
containing that photo. For now, we just do it for
the immediate parent so that when you go back up a
level you're on the right page. -->
<? if ($breadcrumb->url) : ?>
<a href="<?= $breadcrumb->url ?>"><?= html::purify($breadcrumb->title) ?></a>
<? else : ?>
<?= html::purify($breadcrumb->title) ?>
<? endif ?>
</li>
<? $i++ ?>
<? endforeach ?>
</ul>
<? endif ?>
<? // End modified code ?>
</div>
<? if (access::can("view_full", $item)): ?>
<!-- Use javascript to show the full size as an overlay on the current page -->
<script type="text/javascript">
$(document).ready(function() {
full_dims = [<?= $theme->item()->width ?>, <?= $theme->item()->height ?>];
$(".g-fullsize-link").click(function() {
$.gallery_show_full_size(<?= html::js_string($theme->item()->file_url()) ?>, full_dims[0], full_dims[1]);
return false;
});
// After the image is rotated or replaced we have to reload the image dimensions
// so that the full size view isn't distorted.
$("#g-photo").bind("gallery.change", function() {
$.ajax({
url: "<?= url::site("items/dimensions/" . $theme->item()->id) ?>",
dataType: "json",
success: function(data, textStatus) {
full_dims = data.full;
}
});
});
});
</script>
<? endif ?>
<div id="g-item">
<?= $theme->photo_top() ?>
<?= $theme->paginator() ?>
<div id="g-photo">
<?= $theme->resize_top($item) ?>
<? if (access::can("view_full", $item)): ?>
<a href="<?= $item->file_url() ?>" class="g-fullsize-link" title="<?= t("View full size")->for_html_attr() ?>">
<? endif ?>
<?= $item->resize_img(array("id" => "g-item-id-{$item->id}", "class" => "g-resize")) ?>
<? if (access::can("view_full", $item)): ?>
</a>
<? endif ?>
<?= $theme->resize_bottom($item) ?>
</div>
<div id="g-info">
<h1><?= html::purify($item->title) ?></h1>
<div><?= nl2br(html::purify($item->description)) ?></div>
</div>
<?= $theme->photo_bottom() ?>
</div>

View File

@ -0,0 +1,40 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2011 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class tag_cloud_page_event_Core {
static function module_change($changes) {
// See if the Tags module is installed,
// tell the user to install it if it isn't.
if (!module::is_active("tag") || in_array("tag", $changes->deactivate)) {
site_status::warning(
t("The Tag Cloud Page module requires the Tags module. " .
"<a href=\"%url\">Activate the Tags module now</a>",
array("url" => url::site("admin/modules"))),
"tag_cloud_page_needs_tag");
} else {
site_status::clear("tag_cloud_page_needs_tag");
}
}
static function pre_deactivate($data) {
if ($data->module == "tag") {
$data->messages["warn"][] = t("The Tag Cloud Page module requires the Tags module.");
}
}
}

View File

@ -0,0 +1,32 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2011 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class tag_cloud_page_installer {
static function deactivate() {
site_status::clear("tag_cloud_page_needs_tag");
}
static function can_activate() {
$messages = array();
if (!module::is_active("tag")) {
$messages["warn"][] = t("The Tag Cloud Page module requires the Tags module.");
}
return $messages;
}
}

View File

@ -65,6 +65,14 @@ class exif_gps_installer {
site_status::clear("exif_gps_needs_exif");
}
static function can_activate() {
$messages = array();
if (!module::is_active("exif")) {
$messages["warn"][] = t("The EXIF_GPS module requires the EXIF module.");
}
return $messages;
}
static function uninstall() {
// Delete the GPS table before uninstalling.
$db = Database::instance();

View File

@ -0,0 +1,199 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<!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>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<? $theme->start_combining("script,css") ?>
<title>
<? if ($page_title): ?>
<?= $page_title ?>
<? else: ?>
<? if ($theme->item()): ?>
<?= $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 ?>
<? endif ?>
<? endif ?>
</title>
<link rel="shortcut icon"
href="<?= url::file(module::get_var("gallery", "favicon_url")) ?>"
type="image/x-icon" />
<? if ($theme->page_type == "collection"): ?>
<? if ($thumb_proportion != 1): ?>
<? $new_width = round($thumb_proportion * 213) ?>
<? $new_height = round($thumb_proportion * 240) ?>
<style type="text/css">
.g-view #g-content #g-album-grid .g-item {
width: <?= $new_width ?>px;
height: <?= $new_height ?>px;
/* <?= $thumb_proportion ?> */
}
</style>
<? endif ?>
<? endif ?>
<?= $theme->script("json2-min.js") ?>
<?= $theme->script("jquery.js") ?>
<?= $theme->script("jquery.form.js") ?>
<?= $theme->script("jquery-ui.js") ?>
<?= $theme->script("gallery.common.js") ?>
<? /* MSG_CANCEL is required by gallery.dialog.js */ ?>
<script type="text/javascript">
var MSG_CANCEL = <?= t('Cancel')->for_js() ?>;
</script>
<?= $theme->script("gallery.ajax.js") ?>
<?= $theme->script("gallery.dialog.js") ?>
<?= $theme->script("superfish/js/superfish.js") ?>
<?= $theme->script("jquery.localscroll.js") ?>
<? /* 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") ?>
<? elseif ($theme->page_subtype == "movie"): ?>
<?= $theme->script("flowplayer.js") ?>
<? 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") ?>
<? if (module::get_var("theme_clean_canvas", "color_variant") == "dark" ): ?>
<?= $theme->css("dark/themeroller/ui.base.css") ?>
<?= $theme->css("dark/screen_colors.css") ?>
<?= $theme->css("dark/screen_candy.css") ?>
<? else: ?>
<?= $theme->css("clean/themeroller/ui.base.css") ?>
<?= $theme->css("clean/screen_colors.css") ?>
<?= $theme->css("clean/screen_candy.css") ?>
<? endif ?>
<?= $theme->css("screen_layout_base.css") ?>
<?= $theme->css("screen_fonts.css") ?>
<? if (module::get_var("theme_clean_canvas", "wide")): ?>
<?= $theme->css("screen_layout_wide.css") ?>
<? else: ?>
<?= $theme->css("screen_layout_fixed.css") ?>
<? endif ?>
<!--[if lte IE 8]>
<link rel="stylesheet" type="text/css" href="<?= $theme->url("css/fix-ie.css") ?>"
media="screen,print,projection" />
<![endif]-->
<!-- LOOKING FOR YOUR JAVASCRIPT? It's all been combined into the link below -->
<?= $theme->get_combined("script") ?>
<!-- LOOKING FOR YOUR CSS? It's all been combined into the link below -->
<?= $theme->get_combined("css") ?>
</head>
<body <?= $theme->body_attributes() ?>>
<?= $theme->page_top() ?>
<? if (module::get_var("theme_clean_canvas", "wide")): ?>
<div id="doc3" class="yui-t5 g-view">
<? else: ?>
<div id="doc4" class="yui-t5 g-view">
<? endif ?>
<?= $theme->site_status() ?>
<div id="g-header" class="ui-helper-clearfix">
<div id="g-banner">
<? if ($header_text = module::get_var("gallery", "header_text")): ?>
<?= $header_text ?>
<? else: ?>
<a id="g-logo" class="g-left" href="<?= item::root()->url() ?>" title="<?= t("go back to the Gallery home")->for_html_attr() ?>">
<img width="128" height="44" alt="<?= t("Gallery logo: Your photos on your web site")->for_html_attr() ?>" src="<?= $theme->url("images/canvaslogo.png") ?>" />
</a>
<? endif ?>
<?= $theme->user_menu() ?>
<?= $theme->header_top() ?>
<div id="g-banner-languages">
<? $locales = locales::installed(); ?>
<? if (count($locales) > 1 ) { ?>
<? foreach ($locales as $locale => $display_name) { ?>
<? $locales[$locale] = SafeString::of_safe_html($display_name); ?>
<? } ?>
<? $lang_content = new View("user_languages_block.html"); ?>
<? $lang_content->installed_locales = array_merge(array("" => t("« none »")), $locales); ?>
<? $lang_content->selected = (string) locales::cookie_locale(); ?>
<?= $lang_content ?>
<? } ?>
</div>
<!-- hide the menu until after the page has loaded, to minimize menu flicker -->
<div id="g-site-menu" style="visibility: hidden">
<?= $theme->site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?>
</div>
<script type="text/javascript"> $(document).ready(function() { $("#g-site-menu").css("visibility", "visible"); }) </script>
<?= $theme->header_bottom() ?>
</div>
<? // The following code was modifed to allow module-defined breadcrumbs.
// Everything else in this file is a copy of the default page.html.php file.
?>
<? if (!empty($breadcrumbs)): ?>
<ul class="g-breadcrumbs">
<? $i = 0 ?>
<? foreach ($breadcrumbs as $breadcrumb): ?>
<li<? if ($i == 0) print " class=\"g-first\"" ?>>
<!-- Adding ?show=<id> causes Gallery3 to display the page
containing that photo. For now, we just do it for
the immediate parent so that when you go back up a
level you're on the right page. -->
<? if ($breadcrumb->url) : ?>
<a href="<?= $breadcrumb->url ?>"><?= html::purify($breadcrumb->title) ?></a>
<? else : ?>
<?= html::purify($breadcrumb->title) ?>
<? endif ?>
</li>
<? $i++ ?>
<? endforeach ?>
</ul>
<? endif ?>
<? // End modified code ?>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div id="g-content" class="yui-g">
<?= $theme->messages() ?>
<?= $content ?>
</div>
</div>
</div>
<? if (!($theme->item() && !empty($parents))): ?>
<style type="text/css">
/* No breadcrums, position adaption for sidebar needed */
#g-sidebar
{
top: 6px;
}
</style>
<? endif ?>
<div id="g-sidebar" class="yui-b">
<? if ($theme->page_subtype != "login"): ?>
<?= new View("sidebar.html") ?>
<? endif ?>
</div>
</div>
<div id="g-footer" class="ui-helper-clearfix">
<?= $theme->footer() ?>
<? if ($footer_text = module::get_var("gallery", "footer_text")): ?>
<?= $footer_text ?>
<? endif ?>
<? if (module::get_var("gallery", "show_credits")): ?>
<ul id="g-credits" class="g-inline">
<?= $theme->credits() ?>
</ul>
<? endif ?>
</div>
</div>
<?= $theme->page_bottom() ?>
</body>
</html>

View File

@ -0,0 +1,297 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Grey Dragon Theme - a custom theme for Gallery 3
* This theme was designed and built by Serguei Dosyukov, whose blog you will find at http://blog.dragonsoft.us
* Copyright (C) 2009-2011 Serguei Dosyukov
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General
* Public License as published by the Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<? $theme->load_sessioninfo(); ?>
<!-- <?= $theme->themename ?> v.<?= $theme->themeversion ?> (ColorPack: <?= $theme->colorpack ?>) - Copyright (c) 2009-2011 Serguei Dosyukov - All Rights Reserved -->
<html xmlns="http://www.w3.org/1999/xhtml" <?= $theme->html_attributes() ?> xml:lang="en" lang="en" <?= ($theme->is_rtl)? "dir=rtl" : null; ?> >
<?
$item = $theme->item();
if (($theme->enable_pagecache) and (isset($item))):
// Page will expire in 60 seconds
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 60).'GMT');
header("Cache-Control: public");
header("Cache-Control: post-check=3600, pre-check=43200", false);
header("Content-Type: text/html; charset=UTF-8");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
endif;
?>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<? $theme->start_combining("script,css") ?>
<? if ($page_title): ?>
<? $_title = $page_title ?>
<? else: ?>
<? if ($theme->item()): ?>
<? $_title = $theme->bb2html($theme->item()->title, 2); ?>
<? elseif ($theme->tag()): ?>
<? $_title = t("Photos tagged with %tag_title", array("tag_title" => $theme->bb2html($theme->tag()->name, 2))) ?>
<? else: /* Not an item, not a tag, no page_title specified. Help! */ ?>
<? $_title = $theme->bb2html(item::root()->title, 2); ?>
<? endif ?>
<? endif ?>
<title><?= $_title ?></title>
<? if ($theme->disable_seosupport): ?>
<meta name="robots" content="noindex, nofollow, noarchive" />
<meta name="googlebot" content="noindex, nofollow, noarchive, nosnippet, noodp, noimageindex, notranslate" />
<meta name="slurp" content="noindex, nofollow, noarchive, nosnippet, noodp, noydir" />
<meta name="msnbot" content="noindex, nofollow, noarchive, nosnippet, noodp" />
<meta name="teoma" content="noindex, nofollow, noarchive" />
<? endif; ?>
<? if ($theme->blendpagetrans): ?>
<meta http-equiv="Page-Enter" content="blendTrans(Duration=0.5)" />
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0.5)" />
<? endif; ?>
<!-- Internet Explorer 9 Meta tags : Start -->
<meta name="application-name" content="<?= $_title; ?>" />
<meta name="msapplication-tooltip" content="<?= t("Start"); ?> <?= $_title; ?>" />
<meta name="msapplication-starturl" content="<?= item::root()->url() ?>" />
<? if ($theme->allow_root_page): ?>
<meta name="msapplication-task" content="name=<?= t("Gallery") ?>: <?= t("Root Page") ?>; action-uri=<?= item::root()->url(); ?>?root=yes; icon-uri=favicon.ico" />
<meta name="msapplication-task" content="name=<?= t("Gallery") ?>: <?= t("Root Album") ?>; action-uri=<?= item::root()->url(); ?>?root=no; icon-uri=favicon.ico" />
<? else: ?>
<meta name="msapplication-task" content="name=<?= t("Gallery") ?>: <?= t("Root Album") ?>; action-uri=<?= item::root()->url(); ?>; icon-uri=favicon.ico" />
<? endif; ?>
<? if (identity::active_user()->admin): ?>
<meta name="msapplication-task-separator" content="gallery3-greydragon" />
<meta name="msapplication-task" content="name=<?= t("Admin") ?>: <?= t("Dashboard") ?>; action-uri=<?= url::site("admin"); ?>; icon-uri=favicon.ico" />
<? endif; ?>
<!-- Internet Explorer 9 Meta tags : End -->
<link rel="shortcut icon" href="<?= $theme->favicon ?>" type="image/x-icon" />
<? if ($theme->appletouchicon): ?>
<link rel="apple-touch-icon" href="<?= $theme->appletouchicon; ?>"/>
<? endif; ?>
<?= $theme->script("json2-min.js") ?>
<?= $theme->script("jquery.js") ?>
<?= $theme->script("jquery.form.js") ?>
<?= $theme->script("jquery-ui.js") ?>
<?= $theme->script("gallery.common.js") ?>
<? /* MSG_CANCEL is required by gallery.dialog.js */ ?>
<script type="text/javascript">
var MSG_CANCEL = <?= t('Cancel')->for_js() ?>;
</script>
<?= $theme->script("gallery.ajax.js"); ?>
<?= $theme->script("gallery.dialog.js"); ?>
<? /* These are page specific but they get combined */ ?>
<? if ($theme->page_subtype == "photo"): ?>
<?= $theme->script("jquery.scrollTo.js"); ?>
<? elseif ($theme->page_subtype == "movie"): ?>
<?= $theme->script("flowplayer.js") ?>
<? endif ?>
<?= $theme->head() ?>
<? /* Theme specific CSS/JS goes last so that it can override module CSS/JS */ ?>
<?= $theme->script("animation.js"); ?>
<?= $theme->script("ui.support.js"); ?>
<?= $theme->theme_css_inject(); ?>
<!-- LOOKING FOR YOUR CSS? It's all been combined into the link below -->
<?= $theme->get_combined("css"); ?>
<?= $theme->css_link("colorpacks/" . $theme->colorpack . "/colors.css", FALSE); ?>
<?= $theme->css_link("framepacks/" . $theme->framepack . "/frame.css", FALSE); ?>
<? if ($theme->custom_css_path != ""): ?>
<?= $theme->css_link($theme->custom_css_path, TRUE); ?>
<? endif; ?>
<!-- LOOKING FOR YOUR JAVASCRIPT? It's all been combined into the link below -->
<?= $theme->get_combined("script") ?>
<!--[if IE 6]>
<link rel="stylesheet" href="<?= $theme->url("css/old_ie.css") ?>" type="text/css" media="screen,print,projection" />
<![endif]-->
<? if ($theme->thumb_inpage): ?>
<style type="text/css"> #g-column-bottom #g-thumbnav-block, #g-column-top #g-thumbnav-block { display: none; } </style>
<? endif; ?>
</head>
<? if ($theme->item()): ?>
<? $item = $theme->item(); ?>
<? else: ?>
<? $item = item::root(); ?>
<? endif; ?>
<body <?= $theme->body_attributes() ?><?= ($theme->show_root_page)? ' id="g-rootpage"' : null; ?> <?= ($theme->is_rtl)? "class=\"rtl\"" : null; ?> >
<?= $theme->page_top() ?>
<?= $theme->site_status() ?>
<? if (((!$user->guest) or ($theme->show_guest_menu)) and ($theme->mainmenu_position == "bar")): ?>
<style type="text/css"> html { margin-top: 30px !important; } </style>
<div id="g-site-menu" class="g-<?= $theme->mainmenu_position; ?>">
<?= $theme->site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?>
</div>
<? endif ?>
<div id="g-header">
<?= $theme->header_top() ?>
<? if ($header_text = module::get_var("gallery", "header_text")): ?>
<span id="g-header-text"><?= $theme->bb2html($header_text, 1) ?></span>
<? else: ?>
<a id="g-logo" href="<?= item::root()->url() ?><?= ($theme->allow_root_page)? "?root=yes" : null; ?>" 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="<?= $theme->logopath ?>" />
</a>
<? endif ?>
<? if (((!$user->guest) or ($theme->show_guest_menu)) and ($theme->mainmenu_position != "bar")): ?>
<div id="g-site-menu" class="g-<?= $theme->mainmenu_position; ?>">
<?= $theme->site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?>
</div>
<? endif ?>
<?= $theme->messages() ?>
<?= $theme->header_bottom() ?>
<? if ($theme->loginmenu_position == "header"): ?>
<?= $theme->user_menu() ?>
<? endif ?>
<?
// Custom rWatcher code, based on the breadcrumb menu function.
// The rest of this file is the original page.html.php file from the Grey Dragon theme.
?>
<? if (empty($breadcrumbs)): ?>
<?= $theme->breadcrumb_menu($theme, null); ?>
<? else: ?>
<?
$breadcrumb_content = "";
if ($this->breadcrumbs_position == "hide"):
else:
$limit_title_length = module::get_var("gallery", "visible_title_length", 999);
$breadcrumb_content .= '<ul class="g-breadcrumbs g-' . module::get_var("th_greydragon", "breadcrumbs_position", "default") . '">';
$i = 0;
foreach ($breadcrumbs as $breadcrumb):
if ($breadcrumb->url):
$breadcrumb_content .= '<li ' . (($i == 0)? " class=\"g-first\"" : null) . '>';
$breadcrumb_content .= '<a href="' . $breadcrumb->url . '">';
$breadcrumb_content .= text::limit_chars($theme->bb2html(html::purify($breadcrumb->title), 2), $limit_title_length);
$breadcrumb_content .= '</a></li>';
else:
$breadcrumb_content .= '<li class="g-active ' . (($i == 0)? " g-first" : null) . '">' . text::limit_chars($theme->bb2html(html::purify($breadcrumb->title), 2), $limit_title_length) . '</li>';
endif;
$i++;
endforeach;
$breadcrumb_content .= '</ul>';
endif;
print $breadcrumb_content;
// End Edit.
?>
<? endif; ?>
<?= $theme->custom_header(); ?>
</div>
<? if (($theme->page_subtype != "login") and ($theme->page_subtype != "reauthenticate") and ($theme->sidebarvisible == "top")): ?>
<div id="g-column-top">
<?= new View("sidebar.html") ?>
</div>
<? endif; ?>
<div id="g-main">
<div id="g-main-in">
<? if (!$theme->show_root_page): ?>
<?= $theme->sidebar_menu($item->url()) ?>
<div id="g-view-menu" class="g-buttonset<?= ($theme->sidebarallowed != "any")? " g-buttonset-shift" : null; ?>">
<? if ($page_subtype == "album"): ?>
<?= $theme->album_menu() ?>
<? elseif ($page_subtype == "photo") : ?>
<?= $theme->photo_menu() ?>
<? elseif ($page_subtype == "movie") : ?>
<?= $theme->movie_menu() ?>
<? elseif ($page_subtype == "tag") : ?>
<?= $theme->tag_menu() ?>
<? endif ?>
</div>
<? endif; ?>
<? switch ($theme->sidebarvisible):
case "left":
echo '<div id="g-column-left">';
$closediv = TRUE;
break;
case "none":
case "top":
case "bottom":
if (($theme->thumb_inpage) and ($page_subtype == "photo")):
echo '<div id="g-column-right">';
$closediv = TRUE;
else:
$closediv = FALSE;
endif;
break;
default:
echo '<div id="g-column-right">';
$closediv = TRUE;
break;
endswitch; ?>
<? if (($theme->page_subtype != "login") and ($theme->page_subtype != "reauthenticate")): ?>
<? if (($theme->sidebarvisible == "none") or ($theme->sidebarvisible == "bottom") or ($theme->sidebarvisible == "top")): ?>
<? if (($theme->thumb_inpage) and ($page_subtype == "photo")): ?>
<?= '<div class="g-toolbar"><h1>&nbsp;</h1></div>'; ?>
<?= $theme->get_block_html("thumbnav"); ?>
<? endif; ?>
<? else: ?>
<?= new View("sidebar.html") ?>
<? endif; ?>
<? endif ?>
<?= ($closediv)? "</div>" : null; ?>
<? switch ($theme->sidebarvisible):
case "left":
echo '<div id="g-column-centerright">';
break;
case "none":
case "top":
case "bottom":
if (($theme->thumb_inpage) and ($page_subtype == "photo")):
echo '<div id="g-column-centerleft">';
else:
echo '<div id="g-column-centerfull">';
endif;
break;
default:
echo '<div id="g-column-centerleft">';
break;
endswitch;
if ($theme->show_root_page):
echo new View("rootpage.html");
else:
echo $content;
endif; ?>
</div>
</div>
</div>
<? if (($theme->page_subtype != "login") and ($theme->page_subtype != "reauthenticate") and ($theme->sidebarvisible == "bottom")): ?>
<div id="g-column-bottom">
<?= new View("sidebar.html") ?>
</div>
<? endif; ?>
<div id="g-footer">
<?= $theme->footer() ?>
<? if ($footer_text = module::get_var("gallery", "footer_text")): ?>
<span id="g-footer-text"><?= $theme->bb2html($footer_text, 1) ?></span>
<? endif ?>
<?= $theme->credits() ?>
<ul id="g-footer-rightside"><li><?= $theme->copyright ?></li></ul>
<? if ($theme->loginmenu_position == "default"): ?>
<?= $theme->user_menu() ?>
<? endif ?>
<?= $theme->custom_footer(); ?>
</div>
<?= $theme->page_bottom() ?>
</body>
</html>

View File

@ -0,0 +1,209 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Grey Dragon Theme - a custom theme for Gallery 3
* This theme was designed and built by Serguei Dosyukov, whose blog you will find at http://blog.dragonsoft.us
* Copyright (C) 2009-2011 Serguei Dosyukov
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General
* Public License as published by the Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
?>
<?
// This is a generic paginator for album, photo and movie pages. Depending on the page type,
// there are different sets of variables available. With this data, you can make a paginator
// that lets you say "You're viewing photo 5 of 35", or "You're viewing photos 10 - 18 of 37"
// for album views.
//
// Available variables for all page types:
// $page_type - "collection", "item", or "other"
// $page_subtype - "album", "movie", "photo", "tag", etc.
// $previous_page_url - the url to the previous page, if there is one
// $next_page_url - the url to the next page, if there is one
// $total - the total number of photos in this album
//
// Available for the "collection" page types:
// $page - what page number we're on
// $max_pages - the maximum page number
// $page_size - the page size
// $first_page_url - the url to the first page, or null if we're on the first page
// $last_page_url - the url to the last page, or null if we're on the last page
// $first_visible_position - the position number of the first visible photo on this page
// $last_visible_position - the position number of the last visible photo on this page
//
// Available for "item" page types:
// $position - the position number of this photo
//
?>
<?
$_pagelist = array();
// rWatcher Mod
if (isset($dynamic_siblings)):
$current_page = $position;
$total_pages = count($dynamic_siblings);
$siblings = $dynamic_siblings;
for ($i = 1; $i <= $total_pages; $i++):
if ($page_type == "item") {
$_pagelist[$i] = url::site("tag_albums/show/" . $siblings[$i-1]->id . "/" . $tag_id . "/" . $album_id);
} elseif ($page_type == "") {
}
endfor;
else:
// End rWatcher Mod.
switch ($page_type) {
case "collection":
if (isset($item)):
$parent = $item->parent();
endif;
$current_page = $page;
$total_pages = $max_pages;
// Prepare page url list
for ($i = 1; $i <= $total_pages; $i++):
$_pagelist[$i] = url::site(url::merge(array("page" => $i)));
endfor;
break;
case "item":
if (isset($item)):
$parent = $item->parent();
endif;
$current_page = $position;
$total_pages = $total;
if (isset($parent)):
$siblings = $parent->children();
for ($i = 1; $i <= $total; $i++):
$_pagelist[$i] = $siblings[$i-1]->url();
endfor;
endif;
break;
default:
$current_page = 1;
$total_pages = 1;
$_pagelist[1] = url::site();
break;
}
// rWatcher Mod
endif;
// End rWatcher Mod.
if ($total_pages <= 1):
$pagination_msg = "&nbsp;";
else:
$pagination_msg = t("Page:") . ' ';
if ($total_pages < 13):
for ($i = 1; $i <= $total_pages; $i++):
if ($i == $current_page):
$pagination_msg .= '<span>' . t($i) . '</span>';
else:
$pagination_msg .= '<span><a href="' . $_pagelist[$i] . '" title="' . t("Page") . ' ' . t($i) . '">' . t($i) . '</a></span>';
endif;
if ($i < $total_pages):
$pagination_msg .= '&middot;';
endif;
endfor;
elseif ($current_page < 9):
for ($i = 1; $i <= 10; $i++):
if ($i == $current_page):
$pagination_msg .= '<span>' . t($i) . '</span>';
else:
$pagination_msg .= '<span><a href="' . $_pagelist[$i] . '" title="' . t("Page") . ' ' . t($i) . '">' . t($i) . '</a></span>';
endif;
if ($i < 10):
$pagination_msg .= '&middot;';
endif;
endfor;
$pagination_msg .= '&hellip;';
$pagination_msg .= '<span><a href="' . $_pagelist[$total_pages - 1] . '" title="' . t("Page") . ' ' . t($total_pages - 1) . '">' . t($total_pages - 1) . '</a></span>';
$pagination_msg .= '&middot;';
$pagination_msg .= '<span><a href="' . $_pagelist[$total_pages] . '" title="' . t("Page") . ' ' . t($total_pages) . '">' . t($total_pages) . '</a></span>';
elseif ($current_page > $total_pages - 8):
$pagination_msg .= '<span><a href="' . $_pagelist[1] . '" title="' . t("Page") . ' ' . t(1) . '">' . t(1) . '</a></span>';
$pagination_msg .= '&middot;';
$pagination_msg .= '<span><a href="' . $_pagelist[2] . '" title="' . t("Page") . ' ' . t(2) . '">' . t(2) . '</a></span>';
$pagination_msg .= '&hellip;';
for ($i = $total_pages - 9; $i <= $total_pages; $i++):
if ($i == $current_page):
$pagination_msg .= '<span>' . t($i) . '</span>';
else:
$pagination_msg .= '<span><a href="' . $_pagelist[$i] . '" title="' . t("Page") . ' ' . t($i) . '">' . t($i) . '</a></span>';
endif;
if ($i < $total_pages):
$pagination_msg .= '&middot;';
endif;
endfor;
else:
$pagination_msg .= '<span><a href="' . $_pagelist[1] . '" title="' . t("Page") . ' ' . t(1) . '">' . t(1) . '</a></span>';
$pagination_msg .= '&middot;';
$pagination_msg .= '<span><a href="' . $_pagelist[2] . '" title="' . t("Page") . ' ' . t(2) . '">' . t(2) . '</a></span>';
$pagination_msg .= '&hellip;';
for ($i = $current_page - 5; $i <= $current_page + 5; $i++):
if ($i == $current_page):
$pagination_msg .= '<span>' . t($i) . '</span>';
else:
$pagination_msg .= '<span><a href="' . $_pagelist[$i] . '" title="' . t("Page") . ' ' . t($i) . '">' . t($i) . '</a></span>';
endif;
if ($i < $current_page + 5):
$pagination_msg .= '&middot;';
endif;
endfor;
$pagination_msg .= '&hellip;';
$pagination_msg .= '<span><a href="' . $_pagelist[$total_pages - 1] . '" title="' . t("Page") . ' ' . t($total_pages - 1) . '">' . t($total_pages - 1) . '</a></span>';
$pagination_msg .= '&middot;';
$pagination_msg .= '<span><a href="' . $_pagelist[$total_pages] . '" title="' . t("Page") . ' ' . t($total_pages) . '">' . t($total_pages) . '</a></span>';
endif;
endif;
?>
<ul class="g-paginator">
<li class="g-pagination"><?= $pagination_msg ?></li>
<li class="g-navigation">
<? if ($current_page > 1): ?>
<a title="<?= t("first") ?>" id="g-navi-first" href="<?= $_pagelist[1] ?>"><span class="ui-icon ui-icon-first">&nbsp;</span></a>
<? else: ?>
<span class="ui-icon ui-icon-first-d">&nbsp;</span>
<? endif ?>
<? if (isset($previous_page_url)): ?>
<a title="<?= t("previous") ?>" id="g-navi-prev" href="<?= $previous_page_url ?>"><span class="ui-icon ui-icon-prev">&nbsp;</span></a>
<? else: ?>
<span class="ui-icon ui-icon-prev-d">&nbsp;</span>
<? endif ?>
<? // rWatcher Mod. ?>
<? if (isset($parent_url)): ?>
<a title="<?= t("up") ?>" id="g-navi-parent" href="<?= $parent_url ?>"><span class="ui-icon ui-icon-parent">&nbsp;</span></a>
<? elseif (isset($parent)): ?>
<a title="<?= t("up") ?>" id="g-navi-parent" href="<?= $parent->url() ?>"><span class="ui-icon ui-icon-parent">&nbsp;</span></a>
<? else: ?>
<span class="ui-icon ui-icon-parent-d">&nbsp;</span>
<? endif ?>
<? // End rWatcher Mod. ?>
<? if (isset($next_page_url)): ?>
<a title="<?= t("next") ?>" class="ui-right" id="g-navi-next" href="<?= $next_page_url ?>"><span class="ui-icon ui-icon-next">&nbsp;</span></a>
<? else: ?>
<span class="ui-icon ui-icon-next-d">&nbsp;</span>
<? endif ?>
<? if ($current_page < $total_pages): ?>
<a title="<?= t("last") ?>" class="ui-right" id="g-navi-last" href="<?= $_pagelist[$total_pages] ?>"><span class="ui-icon ui-icon-last">&nbsp;</span></a>
<? else: ?>
<span class="ui-icon ui-icon-last-d">&nbsp;</span>
<? endif ?>
</li>
</ul>

View File

@ -0,0 +1,122 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Grey Dragon Theme - a custom theme for Gallery 3
* This theme was designed and built by Serguei Dosyukov, whose blog you will find at http://blog.dragonsoft.us
* Copyright (C) 2009-2011 Serguei Dosyukov
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General
* Public License as published by the Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
?>
<?
if ($theme->desc_allowbbcode):
$_description = $theme->bb2html($item->description, 1);
else:
$_description = nl2br(html::purify($item->description));
endif;
if ($theme->is_photometa_visible):
$_description .= '<ul class="g-metadata">' . $theme->thumb_info($item) . '</ul>';
endif;
switch ($theme->photo_popupbox):
case "preview":
$include_list = FALSE;
$include_single = TRUE;
break;
case "none":
$include_list = FALSE;
$include_single = FALSE;
break;
default:
$include_list = TRUE;
$include_single = TRUE;
break;
endswitch;
?>
<div id="g-item">
<? $_title = $theme->bb2html(html::purify($item->title), 1); ?>
<div id="g-info">
<h1><?= $_title ?></h1>
</div>
<?= $theme->add_paginator("top"); ?>
<?= $theme->photo_top() ?>
<? if (($theme->photo_descmode == "top") and ($_description)): ?>
<div id="g-info"><div class="g-description"><?= $_description ?></div></div>
<? endif; ?>
<div id="g-photo">
<?= $theme->resize_top($item) ?>
<? $_resizewidth = $item->resize_width;
// rWatcher Modification.
$siblings = "";
if (isset($dynamic_siblings)) {
$siblings = $dynamic_siblings;
} else {
$siblings = $item->parent()->children();
}
// End rWatcher Modification
?>
<div class="g-resize" style="margin-left: -<?= intval($_resizewidth / 2); ?>px; ">
<? $script = "<script type=\"text/javascript\">\n";
$script .= " if (document.images) {\n";
for ($i = 0; ($i <= count($siblings) - 1); $i++):
if ($siblings[$i]->rand_key == $item->rand_key): ?>
<a style="<?= ($siblings[$i]->rand_key == $item->rand_key)? "display: static;" : "display: none;"; ?>" title="<?= $theme->bb2html(html::purify($item->title), 2) ?>" <?= ($include_single)? "class=\"g-sb-preview\"" : "target=_blank;"; ?> <?= ($include_list)? "rel=\"g-preview\"" : null; ?> href="<?= (access::can("view_full", $item))? $item->file_url() : $item->resize_url(); ?>">
<?= $item->resize_img(array("id" => "g-photo-id-{$item->id}", "class" => "g-resize", "alt" => $_title)) ?>
</a>
<? if ($i < count($siblings) - 1):
$script .= " var image_preload_n = new Image();\n image_preload_n.src = \"" . $siblings[$i+1]->resize_url() . "\";\n";
endif;
if ($i > 0):
$script .= " var image_preload_p = new Image();\n image_preload_p.src = \"" . $siblings[$i-1]->resize_url() . "\";\n";
endif;
else:
if ($include_list): ?>
<? if (!$siblings[$i]->is_album()): ?>
<a title="<?= $theme->bb2html(html::purify($siblings[$i]->title), 2) ?>" class="g-sb-preview g-hide" rel="g-preview" href="<?= (access::can("view_full", $siblings[$i]))? $siblings[$i]->file_url() : $siblings[$i]->resize_url(); ?>">&nbsp;</a>
<? endif; ?>
<? endif; ?>
<? endif; ?>
<? endfor; ?>
<? $script .= " }\n</script>\n"; ?>
<? $_align = "";
if ($_description):
switch ($theme->photo_descmode):
case "overlay_top":
$_align = "g-align-top";
break;
case "overlay_bottom":
$_align = "g-align-bottom";
break;
default:
break;
endswitch;
endif; ?>
<? if ($_align): ?>
<span class="g-more <?= $_align ?>"><?= t("More") ?></span>
<div class="g-description <?= $_align; ?>" style="width: <?= $_resizewidth - 20; ?>px;" >
<strong><?= $_title ?></strong>
<?= $_description ?>
</div>
<? endif ?>
</div>
<?= $theme->resize_bottom($item) ?>
</div>
<? if (($theme->photo_descmode == "bottom") and ($_description)): ?>
<div id="g-info"><div class="g-description"><?= $_description ?></div></div>
<? endif; ?>
<?= $theme->add_paginator("bottom"); ?>
<?= $theme->photo_bottom() ?>
</div>
<?= $script ?>

View File

@ -0,0 +1,135 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<?
// The g-info block was taken from album.html.php and $theme->album_top() was changed to $theme->dynamic_top().
// $item->title and $item->description have been changed to $title and $description.
//
// The g-album-grid block was also taken from album.html.php. The section for uploading new photos to an empty album
// has been removed. Also, $theme->context_menu has been removed as well (it was crashing the page).
?>
<div id="g-album-header">
<?= $theme->dynamic_top() ?>
<h1><?= $theme->bb2html(html::purify($title), 1) ?></h1>
</div>
<?= $theme->add_paginator("top"); ?>
<? if (($theme->album_descmode == "top") and ($description)): ?>
<div id="g-info"><div class="g-description"><?= $theme->bb2html(html::purify($description), 1) ?></div></div>
<? endif; ?>
<? if (isset($filter_text) && (module::get_var("tag_albums", "tag_index_filter"))): ?>
<div id="g-tags-filter">
<br/ >
<center><?= $filter_text; ?></center>
</div>
<? endif ?>
<div class="g-album-grid-container">
<ul id="g-album-grid" class="<?= $theme->get_grid_column_class(); ?>">
<? if (count($children)): ?>
<? foreach ($children as $i => $child): ?>
<?
// This code is based on grey dragon's get_thumb_element function.
$thumb_item = $child;
$is_portrait = ($thumb_item->thumb_height > $thumb_item->thumb_width);
$item_class = $child->is_album() ? "g-album" : "g-photo";
$content = '<li id="g-item-id-' . $child->id . '" class="g-item ' . $item_class . ' ' . $theme->thumb_type;
if ($child->is_album()):
$_thumb_descmode = $theme->thumb_descmode_a;
else:
$_thumb_descmode = $theme->thumb_descmode;
endif;
$content .= ($_thumb_descmode == "bottom")? " g-expanded" : " g-default";
$content .= ($is_portrait)? " g-portrait" : " g-landscape";
$content .= '">' . $theme->thumb_top($child);
if ($theme->thumb_topalign):
$_shift = "";
else:
if (($theme->crop_factor == 1) and (!$is_portrait)):
$_shift = 'style="margin-top: ' . intval(($theme->_thumb_size_y - $thumb_item->thumb_height) / 2) . 'px;"';
else:
if (($theme->crop_factor > 0) and ($is_portrait)):
$_shift = 'style="margin-top: -' . intval(($thumb_item->thumb_height - $theme->_thumb_size_y) / 2) . 'px;"';
else:
$_shift = "";
endif;
endif;
endif;
// $ss = 'z-index: 22; opacity: 1; -ms-transform: rotate(' . (-15 + rand(0, 31)) . 'deg);'; style="' . $ss . '"
$content .= '<div class="g-thumbslide"><p class="g-thumbcrop">';
$content .= '<a '. $_shift . ' class="g-thumblink" href="' . $child->url() . '">';
if ($thumb_item->has_thumb()):
$content .= $thumb_item->thumb_img();
else:
$content .= '<img title="No Image" alt="No Image" src="' . $theme->url("images/missing-img.png") . '"/>';
endif;
$content .= '</a></p>';
if (($theme->thumb_metamode != "hide") and ($_thumb_descmode == "overlay_bottom")):
$_thumb_metamode = "merged";
else:
$_thumb_metamode = $theme->thumb_metamode;
endif;
if (($_thumb_descmode == "overlay") or ($_thumb_descmode == "overlay_top") or ($_thumb_descmode == "overlay_bottom")):
$content .= '<ul class="g-description ';
if ($_thumb_descmode == "overlay_top"):
$content .= 'g-overlay-top';
endif;
if ($_thumb_descmode == "overlay_bottom"):
$content .= 'g-overlay-bottom';
endif;
$content .= '"><li class="g-title">' . $theme->bb2html(html::purify($child->title), 2) . '</li>';
if ($_thumb_metamode == "merged"):
$content .= $theme->thumb_info($child);
endif;
$content .= '</ul>';
endif;
if (($_thumb_metamode == "default") and ($_thumb_descmode != "overlay_bottom")):
$content .= '<ul class="g-metadata">' . $theme->thumb_info($child) . '</ul>';
endif;
if ($_thumb_descmode == "bottom"):
$content .= '<ul class="g-description">';
$content .= '<li class="g-title">' . $theme->bb2html(html::purify($child->title), 2) . '</li>';
if ($_thumb_metamode == "merged"):
$content .= $theme->thumb_info($child);
endif;
$content .= '</ul>';
endif;
/*
if ($addcontext):
$_text = $this->context_menu($child, "#g-item-id-{$child->id} .g-thumbnail");
$content .= (stripos($_text, '<li>'))? $_text : null;
endif;
*/
$content .= '</div>';
$content .= $theme->thumb_bottom($child);
$content .= '</li>';
print $content;
// End rWatcher Edit.
?>
<? endforeach ?>
<? else: ?>
<li><?= t("There aren't any photos here yet!") ?></li>
<? endif; ?>
</ul>
</div>
<?= $theme->dynamic_bottom() ?>
<? if (($theme->album_descmode == "bottom") and ($description)): ?>
<div id="g-info"><div class="g-description"><?= $theme->bb2html(html::purify($description), 1) ?></div></div>
<? endif; ?>
<?= $theme->add_paginator("bottom"); ?>

View File

@ -36,6 +36,17 @@ class Admin_Tag_Albums_Controller extends Admin_Controller {
array("id" => "g-tag-albums-admin-form"));
$tag_albums_tagsort_group = $form->group("Tag_Albums_Tag_Sort")->label(t("\"All Tags\" Album Preferences"));
$tag_albums_tagsort_group->input("tag_page_title")
->label(t("Page Title"))
->value(module::get_var("tag_albums", "tag_page_title"));
$tag_albums_tagsort_group->dropdown("tag_index")
->label(t("Tag album's index should display:"))
->options(
array("default" => "(default) Individual Tag Albums",
"tagcloudpage" => "Tag Cloud Page Module",
"alltags" => "All Tags Module"))
->selected(module::get_var("tag_albums", "tag_index"));
$tag_albums_tagsort_group->dropdown("tag_sort_by")
->label(t("Sort \"All Tags\" Albums By:"))
->options(
@ -50,6 +61,14 @@ class Admin_Tag_Albums_Controller extends Admin_Controller {
"DESC" => "Descending"))
->selected(module::get_var("tag_albums", "tag_sort_direction"));
$tag_index_scope_options["tag_index_scope"] = Array(t("Use tag album index setting for \"*\" albums as well?"), module::get_var("tag_albums", "tag_index_scope"));
$tag_albums_tagsort_group->checklist("tag_index_scope")
->options($tag_index_scope_options);
$tag_index_filter_options["tag_index_filter"] = Array(t("Display filter links on \"All Tags\" album pages?"), module::get_var("tag_albums", "tag_index_filter"));
$tag_albums_tagsort_group->checklist("tag_index_filter")
->options($tag_index_filter_options);
$tag_albums_tagitemsort_group = $form->group("Tag_Albums_Tag_Item_Sort")->label(t("\"All Tags\" Sub-Album Preferences"));
$tag_albums_tagitemsort_group->dropdown("subalbum_sort_by")
->label(t("Sort Contents of Sub-Albums By:"))
@ -82,12 +101,16 @@ class Admin_Tag_Albums_Controller extends Admin_Controller {
$form = $this->_get_admin_form();
if ($form->validate()) {
Kohana_Log::add("error",print_r($form,1));
module::set_var("tag_albums", "tag_page_title", $form->Tag_Albums_Tag_Sort->tag_page_title->value);
module::set_var("tag_albums", "tag_index", $form->Tag_Albums_Tag_Sort->tag_index->value);
module::set_var("tag_albums", "tag_index_scope", count($form->Tag_Albums_Tag_Sort->tag_index_scope->value));
module::set_var("tag_albums", "tag_index_filter", count($form->Tag_Albums_Tag_Sort->tag_index_filter->value));
module::set_var("tag_albums", "tag_sort_by", $form->Tag_Albums_Tag_Sort->tag_sort_by->value);
module::set_var("tag_albums", "tag_sort_direction", $form->Tag_Albums_Tag_Sort->tag_sort_direction->value);
module::set_var("tag_albums", "subalbum_sort_by", $form->Tag_Albums_Tag_Item_Sort->subalbum_sort_by->value);
module::set_var("tag_albums", "subalbum_sort_direction", $form->Tag_Albums_Tag_Item_Sort->subalbum_sort_direction->value);
message::success(t("Your settings have been saved."));
url::redirect("admin/tag_albums");
}

View File

@ -34,7 +34,7 @@ class tag_albums_Controller extends Controller {
// If it does exist, and is set to *, load a list of all tags.
if ($album_tags[0]->tags == "*") {
$this->index($id);
$this->index($id, "");
} else {
// Otherwise, populate this page with the specified items.
@ -58,12 +58,23 @@ class tag_albums_Controller extends Controller {
}
$album_tags_search_type = $album_tags[0]->search_type;
// Figure out how many items are in this "virtual album"
$count = $this->_count_records($tag_ids, $album_tags_search_type, true);
// Figure out how many items to display on each page.
$page_size = module::get_var("gallery", "page_size", 9);
// If this page was reached from a breadcrumb, figure out what page to load from the show id.
$show = Input::instance()->get("show");
if ($show) {
$child = ORM::factory("item", $show);
$index = $this->_get_position($child->$sort_page_field, $child->id, $tag_ids, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, true);
if ($index) {
$page = ceil($index / $page_size);
url::redirect("tag_albums/album/" . $id . "?page=$page");
}
}
// Figure out how many items are in this "virtual album"
$count = $this->_count_records($tag_ids, $album_tags_search_type, true);
// Figure out which page # the visitor is on and
// don't allow the visitor to go below page 1.
$page = Input::instance()->get("page", 1);
@ -86,8 +97,10 @@ class tag_albums_Controller extends Controller {
$tag_children = $this->_get_records($tag_ids, $page_size, $offset, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, true);
$children = Array();
foreach ($tag_children as $one_child) {
$child_tag = new Tag_Albums_Item($one_child->name, url::site("tag_albums/show/" . $one_child->id . "/0/" . $id), $one_child->type);
$child_tag = new Tag_Albums_Item($one_child->title, url::site("tag_albums/show/" . $one_child->id . "/0/" . $id), $one_child->type);
$child_tag->id = $one_child->id;
$child_tag->view_count = $one_child->view_count;
$child_tag->owner = identity::lookup_user($one_child->owner_id);
if ($one_child->has_thumb()) {
$child_tag->set_thumb($one_child->thumb_url(), $one_child->thumb_width, $one_child->thumb_height);
}
@ -114,17 +127,20 @@ class tag_albums_Controller extends Controller {
$parent_item = ORM::factory("item", $parent_item->parent_id);
}
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, $parent_item->url());
$tag_album_breadcrumbs[1]->url .= "?show=" . $album->id;
$tag_album_breadcrumbs = array_reverse($tag_album_breadcrumbs, true);
// Set up and display the actual page.
$template = new Theme_View("page.html", "collection", "Tag Albums");
$parent_album = ORM::factory("item", $album->parent_id);
$template = new Theme_View("calpage.html", "collection", "Tag Albums");
$template->page_title = $page_title;
$template->set_global("page", $page);
$template->set_global("page_size", $page_size);
$template->set_global("max_pages", $max_pages);
$template->set_global("children", $children);
$template->set_global("children_count", $count);
$template->content = new View("tag_albums.html");
$template->set_global("parent_url", $parent_album->url()); // Used by Grey Dragon.
$template->content = new View("tag_albums_album.html");
$template->content->title = $page_title;
$template->content->description = $page_description;
$template->set_global("breadcrumbs", $tag_album_breadcrumbs);
@ -132,9 +148,27 @@ class tag_albums_Controller extends Controller {
}
}
public function index($id) {
public function filter($id, $filter) {
// Display the index page, but only show albums for
// tags whose name begins with $filter.
$this->index($id, $filter);
}
public function index($id, $filter) {
// Load a page containing sub-albums for each tag in the gallery.
// Check to see if the user has overridden default behavior, and act accordingly.
if ((module::get_var("tag_albums", "tag_index_scope", "false")) || ($id == "")) {
$tag_album_index_type = module::get_var("tag_albums", "tag_index", "default");
if (($tag_album_index_type == "tagcloudpage") && (module::is_active("tag_cloud_page"))) {
url::redirect("tag_cloud_page/");
return;
} elseif (($tag_album_index_type == "alltags") && (module::is_active("all_tags"))) {
url::redirect("all_tags/");
return;
}
}
// If an ID was specified, make sure it's valid.
$album_tags = ORM::factory("tags_album_id")
->where("id", "=", $id)
@ -146,7 +180,7 @@ class tag_albums_Controller extends Controller {
// Inherit permissions, title and description from the album that linked to this page,
// if available, if not use the root album and some default values.
$album = "";
$page_title = t("All Tags");
$page_title = module::get_var("tag_albums", "tag_page_title", "All Tags");
$page_description = "";
if ($id == "") {
$album = ORM::factory("item", 1);
@ -165,6 +199,40 @@ class tag_albums_Controller extends Controller {
// Figure out how many items to display on each page.
$page_size = module::get_var("gallery", "page_size", 9);
// If this page was reached from a breadcrumb, figure out what page to load from the show id.
$show = Input::instance()->get("show");
if ($show) {
$child = ORM::factory("tag", $show);
$comp = "";
if (!strcasecmp($sort_page_direction, "DESC")) {
$comp = ">";
} else {
$comp = "<";
}
$index = ORM::factory("tag")
->where($sort_page_field, $comp, $child->$sort_page_field)
->order_by("tags." . $sort_page_field, $sort_page_direction)
->count_all();
$tag_model = ORM::factory("tag")
->where($sort_page_field, "=", $child->$sort_page_field)
->order_by("tags." . $sort_page_field, $sort_page_direction)
->find_all();
foreach ($tag_model as $one_tag) {
$index++;
if ($one_tag->id == $show) {
break;
}
}
if ($index) {
$page = ceil($index / $page_size);
if ($id == "") {
url::redirect("tag_albums/?page=$page");
} else {
url::redirect("tag_albums/album/" . $id . "?page=$page");
}
}
}
// Figure out which page # the visitor is on and
// don't allow the visitor to go below page 1.
$page = Input::instance()->get("page", 1);
@ -177,8 +245,21 @@ class tag_albums_Controller extends Controller {
// Determine the total number of items,
// for page numbering purposes.
$all_tags_count = ORM::factory("tag")
->count_all();
$all_tags_count_model = ORM::factory("tag");
if ($filter != "") {
if ($filter == "NUM") {
$all_tags_count_model->open();
$all_tags_count_model->where("tags.name", "LIKE", "0%");
$counter = 1;
while ($counter < 10) {
$all_tags_count_model->or_where("tags.name", "LIKE", ($counter++) . "%");
}
$all_tags_count_model->close();
} else {
$all_tags_count_model->where("tags.name", "LIKE", $filter . "%");
}
}
$all_tags_count = $all_tags_count_model->count_all();
// Figure out what the highest page number is.
$max_pages = ceil($all_tags_count / $page_size);
@ -189,9 +270,22 @@ class tag_albums_Controller extends Controller {
}
// Figure out which items to display on this page.
$display_tags = ORM::factory("tag")
->order_by("tags." . $sort_page_field, $sort_page_direction)
->find_all($page_size, $offset);
$display_tags_model = ORM::factory("tag");
if ($filter != "") {
if ($filter == "NUM") {
$display_tags_model->open();
$display_tags_model->where("tags.name", "LIKE", "0%");
$counter = 1;
while ($counter < 10) {
$display_tags_model->or_where("tags.name", "LIKE", ($counter++) . "%");
}
$display_tags_model->close();
} else {
$display_tags_model->where("tags.name", "LIKE", $filter . "%");
}
}
$display_tags_model->order_by("tags." . $sort_page_field, $sort_page_direction);
$display_tags = $display_tags_model->find_all($page_size, $offset);
// Set up the previous and next page buttons.
if ($page > 1) {
@ -224,32 +318,38 @@ class tag_albums_Controller extends Controller {
// Set up breadcrumbs.
$tag_album_breadcrumbs = Array();
$parent_url = "";
if ($id != "") {
$counter = 0;
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($album->title, "");
$parent_item = ORM::factory("item", $album->parent_id);
$parent_url = $parent_item->url();
while ($parent_item->id != 1) {
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, $parent_item->url());
$parent_item = ORM::factory("item", $parent_item->parent_id);
}
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, $parent_item->url());
$tag_album_breadcrumbs[1]->url .= "?show=" . $album->id;
$tag_album_breadcrumbs = array_reverse($tag_album_breadcrumbs, true);
} else {
$parent_url = item::root()->url();
$tag_album_breadcrumbs[0] = new Tag_Albums_Breadcrumb(item::root()->title, item::root()->url());
$tag_album_breadcrumbs[1] = new Tag_Albums_Breadcrumb($page_title, "");
}
// Set up and display the actual page.
$template = new Theme_View("page.html", "collection", "Tag Albums");
$template = new Theme_View("calpage.html", "collection", "Tag Albums");
$template->page_title = $page_title;
$template->set_global("page", $page);
$template->set_global("page_size", $page_size);
$template->set_global("max_pages", $max_pages);
$template->set_global("children", $children);
$template->set_global("children_count", $all_tags_count);
$template->content = new View("tag_albums.html");
$template->set_global("parent_url", $parent_url); // Used by Grey Dragon.
$template->content = new View("tag_albums_album.html");
$template->content->title = $page_title;
$template->content->description = $page_description;
$template->content->filter_text = $this->_get_filter_html($id, $filter);
$template->set_global("breadcrumbs", $tag_album_breadcrumbs);
print $template;
}
@ -275,6 +375,17 @@ class tag_albums_Controller extends Controller {
// Figure out how many items to display on each page.
$page_size = module::get_var("gallery", "page_size", 9);
// If this page was reached from a breadcrumb, figure out what page to load from the show id.
$show = Input::instance()->get("show");
if ($show) {
$child = ORM::factory("item", $show);
$index = $this->_get_position($child->$sort_page_field, $child->id, Array($id), "items." . $sort_page_field, $sort_page_direction, "OR", true);
if ($index) {
$page = ceil($index / $page_size);
url::redirect("tag_albums/tag/" . $id . "/" . $album_id . "?page=$page");
}
}
// Figure out which page # the visitor is on and
// don't allow the visitor to go below page 1.
$page = Input::instance()->get("page", 1);
@ -303,8 +414,10 @@ class tag_albums_Controller extends Controller {
// Create an array of "fake" items to display on the page.
$children = Array();
foreach ($tag_children as $one_child) {
$child_tag = new Tag_Albums_Item($one_child->name, url::site("tag_albums/show/" . $one_child->id . "/" . $id . "/" . $album_id), $one_child->type);
$child_tag = new Tag_Albums_Item($one_child->title, url::site("tag_albums/show/" . $one_child->id . "/" . $id . "/" . $album_id), $one_child->type);
$child_tag->id = $one_child->id;
$child_tag->view_count = $one_child->view_count;
$child_tag->owner = identity::lookup_user($one_child->owner_id);
if ($one_child->has_thumb()) {
$child_tag->set_thumb($one_child->thumb_url(), $one_child->thumb_width, $one_child->thumb_height);
}
@ -326,6 +439,7 @@ class tag_albums_Controller extends Controller {
// Set up breadcrumbs for the page.
$tag_album_breadcrumbs = Array();
$parent_url = "";
if ($album_id != "") {
$counter = 0;
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($display_tag->name, "");
@ -333,27 +447,39 @@ class tag_albums_Controller extends Controller {
if ($album_tags[0]->tags != "*") {
$parent_item = ORM::factory("item", $parent_item->parent_id);
}
$parent_url = $parent_item->url(); // Used by Grey Dragon.
while ($parent_item->id != 1) {
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, $parent_item->url());
$parent_item = ORM::factory("item", $parent_item->parent_id);
}
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, $parent_item->url());
if ((module::get_var("tag_albums", "tag_index_scope", "false")) && (module::get_var("tag_albums", "tag_index", "default") != "default")) {
$tag_album_breadcrumbs[1]->url = url::site("tag_albums/album/" . $album_id);
} else {
$tag_album_breadcrumbs[1]->url = url::site("tag_albums/album/" . $album_id) . "?show=" . $id;
}
$tag_album_breadcrumbs = array_reverse($tag_album_breadcrumbs, true);
} else {
$parent_url = url::site("tag_albums/");
$tag_album_breadcrumbs[0] = new Tag_Albums_Breadcrumb(item::root()->title, item::root()->url());
$tag_album_breadcrumbs[1] = new Tag_Albums_Breadcrumb("All Tags", url::site("tag_albums/"));
if (module::get_var("tag_albums", "tag_index", "default") == "default") {
$tag_album_breadcrumbs[1] = new Tag_Albums_Breadcrumb(module::get_var("tag_albums", "tag_page_title", "All Tags"), url::site("tag_albums/") . "?show=" . $id);
} else {
$tag_album_breadcrumbs[1] = new Tag_Albums_Breadcrumb(module::get_var("tag_albums", "tag_page_title", "All Tags"), url::site("tag_albums/"));
}
$tag_album_breadcrumbs[2] = new Tag_Albums_Breadcrumb($display_tag->name, "");
}
// Set up and display the actual page.
$template = new Theme_View("page.html", "collection", "Tag Albums");
$template = new Theme_View("calpage.html", "collection", "Tag Albums");
$template->page_title = $display_tag->name;
$template->set_global("page", $page);
$template->set_global("page_size", $page_size);
$template->set_global("max_pages", $max_pages);
$template->set_global("children", $children);
$template->set_global("children_count", $count);
$template->content = new View("tag_albums.html");
$template->set_global("parent_url", $parent_url); // Used by Grey Dragon.
$template->content = new View("tag_albums_album.html");
$template->content->title = $display_tag->name;
$template->set_global("breadcrumbs", $tag_album_breadcrumbs);
print $template;
@ -375,6 +501,7 @@ class tag_albums_Controller extends Controller {
$display_tag = ORM::factory("tag", $tag_id);
$item = ORM::factory("item", $item_id);
access::required("view", $item);
$parent_url = "";
// Figure out sort order from module preferences.
$sort_page_field = "";
@ -394,19 +521,21 @@ class tag_albums_Controller extends Controller {
$previous_item = "";
$next_item = "";
$position = 0;
$dynamic_siblings = "";
if ($tag_id > 0) {
$sibling_count = $this->_count_records(Array($tag_id), "OR", false);
$position = $this->_get_position($item->$sort_page_field, $item->id, Array($tag_id), "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type);
$position = $this->_get_position($item->$sort_page_field, $item->id, Array($tag_id), "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
if ($position > 1) {
$previous_item_object = $this->_get_records(Array($tag_id), 1, $position-2, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
if (count($previous_item_object) > 0) {
$previous_item = new Tag_Albums_Item($previous_item_object[0]->name, url::site("tag_albums/show/" . $previous_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $previous_item_object[0]->type);
$previous_item = new Tag_Albums_Item($previous_item_object[0]->title, url::site("tag_albums/show/" . $previous_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $previous_item_object[0]->type);
}
}
$next_item_object = $this->_get_records(Array($tag_id), 1, $position, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
if (count($next_item_object) > 0) {
$next_item = new Tag_Albums_Item($next_item_object[0]->name, url::site("tag_albums/show/" . $next_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $next_item_object[0]->type);
$next_item = new Tag_Albums_Item($next_item_object[0]->title, url::site("tag_albums/show/" . $next_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $next_item_object[0]->type);
}
$dynamic_siblings = $this->_get_records(Array($tag_id), null, null, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
} else {
$tag_ids = Array();
foreach (explode(",", $album_tags[0]->tags) as $tag_name) {
@ -417,17 +546,18 @@ class tag_albums_Controller extends Controller {
}
$album_tags_search_type = $album_tags[0]->search_type;
$sibling_count = $this->_count_records($tag_ids, $album_tags_search_type, false);
$position = $this->_get_position($item->$sort_page_field, $item->id, $tag_ids, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type);
$position = $this->_get_position($item->$sort_page_field, $item->id, $tag_ids, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
if ($position > 1) {
$previous_item_object = $this->_get_records($tag_ids, 1, $position-2, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
if (count($previous_item_object) > 0) {
$previous_item = new Tag_Albums_Item($previous_item_object[0]->name, url::site("tag_albums/show/" . $previous_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $previous_item_object[0]->type);
$previous_item = new Tag_Albums_Item($previous_item_object[0]->title, url::site("tag_albums/show/" . $previous_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $previous_item_object[0]->type);
}
}
$next_item_object = $this->_get_records($tag_ids, 1, $position, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
if (count($next_item_object) > 0) {
$next_item = new Tag_Albums_Item($next_item_object[0]->name, url::site("tag_albums/show/" . $next_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $next_item_object[0]->type);
$next_item = new Tag_Albums_Item($next_item_object[0]->title, url::site("tag_albums/show/" . $next_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $next_item_object[0]->type);
}
$dynamic_siblings = $this->_get_records($tag_ids, null, null, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false);
}
// Set up breadcrumbs
@ -439,45 +569,67 @@ class tag_albums_Controller extends Controller {
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($display_tag->name, url::site("tag_albums/tag/" . $display_tag->id . "/" . $album_id));
}
$parent_item = ORM::factory("item", $album_tags[0]->album_id);
if ($album_tags[0]->tags == "*") {
$parent_url = url::site("tag_albums/tag/" . $display_tag->id . "/" . $album_id);
} else {
$parent_url = $parent_item->url();
}
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, url::site("tag_albums/album/" . $album_id));
$parent_item = ORM::factory("item", $parent_item->parent_id);
while ($parent_item->id != 1) {
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, $parent_item->url());
$parent_item = ORM::factory("item", $parent_item->parent_id);
}
$tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($parent_item->title, $parent_item->url());
$tag_album_breadcrumbs[1]->url .= "?show=" . $item->id;
$tag_album_breadcrumbs = array_reverse($tag_album_breadcrumbs, true);
} else {
$tag_album_breadcrumbs[0] = new Tag_Albums_Breadcrumb(item::root()->title, item::root()->url());
$tag_album_breadcrumbs[1] = new Tag_Albums_Breadcrumb("All Tags", url::site("tag_albums/"));
$tag_album_breadcrumbs[2] = new Tag_Albums_Breadcrumb($display_tag->name, url::site("tag_albums/tag/" . $display_tag->id));
$tag_album_breadcrumbs[1] = new Tag_Albums_Breadcrumb(module::get_var("tag_albums", "tag_page_title", "All Tags"), url::site("tag_albums/"));
$tag_album_breadcrumbs[2] = new Tag_Albums_Breadcrumb($display_tag->name, url::site("tag_albums/tag/" . $display_tag->id) . "?show=" . $item->id);
$tag_album_breadcrumbs[3] = new Tag_Albums_Breadcrumb($item->title, "");
$parent_url = url::site("tag_albums/tag/" . $display_tag->id);
}
// Increase the items view count.
$item->increment_view_count();
// Load the page.
if ($item->is_photo()) {
$template = new Theme_View("page.html", "item", "photo");
$template = new Theme_View("calpage.html", "item", "photo");
$template->page_title = $item->title;
$template->set_global("children", Array());
$template->set_global("item", $item);
$template->set_global("previous_item", $previous_item);
$template->set_global("next_item", $next_item);
$template->set_global("is_tagalbum_page", true); // used for grey dragon
$template->set_global("tag_id", $tag_id); // used for grey dragon
$template->set_global("album_id", $album_id); // used for grey dragon
$template->set_global("parent_url", $parent_url); // Used by Grey Dragon.
$template->set_global("dynamic_siblings", $dynamic_siblings); // Used by Grey Dragon.
$template->set_global("children_count", 0);
$template->set_global("position", $position);
$template->set_global("sibling_count", $sibling_count);
$template->content = new View("tag_albums_photo.html");
$template->content = new View("photo.html");
$template->content->title = $item->title;
$template->set_global("breadcrumbs", $tag_album_breadcrumbs);
print $template;
} elseif ($item->is_movie()) {
$template = new Theme_View("page.html", "item", "movie");
$template = new Theme_View("calpage.html", "item", "movie");
$template->page_title = $item->title;
$template->set_global("children", Array());
$template->set_global("item", $item);
$template->set_global("previous_item", $previous_item);
$template->set_global("next_item", $next_item);
$template->set_global("is_tagalbum_page", true); // used for grey dragon
$template->set_global("tag_id", $tag_id); // used for grey dragon
$template->set_global("album_id", $album_id); // used for grey dragon
$template->set_global("parent_url", $parent_url); // Used by Grey Dragon.
$template->set_global("dynamic_siblings", $dynamic_siblings); // Used by Grey Dragon.
$template->set_global("children_count", 0);
$template->set_global("position", $position);
$template->set_global("sibling_count", $sibling_count);
$template->content = new View("tag_albums_movie.html");
$template->content = new View("movie.html");
$template->content->title = $item->title;
$template->set_global("breadcrumbs", $tag_album_breadcrumbs);
print $template;
@ -487,7 +639,7 @@ class tag_albums_Controller extends Controller {
}
}
private function _get_position($item_title, $item_id, $tag_ids, $sort_field, $sort_direction, $search_type) {
private function _get_position($item_title, $item_id, $tag_ids, $sort_field, $sort_direction, $search_type, $include_albums) {
// Determine an item's position within a virtual album.
// Convert ASC/DESC to < or > characters.
@ -514,7 +666,9 @@ class tag_albums_Controller extends Controller {
$counter++;
}
$items_model->close();
$items_model->and_where("items.type", "!=", "album");
if ($include_albums == false) {
$items_model->and_where("items.type", "!=", "album");
}
$items_model->and_where($sort_field, $comp, $item_title);
$items_model->order_by($sort_field, $sort_direction);
$items_model->group_by("items.id");
@ -543,7 +697,9 @@ class tag_albums_Controller extends Controller {
$counter++;
}
$items_model->close();
$items_model->and_where("items.type", "!=", "album");
if ($include_albums == false) {
$items_model->and_where("items.type", "!=", "album");
}
$items_model->and_where($sort_field, "=", $item_title);
$items_model->order_by($sort_field, $sort_direction);
$items_model->group_by("items.id");
@ -570,6 +726,10 @@ class tag_albums_Controller extends Controller {
// higher then they should be. So instead, I'm manually selecting each column that I need.
$items_model->select("items.id");
$items_model->select("items.name");
$items_model->select("items.title");
$items_model->select("items.view_count");
$items_model->select("items.owner_id");
$items_model->select("items.rand_key");
$items_model->select("items.type");
$items_model->select("items.thumb_width");
$items_model->select("items.thumb_height");
@ -599,6 +759,41 @@ class tag_albums_Controller extends Controller {
return $items_model->find_all($page_size, $offset);
}
private function _get_filter_html($album_id, $str_filter) {
// Generate HTML to display filter links on the index page.
// Make sure $album_id is set.
if ($album_id == "") {
$album_id = 0;
}
// Generate the links.
$str_html = "Filter: ";
if ($str_filter != "") {
if ($album_id > 0) {
$str_html .= "<a href=\"" . url::site("tag_albums/album/" . $album_id) . "\">(All)</a> ";
} else {
$str_html .= "<a href=\"" . url::site("tag_albums/") . "\">(All)</a> ";
}
}
if ($str_filter == "NUM") {
$str_html .= "# ";
} else {
$str_html .= "<a href=\"" . url::site("tag_albums/filter/" . $album_id . "/NUM") . "\">#</a> ";
}
foreach(range('A','Z') as $letter) {
if ($letter == $str_filter) {
$str_html .= $letter . " ";
} else {
$str_html .= "<a href=\"" . url::site("tag_albums/filter/" . $album_id . "/" . $letter) . "\">";
$str_html .= $letter . "</a> ";
}
}
// Return the HTML.
return $str_html;
}
private function _count_records($tag_ids, $search_type, $include_albums) {
// Count the number of viewable items for the designated tag(s)
// and return that number.

View File

@ -34,11 +34,23 @@ class tag_albums_installer {
module::set_var("tag_albums", "tag_sort_direction", "ASC");
module::set_var("tag_albums", "subalbum_sort_by", "title");
module::set_var("tag_albums", "subalbum_sort_direction", "ASC");
module::set_var("tag_albums", "tag_index", "default");
module::set_var("tag_albums", "tag_index_scope", "0");
module::set_var("tag_albums", "tag_index_filter", "0");
// Set the module's version number.
module::set_version("tag_albums", 1);
module::set_version("tag_albums", 2);
}
static function upgrade($version) {
if ($version == 1) {
module::set_var("tag_albums", "tag_index", "default");
module::set_var("tag_albums", "tag_index_scope", "0");
module::set_var("tag_albums", "tag_index_filter", "0");
module::set_version("tag_albums", 2);
}
}
static function deactivate() {
site_status::clear("tag_albums_needs_tag");
}

View File

@ -25,6 +25,9 @@ class Tag_Albums_Item_Core {
public $thumb_width = 0;
public $thumb_height = 0;
public $item_type = "";
public $type = "";
public $view_count = 0;
public $owner;
public function is_album() {
if ($this->item_type == "album") {
@ -106,5 +109,6 @@ class Tag_Albums_Item_Core {
$this->title = $new_title;
$this->url = $new_url;
$this->item_type = $new_type;
$this->type = $new_type;
}
}

View File

@ -1,6 +1,6 @@
name = "Tag Albums"
description = "Creates dynamic albums based on tags."
version = 1
version = 2
author_name = "rWatcher"
author_url = "http://codex.gallery2.org/User:RWatcher"
info_url = "http://codex.gallery2.org/Gallery3:Modules:tag_albums"

View File

@ -0,0 +1,164 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<!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>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<? $theme->start_combining("script,css") ?>
<title>
<? if ($page_title): ?>
<?= $page_title ?>
<? else: ?>
<? if ($theme->item()): ?>
<?= $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 ?>
<? endif ?>
<? endif ?>
</title>
<link rel="shortcut icon"
href="<?= url::file(module::get_var("gallery", "favicon_url")) ?>"
type="image/x-icon" />
<? if ($theme->page_type == "collection"): ?>
<? if ($thumb_proportion != 1): ?>
<? $new_width = round($thumb_proportion * 213) ?>
<? $new_height = round($thumb_proportion * 240) ?>
<style type="text/css">
.g-view #g-content #g-album-grid .g-item {
width: <?= $new_width ?>px;
height: <?= $new_height ?>px;
/* <?= $thumb_proportion ?> */
}
</style>
<? endif ?>
<? endif ?>
<?= $theme->script("json2-min.js") ?>
<?= $theme->script("jquery.js") ?>
<?= $theme->script("jquery.form.js") ?>
<?= $theme->script("jquery-ui.js") ?>
<?= $theme->script("gallery.common.js") ?>
<? /* MSG_CANCEL is required by gallery.dialog.js */ ?>
<script type="text/javascript">
var MSG_CANCEL = <?= t('Cancel')->for_js() ?>;
</script>
<?= $theme->script("gallery.ajax.js") ?>
<?= $theme->script("gallery.dialog.js") ?>
<?= $theme->script("superfish/js/superfish.js") ?>
<?= $theme->script("jquery.localscroll.js") ?>
<? /* 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") ?>
<? elseif ($theme->page_subtype == "movie"): ?>
<?= $theme->script("flowplayer.js") ?>
<? 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 lte IE 8]>
<link rel="stylesheet" type="text/css" href="<?= $theme->url("css/fix-ie.css") ?>"
media="screen,print,projection" />
<![endif]-->
<!-- LOOKING FOR YOUR JAVASCRIPT? It's all been combined into the link below -->
<?= $theme->get_combined("script") ?>
<!-- LOOKING FOR YOUR CSS? It's all been combined into the link below -->
<?= $theme->get_combined("css") ?>
</head>
<body <?= $theme->body_attributes() ?>>
<?= $theme->page_top() ?>
<div id="doc4" class="yui-t5 g-view">
<?= $theme->site_status() ?>
<div id="g-header" class="ui-helper-clearfix">
<div id="g-banner">
<? if ($header_text = module::get_var("gallery", "header_text")): ?>
<?= $header_text ?>
<? else: ?>
<a id="g-logo" class="g-left" href="<?= item::root()->url() ?>" title="<?= t("go back to the Gallery home")->for_html_attr() ?>">
<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>
<? endif ?>
<?= $theme->user_menu() ?>
<?= $theme->header_top() ?>
<!-- hide the menu until after the page has loaded, to minimize menu flicker -->
<div id="g-site-menu" style="visibility: hidden">
<?= $theme->site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?>
</div>
<script type="text/javascript"> $(document).ready(function() { $("#g-site-menu").css("visibility", "visible"); }) </script>
<?= $theme->header_bottom() ?>
</div>
<? // The following code was modifed to allow module-defined breadcrumbs.
// Everything else in this file is a copy of the default page.html.php file.
?>
<? if (!empty($breadcrumbs)): ?>
<ul class="g-breadcrumbs">
<? $i = 0 ?>
<? foreach ($breadcrumbs as $breadcrumb): ?>
<li<? if ($i == 0) print " class=\"g-first\"" ?>>
<!-- Adding ?show=<id> causes Gallery3 to display the page
containing that photo. For now, we just do it for
the immediate parent so that when you go back up a
level you're on the right page. -->
<? if ($breadcrumb->url) : ?>
<a href="<?= $breadcrumb->url ?>"><?= html::purify($breadcrumb->title) ?></a>
<? else : ?>
<?= html::purify($breadcrumb->title) ?>
<? endif ?>
</li>
<? $i++ ?>
<? endforeach ?>
</ul>
<? endif ?>
<? // End modified code ?>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div id="g-content" class="yui-g">
<?= $theme->messages() ?>
<?= $content ?>
</div>
</div>
</div>
<div id="g-sidebar" class="yui-b">
<? if ($theme->page_subtype != "login"): ?>
<?= new View("sidebar.html") ?>
<? endif ?>
</div>
</div>
<div id="g-footer" class="ui-helper-clearfix">
<?= $theme->footer() ?>
<? if ($footer_text = module::get_var("gallery", "footer_text")): ?>
<?= $footer_text ?>
<? endif ?>
<? if (module::get_var("gallery", "show_credits")): ?>
<ul id="g-credits" class="g-inline">
<?= $theme->credits() ?>
</ul>
<? endif ?>
</div>
</div>
<?= $theme->page_bottom() ?>
</body>
</html>

View File

@ -1,37 +1,23 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="g-header" class="ui-helper-clearfix">
<? // The following code was modifed to allow module-defined breadcrumbs.
// Everything else in this file is a copy of the default page.html.php file.
?>
<? if (!empty($breadcrumbs)): ?>
<ul class="g-breadcrumbs">
<? $i = 0 ?>
<? foreach ($breadcrumbs as $breadcrumb): ?>
<li<? if ($i == 0) print " class=\"g-first\"" ?>>
<!-- Adding ?show=<id> causes Gallery3 to display the page
containing that photo. For now, we just do it for
the immediate parent so that when you go back up a
level you're on the right page. -->
<? if ($breadcrumb->url) : ?>
<a href="<?= $breadcrumb->url ?>"><?= html::purify($breadcrumb->title) ?></a>
<? else : ?>
<?= html::purify($breadcrumb->title) ?>
<? endif ?>
</li>
<? $i++ ?>
<? endforeach ?>
</ul>
<? endif ?>
<? // End modified code ?>
</div>
<?
// The g-info block was taken from album.html.php and $theme->album_top() was changed to $theme->dynamic_top().
// $item->title and $item->description have been changed to $title and $description.
//
// The g-album-grid block was also taken from album.html.php. The section for uploading new photos to an empty album
// has been removed. Also, $theme->context_menu has been removed as well (it was crashing the page).
?>
<div id="g-info">
<?= $theme->dynamic_top() ?>
<?= $theme->dynamic_top() ?>
<h1><?= html::purify($title) ?></h1>
<div class="g-description"><?= nl2br(html::purify($description)) ?></div>
</div>
<? if (isset($filter_text) && (module::get_var("tag_albums", "tag_index_filter"))): ?>
<div id="g-tags-filter">
<br/ >
<center><?= $filter_text; ?></center>
</div>
<? endif ?>
<ul id="g-album-grid" class="ui-helper-clearfix">
<? if (count($children)): ?>

View File

@ -1,44 +0,0 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="g-header" class="ui-helper-clearfix">
<? // The following code was modifed to allow module-defined breadcrumbs.
// Everything else in this file is a copy of the default page.html.php file.
?>
<? if (!empty($breadcrumbs)): ?>
<ul class="g-breadcrumbs">
<? $i = 0 ?>
<? foreach ($breadcrumbs as $breadcrumb): ?>
<li<? if ($i == 0) print " class=\"g-first\"" ?>>
<!-- Adding ?show=<id> causes Gallery3 to display the page
containing that photo. For now, we just do it for
the immediate parent so that when you go back up a
level you're on the right page. -->
<? if ($breadcrumb->url) : ?>
<a href="<?= $breadcrumb->url ?>"><?= html::purify($breadcrumb->title) ?></a>
<? else : ?>
<?= html::purify($breadcrumb->title) ?>
<? endif ?>
</li>
<? $i++ ?>
<? endforeach ?>
</ul>
<? endif ?>
<? // End modified code ?>
</div>
<div id="g-item">
<?= $theme->photo_top() ?>
<?= $theme->paginator() ?>
<div id="g-movie" class="ui-helper-clearfix">
<?= $theme->resize_top($item) ?>
<?= $item->movie_img(array("class" => "g-movie", "id" => "g-item-id-{$item->id}")) ?>
<?= $theme->resize_bottom($item) ?>
</div>
<div id="g-info">
<h1><?= html::purify($item->title) ?></h1>
<div><?= nl2br(html::purify($item->description)) ?></div>
</div>
<?= $theme->photo_bottom() ?>
</div>

View File

@ -1,75 +0,0 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="g-header" class="ui-helper-clearfix">
<? // The following code was modifed to allow module-defined breadcrumbs.
// Everything else in this file is a copy of the default page.html.php file.
?>
<? if (!empty($breadcrumbs)): ?>
<ul class="g-breadcrumbs">
<? $i = 0 ?>
<? foreach ($breadcrumbs as $breadcrumb): ?>
<li<? if ($i == 0) print " class=\"g-first\"" ?>>
<!-- Adding ?show=<id> causes Gallery3 to display the page
containing that photo. For now, we just do it for
the immediate parent so that when you go back up a
level you're on the right page. -->
<? if ($breadcrumb->url) : ?>
<a href="<?= $breadcrumb->url ?>"><?= html::purify($breadcrumb->title) ?></a>
<? else : ?>
<?= html::purify($breadcrumb->title) ?>
<? endif ?>
</li>
<? $i++ ?>
<? endforeach ?>
</ul>
<? endif ?>
<? // End modified code ?>
</div>
<? if (access::can("view_full", $item)): ?>
<!-- Use javascript to show the full size as an overlay on the current page -->
<script type="text/javascript">
$(document).ready(function() {
full_dims = [<?= $theme->item()->width ?>, <?= $theme->item()->height ?>];
$(".g-fullsize-link").click(function() {
$.gallery_show_full_size(<?= html::js_string($theme->item()->file_url()) ?>, full_dims[0], full_dims[1]);
return false;
});
// After the image is rotated or replaced we have to reload the image dimensions
// so that the full size view isn't distorted.
$("#g-photo").bind("gallery.change", function() {
$.ajax({
url: "<?= url::site("items/dimensions/" . $theme->item()->id) ?>",
dataType: "json",
success: function(data, textStatus) {
full_dims = data.full;
}
});
});
});
</script>
<? endif ?>
<div id="g-item">
<?= $theme->photo_top() ?>
<?= $theme->paginator() ?>
<div id="g-photo">
<?= $theme->resize_top($item) ?>
<? if (access::can("view_full", $item)): ?>
<a href="<?= $item->file_url() ?>" class="g-fullsize-link" title="<?= t("View full size")->for_html_attr() ?>">
<? endif ?>
<?= $item->resize_img(array("id" => "g-item-id-{$item->id}", "class" => "g-resize")) ?>
<? if (access::can("view_full", $item)): ?>
</a>
<? endif ?>
<?= $theme->resize_bottom($item) ?>
</div>
<div id="g-info">
<h1><?= html::purify($item->title) ?></h1>
<div><?= nl2br(html::purify($item->description)) ?></div>
</div>
<?= $theme->photo_bottom() ?>
</div>

View File

@ -0,0 +1,40 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2011 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class tag_cloud_page_event_Core {
static function module_change($changes) {
// See if the Tags module is installed,
// tell the user to install it if it isn't.
if (!module::is_active("tag") || in_array("tag", $changes->deactivate)) {
site_status::warning(
t("The Tag Cloud Page module requires the Tags module. " .
"<a href=\"%url\">Activate the Tags module now</a>",
array("url" => url::site("admin/modules"))),
"tag_cloud_page_needs_tag");
} else {
site_status::clear("tag_cloud_page_needs_tag");
}
}
static function pre_deactivate($data) {
if ($data->module == "tag") {
$data->messages["warn"][] = t("The Tag Cloud Page module requires the Tags module.");
}
}
}

View File

@ -0,0 +1,32 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2011 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class tag_cloud_page_installer {
static function deactivate() {
site_status::clear("tag_cloud_page_needs_tag");
}
static function can_activate() {
$messages = array();
if (!module::is_active("tag")) {
$messages["warn"][] = t("The Tag Cloud Page module requires the Tags module.");
}
return $messages;
}
}