[MediaWiki-commits] [Gerrit] Fix for correct display of spaces in page names in form titles - change (mediawiki...SemanticForms)

2013-02-26 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/50938


Change subject: Fix for correct display of spaces in page names in form titles
..

Fix for correct display of spaces in page names in form titles

Change-Id: Ib60ba6bc1e325a9dd6cf288402726f9d97bf7f47
---
M specials/SF_FormEdit.php
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms 
refs/changes/38/50938/1

diff --git a/specials/SF_FormEdit.php b/specials/SF_FormEdit.php
index 76e1dbd..b6f2b2e 100644
--- a/specials/SF_FormEdit.php
+++ b/specials/SF_FormEdit.php
@@ -38,6 +38,7 @@
$queryparts = explode( '/', $query, 2 );
$this-mForm = isset( $queryparts[ 0 ] ) ? $queryparts[ 
0 ] : '';
$this-mTarget = isset( $queryparts[ 1 ] ) ? 
$queryparts[ 1 ] : '';
+   $this-mTarget = str_replace( '_', ' ', $this-mTarget 
);
}
 
$alt_forms = $this-getRequest()-getArray( 'alt_form' );
@@ -62,7 +63,6 @@
}
 
static function printForm( $form_name, $targetName, $alt_forms = 
array( ) ) {
-
global $wgOut, $wgRequest;
 
if ( method_exists( 'ApiMain', 'getContext' ) ) {
@@ -108,8 +108,7 @@
} else {
$pageTitle = $result[ 'formtitle' ] . ': ' . 
$targetName;
}
-
-   } else if ( $result[ 'form' ] !== '' ) {
+   } elseif ( $result[ 'form' ] !== '' ) {
// set page title depending on whether the target page 
exists
if ( empty( $targetName ) ) {
$pageTitle = wfMessage( 
'sf_formedit_createtitlenotarget', $result[ 'form' ] )-text();

-- 
To view, visit https://gerrit.wikimedia.org/r/50938
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib60ba6bc1e325a9dd6cf288402726f9d97bf7f47
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren yaro...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix for correct display of spaces in page names in form titles - change (mediawiki...SemanticForms)

2013-02-26 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: Fix for correct display of spaces in page names in form titles
..


Fix for correct display of spaces in page names in form titles

Change-Id: Ib60ba6bc1e325a9dd6cf288402726f9d97bf7f47
---
M specials/SF_FormEdit.php
1 file changed, 2 insertions(+), 3 deletions(-)

Approvals:
  Yaron Koren: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/specials/SF_FormEdit.php b/specials/SF_FormEdit.php
index 76e1dbd..b6f2b2e 100644
--- a/specials/SF_FormEdit.php
+++ b/specials/SF_FormEdit.php
@@ -38,6 +38,7 @@
$queryparts = explode( '/', $query, 2 );
$this-mForm = isset( $queryparts[ 0 ] ) ? $queryparts[ 
0 ] : '';
$this-mTarget = isset( $queryparts[ 1 ] ) ? 
$queryparts[ 1 ] : '';
+   $this-mTarget = str_replace( '_', ' ', $this-mTarget 
);
}
 
$alt_forms = $this-getRequest()-getArray( 'alt_form' );
@@ -62,7 +63,6 @@
}
 
static function printForm( $form_name, $targetName, $alt_forms = 
array( ) ) {
-
global $wgOut, $wgRequest;
 
if ( method_exists( 'ApiMain', 'getContext' ) ) {
@@ -108,8 +108,7 @@
} else {
$pageTitle = $result[ 'formtitle' ] . ': ' . 
$targetName;
}
-
-   } else if ( $result[ 'form' ] !== '' ) {
+   } elseif ( $result[ 'form' ] !== '' ) {
// set page title depending on whether the target page 
exists
if ( empty( $targetName ) ) {
$pageTitle = wfMessage( 
'sf_formedit_createtitlenotarget', $result[ 'form' ] )-text();

-- 
To view, visit https://gerrit.wikimedia.org/r/50938
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib60ba6bc1e325a9dd6cf288402726f9d97bf7f47
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren yaro...@gmail.com
Gerrit-Reviewer: Yaron Koren yaro...@gmail.com
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits