From 1b5fa4daf9efc07dfb19e4184fdf7a7304ef76f0 Mon Sep 17 00:00:00 2001 From: ankush-maherwal Date: Tue, 20 Aug 2019 16:59:40 +0530 Subject: [PATCH] Bug #166 fix: Cluster Filters on UCM list view --- site/layouts/fields/cluster.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 site/layouts/fields/cluster.php diff --git a/site/layouts/fields/cluster.php b/site/layouts/fields/cluster.php new file mode 100644 index 00000000..62640b38 --- /dev/null +++ b/site/layouts/fields/cluster.php @@ -0,0 +1,29 @@ + + * @copyright Copyright (c) 2009-2019 TechJoomla. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access +defined('_JEXEC') or die('Restricted access'); + +if (!key_exists('field', $displayData)) +{ + return; +} + +$field = $displayData['field']; + +if ($field->value) +{ + JLoader::import("/components/com_cluster/includes/cluster", JPATH_ADMINISTRATOR); + $clusterModel = ClusterFactory::model('Cluster', array('ignore_request' => true)); + $cluster = $clusterModel->getItem($field->value); + echo $cluster->name; +} +else +{ + echo "-"; +}