Property changes on: branches/querypage-work2/phase3/maintenance/cleanupTable.inc |
___________________________________________________________________ |
Name: svn:mergeinfo |
1 | 1 | - /branches/REL1_15/phase3/maintenance/cleanupTable.inc:51646 |
/branches/querypage-work/phase3/maintenance/cleanupTable.inc:49084,49528 |
/branches/wmf-deployment/maintenance/cleanupTable.inc:56715 |
2 | 2 | + /branches/REL1_15/phase3/maintenance/cleanupTable.inc:51646 |
/branches/querypage-work/phase3/maintenance/cleanupTable.inc:49084,49528,49599 |
/branches/wmf-deployment/maintenance/cleanupTable.inc:56715 |
Property changes on: branches/querypage-work2/phase3/skins/common/jquery.js |
___________________________________________________________________ |
Name: svn:mergeinfo |
3 | 3 | - /branches/querypage-work/phase3/skins/common/jquery.js:49084,49528 |
4 | 4 | + /branches/querypage-work/phase3/skins/common/jquery.js:49084,49528,49599 |
Property changes on: branches/querypage-work2/phase3/skins/common/jquery.min.js |
___________________________________________________________________ |
Name: svn:mergeinfo |
5 | 5 | - /branches/querypage-work/phase3/skins/common/jquery.min.js:49084,49528 |
6 | 6 | + /branches/querypage-work/phase3/skins/common/jquery.min.js:49084,49528,49599 |
Property changes on: branches/querypage-work2/phase3/includes/OutputPage.php |
___________________________________________________________________ |
Name: svn:mergeinfo |
7 | 7 | - /branches/REL1_15/phase3/includes/OutputPage.php:51646 |
/branches/querypage-work/phase3/includes/OutputPage.php:49084,49528 |
/branches/wmf-deployment/includes/OutputPage.php:53381,57468 |
8 | 8 | + /branches/REL1_15/phase3/includes/OutputPage.php:51646 |
/branches/querypage-work/phase3/includes/OutputPage.php:49084,49528,49599 |
/branches/wmf-deployment/includes/OutputPage.php:53381,57468 |
Property changes on: branches/querypage-work2/phase3/includes/api |
___________________________________________________________________ |
Name: svn:mergeinfo |
9 | 9 | - /branches/REL1_15/phase3/includes/api:51646 |
/branches/REL1_16/phase3/includes/api:63621-63636 |
/branches/querypage-work/phase3/includes/api:49084,49528 |
/branches/sqlite/includes/api:58211-58321 |
/branches/wmf-deployment/includes/api:53381,59952 |
10 | 10 | + /branches/REL1_15/phase3/includes/api:51646 |
/branches/REL1_16/phase3/includes/api:63621-63636 |
/branches/querypage-work/phase3/includes/api:49084,49528,49599 |
/branches/sqlite/includes/api:58211-58321 |
/branches/wmf-deployment/includes/api:53381,59952 |
Property changes on: branches/querypage-work2/phase3/includes/ChangesList.php |
___________________________________________________________________ |
Name: svn:mergeinfo |
11 | 11 | - /branches/REL1_15/phase3/includes/ChangesList.php:51646 |
/branches/querypage-work/phase3/includes/ChangesList.php:49084,49528 |
/branches/wmf-deployment/includes/ChangesList.php:53381,57589 |
12 | 12 | + /branches/REL1_15/phase3/includes/ChangesList.php:51646 |
/branches/querypage-work/phase3/includes/ChangesList.php:49084,49528,49599 |
/branches/wmf-deployment/includes/ChangesList.php:53381,57589 |
Property changes on: branches/querypage-work2/phase3/includes/ConfEditor.php |
___________________________________________________________________ |
Name: svn:mergeinfo |
13 | 13 | - /branches/querypage-work/phase3/includes/ConfEditor.php:49084,49528 |
14 | 14 | + /branches/querypage-work/phase3/includes/ConfEditor.php:49084,49528,49599 |
Index: branches/querypage-work2/phase3/includes/specials/SpecialDisambiguations.php |
— | — | @@ -13,11 +13,11 @@ |
14 | 14 | return 'Disambiguations'; |
15 | 15 | } |
16 | 16 | |
17 | | - function isExpensive( ) { return true; } |
| 17 | + function isExpensive() { return true; } |
18 | 18 | function isSyndicated() { return false; } |
19 | 19 | |
20 | 20 | |
21 | | - function getPageHeader( ) { |
| 21 | + function getPageHeader() { |
22 | 22 | return wfMsgExt( 'disambiguations-text', array( 'parse' ) ); |
23 | 23 | } |
24 | 24 | |
— | — | @@ -85,11 +85,70 @@ |
86 | 86 | |
87 | 87 | return $sql; |
88 | 88 | } |
| 89 | + |
| 90 | + function getQueryInfo() { |
| 91 | + $dbr = wfGetDB( DB_SLAVE ); |
| 92 | + $dMsgText = wfMsgForContent('disambiguationspage'); |
| 93 | + $linkBatch = new LinkBatch; |
89 | 94 | |
90 | | - function getOrder() { |
91 | | - return ''; |
| 95 | + # If the text can be treated as a title, use it verbatim. |
| 96 | + # Otherwise, pull the titles from the links table |
| 97 | + $dp = Title::newFromText($dMsgText); |
| 98 | + if( $dp ) { |
| 99 | + if($dp->getNamespace() != NS_TEMPLATE) { |
| 100 | + # FIXME we assume the disambiguation message is a template but |
| 101 | + # the page can potentially be from another namespace :/ |
| 102 | + wfDebug("Mediawiki:disambiguationspage message does not refer to a template!\n"); |
| 103 | + } |
| 104 | + $linkBatch->addObj( $dp ); |
| 105 | + } else { |
| 106 | + # Get all the templates linked from the Mediawiki:Disambiguationspage |
| 107 | + $disPageObj = Title::makeTitleSafe( NS_MEDIAWIKI, 'disambiguationspage' ); |
| 108 | + $res = $dbr->select( |
| 109 | + array('pagelinks', 'page'), |
| 110 | + 'pl_title', |
| 111 | + array('page_id = pl_from', 'pl_namespace' => NS_TEMPLATE, |
| 112 | + 'page_namespace' => $disPageObj->getNamespace(), 'page_title' => $disPageObj->getDBkey()), |
| 113 | + __METHOD__ ); |
| 114 | + |
| 115 | + while ( $row = $dbr->fetchObject( $res ) ) { |
| 116 | + $linkBatch->addObj( Title::makeTitle( NS_TEMPLATE, $row->pl_title )); |
| 117 | + } |
| 118 | + |
| 119 | + $dbr->freeResult( $res ); |
| 120 | + } |
| 121 | + $set = $linkBatch->constructSet( 'tl', $dbr ); |
| 122 | + if( $set === false ) { |
| 123 | + # We must always return a valid SQL query, but this way |
| 124 | + # the DB will always quickly return an empty result |
| 125 | + $set = 'FALSE'; |
| 126 | + wfDebug("Mediawiki:disambiguationspage message does not link to any templates!\n"); |
| 127 | + } |
| 128 | + |
| 129 | + // FIXME: What are pagelinks and p2 doing here? |
| 130 | + return array ( |
| 131 | + 'tables' => array( 'templatelinks', 'page AS p1', 'pagelinks', 'page AS p2' ), |
| 132 | + 'fields' => array( "'{$this->getName()}' AS type", |
| 133 | + 'p1.page_namespace AS namespace', |
| 134 | + 'p1.page_title AS title', |
| 135 | + 'pl_from AS value' ), |
| 136 | + 'conds' => array( $set, |
| 137 | + 'p1.page_id = tl_from', |
| 138 | + 'pl_namespace = p1.page_namespace', |
| 139 | + 'pl_title = p1.page_title', |
| 140 | + 'p2.page_id = pl_from', |
| 141 | + 'p2.page_namespace' => NS_MAIN ) |
| 142 | + ); |
92 | 143 | } |
93 | 144 | |
| 145 | + function getOrderFields() { |
| 146 | + return array('tl_namespace', 'tl_title', 'value'); |
| 147 | + } |
| 148 | + |
| 149 | + function sortDescending() { |
| 150 | + return false; |
| 151 | + } |
| 152 | + |
94 | 153 | function formatResult( $skin, $result ) { |
95 | 154 | global $wgContLang; |
96 | 155 | $title = Title::newFromID( $result->value ); |
Index: branches/querypage-work2/phase3/includes/specials/SpecialBrokenRedirects.php |
— | — | @@ -16,30 +16,13 @@ |
17 | 17 | return 'BrokenRedirects'; |
18 | 18 | } |
19 | 19 | |
20 | | - function isExpensive( ) { return true; } |
| 20 | + function isExpensive() { return true; } |
21 | 21 | function isSyndicated() { return false; } |
22 | 22 | |
23 | | - function getPageHeader( ) { |
| 23 | + function getPageHeader() { |
24 | 24 | return wfMsgExt( 'brokenredirectstext', array( 'parse' ) ); |
25 | 25 | } |
26 | 26 | |
27 | | - function getSQL() { |
28 | | - $dbr = wfGetDB( DB_SLAVE ); |
29 | | - list( $page, $redirect ) = $dbr->tableNamesN( 'page', 'redirect' ); |
30 | | - |
31 | | - $sql = "SELECT 'BrokenRedirects' AS type, |
32 | | - p1.page_namespace AS namespace, |
33 | | - p1.page_title AS title, |
34 | | - rd_namespace, |
35 | | - rd_title |
36 | | - FROM $redirect AS rd |
37 | | - JOIN $page p1 ON (rd.rd_from=p1.page_id) |
38 | | - LEFT JOIN $page AS p2 ON (rd_namespace=p2.page_namespace AND rd_title=p2.page_title ) |
39 | | - WHERE rd_namespace >= 0 |
40 | | - AND p2.page_namespace IS NULL"; |
41 | | - return $sql; |
42 | | - } |
43 | | - |
44 | 27 | function getQueryInfo() { |
45 | 28 | return array( |
46 | 29 | 'tables' => array( 'redirect', 'page AS p1', 'page AS p2' ), |
— | — | @@ -64,12 +47,13 @@ |
65 | 48 | ); |
66 | 49 | } |
67 | 50 | |
68 | | - function getOrder() { |
| 51 | + function getOrderFields() { |
| 52 | + // FIXME: really? |
69 | 53 | return array (); |
70 | 54 | } |
71 | 55 | |
72 | 56 | function formatResult( $skin, $result ) { |
73 | | - global $wgUser, $wgContLang, $wgLang; |
| 57 | + global $wgUser, $wgContLang; |
74 | 58 | |
75 | 59 | $fromObj = Title::makeTitle( $result->namespace, $result->title ); |
76 | 60 | if ( isset( $result->rd_title ) ) { |
— | — | @@ -85,43 +69,21 @@ |
86 | 70 | |
87 | 71 | // $toObj may very easily be false if the $result list is cached |
88 | 72 | if ( !is_object( $toObj ) ) { |
89 | | - return '<s>' . $skin->link( $fromObj ) . '</s>'; |
| 73 | + return '<s>' . $skin->makeLinkObj( $fromObj ) . '</s>'; |
90 | 74 | } |
91 | 75 | |
92 | | - $from = $skin->linkKnown( |
93 | | - $fromObj, |
94 | | - null, |
95 | | - array(), |
96 | | - array( 'redirect' => 'no' ) |
97 | | - ); |
98 | | - $links = array(); |
99 | | - $links[] = $skin->linkKnown( |
100 | | - $fromObj, |
101 | | - wfMsgHtml( 'brokenredirects-edit' ), |
102 | | - array(), |
103 | | - array( 'action' => 'edit' ) |
104 | | - ); |
105 | | - $to = $skin->link( |
106 | | - $toObj, |
107 | | - null, |
108 | | - array(), |
109 | | - array(), |
110 | | - array( 'broken' ) |
111 | | - ); |
| 76 | + $from = $skin->makeKnownLinkObj( $fromObj ,'', 'redirect=no' ); |
| 77 | + $edit = $skin->makeKnownLinkObj( $fromObj, wfMsgHtml( 'brokenredirects-edit' ), 'action=edit' ); |
| 78 | + $to = $skin->makeBrokenLinkObj( $toObj ); |
112 | 79 | $arr = $wgContLang->getArrow(); |
113 | 80 | |
114 | | - $out = $from . wfMsg( 'word-separator' ); |
| 81 | + $out = "{$from} {$edit}"; |
115 | 82 | |
116 | 83 | if( $wgUser->isAllowed( 'delete' ) ) { |
117 | | - $links[] = $skin->linkKnown( |
118 | | - $fromObj, |
119 | | - wfMsgHtml( 'brokenredirects-delete' ), |
120 | | - array(), |
121 | | - array( 'action' => 'delete' ) |
122 | | - ); |
| 84 | + $delete = $skin->makeKnownLinkObj( $fromObj, wfMsgHtml( 'brokenredirects-delete' ), 'action=delete' ); |
| 85 | + $out .= " {$delete}"; |
123 | 86 | } |
124 | 87 | |
125 | | - $out .= wfMsg( 'parentheses', $wgLang->pipeList( $links ) ); |
126 | 88 | $out .= " {$arr} {$to}"; |
127 | 89 | return $out; |
128 | 90 | } |
Index: branches/querypage-work2/phase3/includes/specials/SpecialDeadendpages.php |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | */ |
11 | 11 | class DeadendPagesPage extends PageQueryPage { |
12 | 12 | |
13 | | - function getName( ) { |
| 13 | + function getName() { |
14 | 14 | return "Deadendpages"; |
15 | 15 | } |
16 | 16 | |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | * |
24 | 24 | * @return true |
25 | 25 | */ |
26 | | - function isExpensive( ) { |
| 26 | + function isExpensive() { |
27 | 27 | return 1; |
28 | 28 | } |
29 | 29 | |
— | — | @@ -35,19 +35,6 @@ |
36 | 36 | return false; |
37 | 37 | } |
38 | 38 | |
39 | | - /** |
40 | | - * @return string an sqlquery |
41 | | - */ |
42 | | - function getSQL() { |
43 | | - $dbr = wfGetDB( DB_SLAVE ); |
44 | | - list( $page, $pagelinks ) = $dbr->tableNamesN( 'page', 'pagelinks' ); |
45 | | - return "SELECT 'Deadendpages' as type, page_namespace AS namespace, page_title as title, page_title AS value " . |
46 | | - "FROM $page LEFT JOIN $pagelinks ON page_id = pl_from " . |
47 | | - "WHERE pl_from IS NULL " . |
48 | | - "AND page_namespace = 0 " . |
49 | | - "AND page_is_redirect = 0"; |
50 | | - } |
51 | | - |
52 | 39 | function getQueryInfo() { |
53 | 40 | return array( |
54 | 41 | 'tables' => array( 'page', 'pagelinks' ), |
Property changes on: branches/querypage-work2/phase3/includes/specials |
___________________________________________________________________ |
Name: svn:mergeinfo |
55 | 42 | - /branches/REL1_15/phase3/includes/specials:51646 |
/branches/querypage-work/phase3/includes/specials:49084,49528 |
/branches/sqlite/includes/specials:58211-58321 |
/branches/wmf-deployment/includes/specials:53381,56967 |
56 | 43 | + /branches/REL1_15/phase3/includes/specials:51646 |
/branches/querypage-work/phase3/includes/specials:49084,49528,49599 |
/branches/sqlite/includes/specials:58211-58321 |
/branches/wmf-deployment/includes/specials:53381,56967 |
Property changes on: branches/querypage-work2/phase3/includes |
___________________________________________________________________ |
Name: svn:mergeinfo |
57 | 44 | - /branches/REL1_15/phase3/includes:51646 |
/branches/querypage-work/phase3/includes:49084,49528 |
/branches/sqlite/includes:58211-58321 |
/branches/wmf-deployment/includes:53381 |
58 | 45 | + /branches/REL1_15/phase3/includes:51646 |
/branches/querypage-work/phase3/includes:49084,49528,49599 |
/branches/sqlite/includes:58211-58321 |
/branches/wmf-deployment/includes:53381 |
Property changes on: branches/querypage-work2/phase3 |
___________________________________________________________________ |
Name: svn:mergeinfo |
59 | 46 | - /branches/REL1_15/phase3:51646 |
/branches/querypage-work/phase3:49084,49528 |
/branches/sqlite:58211-58321 |
60 | 47 | + /branches/REL1_15/phase3:51646 |
/branches/querypage-work/phase3:49084,49528,49599 |
/branches/sqlite:58211-58321 |
Property changes on: branches/querypage-work2 |
___________________________________________________________________ |
Name: svn:mergeinfo |
61 | 48 | - /branches/querypage-work:49084,49528 |
62 | 49 | + /branches/querypage-work:49084,49528,49599 |