Page MenuHomePhabricator

EditPahe.php.udiff

Authored By
bzimport
Nov 21 2014, 8:46 PM
Size
4 KB
Referenced Files
None
Subscribers
None

EditPahe.php.udiff

--- EditPage.php Thu Jun 16 16:08:59 2005
+++ EditPage.php.orig Fri May 27 12:18:20 2005
@@ -176,85 +176,8 @@
// css / js subpages of user pages get a special treatment
$isCssJsSubpage = (Namespace::getUser() == $wgTitle->getNamespace() and preg_match("/\\.(css|js)$/", $wgTitle->getText() ));
- # START TIMG
- # setup the variables for later use
- $timsSkeletonEnabled = false ;
- $timsSkeletonText = '' ;
- # END TIM G
-
if(!$this->mTitle->getArticleID()) { # new article
$wgOut->addWikiText(wfmsg('newarticletext'));
- # START TIMG
- # Get the details for the skeleton URLs
- $timsTitleEditURL=$this->mTitle->getEditURL() ;
- # List the possible skeletons
- # This code is based on the code below that pulls out the list of templates used in the document
- # though I have added comments
- # Get the database
- $timsSkeletonDb =& wfGetDB( DB_SLAVE );
- # get the current table detials
- $timsSkeletonCurrentTable = $timsSkeletonDb->tableName( 'cur' );
- # build the SQL for the query
- # Note that this used the main namespace, in the future a namespace fot Skeletons might be a safer bet
- $timsSkeletonSql = "SELECT cur_namespace, cur_title ".
- "FROM $timsSkeletonCurrentTable WHERE cur_title LIKE('Skeleton:%') AND cur_namespace=".NS_MAIN;
- # execute the query
- $timsSkeletonRes = $timsSkeletonDb->query( $timsSkeletonSql, "EditPage::editform" );
- # if there was a result
- if ( false !== $timsSkeletonRes ) {
- # there was a result, are there any rows ?
- if ( $timsSkeletonDb->numRows( $timsSkeletonRes ) ) {
- # yes there are rows
- # initialise the Skeleton seleciton option. Note that this shoudl be
- # an international type message but I havent got that far
- $timsSkeletonList = "<H1>Skeletons list</H1><P>You can use one of these skeletons to provide the basic structure for you entry" ;
- # For each of the rows we got back
- while ( $timsSkeletonRow = $timsSkeletonDb->fetchObject( $timsSkeletonRes ) ) {
- # make sure that there is an associated title
- if ( $timsSkeletonTitleObj = Title::makeTitle( $timsSkeletonRow ->cur_namespace, $timsSkeletonRow ->cur_title ) ) {
- # yes there is, get the text of the title
- $timsSkeletonTitleName = $timsSkeletonTitleObj -> getText() ;
- # and make it into a link using the title as the visible name and also embedding the name of the skeleton in the link
- $timsSkeletonList .= ", <A HREF=\"$timsTitleEditURL&skeleton=$timsSkeletonTitleName \"> $timsSkeletonTitleName </A>";
- }
- }
- # append the close paragraph to the skeletons list output
- $timsSkeletonList .= ".</P>" ;
- # Append the skeleton none option
- $timsSkeletonList .= "<P>If you want to remove the skeleton chose <A HREF=\"$timsTitleEditURL&skeleton=none\">none</A></P>" ;
- # remind people that specifying a skeleton will wipe out any existing edited text
- $timsSkeletonList .= "<P>Reminder, Chosing a Skeleton (or none) will overwrite any existing edit</P>" ;
- # and output it
- $wgOut->addHTML($timsSkeletonList) ;
- }
- # release the results row set
- $timsSkeletonDb->freeResult( $timsSkeletonRes );
- }
- # see if there is a skeleton specified to use
- # get the request - need this to get the attributes in the URL
- global $wgRequest ;
- # get the value of the skeleton attribute from the URL or none is there is none
- $timsSkeletonName = $wgRequest->getVal( 'skeleton' , 'none') ;
- # Have we got the skeleton attribute ?
- if ( 'none' == $timsSkeletonName) {
- # No
- # Just make sure that the variables are not set
- $timsSkeletonEnabled = false ;
- $timsSkeletonText = '' ;
- } else {
- # Yes, there is a skeleton attribute
- # set the variables to use
- $timsSkeletonEnabled = true ;
- # get tge title of the skeleton page
- $timsSkeletonTitle = Title::newFromText($timsSkeletonName) ;
- # get the associated article
- $timsSkeletonArticle = new Article ( $timsSkeletonTitle ) ;
- $timsSkeletonText = $timsSkeletonArticle->getContent( true );
- $wgOut->addHTML("Using $timsSkeletonName If this is incorrect select a different skeleton above. If you don't want to use a skeleton at all select Skeleton:none") ;
- }
- # provided that the skeleton is not value none
- # try and get the text
- # END TIMG
}
if( Namespace::isTalk( $this->mTitle->getNamespace() ) ) {
@@ -289,8 +212,8 @@
return;
}
if ( $wgUser->pingLimiter() ) {
- $wgOut->rateLimited() ;
- return ;
+ $wgOut->rateLimited();
+ return;
}
# If article is new, insert it.
@@ -605,14 +528,7 @@
}
}
- # TIMG
- # if there is a skeleton
- # make use of it
- if ($timsSkeletonEnabled) {
- $this->textbox1 = $timsSkeletonText ;
- }
$wgOut->addHTML( "
-
{$toolbar}
<form id=\"editform\" name=\"editform\" method=\"post\" action=\"$action\"
enctype=\"multipart/form-data\">

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1822
Default Alt Text
EditPahe.php.udiff (4 KB)

Event Timeline