3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
25 class ProtectedTitlesPager
extends AlphabeticPager
{
28 * @var SpecialProtectedtitles
37 /** @var string|null */
44 * @param SpecialProtectedtitles $form
46 * @param string|null $type
47 * @param string|null $level
48 * @param int|null $namespace
49 * @param string|null $sizetype
50 * @param int|null $size
52 public function __construct( $form, $conds, $type, $level, $namespace,
53 $sizetype = '', $size = 0
56 $this->mConds
= $conds;
57 $this->level
= $level;
58 $this->namespace = $namespace;
59 parent
::__construct( $form->getContext() );
62 protected function getStartBody() {
63 # Do a link batch query
64 $this->mResult
->seek( 0 );
67 foreach ( $this->mResult
as $row ) {
68 $lb->add( $row->pt_namespace
, $row->pt_title
);
80 return $this->mForm
->getPageTitle();
83 function formatRow( $row ) {
84 return $this->mForm
->formatRow( $row );
90 function getQueryInfo() {
91 $conds = $this->mConds
;
92 $conds[] = 'pt_expiry > ' . $this->mDb
->addQuotes( $this->mDb
->timestamp() ) .
93 ' OR pt_expiry IS NULL';
95 $conds['pt_create_perm'] = $this->level
;
98 if ( $this->namespace !== null ) {
99 $conds[] = 'pt_namespace=' . $this->mDb
->addQuotes( $this->namespace );
103 'tables' => 'protected_titles',
104 'fields' => [ 'pt_namespace', 'pt_title', 'pt_create_perm',
105 'pt_expiry', 'pt_timestamp' ],
110 function getIndexField() {
111 return 'pt_timestamp';