- Posts: 2
- Thank you received: 0
The developer takes a few days off for Holidays...
...and will be back with charged battery!
From 23 December to 2 January included
During this period, assistance from developer will not be provided.
|| $jinput->get('filter_month')
|| $jinput->get('filter_corso')
// Get Corso options
$corso = JFormHelper::loadFieldType('Corso', false);
$corsoOptions = $corso->getOptions();
// Get Sede options
$sede = JFormHelper::loadFieldType('Sede', false);
$sedeOptions = $sede->getOptions();
$filter_corso = $menuOptions
? ($this->params->get('filter_corso', 1) * 6)
: ($iCparams->get('filter_corso', 1) * 6);
$filter_sede = $menuOptions
? ($this->params->get('filter_sede', 1) * 6)
: ($iCparams->get('filter_sede', 1) * 6);
$html_filter_corso = '<select class="ic-input-small" id="filter_corso" name="filter_corso">
<option value="">' . JText::_('COM_ICAGENDA_FILTERS_SELECT_CORSO') . '</option>
' . JHtml::_('select.options', $corsoOptions, 'id', 'value',
$jinput->get('filter_corso')) . '</select>';
$html_filter_sede = '<select class="ic-input-small" id="filter_sede" name="filter_sede">
<option value="">' . JText::_('COM_ICAGENDA_FILTERS_SELECT_SEDE') . '</option>
' . JHtml::_('select.options', $sedeOptions, 'id', 'value',
$jinput->get('filter_sede')) . '</select>';
// Filter (dropdown) corso
$corso = $this->getUserStateFromRequest($this->context . '.filter.corso', 'filter_corso', '', 'string');
$this->setState('filter.corso', $corso);
// Filter (dropdown) sede
$sede = $this->getUserStateFromRequest($this->context . '.filter.sede', 'filter_sede', '', 'string');
$this->setState('filter.sede', $sede);
$search = $app->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$id .= ':' . $this->getState('filter.corso');
$id .= ':' . $this->getState('filter.sede');
<?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2017 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.6.0 2016-07-08
* @since 3.6.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('JPATH_BASE') or die;
jimport('joomla.html.html');
jimport('joomla.form.formfield');
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
* Corso frontend search filter.
*/
class JFormFieldCorso extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 3.6.0
*/
protected $type = 'corso';
/**
* Method to get the field options.
*
* @return array The field option objects.
* @since 3.6.0
*/
/*public function getOptions()
{
return '<select id="'.$this->id.'" value="'.$this->value.'">'.
'<option value="confermato" >confermato</option>'.
'<option value="non confermato" >non confermato</option>'.
'</select>';
}
}*/
public function getOptions()
{
$app = JFactory::getApplication();
$params = $app->getParams();
$filters_mode = ($app->getMenu()->getActive()->params->get('search_filters') == 1)
? $params->get('filters_mode', 1)
: JComponentHelper::getParams('com_icagenda')->get('filters_mode', 1);
// Initialize variables.
$options = array();
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('id, slug, value');
$query->from('#__icagenda_customfields_data AS c');
//$query->where('state = 1'); AND 'slug = filter_corso'
$query->where('slug = "filter_corso"');
$query->group('value');
// Search in menu filtered list - Cerca nell'elenco dei menu filtrati
if ($filters_mode == 1)
{
$value = $params->get('value', '');
JArrayHelper::toInteger($value);
$list_value = implode(',', $value);
if ($value
&& count($value) > 0
&& ! in_array('0', $value))
{
$query->where('c.value IN (' . $list_value . ')');
}
}
$query->order('c.value');
// Get the options.
$db->setQuery($query);
$options = $db->loadObjectList();
// Check for a database error.
if ($db->getErrorNum())
{
JError::raiseWarning(500, $db->getErrorMsg());
}
return $options;
}
}
<?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package com_icagenda
* @copyright Copyright (c)2012-2017 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.6.0 2016-07-08
* @since 3.6.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('JPATH_BASE') or die;
jimport('joomla.html.html');
jimport('joomla.form.formfield');
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
* Sede frontend search filter.
*/
class JFormFieldSede extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 3.6.0
*/
protected $type = 'sede';
/**
* Method to get the field options.
*
* @return array The field option objects.
* @since 3.6.0
*/
/* public function getOptions()
{
return '<select id="'.$this->id.'" value="'.$this->value.'">'.
'<option value="da Parma" >da Parma</option>'.
'<option value="da Reggio Emilia" >da Reggio Emilia</option>'.
'<option value="da definire" >da definire</option>'.
'</select>';
}
}*/
public function getOptions()
{
$app = JFactory::getApplication();
$params = $app->getParams();
$filters_mode = ($app->getMenu()->getActive()->params->get('search_filters') == 1)
? $params->get('filters_mode', 1)
: JComponentHelper::getParams('com_icagenda')->get('filters_mode', 1);
// Initialize variables.
$options = array();
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('id, slug, value');
$query->from('#__icagenda_customfields_data AS c');
//$query->where('state = 1'); AND 'slug = filter_corso'
$query->where('slug = "filter_sede"');
$query->group('value');
// Search in menu filtered list - Cerca nell'elenco dei menu filtrati
if ($filters_mode == 1)
{
$value = $params->get('value', '');
JArrayHelper::toInteger($value);
$list_value = implode(',', $value);
if ($value
&& count($value) > 0
&& ! in_array('0', $value))
{
$query->where('c.value IN (' . $list_value . ')');
}
}
$query->order('c.value');
// Get the options.
$db->setQuery($query);
$options = $db->loadObjectList();
// Check for a database error.
if ($db->getErrorNum())
{
JError::raiseWarning(500, $db->getErrorMsg());
}
return $options;
}
}
'filter_corso' => '',
'filter_sede' => '',
elseif (in_array($fieldname, array('filter_category', 'filter_corso', 'filter_sede', 'filter_month', 'filter_year')))
<field
name="filter_corso"
type="hidden"
rendertype="radio"
label="COM_ICAGENDA_LIST_SEARCH_FILTERS_CORSO_LBL"
description=""
default="1"
class="btn-group"
labelclass="control-label"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="filter_sede"
type="hidden"
rendertype="radio"
label="COM_ICAGENDA_LIST_SEARCH_FILTERS_SEDE_LBL"
description=""
default="1"
class="btn-group"
labelclass="control-label"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
da default="filter_search,filter_from,filter_to,filter_category,filter_month,filter_year"
a default="filter_search,filter_from,filter_to,filter_category,filter_corso,filter_sede,filter_month,filter_year"
da default="filter_search,filter_from,filter_to,filter_category,filter_month,filter_year"
a default="filter_search,filter_from,filter_to,filter_category,filter_corso,filter_sede,filter_month,filter_year"
<field
name="filter_corso"
type="hidden"
rendertype="radio"
label="COM_ICAGENDA_LIST_SEARCH_FILTERS_CORSO_LBL"
description=""
default=""
class="btn-group hidden-j25"
labelclass="control-label hidden-j25"
useglobal="true"
showon="search_filters:1"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="filter_sede"
type="hidden"
rendertype="radio"
label="COM_ICAGENDA_LIST_SEARCH_FILTERS_SEDE_LBL"
description=""
default=""
class="btn-group hidden-j25"
labelclass="control-label hidden-j25"
useglobal="true"
showon="search_filters:1"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
Please Log in or Create an account to join the conversation.