Use proper controller naming

This commit is contained in:
kondou 2013-09-04 22:22:56 +02:00
parent b643c02bd5
commit 8fd76e39cf
2 changed files with 10 additions and 8 deletions

View file

@ -6,7 +6,9 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
class OC_Core_Avatar_Controller { namespace OC\Core\Avatar;
class Controller {
public static function getAvatar($args) { public static function getAvatar($args) {
if (!\OC_User::isLoggedIn()) { if (!\OC_User::isLoggedIn()) {
$l = new \OC_L10n('core'); $l = new \OC_L10n('core');
@ -91,7 +93,7 @@ class OC_Core_Avatar_Controller {
} }
public static function deleteAvatar($args) { public static function deleteAvatar($args) {
$user = OC_User::getUser(); $user = \OC_User::getUser();
try { try {
$avatar = new \OC_Avatar(); $avatar = new \OC_Avatar();
@ -118,7 +120,7 @@ class OC_Core_Avatar_Controller {
} }
public static function postCroppedAvatar($args) { public static function postCroppedAvatar($args) {
$user = OC_User::getUser(); $user = \OC_User::getUser();
if (isset($_POST['crop'])) { if (isset($_POST['crop'])) {
$crop = $_POST['crop']; $crop = $_POST['crop'];
} else { } else {

View file

@ -61,19 +61,19 @@ $this->create('core_lostpassword_reset_password', '/lostpassword/reset/{token}/{
// Avatar routes // Avatar routes
$this->create('core_avatar_get_tmp', '/avatar/tmp') $this->create('core_avatar_get_tmp', '/avatar/tmp')
->get() ->get()
->action('OC_Core_Avatar_Controller', 'getTmpAvatar'); ->action('OC\Core\Avatar\Controller', 'getTmpAvatar');
$this->create('core_avatar_get', '/avatar/{user}/{size}') $this->create('core_avatar_get', '/avatar/{user}/{size}')
->get() ->get()
->action('OC_Core_Avatar_Controller', 'getAvatar'); ->action('OC\Core\Avatar\Controller', 'getAvatar');
$this->create('core_avatar_post', '/avatar/') $this->create('core_avatar_post', '/avatar/')
->post() ->post()
->action('OC_Core_Avatar_Controller', 'postAvatar'); ->action('OC\Core\Avatar\Controller', 'postAvatar');
$this->create('core_avatar_delete', '/avatar/') $this->create('core_avatar_delete', '/avatar/')
->delete() ->delete()
->action('OC_Core_Avatar_Controller', 'deleteAvatar'); ->action('OC\Core\Avatar\Controller', 'deleteAvatar');
$this->create('core_avatar_post_cropped', '/avatar/cropped') $this->create('core_avatar_post_cropped', '/avatar/cropped')
->post() ->post()
->action('OC_Core_Avatar_Controller', 'postCroppedAvatar'); ->action('OC\Core\Avatar\Controller', 'postCroppedAvatar');
// Not specifically routed // Not specifically routed
$this->create('app_css', '/apps/{app}/{file}') $this->create('app_css', '/apps/{app}/{file}')