30 lines
878 B
PHP
30 lines
878 B
PHP
<?php
|
|
|
|
namespace app\helpers;
|
|
|
|
use yii\helpers\Url;
|
|
|
|
class AuthItemGrid extends CommonGrid {
|
|
|
|
public static function checkbox($type, $haveRoot = true) {
|
|
return function($model) use ($type, $haveRoot) {
|
|
if ($model->name == "administrator" && $haveRoot)
|
|
return "";
|
|
return "<input type='checkbox' value='{$model->name}' name='checkbox-{$type}' class='checkbox-{$type}'>";
|
|
};
|
|
}
|
|
|
|
public static function rows($type, $bigSize = false) {
|
|
return function($model, $index, $widget, $grid) use ($type, $bigSize) {
|
|
return [
|
|
"ondblclick" => "common.form(this, '{$type}', {$bigSize});",
|
|
"style" => "cursor: pointer;",
|
|
"data" => [
|
|
"href" => Url::to(["update", "name" => $model->name])
|
|
]
|
|
];
|
|
};
|
|
}
|
|
|
|
}
|