]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/disfavorform.php
Message tweaks and elaborations as well as translator documentation tweaks. Based...
[quix0rs-gnu-social.git] / lib / disfavorform.php
index f3a022fece680abaa916c79207a85406e44ab956..9754dfc83b8894da4bfc3a0924eac947a41de828 100644 (file)
@@ -28,7 +28,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
@@ -46,13 +46,11 @@ require_once INSTALLDIR.'/lib/form.php';
  *
  * @see      FavorForm
  */
-
 class DisfavorForm extends Form
 {
     /**
      * Notice to disfavor
      */
-
     var $notice = null;
 
     /**
@@ -61,7 +59,6 @@ class DisfavorForm extends Form
      * @param HTMLOutputter $out    output channel
      * @param Notice        $notice notice to disfavor
      */
-
     function __construct($out=null, $notice=null)
     {
         parent::__construct($out);
@@ -74,7 +71,6 @@ class DisfavorForm extends Form
      *
      * @return int ID of the form
      */
-
     function id()
     {
         return 'disfavor-' . $this->notice->id;
@@ -85,7 +81,6 @@ class DisfavorForm extends Form
      *
      * @return string URL of the action
      */
-
     function action()
     {
         return common_local_url('disfavor');
@@ -96,14 +91,12 @@ class DisfavorForm extends Form
      *
      * @return void
      */
-
     function sessionToken()
     {
         $this->out->hidden('token-' . $this->notice->id,
                            common_session_token());
     }
 
-
     /**
      * Legend of the Form
      *
@@ -111,10 +104,10 @@ class DisfavorForm extends Form
      */
     function formLegend()
     {
+        // TRANS: Form legend for removing the favourite status for a favourite notice.
         $this->out->element('legend', null, _('Disfavor this notice'));
     }
 
-
     /**
      * Data elements
      *
@@ -123,9 +116,12 @@ class DisfavorForm extends Form
 
     function formData()
     {
-        $this->out->hidden('notice-n'.$this->notice->id,
-                           $this->notice->id,
-                           'notice');
+        if (Event::handle('StartDisFavorNoticeForm', array($this, $this->notice))) {
+            $this->out->hidden('notice-n'.$this->notice->id,
+                               $this->notice->id,
+                               'notice');
+            Event::handle('EndDisFavorNoticeForm', array($this, $this->notice));
+        }
     }
 
     /**
@@ -133,22 +129,24 @@ class DisfavorForm extends Form
      *
      * @return void
      */
-
     function formActions()
     {
         $this->out->submit('disfavor-submit-' . $this->notice->id,
-                           _('Disfavor favorite'), 'submit', null, _('Disfavor this notice'));
+                           // TRANS: Button text for removing the favourite status for a favourite notice.
+                           _m('BUTTON','Disfavor favorite'),
+                           'submit',
+                           null,
+                           // TRANS: Button title for removing the favourite status for a favourite notice.
+                           _('Remove this notice from your list of favorite notices.'));
     }
-    
+
     /**
      * Class of the form.
      *
      * @return string the form's class
      */
-
     function formClass()
     {
-        return 'form_disfavor';
+        return 'form_disfavor ajax';
     }
-
 }