return true;
}
- function updateScopedProfile() {
+ public function updateScopedProfile()
+ {
$this->scoped = Profile::current();
return $this->scoped;
}
+ public function getScoped()
+ {
+ return ($this->scoped instanceof Profile) ? $this->scoped : null;
+ }
+
// Must be run _after_ prepare
public function getActionName()
{
return $this->action;
}
+ public function isAction(array $names)
+ {
+ foreach ($names as $class) {
+ // PHP is case insensitive, and we have stuff like ApiUpperCaseAction,
+ // but we at least make a point out of wanting to do stuff case-sensitive.
+ $class = ucfirst($class) . 'Action';
+ if ($this instanceof $class) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* Show page, a template method.
*
*/
function showPage()
{
+ if (StatusNet::isAjax()) {
+ self::showAjax();
+ return;
+ }
if (Event::handle('StartShowHTML', array($this))) {
$this->startHTML();
$this->flush();
}
}
+ public function showAjax()
+ {
+ $this->startHTML('text/xml;charset=utf-8');
+ $this->elementStart('head');
+ // TRANS: Title for conversation page.
+ $this->element('title', null, $this->title());
+ $this->elementEnd('head');
+ $this->elementStart('body');
+ if ($this->getError()) {
+ $this->element('p', array('id'=>'error'), $this->getError());
+ } else {
+ $this->showContent();
+ }
+ $this->elementEnd('body');
+ $this->endHTML();
+ }
+
function endHTML()
{
global $_startTime;
$this->cssLink('js/extlib/jquery-ui/css/smoothness/jquery-ui.css');
if (Event::handle('StartShowUAStyles', array($this))) {
- $this->comment('[if IE]><link rel="stylesheet" type="text/css" '.
- 'href="'.Theme::path('css/ie.css', 'base').'?version='.GNUSOCIAL_VERSION.'" /><![endif]');
- foreach (array(6,7) as $ver) {
- if (file_exists(Theme::file('css/ie'.$ver.'.css', 'base'))) {
- // Yes, IE people should be put in jail.
- $this->comment('[if lte IE '.$ver.']><link rel="stylesheet" type="text/css" '.
- 'href="'.Theme::path('css/ie'.$ver.'.css', 'base').'?version='.GNUSOCIAL_VERSION.'" /><![endif]');
- }
- }
- if (file_exists(Theme::file('css/ie.css'))) {
- $this->comment('[if IE]><link rel="stylesheet" type="text/css" '.
- 'href="'.Theme::path('css/ie.css', null).'?version='.GNUSOCIAL_VERSION.'" /><![endif]');
- }
Event::handle('EndShowUAStyles', array($this));
}
*/
function showLogo()
{
- $this->elementStart('address', array('id' => 'site_contact',
- 'class' => 'vcard'));
+ $this->elementStart('address', array('id' => 'site_contact', 'class' => 'h-card'));
if (Event::handle('StartAddressData', array($this))) {
if (common_config('singleuser', 'enabled')) {
$user = User::singleUser();
$url = common_local_url('public');
}
- $this->elementStart('a', array('class' => 'url home bookmark',
+ $this->elementStart('a', array('class' => 'home bookmark',
'href' => $url));
if (StatusNet::isHTTPS()) {
}
if (!empty($logoUrl)) {
- $this->element('img', array('class' => 'logo photo',
+ $this->element('img', array('class' => 'logo u-photo p-name',
'src' => $logoUrl,
'alt' => common_config('site', 'name')));
}
- $this->text(' ');
- $this->element('span', array('class' => 'fn org'), common_config('site', 'name'));
$this->elementEnd('a');
Event::handle('EndAddressData', array($this));
$this->elementStart('div', 'input_forms');
+ $this->element('label', array('for'=>'input_form_nav'), _m('TAB', 'Share your:'));
+
if (Event::handle('StartShowEntryForms', array(&$tabs))) {
$this->elementStart('ul', array('class' => 'nav',
'id' => 'input_form_nav'));
'class' => 'input_form_nav_tab');
if ($tag == 'status') {
- // We're actually showing the placeholder form,
- // but we special-case the 'Status' tab as if
- // it were a small version of it.
$attrs['class'] .= ' current';
}
$this->elementStart('li', $attrs);
$this->elementEnd('ul');
- $attrs = array('class' => 'input_form current',
- 'id' => 'input_form_placeholder');
- $this->elementStart('div', $attrs);
- $form = new NoticePlaceholderForm($this);
- $form->show();
- $this->elementEnd('div');
-
foreach ($tabs as $tag => $data) {
$attrs = array('class' => 'input_form',
'id' => 'input_form_'.$tag);
+ if ($tag == 'status') {
+ $attrs['class'] .= ' current';
+ }
$this->elementStart('div', $attrs);
// TRANS: license message in footer.
// TRANS: %1$s is the site name, %2$s is a link to the license URL, with a licence name set in configuration.
$notice = _('All %1$s content and data are available under the %2$s license.');
- $link = "<a class=\"license\" rel=\"external license\" href=\"" .
- htmlspecialchars(common_config('license', 'url')) .
- "\">" .
- htmlspecialchars(common_config('license', 'title')) .
- "</a>";
- $this->raw(sprintf(htmlspecialchars($notice),
+ $link = sprintf('<a class="license" rel="external license" href="%1$s">%2$s</a>',
+ htmlspecialchars(common_config('license', 'url')),
+ htmlspecialchars(common_config('license', 'title')));
+ $this->raw(@sprintf(htmlspecialchars($notice),
htmlspecialchars(common_config('site', 'name')),
$link));
$this->elementEnd('p');
*
* @return boolean is read only action?
*/
- function isReadOnly($args)
+ function isReadOnly(array $args=array())
{
return false;
}