HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
TbInputInline.php
Go to the documentation of this file.
1 <?php
10 Yii::import('booster.widgets.input.TbInputVertical');
11 
21 {
26  protected function dropDownList()
27  {
28  echo $this->form->dropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions);
29  }
30 
35  protected function passwordField()
36  {
37  $this->setPlaceholder();
38  echo $this->getPrepend();
39  echo $this->form->passwordField($this->model, $this->attribute, $this->htmlOptions);
40  echo $this->getAppend();
41  }
42 
47  protected function textArea()
48  {
49  $this->setPlaceholder();
50  echo $this->form->textArea($this->model, $this->attribute, $this->htmlOptions);
51  }
52 
57  protected function textField()
58  {
59  $this->setPlaceholder();
60  echo $this->getPrepend();
61  echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions);
62  echo $this->getAppend();
63  }
64 
69  protected function maskedTextField()
70  {
71  $this->setPlaceholder();
72  echo $this->getPrepend();
73  echo $this->form->maskedTextField($this->model, $this->attribute, $this->data, $this->htmlOptions);
74  echo $this->getAppend();
75  }
76 
81  protected function typeAheadField()
82  {
83  $this->setPlaceholder();
84  echo $this->getPrepend();
85  echo $this->form->typeAheadField($this->model, $this->attribute, $this->data, $this->htmlOptions);
86  echo $this->getAppend();
87  }
88 
94  protected function datepickerField()
95  {
96  if (isset($this->htmlOptions['options'])) {
97  $options = $this->htmlOptions['options'];
98  unset($this->htmlOptions['options']);
99  }
100 
101  if (isset($this->htmlOptions['events'])) {
102  $events = $this->htmlOptions['events'];
103  unset($this->htmlOptions['events']);
104  }
105 
106  echo $this->setPlaceholder();
107  echo $this->getPrepend();
108  $this->widget(
109  'booster.widgets.TbDatePicker',
110  array(
111  'model' => $this->model,
112  'attribute' => $this->attribute,
113  'options' => isset($options) ? $options : array(),
114  'events' => isset($events) ? $events : array(),
115  'htmlOptions' => $this->htmlOptions,
116  )
117  );
118  echo $this->getAppend();
119  echo $this->getError() . $this->getHint();
120  }
121 
127  protected function datetimepickerField()
128  {
129  if (isset($this->htmlOptions['options'])) {
130  $options = $this->htmlOptions['options'];
131  unset($this->htmlOptions['options']);
132  }
133 
134  if (isset($this->htmlOptions['events'])) {
135  $events = $this->htmlOptions['events'];
136  unset($this->htmlOptions['events']);
137  }
138 
139  echo $this->setPlaceholder();
140  echo $this->getPrepend();
141  $this->widget(
142  'booster.widgets.TbDateTimePicker',
143  array(
144  'model' => $this->model,
145  'attribute' => $this->attribute,
146  'options' => isset($options) ? $options : array(),
147  'events' => isset($events) ? $events : array(),
148  'htmlOptions' => $this->htmlOptions,
149  )
150  );
151  echo $this->getAppend();
152  echo $this->getError() . $this->getHint();
153  }
154 
160  protected function dateRangeField()
161  {
162  if (isset($this->htmlOptions['options'])) {
163  $options = $this->htmlOptions['options'];
164  unset($this->htmlOptions['options']);
165  }
166 
167  if (isset($options['callback'])) {
168  $callback = $options['callback'];
169  unset($options['callback']);
170  }
171 
172  echo $this->setPlaceholder();
173  echo $this->getPrepend();
174  $this->widget(
175  'booster.widgets.TbDateRangePicker',
176  array(
177  'model' => $this->model,
178  'attribute' => $this->attribute,
179  'options' => isset($options) ? $options : array(),
180  'callback' => isset($callback) ? $callback : '',
181  'htmlOptions' => $this->htmlOptions,
182  )
183  );
184  echo $this->getAppend();
185  echo $this->getError() . $this->getHint();
186  }
187 
188 
189  protected function setPlaceholder()
190  {
191  if (!isset($this->htmlOptions['placeholder'])) {
192  $this->htmlOptions['placeholder'] = $this->model->getAttributeLabel($this->attribute);
193  }
194  }
195 }