forked from crisu83/yii-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAuthAssignmentRevokeColumn.php
executable file
·44 lines (42 loc) · 1.16 KB
/
AuthAssignmentRevokeColumn.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* AuthAssignmentRevokeColumn class file.
* @author Christoffer Niska <[email protected]>
* @copyright Copyright © Christoffer Niska 2012-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @package auth.widgets
*/
/**
* Grid column for displaying the revoke link for an assignment row.
*/
class AuthAssignmentRevokeColumn extends AuthAssignmentColumn
{
/**
* Initializes the column.
*/
public function init()
{
if (isset($this->htmlOptions['class']))
$this->htmlOptions['class'] .= ' actions-column';
else
$this->htmlOptions['class'] = 'actions-column';
}
/**
* Renders the data cell content.
* @param integer $row the row number (zero-based).
* @param mixed $data the data associated with the row.
*/
protected function renderDataCellContent($row, $data)
{
if ($this->userId !== null)
{
echo TbHtml::linkButton(TbHtml::icon('remove'),array(
'style' => TbHtml::STYLE_LINK,
'size' => TbHtml::SIZE_MINI,
'url' => array('revoke', 'itemName' => $data['name'], 'userId' => $this->userId),
'rel' => 'tooltip',
'title' => Yii::t('AuthModule.main', 'Revoke'),
));
}
}
}