aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/start.php22
-rw-r--r--views/default/messages/errors/error.php20
-rw-r--r--views/default/messages/errors/list.php31
-rw-r--r--views/default/pageshell.php27
4 files changed, 92 insertions, 8 deletions
diff --git a/engine/start.php b/engine/start.php
index ca1875bbc..3aef3c803 100644
--- a/engine/start.php
+++ b/engine/start.php
@@ -16,7 +16,7 @@
* Load important prerequisites
*/
- if (!@include(dirname(__FILE__) . "/lib/elgglib.php")) { // Main Elgg library
+ if (!@include_once(dirname(__FILE__) . "/lib/elgglib.php")) { // Main Elgg library
echo "Error in installation: could not load the main Elgg library.";
exit;
}
@@ -25,8 +25,7 @@
* Load the system settings
*/
- if (!@include_once(dirname(__FILE__) . "/settings.php")) // Global settings
- register_error("Could not load the settings file.");
+ @include_once(dirname(__FILE__) . "/settings.php"); // Global settings
/**
* If there are basic issues with the way the installation is formed, don't bother trying
@@ -68,13 +67,20 @@
register_error("Could not load {$file}");
}
- } // End portion for sanitised installs only
-
+ } else { // End portion for sanitised installs only
+ register_error("Elgg is not ready to run.");
+ }
+
// Trigger events
trigger_event('init', 'system');
- if ($count = count_messages("errors")) {
-
- }
+ // If we have load errors, display them
+ if ($count = count_messages("errors")) {
+ echo elgg_view('pageshell', array(
+ 'title' => "Error",
+ 'body' => elgg_view('messages/errors/list',array('object' => system_messages(null, "errors")))
+ ));
+ exit;
+ }
?> \ No newline at end of file
diff --git a/views/default/messages/errors/error.php b/views/default/messages/errors/error.php
new file mode 100644
index 000000000..078e25949
--- /dev/null
+++ b/views/default/messages/errors/error.php
@@ -0,0 +1,20 @@
+<?php
+
+ /**
+ * Elgg error message
+ * Displays a single error message
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ * @uses $vars['object'] An error message (string)
+ */
+?>
+
+ <p>
+ <?php echo nl2br($vars['object']); ?>
+ </p> \ No newline at end of file
diff --git a/views/default/messages/errors/list.php b/views/default/messages/errors/list.php
new file mode 100644
index 000000000..9644b7f5a
--- /dev/null
+++ b/views/default/messages/errors/list.php
@@ -0,0 +1,31 @@
+<?php
+
+ /**
+ * Elgg list errors
+ * Lists error messages
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ * @uses $vars['object'] An array of error messages
+ */
+
+?>
+
+ <div class="messages">
+ <div class="messages-errors">
+
+<?php
+ if (!empty($vars['object']) && is_array($vars['object'])) {
+ foreach($vars['object'] as $error) {
+ echo elgg_view('messages/errors/error',array('object' => $error));
+ }
+ }
+
+?>
+ </div>
+ </div> \ No newline at end of file
diff --git a/views/default/pageshell.php b/views/default/pageshell.php
new file mode 100644
index 000000000..a751143ee
--- /dev/null
+++ b/views/default/pageshell.php
@@ -0,0 +1,27 @@
+<?php
+
+ /**
+ * Elgg pageshell
+ * The standard HTML page shell that everything else fits into
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ * @uses $vars['title'] The page title
+ * @uses $vars['body'] The main content of the page
+ */
+?>
+
+<html>
+ <head>
+ <title><?php echo $vars['title']; ?></title>
+ </head>
+ <body>
+ <h1><?php echo $vars['title']; ?></h1>
+ <?php echo $vars['body']; ?>
+ </body>
+</html> \ No newline at end of file