* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem.file');
$engine = JPATH_ADMINISTRATOR . '/components/com_easyblog/includes/easyblog.php';
if (!JFile::exists($engine)) {
    return;
}
require_once $engine;
require_once __DIR__ . '/helper.php';
// Ensure that all script are loaded
EB::init('module');
// Attach modules stylesheet
EB::stylesheet('module')->attach();
$categories = modEasyBlogCategoriesHelper::getCategories($params);
$app = JFactory::getApplication();
$view = $app->input->get('view');
$layout = $app->input->get('layout');
$selected = '';
if ($view == 'categories' && $layout == 'listings') {
    $selected = $app->input->get('id');
}
$layoutType = $params->get('layouttype');
// For toggle-able layout
if ($layoutType == 'toggle') {
    $model = EB::model('Category');
    $onlyTheseCatIds = $params->get('catid', '');
    $filterCats = array();
    if (!empty($onlyTheseCatIds)) {
        $filterStr = '';