Index: trunk/phase3/skins/Vector.php |
— | — | @@ -341,29 +341,29 @@ |
342 | 342 | * @ingroup Skins |
343 | 343 | */ |
344 | 344 | class VectorTemplate extends QuickTemplate { |
345 | | - |
| 345 | + |
346 | 346 | /* Members */ |
347 | | - |
| 347 | + |
348 | 348 | /** |
349 | 349 | * @var Cached skin object |
350 | 350 | */ |
351 | 351 | var $skin; |
352 | | - |
| 352 | + |
353 | 353 | /* Functions */ |
354 | | - |
| 354 | + |
355 | 355 | /** |
356 | 356 | * Outputs the entire contents of the XHTML page |
357 | 357 | */ |
358 | 358 | public function execute() { |
359 | | - global $wgRequest, $wgUseTwoButtonsSearchForm, $wgOut; |
360 | | - |
| 359 | + global $wgRequest, $wgOut, $wgContLang; |
| 360 | + |
361 | 361 | $this->skin = $this->data['skin']; |
362 | 362 | $action = $wgRequest->getText( 'action' ); |
363 | | - |
| 363 | + |
364 | 364 | // Suppress warnings to prevent notices about missing indexes in |
365 | 365 | // $this->data (is this really the best way to handle this?) |
366 | 366 | wfSuppressWarnings(); |
367 | | - |
| 367 | + |
368 | 368 | // Build additional attributes for navigation urls |
369 | 369 | $nav = $this->skin->buildNavigationUrls(); |
370 | 370 | foreach ( $nav as $section => $links ) { |
— | — | @@ -383,12 +383,11 @@ |
384 | 384 | ' class="' . htmlspecialchars( $link['class'] ) . '"'; |
385 | 385 | unset( $nav[$section][$key]['class'] ); |
386 | 386 | } |
387 | | - |
388 | | - // We don't want to give the watch tab an accesskey if the page is |
389 | | - // being edited, because that conflicts with the accesskey on the |
390 | | - // watch checkbox. We also don't want to give the edit tab an |
391 | | - // accesskey, because that's fairly superfluous and conflicts with |
392 | | - // an accesskey (Ctrl-E) often used for editing in Safari. |
| 387 | + // We don't want to give the watch tab an accesskey if the page |
| 388 | + // is being edited, because that conflicts with the accesskey on |
| 389 | + // the watch checkbox. We also don't want to give the edit tab |
| 390 | + // an accesskey, because that's fairly superfluous and conflicts |
| 391 | + // with an accesskey (Ctrl-E) often used for editing in Safari. |
393 | 392 | if ( |
394 | 393 | in_array( $action, array( 'edit', 'submit' ) ) && |
395 | 394 | in_array( $key, array( 'edit', 'watch', 'unwatch' ) ) |
— | — | @@ -405,7 +404,6 @@ |
406 | 405 | $this->data['view_urls'] = $nav['views']; |
407 | 406 | $this->data['action_urls'] = $nav['actions']; |
408 | 407 | $this->data['variant_urls'] = $nav['variants']; |
409 | | - |
410 | 408 | // Build additional attributes for personal_urls |
411 | 409 | foreach ( $this->data['personal_urls'] as $key => $item) { |
412 | 410 | $this->data['personal_urls'][$key]['attributes'] = |
— | — | @@ -417,7 +415,7 @@ |
418 | 416 | $this->data['personal_urls'][$key]['key'] = |
419 | 417 | $this->skin->tooltipAndAccesskey('pt-'.$key); |
420 | 418 | } |
421 | | - |
| 419 | + |
422 | 420 | // Generate additional footer links |
423 | 421 | $footerlinks = array( |
424 | 422 | 'info' => array( |
— | — | @@ -434,8 +432,7 @@ |
435 | 433 | 'disclaimer', |
436 | 434 | ), |
437 | 435 | ); |
438 | | - |
439 | | - // Build list of valid footer links |
| 436 | + // Reduce footer links down to only those which are being used |
440 | 437 | $validFooterLinks = array(); |
441 | 438 | foreach( $footerlinks as $category => $links ) { |
442 | 439 | $validFooterLinks[$category] = array(); |
— | — | @@ -445,58 +442,72 @@ |
446 | 443 | } |
447 | 444 | } |
448 | 445 | } |
449 | | - |
450 | | - // Begin content output |
451 | | - |
| 446 | + // Reverse horizontally rendered navigation elements |
| 447 | + if ( $wgContLang->isRTL() ) { |
| 448 | + $this->data['view_urls'] = |
| 449 | + array_reverse( $this->data['view_urls'] ); |
| 450 | + $this->data['namespace_urls'] = |
| 451 | + array_reverse( $this->data['namespace_urls'] ); |
| 452 | + $this->data['personal_urls'] = |
| 453 | + array_reverse( $this->data['personal_urls'] ); |
| 454 | + } |
| 455 | + // Output HTML Page |
452 | 456 | echo $wgOut->headElement( $this->skin ); |
453 | | -?> <body<?php if($this->data['body_ondblclick']): ?> ondblclick="<?php $this->text('body_ondblclick') ?>"<?php endif; ?> <?php if($this->data['body_onload']): ?> onload="<?php $this->text('body_onload') ?>"<?php endif; ?> class="mediawiki <?php $this->text('dir') ?> <?php $this->text('pageclass') ?> <?php $this->text('skinnameclass') ?>"> |
| 457 | +?> |
| 458 | + <body<?php if ( $this->data['body_ondblclick'] ): ?> ondblclick="<?php $this->text( 'body_ondblclick' ) ?>"<?php endif; ?> <?php if ( $this->data['body_onload'] ): ?> onload="<?php $this->text( 'body_onload' ) ?>"<?php endif; ?> class="mediawiki <?php $this->text( 'dir' ) ?> <?php $this->text( 'pageclass' ) ?> <?php $this->text( 'skinnameclass' ) ?>" dir="<?php $this->text( 'dir' ) ?>"> |
454 | 459 | <div id="page-base" class="noprint"></div> |
455 | 460 | <div id="head-base" class="noprint"></div> |
456 | 461 | <!-- content --> |
457 | 462 | <div id="content"> |
458 | 463 | <a id="top"></a> |
459 | 464 | <div id="mw-js-message" style="display:none;"></div> |
| 465 | + <?php if ( $this->data['sitenotice'] ): ?> |
460 | 466 | <!-- sitenotice --> |
461 | | - <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?> |
| 467 | + <div id="siteNotice"><?php $this->html( 'sitenotice' ) ?></div> |
462 | 468 | <!-- /sitenotice --> |
| 469 | + <?php endif; ?> |
463 | 470 | <!-- firstHeading --> |
464 | | - <h1 id="firstHeading" class="firstHeading"><?php $this->html('title') ?></h1> |
| 471 | + <h1 id="firstHeading" class="firstHeading"><?php $this->html( 'title' ) ?></h1> |
465 | 472 | <!-- /firstHeading --> |
466 | 473 | <!-- bodyContent --> |
467 | 474 | <div id="bodyContent"> |
468 | 475 | <!-- tagline --> |
469 | | - <h3 id="siteSub"><?php $this->msg('tagline') ?></h3> |
| 476 | + <h3 id="siteSub"><?php $this->msg( 'tagline' ) ?></h3> |
470 | 477 | <!-- /tagline --> |
471 | 478 | <!-- subtitle --> |
472 | | - <div id="contentSub"><?php $this->html('subtitle') ?></div> |
| 479 | + <div id="contentSub"><?php $this->html( 'subtitle' ) ?></div> |
473 | 480 | <!-- /subtitle --> |
474 | | - <?php if($this->data['undelete']): ?> |
| 481 | + <?php if ( $this->data['undelete'] ): ?> |
475 | 482 | <!-- undelete --> |
476 | | - <div id="contentSub2"><?php $this->html('undelete') ?></div> |
| 483 | + <div id="contentSub2"><?php $this->html( 'undelete' ) ?></div> |
477 | 484 | <!-- /undelete --> |
478 | 485 | <?php endif; ?> |
479 | 486 | <?php if($this->data['newtalk'] ): ?> |
480 | 487 | <!-- newtalk --> |
481 | | - <div class="usermessage"><?php $this->html('newtalk') ?></div> |
| 488 | + <div class="usermessage"><?php $this->html( 'newtalk' ) ?></div> |
482 | 489 | <!-- /newtalk --> |
483 | 490 | <?php endif; ?> |
484 | | - <?php if($this->data['showjumplinks']): ?> |
| 491 | + <?php if ( $this->data['showjumplinks'] ): ?> |
485 | 492 | <!-- jumpto --> |
486 | 493 | <div id="jump-to-nav"> |
487 | | - <?php $this->msg('jumpto') ?> <a href="#head"><?php $this->msg('jumptonavigation') ?></a>, |
488 | | - <a href="#search"><?php $this->msg('jumptosearch') ?></a> |
| 494 | + <?php $this->msg( 'jumpto' ) ?><a href="#head"><?php $this->msg( 'jumptonavigation' ) ?></a>, |
| 495 | + <a href="#search"><?php $this->msg( 'jumptosearch' ) ?></a> |
489 | 496 | </div> |
490 | 497 | <!-- /jumpto --> |
491 | 498 | <?php endif; ?> |
492 | 499 | <!-- bodytext --> |
493 | | - <?php $this->html('bodytext') ?> |
| 500 | + <?php $this->html( 'bodytext' ) ?> |
494 | 501 | <!-- /bodytext --> |
| 502 | + <?php if ( $this->data['catlinks'] ): ?> |
495 | 503 | <!-- catlinks --> |
496 | | - <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?> |
| 504 | + <?php $this->html( 'catlinks' ); ?> |
497 | 505 | <!-- /catlinks --> |
| 506 | + <?php endif; ?> |
| 507 | + <?php if ( $this->data['dataAfterContent'] ): ?> |
498 | 508 | <!-- dataAfterContent --> |
499 | | - <?php if($this->data['dataAfterContent']) { $this->html('dataAfterContent'); } ?> |
| 509 | + <?php $this->html( 'dataAfterContent' ); ?> |
500 | 510 | <!-- /dataAfterContent --> |
| 511 | + <?php endif; ?> |
501 | 512 | <div class="visualClear"></div> |
502 | 513 | </div> |
503 | 514 | <!-- /bodyContent --> |
— | — | @@ -504,118 +515,20 @@ |
505 | 516 | <!-- /content --> |
506 | 517 | <!-- header --> |
507 | 518 | <div id="head" class="noprint"> |
508 | | - <!-- personal --> |
509 | | - <?php if ( count( $this->data['personal_urls'] ) > 0 ): ?> |
510 | | - <div id="p-personal"> |
511 | | - <h5><?php $this->msg('personaltools') ?></h5> |
512 | | - <ul <?php $this->html('userlangattributes') ?>> |
513 | | - <?php foreach($this->data['personal_urls'] as $key => $item): ?> |
514 | | - <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> |
515 | | - <?php endforeach; ?> |
516 | | - </ul> |
517 | | - </div> |
518 | | - <?php endif; ?> |
519 | | - <!-- /personal --> |
| 519 | + <?php $this->renderNavigation( 'PERSONAL' ); ?> |
520 | 520 | <div id="left-navigation"> |
521 | | - <!-- namespaces --> |
522 | | - <?php if ( count( $this->data['namespace_urls'] ) > 0 ): ?> |
523 | | - <div id="namespaces" class="vectorTabs"> |
524 | | - <h5><?php $this->msg('namespaces') ?></h5> |
525 | | - <ul <?php $this->html('userlangattributes') ?>> |
526 | | - <?php foreach ($this->data['namespace_urls'] as $key => $link ): ?> |
527 | | - <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> |
528 | | - <?php endforeach; ?> |
529 | | - </ul> |
530 | | - </div> |
531 | | - <?php endif; ?> |
532 | | - <!-- /namespaces --> |
533 | | - <!-- variants --> |
534 | | - <?php if ( count( $this->data['variant_urls'] ) > 0 ): ?> |
535 | | - <div id="variants" class="vectorMenu"> |
536 | | - <h5><span><?php $this->msg('variants') ?></span><a href="#"> </a></h5> |
537 | | - <div class="menu"> |
538 | | - <ul <?php $this->html('userlangattributes') ?>> |
539 | | - <?php foreach ($this->data['variant_urls'] as $key => $link ): ?> |
540 | | - <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li> |
541 | | - <?php endforeach; ?> |
542 | | - </ul> |
543 | | - </div> |
544 | | - </div> |
545 | | - <?php endif; ?> |
546 | | - <!-- /variants --> |
| 521 | + <?php $this->renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?> |
547 | 522 | </div> |
548 | 523 | <div id="right-navigation"> |
549 | | - <!-- views --> |
550 | | - <?php if ( count( $this->data['view_urls'] ) > 0 ): ?> |
551 | | - <div id="views" class="vectorTabs"> |
552 | | - <h5><?php $this->msg('views') ?></h5> |
553 | | - <ul <?php $this->html('userlangattributes') ?>> |
554 | | - <?php foreach ($this->data['view_urls'] as $key => $link ): ?> |
555 | | - <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> |
556 | | - <?php endforeach; ?> |
557 | | - </ul> |
558 | | - </div> |
559 | | - <?php endif; ?> |
560 | | - <!-- /views --> |
561 | | - <!-- actions --> |
562 | | - <?php if ( count( $this->data['action_urls'] ) > 0 ): ?> |
563 | | - <div id="p-cactions" class="vectorMenu"> |
564 | | - <h5><span><?php $this->msg('actions') ?></span><a href="#"> </a></h5> |
565 | | - <div class="menu"> |
566 | | - <ul <?php $this->html('userlangattributes') ?>> |
567 | | - <?php foreach ($this->data['action_urls'] as $key => $link ): ?> |
568 | | - <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li> |
569 | | - <?php endforeach; ?> |
570 | | - </ul> |
571 | | - </div> |
572 | | - </div> |
573 | | - <?php endif; ?> |
574 | | - <!-- /actions --> |
575 | | - <!-- search --> |
576 | | - <div id="p-search"> |
577 | | - <h5 <?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5> |
578 | | - <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform"> |
579 | | - <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/> |
580 | | - <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; ?> /> |
581 | | - <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg( 'searcharticle' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> /> |
582 | | - <?php if ( $wgUseTwoButtonsSearchForm ): ?> |
583 | | - <input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg( 'searchbutton' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> /> |
584 | | - <?php else: ?> |
585 | | - <div><a href="<?php $this->text( 'searchaction' ) ?>" rel="search"><?php $this->msg( 'powersearch-legend' ) ?></a></div> |
586 | | - <?php endif; ?> |
587 | | - </form> |
588 | | - </div> |
589 | | - <!-- /search --> |
| 524 | + <?php $this->renderNavigation( array( 'VIEWS', 'ACTIONS', 'SEARCH' ) ); ?> |
590 | 525 | </div> |
591 | 526 | </div> |
592 | 527 | <!-- /header --> |
593 | 528 | <!-- panel --> |
594 | | - <div id="panel" class="noprint"> |
595 | | - <!-- sidebar --> |
596 | | - <?php |
597 | | - $sidebar = $this->data['sidebar']; |
598 | | - $sidebar['TOOLBOX'] = ( !isset( $sidebar['TOOLBOX'] ) ); |
599 | | - $sidebar['LANGUAGES'] = ( !isset( $sidebar['LANGUAGES'] ) ); |
600 | | - foreach ( $sidebar as $name => $content ) { |
601 | | - switch( $name ) { |
602 | | - case 'SEARCH': |
603 | | - break; |
604 | | - case 'TOOLBOX': |
605 | | - $this->toolBox(); |
606 | | - break; |
607 | | - case 'LANGUAGES': |
608 | | - $this->languageBox(); |
609 | | - break; |
610 | | - default: |
611 | | - $this->customBox( $name, $content ); |
612 | | - break; |
613 | | - } |
614 | | - } |
615 | | - ?> |
616 | | - <!-- /sidebar --> |
617 | | - </div> |
| 529 | + <div id="panel" class="noprint"> |
| 530 | + <?php $this->renderPortals( $this->data['sidebar'] ); ?> |
| 531 | + </div> |
618 | 532 | <!-- /panel --> |
619 | | - <div class="break"></div> |
620 | 533 | <!-- foot --> |
621 | 534 | <div id="foot"> |
622 | 535 | <?php foreach( $validFooterLinks as $category => $links ): ?> |
— | — | @@ -630,10 +543,10 @@ |
631 | 544 | <?php endif; ?> |
632 | 545 | <?php endforeach; ?> |
633 | 546 | <ul id="foot-icons" class="noprint"> |
634 | | - <?php if( $this->data['poweredbyico'] ): ?> |
| 547 | + <?php if ( $this->data['poweredbyico'] ): ?> |
635 | 548 | <li id="foot-icon-poweredby"><?php $this->html( 'poweredbyico' ) ?></li> |
636 | 549 | <?php endif; ?> |
637 | | - <?php if( $this->data['copyrightico'] ): ?> |
| 550 | + <?php if ( $this->data['copyrightico'] ): ?> |
638 | 551 | <li id="foot-icon-copyright"><?php $this->html( 'copyrightico' ) ?></li> |
639 | 552 | <?php endif; ?> |
640 | 553 | </ul> |
— | — | @@ -641,19 +554,15 @@ |
642 | 555 | </div> |
643 | 556 | <!-- /foot --> |
644 | 557 | <!-- logo --> |
645 | | - <div id="p-logo"> |
646 | | - <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> |
647 | | - </div> |
| 558 | + <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> |
648 | 559 | <!-- /logo --> |
649 | 560 | <!-- fixalpha --> |
650 | | - <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha( 'p-logo' ); </script> |
| 561 | + <script type="<?php $this->text('jsmimetype') ?>"> if ( window.isMSIE55 ) fixalpha(); </script> |
651 | 562 | <!-- /fixalpha --> |
652 | 563 | <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?> |
653 | 564 | <?php $this->html( 'reporttime' ) ?> |
654 | 565 | <?php if ( $this->data['debug'] ): ?> |
655 | | - <!-- Debug output: |
656 | | - <?php $this->text( 'debug' ); ?> |
657 | | - --> |
| 566 | + <!-- Debug output: <?php $this->text( 'debug' ); ?> --> |
658 | 567 | <?php endif; ?> |
659 | 568 | </body> |
660 | 569 | </html> |
— | — | @@ -661,58 +570,65 @@ |
662 | 571 | // We're done with abusing arrays now... |
663 | 572 | wfRestoreWarnings(); |
664 | 573 | } |
665 | | - |
| 574 | + |
666 | 575 | /** |
667 | | - * Outputs a box with a list of tools |
| 576 | + * Render a series of portals |
668 | 577 | */ |
669 | | - private function toolBox() { |
| 578 | + private function renderPortals( $portals ) { |
| 579 | + // Force the rendering of the following portals |
| 580 | + if ( !isset( $portals['SEARCH'] ) ) $portals['SEARCH'] = true; |
| 581 | + if ( !isset( $portals['TOOLBOX'] ) ) $portals['TOOLBOX'] = true; |
| 582 | + if ( !isset( $portals['LANGUAGES'] ) ) $portals['LANGUAGES'] = true; |
| 583 | + // Render portals |
| 584 | + foreach ( $portals as $name => $content ) { |
| 585 | + echo "\n<!-- {$name} -->\n"; |
| 586 | + switch( $name ) { |
| 587 | + case 'SEARCH': |
| 588 | + break; |
| 589 | + case 'TOOLBOX': |
670 | 590 | ?> |
671 | | - <div class="portal" id="p-tb"> |
672 | | - <h5 <?php $this->html('userlangattributes') ?>><?php $this->msg( 'toolbox' ) ?></h5> |
673 | | - <div class="body"> |
674 | | - <ul> |
675 | | - <?php if( $this->data['notspecialpage'] ): ?> |
676 | | - <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> |
677 | | - <?php if( $this->data['nav_urls']['recentchangeslinked'] ): ?> |
678 | | - <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> |
679 | | - <?php endif; ?> |
| 591 | +<div class="portal" id="p-tb"> |
| 592 | + <h5 <?php $this->html('userlangattributes') ?>><?php $this->msg( 'toolbox' ) ?></h5> |
| 593 | + <div class="body"> |
| 594 | + <ul> |
| 595 | + <?php if( $this->data['notspecialpage'] ): ?> |
| 596 | + <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> |
| 597 | + <?php if( $this->data['nav_urls']['recentchangeslinked'] ): ?> |
| 598 | + <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> |
680 | 599 | <?php endif; ?> |
681 | | - <?php if( isset( $this->data['nav_urls']['trackbacklink'] ) ): ?> |
682 | | - <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> |
683 | | - <?php endif; ?> |
684 | | - <?php if( $this->data['feeds']): ?> |
685 | | - <li id="feedlinks"> |
686 | | - <?php foreach( $this->data['feeds'] as $key => $feed ): ?> |
687 | | - <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> |
688 | | - <?php endforeach; ?> |
689 | | - </li> |
690 | | - <?php endif; ?> |
691 | | - <?php foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ): ?> |
692 | | - <?php if( $this->data['nav_urls'][$special]): ?> |
693 | | - <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> |
694 | | - <?php endif; ?> |
| 600 | + <?php endif; ?> |
| 601 | + <?php if( isset( $this->data['nav_urls']['trackbacklink'] ) ): ?> |
| 602 | + <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> |
| 603 | + <?php endif; ?> |
| 604 | + <?php if( $this->data['feeds']): ?> |
| 605 | + <li id="feedlinks"> |
| 606 | + <?php foreach( $this->data['feeds'] as $key => $feed ): ?> |
| 607 | + <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> |
695 | 608 | <?php endforeach; ?> |
696 | | - <?php if( !empty( $this->data['nav_urls']['print']['href'] ) ): ?> |
697 | | - <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> |
| 609 | + </li> |
| 610 | + <?php endif; ?> |
| 611 | + <?php foreach( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ): ?> |
| 612 | + <?php if( $this->data['nav_urls'][$special]): ?> |
| 613 | + <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> |
698 | 614 | <?php endif; ?> |
699 | | - <?php if ( !empty( $this->data['nav_urls']['permalink']['href'] ) ): ?> |
700 | | - <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> |
701 | | - <?php elseif ( $this->data['nav_urls']['permalink']['href'] === '' ): ?> |
702 | | - <li id="t-ispermalink"<?php echo $this->skin->tooltip( 't-ispermalink' ) ?>><?php $this->msg( 'permalink' ) ?></li> |
703 | | - <?php endif; ?> |
704 | | - <?php wfRunHooks( 'VectorTemplateToolboxEnd', array( &$this ) ); ?> |
705 | | - <?php wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?> |
706 | | - </ul> |
707 | | - </div> |
| 615 | + <?php endforeach; ?> |
| 616 | + <?php if( !empty( $this->data['nav_urls']['print']['href'] ) ): ?> |
| 617 | + <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> |
| 618 | + <?php endif; ?> |
| 619 | + <?php if ( !empty( $this->data['nav_urls']['permalink']['href'] ) ): ?> |
| 620 | + <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> |
| 621 | + <?php elseif ( $this->data['nav_urls']['permalink']['href'] === '' ): ?> |
| 622 | + <li id="t-ispermalink"<?php echo $this->skin->tooltip( 't-ispermalink' ) ?>><?php $this->msg( 'permalink' ) ?></li> |
| 623 | + <?php endif; ?> |
| 624 | + <?php wfRunHooks( 'VectorTemplateToolboxEnd', array( &$this ) ); ?> |
| 625 | + <?php wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this ) ); ?> |
| 626 | + </ul> |
708 | 627 | </div> |
| 628 | +</div> |
709 | 629 | <?php |
710 | | - } |
711 | | - |
712 | | - /** |
713 | | - * Outputs a box with a list of alternative languages for this page |
714 | | - */ |
715 | | - private function languageBox() { |
716 | | - if( $this->data['language_urls'] ) { |
| 630 | + break; |
| 631 | + case 'LANGUAGES': |
| 632 | + if ( $this->data['language_urls'] ) { |
717 | 633 | ?> |
718 | 634 | <div class="portal" id="p-lang"> |
719 | 635 | <h5 <?php $this->html('userlangattributes') ?>><?php $this->msg( 'otherlanguages' ) ?></h5> |
— | — | @@ -725,18 +641,12 @@ |
726 | 642 | </div> |
727 | 643 | </div> |
728 | 644 | <?php |
729 | | - } |
730 | | - } |
731 | | - |
732 | | - /** |
733 | | - * Outputs a box with a custom list of items or HTML content |
734 | | - * @param string $bar Message name for title of box |
735 | | - * @param mixed $content HTML or array of items to build a list from |
736 | | - */ |
737 | | - private function customBox( $bar, $content ) { |
| 645 | + } |
| 646 | + break; |
| 647 | + default: |
738 | 648 | ?> |
739 | | -<div class="portal" id='<?php echo Sanitizer::escapeId( "p-$bar" ) ?>'<?php echo $this->skin->tooltip( 'p-' . $bar ) ?>> |
740 | | - <h5 <?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $bar ); if ( wfEmptyMsg( $bar, $out ) ) echo htmlspecialchars( $bar ); else echo htmlspecialchars( $out ); ?></h5> |
| 649 | +<div class="portal" id='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php echo $this->skin->tooltip( 'p-' . $name ) ?>> |
| 650 | + <h5 <?php $this->html('userlangattributes') ?>><?php $out = wfMsg( $name ); if ( wfEmptyMsg( $name, $out ) ) echo htmlspecialchars( $name ); else echo htmlspecialchars( $out ); ?></h5> |
741 | 651 | <div class="body"> |
742 | 652 | <?php if ( is_array( $content ) ): ?> |
743 | 653 | <ul> |
— | — | @@ -750,5 +660,124 @@ |
751 | 661 | </div> |
752 | 662 | </div> |
753 | 663 | <?php |
| 664 | + break; |
| 665 | + } |
| 666 | + echo "\n<!-- /{$name} -->\n"; |
| 667 | + } |
754 | 668 | } |
| 669 | + |
| 670 | + /** |
| 671 | + * Render one or more navigations elements by name, automatically reveresed |
| 672 | + * when UI is in RTL mode |
| 673 | + */ |
| 674 | + private function renderNavigation( $elements ) { |
| 675 | + global $wgContLang, $wgUseTwoButtonsSearchForm; |
| 676 | + |
| 677 | + // If only one element was given, wrap it in an array, allowing more |
| 678 | + // flexible arguments |
| 679 | + if ( !is_array( $elements ) ) { |
| 680 | + $elements = array( $elements ); |
| 681 | + // If there's a series of elements, reverse them when in RTL mode |
| 682 | + } else if ( $wgContLang->isRTL() ) { |
| 683 | + $elements = array_reverse( $elements ); |
| 684 | + } |
| 685 | + // Render elements |
| 686 | + foreach ( $elements as $name => $element ) { |
| 687 | + echo "\n<!-- {$name} -->\n"; |
| 688 | + switch ( $element ) { |
| 689 | + case 'NAMESPACES': |
| 690 | + if ( count( $this->data[ 'namespace_urls' ] ) > 0 ) { |
| 691 | +?> |
| 692 | +<div id="namespaces" class="vectorTabs"> |
| 693 | + <h5><?php $this->msg('namespaces') ?></h5> |
| 694 | + <ul <?php $this->html('userlangattributes') ?>> |
| 695 | + <?php foreach ($this->data['namespace_urls'] as $key => $link ): ?> |
| 696 | + <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> |
| 697 | + <?php endforeach; ?> |
| 698 | + </ul> |
| 699 | +</div> |
| 700 | +<?php |
| 701 | + } |
| 702 | + break; |
| 703 | + case 'VARIANTS': |
| 704 | + if ( count( $this->data[ 'variant_urls' ] ) > 0 ) { |
| 705 | +?> |
| 706 | +<div id="variants" class="vectorMenu"> |
| 707 | + <h5><span><?php $this->msg('variants') ?></span><a href="#"> </a></h5> |
| 708 | + <div class="menu"> |
| 709 | + <ul <?php $this->html('userlangattributes') ?>> |
| 710 | + <?php foreach ($this->data['variant_urls'] as $key => $link ): ?> |
| 711 | + <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li> |
| 712 | + <?php endforeach; ?> |
| 713 | + </ul> |
| 714 | + </div> |
| 715 | +</div> |
| 716 | +<?php |
| 717 | + } |
| 718 | + break; |
| 719 | + case 'VIEWS': |
| 720 | + if ( count( $this->data[ 'view_urls' ] ) > 0 ) { |
| 721 | +?> |
| 722 | +<div id="views" class="vectorTabs"> |
| 723 | + <h5><?php $this->msg('views') ?></h5> |
| 724 | + <ul <?php $this->html('userlangattributes') ?>> |
| 725 | + <?php foreach ($this->data['view_urls'] as $key => $link ): ?> |
| 726 | + <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> |
| 727 | + <?php endforeach; ?> |
| 728 | + </ul> |
| 729 | +</div> |
| 730 | +<?php |
| 731 | + } |
| 732 | + break; |
| 733 | + case 'ACTIONS': |
| 734 | + if ( count( $this->data[ 'action_urls' ] ) > 0 ) { |
| 735 | +?> |
| 736 | +<div id="p-cactions" class="vectorMenu"> |
| 737 | + <h5><span><?php $this->msg('actions') ?></span><a href="#"> </a></h5> |
| 738 | + <div class="menu"> |
| 739 | + <ul <?php $this->html('userlangattributes') ?>> |
| 740 | + <?php foreach ($this->data['action_urls'] as $key => $link ): ?> |
| 741 | + <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li> |
| 742 | + <?php endforeach; ?> |
| 743 | + </ul> |
| 744 | + </div> |
| 745 | +</div> |
| 746 | +<?php |
| 747 | + } |
| 748 | + break; |
| 749 | + case 'PERSONAL': |
| 750 | + if ( count( $this->data['personal_urls'] ) > 0 ) { |
| 751 | +?> |
| 752 | +<div id="p-personal"> |
| 753 | + <h5><?php $this->msg('personaltools') ?></h5> |
| 754 | + <ul <?php $this->html('userlangattributes') ?>> |
| 755 | + <?php foreach($this->data['personal_urls'] as $key => $item): ?> |
| 756 | + <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> |
| 757 | + <?php endforeach; ?> |
| 758 | + </ul> |
| 759 | +</div> |
| 760 | +<?php |
| 761 | + } |
| 762 | + break; |
| 763 | + case 'SEARCH': |
| 764 | +?> |
| 765 | +<div id="p-search"> |
| 766 | + <h5 <?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5> |
| 767 | + <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform"> |
| 768 | + <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/> |
| 769 | + <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; ?> /> |
| 770 | + <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg( 'searcharticle' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> /> |
| 771 | + <?php if ( $wgUseTwoButtonsSearchForm ): ?> |
| 772 | + <input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg( 'searchbutton' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> /> |
| 773 | + <?php else: ?> |
| 774 | + <div><a href="<?php $this->text( 'searchaction' ) ?>" rel="search"><?php $this->msg( 'powersearch-legend' ) ?></a></div> |
| 775 | + <?php endif; ?> |
| 776 | + </form> |
| 777 | +</div> |
| 778 | +<?php |
| 779 | + break; |
| 780 | + } |
| 781 | + echo "\n<!-- /{$name} -->\n"; |
| 782 | + } |
| 783 | + } |
755 | 784 | } |
Index: trunk/phase3/skins/vector/main-ltr.css |
— | — | @@ -76,8 +76,11 @@ |
77 | 77 | margin: 0; |
78 | 78 | padding: 0; |
79 | 79 | } |
| 80 | + /* @noflip */ |
80 | 81 | div#p-personal li { |
81 | 82 | float: left; |
| 83 | + } |
| 84 | + div#p-personal li { |
82 | 85 | margin-left: 0.75em; |
83 | 86 | margin-top: 0.5em; |
84 | 87 | font-size: 0.9em; |
— | — | @@ -98,24 +101,33 @@ |
99 | 102 | display: none; |
100 | 103 | } |
101 | 104 | /* Namespaces and Views */ |
| 105 | + /* @noflip */ |
102 | 106 | div.vectorTabs { |
103 | 107 | float: left; |
| 108 | + } |
| 109 | + div.vectorTabs { |
104 | 110 | background-image: url(images/tab-break.png); |
105 | 111 | background-position: bottom left; |
106 | 112 | background-repeat: no-repeat; |
107 | 113 | padding-left: 1px; |
108 | 114 | } |
| 115 | + /* @noflip */ |
109 | 116 | div.vectorTabs ul { |
110 | 117 | float: left; |
| 118 | + } |
| 119 | + div.vectorTabs ul { |
111 | 120 | height: 100%; |
112 | 121 | list-style: none; |
113 | 122 | margin: 0; |
114 | 123 | padding: 0; |
115 | 124 | } |
| 125 | + /* @noflip */ |
| 126 | + div.vectorTabs ul li { |
| 127 | + float: left; |
| 128 | + } |
116 | 129 | /* OVERRIDDEN BY COMPLIANT BROWSERS */ |
117 | 130 | div.vectorTabs ul li { |
118 | 131 | display: inline-block; |
119 | | - float: left; |
120 | 132 | height: 100%; |
121 | 133 | margin: 0; |
122 | 134 | padding: 0; |
— | — | @@ -175,8 +187,11 @@ |
176 | 188 | color: #a55858; |
177 | 189 | } |
178 | 190 | /* Variants and Actions */ |
| 191 | + /* @noflip */ |
179 | 192 | div.vectorMenu { |
180 | 193 | float: left; |
| 194 | + } |
| 195 | + div.vectorMenu { |
181 | 196 | background-image: url(images/arrow-down-icon.png); |
182 | 197 | background-position: center center; |
183 | 198 | background-repeat: no-repeat; |
— | — | @@ -232,8 +247,11 @@ |
233 | 248 | div#p-search h5 { |
234 | 249 | display: none; |
235 | 250 | } |
| 251 | + /* @noflip */ |
236 | 252 | div#p-search { |
237 | 253 | float: left; |
| 254 | + } |
| 255 | + div#p-search { |
238 | 256 | margin-right: 0.75em; |
239 | 257 | } |
240 | 258 | div#p-search form, |
Index: trunk/phase3/skins/vector/main-rtl.css |
— | — | @@ -76,8 +76,11 @@ |
77 | 77 | margin: 0; |
78 | 78 | padding: 0; |
79 | 79 | } |
| 80 | + /* @noflip */ |
80 | 81 | div#p-personal li { |
81 | | - float: right; |
| 82 | + float: left; |
| 83 | + } |
| 84 | + div#p-personal li { |
82 | 85 | margin-right: 0.75em; |
83 | 86 | margin-top: 0.5em; |
84 | 87 | font-size: 0.9em; |
— | — | @@ -98,24 +101,33 @@ |
99 | 102 | display: none; |
100 | 103 | } |
101 | 104 | /* Namespaces and Views */ |
| 105 | + /* @noflip */ |
102 | 106 | div.vectorTabs { |
103 | | - float: right; |
| 107 | + float: left; |
| 108 | + } |
| 109 | + div.vectorTabs { |
104 | 110 | background-image: url(images/tab-break.png); |
105 | 111 | background-position: bottom right; |
106 | 112 | background-repeat: no-repeat; |
107 | 113 | padding-right: 1px; |
108 | 114 | } |
| 115 | + /* @noflip */ |
109 | 116 | div.vectorTabs ul { |
110 | | - float: right; |
| 117 | + float: left; |
| 118 | + } |
| 119 | + div.vectorTabs ul { |
111 | 120 | height: 100%; |
112 | 121 | list-style: none; |
113 | 122 | margin: 0; |
114 | 123 | padding: 0; |
115 | 124 | } |
| 125 | + /* @noflip */ |
| 126 | + div.vectorTabs ul li { |
| 127 | + float: left; |
| 128 | + } |
116 | 129 | /* OVERRIDDEN BY COMPLIANT BROWSERS */ |
117 | 130 | div.vectorTabs ul li { |
118 | 131 | display: inline-block; |
119 | | - float: right; |
120 | 132 | height: 100%; |
121 | 133 | margin: 0; |
122 | 134 | padding: 0; |
— | — | @@ -175,8 +187,11 @@ |
176 | 188 | color: #a55858; |
177 | 189 | } |
178 | 190 | /* Variants and Actions */ |
| 191 | + /* @noflip */ |
179 | 192 | div.vectorMenu { |
180 | | - float: right; |
| 193 | + float: left; |
| 194 | + } |
| 195 | + div.vectorMenu { |
181 | 196 | background-image: url(images/arrow-down-icon.png); |
182 | 197 | background-position: center center; |
183 | 198 | background-repeat: no-repeat; |
— | — | @@ -232,8 +247,11 @@ |
233 | 248 | div#p-search h5 { |
234 | 249 | display: none; |
235 | 250 | } |
| 251 | + /* @noflip */ |
236 | 252 | div#p-search { |
237 | | - float: right; |
| 253 | + float: left; |
| 254 | + } |
| 255 | + div#p-search { |
238 | 256 | margin-left: 0.75em; |
239 | 257 | } |
240 | 258 | div#p-search form, |