Event::handle('EndShowUAStyles', array($this));
}
- if (Event::handle('StartShowDesign', array($this))) {
-
- $user = common_current_user();
-
- if (empty($user) || $user->viewdesigns) {
- $design = $this->getDesign();
-
- if (!empty($design)) {
- $design->showCSS($this);
- }
- }
-
- Event::handle('EndShowDesign', array($this));
- }
Event::handle('EndShowStyles', array($this));
if (common_config('custom_css', 'enabled')) {
$this->cssLink('css/display.css', $baseTheme, $media);
}
$this->cssLink('css/display.css', $mainTheme, $media);
+
+ // Additional styles for RTL languages
+ if (is_rtl(common_language())) {
+ if (file_exists(Theme::file('css/rtl.css'))) {
+ $this->cssLink('css/rtl.css', $mainTheme, $media);
+ }
+ }
}
/**
$this->script('xbImportNode.js');
$this->script('geometa.js');
}
- $this->inlineScript('var _peopletagAC = "' .
- common_local_url('peopletagautocomplete') . '";');
+ // This route isn't available in single-user mode.
+ // Not sure why, but it causes errors here.
+ if (!common_config('singleuser', 'enabled')) {
+ $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; }');
+ // Anti-framing code to avoid clickjacking attacks in older browsers.
+ // This will show a blank page if the page is being framed, which is
+ // consistent with the behavior of the 'X-Frame-Options: SAMEORIGIN'
+ // header, which prevents framing in newer browser.
+ if (common_config('javascript', 'bustframes')) {
+ $this->inlineScript('if (window.top !== window.self) { document.write = ""; window.top.location = window.self.location; setTimeout(function () { document.body.innerHTML = ""; }, 1); window.self.onload = function () { document.body.innerHTML = ""; }; }');
+ }
Event::handle('EndShowStatusNetScripts', array($this));
Event::handle('EndShowLaconicaScripts', array($this));
}
function showPrimaryNav()
{
$this->elementStart('div', array('id' => 'site_nav_global_primary'));
+
+ $user = common_current_user();
+
+ if (!empty($user) || !common_config('site', 'private')) {
+ $form = new SearchForm($this);
+ $form->show();
+ }
+
$pn = new PrimaryNav($this);
$pn->show();
$this->elementEnd('div');
{
// Added @id to li for some control.
// XXX: We might want to move this to htmloutputter.php
- $lattrs = array();
+ $lattrs = array();
+ $classes = array();
if ($class !== null) {
- $lattrs['class'] = $class;
- if ($is_selected) {
- $lattrs['class'] = trim('current ' . $lattrs['class']);
- }
+ $classes[] = trim($class);
+ }
+ if ($is_selected) {
+ $classes[] = 'current';
+ }
+
+ if (!empty($classes)) {
+ $lattrs['class'] = implode(' ', $classes);
}
- (is_null($id)) ? $lattrs : $lattrs['id'] = $id;
+ if (!is_null($id)) {
+ $lattrs['id'] = $id;
+ }
$this->elementStart('li', $lattrs);
$attrs['href'] = $url;
return null;
}
- /**
- * A design for this action
- *
- * @return Design a design object to use
- */
- function getDesign()
- {
- return Design::siteDesign();
- }
-
/**
* Check the session token.
*