r83024 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83023‎ | r83024 | r83025 >
Date:18:10, 1 March 2011
Author:kipcool
Status:deferred
Tags:
Comment:
Setting the meta tag description as the first definition of a page.
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/Editor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/Editor.php
@@ -1104,13 +1104,21 @@
11051105 }
11061106
11071107 public function getViewHTML( IdStack $idPath, $value ) {
 1108+ global $wgOut;
11081109 $definition = getDefinedMeaningDefinition( $value );
11091110 $definedMeaningAsLink = definedMeaningAsLink( $value );
11101111 $escapedDefinition = htmlspecialchars( $definition );
11111112
11121113 if ( $this->truncate && strlen( $definition ) > $this->truncateAt )
11131114 $escapedDefinition = '<span title="' . $escapedDefinition . '">' . htmlspecialchars( mb_substr( $definition, 0, $this->truncateAt ) ) . wfMsg( 'ellipsis' ) . '</span>' . EOL;
1114 -
 1115+
 1116+ static $isMetaDescSet = 0 ;
 1117+ if ( $isMetaDescSet == 0 ) {
 1118+ $expression = definedMeaningExpression ( $value ) ;
 1119+ $wgOut->addMeta( 'Description', $expression . ": " . $definition );
 1120+ $isMetaDescSet = 1 ;
 1121+ }
 1122+
11151123 return $definedMeaningAsLink . ": " . $escapedDefinition;
11161124 }
11171125

Status & tagging log