Index: trunk/extensions/SemanticForms/specials/SF_FormStart.php |
— | — | @@ -60,11 +60,11 @@ |
61 | 61 | $page_name = $wgRequest->getVal( 'page_name' ); |
62 | 62 | // This form can be used to create a sub-page for an |
63 | 63 | // existing page |
64 | | - if ( '' != $super_page ) |
| 64 | + if ( $super_page != '' ) |
65 | 65 | { |
66 | 66 | $page_name = "$super_page/$page_name"; |
67 | 67 | } |
68 | | - if ( '' != $page_name ) { |
| 68 | + if ( $page_name != '' ) { |
69 | 69 | // Append the namespace prefix to the page name, |
70 | 70 | // if a namespace was not already entered. |
71 | 71 | if ( strpos( $page_name, ":" ) === false && $target_namespace != '' ) |
— | — | @@ -173,7 +173,7 @@ |
174 | 174 | } |
175 | 175 | } |
176 | 176 | |
177 | | - if ( '' != $params ) { |
| 177 | + if ( $params != '' ) { |
178 | 178 | $redirect_url .= ( strpos( $redirect_url, "?" ) > - 1 ) ? '&' : '?'; |
179 | 179 | $redirect_url .= $params; |
180 | 180 | } |
Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php |
— | — | @@ -351,7 +351,7 @@ |
352 | 352 | foreach ( $values_array as $cur_value ) { |
353 | 353 | $cur_value = trim( $cur_value ); |
354 | 354 | // ignore a value if it's null |
355 | | - if ( '' != $cur_value ) { |
| 355 | + if ( $cur_value != '' ) { |
356 | 356 | // remove whitespaces |
357 | 357 | $results[] = str_replace( $var, $cur_value, $formula ); |
358 | 358 | } |
— | — | @@ -399,14 +399,16 @@ |
400 | 400 | $values_array = explode( $parser->mStripState->unstripNoWiki( $delimiter ), $value ); |
401 | 401 | $results = array(); |
402 | 402 | $template = trim( $template ); |
| 403 | + |
403 | 404 | foreach ( $values_array as $cur_value ) { |
404 | 405 | $cur_value = trim( $cur_value ); |
405 | 406 | // ignore a value if it's null |
406 | | - if ( '' != $cur_value ) { |
| 407 | + if ( $cur_value != '' ) { |
407 | 408 | // remove whitespaces |
408 | 409 | $results[] = '{{' . $template . '|' . $cur_value . '}}'; |
409 | 410 | } |
410 | 411 | } |
| 412 | + |
411 | 413 | return array( implode( $new_delimiter, $results ), 'noparse' => false, 'isHTML' => false ); |
412 | 414 | } |
413 | 415 | |
Index: trunk/extensions/SemanticForms/includes/SF_LinkUtils.php |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | global $wgCapitalLinks; |
33 | 33 | |
34 | 34 | $namespace = wfUrlencode( $title->getNsText() ); |
35 | | - if ( '' != $namespace ) { |
| 35 | + if ( $namespace != '' ) { |
36 | 36 | $namespace .= ':'; |
37 | 37 | } |
38 | 38 | if ( $wgCapitalLinks ) { |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | global $wgCapitalLinks; |
52 | 52 | |
53 | 53 | $namespace = $title->getNsText(); |
54 | | - if ( '' != $namespace ) { |
| 54 | + if ( $namespace != '' ) { |
55 | 55 | $namespace .= ':'; |
56 | 56 | } |
57 | 57 | if ( $wgCapitalLinks ) { |
— | — | @@ -67,13 +67,17 @@ |
68 | 68 | * (which should be a category, property, or namespace page) |
69 | 69 | */ |
70 | 70 | static function getFormsThatPagePointsTo( $page_name, $page_namespace, $prop_smw_id, $backup_prop_smw_id, $prop_id ) { |
71 | | - if ( $page_name == NULL ) |
| 71 | + if ( $page_name == NULL ) { |
72 | 72 | return array(); |
| 73 | + } |
73 | 74 | |
74 | 75 | global $sfgContLang; |
75 | | - // produce a useful error message if SMW isn't installed |
76 | | - if ( ! function_exists( 'smwfGetStore' ) ) |
| 76 | + |
| 77 | + // Produce a useful error message if SMW isn't installed. |
| 78 | + if ( ! function_exists( 'smwfGetStore' ) ) { |
77 | 79 | die( "ERROR: <a href=\"http://semantic-mediawiki.org\">Semantic MediaWiki</a> must be installed for Semantic Forms to run!" ); |
| 80 | + } |
| 81 | + |
78 | 82 | $store = smwfGetStore(); |
79 | 83 | $title = Title::makeTitleSafe( $page_namespace, $page_name ); |
80 | 84 | $property = SMWPropertyValue::makeProperty( $prop_smw_id ); |