예제 #1
0
파일: Formulaire.php 프로젝트: doorgets/cms
 public function textarea($label, $name, $value = "", $class = "", $style = '', $placeholder = '')
 {
     $rest = substr($name, -8);
     $restHtml = substr($name, -5);
     if (($rest === '_tinymce' || $restHtml === '_html') && !empty($this->i)) {
         $value = $value;
     }
     if ($rest !== '_tinymce' && $restHtml !== '_html' && $restHtml !== '_nofi') {
         $value = Convertag::in($value);
     }
     $valueTemp = $value;
     $name = $this->name . '_' . $name;
     $style = '';
     $styleLabel = '';
     if (isset($_POST[$name])) {
         $value = $_POST[$name];
         if (!empty($this->e[$name])) {
             $styleLabel = 'style="color:#ff0000;"';
             $style = 'style=" border:solid 2px #ff0000; "';
             $value = $valueTemp;
         }
     }
     $textarea = '';
     if (!empty($label)) {
         $textarea = '<label ' . $styleLabel . ' >' . $label . '</label>';
     }
     $placeholder = !empty($placeholder) ? ' placeholder="' . $placeholder . '" ' : '';
     $textarea .= '<textarea id="' . $name . '" name="' . $name . '" ' . $placeholder . ' class="input-control ' . $class . '" ' . $style . ' >' . $value . '</textarea>';
     return $textarea;
 }