Просмотр исходного кода

Move usersAction into usersController

Marien Fressinaud 11 лет назад
Родитель
Сommit
64d1026dd9

+ 5 - 14
app/Controllers/configureController.php

@@ -168,11 +168,11 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
 	 */
 	public function shortcutAction() {
 		$list_keys = array('a', 'b', 'backspace', 'c', 'd', 'delete', 'down', 'e', 'end', 'enter',
-		                    'escape', 'f', 'g', 'h', 'home', 'i', 'insert', 'j', 'k', 'l', 'left',
-		                    'm', 'n', 'o', 'p', 'page_down', 'page_up', 'q', 'r', 'return', 'right',
-		                    's', 'space', 't', 'tab', 'u', 'up', 'v', 'w', 'x', 'y',
-		                    'z', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9',
-		                    'f10', 'f11', 'f12');
+		                   'escape', 'f', 'g', 'h', 'home', 'i', 'insert', 'j', 'k', 'l', 'left',
+		                   'm', 'n', 'o', 'p', 'page_down', 'page_up', 'q', 'r', 'return', 'right',
+		                   's', 'space', 't', 'tab', 'u', 'up', 'v', 'w', 'x', 'y',
+		                   'z', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9',
+		                   'f10', 'f11', 'f12');
 		$this->view->list_keys = $list_keys;
 
 		if (Minz_Request::isPost()) {
@@ -196,15 +196,6 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
 		Minz_View::prependTitle(_t('shortcuts') . ' · ');
 	}
 
-	/**
-	 * This action display the user configuration page
-	 *
-	 * @todo move that action in the user controller
-	 */
-	public function usersAction() {
-		Minz_View::prependTitle(_t('users') . ' · ');
-	}
-
 	/**
 	 * This action handles the archive configuration page.
 	 *

+ 10 - 3
app/Controllers/usersController.php

@@ -13,6 +13,13 @@ class FreshRSS_users_Controller extends Minz_ActionController {
 		}
 	}
 
+	/**
+	 * This action display the user configuration page
+	 */
+	public function indexAction() {
+		Minz_View::prependTitle(_t('users') . ' · ');
+	}
+
 	public function authAction() {
 		if (Minz_Request::isPost()) {
 			$ok = true;
@@ -94,7 +101,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
 			);
 			Minz_Session::_param('notification', $notif);
 		}
-		Minz_Request::forward(array('c' => 'configure', 'a' => 'users'), true);
+		Minz_Request::forward(array('c' => 'users', 'a' => 'index'), true);
 	}
 
 	public function createAction() {
@@ -166,7 +173,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
 			);
 			Minz_Session::_param('notification', $notif);
 		}
-		Minz_Request::forward(array('c' => 'configure', 'a' => 'users'), true);
+		Minz_Request::forward(array('c' => 'users', 'a' => 'index'), true);
 	}
 
 	public function deleteAction() {
@@ -198,6 +205,6 @@ class FreshRSS_users_Controller extends Minz_ActionController {
 			);
 			Minz_Session::_param('notification', $notif);
 		}
-		Minz_Request::forward(array('c' => 'configure', 'a' => 'users'), true);
+		Minz_Request::forward(array('c' => 'users', 'a' => 'index'), true);
 	}
 }

+ 2 - 2
app/layout/aside_configure.phtml

@@ -19,8 +19,8 @@
 		<a href="<?php echo _url('configure', 'queries'); ?>"><?php echo _t('queries'); ?></a>
 	</li>
 	<li class="separator"></li>
-	<li class="item<?php echo Minz_Request::actionName() === 'users' ? ' active' : ''; ?>">
-		<a href="<?php echo _url('configure', 'users'); ?>"><?php echo _t('users'); ?></a>
+	<li class="item<?php echo Minz_Request::controllerName() === 'users' ? ' active' : ''; ?>">
+		<a href="<?php echo _url('users', 'index'); ?>"><?php echo _t('users'); ?></a>
 	</li>
 	<?php
 		$current_user = Minz_Session::param('currentUser', '');

+ 1 - 1
app/layout/header.phtml

@@ -74,7 +74,7 @@ if (Minz_Configuration::canLogIn()) {
 				<li class="item"><a href="<?php echo _url('configure', 'shortcut'); ?>"><?php echo _t('shortcuts'); ?></a></li>
 				<li class="item"><a href="<?php echo _url('configure', 'queries'); ?>"><?php echo _t('queries'); ?></a></li>
 				<li class="separator"></li>
-				<li class="item"><a href="<?php echo _url('configure', 'users'); ?>"><?php echo _t('users'); ?></a></li>
+				<li class="item"><a href="<?php echo _url('users', 'index'); ?>"><?php echo _t('users'); ?></a></li>
 				<?php
 					$current_user = Minz_Session::param('currentUser', '');
 					if (Minz_Configuration::isAdmin($current_user)) {

+ 0 - 0
app/views/configure/users.phtml → app/views/users/index.phtml