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


PHP JUDownloadHelper::getDocumentIcon方法代码示例

本文整理汇总了PHP中JUDownloadHelper::getDocumentIcon方法的典型用法代码示例。如果您正苦于以下问题:PHP JUDownloadHelper::getDocumentIcon方法的具体用法?PHP JUDownloadHelper::getDocumentIcon怎么用?PHP JUDownloadHelper::getDocumentIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JUDownloadHelper的用法示例。


在下文中一共展示了JUDownloadHelper::getDocumentIcon方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getRelatedDocuments

 public function getRelatedDocuments()
 {
     $app = JFactory::getApplication();
     $doc_id = $app->input->getInt('id', 0);
     $relatedDocumentIds = $app->getUserState("com_judownload.edit.document.related_documents", array());
     $related_documents = array();
     if ($relatedDocumentIds) {
         $db = JFactory::getDbo();
         $query = $db->getQuery(true);
         $query->select('d.id, d.title, d.icon');
         $query->from('#__judownload_documents AS d');
         $query->where('d.id IN (' . implode(',', $relatedDocumentIds) . ')');
         $db->setQuery($query);
         $related_documents = $db->loadObjectList();
     } elseif ($doc_id) {
         $db = JFactory::getDbo();
         $query = $db->getQuery(true);
         $query->select('d.id, d.title, d.icon');
         $query->from('#__judownload_documents_relations AS drel');
         $query->join('INNER', '#__judownload_documents AS d ON drel.doc_id_related = d.id');
         $query->where('drel.doc_id = ' . $doc_id);
         $query->order('drel.ordering ASC');
         $db->setQuery($query);
         $related_documents = $db->loadObjectList();
     }
     if ($related_documents) {
         foreach ($related_documents as $document) {
             $document->icon_src = JUDownloadHelper::getDocumentIcon($document->icon);
         }
     }
     return $related_documents;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:32,代码来源:document.php

示例2: _prepareDocument

	protected function _prepareDocument()
	{
		$document = JFactory::getDocument();
		$uri      = clone JUri::getInstance();

		
		$domain        = $uri->toString(array('scheme', 'host', 'port'));
		$canonicalLink = $domain . JRoute::_(JUDownloadHelperRoute::getDocumentRoute($this->item->id, $this->_layout), false);

		JUDownloadFrontHelper::setCanonical($canonicalLink);

		$imageUrl = JUDownloadHelper::getDocumentIcon($this->item->icon);
		
		$document->addCustomTag('<meta property="og:title" content="' . $this->item->title . '" />');
		$document->addCustomTag('<meta property="og:type" content="website" />');
		if ($imageUrl)
		{
			$document->addCustomTag('<meta property="og:image" content="' . JUri::root(true) . "/media/com_judownload/images/document/" . $this->item->icon . '" />');
		}
		$document->addCustomTag('<meta property="og:url" content="' . $canonicalLink . '" />');

		JUDownloadFrontHelperSeo::seo($this);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:23,代码来源:view.html.php

示例3: getOutput

	public function getOutput($options = array())
	{
		if (!$this->isPublished())
		{
			return "";
		}

		if (!$this->value)
		{
			return "";
		}

		$icon_src = JUDownloadHelper::getDocumentIcon($this->value);

		if (!$this->doc_id || !$icon_src)
		{
			return '';
		}

		$isDetailsView = $this->isDetailsView($options);

		$this->setVariable('icon_src', $icon_src);
		$this->setVariable('isDetailsView', $isDetailsView);

		return $this->fetch('output.php', __CLASS__);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:26,代码来源:core_icon.php


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