Index: trunk/extensions/SemanticForms/includes/SF_FormInputs.php |
— | — | @@ -1040,6 +1040,14 @@ |
1041 | 1041 | global $wgCategoryTreeMaxDepth; |
1042 | 1042 | $wgCategoryTreeMaxDepth = 10; |
1043 | 1043 | $tree = efCategoryTreeParserHook( $top_category, array( 'mode' => 'categories', 'depth' => 10 ) ); |
| 1044 | + |
| 1045 | + // capitalize the first letter, if first letters always get capitalized |
| 1046 | + global $wgCapitalLinks; |
| 1047 | + if ( $wgCapitalLinks ) { |
| 1048 | + global $wgContLang; |
| 1049 | + $cur_value = $wgContLang->ucfirst( $cur_value ); |
| 1050 | + } |
| 1051 | + |
1044 | 1052 | $tree = preg_replace( '/(<a class="CategoryTreeLabel.*>)(.*)(<\/a>)/', '<input id="' . $input_id . '" tabindex="' . $sfgTabIndex . '" name="' . $input_name . '" value="$2" type="radio"> $1$2$3', $tree ); |
1045 | 1053 | $tree = str_replace( "value=\"$cur_value\"", "value=\"$cur_value\" checked=\"checked\"", $tree ); |
1046 | 1054 | // if it's disabled, set all to disabled |
— | — | @@ -1061,7 +1069,7 @@ |
1062 | 1070 | if ( ! function_exists( 'efCategoryTreeParserHook' ) ) |
1063 | 1071 | return array( null, null ); |
1064 | 1072 | |
1065 | | - global $sfgTabIndex, $sfgFieldNum; |
| 1073 | + global $sfgTabIndex, $sfgFieldNum, $wgCapitalLinks; |
1066 | 1074 | |
1067 | 1075 | $className = ( $is_mandatory ) ? "mandatoryField" : "createboxInput"; |
1068 | 1076 | if ( array_key_exists( 'class', $other_args ) ) |
— | — | @@ -1108,6 +1116,12 @@ |
1109 | 1117 | } |
1110 | 1118 | // set all checkboxes matching $cur_values to checked |
1111 | 1119 | foreach ( $cur_values as $value ) { |
| 1120 | + // capitalize the first letter, if first letters always get capitalized |
| 1121 | + if ( $wgCapitalLinks ) { |
| 1122 | + global $wgContLang; |
| 1123 | + $value = $wgContLang->ucfirst( $value ); |
| 1124 | + } |
| 1125 | + |
1112 | 1126 | $tree = str_replace( "value=\"$value\"", "value=\"$value\" checked=\"checked\"", $tree ); |
1113 | 1127 | } |
1114 | 1128 | // if it's disabled, set all to disabled |