3 * StatusNet, the distributed open-source microblogging tool
5 * Widget to show a list of OAuth applications
9 * LICENCE: This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Affero General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Affero General Public License for more details.
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 * @category Application
24 * @author Zach Copley <zach@status.net>
25 * @copyright 2008-2010 StatusNet, Inc.
26 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
27 * @link http://status.net/
30 if (!defined('GNUSOCIAL')) { exit(1); }
33 * Widget to show a list of OAuth applications
35 * @category Application
37 * @author Zach Copley <zach@status.net>
38 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
39 * @link http://status.net/
41 class ApplicationList extends Widget
43 /** Current application, application query */
44 var $application = null;
46 /** Owner of this list */
49 /** Action object using us. */
52 function __construct($application, $owner=null, $action=null)
54 parent::__construct($action);
56 $this->application = $application;
57 $this->owner = $owner;
58 $this->action = $action;
63 $this->out->elementStart('ul', 'applications');
67 while ($this->application->fetch()) {
69 if($cnt > APPS_PER_PAGE) {
72 $this->showapplication();
75 $this->out->elementEnd('ul');
80 function showApplication()
82 $user = common_current_user();
84 $this->out->elementStart('li', array('class' => 'application h-entry',
85 'id' => 'oauthclient-' . $this->application->id));
87 $this->out->elementStart('a', array('href' => common_local_url('showapplication',
88 array('id' => $this->application->id)),
89 'class' => 'h-card'));
91 if (!empty($this->application->icon)) {
92 $this->out->element('img', array('src' => $this->application->icon,
93 'class' => 'avatar u-photo'));
96 $this->out->text($this->application->name);
97 $this->out->elementEnd('a');
99 $this->out->raw(' by ');
101 $this->out->element('a', array('href' => $this->application->homepage,
103 $this->application->organization);
105 $this->out->element('p', 'note', $this->application->description);
106 $this->out->elementEnd('li');
110 /* Override this in subclasses. */
111 function showOwnerControls()