public function getXML($data) { $lines = array(); foreach ((array) $data->{$this->value} as $line) { $lines[] = count($line) > 1 ? $line['href'] . ' ' . $line['name'] : $line['href']; } $this->addClass('form-text'); $this->addClass('resizable'); $this->addClass('nowrap'); return parent::wrapXML(array('rows' => $this->rows, 'cols' => $this->cols), html::cdata(join("\n", $lines))); }
public function __construct(array $form) { if (empty($form['rows'])) { $form['rows'] = 20; } if (empty($form['cols'])) { $form['cols'] = 50; } if (empty($form['description'])) { $form['description'] = t('Для оформления текста можно использовать <a href="@url" target="_blank">синтаксис markdown</a>.', array('@url' => 'http://daringfireball.net/projects/markdown/syntax')); } parent::__construct($form, array('value')); }
public function getXML($data) { return parent::wrapXML(array('type' => 'textarea', 'mode' => 'visual', 'class' => 'visualEditor', 'rows' => $this->rows, 'cols' => $this->cols), html::cdata($data->{$this->value})); }