本文整理汇总了PHP中GridCellProvider类的典型用法代码示例。如果您正苦于以下问题:PHP GridCellProvider类的具体用法?PHP GridCellProvider怎么用?PHP GridCellProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GridCellProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTemplateVarsFromRowColumn
/**
* This implementation assumes a simple data element array that
* has column ids as keys.
* @see GridCellProvider::getTemplateVarsFromRowColumn()
* @param $row GridRow
* @param $column GridColumn
* @return array
*/
function getTemplateVarsFromRowColumn($row, $column)
{
$file = $row->getData();
$columnId = $column->getId();
assert(is_a($file, 'SubmissionFile') && !empty($columnId));
switch ($columnId) {
case 'name':
return array('labelKey' => $file->getFileId(), 'label' => '<span class="label before_actions">' . $file->getFileId() . '-' . $file->getRevision() . '</span>' . htmlspecialchars($file->getFileLabel()));
}
return parent::getTemplateVarsFromRowColumn($row, $column);
}
示例2: getCellActions
/**
* @see GridCellProvider::getCellActions()
*/
function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
{
switch ($column->getId()) {
case 'active':
$element = $row->getData();
/* @var $element DataObject */
$router = $request->getRouter();
import('lib.pkp.classes.linkAction.LinkAction');
if ($element->getActive()) {
return array(new LinkAction('deactivateReviewForm', new RemoteActionConfirmationModal(__('manager.reviewForms.confirmDeactivate'), null, $router->url($request, null, 'grid.settings.reviewForms.ReviewFormGridHandler', 'deactivateReviewForm', null, array('reviewFormKey' => $element->getId())))));
} else {
return array(new LinkAction('activateReviewForm', new RemoteActionConfirmationModal(__('manager.reviewForms.confirmActivate'), null, $router->url($request, null, 'grid.settings.reviewForms.ReviewFormGridHandler', 'activateReviewForm', null, array('reviewFormKey' => $element->getId())))));
}
}
return parent::getCellActions($request, $row, $column, $position);
}
示例3: render
/**
* @see GridCellProvider::render()
*/
function render($request, $row, $column)
{
// Default category rows will only have the first column
// as label columns.
if ($column->hasFlag('firstColumn')) {
// Store the current column template.
$template = $column->getTemplate();
// Reset to the default column template.
$column->setTemplate('controllers/grid/gridCell.tpl');
// Render the cell.
$renderedCell = parent::render($request, $row, $column);
// Restore the original column template.
$column->setTemplate($template);
return $renderedCell;
} else {
return '';
}
}
示例4: getCellActions
/**
* @copydoc GridCellProvider::getCellActions()
*/
function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
{
$submissionFile = $row->getData();
assert(is_a($submissionFile, 'SubmissionFile'));
switch ($column->getId()) {
case 'name':
import('lib.pkp.controllers.grid.files.FileNameGridColumn');
$fileNameColumn = new FileNameGridColumn(true, WORKFLOW_STAGE_ID_PRODUCTION, true);
// Set the row data as expected in FileNameGridColumn object.
$rowData = array('submissionFile' => $submissionFile);
$row->setData($rowData);
$actions = $fileNameColumn->getCellActions($request, $row);
// Back the row data as expected by the signoff grid.
$row->setData($submissionFile);
return $actions;
case 'approved':
return array($this->_getApprovedCellAction($request, $submissionFile, $this->getCellState($row, $column)));
}
return parent::getCellActions($request, $row, $column, $position);
}
示例5: getCellActions
/**
* @copydoc GridCellProvider::getCellActions()
*/
function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
{
switch ($column->getId()) {
case 'enabled':
$plugin = $row->getData();
/* @var $plugin Plugin */
$requestArgs = array_merge(array('plugin' => $plugin->getName()), $row->getRequestArgs());
switch (true) {
case $plugin->getEnabled() && $plugin->getCanDisable():
// Create an action to disable the plugin
import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
return array(new LinkAction('disable', new RemoteActionConfirmationModal($request->getSession(), __('grid.plugin.disable'), __('common.disable'), $request->url(null, null, 'disable', null, $requestArgs)), __('manager.plugins.disable'), null));
break;
case !$plugin->getEnabled() && $plugin->getCanEnable():
// Create an action to enable the plugin
import('lib.pkp.classes.linkAction.request.AjaxAction');
return array(new LinkAction('enable', new AjaxAction($request->url(null, null, 'enable', null, $requestArgs)), __('manager.plugins.enable'), null));
break;
}
}
return parent::getCellActions($request, $row, $column, $position);
}
示例6: FilterGridCellProvider
/**
* Constructor
*/
function FilterGridCellProvider()
{
parent::GridCellProvider();
}
示例7: ColumnBasedGridCellProvider
/**
* Constructor
*/
function ColumnBasedGridCellProvider()
{
parent::GridCellProvider();
}
示例8: getCellActions
/**
* @copydoc GridCellProvider::getCellActions()
*/
function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT)
{
if ($column->getId() == 'enabled') {
$plugin = $row->getData();
/* @var $plugin Plugin */
$router = $request->getRouter();
$managementVerbs = $plugin->getManagementVerbs();
if (!is_null($managementVerbs)) {
foreach ($managementVerbs as $verb) {
list($verbName, $verbLocalizedName) = $verb;
$actionArgs = array_merge(array('plugin' => $plugin->getName(), 'verb' => $verbName), $row->getRequestArgs());
$actionRequest = null;
$defaultUrl = $router->url($request, null, null, 'plugin', null, $actionArgs);
if ($verbName === 'enable') {
import('lib.pkp.classes.linkAction.request.AjaxAction');
$actionRequest = new AjaxAction($defaultUrl);
} else {
if ($verbName === 'disable') {
import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
$actionRequest = new RemoteActionConfirmationModal(__('grid.plugin.disable'), __('common.disable'), $defaultUrl);
}
}
if ($actionRequest) {
$linkAction = new LinkAction($verbName, $actionRequest, $verbLocalizedName, null);
return array($linkAction);
}
}
}
// Plugin can't be disabled or don't have
// management verbs for that.
return array();
}
return parent::getCellActions($request, $row, $column, $position);
}
示例9: UserListbuilderGridCellProvider
/**
* Constructor
*/
function UserListbuilderGridCellProvider()
{
parent::GridCellProvider();
}
示例10: MastheadGridCellProvider
/**
* Constructor
*/
function MastheadGridCellProvider()
{
parent::GridCellProvider();
}
示例11: IssueGalleyGridCellProvider
/**
* Constructor
*/
function IssueGalleyGridCellProvider()
{
parent::GridCellProvider();
}
示例12: DateGridCellProvider
/**
* Constructor
* @param $dataProvider DataProvider The object to wrap
* @param $format string See strftime
*/
function DateGridCellProvider($dataProvider, $format)
{
parent::GridCellProvider();
$this->_dataProvider = $dataProvider;
$this->_format = $format;
}
示例13: getCellActions
/**
* 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 LegacyLinkAction instances
*/
function getCellActions(&$request, &$row, &$column, $position = GRID_ACTION_POSITION_DEFAULT)
{
if ($column->getId() == 'name') {
$signoff =& $row->getData();
$submissionFileDao =& DAORegistry::getDAO('SubmissionFileDAO');
/* @var $submissionFileDao SubmissionFileDAO */
if ($signoff->getFileId()) {
$monographFile =& $submissionFileDao->getLatestRevision($signoff->getFileId());
$fileId = $signoff->getFileId();
$router =& $request->getRouter();
$actionArgs = array('gridId' => $row->getGridId(), 'monographId' => $monographFile->getMonographId(), 'fileId' => $fileId);
$userGroupDao =& DAORegistry::getDAO('UserGroupDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
$userGroup =& $userGroupDao->getById($signoff->getUserGroupId());
$user =& $userDao->getUser($signoff->getUserId());
$label = $user->getFullName() . " (" . $userGroup->getLocalizedName() . ") - " . $monographFile->getLocalizedName();
$action = new LegacyLinkAction('downloadFile', LINK_ACTION_MODE_LINK, LINK_ACTION_TYPE_NOTHING, $router->url($request, null, null, 'downloadFile', null, $actionArgs), null, $label);
return array($action);
} else {
$fileId = $monographFile = null;
return null;
}
}
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)
{
$element = $row->getData();
switch ($column->getId()) {
case 'name':
$router = $request->getRouter();
return array(new LinkAction('moreInformation', new AjaxModal($router->url($request, null, null, 'viewPlugin', null, array('rowId' => $row->getId() + 1)), $element->getLocalizedName(), 'modal_information', true), $element->getLocalizedName(), 'details'));
}
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)
{
$staticPage = $row->getData();
switch ($column->getId()) {
case 'path':
$dispatcher = $request->getDispatcher();
return array(new LinkAction('details', new RedirectAction($dispatcher->url($request, ROUTE_PAGE, null) . '/' . $staticPage->getPath(), 'staticPage'), $staticPage->getPath()));
default:
return parent::getCellActions($request, $row, $column, $position);
}
}