aboutsummaryrefslogtreecommitdiffstats
path: root/includes/EditPage.php
diff options
context:
space:
mode:
authorErik Moeller <erik@users.mediawiki.org>2005-07-02 14:38:15 +0000
committerErik Moeller <erik@users.mediawiki.org>2005-07-02 14:38:15 +0000
commitfedceb4bcdae9a67b692eabfe259d78d39ffcab0 (patch)
tree425785a037338c80cf6fa8a7203f89e748d46577 /includes/EditPage.php
parentd81ad1041f409ad3ae082ef2d5e19efff109cb2b (diff)
downloadmediawikicore-fedceb4bcdae9a67b692eabfe259d78d39ffcab0.tar.gz
mediawikicore-fedceb4bcdae9a67b692eabfe259d78d39ffcab0.zip
Add two new parameters for editing new pages:
&preload=Page_name => Content of [[Page name]] will be loaded into the textarea. &&editintro=Page_name => Content of [[Page name]] will be used instead of [[MediaWiki:Newarticletext]]. Respects read permissions. Primary purpose: Customizing of edit pages for newbies, use of custom page templates. Possible future changes: Make preload work with &section=new, make editintro work with any edit.
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/9833
Diffstat (limited to 'includes/EditPage.php')
-rw-r--r--includes/EditPage.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/includes/EditPage.php b/includes/EditPage.php
index a97558f73bc1..8729b94788ba 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -298,7 +298,7 @@ class EditPage {
function editForm( $formtype, $firsttime = false ) {
global $wgOut, $wgUser;
global $wgLang, $wgContLang, $wgParser, $wgTitle;
- global $wgAllowAnonymousMinor;
+ global $wgAllowAnonymousMinor, $wgRequest;
global $wgSpamRegex, $wgFilterCallback;
$sk = $wgUser->getSkin();
@@ -308,7 +308,21 @@ class EditPage {
if(!$this->mTitle->getArticleID()) { # new article
- $wgOut->addWikiText(wfmsg('newarticletext'));
+ $editintro = $wgRequest->getText( 'editintro' );
+ $addstandardintro=true;
+ if($editintro) {
+ $introtitle=Title::newFromText($editintro);
+ if($introtitle->userCanRead()) {
+ $rev=Revision::newFromTitle($introtitle);
+ if($rev) {
+ $wgOut->addWikiText($rev->getText());
+ $addstandardintro=false;
+ }
+ }
+ }
+ if($addstandardintro) {
+ $wgOut->addWikiText(wfmsg('newarticletext'));
+ }
}
if( $this->mTitle->isTalkPage() ) {