Open Journal Systems  3.3.0
GridCategoryRowCellProvider.inc.php
1 <?php
2 
17 import('lib.pkp.classes.controllers.grid.GridCellProvider');
18 
20 
21  //
22  // Implemented methods from GridCellProvider.
23  //
27  function getTemplateVarsFromRowColumn($row, $column) {
28  // Default category rows will only have the first column
29  // as label columns.
30  if ($column->hasFlag('firstColumn')) {
31  return array('label' => $row->getCategoryLabel());
32  } else {
33  return array('label' => '');
34  }
35  }
36 
40  function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_ROW_CLICK) {
41  return $row->getActions($position);
42  }
43 
47  function render($request, $row, $column) {
48  // Default category rows will only have the first column
49  // as label columns.
50  if ($column->hasFlag('firstColumn')) {
51  // Store the current column template.
52  $template = $column->getTemplate();
53 
54  // Reset to the default column template.
55  $column->setTemplate('controllers/grid/gridCell.tpl');
56 
57  // Render the cell.
58  $renderedCell = parent::render($request, $row, $column);
59 
60  // Restore the original column template.
61  $column->setTemplate($template);
62 
63  return $renderedCell;
64  } else {
65  return '';
66  }
67  }
68 }
69 
70 
GridCategoryRowCellProvider
Default grid category row column's cell provider. This class will retrieve the template variables fro...
Definition: GridCategoryRowCellProvider.inc.php:19
GridCategoryRowCellProvider\render
render($request, $row, $column)
Definition: GridCategoryRowCellProvider.inc.php:47
GridCellProvider
Base class for a grid column's cell provider.
Definition: GridCellProvider.inc.php:20
GridCategoryRowCellProvider\getTemplateVarsFromRowColumn
getTemplateVarsFromRowColumn($row, $column)
Definition: GridCategoryRowCellProvider.inc.php:27
GridCategoryRowCellProvider\getCellActions
getCellActions($request, $row, $column, $position=GRID_ACTION_POSITION_ROW_CLICK)
Definition: GridCategoryRowCellProvider.inc.php:40