Open Journal Systems  3.3.0
GridHandler.inc.php
1 <?php
2 
39 // Import the base Handler.
40 import('lib.pkp.classes.handler.PKPHandler');
41 
42 // Import action class.
43 import('lib.pkp.classes.linkAction.LinkAction');
44 
45 // Import grid classes.
46 import('lib.pkp.classes.controllers.grid.GridColumn');
47 import('lib.pkp.classes.controllers.grid.GridRow');
48 
49 // Import JSON class for use with all AJAX requests.
50 import('lib.pkp.classes.core.JSONMessage');
51 
52 // Grid specific action positions.
53 define('GRID_ACTION_POSITION_DEFAULT', 'default');
54 define('GRID_ACTION_POSITION_ABOVE', 'above');
55 define('GRID_ACTION_POSITION_LASTCOL', 'lastcol');
56 define('GRID_ACTION_POSITION_BELOW', 'below');
57 
58 class GridHandler extends PKPHandler {
59 
61  var $_title = '';
62 
64  var $_emptyRowText = 'grid.noItems';
65 
67  var $_footNote = '';
68 
71 
77  var $_actions = array(GRID_ACTION_POSITION_DEFAULT => array());
78 
80  var $_columns = array();
81 
83  var $_data;
84 
86  var $_itemIterator;
87 
89  var $_template;
90 
92  var $_urls;
93 
95  var $_features;
96 
98  var $_constants = [];
99 
100 
108  function __construct($dataProvider = null) {
109  $this->_dataProvider = $dataProvider;
110  parent::__construct();
111  }
112 
113 
114  //
115  // Getters and Setters
116  //
121  function getDataProvider() {
123  }
124 
142  function getRequestArgs() {
143  $dataProvider = $this->getDataProvider();
144  $requestArgs = array();
145  if (is_a($dataProvider, 'GridDataProvider')) {
146  $requestArgs = $dataProvider->getRequestArgs();
147  }
148 
149  $this->callFeaturesHook('getRequestArgs', array('grid' => &$this, 'requestArgs' => &$requestArgs));
150 
151  return $requestArgs;
152  }
153 
161  function getRequestArg($key) {
162  $requestArgs = $this->getRequestArgs();
163  assert(isset($requestArgs[$key]));
164  return $requestArgs[$key];
165  }
166 
171  function getTitle() {
172  return $this->_title;
173  }
174 
179  function setTitle($title) {
180  $this->_title = $title;
181  }
182 
187  function getEmptyRowText() {
188  return $this->_emptyRowText;
189  }
190 
195  function setEmptyRowText($emptyRowText) {
196  $this->_emptyRowText = $emptyRowText;
197  }
198 
203  function getFootNote() {
204  return $this->_footNote;
205  }
206 
211  function setFootNote($footNote) {
212  $this->_footNote = $footNote;
213  }
214 
220  function getActions($position = GRID_ACTION_POSITION_ABOVE) {
221  if(!isset($this->_actions[$position])) return array();
222  return $this->_actions[$position];
223  }
224 
230  function addAction($action, $position = GRID_ACTION_POSITION_ABOVE) {
231  if (!isset($this->_actions[$position])) $this->_actions[$position] = array();
232  $this->_actions[$position][$action->getId()] = $action;
233  }
234 
239  function &getColumns() {
240  return $this->_columns;
241  }
242 
248  function getColumn($columnId) {
249  assert(isset($this->_columns[$columnId]));
250  return $this->_columns[$columnId];
251  }
252 
258  function &getColumnsByFlag($flag) {
259  $columns = array();
260  foreach ($this->getColumns() as $column) {
261  if ($column->hasFlag($flag)) {
262  $columns[$column->getId()] = $column;
263  }
264  }
265 
266  return $columns;
267  }
268 
275  function getColumnsCount($flag = null) {
276  $count = 0;
277  foreach ($this->getColumns() as $column) {
278  if (!$column->hasFlag($flag)) {
279  $count++;
280  }
281  }
282 
283  return $count;
284  }
285 
291  function hasColumn($columnId) {
292  return isset($this->_columns[$columnId]);
293  }
294 
299  function addColumn($column) {
300  assert(is_a($column, 'GridColumn'));
301  $this->_columns[$column->getId()] = $column;
302  }
303 
309  function &getGridDataElements($request) {
310  $filter = $this->getFilterSelectionData($request);
311 
312  // Try to load data if it has not yet been loaded.
313  if (is_null($this->_data)) {
314  $data = $this->loadData($request, $filter);
315 
316  if (is_null($data)) {
317  // Initialize data to an empty array.
318  $data = array();
319  }
320 
321  $this->setGridDataElements($data);
322  }
323 
324  $this->callFeaturesHook('getGridDataElements', array('request' => &$request, 'grid' => &$this, 'gridData' => &$data, 'filter' => &$filter));
325 
326  return $this->_data;
327  }
328 
333  function hasGridDataElements($request) {
334  $data =& $this->getGridDataElements($request);
335  assert (is_array($data));
336  return (boolean) count($data);
337  }
338 
343  function setGridDataElements($data) {
344  $this->callFeaturesHook('setGridDataElements', array('grid' => &$this, 'data' => &$data));
345 
346  // FIXME: We go to arrays for all types of iterators because
347  // iterators cannot be re-used, see #6498.
348  if (is_array($data)) {
349  $this->_data = $data;
350  } elseif(is_a($data, 'DAOResultFactory')) {
351  $this->_data = $data->toAssociativeArray();
352  } elseif(is_a($data, 'ItemIterator')) {
353  $this->_data = $data->toArray();
354  } else {
355  assert(false);
356  }
357  }
358 
363  function getTemplate() {
364  if (is_null($this->_template)) {
365  $this->setTemplate('controllers/grid/grid.tpl');
366  }
367 
368  return $this->_template;
369  }
370 
375  function setTemplate($template) {
376  $this->_template = $template;
377  }
378 
384  function getUrls() {
385  return $this->_urls;
386  }
387 
394  function setUrls($request, $extraUrls = array()) {
395  $router = $request->getRouter();
396  $urls = array(
397  'fetchGridUrl' => $router->url($request, null, null, 'fetchGrid', null, $this->getRequestArgs()),
398  'fetchRowsUrl' => $router->url($request, null, null, 'fetchRows', null, $this->getRequestArgs()),
399  'fetchRowUrl' => $router->url($request, null, null, 'fetchRow', null, $this->getRequestArgs())
400  );
401  $this->_urls = array_merge($urls, $extraUrls);
402  }
403 
411  function getIsSubcomponent() {
412  return false;
413  }
414 
419  function getFeatures() {
421  }
422 
429  function getItemIterator() {
431  }
432 
437  function getPublishChangeEvents() {
438  return array();
439  }
440 
441  // FIXME: Since we've moved to PHP5, maybe those methods
442  // should be moved into interfaces like OrderableItems
443  // and SelectableItems. Then each grid can implement
444  // them in a clear way. It will also simplify this base
445  // class hiding optional interfaces.
446 
447  //
448  // Orderable items.
449  //
455  function getDataElementSequence($gridDataElement) {
456  return 0; // Ordering is ambiguous or irrelevant.
457  }
458 
466  function setDataElementSequence($request, $rowId, $gridDataElement, $newSequence) {
467  assert(false);
468  }
469 
470  //
471  // Selectable items.
472  //
479  function isDataElementSelected($gridDataElement) {
480  assert(false);
481  }
482 
488  function getSelectName() {
489  assert(false);
490  }
491 
503  function getRequestedRow($request, $args) {
504  $isModified = isset($args['modify']);
505  if (isset($args['rowId']) && !$isModified) {
506  // A row ID was specified. Fetch it
507  $elementId = $args['rowId'];
508 
509  // Retrieve row data for the requested row id
510  $dataElement = $this->getRowDataElement($request, $elementId);
511  if (is_null($dataElement)) {
512  // If the row doesn't exist then
513  // return null. It may be that the
514  // row has been deleted in the meantime
515  // and the client does not yet know about this.
516  $nullVar = null;
517  return $nullVar;
518  }
519  } elseif ( $isModified ) {
520  $elementId = null;
521  // The row is modified. The client may be asking
522  // for a formatted new entry, to be saved later, or
523  // for a representation of a modified row.
524  $dataElement = $this->getRowDataElement($request, $elementId);
525  if ( isset($args['rowId']) ) {
526  // the rowId holds the elementId being modified
527  $elementId = $args['rowId'];
528  }
529  }
530 
531  // Instantiate a new row
532  return $this->_getInitializedRowInstance($request, $elementId, $dataElement, $isModified);
533  }
534 
541  function renderRow($request, $row) {
542  $this->setFirstDataColumn();
543  return $this->renderRowInternally($request, $row);
544  }
545 
553  function getGridRangeInfo($request, $rangeName, $contextData = null) {
554  $rangeInfo = parent::getRangeInfo($request, $rangeName, $contextData);
555 
556  $this->callFeaturesHook('getGridRangeInfo', array('request' => &$request, 'grid' => &$this, 'rangeInfo' => $rangeInfo));
557 
558  return $rangeInfo;
559  }
560 
561 
562  //
563  // Overridden methods from PKPHandler
564  //
568  function authorize($request, &$args, $roleAssignments) {
569  $dataProvider = $this->getDataProvider();
570  $hasDataProvider = is_a($dataProvider, 'GridDataProvider');
571  if ($hasDataProvider) {
572  $this->addPolicy($dataProvider->getAuthorizationPolicy($request, $args, $roleAssignments));
573  }
574 
575  $success = parent::authorize($request, $args, $roleAssignments);
576 
577  if ($hasDataProvider && $success === true) {
578  $dataProvider->setAuthorizedContext($this->getAuthorizedContext());
579  }
580 
581  return $success;
582  }
583 
589  function initialize($request, $args = null) {
590  parent::initialize($request);
591 
592  // Load grid-specific translations
593  AppLocale::requireComponents(LOCALE_COMPONENT_PKP_GRID, LOCALE_COMPONENT_APP_COMMON);
594 
595  if ($this->getFilterForm() && $this->isFilterFormCollapsible()) {
596  import('lib.pkp.classes.linkAction.request.NullAction');
597  $this->addAction(
598  new LinkAction(
599  'search',
600  new NullAction(),
601  __('common.search'),
602  'search_extras_expand'
603  )
604  );
605  }
606 
607  // Give a chance to grid add features before calling hooks.
608  // Because we must control when features are added to a grid,
609  // this is the only place that should use the _addFeature() method.
610  $this->_addFeatures($this->initFeatures($request, $args));
611  $this->callFeaturesHook('gridInitialize', array('grid' => &$this));
612  }
613 
614 
615  //
616  // Public handler methods
617  //
625  function fetchGrid($args, $request) {
626  $this->setUrls($request);
627 
628  // Prepare the template to render the grid.
629  $templateMgr = TemplateManager::getManager($request);
630  $templateMgr->assign('grid', $this);
631  $templateMgr->assign('request', $request);
632 
633  // Add rendered filter
634  $renderedFilter = $this->renderFilter($request);
635  $templateMgr->assign('gridFilterForm', $renderedFilter);
636 
637  // Add columns.
638  $this->setFirstDataColumn();
639  $columns = $this->getColumns();
640  $templateMgr->assign('columns', $columns);
641 
642  $this->_fixColumnWidths();
643 
644  // Do specific actions to fetch this grid.
645  $this->doSpecificFetchGridActions($args, $request, $templateMgr);
646 
647  // Assign additional params for the fetchRow and fetchGrid URLs to use.
648  $templateMgr->assign('gridRequestArgs', $this->getRequestArgs());
649 
650  $this->callFeaturesHook('fetchGrid', array('grid' => &$this, 'request' => &$request));
651 
652  // Assign features.
653  $templateMgr->assign('features', $this->getFeatures());
654 
655  // Assign constants.
656  $templateMgr->assign('gridConstants', $this->_constants);
657 
658  // Let the view render the grid.
659  return new JSONMessage(true, $templateMgr->fetch($this->getTemplate()));
660  }
661 
668  function fetchRows($args, $request) {
669  // Render the rows.
670  $this->setFirstDataColumn();
671  $elements = $this->getGridDataElements($request);
672  $renderedRows = $this->renderRowsInternally($request, $elements);
673 
674  $json = new JSONMessage();
675  $json->setStatus(false);
676 
677  if ($renderedRows) {
678  $renderedRowsString = null;
679  foreach ($renderedRows as $rowString) {
680  $renderedRowsString .= $rowString;
681  }
682  $json->setStatus(true);
683  $json->setContent($renderedRowsString);
684  }
685 
686  $this->callFeaturesHook('fetchRows', array('request' => &$request, 'grid' => &$this, 'jsonMessage' => &$json));
687 
688  return $json;
689  }
690 
698  function fetchRow($args, $request) {
699  // Instantiate the requested row (includes a
700  // validity check on the row id).
701  $row = $this->getRequestedRow($request, $args);
702 
703  $json = new JSONMessage(true);
704  if (is_null($row)) {
705  // Inform the client that the row does no longer exist.
706  $json->setAdditionalAttributes(array('elementNotFound' => $args['rowId']));
707  } else {
708  // Render the requested row
709  $renderedRow = $this->renderRow($request, $row);
710  $json->setContent($renderedRow);
711 
712  // Add the sequence map so grid can place the row at the correct position.
713  $sequenceMap = $this->getRowsSequence($request);
714  $json->setAdditionalAttributes(array('sequenceMap' => $sequenceMap));
715  }
716 
717  $this->callFeaturesHook('fetchRow', array('request' => &$request, 'grid' => &$this, 'row' => &$row, 'jsonMessage' => &$json));
718 
719  // Render and return the JSON message.
720  return $json;
721  }
722 
729  function fetchCell(&$args, $request) {
730  // Check the requested column
731  if(!isset($args['columnId'])) fatalError('Missing column id!');
732  if(!$this->hasColumn($args['columnId'])) fatalError('Invalid column id!');
733  $this->setFirstDataColumn();
734  $column = $this->getColumn($args['columnId']);
735 
736  // Instantiate the requested row
737  $row = $this->getRequestedRow($request, $args);
738  if (is_null($row)) fatalError('Row not found!');
739 
740  // Render the cell
741  return new JSONMessage(true, $this->_renderCellInternally($request, $row, $column));
742  }
743 
753  function saveSequence($args, $request) {
754  $this->callFeaturesHook('saveSequence', array('request' => &$request, 'grid' => &$this));
755 
756  return DAO::getDataChangedEvent();
757  }
758 
763  public function getJSHandler() {
764  return '$.pkp.controllers.grid.GridHandler';
765  }
766 
767  //
768  // Protected methods to be overridden/used by subclasses
769  //
779  protected function getRowsSequence($request) {
780  return array_keys($this->getGridDataElements($request));
781  }
782 
783 
790  protected function getRowInstance() {
791  //provide a sensible default row definition
792  return new GridRow();
793  }
794 
804  protected function &getDataElementFromRequest($request, &$elementId) {
805  fatalError('Grid does not support data element creation!');
806  }
807 
816  protected function getRowDataElement($request, &$rowId) {
817  $elements =& $this->getGridDataElements($request);
818 
819  assert(is_array($elements));
820  if (!isset($elements[$rowId])) return null;
821 
822  return $elements[$rowId];
823  }
824 
833  protected function loadData($request, $filter) {
834  $gridData = null;
835  $dataProvider = $this->getDataProvider();
836  if (is_a($dataProvider, 'GridDataProvider')) {
837  // Populate the grid with data from the
838  // data provider.
839  $gridData = $dataProvider->loadData($filter);
840  }
841 
842  $this->callFeaturesHook('loadData', array('request' => &$request, 'grid' => &$this, 'gridData' => &$gridData));
843 
844  return $gridData;
845  }
846 
851  protected function getFilterForm() {
852  return null;
853  }
854 
859  protected function isFilterFormCollapsible() {
860  return true;
861  }
862 
870  protected function getFilterSelectionData($request) {
871  return null;
872  }
873 
880  protected function renderFilter($request, $filterData = array()) {
881  $form = $this->getFilterForm();
882  switch(true) {
883  case $form === null: // No filter form.
884  return '';
885  case is_string($form): // HTML mark-up
886  $templateMgr = TemplateManager::getManager($request);
887 
888  // Assign data to the filter.
889  $templateMgr->assign('filterData', $filterData);
890 
891  // Assign current selected filter data.
892  $filterSelectionData = $this->getFilterSelectionData($request);
893  $templateMgr->assign('filterSelectionData', $filterSelectionData);
894 
895  return $templateMgr->fetch($form);
896  break;
897  }
898  assert(false);
899  }
900 
906  protected function noAutocompleteResults() {
907  $returner = array();
908  $returner[] = array('label' => __('common.noMatches'), 'value' => '');
909 
910  return new JSONMessage(true, $returner);
911  }
912 
921  protected function doSpecificFetchGridActions($args, $request, $templateMgr) {
922  // Render the body elements.
923  $gridBodyParts = $this->renderGridBodyPartsInternally($request);
924  $templateMgr->assign('gridBodyParts', $gridBodyParts);
925  }
926 
934  protected function setFirstDataColumn() {
935  $columns =& $this->getColumns();
936  $firstColumn = reset($columns);
937  $firstColumn->addFlag('firstColumn', true);
938  }
939 
949  protected function initFeatures($request, $args) {
950  $returner = array();
951  HookRegistry::call(strtolower_codesafe(get_class($this) . '::initFeatures'), array($this, $request, $args, &$returner));
952  return $returner;
953  }
954 
960  protected function callFeaturesHook($hookName, $args) {
961  $features = $this->getFeatures();
962  if (is_array($features)) {
963  foreach ($features as &$feature) {
964  if (is_callable(array($feature, $hookName))) {
965  $feature->$hookName($args);
966  } else {
967  assert(false);
968  }
969  }
970  }
971  }
972 
979  protected function renderRowsInternally($request, &$elements) {
980  // Iterate through the rows and render them according
981  // to the row definition.
982  $renderedRows = array();
983  foreach ($elements as $elementId => $element) {
984  // Instantiate a new row.
985  $row = $this->_getInitializedRowInstance($request, $elementId, $element);
986 
987  // Render the row
988  $renderedRows[] = $this->renderRowInternally($request, $row);
989  }
990 
991  return $renderedRows;
992  }
993 
1004  protected function renderRowInternally($request, $row) {
1005  // Iterate through the columns and render the
1006  // cells for the given row.
1007  $renderedCells = array();
1008  $columns = $this->getColumns();
1009  foreach ($columns as $column) {
1010  assert(is_a($column, 'GridColumn'));
1011  $renderedCells[] = $this->_renderCellInternally($request, $row, $column);
1012  }
1013 
1014  // Pass control to the view to render the row
1015  $templateMgr = TemplateManager::getManager($request);
1016  $templateMgr->assign(array(
1017  'grid' => $this,
1018  'columns' => $columns,
1019  'cells' => $renderedCells,
1020  'row' => $row,
1021  ));
1022  return $templateMgr->fetch($row->getTemplate());
1023  }
1024 
1030  protected function renderGridBodyPartsInternally($request) {
1031  // Render the rows.
1032  $elements = $this->getGridDataElements($request);
1033  $renderedRows = $this->renderRowsInternally($request, $elements);
1034 
1035  // Render the body part.
1036  $templateMgr = TemplateManager::getManager($request);
1037  $gridBodyParts = array();
1038  if ( count($renderedRows) > 0 ) {
1039  $templateMgr->assign('grid', $this);
1040  $templateMgr->assign('rows', $renderedRows);
1041  $gridBodyParts[] = $templateMgr->fetch('controllers/grid/gridBodyPart.tpl');
1042  }
1043  return $gridBodyParts;
1044  }
1045 
1046 
1047  //
1048  // Private helper methods
1049  //
1058  private function _getInitializedRowInstance($request, $elementId, &$element, $isModified = false) {
1059  // Instantiate a new row
1060  $row = $this->getRowInstance();
1061  $row->setGridId($this->getId());
1062  $row->setId($elementId);
1063  $row->setData($element);
1064  $row->setRequestArgs($this->getRequestArgs());
1065  $row->setIsModified($isModified);
1067  // Initialize the row before we render it
1068  $row->initialize($request);
1069  $this->callFeaturesHook('getInitializedRowInstance', array('grid' => &$this, 'row' => &$row));
1070  return $row;
1071  }
1072 
1084  private function _renderCellInternally($request, $row, $column) {
1085  // If there is no object, then we want to return an empty row.
1086  // override the assigned GridCellProvider and provide the default.
1087  $element =& $row->getData();
1088  if ( is_null($element) && $row->getIsModified() ) {
1089  import('lib.pkp.classes.controllers.grid.GridCellProvider');
1090  $cellProvider = new GridCellProvider();
1091  return $cellProvider->render($request, $row, $column);
1092  }
1093 
1094  // Otherwise, get the cell content.
1095  // If row defines a cell provider, use it.
1096  $cellProvider = $row->getCellProvider();
1097  if (!is_a($cellProvider, 'GridCellProvider')) {
1098  // Remove reference to the row variable.
1099  unset($cellProvider);
1100  // Get cell provider from column.
1101  $cellProvider = $column->getCellProvider();
1102  }
1103 
1104  return $cellProvider->render($request, $row, $column);
1105  }
1106 
1111  private function _fixColumnWidths() {
1112  $columns =& $this->getColumns();
1113  $width = 0;
1114  $noSpecifiedWidthCount = 0;
1115  // Find the total width and how many columns do not specify their width.
1116  foreach ($columns as $column) {
1117  if ($column->hasFlag('width')) {
1118  $width += $column->getFlag('width');
1119  } else {
1120  $noSpecifiedWidthCount++;
1121  }
1122  }
1123 
1124  // Four cases: we have to add or remove some width, and either we have wiggle room or not.
1125  // First case, width less than 100 and some unspecified columns to add it to.
1126  if ($width < 100) {
1127  if ($noSpecifiedWidthCount > 0) {
1128  // We need to add width to columns that did not specify it.
1129  foreach ($columns as $column) {
1130  if (!$column->hasFlag('width')) {
1131  $modifyColumn = $this->getColumn($column->getId());
1132  $modifyColumn->addFlag('width', round((100 - $width)/$noSpecifiedWidthCount));
1133  unset($modifyColumn);
1134  }
1135  }
1136  }
1137  }
1138 
1139  // Second case, width higher than 100 and all columns width specified.
1140  if ($width > 100) {
1141  if ($noSpecifiedWidthCount == 0) {
1142  // We need to remove width from all columns equally.
1143  $columnsToModify = $columns;
1144  foreach ($columns as $key => $column) {
1145  // We don't want to change the indent column widht, so avoid it.
1146  if ($column->getId() == 'indent') {
1147  unset($columnsToModify[$key]);
1148  }
1149  }
1150 
1151  // Calculate the value to remove from all columns.
1152  $difference = $width - 100;
1153  $columnsCount = count($columnsToModify);
1154  $removeValue = round($difference/$columnsCount);
1155  foreach ($columnsToModify as $column) {
1156  $modifyColumn = $this->getColumn($column->getId());
1157  if (end($columnsToModify) === $column) {
1158  // Handle rounding problems.
1159  $totalWidth = $width - ($removeValue * $columnsCount);
1160  if ($totalWidth < 100) {
1161  $removeValue -= 100 - $totalWidth;
1162  }
1163  }
1164 
1165  $modifyColumn->addFlag('width', $modifyColumn->getFlag('width') - $removeValue);
1166  }
1167  }
1168  }
1169  }
1170 
1175  private function _addFeatures($features) {
1176  assert(is_array($features));
1177  foreach ($features as &$feature) {
1178  assert(is_a($feature, 'GridFeature'));
1179  $this->_features[$feature->getId()] = $feature;
1180  }
1181  }
1182 }
1183 
GridHandler\getRequestArgs
getRequestArgs()
Definition: GridHandler.inc.php:178
GridHandler\renderRowsInternally
renderRowsInternally($request, &$elements)
Definition: GridHandler.inc.php:1015
GridHandler\setEmptyRowText
setEmptyRowText($emptyRowText)
Definition: GridHandler.inc.php:231
PKPHandler\__construct
__construct()
Definition: PKPHandler.inc.php:85
AppLocale\requireComponents
static requireComponents()
Definition: env1/MockAppLocale.inc.php:56
GridHandler\initFeatures
initFeatures($request, $args)
Definition: GridHandler.inc.php:985
GridHandler\getDataProvider
getDataProvider()
Definition: GridHandler.inc.php:157
GridHandler\getRowDataElement
getRowDataElement($request, &$rowId)
Definition: GridHandler.inc.php:852
GridHandler\setFootNote
setFootNote($footNote)
Definition: GridHandler.inc.php:247
GridHandler\saveSequence
saveSequence($args, $request)
Definition: GridHandler.inc.php:789
GridHandler\$_dataProvider
$_dataProvider
Definition: GridHandler.inc.php:82
GridHandler\loadData
loadData($request, $filter)
Definition: GridHandler.inc.php:869
GridHandler\getRowInstance
getRowInstance()
Definition: GridHandler.inc.php:826
GridHandler\isDataElementSelected
isDataElementSelected($gridDataElement)
Definition: GridHandler.inc.php:515
GridHandler\getEmptyRowText
getEmptyRowText()
Definition: GridHandler.inc.php:223
GridHandler\renderRowInternally
renderRowInternally($request, $row)
Definition: GridHandler.inc.php:1040
GridHandler\getActions
getActions($position=GRID_ACTION_POSITION_ABOVE)
Definition: GridHandler.inc.php:256
GridHandler\hasColumn
hasColumn($columnId)
Definition: GridHandler.inc.php:327
GridHandler\fetchGrid
fetchGrid($args, $request)
Definition: GridHandler.inc.php:661
GridHandler\setTemplate
setTemplate($template)
Definition: GridHandler.inc.php:411
GridHandler\$_features
$_features
Definition: GridHandler.inc.php:128
GridHandler\getFeatures
getFeatures()
Definition: GridHandler.inc.php:455
PKPHandler\getId
getId()
Definition: PKPHandler.inc.php:107
GridHandler\setDataElementSequence
setDataElementSequence($request, $rowId, $gridDataElement, $newSequence)
Definition: GridHandler.inc.php:502
PKPHandler
Definition: PKPHandler.inc.php:17
GridHandler\$_data
$_data
Definition: GridHandler.inc.php:104
GridHandler\setFirstDataColumn
setFirstDataColumn()
Definition: GridHandler.inc.php:970
GridHandler\getRequestArg
getRequestArg($key)
Definition: GridHandler.inc.php:197
GridHandler\isFilterFormCollapsible
isFilterFormCollapsible()
Definition: GridHandler.inc.php:895
GridHandler\getDataElementSequence
getDataElementSequence($gridDataElement)
Definition: GridHandler.inc.php:491
GridHandler\$_itemIterator
$_itemIterator
Definition: GridHandler.inc.php:110
GridHandler\getGridDataElements
& getGridDataElements($request)
Definition: GridHandler.inc.php:345
GridHandler\addAction
addAction($action, $position=GRID_ACTION_POSITION_ABOVE)
Definition: GridHandler.inc.php:266
GridHandler\addColumn
addColumn($column)
Definition: GridHandler.inc.php:335
GridHandler\getSelectName
getSelectName()
Definition: GridHandler.inc.php:524
GridHandler\$_actions
$_actions
Definition: GridHandler.inc.php:92
GridHandler\getIsSubcomponent
getIsSubcomponent()
Definition: GridHandler.inc.php:447
DAO\getDataChangedEvent
static getDataChangedEvent($elementId=null, $parentElementId=null, $content='')
Definition: DAO.inc.php:647
GridHandler\getColumnsCount
getColumnsCount($flag=null)
Definition: GridHandler.inc.php:311
GridHandler\getTitle
getTitle()
Definition: GridHandler.inc.php:207
GridHandler\getRowsSequence
getRowsSequence($request)
Definition: GridHandler.inc.php:815
GridHandler\noAutocompleteResults
noAutocompleteResults()
Definition: GridHandler.inc.php:942
GridHandler\setGridDataElements
setGridDataElements($data)
Definition: GridHandler.inc.php:379
TemplateManager
Class for accessing the underlying template engine. Currently integrated with Smarty (from http://sma...
Definition: TemplateManager.inc.php:22
PKPHandler\getAuthorizedContext
& getAuthorizedContext()
Definition: PKPHandler.inc.php:189
NullAction
This action does nothing.
Definition: NullAction.inc.php:18
JSONMessage
Class to represent a JSON (Javascript Object Notation) message.
Definition: JSONMessage.inc.php:18
GridHandler\$_template
$_template
Definition: GridHandler.inc.php:116
GridRow
GridRow implements a row of a Grid. See GridHandler for general information about grids.
Definition: GridRow.inc.php:29
GridHandler\getJSHandler
getJSHandler()
Definition: GridHandler.inc.php:799
GridHandler\$_constants
$_constants
Definition: GridHandler.inc.php:134
GridHandler\$_urls
$_urls
Definition: GridHandler.inc.php:122
LinkAction
Base class defining an action that can be performed by the user in the user interface.
Definition: LinkAction.inc.php:22
GridHandler\getColumn
getColumn($columnId)
Definition: GridHandler.inc.php:284
GridHandler\getRequestedRow
getRequestedRow($request, $args)
Definition: GridHandler.inc.php:539
Seboettg\Collection\count
count()
Definition: ArrayListTrait.php:253
GridHandler\initialize
initialize($request, $args=null)
Definition: GridHandler.inc.php:625
GridHandler\getPublishChangeEvents
getPublishChangeEvents()
Definition: GridHandler.inc.php:473
GridHandler\getDataElementFromRequest
& getDataElementFromRequest($request, &$elementId)
Definition: GridHandler.inc.php:840
GridHandler\fetchRow
fetchRow($args, $request)
Definition: GridHandler.inc.php:734
GridHandler\getColumns
& getColumns()
Definition: GridHandler.inc.php:275
GridCellProvider
Base class for a grid column's cell provider.
Definition: GridCellProvider.inc.php:20
GridHandler\getItemIterator
getItemIterator()
Definition: GridHandler.inc.php:465
GridHandler\setTitle
setTitle($title)
Definition: GridHandler.inc.php:215
GridHandler\__construct
__construct($dataProvider=null)
Definition: GridHandler.inc.php:144
PKPTemplateManager\getManager
static & getManager($request=null)
Definition: PKPTemplateManager.inc.php:1239
GridHandler\getFilterSelectionData
getFilterSelectionData($request)
Definition: GridHandler.inc.php:906
GridHandler\renderFilter
renderFilter($request, $filterData=array())
Definition: GridHandler.inc.php:916
GridHandler\getGridRangeInfo
getGridRangeInfo($request, $rangeName, $contextData=null)
Definition: GridHandler.inc.php:589
GridHandler\getFootNote
getFootNote()
Definition: GridHandler.inc.php:239
GridHandler\getUrls
getUrls()
Definition: GridHandler.inc.php:420
GridHandler\$_columns
$_columns
Definition: GridHandler.inc.php:98
strtolower_codesafe
strtolower_codesafe($str)
Definition: functions.inc.php:280
GridHandler\setUrls
setUrls($request, $extraUrls=array())
Definition: GridHandler.inc.php:430
GridHandler\hasGridDataElements
hasGridDataElements($request)
Definition: GridHandler.inc.php:369
GridHandler\doSpecificFetchGridActions
doSpecificFetchGridActions($args, $request, $templateMgr)
Definition: GridHandler.inc.php:957
GridHandler\$_title
$_title
Definition: GridHandler.inc.php:64
GridHandler
This class defines basic operations for handling HTML grids. Grids are used to implement a standardiz...
Definition: GridHandler.inc.php:58
GridHandler\getFilterForm
getFilterForm()
Definition: GridHandler.inc.php:887
GridHandler\renderRow
renderRow($request, $row)
Definition: GridHandler.inc.php:577
GridHandler\$_emptyRowText
$_emptyRowText
Definition: GridHandler.inc.php:70
GridHandler\$_footNote
$_footNote
Definition: GridHandler.inc.php:76
GridHandler\fetchRows
fetchRows($args, $request)
Definition: GridHandler.inc.php:704
PKPHandler\addPolicy
addPolicy($authorizationPolicy, $addToTop=false)
Definition: PKPHandler.inc.php:157
fatalError
if(!function_exists('import')) fatalError($reason)
Definition: functions.inc.php:32
GridHandler\callFeaturesHook
callFeaturesHook($hookName, $args)
Definition: GridHandler.inc.php:996
GridHandler\fetchCell
fetchCell(&$args, $request)
Definition: GridHandler.inc.php:765
HookRegistry\call
static call($hookName, $args=null)
Definition: HookRegistry.inc.php:86
GridHandler\getTemplate
getTemplate()
Definition: GridHandler.inc.php:399
GridHandler\renderGridBodyPartsInternally
renderGridBodyPartsInternally($request)
Definition: GridHandler.inc.php:1066
GridHandler\getColumnsByFlag
& getColumnsByFlag($flag)
Definition: GridHandler.inc.php:294
GridHandler\authorize
authorize($request, &$args, $roleAssignments)
Definition: GridHandler.inc.php:604