From: Gabriel Wicke Date: Thu, 29 Apr 2004 10:56:32 +0000 (+0000) Subject: moved user css setup to skinphptal, no hardcoded ? X-Git-Tag: 1.3.0beta1~197 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=49d5fbcb7dbdc6280a5a409228fe90df1801048b;p=lhc%2Fweb%2Fwiklou.git moved user css setup to skinphptal, no hardcoded ? --- diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index 25eb0d64c8..6de4a212be 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -65,6 +65,13 @@ extract( $wgRequest->getValues( 'oldid', 'diff' ) ); + $this->initPage( $out ); + $tpl = new PHPTAL($this->template . '.pt', 'templates'); + + #if ( $wgUseDatabaseMessages ) { // uncomment this to fall back to GetText + $tpl->setTranslator(new MediaWiki_I18N()); + #} + $this->thispage = $wgTitle->getPrefixedDbKey(); $this->thisurl = $wgTitle->getPrefixedURL(); $this->thisurle = urlencode($this->thisurl); @@ -72,16 +79,17 @@ $this->username = $wgUser->getName(); $this->userpage = $wgLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName(); $this->userpageurl = $this->makeUrl($this->userpage); - $this->userpageurle = htmlspecialchars($this->userpageurl); - $this->titletxt = $wgTitle->getPrefixedText(); - $this->initPage( $out ); - $tpl = new PHPTAL($this->template . '.pt', 'templates'); + if( $this->loggedin ) { + $this->usercss = $this->makeUrl($this->userpage.'/'.$this->skinname.'.css', 'action=raw&ctype=text/css'); + $this->usercsse = htmlspecialchars($this->usercss); + $this->userjs = $this->makeUrl($this->userpage.'/'.$this->skinname.'.js', 'action=raw&ctype=text/javascript'); + $this->userjse = htmlspecialchars($this->userjs); + } else { + $this->usercss = $this->usercsse = $this->userjs = $this->userjse = false; + } + $this->titletxt = $wgTitle->getPrefixedText(); - #if ( $wgUseDatabaseMessages ) { // uncomment this to fall back to GetText - $tpl->setTranslator(new MediaWiki_I18N()); - #} - $tpl->set( "title", $wgOut->getPageTitle() ); $tpl->set( "pagetitle", $wgOut->getHTMLTitle() ); @@ -127,7 +135,10 @@ $tpl->setRef( "username", &$this->username ); $tpl->setRef( "userpage", &$this->userpage); $tpl->setRef( "userpageurl", &$this->userpageurl); - $tpl->setRef( "userpageurle", &$this->userpageurle); + $tpl->setRef( "usercss", &$this->usercss); + $tpl->setRef( "usercsse", &$this->usercsse); + $tpl->setRef( "userjs", &$this->userjs); + $tpl->setRef( "userjse", &$this->userjse); if( $wgUser->getNewtalk() ) { $usertitle = Title::newFromText( $this->userpage ); $usertalktitle = $usertitle->getTalkPage(); diff --git a/templates/xhtml_slim.pt b/templates/xhtml_slim.pt index 86d0a5c269..f04dfefc4b 100644 --- a/templates/xhtml_slim.pt +++ b/templates/xhtml_slim.pt @@ -16,10 +16,9 @@ - - + +