_title = $title; $this->_titleTranslated = $titleTranslated; $this->_template = $template; } // // Setters/Getters // /** * Get the column title * * @return string */ public function getTitle() { return $this->_title; } /** * Set the column title (already translated) * * @param string $title */ public function setTitle($title) { $this->_title = $title; } /** * Set the column title (already translated) */ public function setTitleTranslated($titleTranslated) { $this->_titleTranslated = $titleTranslated; } /** * Get the translated column title * * @return string */ public function getLocalizedTitle() { if ($this->_titleTranslated) { return $this->_titleTranslated; } return __($this->_title); } /** * get the column's cell template * * @return string */ public function getTemplate() { return $this->_template; } /** * set the column's cell template * * @param string $template */ public function setTemplate($template) { $this->_template = $template; } /** * @see GridBodyElement::getCellProvider() */ public function getCellProvider() { if (is_null(parent::getCellProvider())) { // provide a sensible default cell provider $cellProvider = new ArrayGridCellProvider(); $this->setCellProvider($cellProvider); } return parent::getCellProvider(); } /** * Get cell actions for this column. * * NB: Subclasses have to override this method to * actually provide cell-specific actions. The default * implementation returns an empty array. * * @param \PKP\controllers\grid\GridRow $row The row for which actions are * being requested. * * @return array An array of LinkActions for the cell. */ public function getCellActions($request, $row, $position = GridHandler::GRID_ACTION_POSITION_DEFAULT) { // The default implementation returns an empty array return []; } } if (!PKP_STRICT_MODE) { class_alias('\PKP\controllers\grid\GridColumn', '\GridColumn'); foreach ([ 'COLUMN_ALIGNMENT_LEFT', 'COLUMN_ALIGNMENT_CENTER', 'COLUMN_ALIGNMENT_RIGHT', ] as $constantName) { define($constantName, constant('\GridColumn::' . $constantName)); } }