From 5679e30ef6c68272cce295bd593bc23c9ec1e1b3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 4 Apr 2010 11:55:54 -0700 Subject: REST changes: Allow PUT and POST requests to modify members, not just entity. TESTS ARE NOT UPDATED YET. - Fix item_rest::get() to maintain the proper sort order, which requires duplicating some Item_Model code. - Elide "weight" from the REST version of item - Adjust the weight of members according to the order they're returned from the client. You can't add or remove members here, you can only reorder them. - Changed the wire protocol to handle more complex values. Now "entity" and "members" are JSON encoded. The Gallery3 helper does this correctly. - Changed the wire protocol for tag_item -- now it stores the tag and item urls in the entity, not as members. This is more consistent. - Added missing security for renaming and deleting tags. - Got rid of vestigial tag_rest::post(). We add/remove tags via the relationship. --- modules/tag/helpers/item_tags_rest.php | 5 +++-- modules/tag/helpers/tag_item_rest.php | 2 +- modules/tag/helpers/tag_items_rest.php | 4 ++-- modules/tag/helpers/tag_rest.php | 27 ++++++++++++--------------- modules/tag/helpers/tags_rest.php | 6 +++--- 5 files changed, 21 insertions(+), 23 deletions(-) (limited to 'modules/tag') diff --git a/modules/tag/helpers/item_tags_rest.php b/modules/tag/helpers/item_tags_rest.php index 8a1b1e8b..02c79e5d 100644 --- a/modules/tag/helpers/item_tags_rest.php +++ b/modules/tag/helpers/item_tags_rest.php @@ -31,8 +31,8 @@ class item_tags_rest_Core { } static function post($request) { - $tag = rest::resolve($request->params->tag); - $item = rest::resolve($request->params->item); + $tag = rest::resolve($request->params->entity->tag); + $item = rest::resolve($request->params->entity->item); access::required("view", $item); tag::add($item, $tag->name); @@ -45,6 +45,7 @@ class item_tags_rest_Core { static function delete($request) { list ($tag, $item) = rest::resolve($request->url); + access::required("edit", $item); $tag->remove($item); $tag->save(); } diff --git a/modules/tag/helpers/tag_item_rest.php b/modules/tag/helpers/tag_item_rest.php index bce00a9f..17cb726e 100644 --- a/modules/tag/helpers/tag_item_rest.php +++ b/modules/tag/helpers/tag_item_rest.php @@ -22,7 +22,7 @@ class tag_item_rest_Core { list ($tag, $item) = rest::resolve($request->url); return array( "url" => $request->url, - "members" => array( + "entity" => array( "tag" => rest::url("tag", $tag), "item" => rest::url("item", $item))); } diff --git a/modules/tag/helpers/tag_items_rest.php b/modules/tag/helpers/tag_items_rest.php index 003c7c95..848c2cd3 100644 --- a/modules/tag/helpers/tag_items_rest.php +++ b/modules/tag/helpers/tag_items_rest.php @@ -33,8 +33,8 @@ class tag_items_rest_Core { } static function post($request) { - $tag = rest::resolve($request->params->tag); - $item = rest::resolve($request->params->item); + $tag = rest::resolve($request->params->entity->tag); + $item = rest::resolve($request->params->entity->item); access::required("view", $item); if (!$tag->loaded()) { diff --git a/modules/tag/helpers/tag_rest.php b/modules/tag/helpers/tag_rest.php index f30706bd..e0b7bd87 100644 --- a/modules/tag/helpers/tag_rest.php +++ b/modules/tag/helpers/tag_rest.php @@ -36,28 +36,25 @@ class tag_rest_Core { "members" => $tag_items))); } - static function post($request) { - if (empty($request->params->url)) { - throw new Rest_Exception("Bad request", 400); - } - - $tag = rest::resolve($request->url); - $item = rest::resolve($request->params->url); - access::required("edit", $item); - - tag::add($item, $tag->name); - return array("url" => rest::url("tag_item", $tag, $item)); - } - static function put($request) { + // Who can we allow to edit a tag name? If we allow anybody to do it then any logged in + // user can rename all your tags to something offensive. Right now limit renaming to admins. + if (!identity::active_user()->admin) { + access::forbidden(); + } $tag = rest::resolve($request->url); - if (isset($request->params->name)) { - $tag->name = $request->params->name; + if (isset($request->params->entity->name)) { + $tag->name = $request->params->entity->name; $tag->save(); } } static function delete($request) { + // Restrict deleting tags to admins. Otherwise, a logged in user can do great harm to an + // install. + if (!identity::active_user()->admin) { + access::forbidden(); + } $tag = rest::resolve($request->url); $tag->delete(); } diff --git a/modules/tag/helpers/tags_rest.php b/modules/tag/helpers/tags_rest.php index 82826d8e..434e774a 100644 --- a/modules/tag/helpers/tags_rest.php +++ b/modules/tag/helpers/tags_rest.php @@ -40,13 +40,13 @@ class tags_rest_Core { } } - if (empty($request->params->name)) { + if (empty($request->params->entity->name)) { throw new Rest_Exception("Bad Request", 400); } - $tag = ORM::factory("tag")->where("name", "=", $request->params->name)->find(); + $tag = ORM::factory("tag")->where("name", "=", $request->params->entity->name)->find(); if (!$tag->loaded()) { - $tag->name = $request->params->name; + $tag->name = $request->params->entity->name; $tag->count = 0; $tag->save(); } -- cgit v1.2.3 From af71df3d0f6bbed29446df1801d16d28acbf927c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 17 Apr 2010 15:35:09 -0700 Subject: Update tests to reflect recent changes to the REST API. --- modules/gallery/tests/Item_Rest_Helper_Test.php | 70 ++++++++++++++----------- modules/rest/tests/Rest_Controller_Test.php | 1 + modules/tag/tests/Tag_Item_Rest_Helper_Test.php | 2 +- modules/tag/tests/Tag_Rest_Helper_Test.php | 32 +---------- modules/tag/tests/Tags_Rest_Helper_Test.php | 8 +-- 5 files changed, 49 insertions(+), 64 deletions(-) (limited to 'modules/tag') diff --git a/modules/gallery/tests/Item_Rest_Helper_Test.php b/modules/gallery/tests/Item_Rest_Helper_Test.php index bef95668..0b5e0471 100644 --- a/modules/gallery/tests/Item_Rest_Helper_Test.php +++ b/modules/gallery/tests/Item_Rest_Helper_Test.php @@ -42,13 +42,14 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal_array( array("url" => rest::url("item", $album1), "entity" => $album1->as_restful_array(), - "members" => array( - rest::url("item", $photo1), - rest::url("item", $album2)), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), - "members" => array()))), + "members" => array())), + "members" => array( + rest::url("item", $photo1), + rest::url("item", $album2)), + ), item_rest::get($request)); $request->url = rest::url("item", $album1); @@ -56,13 +57,14 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal_array( array("url" => rest::url("item", $album1), "entity" => $album1->as_restful_array(), - "members" => array( - rest::url("item", $photo1), - rest::url("item", $album2)), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), - "members" => array()))), + "members" => array())), + "members" => array( + rest::url("item", $photo1), + rest::url("item", $album2)), + ), item_rest::get($request)); $request->url = rest::url("item", $album1); @@ -70,14 +72,15 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal_array( 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), rest::url("item", $photo2)), - "relationships" => array( - "tags" => array( - "url" => rest::url("item_tags", $album1), - "members" => array()))), + ), item_rest::get($request)); } @@ -96,12 +99,13 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal_array( array("url" => rest::url("item", $album1), "entity" => $album1->as_restful_array(), - "members" => array( - rest::url("item", $photo2)), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), - "members" => array()))), + "members" => array())), + "members" => array( + rest::url("item", $photo2)), + ), item_rest::get($request)); } @@ -118,12 +122,13 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $this->assert_equal_array( array("url" => rest::url("item", $album1), "entity" => $album1->as_restful_array(), - "members" => array( - rest::url("item", $album2)), "relationships" => array( "tags" => array( "url" => rest::url("item_tags", $album1), - "members" => array() ))), + "members" => array())), + "members" => array( + rest::url("item", $album2)), + ), item_rest::get($request)); } @@ -134,7 +139,8 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request = new stdClass(); $request->url = rest::url("item", $album1); $request->params = new stdClass(); - $request->params->title = "my new title"; + $request->params->entity = new stdClass(); + $request->params->entity->title = "my new title"; item_rest::put($request); $this->assert_equal("my new title", $album1->reload()->title); @@ -147,8 +153,9 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request = new stdClass(); $request->url = rest::url("item", $album1); $request->params = new stdClass(); - $request->params->title = "my new title"; - $request->params->slug = "not url safe"; + $request->params->entity = new stdClass(); + $request->params->entity->title = "my new title"; + $request->params->entity->slug = "not url safe"; try { item_rest::put($request); @@ -166,9 +173,10 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request = new stdClass(); $request->url = rest::url("item", $album1); $request->params = new stdClass(); - $request->params->type = "album"; - $request->params->name = "my album"; - $request->params->title = "my album"; + $request->params->entity = new stdClass(); + $request->params->entity->type = "album"; + $request->params->entity->name = "my album"; + $request->params->entity->title = "my album"; $response = item_rest::post($request); $new_album = rest::resolve($response["url"]); @@ -183,10 +191,11 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request = new stdClass(); $request->url = rest::url("item", $album1); $request->params = new stdClass(); - $request->params->type = "album"; - $request->params->name = "my album"; - $request->params->title = "my album"; - $request->params->slug = "not url safe"; + $request->params->entity = new stdClass(); + $request->params->entity->type = "album"; + $request->params->entity->name = "my album"; + $request->params->entity->title = "my album"; + $request->params->entity->slug = "not url safe"; try { item_rest::post($request); @@ -205,8 +214,9 @@ class Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request = new stdClass(); $request->url = rest::url("item", $album1); $request->params = new stdClass(); - $request->params->type = "photo"; - $request->params->name = "my photo.jpg"; + $request->params->entity = new stdClass(); + $request->params->entity->type = "photo"; + $request->params->entity->name = "my photo.jpg"; $request->file = MODPATH . "gallery/tests/test.jpg"; $response = item_rest::post($request); $new_photo = rest::resolve($response["url"]); diff --git a/modules/rest/tests/Rest_Controller_Test.php b/modules/rest/tests/Rest_Controller_Test.php index 6d09b214..fe83283d 100644 --- a/modules/rest/tests/Rest_Controller_Test.php +++ b/modules/rest/tests/Rest_Controller_Test.php @@ -27,6 +27,7 @@ class Rest_Controller_Test extends Gallery_Unit_Test_Case { public function teardown() { list($_GET, $_POST, $_SERVER) = $this->_save; + identity::set_active_user(identity::admin_user()); } public function login_test() { diff --git a/modules/tag/tests/Tag_Item_Rest_Helper_Test.php b/modules/tag/tests/Tag_Item_Rest_Helper_Test.php index e5acab93..533f832d 100644 --- a/modules/tag/tests/Tag_Item_Rest_Helper_Test.php +++ b/modules/tag/tests/Tag_Item_Rest_Helper_Test.php @@ -32,7 +32,7 @@ class Tag_Item_Rest_Helper_Test extends Gallery_Unit_Test_Case { $request->url = rest::url("tag_item", $tag, item::root()); $this->assert_equal_array( array("url" => rest::url("tag_item", $tag, item::root()), - "members" => array( + "entity" => array( "tag" => rest::url("tag", $tag), "item" => rest::url("item", item::root()))), tag_item_rest::get($request)); diff --git a/modules/tag/tests/Tag_Rest_Helper_Test.php b/modules/tag/tests/Tag_Rest_Helper_Test.php index f4d5a14a..a8aa89d4 100644 --- a/modules/tag/tests/Tag_Rest_Helper_Test.php +++ b/modules/tag/tests/Tag_Rest_Helper_Test.php @@ -67,41 +67,13 @@ class Tag_Rest_Helper_Test extends Gallery_Unit_Test_Case { tag_rest::get($request)); } - public function post_test() { - $tag = test::random_tag(); - - // Create an editable item to be tagged - $album = test::random_album(); - access::allow(identity::everybody(), "edit", $album); - - // Add the album to the tag - $request = new stdClass(); - $request->url = rest::url("tag", $tag); - $request->params = new stdClass(); - $request->params->url = rest::url("item", $album); - $this->assert_equal_array( - array("url" => rest::url("tag_item", $tag, $album)), - tag_rest::post($request)); - } - - public function post_with_no_item_url_test() { - $request = new stdClass(); - try { - tag_rest::post($request); - } catch (Rest_Exception $e) { - $this->assert_equal(400, $e->getCode()); - return; - } - - $this->assert_true(false, "Shouldn't get here"); - } - public function put_test() { $tag = test::random_tag(); $request = new stdClass(); $request->url = rest::url("tag", $tag); $request->params = new stdClass(); - $request->params->name = "new name"; + $request->params->entity = new stdClass(); + $request->params->entity->name = "new name"; tag_rest::put($request); $this->assert_equal("new name", $tag->reload()->name); diff --git a/modules/tag/tests/Tags_Rest_Helper_Test.php b/modules/tag/tests/Tags_Rest_Helper_Test.php index a0ebc8c3..99332c7c 100644 --- a/modules/tag/tests/Tags_Rest_Helper_Test.php +++ b/modules/tag/tests/Tags_Rest_Helper_Test.php @@ -45,11 +45,12 @@ class Tags_Rest_Helper_Test extends Gallery_Unit_Test_Case { } public function post_test() { - access::allow(identity::everybody(), "edit", item::root()); + identity::set_active_user(identity::guest()); $request = new stdClass(); $request->params = new stdClass(); - $request->params->name = "test tag"; + $request->params->entity = new stdClass(); + $request->params->entity->name = "test tag"; $this->assert_equal( array("url" => url::site("rest/tag/1")), tags_rest::post($request)); @@ -63,7 +64,8 @@ class Tags_Rest_Helper_Test extends Gallery_Unit_Test_Case { try { $request = new stdClass(); $request->params = new stdClass(); - $request->params->name = "test tag"; + $request->params->entity = new stdClass(); + $request->params->entity->name = "test tag"; tags_rest::post($request); } catch (Exception $e) { $this->assert_equal(403, $e->getCode()); -- cgit v1.2.3 From 67ced571c7ea066d9e166deb49a63d327e2c1f4d Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Wed, 21 Apr 2010 22:48:33 -0600 Subject: HTML validation and accessibility fix, add id attr to add tag input. --- modules/tag/helpers/tag.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/tag') diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php index 8df4210d..14d27c94 100644 --- a/modules/tag/helpers/tag.php +++ b/modules/tag/helpers/tag.php @@ -98,7 +98,7 @@ class tag_Core { ($item->is_photo() ? t("Add tag to photo") : t("Add tag to movie")); $group = $form->group("add_tag")->label("Add Tag"); - $group->input("name")->label($label)->rules("required"); + $group->input("name")->label($label)->rules("required")->id("name"); $group->hidden("item_id")->value($item->id); $group->submit("")->value(t("Add Tag")); return $form; -- cgit v1.2.3 From e30849d310cf532128f4bd092acfbbd5598a5773 Mon Sep 17 00:00:00 2001 From: ckieffer Date: Thu, 29 Apr 2010 23:59:20 -0600 Subject: Applied capitalization rules to title, changed from Tag admin to Manage tags --- modules/tag/views/admin_tags.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/tag') diff --git a/modules/tag/views/admin_tags.html.php b/modules/tag/views/admin_tags.html.php index b637a7f1..e1db387b 100644 --- a/modules/tag/views/admin_tags.html.php +++ b/modules/tag/views/admin_tags.html.php @@ -16,7 +16,7 @@
-

+

-- cgit v1.2.3 From f1076590f15f5dc55b164e2b22688a51c805265e Mon Sep 17 00:00:00 2001 From: ckieffer Date: Fri, 30 Apr 2010 00:08:37 -0600 Subject: Add page_title to admin views. Closes #1038. --- modules/akismet/controllers/admin_akismet.php | 1 + modules/comment/controllers/admin_comments.php | 1 + modules/digibug/controllers/admin_digibug.php | 1 + modules/g2_import/controllers/admin_g2_import.php | 1 + modules/gallery/controllers/admin_advanced_settings.php | 1 + modules/gallery/controllers/admin_dashboard.php | 1 + modules/gallery/controllers/admin_graphics.php | 1 + modules/gallery/controllers/admin_languages.php | 1 + modules/gallery/controllers/admin_modules.php | 1 + modules/gallery/controllers/admin_sidebar.php | 1 + modules/gallery/controllers/admin_theme_options.php | 1 + modules/gallery/controllers/admin_themes.php | 1 + modules/recaptcha/controllers/admin_recaptcha.php | 1 + modules/server_add/controllers/admin_server_add.php | 1 + modules/tag/controllers/admin_tags.php | 1 + modules/user/controllers/admin_users.php | 1 + modules/watermark/controllers/admin_watermarks.php | 1 + 17 files changed, 17 insertions(+) (limited to 'modules/tag') diff --git a/modules/akismet/controllers/admin_akismet.php b/modules/akismet/controllers/admin_akismet.php index 8d292cf4..af98536a 100644 --- a/modules/akismet/controllers/admin_akismet.php +++ b/modules/akismet/controllers/admin_akismet.php @@ -50,6 +50,7 @@ class Admin_Akismet_Controller extends Admin_Controller { akismet::check_config(); $view = new Admin_View("admin.html"); + $view->page_title = t("Akismet spam filtering"); $view->content = new View("admin_akismet.html"); $view->content->valid_key = $valid_key; $view->content->form = $form; diff --git a/modules/comment/controllers/admin_comments.php b/modules/comment/controllers/admin_comments.php index 3abfe1de..68794638 100644 --- a/modules/comment/controllers/admin_comments.php +++ b/modules/comment/controllers/admin_comments.php @@ -44,6 +44,7 @@ class Admin_Comments_Controller extends Admin_Controller { $page = max(Input::instance()->get("page"), 1); $view = new Admin_View("admin.html"); + $view->page_title = t("Manage comments"); $view->content = new View("admin_comments.html"); $view->content->counts = $this->_counts(); $view->content->menu = $this->_menu($view->content->counts); diff --git a/modules/digibug/controllers/admin_digibug.php b/modules/digibug/controllers/admin_digibug.php index 76ed2319..f3a0f8f0 100644 --- a/modules/digibug/controllers/admin_digibug.php +++ b/modules/digibug/controllers/admin_digibug.php @@ -20,6 +20,7 @@ class Admin_Digibug_Controller extends Admin_Controller { public function index() { $v = new Admin_View("admin.html"); + $v->page_title = t("Digibug"); $v->content = new View("admin_digibug.html"); print $v; } diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php index bc00378d..b1018560 100644 --- a/modules/g2_import/controllers/admin_g2_import.php +++ b/modules/g2_import/controllers/admin_g2_import.php @@ -30,6 +30,7 @@ class Admin_g2_import_Controller extends Admin_Controller { } $view = new Admin_View("admin.html"); + $view->page_title = t("Gallery 2 import"); $view->content = new View("admin_g2_import.html"); $view->content->form = $this->_get_import_form(); $view->content->version = ''; diff --git a/modules/gallery/controllers/admin_advanced_settings.php b/modules/gallery/controllers/admin_advanced_settings.php index d9a281b5..6f4e9403 100644 --- a/modules/gallery/controllers/admin_advanced_settings.php +++ b/modules/gallery/controllers/admin_advanced_settings.php @@ -20,6 +20,7 @@ class Admin_Advanced_Settings_Controller extends Admin_Controller { public function index() { $view = new Admin_View("admin.html"); + $view->page_title = t("Advanced settings"); $view->content = new View("admin_advanced_settings.html"); $view->content->vars = ORM::factory("var") ->order_by("module_name") diff --git a/modules/gallery/controllers/admin_dashboard.php b/modules/gallery/controllers/admin_dashboard.php index adc0df16..76c42612 100644 --- a/modules/gallery/controllers/admin_dashboard.php +++ b/modules/gallery/controllers/admin_dashboard.php @@ -20,6 +20,7 @@ class Admin_Dashboard_Controller extends Admin_Controller { public function index() { $view = new Admin_View("admin.html"); + $view->page_title = t("Dashboard"); $view->content = new View("admin_dashboard.html"); $view->content->blocks = block_manager::get_html("dashboard_center"); $view->sidebar = "
" . diff --git a/modules/gallery/controllers/admin_graphics.php b/modules/gallery/controllers/admin_graphics.php index abbd8986..de98035d 100644 --- a/modules/gallery/controllers/admin_graphics.php +++ b/modules/gallery/controllers/admin_graphics.php @@ -20,6 +20,7 @@ class Admin_Graphics_Controller extends Admin_Controller { public function index() { $view = new Admin_View("admin.html"); + $view->page_title = t("Graphics settings"); $view->content = new View("admin_graphics.html"); $view->content->tk = graphics::detect_toolkits(); $view->content->active = module::get_var("gallery", "graphics_toolkit", "none"); diff --git a/modules/gallery/controllers/admin_languages.php b/modules/gallery/controllers/admin_languages.php index 1ca777dc..0f134fcd 100644 --- a/modules/gallery/controllers/admin_languages.php +++ b/modules/gallery/controllers/admin_languages.php @@ -20,6 +20,7 @@ class Admin_Languages_Controller extends Admin_Controller { public function index($share_translations_form=null) { $v = new Admin_View("admin.html"); + $v->page_title = t("Languages and translations"); $v->content = new View("admin_languages.html"); $v->content->available_locales = locales::available(); $v->content->installed_locales = locales::installed(); diff --git a/modules/gallery/controllers/admin_modules.php b/modules/gallery/controllers/admin_modules.php index 30e1ace5..bf638a37 100644 --- a/modules/gallery/controllers/admin_modules.php +++ b/modules/gallery/controllers/admin_modules.php @@ -20,6 +20,7 @@ class Admin_Modules_Controller extends Admin_Controller { public function index() { $view = new Admin_View("admin.html"); + $view->page_title = t("Modules"); $view->content = new View("admin_modules.html"); $view->content->available = module::available(); print $view; diff --git a/modules/gallery/controllers/admin_sidebar.php b/modules/gallery/controllers/admin_sidebar.php index 73f84d2f..fb857e4e 100644 --- a/modules/gallery/controllers/admin_sidebar.php +++ b/modules/gallery/controllers/admin_sidebar.php @@ -20,6 +20,7 @@ class Admin_Sidebar_Controller extends Admin_Controller { public function index() { $view = new Admin_View("admin.html"); + $view->page_title = t("Manage sidebar"); $view->content = new View("admin_sidebar.html"); $view->content->csrf = access::csrf_token(); $view->content->available = new View("admin_sidebar_blocks.html"); diff --git a/modules/gallery/controllers/admin_theme_options.php b/modules/gallery/controllers/admin_theme_options.php index cf4fb77a..15a42ee5 100644 --- a/modules/gallery/controllers/admin_theme_options.php +++ b/modules/gallery/controllers/admin_theme_options.php @@ -20,6 +20,7 @@ class Admin_Theme_Options_Controller extends Admin_Controller { public function index() { $view = new Admin_View("admin.html"); + $view->page_title = t("Theme options"); $view->content = new View("admin_theme_options.html"); $view->content->form = theme::get_edit_form_admin(); print $view; diff --git a/modules/gallery/controllers/admin_themes.php b/modules/gallery/controllers/admin_themes.php index 327ea6c8..e59eadaf 100644 --- a/modules/gallery/controllers/admin_themes.php +++ b/modules/gallery/controllers/admin_themes.php @@ -20,6 +20,7 @@ class Admin_Themes_Controller extends Admin_Controller { public function index() { $view = new Admin_View("admin.html"); + $view->page_title = t("Theme choice"); $view->content = new View("admin_themes.html"); $view->content->admin = module::get_var("gallery", "active_admin_theme"); $view->content->site = module::get_var("gallery", "active_site_theme"); diff --git a/modules/recaptcha/controllers/admin_recaptcha.php b/modules/recaptcha/controllers/admin_recaptcha.php index 3f2959a5..264d3177 100644 --- a/modules/recaptcha/controllers/admin_recaptcha.php +++ b/modules/recaptcha/controllers/admin_recaptcha.php @@ -51,6 +51,7 @@ class Admin_Recaptcha_Controller extends Admin_Controller { recaptcha::check_config(); $view = new Admin_View("admin.html"); + $view->page_title = t("reCAPTCHA"); $view->content = new View("admin_recaptcha.html"); $view->content->public_key = module::get_var("recaptcha", "public_key"); $view->content->private_key = module::get_var("recaptcha", "private_key"); diff --git a/modules/server_add/controllers/admin_server_add.php b/modules/server_add/controllers/admin_server_add.php index 7ffba361..2e743c81 100644 --- a/modules/server_add/controllers/admin_server_add.php +++ b/modules/server_add/controllers/admin_server_add.php @@ -20,6 +20,7 @@ class Admin_Server_Add_Controller extends Admin_Controller { public function index() { $view = new Admin_View("admin.html"); + $view->page_title = t("Add from server"); $view->content = new View("admin_server_add.html"); $view->content->form = $this->_get_admin_form(); $paths = unserialize(module::get_var("server_add", "authorized_paths", "a:0:{}")); diff --git a/modules/tag/controllers/admin_tags.php b/modules/tag/controllers/admin_tags.php index 03a14814..9e875d14 100644 --- a/modules/tag/controllers/admin_tags.php +++ b/modules/tag/controllers/admin_tags.php @@ -22,6 +22,7 @@ class Admin_Tags_Controller extends Admin_Controller { $filter = Input::instance()->get("filter"); $view = new Admin_View("admin.html"); + $view->page_title = t("Manage tags"); $view->content = new View("admin_tags.html"); $view->content->filter = $filter; diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php index 3e36fd67..e14be393 100644 --- a/modules/user/controllers/admin_users.php +++ b/modules/user/controllers/admin_users.php @@ -20,6 +20,7 @@ class Admin_Users_Controller extends Admin_Controller { public function index() { $view = new Admin_View("admin.html"); + $view->page_title = t("Users and groups"); $view->content = new View("admin_users.html"); $view->content->users = ORM::factory("user")->order_by("name", "ASC")->find_all(); $view->content->groups = ORM::factory("group")->order_by("name", "ASC")->find_all(); diff --git a/modules/watermark/controllers/admin_watermarks.php b/modules/watermark/controllers/admin_watermarks.php index aa5be8db..d26919d5 100644 --- a/modules/watermark/controllers/admin_watermarks.php +++ b/modules/watermark/controllers/admin_watermarks.php @@ -22,6 +22,7 @@ class Admin_Watermarks_Controller extends Admin_Controller { $name = module::get_var("watermark", "name"); $view = new Admin_View("admin.html"); + $view->page_title = t("Watermarks"); $view->content = new View("admin_watermarks.html"); if ($name) { $view->content->name = module::get_var("watermark", "name"); -- cgit v1.2.3