diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-15 09:21:44 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-15 09:21:44 +0000 |
commit | 4fe895a2c473cd22e4741552186fe2be48503167 (patch) | |
tree | 37ed17128d54142938f38f06b6e6708883ddfd06 /modules/forge/libraries/Form_Checkbox.php | |
parent | 3b35e8b91ce94c292b46a296d034542ac5f0f6da (diff) |
Delete forge in preparation to refresh it from vendors/forge/modified
Diffstat (limited to 'modules/forge/libraries/Form_Checkbox.php')
-rw-r--r-- | modules/forge/libraries/Form_Checkbox.php | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/modules/forge/libraries/Form_Checkbox.php b/modules/forge/libraries/Form_Checkbox.php deleted file mode 100644 index c015e437..00000000 --- a/modules/forge/libraries/Form_Checkbox.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php -/** - * FORGE checkbox input library. - * - * $Id$ - * - * @package Forge - * @author Kohana Team - * @copyright (c) 2007-2008 Kohana Team - * @license http://kohanaphp.com/license.html - */ -class Form_Checkbox_Core extends Form_Input { - - protected $data = array - ( - 'type' => 'checkbox', - 'class' => 'checkbox', - 'value' => '1', - 'checked' => FALSE, - ); - - protected $protect = array('type'); - - public function __get($key) - { - if ($key == 'value') - { - // Return the value if the checkbox is checked - return $this->data['checked'] ? $this->data['value'] : NULL; - } - - return parent::__get($key); - } - - public function label($val = NULL) - { - if ($val === NULL) - { - // Do not display labels for checkboxes, labels wrap checkboxes - return ''; - } - else - { - $this->data['label'] = ($val === TRUE) ? utf8::ucwords(inflector::humanize($this->name)) : $val; - return $this; - } - } - - protected function html_element() - { - // Import the data - $data = $this->data; - - if (empty($data['checked'])) - { - // Not checked - unset($data['checked']); - } - else - { - // Is checked - $data['checked'] = 'checked'; - } - - if ($label = arr::remove('label', $data)) - { - // There must be one space before the text - $label = ' '.ltrim($label); - } - - return '<label>'.form::input($data).$label.'</label>'; - } - - protected function load_value() - { - if (is_bool($this->valid)) - return; - - // Makes the box checked if the value from POST is the same as the current value - $this->data['checked'] = ($this->input_value($this->name) == $this->data['value']); - } - -} // End Form Checkbox
\ No newline at end of file |