/** * @copydoc GridHandler::initialize() */ function initialize($request) { parent::initialize($request); // Load language components AppLocale::requireComponents(LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_PKP_COMMON, LOCALE_COMPONENT_APP_MANAGER); // Basic grid configuration $this->setTitle('common.plugins'); // Set the no items row text $this->setEmptyRowText('grid.noItems'); // Columns import('lib.pkp.controllers.grid.plugins.PluginGridCellProvider'); $pluginCellProvider = new PluginGridCellProvider(); $this->addColumn(new GridColumn('name', 'common.name', null, null, $pluginCellProvider, array('multiline' => true, 'showTotalItemsNumber' => true, 'collapseAllColumnsInCategories' => true))); $descriptionColumn = new GridColumn('description', 'common.description', null, null, $pluginCellProvider); $descriptionColumn->addFlag('html', true); $this->addColumn($descriptionColumn); $this->addColumn(new GridColumn('enabled', 'common.enabled', null, 'controllers/grid/common/cell/selectStatusCell.tpl', $pluginCellProvider)); $router = $request->getRouter(); // Grid level actions. $userRoles = $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES); if (in_array(ROLE_ID_SITE_ADMIN, $userRoles)) { import('lib.pkp.classes.linkAction.request.AjaxModal'); // Install plugin. $this->addAction(new LinkAction('upload', new AjaxModal($router->url($request, null, null, 'uploadPlugin'), __('manager.plugins.upload'), 'modal_add_file'), __('manager.plugins.upload'), 'add')); } }
/** * Constructor * @param $signoffUserGroup UserGroup The user * group to be represented in this column. */ function FileSignoffGridColumn(&$signoffUserGroup) { // Configure the column. import('lib.pkp.classes.controllers.grid.ColumnBasedGridCellProvider'); $cellProvider = new ColumnBasedGridCellProvider(); parent::GridColumn('signoff-' . $signoffUserGroup->getId(), null, $signoffUserGroup->getLocalizedAbbrev(), 'controllers/grid/common/cell/statusCell.tpl', $cellProvider); }
/** * Configure the grid * @param $request PKPRequest */ function initialize($request) { parent::initialize($request); // Load submission-specific translations AppLocale::requireComponents(LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_APP_DEFAULT, LOCALE_COMPONENT_PKP_DEFAULT); $plugin = $this->getPlugin(); $plugin->addLocaleData(); // Basic grid configuration $this->setTitle('plugins.generic.addThis.grid.title'); // Columns $plugin->import('controllers.grid.AddThisStatisticsGridCellProvider'); $cellProvider = new AddThisStatisticsGridCellProvider(); $gridColumn = new GridColumn('url', 'common.url', null, null, $cellProvider, array('width' => 50, 'alignment' => COLUMN_ALIGNMENT_LEFT)); $gridColumn->addFlag('html', true); $this->addColumn($gridColumn); $this->addColumn(new GridColumn('shares', 'plugins.generic.addThis.grid.shares', null, null, $cellProvider)); }
/** * Constructor * @param $selectName string The name of the form parameter * to which the selected files will be posted. */ function FileSelectionGridColumn($selectName) { assert(is_string($selectName) && !empty($selectName)); $this->_selectName = $selectName; import('lib.pkp.classes.controllers.grid.ColumnBasedGridCellProvider'); $cellProvider = new ColumnBasedGridCellProvider(); parent::GridColumn('select', 'common.select', null, 'controllers/grid/gridRowSelectInput.tpl', $cellProvider); }
/** * Constructor * @param $userGroup UserGroup The user * group to be represented in this column. * @param $userGroupsPrefix string A prefix * that uniquely identifies the set of * user group columns. */ function UserGroupColumn(&$userGroup, $userGroupsPrefix) { $this->_userGroup =& $userGroup; // Configure the column. import('lib.pkp.classes.controllers.grid.ColumnBasedGridCellProvider'); $cellProvider = new ColumnBasedGridCellProvider(); parent::GridColumn($userGroupsPrefix . 'Group-' . $userGroup->getId(), null, $userGroup->getLocalizedName(), 'controllers/grid/common/cell/statusCell.tpl', $cellProvider); }
/** * Constructor * @param $id string * @param $title string Localization key * @param $titleTranslated * @param $requestArgs array * @param $flags array */ function BaseSignoffStatusColumn($id = '', $title = null, $titleTranslated = null, $userIds, $requestArgs = array(), $flags = array()) { $this->_requestArgs = $requestArgs; $this->_userIds = $userIds; // Configure the column. import('lib.pkp.classes.controllers.grid.ColumnBasedGridCellProvider'); $cellProvider = new ColumnBasedGridCellProvider(); parent::GridColumn($id, $title, $titleTranslated, 'controllers/grid/common/cell/statusCell.tpl', $cellProvider, $flags); }
/** * Constructor */ function ListbuilderGridColumn($listbuilder, $id = '', $title = null, $titleTranslated = null, $template = null, $cellProvider = null, $flags = array()) { // Set this here so that callers using later optional parameters don't need to // duplicate it. if ($template === null) { $template = 'controllers/listbuilder/listbuilderGridCell.tpl'; } // Make the listbuilder's source type available to the cell template as a flag $flags['sourceType'] = $listbuilder->getSourceType(); parent::GridColumn($id, $title, $titleTranslated, $template, $cellProvider, $flags); }
/** * @copydoc GridColumn::getCellActions() */ function getCellActions($request, $row, $position = GRID_ACTION_POSITION_DEFAULT) { // Retrieve the submission file. $query = $row->getData(); $headNote = $query->getHeadNote(); // Create the cell action to download a file. import('lib.pkp.classes.linkAction.request.AjaxModal'); $router = $request->getRouter(); $actionArgs = array_merge($this->_actionArgs, array('queryId' => $query->getId())); return array_merge(parent::getCellActions($request, $row, $position), array(new LinkAction('readQuery', new AjaxModal($router->url($request, null, null, 'readQuery', null, $actionArgs), $headNote ? $headNote->getTitle() : '—', 'modal_edit'), $headNote && $headNote->getTitle() != '' ? $headNote->getTitle() : '—', null))); }
/** * @copydoc GridColumn::getCellActions() */ function getCellActions($request, $row, $position = GRID_ACTION_POSITION_DEFAULT) { $cellActions = parent::getCellActions($request, $row, $position); // Retrieve the submission file. $submissionFileData =& $row->getData(); assert(isset($submissionFileData['submissionFile'])); $submissionFile = $submissionFileData['submissionFile']; /* @var $submissionFile SubmissionFile */ // Create the cell action to download a file. import('lib.pkp.controllers.api.file.linkAction.DownloadFileLinkAction'); $cellActions[] = new DownloadFileLinkAction($request, $submissionFile, $this->_getStageId()); return $cellActions; }
function CreateInstance($_instance = null) { if ($_instance === null) { $_instance = new GridPercentageColumn(); } parent::CreateInstance($_instance); $_instance->MaxValue = $this->MaxValue; $_instance->BackCss = $this->BackCss; $_instance->FrontCss = $this->FrontCss; $_instance->BarWidth = $this->BarWidth; $_instance->BarHeight = $this->BarHeight; $_instance->BackColor = $this->BackColor; $_instance->FrontColor = $this->FrontColor; return $_instance; }
/** * @copydoc GridColumn::getCellActions() */ function getCellActions($request, $row, $position = GRID_ACTION_POSITION_DEFAULT) { $cellActions = parent::getCellActions($request, $row, $position); // Retrieve the submission file. $submissionFileData =& $row->getData(); assert(isset($submissionFileData['submissionFile'])); $submissionFile = $submissionFileData['submissionFile']; /* @var $submissionFile SubmissionFile */ // Create the cell action to download a file. import('lib.pkp.controllers.api.file.linkAction.DownloadFileLinkAction'); $cellActions[] = new DownloadFileLinkAction($request, $submissionFile, $this->_getStageId()); if ($this->_getIncludeNotes()) { import('lib.pkp.controllers.informationCenter.linkAction.FileNotesLinkAction'); $user = $request->getUser(); $cellActions[] = new FileNotesLinkAction($request, $submissionFile, $user, $this->_getStageId(), $this->_removeHistoryTab); } return $cellActions; }
/** * Constructor */ function __construct($userGroup, $flags = array()) { $this->_userGroup = $userGroup; $cellProvider = new ColumnBasedGridCellProvider(); parent::__construct('userGroup-' . $userGroup->getId(), null, $userGroup->getLocalizedName(), 'controllers/grid/common/cell/statusCell.tpl', $cellProvider, $flags); }
public static function columns(&$grid, $columns) { // foreach ($columns as $k => $v) { $html = false; $alias = false; $field = $k; $visible = true; $sortable = true; $width = 0; $function = false; if (is_array($v)) { if (isset($v['field'])) { $alias = $k; $field = $v['field']; } else { if (isset($v['alias'])) { $alias = $v['alias']; } } $html = isset($v['html']) ? $v['html'] : false; $label = isset($v['label']) ? $v['label'] : $field; $width = isset($v['width']) ? (int) $v['width'] : 0; $sortable = isset($v['sortable']) ? (bool) $v['sortable'] : true; $visible = isset($v['visible']) ? (bool) $v['visible'] : true; $function = isset($v['function']) ? $v['function'] : false; } else { $field = $k; $label = $v; } // prepare column object $column = new GridColumn(); // set a css class for this column if (isset($v['class']) && $v['class']) { $column->setCssClass($v['class']); } $column->setHtml($html); $column->setAlias($alias); $column->setField($field); $column->setLabel($label); $column->setWidth($width); $column->setSortable($sortable); $column->setVisible($visible); $column->setFunction($function); //$column->setReadOnly(false); // $grid->addColumn($column); } }
/** * Constructor */ function __construct() { import('lib.pkp.classes.controllers.grid.ColumnBasedGridCellProvider'); $cellProvider = new ColumnBasedGridCellProvider(); parent::__construct('type', 'common.component', null, null, $cellProvider); }
/** * Constructor */ function FileGenreGridColumn() { import('lib.pkp.classes.controllers.grid.ColumnBasedGridCellProvider'); $cellProvider = new ColumnBasedGridCellProvider(); parent::GridColumn('type', 'common.element', null, null, $cellProvider); }
function initialize($request) { parent::initialize($request); AppLocale::requireComponents(LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_APP_MANAGER); // Basic grid configuration $this->setTitle('grid.content.navigation.footer'); // Set the no items row text $this->setEmptyRowText('grid.content.navigation.footer.noneExist'); $context = $request->getContext(); $this->setContext($context); // Columns import('lib.pkp.controllers.grid.content.navigation.FooterGridCellProvider'); $footerLinksGridCellProvider = new FooterGridCellProvider(); $gridColumn = new GridColumn('title', 'common.title', null, 'controllers/grid/gridCell.tpl', $footerLinksGridCellProvider, array()); $gridColumn->addFlag('html', true); $this->addColumn($gridColumn); // Add grid action. $router = $request->getRouter(); import('lib.pkp.classes.linkAction.request.AjaxModal'); $this->addAction(new LinkAction('addFooterCategoryLink', new AjaxModal($router->url($request, null, null, 'addFooterCategory', null, null), __('grid.content.navigation.footer.addCategory'), 'modal_add_item', true), __('grid.content.navigation.footer.addCategory'), 'add_item')); }