00001 <?php
00011 if( !defined( 'MEDIAWIKI' ) )
00012 die( -1 );
00013
00018 class SkinVector extends SkinTemplate {
00019
00020
00021 var $skinname = 'vector', $stylename = 'vector',
00022 $template = 'VectorTemplate', $useHeadElement = true;
00023
00028 public function initPage( OutputPage $out ) {
00029 global $wgStylePath, $wgJsMimeType, $wgStyleVersion, $wgScriptPath, $wgVectorExtraStyles;
00030
00031 parent::initPage( $out );
00032
00033
00034 $out->addStyle( 'vector/main-rtl.css', 'screen', '', 'rtl' );
00035 $out->addStyle( 'vector/main-ltr.css', 'screen', '', 'ltr' );
00036
00037
00038
00039 $out->addScript(
00040 '<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
00041 $wgStylePath .
00042 '/vector/csshover.htc")}</style><![endif]-->'
00043 );
00044
00045
00046 if ( is_array( $wgVectorExtraStyles ) ) {
00047 foreach ( $wgVectorExtraStyles as $style ) {
00048 $out->addStyle( 'vector/' . $style, 'screen' );
00049 }
00050 }
00051 }
00057 function buildNavigationUrls() {
00058 global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle, $wgStylePath;
00059 global $wgDisableLangConversion, $wgVectorUseIconWatch;
00060
00061 wfProfileIn( __METHOD__ );
00062
00063 $links = array(
00064 'namespaces' => array(),
00065 'views' => array(),
00066 'actions' => array(),
00067 'variants' => array()
00068 );
00069
00070
00071 $action = $wgRequest->getVal( 'action', 'view' );
00072 $section = $wgRequest->getVal( 'section' );
00073
00074
00075 if( $this->iscontent ) {
00076
00077
00078 $subjectPage = $this->mTitle->getSubjectPage();
00079 $talkPage = $this->mTitle->getTalkPage();
00080
00081
00082 $isTalk = $this->mTitle->isTalkPage();
00083
00084
00085 $subjectId = $this->mTitle->getNamespaceKey( '' );
00086
00087 if ( $subjectId == 'main' ) {
00088 $talkId = 'talk';
00089 } else {
00090 $talkId = "{$subjectId}_talk";
00091 }
00092 $currentId = $isTalk ? $talkId : $subjectId;
00093
00094
00095 $links['namespaces'][$subjectId] = $this->tabAction(
00096 $subjectPage, 'vector-namespace-' . $subjectId, !$isTalk, '', true
00097 );
00098 $links['namespaces'][$subjectId]['context'] = 'subject';
00099 $links['namespaces'][$talkId] = $this->tabAction(
00100 $talkPage, 'vector-namespace-talk', $isTalk, '', true
00101 );
00102 $links['namespaces'][$talkId]['context'] = 'talk';
00103
00104
00105 if ( $this->mTitle->exists() ) {
00106 $links['views']['view'] = $this->tabAction(
00107 $isTalk ? $talkPage : $subjectPage,
00108 'vector-view-view', ( $action == 'view' ), '', true
00109 );
00110 }
00111
00112 wfProfileIn( __METHOD__ . '-edit' );
00113
00114
00115 if (
00116
00117 $this->mTitle->quickUserCan( 'edit' ) &&
00118 (
00119
00120 $this->mTitle->exists() ||
00121
00122 $this->mTitle->quickUserCan( 'create' )
00123 )
00124 ) {
00125
00126 $isTalkClass = $isTalk ? ' istalk' : '';
00127
00128
00129 $selected = (
00130 ( $action == 'edit' || $action == 'submit' ) &&
00131 ( $section != 'new' )
00132 );
00133 $links['views']['edit'] = array(
00134 'class' => ( $selected ? 'selected' : '' ) . $isTalkClass,
00135 'text' => $this->mTitle->exists()
00136 ? wfMsg( 'vector-view-edit' )
00137 : wfMsg( 'vector-view-create' ),
00138 'href' =>
00139 $this->mTitle->getLocalUrl( $this->editUrlOptions() )
00140 );
00141
00142
00143 if ( ( $isTalk && $wgArticle->isCurrent() ) || ( $wgOut->showNewSectionLink() ) ) {
00144
00145 if ( !$wgOut->forceHideNewSectionLink() ) {
00146
00147
00148 $links['views']['addsection'] = array(
00149 'class' => 'collapsible ' . ( $section == 'new' ? 'selected' : false ),
00150 'text' => wfMsg( 'vector-action-addsection' ),
00151 'href' => $this->mTitle->getLocalUrl(
00152 'action=edit§ion=new'
00153 )
00154 );
00155 }
00156 }
00157
00158 } elseif ( $this->mTitle->isKnown() ) {
00159
00160 $links['views']['viewsource'] = array(
00161 'class' => ( $action == 'edit' ) ? 'selected' : false,
00162 'text' => wfMsg( 'vector-view-viewsource' ),
00163 'href' =>
00164 $this->mTitle->getLocalUrl( $this->editUrlOptions() )
00165 );
00166 }
00167 wfProfileOut( __METHOD__ . '-edit' );
00168
00169 wfProfileIn( __METHOD__ . '-live' );
00170
00171
00172 if ( $this->mTitle->exists() ) {
00173
00174 $links['views']['history'] = array(
00175 'class' => 'collapsible ' . ( ($action == 'history') ? 'selected' : false ),
00176 'text' => wfMsg( 'vector-view-history' ),
00177 'href' => $this->mTitle->getLocalUrl( 'action=history' ),
00178 'rel' => 'archives',
00179 );
00180
00181 if( $wgUser->isAllowed( 'delete' ) ) {
00182 $links['actions']['delete'] = array(
00183 'class' => ($action == 'delete') ? 'selected' : false,
00184 'text' => wfMsg( 'vector-action-delete' ),
00185 'href' => $this->mTitle->getLocalUrl( 'action=delete' )
00186 );
00187 }
00188 if ( $this->mTitle->quickUserCan( 'move' ) ) {
00189 $moveTitle = SpecialPage::getTitleFor(
00190 'Movepage', $this->thispage
00191 );
00192 $links['actions']['move'] = array(
00193 'class' => $this->mTitle->isSpecial( 'Movepage' ) ?
00194 'selected' : false,
00195 'text' => wfMsg( 'vector-action-move' ),
00196 'href' => $moveTitle->getLocalUrl()
00197 );
00198 }
00199
00200 if (
00201 $this->mTitle->getNamespace() !== NS_MEDIAWIKI &&
00202 $wgUser->isAllowed( 'protect' )
00203 ) {
00204 if ( !$this->mTitle->isProtected() ){
00205 $links['actions']['protect'] = array(
00206 'class' => ($action == 'protect') ?
00207 'selected' : false,
00208 'text' => wfMsg( 'vector-action-protect' ),
00209 'href' =>
00210 $this->mTitle->getLocalUrl( 'action=protect' )
00211 );
00212
00213 } else {
00214 $links['actions']['unprotect'] = array(
00215 'class' => ($action == 'unprotect') ?
00216 'selected' : false,
00217 'text' => wfMsg( 'vector-action-unprotect' ),
00218 'href' =>
00219 $this->mTitle->getLocalUrl( 'action=unprotect' )
00220 );
00221 }
00222 }
00223 } else {
00224
00225 if (
00226 $wgUser->isAllowed( 'deletedhistory' ) &&
00227 $wgUser->isAllowed( 'undelete' )
00228 ) {
00229 if( $n = $this->mTitle->isDeleted() ) {
00230 $undelTitle = SpecialPage::getTitleFor( 'Undelete' );
00231 $links['actions']['undelete'] = array(
00232 'class' => false,
00233 'text' => wfMsgExt(
00234 'vector-action-undelete',
00235 array( 'parsemag' ),
00236 $wgLang->formatNum( $n )
00237 ),
00238 'href' => $undelTitle->getLocalUrl(
00239 'target=' . urlencode( $this->thispage )
00240 )
00241 );
00242 }
00243 }
00244
00245 if (
00246 $this->mTitle->getNamespace() !== NS_MEDIAWIKI &&
00247 $wgUser->isAllowed( 'protect' )
00248 ) {
00249 if ( !$this->mTitle->getRestrictions( 'create' ) ) {
00250 $links['actions']['protect'] = array(
00251 'class' => ($action == 'protect') ?
00252 'selected' : false,
00253 'text' => wfMsg( 'vector-action-protect' ),
00254 'href' =>
00255 $this->mTitle->getLocalUrl( 'action=protect' )
00256 );
00257
00258 } else {
00259 $links['actions']['unprotect'] = array(
00260 'class' => ($action == 'unprotect') ?
00261 'selected' : false,
00262 'text' => wfMsg( 'vector-action-unprotect' ),
00263 'href' =>
00264 $this->mTitle->getLocalUrl( 'action=unprotect' )
00265 );
00266 }
00267 }
00268 }
00269 wfProfileOut( __METHOD__ . '-live' );
00279
00280 if ( $this->loggedin ) {
00281 if ( $wgVectorUseIconWatch ) {
00282 $class = 'icon ';
00283 $place = 'views';
00284 } else {
00285 $class = '';
00286 $place = 'actions';
00287 }
00288 $mode = $this->mTitle->userIsWatching() ? 'unwatch' : 'watch';
00289 $links[$place][$mode] = array(
00290 'class' => $class . ( ( $action == 'watch' || $action == 'unwatch' ) ? ' selected' : false ),
00291 'text' => wfMsg( $mode ),
00292 'href' => $this->mTitle->getLocalUrl( 'action=' . $mode )
00293 );
00294 }
00295
00296 wfRunHooks( 'SkinTemplateNavigation', array( &$this, &$links ) );
00297
00298
00299 } else {
00300 $links['namespaces']['special'] = array(
00301 'class' => 'selected',
00302 'text' => wfMsg( 'vector-namespace-special' ),
00303 'href' => $wgRequest->getRequestURL()
00304 );
00305 }
00306
00307
00308 $variants = $wgContLang->getVariants();
00309
00310 if( !$wgDisableLangConversion && count( $variants ) > 1 ) {
00311
00312 $preferred = $wgContLang->getPreferredVariant();
00313
00314 foreach( $variants as $code ) {
00315
00316 $varname = $wgContLang->getVariantname( $code );
00317
00318 if( $varname == 'disable' ) {
00319
00320 continue;
00321 }
00322
00323 $links['variants'][] = array(
00324 'class' => ( $code == $preferred ) ? 'selected' : false,
00325 'text' => $varname,
00326 'href' => $this->mTitle->getLocalURL( '', $code )
00327 );
00328 }
00329 }
00330
00331 wfProfileOut( __METHOD__ );
00332
00333 return $links;
00334 }
00335 }
00336
00341 class VectorTemplate extends QuickTemplate {
00342
00343
00344
00348 var $skin;
00349
00350
00351
00355 public function execute() {
00356 global $wgRequest, $wgOut, $wgContLang;
00357
00358 $this->skin = $this->data['skin'];
00359 $action = $wgRequest->getText( 'action' );
00360
00361
00362 $nav = $this->skin->buildNavigationUrls();
00363 foreach ( $nav as $section => $links ) {
00364 foreach ( $links as $key => $link ) {
00365 $xmlID = $key;
00366 if ( isset( $link['context'] ) && $link['context'] == 'subject' ) {
00367 $xmlID = 'ca-nstab-' . $xmlID;
00368 } else if ( isset( $link['context'] ) && $link['context'] == 'talk' ) {
00369 $xmlID = 'ca-talk';
00370 } else {
00371 $xmlID = 'ca-' . $xmlID;
00372 }
00373 $nav[$section][$key]['attributes'] =
00374 ' id="' . Sanitizer::escapeId( $xmlID ) . '"';
00375 if ( $nav[$section][$key]['class'] ) {
00376 $nav[$section][$key]['attributes'] .=
00377 ' class="' . htmlspecialchars( $link['class'] ) . '"';
00378 unset( $nav[$section][$key]['class'] );
00379 }
00380
00381
00382
00383
00384
00385 if (
00386 in_array( $action, array( 'edit', 'submit' ) ) &&
00387 in_array( $key, array( 'edit', 'watch', 'unwatch' ) )
00388 ) {
00389 $nav[$section][$key]['key'] =
00390 $this->skin->tooltip( $xmlID );
00391 } else {
00392 $nav[$section][$key]['key'] =
00393 $this->skin->tooltipAndAccesskey( $xmlID );
00394 }
00395 }
00396 }
00397 $this->data['namespace_urls'] = $nav['namespaces'];
00398 $this->data['view_urls'] = $nav['views'];
00399 $this->data['action_urls'] = $nav['actions'];
00400 $this->data['variant_urls'] = $nav['variants'];
00401
00402 foreach ( $this->data['personal_urls'] as $key => $item) {
00403 $this->data['personal_urls'][$key]['attributes'] =
00404 ' id="' . Sanitizer::escapeId( "pt-$key" ) . '"';
00405 if ( isset( $item['active'] ) && $item['active'] ) {
00406 $this->data['personal_urls'][$key]['attributes'] .=
00407 ' class="active"';
00408 }
00409 $this->data['personal_urls'][$key]['key'] =
00410 $this->skin->tooltipAndAccesskey('pt-'.$key);
00411 }
00412
00413
00414 $footerlinks = array(
00415 'info' => array(
00416 'lastmod',
00417 'viewcount',
00418 'numberofwatchingusers',
00419 'credits',
00420 'copyright',
00421 'tagline',
00422 ),
00423 'places' => array(
00424 'privacy',
00425 'about',
00426 'disclaimer',
00427 ),
00428 );
00429
00430 $validFooterLinks = array();
00431 foreach( $footerlinks as $category => $links ) {
00432 $validFooterLinks[$category] = array();
00433 foreach( $links as $link ) {
00434 if( isset( $this->data[$link] ) && $this->data[$link] ) {
00435 $validFooterLinks[$category][] = $link;
00436 }
00437 }
00438 }
00439
00440 if ( $wgContLang->isRTL() ) {
00441 $this->data['view_urls'] =
00442 array_reverse( $this->data['view_urls'] );
00443 $this->data['namespace_urls'] =
00444 array_reverse( $this->data['namespace_urls'] );
00445 $this->data['personal_urls'] =
00446 array_reverse( $this->data['personal_urls'] );
00447 }
00448
00449 $this->html( 'headelement' );
00450 ?>
00451 <div id="mw-page-base" class="noprint"></div>
00452 <div id="mw-head-base" class="noprint"></div>
00453 <!-- content -->
00454 <div id="content" <?php $this->html('specialpageattributes') ?>>
00455 <a id="top"></a>
00456 <div id="mw-js-message" style="display:none;"<?php $this->html('userlangattributes') ?>></div>
00457 <?php if ( $this->data['sitenotice'] ): ?>
00458 <!-- sitenotice -->
00459 <div id="siteNotice"><?php $this->html( 'sitenotice' ) ?></div>
00460 <!-- /sitenotice -->
00461 <?php endif; ?>
00462 <!-- firstHeading -->
00463 <h1 id="firstHeading" class="firstHeading"><?php $this->html( 'title' ) ?></h1>
00464 <!-- /firstHeading -->
00465 <!-- bodyContent -->
00466 <div id="bodyContent">
00467 <!-- tagline -->
00468 <h3 id="siteSub"><?php $this->msg( 'tagline' ) ?></h3>
00469 <!-- /tagline -->
00470 <!-- subtitle -->
00471 <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html( 'subtitle' ) ?></div>
00472 <!-- /subtitle -->
00473 <?php if ( $this->data['undelete'] ): ?>
00474 <!-- undelete -->
00475 <div id="contentSub2"><?php $this->html( 'undelete' ) ?></div>
00476 <!-- /undelete -->
00477 <?php endif; ?>
00478 <?php if($this->data['newtalk'] ): ?>
00479 <!-- newtalk -->
00480 <div class="usermessage"><?php $this->html( 'newtalk' ) ?></div>
00481 <!-- /newtalk -->
00482 <?php endif; ?>
00483 <?php if ( $this->data['showjumplinks'] ): ?>
00484 <!-- jumpto -->
00485 <div id="jump-to-nav">
00486 <?php $this->msg( 'jumpto' ) ?> <a href="#mw-head"><?php $this->msg( 'jumptonavigation' ) ?></a>,
00487 <a href="#p-search"><?php $this->msg( 'jumptosearch' ) ?></a>
00488 </div>
00489 <!-- /jumpto -->
00490 <?php endif; ?>
00491 <!-- bodytext -->
00492 <?php $this->html( 'bodytext' ) ?>
00493 <!-- /bodytext -->
00494 <?php if ( $this->data['catlinks'] ): ?>
00495 <!-- catlinks -->
00496 <?php $this->html( 'catlinks' ); ?>
00497 <!-- /catlinks -->
00498 <?php endif; ?>
00499 <?php if ( $this->data['dataAfterContent'] ): ?>
00500 <!-- dataAfterContent -->
00501 <?php $this->html( 'dataAfterContent' ); ?>
00502 <!-- /dataAfterContent -->
00503 <?php endif; ?>
00504 <div class="visualClear"></div>
00505 </div>
00506 <!-- /bodyContent -->
00507 </div>
00508 <!-- /content -->
00509 <!-- header -->
00510 <div id="mw-head" class="noprint">
00511 <?php $this->renderNavigation( 'PERSONAL' ); ?>
00512 <div id="left-navigation">
00513 <?php $this->renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?>
00514 </div>
00515 <div id="right-navigation">
00516 <?php $this->renderNavigation( array( 'VIEWS', 'ACTIONS', 'SEARCH' ) ); ?>
00517 </div>
00518 </div>
00519 <!-- /header -->
00520 <!-- panel -->
00521 <div id="mw-panel" class="noprint">
00522 <!-- logo -->
00523 <div id="p-logo"><a style="background-image: url(<?php $this->text( 'logopath' ) ?>);" href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo $this->skin->tooltipAndAccesskey( 'p-logo' ) ?>></a></div>
00524 <!-- /logo -->
00525 <?php $this->renderPortals( $this->data['sidebar'] ); ?>
00526 </div>
00527 <!-- /panel -->
00528 <!-- footer -->
00529 <div id="footer"<?php $this->html('userlangattributes') ?>>
00530 <?php foreach( $validFooterLinks as $category => $links ): ?>
00531 <?php if ( count( $links ) > 0 ): ?>
00532 <ul id="footer-<?php echo $category ?>">
00533 <?php foreach( $links as $link ): ?>
00534 <?php if( isset( $this->data[$link] ) && $this->data[$link] ): ?>
00535 <li id="footer-<?php echo $category ?>-<?php echo $link ?>"><?php $this->html( $link ) ?></li>
00536 <?php endif; ?>
00537 <?php endforeach; ?>
00538 </ul>
00539 <?php endif; ?>
00540 <?php endforeach; ?>
00541 <ul id="footer-icons" class="noprint">
00542 <?php if ( $this->data['poweredbyico'] ): ?>
00543 <li id="footer-icon-poweredby"><?php $this->html( 'poweredbyico' ) ?></li>
00544 <?php endif; ?>
00545 <?php if ( $this->data['copyrightico'] ): ?>
00546 <li id="footer-icon-copyright"><?php $this->html( 'copyrightico' ) ?></li>
00547 <?php endif; ?>
00548 </ul>
00549 <div style="clear:both"></div>
00550 </div>
00551 <!-- /footer -->
00552 <!-- fixalpha -->
00553 <script type="<?php $this->text('jsmimetype') ?>"> if ( window.isMSIE55 ) fixalpha(); </script>
00554 <!-- /fixalpha -->
00555 <?php $this->html( 'bottomscripts' ); ?>
00556 <?php $this->html( 'reporttime' ) ?>
00557 <?php if ( $this->data['debug'] ): ?>
00558 <!-- Debug output: <?php $this->text( 'debug' ); ?> -->
00559 <?php endif; ?>
00560 </body>
00561 </html>
00562 <?php
00563 }
00564
00568 private function renderPortals( $portals ) {
00569
00570 if ( !isset( $portals['SEARCH'] ) ) $portals['SEARCH'] = true;
00571 if ( !isset( $portals['TOOLBOX'] ) ) $portals['TOOLBOX'] = true;
00572 if ( !isset( $portals['LANGUAGES'] ) ) $portals['LANGUAGES'] = true;
00573
00574 foreach ( $portals as $name => $content ) {
00575 echo "\n<!-- {$name} -->\n";
00576 switch( $name ) {
00577 case 'SEARCH':
00578 break;
00579 case 'TOOLBOX':
00580 ?>
00581 <div class="portal" id="p-tb">
00582 <h5<?php $this->html('userlangattributes') ?>><?php $this->msg( 'toolbox' ) ?></h5>
00583 <div class="body">
00584 <ul>
00585 <?php if( $this->data['notspecialpage'] ): ?>
00586 <li id="t-whatlinkshere"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['whatlinkshere']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-whatlinkshere' ) ?>><?php $this->msg( 'whatlinkshere' ) ?></a></li>
00587 <?php if( $this->data['nav_urls']['recentchangeslinked'] ): ?>
00588 <li id="t-recentchangeslinked"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['recentchangeslinked']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-recentchangeslinked' ) ?>><?php $this->msg( 'recentchangeslinked-toolbox' ) ?></a></li>
00589 <?php endif; ?>
00590 <?php endif; ?>
00591 <?php if( isset( $this->data['nav_urls']['trackbacklink'] ) ): ?>
00592 <li id="t-trackbacklink"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['trackbacklink']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-trackbacklink' ) ?>><?php $this->msg( 'trackbacklink' ) ?></a></li>
00593 <?php endif; ?>
00594 <?php if( $this->data['feeds']): ?>
00595 <li id="feedlinks">
00596 <?php foreach( $this->data['feeds'] as $key => $feed ): ?>
00597 <a id="<?php echo Sanitizer::escapeId( "feed-$key" ) ?>" href="<?php echo htmlspecialchars( $feed['href'] ) ?>" rel="alternate" type="application/<?php echo $key ?>+xml" class="feedlink"<?php echo $this->skin->tooltipAndAccesskey( 'feed-' . $key ) ?>><?php echo htmlspecialchars( $feed['text'] ) ?></a>
00598 <?php endforeach; ?>
00599 </li>
00600 <?php endif; ?>
00601 <?php foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ): ?>
00602 <?php if( $this->data['nav_urls'][$special]): ?>
00603 <li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars( $this->data['nav_urls'][$special]['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-' . $special ) ?>><?php $this->msg( $special ) ?></a></li>
00604 <?php endif; ?>
00605 <?php endforeach; ?>
00606 <?php if( !empty( $this->data['nav_urls']['print']['href'] ) ): ?>
00607 <li id="t-print"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['print']['href'] ) ?>" rel="alternate"<?php echo $this->skin->tooltipAndAccesskey( 't-print' ) ?>><?php $this->msg( 'printableversion' ) ?></a></li>
00608 <?php endif; ?>
00609 <?php if ( !empty( $this->data['nav_urls']['permalink']['href'] ) ): ?>
00610 <li id="t-permalink"><a href="<?php echo htmlspecialchars( $this->data['nav_urls']['permalink']['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 't-permalink' ) ?>><?php $this->msg( 'permalink' ) ?></a></li>
00611 <?php elseif ( $this->data['nav_urls']['permalink']['href'] === '' ): ?>
00612 <li id="t-ispermalink"<?php echo $this->skin->tooltip( 't-ispermalink' ) ?>><?php $this->msg( 'permalink' ) ?></li>
00613 <?php endif; ?>
00614 <?php wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?>
00615 </ul>
00616 </div>
00617 </div>
00618 <?php
00619 break;
00620 case 'LANGUAGES':
00621 if ( $this->data['language_urls'] ) {
00622 ?>
00623 <div class="portal" id="p-lang">
00624 <h5<?php $this->html('userlangattributes') ?>><?php $this->msg( 'otherlanguages' ) ?></h5>
00625 <div class="body">
00626 <ul>
00627 <?php foreach ( $this->data['language_urls'] as $langlink ): ?>
00628 <li class="<?php echo htmlspecialchars( $langlink['class'] ) ?>"><a href="<?php echo htmlspecialchars( $langlink['href'] ) ?>"><?php echo $langlink['text'] ?></a></li>
00629 <?php endforeach; ?>
00630 </ul>
00631 </div>
00632 </div>
00633 <?php
00634 }
00635 break;
00636 default:
00637 ?>
00638 <div class="portal" id='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php echo $this->skin->tooltip( 'p-' . $name ) ?>>
00639 <h5<?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $name ); if ( wfEmptyMsg( $name, $out ) ) echo htmlspecialchars( $name ); else echo htmlspecialchars( $out ); ?></h5>
00640 <div class="body">
00641 <?php if ( is_array( $content ) ): ?>
00642 <ul>
00643 <?php foreach( $content as $key => $val ): ?>
00644 <li id="<?php echo Sanitizer::escapeId( $val['id'] ) ?>"<?php if ( $val['active'] ): ?> class="active" <?php endif; ?>><a href="<?php echo htmlspecialchars( $val['href'] ) ?>"<?php echo $this->skin->tooltipAndAccesskey( $val['id'] ) ?>><?php echo htmlspecialchars( $val['text'] ) ?></a></li>
00645 <?php endforeach; ?>
00646 </ul>
00647 <?php else: ?>
00648 <?php echo $content; ?>
00649 <?php endif; ?>
00650 </div>
00651 </div>
00652 <?php
00653 break;
00654 }
00655 echo "\n<!-- /{$name} -->\n";
00656 }
00657 }
00658
00663 private function renderNavigation( $elements ) {
00664 global $wgContLang, $wgVectorUseSimpleSearch, $wgStylePath;
00665
00666
00667
00668 if ( !is_array( $elements ) ) {
00669 $elements = array( $elements );
00670
00671 } else if ( $wgContLang->isRTL() ) {
00672 $elements = array_reverse( $elements );
00673 }
00674
00675 foreach ( $elements as $name => $element ) {
00676 echo "\n<!-- {$name} -->\n";
00677 switch ( $element ) {
00678 case 'NAMESPACES':
00679 ?>
00680 <div id="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
00681 <h5><?php $this->msg('namespaces') ?></h5>
00682 <ul<?php $this->html('userlangattributes') ?>>
00683 <?php foreach ($this->data['namespace_urls'] as $key => $link ): ?>
00684 <li <?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><span><?php echo htmlspecialchars( $link['text'] ) ?></span></a></li>
00685 <?php endforeach; ?>
00686 </ul>
00687 </div>
00688 <?php
00689 break;
00690 case 'VARIANTS':
00691 ?>
00692 <div id="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
00693 <h5><span><?php $this->msg('variants') ?></span><a href="#"></a></h5>
00694 <div class="menu">
00695 <ul<?php $this->html('userlangattributes') ?>>
00696 <?php foreach ($this->data['variant_urls'] as $key => $link ): ?>
00697 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
00698 <?php endforeach; ?>
00699 </ul>
00700 </div>
00701 </div>
00702 <?php
00703 break;
00704 case 'VIEWS':
00705 ?>
00706 <div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
00707 <h5><?php $this->msg('views') ?></h5>
00708 <ul<?php $this->html('userlangattributes') ?>>
00709 <?php foreach ($this->data['view_urls'] as $key => $link ): ?>
00710 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo (array_key_exists('img',$link) ? '<img src="'.$link['img'].'" alt="'.$link['text'].'" />' : '<span>'.htmlspecialchars( $link['text'] ).'</span>') ?></a></li>
00711 <?php endforeach; ?>
00712 </ul>
00713 </div>
00714 <?php
00715 break;
00716 case 'ACTIONS':
00717 ?>
00718 <div id="p-cactions" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
00719 <h5><span><?php $this->msg('actions') ?></span><a href="#"></a></h5>
00720 <div class="menu">
00721 <ul<?php $this->html('userlangattributes') ?>>
00722 <?php foreach ($this->data['action_urls'] as $key => $link ): ?>
00723 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
00724 <?php endforeach; ?>
00725 </ul>
00726 </div>
00727 </div>
00728 <?php
00729 break;
00730 case 'PERSONAL':
00731 ?>
00732 <div id="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
00733 <h5><?php $this->msg('personaltools') ?></h5>
00734 <ul<?php $this->html('userlangattributes') ?>>
00735 <?php foreach($this->data['personal_urls'] as $key => $item): ?>
00736 <li <?php echo $item['attributes'] ?>><a href="<?php echo htmlspecialchars($item['href']) ?>"<?php echo $item['key'] ?><?php if(!empty($item['class'])): ?> class="<?php echo htmlspecialchars($item['class']) ?>"<?php endif; ?>><?php echo htmlspecialchars($item['text']) ?></a></li>
00737 <?php endforeach; ?>
00738 </ul>
00739 </div>
00740 <?php
00741 break;
00742 case 'SEARCH':
00743 ?>
00744 <div id="p-search">
00745 <h5<?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5>
00746 <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform">
00747 <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/>
00748 <?php if ( $wgVectorUseSimpleSearch ): ?>
00749 <div id="simpleSearch">
00750 <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> />
00751 <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>> </button>
00752 </div>
00753 <?php else: ?>
00754 <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> />
00755 <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg( 'searcharticle' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> />
00756 <input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg( 'searchbutton' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> />
00757 <?php endif; ?>
00758 </form>
00759 </div>
00760 <?php
00761
00762 break;
00763 }
00764 echo "\n<!-- /{$name} -->\n";
00765 }
00766 }
00767 }