* New fileicons for c, cpp, deb, dvi, exe, h, html, iso, java, mid, mov, o,
ogg, pdf, ps, rm, rpm, tar, tex, ttf and txt files based on the KDE
crystalsvg theme.
-* (bug 2118) Added a __LCFIRST__ magic word for forcing the first character of
- a pages heading to render in its lower case form on output, however the page
- is still saved under its upper case name in the database so this is purely an
- aesthetic change (unlike setting $wgCapitalLinks to false).
=== Caveats ===
# Enabled article-related sidebar, toplinks, etc.
$wgOut->setArticleRelated( true );
- # Calculate preview html - must be here, because for the next things you
- # have to know, if the title changes because of __LCFIRST__
- if ( 'preview' == $formtype) {
- $previewOutput = $this->getPreviewText( $isConflict, $isCssJsSubpage );
- }
-
if ( $isConflict ) {
$s = wfMsg( 'editconflict', $this->mTitle->getPrefixedText() );
$wgOut->setPageTitle( $s );
$wgOut->addHTML( '<div id="wikiPreview">' );
if ( 'preview' == $formtype) {
+ $previewOutput = $this->getPreviewText( $isConflict, $isCssJsSubpage );
if ( $wgUser->getOption('previewontop' ) ) {
$wgOut->addHTML( $previewOutput );
$wgOut->addHTML( "<br style=\"clear:both;\" />\n" );
define('MAG_CURRENTWEEK', 37);
define('MAG_CURRENTDOW', 38);
define('MAG_REVISIONID', 39);
-define('MAG_LCFIRST', 40);
$wgVariableIDs = array(
MAG_CURRENTMONTH,
* @return bool
*/
function tryParserCache( $article, $user ) {
- global $wgParserCache, $wgTitle;
+ global $wgParserCache;
$parserOutput = $wgParserCache->get( $article, $user );
if ( $parserOutput !== false ) {
$this->mLanguageLinks += $parserOutput->getLanguageLinks();
$this->mCategoryLinks += $parserOutput->getCategoryLinks();
$this->addHTML( $parserOutput->getText() );
- if( $parserOutput->getLcfirstTitle() )
- $wgTitle->lcfirst();
$t = $parserOutput->getTitleText();
if( !empty( $t ) ) {
$this->setPageTitle( $t );
* @return ParserOutput a ParserOutput
*/
function parse( $text, &$title, $options, $linestart = true, $clearState = true ) {
- global $wgUseTidy, $wgContLang, $wgCapitalLinks;
+ global $wgUseTidy, $wgContLang;
$fname = 'Parser::parse';
wfProfileIn( $fname );
$this->mOptions = $options;
$this->mTitle =& $title;
- $this->mOutput->mLcfirstTitle = false;
$this->mOutputType = OT_HTML;
$this->mStripState = NULL;
$text = $this->internalParse( $text );
- // if the string __LCFIRST__ (make the first character of the title
- // lower case) occurs in the HTML, set the mLcfirstTitle to true
- $mw =& MagicWord::get( MAG_LCFIRST );
- if( $mw->matchAndRemove( $text ) && $wgCapitalLinks ) {
- $title->lcfirst();
- $this->mOutput->mLcfirstTitle = true;
- }
-
+
$text = $this->unstrip( $text, $this->mStripState );
# Clean up special characters, only run once, next-to-last before doBlockLevels
var $mCacheTime; # Used in ParserCache
var $mVersion; # Compatibility check
var $mTitleText; # title text of the chosen language variant
- var $mLcfirstTitle; # This is true if the first letter in the title has to be lowercase
function ParserOutput( $text = '', $languageLinks = array(), $categoryLinks = array(),
$containsOldMagic = false, $titletext = '' )
function getCategoryLinks() { return array_keys( $this->mCategoryLinks ); }
function getCacheTime() { return $this->mCacheTime; }
function getTitleText() { return $this->mTitleText; }
- function getLcfirstTitle() { return $this->mLcfirstTitle; }
function containsOldMagic() { return $this->mContainsOldMagic; }
function setText( $text ) { return wfSetVar( $this->mText, $text ); }
function setLanguageLinks( $ll ) { return wfSetVar( $this->mLanguageLinks, $ll ); }
return ( 0 == $this->mNamespace && "" == $this->mDbkeyform )
|| NS_SPECIAL == $this->mNamespace || NS_IMAGE == $this->mNamespace;
}
-
- /**
- * Changes the title to lowercase - used, when __LCFIRST__ occurs
- */
- function lcfirst() {
- global $wgContLang;
- $this->mTextform = $wgContLang->lcfirst($this->mTextform);
- // reset mPrefixedText, so that it's recalculated when already created
- // with uppercase title
- unset($this->mPrefixedText);
- }
}
?>
MAG_CURRENTWEEK => array( 1, 'CURRENTWEEK' ),
MAG_CURRENTDOW => array( 1, 'CURRENTDOW' ),
MAG_REVISIONID => array( 1, 'REVISIONID' ),
- MAG_LCFIRST => array( 0, '__LCFIRST__' ),
);
#-------------------------------------------------------------------