]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/disfavor.php
Make the OpenID settings work with new framework
[quix0rs-gnu-social.git] / actions / disfavor.php
index f0b528453188634a6ab166fa739682fad086c5b3..fc36f7c75fab62e547233725a471363aad5e7849 100644 (file)
@@ -19,7 +19,8 @@
 
 if (!defined('LACONICA')) { exit(1); }
 
-class DisfavorAction extends Action {
+class DisfavorAction extends Action
+{
 
     function handle($args)
     {
@@ -27,7 +28,7 @@ class DisfavorAction extends Action {
         parent::handle($args);
 
         if (!common_logged_in()) {
-            common_user_error(_('Not logged in.'));
+            $this->clientError(_('Not logged in.'));
             return;
         }
 
@@ -45,7 +46,7 @@ class DisfavorAction extends Action {
         $token = $this->trimmed('token-'.$notice->id);
 
         if (!$token || $token != common_session_token()) {
-            $this->client_error(_("There was a problem with your session token. Try again, please."));
+            $this->clientError(_("There was a problem with your session token. Try again, please."));
             return;
         }
 
@@ -53,7 +54,7 @@ class DisfavorAction extends Action {
         $fave->user_id = $this->id;
         $fave->notice_id = $notice->id;
         if (!$fave->find(true)) {
-            $this->client_error(_('This notice is not a favorite!'));
+            $this->clientError(_('This notice is not a favorite!'));
             return;
         }
 
@@ -61,7 +62,7 @@ class DisfavorAction extends Action {
 
         if (!$result) {
             common_log_db_error($fave, 'DELETE', __FILE__);
-            $this->server_error(_('Could not delete favorite.'));
+            $this->serverError(_('Could not delete favorite.'));
             return;
         }
         
@@ -69,13 +70,13 @@ class DisfavorAction extends Action {
 
         if ($this->boolean('ajax')) {
             common_start_html('text/xml;charset=utf-8', true);
-            common_element_start('head');
-            common_element('title', null, _('Add to favorites'));
-            common_element_end('head');
-            common_element_start('body');
+            $this->elementStart('head');
+            $this->element('title', null, _('Add to favorites'));
+            $this->elementEnd('head');
+            $this->elementStart('body');
             common_favor_form($notice);
-            common_element_end('body');
-            common_element_end('html');
+            $this->elementEnd('body');
+            $this->elementEnd('html');
         } else {
             common_redirect(common_local_url('showfavorites',
                                              array('nickname' => $user->nickname)));