Open Journal Systems  3.3.0
GenreGridRow.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.grid.GridRow');
17 
18 class GenreGridRow extends GridRow {
19 
20  //
21  // Overridden template methods
22  //
26  function initialize($request, $template = null) {
27  parent::initialize($request, $template);
28 
29  // Is this a new row or an existing row?
30  $rowId = $this->getId();
31  if (!empty($rowId) && is_numeric($rowId)) {
32  $router = $request->getRouter();
33  $actionArgs = array(
34  'gridId' => $this->getGridId(),
35  'genreId' => $rowId
36  );
37 
38  import('lib.pkp.classes.linkAction.request.AjaxModal');
39  $this->addAction(
40  new LinkAction(
41  'editGenre',
42  new AjaxModal(
43  $router->url($request, null, null, 'editGenre', null, $actionArgs),
44  __('grid.action.edit'),
45  'modal_edit',
46  true),
47  __('grid.action.edit'),
48  'edit')
49  );
50 
51  import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
52  $this->addAction(
53  new LinkAction(
54  'deleteGenre',
56  $request->getSession(),
57  __('common.confirmDelete'),
58  __('grid.action.delete'),
59  $router->url($request, null, null, 'deleteGenre', null, $actionArgs), 'modal_delete'),
60  __('grid.action.delete'),
61  'delete')
62  );
63  }
64  }
65 }
66 
67 
RemoteActionConfirmationModal
Class defining a simple confirmation modal with a remote action and ok/cancel buttons.
Definition: RemoteActionConfirmationModal.inc.php:18
GridRow\addAction
addAction($action, $position=GRID_ACTION_POSITION_DEFAULT)
Definition: GridRow.inc.php:179
GridBodyElement\getId
getId()
Definition: GridBodyElement.inc.php:57
GridRow\getGridId
getGridId()
Definition: GridRow.inc.php:97
GenreGridRow\initialize
initialize($request, $template=null)
Definition: GenreGridRow.inc.php:26
GridRow
GridRow implements a row of a Grid. See GridHandler for general information about grids.
Definition: GridRow.inc.php:29
AjaxModal
A modal that retrieves its content from via AJAX.
Definition: AjaxModal.inc.php:18
LinkAction
Base class defining an action that can be performed by the user in the user interface.
Definition: LinkAction.inc.php:22
GenreGridRow
Handle Genre grid row requests.
Definition: GenreGridRow.inc.php:18