2007-01-22 05:01:37 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @file
|
|
|
|
|
* @ingroup SpecialPage
|
2007-01-22 05:01:37 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2007-04-04 05:22:37 +00:00
|
|
|
* @todo document
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup SpecialPage
|
2007-01-22 05:01:37 +00:00
|
|
|
*/
|
2007-02-15 11:16:42 +00:00
|
|
|
class ProtectedPagesForm {
|
2007-05-03 14:32:52 +00:00
|
|
|
|
|
|
|
|
protected $IdLevel = 'level';
|
|
|
|
|
protected $IdType = 'type';
|
|
|
|
|
|
2008-04-13 16:07:48 +00:00
|
|
|
public function showList( $msg = '' ) {
|
2007-03-21 09:43:21 +00:00
|
|
|
global $wgOut, $wgRequest;
|
2007-01-22 05:01:37 +00:00
|
|
|
|
2009-01-09 13:38:43 +00:00
|
|
|
if( "" != $msg ) {
|
2007-02-15 11:16:42 +00:00
|
|
|
$wgOut->setSubtitle( $msg );
|
|
|
|
|
}
|
2007-01-22 05:01:37 +00:00
|
|
|
|
2007-02-15 11:16:42 +00:00
|
|
|
// Purge expired entries on one in every 10 queries
|
2009-01-09 13:38:43 +00:00
|
|
|
if( !mt_rand( 0, 10 ) ) {
|
2007-02-15 11:16:42 +00:00
|
|
|
Title::purgeExpiredRestrictions();
|
|
|
|
|
}
|
2007-01-22 05:01:37 +00:00
|
|
|
|
2007-05-03 14:32:52 +00:00
|
|
|
$type = $wgRequest->getVal( $this->IdType );
|
|
|
|
|
$level = $wgRequest->getVal( $this->IdLevel );
|
2007-05-01 20:22:51 +00:00
|
|
|
$sizetype = $wgRequest->getVal( 'sizetype' );
|
|
|
|
|
$size = $wgRequest->getIntOrNull( 'size' );
|
2007-03-21 09:43:21 +00:00
|
|
|
$NS = $wgRequest->getIntOrNull( 'namespace' );
|
2008-04-13 16:07:48 +00:00
|
|
|
$indefOnly = $wgRequest->getBool( 'indefonly' ) ? 1 : 0;
|
2008-08-13 15:40:47 +00:00
|
|
|
$cascadeOnly = $wgRequest->getBool('cascadeonly') ? 1 : 0;
|
2007-03-21 09:43:21 +00:00
|
|
|
|
2008-08-13 15:40:47 +00:00
|
|
|
$pager = new ProtectedPagesPager( $this, array(), $type, $level, $NS, $sizetype, $size, $indefOnly, $cascadeOnly );
|
2007-03-21 09:43:21 +00:00
|
|
|
|
2008-08-13 15:40:47 +00:00
|
|
|
$wgOut->addHTML( $this->showOptions( $NS, $type, $level, $sizetype, $size, $indefOnly, $cascadeOnly ) );
|
2007-01-22 05:01:37 +00:00
|
|
|
|
2009-01-09 13:38:43 +00:00
|
|
|
if( $pager->getNumRows() ) {
|
2007-02-21 10:42:04 +00:00
|
|
|
$s = $pager->getNavigationBar();
|
2008-04-14 07:45:50 +00:00
|
|
|
$s .= "<ul>" .
|
2007-02-15 11:16:42 +00:00
|
|
|
$pager->getBody() .
|
|
|
|
|
"</ul>";
|
2007-02-21 10:42:04 +00:00
|
|
|
$s .= $pager->getNavigationBar();
|
2007-02-15 11:16:42 +00:00
|
|
|
} else {
|
2007-05-01 20:38:11 +00:00
|
|
|
$s = '<p>' . wfMsgHtml( 'protectedpagesempty' ) . '</p>';
|
2007-02-15 11:16:42 +00:00
|
|
|
}
|
|
|
|
|
$wgOut->addHTML( $s );
|
|
|
|
|
}
|
2007-01-22 05:01:37 +00:00
|
|
|
|
|
|
|
|
/**
|
2007-02-15 11:16:42 +00:00
|
|
|
* Callback function to output a restriction
|
2008-04-15 10:26:53 +00:00
|
|
|
* @param $row object Protected title
|
|
|
|
|
* @return string Formatted <li> element
|
2007-01-22 05:01:37 +00:00
|
|
|
*/
|
2008-04-13 16:07:48 +00:00
|
|
|
public function formatRow( $row ) {
|
2007-10-29 18:46:03 +00:00
|
|
|
global $wgUser, $wgLang, $wgContLang;
|
2007-01-22 05:01:37 +00:00
|
|
|
|
2007-02-15 11:16:42 +00:00
|
|
|
wfProfileIn( __METHOD__ );
|
2007-01-22 05:01:37 +00:00
|
|
|
|
2007-02-15 11:16:42 +00:00
|
|
|
static $skin=null;
|
|
|
|
|
|
|
|
|
|
if( is_null( $skin ) )
|
|
|
|
|
$skin = $wgUser->getSkin();
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-02-15 11:16:42 +00:00
|
|
|
$title = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
|
2009-05-08 23:24:31 +00:00
|
|
|
$link = $skin->link( $title );
|
2007-01-22 05:01:37 +00:00
|
|
|
|
2007-01-22 08:57:40 +00:00
|
|
|
$description_items = array ();
|
|
|
|
|
|
2007-03-21 09:43:21 +00:00
|
|
|
$protType = wfMsgHtml( 'restriction-level-' . $row->pr_level );
|
2007-01-22 05:01:37 +00:00
|
|
|
|
2007-01-22 08:57:40 +00:00
|
|
|
$description_items[] = $protType;
|
|
|
|
|
|
2009-01-09 13:38:43 +00:00
|
|
|
if( $row->pr_cascade ) {
|
2007-07-17 10:27:23 +00:00
|
|
|
$description_items[] = wfMsg( 'protect-summary-cascade' );
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-15 10:26:53 +00:00
|
|
|
$expiry_description = '';
|
|
|
|
|
$stxt = '';
|
2007-01-22 08:57:40 +00:00
|
|
|
|
2009-01-09 13:38:43 +00:00
|
|
|
if( $row->pr_expiry != 'infinity' && strlen($row->pr_expiry) ) {
|
2007-02-15 11:16:42 +00:00
|
|
|
$expiry = Block::decodeExpiry( $row->pr_expiry );
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2009-01-09 13:38:43 +00:00
|
|
|
$expiry_description = wfMsg( 'protect-expiring' , $wgLang->timeanddate( $expiry ) ,
|
|
|
|
|
$wgLang->date( $expiry ) , $wgLang->time( $expiry ) );
|
2007-01-22 08:57:40 +00:00
|
|
|
|
2009-05-22 09:35:48 +00:00
|
|
|
$description_items[] = htmlspecialchars($expiry_description);
|
2007-01-22 08:57:40 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2009-01-09 13:38:43 +00:00
|
|
|
if(!is_null($size = $row->page_len)) {
|
2008-07-14 19:10:47 +00:00
|
|
|
$stxt = $wgContLang->getDirMark() . ' ' . $skin->formatRevisionSize( $size );
|
2007-03-21 18:29:31 +00:00
|
|
|
}
|
2008-04-15 10:26:53 +00:00
|
|
|
|
|
|
|
|
# Show a link to the change protection form for allowed users otherwise a link to the protection log
|
|
|
|
|
if( $wgUser->isAllowed( 'protect' ) ) {
|
2009-06-07 18:45:52 +00:00
|
|
|
$changeProtection = ' (' . $skin->linkKnown(
|
|
|
|
|
$title,
|
|
|
|
|
wfMsgHtml( 'protect_change' ),
|
|
|
|
|
array(),
|
|
|
|
|
array( 'action' => 'unprotect' )
|
|
|
|
|
) . ')';
|
2008-04-15 10:26:53 +00:00
|
|
|
} else {
|
|
|
|
|
$ltitle = SpecialPage::getTitleFor( 'Log' );
|
2009-06-07 18:45:52 +00:00
|
|
|
$changeProtection = ' (' . $skin->linkKnown(
|
|
|
|
|
$ltitle,
|
|
|
|
|
wfMsgHtml( 'protectlogpage' ),
|
|
|
|
|
array(),
|
|
|
|
|
array(
|
|
|
|
|
'type' => 'protect',
|
2009-06-15 12:32:59 +00:00
|
|
|
'page' => $title->getPrefixedText()
|
2009-06-07 18:45:52 +00:00
|
|
|
)
|
|
|
|
|
) . ')';
|
2008-04-15 10:26:53 +00:00
|
|
|
}
|
|
|
|
|
|
2007-02-15 11:16:42 +00:00
|
|
|
wfProfileOut( __METHOD__ );
|
|
|
|
|
|
2009-09-30 13:59:29 +00:00
|
|
|
return Html::rawElement(
|
|
|
|
|
'li',
|
|
|
|
|
array(),
|
|
|
|
|
wfSpecialList( $link . $stxt, $wgLang->commaList( $description_items ) ) . $changeProtection ) . "\n";
|
2007-02-15 11:16:42 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-03-21 09:43:21 +00:00
|
|
|
/**
|
|
|
|
|
* @param $namespace int
|
|
|
|
|
* @param $type string
|
|
|
|
|
* @param $level string
|
2007-03-21 21:07:15 +00:00
|
|
|
* @param $minsize int
|
2008-04-13 16:07:48 +00:00
|
|
|
* @param $indefOnly bool
|
2008-08-13 15:40:47 +00:00
|
|
|
* @param $cascadeOnly bool
|
2008-04-15 10:26:53 +00:00
|
|
|
* @return string Input form
|
2007-03-21 09:43:21 +00:00
|
|
|
* @private
|
|
|
|
|
*/
|
2008-08-13 15:40:47 +00:00
|
|
|
protected function showOptions( $namespace, $type='edit', $level, $sizetype, $size, $indefOnly, $cascadeOnly ) {
|
2007-03-21 09:43:21 +00:00
|
|
|
global $wgScript;
|
|
|
|
|
$title = SpecialPage::getTitleFor( 'ProtectedPages' );
|
2008-04-15 10:26:53 +00:00
|
|
|
return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
|
|
|
|
|
Xml::openElement( 'fieldset' ) .
|
2007-03-21 09:43:21 +00:00
|
|
|
Xml::element( 'legend', array(), wfMsg( 'protectedpages' ) ) .
|
2008-09-06 07:11:36 +00:00
|
|
|
Xml::hidden( 'title', $title->getPrefixedDBkey() ) . "\n" .
|
2007-08-04 12:38:48 +00:00
|
|
|
$this->getNamespaceMenu( $namespace ) . " \n" .
|
|
|
|
|
$this->getTypeMenu( $type ) . " \n" .
|
2008-04-13 16:07:48 +00:00
|
|
|
$this->getLevelMenu( $level ) . " \n" .
|
2008-09-06 07:11:36 +00:00
|
|
|
"<br/><span style='white-space: nowrap'>" .
|
2008-04-13 16:18:58 +00:00
|
|
|
$this->getExpiryCheck( $indefOnly ) . " \n" .
|
2008-08-13 15:40:47 +00:00
|
|
|
$this->getCascadeCheck( $cascadeOnly ) . " \n" .
|
2008-09-06 07:11:36 +00:00
|
|
|
"</span><br/><span style='white-space: nowrap'>" .
|
2008-04-13 16:24:24 +00:00
|
|
|
$this->getSizeLimit( $sizetype, $size ) . " \n" .
|
2008-04-13 16:07:48 +00:00
|
|
|
"</span>" .
|
2007-08-04 12:38:48 +00:00
|
|
|
" " . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
|
2008-04-15 10:26:53 +00:00
|
|
|
Xml::closeElement( 'fieldset' ) .
|
|
|
|
|
Xml::closeElement( 'form' );
|
2007-03-21 09:43:21 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-08-04 12:20:41 +00:00
|
|
|
/**
|
|
|
|
|
* Prepare the namespace filter drop-down; standard namespace
|
|
|
|
|
* selector, sans the MediaWiki namespace
|
|
|
|
|
*
|
|
|
|
|
* @param mixed $namespace Pre-select namespace
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2008-04-13 16:07:48 +00:00
|
|
|
protected function getNamespaceMenu( $namespace = null ) {
|
|
|
|
|
return "<span style='white-space: nowrap'>" .
|
|
|
|
|
Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' '
|
|
|
|
|
. Xml::namespaceSelector( $namespace, '' ) . "</span>";
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-04-13 16:07:48 +00:00
|
|
|
/**
|
|
|
|
|
* @return string Formatted HTML
|
|
|
|
|
*/
|
|
|
|
|
protected function getExpiryCheck( $indefOnly ) {
|
2008-04-17 19:16:27 +00:00
|
|
|
return
|
|
|
|
|
Xml::checkLabel( wfMsg('protectedpages-indef'), 'indefonly', 'indefonly', $indefOnly ) . "\n";
|
2007-03-21 09:43:21 +00:00
|
|
|
}
|
2008-08-13 15:40:47 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string Formatted HTML
|
|
|
|
|
*/
|
|
|
|
|
protected function getCascadeCheck( $cascadeOnly ) {
|
|
|
|
|
return
|
|
|
|
|
Xml::checkLabel( wfMsg('protectedpages-cascade'), 'cascadeonly', 'cascadeonly', $cascadeOnly ) . "\n";
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-03-21 21:07:15 +00:00
|
|
|
/**
|
|
|
|
|
* @return string Formatted HTML
|
|
|
|
|
*/
|
2008-04-14 07:45:50 +00:00
|
|
|
protected function getSizeLimit( $sizetype, $size ) {
|
2008-04-17 19:16:27 +00:00
|
|
|
$max = $sizetype === 'max';
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
Xml::radioLabel( wfMsg('minimum-size'), 'sizetype', 'min', 'wpmin', !$max ) .
|
|
|
|
|
' ' .
|
|
|
|
|
Xml::radioLabel( wfMsg('maximum-size'), 'sizetype', 'max', 'wpmax', $max ) .
|
|
|
|
|
' ' .
|
|
|
|
|
Xml::input( 'size', 9, $size, array( 'id' => 'wpsize' ) ) .
|
|
|
|
|
' ' .
|
|
|
|
|
Xml::label( wfMsg('pagesize'), 'wpsize' );
|
2007-03-21 21:07:15 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-03-21 09:43:21 +00:00
|
|
|
/**
|
2009-09-30 13:59:29 +00:00
|
|
|
* Creates the input label of the restriction type
|
|
|
|
|
* @param $pr_type string Protection type
|
2007-03-21 09:43:21 +00:00
|
|
|
* @return string Formatted HTML
|
|
|
|
|
*/
|
2008-04-13 16:07:48 +00:00
|
|
|
protected function getTypeMenu( $pr_type ) {
|
2007-05-03 14:32:52 +00:00
|
|
|
global $wgRestrictionTypes;
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-03-21 09:43:21 +00:00
|
|
|
$m = array(); // Temporary array
|
2007-05-03 14:32:52 +00:00
|
|
|
$options = array();
|
2007-03-21 09:43:21 +00:00
|
|
|
|
|
|
|
|
// First pass to load the log names
|
|
|
|
|
foreach( $wgRestrictionTypes as $type ) {
|
2007-05-03 14:32:52 +00:00
|
|
|
$text = wfMsg("restriction-$type");
|
2007-03-21 09:43:21 +00:00
|
|
|
$m[$text] = $type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Third pass generates sorted XHTML content
|
|
|
|
|
foreach( $m as $text => $type ) {
|
|
|
|
|
$selected = ($type == $pr_type );
|
2007-05-03 14:32:52 +00:00
|
|
|
$options[] = Xml::option( $text, $type, $selected ) . "\n";
|
2007-03-21 09:43:21 +00:00
|
|
|
}
|
|
|
|
|
|
2008-04-13 16:07:48 +00:00
|
|
|
return "<span style='white-space: nowrap'>" .
|
2007-05-03 14:32:52 +00:00
|
|
|
Xml::label( wfMsg('restriction-type') , $this->IdType ) . ' ' .
|
|
|
|
|
Xml::tags( 'select',
|
|
|
|
|
array( 'id' => $this->IdType, 'name' => $this->IdType ),
|
2008-04-13 16:07:48 +00:00
|
|
|
implode( "\n", $options ) ) . "</span>";
|
2007-03-21 09:43:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2009-09-30 13:59:29 +00:00
|
|
|
* Creates the input label of the restriction level
|
|
|
|
|
* @param $pr_level string Protection level
|
2007-03-21 09:43:21 +00:00
|
|
|
* @return string Formatted HTML
|
2008-04-14 07:45:50 +00:00
|
|
|
*/
|
2008-04-13 16:07:48 +00:00
|
|
|
protected function getLevelMenu( $pr_level ) {
|
2007-05-03 14:32:52 +00:00
|
|
|
global $wgRestrictionLevels;
|
|
|
|
|
|
|
|
|
|
$m = array( wfMsg('restriction-level-all') => 0 ); // Temporary array
|
|
|
|
|
$options = array();
|
2007-03-21 09:43:21 +00:00
|
|
|
|
|
|
|
|
// First pass to load the log names
|
|
|
|
|
foreach( $wgRestrictionLevels as $type ) {
|
2009-06-07 18:45:52 +00:00
|
|
|
// Messages used can be 'restriction-level-sysop' and 'restriction-level-autoconfirmed'
|
2009-01-09 13:38:43 +00:00
|
|
|
if( $type !='' && $type !='*') {
|
2007-05-03 14:32:52 +00:00
|
|
|
$text = wfMsg("restriction-level-$type");
|
2007-03-21 09:43:21 +00:00
|
|
|
$m[$text] = $type;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Third pass generates sorted XHTML content
|
|
|
|
|
foreach( $m as $text => $type ) {
|
|
|
|
|
$selected = ($type == $pr_level );
|
2007-05-03 14:32:52 +00:00
|
|
|
$options[] = Xml::option( $text, $type, $selected );
|
2007-03-21 09:43:21 +00:00
|
|
|
}
|
|
|
|
|
|
2009-09-30 13:59:29 +00:00
|
|
|
return "<span style='white-space: nowrap'>" .
|
|
|
|
|
Xml::label( wfMsg( 'restriction-level' ) , $this->IdLevel ) . ' ' .
|
2007-05-03 14:32:52 +00:00
|
|
|
Xml::tags( 'select',
|
|
|
|
|
array( 'id' => $this->IdLevel, 'name' => $this->IdLevel ),
|
2009-09-30 13:59:29 +00:00
|
|
|
implode( "\n", $options ) ) . "</span>";
|
2007-03-21 09:43:21 +00:00
|
|
|
}
|
2007-02-15 11:16:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2007-04-04 05:22:37 +00:00
|
|
|
* @todo document
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Pager
|
2007-02-15 11:16:42 +00:00
|
|
|
*/
|
2007-05-01 20:22:51 +00:00
|
|
|
class ProtectedPagesPager extends AlphabeticPager {
|
2007-02-15 11:16:42 +00:00
|
|
|
public $mForm, $mConds;
|
2008-04-13 16:07:48 +00:00
|
|
|
private $type, $level, $namespace, $sizetype, $size, $indefonly;
|
2007-02-15 11:16:42 +00:00
|
|
|
|
2009-01-09 13:38:43 +00:00
|
|
|
function __construct( $form, $conds = array(), $type, $level, $namespace, $sizetype='', $size=0,
|
|
|
|
|
$indefonly = false, $cascadeonly = false )
|
|
|
|
|
{
|
2007-02-15 11:16:42 +00:00
|
|
|
$this->mForm = $form;
|
|
|
|
|
$this->mConds = $conds;
|
2007-03-21 09:43:21 +00:00
|
|
|
$this->type = ( $type ) ? $type : 'edit';
|
|
|
|
|
$this->level = $level;
|
|
|
|
|
$this->namespace = $namespace;
|
2007-05-01 20:22:51 +00:00
|
|
|
$this->sizetype = $sizetype;
|
|
|
|
|
$this->size = intval($size);
|
2008-04-13 16:07:48 +00:00
|
|
|
$this->indefonly = (bool)$indefonly;
|
2008-08-13 15:40:47 +00:00
|
|
|
$this->cascadeonly = (bool)$cascadeonly;
|
2007-02-15 11:16:42 +00:00
|
|
|
parent::__construct();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getStartBody() {
|
|
|
|
|
# Do a link batch query
|
|
|
|
|
$lb = new LinkBatch;
|
2008-04-13 17:14:54 +00:00
|
|
|
while( $row = $this->mResult->fetchObject() ) {
|
2007-05-09 14:46:44 +00:00
|
|
|
$lb->add( $row->page_namespace, $row->page_title );
|
2007-02-15 11:16:42 +00:00
|
|
|
}
|
|
|
|
|
$lb->execute();
|
|
|
|
|
return '';
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-02-15 11:16:42 +00:00
|
|
|
function formatRow( $row ) {
|
|
|
|
|
return $this->mForm->formatRow( $row );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getQueryInfo() {
|
|
|
|
|
$conds = $this->mConds;
|
2009-03-17 15:27:48 +00:00
|
|
|
$conds[] = '(pr_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
|
|
|
|
|
'OR pr_expiry IS NULL)';
|
2007-02-15 11:16:42 +00:00
|
|
|
$conds[] = 'page_id=pr_page';
|
2007-03-21 09:43:21 +00:00
|
|
|
$conds[] = 'pr_type=' . $this->mDb->addQuotes( $this->type );
|
2009-01-09 13:38:43 +00:00
|
|
|
|
2007-05-08 09:09:46 +00:00
|
|
|
if( $this->sizetype=='min' ) {
|
2007-05-01 20:22:51 +00:00
|
|
|
$conds[] = 'page_len>=' . $this->size;
|
2007-05-08 09:09:46 +00:00
|
|
|
} else if( $this->sizetype=='max' ) {
|
2007-05-01 20:22:51 +00:00
|
|
|
$conds[] = 'page_len<=' . $this->size;
|
2007-05-08 09:09:46 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-04-13 16:07:48 +00:00
|
|
|
if( $this->indefonly ) {
|
|
|
|
|
$conds[] = "pr_expiry = 'infinity' OR pr_expiry IS NULL";
|
|
|
|
|
}
|
2009-01-09 13:38:43 +00:00
|
|
|
if( $this->cascadeonly ) {
|
2008-08-13 15:40:47 +00:00
|
|
|
$conds[] = "pr_cascade = '1'";
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-05-01 20:22:51 +00:00
|
|
|
if( $this->level )
|
2007-03-21 09:43:21 +00:00
|
|
|
$conds[] = 'pr_level=' . $this->mDb->addQuotes( $this->level );
|
2007-05-01 20:22:51 +00:00
|
|
|
if( !is_null($this->namespace) )
|
2007-03-21 09:43:21 +00:00
|
|
|
$conds[] = 'page_namespace=' . $this->mDb->addQuotes( $this->namespace );
|
2007-02-15 11:16:42 +00:00
|
|
|
return array(
|
|
|
|
|
'tables' => array( 'page_restrictions', 'page' ),
|
2007-07-17 10:27:23 +00:00
|
|
|
'fields' => 'pr_id,page_namespace,page_title,page_len,pr_type,pr_level,pr_expiry,pr_cascade',
|
2007-05-04 16:09:09 +00:00
|
|
|
'conds' => $conds
|
2007-02-15 11:16:42 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getIndexField() {
|
2007-03-21 21:07:15 +00:00
|
|
|
return 'pr_id';
|
2007-01-22 05:01:37 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Constructor
|
|
|
|
|
*/
|
|
|
|
|
function wfSpecialProtectedpages() {
|
2007-02-15 11:16:42 +00:00
|
|
|
$ppForm = new ProtectedPagesForm();
|
|
|
|
|
$ppForm->showList();
|
2007-01-22 05:01:37 +00:00
|
|
|
}
|