/** * Adds the attribute / field to the list header. This includes the column name and search field. * * Framework method. It should not be necessary to call this method directly. * * @param string $action the action that is being performed on the node * @param array $arr reference to the the recordlist array * @param string $fieldprefix the fieldprefix * @param int $flags the recordlist flags * @param array $atksearch the current ATK search list (if not empty) * @param ColumnConfig $columnConfig Column configuration object * @param DataGrid $grid The DataGrid this attribute lives on. * @param string $column child column (null for this attribute, * for this attribute and all childs) * * @throws Exception on invalid list column */ public function addToListArrayHeader($action, &$arr, $fieldprefix, $flags, $atksearch, $columnConfig, DataGrid $grid = null, $column = '*') { if ($column != null && $column != '*') { throw new Exception("Invalid list column {$column} for " . get_class($this) . ' ' . $this->getOwnerInstance()->atkNodeUri() . '::' . $this->fieldName()); } if (!$this->hasFlag(self::AF_HIDE_LIST) && !($this->hasFlag(self::AF_HIDE_SELECT) && $action == 'select')) { $key = $fieldprefix . $this->fieldName(); $arr['heading'][$key]['title'] = $this->label(); if ($grid->hasFlag(DataGrid::SORT) && !$this->hasFlag(self::AF_NO_SORT)) { $arr['heading'][$key]['order'] = $this->listHeaderSortOrder($columnConfig); } if ($grid->hasFlag(DataGrid::EXTENDED_SORT)) { $arr['sort'][$key] = $this->extendedSort($columnConfig, $fieldprefix, $grid); } if ($grid->hasFlag(DataGrid::SEARCH) && $this->hasFlag(self::AF_SEARCHABLE)) { $fn = $this->fieldName() . '_search'; if (method_exists($this->m_ownerInstance, $fn)) { $arr['search'][$key] = $this->m_ownerInstance->{$fn}($atksearch, false, $fieldprefix, $grid); } else { $arr['search'][$key] = $this->search($atksearch, false, $fieldprefix, $grid); } $arr['search'][$key] .= $this->searchMode(false, $fieldprefix); } } }