JHTMLGrid/access: Difference between revisions
From Joomla! Documentation
New page:
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</span>
{{Description:JHTMLGrid/access}}
=... |
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/access|Edit Descripton]]<nowiki>]</nowiki> | <nowiki>[</nowiki>[[Description:JHTMLGrid/access|Edit Descripton]]<nowiki>]</nowiki> | ||
</span> | </span> | ||
===Syntax=== | ===Syntax=== | ||
| Line 15: | Line 14: | ||
!Description | !Description | ||
|- | |- | ||
| | | &$row | ||
| | | | ||
| | | | ||
| Line 70: | Line 69: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=access | category=access | ||
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:51, 25 March 2017
Syntax
access(&$row, $i, $archived=NULL)
| Parameter Name | Default Value | Description |
|---|---|---|
| &$row | ||
| $i | ||
| $archived | NULL |
Defined in
libraries/joomla/html/html/grid.php
Importing
jimport( 'joomla.html.html.grid' );
Source Body
function access( &$row, $i, $archived = NULL )
{
if ( !$row->access ) {
$color_access = 'style="color: green;"';
$task_access = 'accessregistered';
} else if ( $row->access == 1 ) {
$color_access = 'style="color: red;"';
$task_access = 'accessspecial';
} else {
$color_access = 'style="color: black;"';
$task_access = 'accesspublic';
}
if ($archived == -1)
{
$href = JText::_( $row->groupname );
}
else
{
$href = '
<a href="javascript:void(0);" onclick="return listItemTask(\'cb'. $i .'\',\''. $task_access .'\')" '. $color_access .'>
'. JText::_( $row->groupname ) .'</a>'
;
}
return $href;
}
[Edit See Also] Template:SeeAlso:JHTMLGrid/access
Examples
Code Examples