Yaron Koren has uploaded a new change for review.

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

Change subject: Default field label for display=table
......................................................................

Default field label for display=table

Change-Id: I6cd805c4253d49a37de625868912dcf51bd463b9
---
M includes/SF_FormPrinter.php
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms 
refs/changes/36/311636/2

diff --git a/includes/SF_FormPrinter.php b/includes/SF_FormPrinter.php
index c408089..303b23f 100644
--- a/includes/SF_FormPrinter.php
+++ b/includes/SF_FormPrinter.php
@@ -402,9 +402,14 @@
                        }
 
                        $sfgFieldNum++;
+                       if ( $formField->getLabel() !== null ) {
+                               $labelText = $formField->getLabel();
+                       } else {
+                               $labelText = $fieldName . ': ';
+                       }
                        $label = Html::element( 'label',
                                array( 'for' => "input_$sfgFieldNum" ),
-                               $formField->getLabel() );
+                               $labelText );
                        $labelCell = Html::rawElement( 'th', null, $label );
                        $inputCell = Html::rawElement( 'td', null, 
$this->formFieldHTML( $formField, $curValue ) );
                        $html .= Html::rawElement( 'tr', null, $labelCell . 
$inputCell ) . "\n";

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6cd805c4253d49a37de625868912dcf51bd463b9
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: 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

Reply via email to