X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fdisfavorform.php;h=9d0e39784ea162e4b38e3c2d747ace801b4991af;hb=4fa286801e3ecbe07568a03c7b625f6749b771e8;hp=ffca0cd8bf24638e7380eeac725ad00869694582;hpb=7233e89be621c2b9ad80b8a7eb2bc16185596cca;p=quix0rs-gnu-social.git diff --git a/lib/disfavorform.php b/lib/disfavorform.php index ffca0cd8bf..9d0e39784e 100644 --- a/lib/disfavorform.php +++ b/lib/disfavorform.php @@ -1,6 +1,6 @@ . * * @category Form - * @package Laconica - * @author Evan Prodromou - * @author Sarven Capadisli - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @author Sarven Capadisli + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,21 +38,19 @@ require_once INSTALLDIR.'/lib/form.php'; * Form for disfavoring a notice * * @category Form - * @package Laconica - * @author Evan Prodromou - * @author Sarven Capadisli + * @package StatusNet + * @author Evan Prodromou + * @author Sarven Capadisli * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @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,10 +81,9 @@ class DisfavorForm extends Form * * @return string URL of the action */ - function action() { - common_local_url('disfavor'); + return common_local_url('disfavor'); } /** @@ -96,13 +91,23 @@ class DisfavorForm extends Form * * @return void */ - function sessionToken() { $this->out->hidden('token-' . $this->notice->id, common_session_token()); } + /** + * Legend of the Form + * + * @return void + */ + function formLegend() + { + // TRANS: Form legend for removing the favourite status for a favourite notice. + $this->out->element('legend', null, _('Disfavor this notice')); + } + /** * Data elements * @@ -111,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)); + } } /** @@ -121,22 +129,24 @@ class DisfavorForm extends Form * * @return void */ - function formActions() { $this->out->submit('disfavor-submit-' . $this->notice->id, - _('Disfavor favorite')); + // TRANS: Button text for removing the favourite status for a favourite notice. + _m('BUTTON','Disfavor favorite'), + 'submit', + null, + // TRANS: Title for button text for removing the favourite status for a favourite notice. + _('Disfavor this notice')); } - + /** * Class of the form. * * @return string the form's class */ - function formClass() { - return 'disfavor'; + return 'form_disfavor ajax'; } - -} \ No newline at end of file +}