diff options
-rw-r--r-- | engine/lib/install.php | 45 | ||||
-rw-r--r-- | install.php | 9 | ||||
-rw-r--r-- | views/default/pageshell.php | 2 |
3 files changed, 52 insertions, 4 deletions
diff --git a/engine/lib/install.php b/engine/lib/install.php new file mode 100644 index 000000000..79b170842 --- /dev/null +++ b/engine/lib/install.php @@ -0,0 +1,45 @@ +<?php
+
+ /**
+ * Elgg installation
+ * Various functions to assist with installing and upgrading the system
+ *
+ * @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/
+ */
+
+ /**
+ * Returns whether or not the database has been installed
+ *
+ * @return true|false Whether the database has been installed
+ */
+ function is_db_installed() {
+
+ $tables = get_db_tables();
+ if (!$tables) {
+ return false;
+ }
+ return true;
+
+ }
+
+ /**
+ * Returns whether or not other settings have been set
+ *
+ * @return true|false Whether or not the rest of the installation has been followed through with
+ */
+ function is_installed() {
+
+ global $CONFIG;
+ if (!empty($CONFIG->path))
+ return true;
+
+ return false;
+
+ }
+
+?>
\ No newline at end of file diff --git a/install.php b/install.php index 5e253eb1b..3be2b3c78 100644 --- a/install.php +++ b/install.php @@ -20,19 +20,20 @@ /**
* If we're installed, go back to the homepage
*/
- forward();
+ if (is_installed())
+ forward();
/**
* Install the database
*/
- $tables = get_db_tables();
- if (!$tables) {
+ if (!is_db_installed()) {
run_sql_script(dirname(__FILE__) . "/engine/schema/mysql.sql");
+ system_message("The Elgg database was installed.");
}
/**
* Load the front page
*/
- echo page_draw(null, elgg_view("homepage"));
+ echo page_draw("Installation", elgg_view("settings/system"));
?>
\ No newline at end of file diff --git a/views/default/pageshell.php b/views/default/pageshell.php index 648fa1ff6..499f1486e 100644 --- a/views/default/pageshell.php +++ b/views/default/pageshell.php @@ -20,6 +20,8 @@ // Set title
if (empty($vars['title'])) {
$title = $vars['config']->sitename;
+ } else if (empty($vars['config']->sitename)) {
+ $title = $vars['title'];
} else {
$title = $vars['config']->sitename . ": " . $vars['title'];
}
|