From a6581ede0b7a50c6159eb5d36cf6be340a072609 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 21 Sep 2009 11:35:27 -0700 Subject: Fix Item_Model::get_position() so that our sort is stable when the comparison row has a null value in the sort field. Fix for #627 Note: this changes get_position() to take an Item_Model instead of an id! --- modules/gallery/controllers/albums.php | 15 +++++---- modules/gallery/controllers/photos.php | 2 +- modules/gallery/models/item.php | 61 +++++++++++++++++++++------------- 3 files changed, 47 insertions(+), 31 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index 183c26d0..3ea08538 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -39,12 +39,15 @@ class Albums_Controller extends Items_Controller { $show = $this->input->get("show"); if ($show) { - $index = $album->get_position($show); - $page = ceil($index / $page_size); - if ($page == 1) { - url::redirect($album->abs_url()); - } else { - url::redirect($album->abs_url("page=$page")); + $child = ORM::factory("item", $show); + $index = $album->get_position($child); + if ($index) { + $page = ceil($index / $page_size); + if ($page == 1) { + url::redirect($album->abs_url()); + } else { + url::redirect($album->abs_url("page=$page")); + } } } diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php index 79ad674a..e6154535 100644 --- a/modules/gallery/controllers/photos.php +++ b/modules/gallery/controllers/photos.php @@ -25,7 +25,7 @@ class Photos_Controller extends Items_Controller { public function _show($photo) { access::required("view", $photo); - $position = $photo->parent()->get_position($photo->id); + $position = $photo->parent()->get_position($photo); if ($position > 1) { list ($previous_item, $ignore, $next_item) = $photo->parent()->children(3, $position - 2); diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index da1f6959..3cc9dd53 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -412,38 +412,51 @@ class Item_Model extends ORM_MPTT { * 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_id) { + public function get_position($child) { if ($this->sort_order == "DESC") { $comp = ">"; } else { $comp = "<"; } - $db = Database::instance(); - $position = $db->query(" - SELECT COUNT(*) AS position FROM {items} - WHERE `parent_id` = {$this->id} - AND `{$this->sort_column}` $comp (SELECT `{$this->sort_column}` - FROM {items} WHERE `id` = $child_id)") - ->current()->position; - - // 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. - $result = $db->query(" - SELECT id FROM {items} - WHERE `parent_id` = {$this->id} - AND `{$this->sort_column}` = (SELECT `{$this->sort_column}` - FROM {items} WHERE `id` = $child_id) - ORDER BY `id` ASC"); + + // We can't use isset() in this comparison because ORM::__get() confuses it. + if ($child->{$this->sort_column} !== null) { + $position = $db->query(" + SELECT COUNT(*) AS position FROM {items} + WHERE `parent_id` = {$this->id} + AND `{$this->sort_column}` $comp (SELECT `{$this->sort_column}` + FROM {items} WHERE `id` = $child->id)") + ->current()->position; + + // 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. + $result = $db->query(" + SELECT id FROM {items} + WHERE `parent_id` = {$this->id} + AND `{$this->sort_column}` = (SELECT `{$this->sort_column}` + FROM {items} WHERE `id` = $child->id) + ORDER BY `id` ASC"); + } else { + // If the sort value is null, then we can't take the approach of doing a comparison to get + // most of the way there. We have to iterate the entire data set. + $position = 0; + $result = $db->query(" + SELECT id FROM {items} + WHERE `parent_id` = {$this->id} + AND `{$this->sort_column}` IS NULL + ORDER BY `id` ASC"); + } + foreach ($result as $row) { $position++; - if ($row->id == $child_id) { + if ($row->id == $child->id) { break; } } -- cgit v1.2.3 From 9e6be40e31b06e5dffe7552928cb8b2d9ee7ad59 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 21 Sep 2009 20:47:55 -0700 Subject: Add viewable() protection to children() and children_count() calls. This is not currently necessary (nor is it a security hole) because we don't constrain permissions at the child level in the core, but it makes our security audits easier and will enable the scenario where somebody writes a module to add per-photo permissions. --- modules/gallery/controllers/photos.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php index e6154535..3de9b3ee 100644 --- a/modules/gallery/controllers/photos.php +++ b/modules/gallery/controllers/photos.php @@ -31,7 +31,7 @@ class Photos_Controller extends Items_Controller { $photo->parent()->children(3, $position - 2); } else { $previous_item = null; - list ($next_item) = $photo->parent()->children(1, $position); + list ($next_item) = $photo->parent()->viewable()->children(1, $position); } $template = new Theme_View("page.html", "photo"); @@ -41,7 +41,7 @@ class Photos_Controller extends Items_Controller { $template->set_global("parents", $photo->parents()); $template->set_global("next_item", $next_item); $template->set_global("previous_item", $previous_item); - $template->set_global("sibling_count", $photo->parent()->children_count()); + $template->set_global("sibling_count", $photo->parent()->viewable()->children_count()); $template->set_global("position", $position); $template->content = new View("photo.html"); -- cgit v1.2.3 From 88350c5b88abb8bfc56b26177b64e049f6b7440f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 21 Sep 2009 21:21:52 -0700 Subject: Update the next/previous item calculations to match what we do in photos.php Force the children_count to be zero, movies have no children. Rename $photo to $movie everywhere. --- modules/gallery/controllers/movies.php | 86 +++++++++++++++------------------- 1 file changed, 38 insertions(+), 48 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/movies.php b/modules/gallery/controllers/movies.php index 04e15315..fa07668e 100644 --- a/modules/gallery/controllers/movies.php +++ b/modules/gallery/controllers/movies.php @@ -22,42 +22,32 @@ class Movies_Controller extends Items_Controller { /** * @see REST_Controller::_show($resource) */ - public function _show($photo) { - access::required("view", $photo); + public function _show($movie) { + access::required("view", $movie); - // We sort by id ascending so for now, find sibling info by doing id based queries. - $next_item = ORM::factory("item") - ->viewable() - ->where("parent_id", $photo->parent_id) - ->where("id >", $photo->id) - ->orderby("id", "ASC") - ->find(); - $previous_item = ORM::factory("item") - ->viewable() - ->where("parent_id", $photo->parent_id) - ->where("id <", $photo->id) - ->orderby("id", "DESC") - ->find(); - $position = ORM::factory("item") - ->viewable() - ->where("parent_id", $photo->parent_id) - ->where("id <=", $photo->id) - ->count_all(); + $position = $movie->parent()->get_position($movie); + if ($position > 1) { + list ($previous_item, $ignore, $next_item) = + $movie->parent()->children(3, $position - 2); + } else { + $previous_item = null; + list ($next_item) = $movie->parent()->viewable()->children(1, $position); + } $template = new Theme_View("page.html", "movie"); - $template->set_global("item", $photo); + $template->set_global("item", $movie); $template->set_global("children", array()); - $template->set_global("children_count", $photo->children_count()); - $template->set_global("parents", $photo->parents()); - $template->set_global("next_item", $next_item->loaded ? $next_item : null); - $template->set_global("previous_item", $previous_item->loaded ? $previous_item : null); - $template->set_global("sibling_count", $photo->parent()->children_count()); + $template->set_global("children_count", 0); + $template->set_global("parents", $movie->parents()); + $template->set_global("next_item", $next_item); + $template->set_global("previous_item", $previous_item); + $template->set_global("sibling_count", $movie->parent()->viewable()->children_count()); $template->set_global("position", $position); $template->content = new View("movie.html"); - $photo->view_count++; - $photo->save(); + $movie->view_count++; + $movie->save(); print $template; } @@ -65,21 +55,21 @@ class Movies_Controller extends Items_Controller { /** * @see REST_Controller::_update($resource) */ - public function _update($photo) { + public function _update($movie) { access::verify_csrf(); - access::required("view", $photo); - access::required("edit", $photo); + access::required("view", $movie); + access::required("edit", $movie); - $form = photo::get_edit_form($photo); + $form = photo::get_edit_form($movie); if ($valid = $form->validate()) { - if ($form->edit_item->filename->value != $photo->name || - $form->edit_item->slug->value != $photo->slug) { + if ($form->edit_item->filename->value != $movie->name || + $form->edit_item->slug->value != $movie->slug) { // Make sure that there's not a name or slug conflict if ($row = Database::instance() ->select(array("name", "slug")) ->from("items") - ->where("parent_id", $photo->parent_id) - ->where("id <>", $photo->id) + ->where("parent_id", $movie->parent_id) + ->where("id <>", $movie->id) ->open_paren() ->where("name", $form->edit_item->filename->value) ->orwhere("slug", $form->edit_item->slug->value) @@ -98,16 +88,16 @@ class Movies_Controller extends Items_Controller { } if ($valid) { - $photo->title = $form->edit_item->title->value; - $photo->description = $form->edit_item->description->value; - $photo->slug = $form->edit_item->slug->value; - $photo->rename($form->edit_item->filename->value); - $photo->save(); - module::event("item_edit_form_completed", $photo, $form); + $movie->title = $form->edit_item->title->value; + $movie->description = $form->edit_item->description->value; + $movie->slug = $form->edit_item->slug->value; + $movie->rename($form->edit_item->filename->value); + $movie->save(); + module::event("item_edit_form_completed", $movie, $form); - log::success("content", "Updated movie", "url()}\">view"); + log::success("content", "Updated movie", "url()}\">view"); message::success( - t("Saved movie %movie_title", array("movie_title" => $photo->title))); + t("Saved movie %movie_title", array("movie_title" => $movie->title))); print json_encode( array("result" => "success")); @@ -121,9 +111,9 @@ class Movies_Controller extends Items_Controller { /** * @see REST_Controller::_form_edit($resource) */ - public function _form_edit($photo) { - access::required("view", $photo); - access::required("edit", $photo); - print photo::get_edit_form($photo); + public function _form_edit($movie) { + access::required("view", $movie); + access::required("edit", $movie); + print photo::get_edit_form($movie); } } -- cgit v1.2.3 From 123afc954281c1f924f851a33ae5016774e6d9f3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 21 Sep 2009 21:22:07 -0700 Subject: Set children_count to 0, photos have no children. --- modules/gallery/controllers/photos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php index 3de9b3ee..81e7519e 100644 --- a/modules/gallery/controllers/photos.php +++ b/modules/gallery/controllers/photos.php @@ -37,7 +37,7 @@ class Photos_Controller extends Items_Controller { $template = new Theme_View("page.html", "photo"); $template->set_global("item", $photo); $template->set_global("children", array()); - $template->set_global("children_count", $photo->children_count()); + $template->set_global("children_count", 0); $template->set_global("parents", $photo->parents()); $template->set_global("next_item", $next_item); $template->set_global("previous_item", $previous_item); -- cgit v1.2.3 From 529ded3388673036314eefd5bfb1cfc0b76f7f9e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 21 Sep 2009 21:28:00 -0700 Subject: 2nd attempt at gracefully dealing with sort columns that contain nulls. This time around, do a query to determine whether or not the sort column has nulls in it. If it doesn't, then use our comparators as before. 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. Fixes #627 --- modules/gallery/models/item.php | 60 ++++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 15 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 3cc9dd53..d1c6feb9 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -420,8 +420,15 @@ class Item_Model extends ORM_MPTT { } $db = Database::instance(); - // We can't use isset() in this comparison because ORM::__get() confuses it. - if ($child->{$this->sort_column} !== null) { + // 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, NULL) + ->count_records(); + + if (empty($count)) { + // There are no NULLs in the sort column, so we can just use it directly. $position = $db->query(" SELECT COUNT(*) AS position FROM {items} WHERE `parent_id` = {$this->id} @@ -443,21 +450,36 @@ class Item_Model extends ORM_MPTT { AND `{$this->sort_column}` = (SELECT `{$this->sort_column}` FROM {items} WHERE `id` = $child->id) ORDER BY `id` ASC"); + foreach ($result as $row) { + $position++; + if ($row->id == $child->id) { + break; + } + } } else { - // If the sort value is null, then we can't take the approach of doing a comparison to get - // most of the way there. We have to iterate the entire data set. - $position = 0; - $result = $db->query(" - SELECT id FROM {items} - WHERE `parent_id` = {$this->id} - AND `{$this->sort_column}` IS NULL - ORDER BY `id` ASC"); - } + // 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. + $orderby = array($this->sort_column => $this->sort_order); + // Use id as a tie breaker + if ($this->sort_column != "id") { + $orderby["id"] = "ASC"; + } - foreach ($result as $row) { - $position++; - if ($row->id == $child->id) { - break; + $position = 0; + foreach ($db->select("id") + ->from("items") + ->where("parent_id", $this->id) + ->orderby($orderby) + ->get() as $row) { + $position++; + if ($row->id == $child->id) { + break; + } } } @@ -564,6 +586,10 @@ class Item_Model extends ORM_MPTT { function children($limit=null, $offset=0, $where=array(), $orderby=null) { if (empty($orderby)) { $orderby = array($this->sort_column => $this->sort_order); + // Use id as a tie breaker + if ($this->sort_column != "id") { + $orderby["id"] = "ASC"; + } } return parent::children($limit, $offset, $where, $orderby); } @@ -582,6 +608,10 @@ class Item_Model extends ORM_MPTT { function descendants($limit=null, $offset=0, $where=array(), $orderby=null) { if (empty($orderby)) { $orderby = array($this->sort_column => $this->sort_order); + // Use id as a tie breaker + if ($this->sort_column != "id") { + $orderby["id"] = "ASC"; + } } return parent::descendants($limit, $offset, $where, $orderby); } -- cgit v1.2.3 From f1366d275e007141a28a933a6221c6337d7aa1d7 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 22 Sep 2009 08:46:07 -0700 Subject: Issue an information message if the user clicks "Save Settings" indicating that the key was not changed as it as identical. This addresses the obscure issue raised in ticket #756 --- modules/gallery/controllers/admin_languages.php | 32 +++++++++++++------------ 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/admin_languages.php b/modules/gallery/controllers/admin_languages.php index d91e5205..42968b43 100644 --- a/modules/gallery/controllers/admin_languages.php +++ b/modules/gallery/controllers/admin_languages.php @@ -24,7 +24,7 @@ class Admin_Languages_Controller extends Admin_Controller { $v->content->available_locales = locales::available(); $v->content->installed_locales = locales::installed(); $v->content->default_locale = module::get_var("gallery", "default_locale"); - + if (empty($share_translations_form)) { $share_translations_form = $this->_share_translations_form(); } @@ -35,21 +35,21 @@ class Admin_Languages_Controller extends Admin_Controller { public function save() { access::verify_csrf(); - - locales::update_installed($this->input->post("installed_locales")); - - $installed_locales = array_keys(locales::installed()); + + locales::update_installed($this->input->post("installed_locales")); + + $installed_locales = array_keys(locales::installed()); $new_default_locale = $this->input->post("default_locale"); - if (!in_array($new_default_locale, $installed_locales)) { - if (!empty($installed_locales)) { - $new_default_locale = $installed_locales[0]; - } else { - $new_default_locale = "en_US"; - } - } - module::set_var("gallery", "default_locale", $new_default_locale); - - print json_encode(array("result" => "success")); + if (!in_array($new_default_locale, $installed_locales)) { + if (!empty($installed_locales)) { + $new_default_locale = $installed_locales[0]; + } else { + $new_default_locale = "en_US"; + } + } + module::set_var("gallery", "default_locale", $new_default_locale); + + print json_encode(array("result" => "success")); } public function share() { @@ -88,6 +88,8 @@ class Admin_Languages_Controller extends Admin_Controller { message::success(t("Your API key has been changed.")); } else if (!$old_key && $new_key) { message::success(t("Your API key has been saved.")); + } else if ($old_key && $new_key && $old_key == $new_key) { + message::info(t("Your API key was not changed as it was identical to the current key.")); } log::success(t("gallery"), t("l10n_client API key changed.")); -- cgit v1.2.3 From bec620487af86f566dc7a82549cd4dcb1cf99c9a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 22 Sep 2009 09:48:24 -0700 Subject: Wrap the login form with a view in order to include a forgot password link. Fixes ticket #620 --- modules/gallery/controllers/albums.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index 3ea08538..694cc4ff 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -28,7 +28,9 @@ class Albums_Controller extends Items_Controller { if ($album->id == 1) { $view = new Theme_View("page.html", "login"); $view->page_title = t("Log in to Gallery"); - $view->content = user::get_login_form("login/auth_html"); + //$view->content = user::get_login_form("login/auth_html"); + $view->content = new View("login_ajax.html"); + $view->content->form = user::get_login_form("login/auth_html"); print $view; return; } else { -- cgit v1.2.3 From 28060d9dce3128cb0254d61a66d865fe8f4e1583 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 22 Sep 2009 14:25:52 -0700 Subject: Create a gallery error handler that traps php errors and rethrows them as Exceptions. This fixes ticket #763 --- modules/gallery/helpers/gallery_error.php | 32 +++++++++++++++++++++++++++++++ modules/gallery/hooks/init_gallery.php | 3 +++ 2 files changed, 35 insertions(+) create mode 100644 modules/gallery/helpers/gallery_error.php (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/gallery_error.php b/modules/gallery/helpers/gallery_error.php new file mode 100644 index 00000000..91e05407 --- /dev/null +++ b/modules/gallery/helpers/gallery_error.php @@ -0,0 +1,32 @@ +getMessage()); + Kohana::log("error", $e->__toString()); + } + } +} \ No newline at end of file diff --git a/modules/gallery/hooks/init_gallery.php b/modules/gallery/hooks/init_gallery.php index 5735e7dc..da7eeb0f 100644 --- a/modules/gallery/hooks/init_gallery.php +++ b/modules/gallery/hooks/init_gallery.php @@ -32,6 +32,9 @@ Event::add("system.post_routing", array("url", "parse_url")); Event::add("system.post_routing", array("gallery", "maintenance_mode")); Event::add("system.shutdown", array("gallery", "shutdown")); +// @todo once we convert to Kohana 2.4 this doesn't have to be here +set_error_handler(array("gallery_error", "error_handler")); + // Override the cookie if we have a session id in the URL. // @todo This should probably be an event callback $input = Input::instance(); -- cgit v1.2.3 From 91c99c9627c8a6352054200d242fd81e963a1c73 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 22 Sep 2009 20:36:12 -0700 Subject: Simplify the "unchanged" status message. --- modules/gallery/controllers/admin_languages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/admin_languages.php b/modules/gallery/controllers/admin_languages.php index 42968b43..a9693d21 100644 --- a/modules/gallery/controllers/admin_languages.php +++ b/modules/gallery/controllers/admin_languages.php @@ -89,7 +89,7 @@ class Admin_Languages_Controller extends Admin_Controller { } else if (!$old_key && $new_key) { message::success(t("Your API key has been saved.")); } else if ($old_key && $new_key && $old_key == $new_key) { - message::info(t("Your API key was not changed as it was identical to the current key.")); + message::info(t("Your API key was not changed.")); } log::success(t("gallery"), t("l10n_client API key changed.")); -- cgit v1.2.3 From faee4391a3283dbafc0ec101b4902fd01bc2e329 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 23 Sep 2009 07:12:17 -0700 Subject: Remove a commented line I forgot to take out --- modules/gallery/controllers/albums.php | 1 - 1 file changed, 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index 694cc4ff..9733d1cd 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -28,7 +28,6 @@ class Albums_Controller extends Items_Controller { if ($album->id == 1) { $view = new Theme_View("page.html", "login"); $view->page_title = t("Log in to Gallery"); - //$view->content = user::get_login_form("login/auth_html"); $view->content = new View("login_ajax.html"); $view->content->form = user::get_login_form("login/auth_html"); print $view; -- cgit v1.2.3 From bdb6b17bf5d3929d6d762bf605f25f944b393e62 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 23 Sep 2009 09:09:45 -0700 Subject: Correct whitespace --- modules/gallery/views/admin_maintenance_show_log.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/views/admin_maintenance_show_log.html.php b/modules/gallery/views/admin_maintenance_show_log.html.php index 8ea1beb6..2dfef90f 100644 --- a/modules/gallery/views/admin_maintenance_show_log.html.php +++ b/modules/gallery/views/admin_maintenance_show_log.html.php @@ -2,8 +2,8 @@ - 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() ?> -
    -
  • abs_url(), "← ".t("Back to the Gallery")) ?>
  • - -
- - - admin_header_bottom() ?> -
-
-
-
-
- messages() ?> - -
-
-
- -
- -
- -
-
- admin_footer() ?> -
- admin_credits() ?> -
-
-
- admin_page_bottom() ?> - - diff --git a/themes/admin_default/views/block.html.php b/themes/admin_default/views/block.html.php deleted file mode 100644 index 6cbea76e..00000000 --- a/themes/admin_default/views/block.html.php +++ /dev/null @@ -1,18 +0,0 @@ - - - - - diff --git a/themes/admin_default/views/pager.html.php b/themes/admin_default/views/pager.html.php deleted file mode 100644 index 5034ec19..00000000 --- a/themes/admin_default/views/pager.html.php +++ /dev/null @@ -1,44 +0,0 @@ - - -
    - $current_first_item, - "to_number" => $current_last_item, - "count" => $total_items)) ?> -
  • - - - - - - - - - - - - - - -
  • -
  • -
  • - - - - - - - - - - - - - - -
  • -
diff --git a/themes/admin_wind/css/fix-ie.css b/themes/admin_wind/css/fix-ie.css new file mode 100644 index 00000000..6bc2334c --- /dev/null +++ b/themes/admin_wind/css/fix-ie.css @@ -0,0 +1,18 @@ +/** + * Fix display in IE 6 and 7 + */ + +#gHeader, +#gGroupAdmin, +#gDeveloperTools, +.gAvailable .gBlock { + zoom: 1; +} + +.gUnavailable { + filter: alpha(opacity=40); +} + +.gUnavailable:hover { + filter: alpha(opacity=100); +} diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css new file mode 100644 index 00000000..de6d436e --- /dev/null +++ b/themes/admin_wind/css/screen.css @@ -0,0 +1,1170 @@ +/** + * Gallery 3 Default Theme Screen Styles + * + * @requires YUI reset, font, grids CSS + * + * Sheet organization: + * 1) Basic HTML elements + * 2) Reusable classes + * 3) Reusable content blocks + * 4) Page layout containers + * 5) Content blocks in specific layout containers + * 6) Navigation and menus + * 7) Browser hacks + * 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; +} + +p { + margin-bottom: 1em; +} + +em { + font-style: oblique; +} + +h1, h2, h3, h4, h5, strong, th { + font-weight: bold; +} + +h1 { + font-size: 1.7em; +} + +#gSearchResults h1 { + margin-bottom: 1em; +} + +#gProgress h1 { + font-size: 1.1em; +} + +h2 { + font-size: 1.4em; +} + +#gSidebar .gBlock h2 { + font-size: 1.2em; +} + +#gSidebar .gBlock li { + margin-bottom: .6em; +} + +h3 { + font-size: 1.2em; +} + +/* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +a, +.gMenu a, +#gDialog a, +.gButtonLink, +.gButtonLink:hover, +.gButtonLink:active, +a.ui-state-hover, +input.ui-state-hover, +button.ui-state-hover { + color: #5382BF !important; + text-decoration: none; + -moz-outline-style: none; +} + +a:hover, +#gDialog a:hover { + text-decoration: underline; +} + +.gMenu a:hover { + text-decoration: none; +} + +#gDialog .gCancel { + clear: none; + float: left; + margin: .3em 1em; +} + +#gForgotPasswordLink { + float: right; + font-size: .9em; +} + +#gDialog .gCancel { + float: left; +} + +/* Tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +table { + width: 100%; +} + +#gContent table { + margin: 1em 0 3em 0; +} + +caption, +th { + text-align: left; +} + +th, +td { + border: none; + border-bottom: 1px solid #ccc; + padding: .5em; + vertical-align: top; +} + +#gAdminMaintenance td { + vertical-align: middle; +} + +/* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +fieldset { + border: 1px solid #ccc; + padding-bottom: .8em; +} + +#gHeader fieldset, +#gSidebar fieldset, +.gShortForm fieldset { + border: none; +} + +legend { + font-weight: bold; + margin-left: 1em; +} + +#gHeader legend, +#gSidebar legend, +#gContent #gSearchForm legend, +input[type="hidden"], +.gShortForm 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: 100%; + 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 ~~~~~~~~~~~~~~~~~~~~~~~ */ + +.gValidationRule { + font-size: 80%; + margin-top: .5em; +} + +form.gError input[type="text"], +li.gError input[type="text"], +form.gError input[type="password"], +li.gError input[type="password"], +form.gError input[type="checkbox"], +li.gError input[type="checkbox"], +form.gError input[type="radio"], +li.gError input[type="radio"], +form.gError textarea, +li.gError textarea, +form.gError select, +li.gError select { + border: 2px solid red; +} + +/** ******************************************************************* + * 2) Reusable generic classes + *********************************************************************/ + +.inactive, .understate { + color: #ccc; + font-weight: normal; +} + +.left { + float: left; + margin: 1em 1em 1em 0; +} + +.right { + float: right; + margin: 1em 0 1em 1em; +} + +.txtright { + text-align: right; +} + +/** ******************************************************************* + * 3) Reusable content blocks + *********************************************************************/ + +.gBlock { + background-color: #fff; + border: 1px solid #ccc; + clear: both; + margin-bottom: 2.5em; + padding: 1em; +} + +#gSidebar .gBlockContent { + padding: 0; +} + +.gBlock h2 { + background-color: #e8e8e8; + padding: .3em .8em; +} + +.gBlockContent { + margin-top: 1em; +} + +.gSelected img, +.gAvailable .gBlock img { + float: left; + margin: 0 1em 1em 0; +} + +.rtl .gSelected img, +.rtl .gAvailable .gBlock img { + float: right; +} + +.gSelected { + background: #e8e8e8; +} + +.gAvailable .gInstalledToolkit:hover { + cursor: pointer; + background: #eee; +} + +.gAvailable .gButtonLink { + width: 96%; +} + +.gSelected .gButtonLink { + display: none; +} + +.gUnavailable { + border-color: #999; + opacity: 0.4; +} + +.gOddRow { + background-color: #eee; +} + +.gEvenRow { + background-color: #fff; +} + +/* Status messages ~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gMessage { + width: 100%; +} + +#gSiteStatus li, +#gMessage li, +.gModuleStatus { + border: 1px solid #ccc; + margin-bottom: .4em; +} + +#gSiteStatus li { + margin-bottom: 0; + border: none; + border-bottom: 1px solid #ccc; +} + +.gModuleStatus { + clear: both; + margin-bottom: 1em; +} + +.gError, +.gInfo, +.gSuccess, +.gWarning { + padding: .4em .5em .4em 30px; +} + +.gError, tr.gError td.gError { + background: #f6cbca url('../images/ico-error.png') no-repeat .4em 50%; +} + +.gInfo { + background: #e8e8e8 url('../images/ico-info.png') no-repeat .4em 50%; +} + +.gSuccess { + background: #d9efc2 url('../images/ico-success.png') no-repeat .4em 50%; +} + +.gWarning, tr.gWarning td.gWarning { + background: #fcf9ce url('../images/ico-warning.png') no-repeat .4em 50%; +} + +.gPager .gInfo, +tr.gError, +tr.gInfo, +tr.gSuccess, +tr.gWarning { + background: none; +} + +.gInfo td.gInfo { + background-color: transparent; +} + +.gSuccess td.gSuccess { + background-color: transparent; +} + +.gError td { + background-color: #f6cbca; +} + +.gWarning td { + background-color: #fcf9ce; +} + +/* Inline layout (forms, lists) ~~~~~~~~~~ */ + +.gShortForm li { + float: left; + padding: .4em 0; +} + +.gShortForm input[type="text"] { + color: #666; + padding: .3em .6em; + width: 11em; +} + +/*** ****************************************************************** + * 4) Page layout containers + *********************************************************************/ + +/* View container ~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.gView { + background-color: #fff; + border: 1px solid #ccc; + border-bottom: none; + min-width: 974px !important; +} + +/* Layout containers ~~~~~~~~~~~~~~~~~~~~~ */ + +#gHeader { + background-color: #e8e8e8; + border-bottom: 1px solid #ccc; + font-size: .8em; + margin-bottom: 20px; + padding: 0 20px; + position: relative; +} + +#gContent { + font-size: 1.1em; + padding-left: 20px; + width: 96%; +} + +#gSidebar { + background-color: #fff; + font-size: .9em; + padding: 0 20px; + width: 220px; +} + +#gFooter { + background-color: #e8e8e8; + border-top: 1px solid #ccc; + font-size: .8em; + margin-top: 20px; + padding: 10px 20px; +} + +/** ******************************************************************* + * 5) Content blocks in specific layout containers + *********************************************************************/ + +/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gHeader #gLogo { + background: transparent url('../../../lib/images/logo.png') no-repeat 0 .5em; + color: #A5A5A5 !important; + display: block; + height: 55px; + padding-top: 5px; + width: 105px; +} + +#gHeader #gLogo:hover { + color: #f60 !important; + text-decoration: none; +} + +#gHeader #gQuickSearchForm { + clear: right; + float: right; + margin: 1em 0; +} + +#gHeader #gQuickSearchForm input[type='text'] { + width: 17em; +} + +#gContent .gBlock h2 { + background-color: transparent; + padding-left: 0; +} + +#gSidebar .gBlockContent { + padding-left: 1em; +} + +/* Footer content ~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gHeader #gLoginMenu li, +#gFooter #gCredits li { + display: inline; +} + +#gHeader #gLoginMenu li { + padding-left: 1.2em; +} + +#gFooter #gCredits li { + padding-right: 1.2em; +} + +#gContent #gSearchResults { + margin-top: 1em; + padding-top: 1em; +} + +.gBlock .ui-dialog-titlebar { + margin: -1em -1em 0; +} + +#gSidebar .gBlock h2 { + background: none; +} + +#gPhotoStream { + background-color: #e8e8e8; +} + +#gPhotoStream .gBlockContent 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*/ +} + +#gContent #gPhotoStream .gItem { + 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; +} + +.rtl #gContent #gPhotoStream .gItem { + float: right; +} + +#gSiteStatus { + margin-bottom: 0; +} + +#gContent .gItem { + 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; +} + +#gAdminCommentsMenu { + margin: 1em 0; +} + +#gAdminCommentsMenu a { + margin: 0; + padding: .2em .6em; +} + +#gAdminGraphics .gAvailable .gBlock { + clear: none; + float: left; + height: 17em; + margin-right: 1em; + width: 30%; +} + +.rtl #gAdminGraphics .gAvailable .gBlock { + float: right; + margin-left: 1em; + margin-right: 0em; +} + +#gSiteTheme, +#gAdminTheme { + float: left; + width: 48%; +} + +.rtl #gSiteTheme, +.rtl #gAdminTheme { + float: right; +} + +#gSiteTheme { + margin-right: 1em; +} + +#gUserAdminList { + margin-bottom: 1em; +} +#gUserAdminList td { + vertical-align: bottom; +} + +#gUserAdminList .gDraggable:hover { + border: 1px dashed black; +} + +#gUserAdminList .admin { + color: #55f; + font-weight: bold; +} + +.gActions a, +.gActions span { + margin-right: 3em; +} + +li.gGroup { + float: left; + display: block; + width: 200px; + border: 1px solid gray; + padding: 0; + margin: 0 1em 1em 0; +} + +.rtl li.gGroup { + float: right; +} + +li.gGroup h4 { + background-color: #eee; + border-bottom: 1px dashed #ccc; + padding: .5em 0 .5em .5em; +} +li.gGroup .gButtonLink { + padding: 0; +} +li.gGroup ul, li.gGroup div { + height: 180px; + margin: 1px; + overflow: auto; + padding-top: .2em; +} +li.gGroup div p { + color: gray; + text-align: center; + padding: 2em .5em 0 .5em +} +li.gGroup .gUser { + padding: .2em 0 0 .5em; +} +li.gGroup .gUser .gButtonLink { + vertical-align: middle; +} + +li.gDefaultGroup h4, li.gDefaultGroup .gUser { + color: gray; +} + +#gAdminAdvancedSettings tr.setting:hover { + background: #ffc; +} + +/** ******************************************************************* + * 5) Navigation and menus + *********************************************************************/ + +#gSiteAdminMenu, +#gTagCloud ul { + font-size: 1.2em; +} + +/* Login menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gHeader #gLoginMenu { + color: #999; + float: right; + margin: 0; + padding: 5px 0; +} + +.rtl #gHeader #gLoginMenu { + text-align: left; +} + +/* Site Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gSiteAdminMenu { + bottom: 0; + display: none; + font-size: 1.2em; + left: 140px; + position: absolute; +} + +#gSiteAdminMenu ul { + margin-bottom: 0; +} + +/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.gPager { + clear: both; + margin: 0; + padding: 5px 0 !important; + width: 100%; +} + +.gPager li { + float: left; + margin: 0; + width: 30%; +} + +.gPager .gInfo { + text-align: center; + width: 40%; +} + +/** ******************************************************************* + * 6) Browser hacks + *********************************************************************/ + +#gSiteAdminMenu:after, +#gHeader:after, +#gAdminCommentsMenu:after, +#gGroupAdmin:after, +.gSelected:after, +.gAvailable .gBlock:after, +#gModuleCreateForm ul li ul:after, +#gDeveloperTools:after, +#gPhotoStream:after, +#gViewMenu:after { + clear: both; + content: "."; + display: block; + height: 0; + visibility: hidden; +} + +/** ******************************************************************* + * 7) jQuery and jQuery UI + *********************************************************************/ + +/* Superfish menu overrides ~~~~~~~~~~~~~~ */ + +.sf-menu li li, .sf-menu li li ul li { + background-color: #bdd2ff; +} + +.sf-menu li:hover { + background-color: #dfe9ff; +} + +/* Ajax loading indicator ~~~~~~~~~~~~~~~~ */ + +.gLoadingLarge { + background: #e8e8e8 url('../../../lib/images/loading-large.gif') no-repeat center center; + font-size: 0; +} + +.gDialogLoadingLarge { + background: url('../../../lib/images/loading-large.gif') no-repeat center center !important; + font-size: 0; +} + +.gLoadingSmall { + background: #e8e8e8 url('../../../lib/images/loading-small.gif') no-repeat center center; + font-size: 0; +} + +.gDraggable { + cursor: move; +} + +.gDropTarget { + background-color: #cfdeff; + border: 1px dotted #999; + height: 100px; + margin: 1em 0; +} + +/* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */ + +#gPanel { + display: none; + padding: 1em; +} + +#gPanel legend { + display: none; +} + +#gPanel fieldset { + border: none; +} + +.ui-draggable { + cursor: move; +} + +.gButtonSetVertical a { + width: 8em !important; +} + +#gAdminDashboard .ui-dialog-titlebar, +#gAdminDashboardSidebar .ui-dialog-titlebar { + padding: .2em .4em; +} + +.ui-widget-overlay { + background: #000; + opacity: .7; +} + +#gDialog { + text-align: left; +} + +#gDialog li { + padding-left: 0; +} + +#gDialog form input[type="text"], +#gDialog form input[type="password"] { + width: 100%; +} + +#gDialog #gLoginForm, +#gDialog #gAddUserForm, +#gDialog #gAddGroupForm { + margin: 0 auto; + width: 270px; +} + +#gDialog fieldset { + border: none; +} + +#gDialog legend { + display: none; +} + +/* jQuery UI ThemeRoller buttons */ + +.gButtonLink { + display: inline-block; + margin: 0 4px 0 0; + padding: .2em .4em; + outline: 0; +} + +.gButtonSet { + padding-left: 1px; +} + +.gButtonSet li { + float: left; +} + +.gButtonSet .gButtonLink { + 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; +} + +/*************** STUFF THAT NEEDS A HOME ****************/ + +#gMove ul { + padding-left: 1em; +} + +#gMove .selected { + background: #999; +} + +.gProgressBar { + height: 1em; + width: 100%; + margin-top: .5em; + display: inline-block; +} + +#gAddPhotos p { + margin: 0; + padding: 0; +} + +#gAddPhotosCanvas { + height: 325px; + width: 450px; + overflow: auto; +} + +#gAddPhotosQueue .progressbar { + height: 4px; +} + +#gAddPhotosQueue .title { + font-size: 1.25em; +} + +#gAddPhotosQueue .status { + font-size: .75em; +} + +#gAddPhotosQueue .box { + margin-bottom: 8px; + padding: 4px; +} + +#gAddPhotosQueue .pending { + background-color: #e8e8e8; + border: 1px solid #d7d7d7; +} + +#gAddPhotosQueue .error { + background-color: #fcc; + border: 1px solid #ebb; +} + +#gAddPhotosQueue .uploading { + background-color: #ff9; + border: 1px solid #ee8; +} + +#gAddPhotosQueue .complete { + background-color: #cfc; + border: 1px solid #beb; +} + +#gAdminG2ImportNotes { + padding-bottom: 20px; +} + +#gAdminG2ImportDetails { + padding-top: 20px; +} + +#gAdminG2ImportDetails .gWarning { + margin-top: 4px; +} + +#gAdminG2ImportDetails .gInfo { + padding: 2px; + border: 1px solid #999; + margin-bottom: 10px; +} + +#gAdminG2ImportNotes p, +#gAdminG2ImportDetails .gInfo p { + padding: 0; + margin: 0; +} + +#gAdminG2ImportNotes ul li, +#gAdminG2Import .gInfo ul li { + padding-left: 0; + margin-left: 20px; + list-style-type: disc; +} + +#gTagAdmin { + table-layout: fixed; +} + +#gTagAdmin td { + border: 0; +} + +#gTagAdmin ul { + padding-bottom: .3em; +} + +#gTagAdmin li { + padding: .1em 0 .2em .3em; +} + +#gTagAdmin .gColumn { + float: left; + width: 200px; +} + +.rtl #gTagAdmin .gColumn { + float: right; +} + +.gEditable { + padding: .1em .3em .2em .3em; +} + +.gEditable:hover { + background-color: #ffc; + cursor: text; +} + +#gRenameTagForm input { + padding: 0 .2em 0 .2em; + clear: none; + float: left; + margin: 0 .2em 0 0; +} + +.rtl #gRenameTagForm input { + float: right; +} + +#gRenameTagForm input[type="text"].gError { + border: 2px solid red; + background: none; +} + +#gRenameTagForm input[type="submit"] { + height: 25px; +} + +#gRenameTagForm a, #gRenameTagForm span { + display: block; + float: left; + padding: .2em .2em 0 .1em; +} + +.rtl #gRenameTagForm a, #gRenameTagForm span { + float: right; +} + +#gTaskLogDialog h1 { + font-size: 1.1em; +} + +.gTaskLog { + border: 1pt solid; + font-size: .9em; + height: 400px; + margin: .5em 0; + overflow: auto; + padding: .5em +} + +#gServerAddAdmin { + margin:auto; + text-align: left; +} + +.rtl #gServerAddAdmin { + text-align: right; +} + +#gServerAddAdmin form fieldset { + border: medium none; +} + +#gServerAddAdmin legend { + display: none; +} + +#gServerAddAdmin .gWarning { + background-color: #FFFF99; +} + +#gAuthorizedPath { + margin: 0 !important; + padding: 0.3em 1.5em 0.3em 1em; +} + +#gServerAdd Admin #path { + width: 80%; +} + +.gRemoveDir:hover { + cursor: pointer; +} + +#gLanguagesForm table { + width: 400px; + float: left; + margin: 0 3em 1em 0; +} + +#gLanguagesForm .installed { + background-color: #EEEEEE; +} + +#gLanguagesForm .default { + background-color: #C5DBEC; + font-weight: bold; +} + +#gLanguagesForm input { + clear: both; +} + +#gTranslations { + padding: 2em 0 0 0; + clear: both; +} + +#gTranslations .gButtonLink { + padding: .5em; +} + +.gDocLink { + float: right; +} + +/* Right to left styles ~~~~~~~~~~~~~~~~~~~~ */ + +.rtl { + direction: rtl; +} + +.rtl caption, +.rtl th, +.rtl #gDialog { + text-align: right; +} + +.rtl .txtright { + text-align: left; +} + +.rtl #gHeader #gQuickSearchForm, +.rtl #gForgotPasswordLink, +.rtl #gHeader #gLoginMenu, +.rtl .ui-icon-right .ui-icon { + clear: left; + float: left; +} + +.rtl #gDialog .gCancel, +.rtl form ul ul li, +.rtl input[type="submit"], +.rtl input[type="reset"], +.rtl .gShortForm li, +.rtl #gContent #gAlbumGrid .gItem, +.rtl #gSiteAdminMenu, +.rtl .gPager li, +.rtl .gButtonSet li, +.rtl .ui-icon-left .ui-icon { + float: right; +} diff --git a/themes/admin_wind/images/avatar.jpg b/themes/admin_wind/images/avatar.jpg new file mode 100644 index 00000000..2e76b12b Binary files /dev/null and b/themes/admin_wind/images/avatar.jpg differ diff --git a/themes/admin_wind/images/ico-album.png b/themes/admin_wind/images/ico-album.png new file mode 100644 index 00000000..affa1b84 Binary files /dev/null and b/themes/admin_wind/images/ico-album.png differ diff --git a/themes/admin_wind/images/ico-error.png b/themes/admin_wind/images/ico-error.png new file mode 100644 index 00000000..c37bd062 Binary files /dev/null and b/themes/admin_wind/images/ico-error.png differ diff --git a/themes/admin_wind/images/ico-info.png b/themes/admin_wind/images/ico-info.png new file mode 100644 index 00000000..12cd1aef Binary files /dev/null and b/themes/admin_wind/images/ico-info.png differ diff --git a/themes/admin_wind/images/ico-print.png b/themes/admin_wind/images/ico-print.png new file mode 100644 index 00000000..b82a8e1e Binary files /dev/null and b/themes/admin_wind/images/ico-print.png differ diff --git a/themes/admin_wind/images/ico-separator.gif b/themes/admin_wind/images/ico-separator.gif new file mode 100644 index 00000000..3de2d0d3 Binary files /dev/null and b/themes/admin_wind/images/ico-separator.gif differ diff --git a/themes/admin_wind/images/ico-success.png b/themes/admin_wind/images/ico-success.png new file mode 100644 index 00000000..a9925a06 Binary files /dev/null and b/themes/admin_wind/images/ico-success.png differ diff --git a/themes/admin_wind/images/ico-view-comments.png b/themes/admin_wind/images/ico-view-comments.png new file mode 100644 index 00000000..e5d3630f Binary files /dev/null and b/themes/admin_wind/images/ico-view-comments.png differ diff --git a/themes/admin_wind/images/ico-view-fullsize.png b/themes/admin_wind/images/ico-view-fullsize.png new file mode 100644 index 00000000..0be23e9b Binary files /dev/null and b/themes/admin_wind/images/ico-view-fullsize.png differ diff --git a/themes/admin_wind/images/ico-view-hybrid.png b/themes/admin_wind/images/ico-view-hybrid.png new file mode 100644 index 00000000..ee902e55 Binary files /dev/null and b/themes/admin_wind/images/ico-view-hybrid.png differ diff --git a/themes/admin_wind/images/ico-view-slideshow.png b/themes/admin_wind/images/ico-view-slideshow.png new file mode 100644 index 00000000..82f61f63 Binary files /dev/null and b/themes/admin_wind/images/ico-view-slideshow.png differ diff --git a/themes/admin_wind/images/ico-warning.png b/themes/admin_wind/images/ico-warning.png new file mode 100644 index 00000000..628cf2da Binary files /dev/null and b/themes/admin_wind/images/ico-warning.png differ diff --git a/themes/admin_wind/js/ui.init.js b/themes/admin_wind/js/ui.init.js new file mode 100644 index 00000000..c6379c09 --- /dev/null +++ b/themes/admin_wind/js/ui.init.js @@ -0,0 +1,59 @@ +$(document).ready(function(){ + // Initialize Superfish menus + $("#gSiteAdminMenu ul.gMenu").addClass("sf-menu"); + $("ul.gMenu").addClass("sf-menu"); + $("ul.sf-menu").superfish({ + delay: 500, + animation: { + opacity: "show", + height: "show" + }, + pathClass: "current", + speed: "fast" + }); + $("#gSiteAdminMenu").css("display", "block"); + + // Initialize status message effects + $("#gMessage li").gallery_show_message(); + + // Initialize modal dialogs + $(".gDialogLink").gallery_dialog(); + + // Initialize ajax links + $(".gAjaxLink").gallery_ajax(); + + // Initialize panels + $(".gPanelLink").gallery_panel(); + + if ($("#gPhotoStream").length) { + // Vertically align thumbs in photostream + $(".gItem").gallery_valign(); + } + + // Apply jQuery UI button css to submit inputs + $("input[type=submit]:not(.gShortForm input)").addClass("ui-state-default ui-corner-all"); + + // Round view menu buttons + if ($("#gAdminCommentsMenu").length) { + $("#gAdminCommentsMenu ul").removeClass("gMenu").removeClass("sf-menu"); + $("#gAdminCommentsMenu").addClass("gButtonSet"); + $("#gAdminCommentsMenu a").addClass("gButtonLink ui-state-default"); + $("#gAdminCommentsMenu ul li:first a").addClass("ui-corner-left"); + $("#gAdminCommentsMenu ul li:last a").addClass("ui-corner-right"); + } + + // Round corners + $(".gSelected").addClass("ui-corner-all"); + $(".gAvailable .gBlock").addClass("ui-corner-all"); + $(".gUnavailable").addClass("ui-corner-all"); + + // Add hover state for buttons + $(".ui-state-default").hover( + function() { + $(this).addClass("ui-state-hover"); + }, + function() { + $(this).removeClass("ui-state-hover"); + } + ); +}); diff --git a/themes/admin_wind/theme.info b/themes/admin_wind/theme.info new file mode 100644 index 00000000..4034b64a --- /dev/null +++ b/themes/admin_wind/theme.info @@ -0,0 +1,6 @@ +name = "Gallery Wind" +description = "A crisp Site Administration theme with soft colors and drop down menus." +version = 1 +author = "Gallery Team" +admin = 1 +site = 0 diff --git a/themes/admin_wind/thumbnail.png b/themes/admin_wind/thumbnail.png new file mode 100644 index 00000000..b07a4cc2 Binary files /dev/null and b/themes/admin_wind/thumbnail.png differ diff --git a/themes/admin_wind/views/admin.html.php b/themes/admin_wind/views/admin.html.php new file mode 100644 index 00000000..ef15ed25 --- /dev/null +++ b/themes/admin_wind/views/admin.html.php @@ -0,0 +1,81 @@ + + + + + + <?= t("Admin Dashboard") ?> + " 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() ?> +
    +
  • abs_url(), "← ".t("Back to the Gallery")) ?>
  • + +
+ + + admin_header_bottom() ?> +
+
+
+
+
+ messages() ?> + +
+
+
+ +
+ +
+ +
+
+ admin_footer() ?> +
+ admin_credits() ?> +
+
+
+ admin_page_bottom() ?> + + diff --git a/themes/admin_wind/views/block.html.php b/themes/admin_wind/views/block.html.php new file mode 100644 index 00000000..6cbea76e --- /dev/null +++ b/themes/admin_wind/views/block.html.php @@ -0,0 +1,18 @@ + + + + + diff --git a/themes/admin_wind/views/pager.html.php b/themes/admin_wind/views/pager.html.php new file mode 100644 index 00000000..5034ec19 --- /dev/null +++ b/themes/admin_wind/views/pager.html.php @@ -0,0 +1,44 @@ + + +
    + $current_first_item, + "to_number" => $current_last_item, + "count" => $total_items)) ?> +
  • + + + + + + + + + + + + + + +
  • +
  • +
  • + + + + + + + + + + + + + + +
  • +
diff --git a/themes/default/css/fix-ie.css b/themes/default/css/fix-ie.css deleted file mode 100644 index eee88c15..00000000 --- a/themes/default/css/fix-ie.css +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Fix display in IE 6, 7 - */ - -#gBanner, -.gBreadcrumbs, -#gAlbumGrid, -#gPager, -#gViewMenu { - zoom: 1; -} - -#gBanner { - z-index: 2; -} - -input.submit { - clear: none !important; - display: inline !important; -} - -#gAddTagForm input.textbox { - width: 110px; -} - -#gDialog a.gCancel { - display: inline-block !important; - float: none !important; -} - -.gPager .txtright { - width: 29%; -} - -.gPager .ui-icon-right { - width: 60px; -} diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css deleted file mode 100644 index 64ecf775..00000000 --- a/themes/default/css/screen.css +++ /dev/null @@ -1,1128 +0,0 @@ -/** - * Gallery 3 Default Theme Screen Styles - * - * @requires YUI reset, font, grids CSS - * - * Sheet organization: - * 1) Basic HTML elements - * 2) Reusable classes - * 3) Reusable content blocks - * 4) Page layout containers - * 5) Content blocks in specific layout containers - * 6) Navigation and menus - * 7) Browser hacks - * 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; -} - -p { - margin-bottom: 1em; -} - -em { - font-style: oblique; -} - -h1, h2, h3, h4, h5, strong, th { - font-weight: bold; -} - -h1 { - font-size: 1.7em; -} - -#gSearchResults h1 { - margin-bottom: 1em; -} - -#gProgress h1 { - font-size: 1.1em; -} - -h2 { - font-size: 1.4em; -} - -#gSidebar .gBlock h2 { - font-size: 1.2em; -} - -#gSidebar .gBlock li { - margin-bottom: .6em; -} - -h3 { - font-size: 1.2em; -} - -/* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -a, -.gMenu a, -#gDialog a, -.gButtonLink, -.gButtonLink:hover, -.gButtonLink:active, -a.ui-state-hover, -input.ui-state-hover, -button.ui-state-hover { - color: #5382bf !important; - cursor: pointer !important; - text-decoration: none; - -moz-outline-style: none; -} - -a:hover, -#gDialog a:hover { - text-decoration: underline; -} - -.gMenu a:hover { - text-decoration: none; -} - -#gDialog .gCancel { - clear: none; - float: left; - margin: .3em 1em; -} - -#gForgotPasswordLink { - float: right; - font-size: .9em; -} - -#gDialog .gCancel { - float: left; -} - -#gDialog #gMessage li { - width: 400px; - white-space: normal; - padding-left: 32px; -} - -/* Tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -table { - width: 100%; -} - -#gContent table { - margin: 1em 0; -} - -caption, -th { - text-align: left; -} - -th, -td { - border: none; - border-bottom: 1px solid #ccc; - padding: .5em; - vertical-align: top; -} - -/* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -fieldset { - border: 1px solid #ccc; - padding-bottom: .8em; -} - -#gBanner fieldset, -#gSidebar fieldset, -.gShortForm fieldset { - border: none; -} - -legend { - font-weight: bold; - margin-left: 1em; -} - -#gBanner legend, -#gSidebar legend, -#gContent #gSearchForm legend, -input[type="hidden"], -.gShortForm 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: 100%; - 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 ~~~~~~~~~~~~~~~~~~~~~~~ */ - -.gValidationRule { - font-size: 80%; - margin-top: .5em; -} - -form.gError input[type="text"], -li.gError input[type="text"], -form.gError input[type="password"], -li.gError input[type="password"], -form.gError input[type="checkbox"], -li.gError input[type="checkbox"], -form.gError input[type="radio"], -li.gError input[type="radio"], -form.gError textarea, -li.gError textarea, -form.gError select, -li.gError select { - border: 2px solid red; -} - -/** ******************************************************************* - * 2) Reusable generic classes - *********************************************************************/ - -.inactive, .understate { - color: #ccc; - font-weight: normal; -} - -.left { - float: left; - margin: 1em 1em 1em 0; -} - -.right { - float: right; - margin: 1em 0 1em 1em; -} - -.txtright { - text-align: right; -} - -/** ******************************************************************* - * 3) Reusable content blocks - *********************************************************************/ - -.gBlock { - clear: both; - margin-bottom: 2.5em; -} - -.gBlock h2 { - background-color: #e8e8e8; - padding: .3em .8em; -} - -.gBlockContent { - margin-top: 1em; -} - -/* Status messages ~~~~~~~~~~~~~~~~~~~~~~~ */ - -#gMessage { - width: 100%; -} - -#gSiteStatus li, -#gMessage li, -.gModuleStatus { - border: 1px solid #ccc; - margin-bottom: .4em; -} - -#gSiteStatus li { - margin-bottom: 0; - border: none; - border-bottom: 1px solid #ccc; -} - -.gModuleStatus { - clear: both; - margin-bottom: 1em; -} - -.gError, -.gInfo, -.gSuccess, -.gWarning { - background-position: .4em 50%; - background-repeat: no-repeat; - padding: .4em .5em .4em 30px; -} - -.gError { - background-color: #f6cbca; - background-image: url('../images/ico-error.png'); -} - -.gInfo { - background-color: #e8e8e8; - background-image: url('../images/ico-info.png'); -} - -.gSuccess { - background-color: #d9efc2; - background-image: url('../images/ico-success.png'); -} - -.gWarning { - background-color: #fcf9ce; - background-image: url('../images/ico-warning.png'); -} - -form .gError, -.gPager .gInfo { - background-color: #fff !important; -} - -.gPager .gInfo { - background-image: none !important; - padding: 0 !important; -} - -/* Inline layout (forms, lists) ~~~~~~~~~~ */ - -.gShortForm li { - float: left; - padding: .4em 0; -} - -.gShortForm input[type="text"] { - color: #666; - padding: .3em .6em; - width: 11em; -} - -/*** ****************************************************************** - * 4) Page layout containers - *********************************************************************/ - -/* View container ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.gView { - background-color: #fff; - border: 1px solid #ccc; - border-bottom: none; -} - -/* Layout containers ~~~~~~~~~~~~~~~~~~~~~ */ - -#gHeader { - margin-bottom: 1em; -} - -#gBanner { - background-color: #e8e8e8; - border-bottom: 1px solid #ccc; - font-size: .8em; - min-height: 5em; - padding: 1em 20px; - position: relative; -} - -#gContent { - font-size: 1.2em; - padding-left: 20px; - position: relative; - width: 696px; -} - -#gSidebar { - font-size: .9em; - padding: 0 20px; - width: 220px; -} - -#gFooter { - background-color: #e8e8e8; - border-top: 1px solid #ccc; - font-size: .8em; - margin-top: 20px; - padding: 10px 20px; -} - -/** ******************************************************************* - * 5) Content blocks in specific layout containers - *********************************************************************/ - -/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#gBanner #gLogo img { - margin: 0; -} - -#gBanner #gQuickSearchForm { - clear: right; - float: right; - margin-top: 1em; -} - -#gBanner #gQuickSearchForm input[type='text'] { - width: 17em; -} - -#gContent .gBlock h2 { - background-color: transparent; - padding-left: 0; -} - -#gSidebar .gBlockContent { - padding-left: 1em; -} - -/* Album content ~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#gContent #gAlbumGrid { - margin: 1em 0; - position: relative; - z-index: 1; -} - -#gContent #gAlbumGrid .gItem { - background-color: #fff; - border: 1px solid #fff; - float: left; - font-size: .7em; - height: 220px; - overflow: hidden; - padding: .6em 8px; - position: relative; - text-align: center; - width: 213px; - z-index: 1; -} - -#gContent #gAlbumGrid .gItem h2 { - margin: 5px 0; -} - -#gContent .gPhoto h2, -#gContent .gItem .gMetadata { - display: none; -} - -#gContent #gAlbumGrid .gAlbum { - background-color: #e8e8e8; -} - -#gContent #gAlbumGrid .gAlbum h2 span { - background: transparent url('../images/ico-album.png') no-repeat top left; - display: inline-block; - height: 16px; - margin-right: 5px; - width: 16px; -} - -#gContent #gAlbumGrid .gHoverItem { - background-color: #fff; - border: 1px solid #000; -} - -#gContent .gHoverItem h2, -#gContent .gHoverItem .gMetadata { - display: block; -} - -/* Individual photo content ~~~~~~~~~~~~~~ */ - -#gContent #gItem { - position: relative; - width: 99%; -} - -#gContent #gPhoto { - position: relative; -} - -#gContent #gItem .gFullSizeLink img { - display: block; - margin: 1em auto !important; -} - -#gContent #gComments { - margin-top: 2em; - position: relative; -} - -#gContent #gComments ul li { - margin: 1em 0; -} - -#gContent #gComments .gAuthor { - border-bottom: 1px solid #ccc; - color: #999; - height: 32px; - line-height: 32px; -} - -#gContent #gComments ul li div { - padding: 0 8px 8px 43px; -} - -#gContent #gComments ul li #gRecaptcha { - padding: 0; -} - -#gContent #gComments ul li #gRecaptcha div { - padding: 0; -} - -#gContent #gComments .gAvatar { - height: 32px; - margin-right: .4em; - width: 32px; -} - -#gAddCommentButton { - position: absolute; - right: 0; - top: 2px; -} - -#gContent #gAddCommentForm { - margin-top: 2em; -} - -/* Footer content ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#gBanner #gLoginMenu li, -#gFooter #gCredits li { - display: inline; -} - -#gBanner #gLoginMenu li { - padding-left: 1.2em; -} - -#gFooter #gCredits li { - padding-right: 1.2em; -} - -#gContent #gSearchResults { - margin-top: 1em; - padding-top: 1em; -} - -/** ******************************************************************* - * 5) Navigation and menus - *********************************************************************/ - -#gSiteMenu, -#gTagCloud ul { - font-size: 1.2em; -} - -/* Login menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#gBanner #gLoginMenu { - color: #999; - float: right; -} - -/* Site Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#gSiteMenu { - bottom: 0; - display: none; - left: 140px; - position: absolute; -} - -#gSiteMenu ul { - margin-bottom: 0 !important; -} - -/* Context Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.gContextMenu { - position: absolute; - bottom: 0; - left: 0; -} - -.gItem .gContextMenu { - display: none; - margin-top: 2em; - width: 100%; -} - -#gItem .gContextMenu { - font-size: .7em; -} - -#gItem .gContextMenu ul { - display: none; -} - -.gContextMenu li { - border-left: none; - border-right: none; - border-bottom: none; -} - -.gContextMenu li a { - display: block; - line-height: 1.6em; -} - -.gHoverItem .gContextMenu { - display: block; -} - -.gHoverItem .gContextMenu li { - text-align: left; -} - -.gHoverItem .gContextMenu a:hover { - text-decoration: none; -} - -/* View Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#gViewMenu { - margin-bottom: 1em; -} - -#gViewMenu a { - background-repeat: no-repeat; - background-position: 50% 50%; - height: 28px !important; - width: 43px !important; -} - -#gViewMenu #gHybridLink { - background-image: url('../images/ico-view-hybrid.png'); -} - -#gViewMenu #gSlideshowLink { - background-image: url('../images/ico-view-slideshow.png'); -} - -#gViewMenu .gFullSizeLink { - background-image: url('../images/ico-view-fullsize.png'); -} - -#gViewMenu #gCommentsLink { - background-image: url('../images/ico-view-comments.png'); -} - -#gViewMenu #gDigibugLink { - background-image: url('../images/ico-print.png'); -} - -/* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.gBreadcrumbs { - padding: 0 20px; -} - -.gBreadcrumbs li { - background: transparent url('../images/ico-separator.gif') no-repeat scroll left center; - float: left; - padding: 10px 6px 10px 16px !important; -} - -.gBreadcrumbs li.root { - background: transparent; -} - -.gBreadcrumbs li a, -.gBreadcrumbs li span { - display: block; -} - -.gBreadcrumbs li.active, -.gBreadcrumbs li.active span { - font-weight: bold; -} - -#gDialog ul.gBreadcrumbs { - clear: both; - margin-left: 0; - padding-left: 0; -} - -#gDialog .gBreadcrumbs li { - font-size: .9em; -} - -/* Tags and cloud ~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#gTagCloud ul { - text-align: justify; -} - -#gTagCloud ul li { - display: inline; - line-height: 1.5em; - text-align: justify; -} - -#gTagCloud ul li a { - text-decoration: none; -} - -#gTagCloud ul li span { - display: none; -} - -#gTagCloud ul li.size1 a { - color: #9cf; - font-size: 80%; - font-weight: 100; -} - -#gTagCloud ul li.size2 a { - color: #69f; - font-size: 90%; - font-weight: 300; -} - -#gTagCloud ul li.size3 a { - color: #69c; - font-size: 100%; - font-weight: 500; -} - -#gTagCloud ul li.size4 a { - color: #369; - font-size: 110%; - font-weight: 700; -} - -#gTagCloud ul li.size5 a { - color: #0e2b52; - font-size: 120%; - font-weight: 900; -} - -#gTagCloud ul li.size6 a { - color: #0e2b52; - font-size: 130%; - font-weight: 900; -} - -#gTagCloud ul li.size7 a { - color: #0e2b52; - font-size: 140%; - font-weight: 900; -} - -#gTagCloud ul li a:hover { - color: #f30; - text-decoration: underline; -} - -#gWelcomeMessage p { - padding-bottom: 1em; -} - -/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -.gPager { - clear: both; - margin: 0; - padding: 5px 0 !important; - width: 100%; -} - -.gPager li { - float: left; - margin: 0; - width: 30%; -} - -.gPager .gInfo { - text-align: center; - width: 40%; -} - -/** ******************************************************************* - * 6) Browser hacks - *********************************************************************/ - -#gHeader:after, -#gAlbumGrid:after, -.gPager:after, -#gViewMenu:after { - clear: both; - content: "."; - display: block; - height: 0; - visibility: hidden; -} - -/** ******************************************************************* - * 7) jQuery and jQuery UI - *********************************************************************/ - -/* Superfish menu overrides ~~~~~~~~~~~~~~ */ - -.sf-menu li li, .sf-menu li li ul li { - background-color: #bdd2ff; -} - -.sf-menu li:hover { - background-color: #dfe9ff; -} - -/* Ajax loading indicator ~~~~~~~~~~~~~~~~ */ - -.gLoadingLarge { - background: #e8e8e8 url('../../../lib/images/loading-large.gif') no-repeat center center; - font-size: 0; -} - -.gDialogLoadingLarge { - background: url('../../../lib/images/loading-large.gif') no-repeat center center !important; - font-size: 0; -} - -.gLoadingSmall { - background: #e8e8e8 url('../../../lib/images/loading-small.gif') no-repeat center center; - font-size: 0; -} - -.gDraggable { - cursor: move; -} - -.gDropTarget { - background-color: #cfdeff; - border: 1px dotted #999; - height: 100px; - margin: 1em 0; -} - -/* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */ - -.ui-widget-overlay { - background: #000; - opacity: .7; -} - -#gDialog { - text-align: left; -} - -#gDialog li { - padding-left: 0; -} - -#gDialog form input[type="text"], -#gDialog form input[type="password"] { - width: 100%; -} - -#gDialog #gLoginForm, -#gDialog #gAddUserForm, -#gDialog #gAddGroupForm { - margin: 0 auto; - width: 270px; -} - -#gDialog fieldset { - border: none; -} - -#gDialog legend { - display: none; -} - -#gDialog p { - margin: 0; -} - -/* jQuery UI ThemeRoller buttons */ - -.gButtonLink { - display: inline-block; - margin: 0 4px 0 0; - padding: .2em .4em; - outline: 0; -} - -.gButtonSet { - padding-left: 1px; -} - -.gButtonSet li { - float: left; -} - -.gButtonSet .gButtonLink { - 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; -} - -/* STUFF THAT NEEDS A HOME */ - -#gMove ul { - padding-left: 1em; -} - -#gMove .selected { - background: #999; -} - -/* Server Add */ - -#gServerAdd button { - margin-bottom: .5em; -} - -#gServerAddTree { - cursor: pointer; - padding-left: 4px; - width: 95%; -} - -#gServerAddTree li { - padding: 0; - float: none; -} - -#gServerAddTree span.selected { - background: #ddd; -} - -#gServerAddTree { - border: 1px solid #ccc; - height: 20em; - overflow: auto; - margin-bottom: .5em; - padding: .5em; -} - -#gServerAdd ul ul li { - padding-left: 1.2em; -} - -/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - -#gEditPermissionForm { - clear: both; -} -#gEditPermissionForm fieldset { - border: 1px solid #cccccc; - padding: 0; -} - -#gPermissions .gDenied, -#gPermissions .gAllowed { - text-align: center; - vertical-align: middle; -} -#gPermissions .gDenied { - background-color: #fcc; -} -#gPermissions .gAllowed { - background-color: #cfc; -} - -/*************** STUFF THAT NEEDS A HOME ****************/ - -.gProgressBar { - height: 1em; - width: 100%; - margin-top: .5em; - display: inline-block; -} - -#gAddPhotos span { - clear: both; - display: block; -} - -#gAddPhotosCanvas { - height: 325px; - width: 450px; - overflow: auto; -} - -#gAddPhotosQueue .progressbar { - height: 4px; -} - -#gAddPhotosQueue .title { - font-size: 1.25em; -} - -#gAddPhotosQueue .status { - font-size: .75em; -} - -#gAddPhotosQueue .box { - margin-bottom: 8px; - padding: 4px; -} - -#gAddPhotosQueue .pending { - background-color: #e8e8e8; - border: 1px solid #d7d7d7; -} - -#gAddPhotosQueue .error { - background-color: #fcc; - border: 1px solid #ebb; -} - -#gAddPhotosQueue .uploading { - background-color: #ff9; - border: 1px solid #ee8; -} - -#gAddPhotosQueue .complete { - background-color: #cfc; - border: 1px solid #beb; -} - -#gAdminG2ImportNotes { - padding-bottom: 20px; -} - -#gAdminG2ImportDetails { - padding-top: 20px; -} - -#gAdminG2ImportDetails .gWarning { - margin-top: 4px; -} - -#gAdminG2ImportDetails .gInfo { - padding: 2px; - border: 1px solid #999; - margin-bottom: 10px; -} - -#gAdminG2ImportNotes p, -#gAdminG2ImportDetails .gInfo p { - padding: 0; - margin: 0; -} - -#gAdminG2ImportNotes ul li, -#gAdminG2Import .gInfo ul li { - padding-left: 0; - margin-left: 20px; - list-style-type: disc; -} - -/* Right to left styles ~~~~~~~~~~~~~~~~~~~~ */ - -.rtl { - direction: rtl; -} - -.rtl caption, -.rtl th, -.rtl #gDialog { - text-align: right; -} - -.rtl #gHeader #gQuickSearchForm, -.rtl #gForgotPasswordLink, -.rtl #gHeader #gLoginMenu, -.rtl .ui-icon-right .ui-icon { - clear: left; - float: left; -} - -.rtl #gDialog .gCancel, -.rtl form ul ul li, -.rtl input[type="submit"], -.rtl input[type="reset"], -.rtl .gShortForm li, -.rtl #gHeader #gLogo img, -.rtl #gContent #gAlbumGrid .gItem, -.rtl #gSiteMenu, -.rtl .gBreadcrumbs li, -.rtl .gPager li, -.rtl .gButtonSet li, -.rtl .ui-icon-left .ui-icon { - float: right; -} - diff --git a/themes/default/images/avatar.jpg b/themes/default/images/avatar.jpg deleted file mode 100644 index acad9314..00000000 Binary files a/themes/default/images/avatar.jpg and /dev/null differ diff --git a/themes/default/images/ico-album.png b/themes/default/images/ico-album.png deleted file mode 100644 index affa1b84..00000000 Binary files a/themes/default/images/ico-album.png and /dev/null differ diff --git a/themes/default/images/ico-denied-gray.png b/themes/default/images/ico-denied-gray.png deleted file mode 100644 index 56db3ff5..00000000 Binary files a/themes/default/images/ico-denied-gray.png and /dev/null differ diff --git a/themes/default/images/ico-denied-pale.png b/themes/default/images/ico-denied-pale.png deleted file mode 100644 index 1e992230..00000000 Binary files a/themes/default/images/ico-denied-pale.png and /dev/null differ diff --git a/themes/default/images/ico-denied.png b/themes/default/images/ico-denied.png deleted file mode 100644 index 08f24936..00000000 Binary files a/themes/default/images/ico-denied.png and /dev/null differ diff --git a/themes/default/images/ico-error.png b/themes/default/images/ico-error.png deleted file mode 100644 index c37bd062..00000000 Binary files a/themes/default/images/ico-error.png and /dev/null differ diff --git a/themes/default/images/ico-help.png b/themes/default/images/ico-help.png deleted file mode 100644 index 5c870176..00000000 Binary files a/themes/default/images/ico-help.png and /dev/null differ diff --git a/themes/default/images/ico-info.png b/themes/default/images/ico-info.png deleted file mode 100644 index 12cd1aef..00000000 Binary files a/themes/default/images/ico-info.png and /dev/null differ diff --git a/themes/default/images/ico-lock.png b/themes/default/images/ico-lock.png deleted file mode 100644 index 2ebc4f6f..00000000 Binary files a/themes/default/images/ico-lock.png and /dev/null differ diff --git a/themes/default/images/ico-print.png b/themes/default/images/ico-print.png deleted file mode 100644 index b82a8e1e..00000000 Binary files a/themes/default/images/ico-print.png and /dev/null differ diff --git a/themes/default/images/ico-separator.gif b/themes/default/images/ico-separator.gif deleted file mode 100644 index 3de2d0d3..00000000 Binary files a/themes/default/images/ico-separator.gif and /dev/null differ diff --git a/themes/default/images/ico-success-gray.png b/themes/default/images/ico-success-gray.png deleted file mode 100644 index 74b2032f..00000000 Binary files a/themes/default/images/ico-success-gray.png and /dev/null differ diff --git a/themes/default/images/ico-success-pale.png b/themes/default/images/ico-success-pale.png deleted file mode 100644 index dc8d1ded..00000000 Binary files a/themes/default/images/ico-success-pale.png and /dev/null differ diff --git a/themes/default/images/ico-success.png b/themes/default/images/ico-success.png deleted file mode 100644 index a9925a06..00000000 Binary files a/themes/default/images/ico-success.png and /dev/null differ diff --git a/themes/default/images/ico-view-comments.png b/themes/default/images/ico-view-comments.png deleted file mode 100644 index e5d3630f..00000000 Binary files a/themes/default/images/ico-view-comments.png and /dev/null differ diff --git a/themes/default/images/ico-view-fullsize.png b/themes/default/images/ico-view-fullsize.png deleted file mode 100644 index 0be23e9b..00000000 Binary files a/themes/default/images/ico-view-fullsize.png and /dev/null differ diff --git a/themes/default/images/ico-view-hybrid.png b/themes/default/images/ico-view-hybrid.png deleted file mode 100644 index ee902e55..00000000 Binary files a/themes/default/images/ico-view-hybrid.png and /dev/null differ diff --git a/themes/default/images/ico-view-slideshow.png b/themes/default/images/ico-view-slideshow.png deleted file mode 100644 index 82f61f63..00000000 Binary files a/themes/default/images/ico-view-slideshow.png and /dev/null differ diff --git a/themes/default/images/ico-warning.png b/themes/default/images/ico-warning.png deleted file mode 100644 index 628cf2da..00000000 Binary files a/themes/default/images/ico-warning.png and /dev/null differ diff --git a/themes/default/images/select-photos-backg.png b/themes/default/images/select-photos-backg.png deleted file mode 100644 index 81c2d616..00000000 Binary files a/themes/default/images/select-photos-backg.png and /dev/null differ diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js deleted file mode 100644 index 4eee1bb2..00000000 --- a/themes/default/js/ui.init.js +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Initialize jQuery UI and Gallery Plugin elements - */ - -var short_forms = new Array( - "#gQuickSearchForm", - "#gAddTagForm", - "#gSearchForm" -); - -$(document).ready(function() { - - // Initialize Superfish menus - $("ul.gMenu").addClass("sf-menu"); - $('ul.sf-menu').superfish({ - delay: 500, - animation: { - opacity:'show', - height:'show' - }, - speed: 'fast' - }); - $("#gSiteMenu").css("display", "block"); - - // Initialize status message effects - $("#gMessage li").gallery_show_message(); - - // Initialize dialogs - $("#gLoginLink").addClass("gDialogLink"); - $(".gDialogLink").gallery_dialog(); - - // Initialize view menu - if ($("#gViewMenu").length) { - $("#gViewMenu ul").removeClass("gMenu").removeClass("sf-menu"); - $("#gViewMenu a").addClass("ui-icon"); - } - - // Initialize short forms - for (var i in short_forms) { - short_form_init(short_forms[i]); - $(short_forms[i]).addClass("gShortForm"); - } - $(".gShortForm input[type=text]").addClass("ui-corner-left"); - $(".gShortForm input[type=submit]").addClass("ui-state-default ui-corner-right"); - - // Apply jQuery UI button css to submit inputs - $("input[type=submit]:not(.gShortForm input)").addClass("ui-state-default ui-corner-all"); - - // Apply styles and icon classes to gContextMenu - if ($(".gContextMenu").length) { - $(".gContextMenu li").addClass("ui-state-default"); - $(".gContextMenu a").addClass("gButtonLink ui-icon-left"); - $(".gContextMenu a").prepend(""); - $(".gContextMenu a span").each(function() { - var iconClass = $(this).parent().attr("class").match(/ui-icon-.[^\s]+/).toString(); - $(this).addClass(iconClass); - }); - } - - // Album view only - if ($("#gAlbumGrid").length) { - // Vertical align thumbnails/metadata in album grid - $(".gItem").gallery_valign(); - - // Initialize thumbnail hover effect - $(".gItem").hover( - function() { - // Insert invisible placeholder to hold the item's position in the grid - var placeHolder = $(this).clone(); - $(placeHolder).attr("id", "gPlaceHolder"); - $(placeHolder).css("visibility", "hidden"); - $(this).after($(placeHolder)); - // Style and position the item - $(this).addClass("gHoverItem"); - var position = $(this).position(); - $(this).css("position", "absolute"); - $(this).css("top", position.top); - $(this).css("left", position.left); - $(this).css("z-index", "1000"); - // Initialize the contextual menu - $(this).gallery_context_menu(); - // Set height based on height of descendents - var title = $(this).find("h2"); - var meta = $(this).find(".gMetadata"); - var item_ht = $(this).height(); - var title_ht = $(title).gallery_height(); - var meta_ht = $(meta).gallery_height(); - var ht = item_ht + title_ht + meta_ht; - var context_label = $(this).find(".gContextMenu li:first"); - var css_id = $(this).attr("id"); - if ($("#" + css_id + " .gContextMenu li").length) { - var context_label_ht = $(context_label).gallery_height(); - ht = ht + context_label_ht; - } - $(this).height(ht); - }, - function() { - // Reset item height, position, and z-index - 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); - $(this).css("left", 0); - $(this).css("z-index", 1); - // Remove the placeholder and hover class from the item - $("#gPlaceHolder").remove(); - $(this).removeClass("gHoverItem"); - } - ); - } - - // Photo/Item item view - if ($("#gItem").length) { - // Ensure the resized image fits within its container - $("#gItem").gallery_fit_photo(); - - // Initialize context menus - var resize = $("#gItem").gallery_get_photo(); - $(resize).hover(function(){ - $(this).gallery_context_menu(); - }); - - // Add scroll effect for links to named anchors - $.localScroll({ - queue: true, - duration: 1000, - hash: true - }); - } - - // Initialize button hover effect - $.fn.gallery_hover_init(); - -}); diff --git a/themes/default/theme.info b/themes/default/theme.info deleted file mode 100644 index 5f19d0d7..00000000 --- a/themes/default/theme.info +++ /dev/null @@ -1,6 +0,0 @@ -name = "Gallery Default" -description = "A crisp and distinctive theme that uses large fonts and icons for easy navigation and an enjoyable browsing experience." -version = 1 -author = "Gallery Team" -site = 1 -admin = 0 diff --git a/themes/default/thumbnail.png b/themes/default/thumbnail.png deleted file mode 100644 index c0594db2..00000000 Binary files a/themes/default/thumbnail.png and /dev/null differ diff --git a/themes/default/views/album.html.php b/themes/default/views/album.html.php deleted file mode 100644 index 01f7be50..00000000 --- a/themes/default/views/album.html.php +++ /dev/null @@ -1,41 +0,0 @@ - - -
- album_top() ?> -

title) ?>

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

    title) ?>

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

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

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

    title) ?>

    - thumb_bottom($child) ?> - -
  • - -
-dynamic_bottom() ?> - -pager() ?> diff --git a/themes/default/views/movie.html.php b/themes/default/views/movie.html.php deleted file mode 100644 index 910814dd..00000000 --- a/themes/default/views/movie.html.php +++ /dev/null @@ -1,37 +0,0 @@ - -
- photo_top() ?> - -
    -
  • - - - - - - - -
  • -
  • $position, "total" => $sibling_count)) ?>
  • -
  • - - - - - - - -
  • -
- - - movie_img(array("class" => "gMovie", "id" => "gMovieId-{$item->id}")) ?> - -
-

title) ?>

-
description)) ?>
-
- - photo_bottom() ?> - context_menu($item, "#gMovieId-{$item->id}") ?> -
diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php deleted file mode 100644 index 19d8cc00..00000000 --- a/themes/default/views/page.html.php +++ /dev/null @@ -1,142 +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 == 'album'): ?> - - - - - - - script("jquery.js") ?> - script("jquery.form.js") ?> - script("jquery-ui.js") ?> - script("gallery.common.js") ?> - - - script("gallery.ajax.js") ?> - script("gallery.dialog.js") ?> - script("gallery.form.js") ?> - script("superfish/js/superfish.js") ?> - script("jquery.localscroll.js") ?> - script("ui.init.js") ?> - - head() they get combined */ ?> - page_type == "photo"): ?> - script("jquery.scrollTo.js") ?> - script("gallery.show_full_size.js") ?> - page_type == "movie"): ?> - script("flowplayer.js") ?> - - - head() ?> - - - body_attributes() ?>> - page_top() ?> -
- site_status() ?> -
-
- header_top() ?> - - - - - -
- site_menu() ?> -
- header_bottom() ?> -
- - - - -
-
-
-
-
- messages() ?> - -
-
-
-
- page_type != "login"): ?> - - -
-
-
- footer() ?> - - - - - -
    - credits() ?> -
- -
-
- page_bottom() ?> - - diff --git a/themes/default/views/pager.html.php b/themes/default/views/pager.html.php deleted file mode 100644 index 7cdc9bb0..00000000 --- a/themes/default/views/pager.html.php +++ /dev/null @@ -1,44 +0,0 @@ - - -
    - $current_first_item, - "to_number" => $current_last_item, - "count" => $total_items)) ?> -
  • - - - - - - - - - - - - - - -
  • -
  • -
  • - - - - - - - - - - - - - - -
  • -
diff --git a/themes/default/views/photo.html.php b/themes/default/views/photo.html.php deleted file mode 100644 index b0096043..00000000 --- a/themes/default/views/photo.html.php +++ /dev/null @@ -1,59 +0,0 @@ - - -item())): ?> - - - - -
- photo_top() ?> - -
    -
  • - - - - - - - -
  • -
  • $position, "total" => $sibling_count)) ?>
  • -
  • - - - - - - - -
  • -
- -
- resize_top($item) ?> - - for_html_attr() ?>"> - - resize_img(array("id" => "gPhotoId-{$item->id}", "class" => "gResize")) ?> - - - - resize_bottom($item) ?> - context_menu($item, "#gPhotoId-{$item->id}") ?> -
- -
-

title) ?>

-
description)) ?>
-
- - photo_bottom() ?> -
diff --git a/themes/default/views/sidebar.html.php b/themes/default/views/sidebar.html.php deleted file mode 100644 index 04379eb6..00000000 --- a/themes/default/views/sidebar.html.php +++ /dev/null @@ -1,18 +0,0 @@ - -sidebar_top() ?> -
-
- - album_menu() ?> - - photo_menu() ?> - - movie_menu() ?> - - tag_menu() ?> - -
-
- -sidebar_blocks() ?> -sidebar_bottom() ?> diff --git a/themes/wind/css/fix-ie.css b/themes/wind/css/fix-ie.css new file mode 100644 index 00000000..eee88c15 --- /dev/null +++ b/themes/wind/css/fix-ie.css @@ -0,0 +1,37 @@ +/** + * Fix display in IE 6, 7 + */ + +#gBanner, +.gBreadcrumbs, +#gAlbumGrid, +#gPager, +#gViewMenu { + zoom: 1; +} + +#gBanner { + z-index: 2; +} + +input.submit { + clear: none !important; + display: inline !important; +} + +#gAddTagForm input.textbox { + width: 110px; +} + +#gDialog a.gCancel { + display: inline-block !important; + float: none !important; +} + +.gPager .txtright { + width: 29%; +} + +.gPager .ui-icon-right { + width: 60px; +} diff --git a/themes/wind/css/screen.css b/themes/wind/css/screen.css new file mode 100644 index 00000000..64ecf775 --- /dev/null +++ b/themes/wind/css/screen.css @@ -0,0 +1,1128 @@ +/** + * Gallery 3 Default Theme Screen Styles + * + * @requires YUI reset, font, grids CSS + * + * Sheet organization: + * 1) Basic HTML elements + * 2) Reusable classes + * 3) Reusable content blocks + * 4) Page layout containers + * 5) Content blocks in specific layout containers + * 6) Navigation and menus + * 7) Browser hacks + * 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; +} + +p { + margin-bottom: 1em; +} + +em { + font-style: oblique; +} + +h1, h2, h3, h4, h5, strong, th { + font-weight: bold; +} + +h1 { + font-size: 1.7em; +} + +#gSearchResults h1 { + margin-bottom: 1em; +} + +#gProgress h1 { + font-size: 1.1em; +} + +h2 { + font-size: 1.4em; +} + +#gSidebar .gBlock h2 { + font-size: 1.2em; +} + +#gSidebar .gBlock li { + margin-bottom: .6em; +} + +h3 { + font-size: 1.2em; +} + +/* Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +a, +.gMenu a, +#gDialog a, +.gButtonLink, +.gButtonLink:hover, +.gButtonLink:active, +a.ui-state-hover, +input.ui-state-hover, +button.ui-state-hover { + color: #5382bf !important; + cursor: pointer !important; + text-decoration: none; + -moz-outline-style: none; +} + +a:hover, +#gDialog a:hover { + text-decoration: underline; +} + +.gMenu a:hover { + text-decoration: none; +} + +#gDialog .gCancel { + clear: none; + float: left; + margin: .3em 1em; +} + +#gForgotPasswordLink { + float: right; + font-size: .9em; +} + +#gDialog .gCancel { + float: left; +} + +#gDialog #gMessage li { + width: 400px; + white-space: normal; + padding-left: 32px; +} + +/* Tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +table { + width: 100%; +} + +#gContent table { + margin: 1em 0; +} + +caption, +th { + text-align: left; +} + +th, +td { + border: none; + border-bottom: 1px solid #ccc; + padding: .5em; + vertical-align: top; +} + +/* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +fieldset { + border: 1px solid #ccc; + padding-bottom: .8em; +} + +#gBanner fieldset, +#gSidebar fieldset, +.gShortForm fieldset { + border: none; +} + +legend { + font-weight: bold; + margin-left: 1em; +} + +#gBanner legend, +#gSidebar legend, +#gContent #gSearchForm legend, +input[type="hidden"], +.gShortForm 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: 100%; + 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 ~~~~~~~~~~~~~~~~~~~~~~~ */ + +.gValidationRule { + font-size: 80%; + margin-top: .5em; +} + +form.gError input[type="text"], +li.gError input[type="text"], +form.gError input[type="password"], +li.gError input[type="password"], +form.gError input[type="checkbox"], +li.gError input[type="checkbox"], +form.gError input[type="radio"], +li.gError input[type="radio"], +form.gError textarea, +li.gError textarea, +form.gError select, +li.gError select { + border: 2px solid red; +} + +/** ******************************************************************* + * 2) Reusable generic classes + *********************************************************************/ + +.inactive, .understate { + color: #ccc; + font-weight: normal; +} + +.left { + float: left; + margin: 1em 1em 1em 0; +} + +.right { + float: right; + margin: 1em 0 1em 1em; +} + +.txtright { + text-align: right; +} + +/** ******************************************************************* + * 3) Reusable content blocks + *********************************************************************/ + +.gBlock { + clear: both; + margin-bottom: 2.5em; +} + +.gBlock h2 { + background-color: #e8e8e8; + padding: .3em .8em; +} + +.gBlockContent { + margin-top: 1em; +} + +/* Status messages ~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gMessage { + width: 100%; +} + +#gSiteStatus li, +#gMessage li, +.gModuleStatus { + border: 1px solid #ccc; + margin-bottom: .4em; +} + +#gSiteStatus li { + margin-bottom: 0; + border: none; + border-bottom: 1px solid #ccc; +} + +.gModuleStatus { + clear: both; + margin-bottom: 1em; +} + +.gError, +.gInfo, +.gSuccess, +.gWarning { + background-position: .4em 50%; + background-repeat: no-repeat; + padding: .4em .5em .4em 30px; +} + +.gError { + background-color: #f6cbca; + background-image: url('../images/ico-error.png'); +} + +.gInfo { + background-color: #e8e8e8; + background-image: url('../images/ico-info.png'); +} + +.gSuccess { + background-color: #d9efc2; + background-image: url('../images/ico-success.png'); +} + +.gWarning { + background-color: #fcf9ce; + background-image: url('../images/ico-warning.png'); +} + +form .gError, +.gPager .gInfo { + background-color: #fff !important; +} + +.gPager .gInfo { + background-image: none !important; + padding: 0 !important; +} + +/* Inline layout (forms, lists) ~~~~~~~~~~ */ + +.gShortForm li { + float: left; + padding: .4em 0; +} + +.gShortForm input[type="text"] { + color: #666; + padding: .3em .6em; + width: 11em; +} + +/*** ****************************************************************** + * 4) Page layout containers + *********************************************************************/ + +/* View container ~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.gView { + background-color: #fff; + border: 1px solid #ccc; + border-bottom: none; +} + +/* Layout containers ~~~~~~~~~~~~~~~~~~~~~ */ + +#gHeader { + margin-bottom: 1em; +} + +#gBanner { + background-color: #e8e8e8; + border-bottom: 1px solid #ccc; + font-size: .8em; + min-height: 5em; + padding: 1em 20px; + position: relative; +} + +#gContent { + font-size: 1.2em; + padding-left: 20px; + position: relative; + width: 696px; +} + +#gSidebar { + font-size: .9em; + padding: 0 20px; + width: 220px; +} + +#gFooter { + background-color: #e8e8e8; + border-top: 1px solid #ccc; + font-size: .8em; + margin-top: 20px; + padding: 10px 20px; +} + +/** ******************************************************************* + * 5) Content blocks in specific layout containers + *********************************************************************/ + +/* Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gBanner #gLogo img { + margin: 0; +} + +#gBanner #gQuickSearchForm { + clear: right; + float: right; + margin-top: 1em; +} + +#gBanner #gQuickSearchForm input[type='text'] { + width: 17em; +} + +#gContent .gBlock h2 { + background-color: transparent; + padding-left: 0; +} + +#gSidebar .gBlockContent { + padding-left: 1em; +} + +/* Album content ~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gContent #gAlbumGrid { + margin: 1em 0; + position: relative; + z-index: 1; +} + +#gContent #gAlbumGrid .gItem { + background-color: #fff; + border: 1px solid #fff; + float: left; + font-size: .7em; + height: 220px; + overflow: hidden; + padding: .6em 8px; + position: relative; + text-align: center; + width: 213px; + z-index: 1; +} + +#gContent #gAlbumGrid .gItem h2 { + margin: 5px 0; +} + +#gContent .gPhoto h2, +#gContent .gItem .gMetadata { + display: none; +} + +#gContent #gAlbumGrid .gAlbum { + background-color: #e8e8e8; +} + +#gContent #gAlbumGrid .gAlbum h2 span { + background: transparent url('../images/ico-album.png') no-repeat top left; + display: inline-block; + height: 16px; + margin-right: 5px; + width: 16px; +} + +#gContent #gAlbumGrid .gHoverItem { + background-color: #fff; + border: 1px solid #000; +} + +#gContent .gHoverItem h2, +#gContent .gHoverItem .gMetadata { + display: block; +} + +/* Individual photo content ~~~~~~~~~~~~~~ */ + +#gContent #gItem { + position: relative; + width: 99%; +} + +#gContent #gPhoto { + position: relative; +} + +#gContent #gItem .gFullSizeLink img { + display: block; + margin: 1em auto !important; +} + +#gContent #gComments { + margin-top: 2em; + position: relative; +} + +#gContent #gComments ul li { + margin: 1em 0; +} + +#gContent #gComments .gAuthor { + border-bottom: 1px solid #ccc; + color: #999; + height: 32px; + line-height: 32px; +} + +#gContent #gComments ul li div { + padding: 0 8px 8px 43px; +} + +#gContent #gComments ul li #gRecaptcha { + padding: 0; +} + +#gContent #gComments ul li #gRecaptcha div { + padding: 0; +} + +#gContent #gComments .gAvatar { + height: 32px; + margin-right: .4em; + width: 32px; +} + +#gAddCommentButton { + position: absolute; + right: 0; + top: 2px; +} + +#gContent #gAddCommentForm { + margin-top: 2em; +} + +/* Footer content ~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gBanner #gLoginMenu li, +#gFooter #gCredits li { + display: inline; +} + +#gBanner #gLoginMenu li { + padding-left: 1.2em; +} + +#gFooter #gCredits li { + padding-right: 1.2em; +} + +#gContent #gSearchResults { + margin-top: 1em; + padding-top: 1em; +} + +/** ******************************************************************* + * 5) Navigation and menus + *********************************************************************/ + +#gSiteMenu, +#gTagCloud ul { + font-size: 1.2em; +} + +/* Login menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gBanner #gLoginMenu { + color: #999; + float: right; +} + +/* Site Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gSiteMenu { + bottom: 0; + display: none; + left: 140px; + position: absolute; +} + +#gSiteMenu ul { + margin-bottom: 0 !important; +} + +/* Context Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.gContextMenu { + position: absolute; + bottom: 0; + left: 0; +} + +.gItem .gContextMenu { + display: none; + margin-top: 2em; + width: 100%; +} + +#gItem .gContextMenu { + font-size: .7em; +} + +#gItem .gContextMenu ul { + display: none; +} + +.gContextMenu li { + border-left: none; + border-right: none; + border-bottom: none; +} + +.gContextMenu li a { + display: block; + line-height: 1.6em; +} + +.gHoverItem .gContextMenu { + display: block; +} + +.gHoverItem .gContextMenu li { + text-align: left; +} + +.gHoverItem .gContextMenu a:hover { + text-decoration: none; +} + +/* View Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gViewMenu { + margin-bottom: 1em; +} + +#gViewMenu a { + background-repeat: no-repeat; + background-position: 50% 50%; + height: 28px !important; + width: 43px !important; +} + +#gViewMenu #gHybridLink { + background-image: url('../images/ico-view-hybrid.png'); +} + +#gViewMenu #gSlideshowLink { + background-image: url('../images/ico-view-slideshow.png'); +} + +#gViewMenu .gFullSizeLink { + background-image: url('../images/ico-view-fullsize.png'); +} + +#gViewMenu #gCommentsLink { + background-image: url('../images/ico-view-comments.png'); +} + +#gViewMenu #gDigibugLink { + background-image: url('../images/ico-print.png'); +} + +/* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.gBreadcrumbs { + padding: 0 20px; +} + +.gBreadcrumbs li { + background: transparent url('../images/ico-separator.gif') no-repeat scroll left center; + float: left; + padding: 10px 6px 10px 16px !important; +} + +.gBreadcrumbs li.root { + background: transparent; +} + +.gBreadcrumbs li a, +.gBreadcrumbs li span { + display: block; +} + +.gBreadcrumbs li.active, +.gBreadcrumbs li.active span { + font-weight: bold; +} + +#gDialog ul.gBreadcrumbs { + clear: both; + margin-left: 0; + padding-left: 0; +} + +#gDialog .gBreadcrumbs li { + font-size: .9em; +} + +/* Tags and cloud ~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gTagCloud ul { + text-align: justify; +} + +#gTagCloud ul li { + display: inline; + line-height: 1.5em; + text-align: justify; +} + +#gTagCloud ul li a { + text-decoration: none; +} + +#gTagCloud ul li span { + display: none; +} + +#gTagCloud ul li.size1 a { + color: #9cf; + font-size: 80%; + font-weight: 100; +} + +#gTagCloud ul li.size2 a { + color: #69f; + font-size: 90%; + font-weight: 300; +} + +#gTagCloud ul li.size3 a { + color: #69c; + font-size: 100%; + font-weight: 500; +} + +#gTagCloud ul li.size4 a { + color: #369; + font-size: 110%; + font-weight: 700; +} + +#gTagCloud ul li.size5 a { + color: #0e2b52; + font-size: 120%; + font-weight: 900; +} + +#gTagCloud ul li.size6 a { + color: #0e2b52; + font-size: 130%; + font-weight: 900; +} + +#gTagCloud ul li.size7 a { + color: #0e2b52; + font-size: 140%; + font-weight: 900; +} + +#gTagCloud ul li a:hover { + color: #f30; + text-decoration: underline; +} + +#gWelcomeMessage p { + padding-bottom: 1em; +} + +/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.gPager { + clear: both; + margin: 0; + padding: 5px 0 !important; + width: 100%; +} + +.gPager li { + float: left; + margin: 0; + width: 30%; +} + +.gPager .gInfo { + text-align: center; + width: 40%; +} + +/** ******************************************************************* + * 6) Browser hacks + *********************************************************************/ + +#gHeader:after, +#gAlbumGrid:after, +.gPager:after, +#gViewMenu:after { + clear: both; + content: "."; + display: block; + height: 0; + visibility: hidden; +} + +/** ******************************************************************* + * 7) jQuery and jQuery UI + *********************************************************************/ + +/* Superfish menu overrides ~~~~~~~~~~~~~~ */ + +.sf-menu li li, .sf-menu li li ul li { + background-color: #bdd2ff; +} + +.sf-menu li:hover { + background-color: #dfe9ff; +} + +/* Ajax loading indicator ~~~~~~~~~~~~~~~~ */ + +.gLoadingLarge { + background: #e8e8e8 url('../../../lib/images/loading-large.gif') no-repeat center center; + font-size: 0; +} + +.gDialogLoadingLarge { + background: url('../../../lib/images/loading-large.gif') no-repeat center center !important; + font-size: 0; +} + +.gLoadingSmall { + background: #e8e8e8 url('../../../lib/images/loading-small.gif') no-repeat center center; + font-size: 0; +} + +.gDraggable { + cursor: move; +} + +.gDropTarget { + background-color: #cfdeff; + border: 1px dotted #999; + height: 100px; + margin: 1em 0; +} + +/* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */ + +.ui-widget-overlay { + background: #000; + opacity: .7; +} + +#gDialog { + text-align: left; +} + +#gDialog li { + padding-left: 0; +} + +#gDialog form input[type="text"], +#gDialog form input[type="password"] { + width: 100%; +} + +#gDialog #gLoginForm, +#gDialog #gAddUserForm, +#gDialog #gAddGroupForm { + margin: 0 auto; + width: 270px; +} + +#gDialog fieldset { + border: none; +} + +#gDialog legend { + display: none; +} + +#gDialog p { + margin: 0; +} + +/* jQuery UI ThemeRoller buttons */ + +.gButtonLink { + display: inline-block; + margin: 0 4px 0 0; + padding: .2em .4em; + outline: 0; +} + +.gButtonSet { + padding-left: 1px; +} + +.gButtonSet li { + float: left; +} + +.gButtonSet .gButtonLink { + 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; +} + +/* STUFF THAT NEEDS A HOME */ + +#gMove ul { + padding-left: 1em; +} + +#gMove .selected { + background: #999; +} + +/* Server Add */ + +#gServerAdd button { + margin-bottom: .5em; +} + +#gServerAddTree { + cursor: pointer; + padding-left: 4px; + width: 95%; +} + +#gServerAddTree li { + padding: 0; + float: none; +} + +#gServerAddTree span.selected { + background: #ddd; +} + +#gServerAddTree { + border: 1px solid #ccc; + height: 20em; + overflow: auto; + margin-bottom: .5em; + padding: .5em; +} + +#gServerAdd ul ul li { + padding-left: 1.2em; +} + +/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#gEditPermissionForm { + clear: both; +} +#gEditPermissionForm fieldset { + border: 1px solid #cccccc; + padding: 0; +} + +#gPermissions .gDenied, +#gPermissions .gAllowed { + text-align: center; + vertical-align: middle; +} +#gPermissions .gDenied { + background-color: #fcc; +} +#gPermissions .gAllowed { + background-color: #cfc; +} + +/*************** STUFF THAT NEEDS A HOME ****************/ + +.gProgressBar { + height: 1em; + width: 100%; + margin-top: .5em; + display: inline-block; +} + +#gAddPhotos span { + clear: both; + display: block; +} + +#gAddPhotosCanvas { + height: 325px; + width: 450px; + overflow: auto; +} + +#gAddPhotosQueue .progressbar { + height: 4px; +} + +#gAddPhotosQueue .title { + font-size: 1.25em; +} + +#gAddPhotosQueue .status { + font-size: .75em; +} + +#gAddPhotosQueue .box { + margin-bottom: 8px; + padding: 4px; +} + +#gAddPhotosQueue .pending { + background-color: #e8e8e8; + border: 1px solid #d7d7d7; +} + +#gAddPhotosQueue .error { + background-color: #fcc; + border: 1px solid #ebb; +} + +#gAddPhotosQueue .uploading { + background-color: #ff9; + border: 1px solid #ee8; +} + +#gAddPhotosQueue .complete { + background-color: #cfc; + border: 1px solid #beb; +} + +#gAdminG2ImportNotes { + padding-bottom: 20px; +} + +#gAdminG2ImportDetails { + padding-top: 20px; +} + +#gAdminG2ImportDetails .gWarning { + margin-top: 4px; +} + +#gAdminG2ImportDetails .gInfo { + padding: 2px; + border: 1px solid #999; + margin-bottom: 10px; +} + +#gAdminG2ImportNotes p, +#gAdminG2ImportDetails .gInfo p { + padding: 0; + margin: 0; +} + +#gAdminG2ImportNotes ul li, +#gAdminG2Import .gInfo ul li { + padding-left: 0; + margin-left: 20px; + list-style-type: disc; +} + +/* Right to left styles ~~~~~~~~~~~~~~~~~~~~ */ + +.rtl { + direction: rtl; +} + +.rtl caption, +.rtl th, +.rtl #gDialog { + text-align: right; +} + +.rtl #gHeader #gQuickSearchForm, +.rtl #gForgotPasswordLink, +.rtl #gHeader #gLoginMenu, +.rtl .ui-icon-right .ui-icon { + clear: left; + float: left; +} + +.rtl #gDialog .gCancel, +.rtl form ul ul li, +.rtl input[type="submit"], +.rtl input[type="reset"], +.rtl .gShortForm li, +.rtl #gHeader #gLogo img, +.rtl #gContent #gAlbumGrid .gItem, +.rtl #gSiteMenu, +.rtl .gBreadcrumbs li, +.rtl .gPager li, +.rtl .gButtonSet li, +.rtl .ui-icon-left .ui-icon { + float: right; +} + diff --git a/themes/wind/images/avatar.jpg b/themes/wind/images/avatar.jpg new file mode 100644 index 00000000..acad9314 Binary files /dev/null and b/themes/wind/images/avatar.jpg differ diff --git a/themes/wind/images/ico-album.png b/themes/wind/images/ico-album.png new file mode 100644 index 00000000..affa1b84 Binary files /dev/null and b/themes/wind/images/ico-album.png differ diff --git a/themes/wind/images/ico-denied-gray.png b/themes/wind/images/ico-denied-gray.png new file mode 100644 index 00000000..56db3ff5 Binary files /dev/null and b/themes/wind/images/ico-denied-gray.png differ diff --git a/themes/wind/images/ico-denied-pale.png b/themes/wind/images/ico-denied-pale.png new file mode 100644 index 00000000..1e992230 Binary files /dev/null and b/themes/wind/images/ico-denied-pale.png differ diff --git a/themes/wind/images/ico-denied.png b/themes/wind/images/ico-denied.png new file mode 100644 index 00000000..08f24936 Binary files /dev/null and b/themes/wind/images/ico-denied.png differ diff --git a/themes/wind/images/ico-error.png b/themes/wind/images/ico-error.png new file mode 100644 index 00000000..c37bd062 Binary files /dev/null and b/themes/wind/images/ico-error.png differ diff --git a/themes/wind/images/ico-help.png b/themes/wind/images/ico-help.png new file mode 100644 index 00000000..5c870176 Binary files /dev/null and b/themes/wind/images/ico-help.png differ diff --git a/themes/wind/images/ico-info.png b/themes/wind/images/ico-info.png new file mode 100644 index 00000000..12cd1aef Binary files /dev/null and b/themes/wind/images/ico-info.png differ diff --git a/themes/wind/images/ico-lock.png b/themes/wind/images/ico-lock.png new file mode 100644 index 00000000..2ebc4f6f Binary files /dev/null and b/themes/wind/images/ico-lock.png differ diff --git a/themes/wind/images/ico-print.png b/themes/wind/images/ico-print.png new file mode 100644 index 00000000..b82a8e1e Binary files /dev/null and b/themes/wind/images/ico-print.png differ diff --git a/themes/wind/images/ico-separator.gif b/themes/wind/images/ico-separator.gif new file mode 100644 index 00000000..3de2d0d3 Binary files /dev/null and b/themes/wind/images/ico-separator.gif differ diff --git a/themes/wind/images/ico-success-gray.png b/themes/wind/images/ico-success-gray.png new file mode 100644 index 00000000..74b2032f Binary files /dev/null and b/themes/wind/images/ico-success-gray.png differ diff --git a/themes/wind/images/ico-success-pale.png b/themes/wind/images/ico-success-pale.png new file mode 100644 index 00000000..dc8d1ded Binary files /dev/null and b/themes/wind/images/ico-success-pale.png differ diff --git a/themes/wind/images/ico-success.png b/themes/wind/images/ico-success.png new file mode 100644 index 00000000..a9925a06 Binary files /dev/null and b/themes/wind/images/ico-success.png differ diff --git a/themes/wind/images/ico-view-comments.png b/themes/wind/images/ico-view-comments.png new file mode 100644 index 00000000..e5d3630f Binary files /dev/null and b/themes/wind/images/ico-view-comments.png differ diff --git a/themes/wind/images/ico-view-fullsize.png b/themes/wind/images/ico-view-fullsize.png new file mode 100644 index 00000000..0be23e9b Binary files /dev/null and b/themes/wind/images/ico-view-fullsize.png differ diff --git a/themes/wind/images/ico-view-hybrid.png b/themes/wind/images/ico-view-hybrid.png new file mode 100644 index 00000000..ee902e55 Binary files /dev/null and b/themes/wind/images/ico-view-hybrid.png differ diff --git a/themes/wind/images/ico-view-slideshow.png b/themes/wind/images/ico-view-slideshow.png new file mode 100644 index 00000000..82f61f63 Binary files /dev/null and b/themes/wind/images/ico-view-slideshow.png differ diff --git a/themes/wind/images/ico-warning.png b/themes/wind/images/ico-warning.png new file mode 100644 index 00000000..628cf2da Binary files /dev/null and b/themes/wind/images/ico-warning.png differ diff --git a/themes/wind/images/select-photos-backg.png b/themes/wind/images/select-photos-backg.png new file mode 100644 index 00000000..81c2d616 Binary files /dev/null and b/themes/wind/images/select-photos-backg.png differ diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js new file mode 100644 index 00000000..4eee1bb2 --- /dev/null +++ b/themes/wind/js/ui.init.js @@ -0,0 +1,141 @@ +/** + * Initialize jQuery UI and Gallery Plugin elements + */ + +var short_forms = new Array( + "#gQuickSearchForm", + "#gAddTagForm", + "#gSearchForm" +); + +$(document).ready(function() { + + // Initialize Superfish menus + $("ul.gMenu").addClass("sf-menu"); + $('ul.sf-menu').superfish({ + delay: 500, + animation: { + opacity:'show', + height:'show' + }, + speed: 'fast' + }); + $("#gSiteMenu").css("display", "block"); + + // Initialize status message effects + $("#gMessage li").gallery_show_message(); + + // Initialize dialogs + $("#gLoginLink").addClass("gDialogLink"); + $(".gDialogLink").gallery_dialog(); + + // Initialize view menu + if ($("#gViewMenu").length) { + $("#gViewMenu ul").removeClass("gMenu").removeClass("sf-menu"); + $("#gViewMenu a").addClass("ui-icon"); + } + + // Initialize short forms + for (var i in short_forms) { + short_form_init(short_forms[i]); + $(short_forms[i]).addClass("gShortForm"); + } + $(".gShortForm input[type=text]").addClass("ui-corner-left"); + $(".gShortForm input[type=submit]").addClass("ui-state-default ui-corner-right"); + + // Apply jQuery UI button css to submit inputs + $("input[type=submit]:not(.gShortForm input)").addClass("ui-state-default ui-corner-all"); + + // Apply styles and icon classes to gContextMenu + if ($(".gContextMenu").length) { + $(".gContextMenu li").addClass("ui-state-default"); + $(".gContextMenu a").addClass("gButtonLink ui-icon-left"); + $(".gContextMenu a").prepend(""); + $(".gContextMenu a span").each(function() { + var iconClass = $(this).parent().attr("class").match(/ui-icon-.[^\s]+/).toString(); + $(this).addClass(iconClass); + }); + } + + // Album view only + if ($("#gAlbumGrid").length) { + // Vertical align thumbnails/metadata in album grid + $(".gItem").gallery_valign(); + + // Initialize thumbnail hover effect + $(".gItem").hover( + function() { + // Insert invisible placeholder to hold the item's position in the grid + var placeHolder = $(this).clone(); + $(placeHolder).attr("id", "gPlaceHolder"); + $(placeHolder).css("visibility", "hidden"); + $(this).after($(placeHolder)); + // Style and position the item + $(this).addClass("gHoverItem"); + var position = $(this).position(); + $(this).css("position", "absolute"); + $(this).css("top", position.top); + $(this).css("left", position.left); + $(this).css("z-index", "1000"); + // Initialize the contextual menu + $(this).gallery_context_menu(); + // Set height based on height of descendents + var title = $(this).find("h2"); + var meta = $(this).find(".gMetadata"); + var item_ht = $(this).height(); + var title_ht = $(title).gallery_height(); + var meta_ht = $(meta).gallery_height(); + var ht = item_ht + title_ht + meta_ht; + var context_label = $(this).find(".gContextMenu li:first"); + var css_id = $(this).attr("id"); + if ($("#" + css_id + " .gContextMenu li").length) { + var context_label_ht = $(context_label).gallery_height(); + ht = ht + context_label_ht; + } + $(this).height(ht); + }, + function() { + // Reset item height, position, and z-index + 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); + $(this).css("left", 0); + $(this).css("z-index", 1); + // Remove the placeholder and hover class from the item + $("#gPlaceHolder").remove(); + $(this).removeClass("gHoverItem"); + } + ); + } + + // Photo/Item item view + if ($("#gItem").length) { + // Ensure the resized image fits within its container + $("#gItem").gallery_fit_photo(); + + // Initialize context menus + var resize = $("#gItem").gallery_get_photo(); + $(resize).hover(function(){ + $(this).gallery_context_menu(); + }); + + // Add scroll effect for links to named anchors + $.localScroll({ + queue: true, + duration: 1000, + hash: true + }); + } + + // Initialize button hover effect + $.fn.gallery_hover_init(); + +}); diff --git a/themes/wind/theme.info b/themes/wind/theme.info new file mode 100644 index 00000000..17ea7c20 --- /dev/null +++ b/themes/wind/theme.info @@ -0,0 +1,6 @@ +name = "Gallery Wind" +description = "A crisp and distinctive theme that uses large fonts and icons for easy navigation and an enjoyable browsing experience." +version = 1 +author = "Gallery Team" +site = 1 +admin = 0 diff --git a/themes/wind/thumbnail.png b/themes/wind/thumbnail.png new file mode 100644 index 00000000..c0594db2 Binary files /dev/null and b/themes/wind/thumbnail.png differ diff --git a/themes/wind/views/album.html.php b/themes/wind/views/album.html.php new file mode 100644 index 00000000..01f7be50 --- /dev/null +++ b/themes/wind/views/album.html.php @@ -0,0 +1,41 @@ + + +
+ album_top() ?> +

title) ?>

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

    title) ?>

    + +
  • + + + admin || access::can("add", $item)): ?> + id") ?> +
  • Add some.", + array("attrs" => html::mark_clean("href=\"$addurl\" class=\"gDialogLink\""))) ?>
  • + +
  • + + +
+album_bottom() ?> + +pager() ?> diff --git a/themes/wind/views/block.html.php b/themes/wind/views/block.html.php new file mode 100644 index 00000000..e8cff833 --- /dev/null +++ b/themes/wind/views/block.html.php @@ -0,0 +1,10 @@ + + + + +
+

+
+ +
+
diff --git a/themes/wind/views/dynamic.html.php b/themes/wind/views/dynamic.html.php new file mode 100644 index 00000000..9ed9d69b --- /dev/null +++ b/themes/wind/views/dynamic.html.php @@ -0,0 +1,29 @@ + +
+
+ dynamic_top() ?> +
+

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

    title) ?>

    + thumb_bottom($child) ?> + +
  • + +
+dynamic_bottom() ?> + +pager() ?> diff --git a/themes/wind/views/movie.html.php b/themes/wind/views/movie.html.php new file mode 100644 index 00000000..910814dd --- /dev/null +++ b/themes/wind/views/movie.html.php @@ -0,0 +1,37 @@ + +
+ photo_top() ?> + +
    +
  • + + + + + + + +
  • +
  • $position, "total" => $sibling_count)) ?>
  • +
  • + + + + + + + +
  • +
+ + + movie_img(array("class" => "gMovie", "id" => "gMovieId-{$item->id}")) ?> + +
+

title) ?>

+
description)) ?>
+
+ + photo_bottom() ?> + context_menu($item, "#gMovieId-{$item->id}") ?> +
diff --git a/themes/wind/views/page.html.php b/themes/wind/views/page.html.php new file mode 100644 index 00000000..19d8cc00 --- /dev/null +++ b/themes/wind/views/page.html.php @@ -0,0 +1,142 @@ + + + + + + + <? 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 == 'album'): ?> + + + + + + + script("jquery.js") ?> + script("jquery.form.js") ?> + script("jquery-ui.js") ?> + script("gallery.common.js") ?> + + + script("gallery.ajax.js") ?> + script("gallery.dialog.js") ?> + script("gallery.form.js") ?> + script("superfish/js/superfish.js") ?> + script("jquery.localscroll.js") ?> + script("ui.init.js") ?> + + head() they get combined */ ?> + page_type == "photo"): ?> + script("jquery.scrollTo.js") ?> + script("gallery.show_full_size.js") ?> + page_type == "movie"): ?> + script("flowplayer.js") ?> + + + head() ?> + + + body_attributes() ?>> + page_top() ?> +
+ site_status() ?> +
+
+ header_top() ?> + + + + + +
+ site_menu() ?> +
+ header_bottom() ?> +
+ + + + +
+
+
+
+
+ messages() ?> + +
+
+
+
+ page_type != "login"): ?> + + +
+
+
+ footer() ?> + + + + + +
    + credits() ?> +
+ +
+
+ page_bottom() ?> + + diff --git a/themes/wind/views/pager.html.php b/themes/wind/views/pager.html.php new file mode 100644 index 00000000..7cdc9bb0 --- /dev/null +++ b/themes/wind/views/pager.html.php @@ -0,0 +1,44 @@ + + +
    + $current_first_item, + "to_number" => $current_last_item, + "count" => $total_items)) ?> +
  • + + + + + + + + + + + + + + +
  • +
  • +
  • + + + + + + + + + + + + + + +
  • +
diff --git a/themes/wind/views/photo.html.php b/themes/wind/views/photo.html.php new file mode 100644 index 00000000..b0096043 --- /dev/null +++ b/themes/wind/views/photo.html.php @@ -0,0 +1,59 @@ + + +item())): ?> + + + + +
+ photo_top() ?> + +
    +
  • + + + + + + + +
  • +
  • $position, "total" => $sibling_count)) ?>
  • +
  • + + + + + + + +
  • +
+ +
+ resize_top($item) ?> + + for_html_attr() ?>"> + + resize_img(array("id" => "gPhotoId-{$item->id}", "class" => "gResize")) ?> + + + + resize_bottom($item) ?> + context_menu($item, "#gPhotoId-{$item->id}") ?> +
+ +
+

title) ?>

+
description)) ?>
+
+ + photo_bottom() ?> +
diff --git a/themes/wind/views/sidebar.html.php b/themes/wind/views/sidebar.html.php new file mode 100644 index 00000000..04379eb6 --- /dev/null +++ b/themes/wind/views/sidebar.html.php @@ -0,0 +1,18 @@ + +sidebar_top() ?> +
+
+ + album_menu() ?> + + photo_menu() ?> + + movie_menu() ?> + + tag_menu() ?> + +
+
+ +sidebar_blocks() ?> +sidebar_bottom() ?> -- cgit v1.2.3 From b038e9cbb4d913088a26f8c4e6e4699de9c860d7 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 23 Sep 2009 17:03:25 -0700 Subject: set the version number to 13, so we will update the default themes in the gallery vars --- modules/gallery/helpers/gallery_installer.php | 11 +++++++++++ modules/gallery/module.info | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 6500482b..6ea1b227 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -364,6 +364,17 @@ class gallery_installer { $db->query("UPDATE {items} SET `relative_url_cache` = NULL, `relative_path_cache` = NULL"); module::set_version("gallery", $version = 12); } + + if ($version == 12) { + if (module::get_var("gallery", "active_site_theme") == "default") { + module::set_var("gallery", "active_site_theme", "wind"); + } + if (module::get_var("gallery", "active_admin_theme") == "admin_default") { + module::set_var("gallery", "active_admin_theme", "admin_wind"); + } + module::set_version("gallery", $version = 13); + } + } static function uninstall() { diff --git a/modules/gallery/module.info b/modules/gallery/module.info index 70bd91e2..65a0691c 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = "Gallery 3" description = "Gallery core application" -version = 12 +version = 13 -- cgit v1.2.3 From 8bab030883647ffaf0e0bd4d172261159d19dd08 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 23 Sep 2009 19:45:23 -0700 Subject: Add a new api method gallery::find_file. This wraps the Kohana::find_file function, but allows the extension to supplied as part of the filename. Changed the Edit permission dialog to use the new api method to locate the icons from the active theme. --- modules/gallery/helpers/gallery.php | 14 +++++++++++ modules/gallery/views/permissions_form.html.php | 33 +++++++++++++------------ 2 files changed, 31 insertions(+), 16 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 91dd2073..d4f733e4 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -79,6 +79,20 @@ class gallery_Core { return date(module::get_var("gallery", "time_format", "H:i:s"), $timestamp); } + /** + * Provide a wrapper function for Kohana::find_file, that first strips the extension and + * then calls the Kohana::find_file supply that extension + * @param string directory to search in + * @param string filename to look for (without extension) + * @param boolean file required + * @return the file relative to the DOCROOT + */ + static function find_file($directory, $file, $required=false) { + $file_name = substr($file, 0, -strlen($ext = strrchr($file, '.'))); + $file_name = Kohana::find_file($directory, $file_name, $required, substr($ext, 1)); + return substr($file_name, strlen(DOCROOT)); + } + static function site_menu($menu, $theme) { if ($theme->page_type != "login") { $menu->append(Menu::factory("link") diff --git a/modules/gallery/views/permissions_form.html.php b/modules/gallery/views/permissions_form.html.php index a0bb35f2..f5639439 100644 --- a/modules/gallery/views/permissions_form.html.php +++ b/modules/gallery/views/permissions_form.html.php @@ -1,7 +1,6 @@
- @@ -12,7 +11,8 @@ - + name, $item) ?> name, $item) ?> @@ -20,33 +20,34 @@ @@ -55,30 +56,30 @@ -- cgit v1.2.3 From d727716af71d6b5d13a64075ba5a91cd0aead74a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 23 Sep 2009 19:51:46 -0700 Subject: Change the simple uploader dialog to use the new gallery::find_file api method. --- modules/gallery/views/simple_uploader.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php index 7f8a96df..acd2bee0 100644 --- a/modules/gallery/views/simple_uploader.html.php +++ b/modules/gallery/views/simple_uploader.html.php @@ -97,7 +97,7 @@ debug: false, // Button settings - button_image_url: , + button_image_url: , button_width: "202", button_height: "45", button_placeholder_id: "gChooseFilesButtonPlaceholder", -- cgit v1.2.3 From 054a8dedac11ffbaa030fdc178031e5f975bbbdf Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 24 Sep 2009 10:28:02 -0700 Subject: Oops, forgot to change the install version number to match the upgrade version number --- modules/gallery/helpers/gallery_installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 6ea1b227..cf13d794 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -268,7 +268,7 @@ class gallery_installer { module::set_var("gallery", "show_credits", 1); // @todo this string needs to be picked up by l10n_scanner module::set_var("gallery", "credits", "Powered by Gallery %version"); - module::set_version("gallery", 12); + module::set_version("gallery", 13); } static function upgrade($version) { -- cgit v1.2.3 From 8e16cee2c3b7df19354af366f212ce52a2a7b5c8 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 24 Sep 2009 14:24:43 -0700 Subject: Forgot to change the defaults theme names on initial install... Duh --- modules/gallery/helpers/gallery_installer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index cf13d794..ee605b27 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -224,8 +224,8 @@ class gallery_installer { $root->save(); access::add_item($root); - module::set_var("gallery", "active_site_theme", "default"); - module::set_var("gallery", "active_admin_theme", "admin_default"); + module::set_var("gallery", "active_site_theme", "wind"); + module::set_var("gallery", "active_admin_theme", "admin_wind"); module::set_var("gallery", "page_size", 9); module::set_var("gallery", "thumb_size", 200); module::set_var("gallery", "resize_size", 640); -- cgit v1.2.3 From 59c1c36639af36b3b9ec99664402f9501c290a40 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 24 Sep 2009 14:50:30 -0700 Subject: Hopefully the last 2 errant occurrences of default as it relates to theme names --- modules/gallery/libraries/Admin_View.php | 2 +- modules/gallery/libraries/Theme_View.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php index 21b70df6..a516a1ae 100644 --- a/modules/gallery/libraries/Admin_View.php +++ b/modules/gallery/libraries/Admin_View.php @@ -29,7 +29,7 @@ class Admin_View_Core extends Gallery_View { public function __construct($name) { $theme_name = module::get_var("gallery", "active_site_theme"); if (!file_exists("themes/$theme_name")) { - module::set_var("gallery", "active_site_theme", "admin_default"); + module::set_var("gallery", "active_site_theme", "admin_wind"); theme::load_themes(); Kohana::log("error", "Unable to locate theme '$theme_name', switching to default theme."); } diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 130e2dce..01d6a61b 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -30,7 +30,7 @@ class Theme_View_Core extends Gallery_View { public function __construct($name, $page_type) { $theme_name = module::get_var("gallery", "active_site_theme"); if (!file_exists("themes/$theme_name")) { - module::set_var("gallery", "active_site_theme", "default"); + module::set_var("gallery", "active_site_theme", "wind"); theme::load_themes(); Kohana::log("error", "Unable to locate theme '$theme_name', switching to default theme."); } -- cgit v1.2.3 From c51c76dcaa41085eb5cb7a1a0299bb378a175372 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 24 Sep 2009 15:06:40 -0700 Subject: Fix Admin_View to look for the the variable active_admin_theme instead of active_site_theme. In addition check for the existence of THEMEPATH . instead of theme/ --- modules/gallery/libraries/Admin_View.php | 6 +++--- modules/gallery/libraries/Theme_View.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php index a516a1ae..fd4fbea8 100644 --- a/modules/gallery/libraries/Admin_View.php +++ b/modules/gallery/libraries/Admin_View.php @@ -27,9 +27,9 @@ class Admin_View_Core extends Gallery_View { * @return void */ public function __construct($name) { - $theme_name = module::get_var("gallery", "active_site_theme"); - if (!file_exists("themes/$theme_name")) { - module::set_var("gallery", "active_site_theme", "admin_wind"); + $theme_name = module::get_var("gallery", "active_admin_theme"); + if (!file_exists(THEMEPATH . $theme_name)) { + module::set_var("gallery", "active_admin_theme", "admin_wind"); theme::load_themes(); Kohana::log("error", "Unable to locate theme '$theme_name', switching to default theme."); } diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 01d6a61b..ebd6a920 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -29,7 +29,7 @@ class Theme_View_Core extends Gallery_View { */ public function __construct($name, $page_type) { $theme_name = module::get_var("gallery", "active_site_theme"); - if (!file_exists("themes/$theme_name")) { + if (!file_exists(THEMEPATH . $theme_name)) { module::set_var("gallery", "active_site_theme", "wind"); theme::load_themes(); Kohana::log("error", "Unable to locate theme '$theme_name', switching to default theme."); -- cgit v1.2.3 From 970158f4d9904d00319c3da421024c68777a855d Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 24 Sep 2009 16:59:33 -0700 Subject: Fix unit tests by updating the xss golden file and declaring gallery_error::error_handler as static --- modules/gallery/helpers/gallery_error.php | 2 +- modules/gallery/tests/xss_data.txt | 176 +++++++++++++++--------------- 2 files changed, 89 insertions(+), 89 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/gallery_error.php b/modules/gallery/helpers/gallery_error.php index 91e05407..39568c93 100644 --- a/modules/gallery/helpers/gallery_error.php +++ b/modules/gallery/helpers/gallery_error.php @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class gallery_error_Core { - function error_handler($severity, $message, $filename, $lineno) { + static function error_handler($severity, $message, $filename, $lineno) { if (error_reporting() == 0) { return; } diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index f3c90e18..7d3cf362 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -148,31 +148,31 @@ modules/gallery/views/permissions_browse.html.php 44 DIRTY_JS $paren modules/gallery/views/permissions_browse.html.php 52 DIRTY_ATTR $item->id modules/gallery/views/permissions_browse.html.php 53 DIRTY_JS $item->id modules/gallery/views/permissions_browse.html.php 60 DIRTY $form -modules/gallery/views/permissions_form.html.php 24 DIRTY_JS $lock->id -modules/gallery/views/permissions_form.html.php 32 DIRTY_JS $group->id -modules/gallery/views/permissions_form.html.php 32 DIRTY_JS $permission->id -modules/gallery/views/permissions_form.html.php 32 DIRTY_JS $item->id -modules/gallery/views/permissions_form.html.php 36 DIRTY_JS $group->id -modules/gallery/views/permissions_form.html.php 36 DIRTY_JS $permission->id -modules/gallery/views/permissions_form.html.php 36 DIRTY_JS $item->id -modules/gallery/views/permissions_form.html.php 43 DIRTY_JS $group->id -modules/gallery/views/permissions_form.html.php 43 DIRTY_JS $permission->id -modules/gallery/views/permissions_form.html.php 43 DIRTY_JS $item->id -modules/gallery/views/permissions_form.html.php 47 DIRTY_JS $group->id -modules/gallery/views/permissions_form.html.php 47 DIRTY_JS $permission->id -modules/gallery/views/permissions_form.html.php 47 DIRTY_JS $item->id -modules/gallery/views/permissions_form.html.php 56 DIRTY_JS $group->id -modules/gallery/views/permissions_form.html.php 56 DIRTY_JS $permission->id -modules/gallery/views/permissions_form.html.php 56 DIRTY_JS $item->id -modules/gallery/views/permissions_form.html.php 63 DIRTY_JS $group->id -modules/gallery/views/permissions_form.html.php 63 DIRTY_JS $permission->id -modules/gallery/views/permissions_form.html.php 63 DIRTY_JS $item->id -modules/gallery/views/permissions_form.html.php 74 DIRTY_JS $group->id -modules/gallery/views/permissions_form.html.php 74 DIRTY_JS $permission->id -modules/gallery/views/permissions_form.html.php 74 DIRTY_JS $item->id -modules/gallery/views/permissions_form.html.php 79 DIRTY_JS $group->id -modules/gallery/views/permissions_form.html.php 79 DIRTY_JS $permission->id -modules/gallery/views/permissions_form.html.php 79 DIRTY_JS $item->id +modules/gallery/views/permissions_form.html.php 26 DIRTY_JS $lock->id +modules/gallery/views/permissions_form.html.php 34 DIRTY_JS $group->id +modules/gallery/views/permissions_form.html.php 34 DIRTY_JS $permission->id +modules/gallery/views/permissions_form.html.php 34 DIRTY_JS $item->id +modules/gallery/views/permissions_form.html.php 37 DIRTY_JS $group->id +modules/gallery/views/permissions_form.html.php 37 DIRTY_JS $permission->id +modules/gallery/views/permissions_form.html.php 37 DIRTY_JS $item->id +modules/gallery/views/permissions_form.html.php 44 DIRTY_JS $group->id +modules/gallery/views/permissions_form.html.php 44 DIRTY_JS $permission->id +modules/gallery/views/permissions_form.html.php 44 DIRTY_JS $item->id +modules/gallery/views/permissions_form.html.php 48 DIRTY_JS $group->id +modules/gallery/views/permissions_form.html.php 48 DIRTY_JS $permission->id +modules/gallery/views/permissions_form.html.php 48 DIRTY_JS $item->id +modules/gallery/views/permissions_form.html.php 57 DIRTY_JS $group->id +modules/gallery/views/permissions_form.html.php 57 DIRTY_JS $permission->id +modules/gallery/views/permissions_form.html.php 57 DIRTY_JS $item->id +modules/gallery/views/permissions_form.html.php 64 DIRTY_JS $group->id +modules/gallery/views/permissions_form.html.php 64 DIRTY_JS $permission->id +modules/gallery/views/permissions_form.html.php 64 DIRTY_JS $item->id +modules/gallery/views/permissions_form.html.php 75 DIRTY_JS $group->id +modules/gallery/views/permissions_form.html.php 75 DIRTY_JS $permission->id +modules/gallery/views/permissions_form.html.php 75 DIRTY_JS $item->id +modules/gallery/views/permissions_form.html.php 80 DIRTY_JS $group->id +modules/gallery/views/permissions_form.html.php 80 DIRTY_JS $permission->id +modules/gallery/views/permissions_form.html.php 80 DIRTY_JS $item->id modules/gallery/views/upgrader.html.php 44 DIRTY_ATTR $module->version==$module->code_version?"current":"upgradeable" modules/gallery/views/upgrader.html.php 45 DIRTY_ATTR $id modules/gallery/views/upgrader.html.php 49 DIRTY $module->version @@ -251,8 +251,8 @@ modules/search/views/search.html.php 31 DIRTY_JS $item- modules/search/views/search.html.php 32 DIRTY $item->thumb_img() modules/server_add/views/admin_server_add.html.php 15 DIRTY_ATTR $id modules/server_add/views/admin_server_add.html.php 24 DIRTY $form -modules/server_add/views/server_add_tree.html.php 12 DIRTY_JS html::js_string($dir) modules/server_add/views/server_add_tree.html.php 20 DIRTY_ATTR is_dir($file)?"ui-icon-folder-collapsed":"ui-icon-document" +modules/server_add/views/server_add_tree.html.php 21 DIRTY_ATTR is_dir($file)?"gDirectory":"gFile" modules/server_add/views/server_add_tree_dialog.html.php 3 DIRTY_JS url::site("server_add/children?path=__PATH__") modules/server_add/views/server_add_tree_dialog.html.php 4 DIRTY_JS url::site("server_add/start?item_id={$item->id}&csrf=$csrf") modules/server_add/views/server_add_tree_dialog.html.php 23 DIRTY $tree @@ -283,65 +283,65 @@ modules/user/views/user_languages_block.html.php 2 DIRTY form:: modules/watermark/views/admin_watermarks.html.php 19 DIRTY_ATTR $width modules/watermark/views/admin_watermarks.html.php 19 DIRTY_ATTR $height modules/watermark/views/admin_watermarks.html.php 19 DIRTY_ATTR $url -themes/admin_wind/views/admin.html.php 15 DIRTY_JS $theme->url() -themes/admin_wind/views/admin.html.php 32 DIRTY $theme->admin_head() -themes/admin_wind/views/admin.html.php 36 DIRTY $theme->admin_page_top() -themes/admin_wind/views/admin.html.php 44 DIRTY $theme->admin_header_top() -themes/admin_wind/views/admin.html.php 49 DIRTY_JS item::root()->url() -themes/admin_wind/views/admin.html.php 53 DIRTY $theme->admin_menu() -themes/admin_wind/views/admin.html.php 55 DIRTY $theme->admin_header_bottom() -themes/admin_wind/views/admin.html.php 62 DIRTY $content -themes/admin_wind/views/admin.html.php 68 DIRTY $sidebar -themes/admin_wind/views/admin.html.php 73 DIRTY $theme->admin_footer() -themes/admin_wind/views/admin.html.php 75 DIRTY $theme->admin_credits() -themes/admin_wind/views/admin.html.php 79 DIRTY $theme->admin_page_bottom() -themes/admin_wind/views/block.html.php 3 DIRTY_ATTR $anchor -themes/admin_wind/views/block.html.php 5 DIRTY $id -themes/admin_wind/views/block.html.php 5 DIRTY_ATTR $css_id -themes/admin_wind/views/block.html.php 13 DIRTY $title -themes/admin_wind/views/block.html.php 16 DIRTY $content -themes/admin_wind/views/pager.html.php 13 DIRTY_JS str_replace('{page}',1,$url) -themes/admin_wind/views/pager.html.php 20 DIRTY_JS str_replace('{page}',$previous_page,$url) -themes/admin_wind/views/pager.html.php 27 DIRTY $from_to_msg -themes/admin_wind/views/pager.html.php 30 DIRTY_JS str_replace('{page}',$next_page,$url) -themes/admin_wind/views/pager.html.php 37 DIRTY_JS str_replace('{page}',$last_page,$url) -themes/wind/views/album.html.php 16 DIRTY_ATTR $child->id -themes/wind/views/album.html.php 16 DIRTY_ATTR $item_class -themes/wind/views/album.html.php 18 DIRTY_JS $child->url() -themes/wind/views/album.html.php 19 DIRTY $child->thumb_img(array("class"=>"gThumbnail")) -themes/wind/views/album.html.php 23 DIRTY_JS $child->url() -themes/wind/views/block.html.php 3 DIRTY_ATTR $anchor -themes/wind/views/block.html.php 5 DIRTY_ATTR $css_id -themes/wind/views/block.html.php 6 DIRTY $title -themes/wind/views/block.html.php 8 DIRTY $content -themes/wind/views/dynamic.html.php 11 DIRTY_ATTR $child->is_album()?"gAlbum":"" -themes/wind/views/dynamic.html.php 13 DIRTY_JS $child->url() -themes/wind/views/dynamic.html.php 14 DIRTY_ATTR $child->id -themes/wind/views/dynamic.html.php 15 DIRTY_ATTR $child->thumb_url() -themes/wind/views/dynamic.html.php 16 DIRTY_ATTR $child->thumb_width -themes/wind/views/dynamic.html.php 17 DIRTY_ATTR $child->thumb_height -themes/wind/views/movie.html.php 8 DIRTY_JS $previous_item->url() -themes/wind/views/movie.html.php 18 DIRTY_JS $next_item->url() -themes/wind/views/movie.html.php 28 DIRTY $item->movie_img(array("class"=>"gMovie","id"=>"gMovieId-{$item->id}")) -themes/wind/views/page.html.php 9 DIRTY $page_title -themes/wind/views/page.html.php 32 DIRTY_JS $theme->url() -themes/wind/views/page.html.php 41 DIRTY $new_width -themes/wind/views/page.html.php 42 DIRTY $new_height -themes/wind/views/page.html.php 43 DIRTY $thumb_proportion -themes/wind/views/page.html.php 82 DIRTY $header_text -themes/wind/views/page.html.php 84 DIRTY_JS item::root()->url() -themes/wind/views/page.html.php 102 DIRTY_JS $parent->url($parent==$theme->item()->parent()?"show={$theme->item()->id}":null) -themes/wind/views/page.html.php 117 DIRTY $content -themes/wind/views/page.html.php 123 DIRTY newView("sidebar.html") -themes/wind/views/page.html.php 130 DIRTY $footer_text -themes/wind/views/pager.html.php 13 DIRTY_JS str_replace('{page}',1,$url) -themes/wind/views/pager.html.php 20 DIRTY_JS str_replace('{page}',$previous_page,$url) -themes/wind/views/pager.html.php 27 DIRTY $from_to_msg -themes/wind/views/pager.html.php 30 DIRTY_JS str_replace('{page}',$next_page,$url) -themes/wind/views/pager.html.php 37 DIRTY_JS str_replace('{page}',$last_page,$url) -themes/wind/views/photo.html.php 8 DIRTY_JS $theme->item()->width -themes/wind/views/photo.html.php 8 DIRTY_JS $theme->item()->height -themes/wind/views/photo.html.php 21 DIRTY_JS $previous_item->url() -themes/wind/views/photo.html.php 31 DIRTY_JS $next_item->url() -themes/wind/views/photo.html.php 43 DIRTY_JS $item->file_url() -themes/wind/views/photo.html.php 45 DIRTY $item->resize_img(array("id"=>"gPhotoId-{$item->id}","class"=>"gResize")) +themes/admin_wind/views/admin.html.php 15 DIRTY_JS $theme->url() +themes/admin_wind/views/admin.html.php 32 DIRTY $theme->admin_head() +themes/admin_wind/views/admin.html.php 36 DIRTY $theme->admin_page_top() +themes/admin_wind/views/admin.html.php 44 DIRTY $theme->admin_header_top() +themes/admin_wind/views/admin.html.php 49 DIRTY_JS item::root()->url() +themes/admin_wind/views/admin.html.php 53 DIRTY $theme->admin_menu() +themes/admin_wind/views/admin.html.php 55 DIRTY $theme->admin_header_bottom() +themes/admin_wind/views/admin.html.php 62 DIRTY $content +themes/admin_wind/views/admin.html.php 68 DIRTY $sidebar +themes/admin_wind/views/admin.html.php 73 DIRTY $theme->admin_footer() +themes/admin_wind/views/admin.html.php 75 DIRTY $theme->admin_credits() +themes/admin_wind/views/admin.html.php 79 DIRTY $theme->admin_page_bottom() +themes/admin_wind/views/block.html.php 3 DIRTY_ATTR $anchor +themes/admin_wind/views/block.html.php 5 DIRTY $id +themes/admin_wind/views/block.html.php 5 DIRTY_ATTR $css_id +themes/admin_wind/views/block.html.php 13 DIRTY $title +themes/admin_wind/views/block.html.php 16 DIRTY $content +themes/admin_wind/views/pager.html.php 13 DIRTY_JS str_replace('{page}',1,$url) +themes/admin_wind/views/pager.html.php 20 DIRTY_JS str_replace('{page}',$previous_page,$url) +themes/admin_wind/views/pager.html.php 27 DIRTY $from_to_msg +themes/admin_wind/views/pager.html.php 30 DIRTY_JS str_replace('{page}',$next_page,$url) +themes/admin_wind/views/pager.html.php 37 DIRTY_JS str_replace('{page}',$last_page,$url) +themes/wind/views/album.html.php 16 DIRTY_ATTR $child->id +themes/wind/views/album.html.php 16 DIRTY_ATTR $item_class +themes/wind/views/album.html.php 18 DIRTY_JS $child->url() +themes/wind/views/album.html.php 19 DIRTY $child->thumb_img(array("class"=>"gThumbnail")) +themes/wind/views/album.html.php 23 DIRTY_JS $child->url() +themes/wind/views/block.html.php 3 DIRTY_ATTR $anchor +themes/wind/views/block.html.php 5 DIRTY_ATTR $css_id +themes/wind/views/block.html.php 6 DIRTY $title +themes/wind/views/block.html.php 8 DIRTY $content +themes/wind/views/dynamic.html.php 11 DIRTY_ATTR $child->is_album()?"gAlbum":"" +themes/wind/views/dynamic.html.php 13 DIRTY_JS $child->url() +themes/wind/views/dynamic.html.php 14 DIRTY_ATTR $child->id +themes/wind/views/dynamic.html.php 15 DIRTY_ATTR $child->thumb_url() +themes/wind/views/dynamic.html.php 16 DIRTY_ATTR $child->thumb_width +themes/wind/views/dynamic.html.php 17 DIRTY_ATTR $child->thumb_height +themes/wind/views/movie.html.php 8 DIRTY_JS $previous_item->url() +themes/wind/views/movie.html.php 18 DIRTY_JS $next_item->url() +themes/wind/views/movie.html.php 28 DIRTY $item->movie_img(array("class"=>"gMovie","id"=>"gMovieId-{$item->id}")) +themes/wind/views/page.html.php 9 DIRTY $page_title +themes/wind/views/page.html.php 32 DIRTY_JS $theme->url() +themes/wind/views/page.html.php 41 DIRTY $new_width +themes/wind/views/page.html.php 42 DIRTY $new_height +themes/wind/views/page.html.php 43 DIRTY $thumb_proportion +themes/wind/views/page.html.php 82 DIRTY $header_text +themes/wind/views/page.html.php 84 DIRTY_JS item::root()->url() +themes/wind/views/page.html.php 102 DIRTY_JS $parent->url($parent==$theme->item()->parent()?"show={$theme->item()->id}":null) +themes/wind/views/page.html.php 117 DIRTY $content +themes/wind/views/page.html.php 123 DIRTY newView("sidebar.html") +themes/wind/views/page.html.php 130 DIRTY $footer_text +themes/wind/views/pager.html.php 13 DIRTY_JS str_replace('{page}',1,$url) +themes/wind/views/pager.html.php 20 DIRTY_JS str_replace('{page}',$previous_page,$url) +themes/wind/views/pager.html.php 27 DIRTY $from_to_msg +themes/wind/views/pager.html.php 30 DIRTY_JS str_replace('{page}',$next_page,$url) +themes/wind/views/pager.html.php 37 DIRTY_JS str_replace('{page}',$last_page,$url) +themes/wind/views/photo.html.php 8 DIRTY_JS $theme->item()->width +themes/wind/views/photo.html.php 8 DIRTY_JS $theme->item()->height +themes/wind/views/photo.html.php 21 DIRTY_JS $previous_item->url() +themes/wind/views/photo.html.php 31 DIRTY_JS $next_item->url() +themes/wind/views/photo.html.php 43 DIRTY_JS $item->file_url() +themes/wind/views/photo.html.php 45 DIRTY $item->resize_img(array("id"=>"gPhotoId-{$item->id}","class"=>"gResize")) -- cgit v1.2.3 From cd240ebaada9ddff112a40a5f80201f23449337e Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 24 Sep 2009 20:06:14 -0700 Subject: Refactored the rebuild_dirty_images handler to simplify the counting and end processing. It was getting all confused with trying to figure out the completed and remaining. Now on initiation it sets the total images that are dirty and then counts the completed until it equals the total, then exits. Fixes ticket #771 --- modules/gallery/helpers/gallery_task.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php index 1b56ab97..3d0476a8 100644 --- a/modules/gallery/helpers/gallery_task.php +++ b/modules/gallery/helpers/gallery_task.php @@ -48,9 +48,13 @@ class gallery_task_Core { $errors = array(); try { $result = graphics::find_dirty_images_query(); + $total_count = $task->get("total_count", -1); + if ($total_count < 0) { + $total_count = $result->count(); + $task->set("total_count", $total_count); + } $completed = $task->get("completed", 0); $ignored = $task->get("ignored", array()); - $remaining = $result->count() - count($ignored); $i = 0; foreach ($result as $row) { @@ -62,19 +66,18 @@ class gallery_task_Core { if ($item->loaded) { try { graphics::generate($item); - $ignored[$item->id] = 1; + $completed++; + $errors[] = t("Successfully rebuilt images for '%title'", array("title" => html::purify($item->title))); } catch (Exception $e) { $errors[] = t("Unable to rebuild images for '%title'", array("title" => html::purify($item->title))); $errors[] = $e->__toString(); + $ignored[$item->id] = 1; } } - $completed++; - $remaining--; - if (++$i == 2) { break; } @@ -83,17 +86,17 @@ class gallery_task_Core { $task->status = t2("Updated: 1 image. Total: %total_count.", "Updated: %count images. Total: %total_count.", $completed, - array("total_count" => ($remaining + $completed))); + array("total_count" => $total_count)); - if ($completed + $remaining > 0) { - $task->percent_complete = (int)(100 * $completed / ($completed + $remaining)); + if ($completed < $total_count) { + $task->percent_complete = (int)(100 * ($completed + count($ignored)) / $total_count); } else { $task->percent_complete = 100; } $task->set("completed", $completed); $task->set("ignored", $ignored); - if ($remaining == 0) { + if ($task->percent_complete == 100) { $task->done = true; $task->state = "success"; site_status::clear("graphics_dirty"); -- cgit v1.2.3 From e204e18b3c6a4b4b1aa76b6d4a5392bd238490eb Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 24 Sep 2009 20:28:26 -0700 Subject: Refactor the graphic rules processing to accomplish 2 goals: First separate the grapics library from module supplied rules and secondly, allow for modules to provide new processing rules callbacks. graphics::generate will now look for _graphics:: methods. --- modules/gallery/helpers/gallery_graphics.php | 54 ++++++++++++++ modules/gallery/helpers/graphics.php | 95 +----------------------- modules/watermark/helpers/watermark_graphics.php | 75 +++++++++++++++++++ 3 files changed, 133 insertions(+), 91 deletions(-) create mode 100644 modules/gallery/helpers/gallery_graphics.php create mode 100644 modules/watermark/helpers/watermark_graphics.php (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/gallery_graphics.php b/modules/gallery/helpers/gallery_graphics.php new file mode 100644 index 00000000..f62fbf97 --- /dev/null +++ b/modules/gallery/helpers/gallery_graphics.php @@ -0,0 +1,54 @@ +resize($options["width"], $options["height"], $options["master"]) + ->quality(module::get_var("gallery", "image_quality")); + if (graphics::can("sharpen")) { + $image->sharpen(module::get_var("gallery", "image_sharpen")); + } + $image->save($output_file); + } + + module::event("graphics_resize_completed", $input_file, $output_file, $options); + } +} diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 78812794..6705652f 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -152,7 +152,7 @@ class graphics_Core { ->orderby("priority", "asc") ->find_all() as $rule) { $args = array($working_file, $output_file, unserialize($rule->args)); - call_user_func_array(array("graphics", $rule->operation), $args); + call_user_func_array(array("{$rule->module_name}_graphics", $rule->operation), $args); $working_file = $output_file; } } @@ -180,42 +180,6 @@ class graphics_Core { } } - /** - * Resize an image. Valid options are width, height and master. Master is one of the Image - * master dimension constants. - * - * @param string $input_file - * @param string $output_file - * @param array $options - */ - static function resize($input_file, $output_file, $options) { - if (!self::$init) { - self::init_toolkit(); - } - - module::event("graphics_resize", $input_file, $output_file, $options); - - if (@filesize($input_file) == 0) { - throw new Exception("@todo EMPTY_INPUT_FILE"); - } - - $dims = getimagesize($input_file); - if (max($dims[0], $dims[1]) < min($options["width"], $options["height"])) { - // Image would get upscaled; do nothing - copy($input_file, $output_file); - } else { - $image = Image::factory($input_file) - ->resize($options["width"], $options["height"], $options["master"]) - ->quality(module::get_var("gallery", "image_quality")); - if (graphics::can("sharpen")) { - $image->sharpen(module::get_var("gallery", "image_sharpen")); - } - $image->save($output_file); - } - - module::event("graphics_resize_completed", $input_file, $output_file, $options); - } - /** * Rotate an image. Valid options are degrees * @@ -238,60 +202,6 @@ class graphics_Core { module::event("graphics_rotate_completed", $input_file, $output_file, $options); } - /** - * Overlay an image on top of the input file. - * - * Valid options are: file, mime_type, position, transparency_percent, padding - * - * Valid positions: northwest, north, northeast, - * west, center, east, - * southwest, south, southeast - * - * padding is in pixels - * - * @param string $input_file - * @param string $output_file - * @param array $options - */ - static function composite($input_file, $output_file, $options) { - if (!self::$init) { - self::init_toolkit(); - } - - module::event("graphics_composite", $input_file, $output_file, $options); - - list ($width, $height) = getimagesize($input_file); - list ($w_width, $w_height) = getimagesize($options["file"]); - - $pad = isset($options["padding"]) ? $options["padding"] : 10; - $top = $pad; - $left = $pad; - $y_center = max($height / 2 - $w_height / 2, $pad); - $x_center = max($width / 2 - $w_width / 2, $pad); - $bottom = max($height - $w_height - $pad, $pad); - $right = max($width - $w_width - $pad, $pad); - - switch ($options["position"]) { - case "northwest": $x = $left; $y = $top; break; - case "north": $x = $x_center; $y = $top; break; - case "northeast": $x = $right; $y = $top; break; - case "west": $x = $left; $y = $y_center; break; - case "center": $x = $x_center; $y = $y_center; break; - case "east": $x = $right; $y = $y_center; break; - case "southwest": $x = $left; $y = $bottom; break; - case "south": $x = $x_center; $y = $bottom; break; - case "southeast": $x = $right; $y = $bottom; break; - } - - Image::factory($input_file) - ->composite($options["file"], $x, $y, $options["transparency"]) - ->quality(module::get_var("gallery", "image_quality")) - ->save($output_file); - - - module::event("graphics_composite_completed", $input_file, $output_file, $options); - } - /** * Return a query result that locates all items with dirty images. * @return Database_Result Query result @@ -463,6 +373,9 @@ class graphics_Core { * Choose which driver the Kohana Image library uses. */ static function init_toolkit() { + if (self::$init) { + return; + } switch(module::get_var("gallery", "graphics_toolkit")) { case "gd": Kohana::config_set("image.driver", "GD"); diff --git a/modules/watermark/helpers/watermark_graphics.php b/modules/watermark/helpers/watermark_graphics.php new file mode 100644 index 00000000..aef7586b --- /dev/null +++ b/modules/watermark/helpers/watermark_graphics.php @@ -0,0 +1,75 @@ +composite($options["file"], $x, $y, $options["transparency"]) + ->quality(module::get_var("gallery", "image_quality")) + ->save($output_file); + + module::event("graphics_composite_completed", $input_file, $output_file, $options); + } catch (ErrorException $e) { + Kohana::log("error", $e->get_message()); + } + } +} -- cgit v1.2.3 From 4345e96d1db63c8488eb7a35cdc8e42987ba53f5 Mon Sep 17 00:00:00 2001 From: jhilden Date: Sat, 26 Sep 2009 11:27:07 -0400 Subject: first try at improving the upload user experience with the file selection button --- modules/gallery/views/simple_uploader.html.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php index 7f8a96df..9c693917 100644 --- a/modules/gallery/views/simple_uploader.html.php +++ b/modules/gallery/views/simple_uploader.html.php @@ -40,8 +40,8 @@
-
+ -
" - class="gDialogLink gButtonLink right ui-icon-left ui-state-default ui-corner-all" + class="gDialogLink gButtonLink g-right ui-icon-left ui-state-default ui-corner-all" title="for_html_attr() ?>"> diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css index 3aee0719..d006463d 100644 --- a/themes/admin_wind/css/screen.css +++ b/themes/admin_wind/css/screen.css @@ -5,7 +5,6 @@ * * Sheet organization: * 1) Basic HTML elements - * 2) Reusable classes * 3) Reusable content blocks * 4) Page layout containers * 5) Content blocks in specific layout containers @@ -239,29 +238,6 @@ li.gError select { border: 2px solid red; } -/** ******************************************************************* - * 2) Reusable generic classes - *********************************************************************/ - -.inactive, .understate { - color: #ccc; - font-weight: normal; -} - -.left { - float: left; - margin: 1em 1em 1em 0; -} - -.right { - float: right; - margin: 1em 0 1em 1em; -} - -.txtright { - text-align: right; -} - /** ******************************************************************* * 3) Reusable content blocks *********************************************************************/ diff --git a/themes/admin_wind/views/admin.html.php b/themes/admin_wind/views/admin.html.php index ef15ed25..b18f010a 100644 --- a/themes/admin_wind/views/admin.html.php +++ b/themes/admin_wind/views/admin.html.php @@ -10,6 +10,7 @@ css("yui/reset-fonts-grids.css") ?> css("themeroller/ui.base.css") ?> css("superfish/css/superfish.css") ?> + css("gallery.common.css") ?> css("screen.css") ?>
  • + class="g-button ui-state-default ui-icon-left"> diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php index dd706a23..ee4a8ad6 100644 --- a/modules/comment/views/comments.html.php +++ b/modules/comment/views/comments.html.php @@ -1,6 +1,6 @@ id})") ?>" id="gAddCommentButton" - class="gButtonLink ui-corner-all ui-icon-left ui-state-default right"> + class="g-button ui-corner-all ui-icon-left ui-state-default right"> diff --git a/modules/exif/views/exif_sidebar.html.php b/modules/exif/views/exif_sidebar.html.php index 60c0e1d4..23ecab03 100644 --- a/modules/exif/views/exif_sidebar.html.php +++ b/modules/exif/views/exif_sidebar.html.php @@ -1,6 +1,6 @@ id}") ?>" title="for_html_attr() ?>" - class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all"> + class="gDialogLink g-button ui-icon-left ui-state-default ui-corner-all"> diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php index 23ff27a8..91b723ad 100644 --- a/modules/g2_import/views/admin_g2_import.html.php +++ b/modules/g2_import/views/admin_g2_import.html.php @@ -84,7 +84,7 @@
  • - "> diff --git a/modules/gallery/views/admin_graphics_gd.html.php b/modules/gallery/views/admin_graphics_gd.html.php index 010a31b4..08c19234 100644 --- a/modules/gallery/views/admin_graphics_gd.html.php +++ b/modules/gallery/views/admin_graphics_gd.html.php @@ -11,7 +11,7 @@ $tk->version)) ?>

    - +

    installed): ?> error): ?> @@ -20,7 +20,7 @@

    - +

    diff --git a/modules/gallery/views/admin_graphics_graphicsmagick.html.php b/modules/gallery/views/admin_graphics_graphicsmagick.html.php index 97624850..6ee15bc3 100644 --- a/modules/gallery/views/admin_graphics_graphicsmagick.html.php +++ b/modules/gallery/views/admin_graphics_graphicsmagick.html.php @@ -11,7 +11,7 @@ $tk->version, "dir" => $tk->dir)) ?>

    - +

    diff --git a/modules/gallery/views/admin_graphics_imagemagick.html.php b/modules/gallery/views/admin_graphics_imagemagick.html.php index cdff7c2c..aeef4919 100644 --- a/modules/gallery/views/admin_graphics_imagemagick.html.php +++ b/modules/gallery/views/admin_graphics_imagemagick.html.php @@ -11,7 +11,7 @@ $tk->version, "dir" => $tk->dir)) ?>

    - +

    error): ?>
    diff --git a/modules/gallery/views/admin_languages.html.php b/modules/gallery/views/admin_languages.html.php index fb30c7ba..d6f50516 100644 --- a/modules/gallery/views/admin_languages.html.php +++ b/modules/gallery/views/admin_languages.html.php @@ -88,7 +88,7 @@

    Step 3: Start the translation mode and the translation interface will appear at the bottom of each Gallery page.") ?>

    + class="g-button ui-state-default ui-corner-all ui-icon-left"> get("l10n_mode", false)): ?> diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php index 00ba5199..8c3917b6 100644 --- a/modules/gallery/views/admin_maintenance.html.php +++ b/modules/gallery/views/admin_maintenance.html.php @@ -30,7 +30,7 @@
    @@ -62,7 +62,7 @@ @@ -96,11 +96,11 @@ @@ -166,19 +166,19 @@ @@ -105,7 +105,7 @@
    " - class="gDialogLink gButtonLink right ui-icon-left ui-state-default ui-corner-all" + class="gDialogLink g-button right ui-icon-left ui-state-default ui-corner-all" title="for_html_attr() ?>"> diff --git a/modules/user/views/admin_users_group.html.php b/modules/user/views/admin_users_group.html.php index 476e0817..6f2496f8 100644 --- a/modules/user/views/admin_users_group.html.php +++ b/modules/user/views/admin_users_group.html.php @@ -4,11 +4,11 @@ special): ?> id") ?>" title=" $group->name))->for_html_attr() ?>" - class="gDialogLink gButtonLink ui-state-default ui-corner-all"> + class="gDialogLink g-button ui-state-default ui-corner-all"> for_html_attr() ?>" - class="gDialogLink gButtonLink ui-state-disabled ui-corner-all ui-icon-left"> + class="gDialogLink g-button ui-state-disabled ui-corner-all ui-icon-left"> @@ -20,7 +20,7 @@ name) ?> special): ?> $user->name, "group" => $group->name))->for_html_attr() ?>"> diff --git a/modules/watermark/views/admin_watermarks.html.php b/modules/watermark/views/admin_watermarks.html.php index ac69d21d..3790030d 100644 --- a/modules/watermark/views/admin_watermarks.html.php +++ b/modules/watermark/views/admin_watermarks.html.php @@ -8,7 +8,7 @@ " title="for_html_attr() ?>" - class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all"> + class="gDialogLink g-button ui-icon-left ui-state-default ui-corner-all">

    @@ -27,10 +27,10 @@

    " title="for_html_attr() ?>" - class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all"> + class="gDialogLink g-button ui-icon-left ui-state-default ui-corner-all"> " title="for_html_attr() ?>" - class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all"> + class="gDialogLink g-button ui-icon-left ui-state-default ui-corner-all">
    diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css index d006463d..737c5939 100644 --- a/themes/admin_wind/css/screen.css +++ b/themes/admin_wind/css/screen.css @@ -68,9 +68,9 @@ h3 { a, .gMenu a, #gDialog a, -.gButtonLink, -.gButtonLink:hover, -.gButtonLink:active, +.g-button, +.g-button:hover, +.g-button:active, a.ui-state-hover, input.ui-state-hover, button.ui-state-hover { @@ -283,11 +283,11 @@ li.gError select { background: #eee; } -.gAvailable .gButtonLink { +.gAvailable .g-button { width: 96%; } -.gSelected .gButtonLink { +.gSelected .g-button { display: none; } @@ -627,7 +627,7 @@ li.gGroup h4 { border-bottom: 1px dashed #ccc; padding: .5em 0 .5em .5em; } -li.gGroup .gButtonLink { +li.gGroup .g-button { padding: 0; } li.gGroup ul, li.gGroup div { @@ -644,7 +644,7 @@ li.gGroup div p { li.gGroup .gUser { padding: .2em 0 0 .5em; } -li.gGroup .gUser .gButtonLink { +li.gGroup .gUser .g-button { vertical-align: middle; } @@ -838,13 +838,6 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { /* jQuery UI ThemeRoller buttons */ -.gButtonLink { - display: inline-block; - margin: 0 4px 0 0; - padding: .2em .4em; - outline: 0; -} - .gButtonSet { padding-left: 1px; } @@ -853,7 +846,7 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { float: left; } -.gButtonSet .gButtonLink { +.gButtonSet .g-button { margin: 0; } @@ -1106,7 +1099,7 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { clear: both; } -#gTranslations .gButtonLink { +#gTranslations .g-button { padding: .5em; } diff --git a/themes/admin_wind/js/ui.init.js b/themes/admin_wind/js/ui.init.js index c6379c09..d9b011bd 100644 --- a/themes/admin_wind/js/ui.init.js +++ b/themes/admin_wind/js/ui.init.js @@ -37,7 +37,7 @@ $(document).ready(function(){ if ($("#gAdminCommentsMenu").length) { $("#gAdminCommentsMenu ul").removeClass("gMenu").removeClass("sf-menu"); $("#gAdminCommentsMenu").addClass("gButtonSet"); - $("#gAdminCommentsMenu a").addClass("gButtonLink ui-state-default"); + $("#gAdminCommentsMenu a").addClass("g-button ui-state-default"); $("#gAdminCommentsMenu ul li:first a").addClass("ui-corner-left"); $("#gAdminCommentsMenu ul li:last a").addClass("ui-corner-right"); } diff --git a/themes/admin_wind/views/pager.html.php b/themes/admin_wind/views/pager.html.php index 90c71446..29b9f9d0 100644 --- a/themes/admin_wind/views/pager.html.php +++ b/themes/admin_wind/views/pager.html.php @@ -10,34 +10,34 @@ "count" => $total_items)) ?>
  • - + - + - + - +
  • - + - + - + - +
  • diff --git a/themes/wind/css/screen.css b/themes/wind/css/screen.css index 9f3a53e6..6d955481 100644 --- a/themes/wind/css/screen.css +++ b/themes/wind/css/screen.css @@ -68,9 +68,9 @@ h3 { a, .gMenu a, #gDialog a, -.gButtonLink, -.gButtonLink:hover, -.gButtonLink:active, +.g-button, +.g-button:hover, +.g-button:active, a.ui-state-hover, input.ui-state-hover, button.ui-state-hover { @@ -884,13 +884,6 @@ form .gError, /* jQuery UI ThemeRoller buttons */ -.gButtonLink { - display: inline-block; - margin: 0 4px 0 0; - padding: .2em .4em; - outline: 0; -} - .gButtonSet { padding-left: 1px; } @@ -899,7 +892,7 @@ form .gError, float: left; } -.gButtonSet .gButtonLink { +.gButtonSet .g-button { margin: 0; } diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js index c79e91bd..4a1962c0 100644 --- a/themes/wind/js/ui.init.js +++ b/themes/wind/js/ui.init.js @@ -49,7 +49,7 @@ $(document).ready(function() { // Apply styles and icon classes to gContextMenu if ($(".gContextMenu").length) { $(".gContextMenu li").addClass("ui-state-default"); - $(".gContextMenu a").addClass("gButtonLink ui-icon-left"); + $(".gContextMenu a").addClass("g-button ui-icon-left"); $(".gContextMenu a").prepend(""); $(".gContextMenu a span").each(function() { var iconClass = $(this).parent().attr("class").match(/ui-icon-.[^\s]+/).toString(); diff --git a/themes/wind/views/movie.html.php b/themes/wind/views/movie.html.php index 8b8e43a8..cf7c9b7f 100644 --- a/themes/wind/views/movie.html.php +++ b/themes/wind/views/movie.html.php @@ -5,20 +5,20 @@
    • - + - +
    • $position, "total" => $sibling_count)) ?>
    • - + - +
    • diff --git a/themes/wind/views/pager.html.php b/themes/wind/views/pager.html.php index b57e0c9d..155c8d16 100644 --- a/themes/wind/views/pager.html.php +++ b/themes/wind/views/pager.html.php @@ -10,34 +10,34 @@ "count" => $total_items)) ?>
    • - + - + - + - +
    • - + - + - + - +
    • diff --git a/themes/wind/views/photo.html.php b/themes/wind/views/photo.html.php index 25e1ad39..def3d8b7 100644 --- a/themes/wind/views/photo.html.php +++ b/themes/wind/views/photo.html.php @@ -18,20 +18,20 @@
      • - + - +
      • $position, "total" => $sibling_count)) ?>
      • - + - +
      • -- cgit v1.2.3 From 60d35b89929d9029c794f72d6a9c38b676e282f6 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 30 Sep 2009 07:31:11 -0700 Subject: Use the block_manager to manage site sidebar panels. Fixes ticket #110. * Extend block_manager to handle sidebar blocks. get_available has become get_available_admin_blocks, get_list becomes get_admin_list. * Create new functions get_available_site_blocks which will look for gallery_block get_available_site_blocks. * Refactor sidebar_blocks into a separate function and then call block_manager::get_html(site.sidebar). Convert image_block to use block management instead of theme::sidebar_blocks * Change the block_manager api so that the theme is passed into the get method. convert info to the new sidebar block approach * Convert the user module to use the new sidebar block structure. remove the installers for info and image_block modules. * Convert tag and rss modules to the new sidebar framework. reset the version number to 1 for info and image_block modules. * Change the get_html method to ignore empty blocks and change the individual handlers to return an empty string if no block is generated * Add a warning message if no sidebar blocks are active and provide a link to the admin page that configures the sidebar. --- modules/comment/helpers/comment_block.php | 2 +- modules/gallery/controllers/admin_dashboard.php | 4 +- modules/gallery/controllers/admin_sidebar.php | 28 ++++++++++ modules/gallery/helpers/block_manager.php | 24 ++++++--- modules/gallery/helpers/gallery_block.php | 5 +- modules/gallery/libraries/Theme_View.php | 12 ++++- modules/gallery/module.info | 2 +- modules/gallery/views/admin_sidebar.html.php | 9 ++++ modules/image_block/helpers/image_block_block.php | 63 +++++++++++++++++++++++ modules/image_block/helpers/image_block_theme.php | 50 ------------------ modules/info/helpers/info_block.php | 39 ++++++++++++++ modules/info/helpers/info_theme.php | 10 ---- modules/rss/helpers/rss_block.php | 49 ++++++++++++++++++ modules/rss/helpers/rss_theme.php | 40 -------------- modules/tag/helpers/tag_block.php | 45 ++++++++++++++++ modules/tag/helpers/tag_theme.php | 19 ------- modules/user/helpers/user_block.php | 46 +++++++++++++++++ modules/user/helpers/user_theme.php | 17 ------ themes/wind/views/no_sidebar.html.php | 5 ++ 19 files changed, 319 insertions(+), 150 deletions(-) create mode 100644 modules/gallery/controllers/admin_sidebar.php create mode 100644 modules/gallery/views/admin_sidebar.html.php create mode 100644 modules/image_block/helpers/image_block_block.php delete mode 100644 modules/image_block/helpers/image_block_theme.php create mode 100644 modules/info/helpers/info_block.php create mode 100644 modules/rss/helpers/rss_block.php delete mode 100644 modules/rss/helpers/rss_theme.php create mode 100644 modules/tag/helpers/tag_block.php create mode 100644 modules/user/helpers/user_block.php create mode 100644 themes/wind/views/no_sidebar.html.php (limited to 'modules/gallery') diff --git a/modules/comment/helpers/comment_block.php b/modules/comment/helpers/comment_block.php index 08182905..b989be6b 100644 --- a/modules/comment/helpers/comment_block.php +++ b/modules/comment/helpers/comment_block.php @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class comment_block_Core { - static function get_list() { + static function get_admin_list() { return array("recent_comments" => t("Recent Comments")); } diff --git a/modules/gallery/controllers/admin_dashboard.php b/modules/gallery/controllers/admin_dashboard.php index 3cb97b14..6bf3b966 100644 --- a/modules/gallery/controllers/admin_dashboard.php +++ b/modules/gallery/controllers/admin_dashboard.php @@ -34,7 +34,7 @@ class Admin_Dashboard_Controller extends Admin_Controller { $form = gallery_block::get_add_block_form(); if ($form->validate()) { list ($module_name, $id) = explode(":", $form->add_block->id->value); - $available = block_manager::get_available(); + $available = block_manager::get_available_admin_blocks(); if ($form->add_block->center->value) { block_manager::add("dashboard_center", $module_name, $id); @@ -66,7 +66,7 @@ class Admin_Dashboard_Controller extends Admin_Controller { } if (!empty($deleted)) { - $available = block_manager::get_available(); + $available = block_manager::get_available_admin_blocks(); $title = $available[join(":", $deleted)]; message::success(t("Removed %title block", array("title" => $title))); } diff --git a/modules/gallery/controllers/admin_sidebar.php b/modules/gallery/controllers/admin_sidebar.php new file mode 100644 index 00000000..7e71426a --- /dev/null +++ b/modules/gallery/controllers/admin_sidebar.php @@ -0,0 +1,28 @@ +content = new View("admin_sidebar.html"); + print $view; + } + +} + diff --git a/modules/gallery/helpers/block_manager.php b/modules/gallery/helpers/block_manager.php index 20b641d4..b99a6571 100644 --- a/modules/gallery/helpers/block_manager.php +++ b/modules/gallery/helpers/block_manager.php @@ -38,13 +38,21 @@ class block_manager_Core { self::set_active($location, $blocks); } - static function get_available() { + static function get_available_admin_blocks() { + return self::_get_blocks("get_admin_list"); + } + + static function get_available_site_blocks() { + return self::_get_blocks("get_site_list"); + } + + private static function _get_blocks($function) { $blocks = array(); foreach (module::active() as $module) { $class_name = "{$module->name}_block"; - if (method_exists($class_name, "get_list")) { - foreach (call_user_func(array($class_name, "get_list")) as $id => $title) { + if (method_exists($class_name, $function)) { + foreach (call_user_func(array($class_name, $function)) as $id => $title) { $blocks["{$module->name}:$id"] = $title; } } @@ -52,14 +60,16 @@ class block_manager_Core { return $blocks; } - static function get_html($location) { + static function get_html($location, $theme) { $active = self::get_active($location); $result = ""; foreach ($active as $id => $desc) { if (method_exists("$desc[0]_block", "get")) { - $block = call_user_func(array("$desc[0]_block", "get"), $desc[1]); - $block->id = $id; - $result .= $block; + $block = call_user_func(array("$desc[0]_block", "get"), $desc[1], $theme); + if (!empty($block)) { + $block->id = $id; + $result .= $block; + } } } return $result; diff --git a/modules/gallery/helpers/gallery_block.php b/modules/gallery/helpers/gallery_block.php index b7816954..f2cb8ded 100644 --- a/modules/gallery/helpers/gallery_block.php +++ b/modules/gallery/helpers/gallery_block.php @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class gallery_block_Core { - static function get_list() { + static function get_admin_list() { return array( "welcome" => t("Welcome to Gallery 3!"), "photo_stream" => t("Photo Stream"), @@ -94,7 +94,8 @@ class gallery_block_Core { $form = new Forge("admin/dashboard/add_block", "", "post", array("id" => "gAddDashboardBlockForm")); $group = $form->group("add_block")->label(t("Add Block")); - $group->dropdown("id")->label(t("Available Blocks"))->options(block_manager::get_available()); + $group->dropdown("id")->label(t("Available Blocks")) + ->options(block_manager::get_available_admin_blocks()); $group->submit("center")->value(t("Add to center")); $group->submit("sidebar")->value(t("Add to sidebar")); return $form; diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 728e8bf9..ab25a4b6 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -153,6 +153,17 @@ class Theme_View_Core extends Gallery_View { return message::get(); } + /** + * Print out the sidebar. + */ + public function sidebar_blocks() { + $sidebar = block_manager::get_html("site.sidebar", $this); + if (empty($sidebar) && user::active()->admin) { + $sidebar = new View("no_sidebar.html"); + } + return $sidebar; + } + /** * Handle all theme functions that insert module content. */ @@ -176,7 +187,6 @@ class Theme_View_Core extends Gallery_View { case "photo_top": case "resize_bottom": case "resize_top": - case "sidebar_blocks": case "sidebar_bottom": case "sidebar_top": case "thumb_bottom": diff --git a/modules/gallery/module.info b/modules/gallery/module.info index bffcb1c6..f509ff08 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = "Gallery 3" description = "Gallery core application" -version = 14 +version = 15 diff --git a/modules/gallery/views/admin_sidebar.html.php b/modules/gallery/views/admin_sidebar.html.php new file mode 100644 index 00000000..32386f5d --- /dev/null +++ b/modules/gallery/views/admin_sidebar.html.php @@ -0,0 +1,9 @@ + + +

        +

        + +

        + +
        +
        \ No newline at end of file diff --git a/modules/image_block/helpers/image_block_block.php b/modules/image_block/helpers/image_block_block.php new file mode 100644 index 00000000..d0402eb6 --- /dev/null +++ b/modules/image_block/helpers/image_block_block.php @@ -0,0 +1,63 @@ + t("Random Image")); + } + + static function get($block_id, $theme) { + $block = ""; + switch ($block_id) { + case "random_image": + $block = new Block(); + $block->css_id = "gImageBlock"; + $block->title = t("Random Image"); + $block->content = new View("image_block_block.html"); + + $random = ((float)mt_rand()) / (float)mt_getrandmax(); + + $items = ORM::factory("item") + ->viewable() + ->where("type !=", "album") + ->where("rand_key < ", $random) + ->orderby(array("rand_key" => "DESC")) + ->find_all(1); + + if ($items->count() == 0) { + // Try once more. If this fails, just ditch the block altogether + $items = ORM::factory("item") + ->viewable() + ->where("type !=", "album") + ->where("rand_key >= ", $random) + ->orderby(array("rand_key" => "DESC")) + ->find_all(1); + } + + if ($items->count() > 0) { + $block->content->item = $items->current(); + } else { + $block = ""; + } + break; + } + + return $block; + } +} diff --git a/modules/image_block/helpers/image_block_theme.php b/modules/image_block/helpers/image_block_theme.php deleted file mode 100644 index 78138b23..00000000 --- a/modules/image_block/helpers/image_block_theme.php +++ /dev/null @@ -1,50 +0,0 @@ -css_id = "gImageBlock"; - $block->title = t("Random Image"); - $block->content = new View("image_block_block.html"); - - $random = ((float)mt_rand()) / (float)mt_getrandmax(); - - $items = ORM::factory("item") - ->viewable() - ->where("type !=", "album") - ->where("rand_key < ", $random) - ->orderby(array("rand_key" => "DESC")) - ->find_all(1); - - if ($items->count() == 0) { - // Try once more. If this fails, just ditch the block altogether - $items = ORM::factory("item") - ->viewable() - ->where("type !=", "album") - ->where("rand_key >= ", $random) - ->orderby(array("rand_key" => "DESC")) - ->find_all(1); - } - - $block->content->item = $items->current(); - - return $items->count() == 0 ? "" : $block; - } -} diff --git a/modules/info/helpers/info_block.php b/modules/info/helpers/info_block.php new file mode 100644 index 00000000..3a853609 --- /dev/null +++ b/modules/info/helpers/info_block.php @@ -0,0 +1,39 @@ + t("Metadata")); + } + + static function get($block_id, $theme) { + $block = ""; + switch ($block_id) { + case "metadata": + if ($theme->item()) { + $block = new Block(); + $block->css_id = "gMetadata"; + $block->title = $theme->item()->is_album() ? t("Album Info") : t("Photo Info"); + $block->content = new View("info_block.html"); + } + break; + } + return $block; + } +} \ No newline at end of file diff --git a/modules/info/helpers/info_theme.php b/modules/info/helpers/info_theme.php index 4bf894ad..8b8602a1 100644 --- a/modules/info/helpers/info_theme.php +++ b/modules/info/helpers/info_theme.php @@ -18,16 +18,6 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class info_theme_Core { - static function sidebar_blocks($theme) { - if ($theme->item()) { - $block = new Block(); - $block->css_id = "gMetadata"; - $block->title = $theme->item()->is_album() ? t("Album Info") : t("Photo Info"); - $block->content = new View("info_block.html"); - return $block; - } - } - static function thumb_info($theme, $item) { $results = ""; if ($item->view_count) { diff --git a/modules/rss/helpers/rss_block.php b/modules/rss/helpers/rss_block.php new file mode 100644 index 00000000..43043f5f --- /dev/null +++ b/modules/rss/helpers/rss_block.php @@ -0,0 +1,49 @@ + t("Available RSS Feeds")); + } + + static function get($block_id, $theme) { + $block = ""; + switch ($block_id) { + case "rss_feeds": + $feeds = array(); + foreach (module::active() as $module) { + $class_name = "{$module->name}_rss"; + if (method_exists($class_name, "available_feeds")) { + $feeds = array_merge($feeds, + call_user_func(array($class_name, "available_feeds"), $theme->item(), $theme->tag())); + } + } + if (!empty($feeds)) { + $block = new Block(); + $block->css_id = "gRss"; + $block->title = t("Available RSS Feeds"); + $block->content = new View("rss_block.html"); + $block->content->feeds = $feeds; + } + break; + } + + return $block; + } +} diff --git a/modules/rss/helpers/rss_theme.php b/modules/rss/helpers/rss_theme.php deleted file mode 100644 index 3d1b9a29..00000000 --- a/modules/rss/helpers/rss_theme.php +++ /dev/null @@ -1,40 +0,0 @@ -css_id = "gRss"; - $block->title = t("Available RSS Feeds"); - $block->content = new View("rss_block.html"); - $block->content->feeds = array(); - foreach (module::active() as $module) { - $class_name = "{$module->name}_rss"; - if (method_exists($class_name, "available_feeds")) { - $block->content->feeds = array_merge( - $block->content->feeds, - call_user_func(array($class_name, "available_feeds"), $theme->item(), $theme->tag())); - } - } - - if ($block->content->feeds) { - return $block; - } - } -} diff --git a/modules/tag/helpers/tag_block.php b/modules/tag/helpers/tag_block.php new file mode 100644 index 00000000..bbcc5fd1 --- /dev/null +++ b/modules/tag/helpers/tag_block.php @@ -0,0 +1,45 @@ + t("Popular Tags")); + } + + static function get($block_id, $theme) { + $block = ""; + switch ($block_id) { + case "tag": + $block = new Block(); + $block->css_id = "gTag"; + $block->title = t("Popular Tags"); + $block->content = new View("tag_block.html"); + $block->content->cloud = tag::cloud(30); + + if ($theme->item() && $theme->page_type() != "tag" && access::can("edit", $theme->item())) { + $controller = new Tags_Controller(); + $block->content->form = tag::get_add_form($theme->item()); + } else { + $block->content->form = ""; + } + break; + } + return $block; + } +} \ No newline at end of file diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php index 1bce9bd8..4f22d2ac 100644 --- a/modules/tag/helpers/tag_theme.php +++ b/modules/tag/helpers/tag_theme.php @@ -28,25 +28,6 @@ class tag_theme_Core { $theme->script("tag.js"); } - static function sidebar_blocks($theme) { - // @todo this needs to be data driven - - $block = new Block(); - $block->css_id = "gTag"; - $block->title = t("Popular Tags"); - $block->content = new View("tag_block.html"); - $block->content->cloud = tag::cloud(30); - - if ($theme->item() && $theme->page_type() != "tag" && access::can("edit", $theme->item())) { - $controller = new Tags_Controller(); - $block->content->form = tag::get_add_form($theme->item()); - } else { - $block->content->form = ""; - } - - return $block; - } - static function sort_by_name($tag1, $tag2) { return strcasecmp($tag1->name, $tag2->name); } diff --git a/modules/user/helpers/user_block.php b/modules/user/helpers/user_block.php new file mode 100644 index 00000000..e7671f06 --- /dev/null +++ b/modules/user/helpers/user_block.php @@ -0,0 +1,46 @@ + t("Language Preference")); + } + + static function get($block_id, $theme) { + $block = ""; + switch ($block_id) { + case "language": + $locales = locales::installed(); + foreach ($locales as $locale => $display_name) { + $locales[$locale] = SafeString::of_safe_html($display_name); + } + if (count($locales) > 1) { + $block = new Block(); + $block->css_id = "gUserLanguageBlock"; + $block->title = t("Language Preference"); + $block->content = new View("user_languages_block.html"); + $block->content->installed_locales = + array_merge(array("" => t("« none »")), $locales); + $block->content->selected = (string) user::cookie_locale(); + } + break; + } + return $block; + } +} \ No newline at end of file diff --git a/modules/user/helpers/user_theme.php b/modules/user/helpers/user_theme.php index 098d87fd..69d63eaf 100644 --- a/modules/user/helpers/user_theme.php +++ b/modules/user/helpers/user_theme.php @@ -33,21 +33,4 @@ class user_theme_Core { return $view->render(); } } - - static function sidebar_blocks($theme) { - $locales = locales::installed(); - foreach ($locales as $locale => $display_name) { - $locales[$locale] = SafeString::of_safe_html($display_name); - } - if (count($locales) > 1) { - $block = new Block(); - $block->css_id = "gUserLanguageBlock"; - $block->title = t("Language Preference"); - $block->content = new View("user_languages_block.html"); - $block->content->installed_locales = - array_merge(array("" => t("« none »")), $locales); - $block->content->selected = (string) user::cookie_locale(); - return $block; - } - } } diff --git a/themes/wind/views/no_sidebar.html.php b/themes/wind/views/no_sidebar.html.php new file mode 100644 index 00000000..7324cf9e --- /dev/null +++ b/themes/wind/views/no_sidebar.html.php @@ -0,0 +1,5 @@ + +
        + Add panels", + array("url" => html::mark_clean(url::site("admin/sidebar")))) ?> +
        -- cgit v1.2.3 From 8bf246f5148730b6596fd34b946ee97771b3bfc6 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 30 Sep 2009 07:52:43 -0700 Subject: Forgot to reset the version number --- modules/gallery/module.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/module.info b/modules/gallery/module.info index f509ff08..bffcb1c6 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = "Gallery 3" description = "Gallery core application" -version = 15 +version = 14 -- cgit v1.2.3 From 19b875723b37ac7121c64c0c882ccbc2e6353d08 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 30 Sep 2009 10:53:22 -0700 Subject: Make the parameter to block_manager::get_html() optional as its not applicable to admin sidebar blocks. --- modules/gallery/helpers/block_manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/block_manager.php b/modules/gallery/helpers/block_manager.php index b99a6571..233e4f2e 100644 --- a/modules/gallery/helpers/block_manager.php +++ b/modules/gallery/helpers/block_manager.php @@ -60,7 +60,7 @@ class block_manager_Core { return $blocks; } - static function get_html($location, $theme) { + static function get_html($location, $theme=null) { $active = self::get_active($location); $result = ""; foreach ($active as $id => $desc) { -- cgit v1.2.3 From 4de412e72270587cbd656ebafe08892344055a4d Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 30 Sep 2009 14:25:33 -0700 Subject: Enable the administration screen for the sidebar. Fix for ticket #110. --- modules/gallery/controllers/admin_sidebar.php | 39 ++++++++++++++++++ modules/gallery/helpers/gallery_event.php | 6 ++- modules/gallery/views/admin_sidebar.html.php | 47 +++++++++++++++++++--- .../gallery/views/admin_sidebar_blocks.html.php | 5 +++ themes/admin_wind/css/screen.css | 28 +++++++++++++ 5 files changed, 119 insertions(+), 6 deletions(-) create mode 100644 modules/gallery/views/admin_sidebar_blocks.html.php (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/admin_sidebar.php b/modules/gallery/controllers/admin_sidebar.php index 7e71426a..f029d259 100644 --- a/modules/gallery/controllers/admin_sidebar.php +++ b/modules/gallery/controllers/admin_sidebar.php @@ -21,8 +21,47 @@ class Admin_Sidebar_Controller extends Admin_Controller { public function index() { $view = new Admin_View("admin.html"); $view->content = new View("admin_sidebar.html"); + $view->content->csrf = access::csrf_token(); + $view->content->available = new View("admin_sidebar_blocks.html"); + $view->content->active = new View("admin_sidebar_blocks.html"); + list($view->content->available->blocks, $view->content->active->blocks) = $this->_get_blocks(); print $view; } + public function update() { + access::verify_csrf(); + + $available_blocks = block_manager::get_available_site_blocks(); + + $active_blocks = array(); + foreach ($this->input->get("block", array()) as $block_id) { + $active_blocks[] = explode(":", (string) $block_id); + } + block_manager::set_active("site.sidebar", $active_blocks); + + $result = array("result" => "success"); + list($available, $active) = $this->_get_blocks(); + $v = new View("admin_sidebar_blocks.html"); + $v->blocks = $available; + $result["available"] = $v->render(); + $v = new View("admin_sidebar_blocks.html"); + $v->blocks = $active; + $result["active"] = $v->render(); + + print json_encode($result); + } + + private function _get_blocks() { + $active_blocks = array(); + $available_blocks = block_manager::get_available_site_blocks(); + foreach (block_manager::get_active("site.sidebar") as $block) { + $id = "{$block[0]}:{$block[1]}"; + if (!empty($available_blocks[$id])) { + $active_blocks[$id] = $available_blocks[$id]; + unset($available_blocks[$id]); + } + } + return array($available_blocks, $active_blocks); + } } diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 9305580f..69458e74 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -171,7 +171,11 @@ class gallery_event_Core { ->append(Menu::factory("link") ->id("theme_options") ->label(t("Theme Options")) - ->url(url::site("admin/theme_options")))) + ->url(url::site("admin/theme_options"))) + ->append(Menu::factory("link") + ->id("sidebar") + ->label(t("Manage Sidebar")) + ->url(url::site("admin/sidebar")))) ->append(Menu::factory("submenu") ->id("statistics_menu") ->label(t("Statistics"))) diff --git a/modules/gallery/views/admin_sidebar.html.php b/modules/gallery/views/admin_sidebar.html.php index 32386f5d..62b59ac1 100644 --- a/modules/gallery/views/admin_sidebar.html.php +++ b/modules/gallery/views/admin_sidebar.html.php @@ -1,9 +1,46 @@ - -

        + +

        - -
        -
        \ No newline at end of file +
        "> +
        +

        +
        +
          + +
        +
        +
        +
        +

        +
        +
          + +
        +
        +
        +
        diff --git a/modules/gallery/views/admin_sidebar_blocks.html.php b/modules/gallery/views/admin_sidebar_blocks.html.php new file mode 100644 index 00000000..a1a71743 --- /dev/null +++ b/modules/gallery/views/admin_sidebar_blocks.html.php @@ -0,0 +1,5 @@ + + + $text): ?> +
      • + diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css index 737c5939..c733b482 100644 --- a/themes/admin_wind/css/screen.css +++ b/themes/admin_wind/css/screen.css @@ -656,6 +656,34 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { background: #ffc; } +/* admin/sidebar ~~~~~~~~~~~~~~~~~~~~~~~~~ */ +.gAdminBlocksList { + float: left; + height: 300px; + margin-left: 20px; + width: 30%; +} + +.gAdminBlocksList div:last-child { + border: .1em solid; + height: 100%; + overflow-y: auto; +} + +.gAdminBlocksList ul { + margin: .1em .1em; + padding: .1em; +} + +.gAdminBlocksList ul li { + background-color: #e8e8e8; + font-size: 1em; + font-weight: bold; + margin: .5em; + padding: .3em .8em; +} + + /** ******************************************************************* * 5) Navigation and menus *********************************************************************/ -- cgit v1.2.3 From e197e4017daa0833cec84d8392e4d05cdf81503d Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 30 Sep 2009 17:02:48 -0700 Subject: Set the gallery version to 15 and provide upgrade processing to set the default sidebar. --- modules/gallery/helpers/gallery_installer.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 9e4e3c35..743808ea 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -268,7 +268,7 @@ class gallery_installer { module::set_var("gallery", "show_credits", 1); // @todo this string needs to be picked up by l10n_scanner module::set_var("gallery", "credits", "Powered by Gallery %version"); - module::set_version("gallery", 14); + module::set_version("gallery", 15); } static function upgrade($version) { @@ -382,6 +382,17 @@ class gallery_installer { module::set_version("gallery", $version = 14); } + if ($version == 14) { + $sidebar_blocks = block_manager::get_active("site.sidebar"); + if (empty($sidebar_blocks)) { + $available_blocks = block_manager::get_available_site_blocks(); + foreach (array_key(block_manager::get_available_site_blocks()) as $id) { + $sidebar_blocks[] = explode(":", $id); + } + block_manager::set_active("site.sidebar", $sidebar_blocks); + } + module::set_version("gallery", $version = 15); + } } static function uninstall() { -- cgit v1.2.3 From 81eaf1e46cb1646bf6b5d5c2f86ea3b3c7a0bd06 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 30 Sep 2009 17:30:01 -0700 Subject: Add functionality to activate sidebar blocks when the module is activated and deactivate the sidebar blocks when the module is deactivated. --- modules/gallery/helpers/block_manager.php | 23 +++++++++++++++++++++++ modules/gallery/helpers/gallery_installer.php | 2 +- modules/gallery/helpers/module.php | 6 ++++++ 3 files changed, 30 insertions(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/block_manager.php b/modules/gallery/helpers/block_manager.php index 233e4f2e..906a251d 100644 --- a/modules/gallery/helpers/block_manager.php +++ b/modules/gallery/helpers/block_manager.php @@ -32,12 +32,35 @@ class block_manager_Core { self::set_active($location, $blocks); } + static function activate_sidebar_blocks($module_name) { + $block_class = "{$module_name}_block"; + if (method_exists($block_class, "get_site_list")) { + $blocks = call_user_func(array($block_class, "get_site_list")); + Kohana::log("error", Kohana::debug($blocks)); + foreach (array_keys($blocks) as $id) { + list ($unused, $block_id) = explode(":", $id); + self::add("site.sidebar", $module_name, $block_id); + } + } + } + static function remove($location, $block_id) { $blocks = self::get_active($location); unset($blocks[$block_id]); self::set_active($location, $blocks); } + static function deactivate_sidebar_blocks($module_name) { + $block_class = "{$module_name}_block"; + if (method_exists($block_class, "get_site_list")) { + $blocks = call_user_func(array($block_class, "get_site_list")); + foreach (array_keys($blocks) as $id) { + list ($unused, $block_id) = explode(":", $id); + self::remove("site.sidebar", $module_name, $block_id); + } + } + } + static function get_available_admin_blocks() { return self::_get_blocks("get_admin_list"); } diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 743808ea..b1ea1f19 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -386,7 +386,7 @@ class gallery_installer { $sidebar_blocks = block_manager::get_active("site.sidebar"); if (empty($sidebar_blocks)) { $available_blocks = block_manager::get_available_site_blocks(); - foreach (array_key(block_manager::get_available_site_blocks()) as $id) { + foreach (array_keys(block_manager::get_available_site_blocks()) as $id) { $sidebar_blocks[] = explode(":", $id); } block_manager::set_active("site.sidebar", $sidebar_blocks); diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php index a27fdbc5..fe37f4f9 100644 --- a/modules/gallery/helpers/module.php +++ b/modules/gallery/helpers/module.php @@ -195,6 +195,9 @@ class module_Core { module::load_modules(); graphics::activate_rules($module_name); + + block_manager::activate_sidebar_blocks($module_name); + log::success( "module", t("Activated module %module_name", array("module_name" => $module_name))); } @@ -219,6 +222,9 @@ class module_Core { module::load_modules(); graphics::deactivate_rules($module_name); + + block_manager::deactivate_sidebar_blocks($module_name); + log::success( "module", t("Deactivated module %module_name", array("module_name" => $module_name))); } -- cgit v1.2.3 From 4ec2654a69a116709056d0311c38449c7968ad3a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 30 Sep 2009 17:49:08 -0700 Subject: Correct version numbers for image_block and info modules, they inadvertently got set to 2, they should be 1 --- modules/gallery/module.info | 2 +- modules/info/module.info | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/module.info b/modules/gallery/module.info index bffcb1c6..f509ff08 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = "Gallery 3" description = "Gallery core application" -version = 14 +version = 15 diff --git a/modules/info/module.info b/modules/info/module.info index 5f84cbb9..e352213c 100644 --- a/modules/info/module.info +++ b/modules/info/module.info @@ -1,3 +1,3 @@ name = "Info" description = "Display extra information about photos and albums" -version = 2 +version = 1 -- cgit v1.2.3 From 0787ef8b206a84778f04aa36604e0d8ea60cd13c Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 30 Sep 2009 17:54:37 -0700 Subject: Added active_sidebar_blocks and deactive_sidebar_blocks to allow the installer to activate and deactive the side bar blocks when a module is activated or deactivated. --- modules/gallery/helpers/block_manager.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/block_manager.php b/modules/gallery/helpers/block_manager.php index 906a251d..f26c3660 100644 --- a/modules/gallery/helpers/block_manager.php +++ b/modules/gallery/helpers/block_manager.php @@ -37,8 +37,7 @@ class block_manager_Core { if (method_exists($block_class, "get_site_list")) { $blocks = call_user_func(array($block_class, "get_site_list")); Kohana::log("error", Kohana::debug($blocks)); - foreach (array_keys($blocks) as $id) { - list ($unused, $block_id) = explode(":", $id); + foreach (array_keys($blocks) as $block_id) { self::add("site.sidebar", $module_name, $block_id); } } @@ -54,8 +53,7 @@ class block_manager_Core { $block_class = "{$module_name}_block"; if (method_exists($block_class, "get_site_list")) { $blocks = call_user_func(array($block_class, "get_site_list")); - foreach (array_keys($blocks) as $id) { - list ($unused, $block_id) = explode(":", $id); + foreach (array_keys($blocks) as $block_id) { self::remove("site.sidebar", $module_name, $block_id); } } -- cgit v1.2.3 From 4d76a99872202de139c943478845c8972348e97c Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 30 Sep 2009 21:27:21 -0700 Subject: Fix a problem with trying to display item related menu items on a dynamic page like tags --- modules/gallery/helpers/gallery_event.php | 99 ++++++++++++++++--------------- 1 file changed, 51 insertions(+), 48 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 69458e74..c01f4135 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -61,65 +61,68 @@ class gallery_event_Core { ->label(t("Home")) ->url(item::root()->url())); + $item = $theme->item(); - $can_edit = $item && access::can("edit", $item); - $can_add = $item && access::can("add", $item); + if (!empty($item)) { + $can_edit = $item && access::can("edit", $item); + $can_add = $item && access::can("add", $item); - if ($can_add) { - $menu->append($add_menu = Menu::factory("submenu") - ->id("add_menu") - ->label(t("Add"))); - $is_album_writable = - is_writable($item->is_album() ? $item->file_path() : $item->parent()->file_path()); - if ($is_album_writable) { - $add_menu->append(Menu::factory("dialog") - ->id("add_photos_item") - ->label(t("Add photos")) - ->url(url::site("simple_uploader/app/$item->id"))); - if ($item->is_album()) { + if ($can_add) { + $menu->append($add_menu = Menu::factory("submenu") + ->id("add_menu") + ->label(t("Add"))); + $is_album_writable = + is_writable($item->is_album() ? $item->file_path() : $item->parent()->file_path()); + if ($is_album_writable) { $add_menu->append(Menu::factory("dialog") - ->id("add_album_item") - ->label(t("Add an album")) - ->url(url::site("form/add/albums/$item->id?type=album"))); + ->id("add_photos_item") + ->label(t("Add photos")) + ->url(url::site("simple_uploader/app/$item->id"))); + if ($item->is_album()) { + $add_menu->append(Menu::factory("dialog") + ->id("add_album_item") + ->label(t("Add an album")) + ->url(url::site("form/add/albums/$item->id?type=album"))); + } + } else { + message::warning(t("The album '%album_name' is not writable.", + array("album_name" => $item->title))); } - } else { - message::warning(t("The album '%album_name' is not writable.", - array("album_name" => $item->title))); } - } - switch ($item->type) { - case "album": - $option_text = t("Album options"); - $edit_text = t("Edit album"); - break; - case "movie": - $option_text = t("Movie options"); - $edit_text = t("Edit movie"); - break; - default: - $option_text = t("Photo options"); - $edit_text = t("Edit photo"); - } - - $menu->append($options_menu = Menu::factory("submenu") - ->id("options_menu") - ->label($option_text)); - if ($item && ($can_edit || $can_add)) { - if ($can_edit) { - $options_menu->append(Menu::factory("dialog") - ->id("edit_item") - ->label($edit_text) - ->url(url::site("form/edit/{$item->type}s/$item->id"))); + switch ($item->type) { + case "album": + $option_text = t("Album options"); + $edit_text = t("Edit album"); + break; + case "movie": + $option_text = t("Movie options"); + $edit_text = t("Edit movie"); + break; + default: + $option_text = t("Photo options"); + $edit_text = t("Edit photo"); } - if ($item->is_album()) { + $menu->append($options_menu = Menu::factory("submenu") + ->id("options_menu") + ->label($option_text)); + if ($item && ($can_edit || $can_add)) { if ($can_edit) { $options_menu->append(Menu::factory("dialog") - ->id("edit_permissions") - ->label(t("Edit permissions")) - ->url(url::site("permissions/browse/$item->id"))); + ->id("edit_item") + ->label($edit_text) + ->url(url::site("form/edit/{$item->type}s/$item->id"))); + } + + if ($item->is_album()) { + if ($can_edit) { + $options_menu->append(Menu::factory("dialog") + ->id("edit_permissions") + ->label(t("Edit permissions")) + ->url(url::site("permissions/browse/$item->id"))); + } } } } -- cgit v1.2.3 From e1e8904e4a82792effd721fc0b4c028d86cf177a Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Wed, 30 Sep 2009 22:49:36 -0600 Subject: Convert gDialog and gCancel over to g-dialog and g-cancel. Refactor CSS id's and classes in the login/reset password dialog. --- lib/gallery.common.css | 56 ++++++++++++++--- lib/gallery.common.js | 4 +- lib/gallery.dialog.js | 72 +++++++++++----------- modules/exif/helpers/exif.php | 2 +- modules/exif/views/exif_sidebar.html.php | 2 +- modules/g2_import/views/admin_g2_import.html.php | 2 +- modules/gallery/helpers/graphics.php | 2 +- modules/gallery/libraries/Menu.php | 2 +- .../gallery/views/admin_advanced_settings.html.php | 2 +- modules/gallery/views/admin_maintenance.html.php | 8 +-- .../views/admin_maintenance_show_log.html.php | 2 +- modules/gallery/views/admin_themes.html.php | 4 +- modules/organize/js/organize.js | 16 ++--- modules/organize/views/organize_dialog.html.php | 2 +- modules/search/helpers/search.php | 2 +- modules/server_add/js/server_add.js | 4 +- modules/tag/js/tag.js | 2 +- modules/tag/views/admin_tags.html.php | 2 +- modules/user/helpers/group.php | 1 + modules/user/helpers/user.php | 3 + modules/user/views/admin_users.html.php | 8 +-- modules/user/views/admin_users_group.html.php | 4 +- modules/user/views/login.html.php | 2 +- modules/user/views/login_ajax.html.php | 24 ++++---- modules/watermark/views/admin_watermarks.html.php | 6 +- themes/admin_wind/css/screen.css | 55 ++--------------- themes/admin_wind/js/ui.init.js | 2 +- themes/wind/css/fix-ie.css | 2 +- themes/wind/css/screen.css | 63 +++---------------- themes/wind/js/ui.init.js | 4 +- themes/wind/views/album.html.php | 2 +- 31 files changed, 158 insertions(+), 204 deletions(-) (limited to 'modules/gallery') diff --git a/lib/gallery.common.css b/lib/gallery.common.css index 601f6609..54453012 100644 --- a/lib/gallery.common.css +++ b/lib/gallery.common.css @@ -3,9 +3,10 @@ * * Sheet organization: * 1) Text - * 2) States and interactions - * 3) Positioning and order - * 4) Reusable containers/widgets + * 2) Dimension and scale + * 3) States and interactions + * 4) Positioning and order + * 5) Containers/widgets */ /** ******************************************************************* @@ -24,8 +25,16 @@ text-align: right; } + +/** ******************************************************************* + * 2) Dimension and scale + **********************************************************************/ + +.g-narrow { +} + /** ******************************************************************* - * 2) States and interactions + * 3) States and interactions **********************************************************************/ .g-active, @@ -105,7 +114,7 @@ form .g-error { } /** ******************************************************************* - * 3) Positioning and order + * 4) Positioning and order **********************************************************************/ .g-left { @@ -131,10 +140,43 @@ form .g-error { } /** ******************************************************************* - * 4) Reusable containers/widgets + * 5) Containers/widgets **********************************************************************/ -.g-dialog { +#g-dialog { + text-align: left; +} + +#g-dialog .g-narrow { + margin: 0 auto; + width: 270px; +} + +#g-dialog fieldset { + border: none; +} + +#g-dialog legend { + display: none; +} + +#g-dialog form input[type="text"], +#g-dialog form input[type="password"] { + width: 100%; +} + +#g-dialog p { + margin: 0; +} + +#g-dialog li { + padding-left: 0; +} + +#g-dialog .g-cancel { + clear: none; + float: left; + margin: .3em 1em; } .g-button { diff --git a/lib/gallery.common.js b/lib/gallery.common.js index a91f021e..59482b22 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -53,7 +53,7 @@ return this.each(function(i){ var size; switch ($(this).attr("id")) { - case "#gDialog": + case "#g-dialog": case "#gPanel": size = "Large"; break; @@ -133,7 +133,7 @@ function() { if (in_progress == 0) { $(this).find("ul").slideDown("fast", function() { in_progress = 1; }); - $(this).find(".gDialogLink").gallery_dialog(); + $(this).find(".g-dialogLink").gallery_dialog(); $(this).find(".gAjaxLink").gallery_ajax(); } }, diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index 39c451e3..a70200f9 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -15,75 +15,75 @@ _show: function(sHref) { var self = this; - var eDialog = '
        '; + var eDialog = '
        '; $("body").append(eDialog); if (!self.options.close) { self.options.close = self.close_dialog; } - $("#gDialog").dialog(self.options); + $("#g-dialog").dialog(self.options); - $("#gDialog").gallery_show_loading(); + $("#g-dialog").gallery_show_loading(); $.get(sHref, function(data) { - $("#gDialog").html(data).gallery_show_loading(); + $("#g-dialog").html(data).gallery_show_loading(); - if ($("#gDialog form").length) { - self.form_loaded(null, $("#gDialog form")); + if ($("#g-dialog form").length) { + self.form_loaded(null, $("#g-dialog form")); } self._layout(); - $("#gDialog").dialog("open"); + $("#g-dialog").dialog("open"); // Remove titlebar for progress dialogs or set title - if ($("#gDialog #gProgress").length) { + if ($("#g-dialog #gProgress").length) { $(".ui-dialog-titlebar").remove(); - } else if ($("#gDialog h1").length) { - $("#gDialog").dialog('option', 'title', $("#gDialog h1:eq(0)").html()); - } else if ($("#gDialog fieldset legend").length) { - $("#gDialog").dialog('option', 'title', $("#gDialog fieldset legend:eq(0)").html()); + } else if ($("#g-dialog h1").length) { + $("#g-dialog").dialog('option', 'title', $("#g-dialog h1:eq(0)").html()); + } else if ($("#g-dialog fieldset legend").length) { + $("#g-dialog").dialog('option', 'title', $("#g-dialog fieldset legend:eq(0)").html()); } - if ($("#gDialog form").length) { + if ($("#g-dialog form").length) { self._ajaxify_dialog(); } }); - $("#gDialog").dialog("option", "self", self); + $("#g-dialog").dialog("option", "self", self); }, _layout: function() { var dialogWidth; - var dialogHeight = $("#gDialog").height(); - var cssWidth = new String($("#gDialog form").css("width")); + 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 ($("#gDialog iframe").length) { + if ($("#g-dialog iframe").length) { dialogWidth = size.width() - 100; // Set the iframe width and height - $("#gDialog iframe").width("100%").height(size.height() - 100); - } else if ($("#gDialog .gDialogPanel").length) { + $("#g-dialog iframe").width("100%").height(size.height() - 100); + } else if ($("#g-dialog .g-dialogPanel").length) { dialogWidth = size.width() - 100; - $("#gDialog").dialog("option", "height", size.height() - 100); + $("#g-dialog").dialog("option", "height", size.height() - 100); } else if (childWidth == "" || childWidth > 300) { dialogWidth = 500; } - $("#gDialog").dialog('option', 'width', dialogWidth); + $("#g-dialog").dialog('option', 'width', dialogWidth); }, form_loaded: function(event, ui) { // Should be defined (and localized) in the theme MSG_CANCEL = MSG_CANCEL || 'Cancel'; - var eCancel = '' + MSG_CANCEL + ''; - if ($("#gDialog .submit").length) { - $("#gDialog .submit").addClass("ui-state-default ui-corner-all"); + var eCancel = '' + MSG_CANCEL + ''; + if ($("#g-dialog .submit").length) { + $("#g-dialog .submit").addClass("ui-state-default ui-corner-all"); $.fn.gallery_hover_init(); - $("#gDialog .submit").parent().append(eCancel); - $("#gDialog .gCancel").click(function(event) { - $("#gDialog").dialog("close"); + $("#g-dialog .submit").parent().append(eCancel); + $("#g-dialog .g-cancel").click(function(event) { + $("#g-dialog").dialog("close"); event.preventDefault(); }); } - $("#gDialog .ui-state-default").hover( + $("#g-dialog .ui-state-default").hover( function() { $(this).addClass("ui-state-hover"); }, @@ -94,23 +94,23 @@ }, close_dialog: function(event, ui) { - var self = $("#gDialog").dialog("option", "self"); - if ($("#gDialog form").length) { - self._trigger("form_closing", null, $("#gDialog form")); + 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, $("#gDialog")); - $("#gDialog").dialog("destroy").remove(); + self._trigger("dialog_closing", null, $("#g-dialog")); + $("#g-dialog").dialog("destroy").remove(); }, _ajaxify_dialog: function() { var self = this; - $("#gDialog form").ajaxForm({ + $("#g-dialog form").ajaxForm({ dataType: "json", success: function(data) { if (data.form) { - $("#gDialog form").replaceWith(data.form); + $("#g-dialog form").replaceWith(data.form); self._ajaxify_dialog(); - self.form_loaded(null, $("#gDialog form")); + self.form_loaded(null, $("#g-dialog form")); if (typeof data.reset == 'function') { eval(data.reset + '()'); } diff --git a/modules/exif/helpers/exif.php b/modules/exif/helpers/exif.php index 83540622..453690ea 100644 --- a/modules/exif/helpers/exif.php +++ b/modules/exif/helpers/exif.php @@ -163,7 +163,7 @@ class exif_Core { list ($remaining) = exif::stats(); if ($remaining) { site_status::warning( - t('Your Exif index needs to be updated. Fix this now', + t('Your Exif index needs to be updated. Fix this now', array("url" => html::mark_clean(url::site("admin/maintenance/start/exif_task::update_index?csrf=__CSRF__")))), "exif_index_out_of_date"); } diff --git a/modules/exif/views/exif_sidebar.html.php b/modules/exif/views/exif_sidebar.html.php index 23ecab03..3c7bb517 100644 --- a/modules/exif/views/exif_sidebar.html.php +++ b/modules/exif/views/exif_sidebar.html.php @@ -1,6 +1,6 @@ id}") ?>" title="for_html_attr() ?>" - class="gDialogLink g-button ui-icon-left ui-state-default ui-corner-all"> + class="g-dialogLink g-button ui-icon-left ui-state-default ui-corner-all"> diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php index 91b723ad..314f030b 100644 --- a/modules/g2_import/views/admin_g2_import.html.php +++ b/modules/g2_import/views/admin_g2_import.html.php @@ -84,7 +84,7 @@

        - "> diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 0e32022f..f9b88638 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -249,7 +249,7 @@ class graphics_Core { "%count of your photos are out of date. Click here to fix them", $count, array("attrs" => html::mark_clean(sprintf( - 'href="%s" class="gDialogLink"', + 'href="%s" class="g-dialogLink"', url::site("admin/maintenance/start/gallery_task::rebuild_dirty_images?csrf=__CSRF__"))))), "graphics_dirty"); } diff --git a/modules/gallery/libraries/Menu.php b/modules/gallery/libraries/Menu.php index 07b2b2b8..4be374a2 100644 --- a/modules/gallery/libraries/Menu.php +++ b/modules/gallery/libraries/Menu.php @@ -142,7 +142,7 @@ class Menu_Element_Dialog extends Menu_Element { } else { $css_class = ""; } - return "

      • url\" " . + return "
      • url\" " . "title=\"$this->label\">$this->label
      • "; } } diff --git a/modules/gallery/views/admin_advanced_settings.html.php b/modules/gallery/views/admin_advanced_settings.html.php index c3595da5..6ad265ac 100644 --- a/modules/gallery/views/admin_advanced_settings.html.php +++ b/modules/gallery/views/admin_advanced_settings.html.php @@ -23,7 +23,7 @@
    @@ -100,7 +100,7 @@ state == "stalled"): ?> - id?csrf=$csrf") ?>"> @@ -170,12 +170,12 @@ get_log()): ?> - id?csrf=$csrf") ?>" class="gDialogLink g-button ui-state-default ui-corner-all"> + id?csrf=$csrf") ?>" class="g-dialogLink g-button ui-state-default ui-corner-all"> - id?csrf=$csrf") ?>" class="gDialogLink g-button" ui-state-default ui-corner-all> + id?csrf=$csrf") ?>" class="g-dialogLink g-button" ui-state-default ui-corner-all> id?csrf=$csrf") ?>" class="g-button ui-state-default ui-corner-all"> diff --git a/modules/gallery/views/admin_maintenance_show_log.html.php b/modules/gallery/views/admin_maintenance_show_log.html.php index 2dfef90f..c61db871 100644 --- a/modules/gallery/views/admin_maintenance_show_log.html.php +++ b/modules/gallery/views/admin_maintenance_show_log.html.php @@ -9,7 +9,7 @@ appendTo('body').submit().remove(); }; -
    +

    name ?>

    get_log()) ?>
    diff --git a/modules/gallery/views/admin_themes.html.php b/modules/gallery/views/admin_themes.html.php index 0aac4717..d0ffc414 100644 --- a/modules/gallery/views/admin_themes.html.php +++ b/modules/gallery/views/admin_themes.html.php @@ -30,7 +30,7 @@ site) continue ?>
    - " class="gDialogLink" title=" $info->name))->for_html_attr() ?>"> + " class="g-dialogLink" title=" $info->name))->for_html_attr() ?>"> " alt="name) ?>" />

    name ?>

    @@ -68,7 +68,7 @@ admin) continue ?>
    - " class="gDialogLink" title=" $info->name))->for_html_attr() ?>"> + " class="g-dialogLink" title=" $info->name))->for_html_attr() ?>"> " alt="name) ?>" />

    name ?>

    diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js index cfaff01c..bee42a22 100644 --- a/modules/organize/js/organize.js +++ b/modules/organize/js/organize.js @@ -138,19 +138,19 @@ var self = this; // Deal with ui.jquery bug: http://dev.jqueryui.com/ticket/4475 (target 1.8?) $(".sf-menu li.sfHover ul").css("z-index", 68); - $("#gDialog").dialog("option", "zIndex", 70); - $("#gDialog").bind("dialogopen", function(event, ui) { - $("#gOrganize").height($("#gDialog").innerHeight() - 20); - $("#gOrganizeMicroThumbPanel").height($("#gDialog").innerHeight() - 90); - $("#gOrganizeTreeContainer").height($("#gDialog").innerHeight() - 59); + $("#g-dialog").dialog("option", "zIndex", 70); + $("#g-dialog").bind("dialogopen", function(event, ui) { + $("#gOrganize").height($("#g-dialog").innerHeight() - 20); + $("#gOrganizeMicroThumbPanel").height($("#g-dialog").innerHeight() - 90); + $("#gOrganizeTreeContainer").height($("#g-dialog").innerHeight() - 59); }); - $("#gDialog").bind("dialogclose", function(event, ui) { + $("#g-dialog").bind("dialogclose", function(event, ui) { window.location.reload(); }); - $("#gDialog #gOrganizeClose").click(function(event) { - $("#gDialog").dialog("close"); + $("#g-dialog #gOrganizeClose").click(function(event) { + $("#g-dialog").dialog("close"); }); $("#gOrganizeSortColumn,#gOrganizeSortOrder").change(function(event) { diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 87f12be9..09720fe4 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -5,7 +5,7 @@ var sort_order_url = ""; var tree_url = ""; -
    +

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

    diff --git a/modules/search/helpers/search.php b/modules/search/helpers/search.php index 0080b4ce..c73eda08 100644 --- a/modules/search/helpers/search.php +++ b/modules/search/helpers/search.php @@ -57,7 +57,7 @@ class search_Core { list ($remaining) = search::stats(); if ($remaining) { site_status::warning( - t('Your search index needs to be updated. Fix this now', + t('Your search index needs to be updated. Fix this now', array("url" => html::mark_clean(url::site("admin/maintenance/start/search_task::update_index?csrf=__CSRF__")))), "search_index_out_of_date"); } diff --git a/modules/server_add/js/server_add.js b/modules/server_add/js/server_add.js index 50a8c36b..86bff079 100644 --- a/modules/server_add/js/server_add.js +++ b/modules/server_add/js/server_add.js @@ -21,7 +21,7 @@ self.run_add(); }); $("#gServerAddCloseButton", this.element).click(function(event) { - $("#gDialog").dialog("close"); + $("#g-dialog").dialog("close"); window.location.reload(); }); $("#gServerAddTree span.gDirectory", this.element).dblclick(function(event) { @@ -33,7 +33,7 @@ $("#gServerAddTree span.gDirectory", this.element).dblclick(function(event) { self.open_dir(event); }); - $("#gDialog").bind("dialogclose", function(event, ui) { + $("#g-dialog").bind("dialogclose", function(event, ui) { window.location.reload(); }); }, diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js index 52c695c6..ab3691a6 100644 --- a/modules/tag/js/tag.js +++ b/modules/tag/js/tag.js @@ -24,7 +24,7 @@ function closeEditInPlaceForms() { $("#gRenameTagForm").parent().html($("#gRenameTagForm").parent().data("revert")); li.height(""); $(".gEditable", li).bind("click", editInPlace); - $(".gDialogLink", li).gallery_dialog(); + $(".g-dialogLink", li).gallery_dialog(); } } diff --git a/modules/tag/views/admin_tags.html.php b/modules/tag/views/admin_tags.html.php index b7344cda..a4bd5d8f 100644 --- a/modules/tag/views/admin_tags.html.php +++ b/modules/tag/views/admin_tags.html.php @@ -50,7 +50,7 @@ name) ?> (count ?>) id") ?>" - class="gDialogLink delete-link g-button"> + class="g-dialogLink delete-link g-button"> diff --git a/modules/user/helpers/group.php b/modules/user/helpers/group.php index 04e6efd6..e0dfac8e 100644 --- a/modules/user/helpers/group.php +++ b/modules/user/helpers/group.php @@ -86,6 +86,7 @@ class group_Core { static function get_add_form_admin() { $form = new Forge("admin/users/add_group", "", "post", array("id" => "gAddGroupForm")); + $form->set_attr('class', "g-narrow"); $form_group = $form->group("add_group")->label(t("Add Group")); $form_group->input("name")->label(t("Name"))->id("gName"); $form_group->inputs["name"]->error_messages( diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index b9162b92..93c385a3 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -26,6 +26,7 @@ class user_Core { static function get_edit_form($user) { $form = new Forge("users/$user->id?_method=put", "", "post", array("id" => "gEditUserForm")); + $form->set_attr("class", "g-narrow"); $group = $form->group("edit_user")->label(t("Edit User: %name", array("name" => $user->name))); $group->input("full_name")->label(t("Full Name"))->id("gFullName")->value($user->full_name); self::_add_locale_dropdown($group, $user); @@ -66,6 +67,7 @@ class user_Core { static function get_add_form_admin() { $form = new Forge("admin/users/add_user", "", "post", array("id" => "gAddUserForm")); + $form->set_attr('class', "g-narrow"); $group = $form->group("add_user")->label(t("Add User")); $group->input("name")->label(t("Username"))->id("gUsername") ->error_messages("in_use", t("There is already a user with that username")); @@ -112,6 +114,7 @@ class user_Core { static function get_login_form($url) { $form = new Forge($url, "", "post", array("id" => "gLoginForm")); + $form->set_attr('class', "g-narrow"); $group = $form->group("login")->label(t("Login")); $group->input("name")->label(t("Username"))->id("gUsername")->class(null); $group->password("password")->label(t("Password"))->id("gPassword")->class(null); diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php index 0741a932..a46e402f 100644 --- a/modules/user/views/admin_users.html.php +++ b/modules/user/views/admin_users.html.php @@ -28,7 +28,7 @@ {}, function(data) { $("#group-" + group_id).html(data); - $("#group-" + group_id + " .gDialogLink").gallery_dialog(); + $("#group-" + group_id + " .g-dialogLink").gallery_dialog(); }); } @@ -43,7 +43,7 @@
    " - class="gDialogLink g-button g-right ui-icon-left ui-state-default ui-corner-all" + class="g-dialogLink g-button g-right ui-icon-left ui-state-default ui-corner-all" title="for_html_attr() ?>"> @@ -89,7 +89,7 @@ id != $user->id && !$user->guest): ?> id") ?>" - class="gDialogLink g-button ui-state-default ui-corner-all ui-icon-left"> + class="g-dialogLink g-button ui-state-default ui-corner-all ui-icon-left"> for_html_attr() ?>" @@ -105,7 +105,7 @@
    " - class="gDialogLink g-button g-right ui-icon-left ui-state-default ui-corner-all" + class="g-dialogLink g-button g-right ui-icon-left ui-state-default ui-corner-all" title="for_html_attr() ?>"> diff --git a/modules/user/views/admin_users_group.html.php b/modules/user/views/admin_users_group.html.php index 6f2496f8..e5c9fcee 100644 --- a/modules/user/views/admin_users_group.html.php +++ b/modules/user/views/admin_users_group.html.php @@ -4,11 +4,11 @@ special): ?> id") ?>" title=" $group->name))->for_html_attr() ?>" - class="gDialogLink g-button ui-state-default ui-corner-all"> + class="g-dialogLink g-button ui-state-default ui-corner-all"> for_html_attr() ?>" - class="gDialogLink g-button ui-state-disabled ui-corner-all ui-icon-left"> + class="g-dialogLink g-button ui-state-disabled ui-corner-all ui-icon-left"> diff --git a/modules/user/views/login.html.php b/modules/user/views/login.html.php index bb670d51..c814bbfa 100644 --- a/modules/user/views/login.html.php +++ b/modules/user/views/login.html.php @@ -11,7 +11,7 @@ html::mark_clean( 'id}") . '" title="' . t("Edit Your Profile")->for_html_attr() . - '" id="gUserProfileLink" class="gDialogLink">' . + '" id="gUserProfileLink" class="g-dialogLink">' . html::clean($user->display_name()) . ''))) ?>
  • diff --git a/modules/user/views/login_ajax.html.php b/modules/user/views/login_ajax.html.php index a7530134..d3364b46 100644 --- a/modules/user/views/login_ajax.html.php +++ b/modules/user/views/login_ajax.html.php @@ -1,12 +1,12 @@ -
    +
      -
    • -
      - -
      +
    • +
    • - +
    diff --git a/modules/watermark/views/admin_watermarks.html.php b/modules/watermark/views/admin_watermarks.html.php index 3790030d..285f6407 100644 --- a/modules/watermark/views/admin_watermarks.html.php +++ b/modules/watermark/views/admin_watermarks.html.php @@ -8,7 +8,7 @@ " title="for_html_attr() ?>" - class="gDialogLink g-button ui-icon-left ui-state-default ui-corner-all"> + class="g-dialogLink g-button ui-icon-left ui-state-default ui-corner-all">

    @@ -27,10 +27,10 @@

    " title="for_html_attr() ?>" - class="gDialogLink g-button ui-icon-left ui-state-default ui-corner-all"> + class="g-dialogLink g-button ui-icon-left ui-state-default ui-corner-all"> " title="for_html_attr() ?>" - class="gDialogLink g-button ui-icon-left ui-state-default ui-corner-all"> + class="g-dialogLink g-button ui-icon-left ui-state-default ui-corner-all">
    diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css index 2679386b..24c63756 100644 --- a/themes/admin_wind/css/screen.css +++ b/themes/admin_wind/css/screen.css @@ -67,7 +67,7 @@ h3 { a, .gMenu a, -#gDialog a, +#g-dialog a, .g-button, .g-button:hover, .g-button:active, @@ -80,7 +80,7 @@ button.ui-state-hover { } a:hover, -#gDialog a:hover { +#g-dialog a:hover { text-decoration: underline; } @@ -88,21 +88,6 @@ a:hover, text-decoration: none; } -#gDialog .gCancel { - clear: none; - float: left; - margin: .3em 1em; -} - -#gForgotPasswordLink { - float: right; - font-size: .9em; -} - -#gDialog .gCancel { - float: left; -} - /* Tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ table { @@ -782,7 +767,7 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { font-size: 0; } -.gDialogLoadingLarge { +.g-dialogLoadingLarge { background: url('../../../lib/images/loading-large.gif') no-repeat center center !important; font-size: 0; } @@ -836,34 +821,6 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { opacity: .7; } -#gDialog { - text-align: left; -} - -#gDialog li { - padding-left: 0; -} - -#gDialog form input[type="text"], -#gDialog form input[type="password"] { - width: 100%; -} - -#gDialog #gLoginForm, -#gDialog #gAddUserForm, -#gDialog #gAddGroupForm { - margin: 0 auto; - width: 270px; -} - -#gDialog fieldset { - border: none; -} - -#gDialog legend { - display: none; -} - /* jQuery UI ThemeRoller buttons */ .gButtonSet { @@ -1056,7 +1013,7 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { float: right; } -#gTaskLogDialog h1 { +#gTaskLog-dialog h1 { font-size: 1.1em; } @@ -1143,7 +1100,7 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { .rtl caption, .rtl th, -.rtl #gDialog { +.rtl #g-dialog { text-align: right; } @@ -1159,7 +1116,7 @@ li.gDefaultGroup h4, li.gDefaultGroup .gUser { float: left; } -.rtl #gDialog .gCancel, +.rtl #g-dialog .g-cancel, .rtl form ul ul li, .rtl input[type="submit"], .rtl input[type="reset"], diff --git a/themes/admin_wind/js/ui.init.js b/themes/admin_wind/js/ui.init.js index d9b011bd..a603f87f 100644 --- a/themes/admin_wind/js/ui.init.js +++ b/themes/admin_wind/js/ui.init.js @@ -17,7 +17,7 @@ $(document).ready(function(){ $("#gMessage li").gallery_show_message(); // Initialize modal dialogs - $(".gDialogLink").gallery_dialog(); + $(".g-dialogLink").gallery_dialog(); // Initialize ajax links $(".gAjaxLink").gallery_ajax(); diff --git a/themes/wind/css/fix-ie.css b/themes/wind/css/fix-ie.css index 4c13764f..8899ec59 100644 --- a/themes/wind/css/fix-ie.css +++ b/themes/wind/css/fix-ie.css @@ -23,7 +23,7 @@ input.submit { width: 110px; } -#gDialog a.gCancel { +#g-dialog a.g-cancel { display: inline-block !important; float: none !important; } diff --git a/themes/wind/css/screen.css b/themes/wind/css/screen.css index 8f17e310..ec75d310 100644 --- a/themes/wind/css/screen.css +++ b/themes/wind/css/screen.css @@ -67,7 +67,7 @@ h3 { a, .gMenu a, -#gDialog a, +#g-dialog a, .g-button, .g-button:hover, .g-button:active, @@ -81,7 +81,7 @@ button.ui-state-hover { } a:hover, -#gDialog a:hover { +#g-dialog a:hover { text-decoration: underline; } @@ -89,22 +89,7 @@ a:hover, text-decoration: none; } -#gDialog .gCancel { - clear: none; - float: left; - margin: .3em 1em; -} - -#gForgotPasswordLink { - float: right; - font-size: .9em; -} - -#gDialog .gCancel { - float: left; -} - -#gDialog #gMessage li { +#g-dialog #gMessage li { width: 400px; white-space: normal; padding-left: 32px; @@ -685,13 +670,13 @@ form .gError, font-weight: bold; } -#gDialog ul.gBreadcrumbs { +#g-dialog ul.gBreadcrumbs { clear: both; margin-left: 0; padding-left: 0; } -#gDialog .gBreadcrumbs li { +#g-dialog .gBreadcrumbs li { font-size: .9em; } @@ -822,7 +807,7 @@ form .gError, font-size: 0; } -.gDialogLoadingLarge { +.g-dialogLoadingLarge { background: url('../../../lib/images/loading-large.gif') no-repeat center center !important; font-size: 0; } @@ -850,38 +835,6 @@ form .gError, opacity: .7; } -#gDialog { - text-align: left; -} - -#gDialog li { - padding-left: 0; -} - -#gDialog form input[type="text"], -#gDialog form input[type="password"] { - width: 100%; -} - -#gDialog #gLoginForm, -#gDialog #gAddUserForm, -#gDialog #gAddGroupForm { - margin: 0 auto; - width: 270px; -} - -#gDialog fieldset { - border: none; -} - -#gDialog legend { - display: none; -} - -#gDialog p { - margin: 0; -} - /* jQuery UI ThemeRoller buttons */ .gButtonSet { @@ -1097,7 +1050,7 @@ form .gError, .rtl caption, .rtl th, -.rtl #gDialog { +.rtl #g-dialog { text-align: right; } @@ -1109,7 +1062,7 @@ form .gError, float: left; } -.rtl #gDialog .gCancel, +.rtl #g-dialog .g-cancel, .rtl form ul ul li, .rtl input[type="submit"], .rtl input[type="reset"], diff --git a/themes/wind/js/ui.init.js b/themes/wind/js/ui.init.js index 4a1962c0..4b3b4306 100644 --- a/themes/wind/js/ui.init.js +++ b/themes/wind/js/ui.init.js @@ -26,8 +26,8 @@ $(document).ready(function() { $("#gMessage li").gallery_show_message(); // Initialize dialogs - $("#gLoginLink").addClass("gDialogLink"); - $(".gDialogLink").gallery_dialog(); + $("#gLoginLink").addClass("g-dialogLink"); + $(".g-dialogLink").gallery_dialog(); // Initialize view menu if ($("#gViewMenu").length) { diff --git a/themes/wind/views/album.html.php b/themes/wind/views/album.html.php index 01f7be50..fd647f81 100644 --- a/themes/wind/views/album.html.php +++ b/themes/wind/views/album.html.php @@ -30,7 +30,7 @@ admin || access::can("add", $item)): ?> id") ?>
  • Add some.", - array("attrs" => html::mark_clean("href=\"$addurl\" class=\"gDialogLink\""))) ?>
  • + array("attrs" => html::mark_clean("href=\"$addurl\" class=\"g-dialogLink\""))) ?>
  • -- cgit v1.2.3 From b2a9bf43afa2aaf845368ea04beef56f2ed035de Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 1 Oct 2009 12:43:30 -0700 Subject: Change gallery::find_file to not assume that the absolute path is relative to the document root. Instead ignore all th path parts until one of application, modules, themes, or libs is found. Fixes ticket #827 --- modules/gallery/helpers/gallery.php | 13 ++++++++++++- modules/gallery/libraries/Gallery_View.php | 6 ++---- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index b6d4fee0..37a08d08 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -96,7 +96,18 @@ class gallery_Core { return "lib/$file"; } - return is_string($file_name) ? substr($file_name, strlen(DOCROOT)) : $file_name; + if (is_string($file_name)) { + // make relative to DOCROOT + $parts = explode("/", $file_name); + foreach ($parts as $idx => $part) { + if (in_array($part, array("application", "modules", "themes", "lib"))) { + break; + } + unset($parts[$idx]); + } + $file_name = implode("/", $parts); + } + return $file_name; } } \ No newline at end of file diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php index 253a314f..bdfd2fc9 100644 --- a/modules/gallery/libraries/Gallery_View.php +++ b/modules/gallery/libraries/Gallery_View.php @@ -85,13 +85,11 @@ class Gallery_View_Core extends View { if (empty($contents)) { $contents = ""; - $docroot_len = strlen(DOCROOT); foreach (array_keys($paths) as $path) { - $relative = substr($path, $docroot_len); if ($type == "css") { - $contents .= "/* $relative */\n" . $this->process_css($path) . "\n"; + $contents .= "/* $path */\n" . $this->process_css($path) . "\n"; } else { - $contents .= "/* $relative */\n" . file_get_contents($path) . "\n"; + $contents .= "/* $path */\n" . file_get_contents($path) . "\n"; } } -- cgit v1.2.3 From 7236208655c3a4c9fba59b36efaeb8f6175a0819 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 2 Oct 2009 13:20:44 -0700 Subject: Log the stack trace when non-admins get the error. --- modules/gallery/views/kohana_error_page.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/gallery') diff --git a/modules/gallery/views/kohana_error_page.php b/modules/gallery/views/kohana_error_page.php index 9361514d..314a9923 100644 --- a/modules/gallery/views/kohana_error_page.php +++ b/modules/gallery/views/kohana_error_page.php @@ -117,6 +117,11 @@
    + + getTraceAsString(); ?> + + + -- cgit v1.2.3 From 9145331fd420ec3fe86833a7b9567ec42f1d84e8 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sat, 3 Oct 2009 12:33:53 -0600 Subject: Renamed and moved gOdd/gEven CSS classes. --- lib/gallery.common.css | 2 ++ modules/comment/views/admin_block_recent_comments.html.php | 2 +- modules/comment/views/admin_comments.html.php | 2 +- modules/gallery/tests/xss_data.txt | 14 +++++++------- modules/gallery/views/admin_maintenance.html.php | 6 +++--- modules/gallery/views/admin_modules.html.php | 2 +- modules/user/views/admin_users.html.php | 2 +- themes/admin_wind/css/screen.css | 8 -------- 8 files changed, 16 insertions(+), 22 deletions(-) (limited to 'modules/gallery') diff --git a/lib/gallery.common.css b/lib/gallery.common.css index 54453012..5768e1cf 100644 --- a/lib/gallery.common.css +++ b/lib/gallery.common.css @@ -134,9 +134,11 @@ form .g-error { } .g-even-row { + background-color: #fff; } .g-odd-row { + background-color: #eee; } /** ******************************************************************* diff --git a/modules/comment/views/admin_block_recent_comments.html.php b/modules/comment/views/admin_block_recent_comments.html.php index 2afa5bf8..ca0d1c0b 100644 --- a/modules/comment/views/admin_block_recent_comments.html.php +++ b/modules/comment/views/admin_block_recent_comments.html.php @@ -1,7 +1,7 @@
      $comment): ?> -
    • "> +
    • "> " class="gAvatar" alt="author_name()) ?>" diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php index ec5ad7b2..82de378c 100644 --- a/modules/comment/views/admin_comments.html.php +++ b/modules/comment/views/admin_comments.html.php @@ -103,7 +103,7 @@
    $comment): ?> - "> + "> - severity) ?>"> + severity) ?>"> @@ -69,7 +69,7 @@ - state == "stalled" ? "gWarning" : "" ?>"> + state == "stalled" ? "gWarning" : "" ?>"> @@ -142,7 +142,7 @@ - state == "success" ? "gSuccess" : "gError" ?>"> + state == "success" ? "gSuccess" : "gError" ?>"> diff --git a/modules/gallery/views/admin_modules.html.php b/modules/gallery/views/admin_modules.html.php index 9cf03cb3..058844b4 100644 --- a/modules/gallery/views/admin_modules.html.php +++ b/modules/gallery/views/admin_modules.html.php @@ -16,7 +16,7 @@ $module_info): ?> - "> + "> $module_name); ?> locked) $data["disabled"] = 1; ?> diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php index a46e402f..46bdb65e 100644 --- a/modules/user/views/admin_users.html.php +++ b/modules/user/views/admin_users.html.php @@ -64,7 +64,7 @@ $user): ?> - user admin ? "admin" : "" ?>"> + user admin ? "admin" : "" ?>"> "; + var ePanel = ""; // We keep track of the open vs. closed state by looking to see if there' // an orig_text attr. If that attr is missing, then the panel is closed @@ -16,12 +16,12 @@ var should_open = !$(element).attr("orig_text"); // Close any open panels and reset their button text - if ($("#gPanel").length) { - $("#gPanel").slideUp("slow").remove(); - $.each($(".gPanelLink"), + if ($("#g-panel").length) { + $("#g-panel").slideUp("slow").remove(); + $.each($(".g-panel-link"), function() { if ($(this).attr("orig_text")) { - $(this).children(".gButtonText").text($(this).attr("orig_text")); + $(this).children(".g-button-text").text($(this).attr("orig_text")); $(this).attr("orig_text", ""); } } @@ -30,15 +30,15 @@ if (should_open) { $(parent).after(ePanel); - $("#gPanel td").html(sHref); + $("#g-panel td").html(sHref); $.get(sHref, function(data) { - $("#gPanel td").html(data); + $("#g-panel td").html(data); self._ajaxify_panel(); if ($(element).attr("open_text")) { - $(element).attr("orig_text", $(element).children(".gButtonText").text()); - $(element).children(".gButtonText").text($(element).attr("open_text")); + $(element).attr("orig_text", $(element).children(".g-button-text").text()); + $(element).children(".g-button-text").text($(element).attr("open_text")); } - $("#gPanel").addClass(parentClass).show().slideDown("slow"); + $("#g-panel").addClass(parentClass).show().slideDown("slow"); }); } @@ -48,11 +48,11 @@ _ajaxify_panel: function () { var self = this; - $("#gPanel td form").ajaxForm({ + $("#g-panel td form").ajaxForm({ dataType: "json", success: function(data) { if (data.form) { - $("#gPanel td form").replaceWith(data.form); + $("#g-panel td form").replaceWith(data.form); self._ajaxify_panel(); } if (data.result == "success") { diff --git a/lib/gallery.show_full_size.js b/lib/gallery.show_full_size.js index 360ecdc2..49dc620a 100644 --- a/lib/gallery.show_full_size.js +++ b/lib/gallery.show_full_size.js @@ -7,7 +7,7 @@ var height = $(document).height(); var size = $.gallery_get_viewport_size(); - $("body").append('
    ' + - '
    '); $().click(function() { - $("#gFullsizeOverlay*").remove(); - $("#gFullsize").remove(); + $("#g-fullsize-overlay*").remove(); + $("#g-fullsize").remove(); }); $().bind("keypress", function() { - $("#gFullsizeOverlay*").remove(); - $("#gFullsize").remove(); + $("#g-fullsize-overlay*").remove(); + $("#g-fullsize").remove(); }); $(window).resize(function() { - $("#gFullsizeOverlay").width($(document).width()).height($(document).height()); + $("#g-fullsize-overlay").width($(document).width()).height($(document).height()); image_size = $.gallery_auto_fit_window(image_width, image_height); - $("#gFullsize").height(image_size.height) + $("#g-fullsize").height(image_size.height) .width(image_size.width) .css("top", image_size.top) .css("left", image_size.left); - $("#gFullSizeImage").height(image_size.height).width(image_size.width); + $("#g-fullsize-image").height(image_size.height).width(image_size.width); }); }; })(jQuery); diff --git a/lib/images/ico-separator.gif b/lib/images/ico-separator.gif new file mode 100644 index 00000000..3de2d0d3 Binary files /dev/null and b/lib/images/ico-separator.gif differ diff --git a/modules/akismet/helpers/akismet.php b/modules/akismet/helpers/akismet.php index acd5cb3e..43549ffa 100644 --- a/modules/akismet/helpers/akismet.php +++ b/modules/akismet/helpers/akismet.php @@ -21,7 +21,7 @@ class akismet_Core { public static $test_mode = TEST_MODE; static function get_configure_form() { - $form = new Forge("admin/akismet", "", "post", array("id" => "gConfigureAkismetForm")); + $form = new Forge("admin/akismet", "", "post", array("id" => "g-configure-akismet-form")); $group = $form->group("configure_akismet")->label(t("Configure Akismet")); $group->input("api_key")->label(t("API Key"))->value(module::get_var("akismet", "api_key")); $group->api_key->error_messages("invalid", t("The API key you provided is invalid.")); diff --git a/modules/akismet/views/admin_akismet.html.php b/modules/akismet/views/admin_akismet.html.php index 009d8810..22c60c97 100644 --- a/modules/akismet/views/admin_akismet.html.php +++ b/modules/akismet/views/admin_akismet.html.php @@ -1,5 +1,5 @@ -
    +

    Wordpress.com API Key, which is also free. Your comments will be automatically relayed to Akismet.com where they'll be scanned for spam. Spam messages will be flagged accordingly and hidden from your vistors until you approve or delete them.", @@ -8,7 +8,7 @@

    -
    +
    diff --git a/modules/akismet/views/admin_akismet_stats.html.php b/modules/akismet/views/admin_akismet_stats.html.php index 41bad15b..32908ba0 100644 --- a/modules/akismet/views/admin_akismet_stats.html.php +++ b/modules/akismet/views/admin_akismet_stats.html.php @@ -1,11 +1,11 @@ -
    -
    diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php index f74a8644..7b2332a8 100644 --- a/modules/comment/helpers/comment.php +++ b/modules/comment/helpers/comment.php @@ -65,12 +65,12 @@ class comment_Core { } static function get_add_form($item) { - $form = new Forge("comments", "", "post", array("id" => "gAddCommentForm")); + $form = new Forge("comments", "", "post", array("id" => "g-comment-form")); $group = $form->group("add_comment")->label(t("Add comment")); - $group->input("name") ->label(t("Name")) ->id("gAuthor"); - $group->input("email") ->label(t("Email (hidden)")) ->id("gEmail"); - $group->input("url") ->label(t("Website (hidden)"))->id("gUrl"); - $group->textarea("text")->label(t("Comment")) ->id("gText"); + $group->input("name") ->label(t("Name")) ->id("g-author"); + $group->input("email") ->label(t("Email (hidden)")) ->id("g-email"); + $group->input("url") ->label(t("Website (hidden)"))->id("g-url"); + $group->textarea("text")->label(t("Comment")) ->id("g-text"); $group->hidden("item_id")->value($item->id); module::event("comment_add_form", $form); $group->submit("")->value(t("Add")); @@ -90,12 +90,12 @@ class comment_Core { static function get_edit_form($comment) { $form = new Forge("comments/{$comment->id}?_method=put", "", "post", - array("id" => "gEditCommentForm")); + array("id" => "g-edit-comment-form")); $group = $form->group("edit_comment")->label(t("Edit comment")); - $group->input("name") ->label(t("Author")) ->id("gAuthor"); - $group->input("email") ->label(t("Email (hidden)")) ->id("gEmail"); - $group->input("url") ->label(t("Website (hidden)"))->id("gUrl"); - $group->textarea("text")->label(t("Comment")) ->id("gText"); + $group->input("name") ->label(t("Author")) ->id("g-author"); + $group->input("email") ->label(t("Email (hidden)")) ->id("g-email"); + $group->input("url") ->label(t("Website (hidden)"))->id("g-url"); + $group->textarea("text")->label(t("Comment")) ->id("g-text"); $group->submit("")->value(t("Edit")); $group->text = $comment->text; diff --git a/modules/comment/helpers/comment_block.php b/modules/comment/helpers/comment_block.php index b989be6b..c00c6c51 100644 --- a/modules/comment/helpers/comment_block.php +++ b/modules/comment/helpers/comment_block.php @@ -26,7 +26,7 @@ class comment_block_Core { $block = new Block(); switch ($block_id) { case "recent_comments": - $block->css_id = "gRecentComments"; + $block->css_id = "g-recent-comments"; $block->title = t("Recent Comments"); $block->content = new View("admin_block_recent_comments.html"); $block->content->comments = diff --git a/modules/comment/helpers/comment_event.php b/modules/comment/helpers/comment_event.php index 0234aea9..2199eb7f 100644 --- a/modules/comment/helpers/comment_event.php +++ b/modules/comment/helpers/comment_event.php @@ -36,7 +36,7 @@ class comment_event_Core { ->id("comments") ->label(t("View comments on this item")) ->url("#comments") - ->css_id("gCommentsLink")); + ->css_id("g-comments-link")); } static function item_index_data($item, $data) { diff --git a/modules/comment/helpers/comment_theme.php b/modules/comment/helpers/comment_theme.php index e9b402f6..10c855db 100644 --- a/modules/comment/helpers/comment_theme.php +++ b/modules/comment/helpers/comment_theme.php @@ -25,7 +25,7 @@ class comment_theme_Core { static function photo_bottom($theme) { $block = new Block; - $block->css_id = "gComments"; + $block->css_id = "g-comments"; $block->title = t("Comments"); $block->anchor = "comments"; diff --git a/modules/comment/js/comment.js b/modules/comment/js/comment.js index 6e985626..96370fb1 100644 --- a/modules/comment/js/comment.js +++ b/modules/comment/js/comment.js @@ -1,43 +1,43 @@ $("document").ready(function() { - $("#gAddCommentButton").click(function(event) { + $("#g-admin-comment-button").click(function(event) { event.preventDefault(); - if (!$("#gAddCommentForm").length) { + if (!$("#g-comment-form").length) { $.get($(this).attr("href"), {}, function(data) { - $("#gCommentDetail").append(data); + $("#g-comment-detail").append(data); ajaxify_comment_form(); }); } }); - $("#gNoComments").click(function(event) { + $("#g-no-comments").click(function(event) { event.preventDefault(); - if (!$("#gAddCommentForm").length) { + if (!$("#g-comment-form").length) { $.get($(this).attr("href"), {}, function(data) { - $("#gCommentDetail").append(data); + $("#g-comment-detail").append(data); ajaxify_comment_form(); }); - $("#gNoCommentsYet").remove(); + $("#g-no-comments-yet").remove(); } }); }); function ajaxify_comment_form() { - $("#gComments form").ajaxForm({ + $("#g-comments form").ajaxForm({ dataType: "json", success: function(data) { if (data.form) { - $("#gComments form").replaceWith(data.form); + $("#g-comments form").replaceWith(data.form); ajaxify_comment_form(); } if (data.result == "success") { $.get(data.resource, function(data, textStatus) { - $("#gComments .gBlockContent ul:first").append("
  • "+data+"
  • "); - $("#gComments .gBlockContent ul:first li:last").effect("highlight", {color: "#cfc"}, 8000); - $("#gAddCommentForm").hide(2000).remove(); - $("#gNoCommentsYet").hide(2000); + $("#g-comments .g-block-content ul:first").append("
  • "+data+"
  • "); + $("#g-comments .g-block-content ul:first li:last").effect("highlight", {color: "#cfc"}, 8000); + $("#g-comment-form").hide(2000).remove(); + $("#g-no-comments-yet").hide(2000); }); } } diff --git a/modules/comment/views/admin_block_recent_comments.html.php b/modules/comment/views/admin_block_recent_comments.html.php index ca0d1c0b..7941e02d 100644 --- a/modules/comment/views/admin_block_recent_comments.html.php +++ b/modules/comment/views/admin_block_recent_comments.html.php @@ -1,9 +1,9 @@
      $comment): ?> -
    • "> +
    • "> " - class="gAvatar" + class="g-avatar" alt="author_name()) ?>" width="32" height="32" /> diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php index 82de378c..0e8dd525 100644 --- a/modules/comment/views/admin_comments.html.php +++ b/modules/comment/views/admin_comments.html.php @@ -6,7 +6,7 @@ $.get(set_state_url.replace("__STATE__", state).replace("__ID__", id), {}, function() { - $("#gComment-" + id).slideUp(); + $("#g-comment-" + id).slideUp(); update_menu(); }); } @@ -18,7 +18,7 @@ $.get(delete_url.replace("__ID__", id), {}, function() { - $("#gComment-" + id).slideUp(); + $("#g-comment-" + id).slideUp(); update_menu(); }); } @@ -27,18 +27,18 @@ $.get(, {}, function(data) { for (var i = 0; i < data.length; i++) { - $("#gAdminCommentsMenu li:eq(" + i + ") a").html(data[i]); + $("#g-admin-comments-menu li:eq(" + i + ") a").html(data[i]); } }, "json"); } -
      +

      -
      +
      @@ -90,7 +90,7 @@
      -
    display_name) ?> display_name) ?> + - <?= t('denied icon')->for_html_attr() ?> + " + title="for_html_attr() ?>" + alt="for_html_attr() ?>" /> - <?= t('locked icon')->for_html_attr() ?> + " alt="for_html_attr() ?>" /> - - <?= t('passive allowed icon')->for_html_attr() ?> + + " alt="for_html_attr() ?>" /> - <?= t('inactive denied icon')->for_html_attr() ?> + " alt="for_html_attr() ?>" /> - <?= t('inactive allowed icon')->for_html_attr() ?> + " alt="for_html_attr() ?>" /> - <?= t('passive denied icon')->for_html_attr() ?> + " alt="for_html_attr() ?>" /> - <?= t('inactive allowed icon')->for_html_attr() ?> + " alt="for_html_attr() ?>" /> id == 1): ?> - <?= t('denied icon')->for_html_attr() ?> + " alt="for_html_attr() ?>" title="for_html_attr() ?>"/> - <?= t('denied icon')->for_html_attr() ?> + " alt="for_html_attr() ?>" /> id == 1): ?> - for_html_attr() ?>" alt="for_html_attr() ?>" /> + " title="for_html_attr() ?>" alt="for_html_attr() ?>" /> - <?= t('allowed icon')->for_html_attr() ?> + " alt="for_html_attr() ?>" /> - <?= t('inactive denied icon')->for_html_attr() ?> + " alt="for_html_attr() ?>" /> callback?csrf=$csrf") ?>" - class="gDialogLink gButtonLink ui-icon-left ui-state-default ui-corner-all"> + class="gDialogLink g-button ui-icon-left ui-state-default ui-corner-all"> " - class="gButtonLink g-right ui-icon-left ui-state-default ui-corner-all"> + class="g-button g-right ui-icon-left ui-state-default ui-corner-all"> id?csrf=$csrf") ?>" - class="gButtonLink g-right ui-icon-left ui-state-default ui-corner-all"> + class="g-button g-right ui-icon-left ui-state-default ui-corner-all"> state == "stalled"): ?> - id?csrf=$csrf") ?>"> @@ -135,7 +135,7 @@ " - class="gButtonLink g-right ui-icon-left ui-state-default ui-corner-all"> + class="g-button g-right ui-icon-left ui-state-default ui-corner-all"> done): ?> - id?csrf=$csrf") ?>" class="gButtonLink ui-state-default ui-corner-all"> + id?csrf=$csrf") ?>" class="g-button ui-state-default ui-corner-all"> get_log()): ?> - id?csrf=$csrf") ?>" class="gDialogLink gButtonLink ui-state-default ui-corner-all"> + id?csrf=$csrf") ?>" class="gDialogLink g-button ui-state-default ui-corner-all"> - id?csrf=$csrf") ?>" class="gDialogLink gButtonLink" ui-state-default ui-corner-all> + id?csrf=$csrf") ?>" class="gDialogLink g-button" ui-state-default ui-corner-all> - id?csrf=$csrf") ?>" class="gButtonLink ui-state-default ui-corner-all"> + id?csrf=$csrf") ?>" class="g-button ui-state-default ui-corner-all"> diff --git a/modules/gallery/views/l10n_client.html.php b/modules/gallery/views/l10n_client.html.php index b0f424be..a7f001aa 100644 --- a/modules/gallery/views/l10n_client.html.php +++ b/modules/gallery/views/l10n_client.html.php @@ -68,7 +68,7 @@ for_html_attr() ?>"/> + class="g-button ui-state-default ui-corner-all"> diff --git a/modules/gallery/views/welcome_message.html.php b/modules/gallery/views/welcome_message.html.php index 5515c3dc..021e5772 100644 --- a/modules/gallery/views/welcome_message.html.php +++ b/modules/gallery/views/welcome_message.html.php @@ -18,7 +18,7 @@ id}") ?>" title="for_html_attr() ?>" id="gAfterInstallChangePasswordLink" - class="gButtonLink ui-state-default ui-corners-all"> + class="g-button ui-state-default ui-corners-all"> id") ?>" open_text="" - class="gPanelLink gButtonLink ui-state-default ui-corner-all ui-icon-left"> + class="gPanelLink g-button ui-state-default ui-corner-all ui-icon-left"> id != $user->id && !$user->guest): ?> id") ?>" - class="gDialogLink gButtonLink ui-state-default ui-corner-all ui-icon-left"> + class="gDialogLink g-button ui-state-default ui-corner-all ui-icon-left"> for_html_attr() ?>" - class="gButtonLink ui-state-disabled ui-corner-all ui-icon-left"> + class="g-button ui-state-disabled ui-corner-all ui-icon-left"> name) ?> module_name/" . html::clean($var->name)) ?>" - class="gDialogLink" + class="g-dialogLink" title=" $var->name, "module_name" => $var->module_name))->for_html_attr() ?>"> value): ?> value) ?> diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php index 8c3917b6..977ba75b 100644 --- a/modules/gallery/views/admin_maintenance.html.php +++ b/modules/gallery/views/admin_maintenance.html.php @@ -30,7 +30,7 @@ callback?csrf=$csrf") ?>" - class="gDialogLink g-button ui-icon-left ui-state-default ui-corner-all"> + class="g-dialogLink g-button ui-icon-left ui-state-default ui-corner-all">
    " diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 7d3cf362..5fd6a390 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -1,12 +1,12 @@ modules/akismet/views/admin_akismet.html.php 16 DIRTY $form modules/akismet/views/admin_akismet_stats.html.php 9 DIRTY_ATTR $api_key modules/akismet/views/admin_akismet_stats.html.php 9 DIRTY_ATTR urlencode($blog_url) -modules/comment/views/admin_block_recent_comments.html.php 4 DIRTY_ATTR ($i%2==0)?"gEvenRow":"gOddRow" +modules/comment/views/admin_block_recent_comments.html.php 4 DIRTY_ATTR ($i%2==0)?"g-even-row":"g-odd-row" modules/comment/views/admin_block_recent_comments.html.php 5 DIRTY_ATTR $comment->author()->avatar_url(32,$theme->url(,true)) modules/comment/views/admin_block_recent_comments.html.php 10 DIRTY gallery::date_time($comment->created) modules/comment/views/admin_comments.html.php 42 DIRTY $menu modules/comment/views/admin_comments.html.php 106 DIRTY_ATTR $comment->id -modules/comment/views/admin_comments.html.php 106 DIRTY_ATTR ($i%2==0)?"gOddRow":"gEvenRow" +modules/comment/views/admin_comments.html.php 106 DIRTY_ATTR ($i%2==0)?"g-odd-row":"g-even-row" modules/comment/views/admin_comments.html.php 109 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true)) modules/comment/views/admin_comments.html.php 122 DIRTY_JS $item->url() modules/comment/views/admin_comments.html.php 124 DIRTY_ATTR $item->thumb_url() @@ -72,18 +72,18 @@ modules/gallery/views/admin_languages.html.php 28 DIRTY form:: modules/gallery/views/admin_languages.html.php 29 DIRTY $display_name modules/gallery/views/admin_languages.html.php 31 DIRTY form::radio("default_locale",$code,($default_locale==$code),((isset($installed_locales[$code]))?'':'disabled="disabled"')) modules/gallery/views/admin_languages.html.php 102 DIRTY $share_translations_form -modules/gallery/views/admin_maintenance.html.php 24 DIRTY_ATTR ($i%2==0)?"gOddRow":"gEvenRow" +modules/gallery/views/admin_maintenance.html.php 24 DIRTY_ATTR ($i%2==0)?"g-odd-row":"g-even-row" modules/gallery/views/admin_maintenance.html.php 24 DIRTY_ATTR log::severity_class($task->severity) modules/gallery/views/admin_maintenance.html.php 25 DIRTY_ATTR log::severity_class($task->severity) modules/gallery/views/admin_maintenance.html.php 26 DIRTY $task->name modules/gallery/views/admin_maintenance.html.php 29 DIRTY $task->description -modules/gallery/views/admin_maintenance.html.php 72 DIRTY_ATTR ($i%2==0)?"gOddRow":"gEvenRow" +modules/gallery/views/admin_maintenance.html.php 72 DIRTY_ATTR ($i%2==0)?"g-odd-row":"g-even-row" modules/gallery/views/admin_maintenance.html.php 72 DIRTY_ATTR $task->state=="stalled"?"gWarning":"" modules/gallery/views/admin_maintenance.html.php 73 DIRTY_ATTR $task->state=="stalled"?"gWarning":"" modules/gallery/views/admin_maintenance.html.php 74 DIRTY gallery::date_time($task->updated) modules/gallery/views/admin_maintenance.html.php 77 DIRTY $task->name modules/gallery/views/admin_maintenance.html.php 92 DIRTY $task->status -modules/gallery/views/admin_maintenance.html.php 145 DIRTY_ATTR ($i%2==0)?"gOddRow":"gEvenRow" +modules/gallery/views/admin_maintenance.html.php 145 DIRTY_ATTR ($i%2==0)?"g-odd-row":"g-even-row" modules/gallery/views/admin_maintenance.html.php 145 DIRTY_ATTR $task->state=="success"?"gSuccess":"gError" modules/gallery/views/admin_maintenance.html.php 146 DIRTY_ATTR $task->state=="success"?"gSuccess":"gError" modules/gallery/views/admin_maintenance.html.php 147 DIRTY gallery::date_time($task->updated) @@ -93,7 +93,7 @@ modules/gallery/views/admin_maintenance_show_log.html.php 8 DIRTY_JS url::s modules/gallery/views/admin_maintenance_show_log.html.php 13 DIRTY $task->name modules/gallery/views/admin_maintenance_task.html.php 55 DIRTY $task->name modules/gallery/views/admin_modules.html.php 9 DIRTY access::csrf_form_field() -modules/gallery/views/admin_modules.html.php 19 DIRTY_ATTR ($i%2==0)?"gOddRow":"gEvenRow" +modules/gallery/views/admin_modules.html.php 19 DIRTY_ATTR ($i%2==0)?"g-odd-row":"g-even-row" modules/gallery/views/admin_modules.html.php 22 DIRTY form::checkbox($data,'1',module::is_active($module_name)) modules/gallery/views/admin_modules.html.php 24 DIRTY $module_info->version modules/gallery/views/admin_theme_options.html.php 5 DIRTY $form @@ -267,7 +267,7 @@ modules/user/views/admin_users.html.php 3 DIRTY_JS url::s modules/user/views/admin_users.html.php 26 DIRTY_JS url::site("admin/users/group/__GROUPID__") modules/user/views/admin_users.html.php 36 DIRTY_JS url::site("admin/users/remove_user_from_group/__USERID__/__GROUPID__?csrf=$csrf") modules/user/views/admin_users.html.php 67 DIRTY_ATTR $user->id -modules/user/views/admin_users.html.php 67 DIRTY_ATTR text::alternate("gOddRow","gEvenRow") +modules/user/views/admin_users.html.php 67 DIRTY_ATTR text::alternate("g-odd-row","g-even-row") modules/user/views/admin_users.html.php 67 DIRTY_ATTR $user->admin?"admin":"" modules/user/views/admin_users.html.php 68 DIRTY_ATTR $user->id modules/user/views/admin_users.html.php 69 DIRTY_ATTR $user->avatar_url(20,$theme->url(,true)) diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php index 977ba75b..4c79c25b 100644 --- a/modules/gallery/views/admin_maintenance.html.php +++ b/modules/gallery/views/admin_maintenance.html.php @@ -21,7 +21,7 @@
    name ?>
    "> updated) ?>
    "> updated) ?>
    " title="for_html_attr() ?>" diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css index 28115149..61161967 100644 --- a/themes/admin_wind/css/screen.css +++ b/themes/admin_wind/css/screen.css @@ -281,14 +281,6 @@ li.gError select { opacity: 0.4; } -.gOddRow { - background-color: #eee; -} - -.gEvenRow { - background-color: #fff; -} - /* Status messages ~~~~~~~~~~~~~~~~~~~~~~~ */ #gMessage { -- cgit v1.2.3 From 3e6ba7acc3291f2268cbe9c9bef0a492b557babb Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sun, 4 Oct 2009 00:27:22 -0600 Subject: Renamed most, if not all css selectors from gName to g-name. Moved a few shared images from wind to lib. Deleted unused images in the admin_wind. This will likely break a few ajax features. --- lib/gallery.common.css | 57 ++- lib/gallery.common.js | 24 +- lib/gallery.dialog.js | 4 +- lib/gallery.panel.js | 24 +- lib/gallery.show_full_size.js | 20 +- lib/images/ico-separator.gif | Bin 0 -> 106 bytes modules/akismet/helpers/akismet.php | 2 +- modules/akismet/views/admin_akismet.html.php | 4 +- modules/akismet/views/admin_akismet_stats.html.php | 6 +- modules/comment/helpers/comment.php | 20 +- modules/comment/helpers/comment_block.php | 2 +- modules/comment/helpers/comment_event.php | 2 +- modules/comment/helpers/comment_theme.php | 2 +- modules/comment/js/comment.js | 26 +- .../views/admin_block_recent_comments.html.php | 4 +- modules/comment/views/admin_comments.html.php | 20 +- modules/comment/views/comment.html.php | 6 +- modules/comment/views/comments.html.php | 14 +- modules/digibug/helpers/digibug_event.php | 7 +- modules/digibug/js/digibug.js | 7 +- modules/digibug/views/admin_digibug.html.php | 8 +- modules/exif/helpers/exif.php | 2 +- modules/exif/views/exif_dialog.html.php | 22 +- modules/exif/views/exif_sidebar.html.php | 5 +- modules/g2_import/controllers/admin_g2_import.php | 2 +- modules/g2_import/helpers/g2_import.php | 6 +- modules/g2_import/views/admin_g2_import.html.php | 18 +- modules/gallery/controllers/admin_dashboard.php | 2 +- modules/gallery/controllers/admin_languages.php | 2 +- modules/gallery/controllers/l10n_client.php | 4 +- modules/gallery/css/debug.css | 8 +- modules/gallery/css/l10n_client.css | 28 +- modules/gallery/helpers/album.php | 10 +- modules/gallery/helpers/gallery_block.php | 16 +- modules/gallery/helpers/gallery_event.php | 2 +- modules/gallery/helpers/graphics.php | 2 +- modules/gallery/helpers/item.php | 2 +- modules/gallery/helpers/log.php | 8 +- modules/gallery/helpers/message.php | 10 +- modules/gallery/helpers/movie.php | 2 +- modules/gallery/helpers/photo.php | 4 +- modules/gallery/helpers/site_status.php | 10 +- modules/gallery/helpers/theme.php | 14 +- modules/gallery/js/albums_form_add.js | 20 +- modules/gallery/js/l10n_client.js | 44 +- modules/gallery/libraries/Admin_View.php | 2 +- modules/gallery/libraries/Menu.php | 8 +- modules/gallery/libraries/Theme_View.php | 6 +- modules/gallery/models/item.php | 2 +- modules/gallery/tests/DrawForm_Test.php | 12 +- modules/gallery/tests/selenium/Add_Comment.html | 8 +- modules/gallery/tests/selenium/Login.html | 8 +- modules/gallery/tests/xss_data.txt | 62 +-- .../gallery/views/admin_advanced_settings.html.php | 8 +- .../views/admin_block_photo_stream.html.php | 2 +- modules/gallery/views/admin_dashboard.html.php | 22 +- modules/gallery/views/admin_graphics.html.php | 10 +- modules/gallery/views/admin_graphics_gd.html.php | 8 +- .../views/admin_graphics_graphicsmagick.html.php | 6 +- .../views/admin_graphics_imagemagick.html.php | 6 +- modules/gallery/views/admin_graphics_none.html.php | 2 +- modules/gallery/views/admin_languages.html.php | 12 +- modules/gallery/views/admin_maintenance.html.php | 26 +- .../views/admin_maintenance_show_log.html.php | 8 +- .../gallery/views/admin_maintenance_task.html.php | 24 +- modules/gallery/views/admin_modules.html.php | 4 +- modules/gallery/views/admin_sidebar.html.php | 24 +- .../gallery/views/admin_sidebar_blocks.html.php | 2 +- modules/gallery/views/admin_theme_options.html.php | 2 +- modules/gallery/views/admin_themes.html.php | 20 +- modules/gallery/views/form.html.php | 4 +- modules/gallery/views/l10n_client.html.php | 6 +- modules/gallery/views/move_browse.html.php | 14 +- modules/gallery/views/permissions_browse.html.php | 14 +- modules/gallery/views/permissions_form.html.php | 10 +- modules/gallery/views/simple_uploader.html.php | 28 +- modules/gallery/views/welcome_message.html.php | 6 +- .../gallery/views/welcome_message_loader.html.php | 4 +- modules/image_block/helpers/image_block_block.php | 2 +- .../image_block/views/image_block_block.html.php | 4 +- modules/info/helpers/info_block.php | 2 +- modules/info/views/info_block.html.php | 2 +- .../notification/helpers/notification_event.php | 2 +- modules/organize/css/organize.css | 50 +-- modules/organize/helpers/organize_event.php | 4 +- modules/organize/js/organize.js | 84 ++-- modules/organize/views/organize_dialog.html.php | 28 +- .../organize/views/organize_thumb_grid.html.php | 10 +- modules/organize/views/organize_tree.html.php | 8 +- modules/recaptcha/helpers/recaptcha.php | 2 +- modules/recaptcha/helpers/recaptcha_event.php | 2 +- modules/recaptcha/views/admin_recaptcha.html.php | 8 +- modules/recaptcha/views/form_recaptcha.html.php | 4 +- modules/rss/helpers/rss_block.php | 2 +- modules/rss/views/rss_block.html.php | 2 +- modules/search/helpers/search.php | 2 +- modules/search/helpers/search_installer.php | 2 +- modules/search/views/search.html.php | 12 +- modules/search/views/search_link.html.php | 6 +- .../server_add/controllers/admin_server_add.php | 2 +- modules/server_add/js/admin.js | 2 +- modules/server_add/js/server_add.js | 58 +-- modules/server_add/views/admin_server_add.html.php | 10 +- modules/server_add/views/server_add_tree.html.php | 6 +- .../views/server_add_tree_dialog.html.php | 26 +- modules/slideshow/helpers/slideshow_event.php | 6 +- modules/tag/helpers/tag.php | 6 +- modules/tag/helpers/tag_block.php | 2 +- modules/tag/js/tag.js | 38 +- modules/tag/views/admin_tags.html.php | 14 +- modules/tag/views/tag_block.html.php | 10 +- modules/user/controllers/password.php | 10 +- modules/user/helpers/group.php | 10 +- modules/user/helpers/user.php | 52 +-- modules/user/helpers/user_block.php | 2 +- modules/user/views/admin_users.html.php | 36 +- modules/user/views/admin_users_group.html.php | 6 +- modules/user/views/login.html.php | 8 +- modules/user/views/user_languages_block.html.php | 4 +- modules/watermark/helpers/watermark.php | 6 +- modules/watermark/views/admin_watermarks.html.php | 8 +- themes/admin_wind/css/fix-ie.css | 12 +- themes/admin_wind/css/screen.css | 453 ++++++++++----------- themes/admin_wind/images/avatar.jpg | Bin 914 -> 0 bytes themes/admin_wind/images/ico-album.png | Bin 397 -> 0 bytes themes/admin_wind/images/ico-print.png | Bin 989 -> 0 bytes themes/admin_wind/images/ico-separator.gif | Bin 106 -> 0 bytes themes/admin_wind/images/ico-view-comments.png | Bin 768 -> 0 bytes themes/admin_wind/images/ico-view-fullsize.png | Bin 1046 -> 0 bytes themes/admin_wind/images/ico-view-hybrid.png | Bin 494 -> 0 bytes themes/admin_wind/images/ico-view-slideshow.png | Bin 960 -> 0 bytes themes/admin_wind/js/ui.init.js | 38 +- themes/admin_wind/views/admin.html.php | 20 +- themes/admin_wind/views/block.html.php | 6 +- themes/admin_wind/views/pager.html.php | 4 +- themes/wind/css/fix-ie.css | 18 +- themes/wind/css/screen.css | 432 +++++++++----------- themes/wind/images/ico-separator.gif | Bin 106 -> 0 bytes themes/wind/images/ico-view-hybrid.png | Bin 494 -> 0 bytes themes/wind/js/ui.init.js | 72 ++-- themes/wind/views/album.html.php | 20 +- themes/wind/views/block.html.php | 4 +- themes/wind/views/dynamic.html.php | 12 +- themes/wind/views/movie.html.php | 12 +- themes/wind/views/no_sidebar.html.php | 2 +- themes/wind/views/page.html.php | 22 +- themes/wind/views/pager.html.php | 4 +- themes/wind/views/photo.html.php | 18 +- themes/wind/views/sidebar.html.php | 4 +- 149 files changed, 1278 insertions(+), 1317 deletions(-) create mode 100644 lib/images/ico-separator.gif delete mode 100644 themes/admin_wind/images/avatar.jpg delete mode 100644 themes/admin_wind/images/ico-album.png delete mode 100644 themes/admin_wind/images/ico-print.png delete mode 100644 themes/admin_wind/images/ico-separator.gif delete mode 100644 themes/admin_wind/images/ico-view-comments.png delete mode 100644 themes/admin_wind/images/ico-view-fullsize.png delete mode 100644 themes/admin_wind/images/ico-view-hybrid.png delete mode 100644 themes/admin_wind/images/ico-view-slideshow.png delete mode 100644 themes/wind/images/ico-separator.gif delete mode 100644 themes/wind/images/ico-view-hybrid.png (limited to 'modules/gallery') diff --git a/lib/gallery.common.css b/lib/gallery.common.css index 5768e1cf..c422fe6e 100644 --- a/lib/gallery.common.css +++ b/lib/gallery.common.css @@ -133,11 +133,11 @@ form .g-error { .g-last { } -.g-even-row { +.g-even { background-color: #fff; } -.g-odd-row { +.g-odd { background-color: #eee; } @@ -211,7 +211,60 @@ form .g-error { margin-bottom: .4em; } +/* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +.g-breadcrumbs { + padding: 0 20px; +} + +.g-breadcrumbs li { + background: transparent url('images/ico-separator.gif') no-repeat scroll left center; + float: left; + padding: 10px 6px 10px 16px !important; +} + +.g-breadcrumbs li.root { + background: transparent; +} + +.g-breadcrumbs li a, +.g-breadcrumbs li span { + display: block; +} + +.g-breadcrumbs li.active, +.g-breadcrumbs li.active span { + font-weight: bold; +} + +#g-dialog ul.g-breadcrumbs { + clear: both; + margin-left: 0; + padding-left: 0; +} + +#g-dialog .g-breadcrumbs li { + font-size: .9em; +} + +/* Pagination ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + .g-pager { + clear: both; + margin: 0; + padding: 5px 0 !important; + width: 100%; +} + +.g-pager li { + float: left; + margin: 0; + width: 30%; +} + +.g-pager .g-info { + text-align: center; + width: 40%; } .g-list-horizontal { diff --git a/lib/gallery.common.js b/lib/gallery.common.js index 59482b22..f2de74ad 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -24,8 +24,8 @@ if (container == null) { container = 'div'; } - $(this).html("<" + container + " class=\"gValign\">" + $(this).html() + ""); - var el = $(this).children(container + ".gValign"); + $(this).html("<" + container + " class=\"g-valign\">" + $(this).html() + ""); + var el = $(this).children(container + ".g-valign"); var elh = $(el).height(); var ph = $(this).height(); var nh = (ph - elh) / 2; @@ -47,21 +47,21 @@ /** * Toggle the processing indicator, both large and small - * @param elementID Target ID, including #, to apply .gLoadingSize + * @param elementID Target ID, including #, to apply .g-loading-size */ $.fn.gallery_show_loading = function() { return this.each(function(i){ var size; switch ($(this).attr("id")) { case "#g-dialog": - case "#gPanel": - size = "Large"; + case "#g-panel": + size = "large"; break; default: - size = "Small"; + size = "small"; break; } - $(this).toggleClass("gLoading" + size); + $(this).toggleClass("g-loading" + size); }); }; @@ -89,7 +89,7 @@ */ $.fn.gallery_get_photo = function() { var photo = $(this).find("img").filter(function() { - return this.id.match(/gPhotoId-\d+/); + return this.id.match(/g-photoId-\d+/); }); return photo; }; @@ -124,8 +124,8 @@ }; $.fn.gallery_context_menu = function() { - if ($(".gContextMenu li").length) { - var hover_target = ".gContextMenu"; + if ($(".g-context-menu li").length) { + var hover_target = ".g-context-menu"; var in_progress = 0; $(hover_target + " *").removeAttr('title'); $(hover_target + " ul").hide(); @@ -133,8 +133,8 @@ function() { if (in_progress == 0) { $(this).find("ul").slideDown("fast", function() { in_progress = 1; }); - $(this).find(".g-dialogLink").gallery_dialog(); - $(this).find(".gAjaxLink").gallery_ajax(); + $(this).find(".g-dialog-link").gallery_dialog(); + $(this).find(".g-ajax-link").gallery_ajax(); } }, function() { diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index a70200f9..c162ab2a 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -36,7 +36,7 @@ $("#g-dialog").dialog("open"); // Remove titlebar for progress dialogs or set title - if ($("#g-dialog #gProgress").length) { + 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()); @@ -61,7 +61,7 @@ dialogWidth = size.width() - 100; // Set the iframe width and height $("#g-dialog iframe").width("100%").height(size.height() - 100); - } else if ($("#g-dialog .g-dialogPanel").length) { + } 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) { diff --git a/lib/gallery.panel.js b/lib/gallery.panel.js index 6115297d..8530dd9f 100644 --- a/lib/gallery.panel.js +++ b/lib/gallery.panel.js @@ -8,7 +8,7 @@ var parent = $(element).parent().parent(); var sHref = $(element).attr("href"); var parentClass = $(parent).attr("class"); - var ePanel = "
    +
    $comment): ?> - "> + "> - $description): ?> - "> + "> "provider"); ?> -
    @@ -103,11 +103,11 @@
    " - class="gAvatar" + class="g-avatar" alt="author_name()) ?>" width="40" height="40" /> @@ -118,7 +118,7 @@ -
      +
        state != "unpublished"): ?>
      • -
      • -

        +

      • +

        " - class="gAvatar" + class="g-avatar" alt="author_name()) ?>" width="40" height="40" /> diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php index ee4a8ad6..636f1522 100644 --- a/modules/comment/views/comments.html.php +++ b/modules/comment/views/comments.html.php @@ -1,23 +1,23 @@ - id})") ?>" id="gAddCommentButton" + id})") ?>" id="g-admin-comment-button" class="g-button ui-corner-all ui-icon-left ui-state-default right"> -

        +
        count()): ?> -

        +

        comment!", - array("attrs" => html::mark_clean("id= \"gNoComments\" href=\"" . url::site("form/add/comments/{$item->id}") . "\" class=\"showCommentForm\""))) ?> + array("attrs" => html::mark_clean("id= \"g-no-comments\" href=\"" . url::site("form/add/comments/{$item->id}") . "\" class=\"showCommentForm\""))) ?>

          -
        • -

          +

        • +

          " - class="gAvatar" + class="g-avatar" alt="author_name()) ?>" width="40" height="40" /> diff --git a/modules/digibug/helpers/digibug_event.php b/modules/digibug/helpers/digibug_event.php index d2830b80..37fa57e5 100644 --- a/modules/digibug/helpers/digibug_event.php +++ b/modules/digibug/helpers/digibug_event.php @@ -32,8 +32,8 @@ class digibug_event_Core { ->id("digibug") ->label(t("Print with Digibug")) ->url(url::site("digibug/print_photo/$item->id?csrf=$theme->csrf")) - ->css_id("gDigibugLink") - ->css_class("ui-icon-print")); + ->css_id("g-print-digibug-link") + ->css_class("g-print-digibug-link ui-icon-print")); } static function context_menu($menu, $theme, $item) { @@ -43,8 +43,7 @@ class digibug_event_Core { ->id("digibug") ->label(t("Print with Digibug")) ->url(url::site("digibug/print_photo/$item->id?csrf=$theme->csrf")) - ->css_id("gDigibugLink") - ->css_class("ui-icon-print")); + ->css_class("g-print-digibug-link ui-icon-print")); } } } diff --git a/modules/digibug/js/digibug.js b/modules/digibug/js/digibug.js index 30bff47d..46ddac52 100644 --- a/modules/digibug/js/digibug.js +++ b/modules/digibug/js/digibug.js @@ -1,10 +1,5 @@ $(document).ready(function() { - $(".gDigibugPrintButton a").click(function(e) { - e.preventDefault(); - return digibug_popup(e.currentTarget.href, { width: 800, height: 600 } ); - }); - - $("#gDigibugLink").click(function(e) { + $(".g-print-digibug-link").click(function(e) { e.preventDefault(); return digibug_popup(e.currentTarget.href, { width: 800, height: 600 } ); }); diff --git a/modules/digibug/views/admin_digibug.html.php b/modules/digibug/views/admin_digibug.html.php index cb952a8a..f75adc60 100644 --- a/modules/digibug/views/admin_digibug.html.php +++ b/modules/digibug/views/admin_digibug.html.php @@ -1,14 +1,14 @@ -

          -
          - "> +
          +
          + ">

            -
          • +
          diff --git a/modules/exif/helpers/exif.php b/modules/exif/helpers/exif.php index 453690ea..5ddd09d4 100644 --- a/modules/exif/helpers/exif.php +++ b/modules/exif/helpers/exif.php @@ -163,7 +163,7 @@ class exif_Core { list ($remaining) = exif::stats(); if ($remaining) { site_status::warning( - t('Your Exif index needs to be updated.
          Fix this now', + t('Your Exif index needs to be updated. Fix this now', array("url" => html::mark_clean(url::site("admin/maintenance/start/exif_task::update_index?csrf=__CSRF__")))), "exif_index_out_of_date"); } diff --git a/modules/exif/views/exif_dialog.html.php b/modules/exif/views/exif_dialog.html.php index 11d1e212..b50eea1d 100644 --- a/modules/exif/views/exif_dialog.html.php +++ b/modules/exif/views/exif_dialog.html.php @@ -1,30 +1,30 @@ -

          -
          - +
          +
          - - - - - + diff --git a/modules/exif/views/exif_sidebar.html.php b/modules/exif/views/exif_sidebar.html.php index 3c7bb517..04f72b02 100644 --- a/modules/exif/views/exif_sidebar.html.php +++ b/modules/exif/views/exif_sidebar.html.php @@ -1,7 +1,6 @@ -id}") ?>" title="for_html_attr() ?>" - class="g-dialogLink g-button ui-icon-left ui-state-default ui-corner-all"> +id}") ?>" title="for_html_attr() ?>" + class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all"> - diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php index 18d09363..1c65f482 100644 --- a/modules/g2_import/controllers/admin_g2_import.php +++ b/modules/g2_import/controllers/admin_g2_import.php @@ -68,7 +68,7 @@ class Admin_g2_import_Controller extends Admin_Controller { private function _get_import_form() { $form = new Forge( - "admin/g2_import/save", "", "post", array("id" => "gAdminConfigureG2ImportForm")); + "admin/g2_import/save", "", "post", array("id" => "g-admin-configure-g2-import-form")); $group = $form->group("configure_g2_import")->label(t("Configure Gallery 2 Import")); $group->input("embed_path")->label(t("Filesystem path to your Gallery 2 embed.php file")) ->value(module::get_var("g2_import", "embed_path", "")); diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 7e5c6f75..99d56d5d 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -201,7 +201,7 @@ class g2_import_Core { if (g2_import::g2_module_active("tags") && module::is_active("tag")) { $result = - g2($gallery->search("SELECT COUNT(DISTINCT([TagItemMap::itemId])) FROM [TagItemMap]")) + g2($gallery->search("SELECT COUNT(DISTINCT([Tag-itemMap::itemId])) FROM [Tag-itemMap]")) ->nextResult(); $stats["tags"] = $result[0]; } else { @@ -853,8 +853,8 @@ class g2_import_Core { $ids = array(); $results = g2($gallery->search( - "SELECT DISTINCT([TagItemMap::itemId]) FROM [TagItemMap] " . - "WHERE [TagItemMap::itemId] > ?", + "SELECT DISTINCT([Tag-itemMap::itemId]) FROM [Tag-itemMap] " . + "WHERE [Tag-itemMap::itemId] > ?", array($min_id), array("limit" => array("count" => 100)))); while ($result = $results->nextResult()) { diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php index 314f030b..51a1e245 100644 --- a/modules/g2_import/views/admin_g2_import.html.php +++ b/modules/g2_import/views/admin_g2_import.html.php @@ -1,11 +1,11 @@ -
          +

          -
          +

          @@ -28,14 +28,14 @@ -

          +

          -
            -
          • +
              +
            • g2_import::version())) ?>
            • -
            • +
            • Using the same value will speed up your import.", array("g2_pixels" => $g2_sizes["thumb"]["size"], "g3_pixels" => $thumb_size, @@ -44,7 +44,7 @@ -
            • +
            • Using the same value will speed up your import.", array("g2_pixels" => $g2_sizes["resize"]["size"], "g3_pixels" => $resize_size, @@ -53,7 +53,7 @@
            -
            +

            @@ -84,7 +84,7 @@

            - "> diff --git a/modules/gallery/controllers/admin_dashboard.php b/modules/gallery/controllers/admin_dashboard.php index 6bf3b966..7e28f625 100644 --- a/modules/gallery/controllers/admin_dashboard.php +++ b/modules/gallery/controllers/admin_dashboard.php @@ -22,7 +22,7 @@ class Admin_Dashboard_Controller extends Admin_Controller { $view = new Admin_View("admin.html"); $view->content = new View("admin_dashboard.html"); $view->content->blocks = block_manager::get_html("dashboard_center"); - $view->sidebar = "

            " . + $view->sidebar = "
            " . block_manager::get_html("dashboard_sidebar") . "
            "; print $view; diff --git a/modules/gallery/controllers/admin_languages.php b/modules/gallery/controllers/admin_languages.php index a9693d21..8af1dd85 100644 --- a/modules/gallery/controllers/admin_languages.php +++ b/modules/gallery/controllers/admin_languages.php @@ -105,7 +105,7 @@ class Admin_Languages_Controller extends Admin_Controller { } private function _share_translations_form() { - $form = new Forge("admin/languages/share", "", "post", array("id" => "gShareTranslationsForm")); + $form = new Forge("admin/languages/share", "", "post", array("id" => "g-share-translations-form")); $group = $form->group("sharing") ->label(t("Sharing your own translations with the Gallery community is easy. Please do!")); $api_key = l10n_client::api_key(); diff --git a/modules/gallery/controllers/l10n_client.php b/modules/gallery/controllers/l10n_client.php index 6e19310b..6fdbb3a1 100644 --- a/modules/gallery/controllers/l10n_client.php +++ b/modules/gallery/controllers/l10n_client.php @@ -102,9 +102,9 @@ class L10n_Client_Controller extends Controller { } private static function _l10n_client_search_form() { - $form = new Forge("l10n_client/search", "", "post", array("id" => "gL10nSearchForm")); + $form = new Forge("l10n_client/search", "", "post", array("id" => "g-l10n-search-form")); $group = $form->group("l10n_search"); - $group->input("l10n-search")->id("gL10nSearch"); + $group->input("l10n-search")->id("g-l10n-search"); $group->submit("l10n-search-filter-clear")->value(t("X")); return $form; diff --git a/modules/gallery/css/debug.css b/modules/gallery/css/debug.css index fe5665ad..6808da09 100644 --- a/modules/gallery/css/debug.css +++ b/modules/gallery/css/debug.css @@ -1,4 +1,4 @@ -.gAnnotatedThemeBlock { +.g-annotated-theme-block { border: 1px solid #C00; clear: both; margin: 1em; @@ -6,15 +6,15 @@ position: relative; } -.gAnnotatedThemeBlock_album_top { +.g-annotated-theme-block_album_top { float: right; } -.gAnnotatedThemeBlock_header_bottom { +.g-annotated-theme-block_header_bottom { float: right; } -.gAnnotatedThemeBlock div.title { +.g-annotated-theme-block div.title { background: #C00; border: 1px solid black; color: white; diff --git a/modules/gallery/css/l10n_client.css b/modules/gallery/css/l10n_client.css index 9c1b12d0..542da8e6 100644 --- a/modules/gallery/css/l10n_client.css +++ b/modules/gallery/css/l10n_client.css @@ -1,6 +1,8 @@ -// TODO(andy_st): Add original copyright notice from Drupal l10_client. -// TODO(andy_st): Add G3 copyright notice. -// TODO(andy_st): clean up formatting to match our other CSS files. +/** + * TODO(andy_st): Add original copyright notice from Drupal l10_client. + * TODO(andy_st): Add G3 copyright notice. + * TODO(andy_st): clean up formatting to match our other CSS files. + */ /* $Id: l10n_client.css,v 1.6 2008/09/09 10:48:20 goba Exp $ */ @@ -50,7 +52,7 @@ font-size: 1em; padding: .5em; } -#l10n-client-toggler #gMinimizeL10n { +#l10n-client-toggler #g-minimize-l10n { border-right: 1px solid #ffffff; } @@ -126,31 +128,31 @@ #l10n-client .string-list li.active { font-weight:bold;} -#l10n-client #gL10nSearchForm { +#l10n-client #g-l10n-search-form { background:#eee; text-align:center; height:2em; line-height:2em; margin:0em; padding:.5em .5em; } -#l10n-client #gL10nSearchForm .form-item, -#l10n-client #gL10nSearchForm input.form-text, -#l10n-client #gL10nSearchForm #search-filter-go, -#l10n-client #gL10nSearchForm #search-filter-clear { +#l10n-client #g-l10n-search-form .form-item, +#l10n-client #g-l10n-search-form input.form-text, +#l10n-client #g-l10n-search-form #search-filter-go, +#l10n-client #g-l10n-search-form #search-filter-clear { display:inline; vertical-align:middle; } -#l10n-client #gL10nSearchForm .form-item { +#l10n-client #g-l10n-search-form .form-item { margin:0em; padding:0em; } -#l10n-client #gL10nSearchForm input.form-text { +#l10n-client #g-l10n-search-form input.form-text { width:80%; } -#l10n-client #gL10nSearchForm #search-filter-clear { +#l10n-client #g-l10n-search-form #search-filter-clear { width:10%; margin:0em; } @@ -178,7 +180,7 @@ overflow:hidden; width:49%; float:right;} -#gL10nClientSaveForm { +#g-l10n-client-save-form { padding:0em;} #l10n-client form ul, diff --git a/modules/gallery/helpers/album.php b/modules/gallery/helpers/album.php index 65868cf2..72a79a75 100644 --- a/modules/gallery/helpers/album.php +++ b/modules/gallery/helpers/album.php @@ -92,7 +92,7 @@ class album_Core { } static function get_add_form($parent) { - $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gAddAlbumForm")); + $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "g-add-album-form")); $group = $form->group("add_album") ->label(t("Add an album to %album_title", array("album_title" => $parent->title))); $group->input("title")->label(t("Title")); @@ -114,7 +114,7 @@ class album_Core { } static function get_edit_form($parent) { - $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gEditAlbumForm")); + $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "g-edit-album-form")); $form->hidden("_method")->value("put"); $group = $form->group("edit_item")->label(t("Edit Album")); @@ -141,14 +141,14 @@ class album_Core { $group->hidden("slug")->value($parent->slug); } - $sort_order = $group->group("sort_order", array("id" => "gAlbumSortOrder")) + $sort_order = $group->group("sort_order", array("id" => "g-album-sort-order")) ->label(t("Sort Order")); - $sort_order->dropdown("column", array("id" => "gAlbumSortColumn")) + $sort_order->dropdown("column", array("id" => "g-album-sort-column")) ->label(t("Sort by")) ->options(album::get_sort_order_options()) ->selected($parent->sort_column); - $sort_order->dropdown("direction", array("id" => "gAlbumSortDirection")) + $sort_order->dropdown("direction", array("id" => "g-album-sort-direction")) ->label(t("Order")) ->options(array("ASC" => t("Ascending"), "DESC" => t("Descending"))) diff --git a/modules/gallery/helpers/gallery_block.php b/modules/gallery/helpers/gallery_block.php index f2cb8ded..5d49a9de 100644 --- a/modules/gallery/helpers/gallery_block.php +++ b/modules/gallery/helpers/gallery_block.php @@ -32,13 +32,13 @@ class gallery_block_Core { $block = new Block(); switch($block_id) { case "welcome": - $block->css_id = "gWelcome"; + $block->css_id = "g-welcome"; $block->title = t("Welcome to Gallery 3"); $block->content = new View("admin_block_welcome.html"); break; case "photo_stream": - $block->css_id = "gPhotoStream"; + $block->css_id = "g-photo-stream"; $block->title = t("Photo Stream"); $block->content = new View("admin_block_photo_stream.html"); $block->content->photos = @@ -46,7 +46,7 @@ class gallery_block_Core { break; case "log_entries": - $block->css_id = "gLogEntries"; + $block->css_id = "g-log-entries"; $block->title = t("Log Entries"); $block->content = new View("admin_block_log_entries.html"); $block->content->entries = ORM::factory("log") @@ -54,7 +54,7 @@ class gallery_block_Core { break; case "stats": - $block->css_id = "gStats"; + $block->css_id = "g-stats"; $block->title = t("Gallery Stats"); $block->content = new View("admin_block_stats.html"); $block->content->album_count = @@ -63,7 +63,7 @@ class gallery_block_Core { break; case "platform_info": - $block->css_id = "gPlatform"; + $block->css_id = "g-platform"; $block->title = t("Platform Information"); $block->content = new View("admin_block_platform.html"); if (is_readable("/proc/loadavg")) { @@ -75,14 +75,14 @@ class gallery_block_Core { break; case "project_news": - $block->css_id = "gProjectNews"; + $block->css_id = "g-project-news"; $block->title = t("Gallery Project News"); $block->content = new View("admin_block_news.html"); $block->content->feed = feed::parse("http://gallery.menalto.com/node/feed", 3); break; case "block_adder": - $block->css_id = "gBlockAdder"; + $block->css_id = "g-block-adder"; $block->title = t("Dashboard Content"); $block->content = self::get_add_block_form(); } @@ -92,7 +92,7 @@ class gallery_block_Core { static function get_add_block_form() { $form = new Forge("admin/dashboard/add_block", "", "post", - array("id" => "gAddDashboardBlockForm")); + array("id" => "g-add-dashboard-block-form")); $group = $form->group("add_block")->label(t("Add Block")); $group->dropdown("id")->label(t("Available Blocks")) ->options(block_manager::get_available_admin_blocks()); diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index c01f4135..290d7d12 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -281,7 +281,7 @@ class gallery_event_Core { ->id("delete") ->label($delete_title) ->css_class("ui-icon-trash") - ->css_id("gQuickDelete") + ->css_id("g-quick-delete") ->url(url::site("quick/form_delete/$item->id?csrf=$csrf&page_type=$page_type"))); } diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index f9b88638..ecddd86b 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -249,7 +249,7 @@ class graphics_Core { "%count of your photos are out of date. Click here to fix them", $count, array("attrs" => html::mark_clean(sprintf( - 'href="%s" class="g-dialogLink"', + 'href="%s" class="g-dialog-link"', url::site("admin/maintenance/start/gallery_task::rebuild_dirty_images?csrf=__CSRF__"))))), "graphics_dirty"); } diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php index 588c08d4..084bbc15 100644 --- a/modules/gallery/helpers/item.php +++ b/modules/gallery/helpers/item.php @@ -130,7 +130,7 @@ class item_Core { $page_type = "photo"; } $form = new Forge( - "quick/delete/$item->id?page_type=$page_type", "", "post", array("id" => "gConfirmDelete")); + "quick/delete/$item->id?page_type=$page_type", "", "post", array("id" => "g-confirm-delete")); $form->hidden("_method")->value("put"); $group = $form->group("confirm_delete")->label(t("Confirm Deletion")); $group->submit("")->value(t("Delete")); diff --git a/modules/gallery/helpers/log.php b/modules/gallery/helpers/log.php index 451f985a..c8e94b45 100644 --- a/modules/gallery/helpers/log.php +++ b/modules/gallery/helpers/log.php @@ -93,16 +93,16 @@ class log_Core { static function severity_class($severity) { switch($severity) { case self::SUCCESS: - return "gSuccess"; + return "g-success"; case self::INFO: - return "gInfo"; + return "g-info"; case self::WARNING: - return "gWarning"; + return "g-warning"; case self::ERROR: - return "gError"; + return "g-error"; } } } diff --git a/modules/gallery/helpers/message.php b/modules/gallery/helpers/message.php index af3b96cc..0d638571 100644 --- a/modules/gallery/helpers/message.php +++ b/modules/gallery/helpers/message.php @@ -81,7 +81,7 @@ class message_Core { $buf[] = "
          • $msg[0]
          • "; } if ($buf) { - return "
              " . implode("", $buf) . "
            "; + return "
              " . implode("", $buf) . "
            "; } } @@ -93,16 +93,16 @@ class message_Core { static function severity_class($severity) { switch($severity) { case self::SUCCESS: - return "gSuccess"; + return "g-success"; case self::INFO: - return "gInfo"; + return "g-info"; case self::WARNING: - return "gWarning"; + return "g-warning"; case self::ERROR: - return "gError"; + return "g-error"; } } } diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php index 6c8c6c88..2190fc94 100644 --- a/modules/gallery/helpers/movie.php +++ b/modules/gallery/helpers/movie.php @@ -129,7 +129,7 @@ class movie_Core { } static function get_edit_form($movie) { - $form = new Forge("movies/$movie->id", "", "post", array("id" => "gEditMovieForm")); + $form = new Forge("movies/$movie->id", "", "post", array("id" => "g-edit-movie-form")); $form->hidden("_method")->value("put"); $group = $form->group("edit_item")->label(t("Edit Movie")); $group->input("title")->label(t("Title"))->value($movie->title); diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php index 065d2d31..692f7111 100644 --- a/modules/gallery/helpers/photo.php +++ b/modules/gallery/helpers/photo.php @@ -138,7 +138,7 @@ class photo_Core { } static function get_add_form($parent) { - $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "gAddPhotoForm")); + $form = new Forge("albums/{$parent->id}", "", "post", array("id" => "g-add-photo-form")); $group = $form->group("add_photo")->label( t("Add Photo to %album_title", array("album_title" => $parent->title))); $group->input("title")->label(t("Title")); @@ -157,7 +157,7 @@ class photo_Core { } static function get_edit_form($photo) { - $form = new Forge("photos/$photo->id", "", "post", array("id" => "gEditPhotoForm")); + $form = new Forge("photos/$photo->id", "", "post", array("id" => "g-edit-photo-form")); $form->hidden("_method")->value("put"); $group = $form->group("edit_item")->label(t("Edit Photo")); $group->input("title")->label(t("Title"))->value($photo->title); diff --git a/modules/gallery/helpers/site_status.php b/modules/gallery/helpers/site_status.php index 6d47e565..b7c6de9a 100644 --- a/modules/gallery/helpers/site_status.php +++ b/modules/gallery/helpers/site_status.php @@ -105,7 +105,7 @@ class site_status_Core { } if ($buf) { - return "
              " . implode("", $buf) . "
            "; + return "
              " . implode("", $buf) . "
            "; } } @@ -117,16 +117,16 @@ class site_status_Core { static function severity_class($severity) { switch($severity) { case self::SUCCESS: - return "gSuccess"; + return "g-success"; case self::INFO: - return "gInfo"; + return "g-info"; case self::WARNING: - return "gWarning"; + return "g-warning"; case self::ERROR: - return "gError"; + return "g-error"; } } } diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php index b46a2c14..fb8f7ca7 100644 --- a/modules/gallery/helpers/theme.php +++ b/modules/gallery/helpers/theme.php @@ -40,22 +40,22 @@ class theme_Core { } static function get_edit_form_admin() { - $form = new Forge("admin/theme_options/save/", "", null, array("id" =>"gThemeOptionsForm")); + $form = new Forge("admin/theme_options/save/", "", null, array("id" =>"g-theme-options-form")); $group = $form->group("edit_theme"); - $group->input("page_size")->label(t("Items per page"))->id("gPageSize") + $group->input("page_size")->label(t("Items per page"))->id("g-page-size") ->rules("required|valid_digit") ->value(module::get_var("gallery", "page_size")); - $group->input("thumb_size")->label(t("Thumbnail size (in pixels)"))->id("gThumbSize") + $group->input("thumb_size")->label(t("Thumbnail size (in pixels)"))->id("g-thumb-size") ->rules("required|valid_digit") ->value(module::get_var("gallery", "thumb_size")); - $group->input("resize_size")->label(t("Resized image size (in pixels)"))->id("gResizeSize") + $group->input("resize_size")->label(t("Resized image size (in pixels)"))->id("g-resize-size") ->rules("required|valid_digit") ->value(module::get_var("gallery", "resize_size")); - $group->textarea("header_text")->label(t("Header text"))->id("gHeaderText") + $group->textarea("header_text")->label(t("Header text"))->id("g-header-text") ->value(module::get_var("gallery", "header_text")); - $group->textarea("footer_text")->label(t("Footer text"))->id("gFooterText") + $group->textarea("footer_text")->label(t("Footer text"))->id("g-footer-text") ->value(module::get_var("gallery", "footer_text")); - $group->checkbox("show_credits")->label(t("Show site credits"))->id("gFooterText") + $group->checkbox("show_credits")->label(t("Show site credits"))->id("g-footer-text") ->checked(module::get_var("gallery", "show_credits")); $group->submit("")->value(t("Save")); return $form; diff --git a/modules/gallery/js/albums_form_add.js b/modules/gallery/js/albums_form_add.js index 43166f27..a568f35d 100644 --- a/modules/gallery/js/albums_form_add.js +++ b/modules/gallery/js/albums_form_add.js @@ -1,22 +1,22 @@ -$("#gAddAlbumForm input[name=title]").change( +$("#g-add-album-form input[name=title]").change( function() { - $("#gAddAlbumForm input[name=name]").attr( - "value", $("#gAddAlbumForm input[name=title]").attr("value") + $("#g-add-album-form input[name=name]").attr( + "value", $("#g-add-album-form input[name=title]").attr("value") .replace(/[\s\/]+/g, "-").replace(/\.+$/, "")); - $("#gAddAlbumForm input[name=slug]").attr( - "value", $("#gAddAlbumForm input[name=title]").attr("value") + $("#g-add-album-form input[name=slug]").attr( + "value", $("#g-add-album-form input[name=title]").attr("value") .replace(/[^A-Za-z0-9-_]+/g, "-") .replace(/^-+/, "") .replace(/-+$/, "")); }); -$("#gAddAlbumForm input[name=title]").keyup( +$("#g-add-album-form input[name=title]").keyup( function() { - $("#gAddAlbumForm input[name=name]").attr( - "value", $("#gAddAlbumForm input[name=title]").attr("value") + $("#g-add-album-form input[name=name]").attr( + "value", $("#g-add-album-form input[name=title]").attr("value") .replace(/[\s\/]+/g, "-") .replace(/\.+$/, "")); - $("#gAddAlbumForm input[name=slug]").attr( - "value", $("#gAddAlbumForm input[name=title]").attr("value") + $("#g-add-album-form input[name=slug]").attr( + "value", $("#g-add-album-form input[name=title]").attr("value") .replace(/[^A-Za-z0-9-_]+/g, "-") .replace(/^-+/, "") .replace(/-+$/, "")); diff --git a/modules/gallery/js/l10n_client.js b/modules/gallery/js/l10n_client.js index 35986e5a..9acb6ca8 100644 --- a/modules/gallery/js/l10n_client.js +++ b/modules/gallery/js/l10n_client.js @@ -35,12 +35,12 @@ jQuery.extend(Gallery, { if(userSelection.length > 0) { Gallery.l10nClient.filter(userSelection); Gallery.l10nClient.toggle(1); - $('#l10n-client #gL10nSearch').focus(); + $('#l10n-client #g-l10n-search').focus(); } else { if($('#l10n-client').is('.hidden')) { Gallery.l10nClient.toggle(1); if(!$.browser.safari) { - $('#l10n-client #gL10nSearch').focus(); + $('#l10n-client #g-l10n-search').focus(); } } else { Gallery.l10nClient.toggle(0); @@ -59,7 +59,7 @@ jQuery.extend(Gallery, { $('#l10n-client-string-select, #l10n-client-string-editor, #l10n-client .labels .label').show(); $('#l10n-client').height('22em').removeClass('hidden'); //$('#l10n-client').slideUp(); - $('#gMinimizeL10n').text("_"); + $('#g-minimize-l10n').text("_"); /* * This CSS clashes with Gallery's CSS, probably due to * YUI's grid / floats. @@ -73,7 +73,7 @@ jQuery.extend(Gallery, { $('#l10n-client-string-select, #l10n-client-string-editor, #l10n-client .labels .label').hide(); $('#l10n-client').height('2em').addClass('hidden'); // TODO: Localize this message - $('#gMinimizeL10n').text(MSG_TRANSLATE_TEXT); + $('#g-minimize-l10n').text(MSG_TRANSLATE_TEXT); /* if(!$.browser.msie) { $('body').css('border-bottom', '0px'); @@ -131,13 +131,13 @@ jQuery.extend(Gallery, { if(search == false || search == '') { $('#l10n-client #l10n-search-filter-clear').focus(); $('#l10n-client-string-select li').show(); - $('#l10n-client #gL10nSearch').val(''); - $('#l10n-client #gL10nSearch').focus(); + $('#l10n-client #g-l10n-search').val(''); + $('#l10n-client #g-l10n-search').focus(); } else { if(search.length > 0) { $('#l10n-client-string-select li').hide(); $('#l10n-client-string-select li:contains('+search+')').show(); - $('#l10n-client #gL10nSearch').val(search); + $('#l10n-client #g-l10n-search').val(search); } } } @@ -193,12 +193,12 @@ Gallery.behaviors.l10nClient = function(context) { var is_plural = Gallery.l10nClient.isPluralMessage(source); Gallery.l10nClient.showSourceMessage(source, is_plural); Gallery.l10nClient.updateTranslationForm(Gallery.l10nClient.getString(index, 'translation'), is_plural); - $("#gL10nClientSaveForm input[name='l10n-message-key']").val(key); + $("#g-l10n-client-save-form input[name='l10n-message-key']").val(key); Gallery.l10nClient.selected = index; }); // When l10n_client window is clicked, toggle based on current state. - $('#gMinimizeL10n').click(function() { + $('#g-minimize-l10n').click(function() { if($('#l10n-client').is('.hidden')) { Gallery.l10nClient.toggle(1); } else { @@ -207,7 +207,7 @@ Gallery.behaviors.l10nClient = function(context) { }); // Close the l10n client using an AJAX call and refreshing the page - $('#gCloseL10n').click(function(event) { + $('#g-close-l10n').click(function(event) { $.ajax({ type: "GET", url: toggle_l10n_mode_url, @@ -223,12 +223,12 @@ Gallery.behaviors.l10nClient = function(context) { // TODO: Either remove hotkeys code or add query.hotkeys.js. if($.hotkeys) { $.hotkeys.add(Gallery.l10nClient.keys['toggle'], function(){Gallery.l10nClient.key('toggle')}); - $.hotkeys.add(Gallery.l10nClient.keys['clear'], {target:'#l10n-client #gL10nSearch', type:'keyup'}, function(){Gallery.l10nClient.key('clear')}); + $.hotkeys.add(Gallery.l10nClient.keys['clear'], {target:'#l10n-client #g-l10n-search', type:'keyup'}, function(){Gallery.l10nClient.key('clear')}); } // Custom listener for l10n_client livesearch - $('#l10n-client #gL10nSearch').keyup(function(key) { - Gallery.l10nClient.filter($('#l10n-client #gL10nSearch').val()); + $('#l10n-client #g-l10n-search').keyup(function(key) { + Gallery.l10nClient.filter($('#l10n-client #g-l10n-search').val()); }); // Clear search @@ -238,7 +238,7 @@ Gallery.behaviors.l10nClient = function(context) { }); // Send AJAX POST data on form submit. - $('#gL10nClientSaveForm').ajaxForm({ + $('#g-l10n-client-save-form').ajaxForm({ dataType: "json", success: function(data) { var source = Gallery.l10nClient.getString(Gallery.l10nClient.selected, 'source'); @@ -250,7 +250,7 @@ Gallery.behaviors.l10nClient = function(context) { var translation = {}; for (var i = 0; i < num_plural_forms; i++) { var form = plural_forms[i]; - translation[form] = $('#gL10nClientSaveForm #l10n-edit-plural-translation-' + form).attr('value'); + translation[form] = $('#g-l10n-client-save-form #l10n-edit-plural-translation-' + form).attr('value'); } } else { translation = $('#l10n-edit-translation').attr('value'); @@ -262,13 +262,13 @@ Gallery.behaviors.l10nClient = function(context) { // Clear the translation form fields Gallery.l10nClient.showSourceMessage('', false); - $('#gL10nClientSaveForm #l10n-edit-translation').val(''); + $('#g-l10n-client-save-form #l10n-edit-translation').val(''); for (var i = 0; i < num_plural_forms; i++) { var form = plural_forms[i]; - $('#gL10nClientSaveForm #l10n-edit-plural-translation-' + form).val(''); + $('#g-l10n-client-save-form #l10n-edit-plural-translation-' + form).val(''); } - $("#gL10nClientSaveForm input[name='l10n-message-key']").val(''); + $("#g-l10n-client-save-form input[name='l10n-message-key']").val(''); }, error: function(xmlhttp) { // TODO: Localize this message @@ -283,12 +283,12 @@ Gallery.behaviors.l10nClient = function(context) { // TODO: Handle plurals in copy button // Copy source text to translation field on button click. - $('#gL10nClientSaveForm #l10n-edit-copy').click(function() { - $('#gL10nClientSaveForm #l10n-edit-target').val($('#l10n-client-string-editor .source-text').text()); + $('#g-l10n-client-save-form #l10n-edit-copy').click(function() { + $('#g-l10n-client-save-form #l10n-edit-target').val($('#l10n-client-string-editor .source-text').text()); }); // Clear translation field on button click. - $('#gL10nClientSaveForm #l10n-edit-clear').click(function() { - $('#gL10nClientSaveForm #l10n-edit-target').val(''); + $('#g-l10n-client-save-form #l10n-edit-clear').click(function() { + $('#g-l10n-client-save-form #l10n-edit-target').val(''); }); }; diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php index 9b12df7e..fa6d1dd3 100644 --- a/modules/gallery/libraries/Admin_View.php +++ b/modules/gallery/libraries/Admin_View.php @@ -96,7 +96,7 @@ class Admin_View_Core extends Gallery_View { if (Session::instance()->get("debug")) { if ($function != "admin_head") { array_unshift( - $blocks, "
            " . + $blocks, "
            " . "
            $function
            "); $blocks[] = "
            "; } diff --git a/modules/gallery/libraries/Menu.php b/modules/gallery/libraries/Menu.php index 4be374a2..47af8531 100644 --- a/modules/gallery/libraries/Menu.php +++ b/modules/gallery/libraries/Menu.php @@ -91,7 +91,7 @@ class Menu_Element_Link extends Menu_Element { } else { $css_class = ""; } - return "
          • url\" " . + return "
          • url\" " . "title=\"$this->label\">$this->label
          • "; } } @@ -122,7 +122,7 @@ class Menu_Element_Ajax_Link extends Menu_Element { } else { $css_class = ""; } - return "
          • url\" " . + return "
          • url\" " . "title=\"$this->label\" ajax_handler=\"$this->ajax_handler\">$this->label
          • "; } } @@ -142,7 +142,7 @@ class Menu_Element_Dialog extends Menu_Element { } else { $css_class = ""; } - return "
          • url\" " . + return "
          • url\" " . "title=\"$this->label\">$this->label
          • "; } } @@ -171,7 +171,7 @@ class Menu_Core extends Menu_Element { case "root": $menu = new Menu("root"); - $menu->css_class("gMenu"); + $menu->css_class("g-menu"); return $menu; case "submenu": diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index ab25a4b6..cba436e8 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -103,7 +103,7 @@ class Theme_View_Core extends Gallery_View { ->id("fullsize") ->label(t("View full size")) ->url($this->item()->file_url()) - ->css_class("gFullSizeLink")); + ->css_class("g-fullsize-link")); } module::event("photo_menu", $menu, $this); @@ -121,7 +121,7 @@ class Theme_View_Core extends Gallery_View { ->append(Menu::factory("submenu") ->id("context_menu") ->label(t("Options"))) - ->css_class("gContextMenu"); + ->css_class("g-context-menu"); module::event("context_menu", $menu, $this, $item, $thumbnail_css_selector); return $menu->compact(); @@ -231,7 +231,7 @@ class Theme_View_Core extends Gallery_View { if (Session::instance()->get("debug")) { if ($function != "head") { array_unshift( - $blocks, "
            " . + $blocks, "
            " . "
            $function
            "); $blocks[] = "
            "; } diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index ff02daf8..246d5fcd 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -567,7 +567,7 @@ class Item_Model extends ORM_MPTT { $v->attrs = array_merge($extra_attrs, array("style" => "display:block;width:{$this->width}px;height:{$this->height}px")); if (empty($v->attrs["id"])) { - $v->attrs["id"] = "gMovieId-{$this->id}"; + $v->attrs["id"] = "g-movie-id-{$this->id}"; } return $v; } diff --git a/modules/gallery/tests/DrawForm_Test.php b/modules/gallery/tests/DrawForm_Test.php index dde54257..7ee80ca2 100644 --- a/modules/gallery/tests/DrawForm_Test.php +++ b/modules/gallery/tests/DrawForm_Test.php @@ -19,14 +19,14 @@ */ class DrawForm_Test extends Unit_Test_Case { function no_group_test() { - $form = new Forge("test/controller", "", "post", array("id" => "gTestGroupForm")); + $form = new Forge("test/controller", "", "post", array("id" => "g-test-group-form")); $form->input("title")->label(t("Title")); $form->textarea("description")->label(t("Text Area")); $form->submit("")->value(t("Submit")); $rendered = $form->__toString(); $expected = "
            \n" . + "id=\"g-test-group-form\">\n" . "\n" . "
              \n" . "
            • \n" . @@ -48,7 +48,7 @@ class DrawForm_Test extends Unit_Test_Case { } function group_test() { - $form = new Forge("test/controller", "", "post", array("id" => "gTestGroupForm")); + $form = new Forge("test/controller", "", "post", array("id" => "g-test-group-form")); $group = $form->group("test_group")->label(t("Test Group")); $group->input("title")->label(t("Title")); $group->textarea("description")->label(t("Text Area")); @@ -56,7 +56,7 @@ class DrawForm_Test extends Unit_Test_Case { $rendered = $form->__toString(); $expected = "\n" . + "id=\"g-test-group-form\">\n" . "\n" . "
              \n" . " Test Group\n" . @@ -81,7 +81,7 @@ class DrawForm_Test extends Unit_Test_Case { } function form_script_test() { - $form = new Forge("test/controller", "", "post", array("id" => "gTestGroupForm")); + $form = new Forge("test/controller", "", "post", array("id" => "g-test-group-form")); $group = $form->group("test_group")->label(t("Test Group")); $group->input("title")->label(t("Title")); $group->textarea("description")->label(t("Text Area")); @@ -92,7 +92,7 @@ class DrawForm_Test extends Unit_Test_Case { $rendered = $form->__toString(); $expected = "\n" . + "id=\"g-test-group-form\">\n" . "\n" . "
              \n" . " Test Group\n" . diff --git a/modules/gallery/tests/selenium/Add_Comment.html b/modules/gallery/tests/selenium/Add_Comment.html index b4b96ed2..dff653da 100644 --- a/modules/gallery/tests/selenium/Add_Comment.html +++ b/modules/gallery/tests/selenium/Add_Comment.html @@ -18,22 +18,22 @@
          - + - + - + - + diff --git a/modules/gallery/tests/selenium/Login.html b/modules/gallery/tests/selenium/Login.html index 5e17a3c7..d2e45c63 100644 --- a/modules/gallery/tests/selenium/Login.html +++ b/modules/gallery/tests/selenium/Login.html @@ -18,17 +18,17 @@ - + - + - + @@ -38,7 +38,7 @@ - + diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 5fd6a390..c8ba3770 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -1,12 +1,12 @@ modules/akismet/views/admin_akismet.html.php 16 DIRTY $form modules/akismet/views/admin_akismet_stats.html.php 9 DIRTY_ATTR $api_key modules/akismet/views/admin_akismet_stats.html.php 9 DIRTY_ATTR urlencode($blog_url) -modules/comment/views/admin_block_recent_comments.html.php 4 DIRTY_ATTR ($i%2==0)?"g-even-row":"g-odd-row" +modules/comment/views/admin_block_recent_comments.html.php 4 DIRTY_ATTR ($i%2==0)?"g-even":"g-odd" modules/comment/views/admin_block_recent_comments.html.php 5 DIRTY_ATTR $comment->author()->avatar_url(32,$theme->url(,true)) modules/comment/views/admin_block_recent_comments.html.php 10 DIRTY gallery::date_time($comment->created) modules/comment/views/admin_comments.html.php 42 DIRTY $menu modules/comment/views/admin_comments.html.php 106 DIRTY_ATTR $comment->id -modules/comment/views/admin_comments.html.php 106 DIRTY_ATTR ($i%2==0)?"g-odd-row":"g-even-row" +modules/comment/views/admin_comments.html.php 106 DIRTY_ATTR ($i%2==0)?"g-odd":"g-even" modules/comment/views/admin_comments.html.php 109 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true)) modules/comment/views/admin_comments.html.php 122 DIRTY_JS $item->url() modules/comment/views/admin_comments.html.php 124 DIRTY_ATTR $item->thumb_url() @@ -56,14 +56,14 @@ modules/gallery/views/admin_dashboard.html.php 35 DIRTY $block modules/gallery/views/admin_graphics.html.php 22 DIRTY newView("admin_graphics_none.html") modules/gallery/views/admin_graphics.html.php 24 DIRTY newView("admin_graphics_$active.html",array("tk"=>$tk->$active,"is_active"=>true)) modules/gallery/views/admin_graphics.html.php 31 DIRTY newView("admin_graphics_$id.html",array("tk"=>$tk->$id,"is_active"=>false)) -modules/gallery/views/admin_graphics_gd.html.php 2 DIRTY_ATTR $is_active?" gSelected":"" -modules/gallery/views/admin_graphics_gd.html.php 2 DIRTY_ATTR $tk->installed?" gInstalledToolkit":" gUnavailable" +modules/gallery/views/admin_graphics_gd.html.php 2 DIRTY_ATTR $is_active?" g-selected":"" +modules/gallery/views/admin_graphics_gd.html.php 2 DIRTY_ATTR $tk->installed?" g-installed-toolkit":" g-unavailable" modules/gallery/views/admin_graphics_gd.html.php 19 DIRTY $tk->error -modules/gallery/views/admin_graphics_graphicsmagick.html.php 2 DIRTY_ATTR $is_active?" gSelected":"" -modules/gallery/views/admin_graphics_graphicsmagick.html.php 2 DIRTY_ATTR $tk->installed?" gInstalledToolkit":" gUnavailable" +modules/gallery/views/admin_graphics_graphicsmagick.html.php 2 DIRTY_ATTR $is_active?" g-selected":"" +modules/gallery/views/admin_graphics_graphicsmagick.html.php 2 DIRTY_ATTR $tk->installed?" g-installed-toolkit":" g-unavailable" modules/gallery/views/admin_graphics_graphicsmagick.html.php 18 DIRTY $tk->error -modules/gallery/views/admin_graphics_imagemagick.html.php 2 DIRTY_ATTR $is_active?" gSelected":"" -modules/gallery/views/admin_graphics_imagemagick.html.php 2 DIRTY_ATTR $tk->installed?" gInstalledToolkit":" gUnavailable" +modules/gallery/views/admin_graphics_imagemagick.html.php 2 DIRTY_ATTR $is_active?" g-selected":"" +modules/gallery/views/admin_graphics_imagemagick.html.php 2 DIRTY_ATTR $tk->installed?" g-installed-toolkit":" g-unavailable" modules/gallery/views/admin_graphics_imagemagick.html.php 18 DIRTY $tk->error modules/gallery/views/admin_languages.html.php 9 DIRTY access::csrf_form_field() modules/gallery/views/admin_languages.html.php 27 DIRTY_ATTR (isset($installed_locales[$code]))?"installed":"" @@ -72,20 +72,20 @@ modules/gallery/views/admin_languages.html.php 28 DIRTY form:: modules/gallery/views/admin_languages.html.php 29 DIRTY $display_name modules/gallery/views/admin_languages.html.php 31 DIRTY form::radio("default_locale",$code,($default_locale==$code),((isset($installed_locales[$code]))?'':'disabled="disabled"')) modules/gallery/views/admin_languages.html.php 102 DIRTY $share_translations_form -modules/gallery/views/admin_maintenance.html.php 24 DIRTY_ATTR ($i%2==0)?"g-odd-row":"g-even-row" +modules/gallery/views/admin_maintenance.html.php 24 DIRTY_ATTR ($i%2==0)?"g-odd":"g-even" modules/gallery/views/admin_maintenance.html.php 24 DIRTY_ATTR log::severity_class($task->severity) modules/gallery/views/admin_maintenance.html.php 25 DIRTY_ATTR log::severity_class($task->severity) modules/gallery/views/admin_maintenance.html.php 26 DIRTY $task->name modules/gallery/views/admin_maintenance.html.php 29 DIRTY $task->description -modules/gallery/views/admin_maintenance.html.php 72 DIRTY_ATTR ($i%2==0)?"g-odd-row":"g-even-row" -modules/gallery/views/admin_maintenance.html.php 72 DIRTY_ATTR $task->state=="stalled"?"gWarning":"" -modules/gallery/views/admin_maintenance.html.php 73 DIRTY_ATTR $task->state=="stalled"?"gWarning":"" +modules/gallery/views/admin_maintenance.html.php 72 DIRTY_ATTR ($i%2==0)?"g-odd":"g-even" +modules/gallery/views/admin_maintenance.html.php 72 DIRTY_ATTR $task->state=="stalled"?"g-warning":"" +modules/gallery/views/admin_maintenance.html.php 73 DIRTY_ATTR $task->state=="stalled"?"g-warning":"" modules/gallery/views/admin_maintenance.html.php 74 DIRTY gallery::date_time($task->updated) modules/gallery/views/admin_maintenance.html.php 77 DIRTY $task->name modules/gallery/views/admin_maintenance.html.php 92 DIRTY $task->status -modules/gallery/views/admin_maintenance.html.php 145 DIRTY_ATTR ($i%2==0)?"g-odd-row":"g-even-row" -modules/gallery/views/admin_maintenance.html.php 145 DIRTY_ATTR $task->state=="success"?"gSuccess":"gError" -modules/gallery/views/admin_maintenance.html.php 146 DIRTY_ATTR $task->state=="success"?"gSuccess":"gError" +modules/gallery/views/admin_maintenance.html.php 145 DIRTY_ATTR ($i%2==0)?"g-odd":"g-even" +modules/gallery/views/admin_maintenance.html.php 145 DIRTY_ATTR $task->state=="success"?"g-success":"g-error" +modules/gallery/views/admin_maintenance.html.php 146 DIRTY_ATTR $task->state=="success"?"g-success":"g-error" modules/gallery/views/admin_maintenance.html.php 147 DIRTY gallery::date_time($task->updated) modules/gallery/views/admin_maintenance.html.php 150 DIRTY $task->name modules/gallery/views/admin_maintenance.html.php 162 DIRTY $task->status @@ -93,7 +93,7 @@ modules/gallery/views/admin_maintenance_show_log.html.php 8 DIRTY_JS url::s modules/gallery/views/admin_maintenance_show_log.html.php 13 DIRTY $task->name modules/gallery/views/admin_maintenance_task.html.php 55 DIRTY $task->name modules/gallery/views/admin_modules.html.php 9 DIRTY access::csrf_form_field() -modules/gallery/views/admin_modules.html.php 19 DIRTY_ATTR ($i%2==0)?"g-odd-row":"g-even-row" +modules/gallery/views/admin_modules.html.php 19 DIRTY_ATTR ($i%2==0)?"g-odd":"g-even" modules/gallery/views/admin_modules.html.php 22 DIRTY form::checkbox($data,'1',module::is_active($module_name)) modules/gallery/views/admin_modules.html.php 24 DIRTY $module_info->version modules/gallery/views/admin_theme_options.html.php 5 DIRTY $form @@ -178,7 +178,7 @@ modules/gallery/views/upgrader.html.php 45 DIRTY_ATTR $id modules/gallery/views/upgrader.html.php 49 DIRTY $module->version modules/gallery/views/upgrader.html.php 52 DIRTY $module->code_version modules/image_block/views/image_block_block.html.php 3 DIRTY_JS $item->url() -modules/image_block/views/image_block_block.html.php 4 DIRTY $item->thumb_img(array("class"=>"gThumbnail")) +modules/image_block/views/image_block_block.html.php 4 DIRTY $item->thumb_img(array("class"=>"g-thumbnail")) modules/info/views/info_block.html.php 22 DIRTY date("M j, Y H:i:s",$item->captured) modules/info/views/info_block.html.php 29 DIRTY_JS $item->owner->url modules/notification/views/comment_published.html.php 28 DIRTY_JS $comment->item()->abs_url() @@ -195,19 +195,19 @@ modules/organize/views/organize_dialog.html.php 5 DIRTY_JS url::s modules/organize/views/organize_dialog.html.php 6 DIRTY_JS url::site("organize/tree/__ALBUM_ID__") modules/organize/views/organize_dialog.html.php 22 DIRTY $album_tree modules/organize/views/organize_dialog.html.php 29 DIRTY $micro_thumb_grid -modules/organize/views/organize_dialog.html.php 37 DIRTY form::dropdown(array("id"=>"gOrganizeSortColumn"),album::get_sort_order_options(),$album->sort_column) -modules/organize/views/organize_dialog.html.php 38 DIRTY form::dropdown(array("id"=>"gOrganizeSortOrder"),array("ASC"=>"Ascending","DESC"=>"Descending"),$album->sort_order) +modules/organize/views/organize_dialog.html.php 37 DIRTY form::dropdown(array("id"=>"g-organize-sort-column"),album::get_sort_order_options(),$album->sort_column) +modules/organize/views/organize_dialog.html.php 38 DIRTY form::dropdown(array("id"=>"g-organize-sort-order"),array("ASC"=>"Ascending","DESC"=>"Descending"),$album->sort_order) modules/organize/views/organize_thumb_grid.html.php 3 DIRTY_ATTR $child->id modules/organize/views/organize_thumb_grid.html.php 4 DIRTY_ATTR $child->id -modules/organize/views/organize_thumb_grid.html.php 5 DIRTY_ATTR $child->is_album()?"gAlbum":"gPhoto" -modules/organize/views/organize_thumb_grid.html.php 6 DIRTY $child->thumb_img(array("class"=>"gThumbnail","ref"=>$child->id),90,true) +modules/organize/views/organize_thumb_grid.html.php 5 DIRTY_ATTR $child->is_album()?"g-album":"g-photo" +modules/organize/views/organize_thumb_grid.html.php 6 DIRTY $child->thumb_img(array("class"=>"g-thumbnail","ref"=>$child->id),90,true) modules/organize/views/organize_thumb_grid.html.php 14 DIRTY_JS url::site("organize/album/$album->id/".($offset+25)) -modules/organize/views/organize_tree.html.php 2 DIRTY_ATTR access::can("edit",$album)?"":"gViewOnly" +modules/organize/views/organize_tree.html.php 2 DIRTY_ATTR access::can("edit",$album)?"":"g-view-only" modules/organize/views/organize_tree.html.php 3 DIRTY_ATTR $album->id modules/organize/views/organize_tree.html.php 6 DIRTY_ATTR $selected&&$album->id==$selected->id?"selected":"" modules/organize/views/organize_tree.html.php 7 DIRTY_ATTR $album->id modules/organize/views/organize_tree.html.php 13 DIRTY View::factory("organize_tree.html",array("selected"=>$selected,"album"=>$child)); -modules/organize/views/organize_tree.html.php 15 DIRTY_ATTR access::can("edit",$child)?"":"gViewOnly" +modules/organize/views/organize_tree.html.php 15 DIRTY_ATTR access::can("edit",$child)?"":"g-view-only" modules/organize/views/organize_tree.html.php 16 DIRTY_ATTR $child->id modules/organize/views/organize_tree.html.php 19 DIRTY_ATTR $child->id modules/recaptcha/views/admin_recaptcha.html.php 10 DIRTY $form @@ -252,7 +252,7 @@ modules/search/views/search.html.php 32 DIRTY $item- modules/server_add/views/admin_server_add.html.php 15 DIRTY_ATTR $id modules/server_add/views/admin_server_add.html.php 24 DIRTY $form modules/server_add/views/server_add_tree.html.php 20 DIRTY_ATTR is_dir($file)?"ui-icon-folder-collapsed":"ui-icon-document" -modules/server_add/views/server_add_tree.html.php 21 DIRTY_ATTR is_dir($file)?"gDirectory":"gFile" +modules/server_add/views/server_add_tree.html.php 21 DIRTY_ATTR is_dir($file)?"g-directory":"g-file" modules/server_add/views/server_add_tree_dialog.html.php 3 DIRTY_JS url::site("server_add/children?path=__PATH__") modules/server_add/views/server_add_tree_dialog.html.php 4 DIRTY_JS url::site("server_add/start?item_id={$item->id}&csrf=$csrf") modules/server_add/views/server_add_tree_dialog.html.php 23 DIRTY $tree @@ -267,19 +267,19 @@ modules/user/views/admin_users.html.php 3 DIRTY_JS url::s modules/user/views/admin_users.html.php 26 DIRTY_JS url::site("admin/users/group/__GROUPID__") modules/user/views/admin_users.html.php 36 DIRTY_JS url::site("admin/users/remove_user_from_group/__USERID__/__GROUPID__?csrf=$csrf") modules/user/views/admin_users.html.php 67 DIRTY_ATTR $user->id -modules/user/views/admin_users.html.php 67 DIRTY_ATTR text::alternate("g-odd-row","g-even-row") +modules/user/views/admin_users.html.php 67 DIRTY_ATTR text::alternate("g-odd","g-even") modules/user/views/admin_users.html.php 67 DIRTY_ATTR $user->admin?"admin":"" modules/user/views/admin_users.html.php 68 DIRTY_ATTR $user->id modules/user/views/admin_users.html.php 69 DIRTY_ATTR $user->avatar_url(20,$theme->url(,true)) modules/user/views/admin_users.html.php 83 DIRTY ($user->last_login==0)?"":gallery::date($user->last_login) modules/user/views/admin_users.html.php 121 DIRTY_ATTR $group->id -modules/user/views/admin_users.html.php 121 DIRTY_ATTR ($group->special?"gDefaultGroup":"") +modules/user/views/admin_users.html.php 121 DIRTY_ATTR ($group->special?"g-default-group":"") modules/user/views/admin_users.html.php 123 DIRTY $v modules/user/views/admin_users_group.html.php 22 DIRTY_JS $user->id modules/user/views/admin_users_group.html.php 22 DIRTY_JS $group->id modules/user/views/login_ajax.html.php 6 DIRTY_JS url::site("password/reset") modules/user/views/login_ajax.html.php 37 DIRTY $form -modules/user/views/user_languages_block.html.php 2 DIRTY form::dropdown("gSelectSessionLocale",$installed_locales,$selected) +modules/user/views/user_languages_block.html.php 2 DIRTY form::dropdown("g-select-session-locale",$installed_locales,$selected) modules/watermark/views/admin_watermarks.html.php 19 DIRTY_ATTR $width modules/watermark/views/admin_watermarks.html.php 19 DIRTY_ATTR $height modules/watermark/views/admin_watermarks.html.php 19 DIRTY_ATTR $url @@ -308,13 +308,13 @@ themes/admin_wind/views/pager.html.php 37 DIRTY_JS str_re themes/wind/views/album.html.php 16 DIRTY_ATTR $child->id themes/wind/views/album.html.php 16 DIRTY_ATTR $item_class themes/wind/views/album.html.php 18 DIRTY_JS $child->url() -themes/wind/views/album.html.php 19 DIRTY $child->thumb_img(array("class"=>"gThumbnail")) +themes/wind/views/album.html.php 19 DIRTY $child->thumb_img(array("class"=>"g-thumbnail")) themes/wind/views/album.html.php 23 DIRTY_JS $child->url() themes/wind/views/block.html.php 3 DIRTY_ATTR $anchor themes/wind/views/block.html.php 5 DIRTY_ATTR $css_id themes/wind/views/block.html.php 6 DIRTY $title themes/wind/views/block.html.php 8 DIRTY $content -themes/wind/views/dynamic.html.php 11 DIRTY_ATTR $child->is_album()?"gAlbum":"" +themes/wind/views/dynamic.html.php 11 DIRTY_ATTR $child->is_album()?"g-album":"" themes/wind/views/dynamic.html.php 13 DIRTY_JS $child->url() themes/wind/views/dynamic.html.php 14 DIRTY_ATTR $child->id themes/wind/views/dynamic.html.php 15 DIRTY_ATTR $child->thumb_url() @@ -322,7 +322,7 @@ themes/wind/views/dynamic.html.php 16 DIRTY_ATTR $chi themes/wind/views/dynamic.html.php 17 DIRTY_ATTR $child->thumb_height themes/wind/views/movie.html.php 8 DIRTY_JS $previous_item->url() themes/wind/views/movie.html.php 18 DIRTY_JS $next_item->url() -themes/wind/views/movie.html.php 28 DIRTY $item->movie_img(array("class"=>"gMovie","id"=>"gMovieId-{$item->id}")) +themes/wind/views/movie.html.php 28 DIRTY $item->movie_img(array("class"=>"g-movie","id"=>"g-movie-id-{$item->id}")) themes/wind/views/page.html.php 9 DIRTY $page_title themes/wind/views/page.html.php 32 DIRTY_JS $theme->url() themes/wind/views/page.html.php 41 DIRTY $new_width @@ -344,4 +344,4 @@ themes/wind/views/photo.html.php 8 DIRTY_JS $theme themes/wind/views/photo.html.php 21 DIRTY_JS $previous_item->url() themes/wind/views/photo.html.php 31 DIRTY_JS $next_item->url() themes/wind/views/photo.html.php 43 DIRTY_JS $item->file_url() -themes/wind/views/photo.html.php 45 DIRTY $item->resize_img(array("id"=>"gPhotoId-{$item->id}","class"=>"gResize")) +themes/wind/views/photo.html.php 45 DIRTY $item->resize_img(array("id"=>"g-photoId-{$item->id}","class"=>"g-resize")) diff --git a/modules/gallery/views/admin_advanced_settings.html.php b/modules/gallery/views/admin_advanced_settings.html.php index 6ad265ac..422bd8f7 100644 --- a/modules/gallery/views/admin_advanced_settings.html.php +++ b/modules/gallery/views/admin_advanced_settings.html.php @@ -1,11 +1,11 @@ -
          +

          -
            -
          • +
              +
            @@ -23,7 +23,7 @@
          - for_html_attr() ?>" /> - +
          +

          - -
          - -
          -

          -

          - -

          +
          +

          +

          + +

          -

          +
          +
          "> + + + + + + + + + $display_name): ?> + +
          + + + + + + + "> + + + + + + +
          + +
          + for_html_attr() ?>" /> +
          +
          +
          -
          - for_html_attr() ?>"> - - +
          +

          +

          + +

          -

          Step 1: Make sure the target language is installed and up to date (check above).") ?>

          +
          + for_html_attr() ?>"> + + -

          Step 2: Make sure you have selected the right target language (currently %default_locale).", - array("default_locale" => locales::display_name())) ?>

          +

          -

          Step 3: Start the translation mode and the translation interface will appear at the bottom of each Gallery page.") ?>

          +

          - - - get("l10n_mode", false)): ?> - - - - - -
          +
            +
          • +
          • locales::display_name())) ?>
          • +
          • +
          + + + get("l10n_mode", false)): ?> + + + + + -

          - +

          + +
          +
          + +
          diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php index 94582dc8..73a4bef8 100644 --- a/modules/gallery/views/admin_maintenance.html.php +++ b/modules/gallery/views/admin_maintenance.html.php @@ -1,193 +1,195 @@ -
          +

          -
          -

          - - - - - - - - - severity) ?>"> - - - - - - -
          - - - - - -
          - name ?> - - description ?> - - callback?csrf=$csrf") ?>" - class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all"> - - -
          -
          - - 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") ?>"> - - - -
          -
          - +
          +
          +

          + + + + + + + + + severity) ?>"> + + + + + + +
          + + + + + +
          + name ?> + + description ?> + + callback?csrf=$csrf") ?>" + class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all"> + + +
          +
          - count()): ?> - + + + count()): ?> +
          +

          + + + + + + + + + + + + state == "success" ? "g-success" : "g-error" ?>"> + + + + + + + + + +
          + + + + + + + + + + + " + class="g-button g-right ui-icon-left ui-state-default ui-corner-all"> + + +
          "> + 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/modules/gallery/views/admin_modules.html.php b/modules/gallery/views/admin_modules.html.php index 75f4f0c5..4c4976f8 100644 --- a/modules/gallery/views/admin_modules.html.php +++ b/modules/gallery/views/admin_modules.html.php @@ -1,32 +1,34 @@ -
          +

          -
          "> - - - - - - - - - - $module_info): ?> - "> - $module_name); ?> - locked) $data["disabled"] = 1; ?> - - - - - - - -
          name) ?> version ?> description) ?>
          - for_html_attr() ?>"/> -
          +
          +
          "> + + + + + + + + + + $module_info): ?> + "> + $module_name); ?> + locked) $data["disabled"] = 1; ?> + + + + + + + +
          name) ?> version ?> description) ?>
          + for_html_attr() ?>" /> +
          +
          diff --git a/modules/gallery/views/admin_sidebar.html.php b/modules/gallery/views/admin_sidebar.html.php index b4f339ae..ea950b54 100644 --- a/modules/gallery/views/admin_sidebar.html.php +++ b/modules/gallery/views/admin_sidebar.html.php @@ -1,7 +1,7 @@ -

          -

          - -

          -
          "> -
          -

          -
          -
            - -
          +
          +

          +

          + +

          + +
          "> +
          +

          +
          +
            + +
          +
          -
          -
          -

          -
          -
            - -
          +
          +

          +
          +
            + +
          +
          diff --git a/modules/gallery/views/admin_theme_options.html.php b/modules/gallery/views/admin_theme_options.html.php index e09be728..a4bf1c4e 100644 --- a/modules/gallery/views/admin_theme_options.html.php +++ b/modules/gallery/views/admin_theme_options.html.php @@ -1,6 +1,8 @@ -
          +

          +
          +
          diff --git a/modules/gallery/views/admin_themes.html.php b/modules/gallery/views/admin_themes.html.php index f7e77a01..dda18265 100644 --- a/modules/gallery/views/admin_themes.html.php +++ b/modules/gallery/views/admin_themes.html.php @@ -7,83 +7,88 @@ } -

          -

          - -

          +
          +

          +

          + +

          -
          -

          -
          - " - alt="name) ?>" /> -

          name ?>

          -

          - description ?> -

          -
          +
          + +
          +

          +
          + " + alt="name) ?>" /> +

          name ?>

          +

          + description ?> +

          +
          -
          -

          -
          - " - alt="name) ?>" /> -

          name ?>

          -

          - description ?> -

          -
          +

          +
          \ No newline at end of file diff --git a/modules/recaptcha/views/admin_recaptcha.html.php b/modules/recaptcha/views/admin_recaptcha.html.php index 3e964801..a0af3ba8 100644 --- a/modules/recaptcha/views/admin_recaptcha.html.php +++ b/modules/recaptcha/views/admin_recaptcha.html.php @@ -1,5 +1,5 @@ -
          +

          reCAPTCHA Public/Private Key pair, which is also free. Once registered, the challenge and response strings are evaluated at recaptcha.net to determine if the form content has been entered by a bot.", @@ -7,27 +7,29 @@ "recaptcha_url" => html::mark_clean("http://recaptcha.net"))) ?>

          - -
          +
          + - -
          -

          -

          - -

          + +
          +

          +

          + +

          -
          - - +
          + + +
          +
          + +
          - - diff --git a/modules/server_add/views/admin_server_add.html.php b/modules/server_add/views/admin_server_add.html.php index e447ee6d..eae767af 100644 --- a/modules/server_add/views/admin_server_add.html.php +++ b/modules/server_add/views/admin_server_add.html.php @@ -1,25 +1,22 @@ -
          -

          - -

          -
          -

          +
          +

          +
          +

          style="display: none;">
        -
        -
        diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js index 41fa4d41..4ed88e03 100644 --- a/modules/tag/js/tag.js +++ b/modules/tag/js/tag.js @@ -37,7 +37,7 @@ function editInPlace(element) { closeEditInPlaceForms(); // create edit form - var tag_id = $(this).attr('id').substr(5); + var tag_id = $(this).attr('rel'); var tag_name = $(this).html(); var tag_width = $(this).width(); $(this).parent().data("revert", $(this).parent().html()); @@ -67,7 +67,7 @@ function editInPlace(element) { console.log("success"); if (data.result == "success") { closeEditInPlaceForms(); // close form - $("#g-tag-" + data.tag_id).text(data.new_tagname); // update tagname + $(".g-tag[rel=" + data.tag_id + "]").text(data.new_tagname); // update tagname window.location.reload(); } else if (data.result == "error") { console.log("error"); diff --git a/modules/tag/views/admin_tags.html.php b/modules/tag/views/admin_tags.html.php index 7771f7fe..67ba4d95 100644 --- a/modules/tag/views/admin_tags.html.php +++ b/modules/tag/views/admin_tags.html.php @@ -1,5 +1,5 @@ - -

        - -

        - count()/5 ?> - - - - - + +
        - count()) ?> -
        - $tag): ?> - name, 0, 1)) ?> - - - -
          - - $tags_per_column): /* new column */ ?> -
        - - +
        +

        + +
        + + + + + - -
        + count()) ?> +
        + $tag): ?> + name, 0, 1)) ?> - - -
          - + + +
            + + $tags_per_column): /* new column */ ?> +
        + + + + + -
        + + + + +
        + + diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php index 2f8d8673..aae39c8c 100644 --- a/modules/user/views/admin_users.html.php +++ b/modules/user/views/admin_users.html.php @@ -41,88 +41,93 @@ }); } -
        - " - class="g-dialog-link g-button g-right ui-icon-left ui-state-default ui-corner-all" - title="for_html_attr() ?>"> - - - -

        - -

        +
        +

        - - - - - - - - + user admin ? "admin" : "" ?>"> - - - - - - - -
        - " - title="for_html_attr() ?>" - alt="name) ?>" - width="20" - height="20" /> - name) ?> - - full_name) ?> - - email) ?> - - last_login == 0) ? "" : gallery::date($user->last_login) ?> - - id") ?>" - open_text="" - class="g-panel-link g-button ui-state-default ui-corner-all ui-icon-left"> - - id != $user->id && !$user->guest): ?> - id") ?>" - class="g-dialog-link g-button ui-state-default ui-corner-all ui-icon-left"> - - - for_html_attr() ?>" - class="g-button ui-state-disabled ui-corner-all ui-icon-left"> - - -
        -
        -
        +

        -
        - " - class="g-dialog-link g-button g-right ui-icon-left ui-state-default ui-corner-all" - title="for_html_attr() ?>"> - - - +
        + + + + + + + + -

        - -

        + $user): ?> + user admin ? "admin" : "" ?>"> + + + + + + + +
        + " + title="for_html_attr() ?>" + alt="name) ?>" + width="20" + height="20" /> + name) ?> + + full_name) ?> + + email) ?> + + last_login == 0) ? "" : gallery::date($user->last_login) ?> + + id") ?>" + open_text="" + class="g-panel-link g-button ui-state-default ui-corner-all ui-icon-left"> + + id != $user->id && !$user->guest): ?> + id") ?>" + class="g-dialog-link g-button ui-state-default ui-corner-all ui-icon-left"> + + + for_html_attr() ?>" + class="g-button ui-state-disabled ui-corner-all ui-icon-left"> + + +
        +
        +
        -
        -
          - $group): ?> -
        • " /> - group = $group; ?> - -
        • - -
        -
        + +
        diff --git a/modules/watermark/views/admin_watermarks.html.php b/modules/watermark/views/admin_watermarks.html.php index d034066a..af38cb41 100644 --- a/modules/watermark/views/admin_watermarks.html.php +++ b/modules/watermark/views/admin_watermarks.html.php @@ -1,37 +1,39 @@ -
        +

        - - " - title="for_html_attr() ?>" - class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all"> - -

        -

        - -

        -
        -
        - -

        - watermark::position($position))) ?> -

        -

        - module::get_var("watermark", "transparency"))) ?> -

        -
        - diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css index 1d60d392..20593e9c 100644 --- a/themes/admin_wind/css/screen.css +++ b/themes/admin_wind/css/screen.css @@ -107,11 +107,11 @@ td { border: none; border-bottom: 1px solid #ccc; padding: .5em; - vertical-align: top; + vertical-align: middle; } -#g-admin-maintenance td { - vertical-align: middle; +th { + white-space: nowrap; } /* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ @@ -474,14 +474,6 @@ tr.g-warning { margin-right: 1em; } -#g-user-admin-list { - margin-bottom: 1em; -} - -#g-user-admin-list td { - vertical-align: bottom; -} - #g-user-admin-list .admin { color: #55f; font-weight: bold; @@ -531,36 +523,19 @@ li.g-default-group h4, li.g-default-group .g-user { color: gray; } -#g-admin-advanced-settings tr.setting:hover { - background: #ffc; -} - -/* admin/sidebar ~~~~~~~~~~~~~~~~~~~~~~~~~ */ -.g-admin-blocks-list { - float: left; - height: 300px; - margin-left: 20px; - width: 30%; -} +/* Block admin ~~~~~~~~~~~~~~~~~~~~~~~~~ */ -.g-admin-blocks-list div:last-child { - border: .1em solid; - height: 100%; - overflow-y: auto; +#g-admin-blocks .g-block { + margin-right: 2em; + height: 200px; + width: 30% !important; } -.g-admin-blocks-list ul { - height: 98%; - margin: .1em .1em; - padding: .1em; -} - -.g-admin-blocks-list ul li { - background-color: #e8e8e8; - font-size: 1em; - font-weight: bold; - margin: .5em; - padding: .3em .8em; +#g-admin-blocks .g-block li { + background: #e7e7e7; + /*border: 1px solid #fff;*/ + margin-bottom: 1em; + padding: .4em .8em; } /** ******************************************************************* @@ -797,20 +772,10 @@ li.g-default-group h4, li.g-default-group .g-user { } #g-languages-form table { - width: 400px; - float: left; + width: 40%; margin: 0 3em 1em 0; } -#g-languages-form .installed { - background-color: #EEEEEE; -} - -#g-languages-form .default { - background-color: #C5DBEC; - font-weight: bold; -} - #g-languages-form input { clear: both; } @@ -824,10 +789,6 @@ li.g-default-group h4, li.g-default-group .g-user { padding: .5em; } -.g-doc-link { - float: right; -} - /** ******************************************************************* * 7) Right to left styles *********************************************************************/ -- cgit v1.2.3 From 6a7db5bea15c346d069d42fef173a0f99393bf3d Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sun, 18 Oct 2009 20:39:31 -0600 Subject: Resolve merge conflict. --- modules/gallery/helpers/module.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php index fe37f4f9..77ec6f63 100644 --- a/modules/gallery/helpers/module.php +++ b/modules/gallery/helpers/module.php @@ -50,8 +50,20 @@ class module_Core { * @param string $module_name */ static function get($module_name) { - // @todo can't easily use model_cache here because it throw an exception on missing models. - return ORM::factory("module", array("name" => $module_name)); + if (empty(self::$modules[$module_name])) { + return ORM::factory("module", array("name" => $module_name)); + } + return self::$modules[$module_name]; + } + + /** + * Get the information about a module + * @returns ArrayObject containing the module information from the module.info file or false if + * not found + */ + static function info($module_name) { + $module_list = self::available(); + return isset($module_list->$module_name) ? $module_list->$module_name : false; } /** @@ -79,7 +91,8 @@ class module_Core { $modules = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS); foreach (glob(MODPATH . "*/module.info") as $file) { $module_name = basename(dirname($file)); - $modules->$module_name = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS); + $modules->$module_name = + new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS); $m =& $modules->$module_name; $m->installed = self::is_installed($module_name); $m->active = self::is_active($module_name); -- cgit v1.2.3 From b2d0b3ebbb1764593e387a2e07e0d4e67f4f5474 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sun, 18 Oct 2009 23:38:27 -0600 Subject: Fix sidebar block admin layout. Don't hardcode block list height, use the equal_heights() function to set it. --- modules/gallery/views/admin_sidebar.html.php | 4 ++++ themes/admin_wind/css/screen.css | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/views/admin_sidebar.html.php b/modules/gallery/views/admin_sidebar.html.php index ea950b54..030dfdce 100644 --- a/modules/gallery/views/admin_sidebar.html.php +++ b/modules/gallery/views/admin_sidebar.html.php @@ -1,5 +1,9 @@ -
        + +

        -
        "> -
        -

        -
        -
          - -
        +
        +
        "> +
        +

        +
        +
          + +
        +
        -
        -
        -

        -
        -
          - -
        +
        +

        +
        +
          + +
        +
        diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css index 31de58f8..a889545b 100644 --- a/themes/admin_wind/css/screen.css +++ b/themes/admin_wind/css/screen.css @@ -424,16 +424,27 @@ li.g-default-group h4, li.g-default-group .g-user { /* Block admin ~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#g-admin-blocks .g-block { - clear: none; +.g-admin-blocks-list { + float: left; + margin: 0 2em 2em 0; width: 30%; } -#g-admin-blocks .g-block .g-draggable { - background: #e7e7e7; - /*border: 1px solid #fff;*/ - margin-bottom: 1em; - padding: .4em .8em; +.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: #e8e8e8; + margin: .5em; + padding: .3em .8em; } /** ******************************************************************* -- cgit v1.2.3 From e025abea4179bc059b8fef195bafe0c3f60f1220 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Tue, 20 Oct 2009 23:37:03 -0600 Subject: Added confirmation message for block admin actions. --- modules/gallery/views/admin_sidebar.html.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/views/admin_sidebar.html.php b/modules/gallery/views/admin_sidebar.html.php index 834429c3..f784b1a5 100644 --- a/modules/gallery/views/admin_sidebar.html.php +++ b/modules/gallery/views/admin_sidebar.html.php @@ -21,6 +21,10 @@ if (data.result == "success") { $("ul#g-available-blocks").html(data.available); $("ul#g-active-blocks").html(data.active); + var message = "Updated blocks"; + $("#g-action-status").remove(); + $("#g-block-admin").before("
        • " + message + "
        "); + $("#g-action-status").fadeTo(1000,1).fadeTo(2000,0); } }); } @@ -29,7 +33,7 @@ }); -
        +

        -- cgit v1.2.3 From ea2ab0c654c5b13c12ad424268d5755aa712dfc2 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 21 Oct 2009 09:32:27 -0700 Subject: Create a No_Direct_Access test which initially checks to insure there is no direct access to the users and groups table defined by the user module. --- modules/gallery/tests/File_Structure_Test.php | 36 ++++----------------------- 1 file changed, 5 insertions(+), 31 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php index 9018f4c6..327b6be8 100644 --- a/modules/gallery/tests/File_Structure_Test.php +++ b/modules/gallery/tests/File_Structure_Test.php @@ -17,6 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +require_once(dirname(__FILE__) . "/Gallery_Filters.php"); + class File_Structure_Test extends Unit_Test_Case { public function no_trailing_closing_php_tag_test() { $dir = new GalleryCodeFilterIterator( @@ -233,7 +235,9 @@ class File_Structure_Test extends Unit_Test_Case { foreach ($info_files as $file) { foreach (file($file) as $line) { $parts = explode("=", $line, 2); - $values[trim($parts[0])] = trim($parts[1]); + if (isset($parts[1])) { + $values[trim($parts[0])] = trim($parts[1]); + } } $module = dirname($file); @@ -261,33 +265,3 @@ class File_Structure_Test extends Unit_Test_Case { } } } - -class PhpCodeFilterIterator extends FilterIterator { - public function accept() { - $path_name = $this->getInnerIterator()->getPathName(); - return substr($path_name, -4) == ".php"; - } -} - -class GalleryCodeFilterIterator extends FilterIterator { - public function accept() { - // Skip anything that we didn"t write - $path_name = $this->getInnerIterator()->getPathName(); - return !( - strpos($path_name, ".svn") || - strpos($path_name, DOCROOT . "test") !== false || - strpos($path_name, DOCROOT . "var") !== false || - strpos($path_name, MODPATH . "forge") !== false || - strpos($path_name, MODPATH . "gallery/views/kohana_error_page.php") !== false || - strpos($path_name, MODPATH . "gallery/views/kohana_profiler.php") !== false || - strpos($path_name, MODPATH . "gallery_unit_test/views/kohana_error_page.php") !== false || - strpos($path_name, MODPATH . "gallery_unit_test/views/kohana_unit_test_cli.php") !== false || - strpos($path_name, MODPATH . "unit_test") !== false || - strpos($path_name, MODPATH . "exif/lib") !== false || - strpos($path_name, MODPATH . "user/lib/PasswordHash") !== false || - strpos($path_name, DOCROOT . "lib/swfupload") !== false || - strpos($path_name, SYSPATH) !== false || - strpos($path_name, MODPATH . "gallery/libraries/HTMLPurifier") !== false || - substr($path_name, -1, 1) == "~"); - } -} -- cgit v1.2.3 From b91da7472651ac5efab668ea6215a4fbaea43f0f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 21 Oct 2009 11:47:21 -0700 Subject: Correct phpDoc --- modules/gallery/helpers/photo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php index 6677ddc9..d1d8fb1f 100644 --- a/modules/gallery/helpers/photo.php +++ b/modules/gallery/helpers/photo.php @@ -26,7 +26,7 @@ class photo_Core { /** * Create a new photo. - * @param integer $parent_id id of parent album + * @param integer $parent parent album * @param string $filename path to the photo file on disk * @param string $name the filename to use for this photo in the album * @param integer $title the title of the new photo -- cgit v1.2.3 From 182c8414a1535f7f141ebca350a2b79d0d4a63ff Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 21 Oct 2009 11:48:40 -0700 Subject: Add the Gallery File Filters and a test to check that the user/group table is only accessed from the user module. --- modules/gallery/tests/Gallery_Filters.php | 48 +++++++++++++++ modules/gallery/tests/No_Direct_Access_Test.php | 77 +++++++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 modules/gallery/tests/Gallery_Filters.php create mode 100644 modules/gallery/tests/No_Direct_Access_Test.php (limited to 'modules/gallery') diff --git a/modules/gallery/tests/Gallery_Filters.php b/modules/gallery/tests/Gallery_Filters.php new file mode 100644 index 00000000..d1bc2cfa --- /dev/null +++ b/modules/gallery/tests/Gallery_Filters.php @@ -0,0 +1,48 @@ +getInnerIterator()->getPathName(); + return substr($path_name, -4) == ".php"; + } +} + +class GalleryCodeFilterIterator extends FilterIterator { + public function accept() { + // Skip anything that we didn"t write + $path_name = $this->getInnerIterator()->getPathName(); + return !( + strpos($path_name, ".svn") || + strpos($path_name, DOCROOT . "test") !== false || + strpos($path_name, DOCROOT . "var") !== false || + strpos($path_name, MODPATH . "forge") !== false || + strpos($path_name, MODPATH . "gallery/views/kohana_error_page.php") !== false || + strpos($path_name, MODPATH . "gallery/views/kohana_profiler.php") !== false || + strpos($path_name, MODPATH . "gallery_unit_test/views/kohana_error_page.php") !== false || + strpos($path_name, MODPATH . "gallery_unit_test/views/kohana_unit_test_cli.php") !== false || + strpos($path_name, MODPATH . "unit_test") !== false || + strpos($path_name, MODPATH . "exif/lib") !== false || + strpos($path_name, MODPATH . "user/lib/PasswordHash") !== false || + strpos($path_name, DOCROOT . "lib/swfupload") !== false || + strpos($path_name, SYSPATH) !== false || + strpos($path_name, MODPATH . "gallery/libraries/HTMLPurifier") !== false || + substr($path_name, -1, 1) == "~"); + } +} diff --git a/modules/gallery/tests/No_Direct_Access_Test.php b/modules/gallery/tests/No_Direct_Access_Test.php new file mode 100644 index 00000000..c6d8df95 --- /dev/null +++ b/modules/gallery/tests/No_Direct_Access_Test.php @@ -0,0 +1,77 @@ + $line) { + if (preg_match('/ORM::factory\\(\"user\"/', $line)) { + $errors[] = "$file($l) => $line"; + } + } + } + $file_as_string = null; + } + if ($errors) { + $this->assert_false(true, "Direct access to the users table found:\n" . join("\n", $errors)); + } + } + + public function no_access_to_groups_table_test() { + $dir = new UserModuleFilterIterator( + new PhpCodeFilterIterator( + new GalleryCodeFilterIterator( + new RecursiveIteratorIterator( + new RecursiveDirectoryIterator(DOCROOT))))); + $errors = array(); + foreach ($dir as $file) { + $file_as_string = file_get_contents($file); + if (preg_match("/ORM::factory\\(\"group\"/", $file_as_string)) { + foreach (split("\n", $file_as_string) as $l => $line) { + if (preg_match('/ORM::factory\\(\"group\"/', $line)) { + $errors[] = "$file($l) => $line"; + } + } + } + $file_as_string = null; + } + if ($errors) { + $this->assert_false(true, "Direct access to the groups table found:\n" . join("\n", $errors)); + } + } + +} + +class UserModuleFilterIterator extends FilterIterator { + public function accept() { + $path_name = $this->getInnerIterator()->getPathName(); + return strpos($path_name, "/modules/user") === false; + } +} -- cgit v1.2.3 From f04177f138df71e6317073b12b754a1c32d0c523 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 21 Oct 2009 11:49:42 -0700 Subject: re-add the lookup_group_by_name API Method. --- modules/gallery/libraries/Identity.php | 7 +++++++ modules/gallery/libraries/drivers/Identity.php | 11 +++++++++-- modules/user/libraries/drivers/Identity/Gallery.php | 13 ++++++++++--- 3 files changed, 26 insertions(+), 5 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/libraries/Identity.php b/modules/gallery/libraries/Identity.php index bfc523f4..1dd5d23b 100644 --- a/modules/gallery/libraries/Identity.php +++ b/modules/gallery/libraries/Identity.php @@ -199,6 +199,13 @@ class Identity_Core { return self::instance()->driver->lookup_group($id); } + /** + * @see Identity_Driver::lookup_group_by_name. + */ + static function lookup_group_by_name($name) { + return self::instance()->driver->lookup_group_by_name($name); + } + /** * @see Identity_Driver::get_user_list. */ diff --git a/modules/gallery/libraries/drivers/Identity.php b/modules/gallery/libraries/drivers/Identity.php index 5b35d49b..39b2a9c7 100644 --- a/modules/gallery/libraries/drivers/Identity.php +++ b/modules/gallery/libraries/drivers/Identity.php @@ -102,12 +102,19 @@ interface Identity_Driver { * @param integer id * @return Group_Definition the user object, or null if the name was invalid. */ - static function lookup_group($id); + public function lookup_group($id); + + /** + * 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); /** * List the groups defined in the Identity Provider */ - static function groups(); + public function groups(); } // End Identity Driver Definition diff --git a/modules/user/libraries/drivers/Identity/Gallery.php b/modules/user/libraries/drivers/Identity/Gallery.php index 17327c17..36f37543 100644 --- a/modules/user/libraries/drivers/Identity/Gallery.php +++ b/modules/user/libraries/drivers/Identity/Gallery.php @@ -118,16 +118,23 @@ class Identity_Gallery_Driver implements Identity_Driver { /** * @see Identity_Driver::lookup_group. */ - static function lookup_group($id) { + public function lookup_group($id) { return group::lookup_by_field("id", $id); } + /** + * @see Identity_Driver::lookup_group_by_name. + */ + public function lookup_group_by_name($name) { + return group::lookup_by_field("name", $name); + } + /** * @see Identity_Driver::get_user_list. */ public function get_user_list($ids) { return ORM::factory("user") - ->in("id", ids) + ->in("id", $ids) ->find_all() ->as_array(); } @@ -135,7 +142,7 @@ class Identity_Gallery_Driver implements Identity_Driver { /** * @see Identity_Driver::groups. */ - static function groups() { + public function groups() { return ORM::factory("group")->find_all(); } -- cgit v1.2.3 From b528fbde579b76cdab098a0319fdfbded93bee4a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 21 Oct 2009 11:50:42 -0700 Subject: Change this files to use the API instead of referencing the group tables directly --- modules/g2_import/helpers/g2_import.php | 2 +- modules/gallery/helpers/gallery_installer.php | 2 +- modules/notification/helpers/notification.php | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'modules/gallery') diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 8b48f727..d24aab93 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -301,7 +301,7 @@ class g2_import_Core { $user->admin = true; $message .= t("\n\tAdded 'admin' flag to user"); } else { - $group = ORM::factory("group", self::map($g2_group_id)); + $group = Identity::lookup_group(self::map($g2_group_id)); $user->add($group); $message .= t("\n\tAdded user to group '%group'.", array("group" => $group->name)); } diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index b1ea1f19..10e796fd 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -317,7 +317,7 @@ class gallery_installer { } if ($version == 7) { - $groups = ORM::factory("group")->find_all(); + $groups = Identity::groups(); $permissions = ORM::factory("permission")->find_all(); foreach($groups as $group) { foreach($permissions as $permission) { diff --git a/modules/notification/helpers/notification.php b/modules/notification/helpers/notification.php index 64eed8dc..080f154b 100644 --- a/modules/notification/helpers/notification.php +++ b/modules/notification/helpers/notification.php @@ -78,6 +78,9 @@ class notification { $subscriber_ids[] = $subscriber->user_id; } + if (empty($subscriber_ids)) { + return array(); + } $users = Identity::get_user_list($subscriber_ids); $subscribers = array(); -- cgit v1.2.3 From b994ea9d6274a6b479da06e9b97ed6e5126587c0 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 21 Oct 2009 11:53:41 -0700 Subject: use the appropriate API's --- modules/gallery/tests/Access_Helper_Test.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/tests/Access_Helper_Test.php b/modules/gallery/tests/Access_Helper_Test.php index b3b5ed30..dac431a7 100644 --- a/modules/gallery/tests/Access_Helper_Test.php +++ b/modules/gallery/tests/Access_Helper_Test.php @@ -22,8 +22,8 @@ class Access_Helper_Test extends Unit_Test_Case { public function teardown() { try { - $group = ORM::factory("group")->where("name", "access_test")->find(); - if ($group->loaded) { + $group = Identity::lookup_group_by_name("access_test"); + if (!empty($group)) { $group->delete(); } } catch (Exception $e) { } @@ -34,7 +34,7 @@ class Access_Helper_Test extends Unit_Test_Case { try { $user = Identity::lookup_user_by_name("access_test"); - if ($user->loaded) { + if (!empty($user)) { $user->delete(); } } catch (Exception $e) { } @@ -123,10 +123,7 @@ class Access_Helper_Test extends Unit_Test_Case { $album = album::create($root, rand(), "test album"); access::allow(Identity::everybody(), "view", $album); - $photo = ORM::factory("item"); - $photo->type = "photo"; - $photo->add_to_parent($album); - access::add_item($photo); + $photo = photo::create($album, MODPATH . "gallery/images/gallery.png", "", ""); $this->assert_true($photo->__get("view_" . Identity::everybody()->id)); } -- cgit v1.2.3 From 7638834e97be905efd80acff6312330db34ba0bc Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 21 Oct 2009 15:17:23 -0700 Subject: Address the issue of the administrator changing the identity provider whilst users are logged onto the system. Addressed the issue by adding try/catch logic to the Session::load_user() method. If load_user fails for any reason, then assume that the identity provider has changed, destroy the current session and redirect to the root album. --- modules/gallery/libraries/MY_Session.php | 43 +++++++++++++++++++------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/libraries/MY_Session.php b/modules/gallery/libraries/MY_Session.php index 6394c0fb..1a3ae801 100644 --- a/modules/gallery/libraries/MY_Session.php +++ b/modules/gallery/libraries/MY_Session.php @@ -23,26 +23,35 @@ class Session extends Session_Core { * Make sure that we have a session and group_ids cached in the session. */ static function load_user() { - $session = Session::instance(); - if (!($user = $session->get("user"))) { - $session->set("user", $user = Identity::guest()); - } + try { + $session = Session::instance(); + if (!($user = $session->get("user"))) { + $session->set("user", $user = Identity::guest()); + } - // The installer cannot set a user into the session, so it just sets an id which we should - // upconvert into a user. - // @todo set the user name into the session instead of 2 and then use it to get the user object - if ($user === 2) { - $user = Instance::lookup_user_by_name("admin"); - self::set_active_user($user); - $session->set("user", $user); - } + // The installer cannot set a user into the session, so it just sets an id which we should + // upconvert into a user. + // @todo set the user name into the session instead of 2 and then use it to get the user object + if ($user === 2) { + $user = Instance::lookup_user_by_name("admin"); + self::set_active_user($user); + $session->set("user", $user); + } - if (!$session->get("group_ids")) { - $ids = array(); - foreach ($user->groups as $group) { - $ids[] = $group->id; + if (!$session->get("group_ids")) { + $ids = array(); + foreach ($user->groups as $group) { + $ids[] = $group->id; + } + $session->set("group_ids", $ids); + } + } catch (Exception $e) { + try { + Session::instance()->destroy(); + } catch (Exception $e) { + // We don't care if there was a problem destroying the session. } - $session->set("group_ids", $ids); + url::redirect(item::root()->abs_url()); } } -- cgit v1.2.3 From 5e4576632d0938cc7c2947db6ee35a7d59fb6edf Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 21 Oct 2009 16:02:34 -0700 Subject: Correct white space --- modules/gallery/controllers/login.php | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/login.php b/modules/gallery/controllers/login.php index 96a97a1d..4c83d647 100644 --- a/modules/gallery/controllers/login.php +++ b/modules/gallery/controllers/login.php @@ -53,6 +53,7 @@ class Login_Controller extends Controller { print $form; } } + private function _auth($url) { $form = login::get_login_form($url); $valid = $form->validate(); -- cgit v1.2.3 From 416470fcb2063359bcf5bd2f11c4ae82e1cf43be Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 22 Oct 2009 07:35:26 -0700 Subject: Internationalize confirmation message. --- modules/gallery/views/admin_sidebar.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery') diff --git a/modules/gallery/views/admin_sidebar.html.php b/modules/gallery/views/admin_sidebar.html.php index f784b1a5..67752f75 100644 --- a/modules/gallery/views/admin_sidebar.html.php +++ b/modules/gallery/views/admin_sidebar.html.php @@ -21,7 +21,7 @@ if (data.result == "success") { $("ul#g-available-blocks").html(data.available); $("ul#g-active-blocks").html(data.active); - var message = "Updated blocks"; + var message = for_js() ?>; $("#g-action-status").remove(); $("#g-block-admin").before("

        • " + message + "
        "); $("#g-action-status").fadeTo(1000,1).fadeTo(2000,0); -- cgit v1.2.3 From 95f3eb3aad3700c883ef6d865ae8d6512883b432 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 22 Oct 2009 07:37:14 -0700 Subject: When an album or photo is updated always return the photo/album location as part of the response. This insures that if the internet address changes, then the page will reload properly. --- modules/gallery/controllers/albums.php | 3 ++- modules/gallery/controllers/photos.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index 9733d1cd..ae4ad395 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -216,7 +216,8 @@ class Albums_Controller extends Items_Controller { array("album_title" => html::purify($album->title)))); print json_encode( - array("result" => "success")); + array("result" => "success", + "location" => $album->url())); } else { print json_encode( array("result" => "error", diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php index fbff53ce..6bb5af89 100644 --- a/modules/gallery/controllers/photos.php +++ b/modules/gallery/controllers/photos.php @@ -113,7 +113,8 @@ class Photos_Controller extends Items_Controller { array("photo_title" => html::purify($photo->title)))); print json_encode( - array("result" => "success")); + array("result" => "success", + "location" => $photo->url())); } else { print json_encode( array("result" => "error", -- cgit v1.2.3 From 4cb9ec1d6d37b49ebafc68d0a94d794a1acb8b28 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 22 Oct 2009 10:09:25 -0700 Subject: Use the request::referrer to determine if we are editting the photo or album from the context menu or from its photo or album page. Fixes ticket #745. Thanks to jankoprowski for the referrer approach. --- modules/gallery/controllers/albums.php | 4 +++- modules/gallery/controllers/photos.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index 9480a037..fabf67ce 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -200,6 +200,8 @@ class Albums_Controller extends Items_Controller { } if ($valid) { + $watching_album = $album->url() != ($location = parse_url(request::referrer(), PHP_URL_PATH)); + $album->title = $form->edit_item->title->value; $album->description = $form->edit_item->description->value; $album->sort_column = $form->edit_item->sort_order->column->value; @@ -217,7 +219,7 @@ class Albums_Controller extends Items_Controller { print json_encode( array("result" => "success", - "location" => $album->url())); + "location" => $watching_album ? $location : $album->url())); } else { print json_encode( array("result" => "error", diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php index 6bb5af89..54cd63c6 100644 --- a/modules/gallery/controllers/photos.php +++ b/modules/gallery/controllers/photos.php @@ -100,6 +100,8 @@ class Photos_Controller extends Items_Controller { } if ($valid) { + $watching_album = $photo->url() != ($location = parse_url(request::referrer(), PHP_URL_PATH)); + $photo->title = $form->edit_item->title->value; $photo->description = $form->edit_item->description->value; $photo->slug = $form->edit_item->slug->value; @@ -114,7 +116,7 @@ class Photos_Controller extends Items_Controller { print json_encode( array("result" => "success", - "location" => $photo->url())); + "location" => $watching_album ? $location : $photo->url())); } else { print json_encode( array("result" => "error", -- cgit v1.2.3 From 3c936d661a088fb43b47eb5b208958180e8f65eb Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 22 Oct 2009 13:09:20 -0700 Subject: Change the name of identity library from Identity to IdentityProvider. Create a helper class called identity to simplify call the Identity Provider. Move the contents of MY_Session.php to the new helper class and remove the MY_Session class --- modules/akismet/tests/Akismet_Helper_Test.php | 2 +- modules/comment/controllers/comments.php | 8 +- modules/comment/helpers/comment.php | 2 +- modules/comment/models/comment.php | 2 +- modules/comment/tests/Comment_Event_Test.php | 2 +- modules/comment/tests/Comment_Helper_Test.php | 4 +- modules/comment/tests/Comment_Model_Test.php | 8 +- modules/digibug/controllers/digibug.php | 2 +- modules/digibug/tests/Digibug_Controller_Test.php | 4 +- modules/g2_import/helpers/g2_import.php | 16 +- modules/gallery/controllers/admin.php | 2 +- modules/gallery/controllers/admin_identity.php | 10 +- modules/gallery/controllers/albums.php | 4 +- modules/gallery/controllers/l10n_client.php | 4 +- modules/gallery/controllers/login.php | 8 +- modules/gallery/controllers/logout.php | 2 +- modules/gallery/controllers/permissions.php | 6 +- modules/gallery/controllers/upgrader.php | 4 +- modules/gallery/controllers/welcome_message.php | 4 +- modules/gallery/helpers/access.php | 4 +- modules/gallery/helpers/gallery.php | 2 +- modules/gallery/helpers/gallery_event.php | 10 +- modules/gallery/helpers/gallery_installer.php | 2 +- modules/gallery/helpers/gallery_theme.php | 2 +- modules/gallery/helpers/identity.php | 225 +++++++++++++++++++++ modules/gallery/helpers/item.php | 4 +- modules/gallery/helpers/locales.php | 2 +- modules/gallery/helpers/log.php | 2 +- modules/gallery/helpers/movie.php | 2 +- modules/gallery/helpers/photo.php | 2 +- modules/gallery/helpers/site_status.php | 2 +- modules/gallery/helpers/task.php | 2 +- modules/gallery/libraries/Admin_View.php | 4 +- modules/gallery/libraries/Identity.php | 222 -------------------- modules/gallery/libraries/IdentityProvider.php | 200 ++++++++++++++++++ modules/gallery/libraries/MY_Session.php | 93 --------- modules/gallery/libraries/Theme_View.php | 6 +- modules/gallery/libraries/drivers/Identity.php | 123 ----------- .../gallery/libraries/drivers/IdentityProvider.php | 123 +++++++++++ modules/gallery/models/item.php | 2 +- modules/gallery/models/log.php | 2 +- modules/gallery/models/task.php | 2 +- modules/gallery/tests/Access_Helper_Test.php | 144 ++++++------- modules/gallery/tests/Albums_Controller_Test.php | 4 +- modules/gallery/tests/Item_Helper_Test.php | 6 +- modules/gallery/tests/Photos_Controller_Test.php | 6 +- modules/gallery/views/kohana_error_page.php | 2 +- modules/gallery/views/login.html.php | 2 +- modules/gallery/views/login_ajax.html.php | 2 +- modules/notification/helpers/notification.php | 10 +- .../notification/helpers/notification_event.php | 2 +- modules/search/helpers/search.php | 4 +- modules/server_add/controllers/server_add.php | 4 +- modules/server_add/helpers/server_add_event.php | 2 +- modules/server_add/helpers/server_add_theme.php | 2 +- modules/user/controllers/admin_users.php | 6 +- modules/user/controllers/password.php | 2 +- modules/user/controllers/users.php | 4 +- modules/user/helpers/group.php | 18 +- .../user/libraries/drivers/Identity/Gallery.php | 150 -------------- .../libraries/drivers/IdentityProvider/Gallery.php | 150 ++++++++++++++ modules/user/views/admin_users.html.php | 2 +- 62 files changed, 885 insertions(+), 769 deletions(-) create mode 100644 modules/gallery/helpers/identity.php delete mode 100644 modules/gallery/libraries/Identity.php create mode 100644 modules/gallery/libraries/IdentityProvider.php delete mode 100644 modules/gallery/libraries/MY_Session.php delete mode 100644 modules/gallery/libraries/drivers/Identity.php create mode 100644 modules/gallery/libraries/drivers/IdentityProvider.php delete mode 100644 modules/user/libraries/drivers/Identity/Gallery.php create mode 100644 modules/user/libraries/drivers/IdentityProvider/Gallery.php (limited to 'modules/gallery') diff --git a/modules/akismet/tests/Akismet_Helper_Test.php b/modules/akismet/tests/Akismet_Helper_Test.php index 6788e7a3..745b455c 100644 --- a/modules/akismet/tests/Akismet_Helper_Test.php +++ b/modules/akismet/tests/Akismet_Helper_Test.php @@ -26,7 +26,7 @@ class Akismet_Helper_Test extends Unit_Test_Case { $root = ORM::factory("item", 1); $this->_comment = comment::create( - $root, Identity::guest(), "This is a comment", + $root, identity::guest(), "This is a comment", "John Doe", "john@gallery2.org", "http://gallery2.org"); foreach ($this->_comment->list_fields("comments") as $name => $field) { if (strpos($name, "server_") === 0) { diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php index c0658cc1..09b9c607 100644 --- a/modules/comment/controllers/comments.php +++ b/modules/comment/controllers/comments.php @@ -65,7 +65,7 @@ class Comments_Controller extends REST_Controller { $form = comment::get_add_form($item); $valid = $form->validate(); if ($valid) { - if (Session::active_user()->guest && !$form->add_comment->inputs["name"]->value) { + if (identity::active_user()->guest && !$form->add_comment->inputs["name"]->value) { $form->add_comment->inputs["name"]->add_error("missing", 1); $valid = false; } @@ -78,13 +78,13 @@ class Comments_Controller extends REST_Controller { if ($valid) { $comment = comment::create( - $item, Session::active_user(), + $item, identity::active_user(), $form->add_comment->text->value, $form->add_comment->inputs["name"]->value, $form->add_comment->email->value, $form->add_comment->url->value); - $active = Session::active_user(); + $active = identity::active_user(); if ($active->guest) { $form->add_comment->inputs["name"]->value(""); $form->add_comment->email->value(""); @@ -192,7 +192,7 @@ class Comments_Controller extends REST_Controller { * @see REST_Controller::form_edit($resource) */ public function _form_edit($comment) { - if (!Session::active_user()->admin) { + if (!identity::active_user()->admin) { access::forbidden(); } print comment::get_edit_form($comment); diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php index e741266d..53d58afa 100644 --- a/modules/comment/helpers/comment.php +++ b/modules/comment/helpers/comment.php @@ -75,7 +75,7 @@ class comment_Core { module::event("comment_add_form", $form); $group->submit("")->value(t("Add")); - $active = Session::active_user(); + $active = identity::active_user(); if (!$active->guest) { $group->inputs["name"]->value($active->full_name)->disabled("disabled"); $group->email->value($active->email)->disabled("disabled"); diff --git a/modules/comment/models/comment.php b/modules/comment/models/comment.php index 5e29e778..bb9b8833 100644 --- a/modules/comment/models/comment.php +++ b/modules/comment/models/comment.php @@ -23,7 +23,7 @@ class Comment_Model extends ORM { } function author() { - return Identity::lookup_user($this->author_id); + return identity::lookup_user($this->author_id); } function author_name() { diff --git a/modules/comment/tests/Comment_Event_Test.php b/modules/comment/tests/Comment_Event_Test.php index eb301893..f650cabf 100644 --- a/modules/comment/tests/Comment_Event_Test.php +++ b/modules/comment/tests/Comment_Event_Test.php @@ -22,7 +22,7 @@ class Comment_Event_Test extends Unit_Test_Case { $rand = rand(); $album = album::create(ORM::factory("item", 1), "test_$rand", "test_$rand"); $comment = comment::create( - $album, Identity::guest(), "text_$rand", "name_$rand", "email_$rand", "url_$rand"); + $album, identity::guest(), "text_$rand", "name_$rand", "email_$rand", "url_$rand"); $album->delete(); diff --git a/modules/comment/tests/Comment_Helper_Test.php b/modules/comment/tests/Comment_Helper_Test.php index e8ab7c79..c635c3b7 100644 --- a/modules/comment/tests/Comment_Helper_Test.php +++ b/modules/comment/tests/Comment_Helper_Test.php @@ -48,7 +48,7 @@ class Comment_Helper_Test extends Unit_Test_Case { $rand = rand(); $root = ORM::factory("item", 1); $comment = comment::create( - $root, Identity::guest(), "text_$rand", "name_$rand", "email_$rand", "url_$rand"); + $root, identity::guest(), "text_$rand", "name_$rand", "email_$rand", "url_$rand"); $this->assert_equal("name_$rand", $comment->author_name()); $this->assert_equal("email_$rand", $comment->author_email()); @@ -77,7 +77,7 @@ class Comment_Helper_Test extends Unit_Test_Case { public function create_comment_for_user_test() { $rand = rand(); $root = ORM::factory("item", 1); - $admin = Identity::lookup_user(2); + $admin = identity::lookup_user(2); $comment = comment::create( $root, $admin, "text_$rand", "name_$rand", "email_$rand", "url_$rand"); diff --git a/modules/comment/tests/Comment_Model_Test.php b/modules/comment/tests/Comment_Model_Test.php index 84532a96..de19648d 100644 --- a/modules/comment/tests/Comment_Model_Test.php +++ b/modules/comment/tests/Comment_Model_Test.php @@ -22,17 +22,17 @@ class Comment_Model_Test extends Unit_Test_Case { public function cant_view_comments_for_unviewable_items_test() { $root = ORM::factory("item", 1); $album = album::create($root, rand(), rand(), rand()); - $comment = comment::create($album, Identity::guest(), "text", "name", "email", "url"); - Session::set_active_user(Identity::guest()); + $comment = comment::create($album, identity::guest(), "text", "name", "email", "url"); + identity::set_active_user(identity::guest()); // We can see the comment when permissions are granted on the album - access::allow(Identity::everybody(), "view", $album); + access::allow(identity::everybody(), "view", $album); $this->assert_equal( 1, ORM::factory("comment")->viewable()->where("comments.id", $comment->id)->count_all()); // We can't see the comment when permissions are denied on the album - access::deny(Identity::everybody(), "view", $album); + access::deny(identity::everybody(), "view", $album); $this->assert_equal( 0, ORM::factory("comment")->viewable()->where("comments.id", $comment->id)->count_all()); diff --git a/modules/digibug/controllers/digibug.php b/modules/digibug/controllers/digibug.php index 8ea83601..1bb2691b 100644 --- a/modules/digibug/controllers/digibug.php +++ b/modules/digibug/controllers/digibug.php @@ -23,7 +23,7 @@ class Digibug_Controller extends Controller { $item = ORM::factory("item", $id); access::required("view", $item); - if (access::group_can(Identity::everybody(), "view_full", $item)) { + if (access::group_can(identity::everybody(), "view_full", $item)) { $full_url = $item->file_url(true); $thumb_url = $item->thumb_url(true); } else { diff --git a/modules/digibug/tests/Digibug_Controller_Test.php b/modules/digibug/tests/Digibug_Controller_Test.php index 19f57972..a56d58bb 100644 --- a/modules/digibug/tests/Digibug_Controller_Test.php +++ b/modules/digibug/tests/Digibug_Controller_Test.php @@ -35,8 +35,8 @@ class Digibug_Controller_Test extends Unit_Test_Case { $root = ORM::factory("item", 1); $this->_album = album::create($root, rand(), "test album"); - access::deny(Identity::everybody(), "view_full", $this->_album); - access::deny(Identity::registered_users(), "view_full", $this->_album); + access::deny(identity::everybody(), "view_full", $this->_album); + access::deny(identity::registered_users(), "view_full", $this->_album); $rand = rand(); $this->_item = photo::create($this->_album, MODPATH . "gallery/tests/test.jpg", "$rand.jpg", diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index d24aab93..f55e7f32 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -230,16 +230,16 @@ class g2_import_Core { switch ($g2_group->getGroupType()) { case GROUP_NORMAL: try { - $group = Identity::create_group($g2_group->getGroupName()); + $group = identity::create_group($g2_group->getGroupName()); } catch (Exception $e) { // @todo For now we assume this is a "duplicate group" exception - $group = Identity::lookup_user_by_name($g2_group->getGroupname()); + $group = identity::lookup_user_by_name($g2_group->getGroupname()); } $message = t("Group '%name' was imported", array("name" => $g2_group->getGroupname())); break; case GROUP_ALL_USERS: - $group = Identity::registered_users(); + $group = identity::registered_users(); $message = t("Group 'Registered' was converted to '%name'", array("name" => $group->name)); break; @@ -248,7 +248,7 @@ class g2_import_Core { break; // This is not a group in G3 case GROUP_EVERYBODY: - $group = Identity::everybody(); + $group = identity::everybody(); $message = t("Group 'Everybody' was converted to '%name'", array("name" => $group->name)); break; } @@ -270,7 +270,7 @@ class g2_import_Core { } if (g2(GalleryCoreApi::isAnonymousUser($g2_user_id))) { - self::set_map($g2_user_id, Identity::guest()->id); + self::set_map($g2_user_id, identity::guest()->id); return t("Skipping Anonymous User"); } @@ -285,11 +285,11 @@ class g2_import_Core { $g2_groups = g2(GalleryCoreApi::fetchGroupsForUser($g2_user->getId())); try { - $user = Identity::create_user($g2_user->getUsername(), $g2_user->getfullname(), ""); + $user = identity::create_user($g2_user->getUsername(), $g2_user->getfullname(), ""); $message = t("Created user: '%name'.", array("name" => $user->name)); } catch (Exception $e) { // @todo For now we assume this is a "duplicate user" exception - $user = Identity::lookup_user_by_name($g2_user->getUsername()); + $user = identity::lookup_user_by_name($g2_user->getUsername()); $message = t("Loaded existing user: '%name'.", array("name" => $user->name)); } @@ -301,7 +301,7 @@ class g2_import_Core { $user->admin = true; $message .= t("\n\tAdded 'admin' flag to user"); } else { - $group = Identity::lookup_group(self::map($g2_group_id)); + $group = identity::lookup_group(self::map($g2_group_id)); $user->add($group); $message .= t("\n\tAdded user to group '%group'.", array("group" => $group->name)); } diff --git a/modules/gallery/controllers/admin.php b/modules/gallery/controllers/admin.php index 24eebe7d..98cac557 100644 --- a/modules/gallery/controllers/admin.php +++ b/modules/gallery/controllers/admin.php @@ -21,7 +21,7 @@ class Admin_Controller extends Controller { private $theme; public function __construct($theme=null) { - if (!(Session::active_user()->admin)) { + if (!(identity::active_user()->admin)) { access::forbidden(); } diff --git a/modules/gallery/controllers/admin_identity.php b/modules/gallery/controllers/admin_identity.php index 9d756a5c..d06132ff 100644 --- a/modules/gallery/controllers/admin_identity.php +++ b/modules/gallery/controllers/admin_identity.php @@ -21,7 +21,7 @@ class Admin_Identity_Controller extends Admin_Controller { public function index() { $view = new Admin_View("admin.html"); $view->content = new View("admin_identity.html"); - $view->content->available = Identity::providers(); + $view->content->available = identity::providers(); $view->content->active = module::get_var("gallery", "identity_provider", "user"); print $view; } @@ -39,7 +39,7 @@ class Admin_Identity_Controller extends Admin_Controller { access::verify_csrf(); $active_provider = module::get_var("gallery", "identity_provider", "user"); - $providers = Identity::providers(); + $providers = identity::providers(); $new_provider = $this->input->post("provider"); @@ -47,13 +47,13 @@ class Admin_Identity_Controller extends Admin_Controller { module::event("pre_identity_change", $active_provider, $new_provider); - Identity::deactivate(); + identity::deactivate(); // Switch authentication module::set_var("gallery", "identity_provider", $new_provider); - Identity::reset(); + identity::reset(); - Identity::activate(); + identity::activate(); // @todo this type of collation is questionable from an i18n perspective message::success(t("Changed to %description", diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index fabf67ce..24ceb0c9 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -111,7 +111,7 @@ class Albums_Controller extends Items_Controller { $this->input->post("name"), $this->input->post("title", $this->input->post("name")), $this->input->post("description"), - Session::active_user()->id, + identity::active_user()->id, $this->input->post("slug")); log::success("content", "Created an album", @@ -146,7 +146,7 @@ class Albums_Controller extends Items_Controller { $_FILES["file"]["name"], $this->input->post("title", $this->input->post("name")), $this->input->post("description"), - Session::active_user()->id); + identity::active_user()->id); log::success("content", "Added a photo", html::anchor("photos/$photo->id", "view photo")); message::success(t("Added photo %photo_title", diff --git a/modules/gallery/controllers/l10n_client.php b/modules/gallery/controllers/l10n_client.php index 2ab73102..6db67d3b 100644 --- a/modules/gallery/controllers/l10n_client.php +++ b/modules/gallery/controllers/l10n_client.php @@ -20,7 +20,7 @@ class L10n_Client_Controller extends Controller { public function save() { access::verify_csrf(); - if (!Session::active_user()->admin) { + if (!identity::active_user()->admin) { access::forbidden(); } @@ -85,7 +85,7 @@ class L10n_Client_Controller extends Controller { public function toggle_l10n_mode() { access::verify_csrf(); - if (!Session::active_user()->admin) { + if (!identity::active_user()->admin) { access::forbidden(); } diff --git a/modules/gallery/controllers/login.php b/modules/gallery/controllers/login.php index 4c83d647..86e2b0a4 100644 --- a/modules/gallery/controllers/login.php +++ b/modules/gallery/controllers/login.php @@ -58,8 +58,8 @@ class Login_Controller extends Controller { $form = login::get_login_form($url); $valid = $form->validate(); if ($valid) { - $user = Identity::lookup_user_by_name($form->login->inputs["name"]->value); - if (empty($user) || !Identity::is_correct_password($user, $form->login->password->value)) { + $user = identity::lookup_user_by_name($form->login->inputs["name"]->value); + if (empty($user) || !identity::is_correct_password($user, $form->login->password->value)) { log::warning( "user", t("Failed login for %name", @@ -70,12 +70,12 @@ class Login_Controller extends Controller { } if ($valid) { - if (Identity::is_writable()) { + if (identity::is_writable()) { $user->login_count += 1; $user->last_login = time(); $user->save(); } - Session::set_active_user($user); + identity::set_active_user($user); log::info("user", t("User %name logged in", array("name" => $user->name))); } diff --git a/modules/gallery/controllers/logout.php b/modules/gallery/controllers/logout.php index 058860fa..1b0364fd 100644 --- a/modules/gallery/controllers/logout.php +++ b/modules/gallery/controllers/logout.php @@ -19,7 +19,7 @@ */ class Logout_Controller extends Controller { public function index() { - $user = Session::active_user(); + $user = identity::active_user(); if (!$user->guest) { try { Session::instance()->destroy(); diff --git a/modules/gallery/controllers/permissions.php b/modules/gallery/controllers/permissions.php index 58c5b816..99943fbb 100644 --- a/modules/gallery/controllers/permissions.php +++ b/modules/gallery/controllers/permissions.php @@ -51,7 +51,7 @@ class Permissions_Controller extends Controller { function change($command, $group_id, $perm_id, $item_id) { access::verify_csrf(); - $group = Identity::lookup_group($group_id); + $group = identity::lookup_group($group_id); $perm = ORM::factory("permission", $perm_id); $item = ORM::factory("item", $item_id); access::required("view", $item); @@ -74,7 +74,7 @@ class Permissions_Controller extends Controller { // If the active user just took away their own edit permissions, give it back. if ($perm->name == "edit") { - if (!access::user_can(Session::active_user(), "edit", $item)) { + if (!access::user_can(identity::active_user(), "edit", $item)) { access::allow($group, $perm->name, $item); } } @@ -84,7 +84,7 @@ class Permissions_Controller extends Controller { private function _get_form($item) { $view = new View("permissions_form.html"); $view->item = $item; - $view->groups = Identity::groups(); + $view->groups = identity::groups(); $view->permissions = ORM::factory("permission")->find_all(); return $view; } diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php index e0c5d340..1aa607ef 100644 --- a/modules/gallery/controllers/upgrader.php +++ b/modules/gallery/controllers/upgrader.php @@ -40,7 +40,7 @@ class Upgrader_Controller extends Controller { } $view = new View("upgrader.html"); - $view->can_upgrade = Session::active_user()->admin || $session->get("can_upgrade"); + $view->can_upgrade = identity::active_user()->admin || $session->get("can_upgrade"); $view->upgrade_token = $upgrade_token; $view->available = module::available(); $view->done = ($available_upgrades == 0); @@ -52,7 +52,7 @@ class Upgrader_Controller extends Controller { // @todo this may screw up some module installers, but we don't have a better answer at // this time. $_SERVER["HTTP_HOST"] = "example.com"; - } else if (!Session::active_user()->admin && !Session::instance()->get("can_upgrade", false)) { + } else if (!identity::active_user()->admin && !Session::instance()->get("can_upgrade", false)) { access::forbidden(); } diff --git a/modules/gallery/controllers/welcome_message.php b/modules/gallery/controllers/welcome_message.php index cfdc3976..af0d6997 100644 --- a/modules/gallery/controllers/welcome_message.php +++ b/modules/gallery/controllers/welcome_message.php @@ -19,12 +19,12 @@ */ class Welcome_Message_Controller extends Controller { public function index() { - if (!Session::active_user()->admin) { + if (!identity::active_user()->admin) { url::redirect(item::root()->abs_url()); } $v = new View("welcome_message.html"); - $v->user = Session::active_user(); + $v->user = identity::active_user(); print $v; } } diff --git a/modules/gallery/helpers/access.php b/modules/gallery/helpers/access.php index 4e7491e3..a3abbe2e 100644 --- a/modules/gallery/helpers/access.php +++ b/modules/gallery/helpers/access.php @@ -79,7 +79,7 @@ class access_Core { * @return boolean */ static function can($perm_name, $item) { - return self::user_can(Session::active_user(), $perm_name, $item); + return self::user_can(identity::active_user(), $perm_name, $item); } /** @@ -423,7 +423,7 @@ class access_Core { // This is ok at packaging time, so work around it. $config = module::get_var("gallery", "identity_provider"); if (!empty($config)) { - return Identity::groups(); + return identity::groups(); } else { return array(); } diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 18bb2609..84f8a7fb 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -27,7 +27,7 @@ class gallery_Core { static function maintenance_mode() { $maintenance_mode = Kohana::config("core.maintenance_mode", false, false); - if (Router::$controller != "login" && !empty($maintenance_mode) && !Session::active_user()->admin) { + if (Router::$controller != "login" && !empty($maintenance_mode) && !identity::active_user()->admin) { Router::$controller = "maintenance"; Router::$controller_path = MODPATH . "gallery/controllers/maintenance.php"; Router::$method = "index"; diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 95be4813..b6afa2c8 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -23,11 +23,7 @@ class gallery_event_Core { * Initialization. */ static function gallery_ready() { - // Call Identity::instance() now to force the load of the user interface classes. - // Session::load_user will attempt to load the active user from the session and needs - // the user definition class, which can't be reached by Kohana's heiracrchical lookup. - Identity::instance(); - Session::load_user(); + identity::load_user(); locales::set_request_locale(); } @@ -139,7 +135,7 @@ class gallery_event_Core { } } - if (Session::active_user()->admin) { + if (identity::active_user()->admin) { $menu->append($admin_menu = Menu::factory("submenu") ->id("admin_menu") ->label(t("Admin"))); @@ -191,7 +187,7 @@ class gallery_event_Core { ->id("sidebar") ->label(t("Manage Sidebar")) ->url(url::site("admin/sidebar")))); - if (count(Identity::providers()) > 1) { + if (count(identity::providers()) > 1) { $menu ->append(Menu::factory("submenu") ->id("identity_menu") diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 10e796fd..9c19eaed 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -317,7 +317,7 @@ class gallery_installer { } if ($version == 7) { - $groups = Identity::groups(); + $groups = identity::groups(); $permissions = ORM::factory("permission")->find_all(); foreach($groups as $group) { foreach($permissions as $permission) { diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index d21cb124..5f3eb2a9 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -54,7 +54,7 @@ class gallery_theme_Core { static function header_top($theme) { if ($theme->page_type != "login") { $view = new View("login.html"); - $view->user = Session::active_user(); + $view->user = identity::active_user(); return $view->render(); } } diff --git a/modules/gallery/helpers/identity.php b/modules/gallery/helpers/identity.php new file mode 100644 index 00000000..cf84c8a9 --- /dev/null +++ b/modules/gallery/helpers/identity.php @@ -0,0 +1,225 @@ + $module) { + if (file_exists(MODPATH . "{$module_name}/config/identity.php")) { + $drivers->$module_name = $module->description; + } + } + self::$available = $drivers; + } + return self::$available; + } + + /** + * Make sure that we have a session and group_ids cached in the session. + */ + static function load_user() { + //try { + // Call IdentityProvider::instance() now to force the load of the user interface classes. + // We are about to load the active user from the session and which needs the user definition + // class, which can't be reached by Kohana's heiracrchical lookup. + IdentityProvider::instance(); + + $session = Session::instance(); + if (!($user = $session->get("user"))) { + self::set_active_user($user = self::guest()); + } + + // The installer cannot set a user into the session, so it just sets an id which we should + // upconvert into a user. + // @todo set the user name into the session instead of 2 and then use it to get the user object + if ($user === 2) { + $user = IdentityProvider::instance()->lookup_user_by_name("admin"); + self::set_active_user($user); + $session->set("user", $user); + } + + if (!$session->get("group_ids")) { + $ids = array(); + foreach ($user->groups as $group) { + $ids[] = $group->id; + } + $session->set("group_ids", $ids); + } + //} catch (Exception $e) { + //try { + //Session::instance()->destroy(); + //} catch (Exception $e) { + // We don't care if there was a problem destroying the session. + //} + //url::redirect(item::root()->abs_url()); + //} + } + + /** + * Return the array of group ids this user belongs to + * + * @return array + */ + static function group_ids_for_active_user() { + return Session::instance()->get("group_ids", array(1)); + } + + /** + * Return the active user. If there's no active user, return the guest user. + * + * @return User_Definition + */ + static function active_user() { + // @todo (maybe) cache this object so we're not always doing session lookups. + $user = Session::instance()->get("user", null); + if (!isset($user)) { + // Don't do this as a fallback in the Session::get() call because it can trigger unnecessary + // work. + $user = identity::guest(); + } + return $user; + } + + /** + * Change the active user. + * @param User_Definition $user + */ + static function set_active_user($user) { + $session = Session::instance(); + $session->set("user", $user); + $session->delete("group_ids"); + self::load_user(); + } + + /** + * Determine if if the current driver supports updates. + * + * @return boolean true if the driver supports updates; false if read only + */ + static function is_writable() { + return IdentityProvider::instance()->is_writable(); + } + + /** + * @see IdentityProvider_Driver::activate. + */ + static function activate() { + IdentityProvider::instance()->activate(); + } + + /** + * @see IdentityProvider_Driver::deactivate. + */ + static function deactivate() { + IdentityProvider::instance()->deactivate(); + } + + /** + * @see IdentityProvider_Driver::guest. + */ + static function guest() { + return IdentityProvider::instance()->guest(); + } + + /** + * @see IdentityProvider_Driver::create_user. + */ + static function create_user($name, $full_name, $password) { + return IdentityProvider::instance()->create_user($name, $full_name, $password); + } + + /** + * @see IdentityProvider_Driver::is_correct_password. + */ + static function is_correct_password($user, $password) { + return IdentityProvider::instance()->is_correct_password($user, $password); + } + + /** + * @see IdentityProvider_Driver::lookup_user. + */ + static function lookup_user($id) { + return IdentityProvider::instance()->lookup_user($id); + } + + /** + * @see IdentityProvider_Driver::lookup_user_by_name. + */ + static function lookup_user_by_name($name) { + return IdentityProvider::instance()->lookup_user_by_name($name); + } + + /** + * @see IdentityProvider_Driver::create_group. + */ + static function create_group($name) { + return IdentityProvider::instance()->create_group($name); + } + + /** + * @see IdentityProvider_Driver::everybody. + */ + static function everybody() { + return IdentityProvider::instance()->everybody(); + } + + /** + * @see IdentityProvider_Driver::registered_users. + */ + static function registered_users() { + return IdentityProvider::instance()->everybody(); + } + + /** + * @see IdentityProvider_Driver::lookup_group. + */ + static function lookup_group($id) { + return IdentityProvider::instance()->lookup_group($id); + } + + /** + * @see IdentityProvider_Driver::lookup_group_by_name. + */ + static function lookup_group_by_name($name) { + return IdentityProvider::instance()->lookup_group_by_name($name); + } + + /** + * @see IdentityProvider_Driver::get_user_list. + */ + static function get_user_list($ids) { + return IdentityProvider::instance()->get_user_list($ids); + } + + /** + * @see IdentityProvider_Driver::groups. + */ + static function groups() { + return IdentityProvider::instance()->groups(); + } +} \ No newline at end of file diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php index 3d36a324..b3b6d0bb 100644 --- a/modules/gallery/helpers/item.php +++ b/modules/gallery/helpers/item.php @@ -158,8 +158,8 @@ class item_Core { */ static function viewable($model) { $view_restrictions = array(); - if (!Session::active_user()->admin) { - foreach (Session::group_ids_for_active_user() as $id) { + if (!identity::active_user()->admin) { + foreach (identity::group_ids_for_active_user() as $id) { // Separate the first restriction from the rest to make it easier for us to formulate // our where clause below if (empty($view_restrictions)) { diff --git a/modules/gallery/helpers/locales.php b/modules/gallery/helpers/locales.php index f80fce03..c2a606cd 100644 --- a/modules/gallery/helpers/locales.php +++ b/modules/gallery/helpers/locales.php @@ -141,7 +141,7 @@ class locales_Core { $locale = self::cookie_locale(); // 2. Check the user's preference if (!$locale) { - $locale = Session::active_user()->locale; + $locale = identity::active_user()->locale; } // 3. Check the browser's / OS' preference if (!$locale) { diff --git a/modules/gallery/helpers/log.php b/modules/gallery/helpers/log.php index d1b34e3a..184b0b97 100644 --- a/modules/gallery/helpers/log.php +++ b/modules/gallery/helpers/log.php @@ -80,7 +80,7 @@ class log_Core { $log->url = substr(url::abs_current(true), 0, 255); $log->referer = request::referrer(null); $log->timestamp = time(); - $log->user_id = Session::active_user()->id; + $log->user_id = identity::active_user()->id; $log->save(); } diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php index 9541f20e..6dac0803 100644 --- a/modules/gallery/helpers/movie.php +++ b/modules/gallery/helpers/movie.php @@ -77,7 +77,7 @@ class movie_Core { $movie->title = $title; $movie->description = $description; $movie->name = $name; - $movie->owner_id = $owner_id ? $owner_id : Session::active_user()->id; + $movie->owner_id = $owner_id ? $owner_id : identity::active_user()->id; $movie->width = $movie_info[0]; $movie->height = $movie_info[1]; $movie->mime_type = strtolower($pi["extension"]) == "mp4" ? "video/mp4" : "video/x-flv"; diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php index 193293e8..01cf5278 100644 --- a/modules/gallery/helpers/photo.php +++ b/modules/gallery/helpers/photo.php @@ -76,7 +76,7 @@ class photo_Core { $photo->title = $title; $photo->description = $description; $photo->name = $name; - $photo->owner_id = $owner_id ? $owner_id : Session::active_user()->id; + $photo->owner_id = $owner_id ? $owner_id : identity::active_user()->id; $photo->width = $image_info[0]; $photo->height = $image_info[1]; $photo->mime_type = empty($image_info['mime']) ? "application/unknown" : $image_info['mime']; diff --git a/modules/gallery/helpers/site_status.php b/modules/gallery/helpers/site_status.php index 06b29fda..2b090776 100644 --- a/modules/gallery/helpers/site_status.php +++ b/modules/gallery/helpers/site_status.php @@ -95,7 +95,7 @@ class site_status_Core { * @return html text */ static function get() { - if (!Session::active_user()->admin) { + if (!identity::active_user()->admin) { return; } $buf = array(); diff --git a/modules/gallery/helpers/task.php b/modules/gallery/helpers/task.php index f84fd10e..dac5f9d3 100644 --- a/modules/gallery/helpers/task.php +++ b/modules/gallery/helpers/task.php @@ -42,7 +42,7 @@ class task_Core { $task->percent_complete = 0; $task->status = ""; $task->state = "started"; - $task->owner_id = Session::active_user()->id; + $task->owner_id = identity::active_user()->id; $task->context = serialize($context); $task->save(); diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php index 74a08c77..6eedec0d 100644 --- a/modules/gallery/libraries/Admin_View.php +++ b/modules/gallery/libraries/Admin_View.php @@ -36,12 +36,12 @@ class Admin_View_Core extends Gallery_View { parent::__construct($name); $this->theme_name = module::get_var("gallery", "active_admin_theme"); - if (Session::active_user()->admin) { + if (identity::active_user()->admin) { $this->theme_name = Input::instance()->get("theme", $this->theme_name); } $this->sidebar = ""; $this->set_global("theme", $this); - $this->set_global("user", Session::active_user()); + $this->set_global("user", identity::active_user()); } public function admin_menu() { diff --git a/modules/gallery/libraries/Identity.php b/modules/gallery/libraries/Identity.php deleted file mode 100644 index 1dd5d23b..00000000 --- a/modules/gallery/libraries/Identity.php +++ /dev/null @@ -1,222 +0,0 @@ -config = Kohana::config("identity.".$config)) === NULL) { - throw new Exception("@todo NO USER LIBRARY CONFIGURATION FOR: $config"); - } - - // Set driver name - $driver = "Identity_".ucfirst($this->config["driver"])."_Driver"; - - // Load the driver - if ( ! Kohana::auto_load($driver)) { - throw new Kohana_Exception("core.driver_not_found", $this->config["driver"], - get_class($this)); - } - - // Initialize the driver - $this->driver = new $driver($this->config["params"]); - - // Validate the driver - if ( !($this->driver instanceof Identity_Driver)) { - throw new Kohana_Exception("core.driver_implements", $this->config["driver"], - get_class($this), "Identity_Driver"); - } - - Kohana::log("debug", "Identity Library initialized"); - } - - /** - * Return a list of installed Identity Drivers. - * - * @return boolean true if the driver supports updates; false if read only - */ - static function providers() { - if (empty(self::$active)) { - $drivers = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS); - foreach (module::active() as $module) { - $module_name = $module->name; - if (file_exists(MODPATH . "{$module->name}/config/identity.php") && - ($info = module::info($module_name))) { - $drivers->$module_name = $info->description; - } - } - self::$active = $drivers; - } - return self::$active; - } - - /** - * @see Identity_Driver::activate. - */ - static function activate() { - self::instance()->driver->activate(); - } - - /** - * @see Identity_Driver::deactivate. - */ - static function deactivate() { - self::instance()->driver->deactivate(); - } - - /** - * Determine if if the current driver supports updates. - * - * @return boolean true if the driver supports updates; false if read only - */ - static function is_writable() { - return !empty(self::instance()->config["allow_updates"]); - } - - /** - * @see Identity_Driver::guest. - */ - static function guest() { - return self::instance()->driver->guest(); - } - - /** - * @see Identity_Driver::create_user. - */ - static function create_user($name, $full_name, $password) { - return self::instance()->driver->create_user($name, $full_name, $password); - } - - /** - * @see Identity_Driver::is_correct_password. - */ - static function is_correct_password($user, $password) { - return self::instance()->driver->is_correct_password($user, $password); - } - - /** - * @see Identity_Driver::lookup_user. - */ - static function lookup_user($id) { - return self::instance()->driver->lookup_user($id); - } - - /** - * @see Identity_Driver::lookup_user_by_name. - */ - static function lookup_user_by_name($name) { - return self::instance()->driver->lookup_user_by_name($name); - } - - /** - * @see Identity_Driver::create_group. - */ - static function create_group($name) { - return self::instance()->driver->create_group($name); - } - - /** - * @see Identity_Driver::everybody. - */ - static function everybody() { - return self::instance()->driver->everybody(); - } - - /** - * @see Identity_Driver::registered_users. - */ - static function registered_users() { - return self::instance()->driver->everybody(); - } - - /** - * @see Identity_Driver::lookup_group. - */ - static function lookup_group($id) { - return self::instance()->driver->lookup_group($id); - } - - /** - * @see Identity_Driver::lookup_group_by_name. - */ - static function lookup_group_by_name($name) { - return self::instance()->driver->lookup_group_by_name($name); - } - - /** - * @see Identity_Driver::get_user_list. - */ - static function get_user_list($ids) { - return self::instance()->driver->get_user_list($ids); - } - - /** - * @see Identity_Driver::groups. - */ - static function groups() { - return self::instance()->driver->groups(); - } -} // End Identity diff --git a/modules/gallery/libraries/IdentityProvider.php b/modules/gallery/libraries/IdentityProvider.php new file mode 100644 index 00000000..512f28eb --- /dev/null +++ b/modules/gallery/libraries/IdentityProvider.php @@ -0,0 +1,200 @@ +config = Kohana::config("identity.".$config)) === NULL) { + throw new Exception("@todo NO USER LIBRARY CONFIGURATION FOR: $config"); + } + + // Set driver name + $driver = "IdentityProvider_".ucfirst($this->config["driver"])."_Driver"; + + // Load the driver + if ( ! Kohana::auto_load($driver)) { + throw new Kohana_Exception("core.driver_not_found", $this->config["driver"], + get_class($this)); + } + + // Initialize the driver + $this->driver = new $driver($this->config["params"]); + + // Validate the driver + if ( !($this->driver instanceof IdentityProvider_Driver)) { + throw new Kohana_Exception("core.driver_implements", $this->config["driver"], + get_class($this), "IdentityProvider_Driver"); + } + + Kohana::log("debug", "Identity Library initialized"); + } + + /** + * Determine if if the current driver supports updates. + * + * @return boolean true if the driver supports updates; false if read only + */ + public function is_writable() { + return !empty($this->config["allow_updates"]); + } + + /** + * @see IdentityProvider_Driver::activate. + */ + public function activate() { + $this->driver->activate(); + } + + /** + * @see IdentityProvider_Driver::deactivate. + */ + public function deactivate() { + $this->driver->deactivate(); + } + + /** + * @see IdentityProvider_Driver::guest. + */ + public function guest() { + return $this->driver->guest(); + } + + /** + * @see IdentityProvider_Driver::create_user. + */ + public function create_user($name, $full_name, $password) { + return $this->driver->create_user($name, $full_name, $password); + } + + /** + * @see IdentityProvider_Driver::is_correct_password. + */ + public function is_correct_password($user, $password) { + return $this->driver->is_correct_password($user, $password); + } + + /** + * @see IdentityProvider_Driver::lookup_user. + */ + public function lookup_user($id) { + return $this->driver->lookup_user($id); + } + + /** + * @see IdentityProvider_Driver::lookup_user_by_name. + */ + public function lookup_user_by_name($name) { + return $this->driver->lookup_user_by_name($name); + } + + /** + * @see IdentityProvider_Driver::create_group. + */ + public function create_group($name) { + return $this->driver->create_group($name); + } + + /** + * @see IdentityProvider_Driver::everybody. + */ + public function everybody() { + return $this->driver->everybody(); + } + + /** + * @see IdentityProvider_Driver::registered_users. + */ + public function registered_users() { + return $this->driver->everybody(); + } + + /** + * @see IdentityProvider_Driver::lookup_group. + */ + public function lookup_group($id) { + return $this->driver->lookup_group($id); + } + + /** + * @see IdentityProvider_Driver::lookup_group_by_name. + */ + public function lookup_group_by_name($name) { + return $this->driver->lookup_group_by_name($name); + } + + /** + * @see IdentityProvider_Driver::get_user_list. + */ + public function get_user_list($ids) { + return $this->driver->get_user_list($ids); + } + + /** + * @see IdentityProvider_Driver::groups. + */ + public function groups() { + return $this->driver->groups(); + } +} // End Identity diff --git a/modules/gallery/libraries/MY_Session.php b/modules/gallery/libraries/MY_Session.php deleted file mode 100644 index 1a3ae801..00000000 --- a/modules/gallery/libraries/MY_Session.php +++ /dev/null @@ -1,93 +0,0 @@ -get("user"))) { - $session->set("user", $user = Identity::guest()); - } - - // The installer cannot set a user into the session, so it just sets an id which we should - // upconvert into a user. - // @todo set the user name into the session instead of 2 and then use it to get the user object - if ($user === 2) { - $user = Instance::lookup_user_by_name("admin"); - self::set_active_user($user); - $session->set("user", $user); - } - - if (!$session->get("group_ids")) { - $ids = array(); - foreach ($user->groups as $group) { - $ids[] = $group->id; - } - $session->set("group_ids", $ids); - } - } catch (Exception $e) { - try { - Session::instance()->destroy(); - } catch (Exception $e) { - // We don't care if there was a problem destroying the session. - } - url::redirect(item::root()->abs_url()); - } - } - - /** - * Return the array of group ids this user belongs to - * - * @return array - */ - static function group_ids_for_active_user() { - return self::instance()->get("group_ids", array(1)); - } - - /** - * Return the active user. If there's no active user, return the guest user. - * - * @return User_Definition - */ - static function active_user() { - // @todo (maybe) cache this object so we're not always doing session lookups. - $user = self::instance()->get("user", null); - if (!isset($user)) { - // Don't do this as a fallback in the Session::get() call because it can trigger unnecessary - // work. - $user = Identity::guest(); - } - return $user; - } - - /** - * Change the active user. - * @param User_Definition $user - */ - static function set_active_user($user) { - $session = Session::instance(); - $session->set("user", $user); - $session->delete("group_ids"); - self::load_user(); - } -} \ No newline at end of file diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 2fdc7531..68ec325f 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -37,13 +37,13 @@ class Theme_View_Core extends Gallery_View { parent::__construct($name); $this->theme_name = module::get_var("gallery", "active_site_theme"); - if (Session::active_user()->admin) { + if (identity::active_user()->admin) { $this->theme_name = Input::instance()->get("theme", $this->theme_name); } $this->item = null; $this->tag = null; $this->set_global("theme", $this); - $this->set_global("user", Session::active_user()); + $this->set_global("user", identity::active_user()); $this->set_global("page_type", $page_type); $this->set_global("page_title", null); if ($page_type == "album") { @@ -158,7 +158,7 @@ class Theme_View_Core extends Gallery_View { */ public function sidebar_blocks() { $sidebar = block_manager::get_html("site.sidebar", $this); - if (empty($sidebar) && Session::active_user()->admin) { + if (empty($sidebar) && identity::active_user()->admin) { $sidebar = new View("no_sidebar.html"); } return $sidebar; diff --git a/modules/gallery/libraries/drivers/Identity.php b/modules/gallery/libraries/drivers/Identity.php deleted file mode 100644 index 39b2a9c7..00000000 --- a/modules/gallery/libraries/drivers/Identity.php +++ /dev/null @@ -1,123 +0,0 @@ -owner_id); + return identity::lookup_user($this->owner_id); } catch (Exception $e) { return null; } diff --git a/modules/gallery/models/log.php b/modules/gallery/models/log.php index 1d639857..4f6b8c4b 100644 --- a/modules/gallery/models/log.php +++ b/modules/gallery/models/log.php @@ -26,7 +26,7 @@ class Log_Model extends ORM { // This relationship depends on an outside module, which may not be present so handle // failures gracefully. try { - return Identity::lookup_user($this->user_id); + return identity::lookup_user($this->user_id); } catch (Exception $e) { return null; } diff --git a/modules/gallery/models/task.php b/modules/gallery/models/task.php index 548e5f9c..f40be492 100644 --- a/modules/gallery/models/task.php +++ b/modules/gallery/models/task.php @@ -46,7 +46,7 @@ class Task_Model extends ORM { } public function owner() { - return Identity::lookup_user($this->owner_id); + return identity::lookup_user($this->owner_id); } /** diff --git a/modules/gallery/tests/Access_Helper_Test.php b/modules/gallery/tests/Access_Helper_Test.php index dac431a7..e9e5cb26 100644 --- a/modules/gallery/tests/Access_Helper_Test.php +++ b/modules/gallery/tests/Access_Helper_Test.php @@ -22,7 +22,7 @@ class Access_Helper_Test extends Unit_Test_Case { public function teardown() { try { - $group = Identity::lookup_group_by_name("access_test"); + $group = identity::lookup_group_by_name("access_test"); if (!empty($group)) { $group->delete(); } @@ -33,7 +33,7 @@ class Access_Helper_Test extends Unit_Test_Case { } catch (Exception $e) { } try { - $user = Identity::lookup_user_by_name("access_test"); + $user = identity::lookup_user_by_name("access_test"); if (!empty($user)) { $user->delete(); } @@ -41,16 +41,16 @@ class Access_Helper_Test extends Unit_Test_Case { // Reset some permissions that we mangle below $root = ORM::factory("item", 1); - access::allow(Identity::everybody(), "view", $root); + access::allow(identity::everybody(), "view", $root); } public function setup() { - Session::set_active_user(Identity::guest()); + identity::set_active_user(identity::guest()); } public function groups_and_permissions_are_bound_to_columns_test() { access::register_permission("access_test", "Access Test"); - $group = Identity::create_group("access_test"); + $group = identity::create_group("access_test"); // We have a new column for this perm / group combo $fields = Database::instance()->list_fields("access_caches"); @@ -65,17 +65,17 @@ class Access_Helper_Test extends Unit_Test_Case { } public function user_can_access_test() { - $access_test = Identity::create_group("access_test"); + $access_test = identity::create_group("access_test"); $root = ORM::factory("item", 1); access::allow($access_test, "view", $root); $item = album::create($root, rand(), "test album"); - access::deny(Identity::everybody(), "view", $item); - access::deny(Identity::registered_users(), "view", $item); + access::deny(identity::everybody(), "view", $item); + access::deny(identity::registered_users(), "view", $item); - $user = Identity::create_user("access_test", "Access Test", ""); + $user = identity::create_user("access_test", "Access Test", ""); foreach ($user->groups as $group) { $user->remove($group); } @@ -89,10 +89,10 @@ class Access_Helper_Test extends Unit_Test_Case { $root = ORM::factory("item", 1); $item = album::create($root, rand(), "test album"); - access::deny(Identity::everybody(), "view", $item); - access::deny(Identity::registered_users(), "view", $item); + access::deny(identity::everybody(), "view", $item); + access::deny(identity::registered_users(), "view", $item); - $user = Identity::create_user("access_test", "Access Test", ""); + $user = identity::create_user("access_test", "Access Test", ""); foreach ($user->groups as $group) { $user->remove($group); } @@ -121,11 +121,11 @@ class Access_Helper_Test extends Unit_Test_Case { $root = ORM::factory("item", 1); $album = album::create($root, rand(), "test album"); - access::allow(Identity::everybody(), "view", $album); + access::allow(identity::everybody(), "view", $album); $photo = photo::create($album, MODPATH . "gallery/images/gallery.png", "", ""); - $this->assert_true($photo->__get("view_" . Identity::everybody()->id)); + $this->assert_true($photo->__get("view_" . identity::everybody()->id)); } public function can_allow_deny_and_reset_intent_test() { @@ -134,23 +134,23 @@ class Access_Helper_Test extends Unit_Test_Case { $intent = ORM::factory("access_intent")->where("item_id", $album)->find(); // Allow - access::allow(Identity::everybody(), "view", $album); + access::allow(identity::everybody(), "view", $album); $this->assert_same(access::ALLOW, $intent->reload()->view_1); // Deny - access::deny(Identity::everybody(), "view", $album); + access::deny(identity::everybody(), "view", $album); $this->assert_same( access::DENY, ORM::factory("access_intent")->where("item_id", $album)->find()->view_1); // Allow again. If the initial value was allow, then the first Allow clause above may not // have actually changed any values. - access::allow(Identity::everybody(), "view", $album); + access::allow(identity::everybody(), "view", $album); $this->assert_same( access::ALLOW, ORM::factory("access_intent")->where("item_id", $album)->find()->view_1); - access::reset(Identity::everybody(), "view", $album); + access::reset(identity::everybody(), "view", $album); $this->assert_same( null, ORM::factory("access_intent")->where("item_id", $album)->find()->view_1); @@ -158,7 +158,7 @@ class Access_Helper_Test extends Unit_Test_Case { public function cant_reset_root_item_test() { try { - access::reset(Identity::everybody(), "view", ORM::factory("item", 1)); + access::reset(identity::everybody(), "view", ORM::factory("item", 1)); } catch (Exception $e) { return; } @@ -167,17 +167,17 @@ class Access_Helper_Test extends Unit_Test_Case { public function can_view_item_test() { $root = ORM::factory("item", 1); - access::allow(Identity::everybody(), "view", $root); - $this->assert_true(access::group_can(Identity::everybody(), "view", $root)); + access::allow(identity::everybody(), "view", $root); + $this->assert_true(access::group_can(identity::everybody(), "view", $root)); } public function can_always_fails_on_unloaded_items_test() { $root = ORM::factory("item", 1); - access::allow(Identity::everybody(), "view", $root); - $this->assert_true(access::group_can(Identity::everybody(), "view", $root)); + access::allow(identity::everybody(), "view", $root); + $this->assert_true(access::group_can(identity::everybody(), "view", $root)); $bogus = ORM::factory("item", -1); - $this->assert_false(access::group_can(Identity::everybody(), "view", $bogus)); + $this->assert_false(access::group_can(identity::everybody(), "view", $bogus)); } public function cant_view_child_of_hidden_parent_test() { @@ -185,21 +185,21 @@ class Access_Helper_Test extends Unit_Test_Case { $album = album::create($root, rand(), "test album"); $root->reload(); - access::deny(Identity::everybody(), "view", $root); - access::reset(Identity::everybody(), "view", $album); + access::deny(identity::everybody(), "view", $root); + access::reset(identity::everybody(), "view", $album); $album->reload(); - $this->assert_false(access::group_can(Identity::everybody(), "view", $album)); + $this->assert_false(access::group_can(identity::everybody(), "view", $album)); } public function view_permissions_propagate_down_test() { $root = ORM::factory("item", 1); $album = album::create($root, rand(), "test album"); - access::allow(Identity::everybody(), "view", $root); - access::reset(Identity::everybody(), "view", $album); + access::allow(identity::everybody(), "view", $root); + access::reset(identity::everybody(), "view", $album); $album->reload(); - $this->assert_true(access::group_can(Identity::everybody(), "view", $album)); + $this->assert_true(access::group_can(identity::everybody(), "view", $album)); } public function can_toggle_view_permissions_propagate_down_test() { @@ -214,18 +214,18 @@ class Access_Helper_Test extends Unit_Test_Case { $album3->reload(); $album4->reload(); - access::allow(Identity::everybody(), "view", $root); - access::deny(Identity::everybody(), "view", $album1); - access::reset(Identity::everybody(), "view", $album2); - access::reset(Identity::everybody(), "view", $album3); - access::reset(Identity::everybody(), "view", $album4); + access::allow(identity::everybody(), "view", $root); + access::deny(identity::everybody(), "view", $album1); + access::reset(identity::everybody(), "view", $album2); + access::reset(identity::everybody(), "view", $album3); + access::reset(identity::everybody(), "view", $album4); $album4->reload(); - $this->assert_false(access::group_can(Identity::everybody(), "view", $album4)); + $this->assert_false(access::group_can(identity::everybody(), "view", $album4)); - access::allow(Identity::everybody(), "view", $album1); + access::allow(identity::everybody(), "view", $album1); $album4->reload(); - $this->assert_true(access::group_can(Identity::everybody(), "view", $album4)); + $this->assert_true(access::group_can(identity::everybody(), "view", $album4)); } public function revoked_view_permissions_cant_be_allowed_lower_down_test() { @@ -234,29 +234,29 @@ class Access_Helper_Test extends Unit_Test_Case { $album2 = album::create($album1, rand(), "test album"); $root->reload(); - access::deny(Identity::everybody(), "view", $root); - access::allow(Identity::everybody(), "view", $album2); + access::deny(identity::everybody(), "view", $root); + access::allow(identity::everybody(), "view", $album2); $album1->reload(); - $this->assert_false(access::group_can(Identity::everybody(), "view", $album1)); + $this->assert_false(access::group_can(identity::everybody(), "view", $album1)); $album2->reload(); - $this->assert_false(access::group_can(Identity::everybody(), "view", $album2)); + $this->assert_false(access::group_can(identity::everybody(), "view", $album2)); } public function can_edit_item_test() { $root = ORM::factory("item", 1); - access::allow(Identity::everybody(), "edit", $root); - $this->assert_true(access::group_can(Identity::everybody(), "edit", $root)); + access::allow(identity::everybody(), "edit", $root); + $this->assert_true(access::group_can(identity::everybody(), "edit", $root)); } public function non_view_permissions_propagate_down_test() { $root = ORM::factory("item", 1); $album = album::create($root, rand(), "test album"); - access::allow(Identity::everybody(), "edit", $root); - access::reset(Identity::everybody(), "edit", $album); - $this->assert_true(access::group_can(Identity::everybody(), "edit", $album)); + access::allow(identity::everybody(), "edit", $root); + access::reset(identity::everybody(), "edit", $album); + $this->assert_true(access::group_can(identity::everybody(), "edit", $album)); } public function non_view_permissions_can_be_revoked_lower_down_test() { @@ -276,36 +276,36 @@ class Access_Helper_Test extends Unit_Test_Case { $outer->reload(); $inner->reload(); - access::allow(Identity::everybody(), "edit", $root); - access::deny(Identity::everybody(), "edit", $outer); - access::allow(Identity::everybody(), "edit", $inner); + access::allow(identity::everybody(), "edit", $root); + access::deny(identity::everybody(), "edit", $outer); + access::allow(identity::everybody(), "edit", $inner); // Outer album is not editable, inner one is. - $this->assert_false(access::group_can(Identity::everybody(), "edit", $outer_photo)); - $this->assert_true(access::group_can(Identity::everybody(), "edit", $inner_photo)); + $this->assert_false(access::group_can(identity::everybody(), "edit", $outer_photo)); + $this->assert_true(access::group_can(identity::everybody(), "edit", $inner_photo)); } public function i_can_edit_test() { // Create a new user that belongs to no groups - $user = Identity::create_user("access_test", "Access Test", ""); + $user = identity::create_user("access_test", "Access Test", ""); foreach ($user->groups as $group) { $user->remove($group); } $user->save(); - Session::set_active_user($user); + identity::set_active_user($user); // This user can't edit anything $root = ORM::factory("item", 1); $this->assert_false(access::can("edit", $root)); // Now add them to a group that has edit permission - $group = Identity::create_group("access_test"); + $group = identity::create_group("access_test"); $group->add($user); $group->save(); access::allow($group, "edit", $root); - $user = Identity::lookup_user($user->id); // reload() does not flush related columns - Session::set_active_user($user); + $user = identity::lookup_user($user->id); // reload() does not flush related columns + identity::set_active_user($user); // And verify that the user can edit. $this->assert_true(access::can("edit", $root)); @@ -317,16 +317,16 @@ class Access_Helper_Test extends Unit_Test_Case { $this->assert_false(file_exists($album->file_path() . "/.htaccess")); - access::deny(Identity::everybody(), "view", $album); + access::deny(identity::everybody(), "view", $album); $this->assert_true(file_exists($album->file_path() . "/.htaccess")); - access::allow(Identity::everybody(), "view", $album); + access::allow(identity::everybody(), "view", $album); $this->assert_false(file_exists($album->file_path() . "/.htaccess")); - access::deny(Identity::everybody(), "view", $album); + access::deny(identity::everybody(), "view", $album); $this->assert_true(file_exists($album->file_path() . "/.htaccess")); - access::reset(Identity::everybody(), "view", $album); + access::reset(identity::everybody(), "view", $album); $this->assert_false(file_exists($album->file_path() . "/.htaccess")); } @@ -338,44 +338,44 @@ class Access_Helper_Test extends Unit_Test_Case { $this->assert_false(file_exists($album->resize_path() . "/.htaccess")); $this->assert_false(file_exists($album->thumb_path() . "/.htaccess")); - access::deny(Identity::everybody(), "view_full", $album); + access::deny(identity::everybody(), "view_full", $album); $this->assert_true(file_exists($album->file_path() . "/.htaccess")); $this->assert_false(file_exists($album->resize_path() . "/.htaccess")); $this->assert_false(file_exists($album->thumb_path() . "/.htaccess")); - access::allow(Identity::everybody(), "view_full", $album); + access::allow(identity::everybody(), "view_full", $album); $this->assert_false(file_exists($album->file_path() . "/.htaccess")); $this->assert_false(file_exists($album->resize_path() . "/.htaccess")); $this->assert_false(file_exists($album->thumb_path() . "/.htaccess")); - access::deny(Identity::everybody(), "view_full", $album); + access::deny(identity::everybody(), "view_full", $album); $this->assert_true(file_exists($album->file_path() . "/.htaccess")); $this->assert_false(file_exists($album->resize_path() . "/.htaccess")); $this->assert_false(file_exists($album->thumb_path() . "/.htaccess")); - access::reset(Identity::everybody(), "view_full", $album); + access::reset(identity::everybody(), "view_full", $album); $this->assert_false(file_exists($album->file_path() . "/.htaccess")); $this->assert_false(file_exists($album->resize_path() . "/.htaccess")); $this->assert_false(file_exists($album->thumb_path() . "/.htaccess")); } public function moved_items_inherit_new_permissions_test() { - Session::set_active_user(Identity::lookup_user_by_name("admin")); + identity::set_active_user(identity::lookup_user_by_name("admin")); $root = ORM::factory("item", 1); $public_album = album::create($root, rand(), "public album"); $public_photo = photo::create($public_album, MODPATH . "gallery/images/gallery.png", "", ""); - access::allow(Identity::everybody(), "view", $public_album); + access::allow(identity::everybody(), "view", $public_album); $root->reload(); // Account for MPTT changes $private_album = album::create($root, rand(), "private album"); - access::deny(Identity::everybody(), "view", $private_album); + access::deny(identity::everybody(), "view", $private_album); $private_photo = photo::create($private_album, MODPATH . "gallery/images/gallery.png", "", ""); // Make sure that we now have a public photo and private photo. - $this->assert_true(access::group_can(Identity::everybody(), "view", $public_photo)); - $this->assert_false(access::group_can(Identity::everybody(), "view", $private_photo)); + $this->assert_true(access::group_can(identity::everybody(), "view", $public_photo)); + $this->assert_false(access::group_can(identity::everybody(), "view", $private_photo)); // Swap the photos item::move($public_photo, $private_album); @@ -391,7 +391,7 @@ class Access_Helper_Test extends Unit_Test_Case { $public_photo->reload(); // Make sure that the public_photo is now private, and the private_photo is now public. - $this->assert_false(access::group_can(Identity::everybody(), "view", $public_photo)); - $this->assert_true(access::group_can(Identity::everybody(), "view", $private_photo)); + $this->assert_false(access::group_can(identity::everybody(), "view", $public_photo)); + $this->assert_true(access::group_can(identity::everybody(), "view", $private_photo)); } } diff --git a/modules/gallery/tests/Albums_Controller_Test.php b/modules/gallery/tests/Albums_Controller_Test.php index fa46d924..b85b5258 100644 --- a/modules/gallery/tests/Albums_Controller_Test.php +++ b/modules/gallery/tests/Albums_Controller_Test.php @@ -45,7 +45,7 @@ class Albums_Controller_Test extends Unit_Test_Case { $_POST["csrf"] = access::csrf_token(); $_POST["slug"] = "new_name"; $_POST["_method"] = "put"; - access::allow(Identity::everybody(), "edit", $root); + access::allow(identity::everybody(), "edit", $root); ob_start(); $controller->_update($this->_album); @@ -69,7 +69,7 @@ class Albums_Controller_Test extends Unit_Test_Case { $_POST["name"] = "new name"; $_POST["title"] = "new title"; $_POST["description"] = "new description"; - access::allow(Identity::everybody(), "edit", $root); + access::allow(identity::everybody(), "edit", $root); try { $controller->_update($this->_album); diff --git a/modules/gallery/tests/Item_Helper_Test.php b/modules/gallery/tests/Item_Helper_Test.php index fc01db91..a364423a 100644 --- a/modules/gallery/tests/Item_Helper_Test.php +++ b/modules/gallery/tests/Item_Helper_Test.php @@ -23,16 +23,16 @@ class Item_Helper_Test extends Unit_Test_Case { $root = ORM::factory("item", 1); $album = album::create($root, rand(), rand(), rand()); $item = self::_create_random_item($album); - Session::set_active_user(Identity::guest()); + identity::set_active_user(identity::guest()); // We can see the item when permissions are granted - access::allow(Identity::everybody(), "view", $album); + access::allow(identity::everybody(), "view", $album); $this->assert_equal( 1, ORM::factory("item")->viewable()->where("id", $item->id)->count_all()); // We can't see the item when permissions are denied - access::deny(Identity::everybody(), "view", $album); + access::deny(identity::everybody(), "view", $album); $this->assert_equal( 0, ORM::factory("item")->viewable()->where("id", $item->id)->count_all()); diff --git a/modules/gallery/tests/Photos_Controller_Test.php b/modules/gallery/tests/Photos_Controller_Test.php index 59c3f78a..2e5d7fe3 100644 --- a/modules/gallery/tests/Photos_Controller_Test.php +++ b/modules/gallery/tests/Photos_Controller_Test.php @@ -31,7 +31,7 @@ class Photos_Controller_Test extends Unit_Test_Case { $root = ORM::factory("item", 1); $photo = photo::create( $root, MODPATH . "gallery/tests/test.jpg", "test.jpeg", - "test", "test", Session::active_user()->id, "slug"); + "test", "test", identity::active_user()->id, "slug"); $orig_name = $photo->name; $_POST["filename"] = "test.jpeg"; @@ -40,7 +40,7 @@ class Photos_Controller_Test extends Unit_Test_Case { $_POST["description"] = "new description"; $_POST["slug"] = "new-slug"; $_POST["csrf"] = access::csrf_token(); - access::allow(Identity::everybody(), "edit", $root); + access::allow(identity::everybody(), "edit", $root); ob_start(); $controller->_update($photo); @@ -64,7 +64,7 @@ class Photos_Controller_Test extends Unit_Test_Case { $_POST["name"] = "new name"; $_POST["title"] = "new title"; $_POST["description"] = "new description"; - access::allow(Identity::everybody(), "edit", $root); + access::allow(identity::everybody(), "edit", $root); try { $controller->_update($photo); diff --git a/modules/gallery/views/kohana_error_page.php b/modules/gallery/views/kohana_error_page.php index 0256fabb..0d8801e5 100644 --- a/modules/gallery/views/kohana_error_page.php +++ b/modules/gallery/views/kohana_error_page.php @@ -57,7 +57,7 @@ <?= t("Something went wrong!") ?> - + admin ?>

        diff --git a/modules/gallery/views/login.html.php b/modules/gallery/views/login.html.php index 6695d564..961f44fa 100644 --- a/modules/gallery/views/login.html.php +++ b/modules/gallery/views/login.html.php @@ -8,7 +8,7 @@

      • - + html::mark_clean( 'id}") . '" title="' . t("Edit Your Profile")->for_html_attr() . diff --git a/modules/gallery/views/login_ajax.html.php b/modules/gallery/views/login_ajax.html.php index 6ed40571..a9a9ef11 100644 --- a/modules/gallery/views/login_ajax.html.php +++ b/modules/gallery/views/login_ajax.html.php @@ -36,7 +36,7 @@
      • - +
      • diff --git a/modules/notification/helpers/notification.php b/modules/notification/helpers/notification.php index 080f154b..9a40b0b9 100644 --- a/modules/notification/helpers/notification.php +++ b/modules/notification/helpers/notification.php @@ -20,7 +20,7 @@ class notification { static function get_subscription($item_id, $user=null) { if (empty($user)) { - $user = Session::active_user(); + $user = identity::active_user(); } return ORM::factory("subscription") @@ -31,7 +31,7 @@ class notification { static function is_watching($item, $user=null) { if (empty($user)) { - $user = Session::active_user(); + $user = identity::active_user(); } return ORM::factory("subscription") @@ -44,7 +44,7 @@ class notification { static function add_watch($item, $user=null) { if ($item->is_album()) { if (empty($user)) { - $user = Session::active_user(); + $user = identity::active_user(); } $subscription = ORM::factory("subscription"); $subscription->item_id = $item->id; @@ -56,7 +56,7 @@ class notification { static function remove_watch($item, $user=null) { if ($item->is_album()) { if (empty($user)) { - $user = Session::active_user(); + $user = identity::active_user(); } $subscription = ORM::factory("subscription") @@ -81,7 +81,7 @@ class notification { if (empty($subscriber_ids)) { return array(); } - $users = Identity::get_user_list($subscriber_ids); + $users = identity::get_user_list($subscriber_ids); $subscribers = array(); foreach ($users as $user) { diff --git a/modules/notification/helpers/notification_event.php b/modules/notification/helpers/notification_event.php index f0530cd9..3a369155 100644 --- a/modules/notification/helpers/notification_event.php +++ b/modules/notification/helpers/notification_event.php @@ -95,7 +95,7 @@ class notification_event_Core { } static function site_menu($menu, $theme) { - if (!Session::active_user()->guest) { + if (!identity::active_user()->guest) { $item = $theme->item(); if ($item && $item->is_album() && access::can("view", $item)) { diff --git a/modules/search/helpers/search.php b/modules/search/helpers/search.php index 8b14cfa9..f9da9a16 100644 --- a/modules/search/helpers/search.php +++ b/modules/search/helpers/search.php @@ -22,8 +22,8 @@ class search_Core { $db = Database::instance(); $q = $db->escape_str($q); - if (!Session::active_user()->admin) { - foreach (Session::group_ids_for_active_user() as $id) { + if (!identity::active_user()->admin) { + foreach (identity::group_ids_for_active_user() as $id) { $fields[] = "`view_$id` = TRUE"; // access::ALLOW } $access_sql = "AND (" . join(" AND ", $fields) . ")"; diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php index 428065f6..53a3d091 100644 --- a/modules/server_add/controllers/server_add.php +++ b/modules/server_add/controllers/server_add.php @@ -103,7 +103,7 @@ class Server_Add_Controller extends Admin_Controller { access::verify_csrf(); $task = ORM::factory("task", $task_id); - if (!$task->loaded || $task->owner_id != Session::active_user()->id) { + if (!$task->loaded || $task->owner_id != identity::active_user()->id) { access::forbidden(); } @@ -207,7 +207,7 @@ class Server_Add_Controller extends Admin_Controller { $task->set("mode", "done"); } - $owner_id = Session::active_user()->id; + $owner_id = identity::active_user()->id; foreach ($entries as $entry) { if (microtime(true) - $start > 0.5) { break; diff --git a/modules/server_add/helpers/server_add_event.php b/modules/server_add/helpers/server_add_event.php index 8f8b0016..1d883a71 100644 --- a/modules/server_add/helpers/server_add_event.php +++ b/modules/server_add/helpers/server_add_event.php @@ -30,7 +30,7 @@ class server_add_event_Core { $item = $theme->item(); $paths = unserialize(module::get_var("server_add", "authorized_paths")); - if ($item && Session::active_user()->admin && $item->is_album() && !empty($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") diff --git a/modules/server_add/helpers/server_add_theme.php b/modules/server_add/helpers/server_add_theme.php index 44681d36..9da8969a 100644 --- a/modules/server_add/helpers/server_add_theme.php +++ b/modules/server_add/helpers/server_add_theme.php @@ -19,7 +19,7 @@ */ class server_add_theme_Core { static function head($theme) { - if (Session::active_user()->admin) { + if (identity::active_user()->admin) { $theme->script("server_add.js"); } } diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php index 258de843..8b96ebd2 100644 --- a/modules/user/controllers/admin_users.php +++ b/modules/user/controllers/admin_users.php @@ -69,7 +69,7 @@ class Admin_Users_Controller extends Admin_Controller { public function delete_user($id) { access::verify_csrf(); - if ($id == Session::active_user()->id || $id == user::guest()->id) { + if ($id == identity::active_user()->id || $id == user::guest()->id) { access::forbidden(); } @@ -136,7 +136,7 @@ class Admin_Users_Controller extends Admin_Controller { } // An admin can change the admin status for any user but themselves - if ($user->id != Session::active_user()->id) { + if ($user->id != identity::active_user()->id) { $user->admin = $form->edit_user->admin->checked; } $user->save(); @@ -158,7 +158,7 @@ class Admin_Users_Controller extends Admin_Controller { $form = $this->_get_user_edit_form_admin($user); // Don't allow the user to control their own admin bit, else you can lock yourself out - if ($user->id == Session::active_user()->id) { + if ($user->id == identity::active_user()->id) { $form->edit_user->admin->disabled(1); } print $form; diff --git a/modules/user/controllers/password.php b/modules/user/controllers/password.php index a8f1c5ca..6bef1a17 100644 --- a/modules/user/controllers/password.php +++ b/modules/user/controllers/password.php @@ -46,7 +46,7 @@ class Password_Controller extends Controller { $valid = $form->validate(); if ($valid) { - $user = Identity::lookup_user_by_name($form->reset->inputs["name"]->value); + $user = identity::lookup_user_by_name($form->reset->inputs["name"]->value); if (!$user->loaded || empty($user->email)) { $form->reset->inputs["name"]->add_error("no_email", 1); $valid = false; diff --git a/modules/user/controllers/users.php b/modules/user/controllers/users.php index 0ccf3e2a..dee54f63 100644 --- a/modules/user/controllers/users.php +++ b/modules/user/controllers/users.php @@ -21,7 +21,7 @@ class Users_Controller extends Controller { public function update($id) { $user = user::lookup($id); - if ($user->guest || $user->id != Session::active_user()->id) { + if ($user->guest || $user->id != identity::active_user()->id) { access::forbidden(); } @@ -59,7 +59,7 @@ class Users_Controller extends Controller { public function form_edit($id) { $user = user::lookup($id); - if ($user->guest || $user->id != Session::active_user()->id) { + if ($user->guest || $user->id != identity::active_user()->id) { access::forbidden(); } diff --git a/modules/user/helpers/group.php b/modules/user/helpers/group.php index 8ad52564..567b2ee4 100644 --- a/modules/user/helpers/group.php +++ b/modules/user/helpers/group.php @@ -25,7 +25,10 @@ */ class group_Core { /** - * @see Identity_Driver::create. + * Create a new group. + * + * @param string $name + * @return Group_Definition the group object */ static function create($name) { $group = ORM::factory("group")->where("name", $name)->find(); @@ -39,14 +42,18 @@ class group_Core { } /** - * @see Identity_Driver::everbody. + * The group of all possible visitors. This includes the guest user. + * + * @return Group_Definition the group object */ static function everybody() { return model_cache::get("group", 1); } /** - * @see Identity_Driver::registered_users. + * The group of all logged-in visitors. This does not include guest users. + * + * @return Group_Definition the group object */ static function registered_users() { return model_cache::get("group", 2); @@ -71,7 +78,10 @@ class group_Core { } /** - * @see Identity_Driver::get_group_list. + * Search the groups by the field and value. + * @param string $field_name column to look up the user by + * @param string $value value to match + * @return Group_Definition the group object, or null if the name was invalid. */ static function lookup_by_field($field_name, $value) { try { diff --git a/modules/user/libraries/drivers/Identity/Gallery.php b/modules/user/libraries/drivers/Identity/Gallery.php deleted file mode 100644 index 36f37543..00000000 --- a/modules/user/libraries/drivers/Identity/Gallery.php +++ /dev/null @@ -1,150 +0,0 @@ -password; - - // Try phpass first, since that's what we generate. - if (strlen($valid) == 34) { - require_once(MODPATH . "user/lib/PasswordHash.php"); - $hashGenerator = new PasswordHash(10, true); - return $hashGenerator->CheckPassword($password, $valid); - } - - $salt = substr($valid, 0, 4); - // Support both old (G1 thru 1.4.0; G2 thru alpha-4) and new password schemes: - $guess = (strlen($valid) == 32) ? md5($password) : ($salt . md5($salt . $password)); - if (!strcmp($guess, $valid)) { - return true; - } - - // Passwords with <&"> created by G2 prior to 2.1 were hashed with entities - $sanitizedPassword = html::specialchars($password, false); - $guess = (strlen($valid) == 32) ? md5($sanitizedPassword) - : ($salt . md5($salt . $sanitizedPassword)); - if (!strcmp($guess, $valid)) { - return true; - } - - return false; - } - - /** - * @see Identity_Driver::lookup_user. - */ - public function lookup_user($id) { - return user::lookup_by_field("id", $id); - } - - /** - * @see Identity_Driver::lookup_user_by_name. - */ - public function lookup_user_by_name($name) { - return user::lookup_by_field("name", $name); - } - - /** - * @see Identity_Driver::create_group. - */ - public function create_group($name) { - return group::create($name); - } - - /** - * @see Identity_Driver::everybody. - */ - public function everybody() { - return group::everybody(); - } - - /** - * @see Identity_Driver::registered_users. - */ - public function registered_users() { - return group::registered_users(); - } - - /** - * @see Identity_Driver::lookup_group. - */ - public function lookup_group($id) { - return group::lookup_by_field("id", $id); - } - - /** - * @see Identity_Driver::lookup_group_by_name. - */ - public function lookup_group_by_name($name) { - return group::lookup_by_field("name", $name); - } - - /** - * @see Identity_Driver::get_user_list. - */ - public function get_user_list($ids) { - return ORM::factory("user") - ->in("id", $ids) - ->find_all() - ->as_array(); - } - - /** - * @see Identity_Driver::groups. - */ - public function groups() { - return ORM::factory("group")->find_all(); - } - -} // End Identity Gallery Driver - diff --git a/modules/user/libraries/drivers/IdentityProvider/Gallery.php b/modules/user/libraries/drivers/IdentityProvider/Gallery.php new file mode 100644 index 00000000..5941abb7 --- /dev/null +++ b/modules/user/libraries/drivers/IdentityProvider/Gallery.php @@ -0,0 +1,150 @@ +password; + + // Try phpass first, since that's what we generate. + if (strlen($valid) == 34) { + require_once(MODPATH . "user/lib/PasswordHash.php"); + $hashGenerator = new PasswordHash(10, true); + return $hashGenerator->CheckPassword($password, $valid); + } + + $salt = substr($valid, 0, 4); + // Support both old (G1 thru 1.4.0; G2 thru alpha-4) and new password schemes: + $guess = (strlen($valid) == 32) ? md5($password) : ($salt . md5($salt . $password)); + if (!strcmp($guess, $valid)) { + return true; + } + + // Passwords with <&"> created by G2 prior to 2.1 were hashed with entities + $sanitizedPassword = html::specialchars($password, false); + $guess = (strlen($valid) == 32) ? md5($sanitizedPassword) + : ($salt . md5($salt . $sanitizedPassword)); + if (!strcmp($guess, $valid)) { + return true; + } + + return false; + } + + /** + * @see IdentityProvider_Driver::lookup_user. + */ + public function lookup_user($id) { + return user::lookup_by_field("id", $id); + } + + /** + * @see IdentityProvider_Driver::lookup_user_by_name. + */ + public function lookup_user_by_name($name) { + return user::lookup_by_field("name", $name); + } + + /** + * @see IdentityProvider_Driver::create_group. + */ + public function create_group($name) { + return group::create($name); + } + + /** + * @see IdentityProvider_Driver::everybody. + */ + public function everybody() { + return group::everybody(); + } + + /** + * @see IdentityProvider_Driver::registered_users. + */ + public function registered_users() { + return group::registered_users(); + } + + /** + * @see IdentityProvider_Driver::lookup_group. + */ + public function lookup_group($id) { + return group::lookup_by_field("id", $id); + } + + /** + * @see IdentityProvider_Driver::lookup_group_by_name. + */ + public function lookup_group_by_name($name) { + return group::lookup_by_field("name", $name); + } + + /** + * @see IdentityProvider_Driver::get_user_list. + */ + public function get_user_list($ids) { + return ORM::factory("user") + ->in("id", $ids) + ->find_all() + ->as_array(); + } + + /** + * @see IdentityProvider_Driver::groups. + */ + public function groups() { + return ORM::factory("group")->find_all(); + } + +} // End Identity Gallery Driver + diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php index ee8d413c..fed92c5e 100644 --- a/modules/user/views/admin_users.html.php +++ b/modules/user/views/admin_users.html.php @@ -91,7 +91,7 @@ open_text="" class="g-panel-link g-button ui-state-default ui-corner-all ui-icon-left"> - id != $user->id && !$user->guest): ?> + id != $user->id && !$user->guest): ?> id") ?>" class="g-dialog-link g-button ui-state-default ui-corner-all ui-icon-left"> -- cgit v1.2.3 From 6b51de49c5c6a4030505ff1f979e3e14da06c457 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 22 Oct 2009 13:28:23 -0700 Subject: Change the modifier on activate and deactivate methods to static as they are in a helper class. --- modules/gallery/tests/No_Direct_Access_Test.php | 77 ---------------------- .../gallery/tests/No_Direct_ORM_Access_Test.php | 77 ++++++++++++++++++++++ modules/user/helpers/user.php | 4 +- 3 files changed, 79 insertions(+), 79 deletions(-) delete mode 100644 modules/gallery/tests/No_Direct_Access_Test.php create mode 100644 modules/gallery/tests/No_Direct_ORM_Access_Test.php (limited to 'modules/gallery') diff --git a/modules/gallery/tests/No_Direct_Access_Test.php b/modules/gallery/tests/No_Direct_Access_Test.php deleted file mode 100644 index c6d8df95..00000000 --- a/modules/gallery/tests/No_Direct_Access_Test.php +++ /dev/null @@ -1,77 +0,0 @@ - $line) { - if (preg_match('/ORM::factory\\(\"user\"/', $line)) { - $errors[] = "$file($l) => $line"; - } - } - } - $file_as_string = null; - } - if ($errors) { - $this->assert_false(true, "Direct access to the users table found:\n" . join("\n", $errors)); - } - } - - public function no_access_to_groups_table_test() { - $dir = new UserModuleFilterIterator( - new PhpCodeFilterIterator( - new GalleryCodeFilterIterator( - new RecursiveIteratorIterator( - new RecursiveDirectoryIterator(DOCROOT))))); - $errors = array(); - foreach ($dir as $file) { - $file_as_string = file_get_contents($file); - if (preg_match("/ORM::factory\\(\"group\"/", $file_as_string)) { - foreach (split("\n", $file_as_string) as $l => $line) { - if (preg_match('/ORM::factory\\(\"group\"/', $line)) { - $errors[] = "$file($l) => $line"; - } - } - } - $file_as_string = null; - } - if ($errors) { - $this->assert_false(true, "Direct access to the groups table found:\n" . join("\n", $errors)); - } - } - -} - -class UserModuleFilterIterator extends FilterIterator { - public function accept() { - $path_name = $this->getInnerIterator()->getPathName(); - return strpos($path_name, "/modules/user") === false; - } -} diff --git a/modules/gallery/tests/No_Direct_ORM_Access_Test.php b/modules/gallery/tests/No_Direct_ORM_Access_Test.php new file mode 100644 index 00000000..c6d8df95 --- /dev/null +++ b/modules/gallery/tests/No_Direct_ORM_Access_Test.php @@ -0,0 +1,77 @@ + $line) { + if (preg_match('/ORM::factory\\(\"user\"/', $line)) { + $errors[] = "$file($l) => $line"; + } + } + } + $file_as_string = null; + } + if ($errors) { + $this->assert_false(true, "Direct access to the users table found:\n" . join("\n", $errors)); + } + } + + public function no_access_to_groups_table_test() { + $dir = new UserModuleFilterIterator( + new PhpCodeFilterIterator( + new GalleryCodeFilterIterator( + new RecursiveIteratorIterator( + new RecursiveDirectoryIterator(DOCROOT))))); + $errors = array(); + foreach ($dir as $file) { + $file_as_string = file_get_contents($file); + if (preg_match("/ORM::factory\\(\"group\"/", $file_as_string)) { + foreach (split("\n", $file_as_string) as $l => $line) { + if (preg_match('/ORM::factory\\(\"group\"/', $line)) { + $errors[] = "$file($l) => $line"; + } + } + } + $file_as_string = null; + } + if ($errors) { + $this->assert_false(true, "Direct access to the groups table found:\n" . join("\n", $errors)); + } + } + +} + +class UserModuleFilterIterator extends FilterIterator { + public function accept() { + $path_name = $this->getInnerIterator()->getPathName(); + return strpos($path_name, "/modules/user") === false; + } +} diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index ec4f56ae..5f154313 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -27,7 +27,7 @@ class user_Core { /** * Initialize the provider so it is ready to use */ - public function activate() { + static function activate() { $db = Database::instance(); $db->query("CREATE TABLE IF NOT EXISTS {users} ( `id` int(9) NOT NULL auto_increment, @@ -93,7 +93,7 @@ class user_Core { /** * Cleanup up this provider so it is unavailable for use and won't conflict with the current driver */ - public function deactivate() { + static function deactivate() { // Delete all users and groups so that we give other modules an opportunity to clean up foreach (ORM::factory("user")->find_all() as $user) { $user->delete(); -- cgit v1.2.3 From f4176ae97dc9ea56d15c9d9f0fdd7bf28b44a656 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 22 Oct 2009 13:29:12 -0700 Subject: Rename No_Direct_access_Test and change the require_once to fully qualify the path to Gallery_Filters.php --- modules/gallery/tests/File_Structure_Test.php | 2 +- modules/gallery/tests/No_Direct_ORM_Access_Test.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php index 327b6be8..36342fda 100644 --- a/modules/gallery/tests/File_Structure_Test.php +++ b/modules/gallery/tests/File_Structure_Test.php @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -require_once(dirname(__FILE__) . "/Gallery_Filters.php"); +require_once(MODPATH . "gallery/tests/Gallery_Filters.php"); class File_Structure_Test extends Unit_Test_Case { public function no_trailing_closing_php_tag_test() { diff --git a/modules/gallery/tests/No_Direct_ORM_Access_Test.php b/modules/gallery/tests/No_Direct_ORM_Access_Test.php index c6d8df95..440321fa 100644 --- a/modules/gallery/tests/No_Direct_ORM_Access_Test.php +++ b/modules/gallery/tests/No_Direct_ORM_Access_Test.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. */ -require_once("Gallery_Filters.php"); +require_once(MODPATH . "gallery/tests/Gallery_Filters.php"); -class No_Direct_Access_Test extends Unit_Test_Case { +class No_Direct_ORM_Access_Test extends Unit_Test_Case { public function no_access_to_users_table_test() { $dir = new UserModuleFilterIterator( new PhpCodeFilterIterator( -- cgit v1.2.3 From 36adc11f058404c78bf0d804d8fe5be6cfa6f515 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 22 Oct 2009 13:30:32 -0700 Subject: move the direct orm test to the users module. --- .../gallery/tests/No_Direct_ORM_Access_Test.php | 77 ---------------------- modules/user/tests/No_Direct_ORM_Access_Test.php | 77 ++++++++++++++++++++++ 2 files changed, 77 insertions(+), 77 deletions(-) delete mode 100644 modules/gallery/tests/No_Direct_ORM_Access_Test.php create mode 100644 modules/user/tests/No_Direct_ORM_Access_Test.php (limited to 'modules/gallery') diff --git a/modules/gallery/tests/No_Direct_ORM_Access_Test.php b/modules/gallery/tests/No_Direct_ORM_Access_Test.php deleted file mode 100644 index 440321fa..00000000 --- a/modules/gallery/tests/No_Direct_ORM_Access_Test.php +++ /dev/null @@ -1,77 +0,0 @@ - $line) { - if (preg_match('/ORM::factory\\(\"user\"/', $line)) { - $errors[] = "$file($l) => $line"; - } - } - } - $file_as_string = null; - } - if ($errors) { - $this->assert_false(true, "Direct access to the users table found:\n" . join("\n", $errors)); - } - } - - public function no_access_to_groups_table_test() { - $dir = new UserModuleFilterIterator( - new PhpCodeFilterIterator( - new GalleryCodeFilterIterator( - new RecursiveIteratorIterator( - new RecursiveDirectoryIterator(DOCROOT))))); - $errors = array(); - foreach ($dir as $file) { - $file_as_string = file_get_contents($file); - if (preg_match("/ORM::factory\\(\"group\"/", $file_as_string)) { - foreach (split("\n", $file_as_string) as $l => $line) { - if (preg_match('/ORM::factory\\(\"group\"/', $line)) { - $errors[] = "$file($l) => $line"; - } - } - } - $file_as_string = null; - } - if ($errors) { - $this->assert_false(true, "Direct access to the groups table found:\n" . join("\n", $errors)); - } - } - -} - -class UserModuleFilterIterator extends FilterIterator { - public function accept() { - $path_name = $this->getInnerIterator()->getPathName(); - return strpos($path_name, "/modules/user") === false; - } -} diff --git a/modules/user/tests/No_Direct_ORM_Access_Test.php b/modules/user/tests/No_Direct_ORM_Access_Test.php new file mode 100644 index 00000000..440321fa --- /dev/null +++ b/modules/user/tests/No_Direct_ORM_Access_Test.php @@ -0,0 +1,77 @@ + $line) { + if (preg_match('/ORM::factory\\(\"user\"/', $line)) { + $errors[] = "$file($l) => $line"; + } + } + } + $file_as_string = null; + } + if ($errors) { + $this->assert_false(true, "Direct access to the users table found:\n" . join("\n", $errors)); + } + } + + public function no_access_to_groups_table_test() { + $dir = new UserModuleFilterIterator( + new PhpCodeFilterIterator( + new GalleryCodeFilterIterator( + new RecursiveIteratorIterator( + new RecursiveDirectoryIterator(DOCROOT))))); + $errors = array(); + foreach ($dir as $file) { + $file_as_string = file_get_contents($file); + if (preg_match("/ORM::factory\\(\"group\"/", $file_as_string)) { + foreach (split("\n", $file_as_string) as $l => $line) { + if (preg_match('/ORM::factory\\(\"group\"/', $line)) { + $errors[] = "$file($l) => $line"; + } + } + } + $file_as_string = null; + } + if ($errors) { + $this->assert_false(true, "Direct access to the groups table found:\n" . join("\n", $errors)); + } + } + +} + +class UserModuleFilterIterator extends FilterIterator { + public function accept() { + $path_name = $this->getInnerIterator()->getPathName(); + return strpos($path_name, "/modules/user") === false; + } +} -- cgit v1.2.3 From ba62fb4b0e9fe2d64803c165a21756e0919c0238 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Thu, 22 Oct 2009 22:06:36 -0600 Subject: Standardize message markup, make the update block status message translatable. --- modules/gallery/controllers/admin_sidebar.php | 3 ++- modules/gallery/views/admin_sidebar.html.php | 8 +++++--- modules/tag/js/tag.js | 5 ++++- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/admin_sidebar.php b/modules/gallery/controllers/admin_sidebar.php index f029d259..c83b5a37 100644 --- a/modules/gallery/controllers/admin_sidebar.php +++ b/modules/gallery/controllers/admin_sidebar.php @@ -47,7 +47,8 @@ class Admin_Sidebar_Controller extends Admin_Controller { $v = new View("admin_sidebar_blocks.html"); $v->blocks = $active; $result["active"] = $v->render(); - + $message = t("Updated sidebar blocks"); + $result["message"] = (string) $message; print json_encode($result); } diff --git a/modules/gallery/views/admin_sidebar.html.php b/modules/gallery/views/admin_sidebar.html.php index f784b1a5..7c97270c 100644 --- a/modules/gallery/views/admin_sidebar.html.php +++ b/modules/gallery/views/admin_sidebar.html.php @@ -21,10 +21,12 @@ if (data.result == "success") { $("ul#g-available-blocks").html(data.available); $("ul#g-active-blocks").html(data.active); - var message = "Updated blocks"; $("#g-action-status").remove(); - $("#g-block-admin").before("
        • " + message + "
        "); - $("#g-action-status").fadeTo(1000,1).fadeTo(2000,0); + var message = "
          "; + message += "
        • " + data.message + "
        • "; + message += "
        "; + $("#g-block-admin").before(message); + $("#g-action-status li").gallery_show_message(); } }); } diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js index ed977480..8cb4e571 100644 --- a/modules/tag/js/tag.js +++ b/modules/tag/js/tag.js @@ -72,7 +72,10 @@ function editInPlace(element) { $("#g-rename-tag-form #name") .addClass("g-error") .focus(); - $("#g-tag-admin").before("

        " + data.message + "

        "); + var message = "
          "; + message += "
        • " + data.message + "
        • "; + message += "
        "; + $("#g-tag-admin").before(message); } } }); -- cgit v1.2.3 From 80c6bf789b4a9925e86abdb3275cc570f9c2d6ad Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Thu, 22 Oct 2009 22:28:55 -0600 Subject: Make g-inline more specific, replace universal selector with an li since this class will most often be used with order and unordered lists. Apply g-inline to the the login menu and footer credits. --- lib/gallery.common.css | 2 +- modules/gallery/views/login.html.php | 2 +- themes/night_wind/css/screen.css | 13 ++++--------- themes/night_wind/views/page.html.php | 4 ++-- themes/wind/css/screen.css | 15 ++++++--------- themes/wind/views/page.html.php | 4 ++-- 6 files changed, 16 insertions(+), 24 deletions(-) (limited to 'modules/gallery') diff --git a/lib/gallery.common.css b/lib/gallery.common.css index 77653d00..51d50dfc 100644 --- a/lib/gallery.common.css +++ b/lib/gallery.common.css @@ -482,7 +482,7 @@ div#g-action-status { /* Inline layout ~~~~~~~~~~ */ -.g-inline * { +.g-inline li { float: left; margin-right: .4em; } diff --git a/modules/gallery/views/login.html.php b/modules/gallery/views/login.html.php index 9be218c0..3b327e31 100644 --- a/modules/gallery/views/login.html.php +++ b/modules/gallery/views/login.html.php @@ -1,5 +1,5 @@ -
          +
            guest): ?>
          • " diff --git a/themes/night_wind/css/screen.css b/themes/night_wind/css/screen.css index 7711a329..dfc94b6d 100644 --- a/themes/night_wind/css/screen.css +++ b/themes/night_wind/css/screen.css @@ -446,15 +446,6 @@ li.g-error select { /* Footer content ~~~~~~~~~~~~~~~~~~~~~~~~ */ -#g-banner #g-login-menu li, -#g-footer #g-credits li { - display: inline; -} - -#g-banner #g-login-menu li { - padding-left: 1.2em; -} - #g-footer #g-credits li { padding-right: 1.2em; } @@ -480,6 +471,10 @@ li.g-error select { float: right; } +#g-banner #g-login-menu li { + padding-left: 1.2em; +} + /* Site Menu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ #g-site-menu { diff --git a/themes/night_wind/views/page.html.php b/themes/night_wind/views/page.html.php index f5c6b0df..a14a3278 100644 --- a/themes/night_wind/views/page.html.php +++ b/themes/night_wind/views/page.html.php @@ -124,14 +124,14 @@ - -
    for_html_attr() ?>" /> diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php index 7ad75f85..ac597715 100644 --- a/modules/gallery/views/admin_maintenance.html.php +++ b/modules/gallery/views/admin_maintenance.html.php @@ -20,9 +20,8 @@ - - severity) ?>"> + severity) ?>"> name ?> @@ -36,7 +35,6 @@ -
    @@ -68,9 +66,8 @@ - - state == "stalled" ? "g-warning" : "" ?>"> + state == "stalled" ? "g-warning" : "" ?>"> "> updated) ?> @@ -108,7 +105,6 @@ -
    @@ -141,9 +137,8 @@ - - state == "success" ? "g-success" : "g-error" ?>"> + state == "success" ? "g-success" : "g-error" ?>"> "> updated) ?> @@ -187,7 +182,6 @@ - diff --git a/modules/gallery/views/admin_modules.html.php b/modules/gallery/views/admin_modules.html.php index 4c4976f8..aebedf09 100644 --- a/modules/gallery/views/admin_modules.html.php +++ b/modules/gallery/views/admin_modules.html.php @@ -15,9 +15,8 @@ - $module_info): ?> - "> + "> $module_name); ?> locked) $data["disabled"] = 1; ?> @@ -25,7 +24,6 @@ version ?> description) ?> - for_html_attr() ?>" /> -- cgit v1.2.3 From 9379308f91a476f790fb8d444536719535c584e4 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 15 Nov 2009 19:36:02 -0800 Subject: Xss data update --- modules/gallery/tests/xss_data.txt | 50 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index ef386906..9146ddb2 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -1,12 +1,12 @@ modules/akismet/views/admin_akismet.html.php 16 DIRTY $form modules/akismet/views/admin_akismet_stats.html.php 9 DIRTY_ATTR $api_key modules/akismet/views/admin_akismet_stats.html.php 9 DIRTY_ATTR urlencode($blog_url) -modules/comment/views/admin_block_recent_comments.html.php 4 DIRTY_ATTR ($i%2==0)?"g-even":"g-odd" +modules/comment/views/admin_block_recent_comments.html.php 4 DIRTY_ATTR text::alternate("g-even","g-odd") modules/comment/views/admin_block_recent_comments.html.php 5 DIRTY_ATTR $comment->author()->avatar_url(32,$theme->url(,true)) modules/comment/views/admin_block_recent_comments.html.php 10 DIRTY gallery::date_time($comment->created) modules/comment/views/admin_comments.html.php 43 DIRTY $menu->render() modules/comment/views/admin_comments.html.php 107 DIRTY_ATTR $comment->id -modules/comment/views/admin_comments.html.php 107 DIRTY_ATTR ($i%2==0)?"g-odd":"g-even" +modules/comment/views/admin_comments.html.php 107 DIRTY_ATTR text::alternate("g-odd","g-even") modules/comment/views/admin_comments.html.php 110 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true)) modules/comment/views/admin_comments.html.php 123 DIRTY_JS $item->url() modules/comment/views/admin_comments.html.php 125 DIRTY_ATTR $item->thumb_url() @@ -40,8 +40,8 @@ modules/digibug/views/digibug_form.html.php 6 DIRTY form:: modules/exif/views/exif_dialog.html.php 14 DIRTY $details[$i]["caption"] modules/exif/views/exif_dialog.html.php 21 DIRTY $details[$i]["caption"] modules/g2_import/views/admin_g2_import.html.php 29 DIRTY $form -modules/gallery/views/admin_advanced_settings.html.php 22 DIRTY_ATTR ($i%2==0)?"g-odd":"g-even" -modules/gallery/views/admin_advanced_settings.html.php 23 DIRTY $var->module_name +modules/gallery/views/admin_advanced_settings.html.php 21 DIRTY_ATTR text::alternate("g-odd","g-even") +modules/gallery/views/admin_advanced_settings.html.php 22 DIRTY $var->module_name modules/gallery/views/admin_block_log_entries.html.php 4 DIRTY_ATTR log::severity_class($entry->severity) modules/gallery/views/admin_block_log_entries.html.php 6 DIRTY gallery::date_time($entry->timestamp) modules/gallery/views/admin_block_log_entries.html.php 7 DIRTY $entry->message @@ -67,8 +67,8 @@ modules/gallery/views/admin_graphics_imagemagick.html.php 2 DIRTY_ATTR $is_ modules/gallery/views/admin_graphics_imagemagick.html.php 2 DIRTY_ATTR $tk->installed?" g-installed-toolkit":" g-unavailable" modules/gallery/views/admin_graphics_imagemagick.html.php 18 DIRTY $tk->error modules/gallery/views/admin_identity.html.php 43 DIRTY access::csrf_form_field() -modules/gallery/views/admin_identity.html.php 51 DIRTY_ATTR ($i%2==0)?"g-odd":"g-even" -modules/gallery/views/admin_identity.html.php 53 DIRTY form::radio($data,$module_name,$module_name==$active) +modules/gallery/views/admin_identity.html.php 50 DIRTY_ATTR text::alternate("g-odd","g-even") +modules/gallery/views/admin_identity.html.php 52 DIRTY form::radio($data,$module_name,$module_name==$active) modules/gallery/views/admin_identity_confirm.html.php 3 DIRTY access::csrf_form_field() modules/gallery/views/admin_identity_confirm.html.php 4 DIRTY form::hidden("provider",$new_provider) modules/gallery/views/admin_languages.html.php 43 DIRTY access::csrf_form_field() @@ -78,30 +78,30 @@ modules/gallery/views/admin_languages.html.php 61 DIRTY form:: modules/gallery/views/admin_languages.html.php 62 DIRTY $display_name modules/gallery/views/admin_languages.html.php 64 DIRTY form::radio("default_locale",$code,($default_locale==$code),((isset($installed_locales[$code]))?'':'disabled="disabled"')) modules/gallery/views/admin_languages.html.php 109 DIRTY $share_translations_form -modules/gallery/views/admin_maintenance.html.php 25 DIRTY_ATTR ($i%2==0)?"g-odd":"g-even" +modules/gallery/views/admin_maintenance.html.php 24 DIRTY_ATTR text::alternate("g-odd","g-even") +modules/gallery/views/admin_maintenance.html.php 24 DIRTY_ATTR log::severity_class($task->severity) modules/gallery/views/admin_maintenance.html.php 25 DIRTY_ATTR log::severity_class($task->severity) -modules/gallery/views/admin_maintenance.html.php 26 DIRTY_ATTR log::severity_class($task->severity) -modules/gallery/views/admin_maintenance.html.php 27 DIRTY $task->name -modules/gallery/views/admin_maintenance.html.php 30 DIRTY $task->description -modules/gallery/views/admin_maintenance.html.php 73 DIRTY_ATTR ($i%2==0)?"g-odd":"g-even" -modules/gallery/views/admin_maintenance.html.php 73 DIRTY_ATTR $task->state=="stalled"?"g-warning":"" -modules/gallery/views/admin_maintenance.html.php 74 DIRTY_ATTR $task->state=="stalled"?"g-warning":"" -modules/gallery/views/admin_maintenance.html.php 75 DIRTY gallery::date_time($task->updated) -modules/gallery/views/admin_maintenance.html.php 78 DIRTY $task->name -modules/gallery/views/admin_maintenance.html.php 93 DIRTY $task->status -modules/gallery/views/admin_maintenance.html.php 146 DIRTY_ATTR ($i%2==0)?"g-odd":"g-even" -modules/gallery/views/admin_maintenance.html.php 146 DIRTY_ATTR $task->state=="success"?"g-success":"g-error" -modules/gallery/views/admin_maintenance.html.php 147 DIRTY_ATTR $task->state=="success"?"g-success":"g-error" -modules/gallery/views/admin_maintenance.html.php 148 DIRTY gallery::date_time($task->updated) -modules/gallery/views/admin_maintenance.html.php 151 DIRTY $task->name -modules/gallery/views/admin_maintenance.html.php 163 DIRTY $task->status +modules/gallery/views/admin_maintenance.html.php 26 DIRTY $task->name +modules/gallery/views/admin_maintenance.html.php 29 DIRTY $task->description +modules/gallery/views/admin_maintenance.html.php 70 DIRTY_ATTR text::alternate("g-odd","g-even") +modules/gallery/views/admin_maintenance.html.php 70 DIRTY_ATTR $task->state=="stalled"?"g-warning":"" +modules/gallery/views/admin_maintenance.html.php 71 DIRTY_ATTR $task->state=="stalled"?"g-warning":"" +modules/gallery/views/admin_maintenance.html.php 72 DIRTY gallery::date_time($task->updated) +modules/gallery/views/admin_maintenance.html.php 75 DIRTY $task->name +modules/gallery/views/admin_maintenance.html.php 90 DIRTY $task->status +modules/gallery/views/admin_maintenance.html.php 141 DIRTY_ATTR text::alternate("g-odd","g-even") +modules/gallery/views/admin_maintenance.html.php 141 DIRTY_ATTR $task->state=="success"?"g-success":"g-error" +modules/gallery/views/admin_maintenance.html.php 142 DIRTY_ATTR $task->state=="success"?"g-success":"g-error" +modules/gallery/views/admin_maintenance.html.php 143 DIRTY gallery::date_time($task->updated) +modules/gallery/views/admin_maintenance.html.php 146 DIRTY $task->name +modules/gallery/views/admin_maintenance.html.php 158 DIRTY $task->status modules/gallery/views/admin_maintenance_show_log.html.php 8 DIRTY_JS url::site("admin/maintenance/save_log/$task->id?csrf=$csrf") modules/gallery/views/admin_maintenance_show_log.html.php 13 DIRTY $task->name modules/gallery/views/admin_maintenance_task.html.php 55 DIRTY $task->name modules/gallery/views/admin_modules.html.php 10 DIRTY access::csrf_form_field() -modules/gallery/views/admin_modules.html.php 20 DIRTY_ATTR ($i%2==0)?"g-odd":"g-even" -modules/gallery/views/admin_modules.html.php 23 DIRTY form::checkbox($data,'1',module::is_active($module_name)) -modules/gallery/views/admin_modules.html.php 25 DIRTY $module_info->version +modules/gallery/views/admin_modules.html.php 19 DIRTY_ATTR text::alternate("g-odd","g-even") +modules/gallery/views/admin_modules.html.php 22 DIRTY form::checkbox($data,'1',module::is_active($module_name)) +modules/gallery/views/admin_modules.html.php 24 DIRTY $module_info->version modules/gallery/views/admin_sidebar.html.php 50 DIRTY $available modules/gallery/views/admin_sidebar.html.php 58 DIRTY $active modules/gallery/views/admin_sidebar_blocks.html.php 4 DIRTY_ATTR $ref -- cgit v1.2.3