API16

JHtmlGrid/published: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> {{Description:JHtmlGrid/published}...
 
m preparing for archive only
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<! removed transcluded page call, red link never existed >
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JHtmlGrid/published|Edit Descripton]]<nowiki>]</nowiki>
</span>
 
{{Description:JHtmlGrid/published}}


===Syntax===
===Syntax===
Line 62: Line 57:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JHtmlGrid/published|Edit See Also]]<nowiki>]</nowiki>
<! removed transcluded page call, red link never existed >
</span>
{{SeeAlso:JHtmlGrid/published}}


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=published
  category=published
  category=JHtmlGrid
  category=JHtmlGrid
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API16]]

Latest revision as of 01:46, 25 March 2017

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

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;
}


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

Examples

Code Examples