JHTMLGrid/published: Difference between revisions
From Joomla! Documentation
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 2 users not shown) | |||
| Line 1: | Line 1: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[</nowiki>[[Description:JHTMLGrid/published|Edit Descripton]]<nowiki>]</nowiki> | <nowiki>[</nowiki>[[Description:JHTMLGrid/published|Edit Descripton]]<nowiki>]</nowiki> | ||
</span> | </span> | ||
===Syntax=== | ===Syntax=== | ||
| Line 15: | Line 14: | ||
!Description | !Description | ||
|- | |- | ||
| | | &$row | ||
| | | | ||
| | | | ||
| Line 65: | Line 64: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=published | category=published | ||
category=JHTMLGrid | category=JHTMLGrid | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
[[Category:Archived pages API15]][[Category:Security mod error page]] | |||
Latest revision as of 00:52, 25 March 2017
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] Template:SeeAlso:JHTMLGrid/published
Examples
Code Examples