2014-04-08 12:32:59 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2016-12-01 07:21:47 +00:00
|
|
|
* @package Joomla.Administrator
|
|
|
|
* @subpackage Weblinks
|
2014-04-08 12:32:59 +00:00
|
|
|
*
|
2017-02-13 16:20:35 +00:00
|
|
|
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
|
2014-04-08 12:32:59 +00:00
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
defined('_JEXEC') or die;
|
|
|
|
|
|
|
|
JLoader::register('WeblinksHelper', JPATH_ADMINISTRATOR . '/components/com_weblinks/helpers/weblinks.php');
|
2016-07-28 20:17:26 +00:00
|
|
|
JLoader::register('WeblinksHelperRoute', JPATH_SITE . '/components/com_weblinks/helpers/route.php');
|
2014-04-08 12:32:59 +00:00
|
|
|
JLoader::register('CategoryHelperAssociation', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/association.php');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Weblinks Component Association Helper
|
|
|
|
*
|
2014-12-04 19:43:05 +00:00
|
|
|
* @since 3.0
|
2014-04-08 12:32:59 +00:00
|
|
|
*/
|
|
|
|
abstract class WeblinksHelperAssociation extends CategoryHelperAssociation
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*
|
2015-02-18 01:20:59 +00:00
|
|
|
* @since 3.0
|
2014-04-08 12:32:59 +00:00
|
|
|
*/
|
|
|
|
public static function getAssociations($id = 0, $view = null)
|
|
|
|
{
|
2015-02-18 01:20:59 +00:00
|
|
|
$jinput = JFactory::getApplication()->input;
|
2016-07-28 20:17:26 +00:00
|
|
|
$view = is_null($view) ? $jinput->get('view') : $view;
|
|
|
|
$id = empty($id) ? $jinput->getInt('id') : $id;
|
2014-04-08 12:32:59 +00:00
|
|
|
|
|
|
|
if ($view == 'category' || $view == 'categories')
|
|
|
|
{
|
|
|
|
return self::getCategoryAssociations($id, 'com_weblinks');
|
|
|
|
}
|
|
|
|
|
|
|
|
return array();
|
|
|
|
}
|
|
|
|
}
|