Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
VersionInfoGridHandler.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.grid.GridHandler');
17 import('lib.pkp.controllers.grid.admin.systemInfo.InfoGridCellProvider');
18 
19 
25  parent::GridHandler();
26  $this->addRoleAssignment(array(
27  ROLE_ID_SITE_ADMIN),
28  array('fetchGrid', 'fetchRow')
29  );
30  }
31 
32 
33  //
34  // Implement template methods from PKPHandler.
35  //
39  function authorize($request, &$args, $roleAssignments) {
40  import('lib.pkp.classes.security.authorization.PolicySet');
41  $rolePolicy = new PolicySet(COMBINING_PERMIT_OVERRIDES);
42 
43  import('lib.pkp.classes.security.authorization.RoleBasedHandlerOperationPolicy');
44  foreach($roleAssignments as $role => $operations) {
45  $rolePolicy->addPolicy(new RoleBasedHandlerOperationPolicy($request, $role, $operations));
46  }
47  $this->addPolicy($rolePolicy);
48 
49  return parent::authorize($request, $args, $roleAssignments);
50  }
51 
55  function initialize($request) {
56  parent::initialize($request);
57 
58  // Load user-related translations.
60  LOCALE_COMPONENT_PKP_USER,
61  LOCALE_COMPONENT_PKP_ADMIN,
62  LOCALE_COMPONENT_APP_ADMIN,
63  LOCALE_COMPONENT_APP_MANAGER,
64  LOCALE_COMPONENT_APP_COMMON
65  );
66 
67  // Basic grid configuration.
68  $this->setTitle('admin.versionHistory');
69 
70  //
71  // Grid columns.
72  //
73  $infoGridCellProvider = new InfoGridCellProvider();
74 
75  // Version number.
76  $this->addColumn(
77  new GridColumn(
78  'version',
79  'admin.version',
80  null,
81  'controllers/grid/gridCell.tpl',
82  $infoGridCellProvider,
83  array('width' => 20)
84  )
85  );
86 
87  // major version number.
88  $this->addColumn(
89  new GridColumn(
90  'versionMajor',
91  'admin.versionMajor',
92  null,
93  'controllers/grid/gridCell.tpl',
94  $infoGridCellProvider
95  )
96  );
97 
98  // minor version number.
99  $this->addColumn(
100  new GridColumn(
101  'versionMinor',
102  'admin.versionMinor',
103  null,
104  'controllers/grid/gridCell.tpl',
105  $infoGridCellProvider
106  )
107  );
108 
109  // revision version number.
110  $this->addColumn(
111  new GridColumn(
112  'versionRevision',
113  'admin.versionRevision',
114  null,
115  'controllers/grid/gridCell.tpl',
116  $infoGridCellProvider
117  )
118  );
119 
120  // build version number.
121  $this->addColumn(
122  new GridColumn(
123  'versionBuild',
124  'admin.versionBuild',
125  null,
126  'controllers/grid/gridCell.tpl',
127  $infoGridCellProvider
128  )
129  );
130 
131  // installation date
132  $this->addColumn(
133  new GridColumn(
134  'dateInstalled',
135  'admin.dateInstalled',
136  null,
137  'controllers/grid/gridCell.tpl',
138  $infoGridCellProvider
139  )
140  );
141  }
142 
143 
144  //
145  // Implement template methods from GridHandler
146  //
147 
151  function loadData($request, $filter) {
152  $versionDao = DAORegistry::getDAO('VersionDAO');
153  return $versionDao->getVersionHistory();
154  }
155 }
156 
157 ?>
An ordered list of policies. Policy sets can be added to decision managers like policies. The decision manager will evaluate the contained policies in the order they were added.
static & getDAO($name, $dbconn=null)
addPolicy($authorizationPolicy, $addToTop=false)
Handle version info grid requests.
static requireComponents()
addColumn($column)
Class defining basic operations for handling HTML grids.
Class to control access to handler operations via role based access control.
authorize($request, &$args, $roleAssignments)
addRoleAssignment($roleIds, $operations)
Subclass for the admin sysInfo grid&#39;s cell provider.
Represents a column within a grid. It is used to configure the way cells within a column are displaye...