. */ require_once('ExportToHtmlTemplate.php'); require_once('CFDBExport.php'); require_once('ExportToHtmlTemplate.php'); class ExportEntry extends ExportToHtmlTemplate implements CFDBExport { var $submitTime; var $tableId = 'cfdb_entry'; /** * @param $formName string * @param $options array of option_name => option_value * @return void */ public function export($formName, $options = null) { if (!isset($options['submit_time'])) { return; } $this->submitTime = $options['submit_time']; unset($options['submit_time']); $options['content'] = 'TO BE REPLACED'; $options['filter'] = 'submit_time=' . $this->submitTime; parent::export($formName, $options); } public function modifyContent($template) { $cssUrl = $this->plugin->getPluginDirUrl() . '/css/misctable.css'; $cssTag = ''; $javascript = ''; if ($this->plugin->isEditorActive()) { $cfdbEditUrl = $this->plugin->getAdminUrlPrefix('admin-ajax.php') . 'action=cfdb-edit'; $cfdbGetValueUrl = $this->plugin->getAdminUrlPrefix('admin-ajax.php') . 'action=cfdb-getvalue'; $loadImg = plugins_url('/../contact-form-to-database-extension-edit/img/load.gif', __FILE__); $javascript = sprintf( ' ', $this->tableId, $cfdbEditUrl, $cfdbGetValueUrl, $loadImg); } $template = "{{BEFORE}}$cssTag{{/BEFORE}}" ; $template .= ''; $cols = $this->dataIterator->getDisplayColumns(); foreach ($cols as $aCol) { $colDisplayValue = $aCol; if ($this->headers && isset($this->headers[$aCol])) { $colDisplayValue = $this->headers[$aCol]; } $template .= sprintf('', $colDisplayValue, $aCol, $this->submitTime, $aCol, $aCol); } $template .= '
%s
${%s}
'; $template .= "{{AFTER}}$javascript{{/AFTER}}"; return $template; } }