Open Journal Systems
3.3.0
NavigationMenusGridRow.inc.php
1
<?php
2
16
import
(
'lib.pkp.classes.controllers.grid.GridRow'
);
17
import
(
'lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal'
);
18
19
class
NavigationMenusGridRow
extends
GridRow
{
20
//
21
// Overridden methods from GridRow
22
//
26
function
initialize
($request, $template =
null
) {
27
parent::initialize($request, $template);
28
29
$element = $this->
getData
();
30
assert(is_a($element,
'NavigationMenu'
));
31
32
$rowId = $this->
getId
();
33
34
// Is this a new row or an existing row?
35
if
(!empty($rowId) && is_numeric($rowId)) {
36
// Only add row actions if this is an existing row
37
$router = $request->getRouter();
38
$actionArgs = array(
39
'navigationMenuId'
=> $rowId
40
);
41
$this->
addAction
(
42
new
LinkAction
(
43
'edit'
,
44
new
AjaxModal
(
45
$router->url($request,
null
,
null
,
'editNavigationMenu'
,
null
, $actionArgs),
46
__(
'grid.action.edit'
),
47
'modal_edit'
,
48
true
49
),
50
__(
'grid.action.edit'
),
51
'edit'
)
52
);
53
54
$this->
addAction
(
55
new
LinkAction
(
56
'remove'
,
57
new
RemoteActionConfirmationModal
(
58
$request->getSession(),
59
__(
'common.confirmDelete'
),
60
__(
'common.remove'
),
61
$router->url($request,
null
,
null
,
'deleteNavigationMenu'
,
null
, $actionArgs),
62
'modal_delete'
63
),
64
__(
'grid.action.remove'
),
65
'delete'
)
66
);
67
68
}
69
}
70
}
71
72
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
NavigationMenusGridRow
NavigationMenu grid row definition.
Definition:
NavigationMenusGridRow.inc.php:19
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
NavigationMenusGridRow\initialize
initialize($request, $template=null)
Definition:
NavigationMenusGridRow.inc.php:26
GridRow\getData
& getData()
Definition:
GridRow.inc.php:131
lib
pkp
controllers
grid
navigationMenus
NavigationMenusGridRow.inc.php
Generated on Fri Aug 28 2020 14:52:51 for Open Journal Systems by
1.8.17