本文整理汇总了PHP中DataObjectGridCellProvider::getCellActions方法的典型用法代码示例。如果您正苦于以下问题:PHP DataObjectGridCellProvider::getCellActions方法的具体用法?PHP DataObjectGridCellProvider::getCellActions怎么用?PHP DataObjectGridCellProvider::getCellActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataObjectGridCellProvider
的用法示例。
在下文中一共展示了DataObjectGridCellProvider::getCellActions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCellActions
/**
* Get cell actions associated with this row/column combination
* @param $row GridRow
* @param $column GridColumn
* @return array an array of LegacyLinkAction instances
*/
function getCellActions(&$request, &$row, &$column, $position = GRID_ACTION_POSITION_DEFAULT)
{
if ($column->getId() == 'files') {
$monographFile =& $row->getData();
$router =& $request->getRouter();
$actionArgs = array('gridId' => $row->getGridId(), 'monographId' => $monographFile->getMonographId(), 'fileId' => $monographFile->getFileId());
$action =& new LegacyLinkAction('downloadFile', LINK_ACTION_MODE_LINK, LINK_ACTION_TYPE_NOTHING, $router->url($request, null, null, 'downloadFile', null, $actionArgs), null, $monographFile->getOriginalFileName());
return array($action);
}
return parent::getCellActions($request, $row, $column, $position);
}
示例2: getCellActions
function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_ROW_CLICK)
{
$submissionFile = $row->getData();
$router = $request->getRouter();
switch ($column->getId()) {
case 'name':
$dispatcher = $request->getDispatcher();
return array(new LinkAction('editSubmissionFile', new AjaxModal($router->url($request, null, null, 'editSubmissionFile', null, array('submissionFileId' => $submissionFile->getFileId(), 'submissionId' => $this->_submissionId)), __('grid.action.edit'), 'modal_edit', true), __('plugins.generic.vgWort.grid.action.edit'), 'edit'));
default:
return parent::getCellActions($request, $row, $column, $position);
}
}
示例3: getCellActions
/**
* @copydoc GridCellProvider::getCellActions()
*/
function getCellActions($request, $row, $column)
{
switch ($column->getId()) {
case 'label':
$element = $row->getData();
if ($element->getRemoteUrl() != '' || !$element->getFileId()) {
break;
}
$submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO');
import('lib.pkp.classes.submission.SubmissionFile');
$submissionFile = $submissionFileDao->getLatestRevision($element->getFileId(), null, $element->getSubmissionId());
import('lib.pkp.controllers.api.file.linkAction.DownloadFileLinkAction');
return array(new DownloadFileLinkAction($request, $submissionFile, $request->getUserVar('stageId'), $element->getLabel()));
}
return parent::getCellActions($request, $row, $column);
}
示例4: getCellActions
/**
* @copydoc GridCellProvider::getCellActions()
*/
function getCellActions($request, $row, $column)
{
switch ($column->getId()) {
case 'contents':
$element = $row->getData();
$submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO');
import('lib.pkp.classes.submission.SubmissionFile');
$submissionFiles = $submissionFileDao->getLatestRevisionsByAssocId(ASSOC_TYPE_NOTE, $element->getId(), $this->_submission->getId(), SUBMISSION_FILE_QUERY);
import('lib.pkp.controllers.api.file.linkAction.DownloadFileLinkAction');
$actions = array();
foreach ($submissionFiles as $submissionFile) {
$actions[] = new DownloadFileLinkAction($request, $submissionFile, $request->getUserVar('stageId'));
}
return $actions;
}
return parent::getCellActions($request, $row, $column);
}
示例5: getCellActions
/**
* Get cell actions associated with this row/column combination
* @param $row GridRow
* @param $column GridColumn
* @return array an array of LegacyLinkAction instances
*/
function getCellActions(&$request, &$row, &$column, $position = GRID_ACTION_POSITION_DEFAULT)
{
if ($column->getId() == 'title') {
$monograph =& $row->getData();
$router =& $request->getRouter();
$dispatcher =& $router->getDispatcher();
$title = $monograph->getLocalizedTitle();
if (empty($title)) {
$title = Locale::translate('common.untitled');
}
$pressId = $monograph->getPressId();
$pressDao = DAORegistry::getDAO('PressDAO');
$press = $pressDao->getPress($pressId);
$action = new LegacyLinkAction('details', LINK_ACTION_MODE_LINK, LINK_ACTION_TYPE_NOTHING, $dispatcher->url($request, ROUTE_PAGE, $press->getPath(), 'workflow', 'submission', $monograph->getId()), null, $title);
return array($action);
}
return parent::getCellActions($request, $row, $column, $position);
}
示例6: getCellActions
/**
* Get cell actions associated with this row/column combination
* @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() == 'title') {
$submission = $row->getData();
if (is_a($submission, 'ReviewerSubmission')) {
// Reviewer: Add a review link action.
return array($this->_getCellLinkAction($request, 'reviewer', 'submission', $submission));
} else {
// Get the right page and operation (authordashboard or workflow).
list($page, $operation) = SubmissionsListGridCellProvider::getPageAndOperationByUserRoles($request, $submission);
// Return redirect link action.
return array($this->_getCellLinkAction($request, $page, $operation, $submission));
}
// This should be unreachable code.
assert(false);
}
return parent::getCellActions($request, $row, $column, $position);
}
示例7: getCellActions
/**
* @copydoc GridCellProvider::getCellActions()
*/
function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
{
switch ($column->getId()) {
case 'enabled':
$element = $row->getData();
/* @var $element DataObject */
$router = $request->getRouter();
import('lib.pkp.classes.linkAction.LinkAction');
if ($element->getCanDisable()) {
if ($element->getEnabled()) {
return array(new LinkAction('disableEmail', new RemoteActionConfirmationModal($request->getSession(), __('manager.emails.disable.message'), null, $router->url($request, null, 'grid.settings.preparedEmails.PreparedEmailsGridHandler', 'disableEmail', null, array('emailKey' => $element->getEmailKey()))), __('manager.emails.disable'), 'disable'));
} else {
return array(new LinkAction('enableEmail', new RemoteActionConfirmationModal($request->getSession(), __('manager.emails.enable.message'), null, $router->url($request, null, 'grid.settings.preparedEmails.PreparedEmailsGridHandler', 'enableEmail', null, array('emailKey' => $element->getEmailKey()))), __('manager.emails.enable'), 'enable'));
}
}
}
return parent::getCellActions($request, $row, $column, $position);
}
示例8: getCellActions
/**
* @copydoc GridCellProvider::getCellActions()
*/
function getCellActions($request, $row, $column)
{
switch ($column->getId()) {
case 'label':
$element = $row->getData();
if ($element->getRemoteUrl() != '' || !$element->getFileId()) {
break;
}
$submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO');
import('lib.pkp.classes.submission.SubmissionFile');
$submissionFiles = $submissionFileDao->getLatestRevisionsByAssocId(ASSOC_TYPE_REPRESENTATION, $element->getId(), $this->_submission->getId(), SUBMISSION_FILE_PROOF);
import('lib.pkp.controllers.api.file.linkAction.DownloadFileLinkAction');
$actions = array();
foreach ($submissionFiles as $submissionFile) {
$actions[] = new DownloadFileLinkAction($request, $submissionFile, $request->getUserVar('stageId'), $element->getLabel());
}
return $actions;
}
return parent::getCellActions($request, $row, $column);
}
示例9: getCellActions
/**
* Get cell actions associated with this row/column combination
*
* @copydoc GridCellProvider::getCellActions()
*/
function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
{
$publishedSubmissionGalley = $row->getData();
$columnId = $column->getId();
assert(is_a($publishedSubmissionGalley, 'ArticleGalley') && !empty($columnId));
$publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
$publishedSubmission = $publishedArticleDao->getPublishedArticleByArticleId($publishedSubmissionGalley->getSubmissionId());
import('lib.pkp.classes.linkAction.request.RedirectAction');
switch ($columnId) {
case 'title':
$this->_titleColumn = $column;
$title = $publishedSubmission->getLocalizedTitle();
if (empty($title)) {
$title = __('common.untitled');
}
$authorsInTitle = $publishedSubmission->getShortAuthorString();
$title = $authorsInTitle . '; ' . $title;
import('lib.pkp.controllers.grid.submissions.SubmissionsListGridCellProvider');
return array(new LinkAction('itemWorkflow', new RedirectAction(SubmissionsListGridCellProvider::getUrlByUserRoles($request, $publishedSubmission)), $title));
case 'issue':
$contextId = $publishedSubmission->getContextId();
$issueId = $publishedSubmission->getIssueId();
$issueDao = DAORegistry::getDAO('IssueDAO');
$issue = $issueDao->getById($issueId, $contextId);
// Link to the issue edit modal
$application = PKPApplication::getApplication();
$dispatcher = $application->getDispatcher();
import('lib.pkp.classes.linkAction.request.AjaxModal');
return array(new LinkAction('edit', new AjaxModal($dispatcher->url($request, ROUTE_COMPONENT, null, 'grid.issues.BackIssueGridHandler', 'editIssue', null, array('issueId' => $issue->getId())), __('plugins.importexport.common.settings.DOIPluginSettings')), $issue->getIssueIdentification(), null));
case 'status':
$status = $publishedSubmissionGalley->getData($this->_plugin->getDepositStatusSettingName());
$statusNames = $this->_plugin->getStatusNames();
$statusActions = $this->_plugin->getStatusActions($publishedSubmission);
if ($status && array_key_exists($status, $statusActions)) {
assert(array_key_exists($status, $statusNames));
return array(new LinkAction('edit', new RedirectAction($statusActions[$status], '_blank'), $statusNames[$status]));
}
}
return parent::getCellActions($request, $row, $column, $position);
}
示例10: getCellActions
/**
* Get cell actions associated with this row/column combination
* @param $row GridRow
* @param $column GridColumn
* @return array an array of LegacyLinkAction instances
*/
function getCellActions(&$request, &$row, &$column, $position = GRID_ACTION_POSITION_DEFAULT)
{
if ($column->getId() == 'name') {
$monographFile =& $row->getData();
$router =& $request->getRouter();
$dispatcher =& $router->getDispatcher();
$fileName = $monographFile->getLocalizedName() != '' ? $monographFile->getLocalizedName() : Locale::translate('common.untitled');
if ($monographFile->getRevision() > 1) {
$fileName .= ' (' . $monographFile->getRevision() . ')';
}
// Add revision number to label
if (empty($fileName)) {
$fileName = Locale::translate('common.untitled');
}
$actionArgs = array('monographId' => $monographFile->getMonographId(), 'fileId' => $monographFile->getFileId());
$genreDao =& DAORegistry::getDAO('GenreDAO');
$genre = $genreDao->getById($monographFile->getGenreId());
$action =& new LegacyLinkAction('downloadFile', LINK_ACTION_MODE_LINK, LINK_ACTION_TYPE_NOTHING, $router->url($request, null, null, 'downloadFile', null, $actionArgs), null, $fileName, $genre->getCategory() == GENRE_CATEGORY_ARTWORK ? 'imageFile' : null);
return array($action);
}
return parent::getCellActions($request, $row, $column, $position);
}
示例11: getCellActions
/**
* Get cell actions associated with this row/column combination
*
* @copydoc GridCellProvider::getCellActions()
*/
function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
{
$publishedIssue = $row->getData();
$columnId = $column->getId();
assert(is_a($publishedIssue, 'Issue') && !empty($columnId));
switch ($columnId) {
case 'identification':
// Link to the issue edit modal
$application = PKPApplication::getApplication();
$dispatcher = $application->getDispatcher();
import('lib.pkp.classes.linkAction.request.AjaxModal');
return array(new LinkAction('edit', new AjaxModal($dispatcher->url($request, ROUTE_COMPONENT, null, 'grid.issues.BackIssueGridHandler', 'editIssue', null, array('issueId' => $publishedIssue->getId())), __('plugins.importexport.common.settings.DOIPluginSettings')), $publishedIssue->getIssueIdentification(), null));
case 'status':
$status = $publishedIssue->getData($this->_plugin->getDepositStatusSettingName());
$statusNames = $this->_plugin->getStatusNames();
$statusActions = $this->_plugin->getStatusActions($publishedIssue);
if ($status && array_key_exists($status, $statusActions)) {
assert(array_key_exists($status, $statusNames));
import('lib.pkp.classes.linkAction.request.RedirectAction');
return array(new LinkAction('edit', new RedirectAction($statusActions[$status], '_blank'), $statusNames[$status]));
}
}
return parent::getCellActions($request, $row, $column, $position);
}
示例12: getCellActions
/**
* @see GridCellProvider::getCellActions()
*/
function getCellActions($request, $row, $column)
{
$data = $row->getData();
$router = $request->getRouter();
if (is_a($data, 'Representation')) {
switch ($column->getId()) {
case 'name':
// if it is a remotely hosted content, don't provide
// file upload and select link actions
$remoteURL = $data->getRemoteURL();
if ($remoteURL) {
return array();
}
import('lib.pkp.controllers.api.file.linkAction.AddFileLinkAction');
import('lib.pkp.controllers.grid.files.fileList.linkAction.SelectFilesLinkAction');
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_EDITOR);
return array(new AddFileLinkAction($request, $data->getSubmissionId(), WORKFLOW_STAGE_ID_PRODUCTION, array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT), null, SUBMISSION_FILE_PROOF, ASSOC_TYPE_REPRESENTATION, $data->getId()), new SelectFilesLinkAction($request, array('submissionId' => $data->getSubmissionId(), 'assocType' => ASSOC_TYPE_REPRESENTATION, 'assocId' => $data->getId(), 'representationId' => $data->getId(), 'stageId' => WORKFLOW_STAGE_ID_PRODUCTION, 'fileStage' => SUBMISSION_FILE_PROOF), __('editor.submission.selectFiles')));
case 'isComplete':
return array(new LinkAction('approveRepresentation', new RemoteActionConfirmationModal(__($data->getIsApproved() ? 'grid.catalogEntry.approvedRepresentation.removeMessage' : 'grid.catalogEntry.approvedRepresentation.message'), __('grid.catalogEntry.approvedRepresentation.title'), $router->url($request, null, null, 'setApproved', null, array('representationId' => $data->getId(), 'newApprovedState' => $data->getIsApproved() ? 0 : 1, 'submissionId' => $data->getSubmissionId())), 'modal_approve'), $data->getIsApproved() ? __('submission.complete') : __('submission.incomplete'), $data->getIsApproved() ? 'complete' : 'incomplete', __('grid.action.setApproval')));
}
} else {
assert(is_array($data) && isset($data['submissionFile']));
$submissionFile = $data['submissionFile'];
switch ($column->getId()) {
case 'name':
import('lib.pkp.controllers.grid.files.FileNameGridColumn');
$fileNameColumn = new FileNameGridColumn(true, WORKFLOW_STAGE_ID_PRODUCTION, true);
return $fileNameColumn->getCellActions($request, $row);
case 'isComplete':
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_EDITOR);
import('lib.pkp.classes.linkAction.request.AjaxAction');
return array(new LinkAction($submissionFile->getViewable() ? 'approved' : 'not_approved', new RemoteActionConfirmationModal(__($submissionFile->getViewable() ? 'editor.submission.proofreading.confirmRemoveCompletion' : 'editor.submission.proofreading.confirmCompletion'), __($submissionFile->getViewable() ? 'editor.submission.proofreading.revokeProofApproval' : 'editor.submission.proofreading.approveProof'), $router->url($request, null, null, 'setProofFileCompletion', null, array('submissionId' => $submissionFile->getSubmissionId(), 'fileId' => $submissionFile->getFileId(), 'revision' => $submissionFile->getRevision(), 'approval' => !$submissionFile->getViewable())), 'modal_approve'), $submissionFile->getViewable() ? __('grid.catalogEntry.availableRepresentation.approved') : __('grid.catalogEntry.availableRepresentation.notApproved')));
}
}
return parent::getCellActions($request, $row, $column);
}
示例13: getCellActions
/**
* Get cell actions associated with this row/column combination
* @param $row GridRow
* @param $column GridColumn
* @return array an array of LinkAction instances
*/
function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
{
$submission = $row->getData();
$user = $request->getUser();
switch ($column->getId()) {
case 'editor':
$stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO');
/* @var $stageAssignmentDao StageAssignmentDAO */
$editorAssignments = $stageAssignmentDao->getEditorsAssignedToStage($submission->getId(), $submission->getStageId());
$assignment = current($editorAssignments);
if (!$assignment) {
return array();
}
$userDao = DAORegistry::getDAO('UserDAO');
/* @var $userDao UserDAO */
$editor = $userDao->getById($assignment->getUserId());
import('lib.pkp.classes.linkAction.request.NullAction');
return array(new LinkAction('editor', new NullAction(), $editor->getInitials(), null, $editor->getFullName()));
case 'stage':
$stageId = $submission->getStageId();
$stage = null;
if ($submission->getSubmissionProgress() > 0) {
// Submission process not completed.
$stage = __('submissions.incomplete');
}
switch ($submission->getStatus()) {
case STATUS_DECLINED:
$stage = __('submission.status.declined');
break;
case STATUS_PUBLISHED:
$stage = __('submission.status.published');
break;
}
if (!$stage) {
$stage = __(WorkflowStageDAO::getTranslationKeyFromId($stageId));
}
import('lib.pkp.classes.linkAction.request.RedirectAction');
$reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewAssignment = $reviewAssignmentDao->getLastReviewRoundReviewAssignmentByReviewer($submission->getId(), $user->getId());
if (is_a($reviewAssignment, 'ReviewAssignment') && $reviewAssignment->getStageId() == $stageId) {
return array(new LinkAction('itemWorkflow', new RedirectAction($request->getDispatcher()->url($request, ROUTE_PAGE, null, 'reviewer', 'submission', $submission->getId())), $stage));
}
return array(new LinkAction('itemWorkflow', new RedirectAction(SubmissionsListGridCellProvider::getUrlByUserRoles($request, $submission)), $stage));
}
return parent::getCellActions($request, $row, $column, $position);
}
示例14: getCellActions
/**
* Get cell actions associated with this row/column combination
* @param $row GridRow
* @param $column GridColumn
* @return array an array of LinkAction instances
*/
function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
{
$reviewAssignment = $row->getData();
$actionArgs = array('submissionId' => $reviewAssignment->getSubmissionId(), 'reviewAssignmentId' => $reviewAssignment->getId(), 'stageId' => $reviewAssignment->getStageId());
$router = $request->getRouter();
$action = false;
$submissionDao = Application::getSubmissionDAO();
$submission = $submissionDao->getById($reviewAssignment->getSubmissionId());
// Only attach actions to the actions column. The actions and status
// columns share state values.
$columnId = $column->getId();
if ($columnId == 'actions') {
switch ($this->getCellState($row, $column)) {
case 'overdue':
case 'overdue_response':
import('lib.pkp.controllers.api.task.SendReminderLinkAction');
return array(new SendReminderLinkAction($request, 'editor.review.reminder', $actionArgs));
case 'read':
import('lib.pkp.controllers.api.task.SendThankYouLinkAction');
return array(new SendThankYouLinkAction($request, 'editor.review.thankReviewer', $actionArgs));
case 'completed':
import('lib.pkp.controllers.review.linkAction.UnconsiderReviewLinkAction');
return array(new UnconsiderReviewLinkAction($request, $reviewAssignment, $submission));
case 'reviewReady':
$user = $request->getUser();
import('lib.pkp.controllers.review.linkAction.ReviewNotesLinkAction');
return array(new ReviewNotesLinkAction($request, $reviewAssignment, $submission, $user, true));
}
}
return parent::getCellActions($request, $row, $column, $position);
}
示例15: getCellActions
/**
* Get cell actions associated with this row/column combination
* @param $row GridRow
* @param $column GridColumn
* @return array an array of LinkAction instances
*/
function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
{
$submission = $row->getData();
$user = $request->getUser();
switch ($column->getId()) {
case 'editor':
$stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO');
/* @var $stageAssignmentDao StageAssignmentDAO */
$editorAssignments = $stageAssignmentDao->getEditorsAssignedToStage($submission->getId(), $submission->getStageId());
$assignment = current($editorAssignments);
if (!$assignment) {
return array();
}
$userDao = DAORegistry::getDAO('UserDAO');
/* @var $userDao UserDAO */
$editor = $userDao->getById($assignment->getUserId());
import('lib.pkp.classes.linkAction.request.NullAction');
return array(new LinkAction('editor', new NullAction(), $editor->getInitials(), null, $editor->getFullName()));
case 'stage':
$stageId = $submission->getStageId();
$stage = null;
if ($submission->getSubmissionProgress() > 0) {
// Submission process not completed.
$stage = __('submissions.incomplete');
}
switch ($submission->getStatus()) {
case STATUS_DECLINED:
$stage = __('submission.status.declined');
break;
case STATUS_PUBLISHED:
$stage = __('submission.status.published');
break;
}
$userGroupDao = DAORegistry::getDAO('UserGroupDAO');
if (!$stage) {
$stage = __(WorkflowStageDAO::getTranslationKeyFromId($stageId));
}
$reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewAssignment = $reviewAssignmentDao->getLastReviewRoundReviewAssignmentByReviewer($submission->getId(), $user->getId());
if (is_a($reviewAssignment, 'ReviewAssignment')) {
// Reviewer: Add a review link action.
return array($this->_getCellLinkAction($request, 'reviewer', 'submission', $submission, $stage));
} else {
// Get the right page and operation (authordashboard or workflow).
list($page, $operation) = SubmissionsListGridCellProvider::getPageAndOperationByUserRoles($request, $submission);
// Return redirect link action.
return array($this->_getCellLinkAction($request, $page, $operation, $submission, $stage));
}
}
return parent::getCellActions($request, $row, $column, $position);
}