]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
moved account forms into forms directory
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 15 Dec 2010 02:15:39 +0000 (02:15 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 15 Dec 2010 02:15:39 +0000 (02:15 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7623 36083f99-b078-4883-b0ff-0f9b5a30f544

12 files changed:
pages/account/forgotten_password.php
pages/account/register.php
views/default/account/forms/forgotten_password.php [deleted file]
views/default/account/forms/register.php [deleted file]
views/default/admin/users/add.php
views/default/core/account/login_box.php
views/default/core/account/login_dropdown.php
views/default/core/account/login_walled_garden.php
views/default/forms/login.php [moved from views/default/account/forms/login.php with 100% similarity]
views/default/forms/register.php [new file with mode: 0644]
views/default/forms/user/requestnewpassword.php [new file with mode: 0644]
views/default/forms/useradd.php [moved from views/default/account/forms/useradd.php with 100% similarity]

index 1906a889ea412ebef3f5ab0e7de9f3be058d9e99..a387717b301f2fecf6464ae0d7d73438f83a22f7 100644 (file)
@@ -8,11 +8,15 @@
 
 require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
 
-if (!isloggedin()) {
-       $area1 = elgg_view_title(elgg_echo("user:password:lost"));
-       $area2 = elgg_view("account/forms/forgotten_password");
-       $content = elgg_view_layout("one_column_with_sidebar", array('content' => $area1 . $area2));
-       echo elgg_view_page(elgg_echo('user:password:lost'), $content);
-} else {
+if (isloggedin()) {
        forward();
-}
\ No newline at end of file
+}
+
+$title = elgg_echo("user:password:lost");
+$content = elgg_view_title($title);
+
+$content .= elgg_view_form('user/requestnewpassword');
+
+$body = elgg_view_layout("one_column_with_sidebar", array('content' => $content));
+
+echo elgg_view_page($title, $body);
index 76319e0d6d3e293fbd67853bb7db59cfd5eb1843..9aa835b9c0e4cac0230f45651005cfb3871649c5 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Assembles and outputs the registration page.
  *
- * Since 1.8 registration can be disabled via administration.  If this is
+ * Since 1.8, registration can be disabled via administration.  If this is
  * the case, calls to this page will forward to the network front page.
  *
  * If the user is logged in, this page will forward to the network
  * @subpackage Registration
  */
 
-/**
- * Start the Elgg engine
- *
- * Why?
- * Tthere _might_ exist direct calls to this file, requiring the engine
- * to be started. Logic for both cases follow.
- *
- * @todo remove as direct calls were deprecated in 1.7
- */
-require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
 // check new registration allowed
 if (elgg_get_config('allow_registration') == false) {
        register_error(elgg_echo('registerdisabled'));
@@ -37,11 +26,23 @@ if (isloggedin()) {
        forward();
 }
 
-$area1 = elgg_view_title(elgg_echo("register"));
-$area2 = elgg_view("account/forms/register", array(
+$title = elgg_echo("register");
+
+$content = elgg_view_title($title);
+
+// create the registration url - including switching to https if configured
+$register_url = elgg_get_site_url() . 'action/register';
+if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) {
+       $register_url = str_replace("http:", "https:", $register_url);
+}
+$form_params = array('action' => $register_url);
+
+$body_params = array(
        'friend_guid' => $friend_guid,
-       'invitecode' => $invitecode)
+       'invitecode' => $invitecode
 );
+$content .= elgg_view_form('register', $form_params, $body_params);
+
+$body = elgg_view_layout("one_column_with_sidebar", array('content' => $content));
 
-$body = elgg_view_layout("one_column_with_sidebar", array('content' => $area1 . $area2));
-echo elgg_view_page(elgg_echo("register"), $body);
+echo elgg_view_page($title, $body);
diff --git a/views/default/account/forms/forgotten_password.php b/views/default/account/forms/forgotten_password.php
deleted file mode 100644 (file)
index 48fafe4..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/**
- * Elgg forgotten password.
- *
- * @package Elgg
- * @subpackage Core
- */
-
-$form_body = "<p>" . elgg_echo('user:password:text') . "</p>";
-$form_body .= "<p><label>". elgg_echo('username') . " "
-       . elgg_view('input/text', array('internalname' => 'username')) . "</label></p>";
-$form_body .= elgg_view('input/captcha');
-$form_body .= "<p>" . elgg_view('input/submit', array('value' => elgg_echo('request'))) . "</p>";
-
-echo elgg_view('input/form', array(
-       'action' => "action/user/requestnewpassword",
-       'body' => $form_body,
-       'class' => "margin-top"
-));
-?>
-
-<script type="text/javascript">
-       $(document).ready(function() { $('input[name=username]').focus(); });
-</script>
\ No newline at end of file
diff --git a/views/default/account/forms/register.php b/views/default/account/forms/register.php
deleted file mode 100644 (file)
index bf629b5..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-/**
- * Elgg register form
- *
- * @package Elgg
- * @subpackage Core
- */
-
-$register_url = elgg_get_site_url();
-if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) {
-       $register_url = str_replace("http:", "https:", $register_url);
-}
-
-$username = get_input('u');
-$email = get_input('e');
-$name = get_input('n');
-
-$admin_option = false;
-$loggedin_user = get_loggedin_user();
-
-if ($loggedin_user && $loggedin_user->isAdmin() && isset($vars['show_admin'])) {
-       $admin_option = true;
-}
-
-$form_body  = "<p><label>" . elgg_echo('name') . "<br />" . elgg_view('input/text' , array('internalname' => 'name', 'class' => "input-text name", 'value' => $name)) . "</label></p>";
-$form_body .= "<p><label>" . elgg_echo('email') . "<br />" . elgg_view('input/text' , array('internalname' => 'email', 'class' => "input-text", 'value' => $email)) . "</label></p>";
-$form_body .= "<p><label>" . elgg_echo('username') . "<br />" . elgg_view('input/text' , array('internalname' => 'username', 'class' => "input-text", 'value' => $username)) . "</label></p>";
-$form_body .= "<p><label>" . elgg_echo('password') . "<br />" . elgg_view('input/password' , array('internalname' => 'password', 'class' => "input-password")) . "</label></p>";
-$form_body .= "<p><label>" . elgg_echo('passwordagain') . "<br />" . elgg_view('input/password' , array('internalname' => 'password2', 'class' => "input-password")) . "</label></p>";
-
-// view to extend to add more fields to the registration form
-$form_body .= elgg_view('register/extend');
-
-// Add captcha hook
-$form_body .= elgg_view('input/captcha');
-
-if ($admin_option) {
-       $form_body .= elgg_view('input/checkboxes', array('internalname' => "admin", 'options' => array(elgg_echo('admin_option'))));
-}
-
-$form_body .= elgg_view('input/hidden', array('internalname' => 'friend_guid', 'value' => $vars['friend_guid']));
-$form_body .= elgg_view('input/hidden', array('internalname' => 'invitecode', 'value' => $vars['invitecode']));
-$form_body .= elgg_view('input/hidden', array('internalname' => 'action', 'value' => 'register'));
-$form_body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('register'))) . "</p>";
-
-echo elgg_view('input/form', array(
-       'action' => "{$login_url}action/register",
-       'body' => $form_body,
-       'class' => "margin-top"
-));
-?>
-
-<script type="text/javascript">
-       $(document).ready(function() { $('input[name=name]').focus(); });
-</script>
index cc2da61db4917dd61eafb11744af132fee88615c..9caeedd89e7e61993072a23081327a49a0cebf77 100644 (file)
@@ -4,4 +4,4 @@
  */
 
 echo elgg_view_title(elgg_echo('admin:users'));
