Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
AnnouncementTypeGridCellProvider.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.grid.GridCellProvider');
17 
19 
24  parent::GridCellProvider();
25  }
26 
30  function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT) {
31  if ($column->getId() == 'name') {
32  $announcementType =& $row->getData();
33  $label = $announcementType->getLocalizedTypeName();
34 
35  $router = $request->getRouter();
36  $actionArgs = array('announcementTypeId' => $row->getId());
37 
38  import('lib.pkp.classes.linkAction.request.AjaxModal');
39  $moreInformationAction = new LinkAction(
40  'edit',
41  new AjaxModal(
42  $router->url($request, null, null, 'editAnnouncementType', null, $actionArgs),
43  __('grid.action.edit'),
44  null,
45  true),
46  $label);
47 
48  return array($moreInformationAction);
49  }
50 
51  return parent::getCellActions($request, $row, $column, $position);
52  }
53 
61  function getTemplateVarsFromRowColumn($row, $column) {
62  $announcementType = $row->getData();
63  $columnId = $column->getId();
64  assert(is_a($announcementType, 'AnnouncementType') && !empty($columnId));
65 
66  switch ($columnId) {
67  case 'title':
68  return array('label' => $announcementType->getLocalizedName());
69  break;
70  default:
71  break;
72  }
73 
74  return parent::getTemplateVarsFromRowColumn($row, $column);
75  }
76 }
77 
78 ?>
getCellActions($request, $row, $column, $position=GRID_ACTION_POSITION_DEFAULT)
Base class for a grid column&#39;s cell provider.
A modal that retrieves its content from via AJAX.
Cell provider for title column of an announcement type grid.
Base class defining an action that can be performed by the user in the user interface.