Ejemplo n.º 1
0
 /**
  * Method render
  * @access public
  * @param boolean $ajax_render [default value: false]
  * @return string html code of object Editor
  * @since 1.0.36
  */
 public function render($ajax_render = false)
 {
     $html = "";
     if ($this->class_name != "") {
         if (!$ajax_render) {
             $html .= "<div id=\"wsp_editor_" . $this->name . "\">\n";
         }
         $html .= "<textarea name=\"" . $this->getEventObjectName() . "\" id=\"" . $this->name . "\"";
         $html .= " style=\"height:";
         if ($this->height != "") {
             $html .= $this->height;
         } else {
             $html .= "100";
         }
         $html .= "px;width:";
         if ($this->width != "") {
             $html .= $this->width . "px";
         } else {
             $html .= "98%";
         }
         $html .= ";\">";
         if ($this->form_object != null) {
             $hidden_text = new TextBox($this->form_object, "hidden_" . $this->name);
         } else {
             $hidden_text = new TextBox($this->page_object, "hidden_" . $this->name);
         }
         $html .= $this->getValue() . "</textarea>\n";
         $hidden_text->setStyle("display:none;")->forceEmpty();
         $html .= $hidden_text->render() . "\n";
         if (!$ajax_render) {
             $html .= "</div>\n";
             $html .= $this->getJavascriptTagOpen();
             $html .= $this->getCreateEditorJs();
             $html .= $this->getJavascriptTagClose();
             if ($this->live_validation != null) {
                 $html .= $this->live_validation->render();
             }
         } else {
             // For Ajax render: Extract JavaScript from HTML
             $array_ajax_render = extract_javascript($this->live_validation->render());
             for ($i = 1; $i < sizeof($array_ajax_render); $i++) {
                 new JavaScript($array_ajax_render[$i], true);
             }
         }
     }
     $this->object_change = false;
     return $html;
 }