/**
*
+ * @package MediaWiki
*/
/**
if( defined( "MEDIAWIKI" ) ) {
# See skin.doc
-
-require_once( 'Feed.php' ); // should not be called if the actual page isn't feed enabled
require_once( 'Image.php' );
# These are the INTERNAL names, which get mapped directly to class names and
require_once( 'RecentChange.php' );
+global $wgLinkHolders;
+$wgLinkHolders = array(
+ 'namespaces' => array(),
+ 'dbkeys' => array(),
+ 'queries' => array(),
+ 'texts' => array(),
+ 'titles' => array()
+);
+
/**
* @todo document
+ * @package MediaWiki
*/
class RCCacheEntry extends RecentChange
{
* The main skin class that provide methods and properties for all other skins
* including PHPTal skins.
* This base class is also the "Standard" skin.
+ * @package MediaWiki
*/
class Skin {
/**#@+
}
function getStylesheet() {
- return 'wikistandard.css';
+ return 'common/wikistandard.css';
}
-
+
function getSkinName() {
return 'standard';
}
function getHeadScripts() {
global $wgStylePath, $wgUser, $wgLang, $wgAllowUserJs;
- $r = "<script type=\"text/javascript\" src=\"{$wgStylePath}/wikibits.js\"></script>\n";
+ $r = "<script type=\"text/javascript\" src=\"{$wgStylePath}/common/wikibits.js\"></script>\n";
if( $wgAllowUserJs && $wgUser->getID() != 0 ) { # logged in
$userpage = $wgLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName();
$userjs = htmlspecialchars($this->makeUrl($userpage.'/'.$this->getSkinName().'.js', 'action=raw&ctype=text/javascript'));
$sheet = $this->getStylesheet();
$action = $wgRequest->getText('action');
$s = "@import \"$wgStylePath/$sheet\";\n";
- if($wgLang->isRTL()) $s .= "@import \"$wgStylePath/common_rtl.css\";\n";
+ if($wgLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css\";\n";
if( $wgAllowUserCss && $wgUser->getID() != 0 ) { # logged in
if($wgTitle->isCssSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
$s .= $wgRequest->getText('wpTextbox1');
$s .= $this->doGetUserStyles();
return $s."\n";
}
-
+
/**
* placeholder, returns generated js in monobook
*/
# of categories an article belong to
if($wgUseCategoryBrowser) {
$s .= '<br/><hr/>';
-
+
# get a big array of the parents tree
$parenttree = $wgTitle->getCategorieBrowser();
}
return $return;
}
-
+
$s .= walkThrough($parenttree);
}
$sub = $wgOut->getSubtitle();
if ( '' == $sub ) {
global $wgExtraSubtitle;
- $sub = wfMsg( 'fromwikipedia' ) . $wgExtraSubtitle;
+ $sub = wfMsg( 'tagline' ) . $wgExtraSubtitle;
}
$subpages = $this->subPageSubtitle();
$sub .= !empty($subpages)?"</p><p class='subpages'>$subpages":'';
function getPoweredBy() {
global $wgStylePath;
- $url = htmlspecialchars( "$wgStylePath/images/poweredby_mediawiki_88x31.png" );
+ $url = htmlspecialchars( "$wgStylePath/common/images/poweredby_mediawiki_88x31.png" );
$img = '<a href="http://www.mediawiki.org/"><img src="'.$url.'" alt="MediaWiki" /></a>';
return $img;
}
function aboutLink() {
$s = $this->makeKnownLink( wfMsg( 'aboutpage' ),
- wfMsg( 'aboutwikipedia' ) );
+ wfMsg( 'aboutsite' ) );
return $s;
}
* Pass a title object, not a title string
*/
function makeLinkObj( &$nt, $text= '', $query = '', $trail = '', $prefix = '' ) {
- global $wgOut, $wgUser;
+ global $wgOut, $wgUser, $wgLinkHolders;
$fname = 'Skin::makeLinkObj';
# Fail gracefully
}
# Allows wiki to bypass using linkcache, see OutputPage::parseLinkHolders()
- $retVal = '<!--LINK ' . implode( ' ', array( $nt->getNamespace(), $nt->getDBkey(),
- $query, $prefix . $text . $inside ) ) . "-->{$trail}";
+ $nr = array_push( $wgLinkHolders['namespaces'], $nt->getNamespace() );
+ $wgLinkHolders['dbkeys'][] = $nt->getDBkey();
+ $wgLinkHolders['queries'][] = $query;
+ $wgLinkHolders['texts'][] = $prefix.$text.$inside;
+ $wgLinkHolders['titles'][] = $nt;
+
+ $retVal = '<!--LINK '. ($nr-1) ."-->{$trail}";
} else {
# Work out link colour immediately
$aid = $nt->getArticleID() ;
return $title->getLocalURL( $urlaction );
}
/*static*/ function makeI18nUrl ( $name, $urlaction='' ) {
- $title = Title::newFromText( wfMsg($name) );
+ $title = Title::newFromText( wfMsgForContent($name) );
$this->checkTitle($title, $name);
return $title->getLocalURL( $urlaction );
}
);
}
/*static*/ function makeI18nUrlDetails ( $name, $urlaction='' ) {
- $title = Title::newFromText( wfMsg($name) );
+ $title = Title::newFromText( wfMsgForContent($name) );
$this->checkTitle($title, $name);
return array(
'href' => $title->getLocalURL( $urlaction ),
} else {
$zoomicon = '<div class="magnify" style="float:'.$magnifyalign.'">'.
'<a href="'.$u.'" class="internal" title="'.$more.'">'.
- '<img src="'.$wgStylePath.'/images/magnify-clip.png" ' .
+ '<img src="'.$wgStylePath.'/common/images/magnify-clip.png" ' .
'width="15" height="11" alt="'.$more.'" /></a></div>';
}
}
# Spacer image
$r = '' ;
- $r .= '<img src="'.$wgStylePath.'/images/Arr_.png" width="12" height="12" border="0" />' ;
+ $r .= '<img src="'.$wgStylePath.'/common/images/Arr_.png" width="12" height="12" border="0" />' ;
$r .= '<tt>' ;
if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
$rcm = 'RCM'.$this->rcCacheIndex ;
$toggleLink = "javascript:toggleVisibility('$rci','$rcm','$rcl')" ;
$arrowdir = $wgLang->isRTL() ? 'l' : 'r';
- $tl = '<span id="'.$rcm.'"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/images/Arr_'.$arrowdir.'.png" width="12" height="12" /></a></span>' ;
- $tl .= '<span id="'.$rcl.'" style="display:none"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/images/Arr_d.png" width="12" height="12" /></a></span>' ;
+ $tl = '<span id="'.$rcm.'"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/common/images/Arr_'.$arrowdir.'.png" width="12" height="12" /></a></span>' ;
+ $tl .= '<span id="'.$rcl.'" style="display:none"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/common/images/Arr_d.png" width="12" height="12" /></a></span>' ;
$r .= $tl ;
# Main line
# Get rc_xxxx variables
extract( $rcObj->mAttribs );
- $r .= '<img src="'.$wgStylePath.'/images/Arr_.png" width="12" height="12" />';
+ $r .= '<img src="'.$wgStylePath.'/common/images/Arr_.png" width="12" height="12" />';
$r .= '<tt> ' ;
if ( $rc_new ) $r .= $N ;
else $r .= ' ' ;
* comments. It escapes any HTML in the comment, but adds some CSS to format
* auto-generated comments (from section editing) and formats [[wikilinks]].
*
- * The &$title parameter must be a title OBJECT. It is used to generate a
+ * The &$title parameter must be a title OBJECT. It is used to generate a
* direct link to the section in the autocomment.
* @author Erik Moeller <moeller@scireview.de>
- *
+ *
* Note: there's not always a title to pass to this function.
* Since you can't set a default parameter for a reference, I've turned it
* temporarily to a value pass. Should be adjusted further. --brion
$link='';
if($title) {
$section=$auto;
-
+
# This is hackish but should work in most cases.
$section=str_replace('[[','',$section);
$section=str_replace(']]','',$section);
* These two do not check for permissions: check $wgTitle->userCanEdit
* before calling them
*/
+ function editSectionScriptForOther( $title, $section, $head ) {
+ $ttl = Title::newFromText( $title );
+ $url = $ttl->escapeLocalURL( 'action=edit§ion='.$section );
+ return '<span oncontextmenu=\'document.location="'.$url.'";return false;\'>'.$head.'</span>';
+ }
+
function editSectionScript( $section, $head ) {
global $wgTitle, $wgRequest;
if( $wgRequest->getInt( 'oldid' ) && ( $wgRequest->getVal( 'diff' ) != '0' ) ) {
return '<span oncontextmenu=\'document.location="'.$url.'";return false;\'>'.$head.'</span>';
}
+ function editSectionLinkForOther( $title, $section ) {
+ global $wgRequest;
+ global $wgUser, $wgLang;
+
+ $title = Title::newFromText($title);
+ $editurl = '§ion='.$section;
+ $url = $this->makeKnownLink($title->getPrefixedText(),wfMsg('editsection'),'action=edit'.$editurl);
+
+ if( $wgLang->isRTL() ) {
+ $farside = 'left';
+ $nearside = 'right';
+ } else {
+ $farside = 'right';
+ $nearside = 'left';
+ }
+ return "<div class=\"editsection\" style=\"float:$farside;margin-$nearside:5px;\">[".$url."]</div>";
+
+ }
+
function editSectionLink( $section ) {
global $wgRequest;
global $wgTitle, $wgUser, $wgLang;
* This function is called by EditPage.php and shows a bulletin board style
* toolbar for common editing functions. It can be disabled in the user
* preferences.
- * The necsesary JavaScript code can be found in style/wikibits.js.
+ * The necessary JavaScript code can be found in style/wikibits.js.
*/
function getEditToolbar() {
global $wgStylePath, $wgLang, $wgMimeType;
$toolbar.="document.writeln(\"<div id='toolbar'>\");\n";
foreach($toolarray as $tool) {
- $image=$wgStylePath.'/images/'.$tool['image'];
+ $image=$wgStylePath.'/common/images/'.$tool['image'];
$open=$tool['open'];
$close=$tool['close'];
$sample = addslashes( $tool['sample'] );