add section link for talk pages
authorGabriel Wicke <gwicke@users.mediawiki.org>
Fri, 30 Apr 2004 14:05:00 +0000 (14:05 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Fri, 30 Apr 2004 14:05:00 +0000 (14:05 +0000)
includes/SkinPHPTal.php
languages/Language.php
stylesheets/monobook/main.css

index cd28f43..96d4ae0 100644 (file)
                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();
 
                                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&section=new'),
+                                                       'ttip' => wfMsg('tooltip-addsection'),
+                                                       'akey' => wfMsg('accesskey-addsection')
+                                               );
+                                       }
                                } else {
                                        $oid = ( $oldid && ! isset( $diff ) ) ? "&oldid={$oldid}" : '';
                                        $content_actions['edit'] = array('class' => ($action == 'edit') ? 'selected' : '',
index 4c8adbb..4459424 100644 (file)
@@ -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]',
index 4192047..d44b4f0 100644 (file)
@@ -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; }