Esempio n. 1
0
 public function __construct($name, $title, $link = null, $icon = null)
 {
     // If we have a link; we're actually an <a class='btn'>
     if (isset($link)) {
         $this->_attributes['href'] = $link;
         $this->_tagName = 'a';
         $this->addClass('btn-default');
         unset($this->_attributes['type']);
         if (isset($icon)) {
             $this->_attributes['icon'] = $icon;
         }
     } else {
         if (isset($icon)) {
             $this->_tagSelfClosing = false;
             $this->_tagName = 'button';
             $this->_attributes['value'] = gettext($title);
             $this->_attributes['icon'] = $icon;
         } else {
             $this->_tagSelfClosing = true;
             $this->_attributes['value'] = gettext($title);
             $this->addClass('btn-primary');
         }
     }
     parent::__construct($name, $title, null);
     if (isset($link)) {
         unset($this->_attributes['name']);
     }
 }
Esempio n. 2
0
 public function __construct($name, $form)
 {
     parent::__construct($name, $form);
     $this->attrs['type'] = 'file';
     $this->form->enctype('multipart/form-data');
     $this->extensions = array();
     $this->max_size = 0;
 }
Esempio n. 3
0
 public function __construct($name, $title, $description, $checked, $value = 'yes')
 {
     parent::__construct($name, $title, 'checkbox', $value);
     $this->_description = $description;
     if ($checked) {
         $this->_attributes['checked'] = 'checked';
     }
     $this->column->addClass('checkbox');
 }
Esempio n. 4
0
 public function __construct($name, $title, $value, array $values, $allowMultiple = false)
 {
     if ($allowMultiple) {
         $name .= '[]';
     }
     parent::__construct($name, $title, null);
     if ($allowMultiple) {
         $this->_attributes['multiple'] = 'multiple';
     }
     $this->_value = $value;
     $this->_values = $values;
 }
Esempio n. 5
0
 public function __construct($name, $title, $value, $type = "BOTH")
 {
     parent::__construct($name, $title, 'text', $value);
     switch ($type) {
         case "BOTH":
             $this->_attributes['pattern'] = '[a-f0-9:.]*';
             break;
         case "V4":
             $this->_attributes['pattern'] = '[0-9.]*';
             break;
         case "V6":
             $this->_attributes['pattern'] = '[a-f0-9:]*';
             break;
     }
 }
Esempio n. 6
0
 public function __construct($name, $filename = FALSE)
 {
     parent::__construct($name);
     if (!empty($_FILES[$name])) {
         if (empty($_FILES[$name]['tmp_name']) or is_uploaded_file($_FILES[$name]['tmp_name'])) {
             // Cache the upload data in this object
             $this->upload = $_FILES[$name];
             // Hack to allow file-only inputs, where no POST data is present
             $_POST[$name] = $this->upload['name'];
             // Set the filename
             $this->filename = empty($filename) ? FALSE : $filename;
         } else {
             // Attempt to delete the invalid file
             is_writable($_FILES[$name]['tmp_name']) and unlink($_FILES[$name]['tmp_name']);
             // Invalid file upload, possible hacking attempt
             unset($_FILES[$name]);
         }
     }
 }
Esempio n. 7
0
 public function __construct($name)
 {
     parent::__construct($name);
     $this->error_messages("incorrect-captcha-sol", t("The values supplied to reCAPTCHA are incorrect."));
     $this->error_messages("invalid-site-private-key", t("The site private key is incorrect."));
 }
Esempio n. 8
0
 public function __construct($name, $form)
 {
     parent::__construct($name, $form);
     $this->attrs['type'] = 'checkbox';
 }
Esempio n. 9
0
 public function __construct($name, $title, $value)
 {
     parent::__construct($name, $title, null);
     $this->_value = $value;
 }
Esempio n. 10
0
 public function __construct($name)
 {
     parent::__construct($name);
     $this->data["script_data"] = array("g3sid" => Session::instance()->id(), "user_agent" => Input::instance()->server("HTTP_USER_AGENT"), "csrf" => access::csrf_token());
 }
Esempio n. 11
0
 public function __construct($title, $text)
 {
     parent::__construct(null, $title);
     $this->_text = $text;
 }
Esempio n. 12
0
 public function __construct($name, $title, $value)
 {
     parent::__construct($name, $title, 'text', $value);
     $this->_attributes['pattern'] = '[a-f0-9:.]*';
 }
Esempio n. 13
0
 public function __construct($name, $form)
 {
     parent::__construct($name, $form);
     $this->attrs['type'] = 'hidden';
 }
Esempio n. 14
0
 public function __construct($name, $form)
 {
     parent::__construct($name, $form);
     $this->choices = array();
     unset($this->attrs['type']);
 }
Esempio n. 15
0
 public function __construct($name, $form)
 {
     parent::__construct($name, $form);
     $this->attrs['type'] = 'text';
     $this->autocomplete = true;
 }