* (bug 11848) Allow URL parameters 'editintro' and 'preload' in Special:Mypage
and Special:Mytalk
* Add special page for getting random page from category
+* Add link on Special:Randomincategory to sidebar
=== Bug fixes in 1.12 ===
);
}
+ if( $this->mTitle->getNamespace() == NS_CATEGORY || $this->mTitle->getNamespace() == NS_CATEGORY_TALK ) {
+ $nav_urls['randomincategory'] = array(
+ 'text' => wfMsg( 'randomincategory-toolbox' ),
+ 'href' => self::makeSpecialUrlSubpage( 'Randomincategory', $this->mTitle->getText() ),
+ );
+ }
+
if( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) {
$id = User::idFromName($this->mTitle->getText());
$ip = User::isIP($this->mTitle->getText());
}
}
+
return $this->namespace;
}
public function setCategory ( $cat ) {
- $this->category = $cat;
+ $category = Title::makeTitleSafe( NS_CATEGORY, $cat );
+ $this->category = $category->getDBKey();
}
/**
}
+
'randompage-nopages' => 'There are no pages in this namespace.',
'randompage-url' => 'Special:Random', # don't translate or duplicate this message to other languages
'randomincategory' => 'Random page in category',
+'randomincategory-toolbox' => 'Random page',
'randomincategory-nocategory' => 'Category $1 doesn\'t exist or is empty',
'randomincategory-label' => 'Category:',
'randomincategory-submit' => 'Go',
'randompage' => 'Случайная страница',
'randompage-nopages' => 'В данном пространстве имён отсутствуют страницы.',
'randomincategory' => 'Случайная страница в категории',
+'randomincategory-toolbox' => 'Случайная страница',
'randomincategory-nocategory' => 'Категория "$1" пуста или не существует',
'randomincategory-label' => 'Категория:',
'randomincategory-submit' => 'Перейти',
} elseif ($this->data['nav_urls']['permalink']['href'] === '') { ?>
<li id="t-ispermalink"<?php echo $skin->tooltip('t-ispermalink') ?>><?php $this->msg('permalink') ?></li><?php
}
+
+ if(!empty($this->data['nav_urls']['randomincategory']['href'])) { ?>
+ <li id="t-random"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['randomincategory']['href'])
+ ?>"<?php echo $skin->tooltipAndAccesskey('t-print') ?>><?php $this->msg('randomincategory-toolbox') ?></a></li><?php
+ }
wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) );
?>