Skip to content

Commit 725a5c2

Browse files
committed
enhanced documentation and added list of defaults for input options
1 parent 1f3a562 commit 725a5c2

26 files changed

+243
-51
lines changed

abstracts/input.php

+129-5
Original file line numberDiff line numberDiff line change
@@ -24,54 +24,178 @@ abstract class input extends element
2424
* @brief Input element type - HTML input type attribute.
2525
**/
2626
protected $type;
27+
28+
/**
29+
* @addtogroup htmlformInputDefaults
30+
*
31+
* @default string $label
32+
* Sets the label for the input
33+
**/
2734
/**
2835
* @brief Input element - HTML label
2936
**/
3037
protected $label;
38+
39+
/**
40+
* @addtogroup htmlformInputDefaults
41+
*
42+
* @default string $marker
43+
* Sets marker character(s) that gets display on required fields.
44+
**/
45+
/**
46+
* @brief Input element - HTML marker text that marks required fields
47+
**/
48+
protected $marker;
49+
50+
/**
51+
* @addtogroup htmlformInputDefaults
52+
*
53+
* @default bool $required
54+
* Sets wether an input is required to hold a value to be valid
55+
**/
3156
/**
3257
* @brief True if the input element is required to hold a value to be valid.
3358
**/
3459
protected $required;
60+
61+
/**
62+
* @addtogroup htmlformInputDefaults
63+
*
64+
* @default bool $disabled
65+
* Enables/disables an input
66+
**/
67+
/**
68+
* @brief wether a input element will be disabled
69+
**/
70+
protected $disabled;
71+
3572
/**
3673
* @brief Name of the parent HTML form. Used to identify the element once it's rendered.
3774
**/
3875
protected $formName;
76+
3977
/**
4078
* @brief Input elements's value.
4179
**/
4280
protected $value = null;
81+
82+
/**
83+
* @addtogroup htmlformInputDefaults
84+
*
85+
* @default string|function $validator
86+
* Sets the validator for the input.
87+
* - When $validator starts and ends with "/" e.g. "/[a-z0-9]/" the
88+
* validator will be a depage::htmlform::validators::regEx
89+
* - When it is a plain string it will be a the validator with the name
90+
* $validator out of the namespace depage::htmlform::validators.
91+
* - If the $validator is callable then the validator will be a
92+
* depage::htmlform::validators::closure
93+
**/
4394
/**
4495
* @brief Holds validator object reference.
4596
**/
4697
protected $validator;
98+
99+
/**
100+
* @addtogroup htmlformInputDefaults
101+
*
102+
* @default string $class
103+
* Class name or class names that gets added to wrapper paragraph.
104+
**/
47105
/**
48106
* @brief class for paragraph
49107
**/
50108
protected $class;
109+
51110
/**
52111
* @brief HTML classes attribute for rendering the input element.
53112
**/
54113
protected $classes;
114+
115+
/**
116+
* @addtogroup htmlformInputDefaults
117+
*
118+
* @default bool $autofocus
119+
* sets current input to get autofocus on a page. If you set the
120+
* autofocus to more than one input - The first one gets the focus.
121+
**/
55122
/**
56123
* @brief HTML autofocus attribute
57124
**/
58125
protected $autofocus = false;
126+
59127
/**
60-
* @brief HTML autocapitalize attribute
128+
* @addtogroup htmlformInputDefaults
129+
*
130+
* @default bool $autocapitalize
131+
* Enables/disables autocapitalizion (mostly on mobile devices)
61132
**/
133+
/**
134+
* @brief HTML autocapitalize attribute
135+
*/
62136
protected $autocapitalize;
137+
63138
/**
64-
* @brief HTML autocorrect attribute
139+
* @addtogroup htmlformInputDefaults
140+
*
141+
* @default bool $autocorrect
142+
* Enables/disables autocorrection
65143
**/
144+
/**
145+
* @brief HTML autocorrect attribute
146+
*/
147+
66148
protected $autocorrect;
67149
/**
68-
* @brief HTML autocomplete attribute
150+
* @addtogroup htmlformInputDefaults
151+
*
152+
* @default bool $autocomplete
153+
* Used to enable/disable autocorrect
69154
**/
155+
/**
156+
* @brief HTML autocomplete attribute
157+
*/
70158
protected $autocomplete;
159+
71160
/**
72161
* @brief HTML pattern attribute
73162
**/
74163
protected $pattern;
164+
165+
/**
166+
* @addtogroup htmlformInputDefaults
167+
*
168+
* @default string $errorMessage
169+
* Sets the message that will be displayed in case of invalid input
170+
**/
171+
/**
172+
* @brief Message that gets displayed in case of invalid input
173+
**/
174+
protected $errorMessage;
175+
176+
/**
177+
* @addtogroup htmlformInputDefaults
178+
*
179+
* @default string $helpMessage
180+
* Optional help message that may be used for extra information e.g. tooltips.
181+
* These string will be html escaped.
182+
**/
183+
/**
184+
* @brief Extra help message
185+
**/
186+
protected $helpMessage;
187+
188+
/**
189+
* @addtogroup htmlformInputDefaults
190+
*
191+
* @default string $helpMessageHtml
192+
* Optional help message that may be used for extra information e.g. tooltips.
193+
* These string won't be escaped as therefor has to be valid html.
194+
**/
195+
/**
196+
* @brief Extra hep message in html format
197+
**/
198+
protected $helpMessageHtml;
75199
// }}}
76200

77201
// {{{ __construct()
@@ -98,7 +222,7 @@ public function __construct($name, $parameters, $form)
98222

