From 3ff03dc4f0a72432b34c00da620272cf011e4ddd Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 29 Jul 2021 14:17:20 +1000 Subject: Publishing h-node.org code. - this is the h-node.org code, except - removed a js file (3x copies at three different locations) without license / copyright headers - /Js/linkToForm.js - /Public/Js/linkToForm.js - /admin/Public/Js/linkToForm.js - removed config files containing credentials - /Application/Include/params.php - /Config/Config.php - /admin/Application/Include/params.php - /admin/Config/Config.php - added license and copyright header to one php file - /admin/Library/ErrorReporting.php (almost identical to /Library/ErrorReporting.php which has the headers) --- h-source/admin/Library/Form/Checkbox.php | 41 +++++++++++ h-source/admin/Library/Form/Entry.php | 45 ++++++++++++ h-source/admin/Library/Form/Form.php | 116 ++++++++++++++++++++++++++++++ h-source/admin/Library/Form/Hidden.php | 23 ++++++ h-source/admin/Library/Form/Html.php | 23 ++++++ h-source/admin/Library/Form/InputText.php | 30 ++++++++ h-source/admin/Library/Form/Password.php | 30 ++++++++ h-source/admin/Library/Form/Radio.php | 30 ++++++++ h-source/admin/Library/Form/Select.php | 30 ++++++++ h-source/admin/Library/Form/Textarea.php | 30 ++++++++ h-source/admin/Library/Form/index.html | 1 + 11 files changed, 399 insertions(+) create mode 100755 h-source/admin/Library/Form/Checkbox.php create mode 100755 h-source/admin/Library/Form/Entry.php create mode 100755 h-source/admin/Library/Form/Form.php create mode 100755 h-source/admin/Library/Form/Hidden.php create mode 100644 h-source/admin/Library/Form/Html.php create mode 100755 h-source/admin/Library/Form/InputText.php create mode 100644 h-source/admin/Library/Form/Password.php create mode 100755 h-source/admin/Library/Form/Radio.php create mode 100755 h-source/admin/Library/Form/Select.php create mode 100755 h-source/admin/Library/Form/Textarea.php create mode 100644 h-source/admin/Library/Form/index.html (limited to 'h-source/admin/Library/Form') diff --git a/h-source/admin/Library/Form/Checkbox.php b/h-source/admin/Library/Form/Checkbox.php new file mode 100755 index 0000000..5df1917 --- /dev/null +++ b/h-source/admin/Library/Form/Checkbox.php @@ -0,0 +1,41 @@ +entryName = $entryName; + } + + public function render($value = null) + { + $wrap = $this->getWrapElements(); + $returnString = "
\n\t"; + $returnString .= $wrap[0]; + $returnString .= $this->getLabelTag(); + $returnString .= $wrap[1]; + $returnString .= Html_Form::checkbox($this->entryName, $value, $this->options, $this->className,$this->idName); + $returnString .= $wrap[2]; + $returnString .="
\n"; + return $returnString; + } + +} diff --git a/h-source/admin/Library/Form/Entry.php b/h-source/admin/Library/Form/Entry.php new file mode 100755 index 0000000..725235a --- /dev/null +++ b/h-source/admin/Library/Form/Entry.php @@ -0,0 +1,45 @@ + entry or a radio button). Associative array or comma-divided list. + public $defaultValue = ''; + public $wrap = array(); + public $type = null; //the type of the entry + + //create the label of each entry of the form + public function getLabelTag() + { + $labelTagClass = isset($this->labelClass) ? $this->labelClass : 'entryLabel'; + return isset($this->labelString) ? "\n\t" : null; + } + + //get the class of the entry + public function getEntryClass() + { + return isset($this->entryClass) ? $this->entryClass : 'formEntry'; + } + + public function getWrapElements() + { + $wrap[0] = isset($this->wrap[0]) ? $this->wrap[0] : null; + $wrap[1] = isset($this->wrap[1]) ? $this->wrap[1] : null; + $wrap[2] = isset($this->wrap[2]) ? $this->wrap[2] : null; + return $wrap; + } + + abstract public function render($value = null); + +} diff --git a/h-source/admin/Library/Form/Form.php b/h-source/admin/Library/Form/Form.php new file mode 100755 index 0000000..00e27d4 --- /dev/null +++ b/h-source/admin/Library/Form/Form.php @@ -0,0 +1,116 @@ +'value') + public $method = 'POST'; //the transmission method: POST/GET + + public function __construct($action,$submit = array('generalAction'=>'save'),$method = 'POST') + { + $this->action = $action; //action of the form: controller/action + $this->submit = $submit; + $this->method = $method; + } + + //method to manage the $this->entry associative array + //entryType: the type of the object to be initialized, $entryName: the name of the entry + //$options: the list of options (if the entry is a \n\n"; + } + $htmlForm .= "\n"; + return $htmlForm; + } + +} diff --git a/h-source/admin/Library/Form/Hidden.php b/h-source/admin/Library/Form/Hidden.php new file mode 100755 index 0000000..fb81b30 --- /dev/null +++ b/h-source/admin/Library/Form/Hidden.php @@ -0,0 +1,23 @@ +entryName = $entryName; + } + + public function render($value = null) + { + $returnString = Html_Form::hidden($this->entryName, $value); + return $returnString; + } + +} diff --git a/h-source/admin/Library/Form/Html.php b/h-source/admin/Library/Form/Html.php new file mode 100644 index 0000000..dce91c6 --- /dev/null +++ b/h-source/admin/Library/Form/Html.php @@ -0,0 +1,23 @@ +entryName = $entryName; + } + + public function render($value = null) + { + $returnString = "
\n\t$value\n
\n"; + return $returnString; + } + +} diff --git a/h-source/admin/Library/Form/InputText.php b/h-source/admin/Library/Form/InputText.php new file mode 100755 index 0000000..fb98336 --- /dev/null +++ b/h-source/admin/Library/Form/InputText.php @@ -0,0 +1,30 @@ +entryName = $entryName; + } + + public function render($value = null) + { + $wrap = $this->getWrapElements(); + $returnString = "
\n\t"; + $returnString .= $wrap[0]; + $returnString .= $this->getLabelTag(); + $returnString .= $wrap[1]; + $returnString .= Html_Form::input($this->entryName, $value, $this->className, $this->idName); + $returnString .= $wrap[2]; + $returnString .="
\n"; + return $returnString; + } + +} diff --git a/h-source/admin/Library/Form/Password.php b/h-source/admin/Library/Form/Password.php new file mode 100644 index 0000000..76bc735 --- /dev/null +++ b/h-source/admin/Library/Form/Password.php @@ -0,0 +1,30 @@ +entryName = $entryName; + } + + public function render($value = null) + { + $wrap = $this->getWrapElements(); + $returnString = "
\n\t"; + $returnString .= $wrap[0]; + $returnString .= $this->getLabelTag(); + $returnString .= $wrap[1]; + $returnString .= Html_Form::password($this->entryName, null, $this->className); + $returnString .= $wrap[2]; + $returnString .="
\n"; + return $returnString; + } + +} diff --git a/h-source/admin/Library/Form/Radio.php b/h-source/admin/Library/Form/Radio.php new file mode 100755 index 0000000..fb20677 --- /dev/null +++ b/h-source/admin/Library/Form/Radio.php @@ -0,0 +1,30 @@ +entryName = $entryName; + } + + public function render($value = null) + { + $wrap = $this->getWrapElements(); + $returnString = "
\n\t"; + $returnString .= $wrap[0]; + $returnString .= $this->getLabelTag(); + $returnString .= $wrap[1]; + $returnString .= Html_Form::radio($this->entryName,$value,$this->options,$this->className, 'after', $this->idName); + $returnString .= $wrap[2]; + $returnString .="
\n"; + return $returnString; + } + +} diff --git a/h-source/admin/Library/Form/Select.php b/h-source/admin/Library/Form/Select.php new file mode 100755 index 0000000..558fd57 --- /dev/null +++ b/h-source/admin/Library/Form/Select.php @@ -0,0 +1,30 @@ +entryName = $entryName; + } + + public function render($value = null) + { + $wrap = $this->getWrapElements(); + $returnString = "
\n\t"; + $returnString .= $wrap[0]; + $returnString .= $this->getLabelTag(); + $returnString .= $wrap[1]; + $returnString .= Html_Form::select($this->entryName,$value,$this->options,$this->className, $this->idName); + $returnString .= $wrap[2]; + $returnString .="
\n"; + return $returnString; + } + +} diff --git a/h-source/admin/Library/Form/Textarea.php b/h-source/admin/Library/Form/Textarea.php new file mode 100755 index 0000000..d81cc84 --- /dev/null +++ b/h-source/admin/Library/Form/Textarea.php @@ -0,0 +1,30 @@ +entryName = $entryName; + } + + public function render($value = null) + { + $wrap = $this->getWrapElements(); + $returnString = "
\n\t"; + $returnString .= $wrap[0]; + $returnString .= $this->getLabelTag(); + $returnString .= $wrap[1]; + $returnString .= Html_Form::textarea($this->entryName, $value, $this->className, $this->idName); + $returnString .= $wrap[2]; + $returnString .="
\n"; + return $returnString; + } + +} diff --git a/h-source/admin/Library/Form/index.html b/h-source/admin/Library/Form/index.html new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/h-source/admin/Library/Form/index.html @@ -0,0 +1 @@ + -- cgit v1.2.3