/** * Returns an XHTML string for the editor * * @param string $data * @param string $query * @return string XHTML string for the editor */ public function output_html($data, $query='') { $editor = editors_get_preferred_editor(FORMAT_HTML); $editor->set_text($data); $editor->use_editor($this->get_id(), array('noclean'=>true)); return parent::output_html($data, $query); }
/** * Returns an XHTML string for the editor * * @param string $data * @param string $query * @return string XHTML string for the editor */ public function output_html($data, $query = '') { $result = parent::output_html($data, $query); $data = trim($data); if ($data) { $decoded = json_decode($data, true); // Note: it is not very nice to abuse these file classes, but anyway... if (is_array($decoded)) { $valid = '<span class="pathok">✔</span>'; } else { $valid = '<span class="patherror">✘</span>'; } $result = str_replace('</textarea>', '</textarea>' . $valid, $result); } return $result; }