double click editing
authorGabriel Wicke <gwicke@users.mediawiki.org>
Wed, 7 Apr 2004 22:54:28 +0000 (22:54 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Wed, 7 Apr 2004 22:54:28 +0000 (22:54 +0000)
includes/SkinPHPTal.php
templates/xhtml_slim.pt

index b7e4a3e..d0b302f 100644 (file)
                        $tpl->setRef( 'charset', $wgOutputEncoding);
                        $tpl->setRef( 'skinname', $this->skinname );
                        $tpl->setRef( "loggedin", &$this->loggedin );
+                       /* XXX currently unused, might get useful later
                        $tpl->set( "editable", ($wgTitle->getNamespace() != NS_SPECIAL ) );
                        $tpl->set( "exists", $wgTitle->getArticleID() != 0 );
                        $tpl->set( "watch", $wgTitle->userIsWatching() ? "unwatch" : "watch" );
                        $tpl->set( "protect", count($wgTitle->getRestrictions()) ? "unprotect" : "protect" );
                        $tpl->set( "helppage", wfMsg('helppage'));
+                       $tpl->set( "sysop", $wgUser->isSysop() );
+                       */
                        $tpl->setRef( "searchaction", &$wgScriptPath );
                        $tpl->setRef( "stylepath", &$wgStyleSheetPath );
                        $tpl->setRef( "lang", &$wgLanguageCode );
                        $tpl->set( "langname", $wgLang->getLanguageName( $wgLanguageCode ) );
                        $tpl->setRef( "username", &$this->username );
                        $tpl->setRef( "userpage", &$this->userpage);
-                       $tpl->set( "sysop", $wgUser->isSysop() );
                        if( $wgUser->getNewtalk() ) {
                                $usertitle = Title::newFromText( $this->userpage );
                                $usertalktitle = $usertitle->getTalkPage();
                        } else {
                                $ntl = "";
                        }
+
                        $tpl->setRef( "newtalk", &$ntl );
                        $tpl->setRef( "skin", &$this);
                        $tpl->set( "logo", $this->logoText() );
                                $tpl->set('language_urls', false);
                        }
                        $tpl->set('personal_urls', $this->buildPersonalUrls());
-                       $tpl->set('content_actions', $this->buildContentActionUrls());
+                       $content_actions = $this->buildContentActionUrls();
+                       $tpl->setRef('content_actions', &$content_actions);
+                       if($content_actions['edit']['href'] && $wgUser->getOption("editondblclick") ) {
+                               $tpl->set('body-ondblclick', 'document.location = "' .$content_actions['edit']['href'] .'";');
+                       } else {
+                               $tpl->set('body-ondblclick', '');
+                       }
                        $tpl->set( "nav_urls", $this->buildNavUrls() );
 
                        // execute template
index 5588c52..760b652 100644 (file)
@@ -21,7 +21,7 @@
     </script>
   </head>
 
-  <body>
+  <body tal:attributes="ondblclick body-ondblclick|default">
     <div id="visual-portal-wrapper">
 
       <div id="portal-column-content">