Yaron Koren has submitted this change and it was merged.
Change subject: Removed "input type" field from SFTemplateField class
......................................................................
Removed "input type" field from SFTemplateField class
Change-Id: I74736f9461d6b31762fe1707f1cea778aa63aee7
---
M includes/SF_FormField.php
M includes/SF_TemplateField.php
M specials/SF_CreateForm.php
3 files changed, 5 insertions(+), 19 deletions(-)
Approvals:
Yaron Koren: Checked; Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/SF_FormField.php b/includes/SF_FormField.php
index 1130aa6..70bc180 100644
--- a/includes/SF_FormField.php
+++ b/includes/SF_FormField.php
@@ -634,15 +634,10 @@
if ( ! $part_of_multiple ) { $text .= "| "; }
$text .= "{{{field|" . $this->template_field->getFieldName();
- // TODO - why is there an input type field in both the form
- // field and the template field? One of them should probably
- // be removed.
if ( $this->mIsHidden ) {
$text .= "|hidden";
} elseif ( !is_null( $this->getInputType() ) ) {
$text .= "|input type=" . $this->getInputType();
- } elseif ( $this->template_field->getInputType() != '' ) {
- $text .= "|input type=" .
$this->template_field->getInputType();
}
foreach ( $this->mFieldArgs as $arg => $value ) {
if ( $value === true ) {
diff --git a/includes/SF_TemplateField.php b/includes/SF_TemplateField.php
index 63f7b89..de9dc52 100644
--- a/includes/SF_TemplateField.php
+++ b/includes/SF_TemplateField.php
@@ -27,7 +27,6 @@
private $mIsList;
private $mDelimiter;
private $mDisplay;
- private $mInputType;
private $mNamespace;
static function create( $name, $label, $semanticProperty = null,
$isList = null, $delimiter = null, $display = null ) {
@@ -191,10 +190,6 @@
return $this->mDisplay;
}
- function getInputType() {
- return $this->mInputType;
- }
-
function getNamespace() {
return $this->mNamespace;
}
@@ -205,10 +200,6 @@
function setLabel( $label ) {
$this->mLabel = $label;
- }
-
- function setInputType( $inputType ) {
- $this->mInputType = $inputType;
}
function setNamespace( $namespace ) {
diff --git a/specials/SF_CreateForm.php b/specials/SF_CreateForm.php
index ef81d28..3409c9a 100644
--- a/specials/SF_CreateForm.php
+++ b/specials/SF_CreateForm.php
@@ -200,13 +200,13 @@
} elseif ( $paramName == 'input
type' ) {
$input_type =
$req->getVal( "input_type_" . $old_i . "_" . $j );
if ( $input_type ==
'hidden' ) {
-
$field->template_field->setInputType( $input_type );
+
$field->setInputType( $input_type );
$field->setIsHidden( true );
} elseif ( substr(
$input_type, 0, 1 ) == '.' ) {
// It's the
default input type -
// don't do
anything.
} else {
-
$field->template_field->setInputType( $input_type );
+
$field->setInputType( $input_type );
}
} else {
if ( ! empty( $value )
) {
@@ -533,10 +533,10 @@
$default_input_type = null;
$possible_input_types =
$sfgFormPrinter->getAllInputTypes();
}
- $text .= $this->inputTypeDropdownHTML( $field_form_text,
$default_input_type, $possible_input_types, $template_field->getInputType() );
+ $text .= $this->inputTypeDropdownHTML( $field_form_text,
$default_input_type, $possible_input_types, $field->getInputType() );
- if ( !is_null( $template_field->getInputType() ) ) {
- $cur_input_type = $template_field->getInputType();
+ if ( !is_null( $field->getInputType() ) ) {
+ $cur_input_type = $field->getInputType();
} elseif ( !is_null( $default_input_type ) ) {
$cur_input_type = $default_input_type;
} else {
--
To view, visit https://gerrit.wikimedia.org/r/278730
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I74736f9461d6b31762fe1707f1cea778aa63aee7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
Gerrit-Reviewer: Yaron Koren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits