]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - lib/infoaction.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / lib / infoaction.php
1 <?php
2
3 /**
4  * Information action
5  *
6  * PHP version 5
7  *
8  * @category Action
9  * @package  StatusNet
10  * @author   Zach Copley <zach@status.net>
11  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
12  * @link     http://status.net/
13  *
14  * StatusNet - the distributed open-source microblogging tool
15  * Copyright (C) 2010, StatusNet, Inc.
16  *
17  * This program is free software: you can redistribute it and/or modify
18  * it under the terms of the GNU Affero General Public License as published by
19  * the Free Software Foundation, either version 3 of the License, or
20  * (at your option) any later version.
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25  * GNU Affero General Public License for more details.
26  *
27  * You should have received a copy of the GNU Affero General Public License
28  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
29  */
30
31 if (!defined('STATUSNET') && !defined('LACONICA')) {
32     exit(1);
33 }
34
35 /**
36  * Base class for displaying dialog box like messages to the user
37  *
38  * @category Action
39  * @package  StatusNet
40  * @author   Zach Copley <zach@status.net>
41  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
42  * @link     http://status.net/
43  *
44  * @see ErrorAction
45  */
46
47 class InfoAction extends Action
48 {
49     var $message = null;
50
51     function __construct($title, $message, $output='php://output', $indent=null)
52     {
53         parent::__construct($output, $indent);
54
55         $this->message = $message;
56         $this->title   = $title;
57
58         // XXX: hack alert: usually we aren't going to
59         // call this page directly, but because it's
60         // an action it needs an args array anyway
61         $this->prepare($_REQUEST);
62     }
63     
64     /**
65      * Page title.
66      *
67      * @return page title
68      */
69
70     function title()
71     {
72         return empty($this->title) ? '' : $this->title;
73     }
74
75     function isReadOnly(array $args=array())
76     {
77         return true;
78     }
79
80     // Overload a bunch of stuff so the page isn't too bloated
81
82     function showBody()
83     {
84         $this->elementStart('body', array('id' => 'error'));
85         $this->elementStart('div', array('id' => 'wrap'));
86         $this->showHeader();
87         $this->showCore();
88         $this->showFooter();
89         $this->elementEnd('div');
90         $this->elementEnd('body');
91     }
92
93     function showCore()
94     {
95         $this->elementStart('div', array('id' => 'core'));
96         $this->elementStart('div', array('id' => 'aside_primary_wrapper'));
97         $this->elementStart('div', array('id' => 'content_wrapper'));
98         $this->elementStart('div', array('id' => 'site_nav_local_views_wrapper'));
99         $this->showContentBlock();
100         $this->elementEnd('div');
101         $this->elementEnd('div');
102         $this->elementEnd('div');
103         $this->elementEnd('div');
104     }
105
106     function showHeader()
107     {
108         $this->elementStart('div', array('id' => 'header'));
109         $this->showLogo();
110         $this->showPrimaryNav();
111         $this->elementEnd('div');
112     }
113
114     /**
115      * Display content.
116      *
117      * @return nothing
118      */
119     function showContent()
120     {
121         $this->element('div', array('class' => 'info'), $this->message);
122     }
123
124 }