diff --git a/3.0/client/PHP/Gallery3.php b/3.0/client/PHP/Gallery3.php index fb97ddf8..782740c6 100644 --- a/3.0/client/PHP/Gallery3.php +++ b/3.0/client/PHP/Gallery3.php @@ -1,7 +1,7 @@ data = new stdClass(); + $this->data->entity = new stdClass(); $this->token = null; $this->url = null; } @@ -169,7 +169,55 @@ class Gallery3 { } class Gallery3_Helper { + static $instance = null; + static function request($method, $url, $token=null, $params=array(), $file=null) { + if (!isset(self::$instance)) { + @include("HTTP/Request2.php"); + if (class_exists("HTTP_Request2")) { + self::$instance = new Gallery3_Helper_HTTP_Request2(); + } else { + include("HTTP/Request.php"); + self::$instance = new Gallery3_Helper_HTTP_Request(); + } + } + return self::$instance->request($method, $url, $token, $params, $file); + } +} + +class Gallery3_Helper_HTTP_Request2 { + function request($method, $url, $token, $params, $file) { + $req = new HTTP_Request2($url); + $req->setMethod($method == "get" ? 'GET' : 'POST'); + $req->setHeader("X-Gallery-Request-Method", $method); + if ($token) { + $req->setHeader("X-Gallery-Request-Key", $token); + } + foreach ($params as $key => $value) { + $req->addPostParameter($key, is_string($value) ? $value : json_encode($value)); + } + if ($file) { + $req->addUpload("file", $file, basename($file), mime_content_type($file)); + } + $response = $req->send(); + $status = $response->getStatus(); + + switch ($status) { + case 200: + case 201: + return json_decode($response->getBody()); + + case 403: + throw new Gallery3_Forbidden_Exception($response->getBody(),$status); + + default: + throw new Gallery3_Exception($response->getBody(),$status); + } + } +} + +class Gallery3_Helper_HTTP_Request { + function request($method, $url, $token, $params, $file) { $req = new HTTP_Request($url); $req->setMethod($method == "get" ? HTTP_REQUEST_METHOD_GET : HTTP_REQUEST_METHOD_POST); $req->addHeader("X-Gallery-Request-Method", $method); diff --git a/3.0/client/Python/pylibgal3/libg3/G3Items.py b/3.0/client/Python/pylibgal3/libg3/G3Items.py index 0fdae593..ce812551 100644 --- a/3.0/client/Python/pylibgal3/libg3/G3Items.py +++ b/3.0/client/Python/pylibgal3/libg3/G3Items.py @@ -22,7 +22,16 @@ __all__ = ['Album' , 'Image' , 'LocalImage' , 'RemoteImage' , 'LocalMovie' , 'RemoteMovie' , 'getItemFromResp' , 'getItemsFromResp'] from datetime import datetime -import json , weakref , types , os , mimetypes , re +import weakref , types , os , mimetypes , re +try: + import json +except: + try: + import simplejson + except ImportError , e: + raise ImportError('You must have either the "json" or "simplejson"' + 'library installed!') + class BaseRemote(object): def __init__(self , respObj , weakGalObj , weakParent=None): diff --git a/3.0/client/Python/pylibgal3/libg3/Gallery3.py b/3.0/client/Python/pylibgal3/libg3/Gallery3.py index 6345c1a8..13409c8a 100644 --- a/3.0/client/Python/pylibgal3/libg3/Gallery3.py +++ b/3.0/client/Python/pylibgal3/libg3/Gallery3.py @@ -26,7 +26,15 @@ from G3Items import getItemFromResp , getItemsFromResp , BaseRemote , Album , \ RemoteImage , Tag from urllib import quote , urlencode from uuid import uuid4 -import urllib2 , os , json +import urllib2 , os +try: + import json +except: + try: + import simplejson + except ImportError , e: + raise ImportError('You must have either the "json" or "simplejson"' + 'library installed!') class Gallery3(object): """ @@ -129,7 +137,6 @@ class Gallery3(object): uri(str) : The uri string defining the resource on the defined host """ url = self._buildUrl(uri , kwargs) - print url return self.getRespFromUrl(url) def addAlbum(self , parent , albumName , title , description=''): diff --git a/3.0/client/Python/pylibgal3/libg3/__init__.py b/3.0/client/Python/pylibgal3/libg3/__init__.py index eec91668..3805ff18 100644 --- a/3.0/client/Python/pylibgal3/libg3/__init__.py +++ b/3.0/client/Python/pylibgal3/libg3/__init__.py @@ -21,4 +21,4 @@ from G3Items import * from Gallery3 import * -__version__ = '0.1.4' +__version__ = '0.1.5' diff --git a/3.0/modules/about/module.info b/3.0/modules/about/module.info index f0c38ace..52e41635 100644 --- a/3.0/modules/about/module.info +++ b/3.0/modules/about/module.info @@ -3,4 +3,5 @@ description = "About page and detail." author_name = "floridave" author_url = "http://codex.gallery2.org/User:Floridave" info_url = "http://codex.gallery2.org/Gallery3:Modules:about" -discuss_url = "http://gallery.menalto.com/forum_module_about" \ No newline at end of file +discuss_url = "http://gallery.menalto.com/forum_module_about" +version = 1 diff --git a/3.0/modules/about_this_album/helpers/about_this_album_block.php b/3.0/modules/about_this_album/helpers/about_this_album_block.php index aefafff5..b3cd6c26 100644 --- a/3.0/modules/about_this_album/helpers/about_this_album_block.php +++ b/3.0/modules/about_this_album/helpers/about_this_album_block.php @@ -1,7 +1,7 @@ \n\n\n\n\n"; + json::reply(array("result" => "success")); } public function logout() { @@ -139,10 +139,10 @@ class albumpassword_Controller extends Controller { cookie::delete("g3_albumpassword_id"); cookie::set("g3_albumpassword", $album_password); message::success(t("Password Accepted.")); - print "\n\n\n\n\n"; + json::reply(array("result" => "success")); } else { message::error(t("Password Rejected.")); - print "\n\n\n\n\n"; + json::reply(array("result" => "success")); } } diff --git a/3.0/modules/albumpassword/helpers/MY_access.php b/3.0/modules/albumpassword/helpers/MY_access.php index bda1db32..e8b4baf5 100644 --- a/3.0/modules/albumpassword/helpers/MY_access.php +++ b/3.0/modules/albumpassword/helpers/MY_access.php @@ -1,7 +1,7 @@ -albumTree.add(id -1 ?>, parent_id -1 ?>, "title ?>", pf+'relative_url_cache ?>'); +albumTree.add(id -1 ?>, parent_id -1 ?>, "title) ?>", pf+'relative_url() ?>'); viewable()->children(null, null, array(array("type", "=", "album"))) as $child){ addtree($child); diff --git a/3.0/modules/albumtree/views/albumtree_block_list.html.php b/3.0/modules/albumtree/views/albumtree_block_list.html.php index 62d8c0ad..08ab3f04 100644 --- a/3.0/modules/albumtree/views/albumtree_block_list.html.php +++ b/3.0/modules/albumtree/views/albumtree_block_list.html.php @@ -15,7 +15,7 @@ function makelist($album,$level){ //print out the list item ?>
  • - title ?> + title) ?>
  • - + viewable()->children(null, null, array(array("type", "=", "album"))) as $child){ diff --git a/3.1/modules/minislideshow/helpers/minislideshow_theme.php b/3.0/modules/arrow_nav/helpers/arrow_nav_theme.php similarity index 80% rename from 3.1/modules/minislideshow/helpers/minislideshow_theme.php rename to 3.0/modules/arrow_nav/helpers/arrow_nav_theme.php index 266452e0..529046ef 100644 --- a/3.1/modules/minislideshow/helpers/minislideshow_theme.php +++ b/3.0/modules/arrow_nav/helpers/arrow_nav_theme.php @@ -1,29 +1,26 @@ -item()) { - return; - } - - return new View("minislideshow_header_block.html"); - } -} +page_subtype == "photo") { + return $theme->script("arrow_nav.js"); + } + } +} diff --git a/3.0/modules/arrow_nav/js/arrow_nav.js b/3.0/modules/arrow_nav/js/arrow_nav.js new file mode 100644 index 00000000..aa1c8c4e --- /dev/null +++ b/3.0/modules/arrow_nav/js/arrow_nav.js @@ -0,0 +1,16 @@ +$(document).keydown(function(e) { + var url; + + if (e.keyCode == 37) { + // Left key pressed + url = $('.g-paginator .g-first a').attr("href"); + // Right key pressed + } else if (e.keyCode == 39) { + url = $('.g-paginator .g-text-right a').attr("href"); + } + + if(url != undefined) { + window.location = url; + return false; + } +}); diff --git a/3.0/modules/arrow_nav/module.info b/3.0/modules/arrow_nav/module.info new file mode 100644 index 00000000..abae7113 --- /dev/null +++ b/3.0/modules/arrow_nav/module.info @@ -0,0 +1,3 @@ +name = "Arrow Navigation" +description = "Use the left/right arrow keys to go to the previous/next photo" +version = 1 diff --git a/3.0/modules/author/helpers/author.php b/3.0/modules/author/helpers/author.php index ae259ec8..d4ee9dc6 100644 --- a/3.0/modules/author/helpers/author.php +++ b/3.0/modules/author/helpers/author.php @@ -1,7 +1,7 @@ set_global("calendar_user", $display_user); + $root = item::root(); + $template = new Theme_View("page.html", "other", "CalendarView"); + $template->set_global( + array("calendar_user" => $display_user, + "breadcrumbs" => array( + Breadcrumb::instance($root->title, $root->url())->set_first(), + Breadcrumb::instance($display_year, url::site("calendarview/calendar/" . $display_year))->set_last()))); $template->page_title = t("Gallery :: Calendar"); $template->content = new View("calendarview_year.html"); $template->content->calendar_year = $display_year; $template->content->calendar_user = $display_user; $template->content->calendar_user_year_form = $this->_get_calenderprefs_form($display_year, $display_user); $template->content->title = t("Calendar") . ": " . $display_year; - // Set up breadcrumbs - $calendar_breadcrumbs[0] = new Calendar_Breadcrumb(item::root()->title, item::root()->url()); - $calendar_breadcrumbs[1] = new Calendar_Breadcrumb($display_year, ""); - $template->set_global("breadcrumbs", $calendar_breadcrumbs); print $template; } public function day($display_year, $display_user, $display_month, $display_day) { // Display all images for the specified day. - // Figure out the total number of photos to display. - $day_count = 0; - if ($display_user == "-1") { - $day_count = ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, $display_day, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month, ($display_day + 1), $display_year)) - ->find_all() - ->count(); - } else { - $day_count = ORM::factory("item") - ->viewable() - ->where("owner_id", "=", $display_user) - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, $display_day, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month, ($display_day + 1), $display_year)) - ->find_all() - ->count(); + // Set up default search conditions for retrieving all photos from the specified day. + $where = array(array("type", "!=", "album")); + if ($display_user != "-1") { + $where[] = array("owner_id", "=", $display_user); } + $where[] = array("captured", ">=", mktime(0, 0, 0, $display_month, $display_day, $display_year)); + $where[] = array("captured", "<", mktime(0, 0, 0, $display_month, ($display_day + 1), $display_year)); + + // Figure out the total number of photos to display. + $day_count = calendarview::get_items_count($where); // Figure out paging stuff. $page_size = module::get_var("gallery", "page_size", 9); @@ -81,70 +68,67 @@ class CalendarView_Controller extends Controller { throw new Kohana_404_Exception(); } - // Set up the page. - $template = new Theme_View("calpage.html", "collection", "CalendarDayView"); - $template->set_global("page", $page); - $template->set_global("max_pages", $max_pages); - $template->set_global("page_size", $page_size); - $template->page_title = t("Gallery :: Calendar"); - // Figure out which photos go on this page. - if ($display_user == "-1") { - $template->set_global("children", ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, $display_day, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month, ($display_day + 1), $display_year)) - ->order_by("captured", "ASC") - ->find_all($page_size, $offset)); - } else { - $template->set_global("children", ORM::factory("item") - ->viewable() - ->where("owner_id", "=", $display_user) - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, $display_day, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month, ($display_day + 1), $display_year)) - ->order_by("captured", "ASC") - ->find_all($page_size, $offset)); - } + $children = calendarview::get_items($page_size, $offset, $where); - // Set up breadcrumbs - $calendar_breadcrumbs[0] = new Calendar_Breadcrumb(item::root()->title, item::root()->url()); - $calendar_breadcrumbs[1] = new Calendar_Breadcrumb($display_year, url::site("calendarview/calendar/" . $display_year . "/" . $display_user)); - $calendar_breadcrumbs[2] = new Calendar_Breadcrumb(t(date("F", mktime(0, 0, 0, $display_month, $display_day, $display_year))), url::site("calendarview/month/" . $display_year . "/" . $display_user . "/" . $display_month)); - $calendar_breadcrumbs[3] = new Calendar_Breadcrumb($display_day, ""); - $template->set_global("breadcrumbs", $calendar_breadcrumbs); - - // Finish setting up and then display the page. - $template->set_global("children_count", $day_count); + // Create and display the page. + $root = item::root(); + $template = new Theme_View("page.html", "collection", "CalendarDayView"); + $template->set_global( + array("page" => $page, + "max_pages" => $max_pages, + "page_size" => $page_size, + "children" => $children, + "breadcrumbs" => array( + Breadcrumb::instance($root->title, $root->url())->set_first(), + Breadcrumb::instance($display_year, url::site("calendarview/calendar/" . $display_year . "/" . $display_user)), + Breadcrumb::instance(t(date("F", mktime(0, 0, 0, $display_month, $display_day, $display_year))), url::site("calendarview/month/" . $display_year . "/" . $display_user . "/" . $display_month)), + Breadcrumb::instance($display_day, url::site("calendarview/month/" . $display_year . "/" . $display_user . "/" . $display_month . "/" . $display_day))->set_last()), + "children_count" => $day_count)); + $template->page_title = t("Gallery :: Calendar"); $template->content = new View("dynamic.html"); $template->content->title = t("Photos From ") . date("d", mktime(0, 0, 0, $display_month, $display_day, $display_year)) . " " . t(date("F", mktime(0, 0, 0, $display_month, $display_day, $display_year))) . " " . date("Y", mktime(0, 0, 0, $display_month, $display_day, $display_year)); print $template; + + // Set breadcrumbs on the photo pages to point back to the calendar day view. + item::set_display_context_callback("CalendarView_Controller::get_display_day_context", $display_user, $display_year, $display_month, $display_day); + } + + static function get_display_day_context($item, $display_user, $display_year, $display_month, $display_day) { + // Set up default search conditions for retrieving all photos from the specified day. + $where = array(array("type", "!=", "album")); + if ($display_user != "-1") { + $where[] = array("owner_id", "=", $display_user); + } + $where[] = array("captured", ">=", mktime(0, 0, 0, $display_month, $display_day, $display_year)); + $where[] = array("captured", "<", mktime(0, 0, 0, $display_month, ($display_day + 1), $display_year)); + + // Generate breadcrumbs for the photo page. + $root = item::root(); + $breadcrumbs = array( + Breadcrumb::instance($root->title, $root->url())->set_first(), + Breadcrumb::instance($display_year, url::site("calendarview/calendar/" . $display_year . "/" . $display_user)), + Breadcrumb::instance(t(date("F", mktime(0, 0, 0, $display_month, $display_day, $display_year))), url::site("calendarview/month/" . $display_year . "/" . $display_user . "/" . $display_month)), + Breadcrumb::instance($display_day, url::site("calendarview/month/" . $display_year . "/" . $display_user . "/" . $display_month . "/" . $display_day)), + Breadcrumb::instance($item->title, $item->url())->set_last() + ); + + return CalendarView_Controller::get_display_context($item, $where, $breadcrumbs); } public function month($display_year, $display_user, $display_month) { // Display all images for the specified month. - // Figure out the total number of photos to display. - $day_count = 0; - if ($display_user == "-1") { - $day_count = ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, 1, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month+1, 1, $display_year)) - ->find_all() - ->count(); - } else { - $day_count = ORM::factory("item") - ->viewable() - ->where("owner_id", "=", $display_user) - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, 1, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month+1, 1, $display_year)) - ->find_all() - ->count(); + // Set up default search conditions for retrieving all photos from the specified month. + $where = array(array("type", "!=", "album")); + if ($display_user != "-1") { + $where[] = array("owner_id", "=", $display_user); } + $where[] = array("captured", ">=", mktime(0, 0, 0, $display_month, 1, $display_year)); + $where[] = array("captured", "<", mktime(0, 0, 0, $display_month+1, 1, $display_year)); + + // Figure out the total number of photos to display. + $day_count = calendarview::get_items_count($where); // Figure out paging stuff. $page_size = module::get_var("gallery", "page_size", 9); @@ -157,44 +141,73 @@ class CalendarView_Controller extends Controller { throw new Kohana_404_Exception(); } - // Set up the page. - $template = new Theme_View("calpage.html", "collection", "CalendarMonthView"); - $template->set_global("page", $page); - $template->set_global("max_pages", $max_pages); - $template->set_global("page_size", $page_size); - $template->page_title = t("Gallery :: Calendar"); - // Figure out which photos go on this page. - if ($display_user == "-1") { - $template->set_global("children", ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, 1, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month+1, 1, $display_year)) - ->order_by("captured", "ASC") - ->find_all($page_size, $offset)); - } else { - $template->set_global("children", ORM::factory("item") - ->viewable() - ->where("owner_id", "=", $display_user) - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, 1, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month+1, 1, $display_year)) - ->order_by("captured", "ASC") - ->find_all($page_size, $offset)); - } + $children = calendarview::get_items($page_size, $offset, $where); - // Set up breadcrumbs - $calendar_breadcrumbs[0] = new Calendar_Breadcrumb(item::root()->title, item::root()->url()); - $calendar_breadcrumbs[1] = new Calendar_Breadcrumb($display_year, url::site("calendarview/calendar/" . $display_year . "/" . $display_user)); - $calendar_breadcrumbs[2] = new Calendar_Breadcrumb(t(date("F", mktime(0, 0, 0, $display_month, 1, $display_year))), ""); - $template->set_global("breadcrumbs", $calendar_breadcrumbs); - - // Finish setting up and then display the page. - $template->set_global("children_count", $day_count); + // Create and display the page. + $root = item::root(); + $template = new Theme_View("page.html", "collection", "CalendarMonthView"); + $template->set_global( + array("page" => $page, + "max_pages" => $max_pages, + "page_size" => $page_size, + "breadcrumbs" => array( + Breadcrumb::instance($root->title, $root->url())->set_first(), + Breadcrumb::instance($display_year, url::site("calendarview/calendar/" . $display_year . "/" . $display_user)), + Breadcrumb::instance(t(date("F", mktime(0, 0, 0, $display_month, 1, $display_year))), url::site("calendarview/month/" . $display_year . "/" . $display_user . "/" . $display_month))->set_last()), + "children" => $children, + "children_count" => $day_count)); + $template->page_title = t("Gallery :: Calendar"); $template->content = new View("dynamic.html"); $template->content->title = t("Photos From ") . t(date("F", mktime(0, 0, 0, $display_month, 1, $display_year))) . " " . date("Y", mktime(0, 0, 0, $display_month, 1, $display_year)); print $template; + + // Set up breadcrumbs for the photo pages to point back to the calendar month view. + item::set_display_context_callback("CalendarView_Controller::get_display_month_context", $display_user, $display_year, $display_month); + } + + static function get_display_month_context($item, $display_user, $display_year, $display_month) { + // Set up default search conditions for retrieving all photos from the specified month. + $where = array(array("type", "!=", "album")); + if ($display_user != "-1") { + $where[] = array("owner_id", "=", $display_user); + } + $where[] = array("captured", ">=", mktime(0, 0, 0, $display_month, 1, $display_year)); + $where[] = array("captured", "<", mktime(0, 0, 0, $display_month+1, 1, $display_year)); + + // Generate breadcrumbs for the photo page. + $root = item::root(); + $breadcrumbs = array( + Breadcrumb::instance($root->title, $root->url())->set_first(), + Breadcrumb::instance($display_year, url::site("calendarview/calendar/" . $display_year . "/" . $display_user)), + Breadcrumb::instance(t(date("F", mktime(0, 0, 0, $display_month, 1, $display_year))), url::site("calendarview/month/" . $display_year . "/" . $display_user . "/" . $display_month)), + Breadcrumb::instance($item->title, $item->url())->set_last() + ); + + return CalendarView_Controller::get_display_context($item, $where, $breadcrumbs); + } + + private function get_display_context($item, $where=array(), $breadcrumbs=array()) { + // Set up previous / next / breadcrumbs / etc to point to CalendarView instead of the album. + + // Figure out the photo's position. + $position = calendarview::get_position($item, $where); + + // Figure out the previous and next items. + if ($position > 1) { + list ($previous_item, $ignore, $next_item) = calendarview::get_items(3, $position - 2, $where); + } else { + list ($next_item) = calendarview::get_items(1, $position, $where); + } + + // Figure out the total number of photos. + $sibling_count = calendarview::get_items_count($where); + + return array("position" => $position, + "previous_item" => $previous_item, + "next_item" => $next_item, + "sibling_count" => $sibling_count, + "breadcrumbs" => $breadcrumbs); } private function _get_calenderprefs_form($display_year, $display_user) { @@ -221,17 +234,31 @@ class CalendarView_Controller extends Controller { // Generate a list of years, starting with the year the earliest photo was // taken, and ending with the year of the most recent photo. $valid_years = Array(); - $all_photos = ORM::factory("item") - ->viewable() - //->where("owner_id", "=", $one_user->id) - ->where("type", "!=", "album") - ->where("captured", "!=", "") - ->order_by("captured", "DESC") - ->find_all(); - $counter = date('Y', $all_photos[count($all_photos)-1]->captured); - while ($counter <= date('Y', $all_photos[0]->captured)) { - $valid_years[$counter] = $counter; - $counter++; + if ($display_user == -1) { + $all_photos = ORM::factory("item") + ->viewable() + ->where("type", "!=", "album") + ->where("captured", "!=", "") + ->order_by("captured", "DESC") + ->find_all(); + $counter = date('Y', $all_photos[count($all_photos)-1]->captured); + while ($counter <= date('Y', $all_photos[0]->captured)) { + $valid_years[$counter] = $counter; + $counter++; + } + } else { + $all_photos = ORM::factory("item") + ->viewable() + ->where("type", "!=", "album") + ->where("captured", "!=", "") + ->where("owner_id", "=", $display_user) + ->order_by("captured", "DESC") + ->find_all(); + $counter = date('Y', $all_photos[count($all_photos)-1]->captured); + while ($counter <= date('Y', $all_photos[0]->captured)) { + $valid_years[$counter] = $counter; + $counter++; + } } // Create the form. @@ -266,4 +293,4 @@ class CalendarView_Controller extends Controller { // redirect to the currect page. url::redirect(url::site("calendarview/calendar/" . $str_year_id . "/" . $str_user_id, request::protocol())); } -} \ No newline at end of file +} diff --git a/3.0/modules/calendarview/css/calendarview_calendar.css b/3.0/modules/calendarview/css/calendarview_calendar.css index 53807042..82dfaa9f 100644 --- a/3.0/modules/calendarview/css/calendarview_calendar.css +++ b/3.0/modules/calendarview/css/calendarview_calendar.css @@ -8,6 +8,15 @@ margin: 10px 10px 10px 10px; } +#g-calendar-profile-grid { + position: relative; + align: center; + float: left; + width: 200px; + height: 145px; + margin: 10px 10px 10px 10px; +} + /* Search form ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #cal_user { top: 0px; diff --git a/3.0/modules/calendarview/helpers/calendarview.php b/3.0/modules/calendarview/helpers/calendarview.php new file mode 100644 index 00000000..4406ed7f --- /dev/null +++ b/3.0/modules/calendarview/helpers/calendarview.php @@ -0,0 +1,48 @@ +viewable() + ->merge_where($where) + ->order_by("captured", "ASC") + ->count_all(); + } + + static function get_items($limit=null, $offset=null, $where=array()) { + // Returns the items identified by $where, up to $limit, and starting at $offset. + return ORM::factory("item") + ->viewable() + ->merge_where($where) + ->order_by("captured", "ASC") + ->find_all($limit, $offset); + } + + static function get_position($item, $where=array()) { + // Get's $item's position within $where. + return ORM::factory("item") + ->viewable() + ->merge_where($where) + ->where("items.id", "<=", $item->id) + ->order_by("captured", "ASC") + ->count_all(); + } +} diff --git a/3.0/modules/calendarview/helpers/calendarview_event.php b/3.0/modules/calendarview/helpers/calendarview_event.php index 731a662a..cb410b01 100644 --- a/3.0/modules/calendarview/helpers/calendarview_event.php +++ b/3.0/modules/calendarview/helpers/calendarview_event.php @@ -1,7 +1,7 @@ user_id = $data->user->id; + + // Figure out what month the users newest photo was taken it. + // Make that the last month to display. + // If a user hasn't uploaded anything, make the current month + // the last to be displayed. + $latest_photo = ORM::factory("item") + ->viewable() + ->where("type", "!=", "album") + ->where("captured", "!=", "") + ->where("owner_id", "=", $data->user->id) + ->order_by("captured", "DESC") + ->find_all(1); + if (count($latest_photo) > 0) { + $v->user_year = date('Y', $latest_photo[0]->captured); + $v->user_month = date('n', $latest_photo[0]->captured); + } else { + $v->user_year = date('Y'); + $v->user_month = date('n'); + } + + $data->content[] = (object) array("title" => t("User calendar"), "view" => $v); + } +} diff --git a/3.0/modules/calendarview/helpers/calendarview_theme.php b/3.0/modules/calendarview/helpers/calendarview_theme.php index fa8002ea..5c571525 100644 --- a/3.0/modules/calendarview/helpers/calendarview_theme.php +++ b/3.0/modules/calendarview/helpers/calendarview_theme.php @@ -1,7 +1,7 @@ css("calendarview_menu.css"); - return $theme->css("calendarview_calendar.css"); + return $theme->css("calendarview_calendar.css") . + $theme->css("calendarview_menu.css"); } } diff --git a/3.0/modules/calendarview/module.info b/3.0/modules/calendarview/module.info index 761eadab..f51f1625 100644 --- a/3.0/modules/calendarview/module.info +++ b/3.0/modules/calendarview/module.info @@ -1,7 +1,7 @@ name = "CalendarView" description = "View your photos by the date they were taken." version = 1 -author_name = "" -author_url = "" +author_name = "rWatcher" +author_url = "http://codex.gallery2.org/User:RWatcher" info_url = "http://codex.gallery2.org/Gallery3:Modules:calendarview" -discuss_url = "http://gallery.menalto.com/forum_module_calendarview" +discuss_url = "http://gallery.menalto.com/node/92405" diff --git a/3.0/modules/calendarview/views/calpage.html.php b/3.0/modules/calendarview/views/calpage.html.php deleted file mode 100644 index 3dab5fc0..00000000 --- a/3.0/modules/calendarview/views/calpage.html.php +++ /dev/null @@ -1,164 +0,0 @@ - - -html_attributes() ?> xml:lang="en" lang="en"> - - - start_combining("script,css") ?> - - <? 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 ?> - - " - type="image/x-icon" /> - - page_type == "collection"): ?> - - - - - - - - script("json2-min.js") ?> - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("jquery.localscroll.js") ?> - - - page_subtype == "photo"): ?> - script("jquery.scrollTo.js") ?> - script("gallery.show_full_size.js") ?> - page_subtype == "movie"): ?> - script("flowplayer.js") ?> - - - head() ?> - - - script("ui.init.js") ?> - css("yui/reset-fonts-grids.css") ?> - css("superfish/css/superfish.css") ?> - css("themeroller/ui.base.css") ?> - css("screen.css") ?> - - - - get_combined("script") ?> - - - get_combined("css") ?> - - - body_attributes() ?>> - page_top() ?> -
    - site_status() ?> -
    -
    - - - - - - user_menu() ?> - header_top() ?> - - - - - - header_bottom() ?> -
    - - - - - - - - - - -
    -
    -
    -
    -
    - messages() ?> - -
    -
    -
    -
    - page_subtype != "login"): ?> - - -
    -
    - -
    - page_bottom() ?> - - \ No newline at end of file diff --git a/3.0/modules/calendarview/views/user_profile_calendarview.html.php b/3.0/modules/calendarview/views/user_profile_calendarview.html.php new file mode 100644 index 00000000..4d9d68a9 --- /dev/null +++ b/3.0/modules/calendarview/views/user_profile_calendarview.html.php @@ -0,0 +1,86 @@ + +viewable() + ->where("owner_id", "=", $user_id) + ->where("type", "!=", "album") + ->where("captured", ">=", mktime(0, 0, 0, $user_month-2, 1, $user_year)) + ->where("captured", "<", mktime(0, 0, 0, $user_month+1, 1, ($user_year))) + ->order_by("captured") + ->find_all(); + + // Set up some initial variables. + $calendar_year = $user_year; + $counter_months = $user_month - 2; + if ($counter_months < 1) { + $counter_months += 12; + $calendar_year--; + } + $counter_days = 0; + $counter = 0; + + // Print the first month. + print "
    "; + if ((count($items) > 0) && (date("n", $items[$counter]->captured) == $counter_months)) { + $month_url = url::site("calendarview/month/" . $calendar_year . "/" . $user_id . "/" . $counter_months . "/"); + } else { + $month_url = ""; + } + $calendar = new PHPCalendar($counter_months, $calendar_year, $month_url); + + // Loop through each photo taken during the 3 month time frame, and see what month and day they were taken on. + // Make the corresponding dates on the calendars into clickable links. + while ($counter < (count($items))) { + + // Check and see if we've switched to a new month. + // If so, render the current calendar and set up a new one. + // Continue printing empty months until we reach the next photo or the last month. + while (date("n", $items[$counter]->captured) != $counter_months) { + echo $calendar->render(); + print "
    "; + $counter_months++; + if ($counter_months == 13) { + $counter_months = 1; + $calendar_year++; + } + $counter_days = 0; + print "
    "; + if (date("n", $items[$counter]->captured) == $counter_months) { + $month_url = url::site("calendarview/month/" . $calendar_year . "/" . $user_id . "/" . $counter_months . "/"); + } else { + $month_url = ""; + } + $calendar = new PHPCalendar($counter_months, $calendar_year, $month_url); + } + + // If the day of the current photo is different then the day of the previous photo, + // then add a link to the calendar for this date and set the current day to this day. + if (date("j", $items[$counter]->captured) > $counter_days) { + $counter_days = date("j", $items[$counter]->captured); + $calendar->event($counter_days, url::site("calendarview/day/" . $calendar_year . "/" . $user_id . "/" . $counter_months . "/" . $counter_days)); + } + + // Move onto the next photo. + $counter++; + } + + // Print out the last calendar to be generated. + echo $calendar->render(); + print "
    "; + $counter_months++; + + // If the calendar that was previously rendered was not the final month, + // then print out a few empty months to fill the remaining space. + while ($counter_months < $user_month + 1) { + print "
    "; + $month_url = ""; + $calendar = new PHPCalendar($counter_months, $calendar_year, $month_url); + echo $calendar->render(); + print "
    "; + $counter_months++; + } + +?> +


    +
    "> >>
    diff --git a/3.0/modules/captionator/controllers/captionator.php b/3.0/modules/captionator/controllers/captionator.php index 8b380f66..ee494648 100644 --- a/3.0/modules/captionator/controllers/captionator.php +++ b/3.0/modules/captionator/controllers/captionator.php @@ -1,7 +1,7 @@ "") { + if (!empty($item_id)) { $item = ORM::factory("item", $item_id); $email_body = "This message refers to type}s/{$item->id}") . "\">this page."; } @@ -83,10 +83,10 @@ class ContactOwner_Controller extends Controller { } // Set up and display the actual page. - $template = new Theme_View("page.html", "other", "Contact"); - $template->content = new View("contactowner_emailform.html"); - $template->content->sendmail_form = $this->get_email_form("-1", $item_id); - print $template; + $view = new View("contactowner_emailform.html"); + $view->sendmail_form = $this->get_email_form("-1", $item_id); + + print $view; } public function emailid($user_id, $item_id) { @@ -98,10 +98,11 @@ class ContactOwner_Controller extends Controller { } // Set up and display the actual page. - $template = new Theme_View("page.html", "other", "Contact"); - $template->content = new View("contactowner_emailform.html"); - $template->content->sendmail_form = $this->get_email_form($user_id, $item_id); - print $template; + // Set up and display the actual page. + $view = new View("contactowner_emailform.html"); + $view->sendmail_form = $this->get_email_form($user_id, $item_id); + + print $view; } public function sendemail($user_id) { @@ -154,18 +155,12 @@ class ContactOwner_Controller extends Controller { ->message($str_emailbody) ->send(); - // Display a message telling the visitor that their email has been sent. - $template = new Theme_View("page.html", "other", "Contact"); - $template->content = new View("contactowner_emailform.html"); - $template->content->sendmail_form = t("Your Message Has Been Sent."); - print $template; + message::info(t("Your Message Has Been Sent.")); + json::reply(array("result" => "success")); } else { // Set up and display the actual page. - $template = new Theme_View("page.html", "other", "Contact"); - $template->content = new View("contactowner_emailform.html"); - $template->content->sendmail_form = $form; - print $template; + json::reply(array("result" => "error", "html" => (string) $form)); } } } diff --git a/3.0/modules/contactowner/helpers/contactowner_block.php b/3.0/modules/contactowner/helpers/contactowner_block.php index b2c31500..cb7fdf79 100644 --- a/3.0/modules/contactowner/helpers/contactowner_block.php +++ b/3.0/modules/contactowner/helpers/contactowner_block.php @@ -1,7 +1,7 @@ 0) && ($userDetails[0]->email != "") && (module::get_var("contactowner", "contact_user_link") == true)) { $block->content->userLink = "item->owner_id) . "/" . $theme->item->id . "\">" . t("Contact") . " " . + $theme->item->owner_id) . "/" . $theme->item->id . "\" class='g-dialog-link'>" . t("Contact") . " " . $userDetails[0]->name . ""; $displayBlock = true; } @@ -63,10 +63,10 @@ class contactowner_block_Core { if (module::get_var("contactowner", "contact_owner_link")) { if ($theme->item()) { $block->content->ownerLink = "item->id . - "\">" . t(module::get_var("contactowner", "contact_button_text")) . ""; + "\" class='g-dialog-link'>" . t(module::get_var("contactowner", "contact_button_text")) . ""; } else { $block->content->ownerLink = "" . t(module::get_var("contactowner", "contact_button_text")) . ""; + "\" class='g-dialog-link'>" . t(module::get_var("contactowner", "contact_button_text")) . ""; } $displayBlock = true; } diff --git a/3.0/modules/contactowner/helpers/contactowner_event.php b/3.0/modules/contactowner/helpers/contactowner_event.php index 7c527155..fff17d0b 100644 --- a/3.0/modules/contactowner/helpers/contactowner_event.php +++ b/3.0/modules/contactowner/helpers/contactowner_event.php @@ -1,7 +1,7 @@ _get_view(); + } + + public function handler() { + access::verify_csrf(); + + $form = $this->_get_form(); + + if ($form->validate()) { + module::set_var("content_warning", "title", $form->content_warning->inputs["title"]->value); + module::set_var("content_warning", "message", $form->content_warning->inputs["message"]->value); + module::set_var("content_warning", "enter_link_text", $form->content_warning->inputs["enter_link_text"]->value); + //module::set_var("content_warning", "enter_link_url", $form->content_warning->inputs["enter_link_url"]->value); + module::set_var("content_warning", "exit_link_text", $form->content_warning->inputs["exit_link_text"]->value); + module::set_var("content_warning", "exit_link_url", $form->content_warning->inputs["exit_link_url"]->value); + url::redirect("admin/content_warning"); + } + print $this->_get_view($form); + } + + private function _get_view($form=null) { + $v = new Admin_View("admin.html"); + $v->content = new View("admin_content_warning.html"); + $v->content->form = empty($form) ? $this->_get_form() : $form; + return $v; + } + + private function _get_form() { + $form = new Forge("admin/content_warning/handler", "", "post", + array("id" => "gAdminContentWerning")); + $group = $form->group("content_warning"); + $group->input("title")->label(t('Title (Will be displayed within H3)'))->rules("required")->value(module::get_var("content_warning", "title")); + $group->textarea("message")->label(t('Message (you can use HTML tags)'))->rules("required")->value(module::get_var("content_warning", "message")); + $group->input("enter_link_text")->label(t('Enter Label'))->rules("required")->value(module::get_var("content_warning", "enter_link_text")); + //$group->input("enter_link_url")->label(t('Enter Url (Leave empty to redirect to the previous page)'))->value(module::get_var("content_warning", "enter_link_url")); + $group->input("exit_link_text")->label(t('Exit Label'))->rules("required")->value(module::get_var("content_warning", "exit_link_text")); + $group->input("exit_link_url")->label(t('Exit Url'))->rules("required")->value(module::get_var("content_warning", "exit_link_url")); + + $group->submit("submit")->value(t("Save")); + return $form; + } +} \ No newline at end of file diff --git a/3.1/themes/three_nids/helpers/three_nids_theme.php b/3.0/modules/content_warning/controllers/content_warning.php similarity index 74% rename from 3.1/themes/three_nids/helpers/three_nids_theme.php rename to 3.0/modules/content_warning/controllers/content_warning.php index 5552a33f..1dc489fb 100644 --- a/3.1/themes/three_nids/helpers/three_nids_theme.php +++ b/3.0/modules/content_warning/controllers/content_warning.php @@ -1,6 +1,6 @@ three_nids theme"; - } -} - +class Content_Warning_Controller extends Controller { + public function index() { + if(isset($_GET['cw'])) { + setcookie('cw_agree', '1', time() + (60 * 60 * 24), '/'); + url::redirect(item::root()->abs_url()); + } + } +} \ No newline at end of file diff --git a/3.0/modules/content_warning/css/jqModal.css b/3.0/modules/content_warning/css/jqModal.css new file mode 100644 index 00000000..d20b96ce --- /dev/null +++ b/3.0/modules/content_warning/css/jqModal.css @@ -0,0 +1,65 @@ +/* jqModal base Styling courtesy of; + Brice Burgess */ + +/* The Window's CSS z-index value is respected (takes priority). If none is supplied, + the Window's z-index value will be set to 3000 by default (via jqModal.js). */ + +.jqmWindow { + display: none; + position: fixed; + top: 5%; + left: 5%; + /*margin-left: -500px;*/ + width: 90%; + height: 90%; + background-color: #EEE; + color: #333; + border: 1px solid black; + padding: 12px; +} + +.jqmOverlay { + background-color: #000; +} + +/* Background iframe styling for IE6. Prevents ActiveX bleed-through (" type="application/x-shockwave-flash">" />" onclick="this.focus(); this.select();" readonly> - + file_url(true); + if (module::is_active("videos")) { + $items_video = ORM::factory("items_video") + ->where("item_id", "=", $item->id) + ->find(); + if ($items_video->loaded()) { + if (file_exists($item->resize_path() . ".flv")) { + $str_movie_path = str_replace("?m=", ".flv?m=", $item->resize_url(true)); + } else { + $str_movie_path = ""; + } + } + } + ?> + + + + " />width ?>" height="height ?>" src="" flashvars='config={"clip":""}'/>" onclick="this.focus(); this.select();" readonly> + + @@ -198,4 +215,4 @@ input[type="text"] { - \ No newline at end of file + diff --git a/3.0/modules/embedlinks/views/embedlinks_sidebar.html.php b/3.0/modules/embedlinks/views/embedlinks_sidebar.html.php index 21d8b7f3..0991382a 100644 --- a/3.0/modules/embedlinks/views/embedlinks_sidebar.html.php +++ b/3.0/modules/embedlinks/views/embedlinks_sidebar.html.php @@ -21,4 +21,4 @@ - \ No newline at end of file + diff --git a/3.0/modules/emboss/controllers/admin_emboss.php b/3.0/modules/emboss/controllers/admin_emboss.php new file mode 100644 index 00000000..0254f86e --- /dev/null +++ b/3.0/modules/emboss/controllers/admin_emboss.php @@ -0,0 +1,71 @@ +. * + *************************************************************************/ +class Admin_Emboss_Controller extends Admin_Controller { + public function index() { + $view = new Admin_View('admin.html'); + $view->page_title = t('Emboss'); + $view->content = new View('admin_emboss.html'); + + $images = ORM::factory('emboss_overlay')->find_all(); + + $view->content->images = $images; + $view->content->emboss_thumbs = module::get_var('emboss','thumbs',0); + $view->content->emboss_resize = module::get_var('emboss','resize',1); + $view->content->emboss_full = module::get_var('emboss','full',1); + + print $view; + } + + static function update() { + access::verify_csrf(); + emboss::update_overlay_options($_POST); + emboss::evaluate_overlays(); + emboss::check_for_dirty(); + url::redirect('admin/emboss'); + } + + static function new_overlay() { + access::verify_csrf(); + $file = $_FILES['overlay']; + emboss::upload_new_overlay($file); + emboss::check_for_dirty(); + url::redirect('admin/emboss'); + } + + static function delete_overlay() { + access::verify_csrf(); + emboss::_delete_overlay($_REQUEST['name']); + emboss::check_for_dirty(); + url::redirect('admin/emboss'); + } + + static function clear_log() { + db::build() + ->delete() + ->from('logs') + ->where('category','=','emboss') + ->execute(); + url::redirect('admin/emboss'); + } + + static function uninstall() { + access::verify_csrf(); + emboss::uninstall(); + url::redirect('admin/modules'); + } +} \ No newline at end of file diff --git a/3.0/modules/emboss/helpers/emboss.php b/3.0/modules/emboss/helpers/emboss.php new file mode 100644 index 00000000..84c50aa2 --- /dev/null +++ b/3.0/modules/emboss/helpers/emboss.php @@ -0,0 +1,459 @@ +. * + *************************************************************************/ +class emboss_Core { + + static function reconcile() + { + emboss::copy_new(VARPATH . 'albums', VARPATH . 'originals'); + emboss::remove_old(VARPATH . 'albums', VARPATH . 'originals'); + } + + private function error($msg) + { + log::error('emboss',$msg); + message::error($msg); + } + + private function success($msg) + { + log::success('emboss',$msg); + message::success($msg); + } + + private function info($msg) + { + log::info('emboss',$msg); + message::info($msg); + } + + private function copy_new($src,$dst) + { + if( ! is_dir($src) ) + return; + + if(! file_exists($dst) ) + { + log::info('emboss',"Creating directory $dst"); + if(! @mkdir($dst) ) + { + emboss::error("Failed to create $dst"); + return; + } + } + if(! is_dir($dst) ) + { + emboss::error("Existing $dst is not a directory"); + return; + } + + if( ! ($dh = opendir($src)) ) + { + emboss::error("Failed to open $src for reading"); + return; + } + + while( $file = readdir($dh) ) + { + if($file=='.'||$file=='..') + continue; + + $srcpath = $src . '/' . $file; + $dstpath = $dst . '/' . $file; + + if( is_dir($srcpath) ) + { + emboss::copy_new($srcpath, $dstpath); + } + else + { + if(! file_exists($dstpath) ) + { + log::info('emboss',"Copying $file to $dst"); + if(! @copy($srcpath,$dstpath) ) + { + emboss::error("Failed to copy $file to $dst"); + } + } + } + } + + closedir($dh); + } + + private function remove_old($src,$archive) + { + if( ! is_dir($archive) ) + return; + + if(! (file_exists($src) && is_dir($src)) ) + { + log::info('emboss',"Removing directory $src"); + emboss::rmdir_recursive($archive); + return; + } + + if( ! ($dh = opendir($archive)) ) + { + emboss::error("Failed to open $archive for reading"); + return; + } + + while( $file = readdir($dh) ) + { + if($file=='.' || $file=='..') + continue; + + $srcpath = $src . '/' . $file; + $archivepath = $archive . '/' . $file; + + if( is_dir($archivepath) ) + { + emboss::remove_old($srcpath,$archivepath); + } + else + { + if( ! file_exists($srcpath) ) + { + log::info('emboss',"Removing $file from $archive"); + if(! @unlink($archivepath) ) + emboss::error("Failed to remove $file from $archive"); + } + } + } + + closedir($dh); + } + + private function rmdir_recursive($dir) { + if(!$dh = @opendir($dir)) + return; + + while ( $obj = readdir($dh)) + { + if($obj=='.' || $obj=='..') continue; + if (!@unlink($dir.'/'.$obj)) + emboss::rmdir_recursive($dir.'/'.$obj); + } + + closedir($dh); + @rmdir($dir); + } + + static function mkdir_recursive($dir) { + $dirs = explode('/', $dir); + $newdir = ''; + for($i=1; $iselect('id') + ->from('emboss_overlays') + ->where('name','=',$name) + ->execute() + ->count(); + + if($n>0) { + emboss::error(t("Overlay named $name already exists.")); + @unlink($tmp); + return; + } + + $width = $image_info[0]; + $height = $image_info[1]; + $where1 = array('width','=',$width); + $where2 = array('height','=',$height); + $where = array($where1,$where2); + + $n = db::build() + ->select('id') + ->from('emboss_overlays') + ->where('width','=',$width) + ->where('height','=',$height) + ->execute() + ->count(); + + if($n>0) { + emboss::error(t("Overlay with dimensions $width x $height already exists.")); + @unlink($tmp); + return; + } + + @rename($tmp, VARPATH . 'modules/emboss/' . $name); + + $overlay = ORM::factory('emboss_overlay'); + $overlay->name = $name; + $overlay->width = $width; + $overlay->height = $height; + $overlay->active = 1; + $overlay->save(); + + emboss::success('Succesfully uploaded overlay ' . $file['name']); + emboss::evaluate_overlays(); + } + + static function _delete_overlay($overlay) + { + $query = db::build() + ->select('id') + ->from('emboss_overlays') + ->where('name','=',$overlay) + ->execute(); + $n = $query->count(); + + $qual = '(database table: g3_emboss_overlay)'; + if($n<1) { + message::error("Internal error... $overlay missing $qual"); + return; + } + if($n>1) { + message::error("Internal error... $overlay has multiple entries $qual"); + return; + } + + $overlay_id = $query[0]->id; + + $q = db::build() + ->from('emboss_overlays') + ->where('id','=',$overlay_id) + ->delete() + ->execute(); + + @unlink(VARPATH . 'modules/emboss/' . $overlay); + + $query = db::build() + ->update('emboss_mappings') + ->where('cur_overlay_id','=',$overlay_id) + ->set('cur_overlay_id',-1) + ->execute(); + + $query = db::build() + ->update('emboss_mappings') + ->where('best_overlay_id','=',$overlay_id) + ->set('best_overlay_id',-1) + ->execute(); + + emboss::success("Succesfully deleted $overlay"); + emboss::evaluate_overlays(); + } + + public function usage_count($overlay_id) + { + $n = db::build() + ->select() + ->from('emboss_mappings') + ->where('best_overlay_id','=',$overlay_id) + ->execute() + ->count(); + return ($n>0 ? $n : ''); + } + + static function update_overlay_options($post) + { + $options = array('method','size','gravity','transparency'); + foreach ($options as $option) { + module::set_var('emboss',$option,$post["$option"]); + } + + db::build()->update('emboss_overlays')->set('active',0)->execute(); + $activeOverlays = $post['active_overlays']; + if(is_array($activeOverlays)) { + foreach ($activeOverlays as $overlay) { + $q = ORM::factory('emboss_overlay')->where('name','=',$overlay)->find(); + $q->active=1; + $q->save(); + } + } + } + + static function evaluate_overlays() + { + $overlays = ORM::factory('emboss_overlay')->where('active','=',1)->find_all(); + $images = ORM::factory('item')->where('type','=','photo')->find_all(); + + $n_new = 0; + $n_update = 0; + $n_none = 0; + + $has_changes=0; + foreach ($images as $image) { + $overlay_id = emboss::determine_best_overlay($image,$overlays); + if($overlay_id < 0) { + $n_none++; + } + + $q = ORM::factory('emboss_mapping')->where('image_id','=',$image->id)->find(); + if( ! $q->loaded() ) { + if($overlay_id>0) { + $n_new++; + } + $q->image_id = $image->id; + $q->best_overlay_id = $overlay_id; + $q->cur_overlay_id = -1; + $q->cur_gravity = 'unset'; + $q->cur_transparency = -1; + $q->save(); + } else if($q->best_overlay_id != $overlay_id) { + if($overlay_id>0) { + $n_update++; + } + $q->best_overlay_id = $overlay_id; + $q->save(); + } + } + + if($n_none) { + emboss::info('Cannot find an overlay for '.$n_none . t2(' image',' images')); + } + if($n_new) { + emboss::info($n_new . t2(' image needs',' images need',$n_new) . + ' now have an overlay available'); + } + if($n_update) { + emboss::info(t2('This changes the overlay for 1 image', + "This changes the overlay for $n_update images", + $n_update)); + } + + if($n_none || $n_new || $n_update) { + + } else{ + message::info('All photos are being embossed with the correct overlay'); + } + } + + static function determine_best_overlay($image,$overlays=NULL) + { + if(!$overlays) { + $overlays = ORM::factory('emboss_overlay')->where('active','=',1)->find_all(); + } + + $method = module::get_var('emboss','method'); + $size = 0.01 * module::get_var('emboss','size'); + + $W = $size * $image->width; + $H = $size * $image->height; + + $bestID = -1; + $bestScore=0; + foreach ($overlays as $overlay) { + $score = $overlay->score($W,$H,$method); + if ( $score>0 && $score>$bestScore ) { + $bestScore = $score; + $bestID = $overlay->id; + } + } + return $bestID; + } + + static function check_for_dirty() + { + $q = emboss::find_dirty(); + $n = $q->count(); + if($n>0) { + $url = url::site('admin/maintenance/start/emboss_task::update_overlays?csrf=__CSRF__'); + site_status::warning( + t2("One of your photos needs to be (re)embossed. Click here to fix it", + "%count of your photos need to be (re)embossed. Click here to fix them", + $n, + array('attrs' => html::mark_clean(sprintf('href="%s" class="g-dialog-link"',$url)))), + 'emboss_dirty'); + } else { + site_status::clear('emboss_dirty'); + } + } + + public function find_dirty() + { + $gravity = module::get_var('emboss','gravity'); + $transparency = module::get_var('emboss','transparency'); + + $q = db::build() + ->select() + ->from('emboss_mappings') + ->or_where('cur_overlay_id','!=',db::expr('best_overlay_id')) + ->or_where('cur_gravity','!=',$gravity) + ->or_where('cur_transparency','!=',$transparency) + ->execute(); + + return $q; + } + + public function uninstall() + { + $items = ORM::factory('item')->find_all(); + foreach($items as $item) { + $path = $item->file_path() . $name; + $orig = str_replace(VARPATH.'albums/',VARPATH.'originals/',$path); + if(file_exists($orig)) { + @unlink($path); + @rename($orig,$path); + } + } + graphics::mark_dirty(1,1); + + Database::instance()->query('DROP TABLE {emboss_overlays}'); + Database::instance()->query('DROP TABLE {emboss_mappings}'); + Database::instancs()->query("delete from {modules} where name='emboss'"); + + log::info('emboss','module uninstalled (database dropped/overlays removed)'); + } + + +} diff --git a/3.0/modules/emboss/helpers/emboss_event.php b/3.0/modules/emboss/helpers/emboss_event.php new file mode 100644 index 00000000..c09c8f5d --- /dev/null +++ b/3.0/modules/emboss/helpers/emboss_event.php @@ -0,0 +1,121 @@ +. * + *************************************************************************/ +class emboss_event_Core { + static function admin_menu($menu,$theme) { + module::set_var('emboss','admin_menu',1); + $menu->get('content_menu') + ->append( + Menu::factory('link') + ->id('emboss') + ->label(t('Emboss')) + ->url(url::site('admin/emboss'))); + } + + static function item_moved($item,$olddir) + { + if( ! ($item->is_photo() || $item->is_album()) ) { + return; + } + + $name = $item->name; + $old_path = $olddir->file_path() . '/' . $name; + $new_path = $item->file_path(); + + if( $new_path == $old_path) { + return; + } + + $old_orig = str_replace(VARPATH . 'albums/', VARPATH . 'originals/', $old_path); + $new_orig = str_replace(VARPATH . 'albums/', VARPATH . 'originals/', $new_path); + $new_dir = str_replace('/'.$name , '',$new_orig); + + if( file_exists($old_orig)) + { + emboss::mkdir_recursive($new_dir); + @rename($old_orig,$new_orig); + log::info('emboss','Moved '.$item->name.' to '.str_replace(VARPATH,'',$new_dir)); + } + } + + static function item_updated($original,$item) + { + if( ! ($item->is_photo() || $item->is_album()) ) { + return; + } + $oldpath = $original->file_path(); + $newpath = $item->file_path(); + if( $oldpath != $newpath ) { + $oldorig = str_replace(VARPATH.'albums/',VARPATH.'originals/',$oldpath); + $neworig = str_replace(VARPATH.'albums/',VARPATH.'originals/',$newpath); + log::info('emboss',"rename $oldorig to $neworig"); + @rename($oldorig,$neworig); + } + } + + static function item_deleted($item) + { + if( ! $item->is_photo() ) { + return; + } + + $name = $item->name; + $id = $item->id; + $path = $item->file_path(); + $orig = str_replace(VARPATH.'albums/',VARPATH.'originals/',$path); + + @unlink($orig); + + db::build() + ->from('emboss_mappings') + ->where('image_id','=',$id) + ->delete() + ->execute(); + + log::info('emboss',"item_deleted: $name"); + } + + static function item_created($item) + { + if( ! $item->is_photo() ) { + return; + } + + $path = $item->file_path(); + $dirs = explode('/',$path); + array_pop($dirs); + $dir = implode('/',$dirs); + + $orig = str_replace(VARPATH.'albums/',VARPATH.'originals/',$path); + $origdir = str_replace(VARPATH.'albums/',VARPATH.'originals/',$dir); + + emboss::mkdir_recursive($origdir); + @copy($path,$orig); + + $q = ORM::factory('emboss_mapping'); + $q->image_id = $item->id; + $q->best_overlay_id = emboss::determine_best_overlay($item); + $q->cur_overlay_id = -1; + $q->cur_gravity = ''; + $q->cur_transparency = -1; + $q->save(); + + emboss::check_for_dirty(); + } + +} + diff --git a/3.0/modules/emboss/helpers/emboss_installer.php b/3.0/modules/emboss/helpers/emboss_installer.php new file mode 100644 index 00000000..663d671f --- /dev/null +++ b/3.0/modules/emboss/helpers/emboss_installer.php @@ -0,0 +1,67 @@ +. * + *************************************************************************/ +class emboss_installer { + static function install() { + $db = Database::instance(); + $db->query("CREATE TABLE IF NOT EXISTS {emboss_overlays} ( + `id` int(9) NOT NULL auto_increment, + `active` tinyint(4) NOT NULL DEFAULT 1, + `name` varchar(64) NOT NULL, + `width` int(9) NOT NULL, + `height` int(9) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY(`name`))"); + + $db->query("CREATE TABLE IF NOT EXISTS {emboss_mappings} ( + `id` int(9) NOT NULL auto_increment, + `image_id` int(9) NOT NULL, + `best_overlay_id` int(9) NOT NULL, + `cur_overlay_id` int(9), + `cur_gravity` varchar(16), + `cur_transparency` tinyint(4), + PRIMARY KEY (`id`), + UNIQUE KEY(`image_id`))"); + + @mkdir(VARPATH . 'originals'); + @mkdir(VARPATH . 'modules'); + @mkdir(VARPATH . 'modules/emboss'); + module::set_version('emboss',1); + log::success('emboss','Emboss Installed'); + } + + static function upgrade($version) + { + module::set_version('emboss',$verion=1); + log::info('emboss',"Upgrade to version $version / No action taken"); + } + + static function activate() + { + log::info('emboss','Emboss Activated'); + emboss::reconcile(); + } + + static function deactivate() + { + log::info('emboss','Emboss Deactivated'); + } + + static function uninstall() { + emboss::uninstall(); + } +} diff --git a/3.0/modules/emboss/helpers/emboss_task.php b/3.0/modules/emboss/helpers/emboss_task.php new file mode 100644 index 00000000..b0673b26 --- /dev/null +++ b/3.0/modules/emboss/helpers/emboss_task.php @@ -0,0 +1,150 @@ +. * + *************************************************************************/ +class emboss_task_Core { + + static function available_tasks() { + $q = emboss::find_dirty(); + $n = $q->count(); + + $description = ( ($n==0) + ? (t('All photo overlays are up to date') ) + : t2('one Photo needs its emboss overlay updated', + "$n Photos need their emboss overlay updated", $n) ); + + $tasks[] = Task_Definition::factory() + ->callback('emboss_task::update_overlays') + ->name(t('Update photo embossing')) + ->description($description) + ->severity($n>0 ? log::WARNING : log::SUCCESS); + return $tasks; + } + + static function update_overlays($task) + { + $errors = array(); + try { + $mode = $task->get('mode','init'); + switch($mode) { + case 'init': + $q = emboss::find_dirty(); + foreach ($q as $item) { + $ids[] = array('id'=>$item->id, + 'image_id'=>$item->image_id, + 'overlay_id'=>$item->best_overlay_id); + } + $count = count($ids); + + if($count>0) { + $task->set('ids',$ids); + $task->set('count',$count); + $task->set('current',0); + $task->set('mode','continue'); + } else { + $task->done = true; + $task->state = 'success'; + $task->percent_complete = 100; + site_status::clear('emboss_dirty'); + return; + } + break; + + case 'continue': + $ids = $task->get('ids'); + $count = $task->get('count'); + $current = $task->get('current'); + break; + } + + $i = 1*$current; + $id = $ids[$i]; + $current++; + $task->set('current',$current); + + emboss_task::do_embossing($id['id'],$id['image_id'],$id['overlay_id']); + + if($current>=$count) { + $task->done = true; + $task->state = 'success'; + $task->percent_complete = 100; + $task->status = 'Complete'; + site_status::clear('emboss_dirty'); + } else { + $task->percent_complete = $current/$count * 100; + $task->status = t("Reembossed $current of $count photos"); + } + + + } catch (Exception $e) { + Kohana_Log::add('error',(string)$e); + $task->done = true; + $task->state = 'error'; + $task->status = $e->getMessage(); + $errors[] = (string)$e; + } + if ($errors) { + $task->log($errors); + } + } + + static function do_embossing($id,$image_id,$overlay_id) + { + $gravity = module::get_var('emboss','gravity'); + $transparency = module::get_var('emboss','transparency'); + + $item = ORM::factory('item')->where('id','=',$image_id)->find(); + $path = $item->file_path() . $name; + $orig = str_replace(VARPATH.'albums/',VARPATH.'originals/',$path); + + @unlink($path); + + if($overlay_id<0) { + log::info('emboss','Remove embossing from '.$item->name); + @copy($orig,$path); + + } else { + $overlay = ORM::factory('emboss_overlay')->where('id','=',$overlay_id)->find(); + $overlay_path = VARPATH.'modules/emboss/'.$overlay->name; + + $opts['file'] = $overlay_path; + $opts['position'] = $gravity; + $opts['transparency'] = 100-$transparency; + + log::info('emboss','Embossing '.$item->name.' with '.$overlay->name); + + gallery_graphics::composite($orig,$path,$opts); + } + + $item->thumb_dirty = 1; + $item->resize_dirty = 1; + $item->save(); + + graphics::generate($item); + + db::build()->update('emboss_mappings') + ->where('id','=',$id) + ->set('cur_overlay_id',$overlay_id) + ->set('cur_gravity',$gravity) + ->set('cur_transparency',$transparency) + ->execute(); + } + + + +} + + diff --git a/3.0/modules/emboss/models/emboss_mapping.php b/3.0/modules/emboss/models/emboss_mapping.php new file mode 100644 index 00000000..1037c269 --- /dev/null +++ b/3.0/modules/emboss/models/emboss_mapping.php @@ -0,0 +1,3 @@ +. * + *************************************************************************/ +class Emboss_Overlay_Model_Core extends ORM { + protected $sorting = array('width' => 'desc', 'height' => 'desc'); + + public function score($W,$H,$function) + { + /************************************************************* + * (W,H) = Image (Width,Height) + * (w,h) = Overlay (width,height) + *************************************************************/ + + $w = $this->width; + $h = $this->height; + if( ($w>$W) || ($h>$H) ) { return 0; } + + /************************************************************* + * Minimize Margin Method + ************************************************************* + * Score = (W^2 + H^2) - ((W-w)^2 + (H-h)^2) + * = (W^2 - (W-w)^2) + (H^2 - (H-h)^2) + * = (2Ww - w^2) + (2Hh - h^2) + * = (2W-w)w + (2H-h)h + *************************************************************/ + + if($function == 'margin') { + $score = ( (2*$W - $w)*$w + (2*$H - $h)*$h ); + } + + /************************************************************* + * Aspect Ratio Weighted + ************************************************************* + * if h < w*(H/W) + * peak value = area on diagonal (w*h) + * null value = 0 on w axis (h=0) + * quadratic fit between: + * Score = W/H h^2 + * if w < h*(W/H) + * Score = H/W w^2 (by symmetry) + *************************************************************/ + + else if($function == 'diag') { + if($h*$W < $w*$H) { + $score = $h*$h*($W/$H); + } else { + $score = $w*$w*($H/$W); + } + } + + /************************************************************* + * Area Method (Default if no match to $function) + ************************************************************* + * Score = w * h + *************************************************************/ + + else { + $score = $w * $h; + } + + return $score; + } + + public function area() + { + return $this->width * $this->height; + } + +} \ No newline at end of file diff --git a/3.0/modules/emboss/module.info b/3.0/modules/emboss/module.info new file mode 100644 index 00000000..14bb7231 --- /dev/null +++ b/3.0/modules/emboss/module.info @@ -0,0 +1,7 @@ +name = "Emboss" +description = "A different watermarking module" +version = 1 +author_name = "mikemayer67" +author_url = "http://www.vmwishes.com" +info_url = "http://codex.gallery2.org/Gallery3:Modules:emboss" +discuss_url = "http://gallery.menalto.com/node/105339" diff --git a/3.0/modules/emboss/views/admin_emboss.html.php b/3.0/modules/emboss/views/admin_emboss.html.php new file mode 100644 index 00000000..86745948 --- /dev/null +++ b/3.0/modules/emboss/views/admin_emboss.html.php @@ -0,0 +1,125 @@ + +/************************************************************************* + * Copyright (C) 2012 Michel A. Mayer * + * * + * 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 3 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, see . * + *************************************************************************/ + + +
    +
    +

    Upload New Overlay

    + + +'overlay','style'=>'margin: .5em 0 .5em 0'))?> +'Upload','style'=>'display:block; float:none'),'Upload')?> + +
    +
    +
    +'options'))?> + +

    Available Overlays

    + + + + + + + + + name; + $data['checked'] = $image->active; + ?> + + + + + + + + +
    ActiveImageSizeUsage
    name?>width?> x height?>id)?>name.'&csrf='.access::csrf_token(), 'delete')?>
    +Check All / +Uncheck All +
    +'Update','style'=>'display:block; float:none'),'Update')?> +
    +

    Embossing Parameters

    + + + + + + + + +0; $i-=5) { $sizes["$i"]="$i%"; } ?> + + + + + + + +
    Best Fit Method:'Maximum Overlay Area', + 'margin'=>'Minimize Borders', + 'diag' =>'Aspect Ratio Weighted'), + module::get_var('emboss','method','area')) ?>
    Location: 'Northwest', + 'north' => 'North', + 'northeast' => 'Northeast', + 'east' => 'East', + 'southeast' => 'Southeast', + 'south' => 'South', + 'southwest' => 'Southwest', + 'south' => 'South', + 'center' => 'Center'), + module::get_var('emboss','gravity','Center')) ?>
    Desired Size:
    Transparency:
    +
    +'Update','style'=>'display:block; float:none'),'Update')?> +
    +
    +
    + + + +
    diff --git a/3.0/modules/exif_gps/controllers/admin_exif_gps.php b/3.0/modules/exif_gps/controllers/admin_exif_gps.php index 0abc5f25..fc563975 100644 --- a/3.0/modules/exif_gps/controllers/admin_exif_gps.php +++ b/3.0/modules/exif_gps/controllers/admin_exif_gps.php @@ -1,7 +1,7 @@ _get_admin_form(); if ($form->validate()) { - Kohana_Log::add("error",print_r($form,1)); - // Save settings to Gallery's database. module::set_var("exif_gps", "googlemap_api_key", $form->Global->google_api_key->value); module::set_var("exif_gps", "googlemap_max_autozoom", $form->Global->max_auto_zoom_level->value); + module::set_var("exif_gps", "markercluster_gridsize", $form->markercluster->markercluster_gridsize->value); + module::set_var("exif_gps", "markercluster_maxzoom", $form->markercluster->markercluster_maxzoom->value); module::set_var("exif_gps", "sidebar_zoom", $form->Sidebar->sidebar_default_zoom->value); module::set_var("exif_gps", "sidebar_mapformat", $form->Sidebar->sidebar_mapformat->value); module::set_var("exif_gps", "sidebar_maptype", $form->Sidebar->sidebar_maptype->value); module::set_var("exif_gps", "largemap_maptype", $form->LargeMap->largemap_maptype->value); - $checkbox_album = false; - $checkbox_user = false; - for ($i = 0; $i < count($form->Global->toolbar_map_album); $i++) { - if ($form->Global->toolbar_map_album->value[$i] == "checkbox_album") { - $checkbox_album = true; - } - } - for ($i = 0; $i < count($form->Global->toolbar_map_user); $i++) { - if ($form->Global->toolbar_map_user->value[$i] == "checkbox_user") { - $checkbox_user = true; - } - } - module::set_var("exif_gps", "toolbar_map_album", $checkbox_album); - module::set_var("exif_gps", "toolbar_map_user", $checkbox_user); + module::set_var("exif_gps", "toolbar_map_album", $form->Global->toolbar_map_album->value); + module::set_var("exif_gps", "toolbar_map_user", $form->Global->toolbar_map_user->value); + module::set_var("exif_gps", "restrict_maps", $form->Global->restrict_maps->value); // Display a success message and redirect back to the TagsMap admin page. message::success(t("Your settings have been saved.")); @@ -81,18 +70,29 @@ class Admin_EXIF_GPS_Controller extends Admin_Controller { $gps_global_group = $form->group("Global") ->label(t("Global Settings")); $gps_global_group->input("google_api_key") - ->label(t("Google Maps API Key")) - ->value(module::get_var("exif_gps", "googlemap_api_key")) - ->rules("required"); + ->label(t("Google APIs Console key (optional):")) + ->value(module::get_var("exif_gps", "googlemap_api_key")); $gps_global_group->input("max_auto_zoom_level") ->label(t("Maximum Auto-Zoom Level:")) ->value(module::get_var("exif_gps", "googlemap_max_autozoom")); - $checkbox_user["checkbox_user"] = array(t("Show \"Map this user\" icon?"), module::get_var("exif_gps", "toolbar_map_user")); - $checkbox_album["checkbox_album"] = array(t("Show \"Map this album\" icon?"), module::get_var("exif_gps", "toolbar_map_album")); - $gps_global_group->checklist("toolbar_map_album") - ->options($checkbox_album); - $gps_global_group->checklist("toolbar_map_user") - ->options($checkbox_user); + $gps_global_group->checkbox("toolbar_map_album")->label(t("Show \"Map this album\" icon?")) + ->checked(module::get_var("exif_gps", "toolbar_map_album", false)); + $gps_global_group->checkbox("toolbar_map_user")->label(t("Show \"Map this user\" icon?")) + ->checked(module::get_var("exif_gps", "toolbar_map_user", false)); + $gps_global_group->checkbox("restrict_maps")->label(t("Restrict maps to registered users?")) + ->checked(module::get_var("exif_gps", "restrict_maps", false)); + + // Create a group for marker cluster settings + $gps_markercluster = $form->group("markercluster") + ->label(t("Marker Cluster Settings")); + $gps_markercluster->input("markercluster_gridsize") + ->label(t("Grid Size")) + ->value(module::get_var("exif_gps", "markercluster_gridsize")) + ->rules("required"); + $gps_markercluster->input("markercluster_maxzoom") + ->label(t("Max Zoom")) + ->value(module::get_var("exif_gps", "markercluster_maxzoom")) + ->rules("required"); // Create a group for sidebar settings $gps_sidebar = $form->group("Sidebar") diff --git a/3.0/modules/exif_gps/controllers/exif_gps.php b/3.0/modules/exif_gps/controllers/exif_gps.php index 52b94b9d..23ae186b 100644 --- a/3.0/modules/exif_gps/controllers/exif_gps.php +++ b/3.0/modules/exif_gps/controllers/exif_gps.php @@ -1,7 +1,7 @@ abs_url()); + } + + public function xml($query_type, $query_id, $offset) { + // Generate an xml output of the photos to be mapped. + // $query_type can be either "album" or "user", $query_id is the id# of the album or user to map. + + // If the user can't view maps, don't let them view the xml. + if ((module::get_var("exif_gps", "restrict_maps") == true) && (identity::active_user()->guest)) { + throw new Kohana_404_Exception(); + } + + $items = ""; + if ($query_type == "user") { + $items = ORM::factory("item") + ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") + ->where("items.owner_id", "=", $query_id) + ->viewable() + ->order_by("exif_coordinates.latitude", "ASC") + ->find_all(EXIF_GPS_Controller::$xml_records_limit, $offset); + } elseif ($query_type == "album") { + $items = ORM::factory("item", $query_id) ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") ->viewable() ->order_by("exif_coordinates.latitude", "ASC") - ->descendants(); + ->descendants(EXIF_GPS_Controller::$xml_records_limit, $offset); + } + + $v = new View("exif_gps_coordinates_xml.html"); + $v->items = $items; + header("Content-type: text/xml; charset=utf-8"); + print $v; + } + + public function map($map_type, $type_id) { + // Map all items in the specified album or user. + // Valid values for $map_type are "album" or "user", $type_id is either an + // album id# or a user id#. + + // If the user can't view maps, throw a 404 error. + if ((module::get_var("exif_gps", "restrict_maps") == true) && (identity::active_user()->guest)) { + throw new Kohana_404_Exception(); + } + + // Figure out what to display for the page title and how many items to display. + $map_title = ""; + $items_count = 0; + if ($map_type == "album") { $curr_album = ORM::factory("item")->where("id", "=", $type_id)->find_all(); $map_title = $curr_album[0]->title; + $items_count = ORM::factory("item", $type_id) + ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") + ->viewable() + ->order_by("exif_coordinates.latitude", "ASC") + ->descendants_count(); } elseif ($map_type == "user") { - // Generate an array of all items uploaded by the current user that - // have exif gps coordinates and order by latitude (to group items - // w/ the same coordinates together). - $items = ORM::factory("item") + $curr_user = ORM::factory("user")->where("id", "=", $type_id)->find_all(); + $map_title = $curr_user[0]->full_name . "'s " . t("Photos"); + $items_count = ORM::factory("item") ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") ->where("items.owner_id", "=", $type_id) ->viewable() ->order_by("exif_coordinates.latitude", "ASC") - ->find_all(); - $curr_user = ORM::factory("user")->where("id", "=", $type_id)->find_all(); - $map_title = $curr_user[0]->full_name . "'s " . t("Photos"); + ->count_all(); } - // Make a new page. - $template = new Theme_View("page.html", "other", "EXIFMap"); + // Set up breadcrumbs. + $breadcrumbs = array(); + if ($map_type == "album") { + $counter = 0; + $breadcrumbs[] = Breadcrumb::instance(t("Map"), url::site("exif_gps/map/album/{$type_id}"))->set_last(); + $parent_item = ORM::factory("item", $type_id); + while ($parent_item->id != 1) { + $breadcrumbs[] = Breadcrumb::instance($parent_item->title, $parent_item->url()); + $parent_item = ORM::factory("item", $parent_item->parent_id); + } + $breadcrumbs[] = Breadcrumb::instance($parent_item->title, $parent_item->url())->set_first(); + $breadcrumbs = array_reverse($breadcrumbs, true); + } else { + $root = item::root(); + $breadcrumbs[] = Breadcrumb::instance($root->title, $root->url())->set_first(); + $breadcrumbs[] = Breadcrumb::instance(t("Photo Map"), url::site("exif_gps/map/{$map_type}/{$type_id}"))->set_last(); + } + + // Set up and display the actual page. + $template = new Theme_View("page.html", "other", "EXIF_GPS_MAP"); $template->page_title = t("Gallery :: Map"); + $template->set_global(array("breadcrumbs" => $breadcrumbs)); $template->content = new View("exif_gps_map.html"); if ($map_title == "") { $template->content->title = t("Map"); @@ -59,17 +122,18 @@ class EXIF_GPS_Controller extends Controller { // Figure out default map type. $int_map_type = module::get_var("exif_gps", "largemap_maptype"); - if ($int_map_type == 0) $map_type = "ROADMAP"; - if ($int_map_type == 1) $map_type = "SATELLITE"; - if ($int_map_type == 2) $map_type = "HYBRID"; - if ($int_map_type == 3) $map_type = "TERRAIN"; - $template->content->map_type = $map_type; + if ($int_map_type == 0) $map_display_type = "ROADMAP"; + if ($int_map_type == 1) $map_display_type = "SATELLITE"; + if ($int_map_type == 2) $map_display_type = "HYBRID"; + if ($int_map_type == 3) $map_display_type = "TERRAIN"; + $template->content->map_type = $map_display_type; - // When mapping an album, generate a "return to album" link. - if (isset($curr_album)) $template->content->return_url = url::abs_site("{$curr_album[0]->type}s/{$curr_album[0]->id}"); + // These are used to set up the URL to the xml file. + $template->content->query_type = $map_type; + $template->content->query_id = $type_id; + $template->content->items_count = $items_count; // Load in module preferences. - $template->content->items = $items; $template->content->google_map_key = module::get_var("exif_gps", "googlemap_api_key"); // Display the page. diff --git a/3.0/modules/exif_gps/helpers/exif_gps.php b/3.0/modules/exif_gps/helpers/exif_gps.php index 823b4b29..c706519f 100644 --- a/3.0/modules/exif_gps/helpers/exif_gps.php +++ b/3.0/modules/exif_gps/helpers/exif_gps.php @@ -1,7 +1,7 @@ guest)) { + return; + } + switch ($block_id) { case "exif_gps_maps": // Display links to a map of the current album and // a map of the current user. if ($theme->item()) { $album_id = ""; + $user_name = ""; $item = $theme->item; if ($item->is_album()) { $album_id = $item->id; @@ -39,20 +45,22 @@ class exif_gps_block_Core { $album_id = $item->parent_id; } $curr_user = ORM::factory("user")->where("id", "=", $item->owner_id)->find_all(); - $user_name = $curr_user[0]->full_name; + if (count($curr_user) > 0) { + $user_name = $curr_user[0]->full_name; + } // Make sure there are actually map-able items to display. $album_items_count = ORM::factory("item", $album_id) ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") ->viewable() ->order_by("exif_coordinates.latitude", "ASC") - ->descendants_count(); + ->descendants_count(1); $user_items_count = ORM::factory("item") ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") ->where("items.owner_id", "=", $item->owner_id) ->viewable() ->order_by("exif_coordinates.latitude", "ASC") - ->count_all(); + ->count_all(1); if (($album_items_count > 0) || ($user_items_count > 0)) { $block = new Block(); @@ -115,6 +123,7 @@ class exif_gps_block_Core { if (module::get_var("exif_gps", "sidebar_maptype") == 1) $block->content->sidebar_map_type = "SATELLITE"; if (module::get_var("exif_gps", "sidebar_maptype") == 2) $block->content->sidebar_map_type = "HYBRID"; if (module::get_var("exif_gps", "sidebar_maptype") == 3) $block->content->sidebar_map_type = "TERRAIN"; + $block->content->items_count = 1; } else { $block->content = new View("exif_gps_static_sidebar.html"); if (module::get_var("exif_gps", "sidebar_maptype") == 0) $block->content->sidebar_map_type = "roadmap"; @@ -126,21 +135,24 @@ class exif_gps_block_Core { $block->content->longitude = $longitude; } elseif (($theme->item()) && ($theme->item->is_album() && (module::get_var("exif_gps", "sidebar_mapformat") == 1))) { // If coordinates were NOT found, and this is an album with a dynamic map, then map the contents of the album. - $items = ORM::factory("item", $theme->item->id) + $items_count = ORM::factory("item", $theme->item->id) ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") ->viewable() ->order_by("exif_coordinates.latitude", "ASC") - ->descendants(); - if (count($items) > 0) { + ->descendants_count(); + if ($items_count > 0) { $block = new Block(); $block->css_id = "g-exif-gps-location"; $block->title = t("Location"); - $block->content = new View("exif_gps_dynamic2_sidebar.html"); + $block->content = new View("exif_gps_dynamic_sidebar.html"); if (module::get_var("exif_gps", "sidebar_maptype") == 0) $block->content->sidebar_map_type = "ROADMAP"; if (module::get_var("exif_gps", "sidebar_maptype") == 1) $block->content->sidebar_map_type = "SATELLITE"; if (module::get_var("exif_gps", "sidebar_maptype") == 2) $block->content->sidebar_map_type = "HYBRID"; if (module::get_var("exif_gps", "sidebar_maptype") == 3) $block->content->sidebar_map_type = "TERRAIN"; - $block->content->items = $items; + $block->content->album_id = $theme->item->id; + $block->content->latitude = 0; + $block->content->longitude = 0; + $block->content->items_count = $items_count; $block->content->google_map_key = module::get_var("exif_gps", "googlemap_api_key"); } } diff --git a/3.0/modules/exif_gps/helpers/exif_gps_event.php b/3.0/modules/exif_gps/helpers/exif_gps_event.php index 9ee59df9..1c19a941 100644 --- a/3.0/modules/exif_gps/helpers/exif_gps_event.php +++ b/3.0/modules/exif_gps/helpers/exif_gps_event.php @@ -1,7 +1,7 @@ guest)) { + return; + } + $album_id = ""; $item = $theme->item; if ($item->is_album()) { @@ -139,6 +146,13 @@ class exif_gps_event_Core { } static function movie_menu($menu, $theme) { + // Adds album and user map icons to movie pages. + + // Do not display icons if the user can't view the page. + if ((module::get_var("exif_gps", "restrict_maps") == true) && (identity::active_user()->guest)) { + return; + } + $album_id = ""; $item = $theme->item; if ($item->is_album()) { @@ -177,8 +191,15 @@ class exif_gps_event_Core { ->css_id("g-exif-gps-user-link")); } } - + static function album_menu($menu, $theme) { + // Adds album and user map icons to album pages. + + // Do not display icons if the user can't view the page. + if ((module::get_var("exif_gps", "restrict_maps") == true) && (identity::active_user()->guest)) { + return; + } + $album_id = ""; $item = $theme->item; if ($item->is_album()) { @@ -217,4 +238,37 @@ class exif_gps_event_Core { ->css_id("g-exif-gps-user-link")); } } + + static function show_user_profile($data) { + // Display a map on the user profile pages. + + // Make sure the user can view maps before displaying one. + if ((module::get_var("exif_gps", "restrict_maps") == true) && (identity::active_user()->guest)) { + return; + } + + // If there's nothing to map, hide the map. + $items_count = ORM::factory("item") + ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") + ->where("items.owner_id", "=", $data->user->id) + ->viewable() + ->order_by("exif_coordinates.latitude", "ASC") + ->count_all(); + if ($items_count == 0) { + return; + } + + // Display the map block. + $v = new View("user_profile_exif_gps.html"); + $int_map_type = module::get_var("exif_gps", "largemap_maptype"); + if ($int_map_type == 0) $map_type = "ROADMAP"; + if ($int_map_type == 1) $map_type = "SATELLITE"; + if ($int_map_type == 2) $map_type = "HYBRID"; + if ($int_map_type == 3) $map_type = "TERRAIN"; + $v->map_type = $map_type; + $v->user_id = $data->user->id; + $v->items_count = $items_count; + $v->google_map_key = module::get_var("exif_gps", "googlemap_api_key"); + $data->content[] = (object) array("title" => t("Photo Map"), "view" => $v); + } } diff --git a/3.0/modules/exif_gps/helpers/exif_gps_installer.php b/3.0/modules/exif_gps/helpers/exif_gps_installer.php index 9dc77968..4f346b4c 100644 --- a/3.0/modules/exif_gps/helpers/exif_gps_installer.php +++ b/3.0/modules/exif_gps/helpers/exif_gps_installer.php @@ -1,7 +1,7 @@ get("completed"); // Generate an array of the next 100 photos to check. - //$all_photos = ORM::factory("item") - // ->where("id", ">", $last_id) - // ->where("type", "=", "photo") - // ->order_by("id") - // ->find_all(100); // Check each photo in the array to see if it already has exif gps data associated with it. // If it doesn't, attempt to extract gps coordinates. diff --git a/3.0/modules/exif_gps/helpers/exif_gps_theme.php b/3.0/modules/exif_gps/helpers/exif_gps_theme.php index 90431195..8a6bfd0c 100644 --- a/3.0/modules/exif_gps/helpers/exif_gps_theme.php +++ b/3.0/modules/exif_gps/helpers/exif_gps_theme.php @@ -1,7 +1,7 @@ css("exif_gps_menu.css"); + return $theme->css("exif_gps_menu.css") . + $theme->script("markerclusterer_compiled.js"); } } diff --git a/3.0/modules/exif_gps/images/exif_gps-loading-map-large.gif b/3.0/modules/exif_gps/images/exif_gps-loading-map-large.gif new file mode 100644 index 00000000..a259e22f Binary files /dev/null and b/3.0/modules/exif_gps/images/exif_gps-loading-map-large.gif differ diff --git a/3.0/modules/exif_gps/js/markerclusterer_compiled.js b/3.0/modules/exif_gps/js/markerclusterer_compiled.js new file mode 100644 index 00000000..4ddf3045 --- /dev/null +++ b/3.0/modules/exif_gps/js/markerclusterer_compiled.js @@ -0,0 +1,21 @@ +(function(){var d=null;function e(a){return function(b){this[a]=b}}function h(a){return function(){return this[a]}}var j; +function k(a,b,c){this.extend(k,google.maps.OverlayView);this.c=a;this.a=[];this.f=[];this.ca=[53,56,66,78,90];this.j=[];this.A=!1;c=c||{};this.g=c.gridSize||60;this.l=c.minimumClusterSize||2;this.J=c.maxZoom||d;this.j=c.styles||[];this.X=c.imagePath||this.Q;this.W=c.imageExtension||this.P;this.O=!0;if(c.zoomOnClick!=void 0)this.O=c.zoomOnClick;this.r=!1;if(c.averageCenter!=void 0)this.r=c.averageCenter;l(this);this.setMap(a);this.K=this.c.getZoom();var f=this;google.maps.event.addListener(this.c, +"zoom_changed",function(){var a=f.c.getZoom();if(f.K!=a)f.K=a,f.m()});google.maps.event.addListener(this.c,"idle",function(){f.i()});b&&b.length&&this.C(b,!1)}j=k.prototype;j.Q="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m";j.P="png";j.extend=function(a,b){return function(a){for(var b in a.prototype)this.prototype[b]=a.prototype[b];return this}.apply(a,[b])};j.onAdd=function(){if(!this.A)this.A=!0,n(this)};j.draw=function(){}; +function l(a){if(!a.j.length)for(var b=0,c;c=a.ca[b];b++)a.j.push({url:a.X+(b+1)+"."+a.W,height:c,width:c})}j.S=function(){for(var a=this.o(),b=new google.maps.LatLngBounds,c=0,f;f=a[c];c++)b.extend(f.getPosition());this.c.fitBounds(b)};j.z=h("j");j.o=h("a");j.V=function(){return this.a.length};j.ba=e("J");j.I=h("J");j.G=function(a,b){for(var c=0,f=a.length,g=f;g!==0;)g=parseInt(g/10,10),c++;c=Math.min(c,b);return{text:f,index:c}};j.$=e("G");j.H=h("G"); +j.C=function(a,b){for(var c=0,f;f=a[c];c++)q(this,f);b||this.i()};function q(a,b){b.s=!1;b.draggable&&google.maps.event.addListener(b,"dragend",function(){b.s=!1;a.L()});a.a.push(b)}j.q=function(a,b){q(this,a);b||this.i()};function r(a,b){var c=-1;if(a.a.indexOf)c=a.a.indexOf(b);else for(var f=0,g;g=a.a[f];f++)if(g==b){c=f;break}if(c==-1)return!1;b.setMap(d);a.a.splice(c,1);return!0}j.Y=function(a,b){var c=r(this,a);return!b&&c?(this.m(),this.i(),!0):!1}; +j.Z=function(a,b){for(var c=!1,f=0,g;g=a[f];f++)g=r(this,g),c=c||g;if(!b&&c)return this.m(),this.i(),!0};j.U=function(){return this.f.length};j.getMap=h("c");j.setMap=e("c");j.w=h("g");j.aa=e("g"); +j.v=function(a){var b=this.getProjection(),c=new google.maps.LatLng(a.getNorthEast().lat(),a.getNorthEast().lng()),f=new google.maps.LatLng(a.getSouthWest().lat(),a.getSouthWest().lng()),c=b.fromLatLngToDivPixel(c);c.x+=this.g;c.y-=this.g;f=b.fromLatLngToDivPixel(f);f.x-=this.g;f.y+=this.g;c=b.fromDivPixelToLatLng(c);b=b.fromDivPixelToLatLng(f);a.extend(c);a.extend(b);return a};j.R=function(){this.m(!0);this.a=[]}; +j.m=function(a){for(var b=0,c;c=this.f[b];b++)c.remove();for(b=0;c=this.a[b];b++)c.s=!1,a&&c.setMap(d);this.f=[]};j.L=function(){var a=this.f.slice();this.f.length=0;this.m();this.i();window.setTimeout(function(){for(var b=0,c;c=a[b];b++)c.remove()},0)};j.i=function(){n(this)}; +function n(a){if(a.A)for(var b=a.v(new google.maps.LatLngBounds(a.c.getBounds().getSouthWest(),a.c.getBounds().getNorthEast())),c=0,f;f=a.a[c];c++)if(!f.s&&b.contains(f.getPosition())){for(var g=a,u=4E4,o=d,v=0,m=void 0;m=g.f[v];v++){var i=m.getCenter();if(i){var p=f.getPosition();if(!i||!p)i=0;else var w=(p.lat()-i.lat())*Math.PI/180,x=(p.lng()-i.lng())*Math.PI/180,i=Math.sin(w/2)*Math.sin(w/2)+Math.cos(i.lat()*Math.PI/180)*Math.cos(p.lat()*Math.PI/180)*Math.sin(x/2)*Math.sin(x/2),i=6371*2*Math.atan2(Math.sqrt(i), +Math.sqrt(1-i));i=this.l&&a.setMap(d); +a=this.c.getZoom();if((b=this.k.I())&&a>b)for(a=0;b=this.a[a];a++)b.setMap(this.c);else if(this.a.length0&&a.e[0]0&&a.e[1] diff --git a/3.0/modules/exif_gps/views/exif_gps_coordinates_xml.html.php b/3.0/modules/exif_gps/views/exif_gps_coordinates_xml.html.php new file mode 100644 index 00000000..c858a236 --- /dev/null +++ b/3.0/modules/exif_gps/views/exif_gps_coordinates_xml.html.php @@ -0,0 +1,13 @@ + +\n"; ?> + + +where("item_id", "=", $item->id)->find(); ?> +thumb_img(array("class" => "g-exif-gps-thumbnail"))); ?> + + +", ">", $str_thumb_html); ?> + + id}"); ?>" thumb="" /> + + diff --git a/3.0/modules/exif_gps/views/exif_gps_dynamic2_sidebar.html.php b/3.0/modules/exif_gps/views/exif_gps_dynamic2_sidebar.html.php deleted file mode 100644 index f4f95799..00000000 --- a/3.0/modules/exif_gps/views/exif_gps_dynamic2_sidebar.html.php +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - diff --git a/3.0/modules/exif_gps/views/exif_gps_dynamic_sidebar.html.php b/3.0/modules/exif_gps/views/exif_gps_dynamic_sidebar.html.php index ff28e101..d8465d4a 100644 --- a/3.0/modules/exif_gps/views/exif_gps_dynamic_sidebar.html.php +++ b/3.0/modules/exif_gps/views/exif_gps_dynamic_sidebar.html.php @@ -1,22 +1,169 @@ - + - + + + +
    +
    +
    +

    +

    + " style="vertical-align: middle;"> +

    +
    +
    diff --git a/3.0/modules/exif_gps/views/exif_gps_map.html.php b/3.0/modules/exif_gps/views/exif_gps_map.html.php index 95f6221c..458c0d88 100644 --- a/3.0/modules/exif_gps/views/exif_gps_map.html.php +++ b/3.0/modules/exif_gps/views/exif_gps_map.html.php @@ -1,66 +1,135 @@ - + + +
    dynamic_top() ?> @@ -89,8 +177,13 @@


    -
    - -
    - +
    +
    +
    +

    +

    + " style="vertical-align: middle;"> +

    +
    +
    dynamic_bottom() ?> diff --git a/3.0/modules/exif_gps/views/exif_gps_maps_sidebar.html.php b/3.0/modules/exif_gps/views/exif_gps_maps_sidebar.html.php index 495554ac..7425bf45 100644 --- a/3.0/modules/exif_gps/views/exif_gps_maps_sidebar.html.php +++ b/3.0/modules/exif_gps/views/exif_gps_maps_sidebar.html.php @@ -1,9 +1,9 @@
      - 0): ?> + 0)): ?>
    • ">
    • - 0): ?> + 0)): ?>
    • ">
    diff --git a/3.0/modules/exif_gps/views/exif_gps_static_sidebar.html.php b/3.0/modules/exif_gps/views/exif_gps_static_sidebar.html.php index 11d80c74..39c4918a 100644 --- a/3.0/modules/exif_gps/views/exif_gps_static_sidebar.html.php +++ b/3.0/modules/exif_gps/views/exif_gps_static_sidebar.html.php @@ -1,2 +1,8 @@ -&size=205x214&maptype=&markers=color:red|color:red|,&sensor=false"> + +&size=205x214&maptype=&markers=color:red|color:red|,&sensor=false"> diff --git a/3.0/modules/exif_gps/views/user_profile_exif_gps.html.php b/3.0/modules/exif_gps/views/user_profile_exif_gps.html.php new file mode 100644 index 00000000..ebb9e33f --- /dev/null +++ b/3.0/modules/exif_gps/views/user_profile_exif_gps.html.php @@ -0,0 +1,181 @@ + + + + + + +
    +
    +
    +

    +

    + " style="vertical-align: middle;"> +

    +
    +
    diff --git a/3.0/modules/export_facebook/controllers/export_facebook.php b/3.0/modules/export_facebook/controllers/export_facebook.php index e40f9a40..d8b81a8d 100644 --- a/3.0/modules/export_facebook/controllers/export_facebook.php +++ b/3.0/modules/export_facebook/controllers/export_facebook.php @@ -1,7 +1,7 @@ _get_view(); + } + + private function _get_view($form=null) { + $view = new Admin_View("admin.html"); + $view->page_title = t("Fit to Screen parameters"); + + $view->content = new View("admin_fittoscreen.html"); + $view->content->form = (empty($form) ? $this->_get_form() : $form) ; + + return $view; + } + + private function _get_form() { + $form = new Forge("admin/fittoscreen/save", "", "post", array("id" => "g-admin-form")); + + $form->dropdown("width_unit")->label(t("Image width unit"))->options(array("px"=>"pixel margin","pr"=>"max pourcentage"))->selected(module::get_var("fittoscreen", "width_unit")); + $form->input("width")->label(t('width'))->rules("required|valid_numeric|length[1,5]")->value(module::get_var("fittoscreen", "width")); + $form->dropdown("height_unit")->label(t("Image height unit"))->options(array("px"=>"pixel margin","pr"=>"max pourcentage"))->selected(module::get_var("fittoscreen", "height_unit")); + $form->input("height")->label(t('height'))->rules("required|valid_numeric|length[1,5]")->value(module::get_var("fittoscreen", "height")); + + $form->submit("submit")->value(t("Save")); + return $form; + } + + public function save(){ + access::verify_csrf(); + + $form = $this->_get_form(); + if ($form->validate()) { + module::set_var("fittoscreen", "width_unit", $form->width_unit->value); + module::set_var("fittoscreen", "width", $form->width->value); + module::set_var("fittoscreen", "height_unit", $form->height_unit->value); + module::set_var("fittoscreen", "height", $form->height->value); + + } + + print $this->_get_view($form); + } +} + +?> diff --git a/3.0/modules/fittoscreen/helpers/fittoscreen_event.php b/3.0/modules/fittoscreen/helpers/fittoscreen_event.php new file mode 100644 index 00000000..5dbe65f7 --- /dev/null +++ b/3.0/modules/fittoscreen/helpers/fittoscreen_event.php @@ -0,0 +1,13 @@ +get("settings_menu") + ->append(Menu::factory("link") + ->id("fittoscreen_menu") + ->label(t("Fit to Screen")) + ->url(url::site("admin/fittoscreen"))); + } +} + +?> diff --git a/3.0/modules/fittoscreen/helpers/fittoscreen_installer.php b/3.0/modules/fittoscreen/helpers/fittoscreen_installer.php new file mode 100644 index 00000000..0e4b7ec0 --- /dev/null +++ b/3.0/modules/fittoscreen/helpers/fittoscreen_installer.php @@ -0,0 +1,14 @@ + + diff --git a/3.0/modules/fittoscreen/helpers/fittoscreen_theme.php b/3.0/modules/fittoscreen/helpers/fittoscreen_theme.php new file mode 100644 index 00000000..de804e95 --- /dev/null +++ b/3.0/modules/fittoscreen/helpers/fittoscreen_theme.php @@ -0,0 +1,9 @@ + diff --git a/3.0/modules/fittoscreen/module.info b/3.0/modules/fittoscreen/module.info new file mode 100644 index 00000000..39067339 --- /dev/null +++ b/3.0/modules/fittoscreen/module.info @@ -0,0 +1,7 @@ +name = "Fit to Screen" +description = "Dynamicaly resize the photo size to fit the screen.
    Version 1.0 | By Matthieu Bouthors | Visit plugin Site | Support | Settings" +version = 10 +author_name = "Matthieu Bouthors" +author_url = "http://www.bouthors.fr" +info_url = "http://codex.gallery2.org/Gallery3:Modules:Fittoscreen" +discuss_url = "http://gallery.menalto.com/node/103929" diff --git a/3.1/modules/adsense/views/admin_adsense.html.php b/3.0/modules/fittoscreen/views/admin_fittoscreen.html.php similarity index 75% rename from 3.1/modules/adsense/views/admin_adsense.html.php rename to 3.0/modules/fittoscreen/views/admin_fittoscreen.html.php index f994fae5..dffd8e8d 100644 --- a/3.1/modules/adsense/views/admin_adsense.html.php +++ b/3.0/modules/fittoscreen/views/admin_fittoscreen.html.php @@ -1,6 +1,6 @@
    -

    +

    diff --git a/3.0/modules/fittoscreen/views/fittoscreen_photo.html.php b/3.0/modules/fittoscreen/views/fittoscreen_photo.html.php new file mode 100644 index 00000000..762a588d --- /dev/null +++ b/3.0/modules/fittoscreen/views/fittoscreen_photo.html.php @@ -0,0 +1,35 @@ + + + diff --git a/3.0/modules/fotomotorw/controllers/admin_fotomotorw.php b/3.0/modules/fotomotorw/controllers/admin_fotomotorw.php new file mode 100644 index 00000000..f487b53a --- /dev/null +++ b/3.0/modules/fotomotorw/controllers/admin_fotomotorw.php @@ -0,0 +1,111 @@ +page_title = t("Fotomoto"); + $view->content = new View("admin_fotomotorw.html"); + + // Generate a form to allow the user to choose which links to display under photos. + $form = new Forge("admin/fotomotorw/savedisplay", "", "post", + array("id" => "g-fotomotorw-admin-display-prefs")); + + $display_links_group = $form->group("fotomoto_display_links_group"); + $link_options["fotomoto_buy_prints"] = array(t("Buy Prints"), module::get_var("fotomotorw", "fotomoto_buy_prints")); + $link_options["fotomoto_buy_cards"] = array(t("Buy Cards"), module::get_var("fotomotorw", "fotomoto_buy_cards")); + $link_options["fotomoto_buy_download"] = array(t("Download"), module::get_var("fotomotorw", "fotomoto_buy_download")); + $link_options["fotomoto_share_ecard"] = array(t("Send eCard"), module::get_var("fotomotorw", "fotomoto_share_ecard")); + $link_options["fotomoto_share_facebook"] = array(t("Share on Facebook"), module::get_var("fotomotorw", "fotomoto_share_facebook")); + $link_options["fotomoto_share_twitter"] = array(t("Share on Twitter"), module::get_var("fotomotorw", "fotomoto_share_twitter")); + $link_options["fotomoto_share_digg"] = array(t("Share on Digg"), module::get_var("fotomotorw", "fotomoto_share_digg")); + + // Turn the array into a series of checkboxes. + $display_links_group->checklist("fotomoto_display_links") + ->options($link_options); + + // Add a save button to the form. + $form->submit("SaveSettings")->value(t("Save")); + + $view->content->display_form = $form; + print $view; + } + + public function reset_private_key() { + // Generate a new (random) private key. + module::set_var("fotomotorw", "fotomoto_private_key", md5(random::hash() . access::private_key())); + message::success(t("Your Photomoto private key has been reset.")); + url::redirect("admin/fotomotorw"); + } + + public function savedisplay() { + // Save the admin's preferences for which fotomoto links to display under each photo. + + // Prevent Cross Site Request Forgery + access::verify_csrf(); + + // Figure out which boxes where checked + $linkOptions_array = Input::instance()->post("fotomoto_display_links"); + $buy_prints = false; + $buy_cards = false; + $buy_download = false; + $share_ecard = false; + $share_facebook = false; + $share_twitter = false; + $share_digg = false; + for ($i = 0; $i < count($linkOptions_array); $i++) { + if ($linkOptions_array[$i] == "fotomoto_buy_prints") { + $buy_prints = true; + } + if ($linkOptions_array[$i] == "fotomoto_buy_cards") { + $buy_cards = true; + } + if ($linkOptions_array[$i] == "fotomoto_buy_download") { + $buy_download = true; + } + if ($linkOptions_array[$i] == "fotomoto_share_ecard") { + $share_ecard = true; + } + if ($linkOptions_array[$i] == "fotomoto_share_facebook") { + $share_facebook = true; + } + if ($linkOptions_array[$i] == "fotomoto_share_twitter") { + $share_twitter = true; + } + if ($linkOptions_array[$i] == "fotomoto_share_digg") { + $share_digg = true; + } + } + + // Save Settings. + module::set_var("fotomotorw", "fotomoto_buy_prints", $buy_prints); + module::set_var("fotomotorw", "fotomoto_buy_cards", $buy_cards); + module::set_var("fotomotorw", "fotomoto_buy_download", $buy_download); + module::set_var("fotomotorw", "fotomoto_share_ecard", $share_ecard); + module::set_var("fotomotorw", "fotomoto_share_facebook", $share_facebook); + module::set_var("fotomotorw", "fotomoto_share_twitter", $share_twitter); + module::set_var("fotomotorw", "fotomoto_share_digg", $share_digg); + + // Display a success message and reload the admin page. + message::success(t("Your Settings Have Been Saved.")); + url::redirect("admin/fotomotorw"); + } +} diff --git a/3.0/modules/fotomotorw/controllers/fotomotorw.php b/3.0/modules/fotomotorw/controllers/fotomotorw.php new file mode 100644 index 00000000..aa7de2d6 --- /dev/null +++ b/3.0/modules/fotomotorw/controllers/fotomotorw.php @@ -0,0 +1,81 @@ +loaded()) { + throw new Kohana_404_Exception(); + } + + // Make sure checksum matches, if not, throw a 404 error. + if ($str_checksum != md5($item->created)) { + throw new Kohana_404_Exception(); + } + + // If the resize file doesn't exist for some reason, display a 404 error. + if (!file_exists($item->resize_path())) { + throw new Kohana_404_Exception(); + } + + // Display the image. + header("Content-Type: {$item->mime_type}"); + Kohana::close_buffers(false); + $fd = fopen($item->resize_path(), "rb"); + fpassthru($fd); + fclose($fd); + } + + public function print_proxy($site_key, $file_id) { + // This function retrieves the full-sized image for fotomoto. + // As this function by-passes normal Gallery security, a private + // site-key is used to try and prevent people other then fotomoto + // from finding the URL. + + // If the site key doesn't match, display a 404 error. + if ($site_key != module::get_var("fotomotorw", "fotomoto_private_key")) { + throw new Kohana_404_Exception(); + } + + // Load the photo from the provided id. If the id# is invalid, display a 404 error. + $item = ORM::factory("item", $file_id); + if (!$item->loaded()) { + throw new Kohana_404_Exception(); + } + + // If the image file doesn't exist for some reason, display a 404 error. + if (!file_exists($item->file_path())) { + throw new Kohana_404_Exception(); + } + + // Display the image. + header("Content-Type: {$item->mime_type}"); + Kohana::close_buffers(false); + $fd = fopen($item->file_path(), "rb"); + fpassthru($fd); + fclose($fd); + } +} diff --git a/3.1/modules/iptc/helpers/iptc_event.php b/3.0/modules/fotomotorw/helpers/fotomotorw_event.php similarity index 56% rename from 3.1/modules/iptc/helpers/iptc_event.php rename to 3.0/modules/fotomotorw/helpers/fotomotorw_event.php index c7b4a6cc..9e58b9d0 100644 --- a/3.1/modules/iptc/helpers/iptc_event.php +++ b/3.0/modules/fotomotorw/helpers/fotomotorw_event.php @@ -1,7 +1,7 @@ is_photo()) { - iptc::extract($item); - } - } - static function item_deleted($item) { - db::build() - ->delete("iptc_records") - ->where("item_id", "=", $item->id) - ->execute(); - } - +class fotomotorw_event_Core { static function admin_menu($menu, $theme) { - // Add a link to the admin page to the Settings menu. + // Display an option under the admin Settings menu. $menu->get("settings_menu") ->append(Menu::factory("link") - ->id("iptc") - ->label(t("IPTC Settings")) - ->url(url::site("admin/iptc"))); + ->id("fotomotorw_menu") + ->label(t("Fotomoto")) + ->url(url::site("admin/fotomotorw"))); + } + + static function context_menu($menu, $theme, $item) { + // Add a "Buy Prints" option to the photo's thumbnail menu. + if ($item->type == "photo") { + $menu->get("options_menu") + ->append(Menu::factory("link") + ->id("fotomotorw") + ->label(t("Buy Prints")) + ->url("javascript:showFotomotoDialog(100, '" . url::abs_site("fotomotorw/resize/" . md5($item->created) . "/{$item->id}") . "');") + ->css_class("g-print-fotomotorw-link ui-icon-print")); + } } } diff --git a/3.1/modules/batchtag/helpers/batchtag_installer.php b/3.0/modules/fotomotorw/helpers/fotomotorw_installer.php similarity index 54% rename from 3.1/modules/batchtag/helpers/batchtag_installer.php rename to 3.0/modules/fotomotorw/helpers/fotomotorw_installer.php index d0c03163..b949b61a 100644 --- a/3.1/modules/batchtag/helpers/batchtag_installer.php +++ b/3.0/modules/fotomotorw/helpers/fotomotorw_installer.php @@ -1,7 +1,7 @@ page_subtype == "photo") || ($theme->page_subtype == "album")) { + return html::script('http://widget.fotomoto.com/stores/script/' . module::get_var("fotomotorw", "fotomoto_site_key") . '.js?api=true'); + } + } + + static function resize_bottom($theme) { + // Create a new block to use to display Fotomoto buy links below the photo. + $block = new Block; + $block->css_id = "g-fotomoto"; + $block->anchor = "fotomoto"; + + // Generate an array of links to display below photos. + $link_array = array(); + $counter = 0; + if (module::get_var("fotomotorw", "fotomoto_buy_prints")) { + $link_array[$counter] = array("100", "Buy Prints"); + $counter++; + } + if (module::get_var("fotomotorw", "fotomoto_buy_cards")) { + $link_array[$counter] = array("300", "Buy Cards"); + $counter++; + } + if (module::get_var("fotomotorw", "fotomoto_buy_download")) { + $link_array[$counter] = array("400", "Download"); + $counter++; + } + if (module::get_var("fotomotorw", "fotomoto_share_ecard")) { + $link_array[$counter] = array("200", "Send eCard"); + $counter++; + } + if (module::get_var("fotomotorw", "fotomoto_share_facebook")) { + $link_array[$counter] = array("201", "Share on Facebook"); + $counter++; + } + if (module::get_var("fotomotorw", "fotomoto_share_twitter")) { + $link_array[$counter] = array("202", "Share on Twitter"); + $counter++; + } + if (module::get_var("fotomotorw", "fotomoto_share_digg")) { + $link_array[$counter] = array("203", "Share on Digg"); + $counter++; + } + + $view = new View("fotomotorw_photo_block.html"); + $view->details = $link_array; + $block->content = $view; + return $block; + } + + static function album_bottom($theme) { + // Add some javascript to the bottom of album pages. + $block = new Block; + $block->css_id = "g-fotomoto"; + $block->anchor = "fotomoto"; + $view = new View("fotomotorw_album_block.html"); + $block->content = $view; + return $block; + } +} diff --git a/3.0/modules/fotomotorw/module.info b/3.0/modules/fotomotorw/module.info new file mode 100644 index 00000000..593ab7e3 --- /dev/null +++ b/3.0/modules/fotomotorw/module.info @@ -0,0 +1,7 @@ +name = "Fotomoto (rWatcher)" +description = "Sell photos on your site through Fotomoto" +version = 1 +author_name = "rWatcher" +author_url = "http://codex.gallery2.org/User:RWatcher" +info_url = "http://codex.gallery2.org/Gallery3:Modules:fotomotorw" +discuss_url = "http://gallery.menalto.com/node/106765" diff --git a/3.0/modules/fotomotorw/views/admin_fotomotorw.html.php b/3.0/modules/fotomotorw/views/admin_fotomotorw.html.php new file mode 100644 index 00000000..b8175472 --- /dev/null +++ b/3.0/modules/fotomotorw/views/admin_fotomotorw.html.php @@ -0,0 +1,64 @@ + + +
    +

    +
    + + + + + + + + +
    + " class="g-dialog-link"> + + + + + + +
    +

    (Log in to the Fotomoto Dashboard to get your Site Key.)

    + + + + + + + + +
    + +
    + + + + + + + + +
    + (">)
    +
    +
    +
    + +
    +

    + + Auto Pickup, or click here."); ?>
    +
    +
    + "
    +
    +
    + + +
    diff --git a/3.0/modules/fotomotorw/views/fotomotorw_album_block.html.php b/3.0/modules/fotomotorw/views/fotomotorw_album_block.html.php new file mode 100644 index 00000000..77bf2f2b --- /dev/null +++ b/3.0/modules/fotomotorw/views/fotomotorw_album_block.html.php @@ -0,0 +1,6 @@ + + diff --git a/3.0/modules/fotomotorw/views/fotomotorw_photo_block.html.php b/3.0/modules/fotomotorw/views/fotomotorw_photo_block.html.php new file mode 100644 index 00000000..a3209822 --- /dev/null +++ b/3.0/modules/fotomotorw/views/fotomotorw_photo_block.html.php @@ -0,0 +1,15 @@ + +
    + 0): ?> + + + | + + + +
    + diff --git a/3.0/modules/google_analytics/controllers/admin_google_analytics.php b/3.0/modules/google_analytics/controllers/admin_google_analytics.php index 4a28ad8d..328e294a 100644 --- a/3.0/modules/google_analytics/controllers/admin_google_analytics.php +++ b/3.0/modules/google_analytics/controllers/admin_google_analytics.php @@ -1,53 +1,62 @@ -_get_view(); - } - - public function handler() { - access::verify_csrf(); - - $form = $this->_get_form(); - if ($form->validate()) { - module::set_var( - "google_analytics", "code", $form->google_analytics_code->analytics_code->value); - url::redirect("admin/google_analytics"); - } - - print $this->_get_view($form); - } - - private function _get_view($form=null) { - $v = new Admin_View("admin.html"); - $v->content = new View("admin_google_analytics.html"); - $v->content->form = empty($form) ? $this->_get_form() : $form; - return $v; - } - - private function _get_form() { - $form = new Forge("admin/google_analytics/handler", "", "post", array("id" => "g-admin-form")); - $group = $form->group("google_analytics_code"); - $group->input("analytics_code")->label(t('Enter the Web-Property-ID given by Google.'))->rules("required")->value(module::get_var("google_analytics", "code")); - $group->submit("submit")->value(t("Save")); - - return $form; - } +_get_view(); + } + + public function handler() + { + access::verify_csrf(); + + $form = $this->_get_form(); + + if ($form->validate()) + { + module::set_var("google_analytics", "code", $form->google_analytics_code->inputs["analytics_code"]->value); + module::set_var("google_analytics", "owneradmin_hidden", $form->google_analytics_code->inputs["analytics_owneradmin_hidden"]->value); + url::redirect("admin/google_analytics"); + } + + print $this->_get_view($form); + } + + private function _get_view($form=null) + { + $v = new Admin_View("admin.html"); + $v->content = new View("admin_google_analytics.html"); + $v->content->form = empty($form) ? $this->_get_form() : $form; + return $v; + } + + private function _get_form() + { + $form = new Forge("admin/google_analytics/handler", "", "post", + array("id" => "gAdminForm")); + $group = $form->group("google_analytics_code"); + $group->input("analytics_code")->label(t('Enter the Web-Property-ID given by Google.'))->rules("required")->value(module::get_var("google_analytics", "code")); + $group->checkbox("analytics_owneradmin_hidden")->label(t("Omit code for owner and admin")) + ->checked(module::get_var("google_analytics", "owneradmin_hidden", false) == 1); + $group->submit("submit")->value(t("Save")); + + return $form; + } } \ No newline at end of file diff --git a/3.0/modules/google_analytics/helpers/google_analytics_event.php b/3.0/modules/google_analytics/helpers/google_analytics_event.php index 0672cf73..1cef1b08 100644 --- a/3.0/modules/google_analytics/helpers/google_analytics_event.php +++ b/3.0/modules/google_analytics/helpers/google_analytics_event.php @@ -1,28 +1,28 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("google_analytics_menu") - ->label(t("Google Analytics")) - ->url(url::site("admin/google_analytics"))); - } -} +get("settings_menu") + ->append(Menu::factory("link") + ->id("google_analytics_menu") + ->label(t("Google Analytics")) + ->url(url::site("admin/google_analytics"))); + } +} diff --git a/3.1/modules/themeroller/helpers/themeroller_installer.php b/3.0/modules/google_analytics/helpers/google_analytics_installer.php similarity index 53% rename from 3.1/modules/themeroller/helpers/themeroller_installer.php rename to 3.0/modules/google_analytics/helpers/google_analytics_installer.php index a2d5688d..0e52c059 100644 --- a/3.1/modules/themeroller/helpers/themeroller_installer.php +++ b/3.0/modules/google_analytics/helpers/google_analytics_installer.php @@ -1,44 +1,45 @@ - "zip", "zlib" => "zlib")); - } - return $messages; - } -} + - - - '; - - return $google_code; - } -} +item->owner_id != identity::active_user()->id) && (identity::active_user()->admin == 0) ) { + $u_o = 0; + } + + if ( $u_o == 0 || ( ($u_o == 1) && (module::get_var("google_analytics", "owneradmin_hidden") == 0) ) ) { + $google_code = ' + + + '; + + return $google_code; + } + + } + +} + + diff --git a/3.0/modules/google_analytics/module.info b/3.0/modules/google_analytics/module.info index ca5a51e3..b49b147b 100644 --- a/3.0/modules/google_analytics/module.info +++ b/3.0/modules/google_analytics/module.info @@ -1,7 +1,7 @@ -name = "Google Analytics" -description = "Renders the Google Analytics Code at the end of the page. Written by 'mcp'." -version = 2 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:google_analytics" -discuss_url = "http://gallery.menalto.com/forum_module_google_analytics" +name = Google Analytics +description = Renders the Google Analytics Code in the head of the page. +version = 4 +author_name = "" +author_url = "" +info_url = "http://codex.gallery2.org/Gallery3:Modules:google_analytics" +discuss_url = "http://gallery.menalto.com/node/88884" diff --git a/3.0/modules/google_analytics/views/admin_google_analytics.html.php b/3.0/modules/google_analytics/views/admin_google_analytics.html.php index e516f35a..9abc3c39 100644 --- a/3.0/modules/google_analytics/views/admin_google_analytics.html.php +++ b/3.0/modules/google_analytics/views/admin_google_analytics.html.php @@ -1,6 +1,6 @@ - -
    -

    -

    - -
    + +
    +

    +

    + +
    diff --git a/3.0/modules/gwtorganize/controllers/admin_gwtorganise.php b/3.0/modules/gwtorganize/controllers/admin_gwtorganise.php index 0c2b0486..4f4ea8ec 100644 --- a/3.0/modules/gwtorganize/controllers/admin_gwtorganise.php +++ b/3.0/modules/gwtorganize/controllers/admin_gwtorganise.php @@ -1,7 +1,7 @@ item()) { - return; - } - $item = $theme->item(); - if ( $item && access::can("edit", $item) ) { - return $theme->css("editcreation.css"); +class Item_Model extends Item_Model_Core { + + function children($limit=null, $offset=null, $where=array(), $order_by=null) { + if (!hide::can_view_hidden_items($this)) { + $this->join("hidden_items", "items.id", "hidden_items.item_id", "LEFT OUTER"); + $this->where("hidden_items.item_id", "IS", NULL); + return parent::children($limit, $offset, $where, $order_by); } } } diff --git a/3.0/modules/hide/models/hidden_item.php b/3.0/modules/hide/models/hidden_item.php index bc98f59c..5f00b6a6 100644 --- a/3.0/modules/hide/models/hidden_item.php +++ b/3.0/modules/hide/models/hidden_item.php @@ -1,7 +1,7 @@ where("item_id", "=", $item->id) + ->find_all(); + + $existing_url = ""; + if (count($item_url) > 0) { + $existing_url = $item_url[0]->url; + } + $form->edit_item + ->input("item_links_url") + ->label(t("Redirect to URL:")) + ->value($existing_url); + } + + static function item_deleted($item) { + // Whenever an item is deleted, delete any corresponding data. + db::build()->delete("item_links")->where("item_id", "=", $item->id)->execute(); + } + + static function item_edit_form_completed($item, $form) { + // Update the database with any changes to the item_links field. + $record = ORM::factory("item_link")->where("item_id", "=", $item->id)->find(); + + if ($form->edit_item->item_links_url->value != "") { + if (!$record->loaded()) { + $record->item_id = $item->id; + } + $record->url = $form->edit_item->item_links_url->value; + $record->save(); + } else { + db::build()->delete("item_links")->where("item_id", "=", $item->id)->execute(); + } + } +} diff --git a/3.1/modules/moduleorder/helpers/moduleorder_installer.php b/3.0/modules/item_links/helpers/item_links_installer.php similarity index 67% rename from 3.1/modules/moduleorder/helpers/moduleorder_installer.php rename to 3.0/modules/item_links/helpers/item_links_installer.php index 4dd3b928..b44a9c19 100644 --- a/3.1/modules/moduleorder/helpers/moduleorder_installer.php +++ b/3.0/modules/item_links/helpers/item_links_installer.php @@ -1,7 +1,7 @@ query("CREATE TABLE IF NOT EXISTS {item_links} ( + `id` int(9) NOT NULL auto_increment, + `item_id` int(9) NOT NULL, + `url` text default NULL, + PRIMARY KEY (`id`), + KEY(`item_id`, `id`)) + DEFAULT CHARSET=utf8;"); + // Set the module's version number. - module::set_version("moduleorder", 1); - } - - static function upgrade($version) { - module::set_version("moduleorder", $version = 1); - } - - static function deactivate() { - // Clear the require higher core version message. - site_status::clear("moduleorder_needs_higherversion"); - } - - static function uninstall() { - module::delete("moduleorder"); + module::set_version("item_links", 1); } } diff --git a/3.1/modules/tag_albums/helpers/tag_albums_theme.php b/3.0/modules/item_links/helpers/item_links_theme.php similarity index 69% rename from 3.1/modules/tag_albums/helpers/tag_albums_theme.php rename to 3.0/modules/item_links/helpers/item_links_theme.php index 3eae0c61..5cfc76cb 100644 --- a/3.1/modules/tag_albums/helpers/tag_albums_theme.php +++ b/3.0/modules/item_links/helpers/item_links_theme.php @@ -1,7 +1,7 @@ item()) { - $album_tags = ORM::factory("tags_album_id") - ->where("album_id", "=", $theme->item->id) + $item_url = ORM::factory("item_link") + ->where("item_id", "=", $theme->item->id) ->find_all(); - if (count($album_tags) > 0) { - url::redirect(url::abs_site("tag_albums/album/" . $album_tags[0]->id)); + if (count($item_url) > 0) { + url::redirect($item_url[0]->url); } } return; diff --git a/3.1/modules/iptc/models/iptc_key.php b/3.0/modules/item_links/models/item_link.php similarity index 91% rename from 3.1/modules/iptc/models/iptc_key.php rename to 3.0/modules/item_links/models/item_link.php index fadcb37b..524e40a3 100644 --- a/3.1/modules/iptc/models/iptc_key.php +++ b/3.0/modules/item_links/models/item_link.php @@ -1,7 +1,7 @@ is_photo() || $old->is_album()) { + $data_file = $new->data_file; + if (isset($data_file)) { + keeporiginal_event_Core::_preserve($old->file_path()); + } if ($old->file_path() != $new->file_path()) { $old_original = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $old->file_path()); $new_original = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $new->file_path()); @@ -105,6 +112,7 @@ class keeporiginal_event_Core { } // Move the file to its new location. + // TODO: If the files have different extensions, then the old extension should be preserved. @rename($old_original, $new_original); } } diff --git a/3.0/modules/keeporiginal/helpers/keeporiginal_installer.php b/3.0/modules/keeporiginal/helpers/keeporiginal_installer.php index 16c38e89..77044896 100644 --- a/3.0/modules/keeporiginal/helpers/keeporiginal_installer.php +++ b/3.0/modules/keeporiginal/helpers/keeporiginal_installer.php @@ -1,7 +1,7 @@ loaded()) { + throw new Kohana_404_Exception(); + } + + // Grab the first 10 items for the specified display type. + // Default to "popular" if display type is invalid. + $template = new View("latestupdates_user_profile_carousel.html"); + $template->items = latestupdates_Controller::items($str_display_type, $user_id, 10); + + // Figure out the text for the "View more" link. + if ($str_display_type == "recent") { + $template->str_view_more_title = t("View all recent uploads"); + } elseif ($str_display_type == "albums") { + $template->str_view_more_title = t("View all recent albums"); + } else { + $template->str_view_more_title = t("View more popular uploads"); + } + + // Set up a "View more" url. + $template->str_view_more_url = url::site("latestupdates/users/{$str_display_type}/{$user_id}"); + + // Display the page. + print $template; + + // Make item links in the carousel load as virtual albums for the view type instead of the regular album. + item::set_display_context_callback("latestupdates_Controller::get_display_context", + $str_display_type, $user_id); + return ; + } + + public function users($str_display_type, $user_id) { + // Generate a dynamic page with items uploaded by a specific user ($user_id). + + // Make sure user_id is valid. + $current_user = ORM::factory("user", $user_id); + if (!$current_user->loaded()) { + throw new Kohana_404_Exception(); + } + + // Figure out how many items to display on each page. + $page_size = 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) { + url::redirect("latestupdates/users/{$str_display_type}/{$user_id}"); + } + + // 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 = latestupdates_Controller::_get_position($child, $str_display_type, $user_id); + if ($index) { + $page = ceil($index / $page_size); + if ($page == 1) { + url::redirect("latestupdates/users/{$str_display_type}/{$user_id}"); + } else { + url::redirect("latestupdates/users/{$str_display_type}/{$user_id}?page=$page"); + } + } + } + + // First item to display. + $offset = ($page - 1) * $page_size; + + // Determine the total number of items, + // for page numbering purposes. + $count = latestupdates_Controller::items_count($str_display_type, $user_id); + + // Figure out what the highest page number is. + $max_pages = ceil($count / $page_size); + + // Don't let the visitor go past the last page. + if ($max_pages && $page > $max_pages) { + url::redirect("latestupdates/users/{$str_display_type}/{$user_id}?page=$max_pages"); + } + + // Figure out which items to display on this page. + $children = latestupdates_Controller::items($str_display_type, $user_id, $page_size, $offset); + + // Figure out the page title. + $str_page_title = ""; + if ($str_display_type == "recent") { + $str_page_title = t("Recent Uploads"); + } elseif ($str_display_type == "albums") { + $str_page_title = t("Recent Albums"); + } else { + $str_page_title = t("Most Viewed"); + } + + // Set up the previous and next page buttons. + if ($page > 1) { + $previous_page = $page - 1; + $view->previous_page_link = url::site("latestupdates/users/{$str_display_type}/{$user_id}?page={$previous_page}"); + } + if ($page < $max_pages) { + $next_page = $page + 1; + $view->next_page_link = url::site("latestupdates/users/{$str_display_type}/{$user_id}?page={$next_page}"); + } + + // Set up and display the actual page. + $root = item::root(); + $template = new Theme_View("page.html", "collection", "LatestUpdates"); + $template->page_title = t("Gallery :: Latest Updates"); + $template->set_global( + array("page" => $page, + "max_pages" => $max_pages, + "page_size" => $page_size, + "children" => $children, + "breadcrumbs" => array( + Breadcrumb::instance($root->title, $root->url())->set_first(), + Breadcrumb::instance(t("User profile: %name", array("name" => $current_user->display_name())), + url::site("user_profile/show/{$user_id}")), + Breadcrumb::instance($str_page_title, + url::site("latestupdates/users/{$str_display_type}/{$user_id}"))->set_last()), + "children_count" => $count)); + $template->content = new View("dynamic.html"); + $template->content->title = $str_page_title; + + // Display the page. + print $template; + + // Set up the callback so links within the photo page will lead to photos within the virtual album + // instead of the actual album. + item::set_display_context_callback("latestupdates_Controller::get_display_context", + $str_display_type, $user_id); + } public function albums($id) { // Figure out how many items to display on each page. $page_size = module::get_var("gallery", "page_size", 9); + // Load the parent album. + $item = ORM::factory("item", $id); + // 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); @@ -30,18 +165,27 @@ class latestupdates_Controller extends Controller { url::redirect("latestupdates/albums/{$item->id}"); } + // 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 = latestupdates_Controller::_get_position($child, "descendants", $item->id); + if ($index) { + $page = ceil($index / $page_size); + if ($page == 1) { + url::redirect("latestupdates/albums/{$item->id}"); + } else { + url::redirect("latestupdates/albums/{$item->id}?page=$page"); + } + } + } + // First item to display. $offset = ($page - 1) * $page_size; - $item = ORM::factory("item", $id); - // Determine the total number of items, // for page numbering purposes. - $count = $item - ->viewable() - ->where("type", "!=", "album") - ->order_by("created", "DESC") - ->descendants_count(); + $count = latestupdates_Controller::items_count("descendants", $item->id); // Figure out what the highest page number is. $max_pages = ceil($count / $page_size); @@ -52,11 +196,7 @@ class latestupdates_Controller extends Controller { } // Figure out which items to display on this page. - $children = $item - ->viewable() - ->where("type", "!=", "album") - ->order_by("created", "DESC") - ->descendants($page_size, $offset); + $children = latestupdates_Controller::items("descendants", $item->id, $page_size, $offset); // Set up the previous and next page buttons. if ($page > 1) { @@ -68,40 +208,73 @@ class latestupdates_Controller extends Controller { $view->next_page_link = url::site("latestupdates/albums/{$item->id}?page={$next_page}"); } + // Set up breadcrumbs. + $breadcrumbs = array(); + $counter = 0; + $breadcrumbs[] = Breadcrumb::instance(t("Recent Uploads"), url::site("latestupdates/albums/{$item->id}"))->set_last(); + $parent_item = $item; + while ($parent_item->id != 1) { + $breadcrumbs[] = Breadcrumb::instance($parent_item->title, $parent_item->url()); + $parent_item = ORM::factory("item", $parent_item->parent_id); + } + $breadcrumbs[] = Breadcrumb::instance($parent_item->title, $parent_item->url())->set_first(); + $breadcrumbs = array_reverse($breadcrumbs, true); + // Set up and display the actual page. + $root = item::root(); $template = new Theme_View("page.html", "collection", "LatestUpdates"); $template->page_title = t("Gallery :: Latest Updates"); - $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->set_global( + array("page" => $page, + "max_pages" => $max_pages, + "page_size" => $page_size, + "children" => $children, + "breadcrumbs" => $breadcrumbs, + "children_count" => $count)); $template->content = new View("dynamic.html"); - $template->content->title = t("Latest Updates"); + $template->content->title = t("Recent Uploads"); + + // Display the page. print $template; + + // Set up the callback so links within the photo page will lead to photos within the virtual album + // instead of the actual album. + item::set_display_context_callback("latestupdates_Controller::get_display_context", + "descendants", $item->id); } public function updates() { - // Figure out how many items to display on each page. - $page_size = module::get_var("gallery", "page_size", 9); + // Figure out how many items to display on each page. + $page_size = 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); + // 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) { url::redirect("latestupdates/updates"); } + // 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 = latestupdates_Controller::_get_position($child, "recent", 0); + if ($index) { + $page = ceil($index / $page_size); + if ($page == 1) { + url::redirect("latestupdates/updates"); + } else { + url::redirect("latestupdates/updates?page=$page"); + } + } + } + // First item to display. $offset = ($page - 1) * $page_size; // Determine the total number of items, // for page numbering purposes. - $count = ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->find_all() - ->count(); + $count = latestupdates_Controller::items_count("recent", 0); // Figure out what the highest page number is. $max_pages = ceil($count / $page_size); @@ -112,11 +285,7 @@ class latestupdates_Controller extends Controller { } // Figure out which items to display on this page. - $items = ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->order_by("created", "DESC") - ->find_all($page_size, $offset); + $items = latestupdates_Controller::items("recent", 0, $page_size, $offset); // Set up the previous and next page buttons. if ($page > 1) { @@ -129,16 +298,298 @@ class latestupdates_Controller extends Controller { } // Set up and display the actual page. + $root = item::root(); $template = new Theme_View("page.html", "collection", "LatestUpdates"); - $template->page_title = t("Gallery :: Latest Updates"); - $template->set_global("page", $page); - $template->set_global("page_size", $page_size); - $template->set_global("max_pages", $max_pages); - $template->set_global("children", $items); - $template->set_global("children_count", $count); - $template->content = new View ("dynamic.html"); - $template->content->title = t("Latest Updates"); + $template->page_title = t("Gallery :: Latest Updates"); + $template->set_global( + array("page" => $page, + "max_pages" => $max_pages, + "page_size" => $page_size, + "children" => $items, + "breadcrumbs" => array( + Breadcrumb::instance($root->title, $root->url())->set_first(), + Breadcrumb::instance(t("Recent Uploads"), + url::site("latestupdates/updates"))->set_last()), + "children_count" => $count)); + $template->content = new View("dynamic.html"); + $template->content->title = t("Recent Uploads"); + + // Display the page. print $template; + + // Set up the callback so links within the photo page will lead to photos within the virtual album + // instead of the actual album. + item::set_display_context_callback("latestupdates_Controller::get_display_context", + "recent", 0); } -} \ No newline at end of file + static function get_display_context($item, $str_display_type, $user_id) { + // Set up display elements on the photo page to link to the virtual album. + // Valid $str_display_type values are popular, recent, albums and descendants. + // $user_id can be set to "0" to search site wide. + // For "descendants", $user_id should be the album id #. + + // Figure out page title. + $str_page_title = ""; + if ($str_display_type == "recent") { + $str_page_title = t("Recent Uploads"); + } elseif ($str_display_type == "albums") { + $str_page_title = t("Recent Albums"); + } elseif ($str_display_type == "descendants") { + $str_page_title = t("Recent Uploads"); + } else { + $str_page_title = t("Most Viewed"); + } + + // Figure out item position. + $position = latestupdates_Controller::_get_position($item, $str_display_type, $user_id); + + // Figure out which items are the previous and next items with the virtual album. + if ($position > 1) { + list ($previous_item, $ignore, $next_item) = + latestupdates_Controller::items($str_display_type, $user_id, 3, $position - 2); + } else { + $previous_item = null; + list ($next_item) = latestupdates_Controller::items($str_display_type, $user_id, 1, $position); + } + + // Figure out total number of items (excluding albums). + $count = latestupdates_Controller::items_count($str_display_type, $user_id); + + // Set up breadcrumbs. + $root = item::root(); + $breadcrumbs = array(); + if ($user_id == 0) { + $breadcrumbs[0] = Breadcrumb::instance($root->title, $root->url())->set_first(); + $breadcrumbs[1] = Breadcrumb::instance($str_page_title, + url::site("latestupdates/updates?show={$item->id}")); + $breadcrumbs[2] = Breadcrumb::instance($item->title, $item->url())->set_last(); + } else { + if ($str_display_type == "descendants") { + $counter = 0; + $breadcrumbs[] = Breadcrumb::instance($item->title, $item->url())->set_last(); + $breadcrumbs[] = Breadcrumb::instance(t("Recent Uploads"), url::site("latestupdates/albums/{$user_id}?show={$item->id}")); + $parent_item = ORM::factory("item", $user_id); + while ($parent_item->id != 1) { + $breadcrumbs[] = Breadcrumb::instance($parent_item->title, $parent_item->url()); + $parent_item = ORM::factory("item", $parent_item->parent_id); + } + $breadcrumbs[] = Breadcrumb::instance($parent_item->title, $parent_item->url())->set_first(); + $breadcrumbs = array_reverse($breadcrumbs, true); + } else { + $current_user = ORM::factory("user", $user_id); + $breadcrumbs[0] = Breadcrumb::instance($root->title, $root->url())->set_first(); + $breadcrumbs[1] = Breadcrumb::instance(t("User profile: %name", array("name" => $current_user->display_name())), + url::site("user_profile/show/{$user_id}")); + $breadcrumbs[2] = Breadcrumb::instance($str_page_title, + url::site("latestupdates/users/{$str_display_type}/{$user_id}?show={$item->id}")); + $breadcrumbs[3] = Breadcrumb::instance($item->title, $item->url())->set_last(); + } + } + + // Return the display elements. + return array("position" => $position, + "previous_item" => $previous_item, + "next_item" => $next_item, + "sibling_count" => $count, + "breadcrumbs" => $breadcrumbs + ); + } + + static function items_count($str_display_type, $user_id) { + // Figure out the total number of items. + // Valid $str_display_type values are popular, recent, albums and descendants. + // $user_id can be set to "0" to search site wide. + // For "descendants", $user_id should be the album id #. + + // If $str_display_type is albums, then we only want albums. + // If it's not, then we want everything except albums. + if ($str_display_type == "albums") { + // This is only used for user profiles, so we always want + // results from a specific user. + $count = ORM::factory("item") + ->viewable() + ->where("type", "=", "album") + ->where("owner_id", "=", $user_id) + ->count_all(); + } else { + + // If $user_id is not 0 we only want results from a specific user, + // Or else we want results from any user. + if ($user_id == 0) { + $count = ORM::factory("item") + ->viewable() + ->where("type", "!=", "album") + ->count_all(); + } else { + + // If type is descendants, then user_id is actually an item id#. + if ($str_display_type == "descendants") { + $item = ORM::factory("item", $user_id); + $count = $item + ->viewable() + ->where("type", "!=", "album") + ->order_by("created", "DESC") + ->descendants_count(); + } else { + $count = ORM::factory("item") + ->viewable() + ->where("type", "!=", "album") + ->where("owner_id", "=", $user_id) + ->count_all(); + } + } + } + + return $count; + } + + static function items($str_display_type, $user_id, $limit=null, $offset=null) { + // Query the database for a list of items to display in the virtual album. + // Valid $str_display_type values are popular, recent, albums and descendants. + // $user_id can be set to "0" to search site wide. + // For "descendants", $user_id should be the album id #. + + // Figure out search parameters based on $str_display_type. + $str_where = array(); + $str_orderby_field = ""; + if ($str_display_type == "recent") { + $str_where = array(array("type", "!=", "album")); + $str_orderby_field = "created"; + } elseif ($str_display_type == "albums") { + $str_where = array(array("type", "=", "album")); + $str_orderby_field = "created"; + } else { + $str_where = array(array("type", "!=", "album")); + $str_orderby_field = "view_count"; + } + + // Search the database for matching items. + + // Searching for descendants of a parent album is significantly + // different from the other query types, so we're doing this one + // seperately. + if ($str_display_type == "descendants") { + $item = ORM::factory("item", $user_id); + return $item + ->viewable() + ->where("type", "!=", "album") + ->order_by("created", "DESC") + ->descendants($limit, $offset); + } + + // If $user_id is greater then 0, limit results + // to a specific user. + if ($user_id == 0) { + return ORM::factory("item") + ->viewable() + ->merge_where($str_where) + ->order_by($str_orderby_field, "DESC") + ->find_all($limit, $offset); + } else { + return ORM::factory("item") + ->viewable() + ->merge_where($str_where) + ->where("owner_id", "=", $user_id) + ->order_by($str_orderby_field, "DESC") + ->find_all($limit, $offset); + } + } + + private function _get_position($item, $str_display_type, $user_id) { + // Figure out the item's position within the virtual album. + // Valid $str_display_type values are popular, recent, albums and descendants. + // $user_id can be set to "0" to search site wide. + // For "descendants", $user_id should be the album id #. + + // Figure out search conditions. + $str_where = array(); + $str_orderby_field = ""; + if ($str_display_type == "recent") { + $str_where = array(array("type", "!=", "album")); + $str_orderby_field = "created"; + } elseif ($str_display_type == "albums") { + $str_where = array(array("type", "=", "album")); + $str_orderby_field = "created"; + } else { + $str_where = array(array("type", "!=", "album")); + $str_orderby_field = "view_count"; + } + + // Count the number of records that have a higher orderby_field value then + // the item we're looking for. + $position = 0; + if ($user_id == 0) { + $position = ORM::factory("item") + ->viewable() + ->merge_where($str_where) + ->where($str_orderby_field, ">", $item->$str_orderby_field) + ->order_by($str_orderby_field, "DESC") + ->count_all(); + } else { + if ($str_display_type == "descendants") { + $album_item = ORM::factory("item", $user_id); + $position = $album_item + ->viewable() + ->where("type", "!=", "album") + ->where("created", ">", $item->created) + ->order_by("created", "DESC") + ->descendants_count(); + } else { + $position = ORM::factory("item") + ->viewable() + ->where("owner_id", "=", $user_id) + ->merge_where($str_where) + ->where($str_orderby_field, ">", $item->$str_orderby_field) + ->order_by($str_orderby_field, "DESC") + ->count_all(); + } + } + + // Set up a db query for all records with the same orderby field value + // as the item we're looking for. + $items = ORM::factory("item"); + if ($user_id == 0) { + $items->viewable() + ->merge_where($str_where) + ->where($str_orderby_field, "=", $item->$str_orderby_field) + ->order_by($str_orderby_field, "DESC"); + } else { + if ($str_display_type == "descendants") { + $item_album = ORM::factory("item", $user_id); + $items = $item_album + ->viewable() + ->where("type", "!=", "album") + ->where("created", "=", $item->created) + ->order_by("created", "DESC"); + } else { + $items->viewable() + ->where("owner_id", "=", $user_id) + ->merge_where($str_where) + ->where($str_orderby_field, "=", $item->$str_orderby_field) + ->order_by($str_orderby_field, "DESC"); + } + } + + // Loop through each remaining match, increasing position by 1 each time + // until we find a match. + if ($str_display_type == "descendants") { + foreach ($items->descendants() as $row) { + $position++; + if ($row->id == $item->id) { + break; + } + } + } else { + foreach ($items->find_all() as $row) { + $position++; + if ($row->id == $item->id) { + break; + } + } + } + + // Return the result. + return $position; + } +} diff --git a/3.0/modules/latestupdates/css/latestupdates_jcarousel.css b/3.0/modules/latestupdates/css/latestupdates_jcarousel.css new file mode 100644 index 00000000..f123143d --- /dev/null +++ b/3.0/modules/latestupdates/css/latestupdates_jcarousel.css @@ -0,0 +1,95 @@ +#jCarouselLite .carousel { + padding: 10px 0 0 0; + margin: 0 0 20px 10px; + position: relative; +} + +#jCarouselLite .digg { + position: absolute; + left: 610px; + top: 110px; +} + +#jCarouselLite .main { + margin-left: 0px; +} + +#jCarouselLite .demo em { + color: #FF3300; + font-weight: bold; + font-size: 60%; + font-style: normal; +} + +#jCarouselLite .carousel a.prev, #jCarouselLite .carousel a.next { + display: block; + float: left; + width: 30px; + height: 90px; + text-decoration: none; + background: url("../images/imageNavLeft.gif") left 60px no-repeat; +} + +#jCarouselLite .carousel a.next { + background: url("../images/imageNavRight.gif") right 60px no-repeat; +} + +#jCarouselLite .carousel a.next:hover { + background-image: url("../images/imageNavRightHover.gif"); +} + +#jCarouselLite .carousel a.prev:hover { + background-image: url("../images/imageNavLeftHover.gif"); +} + +#jCarouselLite .carousel a:hover, #jCarouselLite .carousel a:active { + border: none; + outline: none; +} + +#jCarouselLite .carousel .jCarouselLite { + border: 1px solid black; + float: left; + background-color: #dfdfdf; + + /* Needed for rendering without flicker */ + position: relative; + visibility: hidden; + left: -5000px; +} + +#jCarouselLite .carousel ul { + margin: 0; +} + +#jCarouselLite .carousel li img, +#jCarouselLite .carousel li p { + background-color: #fff; + margin: 10px; +} + +#jCarouselLite .widget img { + cursor: pointer; +} + +#jCarouselLite .mid { + margin-left: 80px; + width: 400px; + height: 300px; +} + +#jCarouselLite .vertical { + margin-left: 90px; +} + +#jCarouselLite .vertical .jCarouselLite { /* so that in IE 6, the carousel div doesnt expand to fill the space */ + width: 90px; +} + +#jCarouselLite .imageSlider li img, +#jCarouselLite .imageSlider li p, +#jCarouselLite .imageSliderExt li img , +#jCarouselLite .imageSliderExt li p { + width: 400px; + height: 300px; +} diff --git a/3.0/modules/latestupdates/helpers/latestupdates_block.php b/3.0/modules/latestupdates/helpers/latestupdates_block.php index 4af70f06..158ffa96 100644 --- a/3.0/modules/latestupdates/helpers/latestupdates_block.php +++ b/3.0/modules/latestupdates/helpers/latestupdates_block.php @@ -1,7 +1,7 @@ title = $new_title; - $this->url = $new_url; +class latestupdates_event_Core { + static function show_user_profile($data) { + // Display links on the user profile pages for recent photos/albums + // and most popular photos from the specified user. + $v = new View("latestupdates_user_profile_info.html"); + $v->user_id = $data->user->id; + $data->content[] = (object) array("title" => t("Latest Updates"), "view" => $v); } } diff --git a/3.1/modules/calendarview/helpers/calendarview_theme.php b/3.0/modules/latestupdates/helpers/latestupdates_theme.php similarity index 79% rename from 3.1/modules/calendarview/helpers/calendarview_theme.php rename to 3.0/modules/latestupdates/helpers/latestupdates_theme.php index fa8002ea..1de3116f 100644 --- a/3.1/modules/calendarview/helpers/calendarview_theme.php +++ b/3.0/modules/latestupdates/helpers/latestupdates_theme.php @@ -1,7 +1,7 @@ css("calendarview_menu.css"); - return $theme->css("calendarview_calendar.css"); + // Load CSS and JS for jCarouselLite. + return $theme->script("jcarousellite_1.0.1.js") . + $theme->css("latestupdates_jcarousel.css"); } } diff --git a/3.0/modules/latestupdates/images/imageNavLeft.gif b/3.0/modules/latestupdates/images/imageNavLeft.gif new file mode 100644 index 00000000..9c0e5af3 Binary files /dev/null and b/3.0/modules/latestupdates/images/imageNavLeft.gif differ diff --git a/3.0/modules/latestupdates/images/imageNavLeftHover.gif b/3.0/modules/latestupdates/images/imageNavLeftHover.gif new file mode 100644 index 00000000..0945b9eb Binary files /dev/null and b/3.0/modules/latestupdates/images/imageNavLeftHover.gif differ diff --git a/3.0/modules/latestupdates/images/imageNavRight.gif b/3.0/modules/latestupdates/images/imageNavRight.gif new file mode 100644 index 00000000..ad4bb007 Binary files /dev/null and b/3.0/modules/latestupdates/images/imageNavRight.gif differ diff --git a/3.0/modules/latestupdates/images/imageNavRightHover.gif b/3.0/modules/latestupdates/images/imageNavRightHover.gif new file mode 100644 index 00000000..a5abcc99 Binary files /dev/null and b/3.0/modules/latestupdates/images/imageNavRightHover.gif differ diff --git a/3.0/modules/latestupdates/js/jcarousellite_1.0.1.js b/3.0/modules/latestupdates/js/jcarousellite_1.0.1.js new file mode 100644 index 00000000..07b82a6d --- /dev/null +++ b/3.0/modules/latestupdates/js/jcarousellite_1.0.1.js @@ -0,0 +1,341 @@ +/** + * jCarouselLite - jQuery plugin to navigate images/any content in a carousel style widget. + * @requires jQuery v1.2 or above + * + * http://gmarwaha.com/jquery/jcarousellite/ + * + * Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com) + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Version: 1.0.1 + * Note: Requires jquery 1.2 or above from version 1.0.1 + */ + +/** + * Creates a carousel-style navigation widget for images/any-content from a simple HTML markup. + * + * The HTML markup that is used to build the carousel can be as simple as... + * + * + * + * As you can see, this snippet is nothing but a simple div containing an unordered list of images. + * You don't need any special "class" attribute, or a special "css" file for this plugin. + * I am using a class attribute just for the sake of explanation here. + * + * To navigate the elements of the carousel, you need some kind of navigation buttons. + * For example, you will need a "previous" button to go backward, and a "next" button to go forward. + * This need not be part of the carousel "div" itself. It can be any element in your page. + * Lets assume that the following elements in your document can be used as next, and prev buttons... + * + * + * + * + * Now, all you need to do is call the carousel component on the div element that represents it, and pass in the + * navigation buttons as options. + * + * $(".carousel").jCarouselLite({ + * btnNext: ".next", + * btnPrev: ".prev" + * }); + * + * That's it, you would have now converted your raw div, into a magnificient carousel. + * + * There are quite a few other options that you can use to customize it though. + * Each will be explained with an example below. + * + * @param an options object - You can specify all the options shown below as an options object param. + * + * @option btnPrev, btnNext : string - no defaults + * @example + * $(".carousel").jCarouselLite({ + * btnNext: ".next", + * btnPrev: ".prev" + * }); + * @desc Creates a basic carousel. Clicking "btnPrev" navigates backwards and "btnNext" navigates forward. + * + * @option btnGo - array - no defaults + * @example + * $(".carousel").jCarouselLite({ + * btnNext: ".next", + * btnPrev: ".prev", + * btnGo: [".0", ".1", ".2"] + * }); + * @desc If you don't want next and previous buttons for navigation, instead you prefer custom navigation based on + * the item number within the carousel, you can use this option. Just supply an array of selectors for each element + * in the carousel. The index of the array represents the index of the element. What i mean is, if the + * first element in the array is ".0", it means that when the element represented by ".0" is clicked, the carousel + * will slide to the first element and so on and so forth. This feature is very powerful. For example, i made a tabbed + * interface out of it by making my navigation elements styled like tabs in css. As the carousel is capable of holding + * any content, not just images, you can have a very simple tabbed navigation in minutes without using any other plugin. + * The best part is that, the tab will "slide" based on the provided effect. :-) + * + * @option mouseWheel : boolean - default is false + * @example + * $(".carousel").jCarouselLite({ + * mouseWheel: true + * }); + * @desc The carousel can also be navigated using the mouse wheel interface of a scroll mouse instead of using buttons. + * To get this feature working, you have to do 2 things. First, you have to include the mouse-wheel plugin from brandon. + * Second, you will have to set the option "mouseWheel" to true. That's it, now you will be able to navigate your carousel + * using the mouse wheel. Using buttons and mouseWheel or not mutually exclusive. You can still have buttons for navigation + * as well. They complement each other. To use both together, just supply the options required for both as shown below. + * @example + * $(".carousel").jCarouselLite({ + * btnNext: ".next", + * btnPrev: ".prev", + * mouseWheel: true + * }); + * + * @option auto : number - default is null, meaning autoscroll is disabled by default + * @example + * $(".carousel").jCarouselLite({ + * auto: 800, + * speed: 500 + * }); + * @desc You can make your carousel auto-navigate itself by specfying a millisecond value in this option. + * The value you specify is the amount of time between 2 slides. The default is null, and that disables auto scrolling. + * Specify this value and magically your carousel will start auto scrolling. + * + * @option speed : number - 200 is default + * @example + * $(".carousel").jCarouselLite({ + * btnNext: ".next", + * btnPrev: ".prev", + * speed: 800 + * }); + * @desc Specifying a speed will slow-down or speed-up the sliding speed of your carousel. Try it out with + * different speeds like 800, 600, 1500 etc. Providing 0, will remove the slide effect. + * + * @option easing : string - no easing effects by default. + * @example + * $(".carousel").jCarouselLite({ + * btnNext: ".next", + * btnPrev: ".prev", + * easing: "bounceout" + * }); + * @desc You can specify any easing effect. Note: You need easing plugin for that. Once specified, + * the carousel will slide based on the provided easing effect. + * + * @option vertical : boolean - default is false + * @example + * $(".carousel").jCarouselLite({ + * btnNext: ".next", + * btnPrev: ".prev", + * vertical: true + * }); + * @desc Determines the direction of the carousel. true, means the carousel will display vertically. The next and + * prev buttons will slide the items vertically as well. The default is false, which means that the carousel will + * display horizontally. The next and prev items will slide the items from left-right in this case. + * + * @option circular : boolean - default is true + * @example + * $(".carousel").jCarouselLite({ + * btnNext: ".next", + * btnPrev: ".prev", + * circular: false + * }); + * @desc Setting it to true enables circular navigation. This means, if you click "next" after you reach the last + * element, you will automatically slide to the first element and vice versa. If you set circular to false, then + * if you click on the "next" button after you reach the last element, you will stay in the last element itself + * and similarly for "previous" button and first element. + * + * @option visible : number - default is 3 + * @example + * $(".carousel").jCarouselLite({ + * btnNext: ".next", + * btnPrev: ".prev", + * visible: 4 + * }); + * @desc This specifies the number of items visible at all times within the carousel. The default is 3. + * You are even free to experiment with real numbers. Eg: "3.5" will have 3 items fully visible and the + * last item half visible. This gives you the effect of showing the user that there are more images to the right. + * + * @option start : number - default is 0 + * @example + * $(".carousel").jCarouselLite({ + * btnNext: ".next", + * btnPrev: ".prev", + * start: 2 + * }); + * @desc You can specify from which item the carousel should start. Remember, the first item in the carousel + * has a start of 0, and so on. + * + * @option scrool : number - default is 1 + * @example + * $(".carousel").jCarouselLite({ + * btnNext: ".next", + * btnPrev: ".prev", + * scroll: 2 + * }); + * @desc The number of items that should scroll/slide when you click the next/prev navigation buttons. By + * default, only one item is scrolled, but you may set it to any number. Eg: setting it to "2" will scroll + * 2 items when you click the next or previous buttons. + * + * @option beforeStart, afterEnd : function - callbacks + * @example + * $(".carousel").jCarouselLite({ + * btnNext: ".next", + * btnPrev: ".prev", + * beforeStart: function(a) { + * alert("Before animation starts:" + a); + * }, + * afterEnd: function(a) { + * alert("After animation ends:" + a); + * } + * }); + * @desc If you wanted to do some logic in your page before the slide starts and after the slide ends, you can + * register these 2 callbacks. The functions will be passed an argument that represents an array of elements that + * are visible at the time of callback. + * + * + * @cat Plugins/Image Gallery + * @author Ganeshji Marwaha/ganeshread@gmail.com + */ + +(function($) { // Compliant with jquery.noConflict() +$.fn.jCarouselLite = function(o) { + o = $.extend({ + btnPrev: null, + btnNext: null, + btnGo: null, + mouseWheel: false, + auto: null, + + speed: 200, + easing: null, + + vertical: false, + circular: true, + visible: 3, + start: 0, + scroll: 1, + + beforeStart: null, + afterEnd: null + }, o || {}); + + return this.each(function() { // Returns the element collection. Chainable. + + var running = false, animCss=o.vertical?"top":"left", sizeCss=o.vertical?"height":"width"; + var div = $(this), ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible; + + if(o.circular) { + ul.prepend(tLi.slice(tl-v-1+1).clone()) + .append(tLi.slice(0,v).clone()); + o.start += v; + } + + var li = $("li", ul), itemLength = li.size(), curr = o.start; + div.css("visibility", "visible"); + + li.css({overflow: "hidden", float: o.vertical ? "none" : "left"}); + ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"}); + div.css({overflow: "hidden", position: "relative", "z-index": "2", left: "0px"}); + + var liSize = o.vertical ? height(li) : width(li); // Full li size(incl margin)-Used for animation + var ulSize = liSize * itemLength; // size of full ul(total length, not just for the visible items) + var divSize = liSize * v; // size of entire div(total length for just the visible items) + + li.css({width: li.width(), height: li.height()}); + ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize)); + + div.css(sizeCss, divSize+"px"); // Width of the DIV. length of visible images + + if(o.btnPrev) + $(o.btnPrev).click(function() { + return go(curr-o.scroll); + }); + + if(o.btnNext) + $(o.btnNext).click(function() { + return go(curr+o.scroll); + }); + + if(o.btnGo) + $.each(o.btnGo, function(i, val) { + $(val).click(function() { + return go(o.circular ? o.visible+i : i); + }); + }); + + if(o.mouseWheel && div.mousewheel) + div.mousewheel(function(e, d) { + return d>0 ? go(curr-o.scroll) : go(curr+o.scroll); + }); + + if(o.auto) + setInterval(function() { + go(curr+o.scroll); + }, o.auto+o.speed); + + function vis() { + return li.slice(curr).slice(0,v); + }; + + function go(to) { + if(!running) { + + if(o.beforeStart) + o.beforeStart.call(this, vis()); + + if(o.circular) { // If circular we are in first or last, then goto the other end + if(to<=o.start-v-1) { // If first, then goto last + ul.css(animCss, -((itemLength-(v*2))*liSize)+"px"); + // If "scroll" > 1, then the "to" might not be equal to the condition; it can be lesser depending on the number of elements. + curr = to==o.start-v-1 ? itemLength-(v*2)-1 : itemLength-(v*2)-o.scroll; + } else if(to>=itemLength-v+1) { // If last, then goto first + ul.css(animCss, -( (v) * liSize ) + "px" ); + // If "scroll" > 1, then the "to" might not be equal to the condition; it can be greater depending on the number of elements. + curr = to==itemLength-v+1 ? v+1 : v+o.scroll; + } else curr = to; + } else { // If non-circular and to points to first or last, we just return. + if(to<0 || to>itemLength-v) return; + else curr = to; + } // If neither overrides it, the curr will still be "to" and we can proceed. + + running = true; + + ul.animate( + animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing, + function() { + if(o.afterEnd) + o.afterEnd.call(this, vis()); + running = false; + } + ); + // Disable buttons when the carousel reaches the last/first, and enable when not + if(!o.circular) { + $(o.btnPrev + "," + o.btnNext).removeClass("disabled"); + $( (curr-o.scroll<0 && o.btnPrev) + || + (curr+o.scroll > itemLength-v && o.btnNext) + || + [] + ).addClass("disabled"); + } + + } + return false; + }; + }); +}; + +function css(el, prop) { + return parseInt($.css(el[0], prop)) || 0; +}; +function width(el) { + return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight'); +}; +function height(el) { + return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom'); +}; + +})(jQuery); \ No newline at end of file diff --git a/3.0/modules/latestupdates/module.info b/3.0/modules/latestupdates/module.info index a4916cd6..95aba927 100644 --- a/3.0/modules/latestupdates/module.info +++ b/3.0/modules/latestupdates/module.info @@ -1,7 +1,7 @@ name = "LatestUpdates" description = "Display recently uploaded photos and videos." version = 1 -author_name = "" -author_url = "" +author_name = "rWatcher" +author_url = "http://codex.gallery2.org/User:RWatcher" info_url = "http://codex.gallery2.org/Gallery3:Modules:latestupdates" -discuss_url = "http://gallery.menalto.com/forum_module_latestupdates" +discuss_url = "http://gallery.menalto.com/node/88936" diff --git a/3.0/modules/latestupdates/views/latestupdates_user_profile_carousel.html.php b/3.0/modules/latestupdates/views/latestupdates_user_profile_carousel.html.php new file mode 100644 index 00000000..1a3ada22 --- /dev/null +++ b/3.0/modules/latestupdates/views/latestupdates_user_profile_carousel.html.php @@ -0,0 +1,37 @@ + + +
    + + + +
    + + diff --git a/3.0/modules/latestupdates/views/latestupdates_user_profile_info.html.php b/3.0/modules/latestupdates/views/latestupdates_user_profile_info.html.php new file mode 100644 index 00000000..175d1376 --- /dev/null +++ b/3.0/modules/latestupdates/views/latestupdates_user_profile_info.html.php @@ -0,0 +1,14 @@ + + +
    + diff --git a/3.0/modules/ldap/config/identity.php b/3.0/modules/ldap/config/identity.php index 8c4136b2..343e3af8 100644 --- a/3.0/modules/ldap/config/identity.php +++ b/3.0/modules/ldap/config/identity.php @@ -34,10 +34,12 @@ $config["ldap"] = array( "driver" => "ldap", "allow_updates" => false, "params" => array( + "guest_user" => "Guest", "groups" => array("engineering", "everybody", "guest"), "everybody_group" => "guest", "registered_users_group" => "everybody", "admins" => array("alice", "bob"), + "admin_mail" => "unknown@unknown.com", "url" => "ldaps://ldap.mycompany.com/", "group_domain" => "ou=Posix,ou=Groups,dc=ymcompany,dc=com", "user_domain" => "ou=People,dc=MyCompany,dc=com", diff --git a/3.0/modules/ldap/helpers/ldap_installer.php b/3.0/modules/ldap/helpers/ldap_installer.php index d9bdbfd4..ae33fd7c 100644 --- a/3.0/modules/ldap/helpers/ldap_installer.php +++ b/3.0/modules/ldap/helpers/ldap_installer.php @@ -1,7 +1,7 @@ id = 0; - self::$_guest_user->name = "Guest"; - self::$_guest_user->full_name = "Guest"; - self::$_guest_user->guest = true; - self::$_guest_user->admin = false; - self::$_guest_user->locale = null; - self::$_guest_user->email = null; - self::$_guest_user->groups = array($this->everybody()); - } - return self::$_guest_user; + return self::lookup_user_by_name(self::$_params["guest_user"]); } /** @@ -86,8 +84,8 @@ class IdentityProvider_Ldap_Driver implements IdentityProvider_Driver { * @see IdentityProvider_Driver::lookup_user. */ public function lookup_user($id) { - if ($id == 0) { - return $this->guest(); + if ($id == LDAP_GUEST_ID) { + return self::lookup_user_by_name(self::$_params["guest_user"]); } $result = ldap_search(self::$_connection, self::$_params["user_domain"], "uidNumber=$id"); $entries = ldap_get_entries(self::$_connection, $result); @@ -109,6 +107,19 @@ class IdentityProvider_Ldap_Driver implements IdentityProvider_Driver { if ($entries["count"] > 0) { return new Ldap_User($entries[0]); } + if ($name == self::$_params["guest_user"]) { + if (empty(self::$_guest_user)) { + self::$_guest_user = new Ldap_User(); + self::$_guest_user->id = LDAP_GUEST_ID; + self::$_guest_user->name = "$name"; + self::$_guest_user->full_name = "$name"; + self::$_guest_user->guest = true; + self::$_guest_user->admin = false; + self::$_guest_user->locale = null; + self::$_guest_user->email = null; + } + return self::$_guest_user; + } return null; } @@ -137,13 +148,20 @@ class IdentityProvider_Ldap_Driver implements IdentityProvider_Driver { * @see IdentityProvider_Driver::lookup_group. */ public function lookup_group($id) { + if ($id = LDAP_EVERYBODY_GROUP_ID) { + return self::lookup_group_by_name(self::$_params["everybody_group"]); + } else if ($id = LDAP_REGISTERED_USERS_ID) { + return self::lookup_group_by_name(self::$_params["registered_users_group"]); + } $result = @ldap_search(self::$_connection, self::$_params["group_domain"], "gidNumber=$id"); $entry_id = ldap_first_entry(self::$_connection, $result); if ($entry_id !== false) { $cn_entry = ldap_get_values(self::$_connection, $entry_id, "cn"); $gid_number_entry = ldap_get_values(self::$_connection, $entry_id, "gidNumber"); - return new Ldap_Group($gid_number_entry[0], $cn_entry[0]); + if (in_array($cn_entry, self::$_params["groups"])) { + return new Ldap_Group($gid_number_entry[0], $cn_entry[0]); + } } return null; } @@ -160,7 +178,21 @@ class IdentityProvider_Ldap_Driver implements IdentityProvider_Driver { if ($entry_id !== false) { $cn_entry = ldap_get_values(self::$_connection, $entry_id, "cn"); $gid_number_entry = ldap_get_values(self::$_connection, $entry_id, "gidNumber"); - return new Ldap_Group($gid_number_entry[0], $cn_entry[0]); + if (in_array($cn_entry, self::$_params["groups"])) { + return new Ldap_Group($gid_number_entry[0], $cn_entry[0]); + } + } + if ($name == self::$_params["everybody_group"]) { + if (!self::$_everybody_group) { + self::$_everybody_group = new Ldap_Group(LDAP_EVERYBODY_ID, $name); + } + return self::$_everybody_group; + } + if ($name == self::$_params["registered_users_group"]) { + if (!self::$_registered_users_group) { + self::$_registered_users_group = new Ldap_Group(LDAP_REGISTERED_USERS_ID, $name); + } + return self::$_registered_users_group; } return null; } @@ -171,7 +203,9 @@ class IdentityProvider_Ldap_Driver implements IdentityProvider_Driver { public function get_user_list($ids) { $users = array(); foreach ($ids as $id) { - $users[] = $this->lookup_user($id); + if ($user = $this->lookup_user($id)) { + $users[] = $user; + } } return $users; } @@ -182,21 +216,21 @@ class IdentityProvider_Ldap_Driver implements IdentityProvider_Driver { public function groups() { $groups = array(); foreach (self::$_params["groups"] as $group_name) { - $groups[] = $this->lookup_group_by_name($group_name); + if ($group = $this->lookup_group_by_name($group_name)) { + $groups[] = $group; + } } return $groups; } static function groups_for($user) { - if ($user->guest) { - return $user->groups; - } - $result = ldap_search(self::$_connection, self::$_params["group_domain"], "(memberUid=$user->name)"); $associated_groups = self::$_params["groups"]; $groups = array(); + $in_everybody_group = false; + $in_registered_users_group = false; for ($entry_id = ldap_first_entry(self::$_connection, $result); $entry_id != false; $entry_id = ldap_next_entry(self::$_connection, $entry_id)) { @@ -205,6 +239,18 @@ class IdentityProvider_Ldap_Driver implements IdentityProvider_Driver { if (in_array($group_name[0], $associated_groups)) { $groups[] = new Ldap_Group($group_id[0], $group_name[0]); } + if ($group_name[0] == self::$_params["everybody_group"]) { + $in_everybody_group = true; + } + if ($group_name[0] == self::$_params["registered_users_group"]) { + $in_registered_users_group = true; + } + } + if (!$in_everybody_group) { + $groups[] = self::lookup_group_by_name(self::$_params["everybody_group"]); + } + if (!$user->guest && !$in_registered_users_group) { + $groups[] = self::lookup_group_by_name(self::$_params["registered_users_group"]); } return $groups; } @@ -235,7 +281,7 @@ class Ldap_User implements User_Definition { if (!empty($this->ldap_entry["displayname"][0])) { return $this->ldap_entry["displayname"][0]; } - return $this->ldap_entry["cn"][0]; + return $this->full_name; } public function __get($key) { @@ -257,10 +303,20 @@ class Ldap_User implements User_Definition { IdentityProvider_Ldap_Driver::$_params["admins"]); case "email": - return $this->ldap_entry["mail"][0]; + if (isset($this->ldap_entry["mail"])) { + return $this->ldap_entry["mail"][0]; + } else if ($this->admin) { + IdentityProvider_Ldap_Driver::$_params["admin_mail"]; + } else { + return null; + } case "full_name": - return $this->ldap_entry["cn"][0]; + if (isset($this->ldap_entry["cn"])) { + return $this->ldap_entry["cn"][0]; + } else { + return $this->name; + } case "dn": return $this->ldap_entry["dn"]; @@ -281,6 +337,12 @@ class Ldap_User implements User_Definition { return sprintf("http://www.gravatar.com/avatar/%s.jpg?s=%d&r=pg%s", md5($this->email), $size, $default ? "&d=" . urlencode($default) : ""); } + + // Called e.g. by user_profile.php:_can_view_profile_pages() + // We don't have "empty" users, so just return true + public function loaded() { + return true; + } } class Ldap_Group implements Group_Definition { diff --git a/3.0/modules/metadescription/helpers/metadescription_event.php b/3.0/modules/metadescription/helpers/metadescription_event.php index 5fedfa11..579d7d43 100644 --- a/3.0/modules/metadescription/helpers/metadescription_event.php +++ b/3.0/modules/metadescription/helpers/metadescription_event.php @@ -1,7 +1,7 @@ module == "tag") { + $data->messages["warn"][] = t("The MetaDescription module requires the Tags module."); + } + } } diff --git a/3.0/modules/metadescription/helpers/metadescription_installer.php b/3.0/modules/metadescription/helpers/metadescription_installer.php index 6d7d540c..200f1c7b 100644 --- a/3.0/modules/metadescription/helpers/metadescription_installer.php +++ b/3.0/modules/metadescription/helpers/metadescription_installer.php @@ -1,7 +1,7 @@ item()) { + if ($theme->item() || $theme->tag()) { $metaView = new View("metadescription_block.html"); $metaView->tags = $tagsItem; return $metaView; diff --git a/3.0/modules/metadescription/module.info b/3.0/modules/metadescription/module.info index f85dbe80..7010a0d1 100644 --- a/3.0/modules/metadescription/module.info +++ b/3.0/modules/metadescription/module.info @@ -1,7 +1,7 @@ name = "MetaDescription" description = "Automatically generates and inserts KEYWORD and DESCRIPTION meta tags into any theme." version = 1 -author_name = "" -author_url = "" +author_name = "rWatcher" +author_url = "http://codex.gallery2.org/User:RWatcher" info_url = "http://codex.gallery2.org/Gallery3:Modules:metadescription" -discuss_url = "http://gallery.menalto.com/forum_module_metadescription" +discuss_url = "http://gallery.menalto.com/node/102477" diff --git a/3.0/modules/minislideshow/controllers/admin_minislideshow.php b/3.0/modules/minislideshow/controllers/admin_minislideshow.php index dfd008fe..050b5a14 100644 --- a/3.0/modules/minislideshow/controllers/admin_minislideshow.php +++ b/3.0/modules/minislideshow/controllers/admin_minislideshow.php @@ -1,7 +1,7 @@ "g-mini-slideshow-admin-form")); - // Get location of slideshow files. $group_slideshow_files = $form->group("Minislideshow"); $group_slideshow_files->input("slideshow_url") @@ -124,4 +123,4 @@ class Admin_Minislideshow_Controller extends Admin_Controller { // Return the newly generated form. return $form; } -} \ No newline at end of file +} diff --git a/3.0/modules/minislideshow/controllers/minislideshow.php b/3.0/modules/minislideshow/controllers/minislideshow.php index bd52f67f..2194223b 100644 --- a/3.0/modules/minislideshow/controllers/minislideshow.php +++ b/3.0/modules/minislideshow/controllers/minislideshow.php @@ -1,7 +1,7 @@ module == "rss") { + $data->messages["warn"][] = t("The MiniSlide Show module requires the RSS module."); + } + } + static function album_menu($menu, $theme) { // Add an option to access the slideshow from the album view. - $menu - ->append(Menu::factory("link") - ->id("minislideshow") - ->label(t("View MiniSlide Show")) - ->url(url::site("minislideshow/showslideshow/" . $theme->item()->id)) - ->css_class("g-dialog-link") - ->css_id("g-mini-slideshow-link")); + if ($theme->item()->children_count(array(array("type", "=", "photo")))) { + $menu + ->append(Menu::factory("link") + ->id("minislideshow") + ->label(t("View MiniSlide Show")) + ->url(url::site("minislideshow/showslideshow/" . $theme->item()->id)) + ->css_class("g-dialog-link") + ->css_id("g-mini-slideshow-link")); + } } static function photo_menu($menu, $theme) { diff --git a/3.0/modules/minislideshow/helpers/minislideshow_installer.php b/3.0/modules/minislideshow/helpers/minislideshow_installer.php index da071844..6ff23dcf 100644 --- a/3.0/modules/minislideshow/helpers/minislideshow_installer.php +++ b/3.0/modules/minislideshow/helpers/minislideshow_installer.php @@ -1,7 +1,7 @@ item()) { - return; - } - - return new View("minislideshow_header_block.html"); + return $theme->css("minislideshow_menu.css"); } } diff --git a/3.0/modules/minislideshow/module.info b/3.0/modules/minislideshow/module.info index 055b5e23..923b02d5 100644 --- a/3.0/modules/minislideshow/module.info +++ b/3.0/modules/minislideshow/module.info @@ -1,7 +1,7 @@ name = "MiniSlide Show" description = "Display MiniSlide Show on your Gallery." version = 1 -author_name = "" -author_url = "" +author_name = "rWatcher" +author_url = "http://codex.gallery2.org/User:RWatcher" info_url = "http://codex.gallery2.org/Gallery3:Modules:minislideshow" -discuss_url = "http://gallery.menalto.com/forum_module_minislideshow" +discuss_url = "http://gallery.menalto.com/node/90362" diff --git a/3.0/modules/minislideshow/views/minislideshow_dialog.html.php b/3.0/modules/minislideshow/views/minislideshow_dialog.html.php index c9507594..9ae60c0b 100644 --- a/3.0/modules/minislideshow/views/minislideshow_dialog.html.php +++ b/3.0/modules/minislideshow/views/minislideshow_dialog.html.php @@ -15,4 +15,4 @@ flashvars="xmlUrl= Embed: " width="485" height="300" align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="minislide" wmode="transparent" allowFullscreen="true" allowScriptAccess="always" quality="high" flashvars="xmlUrl=">" readonly> -
    \ No newline at end of file +
    diff --git a/3.0/modules/minislideshow/views/minislideshow_header_block.html.php b/3.0/modules/minislideshow/views/minislideshow_header_block.html.php deleted file mode 100644 index c52d0117..00000000 --- a/3.0/modules/minislideshow/views/minislideshow_header_block.html.php +++ /dev/null @@ -1,5 +0,0 @@ - - -" /> - - diff --git a/3.0/modules/moduleorder/controllers/admin_moduleorder.php b/3.0/modules/moduleorder/controllers/admin_moduleorder.php index 3eb7fca1..11f9a2fb 100644 --- a/3.0/modules/moduleorder/controllers/admin_moduleorder.php +++ b/3.0/modules/moduleorder/controllers/admin_moduleorder.php @@ -1,7 +1,7 @@ page_title = t("Gallery 3 :: Manage Module Updates"); $view->content = new View("admin_moduleupdates.html"); @@ -61,7 +64,7 @@ class Admin_Moduleupdates_Controller extends Admin_Controller { $cache_updates = array("date" => "", "updates" => 0); $refreshCache = true; } - + //Check the ability to access the Gallery3 GitHub $GitHub = null; try { @@ -90,6 +93,29 @@ class Admin_Moduleupdates_Controller extends Admin_Controller { $update_count = 0; if($refreshCache == true){ + // Only poll GalleryModules.com once for the ini file. + $fp = fopen('gm.ini', 'w'); + $fp2 = fopen('gm_core.ini','w'); + if(function_exists("curl_init")) { + $cp = curl_init("http://www.gallerymodules.com/gallerymodules.ini"); + curl_setopt($cp, CURLOPT_FILE, $fp); + $buffer = curl_exec($cp); + curl_close($cp); + fclose($fp); + + $cp = curl_init("http://www.gallerymodules.com/core.ini"); + curl_setopt($cp, CURLOPT_FILE, $fp2); + $buffer = curl_exec($cp); + curl_close($cp); + fclose($fp2); + } else { + fwrite($fp,file_get_contents("http://www.gallerymodules.com/gallerymodules.ini")); + fclose($fp); + + fwrite($fp2,file_get_contents("http://www.gallerymodules.com/core.ini")); + fclose($fp2); + } + foreach (module::available() as $this_module_name => $module_info) { $font_color_local = "black"; @@ -111,10 +137,10 @@ class Admin_Moduleupdates_Controller extends Admin_Controller { $font_color_local = $this->get_local_module_version_color ($module_info->version, $module_info->code_version); list ($core_version, $core_server) = $this->get_remote_module_version($this_module_name, "CORE"); $font_color_core = $this->get_module_version_color ($module_info->version, $module_info->code_version, $core_version); - list ($contrib_version, $contrib_server) = $this->get_remote_module_version($this_module_name, "CONTRIB"); - $font_color_contrib = $this->get_module_version_color ($module_info->version, $module_info->code_version, $contrib_version); - list ($gh_version, $gh_server) = $this->get_remote_module_version($this_module_name, "GH"); - $font_color_gh = $this->get_module_version_color ($module_info->version, $module_info->code_version, $gh_version); + if(!is_numeric($core_version)) { + list ($gh_version, $gh_server) = $this->get_remote_module_version($this_module_name, "GH"); + $font_color_gh = $this->get_module_version_color ($module_info->version, $module_info->code_version, $gh_version); + } if($font_color_core == "red" or $font_color_contrib == "red" or $font_color_gh == "red"){ $update_count++; @@ -127,14 +153,7 @@ class Admin_Moduleupdates_Controller extends Admin_Controller { $core_dlink = "http://github.com/gallery/gallery3/tree/master/modules/".$this_module_name; } } - - if (is_numeric($contrib_version)) { - if($contrib_version > $module_info->version) { - $contrib_dlink = "http://github.com/gallery/gallery3-contrib/tree/master/". - substr_replace(gallery::VERSION,"",strpos(gallery::VERSION," ")) ."/modules/".$this_module_name; - } - } - + if (is_numeric($gh_version)) { if($gh_version > $module_info->version) { $this_gm_repo = str_replace(".","",substr_replace(gallery::VERSION,"",strpos(gallery::VERSION," "))); @@ -166,6 +185,11 @@ class Admin_Moduleupdates_Controller extends Admin_Controller { Cache::instance()->set("moduleupdates_cache_updates", serialize($cache_updates), array("ModuleUpdates"), null); log::success("moduleupdates", t("Completed checking remote GitHub for modules updates.")); } + + if(is_file('gm.ini')) + unlink('gm.ini'); + if(is_file('gm_core.ini')) + unlink('gm_core.ini'); $view->content->vars = $cache; $view->content->update_time = $cache_updates['date']; @@ -174,6 +198,20 @@ class Admin_Moduleupdates_Controller extends Admin_Controller { $view->content->GitHub = $GitHub; $view->content->Gallery_Version = substr_replace(gallery::VERSION,"",strpos(gallery::VERSION," ")); + //End execution timer + $ExecutionTime = (time()-$bgtime); + if ($ExecutionTime < 1) { + $ExecutionTime = '1'; + }else if ($ExecutionTime <= 30){ + $ExecutionTime = '' . $ExecutionTime . ''; + }else if ($ExecutionTime <= 60){ + $ExecutionTime = '' . $ExecutionTime . ''; + }else{ + $ExecutionTime = '' . $ExecutionTime . ''; + } + + + $view->content->ExecutionTime = $ExecutionTime; print $view; } @@ -224,7 +262,6 @@ class Admin_Moduleupdates_Controller extends Admin_Controller { return $font_color; } - /** * Parses the known GitHub repositories for new versions of modules. * @@ -233,7 +270,6 @@ class Admin_Moduleupdates_Controller extends Admin_Controller { * gather the version information. Uses the following locations; * * http://github.com/gallery/gallery3 - * http://github.com/gallery/gallery3-contrib * http://www.gallerymodules.com * * @author brentil @@ -248,73 +284,69 @@ class Admin_Moduleupdates_Controller extends Admin_Controller { $file = null; switch ($server_location) { - case "CONTRIB": - //Check the Gallery3 Community Contributions GitHub - if ($file == null) { - try { - $file = fopen ("http://github.com/gallery/gallery3-contrib/raw/master/". - substr_replace(gallery::VERSION,"",strpos(gallery::VERSION," "))."/modules/".$module_name."/module.info", "r"); - if ($file != null) { - $server = '(GCC)'; - } - } - catch (Exception $e) { - } - } - break; case "CORE": //Check the main Gallery3 GitHub if ($file == null) { try { - $file = fopen ("http://github.com/gallery/gallery3/raw/master/modules/".$module_name."/module.info", "r"); + if(file_exists('gm_core.ini')) { + $file = 1; + } if ($file != null) { + $gm_core_array = parse_ini_file('gm_core.ini',true); $server = '(G)'; } } - catch (Exception $e) { + catch (Exception $e) { } } break; case "GH": - //Check GalleryModules.com - if ($file == null) { + //Parse ini file from GalleryModules.com try { - $this_gm_repo = str_replace(".","",substr_replace(gallery::VERSION,"",strpos(gallery::VERSION," "))); - if($this_gm_repo == "30"){ - $file = fopen ("http://www.gallerymodules.com/m/".$module_name, "r"); - } else { - $file = fopen ("http://www.gallerymodules.com/".$this_gm_repo."m/".$module_name, "r"); - } + if(file_exists('gm.ini')) { + $file = 1; + } if ($file != null) { + $gm_array = parse_ini_file('gm.ini',true); $server = '(GH)'; } } catch (Exception $e) { + echo $e; } - } break; - } - - if ($file != null) { - while (!feof ($file)) { - $line = fgets ($file, 1024); - if ($server_location == "GH"){ - //GH stores only the version info - if($line == "Not entered" or $line == "See git") { - $line = ""; - } - $version = $line; - break; - } else { - //Regular expression to find & gather the version number in the remote module.info file - if (preg_match ("@version = (.*)@i", $line, $out)) { - $version = $out[1]; - break; + } + + if ($file != null) { + //Search in the GM listing + if ($server_location == "GH"){ + //Search if this is a Gallery 3.0 module + if(array_key_exists($module_name,$gm_array)){ + if(array_key_exists('g3',$gm_array[$module_name])){ + $version = $gm_array[$module_name]['g3']; + } + if($version == ''){ + if(array_key_exists('g31',$gm_array[$module_name])){ + $version = $gm_array[$module_name]['g31']; } } - } - fclose ($file); + if($version == ''){ + if(array_key_exists('codex',$gm_array[$module_name])){ + $version = $gm_array[$module_name]['codex']; + } + } + } else { //Module not found + $version = ''; + } + //Search in the Core listing + } else { + if(array_key_exists($module_name,$gm_core_array)){ + $version = $gm_core_array[$module_name]['version']; + } else { //Module not found + $version = ''; + } } + } return array ($version, $server); } diff --git a/3.0/modules/moduleupdates/helpers/moduleupdates_event.php b/3.0/modules/moduleupdates/helpers/moduleupdates_event.php index ebafb880..440cf409 100644 --- a/3.0/modules/moduleupdates/helpers/moduleupdates_event.php +++ b/3.0/modules/moduleupdates/helpers/moduleupdates_event.php @@ -1,6 +1,6 @@ delete("ModuleUpdates"); //create the blank ModuleUpdates cache entry with an expiration of 0 days @@ -34,7 +34,7 @@ class moduleupdates_installer { } static function upgrade($version) { - module::set_version("moduleupdates", 7); + module::set_version("moduleupdates", 11); //Remove the ModuleUpdates cache entry 'JIC' Cache::instance()->delete("ModuleUpdates"); //Empty the ModuleUpdates cache entry so our new version starts from scratch diff --git a/3.0/modules/moduleupdates/module.info b/3.0/modules/moduleupdates/module.info index 603aeff5..cf66ddd7 100755 --- a/3.0/modules/moduleupdates/module.info +++ b/3.0/modules/moduleupdates/module.info @@ -1,7 +1,7 @@ -name = "Module Updates" +name = "ModuleUpdates" description = "Compares your installed module version against the ones stored in the GitHub." -version = 7 -author_name = "" -author_url = "" +version = 11 +author_name = "brentil" +author_url = "http://gallery.menalto.com/user/153736" info_url = "http://codex.gallery2.org/Gallery3:Modules:moduleupdates" -discuss_url = "http://gallery.menalto.com/forum_module_moduleupdates" +discuss_url = "http://gallery.menalto.com/node/96574" \ No newline at end of file diff --git a/3.0/modules/moduleupdates/views/admin_moduleupdates.html.php b/3.0/modules/moduleupdates/views/admin_moduleupdates.html.php index e55ed7af..b5722d21 100644 --- a/3.0/modules/moduleupdates/views/admin_moduleupdates.html.php +++ b/3.0/modules/moduleupdates/views/admin_moduleupdates.html.php @@ -2,7 +2,7 @@
    -

    +

    @@ -16,7 +16,7 @@
  • Green = Your version is newer than the GitHub
    ") ?>
  • Orange = Your file version is newer than the installed version
    ") ?>
  • Pink = Your installed version is newer than file version
    ") ?>
  • -
  • ") ?>
  • +
  • ") ?>
  • " class="submit" />
  • @@ -24,7 +24,7 @@
      -
    • +
    Core Modules @@ -45,7 +45,7 @@ - +
    Community Contributed Modules @@ -53,7 +53,6 @@
    Installed") ?>
    -
    @@ -62,7 +61,6 @@ "> "; ?> *"; } ?> "; } ?> - "; ?> *"; } ?> $module_name['version'] or $module_name['core_version'] > $module_name['code_version']) { echo "".$module_name['contrib_version']."";} else { echo $module_name['contrib_version']; } ?> "; } ?> "; ?> *"; } ?> $module_name['version'] or $module_name['core_version'] > $module_name['code_version']) { echo "".$module_name['gh_version']."";} else { echo $module_name['gh_version']; } ?> "; } ?> diff --git a/3.0/modules/navcarousel/controllers/navcarousel.php b/3.0/modules/navcarousel/controllers/navcarousel.php index 3b5401a7..d35c897a 100644 --- a/3.0/modules/navcarousel/controllers/navcarousel.php +++ b/3.0/modules/navcarousel/controllers/navcarousel.php @@ -1,7 +1,7 @@ id", "", "post", array("id" => "g-edit-movie-form")); @@ -62,86 +58,38 @@ class movie_Core { } static function extract_frame($input_file, $output_file) { - $ffmpeg = movie::find_ffmpeg(); - if (empty($ffmpeg)) { - // BEGIN rWatcher Edit. - copy(MODPATH . "noffmpeg/images/missing_movie.png", $output_file); - //throw new Exception("@todo MISSING_FFMPEG"); - // END rWatcher Edit. - } - - $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($input_file) . - " -an -ss 00:00:03 -an -r 1 -vframes 1" . - " -y -f mjpeg " . escapeshellarg($output_file) . " 2>&1"; - exec($cmd); - - clearstatcache(); // use $filename parameter when PHP_version is 5.3+ - if (filesize($output_file) == 0) { - // Maybe the movie is shorter, fall back to the first frame. - $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($input_file) . - " -an -an -r 1 -vframes 1" . - " -y -f mjpeg " . escapeshellarg($output_file) . " 2>&1"; - exec($cmd); - - clearstatcache(); - if (filesize($output_file) == 0) { - throw new Exception("@todo FFMPEG_FAILED"); - } - } + // rWatcher Edit: Just copy the generic thumb instead of extracting a frame. + copy(MODPATH . "noffmpeg/images/missing_movie.png", $output_file); } /** * Return the path to the ffmpeg binary if one exists and is executable, or null. */ static function find_ffmpeg() { - if (!($ffmpeg_path = module::get_var("gallery", "ffmpeg_path")) || !file_exists($ffmpeg_path)) { - $ffmpeg_path = system::find_binary( - "ffmpeg", module::get_var("gallery", "graphics_toolkit_path")); - module::set_var("gallery", "ffmpeg_path", $ffmpeg_path); - } - return $ffmpeg_path; + // rWatcher Edit: Return true to trick the system into thinking ffmpeg is present. + return true; } /** * Return the width, height, mime_type and extension of the given movie file. */ static function get_file_metadata($file_path) { - $ffmpeg = movie::find_ffmpeg(); - if (empty($ffmpeg)) { - // BEGIN rWatcher Edit. - $pi = pathinfo($file_path); - $extension = isset($pi["extension"]) ? $pi["extension"] : "flv"; // No extension? Assume FLV. - $mime_type = in_array(strtolower($extension), array("mp4", "m4v")) ? - "video/mp4" : "video/x-flv"; - $vid_width = 320; - $vid_height = 240; - if (strtolower($extension) == "flv") { - $flvinfo = new FLVMetaData($file_path); - $info = $flvinfo->getMetaData(); - if (($info["width"] != "") && ($info["height"] != "")) { - $vid_width = $info["width"]; - $vid_height = $info["height"]; - } - } - return array($vid_width, $vid_height, $mime_type, $extension); - //throw new Exception("@todo MISSING_FFMPEG"); - // END rWatcher Edit. - } - - $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($file_path) . " 2>&1"; - $result = `$cmd`; - if (preg_match("/Stream.*?Video:.*?(\d+)x(\d+)/", $result, $regs)) { - list ($width, $height) = array($regs[1], $regs[2]); - } else { - list ($width, $height) = array(0, 0); - } - + // rWatcher Edit: Use FLVMetaData lib instead of ffmpeg for .flv files. + // For other files, just set a 320x240 default video resolution. $pi = pathinfo($file_path); $extension = isset($pi["extension"]) ? $pi["extension"] : "flv"; // No extension? Assume FLV. $mime_type = in_array(strtolower($extension), array("mp4", "m4v")) ? "video/mp4" : "video/x-flv"; - - return array($width, $height, $mime_type, $extension); + $vid_width = 320; + $vid_height = 240; + if (strtolower($extension) == "flv") { + $flvinfo = new FLVMetaData($file_path); + $info = $flvinfo->getMetaData(); + if (($info["width"] != "") && ($info["height"] != "")) { + $vid_width = $info["width"]; + $vid_height = $info["height"]; + } + } + return array($vid_width, $vid_height, $mime_type, $extension); } - -} \ No newline at end of file +} diff --git a/3.0/modules/noffmpeg/module.info b/3.0/modules/noffmpeg/module.info index fe6b0ec3..8412eb77 100644 --- a/3.0/modules/noffmpeg/module.info +++ b/3.0/modules/noffmpeg/module.info @@ -4,4 +4,4 @@ version = 1 author_name = "" author_url = "" info_url = "http://codex.gallery2.org/Gallery3:Modules:noffmpeg" -discuss_url = "http://gallery.menalto.com/forum_module_noffmpeg" +discuss_url = "http://gallery.menalto.com/node/97978" diff --git a/3.0/modules/noffmpeg/views/form_uploadify.html.php b/3.0/modules/noffmpeg/views/form_uploadify.html.php deleted file mode 100644 index 911e02d5..00000000 --- a/3.0/modules/noffmpeg/views/form_uploadify.html.php +++ /dev/null @@ -1,164 +0,0 @@ - - - - - -
    - admin && !$movies_allowed)): ?> -
    - -

    - suhosin.session.encrypt setting from Suhosin. You must disable this setting to upload photos.", - array("encrypt_url" => "http://www.hardened-php.net/suhosin/configuration.html#suhosin.session.encrypt", - "suhosin_url" => "http://www.hardened-php.net/suhosin/")) ?> -

    - - - admin && !$movies_allowed): ?> -

    - ffmpeg on your system. Movie uploading disabled. Help!", array("help_url" => "http://codex.gallery2.org/Gallery3:FAQ#Why_does_it_say_I.27m_missing_ffmpeg.3F")) ?> -

    - -
    - - -
    -

    - -

    -
      - parents() as $i => $parent): ?> - > title) ?> - -
    • title) ?>
    • -
    -
    - -
    - - -
    -
    -
      -
    -
    -
    - - \ No newline at end of file diff --git a/3.0/modules/pages/controllers/admin_pages.php b/3.0/modules/pages/controllers/admin_pages.php new file mode 100644 index 00000000..1d695776 --- /dev/null +++ b/3.0/modules/pages/controllers/admin_pages.php @@ -0,0 +1,275 @@ +page_title = t("Manage pages"); + $view->content = new View("admin_pages.html"); + $query = ORM::factory("static_page"); + $view->content->pages = $query->order_by("name", "ASC")->find_all(); + $view->content->form = $this->get_prefs_form(); + print $view; + } + + public function createpage() { + // Display a form for creating a new page. + $view = new Admin_View("admin.html"); + $view->page_title = t("Create page"); + $view->content = new View("admin_pages_new.html"); + $view->content->form = $this->get_new_page_form(); + print $view; + } + + public function editpage($id) { + // Display a form for editing an existing page. + $existing_page = ORM::factory("static_page", $id); + $view = new Admin_View("admin.html"); + $view->page_title = t("Edit page"); + $view->content = new View("admin_pages_new.html"); + $view->content->form = $this->get_edit_page_form($existing_page); + print $view; + } + + public function savepage() { + // Save a page to the database. + + access::verify_csrf(); + + // Store form values into variables. + $page_id = Input::instance()->post("page_id"); + $page_name = urlencode(trim(Input::instance()->post("page_name"))); + $page_title = Input::instance()->post("page_title"); + $page_code = stripslashes($_REQUEST["page_code"]); // access var directly to get around xss filtering. + $display_menu = Input::instance()->post("display_menu"); + + // If $page_id is set, update an existing page. + if (isset($page_id)) { + $update_page = ORM::factory("static_page", $page_id); + $update_page->title = $page_title; + $update_page->html_code = $page_code; + $update_page->display_menu = $display_menu; + $update_page->save(); + message::success(t("Page %page_name updated", array("page_name" => $update_page->name))); + log::success("pages", t("Page %page_name updated", array("page_name" => $update_page->name))); + url::redirect("admin/pages"); + } else { + + // If $page_id is not set, we are dealing with a new page. + // Check and make sure a page with the same names doesn't already exist. + $existing_page = ORM::factory("static_page") + ->where("name", "=", $page_name) + ->find_all(); + + // If the page doesn't exist, save it to the database. + if (count($existing_page) == 0) { + $new_page = ORM::factory("static_page"); + $new_page->name = $page_name; + $new_page->title = $page_title; + $new_page->html_code = $page_code; + $new_page->display_menu = $display_menu; + $new_page->save(); + message::success(t("Page %page_name created", array("page_name" => $page_name))); + log::success("pages", t("Page %page_name created", array("page_name" => $page_name))); + url::redirect("admin/pages"); + } else { + + // If the page does exist, ask the user if they want to overwrite the old page with the new one. + message::error(t("Page %page_name already exists, press Save again to overwrite.", array("page_name" => $page_name))); + $view = new Admin_View("admin.html"); + $view->page_title = t("Edit page"); + $view->content = new View("admin_pages_new.html"); + $view->content->form = $this->get_overwrite_page_form($existing_page[0]->id, $page_name, $page_title, $page_code, $display_menu); + print $view; + } + } + } + + public function form_delete($id) { + // Display a form asking the user if they want to delete a page. + $one_page = ORM::factory("static_page", $id); + if ($one_page->loaded()) { + print $this->get_delete_form($one_page); + } + } + + public function delete($id) { + // Delete the specified page. + + access::verify_csrf(); + + // Make sure $id belongs to an actual page. + $one_page = ORM::factory("static_page", $id); + if (!$one_page->loaded()) { + throw new Kohana_404_Exception(); + } + + // If the form validates, delete the specified page. + $form = $this->get_delete_form($one_page); + if ($form->validate()) { + $name = $one_page->name; + $one_page->delete(); + message::success(t("Deleted page %page_name", array("page_name" => $name))); + log::success("pages", t("Deleted page %page_name", array("page_name" => $name))); + json::reply(array("result" => "success", "location" => url::site("admin/pages"))); + } else { + print $form; + } + } + + public function form_rename($id) { + // Display a form to allow the user to rename a page. + $one_page = ORM::factory("static_page", $id); + if ($one_page->loaded()) { + print InPlaceEdit::factory(urldecode($one_page->name)) + ->action("admin/pages/rename/$id") + ->render(); + } + } + + public function rename($id) { + // Rename an existing page. + access::verify_csrf(); + + // Make sure the page specified by $id exists. + $one_page = ORM::factory("static_page", $id); + if (!$one_page->loaded()) { + throw new Kohana_404_Exception(); + } + + $in_place_edit = InPlaceEdit::factory($one_page->name) + ->action("admin/pages/rename/$one_page->id") + ->rules(array("required", "length[1,64]")); + + // If the form validates, and if the new name doesn't already exist, rename the page. + if ($in_place_edit->validate()) { + $old_name = $one_page->name; + $new_name = urlencode(trim($in_place_edit->value())); + $new_name_exists = ORM::factory("static_page")->where("name", "=", $new_name)->find_all(); + if (count($new_name_exists) == 0) { + $one_page->name = $new_name; + $one_page->save(); + $message = t("Renamed page %old_name to %new_name", + array("old_name" => $old_name, "new_name" => $new_name)); + message::success($message); + log::success("pages", $message); + json::reply(array("result" => "success", "location" => url::site("admin/pages"))); + } else { + json::reply(array("result" => "error", "form" => (string)$in_place_edit->render())); + } + } else { + json::reply(array("result" => "error", "form" => (string)$in_place_edit->render())); + } + } + + static function get_delete_form($one_page) { + // Generate a new form asking the user if they want to delete a page. + $form = new Forge("admin/pages/delete/$one_page->id", "", "post", array("id" => "g-delete-pages-form")); + $group = $form->group("delete_page") + ->label(t("Really delete page %page_name?", array("page_name" => $one_page->name))); + $group->submit("")->value(t("Delete Page")); + return $form; + } + + private function get_new_page_form() { + // Generate a form for creating a new page. + $form = new Forge("admin/pages/savepage", "", "post", + array("id" => "g-pages-admin-form")); + + $pages_group = $form->group("new_page"); + $pages_group->input("page_name") + ->label(t("Name")); + $pages_group->input("page_title") + ->label(t("Title")); + $pages_group->textarea("page_code") + ->label(t("HTML Code")); + $pages_group->checkbox("display_menu") + ->label(t("Display in menu?")) + ->checked(false); + $pages_group->submit("save_page") + ->value(t("Save")); + + return $form; + } + + private function get_overwrite_page_form($id, $name, $title, $html_code, $display_menu) { + // Generate a form for overwriting an existing page. + $form = new Forge("admin/pages/savepage", "", "post", + array("id" => "g-pages-admin-form")); + + $pages_group = $form->group("new_page"); + $pages_group->hidden("page_id") + ->value($id); + $pages_group->input("page_name") + ->label(t("Name")) + ->readonly() + ->value($name); + $pages_group->input("page_title") + ->label(t("Title")) + ->value($title); + $pages_group->textarea("page_code") + ->label(t("HTML Code")) + ->value($html_code); + $pages_group->checkbox("display_menu") + ->label(t("Display in menu?")) + ->checked($display_menu); + $pages_group->submit("save_page") + ->value(t("Save")); + + return $form; + } + + private function get_edit_page_form($existing_page) { + // Generate a form for editing an existing page. Reuse the overwrite form for as it's basically the same thing. + return ($this->get_overwrite_page_form($existing_page->id, $existing_page->name, $existing_page->title, $existing_page->html_code, $existing_page->display_menu)); + } + + private function get_prefs_form() { + // Generate a form for global preferences. + $form = new Forge("admin/pages/saveprefs", "", "post", + array("id" => "g-pages-admin-form")); + + $pages_group = $form->group("preferences")->label(t("Settings")); + $pages_group->checkbox("display_sidebar") + ->label(t("Hide sidebar on Pages?")) + ->checked(module::get_var("pages", "show_sidebar")); + $pages_group->checkbox("disable_rich_editor") + ->label(t("Disable rich text editor?")) + ->checked(module::get_var("pages", "disable_rte")); + $pages_group->submit("save_prefs") + ->value(t("Save")); + + return $form; + } + + public function saveprefs() { + // Save a preferences to the database. + + access::verify_csrf(); + + // Save form variables. + module::set_var("pages", "show_sidebar", Input::instance()->post("display_sidebar")); + module::set_var("pages", "disable_rte", Input::instance()->post("disable_rich_editor")); + + // Display message and load main pages admin screen. + message::success(t("Your settings have been saved.")); + url::redirect("admin/pages"); + } +} diff --git a/3.0/modules/pages/controllers/pages.php b/3.0/modules/pages/controllers/pages.php new file mode 100644 index 00000000..3fc638f7 --- /dev/null +++ b/3.0/modules/pages/controllers/pages.php @@ -0,0 +1,49 @@ +where("name", "=", $page_name) + ->find_all(); + + // If it doesn't exist, display a 404 error. + if (count($existing_page) == 0) { + throw new Kohana_404_Exception(); + } + + // Set up breadcrumbs. + $breadcrumbs = array(); + $root = item::root(); + $breadcrumbs[] = Breadcrumb::instance($root->title, $root->url())->set_first(); + $breadcrumbs[] = Breadcrumb::instance(t($existing_page[0]->title), url::site("pages/show/{$page_name}"))->set_last(); + + // Display the page. + $template = new Theme_View("page.html", "other", "Pages"); + $template->set_global(array("breadcrumbs" => $breadcrumbs)); + $template->page_title = t("Gallery :: ") . t($existing_page[0]->title); + $template->content = new View("pages_display.html"); + $template->content->title = $existing_page[0]->title; + $template->content->body = $existing_page[0]->html_code; + print $template; + } +} diff --git a/3.0/modules/pages/css/jHtmlArea.css b/3.0/modules/pages/css/jHtmlArea.css new file mode 100644 index 00000000..641ea291 --- /dev/null +++ b/3.0/modules/pages/css/jHtmlArea.css @@ -0,0 +1,48 @@ +div.jHtmlArea { display: inline block; border: solid 1px #ccc; } +div.jHtmlArea div { padding: 0px; margin: 0px; } +div.jHtmlArea .ToolBar { } +div.jHtmlArea .ToolBar ul { border: solid 0px #ccc; margin: 1px; padding: 1px; position:relative; display: inline; background: #fff url(../images/jHtmlArea_Toolbar_Group_BG.png) repeat-x;} +div.jHtmlArea .ToolBar ul li { list-style-type: none; float: left; border: none; padding: 1px; margin: 1px; } +div.jHtmlArea .ToolBar ul li:hover { border: solid 1px #ccc; background: #ddd url(../images/jHtmlArea_Toolbar_Group__Btn_Select_BG.png); padding: 0; } +div.jHtmlArea .ToolBar ul li a { display: block; width: 16px; height: 16px; background: url(../images/jHtmlArea.png) no-repeat -16px -500px; border: none; cursor: pointer; padding: 0px; } +div.jHtmlArea .ToolBar ul li a.highlighted { border: solid 1px #aaa; background-color: #bbb; padding: 0; } +div.jHtmlArea .ToolBar ul li.separator {height: 16px; margin: 0 2px 0 3px; border-left: 1px solid #ccc;} +div.jHtmlArea .ToolBar ul li.separator:hover { padding: 1px; background-color: #fff; border-top:none; border-bottom:none; border-right:none;} + +div.jHtmlArea .ToolBar ul li a:hover { } +div.jHtmlArea .ToolBar ul li a.bold { background-position: 0 0; } +div.jHtmlArea .ToolBar ul li a.italic { background-position: -16px 0; } +div.jHtmlArea .ToolBar ul li a.underline { background-position: -32px 0; } +div.jHtmlArea .ToolBar ul li a.strikethrough { background-position: -48px 0; } +div.jHtmlArea .ToolBar ul li a.link { background-position: -64px 0; } +div.jHtmlArea .ToolBar ul li a.unlink { background-position: -80px 0; } +div.jHtmlArea .ToolBar ul li a.orderedlist { background-position: -96px 0; } +div.jHtmlArea .ToolBar ul li a.unorderedlist { background-position: -112px 0; } +div.jHtmlArea .ToolBar ul li a.image { background-position: -128px 0; } +div.jHtmlArea .ToolBar ul li a.cut { background-position: -144px 0; } +div.jHtmlArea .ToolBar ul li a.copy { background-position: -160px 0; } +div.jHtmlArea .ToolBar ul li a.paste { background-position: -176px 0; } + +div.jHtmlArea .ToolBar ul li a.html { background-position: -192px 0; opacity:0.6; filter:alpha(opacity=60);} +div.jHtmlArea .ToolBar ul li a.html.highlighted { opacity:1.0; filter:alpha(opacity=100);} + +div.jHtmlArea .ToolBar ul li a.h1 { background-position: 0 -16px;} +div.jHtmlArea .ToolBar ul li a.h2 { background-position: -16px -16px;} +div.jHtmlArea .ToolBar ul li a.h3 { background-position: -32px -16px;} +div.jHtmlArea .ToolBar ul li a.h4 { background-position: -48px -16px;} +div.jHtmlArea .ToolBar ul li a.h5 { background-position: -64px -16px;} +div.jHtmlArea .ToolBar ul li a.h6 { background-position: -80px -16px;} +div.jHtmlArea .ToolBar ul li a.subscript { background-position: -96px -16px;} +div.jHtmlArea .ToolBar ul li a.superscript { background-position: -112px -16px;} +div.jHtmlArea .ToolBar ul li a.indent { background-position: -128px -16px;} +div.jHtmlArea .ToolBar ul li a.outdent { background-position: -144px -16px;} +div.jHtmlArea .ToolBar ul li a.horizontalrule { background-position: -160px -16px;} +div.jHtmlArea .ToolBar ul li a.p { background-position: -176px -16px;} + + +div.jHtmlArea .ToolBar ul li a.justifyleft { background-position: 0 -32px;} +div.jHtmlArea .ToolBar ul li a.justifycenter { background-position: -16px -32px;} +div.jHtmlArea .ToolBar ul li a.justifyright { background-position: -32px -32px;} +div.jHtmlArea .ToolBar ul li a.increasefontsize { background-position: -48px -32px;} +div.jHtmlArea .ToolBar ul li a.decreasefontsize { background-position: -64px -32px;} +div.jHtmlArea .ToolBar ul li a.forecolor { background-position: -80px -32px;} \ No newline at end of file diff --git a/3.1/modules/embedlinks/helpers/embedlinks_block.php b/3.0/modules/pages/helpers/pages_block.php similarity index 50% rename from 3.1/modules/embedlinks/helpers/embedlinks_block.php rename to 3.0/modules/pages/helpers/pages_block.php index 0985007e..90e42b3a 100644 --- a/3.1/modules/embedlinks/helpers/embedlinks_block.php +++ b/3.0/modules/pages/helpers/pages_block.php @@ -1,7 +1,7 @@ t("Embed Links Dialog"), "embed_links_album" => t("Embed Links Album")); + return array("pages_block" => t("Pages Links")); } static function get($block_id, $theme) { $block = ""; - if (!$theme->item()) { - return; - } - switch ($block_id) { - case "embed_links_dialog": - // Display dialog buttons in the sidebar. - $block = new Block(); - $block->css_id = "g-embed-links-sidebar"; - $block->title = t("Link To This Page"); - $block->content = new View("embedlinks_sidebar.html"); - break; + case "pages_block": - case "embed_links_album": - // If the current item is an album and if "In Page" links are enabled then - // display links to the current album in the theme sidebar. - if ($theme->item()->is_album() && module::get_var("embedlinks", "InPageLinks")) { + // Create a new block with a list of all Pages and their links. + + // Query the database for all existing pages. + // If at least one page exists, display the sidebar block. + $query = ORM::factory("static_page"); + $pages = $query->order_by("title", "ASC")->find_all(); + if (count($pages) > 0) { + + // Loop through each page and generate an HTML list of their links and titles. + $content = ""; + + // Make a new sidebar block. $block = new Block(); - $block->css_id = "g-embed-links-album-sidebar"; - $block->title = t("Links"); - $block->content = new View("embedlinks_album_block.html"); + $block->css_id = "g-pages"; + $block->title = t("Pages"); + $block->content = new View("pages_sidebar.html"); + $block->content->links = $content; } - break; + break; } - return $block; } } diff --git a/3.1/modules/moduleorder/helpers/moduleorder_event.php b/3.0/modules/pages/helpers/pages_event.php similarity index 54% rename from 3.1/modules/moduleorder/helpers/moduleorder_event.php rename to 3.0/modules/pages/helpers/pages_event.php index 84773db1..d62c8a51 100644 --- a/3.1/modules/moduleorder/helpers/moduleorder_event.php +++ b/3.0/modules/pages/helpers/pages_event.php @@ -1,7 +1,7 @@ = 32 - if (module::get_version("gallery") < 32) { - site_status::warning( - t("The module 'Module Order' requires Gallery core version of 32 or higher."), - "moduleorder_needs_higherversion"); - } else { - site_status::clear("moduleorder_needs_higherversion"); +class pages_event_Core { + static function admin_menu($menu, $theme) { + // Add a settings link to the admin menu. + $menu->get("content_menu") + ->append(Menu::factory("link") + ->id("pages") + ->label(t("Pages Settings")) + ->url(url::site("admin/pages"))); + } + + static function site_menu($menu, $theme) { + $menu_pages = ORM::factory("static_page") + ->where("display_menu", "=", true) + ->order_by("title", "DESC") + ->find_all(); + if (count($menu_pages) > 0) { + foreach ($menu_pages as $one_page) { + $menu->add_after("home", Menu::factory("link") + ->id("pages-" . $one_page->id) + ->label(t($one_page->title)) + ->url(url::site("pages/show/" . $one_page->name))); + } } } - - static function admin_menu($menu, $theme) { - $menu->get("settings_menu") - ->append(Menu::factory("link") - ->id("moduleorder_menu") - ->label(t("Module order")) - ->url(url::site("admin/moduleorder"))); - } } diff --git a/3.1/modules/tagsmap/helpers/tagsmap_installer.php b/3.0/modules/pages/helpers/pages_installer.php similarity index 52% rename from 3.1/modules/tagsmap/helpers/tagsmap_installer.php rename to 3.0/modules/pages/helpers/pages_installer.php index 48ad5461..c1738a77 100644 --- a/3.1/modules/tagsmap/helpers/tagsmap_installer.php +++ b/3.0/modules/pages/helpers/pages_installer.php @@ -1,7 +1,7 @@ query("CREATE TABLE IF NOT EXISTS {tags_gpses} ( + $db->query("CREATE TABLE IF NOT EXISTS {static_pages} ( `id` int(9) NOT NULL auto_increment, - `tag_id` int(9) NOT NULL, - `latitude` varchar(128) NOT NULL, - `longitude` varchar(128) NOT NULL, - `description` varchar(2048) default NULL, + `name` varchar(255) default NULL, + `title` varchar(255) default NULL, + `html_code` text default NULL, + `display_menu` boolean default 0, PRIMARY KEY (`id`), - KEY(`tag_id`, `id`)) + UNIQUE KEY(`name`)) DEFAULT CHARSET=utf8;"); - // Set the default to Australia (homage to rWatcher) - module::set_var("tagsmap", "googlemap_latitude", -26.11); - module::set_var("tagsmap", "googlemap_longitude", 134); - module::set_var("tagsmap", "googlemap_zoom", 5); - module::set_var("tagsmap", "googlemap_type", "G_NORMAL_MAP"); - module::set_version("tagsmap", 2); - } + // Set some initial values. + module::set_var("pages", "show_sidebar", true); + module::set_var("pages", "disable_rte", false); - static function deactivate() { - site_status::clear("tagsmap_needs_tag"); + // Set the module version number. + module::set_version("pages", 3); } - - static function uninstall() { - // Delete the GPS table before uninstalling. + static function upgrade($version) { $db = Database::instance(); - $db->query("DROP TABLE IF EXISTS {tags_gpses};"); - module::delete("tagsmap"); + if ($version == 1) { + $db->query("ALTER TABLE {static_pages} ADD COLUMN `display_menu` boolean default 0"); + module::set_version("pages", $version = 2); + } + if ($version == 2) { + module::set_var("pages", "disable_rte", false); + module::set_version("pages", $version = 3); + } } } diff --git a/3.1/modules/downloadfullsize/helpers/downloadfullsize_theme.php b/3.0/modules/pages/helpers/pages_theme.php similarity index 73% rename from 3.1/modules/downloadfullsize/helpers/downloadfullsize_theme.php rename to 3.0/modules/pages/helpers/pages_theme.php index 547d3549..52f905ae 100644 --- a/3.1/modules/downloadfullsize/helpers/downloadfullsize_theme.php +++ b/3.0/modules/pages/helpers/pages_theme.php @@ -1,7 +1,7 @@ item && access::can("view_full", $theme->item)) { - return $theme->css("downloadfullsize_menu.css"); +class pages_theme_Core { + static function admin_head($theme) { + // Load jHtmlArea js and css. + if (module::get_var("pages", "disable_rte", false) == false) { + return $theme->script("jHtmlArea-0.7.0.js") . + $theme->css("jHtmlArea.css"); } } } diff --git a/3.0/modules/pages/images/jHtmlArea.png b/3.0/modules/pages/images/jHtmlArea.png new file mode 100644 index 00000000..54c66a10 Binary files /dev/null and b/3.0/modules/pages/images/jHtmlArea.png differ diff --git a/3.1/modules/albumtree/images/nolines_plus.gif b/3.0/modules/pages/images/jHtmlArea_Toolbar_Group_BG.png old mode 100755 new mode 100644 similarity index 66% rename from 3.1/modules/albumtree/images/nolines_plus.gif rename to 3.0/modules/pages/images/jHtmlArea_Toolbar_Group_BG.png index f258ce21..bcfb0545 Binary files a/3.1/modules/albumtree/images/nolines_plus.gif and b/3.0/modules/pages/images/jHtmlArea_Toolbar_Group_BG.png differ diff --git a/3.1/modules/albumtree/images/nolines_minus.gif b/3.0/modules/pages/images/jHtmlArea_Toolbar_Group__Btn_Select_BG.png old mode 100755 new mode 100644 similarity index 67% rename from 3.1/modules/albumtree/images/nolines_minus.gif rename to 3.0/modules/pages/images/jHtmlArea_Toolbar_Group__Btn_Select_BG.png index 2592ac20..4287b5b8 Binary files a/3.1/modules/albumtree/images/nolines_minus.gif and b/3.0/modules/pages/images/jHtmlArea_Toolbar_Group__Btn_Select_BG.png differ diff --git a/3.0/modules/pages/js/jHtmlArea-0.7.0.js b/3.0/modules/pages/js/jHtmlArea-0.7.0.js new file mode 100644 index 00000000..d1e360c4 --- /dev/null +++ b/3.0/modules/pages/js/jHtmlArea-0.7.0.js @@ -0,0 +1,403 @@ +/* +* jHtmlArea 0.7.0 - WYSIWYG Html Editor jQuery Plugin +* Copyright (c) 2009 Chris Pietschmann +* http://jhtmlarea.codeplex.com +* Licensed under the Microsoft Reciprocal License (Ms-RL) +* http://jhtmlarea.codeplex.com/license +*/ +(function($) { + $.fn.htmlarea = function(opts) { + if (opts && typeof (opts) === "string") { + var args = []; + for (var i = 1; i < arguments.length; i++) { args.push(arguments[i]); } + var htmlarea = jHtmlArea(this[0]); + var f = htmlarea[opts]; + if (f) { return f.apply(htmlarea, args); } + } + return this.each(function() { jHtmlArea(this, opts); }); + }; + var jHtmlArea = window.jHtmlArea = function(elem, options) { + if (elem.jquery) { + return jHtmlArea(elem[0]); + } + if (elem.jhtmlareaObject) { + return elem.jhtmlareaObject; + } else { + return new jHtmlArea.fn.init(elem, options); + } + }; + jHtmlArea.fn = jHtmlArea.prototype = { + + // The current version of jHtmlArea being used + jhtmlarea: "0.7.0", + + init: function(elem, options) { + if (elem.nodeName.toLowerCase() === "textarea") { + var opts = $.extend({}, jHtmlArea.defaultOptions, options); + elem.jhtmlareaObject = this; + + var textarea = this.textarea = $(elem); + var container = this.container = $("
    ").addClass("jHtmlArea").width(textarea.width()).insertAfter(textarea); + + var toolbar = this.toolbar = $("
    ").addClass("ToolBar").appendTo(container); + priv.initToolBar.call(this, opts); + + var iframe = this.iframe = $(" + + +
    + + + + + + + + + +
    + + +
    +item()) { + $item = $theme->item(); +} else { + $item = ORM::factory("item", 1); +} +if (access::user_can($guest, "view", $item)) { + $show_like_code = true; +} +?> diff --git a/3.0/modules/social_share/views/facebook_share.html.php b/3.0/modules/social_share/views/facebook_share.html.php new file mode 100644 index 00000000..0c832b31 --- /dev/null +++ b/3.0/modules/social_share/views/facebook_share.html.php @@ -0,0 +1,5 @@ + +
    +"> + +
    \ No newline at end of file diff --git a/3.0/modules/social_share/views/google.html.php b/3.0/modules/social_share/views/google.html.php new file mode 100644 index 00000000..f928a358 --- /dev/null +++ b/3.0/modules/social_share/views/google.html.php @@ -0,0 +1,19 @@ + +
    + +
    " + annotation=""> +
    + + + +
    \ No newline at end of file diff --git a/3.0/modules/social_share/views/twitter.html.php b/3.0/modules/social_share/views/twitter.html.php new file mode 100644 index 00000000..a63ea68e --- /dev/null +++ b/3.0/modules/social_share/views/twitter.html.php @@ -0,0 +1,21 @@ + +
    + + +
    \ No newline at end of file diff --git a/3.0/modules/square_thumbs/helpers/square_thumbs_graphics.php b/3.0/modules/square_thumbs/helpers/square_thumbs_graphics.php index a8641039..fed231da 100644 --- a/3.0/modules/square_thumbs/helpers/square_thumbs_graphics.php +++ b/3.0/modules/square_thumbs/helpers/square_thumbs_graphics.php @@ -1,7 +1,7 @@ 0) { + module::set_var("strip_exif", "exiv_path", $_REQUEST['exiv_path']); + $data['success'] = true; + } else { + $error = ""; + switch ($val) { + case 0: $error = "Empty file path provided"; break; + case -1: $error = "File does not exist"; break; + case -2: $error = "Path is a directory"; break; + default: $error = "Unspecified error"; + } + $data['error'] = $error; + } + + echo json_encode($data); + } + + public function index() { + $form = $this->_get_form(); + + if (request::method() == "post") { + access::verify_csrf(); + + if ($form->validate()) { + module::set_var("strip_exif", "exiv_path", $_POST['exiv_path']); + + if ($_POST['exif_tags'] != "") { + module::set_var("strip_exif", "exif_remove", (isset($_POST['exif_remove']) ? $_POST['exif_remove'] : false)); + module::set_var("strip_exif", "exif_tags", $_POST['exif_tags']); + } else { + module::set_var("strip_exif", "exif_remove", false); + module::set_var("strip_exif", "exif_tags", self::$defExifTags); + } + + if ($_POST['iptc_tags'] != "") { + module::set_var("strip_exif", "iptc_remove", (isset($_POST['iptc_remove']) ? $_POST['iptc_remove'] : false)); + module::set_var("strip_exif", "iptc_tags", $_POST['iptc_tags']); + } else { + module::set_var("strip_exif", "iptc_remove", false); + module::set_var("strip_exif", "iptc_tags", self::$defIptcTags); + } + + if (isset($_POST['verbose'])) + module::set_var("strip_exif", "verbose", $_POST['verbose']); + + message::success(t("Settings have been saved")); + url::redirect("admin/strip_exif"); + } else { + message::error(t("There was a problem with the submitted form. Please check your values and try again.")); + } + } + + print $this->_get_view(); + } + + private function _get_view($form = null) { + $v = new Admin_View("admin.html"); + $v->page_title = t("Gallery 3 :: Manage Strip EXIF/IPTC Settings"); + + $v->content = new View("admin_strip_exif.html"); + $v->content->form = empty($form) ? $this->_get_form() : $form; + + return $v; + } + + private function _get_form() { + $form = new Forge("admin/strip_exif", "", "post", array("id" => "g-admin-strip_exif-form")); + + $group = $form->group("system")->label(t("System")); + + $exivPath = strip_exif::whereis("exiv2"); + $group ->input("exiv_path") + ->id("exiv_path") + ->label(t("Path to exiv2 binary:")) + ->value(module::get_var("strip_exif", "exiv_path", $exivPath)) + ->callback("strip_exif::verify_exiv_path") + ->error_messages("required", t("You must enter the path to exiv2")) + ->error_messages("invalid", t("File does not exist")) + ->error_messages("is_dir", t("File is a directory")) + ->message("Auto detected exiv2 here: " . $exivPath); + + + $group = $form->group("tags")->label(t("Tags")); + + $group ->checkbox("exif_remove") + ->label(t("Strip these EXIF tags:")) + ->checked(module::get_var("strip_exif", "exif_remove", true) == 1); + if (($exifTags = module::get_var("strip_exif", "exif_tags", self::$defExifTags)) == "") + $exifTags = self::$defExifTags; + $group ->input("exif_tags") + ->id("exif_tags") + ->value($exifTags); + + $group ->checkbox("iptc_remove") + ->label(t("Strip these IPTC tags:")) + ->checked(module::get_var("strip_exif", "iptc_remove", true) == 1); + if (($iptcTags = module::get_var("strip_exif", "iptc_tags", self::$defIptcTags)) == "") + $iptcTags = self::$defIptcTags; + $group ->input("iptc_tags") + ->id("iptc_tags") + ->value($iptcTags); + + $form->submit("submit")->value(t("Save")); + return $form; + } +} + +# vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab: diff --git a/3.0/modules/strip_exif/helpers/strip_exif.php b/3.0/modules/strip_exif/helpers/strip_exif.php new file mode 100644 index 00000000..063adf14 --- /dev/null +++ b/3.0/modules/strip_exif/helpers/strip_exif.php @@ -0,0 +1,99 @@ += 1) + $logfile = VARPATH . "modules/strip_exif/log/strip_exif.log"; + else + $logfile = "/dev/null"; + + self::log(1, "Stripping '" . $file . "'"); + + $cmd = $base_cmd . " \"" . $file . "\" >> " . $logfile . " 2>&1"; + self::log(3, " " . $cmd); + exec($cmd); + } + + static function strip($item) { + if (!($item->is_photo() && $item->mime_type == "image/jpeg")) + return; + + $tags = ""; + if (module::get_var("strip_exif", "exif_remove", false)) { + $tags .= "Exif."; + $tags .= preg_replace("/[\s,]+/", " Exif.", module::get_var("strip_exif", "exif_tags", "")) . " "; + } + if (module::get_var("strip_exif", "iptc_remove", false)) { + $tags .= "Iptc."; + $tags .= preg_replace("/[\s,]+/", " Iptc.", module::get_var("strip_exif", "iptc_tags", "")) . " "; + } + $tagList = preg_split("/[\s]+/", $tags, -1, PREG_SPLIT_NO_EMPTY); + + $base_cmd = module::get_var("strip_exif", "exiv_path") . " "; + self::log(1, "Stripping tags from item id " . $item->id); + foreach ($tagList as $tag) { + $base_cmd .= "-M\"del " . $tag . "\"" . " "; + self::log(2, " " . $tag); + } + self::log(2, "Using command:"); + self::log(2, " " . $base_cmd); + + foreach(array($item->file_path(), $item->resize_path(), $item->thumb_path()) as $file) { + self::run_exiv($base_cmd, $file); + } + + $parent = $item->parent(); + if ($parent->album_cover_item_id == $item->id) { + self::run_exiv($base_cmd, $parent->thumb_path()); + } + + self::log(1, "Successfully stripped tags from item id " . $item->id); + } + + static function whereis($app) { + $op = @shell_exec("whereis " . $app); + if ($op != "") { + $op = explode(" ", $op); + for ($i = 1; $i < count($op); $i++) { + if (file_exists($op[$i]) && !is_dir($op[$i])) + return $op[$i]; + } + } + return false; + } + + static function verify_path($path) { + if ($path == "") + return 0; + else if (!file_exists($path)) + return -1; + else if (is_dir($path)) + return -2; + + return 1; + } + + static function verify_exiv_path($field) { + $v = self::verify_path($field->value); + switch ($v) { + case 0: $field->add_error("required", 1); break; + case -1: $field->add_error("invalid", 1); break; + case -2: $field->add_error("is_dir", 1); break; + } + } + + static function log($verbosity, $item) { + if (module::get_var("strip_exif", "verbose", 0) < $verbosity) + return; + + if (is_string($item) || is_numeric($item)) {} + else + $item = print_r($item, true); + + $fh = fopen(VARPATH . "modules/strip_exif/log/strip_exif.log", "a"); + fwrite($fh, date("Y-m-d H:i:s") . ": " . $item . "\n"); + fclose($fh); + } +} + +# vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab: diff --git a/3.0/modules/strip_exif/helpers/strip_exif_event.php b/3.0/modules/strip_exif/helpers/strip_exif_event.php new file mode 100644 index 00000000..b56ad625 --- /dev/null +++ b/3.0/modules/strip_exif/helpers/strip_exif_event.php @@ -0,0 +1,22 @@ +get("settings_menu") + ->append(Menu::factory("link") + ->id("strip_exif_menu") + ->label(t("Strip EXIF/IPTC Data")) + ->url(url::site("admin/strip_exif"))); + } + + static function item_created($item) { + strip_exif::strip($item); + } + + static function item_updated_data_file($item) { + strip_exif::strip($item); + } +} + +# vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab: diff --git a/3.0/modules/strip_exif/helpers/strip_exif_installer.php b/3.0/modules/strip_exif/helpers/strip_exif_installer.php new file mode 100644 index 00000000..80caa7bd --- /dev/null +++ b/3.0/modules/strip_exif/helpers/strip_exif_installer.php @@ -0,0 +1,38 @@ + + +
    +

    + +

    + +
    + +
    +
    diff --git a/3.0/modules/tag_albums/-- Theme Files/clean_canvas/views/calpage.html.php b/3.0/modules/tag_albums/-- Theme Files/clean_canvas/views/calpage.html.php deleted file mode 100644 index 54bb4db8..00000000 --- a/3.0/modules/tag_albums/-- Theme Files/clean_canvas/views/calpage.html.php +++ /dev/null @@ -1,199 +0,0 @@ - - -html_attributes() ?> xml:lang="en" lang="en"> - - - start_combining("script,css") ?> - - <? 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 ?> - - " - type="image/x-icon" /> - - page_type == "collection"): ?> - - - - - - - - script("json2-min.js") ?> - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("jquery.localscroll.js") ?> - - - page_subtype == "photo"): ?> - script("jquery.scrollTo.js") ?> - script("gallery.show_full_size.js") ?> - page_subtype == "movie"): ?> - script("flowplayer.js") ?> - - - head() ?> - - - script("ui.init.js") ?> - css("yui/reset-fonts-grids.css") ?> - css("superfish/css/superfish.css") ?> - - css("dark/themeroller/ui.base.css") ?> - css("dark/screen_colors.css") ?> - css("dark/screen_candy.css") ?> - - css("clean/themeroller/ui.base.css") ?> - css("clean/screen_colors.css") ?> - css("clean/screen_candy.css") ?> - - css("screen_layout_base.css") ?> - css("screen_fonts.css") ?> - - css("screen_layout_wide.css") ?> - - css("screen_layout_fixed.css") ?> - - - - - get_combined("script") ?> - - - get_combined("css") ?> - - - body_attributes() ?>> - page_top() ?> - -
    - -
    - - site_status() ?> -
    -
    - - - - - - user_menu() ?> - header_top() ?> -
    - - 1 ) { ?> - $display_name) { ?> - - - - installed_locales = array_merge(array("" => t("« none »")), $locales); ?> - selected = (string) locales::cookie_locale(); ?> - - -
    - - - - - header_bottom() ?> -
    - - - -
      - - - > - - url) : ?> - title) ?> - - title) ?> - - - - -
    - - - -
    -
    -
    -
    -
    - messages() ?> - -
    -
    -
    - item() && !empty($parents))): ?> - - -
    - page_subtype != "login"): ?> - - -
    -
    - -
    - page_bottom() ?> - - diff --git a/3.0/modules/tag_albums/-- Theme Files/greydragon/views/calpage.html.php b/3.0/modules/tag_albums/-- Theme Files/greydragon/views/calpage.html.php deleted file mode 100644 index 9d3341de..00000000 --- a/3.0/modules/tag_albums/-- Theme Files/greydragon/views/calpage.html.php +++ /dev/null @@ -1,297 +0,0 @@ - - -load_sessioninfo(); ?> - -html_attributes() ?> xml:lang="en" lang="en" is_rtl)? "dir=rtl" : null; ?> > -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; -?> - - - -start_combining("script,css") ?> - - - -item()): ?> -bb2html($theme->item()->title, 2); ?> -tag()): ?> - $theme->bb2html($theme->tag()->name, 2))) ?> - -bb2html(item::root()->title, 2); ?> - - -<?= $_title ?> -disable_seosupport): ?> - - - - - - -blendpagetrans): ?> - - - - - - " /> - -allow_root_page): ?> -: ; action-uri=url(); ?>?root=yes; icon-uri=favicon.ico" /> -: ; action-uri=url(); ?>?root=no; icon-uri=favicon.ico" /> - -: ; action-uri=url(); ?>; icon-uri=favicon.ico" /> - -admin): ?> - -: ; action-uri=; icon-uri=favicon.ico" /> - - - - -appletouchicon): ?> - - -script("json2-min.js") ?> -script("jquery.js") ?> -script("jquery.form.js") ?> -script("jquery-ui.js") ?> -script("gallery.common.js") ?> - - -script("gallery.ajax.js"); ?> -script("gallery.dialog.js"); ?> - - -page_subtype == "photo"): ?> -script("jquery.scrollTo.js"); ?> -page_subtype == "movie"): ?> -script("flowplayer.js") ?> - - -head() ?> - - -script("animation.js"); ?> -script("ui.support.js"); ?> - -theme_css_inject(); ?> - - -get_combined("css"); ?> - -css_link("colorpacks/" . $theme->colorpack . "/colors.css", FALSE); ?> -css_link("framepacks/" . $theme->framepack . "/frame.css", FALSE); ?> -custom_css_path != ""): ?> -css_link($theme->custom_css_path, TRUE); ?> - - -get_combined("script") ?> - - -thumb_inpage): ?> - - - -item()): ?> -item(); ?> - - - -body_attributes() ?>show_root_page)? ' id="g-rootpage"' : null; ?> is_rtl)? "class=\"rtl\"" : null; ?> > -page_top() ?> -site_status() ?> -guest) or ($theme->show_guest_menu)) and ($theme->mainmenu_position == "bar")): ?> - -
    - site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?> -
    - -
    -header_top() ?> - -bb2html($header_text, 1) ?> - - - - -guest) or ($theme->show_guest_menu)) and ($theme->mainmenu_position != "bar")): ?> -
    - site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?> -
    - - -messages() ?> -header_bottom() ?> - -loginmenu_position == "header"): ?> -user_menu() ?> - - - -breadcrumb_menu($theme, null); ?> - -breadcrumbs_position == "hide"): - else: - $limit_title_length = module::get_var("gallery", "visible_title_length", 999); - - $breadcrumb_content .= ''; - endif; - - print $breadcrumb_content; - - // End Edit. -?> - -custom_header(); ?> -
    -page_subtype != "login") and ($theme->page_subtype != "reauthenticate") and ($theme->sidebarvisible == "top")): ?> -
    - -
    - -
    -
    -show_root_page): ?> - sidebar_menu($item->url()) ?> -
    "> - - album_menu() ?> - - photo_menu() ?> - - movie_menu() ?> - - tag_menu() ?> - -
    - -sidebarvisible): - case "left": - echo '
    '; - $closediv = TRUE; - break; - case "none": - case "top": - case "bottom": - if (($theme->thumb_inpage) and ($page_subtype == "photo")): - echo '
    '; - $closediv = TRUE; - else: - $closediv = FALSE; - endif; - break; - default: - echo '
    '; - $closediv = TRUE; - break; - endswitch; ?> -page_subtype != "login") and ($theme->page_subtype != "reauthenticate")): ?> -sidebarvisible == "none") or ($theme->sidebarvisible == "bottom") or ($theme->sidebarvisible == "top")): ?> -thumb_inpage) and ($page_subtype == "photo")): ?> -

     

    '; ?> -get_block_html("thumbnav"); ?> - - - - - -" : null; ?> - -sidebarvisible): - case "left": - echo '
    '; - break; - case "none": - case "top": - case "bottom": - if (($theme->thumb_inpage) and ($page_subtype == "photo")): - echo '
    '; - else: - echo '
    '; - endif; - break; - default: - echo '
    '; - break; - endswitch; - - if ($theme->show_root_page): - echo new View("rootpage.html"); - else: - echo $content; - endif; ?> -
    -
    -
    -page_subtype != "login") and ($theme->page_subtype != "reauthenticate") and ($theme->sidebarvisible == "bottom")): ?> -
    - -
    - - -page_bottom() ?> - - diff --git a/3.0/modules/tag_albums/-- Theme Files/greydragon/views/paginator.html.php b/3.0/modules/tag_albums/-- Theme Files/greydragon/views/paginator.html.php deleted file mode 100644 index 5918299c..00000000 --- a/3.0/modules/tag_albums/-- Theme Files/greydragon/views/paginator.html.php +++ /dev/null @@ -1,209 +0,0 @@ - - - -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 = " "; - else: - $pagination_msg = t("Page:") . ' '; - if ($total_pages < 13): - for ($i = 1; $i <= $total_pages; $i++): - if ($i == $current_page): - $pagination_msg .= '' . t($i) . ''; - else: - $pagination_msg .= '' . t($i) . ''; - endif; - if ($i < $total_pages): - $pagination_msg .= '·'; - endif; - endfor; - elseif ($current_page < 9): - for ($i = 1; $i <= 10; $i++): - if ($i == $current_page): - $pagination_msg .= '' . t($i) . ''; - else: - $pagination_msg .= '' . t($i) . ''; - endif; - if ($i < 10): - $pagination_msg .= '·'; - endif; - endfor; - - $pagination_msg .= '…'; - $pagination_msg .= '' . t($total_pages - 1) . ''; - $pagination_msg .= '·'; - $pagination_msg .= '' . t($total_pages) . ''; - - elseif ($current_page > $total_pages - 8): - $pagination_msg .= '' . t(1) . ''; - $pagination_msg .= '·'; - $pagination_msg .= '' . t(2) . ''; - $pagination_msg .= '…'; - - for ($i = $total_pages - 9; $i <= $total_pages; $i++): - if ($i == $current_page): - $pagination_msg .= '' . t($i) . ''; - else: - $pagination_msg .= '' . t($i) . ''; - endif; - if ($i < $total_pages): - $pagination_msg .= '·'; - endif; - endfor; - - else: - $pagination_msg .= '' . t(1) . ''; - $pagination_msg .= '·'; - $pagination_msg .= '' . t(2) . ''; - $pagination_msg .= '…'; - - for ($i = $current_page - 5; $i <= $current_page + 5; $i++): - if ($i == $current_page): - $pagination_msg .= '' . t($i) . ''; - else: - $pagination_msg .= '' . t($i) . ''; - endif; - if ($i < $current_page + 5): - $pagination_msg .= '·'; - endif; - endfor; - - $pagination_msg .= '…'; - $pagination_msg .= '' . t($total_pages - 1) . ''; - $pagination_msg .= '·'; - $pagination_msg .= '' . t($total_pages) . ''; - endif; - endif; -?> - - \ No newline at end of file diff --git a/3.0/modules/tag_albums/-- Theme Files/greydragon/views/photo.html.php b/3.0/modules/tag_albums/-- Theme Files/greydragon/views/photo.html.php deleted file mode 100644 index 5d3ede73..00000000 --- a/3.0/modules/tag_albums/-- Theme Files/greydragon/views/photo.html.php +++ /dev/null @@ -1,122 +0,0 @@ - -desc_allowbbcode): - $_description = $theme->bb2html($item->description, 1); - else: - $_description = nl2br(html::purify($item->description)); - endif; - - if ($theme->is_photometa_visible): - $_description .= ''; - 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; -?> - -
    - bb2html(html::purify($item->title), 1); ?> -
    -

    -
    - add_paginator("top"); ?> - photo_top() ?> - photo_descmode == "top") and ($_description)): ?> -
    - -
    - resize_top($item) ?> - resize_width; - -// rWatcher Modification. - $siblings = ""; - if (isset($dynamic_siblings)) { - $siblings = $dynamic_siblings; - } else { - $siblings = $item->parent()->children(); - } -// End rWatcher Modification - ?> - -
    - \n"; - $script .= " if (document.images) {\n"; - for ($i = 0; ($i <= count($siblings) - 1); $i++): - if ($siblings[$i]->rand_key == $item->rand_key): ?> - " title="bb2html(html::purify($item->title), 2) ?>" href="file_url() : $item->resize_url(); ?>"> - resize_img(array("id" => "g-photo-id-{$item->id}", "class" => "g-resize", "alt" => $_title)) ?> - - 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): ?> - is_album()): ?> - file_url() : $siblings[$i]->resize_url(); ?>">  - - - - - \n"; ?> - photo_descmode): - case "overlay_top": - $_align = "g-align-top"; - break; - case "overlay_bottom": - $_align = "g-align-bottom"; - break; - default: - break; - endswitch; - endif; ?> - - -
    - - -
    - -
    - resize_bottom($item) ?> -
    - photo_descmode == "bottom") and ($_description)): ?> -
    - - add_paginator("bottom"); ?> - photo_bottom() ?> -
    - \ No newline at end of file diff --git a/3.0/modules/tag_albums/-- Theme Files/greydragon/views/tag_albums_album.html.php b/3.0/modules/tag_albums/-- Theme Files/greydragon/views/tag_albums_album.html.php deleted file mode 100644 index 3a348d3b..00000000 --- a/3.0/modules/tag_albums/-- Theme Files/greydragon/views/tag_albums_album.html.php +++ /dev/null @@ -1,135 +0,0 @@ - -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). -?> - -
    - dynamic_top() ?> -

    bb2html(html::purify($title), 1) ?>

    -
    - -add_paginator("top"); ?> - -album_descmode == "top") and ($description)): ?> -
    bb2html(html::purify($description), 1) ?>
    - - - -
    -
    -
    -
    - - -
    -
      - - $child): ?> -thumb_height > $thumb_item->thumb_width); - - $item_class = $child->is_album() ? "g-album" : "g-photo"; - $content = '
    • 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 .= '

      '; - $content .= ''; - if ($thumb_item->has_thumb()): - $content .= $thumb_item->thumb_img(); - else: - $content .= 'No Image'; - endif; - $content .= '

      '; - - 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 .= '
        bb2html(html::purify($child->title), 2) . ''; - if ($_thumb_metamode == "merged"): - $content .= $theme->thumb_info($child); - endif; - $content .= '
      '; - endif; - - if (($_thumb_metamode == "default") and ($_thumb_descmode != "overlay_bottom")): - $content .= ''; - endif; - - if ($_thumb_descmode == "bottom"): - $content .= '
        '; - $content .= '
      • ' . $theme->bb2html(html::purify($child->title), 2) . '
      • '; - if ($_thumb_metamode == "merged"): - $content .= $theme->thumb_info($child); - endif; - $content .= '
      '; - endif; - - /* - if ($addcontext): - $_text = $this->context_menu($child, "#g-item-id-{$child->id} .g-thumbnail"); - $content .= (stripos($_text, '
    • '))? $_text : null; - endif; - */ - - $content .= '
    '; - $content .= $theme->thumb_bottom($child); - $content .= ''; - - print $content; - // End rWatcher Edit. -?> - - -
  • - - -
    -dynamic_bottom() ?> - -album_descmode == "bottom") and ($description)): ?> -
    bb2html(html::purify($description), 1) ?>
    - - -add_paginator("bottom"); ?> diff --git a/3.0/modules/tag_albums/controllers/admin_tag_albums.php b/3.0/modules/tag_albums/controllers/admin_tag_albums.php index 6267e33c..6682588f 100644 --- a/3.0/modules/tag_albums/controllers/admin_tag_albums.php +++ b/3.0/modules/tag_albums/controllers/admin_tag_albums.php @@ -1,7 +1,7 @@ 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_index_filter_top_options["tag_index_filter_top"] = Array(t("Display filter links on the top of \"All Tags\" album pages?"), module::get_var("tag_albums", "tag_index_filter_top")); + $tag_albums_tagsort_group->checklist("tag_index_filter_top") + ->options($tag_index_filter_top_options); + + $tag_index_filter_bottom_options["tag_index_filter_bottom"] = Array(t("Display filter links on the bottom of \"All Tags\" album pages?"), module::get_var("tag_albums", "tag_index_filter_bottom")); + $tag_albums_tagsort_group->checklist("tag_index_filter_bottom") + ->options($tag_index_filter_bottom_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") @@ -104,7 +108,8 @@ class Admin_Tag_Albums_Controller extends Admin_Controller { 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_index_filter_top", count($form->Tag_Albums_Tag_Sort->tag_index_filter_top->value)); + module::set_var("tag_albums", "tag_index_filter_bottom", count($form->Tag_Albums_Tag_Sort->tag_index_filter_bottom->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); diff --git a/3.0/modules/tag_albums/controllers/tag_albums.php b/3.0/modules/tag_albums/controllers/tag_albums.php index b1293eec..763e6652 100644 --- a/3.0/modules/tag_albums/controllers/tag_albums.php +++ b/3.0/modules/tag_albums/controllers/tag_albums.php @@ -1,7 +1,7 @@ where("id", "=", $id) - ->find_all(); - - // If it doesn't exist, redirect to the modules root page. - if (count($album_tags) == 0) { - url::redirect("tag_albums/"); - } - - // If it does exist, and is set to *, load a list of all tags. - if ($album_tags[0]->tags == "*") { - $this->index($id, ""); - } else { - // Otherwise, populate this page with the specified items. - - // Inherit permissions, title and description from the album that linked to this page. - $album = ORM::factory("item", $album_tags[0]->album_id); - access::required("view", $album); - $page_title = $album->title; - $page_description = $album->description; - - // Determine page sort order. - $sort_page_field = $album->sort_column; - $sort_page_direction = $album->sort_order; - - // Determine search type (AND/OR) and generate an array of the tag ids. - $tag_ids = Array(); - foreach (explode(",", $album_tags[0]->tags) as $tag_name) { - $tag = ORM::factory("tag")->where("name", "=", trim($tag_name))->find(); - if ($tag->loaded()) { - $tag_ids[] = $tag->id; - } - } - $album_tags_search_type = $album_tags[0]->search_type; - - // 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); - if ($page < 1) { - url::redirect("tag_albums/album/" . $id); - } - - // First item to display. - $offset = ($page - 1) * $page_size; - - // Figure out what the highest page number is. - $max_pages = ceil($count / $page_size); - - // Don't let the visitor go past the last page. - if ($max_pages && $page > $max_pages) { - url::redirect("tag_albums/album/{$id}/?page=$max_pages"); - } - - // Figure out which items to display on this page and store their details in $children. - $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->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); - } - $children[] = $child_tag; - } - - // Set up the previous and next page buttons. - if ($page > 1) { - $previous_page = $page - 1; - $view->previous_page_link = url::site("tag_albums/album/{$id}/?page={$previous_page}"); - } - if ($page < $max_pages) { - $next_page = $page + 1; - $view->next_page_link = url::site("tag_albums/album/{$id}/?page={$next_page}"); - } - - // Set up breadcrumbs. - $tag_album_breadcrumbs = Array(); - $counter = 0; - $tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($album->title, ""); - $parent_item = ORM::factory("item", $album->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=" . $album->id; - $tag_album_breadcrumbs = array_reverse($tag_album_breadcrumbs, true); - - // Set up and display the actual page. - $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->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); - print $template; - } - } - 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. @@ -161,10 +31,18 @@ class tag_albums_Controller extends Controller { 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/"); + $redirect_url = "tag_cloud_page/"; + if ($id) { + $redirect_url .= "?album={$id}"; + } + url::redirect($redirect_url); return; } elseif (($tag_album_index_type == "alltags") && (module::is_active("all_tags"))) { - url::redirect("all_tags/"); + $redirect_url = "all_tags/"; + if ($id) { + $redirect_url .= "?album={$id}"; + } + url::redirect($redirect_url); return; } } @@ -174,7 +52,7 @@ class tag_albums_Controller extends Controller { ->where("id", "=", $id) ->find_all(); if (count($album_tags) == 0) { - $id = ""; + $id = 0; } // Inherit permissions, title and description from the album that linked to this page, @@ -182,14 +60,17 @@ class tag_albums_Controller extends Controller { $album = ""; $page_title = module::get_var("tag_albums", "tag_page_title", "All Tags"); $page_description = ""; - if ($id == "") { + $str_page_url = ""; + if ($id == 0) { $album = ORM::factory("item", 1); access::required("view", $album); + $str_page_url = "tag_albums/"; } else { $album = ORM::factory("item", $album_tags[0]->album_id); access::required("view", $album); $page_title = $album->title; $page_description = $album->description; + $str_page_url = "tag_albums/album/" . $id . "/" . urlencode($album->title); } // Figure out sort order from module preferences. @@ -225,10 +106,10 @@ class tag_albums_Controller extends Controller { } if ($index) { $page = ceil($index / $page_size); - if ($id == "") { - url::redirect("tag_albums/?page=$page"); + if ($page == 1) { + url::redirect("$str_page_url"); } else { - url::redirect("tag_albums/album/" . $id . "?page=$page"); + url::redirect("$str_page_url?page=$page"); } } } @@ -237,7 +118,7 @@ class tag_albums_Controller extends Controller { // don't allow the visitor to go below page 1. $page = Input::instance()->get("page", 1); if ($page < 1) { - url::redirect("tag_albums/"); + url::redirect($str_page_url); } // First item to display. @@ -266,7 +147,7 @@ class tag_albums_Controller extends Controller { // Don't let the visitor go past the last page. if ($max_pages && $page > $max_pages) { - url::redirect("tag_albums/?page=$max_pages"); + url::redirect("$str_page_url?page=$max_pages"); } // Figure out which items to display on this page. @@ -290,67 +171,97 @@ class tag_albums_Controller extends Controller { // Set up the previous and next page buttons. if ($page > 1) { $previous_page = $page - 1; - $view->previous_page_link = url::site("tag_albums/album/" . $id . "/?page={$previous_page}"); + $view->previous_page_link = url::site($str_page_url . "?page={$previous_page}"); } if ($page < $max_pages) { $next_page = $page + 1; - $view->next_page_link = url::site("tag_albums/album/" . $id . "/?page={$next_page}"); + $view->next_page_link = url::site($str_page_url . "?page={$next_page}"); } // Generate an arry of "fake" items, one for each tag on the page. - // Grab thumbnails from the most recently uploaded item for each tag, if available. - $children = Array(); + // Grab thumbnails from a admin-specified photo, or the most recently + // uploaded item for each tag, if available. + $children_array = Array(); foreach ($display_tags as $one_tag) { - $tag_item = ORM::factory("item") - ->viewable() - ->join("items_tags", "items.id", "items_tags.item_id") - ->where("items_tags.tag_id", "=", $one_tag->id) - ->order_by("items.id", "DESC") - ->find_all(1, 0); - $child_tag = new Tag_Albums_Item($one_tag->name, url::site("tag_albums/tag/" . $one_tag->id . "/" . $id), "album"); - if (count($tag_item) > 0) { - if ($tag_item[0]->has_thumb()) { - $child_tag->set_thumb($tag_item[0]->thumb_url(), $tag_item[0]->thumb_width, $tag_item[0]->thumb_height); + $tag_thumb_url = ""; + $tag_thumb_width = ""; + $tag_thumb_height = ""; + + // Check and see if the admin specified a photo to use for this tags thumbnail. + $record = ORM::factory("tags_album_tag_cover")->where("tag_id", "=", $one_tag->id)->find(); + if ($record->loaded()) { + $tag_thumb_item = ORM::factory("item", $record->photo_id); + if ($tag_thumb_item->loaded()) { + $tag_thumb_url = $tag_thumb_item->thumb_url(); + $tag_thumb_width = $tag_thumb_item->thumb_width; + $tag_thumb_height = $tag_thumb_item->thumb_height; } } - $children[] = $child_tag; + + // If no pre-specified thumbnail was found, use the most recently uploaded photo (if available). + if ($tag_thumb_url == "") { + $tag_item = ORM::factory("item") + ->viewable() + ->join("items_tags", "items.id", "items_tags.item_id") + ->where("items_tags.tag_id", "=", $one_tag->id) + ->order_by("items.id", "DESC") + ->find_all(1, 0); + if (count($tag_item) > 0) { + if ($tag_item[0]->has_thumb()) { + $tag_thumb_url = $tag_item[0]->thumb_url(); + $tag_thumb_width = $tag_item[0]->thumb_width; + $tag_thumb_height = $tag_item[0]->thumb_height; + } + } + } + + // Create a new object to represent this virtual album, and add it to the array of objects for + // this page. + $child_tag = new Tag_Albums_Item($one_tag->name, url::site("tag_albums/tag/" . $one_tag->id . "/" . $id . "/" . urlencode($one_tag->name)), "album", 0); + if ($tag_thumb_url != "") { + $child_tag->set_thumb($tag_thumb_url, $tag_thumb_width, $tag_thumb_height); + } + $children_array[] = $child_tag; } + $children = new Tag_Albums_Children($children_array); // Set up breadcrumbs. $tag_album_breadcrumbs = Array(); $parent_url = ""; - if ($id != "") { + if ($id > 0) { $counter = 0; - $tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($album->title, ""); + $tag_album_breadcrumbs[] = Breadcrumb::instance($album->title, $album->url())->set_last(); $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()); + $tag_album_breadcrumbs[] = Breadcrumb::instance($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[] = Breadcrumb::instance($parent_item->title, $parent_item->url())->set_first(); $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, ""); + $tag_album_breadcrumbs[] = Breadcrumb::instance(item::root()->title, item::root()->url())->set_first(); + $tag_album_breadcrumbs[] = Breadcrumb::instance($page_title, $str_page_url)->set_first(); } // Set up and display the actual page. - $template = new Theme_View("calpage.html", "collection", "Tag Albums"); + $template = new Theme_View("page.html", "collection", "Tag Albums"); + $template->set_global( + array("page" => $page, + "max_pages" => $max_pages, + "page_size" => $page_size, + "children" => $children, + "breadcrumbs" => $tag_album_breadcrumbs, + "children_count" => $all_tags_count)); $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->set_global("parent_url", $parent_url); // Used by Grey Dragon. - $template->content = new View("tag_albums_album.html"); + $template->content = new View("dynamic.html"); $template->content->title = $page_title; $template->content->description = $page_description; + + $template->set_global("parent_url", $parent_url); // Used by Grey Dragon. $template->content->filter_text = $this->_get_filter_html($id, $filter); - $template->set_global("breadcrumbs", $tag_album_breadcrumbs); print $template; } @@ -365,13 +276,19 @@ class tag_albums_Controller extends Controller { ->where("id", "=", $album_id) ->find_all(); if (count($album_tags) == 0) { - $album_id = ""; + $album_id = 0; } + // Load the current tag. + $display_tag = ORM::factory("tag", $id); + // Figure out sort order from module preferences. $sort_page_field = module::get_var("tag_albums", "subalbum_sort_by", "title"); $sort_page_direction = module::get_var("tag_albums", "subalbum_sort_direction", "ASC"); + // Figure out the URL to this page. + $str_page_url = "tag_albums/tag/{$id}/{$album_id}/" . urlencode($display_tag->name); + // Figure out how many items to display on each page. $page_size = module::get_var("gallery", "page_size", 9); @@ -382,7 +299,11 @@ class tag_albums_Controller extends Controller { $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"); + if ($page == 1) { + url::redirect($str_page_url); + } else { + url::redirect($str_page_url . "?page=$page"); + } } } @@ -390,7 +311,7 @@ class tag_albums_Controller extends Controller { // don't allow the visitor to go below page 1. $page = Input::instance()->get("page", 1); if ($page < 1) { - url::redirect("tag_albums/tag/" . $id . "/" . $album_id); + url::redirect($str_page_url); } // First item to display. @@ -405,103 +326,269 @@ class tag_albums_Controller extends Controller { // Don't let the visitor go past the last page. if ($max_pages && $page > $max_pages) { - url::redirect("tag_albums/tag/{$id}/" . $album_id . "/?page=$max_pages"); + url::redirect($str_page_url . "/?page=$max_pages"); } // Figure out which items to display on this page. $tag_children = $this->_get_records(Array($id), $page_size, $offset, "items." . $sort_page_field, $sort_page_direction, "OR", true); - - // 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->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); - } - $children[] = $child_tag; - } - + // Set up the previous and next page buttons. if ($page > 1) { $previous_page = $page - 1; - $view->previous_page_link = url::site("tag_albums/tag/{$id}/" . $album_id . "/?page={$previous_page}"); + $view->previous_page_link = url::site($str_page_url . "/?page={$previous_page}"); } if ($page < $max_pages) { $next_page = $page + 1; - $view->next_page_link = url::site("tag_albums/tag/{$id}/" . $album_id . "/?page={$next_page}"); + $view->next_page_link = url::site($str_page_url . "/?page={$next_page}"); } - // Load the current tag. - $display_tag = ORM::factory("tag", $id); - // Set up breadcrumbs for the page. $tag_album_breadcrumbs = Array(); $parent_url = ""; - if ($album_id != "") { + if ($album_id > 0) { $counter = 0; - $tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($display_tag->name, ""); + $tag_album_breadcrumbs[] = Breadcrumb::instance($display_tag->name, $str_page_url)->set_last(); $parent_item = ORM::factory("item", $album_tags[0]->album_id); 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()); + $tag_album_breadcrumbs[] = Breadcrumb::instance($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[] = Breadcrumb::instance($parent_item->title, $parent_item->url())->set_first(); + $parent_item = ORM::factory("item", $album_tags[0]->album_id); + $tag_album_breadcrumbs[1]->url .= "?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[] = Breadcrumb::instance(item::root()->title, item::root()->url())->set_first(); 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); + $tag_album_breadcrumbs[] = Breadcrumb::instance(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[] = Breadcrumb::instance(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, ""); + $tag_album_breadcrumbs[] = Breadcrumb::instance($display_tag->name, $str_page_url)->set_last(); } // Set up and display the actual page. - $template = new Theme_View("calpage.html", "collection", "Tag Albums"); + $template = new Theme_View("page.html", "collection", "Tag Albums"); + $template->set_global( + array("page" => $page, + "max_pages" => $max_pages, + "page_size" => $page_size, + "children" => $tag_children, + "breadcrumbs" => $tag_album_breadcrumbs, + "children_count" => $count)); $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->set_global("parent_url", $parent_url); // Used by Grey Dragon. - $template->content = new View("tag_albums_album.html"); + $template->content = new View("dynamic.html"); $template->content->title = $display_tag->name; - $template->set_global("breadcrumbs", $tag_album_breadcrumbs); + $template->content->description = $page_description; + + $template->set_global("all_siblings", $this->_get_records(Array($id), $count, 0, "items." . $sort_page_field, $sort_page_direction, "OR", false)); + $template->set_global("parent_url", $parent_url); // Used by Grey Dragon. print $template; + + // Set breadcrumbs on the photo pages to point back to the calendar day view. + item::set_display_context_callback("tag_albums_Controller::get_display_context", $id, $album_id); + } + + public function album($id) { + // Displays a dynamic page containing items that have been + // tagged with one or more tags. + + // Load the specified ID to make sure it exists. + $album_tags = ORM::factory("tags_album_id") + ->where("id", "=", $id) + ->find_all(); + + // If it doesn't exist, redirect to the modules root page. + if (count($album_tags) == 0) { + url::redirect("tag_albums/"); + } + + // If it does exist, and is set to *, load a list of all tags. + if ($album_tags[0]->tags == "*") { + $this->index($id, ""); + } else { + // Otherwise, populate this page with the specified items. + + // Inherit permissions, title and description from the album that linked to this page. + $album = ORM::factory("item", $album_tags[0]->album_id); + access::required("view", $album); + $page_title = $album->title; + $page_description = $album->description; + + // URL to this page + $str_page_url = "tag_albums/album/" . $id . "/" . urlencode($album->name); + + // Determine page sort order. + $sort_page_field = $album->sort_column; + $sort_page_direction = $album->sort_order; + + // Determine search type (AND/OR) and generate an array of the tag ids. + $tag_ids = Array(); + foreach (explode(",", $album_tags[0]->tags) as $tag_name) { + $tag = ORM::factory("tag")->where("name", "=", trim($tag_name))->find(); + if ($tag->loaded()) { + $tag_ids[] = $tag->id; + } + } + $album_tags_search_type = $album_tags[0]->search_type; + + // 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); + if ($page == 1) { + url::redirect($str_page_url); + } else { + url::redirect($str_page_url . "?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); + if ($page < 1) { + url::redirect($str_page_url); + } + + // First item to display. + $offset = ($page - 1) * $page_size; + + // Figure out what the highest page number is. + $max_pages = ceil($count / $page_size); + + // Don't let the visitor go past the last page. + if ($max_pages && $page > $max_pages) { + url::redirect($str_page_url . "/?page=$max_pages"); + } + + // Figure out which items to display on this page and store their details in $children. + $tag_children = $this->_get_records($tag_ids, $page_size, $offset, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, true); + + // Set up the previous and next page buttons. + if ($page > 1) { + $previous_page = $page - 1; + $view->previous_page_link = url::site($str_page_url . "/?page={$previous_page}"); + } + if ($page < $max_pages) { + $next_page = $page + 1; + $view->next_page_link = url::site($str_page_url . "/?page={$next_page}"); + } + + // Set up breadcrumbs. + $tag_album_breadcrumbs = array(); + $counter = 0; + $tag_album_breadcrumbs[] = Breadcrumb::instance($album->title, $album->url())->set_last(); + $parent_item = ORM::factory("item", $album->parent_id); + while ($parent_item->id != 1) { + $tag_album_breadcrumbs[] = Breadcrumb::instance($parent_item->title, $parent_item->url()); + $parent_item = ORM::factory("item", $parent_item->parent_id); + } + $tag_album_breadcrumbs[] = Breadcrumb::instance($parent_item->title, $parent_item->url())->set_first(); + $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"); + $template->set_global( + array("page" => $page, + "max_pages" => $max_pages, + "page_size" => $page_size, + "children" => $tag_children, + "breadcrumbs" => $tag_album_breadcrumbs, + "children_count" => $count)); + $template->page_title = $page_title; + $template->content = new View("dynamic.html"); + $template->content->title = $page_title; + $template->content->description = $page_description; + + $template->set_global("all_siblings", $this->_get_records($tag_ids, $count, 0, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false)); + $parent_album = ORM::factory("item", $album->parent_id); + $template->set_global("parent_url", $parent_album->url()); // Used by Grey Dragon. + print $template; + + // Set breadcrumbs on the photo pages to point back to the calendar day view. + item::set_display_context_callback("tag_albums_Controller::get_display_context", 0, $id); + } } public function show($item_id, $tag_id, $album_id) { - // Display the specified photo or video ($item_id) with breadcrumbs - // that point back to a virtual album ($tag_id / $album_id). + // This function used to be responsible for displaying photos. + // As of Gallery 3.0.3, it is no longer needed, now it just + // redirects to the photo's primary URL to avoid breaking older links. + item::set_display_context_callback("tag_albums_Controller::get_display_context", $tag_id, $album_id); + $item = ORM::factory("item", $item_id); + url::redirect(url::abs_site("{$item->type}s/{$item->id}")); + } + public function make_tag_album_cover($id, $tag_id, $album_id) { + if (!identity::active_user()->admin) { + message::error(t("You do not have sufficient privileges to do this")); + url::redirect("tag_albums/show/" . $id . "/" . $tag_id . "/" . $album_id . "/" . urlencode($item->name)); + } + + $item = ORM::factory("item", $id); + + if (($album_id > 0) && ($tag_id == 0)) { + // If we are dealing with a dynamic album, set it's thumbnail to this pics. + // Based on modules/gallery/helpers/item.php + $album_tags = ORM::factory("tags_album_id") + ->where("id", "=", $album_id) + ->find_all(); + if (count($album_tags) > 0) { + $parent = ORM::factory("item", $album_tags[0]->album_id); + $parent->album_cover_item_id = $item->id; + $parent->thumb_dirty = 1; + graphics::generate($parent); + $parent->save(); + + $grand_parent = $parent->parent(); + if ($grand_parent && access::can("edit", $grand_parent) && + $grand_parent->album_cover_item_id == null) { + item::make_album_cover($parent); + } + } + message::success(t("Made " . $item->title . " this album's cover")); + url::redirect("tag_albums/show/" . $id . "/" . $tag_id . "/" . $album_id . "/" . urlencode($item->name)); + } else { + // If setting a thumbnail for an auto-generated all tags->tag album. + $record = ORM::factory("tags_album_tag_cover")->where("tag_id", "=", $tag_id)->find(); + if (!$record->loaded()) { + $record->tag_id = $tag_id; + } + $record->photo_id = $id; + $record->save(); + message::success(t("Made " . $item->title . " this album's cover")); + url::redirect("tag_albums/show/" . $id . "/" . $tag_id . "/" . $album_id . "/" . urlencode($item->name)); + } + } + + static function get_display_context($item, $tag_id, $album_id) { // Make sure #album_id is valid, clear it out if it isn't. $album_tags = ORM::factory("tags_album_id") ->where("id", "=", $album_id) ->find_all(); if (count($album_tags) == 0) { - $album_id = ""; + $album_id = 0; } // Load the tag and item, make sure the user has access to the item. $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 = ""; @@ -521,21 +608,19 @@ 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, false); + $sibling_count = tag_albums_Controller::_count_records(Array($tag_id), "OR", false); + $position = tag_albums_Controller::_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); + $previous_item_object = tag_albums_Controller::_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]->title, url::site("tag_albums/show/" . $previous_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $previous_item_object[0]->type); + $previous_item = $previous_item_object[0]; } } - $next_item_object = $this->_get_records(Array($tag_id), 1, $position, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false); + $next_item_object = tag_albums_Controller::_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]->title, url::site("tag_albums/show/" . $next_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $next_item_object[0]->type); + $next_item = $next_item_object[0]; } - $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) { @@ -545,98 +630,54 @@ 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, false); + $sibling_count = tag_albums_Controller::_count_records($tag_ids, $album_tags_search_type, false); + $position = tag_albums_Controller::_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); + $previous_item_object = tag_albums_Controller::_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]->title, url::site("tag_albums/show/" . $previous_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $previous_item_object[0]->type); + $previous_item = $previous_item_object[0]; } } - $next_item_object = $this->_get_records($tag_ids, 1, $position, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false); + $next_item_object = tag_albums_Controller::_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]->title, url::site("tag_albums/show/" . $next_item_object[0]->id . "/" . $tag_id . "/" . $album_id), $next_item_object[0]->type); + $next_item = $next_item_object[0]; } - $dynamic_siblings = $this->_get_records($tag_ids, null, null, "items." . $sort_page_field, $sort_page_direction, $album_tags_search_type, false); + } // Set up breadcrumbs $tag_album_breadcrumbs = Array(); - if ($album_id != "") { + if ($album_id > 0) { $counter = 0; - $tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($item->title, ""); + $tag_album_breadcrumbs[] = Breadcrumb::instance($item->title, $item->url())->set_last(); if ($album_tags[0]->tags == "*") { - $tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($display_tag->name, url::site("tag_albums/tag/" . $display_tag->id . "/" . $album_id)); + $tag_album_breadcrumbs[] = Breadcrumb::instance($display_tag->name, url::site("tag_albums/tag/" . $display_tag->id . "/" . $album_id . "/" . urlencode($display_tag->name))); } $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)); + $tag_album_breadcrumbs[] = Breadcrumb::instance($parent_item->title, url::site("tag_albums/album/" . $album_id . "/" . urlencode($parent_item->name))); $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()); + $tag_album_breadcrumbs[] = Breadcrumb::instance($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[] = Breadcrumb::instance($parent_item->title, $parent_item->url())->set_first(); $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(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); + $tag_album_breadcrumbs[] = Breadcrumb::instance(item::root()->title, item::root()->url())->set_first(); + $tag_album_breadcrumbs[] = Breadcrumb::instance(module::get_var("tag_albums", "tag_page_title", "All Tags"), url::site("tag_albums/")); + $tag_album_breadcrumbs[] = Breadcrumb::instance($display_tag->name, url::site("tag_albums/tag/" . $display_tag->id . "/" . urlencode($display_tag->name)) . "?show=" . $item->id); + $tag_album_breadcrumbs[] = Breadcrumb::instance($item->title, $item->url())->set_last(); } - // Increase the items view count. - $item->increment_view_count(); - - // Load the page. - if ($item->is_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("photo.html"); - $template->content->title = $item->title; - $template->set_global("breadcrumbs", $tag_album_breadcrumbs); - print $template; - } elseif ($item->is_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("movie.html"); - $template->content->title = $item->title; - $template->set_global("breadcrumbs", $tag_album_breadcrumbs); - print $template; - } else { - // If it's something we don't know how to deal with, just redirect to its real page. - url::redirect(url::abs_site("{$item->type}s/{$item->id}")); - } + return array("position" => $position, + "previous_item" => $previous_item, + "next_item" => $next_item, + "tag_id" => $tag_id, + "album_id" => $album_id, + "is_tagalbum_page" => true, + "sibling_count" => $sibling_count, + "breadcrumbs" => $tag_album_breadcrumbs); } private function _get_position($item_title, $item_id, $tag_ids, $sort_field, $sort_direction, $search_type, $include_albums) { @@ -736,6 +777,7 @@ class tag_albums_Controller extends Controller { $items_model->select("items.left_ptr"); $items_model->select("items.right_ptr"); $items_model->select("items.relative_path_cache"); + $items_model->select("items.relative_url_cache"); $items_model->select('COUNT("*") AS result_count'); } $items_model->viewable(); @@ -759,41 +801,6 @@ 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 .= "(All) "; - } else { - $str_html .= "(All) "; - } - } - if ($str_filter == "NUM") { - $str_html .= "# "; - } else { - $str_html .= "# "; - } - foreach(range('A','Z') as $letter) { - if ($letter == $str_filter) { - $str_html .= $letter . " "; - } else { - $str_html .= ""; - $str_html .= $letter . " "; - } - } - - // 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. @@ -841,4 +848,43 @@ class tag_albums_Controller extends Controller { return count($items_model->find_all()); } } + + 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) { + $album_tags = ORM::factory("tags_album_id") + ->where("id", "=", $album_id) + ->find_all(); + $album = ORM::factory("item", $album_tags[0]->album_id); + $str_html .= "name)) . "\">(All) "; + } else { + $str_html .= "(All) "; + } + } + if ($str_filter == "NUM") { + $str_html .= "# "; + } else { + $str_html .= "# "; + } + foreach(range('A','Z') as $letter) { + if ($letter == $str_filter) { + $str_html .= $letter . " "; + } else { + $str_html .= ""; + $str_html .= $letter . " "; + } + } + + // Return the HTML. + return $str_html; + } } diff --git a/3.0/modules/tag_albums/helpers/tag_albums_block.php b/3.0/modules/tag_albums/helpers/tag_albums_block.php index 7243722c..cfcdbbe6 100644 --- a/3.0/modules/tag_albums/helpers/tag_albums_block.php +++ b/3.0/modules/tag_albums/helpers/tag_albums_block.php @@ -1,7 +1,7 @@ deactivate)) { site_status::warning( - t("The Tag Albums module requires the Tags module. " . - "Activate the Tags module now", + t("The Tag Albums module requires the Tags module. Activate the Tags module now", array("url" => url::site("admin/modules"))), "tag_albums_needs_tag"); } else { @@ -76,7 +75,7 @@ class tag_albums_event_Core { $tags_album_group = $form->edit_item->group("tags_album_group"); $tags_album_group->dropdown("tags_album_type") ->options( - array("OR" => t("Display items that contain ANY of the following tags:"), + array("OR" => t("Display items that contain ANY of the following tags:"), "AND" => t("Display items that contain ALL of the following tags:"))) ->selected($tag_album_type); $tags_album_group->input("tag_albums") @@ -107,4 +106,19 @@ class tag_albums_event_Core { db::build()->delete("tags_album_ids")->where("album_id", "=", $item->id)->execute(); } } + + static function site_menu($menu, $theme) { + if ($item = $theme->item()) { + if ($item->is_photo()) { + if ((identity::active_user()->admin) && (isset($theme->is_tagalbum_page))) { + $menu->get("options_menu") + ->append(Menu::factory("link") + ->id("g-tag-albums-set-cover") + ->label(t("Choose as the tag album cover")) + ->css_id("g-tag-albums-set-cover") + ->url(url::site("tag_albums/make_tag_album_cover/" . $item->id . "/" . $theme->tag_id . "/" . $theme->album_id))); + } + } + } + } } diff --git a/3.0/modules/tag_albums/helpers/tag_albums_installer.php b/3.0/modules/tag_albums/helpers/tag_albums_installer.php index ee3df5e2..d4a916e9 100644 --- a/3.0/modules/tag_albums/helpers/tag_albums_installer.php +++ b/3.0/modules/tag_albums/helpers/tag_albums_installer.php @@ -1,7 +1,7 @@ query("CREATE TABLE IF NOT EXISTS {tags_album_tag_covers} ( + `id` int(9) NOT NULL auto_increment, + `tag_id` int(9) NOT NULL, + `photo_id` int(9) NOT NULL, + PRIMARY KEY (`id`), + KEY(`tag_id`, `id`)) + DEFAULT CHARSET=utf8;"); + // Set up some default values. module::set_var("tag_albums", "tag_sort_by", "name"); module::set_var("tag_albums", "tag_sort_direction", "ASC"); @@ -36,19 +44,39 @@ class tag_albums_installer { 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"); + module::set_var("tag_albums", "tag_index_filter_top", "0"); + module::set_var("tag_albums", "tag_index_filter_bottom", "0"); // Set the module's version number. - module::set_version("tag_albums", 2); + module::set_version("tag_albums", 4); } static function upgrade($version) { + $db = Database::instance(); 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); } + + if ($version == 2) { + $db->query("CREATE TABLE IF NOT EXISTS {tags_album_tag_covers} ( + `id` int(9) NOT NULL auto_increment, + `tag_id` int(9) NOT NULL, + `photo_id` int(9) NOT NULL, + PRIMARY KEY (`id`), + KEY(`tag_id`, `id`)) + DEFAULT CHARSET=utf8;"); + module::set_version("tag_albums", 3); + } + + if ($version == 3) { + module::set_var("tag_albums", "tag_index_filter_top", module::get_var("tag_albums", "tag_index_filter", "0")); + module::set_var("tag_albums", "tag_index_filter_bottom", module::get_var("tag_albums", "tag_index_filter", "0")); + module::clear_var("tag_albums", "tag_index_filter"); + module::set_version("tag_albums", 4); + } } static function deactivate() { diff --git a/3.0/modules/tag_albums/helpers/tag_albums_theme.php b/3.0/modules/tag_albums/helpers/tag_albums_theme.php index 3eae0c61..32ef0309 100644 --- a/3.0/modules/tag_albums/helpers/tag_albums_theme.php +++ b/3.0/modules/tag_albums/helpers/tag_albums_theme.php @@ -1,7 +1,7 @@ where("album_id", "=", $theme->item->id) ->find_all(); if (count($album_tags) > 0) { - url::redirect(url::abs_site("tag_albums/album/" . $album_tags[0]->id)); + url::redirect(url::abs_site("tag_albums/album/" . $album_tags[0]->id . "/" . urlencode($theme->item->name))); } } return; } + + static function dynamic_top($theme) { + // If this page is the "all tags" dynamic page, display filter link text. + if (isset($theme->content->filter_text) && module::get_var("tag_albums", "tag_index_filter_top", "0")) { + $view = new View("tag_albums_filter.html"); + $view->filter_text = $theme->content->filter_text; + return $view; + } + } + + static function dynamic_bottom($theme) { + // If this page is the "all tags" dynamic page, display filter link text. + if (isset($theme->content->filter_text) && module::get_var("tag_albums", "tag_index_filter_bottom", "0")) { + $view = new View("tag_albums_filter.html"); + $view->filter_text = $theme->content->filter_text; + return $view; + } + } } diff --git a/3.0/modules/tag_albums/libraries/Tag_Albums_Breadcrumb.php b/3.0/modules/tag_albums/libraries/Tag_Albums_Breadcrumb.php deleted file mode 100644 index ba576e49..00000000 --- a/3.0/modules/tag_albums/libraries/Tag_Albums_Breadcrumb.php +++ /dev/null @@ -1,31 +0,0 @@ -title = $new_title; - $this->url = $new_url; - } -} diff --git a/3.1/modules/atom/libraries/Atom_Link.php b/3.0/modules/tag_albums/libraries/Tag_Albums_Children.php similarity index 62% rename from 3.1/modules/atom/libraries/Atom_Link.php rename to 3.0/modules/tag_albums/libraries/Tag_Albums_Children.php index 723675c1..37ecc081 100644 --- a/3.1/modules/atom/libraries/Atom_Link.php +++ b/3.0/modules/tag_albums/libraries/Tag_Albums_Children.php @@ -1,7 +1,7 @@ element->setAttribute("rel", $rel); - return $this; +class Tag_Albums_Children_Core implements Iterator { + public $array = Array(); + private $position = 0; + + public function __construct($children) { + $this->position = 0; + $this->array = $children; } - public function type($type) { - $this->element->setAttribute("type", $type); - return $this; + function rewind() { + $this->position = 0; } - public function title($title) { - $this->element->setAttribute("title", $title); - return $this; + function current() { + return $this->array[$this->position]; } - public function href($href) { - $this->element->setAttribute("href", $href); - return $this; + function key() { + return $this->position; + } + + function next() { + ++$this->position; + } + + function valid() { + return isset($this->array[$this->position]); } } diff --git a/3.0/modules/tag_albums/libraries/Tag_Albums_Item.php b/3.0/modules/tag_albums/libraries/Tag_Albums_Item.php index a90c5239..0fd766d4 100644 --- a/3.0/modules/tag_albums/libraries/Tag_Albums_Item.php +++ b/3.0/modules/tag_albums/libraries/Tag_Albums_Item.php @@ -1,7 +1,7 @@ item_id > 0) { + $item = ORM::factory("item", $this->item_id); + if (access::can("view_full", $item)) { + return $item->file_url(); + } else { + return $item->resize_url(); + } + } else { + return ""; + } + } + public function thumb_img($extra_attrs=array(), $max=null, $center_vertically=false) { list ($height, $width) = $this->scale_dimensions($max); if ($center_vertically && $max) { @@ -105,10 +119,11 @@ class Tag_Albums_Item_Core { $this->thumb_height = $new_height; } - public function __construct($new_title, $new_url, $new_type) { + public function __construct($new_title, $new_url, $new_type, $new_id) { $this->title = $new_title; $this->url = $new_url; $this->item_type = $new_type; $this->type = $new_type; + $this->item_id = $new_id; } } diff --git a/3.0/modules/tag_albums/models/tag.php b/3.0/modules/tag_albums/models/tag.php index d15a36e0..e02a72c5 100644 --- a/3.0/modules/tag_albums/models/tag.php +++ b/3.0/modules/tag_albums/models/tag.php @@ -1,7 +1,7 @@ viewable() ->join("items_tags", "items.id", "items_tags.item_id") - ->where("items_tags.tag_id", "=", $this->id); - if ($type) { - $model->where("items.type", "=", $type); - } - return $model->find_all($limit, $offset); + ->where("items_tags.tag_id", "=", $this->id) + ->merge_where($where) + ->order_by("items.id") + ->find_all($limit, $offset); } /** * Return the count of all viewable items associated with this tag. - * @param string $type the type of item (album, photo) + * @param string $where an array of arrays, each compatible with ORM::where() * @return integer */ - public function items_count($type=null) { - $model = ORM::factory("item") + public function items_count($where=array()) { + if (is_scalar($where)) { + // backwards compatibility + $where = array(array("items.type", "=", $where)); + } + return $model = ORM::factory("item") ->viewable() ->join("items_tags", "items.id", "items_tags.item_id") - ->where("items_tags.tag_id", "=", $this->id); - - if ($type) { - $model->where("items.type", "=", $type); - } - return $model->count_all(); + ->where("items_tags.tag_id", "=", $this->id) + ->merge_where($where) + ->count_all(); } /** @@ -69,13 +73,23 @@ class Tag_Model_Core extends ORM { * to this tag. */ public function save() { - $related_item_ids = array(); - foreach (db::build() - ->select("item_id") - ->from("items_tags") - ->where("tag_id", "=", $this->id) - ->execute() as $row) { - $related_item_ids[$row->item_id] = 1; + // Check to see if another tag exists with the same name + $duplicate_tag = ORM::factory("tag") + ->where("name", "=", $this->name) + ->where("id", "!=", $this->id) + ->find(); + if ($duplicate_tag->loaded()) { + // If so, tag its items with this tag so as to merge it + $duplicate_tag_items = ORM::factory("item") + ->join("items_tags", "items.id", "items_tags.item_id") + ->where("items_tags.tag_id", "=", $duplicate_tag->id) + ->find_all(); + foreach ($duplicate_tag_items as $item) { + $this->add($item); + } + + // ... and remove the duplicate tag + $duplicate_tag->delete(); } if (isset($this->object_relations["items"])) { @@ -132,10 +146,15 @@ class Tag_Model_Core extends ORM { * @param string $query the query string (eg "page=3") */ public function url($query=null) { - $url = url::site("/tag_albums/tag/{$this->id}/" . urlencode($this->name)); + // rWatcher Edit: Modify URL function to point users to tag_albums instead of tag. + $album_id = Input::instance()->get("album"); + if (!($album_id)) { + $album_id = 0; + } + $url = url::site("/tag_albums/tag/{$this->id}/{$album_id}/" . urlencode($this->name)); if ($query) { $url .= "?$query"; } return $url; } -} +} \ No newline at end of file diff --git a/3.0/modules/tag_albums/models/tags_album_id.php b/3.0/modules/tag_albums/models/tags_album_id.php index a9b16b4f..46ed3bc3 100644 --- a/3.0/modules/tag_albums/models/tags_album_id.php +++ b/3.0/modules/tag_albums/models/tags_album_id.php @@ -1,7 +1,7 @@ - -html_attributes() ?> xml:lang="en" lang="en"> - - - start_combining("script,css") ?> - - <? 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 ?> - - " - type="image/x-icon" /> - - page_type == "collection"): ?> - - - - - - - - script("json2-min.js") ?> - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("jquery.localscroll.js") ?> - - - page_subtype == "photo"): ?> - script("jquery.scrollTo.js") ?> - script("gallery.show_full_size.js") ?> - page_subtype == "movie"): ?> - script("flowplayer.js") ?> - - - head() ?> - - - script("ui.init.js") ?> - css("yui/reset-fonts-grids.css") ?> - css("superfish/css/superfish.css") ?> - css("themeroller/ui.base.css") ?> - css("screen.css") ?> - - - - get_combined("script") ?> - - - get_combined("css") ?> - - - body_attributes() ?>> - page_top() ?> -
    - site_status() ?> -
    -
    - - - - - - user_menu() ?> - header_top() ?> - - - - - - header_bottom() ?> -
    - - - - -
      - - - > - - url) : ?> - title) ?> - - title) ?> - - - - -
    - - - - - -
    -
    -
    -
    -
    - messages() ?> - -
    -
    -
    -
    - page_subtype != "login"): ?> - - -
    -
    - -
    - page_bottom() ?> - - \ No newline at end of file diff --git a/3.0/modules/tag_albums/views/tag_albums_album.html.php b/3.0/modules/tag_albums/views/tag_albums_album.html.php deleted file mode 100644 index 620d3c81..00000000 --- a/3.0/modules/tag_albums/views/tag_albums_album.html.php +++ /dev/null @@ -1,50 +0,0 @@ - -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). -?> -
    - dynamic_top() ?> -

    -
    -
    - - -
    -
    -
    -
    - - - -dynamic_bottom() ?> - -paginator() ?> diff --git a/3.0/modules/tag_albums/views/tag_albums_filter.html.php b/3.0/modules/tag_albums/views/tag_albums_filter.html.php new file mode 100644 index 00000000..3f017c61 --- /dev/null +++ b/3.0/modules/tag_albums/views/tag_albums_filter.html.php @@ -0,0 +1,4 @@ + +
    +
    +
    diff --git a/3.0/modules/tag_cloud/controllers/admin_tag_cloud.php b/3.0/modules/tag_cloud/controllers/admin_tag_cloud.php index 2d42e703..8137719a 100644 --- a/3.0/modules/tag_cloud/controllers/admin_tag_cloud.php +++ b/3.0/modules/tag_cloud/controllers/admin_tag_cloud.php @@ -1,7 +1,7 @@ _get_admin_form(); + $this->_print_screen($form); + } + + public function edit() { + access::verify_csrf(); + $cfg = $this->_get_config(); + $form = $this->_get_admin_form(); + if ($form->validate()) { + if ($form->options_general->load_defaults->value) { + // reset all to defaults, redirect with message + module::install("tag_cloud_html5"); + message::success(t("Tag cloud options reset successfully")); + url::redirect("admin/tag_cloud_html5"); + } else { + $valid = true; + // run checks on various inputs + $options_general = $form->options_general; + if ($options_general->height_sidebar->value < 0) { + $form->options_general->height_sidebar->add_error("not_valid", 1); + $valid = false; + } + foreach ($cfg['groups'] as $groupname => $grouptext) { + ${"options".$groupname} = $form->{"options".$groupname}; + if ($options_general->{"maxtags".$groupname}->value < 0) { + $form->options_general->{"maxtags".$groupname}->add_error("not_valid", 1); + $valid = false; + } + if (${"options".$groupname}->{"maxSpeed".$groupname}->value < 0) { + $form->{"options".$groupname}->{"maxSpeed".$groupname}->add_error("not_valid", 1); + $valid = false; + } + if ((${"options".$groupname}->{"initialX".$groupname}->value < -1) || (${"options".$groupname}->{"initialX".$groupname}->value > 1)) { + $form->{"options".$groupname}->{"initialX".$groupname}->add_error("not_valid", 1); + $valid = false; + } + if ((${"options".$groupname}->{"initialY".$groupname}->value < -1) || (${"options".$groupname}->{"initialY".$groupname}->value > 1)) { + $form->{"options".$groupname}->{"initialY".$groupname}->add_error("not_valid", 1); + $valid = false; + } + if ((${"options".$groupname}->{"deadZone".$groupname}->value < 0) || (${"options".$groupname}->{"deadZone".$groupname}->value > 1)) { + $form->{"options".$groupname}->{"deadZone".$groupname}->add_error("not_valid", 1); + $valid = false; + } + if (${"options".$groupname}->{"zoom".$groupname}->value < 0) { + $form->{"options".$groupname}->{"zoom".$groupname}->add_error("not_valid", 1); + $valid = false; + } + if ((${"options".$groupname}->{"depth".$groupname}->value < 0) || (${"options".$groupname}->{"depth".$groupname}->value > 1)) { + $form->{"options".$groupname}->{"depth".$groupname}->add_error("not_valid", 1); + $valid = false; + } + if (${"options".$groupname}->{"outlineOffset".$groupname}->value < 0) { + $form->{"options".$groupname}->{"outlineOffset".$groupname}->add_error("not_valid", 1); + $valid = false; + } + if (preg_match("/^#[0-9A-Fa-f]{6}$/", ${"options".$groupname}->{"outlineColour".$groupname}->value) == 0) { + $form->{"options".$groupname}->{"outlineColour".$groupname}->add_error("not_valid", 1); + $valid = false; + } + if ((preg_match("/^#[0-9A-Fa-f]{6}$/", ${"options".$groupname}->{"textColour".$groupname}->value) == 0) && (strcmp(${"options".$groupname}->{"textColour".$groupname}->value, "") != 0) ) { + $form->{"options".$groupname}->{"textColour".$groupname}->add_error("not_valid", 1); + $valid = false; + } + if (${"options".$groupname}->{"textHeight".$groupname}->value < 0) { + $form->{"options".$groupname}->{"textHeight".$groupname}->add_error("not_valid", 1); + $valid = false; + } + } + if ($valid) { + // all inputs passed tests above; save them + module::set_var("tag_cloud_html5", "show_wholecloud_link", ($options_general->show_wholecloud_link->value == 1)); + module::set_var("tag_cloud_html5", "show_add_tag_form", ($options_general->show_add_tag_form->value == 1)); + module::set_var("tag_cloud_html5", "height_sidebar", $options_general->height_sidebar->value); + module::set_var("tag_cloud_html5", "show_wholecloud_list", ($options_general->show_wholecloud_list->value == 1)); + foreach ($cfg['groups'] as $groupname => $grouptext) { + module::set_var("tag_cloud_html5", "maxtags".$groupname, $options_general->{"maxtags".$groupname}->value); + + $optionsarray = array(); + $optionsarray['maxSpeed'] = ${"options".$groupname}->{"maxSpeed".$groupname}->value; + $optionsarray['deadZone'] = ${"options".$groupname}->{"deadZone".$groupname}->value; + $optionsarray['initial'] = array(${"options".$groupname}->{"initialX".$groupname}->value, ${"options".$groupname}->{"initialY".$groupname}->value); + $optionsarray['initialDecel'] = (${"options".$groupname}->{"initialDecel".$groupname}->value == 1); + $optionsarray['zoom'] = ${"options".$groupname}->{"zoom".$groupname}->value; + $optionsarray['depth'] = ${"options".$groupname}->{"depth".$groupname}->value; + $optionsarray['outlineMethod'] = ${"options".$groupname}->{"outlineMethod".$groupname}->value; + $optionsarray['outlineOffset'] = ${"options".$groupname}->{"outlineOffset".$groupname}->value; + $optionsarray['outlineColour'] = ${"options".$groupname}->{"outlineColour".$groupname}->value; + $optionsarray['textColour'] = ${"options".$groupname}->{"textColour".$groupname}->value; + $optionsarray['textFont'] = ${"options".$groupname}->{"textFont".$groupname}->value; + $optionsarray['textHeight'] = ${"options".$groupname}->{"textHeight".$groupname}->value; + $optionsarray['frontSelect'] = (${"options".$groupname}->{"frontSelect".$groupname}->value == 1); + $optionsarray['wheelZoom'] = false; // note that this is locked - otherwise scrolling through the page screws everything up + module::set_var("tag_cloud_html5", "options".$groupname, json_encode($optionsarray)); + } + // all done; redirect with message + message::success(t("Tag cloud options updated successfully")); + url::redirect("admin/tag_cloud_html5"); + } + } + } + // print screen from existing form - you wind up here if something wasn't validated + $this->_print_screen($form); + } + + private function _get_config() { + // these define the two variable name groups, along with their labels which are always shown with t() for i18n. + $cfg['groups'] = array("_sidebar"=>"Sidebar", "_wholecloud"=>"Whole cloud"); + // this defines the separator that's used between the group name and the attribute, and is *not* put through t(). + $cfg['sep'] = ": "; + return $cfg; + } + + private function _print_screen($form) { + $view = new Admin_View("admin.html"); + $view->content = new View("admin_tag_cloud_html5.html"); + $view->content->form = $form; + print $view; + } + + private function _get_admin_form() { + $cfg = $this->_get_config(); + $sep = $cfg['sep']; + + // Make the form. This form has three groups: group_general, group_sidebar, and group_wholecloud. + $form = new Forge("admin/tag_cloud_html5/edit", "", "post", array("id" => "g-tag-cloud-html5-admin-form")); + + // group_general + $group_general = $form->group("options_general")->label(t("Tag cloud options").$sep.t("General")); + $group_general->checkbox("load_defaults") + ->label(t("Reset all to default values")) + ->checked(false); + $group_general->checkbox("show_wholecloud_link") + ->label(t("Show 'View whole cloud' link in sidebar")) + ->checked(module::get_var("tag_cloud_html5", "show_wholecloud_link", null)); + $group_general->checkbox("show_add_tag_form") + ->label(t("Show 'Add tag to album' form in sidebar (when permitted and applicable)")) + ->checked(module::get_var("tag_cloud_html5", "show_add_tag_form", null)); + $group_general->input("height_sidebar") + ->label(t("Height of sidebar (as fraction of width)")) + ->value(round(module::get_var("tag_cloud_html5", "height_sidebar", null),3)) // round or else it gets 6 decimal places... + ->error_message("not_valid", t("Height of sidebar must be a 1-5 digit number")) + ->rules("required|valid_numeric|length[1,5]"); + $group_general->checkbox("show_wholecloud_list") + ->label(t("Show tag list under cloud on 'View whole cloud' page")) + ->checked(module::get_var("tag_cloud_html5", "show_wholecloud_list", null)); + + foreach ($cfg['groups'] as $groupname => $grouptext) { + // maxtags - note that this is displayed under group_general! + $maxtags = module::get_var("tag_cloud_html5", "maxtags".$groupname, null); + $group_general->input("maxtags".$groupname) + ->label(t($grouptext).$sep.t("max tags shown")) + ->value($maxtags) + ->error_message("not_valid", t("Max tags must be a 1-4 digit number")) + ->rules("required|valid_numeric|length[1,4]"); + // group_sidebar and group_wholecloud + $options = json_decode(module::get_var("tag_cloud_html5", "options".$groupname, null),true); + ${"group".$groupname} = $form->group("options".$groupname)->label(t("Tag cloud options").$sep.t($grouptext)); + ${"group".$groupname}->input("maxSpeed".$groupname) + ->label(t($grouptext).$sep.t("max speed (typically 0.01-0.20)")) + ->value($options['maxSpeed']) + ->error_message("not_valid", t("Max speed must be a 1-5 digit number")) + ->rules("required|valid_numeric|length[1,5]"); + ${"group".$groupname}->input("initialX".$groupname) + ->label(t($grouptext).$sep.t("initial horizontal speed (between +/-1.0, as fraction of max speed)")) + ->value($options['initial'][0]) + ->error_message("not_valid", t("Initial horizontal speed must be a 1-4 digit number")) + ->rules("required|valid_numeric|length[1,4]"); + ${"group".$groupname}->input("initialY".$groupname) + ->label(t($grouptext).$sep.t("initial vertical speed (between +/-1.0, as fraction of max speed)")) + ->value($options['initial'][1]) + ->error_message("not_valid", t("Initial vertical speed must be a 1-4 digit number")) + ->rules("required|valid_numeric|length[1,4]"); + ${"group".$groupname}->checkbox("initialDecel".$groupname) + ->label(t($grouptext).$sep.t("initial deceleration (if false, the initial speed is held until a mouseover event)")) + ->checked($options['initialDecel']); + ${"group".$groupname}->input("deadZone".$groupname) + ->label(t($grouptext).$sep.t("dead zone (0.0-1.0, where 0.0 is no dead zone and 1.0 is no active zone)")) + ->value($options['deadZone']) + ->error_message("not_valid", t("Dead zone must be a 1-4 digit number")) + ->rules("required|valid_numeric|length[1,4]"); + ${"group".$groupname}->input("zoom".$groupname) + ->label(t($grouptext).$sep.t("zoom (<1.0 is zoom out, >1.0 is zoom in)")) + ->value($options['zoom']) + ->error_message("not_valid", t("Zoom must be a 1-4 digit number")) + ->rules("required|valid_numeric|length[1,4]"); + ${"group".$groupname}->input("depth".$groupname) + ->label(t($grouptext).$sep.t("depth (0.0-1.0)")) + ->value($options['depth']) + ->error_message("not_valid", t("Depth must be a 1-4 digit number")) + ->rules("required|valid_numeric|length[1,4]"); + ${"group".$groupname}->dropdown("outlineMethod".$groupname) + ->label(t($grouptext).$sep.t("outline method (mouseover event)")) + ->options(array("colour"=>t("change text color"),"outline"=>t("add outline around text"),"block"=>t("add block behind text"))) + ->selected($options['outlineMethod']); + ${"group".$groupname}->input("outlineOffset".$groupname) + ->label(t($grouptext).$sep.t("outline offset (mouseover region size around text, in pixels)")) + ->value($options['outlineOffset']) + ->error_message("not_valid", t("Outline offset must be a 1-2 digit number")) + ->rules("required|valid_numeric|length[1,2]"); + ${"group".$groupname}->input("outlineColour".$groupname) + ->label(t($grouptext).$sep.t("outline color (mouseover color, as #hhhhhh)")) + ->value($options['outlineColour']) + ->error_message("not_valid", t("Outline color must be specified as #hhhhhh")) + ->rules("required|length[7]"); + ${"group".$groupname}->input("textColour".$groupname) + ->label(t($grouptext).$sep.t("text color (as #hhhhhh, or empty to use theme color)")) + ->value($options['textColour']) + ->error_message("not_valid", t("Text color must be specified as empty or #hhhhhh")) + ->rules("length[0,7]"); + ${"group".$groupname}->input("textFont".$groupname) + ->label(t($grouptext).$sep.t("text font family (empty to use theme font)")) + ->value($options['textFont']) + ->error_message("not_valid", t("Text font must be empty or a 0-40 character string")) + ->rules("length[0,40]"); + ${"group".$groupname}->input("textHeight".$groupname) + ->label(t($grouptext).$sep.t("text height (in pixels)")) + ->value($options['textHeight']) + ->error_message("not_valid", t("Text height must be a 1-2 digit number")) + ->rules("required|valid_numeric|length[1,2]"); + ${"group".$groupname}->checkbox("frontSelect".$groupname) + ->label(t($grouptext).$sep.t("only allow tags in front to be selected")) + ->checked($options['frontSelect']); + + } + + $form->submit("")->value(t("Save")); + + return $form; + } + +} diff --git a/3.0/modules/tag_cloud_html5/controllers/tag_cloud.php b/3.0/modules/tag_cloud_html5/controllers/tag_cloud.php new file mode 100644 index 00000000..ce9e0147 --- /dev/null +++ b/3.0/modules/tag_cloud_html5/controllers/tag_cloud.php @@ -0,0 +1,44 @@ +content = new View("tag_cloud_html5_page.html"); + $template->content->title = t("Tag cloud"); + $template->content->cloud = tag::cloud($maxtags); + $template->content->options = $options; + + // Display the page. + print $template; + } +} diff --git a/3.0/modules/tag_cloud_html5/css/admin_tag_cloud_html5.css b/3.0/modules/tag_cloud_html5/css/admin_tag_cloud_html5.css new file mode 100644 index 00000000..28afb51f --- /dev/null +++ b/3.0/modules/tag_cloud_html5/css/admin_tag_cloud_html5.css @@ -0,0 +1,30 @@ +#g-content fieldset li { + display: block; + clear: both; + height: 24px; +} +#g-content fieldset input { + display: inline; + float: left; + height: 18px; + margin-right: 0.8em; + width: 250px; +} +#g-content fieldset select { + display: inline; + float: left; + height: 24px; + margin-right: 0.8em; + width: 256px; +} +#g-content fieldset label { + display: inline; + line-height: 24px; +} +#g-content fieldset label input.checkbox { + float: left; + height: 24px; + margin-right: 0.8em; + width: 20px; + margin-left: 236px; +} \ No newline at end of file diff --git a/3.0/modules/tag_cloud_html5/css/tag_cloud_html5.css b/3.0/modules/tag_cloud_html5/css/tag_cloud_html5.css new file mode 100644 index 00000000..bf20ce8c --- /dev/null +++ b/3.0/modules/tag_cloud_html5/css/tag_cloud_html5.css @@ -0,0 +1,106 @@ +/* Tag cloud - sidebar ~~~~~~~~~~~~~~~~~~~~~~~ */ + +/* comment out this first block to make the inline tags appear if the cloud doesn't load */ +#g-tag-cloud-html5-tags { + display: none; +} + +#g-tag-cloud-html5-tags ul { + text-align: justify; +} + +#g-tag-cloud-html5-tags ul li { + display: inline; + text-align: justify; +} + +#g-tag-cloud-html5-tags ul li a { + text-decoration: none; +} + +#g-tag-cloud-html5-tags ul li span { + display: none; +} + +#g-tag-cloud-html5-page ul li a:hover { + text-decoration: underline; +} + +/* Tag cloud - whole cloud page ~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-tag-cloud-html5-page-canvas { + display: block; + margin: 0 auto; +} + +#g-tag-cloud-html5-page-tags ul { + font-size: 1.2em; + text-align: justify; +} + +#g-tag-cloud-html5-page-tags ul li { + display: inline; + line-height: 1.5em; + text-align: justify; +} + +#g-tag-cloud-html5-page-tags ul li a { + text-decoration: none; +} + +#g-tag-cloud-html5-page-tags ul li span { + display: none; +} + +#g-tag-cloud-html5-page-tags ul li.size0 a { + color: #9cf; + font-size: 70%; + font-weight: 100; +} + +#g-tag-cloud-html5-page-tags ul li.size1 a { + color: #9cf; + font-size: 80%; + font-weight: 100; +} + +#g-tag-cloud-html5-page-tags ul li.size2 a { + color: #69f; + font-size: 90%; + font-weight: 300; +} + +#g-tag-cloud-html5-page-tags ul li.size3 a { + color: #69c; + font-size: 100%; + font-weight: 500; +} + +#g-tag-cloud-html5-page-tags ul li.size4 a { + color: #369; + font-size: 110%; + font-weight: 700; +} + +#g-tag-cloud-html5-page-tags ul li.size5 a { + color: #0e2b52; + font-size: 120%; + font-weight: 900; +} + +#g-tag-cloud-html5-page-tags ul li.size6 a { + color: #0e2b52; + font-size: 130%; + font-weight: 900; +} + +#g-tag-cloud-html5-page-tags ul li.size7 a { + color: #0e2b52; + font-size: 140%; + font-weight: 900; +} + +#g-tag-cloud-html5-page-tags ul li a:hover { + color: #f30; + text-decoration: underline; +} diff --git a/3.1/modules/tag_cloud/helpers/tag_cloud_block.php b/3.0/modules/tag_cloud_html5/helpers/tag_cloud_html5_block.php similarity index 54% rename from 3.1/modules/tag_cloud/helpers/tag_cloud_block.php rename to 3.0/modules/tag_cloud_html5/helpers/tag_cloud_html5_block.php index f8f2858b..e1df9264 100644 --- a/3.1/modules/tag_cloud/helpers/tag_cloud_block.php +++ b/3.0/modules/tag_cloud_html5/helpers/tag_cloud_html5_block.php @@ -1,7 +1,7 @@ t("Tag Cloud")); + "tag_cloud_html5_site" => (t("Tag cloud")." HTML5")); } static function get($block_id, $theme) { $block = ""; switch ($block_id) { - case "tag_cloud_site": - $options = array(); - foreach (array("tagcolor", "background_color", "mouseover", "transparent", "speed", "distribution") - as $option) { - $value = module::get_var("tag_cloud", $option, null); - if (!empty($value)) { - switch ($option) { - case "tagcolor": - $options["tcolor"] = $value; - break; - case "mouseover": - $options["hicolor"] = $value; - break; - case "background_color": - $options["bgColor"] = $value; - break; - case "transparent": - $options["wmode"] = "transparent"; - break; - case "speed": - $options["tspeed"] = $value; - break; - case "distribution": - $options["distr"] = "true"; - break; - } - } - } + case "tag_cloud_html5_site": + // load settings + $options = module::get_var("tag_cloud_html5", "options_sidebar", null); + $maxtags = module::get_var("tag_cloud_html5", "maxtags_sidebar", null); + $showlink = module::get_var("tag_cloud_html5", "show_wholecloud_link", null); + $showaddtag = module::get_var("tag_cloud_html5", "show_add_tag_form", null); + $height = module::get_var("tag_cloud_html5", "height_sidebar", null); + + // make the block $block = new Block(); $block->css_id = "g-tag"; - $block->title = t("Tag Cloud"); - $block->content = new View("tag_cloud_block.html"); - $block->content->cloud = tag::cloud(30); + $block->title = t("Tag cloud"); + $block->content = new View("tag_cloud_html5_block.html"); + $block->content->cloud = tag::cloud($maxtags); $block->content->options = $options; + $block->content->height = $height; + + // add the 'View whole cloud' link if needed + if ($showlink) { + $block->content->wholecloud_link = "".t("View whole cloud").""; + } else { + $block->content->wholecloud_link = ""; + } - if ($theme->item() && $theme->page_subtype() != "tag" && access::can("edit", $theme->item())) { + // add the 'Add tag' form if needed + if ($theme->item() && $theme->page_subtype() != "tag" && access::can("edit", $theme->item()) && $showaddtag) { $controller = new Tags_Controller(); $block->content->form = tag::get_add_form($theme->item()); } else { $block->content->form = ""; } + break; } return $block; diff --git a/3.1/modules/embedlinks/helpers/embedlinks_event.php b/3.0/modules/tag_cloud_html5/helpers/tag_cloud_html5_event.php similarity index 81% rename from 3.1/modules/embedlinks/helpers/embedlinks_event.php rename to 3.0/modules/tag_cloud_html5/helpers/tag_cloud_html5_event.php index 69699a09..4e7fc3ca 100644 --- a/3.1/modules/embedlinks/helpers/embedlinks_event.php +++ b/3.0/modules/tag_cloud_html5/helpers/tag_cloud_html5_event.php @@ -1,7 +1,7 @@ get("settings_menu") ->append(Menu::factory("link") - ->id("embedlinks") - ->label(t("EmbedLinks")) - ->url(url::site("admin/embedlinks"))); + ->id("tag_cloud_html5") + ->label(t("Tag cloud")." HTML5") + ->url(url::site("admin/tag_cloud_html5"))); } } diff --git a/3.0/modules/tag_cloud_html5/helpers/tag_cloud_html5_installer.php b/3.0/modules/tag_cloud_html5/helpers/tag_cloud_html5_installer.php new file mode 100644 index 00000000..422a6f2c --- /dev/null +++ b/3.0/modules/tag_cloud_html5/helpers/tag_cloud_html5_installer.php @@ -0,0 +1,78 @@ + 0.05, + "deadZone" => 0.25, + "initial" => array(0.8,-0.3), + "initialDecel" => true, + "zoom" => 1.25, + "depth" => 0.5, + "outlineMethod" => "colour", + "outlineOffset" => 8, + "outlineColour" => "#eeeeee", + "textColour" => "", + "textFont" => "", + "textHeight" => 12, + "frontSelect" => true, + "wheelZoom" => false + ))); + module::set_var("tag_cloud_html5", "options_wholecloud", json_encode(array( + "maxSpeed" => 0.05, + "deadZone" => 0.25, + "initial" => array(0.8,-0.3), + "initialDecel" => true, + "zoom" => 1.25, + "depth" => 0.5, + "outlineMethod" => "colour", + "outlineOffset" => 8, + "outlineColour" => "#eeeeee", + "textColour" => "", + "textFont" => "", + "textHeight" => 13, + "frontSelect" => true, + "wheelZoom" => false + ))); + module::set_version("tag_cloud_html5", 4); + } + + static function upgrade() { + if (is_null(module::get_var("tag_cloud_html5", "options_sidebar")) || + is_null(module::get_var("tag_cloud_html5", "options_wholecloud")) || + (module::get_version("tag_cloud_html5") < 4) ) { + module::install("tag_cloud_html5"); + } + } + + static function uninstall() { + module::clear_all_vars("tag_cloud_html5"); + } + +} diff --git a/3.1/modules/twitter/helpers/twitter_theme.php b/3.0/modules/tag_cloud_html5/helpers/tag_cloud_html5_theme.php similarity index 87% rename from 3.1/modules/twitter/helpers/twitter_theme.php rename to 3.0/modules/tag_cloud_html5/helpers/tag_cloud_html5_theme.php index 2862966d..2bcb516a 100644 --- a/3.1/modules/twitter/helpers/twitter_theme.php +++ b/3.0/modules/tag_cloud_html5/helpers/tag_cloud_html5_theme.php @@ -17,9 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class twitter_theme_Core { +class tag_cloud_html5_theme_Core { static function head($theme) { - $theme->script("twitter.js"); - $theme->css("twitter.css"); + $theme->script("jquery.tagcanvas.mod.min.js"); + $theme->css("tag_cloud_html5.css"); } -} +} \ No newline at end of file diff --git a/3.0/modules/tag_cloud_html5/js/excanvas.compiled.js b/3.0/modules/tag_cloud_html5/js/excanvas.compiled.js new file mode 100644 index 00000000..a34ca1da --- /dev/null +++ b/3.0/modules/tag_cloud_html5/js/excanvas.compiled.js @@ -0,0 +1,35 @@ +// Copyright 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +document.createElement("canvas").getContext||(function(){var s=Math,j=s.round,F=s.sin,G=s.cos,V=s.abs,W=s.sqrt,k=10,v=k/2;function X(){return this.context_||(this.context_=new H(this))}var L=Array.prototype.slice;function Y(b,a){var c=L.call(arguments,2);return function(){return b.apply(a,c.concat(L.call(arguments)))}}var M={init:function(b){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var a=b||document;a.createElement("canvas");a.attachEvent("onreadystatechange",Y(this.init_,this,a))}},init_:function(b){b.namespaces.g_vml_|| +b.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");b.namespaces.g_o_||b.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML");if(!b.styleSheets.ex_canvas_){var a=b.createStyleSheet();a.owningElement.id="ex_canvas_";a.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}"}var c=b.getElementsByTagName("canvas"),d=0;for(;d','","");this.element_.insertAdjacentHTML("BeforeEnd",t.join(""))};i.stroke=function(b){var a=[],c=P(b?this.fillStyle:this.strokeStyle),d=c.color,f=c.alpha*this.globalAlpha;a.push("g.x)g.x=e.x;if(h.y==null||e.yg.y)g.y=e.y}}a.push(' ">');if(b)if(typeof this.fillStyle=="object"){var m=this.fillStyle,r=0,n={x:0,y:0},o=0,q=1;if(m.type_=="gradient"){var t=m.x1_/this.arcScaleX_,E=m.y1_/this.arcScaleY_,p=this.getCoords_(m.x0_/this.arcScaleX_,m.y0_/this.arcScaleY_), +z=this.getCoords_(t,E);r=Math.atan2(z.x-p.x,z.y-p.y)*180/Math.PI;if(r<0)r+=360;if(r<1.0E-6)r=0}else{var p=this.getCoords_(m.x0_,m.y0_),w=g.x-h.x,x=g.y-h.y;n={x:(p.x-h.x)/w,y:(p.y-h.y)/x};w/=this.arcScaleX_*k;x/=this.arcScaleY_*k;var R=s.max(w,x);o=2*m.r0_/R;q=2*m.r1_/R-o}var u=m.colors_;u.sort(function(ba,ca){return ba.offset-ca.offset});var J=u.length,da=u[0].color,ea=u[J-1].color,fa=u[0].alpha*this.globalAlpha,ga=u[J-1].alpha*this.globalAlpha,S=[],l=0;for(;l')}else a.push('');else{var K=this.lineScale_*this.lineWidth;if(K<1)f*=K;a.push("')}a.push("");this.element_.insertAdjacentHTML("beforeEnd",a.join(""))};i.fill=function(){this.stroke(true)};i.closePath=function(){this.currentPath_.push({type:"close"})};i.getCoords_=function(b,a){var c=this.m_;return{x:k*(b*c[0][0]+a*c[1][0]+c[2][0])-v,y:k*(b*c[0][1]+a*c[1][1]+c[2][1])-v}};i.save=function(){var b={};O(this,b);this.aStack_.push(b);this.mStack_.push(this.m_);this.m_=y(I(),this.m_)};i.restore=function(){O(this.aStack_.pop(), +this);this.m_=this.mStack_.pop()};function ha(b){var a=0;for(;a<3;a++){var c=0;for(;c<2;c++)if(!isFinite(b[a][c])||isNaN(b[a][c]))return false}return true}function A(b,a,c){if(!!ha(a)){b.m_=a;if(c)b.lineScale_=W(V(a[0][0]*a[1][1]-a[0][1]*a[1][0]))}}i.translate=function(b,a){A(this,y([[1,0,0],[0,1,0],[b,a,1]],this.m_),false)};i.rotate=function(b){var a=G(b),c=F(b);A(this,y([[a,c,0],[-c,a,0],[0,0,1]],this.m_),false)};i.scale=function(b,a){this.arcScaleX_*=b;this.arcScaleY_*=a;A(this,y([[b,0,0],[0,a, +0],[0,0,1]],this.m_),true)};i.transform=function(b,a,c,d,f,h){A(this,y([[b,a,0],[c,d,0],[f,h,1]],this.m_),true)};i.setTransform=function(b,a,c,d,f,h){A(this,[[b,a,0],[c,d,0],[f,h,1]],true)};i.clip=function(){};i.arcTo=function(){};i.createPattern=function(){return new U};function D(b){this.type_=b;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}D.prototype.addColorStop=function(b,a){a=P(a);this.colors_.push({offset:b,color:a.color,alpha:a.alpha})};function U(){}G_vmlCanvasManager= +M;CanvasRenderingContext2D=H;CanvasGradient=D;CanvasPattern=U})(); diff --git a/3.0/modules/tag_cloud_html5/js/jquery.tagcanvas.mod.min.js b/3.0/modules/tag_cloud_html5/js/jquery.tagcanvas.mod.min.js new file mode 100644 index 00000000..44bf1876 --- /dev/null +++ b/3.0/modules/tag_cloud_html5/js/jquery.tagcanvas.mod.min.js @@ -0,0 +1,27 @@ +/** + * Copyright (C) 2010-2012 Graham Breach + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ +/** + * jQuery.tagcanvas 1.17.1 + * For more information, please contact + */ +/** + * Modified by Shad Laws 2012/06/01 -- all modified lines have "mod Shad Laws" comments + * - included initialDecel and deadZone as options + * - set defaults of new options to mimic behavior without them (false and 0) + * - removed two unnecessary variable declarations caught by YUI Compressor + */ +(function(I){var R,Q,G=Math.abs,r=Math.sin,h=Math.cos,z=Math.max,V=Math.min,B={},C={},D={0:"0,",1:"17,",2:"34,",3:"51,",4:"68,",5:"85,",6:"102,",7:"119,",8:"136,",9:"153,",a:"170,",A:"170,",b:"187,",B:"187,",c:"204,",C:"204,",d:"221,",D:"221,",e:"238,",E:"238,",f:"255,",F:"255,"},e,J,d,l=document,y,c={};for(R=0;R<256;++R){Q=R.toString(16);if(R<16){Q="0"+Q}C[Q]=C[Q.toUpperCase()]=R.toString()+","}function N(i){return typeof(i)!="undefined"}function H(j){var Y=j.length-1,X,Z;while(Y){Z=~~(Math.random()*Y);X=j[Y];j[Y]=j[Z];j[Z]=X;--Y}}function n(Y,aa,af,ac){var ab,ae,j,ad,ag=[],Z=Math.PI*(3-Math.sqrt(5)),X=2/Y;for(ab=0;ab0)}function W(ae,j){var X=1024,aa=ae.weightGradient,Z,ac,Y,ad,ab;if(ae.gCanvas){ac=ae.gCanvas.getContext("2d")}else{ae.gCanvas=Z=g(X,1);if(!Z){return null}ac=Z.getContext("2d");ad=ac.createLinearGradient(0,0,X,0);for(Y in aa){ad.addColorStop(1-Y,aa[Y])}ac.fillStyle=ad;ac.fillRect(0,0,X,1)}ab=ac.getImageData(~~((X-1)*j),0,1,1).data;return"rgba("+ab[0]+","+ab[1]+","+ab[2]+","+(ab[3]/255)+")"}function u(aa,Z,X,ad,ab,ac,j){var Y=(ac||0)+(j&&j[0]<0?G(j[0]):0),i=(ac||0)+(j&&j[1]<0?G(j[1]):0);aa.font=Z;aa.textBaseline="top";aa.fillStyle=X;ab&&(aa.shadowColor=ab);ac&&(aa.shadowBlur=ac);j&&(aa.shadowOffsetX=j[0],aa.shadowOffsetY=j[1]);aa.fillText(ad,Y,i)}function m(aj,ab,af,ah,aa,X,ad,ae,j,ai,ag){var Y=ah+G(j[0])+ae+ae,i=aa+G(j[1])+ae+ae,Z,ac;Z=g(Y+ai,i+ag);if(!Z){return null}ac=Z.getContext("2d");u(ac,ab,X,aj,ad,ae,j);return Z}function P(ab,ae,af,Y){var Z=ab.width+G(Y[0])+af+af,j=ab.height+G(Y[1])+af+af,ac,ad,aa=(af||0)+(Y&&Y[0]<0?G(Y[0]):0),X=(af||0)+(Y&&Y[1]<0?G(Y[1]):0);ac=g(Z,j);if(!ac){return null}ad=ac.getContext("2d");ae&&(ad.shadowColor=ae);af&&(ad.shadowBlur=af);Y&&(ad.shadowOffsetX=Y[0],ad.shadowOffsetY=Y[1]);ad.drawImage(ab,aa,X);return ac}function K(aj,ab,ah){var ai=parseInt(aj.length*ah),aa=parseInt(ah*2),Y=g(ai,aa),ae,j,Z,ad,ag,af,X,ac;if(!Y){return null}ae=Y.getContext("2d");ae.fillStyle="#000";ae.fillRect(0,0,ai,aa);u(ae,ah+"px "+ab,"#fff",aj);j=ae.getImageData(0,0,ai,aa);Z=j.width;ad=j.height;ac={min:{x:Z,y:ad},max:{x:-1,y:-1}};for(af=0;af0){if(agac.max.x){ac.max.x=ag}if(afac.max.y){ac.max.y=af}}}}if(Z!=ai){ac.min.x*=(ai/Z);ac.max.x*=(ai/Z)}if(ad!=aa){ac.min.y*=(ai/ad);ac.max.y*=(ai/ad)}Y=null;return ac}function t(i){return"'"+i.replace(/(\'|\")/g,"").replace(/\s*,\s*/g,"', '")+"'"}function A(i,j,X){X=X||l;if(X.addEventListener){X.addEventListener(i,j,false)}else{X.attachEvent("on"+i,j)}}function O(Z,ab,Y,j){var X=j.taglist,aa=j.imageScale;if(aa&&!(ab.width&&ab.height)){A("load",function(){O(Z,ab,Y,j)},window);return}if(!Z.complete){A("load",function(){O(Z,ab,Y,j)},Z);return}ab.width=ab.width;ab.height=ab.height;if(aa){Z.width=ab.width*aa;Z.height=ab.height*aa}Y.w=Z.width;Y.h=Z.height;X.push(Y)}function M(Y,X){var j=l.defaultView,i=X.replace(/\-([a-z])/g,function(Z){return Z.charAt(1).toUpperCase()});return(j&&j.getComputedStyle&&j.getComputedStyle(Y,null).getPropertyValue(X))||(Y.currentStyle&&Y.currentStyle[i])}function x(X,j){var i=1,Y;if(X.weightFrom){i=1*(j.getAttribute(X.weightFrom)||X.textHeight)}else{if(Y=M(j,"font-size")){i=(Y.indexOf("px")>-1&&Y.replace("px","")*1)||(Y.indexOf("pt")>-1&&Y.replace("pt","")*1.25)||Y*3.3}else{X.weight=false}}return i}function k(X){L(X);var j=X.target||X.fromElement.parentNode,i=s.tc[j.id];i&&(i.mx=i.my=-1)}function L(Z){var Y,X,j=l.documentElement,aa;for(Y in s.tc){X=s.tc[Y];if(X.tttimer){clearTimeout(X.tttimer);X.tttimer=null}aa=I(X.canvas).offset();if(Z.pageX){X.mx=Z.pageX-aa.left;X.my=Z.pageY-aa.top}else{X.mx=Z.clientX+(j.scrollLeft||l.body.scrollLeft)-aa.left;X.my=Z.clientY+(j.scrollTop||l.body.scrollTop)-aa.top}}}function q(Y){var j=s,i=l.addEventListener?0:1,X=Y.target&&N(Y.target.id)?Y.target.id:Y.srcElement.parentNode.id;if(X&&Y.button==i&&j.tc[X]){L(Y);j.tc[X].Clicked(Y)}}function T(X){var i=s,j=X.target&&N(X.target.id)?X.target.id:X.srcElement.parentNode.id;if(j&&i.tc[j]){X.cancelBubble=true;X.returnValue=false;X.preventDefault&&X.preventDefault();i.tc[j].Wheel((X.wheelDelta||X.detail)>0)}}function o(){var X=s.tc,j;for(j in X){X[j].Draw()}}function b(X,i){var j=r(i),Y=h(i);return{x:X.x,y:(X.y*Y)+(X.z*j),z:(X.y*-j)+(X.z*Y)}}function a(X,i){var j=r(i),Y=h(i);return{x:(X.x*Y)+(X.z*-j),y:X.y,z:(X.x*j)+(X.z*Y)}}function S(X,ae,ad,Z,ac,aa){var i,Y,ab,j=X.z1/(X.z1+X.z2+ae.z);i=ae.y*j*aa;Y=ae.x*j*ac;ab=X.z2+ae.z;return{x:Y,y:i,z:ab}}function f(i){this.ts=new Date().valueOf();this.tc=i;this.x=this.y=this.w=this.h=this.sc=1;this.z=0;this.Draw=i.pulsateTo<1&&i.outlineMethod!="colour"?this.DrawPulsate:this.DrawSimple;this.SetMethod(i.outlineMethod)}e=f.prototype;e.SetMethod=function(X){var j={block:["PreDraw","DrawBlock"],colour:["PreDraw","DrawColour"],outline:["PostDraw","DrawOutline"],classic:["LastDraw","DrawOutline"],none:["LastDraw"]},i=j[X]||j.outline;if(X=="none"){this.Draw=function(){return 1}}else{this.drawFunc=this[i[1]]}this[i[0]]=this.Draw};e.Update=function(ad,ac,ae,aa,ab,j,Z,i){var X=this.tc.outlineOffset,Y=2*X;this.x=ab*ad+Z-X;this.y=ab*ac+i-X;this.w=ab*ae+Y;this.h=ab*aa+Y;this.sc=ab;this.z=j.z};e.DrawOutline=function(aa,i,Z,j,X,Y){aa.strokeStyle=Y;aa.strokeRect(i,Z,j,X)};e.DrawColour=function(Y,ab,Z,ac,X,i,ad,j,aa){return this[ad.image?"DrawColourImage":"DrawColourText"](Y,ab,Z,ac,X,i,ad,j,aa)};e.DrawColourText=function(Z,ac,aa,ad,X,i,ae,j,ab){var Y=ae.colour;ae.colour=i;ae.Draw(Z,j,ab);ae.colour=Y;return 1};e.DrawColourImage=function(ac,af,ad,ag,ab,i,aj,j,ae){var ah=ac.canvas,Z=~~z(af,0),Y=~~z(ad,0),aa=V(ah.width-Z,ag)+0.5|0,ai=V(ah.height-Y,ab)+0.5|0,X;if(y){y.width=aa,y.height=ai}else{y=g(aa,ai)}if(!y){return this.SetMethod("outline")}X=y.getContext("2d");X.drawImage(ah,Z,Y,aa,ai,0,0,aa,ai);ac.clearRect(Z,Y,aa,ai);aj.Draw(ac,j,ae);ac.setTransform(1,0,0,1,0,0);ac.save();ac.beginPath();ac.rect(Z,Y,aa,ai);ac.clip();ac.globalCompositeOperation="source-in";ac.fillStyle=i;ac.fillRect(Z,Y,aa,ai);ac.restore();ac.globalCompositeOperation="destination-over";ac.drawImage(y,0,0,aa,ai,Z,Y,aa,ai);ac.globalCompositeOperation="source-over";return 1};e.DrawBlock=function(aa,i,Z,j,X,Y){aa.fillStyle=Y;aa.fillRect(i,Z,j,X)};e.DrawSimple=function(Z,i,j,Y){var X=this.tc;Z.setTransform(1,0,0,1,0,0);Z.strokeStyle=X.outlineColour;Z.lineWidth=X.outlineThickness;Z.shadowBlur=Z.shadowOffsetX=Z.shadowOffsetY=0;Z.globalAlpha=1;return this.drawFunc(Z,this.x,this.y,this.w,this.h,X.outlineColour,i,j,Y)};e.DrawPulsate=function(aa,i,j,Y){var Z=new Date().valueOf()-this.ts,X=this.tc;aa.setTransform(1,0,0,1,0,0);aa.strokeStyle=X.outlineColour;aa.lineWidth=X.outlineThickness;aa.shadowBlur=aa.shadowOffsetX=aa.shadowOffsetY=0;aa.globalAlpha=X.pulsateTo+((1-X.pulsateTo)*(0.5+(h(2*Math.PI*Z/(1000*X.pulsateTime))/2)));return this.drawFunc(aa,this.x,this.y,this.w,this.h,X.outlineColour,i,j,Y)};e.Active=function(X,i,j){return(i>=this.x&&j>=this.y&&i<=this.x+this.w&&j<=this.y+this.h)};e.PreDraw=e.PostDraw=e.LastDraw=function(){};function E(Z,j,ad,af,ae,ab,X,Y){var ac=Z.ctxt,aa;this.tc=Z;this.image=j.src?j:null;this.name=j.src?"":j;this.title=ad.title||null;this.a=ad;this.p3d={x:af[0]*Z.radius*1.1,y:af[1]*Z.radius*1.1,z:af[2]*Z.radius*1.1};this.x=this.y=0;this.w=ae;this.h=ab;this.colour=X||Z.textColour;this.textFont=Y||Z.textFont;this.weight=this.sc=this.alpha=1;this.weighted=!Z.weight;this.outline=new f(Z);if(this.image){if(Z.txtOpt&&Z.shadow){aa=P(this.image,Z.shadow,Z.shadowBlur,Z.shadowOffset);if(aa){this.image=aa;this.w=aa.width;this.h=aa.height}}}else{this.textHeight=Z.textHeight;this.extents=K(this.name,this.textFont,this.textHeight);this.Measure(ac,Z)}this.SetShadowColour=Z.shadowAlpha?this.SetShadowColourAlpha:this.SetShadowColourFixed;this.SetDraw(Z)}J=E.prototype;J.SetDraw=function(i){this.Draw=this.image?(i.ie>7?this.DrawImageIE:this.DrawImage):this.DrawText;i.noSelect&&(this.CheckActive=function(){})};J.Measure=function(ab,j){this.h=this.extents?this.extents.max.y+this.extents.min.y:this.textHeight;ab.font=this.font=this.textHeight+"px "+this.textFont;this.w=ab.measureText(this.name).width;if(j.txtOpt){var Y=j.txtScale,Z=Y*this.textHeight,aa=Z+"px "+this.textFont,X=[Y*j.shadowOffset[0],Y*j.shadowOffset[1]],i;ab.font=aa;i=ab.measureText(this.name).width;this.image=m(this.name,aa,Z,i,Y*this.h,this.colour,j.shadow,Y*j.shadowBlur,X,Y,Y);if(this.image){this.w=this.image.width/Y;this.h=this.image.height/Y}this.SetDraw(j);j.txtOpt=this.image}};J.SetWeight=function(i){if(!this.name.length){return}this.weight=i;this.Weight(this.tc.ctxt,this.tc);this.Measure(this.tc.ctxt,this.tc)};J.Weight=function(Y,X){var j=this.weight,i=X.weightMode;this.weighted=true;if(i=="colour"||i=="both"){this.colour=W(X,(j-X.min_weight)/(X.max_weight-X.min_weight))}if(i=="size"||i=="both"){this.textHeight=j*X.weightSize}this.extents=K(this.name,this.textFont,this.textHeight)};J.SetShadowColourFixed=function(X,j,i){X.shadowColor=j};J.SetShadowColourAlpha=function(X,j,i){X.shadowColor=p(j,i)};J.DrawText=function(X,ab,j){var ac=this.tc,Z=this.x,Y=this.y,aa,i,ad=this.sc;X.globalAlpha=this.alpha;X.setTransform(ad,0,0,ad,0,0);X.fillStyle=this.colour;ac.shadow&&this.SetShadowColour(X,ac.shadow,this.alpha);X.font=this.font;aa=this.w;i=this.h;Z+=(ab/ad)-(aa/2);Y+=(j/ad)-(i/2);X.fillText(this.name,Z,Y)};J.DrawImage=function(Z,af,Y){var ac=this.x,aa=this.y,ag=this.sc,j=this.image,ad=this.w,X=this.h,ab=this.alpha,ae=this.shadow;Z.globalAlpha=ab;Z.setTransform(ag,0,0,ag,0,0);Z.fillStyle=this.colour;ae&&this.SetShadowColour(Z,ae,ab);ac+=(af/ag)-(ad/2);aa+=(Y/ag)-(X/2);Z.drawImage(j,ac,aa,ad,X)};J.DrawImageIE=function(Z,ad,Y){var j=this.image,ae=this.sc,ac=j.width=this.w*ae,X=j.height=this.h*ae,ab=(this.x*ae)+ad-(ac/2),aa=(this.y*ae)+Y-(X/2);Z.setTransform(1,0,0,1,0,0);Z.globalAlpha=this.alpha;Z.drawImage(j,ab,aa)};J.Calc=function(Z,Y){var i=a(this.p3d,Z),j=this.tc,aa=j.minBrightness,X=j.radius;this.p3d=b(i,Y);i=S(j,this.p3d,this.w,this.h,j.stretchX,j.stretchY);this.x=i.x;this.y=i.y;this.sc=(j.z1+j.z2-i.z)/j.z2;this.alpha=z(aa,V(1,aa+1-((i.z-j.z2+X)/(2*X))))};J.CheckActive=function(Y,ac,X){var ad=this.tc,i=this.outline,ab=this.w,j=this.h,aa=this.x-ab/2,Z=this.y-j/2;i.Update(aa,Z,ab,j,this.sc,this.p3d,ac,X);return i.Active(Y,ad.mx,ad.my)?i:null};J.Clicked=function(aa){var j=this.a,X=j.target,Y=j.href,i;if(X!=""&&X!="_self"){if(self.frames[X]){self.frames[X]=Y}else{try{if(top.frames[X]){top.frames[X]=Y;return}}catch(Z){}window.open(Y,X)}return}if(l.createEvent){i=l.createEvent("MouseEvents");i.initMouseEvent("click",1,1,window,0,0,0,0,0,0,0,0,0,0,null);if(!j.dispatchEvent(i)){return}}else{if(j.fireEvent){if(!j.fireEvent("onclick")){return}}}l.location=Y};function s(){var j,X={mx:-1,my:-1,z1:20000,z2:20000,z0:0.0002,freezeActive:false,activeCursor:"pointer",pulsateTo:1,pulsateTime:3,reverse:false,depth:0.5,maxSpeed:0.05,minSpeed:0,decel:0.95,interval:20,initial:null,initialDecel:false,deadZone:0,hideTags:true,minBrightness:0.1,outlineColour:"#ffff99",outlineThickness:2,outlineOffset:5,outlineMethod:"outline",textColour:"#ff99ff",textHeight:15,textFont:"Helvetica, Arial, sans-serif",shadow:"#000",shadowBlur:0,shadowOffset:[0,0],zoom:1,weight:false,weightMode:"size",weightFrom:null,weightSize:1,weightGradient:{0:"#f00",0.33:"#ff0",0.66:"#0f0",1:"#00f"},txtOpt:true,txtScale:2,frontSelect:false,wheelZoom:true,zoomMin:0.3,zoomMax:3,zoomStep:0.05,shape:"sphere",lock:null,tooltip:null,tooltipDelay:300,tooltipClass:"tctooltip",radiusX:1,radiusY:1,radiusZ:1,stretchX:1,stretchY:1,shuffleTags:false,noSelect:false,noMouse:false,imageScale:1};for(j in X){this[j]=X[j]}this.max_weight=0;this.min_weight=200}d=s.prototype;d.Draw=function(){var ag=this.canvas,ae=ag.width,X=ag.height,j=0,ad=this.yaw,Y=this.pitch,Z=ae/2,aj=X/2,ah=this.ctxt,ab,ai,af,ac=-1,al=this.taglist,aa=al.length,ak=this.frontSelect;if(ad==0&&Y==0&&this.drawn&&!this.deadZoneActive){return this.Animate(ae,X)}ah.setTransform(1,0,0,1,0,0);this.active=null;for(af=0;af=0&&this.my>=0&&al[af].CheckActive(ah,Z,aj);if(ai&&ai.sc>j&&(!ak||ai.z<=0)){ab=ai;ab.index=ac=af;j=ai.sc}}this.active=ab;if(!this.txtOpt&&this.shadow){ah.shadowBlur=this.shadowBlur;ah.shadowOffsetX=this.shadowOffset[0];ah.shadowOffsetY=this.shadowOffset[1]}ah.clearRect(0,0,ae,X);for(af=0;af=0&&aa>=0&&abae){this.yaw=ad>X.z0?X.yaw*X.decel:0}if(j!="y"&&Y>ae){this.pitch=Y>X.z0?X.pitch*X.decel:0}}}};d.Zoom=function(i){this.z2=this.z1*(1/i);this.drawn=0};d.Clicked=function(Y){var X=this.taglist,i=this.active;try{if(i&&X[i.index]){X[i.index].Clicked(Y)}}catch(j){}};d.Wheel=function(j){var X=this.zoom+this.zoomStep*(j?1:-1);this.zoom=V(this.zoomMax,z(this.zoomMin,X));this.Zoom(this.zoom)};s.tc={};jQuery.fn.tagcanvas=function(X,j){var i,Y=j?jQuery("#"+j):this;if(l.all&&!j){return false}i=Y.find("a");if(N(window.G_vmlCanvasManager)){this.each(function(){I(this)[0]=window.G_vmlCanvasManager.initElement(I(this)[0])});X.ie=parseFloat(navigator.appVersion.split("MSIE")[1])}if(!i.length||!this[0].getContext||!this[0].getContext("2d").fillText){return false}this.each(function(){var ab,Z,ad,ag,ah,ac,af,ae=[],aa={sphere:n,vcylinder:w,hcylinder:F};j||(i=I(this).find("a"));ac=new s;for(ab in X){ac[ab]=X[ab]}ac.z1=(19800/(Math.exp(ac.depth)*(1-1/Math.E)))+20000-19800/(1-(1/Math.E));ac.z2=ac.z1*(1/ac.zoom);ac.radius=(this.height>this.width?this.width:this.height)*0.33*(ac.z2+ac.z1)/(ac.z1);ac.yaw=ac.initial?ac.initial[0]*ac.maxSpeed:0;ac.pitch=ac.initial?ac.initial[1]*ac.maxSpeed:0;ac.canvas=I(this)[0];ac.ctxt=ac.canvas.getContext("2d");ac.textFont=ac.textFont&&t(ac.textFont);ac.deadZone*=1;ac.pulsateTo*=1;ac.textHeight*=1;ac.minBrightness*=1;ac.ctxt.textBaseline="top";if(ac.shadowBlur||ac.shadowOffset[0]||ac.shadowOffset[1]){ac.ctxt.shadowColor=ac.shadow;ac.shadow=ac.ctxt.shadowColor;ac.shadowAlpha=v()}else{delete ac.shadow}ac.taglist=[];ac.shape=aa[ac.shape]||aa.sphere;Z=ac.shape(i.length,ac.radiusX,ac.radiusY,ac.radiusZ);ac.shuffleTags&&H(Z);ac.listLength=i.length;for(ab=0;abac.max_weight){ac.max_weight=af}if(afac.min_weight)){for(ab=0;ab + +
    +

    + +

    +

    + excanvas to maintain compatibility with pre-9.0 Internet Explorer.") ?> +

    +

    + here.") ?> +

    + +
    diff --git a/3.0/modules/tag_cloud_html5/views/tag_cloud_html5_block.html.php b/3.0/modules/tag_cloud_html5/views/tag_cloud_html5_block.html.php new file mode 100644 index 00000000..68d12e47 --- /dev/null +++ b/3.0/modules/tag_cloud_html5/views/tag_cloud_html5_block.html.php @@ -0,0 +1,38 @@ + + + +
    + + + +
    +
    + +
    + + diff --git a/3.0/modules/tag_cloud_html5/views/tag_cloud_html5_page.html.php b/3.0/modules/tag_cloud_html5/views/tag_cloud_html5_page.html.php new file mode 100644 index 00000000..c8d58b97 --- /dev/null +++ b/3.0/modules/tag_cloud_html5/views/tag_cloud_html5_page.html.php @@ -0,0 +1,38 @@ + + + +
    +
    + dynamic_top() ?> +
    +

    +
    +
    + + + +
    +
    + +
    +dynamic_bottom() ?> diff --git a/3.0/modules/tag_cloud_page/controllers/tag_cloud_page.php b/3.0/modules/tag_cloud_page/controllers/tag_cloud_page.php index 2fc045df..f00e29ad 100644 --- a/3.0/modules/tag_cloud_page/controllers/tag_cloud_page.php +++ b/3.0/modules/tag_cloud_page/controllers/tag_cloud_page.php @@ -1,7 +1,7 @@ item) && ($theme->item->is_album())) { $item = $theme->item; - $all_tags = ORM::factory("tag") + + // Create an ORM query for finding one instance of each tag + // used by children in the current album. + $tags_model = ORM::factory("tag") ->join("items_tags", "items_tags.tag_id", "tags.id") ->join("items", "items.id", "items_tags.item_id", "LEFT") ->where("items.parent_id", "=", $item->id) - ->order_by("tags.id", "ASC") - ->find_all(); + ->order_by("tags.name", "ASC") + ->group_by("tags.id"); + + // Limit $all_tags to the first X tags if max_display_tags is set, + // else populate it with all tags used by this album's children. + $all_tags = ""; + if (module::get_var("tagsinalbum", "max_display_tags") > 0) { + $all_tags = $tags_model->find_all(module::get_var("tagsinalbum", "max_display_tags")); + } else { + $all_tags = $tags_model->find_all(); + } + + // If this album has children that are tagged, display those tags. if (count($all_tags) > 0) { $block = new Block(); $block->css_id = "g-tags-in-album-block"; diff --git a/3.0/modules/tagsinalbum/helpers/tagsinalbum_event.php b/3.0/modules/tagsinalbum/helpers/tagsinalbum_event.php index fe7339ae..ca37bdd9 100644 --- a/3.0/modules/tagsinalbum/helpers/tagsinalbum_event.php +++ b/3.0/modules/tagsinalbum/helpers/tagsinalbum_event.php @@ -1,7 +1,7 @@ id) { - $tag = ORM::factory("tag", $one_tag->id); - $display_tags[] = array(html::clean($tag->name), $tag->url()); - $last_tagid = $one_tag->id; - } - if (module::get_var("tagsinalbum", "max_display_tags") > 0) { - if (count($display_tags) == module::get_var("tagsinalbum", "max_display_tags")) { - break; - } - } - } - - // Sort the array. - asort($display_tags); - - // Print out the list of tags as clickable links. + // Loop through each tag in $all_tags, and display it as a link. $not_first = 0; - foreach ($display_tags as $one_tag) { + foreach ($all_tags as $one_tag) { if ($not_first++ > 0) { print ", "; } - print "" . $one_tag[0] . ""; + print "url() . "\">" . html::clean($one_tag->name) . ""; } ?> diff --git a/3.0/modules/tagsmap/controllers/admin_tagsmap.php b/3.0/modules/tagsmap/controllers/admin_tagsmap.php index 40d87119..0b676957 100644 --- a/3.0/modules/tagsmap/controllers/admin_tagsmap.php +++ b/3.0/modules/tagsmap/controllers/admin_tagsmap.php @@ -1,7 +1,7 @@ group("GoogleMapsKey"); $googlemap_group->input("google_api_key") - ->label(t("Google Maps API Key")) - ->value(module::get_var("tagsmap", "googlemap_api_key")) - ->rules("required"); + ->label(t("Google APIs Console key (optional):")) + ->value(module::get_var("tagsmap", "googlemap_api_key")); // Input boxes for the Maps starting location map type and zoom. $startingmap_group = $form->group("GoogleMapsPos"); @@ -212,6 +210,8 @@ class Admin_TagsMap_Controller extends Admin_Controller { "G_PHYSICAL_MAP" => "Physical", "G_SATELLITE_3D_MAP" => "Google Earth")) ->selected(module::get_var("tagsmap", "googlemap_type")); + $startingmap_group->checkbox("restrict_maps")->label(t("Restrict maps to registered users?")) + ->checked(module::get_var("tagsmap", "restrict_maps", false)); // Add a save button to the form. $form->submit("SaveSettings")->value(t("Save")); @@ -234,6 +234,7 @@ class Admin_TagsMap_Controller extends Admin_Controller { module::set_var("tagsmap", "googlemap_longitude", $form->GoogleMapsPos->google_starting_longitude->value); module::set_var("tagsmap", "googlemap_zoom", $form->GoogleMapsPos->google_default_zoom->value); module::set_var("tagsmap", "googlemap_type", $form->GoogleMapsPos->google_default_type->value); + module::set_var("tagsmap", "restrict_maps", $form->GoogleMapsPos->restrict_maps->value); // Display a success message and redirect back to the TagsMap admin page. message::success(t("Your settings have been saved.")); @@ -247,4 +248,4 @@ class Admin_TagsMap_Controller extends Admin_Controller { $view->content->tags = ORM::factory("tag")->order_by("name", "ASC")->find_all(); print $view; } -} \ No newline at end of file +} diff --git a/3.0/modules/tagsmap/controllers/tagsmap.php b/3.0/modules/tagsmap/controllers/tagsmap.php index 8725db86..8e01f5b5 100644 --- a/3.0/modules/tagsmap/controllers/tagsmap.php +++ b/3.0/modules/tagsmap/controllers/tagsmap.php @@ -1,7 +1,7 @@ guest)) { + throw new Kohana_404_Exception(); + } + // Generate a list of GPS coordinates. $tagsGPS = ORM::factory("tags_gps")->find_all(); - + // Set up and display the actual page. // If fullsize is true, allow the map to take up the entire browser window, // if not, then display the map in the gallery theme. if ($fullsize == true) { $view = new View("tagsmap_googlemap.html"); $view->map_fullsize = true; - + // Load in module preferences. $view->tags_gps = $tagsGPS; $view->google_map_key = module::get_var("tagsmap", "googlemap_api_key"); @@ -38,21 +43,28 @@ class TagsMap_Controller extends Controller { $view->google_map_longitude = module::get_var("tagsmap", "googlemap_longitude"); $view->google_map_zoom = module::get_var("tagsmap", "googlemap_zoom"); $view->google_map_type = module::get_var("tagsmap", "googlemap_type"); - + print $view; } else { - $template = new Theme_View("page.html", "other", "TagsMap"); + // Set up breadcrumbs. + $breadcrumbs = array(); + $root = item::root(); + $breadcrumbs[] = Breadcrumb::instance($root->title, $root->url())->set_first(); + $breadcrumbs[] = Breadcrumb::instance(t("Tag Map"), url::site("tagsmap/googlemap/"))->set_last(); + + $template = new Theme_View("page.html", "other", "tag"); $template->page_title = t("Gallery :: Map"); + $template->set_global(array("breadcrumbs" => $breadcrumbs)); $template->content = new View("tagsmap_googlemap.html"); - // Load in module preferences. + // Load in module preferences. $template->content->tags_gps = $tagsGPS; $template->content->google_map_key = module::get_var("tagsmap", "googlemap_api_key"); $template->content->google_map_latitude = module::get_var("tagsmap", "googlemap_latitude"); $template->content->google_map_longitude = module::get_var("tagsmap", "googlemap_longitude"); $template->content->google_map_zoom = module::get_var("tagsmap", "googlemap_zoom"); $template->content->google_map_type = module::get_var("tagsmap", "googlemap_type"); - + print $template; } } diff --git a/3.0/modules/tagsmap/css/tagsmap_menu.css b/3.0/modules/tagsmap/css/tagsmap_menu.css index 925e1181..9d89d015 100644 --- a/3.0/modules/tagsmap/css/tagsmap_menu.css +++ b/3.0/modules/tagsmap/css/tagsmap_menu.css @@ -1,3 +1,7 @@ #g-view-menu #g-tagsmap-link { background-image: url('../images/ico-view-tagsmap.png'); } +#g-tagsmap-dialog { + color: black; +} +#g-tagsmap-dialog a { color: blue !important; } diff --git a/3.0/modules/tagsmap/helpers/tagsmap_event.php b/3.0/modules/tagsmap/helpers/tagsmap_event.php index 66ed8fd2..81d14736 100644 --- a/3.0/modules/tagsmap/helpers/tagsmap_event.php +++ b/3.0/modules/tagsmap/helpers/tagsmap_event.php @@ -1,7 +1,7 @@ module == "tag") { + $data->messages["warn"][] = t("The TagsMap module requires the Tags module."); + } + } + static function admin_menu($menu, $theme) { // Add a link to the TagsMap admin page to the Content menu. $menu->get("content_menu") @@ -42,6 +48,10 @@ class tagsmap_event_Core { } static function photo_menu($menu, $theme) { + // Make sure the user can view maps before displaying one. + if ((module::get_var("tagsmap", "restrict_maps") == true) && (identity::active_user()->guest)) { + return; + } $menu->append(Menu::factory("link") ->id("tagsmap") ->label(t("View Map")) @@ -50,18 +60,38 @@ class tagsmap_event_Core { } static function movie_menu($menu, $theme) { + // Make sure the user can view maps before displaying one. + if ((module::get_var("tagsmap", "restrict_maps") == true) && (identity::active_user()->guest)) { + return; + } $menu->append(Menu::factory("link") ->id("tagsmap") ->label(t("View Map")) ->url(url::site("tagsmap/googlemap/")) ->css_id("g-tagsmap-link")); } - + + static function tag_menu($menu, $theme) { + // Make sure the user can view maps before displaying one. + if ((module::get_var("tagsmap", "restrict_maps") == true) && (identity::active_user()->guest)) { + return; + } + $menu->append(Menu::factory("link") + ->id("tagsmap") + ->label(t("View Map")) + ->url(url::site("tagsmap/googlemap/")) + ->css_id("g-tagsmap-link")); + } + static function album_menu($menu, $theme) { + // Make sure the user can view maps before displaying one. + if ((module::get_var("tagsmap", "restrict_maps") == true) && (identity::active_user()->guest)) { + return; + } $menu->append(Menu::factory("link") ->id("tagsmap") ->label(t("View Map")) ->url(url::site("tagsmap/googlemap/")) ->css_id("g-tagsmap-link")); } -} \ No newline at end of file +} diff --git a/3.0/modules/tagsmap/helpers/tagsmap_installer.php b/3.0/modules/tagsmap/helpers/tagsmap_installer.php index 48ad5461..ca404509 100644 --- a/3.0/modules/tagsmap/helpers/tagsmap_installer.php +++ b/3.0/modules/tagsmap/helpers/tagsmap_installer.php @@ -1,7 +1,7 @@ css("tagsmap_menu.css"); } diff --git a/3.0/modules/tagsmap/models/tags_gps.php b/3.0/modules/tagsmap/models/tags_gps.php index 31f7943f..669cbc05 100644 --- a/3.0/modules/tagsmap/models/tags_gps.php +++ b/3.0/modules/tagsmap/models/tags_gps.php @@ -1,7 +1,7 @@ -
    You may sign up for a Google Maps API key here.

    +
    + here.

    diff --git a/3.0/modules/tagsmap/views/admin_tagsmap_delete.html.php b/3.0/modules/tagsmap/views/admin_tagsmap_delete.html.php index 8b6c0e95..dd4704a6 100644 --- a/3.0/modules/tagsmap/views/admin_tagsmap_delete.html.php +++ b/3.0/modules/tagsmap/views/admin_tagsmap_delete.html.php @@ -6,4 +6,3 @@ ">Cancel
    - diff --git a/3.0/modules/tagsmap/views/admin_tagsmap_edit.html.php b/3.0/modules/tagsmap/views/admin_tagsmap_edit.html.php index e01f2b29..ff08cbbc 100644 --- a/3.0/modules/tagsmap/views/admin_tagsmap_edit.html.php +++ b/3.0/modules/tagsmap/views/admin_tagsmap_edit.html.php @@ -9,7 +9,13 @@
    - +\n"; +} else { + print "\n"; +} +?> + - diff --git a/3.0/modules/tagsmap/views/tagsmap_googlemap.html.php b/3.0/modules/tagsmap/views/tagsmap_googlemap.html.php index 8e08eabd..aee5a028 100644 --- a/3.0/modules/tagsmap/views/tagsmap_googlemap.html.php +++ b/3.0/modules/tagsmap/views/tagsmap_googlemap.html.php @@ -9,7 +9,12 @@ - +\n"; +} else { + print "\n"; +} +?> + script("gallery.ajax.js") ?> + script("gallery.dialog.js") ?> + script("superfish/js/superfish.js") ?> + script("jquery.scrollTo.js") ?> + + admin_head() ?> + + + script("ui.init.js") ?> css("yui/reset-fonts-grids.css") ?> css("themeroller/ui.base.css") ?> css("superfish/css/superfish.css") ?> css("screen.css") ?> + + css("screen-rtl.css") ?> + - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("ui.init.js") ?> + + get_combined("css") ?> - admin_head() ?> + + get_combined("script") ?> body_attributes() ?>> diff --git a/3.0/themes/browny_admin_wind/views/pager.html.php b/3.0/themes/browny_admin_wind/views/pager.html.php deleted file mode 100644 index 5fff5845..00000000 --- a/3.0/themes/browny_admin_wind/views/pager.html.php +++ /dev/null @@ -1,44 +0,0 @@ - - -
      - $current_first_item, - "to_number" => $current_last_item, - "count" => $total_items)) ?> -
    • - - - - - - - - - - - - - - -
    • -
    • -
    • - - - - - - - - - - - - - - -
    • -
    diff --git a/3.1/themes/sobriety/views/paginator.html.php b/3.0/themes/browny_admin_wind/views/paginator.html.php similarity index 88% rename from 3.1/themes/sobriety/views/paginator.html.php rename to 3.0/themes/browny_admin_wind/views/paginator.html.php index 5034c965..b46d9741 100644 --- a/3.1/themes/sobriety/views/paginator.html.php +++ b/3.0/themes/browny_admin_wind/views/paginator.html.php @@ -1,9 +1,10 @@ +
    • @@ -51,8 +53,8 @@ $first_visible_position, "to_number" => $last_visible_position, @@ -60,8 +62,6 @@ $position, "total" => $total)) ?> - -
    • @@ -85,3 +85,4 @@
    + \ No newline at end of file diff --git a/3.0/themes/browny_wind/css/screen-rtl.css b/3.0/themes/browny_wind/css/screen-rtl.css new file mode 100644 index 00000000..3a0ece7b --- /dev/null +++ b/3.0/themes/browny_wind/css/screen-rtl.css @@ -0,0 +1,393 @@ +/** + * Gallery 3 Browny Wind Theme Right-to-Left Screen Styles + */ + +.rtl { + direction: rtl; +} + +#g-header, +#g-content, +#g-sidebar, +#g-footer, +caption, +th, +#g-dialog, +.g-context-menu li a, +.g-message-box li, +#g-site-status li { + text-align: right; +} + +.g-text-right { + text-align: left; +} + +/* Lists ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.g-text li, +.g-text li { + margin-left: 0; + margin-right: 1em; +} + +/* Messages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.g-error, +.g-info, +.g-success, +.g-warning, +#g-add-photos-status .g-success, +#g-add-photos-status .g-error { + background-position: center right; + padding-right: 30px !important; +} + +form li.g-error, +form li.g-info, +form li.g-success, +form li.g-warning { + padding-right: 0 !important; +} + +.g-left, +.g-inline li, +#g-content #g-album-grid .g-item, +.sf-menu li, +.g-breadcrumbs li, +.g-paginator li, +.g-buttonset li, +.ui-icon-left .ui-icon, +.g-short-form li, +form ul ul li, +input[type="submit"], +input[type="reset"], +input.checkbox, +input[type=checkbox], +input.radio, +input[type=radio] { + float: right; +} + +.g-right, +.ui-icon-right .ui-icon { + float: left; +} + +.g-inline li { + margin-right: 1em; +} + +.g-inline li.g-first { + margin-right: 0; +} + +/* ~browny~ */ +.g-breadcrumbs li { + background: transparent url('../images/ico-separator-rtl.gif') no-repeat scroll right center; + padding: .5em 18px .5em 8px; +} + +.g-breadcrumbs .g-first { + background: none; + padding-right: 0; +} + +input.checkbox { + margin-left: .4em; +} + +#g-add-comment { + right: inherit; + left: 0; +} + +.ui-icon-left .ui-icon { + margin-left: .2em; +} + +.ui-icon-right .ui-icon { + margin-right: .2em; +} + +/* RTL Corner radius ~~~~~~~~~~~~~~~~~~~~~~ */ + +.g-buttonset .ui-corner-tl { + -moz-border-radius-topleft: 0; + -webkit-border-top-left-radius: 0; + border-top-left-radius: 0; + -moz-border-radius-topright: 5px !important; + -webkit-border-top-right-radius: 5px !important; + border-top-right-radius: 5px !important; +} + +.g-buttonset .ui-corner-tr { + -moz-border-radius-topright: 0; + -webkit-border-top-right-radius: 0; + border-top-right-radius: 0; + -moz-border-radius-topleft: 5px !important; + -webkit-border-top-left-radius: 5px !important; + border-top-left-radius: 5px !important; +} + +.g-buttonset .ui-corner-bl { + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-bottomright: 5px !important; + -webkit-border-bottom-right-radius: 5px !important; + border-bottom-right-radius: 5px !important; +} + +.g-buttonset .ui-corner-br { + -moz-border-radius-bottomright: 0; + -webkit-border-bottom-right-radius: 0; + border-bottom-right-radius: 0; + -moz-border-radius-bottomleft: 5px !important; + -webkit-border-bottom-left-radius: 5px !important; + border-bottom-left-radius: 5px !important; +} + +.g-buttonset .ui-corner-right, +.ui-progressbar .ui-corner-right { + -moz-border-radius-topright: 0; + -webkit-border-top-right-radius: 0; + border-top-right-radius: 0; + -moz-border-radius-topleft: 5px !important; + -webkit-border-top-left-radius: 5px !important; + border-top-left-radius: 5px !important; + -moz-border-radius-bottomright: 0; + -webkit-border-bottom-right-radius: 0; + border-bottom-right-radius: 0; + -moz-border-radius-bottomleft: 5px !important; + -webkit-border-bottom-left-radius: 5px !important; + border-bottom-left-radius: 5px !important; +} + +.g-buttonset .ui-corner-left, +.ui-progressbar .ui-corner-left { + -moz-border-radius-topleft: 0; + -webkit-border-top-left-radius: 0; + border-top-left-radius: 0; + -moz-border-radius-topright: 5px !important; + -webkit-border-top-right-radius: 5px !important; + border-top-right-radius: 5px !important; + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-bottomright: 5px !important; + -webkit-border-bottom-right-radius: 5px !important; + border-bottom-right-radius: 5px !important; +} + +/* RTL Superfish ~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.sf-menu a { + border-left: none; + border-right:1px solid #fff; +} + +.sf-menu a.sf-with-ul { + padding-left: 2.25em; + padding-right: 1em; +} + +.sf-sub-indicator { + left: .75em !important; + right: auto; + background: url('../../../lib/superfish/images/arrows-ffffff-rtl.png') no-repeat -10px -100px; +} + +a > .sf-sub-indicator { + top: .8em; + background-position: -10px -100px; +} + +a:focus > .sf-sub-indicator, +a:hover > .sf-sub-indicator, +a:active > .sf-sub-indicator, +li:hover > a > .sf-sub-indicator, +li.sfHover > a > .sf-sub-indicator { + background-position: 0 -100px; +} + +.sf-menu ul .sf-sub-indicator { + background-position: 0 0; +} + +.sf-menu ul a > .sf-sub-indicator { + background-position: -10px 0; +} + +.sf-menu ul a:focus > .sf-sub-indicator, +.sf-menu ul a:hover > .sf-sub-indicator, +.sf-menu ul a:active > .sf-sub-indicator, +.sf-menu ul li:hover > a > .sf-sub-indicator, +.sf-menu ul li.sfHover > a > .sf-sub-indicator { + background-position: 0 0; +} + +.sf-menu li:hover ul, +.sf-menu li.sfHover ul { + right: 0; + left: auto; +} + +ul.sf-menu li li:hover ul, +ul.sf-menu li li.sfHover ul { + right: 12em; + left: auto; +} +ul.sf-menu li li li:hover ul, +ul.sf-menu li li li.sfHover ul { + right: 12em; + left: auto; +} + +.sf-shadow ul { + background: url('../../../lib/superfish/images/shadow.png') no-repeat bottom left; + padding: 0 0 9px 8px; + border-top-right-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-topright: 0; + -moz-border-radius-bottomleft: 0; + -webkit-border-top-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -moz-border-radius-topleft: 17px; + -moz-border-radius-bottomright: 17px; + -webkit-border-top-left-radius: 17px; + -webkit-border-bottom-right-radius: 17px; + border-top-left-radius: 17px; + border-bottom-right-radius: 17px; +} + +/* RTL ThemeRoller ~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.ui-dialog .ui-dialog-titlebar { + padding: 0.5em 1em 0.3em 0.3em; +} + +.ui-dialog .ui-dialog-title { + float: right; +} + +.ui-dialog .ui-dialog-titlebar-close { + left: 0.3em; + right: auto; +} + +.ui-tabs .ui-tabs-nav li { + float: right; +} + +/* RTL paginator ~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.g-paginator .g-info { + width: 35%; +} + +.g-paginator .g-text-right { + margin-left: 0; +} + +.g-paginator .ui-icon-seek-end { + background-position: -80px -160px; +} + +.g-paginator .ui-icon-seek-next { + background-position: -48px -160px; +} + +.g-paginator .ui-icon-seek-prev { + background-position: -32px -160px; +} + +.g-paginator .ui-icon-seek-first { + background-position: -64px -160px; +} + +#g-header #g-login-menu, +#g-header #g-quick-search-form { + clear: left; + float: left; +} + +#g-header #g-login-menu li { + margin-left: 0; + padding-left: 0; + padding-right: 1.2em; +} + +#g-site-menu { + left: auto; + right: 240px; +} + +#g-view-menu #g-slideshow-link { + background-image: url('../images/ico-view-slideshow-rtl.png'); +} + +#g-sidebar .g-block-content { + padding-right: 1em; + padding-left: 0; +} + +#g-footer #g-credits li { + padding-left: 1.2em !important; + padding-right: 0; +} + +/* Browny ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.g-even { + text-align: left; +} + +.g-odd { + text-align: right; +} + +.uploadifyQueueItem .cancel { + float: left; +} + +#g-user-profile .g-block h2 { + padding-right: .8em; + padding-left: auto; +} + +#g-user-profile .g-avatar { + float: right; + right: 0em; + left: auto; + margin: 0em .6em 0em 0em; +} + +#g-user-profile #g-comment-detail .g-author a { + float: right; + right: 0em; + left: auto; + margin-left: .6em; + margin-right: 0em; +} + +#g-user-profile #g-comment-detail div { + margin-right: 5em; + margin-left: 0em; +} + +#g-user-profile h1 { + margin: 1.25em 4.4em 2em 0em; +} + +#g-content #g-comments .g-avatar { + float: right; + margin-left: .4em; + margin-right: 0; +} + +#g-calendar-grid { + padding-right: 8px; + padding-left: 0px; +} + diff --git a/3.0/themes/browny_wind/css/screen.css b/3.0/themes/browny_wind/css/screen.css index ddd593a6..1539dadb 100644 --- a/3.0/themes/browny_wind/css/screen.css +++ b/3.0/themes/browny_wind/css/screen.css @@ -4,21 +4,28 @@ * @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) States and interactions - * 6) Positioning and order - * 7) Navigation and menus - * 8) ThemeRoller - * 9) jQuery and jQuery UI - * 10) Right-to-left language styles - * 11) More Browny + * 0) Pre Overrides + * 1) Font sizes, base HTML elements + * 2) Reusable content blocks + * 3) Page layout containers + * 4) Content blocks in specific layout containers + * 5) States and interactions + * 6) Positioning and order + * 7) Navigation and menus + * 8) jQuery and jQuery UI + * 9) More Browny */ /** ******************************************************************* - * 1) Font sizes, base HTML elements + * 0) Pre Overrides + **********************************************************************/ + +/* ThemeRoller overrides ~~~~~~~~~~~~~~ */ + +@import "themeroller/ui.tabs.css"; + +/** ******************************************************************* + * 1) Font sizes, base HTML elements **********************************************************************/ /* ~browny~ */ @@ -39,6 +46,13 @@ body, html { font-family: Cursive, Serif; } +select, +input, +button, +textarea { + font: 99% 'Century gothic', Verdana, Arial, Helvetica, Clean, sans-serif; +} + p { margin-bottom: 1em; text-shadow: 0px 1px 1px #F7F5F0; @@ -100,13 +114,6 @@ h3 { font-size: .7em; } -select, -input, -button, -textarea { - font: 99% 'Century gothic', Verdana, Arial, Helvetica, Clean, sans-serif; -} - #l10n-client h2 { text-shadow: none; } @@ -144,7 +151,25 @@ a:hover, padding-left: 32px; } +/* Lists ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +ul.g-text li, +.g-text ul li { + list-style-type: disc; +} + +ol.g-text li, +.g-text ol li { + list-style-type: decimal; +} + +.g-text li, +.g-text li { + margin-left: 1em; +} + /* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + form { margin: 0; } @@ -335,6 +360,7 @@ td { } /* Text ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + .g-text-small { font-size: .8em; } @@ -348,7 +374,7 @@ td { } /** ******************************************************************* - * 2) Reusable content blocks + * 2) Reusable content blocks *********************************************************************/ /* ~browny~ */ @@ -362,10 +388,11 @@ td { } /*** ****************************************************************** - * 3) Page layout containers + * 3) Page layout containers *********************************************************************/ /* Dimension and scale ~~~~~~~~~~~~~~~~~~~ */ + .g-one-quarter { width: 25%; } @@ -434,7 +461,7 @@ td { } /** ******************************************************************* - * 4) Content blocks in specific layout containers + * 4) Content blocks in specific layout containers *********************************************************************/ /* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ @@ -562,7 +589,8 @@ td { background-color: #fff; } -/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + #g-edit-permissions-form td { background-image: none; } @@ -675,11 +703,11 @@ tr.g-error td.g-error, } tr.g-success { - background-image: none; + background-image: none; } tr.g-success td.g-success { - background-image: url('../images/ico-success.png'); + background-image: url('../images/ico-success.png'); } .g-warning, @@ -767,7 +795,7 @@ form .g-error { } /** ******************************************************************* - * 7) Navigation and menus + * 7) Navigation and menus *********************************************************************/ /* Login menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ @@ -869,16 +897,7 @@ form .g-error { } /** ******************************************************************* - * 8) ThemeRoller Theme - **********************************************************************/ -/* ~browny~ */ - -/* ThemeRoller overrides ~~~~~~~~~~~~~~~~~ */ - -@import "themeroller/ui.tabs.css"; - -/** ******************************************************************* - * 9) jQuery and jQuery UI + * 8) jQuery and jQuery UI *********************************************************************/ /* Generic block container ~~~~~~~~~~~~~~~ */ @@ -893,18 +912,19 @@ form .g-error { } /* Superfish menu overrides ~~~~~~~~~~~~~~ */ + .sf-menu ul { - width: 12em; + width: 12em; } ul.sf-menu li li:hover ul, ul.sf-menu li li.sfHover ul { - left: 12em; + left: 12em; } ul.sf-menu li li li:hover ul, ul.sf-menu li li li.sfHover ul { - left: 12em; + left: 12em; } /* ~browny~ */ @@ -915,13 +935,13 @@ ul.sf-menu li li li.sfHover ul { /* ~browny~ */ .sf-menu li { - background: #d3b07e url('../images/ui-bg_highlight-soft_45_d3b07e_1x100.png') 50% 50% repeat-x; - text-shadow: 0px 1px 1px #fff; + background: #d3b07e url('../images/ui-bg_highlight-soft_45_d3b07e_1x100.png') 50% 50% repeat-x; + text-shadow: 0px 1px 1px #fff; } /* ~browny~ */ .sf-menu a { - border-top: 1px solid #e0cbae; + border-top: 1px solid #e0cbae; } /* ~browny~ */ @@ -932,7 +952,7 @@ ul.sf-menu li li li.sfHover ul { /* ~browny~ */ .sf-menu li:hover, .sf-menu li.sfHover, .sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active { - background: #e0cbae; + background: #e0cbae; } /* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */ @@ -1005,11 +1025,11 @@ button { .g-progress-bar { height: 1em; width: 100%; - margin-top: .5em; + margin: .5em 0; display: inline-block; } -/* Status and validation messages ~~~~ */ +/* Status and validation messages ~~~~~~~~ */ .g-message-block { background-position: .4em .3em; @@ -1089,7 +1109,7 @@ div#g-action-status { width: 40%; } -/* Dialogs and panels ~~~~~~~~~~~~~~~~~~ */ +/* Dialogs and panels ~~~~~~~~~~~~~~~~~~~~ */ #g-dialog { text-align: left; @@ -1108,7 +1128,7 @@ div#g-action-status { padding: 1em; } -/* Inline layout ~~~~~~~~~~ */ +/* Inline layout ~~~~~~~~~~~~~~~~~~~~~~~~ */ .g-inline li { float: left; @@ -1120,338 +1140,13 @@ div#g-action-status { margin-left: 0; } -/** ******************************************************************* - * 10) Right to left language styles - *********************************************************************/ -.rtl { - direction: rtl; -} - -.rtl #g-header, -.rtl #g-content, -.rtl #g-sidebar, -.rtl #g-footer, -.rtl caption, -.rtl th, -.rtl #g-dialog, -.rtl .g-context-menu li a, -.rtl .g-message-box li, -.rtl #g-site-status li { - text-align: right; -} - -.rtl .g-text-right { - text-align: left; -} - -.rtl .g-error, -.rtl .g-info, -.rtl .g-success, -.rtl .g-warning, -.rtl #g-add-photos-status .g-success, -.rtl #g-add-photos-status .g-error { - background-position: center right; - padding-right: 30px !important; -} - -.rtl form li.g-error, -.rtl form li.g-info, -.rtl form li.g-success, -.rtl form li.g-warning { - padding-right: 0 !important; -} - -.rtl .g-left, -.rtl .g-inline li, -.rtl #g-content #g-album-grid .g-item, -.rtl .sf-menu li, -.rtl .g-breadcrumbs li, -.rtl .g-paginator li, -.rtl .g-buttonset li, -.rtl .ui-icon-left .ui-icon, -.rtl .g-short-form li, -.rtl form ul ul li, -.rtl input[type="submit"], -.rtl input[type="reset"], -.rtl input.checkbox, -.rtl input[type=checkbox], -.rtl input.radio, -.rtl input[type=radio] { - float: right; -} - -.rtl .g-right, -.rtl .ui-icon-right .ui-icon { - float: left; -} - -.rtl .g-inline li { - margin-right: 1em; -} - -.rtl .g-inline li.g-first { - margin-right: 0; -} - -/* ~browny~ */ -.rtl .g-breadcrumbs li { - background: transparent url('../images/ico-separator-rtl.gif') no-repeat scroll right center; - padding: .5em 18px .5em 8px; -} - -.rtl .g-breadcrumbs .g-first { - background: none; - padding-right: 0; -} - -.rtl input.checkbox { - margin-left: .4em; -} - -.rtl #g-add-comment { - right: inherit; - left: 0; -} - -.rtl .ui-icon-left .ui-icon { - margin-left: .2em; -} - -.rtl .ui-icon-right .ui-icon { - margin-right: .2em; -} - -/* RTL Corner radius ~~~~~~~~~~~~~~~~~~~~~~ */ -.rtl .g-buttonset .ui-corner-tl { - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - border-top-left-radius: 0; - -moz-border-radius-topright: 5px !important; - -webkit-border-top-right-radius: 5px !important; - border-top-right-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-tr { - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -moz-border-radius-topleft: 5px !important; - -webkit-border-top-left-radius: 5px !important; - border-top-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-bl { - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 5px !important; - -webkit-border-bottom-right-radius: 5px !important; - border-bottom-right-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-br { - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomleft: 5px !important; - -webkit-border-bottom-left-radius: 5px !important; - border-bottom-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-right, -.rtl .ui-progressbar .ui-corner-right { - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -moz-border-radius-topleft: 5px !important; - -webkit-border-top-left-radius: 5px !important; - border-top-left-radius: 5px !important; - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomleft: 5px !important; - -webkit-border-bottom-left-radius: 5px !important; - border-bottom-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-left, -.rtl .ui-progressbar .ui-corner-left { - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - border-top-left-radius: 0; - -moz-border-radius-topright: 5px !important; - -webkit-border-top-right-radius: 5px !important; - border-top-right-radius: 5px !important; - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 5px !important; - -webkit-border-bottom-right-radius: 5px !important; - border-bottom-right-radius: 5px !important; -} - -/* RTL Superfish ~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.rtl .sf-menu a { - border-left: none; - border-right:1px solid #fff; -} - -.rtl .sf-menu a.sf-with-ul { - padding-left: 2.25em; - padding-right: 1em; -} - -.rtl .sf-sub-indicator { - left: .75em !important; - right: auto; - background: url('../../../lib/superfish/images/arrows-ffffff-rtl.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */ -} -.rtl a > .sf-sub-indicator { /* give all except IE6 the correct values */ - top: .8em; - background-position: -10px -100px; /* use translucent arrow for modern browsers*/ -} -/* apply hovers to modern browsers */ -.rtl a:focus > .sf-sub-indicator, -.rtl a:hover > .sf-sub-indicator, -.rtl a:active > .sf-sub-indicator, -.rtl li:hover > a > .sf-sub-indicator, -.rtl li.sfHover > a > .sf-sub-indicator { - background-position: 0 -100px; /* arrow hovers for modern browsers*/ -} - -/* point right for anchors in subs */ -.rtl .sf-menu ul .sf-sub-indicator { background-position: 0 0; } -.rtl .sf-menu ul a > .sf-sub-indicator { background-position: -10px 0; } -/* apply hovers to modern browsers */ -.rtl .sf-menu ul a:focus > .sf-sub-indicator, -.rtl .sf-menu ul a:hover > .sf-sub-indicator, -.rtl .sf-menu ul a:active > .sf-sub-indicator, -.rtl .sf-menu ul li:hover > a > .sf-sub-indicator, -.rtl .sf-menu ul li.sfHover > a > .sf-sub-indicator { - background-position: 0 0; /* arrow hovers for modern browsers*/ -} - -.rtl .sf-menu li:hover ul, -.rtl .sf-menu li.sfHover ul { - right: 0; - left: auto; -} - -.rtl ul.sf-menu li li:hover ul, -.rtl ul.sf-menu li li.sfHover ul { - right: 12em; /* match ul width */ - left: auto; -} -.rtl ul.sf-menu li li li:hover ul, -.rtl ul.sf-menu li li li.sfHover ul { - right: 12em; /* match ul width */ - left: auto; -} - -/*** shadows for all but IE6 ***/ -.rtl .sf-shadow ul { - background: url('../../../lib/superfish/images/shadow.png') no-repeat bottom left; - padding: 0 0 9px 8px; - border-top-right-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-topright: 0; - -moz-border-radius-bottomleft: 0; - -webkit-border-top-right-radius: 0; - -webkit-border-bottom-left-radius: 0; - -moz-border-radius-topleft: 17px; - -moz-border-radius-bottomright: 17px; - -webkit-border-top-left-radius: 17px; - -webkit-border-bottom-right-radius: 17px; - border-top-left-radius: 17px; - border-bottom-right-radius: 17px; -} - -/* RTL ThemeRoller ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.rtl .ui-dialog .ui-dialog-titlebar { - padding: 0.5em 1em 0.3em 0.3em; -} - -.rtl .ui-dialog .ui-dialog-title { - float: right; -} - -.rtl .ui-dialog .ui-dialog-titlebar-close { - left: 0.3em; - right: auto; -} - - -/* RTL paginator ~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.rtl .g-paginator .g-info { - width: 35%; -} - -.rtl .g-paginator .g-text-right { - margin-left: 0; -} - -.rtl .g-paginator .ui-icon-seek-end { - background-position: -80px -160px; -} - -.rtl .g-paginator .ui-icon-seek-next { - background-position: -48px -160px; -} - -.rtl .g-paginator .ui-icon-seek-prev { - background-position: -32px -160px; -} - -.rtl .g-paginator .ui-icon-seek-first { - background-position: -64px -160px; -} - -.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: 240px; -} - -.rtl #g-view-menu #g-slideshow-link { - background-image: url('../images/ico-view-slideshow-rtl.png'); -} - -.rtl #g-sidebar .g-block-content { - padding-right: 1em; - padding-left: 0; -} - -.rtl #g-footer #g-credits li { - padding-left: 1.2em !important; - padding-right: 0; -} - -/* ~browny~ */ -.rtl .g-even { - text-align: left; -} - -/* ~browny~ */ -.rtl .g-odd { - text-align: right; +/* Autocomplete ~~~~~~~~~~~~~~~~~~~~~~~~~ */ +.ac_loading { + background: white url('../images/loading-small.gif') right center no-repeat !important; } /** ******************************************************************* - * 11) More Browny (Extra overrides for better Browny look) + * 9) More Browny (Extra overrides for better Browny look) *********************************************************************/ /* ~browny~ */ @@ -1478,10 +1173,6 @@ div#g-action-status { background-color: #FAFAEB !important; } -.rtl .uploadifyQueueItem .cancel { - float: left; -} - .uploadifyQueue { margin-top: 1em; } @@ -1533,35 +1224,6 @@ div#g-action-status { margin-bottom: .5em; } -.rtl #g-user-profile .g-block h2 { - padding-right: .8em; - padding-left: auto; -} - -.rtl #g-user-profile .g-avatar { - float: right; - right: 0em; - left: auto; - margin: 0em .6em 0em 0em; -} - -.rtl #g-user-profile #g-comment-detail .g-author a { - float: right; - right: 0em; - left: auto; - margin-left: .6em; - margin-right: 0em; -} - -.rtl #g-user-profile #g-comment-detail div { - margin-right: 5em; - margin-left: 0em; -} - -.rtl #g-user-profile h1 { - margin: 1.25em 4.4em 2em 0em; -} - /* Comments ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #g-content #g-comments .g-avatar { @@ -1570,12 +1232,6 @@ div#g-action-status { margin-left: 0; } -.rtl #g-content #g-comments .g-avatar { - float: right; - margin-left: .4em; - margin-right: 0; -} - /* Organize ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #g-organize { @@ -1609,11 +1265,6 @@ table.calendar td:hover { background: #EDE4D5 !important; } -.rtl #g-calendar-grid { - padding-right: 8px; - padding-left: 0px; -} - #g-view-menu #g-calendarview-link { background-image: url('../images/ico-view-calendarview.png') !important; } diff --git a/3.0/themes/browny_wind/js/ui.init.js b/3.0/themes/browny_wind/js/ui.init.js index 2c67bf3a..3ee3e32e 100644 --- a/3.0/themes/browny_wind/js/ui.init.js +++ b/3.0/themes/browny_wind/js/ui.init.js @@ -82,7 +82,7 @@ $(document).ready(function() { } else { var sib_height = $(this).prev().height(); } - if ($.browser.msie && $.browser.version >= 8) { + if ($.browser.msie && $.browser.version <= 8) { sib_height = sib_height + 1; } $(this).css("height", sib_height); diff --git a/3.0/themes/browny_wind/theme.info b/3.0/themes/browny_wind/theme.info index 85a25c8f..8ec9f1a2 100644 --- a/3.0/themes/browny_wind/theme.info +++ b/3.0/themes/browny_wind/theme.info @@ -1,10 +1,10 @@ name = "Browny Wind" description = "The default Wind theme with a browny style." version = 1 -author = "Ma'moun M. Diraneyya" +author = "Mamouneyya" site = 1 admin = 0 -author_name = "" +author_name = "Ma'moun Diraneyya" author_url = "" info_url = "http://codex.gallery2.org/Gallery3:Themes:browny_wind" -discuss_url = "http://gallery.menalto.com/forum_theme_browny_wind" +discuss_url = "http://gallery.menalto.com/node/95007" diff --git a/3.0/themes/browny_wind/views/no_sidebar.html.php b/3.0/themes/browny_wind/views/no_sidebar.html.php index a9eb0e3e..58c57256 100644 --- a/3.0/themes/browny_wind/views/no_sidebar.html.php +++ b/3.0/themes/browny_wind/views/no_sidebar.html.php @@ -1,6 +1,11 @@
      -
    • -
      "> +
    • + + + + + + ">
    diff --git a/3.0/themes/browny_wind/views/page.html.php b/3.0/themes/browny_wind/views/page.html.php index 5e4040bd..f0ee5b5f 100644 --- a/3.0/themes/browny_wind/views/page.html.php +++ b/3.0/themes/browny_wind/views/page.html.php @@ -1,50 +1,43 @@ - +html_attributes() ?> xml:lang="en" lang="en"> + start_combining("script,css") ?> <? if ($page_title): ?> <?= $page_title ?> <? else: ?> <? if ($theme->item()): ?> - <? if ($theme->item()->is_album()): ?> - <?= t("Browse Album :: %album_title", array("album_title" => $theme->item()->title)) ?> - <? elseif ($theme->item()->is_photo()): ?> - <?= t("Photo :: %photo_title", array("photo_title" => $theme->item()->title)) ?> - <? else: ?> - <?= t("Movie :: %movie_title", array("movie_title" => $theme->item()->title)) ?> - <? endif ?> + <?= $theme->item()->title ?> <? elseif ($theme->tag()): ?> - <?= t("Browse Tag :: %tag_title", array("tag_title" => $theme->tag()->name)) ?> + <?= t("Photos tagged with %tag_title", array("tag_title" => $theme->tag()->name)) ?> <? else: /* Not an item, not a tag, no page_title specified. Help! */ ?> - <?= t("Gallery") ?> + <?= item::root()->title ?> <? endif ?> <? endif ?> - " type="image/x-icon" /> - css("yui/reset-fonts-grids.css") ?> - css("superfish/css/superfish.css") ?> - css("themeroller/ui.base.css") ?> - css("screen.css") ?> - + " + type="image/x-icon" /> + " /> page_type == "collection"): ?> - + + + script("json2-min.js") ?> script("jquery.js") ?> script("jquery.form.js") ?> script("jquery-ui.js") ?> @@ -57,9 +50,8 @@ script("gallery.dialog.js") ?> script("superfish/js/superfish.js") ?> script("jquery.localscroll.js") ?> - script("ui.init.js") ?> - head() they get combined */ ?> + page_subtype == "photo"): ?> script("jquery.scrollTo.js") ?> script("gallery.show_full_size.js") ?> @@ -68,6 +60,26 @@ head() ?> + + + script("ui.init.js") ?> + css("yui/reset-fonts-grids.css") ?> + css("superfish/css/superfish.css") ?> + css("themeroller/ui.base.css") ?> + css("screen.css") ?> + + css("screen-rtl.css") ?> + + + + + get_combined("css") ?> + + + get_combined("script") ?> body_attributes() ?>> @@ -80,7 +92,7 @@ user_menu() ?> diff --git a/3.0/themes/pear4gallery3/.gitignore b/3.0/themes/pear4gallery3/.gitignore new file mode 100644 index 00000000..5b4346fd --- /dev/null +++ b/3.0/themes/pear4gallery3/.gitignore @@ -0,0 +1,2 @@ +icons/depricated +temp/ diff --git a/3.0/themes/pear4gallery3/admin/controllers/admin_theme_options.php b/3.0/themes/pear4gallery3/admin/controllers/admin_theme_options.php new file mode 100644 index 00000000..0befe51b --- /dev/null +++ b/3.0/themes/pear4gallery3/admin/controllers/admin_theme_options.php @@ -0,0 +1,369 @@ + +load_theme_info(); + return ($theme_info->version); + } + + private function get_theme_name() { + $theme_info = $this->load_theme_info(); + return ($theme_info->name); + } + + private function prerequisite_check($group, $id, $is_ok, $caption, $caption_ok, $caption_failed, $iswarning, $msg_error) { + $confirmation_caption = ($is_ok)? $caption_ok : $caption_failed; + $checkbox = $group->checkbox($id) + ->label($caption . " " . $confirmation_caption) + ->checked($is_ok) + ->disabled(true); + if ($is_ok): + $checkbox->class("g-success"); + elseif ($iswarning): + $checkbox->class("g-prerequisite g-warning")->error_messages("failed", $msg_error)->add_error("failed", 1); + else: + $checkbox->class("g-error")->error_messages("failed", $msg_error)->add_error("failed", 1); + endif; + } + + /* Convert old values ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + protected function upgrade_settings() { + if (module::get_var("th_pear4gallery3", "show_logo")): + module::clear_var("th_pear4gallery3", "show_logo"); + module::set_var("th_pear4gallery3", "hide_logo", FALSE); + endif; + if (module::get_var("th_pear4gallery3", "show_sidebar")): + module::clear_var("th_pear4gallery3", "show_sidebar"); + module::set_var("th_pear4gallery3", "sidebar_view", "toggle"); + endif; + } + + protected function get_edit_form_admin() { + $this->upgrade_settings(); + + $form = new Forge("admin/theme_options/save/", "", null, array("id" =>"g-theme-options-form")); + +// Just commenting out, we might want rssmodule in future versions. +// $rssmodulecheck = (module::is_active("rss") && module::info("rss")); + + /* Prerequisites ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + + $group = $form->group("requirements")->label(t("Prerequisites")); + $gallery_ver = module::get_version("gallery"); + $this->prerequisite_check($group, "vercheck", $gallery_ver >= $this->min_gallery_ver, + t("Gallery 3 Core v.") . $this->min_gallery_ver . "+", t("Installed"), t("Required"), FALSE, sprintf(t("Check Failed. Minimum Required Version is %s. Found %s."), $this->min_gallery_ver, $gallery_ver)); + $this->prerequisite_check($group, "square_thumbs", (module::is_active("square_thumbs") and module::info("square_thumbs")), + t("Square Thumbnails"), t("Found"), t("Required"), FALSE, t("Install Square Thumbnails to display Thumbs correctly.")); + if (!module::get_var("th_pear4gallery3", "hide_thumbmeta")): + $this->prerequisite_check($group, "info", (module::is_active("info") and module::info("info")), + t("Info Module"), t("Found"), t("Required"), FALSE, t("Check Failed. Module is required to display Thumb metadata.")); + endif; + + /* General Settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + + $group = $form->group("edit_theme")->label(t("General Settings")); + $group->input("favicon") + ->label(t("URL (relative path) to your favicon.ico")) + ->value(module::get_var("gallery", "favicon_url")); + $group->input("appletouchicon") + ->label(t("URL (relative path) to apple-touch-icon.png")) + ->value(module::get_var("gallery", "appletouchicon_url")); + $group->input("logo_path") + ->label(t("URL (relative path) to custom logo")) + ->value(module::get_var("gallery", "logo_path")); + $group->input("slideshow_time") + ->label(t("Slideshow timeout (in ms)")) + ->value(module::get_var("th_pear4gallery3", "slideshow_time", "5000")); + + /* Advanced Options - General ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + + $group = $form->group("edit_theme_adv_main")->label(t("Advanced Options - General")); + $group->checkbox("hide_item_count") + ->label(t("Hide Album Count")) + ->checked(module::get_var("th_pear4gallery3", "hide_item_count")); + $group->checkbox("hide_logo") + ->label(t("Hide Bottom Pear Logo")) + ->checked(module::get_var("th_pear4gallery3", "hide_logo")); + $group->dropdown("mainmenu_view") + ->label(t("Main page View")) + ->options(array("grid" => t("Grid (Default)"), "mosaic" => t("Mosaic"), "carousel" => t("Carousel"))) + ->selected(module::get_var("th_pear4gallery3", "mainmenu_view")); + $group->checkbox("show_guest_menu") + ->label(t("Show Main Menu for Guest Users")) + ->checked(module::get_var("th_pear4gallery3", "show_guest_menu")); + $group->dropdown("background") + ->label(t("Background color")) + ->options(array("black" => t("Black (Default)"), "dkgrey" => t("Dark-Grey"), "ltgrey" => t("Light-Grey"), "white" => t("White"))) + ->selected(module::get_var("th_pear4gallery3", "background")); + $group->checkbox("show_breadcrumbs") + ->label(t("Show breadcrumbs for navigation.")) + ->checked(module::get_var("th_pear4gallery3", "show_breadcrumbs")); + $group->dropdown("sidebar_view") + ->label(t("Show Sidebar mode")) + ->options(array("hidden" => t("Hidden (Default)"), "static" => t("Always visible"), "toggle" => t("Hover"), "button" => t("Togglable via button"))) + ->selected(module::get_var("th_pear4gallery3", "sidebar_view")); + $group->input("ga_code") + ->label(t("Google analytics code.")) + ->value(module::get_var("th_pear4gallery3", "ga_code")); + $group->input("skimm_lim") + ->label(t("Limit amount of thumbs in album skimming")) + ->value(module::get_var("th_pear4gallery3", "skimm_lim", "50")); + + /* Advanced Options - Mosaic page ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + + $group = $form->group("edit_theme_adv_mosaic")->label(t("Advanced Options - Mosaic Page")); + $group->dropdown("mosaic_effect") + ->label(t("Effect of image transition")) + ->options(array( + "blind" => t("Blinds the element away and shows it by blinding it in. (default)"), + "clip" => t("Clips the element on and off, vertically"), + "drop" => t("Drops the element away and shows it by dropping it in"), + "explode" => t("Explodes the element into multiple pieces"), + "fade" => t("Fades the element, by gradually changing its opacity"), + "fold" => t("Folds the element like a piece of paper"), + "puff" => t("Scale and fade out animations create the puff effect"), + "slide" => t("Slides the element out of the viewport"), + "scale" => t("Shrink and grow an element"), + "none" => t("Disable effects (faster switching)"))) + ->selected(module::get_var("th_pear4gallery3", "mosaic_effect", "blind")); +/* + $group->dropdown("photo_descmode") + ->label(t("Description Display Mode")) + ->options(array("overlay_top" => t("Overlay Top"), "overlay_bottom" => t("Overlay Bottom"), "bottom" => t("Bottom"), "top" => t("Top"), "hide" => t("Hide"))) + ->selected(module::get_var("th_pear4gallery3", "photo_descmode")); + $group->checkbox("thumb_inpage") + ->label(t("Keep Thumb Nav Block on the side")) + ->checked(module::get_var("th_pear4gallery3", "thumb_inpage")); + if (!$thumbnavcheck): + $group->thumb_inpage->disabled(true); + endif; + $group->checkbox("hide_photometa") + ->label(t("Hide Item Meta Data")) + ->checked(module::get_var("th_pear4gallery3", "hide_photometa", TRUE)); + $group->checkbox("desc_allowbbcode") + ->label(t("Allow BBCode/HTML in Descriptions")) + ->checked(module::get_var("th_pear4gallery3", "desc_allowbbcode")); +*/ + /* Maintenance ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + + $group = $form->group("maintenance")->label(t("Maintenance")); + $group->checkbox("build_resize")->label(t("Mark all Image Resizes for Rebuild"))->checked(false); + $group->checkbox("build_thumbs")->label(t("Mark all Thumbnails for Rebuild"))->checked(false); + $group->checkbox("build_exif")->label(t("Mark Exif Info data for reload"))->checked(false); + $iptccheck = module::is_active("iptc") and module::info("iptc"); + if ($iptccheck): + $group->checkbox("build_iptc")->label(t("Mark IPTC Info data for reload"))->checked(false); + endif; + $group->checkbox("purge_cache")->label(t("Purge cache data"))->checked(false); + $group->checkbox("reset_theme")->label(t("Reset Theme to a Default State"))->checked(false); + + module::event("theme_edit_form", $form); + + $form->submit("g-theme-options-save")->value(t("Save Changes")); + + return $form; + } + + protected function get_edit_form_help() { + $help = '
    '; + $help .= 'Help
      '; + $help .= '
    • Prerequisites

      '; + + $gallery_ver = module::get_version("gallery"); + if ( $gallery_ver >= $this->min_gallery_ver && (module::is_active("square_thumbs") and module::info("square_thumbs")) && (module::is_active("info") and module::info("info")) ) + $help .= '

      Requirements are met for theme to function properly.

      '; + else + $help .= '

      Requirements need to be met for theme to function properly.

      '; + $help .= ' +
    • '; + + $help .= '
    • General Settings

      +
    • '; + + $help .= '
    • Advanced Options - General

      +
    • '; + $help .= '
    • Advanced Options - Mosaic Page

      +
    • '; + $help .= '
    • Maintenance

      +

      Without changing image size, you can Mark all Resizes for Rebuild. + Then you need to visit Admin\Maintenance to initiate the process. +

      Same can be done for image thumbs with Mark all Thumbnails for Rebuild. +

      Mark Exif/IPTC Info for reload would mark all Exif or IPTC records as "Dirty" allowing it to be repopulated. +

      And just in case you think that something is not right, you can always Reset Theme to a Default State. +

    • '; + $help .= '
    '; + return t($help); + } + + private function save_item_state($statename, $state, $value) { + if ($state): + module::set_var("th_pear4gallery3", $statename, $value); + else: + module::clear_var("th_pear4gallery3", $statename); + endif; + } + + protected function legacy() { + module::clear_var("th_pear4gallery3", "hide_item_count"); + module::clear_var("th_pear4gallery3", "hide_logo"); + module::clear_var("th_pear4gallery3", "mainmenu_view"); + module::clear_var("th_pear4gallery3", "show_guest_menu"); + module::clear_var("th_pear4gallery3", "background"); + module::clear_var("th_pear4gallery3", "show_breadcrumbs"); + module::clear_var("th_pear4gallery3", "show_sidebar"); + module::clear_var("th_pear4gallery3", "sidebar_view"); + module::clear_var("th_pear4gallery3", "ga_code"); + module::clear_var("th_pear4gallery3", "skimm_lim"); + module::clear_var("th_pear4gallery3", "mosaic_effect"); + } + + protected function reset_theme() { + // Default core theme settings + module::set_var("gallery", "page_size", 50); + module::set_var("gallery", "resize_size", 640); + module::set_var("gallery", "thumb_size", 200); + module::set_var("gallery", "header_text", ""); + module::set_var("gallery", "footer_text", ""); + module::set_var("gallery", "show_credits", FALSE); + module::clear_all_vars("th_pear4gallery3"); + module::clear_var("th_pear4gallery3", "hide_logo"); + } + + public function save() { + site_status::clear("gd_init_configuration"); + access::verify_csrf(); + + $form = self::get_edit_form_admin(); + + if ($form->validate()): + $this->legacy(); + + if ($form->maintenance->reset_theme->value): + $this->reset_theme(); + module::event("theme_edit_form_completed", $form); + message::success(t("Theme details are reset")); + else: + // * General Settings **************************************************** + + $resize_size = 800; + + $build_resize = $form->maintenance->build_resize->value; + $build_thumbs = $form->maintenance->build_thumbs->value; + $build_exif = $form->maintenance->build_exif->value; + if (module::is_active("iptc") and module::info("iptc")): + $build_iptc = $form->maintenance->build_iptc->value; + else: + $build_iptc = FALSE; + endif; + $purge_cache = $form->maintenance->purge_cache->value; + + if ($build_resize): + graphics::remove_rule("gallery", "resize", "gallery_graphics::resize"); + graphics::add_rule("gallery", "resize", "gallery_graphics::resize", + array("width" => $resize_size, "height" => $resize_size, "master" => Image::AUTO), 100); + endif; + + if (module::get_var("gallery", "resize_size") != $resize_size): + module::set_var("gallery", "resize_size", $resize_size); + endif; + + $thumb_size = 200; + $rule = Image::AUTO; + + if ($build_thumbs): + graphics::remove_rule("gallery", "thumb", "gallery_graphics::resize"); + graphics::add_rule("gallery", "thumb", "gallery_graphics::resize", + array("width" => $thumb_size, "height" => $thumb_size, "master" => $rule), 100); + endif; + + if (module::get_var("gallery", "thumb_size") != $thumb_size): + module::set_var("gallery", "thumb_size", $thumb_size); + endif; + + module::set_var("gallery", "page_size", 50); + module::set_var("gallery", "favicon_url", $form->edit_theme->favicon->value); + module::set_var("gallery", "appletouchicon_url", $form->edit_theme->appletouchicon->value); + module::set_var("gallery", "logo_path", $form->edit_theme->logo_path->value); + + $this->save_item_state("slideshow_time", $form->edit_theme->slideshow_time->value != 5000, filter_var($form->edit_theme->slideshow_time->value, FILTER_VALIDATE_INT, array('options' => array('default' => 5000, 'min_range' => 1000)))); + + // * Advanced Options - General ****************************************** + + $this->save_item_state("hide_item_count", $form->edit_theme_adv_main->hide_item_count->value, TRUE); + $this->save_item_state("hide_logo", $form->edit_theme_adv_main->hide_logo->value, TRUE); + $this->save_item_state("mainmenu_view", $form->edit_theme_adv_main->mainmenu_view->value != "grid", $form->edit_theme_adv_main->mainmenu_view->value); + $this->save_item_state("show_guest_menu",$form->edit_theme_adv_main->show_guest_menu->value, TRUE); + $this->save_item_state("background", $form->edit_theme_adv_main->background->value != "black", $form->edit_theme_adv_main->background->value); + $this->save_item_state("show_breadcrumbs",$form->edit_theme_adv_main->show_breadcrumbs->value, TRUE); + $this->save_item_state("sidebar_view",$form->edit_theme_adv_main->sidebar_view->value != "hidden", $form->edit_theme_adv_main->sidebar_view->value); + $this->save_item_state("ga_code", $form->edit_theme_adv_main->ga_code->value, $form->edit_theme_adv_main->ga_code->value); + $this->save_item_state("skimm_lim", $form->edit_theme_adv_main->skimm_lim->value != 50, $form->edit_theme_adv_main->skimm_lim->value); + + // * Advanced Options - Photo page *************************************** + $this->save_item_state("mosaic_effect", $form->edit_theme_adv_mosaic->mosaic_effect->value != "blind", $form->edit_theme_adv_mosaic->mosaic_effect->value); + /* + $this->save_item_state("photo_popupbox", $photo_popupbox != "default", $photo_popupbox); + $this->save_item_state("thumb_inpage", $form->edit_theme_adv_photo->thumb_inpage->value, TRUE); + $this->save_item_state("hide_photometa", !$form->edit_theme_adv_photo->hide_photometa->value, FALSE); + $this->save_item_state("desc_allowbbcode", $form->edit_theme_adv_photo->desc_allowbbcode->value, TRUE); +*/ + + module::event("theme_edit_form_completed", $form); + + message::success(t("Updated theme details")); + + if ($build_exif): + db::update('exif_records') + ->set(array('dirty'=>'1')) + ->execute(); + endif; + + if ($build_iptc): + db::update('iptc_records') + ->set(array('dirty'=>'1')) + ->execute(); + endif; + + if ($purge_cache): + db::build() + ->delete("caches") + ->execute(); + endif; + endif; + url::redirect("admin/theme_options"); + else: + print $this->get_admin_view(); + endif; + } + + protected function get_admin_view() { + $view = new Admin_View("admin.html"); + $view->page_title = t(".Pear Theme"); + $view->content = new View("admin_theme_options.html"); + $view->content->name = self::get_theme_name(); + $view->content->version = self::get_theme_version(); + $view->content->form = self::get_edit_form_admin(); + $view->content->help = self::get_edit_form_help(); + return $view; + } + + public function index() { + site_status::clear("gd_init_configuration"); + print $this->get_admin_view(); + } +} +?> diff --git a/3.0/themes/pear4gallery3/admin/views/admin_include.html.php b/3.0/themes/pear4gallery3/admin/views/admin_include.html.php new file mode 100644 index 00000000..7d02b05c --- /dev/null +++ b/3.0/themes/pear4gallery3/admin/views/admin_include.html.php @@ -0,0 +1,91 @@ + + + + + +version / 10, 1, '.', ''); + else: + $admin_info = new ArrayObject(parse_ini_file(THEMEPATH . $name . "/theme.info"), ArrayObject::ARRAY_AS_PROPS); + $version = $admin_info->version; + endif; +?> + +
    +
    +
    name) ?> -
    + +
    +
    + +
    +
    + +
    +
    diff --git a/3.0/themes/pear4gallery3/admin/views/admin_theme_options.html.php b/3.0/themes/pear4gallery3/admin/views/admin_theme_options.html.php new file mode 100644 index 00000000..a0894dc2 --- /dev/null +++ b/3.0/themes/pear4gallery3/admin/views/admin_theme_options.html.php @@ -0,0 +1,14 @@ + +is_module = FALSE; + $view->name = module::get_var("gallery", "active_site_theme"); + $view->form = $form; + $view->help = $help; + print $view; +?> + diff --git a/3.0/themes/pear4gallery3/controllers/pear.php b/3.0/themes/pear4gallery3/controllers/pear.php new file mode 100644 index 00000000..d231a95a --- /dev/null +++ b/3.0/themes/pear4gallery3/controllers/pear.php @@ -0,0 +1,98 @@ +url = $item->url(); + print $v; + } else { + $comments = ORM::factory("comment") + ->where("item_id", "=", $item->id) + ->where("state", "=", "published") + ->order_by("created", "ASC") + ->find_all(); + + $v = new Theme_View("comments.html", "other", "comment-fragment"); + $v->comments = $comments; + $v->item = $item; + print $v; + } + } + public function about($id){ + $item = ORM::factory("item", $id); + access::required("view", $item); + $v = new Theme_View("about.html"); + $v->item = $item; + $details = array(array("caption" => "Title", "value" => $item->title)); + if ( $item->description != $item->title) { + array_push($details, array("caption" => "Description", "value" => $item->description) ); + } + if ( isset($item->captured )) { + array_push($details, array("caption" => "Captured", "value" => date(module::get_var("gallery", "date_time_format", "Y-M-d H:i:s"), $item->captured))); + } + array_push($details, array("caption" => "Owner", "value" => $item->owner_id)); + array_push($details, array("caption" => "Filename", "value" => $item->name)); + array_push($details, array("caption" => "View count", "value" => $item->view_count)); + + $v->details = $details; + + if (module::is_active("tag")) { + $v->tags= tag::item_tags($item); + } + + print $v; + } + public function download($id){ + $item = ORM::factory("item", $id); + + // Make sure we have access to the item + if (!access::can("view", $item)) { + throw new Kohana_404_Exception(); + } + + // Make sure we have view_full access to the original + if (!access::can("view_full", $item)) { + throw new Kohana_404_Exception(); + } + + // Don't try to load a directory + if ($item->is_album()) { + throw new Kohana_404_Exception(); + } + + $file = $item->file_path(); + + if (!file_exists($file)) { + throw new Kohana_404_Exception(); + } + + header("Content-Length: " . filesize($file)); + header("Pragma: public"); + header("Content-Type: application/force-download"); + header("Content-Disposition: attachment; filename=\"$item->name\""); + + Kohana::close_buffers(false); + readfile($file); + } +} diff --git a/3.1/themes/browny_wind/css/fix-ie.css b/3.0/themes/pear4gallery3/css/fix-ie.css similarity index 67% rename from 3.1/themes/browny_wind/css/fix-ie.css rename to 3.0/themes/pear4gallery3/css/fix-ie.css index 0633ff07..602b977d 100644 --- a/3.1/themes/browny_wind/css/fix-ie.css +++ b/3.0/themes/pear4gallery3/css/fix-ie.css @@ -1,7 +1,7 @@ /** * Fix display in IE 6, 7, and 8 */ - +/* #g-banner { z-index: 2; zoom: 1; @@ -57,3 +57,21 @@ input.submit { .g-paginator .ui-icon-right { width: 60px; } +*/ +#mosaicDetailContainer { + position: static !important; +} + +#hoverView { + position: static !important; +} + +#hoverViewMenu, .hoverViewTopMenu, #hoverViewMenu > .controller, .hoverViewTopMenu > .controller { + zoom: 1; + *display: inline; +} + +#hoverviewmenu > .controller.half, .hoverViewTopMenu > .controller.half { + background-image: url('../icons/controller_half.png'); +} + diff --git a/3.0/themes/pear4gallery3/css/imageflow.packed.css b/3.0/themes/pear4gallery3/css/imageflow.packed.css new file mode 100644 index 00000000..b0c52141 --- /dev/null +++ b/3.0/themes/pear4gallery3/css/imageflow.packed.css @@ -0,0 +1 @@ +@charset "utf-8"; @media screen, projection{.imageflow{overflow:hidden; position:relative; text-align:left; visibility:hidden; width:100%}.imageflow img{border:none; position:absolute; top:0px; visibility:hidden; -ms-interpolation-mode:bicubic}.imageflow p{margin:0 auto; text-align:center}.imageflow .loading{border:1px solid white; height:15px; left:50%; margin-left:-106px; padding:5px; position:relative; visibility:visible; width:200px}.imageflow .loading_bar{background:#fff; height:15px; visibility:visible; width:1%}.imageflow .navigation{z-index:10000}.imageflow .caption{font-weight:bold; position:relative; text-align:center; z-index:10001}.imageflow .scrollbar{border-bottom:1px solid #b3b3b3; position:relative; visibility:hidden; z-index:10002; height:1px}.imageflow .slider{background:url(../icons/slider.png) no-repeat; height:14px; margin:-6px 0 0 -7px; position:absolute; width:14px; z-index:10003}.imageflow .slideshow{cursor:pointer; height:14px; margin:20px 0 0 20px; position:absolute; width:14px; z-index:10003}.imageflow .slideshow.pause{background:url(../icons/button_pause.png) no-repeat}.imageflow .slideshow.play{background:url(../icons/button_play.png) no-repeat}.imageflow .images{overflow:hidden; white-space:nowrap}.imageflow .button{cursor:pointer; height:17px; position:relative; width:17px}.imageflow .previous{background:url(../icons/button_left.png) top left no-repeat; float:left; margin:-7px 0 0 -30px}.imageflow .next{background:url(../icons/button_right.png) top left no-repeat; float:right; margin:-7px -30px 0 30px}} diff --git a/3.0/themes/pear4gallery3/css/pear.css b/3.0/themes/pear4gallery3/css/pear.css new file mode 100644 index 00000000..9fce1567 --- /dev/null +++ b/3.0/themes/pear4gallery3/css/pear.css @@ -0,0 +1,881 @@ +body { + overflow: hidden; + font-size: 10px; + color: #999 !important; + text-align: left; +} + +#loading { + background: #000 url(../icons/load.gif) no-repeat fixed 50%; + position: fixed; + height: 100%; + left: 0; + top: 0; + width: 100%; + z-index: 99998 +} + +.g-hover-item { + border: 0 solid #000; + position: relative !important; + z-index: 11 !important; + display: block; +} + +#g-place-holder { + position: absolute; + display: none; +} +.gallery-thumb { + float: left; + padding: 3px 5px 7px; + position: relative; + text-align: center; + cursor: pointer; +} + +.gallery-album { + display: block; + height: 400px; + overflow: auto; + padding-bottom: 10px; + padding-top: 10px; +} + +th, td { + padding: 0; + border-width: 0; +} + +.giInfo { + color: #888; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 9px; + height: 11px; + margin-bottom: 0; + margin-left: 12px; + margin-right: 0; + text-align: left; +} +.giTitle { + font-size: 1.1em; + font-weight: 700; + margin: .3em 3px !important; + padding: 0; + text-align: left; + height: 1.2em; + overflow: hidden; +} + +#gsNavBar div { + font-weight: 700; +} + +h2 { + font-size: 1.1em; + font-weight: bold; +} + +.center { + text-align: center !important; +} + +#g-header { + margin-top: -2px; + position: fixed; + top: 44px; + width: 100%; + z-index: 50; +} +/*Menu*/ +.sf-menu li:hover, .sf-menu li.sfHover, .sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active { + background: none repeat scroll 0 0 #333; + outline: 0 none; +} +.sf-menu li { + background: none repeat scroll 0 0 #000; + float: left; + position: relative; +} +.sf-menu li li, .sf-menu li li ul li { + background-color: #000; +} +.sf-menu ul { + background: none repeat scroll 0 0 #000; +} +.sf-menu, .sf-menu * { + list-style: none outside none; + margin: 0; + padding: 0; +} +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: #777 !important; + cursor: pointer !important; + text-decoration: none; +} +.sf-menu a, .sf-menu a:visited { + color: #555; +} +.sf-menu a { + border-left: 1px solid #333; + border-top: 1px solid #222; + padding: .75em 1em; + text-decoration: none; + display: block; + position: relative; +} +/* +.ui-state-default, .ui-widget-content .ui-state-default { +background: #ccc; +border: 1px solid #C5DBEC; +color: #555 +font-weight: bold; +outline: medium none; +} +*/ +#g-banner { + background-color: #555; + border-bottom: 1px solid #333; + min-height: 5em; + padding: 1em 20px; + position: relative; +} + +.g-paginator { + padding: 6px 15px 5px; + position: relative; + z-index: 20; +} + +.g-thumbnail { + border-radius: 5%; + /* + -webkit-box-reflect: below 0 + -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.75, transparent), to(white)); + */ +} + +.hovering > *{ + color: #2E8AE6 !important; +} + +#mosaicTable { + position: fixed; + top: 45px; + bottom: 40px; + overflow: hidden; + left: 0; + right: 0; + margin-top: 5px; +} + +#mosaicDetail { + position: absolute; + left: 0; + width: 65%; + height: 100%; + text-align: center; +} + +#mosaicDetailContainer { + margin: 0 auto; + width: 100%; + position: absolute; +} + +#mosaicImg { + cursor: pointer; +} + +#imgMenu { + position: absolute !important; + left: 10px; + right: 10px; + text-align: left; +} + +#gridContainer { + position: absolute; + right: 0; + margin: 0; + padding: 0; + height: 100%; + width: 35%; +} + +#sidebarContainer { + position: fixed; + right: 0; + overflow: none; + top: 45px; + bottom: 40px; +} +#toggleSidebar { + position: absolute; + z-index: 1; + top: 2px; + left: -18px; +} + +#sidebar { + border-left: 1px darkGrey solid; + padding: 0; + height: 100%; + overflow-y: auto; +} +#pearFlow { + width: 100%; + height: 100%; + z-index: 47; + display: none; + position: fixed; +} + +#pearFlow .imageflow { + position: absolute; +} + +.gallery-thumb-round { + background: url('../icons/rounded.png') no-repeat scroll left top; + position: absolute; + height: 200px; + width: 200px; +} + +.p-video{ + background: url('../icons/movie.png') no-repeat center; + position: absolute; + width: 200px; + height: 200px; + left: 0; + top: 0; +} + +.skimm_div { + position: absolute; +} + +.skimm_small { + position: absolute; +} + +.rNavBar{ + position: relative; + float: right; + top: -22px; + padding: 0 5px; +} + +.lNavBar{ + position: relative; + float: left; + padding: 0 5px; +} + +.pearTitle { +color: #ddd; +margin: auto; +position: relative; +text-align: center; +width: 50%; +font-variant: small-caps; +font-size: 1.7em !important; +} + +.count { +color: #666; +font-size: .7em !important; +} + +#gsNavBar { +background:transparent url('../icons/top_bar_bg.png') repeat-x 100% -12px; +position: relative; +height: 37px; +padding: 10px 0 0; +overflow: hidden; +text-shadow: 0 -1px 2px #111; +font-weight: bold; +z-index: 100; +} + +#footerWrapper { +min-width: 800px; +width: 100%; +background:transparent url('../icons/footer_bg.png') top center; +height:40px; +clear:both; +z-index: 100; +position: fixed; +left: 0; +bottom: 0; +} + +#logoButton { +display: block; +z-index: 100; +background: transparent url('../icons/pear_logo_sml.png') no-repeat center center; +width: 40px; +height: 40px; +border: 0; +margin-left: -20px; +position: absolute; +left: 50%; +cursor: pointer; /* hand-shaped cursor */ +} + + +/************************ COLOR PICKER **************************/ + + +#colorPicker { + position: relative; + color: #FFF; + height: 17px; + padding: 0 0 0 25px; + width: 136px; + float: right; + z-index: 100; + font-size: 12px; + top: 11px; +} + + + + +#colorPicker div.label { + margin-top: 2px; + margin-right: 6px; + float: left; + background-color: transparent ! important; + width: auto ! important; + height: 20px; + color: #666; + display: block; + font-size: 12px; + text-shadow: #111 0 -1px 1px; +} + +#colorPicker.disabled div.label{ + text-shadow: #242424 0 -1px 1px; + color: #3f3f3f; +} + +#colorPicker .swatch { + float: left; + background-color: #fff; + height: 15px; + width: 14px; + display: block; + margin-right: 6px; + margin-top: 2px; + cursor: pointer; +/* background-position: 0px -58px; +*/ background-color: transparent; + background-repeat: no-repeat; +} +/* +#colorPicker .hover-with-swatch, #colorPicker .swatch:hover { + background-position: -1px -37px !important; +} +*/ + + +#colorPicker .sel-with-swatch, #colorPicker .hover-with-sel-with-swatch { + cursor: default ! important; +} + +#colorPicker .disabled-with-swatch, #colorPicker.disabled-with-sel-with-swatch, #colorPicker .disabled-with-hover-with-swatch +{ +/* background-position: 0px 0px ! important; */ + cursor: default ! important; +} + +#colorPicker #black { + background-image: url('../icons/color_picker.png') ; + background-position: -1px 0; +} + +#colorPicker #black:hover { + background-position: -1px -40px; +} + +.black-with-sel-with-swatch{ + background-position: -1px -20px ! important; +} + +#colorPicker #dkgrey { + background-image: url('../icons/color_picker.png') ; + background-position: -23px 0; +} + +#colorPicker #dkgrey:hover { + background-position: -23px -40px; +} + +.dkgrey-with-sel-with-swatch{ + background-position: -23px -20px ! important; +} + +#colorPicker #ltgrey { + background-image: url('../icons/color_picker.png'); + background-position: -43px 0px; +} + +#colorPicker #ltgrey:hover { + background-position: -43px -40px; +} + +.ltgrey-with-sel-with-swatch{ + background-position: -43px -20px ! important; +} + +#colorPicker #white { + background-image: url('../icons/color_picker.png'); + background-position: -63px 0px; + margin-right: 16px; +} + +#colorPicker #white:hover { + background-position: -63px -40px; +} + +.white-with-sel-with-swatch{ + background-position: -63px -20px ! important; +} + +/************************ SLIDER VIEW **************************/ + +.sliderView { +padding: 7px 37px 7px 3%; +position: relative; +color: #FFFFFF; +top: 10px; +height: 3px; +width: 154px; +float: right; +z-index: 100; +} + +.sliderView .smaller { +height: 14px; +width: 14px; +float: left; +position: relative; +left: -24px; +top: -4px; +cursor: pointer; /* hand-shaped cursor */ +background: url('../icons/sliderView.png') -16px 0 no-repeat; +} + +.sliderView .larger { +height: 16px; +width: 16px; +float: left; +position: relative; +top: -4px; +left: 133px; +cursor: pointer; /* hand-shaped cursor */ +background: url('../icons/sliderView.png') 0 0 no-repeat; +} + +/*.sliderView .sliderLeftCap { +height: 15px; +width: 5px; +float: left; +position: relative; +left: 0px; +background: url(view_control/track_left.png) top center repeat-x; +}*/ + +.sliderView .sliderRightCap { +height: 15px; +width: 3px; +float: left; +position: relative; +left: 137px; +background: transparent url('../icons/track_fill_right.png') scroll top right no-repeat; +} + +.sliderView .track { +width: 137px; +height: 15px; +background: transparent url('../icons/track_fill_left.png') scroll top left no-repeat; +position: relative; +border: 0; +} + +.sliderView .ui-slider-handle { +background: transparent url('../icons/knob.png') top left no-repeat; +position: absolute; +top: -5px; +width: 16px; +height: 16px; +cursor: pointer; /* hand-shaped cursor */ +margin-left: -7px; +border: 0; +} + +.disabled-with-sliderView { + +} + +.disabled-with-sliderView .smaller, .disabled-with-sliderView .larger, .disabled-with-sliderView .handle{ +cursor: default; +} + +.disabled-with-sliderView .smaller { + background-image: url('../icons/view_control/smaller_dim.png'); +} + +.disabled-with-sliderView .larger { + background-image: url('../icons/view_control/larger_dim.png'); +} + +.disabled-with-sliderView .handle { + background-image: url('../icons/view_control/knob_dim.png'); +} + +.disabled-with-sliderView .sliderRightCap { + background-image: url('../icons/view_control/track_right_dim.png') +} + +.disabled-with-sliderView .track { + background-image: url('../icons/view_control/track_fill_left_dim.png') +} + + +/************************ VIEW CONTROLS **************************/ +#viewControls { + position: relative; + color: #616161; + float: left; + padding-left: 30px; + padding-top: 13px; + z-index: 800; + font-size: 12px; + text-shadow: #111 0 -1px 1px; +} + +#viewControls .label { + margin-top:-1px; +} + +#viewControls .viewSwitcher { +height: 14px; +margin-right: 17px; +float: left; +cursor: pointer; /* hand-shaped cursor */ +font-weight: bold; +} +.vs-icon { + background-image: url('../icons/viewMode.png'); + background-repeat: no-repeat; + width: 20px; + height: 15px; + display: block; + float: left; +} + +.vs-icon-grid { background-position: 0 0; } +.hover-with-viewSwitcher .vs-icon-grid, .sel-with-viewSwitcher .vs-icon-grid { background-position: 0 -15px; } +.vs-icon-mosaic { background-position: -20px 0; } +.hover-with-viewSwitcher .vs-icon-mosaic, .sel-with-viewSwitcher .vs-icon-mosaic { background-position: -20px -15px; } +.vs-icon-carousel { background-position: -40px 0; } +.hover-with-viewSwitcher .vs-icon-carousel, .sel-with-viewSwitcher .vs-icon-carousel { background-position: -40px -15px; } +.vs-icon-slideshow { background-position: -60px 0; } +.hover-with-viewSwitcher .vs-icon-slideshow, .sel-with-viewSwitcher .vs-icon-slideshow { background-position: -60px -15px; } + +#viewControls .sel-with-viewSwitcher, #viewControls .hover-with-viewSwitcher { +color: #fff; +} +#viewControls .sel-with-viewSwitcher, #viewControls .disabled { + cursor: default !important; +} + +/************************ DETAIL VIEW **************************/ + +#detailView { + margin: 0 auto; + position: fixed; + left: 0; + top: 0; + width: 100%; + height: 100%; + z-index: 999; + background-color: #000; + display: none; +} + +#detailView .iMovieVideo { + background-color: #000 ! important; +} + +.titleLabel { + color:#AAA; + font-size:13px; + font-weight:bold; +/* overflow:hidden; +*/ position:relative; + margin:10px auto; + text-align:center; + text-shadow: #000 0 0 1px; + white-space:nowrap; + height:21px; + text-overflow: ellipsis; +} + +.japanese .titleLabel { + font-size: 12px; +} + +.titleLabel:hover { +/* color: #fff;*/ +} + +#detailView .overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +; + +/* filter + +: alpha(opacity=95); + opacity: 0.95; + -moz-opacity:0.95; */ +} + +#detailView .content { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + overflow: hidden; +} + +#detailView .iMovieVideo +{ + overflow-y: auto; + overflow-x: hidden; +} + +.under-panel #detailView .content { + overflow: hidden; +} + +#detailView .imageContainer { + text-align: center; +/* margin: 69px 69px 0px 69px;*/ + margin-top: 40px; + cursor: pointer; +} + + +#slideshowView .imageContainer { + margin: 0; + padding: 0; + overflow: hidden; +} + +#slideshowView .reflectionContainer { + position: absolute; + max-height:50px; + overflow: hidden; +} + +#slideshowView .reflection { + vertical-align: top; +/* height: 20%;*/ + width: 100%; + left:0; + position: absolute; + +} + +#slideshowView .reflectionMask { + background: transparent url('../icons/reflection-black.png') repeat-x 0px bottom; + width: 100%; + height: 100%; + overflow: hidden; + display: block; + z-index: 100; + position: absolute; + vertical-align: top; + left:0; + padding-bottom: 2px ; +} + + +.bg_white #slideshowView .reflectionMask { + background-image: url('../icons/reflection-white.png'); +} + +.bg_ltgrey #slideshowView .reflectionMask { + background-image: url('../icons/reflection-lightgrey.png'); +} + + +.bg_dkgrey #slideshowView .reflectionMask { + background-image: url('../icons/reflections-darkgrey.png'); +} + + +#slideshowView #slideshowHoverView { + height:58px; +} + + +/************************ HOVER VIEW **************************/ +#hoverView, #hoverViewTop { + text-align:center; + width:100%; + position: absolute; + bottom: 20px; +} + +#hoverViewMenu, .hoverViewTopMenu { + background-color:#444; + border-radius:10px; + -webkit-border-radius:10px; + -moz-border-radius:10px; + display:inline-block; + margin-left:auto; + margin-right:auto; + padding:0 5px; + background-image:url('../icons/footer_bg.png'); + padding:4px 15px; + z-index: 40; +} + +#mosaicHover { + z-index: 30; +} +.hoverViewTopMenu { + margin: 10px; + position: absolute; + top: 0; + right: 0; +} + +#hoverViewMenu > .controller, .hoverViewTopMenu > .controller { + background-image:url('../icons/controller.png'); + background-repeat:no-repeat; + height:41px; + width:40px; + display:inline-block; + margin:5px 1px 0; + cursor: pointer; +} +.controller.disabled, .controller.disable { + cursor: default !important; +} + +#close { background-position: 0 0;} +#close:hover { background-position: 0 -41px;} +#close.disabled { background-position: 0 -82px;} + +#download { background-position:-40px 0; } +#download:hover { background-position:-40px -41px; } +#download.disabled { background-position:-40px -82px; } + +#prev { background-position:-80px 0; } +#prev:hover { background-position:-80px -41px; } +#prev.disabled { background-position:-80px -82px; } + +#pause_detail { background-position:-120px 0; } +#pause_detail:hover { background-position:-120px -41px; } +#pause_detail.disabled { background-position:-120px -82px; } + +#play_detail { background-position:-160px 0; } +#play_detail:hover { background-position:-160px -41px; } +#play_detail.disabled { background-position:-160px -82px; } + +#next { background-position:-200px 0; } +#next:hover { background-position:-200px -41px; } +#next.disabled { background-position:-200px -82px; } + +#info { background-position:-240px 0; } +#info:hover { background-position:-240px -41px; } +#info.disabled { background-position:-240px -82px; } + +#comment { background-position:-280px 0; } +#comment:hover { background-position:-280px -41px; } +#comment.disabled { background-position:-280px -82px; } + +.controller.hidden, .controller.hidden:hover { display:none !important} + +#hoverviewmenu > .controller.half, .hoverViewTopMenu > .controller.half { + background-size: 160px; + -moz-background-size: 160px; + height:20px; + width:20px; + margin: 2px 1px 0; +} + +#close .half { background-position: 0 0;} +#close.half:hover { background-position: 0 -20px;} +#close.half.disable { background-position: 0 -41px;} + +#download.half { background-position:-20px 0; } +#download.half:hover { background-position:-20px -20px; } +#download.half.disable { background-position:-20px -41px; } + +#prev.half { background-position:-40px 0; } +#prev.half:hover { background-position:-40px -20px; } +#prev.half.disable { background-position:-40px -41px; } + +#pause.half { background-position:-60px 0; } +#pause.half:hover { background-position:-60px -20px; } +#pause.half.disable { background-position:-60px -41px; } + +#play.half { background-position:-80px 0; } +#play.half:hover { background-position:-80px -20px; } +#play.half.disable { background-position:-80px -41px; } + +#next.half { background-position:-100px 0; } +#next.half:hover { background-position:-100px -20px; } +#next.half.disable { background-position:-100px -41px; } + +#info.half { background-position:-120px 0; } +#info.half:hover { background-position:-120px -20px; } +#info.half.disable { background-position:-120px -41px; } + +#comment.half { background-position:-140px 0; } +#comment.half:hover { background-position:-140px -20px; } +#comment.half.disable { background-position:-140px -41px; } + +#detail_close .half { background-position: 0 0;} +#detail_close.half:hover { background-position: 0 -20px;} +#detail_close.half.disable { background-position: 0 -41px;} + +#detail_download.half { background-position:-20px 0; } +#detail_download.half:hover { background-position:-20px -20px; } +#detail_download.half.disable { background-position:-20px -41px; } + +#detail_prev.half { background-position:-40px 0; } +#detail_prev.half:hover { background-position:-40px -20px; } +#detail_prev.half.disable { background-position:-40px -41px; } + +#detail_pause.half { background-position:-60px 0; } +#detail_pause.half:hover { background-position:-60px -20px; } +#detail_pause.half.disable { background-position:-60px -41px; } + +#detail_play.half { background-position:-80px 0; } +#detail_play.half:hover { background-position:-80px -20px; } +#detail_play.half.disable { background-position:-80px -41px; } + +#detail_next.half { background-position:-100px 0; } +#detail_next.half:hover { background-position:-100px -20px; } +#detail_next.half.disable { background-position:-100px -41px; } + +#detail_info.half { background-position:-120px 0; } +#detail_info.half:hover { background-position:-120px -20px; } +#detail_info.half.disable { background-position:-120px -41px; } + +#detail_comment.half { background-position:-140px 0; } +#detail_comment.half:hover { background-position:-140px -20px; } +#detail_comment.half.disable { background-position:-140px -41px; } + diff --git a/3.1/themes/browny_wind/css/screen.css b/3.0/themes/pear4gallery3/css/screen.css similarity index 75% rename from 3.1/themes/browny_wind/css/screen.css rename to 3.0/themes/pear4gallery3/css/screen.css index 01576252..57ac391f 100644 --- a/3.1/themes/browny_wind/css/screen.css +++ b/3.0/themes/pear4gallery3/css/screen.css @@ -1,35 +1,33 @@ /** - * Gallery 3 Browny Wind Theme Screen Styles + * 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) States and interactions - * 6) Positioning and order - * 7) Navigation and menus - * 8) ThemeRoller - * 9) jQuery and jQuery UI - * 10) Right-to-left language styles - * 11) More Browny + * 1) Font sizes, base HTML elements + * 2) Reusable content blocks + * 3) Page layout containers + * 4) Content blocks in specific layout containers + * 5) States and interactions + * 6) Positioning and order + * 7) Navigation and menus + * 8) jQuery and jQuery UI + * 9) Right-to-left language styles */ /** ******************************************************************* - * 1) Font sizes, base HTML elements + * 1) Font sizes, base HTML elements **********************************************************************/ -/* ~browny~ */ body, html { - background-color: #5a3007; - font-family: 'Century gothic', Verdana, 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; + background-color: #000; + color: #999; + font-size: 10px; + font-family: 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; } p { margin-bottom: 1em; - text-shadow: 0px 1px 1px #F7F5F0; } em { @@ -38,7 +36,6 @@ em { h1, h2, h3, h4, h5, strong, th { font-weight: bold; - text-shadow: 1px 1px 0px #fff; } h1 { @@ -64,7 +61,7 @@ h2 { #g-content, #g-site-menu, h3 { - font-size: 1.2em; + font-size: 1em; } #g-sidebar, @@ -75,11 +72,7 @@ h3 { #g-banner, #g-footer, .g-message { - font-size: .8em; -} - -#g-footer h3 { - text-shadow: 1px 1px 1px #F7F5F0; + font-size: 1em; } #g-album-grid .g-item, @@ -88,20 +81,8 @@ h3 { font-size: .7em; } -select, -input, -button, -textarea { - font: 99% 'Century gothic', Verdana, Arial, Helvetica, Clean, sans-serif; -} - -#l10n-client h2 { - text-shadow: none; -} - /* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -/* ~browny~ */ a, .g-menu a, #g-dialog a, @@ -111,7 +92,7 @@ a, a.ui-state-hover, input.ui-state-hover, button.ui-state-hover { - color: #7f5429 !important; + color: #5382bf !important; cursor: pointer !important; text-decoration: none; -moz-outline-style: none; @@ -152,6 +133,7 @@ legend { font-weight: bold; margin: 0; padding: 0 .2em; + color: #999; } #g-banner legend, @@ -160,39 +142,11 @@ input[type="hidden"] { display: none; } -input.textbox, -input[type="text"], -input[type="password"], -textarea { - border: 1px solid #e8e8e8; - border-top-color: #ccc; - border-left-color: #ccc; - clear: both; - color: #333; - width: 50%; -} - textarea { height: 12em; width: 97%; } -input:focus, -input.textbox:focus, -input[type=text]:focus, -textarea:focus, -option:focus { - background-color: #ffc; - color: #000; -} - -input.checkbox, -input[type=checkbox], -input.radio, -input[type=radio] { - float: left; - margin-right: .4em; -} /* Form layout ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ @@ -310,11 +264,11 @@ caption, th { text-align: left; } -/* ~browny~ */ + th, td { border: none; - border-bottom: 1px solid #f6f3ef; + border-bottom: 1px solid #ccc; padding: .5em; } @@ -336,12 +290,11 @@ td { } /** ******************************************************************* - * 2) Reusable content blocks + * 2) Reusable content blocks *********************************************************************/ -/* ~browny~ */ .g-block h2 { - background-color: #EDE4D5; + background-color: #e8e8e8; padding: .3em .8em; } @@ -349,8 +302,8 @@ td { margin-top: 1em; } -/*** ****************************************************************** - * 3) Page layout containers +/** ******************************************************************* + * 3) Page layout containers *********************************************************************/ /* Dimension and scale ~~~~~~~~~~~~~~~~~~~ */ @@ -388,17 +341,15 @@ td { /* Layout containers ~~~~~~~~~~~~~~~~~~~~~ */ -/* ~browny~ */ #g-header { - margin-bottom: 2em; + margin-bottom: 1em; } -/* ~browny~ */ #g-banner { - background-color: #EDE4D5; + background-color: #e8e8e8; border-bottom: 1px solid #ccc; - min-height: 9em; - padding: .5em 20px; + min-height: 5em; + padding: 1em 20px; position: relative; } @@ -413,25 +364,23 @@ td { width: 220px; } -/* ~browny~ */ #g-footer { - background-color: #EDE4D5; + background-color: #e8e8e8; border-top: 1px solid #ccc; margin-top: 20px; padding: 10px 20px; } /** ******************************************************************* - * 4) Content blocks in specific layout containers + * 4) Content blocks in specific layout containers *********************************************************************/ /* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -/* ~browny~ */ #g-banner #g-quick-search-form { clear: right; float: right; - margin-top: 1.15em; + margin-top: 1em; } #g-banner #g-quick-search-form input[type='text'] { @@ -482,9 +431,8 @@ td { margin-bottom: .6em; } -/* ~browny~ */ #g-content #g-album-grid .g-album { - background-color: #EDE4D5; + background-color: #e8e8e8; } #g-content #g-album-grid .g-album h2 span.g-album { @@ -564,7 +512,7 @@ td { } #g-permissions .g-allowed { - background-color: #fcf9ce; + background-color: #cfc; } #g-permissions .g-breadcrumbs a { @@ -655,11 +603,10 @@ tr.g-error td.g-error, background: #e8e8e8 url('../images/ico-info.png') no-repeat .4em 50%; } -/* ~browny~ */ .g-success, .g-allowed, #g-add-photos-status .g-success { - background: #fcf9ce url('../images/ico-success.png') no-repeat .4em 50%; + background: black url('../images/ico-success.png') no-repeat .4em 50%; } tr.g-success { @@ -746,35 +693,30 @@ form .g-error { background-color: #fff; } -/* ~browny~ */ .g-odd { - background-color: #EDE4D5; + background-color: #eee; } /** ******************************************************************* - * 7) Navigation and menus + * 7) Navigation and menus *********************************************************************/ /* Login menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -/* ~browny~ */ #g-banner #g-login-menu { color: #999; float: right; - padding: .5em; } -/* ~browny~ */ #g-banner #g-login-menu li { padding-left: 1.2em; } /* Site Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -/* ~browny~ */ #g-site-menu { bottom: 0; - left: 250px; + left: 140px; position: absolute; } @@ -786,14 +728,15 @@ form .g-error { .g-context-menu { background-color: #fff; - bottom: 0; + top: 0; left: 0; position: absolute; + z-index: 1; } .g-item .g-context-menu { display: none; - margin-top: 2em; + margin-top: 0em; width: 100%; } @@ -833,7 +776,7 @@ form .g-error { #g-view-menu a { background-repeat: no-repeat; background-position: 50% 50%; - height: 30px !important; + height: 28px !important; width: 43px !important; } @@ -854,24 +797,13 @@ form .g-error { } /** ******************************************************************* - * 8) ThemeRoller Theme - **********************************************************************/ -/* ~browny~ */ - -/* ThemeRoller overrides ~~~~~~~~~~~~~~~~~ */ - -@import "themeroller/ui.tabs.css"; - -/** ******************************************************************* - * 9) jQuery and jQuery UI + * 8) jQuery and jQuery UI *********************************************************************/ - /* Generic block container ~~~~~~~~~~~~~~~ */ .g-block { clear: both; margin-bottom: 2.5em; - overflow: hidden; } .g-block-content { @@ -892,60 +824,28 @@ ul.sf-menu li li li.sfHover ul { left: 12em; } -/* ~browny~ */ .sf-menu li li, .sf-menu li li ul li { - background: #d3b07e url('../images/ui-bg_highlight-soft_15_d3b07e_1x100.png') 50% 50% repeat-x; + background-color: #bdd2ff; } -/* ~browny~ */ -.sf-menu li { - background: #d3b07e url('../images/ui-bg_highlight-soft_45_d3b07e_1x100.png') 50% 50% repeat-x; - text-shadow: 0px 1px 1px #fff; -} - -/* ~browny~ */ -.sf-menu a { - border-top: 1px solid #e0cbae; -} - -/* ~browny~ */ .sf-menu li:hover { - background-color: #e0cbae; -} - -/* ~browny~ */ -.sf-menu li:hover, .sf-menu li.sfHover, -.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active { - background: #e0cbae; + background-color: #dfe9ff; } /* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */ -.ui-widget { - font-family: 'Century gothic', Verdana, 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; -} - -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { - font-family: 'Century gothic', Verdana, 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; -} - .ui-widget-overlay { background: #000; opacity: .7; } -.ui-dialog-content { - text-shadow: 0px 1px 1px #fff; -} - /* Buttons ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ .g-button { display: inline-block; margin: 0 4px 0 0; padding: .2em .4em; - text-shadow: 0px 1px 1px #fff; } .g-button, @@ -1041,11 +941,10 @@ div#g-action-status { padding: 0 20px; } -/* ~browny~ */ .g-breadcrumbs li { background: transparent url('../images/ico-separator.gif') no-repeat scroll left center; float: left; - padding: .5em 8px .5em 18px; + padding: 1em 8px 1em 18px; } .g-breadcrumbs .g-first { @@ -1065,10 +964,6 @@ div#g-action-status { /* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -.g-paginator { - padding: .2em 0; - width: 100%; -} .g-paginator li { float: left; @@ -1113,9 +1008,15 @@ div#g-action-status { margin-left: 0; } +/* Autocomplete ~~~~~~~~~~ */ +.ac_loading { + background: white url('../images/loading-small.gif') right center no-repeat !important; +} + /** ******************************************************************* - * 10) Right to left language styles + * 9) Right to left language styles *********************************************************************/ + .rtl { direction: rtl; } @@ -1186,10 +1087,9 @@ div#g-action-status { margin-right: 0; } -/* ~browny~ */ .rtl .g-breadcrumbs li { background: transparent url('../images/ico-separator-rtl.gif') no-repeat scroll right center; - padding: .5em 18px .5em 8px; + padding: 1em 18px 1em 8px; } .rtl .g-breadcrumbs .g-first { @@ -1416,7 +1316,7 @@ div#g-action-status { .rtl #g-site-menu { left: auto; - right: 240px; + right: 150px; } .rtl #g-view-menu #g-slideshow-link { @@ -1433,190 +1333,17 @@ div#g-action-status { padding-right: 0; } -/** ******************************************************************* - * 11) More Browny (Extra overrides for better Browny look) - *********************************************************************/ -/* ~browny~ */ - -/* /modules/gallery/css/gallery.css ~~~~~~ */ - -#g-add-photos-form p { - margin-bottom: .5em !important; -} - -#g-permissions .g-allowed { - background-color: #fcf9ce !important; -} - -/* /modules/gallery/css/l10n_client.css ~~ */ - -#l10n-client .labels { - background:#262626 !important; -} - -/* Uploadify ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - .uploadifyQueueItem { - border: 2px solid #EBEBDF !important; - background-color: #FAFAEB !important; + background-color: black; +} +.uploadifyError { + background-color: #FDE5DD !important; + color: black; +} +.uploadifyProgress { + background-color: black; +} +.uploadifyProgressBar { + background-color: black; } -.rtl .uploadifyQueueItem .cancel { - float: left; -} - -.uploadifyQueue { - margin-top: 1em; -} - -/* User Profile ~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-user-profile h1 { - color: #5A3007; - margin: 1.25em 0em 2em 4.4em; -} - -#g-user-profile .g-avatar { - float: left; - position: absolute; - left: 0em; - top: 1.3em; - width: 90px !important; - height: 90px !important; - margin: 0em 0em 0em .6em; -} - -#g-user-profile .g-block h2 { - background-color: #F5EFE6; - margin-bottom: .5em; - padding-left: .8em; -} - -#g-user-profile .g-block-content h2 { - background-color: transparent; - margin-bottom: inherit; -} - -#g-user-profile #g-comment-detail .g-author { - font-family: Cursive, Serif; -} - -#g-user-profile #g-comment-detail .g-author a { - float: left; - position: relative; - top: -0.3em; - left: 0em; - margin-right: .6em; -} - -#g-user-profile #g-comment-detail div { - margin-left: 5em; - line-height: 150%; -} - -#g-user-profile #g-comment-detail ul li { - border: .1em dotted #D4BE9B; - padding: .8em .5em; - margin-bottom: .5em; -} - -.rtl #g-user-profile .g-block h2 { - padding-right: .8em; - padding-left: auto; -} - -.rtl #g-user-profile .g-avatar { - float: right; - right: 0em; - left: auto; - margin: 0em .6em 0em 0em; -} - -.rtl #g-user-profile #g-comment-detail .g-author a { - float: right; - right: 0em; - left: auto; - margin-left: .6em; - margin-right: 0em; -} - -.rtl #g-user-profile #g-comment-detail div { - margin-right: 5em; - margin-left: 0em; -} - -.rtl #g-user-profile h1 { - margin: 1.25em 4.4em 2em 0em; -} - -/* Comments ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-content #g-comments .g-avatar { - float: left; - margin-right: .4em; - margin-left: 0; -} - -.rtl #g-content #g-comments .g-avatar { - float: right; - margin-left: .4em; - margin-right: 0; -} - -/* Organize ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-organize { - color: #6E3B1C !important; -} - -#g-organize-hover { - background-color: #92623C !important; -} - -#g-organize-active { - background-color: #F2EEE9 !important; -} - -/* EXIF ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-exif-data { - font-size: .85em !important; -} -.g-odd { - background: #BAAD8B !important; -} -.g-even { - background: #EDE4D5 !important; -} - -/* 3rd Party Modules ~~~~~~~~~~~~~~~~~~~~~ */ - -/* CalendarView */ -#g-calendar-grid { - margin: 8px 8px 8px 8px !important; - border: dotted #EDE4D5; - padding-left: 8px; -} - -table.calendar td:hover { - background: #EDE4D5 !important; -} - -.rtl #g-calendar-grid { - padding-right: 8px; - padding-left: 0px; -} - -#g-view-menu #g-calendarview-link { - background-image: url('../images/ico-view-calendarview.png') !important; -} - -/* DownloadFullSize */ -#g-view-menu #g-download-fullsize-link { - background-image: url('../images/ico-view-downloadfullsize.png') !important; -} - -/* DownloadAlbum */ -#g-view-menu #g-download-album-link { - background-image: url('../images/ico-view-downloadalbum.png'); -} diff --git a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_flat_25_000000_40x100.png similarity index 100% rename from 3.1/modules/highroller/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png rename to 3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_flat_25_000000_40x100.png diff --git a/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_flat_30_cccccc_40x100.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_flat_30_cccccc_40x100.png new file mode 100644 index 00000000..5473afff Binary files /dev/null and b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_flat_30_cccccc_40x100.png differ diff --git a/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_flat_50_5c5c5c_40x100.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_flat_50_5c5c5c_40x100.png new file mode 100644 index 00000000..5950a8db Binary files /dev/null and b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_flat_50_5c5c5c_40x100.png differ diff --git a/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_glass_40_ffc73d_1x400.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_glass_40_ffc73d_1x400.png new file mode 100644 index 00000000..35ec0d9d Binary files /dev/null and b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_glass_40_ffc73d_1x400.png differ diff --git a/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-hard_20_222222_1x100.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-hard_20_222222_1x100.png new file mode 100644 index 00000000..fcb59f8d Binary files /dev/null and b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-hard_20_222222_1x100.png differ diff --git a/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_33_212121_1x100.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_33_212121_1x100.png new file mode 100644 index 00000000..46cb64a7 Binary files /dev/null and b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_33_212121_1x100.png differ diff --git a/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_33_220022_1x100.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_33_220022_1x100.png new file mode 100644 index 00000000..fa0e89de Binary files /dev/null and b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_33_220022_1x100.png differ diff --git a/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_35_2b2b2b_1x100.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_35_2b2b2b_1x100.png new file mode 100644 index 00000000..424c6db3 Binary files /dev/null and b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_35_2b2b2b_1x100.png differ diff --git a/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_44_444444_1x100.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_44_444444_1x100.png new file mode 100644 index 00000000..a5c0a4d0 Binary files /dev/null and b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_44_444444_1x100.png differ diff --git a/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_80_eeeeee_1x100.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_80_eeeeee_1x100.png new file mode 100644 index 00000000..e56eefd6 Binary files /dev/null and b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-bg_highlight-soft_80_eeeeee_1x100.png differ diff --git a/3.1/modules/highroller/themes/eggplant/images/ui-icons_ffffff_256x240.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_4b8e0b_256x240.png similarity index 91% rename from 3.1/modules/highroller/themes/eggplant/images/ui-icons_ffffff_256x240.png rename to 3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_4b8e0b_256x240.png index bef5178a..3bdb67be 100644 Binary files a/3.1/modules/highroller/themes/eggplant/images/ui-icons_ffffff_256x240.png and b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_4b8e0b_256x240.png differ diff --git a/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_999999_256x240.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_999999_256x240.png new file mode 100644 index 00000000..fbdfe8df Binary files /dev/null and b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_999999_256x240.png differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-icons_8DC262_256x240.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_a83300_256x240.png similarity index 91% rename from 3.1/modules/highroller/themes/excite-bike/images/ui-icons_8DC262_256x240.png rename to 3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_a83300_256x240.png index f087a163..95993eab 100644 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-icons_8DC262_256x240.png and b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_a83300_256x240.png differ diff --git a/3.1/modules/highroller/themes/eggplant/images/ui-icons_0b54d5_256x240.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_cccccc_256x240.png similarity index 91% rename from 3.1/modules/highroller/themes/eggplant/images/ui-icons_0b54d5_256x240.png rename to 3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_cccccc_256x240.png index b4bd27f1..9254e05c 100644 Binary files a/3.1/modules/highroller/themes/eggplant/images/ui-icons_0b54d5_256x240.png and b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_cccccc_256x240.png differ diff --git a/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_ffffff_256x240.png b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_ffffff_256x240.png new file mode 100644 index 00000000..01d33934 Binary files /dev/null and b/3.0/themes/pear4gallery3/css/ui-pear-theme/images/ui-icons_ffffff_256x240.png differ diff --git a/3.1/modules/highroller/themes/eggplant/theme.css b/3.0/themes/pear4gallery3/css/ui-pear-theme/jquery-ui-1.8.17.custom.css similarity index 57% rename from 3.1/modules/highroller/themes/eggplant/theme.css rename to 3.0/themes/pear4gallery3/css/ui-pear-theme/jquery-ui-1.8.17.custom.css index 868f5b02..516a21ee 100644 --- a/3.1/modules/highroller/themes/eggplant/theme.css +++ b/3.0/themes/pear4gallery3/css/ui-pear-theme/jquery-ui-1.8.17.custom.css @@ -1,20 +1,21 @@ /* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ + * jQuery UI CSS Framework 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ /* Layout helpers ----------------------------------*/ .ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ +.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } +.ui-helper-clearfix:after { clear: both; } +.ui-helper-clearfix { zoom: 1; } .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } @@ -37,56 +38,62 @@ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - /* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=segoe%20ui,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=3px&bgColorHeader=f9f9f9&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=100&borderColorHeader=cccccc&fcHeader=e69700&iconColorHeader=5fa5e3&bgColorContent=eeeeee&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=0a82eb&bgColorDefault=1484e6&bgTextureDefault=08_diagonals_thick.png&bgImgOpacityDefault=22&borderColorDefault=ffffff&fcDefault=ffffff&iconColorDefault=fcdd4a&bgColorHover=2293f7&bgTextureHover=08_diagonals_thick.png&bgImgOpacityHover=26&borderColorHover=2293f7&fcHover=ffffff&iconColorHover=ffffff&bgColorActive=e69700&bgTextureActive=08_diagonals_thick.png&bgImgOpacityActive=20&borderColorActive=e69700&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=c5ddfc&bgTextureHighlight=07_diagonals_small.png&bgImgOpacityHighlight=25&borderColorHighlight=ffffff&fcHighlight=333333&iconColorHighlight=0b54d5&bgColorError=e69700&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=20&borderColorError=e69700&fcError=ffffff&iconColorError=ffffff&bgColorOverlay=e6b900&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=e69700&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=20&thicknessShadow=0px&offsetTopShadow=6px&offsetLeftShadow=6px&cornerRadiusShadow=3px -*/ + * jQuery UI CSS Framework 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,%20Arial,%20sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=444444&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=44&borderColorHeader=333333&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=000000&bgTextureContent=01_flat.png&bgImgOpacityContent=25&borderColorContent=555555&fcContent=ffffff&iconColorContent=cccccc&bgColorDefault=2b2b2b&bgTextureDefault=03_highlight_soft.png&bgImgOpacityDefault=35&borderColorDefault=444444&fcDefault=999999&iconColorDefault=999999&bgColorHover=212121&bgTextureHover=03_highlight_soft.png&bgImgOpacityHover=33&borderColorHover=7d7d7d&fcHover=ffffff&iconColorHover=ffffff&bgColorActive=222222&bgTextureActive=04_highlight_hard.png&bgImgOpacityActive=20&borderColorActive=44444&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=eeeeee&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=80&borderColorHighlight=cccccc&fcHighlight=000000&iconColorHighlight=4b8e0b&bgColorError=ffc73d&bgTextureError=02_glass.png&bgImgOpacityError=40&borderColorError=ffb73d&fcError=111111&iconColorError=a83300&bgColorOverlay=5c5c5c&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=50&opacityOverlay=80&bgColorShadow=cccccc&bgTextureShadow=01_flat.png&bgImgOpacityShadow=30&opacityShadow=60&thicknessShadow=7px&offsetTopShadow=-7px&offsetLeftShadow=-7px&cornerRadiusShadow=8px + */ /* Component containers ----------------------------------*/ -.ui-widget { font-family: segoe ui, Arial, sans-serif; font-size: 1.1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: segoe ui, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #aaaaaa; background: #eeeeee url(images/ui-bg_inset-hard_100_eeeeee_1x100.png) 50% bottom repeat-x; color: #222222; } -.ui-widget-content a { color: #222222; } -.ui-widget-header { border: 1px solid #cccccc; background: #f9f9f9 url(images/ui-bg_highlight-soft_100_f9f9f9_1x100.png) 50% 50% repeat-x; color: #e69700; font-weight: bold; } -.ui-widget-header a { color: #e69700; } +.ui-widget { font-family: Verdana, Arial, sans-serif; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana, Arial, sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #555555; background: #000000 url(images/ui-bg_flat_25_000000_40x100.png) 50% 50% repeat-x; color: #ffffff; } +.ui-widget-content a { color: #ffffff; } +.ui-widget-header { border: 1px solid #333333; background: #444444 url(images/ui-bg_highlight-soft_44_444444_1x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } +.ui-widget-header a { color: #ffffff; } /* Interaction states ----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #ffffff; background: #1484e6 url(images/ui-bg_diagonals-thick_22_1484e6_40x40.png) 50% 50% repeat; font-weight: bold; color: #ffffff; outline: none; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #ffffff; text-decoration: none; outline: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #2293f7; background: #2293f7 url(images/ui-bg_diagonals-thick_26_2293f7_40x40.png) 50% 50% repeat; font-weight: bold; color: #ffffff; outline: none; } -.ui-state-hover a, .ui-state-hover a:hover { color: #ffffff; text-decoration: none; outline: none; } -.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #e69700; background: #e69700 url(images/ui-bg_diagonals-thick_20_e69700_40x40.png) 50% 50% repeat; font-weight: bold; color: #ffffff; outline: none; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; outline: none; text-decoration: none; } +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #444444; background: #2b2b2b url(images/ui-bg_highlight-soft_35_2b2b2b_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #999999; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #999999; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #7d7d7d; background: #212121 url(images/ui-bg_highlight-soft_33_212121_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } +.ui-state-hover a, .ui-state-hover a:hover { color: #ffffff; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #44444; background: #222222 url(images/ui-bg_highlight-hard_20_222222_1x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; text-decoration: none; } +.ui-widget :active { outline: none; } /* Interaction Cues ----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #ffffff; background: #c5ddfc url(images/ui-bg_diagonals-small_25_c5ddfc_40x40.png) 50% 50% repeat; color: #333333; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #333333; } -.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #e69700; background: #e69700 url(images/ui-bg_diagonals-thick_20_e69700_40x40.png) 50% 50% repeat; color: #ffffff; } -.ui-state-error a, .ui-widget-content .ui-state-error a { color: #ffffff; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #ffffff; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #cccccc; background: #eeeeee url(images/ui-bg_highlight-soft_80_eeeeee_1x100.png) 50% top repeat-x; color: #000000; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #000000; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #ffb73d; background: #ffc73d url(images/ui-bg_glass_40_ffc73d_1x400.png) 50% 50% repeat-x; color: #111111; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #111111; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #111111; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } /* Icons ----------------------------------*/ /* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_0a82eb_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_0a82eb_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_5fa5e3_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_fcdd4a_256x240.png); } +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_cccccc_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_cccccc_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_999999_256x240.png); } .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } .ui-state-active .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_0b54d5_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_4b8e0b_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_a83300_256x240.png); } /* positioning */ .ui-icon-carat-1-n { background-position: 0 0; } @@ -224,6 +231,8 @@ .ui-icon-seek-next { background-position: -32px -160px; } .ui-icon-seek-prev { background-position: -48px -160px; } .ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ .ui-icon-seek-first { background-position: -80px -160px; } .ui-icon-stop { background-position: -96px -160px; } .ui-icon-eject { background-position: -112px -160px; } @@ -268,29 +277,224 @@ ----------------------------------*/ /* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; } -.ui-corner-tr { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; } -.ui-corner-br { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; } -.ui-corner-top { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; } -.ui-corner-right { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; } -.ui-corner-left { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; } -.ui-corner-all { -moz-border-radius: 3px; -webkit-border-radius: 3px; } +.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -khtml-border-top-left-radius: 6px; border-top-left-radius: 6px; } +.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; -khtml-border-top-right-radius: 6px; border-top-right-radius: 6px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; -khtml-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; -khtml-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; } /* Overlays */ -.ui-widget-overlay { background: #e6b900 url(images/ui-bg_flat_0_e6b900_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } -.ui-widget-shadow { margin: 6px 0 0 6px; padding: 0px; background: #e69700 url(images/ui-bg_flat_0_e69700_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 3px; -webkit-border-radius: 3px; }/* Accordion -----------------------------------*/ +.ui-widget-overlay { background: #5c5c5c url(images/ui-bg_flat_50_5c5c5c_40x100.png) 50% 50% repeat-x; opacity: .80;filter:Alpha(Opacity=80); } +.ui-widget-shadow { margin: -7px 0 0 -7px; padding: 7px; background: #cccccc url(images/ui-bg_flat_30_cccccc_40x100.png) 50% 50% repeat-x; opacity: .60;filter:Alpha(Opacity=60); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* + * jQuery UI Resizable 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizable#theming + */ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; } +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* + * jQuery UI Selectable 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectable#theming + */ +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } +/* + * jQuery UI Accordion 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Accordion#theming + */ +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } .ui-accordion .ui-accordion-li-fix { display: inline; } .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } -.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; } +/* + * jQuery UI Autocomplete 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete#theming + */ +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * jQuery UI Menu 1.8.17 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} +/* + * jQuery UI Button 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button#theming + */ +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ +/* + * jQuery UI Dialog 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* + * jQuery UI Slider 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider#theming + */ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* + * jQuery UI Tabs 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs#theming + */ +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } +/* + * jQuery UI Datepicker 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Datepicker#theming + */ +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } @@ -300,11 +504,10 @@ .ui-datepicker .ui-datepicker-next-hover { right:1px; } .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } .ui-datepicker select.ui-datepicker-month-year {width: 100%;} .ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } .ui-datepicker td { border: 0; padding: 1px; } @@ -323,7 +526,7 @@ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } +.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } /* RTL support */ .ui-datepicker-rtl { direction: rtl; } @@ -349,58 +552,14 @@ left: -4px; /*must have*/ width: 200px; /*must have*/ height: 200px; /*must have*/ -}/* Dialog -----------------------------------*/ -.ui-dialog { position: relative; padding: .2em; width: 300px; } -.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs -----------------------------------*/ -.ui-tabs { padding: .2em; zoom: 1; } -.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } -.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } +}/* + * jQuery UI Progressbar 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar#theming + */ +.ui-progressbar { height:2em; text-align: left; overflow: hidden; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/3.0/themes/pear4gallery3/helpers/pear4gallery3_event.php b/3.0/themes/pear4gallery3/helpers/pear4gallery3_event.php new file mode 100644 index 00000000..0034dd6f --- /dev/null +++ b/3.0/themes/pear4gallery3/helpers/pear4gallery3_event.php @@ -0,0 +1,68 @@ +query("CREATE TABLE IF NOT EXISTS {pear_album_views} ( + `id` int(9) NOT NULL auto_increment, + `album_id` int(9) NOT NULL, + `view_mode` varchar(64) NOT NULL, + PRIMARY KEY (`id`)) + DEFAULT CHARSET=utf8;"); + if (!$item->is_album()){ + return; + } else { + $pearsettings = $form->edit_item->group("pear4gallery")->label("Pear settings" . $item->id); + + $record = ORM::factory("pear_album_view")->where("album_id", "=", $item->id)->find(); + if ($record->loaded()) { + $pearsettings->dropdown("view_mode") + ->label(t("View Mode")) + ->options(array("grid" => t("Grid (Default)"), "mosaic" => t("Mosaic"), "carousel" => t("Carousel"))) + ->selected($record->view_mode); + } else { + $pearsettings->dropdown("view_mode") + ->label(t("View Mode")) + ->options(array("grid" => t("Grid (Default)"), "mosaic" => t("Mosaic"), "carousel" => t("Carousel"))) + ->selected("grid"); + } + } + } + + static function item_edit_form_completed($item, $form) { + if (!$item->is_album()){ + return; + } + $view_mode = $form->edit_item->pear4gallery->view_mode->value; + if (!(($view_mode == "mosaic") || ($view_mode == "carousel"))) { + db::build() + ->delete("pear_album_views") + ->where("album_id", "=", $item->id) + ->execute(); + } else { + $record = ORM::factory("pear_album_view")->where("album_id", "=", $item->id)->find(); + if (!$record->loaded()) { + $record->album_id = $item->id; + } + $record->view_mode = $view_mode; + $record->save(); + } + } +} diff --git a/3.0/themes/pear4gallery3/helpers/pear4gallery3_installer.php b/3.0/themes/pear4gallery3/helpers/pear4gallery3_installer.php new file mode 100644 index 00000000..58318e1b --- /dev/null +++ b/3.0/themes/pear4gallery3/helpers/pear4gallery3_installer.php @@ -0,0 +1,27 @@ + + diff --git a/3.0/themes/pear4gallery3/icons/color_picker.png b/3.0/themes/pear4gallery3/icons/color_picker.png new file mode 100644 index 00000000..d2e89ab4 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/color_picker.png differ diff --git a/3.0/themes/pear4gallery3/icons/controller.png b/3.0/themes/pear4gallery3/icons/controller.png new file mode 100644 index 00000000..9807e317 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/controller.png differ diff --git a/3.0/themes/pear4gallery3/icons/controller_half.png b/3.0/themes/pear4gallery3/icons/controller_half.png new file mode 100644 index 00000000..b4be5f71 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/controller_half.png differ diff --git a/3.0/themes/pear4gallery3/icons/download.png b/3.0/themes/pear4gallery3/icons/download.png new file mode 100644 index 00000000..998b3959 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/download.png differ diff --git a/3.0/themes/pear4gallery3/icons/email.png b/3.0/themes/pear4gallery3/icons/email.png new file mode 100644 index 00000000..0110d0d1 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/email.png differ diff --git a/3.0/themes/pear4gallery3/icons/empty_image.png b/3.0/themes/pear4gallery3/icons/empty_image.png new file mode 100644 index 00000000..466f6eff Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/empty_image.png differ diff --git a/3.0/themes/pear4gallery3/icons/footer_bg.png b/3.0/themes/pear4gallery3/icons/footer_bg.png new file mode 100644 index 00000000..88b30955 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/footer_bg.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/close.png b/3.0/themes/pear4gallery3/icons/hud_control/close.png new file mode 100644 index 00000000..30ceceae Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/close.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/close_over.png b/3.0/themes/pear4gallery3/icons/hud_control/close_over.png new file mode 100644 index 00000000..df94e509 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/close_over.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/comment.png b/3.0/themes/pear4gallery3/icons/hud_control/comment.png new file mode 100644 index 00000000..68d21088 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/comment.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/comment_over.png b/3.0/themes/pear4gallery3/icons/hud_control/comment_over.png new file mode 100644 index 00000000..1d520d7f Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/comment_over.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/controlsbg.png b/3.0/themes/pear4gallery3/icons/hud_control/controlsbg.png new file mode 100644 index 00000000..8df96ad8 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/controlsbg.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/download.png b/3.0/themes/pear4gallery3/icons/hud_control/download.png new file mode 100644 index 00000000..dc66d16d Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/download.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/download_disabled.png b/3.0/themes/pear4gallery3/icons/hud_control/download_disabled.png new file mode 100644 index 00000000..5f424c6d Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/download_disabled.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/download_over.png b/3.0/themes/pear4gallery3/icons/hud_control/download_over.png new file mode 100644 index 00000000..a1723e7d Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/download_over.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/info.png b/3.0/themes/pear4gallery3/icons/hud_control/info.png new file mode 100644 index 00000000..ffb7f7a4 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/info.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/info_over.png b/3.0/themes/pear4gallery3/icons/hud_control/info_over.png new file mode 100644 index 00000000..42ec4475 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/info_over.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/next.png b/3.0/themes/pear4gallery3/icons/hud_control/next.png new file mode 100644 index 00000000..59dc8a39 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/next.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/next_disabled.png b/3.0/themes/pear4gallery3/icons/hud_control/next_disabled.png new file mode 100644 index 00000000..2d53548a Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/next_disabled.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/next_over.png b/3.0/themes/pear4gallery3/icons/hud_control/next_over.png new file mode 100644 index 00000000..0a14880e Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/next_over.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/pause.png b/3.0/themes/pear4gallery3/icons/hud_control/pause.png new file mode 100644 index 00000000..cb6ccc06 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/pause.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/pause_over.png b/3.0/themes/pear4gallery3/icons/hud_control/pause_over.png new file mode 100644 index 00000000..104edf7d Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/pause_over.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/play.png b/3.0/themes/pear4gallery3/icons/hud_control/play.png new file mode 100644 index 00000000..babcf734 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/play.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/play_over.png b/3.0/themes/pear4gallery3/icons/hud_control/play_over.png new file mode 100644 index 00000000..873e9d0f Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/play_over.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/prev.png b/3.0/themes/pear4gallery3/icons/hud_control/prev.png new file mode 100644 index 00000000..d141070a Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/prev.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/prev_disabled.png b/3.0/themes/pear4gallery3/icons/hud_control/prev_disabled.png new file mode 100644 index 00000000..d66f83ff Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/prev_disabled.png differ diff --git a/3.0/themes/pear4gallery3/icons/hud_control/prev_over.png b/3.0/themes/pear4gallery3/icons/hud_control/prev_over.png new file mode 100644 index 00000000..fd43d3f5 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/hud_control/prev_over.png differ diff --git a/3.0/themes/pear4gallery3/icons/knob.png b/3.0/themes/pear4gallery3/icons/knob.png new file mode 100644 index 00000000..66f7d562 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/knob.png differ diff --git a/3.1/themes/browny_wind/images/loading-large.gif b/3.0/themes/pear4gallery3/icons/load.gif similarity index 86% rename from 3.1/themes/browny_wind/images/loading-large.gif rename to 3.0/themes/pear4gallery3/icons/load.gif index cc70a7a8..c2739f12 100644 Binary files a/3.1/themes/browny_wind/images/loading-large.gif and b/3.0/themes/pear4gallery3/icons/load.gif differ diff --git a/3.0/themes/pear4gallery3/icons/movie.png b/3.0/themes/pear4gallery3/icons/movie.png new file mode 100644 index 00000000..97793bb7 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/movie.png differ diff --git a/3.0/themes/pear4gallery3/icons/options_bar_bg.png b/3.0/themes/pear4gallery3/icons/options_bar_bg.png new file mode 100644 index 00000000..6184e30f Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/options_bar_bg.png differ diff --git a/3.0/themes/pear4gallery3/icons/pear_logo_lrg.png b/3.0/themes/pear4gallery3/icons/pear_logo_lrg.png new file mode 100644 index 00000000..9041a714 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/pear_logo_lrg.png differ diff --git a/3.0/themes/pear4gallery3/icons/pear_logo_sml.png b/3.0/themes/pear4gallery3/icons/pear_logo_sml.png new file mode 100644 index 00000000..d69401f9 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/pear_logo_sml.png differ diff --git a/3.0/themes/pear4gallery3/icons/reflection-black.png b/3.0/themes/pear4gallery3/icons/reflection-black.png new file mode 100644 index 00000000..5f9a7ccb Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/reflection-black.png differ diff --git a/3.0/themes/pear4gallery3/icons/reflection-darkgrey.png b/3.0/themes/pear4gallery3/icons/reflection-darkgrey.png new file mode 100644 index 00000000..662cb232 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/reflection-darkgrey.png differ diff --git a/3.0/themes/pear4gallery3/icons/reflection-lightgrey.png b/3.0/themes/pear4gallery3/icons/reflection-lightgrey.png new file mode 100644 index 00000000..89848422 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/reflection-lightgrey.png differ diff --git a/3.0/themes/pear4gallery3/icons/reflection-white.png b/3.0/themes/pear4gallery3/icons/reflection-white.png new file mode 100644 index 00000000..27e02aaf Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/reflection-white.png differ diff --git a/3.0/themes/pear4gallery3/icons/rounded.png b/3.0/themes/pear4gallery3/icons/rounded.png new file mode 100644 index 00000000..ce8e31d3 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/rounded.png differ diff --git a/3.0/themes/pear4gallery3/icons/slider.png b/3.0/themes/pear4gallery3/icons/slider.png new file mode 100644 index 00000000..ddb4995c Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/slider.png differ diff --git a/3.0/themes/pear4gallery3/icons/sliderView.png b/3.0/themes/pear4gallery3/icons/sliderView.png new file mode 100644 index 00000000..e418ea9b Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/sliderView.png differ diff --git a/3.0/themes/pear4gallery3/icons/subscribe.png b/3.0/themes/pear4gallery3/icons/subscribe.png new file mode 100644 index 00000000..470cca6e Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/subscribe.png differ diff --git a/3.0/themes/pear4gallery3/icons/top_bar_bg.png b/3.0/themes/pear4gallery3/icons/top_bar_bg.png new file mode 100644 index 00000000..a6bb0759 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/top_bar_bg.png differ diff --git a/3.0/themes/pear4gallery3/icons/track_fill_left.png b/3.0/themes/pear4gallery3/icons/track_fill_left.png new file mode 100644 index 00000000..2866db5c Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/track_fill_left.png differ diff --git a/3.0/themes/pear4gallery3/icons/upload.png b/3.0/themes/pear4gallery3/icons/upload.png new file mode 100644 index 00000000..6331c692 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/upload.png differ diff --git a/3.0/themes/pear4gallery3/icons/viewMode.png b/3.0/themes/pear4gallery3/icons/viewMode.png new file mode 100644 index 00000000..2054c833 Binary files /dev/null and b/3.0/themes/pear4gallery3/icons/viewMode.png differ diff --git a/3.0/themes/pear4gallery3/images/avatar.jpg b/3.0/themes/pear4gallery3/images/avatar.jpg new file mode 100644 index 00000000..acad9314 Binary files /dev/null and b/3.0/themes/pear4gallery3/images/avatar.jpg differ diff --git a/3.0/themes/pear4gallery3/images/ico-album.png b/3.0/themes/pear4gallery3/images/ico-album.png new file mode 100644 index 00000000..affa1b84 Binary files /dev/null and b/3.0/themes/pear4gallery3/images/ico-album.png differ diff --git a/3.1/themes/three_nids/images/ico-denied-inactive.png b/3.0/themes/pear4gallery3/images/ico-denied-inactive.png similarity index 100% rename from 3.1/themes/three_nids/images/ico-denied-inactive.png rename to 3.0/themes/pear4gallery3/images/ico-denied-inactive.png diff --git a/3.1/themes/three_nids/images/ico-denied-passive.png b/3.0/themes/pear4gallery3/images/ico-denied-passive.png similarity index 100% rename from 3.1/themes/three_nids/images/ico-denied-passive.png rename to 3.0/themes/pear4gallery3/images/ico-denied-passive.png diff --git a/3.1/themes/three_nids/images/ico-denied.png b/3.0/themes/pear4gallery3/images/ico-denied.png similarity index 100% rename from 3.1/themes/three_nids/images/ico-denied.png rename to 3.0/themes/pear4gallery3/images/ico-denied.png diff --git a/3.1/themes/browny_admin_wind/images/ico-error.png b/3.0/themes/pear4gallery3/images/ico-error.png similarity index 100% rename from 3.1/themes/browny_admin_wind/images/ico-error.png rename to 3.0/themes/pear4gallery3/images/ico-error.png diff --git a/3.1/themes/three_nids/images/ico-help.png b/3.0/themes/pear4gallery3/images/ico-help.png similarity index 100% rename from 3.1/themes/three_nids/images/ico-help.png rename to 3.0/themes/pear4gallery3/images/ico-help.png diff --git a/3.1/themes/three_nids/images/ico-info.png b/3.0/themes/pear4gallery3/images/ico-info.png similarity index 100% rename from 3.1/themes/three_nids/images/ico-info.png rename to 3.0/themes/pear4gallery3/images/ico-info.png diff --git a/3.1/themes/three_nids/images/ico-lock.png b/3.0/themes/pear4gallery3/images/ico-lock.png similarity index 100% rename from 3.1/themes/three_nids/images/ico-lock.png rename to 3.0/themes/pear4gallery3/images/ico-lock.png diff --git a/3.1/themes/three_nids/images/ico-print.png b/3.0/themes/pear4gallery3/images/ico-print.png similarity index 100% rename from 3.1/themes/three_nids/images/ico-print.png rename to 3.0/themes/pear4gallery3/images/ico-print.png diff --git a/3.1/themes/browny_admin_wind/images/ico-separator-rtl.gif b/3.0/themes/pear4gallery3/images/ico-separator-rtl.gif similarity index 100% rename from 3.1/themes/browny_admin_wind/images/ico-separator-rtl.gif rename to 3.0/themes/pear4gallery3/images/ico-separator-rtl.gif diff --git a/3.1/themes/browny_admin_wind/images/ico-separator.gif b/3.0/themes/pear4gallery3/images/ico-separator.gif similarity index 100% rename from 3.1/themes/browny_admin_wind/images/ico-separator.gif rename to 3.0/themes/pear4gallery3/images/ico-separator.gif diff --git a/3.1/themes/browny_wind/images/ico-success-inactive.png b/3.0/themes/pear4gallery3/images/ico-success-inactive.png similarity index 100% rename from 3.1/themes/browny_wind/images/ico-success-inactive.png rename to 3.0/themes/pear4gallery3/images/ico-success-inactive.png diff --git a/3.1/themes/three_nids/images/ico-success-passive.png b/3.0/themes/pear4gallery3/images/ico-success-passive.png similarity index 100% rename from 3.1/themes/three_nids/images/ico-success-passive.png rename to 3.0/themes/pear4gallery3/images/ico-success-passive.png diff --git a/3.1/themes/three_nids/images/ico-success.png b/3.0/themes/pear4gallery3/images/ico-success.png similarity index 100% rename from 3.1/themes/three_nids/images/ico-success.png rename to 3.0/themes/pear4gallery3/images/ico-success.png diff --git a/3.1/themes/three_nids/images/ico-view-comments.png b/3.0/themes/pear4gallery3/images/ico-view-comments.png similarity index 100% rename from 3.1/themes/three_nids/images/ico-view-comments.png rename to 3.0/themes/pear4gallery3/images/ico-view-comments.png diff --git a/3.1/themes/three_nids/images/ico-view-fullsize.png b/3.0/themes/pear4gallery3/images/ico-view-fullsize.png similarity index 100% rename from 3.1/themes/three_nids/images/ico-view-fullsize.png rename to 3.0/themes/pear4gallery3/images/ico-view-fullsize.png diff --git a/3.1/themes/three_nids/images/ico-view-slideshow-rtl.png b/3.0/themes/pear4gallery3/images/ico-view-slideshow-rtl.png similarity index 100% rename from 3.1/themes/three_nids/images/ico-view-slideshow-rtl.png rename to 3.0/themes/pear4gallery3/images/ico-view-slideshow-rtl.png diff --git a/3.1/themes/three_nids/images/ico-view-slideshow.png b/3.0/themes/pear4gallery3/images/ico-view-slideshow.png similarity index 100% rename from 3.1/themes/three_nids/images/ico-view-slideshow.png rename to 3.0/themes/pear4gallery3/images/ico-view-slideshow.png diff --git a/3.1/themes/browny_admin_wind/images/ico-warning.png b/3.0/themes/pear4gallery3/images/ico-warning.png similarity index 100% rename from 3.1/themes/browny_admin_wind/images/ico-warning.png rename to 3.0/themes/pear4gallery3/images/ico-warning.png diff --git a/3.1/modules/themeroller/data/images/loading-large.gif b/3.0/themes/pear4gallery3/images/loading-large.gif similarity index 100% rename from 3.1/modules/themeroller/data/images/loading-large.gif rename to 3.0/themes/pear4gallery3/images/loading-large.gif diff --git a/3.1/modules/themeroller/data/images/loading-small.gif b/3.0/themes/pear4gallery3/images/loading-small.gif similarity index 100% rename from 3.1/modules/themeroller/data/images/loading-small.gif rename to 3.0/themes/pear4gallery3/images/loading-small.gif diff --git a/3.1/themes/browny_wind/images/select-photos-backg.png b/3.0/themes/pear4gallery3/images/select-photos-backg.png similarity index 100% rename from 3.1/themes/browny_wind/images/select-photos-backg.png rename to 3.0/themes/pear4gallery3/images/select-photos-backg.png diff --git a/3.0/themes/pear4gallery3/js/gallery.ajax.js b/3.0/themes/pear4gallery3/js/gallery.ajax.js new file mode 100644 index 00000000..b1a1796e --- /dev/null +++ b/3.0/themes/pear4gallery3/js/gallery.ajax.js @@ -0,0 +1,14 @@ +(function($) { + $.widget("ui.gallery_ajax", { + _init: function() { + this.element.click(function(event) { + eval("var ajax_handler = " + $(event.currentTarget).attr("ajax_handler")); + $.getJSON($(event.currentTarget).attr("href"), function(data) { + ajax_handler(data); + }); + event.preventDefault(); + return false; + }); + } + }); +})(jQuery); diff --git a/3.0/themes/pear4gallery3/js/gallery.dialog.js b/3.0/themes/pear4gallery3/js/gallery.dialog.js new file mode 100644 index 00000000..329e5dcc --- /dev/null +++ b/3.0/themes/pear4gallery3/js/gallery.dialog.js @@ -0,0 +1,214 @@ + +(function($) { + $.widget("ui.gallery_dialog", { + _init: function() { + var self = this; + if (!self.options.immediate) { + this.element.unbind('click'); + this.element.click(function(event) { + event.preventDefault(); + self._show($(event.currentTarget).attr("href")); + return false; + }); + } else { + self._show(this.element.attr("href")); + } + }, + + _show: function(sHref) { + var self = this; + var eDialog = '
    '; + + if ($("#g-dialog").length) { + $("#g-dialog").dialog("close"); + } + $("body").append(eDialog); + + if (!self.options.close) { + self.options.close = self.close_dialog; + } + $("#g-dialog").dialog(self.options); + + $("#g-dialog").gallery_show_loading(); + + $.ajax({ + url: sHref, + type: "GET", + beforeSend: function(xhr) { + // Until we convert to jquery 1.4, we need to save the XMLHttpRequest object so that we + // can detect the mime type of the reply + this.xhrData = xhr; + }, + success: function(data, textStatus, xhr) { + // Pre jquery 1.4, get the saved XMLHttpRequest object + if (xhr == undefined) { + xhr = this.xhrData; + } + var mimeType = /^(\w+\/\w+)\;?/.exec(xhr.getResponseHeader("Content-Type")); + + var content = ""; + if (mimeType[1] == "application/json") { + data = JSON.parse(data); + content = unescape(data.html); + } else { + content = data; + } + + $("#g-dialog").html(content).gallery_show_loading(); + $("#g-add-comment,#g-dialog .showCommentForm").gallery_dialog(); + + if ($("#g-dialog form").length) { + self.form_loaded(null, $("#g-dialog form")); + } + self._layout(); + + $("#g-dialog").dialog("open"); + self._set_title(); + + if ($("#g-dialog form").length) { + self._ajaxify_dialog(); + //Possible not necessary but kept just in case. + $("#g-dialog").removeClass("g-loading-small g-loading-large"); + } + } + }); + $("#g-dialog").dialog("option", "self", self); + }, + + _layout: function() { + var dialogWidth; + var dialogHeight = $("#g-dialog").height(); + var cssWidth = new String($("#g-dialog form").css("width")); + var childWidth = cssWidth.replace(/[^0-9]/g,""); + var size = $.gallery_get_viewport_size(); + if ($("#g-dialog iframe").length && !$("#g-dialog #fb-root")) { + dialogWidth = size.width() - 100; + // Set the iframe width and height + $("#g-dialog iframe").width("100%").height(size.height() - 100); + } else if ($("#g-dialog .g-dialog-panel").length) { + dialogWidth = size.width() - 100; + $("#g-dialog").dialog("option", "height", size.height() - 100); + } else if (childWidth == "" || childWidth > 300) { + dialogWidth = 500; + } + $("#g-dialog").dialog('option', 'width', dialogWidth); + var mosaicTableH = $("#mosaicTable").height(); + if (mosaicTableH !== 0 && $("#g-dialog").height() > mosaicTableH) { + $("#g-dialog").dialog("option", "height", mosaicTableH); + } + $('#g-dialog').dialog( "option", "position", 'center' ); + }, + + form_loaded: function(event, ui) { + // Should be defined (and localized) in the theme + MSG_CANCEL = MSG_CANCEL || 'Cancel'; + var eCancel = '' + MSG_CANCEL + ''; + $("#g-dialog input[type=submit]").addClass("submit"); + if ($("#g-dialog .submit").length) { + $("#g-dialog .submit").addClass("ui-state-default ui-corner-all"); + $.fn.gallery_hover_init(); + $("#g-dialog .submit").parent().append(eCancel); + $("#g-dialog .g-cancel").click(function(event) { + $("#g-dialog").dialog("close"); + event.preventDefault(); + }); + } + $("#g-dialog textarea,#g-dialog input").addClass("ui-widget-content ui-corner-all"); + $("#g-dialog .ui-state-default").hover( + function() { + $(this).addClass("ui-state-hover"); + }, + function() { + $(this).removeClass("ui-state-hover"); + } + ); + }, + + close_dialog: function(event, ui) { + var self = $("#g-dialog").dialog("option", "self"); + if ($("#g-dialog form").length) { + self._trigger("form_closing", null, $("#g-dialog form")); + } + self._trigger("dialog_closing", null, $("#g-dialog")); + $("#g-dialog").dialog("destroy").remove(); + }, + + _ajaxify_dialog: function() { + var self = this; + $("#g-dialog form").ajaxForm({ + beforeSubmit: function(formData, form, options) { + form.find(":submit") + .addClass("ui-state-disabled") + .attr("disabled", "disabled"); + return true; + }, + beforeSend: function(xhr) { + // Until we convert to jquery 1.4, we need to save the XMLHttpRequest object so that we + // can detect the mime type of the reply + this.xhrData = xhr; + }, + success: function(data) { + if (data.html) { + $("#g-dialog").html(unescape(data.html)); + $("#g-dialog").dialog("option", "position", "center"); + $("#g-dialog form :submit").removeClass("ui-state-disabled") + .attr("disabled", null); + self._set_title(); + self._ajaxify_dialog(); + self.form_loaded(null, $("#g-dialog form")); + if (typeof data.reset == 'function') { + eval(data.reset + '()'); + } + } + if (data.result == "success") { + if (data.view && data.form) { + $("#detail_comment").click(); + return; + } + if (data.location) { + window.location = data.location; + } else { + window.location.reload(); + } + } + else { + $("#g-dialog").dialog('option', 'title', 'Error'); + if(data.form) { + $("#g-dialog").html(data.form); + self.form_loaded(null, $("#g-dialog form")); + self._ajaxify_dialog(); + } else { + $("#g-dialog").html("Something went wrong, try again later."); + } + } + $('#g-dialog').dialog( "option", "position", 'center' ); + } + }); + }, + + _set_title: function() { + // Remove titlebar for progress dialogs or set title + if ($("#g-dialog #g-progress").length) { + $(".ui-dialog-titlebar").remove(); + } else if ($("#g-dialog h1").length) { + $("#g-dialog").dialog('option', 'title', $("#g-dialog h1:eq(0)").html()); + $("#g-dialog h1:eq(0)").hide(); + } else if ($("#g-dialog fieldset legend").length) { + $("#g-dialog").dialog('option', 'title', $("#g-dialog fieldset legend:eq(0)").html()); + } + }, + + form_closing: function(event, ui) {}, + dialog_closing: function(event, ui) {} + }); + + $.extend($.ui.gallery_dialog, { + defaults: { + autoOpen: false, + autoResize: true, + modal: true, + resizable: false, + position: "center" + } + }); +})(jQuery); diff --git a/3.0/themes/pear4gallery3/js/imageflow.packed.js b/3.0/themes/pear4gallery3/js/imageflow.packed.js new file mode 100644 index 00000000..dc3f1017 --- /dev/null +++ b/3.0/themes/pear4gallery3/js/imageflow.packed.js @@ -0,0 +1,38 @@ +/* +Name: ImageFlow +Version: 1.3.0 (March 9 2010) +Author: Finn Rudolph +Support: http://finnrudolph.de/ImageFlow + +License: ImageFlow is licensed under a Creative Commons + Attribution-Noncommercial 3.0 Unported License + (http://creativecommons.org/licenses/by-nc/3.0/). + + You are free: + + to Share - to copy, distribute and transmit the work + + to Remix - to adapt the work + + Under the following conditions: + + Attribution. You must attribute the work in the manner specified by the author or licensor + (but not in any way that suggests that they endorse you or your use of the work). + + Noncommercial. You may not use this work for commercial purposes. + + + For any reuse or distribution, you must make clear to others the license terms of this work. + + Any of the above conditions can be waived if you get permission from the copyright holder. + + Nothing in this license impairs or restricts the author's moral rights. + +Credits: This script is based on Michael L. Perrys Cover flow in Javascript [1]. + The reflections are generated server-sided by a slightly hacked version + of Richard Daveys easyreflections [2] written in PHP. The mouse wheel + support is an implementation of Adomas Paltanavicius JavaScript mouse + wheel code [3]. It also uses the domReadyEvent from Tanny O'Haley [4]. + + [1] http://www.adventuresinsoftware.com/blog/?p=104#comment-1981 + [2] http://reflection.corephp.co.uk/v2.php + [3] http://adomas.org/javascript-mouse-wheel/ + [4] http://tanny.ica.com/ICA/TKO/tkoblog.nsf/dx/domcontentloaded-for-browsers-part-v +*/ + +/* ImageFlow - compressed with http://dean.edwards.name/packer/ */ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('v 4Z(){u.2v={3Q:50,2N:1.5a,2J:y,30:C,1a:y,3j:\'1E\',S:\'5u\',2h:1.0,J:4,33:\'\',2f:C,3a:0.49,36:1.0,2z:v(){B.3V=u.2i},1Y:y,1T:[10,8,6,4,2],2x:5t,2y:1d,3e:C,2M:C,3G:\'\',1N:0.5,31:y,3L:\'\',3u:0.6,2G:C,2X:\'e-5m\',1q:14,1y:y,34:5n,3k:y,3r:1,3D:C,3H:y,1g:4w};9 t=u;u.X=v(a){17(9 b 3T t.2v){u[b]=(a!==1t&&a[b]!==1t)?a[b]:t.2v[b]}9 c=B.R(t.S);7(c){c.A.1H=\'2g\';u.N=c;7(u.3N()){u.H=B.R(t.S+\'5j\');u.2j=B.R(t.S+\'4z\');u.1V=B.R(t.S+\'3X\');u.1B=B.R(t.S+\'4c\');u.1R=B.R(t.S+\'4f\');u.3x=B.R(t.S+\'4j\');u.3l=B.R(t.S+\'4s\');u.1L=B.R(t.S+\'5e\');u.1M=[];u.1w=0;u.E=0;u.1C=0;u.1D=0;u.2q=C;u.2s=C;u.T=y;9 d=u.N.3F;9 e=W.11(d/t.2N);B.R(t.S+\'2A\').A.3b=((e*0.5)-22)+\'M\';c.A.1c=e+\'M\';u.21()}}};u.3N=v(){9 a=t.D.U(\'12\',\'23\');9 b,2S,1l,15;9 c=t.N.F.1r;17(9 d=0;d1){9 i;17(i=0;i1){t.1e.X();t.I.X();t.K.X();t.2o.X();7(t.1y){t.P.X()}7(t.2G){t.1B.A.1H=\'2g\'}}}};u.2Y=v(){9 a=t.H.F.1r;9 i=0,20=0;9 b=Z;17(9 c=0;c(c.h/(t.1N+1))){c.1j=t.2x;c.26=t.2x}G{c.1j=t.2y;c.26=t.2y}7(t.2f===y){c.A.4O=\'4S\';c.A.1Z=\'4U\'}c.A.3s=t.3j;i++}}u.O=t.1M.1r;7(t.2f===y){c=t.H.F[t.1M[0]];u.3J=c.w*t.O;c.A.55=(t.Y/2)+(c.w/2)+\'M\';t.H.A.1c=c.h+\'M\';t.1V.A.1c=(t.1A-c.h)+\'M\'}7(t.2q){t.2q=y;t.E=t.3r-1;7(t.E<0){t.E=0}7(t.1a){t.E=t.E+t.J}2U=(t.1a)?(t.O-(t.J))-1:t.O-1;7(t.E>2U){t.E=2U}7(t.3D===y){t.1K(-t.E*t.1g)}7(t.3H){t.1K(5v)}}7(t.O>1){t.1J(t.E)}t.1K(t.1w)};u.1K=v(x){u.1w=x;u.1o=t.O;17(9 a=0;at.1D){b.A.1H=\'3S\';b.A.1Z=\'2H\'}G{9 z=(W.4I(4p+x*x)+1d)*t.36;9 d=x/z*t.1I+t.1I;b.A.1Z=\'4r\';9 e=(b.h/b.w*b.1j)/z*t.1I;9 f=0;1G(e>t.1A){1x y:f=b.1j/z*t.1I;13;1E:e=t.1A;f=b.w*e/b.h;13}9 g=(t.2u-e)+((e/(t.1N+1))*t.1N);b.A.2Z=d-(b.1j/2)/z*t.1I+\'M\';7(f&&e){b.A.1c=e+\'M\';b.A.1u=f+\'M\';b.A.5s=g+\'M\'}b.A.1H=\'2g\';1G(x<0){1x C:u.1o++;13;1E:u.1o=t.1o-1;13}1G(b.i==t.E){1x y:b.1k=v(){t.1J(u.i)};13;1E:u.1o=t.1o+1;7(b.2i!==\'\'){b.1k=t.2z}13}b.A.1o=t.1o}}G{7((c+t.1U)t.1D){b.A.1H=\'3S\'}G{b.A.1H=\'2g\';1G(b.i==t.E){1x y:b.1k=v(){t.1J(u.i)};13;1E:7(b.2i!==\'\'){b.1k=t.2z}13}}t.H.A.2R=(x-t.3J)+\'M\'}x+=t.1g}};u.1J=v(a){9 b,1v;7(t.1a){7(a+1===t.J){1v=t.O-t.J;b=-1v*t.1g;a=1v-1}7(a===(t.O-t.J)){1v=t.J-1;b=-1v*t.1g;a=1v+1}}9 x=-a*t.1g;u.1C=x;u.1D=x;u.E=a;9 c=t.H.F[a].1z(\'4v\');7(c===\'\'||t.30===y){c=\'&56;\'}t.2j.4e=c;7(t.I.T===y){7(t.1a){u.1b=((a-t.J)*t.1f)/(t.O-(t.J*2)-1)-t.I.2k}G{u.1b=(a*t.1f)/(t.O-1)-t.I.2k}t.1R.A.2R=(t.1b-t.1q)+\'M\'}7(t.1Y===C||t.2h!==t.2v.2h){t.D.27(t.H.F[a],t.1T[0]);t.H.F[a].1j=t.H.F[a].1j*t.2h;9 d=0;9 e=0;9 f=0;9 g=t.1T.1r;17(9 i=1;i<(t.J+1);i++){7((i+1)>g){d=t.1T[g-1]}G{d=t.1T[i]}e=a+i;f=a-i;7(e=0){t.D.27(t.H.F[f],d);t.H.F[f].1j=t.H.F[f].26}}}7(b){t.1K(b)}7(t.T===y){t.T=C;t.2E()}};u.2E=v(){1G(t.1Ct.1w+1){1x C:t.1K(t.1w+(t.1C-t.1w)/3);L.1n(t.2E,t.3Q);t.T=C;13;1E:t.T=y;13}};u.2l=v(a){7(t.1y){t.P.2c()}t.1J(a)};u.P={2n:1,X:v(){(t.3k)?t.P.1p():t.P.1h()},2c:v(){t.D.2L(t.N,\'3m\',t.P.2c);t.P.1h()},3o:v(){t.D.16(t.N,\'3m\',t.P.2c)},1p:v(){t.D.25(t.1L,\'1y 43\');t.1L.1k=v(){t.P.1h()};t.P.3t=L.47(t.P.2P,t.34);L.1n(t.P.3o,1d)},1h:v(){t.D.25(t.1L,\'1y 4b\');t.1L.1k=v(){t.P.1p()};L.4d(t.P.3t)},2P:v(){9 a=t.E+t.P.2n;9 b=y;7(a===t.O){t.P.2n=-1;b=C}7(a<0){t.P.2n=1;b=C}(b)?t.P.2P():t.1J(a)}};u.1e={X:v(){7(L.1m){t.N.1m(\'4h\',t.1e.1W,y)}t.D.16(t.N,\'4k\',t.1e.1W)},1W:v(a){9 b=0;7(!a){a=L.1F}7(a.3z){b=a.3z/4q}G 7(a.3B){b=-a.3B/3}7(b){t.1e.19(b)}t.D.2p(a)},19:v(a){9 b=y;9 c=0;7(a>0){7(t.E>=1){c=t.E-1;b=C}}G{7(t.E<(t.O-1)){c=t.E+1;b=C}}7(b){t.2l(c)}}};u.I={1P:Z,2T:0,2e:0,2k:0,T:y,X:v(){t.D.16(t.N,\'4B\',t.I.3K);t.D.16(t.N,\'3M\',t.I.1h);t.D.16(B,\'3M\',t.I.1h);t.N.4H=v(){9 a=C;7(t.I.T){a=y}V a}},1p:v(o){t.I.1P=o;t.I.2T=t.I.2e-o.3I+t.1b},1h:v(){t.I.1P=Z;t.I.T=y},3K:v(e){9 a=0;7(!e){e=L.1F}7(e.2D){a=e.2D}G 7(e.3P){a=e.3P+B.2K.3d+B.4Q.3d}t.I.2e=a;7(t.I.1P!==Z){9 b=(t.I.2e-t.I.2T)+t.1q;7(b<(-t.1b)){b=-t.1b}7(b>(t.1f-t.1b)){b=t.1f-t.1b}9 c,E;7(t.1a){c=(b+t.1b)/(t.1f/(t.O-(t.J*2)-1));E=W.11(c)+t.J}G{c=(b+t.1b)/(t.1f/(t.O-1));E=W.11(c)}t.I.2k=b;t.I.1P.A.2Z=b+\'M\';7(t.E!==E){t.2l(E)}t.I.T=C}}};u.K={x:0,2B:0,2r:0,T:y,2F:C,X:v(){t.D.16(t.1V,\'4Y\',t.K.1p);t.D.16(B,\'51\',t.K.19);t.D.16(B,\'53\',t.K.1h)},3f:v(e){9 a=y;7(e.28){9 b=e.28[0].1C;7(b===t.1V||b===t.1R||b===t.1B){a=C}}V a},2C:v(e){9 x=0;7(e.28){x=e.28[0].2D}V x},1p:v(e){t.K.2B=t.K.2C(e);t.K.T=C;t.D.2p(e)},3w:v(){9 a=y;7(t.K.T){a=C}V a},19:v(e){7(t.K.3w&&t.K.3f(e)){9 a=(t.1a)?(t.O-(t.J*2)-1):(t.O-1);7(t.K.2F){t.K.2r=(a-t.E)*(t.Y/a);t.K.2F=y}9 b=-(t.K.2C(e)-t.K.2B-t.K.2r);7(b<0){b=0}7(b>t.Y){b=t.Y}t.K.x=b;9 c=W.11(b/(t.Y/a));c=a-c;7(t.E!==c){7(t.1a){c=c+t.J}t.2l(c)}t.D.2p(e)}},1h:v(){t.K.2r=t.K.x;t.K.T=y}};u.2o={X:v(){B.5d=v(a){t.2o.19(a)}},19:v(a){9 b=t.2o.1W(a);1G(b){1x 39:t.1e.19(-1);13;1x 37:t.1e.19(1);13}},1W:v(a){a=a||L.1F;V a.5h}};u.D={16:v(a,b,c){7(a.1m){a.1m(b,c,y)}G 7(a.3g){a["e"+b+c]=c;a[b+c]=v(){a["e"+b+c](L.1F)};a.3g("3y"+b,a[b+c])}},2L:v(a,b,c){7(a.32){a.32(b,c,y)}G 7(a.3A){7(a[b+c]===1t){5r(\'D.2L » 4G 3i 3C 1F 48 1t - 4K 4l 4M 42 3i 3C 4N 4n 1F?\')}a.3A(\'3y\'+b,a[b+c]);a[b+c]=Z;a[\'e\'+b+c]=Z}},27:v(a,b){7(t.1Y===C){a.A.1Y=b/10;a.A.4P=\'4a(1Y=\'+b*10+\')\'}},U:v(a,b,c){9 d=B.4R(a);d.2d(\'38\',t.S+\'4T\'+b);7(c!==1t){b+=\' \'+c}t.D.25(d,b);V d},25:v(a,b){7(a){a.2d(\'3Z\',b);a.2d(\'4V\',b)}},2p:v(e){7(e.3E){e.3E()}G{e.4X=y}V y},3c:v(){9 a=L.2t;7(1X L.2t!=\'v\'){L.2t=v(){t.2m()}}G{L.2t=v(){7(a){a()}t.2m()}}}}}9 1i={2Q:"1i",1S:{},1s:1,1Q:y,2O:Z,3n:v(a){7(!a.$$1s){a.$$1s=u.1s++;7(u.1Q){a()}u.1S[a.$$1s]=a}},58:v(a){7(a.$$1s){4x u.1S[a.$$1s]}},18:v(){7(u.1Q){V}u.1Q=C;17(9 i 3T u.1S){u.1S[i]()}},2w:v(){7(u.1Q){V}7(/5c|4y/i.3O(4g.5f)){7(/4A|2I/.3O(B.3p)){u.18()}G{1n(u.2Q+".2w()",1d)}}G 7(B.R("2V")){V C}7(1X u.2O==="v"){7(1X B.2W!==\'1t\'&&(B.2W(\'2K\')[0]!==Z||B.2K!==Z)){7(u.2O()){u.18()}G{1n(u.2Q+".2w()",4C)}}}V C},X:v(){7(B.1m){B.1m("5k",v(){1i.18()},y)}1n("1i.2w()",1d);v 18(){1i.18()}7(1X 16!=="1t"){16(L,"3R",18)}G 7(B.1m){B.1m("3R",18,y)}G 7(1X L.2a==="v"){9 a=L.2a;L.2a=v(){1i.18();a()}}G{L.2a=18}/*@4E@7(@5o||@3Y)B.44("<3U 38=2V 54 1l=\\"//:\\"><\\/3U>");9 b=B.R("2V");b.59=v(){7(u.3p=="2I"){1i.18()}};@5b@*/}};9 5l=v(a){1i.3n(a)};1i.X();',62,342,'|||||||if||var|||||||||||||||||||||this|function|||false||style|document|true|Helper|imageID|childNodes|else|imagesDiv|MouseDrag|imageFocusMax|Touch|window|px|ImageFlowDiv|max|Slideshow|appendChild|getElementById|ImageFlowID|busy|createDocumentElement|return|Math|init|imagesDivWidth|null||round|div|break||imageNode|addEvent|for|run|handle|circular|newSliderX|height|100|MouseWheel|scrollbarWidth|xStep|stop|domReadyEvent|pc|onclick|src|addEventListener|setTimeout|zIndex|start|sliderWidth|length|domReadyID|undefined|width|clonedImageID|current|case|slideshow|getAttribute|maxHeight|scrollbarDiv|target|memTarget|default|event|switch|visibility|size|glideTo|moveTo|buttonSlideshow|indexArray|reflectionP|cloneNode|object|bDone|sliderDiv|events|opacityArray|maxFocus|navigationDiv|get|typeof|opacity|display|completed|loadingProgress||images|nodeType|setClassName|pcMem|setOpacity|touches|nodeName|onload|IMG|interrupt|setAttribute|mouseX|imageScaling|visible|imageFocusM|url|captionDiv|newX|glideOnEvent|refresh|direction|Key|suppressBrowserDefault|firstRefresh|stopX|firstCheck|onresize|imagesDivHeight|defaults|schedule|percentLandscape|percentOther|onClick|_loading_txt|startX|getX|pageX|animate|first|slider|none|complete|buttons|body|removeEvent|reflections|aspectRatio|DOMContentLoadedCustom|slide|name|marginLeft|version|objectX|maxId|__ie_onload|getElementsByTagName|sliderCursor|loadingStatus|left|captions|reflectionPNG|removeEventListener|imagePath|slideshowSpeed|button|imagesM||id||imagesHeight|paddingTop|addResizeEvent|scrollLeft|preloadImages|isOnNavigationDiv|attachEvent|createTextNode|to|imageCursor|slideshowAutoplay|buttonPreviousDiv|click|add|addInterruptEvent|readyState|02|startID|cursor|action|scrollbarP|loading|isBusy|buttonNextDiv|on|wheelDelta|detachEvent|detail|detach|glideToStartID|preventDefault|offsetWidth|reflectionGET|startAnimation|offsetLeft|totalImagesWidth|drag|reflectPath|mouseup|createStructure|test|clientX|animationSpeed|load|hidden|in|script|location|reflect|_navigation|_win64|class||next|trying|pause|write|php|navigation|setInterval|is|67|alpha|play|_scrollbar|clearInterval|innerHTML|_slider|navigator|DOMMouseScroll|firstChild|_next|mousewheel|you|marginTop|unattached|loading_bar|10000|120|block|_previous|previous|onmousedown|alt|150|delete|WebKit|_caption|loaded|mousemove|250|longdesc|cc_on|xPosition|Pointer|onselectstart|sqrt|caption|perhaps|_loading|are|an|position|filter|documentElement|createElement|relative|_|inline|className|1000|returnValue|touchstart|ImageFlow||touchmove|loading_txt|touchend|defer|paddingLeft|nbsp|scrollbar|remove|onreadystatechange|964|end|KHTML|onkeydown|_slideshow|userAgent|_loading_bar|keyCode|replaceChild|_images|DOMContentLoaded|domReady|resize|1500|_win32|img|removeChild|alert|top|118|imageflow|5000'.split('|'),0,{})); + diff --git a/3.0/themes/pear4gallery3/js/jquery-1.7.1.min.js b/3.0/themes/pear4gallery3/js/jquery-1.7.1.min.js new file mode 100644 index 00000000..198b3ff0 --- /dev/null +++ b/3.0/themes/pear4gallery3/js/jquery-1.7.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
    a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
    "+""+"
    ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
    t
    ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
    ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
    ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/3.0/themes/pear4gallery3/js/jquery-ui-1.8.17.custom.min.js b/3.0/themes/pear4gallery3/js/jquery-ui-1.8.17.custom.min.js new file mode 100644 index 00000000..991cb8d0 --- /dev/null +++ b/3.0/themes/pear4gallery3/js/jquery-ui-1.8.17.custom.min.js @@ -0,0 +1,356 @@ +/*! + * jQuery UI 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.17",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);/* + * jQuery UI Position 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1];return this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&jQuery.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);/* + * jQuery UI Draggable 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!!this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('
    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.lefth[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.toph[3]?j-this.offset.click.toph[2]?k-this.offset.click.left=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f=k&&g<=l||h>=k&&h<=l||gl)&&(e>=i&&e<=j||f>=i&&f<=j||ej);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();droppablesLoop:for(var g=0;g
    ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){c.disabled||(a(this).removeClass("ui-resizable-autohide"),b._handles.show())},function(){c.disabled||b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement);return this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),a.browser.opera&&/relative/.test(f.css("position"))&&f.css({position:"relative",top:"auto",left:"auto"}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b);return!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),ea.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){var b=this.options;if(!!this._proportionallyResizeElements.length){var c=this.helper||this.element;for(var d=0;d');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.17"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10),position:b.css("position")})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,e){a(b).each(function(){var b=a(this),f=a(this).data("resizable-alsoresize"),g={},i=e&&e.length?e:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(i,function(a,b){var c=(f[b]||0)+(h[b]||0);c&&c>=0&&(g[b]=c||null)}),a.browser.opera&&/relative/.test(b.css("position"))&&(d._revertToRelativePosition=!0,b.css({position:"absolute",top:"auto",left:"auto"})),b.css(g)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.css({position:b.data("resizable-alsoresize").position})})};d._revertToRelativePosition&&(d._revertToRelativePosition=!1,typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)),a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!!i){e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);/* + * jQuery UI Selectable 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("
    ")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy();return this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(!this.options.disabled){var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element});return!1}})}},_mouseDrag:function(b){var c=this;this.dragged=!0;if(!this.options.disabled){var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!!i&&i.element!=c.element[0]){var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.righth||i.bottome&&i.rightf&&i.bottom *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f){e=a(this);return!1}});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}this.currentItem=e,this._removeCurrentsFromItems();return!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b);return!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(b,c){if(!!b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+jf&&b+ka[this.floating?"width":"height"]?l:f0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a),this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];e||(b.style.visibility="hidden");return b},update:function(a,b){if(!e||!!d.forcePlaceholderSize)b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!!c)if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];Math.abs(j-h)this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.topthis.containment[3]?h-this.offset.click.topthis.containment[2]?i-this.offset.click.left=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");(b.autoHeight||b.fillHeight)&&c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(!(this.options.disabled||b.altKey||b.ctrlKey)){var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}if(f){a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus();return!1}return!0}},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(!d.disabled){if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return}},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!!g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;this.running||(this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data))}}),a.extend(a.ui.accordion,{version:"1.8.17",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size())b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);else{if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})}},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);/* + * jQuery UI Autocomplete 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!b.options.disabled&&!b.element.propAttr("readOnly")){d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._move("previous",c),c.preventDefault();break;case e.DOWN:b._move("next",c),c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){b.options.disabled||(b.selectedItem=null,b.previous=b.element.val())}).bind("blur.autocomplete",function(a){b.options.disabled||(clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150))}),this._initSource(),this.response=function(){return b._response.apply(b,arguments)},this.menu=a("
      ").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;a.isArray(this.options.source)?(d=this.options.source,this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}):typeof this.options.source=="string"?(e=this.options.source,this.source=function(d,f){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:e,data:d,dataType:"json",autocompleteRequest:++c,success:function(a,b){this.autocompleteRequest===c&&f(a)},error:function(){this.autocompleteRequest===c&&f([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length").data("item.autocomplete",c).append(a("").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible"))this.search(null,b);else{if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)}},widget:function(){return this.menu.element}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){!a(c.target).closest(".ui-menu-item a").length||(c.preventDefault(),b.select(c))}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){!this.active||(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active)this.activate(c,this.element.children(b));else{var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))}},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10}),result.length||(result=this.element.children(".ui-menu-item:first")),this.activate(b,result)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend(""),d.secondary&&b.append(""),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);/* + * jQuery UI Dialog 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||" ",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("
      ")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("
      ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1!==c._trigger("beforeClose",b)){c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d);return c}},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal)return d._trigger("focus",c);e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c);return d},open:function(){if(!this._isOpen){var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode===a.ui.keyCode.TAB){var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return!1}if(b.target===d[0]&&b.shiftKey){e.focus(1);return!1}}}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open");return b}},_createButtons:function(b){var c=this,d=!1,e=a("
      ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("
      ").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.17",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;ic&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.17"})})(jQuery);/* + * jQuery UI Tabs 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */(function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
      ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
    • #{label}
    • "},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},destroy:function(){var b=this.options;this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.17"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a'))}$.extend($.ui,{datepicker:{version:"1.8.17"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('
      ')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$(''+c+""),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('').addClass(this._triggerClass).html(g==""?f:$("").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;db&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$(''),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&pp)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?''+q+"":e?"":''+q+"",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?''+s+"":e?"":''+s+"",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'",x=d?'
      '+(c?w:"")+(this._isInRange(a,v)?'":"")+(c?"":w)+"
      ":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='
      '+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'
      '+"";var R=z?'":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="=5?' class="ui-datepicker-week-end"':"")+">"+''+C[T]+""}Q+=R+"";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z";var _=z?'":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Ym;_+='",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+""}n++,n>11&&(n=0,o++),Q+="
      '+this._get(a,"weekHeader")+"
      '+this._get(a,"calculateWeek")(Y)+""+(bb&&!G?" ":bc?''+Y.getDate()+"":''+Y.getDate()+"")+"
      "+(j?"
      "+(g[0]>0&&N==g[1]-1?'
      ':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'':""),a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this +._get(a,"showMonthAfterYear"),l='
      ',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
      ";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.17",window["DP_jQuery_"+dpuuid]=$})(jQuery);/* + * jQuery UI Progressbar 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("
      ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.17"})})(jQuery);/* + * jQuery UI Effects 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/ + */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.17",save:function(a,b){for(var c=0;c
      ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h
      ").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);/* + * jQuery UI Effects Fade 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* + * jQuery UI Effects Fold 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/* + * jQuery UI Effects Highlight 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/* + * jQuery UI Effects Pulsate 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&×--;for(var e=0;e
      ').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); \ No newline at end of file diff --git a/3.0/themes/pear4gallery3/js/jquery.endless-scroll.js b/3.0/themes/pear4gallery3/js/jquery.endless-scroll.js new file mode 100644 index 00000000..9dd57ffd --- /dev/null +++ b/3.0/themes/pear4gallery3/js/jquery.endless-scroll.js @@ -0,0 +1,126 @@ +/** + * Endless Scroll plugin for jQuery + * + * v1.4.8 + * + * Copyright (c) 2008 Fred Wu + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +/** + * Usage: + * + * // using default options + * $(document).endlessScroll(); + * + * // using some custom options + * $(document).endlessScroll({ + * fireOnce: false, + * fireDelay: false, + * loader: "
      ", + * callback: function(){ + * alert("test"); + * } + * }); + * + * Configuration options: + * + * bottomPixels integer the number of pixels from the bottom of the page that triggers the event + * fireOnce boolean only fire once until the execution of the current event is completed + * fireDelay integer delay the subsequent firing, in milliseconds, 0 or false to disable delay + * loader string the HTML to be displayed during loading + * data string|function plain HTML data, can be either a string or a function that returns a string, + * when passed as a function it accepts one argument: fire sequence (the number + * of times the event triggered during the current page session) + * insertAfter string jQuery selector syntax: where to put the loader as well as the plain HTML data + * callback function callback function, accepts one argument: fire sequence (the number of times + * the event triggered during the current page session) + * resetCounter function resets the fire sequence counter if the function returns true, this function + * could also perform hook actions since it is applied at the start of the event + * ceaseFire function stops the event (no more endless scrolling) if the function returns true + * + * Usage tips: + * + * The plugin is more useful when used with the callback function, which can then make AJAX calls to retrieve content. + * The fire sequence argument (for the callback function) is useful for 'pagination'-like features. + */ + +(function($){ + + $.fn.endlessScroll = function(options) { + + var defaults = { + bottomPixels: 50, + fireOnce: true, + fireDelay: 150, + loader: "
      Loading...
      ", + data: "", + insertAfter: "div:last", + resetCounter: function() { return false; }, + callback: function() { return true; }, + ceaseFire: function() { return false; } + }; + + var options = $.extend({}, defaults, options); + + var firing = true; + var fired = false; + var fireSequence = 0; + + if (options.ceaseFire.apply(this) === true) { + firing = false; + } + + if (firing === true) { + $(this).scroll(function() { + if (options.ceaseFire.apply(this) === true) { + firing = false; + return; // Scroll will still get called, but nothing will happen + } + + if (this == document || this == window) { + var is_scrollable = $(document).height() - $(window).height() <= $(window).scrollTop() + options.bottomPixels; + } else { + var is_scrollable = ($(this)[0].scrollHeight - $(this).height() <= $(this).scrollTop() + options.bottomPixels); + } + + if (is_scrollable && (options.fireOnce == false || (options.fireOnce == true && fired != true))) { + if (options.resetCounter.apply(this) === true) fireSequence = 0; + + fired = true; + fireSequence++; + + $(options.insertAfter).after("
      " + options.loader + "
      "); + + data = typeof options.data == 'function' ? options.data.apply(this, [fireSequence]) : options.data; + + if (data !== false) { + $(options.insertAfter).after("
      " + data + "
      "); + $("div#endless_scroll_data").hide().fadeIn(); + $("div#endless_scroll_data").removeAttr("id"); + + options.callback.apply(this, [fireSequence]); + + if (options.fireDelay !== false || options.fireDelay !== 0) { + $("body").after("
      "); + // slight delay for preventing event firing twice + $("div#endless_scroll_marker").fadeTo(options.fireDelay, 1, function() { + $(this).remove(); + fired = false; + }); + } + else { + fired = false; + } + } + + $("div#endless_scroll_loader").remove(); + } + }); + } + }; + +})(jQuery); diff --git a/3.0/themes/pear4gallery3/js/jquery.getscrollbarwidth.js b/3.0/themes/pear4gallery3/js/jquery.getscrollbarwidth.js new file mode 100644 index 00000000..53a22b02 --- /dev/null +++ b/3.0/themes/pear4gallery3/js/jquery.getscrollbarwidth.js @@ -0,0 +1,31 @@ +/*! Copyright (c) 2008 Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + */ + +/** + * Gets the width of the OS scrollbar + */ +(function($) { + var scrollbarWidth = 0; + $.getScrollbarWidth = function() { + if ( !scrollbarWidth ) { + if ( $.browser.msie ) { + var $textarea1 = $('') + .css({ position: 'absolute', top: -1000, left: -1000 }).appendTo('body'), + $textarea2 = $('') + .css({ position: 'absolute', top: -1000, left: -1000 }).appendTo('body'); + scrollbarWidth = $textarea1.width() - $textarea2.width(); + $textarea1.add($textarea2).remove(); + } else { + var $div = $('
      ') + .css({ width: 100, height: 100, overflow: 'auto', position: 'absolute', top: -1000, left: -1000 }) + .prependTo('body').append('
      ').find('div') + .css({ width: '100%', height: 200 }); + scrollbarWidth = 100 - $div.width(); + $div.parent().remove(); + } + } + return scrollbarWidth; + }; +})(jQuery); \ No newline at end of file diff --git a/3.0/themes/pear4gallery3/js/jquery.parsequery.js b/3.0/themes/pear4gallery3/js/jquery.parsequery.js new file mode 100644 index 00000000..b54d8522 --- /dev/null +++ b/3.0/themes/pear4gallery3/js/jquery.parsequery.js @@ -0,0 +1,19 @@ +/** + * A simple querystring parser. + * Example usage: var q = $.parseQuery(); q.fooreturns "bar" if query contains "?foo=bar"; multiple values are added to an array. + * Values are unescaped by default and plus signs replaced with spaces, or an alternate processing function can be passed in the params object . + * http://actingthemaggot.com/jquery + * + * Copyright (c) 2008 Michael Manning (http://actingthemaggot.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + **/ +jQuery.parseQuery = function(qs,options) { + var q = (typeof qs === 'string'?qs:window.location.search), o = {'f':function(v){return unescape(v).replace(/\+/g,' ');}}, options = (typeof qs === 'object' && typeof options === 'undefined')?qs:options, o = jQuery.extend({}, o, options), params = {}; + jQuery.each(q.match(/^\??(.*)$/)[1].split('&'),function(i,p){ + p = p.split('='); + p[1] = o.f(p[1]); + params[p[0]] = params[p[0]]?((params[p[0]] instanceof Array)?(params[p[0]].push(p[1]),params[p[0]]):[params[p[0]],p[1]]):p[1]; + }); + return params; +} diff --git a/3.0/themes/pear4gallery3/js/pear.js b/3.0/themes/pear4gallery3/js/pear.js new file mode 100644 index 00000000..f4e855b9 --- /dev/null +++ b/3.0/themes/pear4gallery3/js/pear.js @@ -0,0 +1,701 @@ +/*jslint browser: true, regexp: true, sub: false, vars: false, white: false, nomen: false, sloppy: true, undef: false, plusplus: true */ +/*global jQuery, $, Event, refresh, escape, unescape, slideshowImages, ImageFlow, focusImage, swatchImg */ + +var savedHeight = savedWidth = 0; +var pear = {defaultView: "grid", + detailView: false, + sitePath: "/", + defaultBg: "black", + slideshowTimeout: 5000, + currentImg: 0, + hovering: false, + mosaicEffect: "" }; + +function thumbPadding() { + var size, width, margin; + /* Padding on thumbs to make them flow nicer */ + size = Math.ceil((pear.currentView === 'mosaic') ? $('#imgSlider').slider('value') / 2 : $('#imgSlider').slider('value')) + 10; + width = $('#gridContainer').width() - $.getScrollbarWidth() - 8; + margin = width / Math.floor(width / size) - size; + $('.gallery-thumb').css({'margin-left': Math.ceil(margin / 2) + 'px', 'margin-right': Math.floor(margin / 2) + 'px'}); +} + +function toggleReflex(hide) { + if (hide) { + // $$('.Fer').each(function(s) { cvi_reflex.remove(s); }); + $('mosaicGridContainer').select('img[class="Fer"]').each(function (s, index) { Event.observe(s, 'click', function () { if (pear.currentView === 'mosaic') { swatchImg(index); } else { focusImage(index); } }); }); + } else { + // $$('.Fer').each(function(s) { cvi_reflex.add(s, {height: 20, distance: 0 }); }); + $('mosaicGridContainer').select('canvas[class="Fer"]').each(function (s, index) { Event.observe(s, 'click', function () { if (pear.currentView === 'mosaic') { swatchImg(index); } else { focusImage(index); } }); }); + } +} + +function scaleIt(v, sliding) { + // Remap the 0-1 scale to fit the desired range + //v=.26+(v*(1.0-.26)); + var size = (pear.currentView === 'mosaic') ? v / 2 : v; + + toggleReflex(true); + $(".p-photo").each(function (i) { + $(this).attr({height: size + 'px', width: size + 'px'}); + $(this).css({height: size + 'px', width: size + 'px'}); + }); + $(".g-photo").css({width: size + 'px'}); + if (!pear.currentView === 'mosaic' && !sliding) { + toggleReflex(false); + } + thumbPadding(); + $('#gridContainer').trigger('scroll'); +} + +function thumbLoad(index) { + //Load non skimming thumbs + $('.g-thumbnail').each( function() { $(this).attr('src', thumbImages[$(this).attr('id')]); }); + //Load skimming thumbs + $('.skimm_div').each( function() { $(this).append(thumbImages[$(this).attr('id')]); }); + + //Re-initiate all fancyness. + if (pear.currentView === 'mosaic') { $('p.giTitle,div.giInfo').hide(); } else { $('p.giTitle,div.giInfo').show(); } + scaleIt($('#imgSlider').slider('value')); + $('.g-item:not(.g-hover-item)').each(function (index) { $(this).unbind('click'); if ($(this).is('.g-photo')) { $(this).click(function () { if (pear.currentView === 'mosaic') { swatchImg(index); } else { focusImage(index); } }); }}); + // 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:not(:has(span.ui-icon))").prepend(""); + $(".g-context-menu a span").each(function() { + /*jslint regexp: false*/ + var iconClass = $(this).parent().attr("class").match(/ui-icon-.[^\s]+/).toString(); + /*jslint regexp: true*/ + $(this).addClass(iconClass); + }); + $("ul.g-context-menu > li a span").addClass("ui-icon-carat-1-s"); + } + // Initialize thumbnail hover effect + $(".g-item").hover( + function() { + $(this).addClass("hovering"); + if($(this).hasClass("g-album")) { + $(this).data('thumb_src' ,$(this).children('img.g-thumbnail').attr('src')); + } + if(pear.currentView === 'mosaic') { return; } + // 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 + $(this).addClass("g-hover-item"); + // Initialize the contextual menu + $(this).gallery_context_menu(); + // Set the hover item's height + $(this).height("auto"); + }, + function() { + var sib_height; + $(this).removeClass("hovering"); + if($(this).hasClass("g-album")) { + $(this).children('img.g-thumbnail').attr('src', $(this).data('thumb_src')); + } + if (pear.currentView === 'mosaic') { return; } + // Remove the placeholder and hover class from the item + $(this).removeClass("g-hover-item"); + $("#g-place-holder").remove(); + } + ); + // Initialize button hover effect + $.fn.gallery_hover_init(); + thumbPadding(); + + if(pear.viewMode != 'carousel') { + pear.pearCarousel = null; + $("#pearImageFlow").empty(); + } + //Pre fetch images + //if ( typeof prefetch === 'undefined') { prefetch = 0; } + //for ( ; prefetch < slideshowImages.length; prefetch=prefetch+1 ) { $('').attr('src', slideshowImages[prefetch][0]); } +} + +function loadMore() { + if ( navigation.next !== '') { + var url = navigation.next; + navigation.next = ''; + $.get(url,{ ajax: '1'},function (data) { + $('#gridContainer').append(data); + thumbLoad(); + }); + return true; + } + else { return false; } +} + +function setCookie(c_name, value, expiredays) { + var exdate = new Date(); + exdate.setDate(exdate.getDate() + expiredays); + document.cookie = c_name + "=" + + escape(value) + ((expiredays === null) ? "" : ";expires=" + exdate.toGMTString()) + + "; path=" + pear.sitePath; +} + +function getCookie(c_name) { + if (document.cookie.length > 0) { + var c_start, c_end; + c_start = document.cookie.indexOf(c_name + "="); + if (c_start !== -1) { + c_start = c_start + c_name.length + 1; + c_end = document.cookie.indexOf(";", c_start); + if (c_end === -1) { + c_end = document.cookie.length; + } + return unescape(document.cookie.substring(c_start, c_end)); + } + } + return ""; +} + +function mosaicResize() { + if ($('#gridContainer').length === 0) { + return; //no element found + } + var myWidth = 0, myHeight = 0; + var iRatio = 0, iWidth = 0, iHeight = 0; + var siteTop; + if (typeof slideshowImages[pear.currentImg] !== 'undefined') { + iWidth = parseFloat(slideshowImages[pear.currentImg][2].replace(/,/gi, ".")); + iHeight = parseFloat(slideshowImages[pear.currentImg][3].replace(/,/gi, ".")); + iRatio = iWidth / iHeight; + if (isNaN(iRatio)) { iRatio = 1.3333; } + } + if (typeof (window.innerWidth) === 'number') { + //Non-IE + myWidth = window.innerWidth; + myHeight = window.innerHeight; + } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { + //IE 6+ in 'standards compliant mode' + myWidth = document.documentElement.clientWidth; + myHeight = document.documentElement.clientHeight; + } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) { + //IE 4 compatible + myWidth = document.body.clientWidth; + myHeight = document.body.clientHeight; + } + if ($('#imageflow').length !== 0) { + $('#imageflow').css({'height': (myHeight - 53) + 'px', 'width': (((myWidth * 0.5) < (myHeight - 53)) ? myWidth : ((myHeight - 65) * 2)) + 'px'}); + } + if (iRatio > (myWidth / (myHeight - 165))) { + $('#img_detail').css({'height': myWidth / iRatio + "px", 'width': myWidth + "px"}); + } else { + $('#img_detail').css({'height': myHeight - 165 + "px", 'width': (myHeight - 165) * iRatio + "px"}); + } + if (iHeight < (myHeight - 165) && iWidth < myWidth) { + $('#img_detail').css({'height': iHeight + "px", 'width': iWidth + "px"}); + } + myWidth = myWidth - 7; + myHeight = myHeight - $('#g-site-status').outerHeight(true) - $('#paginator').outerHeight(true); + myHeight -= 138; + $('#g-header').css('top', $('#gsNavBar').outerHeight(true) + $('#g-site-status').outerHeight(true) - 4); + + if ($('#g-movie').length) { + myHeight += 18; + } + /*Sidebar*/ + if ($('#sidebarContainer').is(':visible')) { myWidth = myWidth - $('#sidebarContainer').width(); } + if (pear.currentView === 'mosaic') { + //Resize the image.. + myWidth = $('#mosaicDetail').width()-20; + if (iRatio > (myWidth / myHeight)) { + $('#mosaicImg').attr({height: myWidth / iRatio, width: myWidth}); + } else { + $('#mosaicImg').attr({height: myHeight, width: myHeight * iRatio}); + } + if (iHeight < myHeight && iWidth < myWidth) { + $('#mosaicImg').attr({height: iHeight, width: iWidth}); + } + } + /* Fix for firefox that don't support dimensions on empty img tags */ + $('#mosaicImg').css('display', 'inline-block'); + /* Vertical center of image in mosaicView */ + siteTop = $('#mosaicTable').height() / 2 - ($("#imageTitle").attr("savedH") + $("#mosaicImg").height()) / 2; + siteTop = siteTop < 0 ? 0 : siteTop; + $('#mosaicDetailContainer').css('top', siteTop); + + /* Vertical center of content in carousel */ + siteTop = $('#mosaicTable').height() / 2 - $('#pearImageFlow').height() / 2; + siteTop = siteTop < 0 ? 0 : siteTop; + $('#pearImageFlow').css('top', siteTop); + + thumbPadding(); + + if ($('#conf_imageflow').length) { + refresh(); + } +} + +$(window).resize(function () { + if (window.innerHeight === savedHeight && window.innerWidth === savedWidth) { return; } + savedHeight = window.innerHeight; + savedWidth = window.innerWidth; + mosaicResize(); +}); + +function updateHash() { + window.location.hash = getAlbumHash(pear.currentImg); +} + +function swatchSkin(intSkin) { + if ( pear.currentBg !== pear.defaultBg ) { setCookie('swatchSkin', intSkin, 1); } + $('#black,#dkgrey,#ltgrey,#white').removeClass().addClass("swatch"); + switch (intSkin) { + //black + case 'black': + case 0: + $('div.gallery-thumb-round').css('backgroundPosition', "0px 0px"); + $('body,html,#pearFlow').css('backgroundColor', "#000"); + $('p.giTitle').css("color", "#a3a3a3"); + $("#black").addClass("black sel black-with-sel-with-swatch"); + pear.currentBg = "black"; + break; + // dkgrey + case 'dkgrey': + case 1: + $('div.gallery-thumb-round').css('backgroundPosition', "-200px 0px"); + $('body,html,#pearFlow').css('backgroundColor', "#262626"); + $('p.giTitle').css("color", "#a9a9a9"); + $("#dkgrey").addClass("dkgrey sel dkgrey-with-sel-with-swatch"); + pear.currentBg = "dkgrey"; + break; + // ltgrey + case 'ltgrey': + case 2: + $('div.gallery-thumb-round').css('backgroundPosition', "-400px 0px"); + $('body,html,#pearFlow').css('backgroundColor', "#d9d9d9"); + $('p.giTitle').css("color", "#333333"); + $("#ltgrey").addClass("ltgrey sel ltgrey-with-sel-with-swatch"); + pear.currentBg = "ltgrey"; + break; + // white + case 'white': + case 3: + $('div.gallery-thumb-round').css('backgroundPosition', "-600px 0px"); + $('html,body,#pearFlow').css('backgroundColor', "#ffffff"); + $('p.giTitle').css("color", "#444444"); + $("#white").addClass("white sel white-with-sel-with-swatch"); + pear.currentBg = "white"; + break; + default: + // Black is default + if ( typeof pear.defaultBg === "undefined" ) { pear.defaultBg = "black"; } + swatchSkin(pear.defaultBg); + } + updateHash(); +} + +//Set a updating timer so users can't update before the image has appeard.. +function swatchImg(imageId) { + if (imageId < 0 || imageId >= slideshowImages.length) { + if ( navigation.next !== '') { + $.get(navigation.next,{ ajax: '1'},function (data) { + $('#gridContainer').append(data); + thumbLoad(); + swatchImg(imageId); + }); + } + return; + } + + if ( typeof slideshowImages[imageId] === 'undefined' ) { + imageId += 1; + if ( imageId >= slideshowImages.length ) { swatchImg(0); } else { swatchImg(imageId); } + return; + } + + pear.currentImg = imageId; + + if (pear.currentView === 'mosaic') { + $('#imageTitle').each(function (i) {$(this).html("

      "); $(this).attr("savedH", $(this).height()); }); + if ( pear.mosaicEffect === "" ) { + $('#mosaicDetailContainer').hide(0, function () { + $('#imageTitle').html("

      " + slideshowImages[imageId][4] + "

      "); + $('#mosaicImg').attr('src', slideshowImages[imageId][0]); + mosaicResize(); + $('#mosaicDetailContainer').show(); + }); + } + else { + var options = {}; + if ( pear.mosaicEffect === "scale" ) { options = { percent: 0 }; } + $('#mosaicDetailContainer').hide(pear.mosaicEffect, options, "fast", function () { + $('#imageTitle').html("

      " + slideshowImages[imageId][4] + "

      "); + $('#mosaicImg').attr('src', slideshowImages[imageId][0]); + mosaicResize(); + $('#mosaicDetailContainer').show(pear.mosaicEffect, options, "slow"); + }); + } + } + + /* Set controls for hover view. */ + $('#mosaicHover').hide(); + $('#prev').toggleClass('disabled', (pear.currentImg === 0)); + $('#next').toggleClass('disabled', (pear.currentImg === slideshowImages.length - 1)); + $('#img_detail').hide(); + /* Update image and title in focus view */ + $('#img_detail').attr('src', slideshowImages[pear.currentImg][0]); + $('.info_detail').attr('href', pear.sitePath + "pear/about/" + slideshowImages[pear.currentImg][1]); + $('.comments_detail').attr('href', pear.sitePath + "pear/show_comments/" + slideshowImages[pear.currentImg][1]); + $('#imageTitleLabel').html("

      " + slideshowImages[pear.currentImg][4] + "

      "); + $('#download, #detail_download').toggleClass('hidden', + ( slideshowImages[pear.currentImg][5] === '' )); + $(".controller").each( function () { + $(this).css('background-image',$(this).css('background-image')); }); + $('#mosaicHover').show(); + mosaicResize(); + updateHash(); + $('#img_detail').fadeIn(); +} + +function hideHoverView() { + if (!pear.hovering) { $('#hoverView').fadeOut(); } + pear.hideHoverViewHandler = null; +} + +function showHoverView() { + if (pear.hideHoverViewHandler !== null) { clearTimeout(pear.hideHoverViewHandler); } + $('#hoverView').show(); + pear.hideHoverViewHandler = setTimeout(hideHoverView, 3000); +} + +function focusImage(id, redirected) { + if (id < 0 || id >= slideshowImages.length) { + if ( navigation.next !== '') { + $.get(navigation.next,{ ajax: '1'},function (data) { + $('#mosaicGridContainer').append(data); + thumbLoad(); + focusImage(id); + }); + } + return; + } + pear.currentImg = id; + pear.detailView = true; + swatchImg(id); + $('#play_detail,#pause_detail').addClass('hidden'); + $('#detailView').fadeIn('slow'); + showHoverView(); + //Image count. + //if (!redirected) { $.get(slideshowImages[pear.currentImg][6]); } +} + +function checkCookie() { + var co = getCookie('slider'); + if (co !== null && co !== "") { + $('#imgSlider').slider("value", co); + } + co = getCookie('swatchSkin'); + if (co !== null && co !== "") { + swatchSkin(co); + } else { + swatchSkin(pear.defaultBg); + } +} + +function getAlbumHash(img) { + var hash = "#"; + if (img !== 0) { + hash += "img=" + img; + } + if ( pear.defaultView !== pear.currentView ) { + hash += "&viewMode=" + pear.currentView; + } + if ( pear.detailView ) { + hash += "&detailView"; + } + if ( pear.defaultBg !== pear.currentBg ) { + hash += "&bgcolor=" + pear.currentBg; + } + return hash; +} + +function slideShowUpdate() { + pear.slideShowId = pear.slideShowId + 1; + if (pear.slideShowId > slideshowImages.length) { + slideShowId = 0; + } + swatchImg(pear.slideShowId); + pear.slideShowHandler = setTimeout(slideShowUpdate, pear.slideshowTimeout); +} + +function togglePlayPause() { + //We are paused + if (pear.slideShowHandler === null) { + $('#play_detail').addClass('hidden'); + $('#pause_detail').removeClass('hidden'); + pear.slideShowHandler = setTimeout(slideShowUpdate, pear.slideshowTimeout); + } else { //We are playing + $('#pause_detail').addClass('hidden'); + $('#play_detail').removeClass('hidden'); + clearTimeout(pear.slideShowHandler); + pear.slideShowHandler = null; + } +} + +function startSlideshow() { + slideShowMode = true; + $('#play_detail').addClass('hidden'); + $('#pause_detail').removeClass('hidden'); + $('#detailView').fadeIn('slow'); + showHoverView(); + pear.slideShowId = pear.currentImg; + swatchImg(pear.slideShowId); + togglePlayPause(); +} + +function switchMode(mode) { + $('#mosaic,#grid,#carousel').removeClass("sel sel-with-viewSwitcher"); + $('#' + mode).addClass("sel sel-with-viewSwitcher"); + updateHash(); +} + +function switchToGrid() { + pear.currentView = "grid"; + toggleReflex(true); + $('#pearFlow').hide(); + if (!$('#gridContainer').length) { return; } + scaleIt($('#imgSlider').slider('value')); + $('#mosaicDetail').hide(); + $('#gridContainer').css('width', "100%"); + $('p.giTitle,div.giInfo').each(function (s) { $(this).show(); }); + switchMode('grid'); + mosaicResize(); +} + +function switchToMosaic() { + pear.currentView = "mosaic"; + toggleReflex(false); + $('#pearFlow').hide(); + if (!$('#gridContainer').length) { return; } + scaleIt($('#imgSlider').slider('value')); + $('#mosaicDetail').show(); + $('#gridContainer').css('width', "35%"); + $('p.giTitle,div.giInfo').each(function (s) { $(this).hide(); }); + switchMode('mosaic'); + swatchImg(pear.currentImg); + mosaicResize(); +} + +function startImageFlow() { + var i, img; + pear.currentView = 'carousel'; + $('#pearFlow').show(); + + if (!pear.pearCarousel) { + for (i = 0; i < slideshowImages.length; i++) { + //var img = '
      ' + $('#mosaicGridContainer img').eq(i).attr('alt') + '"
      '; + if ( typeof slideshowImages[i] === 'undefined' ) { continue; } + img = '' + slideshowImages[i][4] + ''; + // console.log(img); + $('#pearImageFlow').append(img); + } + pear.pearCarousel = new ImageFlow(); + pear.pearCarousel.init({ImageFlowID: 'pearImageFlow', + aspectRatio: 2.4, imagesHeight: 0.6, + opacity: true, reflections: false, + startID: pear.currentImg + 1, + onClick: function () { focusImage($(this).attr('longdesc')); }, + startAnimation: true, xStep: 200, imageFocusM: 1.0, + imageFocusMax: 4, opacityArray: [10, 9, 6, 2], + percentLandscape: 200, percentOther: 100, + captions: false, slider: false}); + } + switchMode('carousel'); + mosaicResize(); +} + +function hideDetailView() { + $('#detailView').hide(); + pear.slideShowMode = pear.detailView = false; + if (pear.slideShowHandler !== null) { clearTimeout(pear.slideShowHandler); } + pear.slideShowHandler = null; + updateHash(); +} + +function setKeys() { +/* Fixes the back button issue */ +/* window.onunload = function() +{ +document = null; +} +*/ + $(document).keydown(function (e) { + var charCode = e.keyCode || e.which; + if ($( document.activeElement ).is("input:text,input:password,textarea")) { return; } + switch (charCode) { + case 32: /* Space */ + if (pear.slideShowMode) { togglePlayPause(); } + break; + case 39: /* Right arrow key */ + case 78: /* N */ + swatchImg(pear.currentImg + 1); + // if($('imageflow')) handle(-1); + break; + case 80: /* P */ + case 37: /* Left arrow key */ + swatchImg(pear.currentImg - 1); + // if($('imageflow')) handle(1); + break; + case 27: /* Esc-key */ + hideDetailView(); + break; + } + }); +} + +function pearInit(options) { + pear = $.extend({}, pear, options, { currentView: '', currentImg: 0, slideShowId: 0, slideShowHandler: null, hideHoverViewHandler: null }); + pear.currentView = pear.defaultView; + var h, co; + + co = getCookie('swatchSkin'); + if (co === null || co === "") { pear.currentBg = co; } + + /* Parse hash */ + h = $.parseQuery(window.location.hash.substring(1)); + if (h.img !== undefined) { + pear.currentImg = parseInt(h.img, 10); + } + if (h.bgcolor !== undefined) { + pear.currentBg = h.bgcolor; + } + if (h.viewMode !== undefined) { + if (h.viewMode === 'detail') { + pear.currentView = pear.defaultView; + focusImage(pear.currentImg, h.redirected); + } + pear.currentView = h.viewMode; + } + /* end parse hash */ + + swatchSkin(pear.currentBg); + + if (navigator.appVersion.search(/MSIE [0-7]/i) !== -1) { + $('.track').each(function (s) {$(this).css('top', '-16px'); }); //Fix for IE's poor page rendering. + } + /* 58.5 225 32.5 125 */ + $('#imgSlider').slider({ min: 75, max: 250, step: 2, value: 125, + slide: function (event, ui) { scaleIt(ui.value); }, + change: function (event, ui) { scaleIt(ui.value); setCookie('slider', ui.value, '1'); } }); + + //Set event for Thumb Click. + $('.g-item').each(function (index) { $(this).click(function () { if (pear.currentView === 'mosaic') { swatchImg(index); } else { focusImage(index); } }); }); + $('#mosaicDetailContainer').click(function () { focusImage(pear.currentImg); }); + $('#prev').click(function () { swatchImg(pear.currentImg - 1); }); + $('#next').click(function () { swatchImg(pear.currentImg + 1); }); + $('#img_detail').click(function () { hideDetailView(); }); + + if (typeof slideshowImages !== 'undefined' && !slideshowImages.length) { + pear.currentView = pear.defaultView = 'grid'; + } + + setKeys(); + thumbLoad(); + $('#gridContainer').endlessScroll({ fireOnce: true, bottomPixels: 200, callback: function(p) { loadMore(); } }); + $('#gridContainer').trigger('scroll'); + + $('#mosaicDetailContainer').hover(function () { + $(this).addClass("g-photo hovering"); + $(this).prepend($('.g-item:not(.g-hover-item)>ul').slice(pear.currentImg, pear.currentImg+1).clone().attr("id", "imgMenu").removeAttr("context_menu_initialized")); + $(this).gallery_context_menu(); + $.fn.gallery_hover_init();}, + function () { + $(this).removeClass("g-photo hovering"); + $('#imgMenu').remove();}); + + if (slideshowImages.length !== 0) { + $(".viewSwitcher").hover( function() { $(this).addClass("hover-with-viewSwitcher"); }, function() { $(this).removeClass("hover-with-viewSwitcher"); }); + $("#grid").click(function () { switchToGrid(true); }); + $("#mosaic").click(function () { switchToMosaic(true); }); + $("#carousel").click(function () { startImageFlow(true); }); + $('#slideshow').click(function () { startSlideshow(); }); + } else { + $("#grid, #mosaic, #carousel, #slideshow").addClass("disabled"); + } + /* Go to detailView */ + if (h.detailView !== undefined) { + focusImage(pear.currentImg); + } + + switch (pear.currentView) { + case 'carousel': + startImageFlow(); + break; + case 'mosaic': + switchToMosaic(); + break; + default: + switchToGrid(); + } + checkCookie(); + $('#mosaicTable').css('top', 45 +$('#g-action-status').outerHeight(true)); + $('#loading').hide(); +} + +function sidebarInit(mode) { + $('#toggleSidebar').hide().off('click'); + $('#sidebarContainer').show().off('hover'); + $('#sidebar').css('border-left-width', '1px'); + switch (mode) { + case 'toggle': + $('#sidebarContainer').width(5); + $('#sidebar').css('border-left-width', '5px'); + $('#mosaicTable').css('right', '5px'); + $('#sidebarContainer').hover(function () { + $('#sidebar').css('border-left-width', '1px'); + $('#sidebarContainer').stop(true,true).animate( { width: '221' }, 500); + //$('#sidebar').show('slide', { direction: 'right'}, 1000); + $('#mosaicTable').stop(true,true).animate( { right: '221'}, 500, function () { mosaicResize(); }); }, + function () { + $('#sidebar').css('border-left-width', '5px'); + $('#sidebarContainer').stop(true,true).animate( { width: '5' }, 500); + //$('#sidebar').hide('slide', { direction: 'right'}, 1000); + $('#mosaicTable').stop(true,true).animate( { right: '5' }, 500, function () { mosaicResize(); }); + }); + break; + case 'static': + $('#sidebarContainer').width(221); + $('#mosaicTable').css('right', '221px'); + mosaicResize(); + break; + case 'button': + $('#toggleSidebar').show(); + $('#toggleSidebar').off().click(function (){ + $(this).toggleClass("ui-icon-plusthick ui-icon-minusthick"); + if ( $(this).is('.ui-icon-plusthick')) { + $('#sidebarContainer').width(1); + $('#mosaicTable').css('right', '1px'); + setCookie('sidebarState', 'hidden', 1); + } else { + $('#sidebarContainer').width(221); + $('#mosaicTable').css('right', '221px'); + setCookie('sidebarState', 'shown', 1); + } + mosaicResize(); + }); + var state = getCookie('sidebarState'); + if( getCookie('sidebarState') === 'hidden' && $('#toggleSidebar').is('.ui-icon-plusthick')) { + $('#toggleSidebar').trigger('click'); + } + $('#toggleSidebar').trigger('click'); + break; + //case 'hidden': + default: + $('#sidebarContainer').hide(); + $('#mosaicTable').css('right', '0'); + break; + } +} + +(function($){ +$.gallery_replace_image = function(data, img_selector) { + $(img_selector).attr({src: data.src}); + // Update geometrics in slideshowImages[INDEX]. + // Reload the focused image. + $(img_selector).trigger("gallery.change"); + }; +})(jQuery); diff --git a/3.1/themes/browny_wind/js/ui.init.js b/3.0/themes/pear4gallery3/js/ui.init.js similarity index 98% rename from 3.1/themes/browny_wind/js/ui.init.js rename to 3.0/themes/pear4gallery3/js/ui.init.js index 2c67bf3a..d3eddcb6 100644 --- a/3.1/themes/browny_wind/js/ui.init.js +++ b/3.0/themes/pear4gallery3/js/ui.init.js @@ -41,6 +41,7 @@ $(document).ready(function() { var iconClass = $(this).parent().attr("class").match(/ui-icon-.[^\s]+/).toString(); $(this).addClass(iconClass); }); + $("ul.g-context-menu > li a span").addClass("ui-icon-carat-1-s"); } // Remove titles for menu options since we're displaying that text anyway diff --git a/3.1/modules/exif_gps/models/exif_coordinate.php b/3.0/themes/pear4gallery3/models/pear_album_view.php similarity index 95% rename from 3.1/modules/exif_gps/models/exif_coordinate.php rename to 3.0/themes/pear4gallery3/models/pear_album_view.php index e3286d93..2f12e657 100644 --- a/3.1/modules/exif_gps/models/exif_coordinate.php +++ b/3.0/themes/pear4gallery3/models/pear_album_view.php @@ -17,5 +17,5 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class EXIF_Coordinate_Model extends ORM { +class Pear_album_view_Model extends ORM { } diff --git a/3.0/themes/pear4gallery3/theme.info b/3.0/themes/pear4gallery3/theme.info new file mode 100644 index 00000000..58956738 --- /dev/null +++ b/3.0/themes/pear4gallery3/theme.info @@ -0,0 +1,10 @@ +name = ".Pear Theme" +description = "A theme with the intention to mimic Apples mobile me gallery." +version = 3.4.1 +author = "Fredrik Erlandsson " +site = 1 +admin = 0 +author_name = "Fredrik Erlandsson" +author_url = "mailto:fredrik.e@gmail.com" +info_url = "http://codex.gallery2.org/Gallery3:Themes:pear4gallery3" +discuss_url = "http://gallery.menalto.com/node/102280" diff --git a/3.0/themes/pear4gallery3/thumbnail.png b/3.0/themes/pear4gallery3/thumbnail.png new file mode 100644 index 00000000..061c65f3 Binary files /dev/null and b/3.0/themes/pear4gallery3/thumbnail.png differ diff --git a/3.0/themes/pear4gallery3/views/about.html.php b/3.0/themes/pear4gallery3/views/about.html.php new file mode 100644 index 00000000..bf6a0917 --- /dev/null +++ b/3.0/themes/pear4gallery3/views/about.html.php @@ -0,0 +1,49 @@ + + +

      +
      + + + + + + + + + + + + + + + + +
      + +
      +
      + +
      + diff --git a/3.0/themes/pear4gallery3/views/album.html.php b/3.0/themes/pear4gallery3/views/album.html.php new file mode 100644 index 00000000..747f94c5 --- /dev/null +++ b/3.0/themes/pear4gallery3/views/album.html.php @@ -0,0 +1,60 @@ + + + +
      +
      +
      +
      +
      + + + + +
      +
      + Main image +
      +
      +
      +
      +
      + +
      +
      + +
      + + +
      + +album_bottom() ?> + diff --git a/3.1/modules/themeroller/data/views/block.html.php b/3.0/themes/pear4gallery3/views/block.html.php similarity index 100% rename from 3.1/modules/themeroller/data/views/block.html.php rename to 3.0/themes/pear4gallery3/views/block.html.php diff --git a/3.0/themes/pear4gallery3/views/dynamic.html.php b/3.0/themes/pear4gallery3/views/dynamic.html.php new file mode 100644 index 00000000..7f3b9c40 --- /dev/null +++ b/3.0/themes/pear4gallery3/views/dynamic.html.php @@ -0,0 +1,6 @@ + +dynamic_top() ?> + + +dynamic_bottom() ?> + diff --git a/3.0/themes/pear4gallery3/views/exif_dialog.html.php b/3.0/themes/pear4gallery3/views/exif_dialog.html.php new file mode 100644 index 00000000..32d3fae0 --- /dev/null +++ b/3.0/themes/pear4gallery3/views/exif_dialog.html.php @@ -0,0 +1,33 @@ + + +

      +
      + + + + + + + + + + + + + + + + +
      diff --git a/3.0/themes/pear4gallery3/views/facebook_comment.html.php b/3.0/themes/pear4gallery3/views/facebook_comment.html.php new file mode 100644 index 00000000..1558d68c --- /dev/null +++ b/3.0/themes/pear4gallery3/views/facebook_comment.html.php @@ -0,0 +1,16 @@ + +
      +
      + + +
      + + diff --git a/3.0/themes/pear4gallery3/views/hoverView.html.php b/3.0/themes/pear4gallery3/views/hoverView.html.php new file mode 100644 index 00000000..eb1f59c5 --- /dev/null +++ b/3.0/themes/pear4gallery3/views/hoverView.html.php @@ -0,0 +1,23 @@ + +
      +
      +
      +
      +
      +
      +
      +
      +
      + +
      +
      + +
      +
      +
      + + +
      +
      +
      +
      diff --git a/3.1/themes/browny_wind/views/movie.html.php b/3.0/themes/pear4gallery3/views/movie.html.php similarity index 81% rename from 3.1/themes/browny_wind/views/movie.html.php rename to 3.0/themes/pear4gallery3/views/movie.html.php index 158857db..adab9d1b 100644 --- a/3.1/themes/browny_wind/views/movie.html.php +++ b/3.0/themes/pear4gallery3/views/movie.html.php @@ -1,9 +1,12 @@ +
      photo_top() ?> paginator() ?> - +
      resize_top($item) ?> movie_img(array("class" => "g-movie", "id" => "g-item-id-{$item->id}")) ?> @@ -14,6 +17,6 @@

      title) ?>

      description)) ?>
      - +
      photo_bottom() ?>
      diff --git a/3.0/themes/pear4gallery3/views/no_sidebar.html.php b/3.0/themes/pear4gallery3/views/no_sidebar.html.php new file mode 100644 index 00000000..58c57256 --- /dev/null +++ b/3.0/themes/pear4gallery3/views/no_sidebar.html.php @@ -0,0 +1,11 @@ + +
        +
      • + + + + + + "> +
      • +
      diff --git a/3.0/themes/pear4gallery3/views/page.html.php b/3.0/themes/pear4gallery3/views/page.html.php new file mode 100644 index 00000000..ef6c2719 --- /dev/null +++ b/3.0/themes/pear4gallery3/views/page.html.php @@ -0,0 +1,218 @@ + + +page_subtype == "photo"): + foreach (end($parents)->viewable()->children() as $i => $child) + if(!($child->is_album() || $child->is_movie())) + if($child->url() == $_SERVER['REQUEST_URI']) { + header("HTTP/1.1 302 Found"); + header("Location: ".end($parents)->url()."#img=$i&viewMode=detail&redirected=true"); + die(0); + }?> + + +html_attributes() ?> xml:lang="en" lang="en"> + + + + start_combining("script,css") ?> + + <? 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 ?> + + " + type="image/x-icon" /> + + page_type == "collection"): ?> + + + + + + + + script("json2-min.js") ?> + script("jquery-1.7.1.min.js") ?> + script("jquery.form.js") ?> + script("jquery-ui-1.8.17.custom.min.js") ?> + script("jquery.endless-scroll.js") ?> + script("jquery.getscrollbarwidth.js") ?> + script("gallery.common.js") ?> + + + script("gallery.ajax.js") ?> + script("gallery.dialog.js") ?> + script("superfish/js/superfish.js") ?> + script("jquery.localscroll.js") ?> + + + page_subtype == "photo"): ?> + script("jquery.scrollTo.js") ?> + script("gallery.show_full_size.js") ?> + page_subtype == "movie"): ?> + script("flowplayer.js") ?> + + + head() ?> + + + script("ui.init.js") ?> + script("jquery.parsequery.js") ?> + script("imageflow.packed.js") ?> + css("yui/reset-fonts-grids.css") ?> + css("superfish/css/superfish.css") ?> + css("ui-pear-theme/jquery-ui-1.8.17.custom.css") ?> + css("screen.css") ?> + css("imageflow.packed.css") ?> + css("pear.css") ?> + + + get_combined("script") ?> + + + get_combined("css") ?> + + + + + + + + body_attributes() ?>> + + page_top() ?> + site_status() ?> +page_subtype == "login") or ($theme->page_subtype == "reauthenticate")): ?> + + + +
      + +item()): ?> +
      item()->title, 40)) ?>   + + (item()->children()) ?>) + +
      + +
      + +   + + tag()): ?> + $theme->tag()->name)) ?> + + title, 40)) ?>   + + +
      + +
      + +
      +
      + +messages() ?> + + + +
      +
      +
      +
      +
      +
      +
      + +
      +
      Color:
      +
      +
      +
      +
      +
      + +
      +page_subtype != "movie"): ?> +
      + Grid +
      +
      + Mosaic +
      + +
      + Slideshow +
      +
      + +
      + + + + +
      + + + diff --git a/3.0/themes/pear4gallery3/views/paginator.html.php b/3.0/themes/pear4gallery3/views/paginator.html.php new file mode 100644 index 00000000..805ae3dc --- /dev/null +++ b/3.0/themes/pear4gallery3/views/paginator.html.php @@ -0,0 +1,32 @@ + + + diff --git a/3.1/themes/browny_wind/views/photo.html.php b/3.0/themes/pear4gallery3/views/photo.html.php similarity index 100% rename from 3.1/themes/browny_wind/views/photo.html.php rename to 3.0/themes/pear4gallery3/views/photo.html.php diff --git a/3.0/themes/pear4gallery3/views/search.html.php b/3.0/themes/pear4gallery3/views/search.html.php new file mode 100644 index 00000000..3436a00c --- /dev/null +++ b/3.0/themes/pear4gallery3/views/search.html.php @@ -0,0 +1,48 @@ + + +
      " id="g-search-form" class="g-short-form"> +
      + + + +
        +
      • + + +
      • +
      • + for_html_attr() ?>" class="submit" /> +
      • +
      +
      +
      + +
      +

      + + + + paginator() ?> + + +

      + %term", array("term" => $q)) ?> +

      + + +
      diff --git a/3.1/modules/themeroller/data/views/sidebar.html.php b/3.0/themes/pear4gallery3/views/sidebar.html.php similarity index 100% rename from 3.1/modules/themeroller/data/views/sidebar.html.php rename to 3.0/themes/pear4gallery3/views/sidebar.html.php diff --git a/3.0/themes/pear4gallery3/views/thumbs.html.php b/3.0/themes/pear4gallery3/views/thumbs.html.php new file mode 100644 index 00000000..716ad657 --- /dev/null +++ b/3.0/themes/pear4gallery3/views/thumbs.html.php @@ -0,0 +1,73 @@ + +paginator() ?> + + + $child): ?> + 50) break; ?> + + is_album()): ?> + url()."/'+getAlbumHash(skimimg);"; ?> + + + is_photo()): ?> + + is_movie()): ?> + url()."';"; ?> + + + + + + + admin || access::can("add", $item)): ?> + id") ?> +
    • Add some.", + array("attrs" => html::mark_clean("href=\"$addurl\" class=\"g-dialog-link\""))) ?>
    • + +
    • + + diff --git a/3.0/themes/three_nids/admin/helpers/three_nids_event.php b/3.0/themes/three_nids/admin/helpers/three_nids_event.php index abb221fc..17d20012 100644 --- a/3.0/themes/three_nids/admin/helpers/three_nids_event.php +++ b/3.0/themes/three_nids/admin/helpers/three_nids_event.php @@ -1,7 +1,7 @@ nvps = new ArrayList (); - nvps.add(new BasicNameValuePair("user", USERNAME)); - nvps.add(new BasicNameValuePair("password", USERNAME)); - post.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8)); - response = httpclient.execute(post); - String api_key = gson.fromJson(new BufferedReader( - new InputStreamReader(response.getEntity().getContent())).readLine(), String.class); - System.out.println("API Key:" + api_key); - - // Get the JSON representation of the root album, which we know has id 1 - HttpGet get = new HttpGet(BASE_URL + "/rest/item/1"); - get.setHeader("X-Gallery-Request-Method", "GET"); - get.setHeader("X-Gallery-Request-Key", api_key); - response = httpclient.execute(get); - - System.out.println( - "Response: " + new BufferedReader(new InputStreamReader(response.getEntity().getContent())).readLine()); - } -} diff --git a/3.1/client/Java/README b/3.1/client/Java/README deleted file mode 100644 index 2a11795f..00000000 --- a/3.1/client/Java/README +++ /dev/null @@ -1,10 +0,0 @@ -This is very, very rough sample code for how to do some Java REST -requests. To run this code: - -1) Edit Demo.java and set the BASE_URL to your Gallery3 install. -2) Edit USERNAME and PASSWORD as appropriate -3) In a shell, do "sh build.sh" -4) In a shell, do "sh run.sh" - -Note that there is NO error checking, so if something goes wrong -you'll have to debug it. diff --git a/3.1/client/Java/build.sh b/3.1/client/Java/build.sh deleted file mode 100644 index 146932bd..00000000 --- a/3.1/client/Java/build.sh +++ /dev/null @@ -1 +0,0 @@ -javac -classpath lib/httpclient-4.0.1.jar:lib/httpcore-4.0.1.jar:lib/gson-1.4.jar Demo.java diff --git a/3.1/client/Java/lib/commons-logging-api-1.1.1.jar b/3.1/client/Java/lib/commons-logging-api-1.1.1.jar deleted file mode 100644 index bd451168..00000000 Binary files a/3.1/client/Java/lib/commons-logging-api-1.1.1.jar and /dev/null differ diff --git a/3.1/client/Java/lib/gson-1.4.jar b/3.1/client/Java/lib/gson-1.4.jar deleted file mode 100644 index b9c33d03..00000000 Binary files a/3.1/client/Java/lib/gson-1.4.jar and /dev/null differ diff --git a/3.1/client/Java/lib/httpclient-4.0.1.jar b/3.1/client/Java/lib/httpclient-4.0.1.jar deleted file mode 100644 index e9c961f1..00000000 Binary files a/3.1/client/Java/lib/httpclient-4.0.1.jar and /dev/null differ diff --git a/3.1/client/Java/lib/httpcore-4.0.1.jar b/3.1/client/Java/lib/httpcore-4.0.1.jar deleted file mode 100644 index 4638daa5..00000000 Binary files a/3.1/client/Java/lib/httpcore-4.0.1.jar and /dev/null differ diff --git a/3.1/client/Java/run.sh b/3.1/client/Java/run.sh deleted file mode 100644 index 94ccb6e6..00000000 --- a/3.1/client/Java/run.sh +++ /dev/null @@ -1 +0,0 @@ -java -classpath lib/httpclient-4.0.1.jar:lib/httpcore-4.0.1.jar:lib/commons-logging-api-1.1.1.jar:lib/gson-1.4.jar:. Demo diff --git a/3.1/client/PHP/.gitignore b/3.1/client/PHP/.gitignore deleted file mode 100644 index b4700053..00000000 --- a/3.1/client/PHP/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# local file to provide configuration for the client code. See README. -local_config.php diff --git a/3.1/client/PHP/Gallery3.php b/3.1/client/PHP/Gallery3.php deleted file mode 100644 index fb97ddf8..00000000 --- a/3.1/client/PHP/Gallery3.php +++ /dev/null @@ -1,205 +0,0 @@ - $user, "password" => $pass)); - return $response; - } - - /** - * Construct a new Gallery3 instance associated with a remote resource - * @param string remote url - * @param string authentication token - * @return object Gallery3 - */ - static function factory($url=null, $token=null) { - $obj = new Gallery3(); - $obj->token = $token; - $obj->url = $url; - if ($url && $token) { - $obj->load(); - } - return $obj; - } - - /** - * Constructor. - */ - public function __construct() { - $this->data = new stdClass(); - $this->token = null; - $this->url = null; - } - - /** - * Set a value on the remote resource's entity. You must call save for it to take effect. - * - * @param string key - * @param string value - * @return object Gallery3 - * @chainable - */ - public function set($key, $value) { - $this->data->entity->$key = $value; - return $this; - } - - /** - * Replace the members for the remote resource - * - * @param array members - * @return object Gallery3 - * @chainable - */ - public function set_members($members) { - $this->data->members = $members; - return $this; - } - - /** - * Attach a file to the remote resource. - * - * @param string path to a local file (eg: /tmp/foo.jpg) - * @return object Gallery3 - */ - public function set_file($file) { - $this->file = $file; - return $this; - } - - /** - * Save any local changes made to this resource. If this is an existing resource, we'll return - * the resource itself. If we're creating a new resource, return the newly created resource. - * - * @return object Gallery3 - */ - public function create($url, $token) { - if (!is_string($url)) { - throw new Gallery3_Exception("Invalid url: " . var_export($url)); - } - - $response = Gallery3_Helper::request( - "post", $url, $token, array("entity" => $this->data->entity), $this->file); - $this->url = $response->url; - $this->token = $token; - return $this->load(); - } - - /** - * Save any local changes made to this resource. If this is an existing resource, we'll return - * the resource itself. If we're creating a new resource, return the newly created resource. - * - * @return object Gallery3 - */ - public function save() { - $data = array(); - $data["entity"] = array_diff((array)$this->data->entity, $this->original_entity); - if (isset($this->data->members)) { - $data["members"] = $this->data->members; - } - if ($this->file) { - $response = Gallery3_Helper::request("put", $this->url, $this->token, $data, $this->file); - } else { - $response = Gallery3_Helper::request("put", $this->url, $this->token, $data); - } - return $this->load(); - } - - /** - * Delete the remote resource. - * - * @return object Gallery3 - */ - public function delete() { - Gallery3_Helper::request("delete", $this->url, $this->token); - $this->data = array(); - $this->url = null; - return $this; - } - - /** - * Reload the resource from a given url. This is useful after the remote resource has been - * modified. - * - * @return object Gallery3 - */ - public function load() { - $response = Gallery3_Helper::request("get", $this->url, $this->token); - $this->data = $response; - $this->original_entity = isset($response->entity) ? (array)$response->entity : null; - return $this; - } -} - -class Gallery3_Helper { - static function request($method, $url, $token=null, $params=array(), $file=null) { - $req = new HTTP_Request($url); - $req->setMethod($method == "get" ? HTTP_REQUEST_METHOD_GET : HTTP_REQUEST_METHOD_POST); - $req->addHeader("X-Gallery-Request-Method", $method); - if ($token) { - $req->addHeader("X-Gallery-Request-Key", $token); - } - foreach ($params as $key => $value) { - $req->addPostData($key, is_string($value) ? $value : json_encode($value)); - } - if ($file) { - $req->addFile("file", $file, mime_content_type($file)); - } - $req->sendRequest(); - - switch ($req->getResponseCode()) { - case 200: - case 201: - return json_decode($req->getResponseBody()); - - case 403: - throw new Gallery3_Forbidden_Exception($req->getResponseBody()); - - default: - throw new Gallery3_Exception($req->getResponseBody()); - } - } -} - -class Gallery3_Exception extends Exception { -} - -class Gallery3_Forbidden_Exception extends Gallery3_Exception { -} \ No newline at end of file diff --git a/3.1/client/PHP/README b/3.1/client/PHP/README deleted file mode 100644 index 4035bae1..00000000 --- a/3.1/client/PHP/README +++ /dev/null @@ -1,4 +0,0 @@ -# Create a local file called local_config.php and add the following content: -$SITE_URL = "http:///gallery3/index.php/rest"; -$USER = ""; -$PASSWORD = ""; diff --git a/3.1/client/PHP/example.php b/3.1/client/PHP/example.php deleted file mode 100644 index 5bfc49a2..00000000 --- a/3.1/client/PHP/example.php +++ /dev/null @@ -1,112 +0,0 @@ -set("name", "My Tag") - ->create($tags->url, $auth); -alert("Created tag: {$tag->url}"); - -$album = Gallery3::factory() - ->set("type", "album") - ->set("name", "Sample Album") - ->set("title", "This is my Sample Album") - ->create($root->url, $auth); -alert("Created album: {$album->url} {$album->data->entity->title}"); - - -alert("Modify the album"); -$album - ->set("title", "This is the new title") - ->save(); -alert("New title: {$album->data->entity->title}"); - -for ($i = 0; $i < 2; $i++) { - $photo = Gallery3::factory() - ->set("type", "photo") - ->set("name", "Sample Photo.png") - ->set("title", "Sample Photo") - ->set_file("test1.png") - ->create($album->url, $auth); - alert("Uploaded photo: {$photo->url}"); -} -$album->load(); -alert("Album members: " . join(", ", $album->data->members) . ""); - - -alert("Replace the data file"); -$photo->set_file("test2.png") - ->save(); - - -$comment = Gallery3::factory() - ->set("item", $album->data->members[0]) - ->set("type", "comment") - ->set("text", "This is a random comment-- whee!") - ->create($comments->url, $auth); -alert("Comment: {$comment->url}"); - -alert("Reorder the album"); -$album - ->set_members(array($album->data->members[1], $album->data->members[0])) - ->set("sort_column", "weight") - ->save(); -alert("New order: " . join(", ", $album->data->members) . ""); - -alert("Search for the photo"); -$photos = Gallery3::factory($root->url, $auth) - ->set("name", "Sample") - ->load(); -alert("Found: {$photos->data->members[0]}"); - - -alert("Grab a random photo"); -$photos = Gallery3::factory("{$root->url}?random=true", $auth) - ->load(); -alert("Found: {$photos->data->members[0]}"); - - -alert("Tag the album (using the album's relationships: {$album->data->relationships->tags->url})"); -$tag_relationship1 = Gallery3::factory() - ->set("tag", $tag->url) - ->set("item", $root->url) - ->create($album->data->relationships->tags->url, $auth); -alert("Tag: {$tag_relationship1->url}"); - - -alert("Tag the photo (using the tag's relationships: {$tag->data->relationships->items->url})"); -$tag_relationship2 = Gallery3::factory() - ->set("tag", $tag->url) - ->set("item", $photo->url) - ->create($tag->data->relationships->items->url, $auth); -alert("Tag: {$tag_relationship2->url}"); - -alert("Un-tag the photo"); -$tag_relationship2->delete(); -$tag->load(); -alert("1 remaining tag: {$tag->data->relationships->items->members[0]}"); - -alert("Delete the album and tag"); -$album->delete(); -$tag->delete(); - -alert("Done!"); - -function alert($msg) { - print "$msg
      \n"; - flush(); -} -?> \ No newline at end of file diff --git a/3.1/client/PHP/test1.png b/3.1/client/PHP/test1.png deleted file mode 100644 index ca8e0e95..00000000 Binary files a/3.1/client/PHP/test1.png and /dev/null differ diff --git a/3.1/client/PHP/test2.png b/3.1/client/PHP/test2.png deleted file mode 100644 index fdc97779..00000000 Binary files a/3.1/client/PHP/test2.png and /dev/null differ diff --git a/3.1/modules/about_this_album/helpers/about_this_album_block.php b/3.1/modules/about_this_album/helpers/about_this_album_block.php deleted file mode 100644 index aefafff5..00000000 --- a/3.1/modules/about_this_album/helpers/about_this_album_block.php +++ /dev/null @@ -1,76 +0,0 @@ - t("About This Album")); - } - - static function get($block_id, $theme) { - switch ($block_id) { - case "aboutthisalbum": - $item = $theme->item; - if ((!$item) or (!$theme->item->is_album())) { - return ""; - } - if ($theme->item->is_album()) { - $block = new Block(); - $block->css_id = "g-about-this-album"; - $block->content = new View("about_this_album.html"); - - if ($theme->item()->id == item::root()->id) { - $block->title = t("About this Site"); - $block->content->album_count = ORM::factory("item")->where("type", "=", "album")->where("id", "<>", 1)->count_all(); - $block->content->photo_count = ORM::factory("item")->where("type", "=", "photo")->count_all(); - $block->content->vcount = Database::instance()->query("SELECT SUM({items}.view_count) as c FROM {items} WHERE type=\"photo\"")->current()->c; - } Else { - $block->title = t("About this Album"); - $block->content->album_count = $item->descendants_count(array(array("type", "=", "album"))); - $block->content->photo_count = $item->descendants_count(array(array("type", "=", "photo"))); - // $block->content->vcount= $theme->item()->view_count; - $descds = $item->descendants(); - $descds_view = 0; - foreach ($descds as $descd) { - if ($descd->is_photo()) { - $descds_view += $descd->view_count; - } - } - $block->content->vcount = $descds_view; - if ($item->description) { - $block->content->description = html::clean($item->description); - } - } - - - $all_tags = ORM::factory("tag") - ->join("items_tags", "items_tags.tag_id", "tags.id") - ->join("items", "items.id", "items_tags.item_id", "LEFT") - ->where("items.parent_id", "=", $item->id) - ->order_by("tags.id", "ASC") - ->find_all(); - if (count($all_tags) > 0) { - $block->content->all_tags = $all_tags; - } - } - break; - } - return $block; - } -} diff --git a/3.1/modules/about_this_album/module.info b/3.1/modules/about_this_album/module.info deleted file mode 100644 index 19a0e6f1..00000000 --- a/3.1/modules/about_this_album/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "About this Album" -description = "Show some simple, specific and useful info about a given album" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:about_this_album" -discuss_url = "http://gallery.menalto.com/forum_module_about_this_album" diff --git a/3.1/modules/about_this_album/views/about_this_album.html.php b/3.1/modules/about_this_album/views/about_this_album.html.php deleted file mode 100644 index 01dee4f7..00000000 --- a/3.1/modules/about_this_album/views/about_this_album.html.php +++ /dev/null @@ -1,68 +0,0 @@ - - - diff --git a/3.1/modules/about_this_photo/helpers/about_this_photo_block.php b/3.1/modules/about_this_photo/helpers/about_this_photo_block.php deleted file mode 100644 index 267f3904..00000000 --- a/3.1/modules/about_this_photo/helpers/about_this_photo_block.php +++ /dev/null @@ -1,71 +0,0 @@ - t("About This Photo")); - } - - static function get($block_id, $theme) { - $block = new Block(); - switch ($block_id) { - case "simple": - $item = $theme->item; - if ((!$item) or (!$item->is_photo())) { - return ""; - } - $block->css_id = "g-about-this-photo"; - $block->title = t("About this photo"); - $block->content = new View("about_this_photo.html"); - - // exif API doesn't give easy access to individual keys, so do this the hard way - if (module::is_active("exif")) { - $exif = ORM::factory("exif_record")->where("item_id", "=", $theme->item()->id)->find(); - if ($exif->loaded()) { - $exif = unserialize($exif->data); - $timestamp = strtotime($exif["DateTime"]); - //$block->content->date = gallery::date($timestamp); - $block->content->date = date('D j M Y', $timestamp); - $block->content->time = gallery::time($timestamp); - } - } - - $block->content->vcount = $theme->item()->view_count; - - // IPTC - copied more or less from iptc.php - if (module::is_active("iptc")) { - $record = ORM::factory("iptc_record")->where("item_id", "=", $theme->item()->id)->find(); - if ($record->loaded()) { - $record = unserialize($record->data); - $block->content->name = $record["ObjectName"]; - $block->content->caption = $record["Caption"]; - - } - } - - if (module::is_active("tag")) { - $block->content->tags = tag::item_tags($theme->item()); - } - break; - } - return $block; - } -} - diff --git a/3.1/modules/about_this_photo/module.info b/3.1/modules/about_this_photo/module.info deleted file mode 100644 index 876b111b..00000000 --- a/3.1/modules/about_this_photo/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "About this Photo" -description = "Show some simple, specific and useful info about a given photo" -version = 3 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:about_this_photo" -discuss_url = "http://gallery.menalto.com/forum_module_about_this_photo" diff --git a/3.1/modules/about_this_photo/views/about_this_photo.html.php b/3.1/modules/about_this_photo/views/about_this_photo.html.php deleted file mode 100644 index f0ef130a..00000000 --- a/3.1/modules/about_this_photo/views/about_this_photo.html.php +++ /dev/null @@ -1,34 +0,0 @@ - - - diff --git a/3.1/modules/adsense/controllers/admin_adsense.php b/3.1/modules/adsense/controllers/admin_adsense.php deleted file mode 100644 index 05f0c6ad..00000000 --- a/3.1/modules/adsense/controllers/admin_adsense.php +++ /dev/null @@ -1,57 +0,0 @@ -page_title = t("Adsense settings"); - $view->content = new View("admin_adsense.html"); - $view->content->form = $this->_get_admin_form(); - print $view; - } - - public function save() { - access::verify_csrf(); - $form = $this->_get_admin_form(); - if ($form->validate()) { - module::set_var("adsense", "code", $form->adsense->code->value); - module::set_var("adsense", "location", $form->adsense->location->value); - message::success(t("Adsense settings updated")); - url::redirect("admin/adsense"); - } else { - print $form; - } - } - - private function _get_admin_form() { - $form = new Forge("admin/adsense/save", "", "post", array("id" => "g-adsense-admin-form")); - $adsense_settings = $form->group("adsense")->label(t("Adsense settings")); - $adsense_settings->textarea("code")->label(t("Adsense code")) - ->value(module::get_var("adsense", "code")); - $adsense_settings->dropdown("location") - ->label(t("Where should the ads be displayed?")) - ->options(array("header" => t("In the header"), - "sidebar" => t("In the sidebar"), - "footer" => t("In the footer"))) - ->selected(module::get_var("adsense", "location")); - $adsense_settings->submit("save")->value(t("Save")); - return $form; - } -} - diff --git a/3.1/modules/adsense/helpers/adsense_block.php b/3.1/modules/adsense/helpers/adsense_block.php deleted file mode 100644 index 7c00cb45..00000000 --- a/3.1/modules/adsense/helpers/adsense_block.php +++ /dev/null @@ -1,39 +0,0 @@ - t("Adsense")); - } - - static function get($block_id, $theme) { - $block = ""; - switch ($block_id) { - case "adsense": - if (module::get_var("adsense", "location") == "sidebar") { - $block = new Block(); - $block->css_id = "g-adsense"; - $block->title = t("Adsense"); - $block->content = new View("adsense_block.html"); - } - break; - } - return $block; - } -} \ No newline at end of file diff --git a/3.1/modules/adsense/helpers/adsense_event.php b/3.1/modules/adsense/helpers/adsense_event.php deleted file mode 100644 index d72165e1..00000000 --- a/3.1/modules/adsense/helpers/adsense_event.php +++ /dev/null @@ -1,28 +0,0 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("adsense_menu") - ->label(t("Adsense")) - ->url(url::site("admin/adsense"))); - } -} diff --git a/3.1/modules/adsense/helpers/adsense_theme.php b/3.1/modules/adsense/helpers/adsense_theme.php deleted file mode 100644 index 4b7a6d0f..00000000 --- a/3.1/modules/adsense/helpers/adsense_theme.php +++ /dev/null @@ -1,54 +0,0 @@ -' . $code . ' - '; - - return $google_code; - } - } - - static function footer($theme) { - if(module::get_var("adsense","location") == "footer") { - $code = module::get_var("adsense", "code"); - if (!$code) { - return; - } - $google_code = ' - - '; - - return $google_code; - } - } -} diff --git a/3.1/modules/adsense/module.info b/3.1/modules/adsense/module.info deleted file mode 100644 index 066e0ade..00000000 --- a/3.1/modules/adsense/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Adsense" -description = "Display Google Adsense ads" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:adsense" -discuss_url = "http://gallery.menalto.com/forum_module_adsense" diff --git a/3.1/modules/adsense/views/adsense_block.html.php b/3.1/modules/adsense/views/adsense_block.html.php deleted file mode 100644 index 53f8b20a..00000000 --- a/3.1/modules/adsense/views/adsense_block.html.php +++ /dev/null @@ -1,17 +0,0 @@ -' . $code . ' - '; - - echo $google_code; -} -?> - diff --git a/3.1/modules/albumpassword/controllers/admin_albumpassword.php b/3.1/modules/albumpassword/controllers/admin_albumpassword.php deleted file mode 100644 index d146a194..00000000 --- a/3.1/modules/albumpassword/controllers/admin_albumpassword.php +++ /dev/null @@ -1,69 +0,0 @@ -content = new View("admin_albumpassword.html"); - - // Generate a form for controlling the admin section. - $view->content->albumpassword_form = $this->_get_admin_form(); - - // Display the page. - print $view; - } - - private function _get_admin_form() { - // Make a new form for changing admin settings for this module. - $form = new Forge("admin/albumpassword/saveprefs", "", "post", - array("id" => "g-album-password-admin-form")); - - // Should protected items be hidden, or completely in-accessable? - $albumpassword_group = $form->group("album_password_group"); - $albumpassword_group->checkbox("hideonly") - ->label(t("Do not require passwords")) - ->checked(module::get_var("albumpassword", "hideonly")); - - // Add a save button to the form. - $albumpassword_group->submit("save_settings")->value(t("Save")); - - // Return the newly generated form. - return $form; - } - - public function saveprefs() { - // Save user specified preferences. - - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Retrieve submitted form data. - if (Input::instance()->post("hideonly") == false) { - module::set_var("albumpassword", "hideonly", false); - } else { - module::set_var("albumpassword", "hideonly", true); - } - // Display a success message and redirect back to the TagsMap admin page. - message::success(t("Your settings have been saved.")); - url::redirect("admin/albumpassword"); - } -} diff --git a/3.1/modules/albumpassword/controllers/albumpassword.php b/3.1/modules/albumpassword/controllers/albumpassword.php deleted file mode 100644 index 6fea60e8..00000000 --- a/3.1/modules/albumpassword/controllers/albumpassword.php +++ /dev/null @@ -1,181 +0,0 @@ -form = $this->_get_password_form($id); - print $view; - } - - public function login() { - // Display prompt to allow visitors to use their passwords. - - // Create the page. - $view = new View("loginpassword.html"); - $view->form = $this->_get_login_form(); - print $view; - } - - public function remove($id) { - // Remove a password from an album - - // Make sure user has view/edit privileges for this item - $item = ORM::factory("item", $id); - access::required("view", $item); - access::required("edit", $item); - - // Check for and delete the password and any cached ids assigned to it. - $existing_password = ORM::factory("items_albumpassword")->where("album_id", "=", $id)->find_all(); - if (count($existing_password) > 0) { - foreach ($existing_password as $one_password) { - db::build()->delete("albumpassword_idcaches")->where("password_id", "=", $one_password->id)->execute(); - } - db::build()->delete("items_albumpasswords")->where("album_id", "=", $id)->execute(); - message::success(t("Password Removed.")); - } - - // Redirect the user back to the album. - url::redirect(url::abs_site("albums/" . $id)); - } - - public function savepassword() { - // Save a newly assigned password. - - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Convert submitted data to local variables. - $album_id = Input::instance()->post("item_id"); - $album_password = strtolower(Input::instance()->post("assignpassword_password")); - - // Check for, and remove, any existing passwords and cached ids. - $existing_password = ORM::factory("items_albumpassword")->where("album_id", "=", $album_id)->find_all(); - if (count($existing_password) > 0) { - foreach ($existing_password as $one_password) { - db::build()->delete("albumpassword_idcaches")->where("password_id", "=", $one_password->id)->execute(); - } - db::build()->delete("items_albumpasswords")->where("album_id", "=", $album_id)->execute(); - } - - // Save the new password. - $new_password = ORM::factory("items_albumpassword"); - $new_password->album_id = $album_id; - $new_password->password = $album_password; - $new_password->save(); - - // Add the album to the id cache. - $cached_album = ORM::factory("albumpassword_idcache"); - $cached_album->password_id = $new_password->id; - $cached_album->item_id = $album_id; - $cached_album->save(); - - // Check for any sub-items within the album, add all of them to the id cache. - $items = ORM::factory("item", $album_id) - ->viewable() - ->descendants(); - if (count($items) > 0) { - foreach ($items as $one_item) { - $cached_item = ORM::factory("albumpassword_idcache"); - $cached_item->password_id = $new_password->id; - $cached_item->item_id = $one_item->id; - $cached_item->save(); - } - } - - // Display a success message and close the dialog. - message::success(t("Password saved.")); - print "\n\n\n\n\n"; - } - - public function logout() { - // Delete a stored password cookie. - cookie::delete("g3_albumpassword"); - cookie::delete("g3_albumpassword_id"); - url::redirect(url::abs_site("albums/1")); - } - - public function checkpassword() { - // Check that a password is valid, then store in a browser cookie. - - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Convert submitted data to local variables. - $album_password = strtolower(Input::instance()->post("albumpassword_password")); - - // See if the submitted password matches any in the database. - $existing_password = ORM::factory("items_albumpassword") - ->where("password", "=", $album_password) - ->find_all(); - - if (count($existing_password) > 0) { - // If the password if valid, then store it, and display a success message. - // If not, close the dialog and display a rejected message. - cookie::delete("g3_albumpassword_id"); - cookie::set("g3_albumpassword", $album_password); - message::success(t("Password Accepted.")); - print "\n\n\n\n\n"; - } else { - message::error(t("Password Rejected.")); - print "\n\n\n\n\n"; - } - } - - private function _get_password_form($id) { - // Generate a form for assigning a new password. - $form = new Forge("albumpassword/savepassword", "", "post", - array("id" => "g-assign-password-form")); - $assignpassword_group = $form->group("Enter Password") - ->label(t("Enter Password:")); - $assignpassword_group->hidden("item_id")->value($id); - $assignpassword_group->input("assignpassword_password") - ->id('assignpassword_password') - ->label(t("Password:")); - $assignpassword_group->submit("save_password")->value(t("Save")); - - // Return the newly generated form. - return $form; - } - - private function _get_login_form($id) { - // Generate a form for allowing visitors to enter in their passwords. - $form = new Forge("albumpassword/checkpassword", "", "post", - array("id" => "g-login-password-form")); - - $assignpassword_group = $form->group("Enter Password") - ->label(t("Enter Password:")); - $assignpassword_group->password("albumpassword_password") - ->id('albumpassword_password') - ->label(t("Password:")); - - $assignpassword_group->submit("")->value(t("Login")); - - // Return the newly generated form. - return $form; - } -} diff --git a/3.1/modules/albumpassword/helpers/MY_access.php b/3.1/modules/albumpassword/helpers/MY_access.php deleted file mode 100644 index bda1db32..00000000 --- a/3.1/modules/albumpassword/helpers/MY_access.php +++ /dev/null @@ -1,49 +0,0 @@ -where("item_id", "=", $item->id)->order_by("cache_id")->find_all(); - if (count($item_protected) > 0) { - $existing_password = ORM::factory("items_albumpassword")->where("id", "=", $item_protected[0]->password_id)->find(); - if ($existing_password->loaded()) { - if ((cookie::get("g3_albumpassword") != $existing_password->password) && - (identity::active_user()->id != $item->owner_id) && - (!identity::active_user()->admin)) { - throw new Kohana_404_Exception(); - } - } - } - } - } -} diff --git a/3.1/modules/albumpassword/helpers/MY_item.php b/3.1/modules/albumpassword/helpers/MY_item.php deleted file mode 100644 index 07f81906..00000000 --- a/3.1/modules/albumpassword/helpers/MY_item.php +++ /dev/null @@ -1,71 +0,0 @@ -admin) { - - // Display items that are not in idcaches. - $model->and_open()->join("albumpassword_idcaches", "items.id", "albumpassword_idcaches.item_id", "LEFT OUTER") - ->and_where("albumpassword_idcaches.item_id", "IS", NULL); - - // If in hide only mode, check and see if the current item is protected. - // If it is, log the user in with the password to view it. - if (module::get_var("albumpassword", "hideonly") == true) { - $existing_cacheditem = ORM::factory("albumpassword_idcache")->where("item_id", "=", $model->id)->order_by("cache_id")->find_all(); - if (count($existing_cacheditem) > 0) { - $existing_cacheditem_password = ORM::factory("items_albumpassword")->where("id", "=", $existing_cacheditem[0]->password_id)->find_all(); - if (cookie::get("g3_albumpassword") != $existing_cacheditem_password[0]->password) { - cookie::set("g3_albumpassword", $existing_cacheditem_password[0]->password); - cookie::set("g3_albumpassword_id", $existing_cacheditem_password[0]->id); - $model->or_where("albumpassword_idcaches.password_id", "=", $existing_cacheditem_password[0]->id); - } - } - } - - // ... Unless their password id corresponds with a valid password. - $existing_password = ORM::factory("items_albumpassword")->where("password", "=", cookie::get("g3_albumpassword"))->find_all(); - if (count($existing_password) > 0) { - foreach ($existing_password as $one_password) { - if (cookie::get("g3_albumpassword_id") != "") { - if (cookie::get("g3_albumpassword_id") == $one_password->id) { - $model->or_where("albumpassword_idcaches.password_id", "=", $one_password->id); - } - } else { - $model->or_where("albumpassword_idcaches.password_id", "=", $one_password->id); - } - } - } - - // Or the current user is the owner of the item. - $model->or_where("items.owner_id", "=", identity::active_user()->id)->close(); - } - - return $model; - } -} diff --git a/3.1/modules/albumpassword/helpers/albumpassword_event.php b/3.1/modules/albumpassword/helpers/albumpassword_event.php deleted file mode 100644 index b6b93e81..00000000 --- a/3.1/modules/albumpassword/helpers/albumpassword_event.php +++ /dev/null @@ -1,158 +0,0 @@ -item()) { - return; - } - $item = $theme->item(); - - // If there isn't currently a password stored in the cookie, - // then display the enter password link. - if (cookie::get("g3_albumpassword") == "") { - $menu->append(Menu::factory("dialog") - ->id("albumpassword_login") - ->css_id("g-album-password-login") - ->url(url::site("albumpassword/login")) - ->label(t("Unlock albums"))); - } else { - // If a password has been entered already - // display the log out link, and links to the protected albums - $menu->append(Menu::factory("submenu") - ->id("albumpassword_protected") - ->css_id("g-album-password-protected") - ->label(t("Protected albums"))); - $menu->get("albumpassword_protected") - ->append(Menu::factory("link") - ->id("albumpassword_logout") - ->css_id("g-album-password-logout") - ->url(url::site("albumpassword/logout")) - ->label(t("Clear password"))); - $existing_password = ""; - if (cookie::get("g3_albumpassword_id") != "") { - $existing_password = ORM::factory("items_albumpassword") - ->where("password", "=", cookie::get("g3_albumpassword")) - ->where("id", "=", cookie::get("g3_albumpassword_id")) - ->find_all(); - } else { - $existing_password = ORM::factory("items_albumpassword") - ->where("password", "=", cookie::get("g3_albumpassword")) - ->find_all(); - } - if (count($existing_password) > 0) { - $counter = 0; - while ($counter < count($existing_password)) { - $item_album = ORM::factory("item")->where("id", "=", $existing_password[$counter]->album_id)->find(); - $menu->get("albumpassword_protected") - ->append(Menu::factory("link") - ->id("albumpassword_album" . $counter) - ->label(html::purify($item_album->title)) - ->css_id("g-album-password-album" . $counter) - ->url(url::abs_site("{$item_album->type}s/{$item_album->id}"))); - $counter++; - } - } - } - - // If this is an album without a password, display a link for assigning one. - // If this is an album with a password, display a link to remove it. - if ($item->is_album()) { - if ((access::can("view", $item)) && (access::can("edit", $item))) { - $existing_password = ORM::factory("items_albumpassword") - ->where("album_id", "=", $item->id) - ->find_all(); - if (count($existing_password) > 0) { - $menu->get("options_menu") - ->append(Menu::factory("link") - ->id("albumpassword_remove") - ->label(t("Remove password")) - ->css_id("g-album-password-remove") - ->url(url::site("albumpassword/remove/" . $item->id))); - } elseif ($item->id != 1) { - $passworded_subitems = ORM::factory("item", $item->id) - ->and_open()->join("albumpassword_idcaches", "items.id", "albumpassword_idcaches.item_id", "LEFT OUTER") - ->where("albumpassword_idcaches.item_id", "IS NOT", NULL)->close() - ->descendants(); - - $existing_cacheditem = ORM::factory("albumpassword_idcache")->where("item_id", "=", $item->id)->order_by("cache_id")->find_all(); - if ((count($existing_cacheditem) == 0) && count($passworded_subitems) == 0) { - $menu->get("options_menu") - ->append(Menu::factory("dialog") - ->id("albumpassword_assign") - ->label(t("Assign password")) - ->css_id("g-album-password-assign") - ->url(url::site("albumpassword/assign/" . $item->id))); - } - } - } - } - } - - static function item_deleted($item) { - // Check for and delete the password and any cached ids assigned to it. - $existing_password = ORM::factory("items_albumpassword")->where("album_id", "=", $item->id)->find_all(); - if (count($existing_password) > 0) { - foreach ($existing_password as $one_password) { - db::build()->delete("albumpassword_idcaches")->where("password_id", "=", $one_password->id)->execute(); - } - db::build()->delete("items_albumpasswords")->where("album_id", "=", $item->id)->execute(); - message::success(t("Password Removed.")); - } else { - db::build()->delete("albumpassword_idcaches")->where("item_id", "=", $item->id)->execute(); - } - } - - static function item_created($item) { - // Check for any already existing password on parent album(s), if found, generate cache data for the new item. - $existing_password = ORM::factory("albumpassword_idcache")->where("item_id", "=", $item->parent_id)->order_by("cache_id")->find_all(); - if (count($existing_password) > 0) { - $new_cachedid = ORM::factory("albumpassword_idcache"); - $new_cachedid->password_id = $existing_password[0]->password_id; - $new_cachedid->item_id = $item->id; - $new_cachedid->save(); - } - } - - static function item_moved($item, $old_parent) { - // Delete any existing cache data. - db::build()->delete("albumpassword_idcaches")->where("item_id", "=", $item->id)->execute(); - - // Check for a password on the new parent, generate cache data if necessary. - $existing_password = ORM::factory("albumpassword_idcache")->where("item_id", "=", $item->parent_id)->order_by("cache_id")->find_all(); - if (count($existing_password) > 0) { - $new_cachedid = ORM::factory("albumpassword_idcache"); - $new_cachedid->password_id = $existing_password[0]->password_id; - $new_cachedid->item_id = $item->id; - $new_cachedid->save(); - } - } - - static function admin_menu($menu, $theme) { - // Add a link to the Album Password admin page to the Content menu. - $menu->get("settings_menu") - ->append(Menu::factory("link") - ->id("albumpassword") - ->label(t("Album Password Settings")) - ->url(url::site("admin/albumpassword"))); - } -} diff --git a/3.1/modules/albumpassword/helpers/albumpassword_installer.php b/3.1/modules/albumpassword/helpers/albumpassword_installer.php deleted file mode 100644 index 93a6d0c0..00000000 --- a/3.1/modules/albumpassword/helpers/albumpassword_installer.php +++ /dev/null @@ -1,72 +0,0 @@ -query("CREATE TABLE IF NOT EXISTS {items_albumpasswords} ( - `id` int(9) NOT NULL auto_increment, - `album_id` int(9) NOT NULL, - `password` varchar(64) NOT NULL, - PRIMARY KEY (`id`)) - DEFAULT CHARSET=utf8;"); - - // Create a table to store a list of all protected items in. - $db->query("CREATE TABLE IF NOT EXISTS {albumpassword_idcaches} ( - `cache_id` int(9) NOT NULL auto_increment, - `password_id` int(9) NOT NULL, - `item_id` int(9) NOT NULL, - PRIMARY KEY (`cache_id`)) - DEFAULT CHARSET=utf8;"); - - // Set the default value for this module's behavior. - module::set_var("albumpassword", "hideonly", true); - - // Set the module's version number. - module::set_version("albumpassword", 3); - } - - static function upgrade($version) { - $db = Database::instance(); - if ($version == 1) { - // Set the default value for this module's behavior. - module::set_var("albumpassword", "hideonly", true); - module::set_version("albumpassword", $version = 2); - } - if ($version == 2) { - // Create a table to store a list of all protected items in. - $db->query("CREATE TABLE IF NOT EXISTS {albumpassword_idcaches} ( - `cache_id` int(9) NOT NULL auto_increment, - `password_id` int(9) NOT NULL, - `item_id` int(9) NOT NULL, - PRIMARY KEY (`cache_id`)) - DEFAULT CHARSET=utf8;"); - module::set_version("albumpassword", $version = 3); - } - } - - static function uninstall() { - // Delete the password table before uninstalling. - $db = Database::instance(); - $db->query("DROP TABLE IF EXISTS {items_albumpasswords};"); - $db->query("DROP TABLE IF EXISTS {albumpassword_idcaches};"); - module::delete("albumpassword"); - } -} diff --git a/3.1/modules/albumpassword/helpers/albumpassword_task.php b/3.1/modules/albumpassword/helpers/albumpassword_task.php deleted file mode 100644 index 07f620e1..00000000 --- a/3.1/modules/albumpassword/helpers/albumpassword_task.php +++ /dev/null @@ -1,197 +0,0 @@ -join("albumpassword_idcaches", "items_albumpasswords.id", "albumpassword_idcaches.password_id", "LEFT OUTER") - ->and_where("albumpassword_idcaches.password_id", "IS", NULL)->count_all(); - - $tasks = array(); - - $tasks[] = Task_Definition::factory() - ->callback("albumpassword_task::update_idcaches") - ->name(t("Rebuild Album Password ID Caches DB")) - ->description(t("Logs the contents of all protected albums into the db.")) - ->severity($bad_albums ? log::WARNING : log::SUCCESS); - - $tasks[] = Task_Definition::factory() - ->callback("albumpassword_task::lowercase_passwords") - ->name(t("Fix Password DB Casing")) - ->description(t("Fixes case sensitivity issues.")) - ->severity(log::SUCCESS); - - return $tasks; - } - - static function lowercase_passwords($task) { - // Converts all passwords to lower case. - - $start = microtime(true); - $total = $task->get("total"); - $existing_passwords = ORM::factory("items_albumpassword")->find_all(); - - if (empty($total)) { - // Set the initial values for all variables. - $task->set("total", count($existing_passwords)); - $total = $task->get("total"); - $task->set("last_password_id", 0); - $task->set("completed_passwords", 0); - } - - // Retrieve the values for variables from the last time this - // function was run. - $last_password_id = $task->get("last_password_id"); - $completed_passwords = $task->get("completed_passwords"); - - foreach (ORM::factory("items_albumpassword") - ->where("id", ">", $last_password_id) - ->order_by("id") - ->find_all(100) as $one_password) { - $one_password->password = strtolower($one_password->password); - $one_password->save(); - - $last_password_id = $one_password->id; - $completed_passwords++; - - if ($completed_passwords == count($existing_passwords) || microtime(true) - $start > 1.5) { - break; - } - } - - $task->set("last_password_id", $last_password_id); - $task->set("completed_passwords", $completed_passwords); - - if ($completed_passwords == count($existing_passwords)) { - $task->done = true; - $task->state = "success"; - $task->percent_complete = 100; - } else { - $task->percent_complete = round(100 * $completed_passwords / count($existing_passwords)); - } - $task->status = t2("One password fixed", "%count / %total passwords fixed", $completed_passwords, - array("total" => count($existing_passwords))); - } - - static function update_idcaches($task) { - // Populate the idcaches table with the contents of all protected albums. - - $start = microtime(true); - $total = $task->get("total"); - $existing_passwords = ORM::factory("items_albumpassword")->find_all(); - // If this is the first time this function has been run, - // delete and re-create the idcaches table, and set up - // some initial variables. - if (empty($total)) { - // Delete the idcache table and make a new one. - $db = Database::instance(); - $db->query("DROP TABLE IF EXISTS {albumpassword_idcaches};"); - $db->query("CREATE TABLE IF NOT EXISTS {albumpassword_idcaches} ( - `cache_id` int(9) NOT NULL auto_increment, - `password_id` int(9) NOT NULL, - `item_id` int(9) NOT NULL, - PRIMARY KEY (`cache_id`)) - DEFAULT CHARSET=utf8;"); - - // Set the initial values for all variables. - $task->set("total", count($existing_passwords)); - $total = $task->get("total"); - $task->set("last_album_counter", 0); - $task->set("last_id", 0); - $task->set("completed_albums", 0); - $task->set("completed_items", 0); - $task->set("total_items", 0); - } - - // Retrieve the values for variables from the last time this - // function was run. - $last_album_counter = $task->get("last_album_counter"); - $completed_albums = $task->get("completed_albums"); - $completed_items = $task->get("completed_items"); - $total_items = $task->get("total_items"); - $last_id = $task->get("last_id"); - - // If completed_items is 0, then we're just starting to process this - // album. Add the album to idcaches before adding it's contents. - if ($completed_items == 0) { - // Add the album to the id cache. - $cached_album = ORM::factory("albumpassword_idcache"); - $cached_album->password_id = $existing_passwords[$last_album_counter]->id; - $cached_album->item_id = $existing_passwords[$last_album_counter]->album_id; - $cached_album->save(); - - // Set total_items to the number of items in this album. - $total_items = ORM::factory("item", $existing_passwords[$last_album_counter]->album_id) - ->descendants_count(); - $task->set("total_items", $total_items); - } - - // Add each item in the album to idcaches. - foreach (ORM::factory("item", $existing_passwords[$last_album_counter]->album_id) - ->where("id", ">", $last_id) - ->order_by("id") - ->descendants(100) as $item) { - - $cached_item = ORM::factory("albumpassword_idcache"); - $cached_item->password_id =$existing_passwords[$last_album_counter]->id; - $cached_item->item_id = $item->id; - $cached_item->save(); - - $last_id = $item->id; - $completed_items++; - - // Set a time limit so the script doesn't time out. - if (microtime(true) - $start > 1.5) { - break; - } - } // end foreach - - // If completed_items equals total_items, then we've - // processed everything in the current album. - // Increase variables and set everything up for the - // next album. - if ($completed_items == $total_items) { - $completed_items = 0; - $last_album_counter++; - $completed_albums++; - $last_id = 0; - } - - // Store the current values of the variables for the next - // time this function is called. - $task->set("last_album_counter", $last_album_counter); - $task->set("last_id", $last_id); - $task->set("completed_albums", $completed_albums); - $task->set("completed_items", $completed_items); - - // Display the number of albums that have been completed before exiting. - if ($total == $completed_albums) { - $task->done = true; - $task->state = "success"; - $task->percent_complete = 100; - $task->status = t("Scanning Protected Album $completed_albums of $total"); - } else { - $task->percent_complete = round(100 * $completed / $total); - $task->status = t("Scanning Protected Album $completed_albums of $total -- $completed_items / $total_items files"); - } - } -} diff --git a/3.1/modules/albumpassword/models/albumpassword_idcache.php b/3.1/modules/albumpassword/models/albumpassword_idcache.php deleted file mode 100644 index e3d80667..00000000 --- a/3.1/modules/albumpassword/models/albumpassword_idcache.php +++ /dev/null @@ -1,21 +0,0 @@ - -

      - -

      -
      -
      - -

      -
      diff --git a/3.1/modules/albumpassword/views/assignpassword.html.php b/3.1/modules/albumpassword/views/assignpassword.html.php deleted file mode 100644 index c1a60b8d..00000000 --- a/3.1/modules/albumpassword/views/assignpassword.html.php +++ /dev/null @@ -1,7 +0,0 @@ -
      -
        -
      • - -
      • -
      -
      diff --git a/3.1/modules/albumpassword/views/loginpassword.html.php b/3.1/modules/albumpassword/views/loginpassword.html.php deleted file mode 100644 index 750ffbed..00000000 --- a/3.1/modules/albumpassword/views/loginpassword.html.php +++ /dev/null @@ -1,7 +0,0 @@ -
      -
        -
      • - -
      • -
      -
      diff --git a/3.1/modules/albumtree/helpers/albumtree_block.php b/3.1/modules/albumtree/helpers/albumtree_block.php deleted file mode 100644 index f812ab17..00000000 --- a/3.1/modules/albumtree/helpers/albumtree_block.php +++ /dev/null @@ -1,38 +0,0 @@ - t("Album tree")); - } - - static function get($block_id) { - $block = new Block(); - switch ($block_id) { - case "albumtree": - $style = module::get_var("albumtree", "style", "select"); - $block->css_id = "g-albumtree"; - $block->title = t("Album Tree"); - $block->content = new View("albumtree_block_{$style}.html"); - $block->content->root = item::root(); - break; - } - return $block; - } -} \ No newline at end of file diff --git a/3.1/modules/albumtree/helpers/albumtree_installer.php b/3.1/modules/albumtree/helpers/albumtree_installer.php deleted file mode 100644 index 592a9b71..00000000 --- a/3.1/modules/albumtree/helpers/albumtree_installer.php +++ /dev/null @@ -1,33 +0,0 @@ - - diff --git a/3.1/modules/albumtree/views/albumtree_block_dtree.html.php b/3.1/modules/albumtree/views/albumtree_block_dtree.html.php deleted file mode 100644 index 257181f1..00000000 --- a/3.1/modules/albumtree/views/albumtree_block_dtree.html.php +++ /dev/null @@ -1,414 +0,0 @@ - - - - -
      -
      - -
      -
      diff --git a/3.1/modules/albumtree/views/albumtree_block_list.html.php b/3.1/modules/albumtree/views/albumtree_block_list.html.php deleted file mode 100644 index 62d8c0ad..00000000 --- a/3.1/modules/albumtree/views/albumtree_block_list.html.php +++ /dev/null @@ -1,30 +0,0 @@ - - - -
        - -
      • - title ?> -
      • -viewable()->children(null, null, array(array("type", "=", "album"))) as $child){ - makelist($child,$level+1); - } -} -makelist($root,0); -?> -
      - - diff --git a/3.1/modules/albumtree/views/albumtree_block_select.html.php b/3.1/modules/albumtree/views/albumtree_block_select.html.php deleted file mode 100644 index c4633d27..00000000 --- a/3.1/modules/albumtree/views/albumtree_block_select.html.php +++ /dev/null @@ -1,16 +0,0 @@ - - diff --git a/3.1/modules/atom/helpers/atom.php b/3.1/modules/atom/helpers/atom.php deleted file mode 100644 index e2f2d9ce..00000000 --- a/3.1/modules/atom/helpers/atom.php +++ /dev/null @@ -1,36 +0,0 @@ -element->appendChild($this->dom->createElement("name", $name)); - return $this; - } - - public function email($email) { - $this->element->appendChild($this->dom->createElement("email", $email)); - return $this; - } - - public function uri($uri) { - $this->element->appendChild($this->dom->createElement("uri", $uri)); - return $this; - } -} diff --git a/3.1/modules/atom/libraries/Atom_Base.php b/3.1/modules/atom/libraries/Atom_Base.php deleted file mode 100644 index 0cb33b0b..00000000 --- a/3.1/modules/atom/libraries/Atom_Base.php +++ /dev/null @@ -1,76 +0,0 @@ -dom = $dom; - $this->element = $dom->createElement($element_name); - } else { - $this->dom = new DOMDocument('1.0', 'utf-8'); - $this->element = $this->dom->createElementNS("http://www.w3.org/2005/Atom", $element_name); - } - $this->dom->appendChild($this->element); - $this->element_name = $element_name; - return $this; - } - - public function get_element() { - $this->add_children_to_base_element(); - return $this->element; - } - - public function as_xml() { - $this->add_children_to_base_element(); - $this->dom->formatOutput = true; - return $this->dom->saveXML(); - } - - public function as_json() { - $this->add_children_to_base_element(); - /* Both Google and Yahoo generate their JSON from XML. We could do that, too. */ - return null; - } - - public function load_xml($xml) { - /* Load XML into our DOM. We can also validate against the RELAX NG schema from the Atom RFC. */ - } - - protected function add_child($element_type, $element_name) { - // @todo check if element_type is of Atom_Base; this can also be done with no magic - $element = new $element_type($element_name, $this->dom); - $this->children[$element_name][] = $element; - return end($this->children[$element_name]); - } - - protected function add_children_to_base_element() { - foreach ($this->children as $element_type => $elements) { - $base_element = $this->element; - foreach ($elements as $id => $element) { - $base_element->appendChild($element->get_element()); - } - } - } -} \ No newline at end of file diff --git a/3.1/modules/atom/libraries/Atom_Entry.php b/3.1/modules/atom/libraries/Atom_Entry.php deleted file mode 100644 index ceb5738e..00000000 --- a/3.1/modules/atom/libraries/Atom_Entry.php +++ /dev/null @@ -1,52 +0,0 @@ -element->appendChild($this->dom->createElement("id", $id)); - return $this; - } - - public function updated($timestamp) { - $this->element->appendChild( - $this->dom->createElement("updated", atom::unix_to_internet_timestamp($timestamp))); - return $this; - } - - public function title($title) { - $this->element->appendChild($this->dom->createElement("title", $title)); - return $this; - } - - public function content($text, $type="html") { - $content = $this->dom->createElement("content", html::chars($text)); - $content->setAttribute("type", $type); - $this->element->appendChild($content); - return $this; - } - - public function author() { - return $this->add_child("Atom_Author", "author"); - } - - public function link() { - return $this->add_child("Atom_Link", "link"); - } -} diff --git a/3.1/modules/atom/libraries/Atom_Feed.php b/3.1/modules/atom/libraries/Atom_Feed.php deleted file mode 100644 index 9625f951..00000000 --- a/3.1/modules/atom/libraries/Atom_Feed.php +++ /dev/null @@ -1,47 +0,0 @@ -element->appendChild($this->dom->createElement("id", $id)); - return $this; - } - - public function title($title) { - /* @todo Add optional type argument that defaults to "text" */ - $this->element->appendChild($this->dom->createElement("title", $title)); - return $this; - } - - public function updated($timestamp) { - $this->element->appendChild( - $this->dom->createElement("updated", atom::unix_to_internet_timestamp($timestamp))); - return $this; - } - - public function link() { - return $this->add_child("Atom_Link", "link"); - } - - public function entry() { - /* Create new empty entry. */ - return $this->add_child("Atom_Entry", "entry"); - } -} diff --git a/3.1/modules/atom/libraries/Gallery_Atom_Entry.php b/3.1/modules/atom/libraries/Gallery_Atom_Entry.php deleted file mode 100644 index ab6e655c..00000000 --- a/3.1/modules/atom/libraries/Gallery_Atom_Entry.php +++ /dev/null @@ -1,39 +0,0 @@ -id(html::chars(url::abs_current())); - $this->link() - ->rel("self") - ->href(url::abs_current()); - } - - public function link() { - return $this->add_child("Gallery_Atom_Link", "link"); - } -} diff --git a/3.1/modules/atom/libraries/Gallery_Atom_Feed.php b/3.1/modules/atom/libraries/Gallery_Atom_Feed.php deleted file mode 100644 index 138421a2..00000000 --- a/3.1/modules/atom/libraries/Gallery_Atom_Feed.php +++ /dev/null @@ -1,39 +0,0 @@ -id(html::chars(url::abs_current())); - $this->link() - ->rel("self") - ->href(url::abs_current()); - } - - public function link() { - return $this->add_child("Gallery_Atom_Link", "link"); - } -} diff --git a/3.1/modules/atom/libraries/Gallery_Atom_Link.php b/3.1/modules/atom/libraries/Gallery_Atom_Link.php deleted file mode 100644 index def0d497..00000000 --- a/3.1/modules/atom/libraries/Gallery_Atom_Link.php +++ /dev/null @@ -1,45 +0,0 @@ -rel("related") - ->type(rest::ATOM) - ->title($title) - ->href(sprintf("%s%s", url::base(true, "http"), $relative_uri)); - return $this; - } - - public function related_image($relative_uri, $title="", $image_type="jpeg") { - if (empty($title)) { - $title = t("Get related image"); - } - - $this->rel("related") - ->type("image/" . $image_type) - ->title($title) - ->href(sprintf("%s%s", url::base(true, "http"), $relative_uri)); - return $this; - } -} diff --git a/3.1/modules/atom/module.info b/3.1/modules/atom/module.info deleted file mode 100644 index 77f5c0b8..00000000 --- a/3.1/modules/atom/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Atom" -description = "Enable Atom feeds in your Gallery" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:atom" -discuss_url = "http://gallery.menalto.com/forum_module_atom" diff --git a/3.1/modules/autorotate/helpers/autorotate.php b/3.1/modules/autorotate/helpers/autorotate.php deleted file mode 100644 index 50cc1ab3..00000000 --- a/3.1/modules/autorotate/helpers/autorotate.php +++ /dev/null @@ -1,68 +0,0 @@ -is_photo() && $item->mime_type == "image/jpeg") { - require_once(MODPATH . "exif/lib/exif.php"); - $exif_raw = read_exif_data_raw($item->file_path(), false); - if (isset($exif_raw['ValidEXIFData'])) { - $orientation = $exif_raw["IFD0"]["Orientation"]; - $degrees = 0; - if ($orientation == '3: Upside-down') { - $degrees = 180; - } - else if ($orientation == '8: 90 deg CW') { - $degrees = -90; - } - else if ($orientation == '6: 90 deg CCW') { - $degrees = 90; - } - if($degrees) { - $tmpfile = tempnam(TMPPATH, "rotate"); - gallery_graphics::rotate($item->file_path(), $tmpfile, array("degrees" => $degrees), $item); - // Update EXIF info - $data = new PelDataWindow(file_get_contents($tmpfile)); - if (PelJpeg::isValid($data)) { - $jpeg = $file = new PelJpeg(); - $jpeg->load($data); - $exif = $jpeg->getExif(); - if($exif !== null) { - $tiff = $exif->getTiff(); - $ifd0 = $tiff->getIfd(); - $orientation = $ifd0->getEntry(PelTag::ORIENTATION); - $orientation->setValue(1); - file_put_contents($tmpfile, $file->getBytes()); - } - } - $item->set_data_file($tmpfile); - $item->save(); - unlink($tmpfile); - } - } - } - return; - } -} \ No newline at end of file diff --git a/3.1/modules/autorotate/helpers/autorotate_event.php b/3.1/modules/autorotate/helpers/autorotate_event.php deleted file mode 100644 index fe23ef8e..00000000 --- a/3.1/modules/autorotate/helpers/autorotate_event.php +++ /dev/null @@ -1,32 +0,0 @@ -getMessage() . "\n" . $e->getTraceAsString()); - } - } -} \ No newline at end of file diff --git a/3.1/modules/autorotate/helpers/autorotate_installer.php b/3.1/modules/autorotate/helpers/autorotate_installer.php deleted file mode 100644 index 3fa0d203..00000000 --- a/3.1/modules/autorotate/helpers/autorotate_installer.php +++ /dev/null @@ -1,42 +0,0 @@ - - * @version $Revision: 463 $ - * @date $Date: 2006-11-18 23:25:24 +0100 (Sat, 18 Nov 2006) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - - -/* Initialize Gettext, if available. This must be done before any - * part of PEL calls Pel::tra() or Pel::fmt() --- this is ensured if - * every piece of code using those two functions require() this file. - * - * If Gettext is not available, wrapper functions will be created, - * allowing PEL to function, but without any translations. - * - * The PEL translations are stored in './locale'. It is important to - * use an absolute path here because the lookups will be relative to - * the current directory. */ - -if (function_exists('dgettext')) { - bindtextdomain('pel', dirname(__FILE__) . '/locale'); -} else { - - /** - * Pretend to lookup a message in a specific domain. - * - * This is just a stub which will return the original message - * untranslated. The function will only be defined if the Gettext - * extension has not already defined it. - * - * @param string $domain the domain. - * - * @param string $str the message to be translated. - * - * @return string the original, untranslated message. - */ - function dgettext($domain, $str) { - return $str; - } -} - - -/** - * Class with miscellaneous static methods. - * - * This class will contain various methods that govern the overall - * behavior of PEL. - * - * Debugging output from PEL can be turned on and off by assigning - * true or false to {@link Pel::$debug}. - * - * @author Martin Geisler - * @package PEL - */ -class Pel { - - /** - * Flag for controlling debug information. - * - * The methods producing debug information ({@link debug()} and - * {@link warning()}) will only output something if this variable is - * set to true. - * - * @var boolean - */ - private static $debug = false; - - /** - * Flag for strictness of parsing. - * - * If this variable is set to true, then most errors while loading - * images will result in exceptions being thrown. Otherwise a - * warning will be emitted (using {@link Pel::warning}) and the - * exceptions will be appended to {@link Pel::$exceptions}. - * - * Some errors will still be fatal and result in thrown exceptions, - * but an effort will be made to skip over as much garbage as - * possible. - * - * @var boolean - */ - private static $strict = false; - - /** - * Stored exceptions. - * - * When {@link Pel::$strict} is set to false exceptions will be - * accumulated here instead of being thrown. - */ - private static $exceptions = array(); - - - /** - * Return list of stored exceptions. - * - * When PEL is parsing in non-strict mode, it will store most - * exceptions instead of throwing them. Use this method to get hold - * of them when a call returns. - * - * Code for using this could look like this: - * - * - * Pel::setStrictParsing(true); - * Pel::clearExceptions(); - * - * $jpeg = new PelJpeg($file); - * - * // Check for exceptions. - * foreach (Pel::getExceptions() as $e) { - * printf("Exception: %s\n", $e->getMessage()); - * if ($e instanceof PelEntryException) { - * // Warn about entries that couldn't be loaded. - * printf("Warning: Problem with %s.\n", - * PelTag::getName($e->getType(), $e->getTag())); - * } - * } - * - * - * This gives applications total control over the amount of error - * messages shown and (hopefully) provides the necessary information - * for proper error recovery. - * - * @return array the exceptions. - */ - static function getExceptions() { - return self::$exceptions; - } - - - /** - * Clear list of stored exceptions. - * - * Use this function before a call to some method if you intend to - * check for exceptions afterwards. - */ - static function clearExceptions() { - self::$exceptions = array(); - } - - - /** - * Conditionally throw an exception. - * - * This method will throw the passed exception when strict parsing - * in effect (see {@link setStrictParsing()}). Otherwise the - * exception is stored (it can be accessed with {@link - * getExceptions()}) and a warning is issued (with {@link - * Pel::warning}). - * - * @param PelException $e the exceptions. - */ - static function maybeThrow(PelException $e) { - if (self::$strict) { - throw $e; - } else { - self::$exceptions[] = $e; - self::warning('%s (%s:%s)', $e->getMessage(), - basename($e->getFile()), $e->getLine()); - } - } - - - /** - * Enable/disable strict parsing. - * - * If strict parsing is enabled, then most errors while loading - * images will result in exceptions being thrown. Otherwise a - * warning will be emitted (using {@link Pel::warning}) and the - * exceptions will be stored for later use via {@link - * getExceptions()}. - * - * Some errors will still be fatal and result in thrown exceptions, - * but an effort will be made to skip over as much garbage as - * possible. - * - * @param boolean $flag use true to enable strict parsing, false to - * diable. - */ - function setStrictParsing($flag) { - self::$strict = $flag; - } - - - /** - * Get current setting for strict parsing. - * - * @return boolean true if strict parsing is in effect, false - * otherwise. - */ - function getStrictParsing() { - return self::$strict; - } - - - /** - * Enable/disable debugging output. - * - * @param boolean $flag use true to enable debug output, false to - * diable. - */ - function setDebug($flag) { - self::$debug = $flag; - } - - - /** - * Get current setting for debug output. - * - * @return boolean true if debug is enabled, false otherwise. - */ - function getDebug() { - return self::$debug; - } - - - /** - * Conditionally output debug information. - * - * This method works just like printf() except that it always - * terminates the output with a newline, and that it only outputs - * something if the {@link Pel::$debug} is true. - * - * @param string $format the format string. - * - * @param mixed $args,... any number of arguments can be given. The - * arguments will be available for the format string as usual with - * sprintf(). - */ - static function debug() { - if (self::$debug) { - $args = func_get_args(); - $str = array_shift($args); - vprintf($str . "\n", $args); - } - } - - - /** - * Conditionally output a warning. - * - * This method works just like printf() except that it prepends the - * output with the string 'Warning: ', terminates the output with a - * newline, and that it only outputs something if the PEL_DEBUG - * defined to some true value. - * - * @param string $format the format string. - * - * @param mixed $args,... any number of arguments can be given. The - * arguments will be available for the format string as usual with - * sprintf(). - */ - static function warning() { - if (self::$debug) { - $args = func_get_args(); - $str = array_shift($args); - vprintf('Warning: ' . $str . "\n", $args); - } - } - - - /** - * Translate a string. - * - * This static function will use Gettext to translate a string. By - * always using this function for static string one is assured that - * the translation will be taken from the correct text domain. - * Dynamic strings should be passed to {@link fmt} instead. - * - * @param string the string that should be translated. - * - * @return string the translated string, or the original string if - * no translation could be found. - */ - static function tra($str) { - return dgettext('pel', $str); - } - - - /** - * Translate and format a string. - * - * This static function will first use Gettext to translate a format - * string, which will then have access to any extra arguments. By - * always using this function for dynamic string one is assured that - * the translation will be taken from the correct text domain. If - * the string is static, use {@link tra} instead as it will be - * faster. - * - * @param string $format the format string. This will be translated - * before being used as a format string. - * - * @param mixed $args,... any number of arguments can be given. The - * arguments will be available for the format string as usual with - * sprintf(). - * - * @return string the translated string, or the original string if - * no translation could be found. - */ - static function fmt() { - $args = func_get_args(); - $str = array_shift($args); - return vsprintf(dgettext('pel', $str), $args); - } - -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelConvert.php b/3.1/modules/autorotate/lib/pel/PelConvert.php deleted file mode 100644 index 31c4b2a6..00000000 --- a/3.1/modules/autorotate/lib/pel/PelConvert.php +++ /dev/null @@ -1,397 +0,0 @@ - - * @version $Revision: 387 $ - * @date $Date: 2005-10-05 13:02:52 +0200 (Wed, 05 Oct 2005) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/** - * Conversion functions to and from bytes and integers. - * - * The functions found in this class are used to convert bytes into - * integers of several sizes ({@link bytesToShort}, {@link - * bytesToLong}, and {@link bytesToRational}) and convert integers of - * several sizes into bytes ({@link shortToBytes} and {@link - * longToBytes}). - * - * All the methods are static and they all rely on an argument that - * specifies the byte order to be used, this must be one of the class - * constants {@link LITTLE_ENDIAN} or {@link BIG_ENDIAN}. These - * constants will be referred to as the pseudo type PelByteOrder - * throughout the documentation. - * - * @author Martin Geisler - * @package PEL - */ -class PelConvert { - - /** - * Little-endian (Intel) byte order. - * - * Data stored in little-endian byte order store the least - * significant byte first, so the number 0x12345678 becomes 0x78 - * 0x56 0x34 0x12 when stored with little-endian byte order. - */ - const LITTLE_ENDIAN = true; - - /** - * Big-endian (Motorola) byte order. - * - * Data stored in big-endian byte order store the most significant - * byte first, so the number 0x12345678 becomes 0x12 0x34 0x56 0x78 - * when stored with big-endian byte order. - */ - const BIG_ENDIAN = false; - - - /** - * Convert an unsigned short into two bytes. - * - * @param int the unsigned short that will be converted. The lower - * two bytes will be extracted regardless of the actual size passed. - * - * @param PelByteOrder one of {@link LITTLE_ENDIAN} and {@link - * BIG_ENDIAN}. - * - * @return string the bytes representing the unsigned short. - */ - static function shortToBytes($value, $endian) { - if ($endian == self::LITTLE_ENDIAN) - return chr($value) . chr($value >> 8); - else - return chr($value >> 8) . chr($value); - } - - - /** - * Convert a signed short into two bytes. - * - * @param int the signed short that will be converted. The lower - * two bytes will be extracted regardless of the actual size passed. - * - * @param PelByteOrder one of {@link LITTLE_ENDIAN} and {@link - * BIG_ENDIAN}. - * - * @return string the bytes representing the signed short. - */ - static function sShortToBytes($value, $endian) { - /* We can just use shortToBytes, since signed shorts fits well - * within the 32 bit signed integers used in PHP. */ - return self::shortToBytes($value, $endian); - } - - - /** - * Convert an unsigned long into four bytes. - * - * Because PHP limits the size of integers to 32 bit signed, one - * cannot really have an unsigned integer in PHP. But integers - * larger than 2^31-1 will be promoted to 64 bit signed floating - * point numbers, and so such large numbers can be handled too. - * - * @param int the unsigned long that will be converted. The - * argument will be treated as an unsigned 32 bit integer and the - * lower four bytes will be extracted. Treating the argument as an - * unsigned integer means that the absolute value will be used. Use - * {@link sLongToBytes} to convert signed integers. - * - * @param PelByteOrder one of {@link LITTLE_ENDIAN} and {@link - * BIG_ENDIAN}. - * - * @return string the bytes representing the unsigned long. - */ - static function longToBytes($value, $endian) { - /* We cannot convert the number to bytes in the normal way (using - * shifts and modulo calculations) because the PHP operator >> and - * function chr() clip their arguments to 2^31-1, which is the - * largest signed integer known to PHP. But luckily base_convert - * handles such big numbers. */ - $hex = str_pad(base_convert($value, 10, 16), 8, '0', STR_PAD_LEFT); - if ($endian == self::LITTLE_ENDIAN) - return (chr(hexdec($hex{6} . $hex{7})) . - chr(hexdec($hex{4} . $hex{5})) . - chr(hexdec($hex{2} . $hex{3})) . - chr(hexdec($hex{0} . $hex{1}))); - else - return (chr(hexdec($hex{0} . $hex{1})) . - chr(hexdec($hex{2} . $hex{3})) . - chr(hexdec($hex{4} . $hex{5})) . - chr(hexdec($hex{6} . $hex{7}))); - } - - - /** - * Convert a signed long into four bytes. - * - * @param int the signed long that will be converted. The argument - * will be treated as a signed 32 bit integer, from which the lower - * four bytes will be extracted. - * - * @param PelByteOrder one of {@link LITTLE_ENDIAN} and {@link - * BIG_ENDIAN}. - * - * @return string the bytes representing the signed long. - */ - static function sLongToBytes($value, $endian) { - /* We can convert the number into bytes in the normal way using - * shifts and modulo calculations here (in contrast with - * longToBytes) because PHP automatically handles 32 bit signed - * integers for us. */ - if ($endian == self::LITTLE_ENDIAN) - return (chr($value) . - chr($value >> 8) . - chr($value >> 16) . - chr($value >> 24)); - else - return (chr($value >> 24) . - chr($value >> 16) . - chr($value >> 8) . - chr($value)); - } - - - /** - * Extract an unsigned byte from a string of bytes. - * - * @param string the bytes. - * - * @param int the offset. The byte found at the offset will be - * returned as an integer. The must be at least one byte available - * at offset. - * - * @return int the unsigned byte found at offset, e.g., an integer - * in the range 0 to 255. - */ - static function bytesToByte($bytes, $offset) { - return ord($bytes{$offset}); - } - - - /** - * Extract a signed byte from bytes. - * - * @param string the bytes. - * - * @param int the offset. The byte found at the offset will be - * returned as an integer. The must be at least one byte available - * at offset. - * - * @return int the signed byte found at offset, e.g., an integer in - * the range -128 to 127. - */ - static function bytesToSByte($bytes, $offset) { - $n = self::bytesToByte($bytes, $offset); - if ($n > 127) - return $n - 256; - else - return $n; - } - - - /** - * Extract an unsigned short from bytes. - * - * @param string the bytes. - * - * @param int the offset. The short found at the offset will be - * returned as an integer. There must be at least two bytes - * available beginning at the offset given. - * - * @return int the unsigned short found at offset, e.g., an integer - * in the range 0 to 65535. - * - * @param PelByteOrder one of {@link LITTLE_ENDIAN} and {@link - * BIG_ENDIAN}. - */ - static function bytesToShort($bytes, $offset, $endian) { - if ($endian == self::LITTLE_ENDIAN) - return (ord($bytes{$offset+1}) * 256 + - ord($bytes{$offset})); - else - return (ord($bytes{$offset}) * 256 + - ord($bytes{$offset+1})); - } - - - /** - * Extract a signed short from bytes. - * - * @param string the bytes. - * - * @param int the offset. The short found at offset will be returned - * as an integer. There must be at least two bytes available - * beginning at the offset given. - * - * @return int the signed byte found at offset, e.g., an integer in - * the range -32768 to 32767. - * - * @param PelByteOrder one of {@link LITTLE_ENDIAN} and {@link - * BIG_ENDIAN}. - */ - static function bytesToSShort($bytes, $offset, $endian) { - $n = self::bytesToShort($bytes, $offset, $endian); - if ($n > 32767) - return $n - 65536; - else - return $n; - } - - - /** - * Extract an unsigned long from bytes. - * - * @param string the bytes. - * - * @param int the offset. The long found at offset will be returned - * as an integer. There must be at least four bytes available - * beginning at the offset given. - * - * @return int the unsigned long found at offset, e.g., an integer - * in the range 0 to 4294967295. - * - * @param PelByteOrder one of {@link LITTLE_ENDIAN} and {@link - * BIG_ENDIAN}. - */ - static function bytesToLong($bytes, $offset, $endian) { - if ($endian == self::LITTLE_ENDIAN) - return (ord($bytes{$offset+3}) * 16777216 + - ord($bytes{$offset+2}) * 65536 + - ord($bytes{$offset+1}) * 256 + - ord($bytes{$offset})); - else - return (ord($bytes{$offset}) * 16777216 + - ord($bytes{$offset+1}) * 65536 + - ord($bytes{$offset+2}) * 256 + - ord($bytes{$offset+3})); - } - - - /** - * Extract a signed long from bytes. - * - * @param string the bytes. - * - * @param int the offset. The long found at offset will be returned - * as an integer. There must be at least four bytes available - * beginning at the offset given. - * - * @return int the signed long found at offset, e.g., an integer in - * the range -2147483648 to 2147483647. - * - * @param PelByteOrder one of {@link LITTLE_ENDIAN} and {@link - * BIG_ENDIAN}. - */ - static function bytesToSLong($bytes, $offset, $endian) { - $n = self::bytesToLong($bytes, $offset, $endian); - if ($n > 2147483647) - return $n - 4294967296; - else - return $n; - } - - - /** - * Extract an unsigned rational from bytes. - * - * @param string the bytes. - * - * @param int the offset. The rational found at offset will be - * returned as an array. There must be at least eight bytes - * available beginning at the offset given. - * - * @return array the unsigned rational found at offset, e.g., an - * array with two integers in the range 0 to 4294967295. - * - * @param PelByteOrder one of {@link LITTLE_ENDIAN} and {@link - * BIG_ENDIAN}. - */ - static function bytesToRational($bytes, $offset, $endian) { - return array(self::bytesToLong($bytes, $offset, $endian), - self::bytesToLong($bytes, $offset+4, $endian)); - } - - - /** - * Extract a signed rational from bytes. - * - * @param string the bytes. - * - * @param int the offset. The rational found at offset will be - * returned as an array. There must be at least eight bytes - * available beginning at the offset given. - * - * @return array the signed rational found at offset, e.g., an array - * with two integers in the range -2147483648 to 2147483647. - * - * @param PelByteOrder one of {@link LITTLE_ENDIAN} and {@link - * BIG_ENDIAN}. - */ - static function bytesToSRational($bytes, $offset, $endian) { - return array(self::bytesToSLong($bytes, $offset, $endian), - self::bytesToSLong($bytes, $offset+4, $endian)); - } - - - /** - * Format bytes for dumping. - * - * This method is for debug output, it will format a string as a - * hexadecimal dump suitable for display on a terminal. The output - * is printed directly to standard out. - * - * @param string the bytes that will be dumped. - * - * @param int the maximum number of bytes to dump. If this is left - * out (or left to the default of 0), then the entire string will be - * dumped. - */ - static function bytesToDump($bytes, $max = 0) { - $s = strlen($bytes); - - if ($max > 0) - $s = min($max, $s); - - $line = 24; - - for ($i = 0; $i < $s; $i++) { - printf('%02X ', ord($bytes{$i})); - - if (($i+1) % $line == 0) - print("\n"); - } - print("\n"); - } - -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelDataWindow.php b/3.1/modules/autorotate/lib/pel/PelDataWindow.php deleted file mode 100644 index 523f8277..00000000 --- a/3.1/modules/autorotate/lib/pel/PelDataWindow.php +++ /dev/null @@ -1,525 +0,0 @@ - - * @version $Revision: 387 $ - * @date $Date: 2005-10-05 13:02:52 +0200 (Wed, 05 Oct 2005) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelException.php'); -require_once('PelConvert.php'); -/**#@-*/ - - -/** - * An exception thrown when an invalid offset is encountered. - * - * @package PEL - * @subpackage Exception - */ -class PelDataWindowOffsetException extends PelException {} - -/** - * An exception thrown when an invalid window is encountered. - * - * @package PEL - * @subpackage Exception - */ -class PelDataWindowWindowException extends PelException {} - -/** - * The window. - * - * @package PEL - */ -class PelDataWindow { - - /** - * The data held by this window. - * - * The string can contain any kind of data, including binary data. - * - * @var string - */ - private $data = ''; - - /** - * The byte order currently in use. - * - * This will be the byte order used when data is read using the for - * example the {@link getShort} function. It must be one of {@link - * PelConvert::LITTLE_ENDIAN} and {@link PelConvert::BIG_ENDIAN}. - * - * @var PelByteOrder - * @see setByteOrder, getByteOrder - */ - private $order; - - /** - * The start of the current window. - * - * All offsets used for access into the data will count from this - * offset, effectively limiting access to a window starting at this - * byte. - * - * @var int - * @see setWindowStart - */ - private $start = 0; - - /** - * The size of the current window. - * - * All offsets used for access into the data will be limited by this - * variable. A valid offset must be strictly less than this - * variable. - * - * @var int - * @see setWindowSize - */ - private $size = 0; - - - /** - * Construct a new data window with the data supplied. - * - * @param string the data that this window will contain. The data - * will be copied into the new data window. - * - * @param boolean the initial byte order of the window. This must - * be either {@link PelConvert::LITTLE_ENDIAN} or {@link - * PelConvert::BIG_ENDIAN}. This will be used when integers are - * read from the data, and it can be changed later with {@link - * setByteOrder()}. - */ - function __construct($d = '', $e = PelConvert::LITTLE_ENDIAN) { - $this->data = $d; - $this->order = $e; - $this->size = strlen($d); - } - - - /** - * Get the size of the data window. - * - * @return int the number of bytes covered by the window. The - * allowed offsets go from 0 up to this number minus one. - * - * @see getBytes() - */ - function getSize() { - return $this->size; - } - - - /** - * Change the byte order of the data. - * - * @param PelByteOrder the new byte order. This must be either - * {@link PelConvert::LITTLE_ENDIAN} or {@link - * PelConvert::BIG_ENDIAN}. - */ - function setByteOrder($o) { - $this->order = $o; - } - - - /** - * Get the currently used byte order. - * - * @return PelByteOrder this will be either {@link - * PelConvert::LITTLE_ENDIAN} or {@link PelConvert::BIG_ENDIAN}. - */ - function getByteOrder() { - return $this->order; - } - - - /* Move the start of the window forward. - * - * @param int the new start of the window. All new offsets will be - * calculated from this new start offset, and the size of the window - * will shrink to keep the end of the window in place. - */ - function setWindowStart($start) { - if ($start < 0 || $start > $this->size) - throw new PelDataWindowWindowException('Window [%d, %d] does ' . - 'not fit in window [0, %d]', - $start, $this->size, $this->size); - - $this->start += $start; - $this->size -= $start; - } - - - /** - * Adjust the size of the window. - * - * The size can only be made smaller. - * - * @param int the desired size of the window. If the argument is - * negative, the window will be shrunk by the argument. - */ - function setWindowSize($size) { - if ($size < 0) - $size += $this->size; - - if ($size < 0 || $size > $this->size) - throw new PelDataWindowWindowException('Window [0, %d] ' . - 'does not fit in window [0, %d]', - $size, $this->size); - $this->size = $size; - } - - - /** - * Make a new data window with the same data as the this window. - * - * @param mixed if an integer is supplied, then it will be the start - * of the window in the clone. If left unspecified, then the clone - * will inherit the start from this object. - * - * @param mixed if an integer is supplied, then it will be the size - * of the window in the clone. If left unspecified, then the clone - * will inherit the size from this object. - * - * @return PelDataWindow a new window that operates on the same data - * as this window, but (optionally) with a smaller window size. - */ - function getClone($start = false, $size = false) { - $c = clone $this; - - if (is_int($start)) - $c->setWindowStart($start); - - if (is_int($size)) - $c->setWindowSize($size); - - return $c; - } - - - /** - * Validate an offset against the current window. - * - * @param int the offset to be validated. If the offset is negative - * or if it is greater than or equal to the current window size, - * then a {@link PelDataWindowOffsetException} is thrown. - * - * @return void if the offset is valid nothing is returned, if it is - * invalid a new {@link PelDataWindowOffsetException} is thrown. - */ - private function validateOffset($o) { - if ($o < 0 || $o >= $this->size) - throw new PelDataWindowOffsetException('Offset %d not within [%d, %d]', - $o, 0, $this->size-1); - } - - - /** - * Return some or all bytes visible in the window. - * - * This method works just like the standard {@link substr()} - * function in PHP with the exception that it works within the - * window of accessible bytes and does strict range checking. - * - * @param int the offset to the first byte returned. If a negative - * number is given, then the counting will be from the end of the - * window. Invalid offsets will result in a {@link - * PelDataWindowOffsetException} being thrown. - * - * @param int the size of the sub-window. If a negative number is - * given, then that many bytes will be omitted from the result. - * - * @return string a subset of the bytes in the window. This will - * always return no more than {@link getSize()} bytes. - */ - function getBytes($start = false, $size = false) { - if (is_int($start)) { - if ($start < 0) - $start += $this->size; - - $this->validateOffset($start); - } else { - $start = 0; - } - - if (is_int($size)) { - if ($size <= 0) - $size += $this->size - $start; - - $this->validateOffset($start+$size); - } else { - $size = $this->size - $start; - } - - return substr($this->data, $this->start + $start, $size); - } - - - /** - * Return an unsigned byte from the data. - * - * @param int the offset into the data. An offset of zero will - * return the first byte in the current allowed window. The last - * valid offset is equal to {@link getSize()}-1. Invalid offsets - * will result in a {@link PelDataWindowOffsetException} being - * thrown. - * - * @return int the unsigned byte found at offset. - */ - function getByte($o = 0) { - /* Validate the offset --- this throws an exception if offset is - * out of range. */ - $this->validateOffset($o); - - /* Translate the offset into an offset into the data. */ - $o += $this->start; - - /* Return an unsigned byte. */ - return PelConvert::bytesToByte($this->data, $o); - } - - - /** - * Return a signed byte from the data. - * - * @param int the offset into the data. An offset of zero will - * return the first byte in the current allowed window. The last - * valid offset is equal to {@link getSize()}-1. Invalid offsets - * will result in a {@link PelDataWindowOffsetException} being - * thrown. - * - * @return int the signed byte found at offset. - */ - function getSByte($o = 0) { - /* Validate the offset --- this throws an exception if offset is - * out of range. */ - $this->validateOffset($o); - - /* Translate the offset into an offset into the data. */ - $o += $this->start; - - /* Return a signed byte. */ - return PelConvert::bytesToSByte($this->data, $o); - } - - - /** - * Return an unsigned short read from the data. - * - * @param int the offset into the data. An offset of zero will - * return the first short available in the current allowed window. - * The last valid offset is equal to {@link getSize()}-2. Invalid - * offsets will result in a {@link PelDataWindowOffsetException} - * being thrown. - * - * @return int the unsigned short found at offset. - */ - function getShort($o = 0) { - /* Validate the offset+1 to see if we can safely get two bytes --- - * this throws an exception if offset is out of range. */ - $this->validateOffset($o); - $this->validateOffset($o+1); - - /* Translate the offset into an offset into the data. */ - $o += $this->start; - - /* Return an unsigned short. */ - return PelConvert::bytesToShort($this->data, $o, $this->order); - } - - - /** - * Return a signed short read from the data. - * - * @param int the offset into the data. An offset of zero will - * return the first short available in the current allowed window. - * The last valid offset is equal to {@link getSize()}-2. Invalid - * offsets will result in a {@link PelDataWindowOffsetException} - * being thrown. - * - * @return int the signed short found at offset. - */ - function getSShort($o = 0) { - /* Validate the offset+1 to see if we can safely get two bytes --- - * this throws an exception if offset is out of range. */ - $this->validateOffset($o); - $this->validateOffset($o+1); - - /* Translate the offset into an offset into the data. */ - $o += $this->start; - - /* Return a signed short. */ - return PelConvert::bytesToSShort($this->data, $o, $this->order); - } - - - /** - * Return an unsigned long read from the data. - * - * @param int the offset into the data. An offset of zero will - * return the first long available in the current allowed window. - * The last valid offset is equal to {@link getSize()}-4. Invalid - * offsets will result in a {@link PelDataWindowOffsetException} - * being thrown. - * - * @return int the unsigned long found at offset. - */ - function getLong($o = 0) { - /* Validate the offset+3 to see if we can safely get four bytes - * --- this throws an exception if offset is out of range. */ - $this->validateOffset($o); - $this->validateOffset($o+3); - - /* Translate the offset into an offset into the data. */ - $o += $this->start; - - /* Return an unsigned long. */ - return PelConvert::bytesToLong($this->data, $o, $this->order); - } - - - /** - * Return a signed long read from the data. - * - * @param int the offset into the data. An offset of zero will - * return the first long available in the current allowed window. - * The last valid offset is equal to {@link getSize()}-4. Invalid - * offsets will result in a {@link PelDataWindowOffsetException} - * being thrown. - * - * @return int the signed long found at offset. - */ - function getSLong($o = 0) { - /* Validate the offset+3 to see if we can safely get four bytes - * --- this throws an exception if offset is out of range. */ - $this->validateOffset($o); - $this->validateOffset($o+3); - - /* Translate the offset into an offset into the data. */ - $o += $this->start; - - /* Return a signed long. */ - return PelConvert::bytesToSLong($this->data, $o, $this->order); - } - - - /** - * Return an unsigned rational read from the data. - * - * @param int the offset into the data. An offset of zero will - * return the first rational available in the current allowed - * window. The last valid offset is equal to {@link getSize()}-8. - * Invalid offsets will result in a {@link - * PelDataWindowOffsetException} being thrown. - * - * @return array the unsigned rational found at offset. A rational - * number is represented as an array of two numbers: the enumerator - * and denominator. Both of these numbers will be unsigned longs. - */ - function getRational($o = 0) { - return array($this->getLong($o), $this->getLong($o+4)); - } - - - /** - * Return a signed rational read from the data. - * - * @param int the offset into the data. An offset of zero will - * return the first rational available in the current allowed - * window. The last valid offset is equal to {@link getSize()}-8. - * Invalid offsets will result in a {@link - * PelDataWindowOffsetException} being thrown. - * - * @return array the signed rational found at offset. A rational - * number is represented as an array of two numbers: the enumerator - * and denominator. Both of these numbers will be signed longs. - */ - function getSRational($o = 0) { - return array($this->getSLong($o), $this->getSLong($o+4)); - } - - - /** - * String comparison on substrings. - * - * @param int the offset into the data. An offset of zero will make - * the comparison start with the very first byte available in the - * window. The last valid offset is equal to {@link getSize()} - * minus the length of the string. If the string is too long, then - * a {@link PelDataWindowOffsetException} will be thrown. - * - * @param string the string to compare with. - * - * @return boolean true if the string given matches the data in the - * window, at the specified offset, false otherwise. The comparison - * will stop as soon as a mismatch if found. - */ - function strcmp($o, $str) { - /* Validate the offset of the final character we might have to - * check. */ - $s = strlen($str); - $this->validateOffset($o); - $this->validateOffset($o + $s - 1); - - /* Translate the offset into an offset into the data. */ - $o += $this->start; - - /* Check each character, return as soon as the answer is known. */ - for ($i = 0; $i < $s; $i++) { - if ($this->data{$o + $i} != $str{$i}) - return false; - } - - /* All characters matches each other, return true. */ - return true; - } - - - /** - * Return a string representation of the data window. - * - * @return string a description of the window with information about - * the number of bytes accessible, the total number of bytes, and - * the window start and stop. - */ - function __toString() { - return Pel::fmt('DataWindow: %d bytes in [%d, %d] of %d bytes', - $this->size, - $this->start, $this->start + $this->size, - strlen($this->data)); - } - -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelEntry.php b/3.1/modules/autorotate/lib/pel/PelEntry.php deleted file mode 100644 index b3c1d15c..00000000 --- a/3.1/modules/autorotate/lib/pel/PelEntry.php +++ /dev/null @@ -1,382 +0,0 @@ - - * @version $Revision: 442 $ - * @date $Date: 2006-09-17 14:45:10 +0200 (Sun, 17 Sep 2006) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelException.php'); -require_once('PelFormat.php'); -require_once('PelTag.php'); -require_once('Pel.php'); -/**#@-*/ - - -/** - * Exception indicating a problem with an entry. - * - * @author Martin Geisler - * @package PEL - * @subpackage Exception - */ -class PelEntryException extends PelException { - - /** - * The IFD type (if known). - * - * @var int - */ - protected $type; - - /** - * The tag of the entry (if known). - * - * @var PelTag - */ - protected $tag; - - /** - * Get the IFD type associated with the exception. - * - * @return int one of {@link PelIfd::IFD0}, {@link PelIfd::IFD1}, - * {@link PelIfd::EXIF}, {@link PelIfd::GPS}, or {@link - * PelIfd::INTEROPERABILITY}. If no type is set, null is returned. - */ - function getIfdType() { - return $this->type; - } - - - /** - * Get the tag associated with the exception. - * - * @return PelTag the tag. If no tag is set, null is returned. - */ - function getTag() { - return $this->tag; - } - -} - - -/** - * Exception indicating that an unexpected format was found. - * - * The documentation for each tag in {@link PelTag} will detail any - * constrains. - * - * @author Martin Geisler - * @package PEL - * @subpackage Exception - */ -class PelUnexpectedFormatException extends PelEntryException { - - /** - * Construct a new exception indicating an invalid format. - * - * @param int the type of IFD. - * - * @param PelTag the tag for which the violation was found. - * - * @param PelFormat the format found. - * - * @param PelFormat the expected format. - */ - function __construct($type, $tag, $found, $expected) { - parent::__construct('Unexpected format found for %s tag: PelFormat::%s. ' . - 'Expected PelFormat::%s instead.', - PelTag::getName($type, $tag), - strtoupper(PelFormat::getName($found)), - strtoupper(PelFormat::getName($expected))); - $this->tag = $tag; - $this->type = $type; - } -} - - -/** - * Exception indicating that an unexpected number of components was - * found. - * - * Some tags have strict limits as to the allowed number of - * components, and this exception is thrown if the data violates such - * a constraint. The documentation for each tag in {@link PelTag} - * explains the expected number of components. - * - * @author Martin Geisler - * @package PEL - * @subpackage Exception - */ -class PelWrongComponentCountException extends PelEntryException { - - /** - * Construct a new exception indicating a wrong number of - * components. - * - * @param int the type of IFD. - * - * @param PelTag the tag for which the violation was found. - * - * @param int the number of components found. - * - * @param int the expected number of components. - */ - function __construct($type, $tag, $found, $expected) { - parent::__construct('Wrong number of components found for %s tag: %d. ' . - 'Expected %d.', - PelTag::getName($type, $tag), $found, $expected); - $this->tag = $tag; - $this->type = $type; - } -} - - -/** - * Common ancestor class of all {@link PelIfd} entries. - * - * As this class is abstract you cannot instantiate objects from it. - * It only serves as a common ancestor to define the methods common to - * all entries. The most important methods are {@link getValue()} and - * {@link setValue()}, both of which is abstract in this class. The - * descendants will give concrete implementations for them. - * - * If you have some data coming from an image (some raw bytes), then - * the static method {@link newFromData()} is helpful --- it will look - * at the data and give you a proper decendent of {@link PelEntry} - * back. - * - * If you instead want to have an entry for some data which take the - * form of an integer, a string, a byte, or some other PHP type, then - * don't use this class. You should instead create an object of the - * right subclass ({@link PelEntryShort} for short integers, {@link - * PelEntryAscii} for strings, and so on) directly. - * - * @author Martin Geisler - * @package PEL - */ -abstract class PelEntry { - - /** - * Type of IFD containing this tag. - * - * This must be one of the constants defined in {@link PelIfd}: - * {@link PelIfd::IFD0} for the main image IFD, {@link PelIfd::IFD1} - * for the thumbnail image IFD, {@link PelIfd::EXIF} for the Exif - * sub-IFD, {@link PelIfd::GPS} for the GPS sub-IFD, or {@link - * PelIfd::INTEROPERABILITY} for the interoperability sub-IFD. - * - * @var int - */ - protected $ifd_type; - - /** - * The bytes representing this entry. - * - * Subclasses must either override {@link getBytes()} or, if - * possible, maintain this property so that it always contains a - * true representation of the entry. - * - * @var string - */ - protected $bytes = ''; - - /** - * The {@link PelTag} of this entry. - * - * @var PelTag - */ - protected $tag; - - /** - * The {@link PelFormat} of this entry. - * - * @var PelFormat - */ - protected $format; - - /** - * The number of components of this entry. - * - * @var int - */ - protected $components; - - - /** - * Return the tag of this entry. - * - * @return PelTag the tag of this entry. - */ - function getTag() { - return $this->tag; - } - - - /** - * Return the type of IFD which holds this entry. - * - * @return int one of the constants defined in {@link PelIfd}: - * {@link PelIfd::IFD0} for the main image IFD, {@link PelIfd::IFD1} - * for the thumbnail image IFD, {@link PelIfd::EXIF} for the Exif - * sub-IFD, {@link PelIfd::GPS} for the GPS sub-IFD, or {@link - * PelIfd::INTEROPERABILITY} for the interoperability sub-IFD. - */ - function getIfdType() { - return $this->ifd_type; - } - - - /** - * Update the IFD type. - * - * @param int must be one of the constants defined in {@link - * PelIfd}: {@link PelIfd::IFD0} for the main image IFD, {@link - * PelIfd::IFD1} for the thumbnail image IFD, {@link PelIfd::EXIF} - * for the Exif sub-IFD, {@link PelIfd::GPS} for the GPS sub-IFD, or - * {@link PelIfd::INTEROPERABILITY} for the interoperability - * sub-IFD. - */ - function setIfdType($type) { - $this->ifd_type = $type; - } - - - /** - * Return the format of this entry. - * - * @return PelFormat the format of this entry. - */ - function getFormat() { - return $this->format; - } - - - /** - * Return the number of components of this entry. - * - * @return int the number of components of this entry. - */ - function getComponents() { - return $this->components; - } - - - /** - * Turn this entry into bytes. - * - * @param PelByteOrder the desired byte order, which must be either - * {@link Convert::LITTLE_ENDIAN} or {@link Convert::BIG_ENDIAN}. - * - * @return string bytes representing this entry. - */ - function getBytes($o) { - return $this->bytes; - } - - - /** - * Get the value of this entry as text. - * - * The value will be returned in a format suitable for presentation, - * e.g., rationals will be returned as 'x/y', ASCII strings will be - * returned as themselves etc. - * - * @param boolean some values can be returned in a long or more - * brief form, and this parameter controls that. - * - * @return string the value as text. - */ - abstract function getText($brief = false); - - - /** - * Get the value of this entry. - * - * The value returned will generally be the same as the one supplied - * to the constructor or with {@link setValue()}. For a formatted - * version of the value, one should use {@link getText()} instead. - * - * @return mixed the unformatted value. - */ - abstract function getValue(); - - - /** - * Set the value of this entry. - * - * The value should be in the same format as for the constructor. - * - * @param mixed the new value. - * - * @abstract - */ - function setValue($value) { - /* This (fake) abstract method is here to make it possible for the - * documentation to refer to PelEntry::setValue(). - * - * It cannot declared abstract in the proper PHP way, for then PHP - * wont allow subclasses to define it with two arguments (which is - * what PelEntryCopyright does). - */ - throw new PelException('setValue() is abstract.'); - } - - - /** - * Turn this entry into a string. - * - * @return string a string representation of this entry. This is - * mostly for debugging. - */ - function __toString() { - $str = Pel::fmt(" Tag: 0x%04X (%s)\n", - $this->tag, PelTag::getName($this->ifd_type, $this->tag)); - $str .= Pel::fmt(" Format : %d (%s)\n", - $this->format, PelFormat::getName($this->format)); - $str .= Pel::fmt(" Components: %d\n", $this->components); - if ($this->getTag() != PelTag::MAKER_NOTE && - $this->getTag() != PelTag::PRINT_IM) - $str .= Pel::fmt(" Value : %s\n", print_r($this->getValue(), true)); - $str .= Pel::fmt(" Text : %s\n", $this->getText()); - return $str; - } -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelEntryAscii.php b/3.1/modules/autorotate/lib/pel/PelEntryAscii.php deleted file mode 100644 index bdffe4bb..00000000 --- a/3.1/modules/autorotate/lib/pel/PelEntryAscii.php +++ /dev/null @@ -1,482 +0,0 @@ - - * @version $Revision: 443 $ - * @date $Date: 2006-09-17 20:32:04 +0200 (Sun, 17 Sep 2006) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelEntry.php'); -/**#@-*/ - - -/** - * Class for holding a plain ASCII string. - * - * This class can hold a single ASCII string, and it will be used as in - * - * $entry = $ifd->getEntry(PelTag::IMAGE_DESCRIPTION); - * print($entry->getValue()); - * $entry->setValue('This is my image. I like it.'); - * - * - * @author Martin Geisler - * @package PEL - */ -class PelEntryAscii extends PelEntry { - - /** - * The string hold by this entry. - * - * This is the string that was given to the {@link __construct - * constructor} or later to {@link setValue}, without any final NULL - * character. - * - * @var string - */ - private $str; - - - /** - * Make a new PelEntry that can hold an ASCII string. - * - * @param int the tag which this entry represents. This should be - * one of the constants defined in {@link PelTag}, e.g., {@link - * PelTag::IMAGE_DESCRIPTION}, {@link PelTag::MODEL}, or any other - * tag with format {@link PelFormat::ASCII}. - * - * @param string the string that this entry will represent. The - * string must obey the same rules as the string argument to {@link - * setValue}, namely that it should be given without any trailing - * NULL character and that it must be plain 7-bit ASCII. - */ - function __construct($tag, $str = '') { - $this->tag = $tag; - $this->format = PelFormat::ASCII; - $this->setValue($str); - } - - - /** - * Give the entry a new ASCII value. - * - * This will overwrite the previous value. The value can be - * retrieved later with the {@link getValue} method. - * - * @param string the new value of the entry. This should be given - * without any trailing NULL character. The string must be plain - * 7-bit ASCII, the string should contain no high bytes. - * - * @todo Implement check for high bytes? - */ - function setValue($str) { - $this->components = strlen($str)+1; - $this->str = $str; - $this->bytes = $str . chr(0x00); - } - - - /** - * Return the ASCII string of the entry. - * - * @return string the string held, without any final NULL character. - * The string will be the same as the one given to {@link setValue} - * or to the {@link __construct constructor}. - */ - function getValue() { - return $this->str; - } - - - /** - * Return the ASCII string of the entry. - * - * This methods returns the same as {@link getValue}. - * - * @param boolean not used with ASCII entries. - * - * @return string the string held, without any final NULL character. - * The string will be the same as the one given to {@link setValue} - * or to the {@link __construct constructor}. - */ - function getText($brief = false) { - return $this->str; - } - -} - - -/** - * Class for holding a date and time. - * - * This class can hold a timestamp, and it will be used as - * in this example where the time is advanced by one week: - * - * $entry = $ifd->getEntry(PelTag::DATE_TIME_ORIGINAL); - * $time = $entry->getValue(); - * print('The image was taken on the ' . date($time, 'jS')); - * $entry->setValue($time + 7 * 24 * 3600); - * - * - * The example used a standard UNIX timestamp, which is the default - * for this class. - * - * But the Exif format defines dates outside the range of a UNIX - * timestamp (about 1970 to 2038) and so you can also get access to - * the timestamp in two other formats: a simple string or a Julian Day - * Count. Please see the Calendar extension in the PHP Manual for more - * information about the Julian Day Count. - * - * @author Martin Geisler - * @package PEL - */ -class PelEntryTime extends PelEntryAscii { - - /** - * Constant denoting a UNIX timestamp. - */ - const UNIX_TIMESTAMP = 1; - /** - * Constant denoting a Exif string. - */ - const EXIF_STRING = 2; - /** - * Constant denoting a Julian Day Count. - */ - const JULIAN_DAY_COUNT = 3; - - /** - * The Julian Day Count of the timestamp held by this entry. - * - * This is an integer counting the number of whole days since - * January 1st, 4713 B.C. The fractional part of the timestamp held - * by this entry is stored in {@link $seconds}. - * - * @var int - */ - private $day_count; - - /** - * The number of seconds into the day of the timestamp held by this - * entry. - * - * The number of whole days is stored in {@link $day_count} and the - * number of seconds left-over is stored here. - * - * @var int - */ - private $seconds; - - - /** - * Make a new entry for holding a timestamp. - * - * @param int the Exif tag which this entry represents. There are - * only three standard tags which hold timestamp, so this should be - * one of the constants {@link PelTag::DATE_TIME}, {@link - * PelTag::DATE_TIME_ORIGINAL}, or {@link - * PelTag::DATE_TIME_DIGITIZED}. - * - * @param int the timestamp held by this entry in the correct form - * as indicated by the third argument. For {@link UNIX_TIMESTAMP} - * this is an integer counting the number of seconds since January - * 1st 1970, for {@link EXIF_STRING} this is a string of the form - * 'YYYY:MM:DD hh:mm:ss', and for {@link JULIAN_DAY_COUNT} this is a - * floating point number where the integer part denotes the day - * count and the fractional part denotes the time of day (0.25 means - * 6:00, 0.75 means 18:00). - * - * @param int the type of the timestamp. This must be one of - * {@link UNIX_TIMESTAMP}, {@link EXIF_STRING}, or - * {@link JULIAN_DAY_COUNT}. - */ - function __construct($tag, $timestamp, $type = self::UNIX_TIMESTAMP) { - parent::__construct($tag); - $this->setValue($timestamp, $type); - } - - - /** - * Return the timestamp of the entry. - * - * The timestamp held by this entry is returned in one of three - * formats: as a standard UNIX timestamp (default), as a fractional - * Julian Day Count, or as a string. - * - * @param int the type of the timestamp. This must be one of - * {@link UNIX_TIMESTAMP}, {@link EXIF_STRING}, or - * {@link JULIAN_DAY_COUNT}. - * - * @return int the timestamp held by this entry in the correct form - * as indicated by the type argument. For {@link UNIX_TIMESTAMP} - * this is an integer counting the number of seconds since January - * 1st 1970, for {@link EXIF_STRING} this is a string of the form - * 'YYYY:MM:DD hh:mm:ss', and for {@link JULIAN_DAY_COUNT} this is a - * floating point number where the integer part denotes the day - * count and the fractional part denotes the time of day (0.25 means - * 6:00, 0.75 means 18:00). - */ - function getValue($type = self::UNIX_TIMESTAMP) { - switch ($type) { - case self::UNIX_TIMESTAMP: - $seconds = jdtounix($this->day_count); - if ($seconds === false) - /* jdtounix() return false if the Julian Day Count is outside - * the range of a UNIX timestamp. */ - return false; - else - return $seconds + $this->seconds; - - case self::EXIF_STRING: - list($month, $day, $year) = explode('/', jdtogregorian($this->day_count)); - $hours = (int)($this->seconds / 3600); - $minutes = (int)($this->seconds % 3600 / 60); - $seconds = $this->seconds % 60; - return sprintf('%04d:%02d:%02d %02d:%02d:%02d', - $year, $month, $day, $hours, $minutes, $seconds); - case self::JULIAN_DAY_COUNT: - return $this->day_count + $this->seconds / 86400; - default: - throw new PelInvalidArgumentException('Expected UNIX_TIMESTAMP (%d), ' . - 'EXIF_STRING (%d), or ' . - 'JULIAN_DAY_COUNT (%d) for $type, '. - 'got %d.', - self::UNIX_TIMESTAMP, - self::EXIF_STRING, - self::JULIAN_DAY_COUNT, - $type); - } - } - - - /** - * Update the timestamp held by this entry. - * - * @param int the timestamp held by this entry in the correct form - * as indicated by the third argument. For {@link UNIX_TIMESTAMP} - * this is an integer counting the number of seconds since January - * 1st 1970, for {@link EXIF_STRING} this is a string of the form - * 'YYYY:MM:DD hh:mm:ss', and for {@link JULIAN_DAY_COUNT} this is a - * floating point number where the integer part denotes the day - * count and the fractional part denotes the time of day (0.25 means - * 6:00, 0.75 means 18:00). - * - * @param int the type of the timestamp. This must be one of - * {@link UNIX_TIMESTAMP}, {@link EXIF_STRING}, or - * {@link JULIAN_DAY_COUNT}. - * - * @todo How to deal with timezones? Use the TimeZoneOffset tag - * 0x882A? - */ - function setValue($timestamp, $type = self::UNIX_TIMESTAMP) { - switch ($type) { - case self::UNIX_TIMESTAMP: - $this->day_count = unixtojd($timestamp); - $this->seconds = $timestamp % 86400; - break; - - case self::EXIF_STRING: - /* Clean the timestamp: some timestamps are broken other - * separators than ':' and ' '. */ - $d = split('[^0-9]+', $timestamp); - $this->day_count = gregoriantojd($d[1], $d[2], $d[0]); - $this->seconds = $d[3]*3600 + $d[4]*60 + $d[5]; - break; - - case self::JULIAN_DAY_COUNT: - $this->day_count = (int)floor($timestamp); - $this->seconds = (int)(86400 * ($timestamp - floor($timestamp))); - break; - - default: - throw new PelInvalidArgumentException('Expected UNIX_TIMESTAMP (%d), ' . - 'EXIF_STRING (%d), or ' . - 'JULIAN_DAY_COUNT (%d) for $type, '. - 'got %d.', - self::UNIX_TIMESTAMP, - self::EXIF_STRING, - self::JULIAN_DAY_COUNT, - $type); - } - - /* Now finally update the string which will be used when this is - * turned into bytes. */ - parent::setValue($this->getValue(self::EXIF_STRING)); - } -} - - -/** - * Class for holding copyright information. - * - * The Exif standard specifies a certain format for copyright - * information where the one {@link PelTag::COPYRIGHT copyright - * tag} holds both the photographer and editor copyrights, separated - * by a NULL character. - * - * This class is used to manipulate that tag so that the format is - * kept to the standard. A common use would be to add a new copyright - * tag to an image, since most cameras do not add this tag themselves. - * This would be done like this: - * - * - * $entry = new PelEntryCopyright('Copyright, Martin Geisler, 2004'); - * $ifd0->addEntry($entry); - * - * - * Here we only set the photographer copyright, use the optional - * second argument to specify the editor copyright. If there is only - * an editor copyright, then let the first argument be the empty - * string. - * - * @author Martin Geisler - * @package PEL - */ -class PelEntryCopyright extends PelEntryAscii { - - /** - * The photographer copyright. - * - * @var string - */ - private $photographer; - - /** - * The editor copyright. - * - * @var string - */ - private $editor; - - - /** - * Make a new entry for holding copyright information. - * - * @param string the photographer copyright. Use the empty string - * if there is no photographer copyright. - * - * @param string the editor copyright. Use the empty string if - * there is no editor copyright. - */ - function __construct($photographer = '', $editor = '') { - parent::__construct(PelTag::COPYRIGHT); - $this->setValue($photographer, $editor); - } - - - /** - * Update the copyright information. - * - * @param string the photographer copyright. Use the empty string - * if there is no photographer copyright. - * - * @param string the editor copyright. Use the empty string if - * there is no editor copyright. - */ - function setValue($photographer = '', $editor = '') { - $this->photographer = $photographer; - $this->editor = $editor; - - if ($photographer == '' && $editor != '') - $photographer = ' '; - - if ($editor == '') - parent::setValue($photographer); - else - parent::setValue($photographer . chr(0x00) . $editor); - } - - - /** - * Retrive the copyright information. - * - * The strings returned will be the same as the one used previously - * with either {@link __construct the constructor} or with {@link - * setValue}. - * - * @return array an array with two strings, the photographer and - * editor copyrights. The two fields will be returned in that - * order, so that the first array index will be the photographer - * copyright, and the second will be the editor copyright. - */ - function getValue() { - return array($this->photographer, $this->editor); - } - - - /** - * Return a text string with the copyright information. - * - * The photographer and editor copyright fields will be returned - * with a '-' in between if both copyright fields are present, - * otherwise only one of them will be returned. - * - * @param boolean if false, then the strings '(Photographer)' and - * '(Editor)' will be appended to the photographer and editor - * copyright fields (if present), otherwise the fields will be - * returned as is. - * - * @return string the copyright information in a string. - */ - function getText($brief = false) { - if ($brief) { - $p = ''; - $e = ''; - } else { - $p = ' ' . Pel::tra('(Photographer)'); - $e = ' ' . Pel::tra('(Editor)'); - } - - if ($this->photographer != '' && $this->editor != '') - return $this->photographer . $p . ' - ' . $this->editor . $e; - - if ($this->photographer != '') - return $this->photographer . $p; - - if ($this->editor != '') - return $this->editor . $e; - - return ''; - } -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelEntryByte.php b/3.1/modules/autorotate/lib/pel/PelEntryByte.php deleted file mode 100644 index f6482d0c..00000000 --- a/3.1/modules/autorotate/lib/pel/PelEntryByte.php +++ /dev/null @@ -1,275 +0,0 @@ - - * @version $Revision: 419 $ - * @date $Date: 2006-02-20 17:22:36 +0100 (Mon, 20 Feb 2006) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelEntryNumber.php'); -/**#@-*/ - - -/** - * Class for holding unsigned bytes. - * - * This class can hold bytes, either just a single byte or an array of - * bytes. The class will be used to manipulate any of the Exif tags - * which has format {@link PelFormat::BYTE}. - * - * @author Martin Geisler - * @package PEL - */ -class PelEntryByte extends PelEntryNumber { - - /** - * Make a new entry that can hold an unsigned byte. - * - * The method accept several integer arguments. The {@link - * getValue} method will always return an array except for when a - * single integer argument is given here. - * - * @param PelTag the tag which this entry represents. This - * should be one of the constants defined in {@link PelTag} - * which has format {@link PelFormat::BYTE}. - * - * @param int $value... the byte(s) that this entry will represent. - * The argument passed must obey the same rules as the argument to - * {@link setValue}, namely that it should be within range of an - * unsigned byte, that is between 0 and 255 (inclusive). If not, - * then a {@link PelOverflowException} will be thrown. - */ - function __construct($tag /* $value... */) { - $this->tag = $tag; - $this->min = 0; - $this->max = 255; - $this->format = PelFormat::BYTE; - - $value = func_get_args(); - array_shift($value); - $this->setValueArray($value); - } - - - /** - * Convert a number into bytes. - * - * @param int the number that should be converted. - * - * @param PelByteOrder one of {@link PelConvert::LITTLE_ENDIAN} and - * {@link PelConvert::BIG_ENDIAN}, specifying the target byte order. - * - * @return string bytes representing the number given. - */ - function numberToBytes($number, $order) { - return chr($number); - } - -} - - -/** - * Class for holding signed bytes. - * - * This class can hold bytes, either just a single byte or an array of - * bytes. The class will be used to manipulate any of the Exif tags - * which has format {@link PelFormat::BYTE}. - * - * @author Martin Geisler - * @package PEL - */ -class PelEntrySByte extends PelEntryNumber { - - /** - * Make a new entry that can hold a signed byte. - * - * The method accept several integer arguments. The {@link getValue} - * method will always return an array except for when a single - * integer argument is given here. - * - * @param PelTag the tag which this entry represents. This - * should be one of the constants defined in {@link PelTag} - * which has format {@link PelFormat::BYTE}. - * - * @param int $value... the byte(s) that this entry will represent. - * The argument passed must obey the same rules as the argument to - * {@link setValue}, namely that it should be within range of a - * signed byte, that is between -128 and 127 (inclusive). If not, - * then a {@link PelOverflowException} will be thrown. - */ - function __construct($tag /* $value... */) { - $this->tag = $tag; - $this->min = -128; - $this->max = 127; - $this->format = PelFormat::SBYTE; - - $value = func_get_args(); - array_shift($value); - $this->setValueArray($value); - } - - - /** - * Convert a number into bytes. - * - * @param int the number that should be converted. - * - * @param PelByteOrder one of {@link PelConvert::LITTLE_ENDIAN} and - * {@link PelConvert::BIG_ENDIAN}, specifying the target byte order. - * - * @return string bytes representing the number given. - */ - function numberToBytes($number, $order) { - return chr($number); - } - -} - - -/** - * Class used to manipulate strings in the format Windows XP uses. - * - * When examining the file properties of an image in Windows XP one - * can fill in title, comment, author, keyword, and subject fields. - * Filling those fields and pressing OK will result in the data being - * written into the Exif data in the image. - * - * The data is written in a non-standard format and can thus not be - * loaded directly --- this class is needed to translate it into - * normal strings. - * - * It is important that entries from this class are only created with - * the {@link PelTag::XP_TITLE}, {@link PelTag::XP_COMMENT}, {@link - * PelTag::XP_AUTHOR}, {@link PelTag::XP_KEYWORD}, and {@link - * PelTag::XP_SUBJECT} tags. If another tag is used the data will no - * longer be correctly decoded when reloaded with PEL. (The data will - * be loaded as an {@link PelEntryByte} entry, which isn't as useful.) - * - * This class is to be used as in - * - * $entry = $ifd->getEntry(PelTag::XP_TITLE); - * print($entry->getValue()); - * $entry->setValue('My favorite cat'); - * - * - * @author Martin Geisler - * @package PEL - */ -class PelEntryWindowsString extends PelEntry { - - /** - * The string hold by this entry. - * - * This is the string that was given to the {@link __construct - * constructor} or later to {@link setValue}, without any extra NULL - * characters or any such nonsense. - * - * @var string - */ - private $str; - - - /** - * Make a new PelEntry that can hold a Windows XP specific string. - * - * @param int the tag which this entry represents. This should be - * one of {@link PelTag::XP_TITLE}, {@link PelTag::XP_COMMENT}, - * {@link PelTag::XP_AUTHOR}, {@link PelTag::XP_KEYWORD}, and {@link - * PelTag::XP_SUBJECT} tags. If another tag is used, then this - * entry will be incorrectly reloaded as a {@link PelEntryByte}. - * - * @param string the string that this entry will represent. It will - * be passed to {@link setValue} and thus has to obey its - * requirements. - */ - function __construct($tag, $str = '') { - $this->tag = $tag; - $this->format = PelFormat::BYTE; - $this->setValue($str); - } - - - /** - * Give the entry a new value. - * - * This will overwrite the previous value. The value can be - * retrieved later with the {@link getValue} method. - * - * @param string the new value of the entry. This should be use the - * Latin-1 encoding and be given without any extra NULL characters. - */ - function setValue($str) { - $l = strlen($str); - - $this->components = 2 * ($l + 1); - $this->str = $str; - $this->bytes = ''; - for ($i = 0; $i < $l; $i++) - $this->bytes .= $str{$i} . chr(0x00); - - $this->bytes .= chr(0x00) . chr(0x00); - } - - - /** - * Return the string of the entry. - * - * @return string the string held, without any extra NULL - * characters. The string will be the same as the one given to - * {@link setValue} or to the {@link __construct constructor}. - */ - function getValue() { - return $this->str; - } - - - /** - * Return the string of the entry. - * - * This methods returns the same as {@link getValue}. - * - * @param boolean not used. - * - * @return string the string held, without any extra NULL - * characters. The string will be the same as the one given to - * {@link setValue} or to the {@link __construct constructor}. - */ - function getText($brief = false) { - return $this->str; - } - -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelEntryLong.php b/3.1/modules/autorotate/lib/pel/PelEntryLong.php deleted file mode 100644 index 1ae4b30b..00000000 --- a/3.1/modules/autorotate/lib/pel/PelEntryLong.php +++ /dev/null @@ -1,182 +0,0 @@ - - * @version $Revision: 419 $ - * @date $Date: 2006-02-20 17:22:36 +0100 (Mon, 20 Feb 2006) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelEntryNumber.php'); -/**#@-*/ - - -/** - * Class for holding unsigned longs. - * - * This class can hold longs, either just a single long or an array of - * longs. The class will be used to manipulate any of the Exif tags - * which can have format {@link PelFormat::LONG} like in this - * example: - * - * $w = $ifd->getEntry(PelTag::EXIF_IMAGE_WIDTH); - * $w->setValue($w->getValue() / 2); - * $h = $ifd->getEntry(PelTag::EXIF_IMAGE_HEIGHT); - * $h->setValue($h->getValue() / 2); - * - * Here the width and height is updated to 50% of their original - * values. - * - * @author Martin Geisler - * @package PEL - */ -class PelEntryLong extends PelEntryNumber { - - /** - * Make a new entry that can hold an unsigned long. - * - * The method accept its arguments in two forms: several integer - * arguments or a single array argument. The {@link getValue} - * method will always return an array except for when a single - * integer argument is given here, or when an array with just a - * single integer is given. - * - * This means that one can conveniently use objects like this: - * - * $a = new PelEntryLong(PelTag::EXIF_IMAGE_WIDTH, 123456); - * $b = $a->getValue() - 654321; - * - * where the call to {@link getValue} will return an integer instead - * of an array with one integer element, which would then have to be - * extracted. - * - * @param PelTag the tag which this entry represents. This - * should be one of the constants defined in {@link PelTag}, - * e.g., {@link PelTag::IMAGE_WIDTH}, or any other tag which can - * have format {@link PelFormat::LONG}. - * - * @param int $value... the long(s) that this entry will - * represent or an array of longs. The argument passed must obey - * the same rules as the argument to {@link setValue}, namely that - * it should be within range of an unsigned long (32 bit), that is - * between 0 and 4294967295 (inclusive). If not, then a {@link - * PelExifOverflowException} will be thrown. - */ - function __construct($tag /* $value... */) { - $this->tag = $tag; - $this->min = 0; - $this->max = 4294967295; - $this->format = PelFormat::LONG; - - $value = func_get_args(); - array_shift($value); - $this->setValueArray($value); - } - - - /** - * Convert a number into bytes. - * - * @param int the number that should be converted. - * - * @param PelByteOrder one of {@link PelConvert::LITTLE_ENDIAN} and - * {@link PelConvert::BIG_ENDIAN}, specifying the target byte order. - * - * @return string bytes representing the number given. - */ - function numberToBytes($number, $order) { - return PelConvert::longToBytes($number, $order); - } -} - - -/** - * Class for holding signed longs. - * - * This class can hold longs, either just a single long or an array of - * longs. The class will be used to manipulate any of the Exif tags - * which can have format {@link PelFormat::SLONG}. - * - * @author Martin Geisler - * @package PEL - */ -class PelEntrySLong extends PelEntryNumber { - - /** - * Make a new entry that can hold a signed long. - * - * The method accept its arguments in two forms: several integer - * arguments or a single array argument. The {@link getValue} - * method will always return an array except for when a single - * integer argument is given here, or when an array with just a - * single integer is given. - * - * @param PelTag the tag which this entry represents. This - * should be one of the constants defined in {@link PelTag} - * which have format {@link PelFormat::SLONG}. - * - * @param int $value... the long(s) that this entry will represent - * or an array of longs. The argument passed must obey the same - * rules as the argument to {@link setValue}, namely that it should - * be within range of a signed long (32 bit), that is between - * -2147483648 and 2147483647 (inclusive). If not, then a {@link - * PelOverflowException} will be thrown. - */ - function __construct($tag /* $value... */) { - $this->tag = $tag; - $this->min = -2147483648; - $this->max = 2147483647; - $this->format = PelFormat::SLONG; - - $value = func_get_args(); - array_shift($value); - $this->setValueArray($value); - } - - - /** - * Convert a number into bytes. - * - * @param int the number that should be converted. - * - * @param PelByteOrder one of {@link PelConvert::LITTLE_ENDIAN} and - * {@link PelConvert::BIG_ENDIAN}, specifying the target byte order. - * - * @return string bytes representing the number given. - */ - function numberToBytes($number, $order) { - return PelConvert::sLongToBytes($number, $order); - } -} - - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelEntryNumber.php b/3.1/modules/autorotate/lib/pel/PelEntryNumber.php deleted file mode 100644 index 2301bb62..00000000 --- a/3.1/modules/autorotate/lib/pel/PelEntryNumber.php +++ /dev/null @@ -1,309 +0,0 @@ - - * @version $Revision: 419 $ - * @date $Date: 2006-02-20 17:22:36 +0100 (Mon, 20 Feb 2006) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelException.php'); -require_once('PelEntry.php'); -/**#@-*/ - - -/** - * Exception cast when numbers overflow. - * - * @author Martin Geisler - * @package PEL - * @subpackage Exception - */ -class PelOverflowException extends PelException { - - /** - * Construct a new overflow exception. - * - * @param int the value that is out of range. - * - * @param int the minimum allowed value. - * - * @param int the maximum allowed value. - */ - function __construct($v, $min, $max) { - parent::__construct('Value %.0f out of range [%.0f, %.0f]', - $v, $min, $max); - } -} - - -/** - * Class for holding numbers. - * - * This class can hold numbers, with range checks. - * - * @author Martin Geisler - * @package PEL - */ -abstract class PelEntryNumber extends PelEntry { - - /** - * The value held by this entry. - * - * @var array - */ - protected $value = array(); - - /** - * The minimum allowed value. - * - * Any attempt to change the value below this variable will result - * in a {@link PelOverflowException} being thrown. - * - * @var int - */ - protected $min; - - /** - * The maximum allowed value. - * - * Any attempt to change the value over this variable will result in - * a {@link PelOverflowException} being thrown. - * - * @var int - */ - protected $max; - - /** - * The dimension of the number held. - * - * Normal numbers have a dimension of one, pairs have a dimension of - * two, etc. - * - * @var int - */ - protected $dimension = 1; - - - /** - * Change the value. - * - * This method can change both the number of components and the - * value of the components. Range checks will be made on the new - * value, and a {@link PelOverflowException} will be thrown if the - * value is found to be outside the legal range. - * - * The method accept several number arguments. The {@link getValue} - * method will always return an array except for when a single - * number is given here. - * - * @param int|array $value... the new value(s). This can be zero or - * more numbers, that is, either integers or arrays. The input will - * be checked to ensure that the numbers are within the valid range. - * If not, then a {@link PelOverflowException} will be thrown. - * - * @see getValue - */ - function setValue(/* $value... */) { - $value = func_get_args(); - $this->setValueArray($value); - } - - - /** - * Change the value. - * - * This method can change both the number of components and the - * value of the components. Range checks will be made on the new - * value, and a {@link PelOverflowException} will be thrown if the - * value is found to be outside the legal range. - * - * @param array the new values. The array must contain the new - * numbers. - * - * @see getValue - */ - function setValueArray($value) { - foreach ($value as $v) - $this->validateNumber($v); - - $this->components = count($value); - $this->value = $value; - } - - - /** - * Return the numeric value held. - * - * @return int|array this will either be a single number if there is - * only one component, or an array of numbers otherwise. - */ - function getValue() { - if ($this->components == 1) - return $this->value[0]; - else - return $this->value; - } - - - /** - * Validate a number. - * - * This method will check that the number given is within the range - * given my {@link getMin()} and {@link getMax()}, inclusive. If - * not, then a {@link PelOverflowException} is thrown. - * - * @param int|array the number in question. - * - * @return void nothing, but will throw a {@link - * PelOverflowException} if the number is found to be outside the - * legal range and {@link Pel::$strict} is true. - */ - function validateNumber($n) { - if ($this->dimension == 1) { - if ($n < $this->min || $n > $this->max) - Pel::maybeThrow(new PelOverflowException($n, - $this->min, - $this->max)); - } else { - for ($i = 0; $i < $this->dimension; $i++) - if ($n[$i] < $this->min || $n[$i] > $this->max) - Pel::maybeThrow(new PelOverflowException($n[$i], - $this->min, - $this->max)); - } - } - - - /** - * Add a number. - * - * This appends a number to the numbers already held by this entry, - * thereby increasing the number of components by one. - * - * @param int|array the number to be added. - */ - function addNumber($n) { - $this->validateNumber($n); - $this->value[] = $n; - $this->components++; - } - - - /** - * Convert a number into bytes. - * - * The concrete subclasses will have to implement this method so - * that the numbers represented can be turned into bytes. - * - * The method will be called once for each number held by the entry. - * - * @param int the number that should be converted. - * - * @param PelByteOrder one of {@link PelConvert::LITTLE_ENDIAN} and - * {@link PelConvert::BIG_ENDIAN}, specifying the target byte order. - * - * @return string bytes representing the number given. - */ - abstract function numberToBytes($number, $order); - - - /** - * Turn this entry into bytes. - * - * @param PelByteOrder the desired byte order, which must be either - * {@link PelConvert::LITTLE_ENDIAN} or {@link - * PelConvert::BIG_ENDIAN}. - * - * @return string bytes representing this entry. - */ - function getBytes($o) { - $bytes = ''; - for ($i = 0; $i < $this->components; $i++) { - if ($this->dimension == 1) { - $bytes .= $this->numberToBytes($this->value[$i], $o); - } else { - for ($j = 0; $j < $this->dimension; $j++) { - $bytes .= $this->numberToBytes($this->value[$i][$j], $o); - } - } - } - return $bytes; - } - - - /** - * Format a number. - * - * This method is called by {@link getText} to format numbers. - * Subclasses should override this method if they need more - * sophisticated behavior than the default, which is to just return - * the number as is. - * - * @param int the number which will be formatted. - * - * @param boolean it could be that there is both a verbose and a - * brief formatting available, and this argument controls that. - * - * @return string the number formatted as a string suitable for - * display. - */ - function formatNumber($number, $brief = false) { - return $number; - } - - - /** - * Get the numeric value of this entry as text. - * - * @param boolean use brief output? The numbers will be separated - * by a single space if brief output is requested, otherwise a space - * and a comma will be used. - * - * @return string the numbers(s) held by this entry. - */ - function getText($brief = false) { - if ($this->components == 0) - return ''; - - $str = $this->formatNumber($this->value[0]); - for ($i = 1; $i < $this->components; $i++) { - $str .= ($brief ? ' ' : ', '); - $str .= $this->formatNumber($this->value[$i]); - } - - return $str; - } - -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelEntryRational.php b/3.1/modules/autorotate/lib/pel/PelEntryRational.php deleted file mode 100644 index 3dd503c8..00000000 --- a/3.1/modules/autorotate/lib/pel/PelEntryRational.php +++ /dev/null @@ -1,290 +0,0 @@ - - * @version $Revision: 419 $ - * @date $Date: 2006-02-20 17:22:36 +0100 (Mon, 20 Feb 2006) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelEntryLong.php'); -/**#@-*/ - - -/** - * Class for holding unsigned rational numbers. - * - * This class can hold rational numbers, consisting of a numerator and - * denominator both of which are of type unsigned long. Each rational - * is represented by an array with just two entries: the numerator and - * the denominator, in that order. - * - * The class can hold either just a single rational or an array of - * rationals. The class will be used to manipulate any of the Exif - * tags which can have format {@link PelFormat::RATIONAL} like in this - * example: - * - * - * $resolution = $ifd->getEntry(PelTag::X_RESOLUTION); - * $resolution->setValue(array(1, 300)); - * - * - * Here the x-resolution is adjusted to 1/300, which will be 300 DPI, - * unless the {@link PelTag::RESOLUTION_UNIT resolution unit} is set - * to something different than 2 which means inches. - * - * @author Martin Geisler - * @package PEL - */ -class PelEntryRational extends PelEntryLong { - - /** - * Make a new entry that can hold an unsigned rational. - * - * @param PelTag the tag which this entry represents. This should - * be one of the constants defined in {@link PelTag}, e.g., {@link - * PelTag::X_RESOLUTION}, or any other tag which can have format - * {@link PelFormat::RATIONAL}. - * - * @param array $value... the rational(s) that this entry will - * represent. The arguments passed must obey the same rules as the - * argument to {@link setValue}, namely that each argument should be - * an array with two entries, both of which must be within range of - * an unsigned long (32 bit), that is between 0 and 4294967295 - * (inclusive). If not, then a {@link PelOverflowException} will be - * thrown. - */ - function __construct($tag /* $value... */) { - $this->tag = $tag; - $this->format = PelFormat::RATIONAL; - $this->dimension = 2; - $this->min = 0; - $this->max = 4294967295; - - $value = func_get_args(); - array_shift($value); - $this->setValueArray($value); - } - - - /** - * Format a rational number. - * - * The rational will be returned as a string with a slash '/' - * between the numerator and denominator. - * - * @param array the rational which will be formatted. - * - * @param boolean not used. - * - * @return string the rational formatted as a string suitable for - * display. - */ - function formatNumber($number, $brief = false) { - return $number[0] . '/' . $number[1]; - } - - - /** - * Get the value of an entry as text. - * - * The value will be returned in a format suitable for presentation, - * e.g., rationals will be returned as 'x/y', ASCII strings will be - * returned as themselves etc. - * - * @param boolean some values can be returned in a long or more - * brief form, and this parameter controls that. - * - * @return string the value as text. - */ - function getText($brief = false) { - if (isset($this->value[0])) - $v = $this->value[0]; - - switch ($this->tag) { - case PelTag::FNUMBER: - //CC (e->components, 1, v); - return Pel::fmt('f/%.01f', $v[0]/$v[1]); - - case PelTag::APERTURE_VALUE: - //CC (e->components, 1, v); - //if (!v_rat.denominator) return (NULL); - return Pel::fmt('f/%.01f', pow(2, $v[0]/$v[1]/2)); - - case PelTag::FOCAL_LENGTH: - //CC (e->components, 1, v); - //if (!v_rat.denominator) return (NULL); - return Pel::fmt('%.1f mm', $v[0]/$v[1]); - - case PelTag::SUBJECT_DISTANCE: - //CC (e->components, 1, v); - //if (!v_rat.denominator) return (NULL); - return Pel::fmt('%.1f m', $v[0]/$v[1]); - - case PelTag::EXPOSURE_TIME: - //CC (e->components, 1, v); - //if (!v_rat.denominator) return (NULL); - if ($v[0]/$v[1] < 1) - return Pel::fmt('1/%d sec.', $v[1]/$v[0]); - else - return Pel::fmt('%d sec.', $v[0]/$v[1]); - - case PelTag::GPS_LATITUDE: - case PelTag::GPS_LONGITUDE: - $degrees = $this->value[0][0]/$this->value[0][1]; - $minutes = $this->value[1][0]/$this->value[1][1]; - $seconds = $this->value[2][0]/$this->value[2][1]; - - return sprintf('%s° %s\' %s" (%.2f°)', - $degrees, $minutes, $seconds, - $degrees + $minutes/60 + $seconds/3600); - - default: - return parent::getText($brief); - } - } -} - - -/** - * Class for holding signed rational numbers. - * - * This class can hold rational numbers, consisting of a numerator and - * denominator both of which are of type unsigned long. Each rational - * is represented by an array with just two entries: the numerator and - * the denominator, in that order. - * - * The class can hold either just a single rational or an array of - * rationals. The class will be used to manipulate any of the Exif - * tags which can have format {@link PelFormat::SRATIONAL}. - * - * @author Martin Geisler - * @package PEL - */ -class PelEntrySRational extends PelEntrySLong { - - /** - * Make a new entry that can hold a signed rational. - * - * @param PelTag the tag which this entry represents. This should - * be one of the constants defined in {@link PelTag}, e.g., {@link - * PelTag::SHUTTER_SPEED_VALUE}, or any other tag which can have - * format {@link PelFormat::SRATIONAL}. - * - * @param array $value... the rational(s) that this entry will - * represent. The arguments passed must obey the same rules as the - * argument to {@link setValue}, namely that each argument should be - * an array with two entries, both of which must be within range of - * a signed long (32 bit), that is between -2147483648 and - * 2147483647 (inclusive). If not, then a {@link - * PelOverflowException} will be thrown. - */ - function __construct($tag /* $value... */) { - $this->tag = $tag; - $this->format = PelFormat::SRATIONAL; - $this->dimension = 2; - $this->min = -2147483648; - $this->max = 2147483647; - - $value = func_get_args(); - array_shift($value); - $this->setValueArray($value); - } - - - /** - * Format a rational number. - * - * The rational will be returned as a string with a slash '/' - * between the numerator and denominator. Care is taken to display - * '-1/2' instead of the ugly but mathematically equivalent '1/-2'. - * - * @param array the rational which will be formatted. - * - * @param boolean not used. - * - * @return string the rational formatted as a string suitable for - * display. - */ - function formatNumber($number, $brief = false) { - if ($number[1] < 0) - /* Turn output like 1/-2 into -1/2. */ - return (-$number[0]) . '/' . (-$number[1]); - else - return $number[0] . '/' . $number[1]; - } - - - /** - * Get the value of an entry as text. - * - * The value will be returned in a format suitable for presentation, - * e.g., rationals will be returned as 'x/y', ASCII strings will be - * returned as themselves etc. - * - * @param boolean some values can be returned in a long or more - * brief form, and this parameter controls that. - * - * @return string the value as text. - */ - function getText($brief = false) { - if (isset($this->value[0])) - $v = $this->value[0]; - - switch ($this->tag) { - case PelTag::SHUTTER_SPEED_VALUE: - //CC (e->components, 1, v); - //if (!v_srat.denominator) return (NULL); - return Pel::fmt('%.0f/%.0f sec. (APEX: %d)', - $v[0], $v[1], pow(sqrt(2), $v[0]/$v[1])); - - case PelTag::BRIGHTNESS_VALUE: - //CC (e->components, 1, v); - // - // TODO: figure out the APEX thing, or remove this so that it is - // handled by the default clause at the bottom. - return sprintf('%d/%d', $v[0], $v[1]); - //FIXME: How do I calculate the APEX value? - - case PelTag::EXPOSURE_BIAS_VALUE: - //CC (e->components, 1, v); - //if (!v_srat.denominator) return (NULL); - return sprintf('%s%.01f', $v[0]*$v[1] > 0 ? '+' : '', $v[0]/$v[1]); - - default: - return parent::getText($brief); - } - } - -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelEntryShort.php b/3.1/modules/autorotate/lib/pel/PelEntryShort.php deleted file mode 100644 index 72e499d7..00000000 --- a/3.1/modules/autorotate/lib/pel/PelEntryShort.php +++ /dev/null @@ -1,599 +0,0 @@ - - * @version $Revision: 419 $ - * @date $Date: 2006-02-20 17:22:36 +0100 (Mon, 20 Feb 2006) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelEntryNumber.php'); -require_once('PelConvert.php'); -require_once('Pel.php'); -/**#@-*/ - - -/** - * Class for holding signed shorts. - * - * This class can hold shorts, either just a single short or an array - * of shorts. The class will be used to manipulate any of the Exif - * tags which has format {@link PelFormat::SHORT} like in this - * example: - * - * - * $w = $ifd->getEntry(PelTag::EXIF_IMAGE_WIDTH); - * $w->setValue($w->getValue() / 2); - * $h = $ifd->getEntry(PelTag::EXIF_IMAGE_HEIGHT); - * $h->setValue($h->getValue() / 2); - * - * - * Here the width and height is updated to 50% of their original - * values. - * - * @author Martin Geisler - * @package PEL - */ -class PelEntryShort extends PelEntryNumber { - - /** - * Make a new entry that can hold an unsigned short. - * - * The method accept several integer arguments. The {@link - * getValue} method will always return an array except for when a - * single integer argument is given here. - * - * This means that one can conveniently use objects like this: - * - * $a = new PelEntryShort(PelTag::EXIF_IMAGE_HEIGHT, 42); - * $b = $a->getValue() + 314; - * - * where the call to {@link getValue} will return an integer - * instead of an array with one integer element, which would then - * have to be extracted. - * - * @param PelTag the tag which this entry represents. This should be - * one of the constants defined in {@link PelTag}, e.g., {@link - * PelTag::IMAGE_WIDTH}, {@link PelTag::ISO_SPEED_RATINGS}, - * or any other tag with format {@link PelFormat::SHORT}. - * - * @param int $value... the short(s) that this entry will - * represent. The argument passed must obey the same rules as the - * argument to {@link setValue}, namely that it should be within - * range of an unsigned short, that is between 0 and 65535 - * (inclusive). If not, then a {@link PelOverFlowException} will be - * thrown. - */ - function __construct($tag /* $value... */) { - $this->tag = $tag; - $this->min = 0; - $this->max = 65535; - $this->format = PelFormat::SHORT; - - $value = func_get_args(); - array_shift($value); - $this->setValueArray($value); - } - - - /** - * Convert a number into bytes. - * - * @param int the number that should be converted. - * - * @param PelByteOrder one of {@link PelConvert::LITTLE_ENDIAN} and - * {@link PelConvert::BIG_ENDIAN}, specifying the target byte order. - * - * @return string bytes representing the number given. - */ - function numberToBytes($number, $order) { - return PelConvert::shortToBytes($number, $order); - } - - - /** - * Get the value of an entry as text. - * - * The value will be returned in a format suitable for presentation, - * e.g., instead of returning '2' for a {@link - * PelTag::METERING_MODE} tag, 'Center-Weighted Average' is - * returned. - * - * @param boolean some values can be returned in a long or more - * brief form, and this parameter controls that. - * - * @return string the value as text. - */ - function getText($brief = false) { - switch ($this->tag) { - case PelTag::METERING_MODE: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 0: - return Pel::tra('Unknown'); - case 1: - return Pel::tra('Average'); - case 2: - return Pel::tra('Center-Weighted Average'); - case 3: - return Pel::tra('Spot'); - case 4: - return Pel::tra('Multi Spot'); - case 5: - return Pel::tra('Pattern'); - case 6: - return Pel::tra('Partial'); - case 255: - return Pel::tra('Other'); - default: - return $this->value[0]; - } - - case PelTag::COMPRESSION: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 1: - return Pel::tra('Uncompressed'); - case 6: - return Pel::tra('JPEG compression'); - default: - return $this->value[0]; - - } - - case PelTag::PLANAR_CONFIGURATION: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 1: - return Pel::tra('chunky format'); - case 2: - return Pel::tra('planar format'); - default: - return $this->value[0]; - } - - case PelTag::SENSING_METHOD: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 1: - return Pel::tra('Not defined'); - case 2: - return Pel::tra('One-chip color area sensor'); - case 3: - return Pel::tra('Two-chip color area sensor'); - case 4: - return Pel::tra('Three-chip color area sensor'); - case 5: - return Pel::tra('Color sequential area sensor'); - case 7: - return Pel::tra('Trilinear sensor'); - case 8: - return Pel::tra('Color sequential linear sensor'); - default: - return $this->value[0]; - } - - case PelTag::LIGHT_SOURCE: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 0: - return Pel::tra('Unknown'); - case 1: - return Pel::tra('Daylight'); - case 2: - return Pel::tra('Fluorescent'); - case 3: - return Pel::tra('Tungsten (incandescent light)'); - case 4: - return Pel::tra('Flash'); - case 9: - return Pel::tra('Fine weather'); - case 10: - return Pel::tra('Cloudy weather'); - case 11: - return Pel::tra('Shade'); - case 12: - return Pel::tra('Daylight fluorescent'); - case 13: - return Pel::tra('Day white fluorescent'); - case 14: - return Pel::tra('Cool white fluorescent'); - case 15: - return Pel::tra('White fluorescent'); - case 17: - return Pel::tra('Standard light A'); - case 18: - return Pel::tra('Standard light B'); - case 19: - return Pel::tra('Standard light C'); - case 20: - return Pel::tra('D55'); - case 21: - return Pel::tra('D65'); - case 22: - return Pel::tra('D75'); - case 24: - return Pel::tra('ISO studio tungsten'); - case 255: - return Pel::tra('Other'); - default: - return $this->value[0]; - } - - case PelTag::FOCAL_PLANE_RESOLUTION_UNIT: - case PelTag::RESOLUTION_UNIT: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 2: - return Pel::tra('Inch'); - case 3: - return Pel::tra('Centimeter'); - default: - return $this->value[0]; - } - - case PelTag::EXPOSURE_PROGRAM: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 0: - return Pel::tra('Not defined'); - case 1: - return Pel::tra('Manual'); - case 2: - return Pel::tra('Normal program'); - case 3: - return Pel::tra('Aperture priority'); - case 4: - return Pel::tra('Shutter priority'); - case 5: - return Pel::tra('Creative program (biased toward depth of field)'); - case 6: - return Pel::tra('Action program (biased toward fast shutter speed)'); - case 7: - return Pel::tra('Portrait mode (for closeup photos with the background out of focus'); - case 8: - return Pel::tra('Landscape mode (for landscape photos with the background in focus'); - default: - return $this->value[0]; - } - - case PelTag::ORIENTATION: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 1: - return Pel::tra('top - left'); - case 2: - return Pel::tra('top - right'); - case 3: - return Pel::tra('bottom - right'); - case 4: - return Pel::tra('bottom - left'); - case 5: - return Pel::tra('left - top'); - case 6: - return Pel::tra('right - top'); - case 7: - return Pel::tra('right - bottom'); - case 8: - return Pel::tra('left - bottom'); - default: - return $this->value[0]; - } - - case PelTag::YCBCR_POSITIONING: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 1: - return Pel::tra('centered'); - case 2: - return Pel::tra('co-sited'); - default: - return $this->value[0]; - } - - case PelTag::YCBCR_SUB_SAMPLING: - //CC (e->components, 2, v); - if ($this->value[0] == 2 && $this->value[1] == 1) - return 'YCbCr4:2:2'; - if ($this->value[0] == 2 && $this->value[1] == 2) - return 'YCbCr4:2:0'; - - return $this->value[0] . ', ' . $this->value[1]; - - case PelTag::PHOTOMETRIC_INTERPRETATION: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 2: - return 'RGB'; - case 6: - return 'YCbCr'; - default: - return $this->value[0]; - } - - case PelTag::COLOR_SPACE: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 1: - return 'sRGB'; - case 2: - return 'Adobe RGB'; - case 0xffff: - return Pel::tra('Uncalibrated'); - default: - return $this->value[0]; - } - - case PelTag::FLASH: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 0x0000: - return Pel::tra('Flash did not fire.'); - case 0x0001: - return Pel::tra('Flash fired.'); - case 0x0005: - return Pel::tra('Strobe return light not detected.'); - case 0x0007: - return Pel::tra('Strobe return light detected.'); - case 0x0009: - return Pel::tra('Flash fired, compulsory flash mode.'); - case 0x000d: - return Pel::tra('Flash fired, compulsory flash mode, return light not detected.'); - case 0x000f: - return Pel::tra('Flash fired, compulsory flash mode, return light detected.'); - case 0x0010: - return Pel::tra('Flash did not fire, compulsory flash mode.'); - case 0x0018: - return Pel::tra('Flash did not fire, auto mode.'); - case 0x0019: - return Pel::tra('Flash fired, auto mode.'); - case 0x001d: - return Pel::tra('Flash fired, auto mode, return light not detected.'); - case 0x001f: - return Pel::tra('Flash fired, auto mode, return light detected.'); - case 0x0020: - return Pel::tra('No flash function.'); - case 0x0041: - return Pel::tra('Flash fired, red-eye reduction mode.'); - case 0x0045: - return Pel::tra('Flash fired, red-eye reduction mode, return light not detected.'); - case 0x0047: - return Pel::tra('Flash fired, red-eye reduction mode, return light detected.'); - case 0x0049: - return Pel::tra('Flash fired, compulsory flash mode, red-eye reduction mode.'); - case 0x004d: - return Pel::tra('Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected.'); - case 0x004f: - return Pel::tra('Flash fired, compulsory flash mode, red-eye reduction mode, return light detected.'); - case 0x0058: - return Pel::tra('Flash did not fire, auto mode, red-eye reduction mode.'); - case 0x0059: - return Pel::tra('Flash fired, auto mode, red-eye reduction mode.'); - case 0x005d: - return Pel::tra('Flash fired, auto mode, return light not detected, red-eye reduction mode.'); - case 0x005f: - return Pel::tra('Flash fired, auto mode, return light detected, red-eye reduction mode.'); - default: - return $this->value[0]; - } - - case PelTag::CUSTOM_RENDERED: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 0: - return Pel::tra('Normal process'); - case 1: - return Pel::tra('Custom process'); - default: - return $this->value[0]; - } - - case PelTag::EXPOSURE_MODE: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 0: - return Pel::tra('Auto exposure'); - case 1: - return Pel::tra('Manual exposure'); - case 2: - return Pel::tra('Auto bracket'); - default: - return $this->value[0]; - } - - case PelTag::WHITE_BALANCE: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 0: - return Pel::tra('Auto white balance'); - case 1: - return Pel::tra('Manual white balance'); - default: - return $this->value[0]; - } - - case PelTag::SCENE_CAPTURE_TYPE: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 0: - return Pel::tra('Standard'); - case 1: - return Pel::tra('Landscape'); - case 2: - return Pel::tra('Portrait'); - case 3: - return Pel::tra('Night scene'); - default: - return $this->value[0]; - } - - case PelTag::GAIN_CONTROL: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 0: - return Pel::tra('Normal'); - case 1: - return Pel::tra('Low gain up'); - case 2: - return Pel::tra('High gain up'); - case 3: - return Pel::tra('Low gain down'); - case 4: - return Pel::tra('High gain down'); - default: - return $this->value[0]; - } - - case PelTag::SATURATION: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 0: - return Pel::tra('Normal'); - case 1: - return Pel::tra('Low saturation'); - case 2: - return Pel::tra('High saturation'); - default: - return $this->value[0]; - } - - case PelTag::CONTRAST: - case PelTag::SHARPNESS: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 0: - return Pel::tra('Normal'); - case 1: - return Pel::tra('Soft'); - case 2: - return Pel::tra('Hard'); - default: - return $this->value[0]; - } - - case PelTag::SUBJECT_DISTANCE_RANGE: - //CC (e->components, 1, v); - switch ($this->value[0]) { - case 0: - return Pel::tra('Unknown'); - case 1: - return Pel::tra('Macro'); - case 2: - return Pel::tra('Close view'); - case 3: - return Pel::tra('Distant view'); - default: - return $this->value[0]; - } - - case PelTag::SUBJECT_AREA: - switch ($this->components) { - case 2: - return Pel::fmt('(x,y) = (%d,%d)', $this->value[0], $this->value[1]); - case 3: - return Pel::fmt('Within distance %d of (x,y) = (%d,%d)', - $this->value[0], $this->value[1], $this->value[2]); - case 4: - return Pel::fmt('Within rectangle (width %d, height %d) around (x,y) = (%d,%d)', - $this->value[0], $this->value[1], - $this->value[2], $this->value[3]); - - default: - return Pel::fmt('Unexpected number of components (%d, expected 2, 3, or 4).', $this->components); - } - - default: - return parent::getText($brief); - } - } -} - - -/** - * Class for holding signed shorts. - * - * This class can hold shorts, either just a single short or an array - * of shorts. The class will be used to manipulate any of the Exif - * tags which has format {@link PelFormat::SSHORT}. - * - * @author Martin Geisler - * @package PEL - */ -class PelEntrySShort extends PelEntryNumber { - - /** - * Make a new entry that can hold a signed short. - * - * The method accept several integer arguments. The {@link - * getValue} method will always return an array except for when a - * single integer argument is given here. - * - * @param PelTag the tag which this entry represents. This - * should be one of the constants defined in {@link PelTag} - * which has format {@link PelFormat::SSHORT}. - * - * @param int $value... the signed short(s) that this entry will - * represent. The argument passed must obey the same rules as the - * argument to {@link setValue}, namely that it should be within - * range of a signed short, that is between -32768 to 32767 - * (inclusive). If not, then a {@link PelOverFlowException} will be - * thrown. - */ - function __construct($tag /* $value... */) { - $this->tag = $tag; - $this->min = -32768; - $this->max = 32767; - $this->format = PelFormat::SSHORT; - - $value = func_get_args(); - array_shift($value); - $this->setValueArray($value); - } - - - /** - * Convert a number into bytes. - * - * @param int the number that should be converted. - * - * @param PelByteOrder one of {@link PelConvert::LITTLE_ENDIAN} and - * {@link PelConvert::BIG_ENDIAN}, specifying the target byte order. - * - * @return string bytes representing the number given. - */ - function numberToBytes($number, $order) { - return PelConvert::sShortToBytes($number, $order); - } -} - - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelEntryUndefined.php b/3.1/modules/autorotate/lib/pel/PelEntryUndefined.php deleted file mode 100644 index 8ee8df34..00000000 --- a/3.1/modules/autorotate/lib/pel/PelEntryUndefined.php +++ /dev/null @@ -1,416 +0,0 @@ - - * @version $Revision: 380 $ - * @date $Date: 2005-10-03 14:01:28 +0200 (Mon, 03 Oct 2005) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelEntry.php'); -/**#@-*/ - - -/** - * Class for holding data of any kind. - * - * This class can hold bytes of undefined format. - * - * @author Martin Geisler - * @package PEL - */ -class PelEntryUndefined extends PelEntry { - - /** - * Make a new PelEntry that can hold undefined data. - * - * @param PelTag the tag which this entry represents. This - * should be one of the constants defined in {@link PelTag}, - * e.g., {@link PelTag::SCENE_TYPE}, {@link - * PelTag::MAKER_NOTE} or any other tag with format {@link - * PelFormat::UNDEFINED}. - * - * @param string the data that this entry will be holding. Since - * the format is undefined, no checking will be done on the data. - */ - function __construct($tag, $data = '') { - $this->tag = $tag; - $this->format = PelFormat::UNDEFINED; - $this->setValue($data); - } - - - /** - * Set the data of this undefined entry. - * - * @param string the data that this entry will be holding. Since - * the format is undefined, no checking will be done on the data. - */ - function setValue($data) { - $this->components = strlen($data); - $this->bytes = $data; - } - - - /** - * Get the data of this undefined entry. - * - * @return string the data that this entry is holding. - */ - function getValue() { - return $this->bytes; - } - - - /** - * Get the value of this entry as text. - * - * The value will be returned in a format suitable for presentation. - * - * @param boolean some values can be returned in a long or more - * brief form, and this parameter controls that. - * - * @return string the value as text. - */ - function getText($brief = false) { - switch ($this->tag) { - case PelTag::FILE_SOURCE: - //CC (e->components, 1, v); - switch (ord($this->bytes{0})) { - case 0x03: - return 'DSC'; - default: - return sprintf('0x%02X', ord($this->bytes{0})); - } - - case PelTag::SCENE_TYPE: - //CC (e->components, 1, v); - switch (ord($this->bytes{0})) { - case 0x01: - return 'Directly photographed'; - default: - return sprintf('0x%02X', ord($this->bytes{0})); - } - - case PelTag::COMPONENTS_CONFIGURATION: - //CC (e->components, 4, v); - $v = ''; - for ($i = 0; $i < 4; $i++) { - switch (ord($this->bytes{$i})) { - case 0: - $v .= '-'; - break; - case 1: - $v .= 'Y'; - break; - case 2: - $v .= 'Cb'; - break; - case 3: - $v .= 'Cr'; - break; - case 4: - $v .= 'R'; - break; - case 5: - $v .= 'G'; - break; - case 6: - $v .= 'B'; - break; - default: - $v .= 'reserved'; - break; - } - if ($i < 3) $v .= ' '; - } - return $v; - - case PelTag::MAKER_NOTE: - // TODO: handle maker notes. - return $this->components . ' bytes unknown MakerNote data'; - - default: - return '(undefined)'; - } - } - -} - - -/** - * Class for a user comment. - * - * This class is used to hold user comments, which can come in several - * different character encodings. The Exif standard specifies a - * certain format of the {@link PelTag::USER_COMMENT user comment - * tag}, and this class will make sure that the format is kept. - * - * The most basic use of this class simply stores an ASCII encoded - * string for later retrieval using {@link getValue}: - * - * - * $entry = new PelEntryUserComment('An ASCII string'); - * echo $entry->getValue(); - * - * - * The string can be encoded with a different encoding, and if so, the - * encoding must be given using the second argument. The Exif - * standard specifies three known encodings: 'ASCII', 'JIS', and - * 'Unicode'. If the user comment is encoded using a character - * encoding different from the tree known encodings, then the empty - * string should be passed as encoding, thereby specifying that the - * encoding is undefined. - * - * @author Martin Geisler - * @package PEL - */ -class PelEntryUserComment extends PelEntryUndefined { - - /** - * The user comment. - * - * @var string - */ - private $comment; - - /** - * The encoding. - * - * This should be one of 'ASCII', 'JIS', 'Unicode', or ''. - * - * @var string - */ - private $encoding; - - /** - * Make a new entry for holding a user comment. - * - * @param string the new user comment. - * - * @param string the encoding of the comment. This should be either - * 'ASCII', 'JIS', 'Unicode', or the empty string specifying an - * undefined encoding. - */ - function __construct($comment = '', $encoding = 'ASCII') { - parent::__construct(PelTag::USER_COMMENT); - $this->setValue($comment, $encoding); - } - - - /** - * Set the user comment. - * - * @param string the new user comment. - * - * @param string the encoding of the comment. This should be either - * 'ASCII', 'JIS', 'Unicode', or the empty string specifying an - * unknown encoding. - */ - function setValue($comment = '', $encoding = 'ASCII') { - $this->comment = $comment; - $this->encoding = $encoding; - parent::setValue(str_pad($encoding, 8, chr(0)) . $comment); - } - - - /** - * Returns the user comment. - * - * The comment is returned with the same character encoding as when - * it was set using {@link setValue} or {@link __construct the - * constructor}. - * - * @return string the user comment. - */ - function getValue() { - return $this->comment; - } - - - /** - * Returns the encoding. - * - * @return string the encoding of the user comment. - */ - function getEncoding() { - return $this->encoding; - } - - - /** - * Returns the user comment. - * - * @return string the user comment. - */ - function getText($brief = false) { - return $this->comment; - } - -} - - -/** - * Class to hold version information. - * - * There are three Exif entries that hold version information: the - * {@link PelTag::EXIF_VERSION}, {@link - * PelTag::FLASH_PIX_VERSION}, and {@link - * PelTag::INTEROPERABILITY_VERSION} tags. This class manages - * those tags. - * - * The class is used in a very straight-forward way: - * - * $entry = new PelEntryVersion(PelTag::EXIF_VERSION, 2.2); - * - * This creates an entry for an file complying to the Exif 2.2 - * standard. It is easy to test for standards level of an unknown - * entry: - * - * if ($entry->getTag() == PelTag::EXIF_VERSION && - * $entry->getValue() > 2.0) { - * echo 'Recent Exif version.'; - * } - * - * - * @author Martin Geisler - * @package PEL - */ -class PelEntryVersion extends PelEntryUndefined { - - /** - * The version held by this entry. - * - * @var float - */ - private $version; - - - /** - * Make a new entry for holding a version. - * - * @param PelTag the tag. This should be one of {@link - * PelTag::EXIF_VERSION}, {@link PelTag::FLASH_PIX_VERSION}, - * or {@link PelTag::INTEROPERABILITY_VERSION}. - * - * @param float the version. The size of the entries leave room for - * exactly four digits: two digits on either side of the decimal - * point. - */ - function __construct($tag, $version = 0.0) { - parent::__construct($tag); - $this->setValue($version); - } - - - /** - * Set the version held by this entry. - * - * @param float the version. The size of the entries leave room for - * exactly four digits: two digits on either side of the decimal - * point. - */ - function setValue($version = 0.0) { - $this->version = $version; - $major = floor($version); - $minor = ($version - $major)*100; - parent::setValue(sprintf('%02.0f%02.0f', $major, $minor)); - } - - - /** - * Return the version held by this entry. - * - * @return float the version. This will be the same as the value - * given to {@link setValue} or {@link __construct the - * constructor}. - */ - function getValue() { - return $this->version; - } - - - /** - * Return a text string with the version. - * - * @param boolean controls if the output should be brief. Brief - * output omits the word 'Version' so the result is just 'Exif x.y' - * instead of 'Exif Version x.y' if the entry holds information - * about the Exif version --- the output for FlashPix is similar. - * - * @return string the version number with the type of the tag, - * either 'Exif' or 'FlashPix'. - */ - function getText($brief = false) { - $v = $this->version; - - /* Versions numbers like 2.0 would be output as just 2 if we don't - * add the '.0' ourselves. */ - if (floor($this->version) == $this->version) - $v .= '.0'; - - switch ($this->tag) { - case PelTag::EXIF_VERSION: - if ($brief) - return Pel::fmt('Exif %s', $v); - else - return Pel::fmt('Exif Version %s', $v); - - case PelTag::FLASH_PIX_VERSION: - if ($brief) - return Pel::fmt('FlashPix %s', $v); - else - return Pel::fmt('FlashPix Version %s', $v); - - case PelTag::INTEROPERABILITY_VERSION: - if ($brief) - return Pel::fmt('Interoperability %s', $v); - else - return Pel::fmt('Interoperability Version %s', $v); - } - - if ($brief) - return $v; - else - return Pel::fmt('Version %s', $v); - - } - -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelException.php b/3.1/modules/autorotate/lib/pel/PelException.php deleted file mode 100644 index b090fd0e..00000000 --- a/3.1/modules/autorotate/lib/pel/PelException.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @version $Revision: 396 $ - * @date $Date: 2005-10-24 00:36:10 +0200 (Mon, 24 Oct 2005) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/** - * A printf() capable exception. - * - * This class is a simple extension of the standard Exception class in - * PHP, and all the methods defined there retain their original - * meaning. - * - * @package PEL - * @subpackage Exception - */ -class PelException extends Exception { - - /** - * Construct a new PEL exception. - * - * @param string $fmt an optional format string can be given. It - * will be used as a format string for vprintf(). The remaining - * arguments will be available for the format string as usual with - * vprintf(). - * - * @param mixed $args,... any number of arguments to be used with - * the format string. - */ - function __construct(/* fmt, args... */) { - $args = func_get_args(); - $fmt = array_shift($args); - parent::__construct(vsprintf($fmt, $args)); - } -} - - -/** - * Exception throw if invalid data is found. - * - * @author Martin Geisler - * @package PEL - * @subpackage Exception - */ -class PelInvalidDataException extends PelException {} - -/** - * Exception throw if an invalid argument is passed. - * - * @author Martin Geisler - * @package PEL - * @subpackage Exception - */ -class PelInvalidArgumentException extends PelException {} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelExif.php b/3.1/modules/autorotate/lib/pel/PelExif.php deleted file mode 100644 index 6f85d695..00000000 --- a/3.1/modules/autorotate/lib/pel/PelExif.php +++ /dev/null @@ -1,175 +0,0 @@ - - * @version $Revision: 380 $ - * @date $Date: 2005-10-03 14:01:28 +0200 (Mon, 03 Oct 2005) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelJpegContent.php'); -require_once('PelException.php'); -require_once('PelFormat.php'); -require_once('PelEntry.php'); -require_once('PelTiff.php'); -require_once('PelIfd.php'); -require_once('PelTag.php'); -require_once('Pel.php'); -/**#@-*/ - - -/** - * Class representing Exif data. - * - * Exif data resides as {@link PelJpegContent data} and consists of a - * header followed by a number of {@link PelJpegIfd IFDs}. - * - * The interesting method in this class is {@link getTiff()} which - * will return the {@link PelTiff} object which really holds the data - * which one normally think of when talking about Exif data. This is - * because Exif data is stored as an extension of the TIFF file - * format. - * - * @author Martin Geisler - * @package PEL - */ -class PelExif extends PelJpegContent { - - /** - * Exif header. - * - * The Exif data must start with these six bytes to be considered - * valid. - */ - const EXIF_HEADER = "Exif\0\0"; - - /** - * The PelTiff object contained within. - * - * @var PelTiff - */ - private $tiff = null; - - - /** - * Construct a new Exif object. - * - * The new object will be empty --- use the {@link load()} method to - * load Exif data from a {@link PelDataWindow} object, or use the - * {@link setTiff()} to change the {@link PelTiff} object, which is - * the true holder of the Exif {@link PelEntry entries}. - */ - function __construct() { - - } - - - /** - * Load and parse Exif data. - * - * This will populate the object with Exif data, contained as a - * {@link PelTiff} object. This TIFF object can be accessed with - * the {@link getTiff()} method. - */ - function load(PelDataWindow $d) { - Pel::debug('Parsing %d bytes of Exif data...', $d->getSize()); - - /* There must be at least 6 bytes for the Exif header. */ - if ($d->getSize() < 6) - throw new PelInvalidDataException('Expected at least 6 bytes of Exif ' . - 'data, found just %d bytes.', - $d->getSize()); - - /* Verify the Exif header */ - if ($d->strcmp(0, self::EXIF_HEADER)) { - $d->setWindowStart(strlen(self::EXIF_HEADER)); - } else { - throw new PelInvalidDataException('Exif header not found.'); - } - - /* The rest of the data is TIFF data. */ - $this->tiff = new PelTiff(); - $this->tiff->load($d); - } - - - /** - * Change the TIFF information. - * - * Exif data is really stored as TIFF data, and this method can be - * used to change this data from one {@link PelTiff} object to - * another. - * - * @param PelTiff the new TIFF object. - */ - function setTiff(PelTiff $tiff) { - $this->tiff = $tiff; - } - - - /** - * Get the underlying TIFF object. - * - * The actual Exif data is stored in a {@link PelTiff} object, and - * this method provides access to it. - * - * @return PelTiff the TIFF object with the Exif data. - */ - function getTiff() { - return $this->tiff; - } - - - /** - * Produce bytes for the Exif data. - * - * @return string bytes representing this object. - */ - function getBytes() { - return self::EXIF_HEADER . $this->tiff->getBytes(); - } - - - /** - * Return a string representation of this object. - * - * @return string a string describing this object. This is mostly - * useful for debugging. - */ - function __toString() { - return Pel::tra("Dumping Exif data...\n") . - $this->tiff->__toString(); - } - -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelFormat.php b/3.1/modules/autorotate/lib/pel/PelFormat.php deleted file mode 100644 index 4b2badcd..00000000 --- a/3.1/modules/autorotate/lib/pel/PelFormat.php +++ /dev/null @@ -1,225 +0,0 @@ - - * @version $Revision: 380 $ - * @date $Date: 2005-10-03 14:01:28 +0200 (Mon, 03 Oct 2005) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/** - * Namespace for functions operating on Exif formats. - * - * This class defines the constants that are to be used whenever one - * has to refer to the format of an Exif tag. They will be - * collectively denoted by the pseudo-type PelFormat throughout the - * documentation. - * - * All the methods defined here are static, and they all operate on a - * single argument which should be one of the class constants. - * - * @author Martin Geisler - * @package PEL - */ -class PelFormat { - - /** - * Unsigned byte. - * - * Each component will be an unsigned 8-bit integer with a value - * between 0 and 255. - * - * Modelled with the {@link PelEntryByte} class. - */ - const BYTE = 1; - - /** - * ASCII string. - * - * Each component will be an ASCII character. - * - * Modelled with the {@link PelEntryAscii} class. - */ - const ASCII = 2; - - /** - * Unsigned short. - * - * Each component will be an unsigned 16-bit integer with a value - * between 0 and 65535. - * - * Modelled with the {@link PelEntryShort} class. - */ - const SHORT = 3; - - /** - * Unsigned long. - * - * Each component will be an unsigned 32-bit integer with a value - * between 0 and 4294967295. - * - * Modelled with the {@link PelEntryLong} class. - */ - const LONG = 4; - - /** - * Unsigned rational number. - * - * Each component will consist of two unsigned 32-bit integers - * denoting the enumerator and denominator. Each integer will have - * a value between 0 and 4294967295. - * - * Modelled with the {@link PelEntryRational} class. - */ - const RATIONAL = 5; - - /** - * Signed byte. - * - * Each component will be a signed 8-bit integer with a value - * between -128 and 127. - * - * Modelled with the {@link PelEntrySByte} class. - */ - const SBYTE = 6; - - /** - * Undefined byte. - * - * Each component will be a byte with no associated interpretation. - * - * Modelled with the {@link PelEntryUndefined} class. - */ - const UNDEFINED = 7; - - /** - * Signed short. - * - * Each component will be a signed 16-bit integer with a value - * between -32768 and 32767. - * - * Modelled with the {@link PelEntrySShort} class. - */ - const SSHORT = 8; - - /** - * Signed long. - * - * Each component will be a signed 32-bit integer with a value - * between -2147483648 and 2147483647. - * - * Modelled with the {@link PelEntrySLong} class. - */ - const SLONG = 9; - - /** - * Signed rational number. - * - * Each component will consist of two signed 32-bit integers - * denoting the enumerator and denominator. Each integer will have - * a value between -2147483648 and 2147483647. - * - * Modelled with the {@link PelEntrySRational} class. - */ - const SRATIONAL = 10; - - /** - * Floating point number. - * - * Entries with this format are not currently implemented. - */ - const FLOAT = 11; - - /** - * Double precision floating point number. - * - * Entries with this format are not currently implemented. - */ - const DOUBLE = 12; - - - /** - * Returns the name of a format. - * - * @param PelFormat the format. - * - * @return string the name of the format, e.g., 'Ascii' for the - * {@link ASCII} format etc. - */ - static function getName($type) { - switch ($type) { - case self::ASCII: return 'Ascii'; - case self::BYTE: return 'Byte'; - case self::SHORT: return 'Short'; - case self::LONG: return 'Long'; - case self::RATIONAL: return 'Rational'; - case self::SBYTE: return 'SByte'; - case self::SSHORT: return 'SShort'; - case self::SLONG: return 'SLong'; - case self::SRATIONAL: return 'SRational'; - case self::FLOAT: return 'Float'; - case self::DOUBLE: return 'Double'; - case self::UNDEFINED: return 'Undefined'; - default: - return Pel::fmt('Unknown format: 0x%X', $type); - } - } - - - /** - * Return the size of components in a given format. - * - * @param PelFormat the format. - * - * @return the size in bytes needed to store one component with the - * given format. - */ - static function getSize($type) { - switch ($type) { - case self::ASCII: return 1; - case self::BYTE: return 1; - case self::SHORT: return 2; - case self::LONG: return 4; - case self::RATIONAL: return 8; - case self::SBYTE: return 1; - case self::SSHORT: return 2; - case self::SLONG: return 4; - case self::SRATIONAL: return 8; - case self::FLOAT: return 4; - case self::DOUBLE: return 8; - case self::UNDEFINED: return 1; - default: - return Pel::fmt('Unknown format: 0x%X', $type); - } - } - -} -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelIfd.php b/3.1/modules/autorotate/lib/pel/PelIfd.php deleted file mode 100644 index 86c7fad1..00000000 --- a/3.1/modules/autorotate/lib/pel/PelIfd.php +++ /dev/null @@ -1,1200 +0,0 @@ - - * @version $Revision: 443 $ - * @date $Date: 2006-09-17 20:32:04 +0200 (Sun, 17 Sep 2006) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelEntryUndefined.php'); -require_once('PelEntryRational.php'); -require_once('PelDataWindow.php'); -require_once('PelEntryAscii.php'); -require_once('PelEntryShort.php'); -require_once('PelEntryByte.php'); -require_once('PelEntryLong.php'); -require_once('PelException.php'); -require_once('PelFormat.php'); -require_once('PelEntry.php'); -require_once('PelTag.php'); -require_once('Pel.php'); -/**#@-*/ - - -/** - * Exception indicating a general problem with the IFD. - * - * @author Martin Geisler - * @package PEL - * @subpackage Exception - */ -class PelIfdException extends PelException {} - -/** - * Class representing an Image File Directory (IFD). - * - * {@link PelTiff TIFF data} is structured as a number of Image File - * Directories, IFDs for short. Each IFD contains a number of {@link - * PelEntry entries}, some data and finally a link to the next IFD. - * - * @author Martin Geisler - * @package PEL - */ -class PelIfd implements IteratorAggregate, ArrayAccess { - - /** - * Main image IFD. - * - * Pass this to the constructor when creating an IFD which will be - * the IFD of the main image. - */ - const IFD0 = 0; - - /** - * Thumbnail image IFD. - * - * Pass this to the constructor when creating an IFD which will be - * the IFD of the thumbnail image. - */ - const IFD1 = 1; - - /** - * Exif IFD. - * - * Pass this to the constructor when creating an IFD which will be - * the Exif sub-IFD. - */ - const EXIF = 2; - - /** - * GPS IFD. - * - * Pass this to the constructor when creating an IFD which will be - * the GPS sub-IFD. - */ - const GPS = 3; - - /** - * Interoperability IFD. - * - * Pass this to the constructor when creating an IFD which will be - * the interoperability sub-IFD. - */ - const INTEROPERABILITY = 4; - - /** - * The entries held by this directory. - * - * Each tag in the directory is represented by a {@link PelEntry} - * object in this array. - * - * @var array - */ - private $entries = array(); - - /** - * The type of this directory. - * - * Initialized in the constructor. Must be one of {@link IFD0}, - * {@link IFD1}, {@link EXIF}, {@link GPS}, or {@link - * INTEROPERABILITY}. - * - * @var int - */ - private $type; - - /** - * The next directory. - * - * This will be initialized in the constructor, or be left as null - * if this is the last directory. - * - * @var PelIfd - */ - private $next = null; - - /** - * Sub-directories pointed to by this directory. - * - * This will be an array of ({@link PelTag}, {@link PelIfd}) pairs. - * - * @var array - */ - private $sub = array(); - - /** - * The thumbnail data. - * - * This will be initialized in the constructor, or be left as null - * if there are no thumbnail as part of this directory. - * - * @var PelDataWindow - */ - private $thumb_data = null; - // TODO: use this format to choose between the - // JPEG_INTERCHANGE_FORMAT and STRIP_OFFSETS tags. - // private $thumb_format; - - - /** - * Construct a new Image File Directory (IFD). - * - * The IFD will be empty, use the {@link addEntry()} method to add - * an {@link PelEntry}. Use the {@link setNext()} method to link - * this IFD to another. - * - * @param int type the type of this IFD. Must be one of {@link - * IFD0}, {@link IFD1}, {@link EXIF}, {@link GPS}, or {@link - * INTEROPERABILITY}. An {@link PelIfdException} will be thrown - * otherwise. - */ - function __construct($type) { - if ($type != PelIfd::IFD0 && $type != PelIfd::IFD1 && - $type != PelIfd::EXIF && $type != PelIfd::GPS && - $type != PelIfd::INTEROPERABILITY) - throw new PelIfdException('Unknown IFD type: %d', $type); - - $this->type = $type; - } - - - /** - * Load data into a Image File Directory (IFD). - * - * @param PelDataWindow the data window that will provide the data. - * - * @param int the offset within the window where the directory will - * be found. - */ - function load(PelDataWindow $d, $offset) { - $thumb_offset = 0; - $thumb_length = 0; - - Pel::debug('Constructing IFD at offset %d from %d bytes...', - $offset, $d->getSize()); - - /* Read the number of entries */ - $n = $d->getShort($offset); - Pel::debug('Loading %d entries...', $n); - - $offset += 2; - - /* Check if we have enough data. */ - if ($offset + 12 * $n > $d->getSize()) { - $n = floor(($offset - $d->getSize()) / 12); - Pel::maybeThrow(new PelIfdException('Adjusted to: %d.', $n)); - } - - for ($i = 0; $i < $n; $i++) { - // TODO: increment window start instead of using offsets. - $tag = $d->getShort($offset + 12 * $i); - Pel::debug('Loading entry with tag 0x%04X: %s (%d of %d)...', - $tag, PelTag::getName($this->type, $tag), $i + 1, $n); - - switch ($tag) { - case PelTag::EXIF_IFD_POINTER: - case PelTag::GPS_INFO_IFD_POINTER: - case PelTag::INTEROPERABILITY_IFD_POINTER: - $o = $d->getLong($offset + 12 * $i + 8); - Pel::debug('Found sub IFD at offset %d', $o); - - /* Map tag to IFD type. */ - if ($tag == PelTag::EXIF_IFD_POINTER) - $type = PelIfd::EXIF; - elseif ($tag == PelTag::GPS_INFO_IFD_POINTER) - $type = PelIfd::GPS; - elseif ($tag == PelTag::INTEROPERABILITY_IFD_POINTER) - $type = PelIfd::INTEROPERABILITY; - - $this->sub[$type] = new PelIfd($type); - $this->sub[$type]->load($d, $o); - break; - case PelTag::JPEG_INTERCHANGE_FORMAT: - $thumb_offset = $d->getLong($offset + 12 * $i + 8); - $this->safeSetThumbnail($d, $thumb_offset, $thumb_length); - break; - case PelTag::JPEG_INTERCHANGE_FORMAT_LENGTH: - $thumb_length = $d->getLong($offset + 12 * $i + 8); - $this->safeSetThumbnail($d, $thumb_offset, $thumb_length); - break; - default: - $format = $d->getShort($offset + 12 * $i + 2); - $components = $d->getLong($offset + 12 * $i + 4); - - /* The data size. If bigger than 4 bytes, the actual data is - * not in the entry but somewhere else, with the offset stored - * in the entry. - */ - $s = PelFormat::getSize($format) * $components; - if ($s > 0) { - $doff = $offset + 12 * $i + 8; - if ($s > 4) - $doff = $d->getLong($doff); - - $data = $d->getClone($doff, $s); - } else { - $data = new PelDataWindow(); - } - - try { - $entry = $this->newEntryFromData($tag, $format, $components, $data); - - if ($this->isValidTag($tag)) { - $entry->setIfdType($this->type); - $this->entries[$tag] = $entry; - } else { - Pel::maybeThrow(new PelInvalidDataException("IFD %s cannot hold\n%s", - $this->getName(), - $entry->__toString())); - } - } catch (PelException $e) { - /* Throw the exception when running in strict mode, store - * otherwise. */ - Pel::maybeThrow($e); - } - - /* The format of the thumbnail is stored in this tag. */ -// TODO: handle TIFF thumbnail. -// if ($tag == PelTag::COMPRESSION) { -// $this->thumb_format = $data->getShort(); -// } - break; - } - } - - /* Offset to next IFD */ - $o = $d->getLong($offset + 12 * $n); - Pel::debug('Current offset is %d, link at %d points to %d.', - $offset, $offset + 12 * $n, $o); - - if ($o > 0) { - /* Sanity check: we need 6 bytes */ - if ($o > $d->getSize() - 6) { - Pel::maybeThrow(new PelIfdException('Bogus offset to next IFD: ' . - '%d > %d!', - $o, $d->getSize() - 6)); - } else { - if ($this->type == PelIfd::IFD1) // IFD1 shouldn't link further... - Pel::maybeThrow(new PelIfdException('IFD1 links to another IFD!')); - - $this->next = new PelIfd(PelIfd::IFD1); - $this->next->load($d, $o); - } - } else { - Pel::debug('Last IFD.'); - } - } - - - /** - * Make a new entry from a bunch of bytes. - * - * This method will create the proper subclass of {@link PelEntry} - * corresponding to the {@link PelTag} and {@link PelFormat} given. - * The entry will be initialized with the data given. - * - * Please note that the data you pass to this method should come - * from an image, that is, it should be raw bytes. If instead you - * want to create an entry for holding, say, an short integer, then - * create a {@link PelEntryShort} object directly and load the data - * into it. - * - * A {@link PelUnexpectedFormatException} is thrown if a mismatch is - * discovered between the tag and format, and likewise a {@link - * PelWrongComponentCountException} is thrown if the number of - * components does not match the requirements of the tag. The - * requirements for a given tag (if any) can be found in the - * documentation for {@link PelTag}. - * - * @param PelTag the tag of the entry. - * - * @param PelFormat the format of the entry. - * - * @param int the components in the entry. - * - * @param PelDataWindow the data which will be used to construct the - * entry. - * - * @return PelEntry a newly created entry, holding the data given. - */ - function newEntryFromData($tag, $format, $components, PelDataWindow $data) { - - /* First handle tags for which we have a specific PelEntryXXX - * class. */ - - switch ($this->type) { - - case self::IFD0: - case self::IFD1: - case self::EXIF: - case self::INTEROPERABILITY: - - switch ($tag) { - case PelTag::DATE_TIME: - case PelTag::DATE_TIME_ORIGINAL: - case PelTag::DATE_TIME_DIGITIZED: - if ($format != PelFormat::ASCII) - throw new PelUnexpectedFormatException($this->type, $tag, $format, - PelFormat::ASCII); - - if ($components != 20) - throw new PelWrongComponentCountException($this->type, $tag, $components, 20); - - // TODO: handle timezones. - return new PelEntryTime($tag, $data->getBytes(0, -1), PelEntryTime::EXIF_STRING); - - case PelTag::COPYRIGHT: - if ($format != PelFormat::ASCII) - throw new PelUnexpectedFormatException($this->type, $tag, $format, - PelFormat::ASCII); - - $v = explode("\0", trim($data->getBytes(), ' ')); - return new PelEntryCopyright($v[0], $v[1]); - - case PelTag::EXIF_VERSION: - case PelTag::FLASH_PIX_VERSION: - case PelTag::INTEROPERABILITY_VERSION: - if ($format != PelFormat::UNDEFINED) - throw new PelUnexpectedFormatException($this->type, $tag, $format, - PelFormat::UNDEFINED); - - return new PelEntryVersion($tag, $data->getBytes() / 100); - - case PelTag::USER_COMMENT: - if ($format != PelFormat::UNDEFINED) - throw new PelUnexpectedFormatException($this->type, $tag, $format, - PelFormat::UNDEFINED); - if ($data->getSize() < 8) { - return new PelEntryUserComment(); - } else { - return new PelEntryUserComment($data->getBytes(8), - rtrim($data->getBytes(0, 8))); - } - - case PelTag::XP_TITLE: - case PelTag::XP_COMMENT: - case PelTag::XP_AUTHOR: - case PelTag::XP_KEYWORDS: - case PelTag::XP_SUBJECT: - if ($format != PelFormat::BYTE) - throw new PelUnexpectedFormatException($this->type, $tag, $format, - PelFormat::BYTE); - - $v = ''; - for ($i = 0; $i < $components; $i++) { - $b = $data->getByte($i); - /* Convert the byte to a character if it is non-null --- - * information about the character encoding of these entries - * would be very nice to have! So far my tests have shown - * that characters in the Latin-1 character set are stored in - * a single byte followed by a NULL byte. */ - if ($b != 0) - $v .= chr($b); - } - - return new PelEntryWindowsString($tag, $v); - } - - case self::GPS: - - default: - /* Then handle the basic formats. */ - switch ($format) { - case PelFormat::BYTE: - $v = new PelEntryByte($tag); - for ($i = 0; $i < $components; $i++) - $v->addNumber($data->getByte($i)); - return $v; - - case PelFormat::SBYTE: - $v = new PelEntrySByte($tag); - for ($i = 0; $i < $components; $i++) - $v->addNumber($data->getSByte($i)); - return $v; - - case PelFormat::ASCII: - return new PelEntryAscii($tag, $data->getBytes(0, -1)); - - case PelFormat::SHORT: - $v = new PelEntryShort($tag); - for ($i = 0; $i < $components; $i++) - $v->addNumber($data->getShort($i*2)); - return $v; - - case PelFormat::SSHORT: - $v = new PelEntrySShort($tag); - for ($i = 0; $i < $components; $i++) - $v->addNumber($data->getSShort($i*2)); - return $v; - - case PelFormat::LONG: - $v = new PelEntryLong($tag); - for ($i = 0; $i < $components; $i++) - $v->addNumber($data->getLong($i*4)); - return $v; - - case PelFormat::SLONG: - $v = new PelEntrySLong($tag); - for ($i = 0; $i < $components; $i++) - $v->addNumber($data->getSLong($i*4)); - return $v; - - case PelFormat::RATIONAL: - $v = new PelEntryRational($tag); - for ($i = 0; $i < $components; $i++) - $v->addNumber($data->getRational($i*8)); - return $v; - - case PelFormat::SRATIONAL: - $v = new PelEntrySRational($tag); - for ($i = 0; $i < $components; $i++) - $v->addNumber($data->getSRational($i*8)); - return $v; - - case PelFormat::UNDEFINED: - return new PelEntryUndefined($tag, $data->getBytes()); - - default: - throw new PelException('Unsupported format: %s', - PelFormat::getName($format)); - } - } - } - - - - - /** - * Extract thumbnail data safely. - * - * It is safe to call this method repeatedly with either the offset - * or the length set to zero, since it requires both of these - * arguments to be positive before the thumbnail is extracted. - * - * When both parameters are set it will check the length against the - * available data and adjust as necessary. Only then is the - * thumbnail data loaded. - * - * @param PelDataWindow the data from which the thumbnail will be - * extracted. - * - * @param int the offset into the data. - * - * @param int the length of the thumbnail. - */ - private function safeSetThumbnail(PelDataWindow $d, $offset, $length) { - /* Load the thumbnail if both the offset and the length is - * available. */ - if ($offset > 0 && $length > 0) { - /* Some images have a broken length, so we try to carefully - * check the length before we store the thumbnail. */ - if ($offset + $length > $d->getSize()) { - Pel::maybeThrow(new PelIfdException('Thumbnail length %d bytes ' . - 'adjusted to %d bytes.', - $length, - $d->getSize() - $offset)); - $length = $d->getSize() - $offset; - } - - /* Now set the thumbnail normally. */ - $this->setThumbnail($d->getClone($offset, $length)); - } - } - - - /** - * Set thumbnail data. - * - * Use this to embed an arbitrary JPEG image within this IFD. The - * data will be checked to ensure that it has a proper {@link - * PelJpegMarker::EOI} at the end. If not, then the length is - * adjusted until one if found. An {@link PelIfdException} might be - * thrown (depending on {@link Pel::$strict}) this case. - * - * @param PelDataWindow the thumbnail data. - */ - function setThumbnail(PelDataWindow $d) { - $size = $d->getSize(); - /* Now move backwards until we find the EOI JPEG marker. */ - while ($d->getByte($size - 2) != 0xFF || - $d->getByte($size - 1) != PelJpegMarker::EOI) { - $size--; - } - - if ($size != $d->getSize()) - Pel::maybeThrow(new PelIfdException('Decrementing thumbnail size ' . - 'to %d bytes', $size)); - - $this->thumb_data = $d->getClone(0, $size); - } - - - /** - * Get the type of this directory. - * - * @return int of {@link PelIfd::IFD0}, {@link PelIfd::IFD1}, {@link - * PelIfd::EXIF}, {@link PelIfd::GPS}, or {@link - * PelIfd::INTEROPERABILITY}. - */ - function getType() { - return $this->type; - } - - - /** - * Is a given tag valid for this IFD? - * - * Different types of IFDs can contain different kinds of tags --- - * the {@link IFD0} type, for example, cannot contain a {@link - * PelTag::GPS_LONGITUDE} tag. - * - * A special exception is tags with values above 0xF000. They are - * treated as private tags and will be allowed everywhere (use this - * for testing or for implementing your own types of tags). - * - * @param PelTag the tag. - * - * @return boolean true if the tag is considered valid in this IFD, - * false otherwise. - * - * @see getValidTags() - */ - function isValidTag($tag) { - return $tag > 0xF000 || in_array($tag, $this->getValidTags()); - } - - - /** - * Returns a list of valid tags for this IFD. - * - * @return array an array of {@link PelTag}s which are valid for - * this IFD. - */ - function getValidTags() { - switch ($this->type) { - case PelIfd::IFD0: - case PelIfd::IFD1: - return array(PelTag::IMAGE_WIDTH, - PelTag::IMAGE_LENGTH, - PelTag::BITS_PER_SAMPLE, - PelTag::COMPRESSION, - PelTag::PHOTOMETRIC_INTERPRETATION, - PelTag::IMAGE_DESCRIPTION, - PelTag::MAKE, - PelTag::MODEL, - PelTag::STRIP_OFFSETS, - PelTag::ORIENTATION, - PelTag::SAMPLES_PER_PIXEL, - PelTag::ROWS_PER_STRIP, - PelTag::STRIP_BYTE_COUNTS, - PelTag::X_RESOLUTION, - PelTag::Y_RESOLUTION, - PelTag::PLANAR_CONFIGURATION, - PelTag::RESOLUTION_UNIT, - PelTag::TRANSFER_FUNCTION, - PelTag::SOFTWARE, - PelTag::DATE_TIME, - PelTag::ARTIST, - PelTag::WHITE_POINT, - PelTag::PRIMARY_CHROMATICITIES, - PelTag::JPEG_INTERCHANGE_FORMAT, - PelTag::JPEG_INTERCHANGE_FORMAT_LENGTH, - PelTag::YCBCR_COEFFICIENTS, - PelTag::YCBCR_SUB_SAMPLING, - PelTag::YCBCR_POSITIONING, - PelTag::REFERENCE_BLACK_WHITE, - PelTag::COPYRIGHT, - PelTag::EXIF_IFD_POINTER, - PelTag::GPS_INFO_IFD_POINTER, - PelTag::PRINT_IM); - - case PelIfd::EXIF: - return array(PelTag::EXPOSURE_TIME, - PelTag::FNUMBER, - PelTag::EXPOSURE_PROGRAM, - PelTag::SPECTRAL_SENSITIVITY, - PelTag::ISO_SPEED_RATINGS, - PelTag::OECF, - PelTag::EXIF_VERSION, - PelTag::DATE_TIME_ORIGINAL, - PelTag::DATE_TIME_DIGITIZED, - PelTag::COMPONENTS_CONFIGURATION, - PelTag::COMPRESSED_BITS_PER_PIXEL, - PelTag::SHUTTER_SPEED_VALUE, - PelTag::APERTURE_VALUE, - PelTag::BRIGHTNESS_VALUE, - PelTag::EXPOSURE_BIAS_VALUE, - PelTag::MAX_APERTURE_VALUE, - PelTag::SUBJECT_DISTANCE, - PelTag::METERING_MODE, - PelTag::LIGHT_SOURCE, - PelTag::FLASH, - PelTag::FOCAL_LENGTH, - PelTag::MAKER_NOTE, - PelTag::USER_COMMENT, - PelTag::SUB_SEC_TIME, - PelTag::SUB_SEC_TIME_ORIGINAL, - PelTag::SUB_SEC_TIME_DIGITIZED, - PelTag::XP_TITLE, - PelTag::XP_COMMENT, - PelTag::XP_AUTHOR, - PelTag::XP_KEYWORDS, - PelTag::XP_SUBJECT, - PelTag::FLASH_PIX_VERSION, - PelTag::COLOR_SPACE, - PelTag::PIXEL_X_DIMENSION, - PelTag::PIXEL_Y_DIMENSION, - PelTag::RELATED_SOUND_FILE, - PelTag::FLASH_ENERGY, - PelTag::SPATIAL_FREQUENCY_RESPONSE, - PelTag::FOCAL_PLANE_X_RESOLUTION, - PelTag::FOCAL_PLANE_Y_RESOLUTION, - PelTag::FOCAL_PLANE_RESOLUTION_UNIT, - PelTag::SUBJECT_LOCATION, - PelTag::EXPOSURE_INDEX, - PelTag::SENSING_METHOD, - PelTag::FILE_SOURCE, - PelTag::SCENE_TYPE, - PelTag::CFA_PATTERN, - PelTag::CUSTOM_RENDERED, - PelTag::EXPOSURE_MODE, - PelTag::WHITE_BALANCE, - PelTag::DIGITAL_ZOOM_RATIO, - PelTag::FOCAL_LENGTH_IN_35MM_FILM, - PelTag::SCENE_CAPTURE_TYPE, - PelTag::GAIN_CONTROL, - PelTag::CONTRAST, - PelTag::SATURATION, - PelTag::SHARPNESS, - PelTag::DEVICE_SETTING_DESCRIPTION, - PelTag::SUBJECT_DISTANCE_RANGE, - PelTag::IMAGE_UNIQUE_ID, - PelTag::INTEROPERABILITY_IFD_POINTER, - PelTag::GAMMA); - - case PelIfd::GPS: - return array(PelTag::GPS_VERSION_ID, - PelTag::GPS_LATITUDE_REF, - PelTag::GPS_LATITUDE, - PelTag::GPS_LONGITUDE_REF, - PelTag::GPS_LONGITUDE, - PelTag::GPS_ALTITUDE_REF, - PelTag::GPS_ALTITUDE, - PelTag::GPS_TIME_STAMP, - PelTag::GPS_SATELLITES, - PelTag::GPS_STATUS, - PelTag::GPS_MEASURE_MODE, - PelTag::GPS_DOP, - PelTag::GPS_SPEED_REF, - PelTag::GPS_SPEED, - PelTag::GPS_TRACK_REF, - PelTag::GPS_TRACK, - PelTag::GPS_IMG_DIRECTION_REF, - PelTag::GPS_IMG_DIRECTION, - PelTag::GPS_MAP_DATUM, - PelTag::GPS_DEST_LATITUDE_REF, - PelTag::GPS_DEST_LATITUDE, - PelTag::GPS_DEST_LONGITUDE_REF, - PelTag::GPS_DEST_LONGITUDE, - PelTag::GPS_DEST_BEARING_REF, - PelTag::GPS_DEST_BEARING, - PelTag::GPS_DEST_DISTANCE_REF, - PelTag::GPS_DEST_DISTANCE, - PelTag::GPS_PROCESSING_METHOD, - PelTag::GPS_AREA_INFORMATION, - PelTag::GPS_DATE_STAMP, - PelTag::GPS_DIFFERENTIAL); - - case PelIfd::INTEROPERABILITY: - return array(PelTag::INTEROPERABILITY_INDEX, - PelTag::INTEROPERABILITY_VERSION, - PelTag::RELATED_IMAGE_FILE_FORMAT, - PelTag::RELATED_IMAGE_WIDTH, - PelTag::RELATED_IMAGE_LENGTH); - - /* TODO: Where do these tags belong? -PelTag::FILL_ORDER, -PelTag::DOCUMENT_NAME, -PelTag::TRANSFER_RANGE, -PelTag::JPEG_PROC, -PelTag::BATTERY_LEVEL, -PelTag::IPTC_NAA, -PelTag::INTER_COLOR_PROFILE, -PelTag::CFA_REPEAT_PATTERN_DIM, - */ - } - } - - - /** - * Get the name of an IFD type. - * - * @param int one of {@link PelIfd::IFD0}, {@link PelIfd::IFD1}, - * {@link PelIfd::EXIF}, {@link PelIfd::GPS}, or {@link - * PelIfd::INTEROPERABILITY}. - * - * @return string the name of type. - */ - static function getTypeName($type) { - switch ($type) { - case self::IFD0: - return '0'; - case self::IFD1: - return '1'; - case self::EXIF: - return 'Exif'; - case self::GPS: - return 'GPS'; - case self::INTEROPERABILITY: - return 'Interoperability'; - default: - throw new PelIfdException('Unknown IFD type: %d', $type); - } - } - - - /** - * Get the name of this directory. - * - * @return string the name of this directory. - */ - function getName() { - return $this->getTypeName($this->type); - } - - - /** - * Adds an entry to the directory. - * - * @param PelEntry the entry that will be added. - * - * @todo The entry will be identified with its tag, so each - * directory can only contain one entry with each tag. Is this a - * bug? - */ - function addEntry(PelEntry $e) { - $this->entries[$e->getTag()] = $e; - } - - - /** - * Does a given tag exist in this IFD? - * - * This methods is part of the ArrayAccess SPL interface for - * overriding array access of objects, it allows you to check for - * existance of an entry in the IFD: - * - * - * if (isset($ifd[PelTag::FNUMBER])) - * // ... do something with the F-number. - * - * - * @param PelTag the offset to check. - * - * @return boolean whether the tag exists. - */ - function offsetExists($tag) { - return isset($this->entries[$tag]); - } - - - /** - * Retrieve a given tag from this IFD. - * - * This methods is part of the ArrayAccess SPL interface for - * overriding array access of objects, it allows you to read entries - * from the IFD the same was as for an array: - * - * - * $entry = $ifd[PelTag::FNUMBER]; - * - * - * @param PelTag the tag to return. It is an error to ask for a tag - * which is not in the IFD, just like asking for a non-existant - * array entry. - * - * @return PelEntry the entry. - */ - function offsetGet($tag) { - return $this->entries[$tag]; - } - - - /** - * Set or update a given tag in this IFD. - * - * This methods is part of the ArrayAccess SPL interface for - * overriding array access of objects, it allows you to add new - * entries or replace esisting entries by doing: - * - * - * $ifd[PelTag::EXPOSURE_BIAS_VALUE] = $entry; - * - * - * Note that the actual array index passed is ignored! Instead the - * {@link PelTag} from the entry is used. - * - * @param PelTag the offset to update. - * - * @param PelEntry the new value. - */ - function offsetSet($tag, $e) { - if ($e instanceof PelEntry) { - $tag = $e->getTag(); - $this->entries[$tag] = $e; - } else { - throw new PelInvalidArgumentException('Argument "%s" must be a PelEntry.', $e); - } - } - - - /** - * Unset a given tag in this IFD. - * - * This methods is part of the ArrayAccess SPL interface for - * overriding array access of objects, it allows you to delete - * entries in the IFD by doing: - * - * - * unset($ifd[PelTag::EXPOSURE_BIAS_VALUE]) - * - * - * @param PelTag the offset to delete. - */ - function offsetUnset($tag) { - unset($this->entries[$tag]); - } - - - /** - * Retrieve an entry. - * - * @param PelTag the tag identifying the entry. - * - * @return PelEntry the entry associated with the tag, or null if no - * such entry exists. - */ - function getEntry($tag) { - if (isset($this->entries[$tag])) - return $this->entries[$tag]; - else - return null; - } - - - /** - * Returns all entries contained in this IFD. - * - * @return array an array of {@link PelEntry} objects, or rather - * descendant classes. The array has {@link PelTag}s as keys - * and the entries as values. - * - * @see getEntry - * @see getIterator - */ - function getEntries() { - return $this->entries; - } - - - /** - * Return an iterator for all entries contained in this IFD. - * - * Used with foreach as in - * - * - * foreach ($ifd as $tag => $entry) { - * // $tag is now a PelTag and $entry is a PelEntry object. - * } - * - * - * @return Iterator an iterator using the {@link PelTag tags} as - * keys and the entries as values. - */ - function getIterator() { - return new ArrayIterator($this->entries); - } - - - /** - * Returns available thumbnail data. - * - * @return string the bytes in the thumbnail, if any. If the IFD - * does not contain any thumbnail data, the empty string is - * returned. - * - * @todo Throw an exception instead when no data is available? - * - * @todo Return the $this->thumb_data object instead of the bytes? - */ - function getThumbnailData() { - if ($this->thumb_data != null) - return $this->thumb_data->getBytes(); - else - return ''; - } - - - /** - * Make this directory point to a new directory. - * - * @param PelIfd the IFD that this directory will point to. - */ - function setNextIfd(PelIfd $i) { - $this->next = $i; - } - - - /** - * Return the IFD pointed to by this directory. - * - * @return PelIfd the next IFD, following this IFD. If this is the - * last IFD, null is returned. - */ - function getNextIfd() { - return $this->next; - } - - - /** - * Check if this is the last IFD. - * - * @return boolean true if there are no following IFD, false - * otherwise. - */ - function isLastIfd() { - return $this->next == null; - } - - - /** - * Add a sub-IFD. - * - * Any previous sub-IFD of the same type will be overwritten. - * - * @param PelIfd the sub IFD. The type of must be one of {@link - * PelIfd::EXIF}, {@link PelIfd::GPS}, or {@link - * PelIfd::INTEROPERABILITY}. - */ - function addSubIfd(PelIfd $sub) { - $this->sub[$sub->type] = $sub; - } - - - /** - * Return a sub IFD. - * - * @param int the type of the sub IFD. This must be one of {@link - * PelIfd::EXIF}, {@link PelIfd::GPS}, or {@link - * PelIfd::INTEROPERABILITY}. - * - * @return PelIfd the IFD associated with the type, or null if that - * sub IFD does not exist. - */ - function getSubIfd($type) { - if (isset($this->sub[$type])) - return $this->sub[$type]; - else - return null; - } - - - /** - * Get all sub IFDs. - * - * @return array an associative array with (IFD-type, {@link - * PelIfd}) pairs. - */ - function getSubIfds() { - return $this->sub; - } - - - /** - * Turn this directory into bytes. - * - * This directory will be turned into a byte string, with the - * specified byte order. The offsets will be calculated from the - * offset given. - * - * @param int the offset of the first byte of this directory. - * - * @param PelByteOrder the byte order that should be used when - * turning integers into bytes. This should be one of {@link - * PelConvert::LITTLE_ENDIAN} and {@link PelConvert::BIG_ENDIAN}. - */ - function getBytes($offset, $order) { - $bytes = ''; - $extra_bytes = ''; - - Pel::debug('Bytes from IDF will start at offset %d within Exif data', - $offset); - - $n = count($this->entries) + count($this->sub); - if ($this->thumb_data != null) { - /* We need two extra entries for the thumbnail offset and - * length. */ - $n += 2; - } - - $bytes .= PelConvert::shortToBytes($n, $order); - - /* Initialize offset of extra data. This included the bytes - * preceding this IFD, the bytes needed for the count of entries, - * the entries themselves (and sub entries), the extra data in the - * entries, and the IFD link. - */ - $end = $offset + 2 + 12 * $n + 4; - - foreach ($this->entries as $tag => $entry) { - /* Each entry is 12 bytes long. */ - $bytes .= PelConvert::shortToBytes($entry->getTag(), $order); - $bytes .= PelConvert::shortToBytes($entry->getFormat(), $order); - $bytes .= PelConvert::longToBytes($entry->getComponents(), $order); - - /* - * Size? If bigger than 4 bytes, the actual data is not in - * the entry but somewhere else. - */ - $data = $entry->getBytes($order); - $s = strlen($data); - if ($s > 4) { - Pel::debug('Data size %d too big, storing at offset %d instead.', - $s, $end); - $bytes .= PelConvert::longToBytes($end, $order); - $extra_bytes .= $data; - $end += $s; - } else { - Pel::debug('Data size %d fits.', $s); - /* Copy data directly, pad with NULL bytes as necessary to - * fill out the four bytes available.*/ - $bytes .= $data . str_repeat(chr(0), 4 - $s); - } - } - - if ($this->thumb_data != null) { - Pel::debug('Appending %d bytes of thumbnail data at %d', - $this->thumb_data->getSize(), $end); - // TODO: make PelEntry a class that can be constructed with - // arguments corresponding to the newt four lines. - $bytes .= PelConvert::shortToBytes(PelTag::JPEG_INTERCHANGE_FORMAT_LENGTH, - $order); - $bytes .= PelConvert::shortToBytes(PelFormat::LONG, $order); - $bytes .= PelConvert::longToBytes(1, $order); - $bytes .= PelConvert::longToBytes($this->thumb_data->getSize(), - $order); - - $bytes .= PelConvert::shortToBytes(PelTag::JPEG_INTERCHANGE_FORMAT, - $order); - $bytes .= PelConvert::shortToBytes(PelFormat::LONG, $order); - $bytes .= PelConvert::longToBytes(1, $order); - $bytes .= PelConvert::longToBytes($end, $order); - - $extra_bytes .= $this->thumb_data->getBytes(); - $end += $this->thumb_data->getSize(); - } - - - /* Find bytes from sub IFDs. */ - $sub_bytes = ''; - foreach ($this->sub as $type => $sub) { - if ($type == PelIfd::EXIF) - $tag = PelTag::EXIF_IFD_POINTER; - elseif ($type == PelIfd::GPS) - $tag = PelTag::GPS_INFO_IFD_POINTER; - elseif ($type == PelIfd::INTEROPERABILITY) - $tag = PelTag::INTEROPERABILITY_IFD_POINTER; - - /* Make an aditional entry with the pointer. */ - $bytes .= PelConvert::shortToBytes($tag, $order); - /* Next the format, which is always unsigned long. */ - $bytes .= PelConvert::shortToBytes(PelFormat::LONG, $order); - /* There is only one component. */ - $bytes .= PelConvert::longToBytes(1, $order); - - $data = $sub->getBytes($end, $order); - $s = strlen($data); - $sub_bytes .= $data; - - $bytes .= PelConvert::longToBytes($end, $order); - $end += $s; - } - - /* Make link to next IFD, if any*/ - if ($this->isLastIFD()) { - $link = 0; - } else { - $link = $end; - } - - Pel::debug('Link to next IFD: %d', $link); - - $bytes .= PelConvert::longtoBytes($link, $order); - - $bytes .= $extra_bytes . $sub_bytes; - - if (!$this->isLastIfd()) - $bytes .= $this->next->getBytes($end, $order); - - return $bytes; - } - - - /** - * Turn this directory into text. - * - * @return string information about the directory, mainly for - * debugging. - */ - function __toString() { - $str = Pel::fmt("Dumping IFD %s with %d entries...\n", - $this->getName(), count($this->entries)); - - foreach ($this->entries as $entry) - $str .= $entry->__toString(); - - $str .= Pel::fmt("Dumping %d sub IFDs...\n", count($this->sub)); - - foreach ($this->sub as $type => $ifd) - $str .= $ifd->__toString(); - - if ($this->next != null) - $str .= $this->next->__toString(); - - return $str; - } - - -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelJpeg.php b/3.1/modules/autorotate/lib/pel/PelJpeg.php deleted file mode 100644 index f1fb0a7c..00000000 --- a/3.1/modules/autorotate/lib/pel/PelJpeg.php +++ /dev/null @@ -1,599 +0,0 @@ - - * @version $Revision: 473 $ - * @date $Date: 2006-11-24 00:12:21 +0100 (Fri, 24 Nov 2006) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelJpegComment.php'); -require_once('PelJpegContent.php'); -require_once('PelDataWindow.php'); -require_once('PelJpegMarker.php'); -require_once('PelException.php'); -require_once('PelExif.php'); -require_once('Pel.php'); -/**#@-*/ - - -/** - * Exception thrown when an invalid marker is found. - * - * This exception is thrown when PEL expects to find a {@link - * PelJpegMarker} and instead finds a byte that isn't a known marker. - * - * @author Martin Geisler - * @package PEL - * @subpackage Exception - */ -class PelJpegInvalidMarkerException extends PelException { - - /** - * Construct a new invalid marker exception. - * - * The exception will contain a message describing the error, - * including the byte found and the offset of the offending byte. - * - * @param int the byte found. - * - * @param int the offset in the data. - */ - function __construct($marker, $offset) { - parent::__construct('Invalid marker found at offset %d: 0x%2X', - $offset, $marker); - } -} - -/** - * Class for handling JPEG data. - * - * The {@link PelJpeg} class defined here provides an abstraction for - * dealing with a JPEG file. The file will be contain a number of - * sections containing some {@link PelJpegContent content} identified - * by a {@link PelJpegMarker marker}. - * - * The {@link getExif()} method is used get hold of the {@link - * PelJpegMarker::APP1 APP1} section which stores Exif data. So if - * the name of the JPEG file is stored in $filename, then one would - * get hold of the Exif data by saying: - * - * - * $jpeg = new PelJpeg($filename); - * $exif = $jpeg->getExif(); - * $tiff = $exif->getTiff(); - * $ifd0 = $tiff->getIfd(); - * $exif = $ifd0->getSubIfd(PelIfd::EXIF); - * $ifd1 = $ifd0->getNextIfd(); - * - * - * The $idf0 and $ifd1 variables will then be two {@link PelTiff TIFF} - * {@link PelIfd Image File Directories}, in which the data is stored - * under the keys found in {@link PelTag}. - * - * Should one have some image data (in the form of a {@link - * PelDataWindow}) of an unknown type, then the {@link - * PelJpeg::isValid()} function is handy: it will quickly test if the - * data could be valid JPEG data. The {@link PelTiff::isValid()} - * function does the same for TIFF images. - * - * @author Martin Geisler - * @package PEL - */ -class PelJpeg { - - /** - * The sections in the JPEG data. - * - * A JPEG file is built up as a sequence of sections, each section - * is identified with a {@link PelJpegMarker}. Some sections can - * occur more than once in the JPEG stream (the {@link - * PelJpegMarker::DQT DQT} and {@link PelJpegMarker::DHT DTH} - * markers for example) and so this is an array of ({@link - * PelJpegMarker}, {@link PelJpegContent}) pairs. - * - * The content can be either generic {@link PelJpegContent JPEG - * content} or {@link PelExif Exif data}. - * - * @var array - */ - private $sections = array(); - - /** - * The JPEG image data. - * - * @var PelDataWindow - */ - private $jpeg_data = null; - - /** - * Construct a new JPEG object. - * - * The new object will be empty unless an argument is given from - * which it can initialize itself. This can either be the filename - * of a JPEG image, a {@link PelDataWindow} object or a PHP image - * resource handle. - * - * New Exif data (in the form of a {@link PelExif} object) can be - * inserted with the {@link setExif()} method: - * - * - * $jpeg = new PelJpeg($data); - * // Create container for the Exif information: - * $exif = new PelExif(); - * // Now Add a PelTiff object with a PelIfd object with one or more - * // PelEntry objects to $exif... Finally add $exif to $jpeg: - * $jpeg->setExif($exif); - * - */ - function __construct($data = false) { - if ($data === false) - return; - - if (is_string($data)) { - Pel::debug('Initializing PelJpeg object from %s', $data); - $this->loadFile($data); - } elseif ($data instanceof PelDataWindow) { - Pel::debug('Initializing PelJpeg object from PelDataWindow.'); - $this->load($data); - } elseif (is_resource($data) && get_resource_type($data) == 'gd') { - Pel::debug('Initializing PelJpeg object from image resource.'); - /* The ImageJpeg() function insists on printing the bytes - * instead of returning them in a more civil way as a string, so - * we have to buffer the output... */ - ob_start(); - ImageJpeg($data); - $bytes = ob_get_clean(); - $this->load(new PelDataWindow($bytes)); - } else { - throw new PelInvalidArgumentException('Bad type for $data: %s', - gettype($data)); - } - } - - /** - * Load data into a JPEG object. - * - * The data supplied will be parsed and turned into an object - * structure representing the image. This structure can then be - * manipulated and later turned back into an string of bytes. - * - * This methods can be called at any time after a JPEG object has - * been constructed, also after the {@link appendSection()} has been - * called to append custom sections. Loading several JPEG images - * into one object will accumulate the sections, but there will only - * be one {@link PelJpegMarker::SOS} section at any given time. - * - * @param PelDataWindow the data that will be turned into JPEG - * sections. - */ - function load(PelDataWindow $d) { - - Pel::debug('Parsing %d bytes...', $d->getSize()); - - /* JPEG data is stored in big-endian format. */ - $d->setByteOrder(PelConvert::BIG_ENDIAN); - - /* Run through the data to read the sections in the image. After - * each section is read, the start of the data window will be - * moved forward, and after the last section we'll terminate with - * no data left in the window. */ - while ($d->getSize() > 0) { - /* JPEG sections start with 0xFF. The first byte that is not - * 0xFF is a marker (hopefully). - */ - for ($i = 0; $i < 7; $i++) - if ($d->getByte($i) != 0xFF) - break; - - $marker = $d->getByte($i); - - if (!PelJpegMarker::isValid($marker)) - throw new PelJpegInvalidMarkerException($marker, $i); - - /* Move window so first byte becomes first byte in this - * section. */ - $d->setWindowStart($i+1); - - if ($marker == PelJpegMarker::SOI || $marker == PelJpegMarker::EOI) { - $content = new PelJpegContent(new PelDataWindow()); - $this->appendSection($marker, $content); - } else { - /* Read the length of the section. The length includes the - * two bytes used to store the length. */ - $len = $d->getShort(0) - 2; - - Pel::debug('Found %s section of length %d', - PelJpegMarker::getName($marker), $len); - - /* Skip past the length. */ - $d->setWindowStart(2); - - if ($marker == PelJpegMarker::APP1) { - - try { - $content = new PelExif(); - $content->load($d->getClone(0, $len)); - } catch (PelInvalidDataException $e) { - /* We store the data as normal JPEG content if it could - * not be parsed as Exif data. */ - $content = new PelJpegContent($d->getClone(0, $len)); - } - - $this->appendSection($marker, $content); - /* Skip past the data. */ - $d->setWindowStart($len); - - } elseif ($marker == PelJpegMarker::COM) { - - $content = new PelJpegComment(); - $content->load($d->getClone(0, $len)); - $this->appendSection($marker, $content); - $d->setWindowStart($len); - - } else { - - $content = new PelJpegContent($d->getClone(0, $len)); - $this->appendSection($marker, $content); - /* Skip past the data. */ - $d->setWindowStart($len); - - /* In case of SOS, image data will follow. */ - if ($marker == PelJpegMarker::SOS) { - /* Some images have some trailing (garbage?) following the - * EOI marker. To handle this we seek backwards until we - * find the EOI marker. Any trailing content is stored as - * a PelJpegContent object. */ - - $length = $d->getSize(); - while ($d->getByte($length-2) != 0xFF || - $d->getByte($length-1) != PelJpegMarker::EOI) { - $length--; - } - - $this->jpeg_data = $d->getClone(0, $length-2); - Pel::debug('JPEG data: ' . $this->jpeg_data->__toString()); - - /* Append the EOI. */ - $this->appendSection(PelJpegMarker::EOI, - new PelJpegContent(new PelDataWindow())); - - /* Now check to see if there are any trailing data. */ - if ($length != $d->getSize()) { - Pel::maybeThrow(new PelException('Found trailing content ' . - 'after EOI: %d bytes', - $d->getSize() - $length)); - $content = new PelJpegContent($d->getClone($length)); - /* We don't have a proper JPEG marker for trailing - * garbage, so we just use 0x00... */ - $this->appendSection(0x00, $content); - } - - /* Done with the loop. */ - break; - } - } - } - } /* while ($d->getSize() > 0) */ - } - - - /** - * Load data from a file into a JPEG object. - * - * @param string the filename. This must be a readable file. - */ - function loadFile($filename) { - $this->load(new PelDataWindow(file_get_contents($filename))); - } - - - /** - * Set Exif data. - * - * Use this to set the Exif data in the image. This will overwrite - * any old Exif information in the image. - * - * @param PelExif the Exif data. - */ - function setExif(PelExif $exif) { - $app0_offset = 1; - $app1_offset = -1; - - /* Search through all sections looking for APP0 or APP1. */ - for ($i = 0; $i < count($this->sections); $i++) { - if ($this->sections[$i][0] == PelJpegMarker::APP0) { - $app0_offset = $i; - } elseif ($this->sections[$i][0] == PelJpegMarker::APP1) { - $app1_offset = $i; - break; - } - } - - /* Store the Exif data at the appropriate place, either where the - * old Exif data was stored ($app1_offset) or right after APP0 - * ($app0_offset+1). */ - if ($app1_offset > 0) - $this->sections[$app1_offset][1] = $exif; - else - $this->insertSection(PelJpegMarker::APP1, $exif, $app0_offset+1); - } - - - /** - * Get Exif data. - * - * Use this to get the @{link PelExif Exif data} stored. - * - * @return PelExif the Exif data found or null if the image has no - * Exif data. - */ - function getExif() { - $exif = $this->getSection(PelJpegMarker::APP1); - if ($exif instanceof PelExif) - return $exif; - else - return null; - } - - - /** - * Clear any Exif data. - * - * This method will only clear the first @{link PelJpegMarker::APP1} - * section found (there should normally be just one). - */ - function clearExif() { - for ($i = 0; $i < count($this->sections); $i++) { - if ($this->sections[$i][0] == PelJpegMarker::APP1) { - unset($this->sections[$i]); - return; - } - } - } - - - /** - * Append a new section. - * - * Used only when loading an image. If it used again later, then the - * section will end up after the @{link PelJpegMarker::EOI EOI - * marker} and will probably not be useful. - * - * Please use @{link setExif()} instead if you intend to add Exif - * information to an image as that function will know the right - * place to insert the data. - * - * @param PelJpegMarker the marker identifying the new section. - * - * @param PelJpegContent the content of the new section. - */ - function appendSection($marker, PelJpegContent $content) { - $this->sections[] = array($marker, $content); - } - - - /** - * Insert a new section. - * - * Please use @{link setExif()} instead if you intend to add Exif - * information to an image as that function will know the right - * place to insert the data. - * - * @param PelJpegMarker the marker for the new section. - * - * @param PelJpegContent the content of the new section. - * - * @param int the offset where the new section will be inserted --- - * use 0 to insert it at the very beginning, use 1 to insert it - * between sections 1 and 2, etc. - */ - function insertSection($marker, PelJpegContent $content, $offset) { - array_splice($this->sections, $offset, 0, array(array($marker, $content))); - } - - - /** - * Get a section corresponding to a particular marker. - * - * Please use the {@link getExif()} if you just need the Exif data. - * - * This will search through the sections of this JPEG object, - * looking for a section identified with the specified {@link - * PelJpegMarker marker}. The {@link PelJpegContent content} will - * then be returned. The optional argument can be used to skip over - * some of the sections. So if one is looking for the, say, third - * {@link PelJpegMarker::DHT DHT} section one would do: - * - * - * $dht3 = $jpeg->getSection(PelJpegMarker::DHT, 2); - * - * - * @param PelJpegMarker the marker identifying the section. - * - * @param int the number of sections to be skipped. This must be a - * non-negative integer. - * - * @return PelJpegContent the content found, or null if there is no - * content available. - */ - function getSection($marker, $skip = 0) { - foreach ($this->sections as $s) { - if ($s[0] == $marker) - if ($skip > 0) - $skip--; - else - return $s[1]; - } - - return null; - } - - - /** - * Get all sections. - * - * @return array an array of ({@link PelJpegMarker}, {@link - * PelJpegContent}) pairs. Each pair is an array with the {@link - * PelJpegMarker} as the first element and the {@link - * PelJpegContent} as the second element, so the return type is an - * array of arrays. - * - * So to loop through all the sections in a given JPEG image do - * this: - * - * - * foreach ($jpeg->getSections() as $section) { - * $marker = $section[0]; - * $content = $section[1]; - * // Use $marker and $content here. - * } - * - * - * instead of this: - * - * - * foreach ($jpeg->getSections() as $marker => $content) { - * // Does not work the way you would think... - * } - * - * - * The problem is that there could be several sections with the same - * marker, and thus a simple associative array does not suffice. - */ - function getSections() { - return $this->sections; - } - - - /** - * Turn this JPEG object into bytes. - * - * The bytes returned by this method is ready to be stored in a file - * as a valid JPEG image. - * - * @return string bytes representing this JPEG object, including all - * its sections and their associated data. - */ - function getBytes() { - $bytes = ''; - - foreach ($this->sections as $section) { - $m = $section[0]; - $c = $section[1]; - - /* Write the marker */ - $bytes .= "\xFF" . PelJpegMarker::getBytes($m); - /* Skip over empty markers. */ - if ($m == PelJpegMarker::SOI || $m == PelJpegMarker::EOI) - continue; - - $data = $c->getBytes(); - $size = strlen($data) + 2; - - $bytes .= PelConvert::shortToBytes($size, PelConvert::BIG_ENDIAN); - $bytes .= $data; - - /* In case of SOS, we need to write the JPEG data. */ - if ($m == PelJpegMarker::SOS) - $bytes .= $this->jpeg_data->getBytes(); - } - - return $bytes; - - } - - - /** - * Make a string representation of this JPEG object. - * - * This is mainly usefull for debugging. It will show the structure - * of the image, and its sections. - * - * @return string debugging information about this JPEG object. - */ - function __toString() { - $str = Pel::tra("Dumping JPEG data...\n"); - for ($i = 0; $i < count($this->sections); $i++) { - $m = $this->sections[$i][0]; - $c = $this->sections[$i][1]; - $str .= Pel::fmt("Section %d (marker 0x%02X - %s):\n", - $i, $m, PelJpegMarker::getName($m)); - $str .= Pel::fmt(" Description: %s\n", - PelJpegMarker::getDescription($m)); - - if ($m == PelJpegMarker::SOI || - $m == PelJpegMarker::EOI) - continue; - - if ($c instanceof PelExif) { - $str .= Pel::tra(" Content : Exif data\n"); - $str .= $c->__toString() . "\n"; - } elseif ($c instanceof PelJpegComment) { - $str .= Pel::fmt(" Content : %s\n", $c->getValue()); - } else { - $str .= Pel::tra(" Content : Unknown\n"); - } - } - - return $str; - } - - - /** - * Test data to see if it could be a valid JPEG image. - * - * The function will only look at the first few bytes of the data, - * and try to determine if it could be a valid JPEG image based on - * those bytes. This means that the check is more like a heuristic - * than a rigorous check. - * - * @param PelDataWindow the bytes that will be checked. - * - * @return boolean true if the bytes look like the beginning of a - * JPEG image, false otherwise. - * - * @see PelTiff::isValid() - */ - static function isValid(PelDataWindow $d) { - /* JPEG data is stored in big-endian format. */ - $d->setByteOrder(PelConvert::BIG_ENDIAN); - - for ($i = 0; $i < 7; $i++) - if ($d->getByte($i) != 0xFF) - break; - - return $d->getByte($i) == PelJpegMarker::SOI; - } - -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelJpegComment.php b/3.1/modules/autorotate/lib/pel/PelJpegComment.php deleted file mode 100644 index feb62c30..00000000 --- a/3.1/modules/autorotate/lib/pel/PelJpegComment.php +++ /dev/null @@ -1,121 +0,0 @@ - - * @version $Revision: 397 $ - * @date $Date: 2005-10-24 00:40:26 +0200 (Mon, 24 Oct 2005) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelJpegContent.php'); -/**#@-*/ - - -/** - * Class representing JPEG comments. - * - * @author Martin Geisler - * @package PEL - */ -class PelJpegComment extends PelJpegContent { - - /** - * The comment. - * - * @var string - */ - private $comment = ''; - - /** - * Construct a new JPEG comment. - * - * The new comment will contain the string given. - */ - function __construct($comment = '') { - $this->comment = $comment; - } - - - /** - * Load and parse data. - * - * This will load the comment from the data window passed. - */ - function load(PelDataWindow $d) { - $this->comment = $d->getBytes(); - } - - - /** - * Update the value with a new comment. - * - * Any old comment will be overwritten. - * - * @param string the new comment. - */ - function setValue($comment) { - $this->comment = $comment; - } - - - /** - * Get the comment. - * - * @return string the comment. - */ - function getValue() { - return $this->comment; - } - - - /** - * Turn this comment into bytes. - * - * @return string bytes representing this comment. - */ - function getBytes() { - $this->comment; - } - - - /** - * Return a string representation of this object. - * - * @return string the same as {@link getValue()}. - */ - function __toString() { - return $this->getValue(); - } - -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelJpegContent.php b/3.1/modules/autorotate/lib/pel/PelJpegContent.php deleted file mode 100644 index 93eea2ae..00000000 --- a/3.1/modules/autorotate/lib/pel/PelJpegContent.php +++ /dev/null @@ -1,82 +0,0 @@ - - * @version $Revision: 380 $ - * @date $Date: 2005-10-03 14:01:28 +0200 (Mon, 03 Oct 2005) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelDataWindow.php'); -/**#@-*/ - - -/** - * Class representing content in a JPEG file. - * - * A JPEG file consists of a sequence of each of which has an - * associated {@link PelJpegMarker marker} and some content. This - * class represents the content, and this basic type is just a simple - * holder of such content, represented by a {@link PelDataWindow} - * object. The {@link PelExif} class is an example of more - * specialized JPEG content. - * - * @author Martin Geisler - * @package PEL - */ -class PelJpegContent { - private $data = null; - - /** - * Make a new piece of JPEG content. - * - * @param PelDataWindow the content. - */ - function __construct(PelDataWindow $data) { - $this->data = $data; - } - - - /** - * Return the bytes of the content. - * - * @return string bytes representing this JPEG content. These bytes - * will match the bytes given to {@link __construct the - * constructor}. - */ - function getBytes() { - return $this->data->getBytes(); - } - -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelJpegMarker.php b/3.1/modules/autorotate/lib/pel/PelJpegMarker.php deleted file mode 100644 index 377b279b..00000000 --- a/3.1/modules/autorotate/lib/pel/PelJpegMarker.php +++ /dev/null @@ -1,435 +0,0 @@ - - * @version $Revision: 432 $ - * @date $Date: 2006-09-06 00:13:00 +0200 (Wed, 06 Sep 2006) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('Pel.php'); -/**#@-*/ - - -/** - * Class with static methods for JPEG markers. - * - * This class defines the constants to be used whenever one refers to - * a JPEG marker. All the methods defined are static, and they all - * operate on one argument which should be one of the class constants. - * They will all be denoted by PelJpegMarker in the documentation. - * - * @author Martin Geisler - * @package PEL - */ -class PelJpegMarker { - - /** Encoding (baseline) */ - const SOF0 = 0xC0; - /** Encoding (extended sequential) */ - const SOF1 = 0xC1; - /** Encoding (progressive) */ - const SOF2 = 0xC2; - /** Encoding (lossless) */ - const SOF3 = 0xC3; - /** Define Huffman table */ - const DHT = 0xC4; - /** Encoding (differential sequential) */ - const SOF5 = 0xC5; - /** Encoding (differential progressive) */ - const SOF6 = 0xC6; - /** Encoding (differential lossless) */ - const SOF7 = 0xC7; - /** Extension */ - const JPG = 0xC8; - /** Encoding (extended sequential, arithmetic) */ - const SOF9 = 0xC9; - /** Encoding (progressive, arithmetic) */ - const SOF10 = 0xCA; - /** Encoding (lossless, arithmetic) */ - const SOF11 = 0xCB; - /** Define arithmetic coding conditioning */ - const DAC = 0xCC; - /** Encoding (differential sequential, arithmetic) */ - const SOF13 = 0xCD; - /** Encoding (differential progressive, arithmetic) */ - const SOF14 = 0xCE; - /** Encoding (differential lossless, arithmetic) */ - const SOF15 = 0xCF; - /** Restart 0 */ - const RST0 = 0xD0; - /** Restart 1 */ - const RST1 = 0xD1; - /** Restart 2 */ - const RST2 = 0xD2; - /** Restart 3 */ - const RST3 = 0xD3; - /** Restart 4 */ - const RST4 = 0xD4; - /** Restart 5 */ - const RST5 = 0xD5; - /** Restart 6 */ - const RST6 = 0xD6; - /** Restart 7 */ - const RST7 = 0xD7; - /** Start of image */ - const SOI = 0xD8; - /** End of image */ - const EOI = 0xD9; - /** Start of scan */ - const SOS = 0xDA; - /** Define quantization table */ - const DQT = 0xDB; - /** Define number of lines */ - const DNL = 0xDC; - /** Define restart interval */ - const DRI = 0xDD; - /** Define hierarchical progression */ - const DHP = 0xDE; - /** Expand reference component */ - const EXP = 0xDF; - /** Application segment 0 */ - const APP0 = 0xE0; - /** - * Application segment 1 - * - * When a JPEG image contains Exif data, the data will normally be - * stored in this section and a call to {@link PelJpeg::getExif()} - * will return a {@link PelExif} object representing it. - */ - const APP1 = 0xE1; - /** Application segment 2 */ - const APP2 = 0xE2; - /** Application segment 3 */ - const APP3 = 0xE3; - /** Application segment 4 */ - const APP4 = 0xE4; - /** Application segment 5 */ - const APP5 = 0xE5; - /** Application segment 6 */ - const APP6 = 0xE6; - /** Application segment 7 */ - const APP7 = 0xE7; - /** Application segment 8 */ - const APP8 = 0xE8; - /** Application segment 9 */ - const APP9 = 0xE9; - /** Application segment 10 */ - const APP10 = 0xEA; - /** Application segment 11 */ - const APP11 = 0xEB; - /** Application segment 12 */ - const APP12 = 0xEC; - /** Application segment 13 */ - const APP13 = 0xED; - /** Application segment 14 */ - const APP14 = 0xEE; - /** Application segment 15 */ - const APP15 = 0xEF; - /** Extension 0 */ - const JPG0 = 0xF0; - /** Extension 1 */ - const JPG1 = 0xF1; - /** Extension 2 */ - const JPG2 = 0xF2; - /** Extension 3 */ - const JPG3 = 0xF3; - /** Extension 4 */ - const JPG4 = 0xF4; - /** Extension 5 */ - const JPG5 = 0xF5; - /** Extension 6 */ - const JPG6 = 0xF6; - /** Extension 7 */ - const JPG7 = 0xF7; - /** Extension 8 */ - const JPG8 = 0xF8; - /** Extension 9 */ - const JPG9 = 0xF9; - /** Extension 10 */ - const JPG10 = 0xFA; - /** Extension 11 */ - const JPG11 = 0xFB; - /** Extension 12 */ - const JPG12 = 0xFC; - /** Extension 13 */ - const JPG13 = 0xFD; - /** Comment */ - const COM = 0xFE; - - /** - * Check if a byte is a valid JPEG marker. - * - * @param PelJpegMarker the byte that will be checked. - * - * @return boolean if the byte is recognized true is returned, - * otherwise false will be returned. - */ - static function isValid($m) { - return ($m >= self::SOF0 && $m <= self::COM); - } - - /** - * Turn a JPEG marker into bytes. - * - * @param PelJpegMarker the marker. - * - * @return string the marker as a string. This will be a string - * with just a single byte since all JPEG markers are simply single - * bytes. - */ - static function getBytes($m) { - return chr($m); - } - - /** - * Return the short name for a marker. - * - * @param PelJpegMarker the marker. - * - * @return string the name of the marker, e.g., 'SOI' for the Start - * of Image marker. - */ - static function getName($m) { - switch ($m) { - case self::SOF0: return 'SOF0'; - case self::SOF1: return 'SOF1'; - case self::SOF2: return 'SOF2'; - case self::SOF3: return 'SOF3'; - case self::SOF5: return 'SOF5'; - case self::SOF6: return 'SOF6'; - case self::SOF7: return 'SOF7'; - case self::SOF9: return 'SOF9'; - case self::SOF10: return 'SOF10'; - case self::SOF11: return 'SOF11'; - case self::SOF13: return 'SOF13'; - case self::SOF14: return 'SOF14'; - case self::SOF15: return 'SOF15'; - case self::SOI: return 'SOI'; - case self::EOI: return 'EOI'; - case self::SOS: return 'SOS'; - case self::COM: return 'COM'; - case self::DHT: return 'DHT'; - case self::JPG: return 'JPG'; - case self::DAC: return 'DAC'; - case self::RST0: return 'RST0'; - case self::RST1: return 'RST1'; - case self::RST2: return 'RST2'; - case self::RST3: return 'RST3'; - case self::RST4: return 'RST4'; - case self::RST5: return 'RST5'; - case self::RST6: return 'RST6'; - case self::RST7: return 'RST7'; - case self::DQT: return 'DQT'; - case self::DNL: return 'DNL'; - case self::DRI: return 'DRI'; - case self::DHP: return 'DHP'; - case self::EXP: return 'EXP'; - case self::APP0: return 'APP0'; - case self::APP1: return 'APP1'; - case self::APP2: return 'APP2'; - case self::APP3: return 'APP3'; - case self::APP4: return 'APP4'; - case self::APP5: return 'APP5'; - case self::APP6: return 'APP6'; - case self::APP7: return 'APP7'; - case self::APP8: return 'APP8'; - case self::APP9: return 'APP9'; - case self::APP10: return 'APP10'; - case self::APP11: return 'APP11'; - case self::APP12: return 'APP12'; - case self::APP13: return 'APP13'; - case self::APP14: return 'APP14'; - case self::APP15: return 'APP15'; - case self::JPG0: return 'JPG0'; - case self::JPG1: return 'JPG1'; - case self::JPG2: return 'JPG2'; - case self::JPG3: return 'JPG3'; - case self::JPG4: return 'JPG4'; - case self::JPG5: return 'JPG5'; - case self::JPG6: return 'JPG6'; - case self::JPG7: return 'JPG7'; - case self::JPG8: return 'JPG8'; - case self::JPG9: return 'JPG9'; - case self::JPG10: return 'JPG10'; - case self::JPG11: return 'JPG11'; - case self::JPG12: return 'JPG12'; - case self::JPG13: return 'JPG13'; - case self::COM: return 'COM'; - default: return Pel::fmt('Unknown marker: 0x%02X', $m); - } - } - - /** - * Returns a description of a JPEG marker. - * - * @param PelJpegMarker the marker. - * - * @return string the description of the marker. - */ - static function getDescription($m) { - switch ($m) { - case self::SOF0: - return Pel::tra('Encoding (baseline)'); - case self::SOF1: - return Pel::tra('Encoding (extended sequential)'); - case self::SOF2: - return Pel::tra('Encoding (progressive)'); - case self::SOF3: - return Pel::tra('Encoding (lossless)'); - case self::SOF5: - return Pel::tra('Encoding (differential sequential)'); - case self::SOF6: - return Pel::tra('Encoding (differential progressive)'); - case self::SOF7: - return Pel::tra('Encoding (differential lossless)'); - case self::SOF9: - return Pel::tra('Encoding (extended sequential, arithmetic)'); - case self::SOF10: - return Pel::tra('Encoding (progressive, arithmetic)'); - case self::SOF11: - return Pel::tra('Encoding (lossless, arithmetic)'); - case self::SOF13: - return Pel::tra('Encoding (differential sequential, arithmetic)'); - case self::SOF14: - return Pel::tra('Encoding (differential progressive, arithmetic)'); - case self::SOF15: - return Pel::tra('Encoding (differential lossless, arithmetic)'); - case self::SOI: - return Pel::tra('Start of image'); - case self::EOI: - return Pel::tra('End of image'); - case self::SOS: - return Pel::tra('Start of scan'); - case self::COM: - return Pel::tra('Comment'); - case self::DHT: - return Pel::tra('Define Huffman table'); - case self::JPG: - return Pel::tra('Extension'); - case self::DAC: - return Pel::tra('Define arithmetic coding conditioning'); - case self::RST0: - return Pel::fmt('Restart %d', 0); - case self::RST1: - return Pel::fmt('Restart %d', 1); - case self::RST2: - return Pel::fmt('Restart %d', 2); - case self::RST3: - return Pel::fmt('Restart %d', 3); - case self::RST4: - return Pel::fmt('Restart %d', 4); - case self::RST5: - return Pel::fmt('Restart %d', 5); - case self::RST6: - return Pel::fmt('Restart %d', 6); - case self::RST7: - return Pel::fmt('Restart %d', 7); - case self::DQT: - return Pel::tra('Define quantization table'); - case self::DNL: - return Pel::tra('Define number of lines'); - case self::DRI: - return Pel::tra('Define restart interval'); - case self::DHP: - return Pel::tra('Define hierarchical progression'); - case self::EXP: - return Pel::tra('Expand reference component'); - case self::APP0: - return Pel::fmt('Application segment %d', 0); - case self::APP1: - return Pel::fmt('Application segment %d', 1); - case self::APP2: - return Pel::fmt('Application segment %d', 2); - case self::APP3: - return Pel::fmt('Application segment %d', 3); - case self::APP4: - return Pel::fmt('Application segment %d', 4); - case self::APP5: - return Pel::fmt('Application segment %d', 5); - case self::APP6: - return Pel::fmt('Application segment %d', 6); - case self::APP7: - return Pel::fmt('Application segment %d', 7); - case self::APP8: - return Pel::fmt('Application segment %d', 8); - case self::APP9: - return Pel::fmt('Application segment %d', 9); - case self::APP10: - return Pel::fmt('Application segment %d', 10); - case self::APP11: - return Pel::fmt('Application segment %d', 11); - case self::APP12: - return Pel::fmt('Application segment %d', 12); - case self::APP13: - return Pel::fmt('Application segment %d', 13); - case self::APP14: - return Pel::fmt('Application segment %d', 14); - case self::APP15: - return Pel::fmt('Application segment %d', 15); - case self::JPG0: - return Pel::fmt('Extension %d', 0); - case self::JPG1: - return Pel::fmt('Extension %d', 1); - case self::JPG2: - return Pel::fmt('Extension %d', 2); - case self::JPG3: - return Pel::fmt('Extension %d', 3); - case self::JPG4: - return Pel::fmt('Extension %d', 4); - case self::JPG5: - return Pel::fmt('Extension %d', 5); - case self::JPG6: - return Pel::fmt('Extension %d', 6); - case self::JPG7: - return Pel::fmt('Extension %d', 7); - case self::JPG8: - return Pel::fmt('Extension %d', 8); - case self::JPG9: - return Pel::fmt('Extension %d', 9); - case self::JPG10: - return Pel::fmt('Extension %d', 10); - case self::JPG11: - return Pel::fmt('Extension %d', 11); - case self::JPG12: - return Pel::fmt('Extension %d', 12); - case self::JPG13: - return Pel::fmt('Extension %d', 13); - case self::COM: - return Pel::tra('Comment'); - default: - return Pel::fmt('Unknown marker: 0x%02X', $m); - } - } -} - -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelTag.php b/3.1/modules/autorotate/lib/pel/PelTag.php deleted file mode 100644 index 5000811e..00000000 --- a/3.1/modules/autorotate/lib/pel/PelTag.php +++ /dev/null @@ -1,1969 +0,0 @@ - - * @version $Revision: 472 $ - * @date $Date: 2006-11-19 21:29:14 +0100 (Sun, 19 Nov 2006) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('Pel.php'); -require_once('PelIfd.php'); -/**#@-*/ - - -/** - * Class with static methods for Exif tags. - * - * This class defines the constants that represents the Exif tags - * known to PEL. They are supposed to be used whenever one needs to - * specify an Exif tag, and they will be denoted by the pseudo-type - * {@link PelTag} throughout the documentation. - * - * Please note that the constrains on the format and number of - * components given here are advisory only. To follow the Exif - * specification one should obey them, but there is nothing that - * prevents you from creating an {@link IMAGE_LENGTH} entry with two - * or more components, even though the standard says that there should - * be exactly one component. - * - * All the methods in this class are static and should be called with - * the Exif tag on which they should operate. - * - * @author Martin Geisler - * @package PEL - */ -class PelTag { - - /** - * Interoperability index. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: 4. - */ - const INTEROPERABILITY_INDEX = 0x0001; - - /** - * Interoperability version. - * - * Format: {@link PelFormat::UNDEFINED}. - * - * Components: 4. - */ - const INTEROPERABILITY_VERSION = 0x0002; - - /** - * Image width. - * - * Format: {@link PelFormat::SHORT} or {@link PelFormat::LONG}. - * - * Components: 1. - */ - const IMAGE_WIDTH = 0x0100; - - /** - * Image length. - * - * Format: {@link PelFormat::SHORT} or {@link PelFormat::LONG}. - * - * Components: 1. - */ - const IMAGE_LENGTH = 0x0101; - - /** - * Number of bits per component. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 3. - */ - const BITS_PER_SAMPLE = 0x0102; - - /** - * Compression scheme. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const COMPRESSION = 0x0103; - - /** - * Pixel composition. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const PHOTOMETRIC_INTERPRETATION = 0x0106; - - /** - * Fill Orde - * - * Format: Unknown. - * - * Components: Unknown. - */ - const FILL_ORDER = 0x010A; - - /** - * Document Name - * - * Format: Unknown. - * - * Components: Unknown. - */ - const DOCUMENT_NAME = 0x010D; - - /** - * Image Description - * - * Format: {@link PelEntryAscii}. - * - * Components: any number. - */ - const IMAGE_DESCRIPTION = 0x010E; - - /** - * Manufacturer - * - * Format: {@link PelEntryAscii}. - * - * Components: any number. - */ - const MAKE = 0x010F; - - /** - * Model - * - * Format: {@link PelFormat::ASCII}. - * - * Components: any number. - */ - const MODEL = 0x0110; - - /** - * Strip Offsets - * - * Format: {@link PelFormat::SHORT} or {@link PelFormat::LONG}. - * - * Components: any number. - */ - const STRIP_OFFSETS = 0x0111; - - /** - * Orientation of image. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const ORIENTATION = 0x0112; - - /** - * Number of components. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const SAMPLES_PER_PIXEL = 0x0115; - - /** - * Rows per Strip - * - * Format: {@link PelFormat::SHORT} or {@link PelFormat::LONG}. - * - * Components: 1. - */ - const ROWS_PER_STRIP = 0x0116; - - /** - * Strip Byte Count - * - * Format: {@link PelFormat::SHORT} or {@link PelFormat::LONG}. - * - * Components: any number. - */ - const STRIP_BYTE_COUNTS = 0x0117; - - /** - * Image resolution in width direction. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const X_RESOLUTION = 0x011A; - - /** - * Image resolution in height direction. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const Y_RESOLUTION = 0x011B; - - /** - * Image data arrangement. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const PLANAR_CONFIGURATION = 0x011C; - - /** - * Unit of X and Y resolution. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const RESOLUTION_UNIT = 0x0128; - - /** - * Transfer function. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 3. - */ - const TRANSFER_FUNCTION = 0x012D; - - /** - * Software used. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: any number. - */ - const SOFTWARE = 0x0131; - - /** - * File change date and time. - * - * Format: {@link PelFormat::ASCII}, modelled by the {@link - * PelEntryTime} class. - * - * Components: 20. - */ - const DATE_TIME = 0x0132; - - /** - * Person who created the image. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: any number. - */ - const ARTIST = 0x013B; - - /** - * White point chromaticity. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 2. - */ - const WHITE_POINT = 0x013E; - - /** - * Chromaticities of primaries. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 6. - */ - const PRIMARY_CHROMATICITIES = 0x013F; - - /** - * Transfer Range - * - * Format: Unknown. - * - * Components: Unknown. - */ - const TRANSFER_RANGE = 0x0156; - - /** - * JPEGProc - * - * Format: Unknown. - * - * Components: Unknown. - */ - const JPEG_PROC = 0x0200; - - /** - * Offset to JPEG SOI. - * - * Format: {@link PelFormat::LONG}. - * - * Components: 1. - */ - const JPEG_INTERCHANGE_FORMAT = 0x0201; - - /** - * Bytes of JPEG data. - * - * Format: {@link PelFormat::LONG}. - * - * Components: 1. - */ - const JPEG_INTERCHANGE_FORMAT_LENGTH = 0x0202; - - /** - * Color space transformation matrix coefficients. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 3. - */ - const YCBCR_COEFFICIENTS = 0x0211; - - /** - * Subsampling ratio of Y to C. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 2. - */ - const YCBCR_SUB_SAMPLING = 0x0212; - - /** - * Y and C positioning. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const YCBCR_POSITIONING = 0x0213; - - /** - * Pair of black and white reference values. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 6. - */ - const REFERENCE_BLACK_WHITE = 0x0214; - - /** - * Related Image File Format - * - * Format: Unknown. - * - * Components: Unknown. - */ - const RELATED_IMAGE_FILE_FORMAT = 0x1000; - - /** - * Related Image Width - * - * Format: Unknown, probably {@link PelFormat::SHORT}? - * - * Components: Unknown, probably 1. - */ - const RELATED_IMAGE_WIDTH = 0x1001; - - /** Related Image Length - * - * Format: Unknown, probably {@link PelFormat::SHORT}? - * - * Components: Unknown, probably 1. - */ - const RELATED_IMAGE_LENGTH = 0x1002; - - /** - * CFA Repeat Pattern Dim. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 2. - */ - const CFA_REPEAT_PATTERN_DIM = 0x828D; - - /** - * Battery level. - * - * Format: Unknown. - * - * Components: Unknown. - */ - const BATTERY_LEVEL = 0x828F; - - /** - * Copyright holder. - * - * Format: {@link PelFormat::ASCII}, modelled by the {@link - * PelEntryCopyright} class. - * - * Components: any number. - */ - const COPYRIGHT = 0x8298; - - /** - * Exposure Time - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const EXPOSURE_TIME = 0x829A; - - /** - * FNumber - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const FNUMBER = 0x829D; - - /** - * IPTC/NAA - * - * Format: {@link PelFormat::LONG}. - * - * Components: any number. - */ - const IPTC_NAA = 0x83BB; - - /** - * Exif IFD Pointer - * - * Format: {@link PelFormat::LONG}. - * - * Components: 1. - */ - const EXIF_IFD_POINTER = 0x8769; - - /** - * Inter Color Profile - * - * Format: {@link PelFormat::UNDEFINED}. - * - * Components: any number. - */ - const INTER_COLOR_PROFILE = 0x8773; - - /** - * Exposure Program - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const EXPOSURE_PROGRAM = 0x8822; - - /** - * Spectral Sensitivity - * - * Format: {@link PelFormat::ASCII}. - * - * Components: any number. - */ - const SPECTRAL_SENSITIVITY = 0x8824; - - /** - * GPS Info IFD Pointer - * - * Format: {@link PelFormat::LONG}. - * - * Components: 1. - */ - const GPS_INFO_IFD_POINTER = 0x8825; - - /** - * ISO Speed Ratings - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 2. - */ - const ISO_SPEED_RATINGS = 0x8827; - - /** - * OECF - * - * Format: {@link PelFormat::UNDEFINED}. - * - * Components: any number. - */ - const OECF = 0x8828; - - /** - * Exif version. - * - * Format: {@link PelFormat::UNDEFINED}, modelled by the {@link - * PelEntryVersion} class. - * - * Components: 4. - */ - const EXIF_VERSION = 0x9000; - - /** - * Date and time of original data generation. - * - * Format: {@link PelFormat::ASCII}, modelled by the {@link - * PelEntryTime} class. - * - * Components: 20. - */ - const DATE_TIME_ORIGINAL = 0x9003; - - /** - * Date and time of digital data generation. - * - * Format: {@link PelFormat::ASCII}, modelled by the {@link - * PelEntryTime} class. - * - * Components: 20. - */ - const DATE_TIME_DIGITIZED = 0x9004; - - /** - * Meaning of each component. - * - * Format: {@link PelFormat::UNDEFINED}. - * - * Components: 4. - */ - const COMPONENTS_CONFIGURATION = 0x9101; - - /** - * Image compression mode. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const COMPRESSED_BITS_PER_PIXEL = 0x9102; - - /** - * Shutter speed - * - * Format: {@link PelFormat::SRATIONAL}. - * - * Components: 1. - */ - const SHUTTER_SPEED_VALUE = 0x9201; - - /** - * Aperture - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const APERTURE_VALUE = 0x9202; - - /** - * Brightness - * - * Format: {@link PelFormat::SRATIONAL}. - * - * Components: 1. - */ - const BRIGHTNESS_VALUE = 0x9203; - - /** - * Exposure Bias - * - * Format: {@link PelFormat::SRATIONAL}. - * - * Components: 1. - */ - const EXPOSURE_BIAS_VALUE = 0x9204; - - /** - * Max Aperture Value - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const MAX_APERTURE_VALUE = 0x9205; - - /** - * Subject Distance - * - * Format: {@link PelFormat::SRATIONAL}. - * - * Components: 1. - */ - const SUBJECT_DISTANCE = 0x9206; - - /** - * Metering Mode - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const METERING_MODE = 0x9207; - - /** - * Light Source - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const LIGHT_SOURCE = 0x9208; - - /** - * Flash - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const FLASH = 0x9209; - - /** - * Focal Length - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const FOCAL_LENGTH = 0x920A; - - /** - * Subject Area - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 4. - */ - const SUBJECT_AREA = 0x9214; - - /** - * Maker Note - * - * Format: {@link PelFormat::UNDEFINED}. - * - * Components: any number. - */ - const MAKER_NOTE = 0x927C; - - /** - * User Comment - * - * Format: {@link PelFormat::UNDEFINED}, modelled by the {@link - * PelEntryUserComment} class. - * - * Components: any number. - */ - const USER_COMMENT = 0x9286; - - /** - * SubSec Time - * - * Format: {@link PelFormat::ASCII}. - * - * Components: any number. - */ - const SUB_SEC_TIME = 0x9290; - - /** - * SubSec Time Original - * - * Format: {@link PelFormat::ASCII}. - * - * Components: any number. - */ - const SUB_SEC_TIME_ORIGINAL = 0x9291; - - /** - * SubSec Time Digitized - * - * Format: {@link PelFormat::ASCII}. - * - * Components: any number. - */ - const SUB_SEC_TIME_DIGITIZED = 0x9292; - - /** - * Windows XP Title - * - * Format: {@link PelFormat::BYTE}. - * - * Components: any number. - */ - const XP_TITLE = 0x9C9B; - - - /** - * Windows XP Comment - * - * Format: {@link PelFormat::BYTE}. - * - * Components: any number. - */ - const XP_COMMENT = 0x9C9C; - - - /** - * Windows XP Author - * - * Format: {@link PelFormat::BYTE}. - * - * Components: any number. - */ - const XP_AUTHOR = 0x9C9D; - - - /** - * Windows XP Keywords - * - * Format: {@link PelFormat::BYTE}. - * - * Components: any number. - */ - const XP_KEYWORDS = 0x9C9E; - - - /** - * Windows XP Subject - * - * Format: {@link PelFormat::BYTE}. - * - * Components: any number. - */ - const XP_SUBJECT = 0x9C9F; - - - /** - * Supported Flashpix version - * - * Format: {@link PelFormat::UNDEFINED}, modelled by the {@link - * PelEntryVersion} class. - * - * Components: 4. - */ - const FLASH_PIX_VERSION = 0xA000; - - /** - * Color space information. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const COLOR_SPACE = 0xA001; - - /** - * Valid image width. - * - * Format: {@link PelFormat::SHORT} or {@link PelFormat::LONG}. - * - * Components: 1. - */ - const PIXEL_X_DIMENSION = 0xA002; - - /** - * Valid image height. - * - * Format: {@link PelFormat::SHORT} or {@link PelFormat::LONG}. - * - * Components: 1. - */ - const PIXEL_Y_DIMENSION = 0xA003; - - /** - * Related audio file. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: any number. - */ - const RELATED_SOUND_FILE = 0xA004; - - /** - * Interoperability IFD Pointer - * - * Format: {@link PelFormat::LONG}. - * - * Components: 1. - */ - const INTEROPERABILITY_IFD_POINTER = 0xA005; - - /** - * Flash energy. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const FLASH_ENERGY = 0xA20B; - - /** - * Spatial frequency response. - * - * Format: {@link PelFormat::UNDEFINED}. - * - * Components: any number. - */ - const SPATIAL_FREQUENCY_RESPONSE = 0xA20C; - - /** - * Focal plane X resolution. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const FOCAL_PLANE_X_RESOLUTION = 0xA20E; - - /** - * Focal plane Y resolution. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const FOCAL_PLANE_Y_RESOLUTION = 0xA20F; - - /** - * Focal plane resolution unit. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const FOCAL_PLANE_RESOLUTION_UNIT = 0xA210; - - /** - * Subject location. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const SUBJECT_LOCATION = 0xA214; - - /** - * Exposure index. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const EXPOSURE_INDEX = 0xA215; - - /** - * Sensing method. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const SENSING_METHOD = 0xA217; - - /** - * File source. - * - * Format: {@link PelFormat::UNDEFINED}. - * - * Components: 1. - */ - const FILE_SOURCE = 0xA300; - - /** - * Scene type. - * - * Format: {@link PelFormat::UNDEFINED}. - * - * Components: 1. - */ - const SCENE_TYPE = 0xA301; - - /** - * CFA pattern. - * - * Format: {@link PelFormat::UNDEFINED}. - * - * Components: any number. - */ - const CFA_PATTERN = 0xA302; - - /** - * Custom image processing. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const CUSTOM_RENDERED = 0xA401; - - /** - * Exposure mode. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const EXPOSURE_MODE = 0xA402; - - /** - * White balance. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const WHITE_BALANCE = 0xA403; - - /** - * Digital zoom ratio. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const DIGITAL_ZOOM_RATIO = 0xA404; - - /** - * Focal length in 35mm film. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const FOCAL_LENGTH_IN_35MM_FILM = 0xA405; - - /** - * Scene capture type. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const SCENE_CAPTURE_TYPE = 0xA406; - - /** - * Gain control. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const GAIN_CONTROL = 0xA407; - - /** - * Contrast. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const CONTRAST = 0xA408; - - /** - * Saturation. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const SATURATION = 0xA409; - - /** - * Sharpness. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const SHARPNESS = 0xA40A; - - /** - * Device settings description. - * - * This tag indicates information on the picture-taking conditions - * of a particular camera model. The tag is used only to indicate - * the picture-taking conditions in the reader. - */ - const DEVICE_SETTING_DESCRIPTION = 0xA40B; - - /** - * Subject distance range. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const SUBJECT_DISTANCE_RANGE = 0xA40C; - - /** - * Image unique ID. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: 32. - */ - const IMAGE_UNIQUE_ID = 0xA420; - - /** - * Gamma. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const GAMMA = 0xA500; - - /** - * PrintIM - * - * Format: {@link PelFormat::UNDEFINED}. - * - * Components: unknown. - */ - const PRINT_IM = 0xC4A5; - - /** - * GPS tag version. - * - * Format: {@link PelFormat::BYTE}. - * - * Components: 4. - */ - const GPS_VERSION_ID = 0x0000; - - /** - * North or South Latitude. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: 2. - */ - const GPS_LATITUDE_REF = 0x0001; - - /** - * Latitude. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 3. - */ - const GPS_LATITUDE = 0x0002; - - /** - * East or West Longitude. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: 2. - */ - const GPS_LONGITUDE_REF = 0x0003; - - /** - * Longitude. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 3. - */ - const GPS_LONGITUDE = 0x0004; - - /** - * Altitude reference. - * - * Format: {@link PelFormat::BYTE}. - * - * Components: 1. - */ - const GPS_ALTITUDE_REF = 0x0005; - - /** - * Altitude. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const GPS_ALTITUDE = 0x0006; - - /** - * GPS time (atomic clock). - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 3. - */ - const GPS_TIME_STAMP = 0x0007; - - /** - * GPS satellites used for measurement. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: Any. - */ - const GPS_SATELLITES = 0x0008; - - /** - * GPS receiver status. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: 2. - */ - const GPS_STATUS = 0x0009; - - /** - * GPS measurement mode. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: 2. - */ - const GPS_MEASURE_MODE = 0x000A; - - /** - * Measurement precision. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const GPS_DOP = 0x000B; - - /** - * Speed unit. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: 2. - */ - const GPS_SPEED_REF = 0x000C; - - /** - * Speed of GPS receiver. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const GPS_SPEED = 0x000D; - - /** - * Reference for direction of movement. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: 2. - */ - const GPS_TRACK_REF = 0x000E; - - /** - * Direction of movement. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const GPS_TRACK = 0x000F; - - /** - * Reference for direction of image. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: 2. - */ - const GPS_IMG_DIRECTION_REF = 0x0010; - - /** - * Direction of image. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const GPS_IMG_DIRECTION = 0x0011; - - /** - * Geodetic survey data used. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: Any. - */ - const GPS_MAP_DATUM = 0x0012; - - /** - * Reference for latitude of destination. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: 2. - */ - const GPS_DEST_LATITUDE_REF = 0x0013; - - /** - * Latitude of destination. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 3. - */ - const GPS_DEST_LATITUDE = 0x0014; - - /** - * Reference for longitude of destination. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: 2. - */ - const GPS_DEST_LONGITUDE_REF = 0x0015; - - /** - * Longitude of destination. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 3. - */ - const GPS_DEST_LONGITUDE = 0x0016; - - /** - * Reference for bearing of destination. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: 2. - */ - const GPS_DEST_BEARING_REF = 0x0017; - - /** - * Bearing of destination. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const GPS_DEST_BEARING = 0x0018; - - /** - * Reference for distance to destination. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: 2. - */ - const GPS_DEST_DISTANCE_REF = 0x0019; - - /** - * Distance to destination. - * - * Format: {@link PelFormat::RATIONAL}. - * - * Components: 1. - */ - const GPS_DEST_DISTANCE = 0x001A; - - /** - * Name of GPS processing method. - * - * Format: {@link PelFormat::UNDEFINED}. - * - * Components: Any. - */ - const GPS_PROCESSING_METHOD = 0x001B; - - /** - * Name of GPS area. - * - * Format: {@link PelFormat::UNDEFINED}. - * - * Components: Any. - */ - const GPS_AREA_INFORMATION = 0x001C; - - /** - * GPS date. - * - * Format: {@link PelFormat::ASCII}. - * - * Components: 11. - */ - const GPS_DATE_STAMP = 0x001D; - - /** - * GPS differential correction. - * - * Format: {@link PelFormat::SHORT}. - * - * Components: 1. - */ - const GPS_DIFFERENTIAL = 0x001E; - - - /** - * Returns a short name for an Exif tag. - * - * @param int the IFD type of the tag, one of {@link PelIfd::IFD0}, - * {@link PelIfd::IFD1}, {@link PelIfd::EXIF}, {@link PelIfd::GPS}, - * or {@link PelIfd::INTEROPERABILITY}. - * - * @param PelTag the tag. - * - * @return string the short name of the tag, e.g., 'ImageWidth' for - * the {@link IMAGE_WIDTH} tag. If the tag is not known, the string - * 'Unknown:0xTTTT' will be returned where 'TTTT' is the hexadecimal - * representation of the tag. - */ - static function getName($type, $tag) { - - switch ($type) { - case PelIfd::IFD0: - case PelIfd::IFD1: - case PelIfd::EXIF: - case PelIfd::INTEROPERABILITY: - - switch ($tag) { - case self::INTEROPERABILITY_INDEX: - return 'InteroperabilityIndex'; - case self::INTEROPERABILITY_VERSION: - return 'InteroperabilityVersion'; - case self::IMAGE_WIDTH: - return 'ImageWidth'; - case self::IMAGE_LENGTH: - return 'ImageLength'; - case self::BITS_PER_SAMPLE: - return 'BitsPerSample'; - case self::COMPRESSION: - return 'Compression'; - case self::PHOTOMETRIC_INTERPRETATION: - return 'PhotometricInterpretation'; - case self::FILL_ORDER: - return 'FillOrder'; - case self::DOCUMENT_NAME: - return 'DocumentName'; - case self::IMAGE_DESCRIPTION: - return 'ImageDescription'; - case self::MAKE: - return 'Make'; - case self::MODEL: - return 'Model'; - case self::STRIP_OFFSETS: - return 'StripOffsets'; - case self::ORIENTATION: - return 'Orientation'; - case self::SAMPLES_PER_PIXEL: - return 'SamplesPerPixel'; - case self::ROWS_PER_STRIP: - return 'RowsPerStrip'; - case self::STRIP_BYTE_COUNTS: - return 'StripByteCounts'; - case self::X_RESOLUTION: - return 'XResolution'; - case self::Y_RESOLUTION: - return 'YResolution'; - case self::PLANAR_CONFIGURATION: - return 'PlanarConfiguration'; - case self::RESOLUTION_UNIT: - return 'ResolutionUnit'; - case self::TRANSFER_FUNCTION: - return 'TransferFunction'; - case self::SOFTWARE: - return 'Software'; - case self::DATE_TIME: - return 'DateTime'; - case self::ARTIST: - return 'Artist'; - case self::WHITE_POINT: - return 'WhitePoint'; - case self::PRIMARY_CHROMATICITIES: - return 'PrimaryChromaticities'; - case self::TRANSFER_RANGE: - return 'TransferRange'; - case self::JPEG_PROC: - return 'JPEGProc'; - case self::JPEG_INTERCHANGE_FORMAT: - return 'JPEGInterchangeFormat'; - case self::JPEG_INTERCHANGE_FORMAT_LENGTH: - return 'JPEGInterchangeFormatLength'; - case self::YCBCR_COEFFICIENTS: - return 'YCbCrCoefficients'; - case self::YCBCR_SUB_SAMPLING: - return 'YCbCrSubSampling'; - case self::YCBCR_POSITIONING: - return 'YCbCrPositioning'; - case self::REFERENCE_BLACK_WHITE: - return 'ReferenceBlackWhite'; - case self::RELATED_IMAGE_FILE_FORMAT: - return 'RelatedImageFileFormat'; - case self::RELATED_IMAGE_WIDTH: - return 'RelatedImageWidth'; - case self::RELATED_IMAGE_LENGTH: - return 'RelatedImageLength'; - case self::CFA_REPEAT_PATTERN_DIM: - return 'CFARepeatPatternDim'; - case self::CFA_PATTERN: - return 'CFAPattern'; - case self::BATTERY_LEVEL: - return 'BatteryLevel'; - case self::COPYRIGHT: - return 'Copyright'; - case self::EXPOSURE_TIME: - return 'ExposureTime'; - case self::FNUMBER: - return 'FNumber'; - case self::IPTC_NAA: - return 'IPTC/NAA'; - case self::EXIF_IFD_POINTER: - return 'ExifIFDPointer'; - case self::INTER_COLOR_PROFILE: - return 'InterColorProfile'; - case self::EXPOSURE_PROGRAM: - return 'ExposureProgram'; - case self::SPECTRAL_SENSITIVITY: - return 'SpectralSensitivity'; - case self::GPS_INFO_IFD_POINTER: - return 'GPSInfoIFDPointer'; - case self::ISO_SPEED_RATINGS: - return 'ISOSpeedRatings'; - case self::OECF: - return 'OECF'; - case self::EXIF_VERSION: - return 'ExifVersion'; - case self::DATE_TIME_ORIGINAL: - return 'DateTimeOriginal'; - case self::DATE_TIME_DIGITIZED: - return 'DateTimeDigitized'; - case self::COMPONENTS_CONFIGURATION: - return 'ComponentsConfiguration'; - case self::COMPRESSED_BITS_PER_PIXEL: - return 'CompressedBitsPerPixel'; - case self::SHUTTER_SPEED_VALUE: - return 'ShutterSpeedValue'; - case self::APERTURE_VALUE: - return 'ApertureValue'; - case self::BRIGHTNESS_VALUE: - return 'BrightnessValue'; - case self::EXPOSURE_BIAS_VALUE: - return 'ExposureBiasValue'; - case self::MAX_APERTURE_VALUE: - return 'MaxApertureValue'; - case self::SUBJECT_DISTANCE: - return 'SubjectDistance'; - case self::METERING_MODE: - return 'MeteringMode'; - case self::LIGHT_SOURCE: - return 'LightSource'; - case self::FLASH: - return 'Flash'; - case self::FOCAL_LENGTH: - return 'FocalLength'; - case self::MAKER_NOTE: - return 'MakerNote'; - case self::USER_COMMENT: - return 'UserComment'; - case self::SUB_SEC_TIME: - return 'SubSecTime'; - case self::SUB_SEC_TIME_ORIGINAL: - return 'SubSecTimeOriginal'; - case self::SUB_SEC_TIME_DIGITIZED: - return 'SubSecTimeDigitized'; - case self::XP_TITLE: - return 'WindowsXPTitle'; - case self::XP_COMMENT: - return 'WindowsXPComment'; - case self::XP_AUTHOR: - return 'WindowsXPAuthor'; - case self::XP_KEYWORDS: - return 'WindowsXPKeywords'; - case self::XP_SUBJECT: - return 'WindowsXPSubject'; - case self::FLASH_PIX_VERSION: - return 'FlashPixVersion'; - case self::COLOR_SPACE: - return 'ColorSpace'; - case self::PIXEL_X_DIMENSION: - return 'PixelXDimension'; - case self::PIXEL_Y_DIMENSION: - return 'PixelYDimension'; - case self::RELATED_SOUND_FILE: - return 'RelatedSoundFile'; - case self::INTEROPERABILITY_IFD_POINTER: - return 'InteroperabilityIFDPointer'; - case self::FLASH_ENERGY: - return 'FlashEnergy'; - case self::SPATIAL_FREQUENCY_RESPONSE: - return 'SpatialFrequencyResponse'; - case self::FOCAL_PLANE_X_RESOLUTION: - return 'FocalPlaneXResolution'; - case self::FOCAL_PLANE_Y_RESOLUTION: - return 'FocalPlaneYResolution'; - case self::FOCAL_PLANE_RESOLUTION_UNIT: - return 'FocalPlaneResolutionUnit'; - case self::SUBJECT_LOCATION: - return 'SubjectLocation'; - case self::EXPOSURE_INDEX: - return 'ExposureIndex'; - case self::SENSING_METHOD: - return 'SensingMethod'; - case self::FILE_SOURCE: - return 'FileSource'; - case self::SCENE_TYPE: - return 'SceneType'; - case self::SUBJECT_AREA: - return 'SubjectArea'; - case self::CUSTOM_RENDERED: - return 'CustomRendered'; - case self::EXPOSURE_MODE: - return 'ExposureMode'; - case self::WHITE_BALANCE: - return 'WhiteBalance'; - case self::DIGITAL_ZOOM_RATIO: - return 'DigitalZoomRatio'; - case self::FOCAL_LENGTH_IN_35MM_FILM: - return 'FocalLengthIn35mmFilm'; - case self::SCENE_CAPTURE_TYPE: - return 'SceneCaptureType'; - case self::GAIN_CONTROL: - return 'GainControl'; - case self::CONTRAST: - return 'Contrast'; - case self::SATURATION: - return 'Saturation'; - case self::SHARPNESS: - return 'Sharpness'; - case self::DEVICE_SETTING_DESCRIPTION: - return 'DeviceSettingDescription'; - case self::SUBJECT_DISTANCE_RANGE: - return 'SubjectDistanceRange'; - case self::IMAGE_UNIQUE_ID: - return 'ImageUniqueID'; - case self::GAMMA: - return 'Gamma'; - case self::PRINT_IM: - return 'PrintIM'; - } - - case PelIfd::GPS: - switch ($tag) { - case self::GPS_VERSION_ID: - return 'GPSVersionID'; - case self::GPS_LATITUDE_REF: - return 'GPSLatitudeRef'; - case self::GPS_LATITUDE: - return 'GPSLatitude'; - case self::GPS_LONGITUDE_REF: - return 'GPSLongitudeRef'; - case self::GPS_LONGITUDE: - return 'GPSLongitude'; - case self::GPS_ALTITUDE_REF: - return 'GPSAltitudeRef'; - case self::GPS_ALTITUDE: - return 'GPSAltitude'; - case self::GPS_TIME_STAMP: - return 'GPSTimeStamp'; - case self::GPS_SATELLITES: - return 'GPSSatellites'; - case self::GPS_STATUS: - return 'GPSStatus'; - case self::GPS_MEASURE_MODE: - return 'GPSMeasureMode'; - case self::GPS_DOP: - return 'GPSDOP'; - case self::GPS_SPEED_REF: - return 'GPSSpeedRef'; - case self::GPS_SPEED: - return 'GPSSpeed'; - case self::GPS_TRACK_REF: - return 'GPSTrackRef'; - case self::GPS_TRACK: - return 'GPSTrack'; - case self::GPS_IMG_DIRECTION_REF: - return 'GPSImgDirectionRef'; - case self::GPS_IMG_DIRECTION: - return 'GPSImgDirection'; - case self::GPS_MAP_DATUM: - return 'GPSMapDatum'; - case self::GPS_DEST_LATITUDE_REF: - return 'GPSDestLatitudeRef'; - case self::GPS_DEST_LATITUDE: - return 'GPSDestLatitude'; - case self::GPS_DEST_LONGITUDE_REF: - return 'GPSDestLongitudeRef'; - case self::GPS_DEST_LONGITUDE: - return 'GPSDestLongitude'; - case self::GPS_DEST_BEARING_REF: - return 'GPSDestBearingRef'; - case self::GPS_DEST_BEARING: - return 'GPSDestBearing'; - case self::GPS_DEST_DISTANCE_REF: - return 'GPSDestDistanceRef'; - case self::GPS_DEST_DISTANCE: - return 'GPSDestDistance'; - case self::GPS_PROCESSING_METHOD: - return 'GPSProcessingMethod'; - case self::GPS_AREA_INFORMATION: - return 'GPSAreaInformation'; - case self::GPS_DATE_STAMP: - return 'GPSDateStamp'; - case self::GPS_DIFFERENTIAL: - return 'GPSDifferential'; - } - - default: - return Pel::fmt('Unknown: 0x%04X', $tag); - } - } - - - /** - * Returns a title for an Exif tag. - * - * @param int the IFD type of the tag, one of {@link PelIfd::IFD0}, - * {@link PelIfd::IFD1}, {@link PelIfd::EXIF}, {@link PelIfd::GPS}, - * or {@link PelIfd::INTEROPERABILITY}. - * - * @param PelTag the tag. - * - * @return string the title of the tag, e.g., 'Image Width' for the - * {@link IMAGE_WIDTH} tag. If the tag isn't known, the string - * 'Unknown Tag: 0xTT' will be returned where 'TT' is the - * hexadecimal representation of the tag. - */ - function getTitle($type, $tag) { - - switch ($type) { - case PelIfd::IFD0: - case PelIfd::IFD1: - case PelIfd::EXIF: - case PelIfd::INTEROPERABILITY: - - switch ($tag) { - case self::INTEROPERABILITY_INDEX: - return Pel::tra('Interoperability Index'); - case self::INTEROPERABILITY_VERSION: - return Pel::tra('Interoperability Version'); - case self::IMAGE_WIDTH: - return Pel::tra('Image Width'); - case self::IMAGE_LENGTH: - return Pel::tra('Image Length'); - case self::BITS_PER_SAMPLE: - return Pel::tra('Bits per Sample'); - case self::COMPRESSION: - return Pel::tra('Compression'); - case self::PHOTOMETRIC_INTERPRETATION: - return Pel::tra('Photometric Interpretation'); - case self::FILL_ORDER: - return Pel::tra('Fill Order'); - case self::DOCUMENT_NAME: - return Pel::tra('Document Name'); - case self::IMAGE_DESCRIPTION: - return Pel::tra('Image Description'); - case self::MAKE: - return Pel::tra('Manufacturer'); - case self::MODEL: - return Pel::tra('Model'); - case self::STRIP_OFFSETS: - return Pel::tra('Strip Offsets'); - case self::ORIENTATION: - return Pel::tra('Orientation'); - case self::SAMPLES_PER_PIXEL: - return Pel::tra('Samples per Pixel'); - case self::ROWS_PER_STRIP: - return Pel::tra('Rows per Strip'); - case self::STRIP_BYTE_COUNTS: - return Pel::tra('Strip Byte Count'); - case self::X_RESOLUTION: - return Pel::tra('x-Resolution'); - case self::Y_RESOLUTION: - return Pel::tra('y-Resolution'); - case self::PLANAR_CONFIGURATION: - return Pel::tra('Planar Configuration'); - case self::RESOLUTION_UNIT: - return Pel::tra('Resolution Unit'); - case self::TRANSFER_FUNCTION: - return Pel::tra('Transfer Function'); - case self::SOFTWARE: - return Pel::tra('Software'); - case self::DATE_TIME: - return Pel::tra('Date and Time'); - case self::ARTIST: - return Pel::tra('Artist'); - case self::WHITE_POINT: - return Pel::tra('White Point'); - case self::PRIMARY_CHROMATICITIES: - return Pel::tra('Primary Chromaticities'); - case self::TRANSFER_RANGE: - return Pel::tra('Transfer Range'); - case self::JPEG_PROC: - return Pel::tra('JPEG Process'); - case self::JPEG_INTERCHANGE_FORMAT: - return Pel::tra('JPEG Interchange Format'); - case self::JPEG_INTERCHANGE_FORMAT_LENGTH: - return Pel::tra('JPEG Interchange Format Length'); - case self::YCBCR_COEFFICIENTS: - return Pel::tra('YCbCr Coefficients'); - case self::YCBCR_SUB_SAMPLING: - return Pel::tra('YCbCr Sub-Sampling'); - case self::YCBCR_POSITIONING: - return Pel::tra('YCbCr Positioning'); - case self::REFERENCE_BLACK_WHITE: - return Pel::tra('Reference Black/White'); - case self::RELATED_IMAGE_FILE_FORMAT: - return Pel::tra('Related Image File Format'); - case self::RELATED_IMAGE_WIDTH: - return Pel::tra('Related Image Width'); - case self::RELATED_IMAGE_LENGTH: - return Pel::tra('Related Image Length'); - case self::CFA_REPEAT_PATTERN_DIM: - return Pel::tra('CFA Repeat Pattern Dim'); - case self::CFA_PATTERN: - return Pel::tra('CFA Pattern'); - case self::BATTERY_LEVEL: - return Pel::tra('Battery Level'); - case self::COPYRIGHT: - return Pel::tra('Copyright'); - case self::EXPOSURE_TIME: - return Pel::tra('Exposure Time'); - case self::FNUMBER: - return Pel::tra('FNumber'); - case self::IPTC_NAA: - return Pel::tra('IPTC/NAA'); - case self::EXIF_IFD_POINTER: - return Pel::tra('Exif IFD Pointer'); - case self::INTER_COLOR_PROFILE: - return Pel::tra('Inter Color Profile'); - case self::EXPOSURE_PROGRAM: - return Pel::tra('Exposure Program'); - case self::SPECTRAL_SENSITIVITY: - return Pel::tra('Spectral Sensitivity'); - case self::GPS_INFO_IFD_POINTER: - return Pel::tra('GPS Info IFD Pointer'); - case self::ISO_SPEED_RATINGS: - return Pel::tra('ISO Speed Ratings'); - case self::OECF: - return Pel::tra('OECF'); - case self::EXIF_VERSION: - return Pel::tra('Exif Version'); - case self::DATE_TIME_ORIGINAL: - return Pel::tra('Date and Time (original)'); - case self::DATE_TIME_DIGITIZED: - return Pel::tra('Date and Time (digitized)'); - case self::COMPONENTS_CONFIGURATION: - return Pel::tra('Components Configuration'); - case self::COMPRESSED_BITS_PER_PIXEL: - return Pel::tra('Compressed Bits per Pixel'); - case self::SHUTTER_SPEED_VALUE: - return Pel::tra('Shutter speed'); - case self::APERTURE_VALUE: - return Pel::tra('Aperture'); - case self::BRIGHTNESS_VALUE: - return Pel::tra('Brightness'); - case self::EXPOSURE_BIAS_VALUE: - return Pel::tra('Exposure Bias'); - case self::MAX_APERTURE_VALUE: - return Pel::tra('Max Aperture Value'); - case self::SUBJECT_DISTANCE: - return Pel::tra('Subject Distance'); - case self::METERING_MODE: - return Pel::tra('Metering Mode'); - case self::LIGHT_SOURCE: - return Pel::tra('Light Source'); - case self::FLASH: - return Pel::tra('Flash'); - case self::FOCAL_LENGTH: - return Pel::tra('Focal Length'); - case self::MAKER_NOTE: - return Pel::tra('Maker Note'); - case self::USER_COMMENT: - return Pel::tra('User Comment'); - case self::SUB_SEC_TIME: - return Pel::tra('SubSec Time'); - case self::SUB_SEC_TIME_ORIGINAL: - return Pel::tra('SubSec Time Original'); - case self::SUB_SEC_TIME_DIGITIZED: - return Pel::tra('SubSec Time Digitized'); - case self::XP_TITLE: - return 'Windows XP Title'; - case self::XP_COMMENT: - return 'Windows XP Comment'; - case self::XP_AUTHOR: - return 'Windows XP Author'; - case self::XP_KEYWORDS: - return 'Windows XP Keywords'; - case self::XP_SUBJECT: - return 'Windows XP Subject'; - case self::FLASH_PIX_VERSION: - return Pel::tra('FlashPix Version'); - case self::COLOR_SPACE: - return Pel::tra('Color Space'); - case self::PIXEL_X_DIMENSION: - return Pel::tra('Pixel x-Dimension'); - case self::PIXEL_Y_DIMENSION: - return Pel::tra('Pixel y-Dimension'); - case self::RELATED_SOUND_FILE: - return Pel::tra('Related Sound File'); - case self::INTEROPERABILITY_IFD_POINTER: - return Pel::tra('Interoperability IFD Pointer'); - case self::FLASH_ENERGY: - return Pel::tra('Flash Energy'); - case self::SPATIAL_FREQUENCY_RESPONSE: - return Pel::tra('Spatial Frequency Response'); - case self::FOCAL_PLANE_X_RESOLUTION: - return Pel::tra('Focal Plane x-Resolution'); - case self::FOCAL_PLANE_Y_RESOLUTION: - return Pel::tra('Focal Plane y-Resolution'); - case self::FOCAL_PLANE_RESOLUTION_UNIT: - return Pel::tra('Focal Plane Resolution Unit'); - case self::SUBJECT_LOCATION: - return Pel::tra('Subject Location'); - case self::EXPOSURE_INDEX: - return Pel::tra('Exposure index'); - case self::SENSING_METHOD: - return Pel::tra('Sensing Method'); - case self::FILE_SOURCE: - return Pel::tra('File Source'); - case self::SCENE_TYPE: - return Pel::tra('Scene Type'); - case self::SUBJECT_AREA: - return Pel::tra('Subject Area'); - case self::CUSTOM_RENDERED: - return Pel::tra('Custom Rendered'); - case self::EXPOSURE_MODE: - return Pel::tra('Exposure Mode'); - case self::WHITE_BALANCE: - return Pel::tra('White Balance'); - case self::DIGITAL_ZOOM_RATIO: - return Pel::tra('Digital Zoom Ratio'); - case self::FOCAL_LENGTH_IN_35MM_FILM: - return Pel::tra('Focal Length In 35mm Film'); - case self::SCENE_CAPTURE_TYPE: - return Pel::tra('Scene Capture Type'); - case self::GAIN_CONTROL: - return Pel::tra('Gain Control'); - case self::CONTRAST: - return Pel::tra('Contrast'); - case self::SATURATION: - return Pel::tra('Saturation'); - case self::SHARPNESS: - return Pel::tra('Sharpness'); - case self::DEVICE_SETTING_DESCRIPTION: - return Pel::tra('Device Setting Description'); - case self::SUBJECT_DISTANCE_RANGE: - return Pel::tra('Subject Distance Range'); - case self::IMAGE_UNIQUE_ID: - return Pel::tra('Image Unique ID'); - case self::GAMMA: - return Pel::tra('Gamma'); - case self::PRINT_IM: - return Pel::tra('Print IM'); - } - - case PelIfd::GPS: - switch ($tag) { - case self::GPS_VERSION_ID: - return 'GPSVersionID'; - case self::GPS_LATITUDE_REF: - return 'GPSLatitudeRef'; - case self::GPS_LATITUDE: - return 'GPSLatitude'; - case self::GPS_LONGITUDE_REF: - return 'GPSLongitudeRef'; - case self::GPS_LONGITUDE: - return 'GPSLongitude'; - case self::GPS_ALTITUDE_REF: - return 'GPSAltitudeRef'; - case self::GPS_ALTITUDE: - return 'GPSAltitude'; - case self::GPS_TIME_STAMP: - return 'GPSTimeStamp'; - case self::GPS_SATELLITES: - return 'GPSSatellites'; - case self::GPS_STATUS: - return 'GPSStatus'; - case self::GPS_MEASURE_MODE: - return 'GPSMeasureMode'; - case self::GPS_DOP: - return 'GPSDOP'; - case self::GPS_SPEED_REF: - return 'GPSSpeedRef'; - case self::GPS_SPEED: - return 'GPSSpeed'; - case self::GPS_TRACK_REF: - return 'GPSTrackRef'; - case self::GPS_TRACK: - return 'GPSTrack'; - case self::GPS_IMG_DIRECTION_REF: - return 'GPSImgDirectionRef'; - case self::GPS_IMG_DIRECTION: - return 'GPSImgDirection'; - case self::GPS_MAP_DATUM: - return 'GPSMapDatum'; - case self::GPS_DEST_LATITUDE_REF: - return 'GPSDestLatitudeRef'; - case self::GPS_DEST_LATITUDE: - return 'GPSDestLatitude'; - case self::GPS_DEST_LONGITUDE_REF: - return 'GPSDestLongitudeRef'; - case self::GPS_DEST_LONGITUDE: - return 'GPSDestLongitude'; - case self::GPS_DEST_BEARING_REF: - return 'GPSDestBearingRef'; - case self::GPS_DEST_BEARING: - return 'GPSDestBearing'; - case self::GPS_DEST_DISTANCE_REF: - return 'GPSDestDistanceRef'; - case self::GPS_DEST_DISTANCE: - return 'GPSDestDistance'; - case self::GPS_PROCESSING_METHOD: - return 'GPSProcessingMethod'; - case self::GPS_AREA_INFORMATION: - return 'GPSAreaInformation'; - case self::GPS_DATE_STAMP: - return 'GPSDateStamp'; - case self::GPS_DIFFERENTIAL: - return 'GPSDifferential'; - } - - default: - return Pel::fmt('Unknown Tag: 0x%04X', $tag); - } - } - -} -?> \ No newline at end of file diff --git a/3.1/modules/autorotate/lib/pel/PelTiff.php b/3.1/modules/autorotate/lib/pel/PelTiff.php deleted file mode 100644 index 0146c9e2..00000000 --- a/3.1/modules/autorotate/lib/pel/PelTiff.php +++ /dev/null @@ -1,296 +0,0 @@ - - * @version $Revision: 458 $ - * @date $Date: 2006-11-18 22:22:58 +0100 (Sat, 18 Nov 2006) $ - * @license http://www.gnu.org/licenses/gpl.html GNU General Public - * License (GPL) - * @package PEL - */ - -/**#@+ Required class definitions. */ -require_once('PelDataWindow.php'); -require_once('PelIfd.php'); -require_once('Pel.php'); -/**#@-*/ - - -/** - * Class for handling TIFF data. - * - * Exif data is actually an extension of the TIFF file format. TIFF - * images consist of a number of {@link PelIfd Image File Directories} - * (IFDs), each containing a number of {@link PelEntry entries}. The - * IFDs are linked to each other --- one can get hold of the first one - * with the {@link getIfd()} method. - * - * To parse a TIFF image for Exif data one would do: - * - * - * $tiff = new PelTiff($data); - * $ifd0 = $tiff->getIfd(); - * $exif = $ifd0->getSubIfd(PelIfd::EXIF); - * $ifd1 = $ifd0->getNextIfd(); - * - * - * Should one have some image data of an unknown type, then the {@link - * PelTiff::isValid()} function is handy: it will quickly test if the - * data could be valid TIFF data. The {@link PelJpeg::isValid()} - * function does the same for JPEG images. - * - * @author Martin Geisler - * @package PEL - */ -class PelTiff { - - /** - * TIFF header. - * - * This must follow after the two bytes indicating the byte order. - */ - const TIFF_HEADER = 0x002A; - - /** - * The first Image File Directory, if any. - * - * If set, then the type of the IFD must be {@link PelIfd::IFD0}. - * - * @var PelIfd - */ - private $ifd = null; - - - /** - * Construct a new object for holding TIFF data. - * - * The new object will be empty (with no {@link PelIfd}) unless an - * argument is given from which it can initialize itself. This can - * either be the filename of a TIFF image or a {@link PelDataWindow} - * object. - * - * Use {@link setIfd()} to explicitly set the IFD. - */ - function __construct($data = false) { - if ($data === false) - return; - - if (is_string($data)) { - Pel::debug('Initializing PelTiff object from %s', $data); - $this->loadFile($data); - } elseif ($data instanceof PelDataWindow) { - Pel::debug('Initializing PelTiff object from PelDataWindow.'); - $this->load($data); - } else { - throw new PelInvalidArgumentException('Bad type for $data: %s', - gettype($data)); - } - } - - - /** - * Load TIFF data. - * - * The data given will be parsed and an internal tree representation - * will be built. If the data cannot be parsed correctly, a {@link - * PelInvalidDataException} is thrown, explaining the problem. - * - * @param PelDataWindow the data from which the object will be - * constructed. This should be valid TIFF data, coming either - * directly from a TIFF image or from the Exif data in a JPEG image. - */ - function load(PelDataWindow $d) { - Pel::debug('Parsing %d bytes of TIFF data...', $d->getSize()); - - /* There must be at least 8 bytes available: 2 bytes for the byte - * order, 2 bytes for the TIFF header, and 4 bytes for the offset - * to the first IFD. */ - if ($d->getSize() < 8) - throw new PelInvalidDataException('Expected at least 8 bytes of TIFF ' . - 'data, found just %d bytes.', - $d->getSize()); - - /* Byte order */ - if ($d->strcmp(0, 'II')) { - Pel::debug('Found Intel byte order'); - $d->setByteOrder(PelConvert::LITTLE_ENDIAN); - } elseif ($d->strcmp(0, 'MM')) { - Pel::debug('Found Motorola byte order'); - $d->setByteOrder(PelConvert::BIG_ENDIAN); - } else { - throw new PelInvalidDataException('Unknown byte order found in TIFF ' . - 'data: 0x%2X%2X', - $d->getByte(0), $d->getByte(1)); - } - - /* Verify the TIFF header */ - if ($d->getShort(2) != self::TIFF_HEADER) - throw new PelInvalidDataException('Missing TIFF magic value.'); - - /* IFD 0 offset */ - $offset = $d->getLong(4); - Pel::debug('First IFD at offset %d.', $offset); - - if ($offset > 0) { - /* Parse the first IFD, this will automatically parse the - * following IFDs and any sub IFDs. */ - $this->ifd = new PelIfd(PelIfd::IFD0); - $this->ifd->load($d, $offset); - } - } - - - /** - * Load data from a file into a TIFF object. - * - * @param string the filename. This must be a readable file. - */ - function loadFile($filename) { - $this->load(new PelDataWindow(file_get_contents($filename))); - } - - - /** - * Set the first IFD. - * - * @param PelIfd the new first IFD, which must be of type {@link - * PelIfd::IFD0}. - */ - function setIfd(PelIfd $ifd) { - if ($ifd->getType() != PelIfd::IFD0) - throw new PelInvalidDataException('Invalid type of IFD: %d, expected %d.', - $ifd->getType(), PelIfd::IFD0); - - $this->ifd = $ifd; - } - - - /** - * Return the first IFD. - * - * @return PelIfd the first IFD contained in the TIFF data, if any. - * If there is no IFD null will be returned. - */ - function getIfd() { - return $this->ifd; - } - - - /** - * Turn this object into bytes. - * - * TIFF images can have {@link PelConvert::LITTLE_ENDIAN - * little-endian} or {@link PelConvert::BIG_ENDIAN big-endian} byte - * order, and so this method takes an argument specifying that. - * - * @param PelByteOrder the desired byte order of the TIFF data. - * This should be one of {@link PelConvert::LITTLE_ENDIAN} or {@link - * PelConvert::BIG_ENDIAN}. - * - * @return string the bytes representing this object. - */ - function getBytes($order = PelConvert::LITTLE_ENDIAN) { - if ($order == PelConvert::LITTLE_ENDIAN) - $bytes = 'II'; - else - $bytes = 'MM'; - - /* TIFF magic number --- fixed value. */ - $bytes .= PelConvert::shortToBytes(self::TIFF_HEADER, $order); - - if ($this->ifd != null) { - /* IFD 0 offset. We will always start IDF 0 at an offset of 8 - * bytes (2 bytes for byte order, another 2 bytes for the TIFF - * header, and 4 bytes for the IFD 0 offset make 8 bytes - * together). - */ - $bytes .= PelConvert::longToBytes(8, $order); - - /* The argument specifies the offset of this IFD. The IFD will - * use this to calculate offsets from the entries to their data, - * all those offsets are absolute offsets counted from the - * beginning of the data. */ - $bytes .= $this->ifd->getBytes(8, $order); - } else { - $bytes .= PelConvert::longToBytes(0, $order); - } - - return $bytes; - } - - - /** - * Return a string representation of this object. - * - * @return string a string describing this object. This is mostly useful - * for debugging. - */ - function __toString() { - $str = Pel::fmt("Dumping TIFF data...\n"); - if ($this->ifd != null) - $str .= $this->ifd->__toString(); - - return $str; - } - - - /** - * Check if data is valid TIFF data. - * - * This will read just enough data from the data window to determine - * if the data could be a valid TIFF data. This means that the - * check is more like a heuristic than a rigorous check. - * - * @param PelDataWindow the bytes that will be examined. - * - * @return boolean true if the data looks like valid TIFF data, - * false otherwise. - * - * @see PelJpeg::isValid() - */ - static function isValid(PelDataWindow $d) { - /* First check that we have enough data. */ - if ($d->getSize() < 8) - return false; - - /* Byte order */ - if ($d->strcmp(0, 'II')) { - $d->setByteOrder(PelConvert::LITTLE_ENDIAN); - } elseif ($d->strcmp(0, 'MM')) { - Pel::debug('Found Motorola byte order'); - $d->setByteOrder(PelConvert::BIG_ENDIAN); - } else { - return false; - } - - /* Verify the TIFF header */ - return $d->getShort(2) == self::TIFF_HEADER; - } - -} \ No newline at end of file diff --git a/3.1/modules/autorotate/module.info b/3.1/modules/autorotate/module.info deleted file mode 100644 index c4087382..00000000 --- a/3.1/modules/autorotate/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Autorotate" -description = "Rotate an image automatically on upload based on EXIF data" -version = 2 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:autorotate" -discuss_url = "http://gallery.menalto.com/forum_module_autorotate" diff --git a/3.1/modules/basket/controllers/admin_configure.php b/3.1/modules/basket/controllers/admin_configure.php deleted file mode 100644 index 7831734d..00000000 --- a/3.1/modules/basket/controllers/admin_configure.php +++ /dev/null @@ -1,163 +0,0 @@ -validate()) { - - basket::extractForm($form); - message::success(t("Basket Module Configured!")); - } - } - else - { - basket::populateForm($form); - } - - $view = new Admin_View("admin.html"); - $view->content = new View("admin_configure.html"); - - $view->content->form = $form; - - print $view; - } - - /** - * the index page of the user homes admin - */ - public function templates() - { - $form = basket::get_template_form(); - if (request::method() == "post") { - access::verify_csrf(); - - if ($form->validate()) { - - basket::extractTemplateForm($form); - message::success(t("Basket Module Configured!")); - } - } - else - { - basket::populateTemplateForm($form); - } - - $view = new Admin_View("admin.html"); - $view->content = new View("admin_templates.html"); - - $view->content->form = $form; - - print $view; - } - - public function paypal_encrypt_wizard_step1() - { - $view = new Admin_View("admin.html"); - $view->content = new View("pew1.html"); - - $view->content->form = self::keyGenerationForm(); - - print $view; - - } - - public function paypal_encrypt_wizard_step2() - { - access::verify_csrf(); - - $form = self::keyGenerationForm(); - - if (!$form->validate()) { - - self::paypal_encrypt_wizard_step1(); - return; - } - - $ssldir = str_replace('\\','/',VARPATH.'certificate'); - $ssldir= rtrim($ssldir, '/').'/'; - - if ( ! is_dir($ssldir)) - { - // Create the upload directory - mkdir($ssldir, 0777, TRUE); - } - - $prkeyfile = $ssldir . "myprvkey.pem"; - $pubcertfile = $ssldir . "mypubcert.pem"; - $certreqfile = $ssldir . "mycertreq.pem"; - - $dn = array("countryName" => $form->encrypt->countryName->value, - "stateOrProvinceName" => $form->encrypt->stateOrProvinceName->value, - "localityName" => $form->encrypt->localityName->value, - "organizationName" => $form->encrypt->organizationName->value, - "organizationalUnitName" => $form->encrypt->organizationalUnitName->value, - "commonName" => $form->encrypt->commonName->value, - "emailAddress" => $form->encrypt->emailAddress->value); - $privkeypass = $form->encrypt->privKeyPass->value; - $numberofdays = 365; - $config = array( - "private_key_bits" => 1024 - ); - - $privkey = openssl_pkey_new($config); - $csr = openssl_csr_new($dn, $privkey); - $sscert = openssl_csr_sign($csr, null, $privkey, $numberofdays); - openssl_x509_export($sscert, $publickey); - openssl_pkey_export($privkey, $privatekey, $privkeypass); - openssl_csr_export($csr, $csrStr); - - openssl_x509_export_to_file($sscert, $pubcertfile); - openssl_pkey_export_to_file ($privkey, $prkeyfile, $privkeypass); - openssl_csr_export_to_file($csr, $certreqfile); - - //echo "Your Public Certificate has been saved to " . $pubcertfile . "

      "; - //echo "Your Private Key has been saved to " . $prkeyfile . "

      "; - //echo "Your Certificate Request has been saved to " . $certreqfile . "

      "; - - //echo $privatekey; // Will hold the exported PriKey - //echo $publickey; // Will hold the exported PubKey - //echo $csrStr; // Will hold the exported Certificate - } - - private function keyGenerationForm() - { - $form = new Forge("admin/configure/paypal_encrypt_wizard_step2", "", "post", array("id" => "generateKeys", "name" =>"generateKeys")); - $group = $form->group("encrypt")->label(t("Key Generation Details")); - $group->input("countryName")->label(t("Country Name"))->id("countryName"); - $group->input("stateOrProvinceName")->label(t("State or Province Name"))->id("stateOrProvinceName"); - $group->input("localityName")->label(t("Locality Name"))->id("localityName"); - $group->input("organizationName")->label(t("Organization Name"))->id("organizationName"); - $group->input("organizationalUnitName")->label(t("Organizational Unit Name"))->id("organizationalUnitName"); - $group->input("commonName")->label(t("Common Name"))->id("commonName"); - $group->input("emailAddress")->label(t("E-Mail Address"))->id("emailAddress"); - $group->input("privKeyPass")->label(t("Private Key Pass"))->id("privkeypass"); - return $form; - } - -} diff --git a/3.1/modules/basket/controllers/admin_postage_bands.php b/3.1/modules/basket/controllers/admin_postage_bands.php deleted file mode 100644 index 914d7537..00000000 --- a/3.1/modules/basket/controllers/admin_postage_bands.php +++ /dev/null @@ -1,147 +0,0 @@ -content = new View("admin_postage_bands.html"); - $view->content->postage_bands = ORM::factory("postage_band")->order_by("name")->find_all(); - - print $view; - } - - public function add_postage_band_form() { - print postage_band::get_add_form_admin(); - } - - - public function add_postage_band() { - access::verify_csrf(); - - $form = postage_band::get_add_form_admin(); - $valid = $form->validate(); - $name = $form->add_postage->inputs["name"]->value; - $postage = ORM::factory("postage_band")->where("name","=", $name)->find(); - if ($postage->loaded()) { - $form->add_postage->inputs["name"]->add_error("in_use", 1); - $valid = false; - } - - if ($valid) { - $postage = postage_band::create( - $name, - $form->add_postage->flat_rate->value, - $form->add_postage->per_item->value - ); - - $postage->save(); - message::success(t("Created postage band %postage_name", array( - "postage_name" => html::clean($postage->name)))); - print json::reply(array("result" => "success")); - } else { - print $form; - } - } - - public function delete_postage_band_form($id) { - $postage = ORM::factory("postage_band", $id); - if (!$postage->loaded()) { - kohana::show_404(); - } - print postage_band::get_delete_form_admin($postage); - } - - public function delete_postage_band($id) { - access::verify_csrf(); - - $postage = ORM::factory("postage_band", $id); - if (!$postage->loaded()) { - kohana::show_404(); - } - - $form = postage_band::get_delete_form_admin($postage); - if($form->validate()) { - $name = $postage->name; - $postage->delete(); - } else { - print $form; - } - - $message = t("Deleted user %postage_band", array("postage_band" => html::clean($name))); - log::success("user", $message); - message::success($message); - print json::reply(array("result" => "success")); - } - - public function edit_postage_band($id) { - access::verify_csrf(); - - $postage = ORM::factory("postage_band", $id); - if (!$postage->loaded()) { - kohana::show_404(); - } - - $form = postage_band::get_edit_form_admin($postage); - $valid = $form->validate(); - if ($valid) { - $new_name = $form->edit_postage->inputs["name"]->value; - if ($new_name != $postage->name && - ORM::factory("postage_band") - ->where("name", "=", $new_name) - ->where("id","!=", $postage->id) - ->find() - ->loaded()) { - $form->edit_postage->inputs["name"]->add_error("in_use", 1); - $valid = false; - } else { - $postage->name = $new_name; - } - } - - if ($valid) { - $postage->flat_rate = $form->edit_postage->flat_rate->value; - $postage->per_item = $form->edit_postage->per_item->value; - $postage->save(); - - message::success(t("Changed postage band %postage_name", - array("postage_name" => html::clean($postage->name)))); - print json::reply(array("result" => "success")); - } else { - print $form; - } - } - - public function edit_postage_band_form($id) { - $postage = ORM::factory("postage_band", $id); - if (!$postage->loaded()) { - kohana::show_404(); - } - - $form = postage_band::get_edit_form_admin($postage); - - print $form; - } - -} \ No newline at end of file diff --git a/3.1/modules/basket/controllers/admin_product_lines.php b/3.1/modules/basket/controllers/admin_product_lines.php deleted file mode 100644 index 752f4e63..00000000 --- a/3.1/modules/basket/controllers/admin_product_lines.php +++ /dev/null @@ -1,149 +0,0 @@ -content = new View("admin_product_lines.html"); - $view->content->products = ORM::factory("product")->order_by("name")->find_all(); - - print $view; - } - - public function add_product_form() { - print product::get_add_form_admin(); - } - - - public function add_product() { - access::verify_csrf(); - - $form = product::get_add_form_admin(); - $valid = $form->validate(); - $name = $form->add_product->inputs["name"]->value; - $product = ORM::factory("product")->where("name", "=", $name)->find(); - if ($product->loaded()) { - $form->add_product->inputs["name"]->add_error("in_use", 1); - $valid = false; - } - - if ($valid) { - $product = product::create( - $name, - $form->add_product->cost->value, - $form->add_product->description->value, - $form->add_product->postage_band->value - ); - - $product->save(); - message::success(t("Created product %product_name", array( - "product_name" => html::clean($product->name)))); - print json::reply(array("result" => "success")); - } else { - print $form; - } - } - - public function delete_product_form($id) { - $product = ORM::factory("product", $id); - if (!$product->loaded()) { - kohana::show_404(); - } - print product::get_delete_form_admin($product); - } - - public function delete_product($id) { - access::verify_csrf(); - - $product = ORM::factory("product", $id); - if (!$product->loaded()) { - kohana::show_404(); - } - - $form = product::get_delete_form_admin($product); - if($form->validate()) { - $name = $product->name; - $product->delete(); - } else { - print $form; - } - - $message = t("Deleted user %product_name", array("product_name" => html::clean($name))); - log::success("user", $message); - message::success($message); - print json::reply(array("result" => "success")); - } - - public function edit_product($id) { - access::verify_csrf(); - - $product = ORM::factory("product", $id); - if (!$product->loaded()) { - kohana::show_404(); - } - - $form = product::get_edit_form_admin($product); - $valid = $form->validate(); - if ($valid) { - $new_name = $form->edit_product->inputs["name"]->value; - if ($new_name != $product->name && - ORM::factory("product") - ->where("name", "=", $new_name) - ->where("id","!=", $product->id) - ->find() - ->loaded()) { - $form->edit_product->inputs["name"]->add_error("in_use", 1); - $valid = false; - } else { - $product->name = $new_name; - } - } - - if ($valid) { - $product->cost = $form->edit_product->cost->value; - $product->description = $form->edit_product->description->value; - $product->postage_band_id = $form->edit_product->postage_band->value; - $product->save(); - - message::success(t("Changed product %product_name", - array("product_name" => html::clean($product->name)))); - print json::reply(array("result" => "success")); - } else { - print $form; - } - } - - public function edit_product_form($id) { - $product = ORM::factory("product", $id); - if (!$product->loaded()) { - kohana::show_404(); - } - - $form = product::get_edit_form_admin($product); - - print $form; - } - -} \ No newline at end of file diff --git a/3.1/modules/basket/controllers/basket.php b/3.1/modules/basket/controllers/basket.php deleted file mode 100644 index a4ecbee3..00000000 --- a/3.1/modules/basket/controllers/basket.php +++ /dev/null @@ -1,443 +0,0 @@ -query("ALTER TABLE {orders} ADD COLUMN `method` int(9) DEFAULT 0;"); - } - public function view_basket($pp="") { - - $template = new Theme_View("page.html", "basket"); - - $basket = Session_Basket::get(); - if (isset($pp)){ - if ($pp=="nopp"){ - $basket->disablepp(); - } - elseif ($pp=="ppon"){ - $basket->enablepp(); - } - } - - $view = new View("view_basket.html"); - $view->basket = $basket; - - - $template->content = $view; - - print $template; - } - - public function preview($id) { - $item = ORM::factory("item", $id); - - print ""; - - } - - public function view_orders() { - self::check_view_orders(); - $template = new Theme_View("page.html", "basket"); - - $incomplete_orders = ORM::factory("order")->where('status',"<",20)->find_all(); - - $view = new View("view_orders.html"); - - $view->orders = $incomplete_orders; - - $template->content = $view; - - print $template; - } - - - public function view_ipn($orderid){ - self::check_view_orders(); - - $template = new Theme_View("page.html", "basket"); - - $order = ORM::factory("order")->where("id","=",$orderid)->find(); - $ipn_messages = ORM::factory("ipn_message")->where("key","=",$orderid)->find_all(); - //$ipn_messages = ORM::factory("ipn_message")->find_all(); - - $view = new View("view_ipn.html"); - - $view->order = $order; - $view->ipn_messages = $ipn_messages; - - $template->content = $view; - - print $template; - - } - - public function check_view_orders() { - if (!basket::can_view_orders()){ - die("Invalid access."); - } - } - - public function print_order($id){ - - access::verify_csrf(); - self::check_view_orders(); - - - $prefix = basket::getOrderPrefix(); - $length = strlen($prefix); - if (strlen($id)>$length ){ - if ($prefix === strtolower(substr($id,0,$length ))){ - $id = substr($id,$length); - } - } - $order = ORM::factory("order", $id); - $view = new View("print_order.html"); - - if ($order->loaded()){ - $view->order = str_replace(array("\r\n", "\n", "\r"),"
      ",$order->text); - }else{ - $view->order = "Order ".$id." not found."; - } - print $view; - } - - public function show_order($id){ - - access::verify_csrf(); - self::check_view_orders(); - $prefix = basket::getOrderPrefix(); - $length = strlen($prefix); - if (strlen($id)>$length ){ - if ($prefix === strtolower(substr($id,0,$length ))){ - $id = substr($id,$length); - } - } - - $order = ORM::factory("order", $id); - - if ($order->loaded()){ - $view = new View("view_order.html"); - $view->order = $order; - print $view; - }else{ - print "Order ".$id." not found."; - } - } - - public function show_ipn($id){ - access::verify_csrf(); - self::check_view_orders(); - $ipn_message = ORM::factory("ipn_message", $id); - - if ($ipn_message->loaded()){ - print $ipn_message->text; - }else{ - print "IPN Message ".$id." not found."; - } - - } - - public function confirm_order_delivery($id){ - access::verify_csrf(); - self::check_view_orders(); - $order = ORM::factory("order", $id); - - if ($order->loaded()){ - if ($order->status == 2) - { - $order->status = 20; - $order->save(); - } - } - url::redirect("basket/view_orders"); - } - - public function confirm_order_payment($id){ - access::verify_csrf(); - self::check_view_orders(); - $order = ORM::factory("order", $id); - - if ($order->loaded()){ - if ($order->status == 1) - { - $order->status = 2; - $order->save(); - } - } - url::redirect("basket/view_orders"); - } - - private function getCheckoutForm(){ - $form = new Forge("basket/confirm", "", "post", array("id" => "checkout", "name" =>"checkout")); - $group = $form->group("contact")->label(t("Contact Details")); - $group->input("fullname")->label(t("Name"))->id("fullname"); - $group->input("house")->label(t("House Number / Name"))->id("house"); - $group->input("street")->label(t("Street"))->id("street"); - $group->input("suburb")->label(t("Suburb"))->id("suburb"); - $group->input("town")->label(t("Town or City"))->id("town"); - $group->input("postcode")->label(t("Postcode"))->id("postcode"); - $group->input("email")->label(t("E-Mail Address"))->id("email"); - $group->input("phone")->label(t("Telephone Number"))->id("phone"); - $group->hidden("paypal")->id("paypal"); - - return $form; - } - - public function checkout () { - - $template = new Theme_View("page.html", "basket"); - - $view = new View("checkout.html"); - - $basket = Session_Basket::get(); - - $form = self::getCheckoutForm(); - $form->contact->fullname->value($basket->name); - $form->contact->house->value($basket->house); - $form->contact->street->value($basket->street); - $form->contact->suburb->value($basket->suburb); - $form->contact->town->value($basket->town); - $form->contact->postcode->value($basket->postcode); - $form->contact->email->value($basket->email); - $form->contact->phone->value($basket->phone); - $view->form = $form; - - $template->content = $view; - - - print $template; - } - - public function confirm () { - access::verify_csrf(); - - $form = $this->getCheckoutForm(); - - $valid = $form->validate(); - - if ($valid){ - $basket = Session_Basket::get(); - - if (!isset($basket->contents ) || count($basket->contents) == 0) { - self::view_basket(); - return; - } - - $basket->name = $form->contact->fullname->value; - $basket->house = $form->contact->house->value; - $basket->street = $form->contact->street->value; - $basket->suburb = $form->contact->suburb->value; - $basket->town = $form->contact->town->value; - $basket->postcode = $form->contact->postcode->value; - $basket->email = $form->contact->email->value; - $basket->phone = $form->contact->phone->value; - - $paypal=$form->contact->paypal->value=="true"; - $template = new Theme_View("page.html", "basket"); - - if ($paypal){ - // create a prelimary order - $order = basket::createOrder($basket, Order_Model::PAYMENT_PAYPAL); - $paypal = new Paypal(); - - // create the order first - $view = new View("paypal_redirect.html"); - $view ->form = $paypal->process($basket, - url::site("basket/paypal_complete/$order->id", "http"), - url::site("basket/paypal_cancel/$order->id", "http"), - url::site("basket/paypal_ipn/$order->id", "http")); - $template->content = $view; - print $template; - - // redirect to paypal - }else - { - $form = new Forge("basket/complete", "", "post", array("id" => "confirm", "name" =>"confirm")); - $view = new View("confirm_order.html"); - $view->basket = $basket; - $template->content = $view; - $view->form = $form; - print $template; - } - } - else - { - die("Invalid confirmation!"); - - } - } - - function paypal_ipn($id){ - $order = ORM::factory("order")->where("id","=",$id)->find(); - if ($order->loaded()){ - - $paypal = new Paypal(); - - if ($paypal->validate_ipn($id)){ - if ($paypal->ipn_data['payment_status'] == "Completed"){ - - $order->status = Order_Model::PAYMENT_CONFIRMED; - - // send e-mails - basket::send_order($order); - basket::send_invoice($order); - - $order->save(); - } - return; - } - print "invalid access. tut tut!"; - } - return; - - } - - public function paypal_complete($id) { - $order = ORM::factory("order")->where("id","=",$id)->find(); - $basket = Session_Basket::get(); - $basket->clear(); - $this->_complete($order); - } - - public function paypal_cancel($id){ - $order = ORM::factory("order")->where("id","=",$id)->find(); - - if ($order->loaded()){ - $order->delete(); - } - - $this->checkout(); - } - - public function complete () { - access::verify_csrf(); - - $basket = Session_Basket::get(); - - if (!isset($basket->contents ) || count($basket->contents) == 0) { - self::view_basket(); - return; - } - - // create order - $order = basket::createOrder($basket, Order_Model::PAYMENT_OFFLINE); - $basket->clear(); - - // send e-mails - basket::send_order($order); - basket::send_invoice($order); - - - $this->_complete($order); - } - - private function _complete($order){ - $template = new Theme_View("page.html", "basket"); - $view = new View("order_complete.html"); - $ordernumber = basket::getOrderPrefix().$order->id; - $view->ordernumber = $ordernumber; - $view->order = $order; - $view->total_cost = $order->cost; - - $template->content = $view; - - print $template; - } - - private function getAddToBasketForm($id){ - - $form = new Forge("basket/add_to_basket", "", "post", array("id" => "gAddToBasketForm")); - $group = $form->group("add_to_basket")->label(t("Add To Basket")); - $group->hidden("id"); - $group->dropdown("product") - ->label(t("Product")) - ->options(product::getProductArray($id)); - $group->input("quantity")->label(t("Quantity"))->id("gQuantity"); - $group->submit("")->value(t("Add")); - //$group->submit("proceedToCheckout")->value(t("Proceed To Checkout")); - - return $form; - } - - public function add_to_basket(){ - - access::verify_csrf(); - - - if (!isset($_POST['id'])) - { - die("no id"); - } - $form = self::getAddToBasketForm($_POST['id']); - $valid = $form->validate(); - - if ($valid){ - $basket = Session_Basket::getOrCreate(); - $basket->add( - $form->add_to_basket->id->value, - $form->add_to_basket->product->value, - $form->add_to_basket->quantity->value); - - $item = ORM::factory("item", $form->add_to_basket->id->value); - - Session::instance()->set("redirect_home", $item->parent_id); - - print json::reply(array("result" => "success")); - } - else - { - log_error("invalid form!"); - - } - - } - - public function add_to_basket_ajax($id) { - - $view = new View("add_to_basket_ajax.html"); - - // get the item to add - $item = ORM::factory("item", $id); - if (!$item->loaded()) - { - //TODO - die("Not loaded id"); - } - - // get the basket to add to - $form = self::getAddToBasketForm($id); - $form->add_to_basket->id->value($id); - $form->add_to_basket->quantity->value(1); - - $view->form = $form; - $view->item = $item; - - print $view; - } - - public function remove_item($key) { - - $basket = Session_Basket::getOrCreate(); - $basket->remove($key); - url::redirect("basket/view_basket"); - } - -} diff --git a/3.1/modules/basket/css/basket.css b/3.1/modules/basket/css/basket.css deleted file mode 100644 index 107b8229..00000000 --- a/3.1/modules/basket/css/basket.css +++ /dev/null @@ -1,17 +0,0 @@ -#basket {float:right;} -#add_to_basket {float:right} -#basketForm {max-width:200px;float:left;} -#basketThumb {float:left; padding:10px;} -#basketThumb img{max-width:100px;} -#payment {float:right; width:50%} -#checkout input, -#checkout select, -#checkout textarea { - display: block; - clear: both; - padding: .2em; - width: 100%; -} -#sidebar-basket {max-height:300px; overflow-y:auto; overflow-x:hidden;} -.order-status-1 a{color:#AA0000 !important} -.order-status-2 a{color:#00AA00 !important} diff --git a/3.1/modules/basket/helpers/basket.php b/3.1/modules/basket/helpers/basket.php deleted file mode 100644 index b9be6726..00000000 --- a/3.1/modules/basket/helpers/basket.php +++ /dev/null @@ -1,393 +0,0 @@ - "Australian Dollars", - "CAD" => "Canadian Dollars", - "EUR" => "Euros", - "GBP" => "Pounds Sterling", - "JPY" => "Yen", - "USD" => "U.S. Dollars", - "NZD" => "New Zealand Dollar", - "CHF" => "Swiss Franc", - "HKD" => "Hong Kong Dollar", - "SGD" => "Singapore Dollar", - "SEK" => "Swedish Krona", - "DKK" => "Danish Krone", - "PLN" => "Polish Zloty", - "NOK" => "Norwegian Krone", - "HUF" => "Hungarian Forint", - "CZK" => "Czech Koruna", - "ILS" => "Israeli Shekel", - "MXN" => "Mexican Peso"); - - static $format= array( - "AUD" => "$", - "CAD" => "$", - "EUR" => "€", - "GBP" => "£", - "JPY" => "¥", - "USD" => "$", - "NZD" => "$", - "CHF" => "", - "HKD" => "$", - "SGD" => "$", - "SEK" => "", - "DKK" => "", - "PLN" => "", - "NOK" => "", - "HUF" => "", - "CZK" => "", - "ILS" => "", - "MXN" => ""); - - static $formatweb= array( - "AUD" => "$", - "CAD" => "$", - "EUR" => "€", - "GBP" => "£", - "JPY" => "¥", - "USD" => "$", - "NZD" => "$", - "CHF" => "", - "HKD" => "$", - "SGD" => "$", - "SEK" => "", - "DKK" => "", - "PLN" => "", - "NOK" => "", - "HUF" => "", - "CZK" => "", - "ILS" => "", - "MXN" => ""); - - - static public function can_view_orders() - { - if (identity::active_user()->admin){ - return true; - } - - print identity::active_user(); - foreach (identity::active_user()->groups() as $group){ - if ($group->name == 'shop'){ - return true; - } - } - - return false; - } - - - static function get_configure_form() { - $form = new Forge("admin/configure", "", "post", array("id" => "g-configure-form")); - $group = $form->group("configure")->label(t("Configure Basket")); - $group->input("email")->label(t("Offline Paying Email Address"))->id("g-order-email-address"); - $group->dropdown("currency") - ->label(t("Currency")) - ->options(self::$currencies); - - $group->checkbox("side_bar")->label(t("Use only side bar"))->id("g-side-bar-only"); - - $group->checkbox("paypal")->label(t("Use Paypal"))->id("g-paypal"); - $group->input("paypal_account")->label(t("Paypal E-Mail Address"))->id("g-paypal-address"); - $group->checkbox("allow_pickup")->label(t("Allow Product Pickup"))->id("g-allow-pickup"); - $group->input("order_prefix")->label(t("Order Number Prefix"))->id("g-order-prefix"); - $group->submit("")->value(t("Save")); - return $form; - } - - static function get_template_form() { - $form = new Forge("admin/configure/templates", "", "post", array("id" => "g-configure-form")); - $group = $form->group("configure")->label(t("Configure Basket")); - $group->textarea("payment_details")->label(t("Payment Details Description"))->id("g-payment-details"); - $group->textarea("order_complete_page")->label(t("Order Complete Page"))->id("g-order-complete_page"); - $group->input("order_complete_email_subject")->label(t("Order Complete Email Subject"))->id("g-order-complete_email_subject"); - $group->textarea("order_complete_email")->label(t("Order Complete Email"))->id("g-order-complete_email"); - $group->submit("")->value(t("Save")); - return $form; - } - - static function populateForm($form){ - $form->configure->email->value(basket::getEmailAddress()); - $form->configure->side_bar->checked(basket::is_side_bar_only()); - $form->configure->paypal->checked(basket::isPaypal()); - $form->configure->paypal_account->value(basket::getPaypalAccount()); - $form->configure->currency->selected(basket::getCurrency()); - $form->configure->allow_pickup->checked(basket::isAllowPickup()); - $form->configure->order_prefix->value(basket::getOrderPrefix()); - } - - static function populateTemplateForm($form){ - $form->configure->payment_details->value(basket::getPaymentDetails()); - $form->configure->order_complete_page->value(basket::getOrderCompletePage()); - $form->configure->order_complete_email_subject->value(basket::getOrderCompleteEmailSubject()); - $form->configure->order_complete_email->value(basket::getOrderCompleteEmail()); - } - - static function extractForm($form){ - $email = $form->configure->email->value; - $is_side_bar = $form->configure->side_bar->value; - $isPaypal = $form->configure->paypal->value; - $paypal_account = $form->configure->paypal_account->value; - $currency = $form->configure->currency->selected; - $allow_pickup = $form->configure->allow_pickup->value; - $order_prefix = $form->configure->order_prefix->value; - basket::setEmailAddress($email); - basket::set_side_bar_only($is_side_bar); - basket::setPaypal($isPaypal); - basket::setPaypalAccount($paypal_account); - basket::setCurrency($currency); - basket::setAllowPickup($allow_pickup); - basket::setOrderPrefix($order_prefix); - } - static function extractTemplateForm($form){ - $payment_details = $form->configure->payment_details->value; - $order_complete_page = $form->configure->order_complete_page->value; - $order_complete_email_subject = $form->configure->order_complete_email_subject->value; - $order_complete_email = $form->configure->order_complete_email->value; - basket::setPaymentDetails($payment_details); - basket::setOrderCompletePage($order_complete_page); - basket::setOrderCompleteEmailSubject($order_complete_email_subject); - basket::setOrderCompleteEmail($order_complete_email); - } - - static public function is_side_bar_only() - { - return module::get_var("basket","is_side_bar_only"); - - } - - static public function set_side_bar_only($value) - { - module::set_var("basket","is_side_bar_only",$value); - - } - - - static function getEmailAddress(){ - return module::get_var("basket","email"); - } - - static function isPaypal(){ - return module::get_var("basket","paypal"); - } - - static function getPaypalAccount(){ - return module::get_var("basket","paypal_account"); - } - - static function getCurrency(){ - $cur = module::get_var("basket","currency"); - if (!isset($cur)) - { - $cur = "USD"; - } - return $cur; - } - - static function getPaymentDetails(){ - return module::get_var("basket","payment_details"); - } - - static function getOrderPrefix(){ - return module::get_var("basket","order_prefix"); - } - - static function isAllowPickup(){ - return module::get_var("basket","allow_pickup"); - } - - static function getOrderCompletePage(){ - return module::get_var("basket","order_complete_page"); - } - - static function getOrderCompleteEmail(){ - return module::get_var("basket","order_complete_email"); - } - - static function getOrderCompleteEmailSubject(){ - return module::get_var("basket","order_complete_email_subject"); - } - - static function formatMoney($money){ - return self::$format[self::getCurrency()].number_format($money,2); - } - - static function formatMoneyForWeb($money){ - return self::$formatweb[self::getCurrency()].number_format($money,2); - } - - static function replaceStrings($string, $key_values) { - // Replace x_y before replacing x. - krsort($key_values, SORT_STRING); - - $keys = array(); - $values = array(); - foreach ($key_values as $key => $value) { - $keys[] = "%$key"; - $values[] = $value; - } - return str_replace($keys, $values, $string); - } - - static function setEmailAddress($email){ - module::set_var("basket","email",$email); - } - - static function setPaypal($paypal){ - module::set_var("basket","paypal",$paypal); - } - - static function setPaypalAccount($paypal_account){ - module::set_var("basket","paypal_account",$paypal_account); - } - - static function setCurrency($currency){ - module::set_var("basket","currency",$currency); - } - - static function setPaymentDetails($details){ - module::set_var("basket","payment_details",$details); - } - - static function setAllowPickup($allow_pickup){ - module::set_var("basket","allow_pickup",$allow_pickup); - } - - static function setOrderPrefix($order_prefix){ - module::set_var("basket","order_prefix",strtolower($order_prefix)); - } - - static function setOrderCompletePage($details){ - module::set_var("basket","order_complete_page",$details); - } - - static function setOrderCompleteEmail($details){ - module::set_var("basket","order_complete_email",$details); - } - - static function setOrderCompleteEmailSubject($details){ - module::set_var("basket","order_complete_email_subject",$details); - } - - static function createOrder($basket, $method){ - - $order = ORM::factory("order"); - $order->text = "processing"; - $order->save(); - - $ordernumber = basket::getOrderPrefix().$order->id; - - //$admin_address = basket::getEmailAddress(); - $postage = $basket->postage_cost(); - $product_cost = $basket->cost(); - $ppon = $basket->ispp(); - - $text = " - Order Number : ".$ordernumber." - - for : -".$basket->name." -".$basket->house." -".$basket->street." -".$basket->suburb." -".$basket->town." -".$basket->postcode." -".$basket->email." -".$basket->phone." -Placed at ".date("d F Y - H:i" ,time())." -Cost of Ordered Products = ".$product_cost; - if ($ppon){ - $text = $text." -Postage and Packaging Costs + ".$postage." -Total Owed ".($product_cost+$postage)." Total in ".basket::getCurrency(); - } - else{ - $text = $text." -Person has chosen to pick up product. -Total Owed ".($product_cost)." Total in ".basket::getCurrency(); - } - $text = $text." - -Items Ordered: - -"; - - // create the order items - foreach ($basket->contents as $basket_item){ - $item = $basket_item->getItem(); - $prod = ORM::factory("product", $basket_item->product); - $text = $text." -".$item->title." - ".$item->url()." -".$prod->name." - ".$prod->description." -".$basket_item->quantity." @ ".$prod->cost." - -"; - } - - if ($ppon){ - $total_cost = ($product_cost+$postage); - } - else{ - $total_cost = $product_cost; - } - - $order->name = $basket->name; - $order->email = $basket->email; - $order->cost = $total_cost; - $order->text = $text; - $order->status = Order_Model::WAITING_PAYMENT; - $order->method = $method; - $order->save(); - - //$basket->clear(); - - return $order; - } - - public function send_order($order){ - - $from = "From: ".basket::getEmailAddress(); - $ordernumber = basket::getOrderPrefix().$order->id; - - mail(basket::getEmailAddress(), "Order ".$ordernumber." from ".$order->name, $order->text, $from); - - } - - public function send_invoice($order) - { - - $from = "From: ".basket::getEmailAddress(); - $ordernumber = basket::getOrderPrefix().$order->id; - $invoice_email = basket::replaceStrings(basket::getOrderCompleteEmail(),Array( - "name"=>$order->name, - "order_number"=> $ordernumber, - "total_cost" =>basket::formatMoney($order->cost), - "order_details"=>$order->text)); - - mail($order->email, - basket::replaceStrings(basket::getOrderCompleteEmailSubject(),Array("order_number"=>$ordernumber)), - $invoice_email, $from); - - } - -} \ No newline at end of file diff --git a/3.1/modules/basket/helpers/basket_block.php b/3.1/modules/basket/helpers/basket_block.php deleted file mode 100644 index 9263a68e..00000000 --- a/3.1/modules/basket/helpers/basket_block.php +++ /dev/null @@ -1,21 +0,0 @@ - t("Basket")); - } - - static function get($block_id, $theme) { - $block = ""; - switch ($block_id) { - case "shopping": - $block = new Block(); - $block->css_id = "g-view-basket"; - $block->title = t("Basket"); - $block->content = new View("basket-side-bar.html"); - $block->content->basket = Session_Basket::get(); - break; - } - return $block; - } -} \ No newline at end of file diff --git a/3.1/modules/basket/helpers/basket_event.php b/3.1/modules/basket/helpers/basket_event.php deleted file mode 100644 index c22a48c6..00000000 --- a/3.1/modules/basket/helpers/basket_event.php +++ /dev/null @@ -1,123 +0,0 @@ -add_after("users_groups", - $basket_menu = Menu::factory("submenu") - ->id("basket_menu") - ->label(t("Basket"))); - $basket_menu->append( - Menu::factory("link") - ->id("configure") - ->label(t("Configure")) - ->url(url::site("admin/configure"))); - $basket_menu->append( - Menu::factory("link") - ->id("templates") - ->label(t("Templates")) - ->url(url::site("admin/configure/templates"))); - $basket_menu->append( - Menu::factory("link") - ->id("product_line") - ->label(t("Product Lines")) - ->url(url::site("admin/product_lines"))); - $basket_menu->append( - Menu::factory("link") - ->id("postage_bands") - ->label(t("Postage Bands")) - ->url(url::site("admin/postage_bands"))); - $basket_menu->append( - Menu::factory("link") - ->id("view_orders") - ->label(t("View Orders")) - ->url(url::site("basket/view_orders"))); - - } - - static function item_edit_form($item, $form){ - $group = $form->group("products")->label(t("Available Products")); - - $product_override = ORM::factory("product_override")->where('item_id', "=", $item->id)->find(); - $group->checkbox("all")->label("No products except.."); - if ($product_override->loaded()){ - $group->all->checked($product_override->none); - } - - $products = ORM::factory("product")->find_all(); - foreach ($products as $product){ - $p_group = $group->group("product_$product->id")->label(t("$product->description")); - - $description = $product->description; - $cost = $product->cost; - $checked = false; - - if ($product_override->loaded()){ - $item_product = ORM::factory("item_product") - ->where('product_override_id', "=", $product_override->id) - ->where('product_id', "=", $product->id)->find(); - if ($item_product->loaded()){ - $checked = $item_product->include; - if ($item_product->cost != -1){ - $cost = $item_product->cost; - } - } - } - - $p_group->checkbox("exclude_$product->id")->label($description)->checked($checked); - $p_group->input("cost_$product->id")->label("Cost")->value($cost); - //$producta[$product->id] = $product->description." (".basket::formatMoney($product->cost).")"; - } - } - - static function item_edit_form_completed($item, $form){ - $product_override = ORM::factory("product_override")->where('item_id', "=", $item->id)->find(); - - if ($form->products->all->checked) - { - $product_override->none = $form->products->all->checked; - $product_override->item_id=$item->id; - $product_override->save(); - $products = ORM::factory("product")->find_all(); - foreach ($products as $product){ - $p_group = $form->products->__get("product_$product->id"); - $item_product = ORM::factory("item_product") - ->where('product_override_id', "=", $product_override->id) - ->where('product_id', "=", $product->id)->find(); - - $item_product->include = $p_group->__get("exclude_$product->id")->checked; - $item_product->cost = $p_group->__get("cost_$product->id")->value; - $item_product->product_id = $product->id; - $item_product->product_override_id = $product_override->id; - $item_product->save(); - } - } - else - { - if ($product_override->loaded()){ - $product_override->delete(); - } - } - } -} \ No newline at end of file diff --git a/3.1/modules/basket/helpers/basket_installer.php b/3.1/modules/basket/helpers/basket_installer.php deleted file mode 100644 index 0ed7f9aa..00000000 --- a/3.1/modules/basket/helpers/basket_installer.php +++ /dev/null @@ -1,224 +0,0 @@ -query("CREATE TABLE IF NOT EXISTS {products} ( - `id` int(9) NOT NULL auto_increment, - `name` TEXT NOT NULL, - `cost` DECIMAL(10,2) default 0, - `description` varchar(1024), - `postage_band_id` int(9) default 1, - PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - - $db->query("CREATE TABLE IF NOT EXISTS {product_overrides} ( - `id` int(9) NOT NULL auto_increment, - `item_id` int(9) NOT NULL, - `none` BOOLEAN default false, - PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - - $db->query("CREATE TABLE IF NOT EXISTS {item_products} ( - `id` int(9) NOT NULL auto_increment, - `product_override_id` int(9) NOT NULL, - `product_id` int(9) NOT NULL, - `include` BOOLEAN default false, - `cost` DECIMAL(10,2) default -1, - PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - - $db->query("CREATE TABLE IF NOT EXISTS {postage_bands} ( - `id` int(9) NOT NULL auto_increment, - `name` TEXT NOT NULL, - `flat_rate` DECIMAL(10,2) default 0, - `per_item` DECIMAL(10,2) default 0, - PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - - $db->query("CREATE TABLE IF NOT EXISTS {orders} ( - `id` int(9) NOT NULL auto_increment, - `status` int(9) DEFAULT 0, - `name` varchar(1024), - `email` varchar(1024), - `cost` DECIMAL(10,2) default 0, - `method` int(9) DEFAULT 0, - `text` TEXT NOT NULL, - PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - - $db->query("CREATE TABLE IF NOT EXISTS `ipn_messages` ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `date` int(11) NOT NULL, - `key` varchar(20) NOT NULL, - `txn_id` varchar(20) NOT NULL, - `status` varchar(20) NOT NULL, - `success` bool default false, - `text` text, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - - - postage_band::create("No Postage",0,0); - - product::create("4x6",5,"4\"x6\" print",1); - product::create("8x10",25,"8\"x10\" print",1); - product::create("8x12",30,"8\"x12\" print",1); - - basket::setPaymentDetails( -"

      Use the following options to pay for this order.

      -

      Send a chequre to..

      -

      Visit the shop..

      -

      By using internet banking..

      " - ); - basket::setOrderPrefix("ORDER"); - basket::setOrderCompletePage( -"

      Your order number is %order_number. To pay for this order please either:

      -

      - Send a cheque for %total_cost to with reference %order_number..

      -

      - Visit the shop and quote the order %order_number..

      -

      - Transfer %total_cost using internet banking with reference %order_number..

      -

      Order will be processed as soon as payment is received. You should receive an e-mail with your order details shortly.

      " - ); - basket::setOrderCompleteEmail( -"Hi %name, - -Thank you for your order the order details are below. To pay for this order please either: - -- Send a cheque for %total_cost to with reference %order_number.. -- Visit the shop and quote the order %order_number.. -- Transfer %total_cost using internet banking with reference %order_number.. - -Order will be processed as soon as payment is received. For order pick-ups please visit.. - -Order Details -------------- -%order_details - -Thanks"); - basket::setOrderCompleteEmailSubject( -"Photography Order %order_number"); - - module::set_version("basket", 5); - - } - - static function upgrade($version) { - $db = Database::instance(); - if ($version == 1) { - - // fix for allowing decimel place in money - $db->query("ALTER TABLE {products} CHANGE COLUMN `cost` `cost` DECIMAL(10,2) default 0;"); - $db->query("ALTER TABLE {item_products} CHANGE COLUMN `cost` `cost` DECIMAL(10,2) default -1;"); - - // postage bands - $db->query("ALTER TABLE {products} ADD COLUMN `postage_band_id` int(9) default 1"); - $db->query("CREATE TABLE IF NOT EXISTS {postage_bands} ( - `id` int(9) NOT NULL auto_increment, - `name` TEXT NOT NULL, - `flat_rate` DECIMAL(10,2) default 0, - `per_item` DECIMAL(10,2) default 0, - PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - postage_band::create("No Postage",0,0); - - module::set_version("basket", $version = 2); - } - - if ($version == 2) { - $db->query("CREATE TABLE IF NOT EXISTS {orders} ( - `id` int(9) NOT NULL auto_increment, - `text` TEXT NOT NULL, - PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - basket::setPaymentDetails( -"

      Use the following options to pay for this order.

      -

      Send a chequre to..

      -

      Visit the shop..

      -

      By using internet banking..

      " - ); - basket::setOrderPrefix("ORDER"); - basket::setOrderCompletePage( -"

      Your order number is %order_number. To pay for this order please either:

      -

      - Send a cheque for %total_cost to with reference %order_number..

      -

      - Visit the shop and quote the order %order_number..

      -

      - Transfer %total_cost using internet banking with reference %order_number..

      -

      Order will be processed as soon as payment is received. You should receive an e-mail with your order details shortly.

      " - ); - basket::setOrderCompleteEmail( -"Hi %name, - -Thank you for your order the order details are below. To pay for this order please either: - -- Send a cheque for %total_cost to with reference %order_number.. -- Visit the shop and quote the order %order_number.. -- Transfer %total_cost using internet banking with reference %order_number.. - -Order will be processed as soon as payment is received. For order pick-ups please visit.. - -Order Details -------------- -%order_details - -Thanks"); - basket::setOrderCompleteEmailSubject( -"Photography Order %order_number"); - - module::set_version("basket", $version = 3); - } - - if ($version ==3 ){ - $db->query("ALTER TABLE {orders} ADD COLUMN `status` int(9) DEFAULT 0;"); - - $db->query("CREATE TABLE IF NOT EXISTS {ipn_messages} ( - `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, - `date` int(11) NOT NULL, - `key` varchar(20) NOT NULL, - `txn_id` varchar(20) NOT NULL, - `status` varchar(20) NOT NULL, - `success` bool default false, - `text` text, - PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - module::set_version("basket", $version = 4); - - } - - if ($version==4){ - $db->query("ALTER TABLE {orders} ADD COLUMN `name` varchar(1024);"); - $db->query("ALTER TABLE {orders} ADD COLUMN `email` varchar(1024);"); - $db->query("ALTER TABLE {orders} ADD COLUMN `method` int(9) DEFAULT 0;"); - $db->query("ALTER TABLE {orders} ADD COLUMN `cost` DECIMAL(10,2) default 0"); - module::set_version("basket", $version = 5); - } - } - - static function uninstall(){ - $db = Database::instance(); - $db->query("DROP TABLE IF EXISTS {products}"); - $db->query("DROP TABLE IF EXISTS {product_overrides}"); - $db->query("DROP TABLE IF EXISTS {item_products}"); - $db->query("DROP TABLE IF EXISTS {postage_bands}"); - $db->query("DROP TABLE IF EXISTS {orders}"); - } -} diff --git a/3.1/modules/basket/helpers/basket_theme.php b/3.1/modules/basket/helpers/basket_theme.php deleted file mode 100644 index 9900a59f..00000000 --- a/3.1/modules/basket/helpers/basket_theme.php +++ /dev/null @@ -1,56 +0,0 @@ -css("basket.css"); - } - - static function header_top($theme) { - - if (!basket::is_side_bar_only()) - { - $view = new View("basket.html"); - - $view->basket = Session_Basket::get(); - return $view->render(); - } - return ""; - } - - static function admin_head($theme) { - if (strpos(Router::$current_uri, "admin/product_lines") !== false) { - return $theme->script("gallery.panel.js"); - } - } - static function photo_top($theme){ - if (!basket::is_side_bar_only()) - { - if ( product::isForSale($theme->item()->id)){ - $view = new View("add_to_basket.html"); - - $view->item = $theme->item(); - - return $view->render(); - } - } - return ""; - } -} diff --git a/3.1/modules/basket/helpers/postage_band.php b/3.1/modules/basket/helpers/postage_band.php deleted file mode 100644 index ca679d53..00000000 --- a/3.1/modules/basket/helpers/postage_band.php +++ /dev/null @@ -1,97 +0,0 @@ - "gAddPostageForm")); - $group = $form->group("add_postage")->label(t("Add Postage Band")); - $group->input("name")->label(t("Name"))->id("gPostageName") - ->error_messages("in_use", t("There is already a postage band with that name")); - $group->input("flat_rate")->label(t("Flat Rate"))->id("gFlatRate"); - $group->input("per_item")->label(t("Per Item"))->id("gPetItem"); - $group->submit("")->value(t("Add Postage Band")); - $postage = ORM::factory("postage_band"); - return $form; - } - - static function get_edit_form_admin($postage) { - $form = new Forge("admin/postage_bands/edit_postage_band/$postage->id", "", "post", - array("id" => "gEditPostageForm")); - $group = $form->group("edit_postage")->label(t("Edit Postage Band")); - $group->input("name")->label(t("Name"))->id("gPostageName")->value($postage->name); - $group->inputs["name"]->error_messages( - "in_use", t("There is already a postage band with that name")); - $group->input("flat_rate")->label(t("Flat Rate"))->id("gFlatRate")->value($postage->flat_rate); - $group->input("per_item")->label(t("Per Item"))->id("gPetItem")-> - value($postage->per_item); - - $group->submit("")->value(t("Modify Postage Band")); - return $form; - } - - - static function get_delete_form_admin($postage) { - $form = new Forge("admin/postage_bands/delete_postage_band/$postage->id", "", "post", - array("id" => "gDeletePostageForm")); - $group = $form->group("delete_postage")->label( - t("Are you sure you want to delete postage band %name?", array("name" => $postage->name))); - $group->submit("")->value(t("Delete postage band %name", array("name" => $postage->name))); - return $form; - } - - /** - * Create a new postage band - * - * @param string $name - * @param string $full_name - * @param string $password - * @return User_Model - */ - static function create($name, $flatrate, $peritemcost) { - $postage = ORM::factory("postage_band")->where("name", "=", $name)->find(); - if ($postage->loaded()) { - throw new Exception("@todo postage already EXISTS $name"); - } - - $postage->name = $name; - $postage->flat_rate = $flatrate; - $postage->per_item = $peritemcost; - - $postage->save(); - return $postage; - } - - /** - * returns the array of postage bands - * @return an array of postage bands - */ - static function getPostageArray(){ - $postagea = array(); - - $postages = ORM::factory("postage_band")->find_all(); - foreach ($postages as $postage){ - $show = true; - $postagea[$postage->id] = $postage->name; - } - - return $postagea; - } - -} \ No newline at end of file diff --git a/3.1/modules/basket/helpers/product.php b/3.1/modules/basket/helpers/product.php deleted file mode 100644 index a4a13c8c..00000000 --- a/3.1/modules/basket/helpers/product.php +++ /dev/null @@ -1,189 +0,0 @@ - "gAddProductForm")); - $group = $form->group("add_product")->label(t("Add Product")); - $group->input("name")->label(t("Name"))->id("gProductName") - ->error_messages("in_use", t("There is already a product with that name")); - $group->input("cost")->label(t("Cost"))->id("gCost"); - $group->input("description")->label(t("Description"))->id("gDescription"); - $group->dropdown("postage_band") - ->label(t("Postage Band")) - ->options(postage_band::getPostageArray()); - $group->submit("")->value(t("Add Product")); - $product = ORM::factory("product"); - return $form; - } - - static function get_edit_form_admin($product) { - - $form = new Forge("admin/product_lines/edit_product/$product->id", "", "post", - array("id" => "gEditProductForm")); - $group = $form->group("edit_product")->label(t("Edit Product")); - $group->input("name")->label(t("Name"))->id("gProductName")->value($product->name); - $group->inputs["name"]->error_messages( - "in_use", t("There is already a product with that name")); - $group->input("cost")->label(t("Cost"))->id("gCost")->value($product->cost); - $group->input("description")->label(t("Description"))->id("gDescription")-> - value($product->description); - $group->dropdown("postage_band") - ->label(t("Postage Band")) - ->options(postage_band::getPostageArray()) - ->selected($product->postage_band_id); - - $group->submit("")->value(t("Modify Product")); - return $form; - } - - - static function get_delete_form_admin($product) { - $form = new Forge("admin/product_lines/delete_product/$product->id", "", "post", - array("id" => "gDeleteProductForm")); - $group = $form->group("delete_product")->label( - t("Are you sure you want to delete product %name?", array("name" => $product->name))); - $group->submit("")->value(t("Delete product %name", array("name" => $product->name))); - return $form; - } - - /** - * Create a new product - * - * @param string $name - * @param string $full_name - * @param string $password - * @return User_Model - */ - static function create($name, $cost, $description, $postage_band) { - $product = ORM::factory("product")->where("name", "=", $name)->find(); - if ($product->loaded()) { - throw new Exception("@todo USER_ALREADY_EXISTS $name"); - } - - $product->name = $name; - $product->cost = $cost; - $product->description = $description; - $product->postage_band_id = $postage_band; - $product->save(); - return $product; - } - - static function getProductArray($id){ - $producta = array(); - // check for product override - $product_override = ORM::factory("product_override")->where('item_id', "=", $id)->find(); - - if (!$product_override->loaded()){ - // no override found so check parents - // check parents for product override - $item = ORM::factory("item",$id); - - $parents = $item->parents(); - foreach ($parents as $parent){ - // check for product override - $temp_override = ORM::factory("product_override")->where('item_id', "=", $parent->id)->find(); - if ($temp_override ->loaded()){ - $product_override = $temp_override; - //break; - } - } - } - - $products = ORM::factory("product")->find_all(); - foreach ($products as $product){ - $show = true; - $cost = $product->cost; - if ($product_override->loaded()){ - $show = !$product_override->none; - $item_product = ORM::factory("item_product") - ->where('product_override_id', "=", $product_override->id) - ->where('product_id', "=", $product->id)->find(); - - if ($item_product->loaded()){ - $cost = $item_product->cost; - if (!$show){ - $show = $item_product->include; - } - } - } - - if ($show) - { - $producta[$product->id] = html::clean($product->description)." (".basket::formatMoneyForWeb($cost).")"; - } - } - - return $producta; - } - - static function isForSale($id){ - - try - { - // check for product override - $product_override = ORM::factory("product_override")->where('item_id', "=", $id)->find(); - - if (!$product_override->loaded()){ - // no override found so check parents - // check parents for product override - $item = ORM::factory("item",$id); - - $parents = $item->parents(); - foreach ($parents as $parent){ - // check for product override - $temp_override = ORM::factory("product_override")->where('item_id', "=", $parent->id)->find(); - if ($temp_override ->loaded()){ - $product_override = $temp_override; - //break; - } - } - } - - $products = ORM::factory("product")->find_all(); - - if ($product_override->loaded() && $product_override->none){ - - foreach ($products as $product){ - - $item_product = ORM::factory("item_product") - ->where('product_override_id', "=", $product_override->id) - ->where('product_id', "=", $product->id)->find(); - - if ($item_product->loaded()){ - - if ($item_product->include){ - return true; - } - } - } - - return false; - - } else { - return count($products) > 0; - } - } - catch (Exception $e) - { - echo $e; - } - } -} \ No newline at end of file diff --git a/3.1/modules/basket/images/basket.png b/3.1/modules/basket/images/basket.png deleted file mode 100644 index 168bef64..00000000 Binary files a/3.1/modules/basket/images/basket.png and /dev/null differ diff --git a/3.1/modules/basket/libraries/Paypal.php b/3.1/modules/basket/libraries/Paypal.php deleted file mode 100644 index c18ee058..00000000 --- a/3.1/modules/basket/libraries/Paypal.php +++ /dev/null @@ -1,330 +0,0 @@ -add_field('business', 'somebody@domain.com'); - * $p->add_field('first_name', $_POST['first_name']); - * ... (add all your fields in the same manor) - * $p->submit_paypal_post(); - * - * To process an IPN, have your IPN processing file contain: - * - * $p = new paypal_class; - * if ($p->validate_ipn()) { - * ... (IPN is verified. Details are in the ipn_data() array) - * } - * - * - * In case you are new to paypal, here is some information to help you: - * - * 1. Download and read the Merchant User Manual and Integration Guide from - * http://www.paypal.com/en_US/pdf/integration_guide.pdf. This gives - * you all the information you need including the fields you can pass to - * paypal (using add_field() with this class) aswell as all the fields - * that are returned in an IPN post (stored in the ipn_data() array in - * this class). It also diagrams the entire transaction process. - * - * 2. Create a "sandbox" account for a buyer and a seller. This is just - * a test account(s) that allow you to test your site from both the - * seller and buyer perspective. The instructions for this is available - * at https://developer.paypal.com/ as well as a great forum where you - * can ask all your paypal integration questions. Make sure you follow - * all the directions in setting up a sandbox test environment, including - * the addition of fake bank accounts and credit cards. - * - ******************************************************************************* - */ - -class Paypal_Core { - - var $last_error; // holds the last error encountered - - var $ipn_response; // holds the IPN response from paypal - public $ipn_data = array(); // array contains the POST values for IPN - - var $fields = array(); // array holds the fields to submit to paypal - - - public function __construct() - { - // initialization constructor. Called when class is created. - - // sandbox paypal - - //$this->paypal_url = "https://www.sandbox.paypal.com/cgi-bin/webscr"; - //$this->secure_url = "ssl://www.sandbox.paypal.com"; - - // normal paypal - $this->paypal_url = "https://www.paypal.com/cgi-bin/webscr"; - $this->secure_url = "ssl://www.paypal.com"; - - $this->last_error = ''; - - //$this->ipn_log_file = Kohana::log_directory().Kohana::config('paypal.ipn_logfile'); - //$this->ipn_log = true; - $this->ipn_response = ''; - - // populate $fields array with a few default values. See the paypal - // documentation for a list of fields and their data types. These defaul - // values can be overwritten by the calling script. - - - } - - function add_field($field, $value) { - - // adds a key=>value pair to the fields array, which is what will be - // sent to paypal as POST variables. If the value is already in the - // array, it will be overwritten. - - $this->fields["$field"] = $value; - } - - public function process($session_basket, $return_url, $cancel_url, $notify_url){ - - $this->add_field('rm','2'); - $this->add_field('cmd','_cart'); - $this->add_field('upload','1'); - - $this->add_field('currency_code', basket::getCurrency()); - $this->add_field('business', basket::getPaypalAccount()); - - // IPN stuff - $this->add_field('return', $return_url); - $this->add_field('cancel_return', $cancel_url); - $this->add_field('notify_url', $notify_url); - - // postage - if ($session_basket->ispp()){ - $postage = $session_basket->postage_cost(); - if ($postage > 0) { - $this->add_field('shipping_1',$postage); - } - } - - // basket contents - $id = 1; - foreach ($session_basket->contents as $key => $basket_item){ - $this->add_field("item_name_$id", $basket_item->getCode()); - $this->add_field("amount_$id", $basket_item->cost_per); - $this->add_field("quantity_$id",$basket_item->quantity); - $id++; - } - - // shipping address - $this->add_field("payer_email", $session_basket->email); - $this->add_field("address_name", $session_basket->name); - $this->add_field("address_street", $session_basket->house." ".$session_basket->street); - $this->add_field("address_city", $session_basket->town); - $this->add_field("address_zip", $session_basket->postcode); - $this->add_field("contact_phone", $session_basket->phone); - - $string = "
      paypal_url."\">\n"; - - foreach ($this->fields as $name => $value) { - $string = $string."\n"; - } - - $string = $string."
      "; - return $string; - } - - function validate_ipn($key) { - - // parse the paypal URL - $url_parsed=parse_url($this->paypal_url); - - // generate the post string from the _POST vars aswell as load the - // _POST vars into an arry so we can play with them from the calling - // script. - $post_string = 'cmd=_notify-validate'; - foreach ($_POST as $field=>$value) { - $this->ipn_data["$field"] = $value; - $value = urlencode(stripslashes($value)); - $value = preg_replace('/(.*[^%^0^D])(%0A)(.*)/i','${1}%0D%0A${3}',$value); - $post_string .= '&'.$field.'='.$value; - } - - // open the connection to paypal - - $fp = fsockopen($this->secure_url,443,$err_num,$err_str,30); - if(!$fp) { - - // could not open the connection. If loggin is on, the error message - // will be in the log. - $this->last_error = "fsockopen error no. $errnum: $errstr"; - $this->log_ipn_results($key,false); - return false; - - } else { - - // Post the data back to paypal - fputs($fp, "POST ".$url_parsed['path']." HTTP/1.1\r\n"); - fputs($fp, "Host: ".$url_parsed['host']."\r\n"); - fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); - - fputs($fp, "Content-length: ".strlen($post_string)."\r\n\r\n"); - //fputs($fp, "Connection: close\r\n\r\n"); - fputs($fp, $post_string . "\r\n\r\n"); - - // loop through the response from the server and append to variable - while(!feof($fp)) { - $this->ipn_response .= fgets($fp, 1024); - } - - fclose($fp); // close connection - - } - - if (stristr($this->ipn_response,"VERIFIED")===false) - { - // Invalid IPN transaction. Check the log for details. - $this->last_error = 'IPN Validation Failed. '.$url_parsed['host'].'\\'.$url_parsed['path']; - $this->log_ipn_results($key,false); - return false; - } - else{ - - // Valid IPN transaction. - - // check recievers e-mail - $business = basket::getPaypalAccount(); - - if ($this->ipn_data['receiver_email']!=$business) - { - $this->last_error = 'receivers e-mail did not match '.$business; - $this->log_ipn_results($key,false); - return false; - } - - // if confirmed check message has not been received already - if ($this->ipn_data['payment_status'] == "Completed"){ - - $message = ORM::factory("ipn_message") - ->where('key',"=",$key) - ->where('status',"=",'completed') - ->where('txn_id',"=",$this->ipn_data['txn_id'])->find(); - - if ($message->loaded()){ - $this->last_error = 'Message alread received.'; - $this->log_ipn_results($key,false); - return false; - } - } - - $this->log_ipn_results($key,true); - return true; - - } - - } - - function log_ipn_results($key, $success) { - - // Timestamp - $text = '['.date('m/d/Y g:i A').'] - '; - - $message = ORM::factory("ipn_message"); - $message->date = time(); - $message->key = $key; - $message->txn_id = $this->ipn_data['txn_id']; - $message->status = $this->ipn_data['payment_status']; - $message->success = $success; - - // Success or failure being logged? - if ($success) $text .= "SUCCESS!\n"; - else $text .= 'FAIL: '.$this->last_error."\n"; - - // Log the POST variables - $text .= "IPN POST Vars from Paypal:\n"; - foreach ($this->ipn_data as $key=>$value) { - $text .= "$key=$value \n"; - } - - // Log the response from the paypal server - $text .= "\nIPN Response from Paypal Server:\n ".$this->ipn_response; - - $message->text = $text; - $message->save(); - } - - function dump_fields() { - - // Used for debugging, this function will output all the field/value pairs - // that are currently defined in the instance of the class using the - // add_field() function. - - echo "

      paypal_class->dump_fields() Output:

      "; - echo " - - - - "; - - ksort($this->fields); - foreach ($this->fields as $key => $value) { - echo ""; - } - - echo "
      Field NameValue
      $key".urldecode($value)." 

      "; - } -} - - - diff --git a/3.1/modules/basket/libraries/Session_Basket.php b/3.1/modules/basket/libraries/Session_Basket.php deleted file mode 100644 index c73cfe36..00000000 --- a/3.1/modules/basket/libraries/Session_Basket.php +++ /dev/null @@ -1,200 +0,0 @@ -product = $aProduct; - $this->item = $aItem; - $this->quantity = $aQuantity; - $this->calculate_cost(); - } - - private function calculate_cost(){ - $prod = ORM::factory("product", $this->product); - $this->cost = $prod->cost * $this->quantity; - $this->cost_per = $prod->cost; - } - - public function add($quantity){ - $this->quantity += $quantity; - $this->calculate_cost(); - } - - public function size(){ - return $this->quantity; - } - - public function getItem(){ - $photo = ORM::factory("item", $this->item); - return $photo; - } - - public function product_description(){ - $prod = ORM::factory("product", $this->product); - return $prod->description; - } - - public function getProduct(){ - $prod = ORM::factory("product", $this->product); - return $prod; - } - - public function getCode(){ - $photo = ORM::factory("item", $this->item); - $prod = ORM::factory("product", $this->product); - return $photo->id." - ".$photo->title." - ".$prod->name; - } - -} - -class Session_Basket_Core { - - public $contents = array(); - - public $name = ""; - public $house = ""; - public $street = ""; - public $suburb = ""; - public $town = ""; - public $postcode = ""; - public $email = ""; - public $phone = ""; - - public $ppenabled = true; - - public function clear(){ - if (isset($this->contents)){ - foreach ($this->contents as $key => $item){ - unset($this->contents[$key]); - } - } - $this->ppenabled = true; - } - - public function enablepp() - { - $this->ppenabled = true; - } - - public function disablepp() - { - $this->ppenabled = false; - } - - public function ispp(){ - return $this->ppenabled; - } - - - private function create_key($product, $id){ - return "$product _ $id"; - } - - public function size(){ - $size = 0; - if (isset($this->contents)){ - foreach ($this->contents as $product => $basket_item){ - $size += $basket_item->size(); - } - } - return $size; - } - - public function add($id, $product, $quantity){ - - $key = $this->create_key($product, $id); - if (isset($this->contents[$key])){ - $this->contents[$key]->add($quantity); - } - else { - $this->contents[$key] = new basket_item($product, $id, $quantity); - } - } - - public function remove($key){ - unset($this->contents[$key]); - } - - public function postage_cost(){ - $postage_cost = 0; - $postage_bands = array(); - $postage_quantities = array(); - if (isset($this->contents)){ - // create array of postage bands - foreach ($this->contents as $product => $basket_item){ - $postage_band = $basket_item->getProduct()->postage_band; - if (isset($postage_bands[$postage_band->id])) - { - $postage_quantities[$postage_band->id] += $basket_item->quantity; - } - else - { - $postage_quantities[$postage_band->id] = $basket_item->quantity; - $postage_bands[$postage_band->id] = $postage_band; - } - } - - foreach ($postage_bands as $id => $postage_band){ - $postage_cost += $postage_band->flat_rate + ($postage_band->per_item * $postage_quantities[$id]); - } - } - return $postage_cost; - } - - public function cost(){ - $cost = 0; - if (isset($this->contents)){ - foreach ($this->contents as $product => $basket_item){ - $cost += $basket_item->cost; - } - } - return $cost; - } - - public static function get(){ - return Session::instance()->get("basket"); - } - - public static function getOrCreate(){ - $session = Session::instance(); - - $basket = $session->get("basket"); - if (!$basket) - { - $basket = new Session_Basket(); - $session->set("basket", $basket); - } - return $basket; - } - -} \ No newline at end of file diff --git a/3.1/modules/basket/models/ipn_message.php b/3.1/modules/basket/models/ipn_message.php deleted file mode 100644 index c6f75ffa..00000000 --- a/3.1/modules/basket/models/ipn_message.php +++ /dev/null @@ -1,16 +0,0 @@ -date); - } - - public function json_encode(){ - $toReturn = array( - 'id' => $this->id, - 'date' => $this->formatedTime(), - 'text' => text::convertText($this->text)); - return $toReturn; - } -} \ No newline at end of file diff --git a/3.1/modules/basket/models/order.php b/3.1/modules/basket/models/order.php deleted file mode 100644 index 1dc1a627..00000000 --- a/3.1/modules/basket/models/order.php +++ /dev/null @@ -1,56 +0,0 @@ -id." ".$this->name." ".$this->status(); - } - - public function status(){ - switch ($this->status){ - case 1: - return "Waiting Payment"; - case 2: - return "Payment Confirmed"; - case 20: - return "Complete"; - - default: - return "Unknown"; - } - } - - public function payment_method(){ - switch ($this->method){ - case 1: - return "through Paypal"; - case 2: - return "offline"; - - default: - return "Unknown"; - } - } -} diff --git a/3.1/modules/basket/models/product.php b/3.1/modules/basket/models/product.php deleted file mode 100644 index 2bd6a59b..00000000 --- a/3.1/modules/basket/models/product.php +++ /dev/null @@ -1,26 +0,0 @@ - "length[1,32]", - "description" => "length[0,255]"); - protected $belongs_to=array('postage_band'); - -} diff --git a/3.1/modules/basket/models/product_override.php b/3.1/modules/basket/models/product_override.php deleted file mode 100644 index e3e720fd..00000000 --- a/3.1/modules/basket/models/product_override.php +++ /dev/null @@ -1,22 +0,0 @@ - - \ No newline at end of file diff --git a/3.1/modules/basket/views/add_to_basket_ajax.html.php b/3.1/modules/basket/views/add_to_basket_ajax.html.php deleted file mode 100644 index 137ecef2..00000000 --- a/3.1/modules/basket/views/add_to_basket_ajax.html.php +++ /dev/null @@ -1,9 +0,0 @@ - -
      -
      - <?= $item->title?> -
      -
      - -
      -
      \ No newline at end of file diff --git a/3.1/modules/basket/views/admin_configure.html.php b/3.1/modules/basket/views/admin_configure.html.php deleted file mode 100644 index 9960fe01..00000000 --- a/3.1/modules/basket/views/admin_configure.html.php +++ /dev/null @@ -1,7 +0,0 @@ - -
      -

      -

      -

      - -
      \ No newline at end of file diff --git a/3.1/modules/basket/views/admin_postage_bands.html.php b/3.1/modules/basket/views/admin_postage_bands.html.php deleted file mode 100644 index d79fe380..00000000 --- a/3.1/modules/basket/views/admin_postage_bands.html.php +++ /dev/null @@ -1,71 +0,0 @@ - - \ No newline at end of file diff --git a/3.1/modules/basket/views/admin_product_lines.html.php b/3.1/modules/basket/views/admin_product_lines.html.php deleted file mode 100644 index f20f2a37..00000000 --- a/3.1/modules/basket/views/admin_product_lines.html.php +++ /dev/null @@ -1,76 +0,0 @@ - - \ No newline at end of file diff --git a/3.1/modules/basket/views/admin_templates.html.php b/3.1/modules/basket/views/admin_templates.html.php deleted file mode 100644 index 263293c4..00000000 --- a/3.1/modules/basket/views/admin_templates.html.php +++ /dev/null @@ -1,8 +0,0 @@ - -
      -

      -

      - -

      - -
      \ No newline at end of file diff --git a/3.1/modules/basket/views/basket-side-bar.html.php b/3.1/modules/basket/views/basket-side-bar.html.php deleted file mode 100644 index d6ac00d7..00000000 --- a/3.1/modules/basket/views/basket-side-bar.html.php +++ /dev/null @@ -1,42 +0,0 @@ -page_type != 'basket'){ - if (basket::can_view_orders()){ - ?>" title="">item(); - if ($item->is_photo() && product::isForSale($theme->item()->id)){ - ?>

      -id") ?>" -title="">

      -contents) && ($basket->size() > 0)) { - ?>
      -

      " title="">

      - - page_type != 'basket'): ?> - - " - title="">View Orders - - contents) && ($basket->size() > 0)): ?> - - - diff --git a/3.1/modules/basket/views/checkout.html.php b/3.1/modules/basket/views/checkout.html.php deleted file mode 100644 index b9ceaa2d..00000000 --- a/3.1/modules/basket/views/checkout.html.php +++ /dev/null @@ -1,86 +0,0 @@ - - -
      - -
      -

      Payment Details

      - -
      - - - - -
      diff --git a/3.1/modules/basket/views/confirm_order.html.php b/3.1/modules/basket/views/confirm_order.html.php deleted file mode 100644 index 60ff14ac..00000000 --- a/3.1/modules/basket/views/confirm_order.html.php +++ /dev/null @@ -1,89 +0,0 @@ - - - -
      -

      Basket Summary

      -
      - - - - - - - - contents as $key => $prod_details): ?> - "> - - - - - - - - postage_cost();?> - 0):?> - "> - - - - "> - - - -
      - getItem(); ?> -
      - title) ?> -
      -
      - product_description()) ?> - - quantity) ?> - - cost) ?> -
      ispp()?"":"style=\"text-decoration:line-through\""; ?>>Postage and Packagingispp()?"":"style=\"text-decoration:line-through\""; ?>>
      Total Costispp()?basket::formatMoneyForWeb($basket->cost() + $postage):basket::formatMoneyForWeb($basket->cost()); ?>
      -
      - - - -
      -

      Delivery Address

      -name ?>
      -house ?>, -street ?>
      -suburb ?>
      -town ?>
      -postcode ?>
      -
      -

      Contact Details

      -E-mail : email ?>
      -Telephone : phone ?> -
      - -
      diff --git a/3.1/modules/basket/views/order_complete.html.php b/3.1/modules/basket/views/order_complete.html.php deleted file mode 100644 index 5f384732..00000000 --- a/3.1/modules/basket/views/order_complete.html.php +++ /dev/null @@ -1,30 +0,0 @@ - -
      -
      -

      Thankyou for your order

      -method == Order_Model::PAYMENT_PAYPAL){ -?>Your order will be confirmed when Paypal has finished processing your order.$ordernumber, "total_cost"=>basket::formatMoneyForWeb($total_cost)));?>
      -
      \ No newline at end of file diff --git a/3.1/modules/basket/views/paypal_redirect.html.php b/3.1/modules/basket/views/paypal_redirect.html.php deleted file mode 100644 index 26a2438b..00000000 --- a/3.1/modules/basket/views/paypal_redirect.html.php +++ /dev/null @@ -1,4 +0,0 @@ - -

      Processing

      If you are not automatically redirected to - paypal within 5 seconds Click Here.

      - diff --git a/3.1/modules/basket/views/pew1.html.php b/3.1/modules/basket/views/pew1.html.php deleted file mode 100644 index c751f7cb..00000000 --- a/3.1/modules/basket/views/pew1.html.php +++ /dev/null @@ -1,16 +0,0 @@ - - \ No newline at end of file diff --git a/3.1/modules/basket/views/pew2.html.php b/3.1/modules/basket/views/pew2.html.php deleted file mode 100644 index 41324d2d..00000000 --- a/3.1/modules/basket/views/pew2.html.php +++ /dev/null @@ -1,17 +0,0 @@ - - \ No newline at end of file diff --git a/3.1/modules/basket/views/print_order.html.php b/3.1/modules/basket/views/print_order.html.php deleted file mode 100644 index 63598131..00000000 --- a/3.1/modules/basket/views/print_order.html.php +++ /dev/null @@ -1,20 +0,0 @@ - - - -Print Order - - - - - - - - - - - \ No newline at end of file diff --git a/3.1/modules/basket/views/view_basket.html.php b/3.1/modules/basket/views/view_basket.html.php deleted file mode 100644 index 891d2647..00000000 --- a/3.1/modules/basket/views/view_basket.html.php +++ /dev/null @@ -1,137 +0,0 @@ - - -
      -
      - contents ) && count($basket->contents) > 0): ?> - - - - " - class="right g-button ui-state-default ui-corner-all ui-icon-right"> - - -
      -
      - contents ) && count($basket->contents) > 0): ?> - - - - - - - - - - - - - contents as $key => $prod_details): ?> - "> - - - - - - - - - postage_cost();?> - 0):?> - "> - - - - "> - - - "> - - - -
      - getItem(); ?> -
      - - <?= $item->title?> - -
      -
      - product_description()) ?> - - quantity) ?> - - cost?> - cost); ?> - - - " - class="g-button ui-state-default ui-corner-all ui-icon-left"> - -
      ispp()?"":"style=\"text-decoration:line-through\""; ?>>Postage and Packagingispp()?"":"style=\"text-decoration:line-through\""; ?>> -
      ispp()?"":"checked"; ?>/> Select if you wish to pick up the photos.
      Total Costispp()?basket::formatMoneyForWeb($total + $postage):basket::formatMoneyForWeb($total)?>
      - - - Shopping Basket is Empty - - -
      - -
      - contents ) && count($basket->contents) > 0): ?> - - " - class="right g-button ui-state-default ui-corner-all ui-icon-right"> - - -
      -
      \ No newline at end of file diff --git a/3.1/modules/basket/views/view_ipn.html.php b/3.1/modules/basket/views/view_ipn.html.php deleted file mode 100644 index 6c19e27f..00000000 --- a/3.1/modules/basket/views/view_ipn.html.php +++ /dev/null @@ -1,46 +0,0 @@ - -

      IPN Messages for title()?>

      -">Back to orders -
      - - -
      -
      
      -
      - diff --git a/3.1/modules/basket/views/view_order.html.php b/3.1/modules/basket/views/view_order.html.php deleted file mode 100644 index d735e26f..00000000 --- a/3.1/modules/basket/views/view_order.html.php +++ /dev/null @@ -1,18 +0,0 @@ - -

      title()?>

      -Payment is payment_method()?>status==Order_Model::WAITING_PAYMENT){ - ?>
      id)."?csrf=$csrf";?>">Confirm Order Payment status==Order_Model::PAYMENT_CONFIRMED){ - ?>
      id)."?csrf=$csrf";?>">Confirm Order Delivery method==Order_Model::PAYMENT_PAYPAL){ - ?>
      id);?>">View Paypal IPN Messages
      -",$order->text);?> \ No newline at end of file diff --git a/3.1/modules/basket/views/view_orders.html.php b/3.1/modules/basket/views/view_orders.html.php deleted file mode 100644 index a5c90e1c..00000000 --- a/3.1/modules/basket/views/view_orders.html.php +++ /dev/null @@ -1,67 +0,0 @@ - -
      -
      - - - - - - -
      -
      -
      - -
      -
      
      -
      - diff --git a/3.1/modules/batchtag/controllers/batchtag.php b/3.1/modules/batchtag/controllers/batchtag.php deleted file mode 100644 index 01f2e7ff..00000000 --- a/3.1/modules/batchtag/controllers/batchtag.php +++ /dev/null @@ -1,117 +0,0 @@ -post('name')}&item_id={$input->post('item_id')}&tag_subitems={$input->post('tag_subitems')}&csrf={$input->post('csrf')}")); - - } - - public function tagitems2() { - // Tag all non-album items in the current album with the specified tags. - - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - $input = Input::instance(); - - // Variables - if (($input->get("batchtag_max") == false) || ($input->get("batchtag_max") == "0")) { - $batchtag_max = "50"; - } else { - $batchtag_max = $input->get("batchtag_max"); - } - if ($input->get("batchtag_items_processed") == false) { - $batchtag_items_processed = "0"; - } else { - $batchtag_items_processed = $input->get("batchtag_items_processed"); - } - - // Figure out if the contents of sub-albums should also be tagged - $str_tag_subitems = $input->get("tag_subitems"); - - $children = ""; - if ($str_tag_subitems == false) { - // Generate an array of all non-album items in the current album. - $children = ORM::factory("item") - ->where("parent_id", "=", $input->get("item_id")) - ->where("type", "!=", "album") - ->find_all(); - } else { - // Generate an array of all non-album items in the current album - // and any sub albums. - $item = ORM::factory("item", $input->get("item_id")); - $children = $item->descendants(); - } - - // Loop through each item in the album and make sure the user has - // access to view and edit it. - $children_count = "0"; - $tag_count = "0"; - - //echo Kohana::debug($children); - - echo ''; - - foreach ($children as $child) { - - if ($tag_count < $batchtag_max) { - - if ($children_count >= $batchtag_items_processed) { - if (access::can("view", $child) && access::can("edit", $child) && !$child->is_album()) { - - // Assuming the user can view/edit the current item, loop - // through each tag that was submitted and apply it to - // the current item. - foreach (explode(",", $input->get("name")) as $tag_name) { - $tag_name = trim($tag_name); - if ($tag_name) { - tag::add($child, $tag_name); - } - // $tag_count should be inside the foreach loop as it is depending on the number of time tag:add is run - $tag_count++; - } - } - echo '' . "\n"; - $children_count++; - $batchtag_max_new = $tag_count; - echo ''; - } else { $children_count++; } - - } else { break; } - - } - - if ($tag_count < $batchtag_max) { - // Redirect back to the album. - $item = ORM::factory("item", $input->get("item_id")); - url::redirect(url::abs_site("{$item->type}s/{$item->id}")); - //echo url::abs_site("{$item->type}s/{$item->id}"); - } else { - url::redirect(url::abs_site("batchtag/tagitems2?name={$input->get('name')}&item_id={$input->get('item_id')}&tag_subitems={$input->get('tag_subitems')}&batchtag_items_processed=$children_count&batchtag_max=$batchtag_max&csrf={$input->get('csrf')}")); - //echo url::abs_site("batchtag/tagitems2?name={$input->get('name')}&item_id={$input->get('item_id')}&tag_subitems={$input->get('tag_subitems')}&batchtag_items_processed=$children_count&batchtag_max=$batchtag_max&csrf={$input->get('csrf')}"); - } - } -} diff --git a/3.1/modules/batchtag/helpers/batchtag_block.php b/3.1/modules/batchtag/helpers/batchtag_block.php deleted file mode 100644 index 01fe1216..00000000 --- a/3.1/modules/batchtag/helpers/batchtag_block.php +++ /dev/null @@ -1,61 +0,0 @@ - t("Batch Tag")); - } - - static function get($block_id, $theme) { - $block = ""; - - // Only display on album pages that the user can edit. - $item = $theme->item(); - if (!$item || !$item->is_album() || !access::can("edit", $item)) { - return; - } - - switch ($block_id) { - case "batch_tag": - // Make a new sidebar block. - $block = new Block(); - $block->css_id = "g-batch-tag"; - $block->title = t("Batch Tag"); - $block->content = new View("batchtag_block.html"); - - // Make a new form to place in the sidebar block. - $form = new Forge("batchtag/tagitems", "", "post", - array("id" => "g-batch-tag-form")); - $label = t("Tag everything in this album:"); - $group = $form->group("add_tag")->label("Add Tag"); - $group->input("name")->label($label)->rules("required|length[1,64]"); - $group->checkbox("tag_subitems") - ->label(t("Include sub-albums?")) - ->value(true) - ->checked(false); - - $group->hidden("item_id")->value($item->id); - $group->submit("")->value(t("Add Tag")); - $block->content->batch_tag_form = $form; - - break; - } - return $block; - } -} diff --git a/3.1/modules/batchtag/helpers/batchtag_event.php b/3.1/modules/batchtag/helpers/batchtag_event.php deleted file mode 100644 index aedceacd..00000000 --- a/3.1/modules/batchtag/helpers/batchtag_event.php +++ /dev/null @@ -1,40 +0,0 @@ -module == "tag") { - $data->messages["warn"][] = t("The BatchTag module requires the Tags module."); - } - } - - 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 BatchTag module requires the Tags module. " . - "Activate the Tags module now", - array("url" => url::site("admin/modules"))), - "batchtag_needs_tag"); - } else { - site_status::clear("batchtag_needs_tag"); - } - } -} diff --git a/3.1/modules/batchtag/module.info b/3.1/modules/batchtag/module.info deleted file mode 100644 index 56e8691e..00000000 --- a/3.1/modules/batchtag/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "BatchTag" -description = "Automatically apply a tag to the entire contents of an album." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:batchtag" -discuss_url = "http://gallery.menalto.com/forum_module_batchtag" diff --git a/3.1/modules/batchtag/views/batchtag_block.html.php b/3.1/modules/batchtag/views/batchtag_block.html.php deleted file mode 100644 index c46603ca..00000000 --- a/3.1/modules/batchtag/views/batchtag_block.html.php +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/3.1/modules/bitly/README b/3.1/modules/bitly/README deleted file mode 100644 index 3c385366..00000000 --- a/3.1/modules/bitly/README +++ /dev/null @@ -1,12 +0,0 @@ -ABOUT: -Shorten Gallery's album and item links using bit.ly's URL shortening service. - -INSTALLATION AND CONFIGURATION: -http://codex.gallery2.org/Gallery3:Modules:bitly - -SUPPORT/BUG REPORTS: -http://gallery.menalto.com/node/100816 - -ROADMAP: -* Provide multi-user support. -* Display shortened link statistics (clicks, etc.) diff --git a/3.1/modules/bitly/controllers/admin_bitly.php b/3.1/modules/bitly/controllers/admin_bitly.php deleted file mode 100644 index 535a375d..00000000 --- a/3.1/modules/bitly/controllers/admin_bitly.php +++ /dev/null @@ -1,95 +0,0 @@ -validate()) { - $new_login = $form->configure_bitly->login->value; - $new_key = $form->configure_bitly->api_key->value; - $new_domain = $form->configure_bitly->domain->value; - - module::set_var("bitly", "login", $new_login); - module::set_var("bitly", "api_key", $new_key); - module::set_var("bitly", "domain", $new_domain); - - if (!bitly::check_config()) { - url::redirect("admin/bitly"); - } else { - if ($login && !$new_login) { - message::success(t("Your bit.ly login has been cleared.")); - } else if ($login && $new_login && $login != $new_login) { - message::success(t("Your bit.ly login has been changed.")); - } else if (!$login && $new_login) { - message::success(t("Your bit.ly login has been saved.")); - } - if ($api_key && !$new_key) { - message::success(t("Your bit.ly API key has been cleared.")); - } else if ($api_key && $new_key && $api_key != $new_key) { - message::success(t("Your bit.ly API key has been changed.")); - } else if (!$api_key && $new_key) { - message::success(t("Your bit.ly API key has been saved.")); - } - if ($domain && $new_domain && $domain != $new_domain) { - message::success(t("Your preferrend bit.ly domain has been changed.")); - } else if (!$domain && $new_domain) { - message::success(t("Your preferred bit.ly domain has been saved.")); - } - log::success("bitly", t("bit.ly login changed to %new_login", - array("new_login" => $new_login))); - log::success("bitly", t("bit.ly API key changed to %new_key", - array("new_key" => $new_key))); - - (!$new_login || !$new_key) ? $valid_config = false : $valid_config = true; - } - } - } - - $view = new Admin_View("admin.html"); - $view->page_title = t("bit.ly url shortner"); - $view->content = new View("admin_bitly.html"); - $view->content->login = $form->configure_bitly->login->value; - $view->content->api_key = $form->configure_bitly->api_key->value; - $view->content->domain = $form->configure_bitly->domain->value; - $view->content->form = $form; - - $link = ORM::factory("bitly_link")->where("item_id", "=", 1)->find(); - - if ($link->loaded()) { - $view->content->g3_url = bitly::url($link->hash); - } else if ($valid_config && !empty($login) && !empty($api_key) && !empty($domain)) { - $view->content->g3_url = bitly::shorten_url(1); - } - - print $view; - } - -} \ No newline at end of file diff --git a/3.1/modules/bitly/controllers/bitly.php b/3.1/modules/bitly/controllers/bitly.php deleted file mode 100644 index 7a0b53c0..00000000 --- a/3.1/modules/bitly/controllers/bitly.php +++ /dev/null @@ -1,49 +0,0 @@ -relative_url_cache)); - } - - // Redirect back to the item - url::redirect(url::abs_site($item->relative_url_cache)); - } - -} \ No newline at end of file diff --git a/3.1/modules/bitly/helpers/bitly.php b/3.1/modules/bitly/helpers/bitly.php deleted file mode 100644 index f006362e..00000000 --- a/3.1/modules/bitly/helpers/bitly.php +++ /dev/null @@ -1,217 +0,0 @@ - 'expand', - 'shorten' => 'shorten', - 'validate' => 'validate', - 'clicks' => 'clicks', - 'referrers' => 'referrers', - 'countries' => 'countries', - 'clicks_by_minute' => 'clicks_by_minute', - 'clicks_by_day' => 'clicks_by_day', - 'lookup' => 'lookup', - 'info' => 'info', - ); - - static function get_configure_form() { - $form = new Forge("admin/bitly", "", "post", array("id" => "g-configure-bitly-form")); - $group = $form->group("configure_bitly")->label(t("Configure bit.ly")); - $group->input("login") - ->label(t("Login")) - ->value(module::get_var("bitly", "login")) - ->rules("required") - ->error_messages("required", t("You must enter a login")); - $group->input("api_key") - ->label(t("API Key")) - ->value(module::get_var("bitly", "api_key")) - ->rules("required") - ->error_messages("required", t("You must enter an API key")); - $group->dropdown("domain") - ->label(t("Preferred Domain")) - ->options(array("bit.ly" => "bit.ly", "j.mp" => "j.mp")) - ->selected(module::get_var("bitly", "domain")); - $group->submit("")->value(t("Save")); - return $form; - } - - /** - * Check a login and an API Key against bit.ly to make sure they're valid - * @param string $login bit.ly login - * @param string $api_key bit.ly API key - * @return boolean - */ - static function validate_config($login, $api_key) { - if (!empty($login) && !empty($api_key)) { - $parameters = array( - 'login' => $login, - 'apiKey' => $api_key, - 'x_login' => $login, - 'x_apiKey' => $api_key - ); - $request = self::_build_http_request('validate', $parameters); - $response = self::_http_post($request, "api.bit.ly"); - $json_decoded = json_decode($response->body[0]); - if (!$json_decoded->data->valid) { - if ("INVALID_LOGIN" == $json_decoded->status_txt) { - message::error(t("Your bit.ly login is incorrect")); - } else if ("INVALID_APIKEY" == $json_decoded->status_txt) { - message::error(t("Your bit.ly API Key is incorrect.")); - } - return false; - } else { - return true; - } - } - } - - /** - * Check whether the module's configured correctly - * @return boolean - */ - static function check_config() { - $login = module::get_var("bitly", "login"); - $api_key = module::get_var("bitly", "api_key"); - if (empty($login) || empty($api_key)) { - site_status::warning( - t("bit.ly is not quite ready! Please provide a login and API Key", - array("url" => html::mark_clean(url::site("admin/bitly")))), - "bitly_config"); - - } else if (!self::validate_config($login, $api_key)) { - site_status::warning( - t("bit.ly is not properly configured! URLs will not be shortened until its configuration is updated.", - array("url" => html::mark_clean(url::site("admin/bitly")))), - "bitly_config"); - } else { - site_status::clear("bitly_config"); - return true; - } - return false; - } - - /** - * Assemble a bitly API request - * @param string $type Type of API request, ex. shorten - * @param array $params Query string key/value pairs - * @return string - */ - private static function _build_http_request($type, $params) { - $http_request = ''; - if (!empty($type) && count($params)) { - foreach($params as $k => $v) { - $query_string[] = "$k=" . urlencode($v); - } - $path = "/" . self::$api_version . "/$type?" . implode('&', $query_string); - $module_version = module::get_version("bitly"); - - $http_request = "GET $path HTTP/1.0\r\n"; - $http_request .= "Host: " . self::$api_host . "\r\n"; - $http_request .= "User-Agent: Gallery/3 | bitly/" . module::get_version("bitly") . "\r\n"; - $http_request .= "\r\n"; - $http_request .= $path; - } - return $http_request; - } - - /** - * Send an http POST request - * @param string $http_request - * @param string $host - * @return object - */ - private static function _http_post($http_request) { - $response = ''; - if (false !== ($fs = @fsockopen(self::$api_host, 80, $errno, $errstr, 5))) { - fwrite($fs, $http_request); - while ( !feof($fs) ) { - $response .= fgets($fs, 1160); // One TCP-IP packet - } - fclose($fs); - list($headers, $body) = explode("\r\n\r\n", $response); - $headers = explode("\r\n", $headers); - $body = explode("\r\n", $body); - $response = new ArrayObject( - array("headers" => $headers, "body" => $body), ArrayObject::ARRAY_AS_PROPS); - } else { - throw new Exception("@todo CONNECTION TO URL SHORTENING SERVICE FAILED"); - } - Kohana_Log::add("debug", "Received response\n" . print_r($response, 1)); - - return $response; - } - - /** - * Shorten a Gallery URL - * @param int $item_id - * @param string $format - * @return mixed string|false - */ - static function shorten_url($item_id, $format='json') { - $item = ORM::factory("item", $item_id); - $short_url = ''; - $long_url = url::abs_site($item->relative_url_cache); - $parameters = array( - "login" => module::get_var("bitly", "login"), - 'apiKey' => module::get_var("bitly", "api_key"), - 'longUrl' => $long_url, - 'domain' => module::get_var("bitly", "domain"), - 'format' => $format, - ); - $request = self::_build_http_request('shorten', $parameters); - $response = self::_http_post($request, self::$api_host); - $json_response = json_decode($response->body[0]); - $status_txt = $json_response->status_txt; - - if ('OK' == $status_txt) { - $short_url = $json_response->data->url; - // Save the link hash to the database - $link = ORM::factory("bitly_link"); - $link->item_id = $item_id; - $link->hash = $json_response->data->hash; - $link->global_hash = $json_response->data->global_hash; - $link->save(); - return $json_response->data->url; - } else { - $status_code = $json_response->status_code; - log::error("content", "Shortened URL", "Error: $status_code $status_txt item"); - return false; - } - } - - /** - * Build a bit.ly link for a specified hash - * @param string $hash - * @return string - */ - static function url($hash) { - if (!empty($hash)) { - return "http://" . module::get_var("bitly", "domain") . "/$hash"; - } - } - -} diff --git a/3.1/modules/bitly/helpers/bitly_event.php b/3.1/modules/bitly/helpers/bitly_event.php deleted file mode 100644 index 1efeb264..00000000 --- a/3.1/modules/bitly/helpers/bitly_event.php +++ /dev/null @@ -1,67 +0,0 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("bitly_menu") - ->label(t("bit.ly")) - ->url(url::site("admin/bitly"))); - } - - static function site_menu($menu, $theme) { - $link = ORM::factory("bitly_link")->where("item_id", "=", $theme->item->id)->find(); - if (!$link->loaded() && $theme->item->owner->id == identity::active_user()->id) { - $menu->get("options_menu") - ->append(Menu::factory("link") - ->id("bitly") - ->label(t("Shorten link with bit.ly")) - ->url(url::site("bitly/shorten/{$theme->item->id}?csrf={$theme->csrf}")) - ->css_id("g-bitly-shorten") - ->css_class("g-bitly-shorten")); - } - } - - static function context_menu($menu, $theme, $item) { - $link = ORM::factory("bitly_link")->where("item_id", "=", $item->id)->find(); - if (!$link->loaded() && $theme->item->owner->id == identity::active_user()->id) { - $menu->get("options_menu") - ->append(Menu::factory("link") - ->id("bitly") - ->label(t("Shorten link with bit.ly")) - ->url(url::site("bitly/shorten/{$item->id}?csrf={$theme->csrf}")) - ->css_class("g-bitly-shorten ui-icon-link")); - } - } - - static function info_block_get_metadata($block, $item) { - $link = ORM::factory("bitly_link")->where("item_id", "=", $item->id)->find(); - if ($link->loaded()) { - $info = $block->content->metadata; - $info["bitly_url"] = array( - "label" => t("bit.ly url:"), - "value" => bitly::url($link->hash) - ); - $block->content->metadata = $info; - } - } - -} diff --git a/3.1/modules/bitly/js/bitly.js b/3.1/modules/bitly/js/bitly.js deleted file mode 100644 index 96dcb427..00000000 --- a/3.1/modules/bitly/js/bitly.js +++ /dev/null @@ -1,6 +0,0 @@ -$(document).ready(function() { - $(".g-bitly-shorten").click(function(e) { - e.preventDefault(); - return window.location = ($(this).attr("href")); - }); -}); diff --git a/3.1/modules/bitly/module.info b/3.1/modules/bitly/module.info deleted file mode 100644 index ad4cf6d7..00000000 --- a/3.1/modules/bitly/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "bit.ly" -description = "Shorten and track Gallery URLs with bit.ly (http://bit.ly). You'll need a bit.ly API key." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:bitly" -discuss_url = "http://gallery.menalto.com/forum_module_bitly" diff --git a/3.1/modules/bitly/views/admin_bitly.html.php b/3.1/modules/bitly/views/admin_bitly.html.php deleted file mode 100644 index d1d6703a..00000000 --- a/3.1/modules/bitly/views/admin_bitly.html.php +++ /dev/null @@ -1,18 +0,0 @@ - -
      -

      -

      - bit.ly account which will provide an API Key, which is also free.", - array("api_key_url" => "http://bit.ly/a/your_api_key", - "bitly_url" => "http://bit.ly")) ?> -

      -
      - -
      - %g3_url", array('g3_url' => $g3_url)) ?> -
      - - - -
      -
      diff --git a/3.1/modules/calendarview/controllers/calendarview.php b/3.1/modules/calendarview/controllers/calendarview.php deleted file mode 100644 index c1302ba5..00000000 --- a/3.1/modules/calendarview/controllers/calendarview.php +++ /dev/null @@ -1,269 +0,0 @@ -set_global("calendar_user", $display_user); - $template->page_title = t("Gallery :: Calendar"); - $template->content = new View("calendarview_year.html"); - $template->content->calendar_year = $display_year; - $template->content->calendar_user = $display_user; - $template->content->calendar_user_year_form = $this->_get_calenderprefs_form($display_year, $display_user); - $template->content->title = t("Calendar") . ": " . $display_year; - // Set up breadcrumbs - $calendar_breadcrumbs[0] = new Calendar_Breadcrumb(item::root()->title, item::root()->url()); - $calendar_breadcrumbs[1] = new Calendar_Breadcrumb($display_year, ""); - $template->set_global("breadcrumbs", $calendar_breadcrumbs); - print $template; - } - - public function day($display_year, $display_user, $display_month, $display_day) { - // Display all images for the specified day. - - // Figure out the total number of photos to display. - $day_count = 0; - if ($display_user == "-1") { - $day_count = ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, $display_day, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month, ($display_day + 1), $display_year)) - ->find_all() - ->count(); - } else { - $day_count = ORM::factory("item") - ->viewable() - ->where("owner_id", "=", $display_user) - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, $display_day, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month, ($display_day + 1), $display_year)) - ->find_all() - ->count(); - } - - // Figure out paging stuff. - $page_size = module::get_var("gallery", "page_size", 9); - $page = (int) Input::instance()->get("page", "1"); - $offset = ($page-1) * $page_size; - $max_pages = max(ceil($day_count / $page_size), 1); - - // Make sure that the page references a valid offset - if (($page < 1) || ($page > $max_pages)) { - throw new Kohana_404_Exception(); - } - - // Set up the page. - $template = new Theme_View("calpage.html", "collection", "CalendarDayView"); - $template->set_global("page", $page); - $template->set_global("max_pages", $max_pages); - $template->set_global("page_size", $page_size); - $template->page_title = t("Gallery :: Calendar"); - - // Figure out which photos go on this page. - if ($display_user == "-1") { - $template->set_global("children", ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, $display_day, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month, ($display_day + 1), $display_year)) - ->order_by("captured", "ASC") - ->find_all($page_size, $offset)); - } else { - $template->set_global("children", ORM::factory("item") - ->viewable() - ->where("owner_id", "=", $display_user) - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, $display_day, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month, ($display_day + 1), $display_year)) - ->order_by("captured", "ASC") - ->find_all($page_size, $offset)); - } - - // Set up breadcrumbs - $calendar_breadcrumbs[0] = new Calendar_Breadcrumb(item::root()->title, item::root()->url()); - $calendar_breadcrumbs[1] = new Calendar_Breadcrumb($display_year, url::site("calendarview/calendar/" . $display_year . "/" . $display_user)); - $calendar_breadcrumbs[2] = new Calendar_Breadcrumb(t(date("F", mktime(0, 0, 0, $display_month, $display_day, $display_year))), url::site("calendarview/month/" . $display_year . "/" . $display_user . "/" . $display_month)); - $calendar_breadcrumbs[3] = new Calendar_Breadcrumb($display_day, ""); - $template->set_global("breadcrumbs", $calendar_breadcrumbs); - - // Finish setting up and then display the page. - $template->set_global("children_count", $day_count); - $template->content = new View("dynamic.html"); - $template->content->title = t("Photos From ") . date("d", mktime(0, 0, 0, $display_month, $display_day, $display_year)) . " " . t(date("F", mktime(0, 0, 0, $display_month, $display_day, $display_year))) . " " . date("Y", mktime(0, 0, 0, $display_month, $display_day, $display_year)); - print $template; - } - - public function month($display_year, $display_user, $display_month) { - // Display all images for the specified month. - - // Figure out the total number of photos to display. - $day_count = 0; - if ($display_user == "-1") { - $day_count = ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, 1, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month+1, 1, $display_year)) - ->find_all() - ->count(); - } else { - $day_count = ORM::factory("item") - ->viewable() - ->where("owner_id", "=", $display_user) - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, 1, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month+1, 1, $display_year)) - ->find_all() - ->count(); - } - - // Figure out paging stuff. - $page_size = module::get_var("gallery", "page_size", 9); - $page = (int) Input::instance()->get("page", "1"); - $offset = ($page-1) * $page_size; - $max_pages = max(ceil($day_count / $page_size), 1); - - // Make sure that the page references a valid offset - if (($page < 1) || ($page > $max_pages)) { - throw new Kohana_404_Exception(); - } - - // Set up the page. - $template = new Theme_View("calpage.html", "collection", "CalendarMonthView"); - $template->set_global("page", $page); - $template->set_global("max_pages", $max_pages); - $template->set_global("page_size", $page_size); - $template->page_title = t("Gallery :: Calendar"); - - // Figure out which photos go on this page. - if ($display_user == "-1") { - $template->set_global("children", ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, 1, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month+1, 1, $display_year)) - ->order_by("captured", "ASC") - ->find_all($page_size, $offset)); - } else { - $template->set_global("children", ORM::factory("item") - ->viewable() - ->where("owner_id", "=", $display_user) - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, $display_month, 1, $display_year)) - ->where("captured", "<", mktime(0, 0, 0, $display_month+1, 1, $display_year)) - ->order_by("captured", "ASC") - ->find_all($page_size, $offset)); - } - - // Set up breadcrumbs - $calendar_breadcrumbs[0] = new Calendar_Breadcrumb(item::root()->title, item::root()->url()); - $calendar_breadcrumbs[1] = new Calendar_Breadcrumb($display_year, url::site("calendarview/calendar/" . $display_year . "/" . $display_user)); - $calendar_breadcrumbs[2] = new Calendar_Breadcrumb(t(date("F", mktime(0, 0, 0, $display_month, 1, $display_year))), ""); - $template->set_global("breadcrumbs", $calendar_breadcrumbs); - - // Finish setting up and then display the page. - $template->set_global("children_count", $day_count); - $template->content = new View("dynamic.html"); - $template->content->title = t("Photos From ") . t(date("F", mktime(0, 0, 0, $display_month, 1, $display_year))) . " " . date("Y", mktime(0, 0, 0, $display_month, 1, $display_year)); - print $template; - } - - private function _get_calenderprefs_form($display_year, $display_user) { - // Generate a form to allow the visitor to select a year and a gallery photo owner. - $calendar_group = new Forge("calendarview/setprefs", "", "post", - array("id" => "g-view-calendar-form")); - - // Generate a list of all Gallery users who have uploaded photos. - $valid_users[-1] = "(All Users)"; - $gallery_users = ORM::factory("user")->find_all(); - foreach ($gallery_users as $one_user) { - $count = ORM::factory("item") - ->viewable() - ->where("owner_id", "=", $one_user->id) - ->where("type", "!=", "album") - ->where("captured", "!=", "") - ->find_all() - ->count(); - if ($count > 0) { - $valid_users[$one_user->id] = $one_user->full_name; - } - } - - // Generate a list of years, starting with the year the earliest photo was - // taken, and ending with the year of the most recent photo. - $valid_years = Array(); - $all_photos = ORM::factory("item") - ->viewable() - //->where("owner_id", "=", $one_user->id) - ->where("type", "!=", "album") - ->where("captured", "!=", "") - ->order_by("captured", "DESC") - ->find_all(); - $counter = date('Y', $all_photos[count($all_photos)-1]->captured); - while ($counter <= date('Y', $all_photos[0]->captured)) { - $valid_years[$counter] = $counter; - $counter++; - } - - // Create the form. - $calendar_group->dropdown('cal_user') - ->label(t("Display Photos From User: ")) - ->id('cal_user') - ->options($valid_users) - ->selected($display_user); - $calendar_group->dropdown('cal_year') - ->label(t("For Year: ")) - ->id('cal_year') - ->options($valid_years) - ->selected($display_year); - - // Add a save button to the form. - $calendar_group->submit("SaveSettings")->value(t("Go"))->id('cal_go'); - - // Return the newly generated form. - return $calendar_group; - } - - public function setprefs() { - // Change the calendar year and / or user. - - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Get user specified settings. - $str_user_id = Input::instance()->post("cal_user"); - $str_year_id = Input::instance()->post("cal_year"); - - // redirect to the currect page. - url::redirect(url::site("calendarview/calendar/" . $str_year_id . "/" . $str_user_id, request::protocol())); - } -} \ No newline at end of file diff --git a/3.1/modules/calendarview/css/calendarview_calendar.css b/3.1/modules/calendarview/css/calendarview_calendar.css deleted file mode 100644 index 53807042..00000000 --- a/3.1/modules/calendarview/css/calendarview_calendar.css +++ /dev/null @@ -1,50 +0,0 @@ -/* Grid view ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#g-calendar-grid { - position: relative; - align: center; - float: left; - width: 200px; - height: 220px; - margin: 10px 10px 10px 10px; -} - -/* Search form ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#cal_user { - top: 0px; - left: 60px; - display: inline; -} -#cal_year { - top: 0px; - left: 240px; - display: inline; -} -#cal_go { - top: 0px; - left: 328px; - display: inline; -} - -/* Content ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -table.calendar { - text-align: center; -} - -table.calendar caption { - font-size: 1.5em; - padding: 0.2em; -} - -table.calendar th, table.calendar td { - padding: 0.2em; - border: 0px; -} - -table.calendar td:hover { - background: #ddf; -} - -/* For RTL Languages ~~~~~~~~~~~~~~~~~~~~~~~ */ -.rtl #g-calendar-grid { - float: right; -} diff --git a/3.1/modules/calendarview/css/calendarview_menu.css b/3.1/modules/calendarview/css/calendarview_menu.css deleted file mode 100644 index 600cc151..00000000 --- a/3.1/modules/calendarview/css/calendarview_menu.css +++ /dev/null @@ -1,3 +0,0 @@ -#g-view-menu #g-calendarview-link { - background-image: url('../images/ico-view-calendarview.png'); -} diff --git a/3.1/modules/calendarview/helpers/calendarview_block.php b/3.1/modules/calendarview/helpers/calendarview_block.php deleted file mode 100644 index 1037ecaa..00000000 --- a/3.1/modules/calendarview/helpers/calendarview_block.php +++ /dev/null @@ -1,72 +0,0 @@ - t("More Photos From This Date")); - } - - static function get($block_id, $theme) { - $block = ""; - - // Make sure the current page belongs to an item. - if (!$theme->item()) { - return; - } - $item = $theme->item; - - $display_date = ""; - if (isset($item->captured)) { - $display_date = $item->captured; - }elseif (isset($item->created)) { - $display_date = $item->created; - } - - // Make sure there are photo's to display. - $day_count = ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, date("n", $display_date), date("j", $display_date), date("Y", $display_date))) - ->where("captured", "<", mktime(0, 0, 0, date("n", $display_date), date("j", $display_date)+1, date("Y", $display_date))) - ->find_all() - ->count(); - $month_count = ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, date("n", $display_date), 1, date("Y", $display_date))) - ->where("captured", "<", mktime(0, 0, 0, date("n", $display_date)+1, 1, date("Y", $display_date))) - ->find_all() - ->count(); - - switch ($block_id) { - case "calendarview_photo": - if ( ($display_date != "") && (($day_count > 0) || ($month_count > 0)) ) { - $block = new Block(); - $block->css_id = "g-calendarview-sidebar"; - $block->title = t("Calendar"); - $block->content = new View("calendarview_sidebar.html"); - $block->content->date = $display_date; - $block->content->day_count = $day_count; - $block->content->month_count = $month_count; - } - break; - } - return $block; - } -} diff --git a/3.1/modules/calendarview/helpers/calendarview_event.php b/3.1/modules/calendarview/helpers/calendarview_event.php deleted file mode 100644 index 731a662a..00000000 --- a/3.1/modules/calendarview/helpers/calendarview_event.php +++ /dev/null @@ -1,72 +0,0 @@ -append(Menu::factory("link") - ->id("calendarview") - ->label(t("View Calendar")) - ->url(url::site("calendarview/calendar/")) - ->css_id("g-calendarview-link")); - } - - static function movie_menu($menu, $theme) { - $menu->append(Menu::factory("link") - ->id("calendarview") - ->label(t("View Calendar")) - ->url(url::site("calendarview/calendar/")) - ->css_id("g-calendarview-link")); - } - - static function album_menu($menu, $theme) { - $menu->append(Menu::factory("link") - ->id("calendarview") - ->label(t("View Calendar")) - ->url(url::site("calendarview/calendar/")) - ->css_id("g-calendarview-link")); - } - - static function tag_menu($menu, $theme) { - $menu->append(Menu::factory("link") - ->id("calendarview") - ->label(t("View Calendar")) - ->url(url::site("calendarview/calendar/")) - ->css_id("g-calendarview-link")); - } - - static function pre_deactivate($data) { - // If the admin is about to deactivate EXIF, warn them that this module requires it. - if ($data->module == "exif") { - $data->messages["warn"][] = t("The CalendarView module requires the EXIF module."); - } - } - - static function module_change($changes) { - // If EXIF is deactivated, display a warning that it is required for this module to function properly. - if (!module::is_active("exif") || in_array("exif", $changes->deactivate)) { - site_status::warning( - t("The CalendarView module requires the EXIF module. " . - "Activate the EXIF module now", - array("url" => html::mark_clean(url::site("admin/modules")))), - "calendarview_needs_exif"); - } else { - site_status::clear("calendarview_needs_exif"); - } - } -} \ No newline at end of file diff --git a/3.1/modules/calendarview/images/ico-view-calendarview.png b/3.1/modules/calendarview/images/ico-view-calendarview.png deleted file mode 100644 index 5e564b8d..00000000 Binary files a/3.1/modules/calendarview/images/ico-view-calendarview.png and /dev/null differ diff --git a/3.1/modules/calendarview/libraries/Calendar_Breadcrumb.php b/3.1/modules/calendarview/libraries/Calendar_Breadcrumb.php deleted file mode 100644 index 751af272..00000000 --- a/3.1/modules/calendarview/libraries/Calendar_Breadcrumb.php +++ /dev/null @@ -1,31 +0,0 @@ -title = $new_title; - $this->url = $new_url; - } -} diff --git a/3.1/modules/calendarview/libraries/PHPCalendar.php b/3.1/modules/calendarview/libraries/PHPCalendar.php deleted file mode 100644 index 2d1df2b4..00000000 --- a/3.1/modules/calendarview/libraries/PHPCalendar.php +++ /dev/null @@ -1,87 +0,0 @@ -month = (int) $month; - $this->year = (int) $year; - $this->month_url = $url; - } - - public function event($day_of_the_week, $event_url = NULL, $css_id = NULL, $custom_text = NULL) - { - $this->event_data += Array($day_of_the_week => Array($event_url, $css_id, $custom_text)); - } - - public function render() - { - return $this->generate_calendar($this->year, $this->month, $this->event_data, 2, $this->month_url, $this->week_start, NULL); - } - - # PHP Calendar (version 2.3), written by Keith Devens - # http://keithdevens.com/software/php_calendar - # see example at http://keithdevens.com/weblog - # License: http://keithdevens.com/software/license - function generate_calendar($year, $month, $days = array(), $day_name_length = 3, $month_href = NULL, $first_day = 0, $pn = array()) - { - $first_of_month = gmmktime(0,0,0,$month,1,$year); - #remember that mktime will automatically correct if invalid dates are entered - # for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998 - # this provides a built in "rounding" feature to generate_calendar() - - if ($first_day == 0) $day_names = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); - if ($first_day == 1) $day_names = array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"); - - list($month, $year, $month_name, $weekday) = explode(',',gmstrftime('%m,%Y,%B,%w',$first_of_month)); - $weekday = ($weekday + 7 - $first_day) % 7; #adjust for $first_day - $title = t(date("F", mktime(0, 0, 0, $month, 1, $year))) . ' ' . $year; - - #Begin calendar. Uses a real . See http://diveintomark.org/archives/2002/07/03 - @list($p, $pl) = each($pn); @list($n, $nl) = each($pn); #previous and next links, if applicable - if($p) $p = ''.($pl ? ''.$p.'' : $p).' '; - if($n) $n = ' '.($nl ? ''.$n.'' : $n).''; - $calendar = ''."\n". - '\n"; - - if($day_name_length){ #if the day names should be shown ($day_name_length > 0) - #if day_name_length is >3, the full name of the day will be printed - foreach($day_names as $d) - $calendar .= ''; - $calendar .= "\n"; - } - - if($weekday > 0) $calendar .= ''; #initial 'empty' days - for($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){ - if($weekday == 7){ - $weekday = 0; #start a new week - $calendar .= "\n"; - } - if(isset($days[$day]) and is_array($days[$day])){ - @list($link, $classes, $content) = $days[$day]; - if(is_null($content)) $content = $day; - $calendar .= '' : '>'). - ($link ? ''.$content.'' : $content).''; - } - else $calendar .= ""; - } - if($weekday != 7) $calendar .= ''; #remaining "empty" days - - return $calendar."\n
      '.$p.($month_href ? ''.$title.'' : $title).$n."
      '.t($day_name_length < 4 ? substr($d,0,$day_name_length) : $d) . '
       
      $day 
      \n"; - } -} -?> \ No newline at end of file diff --git a/3.1/modules/calendarview/module.info b/3.1/modules/calendarview/module.info deleted file mode 100644 index 761eadab..00000000 --- a/3.1/modules/calendarview/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "CalendarView" -description = "View your photos by the date they were taken." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:calendarview" -discuss_url = "http://gallery.menalto.com/forum_module_calendarview" diff --git a/3.1/modules/calendarview/views/calendarview_sidebar.html.php b/3.1/modules/calendarview/views/calendarview_sidebar.html.php deleted file mode 100644 index b4f1f6fe..00000000 --- a/3.1/modules/calendarview/views/calendarview_sidebar.html.php +++ /dev/null @@ -1,9 +0,0 @@ - -
        - 0): ?> -
      • ">
      • - - 0): ?> -
      • ">
      • - -
      \ No newline at end of file diff --git a/3.1/modules/calendarview/views/calendarview_year.html.php b/3.1/modules/calendarview/views/calendarview_year.html.php deleted file mode 100644 index b40d7d58..00000000 --- a/3.1/modules/calendarview/views/calendarview_year.html.php +++ /dev/null @@ -1,95 +0,0 @@ - -
      -
      - dynamic_top() ?> -
      -

      -
      - -


      - -viewable() - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, 1, 1, $calendar_year)) - ->where("captured", "<", mktime(0, 0, 0, 1, 1, ($calendar_year + 1))) - ->order_by("captured") - ->find_all(); - } else { - $items_for_year = ORM::factory("item") - ->viewable() - ->where("owner_id", "=", $calendar_user) - ->where("type", "!=", "album") - ->where("captured", ">=", mktime(0, 0, 0, 1, 1, $calendar_year)) - ->where("captured", "<", mktime(0, 0, 0, 1, 1, ($calendar_year + 1))) - ->order_by("captured") - ->find_all(); - } - - // Set up some initial variables. - $counter_months = 1; - $counter_days = 0; - $counter = 0; - - // Set up the January Calendar. - // Check and see if any photos were taken in January, - // If so, make the month title into a clickable link. - print "
      "; - if ((count($items_for_year) > 0) && (date("n", $items_for_year[$counter]->captured) == 1)) { - $month_url = url::site("calendarview/month/" . $calendar_year . "/" . $calendar_user . "/" . $counter_months . "/"); - } else { - $month_url = ""; - } - $calendar = new PHPCalendar($counter_months, $calendar_year, $month_url); - - // Loop through each photo taken during this year, and see what month and day they were taken on. - // Make the corresponding dates on the calendars into clickable links. - while ($counter < (count($items_for_year))) { - - // Check and see if we've switched to a new month. - // If so, render the current calendar and set up a new one. - while (date("n", $items_for_year[$counter]->captured) > $counter_months) { - echo $calendar->render(); - print "
      "; - $counter_months++; - $counter_days = 0; - print "
      "; - if (date("n", $items_for_year[$counter]->captured) == $counter_months) { - $month_url = url::site("calendarview/month/" . $calendar_year . "/" . $calendar_user . "/" . $counter_months . "/"); - } else { - $month_url = ""; - } - $calendar = new PHPCalendar($counter_months, $calendar_year, $month_url); - } - - // If the day of the current photo is different then the day of the previous photo, - // then add a link to the calendar for this date and set the current day to this day. - if (date("j", $items_for_year[$counter]->captured) > $counter_days) { - $counter_days = date("j", $items_for_year[$counter]->captured); - $calendar->event($counter_days, url::site("calendarview/day/" . $calendar_year . "/" . $calendar_user . "/" . $counter_months . "/" . $counter_days)); - } - - // Move onto the next photo. - $counter++; - } - - // Print out the last calendar to be generated. - echo $calendar->render(); - print "
      "; - $counter_months++; - - // If the calendar that was previously rendered was not December, - // then print out a few empty months for the rest of the year. - while ($counter_months < 13) { - print "
      "; - $month_url = ""; - $calendar = new PHPCalendar($counter_months, $calendar_year, $month_url); - echo $calendar->render(); - print "
      "; - $counter_months++; - } -?> -dynamic_bottom() ?> diff --git a/3.1/modules/calendarview/views/calpage.html.php b/3.1/modules/calendarview/views/calpage.html.php deleted file mode 100644 index 3dab5fc0..00000000 --- a/3.1/modules/calendarview/views/calpage.html.php +++ /dev/null @@ -1,164 +0,0 @@ - - -html_attributes() ?> xml:lang="en" lang="en"> - - - start_combining("script,css") ?> - - <? 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 ?> - - " - type="image/x-icon" /> - - page_type == "collection"): ?> - - - - - - - - script("json2-min.js") ?> - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("jquery.localscroll.js") ?> - - - page_subtype == "photo"): ?> - script("jquery.scrollTo.js") ?> - script("gallery.show_full_size.js") ?> - page_subtype == "movie"): ?> - script("flowplayer.js") ?> - - - head() ?> - - - script("ui.init.js") ?> - css("yui/reset-fonts-grids.css") ?> - css("superfish/css/superfish.css") ?> - css("themeroller/ui.base.css") ?> - css("screen.css") ?> - - - - get_combined("script") ?> - - - get_combined("css") ?> - - - body_attributes() ?>> - page_top() ?> -
      - site_status() ?> -
      -
      - - - - - - user_menu() ?> - header_top() ?> - - - - - - header_bottom() ?> -
      - - - - -
        - - - > - - url) : ?> - title) ?> - - title) ?> - - - - -
      - - - - - -
      -
      -
      -
      -
      - messages() ?> - -
      -
      -
      -
      - page_subtype != "login"): ?> - - -
      -
      - -
      - page_bottom() ?> - - \ No newline at end of file diff --git a/3.1/modules/captionator/controllers/captionator.php b/3.1/modules/captionator/controllers/captionator.php deleted file mode 100644 index 8b380f66..00000000 --- a/3.1/modules/captionator/controllers/captionator.php +++ /dev/null @@ -1,84 +0,0 @@ -abs_url()); - } - - $v = new Theme_View("page.html", "collection", "captionator"); - $v->content = new View("captionator_dialog.html"); - $v->content->album = $album; - $v->content->enable_tags = module::is_active("tag"); - if ($v->content->enable_tags) { - $v->content->tags = array(); - foreach ($album->viewable()->children() as $child) { - $item = ORM::factory("item", $child->id); - $tag_names = array(); - foreach (tag::item_tags($item) as $tag) { - $tag_names[] = $tag->name; - } - $v->content->tags[$child->id] = implode(", ", $tag_names); - } - } - print $v; - } - - function save($album_id) { - access::verify_csrf(); - - $album = ORM::factory("item", $album_id); - access::required("edit", $album); - - if (Input::instance()->post("save")) { - $titles = Input::instance()->post("title"); - $descriptions = Input::instance()->post("description"); - $filenames = Input::instance()->post("filename"); - $internetaddresses = Input::instance()->post("internetaddress"); - $tags = Input::instance()->post("tags"); - $enable_tags = module::is_active("tag"); - foreach (array_keys($titles) as $id) { - $item = ORM::factory("item", $id); - if ($item->loaded() && access::can("edit", $item)) { - $item->title = $titles[$id]; - $item->description = $descriptions[$id]; - $item->name = $filenames[$id]; - $item->slug = $internetaddresses[$id]; - $item->save(); - if ($enable_tags) { - tag::clear_all($item); - foreach (explode(",", $tags[$id]) as $tag_name) { - if ($tag_name) { - tag::add($item, trim($tag_name)); - } - } - tag::compact(); - } - } - } - message::success(t("Captions saved")); - } - url::redirect($album->abs_url()); - } -} diff --git a/3.1/modules/captionator/helpers/captionator_event.php b/3.1/modules/captionator/helpers/captionator_event.php deleted file mode 100644 index 43e501f8..00000000 --- a/3.1/modules/captionator/helpers/captionator_event.php +++ /dev/null @@ -1,33 +0,0 @@ -item(); - - if ($item && $item->is_album() && access::can("edit", $item)) { - $menu->get("options_menu") - ->append(Menu::factory("link") - ->id("captionator") - ->label(t("Caption album")) - ->css_id("g-menu-captionator-link") - ->url(url::site("captionator/dialog/{$item->id}"))); - } - } -} diff --git a/3.1/modules/captionator/module.info b/3.1/modules/captionator/module.info deleted file mode 100644 index 5edf301c..00000000 --- a/3.1/modules/captionator/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Captionator" -description = "Caption all photos, movies and albums in an album at once." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:captionator" -discuss_url = "http://gallery.menalto.com/forum_module_captionator" diff --git a/3.1/modules/captionator/views/captionator_dialog.html.php b/3.1/modules/captionator/views/captionator_dialog.html.php deleted file mode 100644 index fe77c2ab..00000000 --- a/3.1/modules/captionator/views/captionator_dialog.html.php +++ /dev/null @@ -1,57 +0,0 @@ - -
      - -
      id}") ?>" method="post" id="g-captionator-form"> - -
      - - %album_title", array("album_title" => $album->title)) ?> - - - viewable()->children() as $child): ?> - - - - - -
      - thumb_img(array(), 140, true) ?> - -
        -
      • - - -
      • -
      • - - -
      • - -
      • - - -
      • - -
      • - - -
      • -
      • - - -
      • -
      -
      - -
      -
      - "/> - "/> -
      -
      -
      diff --git a/3.1/modules/contactowner/controllers/admin_contactowner.php b/3.1/modules/contactowner/controllers/admin_contactowner.php deleted file mode 100644 index 26b684ab..00000000 --- a/3.1/modules/contactowner/controllers/admin_contactowner.php +++ /dev/null @@ -1,101 +0,0 @@ -content = new View("admin_contactowner.html"); - $view->content->contactowner_form = $this->_get_admin_form(); - print $view; - } - - public function saveprefs() { - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Figure out which boxes where checked - $linkOptions_array = Input::instance()->post("ContactOwnerLinkTypes"); - $ownerLink = false; - $userLink = false; - for ($i = 0; $i < count($linkOptions_array); $i++) { - if ($linkOptions_array[$i] == "ContactOwner") { - $ownerLink = true; - } - if ($linkOptions_array[$i] == "ContactUser") { - $userLink = true; - } - } - - // Figure out the values of the text boxes - $str_contactbutton = Input::instance()->post("owner_button_text"); - $str_contactemail = Input::instance()->post("owner_email"); - $str_contactname = Input::instance()->post("owner_name"); - $str_messageheader = Input::instance()->post("message_header"); - - // Save Settings. - module::set_var("contactowner", "contact_owner_link", $ownerLink); - module::set_var("contactowner", "contact_user_link", $userLink); - module::set_var("contactowner", "contact_button_text", $str_contactbutton); - module::set_var("contactowner", "contact_owner_email", $str_contactemail); - module::set_var("contactowner", "contact_owner_name", $str_contactname); - module::set_var("contactowner", "contact_owner_header", $str_messageheader); - message::success(t("Your Settings Have Been Saved.")); - - // Load Admin page. - $view = new Admin_View("admin.html"); - $view->content = new View("admin_contactowner.html"); - $view->content->contactowner_form = $this->_get_admin_form(); - print $view; - } - - private function _get_admin_form() { - // Make a new Form. - $form = new Forge("admin/contactowner/saveprefs", "", "post", - array("id" => "g-contact-owner-adminForm")); - - // Make an array for the different types of link codes. - $add_contactlinks = $form->group("contactOwnerLinks"); - $linkOptions["ContactOwner"] = array("Display Contact Site Owner Link", - module::get_var("contactowner", "contact_owner_link")); - $linkOptions["ContactUser"] = array("Display Contact Item Owner Link", - module::get_var("contactowner", "contact_user_link")); - - // Turn the array into a series of checkboxes. - $add_contactlinks->checklist("ContactOwnerLinkTypes") - ->options($linkOptions); - - // Set up some text boxes for the site owners Name, email and the - // text for the contact link. - $add_contacts = $form->group("contactOwner"); - $add_contacts->input("owner_button_text")->label(t("Contact Owner Link Text"))->value(module::get_var("contactowner", "contact_button_text")); - $add_contacts->input("owner_email")->label(t("Owner Email Address"))->value(module::get_var("contactowner", "contact_owner_email")); - $add_contacts->input("owner_name")->label(t("Owner Name"))->value(module::get_var("contactowner", "contact_owner_name")); - - $message_prefs = $form->group("messagePrefs"); - $message_prefs->input("message_header")->label(t("Email Message Header"))->value(module::get_var("contactowner", "contact_owner_header")); - - // Add a save button to the form. - $form->submit("SaveSettings")->value(t("Save")); - - // Return the newly generated form. - return $form; - } -} \ No newline at end of file diff --git a/3.1/modules/contactowner/controllers/contactowner.php b/3.1/modules/contactowner/controllers/contactowner.php deleted file mode 100644 index 0a302c91..00000000 --- a/3.1/modules/contactowner/controllers/contactowner.php +++ /dev/null @@ -1,171 +0,0 @@ -where("id", "=", $user_id) - ->find_all(); - $str_to_name = $userDetails[0]->name; - } - - // If item_id is set, include a link to the item. - $email_body = ""; - if ($item_id <> "") { - $item = ORM::factory("item", $item_id); - $email_body = "This message refers to type}s/{$item->id}") . "\">this page."; - } - - // Make a new form with a couple of text boxes. - $form = new Forge("contactowner/sendemail/{$user_id}", "", "post", - array("id" => "g-contact-owner-send-form")); - $sendmail_fields = $form->group("contactOwner"); - $sendmail_fields->input("email_to") - ->label(t("To:"))->value($str_to_name) - ->id("g-contactowner-to-name"); - $sendmail_fields->input("email_from") - ->label(t("From:"))->value(identity::active_user()->email) - ->id("g-contactowner-from-email") - ->rules('required|valid_email') - ->error_messages("required", t("You must enter a valid email address")) - ->error_messages("valid_email", t("You must enter a valid email address")) - ->error_messages("invalid", t("You must enter a valid email address")); - $sendmail_fields->input("email_subject") - ->label(t("Subject:"))->value("") - ->id("g-contactowner-subject") - ->rules('required') - ->error_messages("required", t("You must enter a subject")); - $sendmail_fields->textarea("email_body") - ->label(t("Message:")) - ->value($email_body) - ->id("g-contactowner-email-body") - ->rules('required') - ->error_messages("required", t("You must enter a message")); - - // Add a captcha, if there's an active captcha module. - module::event("captcha_protect_form", $form); - - // Add a save button to the form. - $sendmail_fields->submit("SendMessage")->value(t("Send")); - - return $form; - } - - public function emailowner($item_id) { - // Display a form that a vistor can use to contact the site owner. - - // If this page is disabled, show a 404 error. - if (module::get_var("contactowner", "contact_owner_link") != true) { - throw new Kohana_404_Exception(); - } - - // Set up and display the actual page. - $template = new Theme_View("page.html", "other", "Contact"); - $template->content = new View("contactowner_emailform.html"); - $template->content->sendmail_form = $this->get_email_form("-1", $item_id); - print $template; - } - - public function emailid($user_id, $item_id) { - // Display a form that a vistor can use to contact a registered user. - - // If this page is disabled, show a 404 error. - if (module::get_var("contactowner", "contact_user_link") != true) { - throw new Kohana_404_Exception(); - } - - // Set up and display the actual page. - $template = new Theme_View("page.html", "other", "Contact"); - $template->content = new View("contactowner_emailform.html"); - $template->content->sendmail_form = $this->get_email_form($user_id, $item_id); - print $template; - } - - public function sendemail($user_id) { - // Validate the form, then send the actual email. - - // If this page is disabled, show a 404 error. - if (($user_id == "-1") && (module::get_var("contactowner", "contact_owner_link") != true)) { - throw new Kohana_404_Exception(); - } elseif (($user_id >= 0) && (module::get_var("contactowner", "contact_user_link") != true)) { - throw new Kohana_404_Exception(); - } - - // Make sure the form submission was valid. - $form = $this->get_email_form($user_id); - $valid = $form->validate(); - if ($valid) { - // Copy the data from the email form into a couple of variables. - $str_emailsubject = Input::instance()->post("email_subject"); - $str_emailfrom = Input::instance()->post("email_from"); - $str_emailbody = Input::instance()->post("email_body"); - - // Add in some
      tags to the message body where ever there are line breaks. - $str_emailbody = str_replace("\n", "\n
      ", $str_emailbody); - - // Gallery's Sendmail library doesn't allow for custom from addresses, - // so add the from email to the beginning of the message body instead. - // Also add in the admin-defined message header. - $str_emailbody = module::get_var("contactowner", "contact_owner_header") . "
      \r\n" . "Message Sent From " . $str_emailfrom . "
      \r\n
      \r\n" . $str_emailbody; - - // Figure out where the email is going to. - $str_emailto = ""; - if ($user_id == -1) { - // If the email id is "-1" send the message to a pre-determined - // owner email address. - $str_emailto = module::get_var("contactowner", "contact_owner_email"); - } else { - // or else grab the email from the user table. - $userDetails = ORM::factory("user") - ->where("id", "=", $user_id) - ->find_all(); - $str_emailto = $userDetails[0]->email; - } - - // Send the email message. - Sendmail::factory() - ->to($str_emailto) - ->subject($str_emailsubject) - ->header("Mime-Version", "1.0") - ->header("Content-type", "text/html; charset=utf-8") - ->message($str_emailbody) - ->send(); - - // Display a message telling the visitor that their email has been sent. - $template = new Theme_View("page.html", "other", "Contact"); - $template->content = new View("contactowner_emailform.html"); - $template->content->sendmail_form = t("Your Message Has Been Sent."); - print $template; - - } else { - // Set up and display the actual page. - $template = new Theme_View("page.html", "other", "Contact"); - $template->content = new View("contactowner_emailform.html"); - $template->content->sendmail_form = $form; - print $template; - } - } -} diff --git a/3.1/modules/contactowner/helpers/contactowner_block.php b/3.1/modules/contactowner/helpers/contactowner_block.php deleted file mode 100644 index b2c31500..00000000 --- a/3.1/modules/contactowner/helpers/contactowner_block.php +++ /dev/null @@ -1,83 +0,0 @@ - t("Contact Owner")); - } - - static function get($block_id, $theme) { - $block = ""; - - switch ($block_id) { - case "contact_owner": - - // Create a new block to display the links in. - $block = new Block(); - $block->css_id = "g-contact-owner"; - $block->title = t("Contact"); - $block->content = new View("contactowner_block.html"); - - // if $displayBlock is true, this block will be displayed, - // if there aren't any links to put in the block for whatever reason - // then $displayBlock will rename set to false and the - // block will not be displayed. - $displayBlock = false; - - if ($theme->item()) { - // Locate the record for the user that created the current item. - // Their name will be displayed as part of the contact link. - $userDetails = ORM::factory("user") - ->where("id", "=", $theme->item->owner_id) - ->find_all(); - - // Figure out if the contact item owner email link should be displayed. - // only display it if the current owner has an email address and - // the option for allowing item owners to be contacted is set to true. - if ((count($userDetails) > 0) && ($userDetails[0]->email != "") && - (module::get_var("contactowner", "contact_user_link") == true)) { - $block->content->userLink = "item->owner_id) . "/" . $theme->item->id . "\">" . t("Contact") . " " . - $userDetails[0]->name . ""; - $displayBlock = true; - } - } - - // Figure out if the contact site owner link should be displayed. - if (module::get_var("contactowner", "contact_owner_link")) { - if ($theme->item()) { - $block->content->ownerLink = "item->id . - "\">" . t(module::get_var("contactowner", "contact_button_text")) . ""; - } else { - $block->content->ownerLink = "" . t(module::get_var("contactowner", "contact_button_text")) . ""; - } - $displayBlock = true; - } - - break; - } - - if ($displayBlock) { - return $block; - } else { - return ""; - } - } -} diff --git a/3.1/modules/contactowner/helpers/contactowner_installer.php b/3.1/modules/contactowner/helpers/contactowner_installer.php deleted file mode 100644 index 99e3371d..00000000 --- a/3.1/modules/contactowner/helpers/contactowner_installer.php +++ /dev/null @@ -1,35 +0,0 @@ - -
      -

      - -
      diff --git a/3.1/modules/contactowner/views/contactowner_block.html.php b/3.1/modules/contactowner/views/contactowner_block.html.php deleted file mode 100644 index f593af5b..00000000 --- a/3.1/modules/contactowner/views/contactowner_block.html.php +++ /dev/null @@ -1,15 +0,0 @@ - -
        - -
      • - -
      • - - - -
      • - -
      • - -
      - diff --git a/3.1/modules/database_info/helpers/database_info_block.php b/3.1/modules/database_info/helpers/database_info_block.php deleted file mode 100644 index af224421..00000000 --- a/3.1/modules/database_info/helpers/database_info_block.php +++ /dev/null @@ -1,36 +0,0 @@ - t("Database info")); - } - - static function get($block_id) { - $block = new Block(); - switch ($block_id) { - case "database_info": - $block->css_id = "g-database-info"; - $block->title = t("Database information"); - $block->content = new View("admin_block_db.html"); - break; - } - return $block; - } -} diff --git a/3.1/modules/database_info/module.info b/3.1/modules/database_info/module.info deleted file mode 100644 index 536a4cab..00000000 --- a/3.1/modules/database_info/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Database Info" -description = "View information about your Gallery 3 database on the admin dashboard." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:database_info" -discuss_url = "http://gallery.menalto.com/forum_module_database_info" diff --git a/3.1/modules/database_info/views/admin_block_db.html.php b/3.1/modules/database_info/views/admin_block_db.html.php deleted file mode 100644 index cf13d535..00000000 --- a/3.1/modules/database_info/views/admin_block_db.html.php +++ /dev/null @@ -1,18 +0,0 @@ - -query("SHOW TABLE STATUS"); - $database_size = 0; - foreach($tables as $table) { - $database_size += ($table->Data_length + $table->Index_length); - } - $database_size = $database_size / 1024 / 1024; -?> -
        -
      • - number_format($database_size, 2))) ?> -
      • -
      • - count($tables))) ?> -
      • -
      diff --git a/3.1/modules/developer/config/developer.php b/3.1/modules/developer/config/developer.php deleted file mode 100644 index e13f0167..00000000 --- a/3.1/modules/developer/config/developer.php +++ /dev/null @@ -1,54 +0,0 @@ - array("album_blocks" => t("Album block"), - "album_bottom" => t("Bottom of album content"), - "album_top" => t("Top of Album content"), - "admin_credits" => t("Administration page credits"), - "admin_footer" => t("Adminsitration page footer"), - "admin_header_top" => t("Top of administration page header"), - "admin_header_bottom" => t("Bottom of administration page header"), - "admin_page_bottom" => t("Bottom of administration page"), - "admin_page_top" => t("Top of administration page"), - "admin_head" => t("Adminstration page head"), - "body_attributes" => t("Body Attributes"), - "credits" => t("Album or photo page credits"), - "dynamic_bottom" => t("Bottom of dynamic page content"), - "dynamic_top" => t("Top of dynamic page content"), - "footer" => t("Album or photo page footer"), - "head" => t("Album or photo page head"), - "header_bottom" => t("Album or photo header bottom"), - "header_top" => t("Album or photo header top"), - "page_bottom" => t("Album or photo bottom"), - "page_top" => t("Album or photo top"), - "photo_blocks" => t("Photo block"), - "photo_bottom" => t("Bottom of photo content"), - "photo_top" => t("Top of photo content"), - "resize_bottom" => t("Bottom of the resize view"), - "resize_top" => t("Top of the resize view"), - "sidebar_bottom" => t("Bottom of sidebar"), - "sidebar_top" => t("Top of sidebar"), - "thumb_bottom" => t("Bottom of thumbnail"), - "thumb_info" => t("Thumbnail information"), - "thumb_top" => t("Top of thumbnail display"))); diff --git a/3.1/modules/developer/controllers/admin_developer.php b/3.1/modules/developer/controllers/admin_developer.php deleted file mode 100644 index 2d150697..00000000 --- a/3.1/modules/developer/controllers/admin_developer.php +++ /dev/null @@ -1,306 +0,0 @@ -content = new View("admin_developer.html"); - $view->content->title = t("Generate module"); - - if (!is_writable(MODPATH)) { - message::warning( - t("The module directory is not writable. Please ensure that it is writable by the web server")); - } - list ($form, $errors) = $this->_get_module_form(); - $view->content->developer_content = $this->_get_module_create_content($form, $errors); - print $view; - } - - public function test_data() { - $v = new Admin_View("admin.html"); - $v->content = new View("admin_developer.html"); - $v->content->title = t("Generate Test Data"); - - list ($form, $errors) = $this->_get_module_form(); - $v->content->developer_content = $this->_get_test_data_view($form, $errors); - print $v; - } - - public function module_create() { - access::verify_csrf(); - - list ($form, $errors) = $this->_get_module_form(); - - $post = new Validation($_POST); - $post->add_rules("name", "required"); - $post->add_rules("display_name", "required"); - $post->add_rules("description", "required"); - $post->add_callbacks("theme", array($this, "_noop_validation")); - $post->add_callbacks("event", array($this, "_noop_validation")); - $post->add_callbacks("name", array($this, "_is_module_defined")); - - if ($post->validate()) { - $task_def = Task_Definition::factory() - ->callback("developer_task::create_module") - ->description(t("Create a new module")) - ->name(t("Create Module")); - $success_msg = t("Generation of %module completed successfully", - array("module" => $post->name)); - $error_msg = t("Generation of %module failed.", array("module" => $post->name)); - $task_context = array("step" => 0, "success_msg" => $success_msg, "error_msg" => $error_msg); - $task = task::create($task_def, array_merge($task_context, $post->as_array())); - - json::reply(array("result" => "started", - "max_iterations" => 15, - "url" => url::site("admin/developer/run_task/{$task->id}?csrf=" . - access::csrf_token()), - "task" => $task->as_array())); - } else { - $v = $this->_get_module_create_content(arr::overwrite($form, $post->as_array()), - arr::overwrite($errors, $post->errors())); - json::reply(array("result" => "error", "html" => (string)$v)); - } - } - - public function _noop_validation(Validation $array, $field) { - } - - public function session($key) { - access::verify_csrf(); - $input = Input::instance(); - Session::instance()->set($key, $input->get("value")); - url::redirect($input->server("HTTP_REFERER")); - } - - public function test_data_create() { - list ($form, $errors) = $this->_get_test_data_form(); - - $post = new Validation($_POST); - $post->add_rules("albums", "numeric"); - $post->add_rules("photos", "numeric"); - $post->add_rules("comments", "numeric"); - $post->add_rules("tags", "numeric"); - $post->add_callbacks("albums", array($this, "_set_default")); - $post->add_callbacks("photos", array($this, "_set_default")); - $post->add_callbacks("comments", array($this, "_set_default")); - $post->add_callbacks("tags", array($this, "_set_default")); - - if ($post->validate()) { - $task_def = Task_Definition::factory() - ->callback("developer_task::create_content") - ->description(t("Create test content")) - ->name(t("Create Test Data")); - $total = $post->albums + $post->photos + $post->comments + $post->tags; - $success_msg = t("Successfully generated test data"); - $error_msg = t("Problems with test data generation was encountered"); - $task = task::create($task_def, array("total" => $total, "batch" => (int)ceil($total / 10), - "success_msg" => $success_msg, - "current" => 0, "error_msg" => $error_msg, - "albums" => $post->albums, "photos" => $post->photos, - "comments" => $post->comments, "tags" => $post->tags)); - batch::start(); - - json::reply(array("result" => "started", - "max_iterations" => $total + 5, - "url" => url::site("admin/developer/run_task/{$task->id}?csrf=" . - access::csrf_token()), - "task" => $task->as_array())); - } else { - $v = $this->_get_test_data_view(arr::overwrite($form, $post->as_array()), - arr::overwrite($errors, $post->errors())); - json::reply(array("result" => "error", "html" => (string)$v)); - } - } - - public function run_task($task_id) { - try { - $task = task::run($task_id); - } catch (Exception $e) { - $error_msg = $e->getMessage(); - $task->done = true; - } - - if ($task->done) { - batch::stop(); - $context = unserialize($task->context); - switch ($task->state) { - case "success": - message::success($context["success_msg"]); - break; - - case "error": - message::success(empty($error_msg) ? $context["error_msg"] : $error_msg); - break; - } - json::reply(array("result" => "success", "task" => $task->as_array())); - - } else { - json::reply(array("result" => "in_progress", "task" => $task->as_array())); - } - } - - function mptt() { - $v = new Admin_View("admin.html"); - $v->content = new View("mptt_tree.html"); - - $v->content->tree = $this->_build_tree(); - - if (exec("which /usr/bin/dot")) { - $v->content->url = url::site("admin/developer/mptt_graph"); - } else { - $v->content->url = null; - message::warning(t("The package 'graphviz' is not installed, degrading to text view")); - } - print $v; - } - - function mptt_graph() { - $items = ORM::factory("item")->order_by("id")->find_all(); - $data = $this->_build_tree(); - - $proc = proc_open("/usr/bin/dot -Tsvg", - array(array("pipe", "r"), - array("pipe", "w")), - $pipes, - VARPATH . "tmp"); - fwrite($pipes[0], $data); - fclose($pipes[0]); - - header("Content-Type: image/svg+xml"); - print(stream_get_contents($pipes[1])); - fclose($pipes[1]); - proc_close($proc); - } - - private function _build_tree() { - $items = ORM::factory("item")->order_by("id")->find_all(); - $data = "digraph G {\n"; - foreach ($items as $item) { - $data .= " $item->parent_id -> $item->id\n"; - $data .= - " $item->id [label=\"$item->id [$item->level] <$item->left_ptr, $item->right_ptr>\"]\n"; - } - $data .= "}\n"; - return $data; - } - - public function _is_module_defined(Validation $post, $field) { - $module_name = strtolower(strtr($post[$field], " ", "_")); - if (file_exists(MODPATH . "$module_name/module.info")) { - $post->add_error($field, "module_exists"); - } - } - - public function _set_default(Validation $post, $field) { - if (empty($post->$field)) { - $post->$field = 0; - } - } - - private function _get_module_form() { - $form = array("name" => "", "display_name" => "", "description" => "", "theme[]" => array(), - "event[]" => array()); - $errors = array_fill_keys(array_keys($form), ""); - - return array($form, $errors); - } - - private function _get_module_create_content($form, $errors) { - $config = Kohana::config("developer.methods"); - - $v = new View("developer_module.html"); - $v->action = "admin/developer/module_create"; - $v->theme = $config["theme"]; - $v->event = $this->_get_events(); - $v->form = $form; - $v->errors = $errors; - $submit_attributes = array( - "id" => "g-generate-module", - "name" => "generate", - "class" => "ui-state-default ui-corner-all", - "style" => "clear:both!important"); - - if (!is_writable(MODPATH)) { - $submit_attributes["class"] .= " ui-state-disabled"; - $submit_attributes["disabled"] = "disabled"; - } - $v->submit_attributes = $submit_attributes; - return $v; - } - - private function _get_events() { - if (empty(self::$event_list)) { - $dir = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator(MODPATH)); - foreach ($dir as $file) { - $file_as_string = file_get_contents($file); - if (preg_match_all('#module::event\("(.*?)"(.*)\);#mU', $file_as_string, $matches, PREG_SET_ORDER) > 0) { - foreach ($matches as $match) { - $event_name = $match[1]; - $display_name = ucwords(str_replace("_", " ", $event_name)); - if (!in_array($display_name, self::$event_list)) { - $parameters = array(); - if (!empty($match[2]) && - preg_match_all('#\$[a-zA-Z_]*#', $match[2], $param_names)) { - - foreach ($param_names[0] as $name) { - $parameters[] = $name != '$this' ? $name : '$' . $event_name; - } - } - self::$event_list["static function $event_name(" . implode(", ", $parameters) . ")"] = $display_name; - } - } - ksort(self::$event_list); - } - } - } - return self::$event_list; - } - - private function _get_test_data_form() { - $form = array("albums" => "10", "photos" => "10", "comments" => "10", "tags" => "10", - "generate_albums" => ""); - $errors = array_fill_keys(array_keys($form), ""); - - return array($form, $errors); - } - - private function _get_test_data_view($form, $errors) { - $v = new View("admin_developer_test_data.html"); - $v->action = "admin/developer/test_data_create"; - $album_count = ORM::factory("item")->where("type", "=", "album")->count_all(); - $photo_count = ORM::factory("item")->where("type", "=", "photo")->count_all(); - - $v->comment_installed = module::is_active("comment"); - $comment_count = empty($v->comment_installed) ? 0 : ORM::factory("comment")->count_all(); - - $v->tag_installed = module::is_active("tag"); - $tag_count = empty($v->tag_installed) ? 0 : ORM::factory("tag")->count_all(); - - $v->album_count = t2("%count album", "%count albums", $album_count); - $v->photo_count = t2("%count photo", "%count photos", $photo_count); - $v->comment_count = t2("%count comment", "%count comments", $comment_count); - $v->tag_count = t2("%count tag", "%count tags", $tag_count); - $v->form = $form; - $v->errors = $errors; - return $v; - } -} diff --git a/3.1/modules/developer/data/DSC_0003.jpg b/3.1/modules/developer/data/DSC_0003.jpg deleted file mode 100644 index 5780d9d8..00000000 Binary files a/3.1/modules/developer/data/DSC_0003.jpg and /dev/null differ diff --git a/3.1/modules/developer/data/DSC_0005.jpg b/3.1/modules/developer/data/DSC_0005.jpg deleted file mode 100644 index 4d2b53a9..00000000 Binary files a/3.1/modules/developer/data/DSC_0005.jpg and /dev/null differ diff --git a/3.1/modules/developer/data/DSC_0017.jpg b/3.1/modules/developer/data/DSC_0017.jpg deleted file mode 100644 index b7f7bb90..00000000 Binary files a/3.1/modules/developer/data/DSC_0017.jpg and /dev/null differ diff --git a/3.1/modules/developer/data/DSC_0019.jpg b/3.1/modules/developer/data/DSC_0019.jpg deleted file mode 100644 index 0ce25aa4..00000000 Binary files a/3.1/modules/developer/data/DSC_0019.jpg and /dev/null differ diff --git a/3.1/modules/developer/data/DSC_0067.jpg b/3.1/modules/developer/data/DSC_0067.jpg deleted file mode 100644 index 84f134cb..00000000 Binary files a/3.1/modules/developer/data/DSC_0067.jpg and /dev/null differ diff --git a/3.1/modules/developer/data/DSC_0072.jpg b/3.1/modules/developer/data/DSC_0072.jpg deleted file mode 100644 index dfad82b0..00000000 Binary files a/3.1/modules/developer/data/DSC_0072.jpg and /dev/null differ diff --git a/3.1/modules/developer/data/P4050088.jpg b/3.1/modules/developer/data/P4050088.jpg deleted file mode 100644 index 62f4749d..00000000 Binary files a/3.1/modules/developer/data/P4050088.jpg and /dev/null differ diff --git a/3.1/modules/developer/helpers/developer_event.php b/3.1/modules/developer/helpers/developer_event.php deleted file mode 100644 index 441fcd77..00000000 --- a/3.1/modules/developer/helpers/developer_event.php +++ /dev/null @@ -1,70 +0,0 @@ -id("developer_menu") - ->label(t("Developer tools")); - $menu->append($developer_menu); - - $developer_menu - ->append(Menu::factory("link") - ->id("generate_menu") - ->label(t("Generate module")) - ->url(url::site("admin/developer/module"))) - ->append(Menu::factory("link") - ->id("generate_data") - ->label(t("Generate test data")) - ->url(url::site("admin/developer/test_data"))) - ->append(Menu::factory("link") - ->id("mptt_tree_menu") - ->label(t("MPTT tree")) - ->url(url::site("admin/developer/mptt"))); - - $csrf = access::csrf_token(); - if (Session::instance()->get("profiler", false)) { - $developer_menu->append( - Menu::factory("link") - ->id("scaffold_profiler") - ->label(t("Profiling off")) - ->url(url::site("admin/developer/session/profiler?value=0&csrf=$csrf"))); - } else { - $developer_menu->append( - Menu::factory("link") - ->id("scaffold_profiler") - ->label(t("Profiling on")) - ->url(url::site("admin/developer/session/profiler?value=1&csrf=$csrf"))); - } - - if (Session::instance()->get("debug", false)) { - $developer_menu->append( - Menu::factory("link") - ->id("scaffold_debugger") - ->label(t("Debugging off")) - ->url(url::site("admin/developer/session/debug?value=0&csrf=$csrf"))); - } else { - $developer_menu->append( - Menu::factory("link") - ->id("scaffold_debugger") - ->label(t("Debugging on")) - ->url(url::site("admin/developer/session/debug?value=1&csrf=$csrf"))); - } - } -} diff --git a/3.1/modules/developer/helpers/developer_task.php b/3.1/modules/developer/helpers/developer_task.php deleted file mode 100644 index 2df2e526..00000000 --- a/3.1/modules/developer/helpers/developer_task.php +++ /dev/null @@ -1,335 +0,0 @@ -context); - - if (empty($context["module"])) { - $context["class_name"] = strtr($context["name"], " ", "_"); - $context["module"] = strtolower($context["class_name"]); - $context["module_path"] = (MODPATH . $context["module"]); - } - - switch ($context["step"]) { - case 0: // Create directory tree - foreach (array("", "controllers", "helpers", "views") as $dir) { - $path = "{$context['module_path']}/$dir"; - if (!file_exists($path)) { - mkdir($path); - chmod($path, 0755); - } - } - break; - case 1: // Generate installer - $context["installer"] = array(); - self::_render_helper_file($context, "installer"); - break; - case 2: // Generate theme helper - $context["theme"] = !isset($context["theme"]) ? array() : $context["theme"]; - self::_render_helper_file($context, "theme"); - break; - case 3: // Generate block helper - $context["block"] = array(); - self::_render_helper_file($context, "block"); - break; - case 4: // Generate event helper - self::_render_helper_file($context, "event"); - break; - case 5: // Generate admin controller - $file = "{$context['module_path']}/controllers/admin_{$context['module']}.php"; - ob_start(); - $v = new View("admin_controller.txt"); - $v->name = $context["name"]; - $v->module = $context["module"]; - $v->class_name = $context["class_name"]; - print $v->render(); - file_put_contents($file, ob_get_contents()); - ob_end_clean(); - break; - case 6: // Generate admin form - $file = "{$context['module_path']}/views/admin_{$context['module']}.html.php"; - ob_start(); - $v = new View("admin_html.txt"); - $v->name = $context["name"]; - $v->module = $context["module"]; - $v->css_id = preg_replace("#\s+#", "", $context["name"]); - print $v->render(); - file_put_contents($file, ob_get_contents()); - ob_end_clean(); - break; - case 7: // Generate controller - $file = "{$context['module_path']}/controllers/{$context['module']}.php"; - ob_start(); - $v = new View("controller.txt"); - $v->name = $context["name"]; - $v->module = $context["module"]; - $v->class_name = $context["class_name"]; - $v->css_id = preg_replace("#\s+#", "", $context["name"]); - print $v->render(); - file_put_contents($file, ob_get_contents()); - ob_end_clean(); - break; - case 8: // Generate sidebar block view - $file = "{$context['module_path']}/views/{$context['module']}_block.html.php"; - ob_start(); - $v = new View("block_html.txt"); - $v->name = $context["name"]; - $v->module = $context["module"]; - $v->class_name = $context["class_name"]; - $v->css_id = preg_replace("#\s+#", "", $context["name"]); - print $v->render(); - file_put_contents($file, ob_get_contents()); - ob_end_clean(); - break; - case 9: // Generate dashboard block view - $file = "{$context['module_path']}/views/admin_{$context['module']}_block.html.php"; - ob_start(); - $v = new View("dashboard_block_html.txt"); - $v->name = $context["name"]; - $v->module = $context["module"]; - $v->class_name = $context["class_name"]; - $v->css_id = preg_replace("#\s+#", "", $context["name"]); - print $v->render(); - file_put_contents($file, ob_get_contents()); - ob_end_clean(); - break; - case 10: // Generate module.info (do last) - $file = "{$context["module_path"]}/module.info"; - ob_start(); - $v = new View("module_info.txt"); - $v->module_name = $context["display_name"]; - $v->module_description = $context["description"]; - print $v->render(); - file_put_contents($file, ob_get_contents()); - ob_end_clean(); - break; - } - if (isset($file)) { - chmod($file, 0765); - } - $task->done = (++$context["step"]) >= 11; - $task->context = serialize($context); - $task->state = "success"; - $task->percent_complete = ($context["step"] / 11.0) * 100; - } - - private static function _render_helper_file($context, $helper) { - if (isset($context[$helper])) { - $config = Kohana::config("developer.methods"); - $file = "{$context["module_path"]}/helpers/{$context["module"]}_{$helper}.php"; - touch($file); - ob_start(); - $v = new View("$helper.txt"); - $v->helper = $helper; - $v->name = $context["name"]; - $v->module = $context["module"]; - $v->module_name = $context["name"]; - $v->css_id = strtr($context["name"], " ", ""); - $v->css_id = preg_replace("#\s#", "", $context["name"]); - $v->callbacks = empty($context[$helper]) ? array() : array_fill_keys($context[$helper], 1); - print $v->render(); - file_put_contents($file, ob_get_contents()); - ob_end_clean(); - } - } - - static function create_content($task) { - $context = unserialize($task->context); - $batch_cnt = $context["batch"]; - while ($context["albums"] > 0 && $batch_cnt > 0) { - set_time_limit(30); - self::_add_album_or_photo("album"); - - $context["current"]++; - $context["albums"]--; - $batch_cnt--; - } - while ($context["photos"] > 0 && $batch_cnt > 0) { - set_time_limit(30); - self::_add_album_or_photo(); - - $context["current"]++; - $context["photos"]--; - $batch_cnt--; - } - while ($context["comments"] > 0 && $batch_cnt > 0) { - self::_add_comment(); - $context["current"]++; - $context["comments"]--; - $batch_cnt--; - } - while ($context["tags"] > 0 && $batch_cnt > 0) { - self::_add_tag(); - $context["current"]++; - $context["tags"]--; - $batch_cnt--; - } - $task->done = $context["current"] >= $context["total"]; - $task->context = serialize($context); - $task->state = "success"; - $task->percent_complete = $context["current"] / $context["total"] * 100; - } - - private static function _add_album_or_photo($desired_type=null) { - srand(time()); - $parents = ORM::factory("item")->where("type", "=", "album")->find_all()->as_array(); - $owner_id = identity::active_user()->id; - - $test_images = glob(dirname(dirname(__FILE__)) . "/data/*.[Jj][Pp][Gg]"); - - $parent = $parents[array_rand($parents)]; - $parent->reload(); - $type = $desired_type; - if (!$type) { - $type = rand(0, 10) ? "photo" : "album"; - } - if ($type == "album") { - $thumb_size = module::get_var("core", "thumb_size"); - $rand = rand(); - $item = ORM::factory("item"); - $item->type = "album"; - $item->parent_id = $parent->id; - $item->name = "rnd_$rand"; - $item->title = "Rnd $rand"; - $item->description = "random album $rand"; - $item->owner_id = $owner_id; - $parents[] = $item->save(); - } else { - $photo_index = rand(0, count($test_images) - 1); - $item = ORM::factory("item"); - $item->type = "photo"; - $item->parent_id = $parent->id; - $item->set_data_file($test_images[$photo_index]); - $item->name = basename($test_images[$photo_index]); - $item->title = "rnd_" . rand(); - $item->description = "sample thumb"; - $item->owner_id = $owner_id; - $item->save(); - } - } - - private static function _add_comment() { - srand(time()); - $photos = ORM::factory("item")->where("type", "=", "photo")->find_all()->as_array(); - $users = ORM::factory("user")->find_all()->as_array(); - - if (empty($photos)) { - return; - } - - if (module::is_active("akismet")) { - akismet::$test_mode = 1; - } - - $photo = $photos[array_rand($photos)]; - $author = $users[array_rand($users)]; - $guest_name = ucfirst(self::_random_phrase(rand(1, 3))); - $guest_email = sprintf("%s@%s.com", self::_random_phrase(1), self::_random_phrase(1)); - $guest_url = sprintf("http://www.%s.com", self::_random_phrase(1)); - - $comment = ORM::factory("comment"); - $comment->author_id = $author->id; - $comment->item_id = $photo->id; - $comment->text = self::_random_phrase(rand(8, 500)); - $comment->guest_name = $guest_name; - $comment->guest_email = $guest_email; - $comment->guest_url = $guest_url; - $comment->save(); - } - - private static function _add_tag() { - $items = ORM::factory("item")->find_all()->as_array(); - - if (!empty($items)) { - $tags = self::_generateTags(); - - $tag_name = $tags[array_rand($tags)]; - $item = $items[array_rand($items)]; - - tag::add($item, $tag_name); - } - } - - private static function _random_phrase($count) { - static $words; - if (empty($words)) { - $sample_text = "Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium - laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi - architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas - sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione - voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit, - amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut - labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis - nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi - consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam - nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla - pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus, qui blanditiis - praesentium voluptatum deleniti atque corrupti, quos dolores et quas molestias excepturi - sint, obcaecati cupiditate non provident, similique sunt in culpa, qui officia deserunt - mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et - expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio, cumque - nihil impedit, quo minus id, quod maxime placeat, facere possimus, omnis voluptas - assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis - debitis aut rerum necessitatibus saepe eveniet, ut et voluptates repudiandae sint et - molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut - reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores - repellat."; - $words = preg_split('/\s+/', $sample_text); - } - - $chosen = array(); - for ($i = 0; $i < $count; $i++) { - $chosen[] = $words[array_rand($words)]; - } - - return implode(' ', $chosen); - } - - private static function _generateTags($number=10){ - // Words from lorem2.com - $words = explode( - " ", - "Lorem ipsum dolor sit amet consectetuer adipiscing elit Donec odio Quisque volutpat " . - "mattis eros Nullam malesuada erat ut turpis Suspendisse urna nibh viverra non " . - "semper suscipit posuere a pede Donec nec justo eget felis facilisis " . - "fermentum Aliquam porttitor mauris sit amet orci Aenean dignissim pellentesque " . - "felis Morbi in sem quis dui placerat ornare Pellentesque odio nisi euismod in " . - "pharetra a ultricies in diam Sed arcu Cras consequat Praesent dapibus neque " . - "id cursus faucibus tortor neque egestas augue eu vulputate magna eros eu " . - "erat Aliquam erat volutpat Nam dui mi tincidunt quis accumsan porttitor " . - "facilisis luctus metus Phasellus ultrices nulla quis nibh Quisque a " . - "lectus Donec consectetuer ligula vulputate sem tristique cursus Nam nulla quam " . - "gravida non commodo a sodales sit amet nisi Pellentesque fermentum " . - "dolor Aliquam quam lectus facilisis auctor ultrices ut elementum vulputate " . - "nunc Sed adipiscing ornare risus Morbi est est blandit sit amet sagittis vel " . - "euismod vel velit Pellentesque egestas sem Suspendisse commodo ullamcorper " . - "magna"); - - while ($number--) { - $results[] = $words[array_rand($words, 1)]; - } - return $results; - } -} \ No newline at end of file diff --git a/3.1/modules/developer/js/developer.js b/3.1/modules/developer/js/developer.js deleted file mode 100644 index 065a7316..00000000 --- a/3.1/modules/developer/js/developer.js +++ /dev/null @@ -1,42 +0,0 @@ -var module_success = function(data) { - $("#g-developer-admin").append('
      '); - $("#g-module-progress").progressbar(); - - var task = data.task; - var url = data.url; - var done = false; - var counter = 0; - var max_iterations = data.max_iterations; - while (!done) { - $.ajax({async: false, - success: function(data, textStatus) { - $("#g-module-progress").progressbar("value", data.task.percent_complete); - done = data.task.done; - }, - error: function(XMLHttpRequest, textStatus, errorThrown) { - done = true; - }, - dataType: "json", - type: "POST", - url: url - }); - // Leave this in as insurance that we never run away - done = done || ++counter > max_iterations; - } - document.location.reload(); -}; - -function ajaxify_developer_form(selector, success) { - $(selector).ajaxForm({ - dataType: "json", - success: function(data) { - if (data.form && data.result != "started") { - $(selector).replaceWith(data.form); - ajaxify_developer_form(selector, success); - } - if (data.result == "started") { - success(data); - } - } - }); -} diff --git a/3.1/modules/developer/module.info b/3.1/modules/developer/module.info deleted file mode 100644 index b62a6b60..00000000 --- a/3.1/modules/developer/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = Developer -description = "Tools to assist module and theme developers" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:developer" -discuss_url = "http://gallery.menalto.com/forum_module_developer" diff --git a/3.1/modules/developer/views/admin_controller.txt.php b/3.1/modules/developer/views/admin_controller.txt.php deleted file mode 100644 index a7e8fc58..00000000 --- a/3.1/modules/developer/views/admin_controller.txt.php +++ /dev/null @@ -1,57 +0,0 @@ - - -/** - * 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 Admin__Controller extends Admin_Controller { - public function index() { - print $this->_get_view(); - } - - public function handler() { - access::verify_csrf(); - - $form = $this->_get_form(); - if ($form->validate()) { - // @todo process the admin form - - message::success(t(" Adminstration Complete Successfully")); - - url::redirect("admin/"); - } - - print $this->_get_view($form); - } - - private function _get_view($form=null) { - $v = new Admin_View("admin.html"); - $v->content = new View("admin_.html"); - $v->content->form = empty($form) ? $this->_get_form() : $form; - return $v; - } - - private function _get_form() { - $form = new Forge("admin//handler", "", "post", - array("id" => "g-adminForm")); - $group = $form->group("group"); - $group->input("text")->label(t("Text"))->rules("required"); - $group->submit("submit")->value(t("Submit")); - - return $form; - } -} \ No newline at end of file diff --git a/3.1/modules/developer/views/admin_developer.html.php b/3.1/modules/developer/views/admin_developer.html.php deleted file mode 100644 index 4831f9ba..00000000 --- a/3.1/modules/developer/views/admin_developer.html.php +++ /dev/null @@ -1,13 +0,0 @@ - - - -
      -

      -
      - -
      -
      diff --git a/3.1/modules/developer/views/admin_developer_test_data.html.php b/3.1/modules/developer/views/admin_developer_test_data.html.php deleted file mode 100644 index a29027ba..00000000 --- a/3.1/modules/developer/views/admin_developer_test_data.html.php +++ /dev/null @@ -1,93 +0,0 @@ - - - "post", "id" => "g-generate-test-data")) ?> - -


      - - (, , , ) -

      - - -
      -
        -
      • -
      • class="g-error"> -
        - - "g-generate-albums", "name" => "generate_albums", "class" => "g-generate-checkbox", "style" => "display:inline", "checked" => !empty($form["generate_albums"])), ".g-radio-album") ?> - - - "album_$number", "name" => "albums", "style" => "display:inline", "checked" => $number == 10, "disabled" => true, "class" => "g-radio-album"), $number) ?> - -
        - -

        - -
      • -
      • class="g-error"> -
        - - "g-generate-photos", "name" => "generate_photos", "class" => "g-generate-checkbox", "style" => "display:inline", "checked" => !empty($form["generate_photos"])), ".g-radio-photo") ?> - - - "photo_$number", "name" => "photos", "style" => "display:inline", "checked" => $number == 10, "disabled" => true, "class" => "g-radio-photo"), $number) ?> - -
        - -

        - -
      • - -
      • class="g-error"> -
        - - "g-generate-comments", "name" => "generate_comments", "class" => "g-generate-checkbox", "style" => "display:inline", "checked" => !empty($form["generate_comments"])), ".g-radio-comment") ?> - - - "comment_$number", "name" => "comments", "style" => "display:inline", "checked" => $number == 10, "disabled" => true, "class" => "g-radio-comment"), $number) ?> - -
        - -

        - -
      • - - -
      • class="g-error"> -
        - - "g-generate-tags", "name" => "generate_tags", "class" => "g-generate-checkbox", "style" => "display:inline", "checked" => !empty($form["generate_tags"])), ".g-radio-tag") ?> - - - "tag_$number", "name" => "tags", "style" => "display:inline", "checked" => $number == 10, "disabled" => true, "class" => "g-radio-tag"), $number) ?> - -
        - -

        - -
      • - -
      • - "g-generate-data", "name" => "generate", "class" => "submit", "style" => "clear:both!important"), t("Generate")) ?> -
      • -
      -
      diff --git a/3.1/modules/developer/views/admin_html.txt.php b/3.1/modules/developer/views/admin_html.txt.php deleted file mode 100644 index 3d230d1c..00000000 --- a/3.1/modules/developer/views/admin_html.txt.php +++ /dev/null @@ -1,10 +0,0 @@ - -" ?> - -
      -

      - " ?> -

      - " ?> - -
      diff --git a/3.1/modules/developer/views/block.txt.php b/3.1/modules/developer/views/block.txt.php deleted file mode 100644 index 28a8d9db..00000000 --- a/3.1/modules/developer/views/block.txt.php +++ /dev/null @@ -1,53 +0,0 @@ - - - -/** - * 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 _block { - static function get_site_list() { - return array( - "" => t(" Sidebar Block")); - } - - static function get_admin_list() { - return array( - "" => t(" Dashboard Block")); - } - - static function get($block_id, $theme) { - $block = new Block(); - switch ($block_id) { - case "": - $block->css_id = "g--admin"; - $block->title = t(" Dashboard Block"); - $block->content = new View("admin__block.html"); - - $block->content->item = ORM::factory("item", 1); - break; - case "": - $block->css_id = "g--site"; - $block->title = t(" Sidebar Block"); - $block->content = new View("_block.html"); - - $block->content->item = ORM::factory("item", 1); - break; - } - return $block; - } -} diff --git a/3.1/modules/developer/views/block_html.txt.php b/3.1/modules/developer/views/block_html.txt.php deleted file mode 100644 index 9942259d..00000000 --- a/3.1/modules/developer/views/block_html.txt.php +++ /dev/null @@ -1,10 +0,0 @@ - -" ?> - -
      - url() ?>\">" ?> - - thumb_tag(array(\"class\" => \"g-thumbnail\")) ?>" ?> - - -
      diff --git a/3.1/modules/developer/views/controller.txt.php b/3.1/modules/developer/views/controller.txt.php deleted file mode 100644 index 664ff987..00000000 --- a/3.1/modules/developer/views/controller.txt.php +++ /dev/null @@ -1,50 +0,0 @@ - - -/** - * 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 _Controller extends Controller { - public function index() { - print $this->_get_form(); - } - - public function handler() { - access::verify_csrf(); - - $form = $this->_get_form(); - if ($form->validate()) { - // @todo process the admin form - - message::success(t(" Processing Successfully")); - - json::reply(array("result" => "success")); - } else { - json::reply(array("result" => "error", "html" => (string)$form)); - } - } - - private function _get_form() { - $form = new Forge("/handler", "", "post", - array("id" => "g--form")); - $group = $form->group("group")->label(t(" Handler")); - $group->input("text")->label(t("Text"))->rules("required"); - $group->submit("submit")->value(t("Submit")); - - return $form; - } -} diff --git a/3.1/modules/developer/views/dashboard_block_html.txt.php b/3.1/modules/developer/views/dashboard_block_html.txt.php deleted file mode 100644 index 8b1c8f5c..00000000 --- a/3.1/modules/developer/views/dashboard_block_html.txt.php +++ /dev/null @@ -1,10 +0,0 @@ - -" ?> - -
      - url() ?>\">" ?> - - thumb_tag(array(\"class\" => \"g-thumbnail\")) ?>" ?> - - -
      diff --git a/3.1/modules/developer/views/developer_module.html.php b/3.1/modules/developer/views/developer_module.html.php deleted file mode 100644 index 8552942a..00000000 --- a/3.1/modules/developer/views/developer_module.html.php +++ /dev/null @@ -1,49 +0,0 @@ - - - "post")) ?> -
      -
        -
      • -
      • class="g-error"> - - - -

        - - -

        - -
      • -
      • class="g-error"> - - - -

        - -
      • -
      • class="g-error"> - - - -

        - -
      • -
      • -
          -
        • - - "theme[]", "multiple" => true, "size" => 6), $theme, $form["theme[]"]) ?> -
        • -
        • - - "event[]", "multiple" => true, "size" => 6), $event, $form["event[]"]) ?> -
        • -
        -
      • -
      • - -
      • -
      -
      - - diff --git a/3.1/modules/developer/views/event.txt.php b/3.1/modules/developer/views/event.txt.php deleted file mode 100644 index 32a48520..00000000 --- a/3.1/modules/developer/views/event.txt.php +++ /dev/null @@ -1,27 +0,0 @@ - - -/** - * 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 _event { - $unused): ?> - { - } - - -} diff --git a/3.1/modules/developer/views/installer.txt.php b/3.1/modules/developer/views/installer.txt.php deleted file mode 100644 index cf6662d5..00000000 --- a/3.1/modules/developer/views/installer.txt.php +++ /dev/null @@ -1,37 +0,0 @@ - - -/** - * 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 _installer { - static function install() { - $version = module::get_version(""); - if ($version == 0) { - /* @todo Put database creation here */ - module::set_version("", 1); - } - } - - static function upgrade($version) { - } - - static function uninstall() { - /* @todo Put database table drops here */ - module::delete(""); - } -} diff --git a/3.1/modules/developer/views/module_info.txt.php b/3.1/modules/developer/views/module_info.txt.php deleted file mode 100644 index 0ea06e7c..00000000 --- a/3.1/modules/developer/views/module_info.txt.php +++ /dev/null @@ -1,6 +0,0 @@ - -name = - -description = "" - -version = 1 diff --git a/3.1/modules/developer/views/mptt_tree.html.php b/3.1/modules/developer/views/mptt_tree.html.php deleted file mode 100644 index db6d4ffd..00000000 --- a/3.1/modules/developer/views/mptt_tree.html.php +++ /dev/null @@ -1,15 +0,0 @@ - -
      -

      - -

      -
      - -
      - - -
      -
      - -
      -
      diff --git a/3.1/modules/developer/views/theme.txt.php b/3.1/modules/developer/views/theme.txt.php deleted file mode 100644 index e4467f43..00000000 --- a/3.1/modules/developer/views/theme.txt.php +++ /dev/null @@ -1,157 +0,0 @@ - - -/** - * 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 _theme { - - static function album_blocks($theme) { - } - - - - static function album_bottom($theme) { - } - - - - static function album_top($theme) { - } - - - - static function admin_credits($theme) { - } - - - - static function admin_footer($theme) { - } - - - - static function admin_header_top($theme) { - } - - - - static function admin_header_bottom($theme) { - } - - - - static function admin_page_bottom($theme) { - } - - - - static function admin_page_top($theme) { - } - - - - static function admin_head($theme) { - } - - - - static function credits($theme) { - } - - - - static function dynamic_bottom($theme) { - } - - - - static function dynamic_top($theme) { - } - - - - static function footer($theme) { - } - - - - static function head($theme) { - } - - - - static function header_bottom($theme) { - } - - - - static function header_top($theme) { - } - - - - static function page_bottom($theme) { - } - - - - static function page_top($theme) { - } - - - - static function photo_blocks($theme) { - } - - - - static function photo_bottom($theme) { - } - - - - static function photo_top($theme) { - } - - - - static function sidebar_bottom($theme) { - } - - - - static function sidebar_top($theme) { - } - - - - static function thumb_bottom($theme, $child) { - } - - - - static function thumb_info($theme, $child) { - } - - - - static function thumb_top($theme, $child) { - } - - -} diff --git a/3.1/modules/displaytags/helpers/displaytags_block.php b/3.1/modules/displaytags/helpers/displaytags_block.php deleted file mode 100644 index 8fc530f1..00000000 --- a/3.1/modules/displaytags/helpers/displaytags_block.php +++ /dev/null @@ -1,54 +0,0 @@ - t("Display Tags")); - } - - static function get($block_id, $theme) { - $block = ""; - - // Make sure the current page belongs to an item. - if (!$theme->item()) { - return; - } - - switch ($block_id) { - case "display_tags": - // Create an array of all the tags for the current item. - $tagsItem = ORM::factory("tag") - ->join("items_tags", "tags.id", "items_tags.tag_id") - ->where("items_tags.item_id", "=", $theme->item->id) - ->find_all(); - - // If the current item has at least one tag, display it/them. - if (count($tagsItem) > 0) { - $block = new Block(); - $block->css_id = "g-display-tags"; - $block->title = t("Tags"); - $block->content = new View("displaytags_block.html"); - $block->content->tags = $tagsItem; - } - - break; - } - return $block; - } -} diff --git a/3.1/modules/displaytags/helpers/displaytags_event.php b/3.1/modules/displaytags/helpers/displaytags_event.php deleted file mode 100644 index 7b92685e..00000000 --- a/3.1/modules/displaytags/helpers/displaytags_event.php +++ /dev/null @@ -1,37 +0,0 @@ -module == "tag") { - $data->messages["warn"][] = t("The DisplayTags module requires the Tags module."); - } - } - - static function module_change($changes) { - if (!module::is_active("tag") || in_array("tag", $changes->deactivate)) { - site_status::warning( - t("The DisplayTags module requires the Tags module. Activate the Tags module now", - array("url" => html::mark_clean(url::site("admin/modules")))), - "displaytags_needs_tag"); - } else { - site_status::clear("displaytags_needs_tag"); - } - } -} diff --git a/3.1/modules/displaytags/helpers/displaytags_installer.php b/3.1/modules/displaytags/helpers/displaytags_installer.php deleted file mode 100644 index 808def8a..00000000 --- a/3.1/modules/displaytags/helpers/displaytags_installer.php +++ /dev/null @@ -1,36 +0,0 @@ - -
      - - - - name) ?> - -
      diff --git a/3.1/modules/downloadalbum/controllers/downloadalbum.php b/3.1/modules/downloadalbum/controllers/downloadalbum.php deleted file mode 100644 index d11adcff..00000000 --- a/3.1/modules/downloadalbum/controllers/downloadalbum.php +++ /dev/null @@ -1,300 +0,0 @@ -is_album()) { - throw new Kohana_Exception('container is not an album: '.$container->relative_path()); - } - - $zipname = (empty($container->name)) - ? 'Gallery.zip' // @todo purified_version_of($container->title).'.zip' - : $container->name.'.zip'; - break; - - case "tag": - // @todo: if the module is not installed, it crash - $container = ORM::factory("tag", $id); - if (is_null($container->name)) { - throw new Kohana_Exception('container is not a tag: '.$id); - } - - $zipname = $container->name.'.zip'; - break; - - default: - throw new Kohana_Exception('unhandled container type: '.$container_type); - } - - $files = $this->getFilesList($container); - - // Calculate ZIP size (look behind for details) - $zipsize = 22; - foreach($files as $f_name => $f_path) { - $zipsize += 76 + 2*strlen($f_name) + filesize($f_path); - } - - // Send headers - $this->prepareOutput(); - $this->sendHeaders($zipname, $zipsize); - - // Generate and send ZIP file - // http://www.pkware.com/documents/casestudies/APPNOTE.TXT (v6.3.2) - $lfh_offset = 0; - $cds = ''; - $cds_offset = 0; - foreach($files as $f_name => $f_path) { - $f_namelen = strlen($f_name); - $f_size = filesize($f_path); - $f_mtime = $this->unix2dostime(filemtime($f_path)); - $f_crc32 = $this->fixBug45028(hexdec(hash_file('crc32b', $f_path, false))); - - // Local file header - echo pack('VvvvVVVVvva' . $f_namelen, - 0x04034b50, // local file header signature (4 bytes) - 0x0a, // version needed to extract (2 bytes) => 1.0 - 0x0800, // general purpose bit flag (2 bytes) => UTF-8 - 0x00, // compression method (2 bytes) => store - $f_mtime, // last mod file time and date (4 bytes) - $f_crc32, // crc-32 (4 bytes) - $f_size, // compressed size (4 bytes) - $f_size, // uncompressed size (4 bytes) - $f_namelen, // file name length (2 bytes) - 0, // extra field length (2 bytes) - - $f_name // file name (variable size) - // extra field (variable size) => n/a - ); - - // File data - readfile($f_path); - - // Data descriptor (n/a) - - // Central directory structure: File header - $cds .= pack('VvvvvVVVVvvvvvVVa' . $f_namelen, - 0x02014b50, // central file header signature (4 bytes) - 0x031e, // version made by (2 bytes) => v3 / Unix - 0x0a, // version needed to extract (2 bytes) => 1.0 - 0x0800, // general purpose bit flag (2 bytes) => UTF-8 - 0x00, // compression method (2 bytes) => store - $f_mtime, // last mod file time and date (4 bytes) - $f_crc32, // crc-32 (4 bytes) - $f_size, // compressed size (4 bytes) - $f_size, // uncompressed size (4 bytes) - $f_namelen, // file name length (2 bytes) - 0, // extra field length (2 bytes) - 0, // file comment length (2 bytes) - 0, // disk number start (2 bytes) - 0, // internal file attributes (2 bytes) - 0x81b40000, // external file attributes (4 bytes) => chmod 664 - $lfh_offset, // relative offset of local header (4 bytes) - - $f_name // file name (variable size) - // extra field (variable size) => n/a - // file comment (variable size) => n/a - ); - - // Update local file header/central directory structure offset - $cds_offset = $lfh_offset += 30 + $f_namelen + $f_size; - } - - // Archive decryption header (n/a) - // Archive extra data record (n/a) - - // Central directory structure: Digital signature (n/a) - echo $cds; // send Central directory structure - - // Zip64 end of central directory record (n/a) - // Zip64 end of central directory locator (n/a) - - // End of central directory record - $numfile = count($files); - $cds_len = strlen($cds); - echo pack('VvvvvVVv', - 0x06054b50, // end of central dir signature (4 bytes) - 0, // number of this disk (2 bytes) - 0, // number of the disk with the start of - // the central directory (2 bytes) - $numfile, // total number of entries in the - // central directory on this disk (2 bytes) - $numfile, // total number of entries in the - // central directory (2 bytes) - $cds_len, // size of the central directory (4 bytes) - $cds_offset, // offset of start of central directory - // with respect to the - // starting disk number (4 bytes) - 0 // .ZIP file comment length (2 bytes) - // .ZIP file comment (variable size) - ); - } - - - /** - * Return the files that must be included in the archive. - */ - private function getFilesList($container) { - $files = array(); - - if( $container instanceof Item_Model && $container->is_album() ) { - $container_realpath = realpath($container->file_path().'/../'); - - $items = $container->viewable() - ->descendants(null, null, array(array("type", "<>", "album"))); - foreach($items as $i) { - if (!access::can('view_full', $i)) { - continue; - } - - $i_realpath = realpath($i->file_path()); - if (!is_readable($i_realpath)) { - continue; - } - - $i_relative_path = str_replace($container_realpath.DIRECTORY_SEPARATOR, '', $i_realpath); - $i_relative_path = str_replace(DIRECTORY_SEPARATOR, '/', $i_relative_path); - $files[$i_relative_path] = $i_realpath; - } - - } else if( $container instanceof Tag_Model ) { - $items = $container->items(); - foreach($items as $i) { - if (!access::can('view_full', $i)) { - continue; - } - - if( $i->is_album() ) { - foreach($this->getFilesList($i) as $f_name => $f_path) { - $files[$container->name.'/'.$f_name] = $f_path; - } - - } else { - $i_realpath = realpath($i->file_path()); - if (!is_readable($i_realpath)) { - continue; - } - - $i_relative_path = $container->name.'/'.$i->name; - $files[$i_relative_path] = $i_realpath; - } - } - } - - if (count($files) === 0) { - throw new Kohana_Exception('no zippable files in ['.$container->name.']'); - } - - return $files; - } - - - /** - * See system/helpers/download.php - */ - private function prepareOutput() { - // Close output buffers - Kohana::close_buffers(FALSE); - // Clear any output - Event::add('system.display', create_function('', 'Kohana::$output = "";')); - } - - /** - * See system/helpers/download.php - */ - private function sendHeaders($filename, $filesize = null) { - if (!is_null($filesize)) { - header('Content-Length: '.$filesize); - } - - // Retrieve MIME type by extension - $mime = Kohana::config('mimes.'.strtolower(substr(strrchr($filename, '.'), 1))); - $mime = empty($mime) ? 'application/octet-stream' : $mime[0]; - header("Content-Type: $mime"); - header('Content-Transfer-Encoding: binary'); - - // Send headers necessary to invoke a "Save As" dialog - header('Content-Disposition: attachment; filename="'.$filename.'"'); - - // Prevent caching - header('Expires: Thu, 01 Jan 1970 00:00:00 GMT'); - - $pragma = 'no-cache'; - $cachecontrol = 'no-cache, max-age=0'; - - // request::user_agent('browser') seems bugged - if (request::user_agent('browser') === 'Internet Explorer' - || stripos(request::user_agent(), 'msie') !== false - || stripos(request::user_agent(), 'internet explorer') !== false) - { - if (request::protocol() === 'https') { - // See http://support.microsoft.com/kb/323308/en-us - $pragma = 'cache'; - $cachecontrol = 'private'; - - } else if (request::user_agent('version') <= '6.0') { - $pragma = ''; - $cachecontrol = 'must-revalidate, post-check=0, pre-check=0'; - } - } - - header('Pragma: '.$pragma); - header('Cache-Control: '.$cachecontrol); - } - - /** - * @return integer DOS date and time - * @param integer _timestamp Unix timestamp - * @desc returns DOS date and time of the timestamp - */ - private function unix2dostime($timestamp) - { - $timebit = getdate($timestamp); - - if ($timebit['year'] < 1980) { - return (1 << 21 | 1 << 16); - } - - $timebit['year'] -= 1980; - - return ($timebit['year'] << 25 | $timebit['mon'] << 21 | - $timebit['mday'] << 16 | $timebit['hours'] << 11 | - $timebit['minutes'] << 5 | $timebit['seconds'] >> 1); - } - - /** - * See http://bugs.php.net/bug.php?id=45028 - */ - private function fixBug45028($hash) { - $output = $hash; - - if( version_compare(PHP_VERSION, '5.2.7', '<') ) { - $str = str_pad(dechex($hash), 8, '0', STR_PAD_LEFT); - $output = hexdec($str{6}.$str{7}.$str{4}.$str{5}.$str{2}.$str{3}.$str{0}.$str{1}); - } - - return $output; - } -} diff --git a/3.1/modules/downloadalbum/css/downloadalbum_menu.css b/3.1/modules/downloadalbum/css/downloadalbum_menu.css deleted file mode 100644 index e3c4c67e..00000000 --- a/3.1/modules/downloadalbum/css/downloadalbum_menu.css +++ /dev/null @@ -1,3 +0,0 @@ -#g-view-menu #g-download-album-link { - background-image: url('../images/ico-view-downloadalbum.png'); -} diff --git a/3.1/modules/downloadalbum/helpers/downloadalbum_event.php b/3.1/modules/downloadalbum/helpers/downloadalbum_event.php deleted file mode 100644 index e8159003..00000000 --- a/3.1/modules/downloadalbum/helpers/downloadalbum_event.php +++ /dev/null @@ -1,40 +0,0 @@ -item->id}"); - $menu - ->append(Menu::factory("link") - ->id("downloadalbum") - ->label(t("Download Album")) - ->url($downloadLink) - ->css_id("g-download-album-link")); - } - - static function tag_menu($menu, $theme) { - $downloadLink = url::site("downloadalbum/zip/tag/{$theme->tag()->id}"); - $menu - ->append(Menu::factory("link") - ->id("downloadalbum") - ->label(t("Download Album")) - ->url($downloadLink) - ->css_id("g-download-album-link")); - } -} diff --git a/3.1/modules/downloadalbum/helpers/downloadalbum_theme.php b/3.1/modules/downloadalbum/helpers/downloadalbum_theme.php deleted file mode 100644 index 8cda59fc..00000000 --- a/3.1/modules/downloadalbum/helpers/downloadalbum_theme.php +++ /dev/null @@ -1,24 +0,0 @@ -css("downloadalbum_menu.css"); - } -} diff --git a/3.1/modules/downloadalbum/images/ico-view-downloadalbum.png b/3.1/modules/downloadalbum/images/ico-view-downloadalbum.png deleted file mode 100644 index ce7804d2..00000000 Binary files a/3.1/modules/downloadalbum/images/ico-view-downloadalbum.png and /dev/null differ diff --git a/3.1/modules/downloadalbum/module.info b/3.1/modules/downloadalbum/module.info deleted file mode 100644 index f547fd4a..00000000 --- a/3.1/modules/downloadalbum/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "DownloadAlbum" -description = "Displays a link to download a ZIP archive of the current album." -version = 2 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:downloadalbum" -discuss_url = "http://gallery.menalto.com/forum_module_downloadalbum" diff --git a/3.1/modules/downloadfullsize/controllers/admin_downloadfullsize.php b/3.1/modules/downloadfullsize/controllers/admin_downloadfullsize.php deleted file mode 100644 index 6836c9c8..00000000 --- a/3.1/modules/downloadfullsize/controllers/admin_downloadfullsize.php +++ /dev/null @@ -1,93 +0,0 @@ -content = new View("admin_downloadfullsize.html"); - $view->content->downloadlinks_form = $this->_get_admin_form(); - print $view; - } - - public function saveprefs() { - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Figure out which boxes where checked - $dlLinks_array = Input::instance()->post("DownloadLinkOptions"); - $fButton = false; - $download_original_button = false; - for ($i = 0; $i < count($dlLinks_array); $i++) { - if ($dlLinks_array[$i] == "fButton") { - $fButton = true; - } - } - - if (module::is_active("keeporiginal")) { - $keeporiginal_array = Input::instance()->post("DownloadOriginalOptions"); - for ($i = 0; $i < count($keeporiginal_array); $i++) { - if ($keeporiginal_array[$i] == "DownloadOriginalImage") { - $download_original_button = true; - } - } - module::set_var("downloadfullsize", "DownloadOriginalImage", $download_original_button); - } - - // Save Settings. - module::set_var("downloadfullsize", "fButton", $fButton); - message::success(t("Your Selection Has Been Saved.")); - - // Load Admin page. - $view = new Admin_View("admin.html"); - $view->content = new View("admin_downloadfullsize.html"); - $view->content->downloadlinks_form = $this->_get_admin_form(); - print $view; - - } - - private function _get_admin_form() { - // Make a new Form. - $form = new Forge("admin/downloadfullsize/saveprefs", "", "post", - array("id" => "g-download-fullsize-adminForm")); - - // Make an array for the different types of download links. - $linkOptions["fButton"] = array(t("Show Floppy Disk Picture Link"), module::get_var("downloadfullsize", "fButton")); - - // Setup a few checkboxes on the form. - $add_links = $form->group("DownloadLinks"); - $add_links->checklist("DownloadLinkOptions") - ->options($linkOptions); - - if (module::is_active("keeporiginal")) { - $KeepOriginalOptions["DownloadOriginalImage"] = array(t("Allow visitors to download the original image when available?"), module::get_var("downloadfullsize", "DownloadOriginalImage")); - $keeporiginal_group = $form->group("KeepOriginalPrefs") - ->label(t("KeepOriginal Preferences")); - $keeporiginal_group->checklist("DownloadOriginalOptions") - ->options($KeepOriginalOptions); - } - - // Add a save button to the form. - $form->submit("SaveLinks")->value(t("Save")); - - // Return the newly generated form. - return $form; - } -} \ No newline at end of file diff --git a/3.1/modules/downloadfullsize/controllers/downloadfullsize.php b/3.1/modules/downloadfullsize/controllers/downloadfullsize.php deleted file mode 100644 index b678a1a8..00000000 --- a/3.1/modules/downloadfullsize/controllers/downloadfullsize.php +++ /dev/null @@ -1,37 +0,0 @@ -is_photo() && module::get_var("downloadfullsize", "DownloadOriginalImage")) { - $original_image = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item->file_path()); - if (file_exists($original_image)) { - download::force($original_image); - } else { - download::force($item->file_path()); - } - } else { - download::force($item->file_path()); - } - } -} diff --git a/3.1/modules/downloadfullsize/css/downloadfullsize_menu.css b/3.1/modules/downloadfullsize/css/downloadfullsize_menu.css deleted file mode 100644 index a608a66a..00000000 --- a/3.1/modules/downloadfullsize/css/downloadfullsize_menu.css +++ /dev/null @@ -1,3 +0,0 @@ -#g-view-menu #g-download-fullsize-link { - background-image: url('../images/ico-view-downloadfullsize.png'); -} diff --git a/3.1/modules/downloadfullsize/helpers/downloadfullsize_block.php b/3.1/modules/downloadfullsize/helpers/downloadfullsize_block.php deleted file mode 100644 index 50e9558d..00000000 --- a/3.1/modules/downloadfullsize/helpers/downloadfullsize_block.php +++ /dev/null @@ -1,51 +0,0 @@ - t("Download Item")); - } - - static function get($block_id, $theme) { - $item = $theme->item; - switch ($block_id) { - case "downloadfullsize": - - // If Item is movie then... - if ($item && $item->is_movie() && access::can("view_full", $item)) { - $block = new Block(); - $block->css_id = "g-download-fullsize"; - $block->title = t("Download Movie"); - $block->content = new View("downloadfullsize_block.html"); - return $block; - } - - // If Item is photo then... - if ($item && $item->is_photo() && access::can("view_full", $item)) { - $block = new Block(); - $block->css_id = "g-download-fullsize"; - $block->title = t("Download Photo"); - $block->content = new View("downloadfullsize_block.html"); - return $block; - } - } - return ""; - } - -} diff --git a/3.1/modules/downloadfullsize/helpers/downloadfullsize_event.php b/3.1/modules/downloadfullsize/helpers/downloadfullsize_event.php deleted file mode 100644 index a9aa86e2..00000000 --- a/3.1/modules/downloadfullsize/helpers/downloadfullsize_event.php +++ /dev/null @@ -1,57 +0,0 @@ -item)) { - if (module::get_var("downloadfullsize", "fButton")) { - $downloadLink = url::site("downloadfullsize/send/{$theme->item->id}"); - $menu - ->append(Menu::factory("link") - ->id("downloadfullsize") - ->label(t("Download Fullsize Image")) - ->url($downloadLink) - ->css_id("g-download-fullsize-link")); - } - } - } - - static function movie_menu($menu, $theme) { - if (access::can("view_full", $theme->item)) { - if (module::get_var("downloadfullsize", "fButton")) { - $downloadLink = url::site("downloadfullsize/send/{$theme->item->id}"); - $menu - ->append(Menu::factory("link") - ->id("downloadfullsize") - ->label(t("Download Video")) - ->url($downloadLink) - ->css_id("g-download-fullsize-link")); - } - } - } - - static function admin_menu($menu, $theme) { - $menu->get("settings_menu") - ->append(Menu::factory("link") - ->id("downloadfullsize") - ->label(t("Download Photo Links")) - ->url(url::site("admin/downloadfullsize"))); - } - -} diff --git a/3.1/modules/downloadfullsize/images/ico-view-downloadfullsize.png b/3.1/modules/downloadfullsize/images/ico-view-downloadfullsize.png deleted file mode 100644 index ce7804d2..00000000 Binary files a/3.1/modules/downloadfullsize/images/ico-view-downloadfullsize.png and /dev/null differ diff --git a/3.1/modules/downloadfullsize/module.info b/3.1/modules/downloadfullsize/module.info deleted file mode 100644 index 078371a9..00000000 --- a/3.1/modules/downloadfullsize/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "DownloadFullsize" -description = "Displays a link to download the fullsize version of the current photo." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:downloadfullsize" -discuss_url = "http://gallery.menalto.com/forum_module_downloadfullsize" diff --git a/3.1/modules/downloadfullsize/views/admin_downloadfullsize.html.php b/3.1/modules/downloadfullsize/views/admin_downloadfullsize.html.php deleted file mode 100644 index 5dc5cef6..00000000 --- a/3.1/modules/downloadfullsize/views/admin_downloadfullsize.html.php +++ /dev/null @@ -1,5 +0,0 @@ - -
      -

      - -
      diff --git a/3.1/modules/downloadfullsize/views/downloadfullsize_block.html.php b/3.1/modules/downloadfullsize/views/downloadfullsize_block.html.php deleted file mode 100644 index a9ccc2a6..00000000 --- a/3.1/modules/downloadfullsize/views/downloadfullsize_block.html.php +++ /dev/null @@ -1,18 +0,0 @@ - - -item->is_photo()) { ?> - - - -item->is_movie()) { ?> - - - diff --git a/3.1/modules/dynamic/controllers/admin_dynamic.php b/3.1/modules/dynamic/controllers/admin_dynamic.php deleted file mode 100644 index 0f87329f..00000000 --- a/3.1/modules/dynamic/controllers/admin_dynamic.php +++ /dev/null @@ -1,81 +0,0 @@ -_get_view(); - } - - public function handler() { - access::verify_csrf(); - - $form = $this->_get_form(); - if ($form->validate()) { - foreach (array("updates", "popular") as $album) { - $album_defn = unserialize(module::get_var("dynamic", $album)); - $group = $form->inputs[$album]; - $album_defn->enabled = $group->inputs["{$album}_enabled"]->value; - $album_defn->description = $group->inputs["{$album}_description"]->value; - $album_defn->limit = $group->inputs["{$album}_limit"] === "" ? null : - $group->inputs["{$album}_limit"]->value; - module::set_var("dynamic", $album, serialize($album_defn)); - } - - message::success(t("Dynamic Albums Configured")); - - url::redirect("admin/dynamic"); - } - - print $this->_get_view($form); - } - - private function _get_view($form=null) { - $v = new Admin_View("admin.html"); - $v->content = new View("admin_dynamic.html"); - $v->content->form = empty($form) ? $this->_get_form() : $form; - return $v; - } - - private function _get_form() { - - $form = new Forge("admin/dynamic/handler", "", "post", - array("id" => "g-admin-form")); - - foreach (array("updates", "popular") as $album) { - $album_defn = unserialize(module::get_var("dynamic", $album)); - - $group = $form->group($album)->label(t($album_defn->title)); - $group->checkbox("{$album}_enabled") - ->label(t("Enable")) - ->value(1) - ->checked($album_defn->enabled); - $group->input("{$album}_limit") - ->label(t("Limit (leave empty for unlimited)")) - ->value(empty($album_defn->limit) ? "" : $album_defn->limit) - ->rules("valid_numeric"); - $group->textarea("{$album}_description") - ->label(t("Description")) - ->rules("length[0,2048]") - ->value($album_defn->description); - } - - $form->submit("submit")->value(t("Submit")); - - return $form; - } -} \ No newline at end of file diff --git a/3.1/modules/dynamic/controllers/dynamic.php b/3.1/modules/dynamic/controllers/dynamic.php deleted file mode 100644 index 6d7e3062..00000000 --- a/3.1/modules/dynamic/controllers/dynamic.php +++ /dev/null @@ -1,66 +0,0 @@ -_show("updates", t("Recent changes")); - } - - public function popular() { - print $this->_show("popular", t("Most viewed")); - } - - private function _show($album) { - $page_size = module::get_var("gallery", "page_size", 9); - $page = Input::instance()->get("page", "1"); - - $album_defn = unserialize(module::get_var("dynamic", $album)); - $children_count = $album_defn->limit; - if (empty($children_count)) { - $children_count = ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->count_all(); - } - - $offset = ($page-1) * $page_size; - - $max_pages = ceil($children_count / $page_size); - - // Make sure that the page references a valid offset - if ($page < 1 || ($children_count && $page > ceil($children_count / $page_size))) { - throw new Kohana_404_Exception(); - } - - $template = new Theme_View("page.html", "collection", "dynamic"); - $template->set_global("page", $page); - $template->set_global("page_size", $page_size); - $template->set_global("max_pages", $max_pages); - $template->set_global("children", ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->order_by($album_defn->key_field, "DESC") - ->find_all($page_size, $offset)); - $template->set_global("children_count", $children_count); - $template->content = new View("dynamic.html"); - $template->content->title = t($album_defn->title); - - print $template; - } - -} \ No newline at end of file diff --git a/3.1/modules/dynamic/helpers/dynamic_block.php b/3.1/modules/dynamic/helpers/dynamic_block.php deleted file mode 100644 index bf7dcd8f..00000000 --- a/3.1/modules/dynamic/helpers/dynamic_block.php +++ /dev/null @@ -1,47 +0,0 @@ - t("Dynamic Albums")); - } - - static function get($block_id) { - switch ($block_id) { - case "dynamic": - $albums = array(); - foreach (array("updates", "popular") as $album) { - $album_defn = unserialize(module::get_var("dynamic", $album)); - if ($album_defn->enabled) { - $albums[$album] = $album_defn->title; - } - } - - if (!empty($albums)) { - $block = new Block(); - $block->css_id = "g-dynamic"; - $block->title = t("Dynamic Albums"); - $block->content = new View("dynamic_block.html"); - $block->content->albums = $albums; - return $block; - } - } - return ""; - } - -} diff --git a/3.1/modules/dynamic/helpers/dynamic_event.php b/3.1/modules/dynamic/helpers/dynamic_event.php deleted file mode 100644 index ab4c6c9a..00000000 --- a/3.1/modules/dynamic/helpers/dynamic_event.php +++ /dev/null @@ -1,27 +0,0 @@ -get("content_menu") - ->append(Menu::factory("link") - ->id("dynamic_menu") - ->label(t("Dynamic Albums")) - ->url(url::site("admin/dynamic"))); - } -} diff --git a/3.1/modules/dynamic/helpers/dynamic_installer.php b/3.1/modules/dynamic/helpers/dynamic_installer.php deleted file mode 100644 index c83479bb..00000000 --- a/3.1/modules/dynamic/helpers/dynamic_installer.php +++ /dev/null @@ -1,40 +0,0 @@ - false, - "limit" => null, - "description" => "", - "key_field" => "view_count", - "title" => t("Most viewed")))); - module::set_var( - "dynamic", "updates", - serialize((object)array("enabled" => false, - "limit" => null, - "description" => "", - "key_field" => "created", - "title" => t("Recent changes")))); - module::set_version("dynamic", 1); - } - } -} diff --git a/3.1/modules/dynamic/module.info b/3.1/modules/dynamic/module.info deleted file mode 100644 index 3e2bae30..00000000 --- a/3.1/modules/dynamic/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Dynamic" -description = "Adds the Recent Changes and Most Viewed dynamic albums" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:dynamic" -discuss_url = "http://gallery.menalto.com/forum_module_dynamic" diff --git a/3.1/modules/dynamic/views/admin_dynamic.html.php b/3.1/modules/dynamic/views/admin_dynamic.html.php deleted file mode 100644 index b810de01..00000000 --- a/3.1/modules/dynamic/views/admin_dynamic.html.php +++ /dev/null @@ -1,8 +0,0 @@ - -
      -

      - -
      - -
      -
      diff --git a/3.1/modules/dynamic/views/dynamic_block.html.php b/3.1/modules/dynamic/views/dynamic_block.html.php deleted file mode 100644 index febf5d3f..00000000 --- a/3.1/modules/dynamic/views/dynamic_block.html.php +++ /dev/null @@ -1,10 +0,0 @@ - -
      -
        - $text): ?> -
      • - "> -
      • - -
      -
      diff --git a/3.1/modules/ecard/controllers/admin_ecard.php b/3.1/modules/ecard/controllers/admin_ecard.php deleted file mode 100644 index 1608b0e1..00000000 --- a/3.1/modules/ecard/controllers/admin_ecard.php +++ /dev/null @@ -1,84 +0,0 @@ -page_title = t("eCard settings"); - $view->content = new View("admin_ecard.html"); - $view->content->form = $this->_get_admin_form(); - print $view; - } - - public function save() { - access::verify_csrf(); - $form = $this->_get_admin_form(); - if ($form->validate()) { - module::set_var("ecard","send_plain",$form->ecard->send_plain->value); - module::set_var("ecard", "sender", $form->ecard->sender->value); - module::set_var("ecard", "bcc", $form->ecard->bcc->value); - module::set_var("ecard", "subject", $form->ecard->subject->value); - module::set_var("ecard", "message", $form->ecard->message->value); - module::set_var("ecard", "max_length", $form->ecard->max_length->value); - module::set_var("ecard", "access_permissions", $form->ecard->access_permissions->value); - module::set_var("ecard", "location", $form->ecard->location->value); - message::success(t("eCard settings updated")); - url::redirect("admin/ecard"); - } else { - print $form; - } - } - - private function _get_admin_form() { - $form = new Forge("admin/ecard/save", "", "post", array("id" => "g-ecard-admin-form")); - $ecard_settings = $form->group("ecard")->label(t("eCard settings")); - $ecard_settings->input("sender") - ->label(t("E-mail sender (leave blank for a user-defined address)")) - ->value(module::get_var("ecard", "sender", "")); - $ecard_settings->input("bcc") - ->label(t("BCC (optional)")) - ->value(module::get_var("ecard", "bcc", "")); - $ecard_settings->input("subject")->label(t("E-mail subject")) - ->value(module::get_var("ecard", "subject")); - $ecard_settings->textarea("message")->label(t("E-mail message. Valid keywords are \"%fromname\" (sender's name))")) - ->value(module::get_var("ecard", "message")); - $ecard_settings->input("max_length") - ->label(t("Maximum message length")) - ->value(module::get_var("ecard","max_length")); - if(module::is_active("watermark")) { - $ecard_settings->checkbox("send_plain") - ->label(t("Allow users to send non-watermarked versions")) - ->value(true) - ->checked(module::get_var("ecard","send_plain")); - } - $ecard_settings->dropdown("access_permissions") - ->label(t("Who can send eCards?")) - ->options(array("everybody" => t("Everybody"), - "registered_users" => t("Only registered users"))) - ->selected(module::get_var("ecard", "access_permissions")); - $ecard_settings->dropdown("location") - ->label(t("Where should the eCard link be displayed?")) - ->options(array("top" => t("At the top of the sidebar as an icon"), - "sidebar" => t("In the sidebar as a button"))) - ->selected(module::get_var("ecard", "location")); - $ecard_settings->submit("save")->value(t("Save")); - return $form; - } -} - diff --git a/3.1/modules/ecard/controllers/ecard.php b/3.1/modules/ecard/controllers/ecard.php deleted file mode 100644 index 21a87080..00000000 --- a/3.1/modules/ecard/controllers/ecard.php +++ /dev/null @@ -1,122 +0,0 @@ -validate(); - } catch (ORM_Validation_Exception $e) { - // Translate ORM validation errors into form error messages - foreach ($e->validation->errors() as $key => $error) { - $form->edit_item->inputs[$key]->add_error($error, 1); - } - $valid = false; - } - - if ($valid) { - $to_array = explode(",",$form->send_ecard->inputs["to_email"]->value); - foreach($to_array as $to) { - $v = new View("ecard_email.html"); - $v->item = $item; - $v->subject = module::get_var("ecard", "subject"); - $from_name = $form->send_ecard->from_name->value; - $bcc = module::get_var("ecard", "bcc"); - if($form->send_ecard->send_to_self->checked == true) { - $cc = $form->send_ecard->inputs["from_email"]->value; - } - $v->message = t(module::get_var("ecard", "message"), array("fromname" => $from_name)); - $v->custom_message = $form->send_ecard->text->value; - $v->image = $item->name; - $from = $form->send_ecard->inputs["from_email"]->value; - $headers = array("from" => $from_name."<".$from.">", "to" => $to, "subject" => module::get_var("ecard", "subject")); - require_once(MODPATH. "ecard/lib/mime.php"); - $mime = new Mail_mime("\n"); - $mime->setHTMLBody($v->render()); - if($form->send_ecard->send_fresh->checked == true) { - $tmpfile = tempnam(TMPPATH, "clean"); - if($form->send_ecard->send_thumbnail->checked == true) { - $options = array("width" => module::get_var("gallery", "thumb_size"), "height" => module::get_var("gallery", "thumb_size"), "master" => Image::AUTO); - gallery_graphics::resize($item->file_path(), $tmpfile, $options, $item); - $mime->addHTMLImage($tmpfile,$item->mime_type,$item->name); - } else { - $options = array("width" => module::get_var("gallery", "resize_size"), "height" => module::get_var("gallery", "resize_size"), "master" => Image::AUTO); - gallery_graphics::resize($item->file_path(), $tmpfile, $options, $item); - $mime->addHTMLImage($tmpfile,$item->mime_type,$item->name); - } - } else { - if($form->send_ecard->send_thumbnail->checked == true) { - $mime->addHTMLImage($item->thumb_path(),$item->mime_type,$item->name); - } else { - $mime->addHTMLImage($item->resize_path(),$item->mime_type,$item->name); - } - } - $body = $mime->get(array('html_charset' => 'UTF-8', 'text_charset' => 'UTF-8','text_encoding' => '8bit','head_charset' => 'UTF-8')); - self::_notify($headers['to'], $headers['from'], $headers['subject'], $item, $body, $mime->headers(), $bcc, $cc); - } - unlink($tmpfile); - message::success("eCard successfully sent"); - json::reply(array("result" => "success")); - } else { - json::reply(array("result" => "error", "html" => (string) $form)); - } - } - /** - * Present a form for sending a new ecard. - */ - public function form_send($item_id) { - $item = ORM::factory("item", $item_id); - access::required("view", $item); - if (!ecard::can_send_ecard()) { - access::forbidden(); - } - $v_form = new View("ecard_form.html"); - $v_form->item_id = $item_id; - print $v_form->render(); - } - private static function _notify($to, $from, $subject, $item, $text, $headers, $bcc, $cc) { - $sendmail = Sendmail::factory(); - $sendmail - ->to($to) - ->from($from) - ->subject($subject); - if(isset($bcc)) { - $sendmail->header("bcc",$bcc); - } - if(isset($cc)) { - $sendmail->header("cc",$cc); - } - foreach($headers as $key => $value) { - $sendmail->header($key,$value); - } - $sendmail - ->message($text) - ->send(); - return; - } -} diff --git a/3.1/modules/ecard/css/ecard.css b/3.1/modules/ecard/css/ecard.css deleted file mode 100644 index 89a86669..00000000 --- a/3.1/modules/ecard/css/ecard.css +++ /dev/null @@ -1,7 +0,0 @@ -#g-send-ecard { - width: 16px; - height: 16px; - float: left; - margin-right: .2em; - background-image: url(../images/email_go.png); -} diff --git a/3.1/modules/ecard/helpers/ecard.php b/3.1/modules/ecard/helpers/ecard.php deleted file mode 100644 index a786521b..00000000 --- a/3.1/modules/ecard/helpers/ecard.php +++ /dev/null @@ -1,89 +0,0 @@ - "g-ecard-form")); - $group = $form->group("send_ecard")->label(t("Send eCard")); - $group->input("from_name") - ->label(t("Your name")) - ->id("g-author") - ->rules("required") - ->error_messages("required", t("You must enter a name for yourself")); - $group->input("from_email") - ->label(t("Your e-mail")) - ->id("g-email") - ->rules("required|valid_email") - ->error_messages("required", t("You must enter a valid email address")) - ->error_messages("invalid", t("You must enter a valid email address")); - $group->input("to_email") - ->label(t("Recipient's e-mail. Separate multiple recipients with a comma.")) - ->id("g-recip-email") - ->rules("required") - ->error_messages("required", t("You must enter a valid email address")); - $group->textarea("text") - ->label(t("Message (".module::get_var("ecard","max_length")." chars max)")) - ->id("g-text") - ->maxlength(module::get_var("ecard","max_length")) - ->rules("required") - ->error_messages("required", t("You must enter a message")); - $group->checkbox("send_to_self") - ->label(t("Send yourself a copy")) - ->value(true) - ->checked(false); - $group->checkbox("send_thumbnail") - ->label(t("Send thumbnail image, instead of resized image.")) - ->value(true) - ->checked(false); - if(module::get_var("ecard","send_plain") == true && module::is_active("watermark")) { - $group->checkbox("send_fresh") - ->label(t("Send non-watermarked image.")) - ->value(true) - ->checked(false); - } - $group->hidden("item_id")->value($item_id); - module::event("ecard_send_form", $form); - module::event("captcha_protect_form", $form); - $group->submit("")->value(t("Send"))->class("ui-state-default ui-corner-all"); - - return $form; - } - - static function prefill_send_form($form) { - $active = identity::active_user(); - if (!$active->guest) { - $group = $form->send_ecard; - $group->inputs["from_name"]->value($active->full_name); - $group->from_email->value($active->email); - } - return $form; - } - - static function can_send_ecard() { - return !identity::active_user()->guest || - module::get_var("ecard", "access_permissions") == "everybody"; - } -} - diff --git a/3.1/modules/ecard/helpers/ecard_block.php b/3.1/modules/ecard/helpers/ecard_block.php deleted file mode 100644 index d90755ab..00000000 --- a/3.1/modules/ecard/helpers/ecard_block.php +++ /dev/null @@ -1,39 +0,0 @@ - t("eCard")); - } - - static function get($block_id, $theme) { - $block = ""; - switch ($block_id) { - case "ecard": - if ($theme->item() && $theme->item()->is_photo() && module::get_var("ecard", "location") == "sidebar") { - $block = new Block(); - $block->css_id = "g-sendecard"; - $block->title = t("eCard"); - $block->content = new View("ecard_block.html"); - } - break; - } - return $block; - } -} \ No newline at end of file diff --git a/3.1/modules/ecard/helpers/ecard_installer.php b/3.1/modules/ecard/helpers/ecard_installer.php deleted file mode 100644 index 8464be49..00000000 --- a/3.1/modules/ecard/helpers/ecard_installer.php +++ /dev/null @@ -1,52 +0,0 @@ -css("ecard.css"); - } -} \ No newline at end of file diff --git a/3.1/modules/ecard/images/email_go.png b/3.1/modules/ecard/images/email_go.png deleted file mode 100644 index 4a6c5d39..00000000 Binary files a/3.1/modules/ecard/images/email_go.png and /dev/null differ diff --git a/3.1/modules/ecard/lib/mime.php b/3.1/modules/ecard/lib/mime.php deleted file mode 100644 index 50616189..00000000 --- a/3.1/modules/ecard/lib/mime.php +++ /dev/null @@ -1,912 +0,0 @@ - | -// | Tomas V.V.Cox (port to PEAR) | -// +-----------------------------------------------------------------------+ -// - -if (!class_exists('Mail_mimePart')) { - require_once(MODPATH . "ecard/lib/mimePart.php"); -} -if (class_exists('Mail_mime')) return; - -/** - * Mime mail composer class. Can handle: text and html bodies, embedded html - * images and attachments. - * Documentation and examples of this class are avaible here: - * http://pear.php.net/manual/ - * - * @notes This class is based on HTML Mime Mail class from - * Richard Heyes which was based also - * in the mime_mail.class by Tobias Ratschiller and - * Sascha Schumann - * - * @author Richard Heyes - * @author Tomas V.V.Cox - * @package Mail - * @access public - */ -class Mail_mime -{ - /** - * Contains the plain text part of the email - * @var string - */ - var $_txtbody; - /** - * Contains the html part of the email - * @var string - */ - var $_htmlbody; - /** - * contains the mime encoded text - * @var string - */ - var $_mime; - /** - * contains the multipart content - * @var string - */ - var $_multipart; - /** - * list of the attached images - * @var array - */ - var $_html_images = array(); - /** - * list of the attachements - * @var array - */ - var $_parts = array(); - /** - * Build parameters - * @var array - */ - var $_build_params = array(); - /** - * Headers for the mail - * @var array - */ - var $_headers = array(); - /** - * End Of Line sequence (for serialize) - * @var string - */ - var $_eol; - - - /** - * Constructor function - * - * @access public - */ - function Mail_mime($crlf = "\r\n") - { - $this->_setEOL($crlf); - $this->_build_params = array( - 'head_encoding' => 'quoted-printable', - 'text_encoding' => '7bit', - 'html_encoding' => 'quoted-printable', - '7bit_wrap' => 998, - 'html_charset' => 'ISO-8859-1', - 'text_charset' => 'ISO-8859-1', - 'head_charset' => 'ISO-8859-1' - ); - } - - /** - * Wakeup (unserialize) - re-sets EOL constant - * - * @access private - */ - function __wakeup() - { - $this->_setEOL($this->_eol); - } - - /** - * Accessor function to set the body text. Body text is used if - * it's not an html mail being sent or else is used to fill the - * text/plain part that emails clients who don't support - * html should show. - * - * @param string $data Either a string or - * the file name with the contents - * @param bool $isfile If true the first param should be treated - * as a file name, else as a string (default) - * @param bool $append If true the text or file is appended to - * the existing body, else the old body is - * overwritten - * @return mixed true on success or PEAR_Error object - * @access public - */ - function setTXTBody($data, $isfile = false, $append = false) - { - if (!$isfile) { - if (!$append) { - $this->_txtbody = $data; - } else { - $this->_txtbody .= $data; - } - } else { - $cont = $this->_file2str($data); - if (!isset($cont) /*PEAR::isError($cont)*/) { - return $cont; - } - if (!$append) { - $this->_txtbody = $cont; - } else { - $this->_txtbody .= $cont; - } - } - return true; - } - - /** - * Adds a html part to the mail - * - * @param string $data Either a string or the file name with the - * contents - * @param bool $isfile If true the first param should be treated - * as a file name, else as a string (default) - * @return mixed true on success or PEAR_Error object - * @access public - */ - function setHTMLBody($data, $isfile = false) - { - if (!$isfile) { - $this->_htmlbody = $data; - } else { - $cont = $this->_file2str($data); - if (!isset($cont) /*PEAR::isError($cont)*/) { - return $cont; - } - $this->_htmlbody = $cont; - } - - return true; - } - - /** - * Adds an image to the list of embedded images. - * - * @param string $file The image file name OR image data itself - * @param string $c_type The content type - * @param string $name The filename of the image. - * Only use if $file is the image data - * @param bool $isfilename Whether $file is a filename or not - * Defaults to true - * @return mixed true on success or PEAR_Error object - * @access public - */ - function addHTMLImage($file, $c_type='application/octet-stream', - $name = '', $isfilename = true) - { - $filedata = ($isfilename === true) ? $this->_file2str($file) - : $file; - if ($isfilename === true) { - $filename = ($name == '' ? $file : $name); - } else { - $filename = $name; - } - if (!isset($filedata) /*PEAR::isError($filedata)*/) { - return $filedata; - } - $this->_html_images[] = array( - 'body' => $filedata, - 'name' => $filename, - 'c_type' => $c_type, - 'cid' => md5(uniqid(time())) - ); - return true; - } - - /** - * Adds a file to the list of attachments. - * - * @param string $file The file name of the file to attach - * OR the file contents itself - * @param string $c_type The content type - * @param string $name The filename of the attachment - * Only use if $file is the contents - * @param bool $isFilename Whether $file is a filename or not - * Defaults to true - * @param string $encoding The type of encoding to use. - * Defaults to base64. - * Possible values: 7bit, 8bit, base64, - * or quoted-printable. - * @param string $disposition The content-disposition of this file - * Defaults to attachment. - * Possible values: attachment, inline. - * @param string $charset The character set used in the filename - * of this attachment. - * @return mixed true on success or PEAR_Error object - * @access public - */ - function addAttachment($file, $c_type = 'application/octet-stream', - $name = '', $isfilename = true, - $encoding = 'base64', - $disposition = 'attachment', $charset = '') - { - $filedata = ($isfilename === true) ? $this->_file2str($file) - : $file; - if ($isfilename === true) { - // Force the name the user supplied, otherwise use $file - $filename = (!empty($name)) ? $name : $file; - } else { - $filename = $name; - } - if (empty($filename)) { - $err = null; /*PEAR::raiseError( - "The supplied filename for the attachment can't be empty" - );*/ - return $err; - } - $filename = basename($filename); - if (!isset($filedata) /*PEAR::isError($filedata)*/) { - return $filedata; - } - - $this->_parts[] = array( - 'body' => $filedata, - 'name' => $filename, - 'c_type' => $c_type, - 'encoding' => $encoding, - 'charset' => $charset, - 'disposition' => $disposition - ); - return true; - } - - /** - * Get the contents of the given file name as string - * - * @param string $file_name path of file to process - * @return string contents of $file_name - * @access private - */ - function &_file2str($file_name) - { - if (!is_readable($file_name)) { - $err = null; //PEAR::raiseError('File is not readable ' . $file_name); - return $err; - } - if (!$fd = fopen($file_name, 'rb')) { - $err = null; //PEAR::raiseError('Could not open ' . $file_name); - return $err; - } - $filesize = filesize($file_name); - if ($filesize == 0){ - $cont = ""; - }else{ - if ($magic_quote_setting = get_magic_quotes_runtime()){ - @set_magic_quotes_runtime(0); - } - $cont = fread($fd, $filesize); - if ($magic_quote_setting){ - @set_magic_quotes_runtime($magic_quote_setting); - } - } - fclose($fd); - return $cont; - } - - /** - * Adds a text subpart to the mimePart object and - * returns it during the build process. - * - * @param mixed The object to add the part to, or - * null if a new object is to be created. - * @param string The text to add. - * @return object The text mimePart object - * @access private - */ - function &_addTextPart(&$obj, $text) - { - $params['content_type'] = 'text/plain'; - $params['encoding'] = $this->_build_params['text_encoding']; - $params['charset'] = $this->_build_params['text_charset']; - if (is_object($obj)) { - $ret = $obj->addSubpart($text, $params); - return $ret; - } else { - $ret = new Mail_mimePart($text, $params); - return $ret; - } - } - - /** - * Adds a html subpart to the mimePart object and - * returns it during the build process. - * - * @param mixed The object to add the part to, or - * null if a new object is to be created. - * @return object The html mimePart object - * @access private - */ - function &_addHtmlPart(&$obj) - { - $params['content_type'] = 'text/html'; - $params['encoding'] = $this->_build_params['html_encoding']; - $params['charset'] = $this->_build_params['html_charset']; - if (is_object($obj)) { - $ret = $obj->addSubpart($this->_htmlbody, $params); - return $ret; - } else { - $ret = new Mail_mimePart($this->_htmlbody, $params); - return $ret; - } - } - - /** - * Creates a new mimePart object, using multipart/mixed as - * the initial content-type and returns it during the - * build process. - * - * @return object The multipart/mixed mimePart object - * @access private - */ - function &_addMixedPart() - { - $params['content_type'] = 'multipart/mixed'; - $ret = new Mail_mimePart('', $params); - return $ret; - } - - /** - * Adds a multipart/alternative part to a mimePart - * object (or creates one), and returns it during - * the build process. - * - * @param mixed The object to add the part to, or - * null if a new object is to be created. - * @return object The multipart/mixed mimePart object - * @access private - */ - function &_addAlternativePart(&$obj) - { - $params['content_type'] = 'multipart/alternative'; - if (is_object($obj)) { - return $obj->addSubpart('', $params); - } else { - $ret = new Mail_mimePart('', $params); - return $ret; - } - } - - /** - * Adds a multipart/related part to a mimePart - * object (or creates one), and returns it during - * the build process. - * - * @param mixed The object to add the part to, or - * null if a new object is to be created - * @return object The multipart/mixed mimePart object - * @access private - */ - function &_addRelatedPart(&$obj) - { - $params['content_type'] = 'multipart/related'; - if (is_object($obj)) { - return $obj->addSubpart('', $params); - } else { - $ret = new Mail_mimePart('', $params); - return $ret; - } - } - - /** - * Adds an html image subpart to a mimePart object - * and returns it during the build process. - * - * @param object The mimePart to add the image to - * @param array The image information - * @return object The image mimePart object - * @access private - */ - function &_addHtmlImagePart(&$obj, $value) - { - $params['content_type'] = $value['c_type'] . '; ' . - 'name="' . $value['name'] . '"'; - $params['encoding'] = 'base64'; - $params['disposition'] = 'inline'; - $params['dfilename'] = $value['name']; - $params['cid'] = $value['cid']; - $ret = $obj->addSubpart($value['body'], $params); - return $ret; - - } - - /** - * Adds an attachment subpart to a mimePart object - * and returns it during the build process. - * - * @param object The mimePart to add the image to - * @param array The attachment information - * @return object The image mimePart object - * @access private - */ - function &_addAttachmentPart(&$obj, $value) - { - $params['dfilename'] = $value['name']; - $params['encoding'] = $value['encoding']; - if ($value['disposition'] != "inline") { - $fname = array("fname" => $value['name']); - $fname_enc = $this->_encodeHeaders($fname); - $params['dfilename'] = $fname_enc['fname']; - } - if ($value['charset']) { - $params['charset'] = $value['charset']; - } - $params['content_type'] = $value['c_type'] . '; ' . - 'name="' . $params['dfilename'] . '"'; - $params['disposition'] = isset($value['disposition']) ? - $value['disposition'] : 'attachment'; - $ret = $obj->addSubpart($value['body'], $params); - return $ret; - } - - /** - * Returns the complete e-mail, ready to send using an alternative - * mail delivery method. Note that only the mailpart that is made - * with Mail_Mime is created. This means that, - * YOU WILL HAVE NO TO: HEADERS UNLESS YOU SET IT YOURSELF - * using the $xtra_headers parameter! - * - * @param string $separation The separation etween these two parts. - * @param array $build_params The Build parameters passed to the - * &get() function. See &get for more info. - * @param array $xtra_headers The extra headers that should be passed - * to the &headers() function. - * See that function for more info. - * @param bool $overwrite Overwrite the existing headers with new. - * @return string The complete e-mail. - * @access public - */ - function getMessage($separation = null, $build_params = null, $xtra_headers = null, $overwrite = false) - { - if ($separation === null) - { - $separation = MAIL_MIME_CRLF; - } - $body = $this->get($build_params); - $head = $this->txtHeaders($xtra_headers, $overwrite); - $mail = $head . $separation . $body; - return $mail; - } - - - /** - * Builds the multipart message from the list ($this->_parts) and - * returns the mime content. - * - * @param array Build parameters that change the way the email - * is built. Should be associative. Can contain: - * head_encoding - What encoding to use for the headers. - * Options: quoted-printable or base64 - * Default is quoted-printable - * text_encoding - What encoding to use for plain text - * Options: 7bit, 8bit, base64, or quoted-printable - * Default is 7bit - * html_encoding - What encoding to use for html - * Options: 7bit, 8bit, base64, or quoted-printable - * Default is quoted-printable - * 7bit_wrap - Number of characters before text is - * wrapped in 7bit encoding - * Default is 998 - * html_charset - The character set to use for html. - * Default is iso-8859-1 - * text_charset - The character set to use for text. - * Default is iso-8859-1 - * head_charset - The character set to use for headers. - * Default is iso-8859-1 - * @return string The mime content - * @access public - */ - function &get($build_params = null) - { - if (isset($build_params)) { - while (list($key, $value) = each($build_params)) { - $this->_build_params[$key] = $value; - } - } - - if (!empty($this->_html_images) AND isset($this->_htmlbody)) { - foreach ($this->_html_images as $key => $value) { - $regex = array(); - $regex[] = '#(\s)((?i)src|background|href(?-i))\s*=\s*(["\']?)' . - preg_quote($value['name'], '#') . '\3#'; - $regex[] = '#(?i)url(?-i)\(\s*(["\']?)' . - preg_quote($value['name'], '#') . '\1\s*\)#'; - $rep = array(); - $rep[] = '\1\2=\3cid:' . $value['cid'] .'\3'; - $rep[] = 'url(\1cid:' . $value['cid'] . '\2)'; - $this->_htmlbody = preg_replace($regex, $rep, - $this->_htmlbody - ); - $this->_html_images[$key]['name'] = basename($this->_html_images[$key]['name']); - } - } - - $null = null; - $attachments = !empty($this->_parts) ? true : false; - $html_images = !empty($this->_html_images) ? true : false; - $html = !empty($this->_htmlbody) ? true : false; - $text = (!$html AND !empty($this->_txtbody)) ? true : false; - - switch (true) { - case $text AND !$attachments: - $message =& $this->_addTextPart($null, $this->_txtbody); - break; - - case !$text AND !$html AND $attachments: - $message =& $this->_addMixedPart(); - for ($i = 0; $i < count($this->_parts); $i++) { - $this->_addAttachmentPart($message, $this->_parts[$i]); - } - break; - - case $text AND $attachments: - $message =& $this->_addMixedPart(); - $this->_addTextPart($message, $this->_txtbody); - for ($i = 0; $i < count($this->_parts); $i++) { - $this->_addAttachmentPart($message, $this->_parts[$i]); - } - break; - - case $html AND !$attachments AND !$html_images: - if (isset($this->_txtbody)) { - $message =& $this->_addAlternativePart($null); - $this->_addTextPart($message, $this->_txtbody); - $this->_addHtmlPart($message); - } else { - $message =& $this->_addHtmlPart($null); - } - break; - - case $html AND !$attachments AND $html_images: - if (isset($this->_txtbody)) { - $message =& $this->_addAlternativePart($null); - $this->_addTextPart($message, $this->_txtbody); - $related =& $this->_addRelatedPart($message); - } else { - $message =& $this->_addRelatedPart($null); - $related =& $message; - } - $this->_addHtmlPart($related); - for ($i = 0; $i < count($this->_html_images); $i++) { - $this->_addHtmlImagePart($related, $this->_html_images[$i]); - } - break; - - case $html AND $attachments AND !$html_images: - $message =& $this->_addMixedPart(); - if (isset($this->_txtbody)) { - $alt =& $this->_addAlternativePart($message); - $this->_addTextPart($alt, $this->_txtbody); - $this->_addHtmlPart($alt); - } else { - $this->_addHtmlPart($message); - } - for ($i = 0; $i < count($this->_parts); $i++) { - $this->_addAttachmentPart($message, $this->_parts[$i]); - } - break; - - case $html AND $attachments AND $html_images: - $message =& $this->_addMixedPart(); - if (isset($this->_txtbody)) { - $alt =& $this->_addAlternativePart($message); - $this->_addTextPart($alt, $this->_txtbody); - $rel =& $this->_addRelatedPart($alt); - } else { - $rel =& $this->_addRelatedPart($message); - } - $this->_addHtmlPart($rel); - for ($i = 0; $i < count($this->_html_images); $i++) { - $this->_addHtmlImagePart($rel, $this->_html_images[$i]); - } - for ($i = 0; $i < count($this->_parts); $i++) { - $this->_addAttachmentPart($message, $this->_parts[$i]); - } - break; - - } - - if (isset($message)) { - $output = $message->encode(); - $this->_headers = array_merge($this->_headers, - $output['headers']); - $body = $output['body']; - return $body; - - } else { - $ret = false; - return $ret; - } - } - - /** - * Returns an array with the headers needed to prepend to the email - * (MIME-Version and Content-Type). Format of argument is: - * $array['header-name'] = 'header-value'; - * - * @param array $xtra_headers Assoc array with any extra headers. - * Optional. - * @param bool $overwrite Overwrite already existing headers. - * @return array Assoc array with the mime headers - * @access public - */ - function &headers($xtra_headers = null, $overwrite = false) - { - // Content-Type header should already be present, - // So just add mime version header - $headers['MIME-Version'] = '1.0'; - if (isset($xtra_headers)) { - $headers = array_merge($headers, $xtra_headers); - } - if ($overwrite){ - $this->_headers = array_merge($this->_headers, $headers); - }else{ - $this->_headers = array_merge($headers, $this->_headers); - } - - $encodedHeaders = $this->_encodeHeaders($this->_headers); - return $encodedHeaders; - } - - /** - * Get the text version of the headers - * (usefull if you want to use the PHP mail() function) - * - * @param array $xtra_headers Assoc array with any extra headers. - * Optional. - * @param bool $overwrite Overwrite the existing heaers with new. - * @return string Plain text headers - * @access public - */ - function txtHeaders($xtra_headers = null, $overwrite = false) - { - $headers = $this->headers($xtra_headers, $overwrite); - $ret = ''; - foreach ($headers as $key => $val) { - $ret .= "$key: $val" . MAIL_MIME_CRLF; - } - return $ret; - } - - /** - * Sets the Subject header - * - * @param string $subject String to set the subject to - * access public - */ - function setSubject($subject) - { - $this->_headers['Subject'] = $subject; - } - - /** - * Set an email to the From (the sender) header - * - * @param string $email The email direction to add - * @access public - */ - function setFrom($email) - { - $this->_headers['From'] = $email; - } - - /** - * Add an email to the Cc (carbon copy) header - * (multiple calls to this method are allowed) - * - * @param string $email The email direction to add - * @access public - */ - function addCc($email) - { - if (isset($this->_headers['Cc'])) { - $this->_headers['Cc'] .= ", $email"; - } else { - $this->_headers['Cc'] = $email; - } - } - - /** - * Add an email to the Bcc (blank carbon copy) header - * (multiple calls to this method are allowed) - * - * @param string $email The email direction to add - * @access public - */ - function addBcc($email) - { - if (isset($this->_headers['Bcc'])) { - $this->_headers['Bcc'] .= ", $email"; - } else { - $this->_headers['Bcc'] = $email; - } - } - - /** - * Since the PHP send function requires you to specifiy - * recipients (To: header) separately from the other - * headers, the To: header is not properly encoded. - * To fix this, you can use this public method to - * encode your recipients before sending to the send - * function - * - * @param string $recipients A comma-delimited list of recipients - * @return string Encoded data - * @access public - */ - function encodeRecipients($recipients) - { - $input = array("To" => $recipients); - $retval = $this->_encodeHeaders($input); - return $retval["To"] ; - } - - /** - * Encodes a header as per RFC2047 - * - * @param array $input The header data to encode - * @return array Encoded data - * @access private - */ - function _encodeHeaders($input) - { - foreach ($input as $hdr_name => $hdr_value) { - if (function_exists('iconv_mime_encode') && preg_match('#[\x80-\xFF]{1}#', $hdr_value)){ - $imePref = array(); - if ($this->_build_params['head_encoding'] == 'base64'){ - $imePrefs['scheme'] = 'B'; - }else{ - $imePrefs['scheme'] = 'Q'; - } - $imePrefs['input-charset'] = $this->_build_params['head_charset']; - $imePrefs['output-charset'] = $this->_build_params['head_charset']; - $hdr_value = iconv_mime_encode($hdr_name, $hdr_value, $imePrefs); - $hdr_value = preg_replace("#^{$hdr_name}\:\ #", "", $hdr_value); - }elseif (preg_match('#[\x80-\xFF]{1}#', $hdr_value)){ - //This header contains non ASCII chars and should be encoded. - switch ($this->_build_params['head_encoding']) { - case 'base64': - //Base64 encoding has been selected. - - //Generate the header using the specified params and dynamicly - //determine the maximum length of such strings. - //75 is the value specified in the RFC. The -2 is there so - //the later regexp doesn't break any of the translated chars. - $prefix = '=?' . $this->_build_params['head_charset'] . '?B?'; - $suffix = '?='; - $maxLength = 75 - strlen($prefix . $suffix) - 2; - $maxLength1stLine = $maxLength - strlen($hdr_name); - - //Base64 encode the entire string - $hdr_value = base64_encode($hdr_value); - - //This regexp will break base64-encoded text at every - //$maxLength but will not break any encoded letters. - $reg1st = "|.{0,$maxLength1stLine}[^\=][^\=]|"; - $reg2nd = "|.{0,$maxLength}[^\=][^\=]|"; - break; - case 'quoted-printable': - default: - //quoted-printable encoding has been selected - - //Generate the header using the specified params and dynamicly - //determine the maximum length of such strings. - //75 is the value specified in the RFC. The -2 is there so - //the later regexp doesn't break any of the translated chars. - $prefix = '=?' . $this->_build_params['head_charset'] . '?Q?'; - $suffix = '?='; - $maxLength = 75 - strlen($prefix . $suffix) - 2; - $maxLength1stLine = $maxLength - strlen($hdr_name); - - //Replace all special characters used by the encoder. - $search = array("=", "_", "?", " "); - $replace = array("=3D", "=5F", "=3F", "_"); - $hdr_value = str_replace($search, $replace, $hdr_value); - - //Replace all extended characters (\x80-xFF) with their - //ASCII values. - $hdr_value = preg_replace( - '#([\x80-\xFF])#e', - '"=" . strtoupper(dechex(ord("\1")))', - $hdr_value - ); - //This regexp will break QP-encoded text at every $maxLength - //but will not break any encoded letters. - $reg1st = "|(.{0,$maxLength})[^\=]|"; - $reg2nd = "|(.{0,$maxLength})[^\=]|"; - break; - } - //Begin with the regexp for the first line. - $reg = $reg1st; - $output = ""; - while ($hdr_value) { - //Split translated string at every $maxLength - //But make sure not to break any translated chars. - $found = preg_match($reg, $hdr_value, $matches); - - //After this first line, we need to use a different - //regexp for the first line. - $reg = $reg2nd; - - //Save the found part and encapsulate it in the - //prefix & suffix. Then remove the part from the - //$hdr_value variable. - if ($found){ - $part = $matches[0]; - $hdr_value = substr($hdr_value, strlen($matches[0])); - }else{ - $part = $hdr_value; - $hdr_value = ""; - } - - //RFC 2047 specifies that any split header should be seperated - //by a CRLF SPACE. - if ($output){ - $output .= "\r\n "; - } - $output .= $prefix . $part . $suffix; - } - $hdr_value = $output; - } - $input[$hdr_name] = $hdr_value; - } - - return $input; - } - - /** - * Set the object's end-of-line and define the constant if applicable - * - * @param string $eol End Of Line sequence - * @access private - */ - function _setEOL($eol) - { - $this->_eol = $eol; - if (!defined('MAIL_MIME_CRLF')) { - define('MAIL_MIME_CRLF', $this->_eol, true); - } - } - - - -} // End of class -?> diff --git a/3.1/modules/ecard/lib/mimePart.php b/3.1/modules/ecard/lib/mimePart.php deleted file mode 100644 index c0050d41..00000000 --- a/3.1/modules/ecard/lib/mimePart.php +++ /dev/null @@ -1,351 +0,0 @@ - | -// +-----------------------------------------------------------------------+ - -/** -* -* Raw mime encoding class -* -* What is it? -* This class enables you to manipulate and build -* a mime email from the ground up. -* -* Why use this instead of mime.php? -* mime.php is a userfriendly api to this class for -* people who aren't interested in the internals of -* mime mail. This class however allows full control -* over the email. -* -* Eg. -* -* // Since multipart/mixed has no real body, (the body is -* // the subpart), we set the body argument to blank. -* -* $params['content_type'] = 'multipart/mixed'; -* $email = new Mail_mimePart('', $params); -* -* // Here we add a text part to the multipart we have -* // already. Assume $body contains plain text. -* -* $params['content_type'] = 'text/plain'; -* $params['encoding'] = '7bit'; -* $text = $email->addSubPart($body, $params); -* -* // Now add an attachment. Assume $attach is -* the contents of the attachment -* -* $params['content_type'] = 'application/zip'; -* $params['encoding'] = 'base64'; -* $params['disposition'] = 'attachment'; -* $params['dfilename'] = 'example.zip'; -* $attach =& $email->addSubPart($body, $params); -* -* // Now build the email. Note that the encode -* // function returns an associative array containing two -* // elements, body and headers. You will need to add extra -* // headers, (eg. Mime-Version) before sending. -* -* $email = $message->encode(); -* $email['headers'][] = 'Mime-Version: 1.0'; -* -* -* Further examples are available at http://www.phpguru.org -* -* TODO: -* - Set encode() to return the $obj->encoded if encode() -* has already been run. Unless a flag is passed to specifically -* re-build the message. -* -* @author Richard Heyes -* @version $Revision: 1.13 $ -* @package Mail -*/ - -class Mail_mimePart { - - /** - * The encoding type of this part - * @var string - */ - var $_encoding; - - /** - * An array of subparts - * @var array - */ - var $_subparts; - - /** - * The output of this part after being built - * @var string - */ - var $_encoded; - - /** - * Headers for this part - * @var array - */ - var $_headers; - - /** - * The body of this part (not encoded) - * @var string - */ - var $_body; - - /** - * Constructor. - * - * Sets up the object. - * - * @param $body - The body of the mime part if any. - * @param $params - An associative array of parameters: - * content_type - The content type for this part eg multipart/mixed - * encoding - The encoding to use, 7bit, 8bit, base64, or quoted-printable - * cid - Content ID to apply - * disposition - Content disposition, inline or attachment - * dfilename - Optional filename parameter for content disposition - * description - Content description - * charset - Character set to use - * @access public - */ - function Mail_mimePart($body = '', $params = array()) - { - if (!defined('MAIL_MIMEPART_CRLF')) { - define('MAIL_MIMEPART_CRLF', defined('MAIL_MIME_CRLF') ? MAIL_MIME_CRLF : "\r\n", TRUE); - } - - foreach ($params as $key => $value) { - switch ($key) { - case 'content_type': - $headers['Content-Type'] = $value . (isset($charset) ? '; charset="' . $charset . '"' : ''); - break; - - case 'encoding': - $this->_encoding = $value; - $headers['Content-Transfer-Encoding'] = $value; - break; - - case 'cid': - $headers['Content-ID'] = '<' . $value . '>'; - break; - - case 'disposition': - $headers['Content-Disposition'] = $value . (isset($dfilename) ? '; filename="' . $dfilename . '"' : ''); - break; - - case 'dfilename': - if (isset($headers['Content-Disposition'])) { - $headers['Content-Disposition'] .= '; filename="' . $value . '"'; - } else { - $dfilename = $value; - } - break; - - case 'description': - $headers['Content-Description'] = $value; - break; - - case 'charset': - if (isset($headers['Content-Type'])) { - $headers['Content-Type'] .= '; charset="' . $value . '"'; - } else { - $charset = $value; - } - break; - } - } - - // Default content-type - if (!isset($headers['Content-Type'])) { - $headers['Content-Type'] = 'text/plain'; - } - - //Default encoding - if (!isset($this->_encoding)) { - $this->_encoding = '7bit'; - } - - // Assign stuff to member variables - $this->_encoded = array(); - $this->_headers = $headers; - $this->_body = $body; - } - - /** - * encode() - * - * Encodes and returns the email. Also stores - * it in the encoded member variable - * - * @return An associative array containing two elements, - * body and headers. The headers element is itself - * an indexed array. - * @access public - */ - function encode() - { - $encoded =& $this->_encoded; - - if (!empty($this->_subparts)) { - srand((double)microtime()*1000000); - $boundary = '=_' . md5(rand() . microtime()); - $this->_headers['Content-Type'] .= ';' . MAIL_MIMEPART_CRLF . "\t" . 'boundary="' . $boundary . '"'; - - // Add body parts to $subparts - for ($i = 0; $i < count($this->_subparts); $i++) { - $headers = array(); - $tmp = $this->_subparts[$i]->encode(); - foreach ($tmp['headers'] as $key => $value) { - $headers[] = $key . ': ' . $value; - } - $subparts[] = implode(MAIL_MIMEPART_CRLF, $headers) . MAIL_MIMEPART_CRLF . MAIL_MIMEPART_CRLF . $tmp['body']; - } - - $encoded['body'] = '--' . $boundary . MAIL_MIMEPART_CRLF . - implode('--' . $boundary . MAIL_MIMEPART_CRLF, $subparts) . - '--' . $boundary.'--' . MAIL_MIMEPART_CRLF; - - } else { - $encoded['body'] = $this->_getEncodedData($this->_body, $this->_encoding) . MAIL_MIMEPART_CRLF; - } - - // Add headers to $encoded - $encoded['headers'] =& $this->_headers; - - return $encoded; - } - - /** - * &addSubPart() - * - * Adds a subpart to current mime part and returns - * a reference to it - * - * @param $body The body of the subpart, if any. - * @param $params The parameters for the subpart, same - * as the $params argument for constructor. - * @return A reference to the part you just added. It is - * crucial if using multipart/* in your subparts that - * you use =& in your script when calling this function, - * otherwise you will not be able to add further subparts. - * @access public - */ - function &addSubPart($body, $params) - { - $this->_subparts[] = new Mail_mimePart($body, $params); - return $this->_subparts[count($this->_subparts) - 1]; - } - - /** - * _getEncodedData() - * - * Returns encoded data based upon encoding passed to it - * - * @param $data The data to encode. - * @param $encoding The encoding type to use, 7bit, base64, - * or quoted-printable. - * @access private - */ - function _getEncodedData($data, $encoding) - { - switch ($encoding) { - case '8bit': - case '7bit': - return $data; - break; - - case 'quoted-printable': - return $this->_quotedPrintableEncode($data); - break; - - case 'base64': - return rtrim(chunk_split(base64_encode($data), 76, MAIL_MIMEPART_CRLF)); - break; - - default: - return $data; - } - } - - /** - * quoteadPrintableEncode() - * - * Encodes data to quoted-printable standard. - * - * @param $input The data to encode - * @param $line_max Optional max line length. Should - * not be more than 76 chars - * - * @access private - */ - function _quotedPrintableEncode($input , $line_max = 76) - { - $lines = preg_split("/\r?\n/", $input); - $eol = MAIL_MIMEPART_CRLF; - $escape = '='; - $output = ''; - - while(list(, $line) = each($lines)){ - - $linlen = strlen($line); - $newline = ''; - - for ($i = 0; $i < $linlen; $i++) { - $char = substr($line, $i, 1); - $dec = ord($char); - - if (($dec == 32) AND ($i == ($linlen - 1))){ // convert space at eol only - $char = '=20'; - - } elseif(($dec == 9) AND ($i == ($linlen - 1))) { // convert tab at eol only - $char = '=09'; - } elseif($dec == 9) { - ; // Do nothing if a tab. - } elseif(($dec == 61) OR ($dec < 32 ) OR ($dec > 126)) { - $char = $escape . strtoupper(sprintf('%02s', dechex($dec))); - } - - if ((strlen($newline) + strlen($char)) >= $line_max) { // MAIL_MIMEPART_CRLF is not counted - $output .= $newline . $escape . $eol; // soft line break; " =\r\n" is okay - $newline = ''; - } - $newline .= $char; - } // end of for - $output .= $newline . $eol; - } - $output = substr($output, 0, -1 * strlen($eol)); // Don't want last crlf - return $output; - } -} // End of class -?> diff --git a/3.1/modules/ecard/module.info b/3.1/modules/ecard/module.info deleted file mode 100644 index 2300f1ad..00000000 --- a/3.1/modules/ecard/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "E-Card" -description = "Send a photo as a postcard" -version = 11 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:ecard" -discuss_url = "http://gallery.menalto.com/forum_module_ecard" diff --git a/3.1/modules/ecard/views/admin_ecard.html.php b/3.1/modules/ecard/views/admin_ecard.html.php deleted file mode 100644 index 0dd6b926..00000000 --- a/3.1/modules/ecard/views/admin_ecard.html.php +++ /dev/null @@ -1,7 +0,0 @@ - -
      -

      -
      - -
      -
      diff --git a/3.1/modules/ecard/views/ecard_block.html.php b/3.1/modules/ecard/views/ecard_block.html.php deleted file mode 100644 index d8aa4e4e..00000000 --- a/3.1/modules/ecard/views/ecard_block.html.php +++ /dev/null @@ -1,6 +0,0 @@ - -id}") ?>" - class="g-dialog-link g-button ui-state-default ui-corner-all"> - - - diff --git a/3.1/modules/ecard/views/ecard_email.html.php b/3.1/modules/ecard/views/ecard_email.html.php deleted file mode 100644 index 0d676cf5..00000000 --- a/3.1/modules/ecard/views/ecard_email.html.php +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - description): ?> - - - - - -
      title) ?>
      - - abs_url() ?> - -
      description)) ?>
      - - diff --git a/3.1/modules/ecard/views/ecard_form.html.php b/3.1/modules/ecard/views/ecard_form.html.php deleted file mode 100644 index fc22e95b..00000000 --- a/3.1/modules/ecard/views/ecard_form.html.php +++ /dev/null @@ -1 +0,0 @@ - Send eCard \ No newline at end of file diff --git a/3.1/modules/editcreation/css/editcreation.css b/3.1/modules/editcreation/css/editcreation.css deleted file mode 100755 index 084dfd8d..00000000 --- a/3.1/modules/editcreation/css/editcreation.css +++ /dev/null @@ -1,8 +0,0 @@ -form#g-edit-album-form fieldset ul li input, -form#g-edit-album-form fieldset ul li select, -form#g-edit-album-form fieldset ul li textarea, -form#g-edit-photo-form fieldset ul li input, -form#g-edit-photo-form fieldset ul li select, -form#g-edit-photo-form fieldset ul li textarea { - display: inline; -} diff --git a/3.1/modules/editcreation/helpers/editcreation_event.php b/3.1/modules/editcreation/helpers/editcreation_event.php deleted file mode 100644 index 8820d8fa..00000000 --- a/3.1/modules/editcreation/helpers/editcreation_event.php +++ /dev/null @@ -1,38 +0,0 @@ -edit_item->dateselect("datecreated") - ->label(t("Created")) - ->minutes(1) - ->years(1970, date('Y')+1) - ->value($item->created); - } - - static function item_edit_form_completed($item, $form) { - // Change the item's created field to the specified value. - $item->created = $form->edit_item->datecreated->value; - $item->save(); - } -} diff --git a/3.1/modules/editcreation/module.info b/3.1/modules/editcreation/module.info deleted file mode 100755 index fef83519..00000000 --- a/3.1/modules/editcreation/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Edit Creation" -description = "Manually edit the creation date of an item in Gallery." -version = 2 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:editcreation" -discuss_url = "http://gallery.menalto.com/forum_module_editcreation" diff --git a/3.1/modules/embed_videos/controllers/embedded_videos.php b/3.1/modules/embed_videos/controllers/embedded_videos.php deleted file mode 100644 index f49d4220..00000000 --- a/3.1/modules/embed_videos/controllers/embedded_videos.php +++ /dev/null @@ -1,166 +0,0 @@ -validate(); - if ($form->add_embedded_video->inputs['video_url']->value != "") { - $title = $form->add_embedded_video->inputs['title']->value; - $description = $form->add_embedded_video->inputs['description']->value; - $valid_url=false; - $embedded_video = ORM::factory("embedded_video"); - $item = ORM::factory("item"); - $item->type = "photo"; - $url = $form->add_embedded_video->inputs['video_url']->value; - if(preg_match("/$youtubeUrlPattern/",$url)) { - $video_id = 0; - if (preg_match("/watch\?v=(.*?)(&\S+=\S+)/",$url,$matches)) { - $video_id = $matches[1]; - } else if (preg_match("/watch\?v=(.*)/",$url,$matches)) { - $video_id = $matches[1]; - } else if (preg_match("/v\/(.*)/",$url,$matches)) { - $video_id = $matches[1]; - } - if ($video_id) { - $video_id = $matches[1]; - $embedded_video->embed_code = ''; - $embedded_video->source = "YouTube"; - $content = file_get_contents("http://img.youtube.com/vi/" . $video_id . "/0.jpg"); - $itemname = "youtube_" . $video_id . ".jpg"; - $temp_filename = VARPATH . "tmp/$itemname"; - if ($content) { - $valid_url = true; - $sxml = simplexml_load_file("http://gdata.youtube.com/feeds/api/videos/$video_id"); - if ($sxml) { - if ($title == '') { - $title = (string)$sxml->title; - } - if ($description == '') { - $description = (string)$sxml->content; - } - } - } - } - } else if(preg_match("/$vimeoUrlPattern/",$url)) { - if(preg_match("/$vimeoUrlPattern\/(.*)/",$url,$matches)) { - $video_id = $matches[1]; - if ($video_id) { - $sxml = simplexml_load_file("http://vimeo.com/api/v2/video/$video_id.xml"); - if ($sxml) { - if ($title == '') { - $title = (string)$sxml->video->title; - } - if ($description == '') { - $description = strip_tags((string)$sxml->video->description); - } - $embedded_video->source = "Vimeo"; - $content = file_get_contents((string)$sxml->video->thumbnail_large); - $itemname = "vimeo_" . $video_id . ".jpg"; - $temp_filename = VARPATH . "tmp/$itemname"; - $width = min((int)$sxml->video->width, $maxwidth); - $height = min((int)$sxml->video->height, $maxheight); - $embedded_video->embed_code = ''; - $valid_url = true; - } - } - } - } - //$item->validate(); - //$content = file_get_contents("http://img.youtube.com/vi/" . $form->add_embedded_video->inputs['name']->value . "/0.jpg"); - if ($valid_url) { - $file = fopen($temp_filename, "wb"); - fwrite($file, $content); - fclose($file); - gallery_graphics::composite($temp_filename, $temp_filename, array("file" => "modules/embed_videos/images/embed_video_icon.png", "position" => "center", "transparency" => 95), $item); - $item->set_data_file($temp_filename); - $item->name = basename($itemname); - $item->title = $title; - $item->parent_id = $album->id; - $item->description = $description; - $item->slug = $form->add_embedded_video->inputs['slug']->value; - $path_info = @pathinfo($temp_filename); - $item->save(); - $embedded_video->item_id = $item->id; - $embedded_video->validate(); - $embedded_video->save(); - log::success("content", t("Added a embedded video"), html::anchor("embeds/$item->id", t("view video"))); - module::event("add_event_form_completed", $item, $form); - } else { - $form->add_embedded_video->inputs['video_url']->add_error('invalid_id', 1); - $valid = false; - } - } else { - $form->add_embedded_video->inputs['video_url']->add_error('invalid_id', 1); - $valid = false; - } - } - catch(Exception $e) { - // Lame error handling for now. Just record the exception and move on - Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString()); - // Ugh. I hate to use instanceof, But this beats catching the exception separately since - // we mostly want to treat it the same way as all other exceptions - if ($e instanceof ORM_Validation_Exception) { - Kohana_Log::add("error", "Validation errors: " . print_r($e->validation->errors(), 1)); - foreach($e->validation->errors() as $key => $error) { - $form->add_embed->inputs[$key]->add_error($error, 1); - } - $valid = false; - } - if (file_exists($temp_filename)) { - unlink($temp_filename); - } - } - if (file_exists($temp_filename)) { - unlink($temp_filename); - } - batch::stop(); - if ($valid) { - //print json_encode(array("result" => "success")); - json::reply(array("result" => "success", "location" => $item->url())); - } else { - //json::reply(array("result" => "error", "form" => (string)$form)); - print $form; - } - } - public function form_add($album_id) { - $album = ORM::factory("item", $album_id); - access::required("view", $album); - access::required("add", $album); - print embed_videos::get_add_form($album); - } -} diff --git a/3.1/modules/embed_videos/helpers/embed_videos.php b/3.1/modules/embed_videos/helpers/embed_videos.php deleted file mode 100644 index 64e0f403..00000000 --- a/3.1/modules/embed_videos/helpers/embed_videos.php +++ /dev/null @@ -1,57 +0,0 @@ -id}", "", "post", array("id" => "g-add-embed-form")); - $group = $form->group("add_embedded_video") - ->label(t("Add embedded video to %album_title", array("album_title" => $album->title))); - $group->input("title")->label(t("Title")) - ->error_messages("required", t("You must provide a title")) - ->error_messages("length", t("Your title is too long")); - $group->input("video_url")->label(t("Video URL")) - ->error_messages( - "conflict", t("There is already a movie with this ID")) - ->error_messages("required", t("You must provide a URL")) - ->error_messages("invalid_id", t("Invalid URL")); - $group->textarea("description")->label(t("Description")); - $group->input("slug")->label(t("Internet Address")) - ->error_messages( - "conflict", t("There is already a movie, photo or album with this internet address")) - ->error_messages( - "not_url_safe", - t("The internet address should contain only letters, numbers, hyphens and underscores")) - ->error_messages("required", t("You must provide an internet address")) - ->error_messages("length", t("Your internet address is too long")); - - module::event("item_add_form", $album, $form); - - $group = $form->group("buttons")->label(""); - $group->submit("")->value(t("Add")); - - return $form; - } -} \ No newline at end of file diff --git a/3.1/modules/embed_videos/helpers/embed_videos_event.php b/3.1/modules/embed_videos/helpers/embed_videos_event.php deleted file mode 100644 index 506d123a..00000000 --- a/3.1/modules/embed_videos/helpers/embed_videos_event.php +++ /dev/null @@ -1,38 +0,0 @@ -where("item_id", "=", $item->id) - ->find() - ->delete(); - } - static function site_menu($menu, $theme) { - $item = $theme->item(); - if ($can_add = $item && access::can("add", $item)) { - $menu->get("add_menu") - ->append(Menu::factory("dialog") - ->id("embed_add") - ->label(t("Embed Video")) - ->url(url::site("form/add/embedded_videos/$item->id"))); - } - } -} diff --git a/3.1/modules/embed_videos/helpers/embed_videos_installer.php b/3.1/modules/embed_videos/helpers/embed_videos_installer.php deleted file mode 100644 index 4db441cf..00000000 --- a/3.1/modules/embed_videos/helpers/embed_videos_installer.php +++ /dev/null @@ -1,44 +0,0 @@ -query("CREATE TABLE {embedded_videos} ( - `id` int(9) NOT NULL auto_increment, - `embed_code` varchar(2048) DEFAULT NULL, - `source` varchar(64) DEFAULT NULL, - `item_id` int(9) NOT NULL, - PRIMARY KEY (`id`), - KEY (`item_id`, `id`)) - DEFAULT CHARSET=utf8;"); - module::set_version("embed_videos", 2); - //exec("cd modules/gallery/controllers/; ln -s ../../embed/controllers/embeds.php embeds.php"); - } - - static function deactivate() { - - } - static function uninstall() { - $db = Database::instance(); - $db->query("DROP TABLE IF EXISTS {embedded_videos};"); - module::delete("embed_videos"); - } -} diff --git a/3.1/modules/embed_videos/helpers/embed_videos_theme.php b/3.1/modules/embed_videos/helpers/embed_videos_theme.php deleted file mode 100644 index 61b7000a..00000000 --- a/3.1/modules/embed_videos/helpers/embed_videos_theme.php +++ /dev/null @@ -1,34 +0,0 @@ -item(); - if ($item && $item->is_photo()) { - $embedded_video = ORM::factory("embedded_video") - ->where("item_id", "=", $item->id) - ->find(); - if ($embedded_video->loaded()) { - $view = new View("embed_video_js.html"); - $view->embed_code = addslashes($embedded_video->embed_code); - return $view; - } - } - } -} \ No newline at end of file diff --git a/3.1/modules/embed_videos/images/embed_video_icon.png b/3.1/modules/embed_videos/images/embed_video_icon.png deleted file mode 100644 index 81e5a9d4..00000000 Binary files a/3.1/modules/embed_videos/images/embed_video_icon.png and /dev/null differ diff --git a/3.1/modules/embed_videos/models/embedded_video.php b/3.1/modules/embed_videos/models/embedded_video.php deleted file mode 100644 index 7f0ae949..00000000 --- a/3.1/modules/embed_videos/models/embedded_video.php +++ /dev/null @@ -1,25 +0,0 @@ - - - - \ No newline at end of file diff --git a/3.1/modules/embedlinks/controllers/admin_embedlinks.php b/3.1/modules/embedlinks/controllers/admin_embedlinks.php deleted file mode 100644 index f25f97e8..00000000 --- a/3.1/modules/embedlinks/controllers/admin_embedlinks.php +++ /dev/null @@ -1,100 +0,0 @@ -content = new View("admin_embedlinks.html"); - $view->content->embedlinks_form = $this->_get_admin_form(); - print $view; - } - - public function saveprefs() { - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Figure out which boxes where checked - $linkOpts_array = Input::instance()->post("LinkCodeTypeOptions"); - $displayType_array = Input::instance()->post("LinkDisplayType"); - - $HTMLButton = false; - $BBCodeButton = false; - $FullURLButton = false; - $InPageLinks = false; - - for ($i = 0; $i < count($linkOpts_array); $i++) { - if ($linkOpts_array[$i] == "HTMLCode") { - $HTMLButton = true; - } - if ($linkOpts_array[$i] == "BBCode") { - $BBCodeButton = true; - } - if ($linkOpts_array[$i] == "FullURL") { - $FullURLButton = true; - } - } - for ($i = 0; $i < count($displayType_array); $i++) { - if ($displayType_array[$i] == "InPageLinks") { - $InPageLinks = true; - } - } - - // Save Settings. - module::set_var("embedlinks", "HTMLCode", $HTMLButton); - module::set_var("embedlinks", "BBCode", $BBCodeButton); - module::set_var("embedlinks", "FullURL", $FullURLButton); - module::set_var("embedlinks", "InPageLinks", $InPageLinks); - message::success(t("Your Selection Has Been Saved.")); - - // Load Admin page. - $view = new Admin_View("admin.html"); - $view->content = new View("admin_embedlinks.html"); - $view->content->embedlinks_form = $this->_get_admin_form(); - print $view; - } - - private function _get_admin_form() { - // Make a new Form. - $form = new Forge("admin/embedlinks/saveprefs", "", "post", - array("id" => "g-embed-links-adminForm")); - - // Make an array for the different types of link codes. - $linkCodes["HTMLCode"] = array(t("Show HTML Links"), module::get_var("embedlinks", "HTMLCode")); - $linkCodes["BBCode"] = array(t("Show BBCode Links"), module::get_var("embedlinks", "BBCode")); - $linkCodes["FullURL"] = array(t("Show the full URL"), module::get_var("embedlinks", "FullURL")); - - // Make an array for the different methods of displaying the links. - $linkDisplays["InPageLinks"] = array(t("Show Links In The Actual Page"), module::get_var("embedlinks", "InPageLinks")); - - // Setup a few checkboxes on the form. - $add_links = $form->group("EmbedLinks"); - $add_links->checklist("LinkCodeTypeOptions") - ->options($linkCodes); - $add_links->checklist("LinkDisplayType") - ->options($linkDisplays); - - // Add a save button to the form. - $add_links->submit("SaveSettings")->value(t("Save")); - - // Return the newly generated form. - return $form; - } -} \ No newline at end of file diff --git a/3.1/modules/embedlinks/controllers/embedlinks.php b/3.1/modules/embedlinks/controllers/embedlinks.php deleted file mode 100644 index 53db22a1..00000000 --- a/3.1/modules/embedlinks/controllers/embedlinks.php +++ /dev/null @@ -1,186 +0,0 @@ -is_album()) { - $linkArray[0] = array("Text:", "type}s/{$item->id}") . "">Click Here"); - $linkArray[1] = array("Thumbnail:", "type}s/{$item->id}") . "">thumb_url(true) . "">"); - $linkTitles[0] = array("Link To This Album:", 2); - - // If the item is a movie, don't display resize links, do display an embed link. - } elseif ($item->is_movie()) { - // Link to the current page. - $linkArray[0] = array("Text:", "type}s/{$item->id}") . "">Click Here"); - $linkArray[1] = array("Thumbnail:", "type}s/{$item->id}") . "">thumb_url(true) . "">"); - $linkTitles[0] = array("Link To This Page:", 2); - - // If the visitor has suficient privlidges to see the fullsized - // version of the current image, then display links to it. - if (access::can("view_full", $item)) { - $linkArray[2] = array("Text:", "file_url(true) . "">Click Here"); - $linkArray[3] = array("Thumbnail:", "file_url(true) . "">thumb_url(true) . "">"); - $linkArray[4] = array("Embed:", "width . "" height="" . $item->height . "" data="" . url::abs_file("lib/flowplayer.swf") . "" type="application/x-shockwave-flash">"); - $linkTitles[1] = array("Link To The Video File:", 3); - } - - // Or else assume the item is a photo. - } else { - // Link to the current page. - $linkArray[0] = array("Text:", "type}s/{$item->id}") . "">Click Here"); - $linkArray[1] = array("Thumbnail:", "type}s/{$item->id}") . "">thumb_url(true) . "">"); - $linkArray[2] = array("Resized:", "type}s/{$item->id}") . "">resize_url(true) . "">"); - $linkTitles[0] = array("Link To This Page:", 3); - - // Link to the "resized" version of the current image. - $linkArray[3] = array("Text:", "resize_url(true) . "">Click Here"); - $linkArray[4] = array("Thumbnail:", "resize_url(true) . "">thumb_url(true) . "">"); - $linkArray[5] = array("Image:", "resize_url(true) . "">"); - $linkTitles[1] = array("Link To The Resized Image:", 3); - - // If the visitor has suficient privlidges to see the fullsized - // version of the current image, then display links to it. - if (access::can("view_full", $item)) { - $linkArray[6] = array("Text:", "file_url(true) . "">Click Here"); - $linkArray[7] = array("Thumbnail:", "file_url(true) . "">thumb_url(true) . "">"); - $linkArray[8] = array("Resized:", "file_url(true) . "">resize_url(true) . "">"); - $linkTitles[2] = array("Link To The Full Size Image:", 3); - } - } - - $view = new View("embedlinks_htmldialog.html"); - $view->titles = $linkTitles; - $view->details = $linkArray; - print $view; - } - - public function showbbcode($item_id) { - // Generate the Dialog Box for BBCode links. - $item = ORM::factory("item", $item_id); - access::required("view", $item); - - // If the current page is an album, only display two links. - if ($item->is_album()) { - $linkArray[0] = array("Text:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "]Click Here[/url]"); - $linkArray[1] = array("Thumbnail:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "][img]" . $item->thumb_url(true) . "[/img][/url]"); - $linkTitles[0] = array("Link To This Album:", 2); - - // If the item is a movie, don't display resize links. - } elseif ($item->is_movie()) { - // Link to the current page. - $linkArray[0] = array("Text:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "]Click Here[/url]"); - $linkArray[1] = array("Thumbnail:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "][img]" . $item->thumb_url(true) . "[/img][/url]"); - $linkTitles[0] = array("Link To This Page:", 2); - - // If the visitor has suficient privlidges to see the fullsized - // version of the current image, then display links to it. - if (access::can("view_full", $item)) { - $linkArray[2] = array("Text:", "[url=" . $item->file_url(true) . "]Click Here[/url]"); - $linkArray[3] = array("Thumbnail:", "[url=" . $item->file_url(true) . "][img]" . $item->thumb_url(true) . "[/img][/url]"); - $linkTitles[1] = array("Link To The Video File:", 2); - } - - // Or else assume the item is a photo. - } else { - // Link to the current page. - $linkArray[0] = array("Text:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "]Click Here[/url]"); - $linkArray[1] = array("Thumbnail:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "][img]" . $item->thumb_url(true) . "[/img][/url]"); - $linkArray[2] = array("Resized:", "[url=" . url::abs_site("{$item->type}s/{$item->id}") . "][img]" . $item->resize_url(true) . "[/img][/url]"); - $linkTitles[0] = array("Link To This Page:", 3); - - // Link to the "resized" version of the current image. - $linkArray[3] = array("Text:", "[url=" . $item->resize_url(true) . "]Click Here[/url]"); - $linkArray[4] = array("Thumbnail:", "[url=" . $item->resize_url(true) . "][img]" . $item->thumb_url(true) . "[/img][/url]"); - $linkArray[5] = array("Image:", "[img]" . $item->resize_url(true) . "[/img]"); - $linkTitles[1] = array("Link To The Resized Image:", 3); - - // If the visitor has suficient privlidges to see the fullsized - // version of the current image, then display links to it. - if (access::can("view_full", $item)) { - $linkArray[6] = array("Text:", "[url=" . $item->file_url(true) . "]Click Here[/url]"); - $linkArray[7] = array("Thumbnail:", "[url=" . $item->file_url(true) . "][img]" . $item->thumb_url(true) . "[/img][/url]"); - $linkArray[8] = array("Resized:", "[url=" . $item->file_url(true) . "][img]" . $item->resize_url(true) . "[/img][/url]"); - $linkTitles[2] = array("Link To The Full Size Image:", 3); - } - } - - $view = new View("embedlinks_bbcodedialog.html"); - $view->titles = $linkTitles; - $view->details = $linkArray; - print $view; - } - - public function showfullurl($item_id) { - // Generate the Dialog Box for the URLs to the items thumb, resize and fullsize image. - $item = ORM::factory("item", $item_id); - access::required("view", $item); - - // If the current page is an album, only display a URL and thumnail fields. - if ($item->is_album()) { - $linkArray[0] = array("Album URL:", url::abs_site("{$item->type}s/{$item->id}")); - $linkArray[1] = array("Thumbnail:", $item->thumb_url(true)); - $linkTitles[0] = array("URLs:", 2); - - // If the item is a movie, do not display the resize url. - } elseif ($item->is_movie()) { - // Link to the current page. - $linkArray[0] = array("This Page:", url::abs_site("{$item->type}s/{$item->id}")); - $linkArray[1] = array("Thumbnail:", $item->thumb_url(true)); - - // If the visitor has suficient privlidges to see the fullsized - // version of the current image, then display its URL. - if (access::can("view_full", $item)) { - $linkArray[2] = array("Video File:", $item->file_url(true)); - $linkTitles[0] = array("URLs:", 3); - } else { - $linkTitles[0] = array("URLs:", 2); - } - - // Or else assume the item is a photo. - } else { - // Link to the current page. - $linkArray[0] = array("This Page:", url::abs_site("{$item->type}s/{$item->id}")); - $linkArray[1] = array("Thumbnail:", $item->thumb_url(true)); - $linkArray[2] = array("Resized:", $item->resize_url(true)); - - // If the visitor has suficient privlidges to see the fullsized - // version of the current image, then display its URL. - if (access::can("view_full", $item)) { - $linkArray[3] = array("Full Size:", $item->file_url(true)); - $linkTitles[0] = array("URLs:", 4); - } else { - $linkTitles[0] = array("URLs:", 3); - } - } - - $view = new View("embedlinks_fullurldialog.html"); - $view->titles = $linkTitles; - $view->details = $linkArray; - print $view; - } - -} diff --git a/3.1/modules/embedlinks/helpers/embedlinks_theme.php b/3.1/modules/embedlinks/helpers/embedlinks_theme.php deleted file mode 100644 index 86338b31..00000000 --- a/3.1/modules/embedlinks/helpers/embedlinks_theme.php +++ /dev/null @@ -1,33 +0,0 @@ -css_id = "g-metadata"; - $block->title = t("Links"); - $block->content = new View("embedlinks_photo_block.html"); - return $block; - } - } -} diff --git a/3.1/modules/embedlinks/module.info b/3.1/modules/embedlinks/module.info deleted file mode 100644 index c5eeb06b..00000000 --- a/3.1/modules/embedlinks/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "EmbedLinks" -description = "Display BBCode and HTML code to embed links to albums/images into other web pages." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:embedlinks" -discuss_url = "http://gallery.menalto.com/forum_module_embedlinks" diff --git a/3.1/modules/embedlinks/views/admin_embedlinks.html.php b/3.1/modules/embedlinks/views/admin_embedlinks.html.php deleted file mode 100644 index 9aa272c3..00000000 --- a/3.1/modules/embedlinks/views/admin_embedlinks.html.php +++ /dev/null @@ -1,5 +0,0 @@ - - diff --git a/3.1/modules/embedlinks/views/embedlinks_album_block.html.php b/3.1/modules/embedlinks/views/embedlinks_album_block.html.php deleted file mode 100644 index 220bf74d..00000000 --- a/3.1/modules/embedlinks/views/embedlinks_album_block.html.php +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/3.1/modules/embedlinks/views/embedlinks_bbcodedialog.html.php b/3.1/modules/embedlinks/views/embedlinks_bbcodedialog.html.php deleted file mode 100644 index 3b7cace1..00000000 --- a/3.1/modules/embedlinks/views/embedlinks_bbcodedialog.html.php +++ /dev/null @@ -1,24 +0,0 @@ - - -

      - diff --git a/3.1/modules/embedlinks/views/embedlinks_fullurldialog.html.php b/3.1/modules/embedlinks/views/embedlinks_fullurldialog.html.php deleted file mode 100644 index 2b40c8a1..00000000 --- a/3.1/modules/embedlinks/views/embedlinks_fullurldialog.html.php +++ /dev/null @@ -1,24 +0,0 @@ - - -

      - diff --git a/3.1/modules/embedlinks/views/embedlinks_htmldialog.html.php b/3.1/modules/embedlinks/views/embedlinks_htmldialog.html.php deleted file mode 100644 index 46537754..00000000 --- a/3.1/modules/embedlinks/views/embedlinks_htmldialog.html.php +++ /dev/null @@ -1,24 +0,0 @@ - - -

      - diff --git a/3.1/modules/embedlinks/views/embedlinks_photo_block.html.php b/3.1/modules/embedlinks/views/embedlinks_photo_block.html.php deleted file mode 100644 index 97bb51c0..00000000 --- a/3.1/modules/embedlinks/views/embedlinks_photo_block.html.php +++ /dev/null @@ -1,201 +0,0 @@ - - - - -

      - - - - - - - - - - - - - - - - -is_photo()) { ?> - - - - - - - - - is_movie()) { ?> - - - - - - - - - - - - - - - - - is_photo()) { ?> - - - - - - - is_movie()) { ?> - - - - - - - -is_photo()) { ?> - - - - - - - - - - - - - - - - - - - - - - - - -

      - - - - - - - - - - - - - - - - - is_photo()) { ?> - - - - - - - - - is_movie()) { ?> - - - - - - - - - - - - - - - - - is_photo()) { ?> - - - - - - - - is_photo()) { ?> - - - - - - - - - - - - - - - - - - - - - - - - -

      - - - - - - - - - - - - - is_photo()) { ?> - - - - - - - - - is_movie()) { ?> - - - - - - - - - - - \ No newline at end of file diff --git a/3.1/modules/embedlinks/views/embedlinks_sidebar.html.php b/3.1/modules/embedlinks/views/embedlinks_sidebar.html.php deleted file mode 100644 index 21d8b7f3..00000000 --- a/3.1/modules/embedlinks/views/embedlinks_sidebar.html.php +++ /dev/null @@ -1,24 +0,0 @@ - - -id}") ?>" title="" - class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all"> - - -
      - - - -id}") ?>" title="" - class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all"> - - - - - - -id}") ?>" title="" - class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all"> - - - - \ No newline at end of file diff --git a/3.1/modules/exif_gps/controllers/admin_exif_gps.php b/3.1/modules/exif_gps/controllers/admin_exif_gps.php deleted file mode 100644 index 0abc5f25..00000000 --- a/3.1/modules/exif_gps/controllers/admin_exif_gps.php +++ /dev/null @@ -1,129 +0,0 @@ -content = new View("admin_exif_gps.html"); - $view->content->exifgps_form = $this->_get_admin_form(); - print $view; - } - - public function saveprefs() { - // Save user preferences to the database. - - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Make sure the user filled out the form properly. - $form = $this->_get_admin_form(); - if ($form->validate()) { - Kohana_Log::add("error",print_r($form,1)); - - // Save settings to Gallery's database. - module::set_var("exif_gps", "googlemap_api_key", $form->Global->google_api_key->value); - module::set_var("exif_gps", "googlemap_max_autozoom", $form->Global->max_auto_zoom_level->value); - module::set_var("exif_gps", "sidebar_zoom", $form->Sidebar->sidebar_default_zoom->value); - module::set_var("exif_gps", "sidebar_mapformat", $form->Sidebar->sidebar_mapformat->value); - module::set_var("exif_gps", "sidebar_maptype", $form->Sidebar->sidebar_maptype->value); - module::set_var("exif_gps", "largemap_maptype", $form->LargeMap->largemap_maptype->value); - $checkbox_album = false; - $checkbox_user = false; - for ($i = 0; $i < count($form->Global->toolbar_map_album); $i++) { - if ($form->Global->toolbar_map_album->value[$i] == "checkbox_album") { - $checkbox_album = true; - } - } - for ($i = 0; $i < count($form->Global->toolbar_map_user); $i++) { - if ($form->Global->toolbar_map_user->value[$i] == "checkbox_user") { - $checkbox_user = true; - } - } - module::set_var("exif_gps", "toolbar_map_album", $checkbox_album); - module::set_var("exif_gps", "toolbar_map_user", $checkbox_user); - - // Display a success message and redirect back to the TagsMap admin page. - message::success(t("Your settings have been saved.")); - url::redirect("admin/exif_gps"); - } - - // Else show the page with errors - $view = new Admin_View("admin.html"); - $view->content = new View("admin_exif_gps.html"); - $view->content->exifgps_form = $form; - print $view; - } - - private function _get_admin_form() { - // Make a new Form. - $form = new Forge("admin/exif_gps/saveprefs", "", "post", - array("id" => "g-exif-gps-adminForm")); - - // Create group for global settings, like the Maps API Key - $gps_global_group = $form->group("Global") - ->label(t("Global Settings")); - $gps_global_group->input("google_api_key") - ->label(t("Google Maps API Key")) - ->value(module::get_var("exif_gps", "googlemap_api_key")) - ->rules("required"); - $gps_global_group->input("max_auto_zoom_level") - ->label(t("Maximum Auto-Zoom Level:")) - ->value(module::get_var("exif_gps", "googlemap_max_autozoom")); - $checkbox_user["checkbox_user"] = array(t("Show \"Map this user\" icon?"), module::get_var("exif_gps", "toolbar_map_user")); - $checkbox_album["checkbox_album"] = array(t("Show \"Map this album\" icon?"), module::get_var("exif_gps", "toolbar_map_album")); - $gps_global_group->checklist("toolbar_map_album") - ->options($checkbox_album); - $gps_global_group->checklist("toolbar_map_user") - ->options($checkbox_user); - - // Create a group for sidebar settings - $gps_sidebar = $form->group("Sidebar") - ->label(t("Sidebar Settings")); - $gps_sidebar->input("sidebar_default_zoom") - ->label(t("Default Zoom Level")) - ->value(module::get_var("exif_gps", "sidebar_zoom")) - ->rules("required"); - $gps_sidebar->dropdown("sidebar_mapformat") - ->label(t("Map Interface")) - ->options(array(t("Static"), t("Interactive"))) - ->selected(module::get_var("exif_gps", "sidebar_mapformat")); - $gps_sidebar->dropdown("sidebar_maptype") - ->label(t("Default Map Type")) - ->options(array(t("Map"), t("Satellite"), - t("Hybrid"), t("Terrain"))) - ->selected(module::get_var("exif_gps", "sidebar_maptype")); - - // Create a group for map album/user settings - $gps_large_map_group = $form->group("LargeMap") - ->label(t("Map Album/User Settings")); - $gps_large_map_group->dropdown("largemap_maptype") - ->label(t("Default Map Type")) - ->options(array(t("Map"), t("Satellite"), - t("Hybrid"), t("Terrain"))) - ->selected(module::get_var("exif_gps", "largemap_maptype")); - - // Add a save button to the form. - $form->submit("SaveSettings")->value(t("Save")); - - // Return the newly generated form. - return $form; - } -} diff --git a/3.1/modules/exif_gps/controllers/exif_gps.php b/3.1/modules/exif_gps/controllers/exif_gps.php deleted file mode 100644 index 52b94b9d..00000000 --- a/3.1/modules/exif_gps/controllers/exif_gps.php +++ /dev/null @@ -1,78 +0,0 @@ -join("exif_coordinates", "items.id", "exif_coordinates.item_id") - ->viewable() - ->order_by("exif_coordinates.latitude", "ASC") - ->descendants(); - $curr_album = ORM::factory("item")->where("id", "=", $type_id)->find_all(); - $map_title = $curr_album[0]->title; - } elseif ($map_type == "user") { - // Generate an array of all items uploaded by the current user that - // have exif gps coordinates and order by latitude (to group items - // w/ the same coordinates together). - $items = ORM::factory("item") - ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") - ->where("items.owner_id", "=", $type_id) - ->viewable() - ->order_by("exif_coordinates.latitude", "ASC") - ->find_all(); - $curr_user = ORM::factory("user")->where("id", "=", $type_id)->find_all(); - $map_title = $curr_user[0]->full_name . "'s " . t("Photos"); - } - - // Make a new page. - $template = new Theme_View("page.html", "other", "EXIFMap"); - $template->page_title = t("Gallery :: Map"); - $template->content = new View("exif_gps_map.html"); - if ($map_title == "") { - $template->content->title = t("Map"); - } else { - $template->content->title = t("Map of") . " " . $map_title; - } - - // Figure out default map type. - $int_map_type = module::get_var("exif_gps", "largemap_maptype"); - if ($int_map_type == 0) $map_type = "ROADMAP"; - if ($int_map_type == 1) $map_type = "SATELLITE"; - if ($int_map_type == 2) $map_type = "HYBRID"; - if ($int_map_type == 3) $map_type = "TERRAIN"; - $template->content->map_type = $map_type; - - // When mapping an album, generate a "return to album" link. - if (isset($curr_album)) $template->content->return_url = url::abs_site("{$curr_album[0]->type}s/{$curr_album[0]->id}"); - - // Load in module preferences. - $template->content->items = $items; - $template->content->google_map_key = module::get_var("exif_gps", "googlemap_api_key"); - - // Display the page. - print $template; - } -} diff --git a/3.1/modules/exif_gps/css/exif_gps_menu.css b/3.1/modules/exif_gps/css/exif_gps_menu.css deleted file mode 100644 index 3f8afa28..00000000 --- a/3.1/modules/exif_gps/css/exif_gps_menu.css +++ /dev/null @@ -1,6 +0,0 @@ -#g-view-menu #g-exif-gps-album-link { - background-image: url('../images/ico-view-exif_gps_album.png'); -} -#g-view-menu #g-exif-gps-user-link { - background-image: url('../images/ico-view-exif_gps_user.png'); -} diff --git a/3.1/modules/exif_gps/helpers/exif_gps.php b/3.1/modules/exif_gps/helpers/exif_gps.php deleted file mode 100644 index 823b4b29..00000000 --- a/3.1/modules/exif_gps/helpers/exif_gps.php +++ /dev/null @@ -1,72 +0,0 @@ -is_photo() && $item->mime_type == "image/jpeg") { - $data = array(); - require_once(MODPATH . "exif/lib/exif.php"); - $exif_raw = read_exif_data_raw($item->file_path(), false); - if (isset($exif_raw['ValidEXIFData'])) { - foreach(self::_keys() as $field => $exifvar) { - if (isset($exif_raw[$exifvar[0]][$exifvar[1]])) { - $value = $exif_raw[$exifvar[0]][$exifvar[1]]; - if (function_exists("mb_detect_encoding") && mb_detect_encoding($value) != "UTF-8") { - $value = utf8_encode($value); - } - $keys[$field] = Input::clean($value); - } - } - } - } - - // If coordinates were extracted, save them to the database. - if (isset($keys["Latitude"]) && isset($keys["Longitude"])) { - $record = ORM::factory("exif_coordinate"); - $record->item_id = $item->id; - $record->latitude = str_replace(",", ".", $keys["Latitude"]); - $record->longitude = str_replace(",", ".", $keys["Longitude"]); - // Represent N/S/E/W as postive and negative numbers - if (substr(strtoupper($keys["Latitude Reference"]), 0, 1) == "S") { - $record->latitude = "-" . $record->latitude; - } - if (substr(strtoupper($keys["Longitude Reference"]), 0, 1) == "W") { - $record->longitude = "-" . $record->longitude; - } - $record->save(); - } - } - - private static function _keys() { - // EXIF fields to extract. - if (!isset(self::$exif_keys)) { - self::$exif_keys = array( - "Latitude Reference" => array("GPS", "Latitude Reference", t("GPS: Latitude Reference"), ), - "Longitude Reference" => array("GPS", "Longitude Reference", t("GPS: Longitude Reference"),), - "Latitude" => array("GPS", "Latitude", t("GPS: Latitude"), ), - "Longitude" => array("GPS", "Longitude", t("GPS: Longitude"), ) - ); - } - return self::$exif_keys; - } -} diff --git a/3.1/modules/exif_gps/helpers/exif_gps_block.php b/3.1/modules/exif_gps/helpers/exif_gps_block.php deleted file mode 100644 index 5b2796fc..00000000 --- a/3.1/modules/exif_gps/helpers/exif_gps_block.php +++ /dev/null @@ -1,151 +0,0 @@ - t("EXIF GPS Location"), - "exif_gps_maps" => t("EXIF GPS Maps")); - } - - static function get($block_id, $theme) { - $block = ""; - - switch ($block_id) { - case "exif_gps_maps": - // Display links to a map of the current album and - // a map of the current user. - if ($theme->item()) { - $album_id = ""; - $item = $theme->item; - if ($item->is_album()) { - $album_id = $item->id; - } else { - $album_id = $item->parent_id; - } - $curr_user = ORM::factory("user")->where("id", "=", $item->owner_id)->find_all(); - $user_name = $curr_user[0]->full_name; - - // Make sure there are actually map-able items to display. - $album_items_count = ORM::factory("item", $album_id) - ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") - ->viewable() - ->order_by("exif_coordinates.latitude", "ASC") - ->descendants_count(); - $user_items_count = ORM::factory("item") - ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") - ->where("items.owner_id", "=", $item->owner_id) - ->viewable() - ->order_by("exif_coordinates.latitude", "ASC") - ->count_all(); - - if (($album_items_count > 0) || ($user_items_count > 0)) { - $block = new Block(); - $block->css_id = "g-exif-gps-maps"; - $block->title = t("Maps"); - $block->content = new View("exif_gps_maps_sidebar.html"); - $block->content->album_id = $album_id; - $block->content->user_id = $item->owner_id; - $block->content->user_name = $user_name; - $block->content->album_items = $album_items_count; - $block->content->user_items = $user_items_count; - } - } - break; - - case "exif_gps_location": - // Look for coordinates to display. - $latitude = ""; - $longitude = ""; - if ($theme->item()) { - // Check and see if the item has exif coordinates associated with it. - $record = ORM::factory("exif_coordinate")->where("item_id", "=", $theme->item->id)->find(); - if ($record->loaded()) { - $latitude = $record->latitude; - $longitude = $record->longitude; - } elseif (module::is_active("tagsmap") && module::is_active("tag")) { - // If there are no exif coordinates, check for tagsmap coordinates instead. - $tagsItem = ORM::factory("tag") - ->join("items_tags", "tags.id", "items_tags.tag_id") - ->where("items_tags.item_id", "=", $theme->item->id) - ->find_all(); - if (count($tagsItem) > 0) { - foreach ($tagsItem as $oneTag) { - $tagsGPS = ORM::factory("tags_gps")->where("tag_id", "=", $oneTag->id)->find(); - if ($tagsGPS->loaded()) { - $latitude = $tagsGPS->latitude; - $longitude = $tagsGPS->longitude; - break; - } - } - } - } - } elseif ( ($theme->tag()) && (module::is_active("tagsmap") && module::is_active("tag")) ) { - // If the current page belongs to a tag, check and see if the tag has GPS coordinates. - $tagsGPS = ORM::factory("tags_gps")->where("tag_id", "=", $theme->tag()->id)->find(); - if ($tagsGPS->loaded()) { - $latitude = $tagsGPS->latitude; - $longitude = $tagsGPS->longitude; - } - } - - // If coordinates were found, create the block. - if ($latitude != "" && $longitude != "") { - $block = new Block(); - $block->css_id = "g-exif-gps-location"; - $block->title = t("Location"); - if (module::get_var("exif_gps", "sidebar_mapformat") == 1) { - $block->content = new View("exif_gps_dynamic_sidebar.html"); - if (module::get_var("exif_gps", "sidebar_maptype") == 0) $block->content->sidebar_map_type = "ROADMAP"; - if (module::get_var("exif_gps", "sidebar_maptype") == 1) $block->content->sidebar_map_type = "SATELLITE"; - if (module::get_var("exif_gps", "sidebar_maptype") == 2) $block->content->sidebar_map_type = "HYBRID"; - if (module::get_var("exif_gps", "sidebar_maptype") == 3) $block->content->sidebar_map_type = "TERRAIN"; - } else { - $block->content = new View("exif_gps_static_sidebar.html"); - if (module::get_var("exif_gps", "sidebar_maptype") == 0) $block->content->sidebar_map_type = "roadmap"; - if (module::get_var("exif_gps", "sidebar_maptype") == 1) $block->content->sidebar_map_type = "satellite"; - if (module::get_var("exif_gps", "sidebar_maptype") == 2) $block->content->sidebar_map_type = "hybrid"; - if (module::get_var("exif_gps", "sidebar_maptype") == 3) $block->content->sidebar_map_type = "terrain"; - } - $block->content->latitude = $latitude; - $block->content->longitude = $longitude; - } elseif (($theme->item()) && ($theme->item->is_album() && (module::get_var("exif_gps", "sidebar_mapformat") == 1))) { - // If coordinates were NOT found, and this is an album with a dynamic map, then map the contents of the album. - $items = ORM::factory("item", $theme->item->id) - ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") - ->viewable() - ->order_by("exif_coordinates.latitude", "ASC") - ->descendants(); - if (count($items) > 0) { - $block = new Block(); - $block->css_id = "g-exif-gps-location"; - $block->title = t("Location"); - $block->content = new View("exif_gps_dynamic2_sidebar.html"); - if (module::get_var("exif_gps", "sidebar_maptype") == 0) $block->content->sidebar_map_type = "ROADMAP"; - if (module::get_var("exif_gps", "sidebar_maptype") == 1) $block->content->sidebar_map_type = "SATELLITE"; - if (module::get_var("exif_gps", "sidebar_maptype") == 2) $block->content->sidebar_map_type = "HYBRID"; - if (module::get_var("exif_gps", "sidebar_maptype") == 3) $block->content->sidebar_map_type = "TERRAIN"; - $block->content->items = $items; - $block->content->google_map_key = module::get_var("exif_gps", "googlemap_api_key"); - } - } - break; - } - return $block; - } -} diff --git a/3.1/modules/exif_gps/helpers/exif_gps_event.php b/3.1/modules/exif_gps/helpers/exif_gps_event.php deleted file mode 100644 index 9ee59df9..00000000 --- a/3.1/modules/exif_gps/helpers/exif_gps_event.php +++ /dev/null @@ -1,220 +0,0 @@ -module == "exif") { - $data->messages["warn"][] = t("The EXIF_GPS module requires the EXIF module."); - } - } - - static function module_change($changes) { - // If EXIF is deactivated, display a warning that it is required for this module to function properly. - if (!module::is_active("exif") || in_array("exif", $changes->deactivate)) { - site_status::warning( - t("The EXIF_GPS module requires the EXIF module. " . - "Activate the EXIF module now", - array("url" => html::mark_clean(url::site("admin/modules")))), - "exif_gps_needs_exif"); - } else { - site_status::clear("exif_gps_needs_exif"); - } - } - - static function item_created($item) { - // Whenever a new non-album item is created, check it for GPS coordinates. - if (!$item->is_album()) { - exif_gps::extract($item); - } - } - - static function item_deleted($item) { - // Whenever an item is deleted, delete any corresponding GPS coordinates. - db::build() - ->delete("exif_coordinates") - ->where("item_id", "=", $item->id) - ->execute(); - } - - static function item_edit_form($item, $form) { - // Allow users to set / edit the GPS coordinates associated with the current item. - $record = ORM::factory("exif_coordinate")->where("item_id", "=", $item->id)->find(); - $gpsdata = $form->edit_item->group("gps_data")->label("GPS Data"); - if ($record->loaded()) { - $gpsdata->input("latitude")->label(t("Latitude")) - ->value($record->latitude); - $gpsdata->input("longitude")->label(t("Longitude")) - ->value($record->longitude); - } else { - $gpsdata->input("latitude")->label(t("Latitude")); - $gpsdata->input("longitude")->label(t("Longitude")); - } - } - - static function item_edit_form_completed($item, $form) { - // Update the db records with the user-specified coordinates. - - // Require a set of coordinates (both latitude and longitude). - // If one or both fields are blank, completely delete any coordinates associated with this item. - if (($form->edit_item->gps_data->latitude->value == "") || ($form->edit_item->gps_data->longitude->value == "")) { - db::build() - ->delete("exif_coordinates") - ->where("item_id", "=", $item->id) - ->execute(); - } else { - $record = ORM::factory("exif_coordinate")->where("item_id", "=", $item->id)->find(); - if (!$record->loaded()) { - $record->item_id = $item->id; - } - $record->latitude = $form->edit_item->gps_data->latitude->value; - $record->longitude = $form->edit_item->gps_data->longitude->value; - $record->save(); - } - } - - static function admin_menu($menu, $theme) { - // Add a link to the EXIF_GPS admin page to the Settings menu. - $menu->get("settings_menu") - ->append(Menu::factory("link") - ->id("exif_gps") - ->label(t("EXIF_GPS Settings")) - ->url(url::site("admin/exif_gps"))); - } - - static function photo_menu($menu, $theme) { - $album_id = ""; - $item = $theme->item; - if ($item->is_album()) { - $album_id = $item->id; - } else { - $album_id = $item->parent_id; - } - $curr_user = ORM::factory("user")->where("id", "=", $item->owner_id)->find_all(); - $user_name = $curr_user[0]->full_name; - - // Make sure there are actually map-able items to display. - $album_items_count = ORM::factory("item", $album_id) - ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") - ->viewable() - ->order_by("exif_coordinates.latitude", "ASC") - ->descendants_count(); - $user_items_count = ORM::factory("item") - ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") - ->where("items.owner_id", "=", $item->owner_id) - ->viewable() - ->order_by("exif_coordinates.latitude", "ASC") - ->count_all(); - - if (($album_items_count > 0) && (module::get_var("exif_gps", "toolbar_map_album") == true)) { - $menu->append(Menu::factory("link") - ->id("exif_gps_album") - ->label(t("Map this album")) - ->url(url::site("exif_gps/map/album/" . $album_id)) - ->css_id("g-exif-gps-album-link")); - } - if (($user_items_count > 0) && (module::get_var("exif_gps", "toolbar_map_user") == true)) { - $menu->append(Menu::factory("link") - ->id("exif_gps_user") - ->label(t("Map ") . $user_name . t("'s photos")) - ->url(url::site("exif_gps/map/user/" . $item->owner_id)) - ->css_id("g-exif-gps-user-link")); - } - } - - static function movie_menu($menu, $theme) { - $album_id = ""; - $item = $theme->item; - if ($item->is_album()) { - $album_id = $item->id; - } else { - $album_id = $item->parent_id; - } - $curr_user = ORM::factory("user")->where("id", "=", $item->owner_id)->find_all(); - $user_name = $curr_user[0]->full_name; - - // Make sure there are actually map-able items to display. - $album_items_count = ORM::factory("item", $album_id) - ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") - ->viewable() - ->order_by("exif_coordinates.latitude", "ASC") - ->descendants_count(); - $user_items_count = ORM::factory("item") - ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") - ->where("items.owner_id", "=", $item->owner_id) - ->viewable() - ->order_by("exif_coordinates.latitude", "ASC") - ->count_all(); - - if (($album_items_count > 0) && (module::get_var("exif_gps", "toolbar_map_album") == true)) { - $menu->append(Menu::factory("link") - ->id("exif_gps_album") - ->label(t("Map this album")) - ->url(url::site("exif_gps/map/album/" . $album_id)) - ->css_id("g-exif-gps-album-link")); - } - if (($user_items_count > 0) && (module::get_var("exif_gps", "toolbar_map_user") == true)) { - $menu->append(Menu::factory("link") - ->id("exif_gps_user") - ->label(t("Map ") . $user_name . t("'s photos")) - ->url(url::site("exif_gps/map/user/" . $item->owner_id)) - ->css_id("g-exif-gps-user-link")); - } - } - - static function album_menu($menu, $theme) { - $album_id = ""; - $item = $theme->item; - if ($item->is_album()) { - $album_id = $item->id; - } else { - $album_id = $item->parent_id; - } - $curr_user = ORM::factory("user")->where("id", "=", $item->owner_id)->find_all(); - $user_name = $curr_user[0]->full_name; - - // Make sure there are actually map-able items to display. - $album_items_count = ORM::factory("item", $album_id) - ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") - ->viewable() - ->order_by("exif_coordinates.latitude", "ASC") - ->descendants_count(); - $user_items_count = ORM::factory("item") - ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") - ->where("items.owner_id", "=", $item->owner_id) - ->viewable() - ->order_by("exif_coordinates.latitude", "ASC") - ->count_all(); - - if (($album_items_count > 0) && (module::get_var("exif_gps", "toolbar_map_album") == true)) { - $menu->append(Menu::factory("link") - ->id("exif_gps_album") - ->label(t("Map this album")) - ->url(url::site("exif_gps/map/album/" . $album_id)) - ->css_id("g-exif-gps-album-link")); - } - if (($user_items_count > 0) && (module::get_var("exif_gps", "toolbar_map_user") == true)) { - $menu->append(Menu::factory("link") - ->id("exif_gps_user") - ->label(t("Map ") . $user_name . t("'s photos")) - ->url(url::site("exif_gps/map/user/" . $item->owner_id)) - ->css_id("g-exif-gps-user-link")); - } - } -} diff --git a/3.1/modules/exif_gps/helpers/exif_gps_installer.php b/3.1/modules/exif_gps/helpers/exif_gps_installer.php deleted file mode 100644 index 9dc77968..00000000 --- a/3.1/modules/exif_gps/helpers/exif_gps_installer.php +++ /dev/null @@ -1,82 +0,0 @@ -query("CREATE TABLE IF NOT EXISTS {exif_coordinates} ( - `id` int(9) NOT NULL auto_increment, - `item_id` int(9) NOT NULL, - `latitude` varchar(128) NOT NULL, - `longitude` varchar(128) NOT NULL, - PRIMARY KEY (`id`), - KEY(`item_id`, `id`)) - DEFAULT CHARSET=utf8;"); - - // If tagsmap is installed, copy the API key over. - if (module::is_active("tagsmap")) { - module::set_var("exif_gps", "googlemap_api_key", module::get_var("tagsmap", "googlemap_api_key")); - } - - // Set some default values. - module::set_var("exif_gps", "sidebar_zoom", "14"); - module::set_var("exif_gps", "sidebar_mapformat", "1"); - module::set_var("exif_gps", "sidebar_maptype", "1"); - module::set_var("exif_gps", "largemap_maptype", "2"); - - // Set the module version number. - module::set_version("exif_gps", 2); - } - - static function upgrade($version) { - if ($version == 1) { - // If tagsmap is installed, copy the API key over. - if (module::is_active("tagsmap")) { - module::set_var("exif_gps", "googlemap_api_key", module::get_var("tagsmap", "googlemap_api_key")); - } - - // Set some default values. - module::set_var("exif_gps", "sidebar_zoom", "14"); - module::set_var("exif_gps", "sidebar_mapformat", "1"); - module::set_var("exif_gps", "sidebar_maptype", "1"); - module::set_var("exif_gps", "largemap_maptype", "2"); - module::set_version("exif_gps", 2); - } - } - - static function deactivate() { - 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(); - $db->query("DROP TABLE IF EXISTS {exif_coordinates};"); - module::delete("exif_gps"); - } -} diff --git a/3.1/modules/exif_gps/helpers/exif_gps_task.php b/3.1/modules/exif_gps/helpers/exif_gps_task.php deleted file mode 100644 index b07646ad..00000000 --- a/3.1/modules/exif_gps/helpers/exif_gps_task.php +++ /dev/null @@ -1,92 +0,0 @@ -delete("exif_coordinates") - ->where("item_id", "NOT IN", - db::build()->select("id")->from("items")) - ->execute(); - - // Display an option on the maintance screen for scanning existing photos - // for GPS data (in case photos were uploaded before the module was active). - return array(Task_Definition::factory() - ->callback("exif_gps_task::update_gps_index") - ->name(t("Extract Exif GPS data")) - ->description(t("Scan all photos for missing GPS data")) - ->severity(log::SUCCESS)); - } - - static function update_gps_index($task) { - $start = microtime(true); - - // Figure out the total number of photos in the database. - // If this is the first run, also set last_id and completed to 0. - $total = $task->get("total"); - if (empty($total)) { - $task->set("total", $total = count(ORM::factory("item")->where("type", "=", "photo")->find_all())); - $task->set("last_id", 0); - $task->set("completed", 0); - } - $last_id = $task->get("last_id"); - $completed = $task->get("completed"); - - // Generate an array of the next 100 photos to check. - //$all_photos = ORM::factory("item") - // ->where("id", ">", $last_id) - // ->where("type", "=", "photo") - // ->order_by("id") - // ->find_all(100); - - // Check each photo in the array to see if it already has exif gps data associated with it. - // If it doesn't, attempt to extract gps coordinates. - foreach (ORM::factory("item") - ->where("id", ">", $last_id) - ->where("type", "=", "photo") - ->order_by("id") - ->find_all(100) as $item) { - - $record = ORM::factory("exif_coordinate")->where("item_id", "=", $item->id)->find(); - if (!$record->loaded()) { - exif_gps::extract($item); - } - $last_id = $item->id; - $completed++; - - if ($completed == $total || microtime(true) - $start > 1.5) { - break; - } - } - - $task->set("completed", $completed); - $task->set("last_id", $last_id); - - if ($total == $completed) { - $task->done = true; - $task->state = "success"; - $task->percent_complete = 100; - } else { - $task->percent_complete = round(100 * $completed / $total); - } - $task->status = t2("One photo scanned", "%count / %total photos scanned", $completed, - array("total" => $total)); - } -} diff --git a/3.1/modules/exif_gps/helpers/exif_gps_theme.php b/3.1/modules/exif_gps/helpers/exif_gps_theme.php deleted file mode 100644 index 90431195..00000000 --- a/3.1/modules/exif_gps/helpers/exif_gps_theme.php +++ /dev/null @@ -1,24 +0,0 @@ -css("exif_gps_menu.css"); - } -} diff --git a/3.1/modules/exif_gps/images/ico-view-exif_gps_album.png b/3.1/modules/exif_gps/images/ico-view-exif_gps_album.png deleted file mode 100644 index 255d6496..00000000 Binary files a/3.1/modules/exif_gps/images/ico-view-exif_gps_album.png and /dev/null differ diff --git a/3.1/modules/exif_gps/images/ico-view-exif_gps_user.png b/3.1/modules/exif_gps/images/ico-view-exif_gps_user.png deleted file mode 100644 index e9f72b3b..00000000 Binary files a/3.1/modules/exif_gps/images/ico-view-exif_gps_user.png and /dev/null differ diff --git a/3.1/modules/exif_gps/module.info b/3.1/modules/exif_gps/module.info deleted file mode 100644 index ebde931e..00000000 --- a/3.1/modules/exif_gps/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Exif GPS Data" -description = "Extract Exif GPS data from photos." -version = 2 -author_name = "rWatcher" -author_url = "http://codex.gallery2.org/User:RWatcher" -info_url = "http://codex.gallery2.org/Gallery3:Modules:exif_gps" -discuss_url = "http://gallery.menalto.com/node/94762" diff --git a/3.1/modules/exif_gps/views/admin_exif_gps.html.php b/3.1/modules/exif_gps/views/admin_exif_gps.html.php deleted file mode 100644 index dcfed2c9..00000000 --- a/3.1/modules/exif_gps/views/admin_exif_gps.html.php +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/3.1/modules/exif_gps/views/exif_gps_dynamic2_sidebar.html.php b/3.1/modules/exif_gps/views/exif_gps_dynamic2_sidebar.html.php deleted file mode 100644 index f4f95799..00000000 --- a/3.1/modules/exif_gps/views/exif_gps_dynamic2_sidebar.html.php +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - diff --git a/3.1/modules/exif_gps/views/exif_gps_dynamic_sidebar.html.php b/3.1/modules/exif_gps/views/exif_gps_dynamic_sidebar.html.php deleted file mode 100644 index ff28e101..00000000 --- a/3.1/modules/exif_gps/views/exif_gps_dynamic_sidebar.html.php +++ /dev/null @@ -1,22 +0,0 @@ - - - - diff --git a/3.1/modules/exif_gps/views/exif_gps_map.html.php b/3.1/modules/exif_gps/views/exif_gps_map.html.php deleted file mode 100644 index 95f6221c..00000000 --- a/3.1/modules/exif_gps/views/exif_gps_map.html.php +++ /dev/null @@ -1,96 +0,0 @@ - - - - -
      -
      - dynamic_top() ?> -
      -

      -
      -
      -
      - -
      - -dynamic_bottom() ?> diff --git a/3.1/modules/exif_gps/views/exif_gps_maps_sidebar.html.php b/3.1/modules/exif_gps/views/exif_gps_maps_sidebar.html.php deleted file mode 100644 index 495554ac..00000000 --- a/3.1/modules/exif_gps/views/exif_gps_maps_sidebar.html.php +++ /dev/null @@ -1,9 +0,0 @@ - -
        - 0): ?> -
      • ">
      • - - 0): ?> -
      • ">
      • - -
      diff --git a/3.1/modules/exif_gps/views/exif_gps_static_sidebar.html.php b/3.1/modules/exif_gps/views/exif_gps_static_sidebar.html.php deleted file mode 100644 index 11d80c74..00000000 --- a/3.1/modules/exif_gps/views/exif_gps_static_sidebar.html.php +++ /dev/null @@ -1,2 +0,0 @@ - -&size=205x214&maptype=&markers=color:red|color:red|,&sensor=false"> diff --git a/3.1/modules/export_facebook/controllers/export_facebook.php b/3.1/modules/export_facebook/controllers/export_facebook.php deleted file mode 100644 index e40f9a40..00000000 --- a/3.1/modules/export_facebook/controllers/export_facebook.php +++ /dev/null @@ -1,70 +0,0 @@ -where("type", "=", "album") - ->where("id", "!=", "1") - ->viewable() - ->find_all(); - - // Loop through each album and output the necessary information. - foreach ($albums as $album) { - $album_contents = ORM::factory("item") - ->where("parent_id", "=", $album->id) - ->where("type", "=", "photo") - ->viewable() - ->find_all(); - - print ($album->level-2) . "\t" . $album->id . "\t" . $album->name . "\t" . count($album_contents) . "\n"; - } - - } else if ($_GET['a'] == "photos") { - // Generate an array of photo's in the specified album. - $photos = ORM::factory("item") - ->where("type", "=", "photo") - ->where("parent_id", "=", $_GET['id']) - ->viewable() - ->find_all(); - - // Loop through each photo, generate a list of tags (if available) and then output the necessary information. - foreach ($photos as $photo) { - $photo_keywords = ""; - if (module::is_active("tag")) { - $photo_tags = ORM::factory("tag") - ->join("items_tags", "tags.id", "items_tags.tag_id") - ->where("items_tags.item_id", "=", $photo->id) - ->find_all(); - foreach ($photo_tags as $tag) { - $photo_keywords = $photo_keywords . $tag->name . ", "; - } - // Cut off the ", " from the end of the string. - if ($photo_keywords != "") { - $photo_keywords = substr($photo_keywords, 0, -2); - } - } - print $photo->id . "\t" . $photo->title . "\t" . stristr($photo->resize_url(false),"/var/") . "\t" . stristr($photo->thumb_url(false), "/var/") . "\t\t" . $photo->description . "\t" . $photo_keywords . "\n"; - } - } - } -} \ No newline at end of file diff --git a/3.1/modules/export_facebook/module.info b/3.1/modules/export_facebook/module.info deleted file mode 100644 index f7388b95..00000000 --- a/3.1/modules/export_facebook/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "export_facebook" -description = "Export Photos from Gallery 3 to Facebook." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:export_facebook" -discuss_url = "http://gallery.menalto.com/forum_module_export_facebook" diff --git a/3.1/modules/favourites/controllers/admin_favourites_configure.php b/3.1/modules/favourites/controllers/admin_favourites_configure.php deleted file mode 100644 index ad6af6f6..00000000 --- a/3.1/modules/favourites/controllers/admin_favourites_configure.php +++ /dev/null @@ -1,50 +0,0 @@ -validate()) { - - favourites_configuration::extractForm($form); - message::success(t("Favourites Module Configured!")); - } - } - else - { - favourites_configuration::populateForm($form); - } - - $view = new Admin_View("admin.html"); - $view->content = new View("admin_favourites_configure.html"); - - $view->content->form = $form; - - print $view; - } -} diff --git a/3.1/modules/favourites/controllers/favourites.php b/3.1/modules/favourites/controllers/favourites.php deleted file mode 100644 index d7989682..00000000 --- a/3.1/modules/favourites/controllers/favourites.php +++ /dev/null @@ -1,206 +0,0 @@ -name =="guest"){ - //login required. - url::redirect("login/html"); - return; - } - - $album = Favourites::getOrCreate()->get_as_album(); - - $page_size = module::get_var("gallery", "page_size", 9); - $input = Input::instance(); - $show = $input->get("show"); - - if ($show) { - $child = ORM::factory("item", $show); - $index = $album->get_position($child); - if ($index) { - $page = ceil($index / $page_size); - if ($page == 1) { - //url::redirect("favourites"); - } else { - //url::redirect("favourites?page=$page"); - } - } - } - - - $page = $input->get("page", "1"); - $children_count = $album->viewable()->children_count(); - $offset = ($page - 1) * $page_size; - $max_pages = max(ceil($children_count / $page_size), 1); - - - // Make sure that the page references a valid offset - if ($page < 1) { - //url::redirect($album->abs_url()); - } else if ($page > $max_pages) { - //url::redirect($album->abs_url("page=$max_pages")); - } - - - - $template = new Theme_View("page.html", "collection", "favourites"); - $template->set_global("page", $page); - $template->set_global("page_title", null); - $template->set_global("max_pages", $max_pages); - $template->set_global("page_size", $page_size); - $template->set_global("children", $album->viewable()->children($page_size, $offset)); - $template->set_global("children_count", $children_count); - $template->content = new View("dynamic.html"); - - print $template; - } - - public function view(){ - if (favourites_configuration::isUsersOnly() && identity::active_user()->name =="guest"){ - //login required. - Session::instance()->set("continue_url", url::current(true)); - $template = new Theme_View("page.html", "collection", "album"); - $template->content = new View("login_required.html"); - $template->content->login_form = new View("login_ajax.html"); - $template->content->login_form->form = auth::get_login_form("login/auth_html"); - print $template; - return; - } - - // extract details from url - $favourites = Favourites::getOrCreate(); - $favourites->clear(); - $array = func_get_args(); - foreach($array as $i=>$item){ - $favourites->toggle($item); - } - url::redirect("favourites"); - } - - private function getSaveForm(){ - - $form = new Forge("favourites/save_favourites", "", "post", array("id" => "gAddToBasketForm")); - $group = $form->group("save")->label(t("Save Favourites")); - $group->hidden("id"); - $group->input("fullname")->label(t("Name"))->id("gname") - ->error_messages("required", t("You must provide your name")) - ->error_messages("not_logged_in", t("You must be logged in to send favourites.")) - ->rules("required"); - $group->input("email")->label(t("Email Address"))->id("gemail") - ->error_messages("required", t("You must provide an email address")) - ->error_messages("valid_email", t("You must provide a valid email address")) - ->rules("valid_email") - ->rules("required"); - $group->textarea("details")->label(t("Comments"))->id("gdetails"); - - $group->submit("")->value(t("save")); - return $form; - } - public function save(){ - $view = new View("save_dialog.html"); - - // get the basket to add to - $form = self::getSaveForm(); - $view->form = $form; - - print $view; - - } - - public function save_favourites($id){ - - access::verify_csrf(); - - $form = self::getSaveForm(); - $valid = $form->validate(); - $name = $form->save->fullname->value; - $email_address = $form->save->email->value; - $comments = $form->save->details->value; - - - if (!isset($email_address ) || strlen($email_address) == 0) { - $valid=false; - $form->save->email->add_error("required", 1); - } - - if (!isset($name ) || strlen($name) == 0) { - $valid=false; - $form->save->fullname->add_error("required", 1); - } - - if (favourites_configuration::isUsersOnly() && identity::active_user()->name =="guest"){ - $valid=false; - $form->save->fullname->add_error("not_logged_in", 1); - } - - if ($valid){ - - $favourites = Favourites::getOrCreate(); - - $from = "From: ".favourites_configuration::getFromEmailAddress(); - - if (favourites_configuration::isEmailAdmin()) - { - $admin_email = $name." has chosen following photo as his or her favourites.\n"; - - // create the order items - $items = ORM::factory("item")->where("id","in", $favourites->contents)->find_all(); - foreach ($items->contents as $id=>$item){ - $admin_email = $admin_email." - ".$item->title." - ".$item->url().""; - } - $admin_email = $admin_email."\n you can view this favourite list at \n".$favourites->getUrl() - ."\n\n He or she has included the additional comments. \n".$comments - ."\n You can e-mail him or her with the following e-mail address ".$email_address; - - mail(favourites_configuration::getEmailAddress(), $name."'s favourites.", $admin_email, $from); - } - - $email = favourites_configuration::replaceStrings( - favourites_configuration::getEmailTemplate(), - Array( - "name"=>$name, - "comments"=>$comments, - "url"=>$favourites->getUrl(), - "owner"=>favourites_configuration::getOwner())); - - mail($email_address,$name."'s Favourites",$email, $from); - - json::reply(array("result" => "success", "location" => url::site("favourites"))); - return; - } - json::reply(array("result" => "error", "html" => (string)$form)); - } - - public function toggle_favourites($id){ - $favourites = Favourites::getOrCreate(); - $infavour = $favourites ->toggle($id); - $title = $infavour?t("Remove from favourites"):t("Add to favourites"); - json::reply(array("result" => "success", - "favourite" => $infavour, - "hasfavourites" => $favourites->hasFavourites(), - "title" => (string)$title)); - } - - public function clear_favourites(){ - Favourites::getOrCreate()->clear(); - } -} diff --git a/3.1/modules/favourites/css/favourites.css b/3.1/modules/favourites/css/favourites.css deleted file mode 100644 index 2f025504..00000000 --- a/3.1/modules/favourites/css/favourites.css +++ /dev/null @@ -1,15 +0,0 @@ -.icon-f{width:32px; height:32px; display:inline-block; background-image: url(../images/faves.png); position:absolute; top:20px; left:0; z-index:20} -.icon-f:hover{background-position: 0 -64px ;} -.icon-f.f-selected{background-position: 0 -32px ;} -.icon-f.f-working{background-position: 0 -96px ;} -#f-view-link {float:right;position:relative; width:50px; height:50px;} -#f-view-link a{width:64px; height:64px; display:inline-block;background-position: -96px 0px;background-image: url(../images/faves.png); position:absolute; top:15px; right:0;} -#f-view-link a:hover{background-position: -96px -64px ;} -#f-save-link {float:right;position:relative; width:64px; height:64px;} -#f-save-link a{width:64px; height:64px; display:inline-block;background-position: -32px 0px;background-image: url(../images/faves.png); position:absolute; top:15px; right:0;} -#f-save-link a:hover{background-position: -32px -64px ;} -.rtl .icon-f{right:0;left:auto;} -.rtl #f-view-link{float:left;} -.rtl #f-view-link a{left:0;right:auto;} -.rtl #f-save-link{float:left;} -.rtl #f-save-link a{left:0;right:auto;} \ No newline at end of file diff --git a/3.1/modules/favourites/helpers/favourites_configuration.php b/3.1/modules/favourites/helpers/favourites_configuration.php deleted file mode 100644 index cae987f4..00000000 --- a/3.1/modules/favourites/helpers/favourites_configuration.php +++ /dev/null @@ -1,144 +0,0 @@ - "g-configure-form")); - - $group = $form->group("configure")->label(t("Configure Favourites")); - $group->dropdown("select_allow") - ->label(t("Please choose what a user can select as a favourite")) - ->options(Array(1=>t("Items only"), 2=>"albums only", 3=>"Both")); - $group->input("fromemail")->label(t("From Email address for site emails"))->id("g-from-email-address"); - $group->checkbox("email_admin")->label(t("Email site owner every saved favourites list"))->id("g-email-admin"); - $group->input("email")->label(t("Email address of Site Owner"))->id("g-owner-email-address"); - $group->input("owner")->label(t("Site Owners name"))->id("g-owner-name"); - $group->checkbox("users_only")->label(t("Only Registered users can create favourites"))->id("g-users-only"); - $group->textarea("email_template")->label(t("Email Template"))->id("g-email-template"); - $group->submit("")->value(t("Save")); - return $form; - } - - static function populateForm($form){ - $form->configure->email->value(favourites_configuration::getEmailAddress()); - $form->configure->fromemail->value(favourites_configuration::getFromEmailAddress()); - $form->configure->email_admin->checked(favourites_configuration::isEmailAdmin()); - $form->configure->users_only->checked(favourites_configuration::isUsersOnly()); - $form->configure->owner->value(favourites_configuration::getOwner()); - $form->configure->email_template->value(favourites_configuration::getEmailTemplate()); - $form->configure->select_allow->selected(favourites_configuration::getSelectAllow()); - } - - static function extractForm($form){ - $email = $form->configure->email->value; - $emailfrom = $form->configure->fromemail->value; - $owner = $form->configure->owner->value; - $is_email_admin = $form->configure->email_admin->value; - $is_users_only = $form->configure->users_only->value; - $email_template = $form->configure->email_template->value; - $select_from = $form->configure->select_allow->selected; - favourites_configuration::setEmailAddress($email); - favourites_configuration::setEmailAdmin($is_email_admin); - favourites_configuration::setFromEmailAddress($emailfrom); - favourites_configuration::setOwner($owner); - favourites_configuration::setUsersOnly($is_users_only); - favourites_configuration::setEmailTemplate($email_template); - favourites_configuration::setSelectAllow($select_from); - } - - static function replaceStrings($string, $key_values) { - // Replace x_y before replacing x. - krsort($key_values, SORT_STRING); - - $keys = array(); - $values = array(); - foreach ($key_values as $key => $value) { - $keys[] = "%$key"; - $values[] = $value; - } - return str_replace($keys, $values, $string); - } - - static function getEmailAddress(){ - return module::get_var("favourites","email"); - } - - static function setEmailAddress($email){ - module::set_var("favourites","email",$email); - } - - static function getOwner(){ - return module::get_var("favourites","owner"); - } - - static function setOwner($owner){ - module::set_var("favourites","owner",$owner); - } - - static function getFromEmailAddress(){ - return module::get_var("favourites","from_email"); - } - - static function setFromEmailAddress($fromemail){ - module::set_var("favourites","from_email",$fromemail); - } - - static function isEmailAdmin(){ - return module::get_var("favourites","email_admin"); - } - - static function setEmailAdmin($email_admin){ - module::set_var("favourites","email_admin",$email_admin); - } - - static function isUsersOnly(){ - return module::get_var("favourites","users_only"); - } - - static function setUsersOnly($users_only){ - module::set_var("favourites","users_only",$users_only); - } - - static function getSelectAllow(){ - return module::get_var("favourites","select_from",1); - } - - static function setSelectAllow($select_from){ - module::set_var("favourites","select_from",$select_from); - } - - static function getEmailTemplate(){ - return module::get_var("favourites","email_template"); - } - - static function setEmailTemplate($email_template){ - module::set_var("favourites","email_template",$email_template); - } - - static function canSelectAlbums(){ - return self::getSelectAllow()!=1; - } - - static function canSelectItems(){ - return self::getSelectAllow()!=2; - } - -} \ No newline at end of file diff --git a/3.1/modules/favourites/helpers/favourites_event.php b/3.1/modules/favourites/helpers/favourites_event.php deleted file mode 100644 index a96ada02..00000000 --- a/3.1/modules/favourites/helpers/favourites_event.php +++ /dev/null @@ -1,34 +0,0 @@ -add_after("users_groups", - Menu::factory("link") - ->id("configure_favourites") - ->label(t("Favourites")) - ->url(url::site("admin/favourites_configure"))); - } - -} \ No newline at end of file diff --git a/3.1/modules/favourites/helpers/favourites_installer.php b/3.1/modules/favourites/helpers/favourites_installer.php deleted file mode 100644 index 91250521..00000000 --- a/3.1/modules/favourites/helpers/favourites_installer.php +++ /dev/null @@ -1,37 +0,0 @@ -css("favourites.css") - . $theme->script("favourites.js"); - } - - static function header_top($theme) { - - if (favourites_configuration::isUsersOnly() && identity::active_user()->name =="guest"){ - return; - } - - if ($theme->page_subtype=="favourites"){ - $view = new View("save_favourites.html"); - $view->favourites = Favourites::getOrCreate(); - return $view->render(); - } - else{ - $view = new View("view_favourites.html"); - $view->favourites = Favourites::getOrCreate(); - return $view->render(); - } - } - - static function photo_top($theme){ - if (!favourites_configuration::canSelectItems() || - (favourites_configuration::isUsersOnly() && identity::active_user()->name =="guest")){ - return; - } - - $view = new View("add_to_favourites.html"); - $view->item = $theme->item(); - $view->favourites = Favourites::getOrCreate(); - return $view->render(); - } - - static function thumb_top($theme, $item){ - if (favourites_configuration::isUsersOnly() && identity::active_user()->name =="guest"){ - return; - } - - if (($item->type=="album" && favourites_configuration::canSelectAlbums()) || - ($item->type!="album" && favourites_configuration::canSelectItems())){ - $view = new View("add_to_favourites.html"); - $view->item = $item; - $view->favourites = Favourites::getOrCreate(); - return $view->render(); - } - } - -} \ No newline at end of file diff --git a/3.1/modules/favourites/images/faves.png b/3.1/modules/favourites/images/faves.png deleted file mode 100644 index ebcccad0..00000000 Binary files a/3.1/modules/favourites/images/faves.png and /dev/null differ diff --git a/3.1/modules/favourites/js/favourites.js b/3.1/modules/favourites/js/favourites.js deleted file mode 100644 index 1eac91a8..00000000 --- a/3.1/modules/favourites/js/favourites.js +++ /dev/null @@ -1,30 +0,0 @@ -$(window).load(function() { - var favlink = $("#f-view-link"); - - $(".icon-f").each(function(){ - var elem = $(this); - var href = elem.attr("href"); - function clickFavourite(e){ - elem.addClass("f-working"); - $.getJSON(href,function (data){ - elem.removeClass("f-working"); - if (data.favourite){ - elem.addClass("f-selected"); - elem.attr("title",data.title); - } - else{ - elem.removeClass("f-selected"); - elem.attr("title",data.title); - } - if (data.hasfavourites){ - favlink.css('display','block'); - }else{ - favlink.css('display','none'); - } - - }); - return false; - } - elem.bind("click",clickFavourite); - }); -}); \ No newline at end of file diff --git a/3.1/modules/favourites/libraries/Favourites.php b/3.1/modules/favourites/libraries/Favourites.php deleted file mode 100644 index 93af434c..00000000 --- a/3.1/modules/favourites/libraries/Favourites.php +++ /dev/null @@ -1,63 +0,0 @@ -contents as $i => $value) { - if ($value==$id){ - unset($this->contents[$i]); - return false; - } - } - $this->contents[]=$id; - return true; - } - - public function contains($id){ - foreach ($this->contents as $i => $value){ - if ($value==$id) return true; - } - return false; - } - - public function hasFavourites(){ - return !empty($this->contents); - } - - public function get_as_album(){ - return Pseudo_album::create($this); - } - - public function clear(){ - $this->contents = array(); - } - - public function getUrl(){ - - $toReturn = url::site("favourites/view","http"); - - foreach ($this->contents as $i => $value){ - $toReturn = $toReturn."/".$value; - } - return $toReturn; - } - - public static function get(){ - return Session::instance()->get("favourites"); - } - - - public static function getOrCreate(){ - $session = Session::instance(); - - $favourites = $session->get("favourites"); - if (!$favourites) - { - $favourites = new Favourites(); - $session->set("favourites", $favourites); - } - return $favourites; - } -} diff --git a/3.1/modules/favourites/libraries/Pseudo_album.php b/3.1/modules/favourites/libraries/Pseudo_album.php deleted file mode 100644 index b4372121..00000000 --- a/3.1/modules/favourites/libraries/Pseudo_album.php +++ /dev/null @@ -1,396 +0,0 @@ -favourites = $favourites; - // Set reasonable defaults - $this->created = time(); - $this->rand_key = ((float)mt_rand()) / (float)mt_getrandmax(); - $this->thumb_dirty = 1; - $this->resize_dirty = 1; - $this->sort_column = "created"; - $this->sort_order = "ASC"; - $this->owner_id = identity::active_user()->id; - $this->parent_id = 1; - - $this->id = 1; - $this->type="album"; - $this->title=t("Favourites"); - $this->description=t("Currently selected favourites"); - } - - public function parent(){ - return ORM::factory("item")->where("id","=",1)->find(); - } - - public static function create($favourites) - { - return new Pseudo_album($favourites); - } - - public function loaded(){ - return true; - } - - public function children_count(){ - return count($this->favourites->contents); - } - - public function parents(){ - return ORM::factory("item")->where("id","=", 1)->find_all(); - } - - /** - * Add a set of restrictions to any following queries to restrict access only to items - * viewable by the active user. - * @chainable - */ - public function viewable() { - return $this; - } - - /** - * Is this item an album? - * @return true if it's an album - */ - public function is_album() { - return true; - } - - /** - * Is this item a photo? - * @return true if it's a photo - */ - public function is_photo() { - return false; - } - - /** - * Is this item a movie? - * @return true if it's a movie - */ - public function is_movie() { - return false; - } - - public function delete($ignored_id=null) { - } - - /** - * Specify the path to the data file associated with this item. To actually associate it, - * you still have to call save(). - * @chainable - */ - public function set_data_file($data_file) { - } - - /** - * Return the server-relative url to this item, eg: - * /gallery3/index.php/BobsWedding?page=2 - * /gallery3/index.php/BobsWedding/Eating-Cake.jpg - * - * @param string $query the query string (eg "show=3") - */ - public function url($query=null) { - $url = url::site("favourites"); - if ($query) { - $url .= "?$query"; - } - return $url; - } - - /** - * Return the full url to this item, eg: - * http://example.com/gallery3/index.php/BobsWedding?page=2 - * http://example.com/gallery3/index.php/BobsWedding/Eating-Cake.jpg - * - * @param string $query the query string (eg "show=3") - */ - public function abs_url($query=null) { - $url = url::abs_site("favourites"); - if ($query) { - $url .= "?$query"; - } - return $url; - } - - /** - * album: /var/albums/album1/album2 - * photo: /var/albums/album1/album2/photo.jpg - */ - public function file_path() { - return VARPATH . "albums/"; - } - - /** - * album: http://example.com/gallery3/var/resizes/album1/ - * photo: http://example.com/gallery3/var/albums/album1/photo.jpg - */ - public function file_url($full_uri=false) { - return; - } - - /** - * album: /var/resizes/album1/.thumb.jpg - * photo: /var/albums/album1/photo.thumb.jpg - */ - public function thumb_path() { - } - - /** - * Return true if there is a thumbnail for this item. - */ - public function has_thumb() { - return false; - } - - /** - * album: http://example.com/gallery3/var/resizes/album1/.thumb.jpg - * photo: http://example.com/gallery3/var/albums/album1/photo.thumb.jpg - */ - public function thumb_url($full_uri=false) { - } - - /** - * album: /var/resizes/album1/.resize.jpg - * photo: /var/albums/album1/photo.resize.jpg - */ - public function resize_path() { - } - - /** - * album: http://example.com/gallery3/var/resizes/album1/.resize.jpg - * photo: http://example.com/gallery3/var/albums/album1/photo.resize.jpg - */ - public function resize_url($full_uri=false) { - } - - - /** - * Return the relative path to this item's file. Note that the components of the path are - * urlencoded so if you want to use this as a filesystem path, you need to call urldecode - * on it. - * @return string - */ - public function relative_path() { - if (!$this->loaded()) { - return; - } - - if (!isset($this->relative_path_cache)) { - $this->_build_relative_caches()->save(); - } - return $this->relative_path_cache; - } - - /** - * Return the relative url to this item's file. - * @return string - */ - public function relative_url() { - } - - - /** - * Handle any business logic necessary to create or modify an item. - * @see ORM::save() - * - * @return ORM Item_Model - */ - public function save() { - } - - /** - * Return the Item_Model representing the cover for this album. - * @return Item_Model or null if there's no cover - */ - public function album_cover() { - return null; - } - - /** - * Find the position of the given child id in this album. The resulting value is 1-indexed, so - * the first child in the album is at position 1. - */ - public function get_position($child, $where=array()) { - /* - if ($this->sort_order == "DESC") { - $comp = ">"; - } else { - $comp = "<"; - } - $db = db::build(); - - // If the comparison column has NULLs in it, we can't use comparators on it and will have to - // deal with it the hard way. - $count = $db->from("items") - ->where("parent_id", "=", $this->id) - ->where($this->sort_column, "IS", null) - ->merge_where($where) - ->count_records(); - - if (empty($count)) { - // There are no NULLs in the sort column, so we can just use it directly. - $sort_column = $this->sort_column; - - $position = $db->from("items") - ->where("parent_id", "=", $this->id) - ->where($sort_column, $comp, $child->$sort_column) - ->merge_where($where) - ->count_records(); - - // We stopped short of our target value in the sort (notice that we're using a < comparator - // above) because it's possible that we have duplicate values in the sort column. An - // equality check would just arbitrarily pick one of those multiple possible equivalent - // columns, which would mean that if you choose a sort order that has duplicates, it'd pick - // any one of them as the child's "position". - // - // Fix this by doing a 2nd query where we iterate over the equivalent columns and add them to - // our base value. - foreach ($db - ->select("id") - ->from("items") - ->where("parent_id", "=", $this->id) - ->where($sort_column, "=", $child->$sort_column) - ->merge_where($where) - ->order_by(array("id" => "ASC")) - ->execute() as $row) { - $position++; - if ($row->id == $child->id) { - break; - } - } - } else { - // There are NULLs in the sort column, so we can't use MySQL comparators. Fall back to - // iterating over every child row to get to the current one. This can be wildly inefficient - // for really large albums, but it should be a rare case that the user is sorting an album - // with null values in the sort column. - // - // Reproduce the children() functionality here using Database directly to avoid loading the - // whole ORM for each row. - $order_by = array($this->sort_column => $this->sort_order); - // Use id as a tie breaker - if ($this->sort_column != "id") { - $order_by["id"] = "ASC"; - } - - $position = 0; - foreach ($db->select("id") - ->from("items") - ->where("parent_id", "=", $this->id) - ->merge_where($where) - ->order_by($order_by) - ->execute() as $row) { - $position++; - if ($row->id == $child->id) { - break; - } - } - } - - return $position;*/ - } - - /** - * Return an tag for the thumbnail. - * @param array $extra_attrs Extra attributes to add to the img tag - * @param int (optional) $max Maximum size of the thumbnail (default: null) - * @param boolean (optional) $center_vertically Center vertically (default: false) - * @return string - */ - public function thumb_img($extra_attrs=array(), $max=null, $center_vertically=false) { - return ""; - } - - /** - * Calculate the largest width/height that fits inside the given maximum, while preserving the - * aspect ratio. - * @param int $max Maximum size of the largest dimension - * @return array - */ - public function scale_dimensions($max) { - } - - /** - * Return an tag for the resize. - * @param array $extra_attrs Extra attributes to add to the img tag - * @return string - */ - public function resize_img($extra_attrs) { - } - - /** - * Return a flowplayer - - - - - \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/27AC86F0820D8F960DBF73C151C0332B.cache.html b/3.1/modules/gwtorganize/war/g3viewer/27AC86F0820D8F960DBF73C151C0332B.cache.html deleted file mode 100644 index 6ae3eb2f..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/27AC86F0820D8F960DBF73C151C0332B.cache.html +++ /dev/null @@ -1,1733 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/396F806CD63ABD414BFBB9D57429F05B.cache.png b/3.1/modules/gwtorganize/war/g3viewer/396F806CD63ABD414BFBB9D57429F05B.cache.png deleted file mode 100644 index 009e9872..00000000 Binary files a/3.1/modules/gwtorganize/war/g3viewer/396F806CD63ABD414BFBB9D57429F05B.cache.png and /dev/null differ diff --git a/3.1/modules/gwtorganize/war/g3viewer/4AFE598FDFDF189DD61F57E554328B10.cache.html b/3.1/modules/gwtorganize/war/g3viewer/4AFE598FDFDF189DD61F57E554328B10.cache.html deleted file mode 100644 index 9f1d2b2a..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/4AFE598FDFDF189DD61F57E554328B10.cache.html +++ /dev/null @@ -1,1840 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/4E8EC2279CB4B46228EFF0682ED166A4.cache.html b/3.1/modules/gwtorganize/war/g3viewer/4E8EC2279CB4B46228EFF0682ED166A4.cache.html deleted file mode 100644 index 7fa662e1..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/4E8EC2279CB4B46228EFF0682ED166A4.cache.html +++ /dev/null @@ -1,1821 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/4F7AD7D8299143D876CB4071BE00BF02.cache.html b/3.1/modules/gwtorganize/war/g3viewer/4F7AD7D8299143D876CB4071BE00BF02.cache.html deleted file mode 100644 index 71d67f32..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/4F7AD7D8299143D876CB4071BE00BF02.cache.html +++ /dev/null @@ -1,1862 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/6462B363383D23B8418857B7A6FAD85B.cache.html b/3.1/modules/gwtorganize/war/g3viewer/6462B363383D23B8418857B7A6FAD85B.cache.html deleted file mode 100644 index e3bf202e..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/6462B363383D23B8418857B7A6FAD85B.cache.html +++ /dev/null @@ -1,1835 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/71ED95F3DFB964762667E45E2922704D.cache.html b/3.1/modules/gwtorganize/war/g3viewer/71ED95F3DFB964762667E45E2922704D.cache.html deleted file mode 100644 index d3b48c83..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/71ED95F3DFB964762667E45E2922704D.cache.html +++ /dev/null @@ -1,1687 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/8603379B5088782D2C0620FAE856E112.cache.png b/3.1/modules/gwtorganize/war/g3viewer/8603379B5088782D2C0620FAE856E112.cache.png deleted file mode 100644 index ded37855..00000000 Binary files a/3.1/modules/gwtorganize/war/g3viewer/8603379B5088782D2C0620FAE856E112.cache.png and /dev/null differ diff --git a/3.1/modules/gwtorganize/war/g3viewer/884CB866FECF37EDDE4914CA60AF2511.cache.html b/3.1/modules/gwtorganize/war/g3viewer/884CB866FECF37EDDE4914CA60AF2511.cache.html deleted file mode 100644 index 70fc28c4..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/884CB866FECF37EDDE4914CA60AF2511.cache.html +++ /dev/null @@ -1,1701 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/9DC95FB4BEC084EF810751F04B440FD7.cache.html b/3.1/modules/gwtorganize/war/g3viewer/9DC95FB4BEC084EF810751F04B440FD7.cache.html deleted file mode 100644 index 59d502f2..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/9DC95FB4BEC084EF810751F04B440FD7.cache.html +++ /dev/null @@ -1,1706 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/A8FBB0ADAFEE7F8EA1CDB15765D13A7F.cache.html b/3.1/modules/gwtorganize/war/g3viewer/A8FBB0ADAFEE7F8EA1CDB15765D13A7F.cache.html deleted file mode 100644 index 87e12a44..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/A8FBB0ADAFEE7F8EA1CDB15765D13A7F.cache.html +++ /dev/null @@ -1,1863 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/CE15F73DB4EDED1CF8F93F95A728792D.cache.html b/3.1/modules/gwtorganize/war/g3viewer/CE15F73DB4EDED1CF8F93F95A728792D.cache.html deleted file mode 100644 index 45651178..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/CE15F73DB4EDED1CF8F93F95A728792D.cache.html +++ /dev/null @@ -1,1868 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/D096B0ED44CBABF1A6B1F2C2D31F4FCC.cache.html b/3.1/modules/gwtorganize/war/g3viewer/D096B0ED44CBABF1A6B1F2C2D31F4FCC.cache.html deleted file mode 100644 index d6666f29..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/D096B0ED44CBABF1A6B1F2C2D31F4FCC.cache.html +++ /dev/null @@ -1,1729 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/DF7764EEC1903CD03C9545B354D8D8E4.cache.png b/3.1/modules/gwtorganize/war/g3viewer/DF7764EEC1903CD03C9545B354D8D8E4.cache.png deleted file mode 100644 index fbae9473..00000000 Binary files a/3.1/modules/gwtorganize/war/g3viewer/DF7764EEC1903CD03C9545B354D8D8E4.cache.png and /dev/null differ diff --git a/3.1/modules/gwtorganize/war/g3viewer/E44767377485D18D6B6864F65BA8EF73.cache.png b/3.1/modules/gwtorganize/war/g3viewer/E44767377485D18D6B6864F65BA8EF73.cache.png deleted file mode 100644 index 030ffab4..00000000 Binary files a/3.1/modules/gwtorganize/war/g3viewer/E44767377485D18D6B6864F65BA8EF73.cache.png and /dev/null differ diff --git a/3.1/modules/gwtorganize/war/g3viewer/EDC7827FEEA59EE44AD790B1C6430C45.cache.png b/3.1/modules/gwtorganize/war/g3viewer/EDC7827FEEA59EE44AD790B1C6430C45.cache.png deleted file mode 100644 index 714cbb11..00000000 Binary files a/3.1/modules/gwtorganize/war/g3viewer/EDC7827FEEA59EE44AD790B1C6430C45.cache.png and /dev/null differ diff --git a/3.1/modules/gwtorganize/war/g3viewer/G3viewer.css b/3.1/modules/gwtorganize/war/g3viewer/G3viewer.css deleted file mode 100644 index c6f40841..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/G3viewer.css +++ /dev/null @@ -1,47 +0,0 @@ -* {padding:0; margin:0;} - -#main {position:relative; width:100%; height:100%} - -.error {width:300px; height:200px;} - -.upload-error {background-color: #FFAAAA;} -.item {width:100px; height: 130px; padding:3px; border: 2px solid #FFF; overflow: hidden; float:left; text-align:center; position:relative;margin:3px;} -.item img{max-width:96px; max-height:76px; *width:96px; *height:76px; border:2px solid #AAA;} -.item h3{font-size:10px; font-weight:normal; position:absolute; bottom:5px; left:0px; width:100%; text-align:center; padding:0; margin:0;} -.ialbum {background-color: #e3effb; border: 2px solid #91c0ef; } -.popped {background-color: #e3effb;} -.view {height: 100%;} -.DropZone {height: 100px; width:6px; margin: 0 -3px 0 -3px; padding: 0; float:left; text-align:center; position:relative;} -.infobar {background-color: #fff; position: absolute; bottom:0px; border-width: 4px 4px 0 4px; border-style: solid; - border-color: #d2e1f6; height: 15px; width: 240px; right: 50px; font-size:10px; padding: 2px 5px 1px 5px;} -.infobar div {float:right; } -.infobar .up-options {float:left;} -.loading{position:absolute; top:0px; left:0px; width:100%; height: 100%; background-color:#FFF; opacity: 0.7; filter: alpha(opacity=70);} -.loading-label{z-index:10; position:absolute; width:100%; left:0px; text-align:center;} -.loading-image{z-index:10;} -.gwt-TreeItem-selected .Tree-Album {background-color: #333; color: #FFF;} -.Tree-Album {padding: 1px;} -.Tree-Album:hover{text-decoration:underline;} -.drop-target{background-color: #91c0ef; color: #000;} - -.dragdrop-selected ,.dragdrop-dragging ,.dragdrop-proxy {filter: Alpha(Opacity=30) !important;;} - -.popup {padding: 2px; border: 1px solid #91c0ef;background-color:#FFF} - -.dialog fieldset{ border: none; padding: 0px; margin: 0px;} -.dialog legend{ display: none;} -.dialog ul {padding:0; margin:0;} -.dialog ul ul li {float:left;} -.dialog li {list-style: none; padding:0;margin:0;} -.dialog form input[type="password"], .dialog form input[type="text"], .dialog form textarea .dialog form select {border: 1px solid #000; padding: 0.2em; display:block; clear: both;} -.dialog form input[type="password"], .dialog form input[type="text"], .dialog form textarea {width: 100%} -.dialog form textarea {height: 12em;} - -.label {width:90px; text-align:center;} -.progressBar {border: 1px solid #cccccc; width: 100px; height: 10px;} -.progessInner {background: #34628c;width: 0px;height: 10px;} - -.dContents {padding: 2px 5px 2px 5px;} -.dButtons {text-align: right} - -.hideme {overflow:hidden; width:0; height:0; margin:0; padding:0;} \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/clear.cache.gif b/3.1/modules/gwtorganize/war/g3viewer/clear.cache.gif deleted file mode 100644 index e565824a..00000000 Binary files a/3.1/modules/gwtorganize/war/g3viewer/clear.cache.gif and /dev/null differ diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/0D97DF37194D1924CC80394AAA96B9A3/1.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/0D97DF37194D1924CC80394AAA96B9A3/1.cache.js deleted file mode 100644 index e53d53ed..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/0D97DF37194D1924CC80394AAA96B9A3/1.cache.js +++ /dev/null @@ -1,9 +0,0 @@ -function ZQ(){} -function WQ(){} -function dR(){} -function VQ(){} -function bR(){return EN} -function YQ(){return DN} -function _Q(){_Q=k9;$Q=new WQ} -function cR(){$Q=(_Q(),new VQ);zx((wx(),vx),1);!!$stats&&$stats(dy(wob,xob,null,null));$Q.Xb();!!$stats&&$stats(dy(wob,yob,null,null))} -var Bob='AsyncLoader1',Aob='AsyncLoader1__Super',wob='runCallbacks1';_=WQ.prototype=new Gf;_.gC=YQ;_.Xb=ZQ;_.tI=0;_=VQ.prototype=new WQ;_.gC=bR;_.Xb=dR;_.tI=0;var $Q;var DN=R1(zob,Aob),EN=R1(zob,Bob);cR(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/0D97DF37194D1924CC80394AAA96B9A3/2.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/0D97DF37194D1924CC80394AAA96B9A3/2.cache.js deleted file mode 100644 index b2a4c208..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/0D97DF37194D1924CC80394AAA96B9A3/2.cache.js +++ /dev/null @@ -1,9 +0,0 @@ -function iR(){} -function fR(){} -function oR(){} -function eR(){} -function mR(){return GN} -function hR(){return FN} -function kR(){kR=k9;jR=new fR} -function nR(){jR=(kR(),new eR);zx((wx(),vx),2);!!$stats&&$stats(dy(Cob,xob,null,null));jR.Xb();!!$stats&&$stats(dy(Cob,yob,null,null))} -var Eob='AsyncLoader2',Dob='AsyncLoader2__Super',Cob='runCallbacks2';_=fR.prototype=new Gf;_.gC=hR;_.Xb=iR;_.tI=0;_=eR.prototype=new fR;_.gC=mR;_.Xb=oR;_.tI=0;var jR;var FN=R1(zob,Dob),GN=R1(zob,Eob);nR(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/0D97DF37194D1924CC80394AAA96B9A3/3.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/0D97DF37194D1924CC80394AAA96B9A3/3.cache.js deleted file mode 100644 index ca33975b..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/0D97DF37194D1924CC80394AAA96B9A3/3.cache.js +++ /dev/null @@ -1,54 +0,0 @@ -function ux(){} -function Ix(){} -function Sx(){} -function Wx(){} -function ly(){} -function H6(){} -function P6(){} -function Gx(){Bx(vx)} -function Hx(){return CM} -function Rx(){return yM} -function Vx(){return zM} -function $x(){return AM} -function oy(){return BM} -function M6(){return MP} -function S6(){return LP} -function Bx(a){zx(a,a.d)} -function _x(a){Zx(this,a)} -function Nx(a){a.c=0;a.d=0} -function Qx(a){return a.d-a.c} -function N2(){return this.b} -function O6(){return this.c.b.e} -function Ox(a){return a.b[a.c]} -function Mx(a,b){a.b[a.d++]=b} -function Yx(a,b){a.b=b;return a} -function R6(a,b){a.b=b;return a} -function T6(){return k6(this.b.b)} -function Px(a){return a.b[a.c++]} -function L6(a){return Q4(this.b,a)} -function t8(a){if(a.c==0){throw c9(new a9)}} -function J6(a,b,c){a.b=b;a.c=c;return a} -function ny(a,b,c){a.c=b;a.b=c;return a} -function Ux(a,b){kz(a);a.g=Hob+b;return a} -function Lx(a,b){a.b=fK(_P,0,-1,b,1);return a} -function r8(a){var b;t8(a);--a.c;b=a.b.b;N8(b);return b.d} -function U6(){var a;a=vK(l6(this.b.b),61).nc();return a} -function N6(){var a;a=v5(new t5,this.c.b);return R6(new P6,a)} -function D4(a){var b;b=l5(new e5,a);return J6(new H6,a,b)} -function Dx(a,b,c,d){!!$stats&&$stats(dy(a,b,c,d))} -function jy(b,c){function d(a){c.Hb(a)} -return __gwtStartLoadingFragment(b,d)} -function Q4(a,b){if(a.d&&V7(a.c,b)){return true}else if(P4(a,b)){return true}else if(N4(a,b)){return true}return false} -function yx(a,b,c){wx();a.b=T7(new R7);a.g=n8(new l8);a.d=b;a.c=c;a.f=Lx(new Ix,b+1);return a} -function wx(){wx=k9;vx=yx(new ux,3,gK(_P,0,-1,[]))} -function ky(a,b){var c,d;c=jy(a,b);if(c==null){return}d=u1();d.open(wgb,c,true);s1(d,ny(new ly,d,b));d.send(null)} -function Ax(a,b){var c,d,e,f;if(b==a.d){return true}for(d=a.c,e=0,f=d.length;e0){e7(h,vK(r8(b.b.g),41));Px(b.b.f)}Nx(b.b.f);g7(h,D4(b.b.b));M4(b.b.b);i=null;for(g=j6(new g6,h);g.b1){return}if(Qx(a.e)>0){c=Ox(a.e);Dx(c==a.d?Fob:Gob+c,xob,Q2(c),null);ky(c,Yx(new Wx,a));return}while(Qx(a.f)>0){c=Px(a.f);b=vK(r8(a.g),41);Dx(c==a.d?Fob:Gob+c,xob,Q2(c),null);ky(c,b)}} -var Pob='AbstractMap$2',Qob='AbstractMap$2$1',Kob='AsyncFragmentLoader',Lob='AsyncFragmentLoader$BoundedIntQueue',Mob='AsyncFragmentLoader$HttpDownloadFailure',Nob='AsyncFragmentLoader$InitialFragmentDownloadFailed',Oob='AsyncFragmentLoader$XhrLoadingStrategy$1',Hob='HTTP download failed with status ',Job='[I',xob='begin',zob='com.google.gwt.lang.asyncloaders.',Gob='download',yob='end',Fob='leftoversDownload',Iob='runAsync';_=ux.prototype=new Gf;_.gC=Hx;_.tI=0;_.c=null;_.d=0;_.e=null;_.f=null;var vx;_=Ix.prototype=new Gf;_.gC=Rx;_.tI=0;_.b=null;_.c=0;_.d=0;_=Sx.prototype=new rw;_.gC=Vx;_.tI=76;_=Wx.prototype=new Gf;_.gC=$x;_.Hb=_x;_.tI=77;_.b=null;_=ly.prototype=new Gf;_.gC=oy;_.Ib=py;_.tI=0;_.b=null;_.c=null;_=F2.prototype;_.gc=N2;_=H6.prototype=new o4;_.ic=L6;_.gC=M6;_.ob=N6;_.jc=O6;_.tI=0;_.b=null;_.c=null;_=P6.prototype=new Gf;_.gC=S6;_.Yb=T6;_.Zb=U6;_.tI=0;_.b=null;var _P=Q1(nbb,Job),CM=R1(clb,Kob),yM=R1(clb,Lob),zM=R1(clb,Mob),AM=R1(clb,Nob),BM=R1(clb,Oob),MP=R1(djb,Pob),LP=R1(djb,Qob);Gx(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/27AC86F0820D8F960DBF73C151C0332B/1.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/27AC86F0820D8F960DBF73C151C0332B/1.cache.js deleted file mode 100644 index d583bce7..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/27AC86F0820D8F960DBF73C151C0332B/1.cache.js +++ /dev/null @@ -1,9 +0,0 @@ -function SQ(){} -function PQ(){} -function YQ(){} -function OQ(){} -function WQ(){return yN} -function RQ(){return xN} -function UQ(){UQ=i9;TQ=new PQ} -function XQ(){TQ=(UQ(),new OQ);Bx((yx(),xx),1);!!$stats&&$stats(fy(xob,yob,null,null));TQ.Vb();!!$stats&&$stats(fy(xob,zob,null,null))} -var Cob='AsyncLoader1',Bob='AsyncLoader1__Super',xob='runCallbacks1';_=PQ.prototype=new Ef;_.gC=RQ;_.Vb=SQ;_.tI=0;_=OQ.prototype=new PQ;_.gC=WQ;_.Vb=YQ;_.tI=0;var TQ;var xN=P1(Aob,Bob),yN=P1(Aob,Cob);XQ(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/27AC86F0820D8F960DBF73C151C0332B/2.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/27AC86F0820D8F960DBF73C151C0332B/2.cache.js deleted file mode 100644 index 7bb8a12e..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/27AC86F0820D8F960DBF73C151C0332B/2.cache.js +++ /dev/null @@ -1,9 +0,0 @@ -function bR(){} -function $Q(){} -function hR(){} -function ZQ(){} -function fR(){return AN} -function aR(){return zN} -function dR(){dR=i9;cR=new $Q} -function gR(){cR=(dR(),new ZQ);Bx((yx(),xx),2);!!$stats&&$stats(fy(Dob,yob,null,null));cR.Vb();!!$stats&&$stats(fy(Dob,zob,null,null))} -var Fob='AsyncLoader2',Eob='AsyncLoader2__Super',Dob='runCallbacks2';_=$Q.prototype=new Ef;_.gC=aR;_.Vb=bR;_.tI=0;_=ZQ.prototype=new $Q;_.gC=fR;_.Vb=hR;_.tI=0;var cR;var zN=P1(Aob,Eob),AN=P1(Aob,Fob);gR(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/27AC86F0820D8F960DBF73C151C0332B/3.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/27AC86F0820D8F960DBF73C151C0332B/3.cache.js deleted file mode 100644 index 8e8f02c9..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/27AC86F0820D8F960DBF73C151C0332B/3.cache.js +++ /dev/null @@ -1,54 +0,0 @@ -function wx(){} -function Kx(){} -function Ux(){} -function Yx(){} -function ny(){} -function F6(){} -function N6(){} -function Ix(){Dx(xx)} -function Jx(){return yM} -function Tx(){return uM} -function Xx(){return vM} -function ay(){return wM} -function qy(){return xM} -function K6(){return FP} -function Q6(){return EP} -function Dx(a){Bx(a,a.d)} -function by(a){_x(this,a)} -function Px(a){a.c=0;a.d=0} -function Sx(a){return a.d-a.c} -function L2(){return this.b} -function M6(){return this.c.b.e} -function Qx(a){return a.b[a.c]} -function Ox(a,b){a.b[a.d++]=b} -function $x(a,b){a.b=b;return a} -function P6(a,b){a.b=b;return a} -function R6(){return i6(this.b.b)} -function Rx(a){return a.b[a.c++]} -function J6(a){return O4(this.b,a)} -function r8(a){if(a.c==0){throw a9(new $8)}} -function H6(a,b,c){a.b=b;a.c=c;return a} -function py(a,b,c){a.c=b;a.b=c;return a} -function Wx(a,b){mz(a);a.g=Iob+b;return a} -function Nx(a,b){a.b=aK(UP,0,-1,b,1);return a} -function Fx(a,b,c,d){!!$stats&&$stats(fy(a,b,c,d))} -function ly(b,c){function d(a){c.Jb(a)} -return __gwtStartLoadingFragment(b,d)} -function p8(a){var b;r8(a);--a.c;b=a.b.b;L8(b);return b.d} -function S6(){var a;a=qK(j6(this.b.b),61).lc();return a} -function B4(a){var b;b=j5(new c5,a);return H6(new F6,a,b)} -function L6(){var a;a=t5(new r5,this.c.b);return P6(new N6,a)} -function yx(){yx=i9;xx=Ax(new wx,3,bK(UP,0,-1,[]))} -function Bx(a,b){var c;c=b==a.d?Gob:Hob+b;Fx(c,zob,O2(b),null);if(Cx(a,b)){Rx(a.e);Y4(a.b,O2(b));Hx(a)}} -function my(a,b){var c,d;c=ly(a,b);if(c==null){return}d=s1();d.open(vgb,c,true);q1(d,py(new ny,d,b));d.send(null)} -function Cx(a,b){var c,d,e,f;if(b==a.d){return true}for(d=a.c,e=0,f=d.length;e1){return}if(Sx(a.e)>0){c=Qx(a.e);Fx(c==a.d?Gob:Hob+c,yob,O2(c),null);my(c,$x(new Yx,a));return}while(Sx(a.f)>0){c=Rx(a.f);b=qK(p8(a.g),41);Fx(c==a.d?Gob:Hob+c,yob,O2(c),null);my(c,b)}} -function _x(b,c){var a,e,f,g,h,i;h=b7(new $6);while(Sx(b.b.f)>0){c7(h,qK(p8(b.b.g),41));Rx(b.b.f)}Px(b.b.f);e7(h,B4(b.b.b));K4(b.b.b);i=null;for(g=h6(new e6,h);g.bb){if(f>1){e.resize(a.c.c,~~Math.max(Math.min(c/f,2147483647),-2147483648));vw(a.d,e.encode());return}vw(a.d,a.b)}else{if(b>1){e.resize(~~Math.max(Math.min(d/b,2147483647),-2147483648),a.c.b);vw(a.d,e.encode());return}vw(a.d,a.b)}} -var Etb='AsyncLoader2',Ctb='beta.canvas',Dtb='runCallbacks2';_=QU.prototype=new RU;_.gC=aV;_.Zb=eV;_.tI=0;var fR=J5(orb,Etb);bV(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4AFE598FDFDF189DD61F57E554328B10/3.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4AFE598FDFDF189DD61F57E554328B10/3.cache.js deleted file mode 100644 index 4481e97b..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4AFE598FDFDF189DD61F57E554328B10/3.cache.js +++ /dev/null @@ -1,35 +0,0 @@ -function zo(){} -function xw(){} -function Cw(){} -function UU(){} -function RU(){} -function fV(){} -function jV(){} -function gA(){bA(Wz)} -function Do(){return KO} -function Bw(){return DP} -function Gw(){return EP} -function TU(){return eR} -function hV(){return cR} -function lV(){return dR} -function bA(a){$z(a,a.e)} -function zw(a,b){a.b=b;return a} -function Ew(a,b){a.b=b;return a} -function $U(){$U=edb;XU=new RU} -function iV(a){$U();ZU=false;dV(a)} -function VJ(a,b){if(!a){return}Fw(a,b)} -function YJ(c,b){c.onprogress=function(a){ZJ(b,a)}} -function Bo(a,b,c){a.b=b;a.d=c;a.c=c.i;return a} -function _w(a,b,c){var d;d=B3(a.g,b);ut(a,c,a.I,d,true);vt(a,b)} -function gw(a,b){T8(a.g.b,b)!=null;lw(a);kw(a);Lt(a.b.f)} -function uw(a){if(a.i.d){(UC(),a.e.I).textContent=Ftb;cV(Bo(new zo,a.b,a))}else{vw(a,a.b)}} -function dV(a){$U();while(VU){dr();jq(Fr(new Dr,Otb+Mh(a)));VU=VU.c}WU=null} -function ZJ(a,b){var c;if(!a){return}c=b.loaded/b.total;a.b.h.b.bb(RN(Math.floor(c*100))+Ntb)} -function $z(a,b){var c;c=b==a.e?tkb:ukb+b;dA(c,Atb,I6(b),null);if(aA(a,b)){pA(a.f);T8(a.b,I6(b));fA(a)}} -function kw(a){var b;if(a.f.c>0){b=EN(lcb(a.f),37);uw(b)}else{a.e=false}} -function cV(a){$U();var b;b=new jV;b.b=a;!!WU&&(WU.c=b);WU=b;!VU&&(VU=b);if(YU){XU.Zb();return}if(!ZU){ZU=true;_z((Xz(),Wz),2,new fV)}} -function gl(a,b,c){var d,e;T8(a.b.b,b)!=null;e=c.Xb();if(e){d=fu(new Wt,a,e,a.c);P8(a.g,I6(d.d),d);Zab(a.h,d);a.m.b==a&&_w(a.m,b,d)}else{a.m.b==a&&vt(a.m,b)}} -function Fw(b,c){var a,e,f;if(c.status!=200){(UC(),b.b.e.I).textContent=Jtb;tk(b.b._(),Ktb,true);dr();jq(Fr(new Dr,Ltb+c.responseText))}(pw(),ow).remove(b.b.f);if(c.status==200){try{f=SM(c.responseText);gw(b.b.j,b.b);gl(b.b.g,b.b,f);return}catch(a){a=RT(a);if(HN(a,23)){e=a;dr();jq(Fr(new Dr,Mtb+Mh(e)+wfb+c.responseText))}else throw a}}T8(b.b.g.b.b,b.b)!=null;gw(b.b.j,b.b)} -function UJ(c,a){var b=c;c.onreadystatechange=function(){if(b.readyState==4){VJ(a,b);b.onreadystatechange=null;b.onprogress=null;b.upload.onprogress=null}}} -function vw(a,b){var c;(UC(),a.e.I).textContent=Gtb;c=vJ().create(Htb);c.open(Xkb,(dr(),$q)+a.g.e+Itb+a.f+yhb+cr);YJ(c.upload,zw(new xw,a));UJ(c,Ew(new Cw,a));c.send(b)} -var Ntb='%',Itb='?filename=',Ttb='AsyncLoader2$1',Utb='AsyncLoader2__Callback',Stb='AsyncLoader2__Super',Ptb='AsyncResizer',Otb='Error Resizing image\n',Ltb='Error Uploading\n',Mtb='Exception on Upload\n',Ftb='Resizing..',Jtb='Upload Error',Qtb='UploadFile$1',Rtb='UploadFile$2',Gtb='Uploading..',Htb='beta.httprequest',Atb='end',Ktb='upload-error';_=zo.prototype=new Wf;_.gC=Do;_.tI=0;_.b=null;_.c=null;_.d=null;_=xw.prototype=new Wf;_.gC=Bw;_.tI=0;_.b=null;_=Cw.prototype=new Wf;_.gC=Gw;_.tI=0;_.b=null;_=RU.prototype=new Wf;_.gC=TU;_.Zb=UU;_.tI=0;var VU=null,WU=null,XU,YU=false,ZU=false;_=fV.prototype=new Wf;_.gC=hV;_.Nb=iV;_.tI=95;_=jV.prototype=new Wf;_.gC=lV;_.tI=0;_.b=null;_.c=null;var KO=J5(fob,Ptb),DP=J5(fob,Qtb),EP=J5(fob,Rtb),eR=J5(orb,Stb),cR=J5(orb,Ttb),dR=J5(orb,Utb);gA(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4E8EC2279CB4B46228EFF0682ED166A4/1.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4E8EC2279CB4B46228EFF0682ED166A4/1.cache.js deleted file mode 100644 index 3a44f42f..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4E8EC2279CB4B46228EFF0682ED166A4/1.cache.js +++ /dev/null @@ -1,7 +0,0 @@ -function pU(){} -function BU(){return _Q} -function FU(){var a;while(uU){a=uU;uU=uU.c;!uU&&(vU=null);Iw(a.b.b)}} -function gw(a,b){Xbb(a.f,b);if(!a.e){a.e=true;iw(a)}a.c=false;jw(a)} -function Iw(a){var b;a.b.b=a.b.c.blob;(nw(),mw).captureBlob(a.b.b,a.b.f,gtb);b=s0(new p0,a.b.f);a.b.d.sb(b);gw(a.b.j,a.b)} -function CU(){xU=true;wU=(zU(),new pU);Yz((Vz(),Uz),1);!!$stats&&$stats(CA(htb,hkb,null,null));wU.$b();!!$stats&&$stats(CA(htb,itb,null,null))} -var jtb='AsyncLoader1',gtb='image/JPEG',htb='runCallbacks1';_=pU.prototype=new qU;_.gC=BU;_.$b=FU;_.tI=0;var _Q=u5(Zqb,jtb);CU(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4E8EC2279CB4B46228EFF0682ED166A4/2.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4E8EC2279CB4B46228EFF0682ED166A4/2.cache.js deleted file mode 100644 index 7b5a86ac..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4E8EC2279CB4B46228EFF0682ED166A4/2.cache.js +++ /dev/null @@ -1,6 +0,0 @@ -function NU(){} -function ZU(){return dR} -function bV(){var a;while(SU){a=SU;SU=SU.c;!SU&&(TU=null);Bo(a.b)}} -function $U(){VU=true;UU=(XU(),new NU);Yz((Vz(),Uz),2);!!$stats&&$stats(CA(ltb,hkb,null,null));UU.$b();!!$stats&&$stats(CA(ltb,itb,null,null))} -function Bo(a){var b,c,d,e,f;e=($wnd.google&&$wnd.google.gears&&$wnd.google.gears.factory).create(ktb);e.decode(a.b);d=e.width;c=e.height;f=d/a.c.c;b=c/a.c.b;if(f>b){if(f>1){e.resize(a.c.c,~~Math.max(Math.min(c/f,2147483647),-2147483648));tw(a.d,e.encode());return}tw(a.d,a.b)}else{if(b>1){e.resize(~~Math.max(Math.min(d/b,2147483647),-2147483648),a.c.b);tw(a.d,e.encode());return}tw(a.d,a.b)}} -var mtb='AsyncLoader2',ktb='beta.canvas',ltb='runCallbacks2';_=NU.prototype=new OU;_.gC=ZU;_.$b=bV;_.tI=0;var dR=u5(Zqb,mtb);$U(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4E8EC2279CB4B46228EFF0682ED166A4/3.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4E8EC2279CB4B46228EFF0682ED166A4/3.cache.js deleted file mode 100644 index 96fe591c..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4E8EC2279CB4B46228EFF0682ED166A4/3.cache.js +++ /dev/null @@ -1,35 +0,0 @@ -function yo(){} -function vw(){} -function Aw(){} -function RU(){} -function OU(){} -function cV(){} -function gV(){} -function eA(){_z(Uz)} -function Co(){return IO} -function zw(){return BP} -function Ew(){return CP} -function QU(){return cR} -function eV(){return aR} -function iV(){return bR} -function _z(a){Yz(a,a.e)} -function xw(a,b){a.b=b;return a} -function Cw(a,b){a.b=b;return a} -function XU(){XU=Scb;UU=new OU} -function fV(a){XU();WU=false;aV(a)} -function TJ(a,b){if(!a){return}Dw(a,b)} -function WJ(c,b){c.onprogress=function(a){XJ(b,a)}} -function Ao(a,b,c){a.b=b;a.d=c;a.c=c.i;return a} -function Zw(a,b,c){var d;d=x3(a.g,b);st(a,c,a.I,d,true);tt(a,b)} -function ew(a,b){F8(a.g.b,b)!=null;jw(a);iw(a);Jt(a.b.f)} -function sw(a){if(a.i.d){sD((XC(),a.e.I),ntb);_U(Ao(new yo,a.b,a))}else{tw(a,a.b)}} -function iw(a){var b;if(a.f.c>0){b=CN(Zbb(a.f),37);sw(b)}else{a.e=false}} -function XJ(a,b){var c;if(!a){return}c=b.loaded/b.total;a.b.h.b.bb(PN(Math.floor(c*100))+vtb)} -function Yz(a,b){var c;c=b==a.e?fkb:gkb+b;bA(c,itb,t6(b),null);if($z(a,b)){nA(a.f);F8(a.b,t6(b));dA(a)}} -function tw(a,b){var c;sD((XC(),a.e.I),otb);c=tJ().create(ptb);c.open(Jkb,(br(),Yq)+a.g.e+qtb+a.f+khb+ar);WJ(c.upload,xw(new vw,a));SJ(c,Cw(new Aw,a));c.send(b)} -function aV(a){XU();while(SU){br();hq(Dr(new Br,wtb+Lh(a)));SU=SU.c}TU=null} -function _U(a){XU();var b;b=new gV;b.b=a;!!TU&&(TU.c=b);TU=b;!SU&&(SU=b);if(VU){UU.$b();return}if(!WU){WU=true;Zz((Vz(),Uz),2,new cV)}} -function fl(a,b,c){var d,e;F8(a.b.b,b)!=null;e=c.Yb();if(e){d=du(new Ut,a,e,a.c);B8(a.g,t6(d.d),d);Lab(a.h,d);a.m.b==a&&Zw(a.m,b,d)}else{a.m.b==a&&tt(a.m,b)}} -function Dw(b,c){var a,e,f;if(c.status!=200){sD((XC(),b.b.e.I),rtb);sk(b.b._(),stb,true);br();hq(Dr(new Br,ttb+c.responseText))}(nw(),mw).remove(b.b.f);if(c.status==200){try{f=QM(c.responseText);ew(b.b.j,b.b);fl(b.b.g,b.b,f);return}catch(a){a=OT(a);if(FN(a,23)){e=a;br();hq(Dr(new Br,utb+Lh(e)+ifb+c.responseText))}else throw a}}F8(b.b.g.b.b,b.b)!=null;ew(b.b.j,b.b)} -function SJ(c,a){var b=c;c.onreadystatechange=function(){if(b.readyState==4){TJ(a,b);b.onreadystatechange=null;b.onprogress=null;b.upload.onprogress=null}}} -var vtb='%',qtb='?filename=',Btb='AsyncLoader2$1',Ctb='AsyncLoader2__Callback',Atb='AsyncLoader2__Super',xtb='AsyncResizer',wtb='Error Resizing image\n',ttb='Error Uploading\n',utb='Exception on Upload\n',ntb='Resizing..',rtb='Upload Error',ytb='UploadFile$1',ztb='UploadFile$2',otb='Uploading..',ptb='beta.httprequest',itb='end',stb='upload-error';_=yo.prototype=new Vf;_.gC=Co;_.tI=0;_.b=null;_.c=null;_.d=null;_=vw.prototype=new Vf;_.gC=zw;_.tI=0;_.b=null;_=Aw.prototype=new Vf;_.gC=Ew;_.tI=0;_.b=null;_=OU.prototype=new Vf;_.gC=QU;_.$b=RU;_.tI=0;var SU=null,TU=null,UU,VU=false,WU=false;_=cV.prototype=new Vf;_.gC=eV;_.Nb=fV;_.tI=95;_=gV.prototype=new Vf;_.gC=iV;_.tI=0;_.b=null;_.c=null;var IO=u5(Qnb,xtb),BP=u5(Qnb,ytb),CP=u5(Qnb,ztb),cR=u5(Zqb,Atb),aR=u5(Zqb,Btb),bR=u5(Zqb,Ctb);eA(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4F7AD7D8299143D876CB4071BE00BF02/1.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4F7AD7D8299143D876CB4071BE00BF02/1.cache.js deleted file mode 100644 index 37f81533..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4F7AD7D8299143D876CB4071BE00BF02/1.cache.js +++ /dev/null @@ -1,7 +0,0 @@ -function SU(){} -function cV(){return uR} -function gV(){var a;while(XU){a=XU;XU=XU.b;!XU&&(YU=null);Kw(a.a.a)}} -function iw(a,b){Hdb(a.e,b);if(!a.d){a.d=true;kw(a)}a.b=false;lw(a)} -function Kw(a){var b;a.a.a=a.a.b.blob;(pw(),ow).captureBlob(a.a.a,a.a.e,Hvb);b=F1(new C1,a.a.e);a.a.c.rb(b);iw(a.a.i,a.a)} -function dV(){$U=true;ZU=(aV(),new SU);cA((_z(),$z),1);!!$stats&&$stats(IA(Ivb,Mlb,null,null));ZU.Zb();!!$stats&&$stats(IA(Ivb,Jvb,null,null))} -var Kvb='AsyncLoader1',Hvb='image/JPEG',Ivb='runCallbacks1';_=SU.prototype=new TU;_.gC=cV;_.Zb=gV;_.tI=0;var uR=f7(ptb,Kvb);dV(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4F7AD7D8299143D876CB4071BE00BF02/2.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4F7AD7D8299143D876CB4071BE00BF02/2.cache.js deleted file mode 100644 index 51e8d46b..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4F7AD7D8299143D876CB4071BE00BF02/2.cache.js +++ /dev/null @@ -1,6 +0,0 @@ -function oV(){} -function AV(){return yR} -function EV(){var a;while(tV){a=tV;tV=tV.b;!tV&&(uV=null);Do(a.a)}} -function BV(){wV=true;vV=(yV(),new oV);cA((_z(),$z),2);!!$stats&&$stats(IA(Mvb,Mlb,null,null));vV.Zb();!!$stats&&$stats(IA(Mvb,Jvb,null,null))} -function Do(a){var b,c,d,e,f;e=($wnd.google&&$wnd.google.gears&&$wnd.google.gears.factory).create(Lvb);e.decode(a.a);d=e.width;c=e.height;f=d/a.b.b;b=c/a.b.a;if(f>b){if(f>1){e.resize(a.b.b,~~Math.max(Math.min(c/f,2147483647),-2147483648));vw(a.c,e.encode());return}vw(a.c,a.a)}else{if(b>1){e.resize(~~Math.max(Math.min(d/b,2147483647),-2147483648),a.b.a);vw(a.c,e.encode());return}vw(a.c,a.a)}} -var Nvb='AsyncLoader2',Lvb='beta.canvas',Mvb='runCallbacks2';_=oV.prototype=new pV;_.gC=AV;_.Zb=EV;_.tI=0;var yR=f7(ptb,Nvb);BV(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4F7AD7D8299143D876CB4071BE00BF02/3.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4F7AD7D8299143D876CB4071BE00BF02/3.cache.js deleted file mode 100644 index f4fa9cb0..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/4F7AD7D8299143D876CB4071BE00BF02/3.cache.js +++ /dev/null @@ -1,35 +0,0 @@ -function Ao(){} -function xw(){} -function Cw(){} -function sV(){} -function pV(){} -function FV(){} -function JV(){} -function kA(){fA($z)} -function Eo(){return dP} -function Bw(){return YP} -function Gw(){return ZP} -function rV(){return xR} -function HV(){return vR} -function LV(){return wR} -function fA(a){cA(a,a.d)} -function zw(a,b){a.a=b;return a} -function Ew(a,b){a.a=b;return a} -function yV(){yV=Ceb;vV=new pV} -function IV(a){yV();xV=false;DV(a)} -function pK(a,b){if(!a){return}Fw(a,b)} -function gw(a,b){pab(a.f.a,b)!=null;lw(a);kw(a);Lt(a.a.e)} -function uw(a){if(a.h.c){(UC(),a.d.H).innerText=Ovb;CV(Co(new Ao,a.a,a))}else{vw(a,a.a)}} -function _w(a,b,c){var d;d=M4(a.f,b);ut(a,c,a.H,d,true);vt(a,b)} -function sK(c,b){c.onprogress=function(a){tK(b,a)}} -function Co(a,b,c){a.a=b;a.c=c;a.b=c.h;return a} -function DV(a){yV();while(tV){dr();jq(Fr(new Dr,Xvb+Qh(a)));tV=tV.b}uV=null} -function tK(a,b){var c;if(!a){return}c=b.loaded/b.total;a.a.g.a.ab(lO(Math.floor(c*100))+Wvb)} -function kw(a){var b;if(a.e.b>0){b=$N(Jdb(a.e),37);uw(b)}else{a.d=false}} -function CV(a){yV();var b;b=new JV;b.a=a;!!uV&&(uV.b=b);uV=b;!tV&&(tV=b);if(wV){vV.Zb();return}if(!xV){xV=true;dA((_z(),$z),2,new FV)}} -function cA(a,b){var c;c=b==a.d?Klb:Llb+b;hA(c,Jvb,e8(b),null);if(eA(a,b)){tA(a.e);pab(a.a,e8(b));jA(a)}} -function hl(a,b,c){var d,e;pab(a.a.a,b)!=null;e=c.Xb();if(e){d=fu(new Wt,a,e,a.b);lab(a.f,e8(d.c),d);vcb(a.g,d);a.l.a==a&&_w(a.l,b,d)}else{a.l.a==a&&vt(a.l,b)}} -function Fw(b,c){var a,e,f;if(c.status!=200){(UC(),b.a.d.H).innerText=Svb;uk(b.a.$(),Tvb,true);dr();jq(Fr(new Dr,Uvb+c.responseText))}(pw(),ow).remove(b.a.e);if(c.status==200){try{f=mN(c.responseText);gw(b.a.i,b.a);hl(b.a.f,b.a,f);return}catch(a){a=pU(a);if(bO(a,23)){e=a;dr();jq(Fr(new Dr,Vvb+Qh(e)+Ngb+c.responseText))}else throw a}}pab(b.a.f.a.a,b.a)!=null;gw(b.a.i,b.a)} -function oK(c,a){var b=c;c.onreadystatechange=function(){if(b.readyState==4){pK(a,b);b.onreadystatechange=null;b.onprogress=null;b.upload.onprogress=null}}} -function vw(a,b){var c;(UC(),a.d.H).innerText=Pvb;c=RJ().create(Qvb);c.open(jmb,(dr(),$q)+a.f.d+Rvb+a.e+Rib+cr);sK(c.upload,zw(new xw,a));oK(c,Ew(new Cw,a));c.send(b)} -var Wvb='%',Rvb='?filename=',awb='AsyncLoader2$1',bwb='AsyncLoader2__Callback',_vb='AsyncLoader2__Super',Yvb='AsyncResizer',Xvb='Error Resizing image\n',Uvb='Error Uploading\n',Vvb='Exception on Upload\n',Ovb='Resizing..',Svb='Upload Error',Zvb='UploadFile$1',$vb='UploadFile$2',Pvb='Uploading..',Qvb='beta.httprequest',Jvb='end',Tvb='upload-error';_=Ao.prototype=new $f;_.gC=Eo;_.tI=0;_.a=null;_.b=null;_.c=null;_=xw.prototype=new $f;_.gC=Bw;_.tI=0;_.a=null;_=Cw.prototype=new $f;_.gC=Gw;_.tI=0;_.a=null;_=pV.prototype=new $f;_.gC=rV;_.Zb=sV;_.tI=0;var tV=null,uV=null,vV,wV=false,xV=false;_=FV.prototype=new $f;_.gC=HV;_.Mb=IV;_.tI=95;_=JV.prototype=new $f;_.gC=LV;_.tI=0;_.a=null;_.b=null;var dP=f7(iqb,Yvb),YP=f7(iqb,Zvb),ZP=f7(iqb,$vb),xR=f7(ptb,_vb),vR=f7(ptb,awb),wR=f7(ptb,bwb);kA(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/6462B363383D23B8418857B7A6FAD85B/1.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/6462B363383D23B8418857B7A6FAD85B/1.cache.js deleted file mode 100644 index a0dac49e..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/6462B363383D23B8418857B7A6FAD85B/1.cache.js +++ /dev/null @@ -1,7 +0,0 @@ -function AU(){} -function MU(){return eR} -function QU(){var a;while(FU){a=FU;FU=FU.b;!FU&&(GU=null);Iw(a.a.a)}} -function gw(a,b){Scb(a.e,b);if(!a.d){a.d=true;iw(a)}a.b=false;jw(a)} -function Iw(a){var b;a.a.a=a.a.b.blob;(nw(),mw).captureBlob(a.a.a,a.a.e,mub);b=k1(new h1,a.a.e);a.a.c.rb(b);gw(a.a.i,a.a)} -function NU(){IU=true;HU=(KU(),new AU);_z((Yz(),Xz),1);!!$stats&&$stats(FA(nub,Ykb,null,null));HU.Zb();!!$stats&&$stats(FA(nub,oub,null,null))} -var pub='AsyncLoader1',mub='image/JPEG',nub='runCallbacks1';_=AU.prototype=new BU;_.gC=MU;_.Zb=QU;_.tI=0;var eR=q6(Yrb,pub);NU(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/6462B363383D23B8418857B7A6FAD85B/2.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/6462B363383D23B8418857B7A6FAD85B/2.cache.js deleted file mode 100644 index 453a199b..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/6462B363383D23B8418857B7A6FAD85B/2.cache.js +++ /dev/null @@ -1,6 +0,0 @@ -function YU(){} -function iV(){return iR} -function mV(){var a;while(bV){a=bV;bV=bV.b;!bV&&(cV=null);Bo(a.a)}} -function jV(){eV=true;dV=(gV(),new YU);_z((Yz(),Xz),2);!!$stats&&$stats(FA(rub,Ykb,null,null));dV.Zb();!!$stats&&$stats(FA(rub,oub,null,null))} -function Bo(a){var b,c,d,e,f;e=($wnd.google&&$wnd.google.gears&&$wnd.google.gears.factory).create(qub);e.decode(a.a);d=e.width;c=e.height;f=d/a.b.b;b=c/a.b.a;if(f>b){if(f>1){e.resize(a.b.b,~~Math.max(Math.min(c/f,2147483647),-2147483648));tw(a.c,e.encode());return}tw(a.c,a.a)}else{if(b>1){e.resize(~~Math.max(Math.min(d/b,2147483647),-2147483648),a.b.a);tw(a.c,e.encode());return}tw(a.c,a.a)}} -var sub='AsyncLoader2',qub='beta.canvas',rub='runCallbacks2';_=YU.prototype=new ZU;_.gC=iV;_.Zb=mV;_.tI=0;var iR=q6(Yrb,sub);jV(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/6462B363383D23B8418857B7A6FAD85B/3.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/6462B363383D23B8418857B7A6FAD85B/3.cache.js deleted file mode 100644 index b5795b52..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/6462B363383D23B8418857B7A6FAD85B/3.cache.js +++ /dev/null @@ -1,35 +0,0 @@ -function yo(){} -function vw(){} -function Aw(){} -function aV(){} -function ZU(){} -function nV(){} -function rV(){} -function hA(){cA(Xz)} -function Co(){return PO} -function zw(){return IP} -function Ew(){return JP} -function _U(){return hR} -function pV(){return fR} -function tV(){return gR} -function cA(a){_z(a,a.d)} -function xw(a,b){a.a=b;return a} -function Cw(a,b){a.a=b;return a} -function gV(){gV=Ndb;dV=new ZU} -function qV(a){gV();fV=false;lV(a)} -function _J(a,b){if(!a){return}Dw(a,b)} -function ew(a,b){A9(a.f.a,b)!=null;jw(a);iw(a);Jt(a.a.e)} -function sw(a){if(a.h.c){(QC(),a.d.H).innerText=tub;kV(Ao(new yo,a.a,a))}else{tw(a,a.a)}} -function Zw(a,b,c){var d;d=p4(a.f,b);st(a,c,a.H,d,true);tt(a,b)} -function cK(c,b){c.onprogress=function(a){dK(b,a)}} -function iw(a){var b;if(a.e.b>0){b=KN(Ucb(a.e),37);sw(b)}else{a.d=false}} -function dK(a,b){var c;if(!a){return}c=b.loaded/b.total;a.a.g.a.ab(XN(Math.floor(c*100))+Bub)} -function lV(a){gV();while(bV){br();hq(Dr(new Br,Cub+Oh(a)));bV=bV.b}cV=null} -function Ao(a,b,c){a.a=b;a.c=c;a.b=c.h;return a} -function _z(a,b){var c;c=b==a.d?Wkb:Xkb+b;eA(c,oub,p7(b),null);if(bA(a,b)){qA(a.e);A9(a.a,p7(b));gA(a)}} -function tw(a,b){var c;(QC(),a.d.H).innerText=uub;c=BJ().create(vub);c.open(tlb,(br(),Yq)+a.f.d+wub+a.e+bib+ar);cK(c.upload,xw(new vw,a));$J(c,Cw(new Aw,a));c.send(b)} -function kV(a){gV();var b;b=new rV;b.a=a;!!cV&&(cV.b=b);cV=b;!bV&&(bV=b);if(eV){dV.Zb();return}if(!fV){fV=true;aA((Yz(),Xz),2,new nV)}} -function fl(a,b,c){var d,e;A9(a.a.a,b)!=null;e=c.Xb();if(e){d=du(new Ut,a,e,a.b);w9(a.f,p7(d.c),d);Gbb(a.g,d);a.l.a==a&&Zw(a.l,b,d)}else{a.l.a==a&&tt(a.l,b)}} -function Dw(b,c){var a,e,f;if(c.status!=200){(QC(),b.a.d.H).innerText=xub;sk(b.a.$(),yub,true);br();hq(Dr(new Br,zub+c.responseText))}(nw(),mw).remove(b.a.e);if(c.status==200){try{f=YM(c.responseText);ew(b.a.i,b.a);fl(b.a.f,b.a,f);return}catch(a){a=ZT(a);if(NN(a,23)){e=a;br();hq(Dr(new Br,Aub+Oh(e)+Zfb+c.responseText))}else throw a}}A9(b.a.f.a.a,b.a)!=null;ew(b.a.i,b.a)} -function $J(c,a){var b=c;c.onreadystatechange=function(){if(b.readyState==4){_J(a,b);b.onreadystatechange=null;b.onprogress=null;b.upload.onprogress=null}}} -var Bub='%',wub='?filename=',Hub='AsyncLoader2$1',Iub='AsyncLoader2__Callback',Gub='AsyncLoader2__Super',Dub='AsyncResizer',Cub='Error Resizing image\n',zub='Error Uploading\n',Aub='Exception on Upload\n',tub='Resizing..',xub='Upload Error',Eub='UploadFile$1',Fub='UploadFile$2',uub='Uploading..',vub='beta.httprequest',oub='end',yub='upload-error';_=yo.prototype=new Yf;_.gC=Co;_.tI=0;_.a=null;_.b=null;_.c=null;_=vw.prototype=new Yf;_.gC=zw;_.tI=0;_.a=null;_=Aw.prototype=new Yf;_.gC=Ew;_.tI=0;_.a=null;_=ZU.prototype=new Yf;_.gC=_U;_.Zb=aV;_.tI=0;var bV=null,cV=null,dV,eV=false,fV=false;_=nV.prototype=new Yf;_.gC=pV;_.Mb=qV;_.tI=95;_=rV.prototype=new Yf;_.gC=tV;_.tI=0;_.a=null;_.b=null;var PO=q6(Rob,Dub),IP=q6(Rob,Eub),JP=q6(Rob,Fub),hR=q6(Yrb,Gub),fR=q6(Yrb,Hub),gR=q6(Yrb,Iub);hA(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/71ED95F3DFB964762667E45E2922704D/1.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/71ED95F3DFB964762667E45E2922704D/1.cache.js deleted file mode 100644 index 4428a14f..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/71ED95F3DFB964762667E45E2922704D/1.cache.js +++ /dev/null @@ -1,9 +0,0 @@ -function wQ(){} -function tQ(){} -function CQ(){} -function sQ(){} -function AQ(){return fN} -function vQ(){return eN} -function yQ(){yQ=m8;xQ=new tQ} -function BQ(){xQ=(yQ(),new sQ);sx((px(),ox),1);!!$stats&&$stats(Yx(snb,tnb,null,null));xQ.Tb();!!$stats&&$stats(Yx(snb,unb,null,null))} -var xnb='AsyncLoader1',wnb='AsyncLoader1__Super',snb='runCallbacks1';_=tQ.prototype=new zf;_.gC=vQ;_.Tb=wQ;_.tI=0;_=sQ.prototype=new tQ;_.gC=AQ;_.Tb=CQ;_.tI=0;var xQ;var eN=S0(vnb,wnb),fN=S0(vnb,xnb);BQ(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/71ED95F3DFB964762667E45E2922704D/2.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/71ED95F3DFB964762667E45E2922704D/2.cache.js deleted file mode 100644 index fe89e09b..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/71ED95F3DFB964762667E45E2922704D/2.cache.js +++ /dev/null @@ -1,9 +0,0 @@ -function HQ(){} -function EQ(){} -function NQ(){} -function DQ(){} -function LQ(){return hN} -function GQ(){return gN} -function JQ(){JQ=m8;IQ=new EQ} -function MQ(){IQ=(JQ(),new DQ);sx((px(),ox),2);!!$stats&&$stats(Yx(ynb,tnb,null,null));IQ.Tb();!!$stats&&$stats(Yx(ynb,unb,null,null))} -var Anb='AsyncLoader2',znb='AsyncLoader2__Super',ynb='runCallbacks2';_=EQ.prototype=new zf;_.gC=GQ;_.Tb=HQ;_.tI=0;_=DQ.prototype=new EQ;_.gC=LQ;_.Tb=NQ;_.tI=0;var IQ;var gN=S0(vnb,znb),hN=S0(vnb,Anb);MQ(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/71ED95F3DFB964762667E45E2922704D/3.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/71ED95F3DFB964762667E45E2922704D/3.cache.js deleted file mode 100644 index efb84b56..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/71ED95F3DFB964762667E45E2922704D/3.cache.js +++ /dev/null @@ -1,54 +0,0 @@ -function nx(){} -function Bx(){} -function Lx(){} -function Px(){} -function ey(){} -function J5(){} -function R5(){} -function zx(){ux(ox)} -function Ax(){return gM} -function Kx(){return cM} -function Ox(){return dM} -function Tx(){return eM} -function hy(){return fM} -function O5(){return jP} -function U5(){return iP} -function ux(a){sx(a,a.d)} -function Ux(a){Sx(this,a)} -function Gx(a){a.c=0;a.d=0} -function Jx(a){return a.d-a.c} -function O1(){return this.b} -function Q5(){return this.c.b.e} -function Hx(a){return a.b[a.c]} -function Fx(a,b){a.b[a.d++]=b} -function Rx(a,b){a.b=b;return a} -function T5(a,b){a.b=b;return a} -function V5(){return m5(this.b.b)} -function Ix(a){return a.b[a.c++]} -function N5(a){return S3(this.b,a)} -function Nx(a,b){cz(a);a.g=Dnb+b;return a} -function gy(a,b,c){a.c=b;a.b=c;return a} -function L5(a,b,c){a.b=b;a.c=c;return a} -function Ex(a,b){a.b=LJ(yP,0,-1,b,1);return a} -function wx(a,b,c,d){!!$stats&&$stats(Yx(a,b,c,d))} -function cy(b,c){function d(a){c.Hb(a)} -return __gwtStartLoadingFragment(b,d)} -function W5(){var a;a=_J(n5(this.b.b),61).hc();return a} -function P5(){var a;a=x4(new v4,this.c.b);return T5(new R5,a)} -function px(){px=m8;ox=rx(new nx,3,MJ(yP,0,-1,[]))} -function F3(a){var b;b=n4(new g4,a);return L5(new J5,a,b)} -function v7(a){if(a.c==0){throw e8(new c8)}} -function t7(a){var b;v7(a);--a.c;b=a.b.b;P7(b);return b.d} -function sx(a,b){var c;c=b==a.d?Bnb:Cnb+b;wx(c,unb,R1(b),null);if(tx(a,b)){Ix(a.e);a4(a.b,R1(b));yx(a)}} -function dy(a,b){var c,d;c=cy(a,b);if(c==null){return}d=v0();d.open(zfb,c,true);t0(d,gy(new ey,d,b));d.send(null)} -function tx(a,b){var c,d,e,f;if(b==a.d){return true}for(d=a.c,e=0,f=d.length;e1){return}if(Jx(a.e)>0){c=Hx(a.e);wx(c==a.d?Bnb:Cnb+c,tnb,R1(c),null);dy(c,Rx(new Px,a));return}while(Jx(a.f)>0){c=Ix(a.f);b=_J(t7(a.g),41);wx(c==a.d?Bnb:Cnb+c,tnb,R1(c),null);dy(c,b)}} -function Sx(b,c){var a,e,f,g,h,i;h=f6(new c6);while(Jx(b.b.f)>0){g6(h,_J(t7(b.b.g),41));Ix(b.b.f)}Gx(b.b.f);i6(h,F3(b.b.b));O3(b.b.b);i=null;for(g=l5(new i5,h);g.b0){b7(h,hK(o8(b.a.f),41));Lx(b.a.e)}Jx(b.a.e);d7(h,A4(b.a.a));J4(b.a.a);i=null;for(g=g6(new d6,h);g.a1){return}if(Mx(a.d)>0){c=Kx(a.d);zx(c==a.c?Job:Kob+c,Bob,N2(c),null);gy(c,Ux(new Sx,a));return}while(Mx(a.e)>0){c=Lx(a.e);b=hK(o8(a.f),41);zx(c==a.c?Job:Kob+c,Bob,N2(c),null);gy(c,b)}} -var Tob='AbstractMap$2',Uob='AbstractMap$2$1',Oob='AsyncFragmentLoader',Pob='AsyncFragmentLoader$BoundedIntQueue',Qob='AsyncFragmentLoader$HttpDownloadFailure',Rob='AsyncFragmentLoader$InitialFragmentDownloadFailed',Sob='AsyncFragmentLoader$XhrLoadingStrategy$1',Lob='HTTP download failed with status ',Nob='[I',Bob='begin',Dob='com.google.gwt.lang.asyncloaders.',Kob='download',Cob='end',Job='leftoversDownload',Mob='runAsync';_=qx.prototype=new Cf;_.gC=Dx;_.tI=0;_.b=null;_.c=0;_.d=null;_.e=null;var rx;_=Ex.prototype=new Cf;_.gC=Nx;_.tI=0;_.a=null;_.b=0;_.c=0;_=Ox.prototype=new kw;_.gC=Rx;_.tI=76;_=Sx.prototype=new Cf;_.gC=Wx;_.Gb=Xx;_.tI=77;_.a=null;_=hy.prototype=new Cf;_.gC=ky;_.Hb=ly;_.tI=0;_.a=null;_.b=null;_=C2.prototype;_.ac=K2;_=E6.prototype=new l4;_.cc=I6;_.gC=J6;_.nb=K6;_.dc=L6;_.tI=0;_.a=null;_.b=null;_=M6.prototype=new Cf;_.gC=P6;_.Tb=Q6;_.Ub=R6;_.tI=0;_.a=null;var JP=N1(lbb,Nob),nM=O1(ilb,Oob),jM=O1(ilb,Pob),kM=O1(ilb,Qob),lM=O1(ilb,Rob),mM=O1(ilb,Sob),uP=O1(jjb,Tob),tP=O1(jjb,Uob);Cx(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/9DC95FB4BEC084EF810751F04B440FD7/1.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/9DC95FB4BEC084EF810751F04B440FD7/1.cache.js deleted file mode 100644 index 5cd9b09c..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/9DC95FB4BEC084EF810751F04B440FD7/1.cache.js +++ /dev/null @@ -1,9 +0,0 @@ -function zQ(){} -function wQ(){} -function FQ(){} -function vQ(){} -function DQ(){return hN} -function yQ(){return gN} -function BQ(){BQ=A8;AQ=new wQ} -function EQ(){AQ=(BQ(),new vQ);ux((rx(),qx),1);!!$stats&&$stats($x(Knb,Lnb,null,null));AQ.Sb();!!$stats&&$stats($x(Knb,Mnb,null,null))} -var Pnb='AsyncLoader1',Onb='AsyncLoader1__Super',Knb='runCallbacks1';_=wQ.prototype=new Af;_.gC=yQ;_.Sb=zQ;_.tI=0;_=vQ.prototype=new wQ;_.gC=DQ;_.Sb=FQ;_.tI=0;var AQ;var gN=f1(Nnb,Onb),hN=f1(Nnb,Pnb);EQ(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/9DC95FB4BEC084EF810751F04B440FD7/2.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/9DC95FB4BEC084EF810751F04B440FD7/2.cache.js deleted file mode 100644 index 4ffb2aa4..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/9DC95FB4BEC084EF810751F04B440FD7/2.cache.js +++ /dev/null @@ -1,9 +0,0 @@ -function KQ(){} -function HQ(){} -function QQ(){} -function GQ(){} -function OQ(){return jN} -function JQ(){return iN} -function MQ(){MQ=A8;LQ=new HQ} -function PQ(){LQ=(MQ(),new GQ);ux((rx(),qx),2);!!$stats&&$stats($x(Qnb,Lnb,null,null));LQ.Sb();!!$stats&&$stats($x(Qnb,Mnb,null,null))} -var Snb='AsyncLoader2',Rnb='AsyncLoader2__Super',Qnb='runCallbacks2';_=HQ.prototype=new Af;_.gC=JQ;_.Sb=KQ;_.tI=0;_=GQ.prototype=new HQ;_.gC=OQ;_.Sb=QQ;_.tI=0;var LQ;var iN=f1(Nnb,Rnb),jN=f1(Nnb,Snb);PQ(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/9DC95FB4BEC084EF810751F04B440FD7/3.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/9DC95FB4BEC084EF810751F04B440FD7/3.cache.js deleted file mode 100644 index 114ed2d9..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/9DC95FB4BEC084EF810751F04B440FD7/3.cache.js +++ /dev/null @@ -1,54 +0,0 @@ -function px(){} -function Dx(){} -function Nx(){} -function Rx(){} -function gy(){} -function X5(){} -function d6(){} -function Bx(){wx(qx)} -function Cx(){return iM} -function Mx(){return eM} -function Qx(){return fM} -function Vx(){return gM} -function jy(){return hM} -function a6(){return mP} -function g6(){return lP} -function wx(a){ux(a,a.d)} -function Wx(a){Ux(this,a)} -function Ix(a){a.c=0;a.d=0} -function Lx(a){return a.d-a.c} -function b2(){return this.b} -function c6(){return this.c.b.e} -function Jx(a){return a.b[a.c]} -function Hx(a,b){a.b[a.d++]=b} -function Tx(a,b){a.b=b;return a} -function f6(a,b){a.b=b;return a} -function h6(){return A5(this.b.b)} -function Kx(a){return a.b[a.c++]} -function _5(a){return e4(this.b,a)} -function J7(a){if(a.c==0){throw s8(new q8)}} -function Z5(a,b,c){a.b=b;a.c=c;return a} -function iy(a,b,c){a.c=b;a.b=c;return a} -function Px(a,b){fz(a);a.g=Vnb+b;return a} -function Gx(a,b){a.b=NJ(BP,0,-1,b,1);return a} -function H7(a){var b;J7(a);--a.c;b=a.b.b;b8(b);return b.d} -function i6(){var a;a=bK(B5(this.b.b),61).gc();return a} -function b6(){var a;a=L4(new J4,this.c.b);return f6(new d6,a)} -function T3(a){var b;b=B4(new u4,a);return Z5(new X5,a,b)} -function yx(a,b,c,d){!!$stats&&$stats($x(a,b,c,d))} -function ey(b,c){function d(a){c.Hb(a)} -return __gwtStartLoadingFragment(b,d)} -function e4(a,b){if(a.d&&j7(a.c,b)){return true}else if(d4(a,b)){return true}else if(b4(a,b)){return true}return false} -function tx(a,b,c){rx();a.b=h7(new f7);a.g=D7(new B7);a.d=b;a.c=c;a.f=Gx(new Dx,b+1);return a} -function rx(){rx=A8;qx=tx(new px,3,OJ(BP,0,-1,[]))} -function fy(a,b){var c,d;c=ey(a,b);if(c==null){return}d=K0();d.open(Nfb,c,true);I0(d,iy(new gy,d,b));d.send(null)} -function vx(a,b){var c,d,e,f;if(b==a.d){return true}for(d=a.c,e=0,f=d.length;e0){u6(h,bK(H7(b.b.g),41));Kx(b.b.f)}Ix(b.b.f);w6(h,T3(b.b.b));a4(b.b.b);i=null;for(g=z5(new w5,h);g.b1){return}if(Lx(a.e)>0){c=Jx(a.e);yx(c==a.d?Tnb:Unb+c,Lnb,e2(c),null);fy(c,Tx(new Rx,a));return}while(Lx(a.f)>0){c=Kx(a.f);b=bK(H7(a.g),41);yx(c==a.d?Tnb:Unb+c,Lnb,e2(c),null);fy(c,b)}} -var bob='AbstractMap$2',cob='AbstractMap$2$1',Ynb='AsyncFragmentLoader',Znb='AsyncFragmentLoader$BoundedIntQueue',$nb='AsyncFragmentLoader$HttpDownloadFailure',_nb='AsyncFragmentLoader$InitialFragmentDownloadFailed',aob='AsyncFragmentLoader$XhrLoadingStrategy$1',Vnb='HTTP download failed with status ',Xnb='[I',Lnb='begin',Nnb='com.google.gwt.lang.asyncloaders.',Unb='download',Mnb='end',Tnb='leftoversDownload',Wnb='runAsync';_=px.prototype=new Af;_.gC=Cx;_.tI=0;_.c=null;_.d=0;_.e=null;_.f=null;var qx;_=Dx.prototype=new Af;_.gC=Mx;_.tI=0;_.b=null;_.c=0;_.d=0;_=Nx.prototype=new mw;_.gC=Qx;_.tI=76;_=Rx.prototype=new Af;_.gC=Vx;_.Hb=Wx;_.tI=77;_.b=null;_=gy.prototype=new Af;_.gC=jy;_.Ib=ky;_.tI=0;_.b=null;_.c=null;_=V1.prototype;_._b=b2;_=X5.prototype=new E3;_.bc=_5;_.gC=a6;_.ob=b6;_.cc=c6;_.tI=0;_.b=null;_.c=null;_=d6.prototype=new Af;_.gC=g6;_.Tb=h6;_.Ub=i6;_.tI=0;_.b=null;var BP=e1(Dab,Xnb),iM=f1(wkb,Ynb),eM=f1(wkb,Znb),fM=f1(wkb,$nb),gM=f1(wkb,_nb),hM=f1(wkb,aob),mP=f1(xib,bob),lP=f1(xib,cob);Bx(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/A8FBB0ADAFEE7F8EA1CDB15765D13A7F/1.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/A8FBB0ADAFEE7F8EA1CDB15765D13A7F/1.cache.js deleted file mode 100644 index 4f191dc0..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/A8FBB0ADAFEE7F8EA1CDB15765D13A7F/1.cache.js +++ /dev/null @@ -1,7 +0,0 @@ -function SU(){} -function cV(){return yR} -function gV(){var a;while(XU){a=XU;XU=XU.c;!XU&&(YU=null);Pw(a.b.b)}} -function nw(a,b){Wcb(a.f,b);if(!a.e){a.e=true;pw(a)}a.c=false;qw(a)} -function Pw(a){var b;a.b.b=a.b.c.blob;(uw(),tw).captureBlob(a.b.b,a.b.f,lub);b=_0(new Y0,a.b.f);a.b.d.sb(b);nw(a.b.j,a.b)} -function dV(){$U=true;ZU=(aV(),new SU);dA((aA(),_z),1);!!$stats&&$stats(JA(mub,blb,null,null));ZU.cc();!!$stats&&$stats(JA(mub,nub,null,null))} -var oub='AsyncLoader1',lub='image/JPEG',mub='runCallbacks1';_=SU.prototype=new TU;_.gC=cV;_.cc=gV;_.tI=0;var yR=u6($rb,oub);dV(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/A8FBB0ADAFEE7F8EA1CDB15765D13A7F/2.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/A8FBB0ADAFEE7F8EA1CDB15765D13A7F/2.cache.js deleted file mode 100644 index 35fe43df..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/A8FBB0ADAFEE7F8EA1CDB15765D13A7F/2.cache.js +++ /dev/null @@ -1,6 +0,0 @@ -function oV(){} -function AV(){return CR} -function EV(){var a;while(tV){a=tV;tV=tV.c;!tV&&(uV=null);Io(a.b)}} -function BV(){wV=true;vV=(yV(),new oV);dA((aA(),_z),2);!!$stats&&$stats(JA(qub,blb,null,null));vV.cc();!!$stats&&$stats(JA(qub,nub,null,null))} -function Io(a){var b,c,d,e,f;e=($wnd.google&&$wnd.google.gears&&$wnd.google.gears.factory).create(pub);e.decode(a.b);d=e.width;c=e.height;f=d/a.c.c;b=c/a.c.b;if(f>b){if(f>1){e.resize(a.c.c,~~Math.max(Math.min(c/f,2147483647),-2147483648));Aw(a.d,e.encode());return}Aw(a.d,a.b)}else{if(b>1){e.resize(~~Math.max(Math.min(d/b,2147483647),-2147483648),a.c.b);Aw(a.d,e.encode());return}Aw(a.d,a.b)}} -var rub='AsyncLoader2',pub='beta.canvas',qub='runCallbacks2';_=oV.prototype=new pV;_.gC=AV;_.cc=EV;_.tI=0;var CR=u6($rb,rub);BV(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/A8FBB0ADAFEE7F8EA1CDB15765D13A7F/3.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/A8FBB0ADAFEE7F8EA1CDB15765D13A7F/3.cache.js deleted file mode 100644 index a7e3e3d6..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/A8FBB0ADAFEE7F8EA1CDB15765D13A7F/3.cache.js +++ /dev/null @@ -1,35 +0,0 @@ -function Fo(){} -function Cw(){} -function Hw(){} -function sV(){} -function pV(){} -function FV(){} -function JV(){} -function lA(){gA(_z)} -function Jo(){return cP} -function Gw(){return XP} -function Lw(){return YP} -function rV(){return BR} -function HV(){return zR} -function LV(){return AR} -function gA(a){dA(a,a.e)} -function Ew(a,b){a.b=b;return a} -function Jw(a,b){a.b=b;return a} -function yV(){yV=Rdb;vV=new pV} -function IV(a){yV();xV=false;DV(a)} -function nK(a,b){if(!a){return}Kw(a,b)} -function qK(c,b){c.onprogress=function(a){rK(b,a)}} -function Ho(a,b,c){a.b=b;a.d=c;a.c=c.i;return a} -function ex(a,b,c){var d;d=e4(a.g,b);zt(a,c,a.I,d,true);At(a,b)} -function lw(a,b){E9(a.g.b,b)!=null;qw(a);pw(a);Qt(a.b.f)} -function zw(a){if(a.i.d){LD((rD(),a.e.I),sub);CV(Ho(new Fo,a.b,a))}else{Aw(a,a.b)}} -function DV(a){yV();while(tV){ir();oq(Kr(new Ir,Bub+Sh(a)));tV=tV.c}uV=null} -function rK(a,b){var c;if(!a){return}c=b.loaded/b.total;a.b.h.b.bb(jO(Math.floor(c*100))+Aub)} -function dA(a,b){var c;c=b==a.e?_kb:alb+b;iA(c,nub,t7(b),null);if(fA(a,b)){uA(a.f);E9(a.b,t7(b));kA(a)}} -function pw(a){var b;if(a.f.c>0){b=YN(Ycb(a.f),37);zw(b)}else{a.e=false}} -function CV(a){yV();var b;b=new JV;b.b=a;!!uV&&(uV.c=b);uV=b;!tV&&(tV=b);if(wV){vV.cc();return}if(!xV){xV=true;eA((aA(),_z),2,new FV)}} -function ml(a,b,c){var d,e;E9(a.b.b,b)!=null;e=c.ac();if(e){d=ku(new _t,a,e,a.c);A9(a.g,t7(d.d),d);Kbb(a.h,d);a.m.b==a&&ex(a.m,b,d)}else{a.m.b==a&&At(a.m,b)}} -function Kw(b,c){var a,e,f;if(c.status!=200){LD((rD(),b.b.e.I),wub);zk(b.b._(),xub,true);ir();oq(Kr(new Ir,yub+c.responseText))}(uw(),tw).remove(b.b.f);if(c.status==200){try{f=kN(c.responseText);lw(b.b.j,b.b);ml(b.b.g,b.b,f);return}catch(a){a=pU(a);if(_N(a,23)){e=a;ir();oq(Kr(new Ir,zub+Sh(e)+cgb+c.responseText))}else throw a}}E9(b.b.g.b.b,b.b)!=null;lw(b.b.j,b.b)} -function mK(c,a){var b=c;c.onreadystatechange=function(){if(b.readyState==4){nK(a,b);b.onreadystatechange=null;b.onprogress=null;b.upload.onprogress=null}}} -function Aw(a,b){var c;LD((rD(),a.e.I),tub);c=PJ().create(uub);c.open(Hlb,(ir(),dr)+a.g.e+vub+a.f+eib+hr);qK(c.upload,Ew(new Cw,a));mK(c,Jw(new Hw,a));c.send(b)} -var Aub='%',vub='?filename=',Gub='AsyncLoader2$1',Hub='AsyncLoader2__Callback',Fub='AsyncLoader2__Super',Cub='AsyncResizer',Bub='Error Resizing image\n',yub='Error Uploading\n',zub='Exception on Upload\n',sub='Resizing..',wub='Upload Error',Dub='UploadFile$1',Eub='UploadFile$2',tub='Uploading..',uub='beta.httprequest',nub='end',xub='upload-error';_=Fo.prototype=new ag;_.gC=Jo;_.tI=0;_.b=null;_.c=null;_.d=null;_=Cw.prototype=new ag;_.gC=Gw;_.tI=0;_.b=null;_=Hw.prototype=new ag;_.gC=Lw;_.tI=0;_.b=null;_=pV.prototype=new ag;_.gC=rV;_.cc=sV;_.tI=0;var tV=null,uV=null,vV,wV=false,xV=false;_=FV.prototype=new ag;_.gC=HV;_.Nb=IV;_.tI=95;_=JV.prototype=new ag;_.gC=LV;_.tI=0;_.b=null;_.c=null;var cP=u6(Oob,Cub),XP=u6(Oob,Dub),YP=u6(Oob,Eub),BR=u6($rb,Fub),zR=u6($rb,Gub),AR=u6($rb,Hub);lA(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/CE15F73DB4EDED1CF8F93F95A728792D/1.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/CE15F73DB4EDED1CF8F93F95A728792D/1.cache.js deleted file mode 100644 index ad849765..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/CE15F73DB4EDED1CF8F93F95A728792D/1.cache.js +++ /dev/null @@ -1,7 +0,0 @@ -function LU(){} -function XU(){return sR} -function _U(){var a;while(QU){a=QU;QU=QU.c;!QU&&(RU=null);Rw(a.b.b)}} -function pw(a,b){Ucb(a.f,b);if(!a.e){a.e=true;rw(a)}a.c=false;sw(a)} -function Rw(a){var b;a.b.b=a.b.c.blob;(ww(),vw).captureBlob(a.b.b,a.b.f,mub);b=T0(new Q0,a.b.f);a.b.d.ub(b);pw(a.b.j,a.b)} -function YU(){TU=true;SU=(VU(),new LU);fA((cA(),bA),1);!!$stats&&$stats(LA(nub,elb,null,null));SU.ac();!!$stats&&$stats(LA(nub,oub,null,null))} -var pub='AsyncLoader1',mub='image/JPEG',nub='runCallbacks1';_=LU.prototype=new MU;_.gC=XU;_.ac=_U;_.tI=0;var sR=s6(asb,pub);YU(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/CE15F73DB4EDED1CF8F93F95A728792D/2.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/CE15F73DB4EDED1CF8F93F95A728792D/2.cache.js deleted file mode 100644 index e48dfe65..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/CE15F73DB4EDED1CF8F93F95A728792D/2.cache.js +++ /dev/null @@ -1,6 +0,0 @@ -function hV(){} -function tV(){return wR} -function xV(){var a;while(mV){a=mV;mV=mV.c;!mV&&(nV=null);Jo(a.b)}} -function uV(){pV=true;oV=(rV(),new hV);fA((cA(),bA),2);!!$stats&&$stats(LA(rub,elb,null,null));oV.ac();!!$stats&&$stats(LA(rub,oub,null,null))} -function Jo(a){var b,c,d,e,f;e=($wnd.google&&$wnd.google.gears&&$wnd.google.gears.factory).create(qub);e.decode(a.b);d=e.width;c=e.height;f=d/a.c.c;b=c/a.c.b;if(f>b){if(f>1){e.resize(a.c.c,~~Math.max(Math.min(c/f,2147483647),-2147483648));Cw(a.d,e.encode());return}Cw(a.d,a.b)}else{if(b>1){e.resize(~~Math.max(Math.min(d/b,2147483647),-2147483648),a.c.b);Cw(a.d,e.encode());return}Cw(a.d,a.b)}} -var sub='AsyncLoader2',qub='beta.canvas',rub='runCallbacks2';_=hV.prototype=new iV;_.gC=tV;_.ac=xV;_.tI=0;var wR=s6(asb,sub);uV(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/CE15F73DB4EDED1CF8F93F95A728792D/3.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/CE15F73DB4EDED1CF8F93F95A728792D/3.cache.js deleted file mode 100644 index 5f8c4d35..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/CE15F73DB4EDED1CF8F93F95A728792D/3.cache.js +++ /dev/null @@ -1,35 +0,0 @@ -function Go(){} -function Ew(){} -function Jw(){} -function lV(){} -function iV(){} -function yV(){} -function CV(){} -function nA(){iA(bA)} -function Ko(){return $O} -function Iw(){return TP} -function Nw(){return UP} -function kV(){return vR} -function AV(){return tR} -function EV(){return uR} -function iA(a){fA(a,a.e)} -function Gw(a,b){a.b=b;return a} -function Lw(a,b){a.b=b;return a} -function rV(){rV=Pdb;oV=new iV} -function BV(a){rV();qV=false;wV(a)} -function iK(a,b){if(!a){return}Mw(a,b)} -function lK(c,b){c.onprogress=function(a){mK(b,a)}} -function Io(a,b,c){a.b=b;a.d=c;a.c=c.i;return a} -function gx(a,b,c){var d;d=Y3(a.g,b);Bt(a,c,a.K,d,true);Ct(a,b)} -function nw(a,b){C9(a.g.b,b)!=null;sw(a);rw(a);St(a.b.f)} -function Bw(a){if(a.i.d){YD((aD(),a.e.K),tub);vV(Io(new Go,a.b,a))}else{Cw(a,a.b)}} -function wV(a){rV();while(mV){kr();qq(Mr(new Kr,Cub+Qh(a)));mV=mV.c}nV=null} -function mK(a,b){var c;if(!a){return}c=b.loaded/b.total;a.b.h.b.db(eO(Math.floor(c*100))+Bub)} -function fA(a,b){var c;c=b==a.e?clb:dlb+b;kA(c,oub,r7(b),null);if(hA(a,b)){wA(a.f);C9(a.b,r7(b));mA(a)}} -function rw(a){var b;if(a.f.c>0){b=TN(Wcb(a.f),37);Bw(b)}else{a.e=false}} -function vV(a){rV();var b;b=new CV;b.b=a;!!nV&&(nV.c=b);nV=b;!mV&&(mV=b);if(pV){oV.ac();return}if(!qV){qV=true;gA((cA(),bA),2,new yV)}} -function nl(a,b,c){var d,e;C9(a.b.b,b)!=null;e=c.$b();if(e){d=mu(new bu,a,e,a.c);y9(a.g,r7(d.d),d);Ibb(a.h,d);a.m.b==a&&gx(a.m,b,d)}else{a.m.b==a&&Ct(a.m,b)}} -function Mw(b,c){var a,e,f;if(c.status!=200){YD((aD(),b.b.e.K),xub);Ak(b.b.bb(),yub,true);kr();qq(Mr(new Kr,zub+c.responseText))}(ww(),vw).remove(b.b.f);if(c.status==200){try{f=fN(c.responseText);nw(b.b.j,b.b);nl(b.b.g,b.b,f);return}catch(a){a=iU(a);if(WN(a,23)){e=a;kr();qq(Mr(new Kr,Aub+Qh(e)+fgb+c.responseText))}else throw a}}C9(b.b.g.b.b,b.b)!=null;nw(b.b.j,b.b)} -function hK(c,a){var b=c;c.onreadystatechange=function(){if(b.readyState==4){iK(a,b);b.onreadystatechange=null;b.onprogress=null;b.upload.onprogress=null}}} -function Cw(a,b){var c;YD((aD(),a.e.K),uub);c=KJ().create(vub);c.open(Glb,(kr(),fr)+a.g.e+wub+a.f+hib+jr);lK(c.upload,Gw(new Ew,a));hK(c,Lw(new Jw,a));c.send(b)} -var Bub='%',wub='?filename=',Hub='AsyncLoader2$1',Iub='AsyncLoader2__Callback',Gub='AsyncLoader2__Super',Dub='AsyncResizer',Cub='Error Resizing image\n',zub='Error Uploading\n',Aub='Exception on Upload\n',tub='Resizing..',xub='Upload Error',Eub='UploadFile$1',Fub='UploadFile$2',uub='Uploading..',vub='beta.httprequest',oub='end',yub='upload-error';_=Go.prototype=new $f;_.gC=Ko;_.tI=0;_.b=null;_.c=null;_.d=null;_=Ew.prototype=new $f;_.gC=Iw;_.tI=0;_.b=null;_=Jw.prototype=new $f;_.gC=Nw;_.tI=0;_.b=null;_=iV.prototype=new $f;_.gC=kV;_.ac=lV;_.tI=0;var mV=null,nV=null,oV,pV=false,qV=false;_=yV.prototype=new $f;_.gC=AV;_.Pb=BV;_.tI=95;_=CV.prototype=new $f;_.gC=EV;_.tI=0;_.b=null;_.c=null;var $O=s6(Sob,Dub),TP=s6(Sob,Eub),UP=s6(Sob,Fub),vR=s6(asb,Gub),tR=s6(asb,Hub),uR=s6(asb,Iub);nA(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/D096B0ED44CBABF1A6B1F2C2D31F4FCC/1.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/D096B0ED44CBABF1A6B1F2C2D31F4FCC/1.cache.js deleted file mode 100644 index 2bd71e07..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/D096B0ED44CBABF1A6B1F2C2D31F4FCC/1.cache.js +++ /dev/null @@ -1,9 +0,0 @@ -function ZQ(){} -function WQ(){} -function dR(){} -function VQ(){} -function bR(){return AN} -function YQ(){return zN} -function _Q(){_Q=Y9;$Q=new WQ} -function cR(){$Q=(_Q(),new VQ);yx((vx(),ux),1);!!$stats&&$stats(cy(Vpb,Wpb,null,null));$Q.Sb();!!$stats&&$stats(cy(Vpb,Xpb,null,null))} -var $pb='AsyncLoader1',Zpb='AsyncLoader1__Super',Vpb='runCallbacks1';_=WQ.prototype=new Ef;_.gC=YQ;_.Sb=ZQ;_.tI=0;_=VQ.prototype=new WQ;_.gC=bR;_.Sb=dR;_.tI=0;var $Q;var zN=D2(Ypb,Zpb),AN=D2(Ypb,$pb);cR(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/D096B0ED44CBABF1A6B1F2C2D31F4FCC/2.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/D096B0ED44CBABF1A6B1F2C2D31F4FCC/2.cache.js deleted file mode 100644 index 1263b2b5..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/D096B0ED44CBABF1A6B1F2C2D31F4FCC/2.cache.js +++ /dev/null @@ -1,9 +0,0 @@ -function iR(){} -function fR(){} -function oR(){} -function eR(){} -function mR(){return CN} -function hR(){return BN} -function kR(){kR=Y9;jR=new fR} -function nR(){jR=(kR(),new eR);yx((vx(),ux),2);!!$stats&&$stats(cy(_pb,Wpb,null,null));jR.Sb();!!$stats&&$stats(cy(_pb,Xpb,null,null))} -var bqb='AsyncLoader2',aqb='AsyncLoader2__Super',_pb='runCallbacks2';_=fR.prototype=new Ef;_.gC=hR;_.Sb=iR;_.tI=0;_=eR.prototype=new fR;_.gC=mR;_.Sb=oR;_.tI=0;var jR;var BN=D2(Ypb,aqb),CN=D2(Ypb,bqb);nR(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/D096B0ED44CBABF1A6B1F2C2D31F4FCC/3.cache.js b/3.1/modules/gwtorganize/war/g3viewer/deferredjs/D096B0ED44CBABF1A6B1F2C2D31F4FCC/3.cache.js deleted file mode 100644 index cfb339de..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/deferredjs/D096B0ED44CBABF1A6B1F2C2D31F4FCC/3.cache.js +++ /dev/null @@ -1,54 +0,0 @@ -function tx(){} -function Hx(){} -function Rx(){} -function Vx(){} -function ky(){} -function t7(){} -function B7(){} -function Fx(){Ax(ux)} -function Gx(){return DM} -function Qx(){return zM} -function Ux(){return AM} -function Zx(){return BM} -function ny(){return CM} -function y7(){return MP} -function E7(){return LP} -function Ax(a){yx(a,a.c)} -function $x(a){Yx(this,a)} -function Mx(a){a.b=0;a.c=0} -function Px(a){return a.c-a.b} -function z3(){return this.a} -function Nx(a){return a.a[a.b]} -function Lx(a,b){a.a[a.c++]=b} -function Xx(a,b){a.a=b;return a} -function D7(a,b){a.a=b;return a} -function Ox(a){return a.a[a.b++]} -function A7(){return this.b.a.d} -function F7(){return Y6(this.a.a)} -function x7(a){return C5(this.a,a)} -function f9(a){if(a.b==0){throw Q9(new O9)}} -function v7(a,b,c){a.a=b;a.b=c;return a} -function my(a,b,c){a.b=b;a.a=c;return a} -function Tx(a,b){kz(a);a.f=eqb+b;return a} -function Kx(a,b){a.a=hK(_P,0,-1,b,1);return a} -function p5(a){var b;b=Z5(new S5,a);return v7(new t7,a,b)} -function d9(a){var b;f9(a);--a.b;b=a.a.a;z9(b);return b.c} -function G7(){var a;a=xK(Z6(this.a.a),61).hc();return a} -function z7(){var a;a=h6(new f6,this.b.a);return D7(new B7,a)} -function Cx(a,b,c,d){!!$stats&&$stats(cy(a,b,c,d))} -function iy(b,c){function d(a){c.Gb(a)} -return __gwtStartLoadingFragment(b,d)} -function C5(a,b){if(a.c&&H8(a.b,b)){return true}else if(B5(a,b)){return true}else if(z5(a,b)){return true}return false} -function xx(a,b,c){vx();a.a=F8(new D8);a.f=_8(new Z8);a.c=b;a.b=c;a.e=Kx(new Hx,b+1);return a} -function vx(){vx=Y9;ux=xx(new tx,3,iK(_P,0,-1,[]))} -function jy(a,b){var c,d;c=iy(a,b);if(c==null){return}d=g2();d.open(bhb,c,true);e2(d,my(new ky,d,b));d.send(null)} -function zx(a,b){var c,d,e,f;if(b==a.c){return true}for(d=a.b,e=0,f=d.length;e0){S7(h,xK(d9(b.a.f),41));Ox(b.a.e)}Mx(b.a.e);U7(h,p5(b.a.a));y5(b.a.a);i=null;for(g=X6(new U6,h);g.a1){return}if(Px(a.d)>0){c=Nx(a.d);Cx(c==a.c?cqb:dqb+c,Wpb,C3(c),null);jy(c,Xx(new Vx,a));return}while(Px(a.e)>0){c=Ox(a.e);b=xK(d9(a.f),41);Cx(c==a.c?cqb:dqb+c,Wpb,C3(c),null);jy(c,b)}} -var mqb='AbstractMap$2',nqb='AbstractMap$2$1',hqb='AsyncFragmentLoader',iqb='AsyncFragmentLoader$BoundedIntQueue',jqb='AsyncFragmentLoader$HttpDownloadFailure',kqb='AsyncFragmentLoader$InitialFragmentDownloadFailed',lqb='AsyncFragmentLoader$XhrLoadingStrategy$1',eqb='HTTP download failed with status ',gqb='[I',Wpb='begin',Ypb='com.google.gwt.lang.asyncloaders.',dqb='download',Xpb='end',cqb='leftoversDownload',fqb='runAsync';_=tx.prototype=new Ef;_.gC=Gx;_.tI=0;_.b=null;_.c=0;_.d=null;_.e=null;var ux;_=Hx.prototype=new Ef;_.gC=Qx;_.tI=0;_.a=null;_.b=0;_.c=0;_=Rx.prototype=new nw;_.gC=Ux;_.tI=76;_=Vx.prototype=new Ef;_.gC=Zx;_.Gb=$x;_.tI=77;_.a=null;_=ky.prototype=new Ef;_.gC=ny;_.Hb=oy;_.tI=0;_.a=null;_.b=null;_=r3.prototype;_.ac=z3;_=t7.prototype=new a5;_.cc=x7;_.gC=y7;_.nb=z7;_.dc=A7;_.tI=0;_.a=null;_.b=null;_=B7.prototype=new Ef;_.gC=E7;_.Tb=F7;_.Ub=G7;_.tI=0;_.a=null;var _P=C2(_bb,gqb),DM=D2(Bmb,hqb),zM=D2(Bmb,iqb),AM=D2(Bmb,jqb),BM=D2(Bmb,kqb),CM=D2(Bmb,lqb),MP=D2(Ckb,mqb),LP=D2(Ckb,nqb);Fx(); \ No newline at end of file diff --git a/3.1/modules/gwtorganize/war/g3viewer/g3viewer.nocache.js b/3.1/modules/gwtorganize/war/g3viewer/g3viewer.nocache.js deleted file mode 100644 index 8ef094fe..00000000 --- a/3.1/modules/gwtorganize/war/g3viewer/g3viewer.nocache.js +++ /dev/null @@ -1,11 +0,0 @@ -function g3viewer(){var M='',nb='" for "gwt:onLoadErrorFn"',lb='" for "gwt:onPropertyErrorFn"',Y='"><\/script>',$='#',Xb='.cache.html',ab='/',Lb='0D97DF37194D1924CC80394AAA96B9A3',Mb='27AC86F0820D8F960DBF73C151C0332B',Nb='4AFE598FDFDF189DD61F57E554328B10',Ob='4E8EC2279CB4B46228EFF0682ED166A4',Pb='4F7AD7D8299143D876CB4071BE00BF02',Qb='6462B363383D23B8418857B7A6FAD85B',Rb='71ED95F3DFB964762667E45E2922704D',Sb='884CB866FECF37EDDE4914CA60AF2511',Tb='9DC95FB4BEC084EF810751F04B440FD7',hc=' - -This html file is for hosted mode support. - diff --git a/3.1/modules/gwtorganize/war/g3viewer/loading.gif b/3.1/modules/gwtorganize/war/g3viewer/loading.gif deleted file mode 100644 index 8f56a82c..00000000 Binary files a/3.1/modules/gwtorganize/war/g3viewer/loading.gif and /dev/null differ diff --git a/3.1/modules/gwtorganize/war/index.php b/3.1/modules/gwtorganize/war/index.php deleted file mode 100644 index 3a5cf905..00000000 --- a/3.1/modules/gwtorganize/war/index.php +++ /dev/null @@ -1,6 +0,0 @@ -Gallery Administration - - -
      diff --git a/3.1/modules/highroller/controllers/highroller.php b/3.1/modules/highroller/controllers/highroller.php deleted file mode 100644 index 80eb05be..00000000 --- a/3.1/modules/highroller/controllers/highroller.php +++ /dev/null @@ -1,29 +0,0 @@ -get("name"); - if ($name) { - Session::instance()->set("highroller_theme", $name); - } else { - Session::instance()->delete("highroller_theme"); - } - } -} diff --git a/3.1/modules/highroller/helpers/highroller_theme.php b/3.1/modules/highroller/helpers/highroller_theme.php deleted file mode 100644 index 9bdfbad1..00000000 --- a/3.1/modules/highroller/helpers/highroller_theme.php +++ /dev/null @@ -1,50 +0,0 @@ -script("highroller.js") - . sprintf("", url::site("highroller/pick_theme")); - } - - static function header_top($theme) { - $session = Session::instance(); - $highroller_theme = $session->get("highroller_theme", ""); - if ($highroller_theme) { - print html::stylesheet( - url::abs_file("modules/highroller/themes/$highroller_theme/theme.css")); - } - } - - static function footer($theme) { - $base = MODPATH . "highroller/themes/"; - $base_len = strlen($base); - $options[] = ""; - foreach (glob("$base*") as $theme) { - $name = substr($theme, $base_len); - $options[$name] = $name; - } - $session = Session::instance(); - $highroller_theme = $session->get("highroller_theme"); - print '
      Theme: ' . - form::dropdown("", $options, $highroller_theme, - 'style="display: inline" onchange="pick_theme(this.value)"') . - '
      '; - } -} \ No newline at end of file diff --git a/3.1/modules/highroller/js/highroller.js b/3.1/modules/highroller/js/highroller.js deleted file mode 100644 index bfa4573c..00000000 --- a/3.1/modules/highroller/js/highroller.js +++ /dev/null @@ -1,7 +0,0 @@ -var pick_theme = function(name) { - $.get(PICK_THEME_URL, - {name: name}, - function() { - window.location.reload(); - }); -}; diff --git a/3.1/modules/highroller/module.info b/3.1/modules/highroller/module.info deleted file mode 100644 index 7b89e9cb..00000000 --- a/3.1/modules/highroller/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "High Roller" -description = "Let users choose from a selection of ThemeRoller themes" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:highroller" -discuss_url = "http://gallery.menalto.com/forum_module_highroller" diff --git a/3.1/modules/highroller/themes/eggplant/images/ui-bg_diagonals-small_25_c5ddfc_40x40.png b/3.1/modules/highroller/themes/eggplant/images/ui-bg_diagonals-small_25_c5ddfc_40x40.png deleted file mode 100644 index 82524abb..00000000 Binary files a/3.1/modules/highroller/themes/eggplant/images/ui-bg_diagonals-small_25_c5ddfc_40x40.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/eggplant/images/ui-bg_diagonals-thick_20_e69700_40x40.png b/3.1/modules/highroller/themes/eggplant/images/ui-bg_diagonals-thick_20_e69700_40x40.png deleted file mode 100644 index 6aed97a2..00000000 Binary files a/3.1/modules/highroller/themes/eggplant/images/ui-bg_diagonals-thick_20_e69700_40x40.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/eggplant/images/ui-bg_diagonals-thick_22_1484e6_40x40.png b/3.1/modules/highroller/themes/eggplant/images/ui-bg_diagonals-thick_22_1484e6_40x40.png deleted file mode 100644 index f11ca67a..00000000 Binary files a/3.1/modules/highroller/themes/eggplant/images/ui-bg_diagonals-thick_22_1484e6_40x40.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/eggplant/images/ui-bg_diagonals-thick_26_2293f7_40x40.png b/3.1/modules/highroller/themes/eggplant/images/ui-bg_diagonals-thick_26_2293f7_40x40.png deleted file mode 100644 index ce718683..00000000 Binary files a/3.1/modules/highroller/themes/eggplant/images/ui-bg_diagonals-thick_26_2293f7_40x40.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/eggplant/images/ui-bg_flat_0_e69700_40x100.png b/3.1/modules/highroller/themes/eggplant/images/ui-bg_flat_0_e69700_40x100.png deleted file mode 100644 index f567c286..00000000 Binary files a/3.1/modules/highroller/themes/eggplant/images/ui-bg_flat_0_e69700_40x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/eggplant/images/ui-bg_flat_0_e6b900_40x100.png b/3.1/modules/highroller/themes/eggplant/images/ui-bg_flat_0_e6b900_40x100.png deleted file mode 100644 index 29e99655..00000000 Binary files a/3.1/modules/highroller/themes/eggplant/images/ui-bg_flat_0_e6b900_40x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/eggplant/images/ui-bg_highlight-soft_100_f9f9f9_1x100.png b/3.1/modules/highroller/themes/eggplant/images/ui-bg_highlight-soft_100_f9f9f9_1x100.png deleted file mode 100644 index 4f9e1ae2..00000000 Binary files a/3.1/modules/highroller/themes/eggplant/images/ui-bg_highlight-soft_100_f9f9f9_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/eggplant/images/ui-bg_inset-hard_100_eeeeee_1x100.png b/3.1/modules/highroller/themes/eggplant/images/ui-bg_inset-hard_100_eeeeee_1x100.png deleted file mode 100644 index f811f309..00000000 Binary files a/3.1/modules/highroller/themes/eggplant/images/ui-bg_inset-hard_100_eeeeee_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/eggplant/images/ui-icons_0a82eb_256x240.png b/3.1/modules/highroller/themes/eggplant/images/ui-icons_0a82eb_256x240.png deleted file mode 100644 index 9c9f6b7f..00000000 Binary files a/3.1/modules/highroller/themes/eggplant/images/ui-icons_0a82eb_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/eggplant/images/ui-icons_5fa5e3_256x240.png b/3.1/modules/highroller/themes/eggplant/images/ui-icons_5fa5e3_256x240.png deleted file mode 100644 index 8167e62a..00000000 Binary files a/3.1/modules/highroller/themes/eggplant/images/ui-icons_5fa5e3_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/eggplant/images/ui-icons_fcdd4a_256x240.png b/3.1/modules/highroller/themes/eggplant/images/ui-icons_fcdd4a_256x240.png deleted file mode 100644 index 7b28a62c..00000000 Binary files a/3.1/modules/highroller/themes/eggplant/images/ui-icons_fcdd4a_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_glass_55_fcf0ba_1x400.png b/3.1/modules/highroller/themes/excite-bike/images/ui-bg_glass_55_fcf0ba_1x400.png deleted file mode 100644 index 7e99e746..00000000 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_glass_55_fcf0ba_1x400.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_gloss-wave_100_ece8da_500x100.png b/3.1/modules/highroller/themes/excite-bike/images/ui-bg_gloss-wave_100_ece8da_500x100.png deleted file mode 100644 index 709b5ab1..00000000 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_gloss-wave_100_ece8da_500x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-hard_100_f5f3e5_1x100.png b/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-hard_100_f5f3e5_1x100.png deleted file mode 100644 index 6045f63e..00000000 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-hard_100_f5f3e5_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-hard_100_fafaf4_1x100.png b/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-hard_100_fafaf4_1x100.png deleted file mode 100644 index bfc39c67..00000000 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-hard_100_fafaf4_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-hard_15_459e00_1x100.png b/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-hard_15_459e00_1x100.png deleted file mode 100644 index 5f609250..00000000 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-hard_15_459e00_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-hard_95_cccccc_1x100.png b/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-hard_95_cccccc_1x100.png deleted file mode 100644 index ca80bffc..00000000 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-hard_95_cccccc_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-soft_25_67b021_1x100.png b/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-soft_25_67b021_1x100.png deleted file mode 100644 index b33bd7b6..00000000 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-soft_25_67b021_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-soft_95_ffedad_1x100.png b/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-soft_95_ffedad_1x100.png deleted file mode 100644 index b4cb8241..00000000 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_highlight-soft_95_ffedad_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_inset-soft_15_2b2922_1x100.png b/3.1/modules/highroller/themes/excite-bike/images/ui-bg_inset-soft_15_2b2922_1x100.png deleted file mode 100644 index 8e5c3a3f..00000000 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-bg_inset-soft_15_2b2922_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-icons_808080_256x240.png b/3.1/modules/highroller/themes/excite-bike/images/ui-icons_808080_256x240.png deleted file mode 100644 index 6f3d2e61..00000000 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-icons_808080_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-icons_847e71_256x240.png b/3.1/modules/highroller/themes/excite-bike/images/ui-icons_847e71_256x240.png deleted file mode 100644 index 89b86802..00000000 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-icons_847e71_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-icons_cd0a0a_256x240.png b/3.1/modules/highroller/themes/excite-bike/images/ui-icons_cd0a0a_256x240.png deleted file mode 100644 index 7930a558..00000000 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-icons_cd0a0a_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-icons_eeeeee_256x240.png b/3.1/modules/highroller/themes/excite-bike/images/ui-icons_eeeeee_256x240.png deleted file mode 100644 index 0f60311e..00000000 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-icons_eeeeee_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/images/ui-icons_ffffff_256x240.png b/3.1/modules/highroller/themes/excite-bike/images/ui-icons_ffffff_256x240.png deleted file mode 100644 index bef5178a..00000000 Binary files a/3.1/modules/highroller/themes/excite-bike/images/ui-icons_ffffff_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/excite-bike/theme.css b/3.1/modules/highroller/themes/excite-bike/theme.css deleted file mode 100644 index 99e7e242..00000000 --- a/3.1/modules/highroller/themes/excite-bike/theme.css +++ /dev/null @@ -1,406 +0,0 @@ -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - - -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=segoe%20ui,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=ece8da&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=100&borderColorHeader=d4ccb0&fcHeader=433f38&iconColorHeader=847e71&bgColorContent=f5f3e5&bgTextureContent=04_highlight_hard.png&bgImgOpacityContent=100&borderColorContent=dfd9c3&fcContent=312e25&iconColorContent=808080&bgColorDefault=459e00&bgTextureDefault=04_highlight_hard.png&bgImgOpacityDefault=15&borderColorDefault=327E04&fcDefault=ffffff&iconColorDefault=eeeeee&bgColorHover=67b021&bgTextureHover=03_highlight_soft.png&bgImgOpacityHover=25&borderColorHover=327E04&fcHover=ffffff&iconColorHover=ffffff&bgColorActive=fafaf4&bgTextureActive=04_highlight_hard.png&bgImgOpacityActive=100&borderColorActive=d4ccb0&fcActive=459e00&iconColorActive=8DC262&bgColorHighlight=fcf0ba&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=e8e1b5&fcHighlight=363636&iconColorHighlight=8DC262&bgColorError=ffedad&bgTextureError=03_highlight_soft.png&bgImgOpacityError=95&borderColorError=e3a345&fcError=cd5c0a&iconColorError=cd0a0a&bgColorOverlay=2b2922&bgTextureOverlay=05_inset_soft.png&bgImgOpacityOverlay=15&opacityOverlay=90&bgColorShadow=cccccc&bgTextureShadow=04_highlight_hard.png&bgImgOpacityShadow=95&opacityShadow=20&thicknessShadow=12px&offsetTopShadow=-12px&offsetLeftShadow=-12px&cornerRadiusShadow=10px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: segoe ui, Arial, sans-serif; font-size: 1.1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: segoe ui, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #dfd9c3; background: #f5f3e5 url(images/ui-bg_highlight-hard_100_f5f3e5_1x100.png) 50% top repeat-x; color: #312e25; } -.ui-widget-content a { color: #312e25; } -.ui-widget-header { border: 1px solid #d4ccb0; background: #ece8da url(images/ui-bg_gloss-wave_100_ece8da_500x100.png) 50% 50% repeat-x; color: #433f38; font-weight: bold; } -.ui-widget-header a { color: #433f38; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #327E04; background: #459e00 url(images/ui-bg_highlight-hard_15_459e00_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #ffffff; outline: none; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #ffffff; text-decoration: none; outline: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #327E04; background: #67b021 url(images/ui-bg_highlight-soft_25_67b021_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #ffffff; outline: none; } -.ui-state-hover a, .ui-state-hover a:hover { color: #ffffff; text-decoration: none; outline: none; } -.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #d4ccb0; background: #fafaf4 url(images/ui-bg_highlight-hard_100_fafaf4_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #459e00; outline: none; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #459e00; outline: none; text-decoration: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #e8e1b5; background: #fcf0ba url(images/ui-bg_glass_55_fcf0ba_1x400.png) 50% 50% repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #e3a345; background: #ffedad url(images/ui-bg_highlight-soft_95_ffedad_1x100.png) 50% top repeat-x; color: #cd5c0a; } -.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd5c0a; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd5c0a; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_808080_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_808080_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_847e71_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_eeeeee_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_8DC262_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_8DC262_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; } -.ui-corner-tr { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; } -.ui-corner-br { -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; } -.ui-corner-top { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; } -.ui-corner-right { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; } -.ui-corner-left { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; } -.ui-corner-all { -moz-border-radius: 6px; -webkit-border-radius: 6px; } - -/* Overlays */ -.ui-widget-overlay { background: #2b2922 url(images/ui-bg_inset-soft_15_2b2922_1x100.png) 50% bottom repeat-x; opacity: .90;filter:Alpha(Opacity=90); } -.ui-widget-shadow { margin: -12px 0 0 -12px; padding: 12px; background: #cccccc url(images/ui-bg_highlight-hard_95_cccccc_1x100.png) 50% top repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 10px; -webkit-border-radius: 10px; }/* Accordion -----------------------------------*/ -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } -.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}/* Dialog -----------------------------------*/ -.ui-dialog { position: relative; padding: .2em; width: 300px; } -.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs -----------------------------------*/ -.ui-tabs { padding: .2em; zoom: 1; } -.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } -.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_flat_0_aaaaaa_40x100.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_flat_0_aaaaaa_40x100.png deleted file mode 100644 index 5b5dab2a..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_flat_0_aaaaaa_40x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_flat_0_eeeeee_40x100.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_flat_0_eeeeee_40x100.png deleted file mode 100644 index e44f861b..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_flat_0_eeeeee_40x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_flat_55_994d53_40x100.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_flat_55_994d53_40x100.png deleted file mode 100644 index 822d5205..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_flat_55_994d53_40x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_flat_55_fafafa_40x100.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_flat_55_fafafa_40x100.png deleted file mode 100644 index 62685abd..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_flat_55_fafafa_40x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_gloss-wave_30_3d3644_500x100.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_gloss-wave_30_3d3644_500x100.png deleted file mode 100644 index b349aae8..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_gloss-wave_30_3d3644_500x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_highlight-soft_100_dcd9de_1x100.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_highlight-soft_100_dcd9de_1x100.png deleted file mode 100644 index 8fb964ce..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_highlight-soft_100_dcd9de_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_highlight-soft_100_eae6ea_1x100.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_highlight-soft_100_eae6ea_1x100.png deleted file mode 100644 index 1e2ae7c9..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_highlight-soft_100_eae6ea_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_highlight-soft_25_30273a_1x100.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_highlight-soft_25_30273a_1x100.png deleted file mode 100644 index 399c01ff..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_highlight-soft_25_30273a_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_highlight-soft_45_5f5964_1x100.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_highlight-soft_45_5f5964_1x100.png deleted file mode 100644 index 18a1b0ba..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-bg_highlight-soft_45_5f5964_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_454545_256x240.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_454545_256x240.png deleted file mode 100644 index 7ec70d11..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_454545_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_734d99_256x240.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_734d99_256x240.png deleted file mode 100644 index 2bb90aae..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_734d99_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_8d78a5_256x240.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_8d78a5_256x240.png deleted file mode 100644 index a1ca0b60..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_8d78a5_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_a8a3ae_256x240.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_a8a3ae_256x240.png deleted file mode 100644 index dfffcbfe..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_a8a3ae_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_ebccce_256x240.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_ebccce_256x240.png deleted file mode 100644 index 68bef14f..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_ebccce_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_ffffff_256x240.png b/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_ffffff_256x240.png deleted file mode 100644 index bef5178a..00000000 Binary files a/3.1/modules/highroller/themes/pepper-grinder/images/ui-icons_ffffff_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/pepper-grinder/theme.css b/3.1/modules/highroller/themes/pepper-grinder/theme.css deleted file mode 100644 index 4b66a710..00000000 --- a/3.1/modules/highroller/themes/pepper-grinder/theme.css +++ /dev/null @@ -1,406 +0,0 @@ -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - - -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande,%20Lucida%20Sans,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=30273a&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=25&borderColorHeader=231d2b&fcHeader=ffffff&iconColorHeader=a8a3ae&bgColorContent=3d3644&bgTextureContent=12_gloss_wave.png&bgImgOpacityContent=30&borderColorContent=7e7783&fcContent=ffffff&iconColorContent=ffffff&bgColorDefault=dcd9de&bgTextureDefault=03_highlight_soft.png&bgImgOpacityDefault=100&borderColorDefault=dcd9de&fcDefault=665874&iconColorDefault=8d78a5&bgColorHover=eae6ea&bgTextureHover=03_highlight_soft.png&bgImgOpacityHover=100&borderColorHover=d1c5d8&fcHover=734d99&iconColorHover=734d99&bgColorActive=5f5964&bgTextureActive=03_highlight_soft.png&bgImgOpacityActive=45&borderColorActive=7e7783&fcActive=ffffff&iconColorActive=454545&bgColorHighlight=fafafa&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=ffdb1f&fcHighlight=333333&iconColorHighlight=8d78a5&bgColorError=994d53&bgTextureError=01_flat.png&bgImgOpacityError=55&borderColorError=994d53&fcError=ffffff&iconColorError=ebccce&bgColorOverlay=eeeeee&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=80&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=60&thicknessShadow=4px&offsetTopShadow=-4px&offsetLeftShadow=-4px&cornerRadiusShadow=0px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #7e7783; background: #3d3644 url(images/ui-bg_gloss-wave_30_3d3644_500x100.png) 50% top repeat-x; color: #ffffff; } -.ui-widget-content a { color: #ffffff; } -.ui-widget-header { border: 1px solid #231d2b; background: #30273a url(images/ui-bg_highlight-soft_25_30273a_1x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } -.ui-widget-header a { color: #ffffff; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #dcd9de; background: #dcd9de url(images/ui-bg_highlight-soft_100_dcd9de_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #665874; outline: none; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #665874; text-decoration: none; outline: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #d1c5d8; background: #eae6ea url(images/ui-bg_highlight-soft_100_eae6ea_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #734d99; outline: none; } -.ui-state-hover a, .ui-state-hover a:hover { color: #734d99; text-decoration: none; outline: none; } -.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #7e7783; background: #5f5964 url(images/ui-bg_highlight-soft_45_5f5964_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #ffffff; outline: none; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; outline: none; text-decoration: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #ffdb1f; background: #fafafa url(images/ui-bg_flat_55_fafafa_40x100.png) 50% 50% repeat-x; color: #333333; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #333333; } -.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #994d53; background: #994d53 url(images/ui-bg_flat_55_994d53_40x100.png) 50% 50% repeat-x; color: #ffffff; } -.ui-state-error a, .ui-widget-content .ui-state-error a { color: #ffffff; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #ffffff; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_a8a3ae_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_8d78a5_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_734d99_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_8d78a5_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ebccce_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; } -.ui-corner-tr { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; } -.ui-corner-br { -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; } -.ui-corner-top { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; } -.ui-corner-right { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; } -.ui-corner-left { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; } -.ui-corner-all { -moz-border-radius: 6px; -webkit-border-radius: 6px; } - -/* Overlays */ -.ui-widget-overlay { background: #eeeeee url(images/ui-bg_flat_0_eeeeee_40x100.png) 50% 50% repeat-x; opacity: .80;filter:Alpha(Opacity=80); } -.ui-widget-shadow { margin: -4px 0 0 -4px; padding: 4px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .60;filter:Alpha(Opacity=60); -moz-border-radius: 0px; -webkit-border-radius: 0px; }/* Accordion -----------------------------------*/ -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } -.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}/* Dialog -----------------------------------*/ -.ui-dialog { position: relative; padding: .2em; width: 300px; } -.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs -----------------------------------*/ -.ui-tabs { padding: .2em; zoom: 1; } -.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } -.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png deleted file mode 100644 index 954e22db..00000000 Binary files a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png deleted file mode 100644 index 64ece570..00000000 Binary files a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png deleted file mode 100644 index 9b383f4d..00000000 Binary files a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png b/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png deleted file mode 100644 index a23baad2..00000000 Binary files a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png b/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png deleted file mode 100644 index 42ccba26..00000000 Binary files a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png deleted file mode 100644 index 39d5824d..00000000 Binary files a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png deleted file mode 100644 index f1273672..00000000 Binary files a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png deleted file mode 100644 index 32f86222..00000000 Binary files a/3.1/modules/highroller/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_222222_256x240.png b/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_222222_256x240.png deleted file mode 100644 index ee039dc0..00000000 Binary files a/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_222222_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_228ef1_256x240.png b/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_228ef1_256x240.png deleted file mode 100644 index 10e3631d..00000000 Binary files a/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_228ef1_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png b/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png deleted file mode 100644 index 35bb8efa..00000000 Binary files a/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png b/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png deleted file mode 100644 index baebb63e..00000000 Binary files a/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_ffffff_256x240.png b/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_ffffff_256x240.png deleted file mode 100644 index bef5178a..00000000 Binary files a/3.1/modules/highroller/themes/ui-lightness/images/ui-icons_ffffff_256x240.png and /dev/null differ diff --git a/3.1/modules/highroller/themes/ui-lightness/theme.css b/3.1/modules/highroller/themes/ui-lightness/theme.css deleted file mode 100644 index 9d7aa08b..00000000 --- a/3.1/modules/highroller/themes/ui-lightness/theme.css +++ /dev/null @@ -1,406 +0,0 @@ -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - - -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } -.ui-widget-content a { color: #333333; } -.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } -.ui-widget-header a { color: #ffffff; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; outline: none; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; outline: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; outline: none; } -.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; outline: none; } -.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; outline: none; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; outline: none; text-decoration: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } -.ui-state-error a, .ui-widget-content .ui-state-error a { color: #ffffff; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #ffffff; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; } -.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } -.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } -.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; } - -/* Overlays */ -.ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } -.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; }/* Accordion -----------------------------------*/ -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } -.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}/* Dialog -----------------------------------*/ -.ui-dialog { position: relative; padding: .2em; width: 300px; } -.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs -----------------------------------*/ -.ui-tabs { padding: .2em; zoom: 1; } -.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } -.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/3.1/modules/html_uploader/controllers/uploader.php b/3.1/modules/html_uploader/controllers/uploader.php deleted file mode 100644 index 0b9b5351..00000000 --- a/3.1/modules/html_uploader/controllers/uploader.php +++ /dev/null @@ -1,128 +0,0 @@ -is_album()) { - $album = $album->parent(); - } - - print $this->_get_add_form($album); - } - - public function add($id) { - $album = ORM::factory("item", $id); - access::required("view", $album); - access::required("add", $album); - access::verify_csrf(); - - $form = $this->_get_add_form($album); - if ($form->validate()) { - batch::start(); - - $count = 0; - $added_a_movie = false; - $added_a_photo = false; - foreach (array("file1", "file2", "file3") as $key) { - if ($form->add_photos->$key->value == "") { - continue; - } - - try { - $temp_filename = $form->add_photos->$key->value; - $item = ORM::factory("item"); - $item->name = basename($temp_filename); - $item->title = item::convert_filename_to_title($item->name); - $item->parent_id = $album->id; - $item->set_data_file($temp_filename); - - $path_info = @pathinfo($temp_filename); - if (array_key_exists("extension", $path_info) && - in_array(strtolower($path_info["extension"]), array("flv", "mp4", "m4v"))) { - $item->type = "movie"; - $item->save(); - $added_a_movie = true; - log::success("content", t("Added a movie"), - html::anchor("movies/$item->id", t("view movie"))); - } else { - $item->type = "photo"; - $item->save(); - $added_a_photo = true; - log::success("content", t("Added a photo"), - html::anchor("photos/$item->id", t("view photo"))); - } - $count++; - module::event("add_photos_form_completed", $item, $form); - } catch (Exception $e) { - // Lame error handling for now. Just record the exception and move on - Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString()); - - // Ugh. I hate to use instanceof, But this beats catching the exception separately since - // we mostly want to treat it the same way as all other exceptions - if ($e instanceof ORM_Validation_Exception) { - Kohana_Log::add("error", "Validation errors: " . print_r($e->validation->errors(), 1)); - } - } - - if (file_exists($temp_filename)) { - unlink($temp_filename); - } - } - batch::stop(); - if ($count) { - if ($added_a_photo && $added_a_movie) { - message::success(t("Added %count photos and movies", array("count" => $count))); - } else if ($added_a_photo) { - message::success(t2("Added one photo", "Added %count photos", $count)); - } else { - message::success(t2("Added one movie", "Added %count movies", $count)); - } - } - json::reply(array("result" => "success")); - } else { - json::reply(array("result" => "error", "html" => (string) $form)); - } - - // Override the application/json mime type. The dialog based HTML uploader uses an iframe to - // buffer the reply, and on some browsers (Firefox 3.6) it does not know what to do with the - // JSON that it gets back so it puts up a dialog asking the user what to do with it. So force - // the encoding type back to HTML for the iframe. - // See: http://jquery.malsup.com/form/#file-upload - header("Content-Type: text/html; charset=" . Kohana::CHARSET); - } - - private function _get_add_form($album) { - $form = new Forge("uploader/add/{$album->id}", "", "post", array("id" => "g-add-photos-form")); - $group = $form->group("add_photos") - ->label(t("Add photos to %album_title", array("album_title" => html::purify($album->title)))); - $group->upload("file1")->add_rule("foo"); - $group->upload("file2"); - $group->upload("file3"); - - module::event("add_photos_form", $album, $form); - - $group = $form->group("buttons")->label(""); - $group->submit("")->value(t("Upload")); - - return $form; - } -} diff --git a/3.1/modules/html_uploader/module.info b/3.1/modules/html_uploader/module.info deleted file mode 100644 index de2becbb..00000000 --- a/3.1/modules/html_uploader/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "HTML Uploader" -description = "Simple HTML uploader that replaces the Flash based uploader" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:html_uploader" -discuss_url = "http://gallery.menalto.com/forum_module_html_uploader" diff --git a/3.1/modules/iptc/controllers/admin_iptc.php b/3.1/modules/iptc/controllers/admin_iptc.php deleted file mode 100644 index e8bdd06c..00000000 --- a/3.1/modules/iptc/controllers/admin_iptc.php +++ /dev/null @@ -1,84 +0,0 @@ -content = new View("admin_iptc.html"); - $view->content->iptc_form = $this->_get_admin_form(); - print $view; - } - - public function saveprefs() { - // Save user preferences to the database. - - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Make sure the user filled out the form properly. - $form = $this->_get_admin_form(); - if ($form->validate()) { - Kohana_Log::add("error",print_r($form,1)); - - // Save settings to Gallery's database. - foreach (iptc::keys() as $keyword => $iptcvar) { - $checkbox = false; - for ($i = 0; $i < count($form->Global->$keyword); $i++) { - if ($form->Global->$keyword->value[$i] == $keyword) { - $checkbox = true; - } - } - module::set_var("iptc", "show_".$keyword, $checkbox); - } - // Display a success message and redirect back to the TagsMap admin page. - message::success(t("Your settings have been saved.")); - url::redirect("admin/iptc"); - } - - // Else show the page with errors - $view = new Admin_View("admin.html"); - $view->content = new View("admin_iptc.html"); - $view->content->iptc_form = $form; - print $view; - } - - private function _get_admin_form() { - // Make a new Form. - $form = new Forge("admin/iptc/saveprefs", "", "post", array("id" => "g-iptc-adminForm")); - - // Create group for display settings - $iptc_display_group = $form->group("Global") - ->label(t("Display Settings")); - - $show = t("Show"); - foreach (iptc::keys() as $keyword => $iptcvar) { - unset($checkbox); - $checkbox[$keyword] = array($show." \"".$iptcvar[1]."\" ?", module::get_var("iptc", "show_".$keyword)); - $iptc_display_group->checklist($keyword) - ->options($checkbox); - } - // Add a save button to the form. - $form->submit("SaveSettings")->value(t("Save")); - - // Return the newly generated form. - return $form; - } -} diff --git a/3.1/modules/iptc/helpers/iptc.php b/3.1/modules/iptc/helpers/iptc.php deleted file mode 100644 index cca0f61f..00000000 --- a/3.1/modules/iptc/helpers/iptc.php +++ /dev/null @@ -1,207 +0,0 @@ -is_photo() && $item->mime_type == "image/jpeg") { - $info = getJpegHeader($item->file_path()); - if ($info !== FALSE) { - $iptcBlock = getIptcBlock($info); - if ($iptcBlock !== FALSE) { - $iptc = iptcparse($iptcBlock); - } else { - $iptc = array(); - } - $xmp = getXmpDom($info); - - foreach (self::keys() as $keyword => $iptcvar) { - $iptc_key = $iptcvar[0]; - $xpath = $iptcvar[2]; - $value = null; - if ($xpath != null) { - $value = getXmpValue($xmp, $xpath); - } - if ($value == null) { - if (!empty($iptc[$iptc_key])) { - $value = implode(";", $iptc[$iptc_key]); - if (function_exists("mb_detect_encoding") && mb_detect_encoding($value) != "UTF-8") { - $value = utf8_encode($value); - } - } - } - if ($value != null) { - $keys[$keyword] = Input::clean($value); - } - } - } - } - - $record = ORM::factory("iptc_record")->where("item_id", "=", $item->id)->find(); - if (!$record->loaded()) { - $record->item_id = $item->id; - } - $record->data = serialize($keys); - $record->key_count = count($keys); - $record->dirty = 0; - $record->save(); - } - - static function get($item) { - $iptc = array(); - $record = ORM::factory("iptc_record") - ->where("item_id", "=", $item->id) - ->find(); - if (!$record->loaded()) { - return array(); - } - - $definitions = self::keys(); - $keys = unserialize($record->data); - foreach ($keys as $key => $value) { - if (module::get_var("iptc", "show_".$key) == 1) - $iptc[] = array("caption" => $definitions[$key][1], "value" => $value); - } - - return $iptc; - } - - - public static function keys() { - if (!isset(self::$iptc_keys)) { - self::$iptc_keys = array( - "ObjectName" => array("2#005", - t("IPTC Object Name"), - "/x:xmpmeta/rdf:RDF/rdf:Description/dc:title/rdf:Alt/rdf:li" ), - "EditStatus" => array("2#007", - t("IPTC Edit Status"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@mediapro:Status" ), - "Category" => array("2#015", - t("IPTC Category"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@photoshop:Category" ), - "SupplementalCategories" => array("2#020", - t("IPTC Categories"), - "/x:xmpmeta/rdf:RDF/rdf:Description/photoshop:SupplementalCategories/rdf:Bag/rdf:li" ), - "FixtureIdentifier" => array("2#022", - t("IPTC Identifier"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@mediapro:Event" ), - "Keywords" => array("2#025", - t("IPTC Keywords"), - "/x:xmpmeta/rdf:RDF/rdf:Description/dc:subject/rdf:Bag/rdf:li" ), - "LocationCode" => array("2#026", - t("IPTC Location Code"), - null ), - "SpecialInstructions" => array("2#040", - t("IPTC Instructions"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@photoshop:Instructions" ), - "DateCreated" => array("2#055", - t("IPTC Created Date"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@photoshop:DateCreated" ), - "ByLine" => array("2#080", - t("IPTC Author"), - "/x:xmpmeta/rdf:RDF/rdf:Description/dc:creator/rdf:Seq/rdf:li" ), - "ByLineTitle" => array("2#085", - t("IPTC Author Title"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@photoshop:AuthorsPosition" ), - "City" => array("2#090", - t("IPTC City"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@photoshop:City" ), - "SubLocation" => array("2#092", - t("IPTC SubLocation"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@Iptc4xmpCore:Location | /x:xmpmeta/rdf:RDF/rdf:Description/@mediapro:Location" ), - "ProvinceState" => array("2#095", - t("IPTC Province State"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@photoshop:State" ), - "CountryCode" => array("2#100", - t("IPTC Country Code"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@Iptc4xmpCore:CountryCode" ), - "CountryName" => array("2#101", - t("IPTC Country Name"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@photoshop:Country" ), - "Transmission" => array("2#103", - t("IPTC Transmission,"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@photoshop:TransmissionReference" ), - "HeadLine" => array("2#105", - t("IPTC HeadLine"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@photoshop:Headline" ), - "Credit" => array("2#110", - t("IPTC Credit"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@photoshop:Credit | /x:xmpmeta/rdf:RDF/rdf:Description/photoshop:Credit" ), - "Source" => array("2#115", - t("IPTC Source"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@photoshop:Source" ), - "Copyright" => array("2#116", - t("IPTC Copyright"), - "/x:xmpmeta/rdf:RDF/rdf:Description/dc:rights/rdf:Alt/rdf:li" ), - "Contacts" => array("2#118", - t("IPTC Contacts"), - "/x:xmpmeta/rdf:RDF/rdf:Description/mediapro:People/rdf:Bag/rdf:li" ), - "Caption" => array("2#120", - t("IPTC Caption"), - "/x:xmpmeta/rdf:RDF/rdf:Description/dc:description/rdf:Alt/rdf:li" ), - "Redactor" => array("2#122", - t("IPTC Redactor"), - "/x:xmpmeta/rdf:RDF/rdf:Description/@photoshop:CaptionWriter" ) - ); - } - return self::$iptc_keys; - } - - - static function stats() { - $missing_iptc = db::build() - ->select("items.id") - ->from("items") - ->join("iptc_records", "items.id", "iptc_records.item_id", "left") - ->where("type", "=", "photo") - ->and_open() - ->where("iptc_records.item_id", "IS", null) - ->or_where("iptc_records.dirty", "=", 1) - ->close() - ->execute() - ->count(); - - $total_items = ORM::factory("item")->where("type", "=", "photo")->count_all(); - if (!$total_items) { - return array(0, 0, 0); - } - return array($missing_iptc, $total_items, - round(100 * (($total_items - $missing_iptc) / $total_items))); - } - - static function check_index() { - list ($remaining) = iptc::stats(); - if ($remaining) { - site_status::warning( - t('Your Iptc index needs to be updated. Fix this now', - array("url" => html::mark_clean(url::site("admin/maintenance/start/iptc_task::update_index?csrf=__CSRF__")))), - "iptc_index_out_of_date"); - } - } -} diff --git a/3.1/modules/iptc/helpers/iptc_task.php b/3.1/modules/iptc/helpers/iptc_task.php deleted file mode 100644 index d4715bff..00000000 --- a/3.1/modules/iptc/helpers/iptc_task.php +++ /dev/null @@ -1,88 +0,0 @@ -delete("iptc_records") - ->where("item_id", "NOT IN", - db::build()->select("id")->from("items")->where("type", "=", "photo")) - ->execute(); - - list ($remaining, $total, $percent) = iptc::stats(); - return array(Task_Definition::factory() - ->callback("iptc_task::update_index") - ->name(t("Extract Iptc data")) - ->description($remaining - ? t2("1 photo needs to be scanned", - "%count (%percent%) of your photos need to be scanned", - $remaining, array("percent" => (100 - $percent))) - : t("IPTC data is up-to-date")) - ->severity($remaining ? log::WARNING : log::SUCCESS)); - } - - static function update_index($task) { - try { - $completed = $task->get("completed", 0); - - $start = microtime(true); - foreach (ORM::factory("item") - ->join("iptc_records", "items.id", "iptc_records.item_id", "left") - ->where("type", "=", "photo") - ->and_open() - ->where("iptc_records.item_id", "IS", null) - ->or_where("iptc_records.dirty", "=", 1) - ->close() - ->find_all() as $item) { - // The query above can take a long time, so start the timer after its done - // to give ourselves a little time to actually process rows. - if (!isset($start)) { - $start = microtime(true); - } - - iptc::extract($item); - $completed++; - - if (microtime(true) - $start > 1.5) { - break; - } - } - - list ($remaining, $total, $percent) = iptc::stats(); - $task->set("completed", $completed); - if ($remaining == 0 || !($remaining + $completed)) { - $task->done = true; - $task->state = "success"; - site_status::clear("iptc_index_out_of_date"); - $task->percent_complete = 100; - } else { - $task->percent_complete = round(100 * $completed / ($remaining + $completed)); - } - $task->status = t2("one record updated, index is %percent% up-to-date", - "%count records updated, index is %percent% up-to-date", - $completed, array("percent" => $percent)); - } catch (Exception $e) { - $task->done = true; - $task->state = "error"; - $task->status = $e->getMessage(); - $task->log((string)$e); - } - } -} diff --git a/3.1/modules/iptc/lib/functions.php b/3.1/modules/iptc/lib/functions.php deleted file mode 100644 index 91ca129f..00000000 --- a/3.1/modules/iptc/lib/functions.php +++ /dev/null @@ -1,97 +0,0 @@ - 0xD7) { - $size = fread($file, 2); - if ($size === FALSE) { - fclose($file); - return $result; - } - $sizeOfSegment = unpack("nV", $size); - $data = fread($file, $sizeOfSegment['V']-2); - if ($data === FALSE) { - fclose($file); - return $result; - } - if ($result === FALSE) - unset($result); - $result[] = array("type" => $typeOfSegment, "data" => $data); // Multiple segments can have the same type like Exif and XMP - } - } while (!feof($file)); - fclose($file); - return $result; -} - - -function getIptcBlock($jpegHeader) -{ - for ($i = 0; $i < count($jpegHeader); $i++) { - if ($jpegHeader[$i]['type'] == 0xED) { - if (strncmp($jpegHeader[$i]['data'], "Photoshop 3.0\x00", 14) == 0) { - return $jpegHeader[$i]['data']; - } - } - } - return FALSE; -} - - -function getXmpDom($jpegHeader) -{ - for ($i = 0; $i < count($jpegHeader); $i++) { - if ($jpegHeader[$i]['type'] == 0xE1) { - if (strncmp($jpegHeader[$i]['data'], "http://ns.adobe.com/xap/1.0/\x00", 29) == 0) { - $xmlstr = substr($jpegHeader[$i]['data'], 29); - $doc = new DOMDocument(); - $doc->loadXML($xmlstr); - return $doc; - } - } - } - return FALSE; -} - - -function getXmpValue($dom, $xpathQuery) -{ - if ($dom === FALSE) - return null; - $xpath = new DOMXPath($dom); - $xpath->registerNamespace('rdf', "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); - $xpath->registerNamespace('photoshop', "http://ns.adobe.com/photoshop/1.0/"); - $xpath->registerNamespace('Iptc4xmpCore', "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"); - $xpath->registerNamespace('dc', "http://purl.org/dc/elements/1.1/"); - $xpath->registerNamespace('mediapro', "http://ns.iview-multimedia.com/mediapro/1.0/"); - $nodeList = $xpath->query($xpathQuery); - $result = ""; - foreach ($nodeList as $node) { - if (!empty($result)) - $result .= ';'; - $result .= $node->nodeValue; - } - return $result; -} - diff --git a/3.1/modules/iptc/module.info b/3.1/modules/iptc/module.info deleted file mode 100644 index 65060f87..00000000 --- a/3.1/modules/iptc/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Iptc Data" -description = "Extract Iptc data and display it on photo pages." -version = 2 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:iptc" -discuss_url = "http://gallery.menalto.com/forum_module_iptc" diff --git a/3.1/modules/iptc/views/admin_iptc.html.php b/3.1/modules/iptc/views/admin_iptc.html.php deleted file mode 100644 index 0fa74aaf..00000000 --- a/3.1/modules/iptc/views/admin_iptc.html.php +++ /dev/null @@ -1,7 +0,0 @@ - -
      -

      -
      - -
      -
      diff --git a/3.1/modules/iptc/views/iptc_block.html.php b/3.1/modules/iptc/views/iptc_block.html.php deleted file mode 100644 index c446935a..00000000 --- a/3.1/modules/iptc/views/iptc_block.html.php +++ /dev/null @@ -1,9 +0,0 @@ - - diff --git a/3.1/modules/itemchecksum/controllers/itemchecksum.php b/3.1/modules/itemchecksum/controllers/itemchecksum.php deleted file mode 100644 index 74b37869..00000000 --- a/3.1/modules/itemchecksum/controllers/itemchecksum.php +++ /dev/null @@ -1,89 +0,0 @@ -viewable() - ->where("parent_id", "=", $album_id) - ->where("type", "!=", "album") - ->find_all(); - - print count($item); - } - - public function md5($album_id, $file_name) { - // Locate an item with $file_name in the album $album_id - // and display it's md5 checksum. - $item = ORM::factory("item") - ->where("parent_id", "=", $album_id) - ->where("name", "=", $file_name) - ->find_all(); - - if (count($item) > 0) { - access::required("view_full", $item[0]); - - // If the KeepOriginal module is active, check for/use the - // original image instead of the gallery edited version. - if (module::is_active("keeporiginal")) { - $original_image = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item[0]->file_path()); - if ($item[0]->is_photo() && file_exists($original_image)) { - print md5_file($original_image); - } else { - print md5_file($item[0]->file_path()); - } - } else { - print md5_file($item[0]->file_path()); - } - } else { - print "0"; - } - } - - public function sha1($album_id, $file_name) { - // Locate an item with $file_name in the album $album_id - // and display it's sha-1 checksum. - - $item = ORM::factory("item") - ->where("parent_id", "=", $album_id) - ->where("name", "=", $file_name) - ->find_all(); - - if (count($item) > 0) { - access::required("view_full", $item[0]); - - // If the KeepOriginal module is active, check for/use the - // original image instead of the gallery edited version. - if (module::is_active("keeporiginal")) { - $original_image = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item[0]->file_path()); - if ($item[0]->is_photo() && file_exists($original_image)) { - print sha1_file($original_image); - } else { - print sha1_file($item[0]->file_path()); - } - } else { - print sha1_file($item[0]->file_path()); - } - } else { - print "0"; - } - } -} diff --git a/3.1/modules/itemchecksum/helpers/item_itemchecksums_rest.php b/3.1/modules/itemchecksum/helpers/item_itemchecksums_rest.php deleted file mode 100644 index c4699f6a..00000000 --- a/3.1/modules/itemchecksum/helpers/item_itemchecksums_rest.php +++ /dev/null @@ -1,42 +0,0 @@ -url); - access::required("view", $item); - - $checksums = array(rest::url("itemchecksum_md5", $item), rest::url("itemchecksum_sha1", $item)); - return array( - "url" => $request->url, - "members" => $checksums); - } - - static function resolve($id) { - $item = ORM::factory("item", $id); - if (!access::can("view", $item)) { - throw new Kohana_404_Exception(); - } - return $item; - } - - static function url($item) { - return url::abs_site("rest/item_checksums/{$item->id}"); - } -} diff --git a/3.1/modules/itemchecksum/helpers/itemchecksum_md5_rest.php b/3.1/modules/itemchecksum/helpers/itemchecksum_md5_rest.php deleted file mode 100644 index e896369c..00000000 --- a/3.1/modules/itemchecksum/helpers/itemchecksum_md5_rest.php +++ /dev/null @@ -1,55 +0,0 @@ -url); - access::required("view", $item); - $checksum = "0"; - // If the KeepOriginal module is active, check for/use the - // original image instead of the gallery edited version. - if (module::is_active("keeporiginal")) { - $original_image = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item->file_path()); - if ($item->is_photo() && file_exists($original_image)) { - $checksum = md5_file($original_image); - } else { - $checksum = md5_file($item->file_path()); - } - } else { - $checksum = md5_file($item->file_path()); - } - $data = array("checksum" => $checksum); - - return array( - "url" => $request->url, - "entity" => $data); - } - - static function resolve($id) { - $item = ORM::factory("item", $id); - if (!access::can("view", $item)) { - throw new Kohana_404_Exception(); - } - return $item; - } - - static function url($item) { - return url::abs_site("rest/itemchecksum_md5/{$item->id}"); - } -} diff --git a/3.1/modules/itemchecksum/helpers/itemchecksum_rest.php b/3.1/modules/itemchecksum/helpers/itemchecksum_rest.php deleted file mode 100644 index 236ef643..00000000 --- a/3.1/modules/itemchecksum/helpers/itemchecksum_rest.php +++ /dev/null @@ -1,41 +0,0 @@ - array( - "url" => rest::url("item_itemchecksums", $resource))); - } - } - - static function resolve($id) { - $item = ORM::factory("item", $id); - if (!access::can("view", $item)) { - throw new Kohana_404_Exception(); - } - return $item; - } - - static function url($item) { - return url::abs_site("rest/itemchecksum/{$item->id}"); - } -} diff --git a/3.1/modules/itemchecksum/helpers/itemchecksum_sha1_rest.php b/3.1/modules/itemchecksum/helpers/itemchecksum_sha1_rest.php deleted file mode 100644 index 847b637b..00000000 --- a/3.1/modules/itemchecksum/helpers/itemchecksum_sha1_rest.php +++ /dev/null @@ -1,55 +0,0 @@ -url); - access::required("view", $item); - $checksum = "0"; - // If the KeepOriginal module is active, check for/use the - // original image instead of the gallery edited version. - if (module::is_active("keeporiginal")) { - $original_image = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item->file_path()); - if ($item->is_photo() && file_exists($original_image)) { - $checksum = sha1_file($original_image); - } else { - $checksum = sha1_file($item->file_path()); - } - } else { - $checksum = sha1_file($item->file_path()); - } - $data = array("checksum" => $checksum); - - return array( - "url" => $request->url, - "entity" => $data); - } - - static function resolve($id) { - $item = ORM::factory("item", $id); - if (!access::can("view", $item)) { - throw new Kohana_404_Exception(); - } - return $item; - } - - static function url($item) { - return url::abs_site("rest/itemchecksum_sha1/{$item->id}"); - } -} diff --git a/3.1/modules/itemchecksum/module.info b/3.1/modules/itemchecksum/module.info deleted file mode 100644 index aa657bf9..00000000 --- a/3.1/modules/itemchecksum/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "ItemChecksum" -description = "Display's a photo or video's MD5 and SHA-1 checksum." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:itemchecksum" -discuss_url = "http://gallery.menalto.com/forum_module_itemchecksum" diff --git a/3.1/modules/jhead/helpers/jhead_event.php b/3.1/modules/jhead/helpers/jhead_event.php deleted file mode 100644 index b9d2f6f0..00000000 --- a/3.1/modules/jhead/helpers/jhead_event.php +++ /dev/null @@ -1,56 +0,0 @@ -is_photo()) { - return; - } - - // Locate jhead - if ( ! is_file($path = exec('which jhead'))) { - // @todo throw an exception ? - Kohana::log('error', 'jhead is not installed'); - } - $binary = str_replace('\\', '/', realpath(dirname($path))); - $binary .= '/jhead'; - $binary .= (PHP_SHLIB_SUFFIX === 'dll') ? '.exe' : ''; - - if ( ! is_file($binary)) { - // @todo throw an exception ? - Kohana::log('error', 'Unable to locate jhead binary'); - } - - // Invoke jhead - if ($error = exec(escapeshellcmd($binary).' -q -autorot '.$item->file_path())) { - // @todo throw an exception ? - Kohana::log('error', 'Error during execution of jhead'); - } - - // Update item - $image_info = getimagesize($item->file_path()); - $item->width = $image_info[0]; - $item->height = $image_info[1]; - $item->resize_dirty = 1; - $item->thumb_dirty = 1; - $item->save(); - graphics::generate($item); - } -} diff --git a/3.1/modules/jhead/module.info b/3.1/modules/jhead/module.info deleted file mode 100644 index ea0de472..00000000 --- a/3.1/modules/jhead/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "jhead Autorotation" -description = "Invoke jhead to rotate images according to Exif orientation tag." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:jhead" -discuss_url = "http://gallery.menalto.com/forum_module_jhead" diff --git a/3.1/modules/keeporiginal/controllers/keeporiginal.php b/3.1/modules/keeporiginal/controllers/keeporiginal.php deleted file mode 100644 index 36f6affe..00000000 --- a/3.1/modules/keeporiginal/controllers/keeporiginal.php +++ /dev/null @@ -1,72 +0,0 @@ -file_path()); - - // Make sure the current item is a photo and that an original exists. - if ($item->is_photo() && file_exists($original_image)) { - // Delete the modified version of the photo. - @unlink($item->file_path()); - - // Copy the original image back over, display an error message if the copy fails. - if (@rename($original_image, $item->file_path())) { - // Re-generate the items resize and thumbnail. - $item_data = model_cache::get("item", $id); - $item_data->resize_dirty= 1; - $item_data->thumb_dirty= 1; - $item_data->save(); - graphics::generate($item_data); - - // If the item is the thumbnail for the parent album, - // fix the parent's thumbnail as well. - $parent = $item_data->parent(); - if ($parent->album_cover_item_id == $item_data->id) { - copy($item_data->thumb_path(), $parent->thumb_path()); - $parent->thumb_width = $item_data->thumb_width; - $parent->thumb_height = $item_data->thumb_height; - $parent->save(); - } - - // Display a success message and redirect to the items page. - message::success(t("Your original image has been restored.")); - url::redirect($item->url()); - - } else { - // Display an error message if the copy failed. - message::error(t("Image restore failed!")); - url::redirect($item->url()); - } - } else { - // Display an error message if there is not an original photo. - message::error(t("Image restore failed!")); - url::redirect($item->url()); - } - } -} diff --git a/3.1/modules/keeporiginal/helpers/keeporiginal_event.php b/3.1/modules/keeporiginal/helpers/keeporiginal_event.php deleted file mode 100644 index 8febcb35..00000000 --- a/3.1/modules/keeporiginal/helpers/keeporiginal_event.php +++ /dev/null @@ -1,131 +0,0 @@ -is_photo()) { - $original_file = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item->file_path()); - if (file_exists($original_file)) { - @unlink($original_file); - } - } - - // When deleting an album, make sure its corresponding location in - // VARPATH/original/ is deleted as well, if it exists. - if ($item->is_album()) { - $original_file = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item->file_path()); - if (file_exists($original_file)) { - @dir::unlink($original_file); - } - } - } - - static function item_updated($old, $new) { - // When updating an item, check and see if the file name is being changed. - // If so, check for and modify any corresponding file/folder in - // VARPATH/original/ as well. - - if ($old->is_photo() || $old->is_album()) { - if ($old->file_path() != $new->file_path()) { - $old_original = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $old->file_path()); - $new_original = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $new->file_path()); - if (file_exists($old_original)) { - @rename($old_original, $new_original); - } - } - } - } - - static function item_moved($item, $old_parent) { - // When moving an item, check and see if a corresponding file exists - // in VARPATH/original/. If so, move that item to a similar directory - // in original as well. - - if ($item->is_photo() || $item->is_album()) { - $old_item_path = $old_parent->file_path() . "/" . $item->name; - if ($item->file_path() != $old_item_path) { - $old_original = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $old_item_path); - $new_original = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item->file_path()); - - if (file_exists($old_original)) { - - // Make sure the new folder exists, create it if it doesn't. - $individual_dirs = split("[/\]", "original/" . str_replace(VARPATH . "albums/", "", $item->file_path())); - $new_img_path = VARPATH; - for($i = 0; $i < count($individual_dirs)-1; $i++) { - $new_img_path = $new_img_path . "/" . $individual_dirs[$i]; - if(!file_exists($new_img_path)) { - @mkdir($new_img_path); - } - } - - // Move the file to its new location. - @rename($old_original, $new_original); - } - } - } - } - - static function site_menu($menu, $theme) { - // Create a menu option to restore the original photo. - if ($item = $theme->item()) { - if ((access::can("view", $item)) && (access::can("edit", $item))) { - $original_image = VARPATH . "original/" . str_replace(VARPATH . "albums/", "", $item->file_path()); - - if ($item->is_photo() && file_exists($original_image)) { - $menu->get("options_menu") - ->append(Menu::factory("link") - ->id("restore") - ->label(t("Restore original")) - ->css_id("g-keep-originals-link") - ->url(url::site("keeporiginal/restore/" . $item->id))); - } - } - } - } -} \ No newline at end of file diff --git a/3.1/modules/keeporiginal/helpers/keeporiginal_installer.php b/3.1/modules/keeporiginal/helpers/keeporiginal_installer.php deleted file mode 100644 index 16c38e89..00000000 --- a/3.1/modules/keeporiginal/helpers/keeporiginal_installer.php +++ /dev/null @@ -1,25 +0,0 @@ -content = new View("admin_language_flags.html"); - $view->content->preferences_form = $this->_get_admin_form(); - print $view; - } - - public function saveprefs() { - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Save Settings - module::set_var("language_flags", "flag_shape", Input::instance()->post("flag_shape")); - - // Load Admin page. - message::success(t("Your Selection Has Been Saved.")); - $view = new Admin_View("admin.html"); - $view->content = new View("admin_language_flags.html"); - $view->content->preferences_form = $this->_get_admin_form(); - print $view; - } - - private function _get_admin_form() { - // Make a new Form. - $form = new Forge("admin/language_flags/saveprefs", "", "post", - array("id" => "g-language-flags-adminForm")); - - // Figure out what type of flags to display. - $group_flag_types = $form->group("flag_types"); - $group_flag_types->dropdown('flag_shape') - ->label(t("Flag Shape:")) - ->options(array('rectangular'=>'Rectangular', 'round'=>'Round', 'square'=>'Square', 'custom'=>'Custom')) - ->selected(module::get_var("language_flags", "flag_shape")); - - // Add a save button to the form. - $form->submit("SavePrefs")->value(t("Save")); - - // Return the newly generated form. - return $form; - } -} \ No newline at end of file diff --git a/3.1/modules/language_flags/css/language_flags_sidebar.css b/3.1/modules/language_flags/css/language_flags_sidebar.css deleted file mode 100644 index 705dad2d..00000000 --- a/3.1/modules/language_flags/css/language_flags_sidebar.css +++ /dev/null @@ -1,20 +0,0 @@ -/* Flag container divs */ -#g-selected-language-flag, -#g-language-flag, -#g-default-language-flag { - display: inline; - margin: 2px; -} - -/* Flags with standard size */ -#g-language-flag img, -#g-default-language-flag img { - width: 40px; - margin: 5px; -} - -/* Flag grows when selected */ -#g-selected-language-flag img { - width: 48px; - margin: 1px; -} \ No newline at end of file diff --git a/3.1/modules/language_flags/helpers/language_flags_event.php b/3.1/modules/language_flags/helpers/language_flags_event.php deleted file mode 100644 index 5b0aa2e6..00000000 --- a/3.1/modules/language_flags/helpers/language_flags_event.php +++ /dev/null @@ -1,30 +0,0 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("language-flags") - ->label(t("Language flag settings")) - ->url(url::site("admin/language_flags"))); - } -} diff --git a/3.1/modules/language_flags/helpers/language_flags_installer.php b/3.1/modules/language_flags/helpers/language_flags_installer.php deleted file mode 100644 index 6fd98a1d..00000000 --- a/3.1/modules/language_flags/helpers/language_flags_installer.php +++ /dev/null @@ -1,31 +0,0 @@ -css("language_flags_sidebar.css"); - } -} diff --git a/3.1/modules/language_flags/images/rectangular/af_ZA.png b/3.1/modules/language_flags/images/rectangular/af_ZA.png deleted file mode 100644 index 81f6c12f..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/af_ZA.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/ar_SA.png b/3.1/modules/language_flags/images/rectangular/ar_SA.png deleted file mode 100644 index 2818f50b..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/ar_SA.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/be_BY.png b/3.1/modules/language_flags/images/rectangular/be_BY.png deleted file mode 100644 index 4c697344..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/be_BY.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/bg_BG.png b/3.1/modules/language_flags/images/rectangular/bg_BG.png deleted file mode 100644 index 46da4c6e..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/bg_BG.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/ca_ES.png b/3.1/modules/language_flags/images/rectangular/ca_ES.png deleted file mode 100644 index c7105790..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/ca_ES.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/da_DK.png b/3.1/modules/language_flags/images/rectangular/da_DK.png deleted file mode 100644 index df9599b3..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/da_DK.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/de_DE.png b/3.1/modules/language_flags/images/rectangular/de_DE.png deleted file mode 100644 index 34809532..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/de_DE.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/default.png b/3.1/modules/language_flags/images/rectangular/default.png deleted file mode 100644 index 7066d218..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/default.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/el_GR.png b/3.1/modules/language_flags/images/rectangular/el_GR.png deleted file mode 100644 index 01478071..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/el_GR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/en_GB.png b/3.1/modules/language_flags/images/rectangular/en_GB.png deleted file mode 100644 index 0b6ff8b0..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/en_GB.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/en_US.png b/3.1/modules/language_flags/images/rectangular/en_US.png deleted file mode 100644 index 5f7b1008..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/en_US.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/es_AR.png b/3.1/modules/language_flags/images/rectangular/es_AR.png deleted file mode 100644 index 15c99336..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/es_AR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/es_ES.png b/3.1/modules/language_flags/images/rectangular/es_ES.png deleted file mode 100644 index c7105790..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/es_ES.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/es_MX.png b/3.1/modules/language_flags/images/rectangular/es_MX.png deleted file mode 100644 index d84f5850..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/es_MX.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/eu_ES.png b/3.1/modules/language_flags/images/rectangular/eu_ES.png deleted file mode 100644 index c7105790..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/eu_ES.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/fa_IR.png b/3.1/modules/language_flags/images/rectangular/fa_IR.png deleted file mode 100644 index 1b1f5b41..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/fa_IR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/fi_FI.png b/3.1/modules/language_flags/images/rectangular/fi_FI.png deleted file mode 100644 index 0273d127..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/fi_FI.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/fr_FR.png b/3.1/modules/language_flags/images/rectangular/fr_FR.png deleted file mode 100644 index ba9d89c9..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/fr_FR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/ga_IE.png b/3.1/modules/language_flags/images/rectangular/ga_IE.png deleted file mode 100644 index 2ce7a539..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/ga_IE.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/he_IL.png b/3.1/modules/language_flags/images/rectangular/he_IL.png deleted file mode 100644 index cf23aaee..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/he_IL.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/hu_HU.png b/3.1/modules/language_flags/images/rectangular/hu_HU.png deleted file mode 100644 index 4550be18..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/hu_HU.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/is_IS.png b/3.1/modules/language_flags/images/rectangular/is_IS.png deleted file mode 100644 index 20e1f8ed..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/is_IS.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/it_IT.png b/3.1/modules/language_flags/images/rectangular/it_IT.png deleted file mode 100644 index 442d628d..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/it_IT.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/ja_JP.png b/3.1/modules/language_flags/images/rectangular/ja_JP.png deleted file mode 100644 index 5c38e938..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/ja_JP.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/ko_KR.png b/3.1/modules/language_flags/images/rectangular/ko_KR.png deleted file mode 100644 index f3872b2e..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/ko_KR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/lt_LT.png b/3.1/modules/language_flags/images/rectangular/lt_LT.png deleted file mode 100644 index e4ffc3d0..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/lt_LT.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/lv_LV.png b/3.1/modules/language_flags/images/rectangular/lv_LV.png deleted file mode 100644 index 7f48f0b5..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/lv_LV.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/nl_NL.png b/3.1/modules/language_flags/images/rectangular/nl_NL.png deleted file mode 100644 index e38bde91..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/nl_NL.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/no_NO.png b/3.1/modules/language_flags/images/rectangular/no_NO.png deleted file mode 100644 index 154d3a0b..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/no_NO.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/pl_PL.png b/3.1/modules/language_flags/images/rectangular/pl_PL.png deleted file mode 100644 index e7a49991..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/pl_PL.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/pt_BR.png b/3.1/modules/language_flags/images/rectangular/pt_BR.png deleted file mode 100644 index 46ff4fa0..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/pt_BR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/pt_PT.png b/3.1/modules/language_flags/images/rectangular/pt_PT.png deleted file mode 100644 index ce9cd682..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/pt_PT.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/ro_RO.png b/3.1/modules/language_flags/images/rectangular/ro_RO.png deleted file mode 100644 index bbb17aa9..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/ro_RO.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/ru_RU.png b/3.1/modules/language_flags/images/rectangular/ru_RU.png deleted file mode 100644 index b98b1066..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/ru_RU.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/sk_SK.png b/3.1/modules/language_flags/images/rectangular/sk_SK.png deleted file mode 100644 index af09cf00..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/sk_SK.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/sl_SI.png b/3.1/modules/language_flags/images/rectangular/sl_SI.png deleted file mode 100644 index cb326fcc..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/sl_SI.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/sr_CS.png b/3.1/modules/language_flags/images/rectangular/sr_CS.png deleted file mode 100644 index b369fa5a..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/sr_CS.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/sv_SE.png b/3.1/modules/language_flags/images/rectangular/sv_SE.png deleted file mode 100644 index 3c216703..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/sv_SE.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/tr_TR.png b/3.1/modules/language_flags/images/rectangular/tr_TR.png deleted file mode 100644 index a889a7b0..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/tr_TR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/uk_UA.png b/3.1/modules/language_flags/images/rectangular/uk_UA.png deleted file mode 100644 index 2ddf06e5..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/uk_UA.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/vi_VN.png b/3.1/modules/language_flags/images/rectangular/vi_VN.png deleted file mode 100644 index 4033f79a..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/vi_VN.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/zh_CN.png b/3.1/modules/language_flags/images/rectangular/zh_CN.png deleted file mode 100644 index 4d54de17..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/zh_CN.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/rectangular/zh_TW.png b/3.1/modules/language_flags/images/rectangular/zh_TW.png deleted file mode 100644 index 4d54de17..00000000 Binary files a/3.1/modules/language_flags/images/rectangular/zh_TW.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/af_ZA.png b/3.1/modules/language_flags/images/round/af_ZA.png deleted file mode 100644 index b02bd971..00000000 Binary files a/3.1/modules/language_flags/images/round/af_ZA.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/ar_SA.png b/3.1/modules/language_flags/images/round/ar_SA.png deleted file mode 100644 index 7bc7fea3..00000000 Binary files a/3.1/modules/language_flags/images/round/ar_SA.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/be_BY.png b/3.1/modules/language_flags/images/round/be_BY.png deleted file mode 100644 index f7af6bce..00000000 Binary files a/3.1/modules/language_flags/images/round/be_BY.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/bg_BG.png b/3.1/modules/language_flags/images/round/bg_BG.png deleted file mode 100644 index 5a3f7026..00000000 Binary files a/3.1/modules/language_flags/images/round/bg_BG.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/ca_ES.png b/3.1/modules/language_flags/images/round/ca_ES.png deleted file mode 100644 index 2f363c35..00000000 Binary files a/3.1/modules/language_flags/images/round/ca_ES.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/cs_CZ.png b/3.1/modules/language_flags/images/round/cs_CZ.png deleted file mode 100644 index 3aecdfb1..00000000 Binary files a/3.1/modules/language_flags/images/round/cs_CZ.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/da_DK.png b/3.1/modules/language_flags/images/round/da_DK.png deleted file mode 100644 index 9db72bf8..00000000 Binary files a/3.1/modules/language_flags/images/round/da_DK.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/de_DE.png b/3.1/modules/language_flags/images/round/de_DE.png deleted file mode 100644 index c84c5e6a..00000000 Binary files a/3.1/modules/language_flags/images/round/de_DE.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/default.png b/3.1/modules/language_flags/images/round/default.png deleted file mode 100644 index 6295dc09..00000000 Binary files a/3.1/modules/language_flags/images/round/default.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/el_GR.png b/3.1/modules/language_flags/images/round/el_GR.png deleted file mode 100644 index a61583f1..00000000 Binary files a/3.1/modules/language_flags/images/round/el_GR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/en_GB.png b/3.1/modules/language_flags/images/round/en_GB.png deleted file mode 100644 index 79892db4..00000000 Binary files a/3.1/modules/language_flags/images/round/en_GB.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/en_US.png b/3.1/modules/language_flags/images/round/en_US.png deleted file mode 100644 index a8cd9038..00000000 Binary files a/3.1/modules/language_flags/images/round/en_US.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/es_AR.png b/3.1/modules/language_flags/images/round/es_AR.png deleted file mode 100644 index 5fba369a..00000000 Binary files a/3.1/modules/language_flags/images/round/es_AR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/es_ES.png b/3.1/modules/language_flags/images/round/es_ES.png deleted file mode 100644 index 2f363c35..00000000 Binary files a/3.1/modules/language_flags/images/round/es_ES.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/es_MX.png b/3.1/modules/language_flags/images/round/es_MX.png deleted file mode 100644 index 250fc627..00000000 Binary files a/3.1/modules/language_flags/images/round/es_MX.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/et_EE.png b/3.1/modules/language_flags/images/round/et_EE.png deleted file mode 100644 index 1e3f12bb..00000000 Binary files a/3.1/modules/language_flags/images/round/et_EE.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/fa_IR.png b/3.1/modules/language_flags/images/round/fa_IR.png deleted file mode 100644 index 19f44c4f..00000000 Binary files a/3.1/modules/language_flags/images/round/fa_IR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/faroe.png b/3.1/modules/language_flags/images/round/faroe.png deleted file mode 100644 index b509bc32..00000000 Binary files a/3.1/modules/language_flags/images/round/faroe.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/fi_FI.png b/3.1/modules/language_flags/images/round/fi_FI.png deleted file mode 100644 index f33982dd..00000000 Binary files a/3.1/modules/language_flags/images/round/fi_FI.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/fr_FR.png b/3.1/modules/language_flags/images/round/fr_FR.png deleted file mode 100644 index c1989222..00000000 Binary files a/3.1/modules/language_flags/images/round/fr_FR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/ga_IE.png b/3.1/modules/language_flags/images/round/ga_IE.png deleted file mode 100644 index ca001997..00000000 Binary files a/3.1/modules/language_flags/images/round/ga_IE.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/he_IL.png b/3.1/modules/language_flags/images/round/he_IL.png deleted file mode 100644 index e50c0fb6..00000000 Binary files a/3.1/modules/language_flags/images/round/he_IL.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/hu_HU.png b/3.1/modules/language_flags/images/round/hu_HU.png deleted file mode 100644 index bc298c4d..00000000 Binary files a/3.1/modules/language_flags/images/round/hu_HU.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/is_IS.png b/3.1/modules/language_flags/images/round/is_IS.png deleted file mode 100644 index d63666a0..00000000 Binary files a/3.1/modules/language_flags/images/round/is_IS.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/it_IT.png b/3.1/modules/language_flags/images/round/it_IT.png deleted file mode 100644 index 45d11e01..00000000 Binary files a/3.1/modules/language_flags/images/round/it_IT.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/ja_JP.png b/3.1/modules/language_flags/images/round/ja_JP.png deleted file mode 100644 index 4dfa7f68..00000000 Binary files a/3.1/modules/language_flags/images/round/ja_JP.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/ko_KR.png b/3.1/modules/language_flags/images/round/ko_KR.png deleted file mode 100644 index 8eb35813..00000000 Binary files a/3.1/modules/language_flags/images/round/ko_KR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/lt_LT.png b/3.1/modules/language_flags/images/round/lt_LT.png deleted file mode 100644 index 0ea2239b..00000000 Binary files a/3.1/modules/language_flags/images/round/lt_LT.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/lv_LV.png b/3.1/modules/language_flags/images/round/lv_LV.png deleted file mode 100644 index 64a53135..00000000 Binary files a/3.1/modules/language_flags/images/round/lv_LV.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/nl_NL.png b/3.1/modules/language_flags/images/round/nl_NL.png deleted file mode 100644 index e2b5d5e0..00000000 Binary files a/3.1/modules/language_flags/images/round/nl_NL.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/no_NO.png b/3.1/modules/language_flags/images/round/no_NO.png deleted file mode 100644 index 5c7f8034..00000000 Binary files a/3.1/modules/language_flags/images/round/no_NO.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/pl_PL.png b/3.1/modules/language_flags/images/round/pl_PL.png deleted file mode 100644 index 02cf15fd..00000000 Binary files a/3.1/modules/language_flags/images/round/pl_PL.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/pt_BR.png b/3.1/modules/language_flags/images/round/pt_BR.png deleted file mode 100644 index 4084fc33..00000000 Binary files a/3.1/modules/language_flags/images/round/pt_BR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/pt_PT.png b/3.1/modules/language_flags/images/round/pt_PT.png deleted file mode 100644 index 5b2a15d9..00000000 Binary files a/3.1/modules/language_flags/images/round/pt_PT.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/ro_RO.png b/3.1/modules/language_flags/images/round/ro_RO.png deleted file mode 100644 index 8ab45d66..00000000 Binary files a/3.1/modules/language_flags/images/round/ro_RO.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/ru_RU.png b/3.1/modules/language_flags/images/round/ru_RU.png deleted file mode 100644 index a352a3d3..00000000 Binary files a/3.1/modules/language_flags/images/round/ru_RU.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/sk_SK.png b/3.1/modules/language_flags/images/round/sk_SK.png deleted file mode 100644 index 04e2cee7..00000000 Binary files a/3.1/modules/language_flags/images/round/sk_SK.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/sl_SI.png b/3.1/modules/language_flags/images/round/sl_SI.png deleted file mode 100644 index 04e2cee7..00000000 Binary files a/3.1/modules/language_flags/images/round/sl_SI.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/sr_CS.png b/3.1/modules/language_flags/images/round/sr_CS.png deleted file mode 100644 index 80d13304..00000000 Binary files a/3.1/modules/language_flags/images/round/sr_CS.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/sv_SE.png b/3.1/modules/language_flags/images/round/sv_SE.png deleted file mode 100644 index e39a0380..00000000 Binary files a/3.1/modules/language_flags/images/round/sv_SE.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/tr_TR.png b/3.1/modules/language_flags/images/round/tr_TR.png deleted file mode 100644 index 39d6acde..00000000 Binary files a/3.1/modules/language_flags/images/round/tr_TR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/uk_UA.png b/3.1/modules/language_flags/images/round/uk_UA.png deleted file mode 100644 index 8febdccf..00000000 Binary files a/3.1/modules/language_flags/images/round/uk_UA.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/vi_VN.png b/3.1/modules/language_flags/images/round/vi_VN.png deleted file mode 100644 index c73f50da..00000000 Binary files a/3.1/modules/language_flags/images/round/vi_VN.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/zh_CN.png b/3.1/modules/language_flags/images/round/zh_CN.png deleted file mode 100644 index 105611bd..00000000 Binary files a/3.1/modules/language_flags/images/round/zh_CN.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/round/zh_TW.png b/3.1/modules/language_flags/images/round/zh_TW.png deleted file mode 100644 index 105611bd..00000000 Binary files a/3.1/modules/language_flags/images/round/zh_TW.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/af_ZA.png b/3.1/modules/language_flags/images/square/af_ZA.png deleted file mode 100644 index 33fff8ff..00000000 Binary files a/3.1/modules/language_flags/images/square/af_ZA.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/ar_SA.png b/3.1/modules/language_flags/images/square/ar_SA.png deleted file mode 100644 index c9794774..00000000 Binary files a/3.1/modules/language_flags/images/square/ar_SA.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/be_BG.png b/3.1/modules/language_flags/images/square/be_BG.png deleted file mode 100644 index e4fa699b..00000000 Binary files a/3.1/modules/language_flags/images/square/be_BG.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/be_BY.png b/3.1/modules/language_flags/images/square/be_BY.png deleted file mode 100644 index aaa8c7e1..00000000 Binary files a/3.1/modules/language_flags/images/square/be_BY.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/ca_CZ.png b/3.1/modules/language_flags/images/square/ca_CZ.png deleted file mode 100644 index 5ce1d124..00000000 Binary files a/3.1/modules/language_flags/images/square/ca_CZ.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/ca_ES.png b/3.1/modules/language_flags/images/square/ca_ES.png deleted file mode 100644 index 4b36885e..00000000 Binary files a/3.1/modules/language_flags/images/square/ca_ES.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/cs_CZ.png b/3.1/modules/language_flags/images/square/cs_CZ.png deleted file mode 100644 index ac171c8b..00000000 Binary files a/3.1/modules/language_flags/images/square/cs_CZ.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/da_DK.png b/3.1/modules/language_flags/images/square/da_DK.png deleted file mode 100644 index 2774386d..00000000 Binary files a/3.1/modules/language_flags/images/square/da_DK.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/de_DE.png b/3.1/modules/language_flags/images/square/de_DE.png deleted file mode 100644 index 15717610..00000000 Binary files a/3.1/modules/language_flags/images/square/de_DE.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/default.png b/3.1/modules/language_flags/images/square/default.png deleted file mode 100644 index 35943a56..00000000 Binary files a/3.1/modules/language_flags/images/square/default.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/el_GR.png b/3.1/modules/language_flags/images/square/el_GR.png deleted file mode 100644 index 595c680c..00000000 Binary files a/3.1/modules/language_flags/images/square/el_GR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/en_GB.png b/3.1/modules/language_flags/images/square/en_GB.png deleted file mode 100644 index d7933cc9..00000000 Binary files a/3.1/modules/language_flags/images/square/en_GB.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/es_AR.png b/3.1/modules/language_flags/images/square/es_AR.png deleted file mode 100644 index 9d42b35b..00000000 Binary files a/3.1/modules/language_flags/images/square/es_AR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/es_ES.png b/3.1/modules/language_flags/images/square/es_ES.png deleted file mode 100644 index 4b36885e..00000000 Binary files a/3.1/modules/language_flags/images/square/es_ES.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/et_EE.png b/3.1/modules/language_flags/images/square/et_EE.png deleted file mode 100644 index 466e9632..00000000 Binary files a/3.1/modules/language_flags/images/square/et_EE.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/eu_ES.png b/3.1/modules/language_flags/images/square/eu_ES.png deleted file mode 100644 index 4b36885e..00000000 Binary files a/3.1/modules/language_flags/images/square/eu_ES.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/fa_IR.png b/3.1/modules/language_flags/images/square/fa_IR.png deleted file mode 100644 index 37334f83..00000000 Binary files a/3.1/modules/language_flags/images/square/fa_IR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/fi_FI.png b/3.1/modules/language_flags/images/square/fi_FI.png deleted file mode 100644 index 6bf9b92b..00000000 Binary files a/3.1/modules/language_flags/images/square/fi_FI.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/fr_FR.png b/3.1/modules/language_flags/images/square/fr_FR.png deleted file mode 100644 index d20ab1d6..00000000 Binary files a/3.1/modules/language_flags/images/square/fr_FR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/ga_IE.png b/3.1/modules/language_flags/images/square/ga_IE.png deleted file mode 100644 index a0deaf0c..00000000 Binary files a/3.1/modules/language_flags/images/square/ga_IE.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/he_IL.png b/3.1/modules/language_flags/images/square/he_IL.png deleted file mode 100644 index 226c5195..00000000 Binary files a/3.1/modules/language_flags/images/square/he_IL.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/hu_HU.png b/3.1/modules/language_flags/images/square/hu_HU.png deleted file mode 100644 index 860e82cc..00000000 Binary files a/3.1/modules/language_flags/images/square/hu_HU.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/is_IS.png b/3.1/modules/language_flags/images/square/is_IS.png deleted file mode 100644 index bd8d9952..00000000 Binary files a/3.1/modules/language_flags/images/square/is_IS.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/it_IT.png b/3.1/modules/language_flags/images/square/it_IT.png deleted file mode 100644 index d52c6291..00000000 Binary files a/3.1/modules/language_flags/images/square/it_IT.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/ja_JP.png b/3.1/modules/language_flags/images/square/ja_JP.png deleted file mode 100644 index ec62c2a7..00000000 Binary files a/3.1/modules/language_flags/images/square/ja_JP.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/ko_KR.png b/3.1/modules/language_flags/images/square/ko_KR.png deleted file mode 100644 index a2e607d1..00000000 Binary files a/3.1/modules/language_flags/images/square/ko_KR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/lt_LT.png b/3.1/modules/language_flags/images/square/lt_LT.png deleted file mode 100644 index e4f2d280..00000000 Binary files a/3.1/modules/language_flags/images/square/lt_LT.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/lv_LV.png b/3.1/modules/language_flags/images/square/lv_LV.png deleted file mode 100644 index f44fe38a..00000000 Binary files a/3.1/modules/language_flags/images/square/lv_LV.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/nl_NL.png b/3.1/modules/language_flags/images/square/nl_NL.png deleted file mode 100644 index 43cd3dc1..00000000 Binary files a/3.1/modules/language_flags/images/square/nl_NL.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/no_NO.png b/3.1/modules/language_flags/images/square/no_NO.png deleted file mode 100644 index c9453e0b..00000000 Binary files a/3.1/modules/language_flags/images/square/no_NO.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/pl_PL.png b/3.1/modules/language_flags/images/square/pl_PL.png deleted file mode 100644 index 5da0b07c..00000000 Binary files a/3.1/modules/language_flags/images/square/pl_PL.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/pt_BR.png b/3.1/modules/language_flags/images/square/pt_BR.png deleted file mode 100644 index 651cb122..00000000 Binary files a/3.1/modules/language_flags/images/square/pt_BR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/pt_PT.png b/3.1/modules/language_flags/images/square/pt_PT.png deleted file mode 100644 index 59ff8a0b..00000000 Binary files a/3.1/modules/language_flags/images/square/pt_PT.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/ro_RO.png b/3.1/modules/language_flags/images/square/ro_RO.png deleted file mode 100644 index b79dbdee..00000000 Binary files a/3.1/modules/language_flags/images/square/ro_RO.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/ru_RU.png b/3.1/modules/language_flags/images/square/ru_RU.png deleted file mode 100644 index 70c1b814..00000000 Binary files a/3.1/modules/language_flags/images/square/ru_RU.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/sk_SK.png b/3.1/modules/language_flags/images/square/sk_SK.png deleted file mode 100644 index 78c56a4c..00000000 Binary files a/3.1/modules/language_flags/images/square/sk_SK.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/sl_SI.png b/3.1/modules/language_flags/images/square/sl_SI.png deleted file mode 100644 index 36b3ed50..00000000 Binary files a/3.1/modules/language_flags/images/square/sl_SI.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/sr_CS.png b/3.1/modules/language_flags/images/square/sr_CS.png deleted file mode 100644 index 187591dd..00000000 Binary files a/3.1/modules/language_flags/images/square/sr_CS.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/sv_SE.png b/3.1/modules/language_flags/images/square/sv_SE.png deleted file mode 100644 index 24bf4372..00000000 Binary files a/3.1/modules/language_flags/images/square/sv_SE.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/tr_TR.png b/3.1/modules/language_flags/images/square/tr_TR.png deleted file mode 100644 index 0b6232ae..00000000 Binary files a/3.1/modules/language_flags/images/square/tr_TR.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/uk_UA.png b/3.1/modules/language_flags/images/square/uk_UA.png deleted file mode 100644 index 53afc4df..00000000 Binary files a/3.1/modules/language_flags/images/square/uk_UA.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/vi_VN.png b/3.1/modules/language_flags/images/square/vi_VN.png deleted file mode 100644 index 49fd1766..00000000 Binary files a/3.1/modules/language_flags/images/square/vi_VN.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/zh_CN.png b/3.1/modules/language_flags/images/square/zh_CN.png deleted file mode 100644 index 63fba8b6..00000000 Binary files a/3.1/modules/language_flags/images/square/zh_CN.png and /dev/null differ diff --git a/3.1/modules/language_flags/images/square/zh_TW.png b/3.1/modules/language_flags/images/square/zh_TW.png deleted file mode 100644 index 63fba8b6..00000000 Binary files a/3.1/modules/language_flags/images/square/zh_TW.png and /dev/null differ diff --git a/3.1/modules/language_flags/module.info b/3.1/modules/language_flags/module.info deleted file mode 100644 index 56fa94ab..00000000 --- a/3.1/modules/language_flags/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Language Flags" -description = "Replaces the language selection drop-down box with clickable flags." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:language_flags" -discuss_url = "http://gallery.menalto.com/forum_module_language_flags" diff --git a/3.1/modules/language_flags/views/admin_language_flags.html.php b/3.1/modules/language_flags/views/admin_language_flags.html.php deleted file mode 100644 index f5bf04c5..00000000 --- a/3.1/modules/language_flags/views/admin_language_flags.html.php +++ /dev/null @@ -1,5 +0,0 @@ - -
      -

      - -
      diff --git a/3.1/modules/language_flags/views/user_languages_block.html.php b/3.1/modules/language_flags/views/user_languages_block.html.php deleted file mode 100644 index a7fe26d9..00000000 --- a/3.1/modules/language_flags/views/user_languages_block.html.php +++ /dev/null @@ -1,57 +0,0 @@ - -" . - "\""
      "; - } - next($installed_locales); - } -?> - diff --git a/3.1/modules/latestalbums/helpers/latestalbums_rss.php b/3.1/modules/latestalbums/helpers/latestalbums_rss.php deleted file mode 100644 index aa34088c..00000000 --- a/3.1/modules/latestalbums/helpers/latestalbums_rss.php +++ /dev/null @@ -1,48 +0,0 @@ -items = ORM::factory("item") - ->viewable() - ->where("type", "=", "album") - ->order_by("created", "DESC") - ->find_all($limit, $offset); - - $all_items = ORM::factory("item") - ->viewable() - ->where("type", "=", "album") - ->order_by("created", "DESC"); - - $feed->max_pages = ceil($all_items->find_all()->count() / $limit); - $feed->title = t("Latest albums"); - $feed->description = t("Most recently created albums"); - return $feed; - } - } -} diff --git a/3.1/modules/latestalbums/module.info b/3.1/modules/latestalbums/module.info deleted file mode 100644 index 9c78cc31..00000000 --- a/3.1/modules/latestalbums/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Latest Albums" -description = "Display recently created albums." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:latestalbums" -discuss_url = "http://gallery.menalto.com/forum_module_latestalbums" diff --git a/3.1/modules/latestupdates/controllers/latestupdates.php b/3.1/modules/latestupdates/controllers/latestupdates.php deleted file mode 100644 index 491dee22..00000000 --- a/3.1/modules/latestupdates/controllers/latestupdates.php +++ /dev/null @@ -1,144 +0,0 @@ -get("page", 1); - if ($page < 1) { - url::redirect("latestupdates/albums/{$item->id}"); - } - - // First item to display. - $offset = ($page - 1) * $page_size; - - $item = ORM::factory("item", $id); - - // Determine the total number of items, - // for page numbering purposes. - $count = $item - ->viewable() - ->where("type", "!=", "album") - ->order_by("created", "DESC") - ->descendants_count(); - - // Figure out what the highest page number is. - $max_pages = ceil($count / $page_size); - - // Don't let the visitor go past the last page. - if ($max_pages && $page > $max_pages) { - url::redirect("latestupdates/albums/{$item->id}?page=$max_pages"); - } - - // Figure out which items to display on this page. - $children = $item - ->viewable() - ->where("type", "!=", "album") - ->order_by("created", "DESC") - ->descendants($page_size, $offset); - - // Set up the previous and next page buttons. - if ($page > 1) { - $previous_page = $page - 1; - $view->previous_page_link = url::site("latestupdates/albums/{$item->id}?page={$previous_page}"); - } - if ($page < $max_pages) { - $next_page = $page + 1; - $view->next_page_link = url::site("latestupdates/albums/{$item->id}?page={$next_page}"); - } - - // 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("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("dynamic.html"); - $template->content->title = t("Latest Updates"); - print $template; - } - - public function updates() { - // Figure out how many items to display on each page. - $page_size = 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) { - url::redirect("latestupdates/updates"); - } - - // First item to display. - $offset = ($page - 1) * $page_size; - - // Determine the total number of items, - // for page numbering purposes. - $count = ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->find_all() - ->count(); - - // Figure out what the highest page number is. - $max_pages = ceil($count / $page_size); - - // Don't let the visitor go past the last page. - if ($max_pages && $page > $max_pages) { - url::redirect("latestupdates/updates?page=$max_pages"); - } - - // Figure out which items to display on this page. - $items = ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->order_by("created", "DESC") - ->find_all($page_size, $offset); - - // Set up the previous and next page buttons. - if ($page > 1) { - $previous_page = $page - 1; - $view->previous_page_link = url::site("latestupdates/updates?page={$previous_page}"); - } - if ($page < $max_pages) { - $next_page = $page + 1; - $view->next_page_link = url::site("latestupdates/updates?page={$next_page}"); - } - - // 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("page_size", $page_size); - $template->set_global("max_pages", $max_pages); - $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; - } - -} \ No newline at end of file diff --git a/3.1/modules/latestupdates/helpers/latestupdates_block.php b/3.1/modules/latestupdates/helpers/latestupdates_block.php deleted file mode 100644 index 4af70f06..00000000 --- a/3.1/modules/latestupdates/helpers/latestupdates_block.php +++ /dev/null @@ -1,53 +0,0 @@ - t("Latest Updates")); - } - - static function get($block_id, $theme) { - $block = ""; - - - switch ($block_id) { - case "latestupdates": - - // 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"); - - if (!$theme->item()) { - $block->content->update_links = array( - "Entire Gallery" => url::site("latestupdates/updates")); - } else { - // Determine the ID# of the current album. - $albumID = $theme->item->is_album() ? $theme->item->id : $theme->item->parent_id; - $block->content->update_links = array( - "Entire Gallery" => url::site("latestupdates/updates"), - "This Album" => url::site("latestupdates/albums/$albumID") - ); - } - break; - } - return $block; - } -} diff --git a/3.1/modules/latestupdates/module.info b/3.1/modules/latestupdates/module.info deleted file mode 100644 index a4916cd6..00000000 --- a/3.1/modules/latestupdates/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "LatestUpdates" -description = "Display recently uploaded photos and videos." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:latestupdates" -discuss_url = "http://gallery.menalto.com/forum_module_latestupdates" diff --git a/3.1/modules/latestupdates/views/latestupdates_block.html.php b/3.1/modules/latestupdates/views/latestupdates_block.html.php deleted file mode 100644 index b1dd9074..00000000 --- a/3.1/modules/latestupdates/views/latestupdates_block.html.php +++ /dev/null @@ -1,10 +0,0 @@ - -
        - $url): ?> -
      • - - - -
      • - -
      diff --git a/3.1/modules/ldap/config/gallery_sample.ldif b/3.1/modules/ldap/config/gallery_sample.ldif deleted file mode 100644 index bc52d08a..00000000 --- a/3.1/modules/ldap/config/gallery_sample.ldif +++ /dev/null @@ -1,74 +0,0 @@ -dn: ou=people,dc=gallery,dc=local -objectClass: organizationalUnit -ou: people - -dn: ou=groups,dc=gallery,dc=local -objectClass: organizationalUnit -ou: groups - -dn: ou=systems,dc=gallery,dc=local -objectClass: organizationalUnit -ou: systems - -dn: uid=jdoe,ou=people,dc=gallery,dc=local -objectClass: inetOrgPerson -objectClass: posixAccount -uid: jdoe -sn: Doe -givenname: John -cn: John Doe -userpassword: {SSHA}76qIsKTflGM6dj0f5c5olnD9ltKKXAFE -displayName: John Doe -homeDirectory: /home/jdoe -uidnumber: 1000 -gidnumber: 10000 -mail: jdoe@gallery.local - -dn: uid=hwallbanger,ou=people,dc=gallery,dc=local -objectClass: inetOrgPerson -objectClass: posixAccount -uid: hwallbanger -sn: Wallbanger -givenname: Harvey -cn: Harvey Wallbanger -userpassword: {SSHA}084H+FFr6s/anIoaIhI+O8OaH2u0MIBL -displayName: Harvey Wallbanger -homeDirectory: /home/hwallbanger -uidnumber: 1001 -gidnumber: 10001 -mail: hwallbanger@gallery.local - -dn: uid=rnail,ou=people,dc=gallery,dc=local -objectClass: inetOrgPerson -objectClass: posixAccount -uid: rnail -sn: Nail -givenname: Rusty -cn: Rusty Nail -userpassword: {SSHA}wXVdpfbP6n9LwoLxrB+NvY2oDN1j/M2z -displayName: Rusty Nail -homeDirectory: /home/rnail -uidnumber: 1002 -gidnumber: 10001 -mail: rnail@gallery.local - -dn: cn=admins,ou=groups,dc=gallery,dc=local -objectclass: posixGroup -cn: admins -gidnumber: 10000 -memberuid: jdoe - -dn: cn=users,ou=groups,dc=gallery,dc=local -objectclass: posixGroup -cn: users -gidnumber: 10001 -memberuid: jdoe -memberuid: hwallbanger -memberuid: rnail - -dn: cn=guest,ou=groups,dc=gallery,dc=local -objectclass: posixGroup -cn: guest -gidnumber: 10002 - - diff --git a/3.1/modules/ldap/config/identity.php b/3.1/modules/ldap/config/identity.php deleted file mode 100644 index 8c4136b2..00000000 --- a/3.1/modules/ldap/config/identity.php +++ /dev/null @@ -1,47 +0,0 @@ - "ldap", - "allow_updates" => false, - "params" => array( - "groups" => array("engineering", "everybody", "guest"), - "everybody_group" => "guest", - "registered_users_group" => "everybody", - "admins" => array("alice", "bob"), - "url" => "ldaps://ldap.mycompany.com/", - "group_domain" => "ou=Posix,ou=Groups,dc=ymcompany,dc=com", - "user_domain" => "ou=People,dc=MyCompany,dc=com", - "bind_rdn" => null, - "bind_password" => null, - ) -); diff --git a/3.1/modules/ldap/helpers/ldap_installer.php b/3.1/modules/ldap/helpers/ldap_installer.php deleted file mode 100644 index d9bdbfd4..00000000 --- a/3.1/modules/ldap/helpers/ldap_installer.php +++ /dev/null @@ -1,53 +0,0 @@ -groups() as $group) { - module::event("group_deleted", $group); - } - } - - static function initialize() { - module::set_version("ldap", 1); - $root = item::root(); - foreach (IdentityProvider::instance()->groups() as $group) { - module::event("group_created", $group); - access::allow($group, "view", $root); - access::allow($group, "view_full", $root); - } - } -} \ No newline at end of file diff --git a/3.1/modules/ldap/libraries/drivers/IdentityProvider/Ldap.php b/3.1/modules/ldap/libraries/drivers/IdentityProvider/Ldap.php deleted file mode 100644 index 93b540e6..00000000 --- a/3.1/modules/ldap/libraries/drivers/IdentityProvider/Ldap.php +++ /dev/null @@ -1,292 +0,0 @@ -id = 0; - self::$_guest_user->name = "Guest"; - self::$_guest_user->full_name = "Guest"; - self::$_guest_user->guest = true; - self::$_guest_user->admin = false; - self::$_guest_user->locale = null; - self::$_guest_user->email = null; - self::$_guest_user->groups = array($this->everybody()); - } - return self::$_guest_user; - } - - /** - * @see IdentityProvider_Driver::admin_user. - */ - public function admin_user() { - return self::lookup_user_by_name(self::$_params["admins"][0]); - } - - /** - * @see IdentityProvider_Driver::create_user. - */ - public function create_user($name, $full_name, $password, $email) { - throw new Exception("@todo INVALID OPERATION"); - } - - /** - * @see IdentityProvider_Driver::is_correct_password. - */ - public function is_correct_password($user, $password) { - $connection = ldap_connect(self::$_params["url"]); - ldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION, 3); - $lbind = @ldap_bind($connection, $user->dn, $password); - ldap_unbind($connection); - - return ($lbind) ? true : false; - } - - /** - * @see IdentityProvider_Driver::lookup_user. - */ - public function lookup_user($id) { - if ($id == 0) { - return $this->guest(); - } - $result = ldap_search(self::$_connection, self::$_params["user_domain"], "uidNumber=$id"); - $entries = ldap_get_entries(self::$_connection, $result); - if ($entries["count"] > 0) { - return new Ldap_User($entries[0]); - } - return null; - } - - /** - * @see IdentityProvider_Driver::lookup_user_by_name. - * - * Special processing: if the supplied name is admin then look up the first user - * specified by the "admins" driver params - */ - public function lookup_user_by_name($name) { - $result = ldap_search(self::$_connection, self::$_params["user_domain"], "uid=$name"); - $entries = ldap_get_entries(self::$_connection, $result); - if ($entries["count"] > 0) { - return new Ldap_User($entries[0]); - } - return null; - } - - /** - * @see IdentityProvider_Driver::create_group. - */ - public function create_group($name) { - throw new Exception("@todo INVALID OPERATION"); - } - - /** - * @see IdentityProvider_Driver::everybody. - */ - public function everybody() { - return $this->lookup_group_by_name(self::$_params["everybody_group"]); - } - - /** - * @see IdentityProvider_Driver::registered_users. - */ - public function registered_users() { - return $this->lookup_group_by_name(self::$_params["registered_users_group"]); - } - - /** - * @see IdentityProvider_Driver::lookup_group. - */ - public function lookup_group($id) { - $result = @ldap_search(self::$_connection, self::$_params["group_domain"], "gidNumber=$id"); - $entry_id = ldap_first_entry(self::$_connection, $result); - - if ($entry_id !== false) { - $cn_entry = ldap_get_values(self::$_connection, $entry_id, "cn"); - $gid_number_entry = ldap_get_values(self::$_connection, $entry_id, "gidNumber"); - return new Ldap_Group($gid_number_entry[0], $cn_entry[0]); - } - return null; - } - - /** - * Look up the group by name. - * @param string $name the name of the group to locate - * @return Group_Definition - */ - public function lookup_group_by_name($name) { - $result = @ldap_search(self::$_connection, self::$_params["group_domain"], "cn=$name"); - $entry_id = ldap_first_entry(self::$_connection, $result); - - if ($entry_id !== false) { - $cn_entry = ldap_get_values(self::$_connection, $entry_id, "cn"); - $gid_number_entry = ldap_get_values(self::$_connection, $entry_id, "gidNumber"); - return new Ldap_Group($gid_number_entry[0], $cn_entry[0]); - } - return null; - } - - /** - * @see IdentityProvider_Driver::get_user_list. - */ - public function get_user_list($ids) { - $users = array(); - foreach ($ids as $id) { - $users[] = $this->lookup_user($id); - } - return $users; - } - - /** - * @see IdentityProvider_Driver::groups. - */ - public function groups() { - $groups = array(); - foreach (self::$_params["groups"] as $group_name) { - $groups[] = $this->lookup_group_by_name($group_name); - } - return $groups; - } - - static function groups_for($user) { - if ($user->guest) { - return $user->groups; - } - - $result = ldap_search(self::$_connection, self::$_params["group_domain"], - "(memberUid=$user->name)"); - - $associated_groups = self::$_params["groups"]; - $groups = array(); - for ($entry_id = ldap_first_entry(self::$_connection, $result); - $entry_id != false; - $entry_id = ldap_next_entry(self::$_connection, $entry_id)) { - $group_id = ldap_get_values(self::$_connection, $entry_id, "gidNumber"); - $group_name = ldap_get_values(self::$_connection, $entry_id, "cn"); - if (in_array($group_name[0], $associated_groups)) { - $groups[] = new Ldap_Group($group_id[0], $group_name[0]); - } - } - return $groups; - } - - /** - * @see IdentityProvider_Driver::add_user_to_group. - */ - public function add_user_to_group($user, $group) { - throw new Exception("@todo INVALID OPERATION"); - } - - /** - * @see IdentityProvider_Driver::remove_user_to_group. - */ - public function remove_user_from_group($user, $group) { - throw new Exception("@todo INVALID OPERATION"); - } -} // End Identity Gallery Driver - -class Ldap_User implements User_Definition { - private $ldap_entry; - - public function __construct($ldap_entry=null) { - $this->ldap_entry = $ldap_entry; - } - - public function display_name() { - return $this->ldap_entry["displayname"][0]; - } - - public function __get($key) { - switch($key) { - case "name": - return $this->ldap_entry["uid"][0]; - - case "guest": - return false; - - case "id": - return $this->ldap_entry["uidnumber"][0]; - - case "locale": // @todo - return null; - - case "admin": - return in_array($this->ldap_entry["uid"][0], - IdentityProvider_Ldap_Driver::$_params["admins"]); - - case "email": - return $this->ldap_entry["mail"][0]; - - case "full_name": - return $this->ldap_entry["cn"][0]; - - case "dn": - return $this->ldap_entry["dn"]; - - case "url": // @todo - return null; - - default: - throw new Exception("@todo UNKNOWN_KEY ($key)"); - } - } - - public function groups() { - return IdentityProvider_Ldap_Driver::groups_for($this); - } - - public function avatar_url($size=80, $default=null) { - return sprintf("http://www.gravatar.com/avatar/%s.jpg?s=%d&r=pg%s", - md5($this->email), $size, $default ? "&d=" . urlencode($default) : ""); - } -} - -class Ldap_Group implements Group_Definition { - public $id; - public $name; - - public function __construct($id, $name) { - $this->id = $id; - $this->name = $name; - $this->special = false; - } -} diff --git a/3.1/modules/ldap/module.info b/3.1/modules/ldap/module.info deleted file mode 100644 index 96785139..00000000 --- a/3.1/modules/ldap/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "LDAP" -description = "Use LDAP for authentication" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:ldap" -discuss_url = "http://gallery.menalto.com/forum_module_ldap" diff --git a/3.1/modules/max_size/helpers/max_size_event.php b/3.1/modules/max_size/helpers/max_size_event.php deleted file mode 100644 index be879e56..00000000 --- a/3.1/modules/max_size/helpers/max_size_event.php +++ /dev/null @@ -1,38 +0,0 @@ -is_photo()) { - list ($width, $height, $mime_type) = photo::get_file_metadata($item->data_file); - if ($width > $max_size || $height > $max_size) { - $tempnam = tempnam(TMPPATH, "size"); - $tmpfile = $tempnam . "." . pathinfo($item->data_file, PATHINFO_EXTENSION); - gallery_graphics::resize( - $item->data_file, $tmpfile, - array("width" => $max_size, "height" => $max_size, "master" => Image::AUTO), - $item); - rename($tmpfile, $item->data_file); - unlink($tempnam); - } - } - } -} \ No newline at end of file diff --git a/3.1/modules/max_size/helpers/max_size_installer.php b/3.1/modules/max_size/helpers/max_size_installer.php deleted file mode 100644 index 1a7f2be9..00000000 --- a/3.1/modules/max_size/helpers/max_size_installer.php +++ /dev/null @@ -1,25 +0,0 @@ -deactivate)) { - site_status::warning( - t("The MetaDescription module requires the Tags module. " . - "Activate the Tags module now", - array("url" => url::site("admin/modules"))), - "metadescription_needs_tag"); - } else { - site_status::clear("metadescription_needs_tag"); - } - } -} diff --git a/3.1/modules/metadescription/helpers/metadescription_installer.php b/3.1/modules/metadescription/helpers/metadescription_installer.php deleted file mode 100644 index 6d7d540c..00000000 --- a/3.1/modules/metadescription/helpers/metadescription_installer.php +++ /dev/null @@ -1,34 +0,0 @@ -tag()) { - // If the current page belongs to a tag, look up - // the information for that tag. - $tagsItem = ORM::factory("tag") - ->where("id", "=", $theme->tag()->id) - ->find_all(); - - } elseif ($theme->item()) { - // If the current page belongs to an item (album, photo, etc.), - // look up any tags that have been applied to that item. - $tagsItem = ORM::factory("tag") - ->join("items_tags", "tags.id", "items_tags.tag_id") - ->where("items_tags.item_id", "=", $theme->item->id) - ->find_all(); - - } else { - // If the current page is neighter an item nor tag, do nothing. - return; - } - - // Load the meta tags into the top of the page. - // @todo: metadescription_block.html requires an item so for now, don't render it unless we - // have one. - if ($theme->item()) { - $metaView = new View("metadescription_block.html"); - $metaView->tags = $tagsItem; - return $metaView; - } - } -} diff --git a/3.1/modules/metadescription/module.info b/3.1/modules/metadescription/module.info deleted file mode 100644 index f85dbe80..00000000 --- a/3.1/modules/metadescription/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "MetaDescription" -description = "Automatically generates and inserts KEYWORD and DESCRIPTION meta tags into any theme." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:metadescription" -discuss_url = "http://gallery.menalto.com/forum_module_metadescription" diff --git a/3.1/modules/metadescription/views/metadescription_block.html.php b/3.1/modules/metadescription/views/metadescription_block.html.php deleted file mode 100644 index 2464b6f1..00000000 --- a/3.1/modules/metadescription/views/metadescription_block.html.php +++ /dev/null @@ -1,45 +0,0 @@ - -item; - $metaTags = ""; - if (count($tags) > 0) { - for ($counter=0; $countername) . ","; - } else { - $metaTags = $metaTags . html::clean($tags[$counter]->name); - } - } - } - - // If $metaTags is empty, use the item's title instead. - if ($metaTags == "") { - $metaTags = html::clean($item->title); - } - - $metaDescription = ""; - $metaDescription = trim(nl2br(html::purify($item->description))); - // If description is empty, use title instead. - if ($metaDescription == "") { - $metaDescription = html::clean($item->title); - } - // If this page belongs to a tag, use the description of the first item instead. - if ($theme->tag()) { - if (count($children) > 0) { - $metaDescription = trim(nl2br(html::purify($children[0]->description))); - } - } - // If it's still empty, use $metaTags. - if ($metaDescription == "") { - $metaDescription = $metaTags; - } - - // Strip HTML - $metaDescription = strip_tags($metaDescription); - // Strip Line Breaks - $metaDescription = str_replace("\n", " ", $metaDescription); - // Limit Description to 150 characters. - $metaDescription = substr($metaDescription, 0,150); -?> - - diff --git a/3.1/modules/minislideshow/controllers/admin_minislideshow.php b/3.1/modules/minislideshow/controllers/admin_minislideshow.php deleted file mode 100644 index dfd008fe..00000000 --- a/3.1/modules/minislideshow/controllers/admin_minislideshow.php +++ /dev/null @@ -1,127 +0,0 @@ -content = new View("admin_minislideshow.html"); - $view->content->minislideshow_form = $this->_get_admin_form(); - print $view; - } - - public function saveprefs() { - // Process the admin form. - - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Save user specified settings to the database. - $str_slideshow_url = Input::instance()->post("slideshow_url"); - module::set_var("minislideshow", "slideshow_url", $str_slideshow_url); - - $str_slideshow_shuffle = Input::instance()->post("shuffle"); - module::set_var("minislideshow", "shuffle", $str_slideshow_shuffle); - - $str_slideshow_dropshadow = Input::instance()->post("dropshadow"); - module::set_var("minislideshow", "dropshadow", $str_slideshow_dropshadow); - - $str_slideshow_show_title = Input::instance()->post("show_title"); - module::set_var("minislideshow", "show_title", $str_slideshow_show_title); - - $str_slideshow_trans_in_type = Input::instance()->post("trans_in_type"); - module::set_var("minislideshow", "trans_in_type", $str_slideshow_trans_in_type); - - $str_slideshow_trans_out_type = Input::instance()->post("trans_out_type"); - module::set_var("minislideshow", "trans_out_type", $str_slideshow_trans_out_type); - - $str_slideshow_mask = Input::instance()->post("mask"); - module::set_var("minislideshow", "mask", $str_slideshow_mask); - - $str_slideshow_use_full_image = Input::instance()->post("use_full_image"); - module::set_var("minislideshow", "use_full_image", $str_slideshow_use_full_image); - - $str_slideshow_delay = Input::instance()->post("delay"); - module::set_var("minislideshow", "delay", $str_slideshow_delay); - - // Display a success message and load the admin screen. - message::success(t("Your Settings Have Been Saved.")); - $view = new Admin_View("admin.html"); - $view->content = new View("admin_minislideshow.html"); - $view->content->minislideshow_form = $this->_get_admin_form(); - print $view; - } - - private function _get_admin_form() { - // Generate a form for configuring the slideshow. - - // Make a new Form. - $form = new Forge("admin/minislideshow/saveprefs", "", "post", - array("id" => "g-mini-slideshow-admin-form")); - - - // Get location of slideshow files. - $group_slideshow_files = $form->group("Minislideshow"); - $group_slideshow_files->input("slideshow_url") - ->label(t("URL to your minislideshow.swf")) - ->value(module::get_var("minislideshow", "slideshow_url")); - - // Get additional settings for the slideshow. - $group_slideshow_settings = $form->group("MinislideshowSettings"); - $group_slideshow_settings->label(t("MiniSlide Show Settings")); - $group_slideshow_settings->dropdown('shuffle') - ->label(t("Shuffle:")) - ->options(array('true'=>'True', ''=>'False')) - ->selected(module::get_var("minislideshow", "shuffle")); - $group_slideshow_settings->dropdown('dropshadow') - ->label(t("Drop Shadow:")) - ->options(array('true'=>'True', ''=>'False')) - ->selected(module::get_var("minislideshow", "dropshadow")); - $group_slideshow_settings->dropdown('show_title') - ->label(t("Show Title:")) - ->options(array('top'=>'Top', 'bottom'=>'Bottom', ''=>'False')) - ->selected(module::get_var("minislideshow", "show_title")); - $group_slideshow_settings->dropdown('trans_in_type') - ->label(t("Transition In:")) - ->options(array('Blinds'=>'Blinds', ''=>'Fade', 'Fly'=>'Fly', 'Iris'=>'Iris', 'Photo'=>'Photo', 'PixelDissolve'=>'Pixel Dissolve', 'Rotate'=>'Rotate', 'Squeeze'=>'Squeeze', 'Wipe'=>'Wipe', 'Zoom'=>'Zoom', 'Random'=>'Random')) - ->selected(module::get_var("minislideshow", "trans_in_type")); - $group_slideshow_settings->dropdown('trans_out_type') - ->label(t("Transition Out:")) - ->options(array('Blinds'=>'Blinds', ''=>'Fade', 'Fly'=>'Fly', 'Iris'=>'Iris', 'Photo'=>'Photo', 'PixelDissolve'=>'Pixel Dissolve', 'Rotate'=>'Rotate', 'Squeeze'=>'Squeeze', 'Wipe'=>'Wipe', 'Zoom'=>'Zoom', 'Random'=>'Random')) - ->selected(module::get_var("minislideshow", "trans_out_type")); - $group_slideshow_settings->dropdown('mask') - ->label(t("Mask:")) - ->options(array(''=>'None', 'circleMask'=>'Circle', 'roundedMask'=>'Rounded Corners', 'starMask'=>'Star')) - ->selected(module::get_var("minislideshow", "mask")); - $group_slideshow_settings->dropdown('use_full_image') - ->label(t("Use Full Image:")) - ->options(array('true', 'false', 'Use Resize')) - ->selected(module::get_var("minislideshow", "use_full_image")); - $group_slideshow_settings->input("delay") - ->label(t("Delay:")) - ->value(module::get_var("minislideshow", "delay")); - - // Add a save button to the form. - $form->submit("SaveSettings")->value(t("Save")); - - // Return the newly generated form. - return $form; - } -} \ No newline at end of file diff --git a/3.1/modules/minislideshow/controllers/minislideshow.php b/3.1/modules/minislideshow/controllers/minislideshow.php deleted file mode 100644 index bd52f67f..00000000 --- a/3.1/modules/minislideshow/controllers/minislideshow.php +++ /dev/null @@ -1,70 +0,0 @@ -is_album()) { - $view->item_id = $item->id; - } else { - $view->item_id = $item->parent_id; - $item = ORM::factory("item", $item_id); - } - access::required("view", $item); - - // Generate additional slideshow parameters from database values. - $slideshow_params = ""; - if (module::get_var("minislideshow", "shuffle") != "") { - $slideshow_params = $slideshow_params . "&shuffle=" . module::get_var("minislideshow", "shuffle"); - } - if (module::get_var("minislideshow", "dropshadow") != "") { - $slideshow_params = $slideshow_params . "&showDropShadow=" . module::get_var("minislideshow", "dropshadow"); - } - if (module::get_var("minislideshow", "show_title") != "") { - $slideshow_params = $slideshow_params . "&showTitle=" . module::get_var("minislideshow", "show_title"); - } - if (module::get_var("minislideshow", "trans_in_type") != "") { - $slideshow_params = $slideshow_params . "&transInType=" . module::get_var("minislideshow", "trans_in_type"); - } - if (module::get_var("minislideshow", "trans_out_type") != "") { - $slideshow_params = $slideshow_params . "&transOutType=" . module::get_var("minislideshow", "trans_out_type"); - } - if (module::get_var("minislideshow", "mask") != "") { - $slideshow_params = $slideshow_params . "&" . module::get_var("minislideshow", "mask") . "=true"; - } - if (module::get_var("minislideshow", "use_full_image") != "") { - $slideshow_params = $slideshow_params . "&useFull=true"; - if (module::get_var("minislideshow", "use_full_image") == "2") { - $slideshow_params = $slideshow_params . "&useResizes=true"; - } - } - if (module::get_var("minislideshow", "delay") != "") { - $slideshow_params = $slideshow_params . "&delay=" . module::get_var("minislideshow", "delay"); - } - $view->slideshow_params = $slideshow_params; - - // Display the slideshow. - print $view; - } -} diff --git a/3.1/modules/minislideshow/css/minislideshow_menu.css b/3.1/modules/minislideshow/css/minislideshow_menu.css deleted file mode 100644 index 19d5e414..00000000 --- a/3.1/modules/minislideshow/css/minislideshow_menu.css +++ /dev/null @@ -1,4 +0,0 @@ -#g-view-menu #g-mini-slideshow-link { - background-image: url('../images/ico-view-minislideshow.png'); -} - diff --git a/3.1/modules/minislideshow/helpers/minislideshow_event.php b/3.1/modules/minislideshow/helpers/minislideshow_event.php deleted file mode 100644 index 6d88569a..00000000 --- a/3.1/modules/minislideshow/helpers/minislideshow_event.php +++ /dev/null @@ -1,65 +0,0 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("minislideshow") - ->label(t("MiniSlide Show settings")) - ->url(url::site("admin/minislideshow"))); - } - - static function module_change($changes) { - // Display a warning message if the RSS module is not installed. - if (!module::is_active("rss") || in_array("rss", $changes->deactivate)) { - site_status::warning( - t("The MiniSlide Show module requires the RSS module. " . - "Activate the RSS module now", - array("url" => url::site("admin/modules"))), - "minislideshow_needs_rss"); - } else { - site_status::clear("minislideshow_needs_rss"); - } - } - - static function album_menu($menu, $theme) { - // Add an option to access the slideshow from the album view. - $menu - ->append(Menu::factory("link") - ->id("minislideshow") - ->label(t("View MiniSlide Show")) - ->url(url::site("minislideshow/showslideshow/" . $theme->item()->id)) - ->css_class("g-dialog-link") - ->css_id("g-mini-slideshow-link")); - } - - static function photo_menu($menu, $theme) { - // Add an option to access the slideshow from the photo view. - $menu - ->append(Menu::factory("link") - ->id("minislideshow") - ->label(t("View MiniSlide Show")) - ->url(url::site("minislideshow/showslideshow/" . $theme->item()->id)) - ->css_class("g-dialog-link") - ->css_id("g-mini-slideshow-link")); - } -} diff --git a/3.1/modules/minislideshow/helpers/minislideshow_installer.php b/3.1/modules/minislideshow/helpers/minislideshow_installer.php deleted file mode 100644 index da071844..00000000 --- a/3.1/modules/minislideshow/helpers/minislideshow_installer.php +++ /dev/null @@ -1,25 +0,0 @@ - -
      -

      - -
      diff --git a/3.1/modules/minislideshow/views/minislideshow_dialog.html.php b/3.1/modules/minislideshow/views/minislideshow_dialog.html.php deleted file mode 100644 index c9507594..00000000 --- a/3.1/modules/minislideshow/views/minislideshow_dialog.html.php +++ /dev/null @@ -1,18 +0,0 @@ - - -

      -
      -" width="485" height="300" - align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" -type="application/x-shockwave-flash" name="minislide" wmode="transparent" - allowFullscreen="true" allowScriptAccess="always" quality="high" -flashvars="xmlUrl="> - - - -
      Embed:" width="485" height="300" align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="minislide" wmode="transparent" allowFullscreen="true" allowScriptAccess="always" quality="high" flashvars="xmlUrl=">" readonly>
      -
      \ No newline at end of file diff --git a/3.1/modules/minislideshow/views/minislideshow_header_block.html.php b/3.1/modules/minislideshow/views/minislideshow_header_block.html.php deleted file mode 100644 index c52d0117..00000000 --- a/3.1/modules/minislideshow/views/minislideshow_header_block.html.php +++ /dev/null @@ -1,5 +0,0 @@ - - -" /> - - diff --git a/3.1/modules/moduleorder/controllers/admin_moduleorder.php b/3.1/modules/moduleorder/controllers/admin_moduleorder.php deleted file mode 100644 index 3eb7fca1..00000000 --- a/3.1/modules/moduleorder/controllers/admin_moduleorder.php +++ /dev/null @@ -1,83 +0,0 @@ -_get_view(); - } - - private function _get_view() { - $view = new Admin_View("admin.html"); - $view->page_title = t("Manage module order"); - $view->content = new View("admin_moduleorder.html"); - $view->content->csrf = access::csrf_token(); - $view->content->available = new View("admin_moduleorder_blocks.html"); - $view->content->active = new View("admin_moduleorder_blocks.html"); - if (module::get_version("gallery") > 31) { - $view->content->available->modules = $this->_get_modules(); - } - return $view; - } - - public function update() { - //Get the ordered list of modules - $modulerawlist = explode("&", trim($_POST['modulelist'], "&")); - - //Make sure that gallery and user modules are first in the list - $current_weight = 2; - $identity_provider = module::get_var("gallery", "identity_provider"); - foreach ($modulerawlist as $row) { - $currentry = explode("=", $row); - $currentry = explode(":", $currentry[1]); - if ($currentry[0] == "gallery") { - $modulelist[0] = $row; - } elseif ($currentry[0] == $identity_provider) { - $modulelist[1] = $row; - } else { - $modulelist[$current_weight] = $row; - $current_weight++; - } - } - ksort($modulelist); - - //Write the correct weight values - $current_weight = 0; - foreach ($modulelist as $row) { - $current_weight++; - $currentry = explode("=", $row); - $currentry = explode(":", $currentry[1]); - db::build() - ->update("modules") - ->set("weight", $current_weight) - ->where("id", "=", $currentry[1]) - ->execute(); - } - - message::success(t("Your settings have been saved.")); - url::redirect("admin/moduleorder"); - print $this->_get_view(); - } - - private function _get_modules() { - $active_blocks = array(); - $available_modules = moduleorder::get_available_site_modules(); - return $available_modules; - } -} - diff --git a/3.1/modules/moduleorder/helpers/moduleorder.php b/3.1/modules/moduleorder/helpers/moduleorder.php deleted file mode 100644 index 570e234b..00000000 --- a/3.1/modules/moduleorder/helpers/moduleorder.php +++ /dev/null @@ -1,32 +0,0 @@ -select("*")->from("modules")->order_by("weight")->execute() as $row) { - $modules["{$row->name}:$row->id"] = $row->name; - } - return $modules; - } -} diff --git a/3.1/modules/moduleorder/module.info b/3.1/modules/moduleorder/module.info deleted file mode 100644 index c6379871..00000000 --- a/3.1/modules/moduleorder/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Module Order" -description = "Allows you to change the order in which modules are executed" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:moduleorder" -discuss_url = "http://gallery.menalto.com/forum_module_moduleorder" diff --git a/3.1/modules/moduleorder/views/admin_moduleorder.html.php b/3.1/modules/moduleorder/views/admin_moduleorder.html.php deleted file mode 100644 index 93b0eaa3..00000000 --- a/3.1/modules/moduleorder/views/admin_moduleorder.html.php +++ /dev/null @@ -1,59 +0,0 @@ - - 31): ?> - - - -
      -

      - -

      -

      - -

      - -

      - -

      -

      -

      - -

      - -
      -
      -
      -

      -
      -
        - -
      -
      -
      -
      -
      " method="post"> - -
      -
      - Save - -
      diff --git a/3.1/modules/moduleorder/views/admin_moduleorder_blocks.html.php b/3.1/modules/moduleorder/views/admin_moduleorder_blocks.html.php deleted file mode 100644 index b7d9458f..00000000 --- a/3.1/modules/moduleorder/views/admin_moduleorder_blocks.html.php +++ /dev/null @@ -1,10 +0,0 @@ - - - $text): ?> - -name == ""): ?> -
    • - -
    • name ?>
    • - - diff --git a/3.1/modules/moduleupdates/controllers/admin_moduleupdates.php b/3.1/modules/moduleupdates/controllers/admin_moduleupdates.php deleted file mode 100755 index a469fe67..00000000 --- a/3.1/modules/moduleupdates/controllers/admin_moduleupdates.php +++ /dev/null @@ -1,321 +0,0 @@ - - */ - public function index() { - - $view = new Admin_View("admin.html"); - $view->page_title = t("Gallery 3 :: Manage Module Updates"); - $view->content = new View("admin_moduleupdates.html"); - $view->content->mu_version = module::get_version("moduleupdates"); - - $refreshCache = false; - - $cache = unserialize(Cache::instance()->get("moduleupdates_cache")); - $cache_updates = unserialize(Cache::instance()->get("moduleupdates_cache_updates")); - - //if someone pressed the button to refresh now - if (request::method() == "post") { - access::verify_csrf(); - $cache = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS); - $cache_updates = array("date" => "", "updates" => 0); - $refreshCache = true; - }else if(count($cache) < 1 or $cache_updates['date'] == ""){ - //if there are no items in the cache array or the update date is "" refresh the data - $cache = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS); - $cache_updates = array("date" => "", "updates" => 0); - $refreshCache = true; - } - - //Check the ability to access the Gallery3 GitHub - $GitHub = null; - try { - $GitHub = fopen ("http://github.com", "r"); - if ($GitHub != null) { - $GitHub = 'Online'; - }else{ - $GitHub = 'Offline'; - } - } - catch (Exception $e) { - } - //Check the ability to access the Google - $Google = null; - try { - $Google = fopen ("http://google.com", "r"); - if ($Google != null) { - $Google = 'Online'; - }else{ - $Google = 'Offline'; - } - } - catch (Exception $e) { - } - - $update_count = 0; - - if($refreshCache == true){ - foreach (module::available() as $this_module_name => $module_info) { - - $font_color_local = "black"; - $core_version = ''; - $core_server = ''; - $core_dlink = ''; - $font_color_core = "black"; - $contrib_version = ''; - $contrib_server = ''; - $contrib_dlink = ''; - $font_color_contrib = "black"; - $gh_version = ''; - $gh_server = ''; - $gh_dlink = ''; - $font_color_gh = "black"; - - - - $font_color_local = $this->get_local_module_version_color ($module_info->version, $module_info->code_version); - list ($core_version, $core_server) = $this->get_remote_module_version($this_module_name, "CORE"); - $font_color_core = $this->get_module_version_color ($module_info->version, $module_info->code_version, $core_version); - list ($contrib_version, $contrib_server) = $this->get_remote_module_version($this_module_name, "CONTRIB"); - $font_color_contrib = $this->get_module_version_color ($module_info->version, $module_info->code_version, $contrib_version); - list ($gh_version, $gh_server) = $this->get_remote_module_version($this_module_name, "GH"); - $font_color_gh = $this->get_module_version_color ($module_info->version, $module_info->code_version, $gh_version); - - if($font_color_core == "red" or $font_color_contrib == "red" or $font_color_gh == "red"){ - $update_count++; - } - - $module_info->name = "".$module_info->name.""; - - if (is_numeric($core_version)) { - if($core_version > $module_info->version) { - $core_dlink = "http://github.com/gallery/gallery3/tree/master/modules/".$this_module_name; - } - } - - if (is_numeric($contrib_version)) { - if($contrib_version > $module_info->version) { - $contrib_dlink = "http://github.com/gallery/gallery3-contrib/tree/master/". - substr_replace(gallery::VERSION,"",strpos(gallery::VERSION," ")) ."/modules/".$this_module_name; - } - } - - if (is_numeric($gh_version)) { - if($gh_version > $module_info->version) { - $this_gm_repo = str_replace(".","",substr_replace(gallery::VERSION,"",strpos(gallery::VERSION," "))); - if($this_gm_repo == "30"){ - $gh_dlink = "http://www.gallerymodules.com/update/".$this_module_name; - } else { - $gh_dlink = "http://www.gallerymodules.com/update".$this_gm_repo."/".$this_module_name; - } - - } - } - - //populate the list fo modules and their data - $cache->$this_module_name = array ("name" => $module_info->name, "locked" => $module_info->locked, - "code_version" => $module_info->code_version, "active" => $module_info->active, - "version" => $module_info->version,"description" => $module_info->description, - "core_version" => $core_version, "core_server" => $core_server, "font_color_core" => $font_color_core, - "contrib_version" => $contrib_version, "contrib_server" => $contrib_server, "font_color_contrib" => $font_color_contrib, - "gh_version" => $gh_version, "gh_server" => $gh_server, "font_color_gh" => $font_color_gh, - "font_color_local" => $font_color_local, "core_dlink" => $core_dlink, "contrib_dlink" => $contrib_dlink, - "gh_dlink" => $gh_dlink); - } - - //Define right now as YYYY.MM.DD HH:MM with the # of updates that are out of date - $cache_updates = array("date" => date("Y.m.d - H:i"), "updates" => $update_count); - - //Write out the new data to cache with a 30 day expiration & 0 for update data so it's always present - Cache::instance()->set("moduleupdates_cache", serialize($cache), array("ModuleUpdates"), 30*86400); - Cache::instance()->set("moduleupdates_cache_updates", serialize($cache_updates), array("ModuleUpdates"), null); - log::success("moduleupdates", t("Completed checking remote GitHub for modules updates.")); - } - - $view->content->vars = $cache; - $view->content->update_time = $cache_updates['date']; - $view->content->csrf = access::csrf_token(); - $view->content->Google = $Google; - $view->content->GitHub = $GitHub; - $view->content->Gallery_Version = substr_replace(gallery::VERSION,"",strpos(gallery::VERSION," ")); - - - print $view; - } - - - /** - * - **/ - private function get_module_version_color ($version, $code_version, $remote_version) { - - $font_color = "black"; - - //BLACK - no module version detected - if ($remote_version == "") { - $font_color = "black"; - //BLUE - DNE: Does Not Exist, this module was not found - } else if ($remote_version == "DNE") { - $font_color = "blue"; - //GREEN - Your version is newer than the GitHub - } else if ($remote_version < $code_version or ($version != '' - and $remote_version < $version)) { - $font_color = "green"; - //RED - Your version is older than the GitHub - } else if ($remote_version > $code_version or ($version != '' - and $remote_version > $version)) { - $font_color = "red"; - } - - return $font_color; - } - - - /** - * - **/ - private function get_local_module_version_color ($version, $code_version) { - - $font_color = "black"; - - //PINK - Your installed version is newer than file version - if ($version != '' and $code_version < $version) { - $font_color = "pink"; - //ORANGE - Your file version is newer than the installed version - } else if ($version != '' and $code_version > $version) { - $font_color = "orange"; - } - - return $font_color; - } - - - /** - * Parses the known GitHub repositories for new versions of modules. - * - * Searches the remote GitHub repositories for a module with a like filename to that of the ones - * installed in the running Gallery isntall. Reads the remote modules module.info file to - * gather the version information. Uses the following locations; - * - * http://github.com/gallery/gallery3 - * http://github.com/gallery/gallery3-contrib - * http://www.gallerymodules.com - * - * @author brentil - * @param String - The folder name of the module to search for on the remote GitHub server - * @param String - The remote server to check against - * @return Array - An array with the remote module version and the server it was found on. - */ - private function get_remote_module_version ($module_name, $server_location) { - - $version = ''; - $server = ''; - $file = null; - - switch ($server_location) { - case "CONTRIB": - //Check the Gallery3 Community Contributions GitHub - if ($file == null) { - try { - $file = fopen ("http://github.com/gallery/gallery3-contrib/raw/master/". - substr_replace(gallery::VERSION,"",strpos(gallery::VERSION," "))."/modules/".$module_name."/module.info", "r"); - if ($file != null) { - $server = '(GCC)'; - } - } - catch (Exception $e) { - } - } - break; - case "CORE": - //Check the main Gallery3 GitHub - if ($file == null) { - try { - $file = fopen ("http://github.com/gallery/gallery3/raw/master/modules/".$module_name."/module.info", "r"); - if ($file != null) { - $server = '(G)'; - } - } - catch (Exception $e) { - } - } - break; - case "GH": - //Check GalleryModules.com - if ($file == null) { - try { - $this_gm_repo = str_replace(".","",substr_replace(gallery::VERSION,"",strpos(gallery::VERSION," "))); - if($this_gm_repo == "30"){ - $file = fopen ("http://www.gallerymodules.com/m/".$module_name, "r"); - } else { - $file = fopen ("http://www.gallerymodules.com/".$this_gm_repo."m/".$module_name, "r"); - } - if ($file != null) { - $server = '(GH)'; - } - } - catch (Exception $e) { - } - } - break; - } - - if ($file != null) { - while (!feof ($file)) { - $line = fgets ($file, 1024); - if ($server_location == "GH"){ - //GH stores only the version info - if($line == "Not entered" or $line == "See git") { - $line = ""; - } - $version = $line; - break; - } else { - //Regular expression to find & gather the version number in the remote module.info file - if (preg_match ("@version = (.*)@i", $line, $out)) { - $version = $out[1]; - break; - } - } - } - fclose ($file); - } - - return array ($version, $server); - } -} \ No newline at end of file diff --git a/3.1/modules/moduleupdates/helpers/moduleupdates_event.php b/3.1/modules/moduleupdates/helpers/moduleupdates_event.php deleted file mode 100644 index ebafb880..00000000 --- a/3.1/modules/moduleupdates/helpers/moduleupdates_event.php +++ /dev/null @@ -1,30 +0,0 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("moduleupdates_menu") - ->label(t("Module Updates")) - ->url(url::site("admin/moduleupdates"))); - } -} \ No newline at end of file diff --git a/3.1/modules/moduleupdates/helpers/moduleupdates_installer.php b/3.1/modules/moduleupdates/helpers/moduleupdates_installer.php deleted file mode 100644 index 1e60a2cb..00000000 --- a/3.1/modules/moduleupdates/helpers/moduleupdates_installer.php +++ /dev/null @@ -1,51 +0,0 @@ -delete("ModuleUpdates"); - //create the blank ModuleUpdates cache entry with an expiration of 0 days - Cache::instance()->set("moduleupdates_cache", "", array("ModuleUpdates"), null); - Cache::instance()->set("moduleupdates_cache_updates", "", array("ModuleUpdates"), null); - } - } - - static function upgrade($version) { - module::set_version("moduleupdates", 7); - //Remove the ModuleUpdates cache entry 'JIC' - Cache::instance()->delete("ModuleUpdates"); - //Empty the ModuleUpdates cache entry so our new version starts from scratch - Cache::instance()->set("moduleupdates_cache", "", array("ModuleUpdates"), null); - Cache::instance()->set("moduleupdates_cache_updates", "", array("ModuleUpdates"), null); - } - - static function uninstall() { - - //Remove the ModuleUpdates cache entry as we remove the module - Cache::instance()->delete("ModuleUpdates"); - module::delete("moduleupdates"); - } -} \ No newline at end of file diff --git a/3.1/modules/moduleupdates/module.info b/3.1/modules/moduleupdates/module.info deleted file mode 100755 index 603aeff5..00000000 --- a/3.1/modules/moduleupdates/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Module Updates" -description = "Compares your installed module version against the ones stored in the GitHub." -version = 7 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:moduleupdates" -discuss_url = "http://gallery.menalto.com/forum_module_moduleupdates" diff --git a/3.1/modules/moduleupdates/views/admin_moduleupdates.html.php b/3.1/modules/moduleupdates/views/admin_moduleupdates.html.php deleted file mode 100644 index e55ed7af..00000000 --- a/3.1/modules/moduleupdates/views/admin_moduleupdates.html.php +++ /dev/null @@ -1,74 +0,0 @@ - - - -
      -

      - - -
      - -
      " id="g-configure-moduleupdates-form"> - -
      - ModuleUpdates Information -
        -
      • Red = Your version is older than the GitHub
        ") ?>
      • -
      • Green = Your version is newer than the GitHub
        ") ?>
      • -
      • Orange = Your file version is newer than the installed version
        ") ?>
      • -
      • Pink = Your installed version is newer than file version
        ") ?>
      • -
      • ") ?>
      • -
      • " class="submit" />
      • -
      -
      -
      - -
      -
        -
      • -
      -
      - Core Modules - - - - - - - - - - "> - - - - - - - -
      Installed") ?>
      "; ?> *"; } ?> "; } ?> "; ?> *"; } ?> $module_name['code_version']) { echo "".$module_name['core_version']."";} else { echo $module_name['core_version']; } ?> "; } ?>
      -
      -
      - Community Contributed Modules - - - - - - - - - - - "> - - - - - - - - -
      Installed") ?>
      "; ?> *"; } ?> "; } ?> "; ?> *"; } ?> $module_name['version'] or $module_name['core_version'] > $module_name['code_version']) { echo "".$module_name['contrib_version']."";} else { echo $module_name['contrib_version']; } ?> "; } ?> "; ?> *"; } ?> $module_name['version'] or $module_name['core_version'] > $module_name['code_version']) { echo "".$module_name['gh_version']."";} else { echo $module_name['gh_version']; } ?> "; } ?>
      -
      -
      -
      \ No newline at end of file diff --git a/3.1/modules/navcarousel/controllers/admin_navcarousel.php b/3.1/modules/navcarousel/controllers/admin_navcarousel.php deleted file mode 100644 index 5d9dff60..00000000 --- a/3.1/modules/navcarousel/controllers/admin_navcarousel.php +++ /dev/null @@ -1,134 +0,0 @@ -_get_view(); - } - - public function handler() { - access::verify_csrf(); - - $form = $this->_get_form(); - if ($form->validate()) { - $scrollsize = intval($form->navcarousel->scrollsize->value); - $showelements = intval($form->navcarousel->showelements->value); - $carouselwidth = intval($form->navcarousel->carouselwidth->value); - $thumbsize = intval($form->thumbsettings->thumbsize->value); - if ($showelements < 1) { - $showelements = 1; - message::error(t("You must show at least one item.")); - } - if ($scrollsize < 1) { - $scrollsize = 1; - message::error(t("You must scroll by at least one item.")); - } - if ($thumbsize > 150 || $thumbsize < 25) { - $thumbsize = 50; - message::error(t("The size of the thumbnails must be between 25 and 150 pixel.")); - } - if ($carouselwidth < ($thumbsize + 75) && $carouselwidth > 0) { - $carouselwidth = $thumbsize + 75; - message::error(t("The carousel must be at least %pixel wide.", array("pixel" => $carouselwidth))); - } - if ($carouselwidth > 0) { - if ($carouselwidth < ((($thumbsize + 11) * $showelements) + 64)) { - $showelements = ($carouselwidth - 64) / ($thumbsize + 11); - $showelements = intval(floor($showelements)); - message::error(t("With the selected carousel width and thumbnail size you can show a maximum of %itemno items.", array("itemno" => $showelements))); - } - } else { - message::warning(t("The maximum number of displayable items cannot be calculated when the carousel width is set to 0.")); - } - if ($scrollsize > $showelements) { - $scrollsize = $showelements; - message::error(t("The number of items to scroll must not exceed the number of items to show.")); - } - module::set_var( - "navcarousel", "scrollsize", $scrollsize); - module::set_var( - "navcarousel", "showelements", $showelements); - module::set_var( - "navcarousel", "carouselwidth", $carouselwidth); - module::set_var( - "navcarousel", "thumbsize", $thumbsize); - module::set_var( - "navcarousel", "abovephoto", $form->navcarousel->abovephoto->value, true); - module::set_var( - "navcarousel", "noajax", $form->navcarousel->noajax->value, true); - module::set_var( - "navcarousel", "showondomready", $form->navcarousel->showondomready->value, true); - module::set_var( - "navcarousel", "maintainaspect", $form->thumbsettings->maintainaspect->value, true); - module::set_var( - "navcarousel", "nomouseover", $form->thumbsettings->nomouseover->value, true); - module::set_var( - "navcarousel", "noresize", $form->thumbsettings->noresize->value, true); - - message::success(t("Your settings have been saved.")); - url::redirect("admin/navcarousel"); - } - print $this->_get_view($form); - } - - private function _get_view($form=null) { - $v = new Admin_View("admin.html"); - $v->content = new View("admin_navcarousel.html"); - $v->content->form = empty($form) ? $this->_get_form() : $form; - return $v; - } - - private function _get_form() { - $form = new Forge("admin/navcarousel/handler", "", "post", array("id" => "g-admin-form")); - - $group = $form->group("navcarousel")->label(t("Navigation carousel settings")); - $group->input("scrollsize")->label(t('Enter how many items you want to scroll when clicking next or previous')) - ->value(module::get_var("navcarousel", "scrollsize", "7")) - ->rules("valid_numeric|length[1,2]"); - $group->input("showelements")->label(t('Enter how many items you want to be visible')) - ->value(module::get_var("navcarousel", "showelements", "7")) - ->rules("valid_numeric|length[1,2]"); - $group->input("carouselwidth")->label(t('Carousel width (in pixel). If set to 0 the carousel will use the full available width.')) - ->value(module::get_var("navcarousel", "carouselwidth", "600")) - ->rules("valid_numeric|length[1,3]"); - $group->checkbox("abovephoto")->label(t("Show carousel above photo")) - ->checked(module::get_var("navcarousel", "abovephoto", false)); - $group->checkbox("noajax")->label(t("Disable dynamic loading of thumbnails (might be slow for big albums)")) - ->checked(module::get_var("navcarousel", "noajax", false)); - $group->checkbox("showondomready")->label(t("Show carousel before all items are loaded (faster loading on large albums but might cause too early display on Chrome and Opera)")) - ->checked(module::get_var("navcarousel", "showondomready", false)); - - $group = $form->group("thumbsettings")->label(t("Change how thumnails are displayed")); - $group->input("thumbsize")->label(t('Thumbnail size (in pixel)')) - ->value(module::get_var("navcarousel", "thumbsize", "50")) - ->rules("valid_numeric|length[1,3]"); - $group->checkbox("nomouseover")->label(t("Do not show item title and number on mouse over")) - ->checked(module::get_var("navcarousel", "nomouseover", false)); - $group->checkbox("noresize")->label(t("Crop thumbails instead of resizing them.")) - ->onClick("changeaspectstate()") - ->id("noresize") - ->checked(module::get_var("navcarousel", "noresize", false)); - $group->checkbox("maintainaspect")->label(t("Maintain aspect ratio of the items for the thumbnails.")) - ->id("maintainaspect") - ->checked(module::get_var("navcarousel", "maintainaspect", false)); - - $form->submit("submit")->value(t("Save")); - return $form; - } -} diff --git a/3.1/modules/navcarousel/controllers/navcarousel.php b/3.1/modules/navcarousel/controllers/navcarousel.php deleted file mode 100644 index 3b5401a7..00000000 --- a/3.1/modules/navcarousel/controllers/navcarousel.php +++ /dev/null @@ -1,62 +0,0 @@ -parent(); - $item_count = -1; - - // Array indexes are 0-based, jCarousel positions are 1-based. - $first = max(0, intval($_GET['first']) - 1); - $last = max($first + 1, intval($_GET['last']) - 1); - - $length = $last - $first + 1; - - // Build the array with the thumbnail URLs - foreach ($parent->viewable()->children() as $photo) { - if (!$photo->is_album()) { - $item_count++; - $itemlist[$item_count] = $photo->thumb_url(); - } - } - - $total = count($itemlist); - $selected = array_slice($itemlist, $first, $length); - - // --- - - header('Content-Type: text/xml'); - - echo ''; - - // Return total number of images so the callback - // can set the size of the carousel. - echo ' ' . $total . ''; - - foreach ($selected as $img) { - echo ' ' . $img . ''; - } - - echo ''; - - } -} diff --git a/3.1/modules/navcarousel/css/credits.txt b/3.1/modules/navcarousel/css/credits.txt deleted file mode 100644 index e5ec8c29..00000000 --- a/3.1/modules/navcarousel/css/credits.txt +++ /dev/null @@ -1 +0,0 @@ -Button images copyright by Tango Icon Library Team (http://tango.freedesktop.org/Tango_Icon_Library) \ No newline at end of file diff --git a/3.1/modules/navcarousel/css/skin.css b/3.1/modules/navcarousel/css/skin.css deleted file mode 100644 index 695779f0..00000000 --- a/3.1/modules/navcarousel/css/skin.css +++ /dev/null @@ -1,122 +0,0 @@ -.jcarousel-skin-tango .jcarousel-container { - -moz-border-radius: 10px; - background: transparent; - border: 0; -} - -.jcarousel-skin-tango .jcarousel-container-horizontal { - padding: 0 60px; - margin: 0 auto; -} - -.jcarousel-skin-tango .jcarousel-item { - background-color: transparent !important; -} - -.jcarousel-skin-tango .jcarousel-item-horizontal { - margin-right: 2px; - margin-right: 2px; - padding-top: 2px; - text-align: center; -} - -.jcarousel-skin-tango .jcarousel-item-placeholder { - background: #fff; - color: #000; -} - -/** - * Horizontal Buttons - */ -.jcarousel-skin-tango .jcarousel-next-horizontal { - position: absolute; - right: 18px; - width: 32px; - height: 32px; - cursor: pointer; - background: transparent url('../images/next-horizontal.png') no-repeat 0 0; - visibility: hidden; -} - -.jcarousel-skin-tango .jcarousel-next-horizontal:hover { - background-position: -32px 0; -} - -.jcarousel-skin-tango .jcarousel-next-horizontal:active { - background-position: -64px 0; -} - -.jcarousel-skin-tango .jcarousel-next-disabled-horizontal, -.jcarousel-skin-tango .jcarousel-next-disabled-horizontal:hover, -.jcarousel-skin-tango .jcarousel-next-disabled-horizontal:active { - cursor: default; - background-position: -96px 0; -} - -.jcarousel-skin-tango .jcarousel-prev-horizontal { - position: absolute; - left: 18px; - width: 32px; - height: 32px; - cursor: pointer; - background: transparent url('../images/prev-horizontal.png') no-repeat 0 0; - visibility: hidden; -} - -.jcarousel-skin-tango .jcarousel-prev-horizontal:hover { - background-position: -32px 0; -} - -.jcarousel-skin-tango .jcarousel-prev-horizontal:active { - background-position: -64px 0; -} - -.jcarousel-skin-tango .jcarousel-prev-disabled-horizontal, -.jcarousel-skin-tango .jcarousel-prev-disabled-horizontal:hover, -.jcarousel-skin-tango .jcarousel-prev-disabled-horizontal:active { - cursor: default; - background-position: -96px 0; -} - -.carousel-thumbnail { - padding: 5px; - margin: 0 !important; -} - -.carousel-thumbnail:hover { - box-shadow: 1px 0px 8px #d7e1fa; - -moz-box-shadow: 1px 0px 8px #d7e1fa; - -webkit-box-shadow: 1px 0px 8px #d7e1fa; -} - -.carousel-current { - box-shadow: 1px 0px 8px #d7e1fa; - -moz-box-shadow: 1px 0px 8px #d7e1fa; - -webkit-box-shadow: 1px 0px 8px #d7e1fa; - padding: 5px; - margin: 0 !important; -} - -#navcarousel-wrapper { - width: 100%; - background: url('../images/ajax-loader.gif') no-repeat center center; -} - -#navcarousel { - visibility: hidden; -} - -/** - * RTL Support - */ - -.jcarousel-skin-tango .jcarousel-direction-rtl {direction:rtl;} -.jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-item-horizontal{ margin-right:0; margin-left:10px;} - -/*horizontal buttons*/ -.jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-next-horizontal{ - background-image:url('../images/prev-horizontal.png'); right:auto; left:5px; -} -.jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-prev-horizontal{ - background-image:url('../images/next-horizontal.png'); left:auto; right:5px; -} diff --git a/3.1/modules/navcarousel/helpers/navcarousel_theme.php b/3.1/modules/navcarousel/helpers/navcarousel_theme.php deleted file mode 100644 index f21ac1cf..00000000 --- a/3.1/modules/navcarousel/helpers/navcarousel_theme.php +++ /dev/null @@ -1,127 +0,0 @@ -page_type == "item") { - if (locales::is_rtl()) { - $rtl_support = "rtl: true,\n"; - } else { - $rtl_support = "rtl: false,\n"; - } - $carouselwidth = module::get_var("navcarousel", "carouselwidth", "600"); - if ($carouselwidth == 0) { - $carouselwidth = "100%"; - $containerwidth = ""; - } else { - $carouselwidth = $carouselwidth ."px"; - $containerwidth = ".jcarousel-skin-tango .jcarousel-container-horizontal {\n - width: ". $carouselwidth .";\n - }\n"; - } - $thumbsize = module::get_var("navcarousel", "thumbsize", "50"); - $showelements = module::get_var("navcarousel", "showelements", "7"); - $childcount = $theme->item->parent()->viewable()->children_count(); - $itemoffset = intval(floor($showelements / 2)); - if ($childcount <= $showelements) { - $itemoffset = 1; - } else { - $itempos = $theme->item->parent()->get_position($theme->item); - $itemoffset = $itempos - $itemoffset; - if ($itemoffset < 1) { - $itemoffset = 1; - } - if (($itemoffset + $showelements) > $childcount) { - $itemoffset = $childcount - $showelements + 1; - } - } - if (module::get_var("navcarousel", "noajax", false)) { - $ajaxhandler = ""; - } else { - $ajaxhandler = "itemLoadCallback: navcarousel_itemLoadCallback,\n"; - } - if (module::get_var("navcarousel", "showondomready", false)) { - $onwinload = ""; - } else { - $onwinload = "});\n - $(window).load(function () {\n"; - } - return - $theme->script("jquery.jcarousel.min.js") - . $theme->css("skin.css") - . "\n - \n - \n - "; - } - } - - static function photo_bottom($theme) { - if (!module::get_var("navcarousel", "abovephoto", false)) { - if ($theme->page_type == "item") { - return new View("navcarousel.html"); - } - } - } - - static function photo_top($theme) { - if (module::get_var("navcarousel", "abovephoto", false)) { - if ($theme->page_type == "item") { - return new View("navcarousel.html"); - } - } - } -} diff --git a/3.1/modules/navcarousel/images/ajax-loader.gif b/3.1/modules/navcarousel/images/ajax-loader.gif deleted file mode 100644 index 3288d103..00000000 Binary files a/3.1/modules/navcarousel/images/ajax-loader.gif and /dev/null differ diff --git a/3.1/modules/navcarousel/images/next-horizontal.png b/3.1/modules/navcarousel/images/next-horizontal.png deleted file mode 100644 index c9943fda..00000000 Binary files a/3.1/modules/navcarousel/images/next-horizontal.png and /dev/null differ diff --git a/3.1/modules/navcarousel/images/prev-horizontal.png b/3.1/modules/navcarousel/images/prev-horizontal.png deleted file mode 100644 index e963d28e..00000000 Binary files a/3.1/modules/navcarousel/images/prev-horizontal.png and /dev/null differ diff --git a/3.1/modules/navcarousel/js/jquery.jcarousel.js b/3.1/modules/navcarousel/js/jquery.jcarousel.js deleted file mode 100644 index 90f2459e..00000000 --- a/3.1/modules/navcarousel/js/jquery.jcarousel.js +++ /dev/null @@ -1,917 +0,0 @@ -/*! - * jCarousel - Riding carousels with jQuery - * http://sorgalla.com/jcarousel/ - * - * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com) - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. - * - * Built on top of the jQuery library - * http://jquery.com - * - * Inspired by the "Carousel Component" by Bill Scott - * http://billwscott.com/carousel/ - */ - -(function($) { - /** - * Creates a carousel for all matched elements. - * - * @example $("#mycarousel").jcarousel(); - * @before
      • First item
      • Second item
      - * @result - * - *
      - *
      - *
      - *
        - *
      • First item
      • - *
      • Second item
      • - *
      - *
      - *
      - *
      - *
      - *
      - * - * @method jcarousel - * @return jQuery - * @param o {Hash|String} A set of key/value pairs to set as configuration properties or a method name to call on a formerly created instance. - */ - $.fn.jcarousel = function(o) { - if (typeof o == 'string') { - var instance = $(this).data('jcarousel'), args = Array.prototype.slice.call(arguments, 1); - return instance[o].apply(instance, args); - } else - return this.each(function() { - $(this).data('jcarousel', new $jc(this, o)); - }); - }; - - // Default configuration properties. - var defaults = { - vertical: false, - rtl: false, - start: 1, - offset: 1, - size: null, - scroll: 3, - visible: null, - animation: 'normal', - easing: 'swing', - auto: 0, - wrap: null, - initCallback: null, - reloadCallback: null, - itemLoadCallback: null, - itemFirstInCallback: null, - itemFirstOutCallback: null, - itemLastInCallback: null, - itemLastOutCallback: null, - itemVisibleInCallback: null, - itemVisibleOutCallback: null, - buttonNextHTML: '
      ', - buttonPrevHTML: '
      ', - buttonNextEvent: 'click', - buttonPrevEvent: 'click', - buttonNextCallback: null, - buttonPrevCallback: null, - itemFallbackDimension: null - }, windowLoaded = false; - - $(window).bind('load.jcarousel', function() { windowLoaded = true; }) - - /** - * The jCarousel object. - * - * @constructor - * @class jcarousel - * @param e {HTMLElement} The element to create the carousel for. - * @param o {Object} A set of key/value pairs to set as configuration properties. - * @cat Plugins/jCarousel - */ - $.jcarousel = function(e, o) { - this.options = $.extend({}, defaults, o || {}); - - this.locked = false; - - this.container = null; - this.clip = null; - this.list = null; - this.buttonNext = null; - this.buttonPrev = null; - - // Only set if not explicitly passed as option - if (!o || o.rtl === undefined) - this.options.rtl = ($(e).attr('dir') || $('html').attr('dir') || '').toLowerCase() == 'rtl'; - - this.wh = !this.options.vertical ? 'width' : 'height'; - this.lt = !this.options.vertical ? (this.options.rtl ? 'right' : 'left') : 'top'; - - // Extract skin class - var skin = '', split = e.className.split(' '); - - for (var i = 0; i < split.length; i++) { - if (split[i].indexOf('jcarousel-skin') != -1) { - $(e).removeClass(split[i]); - skin = split[i]; - break; - } - } - - if (e.nodeName.toUpperCase() == 'UL' || e.nodeName.toUpperCase() == 'OL') { - this.list = $(e); - this.container = this.list.parent(); - - if (this.container.hasClass('jcarousel-clip')) { - if (!this.container.parent().hasClass('jcarousel-container')) - this.container = this.container.wrap('
      '); - - this.container = this.container.parent(); - } else if (!this.container.hasClass('jcarousel-container')) - this.container = this.list.wrap('
      ').parent(); - } else { - this.container = $(e); - this.list = this.container.find('ul,ol').eq(0); - } - - if (skin != '' && this.container.parent()[0].className.indexOf('jcarousel-skin') == -1) - this.container.wrap('
      '); - - this.clip = this.list.parent(); - - if (!this.clip.length || !this.clip.hasClass('jcarousel-clip')) - this.clip = this.list.wrap('
      ').parent(); - - this.buttonNext = $('.jcarousel-next', this.container); - - if (this.buttonNext.size() == 0 && this.options.buttonNextHTML != null) - this.buttonNext = this.clip.after(this.options.buttonNextHTML).next(); - - this.buttonNext.addClass(this.className('jcarousel-next')); - - this.buttonPrev = $('.jcarousel-prev', this.container); - - if (this.buttonPrev.size() == 0 && this.options.buttonPrevHTML != null) - this.buttonPrev = this.clip.after(this.options.buttonPrevHTML).next(); - - this.buttonPrev.addClass(this.className('jcarousel-prev')); - - this.clip.addClass(this.className('jcarousel-clip')).css({ - overflow: 'hidden', - position: 'relative' - }); - this.list.addClass(this.className('jcarousel-list')).css({ - overflow: 'hidden', - position: 'relative', - top: 0, - margin: 0, - padding: 0 - }).css((this.options.rtl ? 'right' : 'left'), 0); - this.container.addClass(this.className('jcarousel-container')).css({ - position: 'relative' - }); - if (!this.options.vertical && this.options.rtl) - this.container.addClass('jcarousel-direction-rtl').attr('dir', 'rtl'); - - var di = this.options.visible != null ? Math.ceil(this.clipping() / this.options.visible) : null; - var li = this.list.children('li'); - - var self = this; - - if (li.size() > 0) { - var wh = 0, i = this.options.offset; - li.each(function() { - self.format(this, i++); - wh += self.dimension(this, di); - }); - - this.list.css(this.wh, (wh + 100) + 'px'); - - // Only set if not explicitly passed as option - if (!o || o.size === undefined) - this.options.size = li.size(); - } - - // For whatever reason, .show() does not work in Safari... - this.container.css('display', 'block'); - this.buttonNext.css('display', 'block'); - this.buttonPrev.css('display', 'block'); - - this.funcNext = function() { self.next(); }; - this.funcPrev = function() { self.prev(); }; - this.funcResize = function() { self.reload(); }; - - if (this.options.initCallback != null) - this.options.initCallback(this, 'init'); - - if (!windowLoaded && $.browser.safari) { - this.buttons(false, false); - $(window).bind('load.jcarousel', function() { self.setup(); }); - } else - this.setup(); - }; - - // Create shortcut for internal use - var $jc = $.jcarousel; - - $jc.fn = $jc.prototype = { - jcarousel: '0.2.5' - }; - - $jc.fn.extend = $jc.extend = $.extend; - - $jc.fn.extend({ - /** - * Setups the carousel. - * - * @method setup - * @return undefined - */ - setup: function() { - this.first = null; - this.last = null; - this.prevFirst = null; - this.prevLast = null; - this.animating = false; - this.timer = null; - this.tail = null; - this.inTail = false; - - if (this.locked) - return; - - this.list.css(this.lt, this.pos(this.options.offset) + 'px'); - var p = this.pos(this.options.start); - this.prevFirst = this.prevLast = null; - this.animate(p, false); - - $(window).unbind('resize.jcarousel', this.funcResize).bind('resize.jcarousel', this.funcResize); - }, - - /** - * Clears the list and resets the carousel. - * - * @method reset - * @return undefined - */ - reset: function() { - this.list.empty(); - - this.list.css(this.lt, '0px'); - this.list.css(this.wh, '10px'); - - if (this.options.initCallback != null) - this.options.initCallback(this, 'reset'); - - this.setup(); - }, - - /** - * Reloads the carousel and adjusts positions. - * - * @method reload - * @return undefined - */ - reload: function() { - if (this.tail != null && this.inTail) - this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + this.tail); - - this.tail = null; - this.inTail = false; - - if (this.options.reloadCallback != null) - this.options.reloadCallback(this); - - if (this.options.visible != null) { - var self = this; - var di = Math.ceil(this.clipping() / this.options.visible), wh = 0, lt = 0; - this.list.children('li').each(function(i) { - wh += self.dimension(this, di); - if (i + 1 < self.first) - lt = wh; - }); - - this.list.css(this.wh, wh + 'px'); - this.list.css(this.lt, -lt + 'px'); - } - - this.scroll(this.first, false); - }, - - /** - * Locks the carousel. - * - * @method lock - * @return undefined - */ - lock: function() { - this.locked = true; - this.buttons(); - }, - - /** - * Unlocks the carousel. - * - * @method unlock - * @return undefined - */ - unlock: function() { - this.locked = false; - this.buttons(); - }, - - /** - * Sets the size of the carousel. - * - * @method size - * @return undefined - * @param s {Number} The size of the carousel. - */ - size: function(s) { - if (s != undefined) { - this.options.size = s; - if (!this.locked) - this.buttons(); - } - - return this.options.size; - }, - - /** - * Checks whether a list element exists for the given index (or index range). - * - * @method get - * @return bool - * @param i {Number} The index of the (first) element. - * @param i2 {Number} The index of the last element. - */ - has: function(i, i2) { - if (i2 == undefined || !i2) - i2 = i; - - if (this.options.size !== null && i2 > this.options.size) - i2 = this.options.size; - - for (var j = i; j <= i2; j++) { - var e = this.get(j); - if (!e.length || e.hasClass('jcarousel-item-placeholder')) - return false; - } - - return true; - }, - - /** - * Returns a jQuery object with list element for the given index. - * - * @method get - * @return jQuery - * @param i {Number} The index of the element. - */ - get: function(i) { - return $('.jcarousel-item-' + i, this.list); - }, - - /** - * Adds an element for the given index to the list. - * If the element already exists, it updates the inner html. - * Returns the created element as jQuery object. - * - * @method add - * @return jQuery - * @param i {Number} The index of the element. - * @param s {String} The innerHTML of the element. - */ - add: function(i, s) { - var e = this.get(i), old = 0, n = $(s); - - if (e.length == 0) { - var c, e = this.create(i), j = $jc.intval(i); - while (c = this.get(--j)) { - if (j <= 0 || c.length) { - j <= 0 ? this.list.prepend(e) : c.after(e); - break; - } - } - } else - old = this.dimension(e); - - if (n.get(0).nodeName.toUpperCase() == 'LI') { - e.replaceWith(n); - e = n; - } else - e.empty().append(s); - - this.format(e.removeClass(this.className('jcarousel-item-placeholder')), i); - - var di = this.options.visible != null ? Math.ceil(this.clipping() / this.options.visible) : null; - var wh = this.dimension(e, di) - old; - - if (i > 0 && i < this.first) - this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - wh + 'px'); - - this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) + wh + 'px'); - - return e; - }, - - /** - * Removes an element for the given index from the list. - * - * @method remove - * @return undefined - * @param i {Number} The index of the element. - */ - remove: function(i) { - var e = this.get(i); - - // Check if item exists and is not currently visible - if (!e.length || (i >= this.first && i <= this.last)) - return; - - var d = this.dimension(e); - - if (i < this.first) - this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) + d + 'px'); - - e.remove(); - - this.list.css(this.wh, $jc.intval(this.list.css(this.wh)) - d + 'px'); - }, - - /** - * Moves the carousel forwards. - * - * @method next - * @return undefined - */ - next: function() { - this.stopAuto(); - - if (this.tail != null && !this.inTail) - this.scrollTail(false); - else - this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'last') && this.options.size != null && this.last == this.options.size) ? 1 : this.first + this.options.scroll); - }, - - /** - * Moves the carousel backwards. - * - * @method prev - * @return undefined - */ - prev: function() { - this.stopAuto(); - - if (this.tail != null && this.inTail) - this.scrollTail(true); - else - this.scroll(((this.options.wrap == 'both' || this.options.wrap == 'first') && this.options.size != null && this.first == 1) ? this.options.size : this.first - this.options.scroll); - }, - - /** - * Scrolls the tail of the carousel. - * - * @method scrollTail - * @return undefined - * @param b {Boolean} Whether scroll the tail back or forward. - */ - scrollTail: function(b) { - if (this.locked || this.animating || !this.tail) - return; - - var pos = $jc.intval(this.list.css(this.lt)); - - !b ? pos -= this.tail : pos += this.tail; - this.inTail = !b; - - // Save for callbacks - this.prevFirst = this.first; - this.prevLast = this.last; - - this.animate(pos); - }, - - /** - * Scrolls the carousel to a certain position. - * - * @method scroll - * @return undefined - * @param i {Number} The index of the element to scoll to. - * @param a {Boolean} Flag indicating whether to perform animation. - */ - scroll: function(i, a) { - if (this.locked || this.animating) - return; - - this.animate(this.pos(i), a); - }, - - /** - * Prepares the carousel and return the position for a certian index. - * - * @method pos - * @return {Number} - * @param i {Number} The index of the element to scoll to. - */ - pos: function(i) { - var pos = $jc.intval(this.list.css(this.lt)); - - if (this.locked || this.animating) - return pos; - - if (this.options.wrap != 'circular') - i = i < 1 ? 1 : (this.options.size && i > this.options.size ? this.options.size : i); - - var back = this.first > i; - - // Create placeholders, new list width/height - // and new list position - var f = this.options.wrap != 'circular' && this.first <= 1 ? 1 : this.first; - var c = back ? this.get(f) : this.get(this.last); - var j = back ? f : f - 1; - var e = null, l = 0, p = false, d = 0, g; - - while (back ? --j >= i : ++j < i) { - e = this.get(j); - p = !e.length; - if (e.length == 0) { - e = this.create(j).addClass(this.className('jcarousel-item-placeholder')); - c[back ? 'before' : 'after' ](e); - - if (this.first != null && this.options.wrap == 'circular' && this.options.size !== null && (j <= 0 || j > this.options.size)) { - g = this.get(this.index(j)); - if (g.length) - e = this.add(j, g.clone(true)); - } - } - - c = e; - d = this.dimension(e); - - if (p) - l += d; - - if (this.first != null && (this.options.wrap == 'circular' || (j >= 1 && (this.options.size == null || j <= this.options.size)))) - pos = back ? pos + d : pos - d; - } - - // Calculate visible items - var clipping = this.clipping(); - var cache = []; - var visible = 0, j = i, v = 0; - var c = this.get(i - 1); - - while (++visible) { - e = this.get(j); - p = !e.length; - if (e.length == 0) { - e = this.create(j).addClass(this.className('jcarousel-item-placeholder')); - // This should only happen on a next scroll - c.length == 0 ? this.list.prepend(e) : c[back ? 'before' : 'after' ](e); - - if (this.first != null && this.options.wrap == 'circular' && this.options.size !== null && (j <= 0 || j > this.options.size)) { - g = this.get(this.index(j)); - if (g.length) - e = this.add(j, g.clone(true)); - } - } - - c = e; - var d = this.dimension(e); - if (d == 0) { - throw new Error('jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...'); - } - - if (this.options.wrap != 'circular' && this.options.size !== null && j > this.options.size) - cache.push(e); - else if (p) - l += d; - - v += d; - - if (v >= clipping) - break; - - j++; - } - - // Remove out-of-range placeholders - for (var x = 0; x < cache.length; x++) - cache[x].remove(); - - // Resize list - if (l > 0) { - this.list.css(this.wh, this.dimension(this.list) + l + 'px'); - - if (back) { - pos -= l; - this.list.css(this.lt, $jc.intval(this.list.css(this.lt)) - l + 'px'); - } - } - - // Calculate first and last item - var last = i + visible - 1; - if (this.options.wrap != 'circular' && this.options.size && last > this.options.size) - last = this.options.size; - - if (j > last) { - visible = 0, j = last, v = 0; - while (++visible) { - var e = this.get(j--); - if (!e.length) - break; - v += this.dimension(e); - if (v >= clipping) - break; - } - } - - var first = last - visible + 1; - if (this.options.wrap != 'circular' && first < 1) - first = 1; - - if (this.inTail && back) { - pos += this.tail; - this.inTail = false; - } - - this.tail = null; - if (this.options.wrap != 'circular' && last == this.options.size && (last - visible + 1) >= 1) { - var m = $jc.margin(this.get(last), !this.options.vertical ? 'marginRight' : 'marginBottom'); - if ((v - m) > clipping) - this.tail = v - clipping - m; - } - - // Adjust position - while (i-- > first) - pos += this.dimension(this.get(i)); - - // Save visible item range - this.prevFirst = this.first; - this.prevLast = this.last; - this.first = first; - this.last = last; - - return pos; - }, - - /** - * Animates the carousel to a certain position. - * - * @method animate - * @return undefined - * @param p {Number} Position to scroll to. - * @param a {Boolean} Flag indicating whether to perform animation. - */ - animate: function(p, a) { - if (this.locked || this.animating) - return; - - this.animating = true; - - var self = this; - var scrolled = function() { - self.animating = false; - - if (p == 0) - self.list.css(self.lt, 0); - - if (self.options.wrap == 'circular' || self.options.wrap == 'both' || self.options.wrap == 'last' || self.options.size == null || self.last < self.options.size) - self.startAuto(); - - self.buttons(); - self.notify('onAfterAnimation'); - - // This function removes items which are appended automatically for circulation. - // This prevents the list from growing infinitely. - if (self.options.wrap == 'circular' && self.options.size !== null) - for (var i = self.prevFirst; i <= self.prevLast; i++) - if (i !== null && !(i >= self.first && i <= self.last) && (i < 1 || i > self.options.size)) - self.remove(i); - }; - - this.notify('onBeforeAnimation'); - - // Animate - if (!this.options.animation || a == false) { - this.list.css(this.lt, p + 'px'); - scrolled(); - } else { - var o = !this.options.vertical ? (this.options.rtl ? {'right': p} : {'left': p}) : {'top': p}; - this.list.animate(o, this.options.animation, this.options.easing, scrolled); - } - }, - - /** - * Starts autoscrolling. - * - * @method auto - * @return undefined - * @param s {Number} Seconds to periodically autoscroll the content. - */ - startAuto: function(s) { - if (s != undefined) - this.options.auto = s; - - if (this.options.auto == 0) - return this.stopAuto(); - - if (this.timer != null) - return; - - var self = this; - this.timer = setTimeout(function() { self.next(); }, this.options.auto * 1000); - }, - - /** - * Stops autoscrolling. - * - * @method stopAuto - * @return undefined - */ - stopAuto: function() { - if (this.timer == null) - return; - - clearTimeout(this.timer); - this.timer = null; - }, - - /** - * Sets the states of the prev/next buttons. - * - * @method buttons - * @return undefined - */ - buttons: function(n, p) { - if (n == undefined || n == null) { - var n = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'first') || this.options.size == null || this.last < this.options.size); - if (!this.locked && (!this.options.wrap || this.options.wrap == 'first') && this.options.size != null && this.last >= this.options.size) - n = this.tail != null && !this.inTail; - } - - if (p == undefined || p == null) { - var p = !this.locked && this.options.size !== 0 && ((this.options.wrap && this.options.wrap != 'last') || this.first > 1); - if (!this.locked && (!this.options.wrap || this.options.wrap == 'last') && this.options.size != null && this.first == 1) - p = this.tail != null && this.inTail; - } - - var self = this; - - this.buttonNext[n ? 'bind' : 'unbind'](this.options.buttonNextEvent + '.jcarousel', this.funcNext)[n ? 'removeClass' : 'addClass'](this.className('jcarousel-next-disabled')).attr('disabled', n ? false : true); - this.buttonPrev[p ? 'bind' : 'unbind'](this.options.buttonPrevEvent + '.jcarousel', this.funcPrev)[p ? 'removeClass' : 'addClass'](this.className('jcarousel-prev-disabled')).attr('disabled', p ? false : true); - - if (this.options.buttonNextCallback != null && this.buttonNext.data('jcarouselstate') != n) { - this.buttonNext.each(function() { self.options.buttonNextCallback(self, this, n); }).data('jcarouselstate', n); - } - - if (this.options.buttonPrevCallback != null && (this.buttonPrev.data('jcarouselstate') != p)) { - this.buttonPrev.each(function() { self.options.buttonPrevCallback(self, this, p); }).data('jcarouselstate', p); - } - }, - - /** - * Notify callback of a specified event. - * - * @method notify - * @return undefined - * @param evt {String} The event name - */ - notify: function(evt) { - var state = this.prevFirst == null ? 'init' : (this.prevFirst < this.first ? 'next' : 'prev'); - - // Load items - this.callback('itemLoadCallback', evt, state); - - if (this.prevFirst !== this.first) { - this.callback('itemFirstInCallback', evt, state, this.first); - this.callback('itemFirstOutCallback', evt, state, this.prevFirst); - } - - if (this.prevLast !== this.last) { - this.callback('itemLastInCallback', evt, state, this.last); - this.callback('itemLastOutCallback', evt, state, this.prevLast); - } - - this.callback('itemVisibleInCallback', evt, state, this.first, this.last, this.prevFirst, this.prevLast); - this.callback('itemVisibleOutCallback', evt, state, this.prevFirst, this.prevLast, this.first, this.last); - }, - - callback: function(cb, evt, state, i1, i2, i3, i4) { - if (this.options[cb] == undefined || (typeof this.options[cb] != 'object' && evt != 'onAfterAnimation')) - return; - - var callback = typeof this.options[cb] == 'object' ? this.options[cb][evt] : this.options[cb]; - - if (!$.isFunction(callback)) - return; - - var self = this; - - if (i1 === undefined) - callback(self, state, evt); - else if (i2 === undefined) - this.get(i1).each(function() { callback(self, this, i1, state, evt); }); - else { - for (var i = i1; i <= i2; i++) - if (i !== null && !(i >= i3 && i <= i4)) - this.get(i).each(function() { callback(self, this, i, state, evt); }); - } - }, - - create: function(i) { - return this.format('
    • ', i); - }, - - format: function(e, i) { - var e = $(e), split = e.get(0).className.split(' '); - for (var j = 0; j < split.length; j++) { - if (split[j].indexOf('jcarousel-') != -1) { - e.removeClass(split[j]); - } - } - e.addClass(this.className('jcarousel-item')).addClass(this.className('jcarousel-item-' + i)).css({ - 'float': (this.options.rtl ? 'right' : 'left'), - 'list-style': 'none' - }).attr('jcarouselindex', i); - return e; - }, - - className: function(c) { - return c + ' ' + c + (!this.options.vertical ? '-horizontal' : '-vertical'); - }, - - dimension: function(e, d) { - var el = e.jquery != undefined ? e[0] : e; - - var old = !this.options.vertical ? - (el.offsetWidth || $jc.intval(this.options.itemFallbackDimension)) + $jc.margin(el, 'marginLeft') + $jc.margin(el, 'marginRight') : - (el.offsetHeight || $jc.intval(this.options.itemFallbackDimension)) + $jc.margin(el, 'marginTop') + $jc.margin(el, 'marginBottom'); - - if (d == undefined || old == d) - return old; - - var w = !this.options.vertical ? - d - $jc.margin(el, 'marginLeft') - $jc.margin(el, 'marginRight') : - d - $jc.margin(el, 'marginTop') - $jc.margin(el, 'marginBottom'); - - $(el).css(this.wh, w + 'px'); - - return this.dimension(el); - }, - - clipping: function() { - return !this.options.vertical ? - this.clip[0].offsetWidth - $jc.intval(this.clip.css('borderLeftWidth')) - $jc.intval(this.clip.css('borderRightWidth')) : - this.clip[0].offsetHeight - $jc.intval(this.clip.css('borderTopWidth')) - $jc.intval(this.clip.css('borderBottomWidth')); - }, - - index: function(i, s) { - if (s == undefined) - s = this.options.size; - - return Math.round((((i-1) / s) - Math.floor((i-1) / s)) * s) + 1; - } - }); - - $jc.extend({ - /** - * Gets/Sets the global default configuration properties. - * - * @method defaults - * @return {Object} - * @param d {Object} A set of key/value pairs to set as configuration properties. - */ - defaults: function(d) { - return $.extend(defaults, d || {}); - }, - - margin: function(e, p) { - if (!e) - return 0; - - var el = e.jquery != undefined ? e[0] : e; - - if (p == 'marginRight' && $.browser.safari) { - var old = {'display': 'block', 'float': 'none', 'width': 'auto'}, oWidth, oWidth2; - - $.swap(el, old, function() { oWidth = el.offsetWidth; }); - - old['marginRight'] = 0; - $.swap(el, old, function() { oWidth2 = el.offsetWidth; }); - - return oWidth2 - oWidth; - } - - return $jc.intval($.css(el, p)); - }, - - intval: function(v) { - v = parseInt(v); - return isNaN(v) ? 0 : v; - } - }); - -})(jQuery); diff --git a/3.1/modules/navcarousel/js/jquery.jcarousel.min.js b/3.1/modules/navcarousel/js/jquery.jcarousel.min.js deleted file mode 100644 index 0b8313ad..00000000 --- a/3.1/modules/navcarousel/js/jquery.jcarousel.min.js +++ /dev/null @@ -1,16 +0,0 @@ -/*! - * jCarousel - Riding carousels with jQuery - * http://sorgalla.com/jcarousel/ - * - * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com) - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. - * - * Built on top of the jQuery library - * http://jquery.com - * - * Inspired by the "Carousel Component" by Bill Scott - * http://billwscott.com/carousel/ - */ - -(function(i){i.fn.jcarousel=function(a){if(typeof a=="string"){var c=i(this).data("jcarousel"),b=Array.prototype.slice.call(arguments,1);return c[a].apply(c,b)}else return this.each(function(){i(this).data("jcarousel",new h(this,a))})};var p={vertical:false,rtl:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null, itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,buttonNextHTML:"
      ",buttonPrevHTML:"
      ",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null,itemFallbackDimension:null},q=false;i(window).bind("load.jcarousel",function(){q=true});i.jcarousel=function(a,c){this.options=i.extend({},p,c||{});this.locked=false;this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!c||c.rtl===undefined)this.options.rtl= (i(a).attr("dir")||i("html").attr("dir")||"").toLowerCase()=="rtl";this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?this.options.rtl?"right":"left":"top";for(var b="",d=a.className.split(" "),e=0;e
      ");this.container=this.container.parent()}else if(!this.container.hasClass("jcarousel-container"))this.container=this.list.wrap("
      ").parent()}else{this.container=i(a);this.list=this.container.find("ul,ol").eq(0)}b!=""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1&&this.container.wrap('
      ');this.clip=this.list.parent();if(!this.clip.length||!this.clip.hasClass("jcarousel-clip"))this.clip=this.list.wrap("
      ").parent(); this.buttonNext=i(".jcarousel-next",this.container);if(this.buttonNext.size()==0&&this.options.buttonNextHTML!=null)this.buttonNext=this.clip.after(this.options.buttonNextHTML).next();this.buttonNext.addClass(this.className("jcarousel-next"));this.buttonPrev=i(".jcarousel-prev",this.container);if(this.buttonPrev.size()==0&&this.options.buttonPrevHTML!=null)this.buttonPrev=this.clip.after(this.options.buttonPrevHTML).next();this.buttonPrev.addClass(this.className("jcarousel-prev"));this.clip.addClass(this.className("jcarousel-clip")).css({overflow:"hidden", position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden",position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"});!this.options.vertical&&this.options.rtl&&this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl");var f=this.options.visible!=null?Math.ceil(this.clipping()/this.options.visible):null;b=this.list.children("li");var g= this;if(b.size()>0){var j=0;e=this.options.offset;b.each(function(){g.format(this,e++);j+=g.dimension(this,f)});this.list.css(this.wh,j+100+"px");if(!c||c.size===undefined)this.options.size=b.size()}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){g.next()};this.funcPrev=function(){g.prev()};this.funcResize=function(){g.reload()};this.options.initCallback!=null&&this.options.initCallback(this,"init");if(!q&& i.browser.safari){this.buttons(false,false);i(window).bind("load.jcarousel",function(){g.setup()})}else this.setup()};var h=i.jcarousel;h.fn=h.prototype={jcarousel:"0.2.5"};h.fn.extend=h.extend=i.extend;h.fn.extend({setup:function(){this.prevLast=this.prevFirst=this.last=this.first=null;this.animating=false;this.tail=this.timer=null;this.inTail=false;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var a=this.pos(this.options.start);this.prevFirst=this.prevLast=null;this.animate(a, false);i(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize)}},reset:function(){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");this.options.initCallback!=null&&this.options.initCallback(this,"reset");this.setup()},reload:function(){this.tail!=null&&this.inTail&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=false;this.options.reloadCallback!=null&&this.options.reloadCallback(this);if(this.options.visible!= null){var a=this,c=Math.ceil(this.clipping()/this.options.visible),b=0,d=0;this.list.children("li").each(function(e){b+=a.dimension(this,c);if(e+1this.options.size)c=this.options.size;for(var b=a;b<=c;b++){var d=this.get(b);if(!d.length||d.hasClass("jcarousel-item-placeholder"))return false}return true},get:function(a){return i(".jcarousel-item-"+a,this.list)},add:function(a,c){var b=this.get(a),d=0,e=i(c);if(b.length==0){var f;b=this.create(a);for(var g=h.intval(a);f=this.get(--g);)if(g<=0||f.length){g<=0?this.list.prepend(b):f.after(b);break}}else d=this.dimension(b);if(e.get(0).nodeName.toUpperCase()=="LI"){b.replaceWith(e); b=e}else b.empty().append(c);this.format(b.removeClass(this.className("jcarousel-item-placeholder")),a);e=this.options.visible!=null?Math.ceil(this.clipping()/this.options.visible):null;d=this.dimension(b,e)-d;a>0&&a=this.first&&a<=this.last)){var b=this.dimension(c);athis.options.size?this.options.size:a;for(var b=this.first>a,d=this.options.wrap!="circular"&&this.first<=1?1:this.first,e=b?this.get(d):this.get(this.last),f=b?d:d-1,g=null,j=0,l=false,k=0;b?--f>=a:++fthis.options.size)){e=this.get(this.index(f)); if(e.length)g=this.add(f,e.clone(true))}}e=g;k=this.dimension(g);if(l)j+=k;if(this.first!=null&&(this.options.wrap=="circular"||f>=1&&(this.options.size==null||f<=this.options.size)))c=b?c+k:c-k}d=this.clipping();var o=[],n=0;f=a;var m=0;for(e=this.get(a-1);++n;){g=this.get(f);l=!g.length;if(g.length==0){g=this.create(f).addClass(this.className("jcarousel-item-placeholder"));e.length==0?this.list.prepend(g):e[b?"before":"after"](g);if(this.first!=null&&this.options.wrap=="circular"&&this.options.size!== null&&(f<=0||f>this.options.size)){e=this.get(this.index(f));if(e.length)g=this.add(f,e.clone(true))}}e=g;k=this.dimension(g);if(k==0)throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...");if(this.options.wrap!="circular"&&this.options.size!==null&&f>this.options.size)o.push(g);else if(l)j+=k;m+=k;if(m>=d)break;f++}for(g=0;g0){this.list.css(this.wh,this.dimension(this.list)+j+"px");if(b){c-=j;this.list.css(this.lt,h.intval(this.list.css(this.lt))- j+"px")}}j=a+n-1;if(this.options.wrap!="circular"&&this.options.size&&j>this.options.size)j=this.options.size;if(f>j){n=0;f=j;for(m=0;++n;){g=this.get(f--);if(!g.length)break;m+=this.dimension(g);if(m>=d)break}}f=j-n+1;if(this.options.wrap!="circular"&&f<1)f=1;if(this.inTail&&b){c+=this.tail;this.inTail=false}this.tail=null;if(this.options.wrap!="circular"&&j==this.options.size&&j-n+1>=1){b=h.margin(this.get(j),!this.options.vertical?"marginRight":"marginBottom");if(m-b>d)this.tail=m-d-b}for(;a-- > f;)c+=this.dimension(this.get(a));this.prevFirst=this.first;this.prevLast=this.last;this.first=f;this.last=j;return c},animate:function(a,c){if(!(this.locked||this.animating)){this.animating=true;var b=this,d=function(){b.animating=false;a==0&&b.list.css(b.lt,0);if(b.options.wrap=="circular"||b.options.wrap=="both"||b.options.wrap=="last"||b.options.size==null||b.last=b.first&&e<=b.last)&&(e<1||e>b.options.size))b.remove(e)};this.notify("onBeforeAnimation");if(!this.options.animation||c==false){this.list.css(this.lt,a+"px");d()}else this.list.animate(!this.options.vertical?this.options.rtl?{right:a}:{left:a}:{top:a},this.options.animation,this.options.easing,d)}},startAuto:function(a){if(a!=undefined)this.options.auto=a;if(this.options.auto==0)return this.stopAuto();if(this.timer==null){var c=this;this.timer=setTimeout(function(){c.next()}, this.options.auto*1E3)}},stopAuto:function(){if(this.timer!=null){clearTimeout(this.timer);this.timer=null}},buttons:function(a,c){if(a==undefined||a==null){a=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="first"||this.options.size==null||this.last=this.options.size)a=this.tail!=null&&!this.inTail}if(c==undefined||c==null){c=!this.locked&&this.options.size!== 0&&(this.options.wrap&&this.options.wrap!="last"||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!=null&&this.first==1)c=this.tail!=null&&this.inTail}var b=this;this.buttonNext[a?"bind":"unbind"](this.options.buttonNextEvent+".jcarousel",this.funcNext)[a?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",a?false:true);this.buttonPrev[c?"bind":"unbind"](this.options.buttonPrevEvent+".jcarousel",this.funcPrev)[c?"removeClass": "addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",c?false:true);this.options.buttonNextCallback!=null&&this.buttonNext.data("jcarouselstate")!=a&&this.buttonNext.each(function(){b.options.buttonNextCallback(b,this,a)}).data("jcarouselstate",a);this.options.buttonPrevCallback!=null&&this.buttonPrev.data("jcarouselstate")!=c&&this.buttonPrev.each(function(){b.options.buttonPrevCallback(b,this,c)}).data("jcarouselstate",c)},notify:function(a){var c=this.prevFirst==null?"init":this.prevFirst< this.first?"next":"prev";this.callback("itemLoadCallback",a,c);if(this.prevFirst!==this.first){this.callback("itemFirstInCallback",a,c,this.first);this.callback("itemFirstOutCallback",a,c,this.prevFirst)}if(this.prevLast!==this.last){this.callback("itemLastInCallback",a,c,this.last);this.callback("itemLastOutCallback",a,c,this.prevLast)}this.callback("itemVisibleInCallback",a,c,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",a,c,this.prevFirst,this.prevLast, this.first,this.last)},callback:function(a,c,b,d,e,f,g){if(!(this.options[a]==undefined||typeof this.options[a]!="object"&&c!="onAfterAnimation")){var j=typeof this.options[a]=="object"?this.options[a][c]:this.options[a];if(i.isFunction(j)){var l=this;if(d===undefined)j(l,b,c);else if(e===undefined)this.get(d).each(function(){j(l,this,d,b,c)});else for(var k=d;k<=e;k++)k!==null&&!(k>=f&&k<=g)&&this.get(k).each(function(){j(l,this,k,b,c)})}}},create:function(a){return this.format("
    • ",a)},format:function(a, c){a=i(a);for(var b=a.get(0).className.split(" "),d=0;d - -
      -

      -

      -

      - If you are experiencing this bug then please enable the option 'Disable dynamic loading of thumbnails'.
      - I am working on fixing this bug and will release an update as soon as possible.") ?>

      - -
      diff --git a/3.1/modules/navcarousel/views/navcarousel.html.php b/3.1/modules/navcarousel/views/navcarousel.html.php deleted file mode 100644 index 40af0d8e..00000000 --- a/3.1/modules/navcarousel/views/navcarousel.html.php +++ /dev/null @@ -1,118 +0,0 @@ -parent(); - $item_counter = 0; - $item_offset = 0; - $maintain_aspect = module::get_var("navcarousel", "maintainaspect", false); - $no_resize = module::get_var("navcarousel", "noresize", false); - $no_ajax = module::get_var("navcarousel", "noajax", false); -?> - - -remove("home"); - } -} diff --git a/3.1/modules/no_home_link/module.info b/3.1/modules/no_home_link/module.info deleted file mode 100644 index fc3aa1db..00000000 --- a/3.1/modules/no_home_link/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "No Home Link" -description = "Gets rid of the 'Home' link in the menu." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:no_home_link" -discuss_url = "http://gallery.menalto.com/forum_module_no_home_link" diff --git a/3.1/modules/nobots/helpers/nobots_theme.php b/3.1/modules/nobots/helpers/nobots_theme.php deleted file mode 100644 index 122cfa00..00000000 --- a/3.1/modules/nobots/helpers/nobots_theme.php +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - diff --git a/3.1/modules/noffmpeg/helpers/movie.php b/3.1/modules/noffmpeg/helpers/movie.php deleted file mode 100644 index 99308994..00000000 --- a/3.1/modules/noffmpeg/helpers/movie.php +++ /dev/null @@ -1,147 +0,0 @@ -id", "", "post", array("id" => "g-edit-movie-form")); - $form->hidden("from_id")->value($movie->id); - $group = $form->group("edit_item")->label(t("Edit Movie")); - $group->input("title")->label(t("Title"))->value($movie->title) - ->error_messages("required", t("You must provide a title")) - ->error_messages("length", t("Your title is too long")); - $group->textarea("description")->label(t("Description"))->value($movie->description); - $group->input("name")->label(t("Filename"))->value($movie->name) - ->error_messages( - "conflict", t("There is already a movie, photo or album with this name")) - ->error_messages("no_slashes", t("The movie name can't contain a \"/\"")) - ->error_messages("no_trailing_period", t("The movie name can't end in \".\"")) - ->error_messages("illegal_data_file_extension", t("You cannot change the movie file extension")) - ->error_messages("required", t("You must provide a movie file name")) - ->error_messages("length", t("Your movie file name is too long")); - $group->input("slug")->label(t("Internet Address"))->value($movie->slug) - ->error_messages( - "conflict", t("There is already a movie, photo or album with this internet address")) - ->error_messages( - "not_url_safe", - t("The internet address should contain only letters, numbers, hyphens and underscores")) - ->error_messages("required", t("You must provide an internet address")) - ->error_messages("length", t("Your internet address is too long")); - - module::event("item_edit_form", $movie, $form); - - $group = $form->group("buttons")->label(""); - $group->submit("")->value(t("Modify")); - - return $form; - } - - static function extract_frame($input_file, $output_file) { - $ffmpeg = movie::find_ffmpeg(); - if (empty($ffmpeg)) { - // BEGIN rWatcher Edit. - copy(MODPATH . "noffmpeg/images/missing_movie.png", $output_file); - //throw new Exception("@todo MISSING_FFMPEG"); - // END rWatcher Edit. - } - - $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($input_file) . - " -an -ss 00:00:03 -an -r 1 -vframes 1" . - " -y -f mjpeg " . escapeshellarg($output_file) . " 2>&1"; - exec($cmd); - - clearstatcache(); // use $filename parameter when PHP_version is 5.3+ - if (filesize($output_file) == 0) { - // Maybe the movie is shorter, fall back to the first frame. - $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($input_file) . - " -an -an -r 1 -vframes 1" . - " -y -f mjpeg " . escapeshellarg($output_file) . " 2>&1"; - exec($cmd); - - clearstatcache(); - if (filesize($output_file) == 0) { - throw new Exception("@todo FFMPEG_FAILED"); - } - } - } - - /** - * Return the path to the ffmpeg binary if one exists and is executable, or null. - */ - static function find_ffmpeg() { - if (!($ffmpeg_path = module::get_var("gallery", "ffmpeg_path")) || !file_exists($ffmpeg_path)) { - $ffmpeg_path = system::find_binary( - "ffmpeg", module::get_var("gallery", "graphics_toolkit_path")); - module::set_var("gallery", "ffmpeg_path", $ffmpeg_path); - } - return $ffmpeg_path; - } - - /** - * Return the width, height, mime_type and extension of the given movie file. - */ - static function get_file_metadata($file_path) { - $ffmpeg = movie::find_ffmpeg(); - if (empty($ffmpeg)) { - // BEGIN rWatcher Edit. - $pi = pathinfo($file_path); - $extension = isset($pi["extension"]) ? $pi["extension"] : "flv"; // No extension? Assume FLV. - $mime_type = in_array(strtolower($extension), array("mp4", "m4v")) ? - "video/mp4" : "video/x-flv"; - $vid_width = 320; - $vid_height = 240; - if (strtolower($extension) == "flv") { - $flvinfo = new FLVMetaData($file_path); - $info = $flvinfo->getMetaData(); - if (($info["width"] != "") && ($info["height"] != "")) { - $vid_width = $info["width"]; - $vid_height = $info["height"]; - } - } - return array($vid_width, $vid_height, $mime_type, $extension); - //throw new Exception("@todo MISSING_FFMPEG"); - // END rWatcher Edit. - } - - $cmd = escapeshellcmd($ffmpeg) . " -i " . escapeshellarg($file_path) . " 2>&1"; - $result = `$cmd`; - if (preg_match("/Stream.*?Video:.*?(\d+)x(\d+)/", $result, $regs)) { - list ($width, $height) = array($regs[1], $regs[2]); - } else { - list ($width, $height) = array(0, 0); - } - - $pi = pathinfo($file_path); - $extension = isset($pi["extension"]) ? $pi["extension"] : "flv"; // No extension? Assume FLV. - $mime_type = in_array(strtolower($extension), array("mp4", "m4v")) ? - "video/mp4" : "video/x-flv"; - - return array($width, $height, $mime_type, $extension); - } - -} \ No newline at end of file diff --git a/3.1/modules/noffmpeg/images/missing_movie.png b/3.1/modules/noffmpeg/images/missing_movie.png deleted file mode 100644 index fdc97779..00000000 Binary files a/3.1/modules/noffmpeg/images/missing_movie.png and /dev/null differ diff --git a/3.1/modules/noffmpeg/libraries/FLVMetaData.php b/3.1/modules/noffmpeg/libraries/FLVMetaData.php deleted file mode 100644 index bfd8e435..00000000 --- a/3.1/modules/noffmpeg/libraries/FLVMetaData.php +++ /dev/null @@ -1,194 +0,0 @@ -. - * - * @author Amin Saeedi, - * @copyright Copyright (c) 2009, Amin Saeedi - * @version 1.0 - * - */ -class FLVMetaData { - private $buffer; - private $metaData; - private $fileName; - private $typeFlagsAudio; - private $typeFlagsVideo; - - public $VCidMap = array( - 2=>"Sorenson H.263", - 3=>"Screen Video", - 4=>"VP6", - 5=>"VP6 with Alpha channel", - ); //Video Codec ID(s) - - public $ACidMap = array( - "Linear PCM, platform endian", - "ADPCM", - "MP3", - "Linear PCM, little endian", - "Nellymoser 16-kHz Mono", - "Nellymoser 8-kHz Mono", - "Nellymoser", - "G.711 A-law logarithmic PCM", - "G.711 mu-law logarithmic PCM", - "reserved", - "AAC", - "Speex", - 14=>"MP3 8-Khz", - 15=>"Device-specific sound" - ); //Audio Codec ID(s) - -/** - * CONSTRUCTOR : initialize class members - * - * @param string $flv : flv file path - */ - public function __construct($flv) { - $this->fileName = $flv; - $this->metaData = array( - "duration"=>null, - "size"=>null, - "framerate"=>null, - "width"=>null, - "height"=>null, - "videodatarate"=>null, - "audiodatarate"=>null, - "audiodelay"=>null, - "audiosamplesize"=>null, - "audiosamplerate"=>null, - "audiocodecid"=>null, - "videocodecid"=>null, - "version"=>null, - "headersize"=>0 - ); - } - -/** - * Gets metadata of FLV file - * - * @return array $this->metaData : matadata of FLV - */ - public function getMetaData(){ - if(!file_exists($this->fileName)){ - echo "Error! {$this->fileName} does not exist.
      "; - return false; - } - if(!is_readable($this->fileName)){ - echo "Error! Could not read the file. Check the file permissions.
      "; - return false; - } - $f = @fopen($this->fileName,"rb"); - if(!$f){ - echo "Unknown Error! Could not read the file.
      "; - return; - } - $signature = fread($f,3); - if($signature != "FLV"){ - echo "Error! Wrong file format."; - return false; - } - $this->metaData["version"] = ord(fread($f,1)); - $this->metaData["size"] = filesize($this->fileName); - - $flags = ord(fread($f,1)); - $flags = sprintf("%'04b", $flags); - $this->typeFlagsAudio = substr($flags, 1, 1); - $this->typeFlagsVideo = substr($flags, 3, 1); - - for ($i=0; $i < 4; $i++) { - $this->metaData["headersize"] += ord(fread($f,1)) ; - } - - $this->buffer = fread($f, 400); - fclose($f); - if(strpos($this->buffer, "onMetaData") === false){ - echo "Error! No MetaData Exists."; - return false; - } - - foreach($this->metaData as $k=>$v){ - $this->parseBuffer($k); - } - return $this->metaData; - } - -/** - * Takes a field name of metadata, retrieve it's value and set it in $this->metaData - * - * @param string $fieldName : matadata field name - */ - private function parseBuffer($fieldName){ - $fieldPos = strpos($this->buffer, $fieldName); //get the field position - if($fieldPos !== false){ - $pos = $fieldPos + strlen($fieldName) + 1; - $buffer = substr($this->buffer,$pos); - - $d = ""; - for($i=0; $i < 8;$i++){ - $d .= sprintf("%08b", ord(substr($buffer,$i,1))); - } - - $total = self::bin2Double($d); - $this->metaData[$fieldName] = $total; - } - } - -/** - * Calculates double-precision value of given binary string - * (IEEE Standard 754 - Floating Point Numbers) - * - * @param string binary data $strBin - * @return Float calculated double-precision number - */ - public static function bin2Double($strBin){ - $sb = substr($strBin, 0, 1); // first bit is sign bit - $exponent = substr($strBin, 1, 11); // 11 bits exponent - $fraction = "1".substr($strBin, 12, 52); //52 bits fraction (1.F) - - $s = pow(-1, bindec($sb)); - $dec = pow(2, (bindec($exponent) - 1023)); //Decode exponent - - if($dec == 2047){ - if($fraction == 0){ - if($s==0){ - echo "Infinity"; - }else{ - echo "-Infinity"; - } - }else{ - echo "NaN"; - } - } - - if($dec > 0 && $dec < 2047){ - $t = 1; - for($i=1 ; $i <= 53; $i++){ - $t += ((int)substr($fraction, $i, 1)) * pow(2, -$i); //decode significand - } - $total = $s * $t * $dec ; - return $total; - } - return false; - } -} -?> diff --git a/3.1/modules/noffmpeg/module.info b/3.1/modules/noffmpeg/module.info deleted file mode 100644 index fe6b0ec3..00000000 --- a/3.1/modules/noffmpeg/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "NoFFMPEG" -description = "Allow video uploads on systems without FFMPEG." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:noffmpeg" -discuss_url = "http://gallery.menalto.com/forum_module_noffmpeg" diff --git a/3.1/modules/noffmpeg/views/form_uploadify.html.php b/3.1/modules/noffmpeg/views/form_uploadify.html.php deleted file mode 100644 index 911e02d5..00000000 --- a/3.1/modules/noffmpeg/views/form_uploadify.html.php +++ /dev/null @@ -1,164 +0,0 @@ - - - - - -
      - admin && !$movies_allowed)): ?> -
      - -

      - suhosin.session.encrypt setting from Suhosin. You must disable this setting to upload photos.", - array("encrypt_url" => "http://www.hardened-php.net/suhosin/configuration.html#suhosin.session.encrypt", - "suhosin_url" => "http://www.hardened-php.net/suhosin/")) ?> -

      - - - admin && !$movies_allowed): ?> -

      - ffmpeg on your system. Movie uploading disabled. Help!", array("help_url" => "http://codex.gallery2.org/Gallery3:FAQ#Why_does_it_say_I.27m_missing_ffmpeg.3F")) ?> -

      - -
      - - -
      -

      - -

      -
        - parents() as $i => $parent): ?> - > title) ?> - -
      • title) ?>
      • -
      -
      - -
      - - -
      -
      -
        -
      -
      -
      - - \ No newline at end of file diff --git a/3.1/modules/pam/LICENSE b/3.1/modules/pam/LICENSE deleted file mode 100755 index 3912109b..00000000 --- a/3.1/modules/pam/LICENSE +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/3.1/modules/pam/README b/3.1/modules/pam/README deleted file mode 100644 index b88adde4..00000000 --- a/3.1/modules/pam/README +++ /dev/null @@ -1,82 +0,0 @@ -Gallery3 PAM version 0.1 released 2010-08-12 - -ABOUT - Allows users to login by using external authentication methods. - - Note: I chose not to use the existing LDAP module because it did not allow me - to use both local Gallery accounts along with the LDAP accounts. - - This module replaces the default login link on the user_menu_login. This - works for the ajax login but to use the html you need to go to /pam ... I do - not know enough about kohana to know how to use the /login url without - removing the gallery/controller/login.php file. - -INSTALLATION - Copy the pam folder to the gallery3 modules folder. - -CONFIGURATION - Add plugins to the plugin folder to enable alternative authentication methods. - - Edit the config/config.php file to override defaults. - - $plugin_path = ''; - The default path is pam/plugins. You can put them anywhere and use this to set - the absolute path. - - $plugins = array('gallery'); - By default the plugin folder is scanned and whatever folders are found are - added to the plugin array. By using this setting you can specify what - plugins to include and in what order they will be used. - - $create_account = true; - By default this is set to false. Set this to true if you want to - automatically create accounts. This assumes the plugin will have a - getAccount() method that will return at the very least: name,full_name,email - - Note: - Two plugins are included in the pam_plugin folder. Copy a plugin to the - plugin folder to make it available to the PAM module. - - mock: will authenticate any matching name/password pair. ex. user/user and if - $create_account is true then an account will be created using the name. The - fullname will be "Mock {the name used}" and the email will be set to "{the - name used}@email.com" - - ad: this is a plugin to authenticate a user via an Active Directory domain - controller. It uses the class adLDAP (http://adldap.sourceforge.net/) and - assumes that your PHP environment has the LDAP exensions loaded. This - plugin has included the adLDAP class version 2.1. I've not tested with later - versions. - -USE - Login as admin and go to the Gallery Modules page. Check the PAM module and - update. The PAM module will replace the "Login" link so that the PAM module - will be used instead of the core Login. - - By default the "gallery" plugin is in the plugin folder. This allows - authentication via the core identity. You should be able to logout and then - login again. - -PROBLEMS - If you are not able to login just remove the PAM folder from the modules and - refresh your page. Or you can go to the default login by going to {your site - url}/login. - - Submit an issue at http://github.com/jimsloan/gallery3-pam/issues or email - me. - -FUTURE - I will be adding a OpenID plugin soon. - - By using the Mock plugin as an example you should be able to create a - connector/plugin to any existing database or web service that will - authenticate user credentials. - -AUTHOR - Jim Sloan (jsloan.email@gmail.com) - -PROJECT HOME - http://github.com/jimsloan/gallery3-pam - -LICENSE - see LICENSE diff --git a/3.1/modules/pam/config/config.php b/3.1/modules/pam/config/config.php deleted file mode 100644 index de40e6e3..00000000 --- a/3.1/modules/pam/config/config.php +++ /dev/null @@ -1,16 +0,0 @@ -_setup(); - } - - /** - * default action for the pam controller - */ - public function index() { - $view = new Theme_View("page.html", "other", "login"); - $view->page_title = t("Login"); - $view->content = auth::get_login_form("pam/auth_html"); - print $view; - } - - /** - * process login form - */ - public function auth_html() { - access::verify_csrf(); - - list ($valid, $form) = $this->_auth("pam/auth__html"); - if ($valid) { - $continue_url = $form->continue_url->value; - url::redirect($continue_url ? $continue_url : item::root()->abs_url()); - } else { - $view = new Theme_View("page.html", "other", "login"); - $view->page_title = t("Log in to Gallery"); - $view->content = new View("auth_ajax.html"); - $view->content->form = $form; - print $view; - } - } - - /** - * display the login form via ajax - */ - public function ajax() { - $view = new View("pam_ajax.html"); - $view->form = auth::get_login_form("pam/auth_ajax"); - print $view; - } - - /** - * process login form via ajax - */ - public function auth_ajax() { - access::verify_csrf(); - - list ($valid, $form) = $this->_auth("pam/auth_ajax"); - if ($valid) { - print json_encode( - array("result" => "success")); - } else { - print json_encode(array("result" => "error", "form" => (string) $form)); - } - } - - - /** - * authenticate the user - * - * @param string $url - * @return boolean - */ - private function _auth($url) { - $form = auth::get_login_form($url); - $validform = $form->validate(); - $valid = false; - - if ($validform) { - - // retrieve the values from the form - $name = $form->login->inputs["name"]->value; - $pass = $form->login->password->value; - - // do we have a user? - $user = identity::lookup_user_by_name($name); - $validuser = empty($user)?false:true; - - // is the user authentic? - $checkpass = $this->_checkpass($name,$pass); - - /* - * we are concerned with these three possibilities: - * 1. there is no valid user or no valid password - * 2. there is no valid user but a valid password - * 3. there is a valid user and a valid password - */ - - // 1. there is no valid user or no valid password: error - if (!$validuser || !$checkpass) { - $form->login->inputs["name"]->add_error("invalid_login", 1); - $name = $form->login->inputs["name"]->value; - log::warning("user", t("Failed login for %name", array("name" => $name))); - module::event("user_auth_failed", $name); - } - - // 2. there is no valid user but a valid password: create account if allowed - if (!$validuser && $checkpass && $this->create_account) { - $account = $this->pam_auth->getAccount(); - if ($account){ - $password = md5(uniqid(mt_rand(), true)); - $new_user = identity::create_user($account->name, $account->full_name, $password, $account->email); - $new_user->url = ''; - $new_user->admin = false; - $new_user->guest = false; - $new_user->save(); - $user = identity::lookup_user_by_name($account->name); - $validuser = empty($user)?false:true; - } - } - - // 3. there is a valid user and a valid password: load user account - if ($validuser && $checkpass) { - auth::login($user); - $valid = true; - } - } - - // regenerate the session id to avoid session trapping - Session::instance()->regenerate(); - - return array($valid, $form); - } - - /** - * check the login name/pass pair against registered services - * - * @param string $name - * @param string $pass - * @return boolean - * - */ - private function _checkpass($name, $pass) - { - // assume failure - $result = false; - - // maybe this should be moved to _setup()? - if ($this->plugins) { - $plugins = $this->plugins; - } - else { - $plugins = $this->_read_plugins(); - } - - $path_template = $this->plugin_path . '/%s/%s.php'; - - // loop over the plugins - foreach ($plugins as $plugin){ - // load and instantiate the class - require sprintf($path_template,$plugin,$plugin); - $class = 'pam_'.$plugin; - $this->pam_auth = new $class($name, $pass); - $result = $this->pam_auth->isAuth(); - /* - * if user is authenticated then leave the loop/method. - * the $this->pam_auth class is used to create a new account - */ - if ($result) return $result; - } - - return $result; - } - - /** - * scan the plugin directory and build a list of names - * - * @return array - */ - private function _read_plugins() { - $plugins = array(); - $plugin_path = MODPATH .'pam/plugins'; - - // build plugin list from plugin folder - $d = dir($plugin_path); - while (false !== ($entry = $d->read())) { - if ($entry != "." && $entry != "..") $plugins[] = $entry ; - } - $d->close(); - return $plugins; - } - - /** - * load the config and set some values - */ - private function _setup() { - - $default_plugin_path = MODPATH .'pam/plugins'; - - if (file_exists(MODPATH .'pam/config/config.php')) { - include MODPATH .'pam/config/config.php'; - } - - $this->plugins = isset($plugins)?$plugins:false; - $this->plugin_path = isset($plugin_path)?$plugin_path:$default_plugin_path; - $this->create_account = isset($create_account)?$create_account:false; - - } - -} \ No newline at end of file diff --git a/3.1/modules/pam/helpers/pam_event.php b/3.1/modules/pam/helpers/pam_event.php deleted file mode 100644 index a0391e77..00000000 --- a/3.1/modules/pam/helpers/pam_event.php +++ /dev/null @@ -1,23 +0,0 @@ -guest) { - // disable the default login - $menu->remove('user_menu_login'); - // add ours - $menu->append(Menu::factory("dialog") - ->id("user_menu_pam") - ->css_id("g-pam-menu") - ->url(url::site("pam/ajax")) - ->label(t("Login"))); - } - } - -} diff --git a/3.1/modules/pam/module.info b/3.1/modules/pam/module.info deleted file mode 100644 index 8913996a..00000000 --- a/3.1/modules/pam/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "PAM" -description = "Pluggable authentication module allows users to login by using external authentication methods." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:pam" -discuss_url = "http://gallery.menalto.com/forum_module_pam" diff --git a/3.1/modules/pam/pam_plugins/ad/ad.php b/3.1/modules/pam/pam_plugins/ad/ad.php deleted file mode 100644 index 8d1b3353..00000000 --- a/3.1/modules/pam/pam_plugins/ad/ad.php +++ /dev/null @@ -1,88 +0,0 @@ -name = $name; - $this->pass = $pass; - $this->adldap = new adLDAP($options); - $this->_auth(); - - } - - /** - * - * @return boolean - */ - public function isAuth() - { - return $this->auth; - } - - /** - * - * @return object or false - */ - public function getAccount() - { - return $this->_account(); - } - - /** - * perform the AD authentication and set the var auth - */ - private function _auth() - { - if ($this->adldap->authenticate($this->name, $this->pass)){ - $this->auth = TRUE; - } - else { - $this->auth = FALSE; - } - } - - - /** - * - * @return object or false - */ - public function _account() - { - $result = $this->adldap->user_info($this->name); - $user_info = $result[0]; - if (isset($user_info)){ - $account = array( - 'name' => $this->name, - 'full_name' => $user_info['displayname'][0], - 'email' => $user_info['mail'][0], - ); - return (object) $account; - } - - return false; - } - - -} - diff --git a/3.1/modules/pam/pam_plugins/ad/adLDAP/LICENCE.txt b/3.1/modules/pam/pam_plugins/ad/adLDAP/LICENCE.txt deleted file mode 100644 index 2661dc22..00000000 --- a/3.1/modules/pam/pam_plugins/ad/adLDAP/LICENCE.txt +++ /dev/null @@ -1,457 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - diff --git a/3.1/modules/pam/pam_plugins/ad/adLDAP/README.txt b/3.1/modules/pam/pam_plugins/ad/adLDAP/README.txt deleted file mode 100644 index 46b3d8c8..00000000 --- a/3.1/modules/pam/pam_plugins/ad/adLDAP/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -PHP LDAP CLASS FOR MANIPULATING ACTIVE DIRECTORY -Version 2.1 - -Written by Scott Barnett -email: scott@wiggumworld.com -http://adldap.sourceforge.net/ - -I'd appreciate any improvements or additions to be submitted back -to benefit the entire community :) - -Works with both PHP 4 and PHP 5 - -I generally install libraries and classes in a folder in the document root -called "includes/". If you want to use somewhere else, just edit the -include directives in the scripts. - -The examples should be pretty self explanatory. If you require more -information, please visit http://adldap.sourceforge.net/ - - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library 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 -Lesser General Public License for more details. - diff --git a/3.1/modules/pam/pam_plugins/ad/adLDAP/adLDAP.php b/3.1/modules/pam/pam_plugins/ad/adLDAP/adLDAP.php deleted file mode 100644 index 4e79260e..00000000 --- a/3.1/modules/pam/pam_plugins/ad/adLDAP/adLDAP.php +++ /dev/null @@ -1,691 +0,0 @@ -0){ - if (array_key_exists("account_suffix",$options)){ $this->_account_suffix=$options["account_suffix"]; } - if (array_key_exists("base_dn",$options)){ $this->_base_dn=$options["base_dn"]; } - if (array_key_exists("domain_controllers",$options)){ $this->_domain_controllers=$options["domain_controllers"]; } - if (array_key_exists("ad_username",$options)){ $this->_ad_username=$options["ad_username"]; } - if (array_key_exists("ad_password",$options)){ $this->_ad_password=$options["ad_password"]; } - if (array_key_exists("real_primarygroup",$options)){ $this->_real_primarygroup=$options["real_primarygroup"]; } - if (array_key_exists("use_ssl",$options)){ $this->_use_ssl=$options["use_ssl"]; } - if (array_key_exists("recursive_groups",$options)){ $this->_recursive_groups=$options["recursive_groups"]; } - } - - //connect to the LDAP server as the username/password - $dc=$this->random_controller(); - if ($this->_use_ssl){ - $this->_conn = ldap_connect("ldaps://".$dc); - } else { - $this->_conn = ldap_connect($dc); - } - - //set some ldap options for talking to AD - ldap_set_option($this->_conn, LDAP_OPT_PROTOCOL_VERSION, 3); - ldap_set_option($this->_conn, LDAP_OPT_REFERRALS, 0); - - //bind as a domain admin if they've set it up - if ($this->_ad_username!=NULL && $this->_ad_password!=NULL){ - $this->_bind = @ldap_bind($this->_conn,$this->_ad_username.$this->_account_suffix,$this->_ad_password); - if (!$this->_bind){ - if ($this->_use_ssl){ - //if you have problems troubleshooting, remove the @ character from the ldap_bind command above to get the actual error message - echo ("FATAL: AD bind failed. Either the LDAPS connection failed or the login credentials are incorrect."); exit(); - } else { - echo ("FATAL: AD bind failed. Check the login credentials."); exit(); - } - } - } - - return (true); - } - - // default destructor - function __destruct(){ ldap_close ($this->_conn); } - - //validate a users login credentials - function authenticate($username,$password,$prevent_rebind=false){ - if ($username==NULL || $password==NULL){ return (false); } //prevent null binding - - //bind as the user - $this->_bind = @ldap_bind($this->_conn,$username.$this->_account_suffix,$password); - if (!$this->_bind){ return (false); } - - //once we've checked their details, kick back into admin mode if we have it - if ($this->_ad_username!=NULL && !$prevent_rebind){ - $this->_bind = @ldap_bind($this->_conn,$this->_ad_username.$this->_account_suffix,$this->_ad_password); - if (!$this->_bind){ echo ("FATAL: AD rebind failed."); exit(); } //this should never happen in theory - } - - return (true); - } - - //***************************************************************************************************************** - // GROUP FUNCTIONS - - // Add a group to a group - function group_add_group($parent,$child){ - - //find the parent group's dn - $parent_group=$this->group_info($parent,array("cn")); - if ($parent_group[0]["dn"]==NULL){ return (false); } - $parent_dn=$parent_group[0]["dn"]; - - //find the child group's dn - $child_group=$this->group_info($child,array("cn")); - if ($child_group[0]["dn"]==NULL){ return (false); } - $child_dn=$child_group[0]["dn"]; - - $add=array(); - $add["member"] = $child_dn; - - $result=@ldap_mod_add($this->_conn,$parent_dn,$add); - if ($result==false){ return (false); } - return (true); - } - - // Add a user to a group - function group_add_user($group,$user){ - //adding a user is a bit fiddly, we need to get the full DN of the user - //and add it using the full DN of the group - - //find the user's dn - $user_info=$this->user_info($user,array("cn")); - if ($user_info[0]["dn"]==NULL){ return (false); } - $user_dn=$user_info[0]["dn"]; - - //find the group's dn - $group_info=$this->group_info($group,array("cn")); - if ($group_info[0]["dn"]==NULL){ return (false); } - $group_dn=$group_info[0]["dn"]; - - $add=array(); - $add["member"] = $user_dn; - - $result=@ldap_mod_add($this->_conn,$group_dn,$add); - if ($result==false){ return (false); } - return (true); - } - - // Create a group - function group_create($attributes){ - if (!is_array($attributes)){ return ("Attributes must be an array"); } - if (!array_key_exists("group_name",$attributes)){ return ("Missing compulsory field [group_name]"); } - if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); } - if (!array_key_exists("description",$attributes)){ return ("Missing compulsory field [description]"); } - if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); } - $attributes["container"]=array_reverse($attributes["container"]); - - //$member_array = array(); - //$member_array[0] = "cn=user1,cn=Users,dc=yourdomain,dc=com"; - //$member_array[1] = "cn=administrator,cn=Users,dc=yourdomain,dc=com"; - - $add=array(); - $add["cn"] = $attributes["group_name"]; - $add["samaccountname"] = $attributes["group_name"]; - $add["objectClass"] = "Group"; - $add["description"] = $attributes["description"]; - //$add["member"] = $member_array; UNTESTED - - $container="OU=".implode(",OU=",$attributes["container"]); - $result=ldap_add($this->_conn,"CN=".$add["cn"].", ".$container.",".$this->_base_dn,$add); - if ($result!=true){ return (false); } - - return (true); - } - - // Remove a group from a group - function group_del_group($parent,$child){ - - //find the parent dn - $parent_group=$this->group_info($parent,array("cn")); - if ($parent_group[0]["dn"]==NULL){ return (false); } - $parent_dn=$parent_group[0]["dn"]; - - //find the child dn - $child_group=$this->group_info($child,array("cn")); - if ($child_group[0]["dn"]==NULL){ return (false); } - $child_dn=$child_group[0]["dn"]; - - $del=array(); - $del["member"] = $child_dn; - - $result=@ldap_mod_del($this->_conn,$parent_dn,$del); - if ($result==false){ return (false); } - return (true); - } - - // Remove a user from a group - function group_del_user($group,$user){ - - //find the parent dn - $group_info=$this->group_info($group,array("cn")); - if ($group_info[0]["dn"]==NULL){ return (false); } - $group_dn=$group_info[0]["dn"]; - - //find the child dn - $user_info=$this->user_info($user,array("cn")); - if ($user_info[0]["dn"]==NULL){ return (false); } - $user_dn=$user_info[0]["dn"]; - - $del=array(); - $del["member"] = $user_dn; - - $result=@ldap_mod_del($this->_conn,$group_dn,$del); - if ($result==false){ return (false); } - return (true); - } - - // Returns an array of information for a specified group - function group_info($group_name,$fields=NULL){ - if ($group_name==NULL){ return (false); } - if (!$this->_bind){ return (false); } - - $filter="(&(objectCategory=group)(name=".$this->ldap_slashes($group_name)."))"; - //echo ($filter."!!!
      "); - if ($fields==NULL){ $fields=array("member","memberof","cn","description","distinguishedname","objectcategory","samaccountname"); } - $sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields); - $entries = ldap_get_entries($this->_conn, $sr); - //print_r($entries); - return ($entries); - } - - // Retun a complete list of "groups in groups" - function recursive_groups($group){ - if ($group==NULL){ return (false); } - - $ret_groups=array(); - - $groups=$this->group_info($group,array("memberof")); - $groups=$groups[0]["memberof"]; - - if ($groups){ - $group_names=$this->nice_names($groups); - $ret_groups=array_merge($ret_groups,$group_names); //final groups to return - - foreach ($group_names as $id => $group_name){ - $child_groups=$this->recursive_groups($group_name); - $ret_groups=array_merge($ret_groups,$child_groups); - } - } - - return ($ret_groups); - } - - //***************************************************************************************************************** - // USER FUNCTIONS - - //create a user - function user_create($attributes){ - //check for compulsory fields - if (!array_key_exists("username",$attributes)){ return ("Missing compulsory field [username]"); } - if (!array_key_exists("firstname",$attributes)){ return ("Missing compulsory field [firstname]"); } - if (!array_key_exists("surname",$attributes)){ return ("Missing compulsory field [surname]"); } - if (!array_key_exists("email",$attributes)){ return ("Missing compulsory field [email]"); } - if (!array_key_exists("container",$attributes)){ return ("Missing compulsory field [container]"); } - if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); } - - if (array_key_exists("password",$attributes) && !$this->_use_ssl){ echo ("FATAL: SSL must be configured on your webserver and enabled in the class to set passwords."); exit(); } - - if (!array_key_exists("display_name",$attributes)){ $attributes["display_name"]=$attributes["firstname"]." ".$attributes["surname"]; } - - //translate the schema - $add=$this->adldap_schema($attributes); - - //additional stuff only used for adding accounts - $add["cn"][0]=$attributes["display_name"]; - $add["samaccountname"][0]=$attributes["username"]; - $add["objectclass"][0]="top"; - $add["objectclass"][1]="person"; - $add["objectclass"][2]="organizationalPerson"; - $add["objectclass"][3]="user"; //person? - //$add["name"][0]=$attributes["firstname"]." ".$attributes["surname"]; - - //set the account control attribute - $control_options=array("NORMAL_ACCOUNT"); - if (!$attributes["enabled"]){ $control_options[]="ACCOUNTDISABLE"; } - $add["userAccountControl"][0]=$this->account_control($control_options); - //echo ("
      "); print_r($add);
      -
      -		//determine the container
      -		$attributes["container"]=array_reverse($attributes["container"]);
      -		$container="OU=".implode(",OU=",$attributes["container"]);
      -
      -		//add the entry
      -		$result=@ldap_add($this->_conn, "CN=".$add["cn"][0].", ".$container.",".$this->_base_dn, $add);
      -		if ($result!=true){ return (false); }
      -		
      -		return (true);
      -	}
      -
      -	// user_groups($user)
      -	//	Returns an array of groups that a user is a member off
      -	function user_groups($username,$recursive=NULL){
      -		if ($username==NULL){ return (false); }
      -		if ($recursive==NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
      -		if (!$this->_bind){ return (false); }
      -		
      -		//search the directory for their information
      -		$info=@$this->user_info($username,array("memberof","primarygroupid"));
      -		$groups=$this->nice_names($info[0]["memberof"]); //presuming the entry returned is our guy (unique usernames)
      -
      -		if ($recursive){
      -			foreach ($groups as $id => $group_name){
      -				$extra_groups=$this->recursive_groups($group_name);
      -				$groups=array_merge($groups,$extra_groups);
      -			}
      -		}
      -		
      -		return ($groups);
      -	}
      -
      -	// Returns an array of information for a specific user
      -	function user_info($username,$fields=NULL){
      -		if ($username==NULL){ return (false); }
      -		if (!$this->_bind){ return (false); }
      -
      -		$filter="samaccountname=".$username;
      -		if ($fields==NULL){ $fields=array("samaccountname","mail","memberof","department","displayname","telephonenumber","primarygroupid"); }
      -		$sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
      -		$entries = ldap_get_entries($this->_conn, $sr);
      -		
      -		// AD does not return the primary group in the ldap query, we may need to fudge it
      -		if ($this->_real_primarygroup){
      -			$entries[0]["memberof"][]=$this->group_cn($entries[0]["primarygroupid"][0]);
      -		} else {
      -			$entries[0]["memberof"][]="CN=Domain Users,CN=Users,".$this->_base_dn;
      -		}
      -		
      -		$entries[0]["memberof"]["count"]++;
      -		return ($entries);
      -	}
      -	
      -	// Returns true if the user is a member of the group
      -	function user_ingroup($username,$group,$recursive=NULL){
      -		if ($username==NULL){ return (false); }
      -		if ($group==NULL){ return (false); }
      -		if (!$this->_bind){ return (false); }
      -		if ($recursive==NULL){ $recursive=$this->_recursive_groups; } //use the default option if they haven't set it
      -		
      -		//get a list of the groups
      -		$groups=$this->user_groups($username,array("memberof"),$recursive);
      -		
      -		//return true if the specified group is in the group list
      -		if (in_array($group,$groups)){ return (true); }
      -
      -		return (false);
      -	}
      -	
      -	//modify a user
      -	function user_modify($username,$attributes){
      -		if ($username==NULL){ return ("Missing compulsory field [username]"); }
      -		if (array_key_exists("password",$attributes) && !$this->_use_ssl){ echo ("FATAL: SSL must be configured on your webserver and enabled in the class to set passwords."); exit(); }
      -		//if (array_key_exists("container",$attributes)){
      -			//if (!is_array($attributes["container"])){ return ("Container attribute must be an array."); }
      -			//$attributes["container"]=array_reverse($attributes["container"]);
      -		//}
      -
      -		//find the dn of the user
      -		$user=$this->user_info($username,array("cn"));
      -		if ($user[0]["dn"]==NULL){ return (false); }
      -		$user_dn=$user[0]["dn"];
      -
      -		//translate the update to the LDAP schema				
      -		$mod=$this->adldap_schema($attributes);
      -		if (!$mod){ return (false); }
      -		
      -		//set the account control attribute (only if specified)
      -		if (array_key_exists("enabled",$attributes)){
      -			if ($attributes["enabled"]){ $control_options=array("NORMAL_ACCOUNT"); }
      -			else { $control_options=array("NORMAL_ACCOUNT","ACCOUNTDISABLE"); }
      -			$mod["userAccountControl"][0]=$this->account_control($control_options);
      -		}
      -
      -		//do the update
      -		$result=ldap_modify($this->_conn,$user_dn,$mod);
      -		if ($result==false){ return (false); }
      -		
      -		return (true);
      -	}
      -		
      -	// Set the password of a user
      -	function user_password($username,$password){
      -		if ($username==NULL){ return (false); }
      -		if ($password==NULL){ return (false); }
      -		if (!$this->_bind){ return (false); }
      -		if (!$this->_use_ssl){ echo ("FATAL: SSL must be configured on your webserver and enabled in the class to set passwords."); exit(); }
      -		
      -		$user=$this->user_info($username,array("cn"));
      -		if ($user[0]["dn"]==NULL){ return (false); }
      -		$user_dn=$user[0]["dn"];
      -				
      -		$add=array();
      -		$add["unicodePwd"][0]=$this->encode_password($password);
      -		
      -		$result=ldap_mod_replace($this->_conn,$user_dn,$add);
      -		if ($result==false){ return (false); }
      -		
      -		return (true);
      -	}
      -
      -	//*****************************************************************************************************************
      -	// COMPUTER FUNCTIONS
      -	
      -	// Returns an array of information for a specific computer
      -	function computer_info($computer_name,$fields=NULL){
      -		if ($computer_name==NULL){ return (false); }
      -		if (!$this->_bind){ return (false); }
      -
      -		$filter="(&(objectClass=computer)(cn=".$computer_name."))";
      -		if ($fields==NULL){ $fields=array("memberof","cn","displayname","dnshostname","distinguishedname","objectcategory","operatingsystem","operatingsystemservicepack","operatingsystemversion"); }
      -		$sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
      -		$entries = ldap_get_entries($this->_conn, $sr);
      -		
      -		return ($entries);
      -	}
      -
      -	// Returns all AD users
      -	function all_users($include_desc = false, $search = "*", $sorted = true){
      -		if (!$this->_bind){ return (false); }
      -		
      -		//perform the search and grab all their details
      -		$filter = "(&(objectClass=user)(samaccounttype=". ADLDAP_NORMAL_ACCOUNT .")(objectCategory=person)(cn=".$search."))";
      -		$fields=array("samaccountname","displayname");
      -		$sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
      -		$entries = ldap_get_entries($this->_conn, $sr);
      -
      -		$users_array = array();
      -		for ($i=0; $i<$entries["count"]; $i++){
      -			if ($include_desc && strlen($entries[$i]["displayname"][0])>0){
      -				$users_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["displayname"][0];
      -			} elseif ($include_desc){
      -				$users_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["samaccountname"][0];
      -			} else {
      -				array_push($users_array, $entries[$i]["samaccountname"][0]);
      -			}
      -		}
      -		if ($sorted){ asort($users_array); }
      -		return ($users_array);
      -	}
      -	
      -	// Returns a complete list of the groups in AD
      -	function all_groups($include_desc = false, $search = "*", $sorted = true){
      -		if (!$this->_bind){ return (false); }
      -		
      -		//perform the search and grab all their details
      -		$filter = "(&(objectCategory=group)(samaccounttype=". ADLDAP_SECURITY_GLOBAL_GROUP .")(cn=".$search."))";
      -		$fields=array("samaccountname","description");
      -		$sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
      -		$entries = ldap_get_entries($this->_conn, $sr);
      -
      -		$groups_array = array();		
      -		for ($i=0; $i<$entries["count"]; $i++){
      -			if ($include_desc && strlen($entries[$i]["description"][0]) > 0 ){
      -				$groups_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["description"][0];
      -			} elseif ($include_desc){
      -				$groups_array[ $entries[$i]["samaccountname"][0] ] = $entries[$i]["samaccountname"][0];
      -			} else {
      -				array_push($groups_array, $entries[$i]["samaccountname"][0]);
      -			}
      -		}
      -		if( $sorted ){ asort($groups_array); }
      -		return ($groups_array);
      -	}
      -
      -	//************************************************************************************************************
      -	// UTILITY FUNCTIONS (not intended to be called directly but I spose you could?)
      -
      -	function adldap_schema($attributes){
      -	
      -		//ldap doesn't like NULL attributes, only set them if they have values
      -		// I'd like to know how to set an LDAP attribute to NULL though, at the moment I set it to a space
      -		$mod=array();
      -		if ($attributes["address_city"]){ $mod["l"][0]=$attributes["address_city"]; }
      -		if ($attributes["address_code"]){ $mod["postalCode"][0]=$attributes["address_code"]; }
      -		//if ($attributes["address_country"]){ $mod["countryCode"][0]=$attributes["address_country"]; } // use country codes?
      -		if ($attributes["address_pobox"]){ $mod["postOfficeBox"][0]=$attributes["address_pobox"]; }
      -		if ($attributes["address_state"]){ $mod["st"][0]=$attributes["address_state"]; }
      -		if ($attributes["address_street"]){ $mod["streetAddress"][0]=$attributes["address_street"]; }
      -		if ($attributes["company"]){ $mod["company"][0]=$attributes["company"]; }
      -		if ($attributes["change_password"]){ $mod["pwdLastSet"][0]=0; }
      -		if ($attributes["company"]){ $mod["company"][0]=$attributes["company"]; }
      -		if ($attributes["department"]){ $mod["department"][0]=$attributes["department"]; }
      -		if ($attributes["description"]){ $mod["description"][0]=$attributes["description"]; }
      -		if ($attributes["display_name"]){ $mod["displayName"][0]=$attributes["display_name"]; }
      -		if ($attributes["email"]){ $mod["mail"][0]=$attributes["email"]; }
      -		if ($attributes["expires"]){ $mod["accountExpires"][0]=$attributes["expires"]; } //unix epoch format?
      -		if ($attributes["firstname"]){ $mod["givenName"][0]=$attributes["firstname"]; }
      -		if ($attributes["home_directory"]){ $mod["homeDirectory"][0]=$attributes["home_directory"]; }
      -		if ($attributes["home_drive"]){ $mod["homeDrive"][0]=$attributes["home_drive"]; }
      -		if ($attributes["initials"]){ $mod["initials"][0]=$attributes["initials"]; }
      -		if ($attributes["logon_name"]){ $mod["userPrincipalName"][0]=$attributes["logon_name"]; }
      -		if ($attributes["manager"]){ $mod["manager"][0]=$attributes["manager"]; }  //UNTESTED ***Use DistinguishedName***
      -		if ($attributes["office"]){ $mod["physicalDeliveryOfficeName"][0]=$attributes["office"]; }
      -		if ($attributes["password"]){ $mod["unicodePwd"][0]=$this->encode_password($attributes["password"]); }
      -		if ($attributes["profile_path"]){ $mod["profilepath"][0]=$attributes["profile_path"]; }
      -		if ($attributes["script_path"]){ $mod["scriptPath"][0]=$attributes["script_path"]; }
      -		if ($attributes["surname"]){ $mod["sn"][0]=$attributes["surname"]; }
      -		if ($attributes["title"]){ $mod["title"][0]=$attributes["title"]; }
      -		if ($attributes["telephone"]){ $mod["telephoneNumber"][0]=$attributes["telephone"]; }
      -		if ($attributes["web_page"]){ $mod["wWWHomePage"][0]=$attributes["web_page"]; }
      -		//echo ("
      "); print_r($mod);
      -/*
      -		// modifying a name is a bit fiddly
      -		if ($attributes["firstname"] && $attributes["surname"]){
      -			$mod["cn"][0]=$attributes["firstname"]." ".$attributes["surname"];
      -			$mod["displayname"][0]=$attributes["firstname"]." ".$attributes["surname"];
      -			$mod["name"][0]=$attributes["firstname"]." ".$attributes["surname"];
      -		}
      -*/
      -
      -
      -		if (count($mod)==0){ return (false); }
      -		return ($mod);
      -	}
      -
      -
      -	function group_cn($gid){
      -		// coping with AD not returning the primary group
      -		// http://support.microsoft.com/?kbid=321360
      -		// for some reason it's not possible to search on primarygrouptoken=XXX
      -		// if someone can show otherwise, I'd like to know about it :)
      -		// this way is resource intensive and generally a pain in the @#%^
      -		
      -		if ($gid==NULL){ return (false); }
      -		$r=false;
      -		
      -		$filter="(&(objectCategory=group)(samaccounttype=". ADLDAP_SECURITY_GLOBAL_GROUP ."))";
      -		$fields=array("primarygrouptoken","samaccountname","distinguishedname");
      -		$sr=ldap_search($this->_conn,$this->_base_dn,$filter,$fields);
      -		$entries = ldap_get_entries($this->_conn, $sr);
      -		
      -		for ($i=0; $i<$entries["count"]; $i++){
      -			if ($entries[$i]["primarygrouptoken"][0]==$gid){
      -				$r=$entries[$i]["distinguishedname"][0];
      -				$i=$entries["count"];
      -			}
      -		}
      -
      -		return ($r);
      -	}
      -
      -	// Encode a password for transmission over LDAP
      -	function encode_password($password){
      -		$password="\"".$password."\"";
      -		$encoded="";
      -		for ($i=0; $i  $char){ $legal[$id]="\\".$char; } //make up the array of legal chars
      -		
      -		$str=str_replace($illegal,$legal,$str); //replace them
      -		return ($str);
      -	}
      -	
      -	// Return a random controller
      -	function random_controller(){
      -		//select a random domain controller
      -		mt_srand(doubleval(microtime()) * 100000000); // for older php versions
      -		return ($this->_domain_controllers[array_rand($this->_domain_controllers)]);
      -	}
      -	
      -	function account_control($options){
      -		$val=0;
      -
      -		if (is_array($options)){
      -			if (in_array("SCRIPT",$options)){ $val=$val+1; }
      -			if (in_array("ACCOUNTDISABLE",$options)){ $val=$val+2; }
      -			if (in_array("HOMEDIR_REQUIRED",$options)){ $val=$val+8; }
      -			if (in_array("LOCKOUT",$options)){ $val=$val+16; }
      -			if (in_array("PASSWD_NOTREQD",$options)){ $val=$val+32; }
      -			//PASSWD_CANT_CHANGE Note You cannot assign this permission by directly modifying the UserAccountControl attribute.
      -			//For information about how to set the permission programmatically, see the "Property flag descriptions" section.
      -			if (in_array("ENCRYPTED_TEXT_PWD_ALLOWED",$options)){ $val=$val+128; }
      -			if (in_array("TEMP_DUPLICATE_ACCOUNT",$options)){ $val=$val+256; }
      -			if (in_array("NORMAL_ACCOUNT",$options)){ $val=$val+512; }
      -			if (in_array("INTERDOMAIN_TRUST_ACCOUNT",$options)){ $val=$val+2048; }
      -			if (in_array("WORKSTATION_TRUST_ACCOUNT",$options)){ $val=$val+4096; }
      -			if (in_array("SERVER_TRUST_ACCOUNT",$options)){ $val=$val+8192; }
      -			if (in_array("DONT_EXPIRE_PASSWORD",$options)){ $val=$val+65536; }
      -			if (in_array("MNS_LOGON_ACCOUNT",$options)){ $val=$val+131072; }
      -			if (in_array("SMARTCARD_REQUIRED",$options)){ $val=$val+262144; }
      -			if (in_array("TRUSTED_FOR_DELEGATION",$options)){ $val=$val+524288; }
      -			if (in_array("NOT_DELEGATED",$options)){ $val=$val+1048576; }
      -			if (in_array("USE_DES_KEY_ONLY",$options)){ $val=$val+2097152; }
      -			if (in_array("DONT_REQ_PREAUTH",$options)){ $val=$val+4194304; } 
      -			if (in_array("PASSWORD_EXPIRED",$options)){ $val=$val+8388608; }
      -			if (in_array("TRUSTED_TO_AUTH_FOR_DELEGATION",$options)){ $val=$val+16777216; }
      -		}
      -		return ($val);
      -	}
      -	
      -	// Take an ldap query and return the nice names, without all the LDAP prefixes (eg. CN, DN)
      -	function nice_names($groups){
      -
      -		$group_array=array();
      -		for ($i=0; $i<$groups["count"]; $i++){ //for each group
      -			$line=$groups[$i];
      -			
      -			if (strlen($line)>0){ 
      -				//more presumptions, they're all prefixed with CN=
      -				//so we ditch the first three characters and the group
      -				//name goes up to the first comma
      -				$bits=explode(",",$line);
      -				$group_array[]=substr($bits[0],3,(strlen($bits[0])-3));
      -			}
      -		}
      -		return ($group_array);	
      -	}
      -	
      -  
      -  
      -  // Returns an array of information for a specific user
      -  function user_dump($dn){
      -    if ($dn==NULL){ return (false); }
      -    if (!$this->_bind){ return (false); }
      -
      -    
      -    $filter = "(objectclass=*)";
      -    
      -    $sr=ldap_read($this->_conn,$dn,$filter);
      -    $entries = ldap_get_entries($this->_conn, $sr);
      -        
      -    return ($entries);
      -  }
      -
      -} // End class
      -
      -?>
      \ No newline at end of file
      diff --git a/3.1/modules/pam/pam_plugins/ad/adLDAP/authenticate.php b/3.1/modules/pam/pam_plugins/ad/adLDAP/authenticate.php
      deleted file mode 100644
      index def9bb37..00000000
      --- a/3.1/modules/pam/pam_plugins/ad/adLDAP/authenticate.php
      +++ /dev/null
      @@ -1,60 +0,0 @@
      - "@trinity-health.org",
      - 'base_dn' => "dc=trinity-health,dc=org",
      - 'domain_controllers' => array ("ldap://addir.trinity-health.org"),
      - 'ad_username' => 'js224113',
      - 'ad_password' => 'pass4tis'
      - );
      -
      -
      -
      -if ($_POST["oldform"]){ //prevent null bind
      -
      -  if ($username!=NULL && $password!=NULL){
      -    //include the class and create a connection
      -    include ("adLDAP.php");
      -    $adldap = new adLDAP($options);
      -
      -    //authenticate the user
      -    if ($adldap -> authenticate($username,$password)){
      -      //establish your session and redirect
      -      $failed=0;
      -    }
      -  }
      -  $failed=1;
      -}
      -
      -?>
      -
      -
      -
      -
      -adLDAP example
      -
      -
      -
      -Please login to continue.
      - -
      - - -Username:
      -Password:
      -
      - -
      -Login Failed!

      \n"); } ?> -
      - -You have successfully logged out."); } ?> - - - - - - diff --git a/3.1/modules/pam/pam_plugins/ad/adLDAP/examples.php b/3.1/modules/pam/pam_plugins/ad/adLDAP/examples.php deleted file mode 100644 index 7b69a39e..00000000 --- a/3.1/modules/pam/pam_plugins/ad/adLDAP/examples.php +++ /dev/null @@ -1,102 +0,0 @@ -\n"); - -// authenticate a username/password -if (0){ - $result=$ldap->authenticate("username","password"); - var_dump($result); -} - -// add a group to a group -if (0){ - $result=$ldap->group_add_group("Parent Group Name","Child Group Name"); - var_dump($result); -} - -// add a user to a group -if (0){ - $result=$ldap->group_add_user("Group Name","username"); - var_dump($result); -} - -// create a group -if (0){ - $attributes=array( - "group_name"=>"Test Group", - "description"=>"Just Testing", - "container"=>array("Groups","A Container"), - ); - $result=$ldap->group_create($attributes); - var_dump($result); -} - -// retrieve information about a group -if (0){ - $result=$ldap->group_info("Group Name"); - var_dump($result); -} - -// create a user account -if (0){ - $attributes=array( - "username"=>"freds", - "logon_name"=>"freds@mydomain.local", - "firstname"=>"Fred", - "surname"=>"Smith", - "company"=>"My Company", - "department"=>"My Department", - "email"=>"freds@mydomain.local", - "container"=>array("Container Parent","Container Child"), - "enabled"=>1, - "password"=>"Password123", - ); - - $result=$ldap->user_create($attributes); - var_dump($result); -} - -// retrieve the group membership for a user -if (0){ - $result=$ldap->user_groups("username"); - print_r($result); -} - -// retrieve information about a user -if (0){ - $result=$ldap->user_info("username"); - print_r($result); -} - -// check if a user is a member of a group -if (0){ - $result=$ldap->user_ingroup("username","Group Name"); - var_dump($result); -} - -// modify a user account (this example will set "user must change password at next logon") -if (0){ - $attributes=array( - "change_password"=>1, - ); - $result=$ldap->user_modify("username",$attributes); - var_dump($result); -} - -// change the password of a user -if (0){ - $result=$ldap->user_password("username","Password123"); - var_dump($result); -} -?> \ No newline at end of file diff --git a/3.1/modules/pam/pam_plugins/ad/config.php b/3.1/modules/pam/pam_plugins/ad/config.php deleted file mode 100644 index 67375301..00000000 --- a/3.1/modules/pam/pam_plugins/ad/config.php +++ /dev/null @@ -1,11 +0,0 @@ - "@domain.com", - 'base_dn' => "DC=USER,DC=COM", - 'domain_controllers' => array ("ldap://doamin.controller.com"), - 'ad_username' => 'username', - 'ad_password' => 'password' - ); - - diff --git a/3.1/modules/pam/pam_plugins/mock/mock.php b/3.1/modules/pam/pam_plugins/mock/mock.php deleted file mode 100644 index 015eaaee..00000000 --- a/3.1/modules/pam/pam_plugins/mock/mock.php +++ /dev/null @@ -1,57 +0,0 @@ -result = ($name == $pass)?true:false; - $this->name = $name; - $this->full_name = 'Mock ' . $name; - $this->email = $name . '@email.com'; - - } - - /** - * - * @return boolean - */ - public function isAuth() - { - return $this->result; - } - - - /** - * - * @return object or false - */ - public function getAccount() - { - $account = array( - 'name' => $this->name, - 'full_name' => $this->full_name, - 'email' => $this->email, - ); - - return (object) $account; - } - - - -} -?> diff --git a/3.1/modules/pam/plugins/gallery/gallery.php b/3.1/modules/pam/plugins/gallery/gallery.php deleted file mode 100644 index 4b5354d7..00000000 --- a/3.1/modules/pam/plugins/gallery/gallery.php +++ /dev/null @@ -1,24 +0,0 @@ -result = identity::is_correct_password($user, $pass); - } - - public function isAuth() - { - return $this->result; - } - -} -?> diff --git a/3.1/modules/pam/views/pam_ajax.html.php b/3.1/modules/pam/views/pam_ajax.html.php deleted file mode 100644 index b9932c4b..00000000 --- a/3.1/modules/pam/views/pam_ajax.html.php +++ /dev/null @@ -1,18 +0,0 @@ - - - -
      -
        -
      • - -
      • -
      -
      diff --git a/3.1/modules/photoannotation/controllers/admin_photoannotation.php b/3.1/modules/photoannotation/controllers/admin_photoannotation.php deleted file mode 100755 index dc7436f6..00000000 --- a/3.1/modules/photoannotation/controllers/admin_photoannotation.php +++ /dev/null @@ -1,312 +0,0 @@ -_get_view(); - } - - public function converter() { - print $this->_get_converter_view(); - } - - public function tagsmaintanance($delete) { - print $this->_get_tagsmaintanance_view($delete); - } - - public function converthandler() { - access::verify_csrf(); - $form = $this->_get_converter_form(); - if ($form->validate()) { - //Load the source tag - $sourcetag = ORM::factory("tag", $form->sourcetag->value); - if (!$sourcetag->loaded()) { - message::error(t("The specified tag could not be found")); - url::redirect("admin/photoannotation/converter"); - } - //Load the target user - $targetuser = ORM::factory("user", $form->targetuser->value); - if (!$targetuser->loaded()) { - message::error(t("The specified person could not be found")); - url::redirect("admin/photoannotation/converter"); - } - //Load all existing tag annotations - $tag_annotations = ORM::factory("items_face")->where("tag_id", "=", $sourcetag->id)->find_all(); - //Disable user notifications so that users don't get flooded with mails - $old_notification_setting = module::get_var("photoannotation", "nonotifications", false); - module::set_var("photoannotation", "nonotifications", true, true); - foreach ($tag_annotations as $tag_annotation) { - photoannotation::saveuser($targetuser->id, $tag_annotation->item_id, $tag_annotation->x1, $tag_annotation->y1, $tag_annotation->x2, $tag_annotation->y2, $tag_annotation->description); - //Delete the old annotation - $tag_annotation->delete(); - } - //Remove and delete old tag - if ($form->deletetag->value) { - $this->_remove_tag($sourcetag, true); - } elseif ($form->removetag->value) { - $this->_remove_tag($sourcetag, false); - } - module::set_var("photoannotation", "nonotifications", $old_notification_setting, true); - message::success(t("%count tag annotations (%tagname) have been converted to user annotations (%username)", array("count" => count($tag_annotations), "tagname" => $sourcetag->name, "username" => $targetuser->display_name()))); - url::redirect("admin/photoannotation/converter"); - } - print $this->_get_converter_view($form); - } - - private function _remove_tag($tag, $delete) { - $name = $tag->name; - db::build()->delete("items_tags")->where("tag_id", "=", $tag->id)->execute(); - if ($delete) { - $tag->delete(); - } - } - - public function handler() { - access::verify_csrf(); - - $form = $this->_get_form(); - if ($form->validate()) { - module::set_var( - "photoannotation", "noborder", $form->hoverphoto->noborder->value, true); - module::set_var( - "photoannotation", "bordercolor", $form->hoverphoto->bordercolor->value); - module::set_var( - "photoannotation", "noclickablehover", $form->hoverclickable->noclickablehover->value, true); - module::set_var( - "photoannotation", "clickablehovercolor", $form->hoverclickable->clickablehovercolor->value); - module::set_var( - "photoannotation", "nohover", $form->hovernoclickable->nohover->value, true); - module::set_var( - "photoannotation", "hovercolor", $form->hovernoclickable->hovercolor->value); - module::set_var( - "photoannotation", "showusers", $form->legendsettings->showusers->value, true); - module::set_var( - "photoannotation", "showfaces", $form->legendsettings->showfaces->value, true); - module::set_var( - "photoannotation", "shownotes", $form->legendsettings->shownotes->value, true); - module::set_var( - "photoannotation", "fullname", $form->legendsettings->fullname->value, true); - module::set_var( - "photoannotation", "nonotifications", $form->notifications->nonotifications->value, true); - module::set_var( - "photoannotation", "notificationoptout", $form->notifications->notificationoptout->value, true); - module::set_var( - "photoannotation", "allowguestsearch", $form->notifications->allowguestsearch->value, true); - module::set_var( - "photoannotation", "newtagsubject", strip_tags($form->newtagmail->newtagsubject->value)); - module::set_var( - "photoannotation", "newtagbody", strip_tags($form->newtagmail->newtagbody->value)); - module::set_var( - "photoannotation", "newcommentsubject", strip_tags($form->newcommentmail->newcommentsubject->value)); - module::set_var( - "photoannotation", "newcommentbody", strip_tags($form->newcommentmail->newcommentbody->value)); - module::set_var( - "photoannotation", "updatedcommentsubject", strip_tags($form->updatedcommentmail->updatedcommentsubject->value)); - module::set_var( - "photoannotation", "updatedcommentbody", strip_tags($form->updatedcommentmail->updatedcommentbody->value)); - module::set_var( - "photoannotation", "onuserdelete", $form->onuserdelete->onuserdelete->value); - message::success(t("Your settings have been saved.")); - url::redirect("admin/photoannotation"); - } - print $this->_get_view($form); - } - - private function _get_view($form=null) { - $v = new Admin_View("admin.html"); - $v->page_title = t("Photo annotation"); - $v->content = new View("admin_photoannotation.html"); - $v->content->form = empty($form) ? $this->_get_form() : $form; - return $v; - } - - private function _get_converter_view($form=null) { - $v = new Admin_View("admin.html"); - $v->page_title = t("Photo annotation converter"); - $v->content = new View("admin_photoannotation_converter.html"); - $v->content->form = empty($form) ? $this->_get_converter_form() : $form; - return $v; - } - - private function _get_tagsmaintanance_view($delete = false) { - $tag_orpanes_count = 0; - $user_orphanes_count = 0; - $item_orphanes_count = 0; - $tag_orpanes_deleted = 0; - $user_orphanes_deleted = 0; - $item_orphanes_deleted = 0; - //check all tag annotations - $tag_annotations = ORM::factory("items_face")->find_all(); - foreach ($tag_annotations as $tag_annotation) { - $check_tag = ORM::factory("tag")->where("id", "=", $tag_annotation->tag_id)->find(); - if (!$check_tag->loaded()) { - if ($delete) { - $tag_annotation->delete(); - $tag_orpanes_deleted++; - } else { - $tag_orpanes_count++; - } - } else { - $check_item = ORM::factory("item")->where("id", "=", $tag_annotation->item_id)->find(); - if (!$check_item->loaded()) { - if ($delete) { - $tag_annotation->delete(); - $item_orpanes_deleted++; - } else { - $item_orpanes_count++; - } - } - } - } - //check all user annotations - $user_annotations = ORM::factory("items_user")->find_all(); - foreach ($user_annotations as $user_annotation) { - $check_user = ORM::factory("user")->where("id", "=", $user_annotation->user_id)->find(); - if (!$check_user->loaded()) { - if ($delete) { - $user_annotation->delete(); - $user_orpanes_deleted++; - } else { - $user_orphanes_count++; - } - } else { - $check_item = ORM::factory("item")->where("id", "=", $user_annotation->item_id)->find(); - if (!$check_item->loaded()) { - if ($delete) { - $user_annotation->delete(); - $item_orpanes_deleted++; - } else { - $item_orpanes_count++; - } - } - } - } - - //check all user annotations - $note_annotations = ORM::factory("items_note")->find_all(); - foreach ($note_annotations as $note_annotation) { - $check_item = ORM::factory("item")->where("id", "=", $note_annotation->item_id)->find(); - if (!$check_item->loaded()) { - if ($delete) { - $note_annotation->delete(); - $item_orpanes_deleted++; - } else { - $item_orpanes_count++; - } - } - } - $v = new Admin_View("admin.html"); - $v->page_title = t("Photo annotation tags maintanance"); - $v->content = new View("admin_photoannotation_tagsmaintanance.html"); - $v->content->tag_orpanes_count = $tag_orpanes_count; - $v->content->user_orphanes_count = $user_orphanes_count; - $v->content->item_orphanes_count = $item_orphanes_count; - $v->content->tag_orpanes_deleted = $tag_orpanes_deleted; - $v->content->user_orphanes_deleted = $user_orphanes_deleted; - $v->content->item_orphanes_deleted = $item_orphanes_deleted; - $v->content->dodeletion = $delete; - return $v; - } - - private function _get_converter_form() { - //get all tags - $tags = ORM::factory("tag")->order_by("name", "ASC")->find_all(); - foreach ($tags as $tag) { - $tag_array[$tag->id] = $tag->name; - } - //get all users - $users = ORM::factory("user")->order_by("name", "ASC")->find_all(); - foreach ($users as $user) { - $user_array[$user->id] = $user->display_name(); - } - $form = new Forge("admin/photoannotation/converthandler", "", "post", array("id" => "g-admin-form")); - $form->dropdown("sourcetag")->label(t("Select tag")) - ->options($tag_array); - $form->dropdown("targetuser")->label(t("Select user")) - ->options($user_array); - $form->checkbox("deletetag")->label(t("Delete the tag after conversion.")); - $form->checkbox("removetag")->label(t("Remove the tag from photos after conversion.")); - $form->submit("submit")->value(t("Convert")); - return $form; - } - - private function _get_form() { - if (module::is_active("comment")) { - $comment_required = ""; - } else { - $comment_required = " (comment module required)"; - } - $form = new Forge("admin/photoannotation/handler", "", "post", array("id" => "g-admin-form")); - $group = $form->group("hoverphoto")->label(t("Hovering over the photo")); - $group->checkbox("noborder")->label(t("Don't show borders.")) - ->checked(module::get_var("photoannotation", "noborder", false)); - $group->input("bordercolor")->label(t('Border color')) - ->value(module::get_var("photoannotation", "bordercolor", "000000")) - ->rules("valid_alpha_numeric|length[6]"); - $group = $form->group("hoverclickable")->label(t("Hovering over a clickable annotation")); - $group->checkbox("noclickablehover")->label(t("Don't show borders.")) - ->checked(module::get_var("photoannotation", "noclickablehover", false)); - $group->input("clickablehovercolor")->label(t('Border color')) - ->value(module::get_var("photoannotation", "clickablehovercolor", "00AD00")) - ->rules("valid_alpha_numeric|length[6]"); - $group = $form->group("hovernoclickable")->label(t("Hovering over a non-clickable annotation")); - $group->checkbox("nohover")->label(t("Don't show borders.")) - ->checked(module::get_var("photoannotation", "nohover", false)); - $group->input("hovercolor")->label(t('Border color')) - ->value(module::get_var("photoannotation", "hovercolor", "990000")) - ->rules("valid_alpha_numeric|length[6]"); - $group = $form->group("legendsettings")->label(t("Legend settings")); - $group->checkbox("showusers")->label(t("Show user annotations below photo.")) - ->checked(module::get_var("photoannotation", "showusers", false)); - $group->checkbox("showfaces")->label(t("Show tag annotations below photo.")) - ->checked(module::get_var("photoannotation", "showfaces", false)); - $group->checkbox("shownotes")->label(t("Show note annotations below photo.")) - ->checked(module::get_var("photoannotation", "shownotes", false)); - $group->checkbox("fullname")->label(t("Show full name of a user instead of the username on annotations (username will be dispayed for users without a full name).")) - ->checked(module::get_var("photoannotation", "fullname", false)); - $group = $form->group("notifications")->label(t("Notification and people cloud settings")); - $group->checkbox("nonotifications")->label(t("Disable user notifications.")) - ->checked(module::get_var("photoannotation", "nonotifications", false)); - $group->checkbox("notificationoptout")->label(t("Notify users by default (only applies to new users and user who have not saved their profile after installing this module).")) - ->checked(module::get_var("photoannotation", "notificationoptout", false)); - $group->checkbox("allowguestsearch")->label(t("Show people cloud and allow people search for guests.")) - ->checked(module::get_var("photoannotation", "allowguestsearch", false)); - $group = $form->group("newtagmail")->label(t("Customize the mail sent to users when a user annotation is created")); - $group->input("newtagsubject")->label(t("Subject")) - ->value(module::get_var("photoannotation", "newtagsubject", "Someone tagged a photo of you")); - $group->textarea("newtagbody")->label(t("Body (allowed placeholders: %name = name of the recipient, %url = link to the item that was tagged)")) - ->value(module::get_var("photoannotation", "newtagbody", "Hello %name, please visit %url to view the photo.")); - $group = $form->group("newcommentmail")->label(t("Customize the mail sent to users when a comment is added". $comment_required)); - $group->input("newcommentsubject")->label(t("Subject")) - ->value(module::get_var("photoannotation", "newcommentsubject", "Someone added a comment to photo of you")); - $group->textarea("newcommentbody")->label(t("Body (allowed placeholders: %name = name of the recipient, %url = link to the item that was commented on)")) - ->value(module::get_var("photoannotation", "newcommentbody", "Hello %name, please visit %url to read the comment.")); - $group = $form->group("updatedcommentmail")->label(t("Customize the mail sent to users when a comment is updated". $comment_required)); - $group->input("updatedcommentsubject")->label(t("Subject")) - ->value(module::get_var("photoannotation", "updatedcommentsubject", "Someone updated a comment to photo of you")); - $group->textarea("updatedcommentbody")->label(t("Body (allowed placeholders: %name = name of the recipient, %url = link to the item that was commented on)")) - ->value(module::get_var("photoannotation", "updatedcommentbody", "Hello %name, please visit %url to read the comment.")); - $group = $form->group("onuserdelete")->label(t("Auto conversion settings")); - $group->dropdown("onuserdelete")->label(t("When deleting a user do the following with all annotations associated with this user")) - ->options(array("0" => t("Delete annotation"), "1" => t("Convert to tag annotation"), "2" => t("Convert to note annotation"))) - ->selected(module::get_var("photoannotation", "onuserdelete", "0")); - $form->submit("submit")->value(t("Save")); - return $form; - } -} diff --git a/3.1/modules/photoannotation/controllers/photoannotation.php b/3.1/modules/photoannotation/controllers/photoannotation.php deleted file mode 100644 index 9044f24f..00000000 --- a/3.1/modules/photoannotation/controllers/photoannotation.php +++ /dev/null @@ -1,297 +0,0 @@ -guest && !module::get_var("photoannotation", "allowguestsearch", false)) { - message::error(t("You have to log in to perform a people search.")); - url::redirect(url::site()); - return; - } - $form = photoannotation::get_user_search_form("g-user-cloud-form"); - $user_id = Input::instance()->get("name", ""); - if ($user_id == "") { - $user_id = Input::instance()->post("name", ""); - } - $getuser = photoannotation::getuser($user_id); - if ($getuser->found) { - url::redirect(user_profile::url($getuser->user->id)); - return; - } - $page_size = module::get_var("gallery", "page_size", 9); - $page = Input::instance()->get("page", 1); - $offset = ($page - 1) * $page_size; - - // Make sure that the page references a valid offset - if ($page < 1) { - $page = 1; - } - list ($count, $result) = photoannotation::search_user($user_id, $page_size, $offset); - $max_pages = max(ceil($count / $page_size), 1); - if ($page > 1) { - $previous_page_url = url::site("photoannotation/showuser?name=". $user_id ."&page=". ($page - 1)); - } - if ($page < $max_pages) { - $next_page_url = url::site("photoannotation/showuser?name=". $user_id ."&page=". ($page + 1)); - } - if ($user_id == "") { - $user_id = "*"; - } - $template = new Theme_View("page.html", "other", "usersearch"); - $template->set_global("position", $page); - $template->set_global("total", $max_pages); - $template->content = new View("photoannotation_user_search.html"); - $template->content->search_form = photoannotation::get_user_search_form(g-user-search-form); - $template->content->users = $result; - $template->content->q = $user_id; - $template->content->count = $count; - $template->content->paginator = new View("paginator.html"); - $template->content->paginator->previous_page_url = $previous_page_url; - $template->content->paginator->next_page_url = $next_page_url; - print $template; - } - - public function save($item_id) { - // Prevent Cross Site Request Forgery - access::verify_csrf(); - //Get form data - $item = ORM::factory("item", $item_id); - $annotate_id = $_POST["noteid"]; - $notetype = $_POST["notetype"]; - $str_y1 = $_POST["top"]; - $str_x1 = $_POST["left"]; - $str_y2 = $_POST["height"] + $str_y1; //Annotation uses area size, tagfaces uses positions - $str_x2 = $_POST["width"] + $str_x1; //Annotation uses area size, tagfaces uses positions - $item_title = $_POST["text"]; - $tag_data = $_POST["tagsList"]; - $user_id = ""; - $user_id = $_POST["userlist"]; - $description = $_POST["desc"]; - $error_noselection = t("Please select a person or tag or specify a title."); - $redir_uri = url::abs_site("{$item->type}s/{$item->id}"); - //If this is a user then get the id - if ($user_id != "") { - $getuser = photoannotation::getuser($user_id); - if (!$getuser->found) { - json::reply(array("result" => "error", "message" => (string)t("Could not find anyone with the name %user.", array("user" => $user_id)))); - return; - } - if ($getuser->isguest) { - json::reply(array("result" => "error", "message" => (string)t("You cannot create an annotation for the guest user."))); - return; - } - $user_id = $getuser->user->id; - } - - //Add tag to item, create tag if not exists - if ($tag_data != "") { - $tag = ORM::factory("tag")->where("name", "=", $tag_data)->find(); - if (!$tag->loaded()) { - $tag->name = $tag_data; - $tag->count = 0; - } - $tag->add($item); - $tag->count++; - $tag->save(); - $tag_data = $tag->id; - } else { - $tag_data = ""; - } - //Save annotation - if ($annotate_id == "new") { //This is a new annotation - $annotate_id = -1; - if ($user_id != "") { //Save user - $new_id = photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); - $dest_type = "user"; - } elseif ($tag_data != "") { //Save face - $new_id = photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); - $dest_type = "face"; - } elseif ($item_title != "") { //Save note - $new_id = photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); - $dest_type = "note"; - } else { //Something's wrong - json::reply(array("result" => "error", "message" => (string)$error_noselection)); - return; - } - } else { //This is an update to an existing annotation - switch ($notetype) { - case "user": //the original annotation is a user - $updateduser = ORM::factory("items_user") //load the existing user - ->where("id", "=", $annotate_id) - ->find(); - if ($user_id != "") { //Conversion user -> user - $new_id = photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); - $dest_type = "user"; - } elseif ($tag_data != "") { //Conversion user -> face - $new_id = photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); - $dest_type = "face"; - $updateduser->delete(); //delete old user - } elseif ($item_title != "") { //Conversion user -> note - $new_id = photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); - $dest_type = "note"; - $updateduser->delete(); //delete old user - } else { //Somethings wrong - json::reply(array("result" => "error", "message" => (string)$error_noselection)); - return; - } - break; - case "face": //the original annotation is a face - $updatedface = ORM::factory("items_face") //load the existing user - ->where("id", "=", $annotate_id) - ->find(); - if ($user_id != "") { //Conversion face -> user - $new_id = photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); - $dest_type = "user"; - $updatedface->delete(); //delete old face - } elseif ($tag_data != "") { //Conversion face -> face - $new_id = photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description, $annotate_id); - $dest_type = "face"; - } elseif ($item_title != "") { //Conversion face -> note - $new_id = photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); - $dest_type = "note"; - $updatedface->delete(); //delete old face - } else { //Somethings wrong - json::reply(array("result" => "error", "message" => (string)$error_noselection)); - return; - } - break; - case "note": //the original annotation is a note - $updatednote = ORM::factory("items_note") //load the existing user - ->where("id", "=", $annotate_id) - ->find(); - if ($user_id != "") { //Conversion note -> user - $new_id = photoannotation::saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); - $dest_type = "user"; - $updatednote->delete(); //delete old note - } elseif ($tag_data != "") { //Conversion note -> face - $new_id = photoannotation::saveface($tag_data, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description); - $dest_type = "face"; - $updatednote->delete(); //delete old note - } elseif ($item_title != "") { //Conversion note -> note - $new_id = photoannotation::savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description, $annotate_id); - $dest_type = "note"; - } else { //Somethings wrong - json::reply(array("result" => "error", "message" => (string)$error_noselection)); - return; - } - break; - default: - json::reply(array("result" => "error", "message" => (string)$error_noselection)); - return; - } - } - $int_text = ""; - $editable = true; - switch ($dest_type) { - case "user": - $fullname = module::get_var("photoannotation", "fullname", false); - $int_text = $getuser->user->display_name() ." (". $getuser->user->name .")"; - if ($fullname) { - $note_text = $getuser->user->display_name(); - } else { - $note_text = $getuser->user->name; - } - $note_url = user_profile::url($getuser->user->id); - break; - case "face": - $note_text = $tag->name; - $note_url = $tag->url(); - break; - case "note": - $note_text = $item_title; - $note_url = ""; - $editable = false; - } - if ($annotate_id == -1) { - $annotation_id = ""; - } else { - $annotation_id = "photoannotation-area-". $notetype ."-". $annotate_id; - } - $reply = array("result" => "success", - "notetype" => (string)$dest_type, - "description" => (string)$description, - "height" => (integer)$_POST["height"], - "internaltext" => (string)$int_text, - "left" => (integer)$str_x1, - "noteid" => (integer)$new_id, - "text" => (string)$note_text, - "top" => (integer)$str_y1, - "url" => (string)$note_url, - "width" => (integer)$_POST["width"], - "editable" => (boolean)$editable, - "annotationid" => (string)$annotation_id, - "oldid" => (string)$annotate_id, - "oldtype" => (string)$notetype); - json::reply($reply); - } - - public function delete($item_data) { - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - //Get form data - $item = ORM::factory("item", $item_data); - $noteid = $_POST["noteid"]; - $notetype = $_POST["notetype"]; - $redir_uri = url::abs_site("{$item->type}s/{$item->id}"); - - if ($noteid == "") { - message::error(t("Please select a tag or note to delete.")); - url::redirect($redir_uri); - return; - } - switch ($notetype) { - case "user": - db::build()->delete("items_users")->where("id", "=", $noteid)->execute(); - break; - case "face": - db::build()->delete("items_faces")->where("id", "=", $noteid)->execute(); - break; - case "note": - db::build()->delete("items_notes")->where("id", "=", $noteid)->execute(); - break; - default: - message::error(t("Please select a tag or note to delete.")); - url::redirect($redir_uri); - return; - } - json::reply(array("result" => "success", "notetype" => (string)$notetype, "noteid" => (string)$noteid)); - } - - public function autocomplete() { - if (!identity::active_user()->guest || module::get_var("photoannotation", "allowguestsearch", false)) { - $users = array(); - $user_parts = explode(",", Input::instance()->get("q")); - $limit = Input::instance()->get("limit"); - $user_part = ltrim(end($user_parts)); - $user_list = ORM::factory("user") - ->where("name", "LIKE", "{$user_part}%") - ->or_where("full_name", "LIKE", "{$user_part}%") - ->order_by("full_name", "ASC") - ->limit($limit) - ->find_all(); - foreach ($user_list as $user) { - if ($user->name != "guest") { - $users[] = $user->display_name() ." (". $user->name .")"; - } - } - print implode("\n", $users); - } - } -} diff --git a/3.1/modules/photoannotation/css/colorpicker.css b/3.1/modules/photoannotation/css/colorpicker.css deleted file mode 100644 index 05b02b48..00000000 --- a/3.1/modules/photoannotation/css/colorpicker.css +++ /dev/null @@ -1,161 +0,0 @@ -.colorpicker { - width: 356px; - height: 176px; - overflow: hidden; - position: absolute; - background: url(../images/colorpicker_background.png); - font-family: Arial, Helvetica, sans-serif; - display: none; -} -.colorpicker_color { - width: 150px; - height: 150px; - left: 14px; - top: 13px; - position: absolute; - background: #f00; - overflow: hidden; - cursor: crosshair; -} -.colorpicker_color div { - position: absolute; - top: 0; - left: 0; - width: 150px; - height: 150px; - background: url(../images/colorpicker_overlay.png); -} -.colorpicker_color div div { - position: absolute; - top: 0; - left: 0; - width: 11px; - height: 11px; - overflow: hidden; - background: url(../images/colorpicker_select.gif); - margin: -5px 0 0 -5px; -} -.colorpicker_hue { - position: absolute; - top: 13px; - left: 171px; - width: 35px; - height: 150px; - cursor: n-resize; -} -.colorpicker_hue div { - position: absolute; - width: 35px; - height: 9px; - overflow: hidden; - background: url(../images/colorpicker_indic.gif) left top; - margin: -4px 0 0 0; - left: 0px; -} -.colorpicker_new_color { - position: absolute; - width: 60px; - height: 30px; - left: 213px; - top: 13px; - background: #f00; -} -.colorpicker_current_color { - position: absolute; - width: 60px; - height: 30px; - left: 283px; - top: 13px; - background: #f00; -} -.colorpicker input { - background-color: transparent; - border: 1px solid transparent; - position: absolute; - font-size: 10px; - font-family: Arial, Helvetica, sans-serif; - color: #898989; - top: 4px; - right: 11px; - text-align: right; - margin: 0; - padding: 0; - height: 11px; -} -.colorpicker_hex { - position: absolute; - width: 72px; - height: 22px; - background: url(../images/colorpicker_hex.png) top; - left: 212px; - top: 142px; -} -.colorpicker_hex input { - right: 6px; -} -.colorpicker_field { - height: 22px; - width: 62px; - background-position: top; - position: absolute; -} -.colorpicker_field span { - position: absolute; - width: 12px; - height: 22px; - overflow: hidden; - top: 0; - right: 0; - cursor: n-resize; -} -.colorpicker_rgb_r { - background-image: url(../images/colorpicker_rgb_r.png); - top: 52px; - left: 212px; -} -.colorpicker_rgb_g { - background-image: url(../images/colorpicker_rgb_g.png); - top: 82px; - left: 212px; -} -.colorpicker_rgb_b { - background-image: url(../images/colorpicker_rgb_b.png); - top: 112px; - left: 212px; -} -.colorpicker_hsb_h { - background-image: url(../images/colorpicker_hsb_h.png); - top: 52px; - left: 282px; -} -.colorpicker_hsb_s { - background-image: url(../images/colorpicker_hsb_s.png); - top: 82px; - left: 282px; -} -.colorpicker_hsb_b { - background-image: url(../images/colorpicker_hsb_b.png); - top: 112px; - left: 282px; -} -.colorpicker_submit { - position: absolute; - width: 22px; - height: 22px; - background: url(../images/colorpicker_submit.png) top; - left: 322px; - top: 142px; - overflow: hidden; -} -.colorpicker_focus { - background-position: center; -} -.colorpicker_hex.colorpicker_focus { - background-position: bottom; -} -.colorpicker_submit.colorpicker_focus { - background-position: bottom; -} -.colorpicker_slider { - background-position: bottom; -} diff --git a/3.1/modules/photoannotation/css/photoannotation.css b/3.1/modules/photoannotation/css/photoannotation.css deleted file mode 100644 index 696ae734..00000000 --- a/3.1/modules/photoannotation/css/photoannotation.css +++ /dev/null @@ -1,266 +0,0 @@ -.photoannotation-user-search { - border-bottom-style:solid; - border-bottom-width:1px; - padding: 0.8em 0.8em !important; -} - -#g-user-cloud ul { - font-size: 1.2em; - text-align: justify; -} - -#g-user-cloud ul li { - display: inline; - line-height: 1.5em; - text-align: justify; -} - -#g-user-cloud ul li a { - text-decoration: none; -} - -#g-user-cloud ul li span { - display: none; -} - -#g-user-cloud ul li.size1 a { - color: #9cf; - font-size: 80%; - font-weight: 100; -} - -#g-user-cloud ul li.size2 a { - color: #69f; - font-size: 90%; - font-weight: 300; -} - -#g-user-cloud ul li.size3 a { - color: #69c; - font-size: 100%; - font-weight: 500; -} - -#g-user-cloud ul li.size4 a { - color: #369; - font-size: 110%; - font-weight: 700; -} - -#g-user-cloud ul li.size5 a { - color: #0e2b52; - font-size: 120%; - font-weight: 900; -} - -#g-user-cloud ul li.size6 a { - color: #0e2b52; - font-size: 130%; - font-weight: 900; -} - -#g-user-cloud ul li.size7 a { - color: #0e2b52; - font-size: 140%; - font-weight: 900; -} - -#g-user-cloud ul li a:hover { - color: #f30; - text-decoration: underline; -} -.image-annotate-canvas { - background-position: left top; - background-repeat: no-repeat; - display: block; - margin: 0 auto; - position: relative; -} -.image-annotate-view { - display: none; - position: relative; -} -.image-annotate-area { - position: absolute; - cursor: default; -} -.image-annotate-area div { - display: block; -} -.image-annotate-area-editable { - cursor: pointer; -} -.image-annotate-note { - background: #000000 none repeat scroll 0 0; - color: #FFFFFF; - display: none; - font-family: Verdana, Sans-Serif; - font-size: 0.9em; - max-width: 200px; - padding: 3px 7px; - position: absolute; -} -.image-annotate-note .actions { - display: block; - font-size: 80%; -} -.image-annotate-edit { - display: none; - direction: ltr !important; -} -#image-annotate-edit-form { - background: #FFFFFF none repeat scroll 0 0; - border: 1px solid #000000; - padding: 7px; - position: absolute; - width: 250px; -} -.image-annotate-rtl form { - text-align: right !important; -} -#image-annotate-edit-form form { - clear: right; - margin: 0 !important; - padding: 0; - z-index: 999; - text-align: left; - color: #000000; -} -#image-annotate-edit-form .box { - margin: 0; -} -#image-annotate-edit-form input.form-text, #image-annotate-edit-form #edit-comment-wrapper textarea { - width: 90%; -} -#image-annotate-edit-form textarea { - height: 50px; - font-family: Verdana, Sans-Serif; - font-size: 12px; - width: 248px; - resize: none; -} -#image-annotate-edit-form fieldset { - background: transparent none repeat scroll 0 0; -} -#image-annotate-edit-form .form-item { - margin: 0 0 5px; -} -#image-annotate-edit-form .form-button, #image-annotate-edit-form .form-submit { - margin: 0; -} -#image-annotate-edit-form a { - cursor: pointer; - display: block; - float: left; - margin: 3px 6px 3px 0; -} -.image-annotate-rtl a { - float: right !important; - margin: 3px 0 3px 6px !important; -} -.inmage-annotate-dialog button{ - float: left !important; -} -.inmage-annotate-dialog-rtl button{ - float: left !important; -} -.image-annotate-edit-area { - border: 1px solid black; - cursor: move; - display: block; - height: 60px; - left: 10px; - margin: 0; - padding: 0; - position: absolute; - top: 10px; - width: 60px; -} -.image-annotate-edit-area .ui-resizable-handle { - opacity: 0.8; -} -.image-annotate-edit-ok { - /*background-image: url(../images/accept.png);*/ -} -.image-annotate-edit-delete { - background-image: url(../images/delete.png); -} -.image-annotate-edit-close { - /*background-image: url(../images/cross.png);*/ -} -.ui-resizable { - position: relative; -} -.ui-resizable-handle { - position: absolute; - font-size: 0.1px; - z-index: 99999; - display: block; -} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable- autohide .ui-resizable-handle { - display: block; -} -.ui-resizable-n { - cursor: n-resize; - height: 7px; - width: 100%; - top: -5px; - left: 0px; -} -.ui-resizable-s { - cursor: s-resize; - height: 7px; - width: 100%; - bottom: -5px; - left: 0px; -} -.ui-resizable-e { - cursor: e-resize; - width: 7px; - right: -5px; - top: 0px; - height: 100%; -} -.ui-resizable-w { - cursor: w-resize; - width: 7px; - left: -5px; - top: 0px; - height: 100%; -} -.ui-resizable-se { - cursor: se-resize; - width: 12px; - height: 12px; - right: 1px; - bottom: 1px; -} -.ui-resizable-sw { - cursor: sw-resize; - width: 9px; - height: 9px; - left: -5px; - bottom: -5px; -} -.ui-resizable-nw { - cursor: nw-resize; - width: 9px; - height: 9px; - left: -5px; - top: -5px; -} -.ui-resizable-ne { - cursor: ne-resize; - width: 9px; - height: 9px; - right: -5px; - top: -5px; -} -.photoannotation-del-button { - background-image: url('../images/delete.png'); - cursor: pointer; -} -.photoannotation-edit-button { - background-image: url('../images/edit.png'); - cursor: pointer; -} diff --git a/3.1/modules/photoannotation/helpers/photoannotation.php b/3.1/modules/photoannotation/helpers/photoannotation.php deleted file mode 100644 index 54d1e2e6..00000000 --- a/3.1/modules/photoannotation/helpers/photoannotation.php +++ /dev/null @@ -1,278 +0,0 @@ -escape($q) ."*"; - if ($q == "*") { - $users = ORM::factory("user"); - $count = $users->count_all(); - $data = $users->order_by("name", "ASC")->find_all($page_size, $offset); - return array($count, $data); - } else { - $query = - "SELECT SQL_CALC_FOUND_ROWS {users}.*, " . - " MATCH({users}.`name`) AGAINST ('$q' IN BOOLEAN MODE) AS `score` " . - "FROM {users} " . - "WHERE MATCH({users}.`name`, {users}.`full_name`) AGAINST ('$q' IN BOOLEAN MODE) " . - "ORDER BY `score` DESC " . - "LIMIT $page_size OFFSET $offset"; - $data = $db->query($query); - $count = $db->query("SELECT FOUND_ROWS() as c")->current()->c; - return array($count, new ORM_Iterator(ORM::factory("user"), $data)); - } - } - - static function get_user_search_form($form_id) { - $form = new Forge("photoannotation/showuser", "", "post", array("id" => $form_id, "class" => "g-short-form")); - $label = t("Search for a person"); - - $group = $form->group("showuser")->label("Search for a person"); - $group->input("name")->label($label)->id("name"); - $group->submit("")->value(t("Search")); - return $form; - } - - public static function getuser($user_string) { - $user_parts = explode("(", $user_string); - $user_part = rtrim(ltrim(end($user_parts)), ")"); - $user = ORM::factory("user")->where("name", "=", $user_part)->find(); - $user_firstpart = trim(implode(array_slice($user_parts, 0, count($user_parts)-1))); - if (!$user->loaded() || strcasecmp($user_firstpart, $user->display_name()) <> 0) { - $result->found = false; - $result->isguest = false; - $result->user = ""; - return $result; - } - if (identity::guest()->id == $user->id) { - $result->found = true; - $result->isguest = true; - $result->user = ""; - return $result; - } - $result->found = true; - $result->isguest = false; - $result->user = $user; - return $result; - } - - public static function saveuser($user_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description) { - //Since we are associating a user we will remove any old annotation of this user on this photo - $item_old_users = ORM::factory("items_user") - ->where("user_id", "=", $user_id) - ->where("item_id", "=", $item_id) - ->find_all(); - if (count($item_old_users) > 1) { - foreach ($item_old_users as $item_old_user) { - $item_old_user->delete(); - } - $item_user = ORM::factory("items_user"); - } elseif (count($item_old_users) == 1) { - $item_user = ORM::factory("items_user", $item_old_users[0]->id); - } else { - $item_user = ORM::factory("items_user"); - photoannotation::send_notifications($user_id, $item_id, "newtag"); - } - $item_user->user_id = $user_id; - $item_user->item_id = $item_id; - $item_user->x1 = $str_x1; - $item_user->y1 = $str_y1; - $item_user->x2 = $str_x2; - $item_user->y2 = $str_y2; - $item_user->description = $description; - $item_user->save(); - return $item_user->id; - } - - public static function saveface($tag_id, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description, $annotate_id = "") { - if ($annotate_id == "") { - $item_face = ORM::factory("items_face"); - } else { - $item_face = ORM::factory("items_face") - ->where("id", "=", $annotate_id) - ->find(); - } - $item_face->tag_id = $tag_id; - $item_face->item_id = $item_id; - $item_face->x1 = $str_x1; - $item_face->y1 = $str_y1; - $item_face->x2 = $str_x2; - $item_face->y2 = $str_y2; - $item_face->description = $description; - $item_face->save(); - return $item_face->id; - } - - public static function savenote($item_title, $item_id, $str_x1, $str_y1, $str_x2, $str_y2, $description, $annotate_id = "") { - if ($annotate_id == "") { - $item_note = ORM::factory("items_note"); - } else { - $item_note = ORM::factory("items_note") - ->where("id", "=", $annotate_id) - ->find(); - } - $item_note->item_id = $item_id; - $item_note->x1 = $str_x1; - $item_note->y1 = $str_y1; - $item_note->x2 = $str_x2; - $item_note->y2 = $str_y2; - $item_note->title = $item_title; - $item_note->description = $description; - $item_note->save(); - return $item_note->id; - } - - public static function send_notifications($recipient_id, $item_id, $mailtype) { - //Load the item - $item = ORM::factory("item")->where("id", "=", $item_id)->find(); - if (!$item->loaded()) { - return false; - } - //Load the user - $recipient = ORM::factory("user")->where("id", "=", $recipient_id)->find(); - if (!$recipient->loaded()) { - return false; - } - //Only send mail if the notifications are switched on globally - if (!module::get_var("photoannotation", "nonotifications", false)) { - //Check if the use has a valid e-mail - if (!valid::email($recipient->email)) { - return false; - } - //Get the users settings - $notification_settings = self::get_user_notification_settings($recipient); - //Check which type of mail to send - switch ($mailtype) { - case "newtag": - //Only send if user has this option enabled - if ($notification_settings->newtag) { - //Get subject and body and send the mail - $subject = module::get_var("photoannotation", "newtagsubject", "Someone tagged a photo of you"); - $body = module::get_var("photoannotation", "newtagbody", "Hello %name, please visit %url to view the photo."); - $body = str_ireplace(array("%url", "%name"), array($item->abs_url(), $recipient->display_name()), $body); - return self::_send_mail($recipient->email, $subject, $body); - } - break; - case "newcomment": - //Only send if user has this option enabled - if ($notification_settings->comment) { - //Don't send if the notification module is active and the user is watching this item - if (module::is_active("notification")) { - if (notification::is_watching($item, $recipient)) { - return false; - } - } - //Get subject and body and send the mail - $subject = module::get_var("photoannotation", "newcommentsubject", "Someone added a comment to photo of you"); - $body = module::get_var("photoannotation", "newcommentbody", "Hello %name, please visit %url to read the comment."); - $body = str_ireplace(array("%url", "%name"), array($item->abs_url(), $recipient->display_name()), $body); - return self::_send_mail($recipient->email, $subject, $body); - } - break; - case "updatecomment": - //Only send if user has this option enabled - if ($notification_settings->comment) { - //Don't send if the notification module is active and the user is watching this item - if (module::is_active("notification")) { - if (notification::is_watching($item, $recipient)) { - return false; - } - } - //Get subject and body and send the mail - $subject = module::get_var("photoannotation", "updatedcommentsubject", "Someone updated a comment to photo of you"); - $body = module::get_var("photoannotation", "updatedcommentbody", "Hello %name, please visit %url to read the comment."); - $body = str_ireplace(array("%url", "%name"), array($item->abs_url(), $recipient->display_name()), $body); - return self::_send_mail($recipient->email, $subject, $body); - } - } - } - return false; - } - - private static function _send_mail($mailto, $subject, $message) { - //Send the notification mail - $message = nl2br($message); - return Sendmail::factory() - ->to($mailto) - ->subject($subject) - ->header("Mime-Version", "1.0") - ->header("Content-type", "text/html; charset=utf-8") - ->message($message) - ->send(); - } - - public static function get_user_notification_settings($user) { - //Try loading the notification settings of user - $notification_settings = ORM::factory("photoannotation_notification")->where("user_id", "=", $user->id)->find(); - if (!$notification_settings->loaded()) { - //If the user did not save his settings use the website default - $notify = module::get_var("photoannotation", "notificationoptout", false); - $notification_settings = ORM::factory("photoannotation_notification"); - $notification_settings->user_id = $user->id; - $notification_settings->newtag = $notify; - $notification_settings->comment = $notify; - $notification_settings->save(); - } - return $notification_settings; - } - - static function cloud($count) { - $users = ORM::factory("user")->order_by("name", "ASC")->find_all(); - if ($users) { - $cloud = new View("photoannotation_cloud.html"); - $fullname = module::get_var("photoannotation", "fullname", false); - foreach ($users as $user) { - $annotations = ORM::factory("items_user")->where("user_id", "=", $user->id)->count_all(); - if ($annotations > 0) { - if ($annotations > $maxcount) { - $maxcount = $annotations; - } - if ($fullname) { - $user_array[$user->name]->name = $user->display_name(); - } else { - $user_array[$user->name]->name = $user->name; - } - $user_array[$user->name]->size = $annotations; - $user_array[$user->name]->url = user_profile::url($user->id); - } - } - if (isset($user_array)) { - $cloud->users = array_slice($user_array, 0, $count); - $cloud->max_count = $maxcount; - return $cloud; - } else { - return ""; - } - } - } - - static function comment_count($user_id) { - if (module::is_active("comment")) { - return ORM::factory("comment")->where("author_id", "=", $user_id)->count_all(); - } else { - return false; - } - } - - static function annotation_count($user_id) { - return ORM::factory("items_user")->where("user_id", "=", $user_id)->count_all(); - } -} diff --git a/3.1/modules/photoannotation/helpers/photoannotation_block.php b/3.1/modules/photoannotation/helpers/photoannotation_block.php deleted file mode 100644 index b627e588..00000000 --- a/3.1/modules/photoannotation/helpers/photoannotation_block.php +++ /dev/null @@ -1,40 +0,0 @@ - t("Users")); - } - - static function get($block_id, $theme) { - $block = ""; - if (!identity::active_user()->guest || module::get_var("photoannotation", "allowguestsearch", false)) { - switch ($block_id) { - case "photoannotation": - $block = new Block(); - $block->css_id = "g-photoannotation"; - $block->title = t("People"); - $block->content = new View("photoannotation_block.html"); - $block->content->cloud = photoannotation::cloud(30); - $block->content->form = photoannotation::get_user_search_form("g-user-cloud-form"); - } - } - return $block; - } -} diff --git a/3.1/modules/photoannotation/helpers/photoannotation_event.php b/3.1/modules/photoannotation/helpers/photoannotation_event.php deleted file mode 100644 index 3b79c824..00000000 --- a/3.1/modules/photoannotation/helpers/photoannotation_event.php +++ /dev/null @@ -1,248 +0,0 @@ -deactivate)) { - site_status::warning( - t("The Photo Annotation module requires the Tags module. " . - "Activate the Tags module now", - array("url" => url::site("admin/modules"))), - "photoannotation_needs_tag"); - } else { - site_status::clear("photoannotation_needs_tag"); - } - if (module::is_active("tagfaces") || in_array("tagfaces", $changes->activate)) { - site_status::warning( - t("The Photo Annotation module cannot be used together with the TagFaces module. " . - "Dectivate the TagFaces module now", - array("url" => url::site("admin/modules"))), - "photoannotation_incompatibility_tagfaces"); - } else { - site_status::clear("photoannotation_incompatibility_tagfaces"); - } - } - - static function site_menu($menu, $theme) { - // Create a menu option for adding face data. - if (!$theme->item()) { - return; - } - $item = $theme->item(); - if ($item->is_photo()) { - if ((access::can("view", $item)) && (access::can("edit", $item))) { - $menu->get("options_menu") - ->append(Menu::factory("link") - ->id("photoannotation") - ->label(t("Add annotation")) - ->css_id("g-photoannotation-link") - ->url("#")); - } - } - } - - static function item_deleted($item) { - // Check for and delete existing Faces and Notes. - $existingFaces = ORM::factory("items_face") - ->where("item_id", "=", $item->id) - ->find_all(); - if (count($existingFaces) > 0) { - db::build()->delete("items_faces")->where("item_id", "=", $item->id)->execute(); - } - - $existingNotes = ORM::factory("items_note") - ->where("item_id", "=", $item->id) - ->find_all(); - if (count($existingNotes) > 0) { - db::build()->delete("items_notes")->where("item_id", "=", $item->id)->execute(); - } - - $existingUsers = ORM::factory("items_user") - ->where("item_id", "=", $item->id) - ->find_all(); - if (count($existingUsers) > 0) { - db::build()->delete("items_users")->where("item_id", "=", $item->id)->execute(); - } - } - - static function user_deleted($old) { - // Check for and delete existing Annotations linked to that user. - $existingFaces = ORM::factory("items_user") - ->where("user_id", "=", $old->id) - ->find_all(); - if (count($existingFaces) > 0) { - $onuserdelete = module::get_var("photoannotation", "onuserdelete", "0"); - if (module::get_var("photoannotation", "fullname", false)) { - $new_tag_name = $old->display_name(); - } else { - $new_tag_name = $old->name; - } - switch ($onuserdelete) { - case "1": - //convert to tag - $tag = ORM::factory("tag")->where("name", "=", $new_tag_name)->find(); - if (!$tag->loaded()) { - $tag->name = $new_tag_name; - $tag->count = 0; - } - foreach ($existingFaces as $existingFace) { - $item = ORM::factory("item")->where("id", "=", $existingFace->item_id)->find(); - $tag->add($item); - $tag->count++; - $tag->save(); - photoannotation::saveface($tag->id, $existingFace->item_id, $existingFace->x1, $existingFace->y1, $existingFace->x2, $existingFace->y2, $existingFace->description); - } - break; - case "2": - //convert to note - foreach ($existingFaces as $existingFace) { - photoannotation::savenote($new_tag_name, $existingFace->item_id, $existingFace->x1, $existingFace->y1, $existingFace->x2, $existingFace->y2, $existingFace->description); - } - } - db::build()->delete("items_users")->where("user_id", "=", $old->id)->execute(); - } - // Delete notification settings - $notification_settings = ORM::factory("photoannotation_notification") - ->where("user_id", "=", $old->id) - ->find(); - if ($notification_settings->loaded()) { - $notification_settings->delete(); - } - } - - static function user_created($user) { - // Write notification settings - $notify = module::get_var("photoannotation", "notificationoptout", false); - $notification_settings = ORM::factory("photoannotation_notification"); - $notification_settings->user_id = $user->id; - $notification_settings->newtag = $notify; - $notification_settings->comment = $notify; - $notification_settings->save(); - } - - static function admin_menu($menu, $theme) { - $menu->get("settings_menu") - ->append(Menu::factory("link") - ->id("photoannotation_menu") - ->label(t("Photo Annotation")) - ->url(url::site("admin/photoannotation"))); - } - - static function show_user_profile($data) { - $view = new Theme_View("dynamic.html", "collection", "userprofiles"); - //load thumbs - $item_users = ORM::factory("items_user")->where("user_id", "=", $data->user->id)->find_all(); - foreach ($item_users as $item_user) { - $item_thumb = ORM::factory("item") - ->viewable() - ->where("type", "!=", "album") - ->where("id", "=", $item_user->item_id) - ->find(); - if ($item_thumb->loaded()) { - $item_thumbs[] = $item_thumb; - } - } - $children_count = count($item_thumbs); - $page_size = module::get_var("gallery", "page_size", 9); - $page = (int) Input::instance()->get("page", "1"); - $offset = ($page-1) * $page_size; - $max_pages = max(ceil($children_count / $page_size), 1); - - // Make sure that the page references a valid offset - if ($page < 1) { - url::redirect($album->abs_url()); - } else if ($page > $max_pages) { - url::redirect($album->abs_url("page=$max_pages")); - } - if ($page < $max_pages) { - $next_page_url = url::site("user_profile/show/". $data->user->id ."?page=". ($page + 1)); - $view->set_global("next_page_url", $next_page_url); - $view->set_global("first_page_url", url::site("user_profile/show/". $data->user->id ."?page=". $max_pages)); - } - - if ($page > 1) { - $view->set_global("previous_page_url", url::site("user_profile/show/". $data->user->id ."?page=". ($page - 1))); - $view->set_global("first_page_url", url::site("user_profile/show/". $data->user->id ."?page=1")); - } - $view->set_global("page", $page); - $view->set_global("max_pages", $max_pages); - $view->set_global("page_size", $page_size); - $view->set_global("children", array_slice($item_thumbs, $offset, $page_size));; - $view->set_global("children_count", $children_count); - $view->set_global("total", $max_pages); - $view->set_global("position", t("Page") ." ". $page); - if ($children_count > 0) { - $data->content[] = (object)array("title" => t("Photos"), "view" => $view); - } - } - - static function user_edit_form($user, $form) { - // Allow users to modify notification settings. - if (!module::get_var("photoannotation", "nonotifications", false)) { - $notification_settings = photoannotation::get_user_notification_settings($user); - $user_notification = $form->edit_user->group("edit_notification")->label("Tag notifications"); - $user_notification->checkbox("photoannotation_newtag")->label(t("Notify me when a tag is added to a photo with me")) - ->checked($notification_settings->newtag); - $user_notification->checkbox("photoannotation_comment")->label(t("Notify me if someone comments on a photo with me on it")) - ->checked($notification_settings->comment); - } - } - - static function user_edit_form_completed($user, $form) { - // Save notification settings. - if (!module::get_var("photoannotation", "nonotifications", false)) { - $notification_settings = ORM::factory("photoannotation_notification")->where("user_id", "=", $user->id)->find(); - if (!$notification_settings->loaded()) { - $notification_settings = ORM::factory("photoannotation_notification"); - $notification_settings->user_id = $user->id; - } - $notification_settings->newtag = $form->edit_user->edit_notification->photoannotation_newtag->value; - $notification_settings->comment = $form->edit_user->edit_notification->photoannotation_comment->value; - $notification_settings->save(); - } - } - - static function comment_created($comment) { - //Check if there are any user annotations on the photo and send notification if applicable - $item_users = ORM::factory("items_user")->where("item_id", "=", $comment->item_id)->find_all(); - if (count($item_users) > 0) { - foreach ($item_users as $item_user) { - //Don't send if the commenter is the user to be notified - if ($comment->author_id != $item_user->user_id && module::is_active("notification")) { - photoannotation::send_notifications($item_user->user_id, $comment->item_id, "newcomment"); - } - } - } - } - - static function comment_updated($comment) { - //Check if there are any user annotations on the photo and send notification if applicable - $item_users = ORM::factory("items_user")->where("item_id", "=", $comment->item_id)->find_all(); - if (count($item_users) > 0) { - foreach ($item_users as $item_user) { - //Don't send if the commenter is the user to be notified - if ($comment->author_id != $item_user->user_id && module::is_active("notification")) { - photoannotation::send_notifications($item_user->user_id, $comment->item_id, "updatedcomment"); - } - } - } - } -} diff --git a/3.1/modules/photoannotation/helpers/photoannotation_installer.php b/3.1/modules/photoannotation/helpers/photoannotation_installer.php deleted file mode 100644 index 2f82c065..00000000 --- a/3.1/modules/photoannotation/helpers/photoannotation_installer.php +++ /dev/null @@ -1,119 +0,0 @@ -query("CREATE TABLE IF NOT EXISTS {items_faces} ( - `id` int(9) NOT NULL auto_increment, - `tag_id` int(9) NOT NULL, - `item_id` int(9) NOT NULL, - `x1` int(9) NOT NULL, - `y1` int(9) NOT NULL, - `x2` int(9) NOT NULL, - `y2` int(9) NOT NULL, - `description` varchar(2048) default NULL, - PRIMARY KEY (`id`)) - DEFAULT CHARSET=utf8;"); - - $db->query("CREATE TABLE IF NOT EXISTS {items_notes} ( - `id` int(9) NOT NULL auto_increment, - `item_id` int(9) NOT NULL, - `x1` int(9) NOT NULL, - `y1` int(9) NOT NULL, - `x2` int(9) NOT NULL, - `y2` int(9) NOT NULL, - `title` varchar(64) NOT NULL, - `description` varchar(2048) default NULL, - PRIMARY KEY (`id`)) - DEFAULT CHARSET=utf8;"); - - $db->query("CREATE TABLE IF NOT EXISTS {items_users} ( - `id` int(9) NOT NULL auto_increment, - `user_id` int(9) NOT NULL, - `item_id` int(9) NOT NULL, - `x1` int(9) NOT NULL, - `y1` int(9) NOT NULL, - `x2` int(9) NOT NULL, - `y2` int(9) NOT NULL, - `description` varchar(2048) default NULL, - PRIMARY KEY (`id`)) - DEFAULT CHARSET=utf8;"); - - $db->query("CREATE TABLE IF NOT EXISTS {photoannotation_notifications} ( - `id` int(9) NOT NULL auto_increment, - `user_id` int(9) NOT NULL unique, - `newtag` int(2) default NULL, - `comment` int(2) default NULL, - PRIMARY KEY (`id`)) - DEFAULT CHARSET=utf8;"); - - // Set the module's version number. - module::set_version("photoannotation", 4); - } - - static function upgrade($version) { - if ($version == 1) { - module::set_version("photoannotation", $version = 2); - } - if ($version == 2) { - $db = Database::instance(); - $db->query("CREATE TABLE IF NOT EXISTS {items_users} ( - `id` int(9) NOT NULL auto_increment, - `user_id` int(9) NOT NULL, - `item_id` int(9) NOT NULL, - `x1` int(9) NOT NULL, - `y1` int(9) NOT NULL, - `x2` int(9) NOT NULL, - `y2` int(9) NOT NULL, - `description` varchar(2048) default NULL, - PRIMARY KEY (`id`)) - DEFAULT CHARSET=utf8;"); - module::set_version("photoannotation", $version = 3); - } - if ($version == 3) { - $db = Database::instance(); - $db->query("CREATE TABLE IF NOT EXISTS {photoannotation_notifications} ( - `id` int(9) NOT NULL auto_increment, - `user_id` int(9) NOT NULL unique, - `newtag` int(2) default NULL, - `comment` int(2) default NULL, - PRIMARY KEY (`id`)) - DEFAULT CHARSET=utf8;"); - module::set_version("photoannotation", $version = 4); - } - } - - static function deactivate() { - // Clear the require tags message when photoannotation is deactivated. - site_status::clear("photoannotation_needs_tag"); - site_status::clear("photoannotation_incompatibility_tagfaces"); - } - - static function uninstall() { - // Delete the face table before uninstalling. - $db = Database::instance(); - $db->query("DROP TABLE IF EXISTS {items_faces};"); - $db->query("DROP TABLE IF EXISTS {items_notes};"); - $db->query("DROP TABLE IF EXISTS {items_users};"); - $db->query("DROP TABLE IF EXISTS {photoannotation_notifications};"); - module::delete("photoannotation"); - } -} diff --git a/3.1/modules/photoannotation/helpers/photoannotation_theme.php b/3.1/modules/photoannotation/helpers/photoannotation_theme.php deleted file mode 100644 index d31ddf35..00000000 --- a/3.1/modules/photoannotation/helpers/photoannotation_theme.php +++ /dev/null @@ -1,81 +0,0 @@ -css("photoannotation.css"); - if ($theme->page_subtype == "photo") { - $v .= $theme->script("jquery.annotate.min.js"); - $noborder = module::get_var("photoannotation", "noborder", false); - $noclickablehover = module::get_var("photoannotation", "noclickablehover", false); - $nohover = module::get_var("photoannotation", "nohover", false); - $bordercolor = "#". module::get_var("photoannotation", "bordercolor", "000000"); - $v .= "\n"; - return $v; - } - } - - static function resize_bottom($theme) { - if ($theme->page_subtype == "photo") { - return new View("photoannotation_highlight_block.html"); - } - } - - static function admin_head($theme) { - if (strpos($theme->content->kohana_filename, "admin_photoannotation.html.php")) { - return $theme->css("colorpicker.css") - . $theme->script("jquery.colorpicker.min.js"); - } - } - -} diff --git a/3.1/modules/photoannotation/images/blank.gif b/3.1/modules/photoannotation/images/blank.gif deleted file mode 100644 index 75b945d2..00000000 Binary files a/3.1/modules/photoannotation/images/blank.gif and /dev/null differ diff --git a/3.1/modules/photoannotation/images/colorpicker_background.png b/3.1/modules/photoannotation/images/colorpicker_background.png deleted file mode 100644 index 8401572f..00000000 Binary files a/3.1/modules/photoannotation/images/colorpicker_background.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/colorpicker_hex.png b/3.1/modules/photoannotation/images/colorpicker_hex.png deleted file mode 100644 index 4e532d7c..00000000 Binary files a/3.1/modules/photoannotation/images/colorpicker_hex.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/colorpicker_hsb_b.png b/3.1/modules/photoannotation/images/colorpicker_hsb_b.png deleted file mode 100644 index dfac595d..00000000 Binary files a/3.1/modules/photoannotation/images/colorpicker_hsb_b.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/colorpicker_hsb_h.png b/3.1/modules/photoannotation/images/colorpicker_hsb_h.png deleted file mode 100644 index 3977ed9f..00000000 Binary files a/3.1/modules/photoannotation/images/colorpicker_hsb_h.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/colorpicker_hsb_s.png b/3.1/modules/photoannotation/images/colorpicker_hsb_s.png deleted file mode 100644 index a2a69973..00000000 Binary files a/3.1/modules/photoannotation/images/colorpicker_hsb_s.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/colorpicker_indic.gif b/3.1/modules/photoannotation/images/colorpicker_indic.gif deleted file mode 100644 index f9fa95e2..00000000 Binary files a/3.1/modules/photoannotation/images/colorpicker_indic.gif and /dev/null differ diff --git a/3.1/modules/photoannotation/images/colorpicker_overlay.png b/3.1/modules/photoannotation/images/colorpicker_overlay.png deleted file mode 100644 index 561cdd9c..00000000 Binary files a/3.1/modules/photoannotation/images/colorpicker_overlay.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/colorpicker_rgb_b.png b/3.1/modules/photoannotation/images/colorpicker_rgb_b.png deleted file mode 100644 index dfac595d..00000000 Binary files a/3.1/modules/photoannotation/images/colorpicker_rgb_b.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/colorpicker_rgb_g.png b/3.1/modules/photoannotation/images/colorpicker_rgb_g.png deleted file mode 100644 index 72b32760..00000000 Binary files a/3.1/modules/photoannotation/images/colorpicker_rgb_g.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/colorpicker_rgb_r.png b/3.1/modules/photoannotation/images/colorpicker_rgb_r.png deleted file mode 100644 index 4855fe03..00000000 Binary files a/3.1/modules/photoannotation/images/colorpicker_rgb_r.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/colorpicker_select.gif b/3.1/modules/photoannotation/images/colorpicker_select.gif deleted file mode 100644 index 599f7f13..00000000 Binary files a/3.1/modules/photoannotation/images/colorpicker_select.gif and /dev/null differ diff --git a/3.1/modules/photoannotation/images/colorpicker_submit.png b/3.1/modules/photoannotation/images/colorpicker_submit.png deleted file mode 100644 index 566fe2dd..00000000 Binary files a/3.1/modules/photoannotation/images/colorpicker_submit.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/custom_background.png b/3.1/modules/photoannotation/images/custom_background.png deleted file mode 100644 index cf55ffdd..00000000 Binary files a/3.1/modules/photoannotation/images/custom_background.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/custom_hex.png b/3.1/modules/photoannotation/images/custom_hex.png deleted file mode 100644 index 888f4444..00000000 Binary files a/3.1/modules/photoannotation/images/custom_hex.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/custom_hsb_b.png b/3.1/modules/photoannotation/images/custom_hsb_b.png deleted file mode 100644 index 2f99dae8..00000000 Binary files a/3.1/modules/photoannotation/images/custom_hsb_b.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/custom_hsb_h.png b/3.1/modules/photoannotation/images/custom_hsb_h.png deleted file mode 100644 index a217e921..00000000 Binary files a/3.1/modules/photoannotation/images/custom_hsb_h.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/custom_hsb_s.png b/3.1/modules/photoannotation/images/custom_hsb_s.png deleted file mode 100644 index 7826b415..00000000 Binary files a/3.1/modules/photoannotation/images/custom_hsb_s.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/custom_indic.gif b/3.1/modules/photoannotation/images/custom_indic.gif deleted file mode 100644 index 222fb94c..00000000 Binary files a/3.1/modules/photoannotation/images/custom_indic.gif and /dev/null differ diff --git a/3.1/modules/photoannotation/images/custom_rgb_b.png b/3.1/modules/photoannotation/images/custom_rgb_b.png deleted file mode 100644 index 80764e5d..00000000 Binary files a/3.1/modules/photoannotation/images/custom_rgb_b.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/custom_rgb_g.png b/3.1/modules/photoannotation/images/custom_rgb_g.png deleted file mode 100644 index fc9778be..00000000 Binary files a/3.1/modules/photoannotation/images/custom_rgb_g.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/custom_rgb_r.png b/3.1/modules/photoannotation/images/custom_rgb_r.png deleted file mode 100644 index 91b0cd4c..00000000 Binary files a/3.1/modules/photoannotation/images/custom_rgb_r.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/custom_submit.png b/3.1/modules/photoannotation/images/custom_submit.png deleted file mode 100644 index cd202cd9..00000000 Binary files a/3.1/modules/photoannotation/images/custom_submit.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/delete.png b/3.1/modules/photoannotation/images/delete.png deleted file mode 100644 index 13eccb1c..00000000 Binary files a/3.1/modules/photoannotation/images/delete.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/edit.png b/3.1/modules/photoannotation/images/edit.png deleted file mode 100644 index 6dbcb679..00000000 Binary files a/3.1/modules/photoannotation/images/edit.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/select.png b/3.1/modules/photoannotation/images/select.png deleted file mode 100644 index 21213bfd..00000000 Binary files a/3.1/modules/photoannotation/images/select.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/select2.png b/3.1/modules/photoannotation/images/select2.png deleted file mode 100644 index 2cd2cabe..00000000 Binary files a/3.1/modules/photoannotation/images/select2.png and /dev/null differ diff --git a/3.1/modules/photoannotation/images/slider.png b/3.1/modules/photoannotation/images/slider.png deleted file mode 100644 index 8b03da96..00000000 Binary files a/3.1/modules/photoannotation/images/slider.png and /dev/null differ diff --git a/3.1/modules/photoannotation/js/jquery.annotate.js b/3.1/modules/photoannotation/js/jquery.annotate.js deleted file mode 100644 index a483bb4f..00000000 --- a/3.1/modules/photoannotation/js/jquery.annotate.js +++ /dev/null @@ -1,694 +0,0 @@ -/// -(function($) { - - $.fn.annotateImage = function(options) { - /// - /// Creates annotations on the given image. - /// Images are loaded from the "getUrl" propety passed into the options. - /// - var opts = $.extend({}, $.fn.annotateImage.defaults, options); - var image = this; - - this.image = this; - this.mode = 'view'; - - // Assign defaults - this.getUrl = opts.getUrl; - this.saveUrl = opts.saveUrl; - this.deleteUrl = opts.deleteUrl; - this.deleteUrl = opts.deleteUrl; - this.editable = opts.editable; - this.useAjax = opts.useAjax; - this.tags = opts.tags; - this.notes = opts.notes; - this.labels = opts.labels; - this.csrf = opts.csrf; - this.cssaclass = opts.cssaclass; - this.rtlsupport = opts.rtlsupport; - this.users = opts.users; - anchor = $('.g-fullsize-link'); - - // Add the canvas - this.canvas = $('
      '); - this.canvas.children('.image-annotate-edit').hide(); - this.canvas.children('.image-annotate-view').hide(); - $('#g-photo').after(this.canvas); - - // Give the canvas and the container their size and background - this.canvas.height(this.height()); - this.canvas.width(this.width()); - this.canvas.css('background-image', 'url("' + this.attr('src') + '")'); - this.canvas.children('.image-annotate-view, .image-annotate-edit').height(this.height()); - this.canvas.children('.image-annotate-view, .image-annotate-edit').width(this.width()); - - // Add the behavior: hide/show the notes when hovering the picture - this.canvas.hover(function() { - if ($(this).children('.image-annotate-edit').css('display') == 'none') { - $(this).children('.image-annotate-view').show(); - $("#photoannotation-fullsize").show(); - } - }, function() { - $(this).children('.image-annotate-view').hide(); - $(this).children('.image-annotate-note').hide(); - $("#photoannotation-fullsize").hide(); - }); - - this.canvas.children('.image-annotate-view').hover(function() { - $(this).show(); - }, function() { - $(this).hide(); - $(this).children('.image-annotate-note').hide(); - }); - - // load the notes - if (this.useAjax) { - $.fn.annotateImage.ajaxLoad(this); - } else { - $.fn.annotateImage.load(this, this.labels, this.editable, this.csrf, this.deleteUrl, this.tags, this.saveUrl, this.cssaclass, this.rtlsupport, this.users); - } - - // Add the "Add a note" button - if ($('#g-photoannotation-link').length !== 0) { - this.button = $('#g-photoannotation-link'); - this.button.click(function() { - $.fn.annotateImage.add(image, opts.tags, opts.labels, opts.saveUrl, opts.csrf, opts.rtlsupport, opts.users); - }); - //this.canvas.after(this.button); - } - - // Hide the original - this.hide(); - $('#g-photo').hide(); - $('.image-annotate-canvas').show(); - $(".g-resize").remove(); - $("#photoannotation-fullsize").append($('.g-fullsize-link:first')); - $('.g-fullsize-link').append($('.g-fullsize-link:first').attr('title')); - $('.image-annotate-canvas').after($('#photoannotation-legend')); - return this; - }; - - /** - * Plugin Defaults - **/ - $.fn.annotateImage.defaults = { - getUrl: 'your-get.rails', - saveUrl: 'your-save.rails', - deleteUrl: 'your-delete.rails', - editable: true, - useAjax: true, - tags: new Array(), - notes: new Array() - }; - - $.fn.annotateImage.clear = function(image) { - /// - /// Clears all existing annotations from the image. - /// - for (var i = 0; i < image.notes.length; i++) { - image.notes[image.notes[i]].destroy(); - } - image.notes = new Array(); - }; - - $.fn.annotateImage.ajaxLoad = function(image) { - /// - /// Loads the annotations from the "getUrl" property passed in on the - /// options object. - /// - $.getJSON(image.getUrl + '?ticks=' + $.fn.annotateImage.getTicks(), function(data) { - image.notes = data; - $.fn.annotateImage.load(image); - }); - }; - - $.fn.annotateImage.load = function(image, labels, editable, csrf, deleteUrl, tags, saveUrl, cssaclass, rtlsupport, users) { - /// - /// Loads the annotations from the notes property passed in on the - /// options object. - /// - for (var i = 0; i < image.notes.length; i++) { - image.notes[image.notes[i]] = new $.fn.annotateView(image, image.notes[i], tags, labels, editable, csrf, deleteUrl, saveUrl, cssaclass, rtlsupport, users); - } - }; - - $.fn.annotateImage.getTicks = function() { - /// - /// Gets a count og the ticks for the current date. - /// This is used to ensure that URLs are always unique and not cached by the browser. - /// - var now = new Date(); - return now.getTime(); - }; - - $.fn.annotateImage.add = function(image, tags, labels, saveUrl, csrf, rtlsupport, users) { - /// - /// Adds a note to the image. - /// - if (image.mode == 'view') { - image.mode = 'edit'; - - // Create/prepare the editable note elements - var editable = new $.fn.annotateEdit(image, null, tags, labels, saveUrl, csrf, rtlsupport, users); - - var okbut = new $.fn.annotateImage.createSaveButton(editable, image, null, rtlsupport, labels, saveUrl); - - editable.form.append(okbut); - - $.fn.annotateImage.createCancelButton(editable, image, rtlsupport, labels); - } - }; - - $.fn.annotateImage.createSaveButton = function(editable, image, note, rtlsupport, labels, saveUrl) { - /// - /// Creates a Save button on the editable note. - /// - var ok = $('' + labels[8] + ''); - ok.click(function() { - var form = $('#image-annotate-edit-form form'); - $.fn.annotateImage.appendPosition(form, editable); - $.ajax({ - url: saveUrl, - type: 'POST', - data: form.serialize(), - error: function(e) { - var errordialog = '
      ' + labels[13] + '
      '; - $('body').append(errordialog); - var btns = {}; - if (rtlsupport == "") { - diagclass = "inmage-annotate-dialog"; - } else { - diagclass = "inmage-annotate-dialog-rtl"; - } - btns[labels[14]] = function(){ - $('#image-annotate-error-dialog').remove(); - }; - $('#image-annotate-error-dialog').dialog({ - modal: true, - resizable: false, - dialogClass: diagclass, - title: labels[13], - close: function(event, ui) { $('#image-annotate-error-dialog').remove(); }, - width: 450, - buttons: btns - }); - }, - success: function(data) { - if (data.result == "error") { - var errordialog = '
      ' + data.message + '
      '; - $('body').append(errordialog); - var btns = {}; - if (rtlsupport == "") { - diagclass = "inmage-annotate-dialog"; - } else { - diagclass = "inmage-annotate-dialog-rtl"; - } - btns[labels[14]] = function(){ - $('#image-annotate-error-dialog').remove(); - }; - $('#image-annotate-error-dialog').dialog({ - modal: true, - resizable: false, - dialogClass: diagclass, - title: labels[13], - close: function(event, ui) { $('#image-annotate-error-dialog').remove(); }, - width: 450, - buttons: btns - }); - } else { - if (data.annotationid != "") { - var legendid = "photoannotation-legend-" + data.oldtype; - $("#" + legendid + "-" + data.oldid).remove(); - if ($("#" + legendid + " > span").size() == 0) { - $("#" + legendid).hide(); - } - $("#" + data.annotationid).remove(); - $("#" + data.annotationid + "-edit").remove(); - $("#" + data.annotationid + "-delete").remove(); - $("#" + data.annotationid + "-note").remove(); - } - editable.description = data.description; - editable.editable = data.editable; - editable.height = data.height; - editable.internaltext = data.internaltext; - editable.left = data.left; - editable.noteid = data.noteid; - editable.notetype = data.notetype; - editable.text = data.text; - editable.top = data.top; - editable.url = data.url; - editable.width = data.width; - - var anchor_open = ""; - var anchor_close = ""; - if (data.url != "") { - anchor_open = ''; - anchor_close = ''; - } - legendid = "photoannotation-legend-" + data.notetype; - $("#" + legendid).show(); - $("#" + legendid).append('' + anchor_open + data.text + anchor_close + ' '); - note = new $.fn.annotateView(image, editable, image.tags, image.labels, image.editable, image.csrf, image.deleteUrl, image.saveUrl, image.cssaclass, image.rtlsupport, image.users); - } - }, - dataType: "json" - }); - image.mode = 'view'; - - editable.destroy(); - - }); - editable.form.append(ok); - }; - - $.fn.annotateImage.createCancelButton = function(editable, image, rtlsupport, labels) { - /// - /// Creates a Cancel button on the editable note. - /// - var cancel = $('' + labels[9] + ''); - cancel.click(function() { - editable.destroy(); - image.mode = 'view'; - }); - editable.form.append(cancel); - }; - - $.fn.annotateImage.saveAsHtml = function(image, target) { - var element = $(target); - var html = ""; - for (var i = 0; i < image.notes.length; i++) { - html += $.fn.annotateImage.createHiddenField("text_" + i, image.notes[i].text); - html += $.fn.annotateImage.createHiddenField("top_" + i, image.notes[i].top); - html += $.fn.annotateImage.createHiddenField("left_" + i, image.notes[i].left); - html += $.fn.annotateImage.createHiddenField("height_" + i, image.notes[i].height); - html += $.fn.annotateImage.createHiddenField("width_" + i, image.notes[i].width); - } - element.html(html); - }; - - $.fn.annotateImage.createHiddenField = function(name, value) { - return '<input type="hidden" name="' + name + '" value="' + value + '" />
      '; - }; - - $.fn.annotateEdit = function(image, note, tags, labels, saveUrl, csrf, rtlsupport, users) { - /// - /// Defines an editable annotation area. - /// - this.image = image; - - if (note) { - this.note = note; - } else { - var newNote = new Object(); - newNote.noteid = "new"; - newNote.top = 30; - newNote.left = 30; - newNote.width = 60; - newNote.height = 60; - newNote.text = ""; - newNote.description = ""; - newNote.notetype = ""; - newNote.internaltext = ""; - this.note = newNote; - } - - // Set area - var area = image.canvas.children('.image-annotate-edit').children('.image-annotate-edit-area'); - this.area = area; - this.area.css('height', this.note.height + 'px'); - this.area.css('width', this.note.width + 'px'); - this.area.css('left', this.note.left + 'px'); - this.area.css('top', this.note.top + 'px'); - - // Show the edition canvas and hide the view canvas - image.canvas.children('.image-annotate-view').hide(); - image.canvas.children('.image-annotate-edit').show(); - - // Add the note (which we'll load with the form afterwards) - var selectedtag = ""; - var notetitle = ""; - var username = ""; - var selecteduser = ""; - if (this.note.notetype == "face") { - selectedtag = this.note.text; - } else if (this.note.notetype == "user") { - username = this.note.internaltext; - } else { - notetitle = this.note.text; - } - var form = $('
      ' + labels[12] + '
      ' + labels[4] + '
      ' + labels[4] + '
      ' + labels[2] + '
      '); - this.form = form; - $('body').append(this.form); - $("#photoannotation-form").ready(function() { - var url = tags; - $("input#image-annotate-tag-text").autocomplete( - url, { - max: 30, - multiple: false, - cacheLength: 1 - } - ); - var urlusers = users; - $("input#photoannotation-user-list").autocomplete( - urlusers, { - max: 30, - multiple: false, - cacheLength: 1 - } - ); - }); - $("input#image-annotate-tag-text").keyup(function() { - if ($("input#image-annotate-tag-text").val() != "") { - $("input#image-annotate-text").html(""); - $("input#image-annotate-text").val(""); - $("input#photoannotation-user-list").html(""); - $("input#photoannotation-user-list").val(""); - } - }); - $("input#image-annotate-text").keyup(function() { - if ($("input#image-annotate-text").val() != "") { - $("input#image-annotate-tag-text").html(""); - $("input#image-annotate-tag-text").val(""); - $("input#photoannotation-user-list").html(""); - $("input#photoannotation-user-list").val(""); - } - }); - $("input#photoannotation-user-list").keyup(function() { - if ($("select#photoannotation-user-list").val() != "-1") { - $("input#image-annotate-tag-text").html(""); - $("input#image-annotate-tag-text").val(""); - $("input#image-annotate-text").html(""); - $("input#image-annotate-text").val(""); - } - }); - this.form.css('left', this.area.offset().left + 'px'); - this.form.css('top', (parseInt(this.area.offset().top) + parseInt(this.area.height()) + 7) + 'px'); - - // Set the area as a draggable/resizable element contained in the image canvas. - // Would be better to use the containment option for resizable but buggy - area.resizable({ - handles: 'all', - - start: function(e, ui) { - form.hide(); - }, - stop: function(e, ui) { - form.css('left', area.offset().left + 'px'); - form.css('top', (parseInt(area.offset().top) + parseInt(area.height()) + 7) + 'px'); - form.show(); - } - }) - .draggable({ - containment: image.canvas, - drag: function(e, ui) { - form.hide(); - }, - stop: function(e, ui) { - form.css('left', area.offset().left + 'px'); - form.css('top', (parseInt(area.offset().top) + parseInt(area.height()) + 7) + 'px'); - form.show(); - } - }); - return this; - }; - - $.fn.annotateEdit.prototype.destroy = function() { - /// - /// Destroys an editable annotation area. - /// - this.image.canvas.children('.image-annotate-edit').hide(); - this.area.resizable('destroy'); - this.area.draggable('destroy'); - this.area.css('height', ''); - this.area.css('width', ''); - this.area.css('left', ''); - this.area.css('top', ''); - this.form.remove(); - }; - - $.fn.annotateView = function(image, note, tags, labels, editable, csrf, deleteUrl, saveUrl, cssaclass, rtlsupport, users) { - /// - /// Defines a annotation area. - /// - this.image = image; - - this.note = note; - - // Add the area - this.area = $('
      '); - image.canvas.children('.image-annotate-view').prepend(this.area); - - if (editable) { - this.delarea = $('
      '); - this.editarea = $('
      '); - image.canvas.children('.image-annotate-view').prepend(this.delarea); - image.canvas.children('.image-annotate-view').prepend(this.editarea); - this.delarea.bind('click',function () { - var confdialog = '
      ' + labels[3] + '
      '; - $('body').append(confdialog); - var btns = {}; - if (rtlsupport == "") { - diagclass = "inmage-annotate-dialog"; - } else { - diagclass = "inmage-annotate-dialog-rtl"; - } - btns[labels[5]] = function(){ - var delform = $("#" + $(this).attr("rel") + "-del-form"); - $.ajax({ - url: deleteUrl, - type: 'POST', - data: delform.serialize(), - error: function(e) { - var errordialog = '
      ' + labels[15] + '
      '; - $('body').append(errordialog); - var btns = {}; - if (rtlsupport == "") { - diagclass = "inmage-annotate-dialog"; - } else { - diagclass = "inmage-annotate-dialog-rtl"; - } - btns[labels[14]] = function(){ - $('#image-annotate-error-dialog').remove(); - }; - $('#image-annotate-error-dialog').dialog({ - modal: true, - resizable: false, - dialogClass: diagclass, - title: labels[13], - close: function(event, ui) { $('#image-annotate-error-dialog').remove(); }, - width: 450, - buttons: btns - }); - }, - success: function(data) { - if (data.result == "success") { - var annotationid = "photoannotation-area-" + data.notetype + "-" + data.noteid; - var legendid = "photoannotation-legend-" + data.notetype; - $("#" + legendid + "-" + data.noteid).remove(); - if ($("#" + legendid + " > span").size() == 0) { - $("#" + legendid).hide(); - } - $("#" + annotationid).remove(); - $("#" + annotationid + "-edit").remove(); - $("#" + annotationid + "-delete").remove(); - $("#" + annotationid + "-note").remove(); - } - }, - dataType: "json" - }); - $('#image-annotate-conf-dialog').remove(); - }; - btns[labels[6]] = function(){ $('#image-annotate-conf-dialog').remove(); }; - $('#image-annotate-conf-dialog').dialog({ - modal: true, - resizable: false, - dialogClass: diagclass, - title: labels[7], - close: function(event, ui) { $('#image-annotate-conf-dialog').remove(); }, - buttons: btns - }); - }); - var form = this; - this.editarea.bind('click',function () { - form.edit(tags, labels, saveUrl, csrf, rtlsupport, users); - }); - this.delarea.hide(); - this.editarea.hide(); - } - - // Add the note - var notedescription = ""; - if (note.description != "") { - notedescription = "
      " + note.description; - } - this.form = $('
      ' + note.text + notedescription + '
      '); - this.form.hide(); - image.canvas.children('.image-annotate-view').append(this.form); - this.form.children('span.actions').hide(); - - // Set the position and size of the note - this.setPosition(rtlsupport); - - // Add the behavior: hide/display the note when hovering the area - var annotation = this; - this.area.hover(function() { - annotation.show(); - if (annotation.delarea != undefined) { - annotation.delarea.show(); - annotation.editarea.show(); - } - }, function() { - annotation.hide(); - if (annotation.delarea != undefined) { - annotation.delarea.hide(); - annotation.editarea.hide(); - } - }); - var legendspan = "#photoannotation-legend-" + this.note.notetype + "-" + this.note.noteid; - if ($(legendspan).length > 0) { - $(legendspan).hover(function() { - var legendsarea = "#photoannotation-area-" + note.notetype + "-" + note.noteid; - $(legendsarea).children('.image-annotate-view').show(); - $(".image-annotate-view").show(); - $(legendsarea).show(); - annotation.show(); - }, function() { - var legendsarea = "#photoannotation-area-" + note.notetype + "-" + note.noteid; - annotation.hide(); - $(legendsarea).children('.image-annotate-view').hide(); - $(".image-annotate-view").hide(); - }); - } - if (editable) { - this.delarea.hover(function() { - annotation.delarea.show(); - annotation.editarea.show(); - }, function() { - annotation.delarea.hide(); - annotation.editarea.hide(); - }); - this.editarea.hover(function() { - annotation.delarea.show(); - annotation.editarea.show(); - }, function() { - annotation.delarea.hide(); - annotation.editarea.hide(); - }); - } - // Edit a note feature - if (note.url != "" && note.url != null) { - this.area.bind('click',function () { - window.location = note.url; - }); - } - }; - - $.fn.annotateView.prototype.setPosition = function(rtlsupport) { - /// - /// Sets the position of an annotation. - /// - this.area.children('div').height((parseInt(this.note.height) - 2) + 'px'); - this.area.children('div').width((parseInt(this.note.width) - 2) + 'px'); - this.area.css('left', (this.note.left) + 'px'); - this.area.css('top', (this.note.top) + 'px'); - this.form.css('left', (this.note.left) + 'px'); - this.form.css('top', (parseInt(this.note.top) + parseInt(this.note.height) + 7) + 'px'); - - if (this.delarea != undefined) { - this.delarea.children('div').height('14px'); - this.delarea.children('div').width('14px'); - this.delarea.css('top', (this.note.top) + 'px'); - this.editarea.children('div').height('14px'); - this.editarea.children('div').width('14px'); - this.editarea.css('top', (this.note.top + 16) + 'px'); - if (rtlsupport == '') { - this.delarea.css('left', (this.note.left + parseInt(this.note.width)) + 'px'); - this.editarea.css('left', (this.note.left + parseInt(this.note.width)) + 'px'); - } else { - this.delarea.css('left', (this.note.left - 16) + 'px'); - this.editarea.css('left', (this.note.left - 16) + 'px'); - } - } - }; - - $.fn.annotateView.prototype.show = function() { - /// - /// Highlights the annotation - /// - this.form.fadeIn(250); - if (!this.note.editable) { - this.area.addClass('image-annotate-area-hover'); - } else { - this.area.addClass('image-annotate-area-editable-hover'); - } - }; - - $.fn.annotateView.prototype.hide = function() { - /// - /// Removes the highlight from the annotation. - /// - this.form.fadeOut(250); - this.area.removeClass('image-annotate-area-hover'); - this.area.removeClass('image-annotate-area-editable-hover'); - }; - - $.fn.annotateView.prototype.destroy = function() { - /// - /// Destroys the annotation. - /// - this.area.remove(); - this.form.remove(); - }; - - $.fn.annotateView.prototype.edit = function(tags, labels, saveUrl, csrf, rtlsupport, users) { - /// - /// Edits the annotation. - /// - if (this.image.mode == 'view') { - this.image.mode = 'edit'; - var annotation = this; - - // Create/prepare the editable note elements - var editable = new $.fn.annotateEdit(this.image, this.note, tags, labels, saveUrl, csrf, rtlsupport, users); - $.fn.annotateImage.createSaveButton(editable, this.image, annotation, rtlsupport, labels, saveUrl); - $.fn.annotateImage.createCancelButton(editable, this.image, rtlsupport, labels); - } - }; - - $.fn.annotateView.prototype.resetPosition = function(editable, text) { - /// - /// Sets the position of an annotation. - /// - this.form.html(text); - this.form.hide(); - - // Resize - this.area.children('div').height(editable.area.height() + 'px'); - this.area.children('div').width((editable.area.width() - 2) + 'px'); - this.area.css('left', (editable.area.position().left) + 'px'); - this.area.css('top', (editable.area.position().top) + 'px'); - this.form.css('left', (editable.area.position().left) + 'px'); - this.form.css('top', (parseInt(editable.area.position().top) + parseInt(editable.area.height()) + 7) + 'px'); - - // Save new position to note - this.note.top = editable.area.position().top; - this.note.left = editable.area.position().left; - this.note.height = editable.area.height(); - this.note.width = editable.area.width(); - this.note.text = text; - this.note.id = editable.note.id; - this.editable = true; - }; - - $.fn.annotateImage.appendPosition = function(form, editable) { - /// - /// Appends the annotations coordinates to the given form that is posted to the server. - /// - var areaFields = $('' + - '' + - '' + - '' + - ''); - form.append(areaFields); - }; - -})(jQuery); diff --git a/3.1/modules/photoannotation/js/jquery.annotate.min.js b/3.1/modules/photoannotation/js/jquery.annotate.min.js deleted file mode 100644 index 9d15d8e5..00000000 --- a/3.1/modules/photoannotation/js/jquery.annotate.min.js +++ /dev/null @@ -1 +0,0 @@ -(function($){$.fn.annotateImage=function(options){var opts=$.extend({},$.fn.annotateImage.defaults,options);var image=this;this.image=this;this.mode='view';this.getUrl=opts.getUrl;this.saveUrl=opts.saveUrl;this.deleteUrl=opts.deleteUrl;this.deleteUrl=opts.deleteUrl;this.editable=opts.editable;this.useAjax=opts.useAjax;this.tags=opts.tags;this.notes=opts.notes;this.labels=opts.labels;this.csrf=opts.csrf;this.cssaclass=opts.cssaclass;this.rtlsupport=opts.rtlsupport;this.users=opts.users;anchor=$('.g-fullsize-link');this.canvas=$('
      ');this.canvas.children('.image-annotate-edit').hide();this.canvas.children('.image-annotate-view').hide();$('#g-photo').after(this.canvas);this.canvas.height(this.height());this.canvas.width(this.width());this.canvas.css('background-image','url("'+this.attr('src')+'")');this.canvas.children('.image-annotate-view, .image-annotate-edit').height(this.height());this.canvas.children('.image-annotate-view, .image-annotate-edit').width(this.width());this.canvas.hover(function(){if($(this).children('.image-annotate-edit').css('display')=='none'){$(this).children('.image-annotate-view').show();$("#photoannotation-fullsize").show()}},function(){$(this).children('.image-annotate-view').hide();$(this).children('.image-annotate-note').hide();$("#photoannotation-fullsize").hide()});this.canvas.children('.image-annotate-view').hover(function(){$(this).show()},function(){$(this).hide();$(this).children('.image-annotate-note').hide()});if(this.useAjax){$.fn.annotateImage.ajaxLoad(this)}else{$.fn.annotateImage.load(this,this.labels,this.editable,this.csrf,this.deleteUrl,this.tags,this.saveUrl,this.cssaclass,this.rtlsupport,this.users)}if($('#g-photoannotation-link').length!==0){this.button=$('#g-photoannotation-link');this.button.click(function(){$.fn.annotateImage.add(image,opts.tags,opts.labels,opts.saveUrl,opts.csrf,opts.rtlsupport,opts.users)})}this.hide();$('#g-photo').hide();$('.image-annotate-canvas').show();$(".g-resize").remove();$("#photoannotation-fullsize").append($('.g-fullsize-link:first'));$('.g-fullsize-link').append($('.g-fullsize-link:first').attr('title'));$('.image-annotate-canvas').after($('#photoannotation-legend'));return this};$.fn.annotateImage.defaults={getUrl:'your-get.rails',saveUrl:'your-save.rails',deleteUrl:'your-delete.rails',editable:true,useAjax:true,tags:new Array(),notes:new Array()};$.fn.annotateImage.clear=function(image){for(var i=0;i'+labels[8]+'');ok.click(function(){var form=$('#image-annotate-edit-form form');$.fn.annotateImage.appendPosition(form,editable);$.ajax({url:saveUrl,type:'POST',data:form.serialize(),error:function(e){var errordialog='
      '+labels[13]+'
      ';$('body').append(errordialog);var btns={};if(rtlsupport==""){diagclass="inmage-annotate-dialog"}else{diagclass="inmage-annotate-dialog-rtl"}btns[labels[14]]=function(){$('#image-annotate-error-dialog').remove()};$('#image-annotate-error-dialog').dialog({modal:true,resizable:false,dialogClass:diagclass,title:labels[13],close:function(event,ui){$('#image-annotate-error-dialog').remove()},width:450,buttons:btns})},success:function(data){if(data.result=="error"){var errordialog='
      '+data.message+'
      ';$('body').append(errordialog);var btns={};if(rtlsupport==""){diagclass="inmage-annotate-dialog"}else{diagclass="inmage-annotate-dialog-rtl"}btns[labels[14]]=function(){$('#image-annotate-error-dialog').remove()};$('#image-annotate-error-dialog').dialog({modal:true,resizable:false,dialogClass:diagclass,title:labels[13],close:function(event,ui){$('#image-annotate-error-dialog').remove()},width:450,buttons:btns})}else{if(data.annotationid!=""){var legendid="photoannotation-legend-"+data.oldtype;$("#"+legendid+"-"+data.oldid).remove();if($("#"+legendid+" > span").size()==0){$("#"+legendid).hide()}$("#"+data.annotationid).remove();$("#"+data.annotationid+"-edit").remove();$("#"+data.annotationid+"-delete").remove();$("#"+data.annotationid+"-note").remove()}editable.description=data.description;editable.editable=data.editable;editable.height=data.height;editable.internaltext=data.internaltext;editable.left=data.left;editable.noteid=data.noteid;editable.notetype=data.notetype;editable.text=data.text;editable.top=data.top;editable.url=data.url;editable.width=data.width;var anchor_open="";var anchor_close="";if(data.url!=""){anchor_open='';anchor_close=''}legendid="photoannotation-legend-"+data.notetype;$("#"+legendid).show();$("#"+legendid).append(''+anchor_open+data.text+anchor_close+' ');note=new $.fn.annotateView(image,editable,image.tags,image.labels,image.editable,image.csrf,image.deleteUrl,image.saveUrl,image.cssaclass,image.rtlsupport,image.users)}},dataType:"json"});image.mode='view';editable.destroy()});editable.form.append(ok)};$.fn.annotateImage.createCancelButton=function(editable,image,rtlsupport,labels){var cancel=$(''+labels[9]+'');cancel.click(function(){editable.destroy();image.mode='view'});editable.form.append(cancel)};$.fn.annotateImage.saveAsHtml=function(image,target){var element=$(target);var html="";for(var i=0;i'};$.fn.annotateEdit=function(image,note,tags,labels,saveUrl,csrf,rtlsupport,users){this.image=image;if(note){this.note=note}else{var newNote=new Object();newNote.noteid="new";newNote.top=30;newNote.left=30;newNote.width=60;newNote.height=60;newNote.text="";newNote.description="";newNote.notetype="";newNote.internaltext="";this.note=newNote}var area=image.canvas.children('.image-annotate-edit').children('.image-annotate-edit-area');this.area=area;this.area.css('height',this.note.height+'px');this.area.css('width',this.note.width+'px');this.area.css('left',this.note.left+'px');this.area.css('top',this.note.top+'px');image.canvas.children('.image-annotate-view').hide();image.canvas.children('.image-annotate-edit').show();var selectedtag="";var notetitle="";var username="";var selecteduser="";if(this.note.notetype=="face"){selectedtag=this.note.text}else if(this.note.notetype=="user"){username=this.note.internaltext}else{notetitle=this.note.text}var form=$('
      '+labels[12]+'
      '+labels[4]+'
      '+labels[4]+'
      '+labels[2]+'
      ');this.form=form;$('body').append(this.form);$("#photoannotation-form").ready(function(){var url=tags;$("input#image-annotate-tag-text").autocomplete(url,{max:30,multiple:false,cacheLength:1});var urlusers=users;$("input#photoannotation-user-list").autocomplete(urlusers,{max:30,multiple:false,cacheLength:1})});$("input#image-annotate-tag-text").keyup(function(){if($("input#image-annotate-tag-text").val()!=""){$("input#image-annotate-text").html("");$("input#image-annotate-text").val("");$("input#photoannotation-user-list").html("");$("input#photoannotation-user-list").val("")}});$("input#image-annotate-text").keyup(function(){if($("input#image-annotate-text").val()!=""){$("input#image-annotate-tag-text").html("");$("input#image-annotate-tag-text").val("");$("input#photoannotation-user-list").html("");$("input#photoannotation-user-list").val("")}});$("input#photoannotation-user-list").keyup(function(){if($("select#photoannotation-user-list").val()!="-1"){$("input#image-annotate-tag-text").html("");$("input#image-annotate-tag-text").val("");$("input#image-annotate-text").html("");$("input#image-annotate-text").val("")}});this.form.css('left',this.area.offset().left+'px');this.form.css('top',(parseInt(this.area.offset().top)+parseInt(this.area.height())+7)+'px');area.resizable({handles:'all',start:function(e,ui){form.hide()},stop:function(e,ui){form.css('left',area.offset().left+'px');form.css('top',(parseInt(area.offset().top)+parseInt(area.height())+7)+'px');form.show()}}).draggable({containment:image.canvas,drag:function(e,ui){form.hide()},stop:function(e,ui){form.css('left',area.offset().left+'px');form.css('top',(parseInt(area.offset().top)+parseInt(area.height())+7)+'px');form.show()}});return this};$.fn.annotateEdit.prototype.destroy=function(){this.image.canvas.children('.image-annotate-edit').hide();this.area.resizable('destroy');this.area.draggable('destroy');this.area.css('height','');this.area.css('width','');this.area.css('left','');this.area.css('top','');this.form.remove()};$.fn.annotateView=function(image,note,tags,labels,editable,csrf,deleteUrl,saveUrl,cssaclass,rtlsupport,users){this.image=image;this.note=note;this.area=$('
      ');image.canvas.children('.image-annotate-view').prepend(this.area);if(editable){this.delarea=$('
      ');this.editarea=$('
      ');image.canvas.children('.image-annotate-view').prepend(this.delarea);image.canvas.children('.image-annotate-view').prepend(this.editarea);this.delarea.bind('click',function(){var confdialog='
      '+labels[3]+'
      ';$('body').append(confdialog);var btns={};if(rtlsupport==""){diagclass="inmage-annotate-dialog"}else{diagclass="inmage-annotate-dialog-rtl"}btns[labels[5]]=function(){var delform=$("#"+$(this).attr("rel")+"-del-form");$.ajax({url:deleteUrl,type:'POST',data:delform.serialize(),error:function(e){var errordialog='
      '+labels[15]+'
      ';$('body').append(errordialog);var btns={};if(rtlsupport==""){diagclass="inmage-annotate-dialog"}else{diagclass="inmage-annotate-dialog-rtl"}btns[labels[14]]=function(){$('#image-annotate-error-dialog').remove()};$('#image-annotate-error-dialog').dialog({modal:true,resizable:false,dialogClass:diagclass,title:labels[13],close:function(event,ui){$('#image-annotate-error-dialog').remove()},width:450,buttons:btns})},success:function(data){if(data.result=="success"){var annotationid="photoannotation-area-"+data.notetype+"-"+data.noteid;var legendid="photoannotation-legend-"+data.notetype;$("#"+legendid+"-"+data.noteid).remove();if($("#"+legendid+" > span").size()==0){$("#"+legendid).hide()}$("#"+annotationid).remove();$("#"+annotationid+"-edit").remove();$("#"+annotationid+"-delete").remove();$("#"+annotationid+"-note").remove()}},dataType:"json"});$('#image-annotate-conf-dialog').remove()};btns[labels[6]]=function(){$('#image-annotate-conf-dialog').remove()};$('#image-annotate-conf-dialog').dialog({modal:true,resizable:false,dialogClass:diagclass,title:labels[7],close:function(event,ui){$('#image-annotate-conf-dialog').remove()},buttons:btns})});var form=this;this.editarea.bind('click',function(){form.edit(tags,labels,saveUrl,csrf,rtlsupport,users)});this.delarea.hide();this.editarea.hide()}var notedescription="";if(note.description!=""){notedescription="
      "+note.description}this.form=$('
      '+note.text+notedescription+'
      ');this.form.hide();image.canvas.children('.image-annotate-view').append(this.form);this.form.children('span.actions').hide();this.setPosition(rtlsupport);var annotation=this;this.area.hover(function(){annotation.show();if(annotation.delarea!=undefined){annotation.delarea.show();annotation.editarea.show()}},function(){annotation.hide();if(annotation.delarea!=undefined){annotation.delarea.hide();annotation.editarea.hide()}});var legendspan="#photoannotation-legend-"+this.note.notetype+"-"+this.note.noteid;if($(legendspan).length>0){$(legendspan).hover(function(){var legendsarea="#photoannotation-area-"+note.notetype+"-"+note.noteid;$(legendsarea).children('.image-annotate-view').show();$(".image-annotate-view").show();$(legendsarea).show();annotation.show()},function(){var legendsarea="#photoannotation-area-"+note.notetype+"-"+note.noteid;annotation.hide();$(legendsarea).children('.image-annotate-view').hide();$(".image-annotate-view").hide()})}if(editable){this.delarea.hover(function(){annotation.delarea.show();annotation.editarea.show()},function(){annotation.delarea.hide();annotation.editarea.hide()});this.editarea.hover(function(){annotation.delarea.show();annotation.editarea.show()},function(){annotation.delarea.hide();annotation.editarea.hide()})}if(note.url!=""&¬e.url!=null){this.area.bind('click',function(){window.location=note.url})}};$.fn.annotateView.prototype.setPosition=function(rtlsupport){this.area.children('div').height((parseInt(this.note.height)-2)+'px');this.area.children('div').width((parseInt(this.note.width)-2)+'px');this.area.css('left',(this.note.left)+'px');this.area.css('top',(this.note.top)+'px');this.form.css('left',(this.note.left)+'px');this.form.css('top',(parseInt(this.note.top)+parseInt(this.note.height)+7)+'px');if(this.delarea!=undefined){this.delarea.children('div').height('14px');this.delarea.children('div').width('14px');this.delarea.css('top',(this.note.top)+'px');this.editarea.children('div').height('14px');this.editarea.children('div').width('14px');this.editarea.css('top',(this.note.top+16)+'px');if(rtlsupport==''){this.delarea.css('left',(this.note.left+parseInt(this.note.width))+'px');this.editarea.css('left',(this.note.left+parseInt(this.note.width))+'px')}else{this.delarea.css('left',(this.note.left-16)+'px');this.editarea.css('left',(this.note.left-16)+'px')}}};$.fn.annotateView.prototype.show=function(){this.form.fadeIn(250);if(!this.note.editable){this.area.addClass('image-annotate-area-hover')}else{this.area.addClass('image-annotate-area-editable-hover')}};$.fn.annotateView.prototype.hide=function(){this.form.fadeOut(250);this.area.removeClass('image-annotate-area-hover');this.area.removeClass('image-annotate-area-editable-hover')};$.fn.annotateView.prototype.destroy=function(){this.area.remove();this.form.remove()};$.fn.annotateView.prototype.edit=function(tags,labels,saveUrl,csrf,rtlsupport,users){if(this.image.mode=='view'){this.image.mode='edit';var annotation=this;var editable=new $.fn.annotateEdit(this.image,this.note,tags,labels,saveUrl,csrf,rtlsupport,users);$.fn.annotateImage.createSaveButton(editable,this.image,annotation,rtlsupport,labels,saveUrl);$.fn.annotateImage.createCancelButton(editable,this.image,rtlsupport,labels)}};$.fn.annotateView.prototype.resetPosition=function(editable,text){this.form.html(text);this.form.hide();this.area.children('div').height(editable.area.height()+'px');this.area.children('div').width((editable.area.width()-2)+'px');this.area.css('left',(editable.area.position().left)+'px');this.area.css('top',(editable.area.position().top)+'px');this.form.css('left',(editable.area.position().left)+'px');this.form.css('top',(parseInt(editable.area.position().top)+parseInt(editable.area.height())+7)+'px');this.note.top=editable.area.position().top;this.note.left=editable.area.position().left;this.note.height=editable.area.height();this.note.width=editable.area.width();this.note.text=text;this.note.id=editable.note.id;this.editable=true};$.fn.annotateImage.appendPosition=function(form,editable){var areaFields=$(''+''+''+''+'');form.append(areaFields)}})(jQuery); diff --git a/3.1/modules/photoannotation/js/jquery.colorpicker.js b/3.1/modules/photoannotation/js/jquery.colorpicker.js deleted file mode 100644 index 802e7c18..00000000 --- a/3.1/modules/photoannotation/js/jquery.colorpicker.js +++ /dev/null @@ -1,484 +0,0 @@ -/** - * - * Color picker - * Author: Stefan Petre www.eyecon.ro - * - * Dual licensed under the MIT and GPL licenses - * - */ -(function ($) { - var ColorPicker = function () { - var - ids = {}, - inAction, - charMin = 65, - visible, - tpl = '
      ', - defaults = { - eventName: 'click', - onShow: function () {}, - onBeforeShow: function(){}, - onHide: function () {}, - onChange: function () {}, - onSubmit: function () {}, - color: 'ff0000', - livePreview: true, - flat: false - }, - fillRGBFields = function (hsb, cal) { - var rgb = HSBToRGB(hsb); - $(cal).data('colorpicker').fields - .eq(1).val(rgb.r).end() - .eq(2).val(rgb.g).end() - .eq(3).val(rgb.b).end(); - }, - fillHSBFields = function (hsb, cal) { - $(cal).data('colorpicker').fields - .eq(4).val(hsb.h).end() - .eq(5).val(hsb.s).end() - .eq(6).val(hsb.b).end(); - }, - fillHexFields = function (hsb, cal) { - $(cal).data('colorpicker').fields - .eq(0).val(HSBToHex(hsb)).end(); - }, - setSelector = function (hsb, cal) { - $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100})); - $(cal).data('colorpicker').selectorIndic.css({ - left: parseInt(150 * hsb.s/100, 10), - top: parseInt(150 * (100-hsb.b)/100, 10) - }); - }, - setHue = function (hsb, cal) { - $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10)); - }, - setCurrentColor = function (hsb, cal) { - $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb)); - }, - setNewColor = function (hsb, cal) { - $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb)); - }, - keyDown = function (ev) { - var pressedKey = ev.charCode || ev.keyCode || -1; - if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) { - return false; - } - var cal = $(this).parent().parent(); - if (cal.data('colorpicker').livePreview === true) { - change.apply(this); - } - }, - change = function (ev) { - var cal = $(this).parent().parent(), col; - if (this.parentNode.className.indexOf('_hex') > 0) { - cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value)); - } else if (this.parentNode.className.indexOf('_hsb') > 0) { - cal.data('colorpicker').color = col = fixHSB({ - h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10), - s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10), - b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10) - }); - } else { - cal.data('colorpicker').color = col = RGBToHSB(fixRGB({ - r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10), - g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10), - b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10) - })); - } - if (ev) { - fillRGBFields(col, cal.get(0)); - fillHexFields(col, cal.get(0)); - fillHSBFields(col, cal.get(0)); - } - setSelector(col, cal.get(0)); - setHue(col, cal.get(0)); - setNewColor(col, cal.get(0)); - cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]); - }, - blur = function (ev) { - var cal = $(this).parent().parent(); - cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus'); - }, - focus = function () { - charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65; - $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus'); - $(this).parent().addClass('colorpicker_focus'); - }, - downIncrement = function (ev) { - var field = $(this).parent().find('input').focus(); - var current = { - el: $(this).parent().addClass('colorpicker_slider'), - max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255), - y: ev.pageY, - field: field, - val: parseInt(field.val(), 10), - preview: $(this).parent().parent().data('colorpicker').livePreview - }; - $(document).bind('mouseup', current, upIncrement); - $(document).bind('mousemove', current, moveIncrement); - }, - moveIncrement = function (ev) { - ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10)))); - if (ev.data.preview) { - change.apply(ev.data.field.get(0), [true]); - } - return false; - }, - upIncrement = function (ev) { - change.apply(ev.data.field.get(0), [true]); - ev.data.el.removeClass('colorpicker_slider').find('input').focus(); - $(document).unbind('mouseup', upIncrement); - $(document).unbind('mousemove', moveIncrement); - return false; - }, - downHue = function (ev) { - var current = { - cal: $(this).parent(), - y: $(this).offset().top - }; - current.preview = current.cal.data('colorpicker').livePreview; - $(document).bind('mouseup', current, upHue); - $(document).bind('mousemove', current, moveHue); - }, - moveHue = function (ev) { - change.apply( - ev.data.cal.data('colorpicker') - .fields - .eq(4) - .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10)) - .get(0), - [ev.data.preview] - ); - return false; - }, - upHue = function (ev) { - fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); - fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); - $(document).unbind('mouseup', upHue); - $(document).unbind('mousemove', moveHue); - return false; - }, - downSelector = function (ev) { - var current = { - cal: $(this).parent(), - pos: $(this).offset() - }; - current.preview = current.cal.data('colorpicker').livePreview; - $(document).bind('mouseup', current, upSelector); - $(document).bind('mousemove', current, moveSelector); - }, - moveSelector = function (ev) { - change.apply( - ev.data.cal.data('colorpicker') - .fields - .eq(6) - .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10)) - .end() - .eq(5) - .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10)) - .get(0), - [ev.data.preview] - ); - return false; - }, - upSelector = function (ev) { - fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); - fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); - $(document).unbind('mouseup', upSelector); - $(document).unbind('mousemove', moveSelector); - return false; - }, - enterSubmit = function (ev) { - $(this).addClass('colorpicker_focus'); - }, - leaveSubmit = function (ev) { - $(this).removeClass('colorpicker_focus'); - }, - clickSubmit = function (ev) { - var cal = $(this).parent(); - var col = cal.data('colorpicker').color; - cal.data('colorpicker').origColor = col; - setCurrentColor(col, cal.get(0)); - cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el); - }, - show = function (ev) { - var cal = $('#' + $(this).data('colorpickerId')); - cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]); - var pos = $(this).offset(); - var viewPort = getViewport(); - var top = pos.top + this.offsetHeight; - var left = pos.left; - if (top + 176 > viewPort.t + viewPort.h) { - top -= this.offsetHeight + 176; - } - if (left + 356 > viewPort.l + viewPort.w) { - left -= 356; - } - cal.css({left: left + 'px', top: top + 'px'}); - if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) { - cal.show(); - } - $(document).bind('mousedown', {cal: cal}, hide); - return false; - }, - hide = function (ev) { - if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) { - if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) { - ev.data.cal.hide(); - } - $(document).unbind('mousedown', hide); - } - }, - isChildOf = function(parentEl, el, container) { - if (parentEl == el) { - return true; - } - if (parentEl.contains) { - return parentEl.contains(el); - } - if ( parentEl.compareDocumentPosition ) { - return !!(parentEl.compareDocumentPosition(el) & 16); - } - var prEl = el.parentNode; - while(prEl && prEl != container) { - if (prEl == parentEl) - return true; - prEl = prEl.parentNode; - } - return false; - }, - getViewport = function () { - var m = document.compatMode == 'CSS1Compat'; - return { - l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft), - t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop), - w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth), - h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight) - }; - }, - fixHSB = function (hsb) { - return { - h: Math.min(360, Math.max(0, hsb.h)), - s: Math.min(100, Math.max(0, hsb.s)), - b: Math.min(100, Math.max(0, hsb.b)) - }; - }, - fixRGB = function (rgb) { - return { - r: Math.min(255, Math.max(0, rgb.r)), - g: Math.min(255, Math.max(0, rgb.g)), - b: Math.min(255, Math.max(0, rgb.b)) - }; - }, - fixHex = function (hex) { - var len = 6 - hex.length; - if (len > 0) { - var o = []; - for (var i=0; i -1) ? hex.substring(1) : hex), 16); - return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)}; - }, - HexToHSB = function (hex) { - return RGBToHSB(HexToRGB(hex)); - }, - RGBToHSB = function (rgb) { - var hsb = { - h: 0, - s: 0, - b: 0 - }; - var min = Math.min(rgb.r, rgb.g, rgb.b); - var max = Math.max(rgb.r, rgb.g, rgb.b); - var delta = max - min; - hsb.b = max; - if (max != 0) { - - } - hsb.s = max != 0 ? 255 * delta / max : 0; - if (hsb.s != 0) { - if (rgb.r == max) { - hsb.h = (rgb.g - rgb.b) / delta; - } else if (rgb.g == max) { - hsb.h = 2 + (rgb.b - rgb.r) / delta; - } else { - hsb.h = 4 + (rgb.r - rgb.g) / delta; - } - } else { - hsb.h = -1; - } - hsb.h *= 60; - if (hsb.h < 0) { - hsb.h += 360; - } - hsb.s *= 100/255; - hsb.b *= 100/255; - return hsb; - }, - HSBToRGB = function (hsb) { - var rgb = {}; - var h = Math.round(hsb.h); - var s = Math.round(hsb.s*255/100); - var v = Math.round(hsb.b*255/100); - if(s == 0) { - rgb.r = rgb.g = rgb.b = v; - } else { - var t1 = v; - var t2 = (255-s)*v/255; - var t3 = (t1-t2)*(h%60)/60; - if(h==360) h = 0; - if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3} - else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3} - else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3} - else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3} - else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3} - else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3} - else {rgb.r=0; rgb.g=0; rgb.b=0} - } - return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)}; - }, - RGBToHex = function (rgb) { - var hex = [ - rgb.r.toString(16), - rgb.g.toString(16), - rgb.b.toString(16) - ]; - $.each(hex, function (nr, val) { - if (val.length == 1) { - hex[nr] = '0' + val; - } - }); - return hex.join(''); - }, - HSBToHex = function (hsb) { - return RGBToHex(HSBToRGB(hsb)); - }, - restoreOriginal = function () { - var cal = $(this).parent(); - var col = cal.data('colorpicker').origColor; - cal.data('colorpicker').color = col; - fillRGBFields(col, cal.get(0)); - fillHexFields(col, cal.get(0)); - fillHSBFields(col, cal.get(0)); - setSelector(col, cal.get(0)); - setHue(col, cal.get(0)); - setNewColor(col, cal.get(0)); - }; - return { - init: function (opt) { - opt = $.extend({}, defaults, opt||{}); - if (typeof opt.color == 'string') { - opt.color = HexToHSB(opt.color); - } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) { - opt.color = RGBToHSB(opt.color); - } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) { - opt.color = fixHSB(opt.color); - } else { - return this; - } - return this.each(function () { - if (!$(this).data('colorpickerId')) { - var options = $.extend({}, opt); - options.origColor = opt.color; - var id = 'collorpicker_' + parseInt(Math.random() * 1000); - $(this).data('colorpickerId', id); - var cal = $(tpl).attr('id', id); - if (options.flat) { - cal.appendTo(this).show(); - } else { - cal.appendTo(document.body); - } - options.fields = cal - .find('input') - .bind('keyup', keyDown) - .bind('change', change) - .bind('blur', blur) - .bind('focus', focus); - cal - .find('span').bind('mousedown', downIncrement).end() - .find('>div.colorpicker_current_color').bind('click', restoreOriginal); - options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector); - options.selectorIndic = options.selector.find('div div'); - options.el = this; - options.hue = cal.find('div.colorpicker_hue div'); - cal.find('div.colorpicker_hue').bind('mousedown', downHue); - options.newColor = cal.find('div.colorpicker_new_color'); - options.currentColor = cal.find('div.colorpicker_current_color'); - cal.data('colorpicker', options); - cal.find('div.colorpicker_submit') - .bind('mouseenter', enterSubmit) - .bind('mouseleave', leaveSubmit) - .bind('click', clickSubmit); - fillRGBFields(options.color, cal.get(0)); - fillHSBFields(options.color, cal.get(0)); - fillHexFields(options.color, cal.get(0)); - setHue(options.color, cal.get(0)); - setSelector(options.color, cal.get(0)); - setCurrentColor(options.color, cal.get(0)); - setNewColor(options.color, cal.get(0)); - if (options.flat) { - cal.css({ - position: 'relative', - display: 'block' - }); - } else { - $(this).bind(options.eventName, show); - } - } - }); - }, - showPicker: function() { - return this.each( function () { - if ($(this).data('colorpickerId')) { - show.apply(this); - } - }); - }, - hidePicker: function() { - return this.each( function () { - if ($(this).data('colorpickerId')) { - $('#' + $(this).data('colorpickerId')).hide(); - } - }); - }, - setColor: function(col) { - if (typeof col == 'string') { - col = HexToHSB(col); - } else if (col.r != undefined && col.g != undefined && col.b != undefined) { - col = RGBToHSB(col); - } else if (col.h != undefined && col.s != undefined && col.b != undefined) { - col = fixHSB(col); - } else { - return this; - } - return this.each(function(){ - if ($(this).data('colorpickerId')) { - var cal = $('#' + $(this).data('colorpickerId')); - cal.data('colorpicker').color = col; - cal.data('colorpicker').origColor = col; - fillRGBFields(col, cal.get(0)); - fillHSBFields(col, cal.get(0)); - fillHexFields(col, cal.get(0)); - setHue(col, cal.get(0)); - setSelector(col, cal.get(0)); - setCurrentColor(col, cal.get(0)); - setNewColor(col, cal.get(0)); - } - }); - } - }; - }(); - $.fn.extend({ - ColorPicker: ColorPicker.init, - ColorPickerHide: ColorPicker.hidePicker, - ColorPickerShow: ColorPicker.showPicker, - ColorPickerSetColor: ColorPicker.setColor - }); -})(jQuery); diff --git a/3.1/modules/photoannotation/js/jquery.colorpicker.min.js b/3.1/modules/photoannotation/js/jquery.colorpicker.min.js deleted file mode 100644 index 36da9f98..00000000 --- a/3.1/modules/photoannotation/js/jquery.colorpicker.min.js +++ /dev/null @@ -1 +0,0 @@ -(function($){var ColorPicker=function(){var ids={},inAction,charMin=65,visible,tpl='
      ',defaults={eventName:'click',onShow:function(){},onBeforeShow:function(){},onHide:function(){},onChange:function(){},onSubmit:function(){},color:'ff0000',livePreview:true,flat:false},fillRGBFields=function(hsb,cal){var rgb=HSBToRGB(hsb);$(cal).data('colorpicker').fields.eq(1).val(rgb.r).end().eq(2).val(rgb.g).end().eq(3).val(rgb.b).end()},fillHSBFields=function(hsb,cal){$(cal).data('colorpicker').fields.eq(4).val(hsb.h).end().eq(5).val(hsb.s).end().eq(6).val(hsb.b).end()},fillHexFields=function(hsb,cal){$(cal).data('colorpicker').fields.eq(0).val(HSBToHex(hsb)).end()},setSelector=function(hsb,cal){$(cal).data('colorpicker').selector.css('backgroundColor','#'+HSBToHex({h:hsb.h,s:100,b:100}));$(cal).data('colorpicker').selectorIndic.css({left:parseInt(150*hsb.s/100,10),top:parseInt(150*(100-hsb.b)/100,10)})},setHue=function(hsb,cal){$(cal).data('colorpicker').hue.css('top',parseInt(150-150*hsb.h/360,10))},setCurrentColor=function(hsb,cal){$(cal).data('colorpicker').currentColor.css('backgroundColor','#'+HSBToHex(hsb))},setNewColor=function(hsb,cal){$(cal).data('colorpicker').newColor.css('backgroundColor','#'+HSBToHex(hsb))},keyDown=function(ev){var pressedKey=ev.charCode||ev.keyCode||-1;if((pressedKey>charMin&&pressedKey<=90)||pressedKey==32){return false}var cal=$(this).parent().parent();if(cal.data('colorpicker').livePreview===true){change.apply(this)}},change=function(ev){var cal=$(this).parent().parent(),col;if(this.parentNode.className.indexOf('_hex')>0){cal.data('colorpicker').color=col=HexToHSB(fixHex(this.value))}else if(this.parentNode.className.indexOf('_hsb')>0){cal.data('colorpicker').color=col=fixHSB({h:parseInt(cal.data('colorpicker').fields.eq(4).val(),10),s:parseInt(cal.data('colorpicker').fields.eq(5).val(),10),b:parseInt(cal.data('colorpicker').fields.eq(6).val(),10)})}else{cal.data('colorpicker').color=col=RGBToHSB(fixRGB({r:parseInt(cal.data('colorpicker').fields.eq(1).val(),10),g:parseInt(cal.data('colorpicker').fields.eq(2).val(),10),b:parseInt(cal.data('colorpicker').fields.eq(3).val(),10)}))}if(ev){fillRGBFields(col,cal.get(0));fillHexFields(col,cal.get(0));fillHSBFields(col,cal.get(0))}setSelector(col,cal.get(0));setHue(col,cal.get(0));setNewColor(col,cal.get(0));cal.data('colorpicker').onChange.apply(cal,[col,HSBToHex(col),HSBToRGB(col)])},blur=function(ev){var cal=$(this).parent().parent();cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus')},focus=function(){charMin=this.parentNode.className.indexOf('_hex')>0?70:65;$(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');$(this).parent().addClass('colorpicker_focus')},downIncrement=function(ev){var field=$(this).parent().find('input').focus();var current={el:$(this).parent().addClass('colorpicker_slider'),max:this.parentNode.className.indexOf('_hsb_h')>0?360:(this.parentNode.className.indexOf('_hsb')>0?100:255),y:ev.pageY,field:field,val:parseInt(field.val(),10),preview:$(this).parent().parent().data('colorpicker').livePreview};$(document).bind('mouseup',current,upIncrement);$(document).bind('mousemove',current,moveIncrement)},moveIncrement=function(ev){ev.data.field.val(Math.max(0,Math.min(ev.data.max,parseInt(ev.data.val+ev.pageY-ev.data.y,10))));if(ev.data.preview){change.apply(ev.data.field.get(0),[true])}return false},upIncrement=function(ev){change.apply(ev.data.field.get(0),[true]);ev.data.el.removeClass('colorpicker_slider').find('input').focus();$(document).unbind('mouseup',upIncrement);$(document).unbind('mousemove',moveIncrement);return false},downHue=function(ev){var current={cal:$(this).parent(),y:$(this).offset().top};current.preview=current.cal.data('colorpicker').livePreview;$(document).bind('mouseup',current,upHue);$(document).bind('mousemove',current,moveHue)},moveHue=function(ev){change.apply(ev.data.cal.data('colorpicker').fields.eq(4).val(parseInt(360*(150-Math.max(0,Math.min(150,(ev.pageY-ev.data.y))))/150,10)).get(0),[ev.data.preview]);return false},upHue=function(ev){fillRGBFields(ev.data.cal.data('colorpicker').color,ev.data.cal.get(0));fillHexFields(ev.data.cal.data('colorpicker').color,ev.data.cal.get(0));$(document).unbind('mouseup',upHue);$(document).unbind('mousemove',moveHue);return false},downSelector=function(ev){var current={cal:$(this).parent(),pos:$(this).offset()};current.preview=current.cal.data('colorpicker').livePreview;$(document).bind('mouseup',current,upSelector);$(document).bind('mousemove',current,moveSelector)},moveSelector=function(ev){change.apply(ev.data.cal.data('colorpicker').fields.eq(6).val(parseInt(100*(150-Math.max(0,Math.min(150,(ev.pageY-ev.data.pos.top))))/150,10)).end().eq(5).val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX-ev.data.pos.left))))/150,10)).get(0),[ev.data.preview]);return false},upSelector=function(ev){fillRGBFields(ev.data.cal.data('colorpicker').color,ev.data.cal.get(0));fillHexFields(ev.data.cal.data('colorpicker').color,ev.data.cal.get(0));$(document).unbind('mouseup',upSelector);$(document).unbind('mousemove',moveSelector);return false},enterSubmit=function(ev){$(this).addClass('colorpicker_focus')},leaveSubmit=function(ev){$(this).removeClass('colorpicker_focus')},clickSubmit=function(ev){var cal=$(this).parent();var col=cal.data('colorpicker').color;cal.data('colorpicker').origColor=col;setCurrentColor(col,cal.get(0));cal.data('colorpicker').onSubmit(col,HSBToHex(col),HSBToRGB(col),cal.data('colorpicker').el)},show=function(ev){var cal=$('#'+$(this).data('colorpickerId'));cal.data('colorpicker').onBeforeShow.apply(this,[cal.get(0)]);var pos=$(this).offset();var viewPort=getViewport();var top=pos.top+this.offsetHeight;var left=pos.left;if(top+176>viewPort.t+viewPort.h){top-=this.offsetHeight+176}if(left+356>viewPort.l+viewPort.w){left-=356}cal.css({left:left+'px',top:top+'px'});if(cal.data('colorpicker').onShow.apply(this,[cal.get(0)])!=false){cal.show()}$(document).bind('mousedown',{cal:cal},hide);return false},hide=function(ev){if(!isChildOf(ev.data.cal.get(0),ev.target,ev.data.cal.get(0))){if(ev.data.cal.data('colorpicker').onHide.apply(this,[ev.data.cal.get(0)])!=false){ev.data.cal.hide()}$(document).unbind('mousedown',hide)}},isChildOf=function(parentEl,el,container){if(parentEl==el){return true}if(parentEl.contains){return parentEl.contains(el)}if(parentEl.compareDocumentPosition){return!!(parentEl.compareDocumentPosition(el)&16)}var prEl=el.parentNode;while(prEl&&prEl!=container){if(prEl==parentEl)return true;prEl=prEl.parentNode}return false},getViewport=function(){var m=document.compatMode=='CSS1Compat';return{l:window.pageXOffset||(m?document.documentElement.scrollLeft:document.body.scrollLeft),t:window.pageYOffset||(m?document.documentElement.scrollTop:document.body.scrollTop),w:window.innerWidth||(m?document.documentElement.clientWidth:document.body.clientWidth),h:window.innerHeight||(m?document.documentElement.clientHeight:document.body.clientHeight)}},fixHSB=function(hsb){return{h:Math.min(360,Math.max(0,hsb.h)),s:Math.min(100,Math.max(0,hsb.s)),b:Math.min(100,Math.max(0,hsb.b))}},fixRGB=function(rgb){return{r:Math.min(255,Math.max(0,rgb.r)),g:Math.min(255,Math.max(0,rgb.g)),b:Math.min(255,Math.max(0,rgb.b))}},fixHex=function(hex){var len=6-hex.length;if(len>0){var o=[];for(var i=0;i-1)?hex.substring(1):hex),16);return{r:hex>>16,g:(hex&0x00FF00)>>8,b:(hex&0x0000FF)}},HexToHSB=function(hex){return RGBToHSB(HexToRGB(hex))},RGBToHSB=function(rgb){var hsb={h:0,s:0,b:0};var min=Math.min(rgb.r,rgb.g,rgb.b);var max=Math.max(rgb.r,rgb.g,rgb.b);var delta=max-min;hsb.b=max;if(max!=0){}hsb.s=max!=0?255*delta/max:0;if(hsb.s!=0){if(rgb.r==max){hsb.h=(rgb.g-rgb.b)/delta}else if(rgb.g==max){hsb.h=2+(rgb.b-rgb.r)/delta}else{hsb.h=4+(rgb.r-rgb.g)/delta}}else{hsb.h=-1}hsb.h*=60;if(hsb.h<0){hsb.h+=360}hsb.s*=100/255;hsb.b*=100/255;return hsb},HSBToRGB=function(hsb){var rgb={};var h=Math.round(hsb.h);var s=Math.round(hsb.s*255/100);var v=Math.round(hsb.b*255/100);if(s==0){rgb.r=rgb.g=rgb.b=v}else{var t1=v;var t2=(255-s)*v/255;var t3=(t1-t2)*(h%60)/60;if(h==360)h=0;if(h<60){rgb.r=t1;rgb.b=t2;rgb.g=t2+t3}else if(h<120){rgb.g=t1;rgb.b=t2;rgb.r=t1-t3}else if(h<180){rgb.g=t1;rgb.r=t2;rgb.b=t2+t3}else if(h<240){rgb.b=t1;rgb.r=t2;rgb.g=t1-t3}else if(h<300){rgb.b=t1;rgb.g=t2;rgb.r=t2+t3}else if(h<360){rgb.r=t1;rgb.g=t2;rgb.b=t1-t3}else{rgb.r=0;rgb.g=0;rgb.b=0}}return{r:Math.round(rgb.r),g:Math.round(rgb.g),b:Math.round(rgb.b)}},RGBToHex=function(rgb){var hex=[rgb.r.toString(16),rgb.g.toString(16),rgb.b.toString(16)];$.each(hex,function(nr,val){if(val.length==1){hex[nr]='0'+val}});return hex.join('')},HSBToHex=function(hsb){return RGBToHex(HSBToRGB(hsb))},restoreOriginal=function(){var cal=$(this).parent();var col=cal.data('colorpicker').origColor;cal.data('colorpicker').color=col;fillRGBFields(col,cal.get(0));fillHexFields(col,cal.get(0));fillHSBFields(col,cal.get(0));setSelector(col,cal.get(0));setHue(col,cal.get(0));setNewColor(col,cal.get(0))};return{init:function(opt){opt=$.extend({},defaults,opt||{});if(typeof opt.color=='string'){opt.color=HexToHSB(opt.color)}else if(opt.color.r!=undefined&&opt.color.g!=undefined&&opt.color.b!=undefined){opt.color=RGBToHSB(opt.color)}else if(opt.color.h!=undefined&&opt.color.s!=undefined&&opt.color.b!=undefined){opt.color=fixHSB(opt.color)}else{return this}return this.each(function(){if(!$(this).data('colorpickerId')){var options=$.extend({},opt);options.origColor=opt.color;var id='collorpicker_'+parseInt(Math.random()*1000);$(this).data('colorpickerId',id);var cal=$(tpl).attr('id',id);if(options.flat){cal.appendTo(this).show()}else{cal.appendTo(document.body)}options.fields=cal.find('input').bind('keyup',keyDown).bind('change',change).bind('blur',blur).bind('focus',focus);cal.find('span').bind('mousedown',downIncrement).end().find('>div.colorpicker_current_color').bind('click',restoreOriginal);options.selector=cal.find('div.colorpicker_color').bind('mousedown',downSelector);options.selectorIndic=options.selector.find('div div');options.el=this;options.hue=cal.find('div.colorpicker_hue div');cal.find('div.colorpicker_hue').bind('mousedown',downHue);options.newColor=cal.find('div.colorpicker_new_color');options.currentColor=cal.find('div.colorpicker_current_color');cal.data('colorpicker',options);cal.find('div.colorpicker_submit').bind('mouseenter',enterSubmit).bind('mouseleave',leaveSubmit).bind('click',clickSubmit);fillRGBFields(options.color,cal.get(0));fillHSBFields(options.color,cal.get(0));fillHexFields(options.color,cal.get(0));setHue(options.color,cal.get(0));setSelector(options.color,cal.get(0));setCurrentColor(options.color,cal.get(0));setNewColor(options.color,cal.get(0));if(options.flat){cal.css({position:'relative',display:'block'})}else{$(this).bind(options.eventName,show)}}})},showPicker:function(){return this.each(function(){if($(this).data('colorpickerId')){show.apply(this)}})},hidePicker:function(){return this.each(function(){if($(this).data('colorpickerId')){$('#'+$(this).data('colorpickerId')).hide()}})},setColor:function(col){if(typeof col=='string'){col=HexToHSB(col)}else if(col.r!=undefined&&col.g!=undefined&&col.b!=undefined){col=RGBToHSB(col)}else if(col.h!=undefined&&col.s!=undefined&&col.b!=undefined){col=fixHSB(col)}else{return this}return this.each(function(){if($(this).data('colorpickerId')){var cal=$('#'+$(this).data('colorpickerId'));cal.data('colorpicker').color=col;cal.data('colorpicker').origColor=col;fillRGBFields(col,cal.get(0));fillHSBFields(col,cal.get(0));fillHexFields(col,cal.get(0));setHue(col,cal.get(0));setSelector(col,cal.get(0));setCurrentColor(col,cal.get(0));setNewColor(col,cal.get(0))}})}}}();$.fn.extend({ColorPicker:ColorPicker.init,ColorPickerHide:ColorPicker.hidePicker,ColorPickerShow:ColorPicker.showPicker,ColorPickerSetColor:ColorPicker.setColor})})(jQuery); diff --git a/3.1/modules/photoannotation/models/items_face.php b/3.1/modules/photoannotation/models/items_face.php deleted file mode 100644 index 51737a45..00000000 --- a/3.1/modules/photoannotation/models/items_face.php +++ /dev/null @@ -1,21 +0,0 @@ - -
      -

      -

      -

      TagFaces module by rWatcher.
      - This means that notes and faces that you create in either one will be shown and are editable by the other module as well. If you added users to an annotation area though they will only be displayed with the Photo Annotation module.
      - You cannot have both active at the same time.", array("tagfaces" => "http://codex.gallery2.org/Gallery3:Modules:tagfaces")) ?> -

      Convert existing tag annotations to user annotations", array("url" => url::site("admin/photoannotation/converter/"))) ?> -
      Check for orphaned annotations", array("url" => url::site("admin/photoannotation/tagsmaintanance/"))) ?>

      - -
      - diff --git a/3.1/modules/photoannotation/views/admin_photoannotation_converter.html.php b/3.1/modules/photoannotation/views/admin_photoannotation_converter.html.php deleted file mode 100644 index 4b8dfa1d..00000000 --- a/3.1/modules/photoannotation/views/admin_photoannotation_converter.html.php +++ /dev/null @@ -1,10 +0,0 @@ - -
      -

      -

      -



      - -
      Back to photo annotation settings", array("url" => url::site("admin/photoannotation/"))) ?> -
      Check for orphaned annotations", array("url" => url::site("admin/photoannotation/tagsmaintanance/"))) ?>

      - -
      diff --git a/3.1/modules/photoannotation/views/admin_photoannotation_tagsmaintanance.html.php b/3.1/modules/photoannotation/views/admin_photoannotation_tagsmaintanance.html.php deleted file mode 100644 index 9e373780..00000000 --- a/3.1/modules/photoannotation/views/admin_photoannotation_tagsmaintanance.html.php +++ /dev/null @@ -1,27 +0,0 @@ - -
      -

      -

      -

      -

      Back to photo annotation settings", array("url" => url::site("admin/photoannotation/"))) ?> -
      Convert existing tag annotations to user annotations", array("url" => url::site("admin/photoannotation/converter/"))) ?>

      - -

      -

      $user_orphanes_deleted)) ?> -
      $tag_orpanes_deleted)) ?> -
      $item_orphanes_deleted)) ?> -

      - Back", array("url" => url::site("admin/photoannotation/"))) ?> - -

      -

      $user_orphanes_count)) ?> -
      $tag_orpanes_count)) ?> -
      $item_orphanes_count)) ?> -

      - - Back", array("url" => url::site("admin/photoannotation/"))) ?> - - Remove all", array("url" => url::site("admin/photoannotation/tagsmaintanance/true"))) ?> - - -
      diff --git a/3.1/modules/photoannotation/views/photoannotation_block.html.php b/3.1/modules/photoannotation/views/photoannotation_block.html.php deleted file mode 100644 index 8861699a..00000000 --- a/3.1/modules/photoannotation/views/photoannotation_block.html.php +++ /dev/null @@ -1,17 +0,0 @@ - - -
      "> - -
      - \ No newline at end of file diff --git a/3.1/modules/photoannotation/views/photoannotation_cloud.html.php b/3.1/modules/photoannotation/views/photoannotation_cloud.html.php deleted file mode 100644 index 6f47b272..00000000 --- a/3.1/modules/photoannotation/views/photoannotation_cloud.html.php +++ /dev/null @@ -1,9 +0,0 @@ - -
        - -
      • - size ?> photos are tagged with - name) ?> -
      • - -
      diff --git a/3.1/modules/photoannotation/views/photoannotation_highlight_block.html.php b/3.1/modules/photoannotation/views/photoannotation_highlight_block.html.php deleted file mode 100644 index 9408380d..00000000 --- a/3.1/modules/photoannotation/views/photoannotation_highlight_block.html.php +++ /dev/null @@ -1,136 +0,0 @@ -where("item_id", "=", $item->id) - ->find_all(); - $existingFaces = ORM::factory("items_face") - ->where("item_id", "=", $item->id) - ->find_all(); - $existingNotes = ORM::factory("items_note") - ->where("item_id", "=", $item->id) - ->find_all(); - $fullname = module::get_var("photoannotation", "fullname", false); - $showusers = module::get_var("photoannotation", "showusers", false); - $showfaces = module::get_var("photoannotation", "showfaces", false); - $shownotes = module::get_var("photoannotation", "shownotes", false); - if (locales::is_rtl()) { - $rtl_support = "image-annotate-rtl"; - } else { - $rtl_support = ""; - } - $tags_arraystring = ""; - $jscode = ""; - $legend_faces = ""; - $legend_notes = ""; - $legend_users = ""; - if (module::get_var("gallery", "active_site_theme") == "greydragon") { - $css_item_id = "#g-photo-id-". $item->id; - $css_a_class = ".g-sb-preview"; - } else { - $css_item_id = "#g-item-id-". $item->id; - $css_a_class = ".g-fullsize-link"; - } - // If it does, then insert some javascript and display an image map - // to show where the faces are at. - if ((count($existingFaces) > 0) || (count($existingNotes) > 0) || (count($existingUsers) > 0)) { - $jscode = "notes: [ "; - foreach ($existingUsers as $oneUser) { - $oneTag = ORM::factory("user", $oneUser->user_id); - if ($oneTag->loaded()) { - if ($fullname) { - $user_text = $oneTag->display_name(); - } else { - $user_text = $oneTag->name; - } - if ($showusers) { - $legend_users .= "id . "\">user_id) ."\">". html::clean($user_text) ." "; - } - $jscode .= "{ \"top\": ". $oneUser->y1 .",\n"; - $jscode .= "\"left\": ". $oneUser->x1 .",\n"; - $jscode .= "\"width\": ". ($oneUser->x2 - $oneUser->x1) .",\n"; - $jscode .= "\"height\": ". ($oneUser->y2 - $oneUser->y1) .",\n"; - $jscode .= "\"text\": \"". html::clean($user_text) ."\",\n"; - $jscode .= "\"internaltext\": \"". $oneTag->display_name() ." (". $oneTag->name .")\",\n"; - $jscode .= "\"description\": \"". html::clean($oneUser->description) ."\",\n"; - $jscode .= "\"noteid\": ". $oneUser->id .",\n"; - $jscode .= "\"notetype\": \"user\",\n"; - $jscode .= "\"editable\": true,\n"; - $jscode .= "\"url\": \"". user_profile::url($oneUser->user_id) ."\" },\n"; - } - } - foreach ($existingFaces as $oneFace) { - $oneTag = ORM::factory("tag", $oneFace->tag_id); - if ($oneTag->loaded()) { - if ($showfaces) { - $legend_faces .= "id . "\">url() ."\">". html::clean($oneTag->name) ." "; - } - $jscode .= "{ \"top\": ". $oneFace->y1 .",\n"; - $jscode .= "\"left\": ". $oneFace->x1 .",\n"; - $jscode .= "\"width\": ". ($oneFace->x2 - $oneFace->x1) .",\n"; - $jscode .= "\"height\": ". ($oneFace->y2 - $oneFace->y1) .",\n"; - $jscode .= "\"text\": \"". html::clean($oneTag->name) ."\",\n"; - $jscode .= "\"description\": \"". html::clean($oneFace->description) ."\",\n"; - $jscode .= "\"noteid\": ". $oneFace->id .",\n"; - $jscode .= "\"notetype\": \"face\",\n"; - $jscode .= "\"editable\": true,\n"; - $jscode .= "\"url\": \"". $oneTag->url() ."\" },\n"; - } - } - foreach ($existingNotes as $oneNote) { - if ($shownotes) { - $legend_notes .= "id . "\">". html::clean($oneNote->title) ." "; - } - $jscode .= "{ \"top\": ". $oneNote->y1 .",\n"; - $jscode .= "\"left\": ". $oneNote->x1 .",\n"; - $jscode .= "\"width\": ". ($oneNote->x2 - $oneNote->x1) .",\n"; - $jscode .= "\"height\": ". ($oneNote->y2 - $oneNote->y1) .",\n"; - $jscode .= "\"text\": \"". html::clean($oneNote->title) ."\",\n"; - $jscode .= "\"description\": \"". html::clean($oneNote->description) ."\",\n"; - $jscode .= "\"noteid\": ". $oneNote->id .",\n"; - $jscode .= "\"notetype\": \"note\",\n"; - $jscode .= "\"editable\": false,\n"; - $jscode .= "\"url\": \"\" },\n"; - } - $jscode = trim($jscode, ",\n"); - $jscode .= " ],"; - } - $display = "none"; - if ($legend_users != "") { - $display = "block"; - } - $legend_users = t("People on this photo: ") . $legend_users .""; - $display = "none"; - if ($legend_faces != "") { - $display = "block"; - } - $legend_faces = t("Faces on this photo: ") . $legend_faces .""; - $display = "none"; - if ($legend_notes != "") { - $display = "block"; - } - $legend_notes = t("Notes on this photo: ") . $legend_notes .""; - $legend_display = $legend_users . $legend_faces . $legend_notes; - $labels_arraystring = "labels: [ '". t("Tag:") ."','". t("Note Title:") ."','". t("Description (optional)") ."','". t("Are you sure you want to delete this annotation?") ."','". t("or") ."','". t("Yes") ."','". t("No") ."','". t("Confirm deletion") ."','". t("Save") ."','". t("Cancel") ."','". t("Person:") ."','". t("No user selected") ."','". t("Select one of the following") ."','". t("An error ocurred while saving annotation") ."','". t("OK") ."','". t("An error ocurred while deleting annotation") ."','". t("View fullsize") ."' ],"; -?> - - ". $legend_display ."
      " ?> diff --git a/3.1/modules/photoannotation/views/photoannotation_user_search.html.php b/3.1/modules/photoannotation/views/photoannotation_user_search.html.php deleted file mode 100644 index 2182a324..00000000 --- a/3.1/modules/photoannotation/views/photoannotation_user_search.html.php +++ /dev/null @@ -1,55 +0,0 @@ - - -
      "> -

      - - - - - id) ."\">" ?> -
      -

      " - alt="display_name()) ?>" - class="g-avatar" width="40" height="40" /> - name ?>

      -
      - - - - - - - - - - - - - - - - -
      display_name() ?>
      id) ?>
      id) ?>
      -
      -
      - - - - - -
      diff --git a/3.1/modules/phpmailer/controllers/admin_phpmailer.php b/3.1/modules/phpmailer/controllers/admin_phpmailer.php deleted file mode 100644 index b64248aa..00000000 --- a/3.1/modules/phpmailer/controllers/admin_phpmailer.php +++ /dev/null @@ -1,109 +0,0 @@ -content = new View("admin_phpmailer.html"); - $view->content->phpmailer_form = $this->_get_admin_form(); - print $view; - } - - public function saveprefs() { - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Figure out the values of the text boxes - $str_phpmailer_path = Input::instance()->post("phpmailer_path"); - $str_phpmailer_from_addr = Input::instance()->post("phpmailer_from_address"); - $str_phpmailer_from_name = Input::instance()->post("phpmailer_from_name"); - $str_smtp_server = Input::instance()->post("phpmailer_smtp_server"); - $str_use_ssl = Input::instance()->post("phpmailer_use_ssl"); - $str_smtp_login = Input::instance()->post("phpmailer_smtp_login"); - $str_smtp_pass = Input::instance()->post("phpmailer_smtp_password"); - $str_smtp_port = Input::instance()->post("phpmailer_smtp_port"); - - if (count($str_use_ssl) > 0) { - $str_use_ssl = true; - } else { - $str_use_ssl = false; - } - - // Save Settings. - module::set_var("phpmailer", "phpmailer_path", $str_phpmailer_path); - module::set_var("phpmailer", "phpmailer_from_address", $str_phpmailer_from_addr); - module::set_var("phpmailer", "phpmailer_from_name", $str_phpmailer_from_name); - module::set_var("phpmailer", "smtp_server", $str_smtp_server); - module::set_var("phpmailer", "use_ssl", $str_use_ssl); - module::set_var("phpmailer", "smtp_login", $str_smtp_login); - module::set_var("phpmailer", "smtp_password", $str_smtp_pass); - module::set_var("phpmailer", "smtp_port", $str_smtp_port); - message::success(t("Your Settings Have Been Saved.")); - - // Load Admin page. - $view = new Admin_View("admin.html"); - $view->content = new View("admin_phpmailer.html"); - $view->content->phpmailer_form = $this->_get_admin_form(); - print $view; - } - - private function _get_admin_form() { - // Make a new Form. - $form = new Forge("admin/phpmailer/saveprefs", "", "post", - array("id" => "g-php-mailer-admin-form")); - - // Create the input boxes for the PHPMailer Settings - $phpmailerGroup = $form->group("PHPMailerSettings"); - $phpmailerGroup->input("phpmailer_path") - ->label(t("Location of PHPMailer Class")) - ->value(module::get_var("phpmailer", "phpmailer_path")); - $phpmailerGroup->input("phpmailer_from_address") - ->label(t("From Email Address")) - ->value(module::get_var("phpmailer", "phpmailer_from_address")); - $phpmailerGroup->input("phpmailer_from_name") - ->label(t("From Name")) - ->value(module::get_var("phpmailer", "phpmailer_from_name")); - - // Create the input boxes for the SMTP server settings - $phpmailerSMTP = $form->group("PHPMailerSMTPSettings"); - $phpmailerSMTP->input("phpmailer_smtp_server") - ->label(t("SMTP Server Address")) - ->value(module::get_var("phpmailer", "smtp_server")); - $phpmailerSMTP->input("phpmailer_smtp_login") - ->label(t("SMTP Login Name")) - ->value(module::get_var("phpmailer", "smtp_login")); - $phpmailerSMTP->password("phpmailer_smtp_password") - ->label(t("SMTP Password")) - ->value(module::get_var("phpmailer", "smtp_password")); - $phpmailerSMTP->input("phpmailer_smtp_port") - ->label(t("SMTP Port")) - ->value(module::get_var("phpmailer", "smtp_port")); - $phpmailer_checklist["use_ssl_checkbox"] = array(t("Use SSL?"), module::get_var("phpmailer", "use_ssl")); - $phpmailerSMTP->checklist("phpmailer_use_ssl") - ->options($phpmailer_checklist); - - // Add a save button to the form. - $form->submit("SaveSettings")->value(t("Save")); - - // Return the newly generated form. - return $form; - } -} diff --git a/3.1/modules/phpmailer/helpers/phpmailer_event.php b/3.1/modules/phpmailer/helpers/phpmailer_event.php deleted file mode 100644 index 58ce104d..00000000 --- a/3.1/modules/phpmailer/helpers/phpmailer_event.php +++ /dev/null @@ -1,28 +0,0 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("phpmailer") - ->label(t("PHPMailer Settings")) - ->url(url::site("admin/phpmailer"))); - } -} diff --git a/3.1/modules/phpmailer/helpers/phpmailer_installer.php b/3.1/modules/phpmailer/helpers/phpmailer_installer.php deleted file mode 100644 index 8fb8b0cd..00000000 --- a/3.1/modules/phpmailer/helpers/phpmailer_installer.php +++ /dev/null @@ -1,41 +0,0 @@ -headers = array(); - $this->from(module::get_var("gallery", "email_from", "")); - $this->reply_to(module::get_var("gallery", "email_reply_to", "")); - $this->line_length(module::get_var("gallery", "email_line_length", 70)); - $separator = module::get_var("gallery", "email_header_separator", null); - $this->header_separator(empty($separator) ? "\n" : unserialize($separator)); - } - - public function __get($key) { - return null; - } - - public function __call($key, $value) { - switch ($key) { - case "to": - $this->to = is_array($value[0]) ? $value[0] : array($value[0]); - break; - case "header": - if (count($value) != 2) { - Kohana_Log::add("error", wordwrap("Invalid header parameters\n" . Kohana::debug($value))); - throw new Exception("@todo INVALID_HEADER_PARAMETERS"); - } - $this->headers[$value[0]] = $value[1]; - break; - case "from": - $this->headers["From"] = $value[0]; - break; - case "reply_to": - $this->headers["Reply-To"] = $value[0]; - break; - default: - $this->$key = $value[0]; - } - return $this; - } - - public function send() { - if (empty($this->to)) { - Kohana_Log::add("error", wordwrap("Sending mail failed:\nNo to address specified")); - throw new Exception("@todo TO_IS_REQUIRED_FOR_MAIL"); - } - $to = implode(", ", $this->to); - $headers = array(); - foreach ($this->headers as $key => $value) { - $key = ucfirst($key); - $headers[] = "$key: $value"; - } - - // The docs say headers should be separated by \r\n, but occasionaly that doesn't work and you - // need to use a single \n. This can be set in config/sendmail.php - $headers = implode($this->header_separator, $headers); - $message = wordwrap($this->message, $this->line_length, "\n"); - if (!$this->mail($to, $this->subject, $message, $headers)) { - throw new Exception("@todo SEND_MAIL_FAILED"); - } - return $this; - } - - public function mail($to, $subject, $message, $headers) { - // This function is completely different from the original - // Gallery Sendmail script. Outside of this function, - // no other changes were made. - - require(module::get_var("phpmailer", "phpmailer_path")); - $mail = new PHPMailer(); - - $mail->IsSMTP(); - $mail->Host = module::get_var("phpmailer", "smtp_server"); - $mail->Port = module::get_var("phpmailer", "smtp_port"); - - if (module::get_var("phpmailer", "smtp_login") != "") { - $mail->SMTPAuth = true; - if (module::get_var("phpmailer", "use_ssl") == true) { - $mail->SMTPSecure = "ssl"; - } - $mail->Username = module::get_var("phpmailer", "smtp_login"); - $mail->Password = module::get_var("phpmailer", "smtp_password"); - } else { - $mail->SMTPAuth = false; - } - - $mail->From = module::get_var("phpmailer", "phpmailer_from_address"); - $mail->FromName = module::get_var("phpmailer", "phpmailer_from_name"); - $mail->AddAddress($to); - $mail->IsHTML(true); - - // demdel's fix for the ecard module. - $boundaryLine = explode("\n", $message, -1); - $newboundary = substr($boundaryLine[0],2); - if (preg_match("/--/", $boundaryLine[0])) { - if (preg_match("/--".$newboundary."--/", end($boundaryLine))) { - $mail->CharSet = "UTF-8"; - $mail->ContentType = "multipart/related; boundary=\"".$newboundary."\""; - } - } - - $mail->Subject = $subject; - $mail->Body = $message; - - return $mail->Send(); - } -} diff --git a/3.1/modules/phpmailer/module.info b/3.1/modules/phpmailer/module.info deleted file mode 100644 index c8659374..00000000 --- a/3.1/modules/phpmailer/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "PHPMailer" -description = "Use PHPMailer when sending email messages." -version = 2 -author_name = "rWatcher" -author_url = "http://codex.gallery2.org/User:RWatcher" -info_url = "http://codex.gallery2.org/Gallery3:Modules:phpmailer" -discuss_url = "http://gallery.menalto.com/node/89279" diff --git a/3.1/modules/phpmailer/views/admin_phpmailer.html.php b/3.1/modules/phpmailer/views/admin_phpmailer.html.php deleted file mode 100644 index d6c3ec0a..00000000 --- a/3.1/modules/phpmailer/views/admin_phpmailer.html.php +++ /dev/null @@ -1,5 +0,0 @@ - -
      -

      - -
      diff --git a/3.1/modules/polar_rose/helpers/polar_rose_theme.php b/3.1/modules/polar_rose/helpers/polar_rose_theme.php deleted file mode 100644 index 32e355f9..00000000 --- a/3.1/modules/polar_rose/helpers/polar_rose_theme.php +++ /dev/null @@ -1,50 +0,0 @@ -item() || $theme->tag())) { - if ($item = $theme->item()) { - $url = rss::feed_link("gallery/album/{$item->id}"); - } else if ($tag = $theme->tag()) { - $url = rss::feed_link("tag/tag/{$tag->id}"); - } - - // Polar Rose doesn't understand relative URLs. Hack around that until they fix it. - $url = url::abs_site(substr($url, strpos($url, "index.php") + 10)); - - return "" . - ""; - } - } - - static function page_bottom($theme) { - return "
      "; - } -} diff --git a/3.1/modules/polar_rose/module.info b/3.1/modules/polar_rose/module.info deleted file mode 100644 index af083e09..00000000 --- a/3.1/modules/polar_rose/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Polar Rose" -description = "Integrate Gallery with the Polar Rose facial recognition service." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:polar_rose" -discuss_url = "http://gallery.menalto.com/forum_module_polar_rose" diff --git a/3.1/modules/purifier/config/purifier.php b/3.1/modules/purifier/config/purifier.php deleted file mode 100644 index 7d47787f..00000000 --- a/3.1/modules/purifier/config/purifier.php +++ /dev/null @@ -1,27 +0,0 @@ - TMPPATH -); - -$config["Attr"] = array( - "EnableID" => true -); diff --git a/3.1/modules/purifier/helpers/purifier.php b/3.1/modules/purifier/helpers/purifier.php deleted file mode 100644 index 5f31b7f3..00000000 --- a/3.1/modules/purifier/helpers/purifier.php +++ /dev/null @@ -1,36 +0,0 @@ - $key_value) { - foreach ($key_value as $key => $value) { - $config->set("$category.$key", $value); - } - } - self::$_purifier = new HTMLPurifier($config); - } - - return self::$_purifier->purify($dirty_html); - } -} diff --git a/3.1/modules/purifier/module.info b/3.1/modules/purifier/module.info deleted file mode 100644 index b29a0f0a..00000000 --- a/3.1/modules/purifier/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "HTML Purifier" -description = "Enable XSS protection using HTMLPurifier" -version = 2 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:purifier" -discuss_url = "http://gallery.menalto.com/forum_module_purifier" diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier.auto.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier.auto.php deleted file mode 100644 index 2e2c685e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier.auto.php +++ /dev/null @@ -1,11 +0,0 @@ -purify($html, $config); -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier.includes.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier.includes.php deleted file mode 100644 index 08737c20..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier.includes.php +++ /dev/null @@ -1,212 +0,0 @@ - $attributes) { - $allowed_elements[$element] = true; - foreach ($attributes as $attribute => $x) { - $allowed_attributes["$element.$attribute"] = true; - } - } - $config->set('HTML.AllowedElements', $allowed_elements); - $config->set('HTML.AllowedAttributes', $allowed_attributes); - $allowed_schemes = array(); - if ($allowed_protocols !== null) { - $config->set('URI.AllowedSchemes', $allowed_protocols); - } - $purifier = new HTMLPurifier($config); - return $purifier->purify($string); -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier.path.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier.path.php deleted file mode 100644 index 8a38372e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier.path.php +++ /dev/null @@ -1,11 +0,0 @@ -config = HTMLPurifier_Config::create($config); - - $this->strategy = new HTMLPurifier_Strategy_Core(); - - } - - /** - * Adds a filter to process the output. First come first serve - * @param $filter HTMLPurifier_Filter object - */ - public function addFilter($filter) { - trigger_error('HTMLPurifier->addFilter() is deprecated, use configuration directives in the Filter namespace or Filter.Custom', E_USER_WARNING); - $this->filters[] = $filter; - } - - /** - * Filters an HTML snippet/document to be XSS-free and standards-compliant. - * - * @param $html String of HTML to purify - * @param $config HTMLPurifier_Config object for this operation, if omitted, - * defaults to the config object specified during this - * object's construction. The parameter can also be any type - * that HTMLPurifier_Config::create() supports. - * @return Purified HTML - */ - public function purify($html, $config = null) { - - // :TODO: make the config merge in, instead of replace - $config = $config ? HTMLPurifier_Config::create($config) : $this->config; - - // implementation is partially environment dependant, partially - // configuration dependant - $lexer = HTMLPurifier_Lexer::create($config); - - $context = new HTMLPurifier_Context(); - - // setup HTML generator - $this->generator = new HTMLPurifier_Generator($config, $context); - $context->register('Generator', $this->generator); - - // set up global context variables - if ($config->get('Core.CollectErrors')) { - // may get moved out if other facilities use it - $language_factory = HTMLPurifier_LanguageFactory::instance(); - $language = $language_factory->create($config, $context); - $context->register('Locale', $language); - - $error_collector = new HTMLPurifier_ErrorCollector($context); - $context->register('ErrorCollector', $error_collector); - } - - // setup id_accumulator context, necessary due to the fact that - // AttrValidator can be called from many places - $id_accumulator = HTMLPurifier_IDAccumulator::build($config, $context); - $context->register('IDAccumulator', $id_accumulator); - - $html = HTMLPurifier_Encoder::convertToUTF8($html, $config, $context); - - // setup filters - $filter_flags = $config->getBatch('Filter'); - $custom_filters = $filter_flags['Custom']; - unset($filter_flags['Custom']); - $filters = array(); - foreach ($filter_flags as $filter => $flag) { - if (!$flag) continue; - if (strpos($filter, '.') !== false) continue; - $class = "HTMLPurifier_Filter_$filter"; - $filters[] = new $class; - } - foreach ($custom_filters as $filter) { - // maybe "HTMLPurifier_Filter_$filter", but be consistent with AutoFormat - $filters[] = $filter; - } - $filters = array_merge($filters, $this->filters); - // maybe prepare(), but later - - for ($i = 0, $filter_size = count($filters); $i < $filter_size; $i++) { - $html = $filters[$i]->preFilter($html, $config, $context); - } - - // purified HTML - $html = - $this->generator->generateFromTokens( - // list of tokens - $this->strategy->execute( - // list of un-purified tokens - $lexer->tokenizeHTML( - // un-purified HTML - $html, $config, $context - ), - $config, $context - ) - ); - - for ($i = $filter_size - 1; $i >= 0; $i--) { - $html = $filters[$i]->postFilter($html, $config, $context); - } - - $html = HTMLPurifier_Encoder::convertFromUTF8($html, $config, $context); - $this->context =& $context; - return $html; - } - - /** - * Filters an array of HTML snippets - * @param $config Optional HTMLPurifier_Config object for this operation. - * See HTMLPurifier::purify() for more details. - * @return Array of purified HTML - */ - public function purifyArray($array_of_html, $config = null) { - $context_array = array(); - foreach ($array_of_html as $key => $html) { - $array_of_html[$key] = $this->purify($html, $config); - $context_array[$key] = $this->context; - } - $this->context = $context_array; - return $array_of_html; - } - - /** - * Singleton for enforcing just one HTML Purifier in your system - * @param $prototype Optional prototype HTMLPurifier instance to - * overload singleton with, or HTMLPurifier_Config - * instance to configure the generated version with. - */ - public static function instance($prototype = null) { - if (!self::$instance || $prototype) { - if ($prototype instanceof HTMLPurifier) { - self::$instance = $prototype; - } elseif ($prototype) { - self::$instance = new HTMLPurifier($prototype); - } else { - self::$instance = new HTMLPurifier(); - } - } - return self::$instance; - } - - /** - * @note Backwards compatibility, see instance() - */ - public static function getInstance($prototype = null) { - return HTMLPurifier::instance($prototype); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier.safe-includes.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier.safe-includes.php deleted file mode 100644 index 899a1f2e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier.safe-includes.php +++ /dev/null @@ -1,206 +0,0 @@ -attr_collections as $coll_i => $coll) { - if (!isset($this->info[$coll_i])) { - $this->info[$coll_i] = array(); - } - foreach ($coll as $attr_i => $attr) { - if ($attr_i === 0 && isset($this->info[$coll_i][$attr_i])) { - // merge in includes - $this->info[$coll_i][$attr_i] = array_merge( - $this->info[$coll_i][$attr_i], $attr); - continue; - } - $this->info[$coll_i][$attr_i] = $attr; - } - } - } - // perform internal expansions and inclusions - foreach ($this->info as $name => $attr) { - // merge attribute collections that include others - $this->performInclusions($this->info[$name]); - // replace string identifiers with actual attribute objects - $this->expandIdentifiers($this->info[$name], $attr_types); - } - } - - /** - * Takes a reference to an attribute associative array and performs - * all inclusions specified by the zero index. - * @param &$attr Reference to attribute array - */ - public function performInclusions(&$attr) { - if (!isset($attr[0])) return; - $merge = $attr[0]; - $seen = array(); // recursion guard - // loop through all the inclusions - for ($i = 0; isset($merge[$i]); $i++) { - if (isset($seen[$merge[$i]])) continue; - $seen[$merge[$i]] = true; - // foreach attribute of the inclusion, copy it over - if (!isset($this->info[$merge[$i]])) continue; - foreach ($this->info[$merge[$i]] as $key => $value) { - if (isset($attr[$key])) continue; // also catches more inclusions - $attr[$key] = $value; - } - if (isset($this->info[$merge[$i]][0])) { - // recursion - $merge = array_merge($merge, $this->info[$merge[$i]][0]); - } - } - unset($attr[0]); - } - - /** - * Expands all string identifiers in an attribute array by replacing - * them with the appropriate values inside HTMLPurifier_AttrTypes - * @param &$attr Reference to attribute array - * @param $attr_types HTMLPurifier_AttrTypes instance - */ - public function expandIdentifiers(&$attr, $attr_types) { - - // because foreach will process new elements we add, make sure we - // skip duplicates - $processed = array(); - - foreach ($attr as $def_i => $def) { - // skip inclusions - if ($def_i === 0) continue; - - if (isset($processed[$def_i])) continue; - - // determine whether or not attribute is required - if ($required = (strpos($def_i, '*') !== false)) { - // rename the definition - unset($attr[$def_i]); - $def_i = trim($def_i, '*'); - $attr[$def_i] = $def; - } - - $processed[$def_i] = true; - - // if we've already got a literal object, move on - if (is_object($def)) { - // preserve previous required - $attr[$def_i]->required = ($required || $attr[$def_i]->required); - continue; - } - - if ($def === false) { - unset($attr[$def_i]); - continue; - } - - if ($t = $attr_types->get($def)) { - $attr[$def_i] = $t; - $attr[$def_i]->required = $required; - } else { - unset($attr[$def_i]); - } - } - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef.php deleted file mode 100644 index 6f82201e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef.php +++ /dev/null @@ -1,123 +0,0 @@ - by removing - * leading and trailing whitespace, ignoring line feeds, and replacing - * carriage returns and tabs with spaces. While most useful for HTML - * attributes specified as CDATA, it can also be applied to most CSS - * values. - * - * @note This method is not entirely standards compliant, as trim() removes - * more types of whitespace than specified in the spec. In practice, - * this is rarely a problem, as those extra characters usually have - * already been removed by HTMLPurifier_Encoder. - * - * @warning This processing is inconsistent with XML's whitespace handling - * as specified by section 3.3.3 and referenced XHTML 1.0 section - * 4.7. However, note that we are NOT necessarily - * parsing XML, thus, this behavior may still be correct. We - * assume that newlines have been normalized. - */ - public function parseCDATA($string) { - $string = trim($string); - $string = str_replace(array("\n", "\t", "\r"), ' ', $string); - return $string; - } - - /** - * Factory method for creating this class from a string. - * @param $string String construction info - * @return Created AttrDef object corresponding to $string - */ - public function make($string) { - // default implementation, return a flyweight of this object. - // If $string has an effect on the returned object (i.e. you - // need to overload this method), it is best - // to clone or instantiate new copies. (Instantiation is safer.) - return $this; - } - - /** - * Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work - * properly. THIS IS A HACK! - */ - protected function mungeRgb($string) { - return preg_replace('/rgb\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\)/', 'rgb(\1,\2,\3)', $string); - } - - /** - * Parses a possibly escaped CSS string and returns the "pure" - * version of it. - */ - protected function expandCSSEscape($string) { - // flexibly parse it - $ret = ''; - for ($i = 0, $c = strlen($string); $i < $c; $i++) { - if ($string[$i] === '\\') { - $i++; - if ($i >= $c) { - $ret .= '\\'; - break; - } - if (ctype_xdigit($string[$i])) { - $code = $string[$i]; - for ($a = 1, $i++; $i < $c && $a < 6; $i++, $a++) { - if (!ctype_xdigit($string[$i])) break; - $code .= $string[$i]; - } - // We have to be extremely careful when adding - // new characters, to make sure we're not breaking - // the encoding. - $char = HTMLPurifier_Encoder::unichr(hexdec($code)); - if (HTMLPurifier_Encoder::cleanUTF8($char) === '') continue; - $ret .= $char; - if ($i < $c && trim($string[$i]) !== '') $i--; - continue; - } - if ($string[$i] === "\n") continue; - } - $ret .= $string[$i]; - } - return $ret; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS.php deleted file mode 100644 index 275bb81f..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS.php +++ /dev/null @@ -1,87 +0,0 @@ -parseCDATA($css); - - $definition = $config->getCSSDefinition(); - - // we're going to break the spec and explode by semicolons. - // This is because semicolon rarely appears in escaped form - // Doing this is generally flaky but fast - // IT MIGHT APPEAR IN URIs, see HTMLPurifier_AttrDef_CSSURI - // for details - - $declarations = explode(';', $css); - $propvalues = array(); - - /** - * Name of the current CSS property being validated. - */ - $property = false; - $context->register('CurrentCSSProperty', $property); - - foreach ($declarations as $declaration) { - if (!$declaration) continue; - if (!strpos($declaration, ':')) continue; - list($property, $value) = explode(':', $declaration, 2); - $property = trim($property); - $value = trim($value); - $ok = false; - do { - if (isset($definition->info[$property])) { - $ok = true; - break; - } - if (ctype_lower($property)) break; - $property = strtolower($property); - if (isset($definition->info[$property])) { - $ok = true; - break; - } - } while(0); - if (!$ok) continue; - // inefficient call, since the validator will do this again - if (strtolower(trim($value)) !== 'inherit') { - // inherit works for everything (but only on the base property) - $result = $definition->info[$property]->validate( - $value, $config, $context ); - } else { - $result = 'inherit'; - } - if ($result === false) continue; - $propvalues[$property] = $result; - } - - $context->destroy('CurrentCSSProperty'); - - // procedure does not write the new CSS simultaneously, so it's - // slightly inefficient, but it's the only way of getting rid of - // duplicates. Perhaps config to optimize it, but not now. - - $new_declarations = ''; - foreach ($propvalues as $prop => $value) { - $new_declarations .= "$prop:$value;"; - } - - return $new_declarations ? $new_declarations : false; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/AlphaValue.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/AlphaValue.php deleted file mode 100644 index 00a24212..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/AlphaValue.php +++ /dev/null @@ -1,21 +0,0 @@ - 1.0) $result = '1'; - return $result; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Background.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Background.php deleted file mode 100644 index 0c40512a..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Background.php +++ /dev/null @@ -1,87 +0,0 @@ -getCSSDefinition(); - $this->info['background-color'] = $def->info['background-color']; - $this->info['background-image'] = $def->info['background-image']; - $this->info['background-repeat'] = $def->info['background-repeat']; - $this->info['background-attachment'] = $def->info['background-attachment']; - $this->info['background-position'] = $def->info['background-position']; - } - - public function validate($string, $config, $context) { - - // regular pre-processing - $string = $this->parseCDATA($string); - if ($string === '') return false; - - // munge rgb() decl if necessary - $string = $this->mungeRgb($string); - - // assumes URI doesn't have spaces in it - $bits = explode(' ', strtolower($string)); // bits to process - - $caught = array(); - $caught['color'] = false; - $caught['image'] = false; - $caught['repeat'] = false; - $caught['attachment'] = false; - $caught['position'] = false; - - $i = 0; // number of catches - $none = false; - - foreach ($bits as $bit) { - if ($bit === '') continue; - foreach ($caught as $key => $status) { - if ($key != 'position') { - if ($status !== false) continue; - $r = $this->info['background-' . $key]->validate($bit, $config, $context); - } else { - $r = $bit; - } - if ($r === false) continue; - if ($key == 'position') { - if ($caught[$key] === false) $caught[$key] = ''; - $caught[$key] .= $r . ' '; - } else { - $caught[$key] = $r; - } - $i++; - break; - } - } - - if (!$i) return false; - if ($caught['position'] !== false) { - $caught['position'] = $this->info['background-position']-> - validate($caught['position'], $config, $context); - } - - $ret = array(); - foreach ($caught as $value) { - if ($value === false) continue; - $ret[] = $value; - } - - if (empty($ret)) return false; - return implode(' ', $ret); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php deleted file mode 100644 index 665321e3..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php +++ /dev/null @@ -1,133 +0,0 @@ - | | left | center | right - ] - [ - | | top | center | bottom - ]? - ] | - [ // this signifies that the vertical and horizontal adjectives - // can be arbitrarily ordered, however, there can only be two, - // one of each, or none at all - [ - left | center | right - ] || - [ - top | center | bottom - ] - ] - top, left = 0% - center, (none) = 50% - bottom, right = 100% -*/ - -/* QuirksMode says: - keyword + length/percentage must be ordered correctly, as per W3C - - Internet Explorer and Opera, however, support arbitrary ordering. We - should fix it up. - - Minor issue though, not strictly necessary. -*/ - -// control freaks may appreciate the ability to convert these to -// percentages or something, but it's not necessary - -/** - * Validates the value of background-position. - */ -class HTMLPurifier_AttrDef_CSS_BackgroundPosition extends HTMLPurifier_AttrDef -{ - - protected $length; - protected $percentage; - - public function __construct() { - $this->length = new HTMLPurifier_AttrDef_CSS_Length(); - $this->percentage = new HTMLPurifier_AttrDef_CSS_Percentage(); - } - - public function validate($string, $config, $context) { - $string = $this->parseCDATA($string); - $bits = explode(' ', $string); - - $keywords = array(); - $keywords['h'] = false; // left, right - $keywords['v'] = false; // top, bottom - $keywords['ch'] = false; // center (first word) - $keywords['cv'] = false; // center (second word) - $measures = array(); - - $i = 0; - - $lookup = array( - 'top' => 'v', - 'bottom' => 'v', - 'left' => 'h', - 'right' => 'h', - 'center' => 'c' - ); - - foreach ($bits as $bit) { - if ($bit === '') continue; - - // test for keyword - $lbit = ctype_lower($bit) ? $bit : strtolower($bit); - if (isset($lookup[$lbit])) { - $status = $lookup[$lbit]; - if ($status == 'c') { - if ($i == 0) { - $status = 'ch'; - } else { - $status = 'cv'; - } - } - $keywords[$status] = $lbit; - $i++; - } - - // test for length - $r = $this->length->validate($bit, $config, $context); - if ($r !== false) { - $measures[] = $r; - $i++; - } - - // test for percentage - $r = $this->percentage->validate($bit, $config, $context); - if ($r !== false) { - $measures[] = $r; - $i++; - } - - } - - if (!$i) return false; // no valid values were caught - - $ret = array(); - - // first keyword - if ($keywords['h']) $ret[] = $keywords['h']; - elseif ($keywords['ch']) { - $ret[] = $keywords['ch']; - $keywords['cv'] = false; // prevent re-use: center = center center - } - elseif (count($measures)) $ret[] = array_shift($measures); - - if ($keywords['v']) $ret[] = $keywords['v']; - elseif ($keywords['cv']) $ret[] = $keywords['cv']; - elseif (count($measures)) $ret[] = array_shift($measures); - - if (empty($ret)) return false; - return implode(' ', $ret); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Border.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Border.php deleted file mode 100644 index 629e74f6..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Border.php +++ /dev/null @@ -1,43 +0,0 @@ -getCSSDefinition(); - $this->info['border-width'] = $def->info['border-width']; - $this->info['border-style'] = $def->info['border-style']; - $this->info['border-top-color'] = $def->info['border-top-color']; - } - - public function validate($string, $config, $context) { - $string = $this->parseCDATA($string); - $string = $this->mungeRgb($string); - $bits = explode(' ', $string); - $done = array(); // segments we've finished - $ret = ''; // return value - foreach ($bits as $bit) { - foreach ($this->info as $propname => $validator) { - if (isset($done[$propname])) continue; - $r = $validator->validate($bit, $config, $context); - if ($r !== false) { - $ret .= $r . ' '; - $done[$propname] = true; - break; - } - } - } - return rtrim($ret); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Color.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Color.php deleted file mode 100644 index 54ee2490..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Color.php +++ /dev/null @@ -1,78 +0,0 @@ -get('Core.ColorKeywords'); - - $color = trim($color); - if ($color === '') return false; - - $lower = strtolower($color); - if (isset($colors[$lower])) return $colors[$lower]; - - if (strpos($color, 'rgb(') !== false) { - // rgb literal handling - $length = strlen($color); - if (strpos($color, ')') !== $length - 1) return false; - $triad = substr($color, 4, $length - 4 - 1); - $parts = explode(',', $triad); - if (count($parts) !== 3) return false; - $type = false; // to ensure that they're all the same type - $new_parts = array(); - foreach ($parts as $part) { - $part = trim($part); - if ($part === '') return false; - $length = strlen($part); - if ($part[$length - 1] === '%') { - // handle percents - if (!$type) { - $type = 'percentage'; - } elseif ($type !== 'percentage') { - return false; - } - $num = (float) substr($part, 0, $length - 1); - if ($num < 0) $num = 0; - if ($num > 100) $num = 100; - $new_parts[] = "$num%"; - } else { - // handle integers - if (!$type) { - $type = 'integer'; - } elseif ($type !== 'integer') { - return false; - } - $num = (int) $part; - if ($num < 0) $num = 0; - if ($num > 255) $num = 255; - $new_parts[] = (string) $num; - } - } - $new_triad = implode(',', $new_parts); - $color = "rgb($new_triad)"; - } else { - // hexadecimal handling - if ($color[0] === '#') { - $hex = substr($color, 1); - } else { - $hex = $color; - $color = '#' . $color; - } - $length = strlen($hex); - if ($length !== 3 && $length !== 6) return false; - if (!ctype_xdigit($hex)) return false; - } - - return $color; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Composite.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Composite.php deleted file mode 100644 index 14038b8a..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Composite.php +++ /dev/null @@ -1,38 +0,0 @@ -defs = $defs; - } - - public function validate($string, $config, $context) { - foreach ($this->defs as $i => $def) { - $result = $this->defs[$i]->validate($string, $config, $context); - if ($result !== false) return $result; - } - return false; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php deleted file mode 100644 index eb0c5113..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php +++ /dev/null @@ -1,28 +0,0 @@ -def = $def; - $this->element = $element; - } - /** - * Checks if CurrentToken is set and equal to $this->element - */ - public function validate($string, $config, $context) { - $token = $context->get('CurrentToken', true); - if ($token && $token->name == $this->element) return false; - return $this->def->validate($string, $config, $context); - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Filter.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Filter.php deleted file mode 100644 index 8ba8bfdc..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Filter.php +++ /dev/null @@ -1,54 +0,0 @@ -intValidator = new HTMLPurifier_AttrDef_Integer(); - } - - public function validate($value, $config, $context) { - $value = $this->parseCDATA($value); - if ($value === 'none') return $value; - // if we looped this we could support multiple filters - $function_length = strcspn($value, '('); - $function = trim(substr($value, 0, $function_length)); - if ($function !== 'alpha' && - $function !== 'Alpha' && - $function !== 'progid:DXImageTransform.Microsoft.Alpha' - ) return false; - $cursor = $function_length + 1; - $parameters_length = strcspn($value, ')', $cursor); - $parameters = substr($value, $cursor, $parameters_length); - $params = explode(',', $parameters); - $ret_params = array(); - $lookup = array(); - foreach ($params as $param) { - list($key, $value) = explode('=', $param); - $key = trim($key); - $value = trim($value); - if (isset($lookup[$key])) continue; - if ($key !== 'opacity') continue; - $value = $this->intValidator->validate($value, $config, $context); - if ($value === false) continue; - $int = (int) $value; - if ($int > 100) $value = '100'; - if ($int < 0) $value = '0'; - $ret_params[] = "$key=$value"; - $lookup[$key] = true; - } - $ret_parameters = implode(',', $ret_params); - $ret_function = "$function($ret_parameters)"; - return $ret_function; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Font.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Font.php deleted file mode 100644 index f5131e7e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Font.php +++ /dev/null @@ -1,149 +0,0 @@ -getCSSDefinition(); - $this->info['font-style'] = $def->info['font-style']; - $this->info['font-variant'] = $def->info['font-variant']; - $this->info['font-weight'] = $def->info['font-weight']; - $this->info['font-size'] = $def->info['font-size']; - $this->info['line-height'] = $def->info['line-height']; - $this->info['font-family'] = $def->info['font-family']; - } - - public function validate($string, $config, $context) { - - static $system_fonts = array( - 'caption' => true, - 'icon' => true, - 'menu' => true, - 'message-box' => true, - 'small-caption' => true, - 'status-bar' => true - ); - - // regular pre-processing - $string = $this->parseCDATA($string); - if ($string === '') return false; - - // check if it's one of the keywords - $lowercase_string = strtolower($string); - if (isset($system_fonts[$lowercase_string])) { - return $lowercase_string; - } - - $bits = explode(' ', $string); // bits to process - $stage = 0; // this indicates what we're looking for - $caught = array(); // which stage 0 properties have we caught? - $stage_1 = array('font-style', 'font-variant', 'font-weight'); - $final = ''; // output - - for ($i = 0, $size = count($bits); $i < $size; $i++) { - if ($bits[$i] === '') continue; - switch ($stage) { - - // attempting to catch font-style, font-variant or font-weight - case 0: - foreach ($stage_1 as $validator_name) { - if (isset($caught[$validator_name])) continue; - $r = $this->info[$validator_name]->validate( - $bits[$i], $config, $context); - if ($r !== false) { - $final .= $r . ' '; - $caught[$validator_name] = true; - break; - } - } - // all three caught, continue on - if (count($caught) >= 3) $stage = 1; - if ($r !== false) break; - - // attempting to catch font-size and perhaps line-height - case 1: - $found_slash = false; - if (strpos($bits[$i], '/') !== false) { - list($font_size, $line_height) = - explode('/', $bits[$i]); - if ($line_height === '') { - // ooh, there's a space after the slash! - $line_height = false; - $found_slash = true; - } - } else { - $font_size = $bits[$i]; - $line_height = false; - } - $r = $this->info['font-size']->validate( - $font_size, $config, $context); - if ($r !== false) { - $final .= $r; - // attempt to catch line-height - if ($line_height === false) { - // we need to scroll forward - for ($j = $i + 1; $j < $size; $j++) { - if ($bits[$j] === '') continue; - if ($bits[$j] === '/') { - if ($found_slash) { - return false; - } else { - $found_slash = true; - continue; - } - } - $line_height = $bits[$j]; - break; - } - } else { - // slash already found - $found_slash = true; - $j = $i; - } - if ($found_slash) { - $i = $j; - $r = $this->info['line-height']->validate( - $line_height, $config, $context); - if ($r !== false) { - $final .= '/' . $r; - } - } - $final .= ' '; - $stage = 2; - break; - } - return false; - - // attempting to catch font-family - case 2: - $font_family = - implode(' ', array_slice($bits, $i, $size - $i)); - $r = $this->info['font-family']->validate( - $font_family, $config, $context); - if ($r !== false) { - $final .= $r . ' '; - // processing completed successfully - return rtrim($final); - } - return false; - } - } - return false; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/FontFamily.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/FontFamily.php deleted file mode 100644 index f1ceec4a..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/FontFamily.php +++ /dev/null @@ -1,72 +0,0 @@ - true, - 'sans-serif' => true, - 'monospace' => true, - 'fantasy' => true, - 'cursive' => true - ); - - // assume that no font names contain commas in them - $fonts = explode(',', $string); - $final = ''; - foreach($fonts as $font) { - $font = trim($font); - if ($font === '') continue; - // match a generic name - if (isset($generic_names[$font])) { - $final .= $font . ', '; - continue; - } - // match a quoted name - if ($font[0] === '"' || $font[0] === "'") { - $length = strlen($font); - if ($length <= 2) continue; - $quote = $font[0]; - if ($font[$length - 1] !== $quote) continue; - $font = substr($font, 1, $length - 2); - } - - $font = $this->expandCSSEscape($font); - - // $font is a pure representation of the font name - - if (ctype_alnum($font) && $font !== '') { - // very simple font, allow it in unharmed - $final .= $font . ', '; - continue; - } - - // bugger out on whitespace. form feed (0C) really - // shouldn't show up regardless - $font = str_replace(array("\n", "\t", "\r", "\x0C"), ' ', $font); - - // These ugly transforms don't pose a security - // risk (as \\ and \" might). We could try to be clever and - // use single-quote wrapping when there is a double quote - // present, but I have choosen not to implement that. - // (warning: this code relies on the selection of quotation - // mark below) - $font = str_replace('\\', '\\5C ', $font); - $font = str_replace('"', '\\22 ', $font); - - // complicated font, requires quoting - $final .= "\"$font\", "; // note that this will later get turned into " - } - $final = rtrim($final, ', '); - if ($final === '') return false; - return $final; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php deleted file mode 100644 index c47c3003..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php +++ /dev/null @@ -1,40 +0,0 @@ -def = $def; - $this->allow = $allow; - } - /** - * Intercepts and removes !important if necessary - */ - public function validate($string, $config, $context) { - // test for ! and important tokens - $string = trim($string); - $is_important = false; - // :TODO: optimization: test directly for !important and ! important - if (strlen($string) >= 9 && substr($string, -9) === 'important') { - $temp = rtrim(substr($string, 0, -9)); - // use a temp, because we might want to restore important - if (strlen($temp) >= 1 && substr($temp, -1) === '!') { - $string = rtrim(substr($temp, 0, -1)); - $is_important = true; - } - } - $string = $this->def->validate($string, $config, $context); - if ($this->allow && $is_important) $string .= ' !important'; - return $string; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Length.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Length.php deleted file mode 100644 index e055643e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Length.php +++ /dev/null @@ -1,47 +0,0 @@ -min = $min !== null ? HTMLPurifier_Length::make($min) : null; - $this->max = $max !== null ? HTMLPurifier_Length::make($max) : null; - } - - public function validate($string, $config, $context) { - $string = $this->parseCDATA($string); - - // Optimizations - if ($string === '') return false; - if ($string === '0') return '0'; - if (strlen($string) === 1) return false; - - $length = HTMLPurifier_Length::make($string); - if (!$length->isValid()) return false; - - if ($this->min) { - $c = $length->compareTo($this->min); - if ($c === false) return false; - if ($c < 0) return false; - } - if ($this->max) { - $c = $length->compareTo($this->max); - if ($c === false) return false; - if ($c > 0) return false; - } - - return $length->toString(); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/ListStyle.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/ListStyle.php deleted file mode 100644 index 008e96d7..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/ListStyle.php +++ /dev/null @@ -1,78 +0,0 @@ -getCSSDefinition(); - $this->info['list-style-type'] = $def->info['list-style-type']; - $this->info['list-style-position'] = $def->info['list-style-position']; - $this->info['list-style-image'] = $def->info['list-style-image']; - } - - public function validate($string, $config, $context) { - - // regular pre-processing - $string = $this->parseCDATA($string); - if ($string === '') return false; - - // assumes URI doesn't have spaces in it - $bits = explode(' ', strtolower($string)); // bits to process - - $caught = array(); - $caught['type'] = false; - $caught['position'] = false; - $caught['image'] = false; - - $i = 0; // number of catches - $none = false; - - foreach ($bits as $bit) { - if ($i >= 3) return; // optimization bit - if ($bit === '') continue; - foreach ($caught as $key => $status) { - if ($status !== false) continue; - $r = $this->info['list-style-' . $key]->validate($bit, $config, $context); - if ($r === false) continue; - if ($r === 'none') { - if ($none) continue; - else $none = true; - if ($key == 'image') continue; - } - $caught[$key] = $r; - $i++; - break; - } - } - - if (!$i) return false; - - $ret = array(); - - // construct type - if ($caught['type']) $ret[] = $caught['type']; - - // construct image - if ($caught['image']) $ret[] = $caught['image']; - - // construct position - if ($caught['position']) $ret[] = $caught['position']; - - if (empty($ret)) return false; - return implode(' ', $ret); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Multiple.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Multiple.php deleted file mode 100644 index 825197d2..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Multiple.php +++ /dev/null @@ -1,58 +0,0 @@ -single = $single; - $this->max = $max; - } - - public function validate($string, $config, $context) { - $string = $this->parseCDATA($string); - if ($string === '') return false; - $parts = explode(' ', $string); // parseCDATA replaced \r, \t and \n - $length = count($parts); - $final = ''; - for ($i = 0, $num = 0; $i < $length && $num < $this->max; $i++) { - if (ctype_space($parts[$i])) continue; - $result = $this->single->validate($parts[$i], $config, $context); - if ($result !== false) { - $final .= $result . ' '; - $num++; - } - } - if ($final === '') return false; - return rtrim($final); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Number.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Number.php deleted file mode 100644 index 6a7a2605..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Number.php +++ /dev/null @@ -1,69 +0,0 @@ -non_negative = $non_negative; - } - - /** - * @warning Some contexts do not pass $config, $context. These - * variables should not be used without checking HTMLPurifier_Length - */ - public function validate($number, $config, $context) { - - $number = $this->parseCDATA($number); - - if ($number === '') return false; - if ($number === '0') return '0'; - - $sign = ''; - switch ($number[0]) { - case '-': - if ($this->non_negative) return false; - $sign = '-'; - case '+': - $number = substr($number, 1); - } - - if (ctype_digit($number)) { - $number = ltrim($number, '0'); - return $number ? $sign . $number : '0'; - } - - // Period is the only non-numeric character allowed - if (strpos($number, '.') === false) return false; - - list($left, $right) = explode('.', $number, 2); - - if ($left === '' && $right === '') return false; - if ($left !== '' && !ctype_digit($left)) return false; - - $left = ltrim($left, '0'); - $right = rtrim($right, '0'); - - if ($right === '') { - return $left ? $sign . $left : '0'; - } elseif (!ctype_digit($right)) { - return false; - } - - return $sign . $left . '.' . $right; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Percentage.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Percentage.php deleted file mode 100644 index 1dcca1a8..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/Percentage.php +++ /dev/null @@ -1,40 +0,0 @@ -number_def = new HTMLPurifier_AttrDef_CSS_Number($non_negative); - } - - public function validate($string, $config, $context) { - - $string = $this->parseCDATA($string); - - if ($string === '') return false; - $length = strlen($string); - if ($length === 1) return false; - if ($string[$length - 1] !== '%') return false; - - $number = substr($string, 0, $length - 1); - $number = $this->number_def->validate($number, $config, $context); - - if ($number === false) return false; - return "$number%"; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/TextDecoration.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/TextDecoration.php deleted file mode 100644 index 912811f9..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/TextDecoration.php +++ /dev/null @@ -1,38 +0,0 @@ - true, - 'overline' => true, - 'underline' => true, - ); - - $string = strtolower($this->parseCDATA($string)); - - if ($string === 'none') return $string; - - $parts = explode(' ', $string); - $final = ''; - foreach ($parts as $part) { - if (isset($allowed_values[$part])) { - $final .= $part . ' '; - } - } - $final = rtrim($final); - if ($final === '') return false; - return $final; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/URI.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/URI.php deleted file mode 100644 index 98df033d..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/CSS/URI.php +++ /dev/null @@ -1,52 +0,0 @@ -parseCDATA($uri_string); - if (strpos($uri_string, 'url(') !== 0) return false; - $uri_string = substr($uri_string, 4); - $new_length = strlen($uri_string) - 1; - if ($uri_string[$new_length] != ')') return false; - $uri = trim(substr($uri_string, 0, $new_length)); - - if (!empty($uri) && ($uri[0] == "'" || $uri[0] == '"')) { - $quote = $uri[0]; - $new_length = strlen($uri) - 1; - if ($uri[$new_length] !== $quote) return false; - $uri = substr($uri, 1, $new_length - 1); - } - - $uri = $this->expandCSSEscape($uri); - - $result = parent::validate($uri, $config, $context); - - if ($result === false) return false; - - // extra sanity check; should have been done by URI - $result = str_replace(array('"', "\\", "\n", "\x0c", "\r"), "", $result); - - return "url(\"$result\")"; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Enum.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Enum.php deleted file mode 100644 index 59745e6d..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Enum.php +++ /dev/null @@ -1,65 +0,0 @@ -valid_values = array_flip($valid_values); - $this->case_sensitive = $case_sensitive; - } - - public function validate($string, $config, $context) { - $string = trim($string); - if (!$this->case_sensitive) { - // we may want to do full case-insensitive libraries - $string = ctype_lower($string) ? $string : strtolower($string); - } - $result = isset($this->valid_values[$string]); - - return $result ? $string : false; - } - - /** - * @param $string In form of comma-delimited list of case-insensitive - * valid values. Example: "foo,bar,baz". Prepend "s:" to make - * case sensitive - */ - public function make($string) { - if (strlen($string) > 2 && $string[0] == 's' && $string[1] == ':') { - $string = substr($string, 2); - $sensitive = true; - } else { - $sensitive = false; - } - $values = explode(',', $string); - return new HTMLPurifier_AttrDef_Enum($values, $sensitive); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Bool.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Bool.php deleted file mode 100644 index ccd8dca5..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Bool.php +++ /dev/null @@ -1,28 +0,0 @@ -name = $name;} - - public function validate($string, $config, $context) { - if (empty($string)) return false; - return $this->name; - } - - /** - * @param $string Name of attribute - */ - public function make($string) { - return new HTMLPurifier_AttrDef_HTML_Bool($string); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Class.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Class.php deleted file mode 100644 index 219b59fe..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Class.php +++ /dev/null @@ -1,34 +0,0 @@ -getDefinition('HTML')->doctype->name; - if ($name == "XHTML 1.1" || $name == "XHTML 2.0") { - return parent::split($string, $config, $context); - } else { - return preg_split('/\s+/', $string); - } - } - protected function filter($tokens, $config, $context) { - $allowed = $config->get('Attr.AllowedClasses'); - $forbidden = $config->get('Attr.ForbiddenClasses'); - $ret = array(); - foreach ($tokens as $token) { - if ( - ($allowed === null || isset($allowed[$token])) && - !isset($forbidden[$token]) && - // We need this O(n) check because of PHP's array - // implementation that casts -0 to 0. - !in_array($token, $ret, true) - ) { - $ret[] = $token; - } - } - return $ret; - } -} diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Color.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Color.php deleted file mode 100644 index 7fdf0a15..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Color.php +++ /dev/null @@ -1,32 +0,0 @@ -get('Core.ColorKeywords'); - - $string = trim($string); - - if (empty($string)) return false; - if (isset($colors[$string])) return $colors[$string]; - if ($string[0] === '#') $hex = substr($string, 1); - else $hex = $string; - - $length = strlen($hex); - if ($length !== 3 && $length !== 6) return false; - if (!ctype_xdigit($hex)) return false; - if ($length === 3) $hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2]; - - return "#$hex"; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/FrameTarget.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/FrameTarget.php deleted file mode 100644 index 306a210c..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/FrameTarget.php +++ /dev/null @@ -1,21 +0,0 @@ -valid_values === false) $this->valid_values = $config->get('Attr.AllowedFrameTargets'); - return parent::validate($string, $config, $context); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/ID.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/ID.php deleted file mode 100644 index 609b5eeb..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/ID.php +++ /dev/null @@ -1,70 +0,0 @@ -get('Attr.EnableID')) return false; - - $id = trim($id); // trim it first - - if ($id === '') return false; - - $prefix = $config->get('Attr.IDPrefix'); - if ($prefix !== '') { - $prefix .= $config->get('Attr.IDPrefixLocal'); - // prevent re-appending the prefix - if (strpos($id, $prefix) !== 0) $id = $prefix . $id; - } elseif ($config->get('Attr.IDPrefixLocal') !== '') { - trigger_error('%Attr.IDPrefixLocal cannot be used unless '. - '%Attr.IDPrefix is set', E_USER_WARNING); - } - - //if (!$this->ref) { - $id_accumulator =& $context->get('IDAccumulator'); - if (isset($id_accumulator->ids[$id])) return false; - //} - - // we purposely avoid using regex, hopefully this is faster - - if (ctype_alpha($id)) { - $result = true; - } else { - if (!ctype_alpha(@$id[0])) return false; - $trim = trim( // primitive style of regexps, I suppose - $id, - 'A..Za..z0..9:-._' - ); - $result = ($trim === ''); - } - - $regexp = $config->get('Attr.IDBlacklistRegexp'); - if ($regexp && preg_match($regexp, $id)) { - return false; - } - - if (/*!$this->ref && */$result) $id_accumulator->add($id); - - // if no change was made to the ID, return the result - // else, return the new id if stripping whitespace made it - // valid, or return false. - return $result ? $id : false; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Length.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Length.php deleted file mode 100644 index 7eec741a..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Length.php +++ /dev/null @@ -1,41 +0,0 @@ - 100) return '100%'; - - return ((string) $points) . '%'; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/LinkTypes.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/LinkTypes.php deleted file mode 100644 index 8b89ceb1..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/LinkTypes.php +++ /dev/null @@ -1,53 +0,0 @@ - 'AllowedRel', - 'rev' => 'AllowedRev' - ); - if (!isset($configLookup[$name])) { - trigger_error('Unrecognized attribute name for link '. - 'relationship.', E_USER_ERROR); - return; - } - $this->name = $configLookup[$name]; - } - - public function validate($string, $config, $context) { - - $allowed = $config->get('Attr.' . $this->name); - if (empty($allowed)) return false; - - $string = $this->parseCDATA($string); - $parts = explode(' ', $string); - - // lookup to prevent duplicates - $ret_lookup = array(); - foreach ($parts as $part) { - $part = strtolower(trim($part)); - if (!isset($allowed[$part])) continue; - $ret_lookup[$part] = true; - } - - if (empty($ret_lookup)) return false; - $string = implode(' ', array_keys($ret_lookup)); - - return $string; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/MultiLength.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/MultiLength.php deleted file mode 100644 index 78ee7839..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/MultiLength.php +++ /dev/null @@ -1,41 +0,0 @@ -split($string, $config, $context); - $tokens = $this->filter($tokens, $config, $context); - if (empty($tokens)) return false; - return implode(' ', $tokens); - - } - - /** - * Splits a space separated list of tokens into its constituent parts. - */ - protected function split($string, $config, $context) { - // OPTIMIZABLE! - // do the preg_match, capture all subpatterns for reformulation - - // we don't support U+00A1 and up codepoints or - // escaping because I don't know how to do that with regexps - // and plus it would complicate optimization efforts (you never - // see that anyway). - $pattern = '/(?:(?<=\s)|\A)'. // look behind for space or string start - '((?:--|-?[A-Za-z_])[A-Za-z_\-0-9]*)'. - '(?:(?=\s)|\z)/'; // look ahead for space or string end - preg_match_all($pattern, $string, $matches); - return $matches[1]; - } - - /** - * Template method for removing certain tokens based on arbitrary criteria. - * @note If we wanted to be really functional, we'd do an array_filter - * with a callback. But... we're not. - */ - protected function filter($tokens, $config, $context) { - return $tokens; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Pixels.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Pixels.php deleted file mode 100644 index 93f08341..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/HTML/Pixels.php +++ /dev/null @@ -1,48 +0,0 @@ -max = $max; - } - - public function validate($string, $config, $context) { - - $string = trim($string); - if ($string === '0') return $string; - if ($string === '') return false; - $length = strlen($string); - if (substr($string, $length - 2) == 'px') { - $string = substr($string, 0, $length - 2); - } - if (!is_numeric($string)) return false; - $int = (int) $string; - - if ($int < 0) return '0'; - - // upper-bound value, extremely high values can - // crash operating systems, see - // WARNING, above link WILL crash you if you're using Windows - - if ($this->max !== null && $int > $this->max) return (string) $this->max; - - return (string) $int; - - } - - public function make($string) { - if ($string === '') $max = null; - else $max = (int) $string; - $class = get_class($this); - return new $class($max); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Integer.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Integer.php deleted file mode 100644 index 12671cdc..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Integer.php +++ /dev/null @@ -1,73 +0,0 @@ -negative = $negative; - $this->zero = $zero; - $this->positive = $positive; - } - - public function validate($integer, $config, $context) { - - $integer = $this->parseCDATA($integer); - if ($integer === '') return false; - - // we could possibly simply typecast it to integer, but there are - // certain fringe cases that must not return an integer. - - // clip leading sign - if ( $this->negative && $integer[0] === '-' ) { - $digits = substr($integer, 1); - if ($digits === '0') $integer = '0'; // rm minus sign for zero - } elseif( $this->positive && $integer[0] === '+' ) { - $digits = $integer = substr($integer, 1); // rm unnecessary plus - } else { - $digits = $integer; - } - - // test if it's numeric - if (!ctype_digit($digits)) return false; - - // perform scope tests - if (!$this->zero && $integer == 0) return false; - if (!$this->positive && $integer > 0) return false; - if (!$this->negative && $integer < 0) return false; - - return $integer; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Lang.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Lang.php deleted file mode 100644 index 9257476f..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Lang.php +++ /dev/null @@ -1,73 +0,0 @@ - 8 || !ctype_alnum($subtags[1])) { - return $new_string; - } - if (!ctype_lower($subtags[1])) $subtags[1] = strtolower($subtags[1]); - - $new_string .= '-' . $subtags[1]; - if ($num_subtags == 2) return $new_string; - - // process all other subtags, index 2 and up - for ($i = 2; $i < $num_subtags; $i++) { - $length = strlen($subtags[$i]); - if ($length == 0 || $length > 8 || !ctype_alnum($subtags[$i])) { - return $new_string; - } - if (!ctype_lower($subtags[$i])) { - $subtags[$i] = strtolower($subtags[$i]); - } - $new_string .= '-' . $subtags[$i]; - } - - return $new_string; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Switch.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Switch.php deleted file mode 100644 index f990931f..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Switch.php +++ /dev/null @@ -1,34 +0,0 @@ -tag = $tag; - $this->withTag = $with_tag; - $this->withoutTag = $without_tag; - } - - public function validate($string, $config, $context) { - $token = $context->get('CurrentToken', true); - if (!$token || $token->name !== $this->tag) { - return $this->withoutTag->validate($string, $config, $context); - } else { - return $this->withTag->validate($string, $config, $context); - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Text.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Text.php deleted file mode 100644 index fc21e656..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/Text.php +++ /dev/null @@ -1,15 +0,0 @@ -parseCDATA($string); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI.php deleted file mode 100644 index 8b9b61c8..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI.php +++ /dev/null @@ -1,77 +0,0 @@ -parser = new HTMLPurifier_URIParser(); - $this->embedsResource = (bool) $embeds_resource; - } - - public function make($string) { - $embeds = (bool) $string; - return new HTMLPurifier_AttrDef_URI($embeds); - } - - public function validate($uri, $config, $context) { - - if ($config->get('URI.Disable')) return false; - - $uri = $this->parseCDATA($uri); - - // parse the URI - $uri = $this->parser->parse($uri); - if ($uri === false) return false; - - // add embedded flag to context for validators - $context->register('EmbeddedURI', $this->embedsResource); - - $ok = false; - do { - - // generic validation - $result = $uri->validate($config, $context); - if (!$result) break; - - // chained filtering - $uri_def = $config->getDefinition('URI'); - $result = $uri_def->filter($uri, $config, $context); - if (!$result) break; - - // scheme-specific validation - $scheme_obj = $uri->getSchemeObj($config, $context); - if (!$scheme_obj) break; - if ($this->embedsResource && !$scheme_obj->browsable) break; - $result = $scheme_obj->validate($uri, $config, $context); - if (!$result) break; - - // Post chained filtering - $result = $uri_def->postFilter($uri, $config, $context); - if (!$result) break; - - // survived gauntlet - $ok = true; - - } while (false); - - $context->destroy('EmbeddedURI'); - if (!$ok) return false; - - // back to string - return $uri->toString(); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI/Email.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI/Email.php deleted file mode 100644 index da4324fa..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI/Email.php +++ /dev/null @@ -1,17 +0,0 @@ -" - // that needs more percent encoding to be done - if ($string == '') return false; - $string = trim($string); - $result = preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i', $string); - return $result ? $string : false; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI/Host.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI/Host.php deleted file mode 100644 index 69373559..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI/Host.php +++ /dev/null @@ -1,62 +0,0 @@ -ipv4 = new HTMLPurifier_AttrDef_URI_IPv4(); - $this->ipv6 = new HTMLPurifier_AttrDef_URI_IPv6(); - } - - public function validate($string, $config, $context) { - $length = strlen($string); - if ($string === '') return ''; - if ($length > 1 && $string[0] === '[' && $string[$length-1] === ']') { - //IPv6 - $ip = substr($string, 1, $length - 2); - $valid = $this->ipv6->validate($ip, $config, $context); - if ($valid === false) return false; - return '['. $valid . ']'; - } - - // need to do checks on unusual encodings too - $ipv4 = $this->ipv4->validate($string, $config, $context); - if ($ipv4 !== false) return $ipv4; - - // A regular domain name. - - // This breaks I18N domain names, but we don't have proper IRI support, - // so force users to insert Punycode. If there's complaining we'll - // try to fix things into an international friendly form. - - // The productions describing this are: - $a = '[a-z]'; // alpha - $an = '[a-z0-9]'; // alphanum - $and = '[a-z0-9-]'; // alphanum | "-" - // domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum - $domainlabel = "$an($and*$an)?"; - // toplabel = alpha | alpha *( alphanum | "-" ) alphanum - $toplabel = "$a($and*$an)?"; - // hostname = *( domainlabel "." ) toplabel [ "." ] - $match = preg_match("/^($domainlabel\.)*$toplabel\.?$/i", $string); - if (!$match) return false; - - return $string; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI/IPv4.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI/IPv4.php deleted file mode 100644 index 996e5be6..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI/IPv4.php +++ /dev/null @@ -1,39 +0,0 @@ -ip4) $this->_loadRegex(); - - if (preg_match('#^' . $this->ip4 . '$#s', $aIP)) - { - return $aIP; - } - - return false; - - } - - /** - * Lazy load function to prevent regex from being stuffed in - * cache. - */ - protected function _loadRegex() { - $oct = '(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])'; // 0-255 - $this->ip4 = "(?:{$oct}\\.{$oct}\\.{$oct}\\.{$oct})"; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI/IPv6.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI/IPv6.php deleted file mode 100644 index a4cf60f6..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrDef/URI/IPv6.php +++ /dev/null @@ -1,99 +0,0 @@ -ip4) $this->_loadRegex(); - - $original = $aIP; - - $hex = '[0-9a-fA-F]'; - $blk = '(?:' . $hex . '{1,4})'; - $pre = '(?:/(?:12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))'; // /0 - /128 - - // prefix check - if (strpos($aIP, '/') !== false) - { - if (preg_match('#' . $pre . '$#s', $aIP, $find)) - { - $aIP = substr($aIP, 0, 0-strlen($find[0])); - unset($find); - } - else - { - return false; - } - } - - // IPv4-compatiblity check - if (preg_match('#(?<=:'.')' . $this->ip4 . '$#s', $aIP, $find)) - { - $aIP = substr($aIP, 0, 0-strlen($find[0])); - $ip = explode('.', $find[0]); - $ip = array_map('dechex', $ip); - $aIP .= $ip[0] . $ip[1] . ':' . $ip[2] . $ip[3]; - unset($find, $ip); - } - - // compression check - $aIP = explode('::', $aIP); - $c = count($aIP); - if ($c > 2) - { - return false; - } - elseif ($c == 2) - { - list($first, $second) = $aIP; - $first = explode(':', $first); - $second = explode(':', $second); - - if (count($first) + count($second) > 8) - { - return false; - } - - while(count($first) < 8) - { - array_push($first, '0'); - } - - array_splice($first, 8 - count($second), 8, $second); - $aIP = $first; - unset($first,$second); - } - else - { - $aIP = explode(':', $aIP[0]); - } - $c = count($aIP); - - if ($c != 8) - { - return false; - } - - // All the pieces should be 16-bit hex strings. Are they? - foreach ($aIP as $piece) - { - if (!preg_match('#^[0-9a-fA-F]{4}$#s', sprintf('%04s', $piece))) - { - return false; - } - } - - return $original; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform.php deleted file mode 100644 index d8c24663..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform.php +++ /dev/null @@ -1,56 +0,0 @@ -confiscateAttr($attr, 'background'); - // some validation should happen here - - $this->prependCSS($attr, "background-image:url($background);"); - - return $attr; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/BdoDir.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/BdoDir.php deleted file mode 100644 index ade24fdc..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/BdoDir.php +++ /dev/null @@ -1,19 +0,0 @@ -get('Attr.DefaultTextDir'); - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/BgColor.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/BgColor.php deleted file mode 100644 index 9d759fb4..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/BgColor.php +++ /dev/null @@ -1,23 +0,0 @@ -confiscateAttr($attr, 'bgcolor'); - // some validation should happen here - - $this->prependCSS($attr, "background-color:$bgcolor;"); - - return $attr; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/BoolToCSS.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/BoolToCSS.php deleted file mode 100644 index d8ee2ece..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/BoolToCSS.php +++ /dev/null @@ -1,36 +0,0 @@ -attr = $attr; - $this->css = $css; - } - - public function transform($attr, $config, $context) { - if (!isset($attr[$this->attr])) return $attr; - unset($attr[$this->attr]); - $this->prependCSS($attr, $this->css); - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Border.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Border.php deleted file mode 100644 index 7909249e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Border.php +++ /dev/null @@ -1,18 +0,0 @@ -confiscateAttr($attr, 'border'); - // some validation should happen here - $this->prependCSS($attr, "border:{$border_width}px solid;"); - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/EnumToCSS.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/EnumToCSS.php deleted file mode 100644 index 12c77264..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/EnumToCSS.php +++ /dev/null @@ -1,58 +0,0 @@ -attr = $attr; - $this->enumToCSS = $enum_to_css; - $this->caseSensitive = (bool) $case_sensitive; - } - - public function transform($attr, $config, $context) { - - if (!isset($attr[$this->attr])) return $attr; - - $value = trim($attr[$this->attr]); - unset($attr[$this->attr]); - - if (!$this->caseSensitive) $value = strtolower($value); - - if (!isset($this->enumToCSS[$value])) { - return $attr; - } - - $this->prependCSS($attr, $this->enumToCSS[$value]); - - return $attr; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/ImgRequired.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/ImgRequired.php deleted file mode 100644 index 3d09eca3..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/ImgRequired.php +++ /dev/null @@ -1,43 +0,0 @@ -get('Core.RemoveInvalidImg')) return $attr; - $attr['src'] = $config->get('Attr.DefaultInvalidImage'); - $src = false; - } - - if (!isset($attr['alt'])) { - if ($src) { - $alt = $config->get('Attr.DefaultImageAlt'); - if ($alt === null) { - // truncate if the alt is too long - $attr['alt'] = substr(basename($attr['src']),0,40); - } else { - $attr['alt'] = $alt; - } - } else { - $attr['alt'] = $config->get('Attr.DefaultInvalidImageAlt'); - } - } - - return $attr; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/ImgSpace.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/ImgSpace.php deleted file mode 100644 index 571dccf2..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/ImgSpace.php +++ /dev/null @@ -1,44 +0,0 @@ - array('left', 'right'), - 'vspace' => array('top', 'bottom') - ); - - public function __construct($attr) { - $this->attr = $attr; - if (!isset($this->css[$attr])) { - trigger_error(htmlspecialchars($attr) . ' is not valid space attribute'); - } - } - - public function transform($attr, $config, $context) { - - if (!isset($attr[$this->attr])) return $attr; - - $width = $this->confiscateAttr($attr, $this->attr); - // some validation could happen here - - if (!isset($this->css[$this->attr])) return $attr; - - $style = ''; - foreach ($this->css[$this->attr] as $suffix) { - $property = "margin-$suffix"; - $style .= "$property:{$width}px;"; - } - - $this->prependCSS($attr, $style); - - return $attr; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Input.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Input.php deleted file mode 100644 index de105bca..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Input.php +++ /dev/null @@ -1,40 +0,0 @@ -pixels = new HTMLPurifier_AttrDef_HTML_Pixels(); - } - - public function transform($attr, $config, $context) { - if (!isset($attr['type'])) $t = 'text'; - else $t = strtolower($attr['type']); - if (isset($attr['checked']) && $t !== 'radio' && $t !== 'checkbox') { - unset($attr['checked']); - } - if (isset($attr['maxlength']) && $t !== 'text' && $t !== 'password') { - unset($attr['maxlength']); - } - if (isset($attr['size']) && $t !== 'text' && $t !== 'password') { - $result = $this->pixels->validate($attr['size'], $config, $context); - if ($result === false) unset($attr['size']); - else $attr['size'] = $result; - } - if (isset($attr['src']) && $t !== 'image') { - unset($attr['src']); - } - if (!isset($attr['value']) && ($t === 'radio' || $t === 'checkbox')) { - $attr['value'] = ''; - } - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Lang.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Lang.php deleted file mode 100644 index 54c9330d..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Lang.php +++ /dev/null @@ -1,28 +0,0 @@ -name = $name; - $this->cssName = $css_name ? $css_name : $name; - } - - public function transform($attr, $config, $context) { - if (!isset($attr[$this->name])) return $attr; - $length = $this->confiscateAttr($attr, $this->name); - if(ctype_digit($length)) $length .= 'px'; - $this->prependCSS($attr, $this->cssName . ":$length;"); - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Name.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Name.php deleted file mode 100644 index e0bf924f..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Name.php +++ /dev/null @@ -1,21 +0,0 @@ -get('HTML.Attr.Name.UseCDATA')) return $attr; - if (!isset($attr['name'])) return $attr; - $id = $this->confiscateAttr($attr, 'name'); - if ( isset($attr['id'])) return $attr; - $attr['id'] = $id; - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/NameSync.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/NameSync.php deleted file mode 100644 index 5e60392f..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/NameSync.php +++ /dev/null @@ -1,27 +0,0 @@ -idDef = new HTMLPurifier_AttrDef_HTML_ID(); - } - - public function transform($attr, $config, $context) { - if (!isset($attr['name'])) return $attr; - $name = $attr['name']; - if (isset($attr['id']) && $attr['id'] === $name) return $attr; - $result = $this->idDef->validate($name, $config, $context); - if ($result === false) unset($attr['name']); - else $attr['name'] = $result; - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/SafeEmbed.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/SafeEmbed.php deleted file mode 100644 index 25d97f20..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/SafeEmbed.php +++ /dev/null @@ -1,15 +0,0 @@ -uri = new HTMLPurifier_AttrDef_URI(true); // embedded - } - - public function transform($attr, $config, $context) { - // If we add support for other objects, we'll need to alter the - // transforms. - switch ($attr['name']) { - // application/x-shockwave-flash - // Keep this synchronized with Injector/SafeObject.php - case 'allowScriptAccess': - $attr['value'] = 'never'; - break; - case 'allowNetworking': - $attr['value'] = 'internal'; - break; - case 'allowFullScreen': - if ($config->get('HTML.FlashAllowFullScreen')) { - $attr['value'] = ($attr['value'] == 'true') ? 'true' : 'false'; - } else { - $attr['value'] = 'false'; - } - break; - case 'wmode': - $attr['value'] = 'window'; - break; - case 'movie': - case 'src': - $attr['name'] = "movie"; - $attr['value'] = $this->uri->validate($attr['value'], $config, $context); - break; - case 'flashvars': - // we're going to allow arbitrary inputs to the SWF, on - // the reasoning that it could only hack the SWF, not us. - break; - // add other cases to support other param name/value pairs - default: - $attr['name'] = $attr['value'] = null; - } - return $attr; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/ScriptRequired.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/ScriptRequired.php deleted file mode 100644 index 9a659780..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/ScriptRequired.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ -class HTMLPurifier_AttrTransform_ScriptRequired extends HTMLPurifier_AttrTransform -{ - public function transform($attr, $config, $context) { - if (!isset($attr['type'])) { - $attr['type'] = 'text/javascript'; - } - return $attr; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Textarea.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Textarea.php deleted file mode 100644 index e1b632fb..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTransform/Textarea.php +++ /dev/null @@ -1,18 +0,0 @@ - - */ -class HTMLPurifier_AttrTransform_Textarea extends HTMLPurifier_AttrTransform -{ - - public function transform($attr, $config, $context) { - // Calculated from Firefox - if (!isset($attr['cols'])) $attr['cols'] = '22'; - if (!isset($attr['rows'])) $attr['rows'] = '3'; - return $attr; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTypes.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTypes.php deleted file mode 100644 index 347d18a2..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrTypes.php +++ /dev/null @@ -1,77 +0,0 @@ -info['Enum'] = new HTMLPurifier_AttrDef_Enum(); - $this->info['Bool'] = new HTMLPurifier_AttrDef_HTML_Bool(); - - $this->info['CDATA'] = new HTMLPurifier_AttrDef_Text(); - $this->info['ID'] = new HTMLPurifier_AttrDef_HTML_ID(); - $this->info['Length'] = new HTMLPurifier_AttrDef_HTML_Length(); - $this->info['MultiLength'] = new HTMLPurifier_AttrDef_HTML_MultiLength(); - $this->info['NMTOKENS'] = new HTMLPurifier_AttrDef_HTML_Nmtokens(); - $this->info['Pixels'] = new HTMLPurifier_AttrDef_HTML_Pixels(); - $this->info['Text'] = new HTMLPurifier_AttrDef_Text(); - $this->info['URI'] = new HTMLPurifier_AttrDef_URI(); - $this->info['LanguageCode'] = new HTMLPurifier_AttrDef_Lang(); - $this->info['Color'] = new HTMLPurifier_AttrDef_HTML_Color(); - - // unimplemented aliases - $this->info['ContentType'] = new HTMLPurifier_AttrDef_Text(); - $this->info['ContentTypes'] = new HTMLPurifier_AttrDef_Text(); - $this->info['Charsets'] = new HTMLPurifier_AttrDef_Text(); - $this->info['Character'] = new HTMLPurifier_AttrDef_Text(); - - // "proprietary" types - $this->info['Class'] = new HTMLPurifier_AttrDef_HTML_Class(); - - // number is really a positive integer (one or more digits) - // FIXME: ^^ not always, see start and value of list items - $this->info['Number'] = new HTMLPurifier_AttrDef_Integer(false, false, true); - } - - /** - * Retrieves a type - * @param $type String type name - * @return Object AttrDef for type - */ - public function get($type) { - - // determine if there is any extra info tacked on - if (strpos($type, '#') !== false) list($type, $string) = explode('#', $type, 2); - else $string = ''; - - if (!isset($this->info[$type])) { - trigger_error('Cannot retrieve undefined attribute type ' . $type, E_USER_ERROR); - return; - } - - return $this->info[$type]->make($string); - - } - - /** - * Sets a new implementation for a type - * @param $type String type name - * @param $impl Object AttrDef for type - */ - public function set($type, $impl) { - $this->info[$type] = $impl; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrValidator.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrValidator.php deleted file mode 100644 index d5a01770..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/AttrValidator.php +++ /dev/null @@ -1,162 +0,0 @@ -getHTMLDefinition(); - $e =& $context->get('ErrorCollector', true); - - // initialize IDAccumulator if necessary - $ok =& $context->get('IDAccumulator', true); - if (!$ok) { - $id_accumulator = HTMLPurifier_IDAccumulator::build($config, $context); - $context->register('IDAccumulator', $id_accumulator); - } - - // initialize CurrentToken if necessary - $current_token =& $context->get('CurrentToken', true); - if (!$current_token) $context->register('CurrentToken', $token); - - if ( - !$token instanceof HTMLPurifier_Token_Start && - !$token instanceof HTMLPurifier_Token_Empty - ) return $token; - - // create alias to global definition array, see also $defs - // DEFINITION CALL - $d_defs = $definition->info_global_attr; - - // don't update token until the very end, to ensure an atomic update - $attr = $token->attr; - - // do global transformations (pre) - // nothing currently utilizes this - foreach ($definition->info_attr_transform_pre as $transform) { - $attr = $transform->transform($o = $attr, $config, $context); - if ($e) { - if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); - } - } - - // do local transformations only applicable to this element (pre) - // ex.

      to

      - foreach ($definition->info[$token->name]->attr_transform_pre as $transform) { - $attr = $transform->transform($o = $attr, $config, $context); - if ($e) { - if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); - } - } - - // create alias to this element's attribute definition array, see - // also $d_defs (global attribute definition array) - // DEFINITION CALL - $defs = $definition->info[$token->name]->attr; - - $attr_key = false; - $context->register('CurrentAttr', $attr_key); - - // iterate through all the attribute keypairs - // Watch out for name collisions: $key has previously been used - foreach ($attr as $attr_key => $value) { - - // call the definition - if ( isset($defs[$attr_key]) ) { - // there is a local definition defined - if ($defs[$attr_key] === false) { - // We've explicitly been told not to allow this element. - // This is usually when there's a global definition - // that must be overridden. - // Theoretically speaking, we could have a - // AttrDef_DenyAll, but this is faster! - $result = false; - } else { - // validate according to the element's definition - $result = $defs[$attr_key]->validate( - $value, $config, $context - ); - } - } elseif ( isset($d_defs[$attr_key]) ) { - // there is a global definition defined, validate according - // to the global definition - $result = $d_defs[$attr_key]->validate( - $value, $config, $context - ); - } else { - // system never heard of the attribute? DELETE! - $result = false; - } - - // put the results into effect - if ($result === false || $result === null) { - // this is a generic error message that should replaced - // with more specific ones when possible - if ($e) $e->send(E_ERROR, 'AttrValidator: Attribute removed'); - - // remove the attribute - unset($attr[$attr_key]); - } elseif (is_string($result)) { - // generally, if a substitution is happening, there - // was some sort of implicit correction going on. We'll - // delegate it to the attribute classes to say exactly what. - - // simple substitution - $attr[$attr_key] = $result; - } else { - // nothing happens - } - - // we'd also want slightly more complicated substitution - // involving an array as the return value, - // although we're not sure how colliding attributes would - // resolve (certain ones would be completely overriden, - // others would prepend themselves). - } - - $context->destroy('CurrentAttr'); - - // post transforms - - // global (error reporting untested) - foreach ($definition->info_attr_transform_post as $transform) { - $attr = $transform->transform($o = $attr, $config, $context); - if ($e) { - if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); - } - } - - // local (error reporting untested) - foreach ($definition->info[$token->name]->attr_transform_post as $transform) { - $attr = $transform->transform($o = $attr, $config, $context); - if ($e) { - if ($attr != $o) $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); - } - } - - $token->attr = $attr; - - // destroy CurrentToken if we made it ourselves - if (!$current_token) $context->destroy('CurrentToken'); - - } - - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Bootstrap.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Bootstrap.php deleted file mode 100644 index 5963fd94..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Bootstrap.php +++ /dev/null @@ -1,98 +0,0 @@ - -if (!defined('PHP_EOL')) { - switch (strtoupper(substr(PHP_OS, 0, 3))) { - case 'WIN': - define('PHP_EOL', "\r\n"); - break; - case 'DAR': - define('PHP_EOL', "\r"); - break; - default: - define('PHP_EOL', "\n"); - } -} - -/** - * Bootstrap class that contains meta-functionality for HTML Purifier such as - * the autoload function. - * - * @note - * This class may be used without any other files from HTML Purifier. - */ -class HTMLPurifier_Bootstrap -{ - - /** - * Autoload function for HTML Purifier - * @param $class Class to load - */ - public static function autoload($class) { - $file = HTMLPurifier_Bootstrap::getPath($class); - if (!$file) return false; - require HTMLPURIFIER_PREFIX . '/' . $file; - return true; - } - - /** - * Returns the path for a specific class. - */ - public static function getPath($class) { - if (strncmp('HTMLPurifier', $class, 12) !== 0) return false; - // Custom implementations - if (strncmp('HTMLPurifier_Language_', $class, 22) === 0) { - $code = str_replace('_', '-', substr($class, 22)); - $file = 'HTMLPurifier/Language/classes/' . $code . '.php'; - } else { - $file = str_replace('_', '/', $class) . '.php'; - } - if (!file_exists(HTMLPURIFIER_PREFIX . '/' . $file)) return false; - return $file; - } - - /** - * "Pre-registers" our autoloader on the SPL stack. - */ - public static function registerAutoload() { - $autoload = array('HTMLPurifier_Bootstrap', 'autoload'); - if ( ($funcs = spl_autoload_functions()) === false ) { - spl_autoload_register($autoload); - } elseif (function_exists('spl_autoload_unregister')) { - $compat = version_compare(PHP_VERSION, '5.1.2', '<=') && - version_compare(PHP_VERSION, '5.1.0', '>='); - foreach ($funcs as $func) { - if (is_array($func)) { - // :TRICKY: There are some compatibility issues and some - // places where we need to error out - $reflector = new ReflectionMethod($func[0], $func[1]); - if (!$reflector->isStatic()) { - throw new Exception(' - HTML Purifier autoloader registrar is not compatible - with non-static object methods due to PHP Bug #44144; - Please do not use HTMLPurifier.autoload.php (or any - file that includes this file); instead, place the code: - spl_autoload_register(array(\'HTMLPurifier_Bootstrap\', \'autoload\')) - after your own autoloaders. - '); - } - // Suprisingly, spl_autoload_register supports the - // Class::staticMethod callback format, although call_user_func doesn't - if ($compat) $func = implode('::', $func); - } - spl_autoload_unregister($func); - } - spl_autoload_register($autoload); - foreach ($funcs as $func) spl_autoload_register($func); - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/CSSDefinition.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/CSSDefinition.php deleted file mode 100644 index 09afc1f1..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/CSSDefinition.php +++ /dev/null @@ -1,301 +0,0 @@ -info['text-align'] = new HTMLPurifier_AttrDef_Enum( - array('left', 'right', 'center', 'justify'), false); - - $border_style = - $this->info['border-bottom-style'] = - $this->info['border-right-style'] = - $this->info['border-left-style'] = - $this->info['border-top-style'] = new HTMLPurifier_AttrDef_Enum( - array('none', 'hidden', 'dotted', 'dashed', 'solid', 'double', - 'groove', 'ridge', 'inset', 'outset'), false); - - $this->info['border-style'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_style); - - $this->info['clear'] = new HTMLPurifier_AttrDef_Enum( - array('none', 'left', 'right', 'both'), false); - $this->info['float'] = new HTMLPurifier_AttrDef_Enum( - array('none', 'left', 'right'), false); - $this->info['font-style'] = new HTMLPurifier_AttrDef_Enum( - array('normal', 'italic', 'oblique'), false); - $this->info['font-variant'] = new HTMLPurifier_AttrDef_Enum( - array('normal', 'small-caps'), false); - - $uri_or_none = new HTMLPurifier_AttrDef_CSS_Composite( - array( - new HTMLPurifier_AttrDef_Enum(array('none')), - new HTMLPurifier_AttrDef_CSS_URI() - ) - ); - - $this->info['list-style-position'] = new HTMLPurifier_AttrDef_Enum( - array('inside', 'outside'), false); - $this->info['list-style-type'] = new HTMLPurifier_AttrDef_Enum( - array('disc', 'circle', 'square', 'decimal', 'lower-roman', - 'upper-roman', 'lower-alpha', 'upper-alpha', 'none'), false); - $this->info['list-style-image'] = $uri_or_none; - - $this->info['list-style'] = new HTMLPurifier_AttrDef_CSS_ListStyle($config); - - $this->info['text-transform'] = new HTMLPurifier_AttrDef_Enum( - array('capitalize', 'uppercase', 'lowercase', 'none'), false); - $this->info['color'] = new HTMLPurifier_AttrDef_CSS_Color(); - - $this->info['background-image'] = $uri_or_none; - $this->info['background-repeat'] = new HTMLPurifier_AttrDef_Enum( - array('repeat', 'repeat-x', 'repeat-y', 'no-repeat') - ); - $this->info['background-attachment'] = new HTMLPurifier_AttrDef_Enum( - array('scroll', 'fixed') - ); - $this->info['background-position'] = new HTMLPurifier_AttrDef_CSS_BackgroundPosition(); - - $border_color = - $this->info['border-top-color'] = - $this->info['border-bottom-color'] = - $this->info['border-left-color'] = - $this->info['border-right-color'] = - $this->info['background-color'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('transparent')), - new HTMLPurifier_AttrDef_CSS_Color() - )); - - $this->info['background'] = new HTMLPurifier_AttrDef_CSS_Background($config); - - $this->info['border-color'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_color); - - $border_width = - $this->info['border-top-width'] = - $this->info['border-bottom-width'] = - $this->info['border-left-width'] = - $this->info['border-right-width'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('thin', 'medium', 'thick')), - new HTMLPurifier_AttrDef_CSS_Length('0') //disallow negative - )); - - $this->info['border-width'] = new HTMLPurifier_AttrDef_CSS_Multiple($border_width); - - $this->info['letter-spacing'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('normal')), - new HTMLPurifier_AttrDef_CSS_Length() - )); - - $this->info['word-spacing'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('normal')), - new HTMLPurifier_AttrDef_CSS_Length() - )); - - $this->info['font-size'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('xx-small', 'x-small', - 'small', 'medium', 'large', 'x-large', 'xx-large', - 'larger', 'smaller')), - new HTMLPurifier_AttrDef_CSS_Percentage(), - new HTMLPurifier_AttrDef_CSS_Length() - )); - - $this->info['line-height'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('normal')), - new HTMLPurifier_AttrDef_CSS_Number(true), // no negatives - new HTMLPurifier_AttrDef_CSS_Length('0'), - new HTMLPurifier_AttrDef_CSS_Percentage(true) - )); - - $margin = - $this->info['margin-top'] = - $this->info['margin-bottom'] = - $this->info['margin-left'] = - $this->info['margin-right'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length(), - new HTMLPurifier_AttrDef_CSS_Percentage(), - new HTMLPurifier_AttrDef_Enum(array('auto')) - )); - - $this->info['margin'] = new HTMLPurifier_AttrDef_CSS_Multiple($margin); - - // non-negative - $padding = - $this->info['padding-top'] = - $this->info['padding-bottom'] = - $this->info['padding-left'] = - $this->info['padding-right'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length('0'), - new HTMLPurifier_AttrDef_CSS_Percentage(true) - )); - - $this->info['padding'] = new HTMLPurifier_AttrDef_CSS_Multiple($padding); - - $this->info['text-indent'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length(), - new HTMLPurifier_AttrDef_CSS_Percentage() - )); - - $trusted_wh = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length('0'), - new HTMLPurifier_AttrDef_CSS_Percentage(true), - new HTMLPurifier_AttrDef_Enum(array('auto')) - )); - $max = $config->get('CSS.MaxImgLength'); - - $this->info['width'] = - $this->info['height'] = - $max === null ? - $trusted_wh : - new HTMLPurifier_AttrDef_Switch('img', - // For img tags: - new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_CSS_Length('0', $max), - new HTMLPurifier_AttrDef_Enum(array('auto')) - )), - // For everyone else: - $trusted_wh - ); - - $this->info['text-decoration'] = new HTMLPurifier_AttrDef_CSS_TextDecoration(); - - $this->info['font-family'] = new HTMLPurifier_AttrDef_CSS_FontFamily(); - - // this could use specialized code - $this->info['font-weight'] = new HTMLPurifier_AttrDef_Enum( - array('normal', 'bold', 'bolder', 'lighter', '100', '200', '300', - '400', '500', '600', '700', '800', '900'), false); - - // MUST be called after other font properties, as it references - // a CSSDefinition object - $this->info['font'] = new HTMLPurifier_AttrDef_CSS_Font($config); - - // same here - $this->info['border'] = - $this->info['border-bottom'] = - $this->info['border-top'] = - $this->info['border-left'] = - $this->info['border-right'] = new HTMLPurifier_AttrDef_CSS_Border($config); - - $this->info['border-collapse'] = new HTMLPurifier_AttrDef_Enum(array( - 'collapse', 'separate')); - - $this->info['caption-side'] = new HTMLPurifier_AttrDef_Enum(array( - 'top', 'bottom')); - - $this->info['table-layout'] = new HTMLPurifier_AttrDef_Enum(array( - 'auto', 'fixed')); - - $this->info['vertical-align'] = new HTMLPurifier_AttrDef_CSS_Composite(array( - new HTMLPurifier_AttrDef_Enum(array('baseline', 'sub', 'super', - 'top', 'text-top', 'middle', 'bottom', 'text-bottom')), - new HTMLPurifier_AttrDef_CSS_Length(), - new HTMLPurifier_AttrDef_CSS_Percentage() - )); - - $this->info['border-spacing'] = new HTMLPurifier_AttrDef_CSS_Multiple(new HTMLPurifier_AttrDef_CSS_Length(), 2); - - // partial support - $this->info['white-space'] = new HTMLPurifier_AttrDef_Enum(array('nowrap')); - - if ($config->get('CSS.Proprietary')) { - $this->doSetupProprietary($config); - } - - if ($config->get('CSS.AllowTricky')) { - $this->doSetupTricky($config); - } - - $allow_important = $config->get('CSS.AllowImportant'); - // wrap all attr-defs with decorator that handles !important - foreach ($this->info as $k => $v) { - $this->info[$k] = new HTMLPurifier_AttrDef_CSS_ImportantDecorator($v, $allow_important); - } - - $this->setupConfigStuff($config); - } - - protected function doSetupProprietary($config) { - // Internet Explorer only scrollbar colors - $this->info['scrollbar-arrow-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-base-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-darkshadow-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-face-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-highlight-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - $this->info['scrollbar-shadow-color'] = new HTMLPurifier_AttrDef_CSS_Color(); - - // technically not proprietary, but CSS3, and no one supports it - $this->info['opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue(); - $this->info['-moz-opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue(); - $this->info['-khtml-opacity'] = new HTMLPurifier_AttrDef_CSS_AlphaValue(); - - // only opacity, for now - $this->info['filter'] = new HTMLPurifier_AttrDef_CSS_Filter(); - - } - - protected function doSetupTricky($config) { - $this->info['display'] = new HTMLPurifier_AttrDef_Enum(array( - 'inline', 'block', 'list-item', 'run-in', 'compact', - 'marker', 'table', 'inline-table', 'table-row-group', - 'table-header-group', 'table-footer-group', 'table-row', - 'table-column-group', 'table-column', 'table-cell', 'table-caption', 'none' - )); - $this->info['visibility'] = new HTMLPurifier_AttrDef_Enum(array( - 'visible', 'hidden', 'collapse' - )); - $this->info['overflow'] = new HTMLPurifier_AttrDef_Enum(array('visible', 'hidden', 'auto', 'scroll')); - } - - - /** - * Performs extra config-based processing. Based off of - * HTMLPurifier_HTMLDefinition. - * @todo Refactor duplicate elements into common class (probably using - * composition, not inheritance). - */ - protected function setupConfigStuff($config) { - - // setup allowed elements - $support = "(for information on implementing this, see the ". - "support forums) "; - $allowed_properties = $config->get('CSS.AllowedProperties'); - if ($allowed_properties !== null) { - foreach ($this->info as $name => $d) { - if(!isset($allowed_properties[$name])) unset($this->info[$name]); - unset($allowed_properties[$name]); - } - // emit errors - foreach ($allowed_properties as $name => $d) { - // :TODO: Is this htmlspecialchars() call really necessary? - $name = htmlspecialchars($name); - trigger_error("Style attribute '$name' is not supported $support", E_USER_WARNING); - } - } - - $forbidden_properties = $config->get('CSS.ForbiddenProperties'); - if ($forbidden_properties !== null) { - foreach ($this->info as $name => $d) { - if (isset($forbidden_properties[$name])) { - unset($this->info[$name]); - } - } - } - - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef.php deleted file mode 100644 index 5533012c..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef.php +++ /dev/null @@ -1,48 +0,0 @@ -elements; - } - - /** - * Validates nodes according to definition and returns modification. - * - * @param $tokens_of_children Array of HTMLPurifier_Token - * @param $config HTMLPurifier_Config object - * @param $context HTMLPurifier_Context object - * @return bool true to leave nodes as is - * @return bool false to remove parent node - * @return array of replacement child tokens - */ - abstract public function validateChildren($tokens_of_children, $config, $context); -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Chameleon.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Chameleon.php deleted file mode 100644 index e70d53e8..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Chameleon.php +++ /dev/null @@ -1,48 +0,0 @@ -inline = new HTMLPurifier_ChildDef_Optional($inline); - $this->block = new HTMLPurifier_ChildDef_Optional($block); - $this->elements = $this->block->elements; - } - - public function validateChildren($tokens_of_children, $config, $context) { - if ($context->get('IsInline') === false) { - return $this->block->validateChildren( - $tokens_of_children, $config, $context); - } else { - return $this->inline->validateChildren( - $tokens_of_children, $config, $context); - } - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Custom.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Custom.php deleted file mode 100644 index 37093d86..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Custom.php +++ /dev/null @@ -1,90 +0,0 @@ -dtd_regex = $dtd_regex; - $this->_compileRegex(); - } - /** - * Compiles the PCRE regex from a DTD regex ($dtd_regex to $_pcre_regex) - */ - protected function _compileRegex() { - $raw = str_replace(' ', '', $this->dtd_regex); - if ($raw{0} != '(') { - $raw = "($raw)"; - } - $el = '[#a-zA-Z0-9_.-]+'; - $reg = $raw; - - // COMPLICATED! AND MIGHT BE BUGGY! I HAVE NO CLUE WHAT I'M - // DOING! Seriously: if there's problems, please report them. - - // collect all elements into the $elements array - preg_match_all("/$el/", $reg, $matches); - foreach ($matches[0] as $match) { - $this->elements[$match] = true; - } - - // setup all elements as parentheticals with leading commas - $reg = preg_replace("/$el/", '(,\\0)', $reg); - - // remove commas when they were not solicited - $reg = preg_replace("/([^,(|]\(+),/", '\\1', $reg); - - // remove all non-paranthetical commas: they are handled by first regex - $reg = preg_replace("/,\(/", '(', $reg); - - $this->_pcre_regex = $reg; - } - public function validateChildren($tokens_of_children, $config, $context) { - $list_of_children = ''; - $nesting = 0; // depth into the nest - foreach ($tokens_of_children as $token) { - if (!empty($token->is_whitespace)) continue; - - $is_child = ($nesting == 0); // direct - - if ($token instanceof HTMLPurifier_Token_Start) { - $nesting++; - } elseif ($token instanceof HTMLPurifier_Token_End) { - $nesting--; - } - - if ($is_child) { - $list_of_children .= $token->name . ','; - } - } - // add leading comma to deal with stray comma declarations - $list_of_children = ',' . rtrim($list_of_children, ','); - $okay = - preg_match( - '/^,?'.$this->_pcre_regex.'$/', - $list_of_children - ); - - return (bool) $okay; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Empty.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Empty.php deleted file mode 100644 index 30df7700..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Empty.php +++ /dev/null @@ -1,20 +0,0 @@ -whitespace) return $tokens_of_children; - else return array(); - } - return $result; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Required.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Required.php deleted file mode 100644 index f21ab23a..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Required.php +++ /dev/null @@ -1,117 +0,0 @@ - $x) { - $elements[$i] = true; - if (empty($i)) unset($elements[$i]); // remove blank - } - } - $this->elements = $elements; - } - public $allow_empty = false; - public $type = 'required'; - public function validateChildren($tokens_of_children, $config, $context) { - // Flag for subclasses - $this->whitespace = false; - - // if there are no tokens, delete parent node - if (empty($tokens_of_children)) return false; - - // the new set of children - $result = array(); - - // current depth into the nest - $nesting = 0; - - // whether or not we're deleting a node - $is_deleting = false; - - // whether or not parsed character data is allowed - // this controls whether or not we silently drop a tag - // or generate escaped HTML from it - $pcdata_allowed = isset($this->elements['#PCDATA']); - - // a little sanity check to make sure it's not ALL whitespace - $all_whitespace = true; - - // some configuration - $escape_invalid_children = $config->get('Core.EscapeInvalidChildren'); - - // generator - $gen = new HTMLPurifier_Generator($config, $context); - - foreach ($tokens_of_children as $token) { - if (!empty($token->is_whitespace)) { - $result[] = $token; - continue; - } - $all_whitespace = false; // phew, we're not talking about whitespace - - $is_child = ($nesting == 0); - - if ($token instanceof HTMLPurifier_Token_Start) { - $nesting++; - } elseif ($token instanceof HTMLPurifier_Token_End) { - $nesting--; - } - - if ($is_child) { - $is_deleting = false; - if (!isset($this->elements[$token->name])) { - $is_deleting = true; - if ($pcdata_allowed && $token instanceof HTMLPurifier_Token_Text) { - $result[] = $token; - } elseif ($pcdata_allowed && $escape_invalid_children) { - $result[] = new HTMLPurifier_Token_Text( - $gen->generateFromToken($token) - ); - } - continue; - } - } - if (!$is_deleting || ($pcdata_allowed && $token instanceof HTMLPurifier_Token_Text)) { - $result[] = $token; - } elseif ($pcdata_allowed && $escape_invalid_children) { - $result[] = - new HTMLPurifier_Token_Text( - $gen->generateFromToken($token) - ); - } else { - // drop silently - } - } - if (empty($result)) return false; - if ($all_whitespace) { - $this->whitespace = true; - return false; - } - if ($tokens_of_children == $result) return true; - return $result; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/StrictBlockquote.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/StrictBlockquote.php deleted file mode 100644 index ca907c12..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/StrictBlockquote.php +++ /dev/null @@ -1,88 +0,0 @@ -init($config); - return $this->fake_elements; - } - - public function validateChildren($tokens_of_children, $config, $context) { - - $this->init($config); - - // trick the parent class into thinking it allows more - $this->elements = $this->fake_elements; - $result = parent::validateChildren($tokens_of_children, $config, $context); - $this->elements = $this->real_elements; - - if ($result === false) return array(); - if ($result === true) $result = $tokens_of_children; - - $def = $config->getHTMLDefinition(); - $block_wrap_start = new HTMLPurifier_Token_Start($def->info_block_wrapper); - $block_wrap_end = new HTMLPurifier_Token_End( $def->info_block_wrapper); - $is_inline = false; - $depth = 0; - $ret = array(); - - // assuming that there are no comment tokens - foreach ($result as $i => $token) { - $token = $result[$i]; - // ifs are nested for readability - if (!$is_inline) { - if (!$depth) { - if ( - ($token instanceof HTMLPurifier_Token_Text && !$token->is_whitespace) || - (!$token instanceof HTMLPurifier_Token_Text && !isset($this->elements[$token->name])) - ) { - $is_inline = true; - $ret[] = $block_wrap_start; - } - } - } else { - if (!$depth) { - // starting tokens have been inline text / empty - if ($token instanceof HTMLPurifier_Token_Start || $token instanceof HTMLPurifier_Token_Empty) { - if (isset($this->elements[$token->name])) { - // ended - $ret[] = $block_wrap_end; - $is_inline = false; - } - } - } - } - $ret[] = $token; - if ($token instanceof HTMLPurifier_Token_Start) $depth++; - if ($token instanceof HTMLPurifier_Token_End) $depth--; - } - if ($is_inline) $ret[] = $block_wrap_end; - return $ret; - } - - private function init($config) { - if (!$this->init) { - $def = $config->getHTMLDefinition(); - // allow all inline elements - $this->real_elements = $this->elements; - $this->fake_elements = $def->info_content_sets['Flow']; - $this->fake_elements['#PCDATA'] = true; - $this->init = true; - } - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Table.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Table.php deleted file mode 100644 index 96870ac5..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ChildDef/Table.php +++ /dev/null @@ -1,142 +0,0 @@ - true, 'tbody' => true, 'thead' => true, - 'tfoot' => true, 'caption' => true, 'colgroup' => true, 'col' => true); - public function __construct() {} - public function validateChildren($tokens_of_children, $config, $context) { - if (empty($tokens_of_children)) return false; - - // this ensures that the loop gets run one last time before closing - // up. It's a little bit of a hack, but it works! Just make sure you - // get rid of the token later. - $tokens_of_children[] = false; - - // only one of these elements is allowed in a table - $caption = false; - $thead = false; - $tfoot = false; - - // as many of these as you want - $cols = array(); - $content = array(); - - $nesting = 0; // current depth so we can determine nodes - $is_collecting = false; // are we globbing together tokens to package - // into one of the collectors? - $collection = array(); // collected nodes - $tag_index = 0; // the first node might be whitespace, - // so this tells us where the start tag is - - foreach ($tokens_of_children as $token) { - $is_child = ($nesting == 0); - - if ($token === false) { - // terminating sequence started - } elseif ($token instanceof HTMLPurifier_Token_Start) { - $nesting++; - } elseif ($token instanceof HTMLPurifier_Token_End) { - $nesting--; - } - - // handle node collection - if ($is_collecting) { - if ($is_child) { - // okay, let's stash the tokens away - // first token tells us the type of the collection - switch ($collection[$tag_index]->name) { - case 'tr': - case 'tbody': - $content[] = $collection; - break; - case 'caption': - if ($caption !== false) break; - $caption = $collection; - break; - case 'thead': - case 'tfoot': - // access the appropriate variable, $thead or $tfoot - $var = $collection[$tag_index]->name; - if ($$var === false) { - $$var = $collection; - } else { - // transmutate the first and less entries into - // tbody tags, and then put into content - $collection[$tag_index]->name = 'tbody'; - $collection[count($collection)-1]->name = 'tbody'; - $content[] = $collection; - } - break; - case 'colgroup': - $cols[] = $collection; - break; - } - $collection = array(); - $is_collecting = false; - $tag_index = 0; - } else { - // add the node to the collection - $collection[] = $token; - } - } - - // terminate - if ($token === false) break; - - if ($is_child) { - // determine what we're dealing with - if ($token->name == 'col') { - // the only empty tag in the possie, we can handle it - // immediately - $cols[] = array_merge($collection, array($token)); - $collection = array(); - $tag_index = 0; - continue; - } - switch($token->name) { - case 'caption': - case 'colgroup': - case 'thead': - case 'tfoot': - case 'tbody': - case 'tr': - $is_collecting = true; - $collection[] = $token; - continue; - default: - if (!empty($token->is_whitespace)) { - $collection[] = $token; - $tag_index++; - } - continue; - } - } - } - - if (empty($content)) return false; - - $ret = array(); - if ($caption !== false) $ret = array_merge($ret, $caption); - if ($cols !== false) foreach ($cols as $token_array) $ret = array_merge($ret, $token_array); - if ($thead !== false) $ret = array_merge($ret, $thead); - if ($tfoot !== false) $ret = array_merge($ret, $tfoot); - foreach ($content as $token_array) $ret = array_merge($ret, $token_array); - if (!empty($collection) && $is_collecting == false){ - // grab the trailing space - $ret = array_merge($ret, $collection); - } - - array_pop($tokens_of_children); // remove phantom token - - return ($ret === $tokens_of_children) ? true : $ret; - - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Config.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Config.php deleted file mode 100644 index ada1b701..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Config.php +++ /dev/null @@ -1,580 +0,0 @@ -defaultPlist; - $this->plist = new HTMLPurifier_PropertyList($parent); - $this->def = $definition; // keep a copy around for checking - $this->parser = new HTMLPurifier_VarParser_Flexible(); - } - - /** - * Convenience constructor that creates a config object based on a mixed var - * @param mixed $config Variable that defines the state of the config - * object. Can be: a HTMLPurifier_Config() object, - * an array of directives based on loadArray(), - * or a string filename of an ini file. - * @param HTMLPurifier_ConfigSchema Schema object - * @return Configured HTMLPurifier_Config object - */ - public static function create($config, $schema = null) { - if ($config instanceof HTMLPurifier_Config) { - // pass-through - return $config; - } - if (!$schema) { - $ret = HTMLPurifier_Config::createDefault(); - } else { - $ret = new HTMLPurifier_Config($schema); - } - if (is_string($config)) $ret->loadIni($config); - elseif (is_array($config)) $ret->loadArray($config); - return $ret; - } - - /** - * Creates a new config object that inherits from a previous one. - * @param HTMLPurifier_Config $config Configuration object to inherit - * from. - * @return HTMLPurifier_Config object with $config as its parent. - */ - public static function inherit(HTMLPurifier_Config $config) { - return new HTMLPurifier_Config($config->def, $config->plist); - } - - /** - * Convenience constructor that creates a default configuration object. - * @return Default HTMLPurifier_Config object. - */ - public static function createDefault() { - $definition = HTMLPurifier_ConfigSchema::instance(); - $config = new HTMLPurifier_Config($definition); - return $config; - } - - /** - * Retreives a value from the configuration. - * @param $key String key - */ - public function get($key, $a = null) { - if ($a !== null) { - $this->triggerError("Using deprecated API: use \$config->get('$key.$a') instead", E_USER_WARNING); - $key = "$key.$a"; - } - if (!$this->finalized) $this->autoFinalize(); - if (!isset($this->def->info[$key])) { - // can't add % due to SimpleTest bug - $this->triggerError('Cannot retrieve value of undefined directive ' . htmlspecialchars($key), - E_USER_WARNING); - return; - } - if (isset($this->def->info[$key]->isAlias)) { - $d = $this->def->info[$key]; - $this->triggerError('Cannot get value from aliased directive, use real name ' . $d->key, - E_USER_ERROR); - return; - } - if ($this->lock) { - list($ns) = explode('.', $key); - if ($ns !== $this->lock) { - $this->triggerError('Cannot get value of namespace ' . $ns . ' when lock for ' . $this->lock . ' is active, this probably indicates a Definition setup method is accessing directives that are not within its namespace', E_USER_ERROR); - return; - } - } - return $this->plist->get($key); - } - - /** - * Retreives an array of directives to values from a given namespace - * @param $namespace String namespace - */ - public function getBatch($namespace) { - if (!$this->finalized) $this->autoFinalize(); - $full = $this->getAll(); - if (!isset($full[$namespace])) { - $this->triggerError('Cannot retrieve undefined namespace ' . htmlspecialchars($namespace), - E_USER_WARNING); - return; - } - return $full[$namespace]; - } - - /** - * Returns a md5 signature of a segment of the configuration object - * that uniquely identifies that particular configuration - * @note Revision is handled specially and is removed from the batch - * before processing! - * @param $namespace Namespace to get serial for - */ - public function getBatchSerial($namespace) { - if (empty($this->serials[$namespace])) { - $batch = $this->getBatch($namespace); - unset($batch['DefinitionRev']); - $this->serials[$namespace] = md5(serialize($batch)); - } - return $this->serials[$namespace]; - } - - /** - * Returns a md5 signature for the entire configuration object - * that uniquely identifies that particular configuration - */ - public function getSerial() { - if (empty($this->serial)) { - $this->serial = md5(serialize($this->getAll())); - } - return $this->serial; - } - - /** - * Retrieves all directives, organized by namespace - * @warning This is a pretty inefficient function, avoid if you can - */ - public function getAll() { - if (!$this->finalized) $this->autoFinalize(); - $ret = array(); - foreach ($this->plist->squash() as $name => $value) { - list($ns, $key) = explode('.', $name, 2); - $ret[$ns][$key] = $value; - } - return $ret; - } - - /** - * Sets a value to configuration. - * @param $key String key - * @param $value Mixed value - */ - public function set($key, $value, $a = null) { - if (strpos($key, '.') === false) { - $namespace = $key; - $directive = $value; - $value = $a; - $key = "$key.$directive"; - $this->triggerError("Using deprecated API: use \$config->set('$key', ...) instead", E_USER_NOTICE); - } else { - list($namespace) = explode('.', $key); - } - if ($this->isFinalized('Cannot set directive after finalization')) return; - if (!isset($this->def->info[$key])) { - $this->triggerError('Cannot set undefined directive ' . htmlspecialchars($key) . ' to value', - E_USER_WARNING); - return; - } - $def = $this->def->info[$key]; - - if (isset($def->isAlias)) { - if ($this->aliasMode) { - $this->triggerError('Double-aliases not allowed, please fix '. - 'ConfigSchema bug with' . $key, E_USER_ERROR); - return; - } - $this->aliasMode = true; - $this->set($def->key, $value); - $this->aliasMode = false; - $this->triggerError("$key is an alias, preferred directive name is {$def->key}", E_USER_NOTICE); - return; - } - - // Raw type might be negative when using the fully optimized form - // of stdclass, which indicates allow_null == true - $rtype = is_int($def) ? $def : $def->type; - if ($rtype < 0) { - $type = -$rtype; - $allow_null = true; - } else { - $type = $rtype; - $allow_null = isset($def->allow_null); - } - - try { - $value = $this->parser->parse($value, $type, $allow_null); - } catch (HTMLPurifier_VarParserException $e) { - $this->triggerError('Value for ' . $key . ' is of invalid type, should be ' . HTMLPurifier_VarParser::getTypeName($type), E_USER_WARNING); - return; - } - if (is_string($value) && is_object($def)) { - // resolve value alias if defined - if (isset($def->aliases[$value])) { - $value = $def->aliases[$value]; - } - // check to see if the value is allowed - if (isset($def->allowed) && !isset($def->allowed[$value])) { - $this->triggerError('Value not supported, valid values are: ' . - $this->_listify($def->allowed), E_USER_WARNING); - return; - } - } - $this->plist->set($key, $value); - - // reset definitions if the directives they depend on changed - // this is a very costly process, so it's discouraged - // with finalization - if ($namespace == 'HTML' || $namespace == 'CSS' || $namespace == 'URI') { - $this->definitions[$namespace] = null; - } - - $this->serials[$namespace] = false; - } - - /** - * Convenience function for error reporting - */ - private function _listify($lookup) { - $list = array(); - foreach ($lookup as $name => $b) $list[] = $name; - return implode(', ', $list); - } - - /** - * Retrieves object reference to the HTML definition. - * @param $raw Return a copy that has not been setup yet. Must be - * called before it's been setup, otherwise won't work. - */ - public function getHTMLDefinition($raw = false) { - return $this->getDefinition('HTML', $raw); - } - - /** - * Retrieves object reference to the CSS definition - * @param $raw Return a copy that has not been setup yet. Must be - * called before it's been setup, otherwise won't work. - */ - public function getCSSDefinition($raw = false) { - return $this->getDefinition('CSS', $raw); - } - - /** - * Retrieves a definition - * @param $type Type of definition: HTML, CSS, etc - * @param $raw Whether or not definition should be returned raw - */ - public function getDefinition($type, $raw = false) { - if (!$this->finalized) $this->autoFinalize(); - // temporarily suspend locks, so we can handle recursive definition calls - $lock = $this->lock; - $this->lock = null; - $factory = HTMLPurifier_DefinitionCacheFactory::instance(); - $cache = $factory->create($type, $this); - $this->lock = $lock; - if (!$raw) { - // see if we can quickly supply a definition - if (!empty($this->definitions[$type])) { - if (!$this->definitions[$type]->setup) { - $this->definitions[$type]->setup($this); - $cache->set($this->definitions[$type], $this); - } - return $this->definitions[$type]; - } - // memory check missed, try cache - $this->definitions[$type] = $cache->get($this); - if ($this->definitions[$type]) { - // definition in cache, return it - return $this->definitions[$type]; - } - } elseif ( - !empty($this->definitions[$type]) && - !$this->definitions[$type]->setup - ) { - // raw requested, raw in memory, quick return - return $this->definitions[$type]; - } - // quick checks failed, let's create the object - if ($type == 'HTML') { - $this->definitions[$type] = new HTMLPurifier_HTMLDefinition(); - } elseif ($type == 'CSS') { - $this->definitions[$type] = new HTMLPurifier_CSSDefinition(); - } elseif ($type == 'URI') { - $this->definitions[$type] = new HTMLPurifier_URIDefinition(); - } else { - throw new HTMLPurifier_Exception("Definition of $type type not supported"); - } - // quick abort if raw - if ($raw) { - if (is_null($this->get($type . '.DefinitionID'))) { - // fatally error out if definition ID not set - throw new HTMLPurifier_Exception("Cannot retrieve raw version without specifying %$type.DefinitionID"); - } - return $this->definitions[$type]; - } - // set it up - $this->lock = $type; - $this->definitions[$type]->setup($this); - $this->lock = null; - // save in cache - $cache->set($this->definitions[$type], $this); - return $this->definitions[$type]; - } - - /** - * Loads configuration values from an array with the following structure: - * Namespace.Directive => Value - * @param $config_array Configuration associative array - */ - public function loadArray($config_array) { - if ($this->isFinalized('Cannot load directives after finalization')) return; - foreach ($config_array as $key => $value) { - $key = str_replace('_', '.', $key); - if (strpos($key, '.') !== false) { - $this->set($key, $value); - } else { - $namespace = $key; - $namespace_values = $value; - foreach ($namespace_values as $directive => $value) { - $this->set($namespace .'.'. $directive, $value); - } - } - } - } - - /** - * Returns a list of array(namespace, directive) for all directives - * that are allowed in a web-form context as per an allowed - * namespaces/directives list. - * @param $allowed List of allowed namespaces/directives - */ - public static function getAllowedDirectivesForForm($allowed, $schema = null) { - if (!$schema) { - $schema = HTMLPurifier_ConfigSchema::instance(); - } - if ($allowed !== true) { - if (is_string($allowed)) $allowed = array($allowed); - $allowed_ns = array(); - $allowed_directives = array(); - $blacklisted_directives = array(); - foreach ($allowed as $ns_or_directive) { - if (strpos($ns_or_directive, '.') !== false) { - // directive - if ($ns_or_directive[0] == '-') { - $blacklisted_directives[substr($ns_or_directive, 1)] = true; - } else { - $allowed_directives[$ns_or_directive] = true; - } - } else { - // namespace - $allowed_ns[$ns_or_directive] = true; - } - } - } - $ret = array(); - foreach ($schema->info as $key => $def) { - list($ns, $directive) = explode('.', $key, 2); - if ($allowed !== true) { - if (isset($blacklisted_directives["$ns.$directive"])) continue; - if (!isset($allowed_directives["$ns.$directive"]) && !isset($allowed_ns[$ns])) continue; - } - if (isset($def->isAlias)) continue; - if ($directive == 'DefinitionID' || $directive == 'DefinitionRev') continue; - $ret[] = array($ns, $directive); - } - return $ret; - } - - /** - * Loads configuration values from $_GET/$_POST that were posted - * via ConfigForm - * @param $array $_GET or $_POST array to import - * @param $index Index/name that the config variables are in - * @param $allowed List of allowed namespaces/directives - * @param $mq_fix Boolean whether or not to enable magic quotes fix - * @param $schema Instance of HTMLPurifier_ConfigSchema to use, if not global copy - */ - public static function loadArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) { - $ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $schema); - $config = HTMLPurifier_Config::create($ret, $schema); - return $config; - } - - /** - * Merges in configuration values from $_GET/$_POST to object. NOT STATIC. - * @note Same parameters as loadArrayFromForm - */ - public function mergeArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true) { - $ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $this->def); - $this->loadArray($ret); - } - - /** - * Prepares an array from a form into something usable for the more - * strict parts of HTMLPurifier_Config - */ - public static function prepareArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) { - if ($index !== false) $array = (isset($array[$index]) && is_array($array[$index])) ? $array[$index] : array(); - $mq = $mq_fix && function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc(); - - $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $schema); - $ret = array(); - foreach ($allowed as $key) { - list($ns, $directive) = $key; - $skey = "$ns.$directive"; - if (!empty($array["Null_$skey"])) { - $ret[$ns][$directive] = null; - continue; - } - if (!isset($array[$skey])) continue; - $value = $mq ? stripslashes($array[$skey]) : $array[$skey]; - $ret[$ns][$directive] = $value; - } - return $ret; - } - - /** - * Loads configuration values from an ini file - * @param $filename Name of ini file - */ - public function loadIni($filename) { - if ($this->isFinalized('Cannot load directives after finalization')) return; - $array = parse_ini_file($filename, true); - $this->loadArray($array); - } - - /** - * Checks whether or not the configuration object is finalized. - * @param $error String error message, or false for no error - */ - public function isFinalized($error = false) { - if ($this->finalized && $error) { - $this->triggerError($error, E_USER_ERROR); - } - return $this->finalized; - } - - /** - * Finalizes configuration only if auto finalize is on and not - * already finalized - */ - public function autoFinalize() { - if ($this->autoFinalize) { - $this->finalize(); - } else { - $this->plist->squash(true); - } - } - - /** - * Finalizes a configuration object, prohibiting further change - */ - public function finalize() { - $this->finalized = true; - unset($this->parser); - } - - /** - * Produces a nicely formatted error message by supplying the - * stack frame information from two levels up and OUTSIDE of - * HTMLPurifier_Config. - */ - protected function triggerError($msg, $no) { - // determine previous stack frame - $backtrace = debug_backtrace(); - if ($this->chatty && isset($backtrace[1])) { - $frame = $backtrace[1]; - $extra = " on line {$frame['line']} in file {$frame['file']}"; - } else { - $extra = ''; - } - trigger_error($msg . $extra, $no); - } - - /** - * Returns a serialized form of the configuration object that can - * be reconstituted. - */ - public function serialize() { - $this->getDefinition('HTML'); - $this->getDefinition('CSS'); - $this->getDefinition('URI'); - return serialize($this); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema.php deleted file mode 100644 index d6e4c78b..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema.php +++ /dev/null @@ -1,158 +0,0 @@ - array( - * 'Directive' => new stdclass(), - * ) - * ) - * - * The stdclass may have the following properties: - * - * - If isAlias isn't set: - * - type: Integer type of directive, see HTMLPurifier_VarParser for definitions - * - allow_null: If set, this directive allows null values - * - aliases: If set, an associative array of value aliases to real values - * - allowed: If set, a lookup array of allowed (string) values - * - If isAlias is set: - * - namespace: Namespace this directive aliases to - * - name: Directive name this directive aliases to - * - * In certain degenerate cases, stdclass will actually be an integer. In - * that case, the value is equivalent to an stdclass with the type - * property set to the integer. If the integer is negative, type is - * equal to the absolute value of integer, and allow_null is true. - * - * This class is friendly with HTMLPurifier_Config. If you need introspection - * about the schema, you're better of using the ConfigSchema_Interchange, - * which uses more memory but has much richer information. - */ - public $info = array(); - - /** - * Application-wide singleton - */ - static protected $singleton; - - public function __construct() { - $this->defaultPlist = new HTMLPurifier_PropertyList(); - } - - /** - * Unserializes the default ConfigSchema. - */ - public static function makeFromSerial() { - return unserialize(file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema.ser')); - } - - /** - * Retrieves an instance of the application-wide configuration definition. - */ - public static function instance($prototype = null) { - if ($prototype !== null) { - HTMLPurifier_ConfigSchema::$singleton = $prototype; - } elseif (HTMLPurifier_ConfigSchema::$singleton === null || $prototype === true) { - HTMLPurifier_ConfigSchema::$singleton = HTMLPurifier_ConfigSchema::makeFromSerial(); - } - return HTMLPurifier_ConfigSchema::$singleton; - } - - /** - * Defines a directive for configuration - * @warning Will fail of directive's namespace is defined. - * @warning This method's signature is slightly different from the legacy - * define() static method! Beware! - * @param $namespace Namespace the directive is in - * @param $name Key of directive - * @param $default Default value of directive - * @param $type Allowed type of the directive. See - * HTMLPurifier_DirectiveDef::$type for allowed values - * @param $allow_null Whether or not to allow null values - */ - public function add($key, $default, $type, $allow_null) { - $obj = new stdclass(); - $obj->type = is_int($type) ? $type : HTMLPurifier_VarParser::$types[$type]; - if ($allow_null) $obj->allow_null = true; - $this->info[$key] = $obj; - $this->defaults[$key] = $default; - $this->defaultPlist->set($key, $default); - } - - /** - * Defines a directive value alias. - * - * Directive value aliases are convenient for developers because it lets - * them set a directive to several values and get the same result. - * @param $namespace Directive's namespace - * @param $name Name of Directive - * @param $aliases Hash of aliased values to the real alias - */ - public function addValueAliases($key, $aliases) { - if (!isset($this->info[$key]->aliases)) { - $this->info[$key]->aliases = array(); - } - foreach ($aliases as $alias => $real) { - $this->info[$key]->aliases[$alias] = $real; - } - } - - /** - * Defines a set of allowed values for a directive. - * @warning This is slightly different from the corresponding static - * method definition. - * @param $namespace Namespace of directive - * @param $name Name of directive - * @param $allowed Lookup array of allowed values - */ - public function addAllowedValues($key, $allowed) { - $this->info[$key]->allowed = $allowed; - } - - /** - * Defines a directive alias for backwards compatibility - * @param $namespace - * @param $name Directive that will be aliased - * @param $new_namespace - * @param $new_name Directive that the alias will be to - */ - public function addAlias($key, $new_key) { - $obj = new stdclass; - $obj->key = $new_key; - $obj->isAlias = true; - $this->info[$key] = $obj; - } - - /** - * Replaces any stdclass that only has the type property with type integer. - */ - public function postProcess() { - foreach ($this->info as $key => $v) { - if (count((array) $v) == 1) { - $this->info[$key] = $v->type; - } elseif (count((array) $v) == 2 && isset($v->allow_null)) { - $this->info[$key] = -$v->type; - } - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php deleted file mode 100644 index 723f3a6c..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php +++ /dev/null @@ -1,44 +0,0 @@ -directives as $d) { - $schema->add( - $d->id->key, - $d->default, - $d->type, - $d->typeAllowsNull - ); - if ($d->allowed !== null) { - $schema->addAllowedValues( - $d->id->key, - $d->allowed - ); - } - foreach ($d->aliases as $alias) { - $schema->addAlias( - $alias->key, - $d->id->key - ); - } - if ($d->valueAliases !== null) { - $schema->addValueAliases( - $d->id->key, - $d->valueAliases - ); - } - } - $schema->postProcess(); - return $schema; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Builder/Xml.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Builder/Xml.php deleted file mode 100644 index 6712b17b..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Builder/Xml.php +++ /dev/null @@ -1,106 +0,0 @@ -startElement('div'); - - $purifier = HTMLPurifier::getInstance(); - $html = $purifier->purify($html); - $this->writeAttribute('xmlns', 'http://www.w3.org/1999/xhtml'); - $this->writeRaw($html); - - $this->endElement(); // div - } - - protected function export($var) { - if ($var === array()) return 'array()'; - return var_export($var, true); - } - - public function build($interchange) { - // global access, only use as last resort - $this->interchange = $interchange; - - $this->setIndent(true); - $this->startDocument('1.0', 'UTF-8'); - $this->startElement('configdoc'); - $this->writeElement('title', $interchange->name); - - foreach ($interchange->directives as $directive) { - $this->buildDirective($directive); - } - - if ($this->namespace) $this->endElement(); // namespace - - $this->endElement(); // configdoc - $this->flush(); - } - - public function buildDirective($directive) { - - // Kludge, although I suppose having a notion of a "root namespace" - // certainly makes things look nicer when documentation is built. - // Depends on things being sorted. - if (!$this->namespace || $this->namespace !== $directive->id->getRootNamespace()) { - if ($this->namespace) $this->endElement(); // namespace - $this->namespace = $directive->id->getRootNamespace(); - $this->startElement('namespace'); - $this->writeAttribute('id', $this->namespace); - $this->writeElement('name', $this->namespace); - } - - $this->startElement('directive'); - $this->writeAttribute('id', $directive->id->toString()); - - $this->writeElement('name', $directive->id->getDirective()); - - $this->startElement('aliases'); - foreach ($directive->aliases as $alias) $this->writeElement('alias', $alias->toString()); - $this->endElement(); // aliases - - $this->startElement('constraints'); - if ($directive->version) $this->writeElement('version', $directive->version); - $this->startElement('type'); - if ($directive->typeAllowsNull) $this->writeAttribute('allow-null', 'yes'); - $this->text($directive->type); - $this->endElement(); // type - if ($directive->allowed) { - $this->startElement('allowed'); - foreach ($directive->allowed as $value => $x) $this->writeElement('value', $value); - $this->endElement(); // allowed - } - $this->writeElement('default', $this->export($directive->default)); - $this->writeAttribute('xml:space', 'preserve'); - if ($directive->external) { - $this->startElement('external'); - foreach ($directive->external as $project) $this->writeElement('project', $project); - $this->endElement(); - } - $this->endElement(); // constraints - - if ($directive->deprecatedVersion) { - $this->startElement('deprecated'); - $this->writeElement('version', $directive->deprecatedVersion); - $this->writeElement('use', $directive->deprecatedUse->toString()); - $this->endElement(); // deprecated - } - - $this->startElement('description'); - $this->writeHTMLDiv($directive->description); - $this->endElement(); // description - - $this->endElement(); // directive - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Exception.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Exception.php deleted file mode 100644 index 47881599..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Exception.php +++ /dev/null @@ -1,11 +0,0 @@ - array(directive info) - */ - public $directives = array(); - - /** - * Adds a directive array to $directives - */ - public function addDirective($directive) { - if (isset($this->directives[$i = $directive->id->toString()])) { - throw new HTMLPurifier_ConfigSchema_Exception("Cannot redefine directive '$i'"); - } - $this->directives[$i] = $directive; - } - - /** - * Convenience function to perform standard validation. Throws exception - * on failed validation. - */ - public function validate() { - $validator = new HTMLPurifier_ConfigSchema_Validator(); - return $validator->validate($this); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Interchange/Directive.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Interchange/Directive.php deleted file mode 100644 index f502d473..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Interchange/Directive.php +++ /dev/null @@ -1,77 +0,0 @@ - true). - * Null if all values are allowed. - */ - public $allowed; - - /** - * List of aliases for the directive, - * e.g. array(new HTMLPurifier_ConfigSchema_Interchange_Id('Ns', 'Dir'))). - */ - public $aliases = array(); - - /** - * Hash of value aliases, e.g. array('alt' => 'real'). Null if value - * aliasing is disabled (necessary for non-scalar types). - */ - public $valueAliases; - - /** - * Version of HTML Purifier the directive was introduced, e.g. '1.3.1'. - * Null if the directive has always existed. - */ - public $version; - - /** - * ID of directive that supercedes this old directive, is an instance - * of HTMLPurifier_ConfigSchema_Interchange_Id. Null if not deprecated. - */ - public $deprecatedUse; - - /** - * Version of HTML Purifier this directive was deprecated. Null if not - * deprecated. - */ - public $deprecatedVersion; - - /** - * List of external projects this directive depends on, e.g. array('CSSTidy'). - */ - public $external = array(); - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php deleted file mode 100644 index bfdbca53..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php +++ /dev/null @@ -1,37 +0,0 @@ -key = $key; - } - - /** - * @warning This is NOT magic, to ensure that people don't abuse SPL and - * cause problems for PHP 5.0 support. - */ - public function toString() { - return $this->key; - } - - public function getRootNamespace() { - return substr($this->key, 0, strpos($this->key, ".")); - } - - public function getDirective() { - return substr($this->key, strpos($this->key, ".") + 1); - } - - public static function make($id) { - return new HTMLPurifier_ConfigSchema_Interchange_Id($id); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/InterchangeBuilder.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/InterchangeBuilder.php deleted file mode 100644 index 3195cc0b..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/InterchangeBuilder.php +++ /dev/null @@ -1,180 +0,0 @@ -varParser = $varParser ? $varParser : new HTMLPurifier_VarParser_Native(); - } - - public static function buildFromDirectory($dir = null) { - $builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder(); - $interchange = new HTMLPurifier_ConfigSchema_Interchange(); - return $builder->buildDir($interchange, $dir); - } - - public function buildDir($interchange, $dir = null) { - if (!$dir) $dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema'; - if (file_exists($dir . '/info.ini')) { - $info = parse_ini_file($dir . '/info.ini'); - $interchange->name = $info['name']; - } - - $files = array(); - $dh = opendir($dir); - while (false !== ($file = readdir($dh))) { - if (!$file || $file[0] == '.' || strrchr($file, '.') !== '.txt') { - continue; - } - $files[] = $file; - } - closedir($dh); - - sort($files); - foreach ($files as $file) { - $this->buildFile($interchange, $dir . '/' . $file); - } - - return $interchange; - } - - public function buildFile($interchange, $file) { - $parser = new HTMLPurifier_StringHashParser(); - $this->build( - $interchange, - new HTMLPurifier_StringHash( $parser->parseFile($file) ) - ); - } - - /** - * Builds an interchange object based on a hash. - * @param $interchange HTMLPurifier_ConfigSchema_Interchange object to build - * @param $hash HTMLPurifier_ConfigSchema_StringHash source data - */ - public function build($interchange, $hash) { - if (!$hash instanceof HTMLPurifier_StringHash) { - $hash = new HTMLPurifier_StringHash($hash); - } - if (!isset($hash['ID'])) { - throw new HTMLPurifier_ConfigSchema_Exception('Hash does not have any ID'); - } - if (strpos($hash['ID'], '.') === false) { - if (count($hash) == 2 && isset($hash['DESCRIPTION'])) { - $hash->offsetGet('DESCRIPTION'); // prevent complaining - } else { - throw new HTMLPurifier_ConfigSchema_Exception('All directives must have a namespace'); - } - } else { - $this->buildDirective($interchange, $hash); - } - $this->_findUnused($hash); - } - - public function buildDirective($interchange, $hash) { - $directive = new HTMLPurifier_ConfigSchema_Interchange_Directive(); - - // These are required elements: - $directive->id = $this->id($hash->offsetGet('ID')); - $id = $directive->id->toString(); // convenience - - if (isset($hash['TYPE'])) { - $type = explode('/', $hash->offsetGet('TYPE')); - if (isset($type[1])) $directive->typeAllowsNull = true; - $directive->type = $type[0]; - } else { - throw new HTMLPurifier_ConfigSchema_Exception("TYPE in directive hash '$id' not defined"); - } - - if (isset($hash['DEFAULT'])) { - try { - $directive->default = $this->varParser->parse($hash->offsetGet('DEFAULT'), $directive->type, $directive->typeAllowsNull); - } catch (HTMLPurifier_VarParserException $e) { - throw new HTMLPurifier_ConfigSchema_Exception($e->getMessage() . " in DEFAULT in directive hash '$id'"); - } - } - - if (isset($hash['DESCRIPTION'])) { - $directive->description = $hash->offsetGet('DESCRIPTION'); - } - - if (isset($hash['ALLOWED'])) { - $directive->allowed = $this->lookup($this->evalArray($hash->offsetGet('ALLOWED'))); - } - - if (isset($hash['VALUE-ALIASES'])) { - $directive->valueAliases = $this->evalArray($hash->offsetGet('VALUE-ALIASES')); - } - - if (isset($hash['ALIASES'])) { - $raw_aliases = trim($hash->offsetGet('ALIASES')); - $aliases = preg_split('/\s*,\s*/', $raw_aliases); - foreach ($aliases as $alias) { - $directive->aliases[] = $this->id($alias); - } - } - - if (isset($hash['VERSION'])) { - $directive->version = $hash->offsetGet('VERSION'); - } - - if (isset($hash['DEPRECATED-USE'])) { - $directive->deprecatedUse = $this->id($hash->offsetGet('DEPRECATED-USE')); - } - - if (isset($hash['DEPRECATED-VERSION'])) { - $directive->deprecatedVersion = $hash->offsetGet('DEPRECATED-VERSION'); - } - - if (isset($hash['EXTERNAL'])) { - $directive->external = preg_split('/\s*,\s*/', trim($hash->offsetGet('EXTERNAL'))); - } - - $interchange->addDirective($directive); - } - - /** - * Evaluates an array PHP code string without array() wrapper - */ - protected function evalArray($contents) { - return eval('return array('. $contents .');'); - } - - /** - * Converts an array list into a lookup array. - */ - protected function lookup($array) { - $ret = array(); - foreach ($array as $val) $ret[$val] = true; - return $ret; - } - - /** - * Convenience function that creates an HTMLPurifier_ConfigSchema_Interchange_Id - * object based on a string Id. - */ - protected function id($id) { - return HTMLPurifier_ConfigSchema_Interchange_Id::make($id); - } - - /** - * Triggers errors for any unused keys passed in the hash; such keys - * may indicate typos, missing values, etc. - * @param $hash Instance of ConfigSchema_StringHash to check. - */ - protected function _findUnused($hash) { - $accessed = $hash->getAccessed(); - foreach ($hash as $k => $v) { - if (!isset($accessed[$k])) { - trigger_error("String hash key '$k' not used by builder", E_USER_NOTICE); - } - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Validator.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Validator.php deleted file mode 100644 index aed7be46..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/Validator.php +++ /dev/null @@ -1,206 +0,0 @@ -parser = new HTMLPurifier_VarParser(); - } - - /** - * Validates a fully-formed interchange object. Throws an - * HTMLPurifier_ConfigSchema_Exception if there's a problem. - */ - public function validate($interchange) { - $this->interchange = $interchange; - $this->aliases = array(); - // PHP is a bit lax with integer <=> string conversions in - // arrays, so we don't use the identical !== comparison - foreach ($interchange->directives as $i => $directive) { - $id = $directive->id->toString(); - if ($i != $id) $this->error(false, "Integrity violation: key '$i' does not match internal id '$id'"); - $this->validateDirective($directive); - } - return true; - } - - /** - * Validates a HTMLPurifier_ConfigSchema_Interchange_Id object. - */ - public function validateId($id) { - $id_string = $id->toString(); - $this->context[] = "id '$id_string'"; - if (!$id instanceof HTMLPurifier_ConfigSchema_Interchange_Id) { - // handled by InterchangeBuilder - $this->error(false, 'is not an instance of HTMLPurifier_ConfigSchema_Interchange_Id'); - } - // keys are now unconstrained (we might want to narrow down to A-Za-z0-9.) - // we probably should check that it has at least one namespace - $this->with($id, 'key') - ->assertNotEmpty() - ->assertIsString(); // implicit assertIsString handled by InterchangeBuilder - array_pop($this->context); - } - - /** - * Validates a HTMLPurifier_ConfigSchema_Interchange_Directive object. - */ - public function validateDirective($d) { - $id = $d->id->toString(); - $this->context[] = "directive '$id'"; - $this->validateId($d->id); - - $this->with($d, 'description') - ->assertNotEmpty(); - - // BEGIN - handled by InterchangeBuilder - $this->with($d, 'type') - ->assertNotEmpty(); - $this->with($d, 'typeAllowsNull') - ->assertIsBool(); - try { - // This also tests validity of $d->type - $this->parser->parse($d->default, $d->type, $d->typeAllowsNull); - } catch (HTMLPurifier_VarParserException $e) { - $this->error('default', 'had error: ' . $e->getMessage()); - } - // END - handled by InterchangeBuilder - - if (!is_null($d->allowed) || !empty($d->valueAliases)) { - // allowed and valueAliases require that we be dealing with - // strings, so check for that early. - $d_int = HTMLPurifier_VarParser::$types[$d->type]; - if (!isset(HTMLPurifier_VarParser::$stringTypes[$d_int])) { - $this->error('type', 'must be a string type when used with allowed or value aliases'); - } - } - - $this->validateDirectiveAllowed($d); - $this->validateDirectiveValueAliases($d); - $this->validateDirectiveAliases($d); - - array_pop($this->context); - } - - /** - * Extra validation if $allowed member variable of - * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. - */ - public function validateDirectiveAllowed($d) { - if (is_null($d->allowed)) return; - $this->with($d, 'allowed') - ->assertNotEmpty() - ->assertIsLookup(); // handled by InterchangeBuilder - if (is_string($d->default) && !isset($d->allowed[$d->default])) { - $this->error('default', 'must be an allowed value'); - } - $this->context[] = 'allowed'; - foreach ($d->allowed as $val => $x) { - if (!is_string($val)) $this->error("value $val", 'must be a string'); - } - array_pop($this->context); - } - - /** - * Extra validation if $valueAliases member variable of - * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. - */ - public function validateDirectiveValueAliases($d) { - if (is_null($d->valueAliases)) return; - $this->with($d, 'valueAliases') - ->assertIsArray(); // handled by InterchangeBuilder - $this->context[] = 'valueAliases'; - foreach ($d->valueAliases as $alias => $real) { - if (!is_string($alias)) $this->error("alias $alias", 'must be a string'); - if (!is_string($real)) $this->error("alias target $real from alias '$alias'", 'must be a string'); - if ($alias === $real) { - $this->error("alias '$alias'", "must not be an alias to itself"); - } - } - if (!is_null($d->allowed)) { - foreach ($d->valueAliases as $alias => $real) { - if (isset($d->allowed[$alias])) { - $this->error("alias '$alias'", 'must not be an allowed value'); - } elseif (!isset($d->allowed[$real])) { - $this->error("alias '$alias'", 'must be an alias to an allowed value'); - } - } - } - array_pop($this->context); - } - - /** - * Extra validation if $aliases member variable of - * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. - */ - public function validateDirectiveAliases($d) { - $this->with($d, 'aliases') - ->assertIsArray(); // handled by InterchangeBuilder - $this->context[] = 'aliases'; - foreach ($d->aliases as $alias) { - $this->validateId($alias); - $s = $alias->toString(); - if (isset($this->interchange->directives[$s])) { - $this->error("alias '$s'", 'collides with another directive'); - } - if (isset($this->aliases[$s])) { - $other_directive = $this->aliases[$s]; - $this->error("alias '$s'", "collides with alias for directive '$other_directive'"); - } - $this->aliases[$s] = $d->id->toString(); - } - array_pop($this->context); - } - - // protected helper functions - - /** - * Convenience function for generating HTMLPurifier_ConfigSchema_ValidatorAtom - * for validating simple member variables of objects. - */ - protected function with($obj, $member) { - return new HTMLPurifier_ConfigSchema_ValidatorAtom($this->getFormattedContext(), $obj, $member); - } - - /** - * Emits an error, providing helpful context. - */ - protected function error($target, $msg) { - if ($target !== false) $prefix = ucfirst($target) . ' in ' . $this->getFormattedContext(); - else $prefix = ucfirst($this->getFormattedContext()); - throw new HTMLPurifier_ConfigSchema_Exception(trim($prefix . ' ' . $msg)); - } - - /** - * Returns a formatted context string. - */ - protected function getFormattedContext() { - return implode(' in ', array_reverse($this->context)); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/ValidatorAtom.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/ValidatorAtom.php deleted file mode 100644 index 4c591fed..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/ValidatorAtom.php +++ /dev/null @@ -1,66 +0,0 @@ -context = $context; - $this->obj = $obj; - $this->member = $member; - $this->contents =& $obj->$member; - } - - public function assertIsString() { - if (!is_string($this->contents)) $this->error('must be a string'); - return $this; - } - - public function assertIsBool() { - if (!is_bool($this->contents)) $this->error('must be a boolean'); - return $this; - } - - public function assertIsArray() { - if (!is_array($this->contents)) $this->error('must be an array'); - return $this; - } - - public function assertNotNull() { - if ($this->contents === null) $this->error('must not be null'); - return $this; - } - - public function assertAlnum() { - $this->assertIsString(); - if (!ctype_alnum($this->contents)) $this->error('must be alphanumeric'); - return $this; - } - - public function assertNotEmpty() { - if (empty($this->contents)) $this->error('must not be empty'); - return $this; - } - - public function assertIsLookup() { - $this->assertIsArray(); - foreach ($this->contents as $v) { - if ($v !== true) $this->error('must be a lookup array'); - } - return $this; - } - - protected function error($msg) { - throw new HTMLPurifier_ConfigSchema_Exception(ucfirst($this->member) . ' in ' . $this->context . ' ' . $msg); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema.ser b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema.ser deleted file mode 100644 index 978089c6..00000000 Binary files a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema.ser and /dev/null differ diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt deleted file mode 100644 index 0517fed0..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt +++ /dev/null @@ -1,8 +0,0 @@ -Attr.AllowedClasses -TYPE: lookup/null -VERSION: 4.0.0 -DEFAULT: null ---DESCRIPTION-- -List of allowed class values in the class attribute. By default, this is null, -which means all classes are allowed. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt deleted file mode 100644 index 249edd64..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt +++ /dev/null @@ -1,12 +0,0 @@ -Attr.AllowedFrameTargets -TYPE: lookup -DEFAULT: array() ---DESCRIPTION-- -Lookup table of all allowed link frame targets. Some commonly used link -targets include _blank, _self, _parent and _top. Values should be -lowercase, as validation will be done in a case-sensitive manner despite -W3C's recommendation. XHTML 1.0 Strict does not permit the target attribute -so this directive will have no effect in that doctype. XHTML 1.1 does not -enable the Target module by default, you will have to manually enable it -(see the module documentation for more details.) ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt deleted file mode 100644 index 9a8fa6a2..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt +++ /dev/null @@ -1,9 +0,0 @@ -Attr.AllowedRel -TYPE: lookup -VERSION: 1.6.0 -DEFAULT: array() ---DESCRIPTION-- -List of allowed forward document relationships in the rel attribute. Common -values may be nofollow or print. By default, this is empty, meaning that no -document relationships are allowed. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt deleted file mode 100644 index b0178834..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt +++ /dev/null @@ -1,9 +0,0 @@ -Attr.AllowedRev -TYPE: lookup -VERSION: 1.6.0 -DEFAULT: array() ---DESCRIPTION-- -List of allowed reverse document relationships in the rev attribute. This -attribute is a bit of an edge-case; if you don't know what it is for, stay -away. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt deleted file mode 100644 index e774b823..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt +++ /dev/null @@ -1,19 +0,0 @@ -Attr.ClassUseCDATA -TYPE: bool/null -DEFAULT: null -VERSION: 4.0.0 ---DESCRIPTION-- -If null, class will auto-detect the doctype and, if matching XHTML 1.1 or -XHTML 2.0, will use the restrictive NMTOKENS specification of class. Otherwise, -it will use a relaxed CDATA definition. If true, the relaxed CDATA definition -is forced; if false, the NMTOKENS definition is forced. To get behavior -of HTML Purifier prior to 4.0.0, set this directive to false. - -Some rational behind the auto-detection: -in previous versions of HTML Purifier, it was assumed that the form of -class was NMTOKENS, as specified by the XHTML Modularization (representing -XHTML 1.1 and XHTML 2.0). The DTDs for HTML 4.01 and XHTML 1.0, however -specify class as CDATA. HTML 5 effectively defines it as CDATA, but -with the additional constraint that each name should be unique (this is not -explicitly outlined in previous specifications). ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt deleted file mode 100644 index 533165e1..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt +++ /dev/null @@ -1,11 +0,0 @@ -Attr.DefaultImageAlt -TYPE: string/null -DEFAULT: null -VERSION: 3.2.0 ---DESCRIPTION-- -This is the content of the alt tag of an image if the user had not -previously specified an alt attribute. This applies to all images without -a valid alt attribute, as opposed to %Attr.DefaultInvalidImageAlt, which -only applies to invalid images, and overrides in the case of an invalid image. -Default behavior with null is to use the basename of the src tag for the alt. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt deleted file mode 100644 index 9eb7e384..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt +++ /dev/null @@ -1,9 +0,0 @@ -Attr.DefaultInvalidImage -TYPE: string -DEFAULT: '' ---DESCRIPTION-- -This is the default image an img tag will be pointed to if it does not have -a valid src attribute. In future versions, we may allow the image tag to -be removed completely, but due to design issues, this is not possible right -now. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt deleted file mode 100644 index 2f17bf47..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt +++ /dev/null @@ -1,8 +0,0 @@ -Attr.DefaultInvalidImageAlt -TYPE: string -DEFAULT: 'Invalid image' ---DESCRIPTION-- -This is the content of the alt tag of an invalid image if the user had not -previously specified an alt attribute. It has no effect when the image is -valid but there was no alt attribute present. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt deleted file mode 100644 index 52654b53..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt +++ /dev/null @@ -1,10 +0,0 @@ -Attr.DefaultTextDir -TYPE: string -DEFAULT: 'ltr' ---DESCRIPTION-- -Defines the default text direction (ltr or rtl) of the document being -parsed. This generally is the same as the value of the dir attribute in -HTML, or ltr if that is not specified. ---ALLOWED-- -'ltr', 'rtl' ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt deleted file mode 100644 index 6440d210..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt +++ /dev/null @@ -1,16 +0,0 @@ -Attr.EnableID -TYPE: bool -DEFAULT: false -VERSION: 1.2.0 ---DESCRIPTION-- -Allows the ID attribute in HTML. This is disabled by default due to the -fact that without proper configuration user input can easily break the -validation of a webpage by specifying an ID that is already on the -surrounding HTML. If you don't mind throwing caution to the wind, enable -this directive, but I strongly recommend you also consider blacklisting IDs -you use (%Attr.IDBlacklist) or prefixing all user supplied IDs -(%Attr.IDPrefix). When set to true HTML Purifier reverts to the behavior of -pre-1.2.0 versions. ---ALIASES-- -HTML.EnableAttrID ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt deleted file mode 100644 index f31d226f..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt +++ /dev/null @@ -1,8 +0,0 @@ -Attr.ForbiddenClasses -TYPE: lookup -VERSION: 4.0.0 -DEFAULT: array() ---DESCRIPTION-- -List of forbidden class values in the class attribute. By default, this is -empty, which means that no classes are forbidden. See also %Attr.AllowedClasses. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklist.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklist.txt deleted file mode 100644 index 5f2b5e3d..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklist.txt +++ /dev/null @@ -1,5 +0,0 @@ -Attr.IDBlacklist -TYPE: list -DEFAULT: array() -DESCRIPTION: Array of IDs not allowed in the document. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt deleted file mode 100644 index 6f582458..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt +++ /dev/null @@ -1,9 +0,0 @@ -Attr.IDBlacklistRegexp -TYPE: string/null -VERSION: 1.6.0 -DEFAULT: NULL ---DESCRIPTION-- -PCRE regular expression to be matched against all IDs. If the expression is -matches, the ID is rejected. Use this with care: may cause significant -degradation. ID matching is done after all other validation. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt deleted file mode 100644 index cc49d43f..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt +++ /dev/null @@ -1,12 +0,0 @@ -Attr.IDPrefix -TYPE: string -VERSION: 1.2.0 -DEFAULT: '' ---DESCRIPTION-- -String to prefix to IDs. If you have no idea what IDs your pages may use, -you may opt to simply add a prefix to all user-submitted ID attributes so -that they are still usable, but will not conflict with core page IDs. -Example: setting the directive to 'user_' will result in a user submitted -'foo' to become 'user_foo' Be sure to set %HTML.EnableAttrID to true -before using this. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt deleted file mode 100644 index 2c5924a7..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt +++ /dev/null @@ -1,14 +0,0 @@ -Attr.IDPrefixLocal -TYPE: string -VERSION: 1.2.0 -DEFAULT: '' ---DESCRIPTION-- -Temporary prefix for IDs used in conjunction with %Attr.IDPrefix. If you -need to allow multiple sets of user content on web page, you may need to -have a seperate prefix that changes with each iteration. This way, -seperately submitted user content displayed on the same page doesn't -clobber each other. Ideal values are unique identifiers for the content it -represents (i.e. the id of the row in the database). Be sure to add a -seperator (like an underscore) at the end. Warning: this directive will -not work unless %Attr.IDPrefix is set to a non-empty value! ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt deleted file mode 100644 index d5caa1bb..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt +++ /dev/null @@ -1,31 +0,0 @@ -AutoFormat.AutoParagraph -TYPE: bool -VERSION: 2.0.1 -DEFAULT: false ---DESCRIPTION-- - -

      - This directive turns on auto-paragraphing, where double newlines are - converted in to paragraphs whenever possible. Auto-paragraphing: -

      -
        -
      • Always applies to inline elements or text in the root node,
      • -
      • Applies to inline elements or text with double newlines in nodes - that allow paragraph tags,
      • -
      • Applies to double newlines in paragraph tags
      • -
      -

      - p tags must be allowed for this directive to take effect. - We do not use br tags for paragraphing, as that is - semantically incorrect. -

      -

      - To prevent auto-paragraphing as a content-producer, refrain from using - double-newlines except to specify a new paragraph or in contexts where - it has special meaning (whitespace usually has no meaning except in - tags like pre, so this should not be difficult.) To prevent - the paragraphing of inline text adjacent to block elements, wrap them - in div tags (the behavior is slightly different outside of - the root node.) -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt deleted file mode 100644 index 2a476481..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt +++ /dev/null @@ -1,12 +0,0 @@ -AutoFormat.Custom -TYPE: list -VERSION: 2.0.1 -DEFAULT: array() ---DESCRIPTION-- - -

      - This directive can be used to add custom auto-format injectors. - Specify an array of injector names (class name minus the prefix) - or concrete implementations. Injector class must exist. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt deleted file mode 100644 index 663064a3..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt +++ /dev/null @@ -1,11 +0,0 @@ -AutoFormat.DisplayLinkURI -TYPE: bool -VERSION: 3.2.0 -DEFAULT: false ---DESCRIPTION-- -

      - This directive turns on the in-text display of URIs in <a> tags, and disables - those links. For example, example becomes - example (http://example.com). -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt deleted file mode 100644 index 3a48ba96..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt +++ /dev/null @@ -1,12 +0,0 @@ -AutoFormat.Linkify -TYPE: bool -VERSION: 2.0.1 -DEFAULT: false ---DESCRIPTION-- - -

      - This directive turns on linkification, auto-linking http, ftp and - https URLs. a tags with the href attribute - must be allowed. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt deleted file mode 100644 index db58b134..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt +++ /dev/null @@ -1,12 +0,0 @@ -AutoFormat.PurifierLinkify.DocURL -TYPE: string -VERSION: 2.0.1 -DEFAULT: '#%s' -ALIASES: AutoFormatParam.PurifierLinkifyDocURL ---DESCRIPTION-- -

      - Location of configuration documentation to link to, let %s substitute - into the configuration's namespace and directive names sans the percent - sign. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt deleted file mode 100644 index 7996488b..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt +++ /dev/null @@ -1,12 +0,0 @@ -AutoFormat.PurifierLinkify -TYPE: bool -VERSION: 2.0.1 -DEFAULT: false ---DESCRIPTION-- - -

      - Internal auto-formatter that converts configuration directives in - syntax %Namespace.Directive to links. a tags - with the href attribute must be allowed. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt deleted file mode 100644 index 35c393b4..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt +++ /dev/null @@ -1,11 +0,0 @@ -AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions -TYPE: lookup -VERSION: 4.0.0 -DEFAULT: array('td' => true, 'th' => true) ---DESCRIPTION-- -

      - When %AutoFormat.RemoveEmpty and %AutoFormat.RemoveEmpty.RemoveNbsp - are enabled, this directive defines what HTML elements should not be - removede if they have only a non-breaking space in them. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt deleted file mode 100644 index ca17eb1d..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt +++ /dev/null @@ -1,15 +0,0 @@ -AutoFormat.RemoveEmpty.RemoveNbsp -TYPE: bool -VERSION: 4.0.0 -DEFAULT: false ---DESCRIPTION-- -

      - When enabled, HTML Purifier will treat any elements that contain only - non-breaking spaces as well as regular whitespace as empty, and remove - them when %AutoForamt.RemoveEmpty is enabled. -

      -

      - See %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions for a list of elements - that don't have this behavior applied to them. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt deleted file mode 100644 index 34657ba4..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt +++ /dev/null @@ -1,46 +0,0 @@ -AutoFormat.RemoveEmpty -TYPE: bool -VERSION: 3.2.0 -DEFAULT: false ---DESCRIPTION-- -

      - When enabled, HTML Purifier will attempt to remove empty elements that - contribute no semantic information to the document. The following types - of nodes will be removed: -

      -
      • - Tags with no attributes and no content, and that are not empty - elements (remove <a></a> but not - <br />), and -
      • -
      • - Tags with no content, except for:
          -
        • The colgroup element, or
        • -
        • - Elements with the id or name attribute, - when those attributes are permitted on those elements. -
        • -
      • -
      -

      - Please be very careful when using this functionality; while it may not - seem that empty elements contain useful information, they can alter the - layout of a document given appropriate styling. This directive is most - useful when you are processing machine-generated HTML, please avoid using - it on regular user HTML. -

      -

      - Elements that contain only whitespace will be treated as empty. Non-breaking - spaces, however, do not count as whitespace. See - %AutoFormat.RemoveEmpty.RemoveNbsp for alternate behavior. -

      -

      - This algorithm is not perfect; you may still notice some empty tags, - particularly if a node had elements, but those elements were later removed - because they were not permitted in that context, or tags that, after - being auto-closed by another tag, where empty. This is for safety reasons - to prevent clever code from breaking validation. The general rule of thumb: - if a tag looked empty on the way in, it will get removed; if HTML Purifier - made it empty, it will stay. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt deleted file mode 100644 index dde990ab..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt +++ /dev/null @@ -1,11 +0,0 @@ -AutoFormat.RemoveSpansWithoutAttributes -TYPE: bool -VERSION: 4.0.1 -DEFAULT: false ---DESCRIPTION-- -

      - This directive causes span tags without any attributes - to be removed. It will also remove spans that had all attributes - removed during processing. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt deleted file mode 100644 index b324608f..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt +++ /dev/null @@ -1,8 +0,0 @@ -CSS.AllowImportant -TYPE: bool -DEFAULT: false -VERSION: 3.1.0 ---DESCRIPTION-- -This parameter determines whether or not !important cascade modifiers should -be allowed in user CSS. If false, !important will stripped. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt deleted file mode 100644 index 748be0ee..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt +++ /dev/null @@ -1,11 +0,0 @@ -CSS.AllowTricky -TYPE: bool -DEFAULT: false -VERSION: 3.1.0 ---DESCRIPTION-- -This parameter determines whether or not to allow "tricky" CSS properties and -values. Tricky CSS properties/values can drastically modify page layout or -be used for deceptive practices but do not directly constitute a security risk. -For example, display:none; is considered a tricky property that -will only be allowed if this directive is set to true. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt deleted file mode 100644 index 460112eb..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt +++ /dev/null @@ -1,18 +0,0 @@ -CSS.AllowedProperties -TYPE: lookup/null -VERSION: 3.1.0 -DEFAULT: NULL ---DESCRIPTION-- - -

      - If HTML Purifier's style attributes set is unsatisfactory for your needs, - you can overload it with your own list of tags to allow. Note that this - method is subtractive: it does its job by taking away from HTML Purifier - usual feature set, so you cannot add an attribute that HTML Purifier never - supported in the first place. -

      -

      - Warning: If another directive conflicts with the - elements here, that directive will win and override. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt deleted file mode 100644 index 5cb7dda3..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt +++ /dev/null @@ -1,11 +0,0 @@ -CSS.DefinitionRev -TYPE: int -VERSION: 2.0.0 -DEFAULT: 1 ---DESCRIPTION-- - -

      - Revision identifier for your custom definition. See - %HTML.DefinitionRev for details. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt deleted file mode 100644 index f1f5c5f1..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt +++ /dev/null @@ -1,13 +0,0 @@ -CSS.ForbiddenProperties -TYPE: lookup -VERSION: 4.2.0 -DEFAULT: array() ---DESCRIPTION-- -

      - This is the logical inverse of %CSS.AllowedProperties, and it will - override that directive or any other directive. If possible, - %CSS.AllowedProperties is recommended over this directive, - because it can sometimes be difficult to tell whether or not you've - forbidden all of the CSS properties you truly would like to disallow. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt deleted file mode 100644 index 7a329147..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt +++ /dev/null @@ -1,16 +0,0 @@ -CSS.MaxImgLength -TYPE: string/null -DEFAULT: '1200px' -VERSION: 3.1.1 ---DESCRIPTION-- -

      - This parameter sets the maximum allowed length on img tags, - effectively the width and height properties. - Only absolute units of measurement (in, pt, pc, mm, cm) and pixels (px) are allowed. This is - in place to prevent imagecrash attacks, disable with null at your own risk. - This directive is similar to %HTML.MaxImgLength, and both should be - concurrently edited, although there are - subtle differences in the input format (the CSS max is a number with - a unit). -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt deleted file mode 100644 index 148eedb8..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt +++ /dev/null @@ -1,10 +0,0 @@ -CSS.Proprietary -TYPE: bool -VERSION: 3.0.0 -DEFAULT: false ---DESCRIPTION-- - -

      - Whether or not to allow safe, proprietary CSS values. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt deleted file mode 100644 index c486724c..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt +++ /dev/null @@ -1,14 +0,0 @@ -Cache.DefinitionImpl -TYPE: string/null -VERSION: 2.0.0 -DEFAULT: 'Serializer' ---DESCRIPTION-- - -This directive defines which method to use when caching definitions, -the complex data-type that makes HTML Purifier tick. Set to null -to disable caching (not recommended, as you will see a definite -performance degradation). - ---ALIASES-- -Core.DefinitionCache ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt deleted file mode 100644 index 54036507..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt +++ /dev/null @@ -1,13 +0,0 @@ -Cache.SerializerPath -TYPE: string/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

      - Absolute path with no trailing slash to store serialized definitions in. - Default is within the - HTML Purifier library inside DefinitionCache/Serializer. This - path must be writable by the webserver. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt deleted file mode 100644 index 568cbf3b..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt +++ /dev/null @@ -1,18 +0,0 @@ -Core.AggressivelyFixLt -TYPE: bool -VERSION: 2.1.0 -DEFAULT: true ---DESCRIPTION-- -

      - This directive enables aggressive pre-filter fixes HTML Purifier can - perform in order to ensure that open angled-brackets do not get killed - during parsing stage. Enabling this will result in two preg_replace_callback - calls and at least two preg_replace calls for every HTML document parsed; - if your users make very well-formed HTML, you can set this directive false. - This has no effect when DirectLex is used. -

      -

      - Notice: This directive's default turned from false to true - in HTML Purifier 3.2.0. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt deleted file mode 100644 index d7317911..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt +++ /dev/null @@ -1,12 +0,0 @@ -Core.CollectErrors -TYPE: bool -VERSION: 2.0.0 -DEFAULT: false ---DESCRIPTION-- - -Whether or not to collect errors found while filtering the document. This -is a useful way to give feedback to your users. Warning: -Currently this feature is very patchy and experimental, with lots of -possible error messages not yet implemented. It will not cause any -problems, but it may not help your users either. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt deleted file mode 100644 index 08b381d3..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt +++ /dev/null @@ -1,28 +0,0 @@ -Core.ColorKeywords -TYPE: hash -VERSION: 2.0.0 ---DEFAULT-- -array ( - 'maroon' => '#800000', - 'red' => '#FF0000', - 'orange' => '#FFA500', - 'yellow' => '#FFFF00', - 'olive' => '#808000', - 'purple' => '#800080', - 'fuchsia' => '#FF00FF', - 'white' => '#FFFFFF', - 'lime' => '#00FF00', - 'green' => '#008000', - 'navy' => '#000080', - 'blue' => '#0000FF', - 'aqua' => '#00FFFF', - 'teal' => '#008080', - 'black' => '#000000', - 'silver' => '#C0C0C0', - 'gray' => '#808080', -) ---DESCRIPTION-- - -Lookup array of color names to six digit hexadecimal number corresponding -to color, with preceding hash mark. Used when parsing colors. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt deleted file mode 100644 index 64b114fc..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt +++ /dev/null @@ -1,14 +0,0 @@ -Core.ConvertDocumentToFragment -TYPE: bool -DEFAULT: true ---DESCRIPTION-- - -This parameter determines whether or not the filter should convert -input that is a full document with html and body tags to a fragment -of just the contents of a body tag. This parameter is simply something -HTML Purifier can do during an edge-case: for most inputs, this -processing is not necessary. - ---ALIASES-- -Core.AcceptFullDocuments ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt deleted file mode 100644 index 36f16e07..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt +++ /dev/null @@ -1,17 +0,0 @@ -Core.DirectLexLineNumberSyncInterval -TYPE: int -VERSION: 2.0.0 -DEFAULT: 0 ---DESCRIPTION-- - -

      - Specifies the number of tokens the DirectLex line number tracking - implementations should process before attempting to resyncronize the - current line count by manually counting all previous new-lines. When - at 0, this functionality is disabled. Lower values will decrease - performance, and this is only strictly necessary if the counting - algorithm is buggy (in which case you should report it as a bug). - This has no effect when %Core.MaintainLineNumbers is disabled or DirectLex is - not being used. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt deleted file mode 100644 index 8bfb47c3..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt +++ /dev/null @@ -1,15 +0,0 @@ -Core.Encoding -TYPE: istring -DEFAULT: 'utf-8' ---DESCRIPTION-- -If for some reason you are unable to convert all webpages to UTF-8, you can -use this directive as a stop-gap compatibility change to let HTML Purifier -deal with non UTF-8 input. This technique has notable deficiencies: -absolutely no characters outside of the selected character encoding will be -preserved, not even the ones that have been ampersand escaped (this is due -to a UTF-8 specific feature that automatically resolves all -entities), making it pretty useless for anything except the most I18N-blind -applications, although %Core.EscapeNonASCIICharacters offers fixes this -trouble with another tradeoff. This directive only accepts ISO-8859-1 if -iconv is not enabled. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt deleted file mode 100644 index 4d5b5055..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt +++ /dev/null @@ -1,10 +0,0 @@ -Core.EscapeInvalidChildren -TYPE: bool -DEFAULT: false ---DESCRIPTION-- -When true, a child is found that is not allowed in the context of the -parent element will be transformed into text as if it were ASCII. When -false, that element and all internal tags will be dropped, though text will -be preserved. There is no option for dropping the element but preserving -child nodes. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt deleted file mode 100644 index a7a5b249..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt +++ /dev/null @@ -1,7 +0,0 @@ -Core.EscapeInvalidTags -TYPE: bool -DEFAULT: false ---DESCRIPTION-- -When true, invalid tags will be written back to the document as plain text. -Otherwise, they are silently dropped. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt deleted file mode 100644 index abb49994..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt +++ /dev/null @@ -1,13 +0,0 @@ -Core.EscapeNonASCIICharacters -TYPE: bool -VERSION: 1.4.0 -DEFAULT: false ---DESCRIPTION-- -This directive overcomes a deficiency in %Core.Encoding by blindly -converting all non-ASCII characters into decimal numeric entities before -converting it to its native encoding. This means that even characters that -can be expressed in the non-UTF-8 encoding will be entity-ized, which can -be a real downer for encodings like Big5. It also assumes that the ASCII -repetoire is available, although this is the case for almost all encodings. -Anyway, use UTF-8! ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt deleted file mode 100644 index 915391ed..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt +++ /dev/null @@ -1,19 +0,0 @@ -Core.HiddenElements -TYPE: lookup ---DEFAULT-- -array ( - 'script' => true, - 'style' => true, -) ---DESCRIPTION-- - -

      - This directive is a lookup array of elements which should have their - contents removed when they are not allowed by the HTML definition. - For example, the contents of a script tag are not - normally shown in a document, so if script tags are to be removed, - their contents should be removed to. This is opposed to a b - tag, which defines some presentational changes but does not hide its - contents. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.Language.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.Language.txt deleted file mode 100644 index 233fca14..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.Language.txt +++ /dev/null @@ -1,10 +0,0 @@ -Core.Language -TYPE: string -VERSION: 2.0.0 -DEFAULT: 'en' ---DESCRIPTION-- - -ISO 639 language code for localizable things in HTML Purifier to use, -which is mainly error reporting. There is currently only an English (en) -translation, so this directive is currently useless. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt deleted file mode 100644 index 8983e2cc..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt +++ /dev/null @@ -1,34 +0,0 @@ -Core.LexerImpl -TYPE: mixed/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

      - This parameter determines what lexer implementation can be used. The - valid values are: -

      -
      -
      null
      -
      - Recommended, the lexer implementation will be auto-detected based on - your PHP-version and configuration. -
      -
      string lexer identifier
      -
      - This is a slim way of manually overridding the implementation. - Currently recognized values are: DOMLex (the default PHP5 -implementation) - and DirectLex (the default PHP4 implementation). Only use this if - you know what you are doing: usually, the auto-detection will - manage things for cases you aren't even aware of. -
      -
      object lexer instance
      -
      - Super-advanced: you can specify your own, custom, implementation that - implements the interface defined by HTMLPurifier_Lexer. - I may remove this option simply because I don't expect anyone - to use it. -
      -
      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt deleted file mode 100644 index eb841a75..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt +++ /dev/null @@ -1,16 +0,0 @@ -Core.MaintainLineNumbers -TYPE: bool/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

      - If true, HTML Purifier will add line number information to all tokens. - This is useful when error reporting is turned on, but can result in - significant performance degradation and should not be used when - unnecessary. This directive must be used with the DirectLex lexer, - as the DOMLex lexer does not (yet) support this functionality. - If the value is null, an appropriate value will be selected based - on other configuration. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt deleted file mode 100644 index d77f5360..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt +++ /dev/null @@ -1,11 +0,0 @@ -Core.NormalizeNewlines -TYPE: bool -VERSION: 4.2.0 -DEFAULT: true ---DESCRIPTION-- -

      - Whether or not to normalize newlines to the operating - system default. When false, HTML Purifier - will attempt to preserve mixed newline files. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt deleted file mode 100644 index 4070c2a0..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt +++ /dev/null @@ -1,12 +0,0 @@ -Core.RemoveInvalidImg -TYPE: bool -DEFAULT: true -VERSION: 1.3.0 ---DESCRIPTION-- - -

      - This directive enables pre-emptive URI checking in img - tags, as the attribute validation strategy is not authorized to - remove elements from the document. Revert to pre-1.3.0 behavior by setting to false. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt deleted file mode 100644 index 3397d9f7..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt +++ /dev/null @@ -1,11 +0,0 @@ -Core.RemoveProcessingInstructions -TYPE: bool -VERSION: 4.2.0 -DEFAULT: false ---DESCRIPTION-- -Instead of escaping processing instructions in the form <? ... -?>, remove it out-right. This may be useful if the HTML -you are validating contains XML processing instruction gunk, however, -it can also be user-unfriendly for people attempting to post PHP -snippets. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt deleted file mode 100644 index a4cd966d..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt +++ /dev/null @@ -1,12 +0,0 @@ -Core.RemoveScriptContents -TYPE: bool/null -DEFAULT: NULL -VERSION: 2.0.0 -DEPRECATED-VERSION: 2.1.0 -DEPRECATED-USE: Core.HiddenElements ---DESCRIPTION-- -

      - This directive enables HTML Purifier to remove not only script tags - but all of their contents. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt deleted file mode 100644 index 3db50ef2..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt +++ /dev/null @@ -1,11 +0,0 @@ -Filter.Custom -TYPE: list -VERSION: 3.1.0 -DEFAULT: array() ---DESCRIPTION-- -

      - This directive can be used to add custom filters; it is nearly the - equivalent of the now deprecated HTMLPurifier->addFilter() - method. Specify an array of concrete implementations. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt deleted file mode 100644 index 16829bcd..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt +++ /dev/null @@ -1,14 +0,0 @@ -Filter.ExtractStyleBlocks.Escaping -TYPE: bool -VERSION: 3.0.0 -DEFAULT: true -ALIASES: Filter.ExtractStyleBlocksEscaping, FilterParam.ExtractStyleBlocksEscaping ---DESCRIPTION-- - -

      - Whether or not to escape the dangerous characters <, > and & - as \3C, \3E and \26, respectively. This is can be safely set to false - if the contents of StyleBlocks will be placed in an external stylesheet, - where there is no risk of it being interpreted as HTML. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt deleted file mode 100644 index 7f95f54d..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt +++ /dev/null @@ -1,29 +0,0 @@ -Filter.ExtractStyleBlocks.Scope -TYPE: string/null -VERSION: 3.0.0 -DEFAULT: NULL -ALIASES: Filter.ExtractStyleBlocksScope, FilterParam.ExtractStyleBlocksScope ---DESCRIPTION-- - -

      - If you would like users to be able to define external stylesheets, but - only allow them to specify CSS declarations for a specific node and - prevent them from fiddling with other elements, use this directive. - It accepts any valid CSS selector, and will prepend this to any - CSS declaration extracted from the document. For example, if this - directive is set to #user-content and a user uses the - selector a:hover, the final selector will be - #user-content a:hover. -

      -

      - The comma shorthand may be used; consider the above example, with - #user-content, #user-content2, the final selector will - be #user-content a:hover, #user-content2 a:hover. -

      -

      - Warning: It is possible for users to bypass this measure - using a naughty + selector. This is a bug in CSS Tidy 1.3, not HTML - Purifier, and I am working to get it fixed. Until then, HTML Purifier - performs a basic check to prevent this. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt deleted file mode 100644 index 6c231b2d..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt +++ /dev/null @@ -1,16 +0,0 @@ -Filter.ExtractStyleBlocks.TidyImpl -TYPE: mixed/null -VERSION: 3.1.0 -DEFAULT: NULL -ALIASES: FilterParam.ExtractStyleBlocksTidyImpl ---DESCRIPTION-- -

      - If left NULL, HTML Purifier will attempt to instantiate a csstidy - class to use for internal cleaning. This will usually be good enough. -

      -

      - However, for trusted user input, you can set this to false to - disable cleaning. In addition, you can supply your own concrete implementation - of Tidy's interface to use, although I don't know why you'd want to do that. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt deleted file mode 100644 index 078d0874..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt +++ /dev/null @@ -1,74 +0,0 @@ -Filter.ExtractStyleBlocks -TYPE: bool -VERSION: 3.1.0 -DEFAULT: false -EXTERNAL: CSSTidy ---DESCRIPTION-- -

      - This directive turns on the style block extraction filter, which removes - style blocks from input HTML, cleans them up with CSSTidy, - and places them in the StyleBlocks context variable, for further - use by you, usually to be placed in an external stylesheet, or a - style block in the head of your document. -

      -

      - Sample usage: -

      -
      ';
      -?>
      -
      -
      -
      -  Filter.ExtractStyleBlocks
      -body {color:#F00;} Some text';
      -
      -    $config = HTMLPurifier_Config::createDefault();
      -    $config->set('Filter', 'ExtractStyleBlocks', true);
      -    $purifier = new HTMLPurifier($config);
      -
      -    $html = $purifier->purify($dirty);
      -
      -    // This implementation writes the stylesheets to the styles/ directory.
      -    // You can also echo the styles inside the document, but it's a bit
      -    // more difficult to make sure they get interpreted properly by
      -    // browsers; try the usual CSS armoring techniques.
      -    $styles = $purifier->context->get('StyleBlocks');
      -    $dir = 'styles/';
      -    if (!is_dir($dir)) mkdir($dir);
      -    $hash = sha1($_GET['html']);
      -    foreach ($styles as $i => $style) {
      -        file_put_contents($name = $dir . $hash . "_$i");
      -        echo '';
      -    }
      -?>
      -
      -
      -  
      - -
      - - -]]>
      -

      - Warning: It is possible for a user to mount an - imagecrash attack using this CSS. Counter-measures are difficult; - it is not simply enough to limit the range of CSS lengths (using - relative lengths with many nesting levels allows for large values - to be attained without actually specifying them in the stylesheet), - and the flexible nature of selectors makes it difficult to selectively - disable lengths on image tags (HTML Purifier, however, does disable - CSS width and height in inline styling). There are probably two effective - counter measures: an explicit width and height set to auto in all - images in your document (unlikely) or the disabling of width and - height (somewhat reasonable). Whether or not these measures should be - used is left to the reader. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt deleted file mode 100644 index 321eaa2d..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt +++ /dev/null @@ -1,16 +0,0 @@ -Filter.YouTube -TYPE: bool -VERSION: 3.1.0 -DEFAULT: false ---DESCRIPTION-- -

      - Warning: Deprecated in favor of %HTML.SafeObject and - %Output.FlashCompat (turn both on to allow YouTube videos and other - Flash content). -

      -

      - This directive enables YouTube video embedding in HTML Purifier. Check - this document - on embedding videos for more information on what this filter does. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt deleted file mode 100644 index 0b2c106d..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt +++ /dev/null @@ -1,25 +0,0 @@ -HTML.Allowed -TYPE: itext/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

      - This is a preferred convenience directive that combines - %HTML.AllowedElements and %HTML.AllowedAttributes. - Specify elements and attributes that are allowed using: - element1[attr1|attr2],element2.... For example, - if you would like to only allow paragraphs and links, specify - a[href],p. You can specify attributes that apply - to all elements using an asterisk, e.g. *[lang]. - You can also use newlines instead of commas to separate elements. -

      -

      - Warning: - All of the constraints on the component directives are still enforced. - The syntax is a subset of TinyMCE's valid_elements - whitelist: directly copy-pasting it here will probably result in - broken whitelists. If %HTML.AllowedElements or %HTML.AllowedAttributes - are set, this directive has no effect. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt deleted file mode 100644 index fcf093f1..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt +++ /dev/null @@ -1,19 +0,0 @@ -HTML.AllowedAttributes -TYPE: lookup/null -VERSION: 1.3.0 -DEFAULT: NULL ---DESCRIPTION-- - -

      - If HTML Purifier's attribute set is unsatisfactory, overload it! - The syntax is "tag.attr" or "*.attr" for the global attributes - (style, id, class, dir, lang, xml:lang). -

      -

      - Warning: If another directive conflicts with the - elements here, that directive will win and override. For - example, %HTML.EnableAttrID will take precedence over *.id in this - directive. You must set that directive to true before you can use - IDs at all. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt deleted file mode 100644 index 1d3fa790..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt +++ /dev/null @@ -1,23 +0,0 @@ -HTML.AllowedElements -TYPE: lookup/null -VERSION: 1.3.0 -DEFAULT: NULL ---DESCRIPTION-- -

      - If HTML Purifier's tag set is unsatisfactory for your needs, you can - overload it with your own list of tags to allow. If you change - this, you probably also want to change %HTML.AllowedAttributes; see - also %HTML.Allowed which lets you set allowed elements and - attributes at the same time. -

      -

      - If you attempt to allow an element that HTML Purifier does not know - about, HTML Purifier will raise an error. You will need to manually - tell HTML Purifier about this element by using the - advanced customization features. -

      -

      - Warning: If another directive conflicts with the - elements here, that directive will win and override. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt deleted file mode 100644 index 5a59a55c..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt +++ /dev/null @@ -1,20 +0,0 @@ -HTML.AllowedModules -TYPE: lookup/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

      - A doctype comes with a set of usual modules to use. Without having - to mucking about with the doctypes, you can quickly activate or - disable these modules by specifying which modules you wish to allow - with this directive. This is most useful for unit testing specific - modules, although end users may find it useful for their own ends. -

      -

      - If you specify a module that does not exist, the manager will silently - fail to use it, so be careful! User-defined modules are not affected - by this directive. Modules defined in %HTML.CoreModules are not - affected by this directive. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt deleted file mode 100644 index 151fb7b8..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTML.Attr.Name.UseCDATA -TYPE: bool -DEFAULT: false -VERSION: 4.0.0 ---DESCRIPTION-- -The W3C specification DTD defines the name attribute to be CDATA, not ID, due -to limitations of DTD. In certain documents, this relaxed behavior is desired, -whether it is to specify duplicate names, or to specify names that would be -illegal IDs (for example, names that begin with a digit.) Set this configuration -directive to true to use the relaxed parsing rules. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt deleted file mode 100644 index 45ae469e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt +++ /dev/null @@ -1,18 +0,0 @@ -HTML.BlockWrapper -TYPE: string -VERSION: 1.3.0 -DEFAULT: 'p' ---DESCRIPTION-- - -

      - String name of element to wrap inline elements that are inside a block - context. This only occurs in the children of blockquote in strict mode. -

      -

      - Example: by default value, - <blockquote>Foo</blockquote> would become - <blockquote><p>Foo</p></blockquote>. - The <p> tags can be replaced with whatever you desire, - as long as it is a block level element. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt deleted file mode 100644 index 52461887..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt +++ /dev/null @@ -1,23 +0,0 @@ -HTML.CoreModules -TYPE: lookup -VERSION: 2.0.0 ---DEFAULT-- -array ( - 'Structure' => true, - 'Text' => true, - 'Hypertext' => true, - 'List' => true, - 'NonXMLCommonAttributes' => true, - 'XMLCommonAttributes' => true, - 'CommonAttributes' => true, -) ---DESCRIPTION-- - -

      - Certain modularized doctypes (XHTML, namely), have certain modules - that must be included for the doctype to be an conforming document - type: put those modules here. By default, XHTML's core modules - are used. You can set this to a blank array to disable core module - protection, but this is not recommended. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt deleted file mode 100644 index a64e3d7c..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt +++ /dev/null @@ -1,9 +0,0 @@ -HTML.CustomDoctype -TYPE: string/null -VERSION: 2.0.1 -DEFAULT: NULL ---DESCRIPTION-- - -A custom doctype for power-users who defined there own document -type. This directive only applies when %HTML.Doctype is blank. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt deleted file mode 100644 index 103db754..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt +++ /dev/null @@ -1,33 +0,0 @@ -HTML.DefinitionID -TYPE: string/null -DEFAULT: NULL -VERSION: 2.0.0 ---DESCRIPTION-- - -

      - Unique identifier for a custom-built HTML definition. If you edit - the raw version of the HTMLDefinition, introducing changes that the - configuration object does not reflect, you must specify this variable. - If you change your custom edits, you should change this directive, or - clear your cache. Example: -

      -
      -$config = HTMLPurifier_Config::createDefault();
      -$config->set('HTML', 'DefinitionID', '1');
      -$def = $config->getHTMLDefinition();
      -$def->addAttribute('a', 'tabindex', 'Number');
      -
      -

      - In the above example, the configuration is still at the defaults, but - using the advanced API, an extra attribute has been added. The - configuration object normally has no way of knowing that this change - has taken place, so it needs an extra directive: %HTML.DefinitionID. - If someone else attempts to use the default configuration, these two - pieces of code will not clobber each other in the cache, since one has - an extra directive attached to it. -

      -

      - You must specify a value to this directive to use the - advanced API features. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt deleted file mode 100644 index 229ae026..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt +++ /dev/null @@ -1,16 +0,0 @@ -HTML.DefinitionRev -TYPE: int -VERSION: 2.0.0 -DEFAULT: 1 ---DESCRIPTION-- - -

      - Revision identifier for your custom definition specified in - %HTML.DefinitionID. This serves the same purpose: uniquely identifying - your custom definition, but this one does so in a chronological - context: revision 3 is more up-to-date then revision 2. Thus, when - this gets incremented, the cache handling is smart enough to clean - up any older revisions of your definition as well as flush the - cache. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt deleted file mode 100644 index 9dab497f..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTML.Doctype -TYPE: string/null -DEFAULT: NULL ---DESCRIPTION-- -Doctype to use during filtering. Technically speaking this is not actually -a doctype (as it does not identify a corresponding DTD), but we are using -this name for sake of simplicity. When non-blank, this will override any -older directives like %HTML.XHTML or %HTML.Strict. ---ALLOWED-- -'HTML 4.01 Transitional', 'HTML 4.01 Strict', 'XHTML 1.0 Transitional', 'XHTML 1.0 Strict', 'XHTML 1.1' ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt deleted file mode 100644 index 7878dc0b..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTML.FlashAllowFullScreen -TYPE: bool -VERSION: 4.2.0 -DEFAULT: false ---DESCRIPTION-- -

      - Whether or not to permit embedded Flash content from - %HTML.SafeObject to expand to the full screen. Corresponds to - the allowFullScreen parameter. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt deleted file mode 100644 index 57358f9b..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt +++ /dev/null @@ -1,21 +0,0 @@ -HTML.ForbiddenAttributes -TYPE: lookup -VERSION: 3.1.0 -DEFAULT: array() ---DESCRIPTION-- -

      - While this directive is similar to %HTML.AllowedAttributes, for - forwards-compatibility with XML, this attribute has a different syntax. Instead of - tag.attr, use tag@attr. To disallow href - attributes in a tags, set this directive to - a@href. You can also disallow an attribute globally with - attr or *@attr (either syntax is fine; the latter - is provided for consistency with %HTML.AllowedAttributes). -

      -

      - Warning: This directive complements %HTML.ForbiddenElements, - accordingly, check - out that directive for a discussion of why you - should think twice before using this directive. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt deleted file mode 100644 index 93a53e14..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt +++ /dev/null @@ -1,20 +0,0 @@ -HTML.ForbiddenElements -TYPE: lookup -VERSION: 3.1.0 -DEFAULT: array() ---DESCRIPTION-- -

      - This was, perhaps, the most requested feature ever in HTML - Purifier. Please don't abuse it! This is the logical inverse of - %HTML.AllowedElements, and it will override that directive, or any - other directive. -

      -

      - If possible, %HTML.Allowed is recommended over this directive, because it - can sometimes be difficult to tell whether or not you've forbidden all of - the behavior you would like to disallow. If you forbid img - with the expectation of preventing images on your site, you'll be in for - a nasty surprise when people start using the background-image - CSS property. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt deleted file mode 100644 index e424c386..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt +++ /dev/null @@ -1,14 +0,0 @@ -HTML.MaxImgLength -TYPE: int/null -DEFAULT: 1200 -VERSION: 3.1.1 ---DESCRIPTION-- -

      - This directive controls the maximum number of pixels in the width and - height attributes in img tags. This is - in place to prevent imagecrash attacks, disable with null at your own risk. - This directive is similar to %CSS.MaxImgLength, and both should be - concurrently edited, although there are - subtle differences in the input format (the HTML max is an integer). -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt deleted file mode 100644 index 62e8e160..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt +++ /dev/null @@ -1,12 +0,0 @@ -HTML.Parent -TYPE: string -VERSION: 1.3.0 -DEFAULT: 'div' ---DESCRIPTION-- - -

      - String name of element that HTML fragment passed to library will be - inserted in. An interesting variation would be using span as the - parent element, meaning that only inline tags would be allowed. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt deleted file mode 100644 index dfb72049..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt +++ /dev/null @@ -1,12 +0,0 @@ -HTML.Proprietary -TYPE: bool -VERSION: 3.1.0 -DEFAULT: false ---DESCRIPTION-- -

      - Whether or not to allow proprietary elements and attributes in your - documents, as per HTMLPurifier_HTMLModule_Proprietary. - Warning: This can cause your documents to stop - validating! -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt deleted file mode 100644 index cdda09a4..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt +++ /dev/null @@ -1,13 +0,0 @@ -HTML.SafeEmbed -TYPE: bool -VERSION: 3.1.1 -DEFAULT: false ---DESCRIPTION-- -

      - Whether or not to permit embed tags in documents, with a number of extra - security features added to prevent script execution. This is similar to - what websites like MySpace do to embed tags. Embed is a proprietary - element and will cause your website to stop validating; you should - see if you can use %Output.FlashCompat with %HTML.SafeObject instead - first.

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt deleted file mode 100644 index ceb342e2..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt +++ /dev/null @@ -1,13 +0,0 @@ -HTML.SafeObject -TYPE: bool -VERSION: 3.1.1 -DEFAULT: false ---DESCRIPTION-- -

      - Whether or not to permit object tags in documents, with a number of extra - security features added to prevent script execution. This is similar to - what websites like MySpace do to object tags. You should also enable - %Output.FlashCompat in order to generate Internet Explorer - compatibility code for your object tags. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt deleted file mode 100644 index a8b1de56..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt +++ /dev/null @@ -1,9 +0,0 @@ -HTML.Strict -TYPE: bool -VERSION: 1.3.0 -DEFAULT: false -DEPRECATED-VERSION: 1.7.0 -DEPRECATED-USE: HTML.Doctype ---DESCRIPTION-- -Determines whether or not to use Transitional (loose) or Strict rulesets. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt deleted file mode 100644 index b4c271b7..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTML.TidyAdd -TYPE: lookup -VERSION: 2.0.0 -DEFAULT: array() ---DESCRIPTION-- - -Fixes to add to the default set of Tidy fixes as per your level. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt deleted file mode 100644 index 4186ccd0..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt +++ /dev/null @@ -1,24 +0,0 @@ -HTML.TidyLevel -TYPE: string -VERSION: 2.0.0 -DEFAULT: 'medium' ---DESCRIPTION-- - -

      General level of cleanliness the Tidy module should enforce. -There are four allowed values:

      -
      -
      none
      -
      No extra tidying should be done
      -
      light
      -
      Only fix elements that would be discarded otherwise due to - lack of support in doctype
      -
      medium
      -
      Enforce best practices
      -
      heavy
      -
      Transform all deprecated elements and attributes to standards - compliant equivalents
      -
      - ---ALLOWED-- -'none', 'light', 'medium', 'heavy' ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt deleted file mode 100644 index 996762bd..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTML.TidyRemove -TYPE: lookup -VERSION: 2.0.0 -DEFAULT: array() ---DESCRIPTION-- - -Fixes to remove from the default set of Tidy fixes as per your level. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt deleted file mode 100644 index 89133b1a..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt +++ /dev/null @@ -1,8 +0,0 @@ -HTML.Trusted -TYPE: bool -VERSION: 2.0.0 -DEFAULT: false ---DESCRIPTION-- -Indicates whether or not the user input is trusted or not. If the input is -trusted, a more expansive set of allowed tags and attributes will be used. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt deleted file mode 100644 index 2a47e384..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt +++ /dev/null @@ -1,11 +0,0 @@ -HTML.XHTML -TYPE: bool -DEFAULT: true -VERSION: 1.1.0 -DEPRECATED-VERSION: 1.7.0 -DEPRECATED-USE: HTML.Doctype ---DESCRIPTION-- -Determines whether or not output is XHTML 1.0 or HTML 4.01 flavor. ---ALIASES-- -Core.XHTML ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt deleted file mode 100644 index 08921fde..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt +++ /dev/null @@ -1,10 +0,0 @@ -Output.CommentScriptContents -TYPE: bool -VERSION: 2.0.0 -DEFAULT: true ---DESCRIPTION-- -Determines whether or not HTML Purifier should attempt to fix up the -contents of script tags for legacy browsers with comments. ---ALIASES-- -Core.CommentScriptContents ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt deleted file mode 100644 index 93398e85..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt +++ /dev/null @@ -1,11 +0,0 @@ -Output.FlashCompat -TYPE: bool -VERSION: 4.1.0 -DEFAULT: false ---DESCRIPTION-- -

      - If true, HTML Purifier will generate Internet Explorer compatibility - code for all object code. This is highly recommended if you enable - %HTML.SafeObject. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt deleted file mode 100644 index 79f8ad82..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt +++ /dev/null @@ -1,13 +0,0 @@ -Output.Newline -TYPE: string/null -VERSION: 2.0.1 -DEFAULT: NULL ---DESCRIPTION-- - -

      - Newline string to format final output with. If left null, HTML Purifier - will auto-detect the default newline type of the system and use that; - you can manually override it here. Remember, \r\n is Windows, \r - is Mac, and \n is Unix. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt deleted file mode 100644 index 232b0236..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt +++ /dev/null @@ -1,14 +0,0 @@ -Output.SortAttr -TYPE: bool -VERSION: 3.2.0 -DEFAULT: false ---DESCRIPTION-- -

      - If true, HTML Purifier will sort attributes by name before writing them back - to the document, converting a tag like: <el b="" a="" c="" /> - to <el a="" b="" c="" />. This is a workaround for - a bug in FCKeditor which causes it to swap attributes order, adding noise - to text diffs. If you're not seeing this bug, chances are, you don't need - this directive. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt deleted file mode 100644 index 06bab00a..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt +++ /dev/null @@ -1,25 +0,0 @@ -Output.TidyFormat -TYPE: bool -VERSION: 1.1.1 -DEFAULT: false ---DESCRIPTION-- -

      - Determines whether or not to run Tidy on the final output for pretty - formatting reasons, such as indentation and wrap. -

      -

      - This can greatly improve readability for editors who are hand-editing - the HTML, but is by no means necessary as HTML Purifier has already - fixed all major errors the HTML may have had. Tidy is a non-default - extension, and this directive will silently fail if Tidy is not - available. -

      -

      - If you are looking to make the overall look of your page's source - better, I recommend running Tidy on the entire page rather than just - user-content (after all, the indentation relative to the containing - blocks will be incorrect). -

      ---ALIASES-- -Core.TidyFormat ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt deleted file mode 100644 index 071bc029..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt +++ /dev/null @@ -1,7 +0,0 @@ -Test.ForceNoIconv -TYPE: bool -DEFAULT: false ---DESCRIPTION-- -When set to true, HTMLPurifier_Encoder will act as if iconv does not exist -and use only pure PHP implementations. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt deleted file mode 100644 index 666635a5..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt +++ /dev/null @@ -1,17 +0,0 @@ -URI.AllowedSchemes -TYPE: lookup ---DEFAULT-- -array ( - 'http' => true, - 'https' => true, - 'mailto' => true, - 'ftp' => true, - 'nntp' => true, - 'news' => true, -) ---DESCRIPTION-- -Whitelist that defines the schemes that a URI is allowed to have. This -prevents XSS attacks from using pseudo-schemes like javascript or mocha. -There is also support for the data and file -URI schemes, but they are not enabled by default. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.Base.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.Base.txt deleted file mode 100644 index 876f0680..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.Base.txt +++ /dev/null @@ -1,17 +0,0 @@ -URI.Base -TYPE: string/null -VERSION: 2.1.0 -DEFAULT: NULL ---DESCRIPTION-- - -

      - The base URI is the URI of the document this purified HTML will be - inserted into. This information is important if HTML Purifier needs - to calculate absolute URIs from relative URIs, such as when %URI.MakeAbsolute - is on. You may use a non-absolute URI for this value, but behavior - may vary (%URI.MakeAbsolute deals nicely with both absolute and - relative paths, but forwards-compatibility is not guaranteed). - Warning: If set, the scheme on this URI - overrides the one specified by %URI.DefaultScheme. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt deleted file mode 100644 index 728e378c..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt +++ /dev/null @@ -1,10 +0,0 @@ -URI.DefaultScheme -TYPE: string -DEFAULT: 'http' ---DESCRIPTION-- - -

      - Defines through what scheme the output will be served, in order to - select the proper object validator when no scheme information is present. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt deleted file mode 100644 index f05312ba..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt +++ /dev/null @@ -1,11 +0,0 @@ -URI.DefinitionID -TYPE: string/null -VERSION: 2.1.0 -DEFAULT: NULL ---DESCRIPTION-- - -

      - Unique identifier for a custom-built URI definition. If you want - to add custom URIFilters, you must specify this value. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt deleted file mode 100644 index 80cfea93..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt +++ /dev/null @@ -1,11 +0,0 @@ -URI.DefinitionRev -TYPE: int -VERSION: 2.1.0 -DEFAULT: 1 ---DESCRIPTION-- - -

      - Revision identifier for your custom definition. See - %HTML.DefinitionRev for details. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt deleted file mode 100644 index 71ce025a..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt +++ /dev/null @@ -1,14 +0,0 @@ -URI.Disable -TYPE: bool -VERSION: 1.3.0 -DEFAULT: false ---DESCRIPTION-- - -

      - Disables all URIs in all forms. Not sure why you'd want to do that - (after all, the Internet's founded on the notion of a hyperlink). -

      - ---ALIASES-- -Attr.DisableURI ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt deleted file mode 100644 index 13c122c8..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt +++ /dev/null @@ -1,11 +0,0 @@ -URI.DisableExternal -TYPE: bool -VERSION: 1.2.0 -DEFAULT: false ---DESCRIPTION-- -Disables links to external websites. This is a highly effective anti-spam -and anti-pagerank-leech measure, but comes at a hefty price: nolinks or -images outside of your domain will be allowed. Non-linkified URIs will -still be preserved. If you want to be able to link to subdomains or use -absolute URIs, specify %URI.Host for your website. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt deleted file mode 100644 index abcc1efd..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt +++ /dev/null @@ -1,13 +0,0 @@ -URI.DisableExternalResources -TYPE: bool -VERSION: 1.3.0 -DEFAULT: false ---DESCRIPTION-- -Disables the embedding of external resources, preventing users from -embedding things like images from other hosts. This prevents access -tracking (good for email viewers), bandwidth leeching, cross-site request -forging, goatse.cx posting, and other nasties, but also results in a loss -of end-user functionality (they can't directly post a pic they posted from -Flickr anymore). Use it if you don't have a robust user-content moderation -team. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt deleted file mode 100644 index f891de49..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt +++ /dev/null @@ -1,15 +0,0 @@ -URI.DisableResources -TYPE: bool -VERSION: 4.2.0 -DEFAULT: false ---DESCRIPTION-- -

      - Disables embedding resources, essentially meaning no pictures. You can - still link to them though. See %URI.DisableExternalResources for why - this might be a good idea. -

      -

      - Note: While this directive has been available since 1.3.0, - it didn't actually start doing anything until 4.2.0. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.Host.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.Host.txt deleted file mode 100644 index ee83b121..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.Host.txt +++ /dev/null @@ -1,19 +0,0 @@ -URI.Host -TYPE: string/null -VERSION: 1.2.0 -DEFAULT: NULL ---DESCRIPTION-- - -

      - Defines the domain name of the server, so we can determine whether or - an absolute URI is from your website or not. Not strictly necessary, - as users should be using relative URIs to reference resources on your - website. It will, however, let you use absolute URIs to link to - subdomains of the domain you post here: i.e. example.com will allow - sub.example.com. However, higher up domains will still be excluded: - if you set %URI.Host to sub.example.com, example.com will be blocked. - Note: This directive overrides %URI.Base because - a given page may be on a sub-domain, but you wish HTML Purifier to be - more relaxed and allow some of the parent domains too. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt deleted file mode 100644 index 0b6df762..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt +++ /dev/null @@ -1,9 +0,0 @@ -URI.HostBlacklist -TYPE: list -VERSION: 1.3.0 -DEFAULT: array() ---DESCRIPTION-- -List of strings that are forbidden in the host of any URI. Use it to kill -domain names of spam, etc. Note that it will catch anything in the domain, -so moo.com will catch moo.com.example.com. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt deleted file mode 100644 index 4214900a..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt +++ /dev/null @@ -1,13 +0,0 @@ -URI.MakeAbsolute -TYPE: bool -VERSION: 2.1.0 -DEFAULT: false ---DESCRIPTION-- - -

      - Converts all URIs into absolute forms. This is useful when the HTML - being filtered assumes a specific base path, but will actually be - viewed in a different context (and setting an alternate base URI is - not possible). %URI.Base must be set for this directive to work. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt deleted file mode 100644 index 58c81dcc..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt +++ /dev/null @@ -1,83 +0,0 @@ -URI.Munge -TYPE: string/null -VERSION: 1.3.0 -DEFAULT: NULL ---DESCRIPTION-- - -

      - Munges all browsable (usually http, https and ftp) - absolute URIs into another URI, usually a URI redirection service. - This directive accepts a URI, formatted with a %s where - the url-encoded original URI should be inserted (sample: - http://www.google.com/url?q=%s). -

      -

      - Uses for this directive: -

      -
        -
      • - Prevent PageRank leaks, while being fairly transparent - to users (you may also want to add some client side JavaScript to - override the text in the statusbar). Notice: - Many security experts believe that this form of protection does not deter spam-bots. -
      • -
      • - Redirect users to a splash page telling them they are leaving your - website. While this is poor usability practice, it is often mandated - in corporate environments. -
      • -
      -

      - Prior to HTML Purifier 3.1.1, this directive also enabled the munging - of browsable external resources, which could break things if your redirection - script was a splash page or used meta tags. To revert to - previous behavior, please use %URI.MungeResources. -

      -

      - You may want to also use %URI.MungeSecretKey along with this directive - in order to enforce what URIs your redirector script allows. Open - redirector scripts can be a security risk and negatively affect the - reputation of your domain name. -

      -

      - Starting with HTML Purifier 3.1.1, there is also these substitutions: -

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      KeyDescriptionExample <a href="">
      %r1 - The URI embeds a resource
      (blank) - The URI is merely a link
      %nThe name of the tag this URI came froma
      %mThe name of the attribute this URI came fromhref
      %pThe name of the CSS property this URI came from, or blank if irrelevant
      -

      - Admittedly, these letters are somewhat arbitrary; the only stipulation - was that they couldn't be a through f. r is for resource (I would have preferred - e, but you take what you can get), n is for name, m - was picked because it came after n (and I couldn't use a), p is for - property. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt deleted file mode 100644 index 6fce0fdc..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt +++ /dev/null @@ -1,17 +0,0 @@ -URI.MungeResources -TYPE: bool -VERSION: 3.1.1 -DEFAULT: false ---DESCRIPTION-- -

      - If true, any URI munging directives like %URI.Munge - will also apply to embedded resources, such as <img src="">. - Be careful enabling this directive if you have a redirector script - that does not use the Location HTTP header; all of your images - and other embedded resources will break. -

      -

      - Warning: It is strongly advised you use this in conjunction - %URI.MungeSecretKey to mitigate the security risk of an open redirector. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt deleted file mode 100644 index 0d00f62e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt +++ /dev/null @@ -1,30 +0,0 @@ -URI.MungeSecretKey -TYPE: string/null -VERSION: 3.1.1 -DEFAULT: NULL ---DESCRIPTION-- -

      - This directive enables secure checksum generation along with %URI.Munge. - It should be set to a secure key that is not shared with anyone else. - The checksum can be placed in the URI using %t. Use of this checksum - affords an additional level of protection by allowing a redirector - to check if a URI has passed through HTML Purifier with this line: -

      - -
      $checksum === sha1($secret_key . ':' . $url)
      - -

      - If the output is TRUE, the redirector script should accept the URI. -

      - -

      - Please note that it would still be possible for an attacker to procure - secure hashes en-mass by abusing your website's Preview feature or the - like, but this service affords an additional level of protection - that should be combined with website blacklisting. -

      - -

      - Remember this has no effect if %URI.Munge is not on. -

      ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt deleted file mode 100644 index 23331a4e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt +++ /dev/null @@ -1,9 +0,0 @@ -URI.OverrideAllowedSchemes -TYPE: bool -DEFAULT: true ---DESCRIPTION-- -If this is set to true (which it is by default), you can override -%URI.AllowedSchemes by simply registering a HTMLPurifier_URIScheme to the -registry. If false, you will also have to update that directive in order -to add more schemes. ---# vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/info.ini b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/info.ini deleted file mode 100644 index 5de4505e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ConfigSchema/schema/info.ini +++ /dev/null @@ -1,3 +0,0 @@ -name = "HTML Purifier" - -; vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ContentSets.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ContentSets.php deleted file mode 100644 index dce28289..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ContentSets.php +++ /dev/null @@ -1,155 +0,0 @@ - true) indexed by name. - * @note This is in HTMLPurifier_HTMLDefinition->info_content_sets - */ - public $lookup = array(); - - /** - * Synchronized list of defined content sets (keys of info) - */ - protected $keys = array(); - /** - * Synchronized list of defined content values (values of info) - */ - protected $values = array(); - - /** - * Merges in module's content sets, expands identifiers in the content - * sets and populates the keys, values and lookup member variables. - * @param $modules List of HTMLPurifier_HTMLModule - */ - public function __construct($modules) { - if (!is_array($modules)) $modules = array($modules); - // populate content_sets based on module hints - // sorry, no way of overloading - foreach ($modules as $module_i => $module) { - foreach ($module->content_sets as $key => $value) { - $temp = $this->convertToLookup($value); - if (isset($this->lookup[$key])) { - // add it into the existing content set - $this->lookup[$key] = array_merge($this->lookup[$key], $temp); - } else { - $this->lookup[$key] = $temp; - } - } - } - $old_lookup = false; - while ($old_lookup !== $this->lookup) { - $old_lookup = $this->lookup; - foreach ($this->lookup as $i => $set) { - $add = array(); - foreach ($set as $element => $x) { - if (isset($this->lookup[$element])) { - $add += $this->lookup[$element]; - unset($this->lookup[$i][$element]); - } - } - $this->lookup[$i] += $add; - } - } - - foreach ($this->lookup as $key => $lookup) { - $this->info[$key] = implode(' | ', array_keys($lookup)); - } - $this->keys = array_keys($this->info); - $this->values = array_values($this->info); - } - - /** - * Accepts a definition; generates and assigns a ChildDef for it - * @param $def HTMLPurifier_ElementDef reference - * @param $module Module that defined the ElementDef - */ - public function generateChildDef(&$def, $module) { - if (!empty($def->child)) return; // already done! - $content_model = $def->content_model; - if (is_string($content_model)) { - // Assume that $this->keys is alphanumeric - $def->content_model = preg_replace_callback( - '/\b(' . implode('|', $this->keys) . ')\b/', - array($this, 'generateChildDefCallback'), - $content_model - ); - //$def->content_model = str_replace( - // $this->keys, $this->values, $content_model); - } - $def->child = $this->getChildDef($def, $module); - } - - public function generateChildDefCallback($matches) { - return $this->info[$matches[0]]; - } - - /** - * Instantiates a ChildDef based on content_model and content_model_type - * member variables in HTMLPurifier_ElementDef - * @note This will also defer to modules for custom HTMLPurifier_ChildDef - * subclasses that need content set expansion - * @param $def HTMLPurifier_ElementDef to have ChildDef extracted - * @return HTMLPurifier_ChildDef corresponding to ElementDef - */ - public function getChildDef($def, $module) { - $value = $def->content_model; - if (is_object($value)) { - trigger_error( - 'Literal object child definitions should be stored in '. - 'ElementDef->child not ElementDef->content_model', - E_USER_NOTICE - ); - return $value; - } - switch ($def->content_model_type) { - case 'required': - return new HTMLPurifier_ChildDef_Required($value); - case 'optional': - return new HTMLPurifier_ChildDef_Optional($value); - case 'empty': - return new HTMLPurifier_ChildDef_Empty(); - case 'custom': - return new HTMLPurifier_ChildDef_Custom($value); - } - // defer to its module - $return = false; - if ($module->defines_child_def) { // save a func call - $return = $module->getChildDef($def); - } - if ($return !== false) return $return; - // error-out - trigger_error( - 'Could not determine which ChildDef class to instantiate', - E_USER_ERROR - ); - return false; - } - - /** - * Converts a string list of elements separated by pipes into - * a lookup array. - * @param $string List of elements - * @return Lookup array of elements - */ - protected function convertToLookup($string) { - $array = explode('|', str_replace(' ', '', $string)); - $ret = array(); - foreach ($array as $i => $k) { - $ret[$k] = true; - } - return $ret; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Context.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Context.php deleted file mode 100644 index 92d31582..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Context.php +++ /dev/null @@ -1,82 +0,0 @@ -_storage[$name])) { - trigger_error("Name $name produces collision, cannot re-register", - E_USER_ERROR); - return; - } - $this->_storage[$name] =& $ref; - } - - /** - * Retrieves a variable reference from the context. - * @param $name String name - * @param $ignore_error Boolean whether or not to ignore error - */ - public function &get($name, $ignore_error = false) { - if (!isset($this->_storage[$name])) { - if (!$ignore_error) { - trigger_error("Attempted to retrieve non-existent variable $name", - E_USER_ERROR); - } - $var = null; // so we can return by reference - return $var; - } - return $this->_storage[$name]; - } - - /** - * Destorys a variable in the context. - * @param $name String name - */ - public function destroy($name) { - if (!isset($this->_storage[$name])) { - trigger_error("Attempted to destroy non-existent variable $name", - E_USER_ERROR); - return; - } - unset($this->_storage[$name]); - } - - /** - * Checks whether or not the variable exists. - * @param $name String name - */ - public function exists($name) { - return isset($this->_storage[$name]); - } - - /** - * Loads a series of variables from an associative array - * @param $context_array Assoc array of variables to load - */ - public function loadArray($context_array) { - foreach ($context_array as $key => $discard) { - $this->register($key, $context_array[$key]); - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Definition.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Definition.php deleted file mode 100644 index fa758a19..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Definition.php +++ /dev/null @@ -1,39 +0,0 @@ -setup) return; - $this->setup = true; - $this->doSetup($config); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache.php deleted file mode 100644 index bb03e72d..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache.php +++ /dev/null @@ -1,108 +0,0 @@ -type = $type; - } - - /** - * Generates a unique identifier for a particular configuration - * @param Instance of HTMLPurifier_Config - */ - public function generateKey($config) { - return $config->version . ',' . // possibly replace with function calls - $config->getBatchSerial($this->type) . ',' . - $config->get($this->type . '.DefinitionRev'); - } - - /** - * Tests whether or not a key is old with respect to the configuration's - * version and revision number. - * @param $key Key to test - * @param $config Instance of HTMLPurifier_Config to test against - */ - public function isOld($key, $config) { - if (substr_count($key, ',') < 2) return true; - list($version, $hash, $revision) = explode(',', $key, 3); - $compare = version_compare($version, $config->version); - // version mismatch, is always old - if ($compare != 0) return true; - // versions match, ids match, check revision number - if ( - $hash == $config->getBatchSerial($this->type) && - $revision < $config->get($this->type . '.DefinitionRev') - ) return true; - return false; - } - - /** - * Checks if a definition's type jives with the cache's type - * @note Throws an error on failure - * @param $def Definition object to check - * @return Boolean true if good, false if not - */ - public function checkDefType($def) { - if ($def->type !== $this->type) { - trigger_error("Cannot use definition of type {$def->type} in cache for {$this->type}"); - return false; - } - return true; - } - - /** - * Adds a definition object to the cache - */ - abstract public function add($def, $config); - - /** - * Unconditionally saves a definition object to the cache - */ - abstract public function set($def, $config); - - /** - * Replace an object in the cache - */ - abstract public function replace($def, $config); - - /** - * Retrieves a definition object from the cache - */ - abstract public function get($config); - - /** - * Removes a definition object to the cache - */ - abstract public function remove($config); - - /** - * Clears all objects from cache - */ - abstract public function flush($config); - - /** - * Clears all expired (older version or revision) objects from cache - * @note Be carefuly implementing this method as flush. Flush must - * not interfere with other Definition types, and cleanup() - * should not be repeatedly called by userland code. - */ - abstract public function cleanup($config); - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache/Decorator.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache/Decorator.php deleted file mode 100644 index 2b2dffb3..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache/Decorator.php +++ /dev/null @@ -1,62 +0,0 @@ -copy(); - // reference is necessary for mocks in PHP 4 - $decorator->cache =& $cache; - $decorator->type = $cache->type; - return $decorator; - } - - /** - * Cross-compatible clone substitute - */ - public function copy() { - return new HTMLPurifier_DefinitionCache_Decorator(); - } - - public function add($def, $config) { - return $this->cache->add($def, $config); - } - - public function set($def, $config) { - return $this->cache->set($def, $config); - } - - public function replace($def, $config) { - return $this->cache->replace($def, $config); - } - - public function get($config) { - return $this->cache->get($config); - } - - public function remove($config) { - return $this->cache->remove($config); - } - - public function flush($config) { - return $this->cache->flush($config); - } - - public function cleanup($config) { - return $this->cache->cleanup($config); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php deleted file mode 100644 index 5ff42414..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php +++ /dev/null @@ -1,43 +0,0 @@ -definitions[$this->generateKey($config)] = $def; - return $status; - } - - public function set($def, $config) { - $status = parent::set($def, $config); - if ($status) $this->definitions[$this->generateKey($config)] = $def; - return $status; - } - - public function replace($def, $config) { - $status = parent::replace($def, $config); - if ($status) $this->definitions[$this->generateKey($config)] = $def; - return $status; - } - - public function get($config) { - $key = $this->generateKey($config); - if (isset($this->definitions[$key])) return $this->definitions[$key]; - $this->definitions[$key] = parent::get($config); - return $this->definitions[$key]; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache/Decorator/Template.php.in b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache/Decorator/Template.php.in deleted file mode 100644 index 21a8fcfd..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache/Decorator/Template.php.in +++ /dev/null @@ -1,47 +0,0 @@ -checkDefType($def)) return; - $file = $this->generateFilePath($config); - if (file_exists($file)) return false; - if (!$this->_prepareDir($config)) return false; - return $this->_write($file, serialize($def)); - } - - public function set($def, $config) { - if (!$this->checkDefType($def)) return; - $file = $this->generateFilePath($config); - if (!$this->_prepareDir($config)) return false; - return $this->_write($file, serialize($def)); - } - - public function replace($def, $config) { - if (!$this->checkDefType($def)) return; - $file = $this->generateFilePath($config); - if (!file_exists($file)) return false; - if (!$this->_prepareDir($config)) return false; - return $this->_write($file, serialize($def)); - } - - public function get($config) { - $file = $this->generateFilePath($config); - if (!file_exists($file)) return false; - return unserialize(file_get_contents($file)); - } - - public function remove($config) { - $file = $this->generateFilePath($config); - if (!file_exists($file)) return false; - return unlink($file); - } - - public function flush($config) { - if (!$this->_prepareDir($config)) return false; - $dir = $this->generateDirectoryPath($config); - $dh = opendir($dir); - while (false !== ($filename = readdir($dh))) { - if (empty($filename)) continue; - if ($filename[0] === '.') continue; - unlink($dir . '/' . $filename); - } - } - - public function cleanup($config) { - if (!$this->_prepareDir($config)) return false; - $dir = $this->generateDirectoryPath($config); - $dh = opendir($dir); - while (false !== ($filename = readdir($dh))) { - if (empty($filename)) continue; - if ($filename[0] === '.') continue; - $key = substr($filename, 0, strlen($filename) - 4); - if ($this->isOld($key, $config)) unlink($dir . '/' . $filename); - } - } - - /** - * Generates the file path to the serial file corresponding to - * the configuration and definition name - * @todo Make protected - */ - public function generateFilePath($config) { - $key = $this->generateKey($config); - return $this->generateDirectoryPath($config) . '/' . $key . '.ser'; - } - - /** - * Generates the path to the directory contain this cache's serial files - * @note No trailing slash - * @todo Make protected - */ - public function generateDirectoryPath($config) { - $base = $this->generateBaseDirectoryPath($config); - return $base . '/' . $this->type; - } - - /** - * Generates path to base directory that contains all definition type - * serials - * @todo Make protected - */ - public function generateBaseDirectoryPath($config) { - $base = $config->get('Cache.SerializerPath'); - $base = is_null($base) ? HTMLPURIFIER_PREFIX . '/HTMLPurifier/DefinitionCache/Serializer' : $base; - return $base; - } - - /** - * Convenience wrapper function for file_put_contents - * @param $file File name to write to - * @param $data Data to write into file - * @return Number of bytes written if success, or false if failure. - */ - private function _write($file, $data) { - return file_put_contents($file, $data); - } - - /** - * Prepares the directory that this type stores the serials in - * @return True if successful - */ - private function _prepareDir($config) { - $directory = $this->generateDirectoryPath($config); - if (!is_dir($directory)) { - $base = $this->generateBaseDirectoryPath($config); - if (!is_dir($base)) { - trigger_error('Base directory '.$base.' does not exist, - please create or change using %Cache.SerializerPath', - E_USER_WARNING); - return false; - } elseif (!$this->_testPermissions($base)) { - return false; - } - $old = umask(0022); // disable group and world writes - mkdir($directory); - umask($old); - } elseif (!$this->_testPermissions($directory)) { - return false; - } - return true; - } - - /** - * Tests permissions on a directory and throws out friendly - * error messages and attempts to chmod it itself if possible - */ - private function _testPermissions($dir) { - // early abort, if it is writable, everything is hunky-dory - if (is_writable($dir)) return true; - if (!is_dir($dir)) { - // generally, you'll want to handle this beforehand - // so a more specific error message can be given - trigger_error('Directory '.$dir.' does not exist', - E_USER_WARNING); - return false; - } - if (function_exists('posix_getuid')) { - // POSIX system, we can give more specific advice - if (fileowner($dir) === posix_getuid()) { - // we can chmod it ourselves - chmod($dir, 0755); - return true; - } elseif (filegroup($dir) === posix_getgid()) { - $chmod = '775'; - } else { - // PHP's probably running as nobody, so we'll - // need to give global permissions - $chmod = '777'; - } - trigger_error('Directory '.$dir.' not writable, '. - 'please chmod to ' . $chmod, - E_USER_WARNING); - } else { - // generic error message - trigger_error('Directory '.$dir.' not writable, '. - 'please alter file permissions', - E_USER_WARNING); - } - return false; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache/Serializer/README b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache/Serializer/README deleted file mode 100755 index 2e35c1c3..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCache/Serializer/README +++ /dev/null @@ -1,3 +0,0 @@ -This is a dummy file to prevent Git from ignoring this empty directory. - - vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCacheFactory.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCacheFactory.php deleted file mode 100644 index 24814cda..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DefinitionCacheFactory.php +++ /dev/null @@ -1,91 +0,0 @@ - array()); - protected $implementations = array(); - protected $decorators = array(); - - /** - * Initialize default decorators - */ - public function setup() { - $this->addDecorator('Cleanup'); - } - - /** - * Retrieves an instance of global definition cache factory. - */ - public static function instance($prototype = null) { - static $instance; - if ($prototype !== null) { - $instance = $prototype; - } elseif ($instance === null || $prototype === true) { - $instance = new HTMLPurifier_DefinitionCacheFactory(); - $instance->setup(); - } - return $instance; - } - - /** - * Registers a new definition cache object - * @param $short Short name of cache object, for reference - * @param $long Full class name of cache object, for construction - */ - public function register($short, $long) { - $this->implementations[$short] = $long; - } - - /** - * Factory method that creates a cache object based on configuration - * @param $name Name of definitions handled by cache - * @param $config Instance of HTMLPurifier_Config - */ - public function create($type, $config) { - $method = $config->get('Cache.DefinitionImpl'); - if ($method === null) { - return new HTMLPurifier_DefinitionCache_Null($type); - } - if (!empty($this->caches[$method][$type])) { - return $this->caches[$method][$type]; - } - if ( - isset($this->implementations[$method]) && - class_exists($class = $this->implementations[$method], false) - ) { - $cache = new $class($type); - } else { - if ($method != 'Serializer') { - trigger_error("Unrecognized DefinitionCache $method, using Serializer instead", E_USER_WARNING); - } - $cache = new HTMLPurifier_DefinitionCache_Serializer($type); - } - foreach ($this->decorators as $decorator) { - $new_cache = $decorator->decorate($cache); - // prevent infinite recursion in PHP 4 - unset($cache); - $cache = $new_cache; - } - $this->caches[$method][$type] = $cache; - return $this->caches[$method][$type]; - } - - /** - * Registers a decorator to add to all new cache objects - * @param - */ - public function addDecorator($decorator) { - if (is_string($decorator)) { - $class = "HTMLPurifier_DefinitionCache_Decorator_$decorator"; - $decorator = new $class; - } - $this->decorators[$decorator->name] = $decorator; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Doctype.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Doctype.php deleted file mode 100644 index ab417793..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Doctype.php +++ /dev/null @@ -1,60 +0,0 @@ -renderDoctype. - * If structure changes, please update that function. - */ -class HTMLPurifier_Doctype -{ - /** - * Full name of doctype - */ - public $name; - - /** - * List of standard modules (string identifiers or literal objects) - * that this doctype uses - */ - public $modules = array(); - - /** - * List of modules to use for tidying up code - */ - public $tidyModules = array(); - - /** - * Is the language derived from XML (i.e. XHTML)? - */ - public $xml = true; - - /** - * List of aliases for this doctype - */ - public $aliases = array(); - - /** - * Public DTD identifier - */ - public $dtdPublic; - - /** - * System DTD identifier - */ - public $dtdSystem; - - public function __construct($name = null, $xml = true, $modules = array(), - $tidyModules = array(), $aliases = array(), $dtd_public = null, $dtd_system = null - ) { - $this->name = $name; - $this->xml = $xml; - $this->modules = $modules; - $this->tidyModules = $tidyModules; - $this->aliases = $aliases; - $this->dtdPublic = $dtd_public; - $this->dtdSystem = $dtd_system; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DoctypeRegistry.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DoctypeRegistry.php deleted file mode 100644 index bb685761..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/DoctypeRegistry.php +++ /dev/null @@ -1,103 +0,0 @@ -doctypes[$doctype->name] = $doctype; - $name = $doctype->name; - // hookup aliases - foreach ($doctype->aliases as $alias) { - if (isset($this->doctypes[$alias])) continue; - $this->aliases[$alias] = $name; - } - // remove old aliases - if (isset($this->aliases[$name])) unset($this->aliases[$name]); - return $doctype; - } - - /** - * Retrieves reference to a doctype of a certain name - * @note This function resolves aliases - * @note When possible, use the more fully-featured make() - * @param $doctype Name of doctype - * @return Editable doctype object - */ - public function get($doctype) { - if (isset($this->aliases[$doctype])) $doctype = $this->aliases[$doctype]; - if (!isset($this->doctypes[$doctype])) { - trigger_error('Doctype ' . htmlspecialchars($doctype) . ' does not exist', E_USER_ERROR); - $anon = new HTMLPurifier_Doctype($doctype); - return $anon; - } - return $this->doctypes[$doctype]; - } - - /** - * Creates a doctype based on a configuration object, - * will perform initialization on the doctype - * @note Use this function to get a copy of doctype that config - * can hold on to (this is necessary in order to tell - * Generator whether or not the current document is XML - * based or not). - */ - public function make($config) { - return clone $this->get($this->getDoctypeFromConfig($config)); - } - - /** - * Retrieves the doctype from the configuration object - */ - public function getDoctypeFromConfig($config) { - // recommended test - $doctype = $config->get('HTML.Doctype'); - if (!empty($doctype)) return $doctype; - $doctype = $config->get('HTML.CustomDoctype'); - if (!empty($doctype)) return $doctype; - // backwards-compatibility - if ($config->get('HTML.XHTML')) { - $doctype = 'XHTML 1.0'; - } else { - $doctype = 'HTML 4.01'; - } - if ($config->get('HTML.Strict')) { - $doctype .= ' Strict'; - } else { - $doctype .= ' Transitional'; - } - return $doctype; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ElementDef.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ElementDef.php deleted file mode 100644 index cbd4e345..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ElementDef.php +++ /dev/null @@ -1,183 +0,0 @@ -setup(), this array may also - * contain an array at index 0 that indicates which attribute - * collections to load into the full array. It may also - * contain string indentifiers in lieu of HTMLPurifier_AttrDef, - * see HTMLPurifier_AttrTypes on how they are expanded during - * HTMLPurifier_HTMLDefinition->setup() processing. - */ - public $attr = array(); - - /** - * Indexed list of tag's HTMLPurifier_AttrTransform to be done before validation - */ - public $attr_transform_pre = array(); - - /** - * Indexed list of tag's HTMLPurifier_AttrTransform to be done after validation - */ - public $attr_transform_post = array(); - - /** - * HTMLPurifier_ChildDef of this tag. - */ - public $child; - - /** - * Abstract string representation of internal ChildDef rules. See - * HTMLPurifier_ContentSets for how this is parsed and then transformed - * into an HTMLPurifier_ChildDef. - * @warning This is a temporary variable that is not available after - * being processed by HTMLDefinition - */ - public $content_model; - - /** - * Value of $child->type, used to determine which ChildDef to use, - * used in combination with $content_model. - * @warning This must be lowercase - * @warning This is a temporary variable that is not available after - * being processed by HTMLDefinition - */ - public $content_model_type; - - - - /** - * Does the element have a content model (#PCDATA | Inline)*? This - * is important for chameleon ins and del processing in - * HTMLPurifier_ChildDef_Chameleon. Dynamically set: modules don't - * have to worry about this one. - */ - public $descendants_are_inline = false; - - /** - * List of the names of required attributes this element has. Dynamically - * populated by HTMLPurifier_HTMLDefinition::getElement - */ - public $required_attr = array(); - - /** - * Lookup table of tags excluded from all descendants of this tag. - * @note SGML permits exclusions for all descendants, but this is - * not possible with DTDs or XML Schemas. W3C has elected to - * use complicated compositions of content_models to simulate - * exclusion for children, but we go the simpler, SGML-style - * route of flat-out exclusions, which correctly apply to - * all descendants and not just children. Note that the XHTML - * Modularization Abstract Modules are blithely unaware of such - * distinctions. - */ - public $excludes = array(); - - /** - * This tag is explicitly auto-closed by the following tags. - */ - public $autoclose = array(); - - /** - * If a foreign element is found in this element, test if it is - * allowed by this sub-element; if it is, instead of closing the - * current element, place it inside this element. - */ - public $wrap; - - /** - * Whether or not this is a formatting element affected by the - * "Active Formatting Elements" algorithm. - */ - public $formatting; - - /** - * Low-level factory constructor for creating new standalone element defs - */ - public static function create($content_model, $content_model_type, $attr) { - $def = new HTMLPurifier_ElementDef(); - $def->content_model = $content_model; - $def->content_model_type = $content_model_type; - $def->attr = $attr; - return $def; - } - - /** - * Merges the values of another element definition into this one. - * Values from the new element def take precedence if a value is - * not mergeable. - */ - public function mergeIn($def) { - - // later keys takes precedence - foreach($def->attr as $k => $v) { - if ($k === 0) { - // merge in the includes - // sorry, no way to override an include - foreach ($v as $v2) { - $this->attr[0][] = $v2; - } - continue; - } - if ($v === false) { - if (isset($this->attr[$k])) unset($this->attr[$k]); - continue; - } - $this->attr[$k] = $v; - } - $this->_mergeAssocArray($this->attr_transform_pre, $def->attr_transform_pre); - $this->_mergeAssocArray($this->attr_transform_post, $def->attr_transform_post); - $this->_mergeAssocArray($this->excludes, $def->excludes); - - if(!empty($def->content_model)) { - $this->content_model = - str_replace("#SUPER", $this->content_model, $def->content_model); - $this->child = false; - } - if(!empty($def->content_model_type)) { - $this->content_model_type = $def->content_model_type; - $this->child = false; - } - if(!is_null($def->child)) $this->child = $def->child; - if(!is_null($def->formatting)) $this->formatting = $def->formatting; - if($def->descendants_are_inline) $this->descendants_are_inline = $def->descendants_are_inline; - - } - - /** - * Merges one array into another, removes values which equal false - * @param $a1 Array by reference that is merged into - * @param $a2 Array that merges into $a1 - */ - private function _mergeAssocArray(&$a1, $a2) { - foreach ($a2 as $k => $v) { - if ($v === false) { - if (isset($a1[$k])) unset($a1[$k]); - continue; - } - $a1[$k] = $v; - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Encoder.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Encoder.php deleted file mode 100644 index fd09eaa1..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Encoder.php +++ /dev/null @@ -1,426 +0,0 @@ - under the - * LGPL license. Notes on what changed are inside, but in general, - * the original code transformed UTF-8 text into an array of integer - * Unicode codepoints. Understandably, transforming that back to - * a string would be somewhat expensive, so the function was modded to - * directly operate on the string. However, this discourages code - * reuse, and the logic enumerated here would be useful for any - * function that needs to be able to understand UTF-8 characters. - * As of right now, only smart lossless character encoding converters - * would need that, and I'm probably not going to implement them. - * Once again, PHP 6 should solve all our problems. - */ - public static function cleanUTF8($str, $force_php = false) { - - // UTF-8 validity is checked since PHP 4.3.5 - // This is an optimization: if the string is already valid UTF-8, no - // need to do PHP stuff. 99% of the time, this will be the case. - // The regexp matches the XML char production, as well as well as excluding - // non-SGML codepoints U+007F to U+009F - if (preg_match('/^[\x{9}\x{A}\x{D}\x{20}-\x{7E}\x{A0}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]*$/Du', $str)) { - return $str; - } - - $mState = 0; // cached expected number of octets after the current octet - // until the beginning of the next UTF8 character sequence - $mUcs4 = 0; // cached Unicode character - $mBytes = 1; // cached expected number of octets in the current sequence - - // original code involved an $out that was an array of Unicode - // codepoints. Instead of having to convert back into UTF-8, we've - // decided to directly append valid UTF-8 characters onto a string - // $out once they're done. $char accumulates raw bytes, while $mUcs4 - // turns into the Unicode code point, so there's some redundancy. - - $out = ''; - $char = ''; - - $len = strlen($str); - for($i = 0; $i < $len; $i++) { - $in = ord($str{$i}); - $char .= $str[$i]; // append byte to char - if (0 == $mState) { - // When mState is zero we expect either a US-ASCII character - // or a multi-octet sequence. - if (0 == (0x80 & ($in))) { - // US-ASCII, pass straight through. - if (($in <= 31 || $in == 127) && - !($in == 9 || $in == 13 || $in == 10) // save \r\t\n - ) { - // control characters, remove - } else { - $out .= $char; - } - // reset - $char = ''; - $mBytes = 1; - } elseif (0xC0 == (0xE0 & ($in))) { - // First octet of 2 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x1F) << 6; - $mState = 1; - $mBytes = 2; - } elseif (0xE0 == (0xF0 & ($in))) { - // First octet of 3 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x0F) << 12; - $mState = 2; - $mBytes = 3; - } elseif (0xF0 == (0xF8 & ($in))) { - // First octet of 4 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x07) << 18; - $mState = 3; - $mBytes = 4; - } elseif (0xF8 == (0xFC & ($in))) { - // First octet of 5 octet sequence. - // - // This is illegal because the encoded codepoint must be - // either: - // (a) not the shortest form or - // (b) outside the Unicode range of 0-0x10FFFF. - // Rather than trying to resynchronize, we will carry on - // until the end of the sequence and let the later error - // handling code catch it. - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x03) << 24; - $mState = 4; - $mBytes = 5; - } elseif (0xFC == (0xFE & ($in))) { - // First octet of 6 octet sequence, see comments for 5 - // octet sequence. - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 1) << 30; - $mState = 5; - $mBytes = 6; - } else { - // Current octet is neither in the US-ASCII range nor a - // legal first octet of a multi-octet sequence. - $mState = 0; - $mUcs4 = 0; - $mBytes = 1; - $char = ''; - } - } else { - // When mState is non-zero, we expect a continuation of the - // multi-octet sequence - if (0x80 == (0xC0 & ($in))) { - // Legal continuation. - $shift = ($mState - 1) * 6; - $tmp = $in; - $tmp = ($tmp & 0x0000003F) << $shift; - $mUcs4 |= $tmp; - - if (0 == --$mState) { - // End of the multi-octet sequence. mUcs4 now contains - // the final Unicode codepoint to be output - - // Check for illegal sequences and codepoints. - - // From Unicode 3.1, non-shortest form is illegal - if (((2 == $mBytes) && ($mUcs4 < 0x0080)) || - ((3 == $mBytes) && ($mUcs4 < 0x0800)) || - ((4 == $mBytes) && ($mUcs4 < 0x10000)) || - (4 < $mBytes) || - // From Unicode 3.2, surrogate characters = illegal - (($mUcs4 & 0xFFFFF800) == 0xD800) || - // Codepoints outside the Unicode range are illegal - ($mUcs4 > 0x10FFFF) - ) { - - } elseif (0xFEFF != $mUcs4 && // omit BOM - // check for valid Char unicode codepoints - ( - 0x9 == $mUcs4 || - 0xA == $mUcs4 || - 0xD == $mUcs4 || - (0x20 <= $mUcs4 && 0x7E >= $mUcs4) || - // 7F-9F is not strictly prohibited by XML, - // but it is non-SGML, and thus we don't allow it - (0xA0 <= $mUcs4 && 0xD7FF >= $mUcs4) || - (0x10000 <= $mUcs4 && 0x10FFFF >= $mUcs4) - ) - ) { - $out .= $char; - } - // initialize UTF8 cache (reset) - $mState = 0; - $mUcs4 = 0; - $mBytes = 1; - $char = ''; - } - } else { - // ((0xC0 & (*in) != 0x80) && (mState != 0)) - // Incomplete multi-octet sequence. - // used to result in complete fail, but we'll reset - $mState = 0; - $mUcs4 = 0; - $mBytes = 1; - $char =''; - } - } - } - return $out; - } - - /** - * Translates a Unicode codepoint into its corresponding UTF-8 character. - * @note Based on Feyd's function at - * , - * which is in public domain. - * @note While we're going to do code point parsing anyway, a good - * optimization would be to refuse to translate code points that - * are non-SGML characters. However, this could lead to duplication. - * @note This is very similar to the unichr function in - * maintenance/generate-entity-file.php (although this is superior, - * due to its sanity checks). - */ - - // +----------+----------+----------+----------+ - // | 33222222 | 22221111 | 111111 | | - // | 10987654 | 32109876 | 54321098 | 76543210 | bit - // +----------+----------+----------+----------+ - // | | | | 0xxxxxxx | 1 byte 0x00000000..0x0000007F - // | | | 110yyyyy | 10xxxxxx | 2 byte 0x00000080..0x000007FF - // | | 1110zzzz | 10yyyyyy | 10xxxxxx | 3 byte 0x00000800..0x0000FFFF - // | 11110www | 10wwzzzz | 10yyyyyy | 10xxxxxx | 4 byte 0x00010000..0x0010FFFF - // +----------+----------+----------+----------+ - // | 00000000 | 00011111 | 11111111 | 11111111 | Theoretical upper limit of legal scalars: 2097151 (0x001FFFFF) - // | 00000000 | 00010000 | 11111111 | 11111111 | Defined upper limit of legal scalar codes - // +----------+----------+----------+----------+ - - public static function unichr($code) { - if($code > 1114111 or $code < 0 or - ($code >= 55296 and $code <= 57343) ) { - // bits are set outside the "valid" range as defined - // by UNICODE 4.1.0 - return ''; - } - - $x = $y = $z = $w = 0; - if ($code < 128) { - // regular ASCII character - $x = $code; - } else { - // set up bits for UTF-8 - $x = ($code & 63) | 128; - if ($code < 2048) { - $y = (($code & 2047) >> 6) | 192; - } else { - $y = (($code & 4032) >> 6) | 128; - if($code < 65536) { - $z = (($code >> 12) & 15) | 224; - } else { - $z = (($code >> 12) & 63) | 128; - $w = (($code >> 18) & 7) | 240; - } - } - } - // set up the actual character - $ret = ''; - if($w) $ret .= chr($w); - if($z) $ret .= chr($z); - if($y) $ret .= chr($y); - $ret .= chr($x); - - return $ret; - } - - /** - * Converts a string to UTF-8 based on configuration. - */ - public static function convertToUTF8($str, $config, $context) { - $encoding = $config->get('Core.Encoding'); - if ($encoding === 'utf-8') return $str; - static $iconv = null; - if ($iconv === null) $iconv = function_exists('iconv'); - set_error_handler(array('HTMLPurifier_Encoder', 'muteErrorHandler')); - if ($iconv && !$config->get('Test.ForceNoIconv')) { - $str = iconv($encoding, 'utf-8//IGNORE', $str); - if ($str === false) { - // $encoding is not a valid encoding - restore_error_handler(); - trigger_error('Invalid encoding ' . $encoding, E_USER_ERROR); - return ''; - } - // If the string is bjorked by Shift_JIS or a similar encoding - // that doesn't support all of ASCII, convert the naughty - // characters to their true byte-wise ASCII/UTF-8 equivalents. - $str = strtr($str, HTMLPurifier_Encoder::testEncodingSupportsASCII($encoding)); - restore_error_handler(); - return $str; - } elseif ($encoding === 'iso-8859-1') { - $str = utf8_encode($str); - restore_error_handler(); - return $str; - } - trigger_error('Encoding not supported, please install iconv', E_USER_ERROR); - } - - /** - * Converts a string from UTF-8 based on configuration. - * @note Currently, this is a lossy conversion, with unexpressable - * characters being omitted. - */ - public static function convertFromUTF8($str, $config, $context) { - $encoding = $config->get('Core.Encoding'); - if ($encoding === 'utf-8') return $str; - static $iconv = null; - if ($iconv === null) $iconv = function_exists('iconv'); - if ($escape = $config->get('Core.EscapeNonASCIICharacters')) { - $str = HTMLPurifier_Encoder::convertToASCIIDumbLossless($str); - } - set_error_handler(array('HTMLPurifier_Encoder', 'muteErrorHandler')); - if ($iconv && !$config->get('Test.ForceNoIconv')) { - // Undo our previous fix in convertToUTF8, otherwise iconv will barf - $ascii_fix = HTMLPurifier_Encoder::testEncodingSupportsASCII($encoding); - if (!$escape && !empty($ascii_fix)) { - $clear_fix = array(); - foreach ($ascii_fix as $utf8 => $native) $clear_fix[$utf8] = ''; - $str = strtr($str, $clear_fix); - } - $str = strtr($str, array_flip($ascii_fix)); - // Normal stuff - $str = iconv('utf-8', $encoding . '//IGNORE', $str); - restore_error_handler(); - return $str; - } elseif ($encoding === 'iso-8859-1') { - $str = utf8_decode($str); - restore_error_handler(); - return $str; - } - trigger_error('Encoding not supported', E_USER_ERROR); - } - - /** - * Lossless (character-wise) conversion of HTML to ASCII - * @param $str UTF-8 string to be converted to ASCII - * @returns ASCII encoded string with non-ASCII character entity-ized - * @warning Adapted from MediaWiki, claiming fair use: this is a common - * algorithm. If you disagree with this license fudgery, - * implement it yourself. - * @note Uses decimal numeric entities since they are best supported. - * @note This is a DUMB function: it has no concept of keeping - * character entities that the projected character encoding - * can allow. We could possibly implement a smart version - * but that would require it to also know which Unicode - * codepoints the charset supported (not an easy task). - * @note Sort of with cleanUTF8() but it assumes that $str is - * well-formed UTF-8 - */ - public static function convertToASCIIDumbLossless($str) { - $bytesleft = 0; - $result = ''; - $working = 0; - $len = strlen($str); - for( $i = 0; $i < $len; $i++ ) { - $bytevalue = ord( $str[$i] ); - if( $bytevalue <= 0x7F ) { //0xxx xxxx - $result .= chr( $bytevalue ); - $bytesleft = 0; - } elseif( $bytevalue <= 0xBF ) { //10xx xxxx - $working = $working << 6; - $working += ($bytevalue & 0x3F); - $bytesleft--; - if( $bytesleft <= 0 ) { - $result .= "&#" . $working . ";"; - } - } elseif( $bytevalue <= 0xDF ) { //110x xxxx - $working = $bytevalue & 0x1F; - $bytesleft = 1; - } elseif( $bytevalue <= 0xEF ) { //1110 xxxx - $working = $bytevalue & 0x0F; - $bytesleft = 2; - } else { //1111 0xxx - $working = $bytevalue & 0x07; - $bytesleft = 3; - } - } - return $result; - } - - /** - * This expensive function tests whether or not a given character - * encoding supports ASCII. 7/8-bit encodings like Shift_JIS will - * fail this test, and require special processing. Variable width - * encodings shouldn't ever fail. - * - * @param string $encoding Encoding name to test, as per iconv format - * @param bool $bypass Whether or not to bypass the precompiled arrays. - * @return Array of UTF-8 characters to their corresponding ASCII, - * which can be used to "undo" any overzealous iconv action. - */ - public static function testEncodingSupportsASCII($encoding, $bypass = false) { - static $encodings = array(); - if (!$bypass) { - if (isset($encodings[$encoding])) return $encodings[$encoding]; - $lenc = strtolower($encoding); - switch ($lenc) { - case 'shift_jis': - return array("\xC2\xA5" => '\\', "\xE2\x80\xBE" => '~'); - case 'johab': - return array("\xE2\x82\xA9" => '\\'); - } - if (strpos($lenc, 'iso-8859-') === 0) return array(); - } - $ret = array(); - set_error_handler(array('HTMLPurifier_Encoder', 'muteErrorHandler')); - if (iconv('UTF-8', $encoding, 'a') === false) return false; - for ($i = 0x20; $i <= 0x7E; $i++) { // all printable ASCII chars - $c = chr($i); // UTF-8 char - $r = iconv('UTF-8', "$encoding//IGNORE", $c); // initial conversion - if ( - $r === '' || - // This line is needed for iconv implementations that do not - // omit characters that do not exist in the target character set - ($r === $c && iconv($encoding, 'UTF-8//IGNORE', $r) !== $c) - ) { - // Reverse engineer: what's the UTF-8 equiv of this byte - // sequence? This assumes that there's no variable width - // encoding that doesn't support ASCII. - $ret[iconv($encoding, 'UTF-8//IGNORE', $c)] = $c; - } - } - restore_error_handler(); - $encodings[$encoding] = $ret; - return $ret; - } - - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/EntityLookup.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/EntityLookup.php deleted file mode 100644 index 96dd5d4e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/EntityLookup.php +++ /dev/null @@ -1,44 +0,0 @@ -table = unserialize(file_get_contents($file)); - } - - /** - * Retrieves sole instance of the object. - * @param Optional prototype of custom lookup table to overload with. - */ - public static function instance($prototype = false) { - // no references, since PHP doesn't copy unless modified - static $instance = null; - if ($prototype) { - $instance = $prototype; - } elseif (!$instance) { - $instance = new HTMLPurifier_EntityLookup(); - $instance->setup(); - } - return $instance; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/EntityLookup/entities.ser b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/EntityLookup/entities.ser deleted file mode 100644 index f2b8b8f2..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/EntityLookup/entities.ser +++ /dev/null @@ -1 +0,0 @@ -a:246:{s:4:"nbsp";s:2:" ";s:5:"iexcl";s:2:"¡";s:4:"cent";s:2:"¢";s:5:"pound";s:2:"£";s:6:"curren";s:2:"¤";s:3:"yen";s:2:"Â¥";s:6:"brvbar";s:2:"¦";s:4:"sect";s:2:"§";s:3:"uml";s:2:"¨";s:4:"copy";s:2:"©";s:4:"ordf";s:2:"ª";s:5:"laquo";s:2:"«";s:3:"not";s:2:"¬";s:3:"shy";s:2:"­";s:3:"reg";s:2:"®";s:4:"macr";s:2:"¯";s:3:"deg";s:2:"°";s:6:"plusmn";s:2:"±";s:5:"acute";s:2:"´";s:5:"micro";s:2:"µ";s:4:"para";s:2:"¶";s:6:"middot";s:2:"·";s:5:"cedil";s:2:"¸";s:4:"ordm";s:2:"º";s:5:"raquo";s:2:"»";s:6:"iquest";s:2:"¿";s:6:"Agrave";s:2:"À";s:6:"Aacute";s:2:"Ã";s:5:"Acirc";s:2:"Â";s:6:"Atilde";s:2:"Ã";s:4:"Auml";s:2:"Ä";s:5:"Aring";s:2:"Ã…";s:5:"AElig";s:2:"Æ";s:6:"Ccedil";s:2:"Ç";s:6:"Egrave";s:2:"È";s:6:"Eacute";s:2:"É";s:5:"Ecirc";s:2:"Ê";s:4:"Euml";s:2:"Ë";s:6:"Igrave";s:2:"ÃŒ";s:6:"Iacute";s:2:"Ã";s:5:"Icirc";s:2:"ÃŽ";s:4:"Iuml";s:2:"Ã";s:3:"ETH";s:2:"Ã";s:6:"Ntilde";s:2:"Ñ";s:6:"Ograve";s:2:"Ã’";s:6:"Oacute";s:2:"Ó";s:5:"Ocirc";s:2:"Ô";s:6:"Otilde";s:2:"Õ";s:4:"Ouml";s:2:"Ö";s:5:"times";s:2:"×";s:6:"Oslash";s:2:"Ø";s:6:"Ugrave";s:2:"Ù";s:6:"Uacute";s:2:"Ú";s:5:"Ucirc";s:2:"Û";s:4:"Uuml";s:2:"Ãœ";s:6:"Yacute";s:2:"Ã";s:5:"THORN";s:2:"Þ";s:5:"szlig";s:2:"ß";s:6:"agrave";s:2:"à";s:6:"aacute";s:2:"á";s:5:"acirc";s:2:"â";s:6:"atilde";s:2:"ã";s:4:"auml";s:2:"ä";s:5:"aring";s:2:"Ã¥";s:5:"aelig";s:2:"æ";s:6:"ccedil";s:2:"ç";s:6:"egrave";s:2:"è";s:6:"eacute";s:2:"é";s:5:"ecirc";s:2:"ê";s:4:"euml";s:2:"ë";s:6:"igrave";s:2:"ì";s:6:"iacute";s:2:"í";s:5:"icirc";s:2:"î";s:4:"iuml";s:2:"ï";s:3:"eth";s:2:"ð";s:6:"ntilde";s:2:"ñ";s:6:"ograve";s:2:"ò";s:6:"oacute";s:2:"ó";s:5:"ocirc";s:2:"ô";s:6:"otilde";s:2:"õ";s:4:"ouml";s:2:"ö";s:6:"divide";s:2:"÷";s:6:"oslash";s:2:"ø";s:6:"ugrave";s:2:"ù";s:6:"uacute";s:2:"ú";s:5:"ucirc";s:2:"û";s:4:"uuml";s:2:"ü";s:6:"yacute";s:2:"ý";s:5:"thorn";s:2:"þ";s:4:"yuml";s:2:"ÿ";s:4:"quot";s:1:""";s:3:"amp";s:1:"&";s:2:"lt";s:1:"<";s:2:"gt";s:1:">";s:4:"apos";s:1:"'";s:5:"OElig";s:2:"Å’";s:5:"oelig";s:2:"Å“";s:6:"Scaron";s:2:"Å ";s:6:"scaron";s:2:"Å¡";s:4:"Yuml";s:2:"Ÿ";s:4:"circ";s:2:"ˆ";s:5:"tilde";s:2:"Ëœ";s:4:"ensp";s:3:" ";s:4:"emsp";s:3:" ";s:6:"thinsp";s:3:" ";s:4:"zwnj";s:3:"‌";s:3:"zwj";s:3:"â€";s:3:"lrm";s:3:"‎";s:3:"rlm";s:3:"â€";s:5:"ndash";s:3:"–";s:5:"mdash";s:3:"—";s:5:"lsquo";s:3:"‘";s:5:"rsquo";s:3:"’";s:5:"sbquo";s:3:"‚";s:5:"ldquo";s:3:"“";s:5:"rdquo";s:3:"â€";s:5:"bdquo";s:3:"„";s:6:"dagger";s:3:"†";s:6:"Dagger";s:3:"‡";s:6:"permil";s:3:"‰";s:6:"lsaquo";s:3:"‹";s:6:"rsaquo";s:3:"›";s:4:"euro";s:3:"€";s:4:"fnof";s:2:"Æ’";s:5:"Alpha";s:2:"Α";s:4:"Beta";s:2:"Î’";s:5:"Gamma";s:2:"Γ";s:5:"Delta";s:2:"Δ";s:7:"Epsilon";s:2:"Ε";s:4:"Zeta";s:2:"Ζ";s:3:"Eta";s:2:"Η";s:5:"Theta";s:2:"Θ";s:4:"Iota";s:2:"Ι";s:5:"Kappa";s:2:"Κ";s:6:"Lambda";s:2:"Λ";s:2:"Mu";s:2:"Îœ";s:2:"Nu";s:2:"Î";s:2:"Xi";s:2:"Ξ";s:7:"Omicron";s:2:"Ο";s:2:"Pi";s:2:"Π";s:3:"Rho";s:2:"Ρ";s:5:"Sigma";s:2:"Σ";s:3:"Tau";s:2:"Τ";s:7:"Upsilon";s:2:"Î¥";s:3:"Phi";s:2:"Φ";s:3:"Chi";s:2:"Χ";s:3:"Psi";s:2:"Ψ";s:5:"Omega";s:2:"Ω";s:5:"alpha";s:2:"α";s:4:"beta";s:2:"β";s:5:"gamma";s:2:"γ";s:5:"delta";s:2:"δ";s:7:"epsilon";s:2:"ε";s:4:"zeta";s:2:"ζ";s:3:"eta";s:2:"η";s:5:"theta";s:2:"θ";s:4:"iota";s:2:"ι";s:5:"kappa";s:2:"κ";s:6:"lambda";s:2:"λ";s:2:"mu";s:2:"μ";s:2:"nu";s:2:"ν";s:2:"xi";s:2:"ξ";s:7:"omicron";s:2:"ο";s:2:"pi";s:2:"Ï€";s:3:"rho";s:2:"Ï";s:6:"sigmaf";s:2:"Ï‚";s:5:"sigma";s:2:"σ";s:3:"tau";s:2:"Ï„";s:7:"upsilon";s:2:"Ï…";s:3:"phi";s:2:"φ";s:3:"chi";s:2:"χ";s:3:"psi";s:2:"ψ";s:5:"omega";s:2:"ω";s:8:"thetasym";s:2:"Ï‘";s:5:"upsih";s:2:"Ï’";s:3:"piv";s:2:"Ï–";s:4:"bull";s:3:"•";s:6:"hellip";s:3:"…";s:5:"prime";s:3:"′";s:5:"Prime";s:3:"″";s:5:"oline";s:3:"‾";s:5:"frasl";s:3:"â„";s:6:"weierp";s:3:"℘";s:5:"image";s:3:"â„‘";s:4:"real";s:3:"â„œ";s:5:"trade";s:3:"â„¢";s:7:"alefsym";s:3:"ℵ";s:4:"larr";s:3:"â†";s:4:"uarr";s:3:"↑";s:4:"rarr";s:3:"→";s:4:"darr";s:3:"↓";s:4:"harr";s:3:"↔";s:5:"crarr";s:3:"↵";s:4:"lArr";s:3:"â‡";s:4:"uArr";s:3:"⇑";s:4:"rArr";s:3:"⇒";s:4:"dArr";s:3:"⇓";s:4:"hArr";s:3:"⇔";s:6:"forall";s:3:"∀";s:4:"part";s:3:"∂";s:5:"exist";s:3:"∃";s:5:"empty";s:3:"∅";s:5:"nabla";s:3:"∇";s:4:"isin";s:3:"∈";s:5:"notin";s:3:"∉";s:2:"ni";s:3:"∋";s:4:"prod";s:3:"âˆ";s:3:"sum";s:3:"∑";s:5:"minus";s:3:"−";s:6:"lowast";s:3:"∗";s:5:"radic";s:3:"√";s:4:"prop";s:3:"âˆ";s:5:"infin";s:3:"∞";s:3:"ang";s:3:"∠";s:3:"and";s:3:"∧";s:2:"or";s:3:"∨";s:3:"cap";s:3:"∩";s:3:"cup";s:3:"∪";s:3:"int";s:3:"∫";s:3:"sim";s:3:"∼";s:4:"cong";s:3:"≅";s:5:"asymp";s:3:"≈";s:2:"ne";s:3:"≠";s:5:"equiv";s:3:"≡";s:2:"le";s:3:"≤";s:2:"ge";s:3:"≥";s:3:"sub";s:3:"⊂";s:3:"sup";s:3:"⊃";s:4:"nsub";s:3:"⊄";s:4:"sube";s:3:"⊆";s:4:"supe";s:3:"⊇";s:5:"oplus";s:3:"⊕";s:6:"otimes";s:3:"⊗";s:4:"perp";s:3:"⊥";s:4:"sdot";s:3:"â‹…";s:5:"lceil";s:3:"⌈";s:5:"rceil";s:3:"⌉";s:6:"lfloor";s:3:"⌊";s:6:"rfloor";s:3:"⌋";s:4:"lang";s:3:"〈";s:4:"rang";s:3:"〉";s:3:"loz";s:3:"â—Š";s:6:"spades";s:3:"â™ ";s:5:"clubs";s:3:"♣";s:6:"hearts";s:3:"♥";s:5:"diams";s:3:"♦";} \ No newline at end of file diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/EntityParser.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/EntityParser.php deleted file mode 100644 index 6e102ca7..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/EntityParser.php +++ /dev/null @@ -1,144 +0,0 @@ - '"', - 38 => '&', - 39 => "'", - 60 => '<', - 62 => '>' - ); - - /** - * Stripped entity names to decimal conversion table for special entities. - */ - protected $_special_ent2dec = - array( - 'quot' => 34, - 'amp' => 38, - 'lt' => 60, - 'gt' => 62 - ); - - /** - * Substitutes non-special entities with their parsed equivalents. Since - * running this whenever you have parsed character is t3h 5uck, we run - * it before everything else. - * - * @param $string String to have non-special entities parsed. - * @returns Parsed string. - */ - public function substituteNonSpecialEntities($string) { - // it will try to detect missing semicolons, but don't rely on it - return preg_replace_callback( - $this->_substituteEntitiesRegex, - array($this, 'nonSpecialEntityCallback'), - $string - ); - } - - /** - * Callback function for substituteNonSpecialEntities() that does the work. - * - * @param $matches PCRE matches array, with 0 the entire match, and - * either index 1, 2 or 3 set with a hex value, dec value, - * or string (respectively). - * @returns Replacement string. - */ - - protected function nonSpecialEntityCallback($matches) { - // replaces all but big five - $entity = $matches[0]; - $is_num = (@$matches[0][1] === '#'); - if ($is_num) { - $is_hex = (@$entity[2] === 'x'); - $code = $is_hex ? hexdec($matches[1]) : (int) $matches[2]; - - // abort for special characters - if (isset($this->_special_dec2str[$code])) return $entity; - - return HTMLPurifier_Encoder::unichr($code); - } else { - if (isset($this->_special_ent2dec[$matches[3]])) return $entity; - if (!$this->_entity_lookup) { - $this->_entity_lookup = HTMLPurifier_EntityLookup::instance(); - } - if (isset($this->_entity_lookup->table[$matches[3]])) { - return $this->_entity_lookup->table[$matches[3]]; - } else { - return $entity; - } - } - } - - /** - * Substitutes only special entities with their parsed equivalents. - * - * @notice We try to avoid calling this function because otherwise, it - * would have to be called a lot (for every parsed section). - * - * @param $string String to have non-special entities parsed. - * @returns Parsed string. - */ - public function substituteSpecialEntities($string) { - return preg_replace_callback( - $this->_substituteEntitiesRegex, - array($this, 'specialEntityCallback'), - $string); - } - - /** - * Callback function for substituteSpecialEntities() that does the work. - * - * This callback has same syntax as nonSpecialEntityCallback(). - * - * @param $matches PCRE-style matches array, with 0 the entire match, and - * either index 1, 2 or 3 set with a hex value, dec value, - * or string (respectively). - * @returns Replacement string. - */ - protected function specialEntityCallback($matches) { - $entity = $matches[0]; - $is_num = (@$matches[0][1] === '#'); - if ($is_num) { - $is_hex = (@$entity[2] === 'x'); - $int = $is_hex ? hexdec($matches[1]) : (int) $matches[2]; - return isset($this->_special_dec2str[$int]) ? - $this->_special_dec2str[$int] : - $entity; - } else { - return isset($this->_special_ent2dec[$matches[3]]) ? - $this->_special_ent2dec[$matches[3]] : - $entity; - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ErrorCollector.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ErrorCollector.php deleted file mode 100644 index cc6275ef..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ErrorCollector.php +++ /dev/null @@ -1,209 +0,0 @@ -locale =& $context->get('Locale'); - $this->context = $context; - $this->_current =& $this->_stacks[0]; - $this->errors =& $this->_stacks[0]; - } - - /** - * Sends an error message to the collector for later use - * @param $severity int Error severity, PHP error style (don't use E_USER_) - * @param $msg string Error message text - * @param $subst1 string First substitution for $msg - * @param $subst2 string ... - */ - public function send($severity, $msg) { - - $args = array(); - if (func_num_args() > 2) { - $args = func_get_args(); - array_shift($args); - unset($args[0]); - } - - $token = $this->context->get('CurrentToken', true); - $line = $token ? $token->line : $this->context->get('CurrentLine', true); - $col = $token ? $token->col : $this->context->get('CurrentCol', true); - $attr = $this->context->get('CurrentAttr', true); - - // perform special substitutions, also add custom parameters - $subst = array(); - if (!is_null($token)) { - $args['CurrentToken'] = $token; - } - if (!is_null($attr)) { - $subst['$CurrentAttr.Name'] = $attr; - if (isset($token->attr[$attr])) $subst['$CurrentAttr.Value'] = $token->attr[$attr]; - } - - if (empty($args)) { - $msg = $this->locale->getMessage($msg); - } else { - $msg = $this->locale->formatMessage($msg, $args); - } - - if (!empty($subst)) $msg = strtr($msg, $subst); - - // (numerically indexed) - $error = array( - self::LINENO => $line, - self::SEVERITY => $severity, - self::MESSAGE => $msg, - self::CHILDREN => array() - ); - $this->_current[] = $error; - - - // NEW CODE BELOW ... - - $struct = null; - // Top-level errors are either: - // TOKEN type, if $value is set appropriately, or - // "syntax" type, if $value is null - $new_struct = new HTMLPurifier_ErrorStruct(); - $new_struct->type = HTMLPurifier_ErrorStruct::TOKEN; - if ($token) $new_struct->value = clone $token; - if (is_int($line) && is_int($col)) { - if (isset($this->lines[$line][$col])) { - $struct = $this->lines[$line][$col]; - } else { - $struct = $this->lines[$line][$col] = $new_struct; - } - // These ksorts may present a performance problem - ksort($this->lines[$line], SORT_NUMERIC); - } else { - if (isset($this->lines[-1])) { - $struct = $this->lines[-1]; - } else { - $struct = $this->lines[-1] = $new_struct; - } - } - ksort($this->lines, SORT_NUMERIC); - - // Now, check if we need to operate on a lower structure - if (!empty($attr)) { - $struct = $struct->getChild(HTMLPurifier_ErrorStruct::ATTR, $attr); - if (!$struct->value) { - $struct->value = array($attr, 'PUT VALUE HERE'); - } - } - if (!empty($cssprop)) { - $struct = $struct->getChild(HTMLPurifier_ErrorStruct::CSSPROP, $cssprop); - if (!$struct->value) { - // if we tokenize CSS this might be a little more difficult to do - $struct->value = array($cssprop, 'PUT VALUE HERE'); - } - } - - // Ok, structs are all setup, now time to register the error - $struct->addError($severity, $msg); - } - - /** - * Retrieves raw error data for custom formatter to use - * @param List of arrays in format of array(line of error, - * error severity, error message, - * recursive sub-errors array) - */ - public function getRaw() { - return $this->errors; - } - - /** - * Default HTML formatting implementation for error messages - * @param $config Configuration array, vital for HTML output nature - * @param $errors Errors array to display; used for recursion. - */ - public function getHTMLFormatted($config, $errors = null) { - $ret = array(); - - $this->generator = new HTMLPurifier_Generator($config, $this->context); - if ($errors === null) $errors = $this->errors; - - // 'At line' message needs to be removed - - // generation code for new structure goes here. It needs to be recursive. - foreach ($this->lines as $line => $col_array) { - if ($line == -1) continue; - foreach ($col_array as $col => $struct) { - $this->_renderStruct($ret, $struct, $line, $col); - } - } - if (isset($this->lines[-1])) { - $this->_renderStruct($ret, $this->lines[-1]); - } - - if (empty($errors)) { - return '

      ' . $this->locale->getMessage('ErrorCollector: No errors') . '

      '; - } else { - return '
      • ' . implode('
      • ', $ret) . '
      '; - } - - } - - private function _renderStruct(&$ret, $struct, $line = null, $col = null) { - $stack = array($struct); - $context_stack = array(array()); - while ($current = array_pop($stack)) { - $context = array_pop($context_stack); - foreach ($current->errors as $error) { - list($severity, $msg) = $error; - $string = ''; - $string .= '
      '; - // W3C uses an icon to indicate the severity of the error. - $error = $this->locale->getErrorName($severity); - $string .= "$error "; - if (!is_null($line) && !is_null($col)) { - $string .= "Line $line, Column $col: "; - } else { - $string .= 'End of Document: '; - } - $string .= '' . $this->generator->escape($msg) . ' '; - $string .= '
      '; - // Here, have a marker for the character on the column appropriate. - // Be sure to clip extremely long lines. - //$string .= '
      ';
      -                //$string .= '';
      -                //$string .= '
      '; - $ret[] = $string; - } - foreach ($current->children as $type => $array) { - $context[] = $current; - $stack = array_merge($stack, array_reverse($array, true)); - for ($i = count($array); $i > 0; $i--) { - $context_stack[] = $context; - } - } - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ErrorStruct.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ErrorStruct.php deleted file mode 100644 index 721c88c1..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/ErrorStruct.php +++ /dev/null @@ -1,60 +0,0 @@ -children[$type][$id])) { - $this->children[$type][$id] = new HTMLPurifier_ErrorStruct(); - $this->children[$type][$id]->type = $type; - } - return $this->children[$type][$id]; - } - - public function addError($severity, $message) { - $this->errors[] = array($severity, $message); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Exception.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Exception.php deleted file mode 100644 index 1882ee68..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Exception.php +++ /dev/null @@ -1,12 +0,0 @@ -preFilter, - * 2->preFilter, 3->preFilter, purify, 3->postFilter, 2->postFilter, - * 1->postFilter. - * - * @note Methods are not declared abstract as it is perfectly legitimate - * for an implementation not to want anything to happen on a step - */ - -class HTMLPurifier_Filter -{ - - /** - * Name of the filter for identification purposes - */ - public $name; - - /** - * Pre-processor function, handles HTML before HTML Purifier - */ - public function preFilter($html, $config, $context) { - return $html; - } - - /** - * Post-processor function, handles HTML after HTML Purifier - */ - public function postFilter($html, $config, $context) { - return $html; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Filter/ExtractStyleBlocks.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Filter/ExtractStyleBlocks.php deleted file mode 100644 index f97b3cb3..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Filter/ExtractStyleBlocks.php +++ /dev/null @@ -1,135 +0,0 @@ - blocks from input HTML, cleans them up - * using CSSTidy, and then places them in $purifier->context->get('StyleBlocks') - * so they can be used elsewhere in the document. - * - * @note - * See tests/HTMLPurifier/Filter/ExtractStyleBlocksTest.php for - * sample usage. - * - * @note - * This filter can also be used on stylesheets not included in the - * document--something purists would probably prefer. Just directly - * call HTMLPurifier_Filter_ExtractStyleBlocks->cleanCSS() - */ -class HTMLPurifier_Filter_ExtractStyleBlocks extends HTMLPurifier_Filter -{ - - public $name = 'ExtractStyleBlocks'; - private $_styleMatches = array(); - private $_tidy; - - public function __construct() { - $this->_tidy = new csstidy(); - } - - /** - * Save the contents of CSS blocks to style matches - * @param $matches preg_replace style $matches array - */ - protected function styleCallback($matches) { - $this->_styleMatches[] = $matches[1]; - } - - /** - * Removes inline #isU', array($this, 'styleCallback'), $html); - $style_blocks = $this->_styleMatches; - $this->_styleMatches = array(); // reset - $context->register('StyleBlocks', $style_blocks); // $context must not be reused - if ($this->_tidy) { - foreach ($style_blocks as &$style) { - $style = $this->cleanCSS($style, $config, $context); - } - } - return $html; - } - - /** - * Takes CSS (the stuff found in in a font-family prop). - if ($config->get('Filter.ExtractStyleBlocks.Escaping')) { - $css = str_replace( - array('<', '>', '&'), - array('\3C ', '\3E ', '\26 '), - $css - ); - } - return $css; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Filter/YouTube.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Filter/YouTube.php deleted file mode 100644 index 9a9d9f96..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Filter/YouTube.php +++ /dev/null @@ -1,39 +0,0 @@ -]+>.+?'. - 'http://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?#s'; - $pre_replace = '\1'; - return preg_replace($pre_regex, $pre_replace, $html); - } - - public function postFilter($html, $config, $context) { - $post_regex = '#((?:v|cp)/[A-Za-z0-9\-_=]+)#'; - return preg_replace_callback($post_regex, array($this, 'postFilterCallback'), $html); - } - - protected function armorUrl($url) { - return str_replace('--', '--', $url); - } - - protected function postFilterCallback($matches) { - $url = $this->armorUrl($matches[1]); - return ''. - ''. - ''. - ''; - - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Generator.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Generator.php deleted file mode 100644 index e5988b64..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Generator.php +++ /dev/null @@ -1,229 +0,0 @@ - tags - */ - private $_scriptFix = false; - - /** - * Cache of HTMLDefinition during HTML output to determine whether or - * not attributes should be minimized. - */ - private $_def; - - /** - * Cache of %Output.SortAttr - */ - private $_sortAttr; - - /** - * Cache of %Output.FlashCompat - */ - private $_flashCompat; - - /** - * Stack for keeping track of object information when outputting IE - * compatibility code. - */ - private $_flashStack = array(); - - /** - * Configuration for the generator - */ - protected $config; - - /** - * @param $config Instance of HTMLPurifier_Config - * @param $context Instance of HTMLPurifier_Context - */ - public function __construct($config, $context) { - $this->config = $config; - $this->_scriptFix = $config->get('Output.CommentScriptContents'); - $this->_sortAttr = $config->get('Output.SortAttr'); - $this->_flashCompat = $config->get('Output.FlashCompat'); - $this->_def = $config->getHTMLDefinition(); - $this->_xhtml = $this->_def->doctype->xml; - } - - /** - * Generates HTML from an array of tokens. - * @param $tokens Array of HTMLPurifier_Token - * @param $config HTMLPurifier_Config object - * @return Generated HTML - */ - public function generateFromTokens($tokens) { - if (!$tokens) return ''; - - // Basic algorithm - $html = ''; - for ($i = 0, $size = count($tokens); $i < $size; $i++) { - if ($this->_scriptFix && $tokens[$i]->name === 'script' - && $i + 2 < $size && $tokens[$i+2] instanceof HTMLPurifier_Token_End) { - // script special case - // the contents of the script block must be ONE token - // for this to work. - $html .= $this->generateFromToken($tokens[$i++]); - $html .= $this->generateScriptFromToken($tokens[$i++]); - } - $html .= $this->generateFromToken($tokens[$i]); - } - - // Tidy cleanup - if (extension_loaded('tidy') && $this->config->get('Output.TidyFormat')) { - $tidy = new Tidy; - $tidy->parseString($html, array( - 'indent'=> true, - 'output-xhtml' => $this->_xhtml, - 'show-body-only' => true, - 'indent-spaces' => 2, - 'wrap' => 68, - ), 'utf8'); - $tidy->cleanRepair(); - $html = (string) $tidy; // explicit cast necessary - } - - // Normalize newlines to system defined value - if ($this->config->get('Core.NormalizeNewlines')) { - $nl = $this->config->get('Output.Newline'); - if ($nl === null) $nl = PHP_EOL; - if ($nl !== "\n") $html = str_replace("\n", $nl, $html); - } - return $html; - } - - /** - * Generates HTML from a single token. - * @param $token HTMLPurifier_Token object. - * @return Generated HTML - */ - public function generateFromToken($token) { - if (!$token instanceof HTMLPurifier_Token) { - trigger_error('Cannot generate HTML from non-HTMLPurifier_Token object', E_USER_WARNING); - return ''; - - } elseif ($token instanceof HTMLPurifier_Token_Start) { - $attr = $this->generateAttributes($token->attr, $token->name); - if ($this->_flashCompat) { - if ($token->name == "object") { - $flash = new stdclass(); - $flash->attr = $token->attr; - $flash->param = array(); - $this->_flashStack[] = $flash; - } - } - return '<' . $token->name . ($attr ? ' ' : '') . $attr . '>'; - - } elseif ($token instanceof HTMLPurifier_Token_End) { - $_extra = ''; - if ($this->_flashCompat) { - if ($token->name == "object" && !empty($this->_flashStack)) { - $flash = array_pop($this->_flashStack); - $compat_token = new HTMLPurifier_Token_Empty("embed"); - foreach ($flash->attr as $name => $val) { - if ($name == "classid") continue; - if ($name == "type") continue; - if ($name == "data") $name = "src"; - $compat_token->attr[$name] = $val; - } - foreach ($flash->param as $name => $val) { - if ($name == "movie") $name = "src"; - $compat_token->attr[$name] = $val; - } - $_extra = ""; - } - } - return $_extra . 'name . '>'; - - } elseif ($token instanceof HTMLPurifier_Token_Empty) { - if ($this->_flashCompat && $token->name == "param" && !empty($this->_flashStack)) { - $this->_flashStack[count($this->_flashStack)-1]->param[$token->attr['name']] = $token->attr['value']; - } - $attr = $this->generateAttributes($token->attr, $token->name); - return '<' . $token->name . ($attr ? ' ' : '') . $attr . - ( $this->_xhtml ? ' /': '' ) //
      v.
      - . '>'; - - } elseif ($token instanceof HTMLPurifier_Token_Text) { - return $this->escape($token->data, ENT_NOQUOTES); - - } elseif ($token instanceof HTMLPurifier_Token_Comment) { - return ''; - } else { - return ''; - - } - } - - /** - * Special case processor for the contents of script tags - * @warning This runs into problems if there's already a literal - * --> somewhere inside the script contents. - */ - public function generateScriptFromToken($token) { - if (!$token instanceof HTMLPurifier_Token_Text) return $this->generateFromToken($token); - // Thanks - $data = preg_replace('#//\s*$#', '', $token->data); - return ''; - } - - /** - * Generates attribute declarations from attribute array. - * @note This does not include the leading or trailing space. - * @param $assoc_array_of_attributes Attribute array - * @param $element Name of element attributes are for, used to check - * attribute minimization. - * @return Generate HTML fragment for insertion. - */ - public function generateAttributes($assoc_array_of_attributes, $element = false) { - $html = ''; - if ($this->_sortAttr) ksort($assoc_array_of_attributes); - foreach ($assoc_array_of_attributes as $key => $value) { - if (!$this->_xhtml) { - // Remove namespaced attributes - if (strpos($key, ':') !== false) continue; - // Check if we should minimize the attribute: val="val" -> val - if ($element && !empty($this->_def->info[$element]->attr[$key]->minimized)) { - $html .= $key . ' '; - continue; - } - } - $html .= $key.'="'.$this->escape($value).'" '; - } - return rtrim($html); - } - - /** - * Escapes raw text data. - * @todo This really ought to be protected, but until we have a facility - * for properly generating HTML here w/o using tokens, it stays - * public. - * @param $string String data to escape for HTML. - * @param $quote Quoting style, like htmlspecialchars. ENT_NOQUOTES is - * permissible for non-attribute output. - * @return String escaped data. - */ - public function escape($string, $quote = null) { - // Workaround for APC bug on Mac Leopard reported by sidepodcast - // http://htmlpurifier.org/phorum/read.php?3,4823,4846 - if ($quote === null) $quote = ENT_COMPAT; - return htmlspecialchars($string, $quote, 'UTF-8'); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLDefinition.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLDefinition.php deleted file mode 100644 index f775604a..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLDefinition.php +++ /dev/null @@ -1,425 +0,0 @@ -getAnonymousModule(); - if (!isset($module->info[$element_name])) { - $element = $module->addBlankElement($element_name); - } else { - $element = $module->info[$element_name]; - } - $element->attr[$attr_name] = $def; - } - - /** - * Adds a custom element to your HTML definition - * @note See HTMLPurifier_HTMLModule::addElement for detailed - * parameter and return value descriptions. - */ - public function addElement($element_name, $type, $contents, $attr_collections, $attributes = array()) { - $module = $this->getAnonymousModule(); - // assume that if the user is calling this, the element - // is safe. This may not be a good idea - $element = $module->addElement($element_name, $type, $contents, $attr_collections, $attributes); - return $element; - } - - /** - * Adds a blank element to your HTML definition, for overriding - * existing behavior - * @note See HTMLPurifier_HTMLModule::addBlankElement for detailed - * parameter and return value descriptions. - */ - public function addBlankElement($element_name) { - $module = $this->getAnonymousModule(); - $element = $module->addBlankElement($element_name); - return $element; - } - - /** - * Retrieves a reference to the anonymous module, so you can - * bust out advanced features without having to make your own - * module. - */ - public function getAnonymousModule() { - if (!$this->_anonModule) { - $this->_anonModule = new HTMLPurifier_HTMLModule(); - $this->_anonModule->name = 'Anonymous'; - } - return $this->_anonModule; - } - - private $_anonModule; - - - // PUBLIC BUT INTERNAL VARIABLES -------------------------------------- - - public $type = 'HTML'; - public $manager; /**< Instance of HTMLPurifier_HTMLModuleManager */ - - /** - * Performs low-cost, preliminary initialization. - */ - public function __construct() { - $this->manager = new HTMLPurifier_HTMLModuleManager(); - } - - protected function doSetup($config) { - $this->processModules($config); - $this->setupConfigStuff($config); - unset($this->manager); - - // cleanup some of the element definitions - foreach ($this->info as $k => $v) { - unset($this->info[$k]->content_model); - unset($this->info[$k]->content_model_type); - } - } - - /** - * Extract out the information from the manager - */ - protected function processModules($config) { - - if ($this->_anonModule) { - // for user specific changes - // this is late-loaded so we don't have to deal with PHP4 - // reference wonky-ness - $this->manager->addModule($this->_anonModule); - unset($this->_anonModule); - } - - $this->manager->setup($config); - $this->doctype = $this->manager->doctype; - - foreach ($this->manager->modules as $module) { - foreach($module->info_tag_transform as $k => $v) { - if ($v === false) unset($this->info_tag_transform[$k]); - else $this->info_tag_transform[$k] = $v; - } - foreach($module->info_attr_transform_pre as $k => $v) { - if ($v === false) unset($this->info_attr_transform_pre[$k]); - else $this->info_attr_transform_pre[$k] = $v; - } - foreach($module->info_attr_transform_post as $k => $v) { - if ($v === false) unset($this->info_attr_transform_post[$k]); - else $this->info_attr_transform_post[$k] = $v; - } - foreach ($module->info_injector as $k => $v) { - if ($v === false) unset($this->info_injector[$k]); - else $this->info_injector[$k] = $v; - } - } - - $this->info = $this->manager->getElements(); - $this->info_content_sets = $this->manager->contentSets->lookup; - - } - - /** - * Sets up stuff based on config. We need a better way of doing this. - */ - protected function setupConfigStuff($config) { - - $block_wrapper = $config->get('HTML.BlockWrapper'); - if (isset($this->info_content_sets['Block'][$block_wrapper])) { - $this->info_block_wrapper = $block_wrapper; - } else { - trigger_error('Cannot use non-block element as block wrapper', - E_USER_ERROR); - } - - $parent = $config->get('HTML.Parent'); - $def = $this->manager->getElement($parent, true); - if ($def) { - $this->info_parent = $parent; - $this->info_parent_def = $def; - } else { - trigger_error('Cannot use unrecognized element as parent', - E_USER_ERROR); - $this->info_parent_def = $this->manager->getElement($this->info_parent, true); - } - - // support template text - $support = "(for information on implementing this, see the ". - "support forums) "; - - // setup allowed elements ----------------------------------------- - - $allowed_elements = $config->get('HTML.AllowedElements'); - $allowed_attributes = $config->get('HTML.AllowedAttributes'); // retrieve early - - if (!is_array($allowed_elements) && !is_array($allowed_attributes)) { - $allowed = $config->get('HTML.Allowed'); - if (is_string($allowed)) { - list($allowed_elements, $allowed_attributes) = $this->parseTinyMCEAllowedList($allowed); - } - } - - if (is_array($allowed_elements)) { - foreach ($this->info as $name => $d) { - if(!isset($allowed_elements[$name])) unset($this->info[$name]); - unset($allowed_elements[$name]); - } - // emit errors - foreach ($allowed_elements as $element => $d) { - $element = htmlspecialchars($element); // PHP doesn't escape errors, be careful! - trigger_error("Element '$element' is not supported $support", E_USER_WARNING); - } - } - - // setup allowed attributes --------------------------------------- - - $allowed_attributes_mutable = $allowed_attributes; // by copy! - if (is_array($allowed_attributes)) { - - // This actually doesn't do anything, since we went away from - // global attributes. It's possible that userland code uses - // it, but HTMLModuleManager doesn't! - foreach ($this->info_global_attr as $attr => $x) { - $keys = array($attr, "*@$attr", "*.$attr"); - $delete = true; - foreach ($keys as $key) { - if ($delete && isset($allowed_attributes[$key])) { - $delete = false; - } - if (isset($allowed_attributes_mutable[$key])) { - unset($allowed_attributes_mutable[$key]); - } - } - if ($delete) unset($this->info_global_attr[$attr]); - } - - foreach ($this->info as $tag => $info) { - foreach ($info->attr as $attr => $x) { - $keys = array("$tag@$attr", $attr, "*@$attr", "$tag.$attr", "*.$attr"); - $delete = true; - foreach ($keys as $key) { - if ($delete && isset($allowed_attributes[$key])) { - $delete = false; - } - if (isset($allowed_attributes_mutable[$key])) { - unset($allowed_attributes_mutable[$key]); - } - } - if ($delete) { - if ($this->info[$tag]->attr[$attr]->required) { - trigger_error("Required attribute '$attr' in element '$tag' was not allowed, which means '$tag' will not be allowed either", E_USER_WARNING); - } - unset($this->info[$tag]->attr[$attr]); - } - } - } - // emit errors - foreach ($allowed_attributes_mutable as $elattr => $d) { - $bits = preg_split('/[.@]/', $elattr, 2); - $c = count($bits); - switch ($c) { - case 2: - if ($bits[0] !== '*') { - $element = htmlspecialchars($bits[0]); - $attribute = htmlspecialchars($bits[1]); - if (!isset($this->info[$element])) { - trigger_error("Cannot allow attribute '$attribute' if element '$element' is not allowed/supported $support"); - } else { - trigger_error("Attribute '$attribute' in element '$element' not supported $support", - E_USER_WARNING); - } - break; - } - // otherwise fall through - case 1: - $attribute = htmlspecialchars($bits[0]); - trigger_error("Global attribute '$attribute' is not ". - "supported in any elements $support", - E_USER_WARNING); - break; - } - } - - } - - // setup forbidden elements --------------------------------------- - - $forbidden_elements = $config->get('HTML.ForbiddenElements'); - $forbidden_attributes = $config->get('HTML.ForbiddenAttributes'); - - foreach ($this->info as $tag => $info) { - if (isset($forbidden_elements[$tag])) { - unset($this->info[$tag]); - continue; - } - foreach ($info->attr as $attr => $x) { - if ( - isset($forbidden_attributes["$tag@$attr"]) || - isset($forbidden_attributes["*@$attr"]) || - isset($forbidden_attributes[$attr]) - ) { - unset($this->info[$tag]->attr[$attr]); - continue; - } // this segment might get removed eventually - elseif (isset($forbidden_attributes["$tag.$attr"])) { - // $tag.$attr are not user supplied, so no worries! - trigger_error("Error with $tag.$attr: tag.attr syntax not supported for HTML.ForbiddenAttributes; use tag@attr instead", E_USER_WARNING); - } - } - } - foreach ($forbidden_attributes as $key => $v) { - if (strlen($key) < 2) continue; - if ($key[0] != '*') continue; - if ($key[1] == '.') { - trigger_error("Error with $key: *.attr syntax not supported for HTML.ForbiddenAttributes; use attr instead", E_USER_WARNING); - } - } - - // setup injectors ----------------------------------------------------- - foreach ($this->info_injector as $i => $injector) { - if ($injector->checkNeeded($config) !== false) { - // remove injector that does not have it's required - // elements/attributes present, and is thus not needed. - unset($this->info_injector[$i]); - } - } - } - - /** - * Parses a TinyMCE-flavored Allowed Elements and Attributes list into - * separate lists for processing. Format is element[attr1|attr2],element2... - * @warning Although it's largely drawn from TinyMCE's implementation, - * it is different, and you'll probably have to modify your lists - * @param $list String list to parse - * @param array($allowed_elements, $allowed_attributes) - * @todo Give this its own class, probably static interface - */ - public function parseTinyMCEAllowedList($list) { - - $list = str_replace(array(' ', "\t"), '', $list); - - $elements = array(); - $attributes = array(); - - $chunks = preg_split('/(,|[\n\r]+)/', $list); - foreach ($chunks as $chunk) { - if (empty($chunk)) continue; - // remove TinyMCE element control characters - if (!strpos($chunk, '[')) { - $element = $chunk; - $attr = false; - } else { - list($element, $attr) = explode('[', $chunk); - } - if ($element !== '*') $elements[$element] = true; - if (!$attr) continue; - $attr = substr($attr, 0, strlen($attr) - 1); // remove trailing ] - $attr = explode('|', $attr); - foreach ($attr as $key) { - $attributes["$element.$key"] = true; - } - } - - return array($elements, $attributes); - - } - - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule.php deleted file mode 100644 index 44b6f33f..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule.php +++ /dev/null @@ -1,244 +0,0 @@ -info, since the object's data is only info, - * with extra behavior associated with it. - */ - public $attr_collections = array(); - - /** - * Associative array of deprecated tag name to HTMLPurifier_TagTransform - */ - public $info_tag_transform = array(); - - /** - * List of HTMLPurifier_AttrTransform to be performed before validation. - */ - public $info_attr_transform_pre = array(); - - /** - * List of HTMLPurifier_AttrTransform to be performed after validation. - */ - public $info_attr_transform_post = array(); - - /** - * List of HTMLPurifier_Injector to be performed during well-formedness fixing. - * An injector will only be invoked if all of it's pre-requisites are met; - * if an injector fails setup, there will be no error; it will simply be - * silently disabled. - */ - public $info_injector = array(); - - /** - * Boolean flag that indicates whether or not getChildDef is implemented. - * For optimization reasons: may save a call to a function. Be sure - * to set it if you do implement getChildDef(), otherwise it will have - * no effect! - */ - public $defines_child_def = false; - - /** - * Boolean flag whether or not this module is safe. If it is not safe, all - * of its members are unsafe. Modules are safe by default (this might be - * slightly dangerous, but it doesn't make much sense to force HTML Purifier, - * which is based off of safe HTML, to explicitly say, "This is safe," even - * though there are modules which are "unsafe") - * - * @note Previously, safety could be applied at an element level granularity. - * We've removed this ability, so in order to add "unsafe" elements - * or attributes, a dedicated module with this property set to false - * must be used. - */ - public $safe = true; - - /** - * Retrieves a proper HTMLPurifier_ChildDef subclass based on - * content_model and content_model_type member variables of - * the HTMLPurifier_ElementDef class. There is a similar function - * in HTMLPurifier_HTMLDefinition. - * @param $def HTMLPurifier_ElementDef instance - * @return HTMLPurifier_ChildDef subclass - */ - public function getChildDef($def) {return false;} - - // -- Convenience ----------------------------------------------------- - - /** - * Convenience function that sets up a new element - * @param $element Name of element to add - * @param $type What content set should element be registered to? - * Set as false to skip this step. - * @param $contents Allowed children in form of: - * "$content_model_type: $content_model" - * @param $attr_includes What attribute collections to register to - * element? - * @param $attr What unique attributes does the element define? - * @note See ElementDef for in-depth descriptions of these parameters. - * @return Created element definition object, so you - * can set advanced parameters - */ - public function addElement($element, $type, $contents, $attr_includes = array(), $attr = array()) { - $this->elements[] = $element; - // parse content_model - list($content_model_type, $content_model) = $this->parseContents($contents); - // merge in attribute inclusions - $this->mergeInAttrIncludes($attr, $attr_includes); - // add element to content sets - if ($type) $this->addElementToContentSet($element, $type); - // create element - $this->info[$element] = HTMLPurifier_ElementDef::create( - $content_model, $content_model_type, $attr - ); - // literal object $contents means direct child manipulation - if (!is_string($contents)) $this->info[$element]->child = $contents; - return $this->info[$element]; - } - - /** - * Convenience function that creates a totally blank, non-standalone - * element. - * @param $element Name of element to create - * @return Created element - */ - public function addBlankElement($element) { - if (!isset($this->info[$element])) { - $this->elements[] = $element; - $this->info[$element] = new HTMLPurifier_ElementDef(); - $this->info[$element]->standalone = false; - } else { - trigger_error("Definition for $element already exists in module, cannot redefine"); - } - return $this->info[$element]; - } - - /** - * Convenience function that registers an element to a content set - * @param Element to register - * @param Name content set (warning: case sensitive, usually upper-case - * first letter) - */ - public function addElementToContentSet($element, $type) { - if (!isset($this->content_sets[$type])) $this->content_sets[$type] = ''; - else $this->content_sets[$type] .= ' | '; - $this->content_sets[$type] .= $element; - } - - /** - * Convenience function that transforms single-string contents - * into separate content model and content model type - * @param $contents Allowed children in form of: - * "$content_model_type: $content_model" - * @note If contents is an object, an array of two nulls will be - * returned, and the callee needs to take the original $contents - * and use it directly. - */ - public function parseContents($contents) { - if (!is_string($contents)) return array(null, null); // defer - switch ($contents) { - // check for shorthand content model forms - case 'Empty': - return array('empty', ''); - case 'Inline': - return array('optional', 'Inline | #PCDATA'); - case 'Flow': - return array('optional', 'Flow | #PCDATA'); - } - list($content_model_type, $content_model) = explode(':', $contents); - $content_model_type = strtolower(trim($content_model_type)); - $content_model = trim($content_model); - return array($content_model_type, $content_model); - } - - /** - * Convenience function that merges a list of attribute includes into - * an attribute array. - * @param $attr Reference to attr array to modify - * @param $attr_includes Array of includes / string include to merge in - */ - public function mergeInAttrIncludes(&$attr, $attr_includes) { - if (!is_array($attr_includes)) { - if (empty($attr_includes)) $attr_includes = array(); - else $attr_includes = array($attr_includes); - } - $attr[0] = $attr_includes; - } - - /** - * Convenience function that generates a lookup table with boolean - * true as value. - * @param $list List of values to turn into a lookup - * @note You can also pass an arbitrary number of arguments in - * place of the regular argument - * @return Lookup array equivalent of list - */ - public function makeLookup($list) { - if (is_string($list)) $list = func_get_args(); - $ret = array(); - foreach ($list as $value) { - if (is_null($value)) continue; - $ret[$value] = true; - } - return $ret; - } - - /** - * Lazy load construction of the module after determining whether - * or not it's needed, and also when a finalized configuration object - * is available. - * @param $config Instance of HTMLPurifier_Config - */ - public function setup($config) {} - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Bdo.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Bdo.php deleted file mode 100644 index 745b4b62..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Bdo.php +++ /dev/null @@ -1,31 +0,0 @@ - array('dir' => false) - ); - - public function setup($config) { - $bdo = $this->addElement( - 'bdo', 'Inline', 'Inline', array('Core', 'Lang'), - array( - 'dir' => 'Enum#ltr,rtl', // required - // The Abstract Module specification has the attribute - // inclusions wrong for bdo: bdo allows Lang - ) - ); - $bdo->attr_transform_post['required-dir'] = new HTMLPurifier_AttrTransform_BdoDir(); - - $this->attr_collections['I18N']['dir'] = 'Enum#ltr,rtl'; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/CommonAttributes.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/CommonAttributes.php deleted file mode 100644 index 44b3779b..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/CommonAttributes.php +++ /dev/null @@ -1,26 +0,0 @@ - array( - 0 => array('Style'), - // 'xml:space' => false, - 'class' => 'Class', - 'id' => 'ID', - 'title' => 'CDATA', - ), - 'Lang' => array(), - 'I18N' => array( - 0 => array('Lang'), // proprietary, for xml:lang/lang - ), - 'Common' => array( - 0 => array('Core', 'I18N') - ) - ); - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Edit.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Edit.php deleted file mode 100644 index 3275bd5f..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Edit.php +++ /dev/null @@ -1,38 +0,0 @@ - 'URI', - // 'datetime' => 'Datetime', // not implemented - ); - $this->addElement('del', 'Inline', $contents, 'Common', $attr); - $this->addElement('ins', 'Inline', $contents, 'Common', $attr); - } - - // HTML 4.01 specifies that ins/del must not contain block - // elements when used in an inline context, chameleon is - // a complicated workaround to acheive this effect - - // Inline context ! Block context (exclamation mark is - // separator, see getChildDef for parsing) - - public $defines_child_def = true; - public function getChildDef($def) { - if ($def->content_model_type != 'chameleon') return false; - $value = explode('!', $def->content_model); - return new HTMLPurifier_ChildDef_Chameleon($value[0], $value[1]); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Forms.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Forms.php deleted file mode 100644 index b8211abd..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Forms.php +++ /dev/null @@ -1,118 +0,0 @@ - 'Form', - 'Inline' => 'Formctrl', - ); - - public function setup($config) { - $form = $this->addElement('form', 'Form', - 'Required: Heading | List | Block | fieldset', 'Common', array( - 'accept' => 'ContentTypes', - 'accept-charset' => 'Charsets', - 'action*' => 'URI', - 'method' => 'Enum#get,post', - // really ContentType, but these two are the only ones used today - 'enctype' => 'Enum#application/x-www-form-urlencoded,multipart/form-data', - )); - $form->excludes = array('form' => true); - - $input = $this->addElement('input', 'Formctrl', 'Empty', 'Common', array( - 'accept' => 'ContentTypes', - 'accesskey' => 'Character', - 'alt' => 'Text', - 'checked' => 'Bool#checked', - 'disabled' => 'Bool#disabled', - 'maxlength' => 'Number', - 'name' => 'CDATA', - 'readonly' => 'Bool#readonly', - 'size' => 'Number', - 'src' => 'URI#embeds', - 'tabindex' => 'Number', - 'type' => 'Enum#text,password,checkbox,button,radio,submit,reset,file,hidden,image', - 'value' => 'CDATA', - )); - $input->attr_transform_post[] = new HTMLPurifier_AttrTransform_Input(); - - $this->addElement('select', 'Formctrl', 'Required: optgroup | option', 'Common', array( - 'disabled' => 'Bool#disabled', - 'multiple' => 'Bool#multiple', - 'name' => 'CDATA', - 'size' => 'Number', - 'tabindex' => 'Number', - )); - - $this->addElement('option', false, 'Optional: #PCDATA', 'Common', array( - 'disabled' => 'Bool#disabled', - 'label' => 'Text', - 'selected' => 'Bool#selected', - 'value' => 'CDATA', - )); - // It's illegal for there to be more than one selected, but not - // be multiple. Also, no selected means undefined behavior. This might - // be difficult to implement; perhaps an injector, or a context variable. - - $textarea = $this->addElement('textarea', 'Formctrl', 'Optional: #PCDATA', 'Common', array( - 'accesskey' => 'Character', - 'cols*' => 'Number', - 'disabled' => 'Bool#disabled', - 'name' => 'CDATA', - 'readonly' => 'Bool#readonly', - 'rows*' => 'Number', - 'tabindex' => 'Number', - )); - $textarea->attr_transform_pre[] = new HTMLPurifier_AttrTransform_Textarea(); - - $button = $this->addElement('button', 'Formctrl', 'Optional: #PCDATA | Heading | List | Block | Inline', 'Common', array( - 'accesskey' => 'Character', - 'disabled' => 'Bool#disabled', - 'name' => 'CDATA', - 'tabindex' => 'Number', - 'type' => 'Enum#button,submit,reset', - 'value' => 'CDATA', - )); - - // For exclusions, ideally we'd specify content sets, not literal elements - $button->excludes = $this->makeLookup( - 'form', 'fieldset', // Form - 'input', 'select', 'textarea', 'label', 'button', // Formctrl - 'a' // as per HTML 4.01 spec, this is omitted by modularization - ); - - // Extra exclusion: img usemap="" is not permitted within this element. - // We'll omit this for now, since we don't have any good way of - // indicating it yet. - - // This is HIGHLY user-unfriendly; we need a custom child-def for this - $this->addElement('fieldset', 'Form', 'Custom: (#WS?,legend,(Flow|#PCDATA)*)', 'Common'); - - $label = $this->addElement('label', 'Formctrl', 'Optional: #PCDATA | Inline', 'Common', array( - 'accesskey' => 'Character', - // 'for' => 'IDREF', // IDREF not implemented, cannot allow - )); - $label->excludes = array('label' => true); - - $this->addElement('legend', false, 'Optional: #PCDATA | Inline', 'Common', array( - 'accesskey' => 'Character', - )); - - $this->addElement('optgroup', false, 'Required: option', 'Common', array( - 'disabled' => 'Bool#disabled', - 'label*' => 'Text', - )); - - // Don't forget an injector for . This one's a little complex - // because it maps to multiple elements. - - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Hypertext.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Hypertext.php deleted file mode 100644 index ec95bb6f..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Hypertext.php +++ /dev/null @@ -1,31 +0,0 @@ -addElement( - 'a', 'Inline', 'Inline', 'Common', - array( - // 'accesskey' => 'Character', - // 'charset' => 'Charset', - 'href' => 'URI', - // 'hreflang' => 'LanguageCode', - 'rel' => new HTMLPurifier_AttrDef_HTML_LinkTypes('rel'), - 'rev' => new HTMLPurifier_AttrDef_HTML_LinkTypes('rev'), - // 'tabindex' => 'Number', - // 'type' => 'ContentType', - ) - ); - $a->formatting = true; - $a->excludes = array('a' => true); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Image.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Image.php deleted file mode 100644 index eb61c038..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Image.php +++ /dev/null @@ -1,40 +0,0 @@ -get('HTML.MaxImgLength'); - $img = $this->addElement( - 'img', 'Inline', 'Empty', 'Common', - array( - 'alt*' => 'Text', - // According to the spec, it's Length, but percents can - // be abused, so we allow only Pixels. - 'height' => 'Pixels#' . $max, - 'width' => 'Pixels#' . $max, - 'longdesc' => 'URI', - 'src*' => new HTMLPurifier_AttrDef_URI(true), // embedded - ) - ); - if ($max === null || $config->get('HTML.Trusted')) { - $img->attr['height'] = - $img->attr['width'] = 'Length'; - } - - // kind of strange, but splitting things up would be inefficient - $img->attr_transform_pre[] = - $img->attr_transform_post[] = - new HTMLPurifier_AttrTransform_ImgRequired(); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Legacy.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Legacy.php deleted file mode 100644 index a65c6170..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Legacy.php +++ /dev/null @@ -1,143 +0,0 @@ -addElement('basefont', 'Inline', 'Empty', false, array( - 'color' => 'Color', - 'face' => 'Text', // extremely broad, we should - 'size' => 'Text', // tighten it - 'id' => 'ID' - )); - $this->addElement('center', 'Block', 'Flow', 'Common'); - $this->addElement('dir', 'Block', 'Required: li', 'Common', array( - 'compact' => 'Bool#compact' - )); - $this->addElement('font', 'Inline', 'Inline', array('Core', 'I18N'), array( - 'color' => 'Color', - 'face' => 'Text', // extremely broad, we should - 'size' => 'Text', // tighten it - )); - $this->addElement('menu', 'Block', 'Required: li', 'Common', array( - 'compact' => 'Bool#compact' - )); - - $s = $this->addElement('s', 'Inline', 'Inline', 'Common'); - $s->formatting = true; - - $strike = $this->addElement('strike', 'Inline', 'Inline', 'Common'); - $strike->formatting = true; - - $u = $this->addElement('u', 'Inline', 'Inline', 'Common'); - $u->formatting = true; - - // setup modifications to old elements - - $align = 'Enum#left,right,center,justify'; - - $address = $this->addBlankElement('address'); - $address->content_model = 'Inline | #PCDATA | p'; - $address->content_model_type = 'optional'; - $address->child = false; - - $blockquote = $this->addBlankElement('blockquote'); - $blockquote->content_model = 'Flow | #PCDATA'; - $blockquote->content_model_type = 'optional'; - $blockquote->child = false; - - $br = $this->addBlankElement('br'); - $br->attr['clear'] = 'Enum#left,all,right,none'; - - $caption = $this->addBlankElement('caption'); - $caption->attr['align'] = 'Enum#top,bottom,left,right'; - - $div = $this->addBlankElement('div'); - $div->attr['align'] = $align; - - $dl = $this->addBlankElement('dl'); - $dl->attr['compact'] = 'Bool#compact'; - - for ($i = 1; $i <= 6; $i++) { - $h = $this->addBlankElement("h$i"); - $h->attr['align'] = $align; - } - - $hr = $this->addBlankElement('hr'); - $hr->attr['align'] = $align; - $hr->attr['noshade'] = 'Bool#noshade'; - $hr->attr['size'] = 'Pixels'; - $hr->attr['width'] = 'Length'; - - $img = $this->addBlankElement('img'); - $img->attr['align'] = 'Enum#top,middle,bottom,left,right'; - $img->attr['border'] = 'Pixels'; - $img->attr['hspace'] = 'Pixels'; - $img->attr['vspace'] = 'Pixels'; - - // figure out this integer business - - $li = $this->addBlankElement('li'); - $li->attr['value'] = new HTMLPurifier_AttrDef_Integer(); - $li->attr['type'] = 'Enum#s:1,i,I,a,A,disc,square,circle'; - - $ol = $this->addBlankElement('ol'); - $ol->attr['compact'] = 'Bool#compact'; - $ol->attr['start'] = new HTMLPurifier_AttrDef_Integer(); - $ol->attr['type'] = 'Enum#s:1,i,I,a,A'; - - $p = $this->addBlankElement('p'); - $p->attr['align'] = $align; - - $pre = $this->addBlankElement('pre'); - $pre->attr['width'] = 'Number'; - - // script omitted - - $table = $this->addBlankElement('table'); - $table->attr['align'] = 'Enum#left,center,right'; - $table->attr['bgcolor'] = 'Color'; - - $tr = $this->addBlankElement('tr'); - $tr->attr['bgcolor'] = 'Color'; - - $th = $this->addBlankElement('th'); - $th->attr['bgcolor'] = 'Color'; - $th->attr['height'] = 'Length'; - $th->attr['nowrap'] = 'Bool#nowrap'; - $th->attr['width'] = 'Length'; - - $td = $this->addBlankElement('td'); - $td->attr['bgcolor'] = 'Color'; - $td->attr['height'] = 'Length'; - $td->attr['nowrap'] = 'Bool#nowrap'; - $td->attr['width'] = 'Length'; - - $ul = $this->addBlankElement('ul'); - $ul->attr['compact'] = 'Bool#compact'; - $ul->attr['type'] = 'Enum#square,disc,circle'; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/List.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/List.php deleted file mode 100644 index 2911a69b..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/List.php +++ /dev/null @@ -1,37 +0,0 @@ - 'List'); - - public function setup($config) { - $ol = $this->addElement('ol', 'List', 'Required: li', 'Common'); - $ol->wrap = "li"; - $ul = $this->addElement('ul', 'List', 'Required: li', 'Common'); - $ul->wrap = "li"; - $this->addElement('dl', 'List', 'Required: dt | dd', 'Common'); - - $this->addElement('li', false, 'Flow', 'Common'); - - $this->addElement('dd', false, 'Flow', 'Common'); - $this->addElement('dt', false, 'Inline', 'Common'); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Name.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Name.php deleted file mode 100644 index c7e27afb..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Name.php +++ /dev/null @@ -1,21 +0,0 @@ -addBlankElement($name); - $element->attr['name'] = 'CDATA'; - if (!$config->get('HTML.Attr.Name.UseCDATA')) { - $element->attr_transform_post['NameSync'] = new HTMLPurifier_AttrTransform_NameSync(); - } - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php deleted file mode 100644 index 8b493ac4..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php +++ /dev/null @@ -1,14 +0,0 @@ - array( - 'lang' => 'LanguageCode', - ) - ); -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Object.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Object.php deleted file mode 100644 index 9277dd56..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Object.php +++ /dev/null @@ -1,47 +0,0 @@ - to cater to legacy browsers: this - * module does not allow this sort of behavior - */ -class HTMLPurifier_HTMLModule_Object extends HTMLPurifier_HTMLModule -{ - - public $name = 'Object'; - public $safe = false; - - public function setup($config) { - - $this->addElement('object', 'Inline', 'Optional: #PCDATA | Flow | param', 'Common', - array( - 'archive' => 'URI', - 'classid' => 'URI', - 'codebase' => 'URI', - 'codetype' => 'Text', - 'data' => 'URI', - 'declare' => 'Bool#declare', - 'height' => 'Length', - 'name' => 'CDATA', - 'standby' => 'Text', - 'tabindex' => 'Number', - 'type' => 'ContentType', - 'width' => 'Length' - ) - ); - - $this->addElement('param', false, 'Empty', false, - array( - 'id' => 'ID', - 'name*' => 'Text', - 'type' => 'Text', - 'value' => 'Text', - 'valuetype' => 'Enum#data,ref,object' - ) - ); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Presentation.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Presentation.php deleted file mode 100644 index 6745977b..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Presentation.php +++ /dev/null @@ -1,36 +0,0 @@ -addElement('hr', 'Block', 'Empty', 'Common'); - $this->addElement('sub', 'Inline', 'Inline', 'Common'); - $this->addElement('sup', 'Inline', 'Inline', 'Common'); - $b = $this->addElement('b', 'Inline', 'Inline', 'Common'); - $b->formatting = true; - $big = $this->addElement('big', 'Inline', 'Inline', 'Common'); - $big->formatting = true; - $i = $this->addElement('i', 'Inline', 'Inline', 'Common'); - $i->formatting = true; - $small = $this->addElement('small', 'Inline', 'Inline', 'Common'); - $small->formatting = true; - $tt = $this->addElement('tt', 'Inline', 'Inline', 'Common'); - $tt->formatting = true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Proprietary.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Proprietary.php deleted file mode 100644 index 176de468..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Proprietary.php +++ /dev/null @@ -1,33 +0,0 @@ -addElement('marquee', 'Inline', 'Flow', 'Common', - array( - 'direction' => 'Enum#left,right,up,down', - 'behavior' => 'Enum#alternate', - 'width' => 'Length', - 'height' => 'Length', - 'scrolldelay' => 'Number', - 'scrollamount' => 'Number', - 'loop' => 'Number', - 'bgcolor' => 'Color', - 'hspace' => 'Pixels', - 'vspace' => 'Pixels', - ) - ); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Ruby.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Ruby.php deleted file mode 100644 index c3f0cbb2..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Ruby.php +++ /dev/null @@ -1,27 +0,0 @@ -addElement('ruby', 'Inline', - 'Custom: ((rb, (rt | (rp, rt, rp))) | (rbc, rtc, rtc?))', - 'Common'); - $this->addElement('rbc', false, 'Required: rb', 'Common'); - $this->addElement('rtc', false, 'Required: rt', 'Common'); - $rb = $this->addElement('rb', false, 'Inline', 'Common'); - $rb->excludes = array('ruby' => true); - $rt = $this->addElement('rt', false, 'Inline', 'Common', array('rbspan' => 'Number')); - $rt->excludes = array('ruby' => true); - $this->addElement('rp', false, 'Optional: #PCDATA', 'Common'); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/SafeEmbed.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/SafeEmbed.php deleted file mode 100644 index 7f602317..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/SafeEmbed.php +++ /dev/null @@ -1,34 +0,0 @@ -get('HTML.MaxImgLength'); - $embed = $this->addElement( - 'embed', 'Inline', 'Empty', 'Common', - array( - 'src*' => 'URI#embedded', - 'type' => 'Enum#application/x-shockwave-flash', - 'width' => 'Pixels#' . $max, - 'height' => 'Pixels#' . $max, - 'allowscriptaccess' => 'Enum#never', - 'allownetworking' => 'Enum#internal', - 'flashvars' => 'Text', - 'wmode' => 'Enum#window', - 'name' => 'ID', - ) - ); - $embed->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeEmbed(); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/SafeObject.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/SafeObject.php deleted file mode 100644 index d3de4f47..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/SafeObject.php +++ /dev/null @@ -1,53 +0,0 @@ -get('HTML.MaxImgLength'); - $object = $this->addElement( - 'object', - 'Inline', - 'Optional: param | Flow | #PCDATA', - 'Common', - array( - // While technically not required by the spec, we're forcing - // it to this value. - 'type' => 'Enum#application/x-shockwave-flash', - 'width' => 'Pixels#' . $max, - 'height' => 'Pixels#' . $max, - 'data' => 'URI#embedded', - 'classid' => 'Enum#clsid:d27cdb6e-ae6d-11cf-96b8-444553540000', - 'codebase' => new HTMLPurifier_AttrDef_Enum(array( - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0')), - ) - ); - $object->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeObject(); - - $param = $this->addElement('param', false, 'Empty', false, - array( - 'id' => 'ID', - 'name*' => 'Text', - 'value' => 'Text' - ) - ); - $param->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeParam(); - $this->info_injector[] = 'SafeObject'; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Scripting.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Scripting.php deleted file mode 100644 index 08502a62..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Scripting.php +++ /dev/null @@ -1,54 +0,0 @@ - 'script | noscript', 'Inline' => 'script | noscript'); - public $safe = false; - - public function setup($config) { - // TODO: create custom child-definition for noscript that - // auto-wraps stray #PCDATA in a similar manner to - // blockquote's custom definition (we would use it but - // blockquote's contents are optional while noscript's contents - // are required) - - // TODO: convert this to new syntax, main problem is getting - // both content sets working - - // In theory, this could be safe, but I don't see any reason to - // allow it. - $this->info['noscript'] = new HTMLPurifier_ElementDef(); - $this->info['noscript']->attr = array( 0 => array('Common') ); - $this->info['noscript']->content_model = 'Heading | List | Block'; - $this->info['noscript']->content_model_type = 'required'; - - $this->info['script'] = new HTMLPurifier_ElementDef(); - $this->info['script']->attr = array( - 'defer' => new HTMLPurifier_AttrDef_Enum(array('defer')), - 'src' => new HTMLPurifier_AttrDef_URI(true), - 'type' => new HTMLPurifier_AttrDef_Enum(array('text/javascript')) - ); - $this->info['script']->content_model = '#PCDATA'; - $this->info['script']->content_model_type = 'optional'; - $this->info['script']->attr_transform_pre['type'] = - $this->info['script']->attr_transform_post['type'] = - new HTMLPurifier_AttrTransform_ScriptRequired(); - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/StyleAttribute.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/StyleAttribute.php deleted file mode 100644 index 47285ceb..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/StyleAttribute.php +++ /dev/null @@ -1,24 +0,0 @@ - array('style' => false), // see constructor - 'Core' => array(0 => array('Style')) - ); - - public function setup($config) { - $this->attr_collections['Style']['style'] = new HTMLPurifier_AttrDef_CSS(); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Tables.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Tables.php deleted file mode 100644 index d0fd0251..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Tables.php +++ /dev/null @@ -1,66 +0,0 @@ -addElement('caption', false, 'Inline', 'Common'); - - $this->addElement('table', 'Block', - new HTMLPurifier_ChildDef_Table(), 'Common', - array( - 'border' => 'Pixels', - 'cellpadding' => 'Length', - 'cellspacing' => 'Length', - 'frame' => 'Enum#void,above,below,hsides,lhs,rhs,vsides,box,border', - 'rules' => 'Enum#none,groups,rows,cols,all', - 'summary' => 'Text', - 'width' => 'Length' - ) - ); - - // common attributes - $cell_align = array( - 'align' => 'Enum#left,center,right,justify,char', - 'charoff' => 'Length', - 'valign' => 'Enum#top,middle,bottom,baseline', - ); - - $cell_t = array_merge( - array( - 'abbr' => 'Text', - 'colspan' => 'Number', - 'rowspan' => 'Number', - ), - $cell_align - ); - $this->addElement('td', false, 'Flow', 'Common', $cell_t); - $this->addElement('th', false, 'Flow', 'Common', $cell_t); - - $this->addElement('tr', false, 'Required: td | th', 'Common', $cell_align); - - $cell_col = array_merge( - array( - 'span' => 'Number', - 'width' => 'MultiLength', - ), - $cell_align - ); - $this->addElement('col', false, 'Empty', 'Common', $cell_col); - $this->addElement('colgroup', false, 'Optional: col', 'Common', $cell_col); - - $this->addElement('tbody', false, 'Required: tr', 'Common', $cell_align); - $this->addElement('thead', false, 'Required: tr', 'Common', $cell_align); - $this->addElement('tfoot', false, 'Required: tr', 'Common', $cell_align); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Target.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Target.php deleted file mode 100644 index 58fa3fae..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Target.php +++ /dev/null @@ -1,23 +0,0 @@ -addBlankElement($name); - $e->attr = array( - 'target' => new HTMLPurifier_AttrDef_HTML_FrameTarget() - ); - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Text.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Text.php deleted file mode 100644 index 768d3f91..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Text.php +++ /dev/null @@ -1,71 +0,0 @@ - 'Heading | Block | Inline' - ); - - public function setup($config) { - - // Inline Phrasal ------------------------------------------------- - $this->addElement('abbr', 'Inline', 'Inline', 'Common'); - $this->addElement('acronym', 'Inline', 'Inline', 'Common'); - $this->addElement('cite', 'Inline', 'Inline', 'Common'); - $this->addElement('dfn', 'Inline', 'Inline', 'Common'); - $this->addElement('kbd', 'Inline', 'Inline', 'Common'); - $this->addElement('q', 'Inline', 'Inline', 'Common', array('cite' => 'URI')); - $this->addElement('samp', 'Inline', 'Inline', 'Common'); - $this->addElement('var', 'Inline', 'Inline', 'Common'); - - $em = $this->addElement('em', 'Inline', 'Inline', 'Common'); - $em->formatting = true; - - $strong = $this->addElement('strong', 'Inline', 'Inline', 'Common'); - $strong->formatting = true; - - $code = $this->addElement('code', 'Inline', 'Inline', 'Common'); - $code->formatting = true; - - // Inline Structural ---------------------------------------------- - $this->addElement('span', 'Inline', 'Inline', 'Common'); - $this->addElement('br', 'Inline', 'Empty', 'Core'); - - // Block Phrasal -------------------------------------------------- - $this->addElement('address', 'Block', 'Inline', 'Common'); - $this->addElement('blockquote', 'Block', 'Optional: Heading | Block | List', 'Common', array('cite' => 'URI') ); - $pre = $this->addElement('pre', 'Block', 'Inline', 'Common'); - $pre->excludes = $this->makeLookup( - 'img', 'big', 'small', 'object', 'applet', 'font', 'basefont' ); - $this->addElement('h1', 'Heading', 'Inline', 'Common'); - $this->addElement('h2', 'Heading', 'Inline', 'Common'); - $this->addElement('h3', 'Heading', 'Inline', 'Common'); - $this->addElement('h4', 'Heading', 'Inline', 'Common'); - $this->addElement('h5', 'Heading', 'Inline', 'Common'); - $this->addElement('h6', 'Heading', 'Inline', 'Common'); - - // Block Structural ----------------------------------------------- - $p = $this->addElement('p', 'Block', 'Inline', 'Common'); - $p->autoclose = array_flip(array("address", "blockquote", "center", "dir", "div", "dl", "fieldset", "ol", "p", "ul")); - - $this->addElement('div', 'Block', 'Flow', 'Common'); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Tidy.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Tidy.php deleted file mode 100644 index b39823aa..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Tidy.php +++ /dev/null @@ -1,207 +0,0 @@ - 'none', 'light', 'medium', 'heavy'); - - /** - * Default level to place all fixes in. Disabled by default - */ - public $defaultLevel = null; - - /** - * Lists of fixes used by getFixesForLevel(). Format is: - * HTMLModule_Tidy->fixesForLevel[$level] = array('fix-1', 'fix-2'); - */ - public $fixesForLevel = array( - 'light' => array(), - 'medium' => array(), - 'heavy' => array() - ); - - /** - * Lazy load constructs the module by determining the necessary - * fixes to create and then delegating to the populate() function. - * @todo Wildcard matching and error reporting when an added or - * subtracted fix has no effect. - */ - public function setup($config) { - - // create fixes, initialize fixesForLevel - $fixes = $this->makeFixes(); - $this->makeFixesForLevel($fixes); - - // figure out which fixes to use - $level = $config->get('HTML.TidyLevel'); - $fixes_lookup = $this->getFixesForLevel($level); - - // get custom fix declarations: these need namespace processing - $add_fixes = $config->get('HTML.TidyAdd'); - $remove_fixes = $config->get('HTML.TidyRemove'); - - foreach ($fixes as $name => $fix) { - // needs to be refactored a little to implement globbing - if ( - isset($remove_fixes[$name]) || - (!isset($add_fixes[$name]) && !isset($fixes_lookup[$name])) - ) { - unset($fixes[$name]); - } - } - - // populate this module with necessary fixes - $this->populate($fixes); - - } - - /** - * Retrieves all fixes per a level, returning fixes for that specific - * level as well as all levels below it. - * @param $level String level identifier, see $levels for valid values - * @return Lookup up table of fixes - */ - public function getFixesForLevel($level) { - if ($level == $this->levels[0]) { - return array(); - } - $activated_levels = array(); - for ($i = 1, $c = count($this->levels); $i < $c; $i++) { - $activated_levels[] = $this->levels[$i]; - if ($this->levels[$i] == $level) break; - } - if ($i == $c) { - trigger_error( - 'Tidy level ' . htmlspecialchars($level) . ' not recognized', - E_USER_WARNING - ); - return array(); - } - $ret = array(); - foreach ($activated_levels as $level) { - foreach ($this->fixesForLevel[$level] as $fix) { - $ret[$fix] = true; - } - } - return $ret; - } - - /** - * Dynamically populates the $fixesForLevel member variable using - * the fixes array. It may be custom overloaded, used in conjunction - * with $defaultLevel, or not used at all. - */ - public function makeFixesForLevel($fixes) { - if (!isset($this->defaultLevel)) return; - if (!isset($this->fixesForLevel[$this->defaultLevel])) { - trigger_error( - 'Default level ' . $this->defaultLevel . ' does not exist', - E_USER_ERROR - ); - return; - } - $this->fixesForLevel[$this->defaultLevel] = array_keys($fixes); - } - - /** - * Populates the module with transforms and other special-case code - * based on a list of fixes passed to it - * @param $lookup Lookup table of fixes to activate - */ - public function populate($fixes) { - foreach ($fixes as $name => $fix) { - // determine what the fix is for - list($type, $params) = $this->getFixType($name); - switch ($type) { - case 'attr_transform_pre': - case 'attr_transform_post': - $attr = $params['attr']; - if (isset($params['element'])) { - $element = $params['element']; - if (empty($this->info[$element])) { - $e = $this->addBlankElement($element); - } else { - $e = $this->info[$element]; - } - } else { - $type = "info_$type"; - $e = $this; - } - // PHP does some weird parsing when I do - // $e->$type[$attr], so I have to assign a ref. - $f =& $e->$type; - $f[$attr] = $fix; - break; - case 'tag_transform': - $this->info_tag_transform[$params['element']] = $fix; - break; - case 'child': - case 'content_model_type': - $element = $params['element']; - if (empty($this->info[$element])) { - $e = $this->addBlankElement($element); - } else { - $e = $this->info[$element]; - } - $e->$type = $fix; - break; - default: - trigger_error("Fix type $type not supported", E_USER_ERROR); - break; - } - } - } - - /** - * Parses a fix name and determines what kind of fix it is, as well - * as other information defined by the fix - * @param $name String name of fix - * @return array(string $fix_type, array $fix_parameters) - * @note $fix_parameters is type dependant, see populate() for usage - * of these parameters - */ - public function getFixType($name) { - // parse it - $property = $attr = null; - if (strpos($name, '#') !== false) list($name, $property) = explode('#', $name); - if (strpos($name, '@') !== false) list($name, $attr) = explode('@', $name); - - // figure out the parameters - $params = array(); - if ($name !== '') $params['element'] = $name; - if (!is_null($attr)) $params['attr'] = $attr; - - // special case: attribute transform - if (!is_null($attr)) { - if (is_null($property)) $property = 'pre'; - $type = 'attr_transform_' . $property; - return array($type, $params); - } - - // special case: tag transform - if (is_null($property)) { - return array('tag_transform', $params); - } - - return array($property, $params); - - } - - /** - * Defines all fixes the module will perform in a compact - * associative array of fix name to fix implementation. - */ - public function makeFixes() {} - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Tidy/Name.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Tidy/Name.php deleted file mode 100644 index d537bf2b..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Tidy/Name.php +++ /dev/null @@ -1,24 +0,0 @@ -content_model_type != 'strictblockquote') return parent::getChildDef($def); - return new HTMLPurifier_ChildDef_StrictBlockquote($def->content_model); - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Tidy/Transitional.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Tidy/Transitional.php deleted file mode 100644 index a9d3a571..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/Tidy/Transitional.php +++ /dev/null @@ -1,9 +0,0 @@ - 'text-align:left;', - 'right' => 'text-align:right;', - 'top' => 'caption-side:top;', - 'bottom' => 'caption-side:bottom;' // not supported by IE - )); - - // @align for img ------------------------------------------------- - $r['img@align'] = - new HTMLPurifier_AttrTransform_EnumToCSS('align', array( - 'left' => 'float:left;', - 'right' => 'float:right;', - 'top' => 'vertical-align:top;', - 'middle' => 'vertical-align:middle;', - 'bottom' => 'vertical-align:baseline;', - )); - - // @align for table ----------------------------------------------- - $r['table@align'] = - new HTMLPurifier_AttrTransform_EnumToCSS('align', array( - 'left' => 'float:left;', - 'center' => 'margin-left:auto;margin-right:auto;', - 'right' => 'float:right;' - )); - - // @align for hr ----------------------------------------------- - $r['hr@align'] = - new HTMLPurifier_AttrTransform_EnumToCSS('align', array( - // we use both text-align and margin because these work - // for different browsers (IE and Firefox, respectively) - // and the melange makes for a pretty cross-compatible - // solution - 'left' => 'margin-left:0;margin-right:auto;text-align:left;', - 'center' => 'margin-left:auto;margin-right:auto;text-align:center;', - 'right' => 'margin-left:auto;margin-right:0;text-align:right;' - )); - - // @align for h1, h2, h3, h4, h5, h6, p, div ---------------------- - // {{{ - $align_lookup = array(); - $align_values = array('left', 'right', 'center', 'justify'); - foreach ($align_values as $v) $align_lookup[$v] = "text-align:$v;"; - // }}} - $r['h1@align'] = - $r['h2@align'] = - $r['h3@align'] = - $r['h4@align'] = - $r['h5@align'] = - $r['h6@align'] = - $r['p@align'] = - $r['div@align'] = - new HTMLPurifier_AttrTransform_EnumToCSS('align', $align_lookup); - - // @bgcolor for table, tr, td, th --------------------------------- - $r['table@bgcolor'] = - $r['td@bgcolor'] = - $r['th@bgcolor'] = - new HTMLPurifier_AttrTransform_BgColor(); - - // @border for img ------------------------------------------------ - $r['img@border'] = new HTMLPurifier_AttrTransform_Border(); - - // @clear for br -------------------------------------------------- - $r['br@clear'] = - new HTMLPurifier_AttrTransform_EnumToCSS('clear', array( - 'left' => 'clear:left;', - 'right' => 'clear:right;', - 'all' => 'clear:both;', - 'none' => 'clear:none;', - )); - - // @height for td, th --------------------------------------------- - $r['td@height'] = - $r['th@height'] = - new HTMLPurifier_AttrTransform_Length('height'); - - // @hspace for img ------------------------------------------------ - $r['img@hspace'] = new HTMLPurifier_AttrTransform_ImgSpace('hspace'); - - // @noshade for hr ------------------------------------------------ - // this transformation is not precise but often good enough. - // different browsers use different styles to designate noshade - $r['hr@noshade'] = - new HTMLPurifier_AttrTransform_BoolToCSS( - 'noshade', - 'color:#808080;background-color:#808080;border:0;' - ); - - // @nowrap for td, th --------------------------------------------- - $r['td@nowrap'] = - $r['th@nowrap'] = - new HTMLPurifier_AttrTransform_BoolToCSS( - 'nowrap', - 'white-space:nowrap;' - ); - - // @size for hr -------------------------------------------------- - $r['hr@size'] = new HTMLPurifier_AttrTransform_Length('size', 'height'); - - // @type for li, ol, ul ------------------------------------------- - // {{{ - $ul_types = array( - 'disc' => 'list-style-type:disc;', - 'square' => 'list-style-type:square;', - 'circle' => 'list-style-type:circle;' - ); - $ol_types = array( - '1' => 'list-style-type:decimal;', - 'i' => 'list-style-type:lower-roman;', - 'I' => 'list-style-type:upper-roman;', - 'a' => 'list-style-type:lower-alpha;', - 'A' => 'list-style-type:upper-alpha;' - ); - $li_types = $ul_types + $ol_types; - // }}} - - $r['ul@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $ul_types); - $r['ol@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $ol_types, true); - $r['li@type'] = new HTMLPurifier_AttrTransform_EnumToCSS('type', $li_types, true); - - // @vspace for img ------------------------------------------------ - $r['img@vspace'] = new HTMLPurifier_AttrTransform_ImgSpace('vspace'); - - // @width for hr, td, th ------------------------------------------ - $r['td@width'] = - $r['th@width'] = - $r['hr@width'] = new HTMLPurifier_AttrTransform_Length('width'); - - return $r; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/XMLCommonAttributes.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/XMLCommonAttributes.php deleted file mode 100644 index abe458e8..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModule/XMLCommonAttributes.php +++ /dev/null @@ -1,14 +0,0 @@ - array( - 'xml:lang' => 'LanguageCode', - ) - ); -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModuleManager.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModuleManager.php deleted file mode 100644 index fbf477fe..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/HTMLModuleManager.php +++ /dev/null @@ -1,403 +0,0 @@ -attrTypes = new HTMLPurifier_AttrTypes(); - $this->doctypes = new HTMLPurifier_DoctypeRegistry(); - - // setup basic modules - $common = array( - 'CommonAttributes', 'Text', 'Hypertext', 'List', - 'Presentation', 'Edit', 'Bdo', 'Tables', 'Image', - 'StyleAttribute', - // Unsafe: - 'Scripting', 'Object', 'Forms', - // Sorta legacy, but present in strict: - 'Name', - ); - $transitional = array('Legacy', 'Target'); - $xml = array('XMLCommonAttributes'); - $non_xml = array('NonXMLCommonAttributes'); - - // setup basic doctypes - $this->doctypes->register( - 'HTML 4.01 Transitional', false, - array_merge($common, $transitional, $non_xml), - array('Tidy_Transitional', 'Tidy_Proprietary'), - array(), - '-//W3C//DTD HTML 4.01 Transitional//EN', - 'http://www.w3.org/TR/html4/loose.dtd' - ); - - $this->doctypes->register( - 'HTML 4.01 Strict', false, - array_merge($common, $non_xml), - array('Tidy_Strict', 'Tidy_Proprietary', 'Tidy_Name'), - array(), - '-//W3C//DTD HTML 4.01//EN', - 'http://www.w3.org/TR/html4/strict.dtd' - ); - - $this->doctypes->register( - 'XHTML 1.0 Transitional', true, - array_merge($common, $transitional, $xml, $non_xml), - array('Tidy_Transitional', 'Tidy_XHTML', 'Tidy_Proprietary', 'Tidy_Name'), - array(), - '-//W3C//DTD XHTML 1.0 Transitional//EN', - 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd' - ); - - $this->doctypes->register( - 'XHTML 1.0 Strict', true, - array_merge($common, $xml, $non_xml), - array('Tidy_Strict', 'Tidy_XHTML', 'Tidy_Strict', 'Tidy_Proprietary', 'Tidy_Name'), - array(), - '-//W3C//DTD XHTML 1.0 Strict//EN', - 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd' - ); - - $this->doctypes->register( - 'XHTML 1.1', true, - array_merge($common, $xml, array('Ruby')), - array('Tidy_Strict', 'Tidy_XHTML', 'Tidy_Proprietary', 'Tidy_Strict', 'Tidy_Name'), // Tidy_XHTML1_1 - array(), - '-//W3C//DTD XHTML 1.1//EN', - 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd' - ); - - } - - /** - * Registers a module to the recognized module list, useful for - * overloading pre-existing modules. - * @param $module Mixed: string module name, with or without - * HTMLPurifier_HTMLModule prefix, or instance of - * subclass of HTMLPurifier_HTMLModule. - * @param $overload Boolean whether or not to overload previous modules. - * If this is not set, and you do overload a module, - * HTML Purifier will complain with a warning. - * @note This function will not call autoload, you must instantiate - * (and thus invoke) autoload outside the method. - * @note If a string is passed as a module name, different variants - * will be tested in this order: - * - Check for HTMLPurifier_HTMLModule_$name - * - Check all prefixes with $name in order they were added - * - Check for literal object name - * - Throw fatal error - * If your object name collides with an internal class, specify - * your module manually. All modules must have been included - * externally: registerModule will not perform inclusions for you! - */ - public function registerModule($module, $overload = false) { - if (is_string($module)) { - // attempt to load the module - $original_module = $module; - $ok = false; - foreach ($this->prefixes as $prefix) { - $module = $prefix . $original_module; - if (class_exists($module)) { - $ok = true; - break; - } - } - if (!$ok) { - $module = $original_module; - if (!class_exists($module)) { - trigger_error($original_module . ' module does not exist', - E_USER_ERROR); - return; - } - } - $module = new $module(); - } - if (empty($module->name)) { - trigger_error('Module instance of ' . get_class($module) . ' must have name'); - return; - } - if (!$overload && isset($this->registeredModules[$module->name])) { - trigger_error('Overloading ' . $module->name . ' without explicit overload parameter', E_USER_WARNING); - } - $this->registeredModules[$module->name] = $module; - } - - /** - * Adds a module to the current doctype by first registering it, - * and then tacking it on to the active doctype - */ - public function addModule($module) { - $this->registerModule($module); - if (is_object($module)) $module = $module->name; - $this->userModules[] = $module; - } - - /** - * Adds a class prefix that registerModule() will use to resolve a - * string name to a concrete class - */ - public function addPrefix($prefix) { - $this->prefixes[] = $prefix; - } - - /** - * Performs processing on modules, after being called you may - * use getElement() and getElements() - * @param $config Instance of HTMLPurifier_Config - */ - public function setup($config) { - - $this->trusted = $config->get('HTML.Trusted'); - - // generate - $this->doctype = $this->doctypes->make($config); - $modules = $this->doctype->modules; - - // take out the default modules that aren't allowed - $lookup = $config->get('HTML.AllowedModules'); - $special_cases = $config->get('HTML.CoreModules'); - - if (is_array($lookup)) { - foreach ($modules as $k => $m) { - if (isset($special_cases[$m])) continue; - if (!isset($lookup[$m])) unset($modules[$k]); - } - } - - // add proprietary module (this gets special treatment because - // it is completely removed from doctypes, etc.) - if ($config->get('HTML.Proprietary')) { - $modules[] = 'Proprietary'; - } - - // add SafeObject/Safeembed modules - if ($config->get('HTML.SafeObject')) { - $modules[] = 'SafeObject'; - } - if ($config->get('HTML.SafeEmbed')) { - $modules[] = 'SafeEmbed'; - } - - // merge in custom modules - $modules = array_merge($modules, $this->userModules); - - foreach ($modules as $module) { - $this->processModule($module); - $this->modules[$module]->setup($config); - } - - foreach ($this->doctype->tidyModules as $module) { - $this->processModule($module); - $this->modules[$module]->setup($config); - } - - // prepare any injectors - foreach ($this->modules as $module) { - $n = array(); - foreach ($module->info_injector as $i => $injector) { - if (!is_object($injector)) { - $class = "HTMLPurifier_Injector_$injector"; - $injector = new $class; - } - $n[$injector->name] = $injector; - } - $module->info_injector = $n; - } - - // setup lookup table based on all valid modules - foreach ($this->modules as $module) { - foreach ($module->info as $name => $def) { - if (!isset($this->elementLookup[$name])) { - $this->elementLookup[$name] = array(); - } - $this->elementLookup[$name][] = $module->name; - } - } - - // note the different choice - $this->contentSets = new HTMLPurifier_ContentSets( - // content set assembly deals with all possible modules, - // not just ones deemed to be "safe" - $this->modules - ); - $this->attrCollections = new HTMLPurifier_AttrCollections( - $this->attrTypes, - // there is no way to directly disable a global attribute, - // but using AllowedAttributes or simply not including - // the module in your custom doctype should be sufficient - $this->modules - ); - } - - /** - * Takes a module and adds it to the active module collection, - * registering it if necessary. - */ - public function processModule($module) { - if (!isset($this->registeredModules[$module]) || is_object($module)) { - $this->registerModule($module); - } - $this->modules[$module] = $this->registeredModules[$module]; - } - - /** - * Retrieves merged element definitions. - * @return Array of HTMLPurifier_ElementDef - */ - public function getElements() { - - $elements = array(); - foreach ($this->modules as $module) { - if (!$this->trusted && !$module->safe) continue; - foreach ($module->info as $name => $v) { - if (isset($elements[$name])) continue; - $elements[$name] = $this->getElement($name); - } - } - - // remove dud elements, this happens when an element that - // appeared to be safe actually wasn't - foreach ($elements as $n => $v) { - if ($v === false) unset($elements[$n]); - } - - return $elements; - - } - - /** - * Retrieves a single merged element definition - * @param $name Name of element - * @param $trusted Boolean trusted overriding parameter: set to true - * if you want the full version of an element - * @return Merged HTMLPurifier_ElementDef - * @note You may notice that modules are getting iterated over twice (once - * in getElements() and once here). This - * is because - */ - public function getElement($name, $trusted = null) { - - if (!isset($this->elementLookup[$name])) { - return false; - } - - // setup global state variables - $def = false; - if ($trusted === null) $trusted = $this->trusted; - - // iterate through each module that has registered itself to this - // element - foreach($this->elementLookup[$name] as $module_name) { - - $module = $this->modules[$module_name]; - - // refuse to create/merge from a module that is deemed unsafe-- - // pretend the module doesn't exist--when trusted mode is not on. - if (!$trusted && !$module->safe) { - continue; - } - - // clone is used because, ideally speaking, the original - // definition should not be modified. Usually, this will - // make no difference, but for consistency's sake - $new_def = clone $module->info[$name]; - - if (!$def && $new_def->standalone) { - $def = $new_def; - } elseif ($def) { - // This will occur even if $new_def is standalone. In practice, - // this will usually result in a full replacement. - $def->mergeIn($new_def); - } else { - // :TODO: - // non-standalone definitions that don't have a standalone - // to merge into could be deferred to the end - continue; - } - - // attribute value expansions - $this->attrCollections->performInclusions($def->attr); - $this->attrCollections->expandIdentifiers($def->attr, $this->attrTypes); - - // descendants_are_inline, for ChildDef_Chameleon - if (is_string($def->content_model) && - strpos($def->content_model, 'Inline') !== false) { - if ($name != 'del' && $name != 'ins') { - // this is for you, ins/del - $def->descendants_are_inline = true; - } - } - - $this->contentSets->generateChildDef($def, $module); - } - - // This can occur if there is a blank definition, but no base to - // mix it in with - if (!$def) return false; - - // add information on required attributes - foreach ($def->attr as $attr_name => $attr_def) { - if ($attr_def->required) { - $def->required_attr[] = $attr_name; - } - } - - return $def; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/IDAccumulator.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/IDAccumulator.php deleted file mode 100644 index ea454e82..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/IDAccumulator.php +++ /dev/null @@ -1,53 +0,0 @@ -load($config->get('Attr.IDBlacklist')); - return $id_accumulator; - } - - /** - * Add an ID to the lookup table. - * @param $id ID to be added. - * @return Bool status, true if success, false if there's a dupe - */ - public function add($id) { - if (isset($this->ids[$id])) return false; - return $this->ids[$id] = true; - } - - /** - * Load a list of IDs into the lookup table - * @param $array_of_ids Array of IDs to load - * @note This function doesn't care about duplicates - */ - public function load($array_of_ids) { - foreach ($array_of_ids as $id) { - $this->ids[$id] = true; - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector.php deleted file mode 100644 index 3e1f5875..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector.php +++ /dev/null @@ -1,239 +0,0 @@ -processToken() - * documentation. - * - * @todo Allow injectors to request a re-run on their output. This - * would help if an operation is recursive. - */ -abstract class HTMLPurifier_Injector -{ - - /** - * Advisory name of injector, this is for friendly error messages - */ - public $name; - - /** - * Instance of HTMLPurifier_HTMLDefinition - */ - protected $htmlDefinition; - - /** - * Reference to CurrentNesting variable in Context. This is an array - * list of tokens that we are currently "inside" - */ - protected $currentNesting; - - /** - * Reference to InputTokens variable in Context. This is an array - * list of the input tokens that are being processed. - */ - protected $inputTokens; - - /** - * Reference to InputIndex variable in Context. This is an integer - * array index for $this->inputTokens that indicates what token - * is currently being processed. - */ - protected $inputIndex; - - /** - * Array of elements and attributes this injector creates and therefore - * need to be allowed by the definition. Takes form of - * array('element' => array('attr', 'attr2'), 'element2') - */ - public $needed = array(); - - /** - * Index of inputTokens to rewind to. - */ - protected $rewind = false; - - /** - * Rewind to a spot to re-perform processing. This is useful if you - * deleted a node, and now need to see if this change affected any - * earlier nodes. Rewinding does not affect other injectors, and can - * result in infinite loops if not used carefully. - * @warning HTML Purifier will prevent you from fast-forwarding with this - * function. - */ - public function rewind($index) { - $this->rewind = $index; - } - - /** - * Retrieves rewind, and then unsets it. - */ - public function getRewind() { - $r = $this->rewind; - $this->rewind = false; - return $r; - } - - /** - * Prepares the injector by giving it the config and context objects: - * this allows references to important variables to be made within - * the injector. This function also checks if the HTML environment - * will work with the Injector (see checkNeeded()). - * @param $config Instance of HTMLPurifier_Config - * @param $context Instance of HTMLPurifier_Context - * @return Boolean false if success, string of missing needed element/attribute if failure - */ - public function prepare($config, $context) { - $this->htmlDefinition = $config->getHTMLDefinition(); - // Even though this might fail, some unit tests ignore this and - // still test checkNeeded, so be careful. Maybe get rid of that - // dependency. - $result = $this->checkNeeded($config); - if ($result !== false) return $result; - $this->currentNesting =& $context->get('CurrentNesting'); - $this->inputTokens =& $context->get('InputTokens'); - $this->inputIndex =& $context->get('InputIndex'); - return false; - } - - /** - * This function checks if the HTML environment - * will work with the Injector: if p tags are not allowed, the - * Auto-Paragraphing injector should not be enabled. - * @param $config Instance of HTMLPurifier_Config - * @param $context Instance of HTMLPurifier_Context - * @return Boolean false if success, string of missing needed element/attribute if failure - */ - public function checkNeeded($config) { - $def = $config->getHTMLDefinition(); - foreach ($this->needed as $element => $attributes) { - if (is_int($element)) $element = $attributes; - if (!isset($def->info[$element])) return $element; - if (!is_array($attributes)) continue; - foreach ($attributes as $name) { - if (!isset($def->info[$element]->attr[$name])) return "$element.$name"; - } - } - return false; - } - - /** - * Tests if the context node allows a certain element - * @param $name Name of element to test for - * @return True if element is allowed, false if it is not - */ - public function allowsElement($name) { - if (!empty($this->currentNesting)) { - $parent_token = array_pop($this->currentNesting); - $this->currentNesting[] = $parent_token; - $parent = $this->htmlDefinition->info[$parent_token->name]; - } else { - $parent = $this->htmlDefinition->info_parent_def; - } - if (!isset($parent->child->elements[$name]) || isset($parent->excludes[$name])) { - return false; - } - // check for exclusion - for ($i = count($this->currentNesting) - 2; $i >= 0; $i--) { - $node = $this->currentNesting[$i]; - $def = $this->htmlDefinition->info[$node->name]; - if (isset($def->excludes[$name])) return false; - } - return true; - } - - /** - * Iterator function, which starts with the next token and continues until - * you reach the end of the input tokens. - * @warning Please prevent previous references from interfering with this - * functions by setting $i = null beforehand! - * @param &$i Current integer index variable for inputTokens - * @param &$current Current token variable. Do NOT use $token, as that variable is also a reference - */ - protected function forward(&$i, &$current) { - if ($i === null) $i = $this->inputIndex + 1; - else $i++; - if (!isset($this->inputTokens[$i])) return false; - $current = $this->inputTokens[$i]; - return true; - } - - /** - * Similar to _forward, but accepts a third parameter $nesting (which - * should be initialized at 0) and stops when we hit the end tag - * for the node $this->inputIndex starts in. - */ - protected function forwardUntilEndToken(&$i, &$current, &$nesting) { - $result = $this->forward($i, $current); - if (!$result) return false; - if ($nesting === null) $nesting = 0; - if ($current instanceof HTMLPurifier_Token_Start) $nesting++; - elseif ($current instanceof HTMLPurifier_Token_End) { - if ($nesting <= 0) return false; - $nesting--; - } - return true; - } - - /** - * Iterator function, starts with the previous token and continues until - * you reach the beginning of input tokens. - * @warning Please prevent previous references from interfering with this - * functions by setting $i = null beforehand! - * @param &$i Current integer index variable for inputTokens - * @param &$current Current token variable. Do NOT use $token, as that variable is also a reference - */ - protected function backward(&$i, &$current) { - if ($i === null) $i = $this->inputIndex - 1; - else $i--; - if ($i < 0) return false; - $current = $this->inputTokens[$i]; - return true; - } - - /** - * Initializes the iterator at the current position. Use in a do {} while; - * loop to force the _forward and _backward functions to start at the - * current location. - * @warning Please prevent previous references from interfering with this - * functions by setting $i = null beforehand! - * @param &$i Current integer index variable for inputTokens - * @param &$current Current token variable. Do NOT use $token, as that variable is also a reference - */ - protected function current(&$i, &$current) { - if ($i === null) $i = $this->inputIndex; - $current = $this->inputTokens[$i]; - } - - /** - * Handler that is called when a text token is processed - */ - public function handleText(&$token) {} - - /** - * Handler that is called when a start or empty token is processed - */ - public function handleElement(&$token) {} - - /** - * Handler that is called when an end token is processed - */ - public function handleEnd(&$token) { - $this->notifyEnd($token); - } - - /** - * Notifier that is called when an end token is processed - * @note This differs from handlers in that the token is read-only - * @deprecated - */ - public function notifyEnd($token) {} - - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/AutoParagraph.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/AutoParagraph.php deleted file mode 100644 index 72152d81..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/AutoParagraph.php +++ /dev/null @@ -1,345 +0,0 @@ -armor['MakeWellFormed_TagClosedError'] = true; - return $par; - } - - public function handleText(&$token) { - $text = $token->data; - // Does the current parent allow

      tags? - if ($this->allowsElement('p')) { - if (empty($this->currentNesting) || strpos($text, "\n\n") !== false) { - // Note that we have differing behavior when dealing with text - // in the anonymous root node, or a node inside the document. - // If the text as a double-newline, the treatment is the same; - // if it doesn't, see the next if-block if you're in the document. - - $i = $nesting = null; - if (!$this->forwardUntilEndToken($i, $current, $nesting) && $token->is_whitespace) { - // State 1.1: ... ^ (whitespace, then document end) - // ---- - // This is a degenerate case - } else { - if (!$token->is_whitespace || $this->_isInline($current)) { - // State 1.2: PAR1 - // ---- - - // State 1.3: PAR1\n\nPAR2 - // ------------ - - // State 1.4:

      PAR1\n\nPAR2 (see State 2) - // ------------ - $token = array($this->_pStart()); - $this->_splitText($text, $token); - } else { - // State 1.5: \n
      - // -- - } - } - } else { - // State 2:
      PAR1... (similar to 1.4) - // ---- - - // We're in an element that allows paragraph tags, but we're not - // sure if we're going to need them. - if ($this->_pLookAhead()) { - // State 2.1:
      PAR1PAR1\n\nPAR2 - // ---- - // Note: This will always be the first child, since any - // previous inline element would have triggered this very - // same routine, and found the double newline. One possible - // exception would be a comment. - $token = array($this->_pStart(), $token); - } else { - // State 2.2.1:
      PAR1
      - // ---- - - // State 2.2.2:
      PAR1PAR1
      - // ---- - } - } - // Is the current parent a

      tag? - } elseif ( - !empty($this->currentNesting) && - $this->currentNesting[count($this->currentNesting)-1]->name == 'p' - ) { - // State 3.1: ...

      PAR1 - // ---- - - // State 3.2: ...

      PAR1\n\nPAR2 - // ------------ - $token = array(); - $this->_splitText($text, $token); - // Abort! - } else { - // State 4.1: ...PAR1 - // ---- - - // State 4.2: ...PAR1\n\nPAR2 - // ------------ - } - } - - public function handleElement(&$token) { - // We don't have to check if we're already in a

      tag for block - // tokens, because the tag would have been autoclosed by MakeWellFormed. - if ($this->allowsElement('p')) { - if (!empty($this->currentNesting)) { - if ($this->_isInline($token)) { - // State 1:

      ... - // --- - - // Check if this token is adjacent to the parent token - // (seek backwards until token isn't whitespace) - $i = null; - $this->backward($i, $prev); - - if (!$prev instanceof HTMLPurifier_Token_Start) { - // Token wasn't adjacent - - if ( - $prev instanceof HTMLPurifier_Token_Text && - substr($prev->data, -2) === "\n\n" - ) { - // State 1.1.4:

      PAR1

      \n\n - // --- - - // Quite frankly, this should be handled by splitText - $token = array($this->_pStart(), $token); - } else { - // State 1.1.1:

      PAR1

      - // --- - - // State 1.1.2:

      - // --- - - // State 1.1.3:
      PAR - // --- - } - - } else { - // State 1.2.1:
      - // --- - - // Lookahead to see if

      is needed. - if ($this->_pLookAhead()) { - // State 1.3.1:

      PAR1\n\nPAR2 - // --- - $token = array($this->_pStart(), $token); - } else { - // State 1.3.2:
      PAR1
      - // --- - - // State 1.3.3:
      PAR1
      \n\n
      - // --- - } - } - } else { - // State 2.3: ...
      - // ----- - } - } else { - if ($this->_isInline($token)) { - // State 3.1: - // --- - // This is where the {p} tag is inserted, not reflected in - // inputTokens yet, however. - $token = array($this->_pStart(), $token); - } else { - // State 3.2:
      - // ----- - } - - $i = null; - if ($this->backward($i, $prev)) { - if ( - !$prev instanceof HTMLPurifier_Token_Text - ) { - // State 3.1.1: ...

      {p} - // --- - - // State 3.2.1: ...

      - // ----- - - if (!is_array($token)) $token = array($token); - array_unshift($token, new HTMLPurifier_Token_Text("\n\n")); - } else { - // State 3.1.2: ...

      \n\n{p} - // --- - - // State 3.2.2: ...

      \n\n
      - // ----- - - // Note: PAR cannot occur because PAR would have been - // wrapped in

      tags. - } - } - } - } else { - // State 2.2:

      • - // ---- - - // State 2.4:

        - // --- - } - } - - /** - * Splits up a text in paragraph tokens and appends them - * to the result stream that will replace the original - * @param $data String text data that will be processed - * into paragraphs - * @param $result Reference to array of tokens that the - * tags will be appended onto - * @param $config Instance of HTMLPurifier_Config - * @param $context Instance of HTMLPurifier_Context - */ - private function _splitText($data, &$result) { - $raw_paragraphs = explode("\n\n", $data); - $paragraphs = array(); // without empty paragraphs - $needs_start = false; - $needs_end = false; - - $c = count($raw_paragraphs); - if ($c == 1) { - // There were no double-newlines, abort quickly. In theory this - // should never happen. - $result[] = new HTMLPurifier_Token_Text($data); - return; - } - for ($i = 0; $i < $c; $i++) { - $par = $raw_paragraphs[$i]; - if (trim($par) !== '') { - $paragraphs[] = $par; - } else { - if ($i == 0) { - // Double newline at the front - if (empty($result)) { - // The empty result indicates that the AutoParagraph - // injector did not add any start paragraph tokens. - // This means that we have been in a paragraph for - // a while, and the newline means we should start a new one. - $result[] = new HTMLPurifier_Token_End('p'); - $result[] = new HTMLPurifier_Token_Text("\n\n"); - // However, the start token should only be added if - // there is more processing to be done (i.e. there are - // real paragraphs in here). If there are none, the - // next start paragraph tag will be handled by the - // next call to the injector - $needs_start = true; - } else { - // We just started a new paragraph! - // Reinstate a double-newline for presentation's sake, since - // it was in the source code. - array_unshift($result, new HTMLPurifier_Token_Text("\n\n")); - } - } elseif ($i + 1 == $c) { - // Double newline at the end - // There should be a trailing

        when we're finally done. - $needs_end = true; - } - } - } - - // Check if this was just a giant blob of whitespace. Move this earlier, - // perhaps? - if (empty($paragraphs)) { - return; - } - - // Add the start tag indicated by \n\n at the beginning of $data - if ($needs_start) { - $result[] = $this->_pStart(); - } - - // Append the paragraphs onto the result - foreach ($paragraphs as $par) { - $result[] = new HTMLPurifier_Token_Text($par); - $result[] = new HTMLPurifier_Token_End('p'); - $result[] = new HTMLPurifier_Token_Text("\n\n"); - $result[] = $this->_pStart(); - } - - // Remove trailing start token; Injector will handle this later if - // it was indeed needed. This prevents from needing to do a lookahead, - // at the cost of a lookbehind later. - array_pop($result); - - // If there is no need for an end tag, remove all of it and let - // MakeWellFormed close it later. - if (!$needs_end) { - array_pop($result); // removes \n\n - array_pop($result); // removes

        - } - - } - - /** - * Returns true if passed token is inline (and, ergo, allowed in - * paragraph tags) - */ - private function _isInline($token) { - return isset($this->htmlDefinition->info['p']->child->elements[$token->name]); - } - - /** - * Looks ahead in the token list and determines whether or not we need - * to insert a

        tag. - */ - private function _pLookAhead() { - $this->current($i, $current); - if ($current instanceof HTMLPurifier_Token_Start) $nesting = 1; - else $nesting = 0; - $ok = false; - while ($this->forwardUntilEndToken($i, $current, $nesting)) { - $result = $this->_checkNeedsP($current); - if ($result !== null) { - $ok = $result; - break; - } - } - return $ok; - } - - /** - * Determines if a particular token requires an earlier inline token - * to get a paragraph. This should be used with _forwardUntilEndToken - */ - private function _checkNeedsP($current) { - if ($current instanceof HTMLPurifier_Token_Start){ - if (!$this->_isInline($current)) { - //

        PAR1
        - // ---- - // Terminate early, since we hit a block element - return false; - } - } elseif ($current instanceof HTMLPurifier_Token_Text) { - if (strpos($current->data, "\n\n") !== false) { - //
        PAR1PAR1\n\nPAR2 - // ---- - return true; - } else { - //
        PAR1PAR1... - // ---- - } - } - return null; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/DisplayLinkURI.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/DisplayLinkURI.php deleted file mode 100644 index 9df45fb2..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/DisplayLinkURI.php +++ /dev/null @@ -1,26 +0,0 @@ -start->attr['href'])){ - $url = $token->start->attr['href']; - unset($token->start->attr['href']); - $token = array($token, new HTMLPurifier_Token_Text(" ($url)")); - } else { - // nothing to display - } - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/Linkify.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/Linkify.php deleted file mode 100644 index 8daf70ea..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/Linkify.php +++ /dev/null @@ -1,46 +0,0 @@ - array('href')); - - public function handleText(&$token) { - if (!$this->allowsElement('a')) return; - - if (strpos($token->data, '://') === false) { - // our really quick heuristic failed, abort - // this may not work so well if we want to match things like - // "google.com", but then again, most people don't - return; - } - - // there is/are URL(s). Let's split the string: - // Note: this regex is extremely permissive - $bits = preg_split('#((?:https?|ftp)://[^\s\'"<>()]+)#S', $token->data, -1, PREG_SPLIT_DELIM_CAPTURE); - - $token = array(); - - // $i = index - // $c = count - // $l = is link - for ($i = 0, $c = count($bits), $l = false; $i < $c; $i++, $l = !$l) { - if (!$l) { - if ($bits[$i] === '') continue; - $token[] = new HTMLPurifier_Token_Text($bits[$i]); - } else { - $token[] = new HTMLPurifier_Token_Start('a', array('href' => $bits[$i])); - $token[] = new HTMLPurifier_Token_Text($bits[$i]); - $token[] = new HTMLPurifier_Token_End('a'); - } - } - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/PurifierLinkify.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/PurifierLinkify.php deleted file mode 100644 index a67b3894..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/PurifierLinkify.php +++ /dev/null @@ -1,45 +0,0 @@ - array('href')); - - public function prepare($config, $context) { - $this->docURL = $config->get('AutoFormat.PurifierLinkify.DocURL'); - return parent::prepare($config, $context); - } - - public function handleText(&$token) { - if (!$this->allowsElement('a')) return; - if (strpos($token->data, '%') === false) return; - - $bits = preg_split('#%([a-z0-9]+\.[a-z0-9]+)#Si', $token->data, -1, PREG_SPLIT_DELIM_CAPTURE); - $token = array(); - - // $i = index - // $c = count - // $l = is link - for ($i = 0, $c = count($bits), $l = false; $i < $c; $i++, $l = !$l) { - if (!$l) { - if ($bits[$i] === '') continue; - $token[] = new HTMLPurifier_Token_Text($bits[$i]); - } else { - $token[] = new HTMLPurifier_Token_Start('a', - array('href' => str_replace('%s', $bits[$i], $this->docURL))); - $token[] = new HTMLPurifier_Token_Text('%' . $bits[$i]); - $token[] = new HTMLPurifier_Token_End('a'); - } - } - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/RemoveEmpty.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/RemoveEmpty.php deleted file mode 100644 index c4c26ef7..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/RemoveEmpty.php +++ /dev/null @@ -1,51 +0,0 @@ -config = $config; - $this->context = $context; - $this->removeNbsp = $config->get('AutoFormat.RemoveEmpty.RemoveNbsp'); - $this->removeNbspExceptions = $config->get('AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions'); - $this->attrValidator = new HTMLPurifier_AttrValidator(); - } - - public function handleElement(&$token) { - if (!$token instanceof HTMLPurifier_Token_Start) return; - $next = false; - for ($i = $this->inputIndex + 1, $c = count($this->inputTokens); $i < $c; $i++) { - $next = $this->inputTokens[$i]; - if ($next instanceof HTMLPurifier_Token_Text) { - if ($next->is_whitespace) continue; - if ($this->removeNbsp && !isset($this->removeNbspExceptions[$token->name])) { - $plain = str_replace("\xC2\xA0", "", $next->data); - $isWsOrNbsp = $plain === '' || ctype_space($plain); - if ($isWsOrNbsp) continue; - } - } - break; - } - if (!$next || ($next instanceof HTMLPurifier_Token_End && $next->name == $token->name)) { - if ($token->name == 'colgroup') return; - $this->attrValidator->validateToken($token, $this->config, $this->context); - $token->armor['ValidateAttributes'] = true; - if (isset($token->attr['id']) || isset($token->attr['name'])) return; - $token = $i - $this->inputIndex + 1; - for ($b = $this->inputIndex - 1; $b > 0; $b--) { - $prev = $this->inputTokens[$b]; - if ($prev instanceof HTMLPurifier_Token_Text && $prev->is_whitespace) continue; - break; - } - // This is safe because we removed the token that triggered this. - $this->rewind($b - 1); - return; - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php deleted file mode 100644 index 509d5dc7..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php +++ /dev/null @@ -1,60 +0,0 @@ -attrValidator = new HTMLPurifier_AttrValidator(); - $this->config = $config; - $this->context = $context; - return parent::prepare($config, $context); - } - - public function handleElement(&$token) { - if ($token->name !== 'span' || !$token instanceof HTMLPurifier_Token_Start) { - return; - } - - // We need to validate the attributes now since this doesn't normally - // happen until after MakeWellFormed. If all the attributes are removed - // the span needs to be removed too. - $this->attrValidator->validateToken($token, $this->config, $this->context); - $token->armor['ValidateAttributes'] = true; - - if (!empty($token->attr)) { - return; - } - - $nesting = 0; - $spanContentTokens = array(); - while ($this->forwardUntilEndToken($i, $current, $nesting)) {} - - if ($current instanceof HTMLPurifier_Token_End && $current->name === 'span') { - // Mark closing span tag for deletion - $current->markForDeletion = true; - // Delete open span tag - $token = false; - } - } - - public function handleEnd(&$token) { - if ($token->markForDeletion) { - $token = false; - } - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/SafeObject.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/SafeObject.php deleted file mode 100644 index fc01eebc..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Injector/SafeObject.php +++ /dev/null @@ -1,91 +0,0 @@ - 'never', - 'allowNetworking' => 'internal', - ); - protected $allowedParam = array( - 'wmode' => true, - 'movie' => true, - 'flashvars' => true, - 'src' => true, - 'allowFullScreen' => true, // if omitted, assume to be 'false' - ); - - public function prepare($config, $context) { - parent::prepare($config, $context); - } - - public function handleElement(&$token) { - if ($token->name == 'object') { - $this->objectStack[] = $token; - $this->paramStack[] = array(); - $new = array($token); - foreach ($this->addParam as $name => $value) { - $new[] = new HTMLPurifier_Token_Empty('param', array('name' => $name, 'value' => $value)); - } - $token = $new; - } elseif ($token->name == 'param') { - $nest = count($this->currentNesting) - 1; - if ($nest >= 0 && $this->currentNesting[$nest]->name === 'object') { - $i = count($this->objectStack) - 1; - if (!isset($token->attr['name'])) { - $token = false; - return; - } - $n = $token->attr['name']; - // We need this fix because YouTube doesn't supply a data - // attribute, which we need if a type is specified. This is - // *very* Flash specific. - if (!isset($this->objectStack[$i]->attr['data']) && - ($token->attr['name'] == 'movie' || $token->attr['name'] == 'src')) { - $this->objectStack[$i]->attr['data'] = $token->attr['value']; - } - // Check if the parameter is the correct value but has not - // already been added - if ( - !isset($this->paramStack[$i][$n]) && - isset($this->addParam[$n]) && - $token->attr['name'] === $this->addParam[$n] - ) { - // keep token, and add to param stack - $this->paramStack[$i][$n] = true; - } elseif (isset($this->allowedParam[$n])) { - // keep token, don't do anything to it - // (could possibly check for duplicates here) - } else { - $token = false; - } - } else { - // not directly inside an object, DENY! - $token = false; - } - } - } - - public function handleEnd(&$token) { - // This is the WRONG way of handling the object and param stacks; - // we should be inserting them directly on the relevant object tokens - // so that the global stack handling handles it. - if ($token->name == 'object') { - array_pop($this->objectStack); - array_pop($this->paramStack); - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Language.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Language.php deleted file mode 100644 index 2fdfc147..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Language.php +++ /dev/null @@ -1,163 +0,0 @@ -config = $config; - $this->context = $context; - } - - /** - * Loads language object with necessary info from factory cache - * @note This is a lazy loader - */ - public function load() { - if ($this->_loaded) return; - $factory = HTMLPurifier_LanguageFactory::instance(); - $factory->loadLanguage($this->code); - foreach ($factory->keys as $key) { - $this->$key = $factory->cache[$this->code][$key]; - } - $this->_loaded = true; - } - - /** - * Retrieves a localised message. - * @param $key string identifier of message - * @return string localised message - */ - public function getMessage($key) { - if (!$this->_loaded) $this->load(); - if (!isset($this->messages[$key])) return "[$key]"; - return $this->messages[$key]; - } - - /** - * Retrieves a localised error name. - * @param $int integer error number, corresponding to PHP's error - * reporting - * @return string localised message - */ - public function getErrorName($int) { - if (!$this->_loaded) $this->load(); - if (!isset($this->errorNames[$int])) return "[Error: $int]"; - return $this->errorNames[$int]; - } - - /** - * Converts an array list into a string readable representation - */ - public function listify($array) { - $sep = $this->getMessage('Item separator'); - $sep_last = $this->getMessage('Item separator last'); - $ret = ''; - for ($i = 0, $c = count($array); $i < $c; $i++) { - if ($i == 0) { - } elseif ($i + 1 < $c) { - $ret .= $sep; - } else { - $ret .= $sep_last; - } - $ret .= $array[$i]; - } - return $ret; - } - - /** - * Formats a localised message with passed parameters - * @param $key string identifier of message - * @param $args Parameters to substitute in - * @return string localised message - * @todo Implement conditionals? Right now, some messages make - * reference to line numbers, but those aren't always available - */ - public function formatMessage($key, $args = array()) { - if (!$this->_loaded) $this->load(); - if (!isset($this->messages[$key])) return "[$key]"; - $raw = $this->messages[$key]; - $subst = array(); - $generator = false; - foreach ($args as $i => $value) { - if (is_object($value)) { - if ($value instanceof HTMLPurifier_Token) { - // factor this out some time - if (!$generator) $generator = $this->context->get('Generator'); - if (isset($value->name)) $subst['$'.$i.'.Name'] = $value->name; - if (isset($value->data)) $subst['$'.$i.'.Data'] = $value->data; - $subst['$'.$i.'.Compact'] = - $subst['$'.$i.'.Serialized'] = $generator->generateFromToken($value); - // a more complex algorithm for compact representation - // could be introduced for all types of tokens. This - // may need to be factored out into a dedicated class - if (!empty($value->attr)) { - $stripped_token = clone $value; - $stripped_token->attr = array(); - $subst['$'.$i.'.Compact'] = $generator->generateFromToken($stripped_token); - } - $subst['$'.$i.'.Line'] = $value->line ? $value->line : 'unknown'; - } - continue; - } elseif (is_array($value)) { - $keys = array_keys($value); - if (array_keys($keys) === $keys) { - // list - $subst['$'.$i] = $this->listify($value); - } else { - // associative array - // no $i implementation yet, sorry - $subst['$'.$i.'.Keys'] = $this->listify($keys); - $subst['$'.$i.'.Values'] = $this->listify(array_values($value)); - } - continue; - } - $subst['$' . $i] = $value; - } - return strtr($raw, $subst); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Language/classes/en-x-test.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Language/classes/en-x-test.php deleted file mode 100644 index 2682b60a..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Language/classes/en-x-test.php +++ /dev/null @@ -1,12 +0,0 @@ - 'HTML Purifier X' -); - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Language/messages/en-x-testmini.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Language/messages/en-x-testmini.php deleted file mode 100644 index 3fa9ef19..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Language/messages/en-x-testmini.php +++ /dev/null @@ -1,12 +0,0 @@ - 'HTML Purifier XNone' -); - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Language/messages/en.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Language/messages/en.php deleted file mode 100644 index 2c96e307..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Language/messages/en.php +++ /dev/null @@ -1,63 +0,0 @@ - 'HTML Purifier', - -// for unit testing purposes -'LanguageFactoryTest: Pizza' => 'Pizza', -'LanguageTest: List' => '$1', -'LanguageTest: Hash' => '$1.Keys; $1.Values', - -'Item separator' => ', ', -'Item separator last' => ' and ', // non-Harvard style - -'ErrorCollector: No errors' => 'No errors detected. However, because error reporting is still incomplete, there may have been errors that the error collector was not notified of; please inspect the output HTML carefully.', -'ErrorCollector: At line' => ' at line $line', -'ErrorCollector: Incidental errors' => 'Incidental errors', - -'Lexer: Unclosed comment' => 'Unclosed comment', -'Lexer: Unescaped lt' => 'Unescaped less-than sign (<) should be <', -'Lexer: Missing gt' => 'Missing greater-than sign (>), previous less-than sign (<) should be escaped', -'Lexer: Missing attribute key' => 'Attribute declaration has no key', -'Lexer: Missing end quote' => 'Attribute declaration has no end quote', -'Lexer: Extracted body' => 'Removed document metadata tags', - -'Strategy_RemoveForeignElements: Tag transform' => '<$1> element transformed into $CurrentToken.Serialized', -'Strategy_RemoveForeignElements: Missing required attribute' => '$CurrentToken.Compact element missing required attribute $1', -'Strategy_RemoveForeignElements: Foreign element to text' => 'Unrecognized $CurrentToken.Serialized tag converted to text', -'Strategy_RemoveForeignElements: Foreign element removed' => 'Unrecognized $CurrentToken.Serialized tag removed', -'Strategy_RemoveForeignElements: Comment removed' => 'Comment containing "$CurrentToken.Data" removed', -'Strategy_RemoveForeignElements: Foreign meta element removed' => 'Unrecognized $CurrentToken.Serialized meta tag and all descendants removed', -'Strategy_RemoveForeignElements: Token removed to end' => 'Tags and text starting from $1 element where removed to end', -'Strategy_RemoveForeignElements: Trailing hyphen in comment removed' => 'Trailing hyphen(s) in comment removed', -'Strategy_RemoveForeignElements: Hyphens in comment collapsed' => 'Double hyphens in comments are not allowed, and were collapsed into single hyphens', - -'Strategy_MakeWellFormed: Unnecessary end tag removed' => 'Unnecessary $CurrentToken.Serialized tag removed', -'Strategy_MakeWellFormed: Unnecessary end tag to text' => 'Unnecessary $CurrentToken.Serialized tag converted to text', -'Strategy_MakeWellFormed: Tag auto closed' => '$1.Compact started on line $1.Line auto-closed by $CurrentToken.Compact', -'Strategy_MakeWellFormed: Tag carryover' => '$1.Compact started on line $1.Line auto-continued into $CurrentToken.Compact', -'Strategy_MakeWellFormed: Stray end tag removed' => 'Stray $CurrentToken.Serialized tag removed', -'Strategy_MakeWellFormed: Stray end tag to text' => 'Stray $CurrentToken.Serialized tag converted to text', -'Strategy_MakeWellFormed: Tag closed by element end' => '$1.Compact tag started on line $1.Line closed by end of $CurrentToken.Serialized', -'Strategy_MakeWellFormed: Tag closed by document end' => '$1.Compact tag started on line $1.Line closed by end of document', - -'Strategy_FixNesting: Node removed' => '$CurrentToken.Compact node removed', -'Strategy_FixNesting: Node excluded' => '$CurrentToken.Compact node removed due to descendant exclusion by ancestor element', -'Strategy_FixNesting: Node reorganized' => 'Contents of $CurrentToken.Compact node reorganized to enforce its content model', -'Strategy_FixNesting: Node contents removed' => 'Contents of $CurrentToken.Compact node removed', - -'AttrValidator: Attributes transformed' => 'Attributes on $CurrentToken.Compact transformed from $1.Keys to $2.Keys', -'AttrValidator: Attribute removed' => '$CurrentAttr.Name attribute on $CurrentToken.Compact removed', - -); - -$errorNames = array( - E_ERROR => 'Error', - E_WARNING => 'Warning', - E_NOTICE => 'Notice' -); - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/LanguageFactory.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/LanguageFactory.php deleted file mode 100644 index 34f6d733..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/LanguageFactory.php +++ /dev/null @@ -1,198 +0,0 @@ -cache[$language_code][$key] = $value - * @value array map - */ - public $cache; - - /** - * Valid keys in the HTMLPurifier_Language object. Designates which - * variables to slurp out of a message file. - * @value array list - */ - public $keys = array('fallback', 'messages', 'errorNames'); - - /** - * Instance of HTMLPurifier_AttrDef_Lang to validate language codes - * @value object HTMLPurifier_AttrDef_Lang - */ - protected $validator; - - /** - * Cached copy of dirname(__FILE__), directory of current file without - * trailing slash - * @value string filename - */ - protected $dir; - - /** - * Keys whose contents are a hash map and can be merged - * @value array lookup - */ - protected $mergeable_keys_map = array('messages' => true, 'errorNames' => true); - - /** - * Keys whose contents are a list and can be merged - * @value array lookup - */ - protected $mergeable_keys_list = array(); - - /** - * Retrieve sole instance of the factory. - * @param $prototype Optional prototype to overload sole instance with, - * or bool true to reset to default factory. - */ - public static function instance($prototype = null) { - static $instance = null; - if ($prototype !== null) { - $instance = $prototype; - } elseif ($instance === null || $prototype == true) { - $instance = new HTMLPurifier_LanguageFactory(); - $instance->setup(); - } - return $instance; - } - - /** - * Sets up the singleton, much like a constructor - * @note Prevents people from getting this outside of the singleton - */ - public function setup() { - $this->validator = new HTMLPurifier_AttrDef_Lang(); - $this->dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier'; - } - - /** - * Creates a language object, handles class fallbacks - * @param $config Instance of HTMLPurifier_Config - * @param $context Instance of HTMLPurifier_Context - * @param $code Code to override configuration with. Private parameter. - */ - public function create($config, $context, $code = false) { - - // validate language code - if ($code === false) { - $code = $this->validator->validate( - $config->get('Core.Language'), $config, $context - ); - } else { - $code = $this->validator->validate($code, $config, $context); - } - if ($code === false) $code = 'en'; // malformed code becomes English - - $pcode = str_replace('-', '_', $code); // make valid PHP classname - static $depth = 0; // recursion protection - - if ($code == 'en') { - $lang = new HTMLPurifier_Language($config, $context); - } else { - $class = 'HTMLPurifier_Language_' . $pcode; - $file = $this->dir . '/Language/classes/' . $code . '.php'; - if (file_exists($file) || class_exists($class, false)) { - $lang = new $class($config, $context); - } else { - // Go fallback - $raw_fallback = $this->getFallbackFor($code); - $fallback = $raw_fallback ? $raw_fallback : 'en'; - $depth++; - $lang = $this->create($config, $context, $fallback); - if (!$raw_fallback) { - $lang->error = true; - } - $depth--; - } - } - - $lang->code = $code; - - return $lang; - - } - - /** - * Returns the fallback language for language - * @note Loads the original language into cache - * @param $code string language code - */ - public function getFallbackFor($code) { - $this->loadLanguage($code); - return $this->cache[$code]['fallback']; - } - - /** - * Loads language into the cache, handles message file and fallbacks - * @param $code string language code - */ - public function loadLanguage($code) { - static $languages_seen = array(); // recursion guard - - // abort if we've already loaded it - if (isset($this->cache[$code])) return; - - // generate filename - $filename = $this->dir . '/Language/messages/' . $code . '.php'; - - // default fallback : may be overwritten by the ensuing include - $fallback = ($code != 'en') ? 'en' : false; - - // load primary localisation - if (!file_exists($filename)) { - // skip the include: will rely solely on fallback - $filename = $this->dir . '/Language/messages/en.php'; - $cache = array(); - } else { - include $filename; - $cache = compact($this->keys); - } - - // load fallback localisation - if (!empty($fallback)) { - - // infinite recursion guard - if (isset($languages_seen[$code])) { - trigger_error('Circular fallback reference in language ' . - $code, E_USER_ERROR); - $fallback = 'en'; - } - $language_seen[$code] = true; - - // load the fallback recursively - $this->loadLanguage($fallback); - $fallback_cache = $this->cache[$fallback]; - - // merge fallback with current language - foreach ( $this->keys as $key ) { - if (isset($cache[$key]) && isset($fallback_cache[$key])) { - if (isset($this->mergeable_keys_map[$key])) { - $cache[$key] = $cache[$key] + $fallback_cache[$key]; - } elseif (isset($this->mergeable_keys_list[$key])) { - $cache[$key] = array_merge( $fallback_cache[$key], $cache[$key] ); - } - } else { - $cache[$key] = $fallback_cache[$key]; - } - } - - } - - // save to cache for later retrieval - $this->cache[$code] = $cache; - - return; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Length.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Length.php deleted file mode 100644 index ca276155..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Length.php +++ /dev/null @@ -1,115 +0,0 @@ - true, 'ex' => true, 'px' => true, 'in' => true, - 'cm' => true, 'mm' => true, 'pt' => true, 'pc' => true - ); - - /** - * @param number $n Magnitude - * @param string $u Unit - */ - public function __construct($n = '0', $u = false) { - $this->n = (string) $n; - $this->unit = $u !== false ? (string) $u : false; - } - - /** - * @param string $s Unit string, like '2em' or '3.4in' - * @warning Does not perform validation. - */ - static public function make($s) { - if ($s instanceof HTMLPurifier_Length) return $s; - $n_length = strspn($s, '1234567890.+-'); - $n = substr($s, 0, $n_length); - $unit = substr($s, $n_length); - if ($unit === '') $unit = false; - return new HTMLPurifier_Length($n, $unit); - } - - /** - * Validates the number and unit. - */ - protected function validate() { - // Special case: - if ($this->n === '+0' || $this->n === '-0') $this->n = '0'; - if ($this->n === '0' && $this->unit === false) return true; - if (!ctype_lower($this->unit)) $this->unit = strtolower($this->unit); - if (!isset(HTMLPurifier_Length::$allowedUnits[$this->unit])) return false; - // Hack: - $def = new HTMLPurifier_AttrDef_CSS_Number(); - $result = $def->validate($this->n, false, false); - if ($result === false) return false; - $this->n = $result; - return true; - } - - /** - * Returns string representation of number. - */ - public function toString() { - if (!$this->isValid()) return false; - return $this->n . $this->unit; - } - - /** - * Retrieves string numeric magnitude. - */ - public function getN() {return $this->n;} - - /** - * Retrieves string unit. - */ - public function getUnit() {return $this->unit;} - - /** - * Returns true if this length unit is valid. - */ - public function isValid() { - if ($this->isValid === null) $this->isValid = $this->validate(); - return $this->isValid; - } - - /** - * Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal. - * @warning If both values are too large or small, this calculation will - * not work properly - */ - public function compareTo($l) { - if ($l === false) return false; - if ($l->unit !== $this->unit) { - $converter = new HTMLPurifier_UnitConverter(); - $l = $converter->convert($l, $this->unit); - if ($l === false) return false; - } - return $this->n - $l->n; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Lexer.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Lexer.php deleted file mode 100644 index 6d6f4864..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Lexer.php +++ /dev/null @@ -1,326 +0,0 @@ -get('Core.LexerImpl'); - } - - $needs_tracking = - $config->get('Core.MaintainLineNumbers') || - $config->get('Core.CollectErrors'); - - $inst = null; - if (is_object($lexer)) { - $inst = $lexer; - } else { - - if (is_null($lexer)) { do { - // auto-detection algorithm - - if ($needs_tracking) { - $lexer = 'DirectLex'; - break; - } - - if ( - class_exists('DOMDocument') && - method_exists('DOMDocument', 'loadHTML') && - !extension_loaded('domxml') - ) { - // check for DOM support, because while it's part of the - // core, it can be disabled compile time. Also, the PECL - // domxml extension overrides the default DOM, and is evil - // and nasty and we shan't bother to support it - $lexer = 'DOMLex'; - } else { - $lexer = 'DirectLex'; - } - - } while(0); } // do..while so we can break - - // instantiate recognized string names - switch ($lexer) { - case 'DOMLex': - $inst = new HTMLPurifier_Lexer_DOMLex(); - break; - case 'DirectLex': - $inst = new HTMLPurifier_Lexer_DirectLex(); - break; - case 'PH5P': - $inst = new HTMLPurifier_Lexer_PH5P(); - break; - default: - throw new HTMLPurifier_Exception("Cannot instantiate unrecognized Lexer type " . htmlspecialchars($lexer)); - } - } - - if (!$inst) throw new HTMLPurifier_Exception('No lexer was instantiated'); - - // once PHP DOM implements native line numbers, or we - // hack out something using XSLT, remove this stipulation - if ($needs_tracking && !$inst->tracksLineNumbers) { - throw new HTMLPurifier_Exception('Cannot use lexer that does not support line numbers with Core.MaintainLineNumbers or Core.CollectErrors (use DirectLex instead)'); - } - - return $inst; - - } - - // -- CONVENIENCE MEMBERS --------------------------------------------- - - public function __construct() { - $this->_entity_parser = new HTMLPurifier_EntityParser(); - } - - /** - * Most common entity to raw value conversion table for special entities. - */ - protected $_special_entity2str = - array( - '"' => '"', - '&' => '&', - '<' => '<', - '>' => '>', - ''' => "'", - ''' => "'", - ''' => "'" - ); - - /** - * Parses special entities into the proper characters. - * - * This string will translate escaped versions of the special characters - * into the correct ones. - * - * @warning - * You should be able to treat the output of this function as - * completely parsed, but that's only because all other entities should - * have been handled previously in substituteNonSpecialEntities() - * - * @param $string String character data to be parsed. - * @returns Parsed character data. - */ - public function parseData($string) { - - // following functions require at least one character - if ($string === '') return ''; - - // subtracts amps that cannot possibly be escaped - $num_amp = substr_count($string, '&') - substr_count($string, '& ') - - ($string[strlen($string)-1] === '&' ? 1 : 0); - - if (!$num_amp) return $string; // abort if no entities - $num_esc_amp = substr_count($string, '&'); - $string = strtr($string, $this->_special_entity2str); - - // code duplication for sake of optimization, see above - $num_amp_2 = substr_count($string, '&') - substr_count($string, '& ') - - ($string[strlen($string)-1] === '&' ? 1 : 0); - - if ($num_amp_2 <= $num_esc_amp) return $string; - - // hmm... now we have some uncommon entities. Use the callback. - $string = $this->_entity_parser->substituteSpecialEntities($string); - return $string; - } - - /** - * Lexes an HTML string into tokens. - * - * @param $string String HTML. - * @return HTMLPurifier_Token array representation of HTML. - */ - public function tokenizeHTML($string, $config, $context) { - trigger_error('Call to abstract class', E_USER_ERROR); - } - - /** - * Translates CDATA sections into regular sections (through escaping). - * - * @param $string HTML string to process. - * @returns HTML with CDATA sections escaped. - */ - protected static function escapeCDATA($string) { - return preg_replace_callback( - '//s', - array('HTMLPurifier_Lexer', 'CDATACallback'), - $string - ); - } - - /** - * Special CDATA case that is especially convoluted for )#si', - array($this, 'scriptCallback'), $html); - } - - $html = $this->normalize($html, $config, $context); - - $cursor = 0; // our location in the text - $inside_tag = false; // whether or not we're parsing the inside of a tag - $array = array(); // result array - - // This is also treated to mean maintain *column* numbers too - $maintain_line_numbers = $config->get('Core.MaintainLineNumbers'); - - if ($maintain_line_numbers === null) { - // automatically determine line numbering by checking - // if error collection is on - $maintain_line_numbers = $config->get('Core.CollectErrors'); - } - - if ($maintain_line_numbers) { - $current_line = 1; - $current_col = 0; - $length = strlen($html); - } else { - $current_line = false; - $current_col = false; - $length = false; - } - $context->register('CurrentLine', $current_line); - $context->register('CurrentCol', $current_col); - $nl = "\n"; - // how often to manually recalculate. This will ALWAYS be right, - // but it's pretty wasteful. Set to 0 to turn off - $synchronize_interval = $config->get('Core.DirectLexLineNumberSyncInterval'); - - $e = false; - if ($config->get('Core.CollectErrors')) { - $e =& $context->get('ErrorCollector'); - } - - // for testing synchronization - $loops = 0; - - while(++$loops) { - - // $cursor is either at the start of a token, or inside of - // a tag (i.e. there was a < immediately before it), as indicated - // by $inside_tag - - if ($maintain_line_numbers) { - - // $rcursor, however, is always at the start of a token. - $rcursor = $cursor - (int) $inside_tag; - - // Column number is cheap, so we calculate it every round. - // We're interested at the *end* of the newline string, so - // we need to add strlen($nl) == 1 to $nl_pos before subtracting it - // from our "rcursor" position. - $nl_pos = strrpos($html, $nl, $rcursor - $length); - $current_col = $rcursor - (is_bool($nl_pos) ? 0 : $nl_pos + 1); - - // recalculate lines - if ( - $synchronize_interval && // synchronization is on - $cursor > 0 && // cursor is further than zero - $loops % $synchronize_interval === 0 // time to synchronize! - ) { - $current_line = 1 + $this->substrCount($html, $nl, 0, $cursor); - } - - } - - $position_next_lt = strpos($html, '<', $cursor); - $position_next_gt = strpos($html, '>', $cursor); - - // triggers on "asdf" but not "asdf " - // special case to set up context - if ($position_next_lt === $cursor) { - $inside_tag = true; - $cursor++; - } - - if (!$inside_tag && $position_next_lt !== false) { - // We are not inside tag and there still is another tag to parse - $token = new - HTMLPurifier_Token_Text( - $this->parseData( - substr( - $html, $cursor, $position_next_lt - $cursor - ) - ) - ); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_lt - $cursor); - } - $array[] = $token; - $cursor = $position_next_lt + 1; - $inside_tag = true; - continue; - } elseif (!$inside_tag) { - // We are not inside tag but there are no more tags - // If we're already at the end, break - if ($cursor === strlen($html)) break; - // Create Text of rest of string - $token = new - HTMLPurifier_Token_Text( - $this->parseData( - substr( - $html, $cursor - ) - ) - ); - if ($maintain_line_numbers) $token->rawPosition($current_line, $current_col); - $array[] = $token; - break; - } elseif ($inside_tag && $position_next_gt !== false) { - // We are in tag and it is well formed - // Grab the internals of the tag - $strlen_segment = $position_next_gt - $cursor; - - if ($strlen_segment < 1) { - // there's nothing to process! - $token = new HTMLPurifier_Token_Text('<'); - $cursor++; - continue; - } - - $segment = substr($html, $cursor, $strlen_segment); - - if ($segment === false) { - // somehow, we attempted to access beyond the end of - // the string, defense-in-depth, reported by Nate Abele - break; - } - - // Check if it's a comment - if ( - substr($segment, 0, 3) === '!--' - ) { - // re-determine segment length, looking for --> - $position_comment_end = strpos($html, '-->', $cursor); - if ($position_comment_end === false) { - // uh oh, we have a comment that extends to - // infinity. Can't be helped: set comment - // end position to end of string - if ($e) $e->send(E_WARNING, 'Lexer: Unclosed comment'); - $position_comment_end = strlen($html); - $end = true; - } else { - $end = false; - } - $strlen_segment = $position_comment_end - $cursor; - $segment = substr($html, $cursor, $strlen_segment); - $token = new - HTMLPurifier_Token_Comment( - substr( - $segment, 3, $strlen_segment - 3 - ) - ); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $strlen_segment); - } - $array[] = $token; - $cursor = $end ? $position_comment_end : $position_comment_end + 3; - $inside_tag = false; - continue; - } - - // Check if it's an end tag - $is_end_tag = (strpos($segment,'/') === 0); - if ($is_end_tag) { - $type = substr($segment, 1); - $token = new HTMLPurifier_Token_End($type); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $inside_tag = false; - $cursor = $position_next_gt + 1; - continue; - } - - // Check leading character is alnum, if not, we may - // have accidently grabbed an emoticon. Translate into - // text and go our merry way - if (!ctype_alpha($segment[0])) { - // XML: $segment[0] !== '_' && $segment[0] !== ':' - if ($e) $e->send(E_NOTICE, 'Lexer: Unescaped lt'); - $token = new HTMLPurifier_Token_Text('<'); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $inside_tag = false; - continue; - } - - // Check if it is explicitly self closing, if so, remove - // trailing slash. Remember, we could have a tag like
        , so - // any later token processing scripts must convert improperly - // classified EmptyTags from StartTags. - $is_self_closing = (strrpos($segment,'/') === $strlen_segment-1); - if ($is_self_closing) { - $strlen_segment--; - $segment = substr($segment, 0, $strlen_segment); - } - - // Check if there are any attributes - $position_first_space = strcspn($segment, $this->_whitespace); - - if ($position_first_space >= $strlen_segment) { - if ($is_self_closing) { - $token = new HTMLPurifier_Token_Empty($segment); - } else { - $token = new HTMLPurifier_Token_Start($segment); - } - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $inside_tag = false; - $cursor = $position_next_gt + 1; - continue; - } - - // Grab out all the data - $type = substr($segment, 0, $position_first_space); - $attribute_string = - trim( - substr( - $segment, $position_first_space - ) - ); - if ($attribute_string) { - $attr = $this->parseAttributeString( - $attribute_string - , $config, $context - ); - } else { - $attr = array(); - } - - if ($is_self_closing) { - $token = new HTMLPurifier_Token_Empty($type, $attr); - } else { - $token = new HTMLPurifier_Token_Start($type, $attr); - } - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $cursor = $position_next_gt + 1; - $inside_tag = false; - continue; - } else { - // inside tag, but there's no ending > sign - if ($e) $e->send(E_WARNING, 'Lexer: Missing gt'); - $token = new - HTMLPurifier_Token_Text( - '<' . - $this->parseData( - substr($html, $cursor) - ) - ); - if ($maintain_line_numbers) $token->rawPosition($current_line, $current_col); - // no cursor scroll? Hmm... - $array[] = $token; - break; - } - break; - } - - $context->destroy('CurrentLine'); - $context->destroy('CurrentCol'); - return $array; - } - - /** - * PHP 5.0.x compatible substr_count that implements offset and length - */ - protected function substrCount($haystack, $needle, $offset, $length) { - static $oldVersion; - if ($oldVersion === null) { - $oldVersion = version_compare(PHP_VERSION, '5.1', '<'); - } - if ($oldVersion) { - $haystack = substr($haystack, $offset, $length); - return substr_count($haystack, $needle); - } else { - return substr_count($haystack, $needle, $offset, $length); - } - } - - /** - * Takes the inside of an HTML tag and makes an assoc array of attributes. - * - * @param $string Inside of tag excluding name. - * @returns Assoc array of attributes. - */ - public function parseAttributeString($string, $config, $context) { - $string = (string) $string; // quick typecast - - if ($string == '') return array(); // no attributes - - $e = false; - if ($config->get('Core.CollectErrors')) { - $e =& $context->get('ErrorCollector'); - } - - // let's see if we can abort as quickly as possible - // one equal sign, no spaces => one attribute - $num_equal = substr_count($string, '='); - $has_space = strpos($string, ' '); - if ($num_equal === 0 && !$has_space) { - // bool attribute - return array($string => $string); - } elseif ($num_equal === 1 && !$has_space) { - // only one attribute - list($key, $quoted_value) = explode('=', $string); - $quoted_value = trim($quoted_value); - if (!$key) { - if ($e) $e->send(E_ERROR, 'Lexer: Missing attribute key'); - return array(); - } - if (!$quoted_value) return array($key => ''); - $first_char = @$quoted_value[0]; - $last_char = @$quoted_value[strlen($quoted_value)-1]; - - $same_quote = ($first_char == $last_char); - $open_quote = ($first_char == '"' || $first_char == "'"); - - if ( $same_quote && $open_quote) { - // well behaved - $value = substr($quoted_value, 1, strlen($quoted_value) - 2); - } else { - // not well behaved - if ($open_quote) { - if ($e) $e->send(E_ERROR, 'Lexer: Missing end quote'); - $value = substr($quoted_value, 1); - } else { - $value = $quoted_value; - } - } - if ($value === false) $value = ''; - return array($key => $this->parseData($value)); - } - - // setup loop environment - $array = array(); // return assoc array of attributes - $cursor = 0; // current position in string (moves forward) - $size = strlen($string); // size of the string (stays the same) - - // if we have unquoted attributes, the parser expects a terminating - // space, so let's guarantee that there's always a terminating space. - $string .= ' '; - - while(true) { - - if ($cursor >= $size) { - break; - } - - $cursor += ($value = strspn($string, $this->_whitespace, $cursor)); - // grab the key - - $key_begin = $cursor; //we're currently at the start of the key - - // scroll past all characters that are the key (not whitespace or =) - $cursor += strcspn($string, $this->_whitespace . '=', $cursor); - - $key_end = $cursor; // now at the end of the key - - $key = substr($string, $key_begin, $key_end - $key_begin); - - if (!$key) { - if ($e) $e->send(E_ERROR, 'Lexer: Missing attribute key'); - $cursor += strcspn($string, $this->_whitespace, $cursor + 1); // prevent infinite loop - continue; // empty key - } - - // scroll past all whitespace - $cursor += strspn($string, $this->_whitespace, $cursor); - - if ($cursor >= $size) { - $array[$key] = $key; - break; - } - - // if the next character is an equal sign, we've got a regular - // pair, otherwise, it's a bool attribute - $first_char = @$string[$cursor]; - - if ($first_char == '=') { - // key="value" - - $cursor++; - $cursor += strspn($string, $this->_whitespace, $cursor); - - if ($cursor === false) { - $array[$key] = ''; - break; - } - - // we might be in front of a quote right now - - $char = @$string[$cursor]; - - if ($char == '"' || $char == "'") { - // it's quoted, end bound is $char - $cursor++; - $value_begin = $cursor; - $cursor = strpos($string, $char, $cursor); - $value_end = $cursor; - } else { - // it's not quoted, end bound is whitespace - $value_begin = $cursor; - $cursor += strcspn($string, $this->_whitespace, $cursor); - $value_end = $cursor; - } - - // we reached a premature end - if ($cursor === false) { - $cursor = $size; - $value_end = $cursor; - } - - $value = substr($string, $value_begin, $value_end - $value_begin); - if ($value === false) $value = ''; - $array[$key] = $this->parseData($value); - $cursor++; - - } else { - // boolattr - if ($key !== '') { - $array[$key] = $key; - } else { - // purely theoretical - if ($e) $e->send(E_ERROR, 'Lexer: Missing attribute key'); - } - - } - } - return $array; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Lexer/PEARSax3.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Lexer/PEARSax3.php deleted file mode 100644 index 72c87635..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Lexer/PEARSax3.php +++ /dev/null @@ -1,139 +0,0 @@ -tokens = array(); - $this->last_token_was_empty = false; - - $string = $this->normalize($string, $config, $context); - - $this->parent_handler = set_error_handler(array($this, 'muteStrictErrorHandler')); - - $parser = new XML_HTMLSax3(); - $parser->set_object($this); - $parser->set_element_handler('openHandler','closeHandler'); - $parser->set_data_handler('dataHandler'); - $parser->set_escape_handler('escapeHandler'); - - // doesn't seem to work correctly for attributes - $parser->set_option('XML_OPTION_ENTITIES_PARSED', 1); - - $parser->parse($string); - - restore_error_handler(); - - return $this->tokens; - - } - - /** - * Open tag event handler, interface is defined by PEAR package. - */ - public function openHandler(&$parser, $name, $attrs, $closed) { - // entities are not resolved in attrs - foreach ($attrs as $key => $attr) { - $attrs[$key] = $this->parseData($attr); - } - if ($closed) { - $this->tokens[] = new HTMLPurifier_Token_Empty($name, $attrs); - $this->last_token_was_empty = true; - } else { - $this->tokens[] = new HTMLPurifier_Token_Start($name, $attrs); - } - $this->stack[] = $name; - return true; - } - - /** - * Close tag event handler, interface is defined by PEAR package. - */ - public function closeHandler(&$parser, $name) { - // HTMLSax3 seems to always send empty tags an extra close tag - // check and ignore if you see it: - // [TESTME] to make sure it doesn't overreach - if ($this->last_token_was_empty) { - $this->last_token_was_empty = false; - return true; - } - $this->tokens[] = new HTMLPurifier_Token_End($name); - if (!empty($this->stack)) array_pop($this->stack); - return true; - } - - /** - * Data event handler, interface is defined by PEAR package. - */ - public function dataHandler(&$parser, $data) { - $this->last_token_was_empty = false; - $this->tokens[] = new HTMLPurifier_Token_Text($data); - return true; - } - - /** - * Escaped text handler, interface is defined by PEAR package. - */ - public function escapeHandler(&$parser, $data) { - if (strpos($data, '--') === 0) { - // remove trailing and leading double-dashes - $data = substr($data, 2); - if (strlen($data) >= 2 && substr($data, -2) == "--") { - $data = substr($data, 0, -2); - } - if (isset($this->stack[sizeof($this->stack) - 1]) && - $this->stack[sizeof($this->stack) - 1] == "style") { - $this->tokens[] = new HTMLPurifier_Token_Text($data); - } else { - $this->tokens[] = new HTMLPurifier_Token_Comment($data); - } - $this->last_token_was_empty = false; - } - // CDATA is handled elsewhere, but if it was handled here: - //if (strpos($data, '[CDATA[') === 0) { - // $this->tokens[] = new HTMLPurifier_Token_Text( - // substr($data, 7, strlen($data) - 9) ); - //} - return true; - } - - /** - * An error handler that mutes strict errors - */ - public function muteStrictErrorHandler($errno, $errstr, $errfile=null, $errline=null, $errcontext=null) { - if ($errno == E_STRICT) return; - return call_user_func($this->parent_handler, $errno, $errstr, $errfile, $errline, $errcontext); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php deleted file mode 100644 index b42965ef..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Lexer/PH5P.php +++ /dev/null @@ -1,3904 +0,0 @@ -normalize($html, $config, $context); - $new_html = $this->wrapHTML($new_html, $config, $context); - try { - $parser = new HTML5($new_html); - $doc = $parser->save(); - } catch (DOMException $e) { - // Uh oh, it failed. Punt to DirectLex. - $lexer = new HTMLPurifier_Lexer_DirectLex(); - $context->register('PH5PError', $e); // save the error, so we can detect it - return $lexer->tokenizeHTML($html, $config, $context); // use original HTML - } - $tokens = array(); - $this->tokenizeDOM( - $doc->getElementsByTagName('html')->item(0)-> // - getElementsByTagName('body')->item(0)-> // - getElementsByTagName('div')->item(0) //
        - , $tokens); - return $tokens; - } - -} - -/* - -Copyright 2007 Jeroen van der Meer - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -*/ - -class HTML5 { - private $data; - private $char; - private $EOF; - private $state; - private $tree; - private $token; - private $content_model; - private $escape = false; - private $entities = array('AElig;','AElig','AMP;','AMP','Aacute;','Aacute', - 'Acirc;','Acirc','Agrave;','Agrave','Alpha;','Aring;','Aring','Atilde;', - 'Atilde','Auml;','Auml','Beta;','COPY;','COPY','Ccedil;','Ccedil','Chi;', - 'Dagger;','Delta;','ETH;','ETH','Eacute;','Eacute','Ecirc;','Ecirc','Egrave;', - 'Egrave','Epsilon;','Eta;','Euml;','Euml','GT;','GT','Gamma;','Iacute;', - 'Iacute','Icirc;','Icirc','Igrave;','Igrave','Iota;','Iuml;','Iuml','Kappa;', - 'LT;','LT','Lambda;','Mu;','Ntilde;','Ntilde','Nu;','OElig;','Oacute;', - 'Oacute','Ocirc;','Ocirc','Ograve;','Ograve','Omega;','Omicron;','Oslash;', - 'Oslash','Otilde;','Otilde','Ouml;','Ouml','Phi;','Pi;','Prime;','Psi;', - 'QUOT;','QUOT','REG;','REG','Rho;','Scaron;','Sigma;','THORN;','THORN', - 'TRADE;','Tau;','Theta;','Uacute;','Uacute','Ucirc;','Ucirc','Ugrave;', - 'Ugrave','Upsilon;','Uuml;','Uuml','Xi;','Yacute;','Yacute','Yuml;','Zeta;', - 'aacute;','aacute','acirc;','acirc','acute;','acute','aelig;','aelig', - 'agrave;','agrave','alefsym;','alpha;','amp;','amp','and;','ang;','apos;', - 'aring;','aring','asymp;','atilde;','atilde','auml;','auml','bdquo;','beta;', - 'brvbar;','brvbar','bull;','cap;','ccedil;','ccedil','cedil;','cedil', - 'cent;','cent','chi;','circ;','clubs;','cong;','copy;','copy','crarr;', - 'cup;','curren;','curren','dArr;','dagger;','darr;','deg;','deg','delta;', - 'diams;','divide;','divide','eacute;','eacute','ecirc;','ecirc','egrave;', - 'egrave','empty;','emsp;','ensp;','epsilon;','equiv;','eta;','eth;','eth', - 'euml;','euml','euro;','exist;','fnof;','forall;','frac12;','frac12', - 'frac14;','frac14','frac34;','frac34','frasl;','gamma;','ge;','gt;','gt', - 'hArr;','harr;','hearts;','hellip;','iacute;','iacute','icirc;','icirc', - 'iexcl;','iexcl','igrave;','igrave','image;','infin;','int;','iota;', - 'iquest;','iquest','isin;','iuml;','iuml','kappa;','lArr;','lambda;','lang;', - 'laquo;','laquo','larr;','lceil;','ldquo;','le;','lfloor;','lowast;','loz;', - 'lrm;','lsaquo;','lsquo;','lt;','lt','macr;','macr','mdash;','micro;','micro', - 'middot;','middot','minus;','mu;','nabla;','nbsp;','nbsp','ndash;','ne;', - 'ni;','not;','not','notin;','nsub;','ntilde;','ntilde','nu;','oacute;', - 'oacute','ocirc;','ocirc','oelig;','ograve;','ograve','oline;','omega;', - 'omicron;','oplus;','or;','ordf;','ordf','ordm;','ordm','oslash;','oslash', - 'otilde;','otilde','otimes;','ouml;','ouml','para;','para','part;','permil;', - 'perp;','phi;','pi;','piv;','plusmn;','plusmn','pound;','pound','prime;', - 'prod;','prop;','psi;','quot;','quot','rArr;','radic;','rang;','raquo;', - 'raquo','rarr;','rceil;','rdquo;','real;','reg;','reg','rfloor;','rho;', - 'rlm;','rsaquo;','rsquo;','sbquo;','scaron;','sdot;','sect;','sect','shy;', - 'shy','sigma;','sigmaf;','sim;','spades;','sub;','sube;','sum;','sup1;', - 'sup1','sup2;','sup2','sup3;','sup3','sup;','supe;','szlig;','szlig','tau;', - 'there4;','theta;','thetasym;','thinsp;','thorn;','thorn','tilde;','times;', - 'times','trade;','uArr;','uacute;','uacute','uarr;','ucirc;','ucirc', - 'ugrave;','ugrave','uml;','uml','upsih;','upsilon;','uuml;','uuml','weierp;', - 'xi;','yacute;','yacute','yen;','yen','yuml;','yuml','zeta;','zwj;','zwnj;'); - - const PCDATA = 0; - const RCDATA = 1; - const CDATA = 2; - const PLAINTEXT = 3; - - const DOCTYPE = 0; - const STARTTAG = 1; - const ENDTAG = 2; - const COMMENT = 3; - const CHARACTR = 4; - const EOF = 5; - - public function __construct($data) { - - $this->data = $data; - $this->char = -1; - $this->EOF = strlen($data); - $this->tree = new HTML5TreeConstructer; - $this->content_model = self::PCDATA; - - $this->state = 'data'; - - while($this->state !== null) { - $this->{$this->state.'State'}(); - } - } - - public function save() { - return $this->tree->save(); - } - - private function char() { - return ($this->char < $this->EOF) - ? $this->data[$this->char] - : false; - } - - private function character($s, $l = 0) { - if($s + $l < $this->EOF) { - if($l === 0) { - return $this->data[$s]; - } else { - return substr($this->data, $s, $l); - } - } - } - - private function characters($char_class, $start) { - return preg_replace('#^(['.$char_class.']+).*#s', '\\1', substr($this->data, $start)); - } - - private function dataState() { - // Consume the next input character - $this->char++; - $char = $this->char(); - - if($char === '&' && ($this->content_model === self::PCDATA || $this->content_model === self::RCDATA)) { - /* U+0026 AMPERSAND (&) - When the content model flag is set to one of the PCDATA or RCDATA - states: switch to the entity data state. Otherwise: treat it as per - the "anything else" entry below. */ - $this->state = 'entityData'; - - } elseif($char === '-') { - /* If the content model flag is set to either the RCDATA state or - the CDATA state, and the escape flag is false, and there are at - least three characters before this one in the input stream, and the - last four characters in the input stream, including this one, are - U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, - and U+002D HYPHEN-MINUS (""), - set the escape flag to false. */ - if(($this->content_model === self::RCDATA || - $this->content_model === self::CDATA) && $this->escape === true && - $this->character($this->char, 3) === '-->') { - $this->escape = false; - } - - /* In any case, emit the input character as a character token. - Stay in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => $char - )); - - } elseif($this->char === $this->EOF) { - /* EOF - Emit an end-of-file token. */ - $this->EOF(); - - } elseif($this->content_model === self::PLAINTEXT) { - /* When the content model flag is set to the PLAINTEXT state - THIS DIFFERS GREATLY FROM THE SPEC: Get the remaining characters of - the text and emit it as a character token. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => substr($this->data, $this->char) - )); - - $this->EOF(); - - } else { - /* Anything else - THIS DIFFERS GREATLY FROM THE SPEC: Get as many character that - otherwise would also be treated as a character token and emit it - as a single character token. Stay in the data state. */ - $len = strcspn($this->data, '<&', $this->char); - $char = substr($this->data, $this->char, $len); - $this->char += $len - 1; - - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => $char - )); - - $this->state = 'data'; - } - } - - private function entityDataState() { - // Attempt to consume an entity. - $entity = $this->entity(); - - // If nothing is returned, emit a U+0026 AMPERSAND character token. - // Otherwise, emit the character token that was returned. - $char = (!$entity) ? '&' : $entity; - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => $char - )); - - // Finally, switch to the data state. - $this->state = 'data'; - } - - private function tagOpenState() { - switch($this->content_model) { - case self::RCDATA: - case self::CDATA: - /* If the next input character is a U+002F SOLIDUS (/) character, - consume it and switch to the close tag open state. If the next - input character is not a U+002F SOLIDUS (/) character, emit a - U+003C LESS-THAN SIGN character token and switch to the data - state to process the next input character. */ - if($this->character($this->char + 1) === '/') { - $this->char++; - $this->state = 'closeTagOpen'; - - } else { - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<' - )); - - $this->state = 'data'; - } - break; - - case self::PCDATA: - // If the content model flag is set to the PCDATA state - // Consume the next input character: - $this->char++; - $char = $this->char(); - - if($char === '!') { - /* U+0021 EXCLAMATION MARK (!) - Switch to the markup declaration open state. */ - $this->state = 'markupDeclarationOpen'; - - } elseif($char === '/') { - /* U+002F SOLIDUS (/) - Switch to the close tag open state. */ - $this->state = 'closeTagOpen'; - - } elseif(preg_match('/^[A-Za-z]$/', $char)) { - /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z - Create a new start tag token, set its tag name to the lowercase - version of the input character (add 0x0020 to the character's code - point), then switch to the tag name state. (Don't emit the token - yet; further details will be filled in before it is emitted.) */ - $this->token = array( - 'name' => strtolower($char), - 'type' => self::STARTTAG, - 'attr' => array() - ); - - $this->state = 'tagName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Parse error. Emit a U+003C LESS-THAN SIGN character token and a - U+003E GREATER-THAN SIGN character token. Switch to the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<>' - )); - - $this->state = 'data'; - - } elseif($char === '?') { - /* U+003F QUESTION MARK (?) - Parse error. Switch to the bogus comment state. */ - $this->state = 'bogusComment'; - - } else { - /* Anything else - Parse error. Emit a U+003C LESS-THAN SIGN character token and - reconsume the current input character in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<' - )); - - $this->char--; - $this->state = 'data'; - } - break; - } - } - - private function closeTagOpenState() { - $next_node = strtolower($this->characters('A-Za-z', $this->char + 1)); - $the_same = count($this->tree->stack) > 0 && $next_node === end($this->tree->stack)->nodeName; - - if(($this->content_model === self::RCDATA || $this->content_model === self::CDATA) && - (!$the_same || ($the_same && (!preg_match('/[\t\n\x0b\x0c >\/]/', - $this->character($this->char + 1 + strlen($next_node))) || $this->EOF === $this->char)))) { - /* If the content model flag is set to the RCDATA or CDATA states then - examine the next few characters. If they do not match the tag name of - the last start tag token emitted (case insensitively), or if they do but - they are not immediately followed by one of the following characters: - * U+0009 CHARACTER TABULATION - * U+000A LINE FEED (LF) - * U+000B LINE TABULATION - * U+000C FORM FEED (FF) - * U+0020 SPACE - * U+003E GREATER-THAN SIGN (>) - * U+002F SOLIDUS (/) - * EOF - ...then there is a parse error. Emit a U+003C LESS-THAN SIGN character - token, a U+002F SOLIDUS character token, and switch to the data state - to process the next input character. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => 'state = 'data'; - - } else { - /* Otherwise, if the content model flag is set to the PCDATA state, - or if the next few characters do match that tag name, consume the - next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[A-Za-z]$/', $char)) { - /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z - Create a new end tag token, set its tag name to the lowercase version - of the input character (add 0x0020 to the character's code point), then - switch to the tag name state. (Don't emit the token yet; further details - will be filled in before it is emitted.) */ - $this->token = array( - 'name' => strtolower($char), - 'type' => self::ENDTAG - ); - - $this->state = 'tagName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Parse error. Switch to the data state. */ - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit a U+003C LESS-THAN SIGN character token and a U+002F - SOLIDUS character token. Reconsume the EOF character in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => 'char--; - $this->state = 'data'; - - } else { - /* Parse error. Switch to the bogus comment state. */ - $this->state = 'bogusComment'; - } - } - } - - private function tagNameState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } elseif($char === '/') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } else { - /* Anything else - Append the current input character to the current tag token's tag name. - Stay in the tag name state. */ - $this->token['name'] .= strtolower($char); - $this->state = 'tagName'; - } - } - - private function beforeAttributeNameState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '/') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Stay in the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Start a new attribute in the current tag token. Set that attribute's - name to the current input character, and its value to the empty string. - Switch to the attribute name state. */ - $this->token['attr'][] = array( - 'name' => strtolower($char), - 'value' => null - ); - - $this->state = 'attributeName'; - } - } - - private function attributeNameState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute name state. */ - $this->state = 'afterAttributeName'; - - } elseif($char === '=') { - /* U+003D EQUALS SIGN (=) - Switch to the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '/' && $this->character($this->char + 1) !== '>') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's name. - Stay in the attribute name state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['name'] .= strtolower($char); - - $this->state = 'attributeName'; - } - } - - private function afterAttributeNameState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the after attribute name state. */ - $this->state = 'afterAttributeName'; - - } elseif($char === '=') { - /* U+003D EQUALS SIGN (=) - Switch to the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '/' && $this->character($this->char + 1) !== '>') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the - before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Start a new attribute in the current tag token. Set that attribute's - name to the current input character, and its value to the empty string. - Switch to the attribute name state. */ - $this->token['attr'][] = array( - 'name' => strtolower($char), - 'value' => null - ); - - $this->state = 'attributeName'; - } - } - - private function beforeAttributeValueState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif($char === '"') { - /* U+0022 QUOTATION MARK (") - Switch to the attribute value (double-quoted) state. */ - $this->state = 'attributeValueDoubleQuoted'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the attribute value (unquoted) state and reconsume - this input character. */ - $this->char--; - $this->state = 'attributeValueUnquoted'; - - } elseif($char === '\'') { - /* U+0027 APOSTROPHE (') - Switch to the attribute value (single-quoted) state. */ - $this->state = 'attributeValueSingleQuoted'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Switch to the attribute value (unquoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueUnquoted'; - } - } - - private function attributeValueDoubleQuotedState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if($char === '"') { - /* U+0022 QUOTATION MARK (") - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState('double'); - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the character - in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (double-quoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueDoubleQuoted'; - } - } - - private function attributeValueSingleQuotedState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if($char === '\'') { - /* U+0022 QUOTATION MARK (') - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState('single'); - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the character - in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (single-quoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueSingleQuoted'; - } - } - - private function attributeValueUnquotedState() { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState(); - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (unquoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueUnquoted'; - } - } - - private function entityInAttributeValueState() { - // Attempt to consume an entity. - $entity = $this->entity(); - - // If nothing is returned, append a U+0026 AMPERSAND character to the - // current attribute's value. Otherwise, emit the character token that - // was returned. - $char = (!$entity) - ? '&' - : $entity; - - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - } - - private function bogusCommentState() { - /* Consume every character up to the first U+003E GREATER-THAN SIGN - character (>) or the end of the file (EOF), whichever comes first. Emit - a comment token whose data is the concatenation of all the characters - starting from and including the character that caused the state machine - to switch into the bogus comment state, up to and including the last - consumed character before the U+003E character, if any, or up to the - end of the file otherwise. (If the comment was started by the end of - the file (EOF), the token is empty.) */ - $data = $this->characters('^>', $this->char); - $this->emitToken(array( - 'data' => $data, - 'type' => self::COMMENT - )); - - $this->char += strlen($data); - - /* Switch to the data state. */ - $this->state = 'data'; - - /* If the end of the file was reached, reconsume the EOF character. */ - if($this->char === $this->EOF) { - $this->char = $this->EOF - 1; - } - } - - private function markupDeclarationOpenState() { - /* If the next two characters are both U+002D HYPHEN-MINUS (-) - characters, consume those two characters, create a comment token whose - data is the empty string, and switch to the comment state. */ - if($this->character($this->char + 1, 2) === '--') { - $this->char += 2; - $this->state = 'comment'; - $this->token = array( - 'data' => null, - 'type' => self::COMMENT - ); - - /* Otherwise if the next seven chacacters are a case-insensitive match - for the word "DOCTYPE", then consume those characters and switch to the - DOCTYPE state. */ - } elseif(strtolower($this->character($this->char + 1, 7)) === 'doctype') { - $this->char += 7; - $this->state = 'doctype'; - - /* Otherwise, is is a parse error. Switch to the bogus comment state. - The next character that is consumed, if any, is the first character - that will be in the comment. */ - } else { - $this->char++; - $this->state = 'bogusComment'; - } - } - - private function commentState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - /* U+002D HYPHEN-MINUS (-) */ - if($char === '-') { - /* Switch to the comment dash state */ - $this->state = 'commentDash'; - - /* EOF */ - } elseif($this->char === $this->EOF) { - /* Parse error. Emit the comment token. Reconsume the EOF character - in the data state. */ - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - /* Anything else */ - } else { - /* Append the input character to the comment token's data. Stay in - the comment state. */ - $this->token['data'] .= $char; - } - } - - private function commentDashState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - /* U+002D HYPHEN-MINUS (-) */ - if($char === '-') { - /* Switch to the comment end state */ - $this->state = 'commentEnd'; - - /* EOF */ - } elseif($this->char === $this->EOF) { - /* Parse error. Emit the comment token. Reconsume the EOF character - in the data state. */ - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - /* Anything else */ - } else { - /* Append a U+002D HYPHEN-MINUS (-) character and the input - character to the comment token's data. Switch to the comment state. */ - $this->token['data'] .= '-'.$char; - $this->state = 'comment'; - } - } - - private function commentEndState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '-') { - $this->token['data'] .= '-'; - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['data'] .= '--'.$char; - $this->state = 'comment'; - } - } - - private function doctypeState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - $this->state = 'beforeDoctypeName'; - - } else { - $this->char--; - $this->state = 'beforeDoctypeName'; - } - } - - private function beforeDoctypeNameState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - // Stay in the before DOCTYPE name state. - - } elseif(preg_match('/^[a-z]$/', $char)) { - $this->token = array( - 'name' => strtoupper($char), - 'type' => self::DOCTYPE, - 'error' => true - ); - - $this->state = 'doctypeName'; - - } elseif($char === '>') { - $this->emitToken(array( - 'name' => null, - 'type' => self::DOCTYPE, - 'error' => true - )); - - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - $this->emitToken(array( - 'name' => null, - 'type' => self::DOCTYPE, - 'error' => true - )); - - $this->char--; - $this->state = 'data'; - - } else { - $this->token = array( - 'name' => $char, - 'type' => self::DOCTYPE, - 'error' => true - ); - - $this->state = 'doctypeName'; - } - } - - private function doctypeNameState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - $this->state = 'AfterDoctypeName'; - - } elseif($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif(preg_match('/^[a-z]$/', $char)) { - $this->token['name'] .= strtoupper($char); - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['name'] .= $char; - } - - $this->token['error'] = ($this->token['name'] === 'HTML') - ? false - : true; - } - - private function afterDoctypeNameState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - // Stay in the DOCTYPE name state. - - } elseif($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['error'] = true; - $this->state = 'bogusDoctype'; - } - } - - private function bogusDoctypeState() { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - // Stay in the bogus DOCTYPE state. - } - } - - private function entity() { - $start = $this->char; - - // This section defines how to consume an entity. This definition is - // used when parsing entities in text and in attributes. - - // The behaviour depends on the identity of the next character (the - // one immediately after the U+0026 AMPERSAND character): - - switch($this->character($this->char + 1)) { - // U+0023 NUMBER SIGN (#) - case '#': - - // The behaviour further depends on the character after the - // U+0023 NUMBER SIGN: - switch($this->character($this->char + 1)) { - // U+0078 LATIN SMALL LETTER X - // U+0058 LATIN CAPITAL LETTER X - case 'x': - case 'X': - // Follow the steps below, but using the range of - // characters U+0030 DIGIT ZERO through to U+0039 DIGIT - // NINE, U+0061 LATIN SMALL LETTER A through to U+0066 - // LATIN SMALL LETTER F, and U+0041 LATIN CAPITAL LETTER - // A, through to U+0046 LATIN CAPITAL LETTER F (in other - // words, 0-9, A-F, a-f). - $char = 1; - $char_class = '0-9A-Fa-f'; - break; - - // Anything else - default: - // Follow the steps below, but using the range of - // characters U+0030 DIGIT ZERO through to U+0039 DIGIT - // NINE (i.e. just 0-9). - $char = 0; - $char_class = '0-9'; - break; - } - - // Consume as many characters as match the range of characters - // given above. - $this->char++; - $e_name = $this->characters($char_class, $this->char + $char + 1); - $entity = $this->character($start, $this->char); - $cond = strlen($e_name) > 0; - - // The rest of the parsing happens bellow. - break; - - // Anything else - default: - // Consume the maximum number of characters possible, with the - // consumed characters case-sensitively matching one of the - // identifiers in the first column of the entities table. - $e_name = $this->characters('0-9A-Za-z;', $this->char + 1); - $len = strlen($e_name); - - for($c = 1; $c <= $len; $c++) { - $id = substr($e_name, 0, $c); - $this->char++; - - if(in_array($id, $this->entities)) { - if ($e_name[$c-1] !== ';') { - if ($c < $len && $e_name[$c] == ';') { - $this->char++; // consume extra semicolon - } - } - $entity = $id; - break; - } - } - - $cond = isset($entity); - // The rest of the parsing happens bellow. - break; - } - - if(!$cond) { - // If no match can be made, then this is a parse error. No - // characters are consumed, and nothing is returned. - $this->char = $start; - return false; - } - - // Return a character token for the character corresponding to the - // entity name (as given by the second column of the entities table). - return html_entity_decode('&'.$entity.';', ENT_QUOTES, 'UTF-8'); - } - - private function emitToken($token) { - $emit = $this->tree->emitToken($token); - - if(is_int($emit)) { - $this->content_model = $emit; - - } elseif($token['type'] === self::ENDTAG) { - $this->content_model = self::PCDATA; - } - } - - private function EOF() { - $this->state = null; - $this->tree->emitToken(array( - 'type' => self::EOF - )); - } -} - -class HTML5TreeConstructer { - public $stack = array(); - - private $phase; - private $mode; - private $dom; - private $foster_parent = null; - private $a_formatting = array(); - - private $head_pointer = null; - private $form_pointer = null; - - private $scoping = array('button','caption','html','marquee','object','table','td','th'); - private $formatting = array('a','b','big','em','font','i','nobr','s','small','strike','strong','tt','u'); - private $special = array('address','area','base','basefont','bgsound', - 'blockquote','body','br','center','col','colgroup','dd','dir','div','dl', - 'dt','embed','fieldset','form','frame','frameset','h1','h2','h3','h4','h5', - 'h6','head','hr','iframe','image','img','input','isindex','li','link', - 'listing','menu','meta','noembed','noframes','noscript','ol','optgroup', - 'option','p','param','plaintext','pre','script','select','spacer','style', - 'tbody','textarea','tfoot','thead','title','tr','ul','wbr'); - - // The different phases. - const INIT_PHASE = 0; - const ROOT_PHASE = 1; - const MAIN_PHASE = 2; - const END_PHASE = 3; - - // The different insertion modes for the main phase. - const BEFOR_HEAD = 0; - const IN_HEAD = 1; - const AFTER_HEAD = 2; - const IN_BODY = 3; - const IN_TABLE = 4; - const IN_CAPTION = 5; - const IN_CGROUP = 6; - const IN_TBODY = 7; - const IN_ROW = 8; - const IN_CELL = 9; - const IN_SELECT = 10; - const AFTER_BODY = 11; - const IN_FRAME = 12; - const AFTR_FRAME = 13; - - // The different types of elements. - const SPECIAL = 0; - const SCOPING = 1; - const FORMATTING = 2; - const PHRASING = 3; - - const MARKER = 0; - - public function __construct() { - $this->phase = self::INIT_PHASE; - $this->mode = self::BEFOR_HEAD; - $this->dom = new DOMDocument; - - $this->dom->encoding = 'UTF-8'; - $this->dom->preserveWhiteSpace = true; - $this->dom->substituteEntities = true; - $this->dom->strictErrorChecking = false; - } - - // Process tag tokens - public function emitToken($token) { - switch($this->phase) { - case self::INIT_PHASE: return $this->initPhase($token); break; - case self::ROOT_PHASE: return $this->rootElementPhase($token); break; - case self::MAIN_PHASE: return $this->mainPhase($token); break; - case self::END_PHASE : return $this->trailingEndPhase($token); break; - } - } - - private function initPhase($token) { - /* Initially, the tree construction stage must handle each token - emitted from the tokenisation stage as follows: */ - - /* A DOCTYPE token that is marked as being in error - A comment token - A start tag token - An end tag token - A character token that is not one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE - An end-of-file token */ - if((isset($token['error']) && $token['error']) || - $token['type'] === HTML5::COMMENT || - $token['type'] === HTML5::STARTTAG || - $token['type'] === HTML5::ENDTAG || - $token['type'] === HTML5::EOF || - ($token['type'] === HTML5::CHARACTR && isset($token['data']) && - !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']))) { - /* This specification does not define how to handle this case. In - particular, user agents may ignore the entirety of this specification - altogether for such documents, and instead invoke special parse modes - with a greater emphasis on backwards compatibility. */ - - $this->phase = self::ROOT_PHASE; - return $this->rootElementPhase($token); - - /* A DOCTYPE token marked as being correct */ - } elseif(isset($token['error']) && !$token['error']) { - /* Append a DocumentType node to the Document node, with the name - attribute set to the name given in the DOCTYPE token (which will be - "HTML"), and the other attributes specific to DocumentType objects - set to null, empty lists, or the empty string as appropriate. */ - $doctype = new DOMDocumentType(null, null, 'HTML'); - - /* Then, switch to the root element phase of the tree construction - stage. */ - $this->phase = self::ROOT_PHASE; - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif(isset($token['data']) && preg_match('/^[\t\n\x0b\x0c ]+$/', - $token['data'])) { - /* Append that character to the Document node. */ - $text = $this->dom->createTextNode($token['data']); - $this->dom->appendChild($text); - } - } - - private function rootElementPhase($token) { - /* After the initial phase, as each token is emitted from the tokenisation - stage, it must be processed as described in this section. */ - - /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the Document object with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->dom->appendChild($comment); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append that character to the Document node. */ - $text = $this->dom->createTextNode($token['data']); - $this->dom->appendChild($text); - - /* A character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED - (FF), or U+0020 SPACE - A start tag token - An end tag token - An end-of-file token */ - } elseif(($token['type'] === HTML5::CHARACTR && - !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || - $token['type'] === HTML5::STARTTAG || - $token['type'] === HTML5::ENDTAG || - $token['type'] === HTML5::EOF) { - /* Create an HTMLElement node with the tag name html, in the HTML - namespace. Append it to the Document object. Switch to the main - phase and reprocess the current token. */ - $html = $this->dom->createElement('html'); - $this->dom->appendChild($html); - $this->stack[] = $html; - - $this->phase = self::MAIN_PHASE; - return $this->mainPhase($token); - } - } - - private function mainPhase($token) { - /* Tokens in the main phase must be handled as follows: */ - - /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A start tag token with the tag name "html" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'html') { - /* If this start tag token was not the first start tag token, then - it is a parse error. */ - - /* For each attribute on the token, check to see if the attribute - is already present on the top element of the stack of open elements. - If it is not, add the attribute and its corresponding value to that - element. */ - foreach($token['attr'] as $attr) { - if(!$this->stack[0]->hasAttribute($attr['name'])) { - $this->stack[0]->setAttribute($attr['name'], $attr['value']); - } - } - - /* An end-of-file token */ - } elseif($token['type'] === HTML5::EOF) { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Anything else. */ - } else { - /* Depends on the insertion mode: */ - switch($this->mode) { - case self::BEFOR_HEAD: return $this->beforeHead($token); break; - case self::IN_HEAD: return $this->inHead($token); break; - case self::AFTER_HEAD: return $this->afterHead($token); break; - case self::IN_BODY: return $this->inBody($token); break; - case self::IN_TABLE: return $this->inTable($token); break; - case self::IN_CAPTION: return $this->inCaption($token); break; - case self::IN_CGROUP: return $this->inColumnGroup($token); break; - case self::IN_TBODY: return $this->inTableBody($token); break; - case self::IN_ROW: return $this->inRow($token); break; - case self::IN_CELL: return $this->inCell($token); break; - case self::IN_SELECT: return $this->inSelect($token); break; - case self::AFTER_BODY: return $this->afterBody($token); break; - case self::IN_FRAME: return $this->inFrameset($token); break; - case self::AFTR_FRAME: return $this->afterFrameset($token); break; - case self::END_PHASE: return $this->trailingEndPhase($token); break; - } - } - } - - private function beforeHead($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token with the tag name "head" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') { - /* Create an element for the token, append the new element to the - current node and push it onto the stack of open elements. */ - $element = $this->insertElement($token); - - /* Set the head element pointer to this new element node. */ - $this->head_pointer = $element; - - /* Change the insertion mode to "in head". */ - $this->mode = self::IN_HEAD; - - /* A start tag token whose tag name is one of: "base", "link", "meta", - "script", "style", "title". Or an end tag with the tag name "html". - Or a character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. Or any other start tag token */ - } elseif($token['type'] === HTML5::STARTTAG || - ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') || - ($token['type'] === HTML5::CHARACTR && !preg_match('/^[\t\n\x0b\x0c ]$/', - $token['data']))) { - /* Act as if a start tag token with the tag name "head" and no - attributes had been seen, then reprocess the current token. */ - $this->beforeHead(array( - 'name' => 'head', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inHead($token); - - /* Any other end tag */ - } elseif($token['type'] === HTML5::ENDTAG) { - /* Parse error. Ignore the token. */ - } - } - - private function inHead($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. - - THIS DIFFERS FROM THE SPEC: If the current node is either a title, style - or script element, append the character to the current node regardless - of its content. */ - if(($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || ( - $token['type'] === HTML5::CHARACTR && in_array(end($this->stack)->nodeName, - array('title', 'style', 'script')))) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('title', 'style', 'script'))) { - array_pop($this->stack); - return HTML5::PCDATA; - - /* A start tag with the tag name "title" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'title') { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - } else { - $element = $this->insertElement($token); - } - - /* Switch the tokeniser's content model flag to the RCDATA state. */ - return HTML5::RCDATA; - - /* A start tag with the tag name "style" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'style') { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - } else { - $this->insertElement($token); - } - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - - /* A start tag with the tag name "script" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'script') { - /* Create an element for the token. */ - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - - /* A start tag with the tag name "base", "link", or "meta" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('base', 'link', 'meta'))) { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - array_pop($this->stack); - - } else { - $this->insertElement($token); - } - - /* An end tag with the tag name "head" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'head') { - /* If the current node is a head element, pop the current node off - the stack of open elements. */ - if($this->head_pointer->isSameNode(end($this->stack))) { - array_pop($this->stack); - - /* Otherwise, this is a parse error. */ - } else { - // k - } - - /* Change the insertion mode to "after head". */ - $this->mode = self::AFTER_HEAD; - - /* A start tag with the tag name "head" or an end tag except "html". */ - } elseif(($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') || - ($token['type'] === HTML5::ENDTAG && $token['name'] !== 'html')) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* If the current node is a head element, act as if an end tag - token with the tag name "head" had been seen. */ - if($this->head_pointer->isSameNode(end($this->stack))) { - $this->inHead(array( - 'name' => 'head', - 'type' => HTML5::ENDTAG - )); - - /* Otherwise, change the insertion mode to "after head". */ - } else { - $this->mode = self::AFTER_HEAD; - } - - /* Then, reprocess the current token. */ - return $this->afterHead($token); - } - } - - private function afterHead($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token with the tag name "body" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'body') { - /* Insert a body element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in body". */ - $this->mode = self::IN_BODY; - - /* A start tag token with the tag name "frameset" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'frameset') { - /* Insert a frameset element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in frameset". */ - $this->mode = self::IN_FRAME; - - /* A start tag token whose tag name is one of: "base", "link", "meta", - "script", "style", "title" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('base', 'link', 'meta', 'script', 'style', 'title'))) { - /* Parse error. Switch the insertion mode back to "in head" and - reprocess the token. */ - $this->mode = self::IN_HEAD; - return $this->inHead($token); - - /* Anything else */ - } else { - /* Act as if a start tag token with the tag name "body" and no - attributes had been seen, and then reprocess the current token. */ - $this->afterHead(array( - 'name' => 'body', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inBody($token); - } - } - - private function inBody($token) { - /* Handle the token as follows: */ - - switch($token['type']) { - /* A character token */ - case HTML5::CHARACTR: - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Append the token's character to the current node. */ - $this->insertText($token['data']); - break; - - /* A comment token */ - case HTML5::COMMENT: - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - break; - - case HTML5::STARTTAG: - switch($token['name']) { - /* A start tag token whose tag name is one of: "script", - "style" */ - case 'script': case 'style': - /* Process the token as if the insertion mode had been "in - head". */ - return $this->inHead($token); - break; - - /* A start tag token whose tag name is one of: "base", "link", - "meta", "title" */ - case 'base': case 'link': case 'meta': case 'title': - /* Parse error. Process the token as if the insertion mode - had been "in head". */ - return $this->inHead($token); - break; - - /* A start tag token with the tag name "body" */ - case 'body': - /* Parse error. If the second element on the stack of open - elements is not a body element, or, if the stack of open - elements has only one node on it, then ignore the token. - (innerHTML case) */ - if(count($this->stack) === 1 || $this->stack[1]->nodeName !== 'body') { - // Ignore - - /* Otherwise, for each attribute on the token, check to see - if the attribute is already present on the body element (the - second element) on the stack of open elements. If it is not, - add the attribute and its corresponding value to that - element. */ - } else { - foreach($token['attr'] as $attr) { - if(!$this->stack[1]->hasAttribute($attr['name'])) { - $this->stack[1]->setAttribute($attr['name'], $attr['value']); - } - } - } - break; - - /* A start tag whose tag name is one of: "address", - "blockquote", "center", "dir", "div", "dl", "fieldset", - "listing", "menu", "ol", "p", "ul" */ - case 'address': case 'blockquote': case 'center': case 'dir': - case 'div': case 'dl': case 'fieldset': case 'listing': - case 'menu': case 'ol': case 'p': case 'ul': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - break; - - /* A start tag whose tag name is "form" */ - case 'form': - /* If the form element pointer is not null, ignore the - token with a parse error. */ - if($this->form_pointer !== null) { - // Ignore. - - /* Otherwise: */ - } else { - /* If the stack of open elements has a p element in - scope, then act as if an end tag with the tag name p - had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token, and set the - form element pointer to point to the element created. */ - $element = $this->insertElement($token); - $this->form_pointer = $element; - } - break; - - /* A start tag whose tag name is "li", "dd" or "dt" */ - case 'li': case 'dd': case 'dt': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - $stack_length = count($this->stack) - 1; - - for($n = $stack_length; 0 <= $n; $n--) { - /* 1. Initialise node to be the current node (the - bottommost node of the stack). */ - $stop = false; - $node = $this->stack[$n]; - $cat = $this->getElementCategory($node->tagName); - - /* 2. If node is an li, dd or dt element, then pop all - the nodes from the current node up to node, including - node, then stop this algorithm. */ - if($token['name'] === $node->tagName || ($token['name'] !== 'li' - && ($node->tagName === 'dd' || $node->tagName === 'dt'))) { - for($x = $stack_length; $x >= $n ; $x--) { - array_pop($this->stack); - } - - break; - } - - /* 3. If node is not in the formatting category, and is - not in the phrasing category, and is not an address or - div element, then stop this algorithm. */ - if($cat !== self::FORMATTING && $cat !== self::PHRASING && - $node->tagName !== 'address' && $node->tagName !== 'div') { - break; - } - } - - /* Finally, insert an HTML element with the same tag - name as the token's. */ - $this->insertElement($token); - break; - - /* A start tag token whose tag name is "plaintext" */ - case 'plaintext': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - return HTML5::PLAINTEXT; - break; - - /* A start tag whose tag name is one of: "h1", "h2", "h3", "h4", - "h5", "h6" */ - case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* If the stack of open elements has in scope an element whose - tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then - this is a parse error; pop elements from the stack until an - element with one of those tag names has been popped from the - stack. */ - while($this->elementInScope(array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'))) { - array_pop($this->stack); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - break; - - /* A start tag whose tag name is "a" */ - case 'a': - /* If the list of active formatting elements contains - an element whose tag name is "a" between the end of the - list and the last marker on the list (or the start of - the list if there is no marker on the list), then this - is a parse error; act as if an end tag with the tag name - "a" had been seen, then remove that element from the list - of active formatting elements and the stack of open - elements if the end tag didn't already remove it (it - might not have if the element is not in table scope). */ - $leng = count($this->a_formatting); - - for($n = $leng - 1; $n >= 0; $n--) { - if($this->a_formatting[$n] === self::MARKER) { - break; - - } elseif($this->a_formatting[$n]->nodeName === 'a') { - $this->emitToken(array( - 'name' => 'a', - 'type' => HTML5::ENDTAG - )); - break; - } - } - - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $el = $this->insertElement($token); - - /* Add that element to the list of active formatting - elements. */ - $this->a_formatting[] = $el; - break; - - /* A start tag whose tag name is one of: "b", "big", "em", "font", - "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ - case 'b': case 'big': case 'em': case 'font': case 'i': - case 'nobr': case 's': case 'small': case 'strike': - case 'strong': case 'tt': case 'u': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $el = $this->insertElement($token); - - /* Add that element to the list of active formatting - elements. */ - $this->a_formatting[] = $el; - break; - - /* A start tag token whose tag name is "button" */ - case 'button': - /* If the stack of open elements has a button element in scope, - then this is a parse error; act as if an end tag with the tag - name "button" had been seen, then reprocess the token. (We don't - do that. Unnecessary.) */ - if($this->elementInScope('button')) { - $this->inBody(array( - 'name' => 'button', - 'type' => HTML5::ENDTAG - )); - } - - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - break; - - /* A start tag token whose tag name is one of: "marquee", "object" */ - case 'marquee': case 'object': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - break; - - /* A start tag token whose tag name is "xmp" */ - case 'xmp': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Switch the content model flag to the CDATA state. */ - return HTML5::CDATA; - break; - - /* A start tag whose tag name is "table" */ - case 'table': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in table". */ - $this->mode = self::IN_TABLE; - break; - - /* A start tag whose tag name is one of: "area", "basefont", - "bgsound", "br", "embed", "img", "param", "spacer", "wbr" */ - case 'area': case 'basefont': case 'bgsound': case 'br': - case 'embed': case 'img': case 'param': case 'spacer': - case 'wbr': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "hr" */ - case 'hr': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "image" */ - case 'image': - /* Parse error. Change the token's tag name to "img" and - reprocess it. (Don't ask.) */ - $token['name'] = 'img'; - return $this->inBody($token); - break; - - /* A start tag whose tag name is "input" */ - case 'input': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an input element for the token. */ - $element = $this->insertElement($token, false); - - /* If the form element pointer is not null, then associate the - input element with the form element pointed to by the form - element pointer. */ - $this->form_pointer !== null - ? $this->form_pointer->appendChild($element) - : end($this->stack)->appendChild($element); - - /* Pop that input element off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "isindex" */ - case 'isindex': - /* Parse error. */ - // w/e - - /* If the form element pointer is not null, - then ignore the token. */ - if($this->form_pointer === null) { - /* Act as if a start tag token with the tag name "form" had - been seen. */ - $this->inBody(array( - 'name' => 'body', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "hr" had - been seen. */ - $this->inBody(array( - 'name' => 'hr', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "p" had - been seen. */ - $this->inBody(array( - 'name' => 'p', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "label" - had been seen. */ - $this->inBody(array( - 'name' => 'label', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a stream of character tokens had been seen. */ - $this->insertText('This is a searchable index. '. - 'Insert your search keywords here: '); - - /* Act as if a start tag token with the tag name "input" - had been seen, with all the attributes from the "isindex" - token, except with the "name" attribute set to the value - "isindex" (ignoring any explicit "name" attribute). */ - $attr = $token['attr']; - $attr[] = array('name' => 'name', 'value' => 'isindex'); - - $this->inBody(array( - 'name' => 'input', - 'type' => HTML5::STARTTAG, - 'attr' => $attr - )); - - /* Act as if a stream of character tokens had been seen - (see below for what they should say). */ - $this->insertText('This is a searchable index. '. - 'Insert your search keywords here: '); - - /* Act as if an end tag token with the tag name "label" - had been seen. */ - $this->inBody(array( - 'name' => 'label', - 'type' => HTML5::ENDTAG - )); - - /* Act as if an end tag token with the tag name "p" had - been seen. */ - $this->inBody(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - - /* Act as if a start tag token with the tag name "hr" had - been seen. */ - $this->inBody(array( - 'name' => 'hr', - 'type' => HTML5::ENDTAG - )); - - /* Act as if an end tag token with the tag name "form" had - been seen. */ - $this->inBody(array( - 'name' => 'form', - 'type' => HTML5::ENDTAG - )); - } - break; - - /* A start tag whose tag name is "textarea" */ - case 'textarea': - $this->insertElement($token); - - /* Switch the tokeniser's content model flag to the - RCDATA state. */ - return HTML5::RCDATA; - break; - - /* A start tag whose tag name is one of: "iframe", "noembed", - "noframes" */ - case 'iframe': case 'noembed': case 'noframes': - $this->insertElement($token); - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - break; - - /* A start tag whose tag name is "select" */ - case 'select': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in select". */ - $this->mode = self::IN_SELECT; - break; - - /* A start or end tag whose tag name is one of: "caption", "col", - "colgroup", "frame", "frameset", "head", "option", "optgroup", - "tbody", "td", "tfoot", "th", "thead", "tr". */ - case 'caption': case 'col': case 'colgroup': case 'frame': - case 'frameset': case 'head': case 'option': case 'optgroup': - case 'tbody': case 'td': case 'tfoot': case 'th': case 'thead': - case 'tr': - // Parse error. Ignore the token. - break; - - /* A start or end tag whose tag name is one of: "event-source", - "section", "nav", "article", "aside", "header", "footer", - "datagrid", "command" */ - case 'event-source': case 'section': case 'nav': case 'article': - case 'aside': case 'header': case 'footer': case 'datagrid': - case 'command': - // Work in progress! - break; - - /* A start tag token not covered by the previous entries */ - default: - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - $this->insertElement($token, true, true); - break; - } - break; - - case HTML5::ENDTAG: - switch($token['name']) { - /* An end tag with the tag name "body" */ - case 'body': - /* If the second element in the stack of open elements is - not a body element, this is a parse error. Ignore the token. - (innerHTML case) */ - if(count($this->stack) < 2 || $this->stack[1]->nodeName !== 'body') { - // Ignore. - - /* If the current node is not the body element, then this - is a parse error. */ - } elseif(end($this->stack)->nodeName !== 'body') { - // Parse error. - } - - /* Change the insertion mode to "after body". */ - $this->mode = self::AFTER_BODY; - break; - - /* An end tag with the tag name "html" */ - case 'html': - /* Act as if an end tag with tag name "body" had been seen, - then, if that token wasn't ignored, reprocess the current - token. */ - $this->inBody(array( - 'name' => 'body', - 'type' => HTML5::ENDTAG - )); - - return $this->afterBody($token); - break; - - /* An end tag whose tag name is one of: "address", "blockquote", - "center", "dir", "div", "dl", "fieldset", "listing", "menu", - "ol", "pre", "ul" */ - case 'address': case 'blockquote': case 'center': case 'dir': - case 'div': case 'dl': case 'fieldset': case 'listing': - case 'menu': case 'ol': case 'pre': case 'ul': - /* If the stack of open elements has an element in scope - with the same tag name as that of the token, then generate - implied end tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with - the same tag name as that of the token, then this - is a parse error. */ - // w/e - - /* If the stack of open elements has an element in - scope with the same tag name as that of the token, - then pop elements from this stack until an element - with that tag name has been popped from the stack. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is "form" */ - case 'form': - /* If the stack of open elements has an element in scope - with the same tag name as that of the token, then generate - implied end tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - } - - if(end($this->stack)->nodeName !== $token['name']) { - /* Now, if the current node is not an element with the - same tag name as that of the token, then this is a parse - error. */ - // w/e - - } else { - /* Otherwise, if the current node is an element with - the same tag name as that of the token pop that element - from the stack. */ - array_pop($this->stack); - } - - /* In any case, set the form element pointer to null. */ - $this->form_pointer = null; - break; - - /* An end tag whose tag name is "p" */ - case 'p': - /* If the stack of open elements has a p element in scope, - then generate implied end tags, except for p elements. */ - if($this->elementInScope('p')) { - $this->generateImpliedEndTags(array('p')); - - /* If the current node is not a p element, then this is - a parse error. */ - // k - - /* If the stack of open elements has a p element in - scope, then pop elements from this stack until the stack - no longer has a p element in scope. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->elementInScope('p')) { - array_pop($this->stack); - - } else { - break; - } - } - } - break; - - /* An end tag whose tag name is "dd", "dt", or "li" */ - case 'dd': case 'dt': case 'li': - /* If the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then - generate implied end tags, except for elements with the - same tag name as the token. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(array($token['name'])); - - /* If the current node is not an element with the same - tag name as the token, then this is a parse error. */ - // w/e - - /* If the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then - pop elements from this stack until an element with that - tag name has been popped from the stack. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is one of: "h1", "h2", "h3", "h4", - "h5", "h6" */ - case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': - $elements = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'); - - /* If the stack of open elements has in scope an element whose - tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then - generate implied end tags. */ - if($this->elementInScope($elements)) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with the same - tag name as that of the token, then this is a parse error. */ - // w/e - - /* If the stack of open elements has in scope an element - whose tag name is one of "h1", "h2", "h3", "h4", "h5", or - "h6", then pop elements from the stack until an element - with one of those tag names has been popped from the stack. */ - while($this->elementInScope($elements)) { - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is one of: "a", "b", "big", "em", - "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ - case 'a': case 'b': case 'big': case 'em': case 'font': - case 'i': case 'nobr': case 's': case 'small': case 'strike': - case 'strong': case 'tt': case 'u': - /* 1. Let the formatting element be the last element in - the list of active formatting elements that: - * is between the end of the list and the last scope - marker in the list, if any, or the start of the list - otherwise, and - * has the same tag name as the token. - */ - while(true) { - for($a = count($this->a_formatting) - 1; $a >= 0; $a--) { - if($this->a_formatting[$a] === self::MARKER) { - break; - - } elseif($this->a_formatting[$a]->tagName === $token['name']) { - $formatting_element = $this->a_formatting[$a]; - $in_stack = in_array($formatting_element, $this->stack, true); - $fe_af_pos = $a; - break; - } - } - - /* If there is no such node, or, if that node is - also in the stack of open elements but the element - is not in scope, then this is a parse error. Abort - these steps. The token is ignored. */ - if(!isset($formatting_element) || ($in_stack && - !$this->elementInScope($token['name']))) { - break; - - /* Otherwise, if there is such a node, but that node - is not in the stack of open elements, then this is a - parse error; remove the element from the list, and - abort these steps. */ - } elseif(isset($formatting_element) && !$in_stack) { - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - break; - } - - /* 2. Let the furthest block be the topmost node in the - stack of open elements that is lower in the stack - than the formatting element, and is not an element in - the phrasing or formatting categories. There might - not be one. */ - $fe_s_pos = array_search($formatting_element, $this->stack, true); - $length = count($this->stack); - - for($s = $fe_s_pos + 1; $s < $length; $s++) { - $category = $this->getElementCategory($this->stack[$s]->nodeName); - - if($category !== self::PHRASING && $category !== self::FORMATTING) { - $furthest_block = $this->stack[$s]; - } - } - - /* 3. If there is no furthest block, then the UA must - skip the subsequent steps and instead just pop all - the nodes from the bottom of the stack of open - elements, from the current node up to the formatting - element, and remove the formatting element from the - list of active formatting elements. */ - if(!isset($furthest_block)) { - for($n = $length - 1; $n >= $fe_s_pos; $n--) { - array_pop($this->stack); - } - - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - break; - } - - /* 4. Let the common ancestor be the element - immediately above the formatting element in the stack - of open elements. */ - $common_ancestor = $this->stack[$fe_s_pos - 1]; - - /* 5. If the furthest block has a parent node, then - remove the furthest block from its parent node. */ - if($furthest_block->parentNode !== null) { - $furthest_block->parentNode->removeChild($furthest_block); - } - - /* 6. Let a bookmark note the position of the - formatting element in the list of active formatting - elements relative to the elements on either side - of it in the list. */ - $bookmark = $fe_af_pos; - - /* 7. Let node and last node be the furthest block. - Follow these steps: */ - $node = $furthest_block; - $last_node = $furthest_block; - - while(true) { - for($n = array_search($node, $this->stack, true) - 1; $n >= 0; $n--) { - /* 7.1 Let node be the element immediately - prior to node in the stack of open elements. */ - $node = $this->stack[$n]; - - /* 7.2 If node is not in the list of active - formatting elements, then remove node from - the stack of open elements and then go back - to step 1. */ - if(!in_array($node, $this->a_formatting, true)) { - unset($this->stack[$n]); - $this->stack = array_merge($this->stack); - - } else { - break; - } - } - - /* 7.3 Otherwise, if node is the formatting - element, then go to the next step in the overall - algorithm. */ - if($node === $formatting_element) { - break; - - /* 7.4 Otherwise, if last node is the furthest - block, then move the aforementioned bookmark to - be immediately after the node in the list of - active formatting elements. */ - } elseif($last_node === $furthest_block) { - $bookmark = array_search($node, $this->a_formatting, true) + 1; - } - - /* 7.5 If node has any children, perform a - shallow clone of node, replace the entry for - node in the list of active formatting elements - with an entry for the clone, replace the entry - for node in the stack of open elements with an - entry for the clone, and let node be the clone. */ - if($node->hasChildNodes()) { - $clone = $node->cloneNode(); - $s_pos = array_search($node, $this->stack, true); - $a_pos = array_search($node, $this->a_formatting, true); - - $this->stack[$s_pos] = $clone; - $this->a_formatting[$a_pos] = $clone; - $node = $clone; - } - - /* 7.6 Insert last node into node, first removing - it from its previous parent node if any. */ - if($last_node->parentNode !== null) { - $last_node->parentNode->removeChild($last_node); - } - - $node->appendChild($last_node); - - /* 7.7 Let last node be node. */ - $last_node = $node; - } - - /* 8. Insert whatever last node ended up being in - the previous step into the common ancestor node, - first removing it from its previous parent node if - any. */ - if($last_node->parentNode !== null) { - $last_node->parentNode->removeChild($last_node); - } - - $common_ancestor->appendChild($last_node); - - /* 9. Perform a shallow clone of the formatting - element. */ - $clone = $formatting_element->cloneNode(); - - /* 10. Take all of the child nodes of the furthest - block and append them to the clone created in the - last step. */ - while($furthest_block->hasChildNodes()) { - $child = $furthest_block->firstChild; - $furthest_block->removeChild($child); - $clone->appendChild($child); - } - - /* 11. Append that clone to the furthest block. */ - $furthest_block->appendChild($clone); - - /* 12. Remove the formatting element from the list - of active formatting elements, and insert the clone - into the list of active formatting elements at the - position of the aforementioned bookmark. */ - $fe_af_pos = array_search($formatting_element, $this->a_formatting, true); - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - - $af_part1 = array_slice($this->a_formatting, 0, $bookmark - 1); - $af_part2 = array_slice($this->a_formatting, $bookmark, count($this->a_formatting)); - $this->a_formatting = array_merge($af_part1, array($clone), $af_part2); - - /* 13. Remove the formatting element from the stack - of open elements, and insert the clone into the stack - of open elements immediately after (i.e. in a more - deeply nested position than) the position of the - furthest block in that stack. */ - $fe_s_pos = array_search($formatting_element, $this->stack, true); - $fb_s_pos = array_search($furthest_block, $this->stack, true); - unset($this->stack[$fe_s_pos]); - - $s_part1 = array_slice($this->stack, 0, $fb_s_pos); - $s_part2 = array_slice($this->stack, $fb_s_pos + 1, count($this->stack)); - $this->stack = array_merge($s_part1, array($clone), $s_part2); - - /* 14. Jump back to step 1 in this series of steps. */ - unset($formatting_element, $fe_af_pos, $fe_s_pos, $furthest_block); - } - break; - - /* An end tag token whose tag name is one of: "button", - "marquee", "object" */ - case 'button': case 'marquee': case 'object': - /* If the stack of open elements has an element in scope whose - tag name matches the tag name of the token, then generate implied - tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with the same - tag name as the token, then this is a parse error. */ - // k - - /* Now, if the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then pop - elements from the stack until that element has been popped from - the stack, and clear the list of active formatting elements up - to the last marker. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - - $marker = end(array_keys($this->a_formatting, self::MARKER, true)); - - for($n = count($this->a_formatting) - 1; $n > $marker; $n--) { - array_pop($this->a_formatting); - } - } - break; - - /* Or an end tag whose tag name is one of: "area", "basefont", - "bgsound", "br", "embed", "hr", "iframe", "image", "img", - "input", "isindex", "noembed", "noframes", "param", "select", - "spacer", "table", "textarea", "wbr" */ - case 'area': case 'basefont': case 'bgsound': case 'br': - case 'embed': case 'hr': case 'iframe': case 'image': - case 'img': case 'input': case 'isindex': case 'noembed': - case 'noframes': case 'param': case 'select': case 'spacer': - case 'table': case 'textarea': case 'wbr': - // Parse error. Ignore the token. - break; - - /* An end tag token not covered by the previous entries */ - default: - for($n = count($this->stack) - 1; $n >= 0; $n--) { - /* Initialise node to be the current node (the bottommost - node of the stack). */ - $node = end($this->stack); - - /* If node has the same tag name as the end tag token, - then: */ - if($token['name'] === $node->nodeName) { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* If the tag name of the end tag token does not - match the tag name of the current node, this is a - parse error. */ - // k - - /* Pop all the nodes from the current node up to - node, including node, then stop this algorithm. */ - for($x = count($this->stack) - $n; $x >= $n; $x--) { - array_pop($this->stack); - } - - } else { - $category = $this->getElementCategory($node); - - if($category !== self::SPECIAL && $category !== self::SCOPING) { - /* Otherwise, if node is in neither the formatting - category nor the phrasing category, then this is a - parse error. Stop this algorithm. The end tag token - is ignored. */ - return false; - } - } - } - break; - } - break; - } - } - - private function inTable($token) { - $clear = array('html', 'table'); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $text = $this->dom->createTextNode($token['data']); - end($this->stack)->appendChild($text); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - end($this->stack)->appendChild($comment); - - /* A start tag whose tag name is "caption" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'caption') { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - - /* Insert an HTML element for the token, then switch the - insertion mode to "in caption". */ - $this->insertElement($token); - $this->mode = self::IN_CAPTION; - - /* A start tag whose tag name is "colgroup" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'colgroup') { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the - insertion mode to "in column group". */ - $this->insertElement($token); - $this->mode = self::IN_CGROUP; - - /* A start tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'col') { - $this->inTable(array( - 'name' => 'colgroup', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - $this->inColumnGroup($token); - - /* A start tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('tbody', 'tfoot', 'thead'))) { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the insertion - mode to "in table body". */ - $this->insertElement($token); - $this->mode = self::IN_TBODY; - - /* A start tag whose tag name is one of: "td", "th", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && - in_array($token['name'], array('td', 'th', 'tr'))) { - /* Act as if a start tag token with the tag name "tbody" had been - seen, then reprocess the current token. */ - $this->inTable(array( - 'name' => 'tbody', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inTableBody($token); - - /* A start tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'table') { - /* Parse error. Act as if an end tag token with the tag name "table" - had been seen, then, if that token wasn't ignored, reprocess the - current token. */ - $this->inTable(array( - 'name' => 'table', - 'type' => HTML5::ENDTAG - )); - - return $this->mainPhase($token); - - /* An end tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'table') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - return false; - - /* Otherwise: */ - } else { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Now, if the current node is not a table element, then this - is a parse error. */ - // w/e - - /* Pop elements from this stack until a table element has been - popped from the stack. */ - while(true) { - $current = end($this->stack)->nodeName; - array_pop($this->stack); - - if($current === 'table') { - break; - } - } - - /* Reset the insertion mode appropriately. */ - $this->resetInsertionMode(); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'tbody', 'td', - 'tfoot', 'th', 'thead', 'tr'))) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* Parse error. Process the token as if the insertion mode was "in - body", with the following exception: */ - - /* If the current node is a table, tbody, tfoot, thead, or tr - element, then, whenever a node would be inserted into the current - node, it must instead be inserted into the foster parent element. */ - if(in_array(end($this->stack)->nodeName, - array('table', 'tbody', 'tfoot', 'thead', 'tr'))) { - /* The foster parent element is the parent element of the last - table element in the stack of open elements, if there is a - table element and it has such a parent element. If there is no - table element in the stack of open elements (innerHTML case), - then the foster parent element is the first element in the - stack of open elements (the html element). Otherwise, if there - is a table element in the stack of open elements, but the last - table element in the stack of open elements has no parent, or - its parent node is not an element, then the foster parent - element is the element before the last table element in the - stack of open elements. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === 'table') { - $table = $this->stack[$n]; - break; - } - } - - if(isset($table) && $table->parentNode !== null) { - $this->foster_parent = $table->parentNode; - - } elseif(!isset($table)) { - $this->foster_parent = $this->stack[0]; - - } elseif(isset($table) && ($table->parentNode === null || - $table->parentNode->nodeType !== XML_ELEMENT_NODE)) { - $this->foster_parent = $this->stack[$n - 1]; - } - } - - $this->inBody($token); - } - } - - private function inCaption($token) { - /* An end tag whose tag name is "caption" */ - if($token['type'] === HTML5::ENDTAG && $token['name'] === 'caption') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore - - /* Otherwise: */ - } else { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Now, if the current node is not a caption element, then this - is a parse error. */ - // w/e - - /* Pop elements from this stack until a caption element has - been popped from the stack. */ - while(true) { - $node = end($this->stack)->nodeName; - array_pop($this->stack); - - if($node === 'caption') { - break; - } - } - - /* Clear the list of active formatting elements up to the last - marker. */ - $this->clearTheActiveFormattingElementsUpToTheLastMarker(); - - /* Switch the insertion mode to "in table". */ - $this->mode = self::IN_TABLE; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr", or an end tag whose tag - name is "table" */ - } elseif(($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) || ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'table')) { - /* Parse error. Act as if an end tag with the tag name "caption" - had been seen, then, if that token wasn't ignored, reprocess the - current token. */ - $this->inCaption(array( - 'name' => 'caption', - 'type' => HTML5::ENDTAG - )); - - return $this->inTable($token); - - /* An end tag whose tag name is one of: "body", "col", "colgroup", - "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'col', 'colgroup', 'html', 'tbody', 'tfoot', 'th', - 'thead', 'tr'))) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in body". */ - $this->inBody($token); - } - } - - private function inColumnGroup($token) { - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $text = $this->dom->createTextNode($token['data']); - end($this->stack)->appendChild($text); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - end($this->stack)->appendChild($comment); - - /* A start tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'col') { - /* Insert a col element for the token. Immediately pop the current - node off the stack of open elements. */ - $this->insertElement($token); - array_pop($this->stack); - - /* An end tag whose tag name is "colgroup" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'colgroup') { - /* If the current node is the root html element, then this is a - parse error, ignore the token. (innerHTML case) */ - if(end($this->stack)->nodeName === 'html') { - // Ignore - - /* Otherwise, pop the current node (which will be a colgroup - element) from the stack of open elements. Switch the insertion - mode to "in table". */ - } else { - array_pop($this->stack); - $this->mode = self::IN_TABLE; - } - - /* An end tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'col') { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Act as if an end tag with the tag name "colgroup" had been seen, - and then, if that token wasn't ignored, reprocess the current token. */ - $this->inColumnGroup(array( - 'name' => 'colgroup', - 'type' => HTML5::ENDTAG - )); - - return $this->inTable($token); - } - } - - private function inTableBody($token) { - $clear = array('tbody', 'tfoot', 'thead', 'html'); - - /* A start tag whose tag name is "tr" */ - if($token['type'] === HTML5::STARTTAG && $token['name'] === 'tr') { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Insert a tr element for the token, then switch the insertion - mode to "in row". */ - $this->insertElement($token); - $this->mode = self::IN_ROW; - - /* A start tag whose tag name is one of: "th", "td" */ - } elseif($token['type'] === HTML5::STARTTAG && - ($token['name'] === 'th' || $token['name'] === 'td')) { - /* Parse error. Act as if a start tag with the tag name "tr" had - been seen, then reprocess the current token. */ - $this->inTableBody(array( - 'name' => 'tr', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inRow($token); - - /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('tbody', 'tfoot', 'thead'))) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore - - /* Otherwise: */ - } else { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Pop the current node from the stack of open elements. Switch - the insertion mode to "in table". */ - array_pop($this->stack); - $this->mode = self::IN_TABLE; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "tfoot", "thead", or an end tag whose tag name is "table" */ - } elseif(($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'tfoor', 'thead'))) || - ($token['type'] === HTML5::STARTTAG && $token['name'] === 'table')) { - /* If the stack of open elements does not have a tbody, thead, or - tfoot element in table scope, this is a parse error. Ignore the - token. (innerHTML case) */ - if(!$this->elementInScope(array('tbody', 'thead', 'tfoot'), true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Act as if an end tag with the same tag name as the current - node ("tbody", "tfoot", or "thead") had been seen, then - reprocess the current token. */ - $this->inTableBody(array( - 'name' => end($this->stack)->nodeName, - 'type' => HTML5::ENDTAG - )); - - return $this->mainPhase($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "td", "th", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr'))) { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in table". */ - $this->inTable($token); - } - } - - private function inRow($token) { - $clear = array('tr', 'html'); - - /* A start tag whose tag name is one of: "th", "td" */ - if($token['type'] === HTML5::STARTTAG && - ($token['name'] === 'th' || $token['name'] === 'td')) { - /* Clear the stack back to a table row context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the insertion - mode to "in cell". */ - $this->insertElement($token); - $this->mode = self::IN_CELL; - - /* Insert a marker at the end of the list of active formatting - elements. */ - $this->a_formatting[] = self::MARKER; - - /* An end tag whose tag name is "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'tr') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Clear the stack back to a table row context. */ - $this->clearStackToTableContext($clear); - - /* Pop the current node (which will be a tr element) from the - stack of open elements. Switch the insertion mode to "in table - body". */ - array_pop($this->stack); - $this->mode = self::IN_TBODY; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "tfoot", "thead", "tr" or an end tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'tfoot', 'thead', 'tr'))) { - /* Act as if an end tag with the tag name "tr" had been seen, then, - if that token wasn't ignored, reprocess the current token. */ - $this->inRow(array( - 'name' => 'tr', - 'type' => HTML5::ENDTAG - )); - - return $this->inCell($token); - - /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('tbody', 'tfoot', 'thead'))) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Otherwise, act as if an end tag with the tag name "tr" had - been seen, then reprocess the current token. */ - $this->inRow(array( - 'name' => 'tr', - 'type' => HTML5::ENDTAG - )); - - return $this->inCell($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "td", "th" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr'))) { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in table". */ - $this->inTable($token); - } - } - - private function inCell($token) { - /* An end tag whose tag name is one of: "td", "th" */ - if($token['type'] === HTML5::ENDTAG && - ($token['name'] === 'td' || $token['name'] === 'th')) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as that of the token, then this is a - parse error and the token must be ignored. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Generate implied end tags, except for elements with the same - tag name as the token. */ - $this->generateImpliedEndTags(array($token['name'])); - - /* Now, if the current node is not an element with the same tag - name as the token, then this is a parse error. */ - // k - - /* Pop elements from this stack until an element with the same - tag name as the token has been popped from the stack. */ - while(true) { - $node = end($this->stack)->nodeName; - array_pop($this->stack); - - if($node === $token['name']) { - break; - } - } - - /* Clear the list of active formatting elements up to the last - marker. */ - $this->clearTheActiveFormattingElementsUpToTheLastMarker(); - - /* Switch the insertion mode to "in row". (The current node - will be a tr element at this point.) */ - $this->mode = self::IN_ROW; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) { - /* If the stack of open elements does not have a td or th element - in table scope, then this is a parse error; ignore the token. - (innerHTML case) */ - if(!$this->elementInScope(array('td', 'th'), true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) { - /* If the stack of open elements does not have a td or th element - in table scope, then this is a parse error; ignore the token. - (innerHTML case) */ - if(!$this->elementInScope(array('td', 'th'), true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html'))) { - /* Parse error. Ignore the token. */ - - /* An end tag whose tag name is one of: "table", "tbody", "tfoot", - "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('table', 'tbody', 'tfoot', 'thead', 'tr'))) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as that of the token (which can only - happen for "tbody", "tfoot" and "thead", or, in the innerHTML case), - then this is a parse error and the token must be ignored. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in body". */ - $this->inBody($token); - } - } - - private function inSelect($token) { - /* Handle the token as follows: */ - - /* A character token */ - if($token['type'] === HTML5::CHARACTR) { - /* Append the token's character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token whose tag name is "option" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'option') { - /* If the current node is an option element, act as if an end tag - with the tag name "option" had been seen. */ - if(end($this->stack)->nodeName === 'option') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* A start tag token whose tag name is "optgroup" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'optgroup') { - /* If the current node is an option element, act as if an end tag - with the tag name "option" had been seen. */ - if(end($this->stack)->nodeName === 'option') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); - } - - /* If the current node is an optgroup element, act as if an end tag - with the tag name "optgroup" had been seen. */ - if(end($this->stack)->nodeName === 'optgroup') { - $this->inSelect(array( - 'name' => 'optgroup', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* An end tag token whose tag name is "optgroup" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'optgroup') { - /* First, if the current node is an option element, and the node - immediately before it in the stack of open elements is an optgroup - element, then act as if an end tag with the tag name "option" had - been seen. */ - $elements_in_stack = count($this->stack); - - if($this->stack[$elements_in_stack - 1]->nodeName === 'option' && - $this->stack[$elements_in_stack - 2]->nodeName === 'optgroup') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); - } - - /* If the current node is an optgroup element, then pop that node - from the stack of open elements. Otherwise, this is a parse error, - ignore the token. */ - if($this->stack[$elements_in_stack - 1] === 'optgroup') { - array_pop($this->stack); - } - - /* An end tag token whose tag name is "option" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'option') { - /* If the current node is an option element, then pop that node - from the stack of open elements. Otherwise, this is a parse error, - ignore the token. */ - if(end($this->stack)->nodeName === 'option') { - array_pop($this->stack); - } - - /* An end tag whose tag name is "select" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'select') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - // w/e - - /* Otherwise: */ - } else { - /* Pop elements from the stack of open elements until a select - element has been popped from the stack. */ - while(true) { - $current = end($this->stack)->nodeName; - array_pop($this->stack); - - if($current === 'select') { - break; - } - } - - /* Reset the insertion mode appropriately. */ - $this->resetInsertionMode(); - } - - /* A start tag whose tag name is "select" */ - } elseif($token['name'] === 'select' && - $token['type'] === HTML5::STARTTAG) { - /* Parse error. Act as if the token had been an end tag with the - tag name "select" instead. */ - $this->inSelect(array( - 'name' => 'select', - 'type' => HTML5::ENDTAG - )); - - /* An end tag whose tag name is one of: "caption", "table", "tbody", - "tfoot", "thead", "tr", "td", "th" */ - } elseif(in_array($token['name'], array('caption', 'table', 'tbody', - 'tfoot', 'thead', 'tr', 'td', 'th')) && $token['type'] === HTML5::ENDTAG) { - /* Parse error. */ - // w/e - - /* If the stack of open elements has an element in table scope with - the same tag name as that of the token, then act as if an end tag - with the tag name "select" had been seen, and reprocess the token. - Otherwise, ignore the token. */ - if($this->elementInScope($token['name'], true)) { - $this->inSelect(array( - 'name' => 'select', - 'type' => HTML5::ENDTAG - )); - - $this->mainPhase($token); - } - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function afterBody($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Process the token as it would be processed if the insertion mode - was "in body". */ - $this->inBody($token); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the first element in the stack of open - elements (the html element), with the data attribute set to the - data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->stack[0]->appendChild($comment); - - /* An end tag with the tag name "html" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') { - /* If the parser was originally created in order to handle the - setting of an element's innerHTML attribute, this is a parse error; - ignore the token. (The element will be an html element in this - case.) (innerHTML case) */ - - /* Otherwise, switch to the trailing end phase. */ - $this->phase = self::END_PHASE; - - /* Anything else */ - } else { - /* Parse error. Set the insertion mode to "in body" and reprocess - the token. */ - $this->mode = self::IN_BODY; - return $this->inBody($token); - } - } - - private function inFrameset($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag with the tag name "frameset" */ - } elseif($token['name'] === 'frameset' && - $token['type'] === HTML5::STARTTAG) { - $this->insertElement($token); - - /* An end tag with the tag name "frameset" */ - } elseif($token['name'] === 'frameset' && - $token['type'] === HTML5::ENDTAG) { - /* If the current node is the root html element, then this is a - parse error; ignore the token. (innerHTML case) */ - if(end($this->stack)->nodeName === 'html') { - // Ignore - - } else { - /* Otherwise, pop the current node from the stack of open - elements. */ - array_pop($this->stack); - - /* If the parser was not originally created in order to handle - the setting of an element's innerHTML attribute (innerHTML case), - and the current node is no longer a frameset element, then change - the insertion mode to "after frameset". */ - $this->mode = self::AFTR_FRAME; - } - - /* A start tag with the tag name "frame" */ - } elseif($token['name'] === 'frame' && - $token['type'] === HTML5::STARTTAG) { - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - - /* A start tag with the tag name "noframes" */ - } elseif($token['name'] === 'noframes' && - $token['type'] === HTML5::STARTTAG) { - /* Process the token as if the insertion mode had been "in body". */ - $this->inBody($token); - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function afterFrameset($token) { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* An end tag with the tag name "html" */ - } elseif($token['name'] === 'html' && - $token['type'] === HTML5::ENDTAG) { - /* Switch to the trailing end phase. */ - $this->phase = self::END_PHASE; - - /* A start tag with the tag name "noframes" */ - } elseif($token['name'] === 'noframes' && - $token['type'] === HTML5::STARTTAG) { - /* Process the token as if the insertion mode had been "in body". */ - $this->inBody($token); - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function trailingEndPhase($token) { - /* After the main phase, as each token is emitted from the tokenisation - stage, it must be processed as described in this section. */ - - /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the Document object with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->dom->appendChild($comment); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Process the token as it would be processed in the main phase. */ - $this->mainPhase($token); - - /* A character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. Or a start tag token. Or an end tag token. */ - } elseif(($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || - $token['type'] === HTML5::STARTTAG || $token['type'] === HTML5::ENDTAG) { - /* Parse error. Switch back to the main phase and reprocess the - token. */ - $this->phase = self::MAIN_PHASE; - return $this->mainPhase($token); - - /* An end-of-file token */ - } elseif($token['type'] === HTML5::EOF) { - /* OMG DONE!! */ - } - } - - private function insertElement($token, $append = true, $check = false) { - // Proprietary workaround for libxml2's limitations with tag names - if ($check) { - // Slightly modified HTML5 tag-name modification, - // removing anything that's not an ASCII letter, digit, or hyphen - $token['name'] = preg_replace('/[^a-z0-9-]/i', '', $token['name']); - // Remove leading hyphens and numbers - $token['name'] = ltrim($token['name'], '-0..9'); - // In theory, this should ever be needed, but just in case - if ($token['name'] === '') $token['name'] = 'span'; // arbitrary generic choice - } - - $el = $this->dom->createElement($token['name']); - - foreach($token['attr'] as $attr) { - if(!$el->hasAttribute($attr['name'])) { - $el->setAttribute($attr['name'], $attr['value']); - } - } - - $this->appendToRealParent($el); - $this->stack[] = $el; - - return $el; - } - - private function insertText($data) { - $text = $this->dom->createTextNode($data); - $this->appendToRealParent($text); - } - - private function insertComment($data) { - $comment = $this->dom->createComment($data); - $this->appendToRealParent($comment); - } - - private function appendToRealParent($node) { - if($this->foster_parent === null) { - end($this->stack)->appendChild($node); - - } elseif($this->foster_parent !== null) { - /* If the foster parent element is the parent element of the - last table element in the stack of open elements, then the new - node must be inserted immediately before the last table element - in the stack of open elements in the foster parent element; - otherwise, the new node must be appended to the foster parent - element. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === 'table' && - $this->stack[$n]->parentNode !== null) { - $table = $this->stack[$n]; - break; - } - } - - if(isset($table) && $this->foster_parent->isSameNode($table->parentNode)) - $this->foster_parent->insertBefore($node, $table); - else - $this->foster_parent->appendChild($node); - - $this->foster_parent = null; - } - } - - private function elementInScope($el, $table = false) { - if(is_array($el)) { - foreach($el as $element) { - if($this->elementInScope($element, $table)) { - return true; - } - } - - return false; - } - - $leng = count($this->stack); - - for($n = 0; $n < $leng; $n++) { - /* 1. Initialise node to be the current node (the bottommost node of - the stack). */ - $node = $this->stack[$leng - 1 - $n]; - - if($node->tagName === $el) { - /* 2. If node is the target node, terminate in a match state. */ - return true; - - } elseif($node->tagName === 'table') { - /* 3. Otherwise, if node is a table element, terminate in a failure - state. */ - return false; - - } elseif($table === true && in_array($node->tagName, array('caption', 'td', - 'th', 'button', 'marquee', 'object'))) { - /* 4. Otherwise, if the algorithm is the "has an element in scope" - variant (rather than the "has an element in table scope" variant), - and node is one of the following, terminate in a failure state. */ - return false; - - } elseif($node === $node->ownerDocument->documentElement) { - /* 5. Otherwise, if node is an html element (root element), terminate - in a failure state. (This can only happen if the node is the topmost - node of the stack of open elements, and prevents the next step from - being invoked if there are no more elements in the stack.) */ - return false; - } - - /* Otherwise, set node to the previous entry in the stack of open - elements and return to step 2. (This will never fail, since the loop - will always terminate in the previous step if the top of the stack - is reached.) */ - } - } - - private function reconstructActiveFormattingElements() { - /* 1. If there are no entries in the list of active formatting elements, - then there is nothing to reconstruct; stop this algorithm. */ - $formatting_elements = count($this->a_formatting); - - if($formatting_elements === 0) { - return false; - } - - /* 3. Let entry be the last (most recently added) element in the list - of active formatting elements. */ - $entry = end($this->a_formatting); - - /* 2. If the last (most recently added) entry in the list of active - formatting elements is a marker, or if it is an element that is in the - stack of open elements, then there is nothing to reconstruct; stop this - algorithm. */ - if($entry === self::MARKER || in_array($entry, $this->stack, true)) { - return false; - } - - for($a = $formatting_elements - 1; $a >= 0; true) { - /* 4. If there are no entries before entry in the list of active - formatting elements, then jump to step 8. */ - if($a === 0) { - $step_seven = false; - break; - } - - /* 5. Let entry be the entry one earlier than entry in the list of - active formatting elements. */ - $a--; - $entry = $this->a_formatting[$a]; - - /* 6. If entry is neither a marker nor an element that is also in - thetack of open elements, go to step 4. */ - if($entry === self::MARKER || in_array($entry, $this->stack, true)) { - break; - } - } - - while(true) { - /* 7. Let entry be the element one later than entry in the list of - active formatting elements. */ - if(isset($step_seven) && $step_seven === true) { - $a++; - $entry = $this->a_formatting[$a]; - } - - /* 8. Perform a shallow clone of the element entry to obtain clone. */ - $clone = $entry->cloneNode(); - - /* 9. Append clone to the current node and push it onto the stack - of open elements so that it is the new current node. */ - end($this->stack)->appendChild($clone); - $this->stack[] = $clone; - - /* 10. Replace the entry for entry in the list with an entry for - clone. */ - $this->a_formatting[$a] = $clone; - - /* 11. If the entry for clone in the list of active formatting - elements is not the last entry in the list, return to step 7. */ - if(end($this->a_formatting) !== $clone) { - $step_seven = true; - } else { - break; - } - } - } - - private function clearTheActiveFormattingElementsUpToTheLastMarker() { - /* When the steps below require the UA to clear the list of active - formatting elements up to the last marker, the UA must perform the - following steps: */ - - while(true) { - /* 1. Let entry be the last (most recently added) entry in the list - of active formatting elements. */ - $entry = end($this->a_formatting); - - /* 2. Remove entry from the list of active formatting elements. */ - array_pop($this->a_formatting); - - /* 3. If entry was a marker, then stop the algorithm at this point. - The list has been cleared up to the last marker. */ - if($entry === self::MARKER) { - break; - } - } - } - - private function generateImpliedEndTags($exclude = array()) { - /* When the steps below require the UA to generate implied end tags, - then, if the current node is a dd element, a dt element, an li element, - a p element, a td element, a th element, or a tr element, the UA must - act as if an end tag with the respective tag name had been seen and - then generate implied end tags again. */ - $node = end($this->stack); - $elements = array_diff(array('dd', 'dt', 'li', 'p', 'td', 'th', 'tr'), $exclude); - - while(in_array(end($this->stack)->nodeName, $elements)) { - array_pop($this->stack); - } - } - - private function getElementCategory($node) { - $name = $node->tagName; - if(in_array($name, $this->special)) - return self::SPECIAL; - - elseif(in_array($name, $this->scoping)) - return self::SCOPING; - - elseif(in_array($name, $this->formatting)) - return self::FORMATTING; - - else - return self::PHRASING; - } - - private function clearStackToTableContext($elements) { - /* When the steps above require the UA to clear the stack back to a - table context, it means that the UA must, while the current node is not - a table element or an html element, pop elements from the stack of open - elements. If this causes any elements to be popped from the stack, then - this is a parse error. */ - while(true) { - $node = end($this->stack)->nodeName; - - if(in_array($node, $elements)) { - break; - } else { - array_pop($this->stack); - } - } - } - - private function resetInsertionMode() { - /* 1. Let last be false. */ - $last = false; - $leng = count($this->stack); - - for($n = $leng - 1; $n >= 0; $n--) { - /* 2. Let node be the last node in the stack of open elements. */ - $node = $this->stack[$n]; - - /* 3. If node is the first node in the stack of open elements, then - set last to true. If the element whose innerHTML attribute is being - set is neither a td element nor a th element, then set node to the - element whose innerHTML attribute is being set. (innerHTML case) */ - if($this->stack[0]->isSameNode($node)) { - $last = true; - } - - /* 4. If node is a select element, then switch the insertion mode to - "in select" and abort these steps. (innerHTML case) */ - if($node->nodeName === 'select') { - $this->mode = self::IN_SELECT; - break; - - /* 5. If node is a td or th element, then switch the insertion mode - to "in cell" and abort these steps. */ - } elseif($node->nodeName === 'td' || $node->nodeName === 'th') { - $this->mode = self::IN_CELL; - break; - - /* 6. If node is a tr element, then switch the insertion mode to - "in row" and abort these steps. */ - } elseif($node->nodeName === 'tr') { - $this->mode = self::IN_ROW; - break; - - /* 7. If node is a tbody, thead, or tfoot element, then switch the - insertion mode to "in table body" and abort these steps. */ - } elseif(in_array($node->nodeName, array('tbody', 'thead', 'tfoot'))) { - $this->mode = self::IN_TBODY; - break; - - /* 8. If node is a caption element, then switch the insertion mode - to "in caption" and abort these steps. */ - } elseif($node->nodeName === 'caption') { - $this->mode = self::IN_CAPTION; - break; - - /* 9. If node is a colgroup element, then switch the insertion mode - to "in column group" and abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'colgroup') { - $this->mode = self::IN_CGROUP; - break; - - /* 10. If node is a table element, then switch the insertion mode - to "in table" and abort these steps. */ - } elseif($node->nodeName === 'table') { - $this->mode = self::IN_TABLE; - break; - - /* 11. If node is a head element, then switch the insertion mode - to "in body" ("in body"! not "in head"!) and abort these steps. - (innerHTML case) */ - } elseif($node->nodeName === 'head') { - $this->mode = self::IN_BODY; - break; - - /* 12. If node is a body element, then switch the insertion mode to - "in body" and abort these steps. */ - } elseif($node->nodeName === 'body') { - $this->mode = self::IN_BODY; - break; - - /* 13. If node is a frameset element, then switch the insertion - mode to "in frameset" and abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'frameset') { - $this->mode = self::IN_FRAME; - break; - - /* 14. If node is an html element, then: if the head element - pointer is null, switch the insertion mode to "before head", - otherwise, switch the insertion mode to "after head". In either - case, abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'html') { - $this->mode = ($this->head_pointer === null) - ? self::BEFOR_HEAD - : self::AFTER_HEAD; - - break; - - /* 15. If last is true, then set the insertion mode to "in body" - and abort these steps. (innerHTML case) */ - } elseif($last) { - $this->mode = self::IN_BODY; - break; - } - } - } - - private function closeCell() { - /* If the stack of open elements has a td or th element in table scope, - then act as if an end tag token with that tag name had been seen. */ - foreach(array('td', 'th') as $cell) { - if($this->elementInScope($cell, true)) { - $this->inCell(array( - 'name' => $cell, - 'type' => HTML5::ENDTAG - )); - - break; - } - } - } - - public function save() { - return $this->dom; - } -} -?> diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/PercentEncoder.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/PercentEncoder.php deleted file mode 100644 index a8ad230d..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/PercentEncoder.php +++ /dev/null @@ -1,98 +0,0 @@ -preserve[$i] = true; // digits - for ($i = 65; $i <= 90; $i++) $this->preserve[$i] = true; // upper-case - for ($i = 97; $i <= 122; $i++) $this->preserve[$i] = true; // lower-case - $this->preserve[45] = true; // Dash - - $this->preserve[46] = true; // Period . - $this->preserve[95] = true; // Underscore _ - $this->preserve[126]= true; // Tilde ~ - - // extra letters not to escape - if ($preserve !== false) { - for ($i = 0, $c = strlen($preserve); $i < $c; $i++) { - $this->preserve[ord($preserve[$i])] = true; - } - } - } - - /** - * Our replacement for urlencode, it encodes all non-reserved characters, - * as well as any extra characters that were instructed to be preserved. - * @note - * Assumes that the string has already been normalized, making any - * and all percent escape sequences valid. Percents will not be - * re-escaped, regardless of their status in $preserve - * @param $string String to be encoded - * @return Encoded string. - */ - public function encode($string) { - $ret = ''; - for ($i = 0, $c = strlen($string); $i < $c; $i++) { - if ($string[$i] !== '%' && !isset($this->preserve[$int = ord($string[$i])]) ) { - $ret .= '%' . sprintf('%02X', $int); - } else { - $ret .= $string[$i]; - } - } - return $ret; - } - - /** - * Fix up percent-encoding by decoding unreserved characters and normalizing. - * @warning This function is affected by $preserve, even though the - * usual desired behavior is for this not to preserve those - * characters. Be careful when reusing instances of PercentEncoder! - * @param $string String to normalize - */ - public function normalize($string) { - if ($string == '') return ''; - $parts = explode('%', $string); - $ret = array_shift($parts); - foreach ($parts as $part) { - $length = strlen($part); - if ($length < 2) { - $ret .= '%25' . $part; - continue; - } - $encoding = substr($part, 0, 2); - $text = substr($part, 2); - if (!ctype_xdigit($encoding)) { - $ret .= '%25' . $part; - continue; - } - $int = hexdec($encoding); - if (isset($this->preserve[$int])) { - $ret .= chr($int) . $text; - continue; - } - $encoding = strtoupper($encoding); - $ret .= '%' . $encoding . $text; - } - return $ret; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer.php deleted file mode 100644 index a0d4a0fd..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer.php +++ /dev/null @@ -1,176 +0,0 @@ -getAll(); - $context = new HTMLPurifier_Context(); - $this->generator = new HTMLPurifier_Generator($config, $context); - } - - /** - * Main function that renders object or aspect of that object - * @note Parameters vary depending on printer - */ - // function render() {} - - /** - * Returns a start tag - * @param $tag Tag name - * @param $attr Attribute array - */ - protected function start($tag, $attr = array()) { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_Start($tag, $attr ? $attr : array()) - ); - } - - /** - * Returns an end teg - * @param $tag Tag name - */ - protected function end($tag) { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_End($tag) - ); - } - - /** - * Prints a complete element with content inside - * @param $tag Tag name - * @param $contents Element contents - * @param $attr Tag attributes - * @param $escape Bool whether or not to escape contents - */ - protected function element($tag, $contents, $attr = array(), $escape = true) { - return $this->start($tag, $attr) . - ($escape ? $this->escape($contents) : $contents) . - $this->end($tag); - } - - protected function elementEmpty($tag, $attr = array()) { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_Empty($tag, $attr) - ); - } - - protected function text($text) { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_Text($text) - ); - } - - /** - * Prints a simple key/value row in a table. - * @param $name Key - * @param $value Value - */ - protected function row($name, $value) { - if (is_bool($value)) $value = $value ? 'On' : 'Off'; - return - $this->start('tr') . "\n" . - $this->element('th', $name) . "\n" . - $this->element('td', $value) . "\n" . - $this->end('tr') - ; - } - - /** - * Escapes a string for HTML output. - * @param $string String to escape - */ - protected function escape($string) { - $string = HTMLPurifier_Encoder::cleanUTF8($string); - $string = htmlspecialchars($string, ENT_COMPAT, 'UTF-8'); - return $string; - } - - /** - * Takes a list of strings and turns them into a single list - * @param $array List of strings - * @param $polite Bool whether or not to add an end before the last - */ - protected function listify($array, $polite = false) { - if (empty($array)) return 'None'; - $ret = ''; - $i = count($array); - foreach ($array as $value) { - $i--; - $ret .= $value; - if ($i > 0 && !($polite && $i == 1)) $ret .= ', '; - if ($polite && $i == 1) $ret .= 'and '; - } - return $ret; - } - - /** - * Retrieves the class of an object without prefixes, as well as metadata - * @param $obj Object to determine class of - * @param $prefix Further prefix to remove - */ - protected function getClass($obj, $sec_prefix = '') { - static $five = null; - if ($five === null) $five = version_compare(PHP_VERSION, '5', '>='); - $prefix = 'HTMLPurifier_' . $sec_prefix; - if (!$five) $prefix = strtolower($prefix); - $class = str_replace($prefix, '', get_class($obj)); - $lclass = strtolower($class); - $class .= '('; - switch ($lclass) { - case 'enum': - $values = array(); - foreach ($obj->valid_values as $value => $bool) { - $values[] = $value; - } - $class .= implode(', ', $values); - break; - case 'css_composite': - $values = array(); - foreach ($obj->defs as $def) { - $values[] = $this->getClass($def, $sec_prefix); - } - $class .= implode(', ', $values); - break; - case 'css_multiple': - $class .= $this->getClass($obj->single, $sec_prefix) . ', '; - $class .= $obj->max; - break; - case 'css_denyelementdecorator': - $class .= $this->getClass($obj->def, $sec_prefix) . ', '; - $class .= $obj->element; - break; - case 'css_importantdecorator': - $class .= $this->getClass($obj->def, $sec_prefix); - if ($obj->allow) $class .= ', !important'; - break; - } - $class .= ')'; - return $class; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/CSSDefinition.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/CSSDefinition.php deleted file mode 100644 index 0be17df7..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/CSSDefinition.php +++ /dev/null @@ -1,38 +0,0 @@ -def = $config->getCSSDefinition(); - $ret = ''; - - $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); - $ret .= $this->start('table'); - - $ret .= $this->element('caption', 'Properties ($info)'); - - $ret .= $this->start('thead'); - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Property', array('class' => 'heavy')); - $ret .= $this->element('th', 'Definition', array('class' => 'heavy', 'style' => 'width:auto;')); - $ret .= $this->end('tr'); - $ret .= $this->end('thead'); - - ksort($this->def->info); - foreach ($this->def->info as $property => $obj) { - $name = $this->getClass($obj, 'AttrDef_'); - $ret .= $this->row($property, $name); - } - - $ret .= $this->end('table'); - $ret .= $this->end('div'); - - return $ret; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/ConfigForm.css b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/ConfigForm.css deleted file mode 100644 index 3ff1a88a..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/ConfigForm.css +++ /dev/null @@ -1,10 +0,0 @@ - -.hp-config {} - -.hp-config tbody th {text-align:right; padding-right:0.5em;} -.hp-config thead, .hp-config .namespace {background:#3C578C; color:#FFF;} -.hp-config .namespace th {text-align:center;} -.hp-config .verbose {display:none;} -.hp-config .controls {text-align:center;} - -/* vim: et sw=4 sts=4 */ diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/ConfigForm.js b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/ConfigForm.js deleted file mode 100644 index cba00c9b..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/ConfigForm.js +++ /dev/null @@ -1,5 +0,0 @@ -function toggleWriteability(id_of_patient, checked) { - document.getElementById(id_of_patient).disabled = checked; -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/ConfigForm.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/ConfigForm.php deleted file mode 100644 index 4d391992..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/ConfigForm.php +++ /dev/null @@ -1,368 +0,0 @@ -docURL = $doc_url; - $this->name = $name; - $this->compress = $compress; - // initialize sub-printers - $this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default(); - $this->fields[HTMLPurifier_VarParser::BOOL] = new HTMLPurifier_Printer_ConfigForm_bool(); - } - - /** - * Sets default column and row size for textareas in sub-printers - * @param $cols Integer columns of textarea, null to use default - * @param $rows Integer rows of textarea, null to use default - */ - public function setTextareaDimensions($cols = null, $rows = null) { - if ($cols) $this->fields['default']->cols = $cols; - if ($rows) $this->fields['default']->rows = $rows; - } - - /** - * Retrieves styling, in case it is not accessible by webserver - */ - public static function getCSS() { - return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css'); - } - - /** - * Retrieves JavaScript, in case it is not accessible by webserver - */ - public static function getJavaScript() { - return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js'); - } - - /** - * Returns HTML output for a configuration form - * @param $config Configuration object of current form state, or an array - * where [0] has an HTML namespace and [1] is being rendered. - * @param $allowed Optional namespace(s) and directives to restrict form to. - */ - public function render($config, $allowed = true, $render_controls = true) { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - - $this->config = $config; - $this->genConfig = $gen_config; - $this->prepareGenerator($gen_config); - - $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def); - $all = array(); - foreach ($allowed as $key) { - list($ns, $directive) = $key; - $all[$ns][$directive] = $config->get($ns .'.'. $directive); - } - - $ret = ''; - $ret .= $this->start('table', array('class' => 'hp-config')); - $ret .= $this->start('thead'); - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Directive', array('class' => 'hp-directive')); - $ret .= $this->element('th', 'Value', array('class' => 'hp-value')); - $ret .= $this->end('tr'); - $ret .= $this->end('thead'); - foreach ($all as $ns => $directives) { - $ret .= $this->renderNamespace($ns, $directives); - } - if ($render_controls) { - $ret .= $this->start('tbody'); - $ret .= $this->start('tr'); - $ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls')); - $ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit')); - $ret .= '[Reset]'; - $ret .= $this->end('td'); - $ret .= $this->end('tr'); - $ret .= $this->end('tbody'); - } - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders a single namespace - * @param $ns String namespace name - * @param $directive Associative array of directives to values - */ - protected function renderNamespace($ns, $directives) { - $ret = ''; - $ret .= $this->start('tbody', array('class' => 'namespace')); - $ret .= $this->start('tr'); - $ret .= $this->element('th', $ns, array('colspan' => 2)); - $ret .= $this->end('tr'); - $ret .= $this->end('tbody'); - $ret .= $this->start('tbody'); - foreach ($directives as $directive => $value) { - $ret .= $this->start('tr'); - $ret .= $this->start('th'); - if ($this->docURL) { - $url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL); - $ret .= $this->start('a', array('href' => $url)); - } - $attr = array('for' => "{$this->name}:$ns.$directive"); - - // crop directive name if it's too long - if (!$this->compress || (strlen($directive) < $this->compress)) { - $directive_disp = $directive; - } else { - $directive_disp = substr($directive, 0, $this->compress - 2) . '...'; - $attr['title'] = $directive; - } - - $ret .= $this->element( - 'label', - $directive_disp, - // component printers must create an element with this id - $attr - ); - if ($this->docURL) $ret .= $this->end('a'); - $ret .= $this->end('th'); - - $ret .= $this->start('td'); - $def = $this->config->def->info["$ns.$directive"]; - if (is_int($def)) { - $allow_null = $def < 0; - $type = abs($def); - } else { - $type = $def->type; - $allow_null = isset($def->allow_null); - } - if (!isset($this->fields[$type])) $type = 0; // default - $type_obj = $this->fields[$type]; - if ($allow_null) { - $type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj); - } - $ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config)); - $ret .= $this->end('td'); - $ret .= $this->end('tr'); - } - $ret .= $this->end('tbody'); - return $ret; - } - -} - -/** - * Printer decorator for directives that accept null - */ -class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer { - /** - * Printer being decorated - */ - protected $obj; - /** - * @param $obj Printer to decorate - */ - public function __construct($obj) { - parent::__construct(); - $this->obj = $obj; - } - public function render($ns, $directive, $value, $name, $config) { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - $this->prepareGenerator($gen_config); - - $ret = ''; - $ret .= $this->start('label', array('for' => "$name:Null_$ns.$directive")); - $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); - $ret .= $this->text(' Null/Disabled'); - $ret .= $this->end('label'); - $attr = array( - 'type' => 'checkbox', - 'value' => '1', - 'class' => 'null-toggle', - 'name' => "$name"."[Null_$ns.$directive]", - 'id' => "$name:Null_$ns.$directive", - 'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!! - ); - if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) { - // modify inline javascript slightly - $attr['onclick'] = "toggleWriteability('$name:Yes_$ns.$directive',checked);toggleWriteability('$name:No_$ns.$directive',checked)"; - } - if ($value === null) $attr['checked'] = 'checked'; - $ret .= $this->elementEmpty('input', $attr); - $ret .= $this->text(' or '); - $ret .= $this->elementEmpty('br'); - $ret .= $this->obj->render($ns, $directive, $value, $name, array($gen_config, $config)); - return $ret; - } -} - -/** - * Swiss-army knife configuration form field printer - */ -class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer { - public $cols = 18; - public $rows = 5; - public function render($ns, $directive, $value, $name, $config) { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - $this->prepareGenerator($gen_config); - // this should probably be split up a little - $ret = ''; - $def = $config->def->info["$ns.$directive"]; - if (is_int($def)) { - $type = abs($def); - } else { - $type = $def->type; - } - if (is_array($value)) { - switch ($type) { - case HTMLPurifier_VarParser::LOOKUP: - $array = $value; - $value = array(); - foreach ($array as $val => $b) { - $value[] = $val; - } - case HTMLPurifier_VarParser::ALIST: - $value = implode(PHP_EOL, $value); - break; - case HTMLPurifier_VarParser::HASH: - $nvalue = ''; - foreach ($value as $i => $v) { - $nvalue .= "$i:$v" . PHP_EOL; - } - $value = $nvalue; - break; - default: - $value = ''; - } - } - if ($type === HTMLPurifier_VarParser::MIXED) { - return 'Not supported'; - $value = serialize($value); - } - $attr = array( - 'name' => "$name"."[$ns.$directive]", - 'id' => "$name:$ns.$directive" - ); - if ($value === null) $attr['disabled'] = 'disabled'; - if (isset($def->allowed)) { - $ret .= $this->start('select', $attr); - foreach ($def->allowed as $val => $b) { - $attr = array(); - if ($value == $val) $attr['selected'] = 'selected'; - $ret .= $this->element('option', $val, $attr); - } - $ret .= $this->end('select'); - } elseif ( - $type === HTMLPurifier_VarParser::TEXT || - $type === HTMLPurifier_VarParser::ITEXT || - $type === HTMLPurifier_VarParser::ALIST || - $type === HTMLPurifier_VarParser::HASH || - $type === HTMLPurifier_VarParser::LOOKUP - ) { - $attr['cols'] = $this->cols; - $attr['rows'] = $this->rows; - $ret .= $this->start('textarea', $attr); - $ret .= $this->text($value); - $ret .= $this->end('textarea'); - } else { - $attr['value'] = $value; - $attr['type'] = 'text'; - $ret .= $this->elementEmpty('input', $attr); - } - return $ret; - } -} - -/** - * Bool form field printer - */ -class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer { - public function render($ns, $directive, $value, $name, $config) { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - $this->prepareGenerator($gen_config); - $ret = ''; - $ret .= $this->start('div', array('id' => "$name:$ns.$directive")); - - $ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive")); - $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); - $ret .= $this->text(' Yes'); - $ret .= $this->end('label'); - - $attr = array( - 'type' => 'radio', - 'name' => "$name"."[$ns.$directive]", - 'id' => "$name:Yes_$ns.$directive", - 'value' => '1' - ); - if ($value === true) $attr['checked'] = 'checked'; - if ($value === null) $attr['disabled'] = 'disabled'; - $ret .= $this->elementEmpty('input', $attr); - - $ret .= $this->start('label', array('for' => "$name:No_$ns.$directive")); - $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); - $ret .= $this->text(' No'); - $ret .= $this->end('label'); - - $attr = array( - 'type' => 'radio', - 'name' => "$name"."[$ns.$directive]", - 'id' => "$name:No_$ns.$directive", - 'value' => '0' - ); - if ($value === false) $attr['checked'] = 'checked'; - if ($value === null) $attr['disabled'] = 'disabled'; - $ret .= $this->elementEmpty('input', $attr); - - $ret .= $this->end('div'); - - return $ret; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/HTMLDefinition.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/HTMLDefinition.php deleted file mode 100644 index 556caf57..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Printer/HTMLDefinition.php +++ /dev/null @@ -1,272 +0,0 @@ -config =& $config; - - $this->def = $config->getHTMLDefinition(); - - $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); - - $ret .= $this->renderDoctype(); - $ret .= $this->renderEnvironment(); - $ret .= $this->renderContentSets(); - $ret .= $this->renderInfo(); - - $ret .= $this->end('div'); - - return $ret; - } - - /** - * Renders the Doctype table - */ - protected function renderDoctype() { - $doctype = $this->def->doctype; - $ret = ''; - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Doctype'); - $ret .= $this->row('Name', $doctype->name); - $ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No'); - $ret .= $this->row('Default Modules', implode($doctype->modules, ', ')); - $ret .= $this->row('Default Tidy Modules', implode($doctype->tidyModules, ', ')); - $ret .= $this->end('table'); - return $ret; - } - - - /** - * Renders environment table, which is miscellaneous info - */ - protected function renderEnvironment() { - $def = $this->def; - - $ret = ''; - - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Environment'); - - $ret .= $this->row('Parent of fragment', $def->info_parent); - $ret .= $this->renderChildren($def->info_parent_def->child); - $ret .= $this->row('Block wrap name', $def->info_block_wrapper); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Global attributes'); - $ret .= $this->element('td', $this->listifyAttr($def->info_global_attr),0,0); - $ret .= $this->end('tr'); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Tag transforms'); - $list = array(); - foreach ($def->info_tag_transform as $old => $new) { - $new = $this->getClass($new, 'TagTransform_'); - $list[] = "<$old> with $new"; - } - $ret .= $this->element('td', $this->listify($list)); - $ret .= $this->end('tr'); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Pre-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre)); - $ret .= $this->end('tr'); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Post-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post)); - $ret .= $this->end('tr'); - - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders the Content Sets table - */ - protected function renderContentSets() { - $ret = ''; - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Content Sets'); - foreach ($this->def->info_content_sets as $name => $lookup) { - $ret .= $this->heavyHeader($name); - $ret .= $this->start('tr'); - $ret .= $this->element('td', $this->listifyTagLookup($lookup)); - $ret .= $this->end('tr'); - } - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders the Elements ($info) table - */ - protected function renderInfo() { - $ret = ''; - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Elements ($info)'); - ksort($this->def->info); - $ret .= $this->heavyHeader('Allowed tags', 2); - $ret .= $this->start('tr'); - $ret .= $this->element('td', $this->listifyTagLookup($this->def->info), array('colspan' => 2)); - $ret .= $this->end('tr'); - foreach ($this->def->info as $name => $def) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', "<$name>", array('class'=>'heavy', 'colspan' => 2)); - $ret .= $this->end('tr'); - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Inline content'); - $ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No'); - $ret .= $this->end('tr'); - if (!empty($def->excludes)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Excludes'); - $ret .= $this->element('td', $this->listifyTagLookup($def->excludes)); - $ret .= $this->end('tr'); - } - if (!empty($def->attr_transform_pre)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Pre-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_pre)); - $ret .= $this->end('tr'); - } - if (!empty($def->attr_transform_post)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Post-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_post)); - $ret .= $this->end('tr'); - } - if (!empty($def->auto_close)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Auto closed by'); - $ret .= $this->element('td', $this->listifyTagLookup($def->auto_close)); - $ret .= $this->end('tr'); - } - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Allowed attributes'); - $ret .= $this->element('td',$this->listifyAttr($def->attr), array(), 0); - $ret .= $this->end('tr'); - - if (!empty($def->required_attr)) { - $ret .= $this->row('Required attributes', $this->listify($def->required_attr)); - } - - $ret .= $this->renderChildren($def->child); - } - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders a row describing the allowed children of an element - * @param $def HTMLPurifier_ChildDef of pertinent element - */ - protected function renderChildren($def) { - $context = new HTMLPurifier_Context(); - $ret = ''; - $ret .= $this->start('tr'); - $elements = array(); - $attr = array(); - if (isset($def->elements)) { - if ($def->type == 'strictblockquote') { - $def->validateChildren(array(), $this->config, $context); - } - $elements = $def->elements; - } - if ($def->type == 'chameleon') { - $attr['rowspan'] = 2; - } elseif ($def->type == 'empty') { - $elements = array(); - } elseif ($def->type == 'table') { - $elements = array_flip(array('col', 'caption', 'colgroup', 'thead', - 'tfoot', 'tbody', 'tr')); - } - $ret .= $this->element('th', 'Allowed children', $attr); - - if ($def->type == 'chameleon') { - - $ret .= $this->element('td', - 'Block: ' . - $this->escape($this->listifyTagLookup($def->block->elements)),0,0); - $ret .= $this->end('tr'); - $ret .= $this->start('tr'); - $ret .= $this->element('td', - 'Inline: ' . - $this->escape($this->listifyTagLookup($def->inline->elements)),0,0); - - } elseif ($def->type == 'custom') { - - $ret .= $this->element('td', ''.ucfirst($def->type).': ' . - $def->dtd_regex); - - } else { - $ret .= $this->element('td', - ''.ucfirst($def->type).': ' . - $this->escape($this->listifyTagLookup($elements)),0,0); - } - $ret .= $this->end('tr'); - return $ret; - } - - /** - * Listifies a tag lookup table. - * @param $array Tag lookup array in form of array('tagname' => true) - */ - protected function listifyTagLookup($array) { - ksort($array); - $list = array(); - foreach ($array as $name => $discard) { - if ($name !== '#PCDATA' && !isset($this->def->info[$name])) continue; - $list[] = $name; - } - return $this->listify($list); - } - - /** - * Listifies a list of objects by retrieving class names and internal state - * @param $array List of objects - * @todo Also add information about internal state - */ - protected function listifyObjectList($array) { - ksort($array); - $list = array(); - foreach ($array as $discard => $obj) { - $list[] = $this->getClass($obj, 'AttrTransform_'); - } - return $this->listify($list); - } - - /** - * Listifies a hash of attributes to AttrDef classes - * @param $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef) - */ - protected function listifyAttr($array) { - ksort($array); - $list = array(); - foreach ($array as $name => $obj) { - if ($obj === false) continue; - $list[] = "$name = " . $this->getClass($obj, 'AttrDef_') . ''; - } - return $this->listify($list); - } - - /** - * Creates a heavy header row - */ - protected function heavyHeader($text, $num = 1) { - $ret = ''; - $ret .= $this->start('tr'); - $ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy')); - $ret .= $this->end('tr'); - return $ret; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/PropertyList.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/PropertyList.php deleted file mode 100644 index f3e2947c..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/PropertyList.php +++ /dev/null @@ -1,86 +0,0 @@ -parent = $parent; - } - - /** - * Recursively retrieves the value for a key - */ - public function get($name) { - if ($this->has($name)) return $this->data[$name]; - // possible performance bottleneck, convert to iterative if necessary - if ($this->parent) return $this->parent->get($name); - throw new HTMLPurifier_Exception("Key '$name' not found"); - } - - /** - * Sets the value of a key, for this plist - */ - public function set($name, $value) { - $this->data[$name] = $value; - } - - /** - * Returns true if a given key exists - */ - public function has($name) { - return array_key_exists($name, $this->data); - } - - /** - * Resets a value to the value of it's parent, usually the default. If - * no value is specified, the entire plist is reset. - */ - public function reset($name = null) { - if ($name == null) $this->data = array(); - else unset($this->data[$name]); - } - - /** - * Squashes this property list and all of its property lists into a single - * array, and returns the array. This value is cached by default. - * @param $force If true, ignores the cache and regenerates the array. - */ - public function squash($force = false) { - if ($this->cache !== null && !$force) return $this->cache; - if ($this->parent) { - return $this->cache = array_merge($this->parent->squash($force), $this->data); - } else { - return $this->cache = $this->data; - } - } - - /** - * Returns the parent plist. - */ - public function getParent() { - return $this->parent; - } - - /** - * Sets the parent plist. - */ - public function setParent($plist) { - $this->parent = $plist; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/PropertyListIterator.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/PropertyListIterator.php deleted file mode 100644 index 7fa2088e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/PropertyListIterator.php +++ /dev/null @@ -1,32 +0,0 @@ -l = strlen($filter); - $this->filter = $filter; - } - - public function accept() { - $key = $this->getInnerIterator()->key(); - if( strncmp($key, $this->filter, $this->l) !== 0 ) { - return false; - } - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy.php deleted file mode 100644 index e975e2c8..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy.php +++ /dev/null @@ -1,26 +0,0 @@ -strategies as $strategy) { - $tokens = $strategy->execute($tokens, $config, $context); - } - return $tokens; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/Core.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/Core.php deleted file mode 100644 index c7d3c79c..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/Core.php +++ /dev/null @@ -1,18 +0,0 @@ -strategies[] = new HTMLPurifier_Strategy_RemoveForeignElements(); - $this->strategies[] = new HTMLPurifier_Strategy_MakeWellFormed(); - $this->strategies[] = new HTMLPurifier_Strategy_FixNesting(); - $this->strategies[] = new HTMLPurifier_Strategy_ValidateAttributes(); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/FixNesting.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/FixNesting.php deleted file mode 100644 index dc4ef88b..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/FixNesting.php +++ /dev/null @@ -1,328 +0,0 @@ -getHTMLDefinition(); - - // insert implicit "parent" node, will be removed at end. - // DEFINITION CALL - $parent_name = $definition->info_parent; - array_unshift($tokens, new HTMLPurifier_Token_Start($parent_name)); - $tokens[] = new HTMLPurifier_Token_End($parent_name); - - // setup the context variable 'IsInline', for chameleon processing - // is 'false' when we are not inline, 'true' when it must always - // be inline, and an integer when it is inline for a certain - // branch of the document tree - $is_inline = $definition->info_parent_def->descendants_are_inline; - $context->register('IsInline', $is_inline); - - // setup error collector - $e =& $context->get('ErrorCollector', true); - - //####################################################################// - // Loop initialization - - // stack that contains the indexes of all parents, - // $stack[count($stack)-1] being the current parent - $stack = array(); - - // stack that contains all elements that are excluded - // it is organized by parent elements, similar to $stack, - // but it is only populated when an element with exclusions is - // processed, i.e. there won't be empty exclusions. - $exclude_stack = array(); - - // variable that contains the start token while we are processing - // nodes. This enables error reporting to do its job - $start_token = false; - $context->register('CurrentToken', $start_token); - - //####################################################################// - // Loop - - // iterate through all start nodes. Determining the start node - // is complicated so it has been omitted from the loop construct - for ($i = 0, $size = count($tokens) ; $i < $size; ) { - - //################################################################// - // Gather information on children - - // child token accumulator - $child_tokens = array(); - - // scroll to the end of this node, report number, and collect - // all children - for ($j = $i, $depth = 0; ; $j++) { - if ($tokens[$j] instanceof HTMLPurifier_Token_Start) { - $depth++; - // skip token assignment on first iteration, this is the - // token we currently are on - if ($depth == 1) continue; - } elseif ($tokens[$j] instanceof HTMLPurifier_Token_End) { - $depth--; - // skip token assignment on last iteration, this is the - // end token of the token we're currently on - if ($depth == 0) break; - } - $child_tokens[] = $tokens[$j]; - } - - // $i is index of start token - // $j is index of end token - - $start_token = $tokens[$i]; // to make token available via CurrentToken - - //################################################################// - // Gather information on parent - - // calculate parent information - if ($count = count($stack)) { - $parent_index = $stack[$count-1]; - $parent_name = $tokens[$parent_index]->name; - if ($parent_index == 0) { - $parent_def = $definition->info_parent_def; - } else { - $parent_def = $definition->info[$parent_name]; - } - } else { - // processing as if the parent were the "root" node - // unknown info, it won't be used anyway, in the future, - // we may want to enforce one element only (this is - // necessary for HTML Purifier to clean entire documents - $parent_index = $parent_name = $parent_def = null; - } - - // calculate context - if ($is_inline === false) { - // check if conditions make it inline - if (!empty($parent_def) && $parent_def->descendants_are_inline) { - $is_inline = $count - 1; - } - } else { - // check if we're out of inline - if ($count === $is_inline) { - $is_inline = false; - } - } - - //################################################################// - // Determine whether element is explicitly excluded SGML-style - - // determine whether or not element is excluded by checking all - // parent exclusions. The array should not be very large, two - // elements at most. - $excluded = false; - if (!empty($exclude_stack)) { - foreach ($exclude_stack as $lookup) { - if (isset($lookup[$tokens[$i]->name])) { - $excluded = true; - // no need to continue processing - break; - } - } - } - - //################################################################// - // Perform child validation - - if ($excluded) { - // there is an exclusion, remove the entire node - $result = false; - $excludes = array(); // not used, but good to initialize anyway - } else { - // DEFINITION CALL - if ($i === 0) { - // special processing for the first node - $def = $definition->info_parent_def; - } else { - $def = $definition->info[$tokens[$i]->name]; - - } - - if (!empty($def->child)) { - // have DTD child def validate children - $result = $def->child->validateChildren( - $child_tokens, $config, $context); - } else { - // weird, no child definition, get rid of everything - $result = false; - } - - // determine whether or not this element has any exclusions - $excludes = $def->excludes; - } - - // $result is now a bool or array - - //################################################################// - // Process result by interpreting $result - - if ($result === true || $child_tokens === $result) { - // leave the node as is - - // register start token as a parental node start - $stack[] = $i; - - // register exclusions if there are any - if (!empty($excludes)) $exclude_stack[] = $excludes; - - // move cursor to next possible start node - $i++; - - } elseif($result === false) { - // remove entire node - - if ($e) { - if ($excluded) { - $e->send(E_ERROR, 'Strategy_FixNesting: Node excluded'); - } else { - $e->send(E_ERROR, 'Strategy_FixNesting: Node removed'); - } - } - - // calculate length of inner tokens and current tokens - $length = $j - $i + 1; - - // perform removal - array_splice($tokens, $i, $length); - - // update size - $size -= $length; - - // there is no start token to register, - // current node is now the next possible start node - // unless it turns out that we need to do a double-check - - // this is a rought heuristic that covers 100% of HTML's - // cases and 99% of all other cases. A child definition - // that would be tricked by this would be something like: - // ( | a b c) where it's all or nothing. Fortunately, - // our current implementation claims that that case would - // not allow empty, even if it did - if (!$parent_def->child->allow_empty) { - // we need to do a double-check - $i = $parent_index; - array_pop($stack); - } - - // PROJECTED OPTIMIZATION: Process all children elements before - // reprocessing parent node. - - } else { - // replace node with $result - - // calculate length of inner tokens - $length = $j - $i - 1; - - if ($e) { - if (empty($result) && $length) { - $e->send(E_ERROR, 'Strategy_FixNesting: Node contents removed'); - } else { - $e->send(E_WARNING, 'Strategy_FixNesting: Node reorganized'); - } - } - - // perform replacement - array_splice($tokens, $i + 1, $length, $result); - - // update size - $size -= $length; - $size += count($result); - - // register start token as a parental node start - $stack[] = $i; - - // register exclusions if there are any - if (!empty($excludes)) $exclude_stack[] = $excludes; - - // move cursor to next possible start node - $i++; - - } - - //################################################################// - // Scroll to next start node - - // We assume, at this point, that $i is the index of the token - // that is the first possible new start point for a node. - - // Test if the token indeed is a start tag, if not, move forward - // and test again. - $size = count($tokens); - while ($i < $size and !$tokens[$i] instanceof HTMLPurifier_Token_Start) { - if ($tokens[$i] instanceof HTMLPurifier_Token_End) { - // pop a token index off the stack if we ended a node - array_pop($stack); - // pop an exclusion lookup off exclusion stack if - // we ended node and that node had exclusions - if ($i == 0 || $i == $size - 1) { - // use specialized var if it's the super-parent - $s_excludes = $definition->info_parent_def->excludes; - } else { - $s_excludes = $definition->info[$tokens[$i]->name]->excludes; - } - if ($s_excludes) { - array_pop($exclude_stack); - } - } - $i++; - } - - } - - //####################################################################// - // Post-processing - - // remove implicit parent tokens at the beginning and end - array_shift($tokens); - array_pop($tokens); - - // remove context variables - $context->destroy('IsInline'); - $context->destroy('CurrentToken'); - - //####################################################################// - // Return - - return $tokens; - - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/MakeWellFormed.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/MakeWellFormed.php deleted file mode 100644 index 03c92bd4..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/MakeWellFormed.php +++ /dev/null @@ -1,475 +0,0 @@ -getHTMLDefinition(); - - // local variables - $generator = new HTMLPurifier_Generator($config, $context); - $escape_invalid_tags = $config->get('Core.EscapeInvalidTags'); - $e = $context->get('ErrorCollector', true); - $t = false; // token index - $i = false; // injector index - $token = false; // the current token - $reprocess = false; // whether or not to reprocess the same token - $stack = array(); - - // member variables - $this->stack =& $stack; - $this->t =& $t; - $this->tokens =& $tokens; - $this->config = $config; - $this->context = $context; - - // context variables - $context->register('CurrentNesting', $stack); - $context->register('InputIndex', $t); - $context->register('InputTokens', $tokens); - $context->register('CurrentToken', $token); - - // -- begin INJECTOR -- - - $this->injectors = array(); - - $injectors = $config->getBatch('AutoFormat'); - $def_injectors = $definition->info_injector; - $custom_injectors = $injectors['Custom']; - unset($injectors['Custom']); // special case - foreach ($injectors as $injector => $b) { - // XXX: Fix with a legitimate lookup table of enabled filters - if (strpos($injector, '.') !== false) continue; - $injector = "HTMLPurifier_Injector_$injector"; - if (!$b) continue; - $this->injectors[] = new $injector; - } - foreach ($def_injectors as $injector) { - // assumed to be objects - $this->injectors[] = $injector; - } - foreach ($custom_injectors as $injector) { - if (!$injector) continue; - if (is_string($injector)) { - $injector = "HTMLPurifier_Injector_$injector"; - $injector = new $injector; - } - $this->injectors[] = $injector; - } - - // give the injectors references to the definition and context - // variables for performance reasons - foreach ($this->injectors as $ix => $injector) { - $error = $injector->prepare($config, $context); - if (!$error) continue; - array_splice($this->injectors, $ix, 1); // rm the injector - trigger_error("Cannot enable {$injector->name} injector because $error is not allowed", E_USER_WARNING); - } - - // -- end INJECTOR -- - - // a note on punting: - // In order to reduce code duplication, whenever some code needs - // to make HTML changes in order to make things "correct", the - // new HTML gets sent through the purifier, regardless of its - // status. This means that if we add a start token, because it - // was totally necessary, we don't have to update nesting; we just - // punt ($reprocess = true; continue;) and it does that for us. - - // isset is in loop because $tokens size changes during loop exec - for ( - $t = 0; - $t == 0 || isset($tokens[$t - 1]); - // only increment if we don't need to reprocess - $reprocess ? $reprocess = false : $t++ - ) { - - // check for a rewind - if (is_int($i) && $i >= 0) { - // possibility: disable rewinding if the current token has a - // rewind set on it already. This would offer protection from - // infinite loop, but might hinder some advanced rewinding. - $rewind_to = $this->injectors[$i]->getRewind(); - if (is_int($rewind_to) && $rewind_to < $t) { - if ($rewind_to < 0) $rewind_to = 0; - while ($t > $rewind_to) { - $t--; - $prev = $tokens[$t]; - // indicate that other injectors should not process this token, - // but we need to reprocess it - unset($prev->skip[$i]); - $prev->rewind = $i; - if ($prev instanceof HTMLPurifier_Token_Start) array_pop($this->stack); - elseif ($prev instanceof HTMLPurifier_Token_End) $this->stack[] = $prev->start; - } - } - $i = false; - } - - // handle case of document end - if (!isset($tokens[$t])) { - // kill processing if stack is empty - if (empty($this->stack)) break; - - // peek - $top_nesting = array_pop($this->stack); - $this->stack[] = $top_nesting; - - // send error - if ($e && !isset($top_nesting->armor['MakeWellFormed_TagClosedError'])) { - $e->send(E_NOTICE, 'Strategy_MakeWellFormed: Tag closed by document end', $top_nesting); - } - - // append, don't splice, since this is the end - $tokens[] = new HTMLPurifier_Token_End($top_nesting->name); - - // punt! - $reprocess = true; - continue; - } - - $token = $tokens[$t]; - - //echo '
        '; printTokens($tokens, $t); printTokens($this->stack); - //flush(); - - // quick-check: if it's not a tag, no need to process - if (empty($token->is_tag)) { - if ($token instanceof HTMLPurifier_Token_Text) { - foreach ($this->injectors as $i => $injector) { - if (isset($token->skip[$i])) continue; - if ($token->rewind !== null && $token->rewind !== $i) continue; - $injector->handleText($token); - $this->processToken($token, $i); - $reprocess = true; - break; - } - } - // another possibility is a comment - continue; - } - - if (isset($definition->info[$token->name])) { - $type = $definition->info[$token->name]->child->type; - } else { - $type = false; // Type is unknown, treat accordingly - } - - // quick tag checks: anything that's *not* an end tag - $ok = false; - if ($type === 'empty' && $token instanceof HTMLPurifier_Token_Start) { - // claims to be a start tag but is empty - $token = new HTMLPurifier_Token_Empty($token->name, $token->attr); - $ok = true; - } elseif ($type && $type !== 'empty' && $token instanceof HTMLPurifier_Token_Empty) { - // claims to be empty but really is a start tag - $this->swap(new HTMLPurifier_Token_End($token->name)); - $this->insertBefore(new HTMLPurifier_Token_Start($token->name, $token->attr)); - // punt (since we had to modify the input stream in a non-trivial way) - $reprocess = true; - continue; - } elseif ($token instanceof HTMLPurifier_Token_Empty) { - // real empty token - $ok = true; - } elseif ($token instanceof HTMLPurifier_Token_Start) { - // start tag - - // ...unless they also have to close their parent - if (!empty($this->stack)) { - - $parent = array_pop($this->stack); - $this->stack[] = $parent; - - if (isset($definition->info[$parent->name])) { - $elements = $definition->info[$parent->name]->child->getAllowedElements($config); - $autoclose = !isset($elements[$token->name]); - } else { - $autoclose = false; - } - - if ($autoclose && $definition->info[$token->name]->wrap) { - // Check if an element can be wrapped by another - // element to make it valid in a context (for - // example,
            needs a
          • in between) - $wrapname = $definition->info[$token->name]->wrap; - $wrapdef = $definition->info[$wrapname]; - $elements = $wrapdef->child->getAllowedElements($config); - $parent_elements = $definition->info[$parent->name]->child->getAllowedElements($config); - if (isset($elements[$token->name]) && isset($parent_elements[$wrapname])) { - $newtoken = new HTMLPurifier_Token_Start($wrapname); - $this->insertBefore($newtoken); - $reprocess = true; - continue; - } - } - - $carryover = false; - if ($autoclose && $definition->info[$parent->name]->formatting) { - $carryover = true; - } - - if ($autoclose) { - // errors need to be updated - $new_token = new HTMLPurifier_Token_End($parent->name); - $new_token->start = $parent; - if ($carryover) { - $element = clone $parent; - $element->armor['MakeWellFormed_TagClosedError'] = true; - $element->carryover = true; - $this->processToken(array($new_token, $token, $element)); - } else { - $this->insertBefore($new_token); - } - if ($e && !isset($parent->armor['MakeWellFormed_TagClosedError'])) { - if (!$carryover) { - $e->send(E_NOTICE, 'Strategy_MakeWellFormed: Tag auto closed', $parent); - } else { - $e->send(E_NOTICE, 'Strategy_MakeWellFormed: Tag carryover', $parent); - } - } - $reprocess = true; - continue; - } - - } - $ok = true; - } - - if ($ok) { - foreach ($this->injectors as $i => $injector) { - if (isset($token->skip[$i])) continue; - if ($token->rewind !== null && $token->rewind !== $i) continue; - $injector->handleElement($token); - $this->processToken($token, $i); - $reprocess = true; - break; - } - if (!$reprocess) { - // ah, nothing interesting happened; do normal processing - $this->swap($token); - if ($token instanceof HTMLPurifier_Token_Start) { - $this->stack[] = $token; - } elseif ($token instanceof HTMLPurifier_Token_End) { - throw new HTMLPurifier_Exception('Improper handling of end tag in start code; possible error in MakeWellFormed'); - } - } - continue; - } - - // sanity check: we should be dealing with a closing tag - if (!$token instanceof HTMLPurifier_Token_End) { - throw new HTMLPurifier_Exception('Unaccounted for tag token in input stream, bug in HTML Purifier'); - } - - // make sure that we have something open - if (empty($this->stack)) { - if ($escape_invalid_tags) { - if ($e) $e->send(E_WARNING, 'Strategy_MakeWellFormed: Unnecessary end tag to text'); - $this->swap(new HTMLPurifier_Token_Text( - $generator->generateFromToken($token) - )); - } else { - $this->remove(); - if ($e) $e->send(E_WARNING, 'Strategy_MakeWellFormed: Unnecessary end tag removed'); - } - $reprocess = true; - continue; - } - - // first, check for the simplest case: everything closes neatly. - // Eventually, everything passes through here; if there are problems - // we modify the input stream accordingly and then punt, so that - // the tokens get processed again. - $current_parent = array_pop($this->stack); - if ($current_parent->name == $token->name) { - $token->start = $current_parent; - foreach ($this->injectors as $i => $injector) { - if (isset($token->skip[$i])) continue; - if ($token->rewind !== null && $token->rewind !== $i) continue; - $injector->handleEnd($token); - $this->processToken($token, $i); - $this->stack[] = $current_parent; - $reprocess = true; - break; - } - continue; - } - - // okay, so we're trying to close the wrong tag - - // undo the pop previous pop - $this->stack[] = $current_parent; - - // scroll back the entire nest, trying to find our tag. - // (feature could be to specify how far you'd like to go) - $size = count($this->stack); - // -2 because -1 is the last element, but we already checked that - $skipped_tags = false; - for ($j = $size - 2; $j >= 0; $j--) { - if ($this->stack[$j]->name == $token->name) { - $skipped_tags = array_slice($this->stack, $j); - break; - } - } - - // we didn't find the tag, so remove - if ($skipped_tags === false) { - if ($escape_invalid_tags) { - $this->swap(new HTMLPurifier_Token_Text( - $generator->generateFromToken($token) - )); - if ($e) $e->send(E_WARNING, 'Strategy_MakeWellFormed: Stray end tag to text'); - } else { - $this->remove(); - if ($e) $e->send(E_WARNING, 'Strategy_MakeWellFormed: Stray end tag removed'); - } - $reprocess = true; - continue; - } - - // do errors, in REVERSE $j order: a,b,c with - $c = count($skipped_tags); - if ($e) { - for ($j = $c - 1; $j > 0; $j--) { - // notice we exclude $j == 0, i.e. the current ending tag, from - // the errors... - if (!isset($skipped_tags[$j]->armor['MakeWellFormed_TagClosedError'])) { - $e->send(E_NOTICE, 'Strategy_MakeWellFormed: Tag closed by element end', $skipped_tags[$j]); - } - } - } - - // insert tags, in FORWARD $j order: c,b,a with - $replace = array($token); - for ($j = 1; $j < $c; $j++) { - // ...as well as from the insertions - $new_token = new HTMLPurifier_Token_End($skipped_tags[$j]->name); - $new_token->start = $skipped_tags[$j]; - array_unshift($replace, $new_token); - if (isset($definition->info[$new_token->name]) && $definition->info[$new_token->name]->formatting) { - $element = clone $skipped_tags[$j]; - $element->carryover = true; - $element->armor['MakeWellFormed_TagClosedError'] = true; - $replace[] = $element; - } - } - $this->processToken($replace); - $reprocess = true; - continue; - } - - $context->destroy('CurrentNesting'); - $context->destroy('InputTokens'); - $context->destroy('InputIndex'); - $context->destroy('CurrentToken'); - - unset($this->injectors, $this->stack, $this->tokens, $this->t); - return $tokens; - } - - /** - * Processes arbitrary token values for complicated substitution patterns. - * In general: - * - * If $token is an array, it is a list of tokens to substitute for the - * current token. These tokens then get individually processed. If there - * is a leading integer in the list, that integer determines how many - * tokens from the stream should be removed. - * - * If $token is a regular token, it is swapped with the current token. - * - * If $token is false, the current token is deleted. - * - * If $token is an integer, that number of tokens (with the first token - * being the current one) will be deleted. - * - * @param $token Token substitution value - * @param $injector Injector that performed the substitution; default is if - * this is not an injector related operation. - */ - protected function processToken($token, $injector = -1) { - - // normalize forms of token - if (is_object($token)) $token = array(1, $token); - if (is_int($token)) $token = array($token); - if ($token === false) $token = array(1); - if (!is_array($token)) throw new HTMLPurifier_Exception('Invalid token type from injector'); - if (!is_int($token[0])) array_unshift($token, 1); - if ($token[0] === 0) throw new HTMLPurifier_Exception('Deleting zero tokens is not valid'); - - // $token is now an array with the following form: - // array(number nodes to delete, new node 1, new node 2, ...) - - $delete = array_shift($token); - $old = array_splice($this->tokens, $this->t, $delete, $token); - - if ($injector > -1) { - // determine appropriate skips - $oldskip = isset($old[0]) ? $old[0]->skip : array(); - foreach ($token as $object) { - $object->skip = $oldskip; - $object->skip[$injector] = true; - } - } - - } - - /** - * Inserts a token before the current token. Cursor now points to this token - */ - private function insertBefore($token) { - array_splice($this->tokens, $this->t, 0, array($token)); - } - - /** - * Removes current token. Cursor now points to new token occupying previously - * occupied space. - */ - private function remove() { - array_splice($this->tokens, $this->t, 1); - } - - /** - * Swap current token with new token. Cursor points to new token (no change). - */ - private function swap($token) { - $this->tokens[$this->t] = $token; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/RemoveForeignElements.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/RemoveForeignElements.php deleted file mode 100644 index 9792a0f5..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/RemoveForeignElements.php +++ /dev/null @@ -1,171 +0,0 @@ -getHTMLDefinition(); - $generator = new HTMLPurifier_Generator($config, $context); - $result = array(); - - $escape_invalid_tags = $config->get('Core.EscapeInvalidTags'); - $remove_invalid_img = $config->get('Core.RemoveInvalidImg'); - - // currently only used to determine if comments should be kept - $trusted = $config->get('HTML.Trusted'); - - $remove_script_contents = $config->get('Core.RemoveScriptContents'); - $hidden_elements = $config->get('Core.HiddenElements'); - - // remove script contents compatibility - if ($remove_script_contents === true) { - $hidden_elements['script'] = true; - } elseif ($remove_script_contents === false && isset($hidden_elements['script'])) { - unset($hidden_elements['script']); - } - - $attr_validator = new HTMLPurifier_AttrValidator(); - - // removes tokens until it reaches a closing tag with its value - $remove_until = false; - - // converts comments into text tokens when this is equal to a tag name - $textify_comments = false; - - $token = false; - $context->register('CurrentToken', $token); - - $e = false; - if ($config->get('Core.CollectErrors')) { - $e =& $context->get('ErrorCollector'); - } - - foreach($tokens as $token) { - if ($remove_until) { - if (empty($token->is_tag) || $token->name !== $remove_until) { - continue; - } - } - if (!empty( $token->is_tag )) { - // DEFINITION CALL - - // before any processing, try to transform the element - if ( - isset($definition->info_tag_transform[$token->name]) - ) { - $original_name = $token->name; - // there is a transformation for this tag - // DEFINITION CALL - $token = $definition-> - info_tag_transform[$token->name]-> - transform($token, $config, $context); - if ($e) $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Tag transform', $original_name); - } - - if (isset($definition->info[$token->name])) { - - // mostly everything's good, but - // we need to make sure required attributes are in order - if ( - ($token instanceof HTMLPurifier_Token_Start || $token instanceof HTMLPurifier_Token_Empty) && - $definition->info[$token->name]->required_attr && - ($token->name != 'img' || $remove_invalid_img) // ensure config option still works - ) { - $attr_validator->validateToken($token, $config, $context); - $ok = true; - foreach ($definition->info[$token->name]->required_attr as $name) { - if (!isset($token->attr[$name])) { - $ok = false; - break; - } - } - if (!$ok) { - if ($e) $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Missing required attribute', $name); - continue; - } - $token->armor['ValidateAttributes'] = true; - } - - if (isset($hidden_elements[$token->name]) && $token instanceof HTMLPurifier_Token_Start) { - $textify_comments = $token->name; - } elseif ($token->name === $textify_comments && $token instanceof HTMLPurifier_Token_End) { - $textify_comments = false; - } - - } elseif ($escape_invalid_tags) { - // invalid tag, generate HTML representation and insert in - if ($e) $e->send(E_WARNING, 'Strategy_RemoveForeignElements: Foreign element to text'); - $token = new HTMLPurifier_Token_Text( - $generator->generateFromToken($token) - ); - } else { - // check if we need to destroy all of the tag's children - // CAN BE GENERICIZED - if (isset($hidden_elements[$token->name])) { - if ($token instanceof HTMLPurifier_Token_Start) { - $remove_until = $token->name; - } elseif ($token instanceof HTMLPurifier_Token_Empty) { - // do nothing: we're still looking - } else { - $remove_until = false; - } - if ($e) $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Foreign meta element removed'); - } else { - if ($e) $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Foreign element removed'); - } - continue; - } - } elseif ($token instanceof HTMLPurifier_Token_Comment) { - // textify comments in script tags when they are allowed - if ($textify_comments !== false) { - $data = $token->data; - $token = new HTMLPurifier_Token_Text($data); - } elseif ($trusted) { - // keep, but perform comment cleaning - if ($e) { - // perform check whether or not there's a trailing hyphen - if (substr($token->data, -1) == '-') { - $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Trailing hyphen in comment removed'); - } - } - $token->data = rtrim($token->data, '-'); - $found_double_hyphen = false; - while (strpos($token->data, '--') !== false) { - if ($e && !$found_double_hyphen) { - $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Hyphens in comment collapsed'); - } - $found_double_hyphen = true; // prevent double-erroring - $token->data = str_replace('--', '-', $token->data); - } - } else { - // strip comments - if ($e) $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Comment removed'); - continue; - } - } elseif ($token instanceof HTMLPurifier_Token_Text) { - } else { - continue; - } - $result[] = $token; - } - if ($remove_until && $e) { - // we removed tokens until the end, throw error - $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Token removed to end', $remove_until); - } - - $context->destroy('CurrentToken'); - - return $result; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/ValidateAttributes.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/ValidateAttributes.php deleted file mode 100644 index d5e03b7b..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Strategy/ValidateAttributes.php +++ /dev/null @@ -1,39 +0,0 @@ -register('CurrentToken', $token); - - foreach ($tokens as $key => $token) { - - // only process tokens that have attributes, - // namely start and empty tags - if (!$token instanceof HTMLPurifier_Token_Start && !$token instanceof HTMLPurifier_Token_Empty) continue; - - // skip tokens that are armored - if (!empty($token->armor['ValidateAttributes'])) continue; - - // note that we have no facilities here for removing tokens - $validator->validateToken($token, $config, $context); - - $tokens[$key] = $token; // for PHP 4 - } - $context->destroy('CurrentToken'); - - return $tokens; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/StringHash.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/StringHash.php deleted file mode 100644 index 2161685e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/StringHash.php +++ /dev/null @@ -1,39 +0,0 @@ -accessed[$index] = true; - return parent::offsetGet($index); - } - - /** - * Returns a lookup array of all array indexes that have been accessed. - * @return Array in form array($index => true). - */ - public function getAccessed() { - return $this->accessed; - } - - /** - * Resets the access array. - */ - public function resetAccessed() { - $this->accessed = array(); - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/StringHashParser.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/StringHashParser.php deleted file mode 100644 index 03deefce..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/StringHashParser.php +++ /dev/null @@ -1,110 +0,0 @@ - 'DefaultKeyValue', - * 'KEY' => 'Value', - * 'KEY2' => 'Value2', - * 'MULTILINE-KEY' => "Multiline\nvalue.\n", - * ) - * - * We use this as an easy to use file-format for configuration schema - * files, but the class itself is usage agnostic. - * - * You can use ---- to forcibly terminate parsing of a single string-hash; - * this marker is used in multi string-hashes to delimit boundaries. - */ -class HTMLPurifier_StringHashParser -{ - - public $default = 'ID'; - - /** - * Parses a file that contains a single string-hash. - */ - public function parseFile($file) { - if (!file_exists($file)) return false; - $fh = fopen($file, 'r'); - if (!$fh) return false; - $ret = $this->parseHandle($fh); - fclose($fh); - return $ret; - } - - /** - * Parses a file that contains multiple string-hashes delimited by '----' - */ - public function parseMultiFile($file) { - if (!file_exists($file)) return false; - $ret = array(); - $fh = fopen($file, 'r'); - if (!$fh) return false; - while (!feof($fh)) { - $ret[] = $this->parseHandle($fh); - } - fclose($fh); - return $ret; - } - - /** - * Internal parser that acepts a file handle. - * @note While it's possible to simulate in-memory parsing by using - * custom stream wrappers, if such a use-case arises we should - * factor out the file handle into its own class. - * @param $fh File handle with pointer at start of valid string-hash - * block. - */ - protected function parseHandle($fh) { - $state = false; - $single = false; - $ret = array(); - do { - $line = fgets($fh); - if ($line === false) break; - $line = rtrim($line, "\n\r"); - if (!$state && $line === '') continue; - if ($line === '----') break; - if (strncmp('--#', $line, 3) === 0) { - // Comment - continue; - } elseif (strncmp('--', $line, 2) === 0) { - // Multiline declaration - $state = trim($line, '- '); - if (!isset($ret[$state])) $ret[$state] = ''; - continue; - } elseif (!$state) { - $single = true; - if (strpos($line, ':') !== false) { - // Single-line declaration - list($state, $line) = explode(':', $line, 2); - $line = trim($line); - } else { - // Use default declaration - $state = $this->default; - } - } - if ($single) { - $ret[$state] = $line; - $single = false; - $state = false; - } else { - $ret[$state] .= "$line\n"; - } - } while (!feof($fh)); - return $ret; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/TagTransform.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/TagTransform.php deleted file mode 100644 index a8a1f45d..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/TagTransform.php +++ /dev/null @@ -1,36 +0,0 @@ - 'xx-small', - '1' => 'xx-small', - '2' => 'small', - '3' => 'medium', - '4' => 'large', - '5' => 'x-large', - '6' => 'xx-large', - '7' => '300%', - '-1' => 'smaller', - '-2' => '60%', - '+1' => 'larger', - '+2' => '150%', - '+3' => '200%', - '+4' => '300%' - ); - - public function transform($tag, $config, $context) { - - if ($tag instanceof HTMLPurifier_Token_End) { - $new_tag = clone $tag; - $new_tag->name = $this->transform_to; - return $new_tag; - } - - $attr = $tag->attr; - $prepend_style = ''; - - // handle color transform - if (isset($attr['color'])) { - $prepend_style .= 'color:' . $attr['color'] . ';'; - unset($attr['color']); - } - - // handle face transform - if (isset($attr['face'])) { - $prepend_style .= 'font-family:' . $attr['face'] . ';'; - unset($attr['face']); - } - - // handle size transform - if (isset($attr['size'])) { - // normalize large numbers - if ($attr['size']{0} == '+' || $attr['size']{0} == '-') { - $size = (int) $attr['size']; - if ($size < -2) $attr['size'] = '-2'; - if ($size > 4) $attr['size'] = '+4'; - } else { - $size = (int) $attr['size']; - if ($size > 7) $attr['size'] = '7'; - } - if (isset($this->_size_lookup[$attr['size']])) { - $prepend_style .= 'font-size:' . - $this->_size_lookup[$attr['size']] . ';'; - } - unset($attr['size']); - } - - if ($prepend_style) { - $attr['style'] = isset($attr['style']) ? - $prepend_style . $attr['style'] : - $prepend_style; - } - - $new_tag = clone $tag; - $new_tag->name = $this->transform_to; - $new_tag->attr = $attr; - - return $new_tag; - - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/TagTransform/Simple.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/TagTransform/Simple.php deleted file mode 100644 index ced91503..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/TagTransform/Simple.php +++ /dev/null @@ -1,35 +0,0 @@ -transform_to = $transform_to; - $this->style = $style; - } - - public function transform($tag, $config, $context) { - $new_tag = clone $tag; - $new_tag->name = $this->transform_to; - if (!is_null($this->style) && - ($new_tag instanceof HTMLPurifier_Token_Start || $new_tag instanceof HTMLPurifier_Token_Empty) - ) { - $this->prependCSS($new_tag->attr, $this->style); - } - return $new_tag; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Token.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Token.php deleted file mode 100644 index 22bebcf7..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Token.php +++ /dev/null @@ -1,57 +0,0 @@ -line = $l; - $this->col = $c; - } - - /** - * Convenience function for DirectLex settings line/col position. - */ - public function rawPosition($l, $c) { - if ($c === -1) $l++; - $this->line = $l; - $this->col = $c; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Token/Comment.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Token/Comment.php deleted file mode 100644 index 592f2eea..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Token/Comment.php +++ /dev/null @@ -1,22 +0,0 @@ -data = $data; - $this->line = $line; - $this->col = $col; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Token/Empty.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Token/Empty.php deleted file mode 100644 index 842c54da..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Token/Empty.php +++ /dev/null @@ -1,11 +0,0 @@ -!empty($obj->is_tag) - * without having to use a function call is_a(). - */ - public $is_tag = true; - - /** - * The lower-case name of the tag, like 'a', 'b' or 'blockquote'. - * - * @note Strictly speaking, XML tags are case sensitive, so we shouldn't - * be lower-casing them, but these tokens cater to HTML tags, which are - * insensitive. - */ - public $name; - - /** - * Associative array of the tag's attributes. - */ - public $attr = array(); - - /** - * Non-overloaded constructor, which lower-cases passed tag name. - * - * @param $name String name. - * @param $attr Associative array of attributes. - */ - public function __construct($name, $attr = array(), $line = null, $col = null) { - $this->name = ctype_lower($name) ? $name : strtolower($name); - foreach ($attr as $key => $value) { - // normalization only necessary when key is not lowercase - if (!ctype_lower($key)) { - $new_key = strtolower($key); - if (!isset($attr[$new_key])) { - $attr[$new_key] = $attr[$key]; - } - if ($new_key !== $key) { - unset($attr[$key]); - } - } - } - $this->attr = $attr; - $this->line = $line; - $this->col = $col; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Token/Text.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Token/Text.php deleted file mode 100644 index 0d82f75a..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/Token/Text.php +++ /dev/null @@ -1,33 +0,0 @@ -data = $data; - $this->is_whitespace = ctype_space($data); - $this->line = $line; - $this->col = $col; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/TokenFactory.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/TokenFactory.php deleted file mode 100644 index 16c969cf..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/TokenFactory.php +++ /dev/null @@ -1,94 +0,0 @@ -p_start = new HTMLPurifier_Token_Start('', array()); - $this->p_end = new HTMLPurifier_Token_End(''); - $this->p_empty = new HTMLPurifier_Token_Empty('', array()); - $this->p_text = new HTMLPurifier_Token_Text(''); - $this->p_comment= new HTMLPurifier_Token_Comment(''); - } - - /** - * Creates a HTMLPurifier_Token_Start. - * @param $name Tag name - * @param $attr Associative array of attributes - * @return Generated HTMLPurifier_Token_Start - */ - public function createStart($name, $attr = array()) { - $p = clone $this->p_start; - $p->__construct($name, $attr); - return $p; - } - - /** - * Creates a HTMLPurifier_Token_End. - * @param $name Tag name - * @return Generated HTMLPurifier_Token_End - */ - public function createEnd($name) { - $p = clone $this->p_end; - $p->__construct($name); - return $p; - } - - /** - * Creates a HTMLPurifier_Token_Empty. - * @param $name Tag name - * @param $attr Associative array of attributes - * @return Generated HTMLPurifier_Token_Empty - */ - public function createEmpty($name, $attr = array()) { - $p = clone $this->p_empty; - $p->__construct($name, $attr); - return $p; - } - - /** - * Creates a HTMLPurifier_Token_Text. - * @param $data Data of text token - * @return Generated HTMLPurifier_Token_Text - */ - public function createText($data) { - $p = clone $this->p_text; - $p->__construct($data); - return $p; - } - - /** - * Creates a HTMLPurifier_Token_Comment. - * @param $data Data of comment token - * @return Generated HTMLPurifier_Token_Comment - */ - public function createComment($data) { - $p = clone $this->p_comment; - $p->__construct($data); - return $p; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URI.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URI.php deleted file mode 100644 index ac983b86..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URI.php +++ /dev/null @@ -1,173 +0,0 @@ -scheme = is_null($scheme) || ctype_lower($scheme) ? $scheme : strtolower($scheme); - $this->userinfo = $userinfo; - $this->host = $host; - $this->port = is_null($port) ? $port : (int) $port; - $this->path = $path; - $this->query = $query; - $this->fragment = $fragment; - } - - /** - * Retrieves a scheme object corresponding to the URI's scheme/default - * @param $config Instance of HTMLPurifier_Config - * @param $context Instance of HTMLPurifier_Context - * @return Scheme object appropriate for validating this URI - */ - public function getSchemeObj($config, $context) { - $registry = HTMLPurifier_URISchemeRegistry::instance(); - if ($this->scheme !== null) { - $scheme_obj = $registry->getScheme($this->scheme, $config, $context); - if (!$scheme_obj) return false; // invalid scheme, clean it out - } else { - // no scheme: retrieve the default one - $def = $config->getDefinition('URI'); - $scheme_obj = $registry->getScheme($def->defaultScheme, $config, $context); - if (!$scheme_obj) { - // something funky happened to the default scheme object - trigger_error( - 'Default scheme object "' . $def->defaultScheme . '" was not readable', - E_USER_WARNING - ); - return false; - } - } - return $scheme_obj; - } - - /** - * Generic validation method applicable for all schemes. May modify - * this URI in order to get it into a compliant form. - * @param $config Instance of HTMLPurifier_Config - * @param $context Instance of HTMLPurifier_Context - * @return True if validation/filtering succeeds, false if failure - */ - public function validate($config, $context) { - - // ABNF definitions from RFC 3986 - $chars_sub_delims = '!$&\'()*+,;='; - $chars_gen_delims = ':/?#[]@'; - $chars_pchar = $chars_sub_delims . ':@'; - - // validate scheme (MUST BE FIRST!) - if (!is_null($this->scheme) && is_null($this->host)) { - $def = $config->getDefinition('URI'); - if ($def->defaultScheme === $this->scheme) { - $this->scheme = null; - } - } - - // validate host - if (!is_null($this->host)) { - $host_def = new HTMLPurifier_AttrDef_URI_Host(); - $this->host = $host_def->validate($this->host, $config, $context); - if ($this->host === false) $this->host = null; - } - - // validate username - if (!is_null($this->userinfo)) { - $encoder = new HTMLPurifier_PercentEncoder($chars_sub_delims . ':'); - $this->userinfo = $encoder->encode($this->userinfo); - } - - // validate port - if (!is_null($this->port)) { - if ($this->port < 1 || $this->port > 65535) $this->port = null; - } - - // validate path - $path_parts = array(); - $segments_encoder = new HTMLPurifier_PercentEncoder($chars_pchar . '/'); - if (!is_null($this->host)) { - // path-abempty (hier and relative) - $this->path = $segments_encoder->encode($this->path); - } elseif ($this->path !== '' && $this->path[0] === '/') { - // path-absolute (hier and relative) - if (strlen($this->path) >= 2 && $this->path[1] === '/') { - // This shouldn't ever happen! - $this->path = ''; - } else { - $this->path = $segments_encoder->encode($this->path); - } - } elseif (!is_null($this->scheme) && $this->path !== '') { - // path-rootless (hier) - // Short circuit evaluation means we don't need to check nz - $this->path = $segments_encoder->encode($this->path); - } elseif (is_null($this->scheme) && $this->path !== '') { - // path-noscheme (relative) - // (once again, not checking nz) - $segment_nc_encoder = new HTMLPurifier_PercentEncoder($chars_sub_delims . '@'); - $c = strpos($this->path, '/'); - if ($c !== false) { - $this->path = - $segment_nc_encoder->encode(substr($this->path, 0, $c)) . - $segments_encoder->encode(substr($this->path, $c)); - } else { - $this->path = $segment_nc_encoder->encode($this->path); - } - } else { - // path-empty (hier and relative) - $this->path = ''; // just to be safe - } - - // qf = query and fragment - $qf_encoder = new HTMLPurifier_PercentEncoder($chars_pchar . '/?'); - - if (!is_null($this->query)) { - $this->query = $qf_encoder->encode($this->query); - } - - if (!is_null($this->fragment)) { - $this->fragment = $qf_encoder->encode($this->fragment); - } - - return true; - - } - - /** - * Convert URI back to string - * @return String URI appropriate for output - */ - public function toString() { - // reconstruct authority - $authority = null; - if (!is_null($this->host)) { - $authority = ''; - if(!is_null($this->userinfo)) $authority .= $this->userinfo . '@'; - $authority .= $this->host; - if(!is_null($this->port)) $authority .= ':' . $this->port; - } - - // reconstruct the result - $result = ''; - if (!is_null($this->scheme)) $result .= $this->scheme . ':'; - if (!is_null($authority)) $result .= '//' . $authority; - $result .= $this->path; - if (!is_null($this->query)) $result .= '?' . $this->query; - if (!is_null($this->fragment)) $result .= '#' . $this->fragment; - - return $result; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIDefinition.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIDefinition.php deleted file mode 100644 index 86ac169c..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIDefinition.php +++ /dev/null @@ -1,93 +0,0 @@ -registerFilter(new HTMLPurifier_URIFilter_DisableExternal()); - $this->registerFilter(new HTMLPurifier_URIFilter_DisableExternalResources()); - $this->registerFilter(new HTMLPurifier_URIFilter_HostBlacklist()); - $this->registerFilter(new HTMLPurifier_URIFilter_MakeAbsolute()); - $this->registerFilter(new HTMLPurifier_URIFilter_Munge()); - } - - public function registerFilter($filter) { - $this->registeredFilters[$filter->name] = $filter; - } - - public function addFilter($filter, $config) { - $r = $filter->prepare($config); - if ($r === false) return; // null is ok, for backwards compat - if ($filter->post) { - $this->postFilters[$filter->name] = $filter; - } else { - $this->filters[$filter->name] = $filter; - } - } - - protected function doSetup($config) { - $this->setupMemberVariables($config); - $this->setupFilters($config); - } - - protected function setupFilters($config) { - foreach ($this->registeredFilters as $name => $filter) { - $conf = $config->get('URI.' . $name); - if ($conf !== false && $conf !== null) { - $this->addFilter($filter, $config); - } - } - unset($this->registeredFilters); - } - - protected function setupMemberVariables($config) { - $this->host = $config->get('URI.Host'); - $base_uri = $config->get('URI.Base'); - if (!is_null($base_uri)) { - $parser = new HTMLPurifier_URIParser(); - $this->base = $parser->parse($base_uri); - $this->defaultScheme = $this->base->scheme; - if (is_null($this->host)) $this->host = $this->base->host; - } - if (is_null($this->defaultScheme)) $this->defaultScheme = $config->get('URI.DefaultScheme'); - } - - public function filter(&$uri, $config, $context) { - foreach ($this->filters as $name => $f) { - $result = $f->filter($uri, $config, $context); - if (!$result) return false; - } - return true; - } - - public function postFilter(&$uri, $config, $context) { - foreach ($this->postFilters as $name => $f) { - $result = $f->filter($uri, $config, $context); - if (!$result) return false; - } - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter.php deleted file mode 100644 index 8c73051e..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter.php +++ /dev/null @@ -1,45 +0,0 @@ -getDefinition('URI')->host; - if ($our_host !== null) $this->ourHostParts = array_reverse(explode('.', $our_host)); - } - public function filter(&$uri, $config, $context) { - if (is_null($uri->host)) return true; - if ($this->ourHostParts === false) return false; - $host_parts = array_reverse(explode('.', $uri->host)); - foreach ($this->ourHostParts as $i => $x) { - if (!isset($host_parts[$i])) return false; - if ($host_parts[$i] != $this->ourHostParts[$i]) return false; - } - return true; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/DisableExternalResources.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/DisableExternalResources.php deleted file mode 100644 index b10370c9..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/DisableExternalResources.php +++ /dev/null @@ -1,12 +0,0 @@ -get('EmbeddedURI', true)) return true; - return parent::filter($uri, $config, $context); - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/DisableResources.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/DisableResources.php deleted file mode 100644 index e69d970a..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/DisableResources.php +++ /dev/null @@ -1,11 +0,0 @@ -get('EmbeddedURI', true); - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/HostBlacklist.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/HostBlacklist.php deleted file mode 100644 index 11463f8f..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/HostBlacklist.php +++ /dev/null @@ -1,21 +0,0 @@ -blacklist = $config->get('URI.HostBlacklist'); - return true; - } - public function filter(&$uri, $config, $context) { - foreach($this->blacklist as $blacklisted_host_fragment) { - if (strpos($uri->host, $blacklisted_host_fragment) !== false) { - return false; - } - } - return true; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/MakeAbsolute.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/MakeAbsolute.php deleted file mode 100644 index 5f3c5ad3..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/MakeAbsolute.php +++ /dev/null @@ -1,114 +0,0 @@ -getDefinition('URI'); - $this->base = $def->base; - if (is_null($this->base)) { - trigger_error('URI.MakeAbsolute is being ignored due to lack of value for URI.Base configuration', E_USER_WARNING); - return false; - } - $this->base->fragment = null; // fragment is invalid for base URI - $stack = explode('/', $this->base->path); - array_pop($stack); // discard last segment - $stack = $this->_collapseStack($stack); // do pre-parsing - $this->basePathStack = $stack; - return true; - } - public function filter(&$uri, $config, $context) { - if (is_null($this->base)) return true; // abort early - if ( - $uri->path === '' && is_null($uri->scheme) && - is_null($uri->host) && is_null($uri->query) && is_null($uri->fragment) - ) { - // reference to current document - $uri = clone $this->base; - return true; - } - if (!is_null($uri->scheme)) { - // absolute URI already: don't change - if (!is_null($uri->host)) return true; - $scheme_obj = $uri->getSchemeObj($config, $context); - if (!$scheme_obj) { - // scheme not recognized - return false; - } - if (!$scheme_obj->hierarchical) { - // non-hierarchal URI with explicit scheme, don't change - return true; - } - // special case: had a scheme but always is hierarchical and had no authority - } - if (!is_null($uri->host)) { - // network path, don't bother - return true; - } - if ($uri->path === '') { - $uri->path = $this->base->path; - } elseif ($uri->path[0] !== '/') { - // relative path, needs more complicated processing - $stack = explode('/', $uri->path); - $new_stack = array_merge($this->basePathStack, $stack); - if ($new_stack[0] !== '' && !is_null($this->base->host)) { - array_unshift($new_stack, ''); - } - $new_stack = $this->_collapseStack($new_stack); - $uri->path = implode('/', $new_stack); - } else { - // absolute path, but still we should collapse - $uri->path = implode('/', $this->_collapseStack(explode('/', $uri->path))); - } - // re-combine - $uri->scheme = $this->base->scheme; - if (is_null($uri->userinfo)) $uri->userinfo = $this->base->userinfo; - if (is_null($uri->host)) $uri->host = $this->base->host; - if (is_null($uri->port)) $uri->port = $this->base->port; - return true; - } - - /** - * Resolve dots and double-dots in a path stack - */ - private function _collapseStack($stack) { - $result = array(); - $is_folder = false; - for ($i = 0; isset($stack[$i]); $i++) { - $is_folder = false; - // absorb an internally duplicated slash - if ($stack[$i] == '' && $i && isset($stack[$i+1])) continue; - if ($stack[$i] == '..') { - if (!empty($result)) { - $segment = array_pop($result); - if ($segment === '' && empty($result)) { - // error case: attempted to back out too far: - // restore the leading slash - $result[] = ''; - } elseif ($segment === '..') { - $result[] = '..'; // cannot remove .. with .. - } - } else { - // relative path, preserve the double-dots - $result[] = '..'; - } - $is_folder = true; - continue; - } - if ($stack[$i] == '.') { - // silently absorb - $is_folder = true; - continue; - } - $result[] = $stack[$i]; - } - if ($is_folder) $result[] = ''; - return $result; - } -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/Munge.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/Munge.php deleted file mode 100644 index 16969bed..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIFilter/Munge.php +++ /dev/null @@ -1,58 +0,0 @@ -target = $config->get('URI.' . $this->name); - $this->parser = new HTMLPurifier_URIParser(); - $this->doEmbed = $config->get('URI.MungeResources'); - $this->secretKey = $config->get('URI.MungeSecretKey'); - return true; - } - public function filter(&$uri, $config, $context) { - if ($context->get('EmbeddedURI', true) && !$this->doEmbed) return true; - - $scheme_obj = $uri->getSchemeObj($config, $context); - if (!$scheme_obj) return true; // ignore unknown schemes, maybe another postfilter did it - if (is_null($uri->host) || empty($scheme_obj->browsable)) { - return true; - } - // don't redirect if target host is our host - if ($uri->host === $config->getDefinition('URI')->host) { - return true; - } - - $this->makeReplace($uri, $config, $context); - $this->replace = array_map('rawurlencode', $this->replace); - - $new_uri = strtr($this->target, $this->replace); - $new_uri = $this->parser->parse($new_uri); - // don't redirect if the target host is the same as the - // starting host - if ($uri->host === $new_uri->host) return true; - $uri = $new_uri; // overwrite - return true; - } - - protected function makeReplace($uri, $config, $context) { - $string = $uri->toString(); - // always available - $this->replace['%s'] = $string; - $this->replace['%r'] = $context->get('EmbeddedURI', true); - $token = $context->get('CurrentToken', true); - $this->replace['%n'] = $token ? $token->name : null; - $this->replace['%m'] = $context->get('CurrentAttr', true); - $this->replace['%p'] = $context->get('CurrentCSSProperty', true); - // not always available - if ($this->secretKey) $this->replace['%t'] = sha1($this->secretKey . ':' . $string); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIParser.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIParser.php deleted file mode 100644 index 902f5270..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIParser.php +++ /dev/null @@ -1,70 +0,0 @@ -percentEncoder = new HTMLPurifier_PercentEncoder(); - } - - /** - * Parses a URI. - * @param $uri string URI to parse - * @return HTMLPurifier_URI representation of URI. This representation has - * not been validated yet and may not conform to RFC. - */ - public function parse($uri) { - - $uri = $this->percentEncoder->normalize($uri); - - // Regexp is as per Appendix B. - // Note that ["<>] are an addition to the RFC's recommended - // characters, because they represent external delimeters. - $r_URI = '!'. - '(([^:/?#"<>]+):)?'. // 2. Scheme - '(//([^/?#"<>]*))?'. // 4. Authority - '([^?#"<>]*)'. // 5. Path - '(\?([^#"<>]*))?'. // 7. Query - '(#([^"<>]*))?'. // 8. Fragment - '!'; - - $matches = array(); - $result = preg_match($r_URI, $uri, $matches); - - if (!$result) return false; // *really* invalid URI - - // seperate out parts - $scheme = !empty($matches[1]) ? $matches[2] : null; - $authority = !empty($matches[3]) ? $matches[4] : null; - $path = $matches[5]; // always present, can be empty - $query = !empty($matches[6]) ? $matches[7] : null; - $fragment = !empty($matches[8]) ? $matches[9] : null; - - // further parse authority - if ($authority !== null) { - $r_authority = "/^((.+?)@)?(\[[^\]]+\]|[^:]*)(:(\d*))?/"; - $matches = array(); - preg_match($r_authority, $authority, $matches); - $userinfo = !empty($matches[1]) ? $matches[2] : null; - $host = !empty($matches[3]) ? $matches[3] : ''; - $port = !empty($matches[4]) ? (int) $matches[5] : null; - } else { - $port = $host = $userinfo = null; - } - - return new HTMLPurifier_URI( - $scheme, $userinfo, $host, $port, $path, $query, $fragment); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme.php deleted file mode 100644 index 2ef2ae55..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme.php +++ /dev/null @@ -1,42 +0,0 @@ -, resolves edge cases - * with making relative URIs absolute - */ - public $hierarchical = false; - - /** - * Validates the components of a URI - * @note This implementation should be called by children if they define - * a default port, as it does port processing. - * @param $uri Instance of HTMLPurifier_URI - * @param $config HTMLPurifier_Config object - * @param $context HTMLPurifier_Context object - * @return Bool success or failure - */ - public function validate(&$uri, $config, $context) { - if ($this->default_port == $uri->port) $uri->port = null; - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/data.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/data.php deleted file mode 100644 index bc4fb8cd..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/data.php +++ /dev/null @@ -1,93 +0,0 @@ - true, - 'image/gif' => true, - 'image/png' => true, - ); - - public function validate(&$uri, $config, $context) { - $result = explode(',', $uri->path, 2); - $is_base64 = false; - $charset = null; - $content_type = null; - if (count($result) == 2) { - list($metadata, $data) = $result; - // do some legwork on the metadata - $metas = explode(';', $metadata); - while(!empty($metas)) { - $cur = array_shift($metas); - if ($cur == 'base64') { - $is_base64 = true; - break; - } - if (substr($cur, 0, 8) == 'charset=') { - // doesn't match if there are arbitrary spaces, but - // whatever dude - if ($charset !== null) continue; // garbage - $charset = substr($cur, 8); // not used - } else { - if ($content_type !== null) continue; // garbage - $content_type = $cur; - } - } - } else { - $data = $result[0]; - } - if ($content_type !== null && empty($this->allowed_types[$content_type])) { - return false; - } - if ($charset !== null) { - // error; we don't allow plaintext stuff - $charset = null; - } - $data = rawurldecode($data); - if ($is_base64) { - $raw_data = base64_decode($data); - } else { - $raw_data = $data; - } - // XXX probably want to refactor this into a general mechanism - // for filtering arbitrary content types - $file = tempnam("/tmp", ""); - file_put_contents($file, $raw_data); - if (function_exists('exif_imagetype')) { - $image_code = exif_imagetype($file); - } elseif (function_exists('getimagesize')) { - set_error_handler(array($this, 'muteErrorHandler')); - $info = getimagesize($file); - restore_error_handler(); - if ($info == false) return false; - $image_code = $info[2]; - } else { - trigger_error("could not find exif_imagetype or getimagesize functions", E_USER_ERROR); - } - $real_content_type = image_type_to_mime_type($image_code); - if ($real_content_type != $content_type) { - // we're nice guys; if the content type is something else we - // support, change it over - if (empty($this->allowed_types[$real_content_type])) return false; - $content_type = $real_content_type; - } - // ok, it's kosher, rewrite what we need - $uri->userinfo = null; - $uri->host = null; - $uri->port = null; - $uri->fragment = null; - $uri->query = null; - $uri->path = "$content_type;base64," . base64_encode($raw_data); - return true; - } - - public function muteErrorHandler($errno, $errstr) {} - -} - diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/file.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/file.php deleted file mode 100644 index 66c30232..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/file.php +++ /dev/null @@ -1,26 +0,0 @@ -userinfo = null; - // file:// makes no provisions for accessing the resource - $uri->port = null; - // While it seems to work on Firefox, the querystring has - // no possible effect and is thus stripped. - $uri->query = null; - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/ftp.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/ftp.php deleted file mode 100644 index f86f5f27..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/ftp.php +++ /dev/null @@ -1,43 +0,0 @@ -query = null; - - // typecode check - $semicolon_pos = strrpos($uri->path, ';'); // reverse - if ($semicolon_pos !== false) { - $type = substr($uri->path, $semicolon_pos + 1); // no semicolon - $uri->path = substr($uri->path, 0, $semicolon_pos); - $type_ret = ''; - if (strpos($type, '=') !== false) { - // figure out whether or not the declaration is correct - list($key, $typecode) = explode('=', $type, 2); - if ($key !== 'type') { - // invalid key, tack it back on encoded - $uri->path .= '%3B' . $type; - } elseif ($typecode === 'a' || $typecode === 'i' || $typecode === 'd') { - $type_ret = ";type=$typecode"; - } - } else { - $uri->path .= '%3B' . $type; - } - $uri->path = str_replace(';', '%3B', $uri->path); - $uri->path .= $type_ret; - } - - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/http.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/http.php deleted file mode 100644 index 1a5ccbe9..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/http.php +++ /dev/null @@ -1,20 +0,0 @@ -userinfo = null; - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/https.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/https.php deleted file mode 100644 index ec1597bd..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/https.php +++ /dev/null @@ -1,12 +0,0 @@ -userinfo = null; - $uri->host = null; - $uri->port = null; - // we need to validate path against RFC 2368's addr-spec - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/news.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/news.php deleted file mode 100644 index 11a8f229..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/news.php +++ /dev/null @@ -1,22 +0,0 @@ -userinfo = null; - $uri->host = null; - $uri->port = null; - $uri->query = null; - // typecode check needed on path - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/nntp.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/nntp.php deleted file mode 100644 index 57a05451..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URIScheme/nntp.php +++ /dev/null @@ -1,20 +0,0 @@ -userinfo = null; - $uri->query = null; - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URISchemeRegistry.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URISchemeRegistry.php deleted file mode 100644 index ad227a43..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/URISchemeRegistry.php +++ /dev/null @@ -1,68 +0,0 @@ -get('URI.AllowedSchemes'); - if (!$config->get('URI.OverrideAllowedSchemes') && - !isset($allowed_schemes[$scheme]) - ) { - return; - } - - if (isset($this->schemes[$scheme])) return $this->schemes[$scheme]; - if (!isset($allowed_schemes[$scheme])) return; - - $class = 'HTMLPurifier_URIScheme_' . $scheme; - if (!class_exists($class)) return; - $this->schemes[$scheme] = new $class(); - return $this->schemes[$scheme]; - } - - /** - * Registers a custom scheme to the cache, bypassing reflection. - * @param $scheme Scheme name - * @param $scheme_obj HTMLPurifier_URIScheme object - */ - public function register($scheme, $scheme_obj) { - $this->schemes[$scheme] = $scheme_obj; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/UnitConverter.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/UnitConverter.php deleted file mode 100644 index 1944fad9..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/UnitConverter.php +++ /dev/null @@ -1,254 +0,0 @@ - array( - 'px' => 3, // This is as per CSS 2.1 and Firefox. Your mileage may vary - 'pt' => 4, - 'pc' => 48, - 'in' => 288, - self::METRIC => array('pt', '0.352777778', 'mm'), - ), - self::METRIC => array( - 'mm' => 1, - 'cm' => 10, - self::ENGLISH => array('mm', '2.83464567', 'pt'), - ), - ); - - /** - * Minimum bcmath precision for output. - */ - protected $outputPrecision; - - /** - * Bcmath precision for internal calculations. - */ - protected $internalPrecision; - - /** - * Whether or not BCMath is available - */ - private $bcmath; - - public function __construct($output_precision = 4, $internal_precision = 10, $force_no_bcmath = false) { - $this->outputPrecision = $output_precision; - $this->internalPrecision = $internal_precision; - $this->bcmath = !$force_no_bcmath && function_exists('bcmul'); - } - - /** - * Converts a length object of one unit into another unit. - * @param HTMLPurifier_Length $length - * Instance of HTMLPurifier_Length to convert. You must validate() - * it before passing it here! - * @param string $to_unit - * Unit to convert to. - * @note - * About precision: This conversion function pays very special - * attention to the incoming precision of values and attempts - * to maintain a number of significant figure. Results are - * fairly accurate up to nine digits. Some caveats: - * - If a number is zero-padded as a result of this significant - * figure tracking, the zeroes will be eliminated. - * - If a number contains less than four sigfigs ($outputPrecision) - * and this causes some decimals to be excluded, those - * decimals will be added on. - */ - public function convert($length, $to_unit) { - - if (!$length->isValid()) return false; - - $n = $length->getN(); - $unit = $length->getUnit(); - - if ($n === '0' || $unit === false) { - return new HTMLPurifier_Length('0', false); - } - - $state = $dest_state = false; - foreach (self::$units as $k => $x) { - if (isset($x[$unit])) $state = $k; - if (isset($x[$to_unit])) $dest_state = $k; - } - if (!$state || !$dest_state) return false; - - // Some calculations about the initial precision of the number; - // this will be useful when we need to do final rounding. - $sigfigs = $this->getSigFigs($n); - if ($sigfigs < $this->outputPrecision) $sigfigs = $this->outputPrecision; - - // BCMath's internal precision deals only with decimals. Use - // our default if the initial number has no decimals, or increase - // it by how ever many decimals, thus, the number of guard digits - // will always be greater than or equal to internalPrecision. - $log = (int) floor(log(abs($n), 10)); - $cp = ($log < 0) ? $this->internalPrecision - $log : $this->internalPrecision; // internal precision - - for ($i = 0; $i < 2; $i++) { - - // Determine what unit IN THIS SYSTEM we need to convert to - if ($dest_state === $state) { - // Simple conversion - $dest_unit = $to_unit; - } else { - // Convert to the smallest unit, pending a system shift - $dest_unit = self::$units[$state][$dest_state][0]; - } - - // Do the conversion if necessary - if ($dest_unit !== $unit) { - $factor = $this->div(self::$units[$state][$unit], self::$units[$state][$dest_unit], $cp); - $n = $this->mul($n, $factor, $cp); - $unit = $dest_unit; - } - - // Output was zero, so bail out early. Shouldn't ever happen. - if ($n === '') { - $n = '0'; - $unit = $to_unit; - break; - } - - // It was a simple conversion, so bail out - if ($dest_state === $state) { - break; - } - - if ($i !== 0) { - // Conversion failed! Apparently, the system we forwarded - // to didn't have this unit. This should never happen! - return false; - } - - // Pre-condition: $i == 0 - - // Perform conversion to next system of units - $n = $this->mul($n, self::$units[$state][$dest_state][1], $cp); - $unit = self::$units[$state][$dest_state][2]; - $state = $dest_state; - - // One more loop around to convert the unit in the new system. - - } - - // Post-condition: $unit == $to_unit - if ($unit !== $to_unit) return false; - - // Useful for debugging: - //echo "
            n";
            -        //echo "$n\nsigfigs = $sigfigs\nnew_log = $new_log\nlog = $log\nrp = $rp\n
            \n"; - - $n = $this->round($n, $sigfigs); - if (strpos($n, '.') !== false) $n = rtrim($n, '0'); - $n = rtrim($n, '.'); - - return new HTMLPurifier_Length($n, $unit); - } - - /** - * Returns the number of significant figures in a string number. - * @param string $n Decimal number - * @return int number of sigfigs - */ - public function getSigFigs($n) { - $n = ltrim($n, '0+-'); - $dp = strpos($n, '.'); // decimal position - if ($dp === false) { - $sigfigs = strlen(rtrim($n, '0')); - } else { - $sigfigs = strlen(ltrim($n, '0.')); // eliminate extra decimal character - if ($dp !== 0) $sigfigs--; - } - return $sigfigs; - } - - /** - * Adds two numbers, using arbitrary precision when available. - */ - private function add($s1, $s2, $scale) { - if ($this->bcmath) return bcadd($s1, $s2, $scale); - else return $this->scale($s1 + $s2, $scale); - } - - /** - * Multiples two numbers, using arbitrary precision when available. - */ - private function mul($s1, $s2, $scale) { - if ($this->bcmath) return bcmul($s1, $s2, $scale); - else return $this->scale($s1 * $s2, $scale); - } - - /** - * Divides two numbers, using arbitrary precision when available. - */ - private function div($s1, $s2, $scale) { - if ($this->bcmath) return bcdiv($s1, $s2, $scale); - else return $this->scale($s1 / $s2, $scale); - } - - /** - * Rounds a number according to the number of sigfigs it should have, - * using arbitrary precision when available. - */ - private function round($n, $sigfigs) { - $new_log = (int) floor(log(abs($n), 10)); // Number of digits left of decimal - 1 - $rp = $sigfigs - $new_log - 1; // Number of decimal places needed - $neg = $n < 0 ? '-' : ''; // Negative sign - if ($this->bcmath) { - if ($rp >= 0) { - $n = bcadd($n, $neg . '0.' . str_repeat('0', $rp) . '5', $rp + 1); - $n = bcdiv($n, '1', $rp); - } else { - // This algorithm partially depends on the standardized - // form of numbers that comes out of bcmath. - $n = bcadd($n, $neg . '5' . str_repeat('0', $new_log - $sigfigs), 0); - $n = substr($n, 0, $sigfigs + strlen($neg)) . str_repeat('0', $new_log - $sigfigs + 1); - } - return $n; - } else { - return $this->scale(round($n, $sigfigs - $new_log - 1), $rp + 1); - } - } - - /** - * Scales a float to $scale digits right of decimal point, like BCMath. - */ - private function scale($r, $scale) { - if ($scale < 0) { - // The f sprintf type doesn't support negative numbers, so we - // need to cludge things manually. First get the string. - $r = sprintf('%.0f', (float) $r); - // Due to floating point precision loss, $r will more than likely - // look something like 4652999999999.9234. We grab one more digit - // than we need to precise from $r and then use that to round - // appropriately. - $precise = (string) round(substr($r, 0, strlen($r) + $scale), -1); - // Now we return it, truncating the zero that was rounded off. - return substr($precise, 0, -1) . str_repeat('0', -$scale + 1); - } - return sprintf('%.' . $scale . 'f', (float) $r); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/VarParser.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/VarParser.php deleted file mode 100644 index f5dbb536..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/VarParser.php +++ /dev/null @@ -1,154 +0,0 @@ - self::STRING, - 'istring' => self::ISTRING, - 'text' => self::TEXT, - 'itext' => self::ITEXT, - 'int' => self::INT, - 'float' => self::FLOAT, - 'bool' => self::BOOL, - 'lookup' => self::LOOKUP, - 'list' => self::ALIST, - 'hash' => self::HASH, - 'mixed' => self::MIXED - ); - - /** - * Lookup table of types that are string, and can have aliases or - * allowed value lists. - */ - static public $stringTypes = array( - self::STRING => true, - self::ISTRING => true, - self::TEXT => true, - self::ITEXT => true, - ); - - /** - * Validate a variable according to type. Throws - * HTMLPurifier_VarParserException if invalid. - * It may return NULL as a valid type if $allow_null is true. - * - * @param $var Variable to validate - * @param $type Type of variable, see HTMLPurifier_VarParser->types - * @param $allow_null Whether or not to permit null as a value - * @return Validated and type-coerced variable - */ - final public function parse($var, $type, $allow_null = false) { - if (is_string($type)) { - if (!isset(HTMLPurifier_VarParser::$types[$type])) { - throw new HTMLPurifier_VarParserException("Invalid type '$type'"); - } else { - $type = HTMLPurifier_VarParser::$types[$type]; - } - } - $var = $this->parseImplementation($var, $type, $allow_null); - if ($allow_null && $var === null) return null; - // These are basic checks, to make sure nothing horribly wrong - // happened in our implementations. - switch ($type) { - case (self::STRING): - case (self::ISTRING): - case (self::TEXT): - case (self::ITEXT): - if (!is_string($var)) break; - if ($type == self::ISTRING || $type == self::ITEXT) $var = strtolower($var); - return $var; - case (self::INT): - if (!is_int($var)) break; - return $var; - case (self::FLOAT): - if (!is_float($var)) break; - return $var; - case (self::BOOL): - if (!is_bool($var)) break; - return $var; - case (self::LOOKUP): - case (self::ALIST): - case (self::HASH): - if (!is_array($var)) break; - if ($type === self::LOOKUP) { - foreach ($var as $k) if ($k !== true) $this->error('Lookup table contains value other than true'); - } elseif ($type === self::ALIST) { - $keys = array_keys($var); - if (array_keys($keys) !== $keys) $this->error('Indices for list are not uniform'); - } - return $var; - case (self::MIXED): - return $var; - default: - $this->errorInconsistent(get_class($this), $type); - } - $this->errorGeneric($var, $type); - } - - /** - * Actually implements the parsing. Base implementation is to not - * do anything to $var. Subclasses should overload this! - */ - protected function parseImplementation($var, $type, $allow_null) { - return $var; - } - - /** - * Throws an exception. - */ - protected function error($msg) { - throw new HTMLPurifier_VarParserException($msg); - } - - /** - * Throws an inconsistency exception. - * @note This should not ever be called. It would be called if we - * extend the allowed values of HTMLPurifier_VarParser without - * updating subclasses. - */ - protected function errorInconsistent($class, $type) { - throw new HTMLPurifier_Exception("Inconsistency in $class: ".HTMLPurifier_VarParser::getTypeName($type)." not implemented"); - } - - /** - * Generic error for if a type didn't work. - */ - protected function errorGeneric($var, $type) { - $vtype = gettype($var); - $this->error("Expected type ".HTMLPurifier_VarParser::getTypeName($type).", got $vtype"); - } - - static public function getTypeName($type) { - static $lookup; - if (!$lookup) { - // Lazy load the alternative lookup table - $lookup = array_flip(HTMLPurifier_VarParser::$types); - } - if (!isset($lookup[$type])) return 'unknown'; - return $lookup[$type]; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/VarParser/Flexible.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/VarParser/Flexible.php deleted file mode 100644 index dea9f169..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/VarParser/Flexible.php +++ /dev/null @@ -1,103 +0,0 @@ - $j) $var[$i] = trim($j); - if ($type === self::HASH) { - // key:value,key2:value2 - $nvar = array(); - foreach ($var as $keypair) { - $c = explode(':', $keypair, 2); - if (!isset($c[1])) continue; - $nvar[trim($c[0])] = trim($c[1]); - } - $var = $nvar; - } - } - if (!is_array($var)) break; - $keys = array_keys($var); - if ($keys === array_keys($keys)) { - if ($type == self::ALIST) return $var; - elseif ($type == self::LOOKUP) { - $new = array(); - foreach ($var as $key) { - $new[$key] = true; - } - return $new; - } else break; - } - if ($type === self::ALIST) { - trigger_error("Array list did not have consecutive integer indexes", E_USER_WARNING); - return array_values($var); - } - if ($type === self::LOOKUP) { - foreach ($var as $key => $value) { - if ($value !== true) { - trigger_error("Lookup array has non-true value at key '$key'; maybe your input array was not indexed numerically", E_USER_WARNING); - } - $var[$key] = true; - } - } - return $var; - default: - $this->errorInconsistent(__CLASS__, $type); - } - $this->errorGeneric($var, $type); - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/VarParser/Native.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/VarParser/Native.php deleted file mode 100644 index cdd342fa..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/VarParser/Native.php +++ /dev/null @@ -1,26 +0,0 @@ -evalExpression($var); - } - - protected function evalExpression($expr) { - $var = null; - $result = eval("\$var = $expr;"); - if ($result === false) { - throw new HTMLPurifier_VarParserException("Fatal error in evaluated code"); - } - return $var; - } - -} - -// vim: et sw=4 sts=4 diff --git a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/VarParserException.php b/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/VarParserException.php deleted file mode 100644 index fe30cc79..00000000 --- a/3.1/modules/purifier/vendor/HTMLPurifier/HTMLPurifier/VarParserException.php +++ /dev/null @@ -1,11 +0,0 @@ - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - vim: et sw=4 sts=4 diff --git a/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php b/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php deleted file mode 100644 index 63fd066f..00000000 --- a/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_graphics.php +++ /dev/null @@ -1,72 +0,0 @@ - $dims[0]) { - // Too wide, scale it down - list ($new_width, $new_height) = array($dims[0], $dims[0] / $desired_ratio); - } - - if ($new_height > $dims[1]) { - // Too tall, scale it down some more - $new_width = min($dims[0], $dims[1] * $desired_ratio); - $new_height = $new_width / $desired_ratio; - } - $new_width = round($new_width); - $new_height = round($new_height); - - Image::factory($input_file) - ->crop($new_width, $new_height) - ->quality(module::get_var("gallery", "image_quality")) - ->save($output_file); - } -} diff --git a/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_installer.php b/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_installer.php deleted file mode 100644 index ad458683..00000000 --- a/3.1/modules/rectangle_thumbs/helpers/rectangle_thumbs_installer.php +++ /dev/null @@ -1,29 +0,0 @@ -where("state", "!=", 2) - ->count_all(); - if ($count == 0) { - site_status::clear("pending_user_registrations"); - } - list ($form, $errors) = $this->_get_form(); - print $this->_get_admin_view($form, $errors); - } - - public function update() { - access::verify_csrf(); - - $post = new Validation($_POST); - $post->add_rules("policy", "required"); - $post->add_rules("group", array($this, "passthru")); - $post->add_rules("email_verification", array($this, "passthru")); - $group_list = array(); - if ($post->validate()) { - module::set_var("registration", "policy", $post->policy); - module::set_var("registration", "default_group", $post->group); - module::set_var("registration", "email_verification", !empty($post->email_verification)); - - message::success(t("Registration defaults have been updated.")); - - url::redirect("admin/register"); - } else { - list ($form, $errors) = $this->_get_form(); - $form = array_merge($form, $post->as_array()); - $errors = array_merge($errors, $post->errors()); - print $this->_get_admin_view($form, $errors); - } - } - - // We need this validation callback in order to have the optional fields copied to - // validation array. - public function passthru($field) { - return true; - } - - public function activate() { - access::verify_csrf(); - - $post = new Validation($_POST); - $post->add_rules("activate_users", "required"); - $post->add_rules("activate", "alpha_numeric"); - if ($post->validate()) { - $names = array(); - if (!empty($post->activate)) { - foreach ($post->activate as $id) { - $user = register::create_new_user($id); - $names[] = $user->name; - } - - message::success(t("Activated %users.", array("users" => implode(", ", $names)))); - } - - $count = ORM::factory("pending_user") - ->where("state", "!=", 2) - ->count_all(); - - if ($count == 0) { - site_status::clear("pending_user_registrations"); - } - url::redirect("admin/register"); - } - - list ($form, $errors) = $this->_get_form(); - $form = array_merge($form, $post->as_array()); - $errors = array_merge($errors, $post->errors()); - print $this->_get_admin_view($form, $errors); - } - - private function _get_admin_view($form, $errors) { - $v = new Admin_View("admin.html"); - $v->page_title = t("User registration"); - $v->content = new View("admin_register.html"); - $v->content->action = "admin/register/update"; - $v->content->policy_list = - array("admin_only" => t("Only site administrators can create new user accounts."), - "visitor" => - t("Visitors can create accounts and no administrator approval is required."), - "admin_approval" => - t("Visitors can create accounts but administrator approval is required.")); - $admin = identity::admin_user(); - $v->content->disable_email = - empty($admin->email) || $form["policy"] == "admin_only" ? "disabled" : ""; - if (empty($admin->email)) { - module::set_var("registration", "email_verification", false); - } - - $v->content->group_list = array(); - foreach (identity::groups() as $group) { - if ($group->id != identity::everybody()->id && - $group->id != identity::registered_users()->id) { - $v->content->group_list[$group->id] = $group->name; - } - } - $hidden = array("name" => "csrf", "value" => access::csrf_token()); - if (count($v->content->group_list)) { - $v->content->group_list = - array("" => t("Choose the default group")) + $v->content->group_list; - } else { - $hidden["group"] = ""; - } - $v->content->hidden = $hidden; - $v->content->pending = ORM::factory("pending_user")->find_all(); - $v->content->activate = "admin/register/activate"; - $v->content->form = $form; - $v->content->errors = $errors; - return $v; - } - - private function _get_form() { - $form = array("policy" => module::get_var("registration", "policy"), - "group" => module::get_var("registration", "default_group"), - "email_verification" => module::get_var("registration", "email_verification")); - $errors = array_fill_keys(array_keys($form), ""); - - return array($form, $errors); - } -} \ No newline at end of file diff --git a/3.1/modules/register/controllers/register.php b/3.1/modules/register/controllers/register.php deleted file mode 100755 index c3519ce3..00000000 --- a/3.1/modules/register/controllers/register.php +++ /dev/null @@ -1,182 +0,0 @@ -_get_form(); - } - - public function handler() { - access::verify_csrf(); - - $form = $this->_get_form(); - $valid = $form->validate(); - - $name = $form->register_user->inputs["name"]->value; - if (register::check_user_name($name)) { - $form->register_user->inputs["name"]->add_error("in_use", 1); - $valid = false; - } - if ($valid) { - $pending_user = register::create_pending_request($form); - $policy = module::get_var("registration", "policy"); - if ($policy == "visitor") { - if ($pending_user->state == 1) { - $user = register::create_new_user($pending_user->id); - Session::instance()->set("registration_first_usage"); - auth::login($user); - Session::instance()->set("registration_first_usage", true); - $pending_user->delete(); - } else { - $user = register::create_new_user($pending_user->id, true); - message::success(t("A confirmation email has been sent to your email address.")); - } - } else if ($pending_user->state == 1) { - site_status::warning( - t("There are pending user registration. Review now!", - array("url" => html::mark_clean(url::site("admin/register")))), - "pending_user_registrations"); - message::success(t("Your registration request is awaiting administrator approval")); - } else { - register::send_confirmation($pending_user); - message::success(t("A confirmation email has been sent to your email address.")); - } - - json::reply(array("result" => "success")); - } else { - json::reply(array("result" => "error", "html" => (string)$form)); - } - } - - public function confirm($hash) { - $pending_user = ORM::factory("pending_user") - ->where("hash", "=", $hash) - ->where("state", "=", 0) - ->find(); - if ($pending_user->loaded()) { - // @todo add a request date to the pending user table and check that it hasn't expired - $policy = module::get_var("registration", "policy"); - $pending_user->state = 1; - $pending_user->save(); - if ($policy == "vistor") { - $user = register::create_new_user($pending_user->id); - message::success(t("Your registration request has been approved")); - auth::login($user); - Session::instance()->set("registration_first_usage", true); - $pending_user->delete(); - } else { - site_status::warning( - t("There are pending user registration. Review now!", - array("url" => html::mark_clean(url::site("admin/register")))), - "pending_user_registrations"); - message::success(t("Your registration request is awaiting administrator approval")); - } - } else { - message::error(t("Your registration request is no longer valid, Please re-register.")); - } - url::redirect(item::root()->abs_url()); - } - - public function first($hash) { - $pending_user = ORM::factory("pending_user") - ->where("hash", "=", $hash) - ->where("state", "=", 2) - ->find(); - if ($pending_user->loaded()) { - // @todo add a request date to the pending user table and check that it hasn't expired - $user = identity::lookup_user_by_name($pending_user->name); - if (!empty($user)) { - auth::login($user); - Session::instance()->set("registration_first_usage", true); - $pending_user->delete(); - } - url::redirect(item::root()->abs_url()); - } else { - message::warning(t("Your account is ready to use so please login.")); - } - url::redirect(item::root()->abs_url()); - } - - public function welcome_message() { - $user = identity::active_user(); - $password = substr(md5(rand()), 0, 8); - $user->password = $password; - $user->save(); - - $v = new View("register_welcome_message.html"); - $v->user = $user; - $v->password = $password; - print $v; - } - - public function change_password($id, $password) { - $user = user::lookup($id); - print $this->_get_change_password_form($user, $password); - } - - private function _get_form() { - $minimum_length = module::get_var("user", "mininum_password_length", 5); - $form = new Forge("register/handler", "", "post", array("id" => "g-register-form")); - $group = $form->group("register_user")->label(t("Register user")); - $group->input("name")->label(t("Username"))->id("g-username") - ->rules("required|length[1,32]") - ->error_messages("in_use", t("There is already a user with that username")); - $group->input("full_name")->label(t("Full Name"))->id("g-fullname") - ->rules("length[0, 255]"); - $group->input("email")->label(t("Email"))->id("g-email") - ->rules("required|valid_email|length[1,255]"); - $group->input("email2")->label(t("Confirm email"))->id("g-email2") - ->matches($group->email); - $group->input("url")->label(t("URL"))->id("g-url") - ->rules("valid_url"); - - module::event("register_add_form", $form); - module::event("captcha_protect_form", $form); - $group->submit("")->value(t("Register")); - return $form; - } - - /** - * Get the password change form. This code is copied from controllers/users.php. The - * difference is that as this is the first time logging on, the user might not have - * expected that they were going to have to enter the password displayed on the welcome - * page, and didn't make note of it. If we were using the standard change password dialog, the - * user would be screwed as there is no way to go back and get it. So with this dialog, - * we will provide the old password as a hidden field. - */ - private function _get_change_password_form($user, $password) { - $form = new Forge( - "users/change_password/$user->id", "", "post", array("id" => "g-change-password-user-form")); - $group = $form->group("change_password")->label(t("Change your password")); - $group->hidden("old_password")->value($password); - $group->password("password")->label(t("New password"))->id("g-password") - ->error_messages("min_length", t("Your new password is too short")); - $group->script("") - ->text( - '$("form").ready(function(){$(\'input[name="password"]\').user_password_strength();});'); - $group->password("password2")->label(t("Confirm new password"))->id("g-password2") - ->matches($group->password) - ->error_messages("matches", t("The passwords you entered do not match")); - - module::event("user_change_password_form", $user, $form); - $group->submit("")->value(t("Save")); - return $form; - } -} \ No newline at end of file diff --git a/3.1/modules/register/helpers/register.php b/3.1/modules/register/helpers/register.php deleted file mode 100644 index 3dec6783..00000000 --- a/3.1/modules/register/helpers/register.php +++ /dev/null @@ -1,105 +0,0 @@ -where("name", "=", $user_name) - ->find(); - return $user->loaded(); - } - - static function send_user_created_confirmation($user, $requires_first=false) { - $message = new View("register_welcome.html"); - $message->user = $user; - $message->site_url = $requires_first ? url::abs_site("register/first/{$user->hash}") : - url::abs_site(""); - self::_sendemail($user->email, t("Your userid has been created"), $message); - } - - static function send_confirmation($user) { - $message = new View("confirm_registration.html"); - $message->confirm_url = url::abs_site("register/confirm/{$user->hash}"); - $message->user = $user; - self::_sendemail($user->email, t("User registration confirmation"), $message); - } - - static function create_pending_request($form) { - $email_verification = module::get_var("registration", "email_verification"); - - $user = ORM::factory("pending_user"); - $user->name = $form->register_user->inputs["name"]->value; - $user->full_name = $form->register_user->inputs["full_name"]->value; - $user->email = $form->register_user->inputs["email"]->value; - $user->url = $form->register_user->inputs["url"]->value; - $user->request_date = time(); - - if (!$email_verification) { - $user->state = 1; - } - $user->hash = md5(rand()); - $user->save(); - return $user; - } - - static function create_new_user($id) { - $user = ORM::factory("pending_user", $id); - - $password = md5(uniqid(mt_rand(), true)); - $new_user = identity::create_user($user->name, $user->full_name, $password, $user->email); - $new_user->url = $user->url; - $new_user->admin = false; - $new_user->guest = false; - $new_user->save(); - - $user->hash = md5(uniqid(mt_rand(), true)); - $user->state = 2; - $user->save(); - self::send_user_created_confirmation($user, $password); - - return $new_user; - } - - private static function _sendemail($email, $subject, $message) { - Sendmail::factory() - ->to($email) - ->subject($subject) - ->header("Mime-Version", "1.0") - ->header("Content-type", "text/html; charset=iso-8859-1") - ->message($message->render()) - ->send(); - } -} \ No newline at end of file diff --git a/3.1/modules/register/helpers/register_event.php b/3.1/modules/register/helpers/register_event.php deleted file mode 100755 index caba65c0..00000000 --- a/3.1/modules/register/helpers/register_event.php +++ /dev/null @@ -1,38 +0,0 @@ -get("settings_menu") - ->append( Menu::factory("link") - ->id("register_users") - ->label(t("User registration")) - ->url(url::site("admin/register"))); - } - - static function user_menu($menu, $theme) { - $user = identity::active_user(); - if ($user->guest) { - $menu->append(Menu::factory("dialog") - ->id("user_menu_register") - ->css_id("g-register-menu") - ->url(url::site("register")) - ->label(t("Register"))); - } - } -} diff --git a/3.1/modules/register/helpers/register_installer.php b/3.1/modules/register/helpers/register_installer.php deleted file mode 100644 index 7724cf34..00000000 --- a/3.1/modules/register/helpers/register_installer.php +++ /dev/null @@ -1,47 +0,0 @@ -query("CREATE TABLE IF NOT EXISTS {pending_users} ( - `id` int(9) NOT NULL auto_increment, - `name` varchar(32) NOT NULL, - `state` int(9) NOT NULL DEFAULT 0, - `full_name` varchar(255) NOT NULL, - `email` varchar(64) default NULL, - `hash` char(32) default NULL, - `url` varchar(255) default NULL, - `request_date` int(9) not NULL DEFAULT 0, - PRIMARY KEY (`id`), - UNIQUE KEY(`hash`, `state`), - UNIQUE KEY(`name`)) - DEFAULT CHARSET=utf8;"); - - module::set_var("registration", "policy", "admin_only"); - module::set_var("registration", "default_group", ""); - module::set_var("registration", "email_verification", false); - - module::set_version("register", 1); - } - - static function uninstall() { - Database::instance()->query("DROP TABLE IF EXISTS {pending_users};"); - } -} \ No newline at end of file diff --git a/3.1/modules/register/helpers/register_theme.php b/3.1/modules/register/helpers/register_theme.php deleted file mode 100644 index a6d9ebae..00000000 --- a/3.1/modules/register/helpers/register_theme.php +++ /dev/null @@ -1,28 +0,0 @@ -get("registration_first_usage")) { - $session->delete("registration_first_usage"); - return new View("register_welcome_message_loader.html"); - } - } -} \ No newline at end of file diff --git a/3.1/modules/register/models/pending_user.php b/3.1/modules/register/models/pending_user.php deleted file mode 100644 index 6b8b4175..00000000 --- a/3.1/modules/register/models/pending_user.php +++ /dev/null @@ -1,21 +0,0 @@ - - -
            -

            -
            - "post"), $hidden) ?> -
            - -
              - $text): ?> -
            • - - -
            • - -
            • - - -
            • -
            • - - - "group"), $group_list, $form["group"]) ?> - - - -
            • -
            • - "g-registration-admin", "name" => "save", "class" => "submit", "style" => "clear:both!important"), t("Update")) ?> -
            • -
            -
            - -
            - -
            - "post"), $hidden) ?> -
            - - - - - - - - - - - - - "> - - - - - - - - -
            - -
            - state != 2): ?> - id) ?> - -   - - state) ?>name) ?>full_name) ?>email) ?>request_date)) ?>
            - "g-registration-activate", "name" => "activate_users", "class" => "submit"), t("Activate selected")) ?> -
            - -
            - -
            diff --git a/3.1/modules/register/views/confirm_registration.html.php b/3.1/modules/register/views/confirm_registration.html.php deleted file mode 100644 index 51fed168..00000000 --- a/3.1/modules/register/views/confirm_registration.html.php +++ /dev/null @@ -1,17 +0,0 @@ - - - - <?= t("User registration confirmation") ?> - - -

            -

            - $user->full_name ? $user->full_name : $user->name)) ?> -

            -

            - clicking this link. If you didn't request this password reset, it's ok to ignore this mail.", - array("site_url" => html::mark_clean(url::base(false, "http")), - "confirm_url" => $confirm_url)) ?> -

            - - diff --git a/3.1/modules/register/views/register_welcome.html.php b/3.1/modules/register/views/register_welcome.html.php deleted file mode 100644 index b2744641..00000000 --- a/3.1/modules/register/views/register_welcome.html.php +++ /dev/null @@ -1,16 +0,0 @@ - - - - <?= t("Welcome to Gallery3") ?> - - -

            -

            - $user->full_name ? $user->full_name : $user->name)) ?> -

            -

            - You can access the site by clicking this link and you will be prompted to set your password at this point.", - array("site_url" => html::mark_clean($site_url))) ?> -

            - - diff --git a/3.1/modules/register/views/register_welcome_message.html.php b/3.1/modules/register/views/register_welcome_message.html.php deleted file mode 100644 index 76c076cb..00000000 --- a/3.1/modules/register/views/register_welcome_message.html.php +++ /dev/null @@ -1,36 +0,0 @@ - -
            -

            - -

            - -

            -

            - -

            -

            - -

            - %user_name account. We have generated a password for you (%password). You should change your password to something that you'll remember.", array("user_name" => $user->name, "password" => $password)) ?> -

            - -

            - id}/$password") ?>" - title="for_html_attr() ?>" - id="g-after-install-change-password-link" - class="g-button ui-state-default ui-corners-all"> - - - -

            - -

            - Gallery website has news and information about the Gallery project and community.", array("url" => "http://gallery.menalto.com")) ?> -

            - -

            - documentation site or you can ask for help in the forums!", array("codex_url" => "http://codex.gallery2.org/Main_Page", "forum_url" => "http://gallery.menalto.com/forum")) ?> -

            -
            diff --git a/3.1/modules/register/views/register_welcome_message_loader.html.php b/3.1/modules/register/views/register_welcome_message_loader.html.php deleted file mode 100644 index ea3c5504..00000000 --- a/3.1/modules/register/views/register_welcome_message_loader.html.php +++ /dev/null @@ -1,7 +0,0 @@ - -for_html_attr() ?>" - href=""/> - diff --git a/3.1/modules/remote/README b/3.1/modules/remote/README deleted file mode 100644 index 456a2e4c..00000000 --- a/3.1/modules/remote/README +++ /dev/null @@ -1,3 +0,0 @@ -This is a preliminary work. To use it, you need to apply the changes -in the patches directory. It's got limited functionality and is only -the beginning of the effort. diff --git a/3.1/modules/remote/controllers/gallery_remote.php b/3.1/modules/remote/controllers/gallery_remote.php deleted file mode 100644 index 0ef99d4f..00000000 --- a/3.1/modules/remote/controllers/gallery_remote.php +++ /dev/null @@ -1,45 +0,0 @@ -post("cmd")) { - case "login": - print "#__GR2PROTO__\n"; - $uname = $input->post("uname"); - if (empty($uname)) { - print "status=202\n"; - } else { - $user = user::lookup_by_name($uname); - $password = $input->post("password"); - if ($user && user::is_correct_password($user, $password)) { - print "status=0\n"; - user::login($user); - } else { - print "status=201\n"; - } - } - print "server_version=2.15\n"; - } - } -} diff --git a/3.1/modules/remote/helpers/gallery_remote.php b/3.1/modules/remote/helpers/gallery_remote.php deleted file mode 100644 index 2f189a2c..00000000 --- a/3.1/modules/remote/helpers/gallery_remote.php +++ /dev/null @@ -1,38 +0,0 @@ -status = $status; - return $reply; - } - - /** - * Set a property on this reply - * @chainable - */ - public static function set($key, $value) { - $this->$key = $value; - return $this; - } -} diff --git a/3.1/modules/remote/module.info b/3.1/modules/remote/module.info deleted file mode 100644 index 89b1d177..00000000 --- a/3.1/modules/remote/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Gallery Remote" -description = "Use Gallery Remote and other similar applications to control your Gallery" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:remote" -discuss_url = "http://gallery.menalto.com/forum_module_remote" diff --git a/3.1/modules/remote/patches/cookie.patch b/3.1/modules/remote/patches/cookie.patch deleted file mode 100644 index 95b16f69..00000000 --- a/3.1/modules/remote/patches/cookie.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/system/helpers/cookie.php b/system/helpers/cookie.php -index 901b6d8..df276ee 100644 ---- a/system/helpers/cookie.php -+++ b/system/helpers/cookie.php -@@ -45,7 +45,7 @@ class cookie_Core { - // Expiration timestamp - $expire = ($expire == 0) ? 0 : time() + (int) $expire; - -- return setcookie($name, $value, $expire, $path, $domain, $secure, $httponly); -+ return setcookie($name, $value, $expire, $path, $domain, $secure, 0); - } - - /** diff --git a/3.1/modules/remote/patches/gallery_remote2.php b/3.1/modules/remote/patches/gallery_remote2.php deleted file mode 100644 index db39124b..00000000 --- a/3.1/modules/remote/patches/gallery_remote2.php +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/3.1/modules/remote/patches/htaccess.patch b/3.1/modules/remote/patches/htaccess.patch deleted file mode 100644 index b2b33617..00000000 --- a/3.1/modules/remote/patches/htaccess.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/.htaccess b/.htaccess -index 1d8bcb3..8229928 100644 ---- a/.htaccess -+++ b/.htaccess -@@ -56,3 +56,10 @@ - # RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L] - # RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L] - # -+ -+# URL rewriting for Gallery Remote -+# -+# RewriteEngine On -+# RewriteBase /~bharat/gallery3/ -+# RewriteRule ^gallery_remote2.php$ index.php?kohana_uri=/remote [QSA,PT,L] -+# diff --git a/3.1/modules/rwinfo/helpers/rwinfo_block.php b/3.1/modules/rwinfo/helpers/rwinfo_block.php deleted file mode 100644 index 378d7a84..00000000 --- a/3.1/modules/rwinfo/helpers/rwinfo_block.php +++ /dev/null @@ -1,118 +0,0 @@ - t("rWInfo")); - } - - static function get($block_id, $theme) { - $block = ""; - switch ($block_id) { - case "metadata": - if ($theme->item()) { - // rWatcher Edit: Don't display on root album. - if ($theme->item->id == 1) { - return ""; - } - // End rWatcher Edit - - $block = new Block(); - $block->css_id = "g-metadata"; - - // rWatcher Edit: Add Movie Info Option - //$block->title = $theme->item()->is_album() ? t("Album info") : t("Photo info"); - $block_title = ""; - if ($theme->item->is_album()) { - $block_title = t("Album Info"); - } else if ($theme->item->is_movie()) { - $block_title = t("Movie Info"); - } else { - $block_title = t("Photo Info"); - } - $block->title = $block_title; - // End rWatcher Edit - - // rWatcher Edit: File Name change. - $block->content = new View("rwinfo_block.html"); - - if ($theme->item->title && module::get_var("rwinfo", "show_title")) { - $info["title"] = array( - "label" => t("Title:"), - "value" => html::purify($theme->item->title) - ); - } - if ($theme->item->description && module::get_var("rwinfo", "show_description")) { - $info["description"] = array( - "label" => t("Description:"), - "value" => nl2br(html::purify($theme->item->description)) - ); - } - if (!$theme->item->is_album() && module::get_var("rwinfo", "show_name")) { - $info["file_name"] = array( - "label" => t("File name:"), - "value" => html::clean($theme->item->name) - ); - } - - // rWatcher Edit: - //if ($theme->item->captured && module::get_var("rwinfo", "show_captured")) { - // $info["captured"] = array( - // "label" => t("Captured:"), - // "value" => gallery::date_time($theme->item->captured) - // ); - //} - if ($theme->item->is_album() && $theme->item->created && module::get_var("rwinfo", "show_captured")) { - $info["captured"] = array( - "label" => t("Date:"), - "value" => gallery::date($theme->item->created) - ); - } - if (!$theme->item->is_album() && $theme->item->created && module::get_var("rwinfo", "show_captured")) { - $info["captured"] = array( - "label" => t("Date:"), - "value" => gallery::date_time($theme->item->captured) - ); - } - // End rWatcher Edit - - if ($theme->item->owner && module::get_var("rwinfo", "show_owner")) { - $display_name = $theme->item->owner->display_name(); - if ($theme->item->owner->url) { - $info["owner"] = array( - "label" => t("Owner:"), - "value" => "item->owner->url}\">" . - html::clean($display_name) . "" - ); - } else { - $info["owner"] = array( - "label" => t("Owner:"), - "value" => html::clean($display_name) - ); - } - } - $block->content->metadata = $info; - - module::event("info_block_get_metadata", $block, $theme->item); - } - break; - } - return $block; - } -} \ No newline at end of file diff --git a/3.1/modules/rwinfo/helpers/rwinfo_installer.php b/3.1/modules/rwinfo/helpers/rwinfo_installer.php deleted file mode 100644 index ca8b429d..00000000 --- a/3.1/modules/rwinfo/helpers/rwinfo_installer.php +++ /dev/null @@ -1,41 +0,0 @@ -view_count) { - $results .= "
          • "; - $results .= t("Views: %view_count", array("view_count" => $item->view_count)); - $results .= "
          • "; - } - - // rWatcher Edit: Display Tags on Thumbnails - if (module::is_active("tag")) { - $tags = ORM::factory("tag") - ->join("items_tags", "tags.id", "items_tags.tag_id") - ->where("items_tags.item_id", "=", $item->id) - ->find_all(); - if (count($tags) > 0) { - $results .= "
          • "; - $results .= t("Tags:") . " "; - $anchors = array(); - foreach ($tags as $tag) { - $anchors[] = "" . html::clean($tag->name) . ""; - } - $results .= join(", ", $anchors) . "
          • "; - } - } - // rWatcher End Edit - - if ($item->owner) { - $results .= "
          • "; - if ($item->owner->url) { - $results .= t("By: %owner_name", - array("owner_name" => $item->owner->display_name(), - "owner_url" => $item->owner->url)); - } else { - $results .= t("By: %owner_name", array("owner_name" => $item->owner->display_name())); - } - $results .= "
          • "; - } - return $results; - } -} \ No newline at end of file diff --git a/3.1/modules/rwinfo/module.info b/3.1/modules/rwinfo/module.info deleted file mode 100644 index c0f2250b..00000000 --- a/3.1/modules/rwinfo/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "rWInfo" -description = "Display extra information about photos and albums" -version = 2 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:rwinfo" -discuss_url = "http://gallery.menalto.com/forum_module_rwinfo" diff --git a/3.1/modules/rwinfo/notes.txt b/3.1/modules/rwinfo/notes.txt deleted file mode 100644 index 5085b0d1..00000000 --- a/3.1/modules/rwinfo/notes.txt +++ /dev/null @@ -1,10 +0,0 @@ -Turn Title and Description off by Default in the installer.(they're displayed elsewhere in the default theme, no reason to show them twice on the same page) -Hide the info sidebar for the root album (without title and description there really isn't anything worth displaying here) -Display tags when mousing over the thumbnails (if tags module is active). -Display "Movie Info" on movies instead of "Photo Info" like the Gallery Info module does. -Changed block name on sidebar to rWInfo, to make it stick out more (helpers\rwinfo_block.php -> return array("metadata" => t("rWInfo")); -Change label for "captured" to "Date", display "created" for albums, "captured" for everything else. -Use gallery::date for formating the albums Date, and gallery::date_time for everything else. (I only want to see the Date an album was created, the time doesn't matter). -Change all occurences of get_var("info" to get_var("rwinfo" to avoid conflicts with the original info module. - - diff --git a/3.1/modules/rwinfo/views/rwinfo_block.html.php b/3.1/modules/rwinfo/views/rwinfo_block.html.php deleted file mode 100644 index b296fa1d..00000000 --- a/3.1/modules/rwinfo/views/rwinfo_block.html.php +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/3.1/modules/scheduler/config/routes.php b/3.1/modules/scheduler/config/routes.php deleted file mode 100644 index 2cda2992..00000000 --- a/3.1/modules/scheduler/config/routes.php +++ /dev/null @@ -1,22 +0,0 @@ -update("tasks") - ->set("state", "stalled") - ->where("done", "=", 0) - ->where("state", "<>", "stalled") - ->where(new Database_Expression("UNIX_TIMESTAMP(NOW()) - `updated` > 15")) - ->execute(); - $stalled_count = $query->count(); - if ($stalled_count) { - log::warning("tasks", - t2("One task is stalled", - "%count tasks are stalled", - $stalled_count), - t('view', - array("url" => html::mark_clean(url::site("admin/maintenance"))))); - } - - $view = new Admin_View("admin.html"); - $view->page_title = t("Maintenance tasks"); - $view->content = new View("admin_schedule.html"); - $view->content->task_definitions = task::get_definitions(); - $view->content->running_tasks = ORM::factory("task") - ->where("done", "=", 0)->order_by("updated", "DESC")->find_all(); - $view->content->finished_tasks = ORM::factory("task") - ->where("done", "=", 1)->order_by("updated", "DESC")->find_all(); - $view->content->schedule_definitions = scheduler::get_definitions(); - print $view; - } - - public function form_add($task_callback) { - access::verify_csrf(); - - $schedule = ORM::factory("schedule"); - $schedule->task_callback = $task_callback; - $schedule->next_run_datetime = time(); - $v = new View("admin_schedule_form.html"); - $v->form = scheduler::get_form("define", $schedule); - $v->method = "define"; - print $v; - } - - public function form_edit($id) { - access::verify_csrf(); - - $schedule = ORM::factory("schedule", $id); - $v = new View("admin_schedule_form.html"); - $v->form = scheduler::get_form("update", $schedule); - $v->method = "update"; - print $v; - } - - public function remove_form($id) { - access::verify_csrf(); - - $schedule = ORM::factory("schedule", $id); - - $v = new View("admin_schedule_confirm.html"); - $v->name = $schedule->name; - $v->form = new Forge("admin/schedule/remove_event/{$id}", "", "post", - array("id" => "g-remove-schedule")); - $group = $v->form->group("remove"); - $group->submit("")->value(t("Continue")); - print $v; - } - - public function remove_event($id) { - access::verify_csrf(); - $schedule = ORM::factory("schedule", $id); - $schedule->delete(); - - message::success(t("Removed scheduled task: %name", array("name" => $schedule->name))); - json::reply(array("result" => "success", "reload" => 1)); - } - - public function define() { - $this->_handle_request("define"); - } - - public function update($id=null) { - $this->_handle_request("update", $id); - } - - private function _handle_request($method, $id=null) { - $schedule = ORM::factory("schedule", $id); - $form = scheduler::get_form($method, $schedule); - $valid = $form->validate(); - if ($valid) { - $schedule->name = $form->schedule_group->schedule_name->value; - $schedule->interval = $form->schedule_group->interval->value; - $schedule->next_run_datetime = - $this->_start_date($form->schedule_group->run_date->dow->selected, - $form->schedule_group->run_date->time->value); - $schedule->task_callback = $form->schedule_group->callback->value; - $schedule->save(); - if ($method == "define") { - message::success(t("Added scheduled task: %name", array("name" => $schedule->name))); - } else { - message::success(t("Updated scheduled task: %name", array("name" => $schedule->name))); - } - json::reply(array("result" => "success", "reload" => 1)); - } else { - json::reply(array("result" => "error", "html" => (string)$form)); - } - } - - private function _start_date($dow, $time) { - list ($hour, $minutes) = explode(":", $time); - $local_time = localtime(); - $days = ($dow < $local_time[6] ? 7 : 0) + $dow - $local_time[6]; - return - mktime($hour, $minutes, 0, $local_time[4] + 1, $local_time[3] + $days, 1900 + $local_time[5]); - } -} diff --git a/3.1/modules/scheduler/helpers/scheduler.php b/3.1/modules/scheduler/helpers/scheduler.php deleted file mode 100644 index 1d248e22..00000000 --- a/3.1/modules/scheduler/helpers/scheduler.php +++ /dev/null @@ -1,129 +0,0 @@ - t("Hourly"), "86400" => t("Daily"), - "604800" => t("Weekly"), "2419200" => t("Monthly")); - } - return $intervals; - } - - static function get_form($method, $schedule) { - if ($method == "define") { - $title = t("Create a scheduled event"); - $button_text = t("Create"); - } else { - $title = t("Update a scheduled event"); - $button_text = t("Update"); - } - - $id = empty($schedule->id) ? "" : "/$schedule->id"; - $form = new Forge("admin/schedule/$method{$id}", "", "post", - array("id" => "g-{$method}-schedule")); - $group = $form->group("schedule_group")->label($title); - $group->input("schedule_name") - ->label(t("Description")) - ->id("g-schedule-name") - ->rules("required|length[0, 128]") - ->error_messages("required", t("You must provide a description")) - ->error_messages("length", t("Your description is too long")) - ->value(!empty($schedule->name) ? $schedule->name : ""); - - list ($dow, $display_time) = scheduler::format_time($schedule->next_run_datetime); - $next = $group->group("run_date")->label(t("Scheduled Date")); - $next->dropdown("dow") - ->label(t("Day")) - ->id("g-schedule-day") - ->rules("required") - ->options(array(t("Sunday"), t("Monday"), t("Tuesday"), t("Wednesday"), - t("Thursday"), t("Friday"), t("Saturday"))) - ->selected($dow); - - $next->input("time") - ->label(t("Hour")) - ->id("g-schedule-time") - ->rules("required") - ->error_messages("required", t("You must provide a time")) - ->error_messages("time_invalid", t("Invalid time")) - ->callback("scheduler::valid_time") - ->value($display_time); - - // need to set the top padding to zero on g-define-schedule li.g-error - $group->dropdown("interval")->label(t("How often"))->id("g-schedule-frequency") - ->options(scheduler::intervals()) - ->rules("required") - ->error_messages("required", t("You must provide an interval")) - ->selected(!empty($schedule->interval) ? $schedule->interval : "2419200"); - $group->hidden("callback")->value($schedule->task_callback); - $group->submit("")->value($button_text); - - return $form; - } - - static function format_time($time) { - $local_time = localtime($time); - $display_time = str_pad($local_time[2], 2, "0", STR_PAD_LEFT) . ":" . - str_pad($local_time[1], 2, "0", STR_PAD_LEFT); - return array($local_time[6], $display_time); - } - - static function valid_time($field) { - if (preg_match("/([0-9]{1,2}):([0-9]{2})/", $field->value, $matches)) { - $hour = (int)$matches[1]; - $minutes = (int)$matches[2]; - if (!(0 <= $hour && $hour<= 23 || 0 <= $minutes && $minutes <= 59)) { - $field->add_error("time_invalid", 1); - } - } else { - $field->add_error("time_invalid", 1); - } - } - - static function get_definitions() { - $schedule_definitions = array(); - $events = ORM::factory("schedule") - ->order_by("next_run_datetime", "asc") - ->find_all(); - if ($events->count()) { - foreach ($events as $schedule) { - $run_date = strftime("%A, %b %e, %Y %H:%M ", $schedule->next_run_datetime); - $intervals = scheduler::intervals(); - $interval = $intervals[$schedule->interval]; - if (!empty($schedule->task_id)) { - $status = t("Running"); - } else if ($schedule->next_run_datetime < time()) { - $status = t("Overdue"); - } else { - $status = t("Scheduled"); - } - - $schedule_definitions[] = (object)array("id" => $schedule->id, - "name" => $schedule->name, - "run_date" => $run_date, - "interval" => $interval, - "status" => $status); - } - } - return $schedule_definitions; - } -} \ No newline at end of file diff --git a/3.1/modules/scheduler/helpers/scheduler_event.php b/3.1/modules/scheduler/helpers/scheduler_event.php deleted file mode 100644 index 69f9f76d..00000000 --- a/3.1/modules/scheduler/helpers/scheduler_event.php +++ /dev/null @@ -1,68 +0,0 @@ -get("maintenance") - ->url(url::site("admin/schedule")); - } - - /** - * At this point, the output has been sent to the browser, so we can take some time - * to run a schedule task. - */ - static function gallery_shutdown() { - try { - $schedule = ORM::factory("schedule") - ->where("next_run_datetime", "<=", time()) - ->where("busy", "!=", 1) - ->order_by("next_run_datetime") - ->find_all(1); - - if ($schedule->count()) { - $schedule = $schedule->current(); - $schedule->busy = true; - $schedule->save(); - - try { - if (empty($schedule->task_id)) { - $task = task::start($schedule->task_callback); - $schedule->task_id = $task->id; - } - - $task = task::run($schedule->task_id); - - if ($task->done) { - $schedule->next_run_datetime += $schedule->interval; - $schedule->task_id = null; - } - - $schedule->busy = false; - $schedule->save(); - } catch (Exception $e) { - $schedule->busy = false; - $schedule->save(); - throw $e; - } - } - } catch (Exception $e) { - Kohana_Log::add("error", (string)$e); - } - } -} diff --git a/3.1/modules/scheduler/helpers/scheduler_installer.php b/3.1/modules/scheduler/helpers/scheduler_installer.php deleted file mode 100644 index 006d30b3..00000000 --- a/3.1/modules/scheduler/helpers/scheduler_installer.php +++ /dev/null @@ -1,42 +0,0 @@ -query("CREATE TABLE {schedules} ( - `id` int(9) NOT NULL auto_increment, - `name` varchar(128) NOT NULL, - `task_callback` varchar(128) NOT NULL, - `task_id` int(9) NULL, - `next_run_datetime` int(9) NOT NULL, - `interval` int(9) NOT NULL, - `busy` bool NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - KEY `run_date` (`next_run_datetime`, `busy`), - UNIQUE KEY (`name`)) - DEFAULT CHARSET=utf8;"); - module::set_version("scheduler", $version = 1); - } - - static function uninstall() { - $db = Database::instance(); - $db->query("DROP TABLE IF EXISTS {schedules}"); - } -} diff --git a/3.1/modules/scheduler/models/schedule.php b/3.1/modules/scheduler/models/schedule.php deleted file mode 100644 index 78f32502..00000000 --- a/3.1/modules/scheduler/models/schedule.php +++ /dev/null @@ -1,33 +0,0 @@ -join("schedules_tasks", "task.id", "schedules_tasks.task_id") - ->where("schedule_id", "=", $this->id) - ->find_all(); - } - - public function add_task($task) { - db::build() - ->insert("schedules_tasks", array("schedule_id" => $this->id,"task_id" => $task->id)) - ->execute(); - } -} diff --git a/3.1/modules/scheduler/module.info b/3.1/modules/scheduler/module.info deleted file mode 100644 index 8d5c9f5e..00000000 --- a/3.1/modules/scheduler/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Scheduler" -description = "Schedule tasks to run at specific times and intervals" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:scheduler" -discuss_url = "http://gallery.menalto.com/forum_module_scheduler" diff --git a/3.1/modules/scheduler/views/admin_schedule.html.php b/3.1/modules/scheduler/views/admin_schedule.html.php deleted file mode 100644 index 2058ea71..00000000 --- a/3.1/modules/scheduler/views/admin_schedule.html.php +++ /dev/null @@ -1,236 +0,0 @@ - -
            -

            -

            - -

            - -
            - - - 0): ?> - - - - count()): ?> -
            -

            - - - - - - - - - - - state == "stalled" ? "g-warning" : "" ?>"> - - - - - - - - -
            - - - - - - - - - - - " - class="g-button g-right ui-icon-left ui-state-default ui-corner-all"> - - -
            "> - updated) ?> - - name ?> - - done): ?> - state == "cancelled"): ?> - - - - state == "stalled"): ?> - - - $task->percent_complete)) ?> - - - status ?> - - owner()->name) ?> - - id?csrf=$csrf") ?>" - class="g-button g-right ui-icon-left ui-state-default ui-corner-all"> - - - state == "stalled"): ?> - id?csrf=$csrf") ?>"> - - - -
            -
            - - - count()): ?> -
            - " - class="g-button g-right ui-icon-left ui-state-default ui-corner-all"> - -

            - - - - - - - - - - - state == "success" ? "g-success" : "g-error" ?>"> - - - - - - - - -
            - - - - - - - - - - - -
            "> - updated) ?> - - name ?> - - state == "success"): ?> - - state == "error"): ?> - - state == "cancelled"): ?> - - - - status ?> - - owner()->name) ?> - - done): ?> - id?csrf=$csrf") ?>" class="g-button ui-state-default ui-corner-all"> - - - get_log()): ?> - id?csrf=$csrf") ?>" class="g-dialog-link g-button ui-state-default ui-corner-all"> - - - - - id?csrf=$csrf") ?>" class="g-dialog-link g-button" ui-state-default ui-corner-all> - - - id?csrf=$csrf") ?>" class="g-button ui-state-default ui-corner-all"> - - - - -
            -
            - -
            -
            diff --git a/3.1/modules/scheduler/views/admin_schedule_confirm.html.php b/3.1/modules/scheduler/views/admin_schedule_confirm.html.php deleted file mode 100644 index 5d09654d..00000000 --- a/3.1/modules/scheduler/views/admin_schedule_confirm.html.php +++ /dev/null @@ -1,4 +0,0 @@ - -

            -

            $name)) ?>

            - diff --git a/3.1/modules/scheduler/views/admin_schedule_form.html.php b/3.1/modules/scheduler/views/admin_schedule_form.html.php deleted file mode 100644 index 3d45dc53..00000000 --- a/3.1/modules/scheduler/views/admin_schedule_form.html.php +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/3.1/modules/scheduler/views/scheduler_definitions.html.php b/3.1/modules/scheduler/views/scheduler_definitions.html.php deleted file mode 100644 index 0ab46f2b..00000000 --- a/3.1/modules/scheduler/views/scheduler_definitions.html.php +++ /dev/null @@ -1,49 +0,0 @@ - - diff --git a/3.1/modules/sharephoto/controllers/admin_sharephoto.php b/3.1/modules/sharephoto/controllers/admin_sharephoto.php deleted file mode 100644 index d8c01022..00000000 --- a/3.1/modules/sharephoto/controllers/admin_sharephoto.php +++ /dev/null @@ -1,82 +0,0 @@ -content = new View("admin_sharephoto.html"); - $view->content->sharephoto_form = $this->_get_admin_form(); - print $view; - } - - public function saveprefs() { - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - $form = $this->_get_admin_form(); - - // Figure out which boxes where checked - $shareOpts_array = Input::instance()->post("ShareOptions"); - - $IconsButton = false; - $HTMLLinksButton = false; - - for ($i = 0; $i < count($shareOpts_array); $i++) { - if ($shareOpts_array[$i] == "Icons") { - $IconsButton = true; - } - if ($shareOpts_array[$i] == "HTMLLinks") { - $HTMLLinksButton = true; - } - } - - // Save Settings. - module::set_var("sharephoto", "Icons", $IconsButton); - module::set_var("sharephoto", "HTMLLinks", $HTMLLinksButton); - message::success(t("Your Selection Has Been Saved.")); - - // Load Admin page. - $view = new Admin_View("admin.html"); - $view->content = new View("admin_sharephoto.html"); - $view->content->sharephoto_form = $form; - print $view; - } - - private function _get_admin_form() { - // New Form. - $form = new Forge("admin/sharephoto/saveprefs", "", "post", - array("id" => "g-sharephoto-adminForm")); - - // Select what to show on the Photo page. - $shareTypes["Icons"] = array(t("Show Icons   "), module::get_var("sharephoto", "Icons")); - $shareTypes["HTMLLinks"] = array(t("Show HTML Links"), module::get_var("sharephoto", "HTMLLinks")); - - // Checkboxes - $add_links = $form->group("SharePhoto"); - $add_links->checklist("ShareOptions") - ->options($shareTypes); - - // Save button - $add_links->submit("SaveSettings")->value(t("Save")); - - // Return the newly generated form. - return $form; - } -} \ No newline at end of file diff --git a/3.1/modules/sharephoto/css/sharephoto.css b/3.1/modules/sharephoto/css/sharephoto.css deleted file mode 100644 index 704b32f8..00000000 --- a/3.1/modules/sharephoto/css/sharephoto.css +++ /dev/null @@ -1,65 +0,0 @@ -#g-sharephoto-links { - font-size: 15px; - margin-top: 55px; -} - -#g-sharephoto-links-position { - margin-bottom: 7px; - border-bottom: 1px solid #B6B6B6; - font-weight: bold; - margin-left: 10px; - margin-right: 10px; -} - -#g-sharephoto-links-small { - font-size:11px; - color:gray; -} - -#dock { - position: relative; - bottom: 0; - font: 13px; -} - -.dock-container { - position: relative; - height: 80px; - padding: 10px; -} - -.dock-contaner-left { - width: 15px; - height: 32px; - position: absolute; - bottom: 0; - left: -15px; -} - -.dock-container .custom_images a { - display: block; - width: 50px; - position: absolute; - bottom: 0; - text-align: center; - text-decoration: none; - color: #333; - cursor: pointer; -} - -.dock-container .custom_images span { - background: rgba(0,0,0,.75); - display: none; - padding: 2px 8px; - margin-left: 17px; - font-size: 11px; - color: #fff; - -moz-border-radius: 10px; - -webkit-border-radius: 10px; -} - -.dock-container .custom_images img { - border: 0; - margin: 5px 5px 0px; - width: 100%; -} diff --git a/3.1/modules/sharephoto/helpers/sharephoto_event.php b/3.1/modules/sharephoto/helpers/sharephoto_event.php deleted file mode 100644 index 0a65ce72..00000000 --- a/3.1/modules/sharephoto/helpers/sharephoto_event.php +++ /dev/null @@ -1,28 +0,0 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("sharephoto") - ->label(t("SharePhoto")) - ->url(url::site("admin/sharephoto"))); - } -} diff --git a/3.1/modules/sharephoto/helpers/sharephoto_theme.php b/3.1/modules/sharephoto/helpers/sharephoto_theme.php deleted file mode 100644 index 035470d7..00000000 --- a/3.1/modules/sharephoto/helpers/sharephoto_theme.php +++ /dev/null @@ -1,38 +0,0 @@ -css("sharephoto.css") - . $theme->script("sharephoto.js"); - } - - - static function photo_bottom($theme) { - $block = new Block; - $block->css_id = "g-sharephoto"; - $block->title = t("Share Photo"); - $block->anchor = "sharephoto"; - - $view = new View("sharephoto.html"); - - $block->content = $view; - return $block; - } -} \ No newline at end of file diff --git a/3.1/modules/sharephoto/images/addthis.png b/3.1/modules/sharephoto/images/addthis.png deleted file mode 100644 index de62f9a9..00000000 Binary files a/3.1/modules/sharephoto/images/addthis.png and /dev/null differ diff --git a/3.1/modules/sharephoto/images/addthis_64.png b/3.1/modules/sharephoto/images/addthis_64.png deleted file mode 100644 index 0e781de2..00000000 Binary files a/3.1/modules/sharephoto/images/addthis_64.png and /dev/null differ diff --git a/3.1/modules/sharephoto/images/btn-overlay.png b/3.1/modules/sharephoto/images/btn-overlay.png deleted file mode 100644 index 222cdc91..00000000 Binary files a/3.1/modules/sharephoto/images/btn-overlay.png and /dev/null differ diff --git a/3.1/modules/sharephoto/images/delicious.png b/3.1/modules/sharephoto/images/delicious.png deleted file mode 100644 index 836e7f60..00000000 Binary files a/3.1/modules/sharephoto/images/delicious.png and /dev/null differ diff --git a/3.1/modules/sharephoto/images/facebook.png b/3.1/modules/sharephoto/images/facebook.png deleted file mode 100644 index abac0e7a..00000000 Binary files a/3.1/modules/sharephoto/images/facebook.png and /dev/null differ diff --git a/3.1/modules/sharephoto/images/facebook_64.png b/3.1/modules/sharephoto/images/facebook_64.png deleted file mode 100644 index e038baea..00000000 Binary files a/3.1/modules/sharephoto/images/facebook_64.png and /dev/null differ diff --git a/3.1/modules/sharephoto/images/icon-addthis.gif b/3.1/modules/sharephoto/images/icon-addthis.gif deleted file mode 100644 index a0d56c8d..00000000 Binary files a/3.1/modules/sharephoto/images/icon-addthis.gif and /dev/null differ diff --git a/3.1/modules/sharephoto/images/myspace.png b/3.1/modules/sharephoto/images/myspace.png deleted file mode 100644 index af21eb02..00000000 Binary files a/3.1/modules/sharephoto/images/myspace.png and /dev/null differ diff --git a/3.1/modules/sharephoto/images/stumbleupon.png b/3.1/modules/sharephoto/images/stumbleupon.png deleted file mode 100644 index d0f47362..00000000 Binary files a/3.1/modules/sharephoto/images/stumbleupon.png and /dev/null differ diff --git a/3.1/modules/sharephoto/images/twitter.png b/3.1/modules/sharephoto/images/twitter.png deleted file mode 100644 index 48e47271..00000000 Binary files a/3.1/modules/sharephoto/images/twitter.png and /dev/null differ diff --git a/3.1/modules/sharephoto/js/fisheye-iutil.min.js b/3.1/modules/sharephoto/js/fisheye-iutil.min.js deleted file mode 100644 index 30e09037..00000000 --- a/3.1/modules/sharephoto/js/fisheye-iutil.min.js +++ /dev/null @@ -1,82 +0,0 @@ -/** -* Interface Elements for jQuery -* Fisheye menu -* -* http://interface.eyecon.ro -* -* Copyright 2006 Stefan Petre -* Dual licensed under the MIT (MIT-LICENSE.txt) -* and GPL (GPL-LICENSE.txt) licenses. -* -*/ - -jQuery.iFisheye={build:function(options) -{return this.each(function() -{var el=this;el.fisheyeCfg={items:jQuery(options.items,this),container:jQuery(options.container,this),pos:jQuery.iUtil.getPosition(this),itemWidth:options.itemWidth,itemsText:options.itemsText,proximity:options.proximity,valign:options.valign,halign:options.halign,maxWidth:options.maxWidth};jQuery.iFisheye.positionContainer(el,0);jQuery(window).bind('resize',function() -{el.fisheyeCfg.pos=jQuery.iUtil.getPosition(el);jQuery.iFisheye.positionContainer(el,0);jQuery.iFisheye.positionItems(el);});jQuery.iFisheye.positionItems(el);el.fisheyeCfg.items.bind('mouseover',function() -{jQuery(el.fisheyeCfg.itemsText,this).get(0).style.display='block';}).bind('mouseout',function() -{jQuery(el.fisheyeCfg.itemsText,this).get(0).style.display='none';});jQuery(document).bind('mousemove',function(e) -{var pointer=jQuery.iUtil.getPointer(e);var toAdd=0;if(el.fisheyeCfg.halign&&el.fisheyeCfg.halign=='center') -var posx=pointer.x-el.fisheyeCfg.pos.x-(el.offsetWidth-el.fisheyeCfg.itemWidth*el.fisheyeCfg.items.size())/2-el.fisheyeCfg.itemWidth/2;else if(el.fisheyeCfg.halign&&el.fisheyeCfg.halign=='right') -var posx=pointer.x-el.fisheyeCfg.pos.x-el.offsetWidth+el.fisheyeCfg.itemWidth*el.fisheyeCfg.items.size();else -var posx=pointer.x-el.fisheyeCfg.pos.x;var posy=Math.pow(pointer.y-el.fisheyeCfg.pos.y-el.offsetHeight/2,2);el.fisheyeCfg.items.each(function(nr) -{distance=Math.sqrt(Math.pow(posx-nr*el.fisheyeCfg.itemWidth,2) -+posy);distance-=el.fisheyeCfg.itemWidth/2;distance=distance<0?0:distance;distance=distance>el.fisheyeCfg.proximity?el.fisheyeCfg.proximity:distance;distance=el.fisheyeCfg.proximity-distance;extraWidth=el.fisheyeCfg.maxWidth*distance/el.fisheyeCfg.proximity;this.style.width=el.fisheyeCfg.itemWidth+extraWidth+'px';this.style.left=el.fisheyeCfg.itemWidth*nr+toAdd+'px';toAdd+=extraWidth;});jQuery.iFisheye.positionContainer(el,toAdd);});})},positionContainer:function(el,toAdd) -{if(el.fisheyeCfg.halign) -if(el.fisheyeCfg.halign=='center') -el.fisheyeCfg.container.get(0).style.left=(el.offsetWidth-el.fisheyeCfg.itemWidth*el.fisheyeCfg.items.size())/2-toAdd/2+'px';else if(el.fisheyeCfg.halign=='left') -el.fisheyeCfg.container.get(0).style.left=-toAdd/el.fisheyeCfg.items.size()+'px';else if(el.fisheyeCfg.halign=='right') -el.fisheyeCfg.container.get(0).style.left=(el.offsetWidth-el.fisheyeCfg.itemWidth*el.fisheyeCfg.items.size())-toAdd/2+'px';el.fisheyeCfg.container.get(0).style.width=el.fisheyeCfg.itemWidth*el.fisheyeCfg.items.size()+toAdd+'px';},positionItems:function(el) -{el.fisheyeCfg.items.each(function(nr) -{this.style.width=el.fisheyeCfg.itemWidth+'px';this.style.left=el.fisheyeCfg.itemWidth*nr+'px';});}};jQuery.fn.Fisheye=jQuery.iFisheye.build;jQuery.iUtil={getPosition:function(e) -{var x=0;var y=0;var es=e.style;var restoreStyles=false;if(jQuery(e).css('display')=='none'){var oldVisibility=es.visibility;var oldPosition=es.position;restoreStyles=true;es.visibility='hidden';es.display='block';es.position='absolute';} -var el=e;while(el){x+=el.offsetLeft+(el.currentStyle&&!jQuery.browser.opera?parseInt(el.currentStyle.borderLeftWidth)||0:0);y+=el.offsetTop+(el.currentStyle&&!jQuery.browser.opera?parseInt(el.currentStyle.borderTopWidth)||0:0);el=el.offsetParent;} -el=e;while(el&&el.tagName&&el.tagName.toLowerCase()!='body') -{x-=el.scrollLeft||0;y-=el.scrollTop||0;el=el.parentNode;} -if(restoreStyles==true){es.display='none';es.position=oldPosition;es.visibility=oldVisibility;} -return{x:x,y:y};},getPositionLite:function(el) -{var x=0,y=0;while(el){x+=el.offsetLeft||0;y+=el.offsetTop||0;el=el.offsetParent;} -return{x:x,y:y};},getSize:function(e) -{var w=jQuery.css(e,'width');var h=jQuery.css(e,'height');var wb=0;var hb=0;var es=e.style;if(jQuery(e).css('display')!='none'){wb=e.offsetWidth;hb=e.offsetHeight;}else{var oldVisibility=es.visibility;var oldPosition=es.position;es.visibility='hidden';es.display='block';es.position='absolute';wb=e.offsetWidth;hb=e.offsetHeight;es.display='none';es.position=oldPosition;es.visibility=oldVisibility;} -return{w:w,h:h,wb:wb,hb:hb};},getSizeLite:function(el) -{return{wb:el.offsetWidth||0,hb:el.offsetHeight||0};},getClient:function(e) -{var h,w,de;if(e){w=e.clientWidth;h=e.clientHeight;}else{de=document.documentElement;w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;} -return{w:w,h:h};},getScroll:function(e) -{var t=0,l=0,w=0,h=0,iw=0,ih=0;if(e&&e.nodeName.toLowerCase()!='body'){t=e.scrollTop;l=e.scrollLeft;w=e.scrollWidth;h=e.scrollHeight;iw=0;ih=0;}else{if(document.documentElement){t=document.documentElement.scrollTop;l=document.documentElement.scrollLeft;w=document.documentElement.scrollWidth;h=document.documentElement.scrollHeight;}else if(document.body){t=document.body.scrollTop;l=document.body.scrollLeft;w=document.body.scrollWidth;h=document.body.scrollHeight;} -iw=self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;ih=self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;} -return{t:t,l:l,w:w,h:h,iw:iw,ih:ih};},getMargins:function(e,toInteger) -{var el=jQuery(e);var t=el.css('marginTop')||'';var r=el.css('marginRight')||'';var b=el.css('marginBottom')||'';var l=el.css('marginLeft')||'';if(toInteger) -return{t:parseInt(t)||0,r:parseInt(r)||0,b:parseInt(b)||0,l:parseInt(l)};else -return{t:t,r:r,b:b,l:l};},getPadding:function(e,toInteger) -{var el=jQuery(e);var t=el.css('paddingTop')||'';var r=el.css('paddingRight')||'';var b=el.css('paddingBottom')||'';var l=el.css('paddingLeft')||'';if(toInteger) -return{t:parseInt(t)||0,r:parseInt(r)||0,b:parseInt(b)||0,l:parseInt(l)};else -return{t:t,r:r,b:b,l:l};},getBorder:function(e,toInteger) -{var el=jQuery(e);var t=el.css('borderTopWidth')||'';var r=el.css('borderRightWidth')||'';var b=el.css('borderBottomWidth')||'';var l=el.css('borderLeftWidth')||'';if(toInteger) -return{t:parseInt(t)||0,r:parseInt(r)||0,b:parseInt(b)||0,l:parseInt(l)||0};else -return{t:t,r:r,b:b,l:l};},getPointer:function(event) -{var x=event.pageX||(event.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))||0;var y=event.pageY||(event.clientY+(document.documentElement.scrollTop||document.body.scrollTop))||0;return{x:x,y:y};},traverseDOM:function(nodeEl,func) -{func(nodeEl);nodeEl=nodeEl.firstChild;while(nodeEl){jQuery.iUtil.traverseDOM(nodeEl,func);nodeEl=nodeEl.nextSibling;}},purgeEvents:function(nodeEl) -{jQuery.iUtil.traverseDOM(nodeEl,function(el) -{for(var attr in el){if(typeof el[attr]==='function'){el[attr]=null;}}});},centerEl:function(el,axis) -{var clientScroll=jQuery.iUtil.getScroll();var windowSize=jQuery.iUtil.getSize(el);if(!axis||axis=='vertically') -jQuery(el).css({top:clientScroll.t+((Math.max(clientScroll.h,clientScroll.ih)-clientScroll.t-windowSize.hb)/2)+'px'});if(!axis||axis=='horizontally') -jQuery(el).css({left:clientScroll.l+((Math.max(clientScroll.w,clientScroll.iw)-clientScroll.l-windowSize.wb)/2)+'px'});},fixPNG:function(el,emptyGIF){var images=jQuery('img[@src*="png"]',el||document),png;images.each(function(){png=this.src;this.src=emptyGIF;this.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+png+"')";});}};[].indexOf||(Array.prototype.indexOf=function(v,n){n=(n==null)?0:n;var m=this.length;for(var i=n;icontentObj.offsetHeight){ - height = contentObj.offsetHeight; - rerunFunction = false; - } - if(height<=1){ - height = 1; - rerunFunction = false; - } - - obj.style.height = height + 'px'; - var topPos = height - contentObj.offsetHeight; - if(topPos>0)topPos=0; - contentObj.style.top = topPos + 'px'; - if(rerunFunction){ - setTimeout('slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer); - }else{ - if(height<=1){ - obj.style.display='none'; - if(objectIdToSlideDown && objectIdToSlideDown!=inputId){ - document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.display='block'; - document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.visibility='visible'; - slideContent(objectIdToSlideDown,dhtmlgoodies_slideSpeed); - }else{ - dhtmlgoodies_slideInProgress = false; - } - }else{ - dhtmlgoodies_activeId = inputId; - dhtmlgoodies_slideInProgress = false; - } - } -} - -function initShowHideDivs() -{ - var divs = document.getElementsByTagName('DIV'); - var divCounter = 1; - for(var no=0;no -
            -

            - -
            diff --git a/3.1/modules/sharephoto/views/sharephoto.html.php b/3.1/modules/sharephoto/views/sharephoto.html.php deleted file mode 100644 index c2b138d9..00000000 --- a/3.1/modules/sharephoto/views/sharephoto.html.php +++ /dev/null @@ -1,71 +0,0 @@ - -
            - - - - - - - - - -
            diff --git a/3.1/modules/square_thumbs/helpers/square_thumbs_graphics.php b/3.1/modules/square_thumbs/helpers/square_thumbs_graphics.php deleted file mode 100644 index 32a0b28a..00000000 --- a/3.1/modules/square_thumbs/helpers/square_thumbs_graphics.php +++ /dev/null @@ -1,42 +0,0 @@ -crop(min($dims[0], $dims[1]), min($dims[0], $dims[1])) - ->quality(module::get_var("gallery", "image_quality")) - ->save($output_file); - } -} diff --git a/3.1/modules/square_thumbs/helpers/square_thumbs_installer.php b/3.1/modules/square_thumbs/helpers/square_thumbs_installer.php deleted file mode 100644 index 5ab9702d..00000000 --- a/3.1/modules/square_thumbs/helpers/square_thumbs_installer.php +++ /dev/null @@ -1,28 +0,0 @@ -server("REMOTE_USER"); - $user = Session::instance()->get("user"); - if (empty($user) || $user->name != $sso_username) { - try { - identity::set_active_user(identity::lookup_user_by_name($sso_username)); - } catch (Exception $e) { - Kohana_Log::add("error", "Couldn't authenticate as $sso_username: " . - $e->getMessage() . "\n" . $e->getTraceAsString()); - } - } - } - - static function user_menu($menu, $theme) { - $menu->remove("user_menu_logout"); - } -} diff --git a/3.1/modules/sso/module.info b/3.1/modules/sso/module.info deleted file mode 100644 index 70399944..00000000 --- a/3.1/modules/sso/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "SSO" -description = "Support single-signon authentication" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:sso" -discuss_url = "http://gallery.menalto.com/forum_module_sso" diff --git a/3.1/modules/tag_albums/-- Theme Files/clean_canvas/views/calpage.html.php b/3.1/modules/tag_albums/-- Theme Files/clean_canvas/views/calpage.html.php deleted file mode 100644 index 54bb4db8..00000000 --- a/3.1/modules/tag_albums/-- Theme Files/clean_canvas/views/calpage.html.php +++ /dev/null @@ -1,199 +0,0 @@ - - -html_attributes() ?> xml:lang="en" lang="en"> - - - start_combining("script,css") ?> - - <? 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 ?> - - " - type="image/x-icon" /> - - page_type == "collection"): ?> - - - - - - - - script("json2-min.js") ?> - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("jquery.localscroll.js") ?> - - - page_subtype == "photo"): ?> - script("jquery.scrollTo.js") ?> - script("gallery.show_full_size.js") ?> - page_subtype == "movie"): ?> - script("flowplayer.js") ?> - - - head() ?> - - - script("ui.init.js") ?> - css("yui/reset-fonts-grids.css") ?> - css("superfish/css/superfish.css") ?> - - css("dark/themeroller/ui.base.css") ?> - css("dark/screen_colors.css") ?> - css("dark/screen_candy.css") ?> - - css("clean/themeroller/ui.base.css") ?> - css("clean/screen_colors.css") ?> - css("clean/screen_candy.css") ?> - - css("screen_layout_base.css") ?> - css("screen_fonts.css") ?> - - css("screen_layout_wide.css") ?> - - css("screen_layout_fixed.css") ?> - - - - - get_combined("script") ?> - - - get_combined("css") ?> - - - body_attributes() ?>> - page_top() ?> - -
            - -
            - - site_status() ?> -
            -
            - - - - - - user_menu() ?> - header_top() ?> -
            - - 1 ) { ?> - $display_name) { ?> - - - - installed_locales = array_merge(array("" => t("« none »")), $locales); ?> - selected = (string) locales::cookie_locale(); ?> - - -
            - - - - - header_bottom() ?> -
            - - - -
              - - - > - - url) : ?> - title) ?> - - title) ?> - - - - -
            - - - -
            -
            -
            -
            -
            - messages() ?> - -
            -
            -
            - item() && !empty($parents))): ?> - - -
            - page_subtype != "login"): ?> - - -
            -
            - -
            - page_bottom() ?> - - diff --git a/3.1/modules/tag_albums/-- Theme Files/greydragon/views/calpage.html.php b/3.1/modules/tag_albums/-- Theme Files/greydragon/views/calpage.html.php deleted file mode 100644 index 9d3341de..00000000 --- a/3.1/modules/tag_albums/-- Theme Files/greydragon/views/calpage.html.php +++ /dev/null @@ -1,297 +0,0 @@ - - -load_sessioninfo(); ?> - -html_attributes() ?> xml:lang="en" lang="en" is_rtl)? "dir=rtl" : null; ?> > -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; -?> - - - -start_combining("script,css") ?> - - - -item()): ?> -bb2html($theme->item()->title, 2); ?> -tag()): ?> - $theme->bb2html($theme->tag()->name, 2))) ?> - -bb2html(item::root()->title, 2); ?> - - -<?= $_title ?> -disable_seosupport): ?> - - - - - - -blendpagetrans): ?> - - - - - - " /> - -allow_root_page): ?> -: ; action-uri=url(); ?>?root=yes; icon-uri=favicon.ico" /> -: ; action-uri=url(); ?>?root=no; icon-uri=favicon.ico" /> - -: ; action-uri=url(); ?>; icon-uri=favicon.ico" /> - -admin): ?> - -: ; action-uri=; icon-uri=favicon.ico" /> - - - - -appletouchicon): ?> - - -script("json2-min.js") ?> -script("jquery.js") ?> -script("jquery.form.js") ?> -script("jquery-ui.js") ?> -script("gallery.common.js") ?> - - -script("gallery.ajax.js"); ?> -script("gallery.dialog.js"); ?> - - -page_subtype == "photo"): ?> -script("jquery.scrollTo.js"); ?> -page_subtype == "movie"): ?> -script("flowplayer.js") ?> - - -head() ?> - - -script("animation.js"); ?> -script("ui.support.js"); ?> - -theme_css_inject(); ?> - - -get_combined("css"); ?> - -css_link("colorpacks/" . $theme->colorpack . "/colors.css", FALSE); ?> -css_link("framepacks/" . $theme->framepack . "/frame.css", FALSE); ?> -custom_css_path != ""): ?> -css_link($theme->custom_css_path, TRUE); ?> - - -get_combined("script") ?> - - -thumb_inpage): ?> - - - -item()): ?> -item(); ?> - - - -body_attributes() ?>show_root_page)? ' id="g-rootpage"' : null; ?> is_rtl)? "class=\"rtl\"" : null; ?> > -page_top() ?> -site_status() ?> -guest) or ($theme->show_guest_menu)) and ($theme->mainmenu_position == "bar")): ?> - -
            - site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?> -
            - -
            -header_top() ?> - -bb2html($header_text, 1) ?> - - - - -guest) or ($theme->show_guest_menu)) and ($theme->mainmenu_position != "bar")): ?> -
            - site_menu($theme->item() ? "#g-item-id-{$theme->item()->id}" : "") ?> -
            - - -messages() ?> -header_bottom() ?> - -loginmenu_position == "header"): ?> -user_menu() ?> - - - -breadcrumb_menu($theme, null); ?> - -breadcrumbs_position == "hide"): - else: - $limit_title_length = module::get_var("gallery", "visible_title_length", 999); - - $breadcrumb_content .= ''; - endif; - - print $breadcrumb_content; - - // End Edit. -?> - -custom_header(); ?> -
            -page_subtype != "login") and ($theme->page_subtype != "reauthenticate") and ($theme->sidebarvisible == "top")): ?> -
            - -
            - -
            -
            -show_root_page): ?> - sidebar_menu($item->url()) ?> -
            "> - - album_menu() ?> - - photo_menu() ?> - - movie_menu() ?> - - tag_menu() ?> - -
            - -sidebarvisible): - case "left": - echo '
            '; - $closediv = TRUE; - break; - case "none": - case "top": - case "bottom": - if (($theme->thumb_inpage) and ($page_subtype == "photo")): - echo '
            '; - $closediv = TRUE; - else: - $closediv = FALSE; - endif; - break; - default: - echo '
            '; - $closediv = TRUE; - break; - endswitch; ?> -page_subtype != "login") and ($theme->page_subtype != "reauthenticate")): ?> -sidebarvisible == "none") or ($theme->sidebarvisible == "bottom") or ($theme->sidebarvisible == "top")): ?> -thumb_inpage) and ($page_subtype == "photo")): ?> -

             

            '; ?> -get_block_html("thumbnav"); ?> - - - - - -" : null; ?> - -sidebarvisible): - case "left": - echo '
            '; - break; - case "none": - case "top": - case "bottom": - if (($theme->thumb_inpage) and ($page_subtype == "photo")): - echo '
            '; - else: - echo '
            '; - endif; - break; - default: - echo '
            '; - break; - endswitch; - - if ($theme->show_root_page): - echo new View("rootpage.html"); - else: - echo $content; - endif; ?> -
            -
            -
            -page_subtype != "login") and ($theme->page_subtype != "reauthenticate") and ($theme->sidebarvisible == "bottom")): ?> -
            - -
            - - -page_bottom() ?> - - diff --git a/3.1/modules/tag_albums/-- Theme Files/greydragon/views/paginator.html.php b/3.1/modules/tag_albums/-- Theme Files/greydragon/views/paginator.html.php deleted file mode 100644 index 5918299c..00000000 --- a/3.1/modules/tag_albums/-- Theme Files/greydragon/views/paginator.html.php +++ /dev/null @@ -1,209 +0,0 @@ - - - -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 = " "; - else: - $pagination_msg = t("Page:") . ' '; - if ($total_pages < 13): - for ($i = 1; $i <= $total_pages; $i++): - if ($i == $current_page): - $pagination_msg .= '' . t($i) . ''; - else: - $pagination_msg .= '' . t($i) . ''; - endif; - if ($i < $total_pages): - $pagination_msg .= '·'; - endif; - endfor; - elseif ($current_page < 9): - for ($i = 1; $i <= 10; $i++): - if ($i == $current_page): - $pagination_msg .= '' . t($i) . ''; - else: - $pagination_msg .= '' . t($i) . ''; - endif; - if ($i < 10): - $pagination_msg .= '·'; - endif; - endfor; - - $pagination_msg .= '…'; - $pagination_msg .= '' . t($total_pages - 1) . ''; - $pagination_msg .= '·'; - $pagination_msg .= '' . t($total_pages) . ''; - - elseif ($current_page > $total_pages - 8): - $pagination_msg .= '' . t(1) . ''; - $pagination_msg .= '·'; - $pagination_msg .= '' . t(2) . ''; - $pagination_msg .= '…'; - - for ($i = $total_pages - 9; $i <= $total_pages; $i++): - if ($i == $current_page): - $pagination_msg .= '' . t($i) . ''; - else: - $pagination_msg .= '' . t($i) . ''; - endif; - if ($i < $total_pages): - $pagination_msg .= '·'; - endif; - endfor; - - else: - $pagination_msg .= '' . t(1) . ''; - $pagination_msg .= '·'; - $pagination_msg .= '' . t(2) . ''; - $pagination_msg .= '…'; - - for ($i = $current_page - 5; $i <= $current_page + 5; $i++): - if ($i == $current_page): - $pagination_msg .= '' . t($i) . ''; - else: - $pagination_msg .= '' . t($i) . ''; - endif; - if ($i < $current_page + 5): - $pagination_msg .= '·'; - endif; - endfor; - - $pagination_msg .= '…'; - $pagination_msg .= '' . t($total_pages - 1) . ''; - $pagination_msg .= '·'; - $pagination_msg .= '' . t($total_pages) . ''; - endif; - endif; -?> - - \ No newline at end of file diff --git a/3.1/modules/tag_albums/-- Theme Files/greydragon/views/photo.html.php b/3.1/modules/tag_albums/-- Theme Files/greydragon/views/photo.html.php deleted file mode 100644 index 5d3ede73..00000000 --- a/3.1/modules/tag_albums/-- Theme Files/greydragon/views/photo.html.php +++ /dev/null @@ -1,122 +0,0 @@ - -desc_allowbbcode): - $_description = $theme->bb2html($item->description, 1); - else: - $_description = nl2br(html::purify($item->description)); - endif; - - if ($theme->is_photometa_visible): - $_description .= ''; - 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; -?> - -
            - bb2html(html::purify($item->title), 1); ?> -
            -

            -
            - add_paginator("top"); ?> - photo_top() ?> - photo_descmode == "top") and ($_description)): ?> -
            - -
            - resize_top($item) ?> - resize_width; - -// rWatcher Modification. - $siblings = ""; - if (isset($dynamic_siblings)) { - $siblings = $dynamic_siblings; - } else { - $siblings = $item->parent()->children(); - } -// End rWatcher Modification - ?> - -
            - \n"; - $script .= " if (document.images) {\n"; - for ($i = 0; ($i <= count($siblings) - 1); $i++): - if ($siblings[$i]->rand_key == $item->rand_key): ?> - " title="bb2html(html::purify($item->title), 2) ?>" href="file_url() : $item->resize_url(); ?>"> - resize_img(array("id" => "g-photo-id-{$item->id}", "class" => "g-resize", "alt" => $_title)) ?> - - 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): ?> - is_album()): ?> - file_url() : $siblings[$i]->resize_url(); ?>">  - - - - - \n"; ?> - photo_descmode): - case "overlay_top": - $_align = "g-align-top"; - break; - case "overlay_bottom": - $_align = "g-align-bottom"; - break; - default: - break; - endswitch; - endif; ?> - - -
            - - -
            - -
            - resize_bottom($item) ?> -
            - photo_descmode == "bottom") and ($_description)): ?> -
            - - add_paginator("bottom"); ?> - photo_bottom() ?> -
            - \ No newline at end of file diff --git a/3.1/modules/tag_albums/-- Theme Files/greydragon/views/tag_albums_album.html.php b/3.1/modules/tag_albums/-- Theme Files/greydragon/views/tag_albums_album.html.php deleted file mode 100644 index 3a348d3b..00000000 --- a/3.1/modules/tag_albums/-- Theme Files/greydragon/views/tag_albums_album.html.php +++ /dev/null @@ -1,135 +0,0 @@ - -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). -?> - -
            - dynamic_top() ?> -

            bb2html(html::purify($title), 1) ?>

            -
            - -add_paginator("top"); ?> - -album_descmode == "top") and ($description)): ?> -
            bb2html(html::purify($description), 1) ?>
            - - - -
            -
            -
            -
            - - -
            -
              - - $child): ?> -thumb_height > $thumb_item->thumb_width); - - $item_class = $child->is_album() ? "g-album" : "g-photo"; - $content = '
            • 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 .= '

              '; - $content .= ''; - if ($thumb_item->has_thumb()): - $content .= $thumb_item->thumb_img(); - else: - $content .= 'No Image'; - endif; - $content .= '

              '; - - 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 .= '
                bb2html(html::purify($child->title), 2) . ''; - if ($_thumb_metamode == "merged"): - $content .= $theme->thumb_info($child); - endif; - $content .= '
              '; - endif; - - if (($_thumb_metamode == "default") and ($_thumb_descmode != "overlay_bottom")): - $content .= ''; - endif; - - if ($_thumb_descmode == "bottom"): - $content .= '
                '; - $content .= '
              • ' . $theme->bb2html(html::purify($child->title), 2) . '
              • '; - if ($_thumb_metamode == "merged"): - $content .= $theme->thumb_info($child); - endif; - $content .= '
              '; - endif; - - /* - if ($addcontext): - $_text = $this->context_menu($child, "#g-item-id-{$child->id} .g-thumbnail"); - $content .= (stripos($_text, '
            • '))? $_text : null; - endif; - */ - - $content .= '
            '; - $content .= $theme->thumb_bottom($child); - $content .= ''; - - print $content; - // End rWatcher Edit. -?> - - -
          • - -
          -
        -dynamic_bottom() ?> - -album_descmode == "bottom") and ($description)): ?> -
        bb2html(html::purify($description), 1) ?>
        - - -add_paginator("bottom"); ?> diff --git a/3.1/modules/tag_albums/controllers/admin_tag_albums.php b/3.1/modules/tag_albums/controllers/admin_tag_albums.php deleted file mode 100644 index 6267e33c..00000000 --- a/3.1/modules/tag_albums/controllers/admin_tag_albums.php +++ /dev/null @@ -1,123 +0,0 @@ -content = new View("admin_tag_albums.html"); - - // Generate a form for the admin Settings. - $view->content->tag_albums_form = $this->_get_admin_form(); - - // Display the page. - print $view; - } - - private function _get_admin_form() { - $form = new Forge("admin/tag_albums/saveprefs", "", "post", - 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( - array("name" => "Name", - "count" => "Count", - "id" => "ID Number")) - ->selected(module::get_var("tag_albums", "tag_sort_by")); - $tag_albums_tagsort_group->dropdown("tag_sort_direction") - ->label(t("Display Albums In:")) - ->options( - array("ASC" => "Ascending Order", - "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:")) - ->options( - array("title" => "Title", - "name" => "File name", - "captured" => "Date captured", - "created" => "Date uploaded", - "updated" => "Date modified", - "view_count" => "Number of views")) - ->selected(module::get_var("tag_albums", "subalbum_sort_by")); - $tag_albums_tagitemsort_group->dropdown("subalbum_sort_direction") - ->label(t("Display Contents of Sub-Albums In:")) - ->options( - array("ASC" => "Ascending Order", - "DESC" => "Descending")) - ->selected(module::get_var("tag_albums", "subalbum_sort_direction")); - - // Add a save button to the form. - $form->submit("SaveSettings")->value(t("Save")); - - // Return the newly generated form. - return $form; - } - - public function saveprefs() { - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - $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"); - } - - // Else show the page with errors - $view = new Admin_View("admin.html"); - $view->content = new View("admin_tag_albums.html"); - $view->content->tag_albums_form = $form; - print $view; - } -} diff --git a/3.1/modules/tag_albums/controllers/tag_albums.php b/3.1/modules/tag_albums/controllers/tag_albums.php deleted file mode 100644 index b1293eec..00000000 --- a/3.1/modules/tag_albums/controllers/tag_albums.php +++ /dev/null @@ -1,844 +0,0 @@ -where("id", "=", $id) - ->find_all(); - - // If it doesn't exist, redirect to the modules root page. - if (count($album_tags) == 0) { - url::redirect("tag_albums/"); - } - - // If it does exist, and is set to *, load a list of all tags. - if ($album_tags[0]->tags == "*") { - $this->index($id, ""); - } else { - // Otherwise, populate this page with the specified items. - - // Inherit permissions, title and description from the album that linked to this page. - $album = ORM::factory("item", $album_tags[0]->album_id); - access::required("view", $album); - $page_title = $album->title; - $page_description = $album->description; - - // Determine page sort order. - $sort_page_field = $album->sort_column; - $sort_page_direction = $album->sort_order; - - // Determine search type (AND/OR) and generate an array of the tag ids. - $tag_ids = Array(); - foreach (explode(",", $album_tags[0]->tags) as $tag_name) { - $tag = ORM::factory("tag")->where("name", "=", trim($tag_name))->find(); - if ($tag->loaded()) { - $tag_ids[] = $tag->id; - } - } - $album_tags_search_type = $album_tags[0]->search_type; - - // 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); - if ($page < 1) { - url::redirect("tag_albums/album/" . $id); - } - - // First item to display. - $offset = ($page - 1) * $page_size; - - // Figure out what the highest page number is. - $max_pages = ceil($count / $page_size); - - // Don't let the visitor go past the last page. - if ($max_pages && $page > $max_pages) { - url::redirect("tag_albums/album/{$id}/?page=$max_pages"); - } - - // Figure out which items to display on this page and store their details in $children. - $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->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); - } - $children[] = $child_tag; - } - - // Set up the previous and next page buttons. - if ($page > 1) { - $previous_page = $page - 1; - $view->previous_page_link = url::site("tag_albums/album/{$id}/?page={$previous_page}"); - } - if ($page < $max_pages) { - $next_page = $page + 1; - $view->next_page_link = url::site("tag_albums/album/{$id}/?page={$next_page}"); - } - - // Set up breadcrumbs. - $tag_album_breadcrumbs = Array(); - $counter = 0; - $tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($album->title, ""); - $parent_item = ORM::factory("item", $album->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=" . $album->id; - $tag_album_breadcrumbs = array_reverse($tag_album_breadcrumbs, true); - - // Set up and display the actual page. - $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->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); - print $template; - } - } - - 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) - ->find_all(); - if (count($album_tags) == 0) { - $id = ""; - } - - // 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 = module::get_var("tag_albums", "tag_page_title", "All Tags"); - $page_description = ""; - if ($id == "") { - $album = ORM::factory("item", 1); - access::required("view", $album); - } else { - $album = ORM::factory("item", $album_tags[0]->album_id); - access::required("view", $album); - $page_title = $album->title; - $page_description = $album->description; - } - - // Figure out sort order from module preferences. - $sort_page_field = module::get_var("tag_albums", "tag_sort_by", "name"); - $sort_page_direction = module::get_var("tag_albums", "tag_sort_direction", "ASC"); - - // 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); - if ($page < 1) { - url::redirect("tag_albums/"); - } - - // First item to display. - $offset = ($page - 1) * $page_size; - - // Determine the total number of items, - // for page numbering purposes. - $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); - - // Don't let the visitor go past the last page. - if ($max_pages && $page > $max_pages) { - url::redirect("tag_albums/?page=$max_pages"); - } - - // Figure out which items to display on this page. - $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) { - $previous_page = $page - 1; - $view->previous_page_link = url::site("tag_albums/album/" . $id . "/?page={$previous_page}"); - } - if ($page < $max_pages) { - $next_page = $page + 1; - $view->next_page_link = url::site("tag_albums/album/" . $id . "/?page={$next_page}"); - } - - // Generate an arry of "fake" items, one for each tag on the page. - // Grab thumbnails from the most recently uploaded item for each tag, if available. - $children = Array(); - foreach ($display_tags as $one_tag) { - $tag_item = ORM::factory("item") - ->viewable() - ->join("items_tags", "items.id", "items_tags.item_id") - ->where("items_tags.tag_id", "=", $one_tag->id) - ->order_by("items.id", "DESC") - ->find_all(1, 0); - $child_tag = new Tag_Albums_Item($one_tag->name, url::site("tag_albums/tag/" . $one_tag->id . "/" . $id), "album"); - if (count($tag_item) > 0) { - if ($tag_item[0]->has_thumb()) { - $child_tag->set_thumb($tag_item[0]->thumb_url(), $tag_item[0]->thumb_width, $tag_item[0]->thumb_height); - } - } - $children[] = $child_tag; - } - - // 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("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->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; - } - - public function tag($id, $album_id) { - // Display a dynamic album containing everything tagged with a specific tag where, - // TAG is $id. - // Optionally, set the breadcrumbs to make this page look like an album where the - // album is $album_id. - - // Make sure $album_id is valid, clear it out if it isn't. - $album_tags = ORM::factory("tags_album_id") - ->where("id", "=", $album_id) - ->find_all(); - if (count($album_tags) == 0) { - $album_id = ""; - } - - // Figure out sort order from module preferences. - $sort_page_field = module::get_var("tag_albums", "subalbum_sort_by", "title"); - $sort_page_direction = module::get_var("tag_albums", "subalbum_sort_direction", "ASC"); - - // 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); - if ($page < 1) { - url::redirect("tag_albums/tag/" . $id . "/" . $album_id); - } - - // First item to display. - $offset = ($page - 1) * $page_size; - - // Determine the total number of items, - // for page numbering purposes. - $count = $this->_count_records(Array($id), "OR", true); - - // Figure out what the highest page number is. - $max_pages = ceil($count / $page_size); - - // Don't let the visitor go past the last page. - if ($max_pages && $page > $max_pages) { - url::redirect("tag_albums/tag/{$id}/" . $album_id . "/?page=$max_pages"); - } - - // Figure out which items to display on this page. - $tag_children = $this->_get_records(Array($id), $page_size, $offset, "items." . $sort_page_field, $sort_page_direction, "OR", true); - - // 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->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); - } - $children[] = $child_tag; - } - - // Set up the previous and next page buttons. - if ($page > 1) { - $previous_page = $page - 1; - $view->previous_page_link = url::site("tag_albums/tag/{$id}/" . $album_id . "/?page={$previous_page}"); - } - if ($page < $max_pages) { - $next_page = $page + 1; - $view->next_page_link = url::site("tag_albums/tag/{$id}/" . $album_id . "/?page={$next_page}"); - } - - // Load the current tag. - $display_tag = ORM::factory("tag", $id); - - // 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, ""); - $parent_item = ORM::factory("item", $album_tags[0]->album_id); - 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()); - 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("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->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; - } - - public function show($item_id, $tag_id, $album_id) { - // Display the specified photo or video ($item_id) with breadcrumbs - // that point back to a virtual album ($tag_id / $album_id). - - // Make sure #album_id is valid, clear it out if it isn't. - $album_tags = ORM::factory("tags_album_id") - ->where("id", "=", $album_id) - ->find_all(); - if (count($album_tags) == 0) { - $album_id = ""; - } - - // Load the tag and item, make sure the user has access to the item. - $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 = ""; - $sort_page_direction = ""; - if (($tag_id > 0) || (count($album_tags) == 0)) { - $sort_page_field = module::get_var("tag_albums", "subalbum_sort_by", "title"); - $sort_page_direction = module::get_var("tag_albums", "subalbum_sort_direction", "ASC"); - } else { - $parent_album = ORM::factory("item", $album_tags[0]->album_id); - $sort_page_field = $parent_album->sort_column; - $sort_page_direction = $parent_album->sort_order; - } - - // Load the number of items in the parent album, and determine previous and next items. - $sibling_count = ""; - $tag_children = ""; - $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, 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]->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]->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) { - $tag = ORM::factory("tag")->where("name", "=", trim($tag_name))->find(); - if ($tag->loaded()) { - $tag_ids[] = $tag->id; - } - } - $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, 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]->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]->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 - $tag_album_breadcrumbs = Array(); - if ($album_id != "") { - $counter = 0; - $tag_album_breadcrumbs[$counter++] = new Tag_Albums_Breadcrumb($item->title, ""); - if ($album_tags[0]->tags == "*") { - $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(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("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("photo.html"); - $template->content->title = $item->title; - $template->set_global("breadcrumbs", $tag_album_breadcrumbs); - print $template; - } elseif ($item->is_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("movie.html"); - $template->content->title = $item->title; - $template->set_global("breadcrumbs", $tag_album_breadcrumbs); - print $template; - } else { - // If it's something we don't know how to deal with, just redirect to its real page. - url::redirect(url::abs_site("{$item->type}s/{$item->id}")); - } - } - - 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. - if (!strcasecmp($sort_direction, "DESC")) { - $comp = ">"; - } else { - $comp = "<"; - } - - // Figure out how many items are _before the current item. - $items_model = ORM::factory("item"); - if ($search_type == "AND") { - $items_model->select('COUNT("*") AS result_count'); - } else { - $items_model->select("items.id"); - } - $items_model->viewable(); - $items_model->join("items_tags", "items.id", "items_tags.item_id"); - $items_model->open(); - $items_model->where("items_tags.tag_id", "=", $tag_ids[0]); - $counter = 1; - while ($counter < count($tag_ids)) { - $items_model->or_where("items_tags.tag_id", "=", $tag_ids[$counter]); - $counter++; - } - $items_model->close(); - 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"); - if ($search_type == "AND") { - $items_model->having("result_count", "=", count($tag_ids)); - } - $position = count($items_model->find_all()); - - // In case multiple items have identical sort criteria, query for - // everything with the same criteria, and increment the position - // one at a time until we find the right item. - $items_model = ORM::factory("item"); - if ($search_type == "AND") { - $items_model->select("items.id"); - $items_model->select('COUNT("*") AS result_count'); - } else { - $items_model->select("items.id"); - } - $items_model->viewable(); - $items_model->join("items_tags", "items.id", "items_tags.item_id"); - $items_model->open(); - $items_model->where("items_tags.tag_id", "=", $tag_ids[0]); - $counter = 1; - while ($counter < count($tag_ids)) { - $items_model->or_where("items_tags.tag_id", "=", $tag_ids[$counter]); - $counter++; - } - $items_model->close(); - 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"); - if ($search_type == "AND") { - $items_model->having("result_count", "=", count($tag_ids)); - } - $match_items = $items_model->find_all(); - foreach ($match_items as $one_item) { - $position++; - if ($one_item->id == $item_id) { - break; - } - } - - return ($position); - } - - private function _get_records($tag_ids, $page_size, $offset, $sort_field, $sort_direction, $search_type, $include_albums) { - // Returns an array of items to be displayed on the current page. - - $items_model = ORM::factory("item"); - if ($search_type == "AND") { - // For some reason, if I do 'select("*")' the item ids all have values that are 1000+ - // 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"); - $items_model->select("items.left_ptr"); - $items_model->select("items.right_ptr"); - $items_model->select("items.relative_path_cache"); - $items_model->select('COUNT("*") AS result_count'); - } - $items_model->viewable(); - $items_model->join("items_tags", "items.id", "items_tags.item_id"); - $items_model->open(); - $items_model->where("items_tags.tag_id", "=", $tag_ids[0]); - $counter = 1; - while ($counter < count($tag_ids)) { - $items_model->or_where("items_tags.tag_id", "=", $tag_ids[$counter]); - $counter++; - } - $items_model->close(); - if ($include_albums == false) { - $items_model->and_where("items.type", "!=", "album"); - } - $items_model->order_by($sort_field, $sort_direction); - $items_model->group_by("items.id"); - if ($search_type == "AND") { - $items_model->having("result_count", "=", count($tag_ids)); - } - 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 .= "(All) "; - } else { - $str_html .= "(All) "; - } - } - if ($str_filter == "NUM") { - $str_html .= "# "; - } else { - $str_html .= "# "; - } - foreach(range('A','Z') as $letter) { - if ($letter == $str_filter) { - $str_html .= $letter . " "; - } else { - $str_html .= ""; - $str_html .= $letter . " "; - } - } - - // 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. - - if (count($tag_ids) == 0) { - // If no tags were specified, return 0. - return 0; - - } elseif (count($tag_ids) == 1) { - // if one tag was specified, we can use count_all to get the number. - $count = ORM::factory("item") - ->viewable() - ->join("items_tags", "items.id", "items_tags.item_id") - ->where("items_tags.tag_id", "=", $tag_ids[0]); - if ($include_albums == false) { - $count->and_where("items.type", "!=", "album"); - } - return $count->count_all(); - - } else { - // If multiple tags were specified, count_all won't work, - // so we'll have to do count(find_all) instead. - $items_model = ORM::factory("item"); - if ($search_type == "AND") { - $items_model->select('COUNT("*") AS result_count'); - } else { - $items_model->select('items.id'); - } - $items_model->viewable(); - $items_model->join("items_tags", "items.id", "items_tags.item_id"); - $items_model->where("items_tags.tag_id", "=", $tag_ids[0]); - $counter = 1; - while ($counter < count($tag_ids)) { - $items_model->or_where("items_tags.tag_id", "=", $tag_ids[$counter]); - $counter++; - } - if ($include_albums == false) { - $items_model->and_where("items.type", "!=", "album"); - } - $items_model->group_by("items.id"); - if ($search_type == "AND") { - $items_model->having("result_count", "=", count($tag_ids)); - } - - return count($items_model->find_all()); - } - } -} diff --git a/3.1/modules/tag_albums/helpers/tag_albums_block.php b/3.1/modules/tag_albums/helpers/tag_albums_block.php deleted file mode 100644 index 7243722c..00000000 --- a/3.1/modules/tag_albums/helpers/tag_albums_block.php +++ /dev/null @@ -1,40 +0,0 @@ - t("Tag Albums")); - } - - static function get($block_id, $theme) { - $block = ""; - - switch ($block_id) { - case "tag_albums": - // Make a new sidebar block. - $block = new Block(); - $block->css_id = "g-tag-albums"; - $block->title = t("Tag Albums"); - $block->content = new View("tag_albums_block.html"); - - break; - } - return $block; - } -} diff --git a/3.1/modules/tag_albums/helpers/tag_albums_event.php b/3.1/modules/tag_albums/helpers/tag_albums_event.php deleted file mode 100644 index 033293f1..00000000 --- a/3.1/modules/tag_albums/helpers/tag_albums_event.php +++ /dev/null @@ -1,110 +0,0 @@ -module == "tag") { - $data->messages["warn"][] = t("The Tag Albums module requires the Tags module."); - } - } - - 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 Albums module requires the Tags module. " . - "Activate the Tags module now", - array("url" => url::site("admin/modules"))), - "tag_albums_needs_tag"); - } else { - site_status::clear("tag_albums_needs_tag"); - } - } - - static function admin_menu($menu, $theme) { - // Add a link to the admin page to the Content menu. - $menu->get("settings_menu") - ->append(Menu::factory("link") - ->id("tag_albums") - ->label(t("Tag Albums Settings")) - ->url(url::site("admin/tag_albums"))); - } - - static function item_edit_form($item, $form) { - // Create fields on the album edit screen to allow the user to link - // the album to a tag_albums page. - if (!($item->is_album())) { - return; - } - - $url = url::site("tags/autocomplete"); - $form->script("") - ->text("$('form input[name=tag_albums]').ready(function() { - $('form input[name=tag_albums]').autocomplete( - '$url', {max: 30, multiple: true, multipleSeparator: ',', cacheLength: 1}); - });"); - - $album_tags = ORM::factory("tags_album_id") - ->where("album_id", "=", $item->id) - ->find_all(); - - $tag_names = ""; - $tag_album_type = "OR"; - if (count($album_tags) > 0) { - $tag_names = $album_tags[0]->tags; - $tag_album_type = $album_tags[0]->search_type; - } - - $tags_album_group = $form->edit_item->group("tags_album_group"); - $tags_album_group->dropdown("tags_album_type") - ->options( - array("OR" => t("Display items that contain ANY of the following tags:"), - "AND" => t("Display items that contain ALL of the following tags:"))) - ->selected($tag_album_type); - $tags_album_group->input("tag_albums") - ->value($tag_names); - } - - static function item_deleted($item) { - // Whenever an item is deleted, delete any corresponding data. - db::build()->delete("tags_album_ids")->where("album_id", "=", $item->id)->execute(); - } - - static function item_edit_form_completed($item, $form) { - // Update the database with any changes to the tag_albums field. - if (!($item->is_album())) { - return; - } - - $record = ORM::factory("tags_album_id")->where("album_id", "=", $item->id)->find(); - - if ($form->edit_item->tags_album_group->tag_albums->value != "") { - if (!$record->loaded()) { - $record->album_id = $item->id; - } - $record->tags = $form->edit_item->tags_album_group->tag_albums->value; - $record->search_type = $form->edit_item->tags_album_group->tags_album_type->value; - $record->save(); - } else { - db::build()->delete("tags_album_ids")->where("album_id", "=", $item->id)->execute(); - } - } -} diff --git a/3.1/modules/tag_albums/helpers/tag_albums_installer.php b/3.1/modules/tag_albums/helpers/tag_albums_installer.php deleted file mode 100644 index ee3df5e2..00000000 --- a/3.1/modules/tag_albums/helpers/tag_albums_installer.php +++ /dev/null @@ -1,69 +0,0 @@ -query("CREATE TABLE IF NOT EXISTS {tags_album_ids} ( - `id` int(9) NOT NULL auto_increment, - `album_id` int(9) NOT NULL, - `tags` varchar(2048) default NULL, - `search_type` varchar(128) NOT NULL, - PRIMARY KEY (`id`), - KEY(`album_id`, `id`)) - DEFAULT CHARSET=utf8;"); - - // Set up some default values. - module::set_var("tag_albums", "tag_sort_by", "name"); - 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", 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"); - } - - static function can_activate() { - $messages = array(); - if (!module::is_active("tag")) { - $messages["warn"][] = t("The Tag Albums module requires the Tags module."); - } - return $messages; - } - - static function uninstall() { - module::delete("tag_albums"); - } -} diff --git a/3.1/modules/tag_albums/libraries/Tag_Albums_Breadcrumb.php b/3.1/modules/tag_albums/libraries/Tag_Albums_Breadcrumb.php deleted file mode 100644 index ba576e49..00000000 --- a/3.1/modules/tag_albums/libraries/Tag_Albums_Breadcrumb.php +++ /dev/null @@ -1,31 +0,0 @@ -title = $new_title; - $this->url = $new_url; - } -} diff --git a/3.1/modules/tag_albums/libraries/Tag_Albums_Item.php b/3.1/modules/tag_albums/libraries/Tag_Albums_Item.php deleted file mode 100644 index a90c5239..00000000 --- a/3.1/modules/tag_albums/libraries/Tag_Albums_Item.php +++ /dev/null @@ -1,114 +0,0 @@ -item_type == "album") { - return true; - } else { - return false; - } - } - - public function has_thumb() { - if ($this->thumb_url != "") { - return true; - } else { - return false; - } - } - - public function thumb_img($extra_attrs=array(), $max=null, $center_vertically=false) { - list ($height, $width) = $this->scale_dimensions($max); - if ($center_vertically && $max) { - // The constant is divide by 2 to calculate the file and 10 to convert to em - $margin_top = (int)(($max - $height) / 20); - $extra_attrs["style"] = "margin-top: {$margin_top}em"; - $extra_attrs["title"] = $this->title; - } - $attrs = array_merge($extra_attrs, - array( - "src" => $this->thumb_url(), - "alt" => $this->title, - "width" => $width, - "height" => $height) - ); - // html::image forces an absolute url which we don't want - return ""; - } - - public function scale_dimensions($max) { - $width = $this->thumb_width; - $height = $this->thumb_height; - - if ($width <= $max && $height <= $max) { - return array($height, $width); - } - - if ($height) { - if (isset($max)) { - if ($width > $height) { - $height = (int)($max * $height / $width); - $width = $max; - } else { - $width = (int)($max * $width / $height); - $height = $max; - } - } - } else { - // Missing thumbnail, can happen on albums with no photos yet. - // @todo we should enforce a placeholder for those albums. - $width = 0; - $height = 0; - } - return array($height, $width); - } - - public function thumb_url() { - return $this->thumb_url; - } - - public function url() { - return $this->url; - } - - public function set_thumb($new_url, $new_width, $new_height) { - $this->thumb_url = $new_url; - $this->thumb_width = $new_width; - $this->thumb_height = $new_height; - } - - public function __construct($new_title, $new_url, $new_type) { - $this->title = $new_title; - $this->url = $new_url; - $this->item_type = $new_type; - $this->type = $new_type; - } -} diff --git a/3.1/modules/tag_albums/models/tag.php b/3.1/modules/tag_albums/models/tag.php deleted file mode 100644 index d15a36e0..00000000 --- a/3.1/modules/tag_albums/models/tag.php +++ /dev/null @@ -1,141 +0,0 @@ -loaded()) { - // Set reasonable defaults - $this->count = 0; - } - } - - /** - * Return all viewable items associated with this tag. - * @param integer $limit number of rows to limit result to - * @param integer $offset offset in result to start returning rows from - * @param string $type the type of item (album, photo) - * @return ORM_Iterator - */ - public function items($limit=null, $offset=null, $type=null) { - $model = ORM::factory("item") - ->viewable() - ->join("items_tags", "items.id", "items_tags.item_id") - ->where("items_tags.tag_id", "=", $this->id); - if ($type) { - $model->where("items.type", "=", $type); - } - return $model->find_all($limit, $offset); - } - - /** - * Return the count of all viewable items associated with this tag. - * @param string $type the type of item (album, photo) - * @return integer - */ - public function items_count($type=null) { - $model = ORM::factory("item") - ->viewable() - ->join("items_tags", "items.id", "items_tags.item_id") - ->where("items_tags.tag_id", "=", $this->id); - - if ($type) { - $model->where("items.type", "=", $type); - } - return $model->count_all(); - } - - /** - * Overload ORM::save() to trigger an item_related_update event for all items that are related - * to this tag. - */ - public function save() { - $related_item_ids = array(); - foreach (db::build() - ->select("item_id") - ->from("items_tags") - ->where("tag_id", "=", $this->id) - ->execute() as $row) { - $related_item_ids[$row->item_id] = 1; - } - - if (isset($this->object_relations["items"])) { - $added = array_diff($this->changed_relations["items"], $this->object_relations["items"]); - $removed = array_diff($this->object_relations["items"], $this->changed_relations["items"]); - if (isset($this->changed_relations["items"])) { - $changed = array_merge($added, $removed); - } - $this->count = count($this->object_relations["items"]) + count($added) - count($removed); - } - - $result = parent::save(); - - if (!empty($changed)) { - foreach (ORM::factory("item")->where("id", "IN", $changed)->find_all() as $item) { - module::event("item_related_update", $item); - } - } - - return $result; - } - - /** - * Overload ORM::delete() to trigger an item_related_update event for all items that are - * related to this tag, and delete all items_tags relationships. - */ - public function delete($ignored_id=null) { - $related_item_ids = array(); - foreach (db::build() - ->select("item_id") - ->from("items_tags") - ->where("tag_id", "=", $this->id) - ->execute() as $row) { - $related_item_ids[$row->item_id] = 1; - } - - db::build()->delete("items_tags")->where("tag_id", "=", $this->id)->execute(); - $result = parent::delete(); - - if ($related_item_ids) { - foreach (ORM::factory("item") - ->where("id", "IN", array_keys($related_item_ids)) - ->find_all() as $item) { - module::event("item_related_update", $item); - } - } - return $result; - } - - /** - * Return the server-relative url to this item, eg: - * /gallery3/index.php/tags/35 - * - * @param string $query the query string (eg "page=3") - */ - public function url($query=null) { - $url = url::site("/tag_albums/tag/{$this->id}/" . urlencode($this->name)); - if ($query) { - $url .= "?$query"; - } - return $url; - } -} diff --git a/3.1/modules/tag_albums/models/tags_album_id.php b/3.1/modules/tag_albums/models/tags_album_id.php deleted file mode 100644 index a9b16b4f..00000000 --- a/3.1/modules/tag_albums/models/tags_album_id.php +++ /dev/null @@ -1,21 +0,0 @@ - -

        - -

        -
        -
        - -
        diff --git a/3.1/modules/tag_albums/views/calpage.html.php b/3.1/modules/tag_albums/views/calpage.html.php deleted file mode 100644 index 3dab5fc0..00000000 --- a/3.1/modules/tag_albums/views/calpage.html.php +++ /dev/null @@ -1,164 +0,0 @@ - - -html_attributes() ?> xml:lang="en" lang="en"> - - - start_combining("script,css") ?> - - <? 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 ?> - - " - type="image/x-icon" /> - - page_type == "collection"): ?> - - - - - - - - script("json2-min.js") ?> - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("jquery.localscroll.js") ?> - - - page_subtype == "photo"): ?> - script("jquery.scrollTo.js") ?> - script("gallery.show_full_size.js") ?> - page_subtype == "movie"): ?> - script("flowplayer.js") ?> - - - head() ?> - - - script("ui.init.js") ?> - css("yui/reset-fonts-grids.css") ?> - css("superfish/css/superfish.css") ?> - css("themeroller/ui.base.css") ?> - css("screen.css") ?> - - - - get_combined("script") ?> - - - get_combined("css") ?> - - - body_attributes() ?>> - page_top() ?> -
        - site_status() ?> -
        -
        - - - - - - user_menu() ?> - header_top() ?> - - - - - - header_bottom() ?> -
        - - - - -
          - - - > - - url) : ?> - title) ?> - - title) ?> - - - - -
        - - - - - -
        -
        -
        -
        -
        - messages() ?> - -
        -
        -
        -
        - page_subtype != "login"): ?> - - -
        -
        - -
        - page_bottom() ?> - - \ No newline at end of file diff --git a/3.1/modules/tag_albums/views/tag_albums_album.html.php b/3.1/modules/tag_albums/views/tag_albums_album.html.php deleted file mode 100644 index 620d3c81..00000000 --- a/3.1/modules/tag_albums/views/tag_albums_album.html.php +++ /dev/null @@ -1,50 +0,0 @@ - -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). -?> -
        - dynamic_top() ?> -

        -
        -
        - - -
        -
        -
        -
        - - - -dynamic_bottom() ?> - -paginator() ?> diff --git a/3.1/modules/tag_albums/views/tag_albums_block.html.php b/3.1/modules/tag_albums/views/tag_albums_block.html.php deleted file mode 100644 index d4b08087..00000000 --- a/3.1/modules/tag_albums/views/tag_albums_block.html.php +++ /dev/null @@ -1,4 +0,0 @@ - - diff --git a/3.1/modules/tag_cloud/controllers/admin_tag_cloud.php b/3.1/modules/tag_cloud/controllers/admin_tag_cloud.php deleted file mode 100644 index 2d42e703..00000000 --- a/3.1/modules/tag_cloud/controllers/admin_tag_cloud.php +++ /dev/null @@ -1,90 +0,0 @@ -content = new View("admin_tag_cloud.html"); - $view->content->form = $this->_get_admin_form(); - - print $view; - } - - public function edit() { - access::verify_csrf(); - - $form = $this->_get_admin_form(); - if ($form->validate()) { - $options = $form->tag_cloud_options; - $valid = true; - if (preg_match("/^0x[0-9A-Fa-f]{6}$/", $options->tagcolor->value) == 0) { - $options->tagcolor->add_error("not_valid", 1); - $valid = false; - } - if (preg_match("/^0x[0-9A-Fa-f]{6}$/", $options->background_color->value) == 0) { - $options->background_color->add_error("not_valid", 1); - $valid = false; - } - if ($valid) { - module::set_var("tag_cloud", "tagcolor", $options->tagcolor->value); - module::set_var("tag_cloud", "mouseover", $options->mouseover->value); - module::set_var("tag_cloud", "background_color", $options->background_color->value); - module::set_var("tag_cloud", "transparent", $options->transparent->value); - module::set_var("tag_cloud", "speed", $options->speed->value); - module::set_var("tag_cloud", "distribution", $options->distribution->value); - message::success(t("Tag cloud options updated successfully")); - url::redirect("admin/tag_cloud"); - } - } - - $view = new Admin_View("admin.html"); - $view->content = new View("admin_tag_cloud.html"); - $view->content->form = $form; - - print $view; - } - - private function _get_admin_form() { - $form = new Forge("admin/tag_cloud/edit", "", "post", - array("id" => "g-tag-cloud-admin-form")); - $group = $form->group("tag_cloud_options")->label(t("Tag Cloud Options")); - $group->input("tagcolor") ->label(t("Tag color")) - ->value(module::get_var("tag_cloud", "tagcolor", "0x333333")) - ->error_message("not_valid", t("The color value must be specified as '0xhhhhhh'")) - ->rules("required|length[8]"); - $group->input("mouseover") ->label(t("Tag mouseover color")) - ->value(module::get_var("tag_cloud", "mouseover", "0x000000")) - ->error_message("not_valid", t("The color value must be specified as '0xhhhhhh'")) - ->rules("required|length[8]"); - $group->input("background_color")->label(t("Background color")) - ->value(module::get_var("tag_cloud", "background_color", "0xffffff")) - ->error_message("not_valid", t("The color value must be specified as '0xhhhhhh'")) - ->rules("required|length[8]"); - $group->checkbox("transparent")->label(t("Transparent mode")) - ->checked(module::get_var("tag_cloud", "transparent", 0) == 1); - $group->input("speed")->label(t("Rotation speed")) - ->value(module::get_var("tag_cloud", "speed", "100")) - ->rules("required|valid_numeric|length[1,3]"); - $group->checkbox("distribution")->label(t("Distribute tags evenly")) - ->checked(module::get_var("tag_cloud", "distribution", 1) == 1); - $group->submit("")->value(t("Save")); - - return $form; - } -} diff --git a/3.1/modules/tag_cloud/helpers/tag_cloud_event.php b/3.1/modules/tag_cloud/helpers/tag_cloud_event.php deleted file mode 100644 index 09ed3fa7..00000000 --- a/3.1/modules/tag_cloud/helpers/tag_cloud_event.php +++ /dev/null @@ -1,28 +0,0 @@ -get("appearance_menu") - ->append(Menu::factory("link") - ->id("tag_cloud") - ->label(t("Tag Cloud")) - ->url(url::site("admin/tag_cloud"))); - } -} diff --git a/3.1/modules/tag_cloud/helpers/tag_cloud_theme.php b/3.1/modules/tag_cloud/helpers/tag_cloud_theme.php deleted file mode 100644 index e804d2e1..00000000 --- a/3.1/modules/tag_cloud/helpers/tag_cloud_theme.php +++ /dev/null @@ -1,25 +0,0 @@ -script("swfobject.js") - . $theme->script("tag_cloud.js"); - } -} \ No newline at end of file diff --git a/3.1/modules/tag_cloud/js/tag_cloud.js b/3.1/modules/tag_cloud/js/tag_cloud.js deleted file mode 100644 index 006b2949..00000000 --- a/3.1/modules/tag_cloud/js/tag_cloud.js +++ /dev/null @@ -1,89 +0,0 @@ -(function($) { - $.widget("ui.gallery_tag_cloud", { - _init: function() { - var self = this; - self._set_tag_cloud(); - this._ajax_form(); - this._autocomplete(); - }, - - _autocomplete: function() { - var url = $("#g-tag-cloud").attr("ref") + "/autocomplete"; - $("#g-add-tag-form input:text").autocomplete( - url, { - max: 30, - multiple: true, - multipleSeparator: ',', - cacheLength: 1} - ); - }, - - _ajax_form: function() { - var self = this; - var form = $("#g-add-tag-form"); - form.ajaxForm({ - dataType: "json", - success: function(data) { - if (data.result == "success") { - $.get($("#g-tag-cloud").attr("ref"), function(data, textStatus) { - $("#g-tag-cloud-movie").remove(); - $("#g-tag-cloud").append("
        " + data + "
        "); - self._set_tag_cloud(); - }); - } - form.resetForm(); - $("#g-add-tag-form :text").blur(); - } - }); - }, - - _set_tag_cloud: function() { - var self = this; - var taglist = $("#g-tag-cloud a"); - - if (taglist.length == 0) { - return; - } - var width = $("#g-tag-cloud").width(); - var tags = document.createElement("tags"); - taglist.each(function(i) { - var addr = $(this).clone(); - $(addr).attr("style", "font-size: 14pt;"); - $(tags).append(addr); - }); - - var flashvars = { - tcolor: self.options.tcolor, - tcolor2: self.options.tcolor2, - mode: "tags", - distr: self.options.distr, - tspeed: self.options.tspeed, - hicolor: self.options.hicolor, - tagcloud: escape("" + $(tags).html() + "").toLowerCase() - }; - var params = { - bgcolor: self.options.bgColor, - wmode: self.options.wmode, - allowscriptaccess: self.options.scriptAccess - }; - - swfobject.embedSWF(self.options.movie, "g-tag-cloud-movie", width, .60 * width, "9", false, - flashvars, params); - } - }); - - $.extend($.ui.gallery_tag_cloud, { - defaults: { - bgColor: "0xFFFFFF", - wmode: "transparent", - scriptAccess: "always", - tcolor: "0x333333", - tcolor2: "0x009900", - hicolor: "0x000000", - tspeed: "100", - distr: "true", - mode: "tag" - } - }); - -})(jQuery); diff --git a/3.1/modules/tag_cloud/lib/license.txt b/3.1/modules/tag_cloud/lib/license.txt deleted file mode 100644 index 94a9ed02..00000000 --- a/3.1/modules/tag_cloud/lib/license.txt +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 3 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, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/3.1/modules/tag_cloud/lib/tagcloud.swf b/3.1/modules/tag_cloud/lib/tagcloud.swf deleted file mode 100644 index 99a8984a..00000000 Binary files a/3.1/modules/tag_cloud/lib/tagcloud.swf and /dev/null differ diff --git a/3.1/modules/tag_cloud/module.info b/3.1/modules/tag_cloud/module.info deleted file mode 100644 index 72c95532..00000000 --- a/3.1/modules/tag_cloud/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Tag Cloud" -description = "3D tag cloud" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:tag_cloud" -discuss_url = "http://gallery.menalto.com/forum_module_tag_cloud" diff --git a/3.1/modules/tag_cloud/views/admin_tag_cloud.html.php b/3.1/modules/tag_cloud/views/admin_tag_cloud.html.php deleted file mode 100644 index b0e752d5..00000000 --- a/3.1/modules/tag_cloud/views/admin_tag_cloud.html.php +++ /dev/null @@ -1,7 +0,0 @@ - -
        -

        - -

        - -
        diff --git a/3.1/modules/tag_cloud/views/tag_cloud_block.html.php b/3.1/modules/tag_cloud/views/tag_cloud_block.html.php deleted file mode 100644 index b4ccb10c..00000000 --- a/3.1/modules/tag_cloud/views/tag_cloud_block.html.php +++ /dev/null @@ -1,18 +0,0 @@ - - -
        "> -
        - -
        -
        - - diff --git a/3.1/modules/tag_cloud_page/controllers/tag_cloud_page.php b/3.1/modules/tag_cloud_page/controllers/tag_cloud_page.php deleted file mode 100644 index 2fc045df..00000000 --- a/3.1/modules/tag_cloud_page/controllers/tag_cloud_page.php +++ /dev/null @@ -1,66 +0,0 @@ -content = new View("tag_cloud_page_cloud.html"); - $template->content->title = t("Tag Cloud"); - - // If the tag cloud module is active, load its settings from the database. - if (module::is_active("tag_cloud")) { - $options = array(); - foreach (array("tagcolor", "background_color", "mouseover", "transparent", "speed", "distribution") - as $option) { - $value = module::get_var("tag_cloud", $option, null); - if (!empty($value)) { - switch ($option) { - case "tagcolor": - $options["tcolor"] = $value; - break; - case "mouseover": - $options["hicolor"] = $value; - break; - case "background_color": - $options["bgColor"] = $value; - break; - case "transparent": - $options["wmode"] = "transparent"; - break; - case "speed": - $options["tspeed"] = $value; - break; - case "distribution": - $options["distr"] = "true"; - break; - } - } - } - $template->content->options = $options; - } - - // Display the page. - print $template; - } -} diff --git a/3.1/modules/tag_cloud_page/css/tag_cloud_page.css b/3.1/modules/tag_cloud_page/css/tag_cloud_page.css deleted file mode 100644 index 1eacad23..00000000 --- a/3.1/modules/tag_cloud_page/css/tag_cloud_page.css +++ /dev/null @@ -1,73 +0,0 @@ -/* Tag cloud page ~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-tag-cloud-page ul { - font-size: 1.2em; - text-align: justify; -} - -#g-tag-cloud-page ul li { - display: inline; - line-height: 1.5em; - text-align: justify; -} - -#g-tag-cloud-page ul li a { - text-decoration: none; -} - -#g-tag-cloud-page ul li span { - display: none; -} - -#g-tag-cloud-page ul li.size0 a { - color: #9cf; - font-size: 70%; - font-weight: 100; -} - -#g-tag-cloud-page ul li.size1 a { - color: #9cf; - font-size: 80%; - font-weight: 100; -} - -#g-tag-cloud-page ul li.size2 a { - color: #69f; - font-size: 90%; - font-weight: 300; -} - -#g-tag-cloud-page ul li.size3 a { - color: #69c; - font-size: 100%; - font-weight: 500; -} - -#g-tag-cloud-page ul li.size4 a { - color: #369; - font-size: 110%; - font-weight: 700; -} - -#g-tag-cloud-page ul li.size5 a { - color: #0e2b52; - font-size: 120%; - font-weight: 900; -} - -#g-tag-cloud-page ul li.size6 a { - color: #0e2b52; - font-size: 130%; - font-weight: 900; -} - -#g-tag-cloud-page ul li.size7 a { - color: #0e2b52; - font-size: 140%; - font-weight: 900; -} - -#g-tag-cloud-page ul li a:hover { - color: #f30; - text-decoration: underline; -} diff --git a/3.1/modules/tag_cloud_page/helpers/tag_cloud_page_block.php b/3.1/modules/tag_cloud_page/helpers/tag_cloud_page_block.php deleted file mode 100644 index 4ac5278b..00000000 --- a/3.1/modules/tag_cloud_page/helpers/tag_cloud_page_block.php +++ /dev/null @@ -1,40 +0,0 @@ - t("Tag Cloud Page Link")); - } - - static function get($block_id, $theme) { - // Generate the sidebar block for linking to the tag cloud page. - $block = ""; - switch ($block_id) { - case "tag_cloud_page": - $block = new Block(); - $block->css_id = "g-tag-cloud-page"; - $block->title = t("Tag Cloud"); - $block->content = new View("tag_cloud_page_block.html"); - - break; - } - return $block; - } -} diff --git a/3.1/modules/tag_cloud_page/helpers/tag_cloud_page_event.php b/3.1/modules/tag_cloud_page/helpers/tag_cloud_page_event.php deleted file mode 100644 index 32f0ada0..00000000 --- a/3.1/modules/tag_cloud_page/helpers/tag_cloud_page_event.php +++ /dev/null @@ -1,40 +0,0 @@ -deactivate)) { - site_status::warning( - t("The Tag Cloud Page module requires the Tags module. " . - "Activate the Tags module now", - 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."); - } - } -} diff --git a/3.1/modules/tag_cloud_page/helpers/tag_cloud_page_installer.php b/3.1/modules/tag_cloud_page/helpers/tag_cloud_page_installer.php deleted file mode 100644 index 4f12115a..00000000 --- a/3.1/modules/tag_cloud_page/helpers/tag_cloud_page_installer.php +++ /dev/null @@ -1,32 +0,0 @@ -script("tag_cloud_page.js"); - } - - // Load the tag cloud page's css code. - return $theme->css("tag_cloud_page.css"); - } -} diff --git a/3.1/modules/tag_cloud_page/js/tag_cloud_page.js b/3.1/modules/tag_cloud_page/js/tag_cloud_page.js deleted file mode 100644 index 66d1ddab..00000000 --- a/3.1/modules/tag_cloud_page/js/tag_cloud_page.js +++ /dev/null @@ -1,89 +0,0 @@ -(function($) { - $.widget("ui.gallery_tag_cloud_page", { - _init: function() { - var self = this; - self._set_tag_cloud(); - this._ajax_form(); - this._autocomplete(); - }, - - _autocomplete: function() { - var url = $("#g-tag-cloud-page-animation").attr("ref") + "/autocomplete"; - $("#g-add-tag-form input:text").autocomplete( - url, { - max: 30, - multiple: true, - multipleSeparator: ',', - cacheLength: 1} - ); - }, - - _ajax_form: function() { - var self = this; - var form = $("#g-add-tag-form"); - form.ajaxForm({ - dataType: "json", - success: function(data) { - if (data.result == "success") { - $.get($("#g-tag-cloud-page-animation").attr("ref"), function(data, textStatus) { - $("#g-tag-cloud-movie-page").remove(); - $("#g-tag-cloud-page-animation").append("
        " + data + "
        "); - self._set_tag_cloud(); - }); - } - form.resetForm(); - $("#g-add-tag-form :text").blur(); - } - }); - }, - - _set_tag_cloud: function() { - var self = this; - var taglist = $("#g-tag-cloud-page-animation a"); - - if (taglist.length == 0) { - return; - } - var width = $("#g-tag-cloud-page-animation").width(); - var tags = document.createElement("tags"); - taglist.each(function(i) { - var addr = $(this).clone(); - $(addr).attr("style", "font-size: 14pt;"); - $(tags).append(addr); - }); - - var flashvars = { - tcolor: self.options.tcolor, - tcolor2: self.options.tcolor2, - mode: "tags", - distr: self.options.distr, - tspeed: self.options.tspeed, - hicolor: self.options.hicolor, - tagcloud: escape("" + $(tags).html() + "").toLowerCase() - }; - var params = { - bgcolor: self.options.bgColor, - wmode: self.options.wmode, - allowscriptaccess: self.options.scriptAccess - }; - - swfobject.embedSWF(self.options.movie, "g-tag-cloud-movie-page", width, .60 * width, "9", false, - flashvars, params); - } - }); - - $.extend($.ui.gallery_tag_cloud_page, { - defaults: { - bgColor: "0xFFFFFF", - wmode: "transparent", - scriptAccess: "always", - tcolor: "0x333333", - tcolor2: "0x009900", - hicolor: "0x000000", - tspeed: "100", - distr: "true", - mode: "tag" - } - }); - -})(jQuery); diff --git a/3.1/modules/tag_cloud_page/module.info b/3.1/modules/tag_cloud_page/module.info deleted file mode 100644 index aebb40cb..00000000 --- a/3.1/modules/tag_cloud_page/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Tag Cloud Page" -description = "Displays a tag cloud of all tags used in the Gallery on a seperate page." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:tag_cloud_page" -discuss_url = "http://gallery.menalto.com/forum_module_tag_cloud_page" diff --git a/3.1/modules/tag_cloud_page/views/tag_cloud_page_block.html.php b/3.1/modules/tag_cloud_page/views/tag_cloud_page_block.html.php deleted file mode 100644 index 46fd70ea..00000000 --- a/3.1/modules/tag_cloud_page/views/tag_cloud_page_block.html.php +++ /dev/null @@ -1,2 +0,0 @@ - -">View cloud diff --git a/3.1/modules/tag_cloud_page/views/tag_cloud_page_cloud.html.php b/3.1/modules/tag_cloud_page/views/tag_cloud_page_cloud.html.php deleted file mode 100644 index acd31ed4..00000000 --- a/3.1/modules/tag_cloud_page/views/tag_cloud_page_cloud.html.php +++ /dev/null @@ -1,35 +0,0 @@ - -
        -
        - dynamic_top() ?> -
        -

        -
        -
        - - - -
        -
        "> -
        - count_all()); ?> -
        -
        -
        - - -
        - count_all()); ?> -
        - - -dynamic_bottom() ?> diff --git a/3.1/modules/tag_it/controllers/tag_it.php b/3.1/modules/tag_it/controllers/tag_it.php deleted file mode 100644 index 53dc5bf3..00000000 --- a/3.1/modules/tag_it/controllers/tag_it.php +++ /dev/null @@ -1,29 +0,0 @@ -tags = tag::item_tags($item); - print $view; - } -} diff --git a/3.1/modules/tag_it/helpers/tag_it_block.php b/3.1/modules/tag_it/helpers/tag_it_block.php deleted file mode 100644 index a26064e3..00000000 --- a/3.1/modules/tag_it/helpers/tag_it_block.php +++ /dev/null @@ -1,67 +0,0 @@ - t("Tag it")); - } - - static function get($block_id, $theme) { - if (identity::active_user()->guest) { - return; - } - - $block = ""; - switch ($block_id) { - case "untagged_photo": - $attempts = 0; - do { - $item = item::random_query() - ->join("items_tags", "items.id", "items_tags.item_id", "left") - ->where("items.type", "!=", "album") - ->where("items_tags.item_id", "IS", null) - ->find_all(1) - ->current(); - } while (!$item && $attempts++ < 3); - if ($item && $item->loaded()) { - $block = new Block(); - $block->css_id = "g-tag-it-block"; - $block->title = t("Tag it"); - $block->content = new View("tag_it_block.html"); - $block->content->item = $item; - - $form = new Forge("tags/create/{$item->id}", "", "post", - array("id" => "g-tag-it-add-tag-form", "class" => "g-short-form")); - $label = $item->is_album() ? - t("Add tag to album") : - ($item->is_photo() ? t("Add tag to photo") : t("Add tag to movie")); - - $group = $form->group("add_tag")->label("Add Tag"); - $group->input("name")->label($label)->rules("required")->id("name"); - $group->hidden("item_id")->value($item->id); - $group->submit("")->value(t("Add Tag")); - - $block->content->form = $form; - } - break; - } - - return $block; - } -} diff --git a/3.1/modules/tag_it/module.info b/3.1/modules/tag_it/module.info deleted file mode 100644 index 743e7260..00000000 --- a/3.1/modules/tag_it/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Tag It" -description = "Present an untagged photo and ask the user to tag it." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:tag_it" -discuss_url = "http://gallery.menalto.com/forum_module_tag_it" diff --git a/3.1/modules/tag_it/views/tag_it_block.html.php b/3.1/modules/tag_it/views/tag_it_block.html.php deleted file mode 100644 index 95a57131..00000000 --- a/3.1/modules/tag_it/views/tag_it_block.html.php +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/3.1/modules/tag_it/views/tag_it_tags_for.html.php b/3.1/modules/tag_it/views/tag_it_tags_for.html.php deleted file mode 100644 index 3020ff98..00000000 --- a/3.1/modules/tag_it/views/tag_it_tags_for.html.php +++ /dev/null @@ -1,6 +0,0 @@ - - - - - -name}") ?>">name ?> diff --git a/3.1/modules/tagfaces/controllers/tagfaces.php b/3.1/modules/tagfaces/controllers/tagfaces.php deleted file mode 100644 index de7b8bfd..00000000 --- a/3.1/modules/tagfaces/controllers/tagfaces.php +++ /dev/null @@ -1,299 +0,0 @@ -set_global("item_id", $id); - $template->set_global("page_title", t("Draw Faces")); - $template->set_global("page_type", "other"); - $template->set_global("page_subtype", "photoface"); - $template->content = new View("drawfaces.html"); - $template->content->title = t("Tag Faces"); - $template->content->form = $this->_get_faces_form($id); - $template->content->delete_form = $this->_get_delfaces_form($id); - - // Display the page. - print $template; - } - - public function delface() { - // Delete the specified face data from the photo. - - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Convert submitted data to local variables. - // Figure out which tagged faces and notes to delete. - $tag_data = Input::instance()->post("facesList"); - $note_data = Input::instance()->post("notesList"); - // Figure out the item id, in order to reload the correct face tagging page. - $item_data = Input::instance()->post("item_id"); - - // If the user didn't select a tag or note, display and error and abort. - if ((count($tag_data) == 0) && (count($note_data) == 0)) { - message::error(t("Please select a tag or note to delete.")); - url::redirect("tagfaces/drawfaces/$item_data"); - return; - } - - // Delete the face(s) from the database. - foreach ($tag_data as $one_tag) { - db::build()->delete("items_faces")->where("id", "=", $one_tag)->execute(); - } - - // Delete the notes(s) from the database. - foreach ($note_data as $one_note) { - db::build()->delete("items_notes")->where("id", "=", $one_note)->execute(); - } - - // Display a success message for deleted faces. - if (count($tag_data) == 1) { - message::success(t("One face deleted.")); - } elseif (count($tag_data) > 1) { - message::success(count($tag_data) . t(" faces deleted.")); - } - - // Display a success message for deleted notes. - if (count($note_data) == 1) { - message::success(t("One note deleted.")); - } elseif (count($note_data) > 1) { - message::success(count($note_data) . t(" notes deleted.")); - } - - // Re-load the face tagging page. - url::redirect("tagfaces/drawfaces/$item_data"); - } - - public function saveface() { - // Save the face coordinates to the specified tag. - - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Convert submitted data to local variables. - $tag_data = Input::instance()->post("tagsList"); - $str_face_title = str_replace("'", "\'", Input::instance()->post("face_title")); - $str_face_description = str_replace("'", "\'", Input::instance()->post("face_description")); - $item_data = Input::instance()->post("item_id"); - $str_x1 = Input::instance()->post("x1"); - $str_y1 = Input::instance()->post("y1"); - $str_x2 = Input::instance()->post("x2"); - $str_y2 = Input::instance()->post("y2"); - - // If the user didn't select a face, display an error and abort. - if (($str_x1 == "") || ($str_x2 == "") || ($str_y1 == "") || ($str_y2 == "")) { - message::error(t("Please select a face.")); - url::redirect("tagfaces/drawfaces/$item_data"); - return; - } - - // Decide if we are saving a face or a note. - if ($tag_data == -1) { - // Make sure there's a title. - if ($str_face_title == "") { - message::error(t("Please select a Tag or specify a Title.")); - url::redirect("tagfaces/drawfaces/$item_data"); - return; - } - - // Save a new Note to the database. - $newnote = ORM::factory("items_note"); - $newnote->item_id = $item_data; - $newnote->x1 = $str_x1; - $newnote->y1 = $str_y1; - $newnote->x2 = $str_x2; - $newnote->y2 = $str_y2; - $newnote->title = $str_face_title; - $newnote->description = $str_face_description; - $newnote->save(); - - } else { - // Check to see if the tag already has a face associated with it. - $existingFace = ORM::factory("items_face") - ->where("tag_id", "=", $tag_data) - ->where("item_id", "=", $item_data) - ->find_all(); - - if (count($existingFace) == 0) { - // Save the new face to the database. - $newface = ORM::factory("items_face"); - $newface->tag_id = $tag_data; - $newface->item_id = $item_data; - $newface->x1 = $str_x1; - $newface->y1 = $str_y1; - $newface->x2 = $str_x2; - $newface->y2 = $str_y2; - $newface->description = $str_face_description; - $newface->save(); - } else { - // Update the coordinates of an existing face. - $updatedFace = ORM::factory("items_face", $existingFace[0]->id); - $updatedFace->x1 = $str_x1; - $updatedFace->y1 = $str_y1; - $updatedFace->x2 = $str_x2; - $updatedFace->y2 = $str_y2; - $updatedFace->description = $str_face_description; - $updatedFace->save(); - } - } - - // Redirect back to the main screen and display a "success" message. - message::success(t("Face saved.")); - url::redirect("tagfaces/drawfaces/$item_data"); - } - - private function _get_faces_form($id) { - // Generate the form that allows the user to select a tag to - // save the face too. Also displays the coordinates of the face - // and the "Save face" button. - - // Make a new Form. - $form = new Forge("tagfaces/saveface", "", "post", - array("id" => "g-tag-faces-form")); - - // Create an array of all the tags for the current item. - $all_tags = ORM::factory("tag") - ->join("items_tags", "tags.id", "items_tags.tag_id") - ->where("items_tags.item_id", "=", $id) - ->find_all(); - - // Generate an array of tags to use as checkboxes. - $array_tags = ""; - $array_tags[-1] = t("No Tag"); - foreach ($all_tags as $oneTag) { - $array_tags[$oneTag->id] = $oneTag->name; - } - - // Make a checklist of tags on the form. - $tags_group = $form->group("FaceTag") - ->label(t("Select a tag or enter in a title:")); - - $tags_group->dropdown('tagsList') - ->label(t("Tag:")) - ->id('tagsList') - ->options($array_tags); - - $tags_group->input("face_title") - ->id('face_title') - ->label(t("Note Title:")); - - $tags_description = $form->group("TagsDescription") - ->label(t("Description (optional):")); - $tags_description->input("face_description") - ->id('face_description'); - - // Generate input boxes to hold the coordinates of the face. - $coordinates_group = $form->group("FaceCoordinates") - ->label(t("Coordinates:")); - $coordinates_group->input('x1') - ->id('x1') - ->label(t("X1")); - $coordinates_group->input("y1") - ->id('y1') - ->label(t("Y1")); - $coordinates_group->input("x2") - ->id('x2') - ->label(t("X2")); - $coordinates_group->input("y2") - ->id('y2') - ->label(t("Y2")); - - // Add the id# of the photo and a save button to the form. - $coordinates_group->hidden("item_id")->value($id); - $form->submit("SaveFace")->value(t("Save face")); - - // Return the newly generated form. - return $form; - } - - private function _get_delfaces_form($id) { - // Generate a form to allow the user to remove face data - // from a photo. - // Make a new Form. - $form = new Forge("tagfaces/delface", "", "post", - array("id" => "g-tag-del-faces-form")); - - // Create an array of all the tags that already have faces. - $existing_faces = ORM::factory("items_face") - ->where("item_id", "=", $id) - ->find_all(); - - // turn the $existing_faces array into an array that can be used - // for a checklist. - $array_faces = ""; - foreach ($existing_faces as $oneFace) { - $array_faces[$oneFace->id] = array(ORM::factory("tag", - $oneFace->tag_id)->name, false); - } - - if ($array_faces) { - // Add a checklist to the form. - $tags_group = $form->group("ExistingFaces") - ->label(t("Tags with faces:")); - // Add the id# of the photo and a delete button to the form. - $tags_group->hidden("item_id")->value($id); - - $tags_group->checklist("facesList") - ->options($array_faces) - ->label(t("Select the tag(s) that correspond(s) to the face(s) you wish to delete:")); - } - - // Create an array of all the notes associated with this photo. - $existing_notes = ORM::factory("items_note") - ->where("item_id", "=", $id) - ->find_all(); - - // turn the $existing_notes array into an array that can be used - // for a checklist. - $array_notes = ""; - foreach ($existing_notes as $oneNote) { - $array_notes[$oneNote->id] = array($oneNote->title, false); - } - - if ($array_notes) { - // Add a checklist to the form. - $notes_group = $form->group("ExistingNotes") - ->label(t("Notes:")); - // Add the id# of the photo and a delete button to the form. - $notes_group->hidden("item_id")->value($id); - - $notes_group->checklist("notesList") - ->options($array_notes) - ->label(t("Select the notes you wish to delete:")); - } - - // Hide the delete button when there's nothing to delete. - if (($array_notes) || ($array_faces)) { - $form->submit("DeleteFace")->value(t("Delete face(s) / note(s)")); - } else { - $form->group("NoFacesNotes")->label(t("There is nothing to delete for this photo.")); - } - - // Return the newly generated form. - return $form; - } -} diff --git a/3.1/modules/tagfaces/helpers/tagfaces_event.php b/3.1/modules/tagfaces/helpers/tagfaces_event.php deleted file mode 100644 index d1c47a61..00000000 --- a/3.1/modules/tagfaces/helpers/tagfaces_event.php +++ /dev/null @@ -1,71 +0,0 @@ -deactivate)) { - site_status::warning( - t("The TagFaces module requires the Tags module. " . - "Activate the Tags module now", - array("url" => url::site("admin/modules"))), - "tagfaces_needs_tag"); - } else { - site_status::clear("tagfaces_needs_tag"); - } - } - - static function site_menu($menu, $theme) { - // Create a menu option for adding face data. - if (!$theme->item()) { - return; - } - - $item = $theme->item(); - - if ($item->is_photo()) { - if ((access::can("view", $item)) && (access::can("edit", $item))) { - $menu->get("options_menu") - ->append(Menu::factory("link") - ->id("tagfaces") - ->label(t("Tag faces")) - ->css_id("g-tag-faces-link") - ->url(url::site("tagfaces/drawfaces/" . $item->id))); - } - } - } - - static function item_deleted($item) { - // Check for and delete existing Faces and Notes. - $existingFaces = ORM::factory("items_face") - ->where("item_id", "=", $item->id) - ->find_all(); - if (count($existingFaces) > 0) { - db::build()->delete("items_faces")->where("item_id", "=", $item->id)->execute(); - } - - $existingNotes = ORM::factory("items_note") - ->where("item_id", "=", $item->id) - ->find_all(); - if (count($existingNotes) > 0) { - db::build()->delete("items_notes")->where("item_id", "=", $item->id)->execute(); - } - } -} diff --git a/3.1/modules/tagfaces/helpers/tagfaces_installer.php b/3.1/modules/tagfaces/helpers/tagfaces_installer.php deleted file mode 100644 index 29ff1dd4..00000000 --- a/3.1/modules/tagfaces/helpers/tagfaces_installer.php +++ /dev/null @@ -1,85 +0,0 @@ -query("CREATE TABLE IF NOT EXISTS {items_faces} ( - `id` int(9) NOT NULL auto_increment, - `tag_id` int(9) NOT NULL, - `item_id` int(9) NOT NULL, - `x1` int(9) NOT NULL, - `y1` int(9) NOT NULL, - `x2` int(9) NOT NULL, - `y2` int(9) NOT NULL, - `description` varchar(2048) default NULL, - PRIMARY KEY (`id`)) - DEFAULT CHARSET=utf8;"); - - $db->query("CREATE TABLE IF NOT EXISTS {items_notes} ( - `id` int(9) NOT NULL auto_increment, - `item_id` int(9) NOT NULL, - `x1` int(9) NOT NULL, - `y1` int(9) NOT NULL, - `x2` int(9) NOT NULL, - `y2` int(9) NOT NULL, - `title` varchar(64) NOT NULL, - `description` varchar(2048) default NULL, - PRIMARY KEY (`id`)) - DEFAULT CHARSET=utf8;"); - - // Set the module's version number. - module::set_version("tagfaces", 2); - } - - static function upgrade($version) { - $db = Database::instance(); - if ($version == 1) { - $db->query("ALTER TABLE {items_faces} ADD `description` varchar(2048) default NULL"); - - $db->query("CREATE TABLE IF NOT EXISTS {items_notes} ( - `id` int(9) NOT NULL auto_increment, - `item_id` int(9) NOT NULL, - `x1` int(9) NOT NULL, - `y1` int(9) NOT NULL, - `x2` int(9) NOT NULL, - `y2` int(9) NOT NULL, - `title` varchar(64) NOT NULL, - `description` varchar(2048) default NULL, - PRIMARY KEY (`id`)) - DEFAULT CHARSET=utf8;"); - - module::set_version("tagfaces", $version = 2); - } - } - - static function deactivate() { - // Clear the require tags message when tagfaces is deactivated. - site_status::clear("tagfaces_needs_tag"); - } - - static function uninstall() { - // Delete the face table before uninstalling. - $db = Database::instance(); - $db->query("DROP TABLE IF EXISTS {items_faces};"); - $db->query("DROP TABLE IF EXISTS {items_notes};"); - module::delete("tagfaces"); - } -} diff --git a/3.1/modules/tagfaces/helpers/tagfaces_theme.php b/3.1/modules/tagfaces/helpers/tagfaces_theme.php deleted file mode 100644 index 03ce7faf..00000000 --- a/3.1/modules/tagfaces/helpers/tagfaces_theme.php +++ /dev/null @@ -1,38 +0,0 @@ -item; - - $existingFaces = ORM::factory("items_face") - ->where("item_id", "=", $item->id) - ->find_all(); - $existingNotes = ORM::factory("items_note") - ->where("item_id", "=", $item->id) - ->find_all(); - - // If it does, add an image map to the page to display them. - if ((count($existingFaces) > 0) || (count($existingNotes) > 0)) { - return new View("drawfaces_highlight_block.html"); - } - } -} diff --git a/3.1/modules/tagfaces/images/Jcrop.gif b/3.1/modules/tagfaces/images/Jcrop.gif deleted file mode 100644 index 72ea7ccb..00000000 Binary files a/3.1/modules/tagfaces/images/Jcrop.gif and /dev/null differ diff --git a/3.1/modules/tagfaces/js/jquery.Jcrop.js b/3.1/modules/tagfaces/js/jquery.Jcrop.js deleted file mode 100644 index d938e203..00000000 --- a/3.1/modules/tagfaces/js/jquery.Jcrop.js +++ /dev/null @@ -1,1197 +0,0 @@ -/** - * jquery.Jcrop.js v0.9.8 - * jQuery Image Cropping Plugin - * @author Kelly Hallman - * Copyright (c) 2008-2009 Kelly Hallman - released under MIT License {{{ - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - - * }}} - */ - -(function($) { - -$.Jcrop = function(obj,opt) -{ - // Initialization {{{ - - // Sanitize some options {{{ - var obj = obj, opt = opt; - - if (typeof(obj) !== 'object') obj = $(obj)[0]; - if (typeof(opt) !== 'object') opt = { }; - - // Some on-the-fly fixes for MSIE...sigh - if (!('trackDocument' in opt)) - { - opt.trackDocument = $.browser.msie ? false : true; - if ($.browser.msie && $.browser.version.split('.')[0] == '8') - opt.trackDocument = true; - } - - if (!('keySupport' in opt)) - opt.keySupport = $.browser.msie ? false : true; - - // }}} - // Extend the default options {{{ - var defaults = { - - // Basic Settings - trackDocument: false, - baseClass: 'jcrop', - addClass: null, - - // Styling Options - bgColor: 'black', - bgOpacity: .6, - borderOpacity: .4, - handleOpacity: .5, - - handlePad: 5, - handleSize: 9, - handleOffset: 5, - edgeMargin: 14, - - aspectRatio: 0, - keySupport: true, - cornerHandles: true, - sideHandles: true, - drawBorders: true, - dragEdges: true, - - boxWidth: 0, - boxHeight: 0, - - boundary: 8, - animationDelay: 20, - swingSpeed: 3, - - allowSelect: true, - allowMove: true, - allowResize: true, - - minSelect: [ 0, 0 ], - maxSize: [ 0, 0 ], - minSize: [ 0, 0 ], - - // Callbacks / Event Handlers - onChange: function() { }, - onSelect: function() { } - - }; - var options = defaults; - setOptions(opt); - - // }}} - // Initialize some jQuery objects {{{ - - var $origimg = $(obj); - var $img = $origimg.clone().removeAttr('id').css({ position: 'static' }); - - $img.width($origimg.width()); - $img.height($origimg.height()); - $origimg.after($img).hide(); - - presize($img,options.boxWidth,options.boxHeight); - - var boundx = $img.width(), - boundy = $img.height(), - - $div = $('
        ') - .width(boundx).height(boundy) - .addClass(cssClass('holder')) - .css({ - position: 'relative', - backgroundColor: options.bgColor - }).insertAfter($origimg).append($img); - ; - - if (options.addClass) $div.addClass(options.addClass); - //$img.wrap($div); - - var $img2 = $('')/*{{{*/ - .attr('src',$img.attr('src')) - .css('position','absolute') - .width(boundx).height(boundy) - ;/*}}}*/ - var $img_holder = $('
        ')/*{{{*/ - .width(pct(100)).height(pct(100)) - .css({ - zIndex: 310, - position: 'absolute', - overflow: 'hidden' - }) - .append($img2) - ;/*}}}*/ - var $hdl_holder = $('
        ')/*{{{*/ - .width(pct(100)).height(pct(100)) - .css('zIndex',320); - /*}}}*/ - var $sel = $('
        ')/*{{{*/ - .css({ - position: 'absolute', - zIndex: 300 - }) - .insertBefore($img) - .append($img_holder,$hdl_holder) - ;/*}}}*/ - - var bound = options.boundary; - var $trk = newTracker().width(boundx+(bound*2)).height(boundy+(bound*2)) - .css({ position: 'absolute', top: px(-bound), left: px(-bound), zIndex: 290 }) - .mousedown(newSelection); - - /* }}} */ - // Set more variables {{{ - - var xlimit, ylimit, xmin, ymin; - var xscale, yscale, enabled = true; - var docOffset = getPos($img), - // Internal states - btndown, lastcurs, dimmed, animating, - shift_down; - - // }}} - - - // }}} - // Internal Modules {{{ - - var Coords = function()/*{{{*/ - { - var x1 = 0, y1 = 0, x2 = 0, y2 = 0, ox, oy; - - function setPressed(pos)/*{{{*/ - { - var pos = rebound(pos); - x2 = x1 = pos[0]; - y2 = y1 = pos[1]; - }; - /*}}}*/ - function setCurrent(pos)/*{{{*/ - { - var pos = rebound(pos); - ox = pos[0] - x2; - oy = pos[1] - y2; - x2 = pos[0]; - y2 = pos[1]; - }; - /*}}}*/ - function getOffset()/*{{{*/ - { - return [ ox, oy ]; - }; - /*}}}*/ - function moveOffset(offset)/*{{{*/ - { - var ox = offset[0], oy = offset[1]; - - if (0 > x1 + ox) ox -= ox + x1; - if (0 > y1 + oy) oy -= oy + y1; - - if (boundy < y2 + oy) oy += boundy - (y2 + oy); - if (boundx < x2 + ox) ox += boundx - (x2 + ox); - - x1 += ox; - x2 += ox; - y1 += oy; - y2 += oy; - }; - /*}}}*/ - function getCorner(ord)/*{{{*/ - { - var c = getFixed(); - switch(ord) - { - case 'ne': return [ c.x2, c.y ]; - case 'nw': return [ c.x, c.y ]; - case 'se': return [ c.x2, c.y2 ]; - case 'sw': return [ c.x, c.y2 ]; - } - }; - /*}}}*/ - function getFixed()/*{{{*/ - { - if (!options.aspectRatio) return getRect(); - // This function could use some optimization I think... - var aspect = options.aspectRatio, - min_x = options.minSize[0]/xscale, - min_y = options.minSize[1]/yscale, - max_x = options.maxSize[0]/xscale, - max_y = options.maxSize[1]/yscale, - rw = x2 - x1, - rh = y2 - y1, - rwa = Math.abs(rw), - rha = Math.abs(rh), - real_ratio = rwa / rha, - xx, yy - ; - if (max_x == 0) { max_x = boundx * 10 } - if (max_y == 0) { max_y = boundy * 10 } - if (real_ratio < aspect) - { - yy = y2; - w = rha * aspect; - xx = rw < 0 ? x1 - w : w + x1; - - if (xx < 0) - { - xx = 0; - h = Math.abs((xx - x1) / aspect); - yy = rh < 0 ? y1 - h: h + y1; - } - else if (xx > boundx) - { - xx = boundx; - h = Math.abs((xx - x1) / aspect); - yy = rh < 0 ? y1 - h : h + y1; - } - } - else - { - xx = x2; - h = rwa / aspect; - yy = rh < 0 ? y1 - h : y1 + h; - if (yy < 0) - { - yy = 0; - w = Math.abs((yy - y1) * aspect); - xx = rw < 0 ? x1 - w : w + x1; - } - else if (yy > boundy) - { - yy = boundy; - w = Math.abs(yy - y1) * aspect; - xx = rw < 0 ? x1 - w : w + x1; - } - } - - // Magic %-) - if(xx > x1) { // right side - if(xx - x1 < min_x) { - xx = x1 + min_x; - } else if (xx - x1 > max_x) { - xx = x1 + max_x; - } - if(yy > y1) { - yy = y1 + (xx - x1)/aspect; - } else { - yy = y1 - (xx - x1)/aspect; - } - } else if (xx < x1) { // left side - if(x1 - xx < min_x) { - xx = x1 - min_x - } else if (x1 - xx > max_x) { - xx = x1 - max_x; - } - if(yy > y1) { - yy = y1 + (x1 - xx)/aspect; - } else { - yy = y1 - (x1 - xx)/aspect; - } - } - - if(xx < 0) { - x1 -= xx; - xx = 0; - } else if (xx > boundx) { - x1 -= xx - boundx; - xx = boundx; - } - - if(yy < 0) { - y1 -= yy; - yy = 0; - } else if (yy > boundy) { - y1 -= yy - boundy; - yy = boundy; - } - - return last = makeObj(flipCoords(x1,y1,xx,yy)); - }; - /*}}}*/ - function rebound(p)/*{{{*/ - { - if (p[0] < 0) p[0] = 0; - if (p[1] < 0) p[1] = 0; - - if (p[0] > boundx) p[0] = boundx; - if (p[1] > boundy) p[1] = boundy; - - return [ p[0], p[1] ]; - }; - /*}}}*/ - function flipCoords(x1,y1,x2,y2)/*{{{*/ - { - var xa = x1, xb = x2, ya = y1, yb = y2; - if (x2 < x1) - { - xa = x2; - xb = x1; - } - if (y2 < y1) - { - ya = y2; - yb = y1; - } - return [ Math.round(xa), Math.round(ya), Math.round(xb), Math.round(yb) ]; - }; - /*}}}*/ - function getRect()/*{{{*/ - { - var xsize = x2 - x1; - var ysize = y2 - y1; - - if (xlimit && (Math.abs(xsize) > xlimit)) - x2 = (xsize > 0) ? (x1 + xlimit) : (x1 - xlimit); - if (ylimit && (Math.abs(ysize) > ylimit)) - y2 = (ysize > 0) ? (y1 + ylimit) : (y1 - ylimit); - - if (ymin && (Math.abs(ysize) < ymin)) - y2 = (ysize > 0) ? (y1 + ymin) : (y1 - ymin); - if (xmin && (Math.abs(xsize) < xmin)) - x2 = (xsize > 0) ? (x1 + xmin) : (x1 - xmin); - - if (x1 < 0) { x2 -= x1; x1 -= x1; } - if (y1 < 0) { y2 -= y1; y1 -= y1; } - if (x2 < 0) { x1 -= x2; x2 -= x2; } - if (y2 < 0) { y1 -= y2; y2 -= y2; } - if (x2 > boundx) { var delta = x2 - boundx; x1 -= delta; x2 -= delta; } - if (y2 > boundy) { var delta = y2 - boundy; y1 -= delta; y2 -= delta; } - if (x1 > boundx) { var delta = x1 - boundy; y2 -= delta; y1 -= delta; } - if (y1 > boundy) { var delta = y1 - boundy; y2 -= delta; y1 -= delta; } - - return makeObj(flipCoords(x1,y1,x2,y2)); - }; - /*}}}*/ - function makeObj(a)/*{{{*/ - { - return { x: a[0], y: a[1], x2: a[2], y2: a[3], - w: a[2] - a[0], h: a[3] - a[1] }; - }; - /*}}}*/ - - return { - flipCoords: flipCoords, - setPressed: setPressed, - setCurrent: setCurrent, - getOffset: getOffset, - moveOffset: moveOffset, - getCorner: getCorner, - getFixed: getFixed - }; - }(); - - /*}}}*/ - var Selection = function()/*{{{*/ - { - var start, end, dragmode, awake, hdep = 370; - var borders = { }; - var handle = { }; - var seehandles = false; - var hhs = options.handleOffset; - - /* Insert draggable elements {{{*/ - - // Insert border divs for outline - if (options.drawBorders) { - borders = { - top: insertBorder('hline') - .css('top',$.browser.msie?px(-1):px(0)), - bottom: insertBorder('hline'), - left: insertBorder('vline'), - right: insertBorder('vline') - }; - } - - // Insert handles on edges - if (options.dragEdges) { - handle.t = insertDragbar('n'); - handle.b = insertDragbar('s'); - handle.r = insertDragbar('e'); - handle.l = insertDragbar('w'); - } - - // Insert side handles - options.sideHandles && - createHandles(['n','s','e','w']); - - // Insert corner handles - options.cornerHandles && - createHandles(['sw','nw','ne','se']); - - /*}}}*/ - // Private Methods - function insertBorder(type)/*{{{*/ - { - var jq = $('
        ') - .css({position: 'absolute', opacity: options.borderOpacity }) - .addClass(cssClass(type)); - $img_holder.append(jq); - return jq; - }; - /*}}}*/ - function dragDiv(ord,zi)/*{{{*/ - { - var jq = $('
        ') - .mousedown(createDragger(ord)) - .css({ - cursor: ord+'-resize', - position: 'absolute', - zIndex: zi - }) - ; - $hdl_holder.append(jq); - return jq; - }; - /*}}}*/ - function insertHandle(ord)/*{{{*/ - { - return dragDiv(ord,hdep++) - .css({ top: px(-hhs+1), left: px(-hhs+1), opacity: options.handleOpacity }) - .addClass(cssClass('handle')); - }; - /*}}}*/ - function insertDragbar(ord)/*{{{*/ - { - var s = options.handleSize, - o = hhs, - h = s, w = s, - t = o, l = o; - - switch(ord) - { - case 'n': case 's': w = pct(100); break; - case 'e': case 'w': h = pct(100); break; - } - - return dragDiv(ord,hdep++).width(w).height(h) - .css({ top: px(-t+1), left: px(-l+1)}); - }; - /*}}}*/ - function createHandles(li)/*{{{*/ - { - for(i in li) handle[li[i]] = insertHandle(li[i]); - }; - /*}}}*/ - function moveHandles(c)/*{{{*/ - { - var midvert = Math.round((c.h / 2) - hhs), - midhoriz = Math.round((c.w / 2) - hhs), - north = west = -hhs+1, - east = c.w - hhs, - south = c.h - hhs, - x, y; - - 'e' in handle && - handle.e.css({ top: px(midvert), left: px(east) }) && - handle.w.css({ top: px(midvert) }) && - handle.s.css({ top: px(south), left: px(midhoriz) }) && - handle.n.css({ left: px(midhoriz) }); - - 'ne' in handle && - handle.ne.css({ left: px(east) }) && - handle.se.css({ top: px(south), left: px(east) }) && - handle.sw.css({ top: px(south) }); - - 'b' in handle && - handle.b.css({ top: px(south) }) && - handle.r.css({ left: px(east) }); - }; - /*}}}*/ - function moveto(x,y)/*{{{*/ - { - $img2.css({ top: px(-y), left: px(-x) }); - $sel.css({ top: px(y), left: px(x) }); - }; - /*}}}*/ - function resize(w,h)/*{{{*/ - { - $sel.width(w).height(h); - }; - /*}}}*/ - function refresh()/*{{{*/ - { - var c = Coords.getFixed(); - - Coords.setPressed([c.x,c.y]); - Coords.setCurrent([c.x2,c.y2]); - - updateVisible(); - }; - /*}}}*/ - - // Internal Methods - function updateVisible()/*{{{*/ - { if (awake) return update(); }; - /*}}}*/ - function update()/*{{{*/ - { - var c = Coords.getFixed(); - - resize(c.w,c.h); - moveto(c.x,c.y); - - options.drawBorders && - borders['right'].css({ left: px(c.w-1) }) && - borders['bottom'].css({ top: px(c.h-1) }); - - seehandles && moveHandles(c); - awake || show(); - - options.onChange(unscale(c)); - }; - /*}}}*/ - function show()/*{{{*/ - { - $sel.show(); - $img.css('opacity',options.bgOpacity); - awake = true; - }; - /*}}}*/ - function release()/*{{{*/ - { - disableHandles(); - $sel.hide(); - $img.css('opacity',1); - awake = false; - }; - /*}}}*/ - function showHandles()//{{{ - { - if (seehandles) - { - moveHandles(Coords.getFixed()); - $hdl_holder.show(); - } - }; - //}}} - function enableHandles()/*{{{*/ - { - seehandles = true; - if (options.allowResize) - { - moveHandles(Coords.getFixed()); - $hdl_holder.show(); - return true; - } - }; - /*}}}*/ - function disableHandles()/*{{{*/ - { - seehandles = false; - $hdl_holder.hide(); - }; - /*}}}*/ - function animMode(v)/*{{{*/ - { - (animating = v) ? disableHandles(): enableHandles(); - }; - /*}}}*/ - function done()/*{{{*/ - { - animMode(false); - refresh(); - }; - /*}}}*/ - - var $track = newTracker().mousedown(createDragger('move')) - .css({ cursor: 'move', position: 'absolute', zIndex: 360 }) - - $img_holder.append($track); - disableHandles(); - - return { - updateVisible: updateVisible, - update: update, - release: release, - refresh: refresh, - setCursor: function (cursor) { $track.css('cursor',cursor); }, - enableHandles: enableHandles, - enableOnly: function() { seehandles = true; }, - showHandles: showHandles, - disableHandles: disableHandles, - animMode: animMode, - done: done - }; - }(); - /*}}}*/ - var Tracker = function()/*{{{*/ - { - var onMove = function() { }, - onDone = function() { }, - trackDoc = options.trackDocument; - - if (!trackDoc) - { - $trk - .mousemove(trackMove) - .mouseup(trackUp) - .mouseout(trackUp) - ; - } - - function toFront()/*{{{*/ - { - $trk.css({zIndex:450}); - if (trackDoc) - { - $(document) - .mousemove(trackMove) - .mouseup(trackUp) - ; - } - } - /*}}}*/ - function toBack()/*{{{*/ - { - $trk.css({zIndex:290}); - if (trackDoc) - { - $(document) - .unbind('mousemove',trackMove) - .unbind('mouseup',trackUp) - ; - } - } - /*}}}*/ - function trackMove(e)/*{{{*/ - { - onMove(mouseAbs(e)); - }; - /*}}}*/ - function trackUp(e)/*{{{*/ - { - e.preventDefault(); - e.stopPropagation(); - - if (btndown) - { - btndown = false; - - onDone(mouseAbs(e)); - options.onSelect(unscale(Coords.getFixed())); - toBack(); - onMove = function() { }; - onDone = function() { }; - } - - return false; - }; - /*}}}*/ - - function activateHandlers(move,done)/* {{{ */ - { - btndown = true; - onMove = move; - onDone = done; - toFront(); - return false; - }; - /* }}} */ - - function setCursor(t) { $trk.css('cursor',t); }; - - $img.before($trk); - return { - activateHandlers: activateHandlers, - setCursor: setCursor - }; - }(); - /*}}}*/ - var KeyManager = function()/*{{{*/ - { - var $keymgr = $('') - .css({ position: 'absolute', left: '-30px' }) - .keypress(parseKey) - .blur(onBlur), - - $keywrap = $('
        ') - .css({ - position: 'absolute', - overflow: 'hidden' - }) - .append($keymgr) - ; - - function watchKeys()/*{{{*/ - { - if (options.keySupport) - { - $keymgr.show(); - $keymgr.focus(); - } - }; - /*}}}*/ - function onBlur(e)/*{{{*/ - { - $keymgr.hide(); - }; - /*}}}*/ - function doNudge(e,x,y)/*{{{*/ - { - if (options.allowMove) { - Coords.moveOffset([x,y]); - Selection.updateVisible(); - }; - e.preventDefault(); - e.stopPropagation(); - }; - /*}}}*/ - function parseKey(e)/*{{{*/ - { - if (e.ctrlKey) return true; - shift_down = e.shiftKey ? true : false; - var nudge = shift_down ? 10 : 1; - switch(e.keyCode) - { - case 37: doNudge(e,-nudge,0); break; - case 39: doNudge(e,nudge,0); break; - case 38: doNudge(e,0,-nudge); break; - case 40: doNudge(e,0,nudge); break; - - case 27: Selection.release(); break; - - case 9: return true; - } - - return nothing(e); - }; - /*}}}*/ - - if (options.keySupport) $keywrap.insertBefore($img); - return { - watchKeys: watchKeys - }; - }(); - /*}}}*/ - - // }}} - // Internal Methods {{{ - - function px(n) { return '' + parseInt(n) + 'px'; }; - function pct(n) { return '' + parseInt(n) + '%'; }; - function cssClass(cl) { return options.baseClass + '-' + cl; }; - function getPos(obj)/*{{{*/ - { - // Updated in v0.9.4 to use built-in dimensions plugin - var pos = $(obj).offset(); - return [ pos.left, pos.top ]; - }; - /*}}}*/ - function mouseAbs(e)/*{{{*/ - { - return [ (e.pageX - docOffset[0]), (e.pageY - docOffset[1]) ]; - }; - /*}}}*/ - function myCursor(type)/*{{{*/ - { - if (type != lastcurs) - { - Tracker.setCursor(type); - //Handles.xsetCursor(type); - lastcurs = type; - } - }; - /*}}}*/ - function startDragMode(mode,pos)/*{{{*/ - { - docOffset = getPos($img); - Tracker.setCursor(mode=='move'?mode:mode+'-resize'); - - if (mode == 'move') - return Tracker.activateHandlers(createMover(pos), doneSelect); - - var fc = Coords.getFixed(); - var opp = oppLockCorner(mode); - var opc = Coords.getCorner(oppLockCorner(opp)); - - Coords.setPressed(Coords.getCorner(opp)); - Coords.setCurrent(opc); - - Tracker.activateHandlers(dragmodeHandler(mode,fc),doneSelect); - }; - /*}}}*/ - function dragmodeHandler(mode,f)/*{{{*/ - { - return function(pos) { - if (!options.aspectRatio) switch(mode) - { - case 'e': pos[1] = f.y2; break; - case 'w': pos[1] = f.y2; break; - case 'n': pos[0] = f.x2; break; - case 's': pos[0] = f.x2; break; - } - else switch(mode) - { - case 'e': pos[1] = f.y+1; break; - case 'w': pos[1] = f.y+1; break; - case 'n': pos[0] = f.x+1; break; - case 's': pos[0] = f.x+1; break; - } - Coords.setCurrent(pos); - Selection.update(); - }; - }; - /*}}}*/ - function createMover(pos)/*{{{*/ - { - var lloc = pos; - KeyManager.watchKeys(); - - return function(pos) - { - Coords.moveOffset([pos[0] - lloc[0], pos[1] - lloc[1]]); - lloc = pos; - - Selection.update(); - }; - }; - /*}}}*/ - function oppLockCorner(ord)/*{{{*/ - { - switch(ord) - { - case 'n': return 'sw'; - case 's': return 'nw'; - case 'e': return 'nw'; - case 'w': return 'ne'; - case 'ne': return 'sw'; - case 'nw': return 'se'; - case 'se': return 'nw'; - case 'sw': return 'ne'; - }; - }; - /*}}}*/ - function createDragger(ord)/*{{{*/ - { - return function(e) { - if (options.disabled) return false; - if ((ord == 'move') && !options.allowMove) return false; - btndown = true; - startDragMode(ord,mouseAbs(e)); - e.stopPropagation(); - e.preventDefault(); - return false; - }; - }; - /*}}}*/ - function presize($obj,w,h)/*{{{*/ - { - var nw = $obj.width(), nh = $obj.height(); - if ((nw > w) && w > 0) - { - nw = w; - nh = (w/$obj.width()) * $obj.height(); - } - if ((nh > h) && h > 0) - { - nh = h; - nw = (h/$obj.height()) * $obj.width(); - } - xscale = $obj.width() / nw; - yscale = $obj.height() / nh; - $obj.width(nw).height(nh); - }; - /*}}}*/ - function unscale(c)/*{{{*/ - { - return { - x: parseInt(c.x * xscale), y: parseInt(c.y * yscale), - x2: parseInt(c.x2 * xscale), y2: parseInt(c.y2 * yscale), - w: parseInt(c.w * xscale), h: parseInt(c.h * yscale) - }; - }; - /*}}}*/ - function doneSelect(pos)/*{{{*/ - { - var c = Coords.getFixed(); - if (c.w > options.minSelect[0] && c.h > options.minSelect[1]) - { - Selection.enableHandles(); - Selection.done(); - } - else - { - Selection.release(); - } - Tracker.setCursor( options.allowSelect?'crosshair':'default' ); - }; - /*}}}*/ - function newSelection(e)/*{{{*/ - { - if (options.disabled) return false; - if (!options.allowSelect) return false; - btndown = true; - docOffset = getPos($img); - Selection.disableHandles(); - myCursor('crosshair'); - var pos = mouseAbs(e); - Coords.setPressed(pos); - Tracker.activateHandlers(selectDrag,doneSelect); - KeyManager.watchKeys(); - Selection.update(); - - e.stopPropagation(); - e.preventDefault(); - return false; - }; - /*}}}*/ - function selectDrag(pos)/*{{{*/ - { - Coords.setCurrent(pos); - Selection.update(); - }; - /*}}}*/ - function newTracker() - { - var trk = $('
        ').addClass(cssClass('tracker')); - $.browser.msie && trk.css({ opacity: 0, backgroundColor: 'white' }); - return trk; - }; - - // }}} - // API methods {{{ - - function animateTo(a)/*{{{*/ - { - var x1 = a[0] / xscale, - y1 = a[1] / yscale, - x2 = a[2] / xscale, - y2 = a[3] / yscale; - - if (animating) return; - - var animto = Coords.flipCoords(x1,y1,x2,y2); - var c = Coords.getFixed(); - var animat = initcr = [ c.x, c.y, c.x2, c.y2 ]; - var interv = options.animationDelay; - - var x = animat[0]; - var y = animat[1]; - var x2 = animat[2]; - var y2 = animat[3]; - var ix1 = animto[0] - initcr[0]; - var iy1 = animto[1] - initcr[1]; - var ix2 = animto[2] - initcr[2]; - var iy2 = animto[3] - initcr[3]; - var pcent = 0; - var velocity = options.swingSpeed; - - Selection.animMode(true); - - var animator = function() - { - return function() - { - pcent += (100 - pcent) / velocity; - - animat[0] = x + ((pcent / 100) * ix1); - animat[1] = y + ((pcent / 100) * iy1); - animat[2] = x2 + ((pcent / 100) * ix2); - animat[3] = y2 + ((pcent / 100) * iy2); - - if (pcent < 100) animateStart(); - else Selection.done(); - - if (pcent >= 99.8) pcent = 100; - - setSelectRaw(animat); - }; - }(); - - function animateStart() - { window.setTimeout(animator,interv); }; - - animateStart(); - }; - /*}}}*/ - function setSelect(rect)//{{{ - { - setSelectRaw([rect[0]/xscale,rect[1]/yscale,rect[2]/xscale,rect[3]/yscale]); - }; - //}}} - function setSelectRaw(l) /*{{{*/ - { - Coords.setPressed([l[0],l[1]]); - Coords.setCurrent([l[2],l[3]]); - Selection.update(); - }; - /*}}}*/ - function setOptions(opt)/*{{{*/ - { - if (typeof(opt) != 'object') opt = { }; - options = $.extend(options,opt); - - if (typeof(options.onChange)!=='function') - options.onChange = function() { }; - - if (typeof(options.onSelect)!=='function') - options.onSelect = function() { }; - - }; - /*}}}*/ - function tellSelect()/*{{{*/ - { - return unscale(Coords.getFixed()); - }; - /*}}}*/ - function tellScaled()/*{{{*/ - { - return Coords.getFixed(); - }; - /*}}}*/ - function setOptionsNew(opt)/*{{{*/ - { - setOptions(opt); - interfaceUpdate(); - }; - /*}}}*/ - function disableCrop()//{{{ - { - options.disabled = true; - Selection.disableHandles(); - Selection.setCursor('default'); - Tracker.setCursor('default'); - }; - //}}} - function enableCrop()//{{{ - { - options.disabled = false; - interfaceUpdate(); - }; - //}}} - function cancelCrop()//{{{ - { - Selection.done(); - Tracker.activateHandlers(null,null); - }; - //}}} - function destroy()//{{{ - { - $div.remove(); - $origimg.show(); - }; - //}}} - - function interfaceUpdate(alt)//{{{ - // This method tweaks the interface based on options object. - // Called when options are changed and at end of initialization. - { - options.allowResize ? - alt?Selection.enableOnly():Selection.enableHandles(): - Selection.disableHandles(); - - Tracker.setCursor( options.allowSelect? 'crosshair': 'default' ); - Selection.setCursor( options.allowMove? 'move': 'default' ); - - $div.css('backgroundColor',options.bgColor); - - if ('setSelect' in options) { - setSelect(opt.setSelect); - Selection.done(); - delete(options.setSelect); - } - - if ('trueSize' in options) { - xscale = options.trueSize[0] / boundx; - yscale = options.trueSize[1] / boundy; - } - - xlimit = options.maxSize[0] || 0; - ylimit = options.maxSize[1] || 0; - xmin = options.minSize[0] || 0; - ymin = options.minSize[1] || 0; - - if ('outerImage' in options) - { - $img.attr('src',options.outerImage); - delete(options.outerImage); - } - - Selection.refresh(); - }; - //}}} - - // }}} - - $hdl_holder.hide(); - interfaceUpdate(true); - - var api = { - animateTo: animateTo, - setSelect: setSelect, - setOptions: setOptionsNew, - tellSelect: tellSelect, - tellScaled: tellScaled, - - disable: disableCrop, - enable: enableCrop, - cancel: cancelCrop, - - focus: KeyManager.watchKeys, - - getBounds: function() { return [ boundx * xscale, boundy * yscale ]; }, - getWidgetSize: function() { return [ boundx, boundy ]; }, - - release: Selection.release, - destroy: destroy - - }; - - $origimg.data('Jcrop',api); - return api; -}; - -$.fn.Jcrop = function(options)/*{{{*/ -{ - function attachWhenDone(from)/*{{{*/ - { - var loadsrc = options.useImg || from.src; - var img = new Image(); - img.onload = function() { $.Jcrop(from,options); }; - img.src = loadsrc; - }; - /*}}}*/ - if (typeof(options) !== 'object') options = { }; - - // Iterate over each object, attach Jcrop - this.each(function() - { - // If we've already attached to this object - if ($(this).data('Jcrop')) - { - // The API can be requested this way (undocumented) - if (options == 'api') return $(this).data('Jcrop'); - // Otherwise, we just reset the options... - else $(this).data('Jcrop').setOptions(options); - } - // If we haven't been attached, preload and attach - else attachWhenDone(this); - }); - - // Return "this" so we're chainable a la jQuery plugin-style! - return this; -}; -/*}}}*/ - -})(jQuery); diff --git a/3.1/modules/tagfaces/js/jquery.Jcrop.min.js b/3.1/modules/tagfaces/js/jquery.Jcrop.min.js deleted file mode 100644 index 9002b978..00000000 --- a/3.1/modules/tagfaces/js/jquery.Jcrop.min.js +++ /dev/null @@ -1,163 +0,0 @@ -/** - * Jcrop v.0.9.8 (minimized) - * (c) 2008 Kelly Hallman and DeepLiquid.com - * More information: http://deepliquid.com/content/Jcrop.html - * Released under MIT License - this header must remain with code - */ - - -(function($){$.Jcrop=function(obj,opt) -{var obj=obj,opt=opt;if(typeof(obj)!=='object')obj=$(obj)[0];if(typeof(opt)!=='object')opt={};if(!('trackDocument'in opt)) -{opt.trackDocument=$.browser.msie?false:true;if($.browser.msie&&$.browser.version.split('.')[0]=='8') -opt.trackDocument=true;} -if(!('keySupport'in opt)) -opt.keySupport=$.browser.msie?false:true;var defaults={trackDocument:false,baseClass:'jcrop',addClass:null,bgColor:'black',bgOpacity:.6,borderOpacity:.4,handleOpacity:.5,handlePad:5,handleSize:9,handleOffset:5,edgeMargin:14,aspectRatio:0,keySupport:true,cornerHandles:true,sideHandles:true,drawBorders:true,dragEdges:true,boxWidth:0,boxHeight:0,boundary:8,animationDelay:20,swingSpeed:3,allowSelect:true,allowMove:true,allowResize:true,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){}};var options=defaults;setOptions(opt);var $origimg=$(obj);var $img=$origimg.clone().removeAttr('id').css({position:'absolute'});$img.width($origimg.width());$img.height($origimg.height());$origimg.after($img).hide();presize($img,options.boxWidth,options.boxHeight);var boundx=$img.width(),boundy=$img.height(),$div=$('
        ').width(boundx).height(boundy).addClass(cssClass('holder')).css({position:'relative',backgroundColor:options.bgColor}).insertAfter($origimg).append($img);;if(options.addClass)$div.addClass(options.addClass);var $img2=$('').attr('src',$img.attr('src')).css('position','absolute').width(boundx).height(boundy);var $img_holder=$('
        ').width(pct(100)).height(pct(100)).css({zIndex:310,position:'absolute',overflow:'hidden'}).append($img2);var $hdl_holder=$('
        ').width(pct(100)).height(pct(100)).css('zIndex',320);var $sel=$('
        ').css({position:'absolute',zIndex:300}).insertBefore($img).append($img_holder,$hdl_holder);var bound=options.boundary;var $trk=newTracker().width(boundx+(bound*2)).height(boundy+(bound*2)).css({position:'absolute',top:px(-bound),left:px(-bound),zIndex:290}).mousedown(newSelection);var xlimit,ylimit,xmin,ymin;var xscale,yscale,enabled=true;var docOffset=getPos($img),btndown,lastcurs,dimmed,animating,shift_down;var Coords=function() -{var x1=0,y1=0,x2=0,y2=0,ox,oy;function setPressed(pos) -{var pos=rebound(pos);x2=x1=pos[0];y2=y1=pos[1];};function setCurrent(pos) -{var pos=rebound(pos);ox=pos[0]-x2;oy=pos[1]-y2;x2=pos[0];y2=pos[1];};function getOffset() -{return[ox,oy];};function moveOffset(offset) -{var ox=offset[0],oy=offset[1];if(0>x1+ox)ox-=ox+x1;if(0>y1+oy)oy-=oy+y1;if(boundyboundx) -{xx=boundx;h=Math.abs((xx-x1)/aspect);yy=rh<0?y1-h:h+y1;}} -else -{xx=x2;h=rwa/aspect;yy=rh<0?y1-h:y1+h;if(yy<0) -{yy=0;w=Math.abs((yy-y1)*aspect);xx=rw<0?x1-w:w+x1;} -else if(yy>boundy) -{yy=boundy;w=Math.abs(yy-y1)*aspect;xx=rw<0?x1-w:w+x1;}} -if(xx>x1){if(xx-x1max_x){xx=x1+max_x;} -if(yy>y1){yy=y1+(xx-x1)/aspect;}else{yy=y1-(xx-x1)/aspect;}}else if(xxmax_x){xx=x1-max_x;} -if(yy>y1){yy=y1+(x1-xx)/aspect;}else{yy=y1-(x1-xx)/aspect;}} -if(xx<0){x1-=xx;xx=0;}else if(xx>boundx){x1-=xx-boundx;xx=boundx;} -if(yy<0){y1-=yy;yy=0;}else if(yy>boundy){y1-=yy-boundy;yy=boundy;} -return last=makeObj(flipCoords(x1,y1,xx,yy));};function rebound(p) -{if(p[0]<0)p[0]=0;if(p[1]<0)p[1]=0;if(p[0]>boundx)p[0]=boundx;if(p[1]>boundy)p[1]=boundy;return[p[0],p[1]];};function flipCoords(x1,y1,x2,y2) -{var xa=x1,xb=x2,ya=y1,yb=y2;if(x2xlimit)) -x2=(xsize>0)?(x1+xlimit):(x1-xlimit);if(ylimit&&(Math.abs(ysize)>ylimit)) -y2=(ysize>0)?(y1+ylimit):(y1-ylimit);if(ymin&&(Math.abs(ysize)0)?(y1+ymin):(y1-ymin);if(xmin&&(Math.abs(xsize)0)?(x1+xmin):(x1-xmin);if(x1<0){x2-=x1;x1-=x1;} -if(y1<0){y2-=y1;y1-=y1;} -if(x2<0){x1-=x2;x2-=x2;} -if(y2<0){y1-=y2;y2-=y2;} -if(x2>boundx){var delta=x2-boundx;x1-=delta;x2-=delta;} -if(y2>boundy){var delta=y2-boundy;y1-=delta;y2-=delta;} -if(x1>boundx){var delta=x1-boundy;y2-=delta;y1-=delta;} -if(y1>boundy){var delta=y1-boundy;y2-=delta;y1-=delta;} -return makeObj(flipCoords(x1,y1,x2,y2));};function makeObj(a) -{return{x:a[0],y:a[1],x2:a[2],y2:a[3],w:a[2]-a[0],h:a[3]-a[1]};};return{flipCoords:flipCoords,setPressed:setPressed,setCurrent:setCurrent,getOffset:getOffset,moveOffset:moveOffset,getCorner:getCorner,getFixed:getFixed};}();var Selection=function() -{var start,end,dragmode,awake,hdep=370;var borders={};var handle={};var seehandles=false;var hhs=options.handleOffset;if(options.drawBorders){borders={top:insertBorder('hline').css('top',$.browser.msie?px(-1):px(0)),bottom:insertBorder('hline'),left:insertBorder('vline'),right:insertBorder('vline')};} -if(options.dragEdges){handle.t=insertDragbar('n');handle.b=insertDragbar('s');handle.r=insertDragbar('e');handle.l=insertDragbar('w');} -options.sideHandles&&createHandles(['n','s','e','w']);options.cornerHandles&&createHandles(['sw','nw','ne','se']);function insertBorder(type) -{var jq=$('
        ').css({position:'absolute',opacity:options.borderOpacity}).addClass(cssClass(type));$img_holder.append(jq);return jq;};function dragDiv(ord,zi) -{var jq=$('
        ').mousedown(createDragger(ord)).css({cursor:ord+'-resize',position:'absolute',zIndex:zi});$hdl_holder.append(jq);return jq;};function insertHandle(ord) -{return dragDiv(ord,hdep++).css({top:px(-hhs+1),left:px(-hhs+1),opacity:options.handleOpacity}).addClass(cssClass('handle'));};function insertDragbar(ord) -{var s=options.handleSize,o=hhs,h=s,w=s,t=o,l=o;switch(ord) -{case'n':case's':w=pct(100);break;case'e':case'w':h=pct(100);break;} -return dragDiv(ord,hdep++).width(w).height(h).css({top:px(-t+1),left:px(-l+1)});};function createHandles(li) -{for(i in li)handle[li[i]]=insertHandle(li[i]);};function moveHandles(c) -{var midvert=Math.round((c.h/2)-hhs),midhoriz=Math.round((c.w/2)-hhs),north=west=-hhs+1,east=c.w-hhs,south=c.h-hhs,x,y;'e'in handle&&handle.e.css({top:px(midvert),left:px(east)})&&handle.w.css({top:px(midvert)})&&handle.s.css({top:px(south),left:px(midhoriz)})&&handle.n.css({left:px(midhoriz)});'ne'in handle&&handle.ne.css({left:px(east)})&&handle.se.css({top:px(south),left:px(east)})&&handle.sw.css({top:px(south)});'b'in handle&&handle.b.css({top:px(south)})&&handle.r.css({left:px(east)});};function moveto(x,y) -{$img2.css({top:px(-y),left:px(-x)});$sel.css({top:px(y),left:px(x)});};function resize(w,h) -{$sel.width(w).height(h);};function refresh() -{var c=Coords.getFixed();Coords.setPressed([c.x,c.y]);Coords.setCurrent([c.x2,c.y2]);updateVisible();};function updateVisible() -{if(awake)return update();};function update() -{var c=Coords.getFixed();resize(c.w,c.h);moveto(c.x,c.y);options.drawBorders&&borders['right'].css({left:px(c.w-1)})&&borders['bottom'].css({top:px(c.h-1)});seehandles&&moveHandles(c);awake||show();options.onChange(unscale(c));};function show() -{$sel.show();$img.css('opacity',options.bgOpacity);awake=true;};function release() -{disableHandles();$sel.hide();$img.css('opacity',1);awake=false;};function showHandles() -{if(seehandles) -{moveHandles(Coords.getFixed());$hdl_holder.show();}};function enableHandles() -{seehandles=true;if(options.allowResize) -{moveHandles(Coords.getFixed());$hdl_holder.show();return true;}};function disableHandles() -{seehandles=false;$hdl_holder.hide();};function animMode(v) -{(animating=v)?disableHandles():enableHandles();};function done() -{animMode(false);refresh();};var $track=newTracker().mousedown(createDragger('move')).css({cursor:'move',position:'absolute',zIndex:360}) -$img_holder.append($track);disableHandles();return{updateVisible:updateVisible,update:update,release:release,refresh:refresh,setCursor:function(cursor){$track.css('cursor',cursor);},enableHandles:enableHandles,enableOnly:function(){seehandles=true;},showHandles:showHandles,disableHandles:disableHandles,animMode:animMode,done:done};}();var Tracker=function() -{var onMove=function(){},onDone=function(){},trackDoc=options.trackDocument;if(!trackDoc) -{$trk.mousemove(trackMove).mouseup(trackUp).mouseout(trackUp);} -function toFront() -{$trk.css({zIndex:450});if(trackDoc) -{$(document).mousemove(trackMove).mouseup(trackUp);}} -function toBack() -{$trk.css({zIndex:290});if(trackDoc) -{$(document).unbind('mousemove',trackMove).unbind('mouseup',trackUp);}} -function trackMove(e) -{onMove(mouseAbs(e));};function trackUp(e) -{e.preventDefault();e.stopPropagation();if(btndown) -{btndown=false;onDone(mouseAbs(e));options.onSelect(unscale(Coords.getFixed()));toBack();onMove=function(){};onDone=function(){};} -return false;};function activateHandlers(move,done) -{btndown=true;onMove=move;onDone=done;toFront();return false;};function setCursor(t){$trk.css('cursor',t);};$img.before($trk);return{activateHandlers:activateHandlers,setCursor:setCursor};}();var KeyManager=function() -{var $keymgr=$('').css({position:'absolute',left:'-30px'}).keypress(parseKey).blur(onBlur),$keywrap=$('
        ').css({position:'absolute',overflow:'hidden'}).append($keymgr);function watchKeys() -{if(options.keySupport) -{$keymgr.show();$keymgr.focus();}};function onBlur(e) -{$keymgr.hide();};function doNudge(e,x,y) -{if(options.allowMove){Coords.moveOffset([x,y]);Selection.updateVisible();};e.preventDefault();e.stopPropagation();};function parseKey(e) -{if(e.ctrlKey)return true;shift_down=e.shiftKey?true:false;var nudge=shift_down?10:1;switch(e.keyCode) -{case 37:doNudge(e,-nudge,0);break;case 39:doNudge(e,nudge,0);break;case 38:doNudge(e,0,-nudge);break;case 40:doNudge(e,0,nudge);break;case 27:Selection.release();break;case 9:return true;} -return nothing(e);};if(options.keySupport)$keywrap.insertBefore($img);return{watchKeys:watchKeys};}();function px(n){return''+parseInt(n)+'px';};function pct(n){return''+parseInt(n)+'%';};function cssClass(cl){return options.baseClass+'-'+cl;};function getPos(obj) -{var pos=$(obj).offset();return[pos.left,pos.top];};function mouseAbs(e) -{return[(e.pageX-docOffset[0]),(e.pageY-docOffset[1])];};function myCursor(type) -{if(type!=lastcurs) -{Tracker.setCursor(type);lastcurs=type;}};function startDragMode(mode,pos) -{docOffset=getPos($img);Tracker.setCursor(mode=='move'?mode:mode+'-resize');if(mode=='move') -return Tracker.activateHandlers(createMover(pos),doneSelect);var fc=Coords.getFixed();var opp=oppLockCorner(mode);var opc=Coords.getCorner(oppLockCorner(opp));Coords.setPressed(Coords.getCorner(opp));Coords.setCurrent(opc);Tracker.activateHandlers(dragmodeHandler(mode,fc),doneSelect);};function dragmodeHandler(mode,f) -{return function(pos){if(!options.aspectRatio)switch(mode) -{case'e':pos[1]=f.y2;break;case'w':pos[1]=f.y2;break;case'n':pos[0]=f.x2;break;case's':pos[0]=f.x2;break;} -else switch(mode) -{case'e':pos[1]=f.y+1;break;case'w':pos[1]=f.y+1;break;case'n':pos[0]=f.x+1;break;case's':pos[0]=f.x+1;break;} -Coords.setCurrent(pos);Selection.update();};};function createMover(pos) -{var lloc=pos;KeyManager.watchKeys();return function(pos) -{Coords.moveOffset([pos[0]-lloc[0],pos[1]-lloc[1]]);lloc=pos;Selection.update();};};function oppLockCorner(ord) -{switch(ord) -{case'n':return'sw';case's':return'nw';case'e':return'nw';case'w':return'ne';case'ne':return'sw';case'nw':return'se';case'se':return'nw';case'sw':return'ne';};};function createDragger(ord) -{return function(e){if(options.disabled)return false;if((ord=='move')&&!options.allowMove)return false;btndown=true;startDragMode(ord,mouseAbs(e));e.stopPropagation();e.preventDefault();return false;};};function presize($obj,w,h) -{var nw=$obj.width(),nh=$obj.height();if((nw>w)&&w>0) -{nw=w;nh=(w/$obj.width())*$obj.height();} -if((nh>h)&&h>0) -{nh=h;nw=(h/$obj.height())*$obj.width();} -xscale=$obj.width()/nw;yscale=$obj.height()/nh;$obj.width(nw).height(nh);};function unscale(c) -{return{x:parseInt(c.x*xscale),y:parseInt(c.y*yscale),x2:parseInt(c.x2*xscale),y2:parseInt(c.y2*yscale),w:parseInt(c.w*xscale),h:parseInt(c.h*yscale)};};function doneSelect(pos) -{var c=Coords.getFixed();if(c.w>options.minSelect[0]&&c.h>options.minSelect[1]) -{Selection.enableHandles();Selection.done();} -else -{Selection.release();} -Tracker.setCursor(options.allowSelect?'crosshair':'default');};function newSelection(e) -{if(options.disabled)return false;if(!options.allowSelect)return false;btndown=true;docOffset=getPos($img);Selection.disableHandles();myCursor('crosshair');var pos=mouseAbs(e);Coords.setPressed(pos);Tracker.activateHandlers(selectDrag,doneSelect);KeyManager.watchKeys();Selection.update();e.stopPropagation();e.preventDefault();return false;};function selectDrag(pos) -{Coords.setCurrent(pos);Selection.update();};function newTracker() -{var trk=$('
        ').addClass(cssClass('tracker'));$.browser.msie&&trk.css({opacity:0,backgroundColor:'white'});return trk;};function animateTo(a) -{var x1=a[0]/xscale,y1=a[1]/yscale,x2=a[2]/xscale,y2=a[3]/yscale;if(animating)return;var animto=Coords.flipCoords(x1,y1,x2,y2);var c=Coords.getFixed();var animat=initcr=[c.x,c.y,c.x2,c.y2];var interv=options.animationDelay;var x=animat[0];var y=animat[1];var x2=animat[2];var y2=animat[3];var ix1=animto[0]-initcr[0];var iy1=animto[1]-initcr[1];var ix2=animto[2]-initcr[2];var iy2=animto[3]-initcr[3];var pcent=0;var velocity=options.swingSpeed;Selection.animMode(true);var animator=function() -{return function() -{pcent+=(100-pcent)/velocity;animat[0]=x+((pcent/100)*ix1);animat[1]=y+((pcent/100)*iy1);animat[2]=x2+((pcent/100)*ix2);animat[3]=y2+((pcent/100)*iy2);if(pcent<100)animateStart();else Selection.done();if(pcent>=99.8)pcent=100;setSelectRaw(animat);};}();function animateStart() -{window.setTimeout(animator,interv);};animateStart();};function setSelect(rect) -{setSelectRaw([rect[0]/xscale,rect[1]/yscale,rect[2]/xscale,rect[3]/yscale]);};function setSelectRaw(l) -{Coords.setPressed([l[0],l[1]]);Coords.setCurrent([l[2],l[3]]);Selection.update();};function setOptions(opt) -{if(typeof(opt)!='object')opt={};options=$.extend(options,opt);if(typeof(options.onChange)!=='function') -options.onChange=function(){};if(typeof(options.onSelect)!=='function') -options.onSelect=function(){};};function tellSelect() -{return unscale(Coords.getFixed());};function tellScaled() -{return Coords.getFixed();};function setOptionsNew(opt) -{setOptions(opt);interfaceUpdate();};function disableCrop() -{options.disabled=true;Selection.disableHandles();Selection.setCursor('default');Tracker.setCursor('default');};function enableCrop() -{options.disabled=false;interfaceUpdate();};function cancelCrop() -{Selection.done();Tracker.activateHandlers(null,null);};function destroy() -{$div.remove();$origimg.show();};function interfaceUpdate(alt) -{options.allowResize?alt?Selection.enableOnly():Selection.enableHandles():Selection.disableHandles();Tracker.setCursor(options.allowSelect?'crosshair':'default');Selection.setCursor(options.allowMove?'move':'default');$div.css('backgroundColor',options.bgColor);if('setSelect'in options){setSelect(opt.setSelect);Selection.done();delete(options.setSelect);} -if('trueSize'in options){xscale=options.trueSize[0]/boundx;yscale=options.trueSize[1]/boundy;} -xlimit=options.maxSize[0]||0;ylimit=options.maxSize[1]||0;xmin=options.minSize[0]||0;ymin=options.minSize[1]||0;if('outerImage'in options) -{$img.attr('src',options.outerImage);delete(options.outerImage);} -Selection.refresh();};$hdl_holder.hide();interfaceUpdate(true);var api={animateTo:animateTo,setSelect:setSelect,setOptions:setOptionsNew,tellSelect:tellSelect,tellScaled:tellScaled,disable:disableCrop,enable:enableCrop,cancel:cancelCrop,focus:KeyManager.watchKeys,getBounds:function(){return[boundx*xscale,boundy*yscale];},getWidgetSize:function(){return[boundx,boundy];},release:Selection.release,destroy:destroy};$origimg.data('Jcrop',api);return api;};$.fn.Jcrop=function(options) -{function attachWhenDone(from) -{var loadsrc=options.useImg||from.src;var img=new Image();img.onload=function(){$.Jcrop(from,options);};img.src=loadsrc;};if(typeof(options)!=='object')options={};this.each(function() -{if($(this).data('Jcrop')) -{if(options=='api')return $(this).data('Jcrop');else $(this).data('Jcrop').setOptions(options);} -else attachWhenDone(this);});return this;};})(jQuery); \ No newline at end of file diff --git a/3.1/modules/tagfaces/js/jquery.min.js b/3.1/modules/tagfaces/js/jquery.min.js deleted file mode 100644 index b1ae21d8..00000000 --- a/3.1/modules/tagfaces/js/jquery.min.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
        "]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
        ","
        "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

        ";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
        ";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
        ").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
        ';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/3.1/modules/tagfaces/models/items_face.php b/3.1/modules/tagfaces/models/items_face.php deleted file mode 100644 index 51737a45..00000000 --- a/3.1/modules/tagfaces/models/items_face.php +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - -
        - dynamic_top() ?> -
        -

        -

        - resize_img(array("id" => "g-select-photo-id-{$item->id}", "class" => "g-select-resize", "style" => "position: fixed;")) ?> -
        -
        - - - -
        - -
        - -


        - -
        -
        -

        - -
        -
        - -
        - - - -dynamic_bottom() ?> diff --git a/3.1/modules/tagfaces/views/drawfaces_highlight_block.html.php b/3.1/modules/tagfaces/views/drawfaces_highlight_block.html.php deleted file mode 100644 index efd9c7c4..00000000 --- a/3.1/modules/tagfaces/views/drawfaces_highlight_block.html.php +++ /dev/null @@ -1,99 +0,0 @@ - -where("item_id", "=", $item->id) - ->find_all(); - $existingNotes = ORM::factory("items_note") - ->where("item_id", "=", $item->id) - ->find_all(); - - // If it does, then insert some javascript and display an image map - // to show where the faces are at. - if ((count($existingFaces) > 0) || (count($existingNotes) > 0)) { -?> - - - - - - - - -tag_id) -?> - <?=$oneTag->name; ?> - - - - <?=$oneNote->title; ?> - - - - diff --git a/3.1/modules/tagsinalbum/helpers/tagsinalbum_block.php b/3.1/modules/tagsinalbum/helpers/tagsinalbum_block.php deleted file mode 100644 index cb28053c..00000000 --- a/3.1/modules/tagsinalbum/helpers/tagsinalbum_block.php +++ /dev/null @@ -1,50 +0,0 @@ - t("Tags In Album")); - } - - static function get($block_id, $theme) { - $block = ""; - - switch ($block_id) { - case "tagsinalbum": - if (($theme->item) && ($theme->item->is_album())) { - $item = $theme->item; - $all_tags = ORM::factory("tag") - ->join("items_tags", "items_tags.tag_id", "tags.id") - ->join("items", "items.id", "items_tags.item_id", "LEFT") - ->where("items.parent_id", "=", $item->id) - ->order_by("tags.id", "ASC") - ->find_all(); - if (count($all_tags) > 0) { - $block = new Block(); - $block->css_id = "g-tags-in-album-block"; - $block->title = t("In this album"); - $block->content = new View("tagsinalbum_sidebar.html"); - $block->content->all_tags = $all_tags; - } - } - break; - } - return $block; - } -} diff --git a/3.1/modules/tagsinalbum/helpers/tagsinalbum_event.php b/3.1/modules/tagsinalbum/helpers/tagsinalbum_event.php deleted file mode 100644 index fe7339ae..00000000 --- a/3.1/modules/tagsinalbum/helpers/tagsinalbum_event.php +++ /dev/null @@ -1,37 +0,0 @@ -module == "tag") { - $data->messages["warn"][] = t("The Tags In Album module requires the Tags module."); - } - } - - static function module_change($changes) { - if (!module::is_active("tag") || in_array("tag", $changes->deactivate)) { - site_status::warning( - t("The Tags In Album module requires the Tags module. Activate the Tags module now", - array("url" => html::mark_clean(url::site("admin/modules")))), - "tagsinalbum_needs_tag"); - } else { - site_status::clear("tagsinalbum_needs_tag"); - } - } -} diff --git a/3.1/modules/tagsinalbum/module.info b/3.1/modules/tagsinalbum/module.info deleted file mode 100644 index 6966c3e5..00000000 --- a/3.1/modules/tagsinalbum/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Tags In Album" -description = "Creates a sidebar block to display tags used by photos and videos in the current album." -version = 2 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:tagsinalbum" -discuss_url = "http://gallery.menalto.com/forum_module_tagsinalbum" diff --git a/3.1/modules/tagsinalbum/views/tagsinalbum_sidebar.html.php b/3.1/modules/tagsinalbum/views/tagsinalbum_sidebar.html.php deleted file mode 100644 index 6c8b1dff..00000000 --- a/3.1/modules/tagsinalbum/views/tagsinalbum_sidebar.html.php +++ /dev/null @@ -1,33 +0,0 @@ - -id) { - $tag = ORM::factory("tag", $one_tag->id); - $display_tags[] = array(html::clean($tag->name), $tag->url()); - $last_tagid = $one_tag->id; - } - if (module::get_var("tagsinalbum", "max_display_tags") > 0) { - if (count($display_tags) == module::get_var("tagsinalbum", "max_display_tags")) { - break; - } - } - } - - // Sort the array. - asort($display_tags); - - // Print out the list of tags as clickable links. - $not_first = 0; - foreach ($display_tags as $one_tag) { - if ($not_first++ > 0) { - print ", "; - } - print "" . $one_tag[0] . ""; - } -?> diff --git a/3.1/modules/tagsmap/controllers/admin_tagsmap.php b/3.1/modules/tagsmap/controllers/admin_tagsmap.php deleted file mode 100644 index 40d87119..00000000 --- a/3.1/modules/tagsmap/controllers/admin_tagsmap.php +++ /dev/null @@ -1,250 +0,0 @@ -content = new View("admin_tagsmap.html"); - - // Generate a form for Google Maps Settings. - $view->content->googlemaps_form = $this->_get_googlemaps_form(); - - // Generate a list of tags to display. - $query = ORM::factory("tag"); - $view->content->tags = $query->order_by("name", "ASC")->find_all(); - - // Display the page. - print $view; - } - - public function edit_gps($tag_id) { - // Generate a new admin page to edit gps data for the tag specified by $tag_id. - - // Determine the name of the tag. - $tagName = ORM::factory("tag") - ->where("id", "=", $tag_id) - ->find_all(); - - // Set up the admin page. - $view = new Admin_View("admin.html"); - $view->content = new View("admin_tagsmap_edit.html"); - $view->content->tagsmapedit_form = $this->_get_tagsgpsedit_form($tag_id); - $view->content->tag_name = $tagName[0]->name; - $view->content->zoom = module::get_var("tagsmap", "googlemap_zoom"); - print $view; - } - - public function orphaned_tags() { - // Locate and delete any orphaned GPS data. - $int_deleted_records = 0; - - // Generate a list of all tags with GPS data. - $existingGPS = ORM::factory("tags_gps") - ->find_all(); - - // Loop through each record and see if a corresponding tag exists. - foreach ($existingGPS as $oneGPS) { - $oneTag = ORM::factory("tag") - ->where("id", "=", $oneGPS->tag_id) - ->find_all(); - - // If the tag no longer exists then delete the record. - if (count($oneTag) == 0) { - // Delete the record. - db::build()->delete("tags_gpses")->where("tag_id", "=", $oneGPS->tag_id)->execute(); - $int_deleted_records++; - } - } - - // Redirect back to the main screen and display a "success" message. - message::success($int_deleted_records . t(" Orphaned Record(s) have been deleted.")); - url::redirect("admin/tagsmap"); - } - - public function confirm_delete_gps($tag_id) { - // Make sure the user meant to hit the delete button. - $view = new Admin_View("admin.html"); - $view->content = new View("admin_tagsmap_delete.html"); - $view->content->tag_id = $tag_id; - - // Determine the name of the tag. - $tagName = ORM::factory("tag") - ->where("id", "=", $tag_id) - ->find_all(); - $view->content->tag_name = $tagName[0]->name; - - print $view; - } - - public function delete_gps($tag_id) { - // Delete the GSP data associated with a tag. - - // Delete the record. - db::build()->delete("tags_gpses")->where("tag_id", "=", $tag_id)->execute(); - - // Redirect back to the main screen and display a "success" message. - message::success(t("Your Settings Have Been Saved.")); - url::redirect("admin/tagsmap"); - } - - private function _get_tagsgpsedit_form($tag_id) { - // Make a new form for editing GPS data associated with a tag ($tag_id). - $form = new Forge("admin/tagsmap/savegps", "", "post", - array("id" => "g-tags-map-admin-form")); - - // Add a few input boxes for GPS and Description - $tagsgps_group = $form->group("TagsMapGPS"); - $tagsgps_group->hidden("tag_id")->value($tag_id); - - // Check and see if this ID already has GPS data, then create - // input boxes to either update it or enter in new information. - $existingGPS = ORM::factory("tags_gps") - ->where("tag_id", "=", $tag_id) - ->find_all(); - if (count($existingGPS) == 0) { - $tagsgps_group->input("gps_latitude") - ->label(t("Latitude"))->value(module::get_var("tagsmap", "googlemap_latitude")); - $tagsgps_group->input("gps_longitude") - ->label(t("Longitude"))->value(module::get_var("tagsmap", "googlemap_longitude")); - $tagsgps_group->textarea("gps_description")->label(t("Description"))->value(""); - } else { - $tagsgps_group->input("gps_latitude")->label(t("Latitude"))->value($existingGPS[0]->latitude); - $tagsgps_group->input("gps_longitude")->label(t("Longitude"))->value($existingGPS[0]->longitude); - $tagsgps_group->textarea("gps_description")->label(t("Description"))->value($existingGPS[0]->description); - } - - // Add a save button to the form. - $tagsgps_group->submit("SaveGPS")->value(t("Save")); - - // Return the newly generated form. - return $form; - } - - public function savegps() { - // Save the GPS coordinates to the database. - - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - // Figure out the values of the text boxes - $str_tagid = Input::instance()->post("tag_id"); - $str_latitude = Input::instance()->post("gps_latitude"); - $str_longitude = Input::instance()->post("gps_longitude"); - $str_description = Input::instance()->post("gps_description"); - - // Save to database. - // Check and see if this ID already has GPS data, - // Update it if it does, create a new record if it doesn't. - $existingGPS = ORM::factory("tags_gps") - ->where("tag_id", "=", $str_tagid) - ->find_all(); - if (count($existingGPS) == 0) { - $newgps = ORM::factory("tags_gps"); - $newgps->tag_id = $str_tagid; - $newgps->latitude = $str_latitude; - $newgps->longitude = $str_longitude; - $newgps->description = $str_description; - $newgps->save(); - } else { - $updatedGPS = ORM::factory("tags_gps", $existingGPS[0]->id); - $updatedGPS->tag_id = $str_tagid; - $updatedGPS->latitude = $str_latitude; - $updatedGPS->longitude = $str_longitude; - $updatedGPS->description = $str_description; - $updatedGPS->save(); - } - - // Redirect back to the main screen and display a "success" message. - message::success(t("Your Settings Have Been Saved.")); - url::redirect("admin/tagsmap"); - } - - private function _get_googlemaps_form() { - // Make a new form for inputing information associated with google maps. - $form = new Forge("admin/tagsmap/savemapprefs", "", "post", - array("id" => "g-tags-map-admin-form")); - - // Input box for the Maps API Key - $googlemap_group = $form->group("GoogleMapsKey"); - $googlemap_group->input("google_api_key") - ->label(t("Google Maps API Key")) - ->value(module::get_var("tagsmap", "googlemap_api_key")) - ->rules("required"); - - // Input boxes for the Maps starting location map type and zoom. - $startingmap_group = $form->group("GoogleMapsPos"); - $startingmap_group->input("google_starting_latitude") - ->label(t("Starting Latitude")) - ->value(module::get_var("tagsmap", "googlemap_latitude")) - ->rules("required"); - $startingmap_group->input("google_starting_longitude") - ->label(t("Starting Longitude")) - ->value(module::get_var("tagsmap", "googlemap_longitude")) - ->rules("required"); - $startingmap_group->input("google_default_zoom") - ->label(t("Default Zoom Level")) - ->value(module::get_var("tagsmap", "googlemap_zoom")) - ->rules("required"); - $startingmap_group->dropdown("google_default_type") - ->label(t("Default Map Type")) - ->options( - array("G_NORMAL_MAP" => "Normal", - "G_SATELLITE_MAP" => "Satellite", - "G_HYBRID_MAP" => "Hybrid", - "G_PHYSICAL_MAP" => "Physical", - "G_SATELLITE_3D_MAP" => "Google Earth")) - ->selected(module::get_var("tagsmap", "googlemap_type")); - - // Add a save button to the form. - $form->submit("SaveSettings")->value(t("Save")); - - // Return the newly generated form. - return $form; - } - - public function savemapprefs() { - // Save information associated with Google Maps to the database. - - // Prevent Cross Site Request Forgery - access::verify_csrf(); - - $form = $this->_get_googlemaps_form(); - if ($form->validate()) { - Kohana_Log::add("error",print_r($form,1)); - module::set_var("tagsmap", "googlemap_api_key", $form->GoogleMapsKey->google_api_key->value); - module::set_var("tagsmap", "googlemap_latitude", $form->GoogleMapsPos->google_starting_latitude->value); - module::set_var("tagsmap", "googlemap_longitude", $form->GoogleMapsPos->google_starting_longitude->value); - module::set_var("tagsmap", "googlemap_zoom", $form->GoogleMapsPos->google_default_zoom->value); - module::set_var("tagsmap", "googlemap_type", $form->GoogleMapsPos->google_default_type->value); - - // Display a success message and redirect back to the TagsMap admin page. - message::success(t("Your settings have been saved.")); - url::redirect("admin/tagsmap"); - } - - // Else show the page with errors - $view = new Admin_View("admin.html"); - $view->content = new View("admin_tagsmap.html"); - $view->content->googlemaps_form = $form; - $view->content->tags = ORM::factory("tag")->order_by("name", "ASC")->find_all(); - print $view; - } -} \ No newline at end of file diff --git a/3.1/modules/tagsmap/controllers/tagsmap.php b/3.1/modules/tagsmap/controllers/tagsmap.php deleted file mode 100644 index 8725db86..00000000 --- a/3.1/modules/tagsmap/controllers/tagsmap.php +++ /dev/null @@ -1,59 +0,0 @@ -find_all(); - - // Set up and display the actual page. - // If fullsize is true, allow the map to take up the entire browser window, - // if not, then display the map in the gallery theme. - if ($fullsize == true) { - $view = new View("tagsmap_googlemap.html"); - $view->map_fullsize = true; - - // Load in module preferences. - $view->tags_gps = $tagsGPS; - $view->google_map_key = module::get_var("tagsmap", "googlemap_api_key"); - $view->google_map_latitude = module::get_var("tagsmap", "googlemap_latitude"); - $view->google_map_longitude = module::get_var("tagsmap", "googlemap_longitude"); - $view->google_map_zoom = module::get_var("tagsmap", "googlemap_zoom"); - $view->google_map_type = module::get_var("tagsmap", "googlemap_type"); - - print $view; - } else { - $template = new Theme_View("page.html", "other", "TagsMap"); - $template->page_title = t("Gallery :: Map"); - $template->content = new View("tagsmap_googlemap.html"); - - // Load in module preferences. - $template->content->tags_gps = $tagsGPS; - $template->content->google_map_key = module::get_var("tagsmap", "googlemap_api_key"); - $template->content->google_map_latitude = module::get_var("tagsmap", "googlemap_latitude"); - $template->content->google_map_longitude = module::get_var("tagsmap", "googlemap_longitude"); - $template->content->google_map_zoom = module::get_var("tagsmap", "googlemap_zoom"); - $template->content->google_map_type = module::get_var("tagsmap", "googlemap_type"); - - print $template; - } - } -} diff --git a/3.1/modules/tagsmap/css/tagsmap_menu.css b/3.1/modules/tagsmap/css/tagsmap_menu.css deleted file mode 100644 index 925e1181..00000000 --- a/3.1/modules/tagsmap/css/tagsmap_menu.css +++ /dev/null @@ -1,3 +0,0 @@ -#g-view-menu #g-tagsmap-link { - background-image: url('../images/ico-view-tagsmap.png'); -} diff --git a/3.1/modules/tagsmap/helpers/tagsmap_event.php b/3.1/modules/tagsmap/helpers/tagsmap_event.php deleted file mode 100644 index 66ed8fd2..00000000 --- a/3.1/modules/tagsmap/helpers/tagsmap_event.php +++ /dev/null @@ -1,67 +0,0 @@ -deactivate)) { - site_status::warning( - t("The TagsMap module requires the Tags module. " . - "Activate the Tags module now", - array("url" => url::site("admin/modules"))), - "tagsmap_needs_tag"); - } else { - site_status::clear("tagsmap_needs_tag"); - } - } - - static function admin_menu($menu, $theme) { - // Add a link to the TagsMap admin page to the Content menu. - $menu->get("content_menu") - ->append(Menu::factory("link") - ->id("tagsmap") - ->label(t("TagsMap Settings")) - ->url(url::site("admin/tagsmap"))); - } - - static function photo_menu($menu, $theme) { - $menu->append(Menu::factory("link") - ->id("tagsmap") - ->label(t("View Map")) - ->url(url::site("tagsmap/googlemap/")) - ->css_id("g-tagsmap-link")); - } - - static function movie_menu($menu, $theme) { - $menu->append(Menu::factory("link") - ->id("tagsmap") - ->label(t("View Map")) - ->url(url::site("tagsmap/googlemap/")) - ->css_id("g-tagsmap-link")); - } - - static function album_menu($menu, $theme) { - $menu->append(Menu::factory("link") - ->id("tagsmap") - ->label(t("View Map")) - ->url(url::site("tagsmap/googlemap/")) - ->css_id("g-tagsmap-link")); - } -} \ No newline at end of file diff --git a/3.1/modules/tagsmap/helpers/tagsmap_theme.php b/3.1/modules/tagsmap/helpers/tagsmap_theme.php deleted file mode 100644 index e43aff13..00000000 --- a/3.1/modules/tagsmap/helpers/tagsmap_theme.php +++ /dev/null @@ -1,25 +0,0 @@ -css("tagsmap_menu.css"); - } -} diff --git a/3.1/modules/tagsmap/images/ico-view-tagsmap.png b/3.1/modules/tagsmap/images/ico-view-tagsmap.png deleted file mode 100644 index 95d714f3..00000000 Binary files a/3.1/modules/tagsmap/images/ico-view-tagsmap.png and /dev/null differ diff --git a/3.1/modules/tagsmap/models/tags_gps.php b/3.1/modules/tagsmap/models/tags_gps.php deleted file mode 100644 index 31f7943f..00000000 --- a/3.1/modules/tagsmap/models/tags_gps.php +++ /dev/null @@ -1,21 +0,0 @@ - -

        - -

        -
        -

        - -

        -
        You may sign up for a Google Maps API key here.

        - -
        - -
        -

        - -

        - count()/5 ?> - - - - - - - - -
        - count()) ?> -
        - $tag): ?> - name, 0, 1)) ?> - - - -
          - - $tags_per_column): /* new column */ ?> -
        - - - - - -
          - - -
        • - name) ?> - (count ?>) - - id") ?>"> - - where("tag_id", "=", $tag->id) - ->find_all(); - if (count($existingGPS) > 0) { - ?> - | id") ?>"> - -
        • - - - - -
        -
        -
        - -
        -

        - -

        - - -
        - "> - - -
        -
        diff --git a/3.1/modules/tagsmap/views/admin_tagsmap_delete.html.php b/3.1/modules/tagsmap/views/admin_tagsmap_delete.html.php deleted file mode 100644 index 8b6c0e95..00000000 --- a/3.1/modules/tagsmap/views/admin_tagsmap_delete.html.php +++ /dev/null @@ -1,9 +0,0 @@ - -
        -

        -

        -">Delete -">Cancel - -
        - diff --git a/3.1/modules/tagsmap/views/admin_tagsmap_edit.html.php b/3.1/modules/tagsmap/views/admin_tagsmap_edit.html.php deleted file mode 100644 index e01f2b29..00000000 --- a/3.1/modules/tagsmap/views/admin_tagsmap_edit.html.php +++ /dev/null @@ -1,58 +0,0 @@ - -
        -

        -
        -

        -
        -
        - -
        - - - - - diff --git a/3.1/modules/tagsmap/views/tagsmap_googlemap.html.php b/3.1/modules/tagsmap/views/tagsmap_googlemap.html.php deleted file mode 100644 index 8e08eabd..00000000 --- a/3.1/modules/tagsmap/views/tagsmap_googlemap.html.php +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - <?= t("Gallery :: Map") ?> - - - - - - - - -
        - - -

        - "> - -

        - diff --git a/3.1/modules/themeroller/controllers/admin_themeroller.php b/3.1/modules/themeroller/controllers/admin_themeroller.php deleted file mode 100755 index 2b448431..00000000 --- a/3.1/modules/themeroller/controllers/admin_themeroller.php +++ /dev/null @@ -1,185 +0,0 @@ -form, $v->errors) = $this->_get_upload_form(); - $v->is_writable = is_writable(THEMEPATH); - $v->action = "admin/themeroller/form_create"; - $submit_class = "ui-state-default ui-corner-all submit g-left"; - - if ($v->not_writable = !is_writable(THEMEPATH)) { - $submit_class .= " ui-state-disabled"; - } - $v->submit_class = $submit_class; - $v->script_data = array( - "g3sid" => Session::instance()->id(), - "user_agent" => Input::instance()->server("HTTP_USER_AGENT"), - "csrf" => access::csrf_token()); - json::reply(array("html" => (string) $v)); - } - - public function form_create() { - $theme_name = Session::instance()->get_once("theme_name"); - json::reply(array("html" => (string) $this->_get_theme_form($theme_name))); - } - - public function upload() { - access::verify_csrf(); - - $validation = new Validation(array_merge($_POST, $_FILES)); - $validation->add_rules("zip_file", "upload::valid", "upload::required", "upload::type[zip]"); - $validation->add_rules("is_admin", "chars[0,1]"); - $validation->add_callbacks("zip_file", array($this, "_unload_zip")); - if ($validation->validate()) { - $session = Session::instance(); - $themeroller_name = $session->get("themeroller_name"); - $is_admin = $validation["is_admin"]; - $counter = 0; - $theme_name_generated = $theme_name = ($is_admin ? "admin_" : "") . $themeroller_name; - while (file_exists(THEMEPATH . "$theme_name_generated/theme.info")) { - $counter++; - $theme_name_generated = "{$theme_name}_{$counter}"; - } - - $theme_name = strtolower(strtr($theme_name_generated, " ", "_")); - $session->set("theme_name", $theme_name); - $session->set("themeroller_is_admin", $is_admin); - print "FILEID: {$validation["zip_file"]["tmp_name"]}"; - } else { - header("HTTP/1.1 400 Bad Request"); - print "ERROR: " . t("Invalid zip archive"); - } - } - - public function create() { - access::verify_csrf(); - - $form = $this->_get_theme_form(); - if ($form->validate()) { - $session = Session::instance(); - $extract_path = $session->get_once("theme_extract_path"); - $v = new View("admin_themeroller_progress.html"); - - $task_def = Task_Definition::factory() - ->callback("themeroller_task::create_theme") - ->description(t("Generate theme from a themeroller archive")) - ->name(t("Generate theme")); - - $v->task = task::create($task_def, - array("path" => $extract_path, - "original_name" => $form->theme->original->value, - "theme_name" => $form->theme->theme_name->value, - "display_name" => $form->theme->display_name->value, - "description" => $form->theme->description->value, - "is_admin" => $session->get("themeroller_is_admin"))); - - json::reply(array("html" => (string) $v)); - } else { - json::reply(array("result" => "error", "html" => (string) $form)); - } - } - - /** - * Run the task of creating the theme - */ - static function run($task_id) { - access::verify_csrf(); - - $task = ORM::factory("task", $task_id); - if (!$task->loaded() || $task->owner_id != identity::active_user()->id) { - access::forbidden(); - } - - $task = task::run($task_id); - - // Prevent the JavaScript code from breaking by forcing a period as - // decimal separator for all locales with sprintf("%F", $value). - json::reply(array("done" => (bool)$task->done, - "status" => (string)$task->status, - "percent_complete" => sprintf("%F", $task->percent_complete))); - } - - static function _is_theme_defined($name) { - $theme_name = strtolower(strtr($name->value, " ", "_")); - if (file_exists(THEMEPATH . "$theme_name/theme.info")) { - $name->add_error("conflict", 1); - } - } - - public function _unload_zip(Validation $post, $field) { - $zipfile = $post["zip_file"]["tmp_name"]; - if (false !== ($extract_path = themeroller::extract_zip_file($zipfile))) { - $theme_name = themeroller::get_theme_name($extract_path); - if (!empty($theme_name)) { - Session::instance()->set("themeroller_name", $theme_name); - } else { - Kohana_Log::add("error", "zip file: css directory not found"); - $post->add_error($field, "invalid zipfile"); - } - } else { - Kohana_Log::add("error", "zip file: open failed"); - $post->add_error($field, "invalid zipfile"); - } - if (file_exists($zipfile)) { - unlink($zipfile); - } - } - - private function _get_theme_form($theme_name=null) { - $session = Session::instance(); - $form = new Forge("admin/themeroller/create", "", "post", array("id" => "g-themeroller-create-form")); - $form_group = $form->group("theme")->label(t("Create theme")); - $original_name = $form_group->hidden("original"); - $name_field = $form_group->input("theme_name")->label(t("Theme Name"))->id("g-name") - ->rules("required") - ->callback("Admin_Themeroller_Controller::_is_theme_defined") - ->error_messages("conflict", t("There is already a theme with that name")) - ->error_messages("required", t("You must enter a theme name")); - $display_name = $form_group->input("display_name")->label(t("Display Name")) - ->id("g-display-name") - ->rules("required") - ->error_messages("required", t("You must enter a theme display name")); - if (!empty($theme_name)) { - $name_field->value($theme_name); - $is_admin = $session->get("themeroller_is_admin"); - $themeroller_name = $session->get("themeroller_name"); - $display_name->value(ucwords($is_admin ? t("%name administration theme", - array("name" => str_replace("-", " ", $themeroller_name))) : - t("%name theme", - array("name" => str_replace("-", " ", $themeroller_name))))); - $original_name->hidden("original")->value(Session::instance()->get("themeroller_name")); - } - $form_group->textarea("description")->label(t("Description")) - ->id("g-description") - ->value(t("A generated theme based on the ui themeroller '%name' styling", array("name" => str_replace("admin_", "", $theme_name)))) - ->rules("required") - ->error_messages("required", t("You must enter a theme description name")); - $form_group->submit("")->value(t("Create")); - - return $form; - } - - private function _get_upload_form() { - $form = array("zip_file" => "", "is_admin" => ""); - $errors = array_fill_keys(array_keys($form), ""); - return array($form, $errors); - } -} \ No newline at end of file diff --git a/3.1/modules/themeroller/data/admin_views/admin.html.php b/3.1/modules/themeroller/data/admin_views/admin.html.php deleted file mode 100644 index b77a8d46..00000000 --- a/3.1/modules/themeroller/data/admin_views/admin.html.php +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - <? if ($page_title): ?> - <?= t("Gallery Admin: %page_title", array("page_title" => $page_title)) ?> - <? else: ?> - <?= t("Admin dashboard") ?> - <? endif ?> - - " type="image/x-icon" /> - - css("yui/reset-fonts-grids.css") ?> - css("themeroller/ui.base.css") ?> - css("superfish/css/superfish.css") ?> - css("screen.css") ?> - - - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("ui.init.js") ?> - - admin_head() ?> - - - body_attributes() ?>> - admin_page_top() ?> - -
        - -
        - - site_status() ?> -
        - admin_header_top() ?> - - user_menu() ?> - - - - admin_header_bottom() ?> -
        -
        -
        -
        -
        - messages() ?> - -
        -
        -
        - -
        - -
        - -
        - -
        - admin_page_bottom() ?> - - diff --git a/3.1/modules/themeroller/data/admin_views/block.html.php b/3.1/modules/themeroller/data/admin_views/block.html.php deleted file mode 100644 index d1d2d088..00000000 --- a/3.1/modules/themeroller/data/admin_views/block.html.php +++ /dev/null @@ -1,18 +0,0 @@ - - - - - diff --git a/3.1/modules/themeroller/data/admin_views/pager.html.php b/3.1/modules/themeroller/data/admin_views/pager.html.php deleted file mode 100644 index 5fff5845..00000000 --- a/3.1/modules/themeroller/data/admin_views/pager.html.php +++ /dev/null @@ -1,44 +0,0 @@ - - -
          - $current_first_item, - "to_number" => $current_last_item, - "count" => $total_items)) ?> -
        • - - - - - - - - - - - - - - -
        • -
        • -
        • - - - - - - - - - - - - - - -
        • -
        diff --git a/3.1/modules/themeroller/data/css/fix-ie.css b/3.1/modules/themeroller/data/css/fix-ie.css deleted file mode 100644 index 40a8d1f6..00000000 --- a/3.1/modules/themeroller/data/css/fix-ie.css +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Fix display in IE 6, 7, and 8 - */ - -#g-banner { - z-index: 2; - zoom: 1; -} - -#g-sidebar { - overflow: hidden; -} - -#g-photo, -#g-movie { - zoom: 1; -} - -#g-photo .g-context-menu, -#g-movie .g-context-menu { - width: 240px; -} - -input.submit { - clear: none !important; - display: inline !important; -} - -.g-short-form input.text, -.g-short-form input.submit { - font-size: 1em; - line-height: 1em; - padding: .38em .3em; -} - -#g-search-form input#q { - width: 300px; -} - -#g-add-tag-form input.textbox { - width: 110px !important; -} - -#g-add-tag-form input[type='submit'] { - padding: .3em 0 !important; -} - -#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/3.1/modules/themeroller/data/js/admin_ui.init.js b/3.1/modules/themeroller/data/js/admin_ui.init.js deleted file mode 100644 index 4ed912f8..00000000 --- a/3.1/modules/themeroller/data/js/admin_ui.init.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Initialize jQuery UI and Gallery Plugins - * @todo Move ui-corner-all assignments to theme admin views - */ - -$(document).ready(function(){ - - // Initialize Superfish menus - $("#g-site-admin-menu .g-menu").hide().addClass("sf-menu"); - $("#g-site-admin-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 modal dialogs - $(".g-dialog-link").gallery_dialog(); - - // Initialize short forms - $(".g-short-form").gallery_short_form(); - - // Initialize ajax links - $(".g-ajax-link").gallery_ajax(); - - // Initialize panels - $(".g-panel-link").gallery_panel(); - - if ($("#g-photo-stream").length) { - // Vertically align thumbs in photostream - $(".g-item").gallery_valign(); - } - - // Apply jQuery UI button css to submit inputs - $("input[type=submit]:not(.g-short-form input)").addClass("ui-state-default ui-corner-all"); - - // Round view menu buttons - if ($("#g-admin-comments-menu").length) { - $("#g-admin-comments-menu ul").removeClass("g-menu"); - $("#g-admin-comments-menu").addClass("g-buttonset"); - $("#g-admin-comments-menu a").addClass("g-button ui-state-default"); - $("#g-admin-comments-menu ul li:first a").addClass("ui-corner-left"); - $("#g-admin-comments-menu ul li:last a").addClass("ui-corner-right"); - } - - // Round corners - $(".g-selected").addClass("ui-corner-all"); - $(".g-available .g-block").addClass("ui-corner-all"); - $(".g-unavailable").addClass("ui-corner-all"); - - // Remove titles for menu options since we're displaying that text anyway - $(".sf-menu a, .sf-menu li").removeAttr("title"); - - // Initialize button hover effect - $.fn.gallery_hover_init(); -}); diff --git a/3.1/modules/themeroller/data/js/site_ui.init.js b/3.1/modules/themeroller/data/js/site_ui.init.js deleted file mode 100644 index a4fc0e2f..00000000 --- a/3.1/modules/themeroller/data/js/site_ui.init.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * 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(""); - $(".g-context-menu a span").each(function() { - var iconClass = $(this).parent().attr("class").match(/ui-icon-.[^\s]+/).toString(); - $(this).addClass(iconClass); - }); - } - - // Remove titles for menu options since we're displaying that text anyway - $(".sf-menu a, .sf-menu li").removeAttr("title"); - - // Album and search results views - 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(); - if ($(this).next().height() > $(this).height()) { - $(this).height($(this).next().height()); - } else if ($(this).prev().height() > $(this).height()) { - $(this).height($(this).prev().height()); - } else { - $(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 - $("#g-photo,#g-movie").hover(function(){ - $(this).gallery_context_menu(); - }); - - // Add scroll effect for links to named anchors - $.localScroll({ - queue: true, - duration: 1000, - hash: true - }); - - $(this).find(".g-dialog-link").gallery_dialog(); - $(this).find(".g-ajax-link").gallery_ajax(); - } - - // Initialize button hover effect - $.fn.gallery_hover_init(); - -}); diff --git a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail.png b/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail.png deleted file mode 100755 index 801976ba..00000000 Binary files a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_bgColorContent.png b/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_bgColorContent.png deleted file mode 100755 index 85d5dda6..00000000 Binary files a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_bgColorContent.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_bgColorDefault.png b/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_bgColorDefault.png deleted file mode 100755 index e4ba7bd1..00000000 Binary files a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_bgColorDefault.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_bgColorHeader.png b/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_bgColorHeader.png deleted file mode 100755 index fba00029..00000000 Binary files a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_bgColorHeader.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_borderColorDefault.png b/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_borderColorDefault.png deleted file mode 100755 index e38bb48d..00000000 Binary files a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_borderColorDefault.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_fcActive.png b/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_fcActive.png deleted file mode 100755 index b1db8e2c..00000000 Binary files a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_fcActive.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_fcDefault.png b/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_fcDefault.png deleted file mode 100755 index 450d826b..00000000 Binary files a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_fcDefault.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_fcHeader.png b/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_fcHeader.png deleted file mode 100755 index 8c3dd3a5..00000000 Binary files a/3.1/modules/themeroller/data/masks/admin_thumbnail/thumbnail_fcHeader.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/css/themeroller/ui-icons_mask_256x240.png b/3.1/modules/themeroller/data/masks/css/themeroller/ui-icons_mask_256x240.png deleted file mode 100755 index 089e7b95..00000000 Binary files a/3.1/modules/themeroller/data/masks/css/themeroller/ui-icons_mask_256x240.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/avatar_mask.png b/3.1/modules/themeroller/data/masks/images/avatar_mask.png deleted file mode 100755 index ca9164cd..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/avatar_mask.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-album_mask.png b/3.1/modules/themeroller/data/masks/images/ico-album_mask.png deleted file mode 100755 index 1df323dc..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-album_mask.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-error_mask[iconColorError].png b/3.1/modules/themeroller/data/masks/images/ico-error_mask[iconColorError].png deleted file mode 100755 index c0eef5fd..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-error_mask[iconColorError].png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-help_mask.png b/3.1/modules/themeroller/data/masks/images/ico-help_mask.png deleted file mode 100755 index 3f72f452..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-help_mask.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-info_mask[iconColorHighlight].png b/3.1/modules/themeroller/data/masks/images/ico-info_mask[iconColorHighlight].png deleted file mode 100755 index 76767424..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-info_mask[iconColorHighlight].png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-print_mask.png b/3.1/modules/themeroller/data/masks/images/ico-print_mask.png deleted file mode 100755 index 31e4bbac..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-print_mask.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-separator-rtl_mask[iconColorDefault].png b/3.1/modules/themeroller/data/masks/images/ico-separator-rtl_mask[iconColorDefault].png deleted file mode 100755 index 5cd517fb..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-separator-rtl_mask[iconColorDefault].png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-separator_mask[iconColorDefault].png b/3.1/modules/themeroller/data/masks/images/ico-separator_mask[iconColorDefault].png deleted file mode 100755 index 8ec32607..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-separator_mask[iconColorDefault].png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-success-inactive_mask[iconColorHighlight].png b/3.1/modules/themeroller/data/masks/images/ico-success-inactive_mask[iconColorHighlight].png deleted file mode 100755 index b888356f..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-success-inactive_mask[iconColorHighlight].png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-success-passive_mask[iconColorHighlight].png b/3.1/modules/themeroller/data/masks/images/ico-success-passive_mask[iconColorHighlight].png deleted file mode 100755 index 7ed64b83..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-success-passive_mask[iconColorHighlight].png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-success_mask[iconColorHighlight].png b/3.1/modules/themeroller/data/masks/images/ico-success_mask[iconColorHighlight].png deleted file mode 100755 index a7500f35..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-success_mask[iconColorHighlight].png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-view-comments_mask.png b/3.1/modules/themeroller/data/masks/images/ico-view-comments_mask.png deleted file mode 100755 index 3df4e027..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-view-comments_mask.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-view-fullsize_mask.png b/3.1/modules/themeroller/data/masks/images/ico-view-fullsize_mask.png deleted file mode 100755 index 7732bace..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-view-fullsize_mask.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-view-slideshow-rtl_mask.png b/3.1/modules/themeroller/data/masks/images/ico-view-slideshow-rtl_mask.png deleted file mode 100755 index 0f05bba9..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-view-slideshow-rtl_mask.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-view-slideshow_mask.png b/3.1/modules/themeroller/data/masks/images/ico-view-slideshow_mask.png deleted file mode 100755 index 6ba2c3b7..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-view-slideshow_mask.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/ico-warning_mask[iconColorWarning].png b/3.1/modules/themeroller/data/masks/images/ico-warning_mask[iconColorWarning].png deleted file mode 100755 index 0f561d8f..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/ico-warning_mask[iconColorWarning].png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/images/select-photos-backg_mask.png b/3.1/modules/themeroller/data/masks/images/select-photos-backg_mask.png deleted file mode 100755 index d5860298..00000000 Binary files a/3.1/modules/themeroller/data/masks/images/select-photos-backg_mask.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail.png b/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail.png deleted file mode 100755 index 3ae3d63b..00000000 Binary files a/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_bgColorContent.png b/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_bgColorContent.png deleted file mode 100755 index 63d4ffa4..00000000 Binary files a/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_bgColorContent.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_bgColorDefault.png b/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_bgColorDefault.png deleted file mode 100755 index e3c6adb6..00000000 Binary files a/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_bgColorDefault.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_bgColorHeader.png b/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_bgColorHeader.png deleted file mode 100755 index 70d8e93e..00000000 Binary files a/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_bgColorHeader.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_fcDefault.png b/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_fcDefault.png deleted file mode 100755 index 9fca446a..00000000 Binary files a/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_fcDefault.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_iconColorHover.png b/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_iconColorHover.png deleted file mode 100755 index 3a27fb6d..00000000 Binary files a/3.1/modules/themeroller/data/masks/site_thumbnail/thumbnail_iconColorHover.png and /dev/null differ diff --git a/3.1/modules/themeroller/data/views/album.html.php b/3.1/modules/themeroller/data/views/album.html.php deleted file mode 100644 index de196be0..00000000 --- a/3.1/modules/themeroller/data/views/album.html.php +++ /dev/null @@ -1,42 +0,0 @@ - - -
        - album_top() ?> -

        title) ?>

        -
        description)) ?>
        -
        - -
          - - $child): ?> - - is_album()): ?> - - -
        • - thumb_top($child) ?> - - thumb_img(array("class" => "g-thumbnail")) ?> - - thumb_bottom($child) ?> - context_menu($child, "#g-item-id-{$child->id} .g-thumbnail") ?> -

          - title) ?>

          - -
        • - - - admin || access::can("add", $item)): ?> - id") ?> -
        • Add some.", - array("attrs" => html::mark_clean("href=\"$addurl\" class=\"g-dialog-link\""))) ?>
        • - -
        • - - -
        -album_bottom() ?> - -paginator() ?> diff --git a/3.1/modules/themeroller/data/views/dynamic.html.php b/3.1/modules/themeroller/data/views/dynamic.html.php deleted file mode 100644 index a8a4d362..00000000 --- a/3.1/modules/themeroller/data/views/dynamic.html.php +++ /dev/null @@ -1,29 +0,0 @@ - -
        -
        - dynamic_top() ?> -
        -

        -
        - -
          - $child): ?> -
        • "> - thumb_top($child) ?> - - photo - -

          title) ?>

          - thumb_bottom($child) ?> - -
        • - -
        -dynamic_bottom() ?> - -paginator() ?> diff --git a/3.1/modules/themeroller/data/views/movie.html.php b/3.1/modules/themeroller/data/views/movie.html.php deleted file mode 100644 index 158857db..00000000 --- a/3.1/modules/themeroller/data/views/movie.html.php +++ /dev/null @@ -1,19 +0,0 @@ - -
        - photo_top() ?> - - paginator() ?> - -
        - resize_top($item) ?> - movie_img(array("class" => "g-movie", "id" => "g-item-id-{$item->id}")) ?> - resize_bottom($item) ?> -
        - -
        -

        title) ?>

        -
        description)) ?>
        -
        - - photo_bottom() ?> -
        diff --git a/3.1/modules/themeroller/data/views/no_sidebar.html.php b/3.1/modules/themeroller/data/views/no_sidebar.html.php deleted file mode 100644 index a9eb0e3e..00000000 --- a/3.1/modules/themeroller/data/views/no_sidebar.html.php +++ /dev/null @@ -1,6 +0,0 @@ - -
          -
        • -
          "> -
        • -
        diff --git a/3.1/modules/themeroller/data/views/page.html.php b/3.1/modules/themeroller/data/views/page.html.php deleted file mode 100644 index ffd5a173..00000000 --- a/3.1/modules/themeroller/data/views/page.html.php +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - <? 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 ?> - - " type="image/x-icon" /> - css("yui/reset-fonts-grids.css") ?> - css("superfish/css/superfish.css") ?> - css("themeroller/ui.base.css") ?> - css("screen.css") ?> - - page_type == "collection"): ?> - - - - - - - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("jquery.localscroll.js") ?> - script("ui.init.js") ?> - - head() they get combined */ ?> - page_subtype == "photo"): ?> - script("jquery.scrollTo.js") ?> - script("gallery.show_full_size.js") ?> - page_subtype == "movie"): ?> - script("flowplayer.js") ?> - - - head() ?> - - - body_attributes() ?>> - page_top() ?> -
        - site_status() ?> -
        -
        - - - - - - user_menu() ?> - header_top() ?> - - - - - - header_bottom() ?> -
        - - item() && !empty($parents)): ?> - - -
        -
        -
        -
        -
        - messages() ?> - -
        -
        -
        -
        - page_subtype != "login"): ?> - - -
        -
        - -
        - page_bottom() ?> - - diff --git a/3.1/modules/themeroller/data/views/paginator.html.php b/3.1/modules/themeroller/data/views/paginator.html.php deleted file mode 100644 index 5034c965..00000000 --- a/3.1/modules/themeroller/data/views/paginator.html.php +++ /dev/null @@ -1,87 +0,0 @@ - - - -
          -
        • - - - - - - - - - - - - - - - - - -
        • - -
        • - - - $first_visible_position, - "to_number" => $last_visible_position, - "count" => $total)) ?> - - $position, "total" => $total)) ?> - - - - -
        • - -
        • - - - - - - - - - - - - - - - - - -
        • -
        diff --git a/3.1/modules/themeroller/data/views/permissions_form.html.php b/3.1/modules/themeroller/data/views/permissions_form.html.php deleted file mode 100644 index 5da1b5e6..00000000 --- a/3.1/modules/themeroller/data/views/permissions_form.html.php +++ /dev/null @@ -1,88 +0,0 @@ - -
        - - - - - - - - - - - - - - name, $item) ?> - name, $item) ?> - name, $item) ?> - - - - - - - - - - - - - - - - - - - - - -
        name) ?>
        display_name) ?> - - - - - - - - - - - id == 1): ?> - - - - - - id == 1): ?> - - - - - -
        -
        diff --git a/3.1/modules/themeroller/data/views/photo.html.php b/3.1/modules/themeroller/data/views/photo.html.php deleted file mode 100644 index f8b5511c..00000000 --- a/3.1/modules/themeroller/data/views/photo.html.php +++ /dev/null @@ -1,38 +0,0 @@ - - -item())): ?> - - - - -
        - photo_top() ?> - - paginator() ?> - - - -
        -

        title) ?>

        -
        description)) ?>
        -
        - - photo_bottom() ?> -
        diff --git a/3.1/modules/themeroller/helpers/themeroller.php b/3.1/modules/themeroller/helpers/themeroller.php deleted file mode 100644 index 44a102cc..00000000 --- a/3.1/modules/themeroller/helpers/themeroller.php +++ /dev/null @@ -1,204 +0,0 @@ -open($zipfile) === true) { - Session::instance()->set("theme_extract_path", $extract_path); - $zip->extractTo($extract_path); - $zip->close(); - return $extract_path; - } - } else if (extension_loaded("zlib")) { - require_once(MODPATH . "themeroller/libraries/pclzip.lib.php"); - $archive = new PclZip($zipfile); - $list = $archive->extract(PCLZIP_OPT_PATH, $extract_path); - if (!empty($list)) { - Session::instance()->set("theme_extract_path", $extract_path); - return $extract_path; - } - } - return false; - } - - static function recursive_directory_delete($path) { - if (is_dir($path)) { - $objects = scandir($path); - foreach ($objects as $object) { - if ($object[0] != ".") { - $object_path = "$path/$object"; - if (filetype($object_path) == "dir") { - self::recursive_directory_delete($object_path); - } else { - unlink($object_path); - } - } - } - } - } - - static function get_theme_name($extract_path) { - $theme_name = null; - if ($handle = opendir($extract_path . "/css")) { - while (false !== ($file = readdir($handle))) { - if ($file[0] !== ".") { - $theme_name = basename($file); - break; - } - } - if (empty($theme_name)) { - Kohana_Log::add("error", "zip file: no theme name"); - $post->add_error($field, "invalid zipfile"); - } - closedir($handle); - } - - return $theme_name; - } - - static function get_theme_parameters($original_name, $css_path, $is_admin) { - $parameters = array(); - $css_files = glob("$css_path/css/$original_name/jquery*.css"); - $css_contents = file_get_contents($css_files[0]); - $parameters["colors"] = $parameters["icons"] = array(); - if (preg_match("/[?|&](.*)/", $css_contents, $matches)) { - if (preg_match_all("/&{0,1}(\w+)=([a-zA-Z0-9\-_\%\.,]*)/", $matches[1], $colors, PREG_SET_ORDER)) { - foreach ($colors as $color) { - $parameters["colors"][$color[1]] = $color[2]; - if (strpos($color[1], "icon") === 0) { - $parameters["icons"][] = $color[2]; - } - } - } - } - if (empty($parameters["colors"]["bgColorOverlay"])) { - $parameters["colors"]["bgColorOverlay"] = $parameters["colors"]["bgColorDefault"]; - /* @todo go find the .ui-widget-overlay { background: #aaaaaa */ - } - // The jquery themeroller has no warning style so lets generate the appropriate colors. - // We'll do this by averaging the color components of highlight and error colors - foreach (array("borderColor", "fc", "bgColor", "iconColor") as $type) { - $highlight = self::_rgb(hexdec($parameters["colors"]["{$type}Highlight"])); - $error = self::_rgb(hexdec($parameters["colors"]["{$type}Error"])); - - $warning = 0; - foreach (array("red", "green", "blue") as $color) { - $warning = ($warning << 8) | (int)floor(($highlight[$color] + $error[$color]) / 2); - } - $parameters["colors"]["{$type}Warning"] = dechex($warning); - if ($type == "iconColor") { - $parameters["icons"][] = $parameters["colors"]["{$type}Warning"]; - } - } - - $parameters["js"] = $is_admin ? glob(MODPATH . "themeroller/data/js/admin_*.js") : - glob(MODPATH . "themeroller/data/js/site_*.js"); - $parameters["standard_css"] = glob(MODPATH . "themeroller/data/css/*.css"); - $parameters["masks"] = glob(MODPATH . "themeroller/data/masks/images/*.png"); - $parameters["icon_mask"] = MODPATH . "themeroller/data/masks/css/themeroller/ui-icons_mask_256x240.png"; - $parameters["views"] = $is_admin ? glob(MODPATH . "themeroller/data/admin_views/*.html.php") : - glob(MODPATH . "themeroller/data/views/*.html.php"); - $parameters["css_files"] = $css_files; - $parameters["gifs"] = glob(MODPATH . "themeroller/data/images/*.gif"); - $parameters["images"] = - glob("$css_path/development-bundle/themes/$original_name/images/ui-bg*.png"); - $thumb_dir = $is_admin ? "admin_thumbnail" : "site_thumbnail"; - $parameters["thumbnail"] = MODPATH . "themeroller/data/masks/$thumb_dir/thumbnail.png"; - $parts = glob(MODPATH . "themeroller/data/masks/$thumb_dir/thumbnail_*.png"); - $parameters["thumbnail_parts"] = array(); - foreach ($parts as $thumb_file) { - if (preg_match("/thumbnail_(.*)\.png$/", $thumb_file, $matches)) { - $parameters["thumbnail_parts"][] = array("file" => $thumb_file, - "color" => $parameters["colors"][$matches[1]]); - } - } - - return $parameters; - } - - static function generate_image($mask_file, $output, $color) { - $mask = imagecreatefrompng($mask_file); - $image = imagecreatetruecolor(imagesx($mask), imagesy($mask)); - $icon_color = self::_rgb(hexdec($color)); - - $transparent = imagecolorallocatealpha($image, - $icon_color['red'], $icon_color['green'], $icon_color['blue'], 127); - imagefill($image, 0, 0, $transparent); - - for ($y=0; $y < imagesy($mask); $y++) { - for ($x=0; $x < imagesx($mask); $x++) { - $pixel_color = imagecolorsforindex($mask, imagecolorat($mask, $x, $y)); - $mask_color = self::_grayscale_pixel($pixel_color); - $mask_alpha = 127 - floor($mask_color["red"] * 127 / 256); - $new_color = imagecolorallocatealpha($image, - $icon_color['red'], $icon_color['green'], $icon_color['blue'], $mask_alpha); - imagesetpixel($image, $x, $y, $new_color); - } - } - - imagesavealpha($image, true); - imagealphablending($image, false); - imagepng($image, $output); - imagedestroy($image); - imagedestroy($mask); - } - - static function generate_thumbnail($base, $parts, $target) { - $image = imagecreatefrompng($base); - - $transparent = imagecolorallocatealpha($image, 0, 0, 0, 127); - imagefill($image, 0, 0, $transparent); - - $width = imagesx($image); - $height = imagesy($image); - - foreach ($parts as $thumb_part) { - $color = self::_rgb(hexdec($thumb_part["color"])); - $image_part = imagecreatefrompng($thumb_part["file"]); - for ($y=0; $y < imagesy($image_part); $y++) { - for ($x=0; $x < imagesx($image_part); $x++) { - $pixel_color = imagecolorsforindex($image_part, imagecolorat($image_part, $x, $y)); - $new_color = imagecolorallocatealpha($image, - $color['red'], $color['green'], $color['blue'], $pixel_color["alpha"]); - imagesetpixel($image, $x, $y, $new_color); - } - } - imagedestroy($image_part); - } - - imagesavealpha($image, true); - imagealphablending($image, false); - imagepng($image, $target); - imagedestroy($image); - } - - private static function _rgb($color) { - $r = ($color >> 16) & 0xff; - $g = ($color >> 8) & 0xff; - $b = $color & 0xff; - return array("red" => $r, "green" => $g, "blue" => $b, "alpha" => 0); - } - - private static function _grayscale_pixel($color) { - $gray = round(($color['red'] * 0.299) + ($color['green'] * 0.587) + ($color['blue'] * 0.114)); - return array("red" => $gray, "green" => $gray, "blue" => $gray, "alpha" => 0); - } -} diff --git a/3.1/modules/themeroller/helpers/themeroller_event.php b/3.1/modules/themeroller/helpers/themeroller_event.php deleted file mode 100644 index faca206e..00000000 --- a/3.1/modules/themeroller/helpers/themeroller_event.php +++ /dev/null @@ -1,27 +0,0 @@ -get("appearance_menu") - ->append(Menu::factory("dialog") - ->id("themeroller") - ->label(t("Import themeroller")) - ->url(url::site("admin/themeroller/form_upload"))); - } -} diff --git a/3.1/modules/themeroller/helpers/themeroller_task.php b/3.1/modules/themeroller/helpers/themeroller_task.php deleted file mode 100644 index f6fec329..00000000 --- a/3.1/modules/themeroller/helpers/themeroller_task.php +++ /dev/null @@ -1,278 +0,0 @@ -get("mode", "init"); - $start = microtime(true); - $theme_name = $task->get("theme_name"); - $is_admin = $task->get("is_admin", false); - $theme_path = THEMEPATH . "$theme_name/"; - $parameters = Cache::instance()->get("create_theme_cache:{$task->id}"); - if ($parameters) { - $parameters = unserialize($parameters); - } - $completed = $task->get("completed", 0); - switch ($mode) { - case "init": - $task->log(t("Starting theme '%theme' creation", array("theme" => $task->get("display_name")))); - $task->set("mode", "create_directory"); - $parameters = themeroller::get_theme_parameters($task->get("original_name"), - $task->get("path"), - $is_admin); - $task->set("total_activites", - 7 // number of directories to create - + 3 // screen.css, theme.info, thumbnail - + count($parameters["standard_css"]) // number of standard css to copy - + count($parameters["views"]) // number of views to copy - + count($parameters["js"]) // number of javascript files to copy - + count($parameters["masks"]) // number of images to generate - + count($parameters["icons"]) // number of icon images to generate - + count($parameters["css_files"]) // number of css files - + count($parameters["gifs"]) // number of static files - + count($parameters["images"])); // number of image files to copy - - $task->status = t("Starting up"); - break; - case "create_directory": - $completed = $task->get("completed"); - foreach (array("", "css", "css/themeroller", "css/themeroller/images", "images", - "js", "views") as $dir) { - $path = "{$theme_path}$dir"; - $completed++; - if (!file_exists($path)) { - mkdir($path); - chmod($path, 0755); - $task->log(t("Created directory: %path", array("path" => $path))); - } - } - $task->status = t("Directories created"); - $task->set("mode", "copy_views"); - break; - case "copy_views": - $task->status = t("Copying views"); - while (!empty($parameters["views"]) && microtime(true) - $start < 1.5) { - $view = array_shift($parameters["views"]); - $target = "{$theme_path}views/" . basename($view); - if (!file_exists($target)) { - copy($view, $target); - $task->log(t("Copied view: %path", array("path" => basename($view)))); - } - $completed++; - } - - if (empty($parameters["views"])){ - $task->status = t("Views copied"); - $task->set("mode", "copy_themeroller_images"); - } - break; - case "copy_themeroller_images": - $task->status = t("Copying themeroller images"); - while (!empty($parameters["images"]) && microtime(true) - $start < 1.5) { - $image = array_shift($parameters["images"]); - $target = "{$theme_path}css/themeroller/images/" . basename($image); - if (!file_exists($target)) { - copy($image, $target); - $task->log(t("Copied themeroller image: %path", array("path" => basename($image)))); - } - $completed++; - } - - if (empty($parameters["views"])){ - $task->status = t("Themeroller images copied"); - $task->set("mode", "copy_gif_images"); - } - break; - case "copy_gif_images": - $task->status = t("Copying gif images"); - while (!empty($parameters["gifs"]) && microtime(true) - $start < 1.5) { - $gif = array_shift($parameters["gifs"]); - $target = "{$theme_path}images/" . basename($gif); - if (!file_exists($target)) { - copy($gif, $target); - $task->log(t("Copied gif image: %path", array("path" => basename($gif)))); - } - $completed++; - } - - if (empty($parameters["gifs"])){ - $task->status = t("Gif images copied"); - $task->set("mode", "copy_css"); - } - break; - case "copy_css": - $task->status = t("Copying themeroller css"); - $target = "{$theme_path}css/themeroller/ui.base.css"; - copy($parameters["css_files"][0], $target); - $completed++; - $task->log(t("Copied themeroller css: themeroller/ui.base.css")); - $task->status = t("Themeroller css copied"); - $task->set("mode", "generate_images"); - break; - case "generate_images": - $task->status = t("Generating gallery images"); - $target_dir = "{$theme_path}images/"; - $colors = $task->get("colors"); - $image_color = $parameters["colors"]["iconColorContent"]; - while (!empty($parameters["masks"]) && microtime(true) - $start < 1.5) { - $mask = array_shift($parameters["masks"]); - $basename = basename($mask); - if (preg_match("/(.*)_mask(\[(\w*)\])?(\.png)$/", $basename, $matches)) { - $basename = "{$matches[1]}{$matches[4]}"; - $image_color = empty($matches[3]) ? $parameters["colors"]["iconColorContent"] : - $parameters["colors"][$matches[3]]; - } else { - $image_color = $parameters["colors"]["iconColorContent"]; - } - $image_file = "{$target_dir}$basename"; - themeroller::generate_image($mask, $image_file, $image_color); - $completed++; - $task->log(t("Generated image: %path", array("path" => $image_file))); - } - if (empty($parameters["masks"])) { - $task->set("mode", "generate_icons"); - $task->status = t("Gallery images generated"); - } - break; - case "generate_icons": - $task->status = t("Generating icons"); - $target_dir = "{$theme_path}css/themeroller/images/"; - $mask_file = $parameters["icon_mask"]; - while (!empty($parameters["icons"]) && microtime(true) - $start < 1.5) { - $color = array_shift($parameters["icons"]); - $icon_file = $target_dir . str_replace("mask", $color, basename($mask_file)); - themeroller::generate_image($mask_file, $icon_file, $color); - $completed++; - $task->log(t("Generated themeroller icon: %path", array("path" => $icon_file))); - } - if (empty($parameters["icons"])) { - $task->set("mode", "copy_standard_css"); - $task->status = t("Icons generated"); - } - break; - case "copy_standard_css": - $task->status = t("Copying standard css"); - while (!empty($parameters["standard_css"]) && microtime(true) - $start < 1.5) { - $css = array_shift($parameters["standard_css"]); - $target = "{$theme_path}css/" . basename($css); - if (!file_exists($target)) { - copy($css, $target); - $task->log(t("Copied css file: %path", array("path" => basename($target)))); - } - $completed++; - } - - if (empty($parameters["standard_css"])){ - $task->status = t("Standard css copied"); - $task->set("mode", "copy_javascript"); - } - break; - case "copy_javascript": - $task->status = t("Copying javascript"); - while (!empty($parameters["js"]) && microtime(true) - $start < 1.5) { - $js = array_shift($parameters["js"]); - $target = "{$theme_path}js/" . str_replace(array("admin_", "site_"), "", basename($js)); - if (!file_exists($target)) { - copy($js, $target); - $task->log(t("Copied js file: %path", array("path" => basename($target)))); - } - $completed++; - } - - if (empty($parameters["js"])){ - $task->status = t("Javascript copied"); - $task->set("mode", "generate_screen_css"); - } - break; - case "generate_screen_css": - $file = "{$theme_path}/css/screen.css"; - $v = new View(($is_admin ? "admin" : "site") . "_screen.css"); - $v->display_name = $task->get("display_name"); - foreach ($parameters["colors"] as $color => $value) { - $v->$color = $value; - } - ob_start(); - print $v->render(); - file_put_contents($file, ob_get_contents()); - ob_end_clean(); - $completed++; - $task->log(t("Generated screen css: %path", array("path" => $file))); - $task->status = t("Screen css generated"); - $task->set("mode", "generate_thumbnail"); - break; - case "generate_thumbnail": - themeroller::generate_thumbnail($parameters["thumbnail"], - $parameters["thumbnail_parts"], - "{$theme_path}thumbnail.png"); - $task->status = t("Thumbnail generated"); - $task->set("mode", "generate_theme_info"); - $completed++; - $task->log(t("Generated theme thumbnail: %path", array("path" => "{$theme_path}thumbnail.png"))); - break; - case "generate_theme_info": - $file = "{$theme_path}/theme.info"; - $v = new View("theme.info"); - $v->display_name = $task->get("display_name"); - $v->description = $task->get("description"); - $v->user_name = identity::active_user()->name; - $v->is_admin = $is_admin; - $v->definition = json_encode($parameters["colors"]); - ob_start(); - print $v->render(); - file_put_contents($file, ob_get_contents()); - ob_end_clean(); - $completed++; - $task->log(t("Generated theme info: %path", array("path" => "{$theme_path}theme.info"))); - $task->status = t("Theme info generated"); - $task->set("mode", "done"); - break; - case "done": - themeroller::recursive_directory_delete($task->get("path")); - $display_name = $task->get("display_name"); - $task->done = true; - $task->state = "success"; - $task->percent_complete = 100; - $completed = $task->get("total_activites"); - Cache::instance()->delete("create_theme_cache:{$task->id}"); - $message = t("Successfully generated: %name", array("name" => $display_name)); - message::info($message); - $task->log($message); - $task->status = t("'%name' generated", array("name" => $display_name)); - } - $task->set("completed", $completed); - if (!$task->done) { - Cache::instance()->set("create_theme_cache:{$task->id}", serialize($parameters)); - $task->percent_complete = ($completed / $task->get("total_activites")) * 100; - } - } catch (Exception $e) { - Kohana_Log::add("error",(string)$e); - $task->done = true; - $task->state = "error"; - $task->status = $e->getMessage(); - $task->log((string)$e); - } - } - -} \ No newline at end of file diff --git a/3.1/modules/themeroller/libraries/gnu-lgpl.txt b/3.1/modules/themeroller/libraries/gnu-lgpl.txt deleted file mode 100644 index b1e3f5a2..00000000 --- a/3.1/modules/themeroller/libraries/gnu-lgpl.txt +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/3.1/modules/themeroller/libraries/pclzip.lib.php b/3.1/modules/themeroller/libraries/pclzip.lib.php deleted file mode 100644 index e7facc1e..00000000 --- a/3.1/modules/themeroller/libraries/pclzip.lib.php +++ /dev/null @@ -1,5694 +0,0 @@ -zipname = $p_zipname; - $this->zip_fd = 0; - $this->magic_quotes_status = -1; - - // ----- Return - return; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // create($p_filelist, $p_add_dir="", $p_remove_dir="") - // create($p_filelist, $p_option, $p_option_value, ...) - // Description : - // This method supports two different synopsis. The first one is historical. - // This method creates a Zip Archive. The Zip file is created in the - // filesystem. The files and directories indicated in $p_filelist - // are added in the archive. See the parameters description for the - // supported format of $p_filelist. - // When a directory is in the list, the directory and its content is added - // in the archive. - // In this synopsis, the function takes an optional variable list of - // options. See bellow the supported options. - // Parameters : - // $p_filelist : An array containing file or directory names, or - // a string containing one filename or one directory name, or - // a string containing a list of filenames and/or directory - // names separated by spaces. - // $p_add_dir : A path to add before the real path of the archived file, - // in order to have it memorized in the archive. - // $p_remove_dir : A path to remove from the real path of the file to archive, - // in order to have a shorter path memorized in the archive. - // When $p_add_dir and $p_remove_dir are set, $p_remove_dir - // is removed first, before $p_add_dir is added. - // Options : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_COMMENT : - // PCLZIP_CB_PRE_ADD : - // PCLZIP_CB_POST_ADD : - // Return Values : - // 0 on failure, - // The list of the added files, with a status of the add action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function create($p_filelist) - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Set default values - $v_options = array(); - $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove from the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_ADD => 'optional', - PCLZIP_CB_POST_ADD => 'optional', - PCLZIP_OPT_NO_COMPRESSION => 'optional', - PCLZIP_OPT_COMMENT => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - //, PCLZIP_OPT_CRYPT => 'optional' - )); - if ($v_result != 1) { - return 0; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; - } - else if ($v_size > 2) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Invalid number / type of arguments"); - return 0; - } - } - } - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Init - $v_string_list = array(); - $v_att_list = array(); - $v_filedescr_list = array(); - $p_result_list = array(); - - // ----- Look if the $p_filelist is really an array - if (is_array($p_filelist)) { - - // ----- Look if the first element is also an array - // This will mean that this is a file description entry - if (isset($p_filelist[0]) && is_array($p_filelist[0])) { - $v_att_list = $p_filelist; - } - - // ----- The list is a list of string names - else { - $v_string_list = $p_filelist; - } - } - - // ----- Look if the $p_filelist is a string - else if (is_string($p_filelist)) { - // ----- Create a list from the string - $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); - } - - // ----- Invalid variable type for $p_filelist - else { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist"); - return 0; - } - - // ----- Reformat the string list - if (sizeof($v_string_list) != 0) { - foreach ($v_string_list as $v_string) { - if ($v_string != '') { - $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; - } - else { - } - } - } - - // ----- For each file in the list check the attributes - $v_supported_attributes - = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' - ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' - ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' - ,PCLZIP_ATT_FILE_MTIME => 'optional' - ,PCLZIP_ATT_FILE_CONTENT => 'optional' - ,PCLZIP_ATT_FILE_COMMENT => 'optional' - ); - foreach ($v_att_list as $v_entry) { - $v_result = $this->privFileDescrParseAtt($v_entry, - $v_filedescr_list[], - $v_options, - $v_supported_attributes); - if ($v_result != 1) { - return 0; - } - } - - // ----- Expand the filelist (expand directories) - $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Call the create fct - $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Return - return $p_result_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // add($p_filelist, $p_add_dir="", $p_remove_dir="") - // add($p_filelist, $p_option, $p_option_value, ...) - // Description : - // This method supports two synopsis. The first one is historical. - // This methods add the list of files in an existing archive. - // If a file with the same name already exists, it is added at the end of the - // archive, the first one is still present. - // If the archive does not exist, it is created. - // Parameters : - // $p_filelist : An array containing file or directory names, or - // a string containing one filename or one directory name, or - // a string containing a list of filenames and/or directory - // names separated by spaces. - // $p_add_dir : A path to add before the real path of the archived file, - // in order to have it memorized in the archive. - // $p_remove_dir : A path to remove from the real path of the file to archive, - // in order to have a shorter path memorized in the archive. - // When $p_add_dir and $p_remove_dir are set, $p_remove_dir - // is removed first, before $p_add_dir is added. - // Options : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_COMMENT : - // PCLZIP_OPT_ADD_COMMENT : - // PCLZIP_OPT_PREPEND_COMMENT : - // PCLZIP_CB_PRE_ADD : - // PCLZIP_CB_POST_ADD : - // Return Values : - // 0 on failure, - // The list of the added files, with a status of the add action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function add($p_filelist) - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Set default values - $v_options = array(); - $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove form the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_ADD => 'optional', - PCLZIP_CB_POST_ADD => 'optional', - PCLZIP_OPT_NO_COMPRESSION => 'optional', - PCLZIP_OPT_COMMENT => 'optional', - PCLZIP_OPT_ADD_COMMENT => 'optional', - PCLZIP_OPT_PREPEND_COMMENT => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - //, PCLZIP_OPT_CRYPT => 'optional' - )); - if ($v_result != 1) { - return 0; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - return 0; - } - } - } - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Init - $v_string_list = array(); - $v_att_list = array(); - $v_filedescr_list = array(); - $p_result_list = array(); - - // ----- Look if the $p_filelist is really an array - if (is_array($p_filelist)) { - - // ----- Look if the first element is also an array - // This will mean that this is a file description entry - if (isset($p_filelist[0]) && is_array($p_filelist[0])) { - $v_att_list = $p_filelist; - } - - // ----- The list is a list of string names - else { - $v_string_list = $p_filelist; - } - } - - // ----- Look if the $p_filelist is a string - else if (is_string($p_filelist)) { - // ----- Create a list from the string - $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); - } - - // ----- Invalid variable type for $p_filelist - else { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist"); - return 0; - } - - // ----- Reformat the string list - if (sizeof($v_string_list) != 0) { - foreach ($v_string_list as $v_string) { - $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; - } - } - - // ----- For each file in the list check the attributes - $v_supported_attributes - = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' - ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' - ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' - ,PCLZIP_ATT_FILE_MTIME => 'optional' - ,PCLZIP_ATT_FILE_CONTENT => 'optional' - ,PCLZIP_ATT_FILE_COMMENT => 'optional' - ); - foreach ($v_att_list as $v_entry) { - $v_result = $this->privFileDescrParseAtt($v_entry, - $v_filedescr_list[], - $v_options, - $v_supported_attributes); - if ($v_result != 1) { - return 0; - } - } - - // ----- Expand the filelist (expand directories) - $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Call the create fct - $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Return - return $p_result_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : listContent() - // Description : - // This public method, gives the list of the files and directories, with their - // properties. - // The properties of each entries in the list are (used also in other functions) : - // filename : Name of the file. For a create or add action it is the filename - // given by the user. For an extract function it is the filename - // of the extracted file. - // stored_filename : Name of the file / directory stored in the archive. - // size : Size of the stored file. - // compressed_size : Size of the file's data compressed in the archive - // (without the headers overhead) - // mtime : Last known modification date of the file (UNIX timestamp) - // comment : Comment associated with the file - // folder : true | false - // index : index of the file in the archive - // status : status of the action (depending of the action) : - // Values are : - // ok : OK ! - // filtered : the file / dir is not extracted (filtered by user) - // already_a_directory : the file can not be extracted because a - // directory with the same name already exists - // write_protected : the file can not be extracted because a file - // with the same name already exists and is - // write protected - // newer_exist : the file was not extracted because a newer file exists - // path_creation_fail : the file is not extracted because the folder - // does not exist and can not be created - // write_error : the file was not extracted because there was a - // error while writing the file - // read_error : the file was not extracted because there was a error - // while reading the file - // invalid_header : the file was not extracted because of an archive - // format error (bad file header) - // Note that each time a method can continue operating when there - // is an action error on a file, the error is only logged in the file status. - // Return Values : - // 0 on an unrecoverable failure, - // The list of the files in the archive. - // -------------------------------------------------------------------------------- - function listContent() - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Call the extracting fct - $p_list = array(); - if (($v_result = $this->privList($p_list)) != 1) - { - unset($p_list); - return(0); - } - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // extract($p_path="./", $p_remove_path="") - // extract([$p_option, $p_option_value, ...]) - // Description : - // This method supports two synopsis. The first one is historical. - // This method extract all the files / directories from the archive to the - // folder indicated in $p_path. - // If you want to ignore the 'root' part of path of the memorized files - // you can indicate this in the optional $p_remove_path parameter. - // By default, if a newer file with the same name already exists, the - // file is not extracted. - // - // If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions - // are used, the path indicated in PCLZIP_OPT_ADD_PATH is append - // at the end of the path value of PCLZIP_OPT_PATH. - // Parameters : - // $p_path : Path where the files and directories are to be extracted - // $p_remove_path : First part ('root' part) of the memorized path - // (if any similar) to remove while extracting. - // Options : - // PCLZIP_OPT_PATH : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_CB_PRE_EXTRACT : - // PCLZIP_CB_POST_EXTRACT : - // Return Values : - // 0 or a negative value on failure, - // The list of the extracted files, with a status of the action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function extract() - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Set default values - $v_options = array(); -// $v_path = "./"; - $v_path = ''; - $v_remove_path = ""; - $v_remove_all_path = false; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Default values for option - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - - // ----- Look for arguments - if ($v_size > 0) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_PATH => 'optional', - PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_EXTRACT => 'optional', - PCLZIP_CB_POST_EXTRACT => 'optional', - PCLZIP_OPT_SET_CHMOD => 'optional', - PCLZIP_OPT_BY_NAME => 'optional', - PCLZIP_OPT_BY_EREG => 'optional', - PCLZIP_OPT_BY_PREG => 'optional', - PCLZIP_OPT_BY_INDEX => 'optional', - PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', - PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional', - PCLZIP_OPT_REPLACE_NEWER => 'optional' - ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' - ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - )); - if ($v_result != 1) { - return 0; - } - - // ----- Set the arguments - if (isset($v_options[PCLZIP_OPT_PATH])) { - $v_path = $v_options[PCLZIP_OPT_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { - $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { - // ----- Check for '/' in last path char - if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { - $v_path .= '/'; - } - $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_remove_path = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - return 0; - } - } - } - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Trace - - // ----- Call the extracting fct - $p_list = array(); - $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, - $v_remove_all_path, $v_options); - if ($v_result < 1) { - unset($p_list); - return(0); - } - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - - // -------------------------------------------------------------------------------- - // Function : - // extractByIndex($p_index, $p_path="./", $p_remove_path="") - // extractByIndex($p_index, [$p_option, $p_option_value, ...]) - // Description : - // This method supports two synopsis. The first one is historical. - // This method is doing a partial extract of the archive. - // The extracted files or folders are identified by their index in the - // archive (from 0 to n). - // Note that if the index identify a folder, only the folder entry is - // extracted, not all the files included in the archive. - // Parameters : - // $p_index : A single index (integer) or a string of indexes of files to - // extract. The form of the string is "0,4-6,8-12" with only numbers - // and '-' for range or ',' to separate ranges. No spaces or ';' - // are allowed. - // $p_path : Path where the files and directories are to be extracted - // $p_remove_path : First part ('root' part) of the memorized path - // (if any similar) to remove while extracting. - // Options : - // PCLZIP_OPT_PATH : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and - // not as files. - // The resulting content is in a new field 'content' in the file - // structure. - // This option must be used alone (any other options are ignored). - // PCLZIP_CB_PRE_EXTRACT : - // PCLZIP_CB_POST_EXTRACT : - // Return Values : - // 0 on failure, - // The list of the extracted files, with a status of the action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - //function extractByIndex($p_index, options...) - function extractByIndex($p_index) - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Set default values - $v_options = array(); -// $v_path = "./"; - $v_path = ''; - $v_remove_path = ""; - $v_remove_all_path = false; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Default values for option - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove form the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_PATH => 'optional', - PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_EXTRACT => 'optional', - PCLZIP_CB_POST_EXTRACT => 'optional', - PCLZIP_OPT_SET_CHMOD => 'optional', - PCLZIP_OPT_REPLACE_NEWER => 'optional' - ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' - ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - )); - if ($v_result != 1) { - return 0; - } - - // ----- Set the arguments - if (isset($v_options[PCLZIP_OPT_PATH])) { - $v_path = $v_options[PCLZIP_OPT_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { - $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { - // ----- Check for '/' in last path char - if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { - $v_path .= '/'; - } - $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; - } - if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) { - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - } - else { - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_remove_path = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - return 0; - } - } - } - - // ----- Trace - - // ----- Trick - // Here I want to reuse extractByRule(), so I need to parse the $p_index - // with privParseOptions() - $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index); - $v_options_trick = array(); - $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick, - array (PCLZIP_OPT_BY_INDEX => 'optional' )); - if ($v_result != 1) { - return 0; - } - $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX]; - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Call the extracting fct - if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) { - return(0); - } - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // delete([$p_option, $p_option_value, ...]) - // Description : - // This method removes files from the archive. - // If no parameters are given, then all the archive is emptied. - // Parameters : - // None or optional arguments. - // Options : - // PCLZIP_OPT_BY_INDEX : - // PCLZIP_OPT_BY_NAME : - // PCLZIP_OPT_BY_EREG : - // PCLZIP_OPT_BY_PREG : - // Return Values : - // 0 on failure, - // The list of the files which are still present in the archive. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function delete() - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Set default values - $v_options = array(); - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Look for arguments - if ($v_size > 0) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_BY_NAME => 'optional', - PCLZIP_OPT_BY_EREG => 'optional', - PCLZIP_OPT_BY_PREG => 'optional', - PCLZIP_OPT_BY_INDEX => 'optional' )); - if ($v_result != 1) { - return 0; - } - } - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Call the delete fct - $v_list = array(); - if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) { - $this->privSwapBackMagicQuotes(); - unset($v_list); - return(0); - } - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : deleteByIndex() - // Description : - // ***** Deprecated ***** - // delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered. - // -------------------------------------------------------------------------------- - function deleteByIndex($p_index) - { - - $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index); - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : properties() - // Description : - // This method gives the properties of the archive. - // The properties are : - // nb : Number of files in the archive - // comment : Comment associated with the archive file - // status : not_exist, ok - // Parameters : - // None - // Return Values : - // 0 on failure, - // An array with the archive properties. - // -------------------------------------------------------------------------------- - function properties() - { - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - $this->privSwapBackMagicQuotes(); - return(0); - } - - // ----- Default properties - $v_prop = array(); - $v_prop['comment'] = ''; - $v_prop['nb'] = 0; - $v_prop['status'] = 'not_exist'; - - // ----- Look if file exists - if (@is_file($this->zipname)) - { - // ----- Open the zip file - if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) - { - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); - - // ----- Return - return 0; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privSwapBackMagicQuotes(); - return 0; - } - - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Set the user attributes - $v_prop['comment'] = $v_central_dir['comment']; - $v_prop['nb'] = $v_central_dir['entries']; - $v_prop['status'] = 'ok'; - } - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_prop; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : duplicate() - // Description : - // This method creates an archive by copying the content of an other one. If - // the archive already exist, it is replaced by the new one without any warning. - // Parameters : - // $p_archive : The filename of a valid archive, or - // a valid PclZip object. - // Return Values : - // 1 on success. - // 0 or a negative value on error (error code). - // -------------------------------------------------------------------------------- - function duplicate($p_archive) - { - $v_result = 1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Look if the $p_archive is a PclZip object - if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) - { - - // ----- Duplicate the archive - $v_result = $this->privDuplicate($p_archive->zipname); - } - - // ----- Look if the $p_archive is a string (so a filename) - else if (is_string($p_archive)) - { - - // ----- Check that $p_archive is a valid zip file - // TBC : Should also check the archive format - if (!is_file($p_archive)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'"); - $v_result = PCLZIP_ERR_MISSING_FILE; - } - else { - // ----- Duplicate the archive - $v_result = $this->privDuplicate($p_archive); - } - } - - // ----- Invalid variable - else - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); - $v_result = PCLZIP_ERR_INVALID_PARAMETER; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : merge() - // Description : - // This method merge the $p_archive_to_add archive at the end of the current - // one ($this). - // If the archive ($this) does not exist, the merge becomes a duplicate. - // If the $p_archive_to_add archive does not exist, the merge is a success. - // Parameters : - // $p_archive_to_add : It can be directly the filename of a valid zip archive, - // or a PclZip object archive. - // Return Values : - // 1 on success, - // 0 or negative values on error (see below). - // -------------------------------------------------------------------------------- - function merge($p_archive_to_add) - { - $v_result = 1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Look if the $p_archive_to_add is a PclZip object - if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) - { - - // ----- Merge the archive - $v_result = $this->privMerge($p_archive_to_add); - } - - // ----- Look if the $p_archive_to_add is a string (so a filename) - else if (is_string($p_archive_to_add)) - { - - // ----- Create a temporary archive - $v_object_archive = new PclZip($p_archive_to_add); - - // ----- Merge the archive - $v_result = $this->privMerge($v_object_archive); - } - - // ----- Invalid variable - else - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); - $v_result = PCLZIP_ERR_INVALID_PARAMETER; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - - - // -------------------------------------------------------------------------------- - // Function : errorCode() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorCode() - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - return(PclErrorCode()); - } - else { - return($this->error_code); - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : errorName() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorName($p_with_code=false) - { - $v_name = array ( PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR', - PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL', - PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL', - PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER', - PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE', - PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG', - PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP', - PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE', - PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL', - PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION', - PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT', - PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL', - PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL', - PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM', - PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', - PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE', - PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE', - PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', - PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION' - ,PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE' - ,PCLZIP_ERR_DIRECTORY_RESTRICTION => 'PCLZIP_ERR_DIRECTORY_RESTRICTION' - ); - - if (isset($v_name[$this->error_code])) { - $v_value = $v_name[$this->error_code]; - } - else { - $v_value = 'NoName'; - } - - if ($p_with_code) { - return($v_value.' ('.$this->error_code.')'); - } - else { - return($v_value); - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : errorInfo() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorInfo($p_full=false) - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - return(PclErrorString()); - } - else { - if ($p_full) { - return($this->errorName(true)." : ".$this->error_string); - } - else { - return($this->error_string." [code ".$this->error_code."]"); - } - } - } - // -------------------------------------------------------------------------------- - - -// -------------------------------------------------------------------------------- -// ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS ***** -// ***** ***** -// ***** THESES FUNCTIONS MUST NOT BE USED DIRECTLY ***** -// -------------------------------------------------------------------------------- - - - - // -------------------------------------------------------------------------------- - // Function : privCheckFormat() - // Description : - // This method check that the archive exists and is a valid zip archive. - // Several level of check exists. (futur) - // Parameters : - // $p_level : Level of check. Default 0. - // 0 : Check the first bytes (magic codes) (default value)) - // 1 : 0 + Check the central directory (futur) - // 2 : 1 + Check each file header (futur) - // Return Values : - // true on success, - // false on error, the error code is set. - // -------------------------------------------------------------------------------- - function privCheckFormat($p_level=0) - { - $v_result = true; - - // ----- Reset the file system cache - clearstatcache(); - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Look if the file exits - if (!is_file($this->zipname)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'"); - return(false); - } - - // ----- Check that the file is readeable - if (!is_readable($this->zipname)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'"); - return(false); - } - - // ----- Check the magic code - // TBC - - // ----- Check the central header - // TBC - - // ----- Check each file header - // TBC - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privParseOptions() - // Description : - // This internal methods reads the variable list of arguments ($p_options_list, - // $p_size) and generate an array with the options and values ($v_result_list). - // $v_requested_options contains the options that can be present and those that - // must be present. - // $v_requested_options is an array, with the option value as key, and 'optional', - // or 'mandatory' as value. - // Parameters : - // See above. - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false) - { - $v_result=1; - - // ----- Read the options - $i=0; - while ($i<$p_size) { - - // ----- Check if the option is supported - if (!isset($v_requested_options[$p_options_list[$i]])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for next option - switch ($p_options_list[$i]) { - // ----- Look for options that request a path value - case PCLZIP_OPT_PATH : - case PCLZIP_OPT_REMOVE_PATH : - case PCLZIP_OPT_ADD_PATH : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE); - $i++; - break; - - case PCLZIP_OPT_TEMP_FILE_THRESHOLD : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - return PclZip::errorCode(); - } - - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'"); - return PclZip::errorCode(); - } - - // ----- Check the value - $v_value = $p_options_list[$i+1]; - if ((!is_integer($v_value)) || ($v_value<0)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Integer expected for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - return PclZip::errorCode(); - } - - // ----- Get the value (and convert it in bytes) - $v_result_list[$p_options_list[$i]] = $v_value*1048576; - $i++; - break; - - case PCLZIP_OPT_TEMP_FILE_ON : - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'"); - return PclZip::errorCode(); - } - - $v_result_list[$p_options_list[$i]] = true; - break; - - case PCLZIP_OPT_TEMP_FILE_OFF : - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_ON])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_ON'"); - return PclZip::errorCode(); - } - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_THRESHOLD'"); - return PclZip::errorCode(); - } - - $v_result_list[$p_options_list[$i]] = true; - break; - - case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if ( is_string($p_options_list[$i+1]) - && ($p_options_list[$i+1] != '')) { - $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE); - $i++; - } - else { - } - break; - - // ----- Look for options that request an array of string for value - case PCLZIP_OPT_BY_NAME : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1]; - } - else if (is_array($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - $i++; - break; - - // ----- Look for options that request an EREG or PREG expression - case PCLZIP_OPT_BY_EREG : - // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG - // to PCLZIP_OPT_BY_PREG - $p_options_list[$i] = PCLZIP_OPT_BY_PREG; - case PCLZIP_OPT_BY_PREG : - //case PCLZIP_OPT_CRYPT : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - $i++; - break; - - // ----- Look for options that takes a string - case PCLZIP_OPT_COMMENT : - case PCLZIP_OPT_ADD_COMMENT : - case PCLZIP_OPT_PREPEND_COMMENT : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, - "Missing parameter value for option '" - .PclZipUtilOptionText($p_options_list[$i]) - ."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, - "Wrong parameter value for option '" - .PclZipUtilOptionText($p_options_list[$i]) - ."'"); - - // ----- Return - return PclZip::errorCode(); - } - $i++; - break; - - // ----- Look for options that request an array of index - case PCLZIP_OPT_BY_INDEX : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_work_list = array(); - if (is_string($p_options_list[$i+1])) { - - // ----- Remove spaces - $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', ''); - - // ----- Parse items - $v_work_list = explode(",", $p_options_list[$i+1]); - } - else if (is_integer($p_options_list[$i+1])) { - $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1]; - } - else if (is_array($p_options_list[$i+1])) { - $v_work_list = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Reduce the index list - // each index item in the list must be a couple with a start and - // an end value : [0,3], [5-5], [8-10], ... - // ----- Check the format of each item - $v_sort_flag=false; - $v_sort_value=0; - for ($j=0; $j= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - $i++; - break; - - // ----- Look for options that request a call-back - case PCLZIP_CB_PRE_EXTRACT : - case PCLZIP_CB_POST_EXTRACT : - case PCLZIP_CB_PRE_ADD : - case PCLZIP_CB_POST_ADD : - /* for futur use - case PCLZIP_CB_PRE_DELETE : - case PCLZIP_CB_POST_DELETE : - case PCLZIP_CB_PRE_LIST : - case PCLZIP_CB_POST_LIST : - */ - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_function_name = $p_options_list[$i+1]; - - // ----- Check that the value is a valid existing function - if (!function_exists($v_function_name)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Set the attribute - $v_result_list[$p_options_list[$i]] = $v_function_name; - $i++; - break; - - default : - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Unknown parameter '" - .$p_options_list[$i]."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Next options - $i++; - } - - // ----- Look for mandatory options - if ($v_requested_options !== false) { - for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { - // ----- Look for mandatory option - if ($v_requested_options[$key] == 'mandatory') { - // ----- Look if present - if (!isset($v_result_list[$key])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); - - // ----- Return - return PclZip::errorCode(); - } - } - } - } - - // ----- Look for default values - if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { - - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privOptionDefaultThreshold() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privOptionDefaultThreshold(&$p_options) - { - $v_result=1; - - if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) - || isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) { - return $v_result; - } - - // ----- Get 'memory_limit' configuration value - $v_memory_limit = ini_get('memory_limit'); - $v_memory_limit = trim($v_memory_limit); - $last = strtolower(substr($v_memory_limit, -1)); - - if($last == 'g') - //$v_memory_limit = $v_memory_limit*1024*1024*1024; - $v_memory_limit = $v_memory_limit*1073741824; - if($last == 'm') - //$v_memory_limit = $v_memory_limit*1024*1024; - $v_memory_limit = $v_memory_limit*1048576; - if($last == 'k') - $v_memory_limit = $v_memory_limit*1024; - - $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit*PCLZIP_TEMPORARY_FILE_RATIO); - - - // ----- Sanity check : No threshold if value lower than 1M - if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) { - unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privFileDescrParseAtt() - // Description : - // Parameters : - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options=false) - { - $v_result=1; - - // ----- For each file in the list check the attributes - foreach ($p_file_list as $v_key => $v_value) { - - // ----- Check if the option is supported - if (!isset($v_requested_options[$v_key])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file attribute '".$v_key."' for this file"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for attribute - switch ($v_key) { - case PCLZIP_ATT_FILE_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['filename'] = PclZipUtilPathReduction($v_value); - - if ($p_filedescr['filename'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - break; - - case PCLZIP_ATT_FILE_NEW_SHORT_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value); - - if ($p_filedescr['new_short_name'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - break; - - case PCLZIP_ATT_FILE_NEW_FULL_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value); - - if ($p_filedescr['new_full_name'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - break; - - // ----- Look for options that takes a string - case PCLZIP_ATT_FILE_COMMENT : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['comment'] = $v_value; - break; - - case PCLZIP_ATT_FILE_MTIME : - if (!is_integer($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". Integer expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['mtime'] = $v_value; - break; - - case PCLZIP_ATT_FILE_CONTENT : - $p_filedescr['content'] = $v_value; - break; - - default : - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Unknown parameter '".$v_key."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for mandatory options - if ($v_requested_options !== false) { - for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { - // ----- Look for mandatory option - if ($v_requested_options[$key] == 'mandatory') { - // ----- Look if present - if (!isset($p_file_list[$key])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); - return PclZip::errorCode(); - } - } - } - } - - // end foreach - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privFileDescrExpand() - // Description : - // This method look for each item of the list to see if its a file, a folder - // or a string to be added as file. For any other type of files (link, other) - // just ignore the item. - // Then prepare the information that will be stored for that file. - // When its a folder, expand the folder with all the files that are in that - // folder (recursively). - // Parameters : - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privFileDescrExpand(&$p_filedescr_list, &$p_options) - { - $v_result=1; - - // ----- Create a result list - $v_result_list = array(); - - // ----- Look each entry - for ($i=0; $iprivCalculateStoredFilename($v_descr, $p_options); - - // ----- Add the descriptor in result list - $v_result_list[sizeof($v_result_list)] = $v_descr; - - // ----- Look for folder - if ($v_descr['type'] == 'folder') { - // ----- List of items in folder - $v_dirlist_descr = array(); - $v_dirlist_nb = 0; - if ($v_folder_handler = @opendir($v_descr['filename'])) { - while (($v_item_handler = @readdir($v_folder_handler)) !== false) { - - // ----- Skip '.' and '..' - if (($v_item_handler == '.') || ($v_item_handler == '..')) { - continue; - } - - // ----- Compose the full filename - $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler; - - // ----- Look for different stored filename - // Because the name of the folder was changed, the name of the - // files/sub-folders also change - if (($v_descr['stored_filename'] != $v_descr['filename']) - && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) { - if ($v_descr['stored_filename'] != '') { - $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler; - } - else { - $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler; - } - } - - $v_dirlist_nb++; - } - - @closedir($v_folder_handler); - } - else { - // TBC : unable to open folder in read mode - } - - // ----- Expand each element of the list - if ($v_dirlist_nb != 0) { - // ----- Expand - if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) { - return $v_result; - } - - // ----- Concat the resulting list - $v_result_list = array_merge($v_result_list, $v_dirlist_descr); - } - else { - } - - // ----- Free local array - unset($v_dirlist_descr); - } - } - - // ----- Get the result list - $p_filedescr_list = $v_result_list; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCreate() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privCreate($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - $v_list_detail = array(); - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the file in write mode - if (($v_result = $this->privOpenFd('wb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Add the list of files - $v_result = $this->privAddList($p_filedescr_list, $p_result_list, $p_options); - - // ----- Close - $this->privCloseFd(); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAdd() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privAdd($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - $v_list_detail = array(); - - // ----- Look if the archive exists or is empty - if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0)) - { - - // ----- Do a create - $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options); - - // ----- Return - return $v_result; - } - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Go to beginning of File - @rewind($this->zip_fd); - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Open the temporary file in write mode - if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) - { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = $v_central_dir['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Swap the file descriptor - // Here is a trick : I swap the temporary fd with the zip fd, in order to use - // the following methods on the temporary fil and not the real archive - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Add the files - $v_header_list = array(); - if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) - { - fclose($v_zip_temp_fd); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($this->zip_fd); - - // ----- Copy the block of file headers from the old archive - $v_size = $v_central_dir['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($v_zip_temp_fd, $v_read_size); - @fwrite($this->zip_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Create the Central Dir files header - for ($i=0, $v_count=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { - fclose($v_zip_temp_fd); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - $v_count++; - } - - // ----- Transform the header to a 'usable' info - $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - // ----- Zip file comment - $v_comment = $v_central_dir['comment']; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) { - $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT]; - } - if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($this->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1) - { - // ----- Reset the file list - unset($v_header_list); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - - // ----- Swap back the file descriptor - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Close - $this->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privOpenFd() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privOpenFd($p_mode) - { - $v_result=1; - - // ----- Look if already open - if ($this->zip_fd != 0) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Open the zip file - if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCloseFd() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privCloseFd() - { - $v_result=1; - - if ($this->zip_fd != 0) - @fclose($this->zip_fd); - $this->zip_fd = 0; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddList() - // Description : - // $p_add_dir and $p_remove_dir will give the ability to memorize a path which is - // different from the real path of the file. This is usefull if you want to have PclTar - // running in any directory, and memorize relative path from an other directory. - // Parameters : - // $p_list : An array containing the file or directory names to add in the tar - // $p_result_list : list of added files with their properties (specially the status field) - // $p_add_dir : Path to add in the filename path archived - // $p_remove_dir : Path to remove in the filename path archived - // Return Values : - // -------------------------------------------------------------------------------- -// function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options) - function privAddList($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - - // ----- Add the files - $v_header_list = array(); - if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($this->zip_fd); - - // ----- Create the Central Dir files header - for ($i=0,$v_count=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { - // ----- Return - return $v_result; - } - $v_count++; - } - - // ----- Transform the header to a 'usable' info - $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - // ----- Zip file comment - $v_comment = ''; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($this->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1) - { - // ----- Reset the file list - unset($v_header_list); - - // ----- Return - return $v_result; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddFileList() - // Description : - // Parameters : - // $p_filedescr_list : An array containing the file description - // or directory names to add in the zip - // $p_result_list : list of added files with their properties (specially the status field) - // Return Values : - // -------------------------------------------------------------------------------- - function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - $v_header = array(); - - // ----- Recuperate the current number of elt in list - $v_nb = sizeof($p_result_list); - - // ----- Loop on the files - for ($j=0; ($jprivAddFile($p_filedescr_list[$j], $v_header, - $p_options); - if ($v_result != 1) { - return $v_result; - } - - // ----- Store the file infos - $p_result_list[$v_nb++] = $v_header; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddFile() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privAddFile($p_filedescr, &$p_header, &$p_options) - { - $v_result=1; - - // ----- Working variable - $p_filename = $p_filedescr['filename']; - - // TBC : Already done in the fileAtt check ... ? - if ($p_filename == "") { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for a stored different filename - /* TBC : Removed - if (isset($p_filedescr['stored_filename'])) { - $v_stored_filename = $p_filedescr['stored_filename']; - } - else { - $v_stored_filename = $p_filedescr['stored_filename']; - } - */ - - // ----- Set the file properties - clearstatcache(); - $p_header['version'] = 20; - $p_header['version_extracted'] = 10; - $p_header['flag'] = 0; - $p_header['compression'] = 0; - $p_header['crc'] = 0; - $p_header['compressed_size'] = 0; - $p_header['filename_len'] = strlen($p_filename); - $p_header['extra_len'] = 0; - $p_header['disk'] = 0; - $p_header['internal'] = 0; - $p_header['offset'] = 0; - $p_header['filename'] = $p_filename; -// TBC : Removed $p_header['stored_filename'] = $v_stored_filename; - $p_header['stored_filename'] = $p_filedescr['stored_filename']; - $p_header['extra'] = ''; - $p_header['status'] = 'ok'; - $p_header['index'] = -1; - - // ----- Look for regular file - if ($p_filedescr['type']=='file') { - $p_header['external'] = 0x00000000; - $p_header['size'] = filesize($p_filename); - } - - // ----- Look for regular folder - else if ($p_filedescr['type']=='folder') { - $p_header['external'] = 0x00000010; - $p_header['mtime'] = filemtime($p_filename); - $p_header['size'] = filesize($p_filename); - } - - // ----- Look for virtual file - else if ($p_filedescr['type'] == 'virtual_file') { - $p_header['external'] = 0x00000000; - $p_header['size'] = strlen($p_filedescr['content']); - } - - - // ----- Look for filetime - if (isset($p_filedescr['mtime'])) { - $p_header['mtime'] = $p_filedescr['mtime']; - } - else if ($p_filedescr['type'] == 'virtual_file') { - $p_header['mtime'] = time(); - } - else { - $p_header['mtime'] = filemtime($p_filename); - } - - // ------ Look for file comment - if (isset($p_filedescr['comment'])) { - $p_header['comment_len'] = strlen($p_filedescr['comment']); - $p_header['comment'] = $p_filedescr['comment']; - } - else { - $p_header['comment_len'] = 0; - $p_header['comment'] = ''; - } - - // ----- Look for pre-add callback - if (isset($p_options[PCLZIP_CB_PRE_ADD])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_header, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_ADD](PCLZIP_CB_PRE_ADD, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_header['status'] = "skipped"; - $v_result = 1; - } - - // ----- Update the informations - // Only some fields can be modified - if ($p_header['stored_filename'] != $v_local_header['stored_filename']) { - $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']); - } - } - - // ----- Look for empty stored filename - if ($p_header['stored_filename'] == "") { - $p_header['status'] = "filtered"; - } - - // ----- Check the path length - if (strlen($p_header['stored_filename']) > 0xFF) { - $p_header['status'] = 'filename_too_long'; - } - - // ----- Look if no error, or file not skipped - if ($p_header['status'] == 'ok') { - - // ----- Look for a file - if ($p_filedescr['type'] == 'file') { - // ----- Look for using temporary file to zip - if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) - && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) - || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) - && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])) ) ) { - $v_result = $this->privAddFileUsingTempFile($p_filedescr, $p_header, $p_options); - if ($v_result < PCLZIP_ERR_NO_ERROR) { - return $v_result; - } - } - - // ----- Use "in memory" zip algo - else { - - // ----- Open the source file - if (($v_file = @fopen($p_filename, "rb")) == 0) { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); - return PclZip::errorCode(); - } - - // ----- Read the file content - $v_content = @fread($v_file, $p_header['size']); - - // ----- Close the file - @fclose($v_file); - - // ----- Calculate the CRC - $p_header['crc'] = @crc32($v_content); - - // ----- Look for no compression - if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { - // ----- Set header parameters - $p_header['compressed_size'] = $p_header['size']; - $p_header['compression'] = 0; - } - - // ----- Look for normal compression - else { - // ----- Compress the content - $v_content = @gzdeflate($v_content); - - // ----- Set header parameters - $p_header['compressed_size'] = strlen($v_content); - $p_header['compression'] = 8; - } - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - @fclose($v_file); - return $v_result; - } - - // ----- Write the compressed (or not) content - @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']); - - } - - } - - // ----- Look for a virtual file (a file from string) - else if ($p_filedescr['type'] == 'virtual_file') { - - $v_content = $p_filedescr['content']; - - // ----- Calculate the CRC - $p_header['crc'] = @crc32($v_content); - - // ----- Look for no compression - if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { - // ----- Set header parameters - $p_header['compressed_size'] = $p_header['size']; - $p_header['compression'] = 0; - } - - // ----- Look for normal compression - else { - // ----- Compress the content - $v_content = @gzdeflate($v_content); - - // ----- Set header parameters - $p_header['compressed_size'] = strlen($v_content); - $p_header['compression'] = 8; - } - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - @fclose($v_file); - return $v_result; - } - - // ----- Write the compressed (or not) content - @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']); - } - - // ----- Look for a directory - else if ($p_filedescr['type'] == 'folder') { - // ----- Look for directory last '/' - if (@substr($p_header['stored_filename'], -1) != '/') { - $p_header['stored_filename'] .= '/'; - } - - // ----- Set the file properties - $p_header['size'] = 0; - //$p_header['external'] = 0x41FF0010; // Value for a folder : to be checked - $p_header['external'] = 0x00000010; // Value for a folder : to be checked - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) - { - return $v_result; - } - } - } - - // ----- Look for post-add callback - if (isset($p_options[PCLZIP_CB_POST_ADD])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_header, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_ADD](PCLZIP_CB_POST_ADD, $v_local_header); - if ($v_result == 0) { - // ----- Ignored - $v_result = 1; - } - - // ----- Update the informations - // Nothing can be modified - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddFileUsingTempFile() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options) - { - $v_result=PCLZIP_ERR_NO_ERROR; - - // ----- Working variable - $p_filename = $p_filedescr['filename']; - - - // ----- Open the source file - if (($v_file = @fopen($p_filename, "rb")) == 0) { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); - return PclZip::errorCode(); - } - - // ----- Creates a compressed temporary file - $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz'; - if (($v_file_compressed = @gzopen($v_gzip_temp_name, "wb")) == 0) { - fclose($v_file); - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); - return PclZip::errorCode(); - } - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = filesize($p_filename); - while ($v_size != 0) { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($v_file, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @gzputs($v_file_compressed, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Close the file - @fclose($v_file); - @gzclose($v_file_compressed); - - // ----- Check the minimum file size - if (filesize($v_gzip_temp_name) < 18) { - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'gzip temporary file \''.$v_gzip_temp_name.'\' has invalid filesize - should be minimum 18 bytes'); - return PclZip::errorCode(); - } - - // ----- Extract the compressed attributes - if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - return PclZip::errorCode(); - } - - // ----- Read the gzip file header - $v_binary_data = @fread($v_file_compressed, 10); - $v_data_header = unpack('a1id1/a1id2/a1cm/a1flag/Vmtime/a1xfl/a1os', $v_binary_data); - - // ----- Check some parameters - $v_data_header['os'] = bin2hex($v_data_header['os']); - - // ----- Read the gzip file footer - @fseek($v_file_compressed, filesize($v_gzip_temp_name)-8); - $v_binary_data = @fread($v_file_compressed, 8); - $v_data_footer = unpack('Vcrc/Vcompressed_size', $v_binary_data); - - // ----- Set the attributes - $p_header['compression'] = ord($v_data_header['cm']); - //$p_header['mtime'] = $v_data_header['mtime']; - $p_header['crc'] = $v_data_footer['crc']; - $p_header['compressed_size'] = filesize($v_gzip_temp_name)-18; - - // ----- Close the file - @fclose($v_file_compressed); - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - return $v_result; - } - - // ----- Add the compressed data - if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) - { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - return PclZip::errorCode(); - } - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - fseek($v_file_compressed, 10); - $v_size = $p_header['compressed_size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($v_file_compressed, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($this->zip_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Close the file - @fclose($v_file_compressed); - - // ----- Unlink the temporary file - @unlink($v_gzip_temp_name); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCalculateStoredFilename() - // Description : - // Based on file descriptor properties and global options, this method - // calculate the filename that will be stored in the archive. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privCalculateStoredFilename(&$p_filedescr, &$p_options) - { - $v_result=1; - - // ----- Working variables - $p_filename = $p_filedescr['filename']; - if (isset($p_options[PCLZIP_OPT_ADD_PATH])) { - $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH]; - } - else { - $p_add_dir = ''; - } - if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) { - $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH]; - } - else { - $p_remove_dir = ''; - } - if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - else { - $p_remove_all_dir = 0; - } - - - // ----- Look for full name change - if (isset($p_filedescr['new_full_name'])) { - // ----- Remove drive letter if any - $v_stored_filename = PclZipUtilTranslateWinPath($p_filedescr['new_full_name']); - } - - // ----- Look for path and/or short name change - else { - - // ----- Look for short name change - // Its when we cahnge just the filename but not the path - if (isset($p_filedescr['new_short_name'])) { - $v_path_info = pathinfo($p_filename); - $v_dir = ''; - if ($v_path_info['dirname'] != '') { - $v_dir = $v_path_info['dirname'].'/'; - } - $v_stored_filename = $v_dir.$p_filedescr['new_short_name']; - } - else { - // ----- Calculate the stored filename - $v_stored_filename = $p_filename; - } - - // ----- Look for all path to remove - if ($p_remove_all_dir) { - $v_stored_filename = basename($p_filename); - } - // ----- Look for partial path remove - else if ($p_remove_dir != "") { - if (substr($p_remove_dir, -1) != '/') - $p_remove_dir .= "/"; - - if ( (substr($p_filename, 0, 2) == "./") - || (substr($p_remove_dir, 0, 2) == "./")) { - - if ( (substr($p_filename, 0, 2) == "./") - && (substr($p_remove_dir, 0, 2) != "./")) { - $p_remove_dir = "./".$p_remove_dir; - } - if ( (substr($p_filename, 0, 2) != "./") - && (substr($p_remove_dir, 0, 2) == "./")) { - $p_remove_dir = substr($p_remove_dir, 2); - } - } - - $v_compare = PclZipUtilPathInclusion($p_remove_dir, - $v_stored_filename); - if ($v_compare > 0) { - if ($v_compare == 2) { - $v_stored_filename = ""; - } - else { - $v_stored_filename = substr($v_stored_filename, - strlen($p_remove_dir)); - } - } - } - - // ----- Remove drive letter if any - $v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename); - - // ----- Look for path to add - if ($p_add_dir != "") { - if (substr($p_add_dir, -1) == "/") - $v_stored_filename = $p_add_dir.$v_stored_filename; - else - $v_stored_filename = $p_add_dir."/".$v_stored_filename; - } - } - - // ----- Filename (reduce the path of stored name) - $v_stored_filename = PclZipUtilPathReduction($v_stored_filename); - $p_filedescr['stored_filename'] = $v_stored_filename; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteFileHeader(&$p_header) - { - $v_result=1; - - // ----- Store the offset position of the file - $p_header['offset'] = ftell($this->zip_fd); - - // ----- Transform UNIX mtime to DOS format mdate/mtime - $v_date = getdate($p_header['mtime']); - $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; - $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; - - // ----- Packed data - $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50, - $p_header['version_extracted'], $p_header['flag'], - $p_header['compression'], $v_mtime, $v_mdate, - $p_header['crc'], $p_header['compressed_size'], - $p_header['size'], - strlen($p_header['stored_filename']), - $p_header['extra_len']); - - // ----- Write the first 148 bytes of the header in the archive - fputs($this->zip_fd, $v_binary_data, 30); - - // ----- Write the variable fields - if (strlen($p_header['stored_filename']) != 0) - { - fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); - } - if ($p_header['extra_len'] != 0) - { - fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteCentralFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteCentralFileHeader(&$p_header) - { - $v_result=1; - - // TBC - //for(reset($p_header); $key = key($p_header); next($p_header)) { - //} - - // ----- Transform UNIX mtime to DOS format mdate/mtime - $v_date = getdate($p_header['mtime']); - $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; - $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; - - - // ----- Packed data - $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50, - $p_header['version'], $p_header['version_extracted'], - $p_header['flag'], $p_header['compression'], - $v_mtime, $v_mdate, $p_header['crc'], - $p_header['compressed_size'], $p_header['size'], - strlen($p_header['stored_filename']), - $p_header['extra_len'], $p_header['comment_len'], - $p_header['disk'], $p_header['internal'], - $p_header['external'], $p_header['offset']); - - // ----- Write the 42 bytes of the header in the zip file - fputs($this->zip_fd, $v_binary_data, 46); - - // ----- Write the variable fields - if (strlen($p_header['stored_filename']) != 0) - { - fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); - } - if ($p_header['extra_len'] != 0) - { - fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); - } - if ($p_header['comment_len'] != 0) - { - fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteCentralHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment) - { - $v_result=1; - - // ----- Packed data - $v_binary_data = pack("VvvvvVVv", 0x06054b50, 0, 0, $p_nb_entries, - $p_nb_entries, $p_size, - $p_offset, strlen($p_comment)); - - // ----- Write the 22 bytes of the header in the zip file - fputs($this->zip_fd, $v_binary_data, 22); - - // ----- Write the variable fields - if (strlen($p_comment) != 0) - { - fputs($this->zip_fd, $p_comment, strlen($p_comment)); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privList() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privList(&$p_list) - { - $v_result=1; - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the zip file - if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) - { - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Go to beginning of Central Dir - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_central_dir['offset'])) - { - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read each entry - for ($i=0; $i<$v_central_dir['entries']; $i++) - { - // ----- Read the file header - if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) - { - $this->privSwapBackMagicQuotes(); - return $v_result; - } - $v_header['index'] = $i; - - // ----- Get the only interesting attributes - $this->privConvertHeader2FileInfo($v_header, $p_list[$i]); - unset($v_header); - } - - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privConvertHeader2FileInfo() - // Description : - // This function takes the file informations from the central directory - // entries and extract the interesting parameters that will be given back. - // The resulting file infos are set in the array $p_info - // $p_info['filename'] : Filename with full path. Given by user (add), - // extracted in the filesystem (extract). - // $p_info['stored_filename'] : Stored filename in the archive. - // $p_info['size'] = Size of the file. - // $p_info['compressed_size'] = Compressed size of the file. - // $p_info['mtime'] = Last modification date of the file. - // $p_info['comment'] = Comment associated with the file. - // $p_info['folder'] = true/false : indicates if the entry is a folder or not. - // $p_info['status'] = status of the action on the file. - // $p_info['crc'] = CRC of the file content. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privConvertHeader2FileInfo($p_header, &$p_info) - { - $v_result=1; - - // ----- Get the interesting attributes - $v_temp_path = PclZipUtilPathReduction($p_header['filename']); - $p_info['filename'] = $v_temp_path; - $v_temp_path = PclZipUtilPathReduction($p_header['stored_filename']); - $p_info['stored_filename'] = $v_temp_path; - $p_info['size'] = $p_header['size']; - $p_info['compressed_size'] = $p_header['compressed_size']; - $p_info['mtime'] = $p_header['mtime']; - $p_info['comment'] = $p_header['comment']; - $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010); - $p_info['index'] = $p_header['index']; - $p_info['status'] = $p_header['status']; - $p_info['crc'] = $p_header['crc']; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractByRule() - // Description : - // Extract a file or directory depending of rules (by index, by name, ...) - // Parameters : - // $p_file_list : An array where will be placed the properties of each - // extracted file - // $p_path : Path to add while writing the extracted files - // $p_remove_path : Path to remove (from the file memorized path) while writing the - // extracted files. If the path does not match the file path, - // the file is extracted with its memorized path. - // $p_remove_path does not apply to 'list' mode. - // $p_path and $p_remove_path are commulative. - // Return Values : - // 1 on success,0 or less on error (see error code list) - // -------------------------------------------------------------------------------- - function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) - { - $v_result=1; - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Check the path - if ( ($p_path == "") - || ( (substr($p_path, 0, 1) != "/") - && (substr($p_path, 0, 3) != "../") - && (substr($p_path,1,2)!=":/"))) - $p_path = "./".$p_path; - - // ----- Reduce the path last (and duplicated) '/' - if (($p_path != "./") && ($p_path != "/")) - { - // ----- Look for the path end '/' - while (substr($p_path, -1) == "/") - { - $p_path = substr($p_path, 0, strlen($p_path)-1); - } - } - - // ----- Look for path to remove format (should end by /) - if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/')) - { - $p_remove_path .= '/'; - } - $p_remove_path_size = strlen($p_remove_path); - - // ----- Open the zip file - if (($v_result = $this->privOpenFd('rb')) != 1) - { - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Start at beginning of Central Dir - $v_pos_entry = $v_central_dir['offset']; - - // ----- Read each entry - $j_start = 0; - for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) - { - - // ----- Read next Central dir entry - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_pos_entry)) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the file header - $v_header = array(); - if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Store the index - $v_header['index'] = $i; - - // ----- Store the file position - $v_pos_entry = ftell($this->zip_fd); - - // ----- Look for the specific extract rules - $v_extract = false; - - // ----- Look for extract by name rule - if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) - && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { - - // ----- Look if the filename is in the list - for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) - && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - $v_extract = true; - } - } - // ----- Look for a filename - elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { - $v_extract = true; - } - } - } - - // ----- Look for extract by ereg rule - // ereg() is deprecated with PHP 5.3 - /* - else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) - && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { - - if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) { - $v_extract = true; - } - } - */ - - // ----- Look for extract by preg rule - else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) - && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { - - if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) { - $v_extract = true; - } - } - - // ----- Look for extract by index rule - else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) - && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { - - // ----- Look if the index is in the list - for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { - $v_extract = true; - } - if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { - $j_start = $j+1; - } - - if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { - break; - } - } - } - - // ----- Look for no rule, which means extract all the archive - else { - $v_extract = true; - } - - // ----- Check compression method - if ( ($v_extract) - && ( ($v_header['compression'] != 8) - && ($v_header['compression'] != 0))) { - $v_header['status'] = 'unsupported_compression'; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION, - "Filename '".$v_header['stored_filename']."' is " - ."compressed by an unsupported compression " - ."method (".$v_header['compression'].") "); - - return PclZip::errorCode(); - } - } - - // ----- Check encrypted files - if (($v_extract) && (($v_header['flag'] & 1) == 1)) { - $v_header['status'] = 'unsupported_encryption'; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, - "Unsupported encryption for " - ." filename '".$v_header['stored_filename'] - ."'"); - - return PclZip::errorCode(); - } - } - - // ----- Look for real extraction - if (($v_extract) && ($v_header['status'] != 'ok')) { - $v_result = $this->privConvertHeader2FileInfo($v_header, - $p_file_list[$v_nb_extracted++]); - if ($v_result != 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - $v_extract = false; - } - - // ----- Look for real extraction - if ($v_extract) - { - - // ----- Go to the file position - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_header['offset'])) - { - // ----- Close the zip file - $this->privCloseFd(); - - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for extraction as string - if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) { - - $v_string = ''; - - // ----- Extracting the file - $v_result1 = $this->privExtractFileAsString($v_header, $v_string, $p_options); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Set the file content - $p_file_list[$v_nb_extracted]['content'] = $v_string; - - // ----- Next extracted file - $v_nb_extracted++; - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - // ----- Look for extraction in standard output - elseif ( (isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) - && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) { - // ----- Extracting the file in standard output - $v_result1 = $this->privExtractFileInOutput($v_header, $p_options); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - // ----- Look for normal extraction - else { - // ----- Extracting the file - $v_result1 = $this->privExtractFile($v_header, - $p_path, $p_remove_path, - $p_remove_all_path, - $p_options); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - } - } - - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFile() - // Description : - // Parameters : - // Return Values : - // - // 1 : ... ? - // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback - // -------------------------------------------------------------------------------- - function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) - { - $v_result=1; - - // ----- Read the file header - if (($v_result = $this->privReadFileHeader($v_header)) != 1) - { - // ----- Return - return $v_result; - } - - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - // ----- Look for all path to remove - if ($p_remove_all_path == true) { - // ----- Look for folder entry that not need to be extracted - if (($p_entry['external']&0x00000010)==0x00000010) { - - $p_entry['status'] = "filtered"; - - return $v_result; - } - - // ----- Get the basename of the path - $p_entry['filename'] = basename($p_entry['filename']); - } - - // ----- Look for path to remove - else if ($p_remove_path != "") - { - if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) - { - - // ----- Change the file status - $p_entry['status'] = "filtered"; - - // ----- Return - return $v_result; - } - - $p_remove_path_size = strlen($p_remove_path); - if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path) - { - - // ----- Remove the path - $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size); - - } - } - - // ----- Add the path - if ($p_path != '') { - $p_entry['filename'] = $p_path."/".$p_entry['filename']; - } - - // ----- Check a base_dir_restriction - if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) { - $v_inclusion - = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION], - $p_entry['filename']); - if ($v_inclusion == 0) { - - PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION, - "Filename '".$p_entry['filename']."' is " - ."outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION"); - - return PclZip::errorCode(); - } - } - - // ----- Look for pre-extract callback - if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_entry['status'] = "skipped"; - $v_result = 1; - } - - // ----- Look for abort result - if ($v_result == 2) { - // ----- This status is internal and will be changed in 'skipped' - $p_entry['status'] = "aborted"; - $v_result = PCLZIP_ERR_USER_ABORTED; - } - - // ----- Update the informations - // Only some fields can be modified - $p_entry['filename'] = $v_local_header['filename']; - } - - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Look for specific actions while the file exist - if (file_exists($p_entry['filename'])) - { - - // ----- Look if file is a directory - if (is_dir($p_entry['filename'])) - { - - // ----- Change the file status - $p_entry['status'] = "already_a_directory"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY, - "Filename '".$p_entry['filename']."' is " - ."already used by an existing directory"); - - return PclZip::errorCode(); - } - } - // ----- Look if file is write protected - else if (!is_writeable($p_entry['filename'])) - { - - // ----- Change the file status - $p_entry['status'] = "write_protected"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, - "Filename '".$p_entry['filename']."' exists " - ."and is write protected"); - - return PclZip::errorCode(); - } - } - - // ----- Look if the extracted file is older - else if (filemtime($p_entry['filename']) > $p_entry['mtime']) - { - // ----- Change the file status - if ( (isset($p_options[PCLZIP_OPT_REPLACE_NEWER])) - && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) { - } - else { - $p_entry['status'] = "newer_exist"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, - "Newer version of '".$p_entry['filename']."' exists " - ."and option PCLZIP_OPT_REPLACE_NEWER is not selected"); - - return PclZip::errorCode(); - } - } - } - else { - } - } - - // ----- Check the directory availability and create it if necessary - else { - if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/')) - $v_dir_to_check = $p_entry['filename']; - else if (!strstr($p_entry['filename'], "/")) - $v_dir_to_check = ""; - else - $v_dir_to_check = dirname($p_entry['filename']); - - if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) { - - // ----- Change the file status - $p_entry['status'] = "path_creation_fail"; - - // ----- Return - //return $v_result; - $v_result = 1; - } - } - } - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) - { - // ----- Look for not compressed file - if ($p_entry['compression'] == 0) { - - // ----- Opening destination file - if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) - { - - // ----- Change the file status - $p_entry['status'] = "write_error"; - - // ----- Return - return $v_result; - } - - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = $p_entry['compressed_size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($this->zip_fd, $v_read_size); - /* Try to speed up the code - $v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($v_dest_file, $v_binary_data, $v_read_size); - */ - @fwrite($v_dest_file, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Closing the destination file - fclose($v_dest_file); - - // ----- Change the file mtime - touch($p_entry['filename'], $p_entry['mtime']); - - - } - else { - // ----- TBC - // Need to be finished - if (($p_entry['flag'] & 1) == 1) { - PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, 'File \''.$p_entry['filename'].'\' is encrypted. Encrypted files are not supported.'); - return PclZip::errorCode(); - } - - - // ----- Look for using temporary file to unzip - if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) - && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) - || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) - && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])) ) ) { - $v_result = $this->privExtractFileUsingTempFile($p_entry, $p_options); - if ($v_result < PCLZIP_ERR_NO_ERROR) { - return $v_result; - } - } - - // ----- Look for extract in memory - else { - - - // ----- Read the compressed file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - $v_file_content = @gzinflate($v_buffer); - unset($v_buffer); - if ($v_file_content === FALSE) { - - // ----- Change the file status - // TBC - $p_entry['status'] = "error"; - - return $v_result; - } - - // ----- Opening destination file - if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { - - // ----- Change the file status - $p_entry['status'] = "write_error"; - - return $v_result; - } - - // ----- Write the uncompressed data - @fwrite($v_dest_file, $v_file_content, $p_entry['size']); - unset($v_file_content); - - // ----- Closing the destination file - @fclose($v_dest_file); - - } - - // ----- Change the file mtime - @touch($p_entry['filename'], $p_entry['mtime']); - } - - // ----- Look for chmod option - if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) { - - // ----- Change the mode of the file - @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]); - } - - } - } - - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - - // ----- Look for post-extract callback - elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); - - // ----- Look for abort result - if ($v_result == 2) { - $v_result = PCLZIP_ERR_USER_ABORTED; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFileUsingTempFile() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privExtractFileUsingTempFile(&$p_entry, &$p_options) - { - $v_result=1; - - // ----- Creates a temporary file - $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz'; - if (($v_dest_file = @fopen($v_gzip_temp_name, "wb")) == 0) { - fclose($v_file); - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); - return PclZip::errorCode(); - } - - - // ----- Write gz file format header - $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3)); - @fwrite($v_dest_file, $v_binary_data, 10); - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = $p_entry['compressed_size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($this->zip_fd, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($v_dest_file, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Write gz file format footer - $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']); - @fwrite($v_dest_file, $v_binary_data, 8); - - // ----- Close the temporary file - @fclose($v_dest_file); - - // ----- Opening destination file - if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { - $p_entry['status'] = "write_error"; - return $v_result; - } - - // ----- Open the temporary gz file - if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) { - @fclose($v_dest_file); - $p_entry['status'] = "read_error"; - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - return PclZip::errorCode(); - } - - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = $p_entry['size']; - while ($v_size != 0) { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @gzread($v_src_file, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($v_dest_file, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - @fclose($v_dest_file); - @gzclose($v_src_file); - - // ----- Delete the temporary file - @unlink($v_gzip_temp_name); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFileInOutput() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privExtractFileInOutput(&$p_entry, &$p_options) - { - $v_result=1; - - // ----- Read the file header - if (($v_result = $this->privReadFileHeader($v_header)) != 1) { - return $v_result; - } - - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - // ----- Look for pre-extract callback - if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_entry['status'] = "skipped"; - $v_result = 1; - } - - // ----- Look for abort result - if ($v_result == 2) { - // ----- This status is internal and will be changed in 'skipped' - $p_entry['status'] = "aborted"; - $v_result = PCLZIP_ERR_USER_ABORTED; - } - - // ----- Update the informations - // Only some fields can be modified - $p_entry['filename'] = $v_local_header['filename']; - } - - // ----- Trace - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) { - // ----- Look for not compressed file - if ($p_entry['compressed_size'] == $p_entry['size']) { - - // ----- Read the file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Send the file to the output - echo $v_buffer; - unset($v_buffer); - } - else { - - // ----- Read the compressed file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - $v_file_content = gzinflate($v_buffer); - unset($v_buffer); - - // ----- Send the file to the output - echo $v_file_content; - unset($v_file_content); - } - } - } - - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - - // ----- Look for post-extract callback - elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); - - // ----- Look for abort result - if ($v_result == 2) { - $v_result = PCLZIP_ERR_USER_ABORTED; - } - } - - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFileAsString() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privExtractFileAsString(&$p_entry, &$p_string, &$p_options) - { - $v_result=1; - - // ----- Read the file header - $v_header = array(); - if (($v_result = $this->privReadFileHeader($v_header)) != 1) - { - // ----- Return - return $v_result; - } - - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - // ----- Look for pre-extract callback - if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_entry['status'] = "skipped"; - $v_result = 1; - } - - // ----- Look for abort result - if ($v_result == 2) { - // ----- This status is internal and will be changed in 'skipped' - $p_entry['status'] = "aborted"; - $v_result = PCLZIP_ERR_USER_ABORTED; - } - - // ----- Update the informations - // Only some fields can be modified - $p_entry['filename'] = $v_local_header['filename']; - } - - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) { - // ----- Look for not compressed file - // if ($p_entry['compressed_size'] == $p_entry['size']) - if ($p_entry['compression'] == 0) { - - // ----- Reading the file - $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); - } - else { - - // ----- Reading the file - $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - if (($p_string = @gzinflate($v_data)) === FALSE) { - // TBC - } - } - - // ----- Trace - } - else { - // TBC : error : can not extract a folder in a string - } - - } - - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - - // ----- Look for post-extract callback - elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Swap the content to header - $v_local_header['content'] = $p_string; - $p_string = ''; - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); - - // ----- Swap back the content to header - $p_string = $v_local_header['content']; - unset($v_local_header['content']); - - // ----- Look for abort result - if ($v_result == 2) { - $v_result = PCLZIP_ERR_USER_ABORTED; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadFileHeader(&$p_header) - { - $v_result=1; - - // ----- Read the 4 bytes signature - $v_binary_data = @fread($this->zip_fd, 4); - $v_data = unpack('Vid', $v_binary_data); - - // ----- Check signature - if ($v_data['id'] != 0x04034b50) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the first 42 bytes of the header - $v_binary_data = fread($this->zip_fd, 26); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 26) - { - $p_header['filename'] = ""; - $p_header['status'] = "invalid_header"; - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Extract the values - $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data); - - // ----- Get filename - $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']); - - // ----- Get extra_fields - if ($v_data['extra_len'] != 0) { - $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']); - } - else { - $p_header['extra'] = ''; - } - - // ----- Extract properties - $p_header['version_extracted'] = $v_data['version']; - $p_header['compression'] = $v_data['compression']; - $p_header['size'] = $v_data['size']; - $p_header['compressed_size'] = $v_data['compressed_size']; - $p_header['crc'] = $v_data['crc']; - $p_header['flag'] = $v_data['flag']; - $p_header['filename_len'] = $v_data['filename_len']; - - // ----- Recuperate date in UNIX format - $p_header['mdate'] = $v_data['mdate']; - $p_header['mtime'] = $v_data['mtime']; - if ($p_header['mdate'] && $p_header['mtime']) - { - // ----- Extract time - $v_hour = ($p_header['mtime'] & 0xF800) >> 11; - $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; - $v_seconde = ($p_header['mtime'] & 0x001F)*2; - - // ----- Extract date - $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; - $v_month = ($p_header['mdate'] & 0x01E0) >> 5; - $v_day = $p_header['mdate'] & 0x001F; - - // ----- Get UNIX date format - $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); - - } - else - { - $p_header['mtime'] = time(); - } - - // TBC - //for(reset($v_data); $key = key($v_data); next($v_data)) { - //} - - // ----- Set the stored filename - $p_header['stored_filename'] = $p_header['filename']; - - // ----- Set the status field - $p_header['status'] = "ok"; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadCentralFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadCentralFileHeader(&$p_header) - { - $v_result=1; - - // ----- Read the 4 bytes signature - $v_binary_data = @fread($this->zip_fd, 4); - $v_data = unpack('Vid', $v_binary_data); - - // ----- Check signature - if ($v_data['id'] != 0x02014b50) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the first 42 bytes of the header - $v_binary_data = fread($this->zip_fd, 42); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 42) - { - $p_header['filename'] = ""; - $p_header['status'] = "invalid_header"; - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Extract the values - $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data); - - // ----- Get filename - if ($p_header['filename_len'] != 0) - $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']); - else - $p_header['filename'] = ''; - - // ----- Get extra - if ($p_header['extra_len'] != 0) - $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']); - else - $p_header['extra'] = ''; - - // ----- Get comment - if ($p_header['comment_len'] != 0) - $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']); - else - $p_header['comment'] = ''; - - // ----- Extract properties - - // ----- Recuperate date in UNIX format - //if ($p_header['mdate'] && $p_header['mtime']) - // TBC : bug : this was ignoring time with 0/0/0 - if (1) - { - // ----- Extract time - $v_hour = ($p_header['mtime'] & 0xF800) >> 11; - $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; - $v_seconde = ($p_header['mtime'] & 0x001F)*2; - - // ----- Extract date - $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; - $v_month = ($p_header['mdate'] & 0x01E0) >> 5; - $v_day = $p_header['mdate'] & 0x001F; - - // ----- Get UNIX date format - $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); - - } - else - { - $p_header['mtime'] = time(); - } - - // ----- Set the stored filename - $p_header['stored_filename'] = $p_header['filename']; - - // ----- Set default status to ok - $p_header['status'] = 'ok'; - - // ----- Look if it is a directory - if (substr($p_header['filename'], -1) == '/') { - //$p_header['external'] = 0x41FF0010; - $p_header['external'] = 0x00000010; - } - - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCheckFileHeaders() - // Description : - // Parameters : - // Return Values : - // 1 on success, - // 0 on error; - // -------------------------------------------------------------------------------- - function privCheckFileHeaders(&$p_local_header, &$p_central_header) - { - $v_result=1; - - // ----- Check the static values - // TBC - if ($p_local_header['filename'] != $p_central_header['filename']) { - } - if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) { - } - if ($p_local_header['flag'] != $p_central_header['flag']) { - } - if ($p_local_header['compression'] != $p_central_header['compression']) { - } - if ($p_local_header['mtime'] != $p_central_header['mtime']) { - } - if ($p_local_header['filename_len'] != $p_central_header['filename_len']) { - } - - // ----- Look for flag bit 3 - if (($p_local_header['flag'] & 8) == 8) { - $p_local_header['size'] = $p_central_header['size']; - $p_local_header['compressed_size'] = $p_central_header['compressed_size']; - $p_local_header['crc'] = $p_central_header['crc']; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadEndCentralDir() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadEndCentralDir(&$p_central_dir) - { - $v_result=1; - - // ----- Go to the end of the zip file - $v_size = filesize($this->zipname); - @fseek($this->zip_fd, $v_size); - if (@ftell($this->zip_fd) != $v_size) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\''); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- First try : look if this is an archive with no commentaries (most of the time) - // in this case the end of central dir is at 22 bytes of the file end - $v_found = 0; - if ($v_size > 26) { - @fseek($this->zip_fd, $v_size-22); - if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read for bytes - $v_binary_data = @fread($this->zip_fd, 4); - $v_data = @unpack('Vid', $v_binary_data); - - // ----- Check signature - if ($v_data['id'] == 0x06054b50) { - $v_found = 1; - } - - $v_pos = ftell($this->zip_fd); - } - - // ----- Go back to the maximum possible size of the Central Dir End Record - if (!$v_found) { - $v_maximum_size = 65557; // 0xFFFF + 22; - if ($v_maximum_size > $v_size) - $v_maximum_size = $v_size; - @fseek($this->zip_fd, $v_size-$v_maximum_size); - if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read byte per byte in order to find the signature - $v_pos = ftell($this->zip_fd); - $v_bytes = 0x00000000; - while ($v_pos < $v_size) - { - // ----- Read a byte - $v_byte = @fread($this->zip_fd, 1); - - // ----- Add the byte - //$v_bytes = ($v_bytes << 8) | Ord($v_byte); - // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number - // Otherwise on systems where we have 64bit integers the check below for the magic number will fail. - $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte); - - // ----- Compare the bytes - if ($v_bytes == 0x504b0506) - { - $v_pos++; - break; - } - - $v_pos++; - } - - // ----- Look if not found end of central dir - if ($v_pos == $v_size) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature"); - - // ----- Return - return PclZip::errorCode(); - } - } - - // ----- Read the first 18 bytes of the header - $v_binary_data = fread($this->zip_fd, 18); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 18) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data)); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Extract the values - $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data); - - // ----- Check the global size - if (($v_pos + $v_data['comment_size'] + 18) != $v_size) { - - // ----- Removed in release 2.2 see readme file - // The check of the file size is a little too strict. - // Some bugs where found when a zip is encrypted/decrypted with 'crypt'. - // While decrypted, zip has training 0 bytes - if (0) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, - 'The central dir is not at the end of the archive.' - .' Some trailing bytes exists after the archive.'); - - // ----- Return - return PclZip::errorCode(); - } - } - - // ----- Get comment - if ($v_data['comment_size'] != 0) { - $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']); - } - else - $p_central_dir['comment'] = ''; - - $p_central_dir['entries'] = $v_data['entries']; - $p_central_dir['disk_entries'] = $v_data['disk_entries']; - $p_central_dir['offset'] = $v_data['offset']; - $p_central_dir['size'] = $v_data['size']; - $p_central_dir['disk'] = $v_data['disk']; - $p_central_dir['disk_start'] = $v_data['disk_start']; - - // TBC - //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) { - //} - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDeleteByRule() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDeleteByRule(&$p_result_list, &$p_options) - { - $v_result=1; - $v_list_detail = array(); - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - return $v_result; - } - - // ----- Go to beginning of File - @rewind($this->zip_fd); - - // ----- Scan all the files - // ----- Start at beginning of Central Dir - $v_pos_entry = $v_central_dir['offset']; - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_pos_entry)) - { - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read each entry - $v_header_list = array(); - $j_start = 0; - for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) - { - - // ----- Read the file header - $v_header_list[$v_nb_extracted] = array(); - if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - - return $v_result; - } - - - // ----- Store the index - $v_header_list[$v_nb_extracted]['index'] = $i; - - // ----- Look for the specific extract rules - $v_found = false; - - // ----- Look for extract by name rule - if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) - && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { - - // ----- Look if the filename is in the list - for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) - && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - $v_found = true; - } - elseif ( (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */ - && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - $v_found = true; - } - } - // ----- Look for a filename - elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { - $v_found = true; - } - } - } - - // ----- Look for extract by ereg rule - // ereg() is deprecated with PHP 5.3 - /* - else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) - && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { - - if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { - $v_found = true; - } - } - */ - - // ----- Look for extract by preg rule - else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) - && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { - - if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { - $v_found = true; - } - } - - // ----- Look for extract by index rule - else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) - && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { - - // ----- Look if the index is in the list - for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { - $v_found = true; - } - if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { - $j_start = $j+1; - } - - if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { - break; - } - } - } - else { - $v_found = true; - } - - // ----- Look for deletion - if ($v_found) - { - unset($v_header_list[$v_nb_extracted]); - } - else - { - $v_nb_extracted++; - } - } - - // ----- Look if something need to be deleted - if ($v_nb_extracted > 0) { - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Creates a temporary zip archive - $v_temp_zip = new PclZip($v_zip_temp_name); - - // ----- Open the temporary zip file in write mode - if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) { - $this->privCloseFd(); - - // ----- Return - return $v_result; - } - - // ----- Look which file need to be kept - for ($i=0; $izip_fd); - if (@fseek($this->zip_fd, $v_header_list[$i]['offset'])) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the file header - $v_local_header = array(); - if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Check that local file header is same as central file header - if ($this->privCheckFileHeaders($v_local_header, - $v_header_list[$i]) != 1) { - // TBC - } - unset($v_local_header); - - // ----- Write the file header - if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Read/write the data block - if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($v_temp_zip->zip_fd); - - // ----- Re-Create the Central Dir files header - for ($i=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Transform the header to a 'usable' info - $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - - // ----- Zip file comment - $v_comment = ''; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) { - // ----- Reset the file list - unset($v_header_list); - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Close - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Destroy the temporary archive - unset($v_temp_zip); - } - - // ----- Remove every files : reset the file - else if ($v_central_dir['entries'] != 0) { - $this->privCloseFd(); - - if (($v_result = $this->privOpenFd('wb')) != 1) { - return $v_result; - } - - if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) { - return $v_result; - } - - $this->privCloseFd(); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDirCheck() - // Description : - // Check if a directory exists, if not it creates it and all the parents directory - // which may be useful. - // Parameters : - // $p_dir : Directory path to check. - // Return Values : - // 1 : OK - // -1 : Unable to create directory - // -------------------------------------------------------------------------------- - function privDirCheck($p_dir, $p_is_dir=false) - { - $v_result = 1; - - - // ----- Remove the final '/' - if (($p_is_dir) && (substr($p_dir, -1)=='/')) - { - $p_dir = substr($p_dir, 0, strlen($p_dir)-1); - } - - // ----- Check the directory availability - if ((is_dir($p_dir)) || ($p_dir == "")) - { - return 1; - } - - // ----- Extract parent directory - $p_parent_dir = dirname($p_dir); - - // ----- Just a check - if ($p_parent_dir != $p_dir) - { - // ----- Look for parent directory - if ($p_parent_dir != "") - { - if (($v_result = $this->privDirCheck($p_parent_dir)) != 1) - { - return $v_result; - } - } - } - - // ----- Create the directory - if (!@mkdir($p_dir, 0777)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privMerge() - // Description : - // If $p_archive_to_add does not exist, the function exit with a success result. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privMerge(&$p_archive_to_add) - { - $v_result=1; - - // ----- Look if the archive_to_add exists - if (!is_file($p_archive_to_add->zipname)) - { - - // ----- Nothing to merge, so merge is a success - $v_result = 1; - - // ----- Return - return $v_result; - } - - // ----- Look if the archive exists - if (!is_file($this->zipname)) - { - - // ----- Do a duplicate - $v_result = $this->privDuplicate($p_archive_to_add->zipname); - - // ----- Return - return $v_result; - } - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - return $v_result; - } - - // ----- Go to beginning of File - @rewind($this->zip_fd); - - // ----- Open the archive_to_add file - if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1) - { - $this->privCloseFd(); - - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir_to_add = array(); - if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - return $v_result; - } - - // ----- Go to beginning of File - @rewind($p_archive_to_add->zip_fd); - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Open the temporary file in write mode - if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = $v_central_dir['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Copy the files from the archive_to_add into the temporary file - $v_size = $v_central_dir_to_add['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($v_zip_temp_fd); - - // ----- Copy the block of file headers from the old archive - $v_size = $v_central_dir['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Copy the block of file headers from the archive_to_add - $v_size = $v_central_dir_to_add['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Merge the file comments - $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment']; - - // ----- Calculate the size of the (new) central header - $v_size = @ftell($v_zip_temp_fd)-$v_offset; - - // ----- Swap the file descriptor - // Here is a trick : I swap the temporary fd with the zip fd, in order to use - // the following methods on the temporary fil and not the real archive fd - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - @fclose($v_zip_temp_fd); - $this->zip_fd = null; - - // ----- Reset the file list - unset($v_header_list); - - // ----- Return - return $v_result; - } - - // ----- Swap back the file descriptor - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Close - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDuplicate() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDuplicate($p_archive_filename) - { - $v_result=1; - - // ----- Look if the $p_archive_filename exists - if (!is_file($p_archive_filename)) - { - - // ----- Nothing to duplicate, so duplicate is a success. - $v_result = 1; - - // ----- Return - return $v_result; - } - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('wb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Open the temporary file in write mode - if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0) - { - $this->privCloseFd(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = filesize($p_archive_filename); - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($v_zip_temp_fd, $v_read_size); - @fwrite($this->zip_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Close - $this->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privErrorLog() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privErrorLog($p_error_code=0, $p_error_string='') - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - PclError($p_error_code, $p_error_string); - } - else { - $this->error_code = $p_error_code; - $this->error_string = $p_error_string; - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privErrorReset() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privErrorReset() - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - PclErrorReset(); - } - else { - $this->error_code = 0; - $this->error_string = ''; - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDisableMagicQuotes() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDisableMagicQuotes() - { - $v_result=1; - - // ----- Look if function exists - if ( (!function_exists("get_magic_quotes_runtime")) - || (!function_exists("set_magic_quotes_runtime"))) { - return $v_result; - } - - // ----- Look if already done - if ($this->magic_quotes_status != -1) { - return $v_result; - } - - // ----- Get and memorize the magic_quote value - $this->magic_quotes_status = @get_magic_quotes_runtime(); - - // ----- Disable magic_quotes - if ($this->magic_quotes_status == 1) { - @set_magic_quotes_runtime(0); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privSwapBackMagicQuotes() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privSwapBackMagicQuotes() - { - $v_result=1; - - // ----- Look if function exists - if ( (!function_exists("get_magic_quotes_runtime")) - || (!function_exists("set_magic_quotes_runtime"))) { - return $v_result; - } - - // ----- Look if something to do - if ($this->magic_quotes_status != -1) { - return $v_result; - } - - // ----- Swap back magic_quotes - if ($this->magic_quotes_status == 1) { - @set_magic_quotes_runtime($this->magic_quotes_status); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - } - // End of class - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilPathReduction() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function PclZipUtilPathReduction($p_dir) - { - $v_result = ""; - - // ----- Look for not empty path - if ($p_dir != "") { - // ----- Explode path by directory names - $v_list = explode("/", $p_dir); - - // ----- Study directories from last to first - $v_skip = 0; - for ($i=sizeof($v_list)-1; $i>=0; $i--) { - // ----- Look for current path - if ($v_list[$i] == ".") { - // ----- Ignore this directory - // Should be the first $i=0, but no check is done - } - else if ($v_list[$i] == "..") { - $v_skip++; - } - else if ($v_list[$i] == "") { - // ----- First '/' i.e. root slash - if ($i == 0) { - $v_result = "/".$v_result; - if ($v_skip > 0) { - // ----- It is an invalid path, so the path is not modified - // TBC - $v_result = $p_dir; - $v_skip = 0; - } - } - // ----- Last '/' i.e. indicates a directory - else if ($i == (sizeof($v_list)-1)) { - $v_result = $v_list[$i]; - } - // ----- Double '/' inside the path - else { - // ----- Ignore only the double '//' in path, - // but not the first and last '/' - } - } - else { - // ----- Look for item to skip - if ($v_skip > 0) { - $v_skip--; - } - else { - $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:""); - } - } - } - - // ----- Look for skip - if ($v_skip > 0) { - while ($v_skip > 0) { - $v_result = '../'.$v_result; - $v_skip--; - } - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilPathInclusion() - // Description : - // This function indicates if the path $p_path is under the $p_dir tree. Or, - // said in an other way, if the file or sub-dir $p_path is inside the dir - // $p_dir. - // The function indicates also if the path is exactly the same as the dir. - // This function supports path with duplicated '/' like '//', but does not - // support '.' or '..' statements. - // Parameters : - // Return Values : - // 0 if $p_path is not inside directory $p_dir - // 1 if $p_path is inside directory $p_dir - // 2 if $p_path is exactly the same as $p_dir - // -------------------------------------------------------------------------------- - function PclZipUtilPathInclusion($p_dir, $p_path) - { - $v_result = 1; - - // ----- Look for path beginning by ./ - if ( ($p_dir == '.') - || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) { - $p_dir = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_dir, 1); - } - if ( ($p_path == '.') - || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) { - $p_path = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_path, 1); - } - - // ----- Explode dir and path by directory separator - $v_list_dir = explode("/", $p_dir); - $v_list_dir_size = sizeof($v_list_dir); - $v_list_path = explode("/", $p_path); - $v_list_path_size = sizeof($v_list_path); - - // ----- Study directories paths - $i = 0; - $j = 0; - while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) { - - // ----- Look for empty dir (path reduction) - if ($v_list_dir[$i] == '') { - $i++; - continue; - } - if ($v_list_path[$j] == '') { - $j++; - continue; - } - - // ----- Compare the items - if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != '')) { - $v_result = 0; - } - - // ----- Next items - $i++; - $j++; - } - - // ----- Look if everything seems to be the same - if ($v_result) { - // ----- Skip all the empty items - while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++; - while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++; - - if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) { - // ----- There are exactly the same - $v_result = 2; - } - else if ($i < $v_list_dir_size) { - // ----- The path is shorter than the dir - $v_result = 0; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilCopyBlock() - // Description : - // Parameters : - // $p_mode : read/write compression mode - // 0 : src & dest normal - // 1 : src gzip, dest normal - // 2 : src normal, dest gzip - // 3 : src & dest gzip - // Return Values : - // -------------------------------------------------------------------------------- - function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0) - { - $v_result = 1; - - if ($p_mode==0) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($p_src, $v_read_size); - @fwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - else if ($p_mode==1) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @gzread($p_src, $v_read_size); - @fwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - else if ($p_mode==2) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($p_src, $v_read_size); - @gzwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - else if ($p_mode==3) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @gzread($p_src, $v_read_size); - @gzwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilRename() - // Description : - // This function tries to do a simple rename() function. If it fails, it - // tries to copy the $p_src file in a new $p_dest file and then unlink the - // first one. - // Parameters : - // $p_src : Old filename - // $p_dest : New filename - // Return Values : - // 1 on success, 0 on failure. - // -------------------------------------------------------------------------------- - function PclZipUtilRename($p_src, $p_dest) - { - $v_result = 1; - - // ----- Try to rename the files - if (!@rename($p_src, $p_dest)) { - - // ----- Try to copy & unlink the src - if (!@copy($p_src, $p_dest)) { - $v_result = 0; - } - else if (!@unlink($p_src)) { - $v_result = 0; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilOptionText() - // Description : - // Translate option value in text. Mainly for debug purpose. - // Parameters : - // $p_option : the option value. - // Return Values : - // The option text value. - // -------------------------------------------------------------------------------- - function PclZipUtilOptionText($p_option) - { - - $v_list = get_defined_constants(); - for (reset($v_list); $v_key = key($v_list); next($v_list)) { - $v_prefix = substr($v_key, 0, 10); - if (( ($v_prefix == 'PCLZIP_OPT') - || ($v_prefix == 'PCLZIP_CB_') - || ($v_prefix == 'PCLZIP_ATT')) - && ($v_list[$v_key] == $p_option)) { - return $v_key; - } - } - - $v_result = 'Unknown'; - - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilTranslateWinPath() - // Description : - // Translate windows path by replacing '\' by '/' and optionally removing - // drive letter. - // Parameters : - // $p_path : path to translate. - // $p_remove_disk_letter : true | false - // Return Values : - // The path translated. - // -------------------------------------------------------------------------------- - function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true) - { - if (stristr(php_uname(), 'windows')) { - // ----- Look for potential disk letter - if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) { - $p_path = substr($p_path, $v_position+1); - } - // ----- Change potential windows directory separator - if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) { - $p_path = strtr($p_path, '\\', '/'); - } - } - return $p_path; - } - // -------------------------------------------------------------------------------- - - -?> diff --git a/3.1/modules/themeroller/libraries/readme.txt b/3.1/modules/themeroller/libraries/readme.txt deleted file mode 100644 index d1b11e25..00000000 --- a/3.1/modules/themeroller/libraries/readme.txt +++ /dev/null @@ -1,421 +0,0 @@ -// -------------------------------------------------------------------------------- -// PclZip 2.8.2 - readme.txt -// -------------------------------------------------------------------------------- -// License GNU/LGPL - August 2009 -// Vincent Blavet - vincent@phpconcept.net -// http://www.phpconcept.net -// -------------------------------------------------------------------------------- -// $Id: readme.txt,v 1.60 2009/09/30 20:35:21 vblavet Exp $ -// -------------------------------------------------------------------------------- - - - -0 - Sommaire -============ - 1 - Introduction - 2 - What's new - 3 - Corrected bugs - 4 - Known bugs or limitations - 5 - License - 6 - Warning - 7 - Documentation - 8 - Author - 9 - Contribute - -1 - Introduction -================ - - PclZip is a library that allow you to manage a Zip archive. - - Full documentation about PclZip can be found here : http://www.phpconcept.net/pclzip - -2 - What's new -============== - - Version 2.8.2 : - - PCLZIP_CB_PRE_EXTRACT and PCLZIP_CB_POST_EXTRACT are now supported with - extraction as a string (PCLZIP_OPT_EXTRACT_AS_STRING). The string - can also be modified in the post-extract call back. - **Bugs correction : - - PCLZIP_OPT_REMOVE_ALL_PATH was not working correctly - - Remove use of eval() and do direct call to callback functions - - Correct support of 64bits systems (Thanks to WordPress team) - - Version 2.8.1 : - - Move option PCLZIP_OPT_BY_EREG to PCLZIP_OPT_BY_PREG because ereg() is - deprecated in PHP 5.3. When using option PCLZIP_OPT_BY_EREG, PclZip will - automatically replace it by PCLZIP_OPT_BY_PREG. - - Version 2.8 : - - Improve extraction of zip archive for large files by using temporary files - This feature is working like the one defined in r2.7. - Options are renamed : PCLZIP_OPT_TEMP_FILE_ON, PCLZIP_OPT_TEMP_FILE_OFF, - PCLZIP_OPT_TEMP_FILE_THRESHOLD - - Add a ratio constant PCLZIP_TEMPORARY_FILE_RATIO to configure the auto - sense of temporary file use. - - Bug correction : Reduce filepath in returned file list to remove ennoying - './/' preambule in file path. - - Version 2.7 : - - Improve creation of zip archive for large files : - PclZip will now autosense the configured memory and use temporary files - when large file is suspected. - This feature can also ne triggered by manual options in create() and add() - methods. 'PCLZIP_OPT_ADD_TEMP_FILE_ON' force the use of temporary files, - 'PCLZIP_OPT_ADD_TEMP_FILE_OFF' disable the autosense technic, - 'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD' allow for configuration of a size - threshold to use temporary files. - Using "temporary files" rather than "memory" might take more time, but - might give the ability to zip very large files : - Tested on my win laptop with a 88Mo file : - Zip "in-memory" : 18sec (max_execution_time=30, memory_limit=180Mo) - Zip "tmporary-files" : 23sec (max_execution_time=30, memory_limit=30Mo) - - Replace use of mktime() by time() to limit the E_STRICT error messages. - - Bug correction : When adding files with full windows path (drive letter) - PclZip is now working. Before, if the drive letter is not the default - path, PclZip was not able to add the file. - - Version 2.6 : - - Code optimisation - - New attributes PCLZIP_ATT_FILE_COMMENT gives the ability to - add a comment for a specific file. (Don't really know if this is usefull) - - New attribute PCLZIP_ATT_FILE_CONTENT gives the ability to add a string - as a file. - - New attribute PCLZIP_ATT_FILE_MTIME modify the timestamp associated with - a file. - - Correct a bug. Files archived with a timestamp with 0h0m0s were extracted - with current time - - Add CRC value in the informations returned back for each file after an - action. - - Add missing closedir() statement. - - When adding a folder, and removing the path of this folder, files were - incorrectly added with a '/' at the beginning. Which means files are - related to root in unix systems. Corrected. - - Add conditional if before constant definition. This will allow users - to redefine constants without changing the file, and then improve - upgrade of pclzip code for new versions. - - Version 2.5 : - - Introduce the ability to add file/folder with individual properties (file descriptor). - This gives for example the ability to change the filename of a zipped file. - . Able to add files individually - . Able to change full name - . Able to change short name - . Compatible with global options - - New attributes : PCLZIP_ATT_FILE_NAME, PCLZIP_ATT_FILE_NEW_SHORT_NAME, PCLZIP_ATT_FILE_NEW_FULL_NAME - - New error code : PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE - - Add a security control feature. PclZip can extract any file in any folder - of a system. People may use this to upload a zip file and try to override - a system file. The PCLZIP_OPT_EXTRACT_DIR_RESTRICTION will give the - ability to forgive any directory transversal behavior. - - New PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : check extraction path - - New error code : PCLZIP_ERR_DIRECTORY_RESTRICTION - - Modification in PclZipUtilPathInclusion() : dir and path beginning with ./ will be prepend - by current path (getcwd()) - - Version 2.4 : - - Code improvment : try to speed up the code by removing unusefull call to pack() - - Correct bug in delete() : delete() should be called with no argument. This was not - the case in 2.3. This is corrected in 2.4. - - Correct a bug in path_inclusion function. When the path has several '../../', the - result was bad. - - Add a check for magic_quotes_runtime configuration. If enabled, PclZip will - disable it while working and det it back to its original value. - This resolve a lots of bad formated archive errors. - - Bug correction : PclZip now correctly unzip file in some specific situation, - when compressed content has same size as uncompressed content. - - Bug correction : When selecting option 'PCLZIP_OPT_REMOVE_ALL_PATH', - directories are not any more created. - - Code improvment : correct unclosed opendir(), better handling of . and .. in - loops. - - - Version 2.3 : - - Correct a bug with PHP5 : affecting the value 0xFE49FFE0 to a variable does not - give the same result in PHP4 and PHP5 .... - - Version 2.2 : - - Try development of PCLZIP_OPT_CRYPT ..... - However this becomes to a stop. To crypt/decrypt I need to multiply 2 long integers, - the result (greater than a long) is not supported by PHP. Even the use of bcmath - functions does not help. I did not find yet a solution ...; - - Add missing '/' at end of directory entries - - Check is a file is encrypted or not. Returns status 'unsupported_encryption' and/or - error code PCLZIP_ERR_UNSUPPORTED_ENCRYPTION. - - Corrected : Bad "version need to extract" field in local file header - - Add private method privCheckFileHeaders() in order to check local and central - file headers. PclZip is now supporting purpose bit flag bit 3. Purpose bit flag bit 3 gives - the ability to have a local file header without size, compressed size and crc filled. - - Add a generic status 'error' for file status - - Add control of compression type. PclZip only support deflate compression method. - Before v2.2, PclZip does not check the compression method used in an archive while - extracting. With v2.2 PclZip returns a new error status for a file using an unsupported - compression method. New status is "unsupported_compression". New error code is - PCLZIP_ERR_UNSUPPORTED_COMPRESSION. - - Add optional attribute PCLZIP_OPT_STOP_ON_ERROR. This will stop the extract of files - when errors like 'a folder with same name exists' or 'a newer file exists' or - 'a write protected file' exists, rather than set a status for the concerning file - and resume the extract of the zip. - - Add optional attribute PCLZIP_OPT_REPLACE_NEWER. This will force, during an extract' the - replacement of the file, even if a newer version of the file exists. - Note that today if a file with the same name already exists but is older it will be - replaced by the extracted one. - - Improve PclZipUtilOption() - - Support of zip archive with trailing bytes. Before 2.2, PclZip checks that the central - directory structure is the last data in the archive. Crypt encryption/decryption of - zip archive put trailing 0 bytes after decryption. PclZip is now supporting this. - - Version 2.1 : - - Add the ability to abort the extraction by using a user callback function. - The user can now return the value '2' in its callback which indicates to stop the - extraction. For a pre call-back extract is stopped before the extration of the current - file. For a post call back, the extraction is stopped after. - - Add the ability to extract a file (or several files) directly in the standard output. - This is done by the new parameter PCLZIP_OPT_EXTRACT_IN_OUTPUT with method extract(). - - Add support for parameters PCLZIP_OPT_COMMENT, PCLZIP_OPT_ADD_COMMENT, - PCLZIP_OPT_PREPEND_COMMENT. This will create, replace, add, or prepend comments - in the zip archive. - - When merging two archives, the comments are not any more lost, but merged, with a - blank space separator. - - Corrected bug : Files are not deleted when all files are asked to be deleted. - - Corrected bug : Folders with name '0' made PclZip to abort the create or add feature. - - - Version 2.0 : - ***** Warning : Some new features may break the backward compatibility for your scripts. - Please carefully read the readme file. - - Add the ability to delete by Index, name and regular expression. This feature is - performed by the method delete(), which uses the optional parameters - PCLZIP_OPT_BY_INDEX, PCLZIP_OPT_BY_NAME, PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG. - - Add the ability to extract by regular expression. To extract by regexp you must use the method - extract(), with the option PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG - (depending if you want to use ereg() or preg_match() syntax) followed by the - regular expression pattern. - - Add the ability to extract by index, directly with the extract() method. This is a - code improvment of the extractByIndex() method. - - Add the ability to extract by name. To extract by name you must use the method - extract(), with the option PCLZIP_OPT_BY_NAME followed by the filename to - extract or an array of filenames to extract. To extract all a folder, use the folder - name rather than the filename with a '/' at the end. - - Add the ability to add files without compression. This is done with a new attribute - which is PCLZIP_OPT_NO_COMPRESSION. - - Add the attribute PCLZIP_OPT_EXTRACT_AS_STRING, which allow to extract a file directly - in a string without using any file (or temporary file). - - Add constant PCLZIP_SEPARATOR for static configuration of filename separators in a single string. - The default separator is now a comma (,) and not any more a blank space. - THIS BREAK THE BACKWARD COMPATIBILITY : Please check if this may have an impact with - your script. - - Improve algorythm performance by removing the use of temporary files when adding or - extracting files in an archive. - - Add (correct) detection of empty filename zipping. This can occurs when the removed - path is the same - as a zipped dir. The dir is not zipped (['status'] = filtered), only its content. - - Add better support for windows paths (thanks for help from manus@manusfreedom.com). - - Corrected bug : When the archive file already exists with size=0, the add() method - fails. Corrected in 2.0. - - Remove the use of OS_WINDOWS constant. Use php_uname() function rather. - - Control the order of index ranges in extract by index feature. - - Change the internal management of folders (better handling of internal flag). - - - Version 1.3 : - - Removing the double include check. This is now done by include_once() and require_once() - PHP directives. - - Changing the error handling mecanism : Remove the use of an external error library. - The former PclError...() functions are replaced by internal equivalent methods. - By changing the environment variable PCLZIP_ERROR_EXTERNAL you can still use the former library. - Introducing the use of constants for error codes rather than integer values. This will help - in futur improvment. - Introduction of error handling functions like errorCode(), errorName() and errorInfo(). - - Remove the deprecated use of calling function with arguments passed by reference. - - Add the calling of extract(), extractByIndex(), create() and add() functions - with variable options rather than fixed arguments. - - Add the ability to remove all the file path while extracting or adding, - without any need to specify the path to remove. - This is available for extract(), extractByIndex(), create() and add() functionS by using - the new variable options parameters : - - PCLZIP_OPT_REMOVE_ALL_PATH : by indicating this option while calling the fct. - - Ability to change the mode of a file after the extraction (chmod()). - This is available for extract() and extractByIndex() functionS by using - the new variable options parameters. - - PCLZIP_OPT_SET_CHMOD : by setting the value of this option. - - Ability to definition call-back options. These call-back will be called during the adding, - or the extracting of file (extract(), extractByIndex(), create() and add() functions) : - - PCLZIP_CB_PRE_EXTRACT : will be called before each extraction of a file. The user - can trigerred the change the filename of the extracted file. The user can triggered the - skip of the extraction. This is adding a 'skipped' status in the file list result value. - - PCLZIP_CB_POST_EXTRACT : will be called after each extraction of a file. - Nothing can be triggered from that point. - - PCLZIP_CB_PRE_ADD : will be called before each add of a file. The user - can trigerred the change the stored filename of the added file. The user can triggered the - skip of the add. This is adding a 'skipped' status in the file list result value. - - PCLZIP_CB_POST_ADD : will be called after each add of a file. - Nothing can be triggered from that point. - - Two status are added in the file list returned as function result : skipped & filename_too_long - 'skipped' is used when a call-back function ask for skipping the file. - 'filename_too_long' is used while adding a file with a too long filename to archive (the file is - not added) - - Adding the function PclZipUtilPathInclusion(), that check the inclusion of a path into - a directory. - - Add a check of the presence of the archive file before some actions (like list, ...) - - Add the initialisation of field "index" in header array. This means that by - default index will be -1 when not explicitly set by the methods. - - Version 1.2 : - - Adding a duplicate function. - - Adding a merge function. The merge function is a "quick merge" function, - it just append the content of an archive at the end of the first one. There - is no check for duplicate files or more recent files. - - Improve the search of the central directory end. - - Version 1.1.2 : - - - Changing the license of PclZip. PclZip is now released under the GNU / LGPL license - (see License section). - - Adding the optional support of a static temporary directory. You will need to configure - the constant PCLZIP_TEMPORARY_DIR if you want to use this feature. - - Improving the rename() function. In some cases rename() does not work (different - Filesystems), so it will be replaced by a copy() + unlink() functions. - - Version 1.1.1 : - - - Maintenance release, no new feature. - - Version 1.1 : - - - New method Add() : adding files in the archive - - New method ExtractByIndex() : partial extract of the archive, files are identified by - their index in the archive - - New method DeleteByIndex() : delete some files/folder entries from the archive, - files are identified by their index in the archive. - - Adding a test of the zlib extension presence. If not present abort the script. - - Version 1.0.1 : - - - No new feature - - -3 - Corrected bugs -================== - - Corrected in Version 2.0 : - - Corrected : During an extraction, if a call-back fucntion is used and try to skip - a file, all the extraction process is stopped. - - Corrected in Version 1.3 : - - Corrected : Support of static synopsis for method extract() is broken. - - Corrected : invalid size of archive content field (0xFF) should be (0xFFFF). - - Corrected : When an extract is done with a remove_path parameter, the entry for - the directory with exactly the same path is not skipped/filtered. - - Corrected : extractByIndex() and deleteByIndex() were not managing index in the - right way. For example indexes '1,3-5,11' will only extract files 1 and 11. This - is due to a sort of the index resulting table that puts 11 before 3-5 (sort on - string and not interger). The sort is temporarilly removed, this means that - you must provide a sorted list of index ranges. - - Corrected in Version 1.2 : - - - Nothing. - - Corrected in Version 1.1.2 : - - - Corrected : Winzip is unable to delete or add new files in a PclZip created archives. - - Corrected in Version 1.1.1 : - - - Corrected : When archived file is not compressed (0% compression), the - extract method fails. - - Corrected in Version 1.1 : - - - Corrected : Adding a complete tree of folder may result in a bad archive - creation. - - Corrected in Version 1.0.1 : - - - Corrected : Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024). - - -4 - Known bugs or limitations -============================= - - Please publish bugs reports in SourceForge : - http://sourceforge.net/tracker/?group_id=40254&atid=427564 - - In Version 2.x : - - PclZip does only support file uncompressed or compressed with deflate (compression method 8) - - PclZip does not support password protected zip archive - - Some concern were seen when changing mtime of a file while archiving. - Seems to be linked to Daylight Saving Time (PclTest_changing_mtime). - - In Version 1.2 : - - - merge() methods does not check for duplicate files or last date of modifications. - - In Version 1.1 : - - - Limitation : Using 'extract' fields in the file header in the zip archive is not supported. - - WinZip is unable to delete a single file in a PclZip created archive. It is also unable to - add a file in a PclZip created archive. (Corrected in v.1.2) - - In Version 1.0.1 : - - - Adding a complete tree of folder may result in a bad archive - creation. (Corrected in V.1.1). - - Path given to methods must be in the unix format (/) and not the Windows format (\). - Workaround : Use only / directory separators. - - PclZip is using temporary files that are sometime the name of the file with a .tmp or .gz - added suffix. Files with these names may already exist and may be overwritten. - Workaround : none. - - PclZip does not check if the zlib extension is present. If it is absent, the zip - file is not created and the lib abort without warning. - Workaround : enable the zlib extension on the php install - - In Version 1.0 : - - - Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024). - (Corrected in v.1.0.1) - - Limitation : Multi-disk zip archive are not supported. - - -5 - License -=========== - - Since version 1.1.2, PclZip Library is released under GNU/LGPL license. - This library is free, so you can use it at no cost. - - HOWEVER, if you release a script, an application, a library or any kind of - code using PclZip library (or a part of it), YOU MUST : - - Indicate in the documentation (or a readme file), that your work - uses PclZip Library, and make a reference to the author and the web site - http://www.phpconcept.net - - Gives the ability to the final user to update the PclZip libary. - - I will also appreciate that you send me a mail (vincent@phpconcept.net), just to - be aware that someone is using PclZip. - - For more information about GNU/LGPL license : http://www.gnu.org - -6 - Warning -================= - - This library and the associated files are non commercial, non professional work. - It should not have unexpected results. However if any damage is caused by this software - the author can not be responsible. - The use of this software is at the risk of the user. - -7 - Documentation -================= - PclZip User Manuel is available in English on PhpConcept : http://www.phpconcept.net/pclzip/man/en/index.php - A Russian translation was done by Feskov Kuzma : http://php.russofile.ru/ru/authors/unsort/zip/ - -8 - Author -========== - - This software was written by Vincent Blavet (vincent@phpconcept.net) on its leasure time. - -9 - Contribute -============== - If you want to contribute to the development of PclZip, please contact vincent@phpconcept.net. - If you can help in financing PhpConcept hosting service, please go to - http://www.phpconcept.net/soutien.php diff --git a/3.1/modules/themeroller/module.info b/3.1/modules/themeroller/module.info deleted file mode 100755 index aaa16bd6..00000000 --- a/3.1/modules/themeroller/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "Theme Roller" -description = "Use a JQuery UI theme to create a Gallery3 Theme" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:themeroller" -discuss_url = "http://gallery.menalto.com/forum_module_themeroller" diff --git a/3.1/modules/themeroller/views/admin_screen.css.php b/3.1/modules/themeroller/views/admin_screen.css.php deleted file mode 100644 index 54ea97f4..00000000 --- a/3.1/modules/themeroller/views/admin_screen.css.php +++ /dev/null @@ -1,1428 +0,0 @@ -/** - * Gallery 3 Admin Redmond Theme Screen Styles - * - * @requires YUI reset, font, grids CSS - * - * Sheet organization: - * 1) Basic HTML elements - * 2) Reusable content blocks - * 3) Page layout containers - * 4) Content blocks in specific layout containers - * 5) States and interactions - * 6) Positioning and order - * 7) Navigation and menus - * 8) jQuery and jQuery UI - * 9) Module color overrides - * 10) Right-to-left language styles - * - * @todo Review g-buttonset-vertical - */ - -/** ******************************************************************* - * 1) Basic HTML elements - **********************************************************************/ -html { - color: #; -} - -body, html { - background-color: #; - font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; /* ffDefault */ - //font-size: 13px/1.231; /* fsDefault/ gallery_line_height */ -} - -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; -} - -h3 { - font-size: 1.2em; -} - -/* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -a, -.g-menu a, -#g-dialog a, -.g-button, -.g-button:active { - color: # !important; - text-decoration: none; - -moz-outline-style: none; -} - -a:hover, -.g-button:hover, -a.ui-state-hover, -input.ui-state-hover, -button.ui-state-hover { - color: # !important; - text-decoration: none; - -moz-outline-style: none; -} - -a:hover, -#g-dialog a:hover { - text-decoration: underline; -} - -.g-menu a:hover { - text-decoration: none; -} - -/* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -form { - margin: 0; -} - -fieldset { - border: 1px solid #; - padding: 0 1em .8em 1em; -} - -#g-banner fieldset, -#g-sidebar fieldset { - border: none; - padding: 0; -} - -legend { - font-weight: bold; - color: #; - padding: 0 .2em; -} - -#g-banner legend, -#g-sidebar legend, -input[type="hidden"] { - display: none; -} - -input.textbox, -input[type="text"], -input[type="password"], -textarea { - background-color: #; - border: 1px solid #; - border-top-color: #; - border-left-color: #; - clear: both; - color: #; - width: 50%; -} - -textarea { - height: 12em; - width: 97%; -} - -input:focus, -input.textbox:focus, -input[type=text]:focus, -textarea:focus, -option:focus { - background-color: #; - color: #; -} - -input.checkbox, -input[type=checkbox], -input.radio, -input[type=radio] { - float: left; - margin-right: .4em; -} - -/* Form layout ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -form li { - margin: 0; - padding: 0 0 .2em 0; -} - -form ul { - margin-top: 0; -} - -form ul ul { - clear: both; -} - -form ul ul li { - float: left; -} - -input, -select, -textarea { - display: block; - clear: both; - padding: .2em; -} - -input[type="submit"], -input[type="reset"] { - display: inline; - clear: none; - float: left; -} - -/* Forms in dialogs and panels ~~~~~~~~~ */ - -#g-dialog ul li { - padding-bottom: .8em; -} - -#g-dialog fieldset, -#g-panel fieldset { - border: none; - padding: 0; -} - -#g-panel legend { - display: none; -} - -label, -input[readonly] { - background-color: #; - color: #; -} - -#g-dialog input.textbox, -#g-dialog input[type=text], -#g-dialog input[type=password], -#g-dialog textarea { - width: 97%; -} - -/* Short forms ~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-short-form legend, -.g-short-form label { - display: none; -} - -.g-short-form fieldset { - border: none; - padding: 0; -} - -.g-short-form li { - float: left; - margin: 0 !important; - padding: .4em 0; -} - -.g-short-form .textbox, -.g-short-form input[type=text] { - background-color: ; - color: #; - padding: .3em .6em; - width: 100%; -} - -.g-short-form .textbox.g-error { - border: 1px solid #; - color: #; - padding-left: 24px; -} - -.g-short-form .g-cancel { - display: block; - margin: .3em .8em; -} - -#g-sidebar .g-short-form li { - padding-left: 0; - padding-right: 0; -} - -fieldset { - margin-bottom: 1em; -} - -#g-content form ul li { - padding: .4em 0; -} - -#g-dialog form { - width: 270px; -} - -#g-dialog fieldset { - margin-bottom: 0; -} - -/* Tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -table { - width: 100%; -} - -#g-content table { - margin: .6em 0 2em 0; -} - -caption, -th { - text-align: left; -} - -th, -td { - border: none; - border-bottom: 1px solid #; - padding: .5em; - vertical-align: middle; -} - -th { - vertical-align: bottom; - white-space: nowrap; -} - -/* Text ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -.g-text-small { - font-size: .8em; -} - -.g-text-big { - font-size: 1.2em; -} - -.g-text-right { - text-align: right; -} - -/** ******************************************************************* - * 2) Reusable content blocks - *********************************************************************/ - -.g-block, -#g-content #g-admin-dashboard .g-block { - background-color: #; - border: 1px solid #; - padding: 1em; -} - -.g-block h2 { - background-color: #; - padding: .3em .8em; -} - -.g-block-content { - margin-top: 1em; -} - -#g-content .g-block { - border: none; - padding: 0; -} - -#g-sidebar .g-block-content { - padding: 0; -} - -#g-content .g-selected, -#g-content .g-available .g-block { - border: 1px solid #; - padding: .8em; -} - -.g-selected img, -.g-available .g-block img { - float: left; - margin: 0 1em 1em 0; -} - -.g-selected { - background: #; -} - -.g-available .g-installed-toolkit:hover { - cursor: pointer; - background: #; -} - -.g-available .g-button { - width: 96%; -} - -.g-selected .g-button { - display: none; -} - -.g-unavailable { - border-color: #; - color: ; - opacity: 0.4; -} - -.g-info td { - background-color: transparent; - background-image: none; -} - -.g-success td { - background-color: transparent; - background-image: none; -} - -.g-error td { - background-color: #; - color: #; - background-image: none; -} - -.g-warning td { - background-color: # !important; - background-image: none; -} - -.g-module-status.g-info, -#g-log-entries .g-info, -.g-module-status.g-success, -#g-log-entries .g-success { - background-color: #; -} - -ul.enumeration li { - list-style-type: disc; - margin-left: 20px; -} - -/*** ****************************************************************** - * 3) Page layout containers - *********************************************************************/ -/* Dimension and scale ~~~~~~~~~~~~~~~~~~~ */ -.g-one-quarter { - width: 25%; -} - -.g-one-third { - width: 33%; -} - -.g-one-half { - width: 50%; -} - -.g-two-thirds { - width: 66%; -} - -.g-three-quarters { - width: 75%; -} - -.g-whole { - width: 100%; -} - -/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-header #g-login-menu { - margin-top: 1em; - float: right; -} - -/* View container ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-view { - background-color: #; - border: 1px solid #; - border-bottom: none; - min-width: 974px !important; -} - -/* Layout containers ~~~~~~~~~~~~~~~~~~~~~ */ - -#g-header { - background-color: #; - border-bottom: 1px solid #; - color: #; - font-size: .8em; - margin-bottom: 20px; - padding: 0 20px; - position: relative; -} - -#g-content { - font-size: 1.1em; - padding: 0 2em; - width: 96%; -} - -#g-sidebar { - background-color: #; - font-size: .9em; - padding: 0 20px; - width: 220px; -} - -#g-footer { - background-color: #; - border-top: 1px solid #; - color: #; - font-size: .8em; - margin-top: 20px; - padding: 10px 20px; -} - -/** ******************************************************************* - * 4) Content blocks in specific layout containers - *********************************************************************/ - -/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-header #g-logo { - background: transparent url('../../../lib/images/logo.png') no-repeat 0 .5em; - color: # !important; - display: block; - height: 65px; - padding-top: 5px; - width: 105px; -} - -#g-header #g-logo:hover { - color: # !important; - text-decoration: none; -} - -#g-login-menu li a { - color: # !important; -} - -#g-content .g-block h2 { - background-color: transparent; - padding-left: 0; -} - -#g-sidebar .g-block-content { - padding-left: 1em; -} - -.g-block .ui-dialog-titlebar { - margin: -1em -1em 0; -} - -#g-sidebar .g-block h2 { - background: none; -} - -/* Photo stream ~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-photo-stream { - background-color: #; -} - -#g-photo-stream .g-block-content ul { - border-right: 1px solid #; - height: 135px; - overflow: auto; - overflow: -moz-scrollbars-horizontal; /* for FF */ - overflow-x: scroll; /* scroll horizontal */ - overflow-y: hidden; /* Hide vertical*/ -} - -#g-content #g-photo-stream .g-item { - background-color: #; - border: 1px solid #; - border-right-color: #; - border-bottom-color: #; - float: left; - height: 90px; - overflow: hidden; - text-align: center; - width: 90px; -} - -#g-content .g-item { - background-color: #; - border: 1px solid #; - border-right-color: #; - border-bottom-color: #; - height: 90px; - padding: 14px 8px; - text-align: center; - width: 90px; -} - -/* Graphics settings ~~~~~~~~~~~~~~~~~~~~~ */ - -#g-admin-graphics .g-available .g-block { - clear: none; - float: left; - margin-right: 1em; - width: 30%; -} - -/* Appearance settings ~~~~~~~~~~~~~~~~~~~ */ - -#g-site-theme, -#g-admin-theme { - float: left; - width: 48%; -} - -#g-site-theme { - margin-right: 1em; -} - -/* Block admin ~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-admin-blocks-list { - float: left; - margin: 0 2em 2em 0; - width: 30%; -} - -.g-admin-blocks-list div:last-child { - border: .1em solid; - height: 100%; -} - -.g-admin-blocks-list ul { - height: 98%; - margin: .1em .1em; - padding: .1em; -} - -.g-admin-blocks-list ul li.g-draggable { - background-color: #; - margin: .5em; - padding: .3em .8em; -} - -/* In-line editing ~~~~~~~~~~~~~~~~~~~~~~ */ -#g-in-place-edit-message { - background-color: #; -} - -/* Theme options ~~~~~~~~~~~~~~~~~~~~~~~~ */ -#g-theme-options-form { - border: 1px solid #; -} -#g-theme-options-form-tabs { - border: none !important; -} -#g-theme-options-form fieldset { - border: none; -} - -.ui-tabs .ui-tabs-nav li a { - padding: 0 1em; -} - -.ui-tabs .ui-tabs-nav li a.g-error { - background: none no-repeat scroll 0 0 transparent; - color: # !important; -} - -/* Footer content ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-footer #g-credits li a { - color: # !important; -} - -/* Language options ~~~~~~~~~~~~~~~~~~~~~~~~ */ -#g-share-translations-form fieldset { - border: 0px; - margin: 0px; - padding: 0px; -} - -#g-share-translations-form fieldset legend { - display: none; -} - -/** ******************************************************************* - * 5) States and interactions - **********************************************************************/ - -.g-draggable:hover { - border: 1px dashed #; -} - -.ui-sortable .g-target, -.ui-state-highlight { - background-color: #; - border: 2px dotted #; -} - -.g-active, -.g-enabled, -.g-available, -.g-selected, -.g-highlight { - font-weight: bold; -} - -.g-inactive, -.g-disabled, -.g-unavailable, -.g-uneditable, -.g-locked, -.g-deselected, -.g-understate { - color: #; - font-weight: normal; -} - -.g-editable:hover { - background-color: #; - color: # -} - -form li.g-error, -form li.g-info, -form li.g-success, -form li.g-warning { - background-image: none; -} - - -form.g-error input[type="text"], -li.g-error input[type="text"], -form.g-error input[type="password"], -li.g-error input[type="password"], -form.g-error input[type="checkbox"], -li.g-error input[type="checkbox"], -form.g-error input[type="radio"], -li.g-error input[type="radio"], -form.g-error textarea, -li.g-error textarea, -form.g-error select, -li.g-error select { - border: 2px solid #; -} - -.g-error, -.g-denied, -tr.g-error td.g-error, -#g-add-photos-status .g-error { - background: # url('../images/ico-error.png') no-repeat .4em 50%; - color: #; -} - -.g-info { - background: # url('../images/ico-info.png') no-repeat .4em 50%; -} - -.g-success, -.g-allowed, -#g-add-photos-status .g-success { - background: # url('../images/ico-success.png') no-repeat .4em 50%; -} - -tr.g-success { - background-image: none; -} - -tr.g-success td.g-success { - background-image: url('../images/ico-success.png'); -} - -.g-warning, -tr.g-warning td.g-warning { - background: # url('../images/ico-warning.png') no-repeat .4em 50% !important; - color: # !important; -} - -form .g-error { - background-color: #; -} - -.g-default { - background-color: #; - font-weight: bold; -} - -.g-draggable:hover { - border: 1px dashed #; -} - -.ui-sortable .g-target, -.ui-state-highlight { - background-color: #; - border: 2px dotted #; -} - -/* Ajax loading indicator ~~~~~~~~~~~~~~~~ */ - -.g-loading-large, -.g-dialog-loading-large { - background: # url('../images/loading-large.gif') no-repeat center center !important; -} - -.g-loading-small { - background: # url('../images/loading-small.gif') no-repeat center center !important; -} - -/** ******************************************************************* - * 6) Positioning and order - **********************************************************************/ - -.g-left { - clear: none; - float: left; -} - -.g-right { - clear: none; - float: right; -} - -.g-first { -} - -.g-last { -} - -.g-even { - background-color: #; -} - -.g-odd { - background-color: #; -} - - -/** ******************************************************************* - * 7) Navigation and menus - *********************************************************************/ - -/* Login menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-banner #g-login-menu { - color: #; - float: right; -} - -#g-banner #g-login-menu li { - padding-left: 1.2em; -} - -/* Site Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-site-admin-menu { - bottom: 0; - font-size: 1.2em; - left: 140px; - position: absolute; -} - -#g-site-admin-menu ul { - margin-bottom: 0; -} - -/** ******************************************************************* - * 8) jQuery and jQuery UI - *********************************************************************/ -/* Generic block container ~~~~~~~~~~~~~~~ */ - -.g-block { - clear: both; - margin-bottom: 2.5em; -} - -.g-block-content { -} - -/* Buttons ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-button { - display: inline-block; - margin: 0 4px 0 0; - padding: .2em .4em; -} - -.g-button, -.g-button:hover, -.g-button:active { - cursor: pointer !important; - outline: 0; - text-decoration: none; - -moz-outline-style: none; -} - -button { - padding: 2px 4px 2px 4px; -} - -/* jQuery UI ThemeRoller buttons ~~~~~~~~~ */ - -.g-buttonset { - padding-left: 1px; -} - -.g-buttonset li { - float: left; -} - -.g-buttonset .g-button { - margin: 0; -} - -.ui-icon-left .ui-icon { - float: left; - margin-right: .2em; -} - -.ui-icon-right .ui-icon { - float: right; - margin-left: .2em; -} - -/* Rotate icon, ThemeRoller only provides one of these */ - -.ui-icon-rotate-ccw { - background-position: -192px -64px; -} - -.ui-icon-rotate-cw { - background-position: -208px -64px; -} - -.g-progress-bar { - height: 1em; - width: 100%; - margin-top: .5em; - display: inline-block; -} - -/* Status and validation messages ~~~~ */ - -.g-message-block { - background-position: .4em .3em; - border: 1px solid #ccc; - padding: 0; -} - -#g-action-status { - margin-bottom: 1em; -} - -#g-action-status li, -p#g-action-status, -div#g-action-status { - padding: .3em .3em .3em 30px; -} - -#g-site-status li { - border-bottom: 1px solid #ccc; - padding: .3em .3em .3em 30px; -} - -.g-module-status { - clear: both; - margin-bottom: 1em; -} - -.g-message { - background-position: 0 50%; -} - -/* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-breadcrumbs { - clear: both; - padding: 0 20px; -} - -.g-breadcrumbs li { - background: transparent url('../images/ico-separator.png') no-repeat scroll left center; - float: left; - padding: 1em 8px 1em 18px; -} - -.g-breadcrumbs .g-first { - background: none; - padding-left: 0; -} - -.g-breadcrumbs li a, -.g-breadcrumbs li span { - display: block; -} - -#g-dialog ul.g-breadcrumbs { - margin-left: 0; - padding-left: 0; -} - -/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-paginator { - padding: .2em 0; - width: 100%; -} - -.g-paginator li { - float: left; - width: 30%; -} - -.g-paginator .g-info { - background: none; - padding: .2em 0; - text-align: center; - width: 40%; -} - -/* Dialogs and panels ~~~~~~~~~~~~~~~~~~ */ - -#g-dialog { - text-align: left; -} - -#g-dialog legend { - display: none; -} - -#g-dialog .g-cancel { - margin: .4em 1em; -} - -#g-panel { - display: none; - padding: 1em; -} - -/* Inline layout ~~~~~~~~~~ */ - -.g-inline li { - float: left; - margin-left: 1.8em; - padding-left: 0 !important; -} - -.g-inline li.g-first { - margin-left: 0; -} - -/* Superfish menu overrides ~~~~~~~~~~~~~~ */ -.sf-menu ul { - width: 12em; -} - -ul.sf-menu li li:hover ul, -ul.sf-menu li li.sfHover ul { - left: 12em; -} - -ul.sf-menu li li li:hover ul, -ul.sf-menu li li li.sfHover ul { - left: 12em; -} -.sf-menu a { - border-left:1px solid #; -} - -.sf-menu li, -.sf-menu li li, -.sf-menu li li ul li { - background-color: #; -} - -.sf-menu li:hover { - background-color: #; -} - -.sf-menu li:hover, -.sf-menu li.sfHover, -.sf-menu a:focus, -.sf-menu a:hover, -.sf-menu a:active { - background-color: # !important; -} - -.sf-sub-indicator { - background-image: url("themeroller/images/ui-icons__256x240.png"); - height: 16px; - width: 16px; -} - -a > .sf-sub-indicator { - background-position: -64px -16px !important; - top: 0.6em; -} - -.sf-menu ul a > .sf-sub-indicator { - background-position: -32px -16px !important; -} - -/* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */ - -.ui-widget-overlay { - background: #; - opacity: .7; -} - -#g-admin-dashboard .ui-state-highlight, -#g-sidebar .ui-state-highlight { - height: 2em; - margin-bottom: 1em; -} - -.g-buttonset-vertical a { - width: 8em !important; -} - -#g-admin-dashboard .ui-dialog-titlebar, -#g-admin-dashboard-sidebar .ui-dialog-titlebar { - padding: .2em .4em; -} - -/** ******************************************************************* - * 9) Module color overrides - *********************************************************************/ - -/* User admin form ~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#g-user-admin-list .g-admin { - color: # !important; - font-weight: bold; -} - -.g-group { - border: 1px solid # !important; -} - -.g-group h4 { - background-color: # !important; - border-bottom: 1px dashed # !important; -} - -.g-default-group h4, -.g-default-group .g-user { - color: # !important; -} - -/** ******************************************************************* - * 10) Right to left styles - *********************************************************************/ - -.rtl { - direction: rtl; -} - -.rtl #g-header, -.rtl #g-content, -.rtl #g-sidebar, -.rtl #g-footer, -.rtl caption, -.rtl th, -.rtl #g-dialog, -.rtl .g-context-menu li a, -.rtl .g-message-box li, -.rtl #g-site-status li { - text-align: right; -} - -.rtl .g-text-right { - text-align: left; -} - -.rtl .g-error, -.rtl .g-info, -.rtl .g-success, -.rtl .g-warning, -.rtl #g-add-photos-status .g-success, -.rtl #g-add-photos-status .g-error { - background-position: center right; - padding-right: 30px !important; -} - -.rtl form li.g-error, -.rtl form li.g-info, -.rtl form li.g-success, -.rtl form li.g-warning { - padding-right: 0 !important; -} - -.rtl .g-left, -.rtl .g-inline li, -.rtl #g-content #g-album-grid .g-item, -.rtl .sf-menu li, -.rtl .g-breadcrumbs li, -.rtl .g-paginator li, -.rtl .g-buttonset li, -.rtl .ui-icon-left .ui-icon, -.rtl .g-short-form li, -.rtl form ul ul li, -.rtl input[type="submit"], -.rtl input[type="reset"], -.rtl input.checkbox, -.rtl input[type=checkbox], -.rtl input.radio, -.rtl input[type=radio] { - float: right; -} - -.rtl .g-right, -.rtl .ui-icon-right .ui-icon { - float: left; -} - -.rtl .g-inline li { - margin-right: 1em; -} - -.rtl .g-inline li.g-first { - margin-right: 0; -} - -.rtl .g-breadcrumbs li { - background: transparent url('../images/ico-separator-rtl.png') no-repeat scroll right center; - padding: 1em 18px 1em 8px; -} - -.rtl .g-breadcrumbs .g-first { - background: none; - padding-right: 0; -} - -.rtl input.checkbox { - margin-left: .4em; -} - -.rtl #g-add-comment { - right: inherit; - left: 0; -} - -.rtl .ui-icon-left .ui-icon { - margin-left: .2em; -} - -.rtl .ui-icon-right .ui-icon { - margin-right: .2em; -} - -/* RTL Corner radius ~~~~~~~~~~~~~~~~~~~~~~ */ -.rtl .g-buttonset .ui-corner-tl { - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - border-top-left-radius: 0; - -moz-border-radius-topright: 5px !important; - -webkit-border-top-right-radius: 5px !important; - border-top-right-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-tr { - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -moz-border-radius-topleft: 5px !important; - -webkit-border-top-left-radius: 5px !important; - border-top-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-bl { - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 5px !important; - -webkit-border-bottom-right-radius: 5px !important; - border-bottom-right-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-br { - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomleft: 5px !important; - -webkit-border-bottom-left-radius: 5px !important; - border-bottom-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-right, -.rtl .ui-progressbar .ui-corner-right { - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -moz-border-radius-topleft: 5px !important; - -webkit-border-top-left-radius: 5px !important; - border-top-left-radius: 5px !important; - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomleft: 5px !important; - -webkit-border-bottom-left-radius: 5px !important; - border-bottom-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-left, -.rtl .ui-progressbar .ui-corner-left { - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - border-top-left-radius: 0; - -moz-border-radius-topright: 5px !important; - -webkit-border-top-right-radius: 5px !important; - border-top-right-radius: 5px !important; - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 5px !important; - -webkit-border-bottom-right-radius: 5px !important; - border-bottom-right-radius: 5px !important; -} - -/* RTL Superfish ~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.rtl .sf-menu a { - border-left: none; - border-right:1px solid #; -} - -.rtl .sf-menu a.sf-with-ul { - padding-left: 2.25em; - padding-right: 1em; -} - -.rtl .sf-sub-indicator { - background: url("themeroller/images/ui-icons__256x240.png") no-repeat -96px -16px; /* 8-bit indexed alpha png. IE6 gets solid image only */ - left: .75em !important; - right: auto; -} - -.rtl a > .sf-sub-indicator { /* give all except IE6 the correct values */ - top: .8em; - background-position: -10px -100px; /* use translucent arrow for modern browsers*/ -} -/* apply hovers to modern browsers */ -.rtl a:focus > .sf-sub-indicator, -.rtl a:hover > .sf-sub-indicator, -.rtl a:active > .sf-sub-indicator, -.rtl li:hover > a > .sf-sub-indicator, -.rtl li.sfHover > a > .sf-sub-indicator { - background-position: 0 -100px; /* arrow hovers for modern browsers*/ -} - -/* point right for anchors in subs */ -.rtl .sf-menu ul .sf-sub-indicator { background-position: 0 0; } -.rtl .sf-menu ul a > .sf-sub-indicator { background-position: -10px 0; } -/* apply hovers to modern browsers */ -.rtl .sf-menu ul a:focus > .sf-sub-indicator, -.rtl .sf-menu ul a:hover > .sf-sub-indicator, -.rtl .sf-menu ul a:active > .sf-sub-indicator, -.rtl .sf-menu ul li:hover > a > .sf-sub-indicator, -.rtl .sf-menu ul li.sfHover > a > .sf-sub-indicator { - background-position: 0 0; /* arrow hovers for modern browsers*/ -} - -.rtl .sf-menu li:hover ul, -.rtl .sf-menu li.sfHover ul { - right: 0; - left: auto; -} - -.rtl ul.sf-menu li li:hover ul, -.rtl ul.sf-menu li li.sfHover ul { - right: 12em; /* match ul width */ - left: auto; -} -.rtl ul.sf-menu li li li:hover ul, -.rtl ul.sf-menu li li li.sfHover ul { - right: 12em; /* match ul width */ - left: auto; -} - -/*** shadows for all but IE6 ***/ -.rtl .sf-shadow ul { - background: url('../images/superfish-shadow.png') no-repeat bottom left; - border-top-right-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-topright: 0; - -moz-border-radius-bottomleft: 0; - -webkit-border-top-right-radius: 0; - -webkit-border-bottom-left-radius: 0; - -moz-border-radius-topleft: 17px; - -moz-border-radius-bottomright: 17px; - -webkit-border-top-left-radius: 17px; - -webkit-border-bottom-right-radius: 17px; - border-top-left-radius: 17px; - border-bottom-right-radius: 17px; -} - -/* RTL ThemeRoller ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.rtl .ui-dialog .ui-dialog-titlebar { - padding: 0.5em 1em 0.3em 0.3em; -} - -.rtl .ui-dialog .ui-dialog-title { - float: right; -} - -.rtl .ui-dialog .ui-dialog-titlebar-close { - left: 0.3em; - right: auto; -} - -.rtl #g-content #g-album-grid .g-item, -.rtl #g-site-theme, -.rtl #g-admin-theme, -.rtl .g-selected img, -.rtl .g-available .g-block img, -.rtl #g-content #g-photo-stream .g-item, -.rtl li.g-group, -.rtl #g-server-add-admin { - float: right; -} - -.rtl #g-admin-graphics .g-available .g-block { - float: right; - margin-left: 1em; - margin-right: 0em; -} - -.rtl #g-site-admin-menu { - left: auto; - right: 150px; -} - -.rtl #g-header #g-login-menu { - float: left; -} - -.rtl #g-header #g-login-menu li { - margin-left: 0; - padding-left: 0; - padding-right: 1.2em; -} - -.rtl .g-selected img, -.rtl .g-available .g-block img { - margin: 0 0 1em 1em; -} - diff --git a/3.1/modules/themeroller/views/admin_themeroller.html.php b/3.1/modules/themeroller/views/admin_themeroller.html.php deleted file mode 100755 index 3f81b15e..00000000 --- a/3.1/modules/themeroller/views/admin_themeroller.html.php +++ /dev/null @@ -1,79 +0,0 @@ - - - - -
        -

        - "post", "id" => "g-themeroller-form")) ?> -
        -
          -
        • - -
        • - -
        • - -
        • class="g-error"> - - - -

          - - -

          - -
        • -
        • class="g-error"> - - - -

          - -
        • -
        • class="g-error"> - - - -

          - -
        • -
        • - - -
        • -
        • - -
          - "zip_file", - "id" => "g-themeroller-zip", - "accept" => "application/zip, multipart/x-zip")) ?> - - - -
        • -
        -
        - -
        diff --git a/3.1/modules/themeroller/views/admin_themeroller_progress.html.php b/3.1/modules/themeroller/views/admin_themeroller_progress.html.php deleted file mode 100644 index 8bfd05ab..00000000 --- a/3.1/modules/themeroller/views/admin_themeroller_progress.html.php +++ /dev/null @@ -1,64 +0,0 @@ - - -
        -
        -

        name ?>

        -
        -
        - -
        -
        - - -
        -
        diff --git a/3.1/modules/themeroller/views/admin_themeroller_upload.html.php b/3.1/modules/themeroller/views/admin_themeroller_upload.html.php deleted file mode 100755 index a1931782..00000000 --- a/3.1/modules/themeroller/views/admin_themeroller_upload.html.php +++ /dev/null @@ -1,70 +0,0 @@ - - - - -
        -

        - "get", "id" => "g-themeroller-form")) ?> -
        -
          -
        • - -
        • - -
        • - -
        • -
        • - "is_admin", - "id" => "g-themeroller-is-admin")) ?> - -
        • -
        • - "zip_file", - "id" => "g-themeroller-zip", - "accept" => "application/zip, multipart/x-zip")) ?> - - - -
        • -
        -
        - -
        diff --git a/3.1/modules/themeroller/views/site_screen.css.php b/3.1/modules/themeroller/views/site_screen.css.php deleted file mode 100644 index 933f8c48..00000000 --- a/3.1/modules/themeroller/views/site_screen.css.php +++ /dev/null @@ -1,1539 +0,0 @@ - -/** - * Gallery 3 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) Positioning and order - * 7) Navigation and menus - * 8) jQuery and jQuery UI - * 9) Organize module style - * 10) Tag module styles - * 11) Right-to-left language styles - */ - -/** ******************************************************************* - * 1) Font sizes, base HTML elements - **********************************************************************/ -html { - color: #; -} - -body, html { - background-color: #; - font-family: ; -// font-size: 13px/1.231; /* gallery_line_height */ -} - -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:active { - color: # !important; /* fcDefault; */ - cursor: pointer !important; - text-decoration: none; - -moz-outline-style: none; -} - -a:hover, -.g-button:hover, -a.ui-state-hover, -input.ui-state-hover, -button.ui-state-hover { - color: # !important; /* fcHover */ - 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; -} - -/* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -form { - margin: 0; -} - -fieldset { - border: 1px solid #; - padding: 0 1em .8em 1em; -} - -#g-banner fieldset, -#g-sidebar fieldset { - border: none; - padding: 0; -} - -legend { - font-weight: bold; - color: #; -} - -#g-banner legend, -#g-sidebar legend, -input[type="hidden"] { - display: none; -} - -input.textbox, -input[type="text"], -input[type="password"], -textarea { - background-color: #; - border: 1px solid #; - border-top-color: #; - border-left-color: #; - clear: both; - color: #; - width: 50%; -} - -textarea { - height: 12em; - width: 97%; -} - -input:focus, -input.textbox:focus, -input[type=text]:focus, -textarea:focus, -option:focus { - background-color: #; - color: #; -} - - -input.checkbox, -input[type=checkbox], -input.radio, -input[type=radio] { - float: left; - margin-right: .4em; -} - -/* Form layout ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -form li { - margin: 0; - padding: 0 0 .2em 0; -} - -form ul { - margin-top: 0; -} - -form ul ul { - clear: both; -} - -form ul ul li { - float: left; -} - -input, -select, -textarea { - display: block; - clear: both; - padding: .2em; -} - -input[type="submit"], -input[type="reset"] { - display: inline; - clear: none; - float: left; -} - -/* Forms in dialogs and panels ~~~~~~~~~ */ - -#g-dialog ul li { - padding-bottom: .8em; -} - -#g-dialog fieldset, -#g-panel fieldset { - border: none; - padding: 0; -} - -#g-panel legend { - display: none; -} - -label, -input[readonly] { - background-color: #; - color: #; -} - -#g-dialog input.textbox, -#g-dialog input[type=text], -#g-dialog input[type=password], -#g-dialog textarea { - width: 97%; -} - -/* Short forms ~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-short-form legend, -.g-short-form label { - display: none; -} - -.g-short-form fieldset { - border: none; - padding: 0; -} - -.g-short-form li { - float: left; - margin: 0 !important; - padding: .4em 0; -} - -.g-short-form .textbox, -.g-short-form input[type=text] { - background-color: - color: #; -} - -.g-short-form .textbox.g-error { - border: 1px solid #; - color: #; -} - - -.g-short-form .g-cancel { - display: block; - margin: .3em .8em; -} - -#g-sidebar .g-short-form li { - padding-left: 0; - padding-right: 0; -} - -/* Tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -table { - width: 100%; -} - -#g-content table { - margin: 1em 0; -} - -caption, -th { - text-align: left; -} - -th, -td { - border: none; - border-bottom: 1px solid #; - padding: .5em; -} - -td { - vertical-align: top; -} - -/* Text ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -.g-text-small { - font-size: .8em; -} - -.g-text-big { - font-size: 1.2em; -} - -.g-text-right { - text-align: right; -} - -/** ******************************************************************* - * 2) Reusable content blocks - *********************************************************************/ - -.g-block h2 { - background-color: #; - padding: .3em .8em; -} - -.g-block-content { - margin-top: 1em; -} - -/** ******************************************************************* - * 3) Page layout containers - *********************************************************************/ - - -/* Dimension and scale ~~~~~~~~~~~~~~~~~~~ */ -.g-one-quarter { - width: 25%; -} - -.g-one-third { - width: 33%; -} - -.g-one-half { - width: 50%; -} - -.g-two-thirds { - width: 66%; -} - -.g-three-quarters { - width: 75%; -} - -.g-whole { - width: 100%; -} - -/* View container ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-view { - background-color: #; - border: 1px solid #; - border-bottom: none; -} - -/* Layout containers ~~~~~~~~~~~~~~~~~~~~~ */ - -#g-header { - margin-bottom: 1em; -} - -#g-banner { - background-color: #; - border-bottom: 1px solid #; - color: #; - 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: #; - border-top: 1px solid #; - margin-top: 20px; - padding: 10px 20px; - color: #; -} - -/* Status and validation messages ~~~~ */ - -.g-message-block { - border: 1px solid #; -} - -#g-site-status li { - border-bottom: 1px solid #; -} - -/* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-breadcrumbs li { - background: transparent url('../images/ico-separator.png') no-repeat scroll left center; -} - -.g-breadcrumbs .g-first { - background: none; -} - -/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-paginator { -} - -.g-paginator li { -} - -.g-paginator .g-info { - background: none; -} - -/* Dialogs and panels ~~~~~~~~~~~~~~~~~~ */ - -#g-dialog { - text-align: left; -} - -#g-dialog legend { - display: none; -} - -#g-dialog .g-cancel { - margin: .4em 1em; -} - -#g-panel { - display: none; - padding: 1em; -} - -/* Inline layout ~~~~~~~~~~ */ - -.g-inline li { - float: left; - margin-left: 1.8em; - padding-left: 0 !important; -} - -.g-inline li.g-first { - margin-left: 0; -} - -/** ******************************************************************* - * 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-login-menu li a { - color: # !important; -} - -/* Sidebar ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-sidebar .g-block-content { - padding-left: 1em; -} - -#g-sidebar #g-image-block { - overflow: hidden; -} - -/* Album content ~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-content #g-album-grid { - margin: 1em 0; - position: relative; - z-index: 1; -} - -#g-content #g-album-grid .g-item { - background-color: #; - border: 1px solid #; - 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: #; -} - -#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 #; - 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; -} - -/* Search results ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-content #g-search-results { - margin-top: 1em; - padding-top: 1em; -} - -/* 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 { - display: block; - margin: 0 auto; -} - -/* Footer content ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-footer #g-credits li { - padding-right: 1.2em; -} - -#g-footer #g-credits li a { - color: # !important; -} - -/* In-line editing ~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-in-place-edit-message { - background-color: #; -} - -/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#g-edit-permissions-form td { - background-image: none; -} - -#g-edit-permissions-form fieldset { - border: 1px solid #; -} - -#g-permissions .g-denied { - background-color: transparent; -} - -#g-permissions .g-allowed { - background-color: transparent; -} - -.g-allowed a { - background-image: url("themeroller/images/ui-icons__256x240.png") !important; - display:inline-block; - margin: auto; -} - -.g-denied a { - background-image: url("themeroller/images/ui-icons__256x240.png") !important; - display:inline-block; - margin: auto; -} - -.g-denied a.g-passive, -.g-allowed a.g-passive { - filter:Alpha(Opacity=35); - opacity: .55; -} - -#g-permissions .g-active a { - border: 1px solid #; - background: #; -} - -/** ******************************************************************* - * 5) States and interactions - **********************************************************************/ - -.g-active, -.g-enabled, -.g-available, -.g-selected, -.g-highlight { - font-weight: bold; -} - -.g-inactive, -.g-disabled, -.g-unavailable, -.g-uneditable, -.g-locked, -.g-deselected, -.g-understate { - color: #; - font-weight: normal; -} - -.g-editable:hover { - background-color: #; - color: # -} - -form li.g-error, -form li.g-info, -form li.g-success, -form li.g-warning { - background-image: none; -} - -form.g-error input[type="text"], -li.g-error input[type="text"], -form.g-error input[type="password"], -li.g-error input[type="password"], -form.g-error input[type="checkbox"], -li.g-error input[type="checkbox"], -form.g-error input[type="radio"], -li.g-error input[type="radio"], -form.g-error textarea, -li.g-error textarea, -form.g-error select, -li.g-error select { - border: 2px solid #; -} - -.g-error, -tr.g-error td.g-error, -#g-add-photos-status .g-error { - background: # url('../images/ico-error.png') no-repeat .4em 50%; - color: #; -} - -.g-info { - background: # url('../images/ico-info.png') no-repeat .4em 50%; -} - -.g-success, -#g-add-photos-status .g-success { - background: # url('../images/ico-success.png') no-repeat .4em 50%; -} - -tr.g-success { - background-image: none; -} - -tr.g-success td.g-success { - background-image: url('../images/ico-success.png'); -} - -.g-warning, -tr.g-warning td.g-warning { - background: # url('../images/ico-warning.png') no-repeat .4em 50%; - color: #; -} - -form .g-error { - background-color: #; -} - -.g-default { - background-color: #; - font-weight: bold; -} - -.g-draggable:hover { - border: 1px dashed #; -} - -.ui-sortable .g-target, -.ui-state-highlight { - background-color: #; - border: 2px dotted #; -} - -/* Ajax loading indicator ~~~~~~~~~~~~~~~~ */ - -.g-loading-large, -.g-dialog-loading-large { - background: # url('../images/loading-large.gif') no-repeat center center !important; -} - -.g-loading-small { - background: # url('../images/loading-small.gif') no-repeat center center !important; -} - -/** ******************************************************************* - * 6) Positioning and order - **********************************************************************/ - -.g-left { - clear: none; - float: left; -} - -.g-right { - clear: none; - float: right; -} - -.g-first { -} - -.g-last { -} - -.g-even { - background-color: #; -} - -.g-odd { - background-color: #; -} - -/** ******************************************************************* - * 7) Navigation and menus - *********************************************************************/ - -/* Login menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-banner #g-login-menu { - color: #; - 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: #; - 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'); -} - -/** ******************************************************************* - * 8) jQuery and jQuery UI - *********************************************************************/ - -/* Generic block container ~~~~~~~~~~~~~~~ */ - -.g-block { - clear: both; - margin-bottom: 2.5em; -} - -.g-block-content { -} - -/* Superfish menu overrides ~~~~~~~~~~~~~~ */ -.sf-menu ul { - width: 12em; -} - -ul.sf-menu li li:hover ul, -ul.sf-menu li li.sfHover ul { - left: 12em; -} - -ul.sf-menu li li li:hover ul, -ul.sf-menu li li li.sfHover ul { - left: 12em; -} - -.sf-menu a { - border-left:1px solid #; -} - -.sf-menu li, -.sf-menu li li, -.sf-menu li li ul li { - background-color: #; -} - -.sf-menu li:hover { - background-color: #; -} - -.sf-menu li:hover, -.sf-menu li.sfHover, -.sf-menu a:focus, -.sf-menu a:hover, -.sf-menu a:active { - background-color: # !important; -} - -.sf-sub-indicator { - background-image: url("themeroller/images/ui-icons__256x240.png"); - height: 16px; - width: 16px; -} - -a > .sf-sub-indicator { - background-position: -64px -16px !important; - top: 0.6em; -} - -.sf-menu ul a > .sf-sub-indicator { - background-position: -32px -16px !important; -} - -/* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */ - -.ui-widget-overlay { - background: #; - opacity: .7; -} - -/* Buttons ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-button { - display: inline-block; - margin: 0 4px 0 0; - padding: .2em .4em; -} - -.g-button, -.g-button:hover, -.g-button:active { - cursor: pointer !important; - outline: 0; - text-decoration: none; - -moz-outline-style: none; -} - -button { - padding: 2px 4px 2px 4px; -} - -/* jQuery UI ThemeRoller buttons ~~~~~~~~~ */ - -.g-buttonset { - padding-left: 1px; -} - -.g-buttonset li { - float: left; -} - -.g-buttonset .g-button { - margin: 0; -} - -.ui-icon-left .ui-icon { - float: left; - margin-right: .2em; -} - -.ui-icon-right .ui-icon { - float: right; - margin-left: .2em; -} - -/* Rotate icon, ThemeRoller only provides one of these */ - -.ui-icon-rotate-ccw { - background-position: -192px -64px; -} - -.ui-icon-rotate-cw { - background-position: -208px -64px; -} - -.g-progress-bar { - height: 1em; - width: 100%; - margin-top: .5em; - display: inline-block; -} - -/* Status and validation messages ~~~~ */ - -.g-message-block { - background-position: .4em .3em; - border: 1px solid #ccc; - padding: 0; -} - -#g-action-status { - margin-bottom: 1em; -} - -#g-action-status li, -p#g-action-status, -div#g-action-status { - padding: .3em .3em .3em 30px; -} - -#g-site-status li { - border-bottom: 1px solid #ccc; - padding: .3em .3em .3em 30px; -} - -.g-module-status { - clear: both; - margin-bottom: 1em; -} - -.g-message { - background-position: 0 50%; -} - -/* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-breadcrumbs { - clear: both; - padding: 0 20px; -} - -.g-breadcrumbs li { - background: transparent url('../images/ico-separator.png') no-repeat scroll left center; - float: left; - padding: 1em 8px 1em 18px; -} - -.g-breadcrumbs .g-first { - background: none; - padding-left: 0; -} - -.g-breadcrumbs li a, -.g-breadcrumbs li span { - display: block; -} - -#g-dialog ul.g-breadcrumbs { - margin-left: 0; - padding-left: 0; -} - -/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-paginator { - padding: .2em 0; - width: 100%; -} - -.g-paginator li { - float: left; - width: 30%; -} - -.g-paginator .g-info { - background: none; - padding: .2em 0; - text-align: center; - width: 40%; -} - -/* Dialogs and panels ~~~~~~~~~~~~~~~~~~ */ - -#g-dialog { - text-align: left; -} - -#g-dialog legend { - display: none; -} - -#g-dialog .g-cancel { - margin: .4em 1em; -} - -#g-panel { - display: none; - padding: 1em; -} - -/* Inline layout ~~~~~~~~~~ */ - -.g-inline li { - float: left; - margin-left: 1.8em; - padding-left: 0 !important; -} - -.g-inline li.g-first { - margin-left: 0; -} - -/* Autocomplete ~~~~~~~~~~ */ -.ac_loading { - background: # url('../images/loading-small.gif') right center no-repeat !important; -} - -/** ******************************************************************* - * 9) Organize module style - *********************************************************************/ -#g-organize { - background-color: #; - border: 0px solid #; - color: #; -} - -#g-organize-hover { - background-color: #; - display: none; -} - -#g-organize-active { - background-color: #; - display: none; -} - -/** ******************************************************************* - * 10) Tag module styles - *********************************************************************/ -/* Tag cloud ~~~~~~~~~~~~~~~~~~~~~~~ */ -#g-tag-cloud ul li a { - text-decoration: none; -} - -#g-tag-cloud ul li.size0 a { - color: #; - font-size: 70%; - font-weight: 100; -} - -#g-tag-cloud ul li.size1 a { - color: #; - font-size: 80%; - font-weight: 100; -} - -#g-tag-cloud ul li.size2 a { - color: #; - font-size: 90%; - font-weight: 300; -} - -#g-tag-cloud ul li.size3 a { - color: #; - font-size: 100%; - font-weight: 500; -} - -#g-tag-cloud ul li.size4 a { - color: #; - font-size: 110%; - font-weight: 700; -} - -#g-tag-cloud ul li.size5 a { - color: #; - font-size: 120%; - font-weight: 900; -} - -#g-tag-cloud ul li.size6 a { - color: #; - font-size: 130%; - font-weight: 900; -} - -#g-tag-cloud ul li.size7 a { - color: #; - font-size: 140%; - font-weight: 900; -} - -#g-tag-cloud ul li a:hover { - color: #f30; - text-decoration: underline; -} - -/** ******************************************************************* - * 11) Right to left language styles - *********************************************************************/ - -.rtl { - direction: rtl; -} - -.rtl #g-header, -.rtl #g-content, -.rtl #g-sidebar, -.rtl #g-footer, -.rtl caption, -.rtl th, -.rtl #g-dialog, -.rtl .g-context-menu li a, -.rtl .g-message-box li, -.rtl #g-site-status li { - text-align: right; -} - -.rtl .g-text-right { - text-align: left; -} - -.rtl .g-error, -.rtl .g-info, -.rtl .g-success, -.rtl .g-warning, -.rtl #g-add-photos-status .g-success, -.rtl #g-add-photos-status .g-error { - background-position: center right; - padding-right: 30px !important; -} - -.rtl form li.g-error, -.rtl form li.g-info, -.rtl form li.g-success, -.rtl form li.g-warning { - padding-right: 0 !important; -} - -.rtl .g-left, -.rtl .g-inline li, -.rtl #g-content #g-album-grid .g-item, -.rtl .sf-menu li, -.rtl .g-breadcrumbs li, -.rtl .g-paginator li, -.rtl .g-buttonset li, -.rtl .ui-icon-left .ui-icon, -.rtl .g-short-form li, -.rtl form ul ul li, -.rtl input[type="submit"], -.rtl input[type="reset"], -.rtl input.checkbox, -.rtl input[type=checkbox], -.rtl input.radio, -.rtl input[type=radio] { - float: right; -} - -.rtl .g-right, -.rtl .ui-icon-right .ui-icon { - float: left; -} - -.rtl .g-inline li { - margin-right: 1em; -} - -.rtl .g-inline li.g-first { - margin-right: 0; -} - -.rtl .g-breadcrumbs li { - background: transparent url('../images/ico-separator-rtl.png') no-repeat scroll right center; - padding: 1em 18px 1em 8px; -} - -.rtl .g-breadcrumbs .g-first { - background: none; - padding-right: 0; -} - -.rtl input.checkbox { - margin-left: .4em; -} - -.rtl #g-add-comment { - right: inherit; - left: 0; -} - -.rtl .ui-icon-left .ui-icon { - margin-left: .2em; -} - -.rtl .ui-icon-right .ui-icon { - margin-right: .2em; -} - -/* RTL Corner radius ~~~~~~~~~~~~~~~~~~~~~~ */ -.rtl .g-buttonset .ui-corner-tl { - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - border-top-left-radius: 0; - -moz-border-radius-topright: 5px !important; - -webkit-border-top-right-radius: 5px !important; - border-top-right-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-tr { - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -moz-border-radius-topleft: 5px !important; - -webkit-border-top-left-radius: 5px !important; - border-top-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-bl { - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 5px !important; - -webkit-border-bottom-right-radius: 5px !important; - border-bottom-right-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-br { - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomleft: 5px !important; - -webkit-border-bottom-left-radius: 5px !important; - border-bottom-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-right, -.rtl .ui-progressbar .ui-corner-right { - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -moz-border-radius-topleft: 5px !important; - -webkit-border-top-left-radius: 5px !important; - border-top-left-radius: 5px !important; - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomleft: 5px !important; - -webkit-border-bottom-left-radius: 5px !important; - border-bottom-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-left, -.rtl .ui-progressbar .ui-corner-left { - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - border-top-left-radius: 0; - -moz-border-radius-topright: 5px !important; - -webkit-border-top-right-radius: 5px !important; - border-top-right-radius: 5px !important; - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 5px !important; - -webkit-border-bottom-right-radius: 5px !important; - border-bottom-right-radius: 5px !important; -} - -/* RTL Superfish ~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.rtl .sf-menu a { - border-left: none; - border-right:1px solid #; -} - -.rtl .sf-menu a.sf-with-ul { - padding-left: 2.25em; - padding-right: 1em; -} - -.rtl .sf-sub-indicator { - left: .75em !important; - right: auto; - background: url("themeroller/images/ui-icons__256x240.png") no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */ -} - -.rtl a > .sf-sub-indicator { /* give all except IE6 the correct values */ - top: .8em; - background-position: -10px -100px; /* use translucent arrow for modern browsers*/ -} -/* apply hovers to modern browsers */ -.rtl a:focus > .sf-sub-indicator, -.rtl a:hover > .sf-sub-indicator, -.rtl a:active > .sf-sub-indicator, -.rtl li:hover > a > .sf-sub-indicator, -.rtl li.sfHover > a > .sf-sub-indicator { - background-position: 0 -100px; /* arrow hovers for modern browsers*/ -} - -/* point right for anchors in subs */ -.rtl .sf-menu ul .sf-sub-indicator { background-position: 0 0; } -.rtl .sf-menu ul a > .sf-sub-indicator { background-position: -10px 0; } -/* apply hovers to modern browsers */ -.rtl .sf-menu ul a:focus > .sf-sub-indicator, -.rtl .sf-menu ul a:hover > .sf-sub-indicator, -.rtl .sf-menu ul a:active > .sf-sub-indicator, -.rtl .sf-menu ul li:hover > a > .sf-sub-indicator, -.rtl .sf-menu ul li.sfHover > a > .sf-sub-indicator { - background-position: 0 0; /* arrow hovers for modern browsers*/ -} - -.rtl .sf-menu li:hover ul, -.rtl .sf-menu li.sfHover ul { - right: 0; - left: auto; -} - -.rtl ul.sf-menu li li:hover ul, -.rtl ul.sf-menu li li.sfHover ul { - right: 12em; /* match ul width */ - left: auto; -} -.rtl ul.sf-menu li li li:hover ul, -.rtl ul.sf-menu li li li.sfHover ul { - right: 12em; /* match ul width */ - left: auto; -} - -/*** shadows for all but IE6 ***/ -.rtl .sf-shadow ul { - background: url('../../../lib/superfish/images/shadow.png') no-repeat bottom left; - padding: 0 0 9px 8px; - border-top-right-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-topright: 0; - -moz-border-radius-bottomleft: 0; - -webkit-border-top-right-radius: 0; - -webkit-border-bottom-left-radius: 0; - -moz-border-radius-topleft: 17px; - -moz-border-radius-bottomright: 17px; - -webkit-border-top-left-radius: 17px; - -webkit-border-bottom-right-radius: 17px; - border-top-left-radius: 17px; - border-bottom-right-radius: 17px; -} - -/* RTL ThemeRoller ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.rtl .ui-dialog .ui-dialog-titlebar { - padding: 0.5em 1em 0.3em 0.3em; -} - -.rtl .ui-dialog .ui-dialog-title { - float: right; -} - -.rtl .ui-dialog .ui-dialog-titlebar-close { - left: 0.3em; - right: auto; -} - -/* RTL paginator ~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.rtl .g-paginator .g-info { - width: 35%; -} - -.rtl .g-paginator .g-text-right { - margin-left: 0; -} - -.rtl .g-paginator .ui-icon-seek-end { - background-position: -80px -160px; -} - -.rtl .g-paginator .ui-icon-seek-next { - background-position: -48px -160px; -} - -.rtl .g-paginator .ui-icon-seek-prev { - background-position: -32px -160px; -} - -.rtl .g-paginator .ui-icon-seek-first { - background-position: -64px -160px; -} - -.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'); -} - -.rtl #g-sidebar .g-block-content { - padding-right: 1em; - padding-left: 0; -} - -.rtl #g-footer #g-credits li { - padding-left: 1.2em !important; - padding-right: 0; -} diff --git a/3.1/modules/themeroller/views/theme.info.php b/3.1/modules/themeroller/views/theme.info.php deleted file mode 100644 index eb8ead8f..00000000 --- a/3.1/modules/themeroller/views/theme.info.php +++ /dev/null @@ -1,9 +0,0 @@ - -name = "" -description = "" -version = 1 -author = "" -site = "" -admin = "" -; definition = - diff --git a/3.1/modules/twitter/README b/3.1/modules/twitter/README deleted file mode 100644 index e761d4e9..00000000 --- a/3.1/modules/twitter/README +++ /dev/null @@ -1,22 +0,0 @@ -ABOUT: -Share photos, movies, and albums on Twitter, directly from Gallery. - -INSTALLATION AND CONFIGURATION: -http://codex.gallery2.org/Gallery3:Modules:twitter - -SUPPORT/BUG REPORTS: -http://gallery.menalto.com/node/100791 - -ROADMAP: -* Display Twitter profile/follow links on Gallery user profile pages. -* Provide "Share on Twitter" for anonymous users. -* Display item (re)tweets. -* Twitter identity provider (log into Gallery with Twitter) - -HISTORY: -2011-03-15 - 1 beta2 -- Allow users to change from one Twitter account to another from their profile page. -- Compose Tweet JavaScript widget fixes to read default options, accept custom widget options. -- Disable the "Tweet" button if the message is over 140 characters. -- Truncate default tweet values longer than 140. -2011-02-15 - 1 beta1 \ No newline at end of file diff --git a/3.1/modules/twitter/controllers/admin_twitter.php b/3.1/modules/twitter/controllers/admin_twitter.php deleted file mode 100644 index 7d1400ab..00000000 --- a/3.1/modules/twitter/controllers/admin_twitter.php +++ /dev/null @@ -1,61 +0,0 @@ -validate()) { - $consumer_key = $form->twitter_oauth->consumer_key->value; - $consumer_secret = $form->twitter_oauth->consumer_secret->value; - $reset_tweet = $form->twitter_message->reset_tweet->value; - if ($reset_tweet) { - $default_tweet = twitter::reset_default_tweet(); - } else { - $default_tweet = $form->twitter_message->default_tweet->value; - } - $shorten_urls = $form->urls->shorten_urls->value; - - module::set_var("twitter", "consumer_key", $consumer_key); - module::set_var("twitter", "consumer_secret", $consumer_secret); - module::set_var("twitter", "default_tweet", $default_tweet); - module::set_var("twitter", "shorten_urls", $shorten_urls); - - message::success("Twitter settings saved"); - url::redirect("admin/twitter"); - } - } - $is_registered = twitter::is_registered(); - - $v = new Admin_View("admin.html"); - $v->page_title = t("Twitter"); - $v->content = new View("admin_twitter.html"); - $v->content->form = $form; - $v->content->is_registered = $is_registered; - - print $v; - } - -} \ No newline at end of file diff --git a/3.1/modules/twitter/controllers/twitter.php b/3.1/modules/twitter/controllers/twitter.php deleted file mode 100644 index 8c98b24b..00000000 --- a/3.1/modules/twitter/controllers/twitter.php +++ /dev/null @@ -1,279 +0,0 @@ -get("twitter_oauth_token"); - $oauth_token_secret = Session::instance()->get("twitter_oauth_token_secret"); - $item_url = Session::instance()->get("twitter_item_redirect"); - - // If the oauth_token is old redirect to the connect page - if (isset($_REQUEST['oauth_token']) && $oauth_token !== $_REQUEST['oauth_token']) { - Session::instance()->set("twitter_oauth_status", "old_token"); - $this->_clear_session(); - url::redirect(url::site("twitter/redirect")); - } - - // Create TwitteroAuth object with app key/secret and token key/secret from default phase - $connection = new TwitterOAuth($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret); - - // Request access tokens from twitter - $access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']); - - // Save the access tokens - Session::instance()->set("twitter_access_token", $access_token); - - // Remove no longer needed request tokens - Session::instance()->delete("twitter_oauth_token"); - Session::instance()->delete("twitter_oauth_token_secret"); - - // If HTTP response is 200 continue otherwise send to connect page to retry - if (200 == $connection->http_code) { - $this->_save_user($access_token); - $item = ORM::factory("item", $item_id); - url::redirect(url::abs_site($item_url)); - } else { - log::error("content", "Twitter", "Unable to retrieve user access token: " . $connection->http_code); - $this->_clear_session(); - url::redirect(url::site("twitter/redirect")); - } - } - - /** - * Display Twitter status dialog. - * @param int $item_id - */ - public function dialog($item_id) { - $item = ORM::factory("item", $item_id); - $form = twitter::get_tweet_form($item); - - // Ensure user has permission - access::required("view", $item); - - $user_id = identity::active_user()->id; - $token_is_set = $this->_is_token_set($user_id); - - $v = new View("twitter_dialog.html"); - $v->is_registered = twitter::is_registered(); - $v->user_token_set = $token_is_set; - - if ($token_is_set) { - $v->type = $item->type; - $v->title = $item->title; - $v->description = $item->description; - $v->form = $form; - $v->character_count = twitter::$character_count; - } else { - $item_url = urlencode(url::abs_site($item->relative_url_cache)); - $v->user_id = $user_id; - $v->twitter_auth_url = url::site("twitter/redirect?item_url=$item_url"); - } - print $v; - } - - /** - * Redirect user to Twitter authorization page. - */ - public function redirect() { - require_once(MODPATH . "twitter/vendor/twitteroauth/twitteroauth.php"); - - $consumer_key = module::get_var("twitter", "consumer_key"); - $consumer_secret = module::get_var("twitter", "consumer_secret"); - $oauth_callback = url::abs_site("twitter/callback"); - - // We'll want this after Twitter kicks back to our callback - if (!empty($_GET['item_url'])) { - Session::instance()->set("twitter_item_redirect", $_GET['item_url']); - } - - // Build TwitterOAuth object with client credentials - $connection = new TwitterOAuth($consumer_key, $consumer_secret); - - // Get temporary credentials. - $request_token = $connection->getRequestToken($oauth_callback); - - // Save temporary credentials to session. - Session::instance()->set("twitter_oauth_token", $request_token['oauth_token']); - Session::instance()->set("twitter_oauth_token_secret", $request_token['oauth_token_secret']); - - // If last connection failed don't display authorization link - if (200 == $connection->http_code) { - // Build authorize URL and redirect user to Twitter - $url = $connection->getAuthorizeURL($request_token["oauth_token"]); - url::redirect($url); - } else { - // Show notification if something went wrong - message::success(t("Could not connect to Twitter. Refresh the page or try again later.")); - url::redirect(urldecode($_GET['item_url'])); - } - } - - /** - * Reset a user's Twitter OAuth access token - * @param int $user_id - */ - public function reset($user_id) { - if (identity::active_user()->id == $user_id) { - $u = ORM::factory("twitter_user")->where("user_id", "=", $user_id)->find(); - if ($u->loaded()) { - $u->oauth_token = ""; - $u->oauth_token_secret = ""; - $u->twitter_user_id = ""; - $u->screen_name = ""; - $u->save(); - message::success(t("Your Twitter access token has been reset.")); - Session::instance()->set("twitter_item_redirect", - url::abs_site("user_profile/show/{$user_id}")); - url::redirect("twitter/redirect"); - } - } - } - - /** - * Post a status update to Twitter - * @param int $item_id - */ - public function tweet($item_id) { - access::verify_csrf(); - - $item = ORM::factory("item", $item_id); - $form = twitter::get_tweet_form($item); - - if ($form->validate()) { - $item_url = url::abs_site($item->relative_url_cache); - $user = $this->_get_twitter_user(identity::active_user()->id); - $consumer_key = module::get_var("twitter", "consumer_key"); - $consumer_secret = module::get_var("twitter", "consumer_secret"); - - require_once(MODPATH . "twitter/vendor/twitteroauth/twitteroauth.php"); - - $connection = new TwitterOAuth( - $consumer_key, - $consumer_secret, - $user->oauth_token, - $user->oauth_token_secret); - - $message = $form->twitter_message->tweet->value; - $response = $connection->post('statuses/update', array('status' => $message)); - - if (200 == $connection->http_code) { - message::success(t("Tweet sent!")); - json::reply(array("result" => "success", "location" => $item->url())); - } else { - message::error(t("Unable to send, your Tweet has been saved. Please try again later.")); - log::error("content", "Twitter", t("Unable to send tweet: %http_code", - array("http_code" => $connection->http_code))); - json::reply(array("result" => "success", "location" => $item->url())); - } - $tweet->item_id = $item_id; - (!empty($response->id)) ? $tweet->twitter_id = $response->id : $tweet->twitter_id = NULL; - $tweet->tweet = $message; - $tweet->id = $form->twitter_message->tweet_id->value; - $this->_save_tweet($tweet); - - } else { - json::reply(array("result" => "error", "html" => (string)$form)); - } - } - - /** - * Clear Twitter module session variables - */ - private function _clear_session() { - Session::instance()->delete("twitter_oauth_token"); - Session::instance()->delete("twitter_oauth_token_secret"); - Session::instance()->delete("twitter_access_token"); - } - - /** - * Get Twitter credentials for the current user. - * @param int $user_id - * @return mixed object|false - */ - private function _get_twitter_user($user_id) { - $twitter_user = ORM::factory("twitter_user")->where("user_id", "=", $user_id)->find(); - if ($twitter_user->loaded()) { - return $twitter_user; - } - return false; - } - - /** - * Check if current user's Twitter credentials have been stored locally. - * @param int $user_id - * @return boolean - */ - private function _is_token_set($user_id) { - $twitter_user = $this->_get_twitter_user($user_id); - if (!empty($twitter_user->oauth_token) && !empty($twitter_user->oauth_token_secret)) { - return true; - } - return false; - } - - /** - * Save new tweets - * @param object $tweet - */ - private function _save_tweet($tweet) { - if (!empty($tweet->item_id) && !empty($tweet->tweet)) { - if ($tweet->id > 0) { - $t = ORM::factory("twitter_tweet")->where("id", "=", $tweet->id)->find(); - } else { - $t = ORM::factory("twitter_tweet"); - } - $t->item_id = $tweet->item_id; - $t->twitter_id = $tweet->twitter_id; - $t->tweet = $tweet->tweet; - $t->sent = (!empty($tweet->twitter_id)) ? time() : NULL; - $t->user_id = identity::active_user()->id; - $t->save(); - } - } - - /** - * Save or update the current user's Twitter credentials. - * @param array $access_token - */ - private function _save_user($access_token) { - $u = ORM::factory("twitter_user") - ->where("user_id", "=", identity::active_user()->id) - ->find(); - if (!$u->loaded()) { - $u = ORM::factory("twitter_user"); - } - $u->oauth_token = $access_token["oauth_token"]; - $u->oauth_token_secret = $access_token["oauth_token_secret"]; - $u->twitter_user_id = $access_token["user_id"]; - $u->screen_name = $access_token["screen_name"]; - $u->user_id = identity::active_user()->id; - $u->save(); - message::success(t("Success! You may now share Gallery items on Twitter.")); - } - -} diff --git a/3.1/modules/twitter/css/twitter.css b/3.1/modules/twitter/css/twitter.css deleted file mode 100644 index 8bb82ccf..00000000 --- a/3.1/modules/twitter/css/twitter.css +++ /dev/null @@ -1,5 +0,0 @@ -#g-twitter-character-count { - float: right; - font-size: 1.4em; - font-weight: bold; -} diff --git a/3.1/modules/twitter/helpers/twitter.php b/3.1/modules/twitter/helpers/twitter.php deleted file mode 100644 index 190ad177..00000000 --- a/3.1/modules/twitter/helpers/twitter.php +++ /dev/null @@ -1,152 +0,0 @@ - "g-configure-twitter-form")); - - $group_oauth = $form->group("twitter_oauth")->label(t("OAuth Settings")); - $group_oauth->input("consumer_key") - ->label(t("Consumer key")) - ->value(module::get_var("twitter", "consumer_key")); - $group_oauth->input("consumer_secret") - ->label(t("Consumer secret")) - ->value(module::get_var("twitter", "consumer_secret")); - - $group_tweet = $form->group("twitter_message")->label(t("Default Tweet")); - $group_tweet->input("default_tweet") - ->label(t("Default Tweet")) - ->value(module::get_var("twitter", "default_tweet")); - $group_tweet->checkbox("reset_tweet") - ->label(t("Reset to default on save")) - ->value(1); - - if (module::is_active("bitly")) { - $group_url = $form->group("urls")->label(t("Shorten URLs")); - $group_url->checkbox("shorten_urls") - ->label(t("Shorten URLs automatically with bit.ly")) - ->checked(module::get_var("twitter", "shorten_urls")); - } - $form->submit("")->value(t("Save")); - return $form; - } - - /** - * Get tweet form - * @param object $item - * @return Forge - */ - static function get_tweet_form($item) { - $long_url = url::abs_site($item->relative_url_cache); - // Check for saved tweets for this user and item - $saved = self::get_failed($item->id); - if ($saved) { - $default_tweet = $saved->tweet; - $tweet_id = $saved->id; - } else { - $default_tweet = module::get_var("twitter", "default_tweet"); - $tweet_id = 0; - } - $tweet = preg_replace("/%type/", $item->type, $default_tweet); - $tweet = preg_replace("/%title/", $item->title, $tweet); - $tweet = preg_replace("/%description/", $item->description, $tweet); - // If bit.ly module's enabled, get the item's URL and shorten it - if (!empty($item->id) && module::is_active("bitly") - && module::get_var("twitter", "shorten_urls")) { - $url = bitly::shorten_url($item->id); - } else { - $url = url::abs_site($item->relative_url_cache); - } - - // Truncate the default tweet if it's too long - $url_length = strlen($url) + 1; - $tweet_length = strlen($tweet); - - if (($tweet_length + $url_length) > self::$character_count) { - $trim_pos = 0 - (($tweet_length + $url_length) - 140); - $tweet = substr($tweet, 0, $trim_pos); - } - $tweet = $tweet . ' ' . $url; - - $form = new Forge("twitter/tweet/$item->id", "", "post", array("id" => "g-twitter-tweet-form")); - $group = $form->group("twitter_message")->label(t("Compose Tweet")); - $group->textarea("tweet") - ->value($tweet) - ->rules("required") - ->error_messages("required", t("Your tweet cannot be empty!")) - ->id("g-tweet"); - $group->hidden("tweet_id")->value($tweet_id)->id("tweet_id"); - $form->submit("")->value(t("Tweet")); - return $form; - } - - /** - * Get the most recent failed tweet for an item - * @param integer $item_id - * @return mixed object|false - */ - function get_failed($item_id) { - $user_id = identity::active_user()->id; - $t = ORM::factory("twitter_tweet") - ->where("item_id", "=", $item_id) - ->where("user_id", "=", $user_id) - ->where("twitter_id", "IS", NULL) - ->find(); - if ($t->loaded()) { - return $t; - } else { - return false; - } - } - - /** - * Has this Gallery been registered at dev.twitter.com/app? - * @return boolean - */ - static function is_registered() { - $consumer_key = module::get_var("twitter", "consumer_key"); - $consumer_secret = module::get_var("twitter", "consumer_secret"); - if (empty($consumer_key) || empty($consumer_secret)) { - site_status::warning( - t("Twitter module requires attention! Set the consumer key and secret.", - array("url" => html::mark_clean(url::site("admin/twitter")))), - "twitter_config"); - return false; - } else { - site_status::clear("twitter_config"); - return true; - } - } - - static function reset_default_tweet() { - return t("Check out this %type, '%title': %description"); - } - -} diff --git a/3.1/modules/twitter/helpers/twitter_event.php b/3.1/modules/twitter/helpers/twitter_event.php deleted file mode 100644 index 72001d3b..00000000 --- a/3.1/modules/twitter/helpers/twitter_event.php +++ /dev/null @@ -1,85 +0,0 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("twitter_menu") - ->label(t("Twitter")) - ->url(url::site("admin/twitter"))); - } - - static function site_menu($menu, $theme) { - $item = $theme->item(); - if ($item && twitter::is_registered() && (identity::active_user()->id > 1)) { - $menu->get("options_menu") - ->append(Menu::factory("dialog") - ->id("twitter") - ->label(t("Share on Twitter")) - ->css_id("g-twitter-link") - ->url(url::site("twitter/dialog/{$item->id}"))); - } - } - - static function context_menu($menu, $theme, $item) { - if ((identity::active_user()->id > 1) && twitter::is_registered()) { - $menu->get("options_menu") - ->append(Menu::factory("dialog") - ->id("twitter") - ->label(t("Share on Twitter")) - ->css_class("ui-icon-link g-twitter-share") - ->url(url::site("twitter/dialog/{$item->id}"))); - } - } - - /** - * Add Twitter account info to user profiles - * @param object $data - */ - static function show_user_profile($data) { - $twitter_account = ORM::factory("twitter_user")->where("user_id", "=", $data->user->id)->find(); - if ($twitter_account->loaded()) { - $v = new View("user_profile_info.html"); - $v->user_profile_data = array(); - $fields = array( - "screen_name" => t("Screen name") - ); - foreach ($fields as $field => $label) { - if (!empty($twitter_account->$field)) { - $value = $twitter_account->$field; - if ($field == "screen_name") { - $value = html::mark_clean(html::anchor(twitter::$url . - $twitter_account->screen_name, - "@{$twitter_account->screen_name}")); - } - $v->user_profile_data[(string) $label] = $value; - } - } - if (identity::active_user()->id == $data->user->id) { - $button = html::mark_clean(html::anchor(url::site("twitter/reset/" - . $data->user->id), t("Switch to another Twitter screen name"))); - $v->user_profile_data[""] = $button; - } - $data->content[] = (object) array("title" => t("Twitter account"), "view" => $v); - } - } - -} diff --git a/3.1/modules/twitter/helpers/twitter_installer.php b/3.1/modules/twitter/helpers/twitter_installer.php deleted file mode 100644 index 58016a08..00000000 --- a/3.1/modules/twitter/helpers/twitter_installer.php +++ /dev/null @@ -1,50 +0,0 @@ -query("CREATE TABLE {twitter_tweets} ( - `id` int(9) NOT NULL AUTO_INCREMENT, - `item_id` int(9) NOT NULL, - `sent` int(9) NULL, - `twitter_id` decimal(20,0) NULL, - `tweet` varchar(255) NOT NULL, - `user_id` int(9) NOT NULL, - PRIMARY KEY (`id`)) - DEFAULT CHARSET=utf8;"); - Database::instance() - ->query("CREATE TABLE {twitter_users} ( - `id` int(9) NOT NULL AUTO_INCREMENT, - `oauth_token` varchar(64) NOT NULL, - `oauth_token_secret` varchar(64) NOT NULL, - `screen_name` varchar(16) NOT NULL, - `twitter_user_id` int(9) NOT NULL, - `user_id` int(9) NOT NULL, - PRIMARY KEY (`id`)) - DEFAULT CHARSET=utf8;"); - module::set_version("twitter", 1); - twitter::reset_default_tweet(); - } - - static function deactivate() { - site_status::clear("twitter_config"); - } -} diff --git a/3.1/modules/twitter/js/twitter.js b/3.1/modules/twitter/js/twitter.js deleted file mode 100644 index e44539d8..00000000 --- a/3.1/modules/twitter/js/twitter.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @todo Add shorten/expand urls toggle button - */ -(function($) { - $.widget("ui.gallery_twitter", { - - _init: function() { - var self = this; - this._set_count(); - this.element.keyup(function(event) { - self._set_count(event.currentTarget); - return false; - }); - }, - - _set_count: function() { - var self = this; - var character_array = $("#g-tweet").val().split(""); - var count = character_array.length; - var remaining = self.options.max_count - count; - var count_container = $("#g-twitter-character-count"); - var color = "#000000"; - if (remaining < 10) { - color = self.options.error_color; - } else if (remaining < 20) { - color = self.options.warn_color; - } - if (remaining < 0) { - $("#g-dialog form :submit").addClass("ui-state-disabled") - .attr("disabled", "disabled"); - } else { - $("#g-dialog form :submit").removeClass("ui-state-disabled") - .attr("disabled", null); - } - $(count_container).css("color", color); - $(count_container).html(remaining); - } - - }); - - $.extend($.ui.gallery_twitter, { - defaults: { - max_count: 140, - warn_color: "#7F0005", - error_color: "#FF0000" - } - }); - -})(jQuery); diff --git a/3.1/modules/twitter/models/twitter_tweet.php b/3.1/modules/twitter/models/twitter_tweet.php deleted file mode 100644 index 9a616cfd..00000000 --- a/3.1/modules/twitter/models/twitter_tweet.php +++ /dev/null @@ -1,21 +0,0 @@ -key = $key; - $this->secret = $secret; - $this->callback_url = $callback_url; - } - - function __toString() { - return "OAuthConsumer[key=$this->key,secret=$this->secret]"; - } -} - -class OAuthToken { - // access tokens and request tokens - public $key; - public $secret; - - /** - * key = the token - * secret = the token secret - */ - function __construct($key, $secret) { - $this->key = $key; - $this->secret = $secret; - } - - /** - * generates the basic string serialization of a token that a server - * would respond to request_token and access_token calls with - */ - function to_string() { - return "oauth_token=" . - OAuthUtil::urlencode_rfc3986($this->key) . - "&oauth_token_secret=" . - OAuthUtil::urlencode_rfc3986($this->secret); - } - - function __toString() { - return $this->to_string(); - } -} - -/** - * A class for implementing a Signature Method - * See section 9 ("Signing Requests") in the spec - */ -abstract class OAuthSignatureMethod { - /** - * Needs to return the name of the Signature Method (ie HMAC-SHA1) - * @return string - */ - abstract public function get_name(); - - /** - * Build up the signature - * NOTE: The output of this function MUST NOT be urlencoded. - * the encoding is handled in OAuthRequest when the final - * request is serialized - * @param OAuthRequest $request - * @param OAuthConsumer $consumer - * @param OAuthToken $token - * @return string - */ - abstract public function build_signature($request, $consumer, $token); - - /** - * Verifies that a given signature is correct - * @param OAuthRequest $request - * @param OAuthConsumer $consumer - * @param OAuthToken $token - * @param string $signature - * @return bool - */ - public function check_signature($request, $consumer, $token, $signature) { - $built = $this->build_signature($request, $consumer, $token); - return $built == $signature; - } -} - -/** - * The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104] - * where the Signature Base String is the text and the key is the concatenated values (each first - * encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&' - * character (ASCII code 38) even if empty. - * - Chapter 9.2 ("HMAC-SHA1") - */ -class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod { - function get_name() { - return "HMAC-SHA1"; - } - - public function build_signature($request, $consumer, $token) { - $base_string = $request->get_signature_base_string(); - $request->base_string = $base_string; - - $key_parts = array( - $consumer->secret, - ($token) ? $token->secret : "" - ); - - $key_parts = OAuthUtil::urlencode_rfc3986($key_parts); - $key = implode('&', $key_parts); - - return base64_encode(hash_hmac('sha1', $base_string, $key, true)); - } -} - -/** - * The PLAINTEXT method does not provide any security protection and SHOULD only be used - * over a secure channel such as HTTPS. It does not use the Signature Base String. - * - Chapter 9.4 ("PLAINTEXT") - */ -class OAuthSignatureMethod_PLAINTEXT extends OAuthSignatureMethod { - public function get_name() { - return "PLAINTEXT"; - } - - /** - * oauth_signature is set to the concatenated encoded values of the Consumer Secret and - * Token Secret, separated by a '&' character (ASCII code 38), even if either secret is - * empty. The result MUST be encoded again. - * - Chapter 9.4.1 ("Generating Signatures") - * - * Please note that the second encoding MUST NOT happen in the SignatureMethod, as - * OAuthRequest handles this! - */ - public function build_signature($request, $consumer, $token) { - $key_parts = array( - $consumer->secret, - ($token) ? $token->secret : "" - ); - - $key_parts = OAuthUtil::urlencode_rfc3986($key_parts); - $key = implode('&', $key_parts); - $request->base_string = $key; - - return $key; - } -} - -/** - * The RSA-SHA1 signature method uses the RSASSA-PKCS1-v1_5 signature algorithm as defined in - * [RFC3447] section 8.2 (more simply known as PKCS#1), using SHA-1 as the hash function for - * EMSA-PKCS1-v1_5. It is assumed that the Consumer has provided its RSA public key in a - * verified way to the Service Provider, in a manner which is beyond the scope of this - * specification. - * - Chapter 9.3 ("RSA-SHA1") - */ -abstract class OAuthSignatureMethod_RSA_SHA1 extends OAuthSignatureMethod { - public function get_name() { - return "RSA-SHA1"; - } - - // Up to the SP to implement this lookup of keys. Possible ideas are: - // (1) do a lookup in a table of trusted certs keyed off of consumer - // (2) fetch via http using a url provided by the requester - // (3) some sort of specific discovery code based on request - // - // Either way should return a string representation of the certificate - protected abstract function fetch_public_cert(&$request); - - // Up to the SP to implement this lookup of keys. Possible ideas are: - // (1) do a lookup in a table of trusted certs keyed off of consumer - // - // Either way should return a string representation of the certificate - protected abstract function fetch_private_cert(&$request); - - public function build_signature($request, $consumer, $token) { - $base_string = $request->get_signature_base_string(); - $request->base_string = $base_string; - - // Fetch the private key cert based on the request - $cert = $this->fetch_private_cert($request); - - // Pull the private key ID from the certificate - $privatekeyid = openssl_get_privatekey($cert); - - // Sign using the key - $ok = openssl_sign($base_string, $signature, $privatekeyid); - - // Release the key resource - openssl_free_key($privatekeyid); - - return base64_encode($signature); - } - - public function check_signature($request, $consumer, $token, $signature) { - $decoded_sig = base64_decode($signature); - - $base_string = $request->get_signature_base_string(); - - // Fetch the public key cert based on the request - $cert = $this->fetch_public_cert($request); - - // Pull the public key ID from the certificate - $publickeyid = openssl_get_publickey($cert); - - // Check the computed signature against the one passed in the query - $ok = openssl_verify($base_string, $decoded_sig, $publickeyid); - - // Release the key resource - openssl_free_key($publickeyid); - - return $ok == 1; - } -} - -class OAuthRequest { - private $parameters; - private $http_method; - private $http_url; - // for debug purposes - public $base_string; - public static $version = '1.0'; - public static $POST_INPUT = 'php://input'; - - function __construct($http_method, $http_url, $parameters=NULL) { - @$parameters or $parameters = array(); - $parameters = array_merge( OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters); - $this->parameters = $parameters; - $this->http_method = $http_method; - $this->http_url = $http_url; - } - - - /** - * attempt to build up a request from what was passed to the server - */ - public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL) { - $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") - ? 'http' - : 'https'; - @$http_url or $http_url = $scheme . - '://' . $_SERVER['HTTP_HOST'] . - ':' . - $_SERVER['SERVER_PORT'] . - $_SERVER['REQUEST_URI']; - @$http_method or $http_method = $_SERVER['REQUEST_METHOD']; - - // We weren't handed any parameters, so let's find the ones relevant to - // this request. - // If you run XML-RPC or similar you should use this to provide your own - // parsed parameter-list - if (!$parameters) { - // Find request headers - $request_headers = OAuthUtil::get_headers(); - - // Parse the query-string to find GET parameters - $parameters = OAuthUtil::parse_parameters($_SERVER['QUERY_STRING']); - - // It's a POST request of the proper content-type, so parse POST - // parameters and add those overriding any duplicates from GET - if ($http_method == "POST" - && @strstr($request_headers["Content-Type"], - "application/x-www-form-urlencoded") - ) { - $post_data = OAuthUtil::parse_parameters( - file_get_contents(self::$POST_INPUT) - ); - $parameters = array_merge($parameters, $post_data); - } - - // We have a Authorization-header with OAuth data. Parse the header - // and add those overriding any duplicates from GET or POST - if (@substr($request_headers['Authorization'], 0, 6) == "OAuth ") { - $header_parameters = OAuthUtil::split_header( - $request_headers['Authorization'] - ); - $parameters = array_merge($parameters, $header_parameters); - } - - } - - return new OAuthRequest($http_method, $http_url, $parameters); - } - - /** - * pretty much a helper function to set up the request - */ - public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL) { - @$parameters or $parameters = array(); - $defaults = array("oauth_version" => OAuthRequest::$version, - "oauth_nonce" => OAuthRequest::generate_nonce(), - "oauth_timestamp" => OAuthRequest::generate_timestamp(), - "oauth_consumer_key" => $consumer->key); - if ($token) - $defaults['oauth_token'] = $token->key; - - $parameters = array_merge($defaults, $parameters); - - return new OAuthRequest($http_method, $http_url, $parameters); - } - - public function set_parameter($name, $value, $allow_duplicates = true) { - if ($allow_duplicates && isset($this->parameters[$name])) { - // We have already added parameter(s) with this name, so add to the list - if (is_scalar($this->parameters[$name])) { - // This is the first duplicate, so transform scalar (string) - // into an array so we can add the duplicates - $this->parameters[$name] = array($this->parameters[$name]); - } - - $this->parameters[$name][] = $value; - } else { - $this->parameters[$name] = $value; - } - } - - public function get_parameter($name) { - return isset($this->parameters[$name]) ? $this->parameters[$name] : null; - } - - public function get_parameters() { - return $this->parameters; - } - - public function unset_parameter($name) { - unset($this->parameters[$name]); - } - - /** - * The request parameters, sorted and concatenated into a normalized string. - * @return string - */ - public function get_signable_parameters() { - // Grab all parameters - $params = $this->parameters; - - // Remove oauth_signature if present - // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.") - if (isset($params['oauth_signature'])) { - unset($params['oauth_signature']); - } - - return OAuthUtil::build_http_query($params); - } - - /** - * Returns the base string of this request - * - * The base string defined as the method, the url - * and the parameters (normalized), each urlencoded - * and the concated with &. - */ - public function get_signature_base_string() { - $parts = array( - $this->get_normalized_http_method(), - $this->get_normalized_http_url(), - $this->get_signable_parameters() - ); - - $parts = OAuthUtil::urlencode_rfc3986($parts); - - return implode('&', $parts); - } - - /** - * just uppercases the http method - */ - public function get_normalized_http_method() { - return strtoupper($this->http_method); - } - - /** - * parses the url and rebuilds it to be - * scheme://host/path - */ - public function get_normalized_http_url() { - $parts = parse_url($this->http_url); - - $port = @$parts['port']; - $scheme = $parts['scheme']; - $host = $parts['host']; - $path = @$parts['path']; - - $port or $port = ($scheme == 'https') ? '443' : '80'; - - if (($scheme == 'https' && $port != '443') - || ($scheme == 'http' && $port != '80')) { - $host = "$host:$port"; - } - return "$scheme://$host$path"; - } - - /** - * builds a url usable for a GET request - */ - public function to_url() { - $post_data = $this->to_postdata(); - $out = $this->get_normalized_http_url(); - if ($post_data) { - $out .= '?'.$post_data; - } - return $out; - } - - /** - * builds the data one would send in a POST request - */ - public function to_postdata() { - return OAuthUtil::build_http_query($this->parameters); - } - - /** - * builds the Authorization: header - */ - public function to_header($realm=null) { - $first = true; - if($realm) { - $out = 'Authorization: OAuth realm="' . OAuthUtil::urlencode_rfc3986($realm) . '"'; - $first = false; - } else - $out = 'Authorization: OAuth'; - - $total = array(); - foreach ($this->parameters as $k => $v) { - if (substr($k, 0, 5) != "oauth") continue; - if (is_array($v)) { - throw new OAuthException('Arrays not supported in headers'); - } - $out .= ($first) ? ' ' : ','; - $out .= OAuthUtil::urlencode_rfc3986($k) . - '="' . - OAuthUtil::urlencode_rfc3986($v) . - '"'; - $first = false; - } - return $out; - } - - public function __toString() { - return $this->to_url(); - } - - - public function sign_request($signature_method, $consumer, $token) { - $this->set_parameter( - "oauth_signature_method", - $signature_method->get_name(), - false - ); - $signature = $this->build_signature($signature_method, $consumer, $token); - $this->set_parameter("oauth_signature", $signature, false); - } - - public function build_signature($signature_method, $consumer, $token) { - $signature = $signature_method->build_signature($this, $consumer, $token); - return $signature; - } - - /** - * util function: current timestamp - */ - private static function generate_timestamp() { - return time(); - } - - /** - * util function: current nonce - */ - private static function generate_nonce() { - $mt = microtime(); - $rand = mt_rand(); - - return md5($mt . $rand); // md5s look nicer than numbers - } -} - -class OAuthServer { - protected $timestamp_threshold = 300; // in seconds, five minutes - protected $version = '1.0'; // hi blaine - protected $signature_methods = array(); - - protected $data_store; - - function __construct($data_store) { - $this->data_store = $data_store; - } - - public function add_signature_method($signature_method) { - $this->signature_methods[$signature_method->get_name()] = - $signature_method; - } - - // high level functions - - /** - * process a request_token request - * returns the request token on success - */ - public function fetch_request_token(&$request) { - $this->get_version($request); - - $consumer = $this->get_consumer($request); - - // no token required for the initial token request - $token = NULL; - - $this->check_signature($request, $consumer, $token); - - // Rev A change - $callback = $request->get_parameter('oauth_callback'); - $new_token = $this->data_store->new_request_token($consumer, $callback); - - return $new_token; - } - - /** - * process an access_token request - * returns the access token on success - */ - public function fetch_access_token(&$request) { - $this->get_version($request); - - $consumer = $this->get_consumer($request); - - // requires authorized request token - $token = $this->get_token($request, $consumer, "request"); - - $this->check_signature($request, $consumer, $token); - - // Rev A change - $verifier = $request->get_parameter('oauth_verifier'); - $new_token = $this->data_store->new_access_token($token, $consumer, $verifier); - - return $new_token; - } - - /** - * verify an api call, checks all the parameters - */ - public function verify_request(&$request) { - $this->get_version($request); - $consumer = $this->get_consumer($request); - $token = $this->get_token($request, $consumer, "access"); - $this->check_signature($request, $consumer, $token); - return array($consumer, $token); - } - - // Internals from here - /** - * version 1 - */ - private function get_version(&$request) { - $version = $request->get_parameter("oauth_version"); - if (!$version) { - // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present. - // Chapter 7.0 ("Accessing Protected Ressources") - $version = '1.0'; - } - if ($version !== $this->version) { - throw new OAuthException("OAuth version '$version' not supported"); - } - return $version; - } - - /** - * figure out the signature with some defaults - */ - private function get_signature_method(&$request) { - $signature_method = - @$request->get_parameter("oauth_signature_method"); - - if (!$signature_method) { - // According to chapter 7 ("Accessing Protected Ressources") the signature-method - // parameter is required, and we can't just fallback to PLAINTEXT - throw new OAuthException('No signature method parameter. This parameter is required'); - } - - if (!in_array($signature_method, - array_keys($this->signature_methods))) { - throw new OAuthException( - "Signature method '$signature_method' not supported " . - "try one of the following: " . - implode(", ", array_keys($this->signature_methods)) - ); - } - return $this->signature_methods[$signature_method]; - } - - /** - * try to find the consumer for the provided request's consumer key - */ - private function get_consumer(&$request) { - $consumer_key = @$request->get_parameter("oauth_consumer_key"); - if (!$consumer_key) { - throw new OAuthException("Invalid consumer key"); - } - - $consumer = $this->data_store->lookup_consumer($consumer_key); - if (!$consumer) { - throw new OAuthException("Invalid consumer"); - } - - return $consumer; - } - - /** - * try to find the token for the provided request's token key - */ - private function get_token(&$request, $consumer, $token_type="access") { - $token_field = @$request->get_parameter('oauth_token'); - $token = $this->data_store->lookup_token( - $consumer, $token_type, $token_field - ); - if (!$token) { - throw new OAuthException("Invalid $token_type token: $token_field"); - } - return $token; - } - - /** - * all-in-one function to check the signature on a request - * should guess the signature method appropriately - */ - private function check_signature(&$request, $consumer, $token) { - // this should probably be in a different method - $timestamp = @$request->get_parameter('oauth_timestamp'); - $nonce = @$request->get_parameter('oauth_nonce'); - - $this->check_timestamp($timestamp); - $this->check_nonce($consumer, $token, $nonce, $timestamp); - - $signature_method = $this->get_signature_method($request); - - $signature = $request->get_parameter('oauth_signature'); - $valid_sig = $signature_method->check_signature( - $request, - $consumer, - $token, - $signature - ); - - if (!$valid_sig) { - throw new OAuthException("Invalid signature"); - } - } - - /** - * check that the timestamp is new enough - */ - private function check_timestamp($timestamp) { - if( ! $timestamp ) - throw new OAuthException( - 'Missing timestamp parameter. The parameter is required' - ); - - // verify that timestamp is recentish - $now = time(); - if (abs($now - $timestamp) > $this->timestamp_threshold) { - throw new OAuthException( - "Expired timestamp, yours $timestamp, ours $now" - ); - } - } - - /** - * check that the nonce is not repeated - */ - private function check_nonce($consumer, $token, $nonce, $timestamp) { - if( ! $nonce ) - throw new OAuthException( - 'Missing nonce parameter. The parameter is required' - ); - - // verify that the nonce is uniqueish - $found = $this->data_store->lookup_nonce( - $consumer, - $token, - $nonce, - $timestamp - ); - if ($found) { - throw new OAuthException("Nonce already used: $nonce"); - } - } - -} - -class OAuthDataStore { - function lookup_consumer($consumer_key) { - // implement me - } - - function lookup_token($consumer, $token_type, $token) { - // implement me - } - - function lookup_nonce($consumer, $token, $nonce, $timestamp) { - // implement me - } - - function new_request_token($consumer, $callback = null) { - // return a new token attached to this consumer - } - - function new_access_token($token, $consumer, $verifier = null) { - // return a new access token attached to this consumer - // for the user associated with this token if the request token - // is authorized - // should also invalidate the request token - } - -} - -class OAuthUtil { - public static function urlencode_rfc3986($input) { - if (is_array($input)) { - return array_map(array('OAuthUtil', 'urlencode_rfc3986'), $input); - } else if (is_scalar($input)) { - return str_replace( - '+', - ' ', - str_replace('%7E', '~', rawurlencode($input)) - ); - } else { - return ''; - } -} - - - // This decode function isn't taking into consideration the above - // modifications to the encoding process. However, this method doesn't - // seem to be used anywhere so leaving it as is. - public static function urldecode_rfc3986($string) { - return urldecode($string); - } - - // Utility function for turning the Authorization: header into - // parameters, has to do some unescaping - // Can filter out any non-oauth parameters if needed (default behaviour) - public static function split_header($header, $only_allow_oauth_parameters = true) { - $pattern = '/(([-_a-z]*)=("([^"]*)"|([^,]*)),?)/'; - $offset = 0; - $params = array(); - while (preg_match($pattern, $header, $matches, PREG_OFFSET_CAPTURE, $offset) > 0) { - $match = $matches[0]; - $header_name = $matches[2][0]; - $header_content = (isset($matches[5])) ? $matches[5][0] : $matches[4][0]; - if (preg_match('/^oauth_/', $header_name) || !$only_allow_oauth_parameters) { - $params[$header_name] = OAuthUtil::urldecode_rfc3986($header_content); - } - $offset = $match[1] + strlen($match[0]); - } - - if (isset($params['realm'])) { - unset($params['realm']); - } - - return $params; - } - - // helper to try to sort out headers for people who aren't running apache - public static function get_headers() { - if (function_exists('apache_request_headers')) { - // we need this to get the actual Authorization: header - // because apache tends to tell us it doesn't exist - $headers = apache_request_headers(); - - // sanitize the output of apache_request_headers because - // we always want the keys to be Cased-Like-This and arh() - // returns the headers in the same case as they are in the - // request - $out = array(); - foreach( $headers AS $key => $value ) { - $key = str_replace( - " ", - "-", - ucwords(strtolower(str_replace("-", " ", $key))) - ); - $out[$key] = $value; - } - } else { - // otherwise we don't have apache and are just going to have to hope - // that $_SERVER actually contains what we need - $out = array(); - if( isset($_SERVER['CONTENT_TYPE']) ) - $out['Content-Type'] = $_SERVER['CONTENT_TYPE']; - if( isset($_ENV['CONTENT_TYPE']) ) - $out['Content-Type'] = $_ENV['CONTENT_TYPE']; - - foreach ($_SERVER as $key => $value) { - if (substr($key, 0, 5) == "HTTP_") { - // this is chaos, basically it is just there to capitalize the first - // letter of every word that is not an initial HTTP and strip HTTP - // code from przemek - $key = str_replace( - " ", - "-", - ucwords(strtolower(str_replace("_", " ", substr($key, 5)))) - ); - $out[$key] = $value; - } - } - } - return $out; - } - - // This function takes a input like a=b&a=c&d=e and returns the parsed - // parameters like this - // array('a' => array('b','c'), 'd' => 'e') - public static function parse_parameters( $input ) { - if (!isset($input) || !$input) return array(); - - $pairs = explode('&', $input); - - $parsed_parameters = array(); - foreach ($pairs as $pair) { - $split = explode('=', $pair, 2); - $parameter = OAuthUtil::urldecode_rfc3986($split[0]); - $value = isset($split[1]) ? OAuthUtil::urldecode_rfc3986($split[1]) : ''; - - if (isset($parsed_parameters[$parameter])) { - // We have already recieved parameter(s) with this name, so add to the list - // of parameters with this name - - if (is_scalar($parsed_parameters[$parameter])) { - // This is the first duplicate, so transform scalar (string) into an array - // so we can add the duplicates - $parsed_parameters[$parameter] = array($parsed_parameters[$parameter]); - } - - $parsed_parameters[$parameter][] = $value; - } else { - $parsed_parameters[$parameter] = $value; - } - } - return $parsed_parameters; - } - - public static function build_http_query($params) { - if (!$params) return ''; - - // Urlencode both keys and values - $keys = OAuthUtil::urlencode_rfc3986(array_keys($params)); - $values = OAuthUtil::urlencode_rfc3986(array_values($params)); - $params = array_combine($keys, $values); - - // Parameters are sorted by name, using lexicographical byte value ordering. - // Ref: Spec: 9.1.1 (1) - uksort($params, 'strcmp'); - - $pairs = array(); - foreach ($params as $parameter => $value) { - if (is_array($value)) { - // If two or more parameters share the same name, they are sorted by their value - // Ref: Spec: 9.1.1 (1) - natsort($value); - foreach ($value as $duplicate_value) { - $pairs[] = $parameter . '=' . $duplicate_value; - } - } else { - $pairs[] = $parameter . '=' . $value; - } - } - // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61) - // Each name-value pair is separated by an '&' character (ASCII code 38) - return implode('&', $pairs); - } -} - -?> diff --git a/3.1/modules/twitter/vendor/twitteroauth/images/darker.png b/3.1/modules/twitter/vendor/twitteroauth/images/darker.png deleted file mode 100644 index 746b6b9f..00000000 Binary files a/3.1/modules/twitter/vendor/twitteroauth/images/darker.png and /dev/null differ diff --git a/3.1/modules/twitter/vendor/twitteroauth/images/lighter.png b/3.1/modules/twitter/vendor/twitteroauth/images/lighter.png deleted file mode 100644 index 297bb034..00000000 Binary files a/3.1/modules/twitter/vendor/twitteroauth/images/lighter.png and /dev/null differ diff --git a/3.1/modules/twitter/vendor/twitteroauth/twitteroauth.php b/3.1/modules/twitter/vendor/twitteroauth/twitteroauth.php deleted file mode 100644 index 674308ae..00000000 --- a/3.1/modules/twitter/vendor/twitteroauth/twitteroauth.php +++ /dev/null @@ -1,245 +0,0 @@ -http_status; } - function lastAPICall() { return $this->last_api_call; } - - /** - * construct TwitterOAuth object - */ - function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) { - $this->sha1_method = new OAuthSignatureMethod_HMAC_SHA1(); - $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret); - if (!empty($oauth_token) && !empty($oauth_token_secret)) { - $this->token = new OAuthConsumer($oauth_token, $oauth_token_secret); - } else { - $this->token = NULL; - } - } - - - /** - * Get a request_token from Twitter - * - * @returns a key/value array containing oauth_token and oauth_token_secret - */ - function getRequestToken($oauth_callback = NULL) { - $parameters = array(); - if (!empty($oauth_callback)) { - $parameters['oauth_callback'] = $oauth_callback; - } - $request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters); - $token = OAuthUtil::parse_parameters($request); - $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); - return $token; - } - - /** - * Get the authorize URL - * - * @returns a string - */ - function getAuthorizeURL($token, $sign_in_with_twitter = TRUE) { - if (is_array($token)) { - $token = $token['oauth_token']; - } - if (empty($sign_in_with_twitter)) { - return $this->authorizeURL() . "?oauth_token={$token}"; - } else { - return $this->authenticateURL() . "?oauth_token={$token}"; - } - } - - /** - * Exchange request token and secret for an access token and - * secret, to sign API calls. - * - * @returns array("oauth_token" => "the-access-token", - * "oauth_token_secret" => "the-access-secret", - * "user_id" => "9436992", - * "screen_name" => "abraham") - */ - function getAccessToken($oauth_verifier = FALSE) { - $parameters = array(); - if (!empty($oauth_verifier)) { - $parameters['oauth_verifier'] = $oauth_verifier; - } - $request = $this->oAuthRequest($this->accessTokenURL(), 'GET', $parameters); - $token = OAuthUtil::parse_parameters($request); - $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); - return $token; - } - - /** - * One time exchange of username and password for access token and secret. - * - * @returns array("oauth_token" => "the-access-token", - * "oauth_token_secret" => "the-access-secret", - * "user_id" => "9436992", - * "screen_name" => "abraham", - * "x_auth_expires" => "0") - */ - function getXAuthToken($username, $password) { - $parameters = array(); - $parameters['x_auth_username'] = $username; - $parameters['x_auth_password'] = $password; - $parameters['x_auth_mode'] = 'client_auth'; - $request = $this->oAuthRequest($this->accessTokenURL(), 'POST', $parameters); - $token = OAuthUtil::parse_parameters($request); - $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']); - return $token; - } - - /** - * GET wrapper for oAuthRequest. - */ - function get($url, $parameters = array()) { - $response = $this->oAuthRequest($url, 'GET', $parameters); - if ($this->format === 'json' && $this->decode_json) { - return json_decode($response); - } - return $response; - } - - /** - * POST wrapper for oAuthRequest. - */ - function post($url, $parameters = array()) { - $response = $this->oAuthRequest($url, 'POST', $parameters); - if ($this->format === 'json' && $this->decode_json) { - return json_decode($response); - } - return $response; - } - - /** - * DELETE wrapper for oAuthReqeust. - */ - function delete($url, $parameters = array()) { - $response = $this->oAuthRequest($url, 'DELETE', $parameters); - if ($this->format === 'json' && $this->decode_json) { - return json_decode($response); - } - return $response; - } - - /** - * Format and sign an OAuth / API request - */ - function oAuthRequest($url, $method, $parameters) { - if (strrpos($url, 'https://') !== 0 && strrpos($url, 'http://') !== 0) { - $url = "{$this->host}{$url}.{$this->format}"; - } - $request = OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $method, $url, $parameters); - $request->sign_request($this->sha1_method, $this->consumer, $this->token); - switch ($method) { - case 'GET': - return $this->http($request->to_url(), 'GET'); - default: - return $this->http($request->get_normalized_http_url(), $method, $request->to_postdata()); - } - } - - /** - * Make an HTTP request - * - * @return API results - */ - function http($url, $method, $postfields = NULL) { - $this->http_info = array(); - $ci = curl_init(); - /* Curl settings */ - curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent); - curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout); - curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout); - curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE); - curl_setopt($ci, CURLOPT_HTTPHEADER, array('Expect:')); - curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer); - curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader')); - curl_setopt($ci, CURLOPT_HEADER, FALSE); - - switch ($method) { - case 'POST': - curl_setopt($ci, CURLOPT_POST, TRUE); - if (!empty($postfields)) { - curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields); - } - break; - case 'DELETE': - curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE'); - if (!empty($postfields)) { - $url = "{$url}?{$postfields}"; - } - } - - curl_setopt($ci, CURLOPT_URL, $url); - $response = curl_exec($ci); - $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE); - $this->http_info = array_merge($this->http_info, curl_getinfo($ci)); - $this->url = $url; - curl_close ($ci); - return $response; - } - - /** - * Get the header info to store. - */ - function getHeader($ch, $header) { - $i = strpos($header, ':'); - if (!empty($i)) { - $key = str_replace('-', '_', strtolower(substr($header, 0, $i))); - $value = trim(substr($header, $i + 2)); - $this->http_header[$key] = $value; - } - return strlen($header); - } -} diff --git a/3.1/modules/twitter/views/admin_twitter.html.php b/3.1/modules/twitter/views/admin_twitter.html.php deleted file mode 100644 index 807a72df..00000000 --- a/3.1/modules/twitter/views/admin_twitter.html.php +++ /dev/null @@ -1,30 +0,0 @@ - -
        -

        - -

        dev.twitter.com/apps/new.", - array("twitter_apps_reg" => "http://dev.twitter.com/apps/new")) ?>

        -
          -
        • -
        • -
        • url::abs_site())) ?>
        • -
        • -
        • -
        • url::abs_site())) ?>
        • -
        • -
        -

        - -

        Twitter application settings, if necessary.", - array("twitter_apps" => "http://dev.twitter.com/apps")) ?>

        - -

        bit.ly module to shorten - Gallery URLs in tweets.", array("bitly_module_url" => "http://codex.gallery2.org/Gallery3:Modules:bitly")) ?>

        - - -
        - -
        -
        diff --git a/3.1/modules/twitter/views/twitter_dialog.html.php b/3.1/modules/twitter/views/twitter_dialog.html.php deleted file mode 100644 index b39c7928..00000000 --- a/3.1/modules/twitter/views/twitter_dialog.html.php +++ /dev/null @@ -1,22 +0,0 @@ - - -
        -

        $type, "title"=> $title)) ?>

        - -

        - -

        -

        " alt="Sign in with Twitter"/>

        - -
        - -
        - -
        -
        - -
        \ No newline at end of file diff --git a/3.1/modules/user_albums/helpers/user_albums_event.php b/3.1/modules/user_albums/helpers/user_albums_event.php deleted file mode 100644 index 1d852e80..00000000 --- a/3.1/modules/user_albums/helpers/user_albums_event.php +++ /dev/null @@ -1,53 +0,0 @@ -name}"; - $group = identity::lookup_group_by_name($group_name); - if (!$group) { - $group = identity::create_group($group_name); - identity::add_user_to_group($user, $group); - } - - // Create an album for the user, if it doesn't exist - $album = ORM::factory("item") - ->where("parent_id", "=", item::root()->id) - ->where("name", "=", $user->name) - ->find(); - if (!$album->loaded()) { - $album->type = "album"; - $album->name = $user->name; - $album->title = "{$user->name}'s album"; - $album->parent_id = item::root()->id; - $album->sort_column = "weight"; - $album->sort_order = "asc"; - $album->save(); - - access::allow($group, "view", item::root()); - access::allow($group, "view_full", $album); - access::allow($group, "edit", $album); - access::allow($group, "add", $album); - } - } -} diff --git a/3.1/modules/user_albums/module.info b/3.1/modules/user_albums/module.info deleted file mode 100644 index 548ea98e..00000000 --- a/3.1/modules/user_albums/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "User Albums" -description = "Create a personal album for new users" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:user_albums" -discuss_url = "http://gallery.menalto.com/forum_module_user_albums" diff --git a/3.1/modules/user_homes/helpers/user_homes_event.php b/3.1/modules/user_homes/helpers/user_homes_event.php deleted file mode 100644 index 0f247c79..00000000 --- a/3.1/modules/user_homes/helpers/user_homes_event.php +++ /dev/null @@ -1,297 +0,0 @@ -where("id", "=", $user->id)->find(); - if ($home->loaded() && $home->home != 0) { - $continue_url = Session::instance()->get("continue_url", null); - if ($continue_url == null){ - Session::instance()->set("redirect_home", $home->home); - } - } - } - - /** - * called after a log in occurs and when the first gallery is loaded. - * if the home variable exists on the session then a redirect will - * occur to that home and the variable removed from the session to - */ - static function gallery_ready() { - $session = Session::instance(); - $home = $session->get("redirect_home"); - if ($home) { - // Remove from session to ensure redirect does not occur again - $session->set("redirect_home",null); - url::redirect("albums/$home"); - } - } - - /** - * Called just before a user is deleted. This will remove the user from - * the user_homes directory. - */ - static function user_before_delete($user) { - ORM::factory("user_home") - ->where("id", "=", $user->id) - ->delete_all(); - } - - /** - * Called when admin is adding a user - */ - static function user_add_form_admin($user, $form) { - $form->add_user->dropdown("user_home") - ->label(t("Home Gallery")) - ->options(self::createGalleryArray()) - ->selected(0); - } - - /** - * Called after a user has been added - */ - static function user_add_form_admin_completed($user, $form) { - $home = ORM::factory("user_home")->where("id", "=", $user->id)->find(); - $home->id = $user->id; - $home->home = $form->add_user->user_home->value; - $home->save(); - } - - /** - * Called when admin is editing a user - */ - static function user_edit_form_admin($user, $form) { - $home = ORM::factory("user_home")->where("id", "=", $user->id)->find(); - if ($home->loaded()) { - $selected = $home->home; - } else { - $selected = 0; - } - $form->edit_user->dropdown("user_home") - ->label(t("Home Gallery")) - ->options(self::createGalleryArray()) - ->selected($selected); - } - - /** - * Called after a user had been edited by the admin - */ - static function user_edit_form_admin_completed($user, $form) { - $home = ORM::factory("user_home")->where("id", "=", $user->id)->find(); - $home->id = $user->id; - $home->home = $form->edit_user->user_home->value; - $home->save(); - } - - - /** - * Called when user is editing their own form - */ - static function user_edit_form($user, $form) { - $home = ORM::factory("user_home")->where("id", "=", $user->id)->find(); - - if ($home->loaded()) { - $selected = $home->home; - } else { - $selected = 0; - } - - $form->edit_user->dropdown("user_home") - ->label(t("Home Gallery")) - ->options(self::createGalleryArray()) - ->selected($selected); - } - - /** - * Called after a user had been edited by the user - */ - static function user_edit_form_completed($user, $form) { - $home = ORM::factory("user_home")->where("id", "=", $user->id)->find(); - $home->id = $user->id; - $home->home = $form->edit_user->user_home->value; - $home->save(); - } - - /** - * Creates an array of galleries - */ - static function createGalleryArray() { - $array[0] = "none"; - $root = ORM::factory("item", 1); - self::tree($root, "", $array); - return $array; - } - - /** - * recursive function to build array for drop down list - */ - static function tree($parent, $dashes, &$array) { - if ($parent->id == "1") { - $array[$parent->id] = ORM::factory("item", 1)->title; - } else { - $array[$parent->id] = "$dashes $parent->name"; - } - - $albums = ORM::factory("item") - ->where("parent_id", "=", $parent->id) - ->where("type", "=", "album") - ->order_by("title", "ASC") - ->find_all(); - foreach ($albums as $album) { - self::tree($album, "-$dashes", $array); - } - return; - } - - static function show_user_profile($data) { - $home = ORM::factory("user_home")->where("id", "=", $data->user->id)->find(); - - if ($home->loaded()) { - $view = new View("user_profile_home.html"); - $item = ORM::factory("item")->where("id", "=", $home->home)->find(); - if ($item->loaded()) { - $view->item = $item; - $data->content[] = (object)array("title" => t("Home album"), "view" => $view); - } - } - } - - static function album_add_form($parent, $form){ - - $group = $form->group("privacy") - ->label(t("album privacy settings")); - $group->checkbox("private")->label(t("Private"))->id("uh_private")->onClick("pc()"); - $group->input("username")->label(t("Username"))->id("uh_username") - ->callback("user_homes_event::valid_name") - ->error_messages("in_use", t("There is already a user with that username")) - ->error_messages("required", t("You must enter a username"))->callback("user_homes_event::valid_name")->rules("length[1,32]"); - $group->password("password")->label(t("Password"))->id("uh_password") - ->callback("user_homes_event::valid_password") - ->error_messages("required", t("You must enter a password")) - ->error_messages("minlength", t("Password is not long enough")); - $group->password("password2")->label(t("Confirm password"))->id("uh_password2") - ->error_messages("matches", t("Passwords do not match")) - ->matches($group->password); - - $form->script("")->url(url::abs_file("modules/user_homes/js/user_homes_add_album.js")); - } - - /** - * Validate the user name. Make sure there are no conflicts. - */ - static function valid_password($field) { - $input = Input::instance(); - $method = $field->method; - $checked = $input->$method("private", false); - if ($checked) - { - if (!$field->value || strlen($field->value)==0){ - $field->add_error("required", 1); - } - else - { - $minimum_length = module::get_var("user", "mininum_password_length", 5); - if (strlen($field->value) < $minimum_length) { - $field->add_error("minlength", 1); - } - } - } - - } - - /** - * Validate the user name. Make sure there are no conflicts. - */ - static function valid_name($field) { - $input = Input::instance(); - $method = $field->method; - $checked = $input->$method("private", false); - - if ($checked) - { - if (!$field->value || strlen($field->value)==0){ - $field->add_error("required", 1); - } - elseif (db::build()->from("users") - ->where("name", "=", $field->value) - ->count_records() == 1) { - $field->add_error("in_use", 1); - } - } - } - - - static function album_add_form_completed($album, $form){ - if ($form->privacy->private->checked) - { - $username = $form->privacy->username->value; - $password = $form->privacy->password->value; - - // TODO validation - - // create a group based on username - $group = identity::create_group($username); - - // create a user based on username - $user = identity::create_user($username, $username, $password, $username."@unknown.com"); - - identity::add_user_to_group($user,$group->id); - - // create user home - $home = ORM::factory("user_home")->where("id", "=", $user->id)->find(); - $home->id = $user->id; - $home->home = $album->id; - $home->save(); - - // reload album - $album->reload(); - - // set permissions - // deny all groups. - $groups = ORM::factory("group")->find_all(); - foreach ($groups as $group2){ - if ($group->id != $group2->id){ - access::deny($group2 , "view", $album); - access::deny($group2 , "view_full", $album); - } - } - - // deny all other albums - $albums = ORM::factory("item") - ->where("type", "=", "album")->find_all(); - foreach($albums as $albumt){ - access::deny($group,"view", $albumt); - } - - // allow access to newly created group - access::allow($group, "view_full", $album); - $parents = $album->parents(); - foreach ($parents as $parent){ - access::allow($group, "view", $parent); - } - access::allow($group, "view", $album); - } - } -} diff --git a/3.1/modules/user_homes/helpers/user_homes_installer.php b/3.1/modules/user_homes/helpers/user_homes_installer.php deleted file mode 100644 index ec75c059..00000000 --- a/3.1/modules/user_homes/helpers/user_homes_installer.php +++ /dev/null @@ -1,40 +0,0 @@ -query("CREATE TABLE IF NOT EXISTS {user_homes} ( - `id` int(9) NOT NULL, - `home` int(9) default NULL, - PRIMARY KEY (`id`), - UNIQUE KEY(`id`)) - DEFAULT CHARSET=utf8;"); - module::set_version("user_homes", 1); - } - - /** - * Drops the table of user homes when the module is uninstalled. - */ - static function uninstall() { - $db = Database::instance(); - $db->query("DROP TABLE IF EXISTS {user_homes};"); - } -} diff --git a/3.1/modules/user_homes/js/user_homes_add_album.js b/3.1/modules/user_homes/js/user_homes_add_album.js deleted file mode 100644 index a2c4fff8..00000000 --- a/3.1/modules/user_homes/js/user_homes_add_album.js +++ /dev/null @@ -1,3 +0,0 @@ -var p=document.getElementById("uh_private"),u=document.getElementById("uh_username"),a=document.getElementById("uh_password"),b=document.getElementById("uh_password2"); -function pc(){u.disabled=!p.checked;a.disabled=!p.checked;b.disabled=!p.checked;} -pc(); \ No newline at end of file diff --git a/3.1/modules/user_homes/models/user_home.php b/3.1/modules/user_homes/models/user_home.php deleted file mode 100644 index 59d35daa..00000000 --- a/3.1/modules/user_homes/models/user_home.php +++ /dev/null @@ -1,22 +0,0 @@ - -
        - -
        diff --git a/3.1/modules/user_rest/helpers/user_rest.php b/3.1/modules/user_rest/helpers/user_rest.php deleted file mode 100644 index 4acd0d25..00000000 --- a/3.1/modules/user_rest/helpers/user_rest.php +++ /dev/null @@ -1,53 +0,0 @@ -url); - - return array( - "url" => $request->url, - "entity" => array( - "display_name" => $user->display_name() - ) - ); - } - - - static function resolve($id) { - $user = identity::lookup_user($id); - - if (!self::_can_view_profile_pages($user)) { - throw new Kohana_404_Exception(); - } - return $user; - } - - - static function _can_view_profile_pages($user) { - if (!$user->loaded()) { - return false; - } - - if ($user->id == identity::active_user()->id) { - // You can always view your own profile - return true; - } - - switch (module::get_var("gallery", "show_user_profiles_to")) { - case "admin_users": - return identity::active_user()->admin; - - case "registered_users": - return !identity::active_user()->guest; - - case "everybody": - return true; - - default: - // Fail in private mode on an invalid setting - return false; - } - } -} - - ?> \ No newline at end of file diff --git a/3.1/modules/user_rest/helpers/user_rest_installer.php b/3.1/modules/user_rest/helpers/user_rest_installer.php deleted file mode 100644 index 32c800f2..00000000 --- a/3.1/modules/user_rest/helpers/user_rest_installer.php +++ /dev/null @@ -1,30 +0,0 @@ -is_movie()) { - $form->edit_item->input("vidheight")->label(t("Video Height")) - ->value($item->height); - $form->edit_item->input("vidwidth")->label(t("Video Width")) - ->value($item->width); - } - } - - static function item_edit_form_completed($item, $form) { - // Save the new height and width to the database. - if ($item->is_movie()) { - $item->height = $form->edit_item->vidheight->value; - $item->width = $form->edit_item->vidwidth->value; - $item->save(); - } - } -} diff --git a/3.1/modules/videodimensions/module.info b/3.1/modules/videodimensions/module.info deleted file mode 100644 index 3a8c101f..00000000 --- a/3.1/modules/videodimensions/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "VideoDimensions" -description = "Manually edit the dimensions of a video." -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:videodimensions" -discuss_url = "http://gallery.menalto.com/forum_module_videodimensions" diff --git a/3.1/modules/videos/controllers/admin_videos.php b/3.1/modules/videos/controllers/admin_videos.php deleted file mode 100644 index 81d691cb..00000000 --- a/3.1/modules/videos/controllers/admin_videos.php +++ /dev/null @@ -1,100 +0,0 @@ -page_title = t("Add from server"); - $view->content = new View("admin_videos.html"); - $view->content->form = $this->_get_admin_form(); - $paths = unserialize(module::get_var("videos", "authorized_paths", "a:0:{}")); - $view->content->paths = array_keys($paths); - - print $view; - } - - public function add_path() { - access::verify_csrf(); - - $form = $this->_get_admin_form(); - $paths = unserialize(module::get_var("videos", "authorized_paths", "a:0:{}")); - if ($form->validate()) { - if (is_link($form->add_path->path->value)) { - $form->add_path->path->add_error("is_symlink", 1); - } else if (!is_readable($form->add_path->path->value)) { - $form->add_path->path->add_error("not_readable", 1); - } else { - $path = $form->add_path->path->value; - $paths[$path] = 1; - module::set_var("videos", "authorized_paths", serialize($paths)); - message::success(t("Added path %path", array("path" => $path))); - videos::check_config($paths); - url::redirect("admin/videos"); - } - } - - $view = new Admin_View("admin.html"); - $view->content = new View("admin_videos.html"); - $view->content->form = $form; - $view->content->paths = array_keys($paths); - print $view; - } - - public function remove_path() { - access::verify_csrf(); - - $path = Input::instance()->get("path"); - $paths = unserialize(module::get_var("videos", "authorized_paths")); - if (isset($paths[$path])) { - unset($paths[$path]); - message::success(t("Removed path %path", array("path" => $path))); - module::set_var("videos", "authorized_paths", serialize($paths)); - videos::check_config($paths); - } - url::redirect("admin/videos"); - } - - public function autocomplete() { - $directories = array(); - $path_prefix = Input::instance()->get("q"); - foreach (glob("{$path_prefix}*") as $file) { - if (is_dir($file) && !is_link($file)) { - $directories[] = $file; - } - } - - print implode("\n", $directories); - } - - private function _get_admin_form() { - $form = new Forge("admin/videos/add_path", "", "post", - array("id" => "g-server-add-admin-form", "class" => "g-short-form")); - $add_path = $form->group("add_path"); - $add_path->input("path")->label(t("Path"))->rules("required")->id("g-path") - ->error_messages("not_readable", t("This directory is not readable by the webserver")) - ->error_messages("is_symlink", t("Symbolic links are not allowed")); - $add_path->submit("add")->value(t("Add Path")); - - return $form; - } -} diff --git a/3.1/modules/videos/controllers/file_proxy.php b/3.1/modules/videos/controllers/file_proxy.php deleted file mode 100644 index f69bff1b..00000000 --- a/3.1/modules/videos/controllers/file_proxy.php +++ /dev/null @@ -1,144 +0,0 @@ -server("REQUEST_URI")); - - // get rid of query parameters - // request_uri: gallery3/var/albums/foo/bar.jpg - $request_uri = preg_replace("/\?.*/", "", $request_uri); - - // var_uri: gallery3/var/ - $var_uri = url::file("var/"); - - // Make sure that the request is for a file inside var - $offset = strpos(rawurldecode($request_uri), $var_uri); - if ($offset !== 0) { - throw new Kohana_404_Exception(); - } - - // file_uri: albums/foo/bar.jpg - $file_uri = substr($request_uri, strlen($var_uri)); - - // type: albums - // path: foo/bar.jpg - list ($type, $path) = explode("/", $file_uri, 2); - if ($type != "resizes" && $type != "albums" && $type != "thumbs") { - throw new Kohana_404_Exception(); - } - - // If the last element is .album.jpg, pop that off since it's not a real item - $path = preg_replace("|/.album.jpg$|", "", $path); - - $item = item::find_by_path($path); - if (!$item->loaded()) { - // We didn't turn it up. If we're looking for a .jpg then it's it's possible that we're - // requesting the thumbnail for a movie. In that case, the .flv, .mp4 or .m4v file would - // have been converted to a .jpg. So try some alternate types: - if (preg_match('/.jpg$/', $path)) { - // rWatcher Mod: look for videos with file extensions supported by the videos module in addition to flv mp4 and m4v - // Original Line: foreach (array("flv", "mp4", "m4v") as $ext) { - foreach (array_merge(array("flv", "mp4", "m4v"), unserialize(module::get_var("videos", "allowed_extensions"))) as $ext) { - $movie_path = preg_replace('/.jpg$/', ".$ext", $path); - $item = item::find_by_path($movie_path); - if ($item->loaded()) { - break; - } - } - } - // rWatcher Mod: - // If we're looking for a .flv then it's it's possible that we're requesting a flash resize - // for a movie. - if (strtolower(substr($path, strlen($path)-4)) == ".flv") { - $movie_path = str_ireplace(".flv", "", $path); - $item = ORM::factory("item")->where("relative_path_cache", "=", $movie_path)->find(); - } - // END rWatcher Mod - } - - if (!$item->loaded()) { - throw new Kohana_404_Exception(); - } - - // Make sure we have access to the item - if (!access::can("view", $item)) { - throw new Kohana_404_Exception(); - } - - // Make sure we have view_full access to the original - if ($type == "albums" && !access::can("view_full", $item)) { - throw new Kohana_404_Exception(); - } - - // Don't try to load a directory - if ($type == "albums" && $item->is_album()) { - throw new Kohana_404_Exception(); - } - - if ($type == "albums") { - $file = $item->file_path(); - } else if ($type == "resizes") { - $file = $item->resize_path(); - // rWatcher MOD - // If the resize is for a movie, assume it needs a .flv extension. - if ($item->is_movie()) { - $file = $file . ".flv"; - } - // End rWatcher MOD - } else { - $file = $item->thumb_path(); - } - - if (!file_exists($file)) { - throw new Kohana_404_Exception(); - } - - header("Content-Length: " . filesize($file)); - - header("Pragma:"); - // Check that the content hasn't expired or it wasn't changed since cached - expires::check(2592000, $item->updated); - - // We don't need to save the session for this request - Session::instance()->abort_save(); - - expires::set(2592000, $item->updated); // 30 days - - // Dump out the image. If the item is a movie, then its thumbnail will be a JPG. - if ($item->is_movie() && $type != "albums") { - header("Content-Type: image/jpeg"); - } else { - header("Content-Type: $item->mime_type"); - } - Kohana::close_buffers(false); - readfile($file); - } -} diff --git a/3.1/modules/videos/controllers/videos.php b/3.1/modules/videos/controllers/videos.php deleted file mode 100644 index 34461b3e..00000000 --- a/3.1/modules/videos/controllers/videos.php +++ /dev/null @@ -1,341 +0,0 @@ -where("task_id", "NOT IN", db::build()->select("id")->from("tasks")) - ->delete("videos_entries") - ->execute(); - - $item = ORM::factory("item", $id); - $view = new View("videos_tree_dialog.html"); - $view->item = $item; - $view->tree = new View("videos_tree.html"); - $view->tree->files = $files; - $view->tree->parents = array(); - print $view; - } - - public function children() { - $path = Input::instance()->get("path"); - - $tree = new View("videos_tree.html"); - $tree->files = array(); - $tree->parents = array(); - - // Make a tree with the parents back up to the authorized path, and all the children under the - // current path. - if (videos::is_valid_path($path)) { - $tree->parents[] = $path; - while (videos::is_valid_path(dirname($tree->parents[0]))) { - array_unshift($tree->parents, dirname($tree->parents[0])); - } - - $glob_path = str_replace(array("{", "}", "[", "]"), array("\{", "\}", "\[", "\]"), $path); - foreach (glob("$glob_path/*") as $file) { - if (!is_readable($file)) { - continue; - } - if (!is_dir($file)) { - $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION)); - // rWatcher Edit - //if (!in_array($ext, array("gif", "jpeg", "jpg", "png", "flv", "mp4", "m4v"))) { - if (!in_array($ext, unserialize(module::get_var("videos", "allowed_extensions")))) { - continue; - } - } - - $tree->files[] = $file; - } - } else { - // Missing or invalid path; print out the list of authorized path - $paths = unserialize(module::get_var("videos", "authorized_paths")); - foreach (array_keys($paths) as $path) { - $tree->files[] = $path; - } - } - print $tree; - } - - /** - * Begin the task of adding photos. - */ - public function start() { - access::verify_csrf(); - $item = ORM::factory("item", Input::instance()->get("item_id")); - - $task_def = Task_Definition::factory() - ->callback("Videos_Controller::add") - ->description(t("Add photos or movies from the local server")) - ->name(t("Add from server")); - $task = task::create($task_def, array("item_id" => $item->id)); - - foreach (Input::instance()->post("paths") as $path) { - if (videos::is_valid_path($path)) { - $entry = ORM::factory("videos_entry"); - $entry->path = $path; - $entry->is_directory = intval(is_dir($path)); - $entry->parent_id = null; - $entry->task_id = $task->id; - $entry->save(); - } - } - - json::reply( - array("result" => "started", - "status" => (string)$task->status, - "url" => url::site("videos/run/$task->id?csrf=" . access::csrf_token()))); - } - - /** - * Run the task of adding photos - */ - function run($task_id) { - access::verify_csrf(); - - $task = ORM::factory("task", $task_id); - if (!$task->loaded() || $task->owner_id != identity::active_user()->id) { - access::forbidden(); - } - - $task = task::run($task_id); - // Prevent the JavaScript code from breaking by forcing a period as - // decimal separator for all locales with sprintf("%F", $value). - json::reply(array("done" => (bool)$task->done, - "status" => (string)$task->status, - "percent_complete" => sprintf("%F", $task->percent_complete))); - } - - /** - * This is the task code that adds photos and albums. It first examines all the target files - * and creates a set of Server_Add_Entry_Models, then runs through the list of models and adds - * them one at a time. - */ - static function add($task) { - $mode = $task->get("mode", "init"); - $start = microtime(true); - - switch ($mode) { - case "init": - $task->set("mode", "build-file-list"); - $task->set("dirs_scanned", 0); - $task->percent_complete = 0; - $task->status = t("Starting up"); - batch::start(); - break; - - case "build-file-list": // 0% to 10% - // We can't fit an arbitrary number of paths in a task, so store them in a separate table. - // Don't use an iterator here because we can't get enough control over it when we're dealing - // with a deep hierarchy and we don't want to go over our time quota. - $paths = unserialize(module::get_var("videos", "authorized_paths")); - $dirs_scanned = $task->get("dirs_scanned"); - while (microtime(true) - $start < 0.5) { - // Process every directory that doesn't yet have a parent id, these are the - // paths that we're importing. - $entry = ORM::factory("videos_entry") - ->where("task_id", "=", $task->id) - ->where("is_directory", "=", 1) - ->where("checked", "=", 0) - ->order_by("id", "ASC") - ->find(); - - if ($entry->loaded()) { - $child_paths = glob(preg_quote($entry->path) . "/*"); - if (!$child_paths) { - $child_paths = glob("{$entry->path}/*"); - } - foreach ($child_paths as $child_path) { - if (!is_dir($child_path)) { - $ext = strtolower(pathinfo($child_path, PATHINFO_EXTENSION)); - // rWatcher Edit. - //if (!in_array($ext, array("gif", "jpeg", "jpg", "png", "flv", "mp4", "m4v")) || - // !filesize($child_path)) { - if (!in_array($ext, unserialize(module::get_var("videos", "allowed_extensions"))) || - !filesize($child_path)) { - // Not importable, skip it. - continue; - } - } - - $child_entry = ORM::factory("videos_entry"); - $child_entry->task_id = $task->id; - $child_entry->path = $child_path; - $child_entry->parent_id = $entry->id; // null if the parent was a staging dir - $child_entry->is_directory = is_dir($child_path); - $child_entry->save(); - } - - // We've processed this entry, mark it as done. - $entry->checked = 1; - $entry->save(); - $dirs_scanned++; - } - } - - // We have no idea how long this can take because we have no idea how deep the tree - // hierarchy rabbit hole goes. Leave ourselves room here for 100 iterations and don't go - // over 10% in percent_complete. - $task->set("dirs_scanned", $dirs_scanned); - $task->percent_complete = min($task->percent_complete + 0.1, 10); - $task->status = t2("Scanned one directory", "Scanned %count directories", $dirs_scanned); - - if (!$entry->loaded()) { - $task->set("mode", "add-files"); - $task->set( - "total_files", - ORM::factory("videos_entry")->where("task_id", "=", $task->id)->count_all()); - $task->percent_complete = 10; - } - break; - - case "add-files": // 10% to 100% - $completed_files = $task->get("completed_files", 0); - $total_files = $task->get("total_files"); - - // Ordering by id ensures that we add them in the order that we created the entries, which - // will create albums first. Ignore entries which already have an Item_Model attached, - // they're done. - $entries = ORM::factory("videos_entry") - ->where("task_id", "=", $task->id) - ->where("item_id", "IS", null) - ->order_by("id", "ASC") - ->limit(10) - ->find_all(); - if ($entries->count() == 0) { - // Out of entries, we're done. - $task->set("mode", "done"); - } - - $owner_id = identity::active_user()->id; - foreach ($entries as $entry) { - if (microtime(true) - $start > 0.5) { - break; - } - - // Look up the parent item for this entry. By now it should exist, but if none was - // specified, then this belongs as a child of the current item. - $parent_entry = ORM::factory("videos_entry", $entry->parent_id); - if (!$parent_entry->loaded()) { - $parent = ORM::factory("item", $task->get("item_id")); - } else { - $parent = ORM::factory("item", $parent_entry->item_id); - } - - $name = basename($entry->path); - $title = item::convert_filename_to_title($name); - if ($entry->is_directory) { - $album = ORM::factory("item"); - $album->type = "album"; - $album->parent_id = $parent->id; - $album->name = $name; - $album->title = $title; - $album->owner_id = $owner_id; - $album->sort_order = $parent->sort_order; - $album->sort_column = $parent->sort_column; - $album->save(); - $entry->item_id = $album->id; - } else { - try { - $extension = strtolower(pathinfo($name, PATHINFO_EXTENSION)); - if (in_array($extension, array("gif", "png", "jpg", "jpeg"))) { - $photo = ORM::factory("item"); - $photo->type = "photo"; - $photo->parent_id = $parent->id; - $photo->set_data_file($entry->path); - $photo->name = $name; - $photo->title = $title; - $photo->owner_id = $owner_id; - $photo->save(); - $entry->item_id = $photo->id; - // rWatcher EDIT - //} else if (in_array($extension, array("flv", "mp4", "m4v"))) { - } else if (in_array($extension, unserialize(module::get_var("videos", "allowed_extensions")))) { - $movie = ORM::factory("item"); - $movie->type = "movie"; - $movie->parent_id = $parent->id; - $movie->set_data_file($entry->path); - $movie->name = $name; - $movie->title = $title; - $movie->owner_id = $owner_id; - $movie->save(); - $entry->item_id = $movie->id; - // rWatcher EDIT: Add record to items_video db. - $items_video = ORM::factory("items_video"); - $items_video->item_id = $movie->id; - $items_video->save(); - // rWatcher EDIT: Scan for flv resizes and copy to resize directory. - if (file_exists($entry->path . ".flv")) { - copy($entry->path . ".flv", $movie->resize_path() . ".flv"); - list ($vid_width, $vid_height, $mime_type) = movie::get_file_metadata($entry->path . ".flv"); - $movie->height = $vid_height; - $movie->width = $vid_width; - $movie->save(); - } - } else { - // This should never happen, because we don't add stuff to the list that we can't - // process. But just in, case.. set this to a non-null value so that we skip this - // entry. - $entry->item_id = 0; - $task->log("Skipping unknown file type: {$entry->path}"); - } - } catch (Exception $e) { - // This can happen if a photo file is invalid, like a BMP masquerading as a .jpg - $entry->item_id = 0; - $task->log("Skipping invalid file: {$entry->file}"); - } - } - - $completed_files++; - $entry->save(); - } - $task->set("completed_files", $completed_files); - $task->status = t("Adding photos / albums (%completed of %total)", - array("completed" => $completed_files, - "total" => $total_files)); - $task->percent_complete = $total_files ? 10 + 100 * ($completed_files / $total_files) : 100; - break; - - case "done": - batch::stop(); - $task->done = true; - $task->state = "success"; - $task->percent_complete = 100; - ORM::factory("videos_entry") - ->where("task_id", "=", $task->id) - ->delete_all(); - message::info(t2("Successfully added one photo / album", - "Successfully added %count photos / albums", - $task->get("completed_files"))); - } - } -} diff --git a/3.1/modules/videos/css/videos.css b/3.1/modules/videos/css/videos.css deleted file mode 100644 index 559e5481..00000000 --- a/3.1/modules/videos/css/videos.css +++ /dev/null @@ -1,38 +0,0 @@ -#g-videos button { - margin-bottom: .5em; -} - -#g-videos-tree { - cursor: pointer; - padding-left: 4px; - width: 95%; -} - -#g-videos-tree li { - padding: 0; - float: none; -} - -#g-videos-tree span.selected { - background: #ddd; -} - -#g-videos-tree { - border: 1px solid #ccc; - height: 20em; - overflow: auto; - margin-bottom: .5em; - padding: .5em; -} - -#g-videos ul ul li { - padding-left: 1.2em; -} - -#g-videos-paths li .ui-icon { - margin-top: .4em; -} - -#g-videos-admin-form .textbox { - width: 400px; -} diff --git a/3.1/modules/videos/helpers/videos.php b/3.1/modules/videos/helpers/videos.php deleted file mode 100644 index f6f3240d..00000000 --- a/3.1/modules/videos/helpers/videos.php +++ /dev/null @@ -1,53 +0,0 @@ -Configure it now!", - array("url" => html::mark_clean(url::site("admin/videos")))), - "videos_configuration"); - } else { - site_status::clear("videos_configuration"); - } - } - - static function is_valid_path($path) { - if (!is_readable($path) || is_link($path)) { - return false; - } - - $authorized_paths = unserialize(module::get_var("videos", "authorized_paths")); - foreach (array_keys($authorized_paths) as $valid_path) { - if (strpos($path, $valid_path) === 0) { - return true; - } - } - - return false; - } -} diff --git a/3.1/modules/videos/helpers/videos_event.php b/3.1/modules/videos/helpers/videos_event.php deleted file mode 100644 index 2bcd53f0..00000000 --- a/3.1/modules/videos/helpers/videos_event.php +++ /dev/null @@ -1,88 +0,0 @@ -get("settings_menu") - ->append(Menu::factory("link") - ->id("videos") - ->label(t("Videos")) - ->url(url::site("admin/videos"))); - } - - static function site_menu($menu, $theme) { - $item = $theme->item(); - $paths = unserialize(module::get_var("videos", "authorized_paths")); - - if ($item && identity::active_user()->admin && $item->is_album() && !empty($paths) && - is_writable($item->is_album() ? $item->file_path() : $item->parent()->file_path())) { - $menu->get("add_menu") - ->append(Menu::factory("dialog") - ->id("Videos") - ->label(t("Add videos")) - ->url(url::site("videos/browse/$item->id"))); - } - } - - static function item_before_delete($item) { - // If deleting a video, make sure the resize is deleted as well, if it exists. - if ($item->is_movie()) { - $items_video = ORM::factory("items_video") - ->where("item_id", "=", $item->id) - ->find(); - if ($items_video->loaded() && file_exists($item->resize_path() . ".flv")) { - @unlink($item->resize_path() . ".flv"); - } - } - } - - static function item_updated($old, $new) { - // When updating a video, check and see if the file name is being changed. - // If so, check for and modify any corresponding resized video - - if ($old->is_movie()) { - if ($old->file_path() != $new->file_path()) { - $items_video = ORM::factory("items_video") - ->where("item_id", "=", $old->id) - ->find(); - if ($items_video->loaded() && file_exists($old->resize_path() . ".flv")) { - @rename($old->resize_path() . ".flv", $new->resize_path() . ".flv"); - } - } - } - } - - static function item_moved($item, $old_parent) { - // When moving an video, also move the flash resize, if it exists. - - if ($item->is_movie()) { - $items_video = ORM::factory("items_video") - ->where("item_id", "=", $item->id) - ->find(); - $old_resize_path = $old_parent->resize_path() . "/" . $item->name . ".flv"; - if ($items_video->loaded() && file_exists($old_resize_path)) { - @rename($old_resize_path, $item->resize_path() . ".flv"); - } - } - } -} diff --git a/3.1/modules/videos/helpers/videos_installer.php b/3.1/modules/videos/helpers/videos_installer.php deleted file mode 100644 index 36a1b423..00000000 --- a/3.1/modules/videos/helpers/videos_installer.php +++ /dev/null @@ -1,76 +0,0 @@ -query("CREATE TABLE {videos_entries} ( - `id` int(9) NOT NULL auto_increment, - `checked` boolean default 0, - `is_directory` boolean default 0, - `item_id` int(9), - `parent_id` int(9), - `path` varchar(255) NOT NULL, - `task_id` int(9) NOT NULL, - PRIMARY KEY (`id`)) - DEFAULT CHARSET=utf8;"); - - // rWatcher Edit: My Table. - $db->query("CREATE TABLE {items_videos} ( - `id` int(9) NOT NULL auto_increment, - `item_id` int(9) NOT NULL, - PRIMARY KEY (`id`), - KEY (`item_id`, `id`)) - DEFAULT CHARSET=utf8;"); - // rWatcher Edit: My Variable. - module::set_var("videos", "allowed_extensions", serialize(array("avi", "mpg", "mpeg", "mov", "wmv", "asf", "mts"))); - - module::set_version("videos", 4); - videos::check_config(); - } - - static function upgrade($version) { - $db = Database::instance(); - - if ($version < 4) { - $db->query("DROP TABLE {videos_files}"); - $db->query("CREATE TABLE {videos_entries} ( - `id` int(9) NOT NULL auto_increment, - `checked` boolean default 0, - `is_directory` boolean default 0, - `item_id` int(9), - `parent_id` int(9), - `path` varchar(255) NOT NULL, - `task_id` int(9) NOT NULL, - PRIMARY KEY (`id`)) - DEFAULT CHARSET=utf8;"); - module::set_version("videos", $version = 4); - } - } - - static function deactivate() { - site_status::clear("videos_configuration"); - } -} diff --git a/3.1/modules/videos/helpers/videos_theme.php b/3.1/modules/videos/helpers/videos_theme.php deleted file mode 100644 index 61200985..00000000 --- a/3.1/modules/videos/helpers/videos_theme.php +++ /dev/null @@ -1,61 +0,0 @@ -admin) { - $buf .= $theme->css("videos.css"); - $buf .= $theme->script("videos.js"); - } - - $item = $theme->item(); - if ($item && $item->is_movie()) { - $items_video = ORM::factory("items_video") - ->where("item_id", "=", $item->id) - ->find(); - if (($items_video->loaded()) && (!file_exists($item->resize_path() . ".flv"))) { - $buf .= $theme->script("videos_download.js"); - } - } - return $buf; - } - - static function admin_head($theme) { - $buf = ""; - if (strpos(Router::$current_uri, "admin/videos") !== false) { - $buf .= $theme->css("videos.css") - . $theme->css("jquery.autocomplete.css"); - $base = url::site("__ARGS__"); - $csrf = access::csrf_token(); - $buf .= ""; - - $buf .= $theme->script("jquery.autocomplete.js") - . $theme->script("admin_videos.js"); // rWatcher edit. - } - - return $buf; - } -} diff --git a/3.1/modules/videos/js/admin_videos.js b/3.1/modules/videos/js/admin_videos.js deleted file mode 100644 index 2a4f462c..00000000 --- a/3.1/modules/videos/js/admin_videos.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Set up autocomplete on the server path list - * - */ -/** - * rWatcher Edit: This file used to be admin.js from server_add module. - * All occurences of server_add have been replaced with videos - * - */ -$("document").ready(function() { - $("#g-path").autocomplete( - base_url.replace("__ARGS__", "admin/videos/autocomplete"), {max: 256}); -}); diff --git a/3.1/modules/videos/js/videos.js b/3.1/modules/videos/js/videos.js deleted file mode 100644 index 27627193..00000000 --- a/3.1/modules/videos/js/videos.js +++ /dev/null @@ -1,130 +0,0 @@ -/** - * rWatcher Edit: This file used to be server_add.js from server_add module. - * All occurences of server-add have been replaced with videos - * - */ -(function($) { - $.widget("ui.gallery_videos", { - _init: function() { - var self = this; - $("#g-videos-add-button", this.element).click(function(event) { - event.preventDefault(); - $(".g-progress-bar", this.element). - progressbar(). - progressbar("value", 0); - $("#g-videos-progress", this.element).slideDown("fast", function() { self.start_add(); }); - }); - $("#g-videos-pause-button", this.element).click(function(event) { - self.pause = true; - $("#g-videos-pause-button", this.element).hide(); - $("#g-videos-continue-button", this.element).show(); - }); - $("#g-videos-continue-button", this.element).click(function(event) { - self.pause = false; - $("#g-videos-pause-button", this.element).show(); - $("#g-videos-continue-button", this.element).hide(); - self.run_add(); - }); - $("#g-videos-close-button", this.element).click(function(event) { - $("#g-dialog").dialog("close"); - window.location.reload(); - }); - $("#g-videos-tree span.g-directory", this.element).dblclick(function(event) { - self.open_dir(event); - }); - $("#g-videos-tree span.g-file, #g-videos-tree span.g-directory", this.element).click(function(event) { - self.select_file(event); - }); - $("#g-videos-tree span.g-directory", this.element).dblclick(function(event) { - self.open_dir(event); - }); - $("#g-dialog").bind("dialogclose", function(event, ui) { - window.location.reload(); - }); - }, - - taskURL: null, - pause: false, - - start_add: function() { - var self = this; - var paths = []; - $.each($("span.selected", self.element), function () { - paths.push($(this).attr("ref")); - }); - - $("#g-videos-add-button", this.element).hide(); - $("#g-videos-pause-button", this.element).show(); - - $.ajax({ - url: START_URL, - type: "POST", - async: false, - data: { "paths[]": paths }, - dataType: "json", - success: function(data, textStatus) { - $("#g-status").html(data.status); - $(".g-progress-bar", self.element).progressbar("value", data.percent_complete); - self.taskURL = data.url; - setTimeout(function() { self.run_add(); }, 25); - } - }); - return false; - }, - - run_add: function () { - var self = this; - $.ajax({ - url: self.taskURL, - async: false, - dataType: "json", - success: function(data, textStatus) { - $("#g-status").html(data.status); - $(".g-progress-bar", self.element).progressbar("value", data.percent_complete); - if (data.done) { - $("#g-videos-progress", this.element).slideUp(); - $("#g-videos-add-button", this.element).show(); - $("#g-videos-pause-button", this.element).hide(); - $("#g-videos-continue-button", this.element).hide(); - } else { - if (!self.pause) { - setTimeout(function() { self.run_add(); }, 25); - } - } - } - }); - }, - - /** - * Load a new directory - */ - open_dir: function(event) { - var self = this; - var path = $(event.target).attr("ref"); - $.ajax({ - url: GET_CHILDREN_URL.replace("__PATH__", path), - success: function(data, textStatus) { - $("#g-videos-tree", self.element).html(data); - $("#g-videos-tree span.g-directory", self.element).dblclick(function(event) { - self.open_dir(event); - }); - $("#g-videos-tree span.g-file, #g-videos-tree span.g-directory", this.element).click(function(event) { - self.select_file(event); - }); - } - }); - }, - - /** - * Manage file selection state. - */ - select_file: function (event) { - $(event.target).toggleClass("selected"); - if ($("#g-videos span.selected").length) { - $("#g-videos-add-button").enable(true).removeClass("ui-state-disabled"); - } else { - $("#g-videos-add-button").enable(false).addClass("ui-state-disabled"); - } - } - }); -})(jQuery); diff --git a/3.1/modules/videos/js/videos_download.js b/3.1/modules/videos/js/videos_download.js deleted file mode 100644 index b0777ec2..00000000 --- a/3.1/modules/videos/js/videos_download.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * rWatcher Edit: This file is one of mine. - * - */ -$("document").ready(function() { - var original_url = document.getElementById('g-videos-full-url'); - $("#g-movie").replaceWith(""); -}); diff --git a/3.1/modules/videos/models/item.php b/3.1/modules/videos/models/item.php deleted file mode 100644 index 171d664c..00000000 --- a/3.1/modules/videos/models/item.php +++ /dev/null @@ -1,1030 +0,0 @@ -loaded()) { - // Set reasonable defaults - $this->created = time(); - $this->rand_key = random::percent(); - $this->thumb_dirty = 1; - $this->resize_dirty = 1; - $this->sort_column = "created"; - $this->sort_order = "ASC"; - $this->owner_id = identity::active_user()->id; - } - } - - /** - * Add a set of restrictions to any following queries to restrict access only to items - * viewable by the active user. - * @chainable - */ - public function viewable() { - return item::viewable($this); - } - - /** - * Is this item an album? - * @return true if it's an album - */ - public function is_album() { - return $this->type == 'album'; - } - - /** - * Is this item a photo? - * @return true if it's a photo - */ - public function is_photo() { - return $this->type == 'photo'; - } - - /** - * Is this item a movie? - * @return true if it's a movie - */ - public function is_movie() { - return $this->type == 'movie'; - } - - public function delete($ignored_id=null) { - if (!$this->loaded()) { - // Concurrent deletes may result in this item already being gone. Ignore it. - return; - } - - if ($this->id == 1) { - $v = new Validation(array("id")); - $v->add_error("id", "cant_delete_root_album"); - ORM_Validation_Exception::handle_validation($this->table_name, $v); - } - - $old = clone $this; - module::event("item_before_delete", $this); - - $parent = $this->parent(); - if ($parent->album_cover_item_id == $this->id) { - item::remove_album_cover($parent); - } - - $path = $this->file_path(); - $resize_path = $this->resize_path(); - $thumb_path = $this->thumb_path(); - - parent::delete(); - if (is_dir($path)) { - // Take some precautions against accidentally deleting way too much - $delete_resize_path = dirname($resize_path); - $delete_thumb_path = dirname($thumb_path); - if ($delete_resize_path == VARPATH . "resizes" || - $delete_thumb_path == VARPATH . "thumbs" || - $path == VARPATH . "albums") { - throw new Exception( - "@todo DELETING_TOO_MUCH ($delete_resize_path, $delete_thumb_path, $path)"); - } - @dir::unlink($path); - @dir::unlink($delete_resize_path); - @dir::unlink($delete_thumb_path); - } else { - @unlink($path); - @unlink($resize_path); - @unlink($thumb_path); - } - - module::event("item_deleted", $old); - } - - /** - * Specify the path to the data file associated with this item. To actually associate it, - * you still have to call save(). - * @chainable - */ - public function set_data_file($data_file) { - $this->data_file = $data_file; - return $this; - } - - /** - * Return the server-relative url to this item, eg: - * /gallery3/index.php/BobsWedding?page=2 - * /gallery3/index.php/BobsWedding/Eating-Cake.jpg - * - * @param string $query the query string (eg "show=3") - */ - public function url($query=null) { - $url = url::site($this->relative_url()); - if ($query) { - $url .= "?$query"; - } - return $url; - } - - /** - * Return the full url to this item, eg: - * http://example.com/gallery3/index.php/BobsWedding?page=2 - * http://example.com/gallery3/index.php/BobsWedding/Eating-Cake.jpg - * - * @param string $query the query string (eg "show=3") - */ - public function abs_url($query=null) { - $url = url::abs_site($this->relative_url()); - if ($query) { - $url .= "?$query"; - } - return $url; - } - - /** - * album: /var/albums/album1/album2 - * photo: /var/albums/album1/album2/photo.jpg - */ - public function file_path() { - return VARPATH . "albums/" . urldecode($this->relative_path()); - } - - /** - * album: http://example.com/gallery3/var/resizes/album1/ - * photo: http://example.com/gallery3/var/albums/album1/photo.jpg - */ - public function file_url($full_uri=false) { - $relative_path = "var/albums/" . $this->relative_path(); - $cache_buster = $this->_cache_buster($this->file_path()); - return ($full_uri ? url::abs_file($relative_path) : url::file($relative_path)) - . $cache_buster; - } - - /** - * album: /var/resizes/album1/.thumb.jpg - * photo: /var/albums/album1/photo.thumb.jpg - */ - public function thumb_path() { - $base = VARPATH . "thumbs/" . urldecode($this->relative_path()); - if ($this->is_photo()) { - return $base; - } else if ($this->is_album()) { - return $base . "/.album.jpg"; - } else if ($this->is_movie()) { - // Replace the extension with jpg - return preg_replace("/...$/", "jpg", $base); - } - } - - /** - * Return true if there is a thumbnail for this item. - */ - public function has_thumb() { - return $this->thumb_width && $this->thumb_height; - } - - /** - * album: http://example.com/gallery3/var/resizes/album1/.thumb.jpg - * photo: http://example.com/gallery3/var/albums/album1/photo.thumb.jpg - */ - public function thumb_url($full_uri=false) { - $cache_buster = $this->_cache_buster($this->thumb_path()); - $relative_path = "var/thumbs/" . $this->relative_path(); - $base = ($full_uri ? url::abs_file($relative_path) : url::file($relative_path)); - if ($this->is_photo()) { - return $base . $cache_buster; - } else if ($this->is_album()) { - return $base . "/.album.jpg" . $cache_buster; - } else if ($this->is_movie()) { - // Replace the extension with jpg - $base = preg_replace("/...$/", "jpg", $base); - return $base . $cache_buster; - } - } - - /** - * album: /var/resizes/album1/.resize.jpg - * photo: /var/albums/album1/photo.resize.jpg - */ - public function resize_path() { - return VARPATH . "resizes/" . urldecode($this->relative_path()) . - ($this->is_album() ? "/.album.jpg" : ""); - } - - /** - * album: http://example.com/gallery3/var/resizes/album1/.resize.jpg - * photo: http://example.com/gallery3/var/albums/album1/photo.resize.jpg - */ - public function resize_url($full_uri=false) { - $relative_path = "var/resizes/" . $this->relative_path(); - $cache_buster = $this->_cache_buster($this->resize_path()); - return ($full_uri ? url::abs_file($relative_path) : url::file($relative_path)) . - ($this->is_album() ? "/.album.jpg" : "") . $cache_buster; - } - - /** - * Rebuild the relative_path_cache and relative_url_cache. - */ - private function _build_relative_caches() { - $names = array(); - $slugs = array(); - foreach (db::build() - ->select(array("name", "slug")) - ->from("items") - ->where("left_ptr", "<=", $this->left_ptr) - ->where("right_ptr", ">=", $this->right_ptr) - ->where("id", "<>", 1) - ->order_by("left_ptr", "ASC") - ->execute() as $row) { - // Don't encode the names segment - $names[] = rawurlencode($row->name); - $slugs[] = rawurlencode($row->slug); - } - $this->relative_path_cache = implode($names, "/"); - $this->relative_url_cache = implode($slugs, "/"); - return $this; - } - - /** - * Return the relative path to this item's file. Note that the components of the path are - * urlencoded so if you want to use this as a filesystem path, you need to call urldecode - * on it. - * @return string - */ - public function relative_path() { - if (!$this->loaded()) { - return; - } - - if (!isset($this->relative_path_cache)) { - $this->_build_relative_caches()->save(); - } - return $this->relative_path_cache; - } - - /** - * Return the relative url to this item's file. - * @return string - */ - public function relative_url() { - if (!$this->loaded()) { - return; - } - - if (!isset($this->relative_url_cache)) { - $this->_build_relative_caches()->save(); - } - return $this->relative_url_cache; - } - - /** - * @see ORM::__get() - */ - public function __get($column) { - if ($column == "owner") { - // This relationship depends on an outside module, which may not be present so handle - // failures gracefully. - try { - return identity::lookup_user($this->owner_id); - } catch (Exception $e) { - return null; - } - } else { - return parent::__get($column); - } - } - - /** - * Handle any business logic necessary to create or modify an item. - * @see ORM::save() - * - * @return ORM Item_Model - */ - public function save() { - $significant_changes = $this->changed; - unset($significant_changes["view_count"]); - unset($significant_changes["relative_url_cache"]); - unset($significant_changes["relative_path_cache"]); - - if ((!empty($this->changed) && $significant_changes) || isset($this->data_file)) { - $this->updated = time(); - if (!$this->loaded()) { - // Create a new item. - module::event("item_before_create", $this); - - // Set a weight if it's missing. We don't do this in the constructor because it's not a - // simple assignment. - if (empty($this->weight)) { - $this->weight = item::get_max_weight(); - } - - // Make an url friendly slug from the name, if necessary - if (empty($this->slug)) { - $tmp = pathinfo($this->name, PATHINFO_FILENAME); - $tmp = preg_replace("/[^A-Za-z0-9-_]+/", "-", $tmp); - $this->slug = trim($tmp, "-"); - - // If the filename is all invalid characters, then the slug may be empty here. Pick a - // random value. - if (empty($this->slug)) { - $this->slug = (string)rand(1000, 9999); - } - } - - // Get the width, height and mime type from our data file for photos and movies. - if ($this->is_photo() || $this->is_movie()) { - if ($this->is_photo()) { - list ($this->width, $this->height, $this->mime_type, $extension) = - photo::get_file_metadata($this->data_file); - } else if ($this->is_movie()) { - list ($this->width, $this->height, $this->mime_type, $extension) = - movie::get_file_metadata($this->data_file); - } - - // Force an extension onto the name if necessary - $pi = pathinfo($this->data_file); - if (empty($pi["extension"])) { - $this->name = "{$this->name}.$extension"; - } - } - - $this->_randomize_name_or_slug_on_conflict(); - - parent::save(); - - // Build our url caches, then save again. We have to do this after it's already been - // saved once because we use only information from the database to build the paths. If we - // could depend on a save happening later we could defer this 2nd save. - $this->_build_relative_caches(); - parent::save(); - - // Take any actions that we can only do once all our paths are set correctly after saving. - switch ($this->type) { - case "album": - mkdir($this->file_path()); - mkdir(dirname($this->thumb_path())); - mkdir(dirname($this->resize_path())); - break; - - case "photo": - case "movie": - // The thumb or resize may already exist in the case where a movie and a photo generate - // a thumbnail of the same name (eg, foo.flv movie and foo.jpg photo will generate - // foo.jpg thumbnail). If that happens, randomize and save again. - if (file_exists($this->resize_path()) || - file_exists($this->thumb_path())) { - $pi = pathinfo($this->name); - $this->name = $pi["filename"] . "-" . random::int() . "." . $pi["extension"]; - parent::save(); - } - - copy($this->data_file, $this->file_path()); - break; - } - - // This will almost definitely trigger another save, so put it at the end so that we're - // tail recursive. Null out the data file variable first, otherwise the next save will - // trigger an item_updated_data_file event. - $this->data_file = null; - module::event("item_created", $this); - } else { - // Update an existing item - module::event("item_before_update", $item); - - // If any significant fields have changed, load up a copy of the original item and - // keep it around. - $original = ORM::factory("item", $this->id); - if (array_intersect($this->changed, array("parent_id", "name", "slug"))) { - $original->_build_relative_caches(); - $this->relative_path_cache = null; - $this->relative_url_cache = null; - } - - $this->_randomize_name_or_slug_on_conflict(); - - parent::save(); - - // Now update the filesystem and any database caches if there were significant value - // changes. If anything past this point fails, then we'll have an inconsistent database - // so this code should be as robust as we can make it. - - // Update the MPTT pointers, if necessary. We have to do this before we generate any - // cached paths! - if ($original->parent_id != $this->parent_id) { - parent::move_to($this->parent()); - } - - if ($original->parent_id != $this->parent_id || $original->name != $this->name) { - // Move all of the items associated data files - @rename($original->file_path(), $this->file_path()); - if ($this->is_album()) { - @rename(dirname($original->resize_path()), dirname($this->resize_path())); - @rename(dirname($original->thumb_path()), dirname($this->thumb_path())); - } else { - @rename($original->resize_path(), $this->resize_path()); - @rename($original->thumb_path(), $this->thumb_path()); - } - - if ($original->parent_id != $this->parent_id) { - // This will result in 2 events since we'll still fire the item_updated event below - module::event("item_moved", $this, $original->parent()); - } - } - - // Changing the name, slug or parent ripples downwards - if ($this->is_album() && - ($original->name != $this->name || - $original->slug != $this->slug || - $original->parent_id != $this->parent_id)) { - db::build() - ->update("items") - ->set("relative_url_cache", null) - ->set("relative_path_cache", null) - ->where("left_ptr", ">", $this->left_ptr) - ->where("right_ptr", "<", $this->right_ptr) - ->execute(); - } - - // Replace the data file, if requested. - // @todo: we don't handle the case where you swap in a file of a different mime type - // should we prevent that in validation? or in set_data_file() - if ($this->data_file && ($this->is_photo() || $this->is_movie())) { - copy($this->data_file, $this->file_path()); - - // Get the width, height and mime type from our data file for photos and movies. - if ($this->is_photo()) { - list ($this->width, $this->height) = photo::get_file_metadata($this->file_path()); - } else if ($this->is_movie()) { - list ($this->width, $this->height) = movie::get_file_metadata($this->file_path()); - } - $this->thumb_dirty = 1; - $this->resize_dirty = 1; - } - - module::event("item_updated", $original, $this); - - if ($this->data_file) { - // Null out the data file variable here, otherwise this event will trigger another - // save() which will think that we're doing another file move. - $this->data_file = null; - module::event("item_updated_data_file", $this); - } - } - } else if (!empty($this->changed)) { - // Insignificant changes only. Don't fire events or do any special checking to try to keep - // this lightweight. - parent::save(); - } - - return $this; - } - - /** - * Check to see if there's another item that occupies the same name or slug that this item - * intends to use, and if so choose a new name/slug while preserving the extension. - * @todo Improve this. Random numbers are not user friendly - */ - private function _randomize_name_or_slug_on_conflict() { - $base_name = pathinfo($this->name, PATHINFO_FILENAME); - $base_ext = pathinfo($this->name, PATHINFO_EXTENSION); - $base_slug = $this->slug; - while (ORM::factory("item") - ->where("parent_id", "=", $this->parent_id) - ->where("id", $this->id ? "<>" : "IS NOT", $this->id) - ->and_open() - ->where("name", "=", $this->name) - ->or_where("slug", "=", $this->slug) - ->close() - ->find()->id) { - $rand = random::int(); - if ($base_ext) { - $this->name = "$base_name-$rand.$base_ext"; - } else { - $this->name = "$base_name-$rand"; - } - $this->slug = "$base_slug-$rand"; - } - } - - /** - * Return the Item_Model representing the cover for this album. - * @return Item_Model or null if there's no cover - */ - public function album_cover() { - if (!$this->is_album()) { - return null; - } - - if (empty($this->album_cover_item_id)) { - return null; - } - - try { - return model_cache::get("item", $this->album_cover_item_id); - } catch (Exception $e) { - // It's possible (unlikely) that the item was deleted, if so keep going. - return null; - } - } - - /** - * Find the position of the given child id in this album. The resulting value is 1-indexed, so - * the first child in the album is at position 1. - * - * This method stands as a backward compatibility for gallery 3.0, and will - * be deprecated in version 3.1. - */ - public function get_position($child, $where=array()) { - return item::get_position($child, $where); - } - - /** - * Return an tag for the thumbnail. - * @param array $extra_attrs Extra attributes to add to the img tag - * @param int (optional) $max Maximum size of the thumbnail (default: null) - * @param boolean (optional) $center_vertically Center vertically (default: false) - * @return string - */ - public function thumb_img($extra_attrs=array(), $max=null, $center_vertically=false) { - list ($height, $width) = $this->scale_dimensions($max); - if ($center_vertically && $max) { - // The constant is divide by 2 to calculate the file and 10 to convert to em - $margin_top = (int)(($max - $height) / 20); - $extra_attrs["style"] = "margin-top: {$margin_top}em"; - $extra_attrs["title"] = $this->title; - } - $attrs = array_merge($extra_attrs, - array( - "src" => $this->thumb_url(), - "alt" => $this->title, - "width" => $width, - "height" => $height) - ); - // html::image forces an absolute url which we don't want - return ""; - } - - /** - * Calculate the largest width/height that fits inside the given maximum, while preserving the - * aspect ratio. Don't upscale. - * @param int $max Maximum size of the largest dimension - * @return array - */ - public function scale_dimensions($max) { - $width = $this->thumb_width; - $height = $this->thumb_height; - - if ($width <= $max && $height <= $max) { - return array($height, $width); - } - - if ($height) { - if (isset($max)) { - if ($width > $height) { - $height = (int)($max * $height / $width); - $width = $max; - } else { - $width = (int)($max * $width / $height); - $height = $max; - } - } - } else { - // Missing thumbnail, can happen on albums with no photos yet. - // @todo we should enforce a placeholder for those albums. - $width = 0; - $height = 0; - } - return array($height, $width); - } - - /** - * Return an tag for the resize. - * @param array $extra_attrs Extra attributes to add to the img tag - * @return string - */ - public function resize_img($extra_attrs) { - $attrs = array_merge($extra_attrs, - array("src" => $this->resize_url(), - "alt" => $this->title, - "width" => $this->resize_width, - "height" => $this->resize_height) - ); - // html::image forces an absolute url which we don't want - return ""; - } - - /** - * Return a flowplayer diff --git a/3.1/modules/videos/views/videos_tree.html.php b/3.1/modules/videos/views/videos_tree.html.php deleted file mode 100644 index 366d4fb4..00000000 --- a/3.1/modules/videos/views/videos_tree.html.php +++ /dev/null @@ -1,38 +0,0 @@ - - -
      • - - - - -
          - - -
        • - - - - -
            - - - -
          • - "> - " - ref="" > - - -
          • - - -
          • - - - -
          -
        • - - -
        -
      • diff --git a/3.1/modules/videos/views/videos_tree_dialog.html.php b/3.1/modules/videos/views/videos_tree_dialog.html.php deleted file mode 100644 index a0c0f7b7..00000000 --- a/3.1/modules/videos/views/videos_tree_dialog.html.php +++ /dev/null @@ -1,53 +0,0 @@ - - - - -
        -

        html::purify($item->title))) ?>

        - -

        -
          - - parents() as $parent): ?> - > title) ?> - - -
        • title) ?>
        • -
        - -
          - -
        - - - - - - - - - - - - - -
        diff --git a/3.1/modules/wordpress_auth/config/identity.php b/3.1/modules/wordpress_auth/config/identity.php deleted file mode 100644 index f09ed141..00000000 --- a/3.1/modules/wordpress_auth/config/identity.php +++ /dev/null @@ -1,63 +0,0 @@ - 'wordpressdb', - 'allow_updates' => false, - 'params' => array( - 'wp_database' => array( - 'username' => 'user', - 'password' => 'pass', - 'database' => 'dbname', - 'host' => 'localhost', - 'table_prefix' => 'wp_', - 'charset' => 'utf8' - ), - 'path' => 'path/to/local/wordpress/installation' - ) -); - - -// load code -if ($config['wordpress_auth']['driver'] == 'wordpressfile') { - require_once $config['wordpress_auth']['params']['path'] . 'wp-load.php'; - require_once $config['wordpress_auth']['params']['path'] . 'wp-admin/includes/user.php'; -} diff --git a/3.1/modules/wordpress_auth/helpers/wordpress_auth_installer.php b/3.1/modules/wordpress_auth/helpers/wordpress_auth_installer.php deleted file mode 100644 index 7c9d4b12..00000000 --- a/3.1/modules/wordpress_auth/helpers/wordpress_auth_installer.php +++ /dev/null @@ -1,64 +0,0 @@ -admin_user(); - // Everything is fine - $messages["warn"][] = IdentityProvider::confirmation_message(); - } - catch (Exception $e) { - $messages["error"][] = - 'Cannot install Wordpress identity provider. Error: ' . $e->getMessage(); - } - return $messages; - } - - static function install() { - IdentityProvider::change_provider('wordpress_auth'); - } - - static function initialize() { - module::set_version('wordpress_auth', 1); - $root = item::root(); - foreach (IdentityProvider::instance()->groups() as $group) { - module::event("group_created", $group); - access::allow($group, "view", $root); - access::allow($group, "view_full", $root); - } - } - - static function uninstall() { - // Delete all groups so that we give other modules an opportunity to clean up - $wordpress_auth_provider = new IdentityProvider("wordpress_auth"); - foreach ($wordpress_auth_provider->groups() as $group) { - module::event("group_deleted", $group); - } - } -} diff --git a/3.1/modules/wordpress_auth/libraries/PasswordHash.php b/3.1/modules/wordpress_auth/libraries/PasswordHash.php deleted file mode 100644 index 93f4536c..00000000 --- a/3.1/modules/wordpress_auth/libraries/PasswordHash.php +++ /dev/null @@ -1,258 +0,0 @@ - in 2004-2006 and placed in -# the public domain. -# -# There's absolutely no warranty. -# -# Please be sure to update the Version line if you edit this file in any way. -# It is suggested that you leave the main version number intact, but indicate -# your project name (after the slash) and add your own revision information. -# -# Please do not change the "private" password hashing method implemented in -# here, thereby making your hashes incompatible. However, if you must, please -# change the hash type identifier (the "$P$") to something different. -# -# Obviously, since this code is in the public domain, the above are not -# requirements (there can be none), but merely suggestions. -# - -/** - * Portable PHP password hashing framework. - * - * @package phpass - * @version 0.1 / genuine - * @link http://www.openwall.com/phpass/ - * @since 2.5 - */ -class PasswordHash { - var $itoa64; - var $iteration_count_log2; - var $portable_hashes; - var $random_state; - - function PasswordHash($iteration_count_log2, $portable_hashes) - { - $this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; - - if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31) - $iteration_count_log2 = 8; - $this->iteration_count_log2 = $iteration_count_log2; - - $this->portable_hashes = $portable_hashes; - - $this->random_state = microtime() . (function_exists('getmypid') ? getmypid() : '') . uniqid(rand(), TRUE); - - } - - function get_random_bytes($count) - { - $output = ''; - if (($fh = @fopen('/dev/urandom', 'rb'))) { - $output = fread($fh, $count); - fclose($fh); - } - - if (strlen($output) < $count) { - $output = ''; - for ($i = 0; $i < $count; $i += 16) { - $this->random_state = - md5(microtime() . $this->random_state); - $output .= - pack('H*', md5($this->random_state)); - } - $output = substr($output, 0, $count); - } - - return $output; - } - - function encode64($input, $count) - { - $output = ''; - $i = 0; - do { - $value = ord($input[$i++]); - $output .= $this->itoa64[$value & 0x3f]; - if ($i < $count) - $value |= ord($input[$i]) << 8; - $output .= $this->itoa64[($value >> 6) & 0x3f]; - if ($i++ >= $count) - break; - if ($i < $count) - $value |= ord($input[$i]) << 16; - $output .= $this->itoa64[($value >> 12) & 0x3f]; - if ($i++ >= $count) - break; - $output .= $this->itoa64[($value >> 18) & 0x3f]; - } while ($i < $count); - - return $output; - } - - function gensalt_private($input) - { - $output = '$P$'; - $output .= $this->itoa64[min($this->iteration_count_log2 + - ((PHP_VERSION >= '5') ? 5 : 3), 30)]; - $output .= $this->encode64($input, 6); - - return $output; - } - - function crypt_private($password, $setting) - { - $output = '*0'; - if (substr($setting, 0, 2) == $output) - $output = '*1'; - - if (substr($setting, 0, 3) != '$P$') - return $output; - - $count_log2 = strpos($this->itoa64, $setting[3]); - if ($count_log2 < 7 || $count_log2 > 30) - return $output; - - $count = 1 << $count_log2; - - $salt = substr($setting, 4, 8); - if (strlen($salt) != 8) - return $output; - - # We're kind of forced to use MD5 here since it's the only - # cryptographic primitive available in all versions of PHP - # currently in use. To implement our own low-level crypto - # in PHP would result in much worse performance and - # consequently in lower iteration counts and hashes that are - # quicker to crack (by non-PHP code). - if (PHP_VERSION >= '5') { - $hash = md5($salt . $password, TRUE); - do { - $hash = md5($hash . $password, TRUE); - } while (--$count); - } else { - $hash = pack('H*', md5($salt . $password)); - do { - $hash = pack('H*', md5($hash . $password)); - } while (--$count); - } - - $output = substr($setting, 0, 12); - $output .= $this->encode64($hash, 16); - - return $output; - } - - function gensalt_extended($input) - { - $count_log2 = min($this->iteration_count_log2 + 8, 24); - # This should be odd to not reveal weak DES keys, and the - # maximum valid value is (2**24 - 1) which is odd anyway. - $count = (1 << $count_log2) - 1; - - $output = '_'; - $output .= $this->itoa64[$count & 0x3f]; - $output .= $this->itoa64[($count >> 6) & 0x3f]; - $output .= $this->itoa64[($count >> 12) & 0x3f]; - $output .= $this->itoa64[($count >> 18) & 0x3f]; - - $output .= $this->encode64($input, 3); - - return $output; - } - - function gensalt_blowfish($input) - { - # This one needs to use a different order of characters and a - # different encoding scheme from the one in encode64() above. - # We care because the last character in our encoded string will - # only represent 2 bits. While two known implementations of - # bcrypt will happily accept and correct a salt string which - # has the 4 unused bits set to non-zero, we do not want to take - # chances and we also do not want to waste an additional byte - # of entropy. - $itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - - $output = '$2a$'; - $output .= chr(ord('0') + $this->iteration_count_log2 / 10); - $output .= chr(ord('0') + $this->iteration_count_log2 % 10); - $output .= '$'; - - $i = 0; - do { - $c1 = ord($input[$i++]); - $output .= $itoa64[$c1 >> 2]; - $c1 = ($c1 & 0x03) << 4; - if ($i >= 16) { - $output .= $itoa64[$c1]; - break; - } - - $c2 = ord($input[$i++]); - $c1 |= $c2 >> 4; - $output .= $itoa64[$c1]; - $c1 = ($c2 & 0x0f) << 2; - - $c2 = ord($input[$i++]); - $c1 |= $c2 >> 6; - $output .= $itoa64[$c1]; - $output .= $itoa64[$c2 & 0x3f]; - } while (1); - - return $output; - } - - function HashPassword($password) - { - $random = ''; - - if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) { - $random = $this->get_random_bytes(16); - $hash = - crypt($password, $this->gensalt_blowfish($random)); - if (strlen($hash) == 60) - return $hash; - } - - if (CRYPT_EXT_DES == 1 && !$this->portable_hashes) { - if (strlen($random) < 3) - $random = $this->get_random_bytes(3); - $hash = - crypt($password, $this->gensalt_extended($random)); - if (strlen($hash) == 20) - return $hash; - } - - if (strlen($random) < 6) - $random = $this->get_random_bytes(6); - $hash = - $this->crypt_private($password, - $this->gensalt_private($random)); - if (strlen($hash) == 34) - return $hash; - - # Returning '*' on error is safe here, but would _not_ be safe - # in a crypt(3)-like function used _both_ for generating new - # hashes and for validating passwords against existing hashes. - return '*'; - } - - function CheckPassword($password, $stored_hash) - { - $hash = $this->crypt_private($password, $stored_hash); - if ($hash[0] == '*') - $hash = crypt($password, $stored_hash); - - return $hash == $stored_hash; - } -} - -?> diff --git a/3.1/modules/wordpress_auth/libraries/drivers/IdentityProvider/Wordpressdb.php b/3.1/modules/wordpress_auth/libraries/drivers/IdentityProvider/Wordpressdb.php deleted file mode 100644 index e71110e6..00000000 --- a/3.1/modules/wordpress_auth/libraries/drivers/IdentityProvider/Wordpressdb.php +++ /dev/null @@ -1,303 +0,0 @@ -config = $config; - $d = $config['wp_database']; - $this->db = new mysqli($d['host'], $d['username'], $d['password'], $d['database']); - if ($this->db->connect_error) { - throw new Exception('Cannot connect to mysql database (' . $this->db->connect_errno . ') ' . $this->db->connect_error); - } - $this->db->set_charset($d['charset']); - } - - /** - * @see IdentityProvider_Driver::guest. - */ - public function guest() { - if (empty($this->_guest_user)) { - $this->_guest_user = new Wordpress_User(); - $this->_guest_user->id = 0; - $this->_guest_user->name = "Guest"; - $this->_guest_user->full_name = "Guest"; - $this->_guest_user->guest = true; - $this->_guest_user->admin = false; - $this->_guest_user->locale = null; - $this->_guest_user->email = null; - $this->_guest_user->url = null; - } - return $this->_guest_user; - } - - /** - * @see IdentityProvider_Driver::admin_user. - */ - public function admin_user() { - $tp = $this->config['wp_database']['table_prefix']; - $query = 'SELECT user_id FROM ' . $tp . 'usermeta WHERE meta_key = "' . $tp . 'capabilities" AND meta_value = "a:1:{s:13:\"administrator\";b:1;}" ORDER BY user_id ASC LIMIT 1'; - - $result = $this->db->query($query); - $admin = $result->fetch_array(MYSQLI_ASSOC); - $result->free(); - if (isset($admin)) { - return $this->lookup_user($admin['user_id']); - } else { - throw new Exception("@todo NO ADMIN USER FOUND"); - } - } - - /** - * @see IdentityProvider_Driver::create_user. - */ - public function create_user($name, $full_name, $password, $email) { - throw new Exception("@todo INVALID OPERATION"); - } - - /** - * @see IdentityProvider_Driver::is_correct_password. - */ - public function is_correct_password($user, $password) { - $password = trim($password); - if ( strlen($user->user_pass) <= 32 ) { - return $user->user_pass == md5($password); - } else { - $hasher = new PasswordHash(8, TRUE); - return $hasher->CheckPassword($password, $user->user_pass); - } - } - - /** - * @see IdentityProvider_Driver::lookup_user. - */ - public function lookup_user($id) { - if (is_numeric($id)) { - $tp = $this->config['wp_database']['table_prefix']; - $query = 'SELECT u.*, m.meta_value AS roles FROM ' . $tp . 'users u LEFT OUTER JOIN ' . $tp . 'usermeta m ON (u.ID = m.user_id) WHERE u.ID = ' . $id . ' AND meta_key = "' . $tp . 'capabilities"'; - $result = $this->db->query($query); - $user = $result->fetch_array(MYSQLI_ASSOC); - $result->free(); - if (isset($user)) { - return new Wordpress_User($user); - } - } - return null; - } - - /** - * @see IdentityProvider_Driver::lookup_user_by_name. - */ - public function lookup_user_by_name($name) { - $name = $this->db->escape_string($name); - $tp = $this->config['wp_database']['table_prefix']; - $query = 'SELECT u.*, m.meta_value AS roles FROM ' . $tp . 'users u LEFT OUTER JOIN ' . $tp . 'usermeta m ON (u.ID = m.user_id) WHERE u.user_login = "' . $name . '" AND meta_key = "' . $tp . 'capabilities"'; - $result = $this->db->query($query); - $user = $result->fetch_array(MYSQLI_ASSOC); - $result->free(); - if (isset($user)) { - return new Wordpress_User($user); - } else { - return null; - } - } - - /** - * @see IdentityProvider_Driver::create_group. - */ - public function create_group($name) { - throw new Exception("@todo INVALID OPERATION"); - } - - /** - * @see IdentityProvider_Driver::everybody. - */ - public function everybody() { - return new Wordpress_Group('everybody'); - } - - /** - * @see IdentityProvider_Driver::registered_users. - */ - public function registered_users() { - return new Wordpress_Group('registered_users'); - } - - /** - * @see IdentityProvider_Driver::get_user_list. - */ - public function get_user_list($ids) { - $users = array(); - foreach ($ids as $id) { - $users[] = $this->lookup_user($id); - } - return $users; - } - - /** - * @see IdentityProvider_Driver::lookup_group. - */ - public function lookup_group($name) { - $groups = $this->groups(); - foreach ($groups as $group) { - if ($group->id == $name) { - return $group; - } - } - return null; - } - - /** - * Look up the group by name. - * @param string $name the name of the group to locate - * @return Group_Definition - */ - public function lookup_group_by_name($name) { - return $this->lookup_group(strtolower($name)); - } - - /** - * @see IdentityProvider_Driver::groups. - */ - public function groups() { - if (!isset($this->wp_roles)) { - $tp = $this->config['wp_database']['table_prefix']; - $query = 'SELECT option_value FROM ' . $tp . 'options WHERE option_name = "' . $tp . 'user_roles" LIMIT 1'; - $result = $this->db->query($query); - $wp_roles = $result->fetch_array(MYSQLI_ASSOC); - $result->free(); - if (isset($wp_roles)) { - $this->wp_roles = unserialize($wp_roles['option_value']); - } - } - - $groups = array(new Wordpress_Group('everybody')); - foreach ($this->wp_roles as $k => $r) { - $groups[] = new Wordpress_Group($k); - } - return $groups; - } - - /** - * @see IdentityProvider_Driver::add_user_to_group. - */ - function add_user_to_group($user, $group) { - throw new Exception("@todo INVALID OPERATION"); - } - - /** - * @see IdentityProvider_Driver::remove_user_to_group. - */ - function remove_user_from_group($user, $group) { - throw new Exception("@todo INVALID OPERATION"); - } -} // End Identity Gallery Driver - -class Wordpress_User implements User_Definition { - private $user_info; - - public function __construct($user_info=null) { - $this->user_info = $user_info; - } - - public function display_name() { - return $this->user_info['user_nicename']; - } - - public function groups() { - return $this->groups; - } - - public function __get($key) { - switch($key) { - case "name": - return $this->user_info['user_login']; - - case "guest": - return false; - - case "id": - return $this->user_info['ID']; - - case "groups": - $groups = array(new Wordpress_Group('everybody')); - - if (isset($this->user_info['roles'])) { - $roles = unserialize($this->user_info['roles']); - foreach ($roles as $k => $r) { - $groups[] = new Wordpress_Group($k); - } - } - $this->groups = $groups; - return $this->groups; - - case "locale": // @todo - return null; - - case "admin": - foreach($this->groups as $g) { - if ($g->id == 'administrator') { - $this->admin = true; - return $this->admin; - } - } - $this->admin = false; - return $this->admin; - - case "email": - return $this->user_info['user_email']; - - case "full_name": - return $this->user_info['user_nicename']; - - case "url": - return $this->user_info['user_url']; - - case "user_pass": - return $this->user_info['user_pass']; - - default: - throw new Exception("@todo UNKNOWN_KEY ($key)"); - } - } - - public function avatar_url($size=80, $default=null) { - return sprintf("http://www.gravatar.com/avatar/%s.jpg?s=%d&r=pg%s", - md5($this->email), $size, $default ? "&d=" . urlencode($default) : ""); - } -} - -class Wordpress_Group implements Group_Definition { - public $id; - public $name; - - public function __construct($id, $name = null) { - $this->id = $id; - if (is_null($name)) $name = ucfirst($id); - $this->name = $name; - } -} diff --git a/3.1/modules/wordpress_auth/libraries/drivers/IdentityProvider/Wordpressfile.php b/3.1/modules/wordpress_auth/libraries/drivers/IdentityProvider/Wordpressfile.php deleted file mode 100644 index 4e2b84d7..00000000 --- a/3.1/modules/wordpress_auth/libraries/drivers/IdentityProvider/Wordpressfile.php +++ /dev/null @@ -1,278 +0,0 @@ -id = 0; - self::$_guest_user->name = "Guest"; - self::$_guest_user->full_name = "Guest"; - self::$_guest_user->guest = true; - self::$_guest_user->admin = false; - self::$_guest_user->locale = null; - self::$_guest_user->email = null; - self::$_guest_user->url = null; - } - return self::$_guest_user; - } - - /** - * @see IdentityProvider_Driver::admin_user. - */ - public function admin_user() { - $wp_user_search = new WP_User_Search(null, null, self::$_params['groups'][count(self::$_params['groups'])-1]); - $admins = $wp_user_search->get_results(); - - if (count($admins) == 0) { - throw new Exception("@todo NO ADMIN USER FOUND"); - } - - return new Wordpress_User($admins[0]); - } - - /** - * @see IdentityProvider_Driver::create_user. - */ - public function create_user($name, $full_name, $password, $email) { - throw new Exception("@todo INVALID OPERATION"); - } - - /** - * @see IdentityProvider_Driver::is_correct_password. - */ - public function is_correct_password($user, $password) { - return user_pass_ok($user->name, $password); - } - - /** - * @see IdentityProvider_Driver::lookup_user. - */ - public function lookup_user($id) { - $user = get_userdata($id); - - if (isset($user)) { - return new Wordpress_User($user); - } else { - return null; - } - } - - /** - * @see IdentityProvider_Driver::lookup_user_by_name. - */ - public function lookup_user_by_name($name) { - $user = get_userdatabylogin($name); - - if (isset($user)) { - return new Wordpress_User($user); - } else { - return null; - } - } - - /** - * @see IdentityProvider_Driver::create_group. - */ - public function create_group($name) { - throw new Exception("@todo INVALID OPERATION"); - } - - /** - * @see IdentityProvider_Driver::everybody. - */ - public function everybody() { - return new Wordpress_Group('everybody'); - } - - /** - * @see IdentityProvider_Driver::registered_users. - */ - public function registered_users() { - return new Wordpress_Group('registered_users'); - } - - /** - * @see IdentityProvider_Driver::get_user_list. - */ - public function get_user_list($ids) { - $users = array(); - foreach ($ids as $id) { - $users[] = $this->lookup_user($id); - } - return $users; - } - - /** - * @see IdentityProvider_Driver::lookup_group. - */ - public function lookup_group($name) { - $groups = $this->groups(); - foreach ($groups as $group) { - if ($group->id == $name) { - return $group; - } - } - return null; - } - - /** - * Look up the group by name. - * @param string $name the name of the group to locate - * @return Group_Definition - */ - public function lookup_group_by_name($name) { - return $this->lookup_group(strtolower($name)); - } - - /** - * @see IdentityProvider_Driver::groups. - */ - public function groups() { - if (isset($this->_groups)) { - return $this->_groups; - } - $wp_role_obj = new WP_Roles(); - $wp_roles = $wp_role_obj->roles; - $groups = array(new Wordpress_Group('everybody')); - foreach ($wp_roles as $k => $r) { - $groups[] = new Wordpress_Group(strtolower($k)); - } - return $groups; - } - - /** - * @see IdentityProvider_Driver::add_user_to_group. - */ - function add_user_to_group($user, $group) { - throw new Exception("@todo INVALID OPERATION"); - } - - /** - * @see IdentityProvider_Driver::remove_user_to_group. - */ - function remove_user_from_group($user, $group) { - throw new Exception("@todo INVALID OPERATION"); - } -} // End Identity Gallery Driver - -class Wordpress_User implements User_Definition { - private $user_info; - - public function __construct($user_info=null) { - $this->user_info = get_object_vars($user_info); - } - - public function display_name() { - return $this->user_info['user_nicename']; - } - - public function groups() { - return $this->groups; - } - - - - public function __get($key) { - switch($key) { - case "name": - return $this->user_info['user_login']; - - case "guest": - return false; - - case "id": - return $this->user_info['ID']; - - case"groups": - $groups = array(new Wordpress_Group('everybody')); - - global $table_prefix; - $user_roles = get_usermeta($this->id, $table_prefix.'capabilities'); - if (is_array($user_roles)) { - foreach ($user_roles as $r) { - $groups[] = new Wordpress_Group($r); - } - } - $this->groups = $groups; - return $this->groups; - - case "locale": // @todo - return null; - - case "admin": - foreach($this->groups as $g) { - if ($g->id == 'administrator') { - $this->admin = true; - return $this->admin; - } - } - $this->admin = false; - return $this->admin; - - case "email": - return $this->user_info['user_email']; - - case "full_name": - return $this->user_info['user_nicename']; - ; - - case "url": // @todo - return null; - - default: - throw new Exception("@todo UNKNOWN_KEY ($key)"); - } - } - - public function avatar_url($size=80, $default=null) { - return sprintf("http://www.gravatar.com/avatar/%s.jpg?s=%d&r=pg%s", - md5($this->email), $size, $default ? "&d=" . urlencode($default) : ""); - } -} - -class Wordpress_Group implements Group_Definition { - public $id; - public $name; - - public function __construct($id, $name = null) { - $this->id = $id; - if (is_null($name)) $name = ucfirst($id); - $this->name = $name; - } -} diff --git a/3.1/modules/wordpress_auth/module.info b/3.1/modules/wordpress_auth/module.info deleted file mode 100644 index e22f621d..00000000 --- a/3.1/modules/wordpress_auth/module.info +++ /dev/null @@ -1,7 +0,0 @@ -name = "WordPress Authentication" -description = "Use a WordPress installation for authentication" -version = 1 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Modules:wordpress_auth" -discuss_url = "http://gallery.menalto.com/forum_module_wordpress_auth" diff --git a/3.1/themes/browny_admin_wind/css/fix-ie.css b/3.1/themes/browny_admin_wind/css/fix-ie.css deleted file mode 100644 index 5475cb79..00000000 --- a/3.1/themes/browny_admin_wind/css/fix-ie.css +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Fix display in IE 6 and 7 - */ - -.g-unavailable { - filter: alpha(opacity=40); -} - -.g-unavailable:hover { - filter: alpha(opacity=100); -} - -tr.g-error td, -tr.g-info td, -tr.g-success td, -tr.g-warning td { - background: none !important; -} diff --git a/3.1/themes/browny_admin_wind/css/screen.css b/3.1/themes/browny_admin_wind/css/screen.css deleted file mode 100644 index fbabbcc3..00000000 --- a/3.1/themes/browny_admin_wind/css/screen.css +++ /dev/null @@ -1,1439 +0,0 @@ -/** - * Gallery 3 Browny Admin Wind Theme Screen Styles - * - * @requires YUI reset, font, grids CSS - * - * Sheet organization: - * 1) Basic HTML elements - * 2) Reusable content blocks - * 3) Page layout containers - * 4) Content blocks in specific layout containers - * 5) States and interactions - * 6) Positioning and order - * 7) Navigation and menus - * 8) ThemeRoller - * 9) jQuery and jQuery UI - * 10) Right-to-left language styles - * 11) More Browny - * - * @todo Review g-buttonset-vertical - */ - -/** ******************************************************************* - * 1) Basic HTML elements - **********************************************************************/ - -/* ~browny~ */ -body, html { - background-color: #5a3007; - font-family: 'Century gothic', Verdana, 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; -} - -p { - margin-bottom: 1em; - text-shadow: 0px 1px 1px #F7F5F0; -} - -em { - font-style: oblique; -} - -h1, h2, h3, h4, h5, strong, th { - font-weight: bold; - text-shadow: 1px 1px 0px #fff; -} - -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; -} - -h3 { - font-size: 1.2em; -} - -select, -input, -button, -textarea { - font: 99% 'Century gothic', Verdana, Arial, Helvetica, Clean, sans-serif; -} - -#l10n-client h2 { - text-shadow: none; -} - -/* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -/* ~browny~ */ -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: #7f5429 !important; - text-decoration: none; - -moz-outline-style: none; -} - -a:hover, -#g-dialog a:hover { - text-decoration: underline; -} - -.g-menu a:hover { - text-decoration: none; -} - -/* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -form { - margin: 0; -} - -fieldset { - border: 1px solid #ccc; - padding: 0 1em .8em 1em; -} - -#g-banner fieldset, -#g-sidebar fieldset { - border: none; - padding: 0; -} - -legend { - font-weight: bold; - margin: 0; - padding: 0 .2em; -} - -#g-banner legend, -#g-sidebar legend, -input[type="hidden"] { - display: none; -} - -input.textbox, -input[type="text"], -input[type="password"], -textarea { - border: 1px solid #e8e8e8; - border-top-color: #ccc; - border-left-color: #ccc; - clear: both; - color: #333; - width: 50%; -} - -textarea { - height: 12em; - width: 97%; -} - -input:focus, -input.textbox:focus, -input[type=text]:focus, -textarea:focus, -option:focus { - background-color: #ffc; - color: #000; -} - -input.checkbox, -input[type=checkbox], -input.radio, -input[type=radio] { - float: left; - margin-right: .4em; -} - -/* Form layout ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -form li { - margin: 0; - padding: 0 0 .2em 0; -} - -form ul { - margin-top: 0; -} - -form ul ul { - clear: both; -} - -form ul ul li { - float: left; -} - -input, -select, -textarea { - display: block; - clear: both; - padding: .2em; -} - -input[type="submit"], -input[type="reset"] { - display: inline; - clear: none; - float: left; -} - -/* Forms in dialogs and panels ~~~~~~~~~ */ - -#g-dialog ul li { - padding-bottom: .8em; -} - -#g-dialog fieldset, -#g-panel fieldset { - border: none; - padding: 0; -} - -#g-panel legend { - display: none; -} - -input[readonly] { - background-color: #F4F4FC; -} - -#g-dialog input.textbox, -#g-dialog input[type=text], -#g-dialog input[type=password], -#g-dialog textarea { - width: 97%; -} - -/* Short forms ~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-short-form legend, -.g-short-form label { - display: none; -} - -.g-short-form fieldset { - border: none; - padding: 0; -} - -.g-short-form li { - float: left; - margin: 0 !important; - padding: .4em 0; -} - -.g-short-form .textbox, -.g-short-form input[type=text] { - color: #666; - padding: .3em .6em; - width: 100%; -} - -.g-short-form .textbox.g-error { - border: 1px solid #f00; - color: #f00; - padding-left: 24px; -} - -.g-short-form .g-cancel { - display: block; - margin: .3em .8em; -} - -#g-sidebar .g-short-form li { - padding-left: 0; - padding-right: 0; -} - -fieldset { - margin-bottom: 1em; -} - -#g-content form ul li { - padding: .4em 0; -} - -#g-dialog form { - width: 270px; -} - -#g-dialog fieldset { - margin-bottom: 0; -} - -fieldset { - margin-bottom: 1em; -} - -#g-content form ul li { - padding: .4em 0; -} - -#g-dialog form { - width: 270px; -} - -#g-dialog fieldset { - margin-bottom: 0; -} - -/* Tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -table { - width: 100%; -} - -#g-content table { - margin: .6em 0 2em 0; -} - -caption, -th { - text-align: left; -} - -th, -td { - border: none; - border-bottom: 1px solid #ccc; - padding: .5em; - vertical-align: middle; -} - -th { - vertical-align: bottom; - white-space: nowrap; -} - -/** ******************************************************************* - * 2) Reusable content blocks - *********************************************************************/ - -.g-block, -#g-content #g-admin-dashboard .g-block { - background-color: #fff; - border: 1px solid #ccc; - padding: 1em; -} - -/* ~browny~ */ -.g-block h2 { - background-color: #f2e6d4; - padding: .3em .8em; -} - -.g-block-content { - margin-top: 1em; - text-shadow: 0px 1px 0px #fff; -} - -#g-content .g-block { - border: none; - padding: 0; -} - -#g-sidebar .g-block-content { - padding: 0; -} - -/* ~browny~ */ -#g-content .g-selected, -#g-content .g-available .g-block { - border: 1px solid #f2e6d4; - padding: .8em; -} - -.g-selected img, -.g-available .g-block img { - float: left; - margin: 0 1em 1em 0; -} - -/* ~browny~ */ -.g-selected { - background: #F5EEE4; -} - -/* ~browny~ */ -.g-available .g-installed-toolkit:hover { - cursor: pointer; - background: #F5EEE4; -} - -.g-available .g-button { - width: 96%; -} - -.g-selected .g-button { - display: none; -} - -.g-unavailable { - border-color: #999; - opacity: 0.4; -} - -.g-info td { - background-color: transparent; - background-image: none; -} - -#g-maintenance-mode ul.g-message-block { - margin-top: .5em; -} - -.g-success td { - background-color: transparent; - background-image: none; -} - -.g-error td { - background-color: #f6cbca; - background-image: none; -} - -.g-warning td { - background-color: #fcf9ce; - background-image: none; -} - -.g-module-status.g-info, -#g-log-entries .g-info, -.g-module-status.g-success, -#g-log-entries .g-success { - background-color: #fff; -} - -ul.enumeration li { - list-style-type: disc; - margin-left: 20px; -} - -/*** ****************************************************************** - * 3) Page layout containers - *********************************************************************/ -/* Dimension and scale ~~~~~~~~~~~~~~~~~~~ */ -.g-one-quarter { - width: 25%; -} - -.g-one-third { - width: 33%; -} - -.g-one-half { - width: 50%; -} - -.g-two-thirds { - width: 66%; -} - -.g-three-quarters { - width: 75%; -} - -.g-whole { - width: 100%; -} - -/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-header #g-login-menu { - margin-top: 1em; - float: right; -} - -/* View container ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-view { - background-color: #fff; - border: 1px solid #ccc; - border-bottom: none; - min-width: 974px !important; -} - -/* Layout containers ~~~~~~~~~~~~~~~~~~~~~ */ - -/* ~browny~ */ -#g-header { - background-color: #f2e6d4; - border-bottom: 1px solid #ccc; - font-size: .8em; - min-height: 9em; - margin-bottom: 20px; - padding: 0 20px; - position: relative; -} - -#g-content { - font-size: 1.1em; - padding: 0 2em; - width: 96%; -} - -#g-sidebar { - background-color: #fff; - font-size: .9em; - padding: 0 20px; - width: 220px; -} - -/* ~browny~ */ -#g-footer { - background-color: #f2e6d4; - border-top: 1px solid #ccc; - font-size: .8em; - margin-top: 20px; - padding: 10px 20px; -} - -/** ******************************************************************* - * 4) Content blocks in specific layout containers - *********************************************************************/ - -/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-header #g-logo { - background: transparent url('../images/logo.png') no-repeat 0 .5em; - color: #A5A5A5 !important; - display: block; - height: 110px; - padding-top: 0px; - width: 205px; -} - -#g-header #g-logo:hover { - color: #f60 !important; - text-decoration: none; -} - -#g-content .g-block h2 { - background-color: transparent; - padding-left: 0; -} - -#g-sidebar .g-block-content { - padding-left: 1em; -} - -.g-block .ui-dialog-titlebar { - margin: -1em -1em 0; -} - -#g-sidebar .g-block h2 { - background: none; -} - -/* Photo stream ~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-photo-stream { - background-color: #e8e8e8; -} - -#g-photo-stream .g-block-content ul { - border-right: 1px solid #e8e8e8; - height: 135px; - overflow: auto; - overflow: -moz-scrollbars-horizontal; /* for FF */ - overflow-x: scroll; /* scroll horizontal */ - overflow-y: hidden; /* Hide vertical*/ -} - -#g-content #g-photo-stream .g-item { - background-color: #fff; - border: 1px solid #e8e8e8; - border-right-color: #ccc; - border-bottom-color: #ccc; - float: left; - height: 90px; - overflow: hidden; - text-align: center; - width: 90px; -} - -#g-content .g-item { - background-color: #fff; - border: 1px solid #e8e8e8; - border-right-color: #ccc; - border-bottom-color: #ccc; - height: 90px; - padding: 14px 8px; - text-align: center; - width: 90px; -} - -/* Graphics settings ~~~~~~~~~~~~~~~~~~~~~ */ - -#g-admin-graphics .g-available .g-block { - clear: none; - float: left; - margin-right: 1em; - width: 30%; -} - -/* Appearance settings ~~~~~~~~~~~~~~~~~~~ */ - -#g-site-theme, -#g-admin-theme { - float: left; - width: 48%; -} - -#g-site-theme { - margin-right: 1em; -} - -/* Block admin ~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-admin-blocks-list { - float: left; - margin: 0 2em 2em 0; - width: 30%; -} - -.g-admin-blocks-list div:last-child { - border: .1em solid; - height: 100%; -} - -.g-admin-blocks-list ul { - height: 98%; - margin: .1em .1em; - padding: .1em; -} - -/* ~browny~ */ -.g-admin-blocks-list ul li.g-draggable { - background-color: #F5EEE4; - margin: .5em; - padding: .3em .8em; -} - -/* In-line editing ~~~~~~~~~~~~~~~~~~~~ */ -#g-in-place-edit-message { - background-color: #FFF; -} - -/* Language options ~~~~~~~~~~~~~~~~~~~~~~~~ */ -#g-share-translations-form fieldset { - border: 0px; - margin: 0px; - padding: 0px; -} - -#g-share-translations-form fieldset legend { - display: none; -} - -/** ******************************************************************* - * 5) States and interactions - **********************************************************************/ - -.g-active, -.g-enabled, -.g-available, -.g-selected, -.g-highlight { - font-weight: bold; -} - -.g-inactive, -.g-disabled, -.g-unavailable, -.g-uneditable, -.g-locked, -.g-deselected, -.g-understate { - color: #ccc; - font-weight: normal; -} - -.g-editable { - padding: .2em .3em; -} - -.g-editable:hover { - background-color: #ffc; - cursor: text; -} - -.g-error, -.g-info, -.g-success, -.g-warning { - padding-left: 30px; -} - -form li.g-error, -form li.g-info, -form li.g-success, -form li.g-warning { - background-image: none; - padding: .3em .8em .3em 0; -} - -.g-short-form li.g-error { - padding: .3em 0; -} - -form.g-error input[type="text"], -li.g-error input[type="text"], -form.g-error input[type="password"], -li.g-error input[type="password"], -form.g-error input[type="checkbox"], -li.g-error input[type="checkbox"], -form.g-error input[type="radio"], -li.g-error input[type="radio"], -form.g-error textarea, -li.g-error textarea, -form.g-error select, -li.g-error select { - border: 2px solid #f00; - margin-bottom: .2em; -} - -.g-error, -.g-denied, -tr.g-error td.g-error, -#g-add-photos-status .g-error { - background: #f6cbca url('../images/ico-error.png') no-repeat .4em 50%; - color: #f00; -} - -.g-info { - background: #e8e8e8 url('../images/ico-info.png') no-repeat .4em 50%; -} - -.g-success, -.g-allowed, -#g-add-photos-status .g-success { - background: #d9efc2 url('../images/ico-success.png') no-repeat .4em 50%; -} - -tr.g-success { - background-image: none; -} - -tr.g-success td.g-success { - background-image: url('../images/ico-success.png'); -} - -.g-warning, -tr.g-warning td.g-warning { - background: #fcf9ce url('../images/ico-warning.png') no-repeat .4em 50%; -} - -form .g-error { - background-color: #fff; - padding-left: 20px; -} - -.g-open { -} - -.g-closed { -} - -.g-installed { - background-color: #eeeeee; -} - -.g-default { - background-color: #c5dbec; - font-weight: bold; -} - -.g-draggable { - cursor: move; -} - -.g-draggable:hover { - border: 1px dashed #000; -} - -.ui-sortable .g-target, -.ui-state-highlight { - background-color: #fcf9ce; - border: 2px dotted #999; - height: 2em; - margin: 1em 0; -} - -/* Ajax loading indicator ~~~~~~~~~~~~~~~~ */ - -.g-loading-large, -.g-dialog-loading-large { - background: #e8e8e8 url('../images/loading-large.gif') no-repeat center center !important; -} - -.g-loading-small { - background: #e8e8e8 url('../images/loading-small.gif') no-repeat center center !important; -} - -/** ******************************************************************* - * 6) Positioning and order - **********************************************************************/ - -.g-left { - clear: none; - float: left; -} - -.g-right { - clear: none; - float: right; -} - -.g-first { -} - -.g-last { -} - -.g-even { - background-color: #ede4d5; -} - -.g-odd { - background-color: #fff; -} - -/** ******************************************************************* - * 7) Navigation and menus - *********************************************************************/ - -/* Site Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-site-admin-menu { - bottom: 0; - font-size: 1.2em; - left: 240px; - position: absolute; -} - -#g-site-admin-menu ul { - margin-bottom: 0; -} - -/** ******************************************************************* - * 8) ThemeRoller Theme - **********************************************************************/ -/* ~browny~ */ - -/* ThemeRoller overrides ~~~~~~~~~~~~~~ */ -@import "themeroller/ui.tabs.css"; - -/** ******************************************************************* - * 9) jQuery and jQuery UI - *********************************************************************/ -/* Generic block container ~~~~~~~~~~~~~~~ */ - -.g-block { - clear: both; - margin-bottom: 2.5em; -} - -.g-block-content { -} - -/* Buttons ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-button { - display: inline-block; - margin: 0 4px 0 0; - padding: .2em .4em; - text-shadow: 0px 1px 1px #fff; -} - -.g-button, -.g-button:hover, -.g-button:active { - cursor: pointer !important; - outline: 0; - text-decoration: none; - -moz-outline-style: none; -} - -button { - padding: 2px 4px 2px 4px; -} - -/* jQuery UI ThemeRoller buttons ~~~~~~~~~ */ - -.g-buttonset { - padding-left: 1px; -} - -.g-buttonset li { - float: left; -} - -.g-buttonset .g-button { - margin: 0; -} - -.ui-icon-left .ui-icon { - float: left; - margin-right: .2em; -} - -.ui-icon-right .ui-icon { - float: right; - margin-left: .2em; -} - -/* Rotate icon, ThemeRoller only provides one of these */ - -.ui-icon-rotate-ccw { - background-position: -192px -64px; -} - -.ui-icon-rotate-cw { - background-position: -208px -64px; -} - -.g-progress-bar { - height: 1em; - width: 100%; - margin-top: .5em; - display: inline-block; -} - -/* Status and validation messages ~~~~ */ - -.g-message-block { - background-position: .4em .3em; - border: 1px solid #ccc; - padding: 0; -} - -#g-action-status { - margin-bottom: 1em; -} - -#g-action-status li, -p#g-action-status, -div#g-action-status { - padding: .3em .3em .3em 30px; -} - -#g-site-status li { - border-bottom: 1px solid #ccc; - padding: .3em .3em .3em 30px; -} - -.g-module-status { - clear: both; - margin-bottom: 1em; -} - -.g-message { - background-position: 0 50%; -} - -/* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-breadcrumbs { - clear: both; - padding: 0 20px; -} - -.g-breadcrumbs li { - background: transparent url('../images/ico-separator.gif') no-repeat scroll left center; - float: left; - padding: 1em 8px 1em 18px; -} - -.g-breadcrumbs .g-first { - background: none; - padding-left: 0; -} - -.g-breadcrumbs li a, -.g-breadcrumbs li span { - display: block; -} - -#g-dialog ul.g-breadcrumbs { - margin-left: 0; - padding-left: 0; -} - -/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-paginator { - padding: .2em 0; - width: 100%; -} - -.g-paginator li { - float: left; - width: 30%; -} - -.g-paginator .g-info { - background: none; - padding: .2em 0; - text-align: center; - width: 40%; -} - -/* Dialogs and panels ~~~~~~~~~~~~~~~~~~ */ - -#g-dialog { - text-align: left; -} - -#g-dialog legend { - display: none; -} - -#g-dialog .g-cancel { - margin: .4em 1em; -} - -#g-panel { - display: none; - padding: 1em; -} - -/* Inline layout ~~~~~~~~~~ */ - -.g-inline li { - float: left; - margin-left: 1.8em; - padding-left: 0 !important; -} - -.g-inline li.g-first { - margin-left: 0; -} - -/* Superfish menu overrides ~~~~~~~~~~~ */ -.sf-menu ul { - width: 12em; -} - -ul.sf-menu li li:hover ul, -ul.sf-menu li li.sfHover ul { - left: 12em; -} - -ul.sf-menu li li li:hover ul, -ul.sf-menu li li li.sfHover ul { - left: 12em; -} - -/* ~browny~ */ -.sf-menu li li, -.sf-menu li li ul li { - background: #d3b07e url('../images/ui-bg_highlight-soft_15_d3b07e_1x100.png') 50% 50% repeat-x; -} - -/* ~browny~ */ -.sf-menu li:hover { - background-color: #e0cbae; -} - -/* ~browny~ */ -.sf-menu a { - border-top: 1px solid #e0cbae; -} - -/* ~browny~ */ -.sf-menu li { - background: #d3b07e url('../images/ui-bg_highlight-soft_45_d3b07e_1x100.png') 50% 50% repeat-x; - text-shadow: 0px 1px 1px #fff; -} - -/* ~browny~ */ -.sf-menu li:hover, -.sf-menu li.sfHover, -.sf-menu a:focus, -.sf-menu a:hover, -.sf-menu a:active { - background: #e0cbae; -} - -/* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~ */ - -#g-admin-dashboard .ui-state-highlight, -#g-sidebar .ui-state-highlight { - height: 2em; - margin-bottom: 1em; -} - -.g-buttonset-vertical a { - width: 8em !important; -} - -#g-admin-dashboard .ui-dialog-titlebar, -#g-admin-dashboard-sidebar .ui-dialog-titlebar { - padding: .2em .4em; -} - -.ui-dialog-content { - text-shadow: 0px 1px 1px #fff; -} - -.ui-widget { - font-family: 'Century gothic', Verdana, 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; -} - -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { - font-family: 'Century gothic', Verdana, 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; -} - -/** ******************************************************************* - * 10) Right to left styles - *********************************************************************/ - -.rtl { - direction: rtl; -} - -.rtl #g-header, -.rtl #g-content, -.rtl #g-sidebar, -.rtl #g-footer, -.rtl caption, -.rtl th, -.rtl #g-dialog, -.rtl .g-context-menu li a, -.rtl .g-message-box li, -.rtl #g-site-status li { - text-align: right; -} - -.rtl .g-text-right { - text-align: left; -} - -.rtl .g-error, -.rtl .g-info, -.rtl .g-success, -.rtl .g-warning, -.rtl #g-add-photos-status .g-success, -.rtl #g-add-photos-status .g-error { - background-position: center right; - padding-right: 30px !important; -} - -.rtl form li.g-error, -.rtl form li.g-info, -.rtl form li.g-success, -.rtl form li.g-warning { - padding-right: 0 !important; -} - -.rtl .g-left, -.rtl .g-inline li, -.rtl #g-content #g-album-grid .g-item, -.rtl .sf-menu li, -.rtl .g-breadcrumbs li, -.rtl .g-paginator li, -.rtl .g-buttonset li, -.rtl .ui-icon-left .ui-icon, -.rtl .g-short-form li, -.rtl form ul ul li, -.rtl input[type="submit"], -.rtl input[type="reset"], -.rtl input.checkbox, -.rtl input[type=checkbox], -.rtl input.radio, -.rtl input[type=radio] { - float: right; -} - -.rtl .g-right, -.rtl .ui-icon-right .ui-icon { - float: left; -} - -.rtl .g-inline li { - margin-right: 1em; -} - -.rtl .g-inline li.g-first { - margin-right: 0; -} - -.rtl .g-breadcrumbs li { - background: transparent url('../images/ico-separator-rtl.gif') no-repeat scroll right center; - padding: 1em 18px 1em 8px; -} - -.rtl .g-breadcrumbs .g-first { - background: none; - padding-right: 0; -} - -.rtl input.checkbox { - margin-left: .4em; -} - -.rtl #g-add-comment { - right: inherit; - left: 0; -} - -.rtl .ui-icon-left .ui-icon { - margin-left: .2em; -} - -.rtl .ui-icon-right .ui-icon { - margin-right: .2em; -} - -/* RTL Corner radius ~~~~~~~~~~~~~~~~~~~~~~ */ -.rtl .g-buttonset .ui-corner-tl { - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - border-top-left-radius: 0; - -moz-border-radius-topright: 5px !important; - -webkit-border-top-right-radius: 5px !important; - border-top-right-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-tr { - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -moz-border-radius-topleft: 5px !important; - -webkit-border-top-left-radius: 5px !important; - border-top-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-bl { - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 5px !important; - -webkit-border-bottom-right-radius: 5px !important; - border-bottom-right-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-br { - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomleft: 5px !important; - -webkit-border-bottom-left-radius: 5px !important; - border-bottom-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-right, -.rtl .ui-progressbar .ui-corner-right { - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -moz-border-radius-topleft: 5px !important; - -webkit-border-top-left-radius: 5px !important; - border-top-left-radius: 5px !important; - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomleft: 5px !important; - -webkit-border-bottom-left-radius: 5px !important; - border-bottom-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-left, -.rtl .ui-progressbar .ui-corner-left { - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - border-top-left-radius: 0; - -moz-border-radius-topright: 5px !important; - -webkit-border-top-right-radius: 5px !important; - border-top-right-radius: 5px !important; - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 5px !important; - -webkit-border-bottom-right-radius: 5px !important; - border-bottom-right-radius: 5px !important; -} - -/* RTL Superfish ~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.rtl .sf-menu a { - border-left: none; - border-right:1px solid #fff; -} - -.rtl .sf-menu a.sf-with-ul { - padding-left: 2.25em; - padding-right: 1em; -} - -.rtl .sf-sub-indicator { - left: .75em !important; - right: auto; - background: url('../../../lib/superfish/images/arrows-ffffff-rtl.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */ -} -.rtl a > .sf-sub-indicator { /* give all except IE6 the correct values */ - top: .8em; - background-position: -10px -100px; /* use translucent arrow for modern browsers*/ -} -/* apply hovers to modern browsers */ -.rtl a:focus > .sf-sub-indicator, -.rtl a:hover > .sf-sub-indicator, -.rtl a:active > .sf-sub-indicator, -.rtl li:hover > a > .sf-sub-indicator, -.rtl li.sfHover > a > .sf-sub-indicator { - background-position: 0 -100px; /* arrow hovers for modern browsers*/ -} - -/* point right for anchors in subs */ -.rtl .sf-menu ul .sf-sub-indicator { background-position: 0 0; } -.rtl .sf-menu ul a > .sf-sub-indicator { background-position: -10px 0; } -/* apply hovers to modern browsers */ -.rtl .sf-menu ul a:focus > .sf-sub-indicator, -.rtl .sf-menu ul a:hover > .sf-sub-indicator, -.rtl .sf-menu ul a:active > .sf-sub-indicator, -.rtl .sf-menu ul li:hover > a > .sf-sub-indicator, -.rtl .sf-menu ul li.sfHover > a > .sf-sub-indicator { - background-position: 0 0; /* arrow hovers for modern browsers*/ -} - -.rtl .sf-menu li:hover ul, -.rtl .sf-menu li.sfHover ul { - right: 0; - left: auto; -} - -.rtl ul.sf-menu li li:hover ul, -.rtl ul.sf-menu li li.sfHover ul { - right: 12em; /* match ul width */ - left: auto; -} -.rtl ul.sf-menu li li li:hover ul, -.rtl ul.sf-menu li li li.sfHover ul { - right: 12em; /* match ul width */ - left: auto; -} - -/*** shadows for all but IE6 ***/ -.rtl .sf-shadow ul { - background: url('../../../lib/superfish/images/shadow.png') no-repeat bottom left; - padding: 0 0 9px 8px; - border-top-right-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-topright: 0; - -moz-border-radius-bottomleft: 0; - -webkit-border-top-right-radius: 0; - -webkit-border-bottom-left-radius: 0; - -moz-border-radius-topleft: 17px; - -moz-border-radius-bottomright: 17px; - -webkit-border-top-left-radius: 17px; - -webkit-border-bottom-right-radius: 17px; - border-top-left-radius: 17px; - border-bottom-right-radius: 17px; -} - -/* RTL ThemeRoller ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.rtl .ui-dialog .ui-dialog-titlebar { - padding: 0.5em 1em 0.3em 0.3em; -} - -.rtl .ui-dialog .ui-dialog-title { - float: right; -} - -.rtl .ui-dialog .ui-dialog-titlebar-close { - left: 0.3em; - right: auto; -} - -.rtl #g-content #g-album-grid .g-item, -.rtl #g-site-theme, -.rtl #g-admin-theme, -.rtl .g-selected img, -.rtl .g-available .g-block img, -.rtl #g-content #g-photo-stream .g-item, -.rtl li.g-group, -.rtl #g-server-add-admin { - float: right; -} - -.rtl #g-admin-graphics .g-available .g-block { - float: right; - margin-left: 1em; - margin-right: 0em; -} - -.rtl #g-site-admin-menu { - left: auto; - right: 240px; -} - -.rtl #g-header #g-login-menu { - float: left; -} - -.rtl #g-header #g-login-menu li { - margin-left: 0; - padding-left: 0; - padding-right: 1.2em; -} - -/* ~browny~ */ -.rtl .g-selected img, -.rtl .g-available .g-block img { - margin: 0 0 1em 1em; -} - -/** ******************************************************************* - * 11) More Browny (Extra overrides for better Browny look) - *********************************************************************/ - -/* /lib/gallery.common.css ~~~~~~~~~~~~ */ - -.g-success { -background: #fcf9ce url('../images/ico-success.png') no-repeat .4em 50% -} - -.g-even { - background: transparent; -} - -.g-odd { - background-color: #f2e6d4; -} - -/* /modules/gallery/css/l10n_client.css */ - -#l10n-client .labels { - background:#262626 !important; -} - -/* /modules/user/css/user.css ~~~~~~~~~ */ - -#g-user-admin-list .g-admin { - color: #8d8d3d !important; -} diff --git a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_flat_0_aaaaaa_40x100.png b/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_flat_0_aaaaaa_40x100.png deleted file mode 100755 index 5b5dab2a..00000000 Binary files a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_flat_0_aaaaaa_40x100.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_flat_55_fbd388_40x100.png b/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_flat_55_fbd388_40x100.png deleted file mode 100755 index ab36af14..00000000 Binary files a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_flat_55_fbd388_40x100.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_glass_55_ead2ae_1x400.png b/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_glass_55_ead2ae_1x400.png deleted file mode 100755 index 2719d497..00000000 Binary files a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_glass_55_ead2ae_1x400.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_glass_75_f2e6d4_1x400.png b/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_glass_75_f2e6d4_1x400.png deleted file mode 100755 index 840cf86c..00000000 Binary files a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_glass_75_f2e6d4_1x400.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_glass_95_fef1ec_1x400.png b/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_glass_95_fef1ec_1x400.png deleted file mode 100755 index 4443fdc1..00000000 Binary files a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_glass_95_fef1ec_1x400.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_gloss-wave_55_714213_500x100.png b/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_gloss-wave_55_714213_500x100.png deleted file mode 100755 index 5c24f8c4..00000000 Binary files a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_gloss-wave_55_714213_500x100.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_inset-hard_100_ecd9c1_1x100.png b/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_inset-hard_100_ecd9c1_1x100.png deleted file mode 100755 index 600ad13a..00000000 Binary files a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_inset-hard_100_ecd9c1_1x100.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_inset-hard_100_f6f3ef_1x100.png b/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_inset-hard_100_f6f3ef_1x100.png deleted file mode 100755 index 203e259b..00000000 Binary files a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-bg_inset-hard_100_f6f3ef_1x100.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_3d2105_256x240.png b/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_3d2105_256x240.png deleted file mode 100755 index e38c4188..00000000 Binary files a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_3d2105_256x240.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_41260c_256x240.png b/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_41260c_256x240.png deleted file mode 100755 index 46ea5bec..00000000 Binary files a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_41260c_256x240.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_563b1a_256x240.png b/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_563b1a_256x240.png deleted file mode 100755 index b39e12aa..00000000 Binary files a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_563b1a_256x240.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_704a24_256x240.png b/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_704a24_256x240.png deleted file mode 100755 index edf5228f..00000000 Binary files a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_704a24_256x240.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_be5f09_256x240.png b/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_be5f09_256x240.png deleted file mode 100755 index a5ca814b..00000000 Binary files a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_be5f09_256x240.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_cd0a0a_256x240.png b/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_cd0a0a_256x240.png deleted file mode 100755 index 7cdf7b2e..00000000 Binary files a/3.1/themes/browny_admin_wind/css/themeroller/images/ui-icons_cd0a0a_256x240.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/css/themeroller/ui.base.css b/3.1/themes/browny_admin_wind/css/themeroller/ui.base.css deleted file mode 100755 index 1a1810c8..00000000 --- a/3.1/themes/browny_admin_wind/css/themeroller/ui.base.css +++ /dev/null @@ -1,7 +0,0 @@ -@import "ui.core.css"; -@import "ui.theme.css"; -@import "ui.datepicker.css"; -@import "ui.dialog.css"; -@import "ui.progressbar.css"; -@import "ui.resizable.css"; -@import "ui.tabs.css"; diff --git a/3.1/themes/browny_admin_wind/css/themeroller/ui.core.css b/3.1/themes/browny_admin_wind/css/themeroller/ui.core.css deleted file mode 100755 index c2f18f2c..00000000 --- a/3.1/themes/browny_admin_wind/css/themeroller/ui.core.css +++ /dev/null @@ -1,37 +0,0 @@ -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } \ No newline at end of file diff --git a/3.1/themes/browny_admin_wind/css/themeroller/ui.datepicker.css b/3.1/themes/browny_admin_wind/css/themeroller/ui.datepicker.css deleted file mode 100755 index 567f8c97..00000000 --- a/3.1/themes/browny_admin_wind/css/themeroller/ui.datepicker.css +++ /dev/null @@ -1,62 +0,0 @@ -/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -} \ No newline at end of file diff --git a/3.1/themes/browny_admin_wind/css/themeroller/ui.dialog.css b/3.1/themes/browny_admin_wind/css/themeroller/ui.dialog.css deleted file mode 100755 index 2997595b..00000000 --- a/3.1/themes/browny_admin_wind/css/themeroller/ui.dialog.css +++ /dev/null @@ -1,13 +0,0 @@ -/* Dialog -----------------------------------*/ -.ui-dialog { position: relative; padding: .2em; width: 300px; } -.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } diff --git a/3.1/themes/browny_admin_wind/css/themeroller/ui.progressbar.css b/3.1/themes/browny_admin_wind/css/themeroller/ui.progressbar.css deleted file mode 100755 index bc0939ec..00000000 --- a/3.1/themes/browny_admin_wind/css/themeroller/ui.progressbar.css +++ /dev/null @@ -1,4 +0,0 @@ -/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/3.1/themes/browny_admin_wind/css/themeroller/ui.resizable.css b/3.1/themes/browny_admin_wind/css/themeroller/ui.resizable.css deleted file mode 100755 index 44efeb2e..00000000 --- a/3.1/themes/browny_admin_wind/css/themeroller/ui.resizable.css +++ /dev/null @@ -1,13 +0,0 @@ -/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} \ No newline at end of file diff --git a/3.1/themes/browny_admin_wind/css/themeroller/ui.tabs.css b/3.1/themes/browny_admin_wind/css/themeroller/ui.tabs.css deleted file mode 100755 index 3ca6b9a0..00000000 --- a/3.1/themes/browny_admin_wind/css/themeroller/ui.tabs.css +++ /dev/null @@ -1,11 +0,0 @@ -/* Tabs -----------------------------------*/ -.ui-tabs { padding: .2em; zoom: 1; } -.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } -.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/3.1/themes/browny_admin_wind/css/themeroller/ui.theme.css b/3.1/themes/browny_admin_wind/css/themeroller/ui.theme.css deleted file mode 100755 index 8d5bc8fe..00000000 --- a/3.1/themes/browny_admin_wind/css/themeroller/ui.theme.css +++ /dev/null @@ -1,247 +0,0 @@ - - - - -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Geeza%20Pro,%20Lucida%20Grande,%20Lucida%20Sans,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=714213&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=55&borderColorHeader=4e2e0e&fcHeader=ffffff&iconColorHeader=41260c&bgColorContent=f6f3ef&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=9e7247&fcContent=222222&iconColorContent=3d2105&bgColorDefault=f2e6d4&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=c2ad99&fcDefault=7f5429&iconColorDefault=704a24&bgColorHover=ead2ae&bgTextureHover=02_glass.png&bgImgOpacityHover=55&borderColorHover=ab8b6d&fcHover=7f5429&iconColorHover=704a24&bgColorActive=ecd9c1&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=100&borderColorActive=684f36&fcActive=734d21&iconColorActive=563b1a&bgColorHighlight=fbd388&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=f3af30&fcHighlight=363636&iconColorHighlight=be5f09&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #9e7247; background: #f6f3ef url(images/ui-bg_inset-hard_100_f6f3ef_1x100.png) 50% bottom repeat-x; color: #222222; } -.ui-widget-content a { color: #222222; } -.ui-widget-header { border: 1px solid #4e2e0e; background: #714213 url(images/ui-bg_gloss-wave_55_714213_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } -.ui-widget-header a { color: #ffffff; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #c2ad99; background: #f2e6d4 url(images/ui-bg_glass_75_f2e6d4_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #7f5429; outline: none; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #7f5429; text-decoration: none; outline: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #ab8b6d; background: #ead2ae url(images/ui-bg_glass_55_ead2ae_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #7f5429; outline: none; } -.ui-state-hover a, .ui-state-hover a:hover { color: #7f5429; text-decoration: none; outline: none; } -.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #684f36; background: #ecd9c1 url(images/ui-bg_inset-hard_100_ecd9c1_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #734d21; outline: none; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #734d21; outline: none; text-decoration: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #f3af30; background: #fbd388 url(images/ui-bg_flat_55_fbd388_40x100.png) 50% 50% repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } -.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_3d2105_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_3d2105_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_41260c_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_704a24_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_704a24_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_563b1a_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_be5f09_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; } -.ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; } -.ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; } -.ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; } -.ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; } -.ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; } -.ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; } - -/* Overlays */ -.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } -.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; } \ No newline at end of file diff --git a/3.1/themes/browny_admin_wind/images/avatar.jpg b/3.1/themes/browny_admin_wind/images/avatar.jpg deleted file mode 100644 index 1345b31a..00000000 Binary files a/3.1/themes/browny_admin_wind/images/avatar.jpg and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/images/ico-info.png b/3.1/themes/browny_admin_wind/images/ico-info.png deleted file mode 100644 index 3e9e9e87..00000000 Binary files a/3.1/themes/browny_admin_wind/images/ico-info.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/images/ico-success.png b/3.1/themes/browny_admin_wind/images/ico-success.png deleted file mode 100644 index 6e0f6f54..00000000 Binary files a/3.1/themes/browny_admin_wind/images/ico-success.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/images/loading-large.gif b/3.1/themes/browny_admin_wind/images/loading-large.gif deleted file mode 100644 index cc70a7a8..00000000 Binary files a/3.1/themes/browny_admin_wind/images/loading-large.gif and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/images/loading-small.gif b/3.1/themes/browny_admin_wind/images/loading-small.gif deleted file mode 100644 index d0bce154..00000000 Binary files a/3.1/themes/browny_admin_wind/images/loading-small.gif and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/images/logo.png b/3.1/themes/browny_admin_wind/images/logo.png deleted file mode 100644 index 6ffa889b..00000000 Binary files a/3.1/themes/browny_admin_wind/images/logo.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/images/ui-bg_highlight-soft_15_d3b07e_1x100.png b/3.1/themes/browny_admin_wind/images/ui-bg_highlight-soft_15_d3b07e_1x100.png deleted file mode 100755 index 99a55f5f..00000000 Binary files a/3.1/themes/browny_admin_wind/images/ui-bg_highlight-soft_15_d3b07e_1x100.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/images/ui-bg_highlight-soft_45_d3b07e_1x100.png b/3.1/themes/browny_admin_wind/images/ui-bg_highlight-soft_45_d3b07e_1x100.png deleted file mode 100755 index 063dc802..00000000 Binary files a/3.1/themes/browny_admin_wind/images/ui-bg_highlight-soft_45_d3b07e_1x100.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/js/ui.init.js b/3.1/themes/browny_admin_wind/js/ui.init.js deleted file mode 100644 index 4ed912f8..00000000 --- a/3.1/themes/browny_admin_wind/js/ui.init.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Initialize jQuery UI and Gallery Plugins - * @todo Move ui-corner-all assignments to theme admin views - */ - -$(document).ready(function(){ - - // Initialize Superfish menus - $("#g-site-admin-menu .g-menu").hide().addClass("sf-menu"); - $("#g-site-admin-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 modal dialogs - $(".g-dialog-link").gallery_dialog(); - - // Initialize short forms - $(".g-short-form").gallery_short_form(); - - // Initialize ajax links - $(".g-ajax-link").gallery_ajax(); - - // Initialize panels - $(".g-panel-link").gallery_panel(); - - if ($("#g-photo-stream").length) { - // Vertically align thumbs in photostream - $(".g-item").gallery_valign(); - } - - // Apply jQuery UI button css to submit inputs - $("input[type=submit]:not(.g-short-form input)").addClass("ui-state-default ui-corner-all"); - - // Round view menu buttons - if ($("#g-admin-comments-menu").length) { - $("#g-admin-comments-menu ul").removeClass("g-menu"); - $("#g-admin-comments-menu").addClass("g-buttonset"); - $("#g-admin-comments-menu a").addClass("g-button ui-state-default"); - $("#g-admin-comments-menu ul li:first a").addClass("ui-corner-left"); - $("#g-admin-comments-menu ul li:last a").addClass("ui-corner-right"); - } - - // Round corners - $(".g-selected").addClass("ui-corner-all"); - $(".g-available .g-block").addClass("ui-corner-all"); - $(".g-unavailable").addClass("ui-corner-all"); - - // Remove titles for menu options since we're displaying that text anyway - $(".sf-menu a, .sf-menu li").removeAttr("title"); - - // Initialize button hover effect - $.fn.gallery_hover_init(); -}); diff --git a/3.1/themes/browny_admin_wind/theme.info b/3.1/themes/browny_admin_wind/theme.info deleted file mode 100644 index aaab699a..00000000 --- a/3.1/themes/browny_admin_wind/theme.info +++ /dev/null @@ -1,10 +0,0 @@ -name = "Browny Wind" -description = "The default Wind Admin theme with a browny style." -version = 1 -author = "Ma'moun M. Diraneyya" -admin = 1 -site = 0 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Themes:browny_admin_wind" -discuss_url = "http://gallery.menalto.com/forum_theme_browny_admin_wind" diff --git a/3.1/themes/browny_admin_wind/thumbnail.png b/3.1/themes/browny_admin_wind/thumbnail.png deleted file mode 100644 index ebb0f2cc..00000000 Binary files a/3.1/themes/browny_admin_wind/thumbnail.png and /dev/null differ diff --git a/3.1/themes/browny_admin_wind/views/admin.html.php b/3.1/themes/browny_admin_wind/views/admin.html.php deleted file mode 100644 index c8041069..00000000 --- a/3.1/themes/browny_admin_wind/views/admin.html.php +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - <? if ($page_title): ?> - <?= t("Gallery Admin: %page_title", array("page_title" => $page_title)) ?> - <? else: ?> - <?= t("Admin dashboard") ?> - <? endif ?> - - " type="image/x-icon" /> - - css("yui/reset-fonts-grids.css") ?> - css("themeroller/ui.base.css") ?> - css("superfish/css/superfish.css") ?> - css("screen.css") ?> - - - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("ui.init.js") ?> - - admin_head() ?> - - - body_attributes() ?>> - admin_page_top() ?> - -
        - -
        - - site_status() ?> -
        - admin_header_top() ?> - - user_menu() ?> - - - - admin_header_bottom() ?> -
        -
        -
        -
        -
        - messages() ?> - -
        -
        -
        - -
        - -
        - -
        - -
        - admin_page_bottom() ?> - - diff --git a/3.1/themes/browny_admin_wind/views/block.html.php b/3.1/themes/browny_admin_wind/views/block.html.php deleted file mode 100644 index d1d2d088..00000000 --- a/3.1/themes/browny_admin_wind/views/block.html.php +++ /dev/null @@ -1,18 +0,0 @@ - - - - - diff --git a/3.1/themes/browny_admin_wind/views/pager.html.php b/3.1/themes/browny_admin_wind/views/pager.html.php deleted file mode 100644 index 5fff5845..00000000 --- a/3.1/themes/browny_admin_wind/views/pager.html.php +++ /dev/null @@ -1,44 +0,0 @@ - - -
          - $current_first_item, - "to_number" => $current_last_item, - "count" => $total_items)) ?> -
        • - - - - - - - - - - - - - - -
        • -
        • -
        • - - - - - - - - - - - - - - -
        • -
        diff --git a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_flat_0_aaaaaa_40x100.png b/3.1/themes/browny_wind/css/themeroller/images/ui-bg_flat_0_aaaaaa_40x100.png deleted file mode 100755 index 5b5dab2a..00000000 Binary files a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_flat_0_aaaaaa_40x100.png and /dev/null differ diff --git a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_flat_55_fbd388_40x100.png b/3.1/themes/browny_wind/css/themeroller/images/ui-bg_flat_55_fbd388_40x100.png deleted file mode 100755 index ab36af14..00000000 Binary files a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_flat_55_fbd388_40x100.png and /dev/null differ diff --git a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_glass_55_ead2ae_1x400.png b/3.1/themes/browny_wind/css/themeroller/images/ui-bg_glass_55_ead2ae_1x400.png deleted file mode 100755 index 2719d497..00000000 Binary files a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_glass_55_ead2ae_1x400.png and /dev/null differ diff --git a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_glass_75_f2e6d4_1x400.png b/3.1/themes/browny_wind/css/themeroller/images/ui-bg_glass_75_f2e6d4_1x400.png deleted file mode 100755 index 840cf86c..00000000 Binary files a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_glass_75_f2e6d4_1x400.png and /dev/null differ diff --git a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_glass_95_fef1ec_1x400.png b/3.1/themes/browny_wind/css/themeroller/images/ui-bg_glass_95_fef1ec_1x400.png deleted file mode 100755 index 4443fdc1..00000000 Binary files a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_glass_95_fef1ec_1x400.png and /dev/null differ diff --git a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_gloss-wave_55_714213_500x100.png b/3.1/themes/browny_wind/css/themeroller/images/ui-bg_gloss-wave_55_714213_500x100.png deleted file mode 100755 index 5c24f8c4..00000000 Binary files a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_gloss-wave_55_714213_500x100.png and /dev/null differ diff --git a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_inset-hard_100_ecd9c1_1x100.png b/3.1/themes/browny_wind/css/themeroller/images/ui-bg_inset-hard_100_ecd9c1_1x100.png deleted file mode 100755 index 600ad13a..00000000 Binary files a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_inset-hard_100_ecd9c1_1x100.png and /dev/null differ diff --git a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_inset-hard_100_f6f3ef_1x100.png b/3.1/themes/browny_wind/css/themeroller/images/ui-bg_inset-hard_100_f6f3ef_1x100.png deleted file mode 100755 index 203e259b..00000000 Binary files a/3.1/themes/browny_wind/css/themeroller/images/ui-bg_inset-hard_100_f6f3ef_1x100.png and /dev/null differ diff --git a/3.1/themes/browny_wind/css/themeroller/images/ui-icons_3d2105_256x240.png b/3.1/themes/browny_wind/css/themeroller/images/ui-icons_3d2105_256x240.png deleted file mode 100755 index e38c4188..00000000 Binary files a/3.1/themes/browny_wind/css/themeroller/images/ui-icons_3d2105_256x240.png and /dev/null differ diff --git a/3.1/themes/browny_wind/css/themeroller/images/ui-icons_41260c_256x240.png b/3.1/themes/browny_wind/css/themeroller/images/ui-icons_41260c_256x240.png deleted file mode 100755 index 46ea5bec..00000000 Binary files a/3.1/themes/browny_wind/css/themeroller/images/ui-icons_41260c_256x240.png and /dev/null differ diff --git a/3.1/themes/browny_wind/css/themeroller/images/ui-icons_563b1a_256x240.png b/3.1/themes/browny_wind/css/themeroller/images/ui-icons_563b1a_256x240.png deleted file mode 100755 index b39e12aa..00000000 Binary files a/3.1/themes/browny_wind/css/themeroller/images/ui-icons_563b1a_256x240.png and /dev/null differ diff --git a/3.1/themes/browny_wind/css/themeroller/images/ui-icons_704a24_256x240.png b/3.1/themes/browny_wind/css/themeroller/images/ui-icons_704a24_256x240.png deleted file mode 100755 index edf5228f..00000000 Binary files a/3.1/themes/browny_wind/css/themeroller/images/ui-icons_704a24_256x240.png and /dev/null differ diff --git a/3.1/themes/browny_wind/css/themeroller/images/ui-icons_be5f09_256x240.png b/3.1/themes/browny_wind/css/themeroller/images/ui-icons_be5f09_256x240.png deleted file mode 100755 index a5ca814b..00000000 Binary files a/3.1/themes/browny_wind/css/themeroller/images/ui-icons_be5f09_256x240.png and /dev/null differ diff --git a/3.1/themes/browny_wind/css/themeroller/images/ui-icons_cd0a0a_256x240.png b/3.1/themes/browny_wind/css/themeroller/images/ui-icons_cd0a0a_256x240.png deleted file mode 100755 index 7cdf7b2e..00000000 Binary files a/3.1/themes/browny_wind/css/themeroller/images/ui-icons_cd0a0a_256x240.png and /dev/null differ diff --git a/3.1/themes/browny_wind/css/themeroller/ui.base.css b/3.1/themes/browny_wind/css/themeroller/ui.base.css deleted file mode 100755 index 1a1810c8..00000000 --- a/3.1/themes/browny_wind/css/themeroller/ui.base.css +++ /dev/null @@ -1,7 +0,0 @@ -@import "ui.core.css"; -@import "ui.theme.css"; -@import "ui.datepicker.css"; -@import "ui.dialog.css"; -@import "ui.progressbar.css"; -@import "ui.resizable.css"; -@import "ui.tabs.css"; diff --git a/3.1/themes/browny_wind/css/themeroller/ui.core.css b/3.1/themes/browny_wind/css/themeroller/ui.core.css deleted file mode 100755 index c2f18f2c..00000000 --- a/3.1/themes/browny_wind/css/themeroller/ui.core.css +++ /dev/null @@ -1,37 +0,0 @@ -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } \ No newline at end of file diff --git a/3.1/themes/browny_wind/css/themeroller/ui.datepicker.css b/3.1/themes/browny_wind/css/themeroller/ui.datepicker.css deleted file mode 100755 index 567f8c97..00000000 --- a/3.1/themes/browny_wind/css/themeroller/ui.datepicker.css +++ /dev/null @@ -1,62 +0,0 @@ -/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -} \ No newline at end of file diff --git a/3.1/themes/browny_wind/css/themeroller/ui.dialog.css b/3.1/themes/browny_wind/css/themeroller/ui.dialog.css deleted file mode 100755 index 2997595b..00000000 --- a/3.1/themes/browny_wind/css/themeroller/ui.dialog.css +++ /dev/null @@ -1,13 +0,0 @@ -/* Dialog -----------------------------------*/ -.ui-dialog { position: relative; padding: .2em; width: 300px; } -.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } diff --git a/3.1/themes/browny_wind/css/themeroller/ui.progressbar.css b/3.1/themes/browny_wind/css/themeroller/ui.progressbar.css deleted file mode 100755 index bc0939ec..00000000 --- a/3.1/themes/browny_wind/css/themeroller/ui.progressbar.css +++ /dev/null @@ -1,4 +0,0 @@ -/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/3.1/themes/browny_wind/css/themeroller/ui.resizable.css b/3.1/themes/browny_wind/css/themeroller/ui.resizable.css deleted file mode 100755 index 44efeb2e..00000000 --- a/3.1/themes/browny_wind/css/themeroller/ui.resizable.css +++ /dev/null @@ -1,13 +0,0 @@ -/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} \ No newline at end of file diff --git a/3.1/themes/browny_wind/css/themeroller/ui.tabs.css b/3.1/themes/browny_wind/css/themeroller/ui.tabs.css deleted file mode 100755 index 3ca6b9a0..00000000 --- a/3.1/themes/browny_wind/css/themeroller/ui.tabs.css +++ /dev/null @@ -1,11 +0,0 @@ -/* Tabs -----------------------------------*/ -.ui-tabs { padding: .2em; zoom: 1; } -.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } -.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/3.1/themes/browny_wind/css/themeroller/ui.theme.css b/3.1/themes/browny_wind/css/themeroller/ui.theme.css deleted file mode 100755 index ff1d4be5..00000000 --- a/3.1/themes/browny_wind/css/themeroller/ui.theme.css +++ /dev/null @@ -1,247 +0,0 @@ - - - - -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Geeza%20Pro,%20Lucida%20Grande,%20Lucida%20Sans,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=714213&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=55&borderColorHeader=4e2e0e&fcHeader=ffffff&iconColorHeader=41260c&bgColorContent=f6f3ef&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=9e7247&fcContent=222222&iconColorContent=3d2105&bgColorDefault=f2e6d4&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=c2ad99&fcDefault=7f5429&iconColorDefault=704a24&bgColorHover=ead2ae&bgTextureHover=02_glass.png&bgImgOpacityHover=55&borderColorHover=ab8b6d&fcHover=7f5429&iconColorHover=704a24&bgColorActive=ecd9c1&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=100&borderColorActive=684f36&fcActive=734d21&iconColorActive=563b1a&bgColorHighlight=fbd388&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=f3af30&fcHighlight=363636&iconColorHighlight=be5f09&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #9e7247; background: #f6f3ef url(images/ui-bg_inset-hard_100_f6f3ef_1x100.png) 50% bottom repeat-x; color: #222222; } -.ui-widget-content a { color: #222222; } -.ui-widget-header { border: 1px solid #4e2e0e; background: #714213 url(images/ui-bg_gloss-wave_55_714213_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } -.ui-widget-header a { color: #ffffff; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #c2ad99; background: #f2e6d4 url(images/ui-bg_glass_75_f2e6d4_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #7f5429; outline: none; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #7f5429; text-decoration: none; outline: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #ab8b6d; background: #ead2ae url(images/ui-bg_glass_55_ead2ae_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #7f5429; outline: none; } -.ui-state-hover a, .ui-state-hover a:hover { color: #7f5429; text-decoration: none; outline: none; } -.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #684f36; background: #ecd9c1 url(images/ui-bg_inset-hard_100_ecd9c1_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #734d21; outline: none; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #734d21; outline: none; text-decoration: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #f3af30; background: #fbd388 url(images/ui-bg_flat_55_fbd388_40x100.png) 50% 50% repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } -.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_3d2105_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_3d2105_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_41260c_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_704a24_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_704a24_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_563b1a_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_be5f09_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; } -.ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; } -.ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; } -.ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; } -.ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; } -.ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; } -.ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; } - -/* Overlays */ -.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } -.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; } \ No newline at end of file diff --git a/3.1/themes/browny_wind/images/avatar.jpg b/3.1/themes/browny_wind/images/avatar.jpg deleted file mode 100644 index 9505092c..00000000 Binary files a/3.1/themes/browny_wind/images/avatar.jpg and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-album.png b/3.1/themes/browny_wind/images/ico-album.png deleted file mode 100644 index b1e5bfdf..00000000 Binary files a/3.1/themes/browny_wind/images/ico-album.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-error.png b/3.1/themes/browny_wind/images/ico-error.png deleted file mode 100644 index c37bd062..00000000 Binary files a/3.1/themes/browny_wind/images/ico-error.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-help.png b/3.1/themes/browny_wind/images/ico-help.png deleted file mode 100644 index 7dbd48cb..00000000 Binary files a/3.1/themes/browny_wind/images/ico-help.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-info.png b/3.1/themes/browny_wind/images/ico-info.png deleted file mode 100644 index 3e9e9e87..00000000 Binary files a/3.1/themes/browny_wind/images/ico-info.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-print.png b/3.1/themes/browny_wind/images/ico-print.png deleted file mode 100644 index db79758a..00000000 Binary files a/3.1/themes/browny_wind/images/ico-print.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-separator-rtl.gif b/3.1/themes/browny_wind/images/ico-separator-rtl.gif deleted file mode 100644 index d9061a46..00000000 Binary files a/3.1/themes/browny_wind/images/ico-separator-rtl.gif and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-separator.gif b/3.1/themes/browny_wind/images/ico-separator.gif deleted file mode 100644 index 3de2d0d3..00000000 Binary files a/3.1/themes/browny_wind/images/ico-separator.gif and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-success.png b/3.1/themes/browny_wind/images/ico-success.png deleted file mode 100644 index 6e0f6f54..00000000 Binary files a/3.1/themes/browny_wind/images/ico-success.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-view-calendarview.png b/3.1/themes/browny_wind/images/ico-view-calendarview.png deleted file mode 100644 index 9fbc80a9..00000000 Binary files a/3.1/themes/browny_wind/images/ico-view-calendarview.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-view-comments.png b/3.1/themes/browny_wind/images/ico-view-comments.png deleted file mode 100644 index acaf97d6..00000000 Binary files a/3.1/themes/browny_wind/images/ico-view-comments.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-view-downloadalbum.png b/3.1/themes/browny_wind/images/ico-view-downloadalbum.png deleted file mode 100644 index 1ea75b89..00000000 Binary files a/3.1/themes/browny_wind/images/ico-view-downloadalbum.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-view-downloadfullsize.png b/3.1/themes/browny_wind/images/ico-view-downloadfullsize.png deleted file mode 100644 index 1a840ac9..00000000 Binary files a/3.1/themes/browny_wind/images/ico-view-downloadfullsize.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-view-fullsize.png b/3.1/themes/browny_wind/images/ico-view-fullsize.png deleted file mode 100644 index 314eae1b..00000000 Binary files a/3.1/themes/browny_wind/images/ico-view-fullsize.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-view-slideshow-rtl.png b/3.1/themes/browny_wind/images/ico-view-slideshow-rtl.png deleted file mode 100644 index 2e3e9387..00000000 Binary files a/3.1/themes/browny_wind/images/ico-view-slideshow-rtl.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-view-slideshow.png b/3.1/themes/browny_wind/images/ico-view-slideshow.png deleted file mode 100644 index 6b0cf6f0..00000000 Binary files a/3.1/themes/browny_wind/images/ico-view-slideshow.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ico-warning.png b/3.1/themes/browny_wind/images/ico-warning.png deleted file mode 100644 index 628cf2da..00000000 Binary files a/3.1/themes/browny_wind/images/ico-warning.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/loading-small.gif b/3.1/themes/browny_wind/images/loading-small.gif deleted file mode 100644 index d0bce154..00000000 Binary files a/3.1/themes/browny_wind/images/loading-small.gif and /dev/null differ diff --git a/3.1/themes/browny_wind/images/logo.png b/3.1/themes/browny_wind/images/logo.png deleted file mode 100644 index b430321b..00000000 Binary files a/3.1/themes/browny_wind/images/logo.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ui-bg_highlight-soft_15_d3b07e_1x100.png b/3.1/themes/browny_wind/images/ui-bg_highlight-soft_15_d3b07e_1x100.png deleted file mode 100755 index 99a55f5f..00000000 Binary files a/3.1/themes/browny_wind/images/ui-bg_highlight-soft_15_d3b07e_1x100.png and /dev/null differ diff --git a/3.1/themes/browny_wind/images/ui-bg_highlight-soft_45_d3b07e_1x100.png b/3.1/themes/browny_wind/images/ui-bg_highlight-soft_45_d3b07e_1x100.png deleted file mode 100755 index 063dc802..00000000 Binary files a/3.1/themes/browny_wind/images/ui-bg_highlight-soft_45_d3b07e_1x100.png and /dev/null differ diff --git a/3.1/themes/browny_wind/theme.info b/3.1/themes/browny_wind/theme.info deleted file mode 100644 index 85a25c8f..00000000 --- a/3.1/themes/browny_wind/theme.info +++ /dev/null @@ -1,10 +0,0 @@ -name = "Browny Wind" -description = "The default Wind theme with a browny style." -version = 1 -author = "Ma'moun M. Diraneyya" -site = 1 -admin = 0 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Themes:browny_wind" -discuss_url = "http://gallery.menalto.com/forum_theme_browny_wind" diff --git a/3.1/themes/browny_wind/thumbnail.png b/3.1/themes/browny_wind/thumbnail.png deleted file mode 100644 index 4ad2069e..00000000 Binary files a/3.1/themes/browny_wind/thumbnail.png and /dev/null differ diff --git a/3.1/themes/browny_wind/views/album.html.php b/3.1/themes/browny_wind/views/album.html.php deleted file mode 100644 index 1a56af67..00000000 --- a/3.1/themes/browny_wind/views/album.html.php +++ /dev/null @@ -1,44 +0,0 @@ - - -
        - album_top() ?> -

        title) ?>

        -
        description)) ?>
        -
        - -
          - - $child): ?> - - is_album()): ?> - - -
        • - thumb_top($child) ?> - - has_thumb()): ?> - thumb_img(array("class" => "g-thumbnail")) ?> - - - thumb_bottom($child) ?> - context_menu($child, "#g-item-id-{$child->id} .g-thumbnail") ?> -

          - title) ?>

          - -
        • - - - admin || access::can("add", $item)): ?> - id") ?> -
        • Add some.", - array("attrs" => html::mark_clean("href=\"$addurl\" class=\"g-dialog-link\""))) ?>
        • - -
        • - - -
        -album_bottom() ?> - -paginator() ?> diff --git a/3.1/themes/browny_wind/views/block.html.php b/3.1/themes/browny_wind/views/block.html.php deleted file mode 100644 index 699d7c22..00000000 --- a/3.1/themes/browny_wind/views/block.html.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - -
        -

        -
        - -
        -
        diff --git a/3.1/themes/browny_wind/views/calpage.html.php b/3.1/themes/browny_wind/views/calpage.html.php deleted file mode 100644 index 9318b742..00000000 --- a/3.1/themes/browny_wind/views/calpage.html.php +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - <? 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 ?> - - " type="image/x-icon" /> - css("yui/reset-fonts-grids.css") ?> - css("superfish/css/superfish.css") ?> - css("themeroller/ui.base.css") ?> - css("gallery.common.css") ?> - css("screen.css") ?> - - page_type == "collection"): ?> - - - - - - - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("jquery.localscroll.js") ?> - script("ui.init.js") ?> - - head() they get combined */ ?> - page_subtype == "photo"): ?> - script("jquery.scrollTo.js") ?> - script("gallery.show_full_size.js") ?> - page_subtype == "movie"): ?> - script("flowplayer.js") ?> - - - head() ?> - - - body_attributes() ?>> - page_top() ?> -
        - site_status() ?> -
        -
        - - - - - - user_menu() ?> - header_top() ?> - - - - - - header_bottom() ?> -
        - - - -
          - - - > - - url) : ?> - title) ?> - - title) ?> - - - - -
        - - - -
        -
        -
        -
        -
        - messages() ?> - -
        -
        -
        -
        - page_subtype != "login"): ?> - - -
        -
        - -
        - page_bottom() ?> - - diff --git a/3.1/themes/browny_wind/views/dynamic.html.php b/3.1/themes/browny_wind/views/dynamic.html.php deleted file mode 100644 index a8a4d362..00000000 --- a/3.1/themes/browny_wind/views/dynamic.html.php +++ /dev/null @@ -1,29 +0,0 @@ - -
        -
        - dynamic_top() ?> -
        -

        -
        - -
          - $child): ?> -
        • "> - thumb_top($child) ?> - - photo - -

          title) ?>

          - thumb_bottom($child) ?> - -
        • - -
        -dynamic_bottom() ?> - -paginator() ?> diff --git a/3.1/themes/browny_wind/views/no_sidebar.html.php b/3.1/themes/browny_wind/views/no_sidebar.html.php deleted file mode 100644 index a9eb0e3e..00000000 --- a/3.1/themes/browny_wind/views/no_sidebar.html.php +++ /dev/null @@ -1,6 +0,0 @@ - -
          -
        • -
          "> -
        • -
        diff --git a/3.1/themes/browny_wind/views/page.html.php b/3.1/themes/browny_wind/views/page.html.php deleted file mode 100644 index 5e4040bd..00000000 --- a/3.1/themes/browny_wind/views/page.html.php +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - <? 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 ?> - - " type="image/x-icon" /> - css("yui/reset-fonts-grids.css") ?> - css("superfish/css/superfish.css") ?> - css("themeroller/ui.base.css") ?> - css("screen.css") ?> - - page_type == "collection"): ?> - - - - - - - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("jquery.localscroll.js") ?> - script("ui.init.js") ?> - - head() they get combined */ ?> - page_subtype == "photo"): ?> - script("jquery.scrollTo.js") ?> - script("gallery.show_full_size.js") ?> - page_subtype == "movie"): ?> - script("flowplayer.js") ?> - - - head() ?> - - - body_attributes() ?>> - page_top() ?> -
        - site_status() ?> -
        -
        - - - - - - user_menu() ?> - header_top() ?> - - - - - - header_bottom() ?> -
        - - item() && !empty($parents)): ?> - - -
        -
        -
        -
        -
        - messages() ?> - -
        -
        -
        -
        - page_subtype != "login"): ?> - - -
        -
        - -
        - page_bottom() ?> - - diff --git a/3.1/themes/browny_wind/views/paginator.html.php b/3.1/themes/browny_wind/views/paginator.html.php deleted file mode 100644 index 1f3017ad..00000000 --- a/3.1/themes/browny_wind/views/paginator.html.php +++ /dev/null @@ -1,124 +0,0 @@ - - - -parent(); - endif; - $current_page = $position; - $total_pages = $total; - $siblings = $item->parent()->children(); - for ($i = 1; $i <= $total; $i++): - $_pagelist[$i] = $siblings[$i-1]->url(); - endfor; - } - endif; -?> - -
          -
        • - - - - - - - - - - - - 1): ?> - - - - - - - - - - - - - - - -
        • - -
        • - - - $first_visible_position, - "to_number" => $last_visible_position, - "count" => $total)) ?> - - $position, "total" => $total)) ?> - - - - -
        • - -
        • - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        • -
        diff --git a/3.1/themes/browny_wind/views/sidebar.html.php b/3.1/themes/browny_wind/views/sidebar.html.php deleted file mode 100644 index 086d1359..00000000 --- a/3.1/themes/browny_wind/views/sidebar.html.php +++ /dev/null @@ -1,16 +0,0 @@ - -sidebar_top() ?> -
        - - album_menu() ?> - - photo_menu() ?> - - movie_menu() ?> - - tag_menu() ?> - -
        - -sidebar_blocks() ?> -sidebar_bottom() ?> diff --git a/3.1/themes/browny_wind/views/user_profile.html.php b/3.1/themes/browny_wind/views/user_profile.html.php deleted file mode 100644 index 162ff291..00000000 --- a/3.1/themes/browny_wind/views/user_profile.html.php +++ /dev/null @@ -1,47 +0,0 @@ - - -
        - -

        - " - alt="display_name()) ?>" - class="g-avatar g-left" width="90" height="90" /> - $user->display_name())) ?> -

        - -
        -

        title) ?>

        -
        - view ?> -
        -
        - -
        diff --git a/3.1/themes/browny_wind/views/user_profile_comments.html.php b/3.1/themes/browny_wind/views/user_profile_comments.html.php deleted file mode 100644 index 9d3df0d9..00000000 --- a/3.1/themes/browny_wind/views/user_profile_comments.html.php +++ /dev/null @@ -1,21 +0,0 @@ - -
        -
          - -
        • -

          - - item()->thumb_img(array(), 70) ?> - - on %date for %title ", - array("date" => gallery::date_time($comment->created), - "title" => $comment->item()->title)); ?> -

          -
          -
          - text)) ?> -
          -
        • - -
        -
        diff --git a/3.1/themes/sobriety/css/screen.css b/3.1/themes/sobriety/css/screen.css deleted file mode 100644 index ea8bfaf0..00000000 --- a/3.1/themes/sobriety/css/screen.css +++ /dev/null @@ -1,940 +0,0 @@ -/* Common ------------------------------------------------ */ -a, a:visited { - - color: #258; - text-decoration: none; - - border-bottom: 1px dotted #469; -} - -a:hover, a:active { - color: #933; - - border-color: #b55; - border-bottom-style: solid; -} - -h1 { - padding: 0 0 .5em; - - font-size: 1.7em; - font-weight: normal; - color: #543; - - border-bottom: 1px solid #ddd; -} - - - -/* Page structure ------------------------------------------------ */ - -body { - margin: 0; - - font-family: "Gill Sans", "Trebuchet MS", Verdana, sans-serif; - font-size: small; - color: #333; - - background-color: #ccb; - background-image: url("../images/backgrounds/body-bg.jpg"); - background-repeat: repeat-x; - background-position: top; -} - - -/* ~~~~~ Header ~~~~~ */ - -div#g-header { - padding: 0.5em 0; - height: 1.5em; - - line-height: 1.5em; - - background-color: #000; - background-image: url("../images/backgrounds/body-breadcrumbs-bg.gif"); - background-repeat: repeat; - background-position: top; - - border-bottom: 3px solid #bba; -} - -div#g-banner { - display: none; -} - -ul.g-breadcrumbs { - margin: 0; - padding: 0; - - color: #777; - text-align: center; -} - -ul.g-breadcrumbs > li { - display: inline; - padding-left: 0.3em; -} - -ul.g-breadcrumbs > li:after { - content: "»"; -} - -ul.g-breadcrumbs > li.g-active:after { - content: ""; -} - -ul.g-breadcrumbs > li > a { - margin-right: 0.3em; - - color: #888; - - border-color: #777; -} - - -/* ~~~~~ Content ~~~~~ */ - -div#bd { - padding: 15px; -} - - -/* ~~~~~ Footer ~~~~~ */ -/* TODO */ -#g-footer { - clear: both; - margin: 0 15px; - border-top: 1px solid #ddc; - color: #887; - padding: .5em 0 2em 0; - text-align: center; -} - -#g-footer #g-credits { - list-style: none; - display: inline; - margin: 0 auto; - padding: 0; -} - -#g-footer #g-credits li { - display: inline; -} - - - - - - -/* Albums & Items ------------------------------------------------ */ - - -.g-item, -#g-item .g-paginator li.g-first, -#g-item .g-paginator li.g-text-right { - display: block; - position: relative; - text-align: center; - - background: #fff url("../images/backgrounds/thumb.png") no-repeat; - - border-radius: 5px; - box-shadow: 3px 3px 0px #b7b7a7; - -webkit-border-radius: 5px; - -webkit-box-shadow: 3px 3px 0px #b7b7a7; - -moz-border-radius: 5px; - -moz-box-shadow: 3px 3px 0px #b7b7a7; -} - - - -.g-item > a, -#g-item .g-paginator li.g-first a, -#g-item .g-paginator li.g-text-right a { - display: block; - width: 100%; - height: 100%; - text-decoration: none; - background-position: center; - background-repeat: no-repeat; - border: 0; - vertical-align: middle; -} - -.g-item > a { - display: table-cell; -} - -#g-item .g-paginator li.g-first a, -#g-item .g-paginator li.g-text-right a { - border-bottom: none; - text-indent: -9999em; - font-size: 1px; - color: #fff; -} - -.g-item > h2 { - position: absolute; - left: 15px; - bottom: 8px; - margin: 0; - padding-top: 8px; - - background: #fff; - text-align: center; - color:#333; - line-height: 10px; - - font-size: 10px; - font-weight: normal; - text-transform: uppercase; - letter-spacing: .1em; -} - -.g-item > h2 a { - border: 0; -} - -#g-item .g-paginator li.g-text-right { - position: absolute; - top: 0px; -} - - - - -/* ~~~~~ Album ~~~~~ */ -.g-item { - float:left; - margin:0 10px 10px 0; -} - -.g-item.g-album > a { - background-image: url("../images/emblems/g-item_g-album.png"); - background-repeat: no-repeat; -} - - - - - -#g-content > #g-info { - clear:left; - float:left; - width:22%; - margin:0; - line-height:1.4em; -} -#g-content > #g-info h1 { - margin:0 0 .5em; - text-align:left; - text-transform:none; - letter-spacing:0; - } -#g-content > #g-info .g-description { - line-height:1.6em; - margin-bottom:1em; - } - - -#g-content > #g-album-grid { - float:right; - position:relative; - width:75%; - margin:0 0 15px; - padding:0; - list-style:none; - line-height:1.4em; - } -#g-content > #g-album-grid li.g-item { - } - -/*.g-item .g-context-menu,*/ -.g-item .g-metadata -{ - display: none; -} - - -.g-item > ul.g-context-menu { - list-style-type: none; - - display: none; - position: absolute; - top: 0px; - left: 0px; - - font-size: 12px; - - width: 32px; - height: 32px; - padding: 2px; - margin: 0; -} - -.g-item:hover > ul.g-context-menu { - display: block; -} - -.g-item:hover > ul.g-context-menu > li { - - display: block; - width: 32px; - height: 32px; - background: url('../images/emblems/g-context-menu.png') no-repeat; -} - -.g-item:hover > ul.g-context-menu > li:hover { - background: none; -} - -.g-item:hover > ul.g-context-menu > li > a { - display: none; -} - -.g-item:hover > ul.g-context-menu > li > ul { - list-style-type: none; - background: url('../images/backgrounds/000000_opacity50.png') 0 0 repeat; - padding: 5px 2px ; - display: none; - position: absolute; - top: 0; - left: 0; - width: 230px; - text-align: left; - -moz-border-radius-topleft: 5px; - -moz-border-radius-topright: 5px; - -webkit-border-top-left-radius: 5px; - -webkit-border-top-right-radius: 5px; - z-index: 2; -} - -.g-item:hover > ul.g-context-menu > li:hover > ul { - display: block; -} -.g-item:hover > ul.g-context-menu > li:hover > ul > li { - line-height: 16px; - padding: 0px 0 0px 20px; -} -.g-item:hover > ul.g-context-menu > li:hover > ul > li > a { - color: #fff; - text-decoration: none; - border: none; - display: block; - padding: 4px 0; -} - -.g-item:hover > ul.g-context-menu > li:hover > ul > li > a > span { - height: 16px; - width: 16px; - display: block; - position: absolute; - left: 2px; - background-image: url("../images/icons/ui-icons_d8e7f3_256x240.png"); -} -.g-item:hover > ul.g-context-menu > li:hover > ul > li:hover > a { - color: #f9bd01; -} -.g-item:hover > ul.g-context-menu > li:hover > ul > li:hover > a > span { - background-image: url("../images/icons/ui-icons_f9bd01_256x240.png"); -} - -span.ui-icon-pencil { background-position: -64px -112px; } -span.ui-icon-folder-open { background-position: -16px -96px; } -span.ui-icon-star { background-position: -224px -112px; } -span.ui-icon-trash { background-position: -176px -96px; } -span.ui-icon-rotate-ccw { background-position: -192px -64px; } -span.ui-icon-rotate-cw { background-position: -208px -64px; } -span.ui-icon-plus { background-position: -16px -128px; } -span.ui-icon-note { background-position: -64px -96px; } -span.ui-icon-key { background-position: -112px -128px; } - - - - - - - -#g-content > .g-paginator { - clear:left; - float:left; - width:22%; - position: relative; - padding: 2em 0 0 0; - margin: 0; -} - -#g-content > .g-paginator li { - padding: 0; - margin: 0; - list-style: none; -} - -#g-content > .g-paginator .g-info { - position: absolute; - top: 0; - width: 100%; - background:#bba; - text-align: center; - padding:2px 0; - margin:0 0 .5em; -} - -#g-content > .g-paginator .g-first, -#g-content > .g-paginator .g-text-right { - width: 45%; - float: left; -} -#g-content > .g-paginator .g-text-right { - float: right; - text-align: right; -} - -#g-content > .g-paginator .g-first a + a:before { - content: "« "; -} - -#g-content > .g-paginator .g-text-right a:first-child:after { - content: " »"; -} - -#g-content > .g-paginator .g-first a:first-child, -#g-content > .g-paginator .g-text-right a + a, -#g-content > .g-paginator .ui-state-disabled { - display: none; -} - -#g-sidebar { - clear:left; - float:left; - width:22%; -} - -#g-sidebar .g-block { - margin-top: 1em; -} - -#g-sidebar .g-block h2 { - width: 100%; - background:#bba; - text-align: center; - padding:2px 0; - margin:0 0 .5em; - font-size: 1em; - font-weight: normal; -} - - -/* ~~~~~ Item ~~~~~ */ - -#g-item { - position: relative; -} - -#g-item #g-photo, -#g-item #g-movie { - text-align: center; - display: inline; - position: relative; - left: 50%; - background: #b7b7a7; -} - -#g-item #g-movie { - display: block; -} - -#g-item #g-photo a { - border: none; -} - -#g-item #g-photo a img { - border: 10px solid #fff; - -webkit-box-shadow: 3px 3px 0px #b7b7a7; - -moz-box-shadow: 3px 3px 0px #b7b7a7; -} - -#g-item .g-paginator { - position: absolute; - left: 50%; - width: 0px; - height: 0px; - - list-style: none; - padding: 0; - margin: 0; -} - -#g-item .g-paginator li { - padding: 0; - margin: 0; - display: inline; -} - -#g-item .g-paginator li.g-info { - display: block; - position: absolute; - right: 340px; /* 640/2 + 10 + 10 */ - top: 230px; - width: 230px; - height: 30px; - padding-top: 10px; - margin-top: 30px; - text-align: right; - font-style: italic; - background-image: url("../images/divider_l.png"); - background-position: right top; - background-repeat: no-repeat; -} - -#g-item .g-paginator li.g-first a:hover span, -#g-item .g-paginator li.g-text-right a:hover span { - display: block; - position: relative; - height: 22px; - top: 10px; - background-position: center; - background-repeat: no-repeat; - z-index: 2; -} -#g-item .g-paginator li.g-first a:hover span { - background-image: url("../images/photonav_prev.png"); -} - -#g-item .g-paginator li.g-text-right a:hover span { - background-image: url("../images/photonav_next.png"); -} - -#g-item .g-context-menu { - display: none; -} - -#g-item #g-info { - width: 230px; - position: absolute; - top: 260px; /* (230 + 30) */ - left: 50%; - margin-left: 340px; /* (640/2 + 10 + 10) */ -} - -#g-item #g-info h1 { - text-align: left; - font-size: 1em; - border: none; - padding-top: 10px; - background-image: url("../images/divider_r.png"); - background-position: left top; - background-repeat: no-repeat; -} - -#g-item .g-block { - display: none; -} - -#g-item .g-block#g-metadata { - text-align: right; - display: block; - width: 300px; /* 230px is not enought: french is verbose */ - position: absolute; - right: 50%; - margin-right: 340px; /* (640/2 + 10 + 10) */ - top: 300px; /* (230 + 30 + 10 + 30) */ -} - -#g-item .g-block#g-metadata h2 { - font-size: 1em; - padding-top: 10px; - text-align: right; - font-style: italic; - background-image: url("../images/divider_l.png"); - background-position: right top; - background-repeat: no-repeat; -} - -#g-item .g-block#g-metadata ul { - list-style: none; - padding: 0; -} - -#g-item .g-block#g-comments { - display: block; -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#g-login-menu { - position: absolute; - right: 0; - padding: 0; - margin: 0; -} -#g-login-menu li { - display: inline; -} -#g-login-menu li:first-child { - /*display: none;*/ -} -#g-logo, #g-quick-search-form, #g-site-menu { - display: none; -} - - - - - - - - - -/* Status and validation messages ~~~~ */ - -.g-message-block { - background-position: .4em .3em; - border: 1px solid #ccc; - padding: 0; -} - -#g-action-status { - width: 75%; - float: right; - margin-bottom: 1em; -} - -#g-action-status li, -p#g-action-status, -div#g-action-status { - padding: .3em .3em .3em 30px; -} - -#g-site-status li { - border-bottom: 1px solid #ccc; - padding: .3em .3em .3em 30px; -} - -.g-module-status { - clear: both; - margin-bottom: 1em; -} - -.g-message { - background-position: 0 50%; -} - -.g-warning { - background: #fcf9ce url('../images/icons/ico-warning.png') no-repeat .4em 50%; -} - - - - - -/* ~~~~~ Dialog ~~~~~ */ - -.ui-widget-overlay { - background: #000; - opacity: .8; - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; -} - -.ui-dialog { - background: url("../images/backgrounds/f0f0f0_opacity80.png"); - position: fixed !important; - padding: 0; -} - -.ui-dialog-titlebar { - display: none; -} - -#g-dialog { - padding: 0 2em 0 15px; - margin: 0; -} - -#g-dialog form, #g-dialog div#g-edit-permissions-form { - padding: 0 0 0 63px; /* 48 + 15 */ - margin: 0; - background-repeat: no-repeat; - background-position: 0px 3em; -} -#g-dialog form#g-add-album-form { - background-image: url("../images/icons/g-add-album-form.png"); -} -#g-dialog form#g-edit-album-form { - background-image: url("../images/icons/g-edit-album-form.png"); -} -#g-dialog form#g-add-photos-form { - background-image: url("../images/icons/g-add-photos-form.png"); -} -#g-dialog form#g-confirm-delete { - background-image: url("../images/icons/g-confirm-delete.png"); -} -#g-dialog div#g-edit-permissions-form { - background-image: url("../images/icons/g-edit-permissions-form.png"); -} - - -#g-dialog form fieldset, -#g-dialog div#g-edit-permissions-form fieldset { - border: none; - padding: 0; - margin: 0; -} - -#g-dialog form fieldset legend, -#g-dialog div#g-edit-permissions-form fieldset legend { - font-size: 1em; - font-weight: bold; - /*text-align: center;*/ - display: block; - padding: 1em 0 1em 0; - /*margin: auto;*/ -} - - -#g-dialog form fieldset ul, -#g-dialog div#g-edit-permissions-form fieldset ul { - list-style: none; - margin: 0; - padding: 0; -} - -#g-dialog form fieldset ul li, -#g-dialog div#g-edit-permissions-form fieldset ul li { - padding-bottom: 0.8em; -} - -/*#g-dialog form fieldset ul li label { - padding-bottom: 0.5em; -}*/ - -#g-dialog input.textbox, -#g-dialog input[type=text], -#g-dialog input[type=password], -#g-dialog textarea { - /*border: 1px solid #000;*/ - width: 100%; - padding: 0; - margin: 0; -} - -#g-dialog textarea { - height: 8em; -} - -#g-add-photos-canvas-sd { - height: 33px; - /*margin-right: 63px;*/ - position: relative; -} - -#g-add-photos-button-sd { - z-index: 1; - display: block; - position: relative; - width: 150px; - height: 20px; - top: 6px; - padding: 0; - margin: auto; -} - -#g-add-photos-canvas-sd object { - margin: 0; - z-index: 100; - position: relative; - display: block; - margin: auto; - top: -20px; - /*top: 0; - left: 50%; - padding-right: 75px;*/ - /*position: relative;display: none;*/ -} - -.uploadifyQueue { - display: none; -} - -#g-add-photos-progress { - margin-top: 1em; -} - -#g-add-photos-progress li { - padding: 0; -} - -#g-add-photos-progress-text { - font-size: 1.2em; -} - -#g-add-photos-progressbar-frame { - width: 100%; - padding: 0 !important; - border: 1px solid #aaa; -} - -#g-add-photos-progressbar { - display: block; - height: 22px; - width: 0%; - background-image: url("../images/backgrounds/pbar-ani.gif"); - background-repeat: x-repeat; -} -#g-add-photos-progressbar.stop { - background-image: url("../images/backgrounds/pbar-ani-stop.gif"); -} - -#g-dialog div#g-edit-permissions-form table { - width: 100%; - border: none; - padding: 0; - margin: 0; - border-spacing: 0px; - border-collapse: collapse; -} -#g-dialog div#g-edit-permissions-form table a { - border: none; -} -#g-dialog div#g-edit-permissions-form tbody tr { - border-bottom: 1px solid #aaa; -} -#g-dialog div#g-edit-permissions-form thead th { - font-weight: normal; -} -#g-dialog div#g-edit-permissions-form tbody th { - text-align: left; -} -#g-dialog div#g-edit-permissions-form td { - width: 65px; -} - -/*#g-dialog input[type=submit].submit { - float: right; -} -#g-dialog a.g-cancel { - float: left; - clear: left; -}*/ - -/* Forms in dialogs and panels ~~~~~~~~~ */ - -/*#g-dialog ul li { - padding-bottom: .8em; -} - - - -input[readonly] { - background-color: #F4F4FC; -} - -#g-dialog input.textbox, -#g-dialog input[type=text], -#g-dialog input[type=password], -#g-dialog textarea { - width: 97%; -}*/ - -/* Short forms ~~~~~~~~~~~~~~~~~~~~~~~ */ - -/*.g-short-form legend, -.g-short-form label { - display: none; -} - -.g-short-form fieldset { - border: none; - padding: 0; -} - -.g-short-form li { - float: left; - margin: 0 !important; - padding: .4em 0; -} - -.g-short-form .textbox, -.g-short-form input[type=text] { - color: #666; - padding: .3em .6em; - width: 100%; -} - -.g-short-form .textbox.g-error { - border: 1px solid #f00; - color: #f00; - padding-left: 24px; -} - -.g-short-form .g-cancel { - display: block; - margin: .3em .8em; -} - -#g-sidebar .g-short-form li { - padding-left: 0; - padding-right: 0; -}*/ - -/* Dialogs and panels ~~~~~~~~~~~~~~~~~~ */ - -/*#g-dialog { - text-align: left; -} - - - -#g-dialog .g-cancel { - margin: .4em 1em; -} - -#g-panel { - display: none; - padding: 1em; -}*/ - -/* Inline layout ~~~~~~~~~~ */ - -/*.g-inline li { - float: left; - margin-left: 1.8em; - padding-left: 0 !important; -} - -.g-inline li.g-first { - margin-left: 0; -}*/ - diff --git a/3.1/themes/sobriety/images/backgrounds/000000_opacity50.png b/3.1/themes/sobriety/images/backgrounds/000000_opacity50.png deleted file mode 100644 index a2321f11..00000000 Binary files a/3.1/themes/sobriety/images/backgrounds/000000_opacity50.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/backgrounds/ajax_progress2.gif b/3.1/themes/sobriety/images/backgrounds/ajax_progress2.gif deleted file mode 100644 index 658f0a0b..00000000 Binary files a/3.1/themes/sobriety/images/backgrounds/ajax_progress2.gif and /dev/null differ diff --git a/3.1/themes/sobriety/images/backgrounds/body-bg.jpg b/3.1/themes/sobriety/images/backgrounds/body-bg.jpg deleted file mode 100644 index 36273d69..00000000 Binary files a/3.1/themes/sobriety/images/backgrounds/body-bg.jpg and /dev/null differ diff --git a/3.1/themes/sobriety/images/backgrounds/body-breadcrumbs-bg.gif b/3.1/themes/sobriety/images/backgrounds/body-breadcrumbs-bg.gif deleted file mode 100644 index f923d9aa..00000000 Binary files a/3.1/themes/sobriety/images/backgrounds/body-breadcrumbs-bg.gif and /dev/null differ diff --git a/3.1/themes/sobriety/images/backgrounds/f0f0f0_opacity80.png b/3.1/themes/sobriety/images/backgrounds/f0f0f0_opacity80.png deleted file mode 100644 index 3944a9f6..00000000 Binary files a/3.1/themes/sobriety/images/backgrounds/f0f0f0_opacity80.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/backgrounds/pbar-ani-stop.gif b/3.1/themes/sobriety/images/backgrounds/pbar-ani-stop.gif deleted file mode 100644 index f083c4da..00000000 Binary files a/3.1/themes/sobriety/images/backgrounds/pbar-ani-stop.gif and /dev/null differ diff --git a/3.1/themes/sobriety/images/backgrounds/pbar-ani.gif b/3.1/themes/sobriety/images/backgrounds/pbar-ani.gif deleted file mode 100644 index 0dfd45b8..00000000 Binary files a/3.1/themes/sobriety/images/backgrounds/pbar-ani.gif and /dev/null differ diff --git a/3.1/themes/sobriety/images/backgrounds/progressbar.png b/3.1/themes/sobriety/images/backgrounds/progressbar.png deleted file mode 100644 index e23fe76d..00000000 Binary files a/3.1/themes/sobriety/images/backgrounds/progressbar.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/backgrounds/progressbar.tiff b/3.1/themes/sobriety/images/backgrounds/progressbar.tiff deleted file mode 100644 index 5d12cab3..00000000 Binary files a/3.1/themes/sobriety/images/backgrounds/progressbar.tiff and /dev/null differ diff --git a/3.1/themes/sobriety/images/backgrounds/thumb.png b/3.1/themes/sobriety/images/backgrounds/thumb.png deleted file mode 100644 index b44ed363..00000000 Binary files a/3.1/themes/sobriety/images/backgrounds/thumb.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/bullet_white.gif b/3.1/themes/sobriety/images/bullet_white.gif deleted file mode 100644 index d7545b2c..00000000 Binary files a/3.1/themes/sobriety/images/bullet_white.gif and /dev/null differ diff --git a/3.1/themes/sobriety/images/divider_l.png b/3.1/themes/sobriety/images/divider_l.png deleted file mode 100644 index 0c8de096..00000000 Binary files a/3.1/themes/sobriety/images/divider_l.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/divider_r.png b/3.1/themes/sobriety/images/divider_r.png deleted file mode 100644 index 813fe176..00000000 Binary files a/3.1/themes/sobriety/images/divider_r.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/emblems/g-context-menu.png b/3.1/themes/sobriety/images/emblems/g-context-menu.png deleted file mode 100644 index fe593fbb..00000000 Binary files a/3.1/themes/sobriety/images/emblems/g-context-menu.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/emblems/g-item_g-album.png b/3.1/themes/sobriety/images/emblems/g-item_g-album.png deleted file mode 100644 index 89a38508..00000000 Binary files a/3.1/themes/sobriety/images/emblems/g-item_g-album.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/icon_pushpin.gif b/3.1/themes/sobriety/images/icon_pushpin.gif deleted file mode 100644 index b9e8461e..00000000 Binary files a/3.1/themes/sobriety/images/icon_pushpin.gif and /dev/null differ diff --git a/3.1/themes/sobriety/images/icons/g-add-album-form.png b/3.1/themes/sobriety/images/icons/g-add-album-form.png deleted file mode 100644 index ddaf8234..00000000 Binary files a/3.1/themes/sobriety/images/icons/g-add-album-form.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/icons/g-add-photos-form.png b/3.1/themes/sobriety/images/icons/g-add-photos-form.png deleted file mode 100644 index 4fe3fc3d..00000000 Binary files a/3.1/themes/sobriety/images/icons/g-add-photos-form.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/icons/g-confirm-delete.png b/3.1/themes/sobriety/images/icons/g-confirm-delete.png deleted file mode 100644 index 95a8ea7e..00000000 Binary files a/3.1/themes/sobriety/images/icons/g-confirm-delete.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/icons/g-edit-album-form.png b/3.1/themes/sobriety/images/icons/g-edit-album-form.png deleted file mode 100644 index 73ee06c4..00000000 Binary files a/3.1/themes/sobriety/images/icons/g-edit-album-form.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/icons/g-edit-permissions-form.png b/3.1/themes/sobriety/images/icons/g-edit-permissions-form.png deleted file mode 100644 index 7579bdd4..00000000 Binary files a/3.1/themes/sobriety/images/icons/g-edit-permissions-form.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/icons/g-edit-permissions-form_.png b/3.1/themes/sobriety/images/icons/g-edit-permissions-form_.png deleted file mode 100644 index e37343f5..00000000 Binary files a/3.1/themes/sobriety/images/icons/g-edit-permissions-form_.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/icons/ico-warning.png b/3.1/themes/sobriety/images/icons/ico-warning.png deleted file mode 100644 index 628cf2da..00000000 Binary files a/3.1/themes/sobriety/images/icons/ico-warning.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/icons/ui-icons_d8e7f3_256x240.png b/3.1/themes/sobriety/images/icons/ui-icons_d8e7f3_256x240.png deleted file mode 100644 index 9ea51421..00000000 Binary files a/3.1/themes/sobriety/images/icons/ui-icons_d8e7f3_256x240.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/icons/ui-icons_f9bd01_256x240.png b/3.1/themes/sobriety/images/icons/ui-icons_f9bd01_256x240.png deleted file mode 100644 index c41adbb2..00000000 Binary files a/3.1/themes/sobriety/images/icons/ui-icons_f9bd01_256x240.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/moreslide_next.gif b/3.1/themes/sobriety/images/moreslide_next.gif deleted file mode 100644 index 987a638e..00000000 Binary files a/3.1/themes/sobriety/images/moreslide_next.gif and /dev/null differ diff --git a/3.1/themes/sobriety/images/moreslide_prev.gif b/3.1/themes/sobriety/images/moreslide_prev.gif deleted file mode 100644 index 93c2e11f..00000000 Binary files a/3.1/themes/sobriety/images/moreslide_prev.gif and /dev/null differ diff --git a/3.1/themes/sobriety/images/photonav_next.png b/3.1/themes/sobriety/images/photonav_next.png deleted file mode 100644 index d0986f5e..00000000 Binary files a/3.1/themes/sobriety/images/photonav_next.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/photonav_prev.png b/3.1/themes/sobriety/images/photonav_prev.png deleted file mode 100644 index d5773739..00000000 Binary files a/3.1/themes/sobriety/images/photonav_prev.png and /dev/null differ diff --git a/3.1/themes/sobriety/images/slide_minis.gif b/3.1/themes/sobriety/images/slide_minis.gif deleted file mode 100644 index 2f31ed93..00000000 Binary files a/3.1/themes/sobriety/images/slide_minis.gif and /dev/null differ diff --git a/3.1/themes/sobriety/js/sobriety.ui.init.js b/3.1/themes/sobriety/js/sobriety.ui.init.js deleted file mode 100644 index 4e97611f..00000000 --- a/3.1/themes/sobriety/js/sobriety.ui.init.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Initialize jQuery UI and Gallery Plugin elements - */ - -$(document).ready(function() { - $.ui.gallery_dialog.defaults.position = "top"; - //$.ui.gallery_dialog.defaults.show = "slide"; - $.ui.dialog.defaults.draggable = false; -}); diff --git a/3.1/themes/sobriety/js/ui.init.js b/3.1/themes/sobriety/js/ui.init.js deleted file mode 100644 index 4393a04a..00000000 --- a/3.1/themes/sobriety/js/ui.init.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * 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(""); - $(".g-context-menu a span").each(function() { - var iconClass = $(this).parent().attr("class").match(/ui-icon-.[^\s]+/).toString(); - $(this).addClass(iconClass); - }); - } - - // Remove titles for menu options since we're displaying that text anyway - $(".sf-menu a, .sf-menu li").removeAttr("title"); - - // Album and search results views - /*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(); - if ($(this).next().height() > $(this).height()) { - $(this).height($(this).next().height()); - } else if ($(this).prev().height() > $(this).height()) { - $(this).height($(this).prev().height()); - } else { - $(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 - $("#g-photo,#g-movie").hover(function(){ - $(this).gallery_context_menu(); - }); - - // Add scroll effect for links to named anchors - /*$.localScroll({ - queue: true, - duration: 1000, - hash: true - });*/ - - $(this).find(".g-dialog-link").gallery_dialog(); - $(this).find(".g-ajax-link").gallery_ajax(); - } - - // Initialize button hover effect - $.fn.gallery_hover_init(); - -}); diff --git a/3.1/themes/sobriety/theme.info b/3.1/themes/sobriety/theme.info deleted file mode 100644 index 452fc2f5..00000000 --- a/3.1/themes/sobriety/theme.info +++ /dev/null @@ -1,12 +0,0 @@ -name = "Sobriety" -description = "A clean and sober theme from http://stopdesign.com/templates/photos/, by Douglas Bowman." -version = 1 -author = "Romain LE DISEZ" -site = 1 -admin = 0 -;wind commit = 3b05db2685d92ca538d7993c960b06ea32f3a8df -;wind date = Wed Jun 23 11:16:56 2010 -0700 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Themes:sobriety" -discuss_url = "http://gallery.menalto.com/forum_theme_sobriety" diff --git a/3.1/themes/sobriety/thumbnail.png b/3.1/themes/sobriety/thumbnail.png deleted file mode 100644 index 343c3f2d..00000000 Binary files a/3.1/themes/sobriety/thumbnail.png and /dev/null differ diff --git a/3.1/themes/sobriety/views/album.html.php b/3.1/themes/sobriety/views/album.html.php deleted file mode 100644 index b9072e2b..00000000 --- a/3.1/themes/sobriety/views/album.html.php +++ /dev/null @@ -1,42 +0,0 @@ - - -
        - album_top() ?> -

        title) ?>

        -
        description)) ?>
        -
        - -
          - - $child): ?> - - is_album()): ?> - - -
        • - thumb_top($child) ?> - - thumb_img(array("class" => "g-thumbnail")) ?> - - thumb_bottom($child) ?> - context_menu($child, "#g-item-id-{$child->id} .g-thumbnail") ?> -

          - title) ?>

          - -
        • - - - admin || access::can("add", $item)): ?> - id") ?> -
        • Add some.", - array("attrs" => html::mark_clean("href=\"$addurl\" class=\"g-dialog-link\""))) ?>
        • - -
        • - - -
        -album_bottom() ?> - -paginator() ?> diff --git a/3.1/themes/sobriety/views/block.html.php b/3.1/themes/sobriety/views/block.html.php deleted file mode 100644 index 699d7c22..00000000 --- a/3.1/themes/sobriety/views/block.html.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - -
        -

        -
        - -
        -
        diff --git a/3.1/themes/sobriety/views/dynamic.html.php b/3.1/themes/sobriety/views/dynamic.html.php deleted file mode 100644 index a8a4d362..00000000 --- a/3.1/themes/sobriety/views/dynamic.html.php +++ /dev/null @@ -1,29 +0,0 @@ - -
        -
        - dynamic_top() ?> -
        -

        -
        - -
          - $child): ?> -
        • "> - thumb_top($child) ?> - - photo - -

          title) ?>

          - thumb_bottom($child) ?> - -
        • - -
        -dynamic_bottom() ?> - -paginator() ?> diff --git a/3.1/themes/sobriety/views/form_uploadify.html.php b/3.1/themes/sobriety/views/form_uploadify.html.php deleted file mode 100644 index 62171c04..00000000 --- a/3.1/themes/sobriety/views/form_uploadify.html.php +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - -
          -
        • - suhosin.session.encrypt setting from Suhosin. You must disable this setting to upload photos.", - array("encrypt_url" => "http://www.hardened-php.net/suhosin/configuration.html#suhosin.session.encrypt", - "suhosin_url" => "http://www.hardened-php.net/suhosin/")) ?> -
        • -
        - - -
        -

        - -

        -
          - parents() as $i => $parent): ?> - > title) ?> - -
        • title) ?>
        • -
        -
        -*/ -?> - -
        - - -
        - -
        -
          -
        • 0 KB 0 KB
        • -
        • -
        • n/a
        • -
        • n/a, n/a
        • -
        -
        - -
          -
        -
        -*/ -?> diff --git a/3.1/themes/sobriety/views/movie.html.php b/3.1/themes/sobriety/views/movie.html.php deleted file mode 100644 index 158857db..00000000 --- a/3.1/themes/sobriety/views/movie.html.php +++ /dev/null @@ -1,19 +0,0 @@ - -
        - photo_top() ?> - - paginator() ?> - -
        - resize_top($item) ?> - movie_img(array("class" => "g-movie", "id" => "g-item-id-{$item->id}")) ?> - resize_bottom($item) ?> -
        - -
        -

        title) ?>

        -
        description)) ?>
        -
        - - photo_bottom() ?> -
        diff --git a/3.1/themes/sobriety/views/no_sidebar.html.php b/3.1/themes/sobriety/views/no_sidebar.html.php deleted file mode 100644 index a9eb0e3e..00000000 --- a/3.1/themes/sobriety/views/no_sidebar.html.php +++ /dev/null @@ -1,6 +0,0 @@ - -
          -
        • -
          "> -
        • -
        diff --git a/3.1/themes/sobriety/views/page.html.php b/3.1/themes/sobriety/views/page.html.php deleted file mode 100644 index cf10b85e..00000000 --- a/3.1/themes/sobriety/views/page.html.php +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - <? 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 ?> - - " type="image/x-icon" /> - css("_DISABLED_yui/reset-fonts-grids.css") ?> - css("_DISABLED_superfish/css/superfish.css") ?> - css("_DISABLED_themeroller/ui.base.css") ?> - css("_DISABLED_gallery.common.css") ?> - css("screen.css") ?> - - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("_DISABLED_superfish/js/superfish.js") ?> - script("_DISABLED_jquery.localscroll.js") ?> - script("sobriety.ui.init.js") ?> - script("ui.init.js") ?> - - head() they get combined */ ?> - page_subtype == "photo"): ?> - script("_DISABLED_jquery.scrollTo.js") ?> - script("_DISABLED_gallery.show_full_size.js") ?> - page_subtype == "movie"): ?> - script("flowplayer.js") ?> - - - head() ?> - - - - body_attributes() ?>> - page_top() ?> -
        - site_status() ?> -
        -
        - - - - - - user_menu() ?> - header_top() ?> - - - - - - header_bottom() ?> -
        - - item() && !empty($parents)): ?> - - -
        -
        -
        -
        -
        - messages() ?> - -
        -
        -
        -
        - page_subtype != "login"): ?> - - -
        -
        - -
        - page_bottom() ?> - - diff --git a/3.1/themes/sobriety/views/permissions_form.html.php b/3.1/themes/sobriety/views/permissions_form.html.php deleted file mode 100644 index e8a67c67..00000000 --- a/3.1/themes/sobriety/views/permissions_form.html.php +++ /dev/null @@ -1,97 +0,0 @@ - -
        - - - - - - - - - - - - - - - - - name, $item) ?> - name, $item) ?> - name, $item) ?> - - - - - - - - - - - - - - - - - - - - - -
        display_name) ?>
        name) ?> - " - title="for_html_attr() ?>" - alt="for_html_attr() ?>" /> - - " alt="for_html_attr() ?>" /> - - - - " alt="for_html_attr() ?>" /> - - - " alt="for_html_attr() ?>" /> - - - - " alt="for_html_attr() ?>" /> - - - " alt="for_html_attr() ?>" /> - - - - " alt="for_html_attr() ?>" /> - - id == 1): ?> - " alt="for_html_attr() ?>" title="for_html_attr() ?>"/> - - - " alt="for_html_attr() ?>" /> - - - - id == 1): ?> - " title="for_html_attr() ?>" alt="for_html_attr() ?>" /> - - - " alt="for_html_attr() ?>" /> - - - - " alt="for_html_attr() ?>" /> - -
        -
        -
        - -
        \ No newline at end of file diff --git a/3.1/themes/sobriety/views/photo.html.php b/3.1/themes/sobriety/views/photo.html.php deleted file mode 100644 index c5393547..00000000 --- a/3.1/themes/sobriety/views/photo.html.php +++ /dev/null @@ -1,39 +0,0 @@ - - -item())): ?> - - - - -
        - photo_top() ?> - - paginator() ?> - - - -
        -

        title) ?>

        -
        description)) ?>
        -
        - - - photo_bottom() ?> -
        diff --git a/3.1/themes/sobriety/views/sidebar.html.php b/3.1/themes/sobriety/views/sidebar.html.php deleted file mode 100644 index ecb440af..00000000 --- a/3.1/themes/sobriety/views/sidebar.html.php +++ /dev/null @@ -1,17 +0,0 @@ - -sidebar_top() ?> -
        - - album_menu() ?> - - photo_menu() ?> - - movie_menu() ?> - - tag_menu() ?> - -
        - - -sidebar_blocks() ?> -sidebar_bottom() ?> diff --git a/3.1/themes/sobriety/views/sobriety_actions.html.php b/3.1/themes/sobriety/views/sobriety_actions.html.php deleted file mode 100644 index a781a558..00000000 --- a/3.1/themes/sobriety/views/sobriety_actions.html.php +++ /dev/null @@ -1,22 +0,0 @@ - -theme, ""); - -?> -elements['add_menu']->elements) || isset($menu->elements['options_menu']->elements) ): ?> -
        -

        -
        - -
        -
        - \ No newline at end of file diff --git a/3.1/themes/sobriety/views/sobriety_styles.html.php b/3.1/themes/sobriety/views/sobriety_styles.html.php deleted file mode 100644 index 94a9310c..00000000 --- a/3.1/themes/sobriety/views/sobriety_styles.html.php +++ /dev/null @@ -1,86 +0,0 @@ - - - diff --git a/3.1/themes/three_nids/README b/3.1/themes/three_nids/README deleted file mode 100644 index 4f9efcb9..00000000 --- a/3.1/themes/three_nids/README +++ /dev/null @@ -1,37 +0,0 @@ -This is a theme for gallery3. -It uses jquery lightbox slideshow (fancybox) to display images. - -********* -Demo @ http://gallery.3nids.ch - -********* -Requirements: -- Gallery 3 last experimental version @ http://github.com/gallery/gallery3 -- Tag and tagsmap modules activated (optional) - -********* -Installation: - -1. Copy the theme folder (three_nids) into gallery3/themes directory. -2. Copy the tagsmap module into the gallery3/modules folder. -3. Activate tagsmap module and three_nids theme. - -********* -Configuration: -Go to Admin -> Appearance -> Theme Options to configure the theme properly. - -********* -Use: -This theme displays full size images. So be carefull to upload not too large images! -The theme optionally uses the tagsmap module. - -For advanced users: -If you want to separate geotag from others, name those with the "map." prefix., the "map." prefix will not be displayed on the map. -If you want to remove the prefix in the tag cloud sidebar, wou will have to update in gallery3/modules/tag/helpers/tag.php the popular_tags function: - static function popular_tags($count) { - return ORM::factory("tag") - ->orderby("count", "DESC") - ->notregex("name","map\.") - ->limit($count) - ->find_all(); - } diff --git a/3.1/themes/three_nids/admin/helpers/three_nids_event.php b/3.1/themes/three_nids/admin/helpers/three_nids_event.php deleted file mode 100644 index abb221fc..00000000 --- a/3.1/themes/three_nids/admin/helpers/three_nids_event.php +++ /dev/null @@ -1,42 +0,0 @@ -group("three_nids")->label(t("3nids Theme Settings")); - $group->input("title") - ->rules("required") - ->label(t("item title : parent or item.")) - ->value(module::get_var("three_nids", "title")); - $group->input("description") - ->rules("required") - ->label(t("item description : tags or item or parent or nothing. If item description chosen and not available, then parent description is used.")) - ->value(module::get_var("three_nids", "description")); - $group->input("photo_size") - ->rules("required") - ->label(t("Photo size: resize or full.")) - ->value(module::get_var("three_nids", "photo_size")); - } - - static function theme_edit_form_completed($form) { - module::set_var("three_nids", "description", $form->three_nids->description->value); - module::set_var("three_nids", "title", $form->three_nids->title->value); - module::set_var("three_nids", "photo_size", $form->three_nids->photo_size->value); - } -} \ No newline at end of file diff --git a/3.1/themes/three_nids/controllers/three_nids.php b/3.1/themes/three_nids/controllers/three_nids.php deleted file mode 100644 index f830efb5..00000000 --- a/3.1/themes/three_nids/controllers/three_nids.php +++ /dev/null @@ -1,36 +0,0 @@ -where("item_id", "=", $item->id) - ->where("state", "=", "published") - ->order_by("created", "ASC") - ->find_all(); - - $v = new Theme_View("comments.html", "other", "comment-fragment"); - $v->comments = $comments; - $v->item = $item; - print $v; - } -} diff --git a/3.1/themes/three_nids/css/fix-ie.css b/3.1/themes/three_nids/css/fix-ie.css deleted file mode 100644 index fcebeea8..00000000 --- a/3.1/themes/three_nids/css/fix-ie.css +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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-pager .g-text-right { - width: 29%; -} - -.g-pager .ui-icon-right { - width: 60px; -} diff --git a/3.1/themes/three_nids/css/jquery.fancybox.css b/3.1/themes/three_nids/css/jquery.fancybox.css deleted file mode 100644 index 35fe8bea..00000000 --- a/3.1/themes/three_nids/css/jquery.fancybox.css +++ /dev/null @@ -1,658 +0,0 @@ -html, body { - height: 100%; -} - -div#fancy_overlay { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: black; - display: none; - z-index: 30; -} - -* html div#fancy_overlay { - position: absolute; - height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); -} - -div#fancy_wrap { - text-align: middle; -} - -div#fancy_loading { - position: absolute; - height: 40px; - width: 40px; - cursor: pointer; - display: none; - overflow: hidden; - background: transparent; - z-index: 100; -} - -div#fancy_loading div { - position: absolute; - top: 0; - left: 0; - width: 40px; - height: 480px; - background: transparent url('../images/fancy_progress.png') no-repeat; -} - -div#fancy_loading_overlay { - position: absolute; - background-color: #FFF; - z-index: 30; -} - -div#fancy_outer { - position: absolute; - top: 0; - left: 0; - z-index: 90; - padding: 18px 18px 20px 0px; - margin: 0; - overflow: hidden; - background: transparent; - display: none; -} - -div#fancy_inner { - position: relative; - width:100%; - height:100%; - border: 1px solid #BBB; - background: #FFF; -} - -div#fancy_content { - margin: 0; - z-index: 100; - position: absolute; -} - -div#fancy_div { - background: #000; - color: #FFF; - height: 100%; - width: 100%; - z-index: 100; -} - -img#fancy_img { - position: absolute; - top: 0; - left: 0; - border:0; - padding: 0; - margin: 0; - z-index: 100; - width: 100%; - height: 100%; -} - -div#fancy_close { - position: absolute; - top: -12px; - right: -15px; - height: 30px; - width: 30px; - background: url('../images/fancy_closebox.png') top left no-repeat; - cursor: pointer; - z-index: 181; - display: none; -} - -#fancy_frame { - position: relative; - width: 100%; - height: 100%; - display: none; -} - -#fancy_ajax { - width: 100%; - height: 100%; - overflow: auto; -} - -a#fancy_left, a#fancy_right { - position: absolute; - top: 15px; - height: 50px; - width: 30%; - cursor: pointer; - z-index: 111; - display: none; - background-image: url('data:image/gif;base64,AAAA'); - outline: none; -} - -a#fancy_left { - left: 0px; -} - -a#fancy_right { - right: 0px; -} - -span.fancy_ico { - position: absolute; - top: 50%; - margin-top: -15px; - width: 30px; - height: 30px; - z-index: 112; - cursor: pointer; - display: block; -} - -span#fancy_left_ico { - left: -9999px; - background: transparent url('../images/fancy_left.png') no-repeat; -} - -span#fancy_right_ico { - right: -9999px; - background: transparent url('../images/fancy_right.png') no-repeat; -} - -a#fancy_left:hover { - visibility: visible; -} - -a#fancy_right:hover { - visibility: visible; -} - -a#fancy_left:hover span { - left: 20px; -} - -a#fancy_right:hover span { - right: 20px; -} - -.fancy_bigIframe { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: transparent; -} - -div#fancy_bg { - position: absolute; - top: 0; left: 0; - width: 100%; - height: 100%; - z-index: 70; - border: 0; - padding: 0; - margin: 0; -} - -div.fancy_bg { - position: absolute; - display: block; - z-index: 70; - border: 0; - padding: 0; - margin: 0; -} - -div.fancy_bg_n { - top: -18px; - width: 100%; - height: 18px; - background: transparent url('../images/fancy_shadow_n.png') repeat-x; -} - -div.fancy_bg_ne { - top: -18px; - right: -13px; - width: 13px; - height: 18px; - background: transparent url('../images/fancy_shadow_ne.png') no-repeat; -} - -div.fancy_bg_e { - right: -13px; - height: 100%; - width: 13px; - background: transparent url('../images/fancy_shadow_e.png') repeat-y; -} - -div.fancy_bg_se { - bottom: -18px; - right: -13px; - width: 13px; - height: 18px; - background: transparent url('../images/fancy_shadow_se.png') no-repeat; -} - -div.fancy_bg_s { - bottom: -18px; - width: 100%; - height: 18px; - background: transparent url('../images/fancy_shadow_s.png') repeat-x; -} - -div.fancy_bg_sw { - bottom: -18px; - left: -13px; - width: 13px; - height: 18px; - background: transparent url('../images/fancy_shadow_sw.png') no-repeat; -} - -div.fancy_bg_w { - left: -13px; - height: 100%; - width: 13px; - background: transparent url('../images/fancy_shadow_w.png') repeat-y; -} - -div.fancy_bg_nw { - top: -18px; - left: -13px; - width: 13px; - height: 18px; - background: transparent url('../images/fancy_shadow_nw.png') no-repeat; -} - -div#fancy_title { - position: absolute; - bottom: -20px; - left: 0; - z-index: 100; - display: none; -} - -div#fancy_title div { - color: #FFF; - font: bold 10px Arial; - padding-bottom: 3px; -} - -div#fancy_title table { - margin: 0 auto; -} - -div#fancy_title table td { - padding: 0; - vertical-align: middle; -} - -td#fancy_title_left { - height: 32px; - width: 15px; - background: transparent url('../images/fancy_title_left.png') repeat-x; -} - -td#fancy_title_main { - height: 32px; - background: transparent url('../images/fancy_title_main.png') repeat-x; -} - -td#fancy_title_right { - height: 32px; - width: 15px; - background: transparent url('../images/fancy_title_right.png') repeat-x; -} - -div#fancy_modules { - position: absolute; - bottom: -20px; - right: 0px; - z-index: 100; - display: none; -} -div#fancy_modules div { - color: #FFF; - font: bold 10px Arial; - padding-bottom: 3px; -} - -div#fancy_modules table { - margin: 0 auto; -} - -div#fancy_modules table td { - padding: 0; - vertical-align: middle; -} - -td#fancy_modules_left { - border-color: #333333; - height: 32px; - width: 15px; - background: transparent url('../images/fancy_title_left.png') repeat-x; -} - -td#fancy_modules_main { - border-color: #333333; - height: 32px; - background: transparent url('../images/fancy_title_main.png') repeat-x; -} - -td#fancy_modules_right { - border-color: #333333; - height: 32px; - width: 15px; - background: transparent url('../images/fancy_title_right.png') repeat-x; -} - -/* ************************************************* */ -/* ************************************************* */ -/* ************************************************* */ -/* ************************************************* */ - -div#mod_overlay { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: black; - display: none; - z-index: 1030; -} - -* html div#mod_overlay { - position: absolute; - height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); -} - -div#mod_wrap { - text-align: middle; -} - -div#mod_loading { - position: absolute; - height: 40px; - width: 40px; - cursor: pointer; - display: none; - overflow: hidden; - background: transparent; - z-index: 10100; -} - -div#mod_loading div { - position: absolute; - top: 0; - left: 0; - width: 40px; - height: 480px; - background: transparent url('../images/fancy_progress.png') no-repeat; -} - -div#mod_loading_overlay { - position: absolute; - background-color: #FFF; - z-index: 1030; -} - -div#mod_outer { - position: absolute; - top: 0; - left: 0; - z-index: 1090; - padding: 18px 18px 20px 0px; - margin: 0; - overflow: hidden; - background: transparent; - display: none; -} - -div#mod_inner { - position: relative; - width:100%; - height:100%; - border: 1px solid #BBB; - background: #FFF; -} - -div#mod_content { - margin: 0; - z-index: 10100; - position: absolute; -} - -div#mod_div { - background: #000; - color: #FFF; - height: 100%; - width: 100%; - z-index: 10100; -} - -img#mod_img { - position: absolute; - top: 0; - left: 0; - border:0; - padding: 0; - margin: 0; - z-index: 10100; - width: 100%; - height: 100%; -} - -div#mod_close { - position: absolute; - top: -12px; - right: -15px; - height: 30px; - width: 30px; - background: url('../images/fancy_closebox.png') top left no-repeat; - cursor: pointer; - z-index: 10181; - display: none; -} - -#mod_frame { - position: relative; - width: 100%; - height: 100%; - display: none; -} - -#mod_ajax { - width: 100%; - height: 100%; - overflow: auto; -} - -a#mod_left, a#mod_right { - position: absolute; - bottom: 0px; - height: 100%; - width: 35%; - cursor: pointer; - z-index: 10111; - display: none; - background-image: url('data:image/gif;base64,AAAA'); - outline: none; -} - -a#mod_left { - left: 0px; -} - -a#mod_right { - right: 0px; -} - -span.mod_ico { - position: absolute; - top: 50%; - margin-top: -15px; - width: 30px; - height: 30px; - z-index: 10112; - cursor: pointer; - display: block; -} - -span#mod_left_ico { - left: -9999px; - background: transparent url('../images/fancy_left.png') no-repeat; -} - -span#mod_right_ico { - right: -9999px; - background: transparent url('../images/fancy_right.png') no-repeat; -} - -a#mod_left:hover { - visibility: visible; -} - -a#mod_right:hover { - visibility: visible; -} - -a#mod_left:hover span { - left: 20px; -} - -a#mod_right:hover span { - right: 20px; -} - -.mod_bigIframe { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: transparent; -} - -div#mod_bg { - position: absolute; - top: 0; left: 0; - width: 100%; - height: 100%; - z-index: 1070; - border: 0; - padding: 0; - margin: 0; -} - -div.mod_bg { - position: absolute; - display: block; - z-index: 1070; - border: 0; - padding: 0; - margin: 0; -} - -div.mod_bg_n { - top: -18px; - width: 100%; - height: 18px; - background: transparent url('../images/fancy_shadow_n.png') repeat-x; -} - -div.mod_bg_ne { - top: -18px; - right: -13px; - width: 13px; - height: 18px; - background: transparent url('../images/fancy_shadow_ne.png') no-repeat; -} - -div.mod_bg_e { - right: -13px; - height: 100%; - width: 13px; - background: transparent url('../images/fancy_shadow_e.png') repeat-y; -} - -div.mod_bg_se { - bottom: -18px; - right: -13px; - width: 13px; - height: 18px; - background: transparent url('../images/fancy_shadow_se.png') no-repeat; -} - -div.mod_bg_s { - bottom: -18px; - width: 100%; - height: 18px; - background: transparent url('../images/fancy_shadow_s.png') repeat-x; -} - -div.mod_bg_sw { - bottom: -18px; - left: -13px; - width: 13px; - height: 18px; - background: transparent url('../images/fancy_shadow_sw.png') no-repeat; -} - -div.mod_bg_w { - left: -13px; - height: 100%; - width: 13px; - background: transparent url('../images/fancy_shadow_w.png') repeat-y; -} - -div.mod_bg_nw { - top: -18px; - left: -13px; - width: 13px; - height: 18px; - background: transparent url('../images/fancy_shadow_nw.png') no-repeat; -} - -div#mod_title { - position: absolute; - bottom: -20px; - left: 0; - z-index: 10100; - display: none; -} - -div#mod_title div { - color: #FFF; - font: bold 10px Arial; - padding-bottom: 3px; -} - -div#mod_title table { - margin: 0 auto; -} - -div#mod_title table td { - padding: 0; - vertical-align: middle; -} - -td#mod_title_left { - height: 32px; - width: 15px; - background: transparent url('../images/fancy_title_left.png') repeat-x; -} - -td#mod_title_main { - height: 32px; - background: transparent url('../images/fancy_title_main.png') repeat-x; -} - -td#mod_title_right { - height: 32px; - width: 15px; - background: transparent url('../images/fancy_title_right.png') repeat-x; -} - - diff --git a/3.1/themes/three_nids/css/screen.css b/3.1/themes/three_nids/css/screen.css deleted file mode 100644 index 6bbec16f..00000000 --- a/3.1/themes/three_nids/css/screen.css +++ /dev/null @@ -1,1645 +0,0 @@ -/** - * Gallery 3 Default Theme Screen Styles - * - * @requires YUI reset, font, grids CSS - * - * Sheet organization: - * 1) Basic HTML elements - * 2) Reusable content blocks - * 3) Page layout containers - * 4) Content blocks in specific layout containers - * 5) States and interactions - * 6) Positioning and order - * 7) Navigation and menus - * 8) jQuery and jQuery UI - * 9) Right-to-left language styles - */ - -/** ******************************************************************* - * 1) Basic HTML elements - **********************************************************************/ - -body, html { - background-color: #ccc; - font-family: 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; - color: #e8e8e8; -} - -p { - margin-bottom: 1em; -} - -em { - font-style: oblique; -} - -h1, h2, h3, h4, h5, strong, th { - font-weight: bold; -} - -h1 { - font-size: 1.5em; -} - -#g-search-results h1 { - margin-bottom: 1em; -} - -#g-progress h1 { - font-size: 1.1em; -} - -h2 { - font-size: 1.2em; -} - -#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; -} -h4 { - font-size: 0.9em; -} - -#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: #ffffcc !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; - vertical-align: top; -} - -/* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -form { - margin: 0; -} - -fieldset { - border: 1px solid #ccc; - padding-bottom: .8em; -} - -#g-banner fieldset, -#g-sidebar fieldset, -.g-short-form fieldset { - border: none; -} - -legend { - font-weight: bold; - margin-left: 1em; - color: #e8e8e8; -} - -#g-banner legend, -#g-sidebar legend, -#g-content #g-search-form legend, -input[type="hidden"], -.g-short-form label { - display: none; -} - -label { - cursor: help; -} - -input[type="text"], -input[type="password"] { - width: 50%; -} - -input[type="text"], -input[type="password"], -textarea { - border: 1px solid #e8e8e8; - border-top-color: #ccc; - border-left-color: #ccc; - color: #333; -} - -textarea { - width: 90%; - height: 12em; -} - -input:focus, -textarea:focus, -option:focus { - background-color: #ffc; - color: #000; -} - -/* Form layout ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -form li { - margin: 0 !important; - padding: .3em 1.5em .3em 1em; -} - -form ul ul { - clear: both; -} - -form ul ul li { - float: left; -} - -input, -select, -textarea { - display: block; - clear: both; - padding: .2em; -} - -input[type="submit"], -input[type="reset"] { - display: inline; - clear: none; - float: left; -} - -/* Form validation ~~~~~~~~~~~~~~~~~~~~~~~ */ - -form.g-error input[type="text"], -li.g-error input[type="text"], -form.g-error input[type="password"], -li.g-error input[type="password"], -form.g-error input[type="checkbox"], -li.g-error input[type="checkbox"], -form.g-error input[type="radio"], -li.g-error input[type="radio"], -form.g-error textarea, -li.g-error textarea, -form.g-error select, -li.g-error select { - border: 2px solid red; -} - -/* Forms in dialogs and panels ~~~~~~~~~ */ - -#g-dialog ul li { - padding-bottom: .8em; -} - -#g-dialog fieldset, -#g-panel fieldset { - border: none; - padding: 0; -} - -#g-panel legend { - display: none; -} - -input[readonly] { - background-color: #F4F4FC; -} - -#g-dialog input.textbox, -#g-dialog input[type=text], -#g-dialog input[type=password], -#g-dialog textarea { - width: 97%; -} - -/* Short forms ~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-short-form legend, -.g-short-form label { - display: none; -} - -.g-short-form fieldset { - border: none; - padding: 0; -} - -.g-short-form li { - float: left; - margin: 0 !important; - padding: .4em 0; -} - -.g-short-form .textbox, -.g-short-form input[type=text] { - color: #666; - padding: .3em .6em; - width: 100%; -} - -.g-short-form .textbox.g-error { - border: 1px solid #f00; - color: #f00; - padding-left: 24px; -} - -.g-short-form .g-cancel { - display: block; - margin: .3em .8em; -} - -#g-sidebar .g-short-form li { - padding-left: 0; - padding-right: 0; -} - -/* Text ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -.g-text-small { - font-size: .8em; -} - -.g-text-big { - font-size: 1.2em; -} - -.g-text-right { - text-align: right; -} - -/** ******************************************************************* - * 2) Reusable content blocks - *********************************************************************/ - -.g-block h2 { - background-color: #333; - padding: .3em .8em; -} - -.g-block-content { - margin-top: 1em; -} - -/* Status messages ~~~~~~~~~~~~~~~~~~~~~~~ */ - -/* Inline layout (forms, lists) ~~~~~~~~~~ */ - -.g-short-form li { - float: left; - padding: .4em 0; -} - -.g-short-form input[type="text"] { - color: #666; - padding: .3em .6em; - width: 11em; -} - -/*** ****************************************************************** - * 3) Page layout containers - *********************************************************************/ - -/* Dimension and scale ~~~~~~~~~~~~~~~~~~~ */ -.g-one-quarter { - width: 25%; -} - -.g-one-third { - width: 33%; -} - -.g-one-half { - width: 50%; -} - -.g-two-thirds { - width: 66%; -} - -.g-three-quarters { - width: 75%; -} - -.g-whole { - width: 100%; -} - -/* View container ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-view { - background-color: #333333; - border: 1px solid #e8e8e8; - border-bottom: none; -} - -/* Layout containers ~~~~~~~~~~~~~~~~~~~~~ */ - -#g-header { - margin-bottom: 1em; - background-color: #484848; - border-bottom: 1px solid #e8e8e8; -} - -#g-banner { - background-color: #333333; - border-bottom: 1px solid #e8e8e8; - font-size: .8em; - min-height: 5em; - padding: 1em 20px; - position: relative; -} - -#g-content { - font-size: 1.2em; - padding-left: 20px; - position: relative; - width: 600px; -} - -#g-sidebar { - background-color: #333333; - font-size: .9em; - padding: 0 20px; - width: 220px; -} - -#g-footer { - background-color: #484848; - border-top: 1px solid #ccc; - font-size: .8em; - margin-top: 20px; - padding: 10px 20px; -} - -/** ******************************************************************* - * 4) Content blocks in specific layout containers - *********************************************************************/ - -/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-banner #g-logo img { - margin: 0; -} - -#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: #484848; - border: 1px solid #e8e8e8; - float: left; - font-size: .7em; - padding: .6em 8px; - position: relative; - text-align: center; - width: 180px; - height: 210px; - 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 { - color: #ffffcc; - display: none; - margin-bottom: .6em; -} - -#g-content #g-album-grid .g-album { - background-color: #484848; -} - -#g-content #g-album-grid .g-album h2 span { - 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 { - background-color: #000; - position: absolute !important; - z-index: 1000 !important; - border: 1px solid #f9bd01; -} - -#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; -} - -/* Search results ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-content #g-search-results { - margin-top: 1em; - padding-top: 1em; -} - -/* Individual photo content ~~~~~~~~~~~~~~ */ - -#g-content #g-item { - position: relative; - width: 100%; -} - -#g-content #g-photo { - position: relative; -} - -#g-content #g-item .g-fullsize-link img { - display: block; - margin: 1em auto !important; -} - -#g-comments { - margin-top: 2em; - position: relative; -} - -#g-comments ul li { - margin: 1em 0; -} - -#g-comments .g-author { - border-bottom: 1px solid #ccc; - color: #999; - height: 32px; - line-height: 32px; -} - -#g-comments ul li div { - padding: 0 8px 8px 43px; -} - -#g-comments ul li #g-recaptcha { - padding: 0; -} - -#g-comments ul li #g-recaptcha div { - padding: 0; -} - -#g-comments .g-avatar { - height: 32px; - margin-right: .4em; - width: 32px; -} - -#g-admin-comment-button { - position: absolute; - right: 0; - top: 2px; -} - -#g-content #g-comment-form { - margin-top: 2em; -} - -/* 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; -} - -/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#g-edit-permissions-form td { - background-image: none; -} - -#g-edit-permissions-form fieldset { - border: 1px solid #ccc; -} - -#g-permissions .g-denied { - background-color: #fcc; -} - -#g-permissions .g-allowed { - background-color: #cfc; -} - -#g-permissions .g-breadcrumbs a { - border: 1px solid #fff; -} - -#g-permissions .g-active a { - border: 1px solid #ddd; - background: #eee; -} - -/** ******************************************************************* - * 5) States and interactions - **********************************************************************/ - -.g-active, -.g-enabled, -.g-available, -.g-selected, -.g-highlight { - font-weight: bold; -} - -.g-inactive, -.g-disabled, -.g-unavailable, -.g-uneditable, -.g-locked, -.g-deselected, -.g-understate { - color: #ccc; - font-weight: normal; -} - -.g-editable { - padding: .2em .3em; -} - -.g-editable:hover { - background-color: #ffc; - cursor: text; -} - -.g-error, -.g-info, -.g-success, -.g-warning { - padding-left: 30px; -} - -form li.g-error, -form li.g-info, -form li.g-success, -form li.g-warning { - background-image: none; - padding: .3em .8em .3em 0; -} - -.g-short-form li.g-error { - padding: .3em 0; -} - -form.g-error input[type="text"], -li.g-error input[type="text"], -form.g-error input[type="password"], -li.g-error input[type="password"], -form.g-error input[type="checkbox"], -li.g-error input[type="checkbox"], -form.g-error input[type="radio"], -li.g-error input[type="radio"], -form.g-error textarea, -li.g-error textarea, -form.g-error select, -li.g-error select { - border: 2px solid #f00; - margin-bottom: .2em; -} - -.g-error, -.g-denied, -tr.g-error td.g-error, -#g-add-photos-status .g-error { - background: #f6cbca url('../images/ico-error.png') no-repeat .4em 50%; - color: #f00; -} - -.g-info { - background: #e8e8e8 url('../images/ico-info.png') no-repeat .4em 50%; -} - -.g-success, -.g-allowed, -#g-add-photos-status .g-success { - background: #d9efc2 url('../images/ico-success.png') no-repeat .4em 50%; -} - -tr.g-success { - background-image: none; -} - -tr.g-success td.g-success { - background-image: url('../images/ico-success.png'); -} - -.g-warning, -tr.g-warning td.g-warning { - background: #fcf9ce url('../images/ico-warning.png') no-repeat .4em 50%; -} - -form .g-error { - background-color: #fff; - padding-left: 20px; -} - -.g-open { -} - -.g-closed { -} - -.g-installed { - background-color: #eeeeee; -} - -.g-default { - background-color: #c5dbec; - font-weight: bold; -} - -.g-draggable { - cursor: move; -} - -.g-draggable:hover { - border: 1px dashed #000; -} - -.ui-sortable .g-target, -.ui-state-highlight { - background-color: #fcf9ce; - border: 2px dotted #999; - height: 2em; - margin: 1em 0; -} - -/* Ajax loading indicator ~~~~~~~~~~~~~~~~ */ - -.g-loading-large, -.g-dialog-loading-large { - background: #e8e8e8 url('../images/loading-large.gif') no-repeat center center !important; -} - -.g-loading-small { - background: #e8e8e8 url('../images/loading-small.gif') no-repeat center center !important; -} - -/** ******************************************************************* - * 6) Positioning and order - **********************************************************************/ - -.g-left { - clear: none; - float: left; -} - -.g-right { - clear: none; - float: right; -} - -.g-first { -} - -.g-last { -} - -.g-even { - background-color: #fff; -} - -.g-odd { - background-color: #eee; -} - -/** ******************************************************************* - * 7 Navigation and menus - *********************************************************************/ - -#g-site-menu, -#g-tag-cloud ul { - font-size: 1.2em; -} - -/* 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; - display: none; - left: 300px; - 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 { - font-size: .7em; -} - -#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'); -} - -/* Tags and cloud ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-tag-cloud ul { - text-align: justify; -} - -#g-tag-cloud ul li { - display: inline; - line-height: 1.5em; - text-align: justify; -} - -#g-tag-cloud ul li a { - text-decoration: none; -} - -#g-tag-cloud ul li span { - display: none; -} - -#g-tag-cloud ul li.size1 a { - color: #9cf; - font-size: 80%; - font-weight: 100; -} - -#g-tag-cloud ul li.size2 a { - color: #69f; - font-size: 90%; - font-weight: 300; -} - -#g-tag-cloud ul li.size3 a { - color: #69c; - font-size: 100%; - font-weight: 500; -} - -#g-tag-cloud ul li.size4 a { - color: #369; - font-size: 110%; - font-weight: 700; -} - -#g-tag-cloud ul li.size5 a { - color: #0e2b52; - font-size: 120%; - font-weight: 900; -} - -#g-tag-cloud ul li.size6 a { - color: #0e2b52; - font-size: 130%; - font-weight: 900; -} - -#g-tag-cloud ul li.size7 a { - color: #0e2b52; - font-size: 140%; - font-weight: 900; -} - -#g-tag-cloud ul li a:hover { - color: #f30; - text-decoration: underline; -} - -#g-welcome-message p { - padding-bottom: 1em; -} - -/** ******************************************************************* - * 8) jQuery and jQuery UI - *********************************************************************/ -/* Generic block container ~~~~~~~~~~~~~~~ */ - -.g-block { - clear: both; - margin-bottom: 2.5em; -} - -.g-block-content { -} - -/* Superfish menu overrides ~~~~~~~~~~~~~~ */ - -.sf-menu ul { - width: 12em; -} - -ul.sf-menu li li:hover ul, -ul.sf-menu li li.sfHover ul { - left: 12em; -} - -ul.sf-menu li li li:hover ul, -ul.sf-menu li li li.sfHover ul { - left: 12em; -} - -.sf-menu a { - border-left: 1px solid #e8e8e8; - border-top: 1px solid #e8e8e8; -} - -.sf-menu li { - color: #fff; - background-color: #333; -} - -.sf-menu li li, .sf-menu li li ul li { - color: #fff; - background-color: #333; -} - -.sf-menu li:hover { - color: #fff; - background-color: #777; -} - -.sf-menu li:hover, .sf-menu li.sfHover, -.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active { - background: #777; -} - -/* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */ - -.ui-widget-overlay { - background: #000; - opacity: .7; -} - -/* Buttons ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-button { - display: inline-block; - margin: 0 4px 0 0; - padding: .2em .4em; -} - -.g-button, -.g-button:hover, -.g-button:active { - cursor: pointer !important; - outline: 0; - text-decoration: none; - -moz-outline-style: none; -} - -button { - padding: 2px 4px 2px 4px; -} - -/* jQuery UI ThemeRoller buttons */ - -.g-buttonset { - padding-left: 1px; -} - -.g-buttonset li { - float: left; -} - -.g-buttonset .g-button { - margin: 0; -} - -.ui-icon-left .ui-icon { - float: left; - margin-right: .2em; -} - -.ui-icon-right .ui-icon { - float: right; - margin-left: .2em; -} - -.ui-icon-rotate-ccw { - background-position: -192px -64px; -} - -.ui-icon-rotate-cw { - background-position: -208px -64px; -} - -.g-progress-bar { - height: 1em; - width: 100%; - margin-top: .5em; - display: inline-block; -} - -/* Status and validation messages ~~~~ */ - -.g-message-block { - background-position: .4em .3em; - border: 1px solid #ccc; - padding: 0; -} - -#g-action-status { - margin-bottom: 1em; -} - -#g-action-status li, -p#g-action-status, -div#g-action-status { - padding: .3em .3em .3em 30px; -} - -#g-site-status li { - border-bottom: 1px solid #ccc; - padding: .3em .3em .3em 30px; -} - -.g-module-status { - clear: both; - margin-bottom: 1em; -} - -.g-message { - background-position: 0 50%; -} - -/* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-breadcrumbs { - clear: both; - padding: 0 20px; -} - -.g-breadcrumbs li { - background: transparent url('../images/ico-separator.gif') no-repeat scroll left center; - float: left; - padding: 1em 8px 1em 18px; -} - -.g-breadcrumbs .g-first { - background: none; - padding-left: 0; -} - -.g-breadcrumbs li a, -.g-breadcrumbs li span { - display: block; -} - -#g-dialog ul.g-breadcrumbs { - margin-left: 0; - padding-left: 0; -} - -/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.g-paginator { - padding: .2em 0; - width: 100%; -} - -.g-paginator li { - float: left; -} - -.g-paginator .g-info { - background: none; - padding: .2em 0; - text-align: center; - width: 40%; -} - -/* Dialogs and panels ~~~~~~~~~~~~~~~~~~ */ - -#g-dialog { - text-align: left; -} - -#g-dialog legend { - display: none; -} - -#g-dialog .g-cancel { - margin: .4em 1em; -} - -#g-panel { - display: none; - padding: 1em; -} - -/* Inline layout ~~~~~~~~~~ */ - -.g-inline li { - float: left; - margin-left: 1.8em; - padding-left: 0 !important; -} - -.g-inline li.g-first { - margin-left: 0; -} - -/* STUFF THAT NEEDS A HOME */ - -#g-move ul { - padding-left: 1em; -} - -#g-move .selected { - background: #999; -} - - -/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#g-edit-permissions-form { - clear: both; -} - -#g-edit-permissions-form td { - background-image: none; -} - -#g-edit-permissions-form fieldset { - border: 1px solid #ccc; - padding: 0; -} - -#g-permissions .g-denied, -#g-permissions .g-allowed { - text-align: center; - vertical-align: middle; -} - -#g-permissions .g-denied { - background-color: #fcc; -} - -#g-permissions .g-allowed { - background-color: #cfc; -} - -/* Autocomplete ~~~~~~~~~~ */ -.ac_loading { - background: white url('../images/loading-small.gif') right center no-repeat !important; -} - -/*************** STUFF THAT NEEDS A HOME ****************/ - -#g-admin-g2-import-notes { - padding-bottom: 20px; -} - -#g-admin-g2-import-details { - padding-top: 20px; -} - -#g-admin-g2-import-details .g-warning { - margin-top: 4px; -} - -#g-admin-g2-import-details .g-info { - padding: 2px; - border: 1px solid #999; - margin-bottom: 10px; -} - -#g-admin-g2-import-notes p, -#g-admin-g2-import-details .g-info p { - padding: 0; - margin: 0; -} - -#g-admin-g2-import-notes ul li, -#g-admin-g2-import .g-info ul li { - padding-left: 0; - margin-left: 20px; - list-style-type: disc; -} - -/** ******************************************************************* - * 9) Right to left language styles - *********************************************************************/ - -.rtl { - direction: rtl; -} - -.rtl #g-header, -.rtl #g-content, -.rtl #g-sidebar, -.rtl #g-footer, -.rtl caption, -.rtl th, -.rtl #g-dialog, -.rtl .g-context-menu li a, -.rtl .g-message-box li, -.rtl #g-site-status li { - text-align: right; -} - -.rtl .g-text-right { - text-align: left; -} - -.rtl .g-error, -.rtl .g-info, -.rtl .g-success, -.rtl .g-warning, -.rtl #g-add-photos-status .g-success, -.rtl #g-add-photos-status .g-error { - background-position: center right; - padding-right: 30px !important; -} - -.rtl form li.g-error, -.rtl form li.g-info, -.rtl form li.g-success, -.rtl form li.g-warning { - padding-right: 0 !important; -} - -.rtl .g-left, -.rtl .g-inline li, -.rtl #g-content #g-album-grid .g-item, -.rtl .sf-menu li, -.rtl .g-breadcrumbs li, -.rtl .g-paginator li, -.rtl .g-buttonset li, -.rtl .ui-icon-left .ui-icon, -.rtl .g-short-form li, -.rtl form ul ul li, -.rtl input[type="submit"], -.rtl input[type="reset"], -.rtl input.checkbox, -.rtl input[type=checkbox], -.rtl input.radio, -.rtl input[type=radio] { - float: right; -} - -.rtl .g-right, -.rtl .ui-icon-right .ui-icon { - float: left; -} - -.rtl .g-inline li { - margin-right: 1em; -} - -.rtl .g-inline li.g-first { - margin-right: 0; -} - -.rtl .g-breadcrumbs li { - background: transparent url('../images/ico-separator-rtl.gif') no-repeat scroll right center; - padding: 1em 18px 1em 8px; -} - -.rtl .g-breadcrumbs .g-first { - background: none; - padding-right: 0; -} - -.rtl input.checkbox { - margin-left: .4em; -} - -.rtl #g-add-comment { - right: inherit; - left: 0; -} - -.rtl .ui-icon-left .ui-icon { - margin-left: .2em; -} - -.rtl .ui-icon-right .ui-icon { - margin-right: .2em; -} - -/* RTL Corner radius ~~~~~~~~~~~~~~~~~~~~~~ */ -.rtl .g-buttonset .ui-corner-tl { - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - border-top-left-radius: 0; - -moz-border-radius-topright: 5px !important; - -webkit-border-top-right-radius: 5px !important; - border-top-right-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-tr { - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -moz-border-radius-topleft: 5px !important; - -webkit-border-top-left-radius: 5px !important; - border-top-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-bl { - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 5px !important; - -webkit-border-bottom-right-radius: 5px !important; - border-bottom-right-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-br { - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomleft: 5px !important; - -webkit-border-bottom-left-radius: 5px !important; - border-bottom-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-right, -.rtl .ui-progressbar .ui-corner-right { - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -moz-border-radius-topleft: 5px !important; - -webkit-border-top-left-radius: 5px !important; - border-top-left-radius: 5px !important; - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomleft: 5px !important; - -webkit-border-bottom-left-radius: 5px !important; - border-bottom-left-radius: 5px !important; -} - -.rtl .g-buttonset .ui-corner-left, -.rtl .ui-progressbar .ui-corner-left { - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - border-top-left-radius: 0; - -moz-border-radius-topright: 5px !important; - -webkit-border-top-right-radius: 5px !important; - border-top-right-radius: 5px !important; - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 5px !important; - -webkit-border-bottom-right-radius: 5px !important; - border-bottom-right-radius: 5px !important; -} - -/* RTL Superfish ~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.rtl .sf-menu a { - border-left: none; - border-right:1px solid #fff; -} - -.rtl .sf-menu a.sf-with-ul { - padding-left: 2.25em; - padding-right: 1em; -} - -.rtl .sf-sub-indicator { - left: .75em !important; - right: auto; - background: url('../../../lib/superfish/images/arrows-ffffff-rtl.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */ -} -.rtl a > .sf-sub-indicator { /* give all except IE6 the correct values */ - top: .8em; - background-position: -10px -100px; /* use translucent arrow for modern browsers*/ -} -/* apply hovers to modern browsers */ -.rtl a:focus > .sf-sub-indicator, -.rtl a:hover > .sf-sub-indicator, -.rtl a:active > .sf-sub-indicator, -.rtl li:hover > a > .sf-sub-indicator, -.rtl li.sfHover > a > .sf-sub-indicator { - background-position: 0 -100px; /* arrow hovers for modern browsers*/ -} - -/* point right for anchors in subs */ -.rtl .sf-menu ul .sf-sub-indicator { background-position: 0 0; } -.rtl .sf-menu ul a > .sf-sub-indicator { background-position: -10px 0; } -/* apply hovers to modern browsers */ -.rtl .sf-menu ul a:focus > .sf-sub-indicator, -.rtl .sf-menu ul a:hover > .sf-sub-indicator, -.rtl .sf-menu ul a:active > .sf-sub-indicator, -.rtl .sf-menu ul li:hover > a > .sf-sub-indicator, -.rtl .sf-menu ul li.sfHover > a > .sf-sub-indicator { - background-position: 0 0; /* arrow hovers for modern browsers*/ -} - -.rtl .sf-menu li:hover ul, -.rtl .sf-menu li.sfHover ul { - right: 0; - left: auto; -} - -.rtl ul.sf-menu li li:hover ul, -.rtl ul.sf-menu li li.sfHover ul { - right: 12em; /* match ul width */ - left: auto; -} -.rtl ul.sf-menu li li li:hover ul, -.rtl ul.sf-menu li li li.sfHover ul { - right: 12em; /* match ul width */ - left: auto; -} - -/*** shadows for all but IE6 ***/ -.rtl .sf-shadow ul { - background: url('../../../lib/superfish/images/shadow.png') no-repeat bottom left; - padding: 0 0 9px 8px; - border-top-right-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-topright: 0; - -moz-border-radius-bottomleft: 0; - -webkit-border-top-right-radius: 0; - -webkit-border-bottom-left-radius: 0; - -moz-border-radius-topleft: 17px; - -moz-border-radius-bottomright: 17px; - -webkit-border-top-left-radius: 17px; - -webkit-border-bottom-right-radius: 17px; - border-top-left-radius: 17px; - border-bottom-right-radius: 17px; -} - -/* RTL ThemeRoller ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.rtl .ui-dialog .ui-dialog-titlebar { - padding: 0.5em 1em 0.3em 0.3em; -} - -.rtl .ui-dialog .ui-dialog-title { - float: right; -} - -.rtl .ui-dialog .ui-dialog-titlebar-close { - left: 0.3em; - right: auto; -} - - -/* RTL paginator ~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.rtl .g-paginator .g-info { - width: 35%; -} - -.rtl .g-paginator .g-text-right { - margin-left: 0; -} - -.rtl .g-paginator .ui-icon-seek-end { - background-position: -80px -160px; -} - -.rtl .g-paginator .ui-icon-seek-next { - background-position: -48px -160px; -} - -.rtl .g-paginator .ui-icon-seek-prev { - background-position: -32px -160px; -} - -.rtl .g-paginator .ui-icon-seek-first { - background-position: -64px -160px; -} - -.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'); -} - -.rtl #g-sidebar .g-block-content { - padding-right: 1em; - padding-left: 0; -} - -.rtl #g-footer #g-credits li { - padding-left: 1.2em !important; - padding-right: 0; -} - -.rtl caption, -.rtl th, -.rtl #g-dialog { - text-align: right; -} - -.rtl .g-right, -.rtl #g-header #g-quick-search-form, -.rtl #g-header #g-login-menu, -.rtl .ui-icon-right .ui-icon { - clear: left; - float: left; -} - -.rtl .g-left, -.rtl #g-dialog .g-cancel, -.rtl form ul ul li, -.rtl input[type="submit"], -.rtl input[type="reset"], -.rtl .g-short-form li, -.rtl #g-header #g-logo img, -.rtl #g-content #g-album-grid .g-item, -.rtl #g-site-menu, -.rtl .g-breadcrumbs li, -.rtl .g-pager li, -.rtl .g-buttonset li, -.rtl .ui-icon-left .ui-icon { - float: right; -} diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_0_333333_40x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_0_333333_40x100.png deleted file mode 100644 index 2f2c7a45..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_0_333333_40x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_0_484848_40x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_0_484848_40x100.png deleted file mode 100644 index 37979abe..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_0_484848_40x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_0_aaaaaa_40x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_0_aaaaaa_40x100.png deleted file mode 100644 index 5b5dab2a..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_0_aaaaaa_40x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_100_000000_40x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_100_000000_40x100.png deleted file mode 100644 index abdc0108..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_100_000000_40x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_100_333333_40x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_100_333333_40x100.png deleted file mode 100644 index 2f2c7a45..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_100_333333_40x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_100_484848_40x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_100_484848_40x100.png deleted file mode 100644 index 37979abe..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_100_484848_40x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_100_b30000_40x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_100_b30000_40x100.png deleted file mode 100644 index 121651a0..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_100_b30000_40x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_55_fbec88_40x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_55_fbec88_40x100.png deleted file mode 100644 index 47acaadd..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_flat_55_fbec88_40x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_glass_95_fef1ec_1x400.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_glass_95_fef1ec_1x400.png deleted file mode 100644 index 4443fdc1..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_glass_95_fef1ec_1x400.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_gloss-wave_16_121212_500x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_gloss-wave_16_121212_500x100.png deleted file mode 100644 index c7a2ee1b..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_gloss-wave_16_121212_500x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-hard_100_333333_1x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-hard_100_333333_1x100.png deleted file mode 100644 index 254bb228..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-hard_100_333333_1x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-hard_15_888888_1x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-hard_15_888888_1x100.png deleted file mode 100644 index 66e53e16..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-hard_15_888888_1x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-hard_55_555555_1x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-hard_55_555555_1x100.png deleted file mode 100644 index 1453bc18..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-hard_55_555555_1x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-soft_35_adadad_1x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-soft_35_adadad_1x100.png deleted file mode 100644 index 5a5a41d4..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-soft_35_adadad_1x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-soft_60_dddddd_1x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-soft_60_dddddd_1x100.png deleted file mode 100644 index 747e1fa6..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_highlight-soft_60_dddddd_1x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-bg_inset-soft_15_121212_1x100.png b/3.1/themes/three_nids/css/themeroller/images/ui-bg_inset-soft_15_121212_1x100.png deleted file mode 100644 index e7692acd..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-bg_inset-soft_15_121212_1x100.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-icons_222222_256x240.png b/3.1/themes/three_nids/css/themeroller/images/ui-icons_222222_256x240.png deleted file mode 100644 index ee039dc0..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-icons_222222_256x240.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-icons_333333_256x240.png b/3.1/themes/three_nids/css/themeroller/images/ui-icons_333333_256x240.png deleted file mode 100644 index 379a4064..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-icons_333333_256x240.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-icons_444444_256x240.png b/3.1/themes/three_nids/css/themeroller/images/ui-icons_444444_256x240.png deleted file mode 100644 index 1d071b4e..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-icons_444444_256x240.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-icons_666666_256x240.png b/3.1/themes/three_nids/css/themeroller/images/ui-icons_666666_256x240.png deleted file mode 100644 index 05fae5ee..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-icons_666666_256x240.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-icons_aaaaaa_256x240.png b/3.1/themes/three_nids/css/themeroller/images/ui-icons_aaaaaa_256x240.png deleted file mode 100644 index 9b04537f..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-icons_aaaaaa_256x240.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-icons_bbbbbb_256x240.png b/3.1/themes/three_nids/css/themeroller/images/ui-icons_bbbbbb_256x240.png deleted file mode 100644 index 8340d085..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-icons_bbbbbb_256x240.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-icons_cccccc_256x240.png b/3.1/themes/three_nids/css/themeroller/images/ui-icons_cccccc_256x240.png deleted file mode 100644 index 12774b8f..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-icons_cccccc_256x240.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-icons_cd0a0a_256x240.png b/3.1/themes/three_nids/css/themeroller/images/ui-icons_cd0a0a_256x240.png deleted file mode 100644 index 7930a558..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-icons_cd0a0a_256x240.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-icons_f9bd01_256x240.png b/3.1/themes/three_nids/css/themeroller/images/ui-icons_f9bd01_256x240.png deleted file mode 100644 index 1619b868..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-icons_f9bd01_256x240.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/images/ui-icons_f9db01_256x240.png b/3.1/themes/three_nids/css/themeroller/images/ui-icons_f9db01_256x240.png deleted file mode 100644 index af18dccc..00000000 Binary files a/3.1/themes/three_nids/css/themeroller/images/ui-icons_f9db01_256x240.png and /dev/null differ diff --git a/3.1/themes/three_nids/css/themeroller/ui.base.css b/3.1/themes/three_nids/css/themeroller/ui.base.css deleted file mode 100644 index e48cfd1e..00000000 --- a/3.1/themes/three_nids/css/themeroller/ui.base.css +++ /dev/null @@ -1,406 +0,0 @@ -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - - -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande,%20Lucida%20Sans,%20Arial,%20sans-serif&bgColorDefault=333333&fwDefault=bold&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=484848&bgTextureHeader=01_flat.png&bgImgOpacityHeader=100&borderColorHeader=e8e8e8&fcHeader=e8e8e8&iconColorHeader=f9bd01&bgColorContent=333333&bgTextureContent=01_flat.png&bgImgOpacityContent=100&borderColorContent=e8e8e8&fcContent=e8e8e8&iconColorContent=f9db01&bgColorDefault=333333&bgTextureDefault=01_flat.png&bgImgOpacityDefault=100&borderColorDefault=f9db01&fcDefault=FFFFCC&iconColorDefault=f9db01&bgColorHover=000000&bgTextureHover=01_flat.png&bgImgOpacityHover=100&borderColorHover=f9db01&fcHover=e8e8e8&iconColorHover=f9db01&bgColorActive=333333&bgTextureActive=04_highlight_hard.png&bgImgOpacityActive=100&borderColorActive=e8e8e8&fcActive=e8e8e8&iconColorActive=f9bd01&bgColorHighlight=fbec88&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=333333&fcHighlight=333333&iconColorHighlight=333333&bgColorError=b30000&bgTextureError=01_flat.png&bgImgOpacityError=100&borderColorError=f9db01&fcError=f9db01&iconColorError=f9db01&bgColorOverlay=484848&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=100&bgColorShadow=333333&bgTextureShadow=01_flat.png&bgImgOpacityShadow=100&opacityShadow=50&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #e8e8e8; background: #333333 url(images/ui-bg_flat_100_333333_40x100.png) 50% 50% repeat-x; color: #e8e8e8; } -.ui-widget-content a { color: #e8e8e8; } -.ui-widget-header { border: 1px solid #e8e8e8; background: #484848 url(images/ui-bg_flat_100_484848_40x100.png) 50% 50% repeat-x; color: #e8e8e8; font-weight: bold; } -.ui-widget-header a { color: #e8e8e8; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #f9db01; background: #333333 url(images/ui-bg_flat_100_333333_40x100.png) 50% 50% repeat-x; font-weight: bold; color: #FFFFCC; outline: none; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #FFFFCC; text-decoration: none; outline: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #f9db01; background: #000000 url(images/ui-bg_flat_100_000000_40x100.png) 50% 50% repeat-x; font-weight: bold; color: #e8e8e8; outline: none; } -.ui-state-hover a, .ui-state-hover a:hover { color: #e8e8e8; text-decoration: none; outline: none; } -.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #e8e8e8; background: #333333 url(images/ui-bg_highlight-hard_100_333333_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #e8e8e8; outline: none; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #e8e8e8; outline: none; text-decoration: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #333333; background: #fbec88 url(images/ui-bg_flat_55_fbec88_40x100.png) 50% 50% repeat-x; color: #333333; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #333333; } -.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #f9db01; background: #b30000 url(images/ui-bg_flat_100_b30000_40x100.png) 50% 50% repeat-x; color: #f9db01; } -.ui-state-error a, .ui-widget-content .ui-state-error a { color: #f9db01; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #f9db01; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_f9db01_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_f9db01_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_f9bd01_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_f9db01_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_f9db01_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_f9bd01_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_333333_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_f9db01_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; } -.ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; } -.ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; } -.ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; } -.ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; } -.ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; } -.ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; } - -/* Overlays */ -.ui-widget-overlay { background: #484848 url(images/ui-bg_flat_0_484848_40x100.png) 50% 50% repeat-x; opacity: 100;filter:Alpha(Opacity=100); } -.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #333333 url(images/ui-bg_flat_100_333333_40x100.png) 50% 50% repeat-x; opacity: .50;filter:Alpha(Opacity=50); -moz-border-radius: 8px; -webkit-border-radius: 8px; }/* Accordion -----------------------------------*/ -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } -.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}/* Dialog -----------------------------------*/ -.ui-dialog { position: relative; padding: .2em; width: 300px; } -.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs -----------------------------------*/ -.ui-tabs { padding: .2em; zoom: 1; } -.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } -.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/3.1/themes/three_nids/css/three_nids.css b/3.1/themes/three_nids/css/three_nids.css deleted file mode 100644 index 27f61a07..00000000 --- a/3.1/themes/three_nids/css/three_nids.css +++ /dev/null @@ -1,54 +0,0 @@ -/* 3nids specific */ -.g-movie { - padding-top: 10px; -} - -.g-map-head img { - display: block; - margin: 3px; -} - -.g-map-head a { - float: right; -} - -.g-comment-thumb{ - padding: 5px; - text-align: left; -} - -.g-fancy-iframe-body{ - background-color: #333333; - height: auto; -} - -#mod_frame{ - background-color: #333333; - } - - .g-comment-box { - border-bottom: 1px solid #555; -} - -.g-comment-box:hover{ - background-color: black; - color: #ffffcc; -} - - #g-comment-detail { - width: 360px; - height: 100%; - background-color: #333333; - padding: 10px; - text-align: left; - margin-top: 30px; -} - -.g-block-content .g-parent-album h4 span { - background: transparent url('../images/ico-album.png') no-repeat top left; - display: inline-block; - height: 16px; - margin-right: 5px; - width: 16px; -} - diff --git a/3.1/themes/three_nids/helpers/three_nids.php b/3.1/themes/three_nids/helpers/three_nids.php deleted file mode 100644 index 93115624..00000000 --- a/3.1/themes/three_nids/helpers/three_nids.php +++ /dev/null @@ -1,125 +0,0 @@ -is_movie()){ - $width = $item->width; - $height = $item->height; - }else{ - $width = $item->resize_width; - $height = $item->resize_height; - } - - $description_mode = module::get_var("three_nids", "description"); - $description = ""; - $tags = tag::item_tags($item); - if(count($tags) && $description_mode == "tags"){ - $description = " || " . implode(", ", $tags); - } else if ($description_mode == "item" && $item->description != ""){ - $description = " || " . str_replace("\"",""",$item->description); - } else if (($description_mode == "parent" || - $description_mode == "item") && $item->parent()->description != ""){ - $description = " || " . str_replace("\"", """, $item->parent()->description); - } - - $title_mode = module::get_var("three_nids", "title"); - if ($title_mode == "parent"){ - $title = html::clean($item->parent()->title); - } else { - $title = html::clean($item->title); - } - - $rel = ""; - if ($group_img == true) { - $rel = " rel=\"fancygroup\" "; - } - - if ($item->is_photo() || $item->is_movie()){ - $fancymodule = ""; - if (module::is_active("exif")) { - $fancymodule .= "exif::" . url::site("exif/show/{$item->id}") . ";;"; - } - if (module::is_active("comment")) { - $fancymodule .= "comment::" . url::site("three_nids/show_comments/{$item->id}") . - ";;comment_count::" . three_nids::comment_count($item) . ";;"; - } - if ($item->is_photo()){ - $link .= "id}") ."/?w=" . $width . - "xewx&h=" . $height . "xehx\" " . $rel . " class=\"fancyclass iframe\" title=\"" . - $title . $description ."\" name=\"" . $fancymodule . " \">"; - } else { - $link .= "id}") . "/?w=" . - strval(20 + $width) . "xewx&h=" . strval(50 + $height) . "xehx\" " . $rel . - " class=\"fancyclass iframe\" title=\"" . $item->parent()->title . $description . - "\" name=\"" . $fancymodule . " \">"; - } - } else if ($item->is_album() && $view_type != "header") { - $link .= "url() . "\">"; - } else { - // NOTE: we don't want to open an here because $view_type is "header", but lower down - // we're going to close one, so that's going to generate a mismatch. For now, just open a - // link anyway. - // @todo: figure out what we really should be doing here. - $link .= "url() . "\">"; - } - - if ($view_type != "header") { - $link .= $item->thumb_img(array("class" => "g-thumbnail")) . ""; - if ($item->is_album() && $view_type == "album") { - $link .= "url() . "?show=" . $item->id . - "\"><$parent_title_class>" . html::clean($item->title) . - ""; - } else if (!($item->is_album()) && $view_type == "dynamic") { - $link .= "parent()->url() . "?show=" . $item->id . - "\" class=\"g-parent-album\"><$parent_title_class>" . - html::clean($item->parent()->title) . ""; - } - - if (($item->is_photo() || $item->is_movie()) && $display_comment && - module::is_active("comment")) { - $link .= ""; - } - } else { - $link .= ""; - } - return $link; - } - - static function comment_count($item) { - access::required("view", $item); - - return ORM::factory("comment") - ->where("item_id", "=", $item->id) - ->where("state", "=", "published") - ->order_by("created", "DESC") - ->count_all(); - } -} -?> \ No newline at end of file diff --git a/3.1/themes/three_nids/images/avatar.jpg b/3.1/themes/three_nids/images/avatar.jpg deleted file mode 100644 index d08724fc..00000000 Binary files a/3.1/themes/three_nids/images/avatar.jpg and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_closebox.png b/3.1/themes/three_nids/images/fancy_closebox.png deleted file mode 100644 index 4de4396d..00000000 Binary files a/3.1/themes/three_nids/images/fancy_closebox.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_left.png b/3.1/themes/three_nids/images/fancy_left.png deleted file mode 100644 index 61494e63..00000000 Binary files a/3.1/themes/three_nids/images/fancy_left.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_progress.png b/3.1/themes/three_nids/images/fancy_progress.png deleted file mode 100644 index 06b7c89a..00000000 Binary files a/3.1/themes/three_nids/images/fancy_progress.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_right.png b/3.1/themes/three_nids/images/fancy_right.png deleted file mode 100644 index 0a56042f..00000000 Binary files a/3.1/themes/three_nids/images/fancy_right.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_shadow_e.png b/3.1/themes/three_nids/images/fancy_shadow_e.png deleted file mode 100644 index 5db7b2b8..00000000 Binary files a/3.1/themes/three_nids/images/fancy_shadow_e.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_shadow_n.png b/3.1/themes/three_nids/images/fancy_shadow_n.png deleted file mode 100644 index 4e20abbe..00000000 Binary files a/3.1/themes/three_nids/images/fancy_shadow_n.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_shadow_ne.png b/3.1/themes/three_nids/images/fancy_shadow_ne.png deleted file mode 100644 index 64ef7225..00000000 Binary files a/3.1/themes/three_nids/images/fancy_shadow_ne.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_shadow_nw.png b/3.1/themes/three_nids/images/fancy_shadow_nw.png deleted file mode 100644 index 9ef03377..00000000 Binary files a/3.1/themes/three_nids/images/fancy_shadow_nw.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_shadow_s.png b/3.1/themes/three_nids/images/fancy_shadow_s.png deleted file mode 100644 index bf52bd61..00000000 Binary files a/3.1/themes/three_nids/images/fancy_shadow_s.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_shadow_se.png b/3.1/themes/three_nids/images/fancy_shadow_se.png deleted file mode 100644 index 12311ed3..00000000 Binary files a/3.1/themes/three_nids/images/fancy_shadow_se.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_shadow_sw.png b/3.1/themes/three_nids/images/fancy_shadow_sw.png deleted file mode 100644 index 923a8b50..00000000 Binary files a/3.1/themes/three_nids/images/fancy_shadow_sw.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_shadow_w.png b/3.1/themes/three_nids/images/fancy_shadow_w.png deleted file mode 100644 index 6f808d3e..00000000 Binary files a/3.1/themes/three_nids/images/fancy_shadow_w.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_title_left.png b/3.1/themes/three_nids/images/fancy_title_left.png deleted file mode 100644 index 1e82b6da..00000000 Binary files a/3.1/themes/three_nids/images/fancy_title_left.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_title_main.png b/3.1/themes/three_nids/images/fancy_title_main.png deleted file mode 100644 index 5f505b00..00000000 Binary files a/3.1/themes/three_nids/images/fancy_title_main.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/fancy_title_right.png b/3.1/themes/three_nids/images/fancy_title_right.png deleted file mode 100644 index ef0dc201..00000000 Binary files a/3.1/themes/three_nids/images/fancy_title_right.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/ico-album.png b/3.1/themes/three_nids/images/ico-album.png deleted file mode 100644 index e3bb4fc5..00000000 Binary files a/3.1/themes/three_nids/images/ico-album.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/ico-error.png b/3.1/themes/three_nids/images/ico-error.png deleted file mode 100644 index c37bd062..00000000 Binary files a/3.1/themes/three_nids/images/ico-error.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/ico-separator-rtl.gif b/3.1/themes/three_nids/images/ico-separator-rtl.gif deleted file mode 100644 index d9061a46..00000000 Binary files a/3.1/themes/three_nids/images/ico-separator-rtl.gif and /dev/null differ diff --git a/3.1/themes/three_nids/images/ico-separator.gif b/3.1/themes/three_nids/images/ico-separator.gif deleted file mode 100644 index 3de2d0d3..00000000 Binary files a/3.1/themes/three_nids/images/ico-separator.gif and /dev/null differ diff --git a/3.1/themes/three_nids/images/ico-success-inactive.png b/3.1/themes/three_nids/images/ico-success-inactive.png deleted file mode 100644 index 74b2032f..00000000 Binary files a/3.1/themes/three_nids/images/ico-success-inactive.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/ico-warning.png b/3.1/themes/three_nids/images/ico-warning.png deleted file mode 100644 index 628cf2da..00000000 Binary files a/3.1/themes/three_nids/images/ico-warning.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/loading-large.gif b/3.1/themes/three_nids/images/loading-large.gif deleted file mode 100644 index cc70a7a8..00000000 Binary files a/3.1/themes/three_nids/images/loading-large.gif and /dev/null differ diff --git a/3.1/themes/three_nids/images/loading-small.gif b/3.1/themes/three_nids/images/loading-small.gif deleted file mode 100644 index d0bce154..00000000 Binary files a/3.1/themes/three_nids/images/loading-small.gif and /dev/null differ diff --git a/3.1/themes/three_nids/images/map.png b/3.1/themes/three_nids/images/map.png deleted file mode 100644 index 1df93fb5..00000000 Binary files a/3.1/themes/three_nids/images/map.png and /dev/null differ diff --git a/3.1/themes/three_nids/images/select-photos-backg.png b/3.1/themes/three_nids/images/select-photos-backg.png deleted file mode 100644 index 81c2d616..00000000 Binary files a/3.1/themes/three_nids/images/select-photos-backg.png and /dev/null differ diff --git a/3.1/themes/three_nids/js/jquery.easing.js b/3.1/themes/three_nids/js/jquery.easing.js deleted file mode 100644 index ef743210..00000000 --- a/3.1/themes/three_nids/js/jquery.easing.js +++ /dev/null @@ -1,205 +0,0 @@ -/* - * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ - * - * Uses the built in easing capabilities added In jQuery 1.1 - * to offer multiple easing options - * - * TERMS OF USE - jQuery Easing - * - * Open source under the BSD License. - * - * Copyright © 2008 George McGinley Smith - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * Neither the name of the author nor the names of contributors may be used to endorse - * or promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * -*/ - -// t: current time, b: begInnIng value, c: change In value, d: duration -jQuery.easing['jswing'] = jQuery.easing['swing']; - -jQuery.extend( jQuery.easing, -{ - def: 'easeOutQuad', - swing: function (x, t, b, c, d) { - //alert(jQuery.easing.default); - return jQuery.easing[jQuery.easing.def](x, t, b, c, d); - }, - easeInQuad: function (x, t, b, c, d) { - return c*(t/=d)*t + b; - }, - easeOutQuad: function (x, t, b, c, d) { - return -c *(t/=d)*(t-2) + b; - }, - easeInOutQuad: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t + b; - return -c/2 * ((--t)*(t-2) - 1) + b; - }, - easeInCubic: function (x, t, b, c, d) { - return c*(t/=d)*t*t + b; - }, - easeOutCubic: function (x, t, b, c, d) { - return c*((t=t/d-1)*t*t + 1) + b; - }, - easeInOutCubic: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t*t + b; - return c/2*((t-=2)*t*t + 2) + b; - }, - easeInQuart: function (x, t, b, c, d) { - return c*(t/=d)*t*t*t + b; - }, - easeOutQuart: function (x, t, b, c, d) { - return -c * ((t=t/d-1)*t*t*t - 1) + b; - }, - easeInOutQuart: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t*t*t + b; - return -c/2 * ((t-=2)*t*t*t - 2) + b; - }, - easeInQuint: function (x, t, b, c, d) { - return c*(t/=d)*t*t*t*t + b; - }, - easeOutQuint: function (x, t, b, c, d) { - return c*((t=t/d-1)*t*t*t*t + 1) + b; - }, - easeInOutQuint: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; - return c/2*((t-=2)*t*t*t*t + 2) + b; - }, - easeInSine: function (x, t, b, c, d) { - return -c * Math.cos(t/d * (Math.PI/2)) + c + b; - }, - easeOutSine: function (x, t, b, c, d) { - return c * Math.sin(t/d * (Math.PI/2)) + b; - }, - easeInOutSine: function (x, t, b, c, d) { - return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; - }, - easeInExpo: function (x, t, b, c, d) { - return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; - }, - easeOutExpo: function (x, t, b, c, d) { - return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; - }, - easeInOutExpo: function (x, t, b, c, d) { - if (t==0) return b; - if (t==d) return b+c; - if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; - return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; - }, - easeInCirc: function (x, t, b, c, d) { - return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; - }, - easeOutCirc: function (x, t, b, c, d) { - return c * Math.sqrt(1 - (t=t/d-1)*t) + b; - }, - easeInOutCirc: function (x, t, b, c, d) { - if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; - return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; - }, - easeInElastic: function (x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; - }, - easeOutElastic: function (x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; - }, - easeInOutElastic: function (x, t, b, c, d) { - var s=1.70158;var p=0;var a=c; - if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); - if (a < Math.abs(c)) { a=c; var s=p/4; } - else var s = p/(2*Math.PI) * Math.asin (c/a); - if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; - return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; - }, - easeInBack: function (x, t, b, c, d, s) { - if (s == undefined) s = 1.70158; - return c*(t/=d)*t*((s+1)*t - s) + b; - }, - easeOutBack: function (x, t, b, c, d, s) { - if (s == undefined) s = 1.70158; - return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; - }, - easeInOutBack: function (x, t, b, c, d, s) { - if (s == undefined) s = 1.70158; - if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; - return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; - }, - easeInBounce: function (x, t, b, c, d) { - return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; - }, - easeOutBounce: function (x, t, b, c, d) { - if ((t/=d) < (1/2.75)) { - return c*(7.5625*t*t) + b; - } else if (t < (2/2.75)) { - return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; - } else if (t < (2.5/2.75)) { - return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; - } else { - return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; - } - }, - easeInOutBounce: function (x, t, b, c, d) { - if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; - return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; - } -}); - -/* - * - * TERMS OF USE - EASING EQUATIONS - * - * Open source under the BSD License. - * - * Copyright © 2001 Robert Penner - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * Neither the name of the author nor the names of contributors may be used to endorse - * or promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ \ No newline at end of file diff --git a/3.1/themes/three_nids/js/jquery.fancybox.js b/3.1/themes/three_nids/js/jquery.fancybox.js deleted file mode 100644 index a07c9cba..00000000 --- a/3.1/themes/three_nids/js/jquery.fancybox.js +++ /dev/null @@ -1,1123 +0,0 @@ -/* - * FancyBox - simple and fancy jQuery plugin - * Examples and documentation at: http://fancy.klade.lv/ - * Version: 1.2.1 (13/03/2009) - * Copyright (c) 2009 Janis Skarnelis - * Licensed under the MIT License: http://en.wikipedia.org/wiki/MIT_License - * Requires: jQuery v1.3+ -*/ -;(function($) { - - $.fn.fixPNG = function() { - return this.each(function () { - var image = $(this).css('backgroundImage'); - - if (image.match(/^url\(["']?(.*\.png)["']?\)$/i)) { - image = RegExp.$1; - $(this).css({ - 'backgroundImage': 'none', - 'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=" + ($(this).css('backgroundRepeat') == 'no-repeat' ? 'crop' : 'scale') + ", src='" + image + "')" - }).each(function () { - var position = $(this).css('position'); - if (position != 'absolute' && position != 'relative') - $(this).css('position', 'relative'); - }); - } - }); - }; - - - var elem, opts, busy = false, imagePreloader = new Image, loadingTimer, loadingFrame = 1, imageRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i; - var isIE = ($.browser.msie && parseInt($.browser.version.substr(0,1)) < 8); - - $.fn.fancybox = function(settings) { - settings = $.extend({}, $.fn.fancybox.defaults, settings); - - var matchedGroup = this; - - function _initialize() { - elem = this; - opts = settings; - - _start(); - - return false; - }; - - function _start() { - if (busy) return; - - if ($.isFunction(opts.callbackOnStart)) { - opts.callbackOnStart(); - } - - opts.itemArray = []; - opts.itemCurrent = 0; - - if (settings.itemArray.length > 0) { - opts.itemArray = settings.itemArray; - - } else { - var item = {}; - - if (!elem.rel || elem.rel == '') { - var item = {href: elem.href, title: elem.title, modules: elem.name, fancyclass: elem.className}; - - if ($(elem).children("img:first").length) { - item.orig = $(elem).children("img:first"); - } - - opts.itemArray.push( item ); - - } else { - - var subGroup = $(matchedGroup).filter("a[rel=" + elem.rel + "]"); - - var item = {}; - - for (var i = 0; i < subGroup.length; i++) { - item = {href: subGroup[i].href, title: subGroup[i].title, modules: subGroup[i].name, fancyclass: subGroup[i].className}; - - if ($(subGroup[i]).children("img:first").length) { - item.orig = $(subGroup[i]).children("img:first"); - } - - opts.itemArray.push( item ); - } - - while ( opts.itemArray[ opts.itemCurrent ].href != elem.href ) { - opts.itemCurrent++; - } - } - } - - if (opts.overlayShow) { - if (isIE) { - $('embed, object, select').css('visibility', 'hidden'); - } - - $("#fancy_overlay").css('opacity', opts.overlayOpacity).show(); - } - - _change_item(); - }; - - function _change_item() { - $("#fancy_right, #fancy_left, #fancy_close, #fancy_title, #fancy_modules").hide(); - - var href = opts.itemArray[ opts.itemCurrent ].href; - - if (href.match(/#/)) { - var target = window.location.href.split('#')[0]; target = href.replace(target, ''); target = target.substr(target.indexOf('#')); - - _set_content('
        ' + $(target).html() + '
        ', opts.frameWidth, opts.frameHeight); - - } else if (href.match(imageRegExp)) { - imagePreloader = new Image; imagePreloader.src = href; - - if (imagePreloader.complete) { - _proceed_image(); - - } else { - $.fn.fancybox.showLoading(); - - $(imagePreloader).unbind().bind('load', function() { - $(".fancy_loading").hide(); - - _proceed_image(); - }); - } - } else if (href.match("iframe") || opts.itemArray[opts.itemCurrent].fancyclass.indexOf("iframe") >= 0) { - if (href.match('w=') && href.match('h=')){ - var ifrWidth = parseInt(href.substring(href.indexOf('w=')+2,href.indexOf('xewx'))); - var ifrHeight = parseInt(href.substring(href.indexOf('h=')+2,href.indexOf('xehx'))); - }else{ - var ifrWidth= opts.frameWidth; - var ifrHeight= opts.frameHeight; - } - $("#fancy_content").empty(); - _set_content('', ifrWidth, ifrHeight); - - } else { - $.get(href, function(data) { - _set_content( '
        ' + data + '
        ', opts.frameWidth, opts.frameHeight ); - }); - } - }; - - function _proceed_image() { - if (opts.imageScale) { - var w = $.fn.fancybox.getViewport(); - - var r = Math.min(Math.min(w[0] - 36, imagePreloader.width) / imagePreloader.width, Math.min(w[1] - 60, imagePreloader.height) / imagePreloader.height); - - var width = Math.round(r * imagePreloader.width); - var height = Math.round(r * imagePreloader.height); - - } else { - var width = imagePreloader.width; - var height = imagePreloader.height; - } - - _set_content('', width, height); - }; - - function _preload_neighbor_images() { - if ((opts.itemArray.length -1) > opts.itemCurrent) { - var href = opts.itemArray[opts.itemCurrent + 1].href; - $("'); - $("#fancy_close, .fancy_bg, .fancy_title, .fancy_modules, .fancy_ico").fixPNG(); - } - }; - - $.fn.fancybox.defaults = { - padding : 10, - imageScale : true, - zoomOpacity : false, - zoomSpeedIn : 0, - zoomSpeedOut : 0, - zoomSpeedChange : 300, - easingIn : 'swing', - easingOut : 'swing', - easingChange : 'swing', - frameWidth : 425, - frameHeight : 355, - overlayShow : true, - overlayOpacity : 0.8, - hideOnContentClick : false, - centerOnScroll : true, - itemArray : [], - callbackOnStart : null, - callbackOnShow : null, - callbackOnClose : null - }; - - $(document).ready(function() { - $.fn.fancybox.build(); - }); - -// ************************************************************************************************************************************* -// ************************************************************************************************************************************* -// ************************************************************************************************************************************* -// ************************************************************************************************************************************* -// ************************************************************************************************************************************* -// ************************************************************************************************************************************* -// ************************************************************************************************************************************* -// ************************************************************************************************************************************* -// ************************************************************************************************************************************* -// ************************************************************************************************************************************* - - var modelem, modopts, modbusy = false, imagePreloader = new Image, loadingTimer, loadingFrame = 1, imageRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i; - - $.fn.modbox = function(settings) { - settings = $.extend({}, $.fn.modbox.defaults, settings); - - var matchedGroup = this; - - function _initialize() { - modelem = this; - modopts = settings; - - _start(); - - return false; - }; - - function _start() { - if (modbusy) return; - - if ($.isFunction(modopts.callbackOnStart)) { - modopts.callbackOnStart(); - } - - modopts.itemArray = []; - modopts.itemCurrent = 0; - - if (settings.itemArray.length > 0) { - modopts.itemArray = settings.itemArray; - - } else { - var item = {}; - - if (!modelem.rel || modelem.rel == '') { - var item = {href: modelem.href, title: modelem.title}; - - if ($(modelem).children("img:first").length) { - item.orig = $(modelem).children("img:first"); - } - - modopts.itemArray.push( item ); - - } else { - - var subGroup = $(matchedGroup).filter("a[rel=" + modelem.rel + "]"); - - var item = {}; - - for (var i = 0; i < subGroup.length; i++) { - item = {href: subGroup[i].href, title: subGroup[i].title}; - - if ($(subGroup[i]).children("img:first").length) { - item.orig = $(subGroup[i]).children("img:first"); - } - - modopts.itemArray.push( item ); - } - - while ( modopts.itemArray[ modopts.itemCurrent ].href != modelem.href ) { - modopts.itemCurrent++; - } - } - } - - if (modopts.overlayShow) { - if (isIE) { - $('embed, object, select').css('visibility', 'hidden'); - } - - $("#mod_overlay").css('opacity', modopts.overlayOpacity).show(); - } - - _change_item(); - }; - - function _change_item() { - $("#mod_right, #mod_left, #mod_close, #mod_title").hide(); - - var href = modopts.itemArray[ modopts.itemCurrent ].href; - - if (href.match(/#/)) { - var target = window.location.href.split('#')[0]; target = href.replace(target, ''); target = target.substr(target.indexOf('#')); - - _set_content('
        ' + $(target).html() + '
        ', modopts.frameWidth, modopts.frameHeight); - - } else if (href.match(imageRegExp)) { - imagePreloader = new Image; imagePreloader.src = href; - - if (imagePreloader.complete) { - _proceed_image(); - - } else { - $.fn.modbox.showLoading(); - - $(imagePreloader).unbind().bind('load', function() { - $(".mod_loading").hide(); - - _proceed_image(); - }); - } - - } else if (href.match("iframe") || modelem.className.indexOf("iframe") >= 0) { - _set_content('', modopts.frameWidth, modopts.frameHeight); - - } else { - $.get(href, function(data) { - _set_content( '
        ' + data + '
        ', modopts.frameWidth, modopts.frameHeight ); - }); - } - }; - - function _proceed_image() { - if (modopts.imageScale) { - var w = $.fn.modbox.getViewport(); - - var r = Math.min(Math.min(w[0] - 36, imagePreloader.width) / imagePreloader.width, Math.min(w[1] - 60, imagePreloader.height) / imagePreloader.height); - - var width = Math.round(r * imagePreloader.width); - var height = Math.round(r * imagePreloader.height); - - } else { - var width = imagePreloader.width; - var height = imagePreloader.height; - } - - _set_content('', width, height); - }; - - function _preload_neighbor_images() { - if ((modopts.itemArray.length -1) > modopts.itemCurrent) { - var href = modopts.itemArray[modopts.itemCurrent + 1].href; - - if (href.match(imageRegExp)) { - objNext = new Image(); - objNext.src = href; - } - } - - if (modopts.itemCurrent > 0) { - var href = modopts.itemArray[modopts.itemCurrent -1].href; - - if (href.match(imageRegExp)) { - objNext = new Image(); - objNext.src = href; - } - } - }; - - function _set_content(value, width, height) { - modbusy = true; - - var pad = modopts.padding; - - if (isIE) { - $("#mod_content")[0].style.removeExpression("height"); - $("#mod_content")[0].style.removeExpression("width"); - } - - if (pad > 0) { - width += pad * 2; - height += pad * 2; - - $("#mod_content").css({ - 'top' : pad + 'px', - 'right' : pad + 'px', - 'bottom' : pad + 'px', - 'left' : pad + 'px', - 'width' : 'auto', - 'height' : 'auto' - }); - - if (isIE) { - $("#mod_content")[0].style.setExpression('height', '(this.parentNode.clientHeight - 20)'); - $("#mod_content")[0].style.setExpression('width', '(this.parentNode.clientWidth - 20)'); - } - - } else { - $("#mod_content").css({ - 'top' : 0, - 'right' : 0, - 'bottom' : 0, - 'left' : 0, - 'width' : '100%', - 'height' : '100%' - }); - } - - if ($("#mod_outer").is(":visible") && width == $("#mod_outer").width() && height == $("#mod_outer").height()) { - $("#mod_content").fadeOut("fast", function() { - $("#mod_content").empty().append($(value)).fadeIn("normal", function() { - _finish(); - }); - }); - - return; - } - - var w = $.fn.modbox.getViewport(); - - var itemLeft = (width + 36) > w[0] ? w[2] : (w[2] + Math.round((w[0] - width - 36) / 2)); - var itemTop = (height + 50) > w[1] ? w[3] : (w[3] + Math.round((w[1] - height - 50) / 2)); - - var itemOpts = { - 'left': itemLeft, - 'top': itemTop, - 'width': width + 'px', - 'height': height + 'px' - }; - - if ($("#mod_outer").is(":visible")) { - $("#mod_content").fadeOut("normal", function() { - $("#mod_content").empty(); - $("#mod_outer").animate(itemOpts, modopts.zoomSpeedChange, modopts.easingChange, function() { - $("#mod_content").append($(value)).fadeIn("normal", function() { - _finish(); - }); - }); - }); - - } else { - - if (modopts.zoomSpeedIn > 0 && modopts.itemArray[modopts.itemCurrent].orig !== undefined) { - $("#mod_content").empty().append($(value)); - - var orig_item = modopts.itemArray[modopts.itemCurrent].orig; - var orig_pos = $.fn.modbox.getPosition(orig_item); - - $("#mod_outer").css({ - 'left': (orig_pos.left - 18) + 'px', - 'top': (orig_pos.top - 18) + 'px', - 'width': $(orig_item).width(), - 'height': $(orig_item).height() - }); - - if (modopts.zoomOpacity) { - itemOpts.opacity = 'show'; - } - - $("#mod_outer").animate(itemOpts, modopts.zoomSpeedIn, modopts.easingIn, function() { - _finish(); - }); - - } else { - - $("#mod_content").hide().empty().append($(value)).show(); - $("#mod_outer").css(itemOpts).fadeIn("normal", function() { - _finish(); - }); - } - } - }; - - function _set_navigation() { - if (modopts.itemCurrent != 0) { - $("#mod_left, #mod_left_ico").unbind().bind("click", function(e) { - e.stopPropagation(); - - modopts.itemCurrent--; - _change_item(); - - return false; - }); - - $("#mod_left").show(); - } - - if (modopts.itemCurrent != ( modopts.itemArray.length -1)) { - $("#mod_right, #mod_right_ico").unbind().bind("click", function(e) { - e.stopPropagation(); - - modopts.itemCurrent++; - _change_item(); - - return false; - }); - - $("#mod_right").show(); - } - }; - - function _finish() { - _set_navigation(); - - _preload_neighbor_images(); - - $(document).keydown(function(e) { - if (e.keyCode == 27) { - $.fn.modbox.close(); - $(document).unbind("keydown"); - - } else if(e.keyCode == 37 && modopts.itemCurrent != 0) { - modopts.itemCurrent--; - _change_item(); - $(document).unbind("keydown"); - - } else if(e.keyCode == 39 && modopts.itemCurrent != (modopts.itemArray.length - 1)) { - modopts.itemCurrent++; - _change_item(); - $(document).unbind("keydown"); - } - }); - - if (modopts.centerOnScroll) { - $(window).bind("resize scroll", $.fn.modbox.scrollBox); - } else { - $("div#mod_outer").css("position", "absolute"); - } - - if (modopts.hideOnContentClick) { - $("#mod_wrap").click($.fn.modbox.close); - } - - $("#mod_overlay, #mod_close").bind("click", $.fn.modbox.close); - - $("#mod_close").show(); - - if (modopts.itemArray[ modopts.itemCurrent ].title !== undefined && modopts.itemArray[ modopts.itemCurrent ].title.length > 0) { - $('#mod_title div').html(modopts.itemArray[ modopts.itemCurrent ].title); - $('#mod_title').show(); - } - - if (modopts.overlayShow && isIE) { - $('embed, object, select', $('#mod_content')).css('visibility', 'visible'); - } - - if ($.isFunction(modopts.callbackOnShow)) { - modopts.callbackOnShow(); - } - - modbusy = false; - }; - - return this.unbind('click').click(_initialize); - }; - - $.fn.modbox.scrollBox = function() { - var pos = $.fn.modbox.getViewport(); - - $("#mod_outer").css('left', (($("#mod_outer").width() + 36) > pos[0] ? pos[2] : pos[2] + Math.round((pos[0] - $("#mod_outer").width() - 36) / 2))); - $("#mod_outer").css('top', (($("#mod_outer").height() + 50) > pos[1] ? pos[3] : pos[3] + Math.round((pos[1] - $("#mod_outer").height() - 50) / 2))); - }; - - $.fn.modbox.getNumeric = function(el, prop) { - return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0; - }; - - $.fn.modbox.getPosition = function(el) { - var pos = el.offset(); - - pos.top += $.fn.modbox.getNumeric(el, 'paddingTop'); - pos.top += $.fn.modbox.getNumeric(el, 'borderTopWidth'); - - pos.left += $.fn.modbox.getNumeric(el, 'paddingLeft'); - pos.left += $.fn.modbox.getNumeric(el, 'borderLeftWidth'); - - return pos; - }; - - $.fn.modbox.showIframe = function() { - $(".mod_loading").hide(); - $("#mod_frame").show(); - }; - - $.fn.modbox.getViewport = function() { - return [$(window).width(), $(window).height(), $(document).scrollLeft(), $(document).scrollTop() ]; - }; - - $.fn.modbox.animateLoading = function() { - if (!$("#mod_loading").is(':visible')){ - clearInterval(loadingTimer); - return; - } - - $("#mod_loading > div").css('top', (loadingFrame * -40) + 'px'); - - loadingFrame = (loadingFrame + 1) % 12; - }; - - $.fn.modbox.showLoading = function() { - clearInterval(loadingTimer); - - var pos = $.fn.modbox.getViewport(); - - $("#mod_loading").css({'left': ((pos[0] - 40) / 2 + pos[2]), 'top': ((pos[1] - 40) / 2 + pos[3])}).show(); - $("#mod_loading").bind('click', $.fn.modbox.close); - - loadingTimer = setInterval($.fn.modbox.animateLoading, 66); - }; - - $.fn.modbox.close = function() { - modbusy = true; - - $(imagePreloader).unbind(); - - $("#mod_overlay, #mod_close").unbind(); - - if (modopts.hideOnContentClick) { - $("#mod_wrap").unbind(); - } - - $("#mod_close, .mod_loading, #mod_left, #mod_right, #mod_title").hide(); - - if (modopts.centerOnScroll) { - $(window).unbind("resize scroll"); - } - - __cleanup = function() { - $("#mod_overlay, #mod_outer").hide(); - - if (modopts.centerOnScroll) { - $(window).unbind("resize scroll"); - } - - if (isIE) { - $('embed, object, select').css('visibility', 'visible'); - } - - if ($.isFunction(modopts.callbackOnClose)) { - modopts.callbackOnClose(); - } - - modbusy = false; - }; - - if ($("#mod_outer").is(":visible") !== false) { - if (modopts.zoomSpeedOut > 0 && modopts.itemArray[modopts.itemCurrent].orig !== undefined) { - var orig_item = modopts.itemArray[modopts.itemCurrent].orig; - var orig_pos = $.fn.modbox.getPosition(orig_item); - - var itemOpts = { - 'left': (orig_pos.left - 18) + 'px', - 'top': (orig_pos.top - 18) + 'px', - 'width': $(orig_item).width(), - 'height': $(orig_item).height() - }; - - if (modopts.zoomOpacity) { - itemOpts.opacity = 'hide'; - } - - $("#mod_outer").stop(false, true).animate(itemOpts, modopts.zoomSpeedOut, modopts.easingOut, __cleanup); - - } else { - $("#mod_outer").stop(false, true).fadeOut("fast", __cleanup); - } - - } else { - __cleanup(); - } - - return false; - }; - - $.fn.modbox.build = function() { - var html = ''; - - html += '
        '; - - html += '
        '; - - html += '
        '; - - html += '
        '; - - html += '
        '; - - html += '
        '; - - html += '
        '; - - html += ''; - - html += '
        '; - - html += '
        '; - - html += '
        '; - - html += '
        '; - - html += '
        '; - - $(html).appendTo("body"); - - $('
        ').appendTo('#mod_title'); - - if (isIE) { - $("#mod_inner").prepend(''); - $("#mod_close, .mod_bg, .mod_title, .mod_ico").fixPNG(); - } - }; - - $.fn.modbox.defaults = { - padding : 0, - imageScale : true, - zoomOpacity : false, - zoomSpeedIn : 0, - zoomSpeedOut : 0, - zoomSpeedChange : 300, - easingIn : 'swing', - easingOut : 'swing', - easingChange : 'swing', - frameWidth : 400, - frameHeight : 400, - overlayShow : true, - overlayOpacity : 0.3, - hideOnContentClick : false, - centerOnScroll : true, - itemArray : [], - callbackOnStart : null, - callbackOnShow : null, - callbackOnClose : null - }; - - $(document).ready(function() { - $.fn.modbox.build(); - }); - -})(jQuery); \ No newline at end of file diff --git a/3.1/themes/three_nids/js/ui.init.js b/3.1/themes/three_nids/js/ui.init.js deleted file mode 100644 index 88139e22..00000000 --- a/3.1/themes/three_nids/js/ui.init.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Initialize jQuery UI and Gallery Plugin elements - */ - -$(document).ready(function() { - $(".fancyclass").fancybox(); - - // Initialize Superfish menus - $("ul.g-menu").addClass("sf-menu"); - $('ul.sf-menu').superfish({ - delay: 500, - animation: { - opacity:'show', - height:'show' - }, - speed: 'fast' - }); - $("#g-site-menu").css("display", "block"); - - // Initialize short forms - $(".g-short-form").gallery_short_form(); - - - // Initialize status message effects - $("#g-action-status li").gallery_show_message(); - - // Initialize dialogs - $("#g-login-link").addClass("g-dialog-link"); - $(".g-dialog-link").gallery_dialog(); - - // Initialize view menu - 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 button css to submit inputs - $("input[type=submit]:not(.g-short-form input)").addClass("ui-state-default ui-corner-all"); - - // Apply styles and icon classes to g-context-menu - 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(""); - $(".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(); - $(".fancyclass").fancybox(); - } - ); - } - - // Photo/Item item view lightbox - if ($("#g-item-box").length) { - $(this).gallery_context_menu(); - } - - - // Photo/Item item view - if ($("#g-item").length) { - // Ensure the resized image fits within its container - $("#g-item").gallery_fit_photo(); - - // Initialize context menus - var resize = $("#g-item").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/3.1/themes/three_nids/theme.info b/3.1/themes/three_nids/theme.info deleted file mode 100644 index 4fb28616..00000000 --- a/3.1/themes/three_nids/theme.info +++ /dev/null @@ -1,10 +0,0 @@ -name = "3nids theme" -description = "Default theme modified using jquery lightbox slideshow." -version = 2 -author = "3nids" -site = 1 -admin = 0 -author_name = "" -author_url = "" -info_url = "http://codex.gallery2.org/Gallery3:Themes:three_nids" -discuss_url = "http://gallery.menalto.com/forum_theme_three_nids" diff --git a/3.1/themes/three_nids/thumbnail.png b/3.1/themes/three_nids/thumbnail.png deleted file mode 100644 index 3b7bcfec..00000000 Binary files a/3.1/themes/three_nids/thumbnail.png and /dev/null differ diff --git a/3.1/themes/three_nids/views/album.html.php b/3.1/themes/three_nids/views/album.html.php deleted file mode 100644 index ab67f100..00000000 --- a/3.1/themes/three_nids/views/album.html.php +++ /dev/null @@ -1,51 +0,0 @@ - - -
        - album_top() ?> -

        title) ?>

        -
        description)) ?>
        -
        -viewable()->children(); -$theme->pagination = new Pagination(); -$theme->pagination->initialize( - array("query_string" => "page", "total_items" => $children_count, "items_per_page" => $page_size, "style" => "classic")); -$children_offset = ($theme->pagination->current_page -1) * $page_size ; -?> -
          - - - - - - - $child): ?> - - is_album()): ?> - - -
        • - thumb_top($child) ?> - - thumb_bottom($child) ?> - context_menu($child, "#g-item-id-{$child->id} .g-thumbnail") ?> -
        • - - - - - - - - admin || access::can("add", $item)): ?> - id") ?> -
        • Add some.", - array("attrs" => html::mark_clean("href=\"$addurl\" class=\"g-dialog-link\""))) ?>
        • - -
        • - - -
        -album_bottom() ?> - -paginator() ?> diff --git a/3.1/themes/three_nids/views/block.html.php b/3.1/themes/three_nids/views/block.html.php deleted file mode 100644 index 699d7c22..00000000 --- a/3.1/themes/three_nids/views/block.html.php +++ /dev/null @@ -1,10 +0,0 @@ - - - - -
        -

        -
        - -
        -
        diff --git a/3.1/themes/three_nids/views/comments.html.php b/3.1/themes/three_nids/views/comments.html.php deleted file mode 100644 index 5086aceb..00000000 --- a/3.1/themes/three_nids/views/comments.html.php +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - css("yui/reset-fonts-grids.css") ?> - css("superfish/css/superfish.css") ?> - css("themeroller/ui.base.css") ?> - css("gallery.common.css") ?> - css("jquery.fancybox.css") ?> - css("screen.css") ?> - css("three_nids.css") ?> - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("jquery.localscroll.js") ?> - script("jquery.easing.js") ?> - script("jquery.fancybox.js") ?> - script("ui.init.js") ?> - head() ?> - - -
        - thumb_img() ?> -
        - id}") ?>" id="g-admin-comment-button" - class="g-button ui-corner-all ui-icon-left ui-state-default right"> - - - -
        - count()): ?> -

        - -

        - -
          - -
        • - %name %date: ', - array("date" => date(module::get_var("gallery", "date_time_format", "Y-M-d H:i:s"), $comment->created), - "name" => html::clean($comment->author_name()))); ?> -
          - text)) ?> -
          -
        • - -
        -
        - - diff --git a/3.1/themes/three_nids/views/dynamic.html.php b/3.1/themes/three_nids/views/dynamic.html.php deleted file mode 100644 index 7c0e7131..00000000 --- a/3.1/themes/three_nids/views/dynamic.html.php +++ /dev/null @@ -1,37 +0,0 @@ - -
        -
        - dynamic_top() ?> -
        -

        -
        -items(); - $theme->pagination = new Pagination(); - $theme->pagination->initialize(array("query_string" => "page","total_items" => $children_count,"items_per_page" => $page_size,"style" => "classic")); - $children_offset = ($theme->pagination->current_page -1) * $page_size ; ?> - - -
          - - - - - - $child): ?> - - -
        • - thumb_top($child) ?> - - thumb_bottom($child) ?> - context_menu($child, "#g-ItemId-{$child->id} .g-Thumbnail") ?> -
        • - -
        - - - - -dynamic_bottom() ?> - -paginator() ?> diff --git a/3.1/themes/three_nids/views/exif_dialog.html.php b/3.1/themes/three_nids/views/exif_dialog.html.php deleted file mode 100644 index 8ce20cc3..00000000 --- a/3.1/themes/three_nids/views/exif_dialog.html.php +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - -
        -
        - - - - - - - - - - - - - - - -
        - - - - - - - -
        -
        -
        - - diff --git a/3.1/themes/three_nids/views/image_block_block.html.php b/3.1/themes/three_nids/views/image_block_block.html.php deleted file mode 100644 index 0b56af20..00000000 --- a/3.1/themes/three_nids/views/image_block_block.html.php +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/3.1/themes/three_nids/views/movie.html.php b/3.1/themes/three_nids/views/movie.html.php deleted file mode 100644 index 3ebe0632..00000000 --- a/3.1/themes/three_nids/views/movie.html.php +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - css("yui/reset-fonts-grids.css") ?> - css("superfish/css/superfish.css") ?> - css("themeroller/ui.base.css") ?> - css("gallery.common.css") ?> - css("jquery.fancybox.css") ?> - css("screen.css") ?> - css("three_nids.css") ?> - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("jquery.localscroll.js") ?> - script("jquery.easing.js") ?> - script("jquery.fancybox.js") ?> - script("ui.init.js") ?> - script("flowplayer.js") ?> - head() ?> - - -
        -
        - movie_img( - array("class" => "g-movie", "id" => "g-movie-id-{$item->id}", - "style" => "display:block;width:{$item->width}px;height:{$item->height}px")) ?> - context_menu($item, "#g-movie-id-{$item->id}") ?> -
        -

        title) ?>

        -
        description)) ?>
        -
        -
        - - diff --git a/3.1/themes/three_nids/views/no_sidebar.html.php b/3.1/themes/three_nids/views/no_sidebar.html.php deleted file mode 100644 index 378bd971..00000000 --- a/3.1/themes/three_nids/views/no_sidebar.html.php +++ /dev/null @@ -1,6 +0,0 @@ - -
          -
        • - Add blocks", - array("url" => html::mark_clean(url::site("admin/sidebar")))) ?>
        • -
        diff --git a/3.1/themes/three_nids/views/page.html.php b/3.1/themes/three_nids/views/page.html.php deleted file mode 100644 index ae0e1b16..00000000 --- a/3.1/themes/three_nids/views/page.html.php +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - - <? if ($page_title): ?> - <?= $page_title ?> - <? else: ?> - <? if ($theme->item()): ?> - <? if ($theme->item()->is_album()): ?> - <?= t("Gallery :: %album_title", array("album_title" => $theme->item()->title)) ?> - <? elseif ($theme->item()->is_photo()): ?> - <?= t("Gallery :: %photo_title", array("photo_title" => $theme->item()->title)) ?> - <? else: ?> - <?= t("Gallery :: %movie_title", array("movie_title" => $theme->item()->title)) ?> - <? endif ?> - <? elseif ($theme->tag()): ?> - <?= t("Gallery :: %tag_title", array("tag_title" => $theme->tag()->name)) ?> - <? else: /* Not an item, not a tag, no page_title specified. Help! */ ?> - <?= t("Gallery") ?> - <? endif ?> - <? endif ?> - - " type="image/x-icon" /> - css("yui/reset-fonts-grids.css") ?> - css("superfish/css/superfish.css") ?> - css("themeroller/ui.base.css") ?> - css("jquery.fancybox.css") ?> - css("screen.css") ?> - css("three_nids.css") ?> - - page_type == 'collection'): ?> - - - - - - - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("jquery.localscroll.js") ?> - script("jquery.easing.js") ?> - script("jquery.fancybox.js") ?> - script("ui.init.js") ?> - - head() they get combined */ ?> - page_subtype == "photo"): ?> - script("jquery.scrollTo.js") ?> - script("gallery.show_full_size.js") ?> - page_subtype == "movie"): ?> - script("flowplayer.js") ?> - - - head() ?> - - - body_attributes() ?>> - page_top() ?> -
        - site_status() ?> -
        -
        - user_menu() ?> - header_top() ?> - - - - - -
        - admin): ?> - site_menu("#g-item-img") ?> - -
        - header_bottom() ?> -
        - - - - tag()): ?> -
          -
        • - - - -
        • -
        • tag()->name) ?>
        • -
        - - - - - - - -
        -
        -
        -
        -
        - messages() ?> - -
        -
        -
        -
        - page_subtype != "login"): ?> - - -
        -
        - -
        - page_bottom() ?> - - diff --git a/3.1/themes/three_nids/views/paginator.html.php b/3.1/themes/three_nids/views/paginator.html.php deleted file mode 100644 index 5034c965..00000000 --- a/3.1/themes/three_nids/views/paginator.html.php +++ /dev/null @@ -1,87 +0,0 @@ - - - -
          -
        • - - - - - - - - - - - - - - - - - -
        • - -
        • - - - $first_visible_position, - "to_number" => $last_visible_position, - "count" => $total)) ?> - - $position, "total" => $total)) ?> - - - - -
        • - -
        • - - - - - - - - - - - - - - - - - -
        • -
        diff --git a/3.1/themes/three_nids/views/photo.html.php b/3.1/themes/three_nids/views/photo.html.php deleted file mode 100644 index 80a499b6..00000000 --- a/3.1/themes/three_nids/views/photo.html.php +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - css("yui/reset-fonts-grids.css") ?> - css("superfish/css/superfish.css") ?> - css("themeroller/ui.base.css") ?> - css("gallery.common.css") ?> - css("jquery.fancybox.css") ?> - css("screen.css") ?> - css("three_nids.css") ?> - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("superfish/js/superfish.js") ?> - script("jquery.localscroll.js") ?> - script("jquery.easing.js") ?> - script("jquery.fancybox.js") ?> - script("ui.init.js") ?> - head() ?> - - -
        - - - - - - - context_menu($item, "#g-item-id-{$item->id}") ?> -
        - - diff --git a/3.1/themes/three_nids/views/search.html.php b/3.1/themes/three_nids/views/search.html.php deleted file mode 100644 index 0699decd..00000000 --- a/3.1/themes/three_nids/views/search.html.php +++ /dev/null @@ -1,39 +0,0 @@ - - - -pagination = new Pagination(); - $theme->pagination->initialize(array("query_string" => "page","total_items" => $children_count_true,"items_per_page" => $page_size,"style" => "classic")); - $children_offset = ($theme->pagination->current_page -1) * $page_size ; ?> - -
        -

        %term", array("term" => $q)) ?>

        - - -
          - - - - - -
        • - thumb_top($child) ?> - - thumb_bottom($child) ?> - context_menu($child, "#g-item-id-{$child->id} .g-thumbnail") ?> -
        • - - - - - -
        - paginator() ?> - - -

        - %term", array("term" => $q)) ?> -

        - - -
        diff --git a/3.1/themes/three_nids/views/sidebar.html.php b/3.1/themes/three_nids/views/sidebar.html.php deleted file mode 100644 index 54f1d00d..00000000 --- a/3.1/themes/three_nids/views/sidebar.html.php +++ /dev/null @@ -1,18 +0,0 @@ - -sidebar_top() ?> -
        -
        - - album_menu() ?> - - photo_menu() ?> - - movie_menu() ?> - - tag_menu() ?> - -
        -
        - -sidebar_blocks() ?> -sidebar_bottom() ?>