MediaWiki REL1_33
ProtectedTitlesPager.php
Go to the documentation of this file.
1<?php
26
30 public $mForm;
31
35 public $mConds;
36
46 public function __construct( $form, $conds, $type, $level, $namespace,
47 $sizetype = '', $size = 0
48 ) {
49 $this->mForm = $form;
50 $this->mConds = $conds;
51 $this->level = $level;
52 $this->namespace = $namespace;
53 $this->size = intval( $size );
54 parent::__construct( $form->getContext() );
55 }
56
57 protected function getStartBody() {
58 # Do a link batch query
59 $this->mResult->seek( 0 );
60 $lb = new LinkBatch;
61
62 foreach ( $this->mResult as $row ) {
63 $lb->add( $row->pt_namespace, $row->pt_title );
64 }
65
66 $lb->execute();
67
68 return '';
69 }
70
74 function getTitle() {
75 return $this->mForm->getPageTitle();
76 }
77
78 function formatRow( $row ) {
79 return $this->mForm->formatRow( $row );
80 }
81
85 function getQueryInfo() {
86 $conds = $this->mConds;
87 $conds[] = 'pt_expiry > ' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
88 ' OR pt_expiry IS NULL';
89 if ( $this->level ) {
90 $conds['pt_create_perm'] = $this->level;
91 }
92
93 if ( !is_null( $this->namespace ) ) {
94 $conds[] = 'pt_namespace=' . $this->mDb->addQuotes( $this->namespace );
95 }
96
97 return [
98 'tables' => 'protected_titles',
99 'fields' => [ 'pt_namespace', 'pt_title', 'pt_create_perm',
100 'pt_expiry', 'pt_timestamp' ],
101 'conds' => $conds
102 ];
103 }
104
105 function getIndexField() {
106 return 'pt_timestamp';
107 }
108}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
IndexPager with an alphabetic list and a formatted navigation bar.
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Definition LinkBatch.php:34
add( $ns, $dbkey)
Definition LinkBatch.php:83
formatRow( $row)
Abstract formatting function.
SpecialProtectedtitles $mForm
getStartBody()
Hook into getBody(), allows text to be inserted at the start.
__construct( $form, $conds, $type, $level, $namespace, $sizetype='', $size=0)
getIndexField()
This function should be overridden to return the name of the index fi- eld.
A special page that list protected titles from creation.
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))