Exemple #1
0
 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');
 }
Exemple #2
0
 function __construct(Wtk_Form_Model_Instance $instance, $button = null)
 {
     parent::__construct($instance);
     if (!$button) {
         $button = new Wtk_Form_Button("Téléverser");
         $button->addFlags('label');
     }
     $this->button = $button;
     $this->tooltip = "Taille maximale : " . ini_get('upload_max_filesize');
 }
Exemple #3
0
 /**
  * @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());
 }
Exemple #4
0
 function __construct($instance, $width = 12, $height = 1, $suffix = '')
 {
     parent::__construct($instance);
     $this->setSize($width, $height);
     $this->useSuffix($suffix);
     /* Calcule le type HTML depuis le nom de la classe. */
     $klass = get_called_class();
     if ($klass == get_class()) {
         $this->type = 'text';
     } else {
         $parts = explode('_', $klass);
         $this->type = strtolower(end($parts));
     }
     $this->placeholder = null;
     $this->pattern = null;
 }
Exemple #5
0
 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)));
         }
     }
 }
Exemple #6
0
 function __construct(Wtk_Form_Model_Instance $instance)
 {
     parent::__construct($instance);
     $this->value = $instance->getHex();
 }
Exemple #7
0
 function __construct($instance)
 {
     parent::__construct($instance);
 }
Exemple #8
0
 function __construct($instance)
 {
     parent::__construct($instance);
     $this->caption = null;
 }