}
}
- function timingComment()
+ function endHTML()
{
global $_startTime;
$diff = round(($endTime - $_startTime) * 1000);
$this->raw("<!-- ${diff}ms -->");
}
- }
- function endHTML()
- {
- $this->timingComment();
return parent::endHTML();
}
-
/**
* Show head, a template method.
*
function showHead()
{
// XXX: attributes (profile?)
- $this->timingComment();
$this->elementStart('head');
if (Event::handle('StartShowHeadElements', array($this))) {
if (Event::handle('StartShowHeadTitle', array($this))) {
Event::handle('EndShowHeadElements', array($this));
}
$this->elementEnd('head');
- $this->timingComment();
}
/**
$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.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; }');
* 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();
*/
function showBody()
{
- $this->timingComment();
$this->elementStart('body', (common_current_user()) ? array('id' => strtolower($this->trimmed('action')),
'class' => 'user_in')
: array('id' => strtolower($this->trimmed('action'))));
$this->elementStart('div', array('id' => 'wrap'));
if (Event::handle('StartShowHeader', array($this))) {
- $this->timingComment();
$this->showHeader();
$this->flush();
- $this->timingComment();
Event::handle('EndShowHeader', array($this));
}
$this->showCore();
$this->flush();
if (Event::handle('StartShowFooter', array($this))) {
- $this->timingComment();
$this->showFooter();
$this->flush();
- $this->timingComment();
Event::handle('EndShowFooter', array($this));
}
$this->elementEnd('div');
$this->showScripts();
$this->elementEnd('body');
- $this->timingComment();
}
/**
$this->elementStart('div', array('id' => 'content_wrapper'));
$this->elementStart('div', array('id' => 'site_nav_local_views_wrapper'));
if (Event::handle('StartShowLocalNavBlock', array($this))) {
- $this->timingComment();
$this->showLocalNavBlock();
$this->flush();
- $this->timingComment();
Event::handle('EndShowLocalNavBlock', array($this));
}
if (Event::handle('StartShowContentBlock', array($this))) {
- $this->timingComment();
$this->showContentBlock();
$this->flush();
- $this->timingComment();
Event::handle('EndShowContentBlock', array($this));
}
if (Event::handle('StartShowAside', array($this))) {
- $this->timingComment();
$this->showAside();
$this->flush();
- $this->timingComment();
Event::handle('EndShowAside', array($this));
}
$this->elementEnd('div');
*
* @return nothing
*/
-
function showProfileBlock()
{
if (common_logged_in()) {
*
* @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;