Index: trunk/extensions/SemanticDrilldown/includes/SD_GlobalFunctions.php |
— | — | @@ -19,17 +19,19 @@ |
20 | 20 | define('SD_SP_HAS_LABEL', 7); |
21 | 21 | define('SD_SP_HAS_DRILLDOWN_TITLE', 8); |
22 | 22 | |
23 | | -$wgExtensionFunctions[] = 'sdgSetupExtension'; |
| 23 | +$wgExtensionCredits['specialpage'][]= array( |
| 24 | + 'name' => 'Semantic Drilldown', |
| 25 | + 'version' => SD_VERSION, |
| 26 | + 'author' => 'Yaron Koren', |
| 27 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:Semantic_Drilldown', |
| 28 | + 'description' => 'A drilldown interface for navigating through semantic data', |
| 29 | +); |
24 | 30 | |
25 | 31 | require_once($sdgIP . '/languages/SD_Language.php'); |
26 | 32 | |
27 | | -if (version_compare($wgVersion, '1.11', '>=' )) { |
28 | | - $wgExtensionMessagesFiles['SemanticDrilldown'] = $sdgIP . '/languages/SD_Messages.php'; |
29 | | -} else { |
30 | | - $wgExtensionFunctions[] = 'sdfLoadMessagesManually'; |
31 | | -} |
| 33 | +$wgExtensionMessagesFiles['SemanticDrilldown'] = $sdgIP . '/languages/SD_Messages.php'; |
32 | 34 | |
33 | | -// register all special pages |
| 35 | +// register all special pages and other classes |
34 | 36 | $wgSpecialPages['Filters'] = 'SDFilters'; |
35 | 37 | $wgSpecialPageGroups['Filters'] = 'users'; |
36 | 38 | $wgAutoloadClasses['SDFilters'] = $sdgIP . '/specials/SD_Filters.php'; |
— | — | @@ -40,39 +42,10 @@ |
41 | 43 | $wgSpecialPageGroups['BrowseData'] = 'users'; |
42 | 44 | $wgAutoloadClasses['SDBrowseData'] = $sdgIP . '/specials/SD_BrowseData.php'; |
43 | 45 | |
44 | | -/** |
45 | | - * Do the actual intialization of the extension. This is just a delayed init that makes sure |
46 | | - * MediaWiki is set up properly before we add our stuff. |
47 | | - */ |
48 | | -function sdgSetupExtension() { |
49 | | - global $sdgNamespace, $sdgIP, $wgVersion, $wgExtensionCredits; |
| 46 | +$wgAutoloadClasses['SDFilter'] = $sdgIP . '/includes/SD_Filter.php'; |
| 47 | +$wgAutoloadClasses['SDFilterValue'] = $sdgIP . '/includes/SD_FilterValue.php'; |
| 48 | +$wgAutoloadClasses['SDAppliedFilter'] = $sdgIP . '/includes/SD_AppliedFilter.php'; |
50 | 49 | |
51 | | - require_once($sdgIP . '/includes/SD_Filter.php'); |
52 | | - require_once($sdgIP . '/includes/SD_FilterValue.php'); |
53 | | - require_once($sdgIP . '/includes/SD_AppliedFilter.php'); |
54 | | - |
55 | | - /**********************************************/ |
56 | | - /***** register hooks *****/ |
57 | | - /**********************************************/ |
58 | | - |
59 | | - /**********************************************/ |
60 | | - /***** create globals for outside hooks *****/ |
61 | | - /**********************************************/ |
62 | | - |
63 | | - /**********************************************/ |
64 | | - /***** credits (see "Special:Version") *****/ |
65 | | - /**********************************************/ |
66 | | - $wgExtensionCredits['specialpage'][]= array( |
67 | | - 'name' => 'Semantic Drilldown', |
68 | | - 'version' => SD_VERSION, |
69 | | - 'author' => 'Yaron Koren', |
70 | | - 'url' => 'http://www.mediawiki.org/wiki/Extension:Semantic_Drilldown', |
71 | | - 'description' => 'A drilldown interface for navigating through semantic data', |
72 | | - ); |
73 | | - |
74 | | - return true; |
75 | | -} |
76 | | - |
77 | 50 | /**********************************************/ |
78 | 51 | /***** namespace settings *****/ |
79 | 52 | /**********************************************/ |
— | — | @@ -191,8 +164,7 @@ |
192 | 165 | function sdfGetTopLevelCategories() { |
193 | 166 | $categories = array(); |
194 | 167 | $dbr = wfGetDB( DB_SLAVE ); |
195 | | - $page = $dbr->tableName('page'); |
196 | | - $categorylinks = $dbr->tableName('categorylinks'); |
| 168 | + extract($dbr->tableNames('page', 'categorylinks')); |
197 | 169 | $cat_ns = NS_CATEGORY; |
198 | 170 | $sql = "SELECT page_title FROM $page p LEFT OUTER JOIN $categorylinks cl ON p.page_id = cl.cl_from WHERE p.page_namespace = $cat_ns AND cl.cl_to IS NULL"; |
199 | 171 | $res = $dbr->query($sql); |
— | — | @@ -417,8 +389,7 @@ |
418 | 390 | $pages = array(); |
419 | 391 | $subcategories = array(); |
420 | 392 | $dbr = wfGetDB( DB_SLAVE ); |
421 | | - $categorylinks = $dbr->tableName( 'categorylinks' ); |
422 | | - $page = $dbr->tableName( 'page' ); |
| 393 | + extract($dbr->tableNames('page', 'categorylinks')); |
423 | 394 | $cat_ns = NS_CATEGORY; |
424 | 395 | $query_category = str_replace(' ', '_', $category_name); |
425 | 396 | $query_category = str_replace("'", "\'", $query_category); |