r56504 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56503‎ | r56504 | r56505 >
Date:12:20, 17 September 2009
Author:jojo
Status:ok
Tags:
Comment:
fix: do not show "stop page" when choosing cancel
Modified paths:
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.body.php
@@ -76,7 +76,6 @@
7777 CollectionSession::enable();
7878 $wgOut->redirect( $title->getFullURL() );
7979 return;
80 -
8180 case 'stop_book_creator':
8281 $title = Title::newFromText( $wgRequest->getVal( 'referer', '' ) );
8382 if ( is_null( $title ) || $title->equals( $wgTitle ) ) {
@@ -317,6 +316,8 @@
318317 function renderBookCreatorPage( $referer ) {
319318 global $wgOut;
320319 global $wgScriptPath;
 320+ global $wgTitle;
 321+ global $wgUser;
321322
322323 $this->setHeaders();
323324 $wgOut->setPageTitle( wfMsg( 'coll-book_creator' ) );
@@ -359,6 +360,12 @@
360361 EOS
361362 ;
362363
 364+ $title = Title::newFromText( $referer );
 365+ if ( is_null( $title ) || $title->equals( $wgTitle ) ) {
 366+ $title = Title::newMainPage();
 367+ }
 368+ $sk = $wgUser->getSkin();
 369+
363370 $wgOut->addHTML(
364371 Xml::tags( 'div',
365372 array(
@@ -386,18 +393,15 @@
387394 array(
388395 'class' => 'collection-button cancel',
389396 ),
390 - Xml::element( 'a',
 397+ $sk->link(
 398+ $title,
 399+ wfMsgHtml( 'coll-cancel' ),
391400 array(
392 - 'href' => SkinTemplate::makeSpecialUrl(
393 - 'Book',
394 - array(
395 - 'bookcmd' => 'stop_book_creator',
396 - 'referer' => $referer,
397 - )
398 - ),
399 - // TODO: title
 401+ 'rel' => 'nofollow',
 402+ // TOOD: title
400403 ),
401 - wfMsg( 'coll-cancel' )
 404+ array(),
 405+ array( 'known', 'noclasses' )
402406 )
403407 )
404408 . Xml::element( 'div',

Status & tagging log