$this->lang = ( $langObj ? $langObj : $wgContLang );
$this->langcode = $this->lang->getCode();
- $this->foreign = $this->langcode != $wgContLang->getCode();
+ $this->foreign = $this->langcode !== $wgContLang->getCode();
$request = $this->getRequest();
if ( $this->filter === 'all' ) {
$this->custom = null; // So won't match in either case
} else {
- $this->custom = ( $this->filter == 'unmodified' );
+ $this->custom = ( $this->filter === 'unmodified' );
}
$prefix = $this->getLanguage()->ucfirst( $request->getVal( 'prefix', '' ) );
- $prefix = $prefix != '' ? Title::makeTitleSafe( NS_MEDIAWIKI, $request->getVal( 'prefix', null ) ) : null;
+ $prefix = $prefix !== '' ?
+ Title::makeTitleSafe( NS_MEDIAWIKI, $request->getVal( 'prefix', null ) ) :
+ null;
+
if ( $prefix !== null ) {
$this->displayPrefix = $prefix->getDBkey();
$this->prefix = '/^' . preg_quote( $this->displayPrefix ) . '/i';
$msg = wfMessage( 'allmessages-language' );
$langSelect = Xml::languageSelector( $this->langcode, false, null, $attrs, $msg );
- $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-allmessages-form' ) ) .
+ $out = Xml::openElement( 'form', array(
+ 'method' => 'get',
+ 'action' => $wgScript,
+ 'id' => 'mw-allmessages-form'
+ ) ) .
Xml::fieldset( $this->msg( 'allmessages-filter-legend' )->text() ) .
Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
Xml::openElement( 'table', array( 'class' => 'mw-allmessages-table' ) ) . "\n" .
Xml::label( $this->msg( 'allmessages-prefix' )->text(), 'mw-allmessages-form-prefix' ) .
"</td>\n
<td class=\"mw-input\">" .
- Xml::input( 'prefix', 20, str_replace( '_', ' ', $this->displayPrefix ), array( 'id' => 'mw-allmessages-form-prefix' ) ) .
+ Xml::input(
+ 'prefix',
+ 20,
+ str_replace( '_', ' ', $this->displayPrefix ),
+ array( 'id' => 'mw-allmessages-form-prefix' )
+ ) .
"</td>\n
</tr>
<tr>\n
'filter',
'unmodified',
'mw-allmessages-form-filter-unmodified',
- ( $this->filter == 'unmodified' )
+ ( $this->filter === 'unmodified' )
) .
Xml::radioLabel( $this->msg( 'allmessages-filter-all' )->text(),
'filter',
'all',
'mw-allmessages-form-filter-all',
- ( $this->filter == 'all' )
+ ( $this->filter === 'all' )
) .
Xml::radioLabel( $this->msg( 'allmessages-filter-modified' )->text(),
'filter',
'modified',
'mw-allmessages-form-filter-modified',
- ( $this->filter == 'modified' )
+ ( $this->filter === 'modified' )
) .
"</td>\n
</tr>
$exists = false;
if ( $foreign ) {
$title = explode( '/', $s->page_title );
- if ( count( $title ) === 2 && $langcode == $title[1]
+ if ( count( $title ) === 2 && $langcode === $title[1]
&& isset( $xNames[$title[0]] )
) {
$exists = $title[0];
} elseif ( isset( $xNames[$s->page_title] ) ) {
$exists = $s->page_title;
}
- if ( $exists && $s->page_namespace == NS_MEDIAWIKI ) {
+ if ( $exists && $s->page_namespace === NS_MEDIAWIKI ) {
$pageFlags[$exists] = true;
- } elseif ( $exists && $s->page_namespace == NS_MEDIAWIKI_TALK ) {
+ } elseif ( $exists && $s->page_namespace === NS_MEDIAWIKI_TALK ) {
$talkFlags[$exists] = true;
}
}
$count++;
}
- if ( $count == $limit ) {
+ if ( $count === $limit ) {
break;
}
}
}
function getStartBody() {
- return Xml::openElement( 'table', array( 'class' => 'mw-datatable TablePager', 'id' => 'mw-allmessagestable' ) ) . "\n" .
+ return Xml::openElement( 'table', array(
+ 'class' => 'mw-datatable TablePager',
+ 'id' => 'mw-allmessagestable'
+ ) ) .
+ "\n" .
"<thead><tr>
<th rowspan=\"2\">" .
$this->msg( 'allmessagesname' )->escaped() . "
case 'am_actual' :
return Sanitizer::escapeHtmlAllowEntities( $value, ENT_QUOTES );
}
+
return '';
}
if ( $row->am_customised ) {
$s .= Xml::openElement( 'tr', $this->getRowAttrs( $row, true ) );
$formatted = strval( $this->formatValue( 'am_actual', $row->am_actual ) );
- if ( $formatted == '' ) {
+
+ if ( $formatted === '' ) {
$formatted = ' ';
}
+
$s .= Xml::tags( 'td', $this->getCellAttrs( 'am_actual', $row->am_actual ), $formatted )
. "</tr>\n";
}
function getRowAttrs( $row, $isSecond = false ) {
$arr = array();
+
if ( $row->am_customised ) {
$arr['class'] = 'allmessages-customised';
}
+
if ( !$isSecond ) {
$arr['id'] = Sanitizer::escapeId( 'msg_' . $this->getLanguage()->lcfirst( $row->am_title ) );
}
}
function getCellAttrs( $field, $value ) {
- if ( $this->mCurrentRow->am_customised && $field == 'am_title' ) {
+ if ( $this->mCurrentRow->am_customised && $field === 'am_title' ) {
return array( 'rowspan' => '2', 'class' => $field );
- } elseif ( $field == 'am_title' ) {
+ } elseif ( $field === 'am_title' ) {
return array( 'class' => $field );
} else {
return array( 'lang' => $this->langcode, 'dir' => $this->lang->getDir(), 'class' => $field );