]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/UserFlag/flagnoticeaction.php
Stub actions for UserFlag plugin
[quix0rs-gnu-social.git] / plugins / UserFlag / flagnoticeaction.php
1 <?php
2 /**
3  * Add a flag to a notice
4  *
5  * PHP version 5
6  *
7  * @category Action
8  * @package  StatusNet
9  * @author   Evan Prodromou <evan@status.net>
10  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
11  * @link     http://status.net/
12  *
13  * StatusNet - the distributed open-source microblogging tool
14  * Copyright (C) 2009, StatusNet, Inc.
15  *
16  * This program is free software: you can redistribute it and/or modify
17  * it under the terms of the GNU Affero General Public License as published by
18  * the Free Software Foundation, either version 3 of the License, or
19  * (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU Affero General Public License for more details.
25  *
26  * You should have received a copy of the GNU Affero General Public License
27  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
28  */
29
30 if (!defined('STATUSNET')) {
31     exit(1);
32 }
33
34 /**
35  * Action to flag a notice.
36  *
37  * @category Action
38  * @package  StatusNet
39  * @author   Evan Prodromou <evan@status.net>
40  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
41  * @link     http://status.net/
42  */
43
44 class FlagnoticeAction extends Action
45 {
46     var $notice = null;
47
48     /**
49      * Take arguments for running
50      *
51      * @param array $args $_REQUEST args
52      *
53      * @return boolean success flag
54      */
55
56     function prepare($args)
57     {
58         if ($_SERVER['REQUEST_METHOD'] != 'POST') {
59             throw new ClientException(_('Action only accepts POST'));
60         }
61
62         return true;
63     }
64
65     /**
66      * Handle request
67      *
68      * Shows a page with list of favorite notices
69      *
70      * @param array $args $_REQUEST args; handled in prepare()
71      *
72      * @return void
73      */
74
75     function handle($args)
76     {
77         parent::handle($args);
78
79         $this->flagNotice();
80         $this->returnTo();
81     }
82
83     function title() {
84         return _('Flag notice');
85     }
86
87     /**
88      * save the notice flag
89      *
90      * @return void
91      */
92
93     function flagNotice()
94     {
95     }
96 }
97