Index: trunk/extensions/SemanticDrilldown/includes/SD_GlobalFunctions.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | |
9 | 9 | if (!defined('MEDIAWIKI')) die(); |
10 | 10 | |
11 | | -define('SD_VERSION','0.4.4'); |
| 11 | +define('SD_VERSION','0.4.5'); |
12 | 12 | |
13 | 13 | // constants for special properties |
14 | 14 | define('SD_SP_HAS_FILTER', 1); |
— | — | @@ -29,6 +29,17 @@ |
30 | 30 | $wgExtensionFunctions[] = 'sdfLoadMessagesManually'; |
31 | 31 | } |
32 | 32 | |
| 33 | +// register all special pages |
| 34 | +$wgSpecialPages['Filters'] = 'SDFilters'; |
| 35 | +$wgSpecialPageGroups['Filters'] = 'users'; |
| 36 | +$wgAutoloadClasses['SDFilters'] = $sdgIP . '/specials/SD_Filters.php'; |
| 37 | +$wgSpecialPages['CreateFilter'] = 'SDCreateFilter'; |
| 38 | +$wgSpecialPageGroups['CreateFilter'] = 'users'; |
| 39 | +$wgAutoloadClasses['SDCreateFilter'] = $sdgIP . '/specials/SD_CreateFilter.php'; |
| 40 | +$wgSpecialPages['BrowseData'] = 'SDBrowseData'; |
| 41 | +$wgSpecialPageGroups['BrowseData'] = 'users'; |
| 42 | +$wgAutoloadClasses['SDBrowseData'] = $sdgIP . '/specials/SD_BrowseData.php'; |
| 43 | + |
33 | 44 | /** |
34 | 45 | * Do the actual intialization of the extension. This is just a delayed init that makes sure |
35 | 46 | * MediaWiki is set up properly before we add our stuff. |
— | — | @@ -44,18 +55,10 @@ |
45 | 56 | require_once($sdgIP . '/includes/SD_AppliedFilter.php'); |
46 | 57 | |
47 | 58 | /**********************************************/ |
48 | | - /***** register specials *****/ |
| 59 | + /***** register hooks *****/ |
49 | 60 | /**********************************************/ |
50 | 61 | |
51 | | - require_once($sdgIP . '/specials/SD_BrowseData.php'); |
52 | | - require_once($sdgIP . '/specials/SD_Filters.php'); |
53 | | - require_once($sdgIP . '/specials/SD_CreateFilter.php'); |
54 | | - |
55 | 62 | /**********************************************/ |
56 | | - /***** register hooks *****/ |
57 | | - /**********************************************/ |
58 | | - |
59 | | - /**********************************************/ |
60 | 63 | /***** create globals for outside hooks *****/ |
61 | 64 | /**********************************************/ |
62 | 65 | |
— | — | @@ -63,7 +66,7 @@ |
64 | 67 | /***** credits (see "Special:Version") *****/ |
65 | 68 | /**********************************************/ |
66 | 69 | $wgExtensionCredits['specialpage'][]= array( |
67 | | - 'name' => 'Semantic Drilldown', |
| 70 | + 'name' => 'Semantic Drilldown', |
68 | 71 | 'version' => SD_VERSION, |
69 | 72 | 'author' => 'Yaron Koren', |
70 | 73 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Semantic_Drilldown', |
— | — | @@ -189,20 +192,20 @@ |
190 | 193 | * children of some other category |
191 | 194 | */ |
192 | 195 | function sdfGetTopLevelCategories() { |
193 | | - $categories = array(); |
194 | | - $dbr = wfGetDB( DB_SLAVE ); |
| 196 | + $categories = array(); |
| 197 | + $dbr = wfGetDB( DB_SLAVE ); |
195 | 198 | $page = $dbr->tableName('page'); |
196 | 199 | $categorylinks = $dbr->tableName('categorylinks'); |
197 | 200 | $cat_ns = NS_CATEGORY; |
198 | 201 | $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 | 202 | $res = $dbr->query($sql); |
200 | | - if ($dbr->numRows( $res ) > 0) { |
201 | | - while ($row = $dbr->fetchRow($res)) { |
202 | | - $categories[] = str_replace('_', ' ', $row[0]); |
203 | | - } |
204 | | - } |
205 | | - $dbr->freeResult($res); |
206 | | - return $categories; |
| 203 | + if ($dbr->numRows( $res ) > 0) { |
| 204 | + while ($row = $dbr->fetchRow($res)) { |
| 205 | + $categories[] = str_replace('_', ' ', $row[0]); |
| 206 | + } |
| 207 | + } |
| 208 | + $dbr->freeResult($res); |
| 209 | + return $categories; |
207 | 210 | } |
208 | 211 | |
209 | 212 | function sdfGetSemanticProperties_0_7() { |