diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-08 12:14:17 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-08 12:14:17 +0000 |
commit | 10f233a2e2a11416413585ceadafa0d7b07988bc (patch) | |
tree | 4dc3c0093d0c0c97cfcf88e7d89292341325350a /views/default/input | |
parent | cef25136b69582dc9e6efd95284f4f3e40b7a53f (diff) | |
download | elgg-10f233a2e2a11416413585ceadafa0d7b07988bc.tar.gz elgg-10f233a2e2a11416413585ceadafa0d7b07988bc.tar.bz2 |
Refs #211: Two forms converted + extra functionality to input views
git-svn-id: https://code.elgg.org/elgg/trunk@1790 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/input')
-rw-r--r-- | views/default/input/access.php | 7 | ||||
-rw-r--r-- | views/default/input/button.php | 5 | ||||
-rw-r--r-- | views/default/input/checkboxes.php | 5 | ||||
-rw-r--r-- | views/default/input/email.php | 6 | ||||
-rw-r--r-- | views/default/input/file.php | 6 | ||||
-rw-r--r-- | views/default/input/longtext.php | 7 | ||||
-rw-r--r-- | views/default/input/password.php | 6 | ||||
-rw-r--r-- | views/default/input/pulldown.php | 6 | ||||
-rw-r--r-- | views/default/input/radio.php | 5 | ||||
-rw-r--r-- | views/default/input/reset.php | 4 | ||||
-rw-r--r-- | views/default/input/submit.php | 4 | ||||
-rw-r--r-- | views/default/input/tags.php | 7 | ||||
-rw-r--r-- | views/default/input/text.php | 11 | ||||
-rw-r--r-- | views/default/input/url.php | 8 |
14 files changed, 65 insertions, 22 deletions
diff --git a/views/default/input/access.php b/views/default/input/access.php index 1157e45e0..dfd23df1d 100644 --- a/views/default/input/access.php +++ b/views/default/input/access.php @@ -15,7 +15,10 @@ * @uses $vars['js'] Any Javascript to enter into the input tag
* @uses $vars['internalname'] The name of the input field
*
- */
+ */ + + $class = $vars['class']; + if (!$class) $class = "input-access";
if (!is_array($vars['options'])) {
@@ -27,7 +30,7 @@ ?>
-<select name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['js'])) echo $vars['js']; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?>>
+<select name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['js'])) echo $vars['js']; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>">
<?php
foreach($vars['options'] as $key => $option) {
diff --git a/views/default/input/button.php b/views/default/input/button.php index 2249158e6..e646998ea 100644 --- a/views/default/input/button.php +++ b/views/default/input/button.php @@ -20,6 +20,9 @@ */ global $CONFIG; + + $class = $vars['class']; + if (!$class) $class = "submit_button"; $type = strtolower($vars['type']); switch ($type) @@ -35,4 +38,4 @@ $src = $vars['src']; if (strpos($src,$CONFIG->wwwroot)===false) $src = ""; // blank src if trying to access an offsite image. ?> -<input type="<?php echo $type; ?>" class="<?php echo $type; ?>_button" <?php echo $vars['js']; ?> value="<?php echo $value; ?>" src="<?php echo $src; ?>" />
\ No newline at end of file +<input type="<?php echo $type; ?>" class="<?php echo $type; ?>_button" <?php echo $vars['js']; ?> value="<?php echo $value; ?>" src="<?php echo $src; ?>" class="<?php echo $class; ?>" />
\ No newline at end of file diff --git a/views/default/input/checkboxes.php b/views/default/input/checkboxes.php index 6d39d823d..c27a197cf 100644 --- a/views/default/input/checkboxes.php +++ b/views/default/input/checkboxes.php @@ -17,6 +17,9 @@ * @uses $vars['options'] An array of strings representing the options for the checkbox field
*
*/
+ + $class = $vars['class']; + if (!$class) $class = "input-checkboxes"; foreach($vars['options'] as $label => $option) {
//if (!in_array($option,$vars['value'])) {
@@ -39,7 +42,7 @@ } if ($vars['disabled']) $disabled = ' disabled="yes" ';
- echo "<label><input type=\"checkbox\" $disabled {$vars['js']} name=\"{$vars['internalname']}[]\" {$selected} value=\"".htmlentities($option)."\" {$selected} />{$label}</label><br />";
+ echo "<label><input type=\"checkbox\" $disabled {$vars['js']} name=\"{$vars['internalname']}[]\" {$selected} value=\"".htmlentities($option)."\" {$selected} class=\"$class\" />{$label}</label><br />";
}
?>
\ No newline at end of file diff --git a/views/default/input/email.php b/views/default/input/email.php index b5c9a6e3b..bedf93e27 100644 --- a/views/default/input/email.php +++ b/views/default/input/email.php @@ -16,7 +16,9 @@ * @uses $vars['internalname'] The name of the input field
*
*/
-
+ + $class = $vars['class']; + if (!$class) $class = "input-text";
?>
-<input type="text" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" value="<?php echo $vars['value']; ?>" class="input-text"/>
\ No newline at end of file +<input type="text" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" value="<?php echo $vars['value']; ?>" class="<?php echo $class; ?>"/>
\ No newline at end of file diff --git a/views/default/input/file.php b/views/default/input/file.php index 5dde370a2..de0098b3e 100644 --- a/views/default/input/file.php +++ b/views/default/input/file.php @@ -19,6 +19,8 @@ if (!empty($vars['value'])) {
echo elgg_echo('fileexists') . "<br />";
}
-
+ + $class = $vars['class']; + if (!$class) $class = "input-file";
?>
-<input type="file" size="30" <?php echo $vars['js']; ?>name="<?php echo $vars['internalname']; ?>" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> />
\ No newline at end of file +<input type="file" size="30" <?php echo $vars['js']; ?>name="<?php echo $vars['internalname']; ?>" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>" />
\ No newline at end of file diff --git a/views/default/input/longtext.php b/views/default/input/longtext.php index e21c96a59..85c3f8186 100644 --- a/views/default/input/longtext.php +++ b/views/default/input/longtext.php @@ -16,7 +16,10 @@ * @uses $vars['internalname'] The name of the input field
*
*/
-
+ + $class = $vars['class']; + if (!$class) $class = "input-textarea"; +
?>
-<textarea class="input-textarea" name="<?php echo $vars['internalname']; ?>" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?>><?php echo $vars['value']; ?></textarea>
\ No newline at end of file +<textarea class="<?php echo $class; ?>" name="<?php echo $vars['internalname']; ?>" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?>><?php echo $vars['value']; ?></textarea>
\ No newline at end of file diff --git a/views/default/input/password.php b/views/default/input/password.php index 740a1a3f0..6fbd7254b 100644 --- a/views/default/input/password.php +++ b/views/default/input/password.php @@ -16,7 +16,9 @@ * @uses $vars['internalname'] The name of the input field
*
*/
-
+ + $class = $vars['class']; + if (!$class) $class = "input-password";
?>
-<input type="password" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" value="<?php echo $vars['value']; ?>" />
\ No newline at end of file +<input type="password" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" value="<?php echo $vars['value']; ?>" class="<?php echo $class; ?>" />
\ No newline at end of file diff --git a/views/default/input/pulldown.php b/views/default/input/pulldown.php index 081dffc2a..96b4d19aa 100644 --- a/views/default/input/pulldown.php +++ b/views/default/input/pulldown.php @@ -18,11 +18,15 @@ * @uses $vars['options_values'] An associative array of "value" => "option" where "value" is an internal name and "option" is * the value displayed on the button. Replaces $vars['options'] when defined.
*/
+ + + $class = $vars['class']; + if (!$class) $class = "input-pulldown"; ?>
-<select name="<?php echo $vars['internalname']; ?>" <?php echo $vars['js']; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?>>
+<select name="<?php echo $vars['internalname']; ?>" <?php echo $vars['js']; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>">
<?php
if ($vars['options_values']) { diff --git a/views/default/input/radio.php b/views/default/input/radio.php index 6089b912f..3b367816b 100644 --- a/views/default/input/radio.php +++ b/views/default/input/radio.php @@ -17,6 +17,9 @@ * @uses $vars['options'] An array of strings representing the options for the radio field
*
*/
+ + $class = $vars['class']; + if (!$class) $class = "input-radio"; foreach($vars['options'] as $option => $label) {
if ($option != $vars['value']) {
@@ -26,7 +29,7 @@ } if ($vars['disabled']) $disabled = ' disabled="yes" ';
- echo "<label><input type=\"radio\" $disabled {$vars['js']} name=\"{$vars['internalname']}\" value=\"".htmlentities($option)."\" {$selected} />{$label}</label><br />";
+ echo "<label><input type=\"radio\" $disabled {$vars['js']} name=\"{$vars['internalname']}\" value=\"".htmlentities($option)."\" {$selected} class=\"$class\" />{$label}</label><br />";
}
?>
\ No newline at end of file diff --git a/views/default/input/reset.php b/views/default/input/reset.php index 34a50d2f5..2e0e78037 100644 --- a/views/default/input/reset.php +++ b/views/default/input/reset.php @@ -19,5 +19,9 @@ */ $vars['type'] = 'reset'; + $class = $vars['class']; + if (!$class) $class = "submit_button"; + $vars['class'] = $class; + echo elgg_view('input/button', $vars); ?>
\ No newline at end of file diff --git a/views/default/input/submit.php b/views/default/input/submit.php index 735130b65..83ee98f27 100644 --- a/views/default/input/submit.php +++ b/views/default/input/submit.php @@ -19,5 +19,9 @@ */ $vars['type'] = 'submit'; + $class = $vars['class']; + if (!$class) $class = "submit_button"; + $vars['class'] = $class; + echo elgg_view('input/button', $vars); ?>
\ No newline at end of file diff --git a/views/default/input/tags.php b/views/default/input/tags.php index 8a03759fd..09b72ac76 100644 --- a/views/default/input/tags.php +++ b/views/default/input/tags.php @@ -15,8 +15,11 @@ * @uses $vars['js'] Any Javascript to enter into the input tag
* @uses $vars['internalname'] The name of the input field
* @uses $vars['value'] An array of tags
- *
+ * @uses $vars['class'] Class override
*/
+ + $class = $vars['class']; + if (!$class) $class = "input-tags"; $tags = "";
if (!empty($vars['value'])) {
@@ -39,4 +42,4 @@ }
?>
-<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?><?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" value="<?php echo htmlentities($tags); ?>" class="input-tags"/>
\ No newline at end of file +<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?><?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" value="<?php echo htmlentities($tags); ?>" class="<?php echo $class; ?>"/>
\ No newline at end of file diff --git a/views/default/input/text.php b/views/default/input/text.php index 6f3b6ba4b..3f7667c4f 100644 --- a/views/default/input/text.php +++ b/views/default/input/text.php @@ -14,9 +14,14 @@ * @uses $vars['value'] The current value, if any
* @uses $vars['js'] Any Javascript to enter into the input tag
* @uses $vars['internalname'] The name of the input field
- * @uses $vars['disabled'] If true then control is read-only
+ * @uses $vars['disabled'] If true then control is read-only + * @uses $vars['class'] Class override
*/
-
+ + + $class = $vars['class']; + if (!$class) $class = "input-text"; +
?>
-<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" value="<?php echo htmlentities($vars['value']); ?>" class="input-text"/>
\ No newline at end of file +<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" value="<?php echo htmlentities($vars['value']); ?>" class="<?php echo $class ?>"/>
\ No newline at end of file diff --git a/views/default/input/url.php b/views/default/input/url.php index f42a43a14..1247971b5 100644 --- a/views/default/input/url.php +++ b/views/default/input/url.php @@ -14,9 +14,11 @@ * @uses $vars['value'] The current value, if any
* @uses $vars['js'] Any Javascript to enter into the input tag
* @uses $vars['internalname'] The name of the input field
- *
+ * @uses $vars['class'] Class override
*/
-
+ + $class = $vars['class']; + if (!$class) $class = "input-url";
?>
-<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" value="<?php echo $vars['value']; ?>" class="input-url"/>
\ No newline at end of file +<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" value="<?php echo $vars['value']; ?>" class="<?php echo $class; ?>"/>
\ No newline at end of file |