Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
AnnouncementTypeGridRow.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.grid.GridRow');
17 import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
18 
24  parent::GridRow();
25  }
26 
27 
28  //
29  // Overridden methods from GridRow
30  //
34  function initialize($request) {
35  parent::initialize($request);
36 
37  // Is this a new row or an existing row?
38  $element = $this->getData();
39  assert(is_a($element, 'AnnouncementType'));
40 
41  $rowId = $this->getId();
42 
43  if (!empty($rowId) && is_numeric($rowId)) {
44  // Only add row actions if this is an existing row
45  $router = $request->getRouter();
46  $actionArgs = array(
47  'announcementTypeId' => $rowId
48  );
49  $this->addAction(
50  new LinkAction(
51  'edit',
52  new AjaxModal(
53  $router->url($request, null, null, 'editAnnouncementType', null, $actionArgs),
54  __('grid.action.edit'),
55  'modal_edit',
56  true
57  ),
58  __('grid.action.edit'),
59  'edit')
60  );
61  $this->addAction(
62  new LinkAction(
63  'remove',
65  __('common.confirmDelete'),
66  __('common.remove'),
67  $router->url($request, null, null, 'deleteAnnouncementType', null, $actionArgs),
68  'modal_delete'
69  ),
70  __('grid.action.remove'),
71  'delete')
72  );
73  }
74  }
75 }
76 
77 ?>
Announcement type grid row definition.
A modal that retrieves its content from via AJAX.
& getData()
Class defining basic operations for handling HTML gridRows.
Definition: GridRow.inc.php:25
Class defining a simple confirmation modal with a remote action and ok/cancel buttons.
addAction($action, $position=GRID_ACTION_POSITION_DEFAULT)
Base class defining an action that can be performed by the user in the user interface.