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 function __construct($application, Profile $owner, Action $out=null)
51 parent::__construct($out);
53 $this->application = $application;
54 $this->owner = $owner;
59 $this->out->elementStart('ul', 'applications');
63 while ($this->application->fetch()) {
65 if($cnt > APPS_PER_PAGE) {
68 $this->showApplication();
71 $this->out->elementEnd('ul');
76 function showApplication()
78 $this->out->elementStart('li', array('class' => 'application h-entry',
79 'id' => 'oauthclient-' . $this->application->id));
81 $this->out->elementStart('a', array('href' => common_local_url('showapplication',
82 array('id' => $this->application->id)),
83 'class' => 'h-card'));
85 if (!empty($this->application->icon)) {
86 $this->out->element('img', array('src' => $this->application->icon,
87 'class' => 'avatar u-photo'));
90 $this->out->text($this->application->name);
91 $this->out->elementEnd('a');
93 $this->out->raw(' by ');
95 $this->out->element('a', array('href' => $this->application->homepage,
97 $this->application->organization);
99 $this->out->element('p', 'note', $this->application->description);
100 $this->out->elementEnd('li');
104 /* Override this in subclasses. */
105 function showOwnerControls()