-echo elgg_view('account/forms/useradd', array('show_admin'=>true));
\ No newline at end of file
+echo elgg_view('forms/useradd', array('show_admin'=>true));
\ No newline at end of file
index eb37d7554721b08ea522a71ead595bc271fc46d4..0dee72328ef89c534d0a4783d41b65c871ab2595 100644 (file)
@@ -6,7 +6,7 @@
  * @subpackage Core
  */
 
-$form_body = elgg_view('account/forms/login');
+$form_body = elgg_view('forms/login');
 
 $login_url = elgg_get_site_url();
 if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) {
index dc124f4e8fcacf9175b0d2593c7fcee674f1ef0b..386a52a6cb6a9d8f245e005d409f555ce4234931 100644 (file)
@@ -8,7 +8,7 @@ if (isloggedin()) {
        return true;
 }
 
-$form_body = elgg_view('account/forms/login');
+$form_body = elgg_view('forms/login');
 $form_body .= "<input type='hidden' name='returntoreferer' value='true' />";
 
 $login_url = elgg_get_site_url();
index 9f407bdff381c4c1c1c88d6cbc762d8d8f49d3d4..bdd4cb016b20a837ade79ce8095f7c0785e542b5 100644 (file)
@@ -21,7 +21,7 @@ $form_body .= "<a class='forgotten_password_link' href=\"{$login_url}pages/accou
 $form_body .= '</p>';
 */
 
-$form_body = elgg_view('account/forms/login');
+$form_body = elgg_view('forms/login');
 $form_body .= elgg_view('input/hidden', array('internalname' => 'returntoreferer', 'value' => 'true'));
 
 $login_url = elgg_get_site_url();
diff --git a/views/default/forms/register.php b/views/default/forms/register.php
new file mode 100644 (file)
index 0000000..93e2585
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Elgg register form
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+$username = get_input('u');
+$email = get_input('e');
+$name = get_input('n');
+
+$admin_option = false;
+if (isadminloggedin() && isset($vars['show_admin'])) {
+       $admin_option = true;
+}
+
+?>
+<p class="mtm">
+       <label><?php echo elgg_echo('name'); ?></label>
+       <br />
+       <?php echo elgg_view('input/text', array('internalname' => 'name', 'value' => $name)); ?>
+</p>
+<p>
+       <label><?php echo elgg_echo('email'); ?></label>
+       <br />
+       <?php echo elgg_view('input/text', array('internalname' => 'email', 'value' => $email)); ?>
+</p>
+<p>
+       <label><?php echo elgg_echo('username'); ?></label>
+       <br />
+       <?php echo elgg_view('input/text', array('internalname' => 'username', 'value' => $username)); ?>
+</p>
+<p>
+       <label><?php echo elgg_echo('password'); ?></label>
+       <br />
+       <?php echo elgg_view('input/password', array('internalname' => 'password')); ?>
+</p>
+<p>
+       <label><?php echo elgg_echo('passwordagain'); ?></label>
+       <br />
+       <?php echo elgg_view('input/password', array('internalname' => 'password2')); ?>
+</p>
+
+<?php
+// view to extend to add more fields to the registration form
+echo elgg_view('register/extend');
+
+// Add captcha hook
+echo elgg_view('input/captcha');
+
+if ($admin_option) {
+       echo elgg_view('input/checkboxes', array('internalname' => "admin", 'options' => array(elgg_echo('admin_option'))));
+}
+
+echo elgg_view('input/hidden', array('internalname' => 'friend_guid', 'value' => $vars['friend_guid']));
+echo elgg_view('input/hidden', array('internalname' => 'invitecode', 'value' => $vars['invitecode']));
+echo elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('register')));
+?>
+
+<script type="text/javascript">
+       $(document).ready(function() {
+               $('input[name=name]').focus();
+       });
+</script>
\ No newline at end of file
diff --git a/views/default/forms/user/requestnewpassword.php b/views/default/forms/user/requestnewpassword.php
new file mode 100644 (file)
index 0000000..a235f2c
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Elgg forgotten password.
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+?>
+
+<p class="mtm">
+       <?php echo elgg_echo('user:password:text'); ?>
+</p>
+<p>
+       <label><?php echo elgg_echo('username'); ?></label>
+       <?php echo elgg_view('input/text', array('internalname' => 'username')); ?>
+</p>
+<?php echo elgg_view('input/captcha'); ?>
+<p>
+       <?php echo elgg_view('input/submit', array('value' => elgg_echo('request'))); ?>
+</p>
+
+<script type="text/javascript">
+       $(document).ready(function() {
+               $('input[name=username]').focus();
+       });
+</script>
\ No newline at end of file