Index: trunk/extensions/SemanticForms/includes/SF_PageSchemas.php |
— | — | @@ -139,7 +139,7 @@ |
140 | 140 | $listSeparator = ','; |
141 | 141 | $key_values_str = str_replace( "\\$listSeparator", "\a", $val ); |
142 | 142 | $key_values_array = explode( $listSeparator, $key_values_str ); |
143 | | - foreach ( $key_values_array as $i => $value ) { |
| 143 | + foreach ( $key_values_array as $value ) { |
144 | 144 | // replace beep back with comma, trim |
145 | 145 | $value = str_replace( "\a", $listSeparator, trim( $value ) ); |
146 | 146 | $param_value = explode( "=", $value, 2 ); |
— | — | @@ -225,7 +225,6 @@ |
226 | 226 | } |
227 | 227 | |
228 | 228 | public static function getTemplateEditingHTML( $psTemplate ) { |
229 | | - $form_array = array(); |
230 | 229 | $hasExistingValues = false; |
231 | 230 | $templateLabel = null; |
232 | 231 | $addAnotherText = null; |
— | — | @@ -328,7 +327,6 @@ |
329 | 328 | $form_fields = array(); |
330 | 329 | $fieldsInfo = $psTemplate->getFields(); |
331 | 330 | foreach ( $fieldsInfo as $i => $psField ) { |
332 | | - $fieldName = $psField->getName(); |
333 | 331 | $fieldFormArray = $psField->getObject( 'semanticforms_FormInput' ); |
334 | 332 | if ( !is_null( $fieldFormArray ) ) { |
335 | 333 | $formField = SFFormField::create( $i, $template_fields[$i] ); |
— | — | @@ -356,8 +354,6 @@ |
357 | 355 | * the current Page Schemas schema. |
358 | 356 | */ |
359 | 357 | public static function getPagesToGenerate( $pageSchemaObj ) { |
360 | | - global $wgOut, $wgUser; |
361 | | - |
362 | 358 | $psTemplates = $pageSchemaObj->getTemplates(); |
363 | 359 | foreach ( $psTemplates as $psTemplate ) { |
364 | 360 | $title = Title::makeTitleSafe( NS_TEMPLATE, $psTemplate->getName() ); |
— | — | @@ -431,7 +427,7 @@ |
432 | 428 | * Generate pages (form and templates) specified in the list. |
433 | 429 | */ |
434 | 430 | public static function generatePages( $pageSchemaObj, $selectedPages ) { |
435 | | - global $wgOut, $wgUser; |
| 431 | + global $wgUser; |
436 | 432 | |
437 | 433 | $psTemplates = $pageSchemaObj->getTemplates(); |
438 | 434 | |
Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.php |
— | — | @@ -380,7 +380,7 @@ |
381 | 381 | } |
382 | 382 | |
383 | 383 | static function getShowFCKEditor() { |
384 | | - global $wgUser, $wgDefaultUserOptions; |
| 384 | + global $wgUser; |
385 | 385 | |
386 | 386 | // Differentiate between FCKeditor and the newer CKeditor, |
387 | 387 | // which isn't handled here |
Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php |
— | — | @@ -595,7 +595,7 @@ |
596 | 596 | $params = func_get_args(); |
597 | 597 | array_shift( $params ); // don't need the parser |
598 | 598 | |
599 | | - foreach ( $params as $i => $param ) { |
| 599 | + foreach ( $params as $param ) { |
600 | 600 | |
601 | 601 | $elements = explode( '=', $param, 2 ); |
602 | 602 | |
Index: trunk/extensions/SemanticForms/includes/SF_TemplateInForm.php |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | // Then, get calls to #set and #set_internal |
84 | 84 | // (thankfully, they have basically the same syntax). |
85 | 85 | if ( preg_match_all( '/#(set|set_internal):(.*?}}})\s*}}/mis', $templateText, $matches ) ) { |
86 | | - foreach ( $matches[2] as $i => $match ) { |
| 86 | + foreach ( $matches[2] as $match ) { |
87 | 87 | if ( preg_match_all( '/([^|{]*?)=\s*{{{([^|}]*)/mis', $match, $matches2 ) ) { |
88 | 88 | foreach ( $matches2[1] as $i => $propertyName ) { |
89 | 89 | $fieldName = trim( $matches2[2][$i] ); |
— | — | @@ -98,7 +98,7 @@ |
99 | 99 | |
100 | 100 | // Then, get calls to #declare. |
101 | 101 | if ( preg_match_all( '/#declare:(.*?)}}/mis', $templateText, $matches ) ) { |
102 | | - foreach ( $matches[1] as $i => $match ) { |
| 102 | + foreach ( $matches[1] as $match ) { |
103 | 103 | $setValues = explode( '|', $match ); |
104 | 104 | foreach ( $setValues as $valuePair ) { |
105 | 105 | $keyAndVal = explode( '=', $valuePair ); |
— | — | @@ -116,7 +116,7 @@ |
117 | 117 | |
118 | 118 | // Finally, get any non-semantic fields defined. |
119 | 119 | if ( preg_match_all( '/{{{([^|}]*)/mis', $templateText, $matches ) ) { |
120 | | - foreach ( $matches[1] as $i => $fieldName ) { |
| 120 | + foreach ( $matches[1] as $fieldName ) { |
121 | 121 | $fieldName = trim( $fieldName ); |
122 | 122 | if ( !empty( $fieldName ) && ( ! in_array( $fieldName, $fieldNamesArray ) ) ) { |
123 | 123 | $cur_pos = stripos( $templateText, $fieldName ); |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_ComboBoxInput.php |
— | — | @@ -37,7 +37,6 @@ |
38 | 38 | if ( array_key_exists( 'class', $other_args ) ) { |
39 | 39 | $className .= ' ' . $other_args['class']; |
40 | 40 | } |
41 | | - $disabled_text = ( $is_disabled ) ? 'disabled' : ''; |
42 | 41 | |
43 | 42 | if ( array_key_exists( 'size', $other_args ) ) { |
44 | 43 | $size = $other_args['size']; |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_CategoryInput.php |
— | — | @@ -26,12 +26,8 @@ |
27 | 27 | return null; |
28 | 28 | } |
29 | 29 | |
30 | | - global $sfgTabIndex, $sfgFieldNum; |
| 30 | + global $sfgTabIndex; |
31 | 31 | |
32 | | - $className = ( $is_mandatory ) ? 'mandatoryField' : 'createboxInput'; |
33 | | - if ( array_key_exists( 'class', $other_args ) ) { |
34 | | - $className .= ' ' . $other_args['class']; |
35 | | - } |
36 | 32 | if ( array_key_exists( 'top category', $other_args ) ) { |
37 | 33 | $top_category = $other_args['top category']; |
38 | 34 | } else { |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_DateInput.php |
— | — | @@ -49,8 +49,6 @@ |
50 | 50 | public static function getMainHTML( $date, $input_name, $is_mandatory, $is_disabled, $other_args ) { |
51 | 51 | global $sfgTabIndex, $sfgFieldNum, $wgAmericanDates; |
52 | 52 | |
53 | | - $input_id = "input_$sfgFieldNum"; |
54 | | - |
55 | 53 | if ( $date ) { |
56 | 54 | // Can show up here either as an array or a string, |
57 | 55 | // depending on whether it came from user input or a |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_CategoriesInput.php |
— | — | @@ -28,12 +28,7 @@ |
29 | 29 | |
30 | 30 | global $sfgTabIndex, $sfgFieldNum, $wgCapitalLinks; |
31 | 31 | |
32 | | - $className = ( $is_mandatory ) ? 'mandatoryField' : 'createboxInput'; |
33 | | - if ( array_key_exists( 'class', $other_args ) ) { |
34 | | - $className .= ' ' . $other_args['class']; |
35 | | - } |
36 | 32 | $input_id = "input_$sfgFieldNum"; |
37 | | - $info_id = "info_$sfgFieldNum"; |
38 | 33 | // get list delimiter - default is comma |
39 | 34 | if ( array_key_exists( 'delimiter', $other_args ) ) { |
40 | 35 | $delimiter = $other_args['delimiter']; |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_RadioButtonInput.php |
— | — | @@ -64,7 +64,7 @@ |
65 | 65 | } |
66 | 66 | $itemAttrs = array( 'class' => $itemClass ); |
67 | 67 | |
68 | | - foreach ( $possible_values as $i => $possible_value ) { |
| 68 | + foreach ( $possible_values as $possible_value ) { |
69 | 69 | $sfgTabIndex++; |
70 | 70 | $sfgFieldNum++; |
71 | 71 | $input_id = "input_$sfgFieldNum"; |
Index: trunk/extensions/SemanticForms/includes/forminputs/SF_DateTimeInput.php |
— | — | @@ -86,7 +86,6 @@ |
87 | 87 | } |
88 | 88 | } |
89 | 89 | } else { |
90 | | - $cur_date = getdate(); |
91 | 90 | $hour = null; |
92 | 91 | $minute = null; |
93 | 92 | $second = '00'; // default at least this value |
Index: trunk/extensions/SemanticForms/includes/SF_AutocompleteAPI.php |
— | — | @@ -27,7 +27,6 @@ |
28 | 28 | $category = $params['category']; |
29 | 29 | $concept = $params['concept']; |
30 | 30 | $external_url = $params['external_url']; |
31 | | - $limit = $params['limit']; |
32 | 31 | |
33 | 32 | if ( strlen( $substr ) == 0 ) { |
34 | 33 | $this->dieUsage( 'The substring must be specified', 'param_substr' ); |
Index: trunk/extensions/SemanticForms/includes/SF_Utils.php |
— | — | @@ -339,7 +339,7 @@ |
340 | 340 | self::loadJavascriptAndCSS( $parser ); |
341 | 341 | return; |
342 | 342 | } |
343 | | - global $sfgScriptPath, $smwgScriptPath, $wgScriptPath, $wgJsMimeType, $sfgUseFormEditPage; |
| 343 | + global $sfgScriptPath, $smwgScriptPath, $wgJsMimeType, $sfgUseFormEditPage; |
344 | 344 | global $smwgJQueryIncluded, $smwgJQUIAutoIncluded; |
345 | 345 | // jQuery and jQuery UI are used so often in forms, we might as |
346 | 346 | // well assume they'll always be used, and include them in |
— | — | @@ -650,7 +650,6 @@ |
651 | 651 | return null; |
652 | 652 | } |
653 | 653 | |
654 | | - $names_array = array(); |
655 | 654 | // The query depends on whether this is a property, category, |
656 | 655 | // concept or namespace. |
657 | 656 | if ( $source_type == 'property' || $source_type == 'attribute' || $source_type == 'relation' ) { |
Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php |
— | — | @@ -333,7 +333,7 @@ |
334 | 334 | * only a page formula exists). |
335 | 335 | */ |
336 | 336 | function formHTML( $form_def, $form_submitted, $source_is_page, $form_id = null, $existing_page_content = null, $page_name = null, $page_name_formula = null, $is_query = false, $is_embedded = false ) { |
337 | | - global $wgRequest, $wgUser, $wgOut, $wgParser; |
| 337 | + global $wgRequest, $wgUser, $wgParser; |
338 | 338 | global $sfgTabIndex; // used to represent the current tab index in the form |
339 | 339 | global $sfgFieldNum; // used for setting various HTML IDs |
340 | 340 | |
— | — | @@ -481,7 +481,6 @@ |
482 | 482 | // Placeholder name in the form |
483 | 483 | $curPlaceholder = null; |
484 | 484 | // Used to store the HTML code of the multiple template, to reinsert it into the right spot |
485 | | - $multipleTemplateString = ""; |
486 | 485 | // This array will keep track of all the replaced @<name>@ strings |
487 | 486 | $placeholderFields = array(); |
488 | 487 | |
— | — | @@ -1533,13 +1532,14 @@ |
1534 | 1533 | else |
1535 | 1534 | $form_text .= SFFormUtils::formBottom( $form_is_disabled ); |
1536 | 1535 | } |
1537 | | - $starttime = wfTimestampNow(); |
| 1536 | + |
1538 | 1537 | $page_article = new Article( $this->mPageTitle, 0 ); |
1539 | | - $edittime = $page_article->getTimestamp(); |
| 1538 | + |
1540 | 1539 | if ( !$is_query ) { |
1541 | 1540 | $form_text .= SFFormUtils::hiddenFieldHTML( 'wpStarttime', wfTimestampNow() ); |
1542 | 1541 | $form_text .= SFFormUtils::hiddenFieldHTML( 'wpEdittime', $page_article->getTimestamp() ); |
1543 | 1542 | } |
| 1543 | + |
1544 | 1544 | $form_text .= "\t</form>\n"; |
1545 | 1545 | |
1546 | 1546 | // Add general Javascript code. |
Index: trunk/extensions/SemanticForms/includes/SF_AutoeditAPI.php |
— | — | @@ -422,7 +422,6 @@ |
423 | 423 | if ( !$name ) |
424 | 424 | continue; |
425 | 425 | |
426 | | - $values = array(); |
427 | 426 | $options = $select->getElementsByTagName( 'option' ); |
428 | 427 | |
429 | 428 | if ( count( $options ) && ( !$select->hasAttribute( "multiple" ) || $options->item( 0 )->hasAttribute( 'selected' ) ) ) { |
— | — | @@ -462,7 +461,7 @@ |
463 | 462 | private function parseDataFromQueryString( &$data, $queryString ) { |
464 | 463 | $params = explode( '&', $queryString ); |
465 | 464 | |
466 | | - foreach ( $params as $i => $param ) { |
| 465 | + foreach ( $params as $param ) { |
467 | 466 | $elements = explode( '=', $param, 2 ); |
468 | 467 | |
469 | 468 | $key = trim( urldecode( $elements[0] ) ); |