From 10f233a2e2a11416413585ceadafa0d7b07988bc Mon Sep 17 00:00:00 2001 From: marcus Date: Fri, 8 Aug 2008 12:14:17 +0000 Subject: 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 --- views/default/account/forms/forgotten_password.php | 10 +++++----- views/default/account/forms/login.php | 21 +++++++++++++-------- views/default/input/access.php | 7 +++++-- views/default/input/button.php | 5 ++++- views/default/input/checkboxes.php | 5 ++++- views/default/input/email.php | 6 ++++-- views/default/input/file.php | 6 ++++-- views/default/input/longtext.php | 7 +++++-- views/default/input/password.php | 6 ++++-- views/default/input/pulldown.php | 6 +++++- views/default/input/radio.php | 5 ++++- views/default/input/reset.php | 4 ++++ views/default/input/submit.php | 4 ++++ views/default/input/tags.php | 7 +++++-- views/default/input/text.php | 11 ++++++++--- views/default/input/url.php | 8 +++++--- 16 files changed, 83 insertions(+), 35 deletions(-) diff --git a/views/default/account/forms/forgotten_password.php b/views/default/account/forms/forgotten_password.php index 18a9888fd..24c2df2f0 100644 --- a/views/default/account/forms/forgotten_password.php +++ b/views/default/account/forms/forgotten_password.php @@ -9,11 +9,11 @@ * @copyright Curverider Ltd 2008 * @link http://elgg.org/ */ + + $form_body = "

" . elgg_echo('user:password:text') . "

"; + $form_body .= "

". elgg_echo('username') . " " . elgg_view('input/text', array('internalname' => 'username')) . "

"; + $form_body .= "

" . elgg_view('input/submit', array('value' => elgg_echo('request'))) . "

"; ?>
-
-

-

'username')); ?>

-

-
+ "{$vars['url']}actions/user/requestnewpassword", 'body' => $form_body)); ?>
\ No newline at end of file diff --git a/views/default/account/forms/login.php b/views/default/account/forms/login.php index ea37ff692..7afef1404 100644 --- a/views/default/account/forms/login.php +++ b/views/default/account/forms/login.php @@ -11,15 +11,20 @@ * @link http://elgg.org/ */ - global $CONFIG; + global $CONFIG; + + $form_body = "

"; + $form_body .= "
"; + $form_body .= "
"; + $form_body .= elgg_view('input/submit', array('value' => elgg_echo('login'))) . "

"; + $form_body .= "

"; + $form_body .= (!isset($CONFIG->disable_registration) || !($CONFIG->disable_registration)) ? "" . elgg_echo('register') . " : " : ""; + $form_body .= "" . elgg_echo('user:password:lost') . "

"; + + // ?>

-
-

-
-
-

-

disable_registration) || !($CONFIG->disable_registration)) { ?> :

-
+ $form_body, 'action' => "{$vars['url']}action/login")); ?> +
\ No newline at end of file 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 @@ ?> - class=""> $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. ?> - value="" src="" /> \ No newline at end of file + value="" src="" 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 "
"; + echo "
"; } ?> \ 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"; ?> - name="" value="" class="input-text"/> \ No newline at end of file + name="" value="" 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') . "
"; } - + + $class = $vars['class']; + if (!$class) $class = "input-file"; ?> -name="" /> \ No newline at end of file +name="" 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"; + ?> - \ No newline at end of file + \ 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"; ?> - name="" value="" /> \ No newline at end of file + name="" value="" 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"; ?> - class=""> $label) { if ($option != $vars['value']) { @@ -26,7 +29,7 @@ } if ($vars['disabled']) $disabled = ' disabled="yes" '; - echo "
"; + echo "
"; } ?> \ 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 @@ } ?> - name="" value="" class="input-tags"/> \ No newline at end of file + name="" value="" 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"; + ?> - name="" value="" class="input-text"/> \ No newline at end of file + name="" value="" 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"; ?> - name="" value="" class="input-url"/> \ No newline at end of file + name="" value="" class=""/> \ No newline at end of file -- cgit v1.2.3