Index: trunk/extensions/SemanticForms/specials/SF_CreateCategory.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | static function createCategoryText( $default_form, $category_name, $parent_category ) { |
31 | 31 | SFUtils::loadMessages(); |
32 | 32 | |
33 | | - if ( $default_form == '' ) { |
| 33 | + if ( $default_form === '' ) { |
34 | 34 | $text = wfMsgForContent( 'sf_category_desc', $category_name ); |
35 | 35 | } else { |
36 | 36 | global $sfgContLang; |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | $form_tag = "[[" . $specprops[SF_SP_HAS_DEFAULT_FORM] . "::$default_form]]"; |
39 | 39 | $text = wfMsgForContent( 'sf_category_hasdefaultform', $form_tag ); |
40 | 40 | } |
41 | | - if ( $parent_category != '' ) { |
| 41 | + if ( $parent_category !== '' ) { |
42 | 42 | global $wgContLang; |
43 | 43 | $namespace_labels = $wgContLang->getNamespaces(); |
44 | 44 | $category_namespace = $namespace_labels[NS_CATEGORY]; |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | $preview_page = $wgRequest->getCheck( 'wpPreview' ); |
64 | 64 | if ( $save_page || $preview_page ) { |
65 | 65 | # validate category name |
66 | | - if ( $category_name == '' ) { |
| 66 | + if ( $category_name === '' ) { |
67 | 67 | $category_name_error_str = wfMsg( 'sf_blank_error' ); |
68 | 68 | } else { |
69 | 69 | # redirect to wiki interface |
Index: trunk/extensions/SemanticForms/specials/SF_FormStart.php |
— | — | @@ -64,14 +64,14 @@ |
65 | 65 | $page_name = $wgRequest->getVal( 'page_name' ); |
66 | 66 | // This form can be used to create a sub-page for an |
67 | 67 | // existing page |
68 | | - if ( $super_page != '' ) |
| 68 | + if ( $super_page !== '' ) |
69 | 69 | { |
70 | 70 | $page_name = "$super_page/$page_name"; |
71 | 71 | } |
72 | | - if ( $page_name != '' ) { |
| 72 | + if ( $page_name !== '' ) { |
73 | 73 | // Append the namespace prefix to the page name, |
74 | 74 | // if this namespace was not already entered. |
75 | | - if ( strpos( $page_name, $target_namespace . ':' ) === false && $target_namespace != '' ) |
| 75 | + if ( strpos( $page_name, $target_namespace . ':' ) === false && $target_namespace !== '' ) |
76 | 76 | $page_name = $target_namespace . ':' . $page_name; |
77 | 77 | // If there was no page title, it's probably an |
78 | 78 | // invalid page name, containing forbidden |
— | — | @@ -88,10 +88,10 @@ |
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | | - if ( ( !$form_title || !$form_title->exists() ) && ( $form_name != '' ) ) { |
| 92 | + if ( ( !$form_title || !$form_title->exists() ) && ( $form_name !== '' ) ) { |
93 | 93 | $text = Xml::element( 'p', null, wfMsg( 'sf_formstart_badform', SFUtils::linkText( SF_NS_FORM, $form_name ) ) ) . "\n"; |
94 | 94 | } else { |
95 | | - if ( $form_name == '' ) { |
| 95 | + if ( $form_name === '' ) { |
96 | 96 | $description = htmlspecialchars( wfMsg( 'sf_formstart_noform_docu', $form_name ) ); |
97 | 97 | } |
98 | 98 | else { |
— | — | @@ -106,7 +106,7 @@ |
107 | 107 | END; |
108 | 108 | // If no form was specified, display a dropdown letting |
109 | 109 | // the user choose the form. |
110 | | - if ( $form_name == '' ) |
| 110 | + if ( $form_name === '' ) |
111 | 111 | $text .= SFUtils::formDropdownHTML(); |
112 | 112 | |
113 | 113 | $text .= "\t</p>\n"; |
— | — | @@ -172,7 +172,7 @@ |
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
176 | | - if ( $params != '' ) { |
| 176 | + if ( $params !== '' ) { |
177 | 177 | $redirect_url .= ( strpos( $redirect_url, "?" ) > - 1 ) ? '&' : '?'; |
178 | 178 | $redirect_url .= $params; |
179 | 179 | } |
Index: trunk/extensions/SemanticForms/specials/SF_CreateProperty.php |
— | — | @@ -31,13 +31,13 @@ |
32 | 32 | $prop_labels = $smwgContLang->getPropertyLabels(); |
33 | 33 | $type_tag = "[[{$prop_labels['_TYPE']}::$property_type]]"; |
34 | 34 | $text = wfMsgForContent( 'sf_property_isproperty', $type_tag ); |
35 | | - if ( $default_form != '' ) { |
| 35 | + if ( $default_form !== '' ) { |
36 | 36 | global $sfgContLang; |
37 | 37 | $sf_prop_labels = $sfgContLang->getPropertyLabels(); |
38 | 38 | $default_form_tag = "[[{$sf_prop_labels[SF_SP_HAS_DEFAULT_FORM]}::$default_form]]"; |
39 | 39 | $text .= ' ' . wfMsgForContent( 'sf_property_linkstoform', $default_form_tag ); |
40 | 40 | } |
41 | | - if ( $allowed_values_str != '' ) { |
| 41 | + if ( $allowed_values_str !== '' ) { |
42 | 42 | // replace the comma substitution character that has no chance of |
43 | 43 | // being included in the values list - namely, the ASCII beep |
44 | 44 | global $sfgListSeparator; |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | $preview_page = $wgRequest->getCheck( 'wpPreview' ); |
76 | 76 | if ( $save_page || $preview_page ) { |
77 | 77 | # validate property name |
78 | | - if ( $property_name == '' ) { |
| 78 | + if ( $property_name === '' ) { |
79 | 79 | $property_name_error_str = wfMsg( 'sf_blank_error' ); |
80 | 80 | } else { |
81 | 81 | # redirect to wiki interface |
Index: trunk/extensions/SemanticForms/specials/SF_CreateClass.php |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | $template_name = trim( $wgRequest->getVal( "template_name" ) ); |
67 | 67 | $form_name = trim( $wgRequest->getVal( "form_name" ) ); |
68 | 68 | $category_name = trim( $wgRequest->getVal( "category_name" ) ); |
69 | | - if ( $template_name == '' | $form_name == '' || $category_name == '' ) { |
| 69 | + if ( $template_name === '' | $form_name === '' || $category_name === '' ) { |
70 | 70 | $wgOut->addWikiMsg( 'sf_createclass_missingvalues' ); |
71 | 71 | return; |
72 | 72 | } |
Index: trunk/extensions/SemanticForms/specials/SF_FormEdit.php |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | SFUtils::loadMessages(); |
95 | 95 | |
96 | 96 | // If we have no form name we might as well stop right away |
97 | | - if ( $form_name == '' ) { |
| 97 | + if ( $form_name === '' ) { |
98 | 98 | return 'sf_formedit_badurl'; |
99 | 99 | } |
100 | 100 | |
— | — | @@ -107,7 +107,7 @@ |
108 | 108 | $form_definition = $form_article->getContent(); |
109 | 109 | $form_definition = StringUtils::delimiterReplace( '<noinclude>', '</noinclude>', '', $form_definition ); |
110 | 110 | |
111 | | - if ( $target_name == '' ) { |
| 111 | + if ( $target_name === '' ) { |
112 | 112 | |
113 | 113 | // parse the form to see if it has a 'page name' value set |
114 | 114 | $matches; |
— | — | @@ -146,7 +146,7 @@ |
147 | 147 | } else { |
148 | 148 | $text = Xml::tags( 'p', array( 'class' => 'error' ), wfMsg( 'sf_formstart_badform', SFUtils::linkText( SF_NS_FORM, $form_name ) ) ) . "\n"; |
149 | 149 | } |
150 | | - } elseif ( $target_name == '' && $page_name_formula == '' ) { |
| 150 | + } elseif ( $target_name === '' && $page_name_formula === '' ) { |
151 | 151 | $text = Xml::element( 'p', array( 'class' => 'error' ), wfMsg( 'sf_formedit_badurl' ) ) . "\n"; |
152 | 152 | } else { |
153 | 153 | |
— | — | @@ -188,7 +188,7 @@ |
189 | 189 | $wgOut->setPageTitle( $s ); |
190 | 190 | |
191 | 191 | if ( $form_submitted ) { |
192 | | - if ( $page_name_formula != '' ) { |
| 192 | + if ( !is_null( $page_name_formula ) && $page_name_formula !== '' ) { |
193 | 193 | $target_name = $generated_page_name; |
194 | 194 | // prepend a super-page, if one was specified |
195 | 195 | if ( $wgRequest->getCheck( 'super_page' ) ) { |
— | — | @@ -271,8 +271,12 @@ |
272 | 272 | } |
273 | 273 | |
274 | 274 | if ( is_null( $target_title ) ) { |
275 | | - if ( $target_name ) return array ( 'sf_formstart_badtitle' , array( $target_name ) ); |
276 | | - else return 'sf_formedit_emptytitle'; |
| 275 | + if ( $target_name ) { |
| 276 | + return array ( 'sf_formstart_badtitle' , array( $target_name ) ); |
| 277 | + } |
| 278 | + else { |
| 279 | + return 'sf_formedit_emptytitle'; |
| 280 | + } |
277 | 281 | } |
278 | 282 | |
279 | 283 | if ( $save_page ) { |
— | — | @@ -347,7 +351,7 @@ |
348 | 352 | // override the default title for this page if |
349 | 353 | // a title was specified in the form |
350 | 354 | if ( $form_page_title != null ) { |
351 | | - if ( $target_name == '' ) { |
| 355 | + if ( $target_name === '' ) { |
352 | 356 | $wgOut->setPageTitle( $form_page_title ); |
353 | 357 | } else { |
354 | 358 | $wgOut->setPageTitle( "$form_page_title: {$target_title->getPrefixedText()}" ); |
Index: trunk/extensions/SemanticForms/specials/SF_RunQuery.php |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | $form_title = Title::makeTitleSafe( SF_NS_FORM, $form_name ); |
40 | 40 | |
41 | 41 | if ( !$form_title || !$form_title->exists() ) { |
42 | | - if ( $form_name == '' ) { |
| 42 | + if ( $form_name === '' ) { |
43 | 43 | $text = Xml::element( 'p', array( 'class' => 'error' ), wfMsg( 'sf_runquery_badurl' ) ) . "\n"; |
44 | 44 | } else { |
45 | 45 | $text = Xml::tags( 'p', array( 'class' => 'error' ), |
Index: trunk/extensions/SemanticForms/specials/SF_UploadWindow.php |
— | — | @@ -380,7 +380,7 @@ |
381 | 381 | /** |
382 | 382 | * If there was no filename or a zero size given, give up quick. |
383 | 383 | */ |
384 | | - if ( trim( $this->mSrcName ) == '' || empty( $this->mFileSize ) ) { |
| 384 | + if ( trim( $this->mSrcName ) === '' || empty( $this->mFileSize ) ) { |
385 | 385 | $this->mainUploadWindowForm( wfMsgHtml( 'emptyfile' ) ); |
386 | 386 | return; |
387 | 387 | } |
— | — | @@ -449,7 +449,7 @@ |
450 | 450 | /* Don't allow users to override the blacklist (check file extension) */ |
451 | 451 | global $wgStrictFileExtensions; |
452 | 452 | global $wgFileExtensions, $wgFileBlacklist; |
453 | | - if ( $finalExt == '' ) { |
| 453 | + if ( $finalExt === '' ) { |
454 | 454 | return $this->uploadError( wfMsgExt( 'filetype-missing', array ( 'parseinline' ) ) ); |
455 | 455 | } elseif ( $this->checkFileExtensionList( $ext, $wgFileBlacklist ) || |
456 | 456 | ( $wgStrictFileExtensions && !$this->checkFileExtension( $finalExt, $wgFileExtensions ) ) ) { |
— | — | @@ -517,7 +517,7 @@ |
518 | 518 | if ( !$this->mDestWarningAck ) { |
519 | 519 | $warning .= self::getExistsWarning( $this->mLocalFile ); |
520 | 520 | } |
521 | | - if ( $warning != '' ) { |
| 521 | + if ( $warning !== '' ) { |
522 | 522 | /** |
523 | 523 | * Stash the file in a temporary location; the user can choose |
524 | 524 | * to let it through and we'll complete the upload then. |
— | — | @@ -564,7 +564,7 @@ |
565 | 565 | // both a delimiter and a file name; and add on a delimiter |
566 | 566 | // at the end in any case |
567 | 567 | var cur_value = parent.document.getElementById("{$this->mInputID}").value; |
568 | | - if (cur_value == '') { |
| 568 | + if (cur_value === '') { |
569 | 569 | parent.document.getElementById("{$this->mInputID}").value = "$basename{$this->mDelimiter} "; |
570 | 570 | } else { |
571 | 571 | var last_char = cur_value.charAt(cur_value.length - 1); |
— | — | @@ -971,7 +971,7 @@ |
972 | 972 | |
973 | 973 | $watchChecked = |
974 | 974 | ( $wgUser->getOption( 'watchdefault' ) || |
975 | | - ( $wgUser->getOption( 'watchcreations' ) && $this->mDesiredDestName == '' ) ) |
| 975 | + ( $wgUser->getOption( 'watchcreations' ) && $this->mDesiredDestName === '' ) ) |
976 | 976 | ? 'checked="checked"' |
977 | 977 | : ''; |
978 | 978 | $warningChecked = $this->mIgnoreWarning ? 'checked' : ''; |
— | — | @@ -1043,7 +1043,7 @@ |
1044 | 1044 | EOT |
1045 | 1045 | ); |
1046 | 1046 | |
1047 | | - if ( $licenseshtml != '' ) { |
| 1047 | + if ( $licenseshtml !== '' ) { |
1048 | 1048 | $wgOut->addHTML( " |
1049 | 1049 | <td align='$align1'><label for='wpLicense'>$license</label></td> |
1050 | 1050 | <td align='$align2'> |
— | — | @@ -1531,7 +1531,7 @@ |
1532 | 1532 | static function getInitialPageText( $comment, $license, $copyStatus, $source ) { |
1533 | 1533 | global $wgUseCopyrightUpload; |
1534 | 1534 | if ( $wgUseCopyrightUpload ) { |
1535 | | - if ( $license != '' ) { |
| 1535 | + if ( $license !== '' ) { |
1536 | 1536 | $licensetxt = '== ' . wfMsgForContent( 'license' ) . " ==\n" . '{{' . $license . '}}' . "\n"; |
1537 | 1537 | } |
1538 | 1538 | $pageText = '== ' . wfMsg ( 'filedesc' ) . " ==\n" . $comment . "\n" . |
— | — | @@ -1539,8 +1539,8 @@ |
1540 | 1540 | "$licensetxt" . |
1541 | 1541 | '== ' . wfMsgForContent ( 'filesource' ) . " ==\n" . $source ; |
1542 | 1542 | } else { |
1543 | | - if ( $license != '' ) { |
1544 | | - $filedesc = $comment == '' ? '' : '== ' . wfMsg ( 'filedesc' ) . " ==\n" . $comment . "\n"; |
| 1543 | + if ( $license !== '' ) { |
| 1544 | + $filedesc = $comment === '' ? '' : '== ' . wfMsg ( 'filedesc' ) . " ==\n" . $comment . "\n"; |
1545 | 1545 | $pageText = $filedesc . |
1546 | 1546 | '== ' . wfMsgForContent ( 'license' ) . " ==\n" . '{{' . $license . '}}' . "\n"; |
1547 | 1547 | } else { |
Index: trunk/extensions/SemanticForms/specials/SF_Templates.php |
— | — | @@ -114,7 +114,7 @@ |
115 | 115 | $title = Title::makeTitle( NS_TEMPLATE, $result->value ); |
116 | 116 | $text = $skin->makeLinkObj( $title, htmlspecialchars( $title->getText() ) ); |
117 | 117 | $category = $this->getCategoryDefinedByTemplate( $title ); |
118 | | - if ( $category != '' ) { |
| 118 | + if ( $category !== '' ) { |
119 | 119 | SFUtils::loadMessages(); |
120 | 120 | $text .= ' ' . wfMsg( 'sf_templates_definescat' ) . ' ' . SFUtils::linkText( NS_CATEGORY, $category ); |
121 | 121 | } |
Index: trunk/extensions/SemanticForms/specials/SF_UploadWindow2.php |
— | — | @@ -399,7 +399,7 @@ |
400 | 400 | // both a delimiter and a file name; and add on a delimiter |
401 | 401 | // at the end in any case |
402 | 402 | var cur_value = parent.document.getElementById("{$this->mInputID}").value; |
403 | | - if (cur_value == '') { |
| 403 | + if (cur_value === '') { |
404 | 404 | parent.document.getElementById("{$this->mInputID}").value = '$basename' + '{$this->mDelimiter} '; |
405 | 405 | } else { |
406 | 406 | var last_char = cur_value.charAt(cur_value.length - 1); |
— | — | @@ -431,7 +431,7 @@ |
432 | 432 | global $wgUseCopyrightUpload; |
433 | 433 | if ( $wgUseCopyrightUpload ) { |
434 | 434 | $licensetxt = ''; |
435 | | - if ( $license != '' ) { |
| 435 | + if ( $license !== '' ) { |
436 | 436 | $licensetxt = '== ' . wfMsgForContent( 'license-header' ) . " ==\n" . '{{' . $license . '}}' . "\n"; |
437 | 437 | } |
438 | 438 | $pageText = '== ' . wfMsgForContent ( 'filedesc' ) . " ==\n" . $comment . "\n" . |
— | — | @@ -439,8 +439,8 @@ |
440 | 440 | "$licensetxt" . |
441 | 441 | '== ' . wfMsgForContent ( 'filesource' ) . " ==\n" . $source ; |
442 | 442 | } else { |
443 | | - if ( $license != '' ) { |
444 | | - $filedesc = $comment == '' ? '' : '== ' . wfMsgForContent ( 'filedesc' ) . " ==\n" . $comment . "\n"; |
| 443 | + if ( $license !== '' ) { |
| 444 | + $filedesc = $comment === '' ? '' : '== ' . wfMsgForContent ( 'filedesc' ) . " ==\n" . $comment . "\n"; |
445 | 445 | $pageText = $filedesc . |
446 | 446 | '== ' . wfMsgForContent ( 'license-header' ) . " ==\n" . '{{' . $license . '}}' . "\n"; |
447 | 447 | } else { |
Index: trunk/extensions/SemanticForms/specials/SF_CreateTemplate.php |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | |
126 | 126 | function validateCreateTemplateForm() { |
127 | 127 | templateName = jQuery('#template_name').val(); |
128 | | - if (templateName == '') { |
| 128 | + if (templateName === '') { |
129 | 129 | scroll(0, 0); |
130 | 130 | jQuery('#template_name_p').append(' <font color="red">$template_name_error_str</font>'); |
131 | 131 | return false; |
Index: trunk/extensions/SemanticForms/includes/SF_FormField.php |
— | — | @@ -263,7 +263,7 @@ |
264 | 264 | // such templates in form definitions gets more sophisticated |
265 | 265 | function createMarkup( $part_of_multiple, $is_last_field_in_template ) { |
266 | 266 | $text = ""; |
267 | | - if ( $this->template_field->getLabel() != '' ) { |
| 267 | + if ( $this->template_field->getLabel() !== '' ) { |
268 | 268 | if ( $part_of_multiple ) { |
269 | 269 | $text .= "'''" . $this->template_field->getLabel() . ":''' "; |
270 | 270 | } else { |
— | — | @@ -277,9 +277,9 @@ |
278 | 278 | // be removed. |
279 | 279 | if ( $this->mIsHidden ) { |
280 | 280 | $text .= "|hidden"; |
281 | | - } elseif ( $this->getInputType() != '' ) { |
| 281 | + } elseif ( $this->getInputType() !== '' ) { |
282 | 282 | $text .= "|input type=" . $this->getInputType(); |
283 | | - } elseif ( $this->template_field->getInputType() != '' ) { |
| 283 | + } elseif ( $this->template_field->getInputType() !== '' ) { |
284 | 284 | $text .= "|input type=" . $this->template_field->getInputType(); |
285 | 285 | } |
286 | 286 | foreach ( $this->mFieldArgs as $arg => $value ) { |
— | — | @@ -321,7 +321,7 @@ |
322 | 322 | $other_args['value_labels'] = $this->template_field->getValueLabels(); |
323 | 323 | } |
324 | 324 | $other_args['is_list'] = ( $this->mIsList || $this->template_field->isList() ); |
325 | | - if ( $this->template_field->getSemanticProperty() != '' && |
| 325 | + if ( $this->template_field->getSemanticProperty() !== '' && |
326 | 326 | ! array_key_exists( 'semantic_property', $other_args ) ) { |
327 | 327 | $other_args['semantic_property'] = $this->template_field->getSemanticProperty(); |
328 | 328 | $other_args['property_type'] = $this->template_field->getPropertyType(); |
Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php |
— | — | @@ -366,7 +366,7 @@ |
367 | 367 | // just use the name of the actual page we're on. |
368 | 368 | global $wgTitle; |
369 | 369 | $this->mPageTitle = $wgTitle; |
370 | | - } elseif ( $page_name == '' ) { |
| 370 | + } elseif ( $page_name === '' ) { |
371 | 371 | $this->mPageTitle = Title::newFromText( |
372 | 372 | $wgRequest->getVal( 'namespace' ) . ":Semantic Forms permissions test" ); |
373 | 373 | } else { |
— | — | @@ -967,7 +967,7 @@ |
968 | 968 | } else { |
969 | 969 | $sfgTabIndex++; |
970 | 970 | $sfgFieldNum++; |
971 | | - if ( $cur_value == '' ) { |
| 971 | + if ( $cur_value === '' ) { |
972 | 972 | $default_value = '!free_text!'; |
973 | 973 | } else { |
974 | 974 | $default_value = $cur_value; |
— | — | @@ -1001,7 +1001,7 @@ |
1002 | 1002 | $data_text .= "!free_text!\n"; |
1003 | 1003 | } |
1004 | 1004 | |
1005 | | - if ( $template_name == '' || $field_name == '<freetext>' ) { |
| 1005 | + if ( $template_name === '' || $field_name == '<freetext>' ) { |
1006 | 1006 | $section = substr_replace( $section, $new_text, $brackets_loc, $brackets_end_loc + 3 - $brackets_loc ); |
1007 | 1007 | } else { |
1008 | 1008 | if ( is_array( $cur_value ) ) { |
— | — | @@ -1036,7 +1036,7 @@ |
1037 | 1037 | } elseif ( count( $cur_value ) >= 3 ) { |
1038 | 1038 | $month = $cur_value['month']; |
1039 | 1039 | $day = $cur_value['day']; |
1040 | | - if ( $day != '' ) { |
| 1040 | + if ( $day !== '' ) { |
1041 | 1041 | global $wgAmericanDates; |
1042 | 1042 | if ( $wgAmericanDates == false ) { |
1043 | 1043 | // pad out day to always be two digits |
— | — | @@ -1050,7 +1050,7 @@ |
1051 | 1051 | if ( isset( $cur_value['second'] ) ) $second = $cur_value['second']; |
1052 | 1052 | if ( isset( $cur_value['ampm24h'] ) ) $ampm24h = $cur_value['ampm24h']; |
1053 | 1053 | if ( isset( $cur_value['timezone'] ) ) $timezone = $cur_value['timezone']; |
1054 | | - if ( $month != '' && $day != '' && $year != '' ) { |
| 1054 | + if ( $month !== '' && $day !== '' && $year !== '' ) { |
1055 | 1055 | // special handling for American dates - otherwise, just |
1056 | 1056 | // the standard year/month/day (where month is a number) |
1057 | 1057 | global $wgAmericanDates; |
— | — | @@ -1076,7 +1076,7 @@ |
1077 | 1077 | } else { // value is not an array |
1078 | 1078 | $cur_value_in_template = $cur_value; |
1079 | 1079 | } |
1080 | | - if ( $template_name == null || $template_name == '' ) { |
| 1080 | + if ( $template_name == null || $template_name === '' ) { |
1081 | 1081 | $input_name = $field_name; |
1082 | 1082 | } elseif ( $allow_multiple ) { |
1083 | 1083 | // 'num' will get replaced by an actual index, either in PHP |
— | — | @@ -1103,7 +1103,7 @@ |
1104 | 1104 | // if we're creating the page name from a formula based on |
1105 | 1105 | // form values, see if the current input is part of that formula, |
1106 | 1106 | // and if so, substitute in the actual value |
1107 | | - if ( $form_submitted && $generated_page_name != '' ) { |
| 1107 | + if ( $form_submitted && $generated_page_name !== '' ) { |
1108 | 1108 | // this line appears to be unnecessary |
1109 | 1109 | // $generated_page_name = str_replace('.', '_', $generated_page_name); |
1110 | 1110 | $generated_page_name = str_replace( ' ', '_', $generated_page_name ); |
— | — | @@ -1154,10 +1154,10 @@ |
1155 | 1155 | if ( $default_value == 'now' && |
1156 | 1156 | // if the date is hidden, cur_value will already be set |
1157 | 1157 | // to the default value |
1158 | | - ( $cur_value == '' || $cur_value == 'now' ) ) { |
| 1158 | + ( $cur_value === '' || $cur_value == 'now' ) ) { |
1159 | 1159 | if ( $input_type == 'date' || $input_type == 'datetime' || |
1160 | 1160 | $input_type == 'year' || |
1161 | | - ( $input_type == '' && $form_field->getTemplateField()->getPropertyType() == '_dat' ) ) { |
| 1161 | + ( $input_type === '' && $form_field->getTemplateField()->getPropertyType() == '_dat' ) ) { |
1162 | 1162 | // Get current time, for the time zone specified in the wiki. |
1163 | 1163 | global $wgLocaltimezone; |
1164 | 1164 | if ( isset( $wgLocaltimezone ) ) { |
— | — | @@ -1206,7 +1206,7 @@ |
1207 | 1207 | if ( $default_value == 'current user' && |
1208 | 1208 | // if the date is hidden, cur_value will already be set |
1209 | 1209 | // to the default value |
1210 | | - ( $cur_value == '' || $cur_value == 'current user' ) ) { |
| 1210 | + ( $cur_value === '' || $cur_value == 'current user' ) ) { |
1211 | 1211 | |
1212 | 1212 | $cur_value_in_template = $wgUser->getName(); |
1213 | 1213 | $cur_value = $cur_value_in_template; |
— | — | @@ -1245,7 +1245,7 @@ |
1246 | 1246 | $template_text .= "|$cur_value_in_template"; |
1247 | 1247 | } else { |
1248 | 1248 | // If the value is null, don't include it at all. |
1249 | | - if ( $cur_value_in_template != '' ) { |
| 1249 | + if ( $cur_value_in_template !== '' ) { |
1250 | 1250 | $template_text .= "\n|$field_name=$cur_value_in_template"; |
1251 | 1251 | } |
1252 | 1252 | } |
— | — | @@ -1370,7 +1370,7 @@ |
1371 | 1371 | } // end while |
1372 | 1372 | |
1373 | 1373 | if ( ! $all_instances_printed ) { |
1374 | | - if ( $template_text != '' ) { |
| 1374 | + if ( $template_text !== '' ) { |
1375 | 1375 | // For mostly aesthetic purposes, if the template call ends with |
1376 | 1376 | // a bunch of pipes (i.e., it's an indexed template with unused |
1377 | 1377 | // parameters at the end), remove the pipes. |
— | — | @@ -1529,7 +1529,7 @@ |
1530 | 1530 | |
1531 | 1531 | // Add a warning in, if we're editing an existing page and that |
1532 | 1532 | // page appears to not have been created with this form. |
1533 | | - if ( $this->mPageTitle->exists() && ( $existing_page_content != '' ) && ! $source_page_matches_this_form ) { |
| 1533 | + if ( $this->mPageTitle->exists() && ( $existing_page_content !== '' ) && ! $source_page_matches_this_form ) { |
1534 | 1534 | $form_text = "\t" . '<div class="warningbox">' . wfMsg( 'sf_formedit_formwarning', $this->mPageTitle->getFullURL() ) . "</div>\n<br clear=\"both\" />\n" . $form_text; |
1535 | 1535 | } |
1536 | 1536 | |
— | — | @@ -1604,7 +1604,7 @@ |
1605 | 1605 | |
1606 | 1606 | if ( $form_field->isHidden() ) { |
1607 | 1607 | $text = SFFormUtils::hiddenFieldHTML( $form_field->getInputName(), $cur_value ); |
1608 | | - } elseif ( $form_field->getInputType() != '' && |
| 1608 | + } elseif ( $form_field->getInputType() !== '' && |
1609 | 1609 | array_key_exists( $form_field->getInputType(), $this->mInputTypeHooks ) && |
1610 | 1610 | $this->mInputTypeHooks[$form_field->getInputType()] != null ) { |
1611 | 1611 | $funcArgs = array(); |
— | — | @@ -1622,7 +1622,7 @@ |
1623 | 1623 | } else { // input type not defined in form |
1624 | 1624 | $property_type = $template_field->getPropertyType(); |
1625 | 1625 | $is_list = ( $form_field->isList() || $template_field->isList() ); |
1626 | | - if ( $property_type != '' && |
| 1626 | + if ( $property_type !== '' && |
1627 | 1627 | array_key_exists( $property_type, $this->mSemanticTypeHooks ) && |
1628 | 1628 | isset( $this->mSemanticTypeHooks[$property_type][$is_list] ) ) { |
1629 | 1629 | $funcArgs = array(); |
Index: trunk/extensions/SemanticForms/includes/SF_AutoeditAPI.php |
— | — | @@ -385,7 +385,7 @@ |
386 | 386 | if ( !$name ) |
387 | 387 | continue; |
388 | 388 | |
389 | | - if ( $type == '' ) |
| 389 | + if ( $type === '' ) |
390 | 390 | $type = 'text'; |
391 | 391 | |
392 | 392 | switch ( $type ) { |
Index: trunk/extensions/SemanticForms/includes/SF_FormLinker.php |
— | — | @@ -287,7 +287,7 @@ |
288 | 288 | } |
289 | 289 | self::createLinkedPage( $target, $incoming_properties ); |
290 | 290 | $link = self::formEditLink( $target, $incoming_properties ); |
291 | | - if ( $link != '' ) { |
| 291 | + if ( $link !== '' ) { |
292 | 292 | $attribs['href'] = $link; |
293 | 293 | } |
294 | 294 | return true; |
Index: trunk/extensions/SemanticForms/includes/SF_TemplateField.php |
— | — | @@ -209,7 +209,7 @@ |
210 | 210 | |
211 | 211 | foreach ( $template_fields as $i => $field ) { |
212 | 212 | // Header/field label column |
213 | | - if ( $field->mDisplay == '' ) { |
| 213 | + if ( $field->mDisplay === '' ) { |
214 | 214 | if ( $i > 0 ) { |
215 | 215 | $tableText .= "|-\n"; |
216 | 216 | } |
— | — | @@ -264,7 +264,7 @@ |
265 | 265 | |
266 | 266 | // Add a row with an inline query to this table, for |
267 | 267 | // aggregation, if a property was specified. |
268 | | - if ( $aggregating_property != '' ) { |
| 268 | + if ( $aggregating_property !== '' ) { |
269 | 269 | if ( count( $template_fields ) > 0 ) { |
270 | 270 | $tableText .= "|-\n"; |
271 | 271 | } |
— | — | @@ -286,13 +286,13 @@ |
287 | 287 | } |
288 | 288 | |
289 | 289 | // Add a call to #set, if necessary |
290 | | - if ( $setText != '' ) { |
| 290 | + if ( $setText !== '' ) { |
291 | 291 | $setText = '{{#set:' . $setText . "}}\n"; |
292 | 292 | $text .= $setText; |
293 | 293 | } |
294 | 294 | |
295 | 295 | $text .= $tableText; |
296 | | - if ( $category != '' ) { |
| 296 | + if ( $category !== '' ) { |
297 | 297 | global $wgContLang; |
298 | 298 | $namespace_labels = $wgContLang->getNamespaces(); |
299 | 299 | $category_namespace = $namespace_labels[NS_CATEGORY]; |
Index: trunk/extensions/SemanticForms/includes/SF_PageSchemas.php |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | $xml .= '<InputType>' . $val . '</InputType>'; |
133 | 133 | } |
134 | 134 | } elseif ( substr( $var, 0, 14 ) == 'sf_key_values_' ) { |
135 | | - if ( $val != '' ) { |
| 135 | + if ( $val !== '' ) { |
136 | 136 | // replace the comma substitution character that has no chance of |
137 | 137 | // being included in the values list - namely, the ASCII beep |
138 | 138 | $listSeparator = ','; |
— | — | @@ -186,7 +186,7 @@ |
187 | 187 | // we set it based on whether or not a page formula has been |
188 | 188 | // specified. |
189 | 189 | $twoStepProcessAttrs = array( 'id' => 'sf-two-step-process' ); |
190 | | - if ( $pageNameFormula == '' ) { |
| 190 | + if ( $pageNameFormula === '' ) { |
191 | 191 | $twoStepProcessAttrs['checked'] = true; |
192 | 192 | } |
193 | 193 | $text .= '<p>' . Html::input( 'sf_two_step_process', null, 'checkbox', $twoStepProcessAttrs ); |
— | — | @@ -380,7 +380,7 @@ |
381 | 381 | foreach( $psFields as $psField ) { |
382 | 382 | $prop_array = $psField->getObject('semanticmediawiki_Property'); |
383 | 383 | $propertyName = PageSchemas::getValueFromObject( $prop_array, 'name' ); |
384 | | - if ( $psField->getLabel() == '' ) { |
| 384 | + if ( $psField->getLabel() === '' ) { |
385 | 385 | $fieldLabel = $psField->getName(); |
386 | 386 | } else { |
387 | 387 | $fieldLabel = $psField->getLabel(); |
Index: trunk/extensions/SemanticForms/includes/SF_TemplateInForm.php |
— | — | @@ -189,7 +189,7 @@ |
190 | 190 | if ( $this->mAllowMultiple ) { |
191 | 191 | $text .= "|multiple"; |
192 | 192 | } |
193 | | - if ( $this->mLabel != '' ) { |
| 193 | + if ( $this->mLabel !== '' ) { |
194 | 194 | $text .= "|label=" . $this->mLabel; |
195 | 195 | } |
196 | 196 | $text .= "}}}\n"; |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextInput.php |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | $text .= self::uploadLinkHTML( $input_id, $delimiter, $default_filename ); |
151 | 151 | } |
152 | 152 | $spanClass = 'inputSpan'; |
153 | | - if ( $inputType != '' ) { |
| 153 | + if ( $inputType !== '' ) { |
154 | 154 | $spanClass .= " {$inputType}Input"; |
155 | 155 | } |
156 | 156 | if ( $is_mandatory ) { |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_RadioButtonInput.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | // mandatory field and there's a current value in place (either |
38 | 38 | // through a default value or because we're editing an existing |
39 | 39 | // page). |
40 | | - if ( !$is_mandatory || $cur_value == '' ) { |
| 40 | + if ( !$is_mandatory || $cur_value === '' ) { |
41 | 41 | array_unshift( $possible_values, '' ); |
42 | 42 | } |
43 | 43 | |
— | — | @@ -76,7 +76,7 @@ |
77 | 77 | if ( $is_disabled ) { |
78 | 78 | $radiobutton_attrs['disabled'] = 'disabled'; |
79 | 79 | } |
80 | | - if ( $possible_value == '' ) { // blank/"None" value |
| 80 | + if ( $possible_value === '' ) { // blank/"None" value |
81 | 81 | $label = wfMsg( 'sf_formedit_none' ); |
82 | 82 | } elseif ( |
83 | 83 | array_key_exists( 'value_labels', $other_args ) && |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_DropdownInput.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | // mandatory field and there's a current value in place |
51 | 51 | // (either through a default value or because we're editing |
52 | 52 | // an existing page). |
53 | | - if ( !$is_mandatory || $cur_value == '' ) { |
| 53 | + if ( !$is_mandatory || $cur_value === '' ) { |
54 | 54 | $innerDropdown .= " <option value=\"\"></option>\n"; |
55 | 55 | } |
56 | 56 | if ( ( $possible_values = $other_args['possible_values'] ) == null ) { |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_TextWithAutocompleteInput.php |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | if ( array_key_exists( 'remote autocompletion', $field_args ) && |
114 | 114 | $field_args['remote autocompletion'] == true ) { |
115 | 115 | $remoteDataType = $autocompleteFieldType; |
116 | | - } elseif ( $autocompletionSource != '' ) { |
| 116 | + } elseif ( $autocompletionSource !== '' ) { |
117 | 117 | // @TODO - that count() check shouldn't be necessary |
118 | 118 | if ( array_key_exists( 'possible_values', $field_args ) && |
119 | 119 | count( $field_args['possible_values'] ) > 0 ) { |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_CategoryInput.php |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | // mandatory field and there's a current value in place |
58 | 58 | // (either through a default value or because we're editing |
59 | 59 | // an existing page) |
60 | | - if ( !$is_mandatory || $cur_value == '' ) { |
| 60 | + if ( !$is_mandatory || $cur_value === '' ) { |
61 | 61 | $text .= ' <input type="radio" tabindex="' . $sfgTabIndex . '" name="' . $input_name . '" value=""'; |
62 | 62 | if ( !$cur_value ) { |
63 | 63 | $text .= ' checked="checked"'; |
Index: trunk/extensions/SemanticForms/includes/SF_AutocompleteAPI.php |
— | — | @@ -33,21 +33,21 @@ |
34 | 34 | $this->dieUsage( 'The substring must be specified', 'param_substr' ); |
35 | 35 | } |
36 | 36 | |
37 | | - if ( $attribute != '' ) { |
| 37 | + if ( $attribute !== '' ) { |
38 | 38 | $data = self::getAllValuesForProperty( false, $attribute, $substr ); |
39 | | - } elseif ( $relation != '' ) { |
| 39 | + } elseif ( $relation !== '' ) { |
40 | 40 | $data = self::getAllValuesForProperty( true, $relation, $substr ); |
41 | | - } elseif ( $category != '' ) { |
| 41 | + } elseif ( $category !== '' ) { |
42 | 42 | $data = SFUtils::getAllPagesForCategory( $category, 3, $substr ); |
43 | | - } elseif ( $concept != '' ) { |
| 43 | + } elseif ( $concept !== '' ) { |
44 | 44 | $data = SFUtils::getAllPagesForConcept( $concept, $substr ); |
45 | | - } elseif ( $namespace != '' ) { |
| 45 | + } elseif ( $namespace !== '' ) { |
46 | 46 | // Special handling for main (blank) namespace. |
47 | 47 | if ( $namespace == 'main' ) { |
48 | 48 | $namespace = ''; |
49 | 49 | } |
50 | 50 | $data = SFUtils::getAllPagesForNamespace( $namespace, $substr ); |
51 | | - } elseif ( $external_url != '' ) { |
| 51 | + } elseif ( $external_url !== '' ) { |
52 | 52 | $data = SFUtils::getValuesFromExternalURL( $external_url, $substr ); |
53 | 53 | } else { |
54 | 54 | $data = array(); |
Index: trunk/extensions/SemanticForms/includes/SF_Utils.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | */ |
42 | 42 | public static function titleURLString( $title ) { |
43 | 43 | $namespace = wfUrlencode( $title->getNsText() ); |
44 | | - if ( $namespace != '' ) { |
| 44 | + if ( $namespace !== '' ) { |
45 | 45 | $namespace .= ':'; |
46 | 46 | } |
47 | 47 | if ( self::isCapitalized( $title ) ) { |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | */ |
59 | 59 | public static function titleString( $title ) { |
60 | 60 | $namespace = $title->getNsText(); |
61 | | - if ( $namespace != '' ) { |
| 61 | + if ( $namespace !== '' ) { |
62 | 62 | $namespace .= ':'; |
63 | 63 | } |
64 | 64 | if ( self::isCapitalized( $title ) ) { |
Index: trunk/extensions/SemanticForms/libs/SF_ajax_form_preview.js |
— | — | @@ -87,7 +87,7 @@ |
88 | 88 | elts = form.elements; |
89 | 89 | |
90 | 90 | for (i=0; i < elts.length; ++i) { |
91 | | - if (elts[i].name && elts[i].name != '' && !elts[i].disabled && |
| 91 | + if (elts[i].name && elts[i].name !== '' && !elts[i].disabled && |
92 | 92 | ((elts[i].type!='submit' && elts[i].type!='button' && elts[i].type!='radio' && elts[i].type!='checkbox') || elts[i].checked)) { |
93 | 93 | addData (elts[i].name, elts[i].value); |
94 | 94 | } |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | elts = frag.getElementsByTagName("form")["editform"].elements; |
126 | 126 | |
127 | 127 | for (i=0; i < elts.length; ++i) |
128 | | - if (elts[i].name && elts[i].name != '') addData (elts[i].name, elts[i].value); |
| 128 | + if (elts[i].name && elts[i].name !== '') addData (elts[i].name, elts[i].value); |
129 | 129 | |
130 | 130 | aj2.open('POST', action, true); |
131 | 131 | aj2.setRequestHeader('Content-Type', 'multipart/form-data; boundary='+boundary); |