X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fspecials%2FSpecialProtectedpages.php;h=74ed5378e4143644cced27858c4248ccbc0b5f51;hb=fcdf2518605954fe1bcf88598fc14bd95d525882;hp=30c57eb67ac97b108ba6afd071130c595529e2c7;hpb=6392dda47bd1ef251750aea06822c231e1b2b992;p=lhc%2Fweb%2Fwiklou.git
diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php
index 30c57eb67a..74ed5378e4 100644
--- a/includes/specials/SpecialProtectedpages.php
+++ b/includes/specials/SpecialProtectedpages.php
@@ -58,21 +58,20 @@ class SpecialProtectedpages extends SpecialPage {
$this->getOutput()->addHTML( $this->showOptions( $NS, $type, $level, $sizetype, $size, $indefOnly, $cascadeOnly ) );
if( $pager->getNumRows() ) {
- $s = $pager->getNavigationBar();
- $s .= "
" .
- $pager->getBody() .
- "
";
- $s .= $pager->getNavigationBar();
+ $this->getOutput()->addHTML(
+ $pager->getNavigationBar() .
+ '' . $pager->getBody() . '
' .
+ $pager->getNavigationBar()
+ );
} else {
- $s = '' . wfMsgHtml( 'protectedpagesempty' ) . '
';
+ $this->getOutput()->addWikiMsg( 'protectedpagesempty' );
}
- $this->getOutput()->addHTML( $s );
}
/**
* Callback function to output a restriction
- * @param $row object Protected title
- * @return string Formatted element
+ * @param Title $row Protected title
+ * @return string Formatted "" element
*/
public function formatRow( $row ) {
wfProfileIn( __METHOD__ );
@@ -88,12 +87,12 @@ class SpecialProtectedpages extends SpecialPage {
$description_items = array ();
- $protType = wfMsgHtml( 'restriction-level-' . $row->pr_level );
+ $protType = $this->msg( 'restriction-level-' . $row->pr_level )->escaped();
$description_items[] = $protType;
if( $row->pr_cascade ) {
- $description_items[] = wfMsg( 'protect-summary-cascade' );
+ $description_items[] = $this->msg( 'protect-summary-cascade' )->text();
}
$stxt = '';
@@ -101,15 +100,13 @@ class SpecialProtectedpages extends SpecialPage {
$expiry = $lang->formatExpiry( $row->pr_expiry, TS_MW );
if( $expiry != $infinity ) {
-
- $expiry_description = wfMsg(
+ $user = $this->getUser();
+ $description_items[] = $this->msg(
'protect-expiring-local',
- $lang->timeanddate( $expiry, true ),
- $lang->date( $expiry, true ),
- $lang->time( $expiry, true )
- );
-
- $description_items[] = htmlspecialchars($expiry_description);
+ $lang->userTimeAndDate( $expiry, $user ),
+ $lang->userDate( $expiry, $user ),
+ $lang->userTime( $expiry, $user )
+ )->escaped();
}
if(!is_null($size = $row->page_len)) {
@@ -120,7 +117,7 @@ class SpecialProtectedpages extends SpecialPage {
if( $this->getUser()->isAllowed( 'protect' ) ) {
$changeProtection = Linker::linkKnown(
$title,
- wfMsgHtml( 'protect_change' ),
+ $this->msg( 'protect_change' )->escaped(),
array(),
array( 'action' => 'unprotect' )
);
@@ -128,7 +125,7 @@ class SpecialProtectedpages extends SpecialPage {
$ltitle = SpecialPage::getTitleFor( 'Log' );
$changeProtection = Linker::linkKnown(
$ltitle,
- wfMsgHtml( 'protectlogpage' ),
+ $this->msg( 'protectlogpage' )->escaped(),
array(),
array(
'type' => 'protect',
@@ -162,7 +159,7 @@ class SpecialProtectedpages extends SpecialPage {
$title = $this->getTitle();
return Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
Xml::openElement( 'fieldset' ) .
- Xml::element( 'legend', array(), wfMsg( 'protectedpages' ) ) .
+ Xml::element( 'legend', array(), $this->msg( 'protectedpages' )->text() ) .
Html::hidden( 'title', $title->getPrefixedDBkey() ) . "\n" .
$this->getNamespaceMenu( $namespace ) . " \n" .
$this->getTypeMenu( $type ) . " \n" .
@@ -173,7 +170,7 @@ class SpecialProtectedpages extends SpecialPage {
"
" .
$this->getSizeLimit( $sizetype, $size ) . " \n" .
"" .
- " " . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
+ " " . Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . "\n" .
Xml::closeElement( 'fieldset' ) .
Xml::closeElement( 'form' );
}
@@ -206,7 +203,7 @@ class SpecialProtectedpages extends SpecialPage {
*/
protected function getExpiryCheck( $indefOnly ) {
return
- Xml::checkLabel( wfMsg('protectedpages-indef'), 'indefonly', 'indefonly', $indefOnly ) . "\n";
+ Xml::checkLabel( $this->msg( 'protectedpages-indef' )->text(), 'indefonly', 'indefonly', $indefOnly ) . "\n";
}
/**
@@ -214,7 +211,7 @@ class SpecialProtectedpages extends SpecialPage {
*/
protected function getCascadeCheck( $cascadeOnly ) {
return
- Xml::checkLabel( wfMsg('protectedpages-cascade'), 'cascadeonly', 'cascadeonly', $cascadeOnly ) . "\n";
+ Xml::checkLabel( $this->msg( 'protectedpages-cascade' )->text(), 'cascadeonly', 'cascadeonly', $cascadeOnly ) . "\n";
}
/**
@@ -224,13 +221,13 @@ class SpecialProtectedpages extends SpecialPage {
$max = $sizetype === 'max';
return
- Xml::radioLabel( wfMsg('minimum-size'), 'sizetype', 'min', 'wpmin', !$max ) .
+ Xml::radioLabel( $this->msg( 'minimum-size' )->text(), 'sizetype', 'min', 'wpmin', !$max ) .
' ' .
- Xml::radioLabel( wfMsg('maximum-size'), 'sizetype', 'max', 'wpmax', $max ) .
+ Xml::radioLabel( $this->msg( 'maximum-size' )->text(), 'sizetype', 'max', 'wpmax', $max ) .
' ' .
Xml::input( 'size', 9, $size, array( 'id' => 'wpsize' ) ) .
' ' .
- Xml::label( wfMsg('pagesize'), 'wpsize' );
+ Xml::label( $this->msg( 'pagesize' )->text(), 'wpsize' );
}
/**
@@ -244,7 +241,7 @@ class SpecialProtectedpages extends SpecialPage {
// First pass to load the log names
foreach( Title::getFilteredRestrictionTypes( true ) as $type ) {
- $text = wfMsg("restriction-$type");
+ $text = $this->msg( "restriction-$type" )->text();
$m[$text] = $type;
}
@@ -255,7 +252,7 @@ class SpecialProtectedpages extends SpecialPage {
}
return "" .
- Xml::label( wfMsg('restriction-type') , $this->IdType ) . ' ' .
+ Xml::label( $this->msg( 'restriction-type' )->text(), $this->IdType ) . ' ' .
Xml::tags( 'select',
array( 'id' => $this->IdType, 'name' => $this->IdType ),
implode( "\n", $options ) ) . "";
@@ -269,14 +266,14 @@ class SpecialProtectedpages extends SpecialPage {
protected function getLevelMenu( $pr_level ) {
global $wgRestrictionLevels;
- $m = array( wfMsg('restriction-level-all') => 0 ); // Temporary array
+ $m = array( $this->msg( 'restriction-level-all' )->text() => 0 ); // Temporary array
$options = array();
// First pass to load the log names
foreach( $wgRestrictionLevels as $type ) {
// Messages used can be 'restriction-level-sysop' and 'restriction-level-autoconfirmed'
if( $type !='' && $type !='*') {
- $text = wfMsg("restriction-level-$type");
+ $text = $this->msg( "restriction-level-$type" )->text();
$m[$text] = $type;
}
}
@@ -288,7 +285,7 @@ class SpecialProtectedpages extends SpecialPage {
}
return "" .
- Xml::label( wfMsg( 'restriction-level' ) , $this->IdLevel ) . ' ' .
+ Xml::label( $this->msg( 'restriction-level' )->text(), $this->IdLevel ) . ' ' .
Xml::tags( 'select',
array( 'id' => $this->IdLevel, 'name' => $this->IdLevel ),
implode( "\n", $options ) ) . "";