summaryrefslogtreecommitdiff
path: root/modules/forge/libraries/Form_Checklist.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-15 09:21:44 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-15 09:21:44 +0000
commit4fe895a2c473cd22e4741552186fe2be48503167 (patch)
tree37ed17128d54142938f38f06b6e6708883ddfd06 /modules/forge/libraries/Form_Checklist.php
parent3b35e8b91ce94c292b46a296d034542ac5f0f6da (diff)
Delete forge in preparation to refresh it from vendors/forge/modified
Diffstat (limited to 'modules/forge/libraries/Form_Checklist.php')
-rw-r--r--modules/forge/libraries/Form_Checklist.php92
1 files changed, 0 insertions, 92 deletions
diff --git a/modules/forge/libraries/Form_Checklist.php b/modules/forge/libraries/Form_Checklist.php
deleted file mode 100644
index 6b1df490..00000000
--- a/modules/forge/libraries/Form_Checklist.php
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-/**
- * FORGE checklist input library.
- *
- * $Id$
- *
- * @package Forge
- * @author Kohana Team
- * @copyright (c) 2007-2008 Kohana Team
- * @license http://kohanaphp.com/license.html
- */
-class Form_Checklist_Core extends Form_Input {
-
- protected $data = array
- (
- 'name' => '',
- 'type' => 'checkbox',
- 'class' => 'checklist',
- 'options' => array(),
- );
-
- protected $protect = array('name', 'type');
-
- public function __construct($name)
- {
- $this->data['name'] = $name;
- }
-
- public function __get($key)
- {
- if ($key == 'value')
- {
- // Return the currently checked values
- $array = array();
- foreach ($this->data['options'] as $id => $opt)
- {
- // Return the options that are checked
- ($opt[1] === TRUE) and $array[] = $id;
- }
- return $array;
- }
-
- return parent::__get($key);
- }
-
- public function render()
- {
- // Import base data
- $base_data = $this->data;
-
- // Make it an array
- $base_data['name'] .= '[]';
-
- // Newline
- $nl = "\n";
-
- $checklist = '<ul class="'.arr::remove('class', $base_data).'">'.$nl;
- foreach (arr::remove('options', $base_data) as $val => $opt)
- {
- // New set of input data
- $data = $base_data;
-
- // Get the title and checked status
- list ($title, $checked) = $opt;
-
- // Set the name, value, and checked status
- $data['value'] = $val;
- $data['checked'] = $checked;
-
- $checklist .= '<li><label>'.form::checkbox($data).' '.$title.'</label></li>'.$nl;
- }
- $checklist .= '</ul>';
-
- return $checklist;
- }
-
- protected function load_value()
- {
- foreach ($this->data['options'] as $val => $checked)
- {
- if ($input = $this->input_value($this->data['name']))
- {
- $this->data['options'][$val][1] = in_array($val, $input);
- }
- else
- {
- $this->data['options'][$val][1] = FALSE;
- }
- }
- }
-
-} // End Form Checklist \ No newline at end of file