From Joomla! Documentation

< API16:JHtmlJGrid

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

<! removed transcluded page call, red link never existed >


static published($value=0, $i, $taskPrefix= '', $canChange=true)
Parameter Name Default Value Description
$value 0 $value The state value.
$i $i
$taskPrefix An optional prefix for the task.
$canChange true An optional setting for access control on the action.

Defined in



jimport( 'joomla.html.html.jgrid' );

Source Body

public static function published($value = 0, $i, $taskPrefix = '', $canChange = true)
        // Array of image, task, title, action
        $states = array(
                1       => array('tick.png',            $taskPrefix.'unpublish',        'JState_Published',             'JState_UnPublish_Item'),
                0       => array('publish_x.png',       $taskPrefix.'publish',          'JState_UnPublished',   'JState_Publish_Item'),
                -1      => array('disabled.png',        $taskPrefix.'unpublish',        'JState_Archived',              'JState_UnPublish_Item'),
                -2      => array('trash.png',           $taskPrefix.'publish',          'JState_Trashed',               'JState_Publish_Item'),
        $state  = JArrayHelper::getValue($states, (int) $value, $states[0]);
        $html   = JHTML::_('image','admin/'.$state[0], JText::_($state[2]), NULL, true);
        if ($canChange) {
                $html   = '<a href="javascript:void(0);" onclick="return listItemTask(\'cb'.$i.'\',\''.$state[1].'\')" title="'.JText::_($state[3]).'">'
                                . $html.'</a>';

        return $html;

<! removed transcluded page call, red link never existed >


Code Examples