本文整理汇总了PHP中SMWPropertyValue::isVisible方法的典型用法代码示例。如果您正苦于以下问题:PHP SMWPropertyValue::isVisible方法的具体用法?PHP SMWPropertyValue::isVisible怎么用?PHP SMWPropertyValue::isVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMWPropertyValue
的用法示例。
在下文中一共展示了SMWPropertyValue::isVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayValue
/**
* Displays a value, including all relevant links (browse and search by property)
*
* @param[in] $property SMWPropertyValue The property this value is linked to the subject with
* @param[in] $value DataValue The actual value
* @param[in] $incoming bool If this is an incoming or outgoing link
*
* @return string HTML with the link to the article, browse, and search pages
*/
private function displayValue(\SMWPropertyValue $property, DataValue $dataValue, $incoming)
{
$linker = smwfGetLinker();
// Allow the DV formatter to access a specific language code
$dataValue->setOption(DataValue::OPT_CONTENT_LANGUAGE, Localizer::getInstance()->getPreferredContentLanguage($this->subject->getDataItem())->getCode());
$dataValue->setOption(DataValue::OPT_USER_LANGUAGE, Localizer::getInstance()->getUserLanguage()->getCode());
$dataValue->setContextPage($this->subject->getDataItem());
// Use LOCL formatting where appropriate (date)
$dataValue->setOutputFormat('LOCL');
$html = $dataValue->getLongHTMLText($linker);
if ($dataValue->getTypeID() === '_wpg' || $dataValue->getTypeID() === '__sob') {
$html .= " " . \SMWInfolink::newBrowsingLink('+', $dataValue->getLongWikiText())->getHTML($linker);
} elseif ($incoming && $property->isVisible()) {
$html .= " " . \SMWInfolink::newInversePropertySearchLink('+', $dataValue->getTitle(), $property->getDataItem()->getLabel(), 'smwsearch')->getHTML($linker);
} elseif ($dataValue->getProperty() instanceof DIProperty && $dataValue->getProperty()->getKey() !== '_INST') {
$html .= $dataValue->getInfolinkText(SMW_OUTPUT_HTML, $linker);
}
return $html;
}
示例2: displayValue
/**
* Displays a value, including all relevant links (browse and search by property)
*
* @param[in] $property SMWPropertyValue The property this value is linked to the subject with
* @param[in] $value SMWDataValue The actual value
* @param[in] $incoming bool If this is an incoming or outgoing link
*
* @return string HTML with the link to the article, browse, and search pages
*/
private function displayValue( SMWPropertyValue $property, SMWDataValue $dataValue, $incoming ) {
$linker = smwfGetLinker();
$html = $dataValue->getLongHTMLText( $linker );
if ( $dataValue->getTypeID() == '_wpg' ) {
$html .= " " . SMWInfolink::newBrowsingLink( '+', $dataValue->getLongWikiText() )->getHTML( $linker );
} elseif ( $incoming && $property->isVisible() ) {
$html .= " " . SMWInfolink::newInversePropertySearchLink( '+', $dataValue->getTitle(), $property->getDataItem()->getLabel(), 'smwsearch' )->getHTML( $linker );
} else {
$html .= $dataValue->getInfolinkText( SMW_OUTPUT_HTML, $linker );
}
return $html;
}