id = $id; $this->mode = $mode; $this->renderer = $renderer; $this->searchConfig = $searchConfig; $this->data = $searchConfig->getConf(); $this->columns = $searchConfig->getColumns(); $this->result = $this->searchConfig->execute(); $this->resultColumnCount = count($this->columns); $this->resultPIDs = $this->searchConfig->getPids(); } /** * Create the list on the renderer */ public function render() { $this->startScope(); $this->renderer->doc .= ''; $this->finishScope(); return; } /** * Adds additional info to document and renderer in XHTML mode * * @see finishScope() */ protected function startScope() { // wrapping div if($this->mode != 'xhtml') return; $this->renderer->doc .= "
"; } /** * Closes anything opened in startScope() * * @see startScope() */ protected function finishScope() { // wrapping div if($this->mode != 'xhtml') return; $this->renderer->doc .= '
'; } /** * @param $resultrow */ protected function renderListItem($resultrow) { $this->renderer->doc .= '
  • '; $sepbyheaders = $this->searchConfig->getConf()['sepbyheaders']; $headers = $this->searchConfig->getConf()['headers']; /** * @var Value $value */ foreach ($resultrow as $column => $value) { if ($value->isEmpty()) { continue; } if ($sepbyheaders && !empty($headers[$column])) { $this->renderer->doc .= '' . hsc($headers[$column]) . ''; } $type = 'struct_' . strtolower($value->getColumn()->getType()->getClass()); $this->renderer->doc .= '
    '; $value->render($this->renderer, $this->mode); if ($column < $this->resultColumnCount) { $this->renderer->doc .= ' '; } $this->renderer->doc .= '
    '; } $this->renderer->doc .= '
  • '; } }