Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
SystemInfoGridHandler.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.grid.CategoryGridHandler');
17 import('lib.pkp.controllers.grid.admin.systemInfo.SystemInfoGridCategoryRow');
18 
20 
21  var $_configData;
22 
26  function SystemInfoGridHandler() {
27  parent::CategoryGridHandler();
28  $this->addRoleAssignment(array(
29  ROLE_ID_SITE_ADMIN),
30  array('fetchGrid', 'fetchCategory', 'fetchRow')
31  );
32  }
33 
34 
35  //
36  // Implement template methods from PKPHandler.
37  //
41  function authorize($request, &$args, $roleAssignments) {
42  import('lib.pkp.classes.security.authorization.PolicySet');
43  $rolePolicy = new PolicySet(COMBINING_PERMIT_OVERRIDES);
44 
45  import('lib.pkp.classes.security.authorization.RoleBasedHandlerOperationPolicy');
46  foreach($roleAssignments as $role => $operations) {
47  $rolePolicy->addPolicy(new RoleBasedHandlerOperationPolicy($request, $role, $operations));
48  }
49  $this->addPolicy($rolePolicy);
50 
51  return parent::authorize($request, $args, $roleAssignments);
52  }
53 
57  function initialize($request) {
58  parent::initialize($request);
59 
60  // Load user-related translations.
62  LOCALE_COMPONENT_PKP_USER,
63  LOCALE_COMPONENT_APP_ADMIN,
64  LOCALE_COMPONENT_PKP_ADMIN,
65  LOCALE_COMPONENT_APP_MANAGER,
66  LOCALE_COMPONENT_APP_COMMON
67  );
68 
69  // Basic grid configuration.
70  $this->setTitle('admin.systemConfiguration');
71  $this->setInstructions('admin.systemConfigurationDescription');
72 
73  //
74  // Grid columns.
75  //
76  import('lib.pkp.controllers.grid.admin.systemInfo.InfoGridCellProvider');
77  $infoGridCellProvider = new InfoGridCellProvider();
78 
79  // setting name.
80  $this->addColumn(
81  new GridColumn(
82  'name',
83  'admin.systemInfo.settingName',
84  null,
85  'controllers/grid/gridCell.tpl',
86  $infoGridCellProvider,
87  array('width' => 20)
88  )
89  );
90 
91  // setting value.
92  $this->addColumn(
93  new GridColumn(
94  'value',
95  'admin.systemInfo.settingValue',
96  null,
97  'controllers/grid/gridCell.tpl',
98  $infoGridCellProvider
99  )
100  );
101 
102  $this->_configData = Config::getData();
103  }
104 
105 
106  //
107  // Implement template methods from CategoryGridHandler
108  //
113  return new SystemInfoGridCategoryRow();
114  }
115 
119  function getCategoryData($configSection) {
120  return $this->_configData[$configSection];
121  }
122 
126  function loadData($request, $filter) {
127  return array_keys($this->_configData);
128  }
129 }
130 ?>
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.
addPolicy($authorizationPolicy, $addToTop=false)
authorize($request, &$args, $roleAssignments)
static requireComponents()
addColumn($column)
Class to control access to handler operations via role based access control.
addRoleAssignment($roleIds, $operations)
Subclass for the admin sysInfo grid&#39;s cell provider.
Class defining basic operations for handling HTML grids with categories.
static & getData()
Definition: Config.inc.php:44
System Info grid category row definition.
setInstructions($instructions)
Handle system info grid requests.
Represents a column within a grid. It is used to configure the way cells within a column are displaye...