From 04b90c3bdef9b2f4daf8bffc1e814b0bac9912f4 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 15 May 2010 23:42:55 -0700 Subject: Remove the item id from the rest/gallery/items url as that was inconsistent. Add the query parameter ancestors_for= to provide a restful way to retrieve the ancestors of an item. (cherry picked from commit e9c8a8ae532e785ab95e6b43864c93b485785d6c) Conflicts: modules/gallery/helpers/items_rest.php --- modules/gallery/tests/Items_Rest_Helper_Test.php | 103 +++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 modules/gallery/tests/Items_Rest_Helper_Test.php (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/Items_Rest_Helper_Test.php b/modules/gallery/tests/Items_Rest_Helper_Test.php new file mode 100644 index 00000000..cd01ae0c --- /dev/null +++ b/modules/gallery/tests/Items_Rest_Helper_Test.php @@ -0,0 +1,103 @@ +reload(); + $album2->reload(); + + $request = new stdClass(); + $request->params = new stdClass(); + $request->params->urls = json_encode(array( + rest::url("item", $photo1), + rest::url("item", $album2))); + $this->assert_equal_array( + array( + array("url" => rest::url("item", $photo1), + "entity" => $photo1->as_restful_array(), + "relationships" => array( + "tags" => array( + "url" => rest::url("item_tags", $photo1), + "members" => array()))), + array("url" => rest::url("item", $album2), + "entity" => $album2->as_restful_array(), + "relationships" => array( + "tags" => array( + "url" => rest::url("item_tags", $album2), + "members" => array())), + "members" => array( + rest::url("item", $photo2)))), + items_rest::get($request)); + } + + public function get_ancestor_test() { + $album1 = test::random_album(); + $photo1 = test::random_photo($album1); + $album2 = test::random_album($album1); + $photo2 = test::random_photo($album2); + $album1->reload(); + $album2->reload(); + + $root = ORM::factory("item", 1); + $restful_root = array( + "url" => rest::url("item", $root), + "entity" => $root->as_restful_array(), + "relationships" => rest::relationships("item", $root)); + $restful_root["members"] = array(); + foreach ($root->children() as $child) { + $restful_root["members"][] = rest::url("item", $child); + } + + $request = new stdClass(); + $request->params = new stdClass(); + $request->params->ancestor_for = rest::url("item", $photo2); + $this->assert_equal_array( + array( + $restful_root, + array("url" => rest::url("item", $album1), + "entity" => $album1->as_restful_array(), + "relationships" => array( + "tags" => array( + "url" => rest::url("item_tags", $album1), + "members" => array())), + "members" => array( + rest::url("item", $photo1), + rest::url("item", $album2)), + ), + array("url" => rest::url("item", $album2), + "entity" => $album2->as_restful_array(), + "relationships" => array( + "tags" => array( + "url" => rest::url("item_tags", $album2), + "members" => array())), + "members" => array( + rest::url("item", $photo2))), + array("url" => rest::url("item", $photo2), + "entity" => $photo2->as_restful_array(), + "relationships" => array( + "tags" => array( + "url" => rest::url("item_tags", $photo2), + "members" => array())))), + items_rest::get($request)); + } +} -- cgit v1.2.3 From a600185b605a37ca1b60cb6d9814d5441f54cd88 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 10 May 2010 06:31:38 -0700 Subject: Allow the use of the type query parameter to filter the results of a rest/gallery/items?urls=... request. This allows the client to pass the entire list of member urls and have the rest server filter the results based on the specified types. (cherry picked from commit 3fe10b15cf9359b66452c24965df575203e8af8e) --- modules/gallery/helpers/items_rest.php | 22 ++++-- modules/gallery/tests/Items_Rest_Helper_Test.php | 85 ++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 4 deletions(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/helpers/items_rest.php b/modules/gallery/helpers/items_rest.php index 4f50e434..32597a65 100644 --- a/modules/gallery/helpers/items_rest.php +++ b/modules/gallery/helpers/items_rest.php @@ -19,23 +19,37 @@ */ class items_rest_Core { /** - * To retrieve a collection of items, you can specify the following query parameters to specify the - * type of the collection. If both are specified, then the url parameter is used and the - * ancestor_for is ignored. + * To retrieve a collection of items, you can specify the following query parameters to specify + * the type of the collection. If both are specified, then the url parameter is used and the + * ancestor_for is ignored. Specifying the "type" parameter with the urls parameter, will + * filter the results based on the specified type. Using the type parameter with the + * ancestor_for parameter makes no sense and will be ignored. * * urls=url1,url2,url3 * return items that match the specified urls. Typically used to return the member detail * * ancestor_for=url * return the ancestors of the specified item + * + * type= + * limit the type to types in this list. eg, "type=photo,movie" */ static function get($request) { $items = array(); if (isset($request->params->urls)) { foreach (json_decode($request->params->urls) as $url) { + if (isset($request->params->type)) { + $types = explode(",", $request->params->type); + } $item = rest::resolve($url); if (access::can("view", $item)) { - $items[] = items_rest::format_restful_item($item); + if (isset($types)) { + if (in_array($item->type, $types)) { + $items[] = items_rest::format_restful_item($item); + } + } else { + $items[] = items_rest::format_restful_item($item); + } } } } else if (isset($request->params->ancestor_for)) { diff --git a/modules/gallery/tests/Items_Rest_Helper_Test.php b/modules/gallery/tests/Items_Rest_Helper_Test.php index cd01ae0c..94bf912a 100644 --- a/modules/gallery/tests/Items_Rest_Helper_Test.php +++ b/modules/gallery/tests/Items_Rest_Helper_Test.php @@ -50,6 +50,91 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { items_rest::get($request)); } + public function get_url_filter_album_test() { + $album1 = test::random_album(); + $photo1 = test::random_photo($album1); + $album2 = test::random_album($album1); + $photo2 = test::random_photo($album2); + $album1->reload(); + $album2->reload(); + + $request = new stdClass(); + $request->params = new stdClass(); + $request->params->urls = json_encode(array( + rest::url("item", $photo1), + rest::url("item", $album2))); + $request->params->type = "album"; + $this->assert_equal_array( + array( + array("url" => rest::url("item", $album2), + "entity" => $album2->as_restful_array(), + "relationships" => array( + "tags" => array( + "url" => rest::url("item_tags", $album2), + "members" => array())), + "members" => array( + rest::url("item", $photo2)))), + items_rest::get($request)); + } + + public function get_url_filter_photo_test() { + $album1 = test::random_album(); + $photo1 = test::random_photo($album1); + $album2 = test::random_album($album1); + $photo2 = test::random_photo($album2); + $album1->reload(); + $album2->reload(); + + $request = new stdClass(); + $request->params = new stdClass(); + $request->params->urls = json_encode(array( + rest::url("item", $photo1), + rest::url("item", $album2))); + $request->params->type = "photo"; + $this->assert_equal_array( + array( + array("url" => rest::url("item", $photo1), + "entity" => $photo1->as_restful_array(), + "relationships" => array( + "tags" => array( + "url" => rest::url("item_tags", $photo1), + "members" => array())))), + items_rest::get($request)); + } + + public function get_url_filter_albums_photos_test() { + $album1 = test::random_album(); + $photo1 = test::random_photo($album1); + $album2 = test::random_album($album1); + $photo2 = test::random_photo($album2); + $album1->reload(); + $album2->reload(); + + $request = new stdClass(); + $request->params = new stdClass(); + $request->params->urls = json_encode(array( + rest::url("item", $photo1), + rest::url("item", $album2))); + $request->params->type = "photo,album"; + $this->assert_equal_array( + array( + array("url" => rest::url("item", $photo1), + "entity" => $photo1->as_restful_array(), + "relationships" => array( + "tags" => array( + "url" => rest::url("item_tags", $photo1), + "members" => array()))), + array("url" => rest::url("item", $album2), + "entity" => $album2->as_restful_array(), + "relationships" => array( + "tags" => array( + "url" => rest::url("item_tags", $album2), + "members" => array())), + "members" => array( + rest::url("item", $photo2)))), + items_rest::get($request)); + } + public function get_ancestor_test() { $album1 = test::random_album(); $photo1 = test::random_photo($album1); -- cgit v1.2.3 From fd437aec2bbd3e65b330b0790af970ca7e078636 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 4 Jun 2010 13:58:49 -0700 Subject: Correct XSS Security Test golden file for recent changes. Update the controller_auth data file for the rename of admin_comments to admin_manage_comments. --- modules/gallery/tests/controller_auth_data.txt | 2 +- modules/gallery/tests/xss_data.txt | 37 +++++++++++++------------- 2 files changed, 19 insertions(+), 20 deletions(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/controller_auth_data.txt b/modules/gallery/tests/controller_auth_data.txt index 0aa26057..94e7a07f 100644 --- a/modules/gallery/tests/controller_auth_data.txt +++ b/modules/gallery/tests/controller_auth_data.txt @@ -1,4 +1,4 @@ -modules/comment/controllers/admin_comments.php queue DIRTY_CSRF +modules/comment/controllers/admin_manage_comments.php queue DIRTY_CSRF modules/comment/helpers/comment_rss.php feed DIRTY_AUTH modules/digibug/controllers/digibug.php print_proxy DIRTY_CSRF|DIRTY_AUTH modules/digibug/controllers/digibug.php close_window DIRTY_AUTH diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index afad9e13..0a75d6f7 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -4,21 +4,21 @@ modules/akismet/views/admin_akismet_stats.html.php 9 DIRTY_ATTR urle 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 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() -modules/comment/views/admin_comments.html.php 127 DIRTY photo::img_dimensions($item->thumb_width,$item->thumb_height,75) -modules/comment/views/admin_comments.html.php 135 DIRTY gallery::date($comment->created) -modules/comment/views/admin_comments.html.php 142 DIRTY_JS $comment->id -modules/comment/views/admin_comments.html.php 151 DIRTY_JS $comment->id -modules/comment/views/admin_comments.html.php 160 DIRTY_JS $comment->id -modules/comment/views/admin_comments.html.php 169 DIRTY_JS $comment->id -modules/comment/views/admin_comments.html.php 176 DIRTY_JS $comment->id -modules/comment/views/admin_comments.html.php 184 DIRTY_JS $comment->id -modules/comment/views/admin_comments.html.php 197 DIRTY $pager +modules/comment/views/admin_manage_comments.html.php 43 DIRTY $menu->render() +modules/comment/views/admin_manage_comments.html.php 107 DIRTY_ATTR $comment->id +modules/comment/views/admin_manage_comments.html.php 107 DIRTY_ATTR text::alternate("g-odd","g-even") +modules/comment/views/admin_manage_comments.html.php 110 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true)) +modules/comment/views/admin_manage_comments.html.php 123 DIRTY_JS $item->url() +modules/comment/views/admin_manage_comments.html.php 125 DIRTY_ATTR $item->thumb_url() +modules/comment/views/admin_manage_comments.html.php 127 DIRTY photo::img_dimensions($item->thumb_width,$item->thumb_height,75) +modules/comment/views/admin_manage_comments.html.php 135 DIRTY gallery::date($comment->created) +modules/comment/views/admin_manage_comments.html.php 142 DIRTY_JS $comment->id +modules/comment/views/admin_manage_comments.html.php 151 DIRTY_JS $comment->id +modules/comment/views/admin_manage_comments.html.php 160 DIRTY_JS $comment->id +modules/comment/views/admin_manage_comments.html.php 169 DIRTY_JS $comment->id +modules/comment/views/admin_manage_comments.html.php 176 DIRTY_JS $comment->id +modules/comment/views/admin_manage_comments.html.php 184 DIRTY_JS $comment->id +modules/comment/views/admin_manage_comments.html.php 197 DIRTY $pager modules/comment/views/comment.html.php 2 DIRTY_ATTR $comment->id; modules/comment/views/comment.html.php 5 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true)) modules/comment/views/comment.mrss.php 10 DIRTY $feed->uri @@ -175,7 +175,7 @@ modules/gallery/views/move_tree.html.php 15 DIRTY_JS $child modules/gallery/views/movieplayer.html.php 2 DIRTY html::anchor($item->file_url(true),"",$attrs) modules/gallery/views/movieplayer.html.php 5 DIRTY_JS $attrs["id"] modules/gallery/views/movieplayer.html.php 7 DIRTY_JS url::abs_file("lib/flowplayer.swf") -modules/gallery/views/movieplayer.html.php 13 DIRTY_JS url::abs_file("lib/flowplayer.h264streaming.swf") +modules/gallery/views/movieplayer.html.php 14 DIRTY_JS url::abs_file("lib/flowplayer.pseudostreaming.swf") modules/gallery/views/permissions_browse.html.php 3 DIRTY_JS url::site("permissions/form/__ITEM__") modules/gallery/views/permissions_browse.html.php 16 DIRTY_JS url::site("permissions/change/__CMD__/__GROUP__/__PERM__/__ITEM__?csrf=$csrf") modules/gallery/views/permissions_browse.html.php 43 DIRTY_ATTR $parent->id @@ -320,7 +320,6 @@ modules/user/views/admin_users_group.html.php 24 DIRTY_JS $group modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $width modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $height modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $url -themes/admin_wind/views/admin.html.php 9 DIRTY $page_title themes/admin_wind/views/admin.html.php 22 DIRTY_JS $theme->url() themes/admin_wind/views/admin.html.php 39 DIRTY $theme->admin_head() themes/admin_wind/views/admin.html.php 43 DIRTY $theme->admin_page_top() @@ -363,7 +362,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/dynamic.html.php 29 DIRTY $theme->paginator() themes/wind/views/movie.html.php 5 DIRTY $theme->paginator() -themes/wind/views/movie.html.php 8 DIRTY $item->movie_img(array("class"=>"g-movie","id"=>"g-movie-id-{$item->id}")) +themes/wind/views/movie.html.php 8 DIRTY $item->movie_img(array("class"=>"g-movie","id"=>"g-item-id-{$item->id}")) themes/wind/views/page.html.php 9 DIRTY $page_title themes/wind/views/page.html.php 33 DIRTY_JS $theme->url() themes/wind/views/page.html.php 42 DIRTY $new_width @@ -384,4 +383,4 @@ themes/wind/views/photo.html.php 8 DIRTY_JS $theme themes/wind/views/photo.html.php 8 DIRTY_JS $theme->item()->height themes/wind/views/photo.html.php 18 DIRTY $theme->paginator() themes/wind/views/photo.html.php 23 DIRTY_JS $item->file_url() -themes/wind/views/photo.html.php 25 DIRTY $item->resize_img(array("id"=>"g-photo-id-{$item->id}","class"=>"g-resize")) +themes/wind/views/photo.html.php 25 DIRTY $item->resize_img(array("id"=>"g-item-id-{$item->id}","class"=>"g-resize")) -- cgit v1.2.3 From 98fce83de5f772482382bfabdbcd94c25ecdbb1a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 7 Jun 2010 22:23:46 -0700 Subject: Add a "convert_ids" parameter to Item_Model::as_restful_array(), which we can turn on with a query parameter. --- modules/gallery/models/item.php | 20 ++++++++++++-------- modules/gallery/tests/Item_Model_Test.php | 12 ++++++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 409ed3cc..dfcbdd70 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -924,17 +924,21 @@ class Item_Model extends ORM_MPTT { /** * Same as ORM::as_array() but convert id fields into their RESTful form. */ - public function as_restful_array() { + public function as_restful_array($convert_ids=true) { // Convert item ids to rest URLs for consistency $data = $this->as_array(); - if ($tmp = $this->parent()) { - $data["parent"] = rest::url("item", $tmp); - } - unset($data["parent_id"]); - if ($tmp = $this->album_cover()) { - $data["album_cover"] = rest::url("item", $tmp); + + if ($convert_ids) { + if ($tmp = $this->parent()) { + $data["parent"] = rest::url("item", $tmp); + } + unset($data["parent_id"]); + + if ($tmp = $this->album_cover()) { + $data["album_cover"] = rest::url("item", $tmp); + } + unset($data["album_cover_item_id"]); } - unset($data["album_cover_item_id"]); if (access::can("view_full", $this) && $this->is_photo()) { $data["file_url"] = $this->file_url(true); diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php index 15aa2d8c..9d3f54f2 100644 --- a/modules/gallery/tests/Item_Model_Test.php +++ b/modules/gallery/tests/Item_Model_Test.php @@ -364,6 +364,18 @@ class Item_Model_Test extends Gallery_Unit_Test_Case { $this->assert_true(!array_key_exists("album_cover_item_id", $result)); } + public function as_restful_array_with_ids_test() { + $album = test::random_album(); + $photo = test::random_photo($album); + $album->reload(); + + $result = $album->as_restful_array(false); + $this->assert_same(item::root()->id, $result["parent_id"]); + $this->assert_same($photo->id, $result["album_cover_item_id"]); + $this->assert_true(!array_key_exists("parent", $result)); + $this->assert_true(!array_key_exists("album_cover_item", $result)); + } + public function first_photo_becomes_album_cover() { $album = test::random_album(); $photo = test::random_photo($album); -- cgit v1.2.3 From 6425d41eddd44091b2d83ba3c3734cc6990ca581 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 7 Jun 2010 23:12:52 -0700 Subject: Add a "preserve_ids" global query parameter for REST requests that indicates that we shouldn't opportunistically convert ids into REST urls. --- modules/gallery/helpers/item_rest.php | 3 +- modules/gallery/helpers/items_rest.php | 14 ++++++---- modules/gallery/models/item.php | 7 +++-- modules/gallery/tests/Item_Model_Test.php | 4 +-- modules/gallery/tests/Item_Rest_Helper_Test.php | 21 ++++++++++---- modules/gallery/tests/Items_Rest_Helper_Test.php | 35 ++++++++++++++++-------- 6 files changed, 57 insertions(+), 27 deletions(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/helpers/item_rest.php b/modules/gallery/helpers/item_rest.php index c88f92d9..1d19d9f1 100644 --- a/modules/gallery/helpers/item_rest.php +++ b/modules/gallery/helpers/item_rest.php @@ -78,9 +78,10 @@ class item_rest_Core { } $orm->order_by($order_by); + $preserve_ids = isset($p->preserve_ids) ? (bool)$p->preserve_ids : false; $result = array( "url" => $request->url, - "entity" => $item->as_restful_array(), + "entity" => $item->as_restful_array($preserve_ids), "relationships" => rest::relationships("item", $item)); if ($item->is_album()) { $result["members"] = array(); diff --git a/modules/gallery/helpers/items_rest.php b/modules/gallery/helpers/items_rest.php index 9cca9a54..e9773745 100644 --- a/modules/gallery/helpers/items_rest.php +++ b/modules/gallery/helpers/items_rest.php @@ -36,6 +36,8 @@ class items_rest_Core { */ static function get($request) { $items = array(); + $preserve_ids = isset($request->params->preserve_ids) ? + (bool)$request->params->preserve_ids : false; if (isset($request->params->urls)) { foreach (json_decode($request->params->urls) as $url) { if (isset($request->params->type)) { @@ -45,10 +47,10 @@ class items_rest_Core { if (access::can("view", $item)) { if (isset($types)) { if (in_array($item->type, $types)) { - $items[] = items_rest::_format_restful_item($item); + $items[] = items_rest::_format_restful_item($item, $preserve_ids); } } else { - $items[] = items_rest::_format_restful_item($item); + $items[] = items_rest::_format_restful_item($item, $preserve_ids); } } } @@ -57,9 +59,9 @@ class items_rest_Core { if (!access::can("view", $item)) { throw new Kohana_404_Exception(); } - $items[] = items_rest::_format_restful_item($item); + $items[] = items_rest::_format_restful_item($item, $preserve_ids); while (($item = $item->parent()) != null) { - array_unshift($items, items_rest::_format_restful_item($item)); + array_unshift($items, items_rest::_format_restful_item($item, $preserve_ids)); }; } @@ -74,9 +76,9 @@ class items_rest_Core { return $item; } - private static function _format_restful_item($item) { + private static function _format_restful_item($item, $preserve_ids) { $item_rest = array("url" => rest::url("item", $item), - "entity" => $item->as_restful_array(), + "entity" => $item->as_restful_array($preserve_ids), "relationships" => rest::relationships("item", $item)); if ($item->type == "album") { $members = array(); diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index dfcbdd70..f59caa65 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -923,12 +923,15 @@ class Item_Model extends ORM_MPTT { /** * Same as ORM::as_array() but convert id fields into their RESTful form. + * Convert any item ids into REST urls + * + * @param bool preserve_ids true if we should preserve ids */ - public function as_restful_array($convert_ids=true) { + public function as_restful_array($preserve_ids) { // Convert item ids to rest URLs for consistency $data = $this->as_array(); - if ($convert_ids) { + if (!$preserve_ids) { if ($tmp = $this->parent()) { $data["parent"] = rest::url("item", $tmp); } diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php index 9d3f54f2..6c5882c4 100644 --- a/modules/gallery/tests/Item_Model_Test.php +++ b/modules/gallery/tests/Item_Model_Test.php @@ -357,7 +357,7 @@ class Item_Model_Test extends Gallery_Unit_Test_Case { $photo = test::random_photo($album); $album->reload(); - $result = $album->as_restful_array(); + $result = $album->as_restful_array(false); $this->assert_same(rest::url("item", item::root()), $result["parent"]); $this->assert_same(rest::url("item", $photo), $result["album_cover"]); $this->assert_true(!array_key_exists("parent_id", $result)); @@ -369,7 +369,7 @@ class Item_Model_Test extends Gallery_Unit_Test_Case { $photo = test::random_photo($album); $album->reload(); - $result = $album->as_restful_array(false); + $result = $album->as_restful_array(true); $this->assert_same(item::root()->id, $result["parent_id"]); $this->assert_same($photo->id, $result["album_cover_item_id"]); $this->assert_true(!array_key_exists("parent", $result)); diff --git a/modules/gallery/tests/Item_Rest_Helper_Test.php b/modules/gallery/tests/Item_Rest_Helper_Test.php index 0b5e0471..5a80d66b 100644 --- a/modules/gallery/tests/Item_Rest_Helper_Test.php +++ b/modules/gallery/tests/Item_Rest_Helper_Test.php @@ -28,6 +28,17 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal($album->id, $resolved->id); } + public function get_with_ids_test() { + $photo1 = test::random_photo(item::root()); + $request = new stdClass(); + $request->url = rest::url("item", $photo1); + $request->params = new stdClass(); + $request->params->preserve_ids = 1; + + $response = item_rest::get($request); + $this->assert_equal(item::root()->id, $response["entity"]["parent_id"]); // Spot check + } + public function get_scope_test() { $album1 = test::random_album(); $photo1 = test::random_photo($album1); @@ -41,7 +52,7 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request->params = new stdClass(); $this->assert_equal_array( array("url" => rest::url("item", $album1), - "entity" => $album1->as_restful_array(), + "entity" => $album1->as_restful_array(false), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), @@ -56,7 +67,7 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request->params->scope = "direct"; $this->assert_equal_array( array("url" => rest::url("item", $album1), - "entity" => $album1->as_restful_array(), + "entity" => $album1->as_restful_array(false), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), @@ -71,7 +82,7 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request->params->scope = "all"; $this->assert_equal_array( array("url" => rest::url("item", $album1), - "entity" => $album1->as_restful_array(), + "entity" => $album1->as_restful_array(false), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), @@ -98,7 +109,7 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request->params->name = "foo"; $this->assert_equal_array( array("url" => rest::url("item", $album1), - "entity" => $album1->as_restful_array(), + "entity" => $album1->as_restful_array(false), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), @@ -121,7 +132,7 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request->params->type = "album"; $this->assert_equal_array( array("url" => rest::url("item", $album1), - "entity" => $album1->as_restful_array(), + "entity" => $album1->as_restful_array(false), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), diff --git a/modules/gallery/tests/Items_Rest_Helper_Test.php b/modules/gallery/tests/Items_Rest_Helper_Test.php index 94bf912a..3efd677d 100644 --- a/modules/gallery/tests/Items_Rest_Helper_Test.php +++ b/modules/gallery/tests/Items_Rest_Helper_Test.php @@ -34,13 +34,13 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal_array( array( array("url" => rest::url("item", $photo1), - "entity" => $photo1->as_restful_array(), + "entity" => $photo1->as_restful_array(false), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $photo1), "members" => array()))), array("url" => rest::url("item", $album2), - "entity" => $album2->as_restful_array(), + "entity" => $album2->as_restful_array(false), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album2), @@ -67,7 +67,7 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal_array( array( array("url" => rest::url("item", $album2), - "entity" => $album2->as_restful_array(), + "entity" => $album2->as_restful_array(false), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album2), @@ -94,7 +94,7 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal_array( array( array("url" => rest::url("item", $photo1), - "entity" => $photo1->as_restful_array(), + "entity" => $photo1->as_restful_array(false), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $photo1), @@ -119,13 +119,13 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal_array( array( array("url" => rest::url("item", $photo1), - "entity" => $photo1->as_restful_array(), + "entity" => $photo1->as_restful_array(false), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $photo1), "members" => array()))), array("url" => rest::url("item", $album2), - "entity" => $album2->as_restful_array(), + "entity" => $album2->as_restful_array(false), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album2), @@ -146,7 +146,7 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { $root = ORM::factory("item", 1); $restful_root = array( "url" => rest::url("item", $root), - "entity" => $root->as_restful_array(), + "entity" => $root->as_restful_array(false), "relationships" => rest::relationships("item", $root)); $restful_root["members"] = array(); foreach ($root->children() as $child) { @@ -155,12 +155,12 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request = new stdClass(); $request->params = new stdClass(); - $request->params->ancestor_for = rest::url("item", $photo2); + $request->params->ancestors_for = rest::url("item", $photo2); $this->assert_equal_array( array( $restful_root, array("url" => rest::url("item", $album1), - "entity" => $album1->as_restful_array(), + "entity" => $album1->as_restful_array(false), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), @@ -170,7 +170,7 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { rest::url("item", $album2)), ), array("url" => rest::url("item", $album2), - "entity" => $album2->as_restful_array(), + "entity" => $album2->as_restful_array(false), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album2), @@ -178,11 +178,24 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { "members" => array( rest::url("item", $photo2))), array("url" => rest::url("item", $photo2), - "entity" => $photo2->as_restful_array(), + "entity" => $photo2->as_restful_array(false), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $photo2), "members" => array())))), items_rest::get($request)); } + + public function get_ancestor_with_ids_test() { + $album1 = test::random_album(); + $photo1 = test::random_photo($album1); + + $request = new stdClass(); + $request->params = new stdClass(); + $request->params->ancestors_for = rest::url("item", $photo1); + $request->params->preserve_ids = 1; + + $response = items_rest::get($request); + $this->assert_same(item::root()->id, $response[1]["entity"]["parent_id"]); // Spot check + } } -- cgit v1.2.3 From b40057283e1dfbb3bbb41a6dfc8ccc8e2111d810 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 8 Jun 2010 20:59:24 -0700 Subject: Add a "can_edit" field to the Item_Model's REST output. It's applicable to the current user. --- modules/gallery/models/item.php | 1 + modules/gallery/tests/Item_Model_Test.php | 13 +++++++++++++ 2 files changed, 14 insertions(+) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index f59caa65..a0866934 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -951,6 +951,7 @@ class Item_Model extends ORM_MPTT { $data["resize_url"] = $tmp; } $data["thumb_url"] = $this->thumb_url(true); + $data["can_edit"] = access::can("edit", $this); // Elide some internal-only data that is going to cause confusion in the client. foreach (array("relative_path_cache", "relative_url_cache", "left_ptr", "right_ptr", diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php index 6c5882c4..3df6197d 100644 --- a/modules/gallery/tests/Item_Model_Test.php +++ b/modules/gallery/tests/Item_Model_Test.php @@ -18,6 +18,10 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class Item_Model_Test extends Gallery_Unit_Test_Case { + public function teardown() { + identity::set_active_user(identity::admin_user()); + } + public function saving_sets_created_and_updated_dates_test() { $item = test::random_photo(); $this->assert_true(!empty($item->created)); @@ -376,6 +380,15 @@ class Item_Model_Test extends Gallery_Unit_Test_Case { $this->assert_true(!array_key_exists("album_cover_item", $result)); } + public function as_restful_array_with_edit_bit_test() { + $response = item::root()->as_restful_array(true); + $this->assert_true($response["can_edit"]); + + identity::set_active_user(identity::guest()); + $response = item::root()->as_restful_array(true); + $this->assert_false($response["can_edit"]); + } + public function first_photo_becomes_album_cover() { $album = test::random_album(); $photo = test::random_photo($album); -- cgit v1.2.3 From 3dacafb7182dd915c4c6d4e7d75722976e231465 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 9 Jun 2010 20:49:32 -0700 Subject: Revert the "preserve_ids" global query parameter. We decided that it was a bad idea. This reverts commit 6425d41eddd44091b2d83ba3c3734cc6990ca581. --- modules/gallery/helpers/item_rest.php | 3 +- modules/gallery/helpers/items_rest.php | 14 ++++------ modules/gallery/models/item.php | 7 ++--- modules/gallery/tests/Item_Model_Test.php | 4 +-- modules/gallery/tests/Item_Rest_Helper_Test.php | 21 ++++---------- modules/gallery/tests/Items_Rest_Helper_Test.php | 35 ++++++++---------------- 6 files changed, 27 insertions(+), 57 deletions(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/helpers/item_rest.php b/modules/gallery/helpers/item_rest.php index 1d19d9f1..c88f92d9 100644 --- a/modules/gallery/helpers/item_rest.php +++ b/modules/gallery/helpers/item_rest.php @@ -78,10 +78,9 @@ class item_rest_Core { } $orm->order_by($order_by); - $preserve_ids = isset($p->preserve_ids) ? (bool)$p->preserve_ids : false; $result = array( "url" => $request->url, - "entity" => $item->as_restful_array($preserve_ids), + "entity" => $item->as_restful_array(), "relationships" => rest::relationships("item", $item)); if ($item->is_album()) { $result["members"] = array(); diff --git a/modules/gallery/helpers/items_rest.php b/modules/gallery/helpers/items_rest.php index e9773745..9cca9a54 100644 --- a/modules/gallery/helpers/items_rest.php +++ b/modules/gallery/helpers/items_rest.php @@ -36,8 +36,6 @@ class items_rest_Core { */ static function get($request) { $items = array(); - $preserve_ids = isset($request->params->preserve_ids) ? - (bool)$request->params->preserve_ids : false; if (isset($request->params->urls)) { foreach (json_decode($request->params->urls) as $url) { if (isset($request->params->type)) { @@ -47,10 +45,10 @@ class items_rest_Core { if (access::can("view", $item)) { if (isset($types)) { if (in_array($item->type, $types)) { - $items[] = items_rest::_format_restful_item($item, $preserve_ids); + $items[] = items_rest::_format_restful_item($item); } } else { - $items[] = items_rest::_format_restful_item($item, $preserve_ids); + $items[] = items_rest::_format_restful_item($item); } } } @@ -59,9 +57,9 @@ class items_rest_Core { if (!access::can("view", $item)) { throw new Kohana_404_Exception(); } - $items[] = items_rest::_format_restful_item($item, $preserve_ids); + $items[] = items_rest::_format_restful_item($item); while (($item = $item->parent()) != null) { - array_unshift($items, items_rest::_format_restful_item($item, $preserve_ids)); + array_unshift($items, items_rest::_format_restful_item($item)); }; } @@ -76,9 +74,9 @@ class items_rest_Core { return $item; } - private static function _format_restful_item($item, $preserve_ids) { + private static function _format_restful_item($item) { $item_rest = array("url" => rest::url("item", $item), - "entity" => $item->as_restful_array($preserve_ids), + "entity" => $item->as_restful_array(), "relationships" => rest::relationships("item", $item)); if ($item->type == "album") { $members = array(); diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index a0866934..009457c1 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -923,15 +923,12 @@ class Item_Model extends ORM_MPTT { /** * Same as ORM::as_array() but convert id fields into their RESTful form. - * Convert any item ids into REST urls - * - * @param bool preserve_ids true if we should preserve ids */ - public function as_restful_array($preserve_ids) { + public function as_restful_array($convert_ids=true) { // Convert item ids to rest URLs for consistency $data = $this->as_array(); - if (!$preserve_ids) { + if ($convert_ids) { if ($tmp = $this->parent()) { $data["parent"] = rest::url("item", $tmp); } diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php index 3df6197d..f9e6a4e3 100644 --- a/modules/gallery/tests/Item_Model_Test.php +++ b/modules/gallery/tests/Item_Model_Test.php @@ -361,7 +361,7 @@ class Item_Model_Test extends Gallery_Unit_Test_Case { $photo = test::random_photo($album); $album->reload(); - $result = $album->as_restful_array(false); + $result = $album->as_restful_array(); $this->assert_same(rest::url("item", item::root()), $result["parent"]); $this->assert_same(rest::url("item", $photo), $result["album_cover"]); $this->assert_true(!array_key_exists("parent_id", $result)); @@ -373,7 +373,7 @@ class Item_Model_Test extends Gallery_Unit_Test_Case { $photo = test::random_photo($album); $album->reload(); - $result = $album->as_restful_array(true); + $result = $album->as_restful_array(false); $this->assert_same(item::root()->id, $result["parent_id"]); $this->assert_same($photo->id, $result["album_cover_item_id"]); $this->assert_true(!array_key_exists("parent", $result)); diff --git a/modules/gallery/tests/Item_Rest_Helper_Test.php b/modules/gallery/tests/Item_Rest_Helper_Test.php index 5a80d66b..0b5e0471 100644 --- a/modules/gallery/tests/Item_Rest_Helper_Test.php +++ b/modules/gallery/tests/Item_Rest_Helper_Test.php @@ -28,17 +28,6 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal($album->id, $resolved->id); } - public function get_with_ids_test() { - $photo1 = test::random_photo(item::root()); - $request = new stdClass(); - $request->url = rest::url("item", $photo1); - $request->params = new stdClass(); - $request->params->preserve_ids = 1; - - $response = item_rest::get($request); - $this->assert_equal(item::root()->id, $response["entity"]["parent_id"]); // Spot check - } - public function get_scope_test() { $album1 = test::random_album(); $photo1 = test::random_photo($album1); @@ -52,7 +41,7 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request->params = new stdClass(); $this->assert_equal_array( array("url" => rest::url("item", $album1), - "entity" => $album1->as_restful_array(false), + "entity" => $album1->as_restful_array(), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), @@ -67,7 +56,7 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request->params->scope = "direct"; $this->assert_equal_array( array("url" => rest::url("item", $album1), - "entity" => $album1->as_restful_array(false), + "entity" => $album1->as_restful_array(), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), @@ -82,7 +71,7 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request->params->scope = "all"; $this->assert_equal_array( array("url" => rest::url("item", $album1), - "entity" => $album1->as_restful_array(false), + "entity" => $album1->as_restful_array(), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), @@ -109,7 +98,7 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request->params->name = "foo"; $this->assert_equal_array( array("url" => rest::url("item", $album1), - "entity" => $album1->as_restful_array(false), + "entity" => $album1->as_restful_array(), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), @@ -132,7 +121,7 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request->params->type = "album"; $this->assert_equal_array( array("url" => rest::url("item", $album1), - "entity" => $album1->as_restful_array(false), + "entity" => $album1->as_restful_array(), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), diff --git a/modules/gallery/tests/Items_Rest_Helper_Test.php b/modules/gallery/tests/Items_Rest_Helper_Test.php index 3efd677d..94bf912a 100644 --- a/modules/gallery/tests/Items_Rest_Helper_Test.php +++ b/modules/gallery/tests/Items_Rest_Helper_Test.php @@ -34,13 +34,13 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal_array( array( array("url" => rest::url("item", $photo1), - "entity" => $photo1->as_restful_array(false), + "entity" => $photo1->as_restful_array(), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $photo1), "members" => array()))), array("url" => rest::url("item", $album2), - "entity" => $album2->as_restful_array(false), + "entity" => $album2->as_restful_array(), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album2), @@ -67,7 +67,7 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal_array( array( array("url" => rest::url("item", $album2), - "entity" => $album2->as_restful_array(false), + "entity" => $album2->as_restful_array(), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album2), @@ -94,7 +94,7 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal_array( array( array("url" => rest::url("item", $photo1), - "entity" => $photo1->as_restful_array(false), + "entity" => $photo1->as_restful_array(), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $photo1), @@ -119,13 +119,13 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal_array( array( array("url" => rest::url("item", $photo1), - "entity" => $photo1->as_restful_array(false), + "entity" => $photo1->as_restful_array(), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $photo1), "members" => array()))), array("url" => rest::url("item", $album2), - "entity" => $album2->as_restful_array(false), + "entity" => $album2->as_restful_array(), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album2), @@ -146,7 +146,7 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { $root = ORM::factory("item", 1); $restful_root = array( "url" => rest::url("item", $root), - "entity" => $root->as_restful_array(false), + "entity" => $root->as_restful_array(), "relationships" => rest::relationships("item", $root)); $restful_root["members"] = array(); foreach ($root->children() as $child) { @@ -155,12 +155,12 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request = new stdClass(); $request->params = new stdClass(); - $request->params->ancestors_for = rest::url("item", $photo2); + $request->params->ancestor_for = rest::url("item", $photo2); $this->assert_equal_array( array( $restful_root, array("url" => rest::url("item", $album1), - "entity" => $album1->as_restful_array(false), + "entity" => $album1->as_restful_array(), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), @@ -170,7 +170,7 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { rest::url("item", $album2)), ), array("url" => rest::url("item", $album2), - "entity" => $album2->as_restful_array(false), + "entity" => $album2->as_restful_array(), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album2), @@ -178,24 +178,11 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { "members" => array( rest::url("item", $photo2))), array("url" => rest::url("item", $photo2), - "entity" => $photo2->as_restful_array(false), + "entity" => $photo2->as_restful_array(), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $photo2), "members" => array())))), items_rest::get($request)); } - - public function get_ancestor_with_ids_test() { - $album1 = test::random_album(); - $photo1 = test::random_photo($album1); - - $request = new stdClass(); - $request->params = new stdClass(); - $request->params->ancestors_for = rest::url("item", $photo1); - $request->params->preserve_ids = 1; - - $response = items_rest::get($request); - $this->assert_same(item::root()->id, $response[1]["entity"]["parent_id"]); // Spot check - } } -- cgit v1.2.3 From aff0f6eca85e1a9aec83e13c29746f58010a56f6 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 9 Jun 2010 20:55:39 -0700 Subject: Fix get_ancestor_test() since the parameter was renamed to ancestors_for. --- modules/gallery/tests/Items_Rest_Helper_Test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/Items_Rest_Helper_Test.php b/modules/gallery/tests/Items_Rest_Helper_Test.php index 94bf912a..17e979a5 100644 --- a/modules/gallery/tests/Items_Rest_Helper_Test.php +++ b/modules/gallery/tests/Items_Rest_Helper_Test.php @@ -135,7 +135,7 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { items_rest::get($request)); } - public function get_ancestor_test() { + public function get_ancestors_test() { $album1 = test::random_album(); $photo1 = test::random_photo($album1); $album2 = test::random_album($album1); @@ -155,7 +155,7 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request = new stdClass(); $request->params = new stdClass(); - $request->params->ancestor_for = rest::url("item", $photo2); + $request->params->ancestors_for = rest::url("item", $photo2); $this->assert_equal_array( array( $restful_root, -- cgit v1.2.3 From 6556ca88339c78824f3de64c85a57e30a679431c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 9 Jun 2010 21:23:42 -0700 Subject: In GalleryCodeFilterIterator::accept(), ignore . and .., and stop caring about .svn --- modules/gallery/tests/Gallery_Filters.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/Gallery_Filters.php b/modules/gallery/tests/Gallery_Filters.php index 4e32553b..debbe846 100644 --- a/modules/gallery/tests/Gallery_Filters.php +++ b/modules/gallery/tests/Gallery_Filters.php @@ -28,8 +28,10 @@ class GalleryCodeFilterIterator extends FilterIterator { public function accept() { // Skip anything that we didn"t write $path_name = $this->getInnerIterator()->getPathName(); + $file_name = $this->getInnerIterator()->getFileName(); return !( - strpos($path_name, ".svn") || + $file_name == "." || + $file_name == ".." || strpos($path_name, DOCROOT . "test") !== false || strpos($path_name, DOCROOT . "var") !== false || strpos($path_name, MODPATH . "forge") !== false || -- cgit v1.2.3 From ab93767e4d39764f103545efb6ac64ff942eb187 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 9 Jun 2010 21:26:36 -0700 Subject: Update golden file --- modules/gallery/tests/xss_data.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 0a75d6f7..68dca9cb 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -4,6 +4,7 @@ modules/akismet/views/admin_akismet_stats.html.php 9 DIRTY_ATTR urle 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 5 DIRTY $form modules/comment/views/admin_manage_comments.html.php 43 DIRTY $menu->render() modules/comment/views/admin_manage_comments.html.php 107 DIRTY_ATTR $comment->id modules/comment/views/admin_manage_comments.html.php 107 DIRTY_ATTR text::alternate("g-odd","g-even") @@ -32,8 +33,8 @@ modules/comment/views/comment.mrss.php 29 DIRTY $child modules/comment/views/comment.mrss.php 34 DIRTY_ATTR $child->thumb_url modules/comment/views/comment.mrss.php 35 DIRTY_ATTR $child->thumb_height modules/comment/views/comment.mrss.php 35 DIRTY_ATTR $child->thumb_width -modules/comment/views/comments.html.php 18 DIRTY_ATTR $comment->id -modules/comment/views/comments.html.php 21 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true)) +modules/comment/views/comments.html.php 21 DIRTY_ATTR $comment->id +modules/comment/views/comments.html.php 24 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true)) modules/comment/views/user_profile_comments.html.php 5 DIRTY_ATTR $comment->id modules/comment/views/user_profile_comments.html.php 10 DIRTY_JS $comment->item()->url() modules/comment/views/user_profile_comments.html.php 11 DIRTY $comment->item()->thumb_img(array(),50) -- cgit v1.2.3 From 58b21e909d8ba628ddb8a19e732989821abb0283 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 10 Jun 2010 18:49:29 -0700 Subject: Change the pattern used to convert the file name to a title. Fixes ticket#1061 --- modules/gallery/helpers/item.php | 2 +- modules/gallery/tests/Item_Helper_Test.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php index bbbe1058..15bbe977 100644 --- a/modules/gallery/helpers/item.php +++ b/modules/gallery/helpers/item.php @@ -136,7 +136,7 @@ class item_Core { */ static function convert_filename_to_title($filename) { $title = strtr($filename, "_", " "); - $title = preg_replace("/\..*?$/", "", $title); + $title = preg_replace("/\..{3,4}$/", "", $title); $title = preg_replace("/ +/", " ", $title); return $title; } diff --git a/modules/gallery/tests/Item_Helper_Test.php b/modules/gallery/tests/Item_Helper_Test.php index 4771b11a..00229973 100644 --- a/modules/gallery/tests/Item_Helper_Test.php +++ b/modules/gallery/tests/Item_Helper_Test.php @@ -41,6 +41,11 @@ class Item_Helper_Test extends Gallery_Unit_Test_Case { ORM::factory("item")->viewable()->where("id", "=", $item->id)->count_all()); } + public function convert_filename_to_title_test() { + $this->assert_equal("foo", item::convert_filename_to_title("foo.jpg")); + $this->assert_equal("foo.bar", item::convert_filename_to_title("foo.bar.jpg")); + } + public function convert_filename_to_slug_test() { $this->assert_equal("foo", item::convert_filename_to_slug("{[foo]}")); $this->assert_equal("foo-bar", item::convert_filename_to_slug("{[foo!@#!$@#^$@($!(@bar]}")); -- cgit v1.2.3 From e3535349abb6e955a75d97f57971f4ea4913da6f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 15 Jun 2010 20:25:35 -0700 Subject: Revert "Add a "convert_ids" parameter to Item_Model::as_restful_array(), which" This reverts commit 98fce83de5f772482382bfabdbcd94c25ecdbb1a. Conflicts: modules/gallery/tests/Item_Model_Test.php --- modules/gallery/models/item.php | 20 ++++++++------------ modules/gallery/tests/Item_Model_Test.php | 12 ------------ 2 files changed, 8 insertions(+), 24 deletions(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 009457c1..e42430bf 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -924,21 +924,17 @@ class Item_Model extends ORM_MPTT { /** * Same as ORM::as_array() but convert id fields into their RESTful form. */ - public function as_restful_array($convert_ids=true) { + public function as_restful_array() { // Convert item ids to rest URLs for consistency $data = $this->as_array(); - - if ($convert_ids) { - if ($tmp = $this->parent()) { - $data["parent"] = rest::url("item", $tmp); - } - unset($data["parent_id"]); - - if ($tmp = $this->album_cover()) { - $data["album_cover"] = rest::url("item", $tmp); - } - unset($data["album_cover_item_id"]); + if ($tmp = $this->parent()) { + $data["parent"] = rest::url("item", $tmp); + } + unset($data["parent_id"]); + if ($tmp = $this->album_cover()) { + $data["album_cover"] = rest::url("item", $tmp); } + unset($data["album_cover_item_id"]); if (access::can("view_full", $this) && $this->is_photo()) { $data["file_url"] = $this->file_url(true); diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php index f9e6a4e3..907cfe24 100644 --- a/modules/gallery/tests/Item_Model_Test.php +++ b/modules/gallery/tests/Item_Model_Test.php @@ -368,18 +368,6 @@ class Item_Model_Test extends Gallery_Unit_Test_Case { $this->assert_true(!array_key_exists("album_cover_item_id", $result)); } - public function as_restful_array_with_ids_test() { - $album = test::random_album(); - $photo = test::random_photo($album); - $album->reload(); - - $result = $album->as_restful_array(false); - $this->assert_same(item::root()->id, $result["parent_id"]); - $this->assert_same($photo->id, $result["album_cover_item_id"]); - $this->assert_true(!array_key_exists("parent", $result)); - $this->assert_true(!array_key_exists("album_cover_item", $result)); - } - public function as_restful_array_with_edit_bit_test() { $response = item::root()->as_restful_array(true); $this->assert_true($response["can_edit"]); -- cgit v1.2.3 From e82aa6dcd80ce0c41a04e3331b0a63e25c25216f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 17 Jun 2010 10:22:19 -0700 Subject: Update the xss gold file with changes to views in the last couple of commits. --- modules/gallery/tests/xss_data.txt | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 68dca9cb..7fce42a1 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -235,27 +235,16 @@ modules/notification/views/item_updated.html.php 20 DIRTY_JS $item- modules/notification/views/item_updated.html.php 20 DIRTY $item->abs_url() modules/notification/views/user_profile_notification.html.php 5 DIRTY_ATTR $subscription->id modules/notification/views/user_profile_notification.html.php 6 DIRTY_JS $subscription->url -modules/organize/views/organize_dialog.html.php 3 DIRTY_JS url::site("organize/move_to/__ALBUM_ID__?csrf=$csrf") -modules/organize/views/organize_dialog.html.php 4 DIRTY_JS url::site("organize/rearrange/__TARGET_ID__/__BEFORE__?csrf=$csrf") -modules/organize/views/organize_dialog.html.php 5 DIRTY_JS url::site("organize/sort_order/__ALBUM_ID__/__COL__/__DIR__?csrf=$csrf") -modules/organize/views/organize_dialog.html.php 6 DIRTY_JS url::site("organize/tree/__ALBUM_ID__") -modules/organize/views/organize_dialog.html.php 14 DIRTY $album_tree -modules/organize/views/organize_dialog.html.php 23 DIRTY $micro_thumb_grid -modules/organize/views/organize_dialog.html.php 32 DIRTY form::dropdown(array("id"=>"g-organize-sort-column"),album::get_sort_order_options(),$album->sort_column) -modules/organize/views/organize_thumb_grid.html.php 3 DIRTY_ATTR $child->is_album()?"g-album":"g-photo" -modules/organize/views/organize_thumb_grid.html.php 4 DIRTY_ATTR $child->id -modules/organize/views/organize_thumb_grid.html.php 5 DIRTY $child->thumb_img(array("class"=>"g-thumbnail","ref"=>$child->id),90,true) -modules/organize/views/organize_thumb_grid.html.php 6 DIRTY $child->is_album()?" class=\"ui-icon ui-icon-note\"":"" -modules/organize/views/organize_thumb_grid.html.php 13 DIRTY_JS url::site("organize/album/$album->id/".($offset+25)) -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?"ui-state-focus":"" -modules/organize/views/organize_tree.html.php 7 DIRTY_ATTR $album->id -modules/organize/views/organize_tree.html.php 15 DIRTY View::factory("organize_tree.html",array("selected"=>$selected,"album"=>$child)); -modules/organize/views/organize_tree.html.php 17 DIRTY_ATTR access::can("edit",$child)?"":"g-view-only" -modules/organize/views/organize_tree.html.php 18 DIRTY_ATTR $child->id -modules/organize/views/organize_tree.html.php 20 DIRTY_ATTR $selected&&$child->id==$selected->id?"ui-state-focus":"" -modules/organize/views/organize_tree.html.php 20 DIRTY_ATTR $child->id +modules/organize/views/organize_dialog.html.php 92 DIRTY_JS $domain +modules/organize/views/organize_dialog.html.php 93 DIRTY_JS $access_key +modules/organize/views/organize_dialog.html.php 94 DIRTY_JS $protocol +modules/organize/views/organize_dialog.html.php 95 DIRTY_JS $file_filter +modules/organize/views/organize_dialog.html.php 96 DIRTY_JS $sort_order +modules/organize/views/organize_dialog.html.php 97 DIRTY_JS $sort_fields +modules/organize/views/organize_dialog.html.php 98 DIRTY_JS $album->id +modules/organize/views/organize_dialog.html.php 99 DIRTY_JS $rest_uri +modules/organize/views/organize_dialog.html.php 100 DIRTY_JS $controller_uri +modules/organize/views/organize_dialog.html.php 124 DIRTY_JS $swf_url modules/recaptcha/views/admin_recaptcha.html.php 11 DIRTY $form modules/recaptcha/views/admin_recaptcha.html.php 23 DIRTY_JS $public_key modules/recaptcha/views/form_recaptcha.html.php 7 DIRTY_JS $public_key @@ -363,7 +352,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/dynamic.html.php 29 DIRTY $theme->paginator() themes/wind/views/movie.html.php 5 DIRTY $theme->paginator() -themes/wind/views/movie.html.php 8 DIRTY $item->movie_img(array("class"=>"g-movie","id"=>"g-item-id-{$item->id}")) +themes/wind/views/movie.html.php 9 DIRTY $item->movie_img(array("class"=>"g-movie","id"=>"g-item-id-{$item->id}")) themes/wind/views/page.html.php 9 DIRTY $page_title themes/wind/views/page.html.php 33 DIRTY_JS $theme->url() themes/wind/views/page.html.php 42 DIRTY $new_width -- cgit v1.2.3 From d86d1a32e8fc0feeaea3fa29a07035e0edfc7b90 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 19 Jun 2010 15:12:58 -0700 Subject: Updated for comment REST relationships. --- modules/gallery/tests/Item_Rest_Helper_Test.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/Item_Rest_Helper_Test.php b/modules/gallery/tests/Item_Rest_Helper_Test.php index 0b5e0471..a2ab534b 100644 --- a/modules/gallery/tests/Item_Rest_Helper_Test.php +++ b/modules/gallery/tests/Item_Rest_Helper_Test.php @@ -43,6 +43,8 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { array("url" => rest::url("item", $album1), "entity" => $album1->as_restful_array(), "relationships" => array( + "comments" => array( + "url" => rest::url("item_comments", $album1)), "tags" => array( "url" => rest::url("item_tags", $album1), "members" => array())), @@ -58,6 +60,8 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { array("url" => rest::url("item", $album1), "entity" => $album1->as_restful_array(), "relationships" => array( + "comments" => array( + "url" => rest::url("item_comments", $album1)), "tags" => array( "url" => rest::url("item_tags", $album1), "members" => array())), @@ -73,6 +77,8 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { array("url" => rest::url("item", $album1), "entity" => $album1->as_restful_array(), "relationships" => array( + "comments" => array( + "url" => rest::url("item_comments", $album1)), "tags" => array( "url" => rest::url("item_tags", $album1), "members" => array())), @@ -100,6 +106,8 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { array("url" => rest::url("item", $album1), "entity" => $album1->as_restful_array(), "relationships" => array( + "comments" => array( + "url" => rest::url("item_comments", $album1)), "tags" => array( "url" => rest::url("item_tags", $album1), "members" => array())), @@ -123,6 +131,8 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { array("url" => rest::url("item", $album1), "entity" => $album1->as_restful_array(), "relationships" => array( + "comments" => array( + "url" => rest::url("item_comments", $album1)), "tags" => array( "url" => rest::url("item_tags", $album1), "members" => array())), -- cgit v1.2.3 From 1a210dd27084e4213a1738992b700a244de97d35 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 20 Jun 2010 09:03:23 -0700 Subject: Add "json" as a valid view suffix. --- modules/gallery/tests/File_Structure_Test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php index 39df9f06..1c3356d9 100644 --- a/modules/gallery/tests/File_Structure_Test.php +++ b/modules/gallery/tests/File_Structure_Test.php @@ -42,8 +42,8 @@ class File_Structure_Test extends Gallery_Unit_Test_Case { if (strpos($file, "views")) { $this->assert_true( - preg_match("#/views/.*?(\.html|mrss|txt)\.php$#", $file->getPathname()), - "{$file->getPathname()} should end in .{html,mrss,txt}.php"); + preg_match("#/views/.*?\.(html|mrss|txt|json)\.php$#", $file->getPathname()), + "{$file->getPathname()} should end in .{html,mrss,txt,json}.php"); } } } -- cgit v1.2.3 From 9f9d3866e86d4b50fc1315c7db2687a5f0b8ce8d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 20 Jun 2010 09:28:36 -0700 Subject: Exclude the .git directory. --- modules/gallery/tests/Gallery_Filters.php | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/Gallery_Filters.php b/modules/gallery/tests/Gallery_Filters.php index debbe846..052990d5 100644 --- a/modules/gallery/tests/Gallery_Filters.php +++ b/modules/gallery/tests/Gallery_Filters.php @@ -32,6 +32,7 @@ class GalleryCodeFilterIterator extends FilterIterator { return !( $file_name == "." || $file_name == ".." || + strpos($path_name, DOCROOT . ".git") !== false || strpos($path_name, DOCROOT . "test") !== false || strpos($path_name, DOCROOT . "var") !== false || strpos($path_name, MODPATH . "forge") !== false || -- cgit v1.2.3 From ec052d71301acbf519947897f8adda7fdcf7fefb Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 20 Jun 2010 09:36:56 -0700 Subject: Assert how many files we analyze so that we can tell if we're suddenly analzying too many or too few. --- modules/gallery/tests/File_Structure_Test.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/File_Structure_Test.php b/modules/gallery/tests/File_Structure_Test.php index 1c3356d9..96e0b758 100644 --- a/modules/gallery/tests/File_Structure_Test.php +++ b/modules/gallery/tests/File_Structure_Test.php @@ -23,13 +23,18 @@ class File_Structure_Test extends Gallery_Unit_Test_Case { public function no_trailing_closing_php_tag_test() { $dir = new GalleryCodeFilterIterator( new RecursiveIteratorIterator(new RecursiveDirectoryIterator(DOCROOT))); + $count = 0; foreach ($dir as $file) { + $count++; if (!preg_match("|\.html\.php$|", $file->getPathname())) { $this->assert_false( preg_match('/\?\>\s*$/', file_get_contents($file)), "{$file->getPathname()} ends in ?>"); } } + + $this->assert_true($count > 500, "We should have analyzed at least this 500 files"); + $this->assert_true($count < 1000, "We shouldn't be shipping 1000 files!"); } public function view_files_correct_suffix_test() { -- cgit v1.2.3 From 2e016855532962ea3e03700879be70f1ad3a8911 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 20 Jun 2010 09:40:35 -0700 Subject: Add "comments" relationship support. --- modules/gallery/tests/Items_Rest_Helper_Test.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/Items_Rest_Helper_Test.php b/modules/gallery/tests/Items_Rest_Helper_Test.php index 17e979a5..8e53110a 100644 --- a/modules/gallery/tests/Items_Rest_Helper_Test.php +++ b/modules/gallery/tests/Items_Rest_Helper_Test.php @@ -36,12 +36,16 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { array("url" => rest::url("item", $photo1), "entity" => $photo1->as_restful_array(), "relationships" => array( + "comments" => array( + "url" => rest::url("item_comments", $photo1)), "tags" => array( "url" => rest::url("item_tags", $photo1), "members" => array()))), array("url" => rest::url("item", $album2), "entity" => $album2->as_restful_array(), "relationships" => array( + "comments" => array( + "url" => rest::url("item_comments", $album2)), "tags" => array( "url" => rest::url("item_tags", $album2), "members" => array())), @@ -69,6 +73,8 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { array("url" => rest::url("item", $album2), "entity" => $album2->as_restful_array(), "relationships" => array( + "comments" => array( + "url" => rest::url("item_comments", $album2)), "tags" => array( "url" => rest::url("item_tags", $album2), "members" => array())), @@ -96,6 +102,8 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { array("url" => rest::url("item", $photo1), "entity" => $photo1->as_restful_array(), "relationships" => array( + "comments" => array( + "url" => rest::url("item_comments", $photo1)), "tags" => array( "url" => rest::url("item_tags", $photo1), "members" => array())))), @@ -121,12 +129,16 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { array("url" => rest::url("item", $photo1), "entity" => $photo1->as_restful_array(), "relationships" => array( + "comments" => array( + "url" => rest::url("item_comments", $photo1)), "tags" => array( "url" => rest::url("item_tags", $photo1), "members" => array()))), array("url" => rest::url("item", $album2), "entity" => $album2->as_restful_array(), "relationships" => array( + "comments" => array( + "url" => rest::url("item_comments", $album2)), "tags" => array( "url" => rest::url("item_tags", $album2), "members" => array())), @@ -162,6 +174,8 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { array("url" => rest::url("item", $album1), "entity" => $album1->as_restful_array(), "relationships" => array( + "comments" => array( + "url" => rest::url("item_comments", $album1)), "tags" => array( "url" => rest::url("item_tags", $album1), "members" => array())), @@ -172,6 +186,8 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { array("url" => rest::url("item", $album2), "entity" => $album2->as_restful_array(), "relationships" => array( + "comments" => array( + "url" => rest::url("item_comments", $album2)), "tags" => array( "url" => rest::url("item_tags", $album2), "members" => array())), @@ -180,6 +196,8 @@ class Items_Rest_Helper_Test extends Gallery_Unit_Test_Case { array("url" => rest::url("item", $photo2), "entity" => $photo2->as_restful_array(), "relationships" => array( + "comments" => array( + "url" => rest::url("item_comments", $photo2)), "tags" => array( "url" => rest::url("item_tags", $photo2), "members" => array())))), -- cgit v1.2.3 From 6ebbb4fbf5cc5559f433300871078be41d615cf6 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 20 Jun 2010 09:51:39 -0700 Subject: Updated golden files. --- modules/gallery/tests/controller_auth_data.txt | 2 + modules/gallery/tests/xss_data.txt | 82 ++++++++++++++++++++------ 2 files changed, 65 insertions(+), 19 deletions(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/controller_auth_data.txt b/modules/gallery/tests/controller_auth_data.txt index 94e7a07f..8263f79d 100644 --- a/modules/gallery/tests/controller_auth_data.txt +++ b/modules/gallery/tests/controller_auth_data.txt @@ -23,6 +23,8 @@ modules/gallery/controllers/user_profile.php show modules/gallery/controllers/user_profile.php contact DIRTY_AUTH modules/gallery/controllers/user_profile.php send DIRTY_AUTH modules/gallery/controllers/welcome_message.php index DIRTY_AUTH +modules/organize/controllers/organize.php dialog DIRTY_CSRF +modules/organize/controllers/organize.php add_album_fields DIRTY_AUTH modules/rest/controllers/rest.php index DIRTY_CSRF|DIRTY_AUTH modules/rest/controllers/rest.php __call DIRTY_CSRF|DIRTY_AUTH modules/rss/controllers/rss.php feed DIRTY_CSRF|DIRTY_AUTH diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 7fce42a1..4ead8a3f 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -33,8 +33,8 @@ modules/comment/views/comment.mrss.php 29 DIRTY $child modules/comment/views/comment.mrss.php 34 DIRTY_ATTR $child->thumb_url modules/comment/views/comment.mrss.php 35 DIRTY_ATTR $child->thumb_height modules/comment/views/comment.mrss.php 35 DIRTY_ATTR $child->thumb_width -modules/comment/views/comments.html.php 21 DIRTY_ATTR $comment->id -modules/comment/views/comments.html.php 24 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true)) +modules/comment/views/comments.html.php 28 DIRTY_ATTR $comment->id +modules/comment/views/comments.html.php 31 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true)) modules/comment/views/user_profile_comments.html.php 5 DIRTY_ATTR $comment->id modules/comment/views/user_profile_comments.html.php 10 DIRTY_JS $comment->item()->url() modules/comment/views/user_profile_comments.html.php 11 DIRTY $comment->item()->thumb_img(array(),50) @@ -122,6 +122,50 @@ modules/gallery/views/admin_themes.html.php 76 DIRTY $info- modules/gallery/views/admin_themes.html.php 78 DIRTY $info->description modules/gallery/views/admin_themes_preview.html.php 7 DIRTY_ATTR $url modules/gallery/views/error_404.html.php 14 DIRTY $login_form +modules/gallery/views/error_admin.html.php 150 DIRTY $type +modules/gallery/views/error_admin.html.php 150 DIRTY $code +modules/gallery/views/error_admin.html.php 153 DIRTY $message +modules/gallery/views/error_admin.html.php 156 DIRTY_ATTR $error_id +modules/gallery/views/error_admin.html.php 161 DIRTY Kohana_Exception::debug_path($file) +modules/gallery/views/error_admin.html.php 161 DIRTY $line +modules/gallery/views/error_admin.html.php 166 DIRTY_ATTR ($num==$line)?"highlight":"" +modules/gallery/views/error_admin.html.php 166 DIRTY $num +modules/gallery/views/error_admin.html.php 166 DIRTY htmlspecialchars($row,ENT_NOQUOTES,Kohana::CHARSET) +modules/gallery/views/error_admin.html.php 178 DIRTY_ATTR $source_id +modules/gallery/views/error_admin.html.php 178 DIRTY_JS $source_id +modules/gallery/views/error_admin.html.php 178 DIRTY Kohana_Exception::debug_path($step["file"]) +modules/gallery/views/error_admin.html.php 178 DIRTY $step["line"] +modules/gallery/views/error_admin.html.php 180 DIRTY Kohana_Exception::debug_path($step["file"]) +modules/gallery/views/error_admin.html.php 180 DIRTY $step["line"] +modules/gallery/views/error_admin.html.php 187 DIRTY $step["function"] +modules/gallery/views/error_admin.html.php 188 DIRTY_ATTR $args_id +modules/gallery/views/error_admin.html.php 188 DIRTY_JS $args_id +modules/gallery/views/error_admin.html.php 192 DIRTY_ATTR $args_id +modules/gallery/views/error_admin.html.php 197 DIRTY $name +modules/gallery/views/error_admin.html.php 200 DIRTY Kohana_Exception::safe_dump($arg,$name) +modules/gallery/views/error_admin.html.php 208 DIRTY_ATTR $source_id +modules/gallery/views/error_admin.html.php 208 DIRTY_ATTR ($num==$step["line"])?"highlight":"" +modules/gallery/views/error_admin.html.php 208 DIRTY $num +modules/gallery/views/error_admin.html.php 208 DIRTY htmlspecialchars($row,ENT_NOQUOTES,Kohana::CHARSET) +modules/gallery/views/error_admin.html.php 218 DIRTY_ATTR $env_id=$error_id."environment" +modules/gallery/views/error_admin.html.php 218 DIRTY_JS $env_id +modules/gallery/views/error_admin.html.php 220 DIRTY_ATTR $env_id +modules/gallery/views/error_admin.html.php 222 DIRTY_ATTR $env_id=$error_id."environment_included" +modules/gallery/views/error_admin.html.php 222 DIRTY_JS $env_id +modules/gallery/views/error_admin.html.php 222 DIRTY count($included) +modules/gallery/views/error_admin.html.php 223 DIRTY_ATTR $env_id +modules/gallery/views/error_admin.html.php 228 DIRTY Kohana_Exception::debug_path($file) +modules/gallery/views/error_admin.html.php 235 DIRTY_ATTR $env_id=$error_id."environment_loaded" +modules/gallery/views/error_admin.html.php 235 DIRTY_JS $env_id +modules/gallery/views/error_admin.html.php 235 DIRTY count($included) +modules/gallery/views/error_admin.html.php 236 DIRTY_ATTR $env_id +modules/gallery/views/error_admin.html.php 241 DIRTY Kohana_Exception::debug_path($file) +modules/gallery/views/error_admin.html.php 249 DIRTY_ATTR $env_id="$error_id.environment".strtolower($var) +modules/gallery/views/error_admin.html.php 250 DIRTY_JS $env_id +modules/gallery/views/error_admin.html.php 250 DIRTY $var +modules/gallery/views/error_admin.html.php 251 DIRTY_ATTR $env_id +modules/gallery/views/error_admin.html.php 257 DIRTY $key +modules/gallery/views/error_admin.html.php 261 DIRTY Kohana_Exception::safe_dump($value,$key) modules/gallery/views/form_uploadify.html.php 9 DIRTY_JS url::file("lib/uploadify/uploadify.swf") modules/gallery/views/form_uploadify.html.php 10 DIRTY_JS url::site("simple_uploader/add_photo/{$album->id}") modules/gallery/views/form_uploadify.html.php 14 DIRTY_JS url::file("lib/uploadify/cancel.png") @@ -235,16 +279,16 @@ modules/notification/views/item_updated.html.php 20 DIRTY_JS $item- modules/notification/views/item_updated.html.php 20 DIRTY $item->abs_url() modules/notification/views/user_profile_notification.html.php 5 DIRTY_ATTR $subscription->id modules/notification/views/user_profile_notification.html.php 6 DIRTY_JS $subscription->url -modules/organize/views/organize_dialog.html.php 92 DIRTY_JS $domain -modules/organize/views/organize_dialog.html.php 93 DIRTY_JS $access_key -modules/organize/views/organize_dialog.html.php 94 DIRTY_JS $protocol -modules/organize/views/organize_dialog.html.php 95 DIRTY_JS $file_filter -modules/organize/views/organize_dialog.html.php 96 DIRTY_JS $sort_order -modules/organize/views/organize_dialog.html.php 97 DIRTY_JS $sort_fields -modules/organize/views/organize_dialog.html.php 98 DIRTY_JS $album->id -modules/organize/views/organize_dialog.html.php 99 DIRTY_JS $rest_uri -modules/organize/views/organize_dialog.html.php 100 DIRTY_JS $controller_uri -modules/organize/views/organize_dialog.html.php 124 DIRTY_JS $swf_url +modules/organize/views/organize_dialog.html.php 90 DIRTY_JS $domain +modules/organize/views/organize_dialog.html.php 91 DIRTY_JS $access_key +modules/organize/views/organize_dialog.html.php 92 DIRTY_JS request::protocol() +modules/organize/views/organize_dialog.html.php 93 DIRTY_JS $file_filter +modules/organize/views/organize_dialog.html.php 94 DIRTY_JS $sort_order +modules/organize/views/organize_dialog.html.php 95 DIRTY_JS $sort_fields +modules/organize/views/organize_dialog.html.php 96 DIRTY_JS $album->id +modules/organize/views/organize_dialog.html.php 97 DIRTY_JS $rest_uri +modules/organize/views/organize_dialog.html.php 98 DIRTY_JS $controller_uri +modules/organize/views/organize_dialog.html.php 122 DIRTY_JS $swf_uri modules/recaptcha/views/admin_recaptcha.html.php 11 DIRTY $form modules/recaptcha/views/admin_recaptcha.html.php 23 DIRTY_JS $public_key modules/recaptcha/views/form_recaptcha.html.php 7 DIRTY_JS $public_key @@ -316,13 +360,13 @@ themes/admin_wind/views/admin.html.php 43 DIRTY $theme themes/admin_wind/views/admin.html.php 51 DIRTY $theme->admin_header_top() themes/admin_wind/views/admin.html.php 52 DIRTY_JS item::root()->url() themes/admin_wind/views/admin.html.php 55 DIRTY $theme->user_menu() -themes/admin_wind/views/admin.html.php 57 DIRTY $theme->admin_menu() -themes/admin_wind/views/admin.html.php 59 DIRTY $theme->admin_header_bottom() -themes/admin_wind/views/admin.html.php 66 DIRTY $content -themes/admin_wind/views/admin.html.php 72 DIRTY $sidebar -themes/admin_wind/views/admin.html.php 77 DIRTY $theme->admin_footer() -themes/admin_wind/views/admin.html.php 79 DIRTY $theme->admin_credits() -themes/admin_wind/views/admin.html.php 83 DIRTY $theme->admin_page_bottom() +themes/admin_wind/views/admin.html.php 58 DIRTY $theme->admin_menu() +themes/admin_wind/views/admin.html.php 61 DIRTY $theme->admin_header_bottom() +themes/admin_wind/views/admin.html.php 68 DIRTY $content +themes/admin_wind/views/admin.html.php 74 DIRTY $sidebar +themes/admin_wind/views/admin.html.php 79 DIRTY $theme->admin_footer() +themes/admin_wind/views/admin.html.php 81 DIRTY $theme->admin_credits() +themes/admin_wind/views/admin.html.php 85 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 -- cgit v1.2.3 From 0d424a635d12eee59d2080fa7ffa32a248b0fd5c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 3 Jul 2010 14:25:33 -0700 Subject: When we delete an item, make sure that we scrub it from any other items that may have it in the album_cover_item_id column. Fixes ticket #1172. --- modules/gallery/helpers/gallery_event.php | 9 +++++++++ modules/gallery/tests/Item_Helper_Test.php | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 82f42d98..40ea50fa 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -98,6 +98,15 @@ class gallery_event_Core { static function item_deleted($item) { access::delete_item($item); + // Find any other albums that had the deleted item as the album cover and null it out. + // In some cases this may leave us with a missing album cover up in this item's parent + // hierarchy, but in most cases it'll work out fine. + foreach (ORM::factory("item") + ->where("album_cover_item_id", "=", $item->id) + ->find_all() as $parent) { + item::remove_album_cover($parent); + } + $parent = $item->parent(); if (!$parent->album_cover_item_id) { // Assume we deleted the album cover and pick a new one. Choosing the first photo in the diff --git a/modules/gallery/tests/Item_Helper_Test.php b/modules/gallery/tests/Item_Helper_Test.php index 00229973..eb2458cb 100644 --- a/modules/gallery/tests/Item_Helper_Test.php +++ b/modules/gallery/tests/Item_Helper_Test.php @@ -111,15 +111,18 @@ class Item_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_not_same($rand, $photo2->slug); } - public function delete_cover_photo_picks_new_album_cover() { - $album = test::random_album(); + public function delete_cover_photo_picks_new_album_cover_test() { + $parent = test::random_album(); + $album = test::random_album($parent); $photo1 = test::random_photo($album); // At this point, $photo1 is the album cover. We verify this in // Item_Model_Test::first_photo_becomes_album_cover $photo2 = test::random_photo($album); $photo1->delete(); $album->reload(); + $parent->reload(); $this->assert_same($photo2->id, $album->album_cover_item_id); + $this->assert_same($photo2->id, $parent->album_cover_item_id); } } -- cgit v1.2.3 From eee8c27f2666d65c03c36698a612a055e9b55d5e Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 6 Jul 2010 08:43:02 -0700 Subject: Correct the controller auth golden file from when the simple_uploader was renamed to flash_uploader --- modules/gallery/tests/controller_auth_data.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/controller_auth_data.txt b/modules/gallery/tests/controller_auth_data.txt index 8263f79d..f7ceed90 100644 --- a/modules/gallery/tests/controller_auth_data.txt +++ b/modules/gallery/tests/controller_auth_data.txt @@ -9,6 +9,8 @@ modules/gallery/controllers/albums.php show modules/gallery/controllers/combined.php javascript DIRTY_AUTH modules/gallery/controllers/combined.php css DIRTY_AUTH modules/gallery/controllers/file_proxy.php __call DIRTY_CSRF|DIRTY_AUTH +modules/gallery/controllers/flash_uploader.php start DIRTY_AUTH +modules/gallery/controllers/flash_uploader.php finish DIRTY_AUTH modules/gallery/controllers/login.php ajax DIRTY_AUTH modules/gallery/controllers/login.php auth_ajax DIRTY_AUTH modules/gallery/controllers/login.php html DIRTY_AUTH @@ -16,8 +18,6 @@ modules/gallery/controllers/login.php auth_html modules/gallery/controllers/logout.php index DIRTY_AUTH modules/gallery/controllers/maintenance.php index DIRTY_AUTH modules/gallery/controllers/quick.php form_edit DIRTY_CSRF -modules/gallery/controllers/simple_uploader.php start DIRTY_AUTH -modules/gallery/controllers/simple_uploader.php finish DIRTY_AUTH modules/gallery/controllers/upgrader.php index DIRTY_AUTH modules/gallery/controllers/user_profile.php show DIRTY_AUTH modules/gallery/controllers/user_profile.php contact DIRTY_AUTH -- cgit v1.2.3 From 9d66783f47636153bf3661d1d89e694dd5188c36 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 6 Jul 2010 09:48:37 -0700 Subject: Update the xss golden file --- modules/gallery/tests/xss_data.txt | 64 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'modules/gallery/tests') diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 4ead8a3f..26edaebc 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -28,11 +28,11 @@ modules/comment/views/comment.mrss.php 16 DIRTY_JS $feed- modules/comment/views/comment.mrss.php 19 DIRTY_JS $feed->next_page_uri modules/comment/views/comment.mrss.php 21 DIRTY $pub_date modules/comment/views/comment.mrss.php 22 DIRTY $pub_date -modules/comment/views/comment.mrss.php 28 DIRTY $child->item_uri -modules/comment/views/comment.mrss.php 29 DIRTY $child->pub_date -modules/comment/views/comment.mrss.php 34 DIRTY_ATTR $child->thumb_url -modules/comment/views/comment.mrss.php 35 DIRTY_ATTR $child->thumb_height -modules/comment/views/comment.mrss.php 35 DIRTY_ATTR $child->thumb_width +modules/comment/views/comment.mrss.php 28 DIRTY $comment->item_uri +modules/comment/views/comment.mrss.php 29 DIRTY $comment->pub_date +modules/comment/views/comment.mrss.php 34 DIRTY_ATTR $comment->thumb_url +modules/comment/views/comment.mrss.php 35 DIRTY_ATTR $comment->thumb_height +modules/comment/views/comment.mrss.php 35 DIRTY_ATTR $comment->thumb_width modules/comment/views/comments.html.php 28 DIRTY_ATTR $comment->id modules/comment/views/comments.html.php 31 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true)) modules/comment/views/user_profile_comments.html.php 5 DIRTY_ATTR $comment->id @@ -109,7 +109,7 @@ modules/gallery/views/admin_sidebar.html.php 50 DIRTY $avail modules/gallery/views/admin_sidebar.html.php 58 DIRTY $active modules/gallery/views/admin_sidebar_blocks.html.php 4 DIRTY_ATTR $ref modules/gallery/views/admin_sidebar_blocks.html.php 4 DIRTY $text -modules/gallery/views/admin_theme_options.html.php 6 DIRTY $form +modules/gallery/views/admin_theme_options.html.php 36 DIRTY $form modules/gallery/views/admin_themes.html.php 3 DIRTY_JS url::site("admin/themes/choose") modules/gallery/views/admin_themes.html.php 5 DIRTY_JS $csrf modules/gallery/views/admin_themes.html.php 22 DIRTY $themes[$site]->name @@ -120,7 +120,7 @@ modules/gallery/views/admin_themes.html.php 60 DIRTY $theme modules/gallery/views/admin_themes.html.php 62 DIRTY $themes[$admin]->description modules/gallery/views/admin_themes.html.php 76 DIRTY $info->name modules/gallery/views/admin_themes.html.php 78 DIRTY $info->description -modules/gallery/views/admin_themes_preview.html.php 7 DIRTY_ATTR $url +modules/gallery/views/admin_themes_preview.html.php 8 DIRTY_ATTR $url modules/gallery/views/error_404.html.php 14 DIRTY $login_form modules/gallery/views/error_admin.html.php 150 DIRTY $type modules/gallery/views/error_admin.html.php 150 DIRTY $code @@ -167,7 +167,7 @@ modules/gallery/views/error_admin.html.php 251 DIRTY_ATTR $env modules/gallery/views/error_admin.html.php 257 DIRTY $key modules/gallery/views/error_admin.html.php 261 DIRTY Kohana_Exception::safe_dump($value,$key) modules/gallery/views/form_uploadify.html.php 9 DIRTY_JS url::file("lib/uploadify/uploadify.swf") -modules/gallery/views/form_uploadify.html.php 10 DIRTY_JS url::site("simple_uploader/add_photo/{$album->id}") +modules/gallery/views/form_uploadify.html.php 10 DIRTY_JS url::site("flash_uploader/add_photo/{$album->id}") modules/gallery/views/form_uploadify.html.php 14 DIRTY_JS url::file("lib/uploadify/cancel.png") modules/gallery/views/form_uploadify.html.php 15 DIRTY_JS $simultaneous_upload_limit modules/gallery/views/in_place_edit.html.php 2 DIRTY form::open($action,array("method"=>"post","id"=>"g-in-place-edit-form","class"=>"g-short-form")) @@ -190,7 +190,7 @@ modules/gallery/views/l10n_client.html.php 58 DIRTY form:: modules/gallery/views/l10n_client.html.php 62 DIRTY form::textarea("l10n-edit-plural-translation-many","",' rows="2"') modules/gallery/views/l10n_client.html.php 67 DIRTY form::textarea("l10n-edit-plural-translation-other","",' rows="2"') modules/gallery/views/login_ajax.html.php 6 DIRTY_JS url::site("password/reset") -modules/gallery/views/login_ajax.html.php 37 DIRTY $form +modules/gallery/views/login_ajax.html.php 44 DIRTY $form modules/gallery/views/maintenance.html.php 46 DIRTY auth::get_login_form("login/auth_html") modules/gallery/views/menu.html.php 4 DIRTY $menu->css_id?"id='$menu->css_id'":"" modules/gallery/views/menu.html.php 4 DIRTY_ATTR $menu->css_class @@ -298,26 +298,26 @@ modules/rss/views/feed.mrss.php 16 DIRTY_JS $feed- modules/rss/views/feed.mrss.php 19 DIRTY_JS $feed->next_page_uri modules/rss/views/feed.mrss.php 21 DIRTY $pub_date modules/rss/views/feed.mrss.php 22 DIRTY $pub_date -modules/rss/views/feed.mrss.php 28 DIRTY date("D, d M Y H:i:s T",$child->created); -modules/rss/views/feed.mrss.php 35 DIRTY_ATTR $child->resize_url(true) -modules/rss/views/feed.mrss.php 37 DIRTY_ATTR $child->resize_height -modules/rss/views/feed.mrss.php 37 DIRTY_ATTR $child->resize_width -modules/rss/views/feed.mrss.php 40 DIRTY_ATTR $child->thumb_url(true) -modules/rss/views/feed.mrss.php 42 DIRTY_ATTR $child->thumb_height -modules/rss/views/feed.mrss.php 42 DIRTY_ATTR $child->thumb_width -modules/rss/views/feed.mrss.php 48 DIRTY_ATTR $child->thumb_url(true) -modules/rss/views/feed.mrss.php 49 DIRTY_ATTR $child->thumb_height -modules/rss/views/feed.mrss.php 50 DIRTY_ATTR $child->thumb_width -modules/rss/views/feed.mrss.php 57 DIRTY_ATTR $child->resize_url(true) -modules/rss/views/feed.mrss.php 58 DIRTY_ATTR @filesize($child->resize_path()) -modules/rss/views/feed.mrss.php 59 DIRTY_ATTR $child->mime_type -modules/rss/views/feed.mrss.php 60 DIRTY_ATTR $child->resize_height -modules/rss/views/feed.mrss.php 61 DIRTY_ATTR $child->resize_width -modules/rss/views/feed.mrss.php 65 DIRTY_ATTR $child->file_url(true) -modules/rss/views/feed.mrss.php 66 DIRTY_ATTR @filesize($child->file_path()) -modules/rss/views/feed.mrss.php 67 DIRTY_ATTR $child->mime_type -modules/rss/views/feed.mrss.php 68 DIRTY_ATTR $child->height -modules/rss/views/feed.mrss.php 69 DIRTY_ATTR $child->width +modules/rss/views/feed.mrss.php 28 DIRTY date("D, d M Y H:i:s T",$item->created); +modules/rss/views/feed.mrss.php 35 DIRTY_ATTR $item->resize_url(true) +modules/rss/views/feed.mrss.php 37 DIRTY_ATTR $item->resize_height +modules/rss/views/feed.mrss.php 37 DIRTY_ATTR $item->resize_width +modules/rss/views/feed.mrss.php 40 DIRTY_ATTR $item->thumb_url(true) +modules/rss/views/feed.mrss.php 42 DIRTY_ATTR $item->thumb_height +modules/rss/views/feed.mrss.php 42 DIRTY_ATTR $item->thumb_width +modules/rss/views/feed.mrss.php 48 DIRTY_ATTR $item->thumb_url(true) +modules/rss/views/feed.mrss.php 49 DIRTY_ATTR $item->thumb_height +modules/rss/views/feed.mrss.php 50 DIRTY_ATTR $item->thumb_width +modules/rss/views/feed.mrss.php 57 DIRTY_ATTR $item->resize_url(true) +modules/rss/views/feed.mrss.php 58 DIRTY_ATTR @filesize($item->resize_path()) +modules/rss/views/feed.mrss.php 59 DIRTY_ATTR $item->mime_type +modules/rss/views/feed.mrss.php 60 DIRTY_ATTR $item->resize_height +modules/rss/views/feed.mrss.php 61 DIRTY_ATTR $item->resize_width +modules/rss/views/feed.mrss.php 65 DIRTY_ATTR $item->file_url(true) +modules/rss/views/feed.mrss.php 66 DIRTY_ATTR @filesize($item->file_path()) +modules/rss/views/feed.mrss.php 67 DIRTY_ATTR $item->mime_type +modules/rss/views/feed.mrss.php 68 DIRTY_ATTR $item->height +modules/rss/views/feed.mrss.php 69 DIRTY_ATTR $item->width modules/rss/views/rss_block.html.php 6 DIRTY_JS rss::url($url) modules/search/views/search.html.php 27 DIRTY_ATTR $item_class modules/search/views/search.html.php 28 DIRTY_JS $item->url() @@ -406,9 +406,9 @@ themes/wind/views/page.html.php 81 DIRTY $heade themes/wind/views/page.html.php 83 DIRTY_JS item::root()->url() themes/wind/views/page.html.php 87 DIRTY $theme->user_menu() themes/wind/views/page.html.php 108 DIRTY_JS $parent->url($parent==$theme->item()->parent()?"show={$theme->item()->id}":null) -themes/wind/views/page.html.php 124 DIRTY $content -themes/wind/views/page.html.php 130 DIRTY newView("sidebar.html") -themes/wind/views/page.html.php 137 DIRTY $footer_text +themes/wind/views/page.html.php 126 DIRTY $content +themes/wind/views/page.html.php 132 DIRTY newView("sidebar.html") +themes/wind/views/page.html.php 139 DIRTY $footer_text themes/wind/views/paginator.html.php 33 DIRTY_JS $first_page_url themes/wind/views/paginator.html.php 42 DIRTY_JS $previous_page_url themes/wind/views/paginator.html.php 70 DIRTY_JS $next_page_url -- cgit v1.2.3