function template() { $tpl = parent::template(); $button = $this->button->template(); $tpl->control->addChild('button', $button); return $tpl; }
function __construct($instance, $format = '%Y-%m-%d') { parent::__construct($instance); $this->data = array_merge($this->data, $instance->getDateArray()); $this->setFormat($format); $this->setDojoType('wtk.form.control.Date'); }
/** * @compact = NULL => auto */ function __construct($instance, $compact = NULL) { parent::__construct($instance); if (!$instance instanceof Wtk_Form_Model_Instance_Enum) { throw new Exception(__CLASS__ . ' needs an Enum instance'); } $this->setItems($this->instance->getItems()); $this->setCompact($compact); $this->multiple = $instance->getMultiple(); if ($this->multiple) { $this->addFlags('multiple'); } $this->select($this->instance->get()); }
function __construct($instance, $model) { parent::__construct($instance); // récupération des colonnes $row = $instance->rewind(); $columns = array(); if ($row) { foreach ($row as $cell) { $columns[$cell->id] = $cell->label; } } // création du model du tableau $this->tm = new Wtk_Table_Model($columns); foreach ($instance as $row) { $args = array(); foreach ($row as $cell) { $args[] = $cell; } call_user_func_array(array($this->tm, 'append'), $args); } // création de la vue $this->table = new Wtk_Table($this->tm); $this->table->addFlags('form', 'control'); $this->table->setDojoType("wtk.form.control.Table"); $this->table->setRowDojoType("wtk.form.control.TableRow"); if ($instance->reorderable) { $this->table->addFlags('reorderable'); } if ($instance->extensible) { $this->table->addFlags('extensible'); } if ($row) { foreach ($model as $name => $conf) { $class = $conf[0]; $args = array_slice($conf, 1); $this->table->addColumn(new Wtk_Table_Column($columns[$name], new Wtk_Table_CellRenderer_Control($class, $args, $name))); } } }
function __construct(Wtk_Form_Model_Instance $instance) { parent::__construct($instance); $this->value = $instance->getHex(); }
function __construct($instance) { parent::__construct($instance); }
function controlTemplate() { /* On utilise le template Entry, même pour les sous-classes. */ return parent::elementTemplate(get_class()); }
function __construct($instance) { parent::__construct($instance); $this->caption = null; }