r102496 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102495‎ | r102496 | r102497 >
Date:08:22, 9 November 2011
Author:ialex
Status:deferred
Tags:
Comment:
Some misc fixes (not completely tested since it's hard to make this extension work):
* Removed calls to Non-existing function OutputPage::addScriptClass()
* Create a new MV_Title instance instead of using $wgArticle
* Call EditPage::edit() instead of EditPage::submit() and removed checks from the else part since they can't be false (I know this part is in a comment)
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_Hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -291,8 +291,8 @@
292292 * enables linkback and autocomplete for search
293293 */
294294 function mvfAutoAllPageHeader() {
295 - global $mvgScriptPath, $wgJsMimeType, $wgOut, $mvExtraHeader, $wgTitle;
296 - global $mvgJSDebug, $wgEnableScriptLoader, $wgRequest;
 295+ global $mvgScriptPath, $wgJsMimeType, $wgOut, $mvExtraHeader;
 296+ global $mvgJSDebug;
297297
298298 $mvgScriptPath = htmlspecialchars( $mvgScriptPath );
299299 $wgJsMimeType = htmlspecialchars( $wgJsMimeType ) ;
@@ -304,10 +304,6 @@
305305 $unique_req_param = MV_VERSION;
306306 }
307307
308 - $wgOut->addScriptClass( "mv_allpages" );
309 - $wgOut->addScriptClass( "mv_search" );
310 -
311 -
312308 $mvCssUrl = $mvgScriptPath . '/skins/mv_custom.css';
313309 $wgOut->addLink( array(
314310 'rel' => 'stylesheet',
Index: trunk/extensions/MetavidWiki/includes/MV_Hooks.php
@@ -133,14 +133,15 @@
134134 return true;
135135 }
136136 function mvAddToolBoxLinks(){
137 - global $wgTitle,$wgUser,$wgArticle;
 137+ global $wgTitle,$wgUser;
138138 if( $wgTitle->getNamespace() == MV_NS_STREAM){
139139 //make sure the Messages are loaded
140140 //add export cmml link:
141141 $sTitle = SpecialPage::getTitleFor( 'MvExportStream' );
 142+ $mvTitle = new MV_Title( $wgTitle->getDBkey() );
142143 $sk = $wgUser->getSkin();
143144 $link = $sk->makeKnownLinkObj( $sTitle,wfMsg('mv_stream_resource_export'),
144 - 'feed_format=roe&stream_name=' . htmlspecialchars( $wgArticle->mvTitle->getStreamName() ) . '&t=' . htmlspecialchars($wgArticle->mvTitle->getTimeRequest() ),
 145+ 'feed_format=roe&stream_name=' . htmlspecialchars( $mvTitle->getStreamName() ) . '&t=' . htmlspecialchars( $mvTitle->getTimeRequest() ),
145146 '', '', 'title="' . htmlspecialchars( wfMsg( 'mv_export_cmml' ) ) . '"' );
146147 echo "<li>" . $link . "</li>";
147148 }
@@ -230,8 +231,8 @@
231232 if( !$wgRequest->getVal( 'UseExternalEditor' ) || $action=='submit' || $internal ||
232233 $section || $oldid || ( !$user->getOption( 'externaleditor' ) && !$external ) ) {
233234 $editor = new MvEditSequence( $article );
234 - $editor->submit();
235 - } elseif( $wgRequest->getVal( 'UseExternalEditor' ) && ( $external || $user->getOption( 'externaleditor' ) ) ) {
 235+ $editor->edit();
 236+ } else {
236237 $mode = $wgRequest->getVal( 'mode' );
237238 $extedit = new ExternalEdit( $article, $mode );
238239 $extedit->edit();

Status & tagging log