当前位置: 首页>>代码示例>>PHP>>正文


PHP SMWPropertyValue::isVisible方法代码示例

本文整理汇总了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;
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:28,代码来源:HtmlContentBuilder.php

示例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;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:24,代码来源:SMW_SpecialBrowse.php


注:本文中的SMWPropertyValue::isVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。