function on_every_time() { $session_loki_val = $this->controller->get_form_data('newsletter_loki'); if (empty($session_loki_val)) { $dump = $this->controller->get_all_form_data(); $exporter = new NewsletterExporter(assemble_data($dump)); $exported_newsletter = $exporter->export($this->controller->get_form_data('templateChooser')); $this->set_value('newsletter_loki', $exported_newsletter); } else { $this->set_value('newsletter_loki', $session_loki_val); } }
function pre_show_form() { echo "<h1>Step Three — Select a Template</h1>"; echo "<p>Select a template from the choices below.</p>"; echo '<div id="previewDiv">'; $dump = $this->controller->get_all_form_data(); $exporter = new NewsletterExporter(assemble_data($dump)); $formats = $exporter->get_export_formats(); foreach ($formats as $format => $info) { echo '<h3 class="templateName">' . $info['name'] . "</h3>"; echo '<div id="' . $format . '" name="' . $info['name'] . '" class="newsletterTemplate">'; echo $exporter->export($format); echo "</div>"; echo '<br class="templateName" />'; } echo "</div>"; }