aboutsummaryrefslogtreecommitdiff
path: root/views/installation/install
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-05 10:53:40 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-05 10:53:40 +0000
commit7f01270ba106937300cf491927839d3428360d0a (patch)
tree589b179f84b2fb8d8c229099d0b9f6d3ece682ea /views/installation/install
parentf1c75074c96f8c8f144bc132f75443dd8502c440 (diff)
downloadelgg-7f01270ba106937300cf491927839d3428360d0a.tar.gz
elgg-7f01270ba106937300cf491927839d3428360d0a.tar.bz2
moved installation to its own viewtype
git-svn-id: http://code.elgg.org/elgg/trunk@7010 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/installation/install')
-rw-r--r--views/installation/install/footer.php10
-rw-r--r--views/installation/install/forms/admin.php21
-rw-r--r--views/installation/install/forms/database.php20
-rw-r--r--views/installation/install/forms/settings.php20
-rw-r--r--views/installation/install/forms/template.php27
-rw-r--r--views/installation/install/header.php6
-rw-r--r--views/installation/install/nav.php35
-rw-r--r--views/installation/install/pages/admin.php8
-rw-r--r--views/installation/install/pages/complete.php14
-rw-r--r--views/installation/install/pages/database.php16
-rw-r--r--views/installation/install/pages/requirements.php39
-rw-r--r--views/installation/install/pages/settings.php5
-rw-r--r--views/installation/install/pages/welcome.php8
-rw-r--r--views/installation/install/sidebar.php26
14 files changed, 255 insertions, 0 deletions
diff --git a/views/installation/install/footer.php b/views/installation/install/footer.php
new file mode 100644
index 000000000..69cd27f66
--- /dev/null
+++ b/views/installation/install/footer.php
@@ -0,0 +1,10 @@
+<?php
+/**
+ * Install footer - offers help links
+ */
+?>
+<ul>
+ <li><a href="http://docs.elgg.org/wiki/Installation">Install instructions</a></li>
+ <li><a href="http://docs.elgg.org/wiki/Install_Troubleshooting">Install troubleshooting</a></li>
+ <li><a href="http://community.elgg.org/pg/groups/world/">Elgg community forums</a></li>
+</ul> \ No newline at end of file
diff --git a/views/installation/install/forms/admin.php b/views/installation/install/forms/admin.php
new file mode 100644
index 000000000..ae83cadea
--- /dev/null
+++ b/views/installation/install/forms/admin.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Admin account form
+ *
+ * @uses $vars['variables'] Array of form variables. See ElggInstaller.
+ */
+
+$vars['type'] = 'admin';
+$form_body = elgg_view('install/forms/template', $vars);
+
+
+// @todo bug in current_page_url() with :8080 sites
+//$url = current_page_url();
+$url = '/install.php?step=admin';
+
+$params = array(
+ 'body' => $form_body,
+ 'action' => $url,
+ 'disable_security' => TRUE,
+);
+echo elgg_view('input/form', $params);
diff --git a/views/installation/install/forms/database.php b/views/installation/install/forms/database.php
new file mode 100644
index 000000000..a3fa8dd65
--- /dev/null
+++ b/views/installation/install/forms/database.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Database form
+ *
+ * @uses $vars['variables'] Array of form variables. See ElggInstaller.
+ */
+
+$vars['type'] = 'database';
+$form_body = elgg_view('install/forms/template', $vars);
+
+// @todo bug in current_page_url() with :8080 sites
+//$url = current_page_url();
+$url = '/install.php?step=database';
+
+$params = array(
+ 'body' => $form_body,
+ 'action' => $url,
+ 'disable_security' => TRUE,
+);
+echo elgg_view('input/form', $params);
diff --git a/views/installation/install/forms/settings.php b/views/installation/install/forms/settings.php
new file mode 100644
index 000000000..67cba10f6
--- /dev/null
+++ b/views/installation/install/forms/settings.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Site settings form
+ *
+ * @uses $vars['variables'] Array of form variables. See ElggInstaller.
+ */
+
+$vars['type'] = 'settings';
+$form_body = elgg_view('install/forms/template', $vars);
+
+// @todo bug in current_page_url() with :8080 sites
+//$url = current_page_url();
+$url = '/install.php?step=settings';
+
+$params = array(
+ 'body' => $form_body,
+ 'action' => $url,
+ 'disable_security' => TRUE,
+);
+echo elgg_view('input/form', $params);
diff --git a/views/installation/install/forms/template.php b/views/installation/install/forms/template.php
new file mode 100644
index 000000000..a2d93f42e
--- /dev/null
+++ b/views/installation/install/forms/template.php
@@ -0,0 +1,27 @@
+<?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("installation:$type:label:$field");
+ $help = elgg_echo("installation:$type:help:$field");
+ $params['internalname'] = $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>';
+}
+
+$form_body .= elgg_view('input/submit', array('value' => elgg_echo('next')));
+
+echo $form_body;
diff --git a/views/installation/install/header.php b/views/installation/install/header.php
new file mode 100644
index 000000000..d821e31e5
--- /dev/null
+++ b/views/installation/install/header.php
@@ -0,0 +1,6 @@
+<?php
+/**
+ * Install header
+ */
+?>
+<h1>Elgg</h1>
diff --git a/views/installation/install/nav.php b/views/installation/install/nav.php
new file mode 100644
index 000000000..d6a20ea2b
--- /dev/null
+++ b/views/installation/install/nav.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Navigation for installation pages
+ *
+ * @uses $vars['url'] base url of site
+ * @uses $vars['next_step'] next step as string
+ * @uses $vars['refresh'] should refresh button be shown?
+ * @uses $vars['advance'] should the next button be active?
+ */
+
+
+// has a refresh button been requested
+$refresh = '';
+if (isset($vars['refresh']) && $vars['refresh']) {
+ $refresh_text = elgg_echo('Refresh');
+ $refresh = "<a href=\"\">$refresh_text</a>";
+}
+
+// create next button and selectively disable
+$next_text = elgg_echo('next');
+$next_link = "{$vars['url']}install.php?step={$vars['next_step']}";
+$next = "<a href=\"$next_link\" disable=\"disable\">$next_text</a>";
+if (isset($vars['advance']) && !$vars['advance']) {
+ // disable the next button
+ $next = "<a class=\"disabled\">$next_text</a>";
+}
+
+
+echo <<<___END
+<div class="install_nav">
+ $next
+ $refresh
+</div>
+
+___END;
diff --git a/views/installation/install/pages/admin.php b/views/installation/install/pages/admin.php
new file mode 100644
index 000000000..1fdd5dced
--- /dev/null
+++ b/views/installation/install/pages/admin.php
@@ -0,0 +1,8 @@
+<?php
+/**
+ * Install create admin account page
+ */
+
+echo autop(elgg_echo('install:admin:instructions'));
+
+echo elgg_view('install/forms/admin', $vars);
diff --git a/views/installation/install/pages/complete.php b/views/installation/install/pages/complete.php
new file mode 100644
index 000000000..60838a630
--- /dev/null
+++ b/views/installation/install/pages/complete.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * Install completion page
+ */
+
+echo autop(elgg_echo('install:complete:instructions'));
+
+?>
+
+<div class="install_nav">
+<?php
+ echo "<a href=\"{$vars['url']}index.php\">Go to site</a>";
+?>
+</div>
diff --git a/views/installation/install/pages/database.php b/views/installation/install/pages/database.php
new file mode 100644
index 000000000..7765c6e48
--- /dev/null
+++ b/views/installation/install/pages/database.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Install database page
+ *
+ * @uses $vars['failure'] Settings file exists but something went wrong
+ */
+
+if (isset($vars['failure']) && $vars['failure']) {
+ echo autop(elgg_echo('install:database:error'));
+ $vars['refresh'] = TRUE;
+ $vars['advance'] = FALSE;
+ echo elgg_view('install/nav', $vars);
+} else {
+ echo autop(elgg_echo('install:database:instructions'));
+ echo elgg_view('install/forms/database', $vars);
+} \ No newline at end of file
diff --git a/views/installation/install/pages/requirements.php b/views/installation/install/pages/requirements.php
new file mode 100644
index 000000000..b6516840f
--- /dev/null
+++ b/views/installation/install/pages/requirements.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Install requirements checking page
+ *
+ * @uses $vars['num_failures] Number of requirements failures
+ * @uses $vars['num_warnings] Number of recommendation warnings
+ */
+
+if ($vars['num_failures'] != 0) {
+ $instruct_text = elgg_echo('install:requirements:instructions:failure');
+} elseif ($vars['num_warnings'] != 0) {
+ $instruct_text = elgg_echo('install:requirements:instructions:warning');
+} else {
+ $instruct_text = elgg_echo('install:requirements:instructions:success');
+}
+
+echo autop($instruct_text);
+
+$report = $vars['report'];
+foreach ($report as $category => $checks) {
+ $title = elgg_echo("install:require:$category");
+ echo "<h3>$title</h3>";
+ echo "<ul>";
+ foreach ($checks as $check) {
+ echo "<li class=\"{$check['severity']}\">";
+ echo autop($check['message']);
+ echo "</li>";
+ }
+ echo "</ul>";
+}
+
+$vars['refresh'] = TRUE;
+
+// cannot advance to next step with a failure
+if ($vars['num_failures'] != 0) {
+ $vars['advance'] = FALSE;
+}
+
+echo elgg_view('install/nav', $vars);
diff --git a/views/installation/install/pages/settings.php b/views/installation/install/pages/settings.php
new file mode 100644
index 000000000..6f20573ef
--- /dev/null
+++ b/views/installation/install/pages/settings.php
@@ -0,0 +1,5 @@
+<?php
+
+echo autop(elgg_echo('install:settings:instructions'));
+
+echo elgg_view('install/forms/settings', $vars);
diff --git a/views/installation/install/pages/welcome.php b/views/installation/install/pages/welcome.php
new file mode 100644
index 000000000..f069e4ba7
--- /dev/null
+++ b/views/installation/install/pages/welcome.php
@@ -0,0 +1,8 @@
+<?php
+/**
+ * Install welcome page
+ */
+
+echo autop(elgg_echo('install:welcome:instructions'));
+
+echo elgg_view('install/nav', $vars);
diff --git a/views/installation/install/sidebar.php b/views/installation/install/sidebar.php
new file mode 100644
index 000000000..8136cd898
--- /dev/null
+++ b/views/installation/install/sidebar.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Install sidebar
+ *
+ * @uses $vars['step'] Current step
+ * @uses $vars['steps'] Array of steps
+ */
+
+$current_step = $vars['step'];
+$steps = $vars['steps'];
+
+$current_step_index = array_search($current_step, $steps);
+
+echo '<ol>';
+foreach ($steps as $index => $step) {
+ if ($index < $current_step_index) {
+ $class = 'past';
+ } elseif ($index == $current_step_index) {
+ $class = 'present';
+ } else {
+ $class = 'future';
+ }
+ $text = elgg_echo("install:$step");
+ echo "<li class=\"$class\">$text</li>";
+}
+echo '</ol>';