var $mInterwikiMagic; # Interlanguage links are removed and returned in an array
var $mAllowExternalImages; # Allow external images inline
var $mAllowExternalImagesFrom; # If not, any exception?
- var $mEnableImageWhitelist; # If not or it doesn't match, should we check an on-wiki whitelist?
- var $mSkin = null; # Reference to the preferred skin
+ var $mEnableImageWhitelist; # If not or it doesn't match, should we check an on-wiki whitelist?
var $mDateFormat = null; # Date format index
var $mEditSection = true; # Create "edit section" links
var $mAllowSpecialInclusion; # Allow inclusion of special pages
function getAllowSpecialInclusion() { return $this->mAllowSpecialInclusion; }
function getTidy() { return $this->mTidy; }
function getInterfaceMessage() { return $this->mInterfaceMessage; }
- function getTargetLanguage() { return $this->mTargetLanguage; }
+ function getTargetLanguage( $title = null ) {
+ if ( $title && $title->isCssOrJsPage() ) {
+ return Language::factory( 'en' ); // css/js should always be LTR
+ } elseif ( $title && $title->getNamespace() == NS_MEDIAWIKI ) {
+ // Parse mediawiki messages with correct target language
+ list( /* $unused */, $lang ) = MessageCache::singleton()->figureMessage( $title->getText() );
+ $obj = wfGetLangObj( $lang );
+ return $obj;
+ }
+ return $this->mTargetLanguage;
+}
function getMaxIncludeSize() { return $this->mMaxIncludeSize; }
function getMaxPPNodeCount() { return $this->mMaxPPNodeCount; }
function getMaxPPExpandDepth() { return $this->mMaxPPExpandDepth; }
function getUser() { return $this->mUser; }
function getPreSaveTransform() { return $this->mPreSaveTransform; }
- /**
- * @param $title Title
- * @return Skin
- * @deprecated Use Linker::* instead
- */
- function getSkin( $title = null ) {
- if ( !isset( $this->mSkin ) ) {
- $this->mSkin = $this->mUser->getSkin( $title );
- }
- return $this->mSkin;
+ /**
+ * @param $title Title
+ * @return Skin
+ * @deprecated since 1.18 Use Linker::* instead
+ */
+ function getSkin( $title = null ) {
+ wfDeprecated( __METHOD__ );
+ return new DummyLinker;
}
function getDateFormat() {
* You shouldn't use this. Really. $parser->getFunctionLang() is all you need.
* Using this fragments the cache and is discouraged. Yes, {{int: }} uses this,
* producing inconsistent tables (Bug 14404).
+ * @return String Language code
+ * @since 1.17
*/
function getUserLang() {
$this->optionUsed('userlang');
function setTidy( $x ) { return wfSetVar( $this->mTidy, $x); }
function setSkin( $x ) { $this->mSkin = $x; }
function setInterfaceMessage( $x ) { return wfSetVar( $this->mInterfaceMessage, $x); }
- function setTargetLanguage( $x ) { return wfSetVar( $this->mTargetLanguage, $x); }
+ function setTargetLanguage( $x ) { return wfSetVar( $this->mTargetLanguage, $x, true ); }
function setMaxIncludeSize( $x ) { return wfSetVar( $this->mMaxIncludeSize, $x ); }
function setMaxPPNodeCount( $x ) { return wfSetVar( $this->mMaxPPNodeCount, $x ); }
function setMaxTemplateDepth( $x ) { return wfSetVar( $this->mMaxTemplateDepth, $x ); }
function setCleanSignatures( $x ) { return wfSetVar( $this->mCleanSignatures, $x ); }
function setExternalLinkTarget( $x ) { return wfSetVar( $this->mExternalLinkTarget, $x ); }
function setMath( $x ) { return wfSetVar( $this->mMath, $x ); }
- function setUserLang( $x ) { return wfSetVar( $this->mUserLang, $x ); }
+ function setUserLang( $x ) {
+ if ( $x instanceof Language ) {
+ $x = $x->getCode();
+ }
+ return wfSetVar( $this->mUserLang, $x );
+ }
function setThumbSize( $x ) { return wfSetVar( $this->mThumbSize, $x ); }
function setStubThreshold( $x ) { return wfSetVar( $this->mStubThreshold, $x ); }
function setPreSaveTransform( $x ) { return wfSetVar( $this->mPreSaveTransform, $x ); }
$confstr .= '!*';
// add in language specific options, if any
- // FIXME: This is just a way of retrieving the url/user preferred variant
+ // @todo FIXME: This is just a way of retrieving the url/user preferred variant
$confstr .= $wgContLang->getExtraHashOptions();
- // Since the skin could be overloading link(), it should be
- // included here but in practice, none of our skins do that.
- // $confstr .= "!" . $this->mSkin->getSkinName();
-
$confstr .= $wgRenderHashAppend;
if ( !in_array( 'editsection', $forOptions ) ) {