$fname = 'Article::insertNewArticle';
wfProfileIn( $fname );
+ if( !wfRunHooks( 'ArticleSave', array( &$this, &$wgUser, &$text,
+ &$summary, &$isminor, &$watchthis, NULL ) ) ) {
+ wfDebug( "$fname: ArticleSave hook aborted save!\n" );
+ wfProfileOut( $fname );
+ return false;
+ }
+
$this->mGoodAdjustment = $this->isCountable( $text );
$this->mTotalAdjustment = 1;
$oldid = 0; # new article
$this->showArticle( $text, wfMsg( 'newarticle' ), false, $isminor, $now, $summary, $oldid );
+
+ wfRunHooks( 'ArticleSaveComplete', array( &$this, &$wgUser, $text,
+ $summary, $isminor,
+ $watchthis, NULL ) );
wfProfileOut( $fname );
}
wfProfileIn( $fname );
$good = true;
+ if( !wfRunHooks( 'ArticleSave', array( &$this, &$wgUser, &$text,
+ &$summary, &$minor,
+ &$watchthis, &$sectionanchor ) ) ) {
+ wfDebug( "$fname: ArticleSave hook aborted save!\n" );
+ wfProfileOut( $fname );
+ return false;
+ }
+
$isminor = ( $minor && $wgUser->isLoggedIn() );
if ( $this->isRedirect( $text ) ) {
# Remove all content but redirect
$this->showArticle( $text, wfMsg( 'updated' ), $sectionanchor, $isminor, $now, $summary, $lastRevision );
}
+ wfRunHooks( 'ArticleSaveComplete',
+ array( &$this, &$wgUser, $text,
+ $summary, $minor,
+ $watchthis, $sectionanchor ) );
wfProfileOut( $fname );
return $good;
}
wfProfileOut( $fname );
return false;
}
- if (wfRunHooks('ArticleSave', array(&$this->mArticle, &$wgUser, &$this->textbox1,
- &$this->summary, &$this->minoredit, &$this->watchthis, NULL)))
- {
-
- $isComment=($this->section=='new');
- $this->mArticle->insertNewArticle( $this->textbox1, $this->summary,
- $this->minoredit, $this->watchthis, false, $isComment);
- wfRunHooks('ArticleSaveComplete', array(&$this->mArticle, &$wgUser, $this->textbox1,
- $this->summary, $this->minoredit,
- $this->watchthis, NULL));
- }
+
+ $isComment=($this->section=='new');
+ $this->mArticle->insertNewArticle( $this->textbox1, $this->summary,
+ $this->minoredit, $this->watchthis, false, $isComment);
+
wfProfileOut( $fname );
return false;
}
$this->textbox1 = $text;
$this->section = '';
- if (wfRunHooks('ArticleSave', array(&$this->mArticle, &$wgUser, &$text,
- &$this->summary, &$this->minoredit,
- &$this->watchthis, &$sectionanchor)))
- {
- # update the article here
- if($this->mArticle->updateArticle( $text, $this->summary, $this->minoredit,
- $this->watchthis, '', $sectionanchor ))
- {
- wfRunHooks('ArticleSaveComplete',
- array(&$this->mArticle, &$wgUser, $text,
- $this->summary, $this->minoredit,
- $this->watchthis, $sectionanchor));
- wfProfileOut( $fname );
- return false;
- } else {
- $this->isConflict = true;
- }
+ # update the article here
+ if( $this->mArticle->updateArticle( $text, $this->summary, $this->minoredit,
+ $this->watchthis, '', $sectionanchor ) ) {
+ wfProfileOut( $fname );
+ return false;
+ } else {
+ $this->isConflict = true;
}
wfProfileOut( $fname );
return true;