From: Victor Vasiliev Date: Sun, 11 Nov 2007 14:17:59 +0000 (+0000) Subject: * Normalize titles in Special:Randomincategory X-Git-Tag: 1.31.0-rc.0~50919 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=04bfab85fbaa9b26d95b92aea9d0c321e3bae8f4;p=lhc%2Fweb%2Fwiklou.git * Normalize titles in Special:Randomincategory * Add link on Special:Randomincategory to sidebar --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1891782ed5..089e798fdb 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -58,6 +58,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (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 === diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index eb651b552e..6145e9dccc 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -893,6 +893,13 @@ class SkinTemplate extends Skin { ); } + 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()); @@ -1196,3 +1203,4 @@ class QuickTemplate { } } + diff --git a/includes/SpecialRandomincategory.php b/includes/SpecialRandomincategory.php index 5372fa1117..ba5ebe387b 100644 --- a/includes/SpecialRandomincategory.php +++ b/includes/SpecialRandomincategory.php @@ -53,7 +53,8 @@ class RandomPageInCategory { return $this->namespace; } public function setCategory ( $cat ) { - $this->category = $cat; + $category = Title::makeTitleSafe( NS_CATEGORY, $cat ); + $this->category = $category->getDBKey(); } /** @@ -122,3 +123,4 @@ class RandomPageInCategory { } + diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 49093b7461..09767666e6 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1555,6 +1555,7 @@ PICT # misc. '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', diff --git a/languages/messages/MessagesRu.php b/languages/messages/MessagesRu.php index 250cbf3fd0..45b43de035 100644 --- a/languages/messages/MessagesRu.php +++ b/languages/messages/MessagesRu.php @@ -1216,6 +1216,7 @@ $3 указал следующую причину: ''$2''", 'randompage' => 'Случайная страница', 'randompage-nopages' => 'В данном пространстве имён отсутствуют страницы.', 'randomincategory' => 'Случайная страница в категории', +'randomincategory-toolbox' => 'Случайная страница', 'randomincategory-nocategory' => 'Категория "$1" пуста или не существует', 'randomincategory-label' => 'Категория:', 'randomincategory-submit' => 'Перейти', diff --git a/skins/MonoBook.php b/skins/MonoBook.php index d0148a701f..fcf7d4bf1d 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -221,6 +221,11 @@ class MonoBookTemplate extends QuickTemplate { } elseif ($this->data['nav_urls']['permalink']['href'] === '') { ?> data['nav_urls']['randomincategory']['href'])) { ?> +
  • tooltipAndAccesskey('t-print') ?>>msg('randomincategory-toolbox') ?>