本文整理汇总了PHP中GridHandler类的典型用法代码示例。如果您正苦于以下问题:PHP GridHandler类的具体用法?PHP GridHandler怎么用?PHP GridHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GridHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
/**
* @see GridHandler::initialize()
*/
function initialize($request, $args = null)
{
parent::initialize($request, $args);
// Basic grid configuration
$this->setId('preparedEmailsGrid');
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_PKP_USER);
// Set the grid title.
$this->setTitle('grid.preparedEmails.title');
$this->setInstructions('grid.preparedEmails.description');
// Grid actions
import('lib.pkp.controllers.grid.settings.preparedEmails.linkAction.EditEmailLinkAction');
$addEmailLinkAction = new EditEmailLinkAction($request);
$this->addAction($addEmailLinkAction);
import('lib.pkp.classes.linkAction.LinkAction');
import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
$router = $request->getRouter();
$this->addAction(new LinkAction('resetAll', new RemoteActionConfirmationModal(__('manager.emails.resetAll.message'), null, $router->url($request, null, 'grid.settings.preparedEmails.PreparedEmailsGridHandler', 'resetAllEmails')), __('manager.emails.resetAll'), 'reset_default'));
// Columns
import('lib.pkp.controllers.grid.settings.preparedEmails.PreparedEmailsGridCellProvider');
$cellProvider = new PreparedEmailsGridCellProvider();
$this->addColumn(new GridColumn('name', 'common.name', null, null, $cellProvider, array('width' => 40)));
$this->addColumn(new GridColumn('sender', 'email.sender', null, null, $cellProvider, array('width' => 10)));
$this->addColumn(new GridColumn('recipient', 'email.recipient', null, null, $cellProvider));
$this->addColumn(new GridColumn('subject', 'common.subject', null, null, $cellProvider));
$this->addColumn(new GridColumn('enabled', 'common.enabled', null, 'controllers/grid/common/cell/selectStatusCell.tpl', $cellProvider, array('width' => 5)));
}
开发者ID:relaciones-internacionales-journal,项目名称:pkp-lib,代码行数:29,代码来源:PreparedEmailsGridHandler.inc.php
示例2: initialize
function initialize(&$request)
{
parent::initialize($request);
// Basic grid configuration
$this->setId('preparedEmailsGrid');
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_MANAGER);
// Set the grid title.
$this->setTitle('grid.preparedEmails.title');
$this->setInstructions('grid.preparedEmails.description');
// Elements to be displayed in the grid
$emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO');
/* @var $emailTemplateDao EmailTemplateDAO */
$emailTemplates =& $emailTemplateDao->getEmailTemplates(AppLocale::getLocale(), $this->getContextId($request));
$rowData = array();
foreach ($emailTemplates as $emailTemplate) {
$rowData[$emailTemplate->getEmailKey()] = $emailTemplate;
}
$this->setGridDataElements($rowData);
// Grid actions
import('lib.pkp.controllers.grid.settings.preparedEmails.linkAction.EditEmailLinkAction');
$addEmailLinkAction = new EditEmailLinkAction($request);
$this->addAction($addEmailLinkAction);
import('lib.pkp.classes.linkAction.LinkAction');
import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
$router =& $request->getRouter();
$this->addAction(new LinkAction('resetAll', new RemoteActionConfirmationModal(__('manager.emails.resetAll.message'), null, $router->url($request, null, 'grid.settings.preparedEmails.PreparedEmailsGridHandler', 'resetAllEmails')), __('manager.emails.resetAll'), 'reset_default'));
// Columns
import('lib.pkp.controllers.grid.settings.preparedEmails.PreparedEmailsGridCellProvider');
$cellProvider = new PreparedEmailsGridCellProvider();
$this->addColumn(new GridColumn('name', 'common.name', null, 'controllers/grid/gridCell.tpl', $cellProvider, array('width' => 40)));
$this->addColumn(new GridColumn('sender', 'email.sender', null, 'controllers/grid/gridCell.tpl', $cellProvider, array('width' => 10)));
$this->addColumn(new GridColumn('recipient', 'email.recipient', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('subject', 'common.subject', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('enabled', 'common.enabled', null, 'controllers/grid/common/cell/selectStatusCell.tpl', $cellProvider, array('width' => 5)));
}
示例3: initialize
function initialize(&$request)
{
parent::initialize($request);
// Basic grid configuration
$this->setId('preparedEmailsGrid');
$this->setTitle('grid.preparedEmails.currentList');
Locale::requireComponents(array(LOCALE_COMPONENT_PKP_MANAGER));
// Elements to be displayed in the grid
$press =& $request->getPress();
$emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO');
/* @var $emailTemplateDao EmailTemplateDAO */
$emailTemplates =& $emailTemplateDao->getEmailTemplates(Locale::getLocale(), $press->getId());
$rowData = array();
foreach ($emailTemplates as $emailTemplate) {
$rowData[$emailTemplate->getEmailKey()] = $emailTemplate;
}
$this->setGridDataElements($rowData);
// Grid actions
import('lib.pkp.classes.linkAction.LinkAction');
import('lib.pkp.classes.linkAction.request.ConfirmationModal');
$router =& $request->getRouter();
$this->addAction(new LinkAction('resetAll', new ConfirmationModal(__('manager.emails.resetAll.message'), null, $router->url($request, null, 'grid.settings.preparedEmails.PreparedEmailsGridHandler', 'resetAllEmails')), __('manager.emails.resetAll'), 'delete'));
import('controllers.grid.settings.preparedEmails.linkAction.EditEmailLinkAction');
$addEmailLinkAction =& new EditEmailLinkAction($request);
$this->addAction($addEmailLinkAction);
// Columns
import('controllers.grid.settings.preparedEmails.PreparedEmailsGridCellProvider');
$cellProvider =& new PreparedEmailsGridCellProvider();
$this->addColumn(new GridColumn('name', 'common.name', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('sender', 'email.sender', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('recipient', 'email.recipient', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('subject', 'common.subject', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('enabled', 'common.enabled', null, 'controllers/grid/common/cell/checkMarkCell.tpl', $cellProvider));
}
示例4: initialize
/**
* @see GridHandler::initialize
*/
function initialize(&$request, $addItemLink = true)
{
parent::initialize($request);
if ($addItemLink) {
import('lib.pkp.classes.linkAction.request.NullAction');
$this->addAction(new LinkAction('addItem', new NullAction(), __('grid.action.addItem'), 'add_item'));
}
}
示例5: initialize
/**
* @see GridHandler::initialize
* @param $request PKPRequest
* @param $addItemLink boolean optional True/default to present an "add item" link action
*/
function initialize($request, $addItemLink = true)
{
parent::initialize($request);
if ($addItemLink) {
import('lib.pkp.classes.linkAction.request.NullAction');
$this->addAction($this->getAddItemLinkAction(new NullAction()));
}
}
示例6: renderFilter
/**
* @copyDoc GridHandler::renderFilter()
*/
function renderFilter($request, $filterData = array())
{
$workflowStages = WorkflowStageDAO::getWorkflowStageTranslationKeys();
$workflowStages[0] = 'workflow.stage.any';
ksort($workflowStages);
$filterColumns = $this->getFilterColumns();
$filterData = array('columns' => $filterColumns, 'workflowStages' => $workflowStages, 'gridId' => $this->getId());
return parent::renderFilter($request, $filterData);
}
示例7: initialize
/**
* @copydoc Gridhandler::initialize()
*/
function initialize($request, $args = null)
{
parent::initialize($request);
$context = $request->getContext();
// Set the grid title.
$this->setTitle('plugins.generic.customBlockManager.customBlocks');
// Set the grid instructions.
$this->setEmptyRowText('plugins.generic.customBlockManager.noneCreated');
// Get the blocks and add the data to the grid
$customBlockManagerPlugin = $this->plugin;
$blocks = $customBlockManagerPlugin->getSetting($context->getId(), 'blocks');
$gridData = array();
if (is_array($blocks)) {
foreach ($blocks as $block) {
$gridData[$block] = array('title' => $block);
}
}
$this->setGridDataElements($gridData);
// Add grid-level actions
$router = $request->getRouter();
import('lib.pkp.classes.linkAction.request.AjaxModal');
$this->addAction(new LinkAction('addCustomBlock', new AjaxModal($router->url($request, null, null, 'addCustomBlock'), __('plugins.generic.customBlockManager.addBlock'), 'modal_add_item'), __('plugins.generic.customBlockManager.addBlock'), 'add_item'));
// Columns
$this->addColumn(new GridColumn('title', 'plugins.generic.customBlockManager.blockName', null, 'controllers/grid/gridCell.tpl'));
}
示例8: initialize
function initialize(&$request)
{
parent::initialize($request);
// Retrieve the authorized monograph.
$this->setMonograph($this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH));
// Load submission-specific translations
Locale::requireComponents(array(LOCALE_COMPONENT_OMP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_OMP_DEFAULT_SETTINGS));
// Basic grid configuration
$this->setTitle('submission.submit.addAuthor');
// Get the monograph id
$monograph =& $this->getMonograph();
assert(is_a($monograph, 'Monograph'));
$monographId = $monograph->getId();
// Retrieve the submissionContributors associated with this monograph to be displayed in the grid
$authorDao =& DAORegistry::getDAO('AuthorDAO');
$data =& $authorDao->getAuthorsByMonographId($monographId);
$this->setData($data);
// Grid actions
$router =& $request->getRouter();
$actionArgs = array('monographId' => $monographId);
$this->addAction(new LegacyLinkAction('addSubmissionContributor', LINK_ACTION_MODE_MODAL, LINK_ACTION_TYPE_APPEND, $router->url($request, null, null, 'addSubmissionContributor', null, $actionArgs), 'grid.action.addAuthor'));
// Columns
$cellProvider = new SubmissionContributorGridCellProvider();
$this->addColumn(new GridColumn('name', 'author.users.contributor.name', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('email', 'author.users.contributor.email', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('role', 'author.users.contributor.role', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('principalContact', 'author.users.contributor.principalContact', null, 'controllers/grid/users/submissionContributor/primaryContact.tpl', $cellProvider));
}
示例9: initialize
function initialize(&$request)
{
parent::initialize($request);
// Retrieve the authorized monograph.
$this->setMonograph($this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH));
// Load submission-specific translations
Locale::requireComponents(array(LOCALE_COMPONENT_OMP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_OMP_DEFAULT_SETTINGS));
// Basic grid configuration
$this->setTitle('submission.submit.stageParticipants');
// Get the monograph id
$monograph =& $this->getMonograph();
assert(is_a($monograph, 'Monograph'));
$monographId = $monograph->getId();
// Retrieve the stageParticipants associated with this monograph to be displayed in the grid
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$data =& $signoffDao->getAllBySymbolic('SIGNOFF_STAGE', ASSOC_TYPE_MONOGRAPH, $monographId, null, $monograph->getCurrentStageId());
$this->setData($data);
// Grid actions
$router =& $request->getRouter();
$actionArgs = array('monographId' => $monographId, 'stageId' => $monograph->getCurrentStageId());
$this->addAction(new LegacyLinkAction('addStageParticipant', LINK_ACTION_MODE_MODAL, LINK_ACTION_TYPE_REPLACE, $router->url($request, null, null, 'addStageParticipant', null, $actionArgs), 'submission.submit.addStageParticipant'));
// Columns
$cellProvider = new StageParticipantGridCellProvider();
$this->addColumn(new GridColumn('name', 'author.users.contributor.name', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('userGroup', 'author.users.contributor.role', null, 'controllers/grid/gridCell.tpl', $cellProvider));
}
示例10: initialize
function initialize(&$request)
{
parent::initialize($request);
Locale::requireComponents(array(LOCALE_COMPONENT_OMP_EDITOR, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_PKP_SUBMISSION));
$monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
// Retrieve the submissionContributors associated with this monograph to be displayed in the grid
$doneMin = $request->getUserVar('doneMin');
$doneMax = $request->getUserVar('doneMax');
$avgMin = $request->getUserVar('avgMin');
$avgMax = $request->getUserVar('avgMax');
$lastMin = $request->getUserVar('lastMin');
$lastMax = $request->getUserVar('lastMax');
$activeMin = $request->getUserVar('activeMin');
$activeMax = $request->getUserVar('activeMax');
$interests = null;
$seriesEditorSubmissionDao =& DAORegistry::getDAO('SeriesEditorSubmissionDAO');
$data =& $seriesEditorSubmissionDao->getFilteredReviewers($monograph->getPressId(), $doneMin, $doneMax, $avgMin, $avgMax, $lastMin, $lastMax, $activeMin, $activeMax, $interests, $monograph->getId(), $monograph->getCurrentRound());
$this->setData($data);
// Columns
$cellProvider = new ReviewerSelectGridCellProvider();
$this->addColumn(new GridColumn('select', '', null, 'controllers/grid/users/reviewerSelect/reviewerSelectRadioButton.tpl', $cellProvider));
$this->addColumn(new GridColumn('name', 'author.users.contributor.name', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('done', 'common.done', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('avg', 'editor.review.days', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('last', 'editor.submissions.lastAssigned', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('active', 'common.active', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('interests', 'user.interests', null, 'controllers/grid/gridCell.tpl', $cellProvider));
}
示例11: initialize
function initialize(&$request)
{
parent::initialize($request);
// Retrieve the authorized monograph.
$this->_monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
// Load submission-specific translations
Locale::requireComponents(array(LOCALE_COMPONENT_OMP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_OMP_DEFAULT_SETTINGS));
// Get the monograph id
$monograph =& $this->getMonograph();
assert(is_a($monograph, 'Monograph'));
$monographId = $monograph->getId();
// Retrieve the submissionParticipants associated with this monograph to be displayed in the grid
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
/* @var $signoffDao SignoffDAO */
$users =& $signoffDao->getUsersBySymbolic('SIGNOFF_STAGE', ASSOC_TYPE_MONOGRAPH, $monographId);
$rowData = array();
while ($user =& $users->next()) {
$userId = $user->getId();
$rowData[$userId] = $user;
}
$this->setData($rowData);
// Columns
$cellProvider = new SubmissionParticipantGridCellProvider();
$this->addColumn(new GridColumn('name', 'author.users.contributor.name', null, 'controllers/grid/gridCell.tpl', $cellProvider));
}
示例12: initialize
function initialize(&$request)
{
parent::initialize($request);
// Load submission-specific translations
Locale::requireComponents(array(LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_OMP_EDITOR));
// Basic grid configuration
$this->setTitle('user.role.reviewers');
// Get the monograph
$submission =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
assert(is_a($submission, 'SeriesEditorSubmission'));
$monographId = $submission->getId();
// Get the review round currently being looked at
$reviewType = $request->getUserVar('reviewType');
$round = $request->getUserVar('round');
// Get the existing review assignments for this monograph
$reviewAssignments =& $submission->getReviewAssignments($reviewType, $round);
$this->setData($reviewAssignments);
// Grid actions
$router =& $request->getRouter();
$actionArgs = array('monographId' => $monographId, 'reviewType' => $reviewType, 'round' => $round);
$this->addAction(new LegacyLinkAction('addReviewer', LINK_ACTION_MODE_MODAL, LINK_ACTION_TYPE_APPEND, $router->url($request, null, null, 'addReviewer', null, $actionArgs), 'editor.monograph.addReviewer'));
// Columns
$cellProvider = new ReviewerGridCellProvider();
$this->addColumn(new GridColumn('name', 'user.name', null, 'controllers/grid/gridCell.tpl', $cellProvider));
// Add a column for the stage editor.
// FIXME: We're just adding some placeholder text here until this
// is correctly implemented, see #6233.
$this->addColumn(new GridColumn('FIXME', null, 'FIXME', 'controllers/grid/common/cell/roleCell.tpl', $cellProvider));
// Add a column for the assigned reviewer.
$this->addColumn(new GridColumn('reviewer', 'user.role.reviewer', null, 'controllers/grid/common/cell/roleCell.tpl', $cellProvider));
}
示例13: initialize
/**
* @copydoc PKPHandler::initialize()
*/
function initialize($request)
{
parent::initialize($request);
// Load submission-specific translations.
AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON, LOCALE_COMPONENT_APP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION);
// Load submissions.
$user = $request->getUser();
$this->setGridDataElements($this->getSubmissions($request, $user->getId()));
// Fetch the authorized roles and determine if the user is a manager.
$authorizedRoles = $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES);
$this->_isManager = in_array(ROLE_ID_MANAGER, $authorizedRoles);
// If there is more than one context in the system, add a context column
$contextDao = Application::getContextDAO();
$contexts = $contextDao->getAll();
$cellProvider = new SubmissionsListGridCellProvider($authorizedRoles);
if ($contexts->getCount() > 1) {
$hasRoleCount = 0;
$userGroupDao = DAORegistry::getDAO('UserGroupDAO');
while ($context = $contexts->next()) {
$userGroups = $userGroupDao->getByUserId($user->getId(), $context->getId());
if ($userGroups->getCount() > 0) {
$hasRoleCount++;
}
}
if ($hasRoleCount > 1 || $request->getContext() == null) {
$this->addColumn(new GridColumn('context', 'context.context', null, 'controllers/grid/gridCell.tpl', $cellProvider));
}
}
$this->addColumn(new GridColumn('author', 'submission.authors', null, 'controllers/grid/gridCell.tpl', $cellProvider));
$this->addColumn(new GridColumn('title', 'submission.title', null, 'controllers/grid/gridCell.tpl', $cellProvider, array('html' => true, 'alignment' => COLUMN_ALIGNMENT_LEFT)));
$this->addColumn(new GridColumn('status', 'common.status', null, 'controllers/grid/gridCell.tpl', $cellProvider));
}
示例14: authorize
/**
* @copydoc PKPHandler::authorize()
* @param $contextRequired boolean
*/
function authorize($request, &$args, $roleAssignments, $contextRequired = true)
{
if ($contextRequired) {
import('lib.pkp.classes.security.authorization.ContextAccessPolicy');
$this->addPolicy(new ContextAccessPolicy($request, $roleAssignments));
}
return parent::authorize($request, $args, $roleAssignments);
}
示例15: initialize
/**
* @copydoc PKPHandler::initialize()
*/
function initialize($request)
{
parent::initialize($request);
// Load user-related translations.
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_PKP_MANAGER);
// Basic grid configuration.
$this->setTitle('common.languages');
}