diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-11 19:14:32 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-11 19:14:32 +0000 |
commit | d3334ef71b8e71e0db6c463436555f406941d5c9 (patch) | |
tree | cd4109bcc0d7abf2528cf5940e6c132c3e98b01a /views | |
parent | 982d56d370ba021e17a6e8548cdeb26345a89380 (diff) | |
download | elgg-d3334ef71b8e71e0db6c463436555f406941d5c9.tar.gz elgg-d3334ef71b8e71e0db6c463436555f406941d5c9.tar.bz2 |
Implemented sticky forms.
git-svn-id: http://code.elgg.org/elgg/trunk@5368 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views')
-rw-r--r-- | views/default/input/access.php | 3 | ||||
-rw-r--r-- | views/default/input/calendar.php | 4 | ||||
-rw-r--r-- | views/default/input/checkboxes.php | 4 | ||||
-rw-r--r-- | views/default/input/email.php | 5 | ||||
-rw-r--r-- | views/default/input/hidden.php | 5 | ||||
-rw-r--r-- | views/default/input/longtext.php | 4 | ||||
-rw-r--r-- | views/default/input/plaintext.php | 4 | ||||
-rw-r--r-- | views/default/input/pulldown.php | 4 | ||||
-rw-r--r-- | views/default/input/radio.php | 4 | ||||
-rw-r--r-- | views/default/input/tags.php | 4 | ||||
-rw-r--r-- | views/default/input/text.php | 8 | ||||
-rw-r--r-- | views/default/input/url.php | 5 | ||||
-rw-r--r-- | views/default/input/userpicker.php | 4 |
13 files changed, 57 insertions, 1 deletions
diff --git a/views/default/input/access.php b/views/default/input/access.php index e93b47cd1..2515180ce 100644 --- a/views/default/input/access.php +++ b/views/default/input/access.php @@ -30,6 +30,9 @@ if (!array_key_exists('value', $vars) || $vars['value'] == ACCESS_DEFAULT) { $vars['value'] = get_default_access(); } +if (!isset($vars['value']) || $vars['value'] === FALSE) { + $vars['value'] = elgg_get_sticky_value($vars['internalname']); +} if ((!isset($vars['options'])) || (!is_array($vars['options']))) { $vars['options'] = array(); diff --git a/views/default/input/calendar.php b/views/default/input/calendar.php index 12cbf95ec..09c29753a 100644 --- a/views/default/input/calendar.php +++ b/views/default/input/calendar.php @@ -26,6 +26,10 @@ END; $strippedname = sanitise_string($vars['internalname']); $js = "cal" . $strippedname; +if (!isset($vars['value']) || $vars['value'] === FALSE) { + $vars['value'] = elgg_get_sticky_value($vars['internalname']); +} + if ($vars['value'] > 86400) { $val = date("F j, Y",$vars['value']); } else { diff --git a/views/default/input/checkboxes.php b/views/default/input/checkboxes.php index 60674cb3c..fa7c0c34c 100644 --- a/views/default/input/checkboxes.php +++ b/views/default/input/checkboxes.php @@ -20,6 +20,10 @@ if (!$class) { $class = "input_checkboxes"; } +if (!isset($vars['value']) || $vars['value'] === FALSE) { + $vars['value'] = elgg_get_sticky_value($vars['internalname']); +} + foreach($vars['options'] as $label => $option) { //if (!in_array($option,$vars['value'])) { if (is_array($vars['value'])) { diff --git a/views/default/input/email.php b/views/default/input/email.php index 62a4ec993..f8df87dd4 100644 --- a/views/default/input/email.php +++ b/views/default/input/email.php @@ -20,6 +20,11 @@ $class = $vars['class']; if (!$class) { $class = "input_text"; } + +if (!isset($vars['value']) || $vars['value'] === FALSE) { + $vars['value'] = elgg_get_sticky_value($vars['internalname']); +} + ?> <input type="text" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?>value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>"/>
\ No newline at end of file diff --git a/views/default/input/hidden.php b/views/default/input/hidden.php index e95779367..2abf4faf5 100644 --- a/views/default/input/hidden.php +++ b/views/default/input/hidden.php @@ -14,5 +14,10 @@ * @uses $vars['internalname'] The name of the input field * */ + +if (!isset($vars['value']) || $vars['value'] === FALSE) { + $vars['value'] = elgg_get_sticky_value($vars['internalname']); +} + ?> <input type="hidden" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" />
\ No newline at end of file diff --git a/views/default/input/longtext.php b/views/default/input/longtext.php index 328eb8f78..e1bc235e3 100644 --- a/views/default/input/longtext.php +++ b/views/default/input/longtext.php @@ -26,6 +26,10 @@ if (isset($vars['disabled'])) { $disabled = $vars['disabled']; } +if (!isset($vars['value']) || $vars['value'] === FALSE) { + $vars['value'] = elgg_get_sticky_value($vars['internalname']); +} + $value = ''; if (isset($vars['value'])) { $value = $vars['value']; diff --git a/views/default/input/plaintext.php b/views/default/input/plaintext.php index 22171a7a7..dd1178945 100644 --- a/views/default/input/plaintext.php +++ b/views/default/input/plaintext.php @@ -19,6 +19,10 @@ if (!$class) { $class = "input_textarea"; } +if (!isset($vars['value']) || $vars['value'] === FALSE) { + $vars['value'] = elgg_get_sticky_value($vars['internalname']); +} + ?> <textarea class="<?php echo $class; ?>" name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?>><?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?></textarea>
\ No newline at end of file diff --git a/views/default/input/pulldown.php b/views/default/input/pulldown.php index 59c8a7adc..b24d92b38 100644 --- a/views/default/input/pulldown.php +++ b/views/default/input/pulldown.php @@ -21,6 +21,10 @@ if (!$class) { $class = "input_pulldown"; } +if (!isset($vars['value']) || $vars['value'] === FALSE) { + $vars['value'] = elgg_get_sticky_value($vars['internalname']); +} + ?> <select name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php echo $vars['js']; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>"> diff --git a/views/default/input/radio.php b/views/default/input/radio.php index 8304d0737..fe7335b8a 100644 --- a/views/default/input/radio.php +++ b/views/default/input/radio.php @@ -20,6 +20,10 @@ if (!$class) { $class = "input_radio"; } +if (!isset($vars['value']) || $vars['value'] === FALSE) { + $vars['value'] = elgg_get_sticky_value($vars['internalname']); +} + foreach($vars['options'] as $label => $option) { if (strtolower($option) != strtolower($vars['value'])) { $selected = ""; diff --git a/views/default/input/tags.php b/views/default/input/tags.php index 3592edb10..1c71cb0e0 100644 --- a/views/default/input/tags.php +++ b/views/default/input/tags.php @@ -29,6 +29,10 @@ if (isset($vars['disabled'])) { $disabled = $vars['disabled']; } +if (!isset($vars['value']) || $vars['value'] === FALSE) { + $vars['value'] = elgg_get_sticky_value($vars['internalname']); +} + $tags = ""; if (!empty($vars['value'])) { if (is_array($vars['value'])) { diff --git a/views/default/input/text.php b/views/default/input/text.php index aa6e571b6..a77956985 100644 --- a/views/default/input/text.php +++ b/views/default/input/text.php @@ -29,6 +29,12 @@ if (isset($vars['disabled'])) { $disabled = $vars['disabled']; } +if (!isset($vars['value']) || $vars['value'] === FALSE) { + $vars['value'] = elgg_get_sticky_value($vars['internalname']); +} + +$value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); + ?> -<input type="text" <?php if ($disabled) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class ?>"/>
\ No newline at end of file +<input type="text" <?php if ($disabled) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo $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 571754c77..0b9e124c6 100644 --- a/views/default/input/url.php +++ b/views/default/input/url.php @@ -18,6 +18,11 @@ $class = $vars['class']; if (!$class) { $class = "input_url"; } + +if (!isset($vars['value']) || $vars['value'] === FALSE) { + $vars['value'] = elgg_get_sticky_value($vars['internalname']); +} + ?> <input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>"/>
\ No newline at end of file diff --git a/views/default/input/userpicker.php b/views/default/input/userpicker.php index 742554dbd..18f3085c2 100644 --- a/views/default/input/userpicker.php +++ b/views/default/input/userpicker.php @@ -22,6 +22,10 @@ global $user_picker_js_sent; +if (!isset($vars['value']) || $vars['value'] === FALSE) { + $vars['value'] = elgg_get_sticky_value($vars['internalname']); +} + if (!$user_picker_js_sent) { ?> <!-- User picker JS --> |