<?php /** * @package EasyDiscuss * @copyright Copyright (C) 2010 Stack Ideas Private Limited. All rights reserved. * @license GNU/GPL, see LICENSE.php * * EasyDiscuss is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // no direct access defined('_JEXEC') or die('Restricted access'); require_once JPATH_ROOT . '/components/com_easydiscuss/helpers/helper.php'; require_once DISCUSS_HELPERS . '/string.php'; require_once dirname(__FILE__) . '/helper.php'; $lang = JFactory::getLanguage(); $lang->load('mod_easydiscuss_categories', JPATH_ROOT); $categories = modEasydiscussCategoriesHelper::getData($params); $selected = ''; $document = JFactory::getDocument(); DiscussHelper::loadStylesheet("module", "mod_easydiscuss_categories"); require JModuleHelper::getLayoutPath('mod_easydiscuss_categories');
public static function accessNestedCategories(&$categories, $selected, $params, $level = null) { $itemid = modEasydiscussCategoriesHelper::_getMenuItemId($params); foreach ($categories as $category) { if (is_null($level)) { $level = 0; } $css = ''; if ($category->id == $selected) { $css = 'font-weight: bold;'; } if ($params->get('layouttype') == 'tree') { // $category->level -= 1; $padding = $level * 30; } ob_start(); include JModuleHelper::getLayoutPath('mod_easydiscuss_categories', 'item'); $contents = ob_get_contents(); ob_end_clean(); echo $contents; if ($params->get('layouttype') == 'tree' || $params->get('layouttype') == 'flat') { if (isset($category->childs) && is_array($category->childs)) { modEasydiscussCategoriesHelper::accessNestedCategories($category->childs, $selected, $params, $level + 1); } } } }
// Replace the icon now. $( this ).parent().removeClass( 'expanded' ); }); }); </script> <div class="discuss-mod discuss-mod-categories discuss-categories<?php echo $params->get('moduleclass_sfx'); ?> "> <?php if ($categories) { ?> <ul class="toggleModuleCategories unstyled"> <?php echo modEasydiscussCategoriesHelper::accessNestedCategories($categories, $selected, $params); ?> </ul> <?php } else { ?> <div class="no-item"> <?php echo JText::_('MOD_DISCUSSIONSCATEGORIES_NO_ENTRIES'); ?> </div> <?php } ?> </div>
" > <div class="item"<?php echo $params->get('layouttype') == 'tree' ? ' style="padding-left: ' . $padding . 'px;"' : ''; ?> > <?php if ($params->get('showcavatar', true)) { ?> <a href="<?php echo DiscussRouter::_('index.php?option=com_easydiscuss&view=categories&layout=listings&category_id=' . $category->id); ?> " class="item-avatar float-l"> <img src="<?php echo modEasydiscussCategoriesHelper::getAvatar($category); ?> " width="34" height="34" alt="<?php echo DiscussStringHelper::escape($category->title); ?> " class="avatar" /> </a> <?php } ?> <div class="item-story"> <?php if (!empty($category->childs)) { ?> <a href="javascript:void(0);" class="show-item" data-id="<?php