本文整理汇总了PHP中NewsfeedsHelperRoute::getNewsfeedRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP NewsfeedsHelperRoute::getNewsfeedRoute方法的具体用法?PHP NewsfeedsHelperRoute::getNewsfeedRoute怎么用?PHP NewsfeedsHelperRoute::getNewsfeedRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NewsfeedsHelperRoute
的用法示例。
在下文中一共展示了NewsfeedsHelperRoute::getNewsfeedRoute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onJSolrSearchURIGet
public function onJSolrSearchURIGet($document)
{
if ($this->get('context') == $document->context) {
require_once JPATH_ROOT . "/components/com_newsfeeds/helpers/route.php";
return NewsfeedsHelperRoute::getNewsfeedRoute($document->id, $document->parent_id);
}
return null;
}
示例2: getAssociations
/**
* Method to get the associations for a given item
*
* @param integer $id Id of the item
* @param string $view Name of the view
*
* @return array Array of associations for the item
*
* @since 3.0
*/
public static function getAssociations($id = 0, $view = null)
{
$jinput = JFactory::getApplication()->input;
$view = is_null($view) ? $jinput->get('view') : $view;
$id = empty($id) ? $jinput->getInt('id') : $id;
if ($view == 'newsfeed') {
if ($id) {
$associations = JLanguageAssociations::getAssociations('com_newsfeeds', '#__newsfeeds', 'com_newsfeeds.item', $id);
$return = array();
foreach ($associations as $tag => $item) {
$return[$tag] = NewsfeedsHelperRoute::getNewsfeedRoute($item->id, (int) $item->catid, $item->language);
}
return $return;
}
}
if ($view == 'category' || $view == 'categories') {
return self::getCategoryAssociations($id, 'com_newsfeeds');
}
return array();
}
示例3: getAssociations
/**
* Method to get the associations for a given item
*
* @param integer $id Id of the item
* @param string $view Name of the view
*
* @return array Array of associations for the item
*
* @since 3.0
*/
public static function getAssociations($id = 0, $view = null)
{
jimport('helper.route', JPATH_COMPONENT_SITE);
$app = JFactory::getApplication();
$jinput = $app->input;
$view = is_null($view) ? $jinput->get('view') : $view;
$id = empty($id) ? $jinput->getInt('id') : $id;
if ($view == 'newsfeed') {
if ($id) {
$associations = NewsfeedsHelper::getAssociations($id);
$return = array();
foreach ($associations as $tag => $item) {
$return[$tag] = NewsfeedsHelperRoute::getNewsfeedRoute($item->id, $item->catid, $item->language);
}
return $return;
}
}
if ($view == 'category' || $view == 'categories') {
return self::getCategoryAssociations($id, 'com_newsfeeds');
}
return array();
}
示例4:
</td>
<td>
<a href="javascript:void(0)" onclick="if (window.parent) window.parent.<?php
echo $this->escape($function);
?>
('<?php
echo $item->id;
?>
', '<?php
echo $this->escape(addslashes($item->name));
?>
', '<?php
echo $this->escape($item->catid);
?>
', null, '<?php
echo $this->escape(NewsfeedsHelperRoute::getNewsfeedRoute($item->id, $item->catid, $item->language));
?>
', '<?php
echo $this->escape($lang);
?>
', null);">
<?php
echo $this->escape($item->name);
?>
</a>
<div class="small">
<?php
echo JText::_('JCATEGORY') . ": " . $this->escape($item->category_title);
?>
</div>
</td>
示例5: index
/**
* Method to index an item. The item must be a FinderIndexerResult object.
*
* @param FinderIndexerResult $item The item to index as an FinderIndexerResult object.
* @param string $format The item format. Not used.
*
* @return void
*
* @since 2.5
* @throws Exception on database error.
*/
protected function index(FinderIndexerResult $item, $format = 'html')
{
// Check if the extension is enabled.
if (JComponentHelper::isEnabled($this->extension) == false) {
return;
}
$item->setLanguage();
// Initialize the item parameters.
$registry = new Registry();
$registry->loadString($item->params);
$item->params = $registry;
$registry = new Registry();
$registry->loadString($item->metadata);
$item->metadata = $registry;
// Build the necessary route and path information.
$item->url = $this->getURL($item->id, $this->extension, $this->layout);
$item->route = NewsfeedsHelperRoute::getNewsfeedRoute($item->slug, $item->catslug, $item->language);
$item->path = FinderIndexerHelper::getContentPath($item->route);
/*
* Add the meta-data processing instructions based on the newsfeeds
* configuration parameters.
*/
// Add the meta-author.
$item->metaauthor = $item->metadata->get('author');
// Handle the link to the meta-data.
$item->addInstruction(FinderIndexer::META_CONTEXT, 'link');
$item->addInstruction(FinderIndexer::META_CONTEXT, 'metakey');
$item->addInstruction(FinderIndexer::META_CONTEXT, 'metadesc');
$item->addInstruction(FinderIndexer::META_CONTEXT, 'metaauthor');
$item->addInstruction(FinderIndexer::META_CONTEXT, 'author');
$item->addInstruction(FinderIndexer::META_CONTEXT, 'created_by_alias');
// Add the type taxonomy data.
$item->addTaxonomy('Type', 'News Feed');
// Add the category taxonomy data.
$item->addTaxonomy('Category', $item->category, $item->cat_state, $item->cat_access);
// Add the language taxonomy data.
$item->addTaxonomy('Language', $item->language);
// Get content extras.
FinderIndexerHelper::getContentExtras($item);
// Index the item.
$this->indexer->index($item);
}