http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95742

Revision: 95742
Author:   nikerabbit
Date:     2011-08-30 08:56:18 +0000 (Tue, 30 Aug 2011)
Log Message:
-----------
Small fixes, avoid oldid bugs, whitespace

Modified Paths:
--------------
    trunk/extensions/SemanticForms/specials/SF_FormEdit.php
    trunk/extensions/SemanticForms/specials/SF_FormStart.php
    trunk/extensions/SemanticForms/specials/SF_RunQuery.php
    trunk/extensions/SemanticForms/specials/SF_Templates.php

Modified: trunk/extensions/SemanticForms/specials/SF_FormEdit.php
===================================================================
--- trunk/extensions/SemanticForms/specials/SF_FormEdit.php     2011-08-30 
08:45:41 UTC (rev 95741)
+++ trunk/extensions/SemanticForms/specials/SF_FormEdit.php     2011-08-30 
08:56:18 UTC (rev 95742)
@@ -103,7 +103,7 @@
 
                $form_title = Title::makeTitleSafe( SF_NS_FORM, $form_name );
 
-               $form_article = new Article( $form_title );
+               $form_article = new Article( $form_title, 0 );
                $form_definition = $form_article->getContent();
                $form_definition = StringUtils::delimiterReplace( 
'<noinclude>', '</noinclude>', '', $form_definition );
 
@@ -125,7 +125,7 @@
                                        $page_contents = null;
                                        //$page_is_source = false;
                                } else {
-                                       $target_article = new Article( 
$target_title );
+                                       $target_article = new Article( 
$target_title, 0 );
                                        $page_contents = 
$target_article->getContent();
                                        //$page_is_source = true;
                                }
@@ -300,7 +300,7 @@
 
                                        // Find existing article if it exists,
                                        // or create a new one.
-                                       $article = new Article( $target_title );
+                                       $article = new Article( $target_title, 
0 );
 
                                        $editor = new EditPage( $article );
                                        $editor->importFormData( $request );

Modified: trunk/extensions/SemanticForms/specials/SF_FormStart.php
===================================================================
--- trunk/extensions/SemanticForms/specials/SF_FormStart.php    2011-08-30 
08:45:41 UTC (rev 95741)
+++ trunk/extensions/SemanticForms/specials/SF_FormStart.php    2011-08-30 
08:56:18 UTC (rev 95742)
@@ -88,7 +88,7 @@
                        }
                }
 
-               if ( ( ! $form_title || ! $form_title->exists() ) && ( 
$form_name != '' ) ) {
+               if ( ( !$form_title || !$form_title->exists() ) && ( $form_name 
!= '' ) ) {
                        $text = Xml::element( 'p', null, wfMsg( 
'sf_formstart_badform', SFUtils::linkText( SF_NS_FORM, $form_name ) ) ) . "\n";
                } else {
                        if ( $form_name == '' ) {
@@ -126,7 +126,7 @@
                if ( $page_title->exists() ) {
                        // It exists - see if page is a redirect; if
                        // it is, edit the target page instead.
-                       $article = new Article( $page_title );
+                       $article = new Article( $page_title, 0 );
                        $article->loadContent();
                        $redirect_title = Title::newFromRedirect( 
$article->fetchContent() );
                        if ( $redirect_title != null ) {

Modified: trunk/extensions/SemanticForms/specials/SF_RunQuery.php
===================================================================
--- trunk/extensions/SemanticForms/specials/SF_RunQuery.php     2011-08-30 
08:45:41 UTC (rev 95741)
+++ trunk/extensions/SemanticForms/specials/SF_RunQuery.php     2011-08-30 
08:56:18 UTC (rev 95742)
@@ -35,10 +35,11 @@
                // Get contents of form-definition page.
                $form_title = Title::makeTitleSafe( SF_NS_FORM, $form_name );
 
-               if ( ! $form_title || ! $form_title->exists() ) {
+               if ( !$form_title || !$form_title->exists() ) {
                        if ( $form_name == '' ) {
                                $text = Xml::element( 'p', array( 'class' => 
'error' ), wfMsg( 'sf_runquery_badurl' ) ) . "\n";
                        } else {
+                               /// FIXME: i18n
                                $text = '<p class="error">Error: No form page 
was found at ' . SFUtils::linkText( SF_NS_FORM, $form_name ) . ".</p>\n";
                        }
                        $wgOut->addHTML( $text );
@@ -46,7 +47,7 @@
                }
 
                // Initialize variables.
-               $form_article = new Article( $form_title );
+               $form_article = new Article( $form_title, 0 );
                $form_definition = $form_article->getContent();
                $submit_url = $form_title->getLocalURL( 'action=submit' );
                if ( $embedded ) {
@@ -110,7 +111,7 @@
                                $text .= "\n<h2>$additional_query</h2>\n";
                }
                if ( !$raw ) {
-                       $action = htmlspecialchars( SpecialPage::getTitleFor( 
"RunQuery", $form_name )->getLocalURL() );
+                       $action = htmlspecialchars( $this->getTitle( $form_name 
)->getLocalURL() );
                        $text .= <<<END
        <form id="sfForm" name="createbox" action="$action" method="post" 
class="createbox">
 

Modified: trunk/extensions/SemanticForms/specials/SF_Templates.php
===================================================================
--- trunk/extensions/SemanticForms/specials/SF_Templates.php    2011-08-30 
08:45:41 UTC (rev 95741)
+++ trunk/extensions/SemanticForms/specials/SF_Templates.php    2011-08-30 
08:56:18 UTC (rev 95742)
@@ -97,7 +97,7 @@
        function getCategoryDefinedByTemplate( $templateTitle ) {
                global $wgContLang;
 
-               $templateArticle = new Article( $templateTitle );
+               $templateArticle = new Article( $templateTitle, 0 );
                $templateText = $templateArticle->getContent();
                $cat_ns_name = $wgContLang->getNsText( NS_TEMPLATE );
                if ( preg_match_all( 
"/\[\[(Category|$cat_ns_name):([^\]]*)\]\]/", $templateText, $matches ) ) {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to