HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
GRI.php
Go to the documentation of this file.
1 <?php
2 class GRI
3 {
4  public function getIndex($data, $row, $column)
5  {
6  $grid = $column->grid;
7  $pages = $grid->dataProvider->getPagination();
8  $start = ($grid->enablePagination === false) ? 0 : $pages->getCurrentPage(false) * $pages->getPageSize();
9  return $start + $row + 1;
10  }
11 
19  public function getIndexManual($row, $currentPage, $pageSize = 10) {
20  if (!empty($currentPage)) {
21  $currentPage -= 1;
22  }
23  $res = ($row + 1) + ($currentPage * $pageSize);
24  return (string)$res;
25  }
26 
32  public function buttonByUsername($username) {
33  $usernames = array(
34  'admin' => true,
35  'default' => true,
36  'default_temp' => true
37  );
38  return !isset($usernames[$username]);
39  }
40 
46  public function buttonByType($type) {
47  $types = array(
48  'default' => true,
49  'default_temp' => true
50  );
51  return !isset($types[$type]);
52  }
53 }