]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Converted installation forms to use elgg_view_form and the /forms/ directory
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 25 Feb 2011 18:44:57 +0000 (18:44 +0000)
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 25 Feb 2011 18:44:57 +0000 (18:44 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8465 36083f99-b078-4883-b0ff-0f9b5a30f544

views/installation/install/forms/admin.php [deleted file]
views/installation/install/forms/database.php [deleted file]
views/installation/install/forms/settings.php [deleted file]
views/installation/install/forms/template.php [deleted file]
views/installation/install/pages/admin.php
views/installation/install/pages/database.php
views/installation/install/pages/settings.php

diff --git a/views/installation/install/forms/admin.php b/views/installation/install/forms/admin.php
deleted file mode 100644 (file)
index d860096..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-/**
- * Admin account form
- *
- * @uses $vars['variables'] Array of form variables. See ElggInstaller.
- * 
- * @todo Forms 1.8: Convert to use elgg_view_form
- */
-
-$vars['type'] = 'admin';
-$form_body = elgg_view('install/forms/template', $vars);
-
-$url = current_page_url();
-
-$params = array(
-       'body' => $form_body,
-       'action' => $url,
-       'disable_security' => TRUE,
-       'js' => 'onsubmit="return elggCheckFormSubmission()"',
-);
-echo elgg_view('input/form', $params);
diff --git a/views/installation/install/forms/database.php b/views/installation/install/forms/database.php
deleted file mode 100644 (file)
index 02e3816..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-/**
- * Database form
- *
- * @uses $vars['variables'] Array of form variables. See ElggInstaller.
- * 
- * @todo Forms 1.8: Convert to use elgg_view_form
- */
-
-$vars['type'] = 'database';
-$form_body = elgg_view('install/forms/template', $vars);
-
-$url = current_page_url();
-
-$params = array(
-       'body' => $form_body,
-       'action' => $url,
-       'disable_security' => TRUE,
-       'js' => 'onsubmit="return elggCheckFormSubmission()"',
-);
-echo elgg_view('input/form', $params);
diff --git a/views/installation/install/forms/settings.php b/views/installation/install/forms/settings.php
deleted file mode 100644 (file)
index 3aa90c1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-/**
- * Site settings form
- *
- * @uses $vars['variables'] Array of form variables. See ElggInstaller.
- * 
- * @todo Forms 1.8: Convert to use elgg_view_form
- */
-
-$vars['type'] = 'settings';
-$form_body = elgg_view('install/forms/template', $vars);
-
-$url = current_page_url();
-
-$params = array(
-       'body' => $form_body,
-       'action' => $url,
-       'disable_security' => TRUE,
-       'js' => 'onsubmit="return elggCheckFormSubmission()"',
-);
-echo elgg_view('input/form', $params);
diff --git a/views/installation/install/forms/template.php b/views/installation/install/forms/template.php
deleted file mode 100644 (file)
index 5e44d92..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/**
- * Generic form template for install forms
- *
- * @uses $vars['variables']
- * @uses $vars['type'] Type of form: admin, database, settings
- */
-
-$variables = $vars['variables'];
-$type = $vars['type'];
-
-$form_body = '';
-foreach ($variables as $field => $params) {
-       $label = elgg_echo("install:$type:label:$field");
-       $help = elgg_echo("install:$type:help:$field");
-       $params['name'] = $field;
-
-       $form_body .= '<p>';
-       $form_body .= "<label>$label</label>";
-       $form_body .= elgg_view("input/{$params['type']}", $params);
-       $form_body .= "<span class=\"install-help\">$help</span>";
-       $form_body .= '</p>';
-}
-
-$submit_params = array(
-       'value' => elgg_echo('next'),
-);
-$form_body .= elgg_view('input/submit', $submit_params);
-
-echo $form_body;
-
-?>
-<?php //@todo JS 1.8: no ?>
-<script type="text/javascript">
-       var was_submitted = false;
-       function elggCheckFormSubmission() {
-               if (was_submitted == false) {
-                       was_submitted = true;
-                       return true;
-               }
-               return false;
-       }
-</script>
index 1fdd5dced12086b3164e9e47bc20f8928cccae1d..c9d244416c5b02dbecb87895aad13ea758e10348 100644 (file)
@@ -5,4 +5,14 @@
 
 echo autop(elgg_echo('install:admin:instructions'));
 
-echo elgg_view('install/forms/admin', $vars);
+$vars['type'] = 'admin';
+
+$url = current_page_url();
+
+$form_vars = array(
+       'action' => $url,
+       'disable_security' => TRUE,
+       'onsubmit' => 'return elggCheckFormSubmission()',
+);
+
+echo elgg_view_form('install/template', $form_vars, $vars);
index 7765c6e486c63bbddb9f37744db974e639e263fc..003571232e3935638cca20fefcbdb8ff9bda8e33 100644 (file)
@@ -12,5 +12,16 @@ if (isset($vars['failure']) && $vars['failure']) {
        echo elgg_view('install/nav', $vars);
 } else {
        echo autop(elgg_echo('install:database:instructions'));
-       echo elgg_view('install/forms/database', $vars);
+       
+       $vars['type'] = 'database';
+       
+       $url = current_page_url();
+       
+       $form_vars = array(
+               'action' => $url,
+               'disable_security' => TRUE,
+               'onsubmit' => 'return elggCheckFormSubmission()',
+       );
+       
+       echo elgg_view_form('install/template', $form_vars, $vars);
 }
\ No newline at end of file
index 6f20573ef6bb30be47541fc20a2dffa8127a2107..d1fd0a9ffd43ba078835956b22dd90e02f2592f6 100644 (file)
@@ -2,4 +2,14 @@
 
 echo autop(elgg_echo('install:settings:instructions'));
 
-echo elgg_view('install/forms/settings', $vars);
+$vars['type'] = 'settings';
+
+$url = current_page_url();
+
+$form_vars = array(
+       'action' => $url,
+       'disable_security' => TRUE,
+       'onsubmit' => 'return elggCheckFormSubmission()',
+);
+
+echo elgg_view_form('install/template', $form_vars, $vars);