Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion components/com_contact/views/categories/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.caption');

echo JLayoutHelper::render('joomla.content.categories_default', $this);
JFactory::getDocument()->addScriptDeclaration("
jQuery(function($) {
$('.categories-list').find('[id^=category-btn-]').each(function(index, btn) {
var btn = $(btn);
btn.on('click', function() {
btn.find('span').toggleClass('icon-plus');
btn.find('span').toggleClass('icon-minus');
});
});
});");

echo JLayoutHelper::render('joomla.content.categories_default', $this);
echo $this->loadTemplate('items');
?>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
</span>
<?php endif; ?>
<?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?>
<a href="#category-<?php echo $item->id;?>" data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right"><span class="icon-plus"></span></a>
<a id="category-btn-<?php echo $item->id;?>" href="#category-<?php echo $item->id;?>"
data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right"><span class="icon-plus"></span></a>
<?php endif;?>
</h3>
<?php if ($this->params->get('show_subcat_desc_cat') == 1) :?>
Expand Down
12 changes: 12 additions & 0 deletions components/com_content/views/categories/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@

JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.caption');

JFactory::getDocument()->addScriptDeclaration("
jQuery(function($) {
$('.categories-list').find('[id^=category-btn-]').each(function(index, btn) {
var btn = $(btn);
btn.on('click', function() {
btn.find('span').toggleClass('icon-plus');
btn.find('span').toggleClass('icon-minus');
});
});
});");

echo JLayoutHelper::render('joomla.content.categories_default', $this);
echo $this->loadTemplate('items');
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
</span>
<?php endif; ?>
<?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?>
<a href="#category-<?php echo $item->id;?>" data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right"><span class="icon-plus"></span></a>
<a id="category-btn-<?php echo $item->id;?>" href="#category-<?php echo $item->id;?>"
data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right"><span class="icon-plus"></span></a>
<?php endif;?>
</h3>
<?php if ($this->params->get('show_description_image') && $item->getParams()->get('image')) : ?>
Expand Down
12 changes: 12 additions & 0 deletions components/com_newsfeeds/views/categories/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@

JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.caption');

JFactory::getDocument()->addScriptDeclaration("
jQuery(function($) {
$('.categories-list').find('[id^=category-btn-]').each(function(index, btn) {
var btn = $(btn);
btn.on('click', function() {
btn.find('span').toggleClass('icon-plus');
btn.find('span').toggleClass('icon-minus');
});
});
});");

echo JLayoutHelper::render('joomla.content.categories_default', $this);
echo $this->loadTemplate('items');
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
</span>
<?php endif; ?>
<?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?>
<a href="#category-<?php echo $item->id;?>" data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right"><span class="icon-plus"></span></a>
<a id="category-btn-<?php echo $item->id;?>" href="#category-<?php echo $item->id;?>"
data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right"><span class="icon-plus"></span></a>
<?php endif;?>
</h3>
<?php if ($this->params->get('show_subcat_desc_cat') == 1) :?>
Expand Down
2 changes: 1 addition & 1 deletion libraries/legacy/view/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function display($tpl = null)
// Escape strings for HTML output
$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));

$this->maxLevelcat = $params->get('maxLevelcat', -1);
$this->maxLevelcat = $params->get('maxLevelcat', -1) < 0 ? PHP_INT_MAX : $params->get('maxLevelcat', PHP_INT_MAX);
$this->params = &$params;
$this->parent = &$parent;
$this->items = &$items;
Expand Down