Index: trunk/extensions/FlaggedRevs/specialpages/ReviewedPages_body.php |
— | — | @@ -23,6 +23,7 @@ |
24 | 24 | $this->namespace = $wgRequest->getInt( 'namespace' ); |
25 | 25 | $this->type = $wgRequest->getInt( 'level', -1 ); |
26 | 26 | $this->type = min($this->type,$maxType); |
| 27 | + $this->hideRedirs = $wgRequest->getBool( 'hideredirs', true ); |
27 | 28 | |
28 | 29 | $this->showForm(); |
29 | 30 | $this->showPageList(); |
— | — | @@ -34,11 +35,20 @@ |
35 | 36 | $form = Xml::openElement( 'form', |
36 | 37 | array( 'name' => 'reviewedpages', 'action' => $wgScript, 'method' => 'get' ) ); |
37 | 38 | $form .= "<fieldset><legend>".wfMsg('reviewedpages-leg')."</legend>\n"; |
38 | | - |
| 39 | + |
| 40 | + // show/hide links |
| 41 | + $showhide = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) ); |
| 42 | + $onoff = 1 - $this->hideRedirs; |
| 43 | + $link = $this->skin->link( $this->getTitle(), $showhide[$onoff], array(), |
| 44 | + array( 'hideredirs' => $onoff, 'namespace' => $this->namespace ) |
| 45 | + ); |
| 46 | + $showhideredirs = wfMsgHtml( 'whatlinkshere-hideredirs', $link ); |
| 47 | + |
39 | 48 | if( count($wgFlaggedRevsNamespaces) > 1 ) { |
40 | | - $form .= FlaggedRevsXML::getNamespaceMenu( $this->namespace ) . ' '; |
| 49 | + $form .= FlaggedRevsXML::getNamespaceMenu( $this->namespace ) . ' '; |
41 | 50 | } |
42 | | - $form .= FlaggedRevsXML::getLevelMenu( $this->type ); |
| 51 | + $form .= FlaggedRevsXML::getLevelMenu( $this->type ) . ' '; |
| 52 | + $form .= $showhideredirs . ' '; |
43 | 53 | |
44 | 54 | $form .= " ".Xml::submitButton( wfMsg( 'go' ) ); |
45 | 55 | $form .= Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() ); |
— | — | @@ -50,7 +60,7 @@ |
51 | 61 | protected function showPageList() { |
52 | 62 | global $wgOut, $wgUser, $wgLang; |
53 | 63 | |
54 | | - $pager = new ReviewedPagesPager( $this, array(), $this->type, $this->namespace ); |
| 64 | + $pager = new ReviewedPagesPager( $this, array(), $this->type, $this->namespace, $this->hideRedirs ); |
55 | 65 | if( $pager->getNumRows() ) { |
56 | 66 | $wgOut->addHTML( wfMsgExt('reviewedpages-list', array('parse') ) ); |
57 | 67 | $wgOut->addHTML( $pager->getNavigationBar() ); |
— | — | @@ -92,7 +102,7 @@ |
93 | 103 | class ReviewedPagesPager extends AlphabeticPager { |
94 | 104 | public $mForm, $mConds, $namespace, $type; |
95 | 105 | |
96 | | - function __construct( $form, $conds = array(), $type=0, $namespace=0 ) { |
| 106 | + function __construct( $form, $conds = array(), $type=0, $namespace=0, $hideRedirs=1 ) { |
97 | 107 | $this->mForm = $form; |
98 | 108 | $this->mConds = $conds; |
99 | 109 | $this->type = $type; |
— | — | @@ -105,6 +115,7 @@ |
106 | 116 | $namespace = empty($wgFlaggedRevsNamespaces) ? -1 : $wgFlaggedRevsNamespaces[0]; |
107 | 117 | } |
108 | 118 | $this->namespace = $namespace; |
| 119 | + $this->hideRedirs = $hideRedirs; |
109 | 120 | |
110 | 121 | parent::__construct(); |
111 | 122 | } |
— | — | @@ -121,12 +132,15 @@ |
122 | 133 | $conds['fp_quality'] = $this->type; |
123 | 134 | $index = 'fp_quality_page'; |
124 | 135 | } |
| 136 | + if( $this->hideRedirs ) { |
| 137 | + $conds['page_is_redirect'] = 0; |
| 138 | + } |
125 | 139 | $conds['page_namespace'] = $this->namespace; // Sanity check NS |
126 | 140 | return array( |
127 | 141 | 'tables' => array('flaggedpages','page'), |
128 | 142 | 'fields' => 'page_namespace,page_title,page_len,fp_page_id', |
129 | 143 | 'conds' => $conds, |
130 | | - 'options' => array( 'USE INDEX' => array('flaggedpages' => $index) ) |
| 144 | + 'options' => array( 'USE INDEX' => array('flaggedpages' => $index,'page' => 'PRIMARY') ) |
131 | 145 | ); |
132 | 146 | } |
133 | 147 | |