# Allow frames by default
$outputPage->allowClickjacking();
- $parserCache = ParserCache::singleton();
+ $parserCache = MediaWikiServices::getInstance()->getParserCache();
$parserOptions = $this->getParserOptions();
# Render printable version, use printable version cache
$outputPage->enableOOUI();
- $options = [];
- $options[] = [
- 'data' => 'other',
- 'label' => $ctx->msg( 'deletereasonotherlist' )->inContentLanguage()->text(),
- ];
- $list = $ctx->msg( 'deletereason-dropdown' )->inContentLanguage()->text();
- foreach ( explode( "\n", $list ) as $option ) {
- $value = trim( $option );
- if ( $value == '' ) {
- continue;
- } elseif ( substr( $value, 0, 1 ) == '*' && substr( $value, 1, 1 ) != '*' ) {
- $options[] = [ 'optgroup' => trim( substr( $value, 1 ) ) ];
- } elseif ( substr( $value, 0, 2 ) == '**' ) {
- $options[] = [ 'data' => trim( substr( $value, 2 ) ) ];
- } else {
- $options[] = [ 'data' => trim( $value ) ];
- }
- }
+ $options = Xml::listDropDownOptions(
+ $ctx->msg( 'deletereason-dropdown' )->inContentLanguage()->text(),
+ [ 'other' => $ctx->msg( 'deletereasonotherlist' )->inContentLanguage()->text() ]
+ );
+ $options = Xml::listDropDownOptionsOoui( $options );
$fields[] = new OOUI\FieldLayout(
new OOUI\DropdownInputWidget( [
/**
* Check if the page can be cached
- * @param integer $mode One of the HTMLFileCache::MODE_* constants (since 1.28)
+ * @param int $mode One of the HTMLFileCache::MODE_* constants (since 1.28)
* @return bool
*/
public function isFileCacheable( $mode = HTMLFileCache::MODE_NORMAL ) {
/**
* @param array $limit
* @param array $expiry
- * @param bool $cascade
+ * @param bool &$cascade
* @param string $reason
* @param User $user
* @return Status
/**
* @param array $limit
* @param string $reason
- * @param int $cascade
+ * @param int &$cascade
* @param array $expiry
* @return bool
*/
* @param bool $suppress
* @param int $u1 Unused
* @param bool $u2 Unused
- * @param string $error
+ * @param string &$error
* @return bool
*/
public function doDeleteArticle(
* @param string $summary
* @param string $token
* @param bool $bot
- * @param array $resultDetails
+ * @param array &$resultDetails
* @param User|null $user
* @return array
*/
* @param string $fromP
* @param string $summary
* @param bool $bot
- * @param array $resultDetails
+ * @param array &$resultDetails
* @param User|null $guser
* @return array
*/
}
/**
- * @param bool $hasHistory
+ * @param bool &$hasHistory
* @return mixed
*/
public function generateReason( &$hasHistory ) {