Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
ChapterGridCategoryRowCellProvider.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.grid.GridCellProvider');
17 
19 
20  var $_readOnly;
21 
26  parent::GridCellProvider();
27  }
28 
32  function getCellActions($request, $row, $column) {
33  if ($column->getId() == 'name' && !$row->isReadOnly()) {
34  $chapter = $row->getData();
35  $monograph = $row->getMonograph();
36 
37  $router = $request->getRouter();
38  $actionArgs = array(
39  'submissionId' => $monograph->getId(),
40  'chapterId' => $chapter->getId()
41  );
42 
43  return array(new LinkAction(
44  'editChapter',
45  new AjaxModal(
46  $router->url($request, null, null, 'editChapter', null, $actionArgs),
47  __('submission.chapter.editChapter'),
48  'modal_edit'
49  ),
50  $chapter->getLocalizedTitle()
51  )
52  );
53  }
54  }
55 
59  function getTemplateVarsFromRowColumn($row, $column) {
60  // If row is not read only, the cell will contains a link
61  // action. See getCellActions() above.
62  if ($column->getId() == 'name' && $row->isReadOnly()) {
63  $chapter = $row->getData();
64  $label = $chapter->getLocalizedTitle();
65  } else {
66  $label = '';
67  }
68 
69  return array('label' => $label);
70  }
71 }
72 
73 ?>
Base class for a grid column&#39;s cell provider.
Chapter grid category rows cell provider.
A modal that retrieves its content from via AJAX.
Base class defining an action that can be performed by the user in the user interface.