aboutsummaryrefslogtreecommitdiff
path: root/views/failsafe
diff options
context:
space:
mode:
Diffstat (limited to 'views/failsafe')
-rw-r--r--views/failsafe/input/password.php23
-rw-r--r--views/failsafe/install/footer.php10
-rw-r--r--views/failsafe/install/forms/admin.php21
-rw-r--r--views/failsafe/install/forms/database.php20
-rw-r--r--views/failsafe/install/forms/settings.php20
-rw-r--r--views/failsafe/install/forms/template.php27
-rw-r--r--views/failsafe/install/header.php6
-rw-r--r--views/failsafe/install/nav.php35
-rw-r--r--views/failsafe/install/pages/admin.php8
-rw-r--r--views/failsafe/install/pages/complete.php14
-rw-r--r--views/failsafe/install/pages/database.php16
-rw-r--r--views/failsafe/install/pages/requirements.php39
-rw-r--r--views/failsafe/install/pages/settings.php5
-rw-r--r--views/failsafe/install/pages/welcome.php8
-rw-r--r--views/failsafe/install/sidebar.php26
-rw-r--r--views/failsafe/page_shells/install.php51
16 files changed, 329 insertions, 0 deletions
diff --git a/views/failsafe/input/password.php b/views/failsafe/input/password.php
new file mode 100644
index 000000000..461f77955
--- /dev/null
+++ b/views/failsafe/input/password.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Elgg password input
+ * Displays a password input field
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ *
+ * @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
+ *
+ */
+
+$class = $vars['class'];
+if (!$class) {
+ $class = "input_password";
+}
+?>
+
+<input type="password" <?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; ?>" />
diff --git a/views/failsafe/install/footer.php b/views/failsafe/install/footer.php
new file mode 100644
index 000000000..69cd27f66
--- /dev/null
+++ b/views/failsafe/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/failsafe/install/forms/admin.php b/views/failsafe/install/forms/admin.php
new file mode 100644
index 000000000..ae83cadea
--- /dev/null
+++ b/views/failsafe/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/failsafe/install/forms/database.php b/views/failsafe/install/forms/database.php
new file mode 100644
index 000000000..a3fa8dd65
--- /dev/null
+++ b/views/failsafe/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/failsafe/install/forms/settings.php b/views/failsafe/install/forms/settings.php
new file mode 100644
index 000000000..67cba10f6
--- /dev/null
+++ b/views/failsafe/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/failsafe/install/forms/template.php b/views/failsafe/install/forms/template.php
new file mode 100644
index 000000000..a2d93f42e
--- /dev/null
+++ b/views/failsafe/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/failsafe/install/header.php b/views/failsafe/install/header.php
new file mode 100644
index 000000000..d821e31e5
--- /dev/null
+++ b/views/failsafe/install/header.php
@@ -0,0 +1,6 @@
+<?php
+/**
+ * Install header
+ */
+?>
+<h1>Elgg</h1>
diff --git a/views/failsafe/install/nav.php b/views/failsafe/install/nav.php
new file mode 100644
index 000000000..d6a20ea2b
--- /dev/null
+++ b/views/failsafe/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/failsafe/install/pages/admin.php b/views/failsafe/install/pages/admin.php
new file mode 100644
index 000000000..1fdd5dced
--- /dev/null
+++ b/views/failsafe/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/failsafe/install/pages/complete.php b/views/failsafe/install/pages/complete.php
new file mode 100644
index 000000000..60838a630
--- /dev/null
+++ b/views/failsafe/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/failsafe/install/pages/database.php b/views/failsafe/install/pages/database.php
new file mode 100644
index 000000000..7765c6e48
--- /dev/null
+++ b/views/failsafe/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/failsafe/install/pages/requirements.php b/views/failsafe/install/pages/requirements.php
new file mode 100644
index 000000000..b6516840f
--- /dev/null
+++ b/views/failsafe/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/failsafe/install/pages/settings.php b/views/failsafe/install/pages/settings.php
new file mode 100644
index 000000000..6f20573ef
--- /dev/null
+++ b/views/failsafe/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/failsafe/install/pages/welcome.php b/views/failsafe/install/pages/welcome.php
new file mode 100644
index 000000000..f069e4ba7
--- /dev/null
+++ b/views/failsafe/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/failsafe/install/sidebar.php b/views/failsafe/install/sidebar.php
new file mode 100644
index 000000000..8136cd898
--- /dev/null
+++ b/views/failsafe/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>';
diff --git a/views/failsafe/page_shells/install.php b/views/failsafe/page_shells/install.php
new file mode 100644
index 000000000..b023197fa
--- /dev/null
+++ b/views/failsafe/page_shells/install.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Elgg install pageshell
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ *
+ * @uses $vars['title'] The page title
+ * @uses $vars['body'] The main content of the page
+ * @uses $vars['sysmessages'] Array of system status messages
+ */
+
+// we won't trust server configuration but specify utf-8
+header('Content-type: text/html; charset=utf-8');
+
+// turn off browser caching
+header('Pragma: public', TRUE);
+header("Cache-Control: no-cache, must-revalidate", TRUE);
+header('Expires: Fri, 05 Feb 1982 00:00:00 -0500', TRUE);
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <title>Elgg Install : <?php echo $vars['title']; ?></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="SHORTCUT ICON" href="<?php echo $vars['url']; ?>_graphics/favicon.ico" />
+ <link rel="stylesheet" href="<?php echo $vars['url']; ?>install/install.css" type="text/css" />
+ </head>
+ <body>
+ <div id="elgg_wrapper">
+ <div id="elgg_header">
+ <?php echo elgg_view('install/header', $vars); ?>
+ </div>
+ <div id="elgg_sidebar">
+ <?php echo elgg_view('install/sidebar', $vars); ?>
+ </div>
+ <div id="elgg_content">
+ <h2><?php echo $vars['title']; ?></h2>
+ <?php echo elgg_view('messages/list', array('object' => $vars['sysmessages'])); ?>
+ <?php echo $vars['body']; ?>
+ </div>
+ <div class="clearfloat"></div>
+ </div>
+ <div id="elgg_footer">
+ <?php echo elgg_view('install/footer'); ?>
+ </div>
+ </body>
+</html>