4 * StatusNet, the distributed open-source microblogging tool
6 * Widget to show a list of OAuth applications
10 * LICENCE: This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Affero General Public License for more details.
20 * You should have received a copy of the GNU Affero General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 * @author Zach Copley <zach@status.net>
26 * @copyright 2008-2009 StatusNet, Inc.
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
28 * @link http://status.net/
31 if (!defined('STATUSNET') && !defined('LACONICA')) {
35 require_once INSTALLDIR . '/lib/widget.php';
37 define('APPS_PER_PAGE', 20);
40 * Widget to show a list of OAuth applications
44 * @author Zach Copley <zach@status.net>
45 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
46 * @link http://status.net/
49 class ApplicationList extends Widget
51 /** Current application, application query */
52 var $application = null;
54 /** Owner of this list */
57 /** Action object using us. */
60 function __construct($application, $owner=null, $action=null)
62 parent::__construct($action);
64 $this->application = $application;
65 $this->owner = $owner;
66 $this->action = $action;
71 $this->out->elementStart('ul', 'applications xoxo');
75 while ($this->application->fetch()) {
77 if($cnt > APPS_PER_PAGE) {
80 $this->showapplication();
83 $this->out->elementEnd('ul');
88 function showApplication()
90 $this->out->elementStart('li', array('class' => 'application',
91 'id' => 'oauthclient-' . $this->application->id));
93 $user = common_current_user();
95 $this->out->raw($this->application->name);
97 $this->out->elementEnd('li');
100 /* Override this in subclasses. */
102 function showOwnerControls()
107 function highlight($text)
109 return htmlspecialchars($text);