forked from crisu83/yii-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAuthAssignmentViewColumn.php
44 lines (42 loc) · 1.17 KB
/
AuthAssignmentViewColumn.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
/**
* AuthAssignmentViewColumn 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 view link for an assignment row.
*/
class AuthAssignmentViewColumn 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 (!Yii::app()->user->isAdmin)
{
$this->grid->controller->widget('bootstrap.widgets.TbButton', array(
'type' => 'link',
'size' => 'mini',
'icon' => 'eye-open',
'url' => array('view', 'id' => $data->{$this->idColumn}),
'htmlOptions' => array('rel' => 'tooltip', 'title' => Yii::t('AuthModule.main', 'View')),
));
}
}
}