2011-02-03 09:23:24 +09:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* StatusNet - the distributed open-source microblogging tool
|
|
|
|
* Copyright (C) 2011, StatusNet, Inc.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2019-08-09 23:22:55 +09:00
|
|
|
if (!defined('GNUSOCIAL')) {
|
|
|
|
exit(1);
|
|
|
|
}
|
2011-02-03 09:23:24 +09:00
|
|
|
|
2011-03-11 10:13:34 +09:00
|
|
|
class ProfileDetailAction extends ShowstreamAction
|
2011-02-03 09:23:24 +09:00
|
|
|
{
|
2019-08-09 23:22:55 +09:00
|
|
|
public function isReadOnly($args)
|
2011-02-03 09:23:24 +09:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-08-09 23:22:55 +09:00
|
|
|
public function title()
|
2011-02-03 09:23:24 +09:00
|
|
|
{
|
2015-07-10 19:34:06 +09:00
|
|
|
return $this->target->getFancyName();
|
2011-02-03 09:23:24 +09:00
|
|
|
}
|
|
|
|
|
2019-08-09 23:22:55 +09:00
|
|
|
public function showStylesheets()
|
|
|
|
{
|
2011-02-03 09:23:24 +09:00
|
|
|
parent::showStylesheets();
|
2011-03-15 11:40:31 +09:00
|
|
|
$this->cssLink('plugins/ExtendedProfile/css/profiledetail.css');
|
2011-02-03 09:23:24 +09:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-08-09 23:22:55 +09:00
|
|
|
public function showContent()
|
2011-02-03 09:23:24 +09:00
|
|
|
{
|
|
|
|
$cur = common_current_user();
|
2015-07-10 19:34:06 +09:00
|
|
|
if ($this->scoped instanceof Profile && $this->scoped->sameAs($this->target)) {
|
2011-02-03 09:23:24 +09:00
|
|
|
$this->elementStart('div', 'entity_actions');
|
2011-03-15 11:40:31 +09:00
|
|
|
$this->elementStart('ul');
|
2011-02-03 09:23:24 +09:00
|
|
|
$this->elementStart('li', 'entity_edit');
|
2019-08-09 23:22:55 +09:00
|
|
|
$this->element(
|
|
|
|
'a',
|
|
|
|
array('href' => common_local_url('profiledetailsettings'),
|
|
|
|
// TRANS: Link title for link on user profile.
|
|
|
|
'title' => _m('Edit extended profile settings')),
|
|
|
|
// TRANS: Link text for link on user profile.
|
|
|
|
_m('Edit')
|
|
|
|
);
|
2011-02-03 09:23:24 +09:00
|
|
|
$this->elementEnd('li');
|
2011-03-15 11:40:31 +09:00
|
|
|
$this->elementEnd('ul');
|
2011-02-03 09:23:24 +09:00
|
|
|
$this->elementEnd('div');
|
|
|
|
}
|
|
|
|
|
2015-07-10 19:34:06 +09:00
|
|
|
$widget = new ExtendedProfileWidget($this, $this->target);
|
2011-02-03 09:23:24 +09:00
|
|
|
$widget->show();
|
|
|
|
}
|
|
|
|
}
|