API15

API15:JHTMLGrid/published

From Joomla! Documentation

Revision as of 22:21, 22 March 2010 by Doxiki (talk | contribs) (New page: <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> {{Description:JHTMLGrid/published}...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

[Edit Descripton]

Template:Description:JHTMLGrid/published

Syntax

published(&$row, $i, $imgY= 'tick.png', $imgX= 'publish_x.png', $prefix='')
Parameter Name Default Value Description
$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] Template:SeeAlso:JHTMLGrid/published

Examples

<CodeExamplesForm />