GridCellProvider::getCellActions PHP Method

getCellActions() public method

NB: The default implementation delegates to the grid column for cell-specific actions. Another thinkable implementation would be row-specific actions in which case action instantiation should be delegated to the row.
public getCellActions ( $request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT ) : array
$request Request
$row GridRow
$column GridColumn
$position int GRID_ACTION_POSITION_...
return array an array of LinkAction instances
    function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
    {
        return $column->getCellActions($request, $row, $position);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Get cell actions associated with this row/column combination
  * Adds a link to the file if there is an uploaded file present
  * @param $row GridRow
  * @param $column GridColumn
  * @return array an array of LinkAction instances
  */
 function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
 {
     if ($column->getId() == 'name') {
         $user = $request->getUser();
         $actionArgs = array_merge($row->getRequestArgs(), array('signoffId' => $row->getId()));
         $signoff = $row->getData();
         $actions = array();
         if ($signoff->getDateCompleted()) {
             import('lib.pkp.controllers.informationCenter.linkAction.SignoffNotesLinkAction');
             $actions[] = new SignoffNotesLinkAction($request, $signoff, $this->getSubmissionId(), $this->getStageId());
         } else {
             if (time() > strtotime($signoff->getDateUnderway())) {
                 import('lib.pkp.controllers.api.task.SendReminderLinkAction');
                 $actions[] = new SendReminderLinkAction($request, 'editor.submission.proof.reminder', $actionArgs);
             }
         }
         if (!$signoff->getDateCompleted() && $signoff->getUserId() == $user->getId()) {
             // User own the unfinished signoff, let it complete the task.
             import('lib.pkp.controllers.api.signoff.linkAction.AddSignoffFileLinkAction');
             $addFileAction = new AddSignoffFileLinkAction($request, $this->getSubmissionId(), $this->getStageId(), $signoff->getSymbolic(), $signoff->getId(), __('submission.upload.signoff'), __('submission.upload.signoff'));
             // FIXME: This is not ideal.
             $addFileAction->_title = null;
             $actions[] = $addFileAction;
         }
     }
     return array_merge(parent::getCellActions($request, $row, $column, $position), $actions);
 }
All Usage Examples Of GridCellProvider::getCellActions