Actions

API15

JHTMLGrid/published

From Joomla! Documentation

< API15:JHTMLGrid
Revision as of 20:49, 12 May 2013 by Tom Hutchison (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

published(&$row, $i, $imgY= 'tick.png', $imgX= 'publish_x.png', $prefix='')
Parameter Name Default Value Description
&$row
$i
$imgY 'tick.png'
$imgX 'publish_x.png'
$prefix

Defined in

libraries/joomla/html/html/grid.php

Importing

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

Source Body

function published( &$row, $i, $imgY = 'tick.png', $imgX = 'publish_x.png', $prefix='' )
{
        $img    = $row->published ? $imgY : $imgX;
        $task   = $row->published ? 'unpublish' : 'publish';
        $alt    = $row->published ? JText::_( 'Published' ) : JText::_( 'Unpublished' );
        $action = $row->published ? JText::_( 'Unpublish Item' ) : JText::_( 'Publish item' );
 
        $href = '
        <a href="javascript:void(0);" onclick="return listItemTask(\'cb'. $i .'\',\''. $prefix.$task .'\')" title="'. $action .'">
        <img src="images/'. $img .'" border="0" alt="'. $alt .'" /></a>'
        ;
 
        return $href;
}

[Edit See Also] SeeAlso:JHTMLGrid/published

Examples

<CodeExamplesForm />