summaryrefslogtreecommitdiff
path: root/modules/forge/libraries/Form_Group.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-10-31 22:12:14 +0000
committerBharat Mediratta <bharat@menalto.com>2008-10-31 22:12:14 +0000
commiteba717f95f586d2538007bd18da6e9b32b076c30 (patch)
tree15fc596a270f9de0d163c66c96e3c65fca5ee100 /modules/forge/libraries/Form_Group.php
parentfff10f8b70376ef25722bd867df26bc5aefced43 (diff)
Merge over vendor code.
git-svn-id: http://gallery.svn.sourceforge.net/svnroot/gallery/trunk/eval/gx/gallery3/trunk@18408 57fcd75e-5312-0410-8df3-f5eb6fbb1595
Diffstat (limited to 'modules/forge/libraries/Form_Group.php')
-rw-r--r--modules/forge/libraries/Form_Group.php89
1 files changed, 89 insertions, 0 deletions
diff --git a/modules/forge/libraries/Form_Group.php b/modules/forge/libraries/Form_Group.php
new file mode 100644
index 00000000..0c6dd100
--- /dev/null
+++ b/modules/forge/libraries/Form_Group.php
@@ -0,0 +1,89 @@
+<?php
+/**
+ * FORGE group library.
+ *
+ * $Id$
+ *
+ * @package Forge
+ * @author Kohana Team
+ * @copyright (c) 2007-2008 Kohana Team
+ * @license http://kohanaphp.com/license.html
+ */
+class Form_Group_Core extends Forge {
+
+ protected $data = array
+ (
+ 'type' => 'group',
+ 'name' => '',
+ 'class' => 'group',
+ 'label' => '',
+ 'message' => ''
+ );
+
+ // Input method
+ public $method;
+
+ public function __construct($name = NULL, $class = 'group')
+ {
+ $this->data['name'] = $name;
+ $this->data['class'] = $class;
+
+ // Set dummy data so we don't get errors
+ $this->attr['action'] = '';
+ $this->attr['method'] = 'post';
+ }
+
+ public function __get($key)
+ {
+ if ($key == 'type' || $key == 'name')
+ {
+ return $this->data[$key];
+ }
+ return parent::__get($key);
+ }
+
+ public function __set($key, $val)
+ {
+ if ($key == 'method')
+ {
+ $this->attr['method'] = $val;
+ }
+ $this->$key = $val;
+ }
+
+ public function label($val = NULL)
+ {
+ if ($val === NULL)
+ {
+ if ($label = $this->data['label'])
+ {
+ return $this->data['label'];
+ }
+ }
+ else
+ {
+ $this->data['label'] = ($val === TRUE) ? ucwords(inflector::humanize($this->data['name'])) : $val;
+ return $this;
+ }
+ }
+
+ public function message($val = NULL)
+ {
+ if ($val === NULL)
+ {
+ return $this->data['message'];
+ }
+ else
+ {
+ $this->data['message'] = $val;
+ return $this;
+ }
+ }
+
+ public function render()
+ {
+ // No Sir, we don't want any html today thank you
+ return;
+ }
+
+} // End Form Group \ No newline at end of file