getConf(); $this->template = $conf['template']; $this->pdf = $conf['pdf'] ?? false; $this->hideform = $conf['hideform'] ?? false; $this->filename = $conf['filename'] ?? ''; $this->helper_structodt = plugin_load('helper', 'structodt'); } /** * Adds additional info to document and renderer in XHTML mode * * We add the schema name as data attribute * * @see finishScope() */ public function startScope() { // unique identifier for this aggregation $this->renderer->info['struct_table_hash'] = md5(var_export($this->data, true)); if ($this->mode != 'xhtml') return; $table = hsc($this->columns[0]->getTable()); $config = $this->searchConfig->getConf(); if (isset($config['filter'])) unset($config['filter']); $config = hsc(json_encode($config)); $filetype = $this->pdf ? 'pdf' : 'odt'; $template = hsc(json_encode($this->template)); $hideform = ''; if ($this->hideform) { $hideform = 'hideform'; } $filename = hsc($this->filename); // wrapping div $this->renderer->doc .= "
"; // unique identifier for this aggregation $this->renderer->info['struct_table_hash'] = md5(var_export($this->data, true)); } /** * Adds PDF export controls */ protected function renderExportControls() { global $ID; parent::renderExportControls(); if($this->mode != 'xhtml') return; if(!$this->resultCount) return; // FIXME apply dynamic filters $urlParameters = array( 'do' => 'structodt', 'action' => 'renderAll', 'template_string' => hsc(json_encode($this->template)), 'filename' => $this->filename ); foreach($this->data['schemas'] as $key => $schema) { $urlParameters['schema[' . $key . '][0]'] = $schema[0]; $urlParameters['schema[' . $key . '][1]'] = $schema[1]; } foreach($this->data['filter'] as $i => $filter) { foreach ($filter as $j => $value) { $urlParameters["filter[$i][$j]"] = $value; } } $margin=0; if (!empty($this->data['csv'])) { $margin = 10; } $href = wl($ID, $urlParameters); $this->renderer->doc .= '' . $this->helper_structodt->getLang('btn_downloadAll') . ''; if ($this->pdf) { $urlParameters['format'] = 'pdf'; $href = wl($ID, $urlParameters); $this->renderer->doc .= '' . $this->helper_structodt->getLang('btn_downloadAll') . ''; } } }