code/libraries/joomlatools/library/template/helper/grid.php
public function publish($config = array())
    {
        $translator = $this->getObject('translator');

        $config = new KObjectConfigJson($config);
        $config->append(array(
            'entity'    => null,
            'field'     => 'enabled',
            'clickable' => true
        ))->append(array(
            'enabled'   => (bool) $config->entity->{$config->field},
        ))->append(array(
            'alt'       => $config->enabled ? $translator->translate('Published') : $translator->translate('Unpublished'),
            'tooltip'   => $config->enabled ? $translator->translate('Unpublish Item') : $translator->translate('Publish Item'),
            'color'     => $config->enabled ? '#468847' : '#b94a48',
            'icon'      => $config->enabled ? 'enabled' : 'disabled',
        ));

        return $this->enable($config);
    }
public function publish($config = array())
    {
        $translator = $this->getObject('translator');

        $config = new KObjectConfigJson($config);
        $config->append(array(
            'entity'    => null,
            'field'     => 'enabled',
            'clickable' => true
        ))->append(array(
            'enabled'   => (bool) $config->entity->{$config->field},
        ))->append(array(
            'alt'       => $config->enabled ? $translator->translate('Published') : $translator->translate('Unpublished'),
            'tooltip'   => $config->enabled ? $translator->translate('Unpublish Item') : $translator->translate('Publish Item'),
            'color'     => $config->enabled ? '#468847' : '#b94a48',
            'icon'      => $config->enabled ? 'enabled' : 'disabled',
        ));

        return $this->enable($config);
    }
public function publish ( $ config = array ( ) ) { $ translator = $ this -> getObject ( 'translator' ) ; $ config = new KObjectConfigJson ( $ config ) ; $ config -> append ( array ( 'entity' => null , 'field' => 'enabled' , 'clickable' => true ) ) -> append ( array ( 'enabled' => ( bool ) $ config -> entity -> { $ config -> field } , ) ) -> append ( array ( 'alt' => $ config -> enabled ? $ translator -> translate ( 'Published' ) : $ translator -> translate ( 'Unpublished' ) , 'tooltip' => $ config -> enabled ? $ translator -> translate ( 'Unpublish Item' ) : $ translator -> translate ( 'Publish Item' ) , 'color' => $ config -> enabled ? '#468847' : '#b94a48' , 'icon' => $ config -> enabled ? 'enabled' : 'disabled' , ) ) ; return $ this -> enable ( $ config ) ; }
Render a publish field

@param 	array 	$config An optional array with configuration options
@return	string	Html
Render a publish field