diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-05 19:14:48 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-05 19:14:48 +0000 |
commit | ff31226fdeb972aac2f37f0098240cb366a9bb26 (patch) | |
tree | 1f0caa75c9a340cf28ce9a81a4cbe3230d13abf3 /actions/systemsettings/install.php | |
parent | 81ffac29fabc175eebdbf95578da046f4f00611b (diff) | |
download | elgg-ff31226fdeb972aac2f37f0098240cb366a9bb26.tar.gz elgg-ff31226fdeb972aac2f37f0098240cb366a9bb26.tar.bz2 |
Merged 18_new_admin branch to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@5977 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions/systemsettings/install.php')
-rw-r--r-- | actions/systemsettings/install.php | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/actions/systemsettings/install.php b/actions/systemsettings/install.php index 18440c62d..589e3a06c 100644 --- a/actions/systemsettings/install.php +++ b/actions/systemsettings/install.php @@ -10,8 +10,11 @@ * @link http://elgg.org/ */ +global $CONFIG; define('INSTALLING', TRUE); -elgg_set_viewtype('failsafe'); // Set failsafe again incase we get an exception thrown + +// Set failsafe again in case we get an exception thrown +elgg_set_viewtype('failsafe'); if (is_installed()) { forward(); @@ -43,7 +46,6 @@ if (get_input('settings') == 'go') { $site->name = get_input('sitename'); $site->url = $url; $site->description = get_input('sitedescription'); - $site->email = get_input('siteemail'); $site->access_id = ACCESS_PUBLIC; $guid = $site->save(); @@ -51,6 +53,12 @@ if (get_input('settings') == 'go') { throw new InstallationException(sprintf(elgg_echo('InstallationException:CantCreateSite'), get_input('sitename'), get_input('wwwroot'))); } + $site->email = get_input('siteemail'); + + // this is needed to grab plugins + $CONFIG->site_guid = $guid; + $CONFIG->site = $site; + datalist_set('installed',time()); datalist_set('path', $path); datalist_set('dataroot', $dataroot); @@ -94,16 +102,18 @@ if (get_input('settings') == 'go') { enable_plugin(trim($plugin), $site->getGUID()); } } else { - enable_plugin('profile', $site->getGUID()); - enable_plugin('logbrowser', $site->getGUID()); - enable_plugin('diagnostics', $site->getGUID()); - enable_plugin('uservalidationbyemail', $site->getGUID()); - enable_plugin('htmlawed', $site->getGUID()); - enable_plugin('search', $site->getGUID()); + // activate plugins with manifest.xml: elgg_install_state = enabled + $plugins = get_plugin_list(); + foreach ($plugins as $plugin) { + if ($manifest = load_plugin_manifest($plugin)) { + if (isset($manifest['elgg_install_state']) && $manifest['elgg_install_state'] == 'enabled') { + enable_plugin($plugin); + } + } + } } // reset the views path in case of installing over an old data dir. - // @todo should this warn / error first? $dataroot = datalist_get('dataroot'); $cache = new ElggFileCache($dataroot); $cache->delete('view_paths'); |