function getDefinedMeaningReferenceRecord( $definedMeaningId ) {
	$o = OmegaWikiAttributes::getInstance();
	
	$record = new ArrayRecord( $o->definedMeaningReferenceStructure );
	$record->definedMeaningId = $definedMeaningId;
	$record->definedMeaningLabel = definedMeaningExpression( $definedMeaningId );
	$record->definedMeaningDefiningExpression = definingExpression( $definedMeaningId );
	
	return $record;
}
	/** 
	 * Fetch from DB if necessary
	 *
	 */
	public function getDefiningExpression() {
		if ( is_null( $this->definingExpression ) ) {
			return definingExpression( $this->getId(), $this->getDataset() );
		}
		return $this->definingExpression;
	}
Exemplo n.º 3
0
function definingExpressionAsLink( $definedMeaningId ) {
	return spellingAsLink( definingExpression( $definedMeaningId ) );
}
Exemplo n.º 4
0
	public function getViewHTML( IdStack $idPath, $value ) {
		global $wgOut;
		$definition = getDefinedMeaningDefinition( $value );
		$definedMeaningAsLink = definedMeaningAsLink( $value );
		$escapedDefinition = htmlspecialchars( $definition );
		if ( $this->truncate && strlen( $definition ) > $this->truncateAt )
			$escapedDefinition = '<span title="' . $escapedDefinition . '">' . htmlspecialchars( mb_substr( $definition, 0, $this->truncateAt ) ) . wfMsg( 'ellipsis' ) . '</span>' . EOL;

		static $isMetaDescSet = 0 ;
		if ( $isMetaDescSet == 0 ) {
			$expression = definedMeaningExpression ( $value ) ;
			$wgOut->addMeta( 'Description', $expression . ": " . $definition );
			$isMetaDescSet = 1 ;
		}

		$DMPageName = definingExpression( $value ) . " (" . $value . ")" ;
		$DMTitle = Title::makeTitle( NS_DEFINEDMEANING , $DMPageName );
		$editURL = $DMTitle->getLocalURL( 'action=edit' ) ;
		$editLink = '<div style="float:right; font-size:60%;"><sup>['
			. createLink( $editURL , wfMsg( 'edit') )
			. ']</sup></div>' ;

		return $editLink . $definedMeaningAsLink . ": " . $escapedDefinition ;
	}