Index: trunk/extensions/SemanticForms/specials/SF_Forms.php |
— | — | @@ -17,7 +17,6 @@ |
18 | 18 | */ |
19 | 19 | function __construct() { |
20 | 20 | parent::__construct( 'Forms' ); |
21 | | - SFUtils::loadMessages(); |
22 | 21 | } |
23 | 22 | |
24 | 23 | function execute( $query ) { |
— | — | @@ -55,8 +54,6 @@ |
56 | 55 | function getPageHeader() { |
57 | 56 | global $wgUser; |
58 | 57 | |
59 | | - SFUtils::loadMessages(); |
60 | | - |
61 | 58 | $sk = $wgUser->getSkin(); |
62 | 59 | $create_form_link = SFUtils::linkForSpecialPage( $sk, 'CreateForm' ); |
63 | 60 | $header = "<p>" . $create_form_link . ".</p>\n"; |
Index: trunk/extensions/SemanticForms/specials/SF_CreateForm.php |
— | — | @@ -18,7 +18,6 @@ |
19 | 19 | */ |
20 | 20 | function __construct() { |
21 | 21 | parent::__construct( 'CreateForm' ); |
22 | | - SFUtils::loadMessages(); |
23 | 22 | } |
24 | 23 | |
25 | 24 | function execute( $query ) { |
— | — | @@ -51,8 +50,6 @@ |
52 | 51 | global $wgOut, $wgRequest, $wgUser, $sfgScriptPath; |
53 | 52 | $db = wfGetDB( DB_SLAVE ); |
54 | 53 | |
55 | | - SFUtils::loadMessages(); |
56 | | - |
57 | 54 | // Create Javascript to populate fields to let the user input |
58 | 55 | // parameters for the field, based on the input type selected |
59 | 56 | // in the dropdown. |
Index: trunk/extensions/SemanticForms/specials/SF_CreateProperty.php |
— | — | @@ -18,7 +18,6 @@ |
19 | 19 | */ |
20 | 20 | function __construct() { |
21 | 21 | parent::__construct( 'CreateProperty' ); |
22 | | - SFUtils::loadMessages(); |
23 | 22 | } |
24 | 23 | |
25 | 24 | function execute( $query ) { |
— | — | @@ -58,8 +57,6 @@ |
59 | 58 | global $wgOut, $wgRequest, $sfgScriptPath; |
60 | 59 | global $smwgContLang; |
61 | 60 | |
62 | | - SFUtils::loadMessages(); |
63 | | - |
64 | 61 | # cycle through the query values, setting the appropriate local variables |
65 | 62 | $property_name = $wgRequest->getVal( 'property_name' ); |
66 | 63 | $property_type = $wgRequest->getVal( 'property_type' ); |
Index: trunk/extensions/SemanticForms/specials/SF_CreateClass.php |
— | — | @@ -19,7 +19,6 @@ |
20 | 20 | */ |
21 | 21 | public function __construct() { |
22 | 22 | parent::__construct( 'CreateClass', 'createclass' ); |
23 | | - SFUtils::loadMessages(); |
24 | 23 | } |
25 | 24 | |
26 | 25 | static function addJavascript( $numStartingRows ) { |
Index: trunk/extensions/SemanticForms/specials/SF_FormEdit.php |
— | — | @@ -22,7 +22,6 @@ |
23 | 23 | */ |
24 | 24 | function __construct() { |
25 | 25 | parent::__construct( 'FormEdit' ); |
26 | | - SFUtils::loadMessages(); |
27 | 26 | } |
28 | 27 | |
29 | 28 | function execute( $query, $redirectOnError = true ) { |
— | — | @@ -90,8 +89,6 @@ |
91 | 90 | static function printForm( &$form_name, &$target_name, $alt_forms = array(), $redirectOnError = false ) { |
92 | 91 | global $wgOut, $wgRequest, $wgUser, $sfgFormPrinter; |
93 | 92 | |
94 | | - SFUtils::loadMessages(); |
95 | | - |
96 | 93 | // If we have no form name we might as well stop right away |
97 | 94 | if ( $form_name === '' ) { |
98 | 95 | return 'sf_formedit_badurl'; |
Index: trunk/extensions/SemanticForms/specials/SF_RunQuery.php |
— | — | @@ -17,7 +17,6 @@ |
18 | 18 | */ |
19 | 19 | function __construct() { |
20 | 20 | parent::__construct( 'RunQuery' ); |
21 | | - SFUtils::loadMessages(); |
22 | 21 | } |
23 | 22 | |
24 | 23 | function execute( $query ) { |
— | — | @@ -88,11 +87,8 @@ |
89 | 88 | // isn't needed. |
90 | 89 | if ( $wgParser->getOutput() == null ) { |
91 | 90 | $headItems = array(); |
92 | | - // method was added in MW 1.16 |
93 | | - } elseif ( method_exists( $wgParser->getOutput(), 'getHeadItems' ) ) { |
94 | | - $headItems = $wgParser->getOutput()->getHeadItems(); |
95 | 91 | } else { |
96 | | - $headItems = $wgParser->getOutput()->mHeadItems; |
| 92 | + $headItems = $wgParser->getOutput()->getHeadItems(); |
97 | 93 | } |
98 | 94 | foreach ( $headItems as $key => $item ) { |
99 | 95 | $wgOut->addHeadItem( $key, "\t\t" . $item . "\n" ); |
Index: trunk/extensions/SemanticForms/specials/SF_Templates.php |
— | — | @@ -17,7 +17,6 @@ |
18 | 18 | */ |
19 | 19 | function __construct() { |
20 | 20 | parent::__construct( 'Templates' ); |
21 | | - SFUtils::loadMessages(); |
22 | 21 | } |
23 | 22 | |
24 | 23 | function execute( $query ) { |
— | — | @@ -56,8 +55,6 @@ |
57 | 56 | function getPageHeader() { |
58 | 57 | global $wgUser; |
59 | 58 | |
60 | | - SFUtils::loadMessages(); |
61 | | - |
62 | 59 | $sk = $wgUser->getSkin(); |
63 | 60 | $create_template_link = SFUtils::linkForSpecialPage( $sk, 'CreateTemplate' ); |
64 | 61 | $header = "<p>" . $create_template_link . ".</p>\n"; |
— | — | @@ -115,7 +112,6 @@ |
116 | 113 | $text = $skin->makeLinkObj( $title, htmlspecialchars( $title->getText() ) ); |
117 | 114 | $category = $this->getCategoryDefinedByTemplate( $title ); |
118 | 115 | if ( $category !== '' ) { |
119 | | - SFUtils::loadMessages(); |
120 | 116 | $text .= ' ' . wfMsgExt( 'sf_templates_definescat', 'parseinline', SFUtils::linkText( NS_CATEGORY, $category ) ); |
121 | 117 | } |
122 | 118 | return $text; |
Index: trunk/extensions/SemanticForms/specials/SF_CreateTemplate.php |
— | — | @@ -18,7 +18,6 @@ |
19 | 19 | */ |
20 | 20 | public function SFCreateTemplate() { |
21 | 21 | parent::__construct( 'CreateTemplate' ); |
22 | | - SFUtils::loadMessages(); |
23 | 22 | } |
24 | 23 | |
25 | 24 | public function execute( $query ) { |
— | — | @@ -73,8 +72,6 @@ |
74 | 73 | } |
75 | 74 | |
76 | 75 | public static function printFieldEntryBox( $id, $all_properties, $display = true ) { |
77 | | - SFUtils::loadMessages(); |
78 | | - |
79 | 76 | $fieldString = $display ? '' : 'id="starterField" style="display: none"'; |
80 | 77 | $text = "\t<div class=\"fieldBox\" $fieldString>\n"; |
81 | 78 | $text .= "\t<p>" . wfMsg( 'sf_createtemplate_fieldname' ) . ' ' . |
— | — | @@ -150,7 +147,6 @@ |
151 | 148 | function printCreateTemplateForm() { |
152 | 149 | global $wgOut, $wgRequest, $wgUser, $sfgScriptPath; |
153 | 150 | |
154 | | - SFUtils::loadMessages(); |
155 | 151 | self::addJavascript(); |
156 | 152 | |
157 | 153 | $text = ''; |
Index: trunk/extensions/SemanticForms/specials/SF_CreateCategory.php |
— | — | @@ -18,7 +18,6 @@ |
19 | 19 | */ |
20 | 20 | function __construct() { |
21 | 21 | parent::__construct( 'CreateCategory' ); |
22 | | - SFUtils::loadMessages(); |
23 | 22 | } |
24 | 23 | |
25 | 24 | function execute( $query ) { |
— | — | @@ -27,7 +26,6 @@ |
28 | 27 | } |
29 | 28 | |
30 | 29 | static function createCategoryText( $default_form, $category_name, $parent_category ) { |
31 | | - SFUtils::loadMessages(); |
32 | 30 | |
33 | 31 | if ( $default_form === '' ) { |
34 | 32 | $text = wfMsgForContent( 'sf_category_desc', $category_name ); |
— | — | @@ -50,8 +48,6 @@ |
51 | 49 | function doSpecialCreateCategory() { |
52 | 50 | global $wgOut, $wgRequest, $wgUser, $sfgScriptPath; |
53 | 51 | |
54 | | - SFUtils::loadMessages(); |
55 | | - |
56 | 52 | # cycle through the query values, setting the appropriate local variables |
57 | 53 | $category_name = $wgRequest->getVal( 'category_name' ); |
58 | 54 | $default_form = $wgRequest->getVal( 'default_form' ); |
Index: trunk/extensions/SemanticForms/specials/SF_FormStart.php |
— | — | @@ -19,7 +19,6 @@ |
20 | 20 | */ |
21 | 21 | function __construct() { |
22 | 22 | parent::__construct( 'FormStart' ); |
23 | | - SFUtils::loadMessages(); |
24 | 23 | } |
25 | 24 | |
26 | 25 | function execute( $query ) { |
— | — | @@ -27,7 +26,6 @@ |
28 | 27 | |
29 | 28 | $this->setHeaders(); |
30 | 29 | |
31 | | - SFUtils::loadMessages(); |
32 | 30 | $form_name = $wgRequest->getVal( 'form' ); |
33 | 31 | $target_namespace = $wgRequest->getVal( 'namespace' ); |
34 | 32 | $super_page = $wgRequest->getVal( 'super_page' ); |
Index: trunk/extensions/SemanticForms/includes/SF_FormEditTab.php |
— | — | @@ -37,8 +37,6 @@ |
38 | 38 | global $wgRequest, $wgUser; |
39 | 39 | global $sfgRenameEditTabs, $sfgRenameMainEditTab; |
40 | 40 | |
41 | | - SFUtils::loadMessages(); |
42 | | - |
43 | 41 | $user_can_edit = $wgUser->isAllowed( 'edit' ) && $title->userCan( 'edit' ); |
44 | 42 | // Create the form edit tab, and apply whatever changes are |
45 | 43 | // specified by the edit-tab global variables. |
— | — | @@ -144,7 +142,6 @@ |
145 | 143 | return true; |
146 | 144 | } |
147 | 145 | if ( count( $form_names ) > 1 ) { |
148 | | - SFUtils::loadMessages(); |
149 | 146 | $warning_text = "\t" . '<div class="warningMessage">' . wfMsg( 'sf_formedit_morethanoneform' ) . "</div>\n"; |
150 | 147 | $wgOut->addHTML( $warning_text ); |
151 | 148 | } |
Index: trunk/extensions/SemanticForms/includes/SF_Utils.php |
— | — | @@ -14,25 +14,9 @@ |
15 | 15 | */ |
16 | 16 | public static function linkForSpecialPage( $skin, $specialPageName ) { |
17 | 17 | $specialPage = SpecialPage::getPage( $specialPageName ); |
18 | | - // link() method was added in MW 1.16 |
19 | | - if ( method_exists( $skin, 'link' ) ) { |
20 | | - return $skin->link( $specialPage->getTitle(), $specialPage->getDescription() ); |
21 | | - } else { |
22 | | - return $skin->makeKnownLinkObj( $specialPage->getTitle(), $specialPage->getDescription() ); |
23 | | - } |
| 18 | + return $skin->link( $specialPage->getTitle(), $specialPage->getDescription() ); |
24 | 19 | } |
25 | 20 | |
26 | | - public static function isCapitalized( $title ) { |
27 | | - // Method was added in MW 1.16. |
28 | | - $realFunction = array( 'MWNamespace', 'isCapitalized' ); |
29 | | - if ( is_callable( $realFunction ) ) { |
30 | | - return MWNamespace::isCapitalized( $title->getNamespace() ); |
31 | | - } else { |
32 | | - global $wgCapitalLinks; |
33 | | - return $wgCapitalLinks; |
34 | | - } |
35 | | - } |
36 | | - |
37 | 21 | /** |
38 | 22 | * Creates the name of the page that appears in the URL; |
39 | 23 | * this method is necessary because Title::getPartialURL(), for |
— | — | @@ -43,7 +27,7 @@ |
44 | 28 | if ( $namespace !== '' ) { |
45 | 29 | $namespace .= ':'; |
46 | 30 | } |
47 | | - if ( self::isCapitalized( $title ) ) { |
| 31 | + if ( MWNamespace::isCapitalized( $title->getNamespace() ) ) { |
48 | 32 | global $wgContLang; |
49 | 33 | return $namespace . $wgContLang->ucfirst( $title->getPartialURL() ); |
50 | 34 | } else { |
— | — | @@ -60,7 +44,7 @@ |
61 | 45 | if ( $namespace !== '' ) { |
62 | 46 | $namespace .= ':'; |
63 | 47 | } |
64 | | - if ( self::isCapitalized( $title ) ) { |
| 48 | + if ( MWNamespace::isCapitalized( $title->getNamespace() ) ) { |
65 | 49 | global $wgContLang; |
66 | 50 | return $namespace . $wgContLang->ucfirst( $title->getText() ); |
67 | 51 | } else { |
— | — | @@ -652,7 +636,7 @@ |
653 | 637 | |
654 | 638 | // The query depends on whether this is a property, category, |
655 | 639 | // concept or namespace. |
656 | | - if ( $source_type == 'property' || $source_type == 'attribute' || $source_type == 'relation' ) { |
| 640 | + if ( $source_type == 'property' ) { |
657 | 641 | $names_array = self::getAllValuesForProperty( $source_name ); |
658 | 642 | } elseif ( $source_type == 'category' ) { |
659 | 643 | $names_array = self::getAllPagesForCategory( $source_name, 10 ); |
— | — | @@ -719,27 +703,10 @@ |
720 | 704 | } |
721 | 705 | |
722 | 706 | /** |
723 | | - * Loads messages only for MediaWiki versions that need it (< 1.16) |
724 | | - */ |
725 | | - public static function loadMessages() { |
726 | | - global $wgVersion; |
727 | | - if ( version_compare( $wgVersion, '1.16', '<' ) ) { |
728 | | - wfLoadExtensionMessages( 'SemanticForms' ); |
729 | | - } |
730 | | - } |
731 | | - |
732 | | - /** |
733 | 707 | * Gets the word in the wiki's language, as defined in Semantic |
734 | 708 | * MediaWiki, for either the value 'yes' or 'no'. |
735 | 709 | */ |
736 | 710 | public static function getWordForYesOrNo( $isYes ) { |
737 | | - global $wgVersion; |
738 | | - // Manually load SMW's message values here, in case they |
739 | | - // didn't get loaded before. |
740 | | - if ( version_compare( $wgVersion, '1.16', '<' ) ) { |
741 | | - wfLoadExtensionMessages( 'SemanticMediaWiki' ); |
742 | | - } |
743 | | - |
744 | 711 | $wordsMsg = ( $isYes ) ? 'smw_true_words' : 'smw_false_words'; |
745 | 712 | $possibleWords = explode( ',', wfMsgForContent( $wordsMsg ) ); |
746 | 713 | // Get the value in the series that tends to be "yes" or "no" - |
Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php |
— | — | @@ -174,11 +174,7 @@ |
175 | 175 | if ( $count > 0 ) { |
176 | 176 | $pager->mLimit = 10; |
177 | 177 | $out->addHTML( '<div class="mw-warning-with-logexcerpt">' ); |
178 | | - // the message name changed in MW 1.16 |
179 | | - if ( ! wfEmptyMsg( 'moveddeleted-notice', wfMsg( 'moveddeleted-notice' ) ) ) |
180 | | - $out->addWikiMsg( 'moveddeleted-notice' ); |
181 | | - else |
182 | | - $out->addWikiMsg( 'recreate-deleted-warn' ); |
| 178 | + $out->addWikiMsg( 'moveddeleted-notice' ); |
183 | 179 | $out->addHTML( |
184 | 180 | $loglist->beginLogEventsList() . |
185 | 181 | $pager->getBody() . |
Index: trunk/extensions/SemanticForms/includes/SF_FormLinker.php |
— | — | @@ -241,7 +241,6 @@ |
242 | 242 | if ( '' === $namespace_name ) { |
243 | 243 | // If it's in the main (blank) namespace, check for the |
244 | 244 | // file named with the word for "Main" in this language. |
245 | | - SFUtils::loadMessages(); |
246 | 245 | $namespace_name = wfMsgForContent( 'sf_blank_namespace' ); |
247 | 246 | } |
248 | 247 | if ( $form_edit_link = self::getFormEditLinkForPage( $title, $namespace_name, NS_PROJECT ) ) { |
— | — | @@ -339,7 +338,6 @@ |
340 | 339 | if ( NS_MAIN === $namespace ) { |
341 | 340 | // If it's in the main (blank) namespace, check for the |
342 | 341 | // file named with the word for "Main" in this language. |
343 | | - SFUtils::loadMessages(); |
344 | 342 | $namespace_label = wfMsgForContent( 'sf_blank_namespace' ); |
345 | 343 | } else { |
346 | 344 | global $wgContLang; |
Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.php |
— | — | @@ -41,12 +41,7 @@ |
42 | 42 | } |
43 | 43 | |
44 | 44 | static function hiddenFieldHTML( $input_name, $cur_value ) { |
45 | | - // 'Html' class was added in MW 1.16 |
46 | | - if ( class_exists( 'Html' ) ) { |
47 | | - return "\t" . Html::hidden( $input_name, $cur_value ) . "\n"; |
48 | | - } else { |
49 | | - return "\t" . Xml::hidden( $input_name, $cur_value ) . "\n"; |
50 | | - } |
| 45 | + return "\t" . Html::hidden( $input_name, $cur_value ) . "\n"; |
51 | 46 | } |
52 | 47 | |
53 | 48 | /** |
Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php |
— | — | @@ -199,8 +199,7 @@ |
200 | 200 | $inTooltip = Sanitizer::decodeCharReferences( $value ); |
201 | 201 | } elseif ( $param_name == 'target' ) { |
202 | 202 | $inTargetName = $value; |
203 | | - } elseif ( $param_name == null && $value == 'popup' |
204 | | - && version_compare( $wgVersion, '1.16', '>=' ) ) { |
| 203 | + } elseif ( $param_name == null && $value == 'popup' ) { |
205 | 204 | self::loadScriptsForPopupForm( $parser ); |
206 | 205 | $classStr = 'popupformlink'; |
207 | 206 | } |
— | — | @@ -315,8 +314,7 @@ |
316 | 315 | $autocompletion_type = 'namespace'; |
317 | 316 | } elseif ( $param_name == 'remote autocompletion' ) { |
318 | 317 | $inRemoteAutocompletion = true; |
319 | | - } elseif ( $param_name == null && $value == 'popup' |
320 | | - && version_compare( $wgVersion, '1.16', '>=' ) ) { |
| 318 | + } elseif ( $param_name == null && $value == 'popup' ) { |
321 | 319 | self::loadScriptsForPopupForm( $parser ); |
322 | 320 | $classStr = 'popupforminput'; |
323 | 321 | } |
— | — | @@ -415,7 +413,6 @@ |
416 | 414 | ) . "\n"; |
417 | 415 | } |
418 | 416 | } |
419 | | - SFUtils::loadMessages(); |
420 | 417 | $button_str = ( $inButtonStr != '' ) ? $inButtonStr : wfMsg( 'sf_formstart_createoredit' ); |
421 | 418 | $str .= <<<END |
422 | 419 | <input type="submit" value="$button_str" /></p> |
Index: trunk/extensions/SemanticForms/SemanticForms.php |
— | — | @@ -172,7 +172,7 @@ |
173 | 173 | |
174 | 174 | $wgExtensionMessagesFiles['SemanticForms'] = $sfgIP . '/languages/SF_Messages.php'; |
175 | 175 | $wgExtensionMessagesFiles['SemanticFormsAlias'] = $sfgIP . '/languages/SF_Aliases.php'; |
176 | | -// Allow for file-upload windows for MW >= 1.16.1 |
| 176 | +// Allow for popup windows for file upload |
177 | 177 | $wgEditPageFrameOptions = 'SAMEORIGIN'; |
178 | 178 | |
179 | 179 | // register client-side modules |