GridHandler::initialize PHP Méthode

initialize() public méthode

See also: PKPHandler::initialize()
public initialize ( $request, $args = null )
$request PKPRequest
$args array optional
    function initialize($request, $args = null)
    {
        parent::initialize($request, $args);
        // Load grid-specific translations
        AppLocale::requireComponents(LOCALE_COMPONENT_PKP_GRID, LOCALE_COMPONENT_APP_COMMON);
        if ($this->getFilterForm() && $this->isFilterFormCollapsible()) {
            import('lib.pkp.classes.linkAction.request.NullAction');
            $this->addAction(new LinkAction('search', new NullAction(), __('common.search'), 'search_extras_expand'));
        }
        // Give a chance to grid add features before calling hooks.
        // Because we must control when features are added to a grid,
        // this is the only place that should use the _addFeature() method.
        $this->_addFeatures($this->initFeatures($request, $args));
        $this->callFeaturesHook('gridInitialize', array('grid' => &$this));
    }

Usage Example

 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));
 }
All Usage Examples Of GridHandler::initialize