99223
// {{{ setDefaults()
100224
/**
101-
* @brief Collects initial values across subclasses.
225+
* @brief Sets the default values for input elements
102226
*
103227
* The constructor loops through these and creates settable class
104228
* attributes at runtime. It's a compact mechanism for initialising
@@ -301,7 +425,7 @@ public function setRequired($required = true)
301425
/**
302426
* @brief Sets the HTML disabled-attribute of the current input element.
303427
*
304-
* @param bool $dіsabled HTML disabled-attribute
428+
* @param bool $disabled HTML disabled-attribute
305429
* @return void
306430
**/
307431
public function setDisabled($disabled = true)

documentation/Doxyfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,10 @@ TAB_SIZE = 8
229229
# newlines.
230230

231231
ALIASES = "intro=<div class=\"intro\">" \
232-
"endintro=</div>"
232+
"endintro=</div>" \
233+
"default=@param " \
234+
"license=@par License:\n" \
235+
"copyright=@par Copyright:\n"
233236

234237
# This tag can be used to specify a number of word-keyword mappings (TCL only).
235238
# A mapping has the form "name=value". For example adding "class=itcl::class"

elements/address.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
* - a state
1818
* - a country select
1919
*
20-
* @section usage
20+
* Usage
21+
* -----
2122
*
2223
* @code
2324
<?php

elements/boolean.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
* be clicked to sumbit the form succesfully. It may e.g. be used for specific
1919
* terms a user has to accept to register.
2020
*
21-
* @section usage
21+
* @see depage::htmlform::elements::multiple
22+
*
23+
* Usage
24+
* -----
2225
*
2326
* @code
2427
<?php

elements/country.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
* An optional 'priority' parameter moves countries to the top of the select based on the DEPAGE_LANG locale:
2020
* e.g. 'de' => array('de','at'), 'en' => array('au','gb','ca','us')
2121
*
22-
* @section usage
22+
* Usage
23+
* -----
2324
*
2425
* @code
2526
<?php

elements/creditcard.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515
* Class to get a user creditcard information. It generates a fieldset
1616
* that consists of
1717
*
18-
* - a creditcard-type (like 'Visa', 'MasterCard' or 'American Express')
19-
* - a field for the creditcard-number
20-
* - a field for the expiry-date
21-
* - a field for the card-owner
18+
* - a creditcard-type (like 'Visa', 'MasterCard' or 'American Express')
19+
* - a field for the creditcard-number
20+
* - a field for the expiry-date
21+
* - a field for the card-owner
2222
*
23-
* At the moment this input only checks the formatting of the numbers but not if
23+
* At the moment this input only checks the formatting of the numbers but not, if
2424
* it is a valid creditcard.
2525
*
26-
* @section usage
26+
* Usage
27+
* -----
2728
*
2829
* @code
2930
<?php

elements/email.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
*
1515
* Class for the HTML5 input-type "email".
1616
*
17-
* @section usage
17+
* Usage
18+
* -----
1819
*
1920
* @code
2021
<?php

elements/fieldset.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
* Class for the HTML fieldset element. Can be used to group other elments
1818
* together.
1919
*
20-
* @section usage
20+
* Usage
21+
* -----
2122
*
2223
* @code
2324
<?php

elements/hidden.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
*
1515
* Class for the HTML input-type "hidden".
1616
*
17-
* @section usage
17+
* Usage
18+
* -----
1819
*
1920
* @code
2021
<?php

elements/html.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
*
1515
* Class for custom HTML code sections.
1616
*
17-
* @section usage
17+
* Usage
18+
* -----
1819
*
1920
* @code
2021
<?php

elements/multiple.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
* Class for multiple-choice type HTML elements. Has the same return value,
1818
* regardless of skin type (checkbox or select).
1919
*
20-
* @section usage
20+
* @see depage::htmlform::elements::single
21+
* @see depage::htmlform::elements::boolean
22+
*
23+
* Usage
24+
* -----
2125
*
2226
* @code
2327
<?php

elements/number.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
*
1515
* Class for HTML5 input type "number".
1616
*
17-
* @section usage
17+
* Usage
18+
* -----
1819
*
1920
* @code
2021
<?php

elements/password.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
* Class for the HTML input type "password". Entered characters are masked with
1616
* asterisks or bullets (depends on browser).
1717
*
18-
* @section usage
18+
* Usage
19+
* -----
1920
*
2021
* @code
2122
<?php

elements/placeholder.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
/**
1515
* @brief Adds a placeholder for a form element
1616
*
17-
* @section usage
17+
* Usage
18+
* -----
1819
*
1920
* @code
2021
<?php

elements/placeholdermultiple.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
/**
1313
* @brief Placeholder for form multiple form values.
1414
*
15-
* @section usage
15+
* Usage
16+
* -----
1617
*
1718
* @code
1819
<?php

elements/range.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
*
1515
* Class for HTML5 input type "range".
1616
*
17-
* @section usage
17+
* Usage
18+
* -----
1819
*
1920
* @code
2021
<?php

elements/richtext.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
* adds a textarea-element with additional richtext-functionality
1616
* added by javascript
1717
*
18-
* @section usage
18+
* Usage
19+
* -----
1920
*
2021
* @code
2122
<?php

elements/single.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
* Class for radio-like HTML elements. Has the same return value, regardless
1818
* of skin type (radio or select).
1919
*
20-
* @section usage
20+
* Usage
21+
* -----
2122
*
2223
* @code
2324
<?php

elements/state.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
*
1616
* Option values are 4-digit alpha ISO state codes.
1717
*
18-
* @section usage
18+
* Usage
19+
* -----
1920
*
2021
* @code
2122
<?php

0 commit comments

Comments
 (0)