public function textarea_tags() { $tags = explode_trim(',', $this->value); if (is_array($tags)) { foreach ($tags as $key => $tag) { $tag = strtolower($tag); $tags[$key] = preg_replace('/[\\W]+/', '_', $tag); } } $tags = implode_trim(',', $tags); return array('@cdata' => $tags); }
private function multi_code() { $this->schema['desc'] = $this->matrix->explodeTrim("\n", $this->schema['desc']); $options = $this->matrix->explodeTrim("\n", $this->schema['options']); $keys = $this->get_multi_keys($this->schema['rows']); $labels = !empty($this->schema['labels']) ? $this->matrix->explodeTrim("\n", $this->schema['labels']) : array(); $values = explode_trim("\n", $this->value); ?> <script> <?php for ($s = 0; $s < count($keys); $s++) { ?> editAreaLoader.init({ id: '<?php echo $this->id; ?> _<?php echo $s; ?> ', start_highlight: true, allow_resize: "both", allow_toggle: true, word_wrap: true, language: "en", syntax: "php" }); <?php } ?> </script> <span class="multi_code"> <?php $s = 0; foreach ($keys as $i => $val) { // value $value = 0; if (isset($values[$i])) { $value = $values[$i]; } elseif (isset($values[$s])) { $value = $values[$s]; } ?> <?php if (!empty($labels) && isset($labels[$s])) { ?> <label><?php echo $labels[$s]; ?> : </label><?php } ?> <textarea class="text" id="<?php echo $this->id . '_' . $s; ?> " name="<?php echo $this->id; ?> []" <?php echo $this->properties; ?> ><?php echo $value; ?> </textarea> <?php $s++; } ?> </span> <?php }