summaryrefslogtreecommitdiff
path: root/Toha.skin.php
diff options
context:
space:
mode:
Diffstat (limited to 'Toha.skin.php')
-rw-r--r--Toha.skin.php256
1 files changed, 128 insertions, 128 deletions
diff --git a/Toha.skin.php b/Toha.skin.php
index 45ad911..26a7ea6 100644
--- a/Toha.skin.php
+++ b/Toha.skin.php
@@ -20,12 +20,12 @@ class SkinToha extends SkinTemplate {
/**
* initialize the page
*/
- public function initPage( OutputPage $out ) {
- parent::initPage( $out );
- $out->addModuleScripts( array(
+ public function initPage( OutputPage $out ) {
+ parent::initPage( $out );
+ $out->addModuleScripts( array(
'skins.toha'
) );
- }
+ }
/**
* Add CSS via ResourceLoader
@@ -46,12 +46,12 @@ class SkinToha extends SkinTemplate {
* @return QuickTemplate The template to be executed by outputPage
*/
function prepareQuickTemplate( ) {
- global $wgSmallLogo;
+ global $wgSmallLogo;
$tpl = parent::prepareQuickTemplate( );
$tpl->setRef( 'smalllogopath', $wgSmallLogo );
- return $tpl;
+ return $tpl;
- }
+ }
}
@@ -91,13 +91,13 @@ class TohaTemplate extends BaseTemplate {
if ( is_array( $box['content'] ) ) {
echo '<ul>';
- $wrapper = array( 'text-wrapper' => array(
- array( 'tag' => 'div',
- 'attributes' => array( 'class' => 'link_icon' ) ),
- array( 'tag' => 'span' )
- ) );
+ $wrapper = array( 'text-wrapper' => array(
+ array( 'tag' => 'div',
+ 'attributes' => array( 'class' => 'link_icon' ) ),
+ array( 'tag' => 'span' )
+ ) );
- foreach ( $box['content'] as $key => $item ) {
+ foreach ( $box['content'] as $key => $item ) {
echo $this->makeListItem( $key, $item, $wrapper );
}
echo '</ul>';
@@ -108,79 +108,79 @@ class TohaTemplate extends BaseTemplate {
<?php
}
- /**
- * Prepare links for submenus.
- */
+ /**
+ * Prepare links for submenus.
+ */
private function outputRawLinks( $name, $links ) {
- echo 'var inner_' . $name . ' = \'';
+ echo 'var inner_' . $name . ' = \'';
- if ( is_array( $links ) ) {
+ if ( is_array( $links ) ) {
- foreach ( $links as $key => $item )
- echo $this->makeLink( $key, $item );
+ foreach ( $links as $key => $item )
+ echo $this->makeLink( $key, $item );
- } else {
+ } else {
- echo $links;
+ echo $links;
- }
+ }
- echo '\';' . "\n";
+ echo '\';' . "\n";
- echo 'addMenuToID(\'n-' . $name . '-desc\', inner_' . $name . ');';
+ echo 'addMenuToID(\'n-' . $name . '-desc\', inner_' . $name . ');';
- echo "\n\n";
+ echo "\n\n";
- }
+ }
- /**
- * Define menus on the left and on the right.
- */
- private function renderPortletAsSideButtons( $required, $boxes ) {
+ /**
+ * Define menus on the left and on the right.
+ */
+ private function renderPortletAsSideButtons( $required, $boxes ) {
- foreach ( $required as $req ) {
+ foreach ( $required as $req ) {
- if ( ! array_key_exists( $req, $boxes ) )
- continue;
+ if ( ! array_key_exists( $req, $boxes ) )
+ continue;
- $box = $boxes[$req];
+ $box = $boxes[$req];
- if ( ! $box['content'] )
- continue;
+ if ( ! $box['content'] )
+ continue;
- ?>
- <ul id="<?php echo Sanitizer::escapeId( $box['id'] ) ?>">
- <?php
+ ?>
+ <ul id="<?php echo Sanitizer::escapeId( $box['id'] ) ?>">
+ <?php
- if ( is_array( $box['content'] ) ) {
+ if ( is_array( $box['content'] ) ) {
- foreach ( $box['content'] as $key => $item )
- echo $this->makeListItem( $key, $item,
- array( 'text-wrapper' => array( 'tag' => 'span' ) ) );
+ foreach ( $box['content'] as $key => $item )
+ echo $this->makeListItem( $key, $item,
+ array( 'text-wrapper' => array( 'tag' => 'span' ) ) );
- } else {
+ } else {
- echo $box['content'];
+ echo $box['content'];
- }
+ }
- ?>
- </ul>
- <?php
+ ?>
+ </ul>
+ <?php
- }
+ }
- }
+ }
- /**
+ /**
* Outputs the entire contents of the page.
*/
public function execute() {
- $this->html( 'headelement' ) ?>
+ $this->html( 'headelement' ) ?>
- <header>
+ <header>
<a
id="p-logo"
@@ -199,8 +199,8 @@ class TohaTemplate extends BaseTemplate {
</a>
<?php
- $sideboxes = $this->getSidebar();
- $this->outputPortlet( $sideboxes['navigation'] );
+ $sideboxes = $this->getSidebar();
+ $this->outputPortlet( $sideboxes['navigation'] );
?>
</header>
@@ -209,45 +209,45 @@ class TohaTemplate extends BaseTemplate {
<script>
- function toggleExtender() {
+ function toggleExtender() {
- header = document.getElementsByTagName("header")[0];
+ header = document.getElementsByTagName("header")[0];
- if (document.body.scrollTop > 105 || document.documentElement.scrollTop > 105)
- header.className = "sticky";
+ if (document.body.scrollTop > 105 || document.documentElement.scrollTop > 105)
+ header.className = "sticky";
- else
- header.className = "";
+ else
+ header.className = "";
- }
+ }
- window.onscroll = toggleExtender;
+ window.onscroll = toggleExtender;
- </script>
+ </script>
<div id="mw-wrapper">
<script>
- function buildDynMenus() {
+ function buildDynMenus() {
- <?php
+ <?php
- foreach ( $sideboxes as $boxName => $box ) {
+ foreach ( $sideboxes as $boxName => $box ) {
- $parts = explode( '-', $boxName );
+ $parts = explode( '-', $boxName );
- if ( count( $parts ) != 2 ) continue;
+ if ( count( $parts ) != 2 ) continue;
- if ($parts[1] != 'submenu' ) break;
+ if ($parts[1] != 'submenu' ) break;
- $this->outputRawLinks( $parts[0], $box['content'] );
+ $this->outputRawLinks( $parts[0], $box['content'] );
- }
+ }
- ?>
+ ?>
- }
+ }
document.body.onload = buildDynMenus;
@@ -262,15 +262,15 @@ class TohaTemplate extends BaseTemplate {
<div class="usermessage"><?php $this->html( 'newtalk' ) ?></div>
<?php } ?>
- <?php
- if (false/* && !$this->getSkin()->getTitle()->isMainPage()*/) {
- ?>
+ <?php
+ if (false/* && !$this->getSkin()->getTitle()->isMainPage()*/) {
+ ?>
<h1 class="firstHeading">
<?php $this->html( 'title' ) ?>
</h1>
- <?php
- }
- ?>
+ <?php
+ }
+ ?>
<div class="mw-body-content">
<div id="contentSub">
@@ -305,89 +305,89 @@ class TohaTemplate extends BaseTemplate {
<?php } ?>
</ul>
- <ul id="lastmod">
- <li><?php $this->html( 'lastmod' ) ?></li>
- </ul>
+ <ul id="lastmod">
+ <li><?php $this->html( 'lastmod' ) ?></li>
+ </ul>
- <?php global $wgFooterImages; ?>
+ <?php global $wgFooterImages; ?>
<ul id="links">
<?php foreach ( $wgFooterImages as $category => $params ) { ?>
- <li>
- <a href="<?= $params['url'] ?>">
- <?php if ( isset( $params['src'] ) ) { ?>
- <img alt="<?= $params['alt'] ?>" src="<?= $params['src'] ?>" onmouseover="this.src='<?= $params['hsrc'] ?>'" onmouseout="this.src='<?= $params['src'] ?>'">
- <?php } else { ?>
- <img alt="<?= $params['alt'] ?>" src="<?= $params['src'] ?>">
- <?php } ?>
- </a>
- </li>
+ <li>
+ <a href="<?= $params['url'] ?>">
+ <?php if ( isset( $params['src'] ) ) { ?>
+ <img alt="<?= $params['alt'] ?>" src="<?= $params['src'] ?>" onmouseover="this.src='<?= $params['hsrc'] ?>'" onmouseout="this.src='<?= $params['src'] ?>'">
+ <?php } else { ?>
+ <img alt="<?= $params['alt'] ?>" src="<?= $params['src'] ?>">
+ <?php } ?>
+ </a>
+ </li>
<?php } ?>
</ul>
- <div style="clear: both;"></div>
+ <div style="clear: both;"></div>
- </div>
+ </div>
<div id="mw-navigation" class="left-navigation">
- <div>
- <?php
+ <div>
+ <?php
- $this->renderPortletAsSideButtons( array ( 'TOOLBOX', 'LANGUAGES' ), $sideboxes );
+ $this->renderPortletAsSideButtons( array ( 'TOOLBOX', 'LANGUAGES' ), $sideboxes );
- ?>
- </div>
+ ?>
+ </div>
- </div>
+ </div>
<div id="mw-navigation" class="right-navigation">
- <div>
- <?php
+ <div>
+ <?php
- $navigations = $this->data['content_navigation'];
+ $navigations = $this->data['content_navigation'];
- if ( array_key_exists('view', $navigations['views']) )
- unset( $navigations['views']['view'] );
+ if ( array_key_exists('view', $navigations['views']) )
+ unset( $navigations['views']['view'] );
- $rboxes = array(
+ $rboxes = array(
- 'personal' => array(
+ 'personal' => array(
- 'id' => 'p-personal',
- 'content' => $this->getPersonalTools()
+ 'id' => 'p-personal',
+ 'content' => $this->getPersonalTools()
- ),
+ ),
- 'views' => array(
+ 'views' => array(
- 'id' => 'p-views',
- 'content' => $navigations['views']
+ 'id' => 'p-views',
+ 'content' => $navigations['views']
- ),
+ ),
- 'actions' => array(
+ 'actions' => array(
- 'id' => 'p-actions',
- 'content' => $navigations['actions']
+ 'id' => 'p-actions',
+ 'content' => $navigations['actions']
- )
+ )
- );
+ );
- $this->renderPortletAsSideButtons( array ( 'personal', 'views', 'actions' ), $rboxes );
+ $this->renderPortletAsSideButtons( array ( 'personal', 'views', 'actions' ), $rboxes );
- ?>
- </div>
+ ?>
+ </div>
- </div>
+ </div>
- </div>
+ </div>
<?php $this->printTrail() ?>
- </body></html>
+ </body></html>
<?php
}