Example #1
0
 public function __construct($name, $caption, $value = NULL)
 {
     $id = 'form_field_' . self::$count++;
     $this->create_label($id, $caption);
     $this->input = html_tag::create('textarea');
     $this->input->name = $name;
     $this->input->id = $id;
     $this->input->append($value);
 }
Example #2
0
 public function __construct($link, $caption = NULL)
 {
     parent::__construct('a');
     if ($caption) {
         $this->append($caption);
     }
     $this->href = $link;
     $this->link = parse_url($link);
     parse_str($this->link['query'], $this->args);
 }
Example #3
0
 public function __construct($name, $caption, $options, $value = NULL)
 {
     $id = 'form_field_' . self::$count++;
     $this->create_label($id, $caption);
     $this->input = html_tag::create('select');
     $this->input->name = $name;
     foreach ($options as $k => $v) {
         if ($value != $k) {
             $this->input->append('<option value="' . htmlspecialchars($k) . '">' . htmlspecialchars($v) . '</option>');
         } else {
             $this->input->append('<option value="' . htmlspecialchars($k) . '" selected>' . htmlspecialchars($v) . '</option>');
         }
     }
 }
Example #4
0
 public function add($title, $content = null)
 {
     $id = self::$tab_count++;
     $link = html_tag::create('a')->attr('href', '#tabs-' . $id)->append($title);
     $link->attr('data-toggle', 'tab');
     $this->tabs->append(html_tag::create('li')->append($link));
     $data = html_tag::create('div')->attr('id', 'tabs-' . $id);
     $data->class = 'tab-pane';
     if ($content) {
         $data->append($content);
     }
     $this->content->append($data);
     return $data;
 }
Example #5
0
 public function __construct($name, $caption, $options, $value = NULL)
 {
     $this->label = html_tag::create('div')->append($caption);
     $this->label->class = 'form_label';
     $this->input = array();
     foreach ($options as $k => $v) {
         $id = 'form_field_' . self::$count++;
         $label = html_tag::create('label')->append($v);
         $label->for = $id;
         $input = html_standalone::create('input');
         $input->type = 'radio';
         $input->id = $id;
         $input->value = $k;
         $input->name = $name;
         if ($k == $value) {
             $input->checked = true;
         }
         $this->input[] = array($input, $label);
     }
 }
Example #6
0
 public function __construct($link)
 {
     parent::__construct('ul');
     $this->class = 'nav nav-tabs nav-stacked';
     $this->link = $link instanceof html_link ? $link : new html_link($link);
 }
Example #7
0
 public function __construct()
 {
     parent::__construct('div');
     $this->class = 'grid';
 }
Example #8
0
 protected function create_label($id, $caption)
 {
     $this->label = html_tag::create('label')->append($caption);
     $this->label->for = $id;
     $this->label->class = 'control-label';
 }
Example #9
0
 /**
  * Converts the object into html string
  * @return string
  */
 public function __toString()
 {
     $this->append(html_tag::create('div')->attr('class', 'control-group')->append($this->buttons));
     return parent::__toString();
 }