public function get_antispam_values() { if ($this->antispam !== false) { return $this->antispam; } $antispam = array(); if (file_exists(PerchUtil::file_path(PERCH_PATH . $this->templatePath))) { $template = $this->_get_template_content(); $TemplatedForm = new PerchTemplatedForm($template); $TemplatedForm->refine($this->formID); $fields = $TemplatedForm->get_fields(); if (PerchUtil::count($fields)) { foreach ($fields as $Tag) { if ($Tag->antispam()) { $key = $Tag->antispam(); $incoming_attr = $Tag->id(); if ($Tag->name()) { $incoming_attr = $Tag->name(); } if (isset($this->data[$incoming_attr])) { if (isset($antispam[$key])) { $antispam[$key] .= ' ' . $this->data[$incoming_attr]; } else { $antispam[$key] = $this->data[$incoming_attr]; } } } } } } $this->antispam = $antispam; return $antispam; }
public function render_forms($html, $vars = array()) { if (strpos($html, 'perch:form ') !== false) { $Form = new PerchTemplatedForm($html); $html = $Form->render($vars); } return $html; }