aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/form.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/form.php')
-rw-r--r--inc/form.php30
1 files changed, 14 insertions, 16 deletions
diff --git a/inc/form.php b/inc/form.php
index 7afb0ba30..ddf0732d0 100644
--- a/inc/form.php
+++ b/inc/form.php
@@ -6,8 +6,6 @@
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
-if(!defined('DOKU_INC')) die('meh.');
-
/**
* Class for creating simple HTML forms.
*
@@ -55,7 +53,7 @@ class Doku_Form {
*
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
- function __construct($params, $action=false, $method=false, $enctype=false) {
+ public function __construct($params, $action=false, $method=false, $enctype=false) {
if(!is_array($params)) {
$this->params = array('id' => $params);
if ($action !== false) $this->params['action'] = $action;
@@ -88,7 +86,7 @@ class Doku_Form {
*
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
- function startFieldset($legend) {
+ public function startFieldset($legend) {
if ($this->_infieldset) {
$this->addElement(array('_elem'=>'closefieldset'));
}
@@ -101,7 +99,7 @@ class Doku_Form {
*
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
- function endFieldset() {
+ public function endFieldset() {
if ($this->_infieldset) {
$this->addElement(array('_elem'=>'closefieldset'));
}
@@ -120,7 +118,7 @@ class Doku_Form {
*
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
- function addHidden($name, $value) {
+ public function addHidden($name, $value) {
if (is_null($value))
unset($this->_hidden[$name]);
else
@@ -138,7 +136,7 @@ class Doku_Form {
*
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
- function addElement($elem) {
+ public function addElement($elem) {
$this->_content[] = $elem;
}
@@ -152,7 +150,7 @@ class Doku_Form {
*
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
- function insertElement($pos, $elem) {
+ public function insertElement($pos, $elem) {
array_splice($this->_content, $pos, 0, array($elem));
}
@@ -166,7 +164,7 @@ class Doku_Form {
*
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
- function replaceElement($pos, $elem) {
+ public function replaceElement($pos, $elem) {
$rep = array();
if (!is_null($elem)) $rep[] = $elem;
array_splice($this->_content, $pos, 1, $rep);
@@ -182,7 +180,7 @@ class Doku_Form {
*
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
- function findElementByType($type) {
+ public function findElementByType($type) {
foreach ($this->_content as $pos=>$elem) {
if (is_array($elem) && $elem['_elem'] == $type)
return $pos;
@@ -200,7 +198,7 @@ class Doku_Form {
*
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
- function findElementById($id) {
+ public function findElementById($id) {
foreach ($this->_content as $pos=>$elem) {
if (is_array($elem) && isset($elem['id']) && $elem['id'] == $id)
return $pos;
@@ -219,7 +217,7 @@ class Doku_Form {
*
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
- function findElementByAttribute($name, $value) {
+ public function findElementByAttribute($name, $value) {
foreach ($this->_content as $pos=>$elem) {
if (is_array($elem) && isset($elem[$name]) && $elem[$name] == $value)
return $pos;
@@ -239,7 +237,7 @@ class Doku_Form {
*
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
- function &getElementAt($pos) {
+ public function &getElementAt($pos) {
if ($pos < 0) $pos = count($this->_content) + $pos;
if ($pos < 0) $pos = 0;
if ($pos >= count($this->_content)) $pos = count($this->_content) - 1;
@@ -256,7 +254,7 @@ class Doku_Form {
*
* @return string html of the form
*/
- function getForm() {
+ public function getForm() {
global $lang;
$form = '';
$this->params['accept-charset'] = $lang['encoding'];
@@ -286,7 +284,7 @@ class Doku_Form {
*
* wraps around getForm()
*/
- function printForm(){
+ public function printForm(){
echo $this->getForm();
}
@@ -302,7 +300,7 @@ class Doku_Form {
* @author Adrian Lang <lang@cosmocode.de>
*/
- function addRadioSet($name, $entries) {
+ public function addRadioSet($name, $entries) {
global $INPUT;
$value = (array_key_exists($INPUT->post->str($name), $entries)) ?
$INPUT->str($name) : key($entries);