Back to JGrid class

Method isdefault

public static string
isdefault
(mixed $value, mixed $i, mixed $prefix = '', mixed $enabled = true, mixed $checkbox = 'cb', mixed $formId = null, mixed $active_class = 'icon-color-featured icon-star', mixed $inactive_class = 'icon-unfeatured')
Returns an isDefault state on a grid
Parameters
  • int $value The state value.
  • int $i The row index
  • string|array $prefix An optional task prefix or an array of options
  • bool $enabled An optional setting for access control on the action.
  • string $checkbox An optional prefix for checkboxes.
  • string $formId An optional form selector.
  • string $active_class The class for active items.
  • string $inactive_class The class for inactive items.
Returns
  • string The HTML markup
Since
  • 1.6
-
  • \Joomla\CMS\HTML\Helpers\JHtmlJGrid::state()
Class: JGrid
Project: Joomla

Method isdefault - Source code

/**
 * Returns an isDefault state on a grid
 *
 * @param   integer       $value             The state value.
 * @param   integer       $i                 The row index
 * @param   string|array  $prefix            An optional task prefix or an array of options
 * @param   boolean       $enabled           An optional setting for access control on the action.
 * @param   string        $checkbox          An optional prefix for checkboxes.
 * @param   string        $formId            An optional form selector.
 * @param   string        $active_class      The class for active items.
 * @param   string        $inactive_class    The class for inactive items.
 *
 * @return  string  The HTML markup
 *
 * @see     JHtmlJGrid::state()
 * @since   1.6
 */
public static function isdefault($value, $i, $prefix = '', $enabled = true, $checkbox = 'cb', $formId = null, $active_class = 'icon-color-featured icon-star', $inactive_class = 'icon-unfeatured')
{
    if (is_array($prefix)) {
        $options = $prefix;
        $enabled = array_key_exists('enabled', $options) ? $options['enabled'] : $enabled;
        $checkbox = array_key_exists('checkbox', $options) ? $options['checkbox'] : $checkbox;
        $prefix = array_key_exists('prefix', $options) ? $options['prefix'] : '';
    }
    $states = array(0 => array('setDefault', '', 'JLIB_HTML_SETDEFAULT_ITEM', '', 1, $inactive_class, $inactive_class), 1 => array('unsetDefault', 'JDEFAULT', 'JLIB_HTML_UNSETDEFAULT_ITEM', 'JDEFAULT', 1, $active_class, $active_class));
    return static::state($states, $value, $i, $prefix, $enabled, true, $checkbox, $formId);
}