Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
SeriesGridRow.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.grid.GridRow');
17 
18 class SeriesGridRow extends GridRow {
22  function SeriesGridRow() {
23  parent::GridRow();
24  }
25 
26  //
27  // Overridden template methods
28  //
29  /*
30  * Configure the grid row
31  * @param $request PKPRequest
32  */
33  function initialize($request) {
34  parent::initialize($request);
35 
36  $this->setupTemplate($request);
37 
38  // Is this a new row or an existing row?
39  $seriesId = $this->getId();
40  if (!empty($seriesId) && is_numeric($seriesId)) {
41  $router = $request->getRouter();
42 
43  import('lib.pkp.classes.linkAction.request.AjaxModal');
44  $this->addAction(
45  new LinkAction(
46  'editSeries',
47  new AjaxModal(
48  $router->url($request, null, null, 'editSeries', null, array('seriesId' => $seriesId)),
49  __('grid.action.edit'),
50  'modal_edit',
51  true),
52  __('grid.action.edit'),
53  'edit'
54  )
55  );
56 
57  import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
58  $this->addAction(
59  new LinkAction(
60  'deleteSeries',
62  __('common.confirmDelete'),
63  __('grid.action.delete'),
64  $router->url($request, null, null, 'deleteSeries', null, array('seriesId' => $seriesId)), 'modal_delete'
65  ),
66  __('grid.action.delete'),
67  'delete'
68  )
69  );
70  }
71  }
72 
76  function setupTemplate($request) {
77  // Load manager translations. FIXME are these needed?
79  LOCALE_COMPONENT_APP_MANAGER,
80  LOCALE_COMPONENT_PKP_COMMON,
81  LOCALE_COMPONENT_PKP_USER,
82  LOCALE_COMPONENT_APP_COMMON
83  );
84  }
85 }
86 
87 ?>
static requireComponents()
Handle series grid row requests.
A modal that retrieves its content from via AJAX.
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)
setupTemplate($request)
Base class defining an action that can be performed by the user in the user interface.