diff options
32 files changed, 1240 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..283027db --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "modules/randimg"] + path = modules/randimg + url = gitosis@code.nkinka.de:randimg.git diff --git a/modules/album_block/helpers/album_block_block.php b/modules/album_block/helpers/album_block_block.php new file mode 100644 index 00000000..d469a0c7 --- /dev/null +++ b/modules/album_block/helpers/album_block_block.php @@ -0,0 +1,61 @@ +<?php defined("SYSPATH") or die("No direct script access."); +/** + * Gallery - a web based photo album viewer and editor + * Copyright (C) 2000-2009 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 album_block_block_Core { + static function get_site_list() { + return array("album_list" => t("Album list")); + } + + static function get($block_id, $theme) { + $block = ""; + switch ($block_id) { + case "album_list": + $block = new Block(); + $block->css_id = "g-album-block"; + $block->title = t("Album list"); + $block->content = new View("album_block_block.html"); + + //$items = ORM::factory("item") + // ->viewable() + // ->where("type ==", "album") + // ->find_all(5); + + $items = ORM::factory("item")->where(array("type" => "album", "id !=" => 1))->orderby("updated", "DESC")->find_all(); + //if ($items->count() == 0) { + // Try once more. If this fails, just ditch the block altogether + //$items = ORM::factory("item") + //->viewable() + // ->where("type !=", "album") + // ->where("rand_key >= ", $random) + // ->orderby(array("rand_key" => "DESC")) + // ->find_all(1); + //} + + if ($items->count() > 0) { + #$block->content->item = $items->current(); + $block->content->items = $items; + } else { + $block = ""; + } + break; + } + + return $block; + } +} diff --git a/modules/album_block/module.info b/modules/album_block/module.info new file mode 100644 index 00000000..0a93532d --- /dev/null +++ b/modules/album_block/module.info @@ -0,0 +1,3 @@ +name = "Album Block" +description = "Display a list of albums in the sidebar" +version = 1 diff --git a/modules/album_block/views/album_block_block.html.php b/modules/album_block/views/album_block_block.html.php new file mode 100644 index 00000000..81660263 --- /dev/null +++ b/modules/album_block/views/album_block_block.html.php @@ -0,0 +1,8 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<?php foreach ( $items as $item ) : ?> +<div> +<a href="/photos/index.php/<?php echo $item->slug ?>"> +<img alt="<?php echo $item->title ?>" src="/photos/var/thumbs/<?php echo $item->slug ?>/.album.jpg?m=<?php echo $item->updated ?>" class="g-thumbnail"/> +</a> +</div> +<?php endforeach ?> diff --git a/modules/latestupdates/controllers/latestupdates.php b/modules/latestupdates/controllers/latestupdates.php new file mode 100644 index 00000000..39f0df60 --- /dev/null +++ b/modules/latestupdates/controllers/latestupdates.php @@ -0,0 +1,112 @@ +<?php defined("SYSPATH") or die("No direct script access."); +/** + * Gallery - a web based photo album viewer and editor + * Copyright (C) 2000-2009 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 latestupdates_Controller extends Controller { + + public function albums($id) { + // Figure out how many items to display on each page. + $itemsPerPage = module::get_var("gallery", "page_size", 9); + + // 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); + if ($page < 1) { + $page = 1; + } + + // First item to display. + $offset = ($page - 1) * $itemsPerPage; + + // Determine the total number of items, + // for page numbering purposes. + $count = ORM::factory("item", $id) + ->viewable() + ->where("type", "!=", "album") + ->order_by("created", "DESC") + ->count_all(); + + // Figure out what the highest page number is. + $max_pages = ceil($count / $itemsPerPage); + + // Figure out which items to display on this page. + $children = ORM::factory("item", $id) + ->viewable() + ->where("type", "!=", "album") + ->order_by("created", "DESC") + ->find_all($itemsPerPage, $offset); + + // Set up and display the actual page. + $template = new Theme_View("page.html", "collection", "LatestUpdates"); + $template->page_title = t("Gallery :: Latest Updates"); + $template->set_global("page", $page); + $template->set_global("max_page", $max_page); + $template->set_global("page_size", $itemsPerPage); + $template->set_global("children", $children); + $template->set_global("children_count", $count); + $template->content = new View("dynamic.html"); + $template->content->title = t("Latest Updates"); + print $template; + } + + public function updates() { + // Figure out how many items to display on each page. + $itemsPerPage = module::get_var("gallery", "page_size", 9); + + // 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); + + if ($page < 1) { + $page = 1; + } + + // First item to display. + $offset = ($page - 1) * $itemsPerPage; + + // Determine the total number of items, + // for page numbering purposes. + $count = ORM::factory("item") + ->viewable() + ->where("type", "!=", "album") + ->count_all(); + + // Figure out what the highest page number is. + $max_pages = ceil($count / $itemsPerPage); + + // Figure out which items to display on this page. + $items = ORM::factory("item") + ->viewable() + ->where("type", "!=", "album") + ->order_by("created", "DESC") + ->find_all($itemsPerPage, $offset); + + // Set up and display the actual page. + $template = new Theme_View("page.html", "collection", "LatestUpdates"); + $template->page_title = t("Gallery :: Latest Updates"); + $template->set_global("page", $page); + $template->set_global("max_pages", $max_pages); + $template->set_global("page_size", $itemsPerPage); + $template->set_global("children", $items); + $template->set_global("children_count", $count); + $template->content = new View ("dynamic.html"); + $template->content->title = t("Latest Updates"); + print $template; + } + +} diff --git a/modules/latestupdates/helpers/latestupdates_block.php b/modules/latestupdates/helpers/latestupdates_block.php new file mode 100644 index 00000000..095ba06b --- /dev/null +++ b/modules/latestupdates/helpers/latestupdates_block.php @@ -0,0 +1,49 @@ +<?php defined("SYSPATH") or die("No direct script access."); +/** + * Gallery - a web based photo album viewer and editor + * Copyright (C) 2000-2009 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 latestupdates_block_Core { + static function get_site_list() { + return array("latestupdates" => t("Latest Updates")); + } + + static function get($block_id, $theme) { + $block = ""; + + if (!$theme->item()) { + return; + } + + switch ($block_id) { + case "latestupdates": + // Determine the ID# of the current album. + $albumID = $theme->item->is_album() ? $theme->item->id : $theme->item->parent_id; + + // Make a new sidebar block. + $block = new Block(); + $block->css_id = "g-latest-updates"; + $block->title = t("Latest Updates"); + $block->content = new View("latestupdates_block.html"); + $block->content->update_links = array( + "View newest photos" => url::site("latestupdates/updates"), + ); + break; + } + return $block; + } +} diff --git a/modules/latestupdates/module.info b/modules/latestupdates/module.info new file mode 100644 index 00000000..9f5d518d --- /dev/null +++ b/modules/latestupdates/module.info @@ -0,0 +1,3 @@ +name = "LatestUpdates" +description = "Display recently uploaded photos and videos." +version = 1 diff --git a/modules/latestupdates/views/latestupdates_block.html.php b/modules/latestupdates/views/latestupdates_block.html.php new file mode 100644 index 00000000..b1dd9074 --- /dev/null +++ b/modules/latestupdates/views/latestupdates_block.html.php @@ -0,0 +1,10 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<ul id="g-update-list"> +<? foreach($update_links as $title => $url): ?> + <li style="clear: both;"> + <a href="<?= $url ?>"> + <?= t($title) ?> + </a> + </li> +<? endforeach ?> +</ul> diff --git a/modules/randimg b/modules/randimg new file mode 160000 +Subproject 79f4038d0e05c57082e841ac36fc2559dd70ea7 diff --git a/themes/wind_npk/css/fix-ie.css b/themes/wind_npk/css/fix-ie.css new file mode 100644 index 00000000..376dac74 --- /dev/null +++ b/themes/wind_npk/css/fix-ie.css @@ -0,0 +1,29 @@ +/** + * Fix display in IE 6, 7 + */ + +#g-banner { + z-index: 2; +} + +input.submit { + clear: none !important; + display: inline !important; +} + +#g-add-tag-form input.textbox { + width: 110px; +} + +#g-dialog .g-cancel { + display: inline-block !important; + float: none !important; +} + +.g-paginator .g-text-right { + width: 29%; +} + +.g-paginator .ui-icon-right { + width: 60px; +} diff --git a/themes/wind_npk/css/screen.css b/themes/wind_npk/css/screen.css new file mode 100644 index 00000000..12fa695d --- /dev/null +++ b/themes/wind_npk/css/screen.css @@ -0,0 +1,449 @@ +/** + * Gallery 3 Wind Theme Screen Styles + * + * @requires YUI reset, font, grids CSS + * + * Sheet organization: + * 1) Font sizes, base HTML elements + * 2) Reusable content blocks + * 3) Page layout containers + * 4) Content blocks in specific layout containers + * 5) Navigation and menus + * 6) jQuery and jQuery UI + * 7) Right-to-left language styles + */ + +/** ******************************************************************* + * 1) Font sizes, base HTML elements + **********************************************************************/ + +body, html { + background-color: #ccc; + font-family: 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; +} + +p { + margin-bottom: 1em; +} + +em { + font-style: oblique; +} + +h1, h2, h3, h4, h5, strong, th { + font-weight: bold; +} + +h1 { + font-size: 1.7em; +} + +#g-dialog h1 { + font-size: 1.1em; +} + +h2 { + font-size: 1.4em; +} + +#g-sidebar .g-block h2 { + font-size: 1.2em; +} + +#g-sidebar .g-block li { + margin-bottom: .6em; +} + +#g-content, +#g-site-menu, +h3 { + font-size: 1.2em; +} + +#g-sidebar, +.g-breadcrumbs { + font-size: .9em; +} + +#g-banner, +#g-footer, +.g-message { + font-size: .8em; +} + +#g-album-grid .g-item, +#g-item #g-photo, +#g-item #g-movie { + font-size: .7em; +} + +/* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +a, +.g-menu a, +#g-dialog a, +.g-button, +.g-button:hover, +.g-button:active, +a.ui-state-hover, +input.ui-state-hover, +button.ui-state-hover { + color: #5382bf !important; + cursor: pointer !important; + text-decoration: none; + -moz-outline-style: none; +} + +a:hover, +#g-dialog a:hover { + text-decoration: underline; +} + +.g-menu a:hover { + text-decoration: none; +} + +#g-dialog #g-action-status li { + width: 400px; + white-space: normal; + padding-left: 32px; +} + +/* Tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +table { + width: 100%; +} + +#g-content table { + margin: 1em 0; +} + +caption, +th { + text-align: left; +} + +th, +td { + border: none; + border-bottom: 1px solid #ccc; + padding: .5em; +} + +td { + vertical-align: top; +} + +/** ******************************************************************* + * 2) Reusable content blocks + *********************************************************************/ + +.g-block h2 { + background-color: #e8e8e8; + padding: .3em .8em; +} + +.g-block-content { + margin-top: 1em; +} + +/*** ****************************************************************** + * 3) Page layout containers + *********************************************************************/ + +/* View container ~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.g-view { + background-color: #fff; + border: 1px solid #ccc; + border-bottom: none; +} + +/* Layout containers ~~~~~~~~~~~~~~~~~~~~~ */ + +#g-header { + margin-bottom: 1em; +} + +#g-banner { + background-color: #e8e8e8; + border-bottom: 1px solid #ccc; + min-height: 5em; + padding: 1em 20px; + position: relative; +} + +#g-content { + padding-left: 20px; + position: relative; + width: 696px; +} + +#g-sidebar { + padding: 0 20px; + width: 220px; +} + +#g-footer { + background-color: #e8e8e8; + border-top: 1px solid #ccc; + margin-top: 20px; + padding: 10px 20px; +} + +/** ******************************************************************* + * 4) Content blocks in specific layout containers + *********************************************************************/ + +/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-banner #g-quick-search-form { + clear: right; + float: right; + margin-top: 1em; +} + +#g-banner #g-quick-search-form input[type='text'] { + width: 17em; +} + +#g-content .g-block h2 { + background-color: transparent; + padding-left: 0; +} + +#g-sidebar .g-block-content { + padding-left: 1em; +} + +/* Album content ~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-content #g-album-grid { + margin: 1em 0; + position: relative; + z-index: 1; +} + +#g-content #g-album-grid .g-item { + background-color: #fff; + border: 1px solid #fff; + float: left; + padding: .6em 8px; + position: relative; + text-align: center; + width: 213px; + z-index: 1; +} + +#g-content #g-album-grid .g-item h2 { + margin: 5px 0; +} + +#g-content .g-photo h2, +#g-content .g-item .g-metadata { + display: none; + margin-bottom: .6em; +} + +#g-content #g-album-grid .g-album { + background-color: #e8e8e8; +} + +#g-content #g-album-grid .g-album h2 span.g-album { + background: transparent url('../images/ico-album.png') no-repeat top left; + display: inline-block; + height: 16px; + margin-right: 5px; + width: 16px; +} + +#g-content #g-album-grid .g-hover-item { + border: 1px solid #000; + position: absolute !important; + z-index: 1000 !important; +} + +#g-content .g-hover-item h2, +#g-content .g-hover-item .g-metadata { + display: block; +} + +#g-content #g-album-grid #g-place-holder { + position: relative; + visibility: hidden; + z-index: 1; +} + +/* Individual photo content ~~~~~~~~~~~~~~ */ + +#g-item { + position: relative; + width: 100%; +} + +#g-item #g-photo, +#g-item #g-movie { + padding: 2.2em 0; + position: relative; +} + +#g-item img.g-resize, +#g-item a.g-movie object { + display: block; + margin: 0 auto; +} + +/* Footer content ~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-footer #g-credits li { + padding-right: 1.2em; +} + +#g-content #g-search-results { + margin-top: 1em; + padding-top: 1em; +} + +/* In-line editing ~~~~~~~~~~~~~~~~~~~~~~ */ +#g-in-place-edit-message { + background-color: #FFF; +} + +/** ******************************************************************* + * 5) Navigation and menus + *********************************************************************/ + +/* Login menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-banner #g-login-menu { + color: #999; + float: right; +} + +#g-banner #g-login-menu li { + padding-left: 1.2em; +} + +/* Site Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-site-menu { + bottom: 0; + left: 140px; + position: absolute; +} + +#g-site-menu ul { + margin-bottom: 0 !important; +} + +/* Context Menu ~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.g-context-menu { + background-color: #fff; + bottom: 0; + left: 0; + position: absolute; +} + +.g-item .g-context-menu { + display: none; + margin-top: 2em; + width: 100%; +} + +#g-item .g-context-menu ul { + display: none; +} + +.g-context-menu li { + border-left: none; + border-right: none; + border-bottom: none; +} + +.g-context-menu li a { + display: block; + line-height: 1.6em; +} + +.g-hover-item .g-context-menu { + display: block; +} + +.g-hover-item .g-context-menu li { + text-align: left; +} + +.g-hover-item .g-context-menu a:hover { + text-decoration: none; +} + +/* View Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-view-menu { + margin-bottom: 1em; +} + +#g-view-menu a { + background-repeat: no-repeat; + background-position: 50% 50%; + height: 28px !important; + width: 43px !important; +} + +#g-view-menu #g-slideshow-link { + background-image: url('../images/ico-view-slideshow.png'); +} + +#g-view-menu .g-fullsize-link { + background-image: url('../images/ico-view-fullsize.png'); +} + +#g-view-menu #g-comments-link { + background-image: url('../images/ico-view-comments.png'); +} + +#g-view-menu #g-print-digibug-link { + background-image: url('../images/ico-print.png'); +} + +/** ******************************************************************* + * 6) jQuery and jQuery UI + *********************************************************************/ + +/* Superfish menu overrides ~~~~~~~~~~~~~~ */ + +.sf-menu li li, +.sf-menu li li ul li { + background-color: #bdd2ff; +} + +.sf-menu li:hover { + background-color: #dfe9ff; +} + +/** ******************************************************************* + * 7) Right to left language styles + *********************************************************************/ + +.rtl #g-header #g-login-menu, +.rtl #g-header #g-quick-search-form { + clear: left; + float: left; +} + +.rtl #g-header #g-login-menu li { + margin-left: 0; + padding-left: 0; + padding-right: 1.2em; +} + +.rtl #g-site-menu { + left: auto; + right: 150px; +} + +.rtl #g-view-menu #g-slideshow-link { + background-image: url('../images/ico-view-slideshow-rtl.png'); +} diff --git a/themes/wind_npk/images/avatar.jpg b/themes/wind_npk/images/avatar.jpg Binary files differnew file mode 100644 index 00000000..acad9314 --- /dev/null +++ b/themes/wind_npk/images/avatar.jpg diff --git a/themes/wind_npk/images/ico-album.png b/themes/wind_npk/images/ico-album.png Binary files differnew file mode 100644 index 00000000..affa1b84 --- /dev/null +++ b/themes/wind_npk/images/ico-album.png diff --git a/themes/wind_npk/images/ico-help.png b/themes/wind_npk/images/ico-help.png Binary files differnew file mode 100644 index 00000000..5c870176 --- /dev/null +++ b/themes/wind_npk/images/ico-help.png diff --git a/themes/wind_npk/images/ico-print.png b/themes/wind_npk/images/ico-print.png Binary files differnew file mode 100644 index 00000000..b82a8e1e --- /dev/null +++ b/themes/wind_npk/images/ico-print.png diff --git a/themes/wind_npk/images/ico-view-comments.png b/themes/wind_npk/images/ico-view-comments.png Binary files differnew file mode 100644 index 00000000..e5d3630f --- /dev/null +++ b/themes/wind_npk/images/ico-view-comments.png diff --git a/themes/wind_npk/images/ico-view-fullsize.png b/themes/wind_npk/images/ico-view-fullsize.png Binary files differnew file mode 100644 index 00000000..0be23e9b --- /dev/null +++ b/themes/wind_npk/images/ico-view-fullsize.png diff --git a/themes/wind_npk/images/ico-view-slideshow-rtl.png b/themes/wind_npk/images/ico-view-slideshow-rtl.png Binary files differnew file mode 100644 index 00000000..5788b3c3 --- /dev/null +++ b/themes/wind_npk/images/ico-view-slideshow-rtl.png diff --git a/themes/wind_npk/images/ico-view-slideshow.png b/themes/wind_npk/images/ico-view-slideshow.png Binary files differnew file mode 100644 index 00000000..82f61f63 --- /dev/null +++ b/themes/wind_npk/images/ico-view-slideshow.png diff --git a/themes/wind_npk/images/select-photos-backg.png b/themes/wind_npk/images/select-photos-backg.png Binary files differnew file mode 100644 index 00000000..81c2d616 --- /dev/null +++ b/themes/wind_npk/images/select-photos-backg.png diff --git a/themes/wind_npk/js/ui.init.js b/themes/wind_npk/js/ui.init.js new file mode 100644 index 00000000..f9fb8519 --- /dev/null +++ b/themes/wind_npk/js/ui.init.js @@ -0,0 +1,111 @@ +/** + * Initialize jQuery UI and Gallery Plugins + */ + +$(document).ready(function() { + + // Initialize Superfish menus (hidden, then shown to address IE issue) + $("#g-site-menu .g-menu").hide().addClass("sf-menu"); + $("#g-site-menu .g-menu").superfish({ + delay: 500, + animation: { + opacity:'show', + height:'show' + }, + pathClass: "g-selected", + speed: 'fast' + }).show(); + + // Initialize status message effects + $("#g-action-status li").gallery_show_message(); + + // Initialize dialogs + $(".g-dialog-link").gallery_dialog(); + + // Initialize short forms + $(".g-short-form").gallery_short_form(); + + // Apply jQuery UI icon, hover, and rounded corner styles + $("input[type=submit]:not(.g-short-form input)").addClass("ui-state-default ui-corner-all"); + if ($("#g-view-menu").length) { + $("#g-view-menu ul").removeClass("g-menu").removeClass("sf-menu"); + $("#g-view-menu a").addClass("ui-icon"); + } + + // Apply jQuery UI icon and hover styles to context menus + if ($(".g-context-menu").length) { + $(".g-context-menu li").addClass("ui-state-default"); + $(".g-context-menu a").addClass("g-button ui-icon-left"); + $(".g-context-menu a").prepend("<span class=\"ui-icon\"></span>"); + $(".g-context-menu a span").each(function() { + var iconClass = $(this).parent().attr("class").match(/ui-icon-.[^\s]+/).toString(); + $(this).addClass(iconClass); + }); + } + + // Album view only + if ($("#g-album-grid").length) { + // Set equal height for album items and vertically align thumbnails/metadata + $('.g-item').equal_heights().gallery_valign(); + + // Initialize thumbnail hover effect + $(".g-item").hover( + function() { + // Insert a placeholder to hold the item's position in the grid + var placeHolder = $(this).clone().attr("id", "g-place-holder"); + $(this).after($(placeHolder)); + // Style and position the hover item + var position = $(this).position(); + $(this).css("top", position.top).css("left", position.left); + $(this).addClass("g-hover-item"); + // Initialize the contextual menu + $(this).gallery_context_menu(); + // Set the hover item's height + $(this).height("auto"); + var context_menu = $(this).find(".g-context-menu"); + var adj_height = $(this).height() + context_menu.height(); + $(this).height(adj_height); + }, + function() { + // Reset item height and position + if ($(this).next().height()) { + var sib_height = $(this).next().height(); + } else { + var sib_height = $(this).prev().height(); + } + if ($.browser.msie && $.browser.version >= 8) { + sib_height = sib_height + 1; + } + $(this).css("height", sib_height); + $(this).css("position", "relative"); + $(this).css("top", 0).css("left", 0); + // Remove the placeholder and hover class from the item + $(this).removeClass("g-hover-item"); + $("#g-place-holder").remove(); + } + ); + } + + // Photo/Item item view + if ($("#g-photo,#g-movie").length) { + // Ensure the resized image fits within its container + $("#g-photo,#g-movie").gallery_fit_photo(); + + // Initialize context menus + var resize = $("#g-photo,#g-movie").gallery_get_photo(); + $(resize).hover(function(){ + $(this).gallery_context_menu(); + }); + + // Add scroll effect for links to named anchors + $.localScroll({ + queue: true, + duration: 1000, + hash: true + }); + } + + // Initialize button hover effect + $.fn.gallery_hover_init(); + +}); diff --git a/themes/wind_npk/theme.info b/themes/wind_npk/theme.info new file mode 100644 index 00000000..17ea7c20 --- /dev/null +++ b/themes/wind_npk/theme.info @@ -0,0 +1,6 @@ +name = "Gallery Wind" +description = "A crisp and distinctive theme that uses large fonts and icons for easy navigation and an enjoyable browsing experience." +version = 1 +author = "Gallery Team" +site = 1 +admin = 0 diff --git a/themes/wind_npk/thumbnail.png b/themes/wind_npk/thumbnail.png Binary files differnew file mode 100644 index 00000000..c0594db2 --- /dev/null +++ b/themes/wind_npk/thumbnail.png diff --git a/themes/wind_npk/views/album.html.php b/themes/wind_npk/views/album.html.php new file mode 100644 index 00000000..eabe07c3 --- /dev/null +++ b/themes/wind_npk/views/album.html.php @@ -0,0 +1,42 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<? // @todo Set hover on AlbumGrid list items for guest users ?> +<div id="g-info"> + <?= $theme->album_top() ?> + <h1><?= html::purify($item->title) ?></h1> + <div class="g-description"><?= nl2br(html::purify($item->description)) ?></div> +</div> + +<ul id="g-album-grid" class="ui-helper-clearfix"> +<? if (count($children)): ?> + <? foreach ($children as $i => $child): ?> + <? $item_class = "g-photo"; ?> + <? if ($child->is_album()): ?> + <? $item_class = "g-album"; ?> + <? endif ?> + <li id="g-item-id-<?= $child->id ?>" class="g-item <?= $item_class ?>"> + <?= $theme->thumb_top($child) ?> + <a href="<?= $child->url() ?>"> + <?= $child->thumb_img(array("class" => "g-thumbnail")) ?> + </a> + <?= $theme->thumb_bottom($child) ?> + <?= $theme->context_menu($child, "#g-item-id-{$child->id} .g-thumbnail") ?> + <h2><span class="<?= $item_class ?>"></span> + <a href="<?= $child->url() ?>"><?= html::purify($child->title) ?></a></h2> + <ul class="g-metadata"> + <?= $theme->thumb_info($child) ?> + </ul> + </li> + <? endforeach ?> +<? else: ?> + <? if ($user->admin || access::can("add", $item)): ?> + <? $addurl = url::file("index.php/simple_uploader/app/$item->id") ?> + <li><?= t("There aren't any photos here yet! <a %attrs>Add some</a>.", + array("attrs" => html::mark_clean("href=\"$addurl\" class=\"g-dialog-link\""))) ?></li> + <? else: ?> + <li><?= t("There aren't any photos here yet!") ?></li> + <? endif; ?> +<? endif; ?> +</ul> +<?= $theme->album_bottom() ?> + +<?= $theme->paginator() ?> diff --git a/themes/wind_npk/views/block.html.php b/themes/wind_npk/views/block.html.php new file mode 100644 index 00000000..699d7c22 --- /dev/null +++ b/themes/wind_npk/views/block.html.php @@ -0,0 +1,10 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<? if ($anchor): ?> +<a name="<?= $anchor ?>"></a> +<? endif ?> +<div id="<?= $css_id ?>" class="g-block"> + <h2><?= $title ?></h2> + <div class="g-block-content"> + <?= $content ?> + </div> +</div> diff --git a/themes/wind_npk/views/dynamic.html.php b/themes/wind_npk/views/dynamic.html.php new file mode 100644 index 00000000..a4ab11e7 --- /dev/null +++ b/themes/wind_npk/views/dynamic.html.php @@ -0,0 +1,29 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<div id="g-album-header"> + <div id="g-album-header-buttons"> + <?= $theme->dynamic_top() ?> + </div> + <h1><?= html::clean($title) ?></h1> +</div> + +<ul id="g-album-grid" class="ui-helper-clearfix"> + <? foreach ($children as $i => $child): ?> + <li class="g-item <?= $child->is_album() ? "g-album" : "" ?>"> + <?= $theme->thumb_top($child) ?> + <a href="<?= $child->url() ?>"> + <img id="g-photo-id-<?= $child->id ?>" class="g-thumbnail" + alt="photo" src="<?= $child->thumb_url() ?>" + width="<?= $child->thumb_width ?>" + height="<?= $child->thumb_height ?>" /> + </a> + <h2><?//= html::purify($child->title) ?></h2> + <?= $theme->thumb_bottom($child) ?> + <ul class="g-metadata"> + <?= $theme->thumb_info($child) ?> + </ul> + </li> + <? endforeach ?> +</ul> +<?= $theme->dynamic_bottom() ?> + +<?= $theme->paginator() ?> diff --git a/themes/wind_npk/views/movie.html.php b/themes/wind_npk/views/movie.html.php new file mode 100644 index 00000000..27c293ce --- /dev/null +++ b/themes/wind_npk/views/movie.html.php @@ -0,0 +1,18 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<div id="g-item"> + <?= $theme->photo_top() ?> + + <?= $theme->paginator() ?> + + <div id="g-movie" class="ui-helper-clearfix"> + <?= $item->movie_img(array("class" => "g-movie", "id" => "g-movie-id-{$item->id}")) ?> + <?= $theme->context_menu($item, "#g-movie-id-{$item->id}") ?> + </div> + + <div id="g-info"> + <h1><?= html::purify($item->title) ?></h1> + <div><?= nl2br(html::purify($item->description)) ?></div> + </div> + + <?= $theme->photo_bottom() ?> +</div> diff --git a/themes/wind_npk/views/no_sidebar.html.php b/themes/wind_npk/views/no_sidebar.html.php new file mode 100644 index 00000000..378bd971 --- /dev/null +++ b/themes/wind_npk/views/no_sidebar.html.php @@ -0,0 +1,6 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<ul class="g-message-block"> + <li class="g-warning"><?= t("No active sidebar blocks.<br/> + <a href=\"%url\">Add blocks</a>", + array("url" => html::mark_clean(url::site("admin/sidebar")))) ?></li> +</ul> diff --git a/themes/wind_npk/views/page.html.php b/themes/wind_npk/views/page.html.php new file mode 100644 index 00000000..2dcc5d70 --- /dev/null +++ b/themes/wind_npk/views/page.html.php @@ -0,0 +1,149 @@ +<?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" xml:lang="en" lang="en"> + <head> + <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> + <title> + <? if ($page_title): ?> + <?= $page_title ?> + <? else: ?> + <? if ($theme->item()): ?> + <? if ($theme->item()->is_album()): ?> + <?= t("Browse Album :: %album_title", array("album_title" => $theme->item()->title)) ?> + <? elseif ($theme->item()->is_photo()): ?> + <?= t("Photo :: %photo_title", array("photo_title" => $theme->item()->title)) ?> + <? else: ?> + <?= t("Movie :: %movie_title", array("movie_title" => $theme->item()->title)) ?> + <? endif ?> + <? elseif ($theme->tag()): ?> + <?= t("Browse Tag :: %tag_title", array("tag_title" => $theme->tag()->name)) ?> + <? else: /* Not an item, not a tag, no page_title specified. Help! */ ?> + <?= t("Gallery") ?> + <? endif ?> + <? endif ?> + </title> + <link rel="shortcut icon" href="<?= url::file("lib/images/favicon.ico") ?>" type="image/x-icon" /> + <?= $theme->css("yui/reset-fonts-grids.css") ?> + <?= $theme->css("superfish/css/superfish.css") ?> + <?= $theme->css("themeroller/ui.base.css") ?> + <?= $theme->css("gallery.common.css") ?> + <?= $theme->css("screen.css") ?> + <!--[if lt IE 8]> + <link rel="stylesheet" type="text/css" href="<?= $theme->url("css/fix-ie.css") ?>" + media="screen,print,projection" /> + <![endif]--> + <? if ($theme->page_type == "collection"): ?> + <? if ($thumb_proportion != 1): ?> + <? $new_width = $thumb_proportion * 213 ?> + <? $new_height = $thumb_proportion * 240 ?> + <style type="text/css"> + #g-content #g-album-grid .g-item { + width: <?= $new_width ?>px; + height: <?= $new_height ?>px; + /* <?= $thumb_proportion ?> */ + } + </style> + <? endif ?> + <? endif ?> + <?= $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") ?> + <?= $theme->script("ui.init.js") ?> + + <? /* These are page specific, but if we put them before $theme->head() 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() ?> + </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 and make it visible after the page has loaded, to minimize menu flicker --> + <div id="g-site-menu" style="visibility: hidden"> + <?= $theme->site_menu() ?> + </div> + <script> $(document).ready(function() { $("#g-site-menu").css("visibility", "visible"); }) </script> + + <?= $theme->header_bottom() ?> + </div> + + <? if ($theme->item() && !empty($parents)): ?> + <ul class="g-breadcrumbs"> + <? $i = 0 ?> + <? foreach ($parents as $parent): ?> + <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. --> + <a href="<?= $parent->url($parent == $theme->item()->parent() ? + "show={$theme->item()->id}" : null) ?>"> + <?= html::purify($parent->title) ?> + </a> + </li> + <? $i++ ?> + <? endforeach ?> + <li class="g-active<? if ($i == 0) print " g-first" ?>"><?= html::purify($theme->item()->title) ?></li> + </ul> + <? endif ?> + </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> diff --git a/themes/wind_npk/views/paginator.html.php b/themes/wind_npk/views/paginator.html.php new file mode 100644 index 00000000..5034c965 --- /dev/null +++ b/themes/wind_npk/views/paginator.html.php @@ -0,0 +1,87 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<? +// 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 +// +?> + +<ul class="g-paginator ui-helper-clearfix"> + <li class="g-first"> + <? if ($page_type == "collection"): ?> + <? if (isset($first_page_url)): ?> + <a href="<?= $first_page_url ?>" class="g-button ui-icon-left ui-state-default ui-corner-all"> + <span class="ui-icon ui-icon-seek-first"></span><?= t("First") ?></a> + <? else: ?> + <a class="g-button ui-icon-left ui-state-disabled ui-corner-all"> + <span class="ui-icon ui-icon-seek-first"></span><?= t("First") ?></a> + <? endif ?> + <? endif ?> + + <? if (isset($previous_page_url)): ?> + <a href="<?= $previous_page_url ?>" class="g-button ui-icon-left ui-state-default ui-corner-all"> + <span class="ui-icon ui-icon-seek-prev"></span><?= t("Previous") ?></a> + <? else: ?> + <a class="g-button ui-icon-left ui-state-disabled ui-corner-all"> + <span class="ui-icon ui-icon-seek-prev"></span><?= t("Previous") ?></a> + <? endif ?> + </li> + + <li class="g-info"> + <? if ($total): ?> + <? if ($page_type == "collection"): ?> + <?= /* @todo This message isn't easily localizable */ + t2("Photo %from_number of %count", + "Photos %from_number - %to_number of %count", + $total, + array("from_number" => $first_visible_position, + "to_number" => $last_visible_position, + "count" => $total)) ?> + <? else: ?> + <?= t("%position of %total", array("position" => $position, "total" => $total)) ?> + <? endif ?> + <? else: ?> + <?= t("No photos") ?> + <? endif ?> + </li> + + <li class="g-text-right"> + <? if (isset($next_page_url)): ?> + <a href="<?= $next_page_url ?>" class="g-button ui-icon-right ui-state-default ui-corner-all"> + <span class="ui-icon ui-icon-seek-next"></span><?= t("Next") ?></a> + <? else: ?> + <a class="g-button ui-state-disabled ui-icon-right ui-corner-all"> + <span class="ui-icon ui-icon-seek-next"></span><?= t("Next") ?></a> + <? endif ?> + + <? if ($page_type == "collection"): ?> + <? if (isset($last_page_url)): ?> + <a href="<?= $last_page_url ?>" class="g-button ui-icon-right ui-state-default ui-corner-all"> + <span class="ui-icon ui-icon-seek-end"></span><?= t("Last") ?></a> + <? else: ?> + <a class="g-button ui-state-disabled ui-icon-right ui-corner-all"> + <span class="ui-icon ui-icon-seek-end"></span><?= t("Last") ?></a> + <? endif ?> + <? endif ?> + </li> +</ul> diff --git a/themes/wind_npk/views/photo.html.php b/themes/wind_npk/views/photo.html.php new file mode 100644 index 00000000..e0fae3f1 --- /dev/null +++ b/themes/wind_npk/views/photo.html.php @@ -0,0 +1,39 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> + +<? if (access::can("view_full", $theme->item())): ?> +<!-- Use javascript to show the full size as an overlay on the current page --> +<script type="text/javascript"> + $(document).ready(function() { + $(".g-fullsize-link").click(function() { + $.gallery_show_full_size(<?= html::js_string($theme->item()->file_url()) ?>, "<?= $theme->item()->width ?>", "<?= $theme->item()->height ?>"); + return false; + }); + }); +</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-photo-id-{$item->id}", "class" => "g-resize")) ?> + <? if (access::can("view_full", $item)): ?> + </a> + <? endif ?> + <?= $theme->resize_bottom($item) ?> + <?= $theme->context_menu($item, "#g-photo-id-{$item->id}") ?> + </div> + + <div id="g-info"> + <h1><?= html::purify($item->title) ?></h1> + <div><?= nl2br(html::purify($item->description)) ?></div> + </div> + + <?= $theme->photo_bottom() ?> +</div> diff --git a/themes/wind_npk/views/sidebar.html.php b/themes/wind_npk/views/sidebar.html.php new file mode 100644 index 00000000..086d1359 --- /dev/null +++ b/themes/wind_npk/views/sidebar.html.php @@ -0,0 +1,16 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<?= $theme->sidebar_top() ?> +<div id="g-view-menu" class="g-buttonset ui-helper-clearfix"> + <? 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> + +<?= $theme->sidebar_blocks() ?> +<?= $theme->sidebar_bottom() ?> |