r55750 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55749‎ | r55750 | r55751 >
Date:10:45, 2 September 2009
Author:jojo
Status:deferred
Tags:
Comment:
use fancy buttons on start book mode page
Modified paths:
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)
  • /trunk/extensions/Collection/Collection.i18n.php (modified) (history)
  • /trunk/extensions/Collection/images/cancel-button.png (added) (history)
  • /trunk/extensions/Collection/images/ok-button.png (added) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.i18n.php
@@ -25,7 +25,7 @@
2626
2727 $messages['en'] = array(
2828 'coll-desc' => '[[Special:Book|Create books]]',
29 - 'coll-book_mode_intro' => "With the ''book mode'' you can create a book consisting of arbitrary wiki pages. You can export your book in different formats (for example PDF or ODF) or order a printed copy.",
 29+ 'coll-book_mode_intro' => "<big>With the ''book mode'' you can create a book containing wiki pages of your choice. You can export the book in different formats (for example PDF or ODF) or order a printed copy.</big>",
3030 'coll-book_mode_help' => 'See [[{{MediaWiki:Coll-helppage}}|the help page about books]] for more information.',
3131 'coll-start_book_mode' => 'Start book mode',
3232 'coll-book_mode_text_article' => 'Book mode text',
Index: trunk/extensions/Collection/images/cancel-button.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/Collection/images/cancel-button.png
___________________________________________________________________
Name: svn:mime-type
3333 + image/png
Index: trunk/extensions/Collection/images/ok-button.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/extensions/Collection/images/ok-button.png
___________________________________________________________________
Name: svn:mime-type
3434 + image/png
Index: trunk/extensions/Collection/Collection.body.php
@@ -59,11 +59,7 @@
6060 if ( is_null( $title ) ) {
6161 $title = Title::newMainPage();
6262 }
63 - if ( $wgRequest->getVal( 'continue' ) ) {
64 - CollectionSession::enable();
65 - } else {
66 - CollectionSession::disable();
67 - }
 63+ CollectionSession::enable();
6864 $wgOut->redirect( $title->getFullURL() );
6965 return;
7066
@@ -277,47 +273,114 @@
278274
279275 function renderBookModePage( $referer ) {
280276 global $wgOut;
 277+ global $wgScriptPath;
281278
282279 $this->setHeaders();
283280 $wgOut->setPageTitle( wfMsg( 'coll-book_mode' ) );
284281
285282 $wgOut->addWikiMsg( 'coll-book_mode_intro' );
286283
 284+ $imagepath = "$wgScriptPath/extensions/Collection/images";
 285+
 286+ $wgOut->addInlineStyle(<<<EOS
 287+.collection-button {
 288+ float: left;
 289+ padding: 0 10px 0 14px;
 290+ height: 29px;
 291+}
 292+
 293+.collection-button.ok {
 294+ background: url($imagepath/ok-button.png) left top no-repeat;
 295+}
 296+
 297+.collection-button.okright {
 298+ background: url($imagepath/ok-button.png) right top no-repeat;
 299+ margin-right: 10px;
 300+ padding: 0;
 301+ width: 4px;
 302+}
 303+
 304+.collection-button.cancel {
 305+ background: url($imagepath/cancel-button.png) left top no-repeat;
 306+}
 307+
 308+.collection-button.cancelright {
 309+ background: url($imagepath/cancel-button.png) right top no-repeat;
 310+ padding: 0;
 311+ width: 4px;
 312+}
 313+
 314+.collection-button a {
 315+ display: block;
 316+ color: #fff;
 317+ font-size: 1.1em;
 318+ font-weight: bold;
 319+ line-height: 29px;
 320+}
 321+
 322+.collection-button a:hover {
 323+ text-decoration: none;
 324+}
 325+EOS
 326+ );
 327+
287328 $wgOut->addHTML(
288329 Xml::tags( 'div',
289330 array(
290331 'style' => 'margin: 10px 0;',
291332 ),
292 - Xml::tags( 'form',
 333+ Xml::tags( 'div',
293334 array(
294 - 'action' => SkinTemplate::makeSpecialUrlSubpage( 'Book', 'start_book_mode/' ),
295 - 'method' => 'post',
 335+ 'class' => 'collection-button ok',
296336 ),
297 - Xml::element( 'input',
 337+ Xml::element( 'a',
298338 array(
299 - 'type' => 'hidden',
300 - 'name' => 'referer',
301 - 'value' => $referer,
 339+ 'href' => SkinTemplate::makeSpecialUrlSubpage(
 340+ 'Book', 'start_book_mode/',
 341+ array(
 342+ 'referer' => $referer,
 343+ )
 344+ ),
 345+ // TODO: title
302346 ),
303 - '', false
 347+ wfMsg( 'coll-start_book_mode' )
304348 )
305 - . Xml::element( 'input',
 349+ )
 350+ . Xml::element( 'div',
 351+ array(
 352+ 'class' => 'collection-button okright',
 353+ ),
 354+ '', false
 355+ )
 356+ . Xml::tags( 'div',
 357+ array(
 358+ 'class' => 'collection-button cancel',
 359+ ),
 360+ Xml::element( 'a',
306361 array(
307 - 'type' => 'submit',
308 - 'name' => 'continue',
309 - 'value' => wfMsg( 'coll-start_book_mode' ),
 362+ 'href' => SkinTemplate::makeSpecialUrlSubpage(
 363+ 'Book', 'stop_book_mode/',
 364+ array(
 365+ 'referer' => $referer,
 366+ )
 367+ ),
 368+ // TODO: title
310369 ),
311 - '', false
 370+ wfMsg( 'coll-cancel' )
312371 )
313 - . Xml::element( 'input',
314 - array(
315 - 'type' => 'submit',
316 - 'name' => 'exit',
317 - 'value' => wfMsg( 'coll-cancel' ),
318 - ),
319 - '', false
320 - )
321372 )
 373+ . Xml::element( 'div',
 374+ array(
 375+ 'class' => 'collection-button cancelright',
 376+ ),
 377+ '', false
 378+ )
 379+ . Xml::element( 'div',
 380+ array(
 381+ 'style' => 'clear: both;',
 382+ ),
 383+ '', false
 384+ )
322385 )
323386 );
324387

Status & tagging log