return $this->mArticle;
}
+
/**
* Fetch initial editing page content.
* @private
* the newly-edited page.
*/
function edit() {
- global $wgOut, $wgRequest;
+ global $wgOut, $wgRequest, $wgEnableJS2system;
// Allow extensions to modify/prevent this form or submission
if ( !wfRunHooks( 'AlternateEdit', array( &$this ) ) ) {
return;
}
$wgOut->addScriptFile( 'edit.js' );
+
+ if($wgEnableJS2system)
+ $wgOut->addScriptClass( 'editPage' );
+
$permErrors = $this->getEditPermissionErrors();
if ( $permErrors ) {
wfDebug( __METHOD__.": User can't edit\n" );
wfProfileOut( $fname );
// Allow extensions to modify form data
- wfRunHooks( 'EditPage::importFormData', array( &$this ) );
+ wfRunHooks( 'EditPage::importFormData', array( &$this, $request ) );
}
/**
}
// Run post-section-merge edit filter
- if ( !wfRunHooks( 'EditFilterMerged', array( $this, $this->textbox1, &$this->hookError, $this->summary ) ) ) {
+ if ( !wfRunHooks( 'EditFilterMerged', array( &$this, $this->textbox1, &$this->hookError, $this->summary ) ) ) {
# Error messages etc. could be handled within the hook...
wfProfileOut( $fname );
return self::AS_HOOK_ERROR;
$oldtext = $this->mArticle->getContent();
// Run post-section-merge edit filter
- if ( !wfRunHooks( 'EditFilterMerged', array( $this, $text, &$this->hookError, $this->summary ) ) ) {
+ if ( !wfRunHooks( 'EditFilterMerged', array( &$this, $text, &$this->hookError, $this->summary ) ) ) {
# Error messages etc. could be handled within the hook...
wfProfileOut( $fname );
return self::AS_HOOK_ERROR;
}
return true;
}
-
+
/**
* Check given input text against $wgSpamRegex, and return the text of the first match.
* @return mixed -- matching string or false
$toolbar = '';
}
+
// activate checkboxes if user wants them to be always active
if ( !$this->preview && !$this->diff ) {
# Sort out the "watch" checkbox
# Already watched
$this->watchthis = true;
}
-
+
# May be overriden by request parameters
if( $wgRequest->getBool( 'watchthis' ) ) {
$this->watchthis = true;
$toolbar.="/*]]>*/\n</script>";
$toolbar.="\n</div>";
-
+
wfRunHooks( 'EditPageBeforeEditToolbar', array( &$toolbar ) );
-
+
return $toolbar;
}