r97792 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97791‎ | r97792 | r97793 >
Date:04:54, 22 September 2011
Author:yaron
Status:deferred
Tags:
Comment:
Follow-up to r97790 - bug fix, plus various additional improvements
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_PageSchemas.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_PageSchemas.php
@@ -100,10 +100,10 @@
101101 $value = str_replace( "\a", $listSeparator, trim( $value ) );
102102 $param_value = explode( "=", $value );
103103 if ( $param_value[1] != null ) {
104 - //handles Parameter name="size">20</Parameter>
 104+ // Handles <Parameter name="size">20</Parameter>
105105 $xml .= '<Parameter name="'.$param_value[0].'">'.$param_value[1].'</Parameter>';
106106 } else {
107 - //handles <Parameter name="mandatory" />
 107+ // Handles <Parameter name="mandatory" />
108108 $xml .= '<Parameter name="'.$param_value[0].'"/>';
109109 }
110110 }
@@ -116,7 +116,7 @@
117117 return true;
118118 }
119119
120 - public static function getSchemaHTML( $pageSchemaObj, &$text_extensions ) {
 120+ public static function getSchemaHTML( $pageSchemaObj, &$extensionsHTML ) {
121121 $form_array = array();
122122 $hasExistingValues = false;
123123 if ( !is_null( $pageSchemaObj ) ) {
@@ -150,7 +150,7 @@
151151 $editTitle = '';
152152 }
153153 $text .= "\t<p>" . wfMsg( 'sf-pageschemas-edittitle' ) . ' ' . Html::input( 'sf_edit_title', $editTitle, 'text', array( 'size' => 25 ) ) . "</p>\n";
154 - $text_extensions['sf'] = array( 'Form', '#CF9', $text, $hasExistingValues );
 154+ $extensionsHTML['sf'] = array( 'Form', '#CF9', $text, $hasExistingValues );
155155
156156 return true;
157157 }
@@ -159,7 +159,7 @@
160160 * Returns the HTML for inputs to define a single form field,
161161 * within the Page Schemas 'edit schema' page.
162162 */
163 - public static function getFieldHTML( $field, &$text_extensions ) {
 163+ public static function getFieldHTML( $field, &$extensionsHTML ) {
164164 $hasExistingValues = false;
165165 $fieldValues = array();
166166 if ( !is_null( $field ) ) {
@@ -204,7 +204,7 @@
205205 $inputParamsAttrs = array( 'size' => 80 );
206206 $inputParamsInput = Html::input( 'sf_key_values_num', $param_value_str, 'text', $inputParamsAttrs );
207207 $text .= "\t<p>$inputParamsInput</p>\n";
208 - $text_extensions['sf'] = array( 'Form input', '#CF9', $text, $hasExistingValues );
 208+ $extensionsHTML['sf'] = array( 'Form input', '#CF9', $text, $hasExistingValues );
209209
210210 return true;
211211 }
@@ -214,7 +214,7 @@
215215 if ( is_null( $mainFormInfo ) || !array_key_exists( 'name', $mainFormInfo ) ) {
216216 return null;
217217 }
218 - return $mainFormInfo['name']
 218+ return $mainFormInfo['name'];
219219 }
220220
221221 public static function getMainFormInfo( $psSchemaObj ) {
@@ -287,7 +287,7 @@
288288 if ( array_key_exists( 'smw', $smw_array ) ) {
289289 $propertyName = $smw_array['smw']['name'];
290290 } else {
291 - $propertName = null;
 291+ $propertyName = null;
292292 }
293293 if ( $fieldObj->getLabel() == '' ) {
294294 $fieldLabel = $fieldObj->getName();
@@ -393,11 +393,11 @@
394394 $text = PageSchemas::tableMessageRowHTML( "paramAttr", wfMsg( 'specialpages-group-sf_group' ), (string)$tag );
395395 foreach ( $child->children() as $prop ) {
396396 if ( $prop->getName() == 'InputType' ) {
397 - $text .= PageSchemas::tableMessageRowHTML("paramAttrMsg", $prop->getName(), $prop );
 397+ $propName = 'Input type';
398398 } else {
399 - $prop_name = (string)$prop->attributes()->name;
400 - $text .= PageSchemas::tableMessageRowHTML("paramAttrMsg", $prop_name, (string)$prop );
 399+ $propName = (string)$prop->attributes()->name;
401400 }
 401+ $text .= PageSchemas::tableMessageRowHTML("paramAttrMsg", $propName, (string)$prop );
402402 }
403403 $text_object['sf'] = $text;
404404 break;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97790PHP improvementsyaron04:17, 22 September 2011