本文整理汇总了PHP中GridRow类的典型用法代码示例。如果您正苦于以下问题:PHP GridRow类的具体用法?PHP GridRow怎么用?PHP GridRow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GridRow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
/**
* @see GridRow::initialize()
* @param $request PKPRequest
*/
function initialize($request)
{
parent::initialize($request);
// Retrieve the submission id from the request
// These parameters need not be validated as we're just
// passing them along to another request, where they will be
// checked before they're used.
$submissionId = (int) $request->getUserVar('submissionId');
$stageId = (int) $request->getUserVar('stageId');
$round = (int) $request->getUserVar('round');
// Is this a new row or an existing row?
$rowId = $this->getId();
if (!empty($rowId) && is_numeric($rowId)) {
// Only add row actions if this is an existing row
$router = $request->getRouter();
$actionArgs = array('submissionId' => $submissionId, 'reviewAssignmentId' => $rowId, 'stageId' => $stageId, 'round' => $round);
$this->addAction(new LinkAction('history', new AjaxModal($router->url($request, null, null, 'reviewHistory', null, $actionArgs), __('submission.history'), 'modal_information'), __('submission.history'), 'more_info'));
$this->addAction(new LinkAction('email', new AjaxModal($router->url($request, null, null, 'sendEmail', null, $actionArgs), __('grid.user.email'), 'modal_email'), __('grid.user.email'), 'notify'));
$this->addAction(new LinkAction('manageAccess', new AjaxModal($router->url($request, null, null, 'limitFiles', null, $actionArgs), __('editor.submissionReview.limitFiles'), 'modal_add_file'), __('editor.submissionReview.limitFiles.link'), 'edit'));
$reviewAssignment = $this->getData();
// Only assign this action if the reviewer has not acknowledged yet.
if (!$reviewAssignment->getDateConfirmed()) {
$this->addAction(new LinkAction('unassignReviewer', new AjaxModal($router->url($request, null, null, 'unassignReviewer', null, $actionArgs), __('editor.review.unassignReviewer'), 'modal_delete'), __('editor.review.unassignReviewer'), 'delete'));
}
}
}
示例2: GridCategoryRow
/**
* Constructor.
*/
function GridCategoryRow()
{
parent::GridRow();
// Set a default cell provider that will get the cell template
// variables from the category grid row.
$this->setCellProvider(new GridCategoryRowCellProvider());
}
示例3: initialize
/**
* @see GridRow::initialize()
* @param $request PKPRequest
*/
function initialize(&$request)
{
// Do the default initialization
parent::initialize($request);
// Retrieve the article id from the request
$articleId = $request->getUserVar('articleId');
assert(is_numeric($articleId));
// Is this a new row or an existing row?
$rowId = $this->getId();
if (!empty($rowId) && is_numeric($rowId)) {
// Only add row actions if this is an existing row
$router =& $request->getRouter();
$actionArgs = array('articleId' => $articleId, 'citationId' => $rowId);
// Get the citation to decide whether it has already been
// checked.
$citation =& $this->getData();
assert(is_a($citation, 'Citation'));
if ($citation->getCitationState() < CITATION_LOOKED_UP) {
$editActionOp = 'checkCitation';
$editActionTitle = 'submission.citations.grid.editCheckCitation';
} else {
$editActionOp = 'editCitation';
$editActionTitle = 'grid.action.edit';
}
// Add row actions
$this->addAction(new GridAction('editCitation', GRID_ACTION_MODE_MODAL, GRID_ACTION_TYPE_REPLACE, $router->url($request, null, null, $editActionOp, null, $actionArgs), $editActionTitle, null, 'edit'));
$this->addAction(new GridAction('deleteCitation', GRID_ACTION_MODE_CONFIRM, GRID_ACTION_TYPE_REMOVE, $router->url($request, null, null, 'deleteCitation', null, $actionArgs), 'grid.action.delete', null, 'delete'));
// Set a non-default template that supports row actions
$this->setTemplate('controllers/grid/gridRowWithActions.tpl');
}
}
示例4: initialize
/**
* @see GridRow::initialize()
*/
function initialize($request)
{
parent::initialize($request);
// Is this a new row or an existing row?
$element = $this->getData();
assert(is_a($element, 'ReviewForm'));
$rowId = $this->getId();
if (!empty($rowId) && is_numeric($rowId)) {
// Only add row actions if this is an existing row
$router = $request->getRouter();
// determine whether or not this Review Form is editable.
$canEdit = $element->getIncompleteCount() == 0 && $element->getCompleteCount() == 0;
// if review form is editable, add 'edit' grid row action
if ($canEdit) {
$this->addAction(new LinkAction('edit', new AjaxModal($router->url($request, null, null, 'editReviewForm', null, array('rowId' => $rowId)), __('grid.action.edit'), 'modal_edit', true), __('grid.action.edit'), 'edit'));
}
// if review form is not editable, add 'copy' grid row action
if (!$canEdit) {
$this->addAction(new LinkAction('copy', new RemoteActionConfirmationModal(__('manager.reviewForms.confirmCopy'), null, $router->url($request, null, null, 'copyReviewForm', null, array('rowId' => $rowId))), __('grid.action.copy'), 'copy'));
}
// add 'preview' grid row action
$this->addAction(new LinkAction('preview', new AjaxModal($router->url($request, null, null, 'editReviewForm', null, array('rowId' => $rowId, 'preview' => 1)), __('grid.action.preview'), 'preview', true), __('grid.action.preview'), 'preview'));
// if review form is editable, add 'delete' grid row action.
if ($canEdit) {
$this->addAction(new LinkAction('delete', new RemoteActionConfirmationModal(__('manager.reviewForms.confirmDelete'), null, $router->url($request, null, null, 'deleteReviewForm', null, array('rowId' => $rowId))), __('grid.action.delete'), 'delete'));
}
}
}
示例5: initialize
/**
* @copydoc GridRow::initialize()
*/
function initialize($request, $template = null)
{
parent::initialize($request, $template);
// Retrieve the submission id from the request
// These parameters need not be validated as we're just
// passing them along to another request, where they will be
// checked before they're used.
$submissionId = (int) $request->getUserVar('submissionId');
$stageId = (int) $request->getUserVar('stageId');
$round = (int) $request->getUserVar('round');
// Is this a new row or an existing row?
$rowId = $this->getId();
if (!empty($rowId) && is_numeric($rowId)) {
// Only add row actions if this is an existing row
$router = $request->getRouter();
$actionArgs = array('submissionId' => $submissionId, 'reviewAssignmentId' => $rowId, 'stageId' => $stageId, 'round' => $round);
// read or upload a review
$submissionDao = Application::getSubmissionDAO();
$submission = $submissionDao->getById($submissionId);
$this->addAction(new LinkAction('readReview', new AjaxModal($router->url($request, null, null, 'readReview', null, $actionArgs), __('editor.review.reviewDetails') . ': ' . $submission->getLocalizedTitle(), 'modal_information'), __('editor.review.reviewDetails'), 'more_info'));
$this->addAction(new LinkAction('email', new AjaxModal($router->url($request, null, null, 'sendEmail', null, $actionArgs), __('editor.review.emailReviewer'), 'modal_email'), __('editor.review.emailReviewer'), 'notify'));
$this->addAction(new LinkAction('manageAccess', new AjaxModal($router->url($request, null, null, 'editReview', null, $actionArgs), __('editor.submissionReview.editReview'), 'modal_add_file'), __('common.edit'), 'edit'));
$reviewAssignment = $this->getData();
// Only assign this action if the reviewer has not acknowledged yet.
if (!$reviewAssignment->getDateConfirmed()) {
$this->addAction(new LinkAction('unassignReviewer', new AjaxModal($router->url($request, null, null, 'unassignReviewer', null, $actionArgs), __('editor.review.unassignReviewer'), 'modal_delete'), __('editor.review.unassignReviewer'), 'delete'));
}
$this->addAction(new LinkAction('history', new AjaxModal($router->url($request, null, null, 'reviewHistory', null, $actionArgs), __('submission.history'), 'modal_information'), __('submission.history'), 'more_info'));
}
}
示例6: initialize
/**
* @see GridRow::initialize()
* @param $request PKPRequest
*/
function initialize($request)
{
// Do the default initialization
parent::initialize($request);
// Retrieve the submission from the request
$submission = $this->getSubmission();
// Is this a new row or an existing row?
$rowId = $this->getId();
if (!empty($rowId) && is_numeric($rowId)) {
// Only add row actions if this is an existing row
$router = $request->getRouter();
$actionArgs = $this->getRequestArgs();
$actionArgs['authorId'] = $rowId;
if ($this->canAdminister($request)) {
// Add row-level actions
import('lib.pkp.classes.linkAction.request.AjaxModal');
$this->addAction(new LinkAction('editAuthor', new AjaxModal($router->url($request, null, null, 'editAuthor', null, $actionArgs), __('grid.action.editContributor'), 'modal_edit'), __('grid.action.edit'), 'edit'));
import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
$this->addAction(new LinkAction('deleteAuthor', new RemoteActionConfirmationModal(__('common.confirmDelete'), __('common.delete'), $router->url($request, null, null, 'deleteAuthor', null, $actionArgs), 'modal_delete'), __('grid.action.delete'), 'delete'));
$authorDao = DAORegistry::getDAO('AuthorDAO');
$userDao = DAORegistry::getDAO('UserDAO');
$author = $authorDao->getById($rowId);
if ($author && !$userDao->userExistsByEmail($author->getEmail())) {
$this->addAction(new LinkAction('addUser', new AjaxModal($router->url($request, null, null, 'addUser', null, $actionArgs), __('grid.user.add'), 'modal_add_user', true), __('grid.user.add'), 'add_user'));
}
}
}
}
示例7: initialize
/**
* @see GridRow::initialize()
*/
function initialize(&$request)
{
parent::initialize($request);
// Is this a new row or an existing row?
$element =& $this->getData();
assert(is_a($element, 'User'));
$rowId = $this->getId();
if (!empty($rowId) && is_numeric($rowId)) {
// Only add row actions if this is an existing row
$router =& $request->getRouter();
$actionArgs = array('gridId' => $this->getGridId(), 'rowId' => $rowId);
$this->addAction(new LegacyLinkAction('email', LINK_ACTION_MODE_MODAL, null, $router->url($request, null, null, 'editEmail', null, $actionArgs), 'grid.user.email', null, 'notify'));
$this->addAction(new LegacyLinkAction('edit', LINK_ACTION_MODE_MODAL, LINK_ACTION_TYPE_REPLACE, $router->url($request, null, null, 'editUser', null, $actionArgs), 'grid.action.edit', null, 'edit'));
if ($element->getDisabled()) {
$actionArgs['enable'] = true;
$this->addAction(new LegacyLinkAction('enable', LINK_ACTION_MODE_MODAL, LINK_ACTION_TYPE_REPLACE, $router->url($request, null, null, 'editDisableUser', null, $actionArgs), 'grid.user.enable', null, 'enable'));
} else {
$actionArgs['enable'] = false;
$this->addAction(new LegacyLinkAction('disable', LINK_ACTION_MODE_MODAL, LINK_ACTION_TYPE_REPLACE, $router->url($request, null, null, 'editDisableUser', null, $actionArgs), 'grid.user.disable', null, 'disable'));
}
$this->addAction(new LegacyLinkAction('remove', LINK_ACTION_MODE_CONFIRM, LINK_ACTION_TYPE_REMOVE, $router->url($request, null, null, 'removeUser', null, $actionArgs), 'grid.action.remove', null, 'delete'));
// Set a non-default template that supports row actions
$this->setTemplate('controllers/grid/gridRowWithActions.tpl');
}
}
示例8: initialize
/**
* @copydoc GridRow::initialize()
*/
function initialize($request, $template = null)
{
parent::initialize($request, $template);
// Is this a new row or an existing row?
$plugin =& $this->getData();
/* @var $plugin Plugin */
assert(is_a($plugin, 'Plugin'));
$rowId = $this->getId();
// Only add row actions if this is an existing row
if (!is_null($rowId)) {
$router = $request->getRouter();
/* @var $router PKPRouter */
$actionArgs = array_merge(array('plugin' => $plugin->getName()), $this->getRequestArgs());
if ($this->_canEdit($plugin)) {
foreach ($plugin->getActions($request, $actionArgs) as $action) {
$this->addAction($action);
}
}
// Administrative functions.
if (in_array(ROLE_ID_SITE_ADMIN, $this->_userRoles)) {
import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
$this->addAction(new LinkAction('delete', new RemoteActionConfirmationModal(__('manager.plugins.deleteConfirm'), __('common.delete'), $router->url($request, null, null, 'deletePlugin', null, $actionArgs), 'modal_delete'), __('common.delete'), 'delete'));
$this->addAction(new LinkAction('upgrade', new AjaxModal($router->url($request, null, null, 'upgradePlugin', null, $actionArgs), __('manager.plugins.upgrade'), 'modal_upgrade'), __('grid.action.upgrade'), 'upgrade'));
}
}
}
示例9: initialize
/**
* @copydoc GridRow::initialize()
*/
function initialize($request, $template = null)
{
// Do the default initialization
parent::initialize($request, $template);
// Is this a new row or an existing row?
$rowId = $this->getId();
if (!empty($rowId) && is_numeric($rowId)) {
// Only add row actions if this is an existing row.
$router = $request->getRouter();
import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
if ($this->_canAdminister) {
$this->addAction(new LinkAction('delete', new RemoteActionConfirmationModal(__('editor.submission.removeStageParticipant.description'), __('editor.submission.removeStageParticipant'), $router->url($request, null, null, 'deleteParticipant', null, $this->getRequestArgs()), 'modal_delete'), __('grid.action.remove'), 'delete'));
}
import('lib.pkp.controllers.grid.users.stageParticipant.linkAction.NotifyLinkAction');
$submission = $this->getSubmission();
$stageId = $this->getStageId();
$stageAssignment = $this->getData();
$userId = $stageAssignment->getUserId();
$this->addAction(new NotifyLinkAction($request, $submission, $stageId, $userId));
$user = $request->getUser();
if (!Validation::isLoggedInAs() && $user->getId() != $rowId && Validation::canAdminister($rowId, $user->getId())) {
$dispatcher = $router->getDispatcher();
import('lib.pkp.classes.linkAction.request.RedirectConfirmationModal');
$this->addAction(new LinkAction('logInAs', new RedirectConfirmationModal(__('grid.user.confirmLogInAs'), __('grid.action.logInAs'), $dispatcher->url($request, ROUTE_PAGE, null, 'login', 'signInAsUser', $userId)), __('grid.action.logInAs'), 'enroll_user'));
}
}
}
示例10: initialize
/**
* @copydoc GridRow::initialize()
*/
function initialize($request, $template = null)
{
// Do the default initialization
parent::initialize($request, $template);
// Retrieve the submission from the request
$submission = $this->getSubmission();
// Is this a new row or an existing row?
$rowId = $this->getId();
if (!empty($rowId) && is_numeric($rowId)) {
// Only add row actions if this is an existing row
$router = $request->getRouter();
$actionArgs = $this->getRequestArgs();
$actionArgs['representationId'] = $rowId;
// Add row-level actions
import('lib.pkp.classes.linkAction.request.AjaxModal');
$this->addAction(new LinkAction('editGalley', new AjaxModal($router->url($request, null, null, 'editGalley', null, $actionArgs), __('submission.layout.editGalley'), 'modal_edit'), __('grid.action.edit'), 'edit'));
$galley = $this->getData();
if ($galley->getRemoteUrl() == '') {
import('lib.pkp.controllers.api.file.linkAction.AddFileLinkAction');
import('lib.pkp.classes.submission.SubmissionFile');
// Constants
$this->addAction(new AddFileLinkAction($request, $this->getSubmission()->getId(), WORKFLOW_STAGE_ID_PRODUCTION, array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT), null, SUBMISSION_FILE_PROOF, ASSOC_TYPE_REPRESENTATION, $rowId));
}
import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
$this->addAction(new LinkAction('deleteGalley', new RemoteActionConfirmationModal(__('common.confirmDelete'), __('grid.action.delete'), $router->url($request, null, null, 'deleteGalley', null, $actionArgs), 'modal_delete'), __('grid.action.delete'), 'delete'));
}
}
示例11: initialize
/**
* @see GridRow::initialize()
* @param $request PKPRequest
*/
function initialize(&$request)
{
parent::initialize($request);
$press =& $request->getPress();
$user =& $this->getData();
$this->setId($user->getId());
$seriesEditorSubmissionDao =& DAORegistry::getDAO('SeriesEditorSubmissionDAO');
$this->reviewerStats =& $seriesEditorSubmissionDao->getReviewerStatistics($press->getId());
}
示例12: initialize
/**
* @see GridRow::initialize()
* @param $request PKPRequest
*/
function initialize($request)
{
parent::initialize($request);
$context = $request->getContext();
$user = $this->getData();
$this->setId($user->getId());
$reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO');
$this->reviewerStats = $reviewAssignmentDao->getReviewerStatistics($context->getId());
}
示例13: initialize
/**
* @copydoc GridRow::initialize()
*/
function initialize($request)
{
parent::initialize($request);
$router = $request->getRouter();
$data = $this->getData();
$actionArgs = array('locale' => $this->locale, 'emailKey' => $this->getId());
// Create the "edit" action
import('lib.pkp.classes.linkAction.request.AddTabAction');
$this->addAction(new LinkAction('edit', new AddTabAction($this->tabsSelector, $router->url($request, null, null, 'edit', null, $actionArgs), $this->getId()), __('grid.action.edit'), 'edit'));
}
示例14: initialize
/**
* @copydoc GridRow::initialize()
*/
function initialize($request)
{
parent::initialize($request);
$router = $request->getRouter();
$actionArgs = array('locale' => $this->getId(), 'tabsSelector' => $this->tabsSelector);
// Create the "edit" action
import('lib.pkp.classes.linkAction.request.AddTabAction');
$this->addAction(new LinkAction('edit', new AddTabAction($this->tabsSelector, $router->url($request, null, null, 'edit', null, $actionArgs), __('plugins.generic.translator.locale', array('locale' => $this->getId()))), __('grid.action.edit'), 'edit'));
// Create the "export" action
$this->addAction(new LinkAction('export', new RedirectAction($router->url($request, null, null, 'export', null, array('locale' => $this->getId()))), __('common.export'), 'zip'));
}
示例15: initialize
/**
* @copydoc GridRow::initialize()
*/
function initialize($request, $template = null)
{
parent::initialize($request, $template);
AppLocale::requireComponents(LOCALE_COMPONENT_APP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION);
$requestArgs = array_merge($this->getRequestArgs(), array('submissionId' => $this->getId(), 'rowId' => $this->getId()));
$dispatcher = Application::getDispatcher();
import('lib.pkp.classes.linkAction.request.AjaxModal');
$this->addAction(new LinkAction('catalogEntry', new AjaxModal($dispatcher->url($request, ROUTE_COMPONENT, null, 'modals.submissionMetadata.CatalogEntryHandler', 'fetch', null, array_merge($requestArgs, array('stageId' => WORKFLOW_STAGE_ID_PRODUCTION))), __('submission.catalogEntry'), 'modal_more_info'), __('submission.editCatalogEntry')));
import('lib.pkp.classes.linkAction.request.RedirectAction');
$this->addAction(new LinkAction('itemWorkflow', new RedirectAction($dispatcher->url($request, ROUTE_PAGE, null, 'workflow', 'access', null, $requestArgs)), __('submission.submission')));
}