本文整理汇总了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;
}
示例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);
}
示例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__);
}