From 989c24dc996f9cd29cf660662476fc26c77ba835 Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Thu, 12 Feb 2009 02:51:44 +0000 Subject: Move l10n enable/disable option to Options menu. Only available to admins at this point. --- core/controllers/l10n_client.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/controllers') diff --git a/core/controllers/l10n_client.php b/core/controllers/l10n_client.php index 41e05c98..3e95248a 100644 --- a/core/controllers/l10n_client.php +++ b/core/controllers/l10n_client.php @@ -20,6 +20,7 @@ class L10n_Client_Controller extends Controller { public function save($string) { access::verify_csrf(); + user::active()->admin or access::forbidden(); $input = Input::instance(); $message = $input->post("l10n-message-source"); @@ -55,6 +56,16 @@ class L10n_Client_Controller extends Controller { print json_encode(new stdClass()); } + public function toggle_l10n_mode() { + access::verify_csrf(); + + $session = Session::instance(); + $session->set("l10n_mode", + !$session->get("l10n_mode", false)); + + url::redirect(url::site("albums/1")); + } + private static function _l10n_client_form() { $form = new Forge("l10n_client/save", "", "post", array("id" => "gL10nClientSaveForm")); $group = $form->group("l10n_message"); -- cgit v1.2.3