r77955 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77954‎ | r77955 | r77956 >
Date:03:15, 7 December 2010
Author:tstarling
Status:ok (Comments)
Tags:
Comment:
Modify config-install-done, hopefully this is what Chad was looking for in CR r77948. Added a large, obvious download link with icon from the Crystal Project.
Modified paths:
  • /trunk/phase3/includes/installer/Installer.i18n.php (modified) (history)
  • /trunk/phase3/includes/installer/WebInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/WebInstallerPage.php (modified) (history)
  • /trunk/phase3/skins/common/config.css (modified) (history)
  • /trunk/phase3/skins/common/images/download-32.png (added) (history)

Diff [purge]

Index: trunk/phase3/skins/common/config.css
@@ -153,3 +153,7 @@
154154 #config-memcachewrapper {
155155 display: none;
156156 }
 157+.config-download-link {
 158+ font-size: 1.8em;
 159+ margin-left: 2em;
 160+}
Index: trunk/phase3/skins/common/images/download-32.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/phase3/skins/common/images/download-32.png
___________________________________________________________________
Added: svn:executable
157161 + *
Added: svn:mime-type
158162 + image/png
Index: trunk/phase3/includes/installer/WebInstaller.php
@@ -99,6 +99,10 @@
100100 parent::__construct();
101101 $this->output = new WebInstallerOutput( $this );
102102 $this->request = $request;
 103+
 104+ // Add parser hook for WebInstaller_Complete
 105+ global $wgParser;
 106+ $wgParser->setHook( 'downloadlink', array( $this, 'downloadLinkHook' ) );
103107 }
104108
105109 /**
@@ -956,4 +960,15 @@
957961 return $url;
958962 }
959963
 964+ public function downloadLinkHook( $text, $attribs, $parser ) {
 965+ $img = Html::element( 'img', array(
 966+ 'src' => '../skins/common/images/download-32.png',
 967+ 'width' => '32',
 968+ 'height' => '32',
 969+ ) );
 970+ $anchor = Html::rawElement( 'a',
 971+ array( 'href' => $this->getURL( array( 'localsettings' => 1 ) ) ),
 972+ $img . ' ' . wfMsgHtml( 'config-download-localsettings' ) );
 973+ return Html::rawElement( 'div', array( 'class' => 'config-download-link' ), $anchor );
 974+ }
960975 }
Index: trunk/phase3/includes/installer/Installer.i18n.php
@@ -474,10 +474,16 @@
475475 The installer has generated a <code>LocalSettings.php</code> file.
476476 It contains all your configuration.
477477
478 -You will need to [$1 download] it and put it in the base of your wiki installation (the same directory as index.php).
 478+You will need to download it and put it in the base of your wiki installation (the same directory as index.php). The download should have started automatically.
 479+
 480+If the download was not offerred, or if you cancelled it, you can restart the download by clicking the link below:
 481+
 482+$3
 483+
479484 '''Note''': If you do not do this now, this generated configuration file will not be available to you later if you exit the installation without downloading it.
480485
481486 When that has been done, you can '''[$2 enter your wiki]'''.", // $1 is the URL to LocalSettings download, $2 is link to wiki
 487+ 'config-download-localsettings' => 'Download LocalSettings.php',
482488 'config-help' => 'help',
483489 );
484490
@@ -565,7 +571,9 @@
566572 'config-install-sysop' => 'Message indicates that the administrator user account is being created',
567573 'config-install-done' => 'Parameters:
568574 * $1 is the URL to LocalSettings download
569 -* $2 is a link to the wiki.',
 575+* $2 is a link to the wiki.
 576+* $3 is a download link with attached download icon. The config-download-localsettings message will be used as the link text.',
 577+ 'config-download-localsettings' => 'The link text used in the download link in config-install-done.',
570578 'config-help' => 'This is used in help boxes.'
571579 );
572580
Index: trunk/phase3/includes/installer/WebInstallerPage.php
@@ -941,7 +941,8 @@
942942 $lsUrl,
943943 $GLOBALS['wgServer'] .
944944 $this->getVar( 'wgScriptPath' ) . '/index' .
945 - $this->getVar( 'wgScriptExtension' )
 945+ $this->getVar( 'wgScriptExtension' ),
 946+ '<downloadlink/>'
946947 ), 'tick-32.png'
947948 )
948949 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r77959Spelling error from r77955.tstarling04:14, 7 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77948* Pop up a download box for LocalSettings.php when the user goes to page=Comp...tstarling02:01, 7 December 2010

Comments

#Comment by 😂 (talk | contribs)   04:37, 7 December 2010

Yeah, that's exactly what I was going for. The icon is a nice touch too.

Status & tagging log