Actions

API16

JHtmlGrid/published

From Joomla! Documentation

< API16:JHtmlGrid
Revision as of 17:51, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

[Edit Descripton]

Description:JHtmlGrid/published

Contents

Syntax

static published($value, $i, $img1= 'tick.png', $img0= 'publish_x.png', $prefix='')
Parameter Name Default Value Description
$value $value Either the scalar value, or an object (for backward compatibility, deprecated)
$i $i
$img1 'tick.png' $img1 Image for a positive or on value
$img0 'publish_x.png' $img0 Image for the empty or off value
$prefix $prefix An optional prefix for the task

Defined in

libraries/joomla/html/html/grid.php

Importing

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

Source Body

public static function published($value, $i, $img1 = 'tick.png', $img0 = 'publish_x.png', $prefix='')
{
        if (is_object($value)) {
                $value = $value->published;
        }
        $img    = $value ? $img1 : $img0;
        $task   = $value ? 'unpublish' : 'publish';
        $alt    = $value ? JText::_('Published') : JText::_('Unpublished');
        $action = $value ? JText::_('UNPUBLISH_ITEM') : JText::_('PUBLISH_ITEM');
 
        $href = '
        <a href="javascript:void(0);" onclick="return listItemTask(\'cb'. $i .'\',\''. $prefix.$task .'\')" title="'. $action .'">'.
        JHTML::_('image','admin/'.$img, $alt, array('border' => 0), true).'</a>'
        ;
 
        return $href;
}

[Edit See Also] SeeAlso:JHtmlGrid/published

Examples

<CodeExamplesForm />