function prepare($argarray)
{
$this->args =& common_copy_args($argarray);
+
+ if ($this->boolean('ajax')) {
+ StatusNet::setAjax(true);
+ }
+
return true;
}
{
if (Event::handle('StartShowHTML', array($this))) {
$this->startHTML();
+ $this->flush();
Event::handle('EndShowHTML', array($this));
}
if (Event::handle('StartShowHead', array($this))) {
$this->showHead();
+ $this->flush();
Event::handle('EndShowHead', array($this));
}
if (Event::handle('StartShowBody', array($this))) {
{
$this->element('title', null,
// TRANS: Page title. %1$s is the title, %2$s is the site name.
- sprintf(_("%1\$s - %2\$s"),
+ sprintf(_('%1$s - %2$s'),
$this->title(),
common_config('site', 'name')));
}
function title()
{
// TRANS: Page title for a page without a title set.
- return _("Untitled page");
+ return _('Untitled page');
}
/**
Event::handle('EndShowLaconicaStyles', array($this));
}
+ $this->cssLink(common_path('js/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='.STATUSNET_VERSION.'" /><![endif]');
{
if (Event::handle('StartShowScripts', array($this))) {
if (Event::handle('StartShowJQueryScripts', array($this))) {
- $this->script('jquery.min.js');
- $this->script('jquery.form.min.js');
- $this->script('jquery.cookie.min.js');
- $this->inlineScript('if (typeof window.JSON !== "object") { $.getScript("'.common_path('js/json2.min.js').'"); }');
- $this->script('jquery.joverlay.min.js');
+ if (common_config('site', 'minify')) {
+ $this->script('jquery.min.js');
+ $this->script('jquery.form.min.js');
+ $this->script('jquery-ui.min.js');
+ $this->script('jquery.cookie.min.js');
+ $this->inlineScript('if (typeof window.JSON !== "object") { $.getScript("'.common_path('js/json2.min.js').'"); }');
+ $this->script('jquery.joverlay.min.js');
+ $this->script('jquery.infieldlabel.min.js');
+ } else {
+ $this->script('jquery.js');
+ $this->script('jquery.form.js');
+ $this->script('jquery-ui.min.js');
+ $this->script('jquery.cookie.js');
+ $this->inlineScript('if (typeof window.JSON !== "object") { $.getScript("'.common_path('js/json2.js').'"); }');
+ $this->script('jquery.joverlay.js');
+ $this->script('jquery.infieldlabel.js');
+ }
+
Event::handle('EndShowJQueryScripts', array($this));
}
if (Event::handle('StartShowStatusNetScripts', array($this)) &&
$this->script('xbImportNode.js');
$this->script('geometa.js');
}
+ $this->inlineScript('var _peopletagAC = "' .
+ common_local_url('peopletagautocomplete') . '";');
$this->showScriptMessages();
// Frame-busting code to avoid clickjacking attacks.
- $this->inlineScript('if (window.top !== window.self) { window.top.location.href = window.self.location.href; }');
+ if (common_config('javascript', 'bustframes')) {
+ $this->inlineScript('if (window.top !== window.self) { window.top.location.href = window.self.location.href; }');
+ }
Event::handle('EndShowStatusNetScripts', array($this));
Event::handle('EndShowLaconicaScripts', array($this));
}
* events and appending to the array. Try to avoid adding strings that won't be used, as
* they'll be added to HTML output.
*/
-
function showScriptMessages()
{
$messages = array();
$this->elementStart('div', array('id' => 'wrap'));
if (Event::handle('StartShowHeader', array($this))) {
$this->showHeader();
+ $this->flush();
Event::handle('EndShowHeader', array($this));
}
$this->showCore();
+ $this->flush();
if (Event::handle('StartShowFooter', array($this))) {
$this->showFooter();
+ $this->flush();
Event::handle('EndShowFooter', array($this));
}
$this->elementEnd('div');
*/
function showNoticeForm()
{
- $tabs = array('status' => _('Status'));
+ // TRANS: Tab on the notice form.
+ $tabs = array('status' => _m('TAB','Status'));
$this->elementStart('div', 'input_forms');
if (Event::handle('StartShowEntryForms', array(&$tabs))) {
-
$this->elementStart('ul', array('class' => 'nav',
'id' => 'input_form_nav'));
foreach ($tabs as $tag => $title) {
-
$attrs = array('id' => 'input_form_nav_'.$tag,
'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->element('a',
$this->elementEnd('div');
foreach ($tabs as $tag => $title) {
-
$attrs = array('class' => 'input_form',
'id' => 'input_form_'.$tag);
if (Event::handle('StartMakeEntryForm', array($tag, $this, &$form))) {
if ($tag == 'status') {
- $form = new NoticeForm($this);
+ $options = $this->noticeFormOptions();
+ $form = new NoticeForm($this, $options);
}
Event::handle('EndMakeEntryForm', array($tag, $this, $form));
}
$this->elementEnd('div');
}
+ function noticeFormOptions()
+ {
+ return array();
+ }
+
/**
* Show anonymous message.
*
function showCore()
{
$this->elementStart('div', array('id' => 'core'));
+ $this->elementStart('div', array('id' => 'aside_primary_wrapper'));
+ $this->elementStart('div', array('id' => 'content_wrapper'));
+ $this->elementStart('div', array('id' => 'site_nav_local_views_wrapper'));
if (Event::handle('StartShowLocalNavBlock', array($this))) {
$this->showLocalNavBlock();
+ $this->flush();
Event::handle('EndShowLocalNavBlock', array($this));
}
if (Event::handle('StartShowContentBlock', array($this))) {
$this->showContentBlock();
+ $this->flush();
Event::handle('EndShowContentBlock', array($this));
}
if (Event::handle('StartShowAside', array($this))) {
$this->showAside();
+ $this->flush();
Event::handle('EndShowAside', array($this));
}
$this->elementEnd('div');
+ $this->elementEnd('div');
+ $this->elementEnd('div');
+ $this->elementEnd('div');
}
/**
// Need to have this ID for CSS; I'm too lazy to add it to
// all menus
$this->elementStart('div', array('id' => 'site_nav_local_views'));
+ // Cheat cheat cheat!
$this->showLocalNav();
$this->elementEnd('div');
}
+ /**
+ * If there's a logged-in user, show a bit of login context
+ *
+ * @return nothing
+ */
+ function showProfileBlock()
+ {
+ if (common_logged_in()) {
+ $block = new DefaultProfileBlock($this);
+ $block->show();
+ }
+ }
+
/**
* Show local navigation.
*
{
$this->elementStart('div', array('id' => 'aside_primary',
'class' => 'aside'));
+ $this->showProfileBlock();
if (Event::handle('StartShowObjectNavBlock', array($this))) {
$this->showObjectNavBlock();
Event::handle('EndShowObjectNavBlock', array($this));
// TRANS: Text between [] is a link description, text between () is the link itself.
// TRANS: Make sure there is no whitespace between "]" and "(".
// TRANS: "%%site.broughtby%%" is the value of the variable site.broughtby
- $instr = _('**%%site.name%%** is a microblogging service brought to you by [%%site.broughtby%%](%%site.broughtbyurl%%).');
+ $instr = _('**%%site.name%%** is a social network, courtesy of [%%site.broughtby%%](%%site.broughtbyurl%%).');
} else {
// TRANS: First sentence of the StatusNet site license. Used if 'broughtby' is not set.
- $instr = _('**%%site.name%%** is a microblogging service.');
+ $instr = _('**%%site.name%%** is a social network.');
}
$instr .= ' ';
// TRANS: Second sentence of the StatusNet site license. Mentions the StatusNet source code license.
// TRANS: Make sure there is no whitespace between "]" and "(".
// TRANS: Text between [] is a link description, text between () is the link itself.
// TRANS: %s is the version of StatusNet that is being used.
- $instr .= sprintf(_('It runs the [StatusNet](http://status.net/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), STATUSNET_VERSION);
+ $instr .= sprintf(_('It runs on [GNU social](http://www.gnu.org/software/social/), version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), STATUSNET_VERSION);
$output = common_markup_to_html($instr);
$this->raw($output);
// do it
*
* @return nothing
*/
- function menuItem($url, $text, $title=null, $is_selected=false, $id=null)
+ function menuItem($url, $text, $title=null, $is_selected=false, $id=null, $class=null)
{
// Added @id to li for some control.
// XXX: We might want to move this to htmloutputter.php
$lattrs = array();
- if ($is_selected) {
- $lattrs['class'] = 'current';
+ if ($class !== null) {
+ $lattrs['class'] = $class;
+ if ($is_selected) {
+ $lattrs['class'] = trim('current ' . $lattrs['class']);
+ }
}
(is_null($id)) ? $lattrs : $lattrs['id'] = $id;