예제 #1
0
 /**
  * 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);
 }
예제 #2
0
파일: adminlib.php 프로젝트: Burick/moodle
 /**
  * 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">&#x2714;</span>';
         } else {
             $valid = '<span class="patherror">&#x2718;</span>';
         }
         $result = str_replace('</textarea>', '</textarea>' . $valid, $result);
     }
     return $result;
 }