r3014 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r3013‎ | r3014 | r3015 >
Date:22:54, 7 April 2004
Author:gabrielwicke
Status:old
Tags:
Comment:
double click editing
Modified paths:
  • /trunk/phase3/includes/SkinPHPTal.php (modified) (history)
  • /trunk/phase3/templates/xhtml_slim.pt (modified) (history)

Diff [purge]

Index: trunk/phase3/templates/xhtml_slim.pt
@@ -21,7 +21,7 @@
2222 </script>
2323 </head>
2424
25 - <body>
 25+ <body tal:attributes="ondblclick body-ondblclick|default">
2626 <div id="visual-portal-wrapper">
2727
2828 <div id="portal-column-content">
Index: trunk/phase3/includes/SkinPHPTal.php
@@ -84,18 +84,20 @@
8585 $tpl->setRef( 'charset', $wgOutputEncoding);
8686 $tpl->setRef( 'skinname', $this->skinname );
8787 $tpl->setRef( "loggedin", &$this->loggedin );
 88+ /* XXX currently unused, might get useful later
8889 $tpl->set( "editable", ($wgTitle->getNamespace() != NS_SPECIAL ) );
8990 $tpl->set( "exists", $wgTitle->getArticleID() != 0 );
9091 $tpl->set( "watch", $wgTitle->userIsWatching() ? "unwatch" : "watch" );
9192 $tpl->set( "protect", count($wgTitle->getRestrictions()) ? "unprotect" : "protect" );
9293 $tpl->set( "helppage", wfMsg('helppage'));
 94+ $tpl->set( "sysop", $wgUser->isSysop() );
 95+ */
9396 $tpl->setRef( "searchaction", &$wgScriptPath );
9497 $tpl->setRef( "stylepath", &$wgStyleSheetPath );
9598 $tpl->setRef( "lang", &$wgLanguageCode );
9699 $tpl->set( "langname", $wgLang->getLanguageName( $wgLanguageCode ) );
97100 $tpl->setRef( "username", &$this->username );
98101 $tpl->setRef( "userpage", &$this->userpage);
99 - $tpl->set( "sysop", $wgUser->isSysop() );
100102 if( $wgUser->getNewtalk() ) {
101103 $usertitle = Title::newFromText( $this->userpage );
102104 $usertalktitle = $usertitle->getTalkPage();
@@ -111,6 +113,7 @@
112114 } else {
113115 $ntl = "";
114116 }
 117+
115118 $tpl->setRef( "newtalk", &$ntl );
116119 $tpl->setRef( "skin", &$this);
117120 $tpl->set( "logo", $this->logoText() );
@@ -136,7 +139,13 @@
137140 $tpl->set('language_urls', false);
138141 }
139142 $tpl->set('personal_urls', $this->buildPersonalUrls());
140 - $tpl->set('content_actions', $this->buildContentActionUrls());
 143+ $content_actions = $this->buildContentActionUrls();
 144+ $tpl->setRef('content_actions', &$content_actions);
 145+ if($content_actions['edit']['href'] && $wgUser->getOption("editondblclick") ) {
 146+ $tpl->set('body-ondblclick', 'document.location = "' .$content_actions['edit']['href'] .'";');
 147+ } else {
 148+ $tpl->set('body-ondblclick', '');
 149+ }
141150 $tpl->set( "nav_urls", $this->buildNavUrls() );
142151
143152 // execute template

Status & tagging log