From 3a5d6d4dd9d83102fb396479dcc9d54fa3366d8e Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Fri, 30 Apr 2004 14:05:00 +0000 Subject: [PATCH] add section link for talk pages --- includes/SkinPHPTal.php | 14 +++++++++++++- languages/Language.php | 7 +++++-- stylesheets/monobook/main.css | 6 ++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index cd28f43d1e..96d4ae0e5b 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -294,6 +294,7 @@ function buildContentActionUrls () { global $wgTitle, $wgUser, $wgRequest; $action = $wgRequest->getText( 'action' ); + $section = $wgRequest->getText( 'section' ); $oldid = $wgRequest->getVal( 'oldid' ); $diff = $wgRequest->getVal( 'diff' ); $content_actions = array(); @@ -332,13 +333,24 @@ if ( $wgTitle->userCanEdit() ) { $oid = ( $oldid && ! isset( $diff ) ) ? "&oldid={$oldid}" : ''; + $istalk = ( Namespace::isTalk( $wgTitle->getNamespace()) ); + $istalkclass = $istalk?' istalk':''; $content_actions['edit'] = array( - 'class' => ($action == 'edit' or $action == 'submit') ? 'selected' : '', + 'class' => ((($action == 'edit' or $action == 'submit') and $section != 'new') ? 'selected' : '').$istalkclass, 'text' => wfMsg('edit'), 'href' => $this->makeUrl($this->thispage, 'action=edit'.$oid), 'ttip' => wfMsg('tooltip-edit'), 'akey' => wfMsg('accesskey-edit') ); + if ( $istalk ) { + $content_actions['addsection'] = array( + 'class' => $section == 'new'?'selected':'', + 'text' => wfMsg('addsection'), + 'href' => $this->makeUrl($this->thispage, 'action=edit§ion=new'), + 'ttip' => wfMsg('tooltip-addsection'), + 'akey' => wfMsg('accesskey-addsection') + ); + } } else { $oid = ( $oldid && ! isset( $diff ) ) ? "&oldid={$oldid}" : ''; $content_actions['edit'] = array('class' => ($action == 'edit') ? 'selected' : '', diff --git a/languages/Language.php b/languages/Language.php index 4c8adbb996..4459424311 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -524,6 +524,7 @@ $wgLanguageNamesEn =& $wgLanguageNames; 'specialpage' => 'Special Page', 'personaltools' => 'Personal tools', "postcomment" => "Post a comment", +"addsection" => "+", "articlepage" => "View article", "subjectpage" => "View subject", # For compatibility 'talk' => 'Discussion', @@ -1478,9 +1479,10 @@ amusement.", 'accesskey-article' => 'a', 'accesskey-talk' => 't', 'accesskey-edit' => 'e', +'accesskey-addsection' => '+', 'accesskey-viewsource' => 'e', 'accesskey-history' => 'h', -'accesskey-protect' => '-', +'accesskey-protect' => '=', 'accesskey-delete' => 'd', 'accesskey-undelete' => 'd', 'accesskey-move' => 'm', @@ -1519,9 +1521,10 @@ amusement.", 'tooltip-article' => 'View the article [alt-a]', 'tooltip-talk' => 'Discussion about the article [alt-t]', 'tooltip-edit' => 'You can edit this page. Please use the preview button before saving. [alt-e]', +'tooltip-addsection' => 'Add a comment to this page. [alt-+]', 'tooltip-viewsource' => 'This page is protected. You can view it\'s source. [alt-e]', 'tooltip-history' => 'Past versions of this page, [alt-h]', -'tooltip-protect' => 'Protect this page [alt--]', +'tooltip-protect' => 'Protect this page [alt-=]', 'tooltip-delete' => 'Delete this page [alt-d]', 'tooltip-undelete' => "Restore $1 deleted edits to this page [alt-d]", 'tooltip-move' => 'Move this page [alt-m]', diff --git a/stylesheets/monobook/main.css b/stylesheets/monobook/main.css index 4192047bdf..d44b4f0d74 100644 --- a/stylesheets/monobook/main.css +++ b/stylesheets/monobook/main.css @@ -715,6 +715,12 @@ li#pt-login { text-decoration: none; } #p-cactions h5 { display: none; } +#p-cactions li.istalk { margin-right: 0; } +#p-cactions li.istalk a { padding-right: 0.5em; } +#p-cactions #ca-addsection a { + padding-left: 0.4em; + padding-right: 0.4em; +} /* offsets to distinguish the tab groups */ li#ca-talk { margin-right: 1.6em; } li#ca-watch { margin-left: 1.6em; } -- 2.20.1