getConf(); $this->template = $conf['template']; $this->pdf = $conf['pdf']; $this->helper_structodt = plugin_load('helper', 'structodt'); } /** * Adds additional info to document and renderer in XHTML mode * * @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 = $this->columns[0]->getTable(); $filetype = $this->pdf ? 'pdf' : 'odt'; // wrapping div $this->renderer->doc .= '
'; } /** * Adds PDF export controls */ protected function renderExportControls() { global $ID; parent::renderExportControls(); if($this->mode != 'xhtml') return; if(!$this->data['pdf']) return; if(!$this->resultCount) return; // FIXME apply dynamic filters $urlParameters = array( 'do' => 'structodt', 'action' => 'renderAll', 'template_string' => $this->template ); 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; } } $href = wl($ID, $urlParameters); $style=''; if (!empty($this->data['csv'])) { $style='style="margin-left: 10em;"'; } $this->renderer->doc .= ''.$this->helper_structodt->getLang('btn_downloadAll').''; } }