aboutsummaryrefslogtreecommitdiff
path: root/h-source/Library/Form/File.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-05-08 15:26:22 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-05-08 15:26:22 +0000
commitafc02bc1c3db9ffe8c9bf660c8aa08666752edfb (patch)
tree9a02b06b390dd0c1e796474b888e92c245473424 /h-source/Library/Form/File.php
parent7fdac301801bc44f6fdb343187413bdfd2d5366c (diff)
h-source:added new EasyGiant SVN version
Diffstat (limited to 'h-source/Library/Form/File.php')
-rw-r--r--h-source/Library/Form/File.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/h-source/Library/Form/File.php b/h-source/Library/Form/File.php
new file mode 100644
index 0000000..48030f7
--- /dev/null
+++ b/h-source/Library/Form/File.php
@@ -0,0 +1,47 @@
+<?php
+
+// EasyGiant, a web software to build a community of people that want to share their hardware information.
+// Copyright (C) 2009 - 2010 Antonio Gallo (h-source-copyright.txt)
+//
+// This file is part of EasyGiant
+//
+// EasyGiant is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// EasyGiant is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with EasyGiant. If not, see <http://www.gnu.org/licenses/>.
+
+if (!defined('EG')) die('Direct access not allowed!');
+
+//create the HTML of a file upload entry
+class Form_File extends Form_Entry
+{
+
+ public function __construct($entryName = null)
+ {
+ $this->entryName = $entryName;
+ }
+
+ public function render($value = null)
+ {
+ $wrap = $this->getWrapElements($value);
+ $returnString = $wrap[0];
+ $returnString .= "<div class='".$this->getEntryClass()."'>\n\t";
+ $returnString .= $wrap[1];
+ $returnString .= $this->getLabelTag();
+ $returnString .= $wrap[2];
+ $returnString .= Html_Form::fileUpload($this->entryName, $value, $this->className, $this->idName);
+ $returnString .= $wrap[3];
+ $returnString .="</div>\n";
+ $returnString .= $wrap[4];
+ return $returnString;
+ }
+
+}