require_once $IP.'/PHPTAL-NP-0.7.0/libs/PHPTAL.php';
/**
- *
+ * @todo document
* @package MediaWiki
*/
class MediaWiki_I18N extends PHPTAL_I18N {
* @package MediaWiki
*/
class SkinPHPTal extends Skin {
+ /**#@+
+ * @access private
+ */
+
+ /**
+ * Name of our skin, set in initPage()
+ * It probably need to be all lower case.
+ */
+ var $skinname;
+
+ /**
+ * Stylesheets set to use
+ * Sub directory in ./skins/ where various stylesheets are located
+ */
+ var $stylename;
+
+ /**
+ * PHPTal template to be used.
+ * '.pt' will be automaticly added to it on PHPTAL object creation
+ */
var $template;
+ /**#@-*/
+
+ /** */
function initPage( &$out ) {
parent::initPage( $out );
- $this->skinname = 'monobook';
- $this->template = 'MonoBook';
+ $this->skinname = 'monobook';
+ $this->stylename = 'monobook';
+ $this->template = 'MonoBook';
}
/**
global $wgScript, $wgStylePath, $wgLanguageCode, $wgUseNewInterlanguage;
global $wgMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest;
global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgSiteNotice;
- global $wgMaxCredits, $wgShowCreditsIfMax;
+ global $wgMaxCredits, $wgShowCreditsIfMax;
extract( $wgRequest->getValues( 'oldid', 'diff' ) );
$tpl->setRef( 'mimetype', $wgMimeType );
$tpl->setRef( 'charset', $wgOutputEncoding );
$tpl->set( 'headlinks', $out->getHeadLinks() );
+ $tpl->setRef( 'wgScript', $wgScript );
$tpl->setRef( 'skinname', $this->skinname );
+ $tpl->setRef( 'stylename', $this->stylename );
$tpl->setRef( 'loggedin', $this->loggedin );
$tpl->set('nsclass', 'ns-'.$wgTitle->getNamespace());
+ $tpl->set('notspecialpage', $wgTitle->getNamespace() != NS_SPECIAL);
/* XXX currently unused, might get useful later
$tpl->set( "editable", ($wgTitle->getNamespace() != NS_SPECIAL ) );
$tpl->set( "exists", $wgTitle->getArticleID() != 0 );
* an array of edit links by default used for the tabs
*/
function buildContentActionUrls () {
- global $wgTitle, $wgUser, $wgRequest, $wgUseValidation;
+ global $wgTitle, $wgUser, $wgOut, $wgRequest, $wgUseValidation;
$action = $wgRequest->getText( 'action' );
$section = $wgRequest->getText( 'section' );
$oldid = $wgRequest->getVal( 'oldid' );
$diff = $wgRequest->getVal( 'diff' );
$content_actions = array();
- if( $this->iscontent ) {
+ if( $this->iscontent and !$wgOut->isQuickbarSuppressed() ) {
$nskey = $this->getNameSpaceKey();
$is_active = !Namespace::isTalk( $wgTitle->getNamespace()) ;
$nav_urls['mainpage'] = array('href' => htmlspecialchars( $this->makeI18nUrl('mainpage')));
$nav_urls['randompage'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage')));
$nav_urls['recentchanges'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchanges')));
- $nav_urls['whatlinkshere'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Whatlinkshere', 'target='.urlencode( $this->thispage ))));
$nav_urls['currentevents'] = (wfMsg('currentevents') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('currentevents'))) : false;
$nav_urls['portal'] = (wfMsg('portal') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('portal-url'))) : false;
- $nav_urls['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage ))));
$nav_urls['bugreports'] = array('href' => htmlspecialchars( $this->makeI18nUrl('bugreportspage')));
// $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $this->makeI18nUrl('sitesupportpage')));
$nav_urls['sitesupport'] = array('href' => htmlspecialchars( $wgSiteSupportPage));
}
$nav_urls['specialpages'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Specialpages')));
+ if( $wgTitle->getNamespace() != NS_SPECIAL) {
+ $nav_urls['whatlinkshere'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Whatlinkshere', 'target='.urlencode( $this->thispage ))));
+ $nav_urls['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage ))));
+ }
+
if( $wgTitle->getNamespace() == NS_USER || $wgTitle->getNamespace() == NS_USER_TALK ) {
$id = User::idFromName($wgTitle->getText());
$ip = User::isIP($wgTitle->getText());
}
}
-
return $nav_urls;
}
$action = $wgRequest->getText('action');
$maxage = $wgRequest->getText('maxage');
$s = "/* generated user stylesheet */\n";
- if($wgLang->isRTL()) $s .= '@import "'.$wgStylePath.'/'.$this->skinname.'/rtl.css";'."\n";
+ if($wgLang->isRTL()) $s .= '@import "'.$wgStylePath.'/'.$this->stylename.'/rtl.css";'."\n";
$s .= '@import "'.
$this->makeNSUrl(ucfirst($this->skinname).'.css', 'action=raw&ctype=text/css&smaxage='.$wgSquidMaxage, NS_MEDIAWIKI)."\";\n";
if($wgUser->getID() != 0) {