aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-22 20:58:21 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-22 20:58:21 +0000
commit46c278c3603765b623fa441e2435274fbeda05ad (patch)
treec2b926d3195aa71524f9c8b692e567cfd4605b9b /engine/lib/elgglib.php
parentf9ee6f1429f800c3eed3c0ef59d98219be32fba8 (diff)
downloadelgg-46c278c3603765b623fa441e2435274fbeda05ad.tar.gz
elgg-46c278c3603765b623fa441e2435274fbeda05ad.tar.bz2
Merged r6620:6653 from 1.7 branch into trunk
git-svn-id: http://code.elgg.org/elgg/trunk@6846 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php49
1 files changed, 11 insertions, 38 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 3d08227e4..1d52c0534 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -1624,7 +1624,7 @@ function is_not_null($string) {
function elgg_normalise_plural_options_array($options, $singulars) {
foreach ($singulars as $singular) {
$plural = $singular . 's';
-
+
if (array_key_exists($singular, $options)) {
if ($options[$singular] === ELGG_ENTITIES_ANY_VALUE) {
$options[$plural] = $options[$singular];
@@ -1632,7 +1632,7 @@ function elgg_normalise_plural_options_array($options, $singulars) {
$options[$plural] = array($options[$singular]);
}
}
-
+
unset($options[$singular]);
}
@@ -2167,6 +2167,12 @@ function __elgg_shutdown_hook() {
function elgg_init() {
global $CONFIG;
+ // Actions
+ register_action('comments/add');
+ register_action('comments/delete');
+ register_action('likes/add');
+ register_action('likes/delete');
+
// Page handler for JS
register_page_handler('js','js_page_handler');
@@ -2181,44 +2187,12 @@ function elgg_walled_garden_index() {
$login = elgg_view('account/forms/login_walled_garden');
page_draw('', $login, 'page_shells/walled_garden');
-
+
// @hack Index must exit to keep plugins from continuing to extend
exit;
}
/**
- * Boot Elgg
- * @return unknown_type
- */
-function elgg_boot() {
- global $CONFIG;
-
- // Actions
- register_action('comments/add');
- register_action('comments/delete');
- register_action('likes/add');
- register_action('likes/delete');
-
- elgg_view_register_simplecache('css');
- elgg_view_register_simplecache('js/friendsPickerv1');
- elgg_view_register_simplecache('js/initialise_elgg');
-
- // discover the built-in view types
- // @todo cache this
- $view_path = $CONFIG->viewpath;
- $CONFIG->view_types = array();
-
- $views = scandir($view_path);
-
- foreach ($views as $view) {
- if ('.' !== substr($view, 0, 1) && is_dir($view_path . $view)) {
- $CONFIG->view_types[] = $view;
- }
- }
-
-}
-
-/**
* Runs unit tests for the API.
*/
function elgg_api_test($hook, $type, $value, $params) {
@@ -2420,7 +2394,7 @@ function elgg_get_array_value($key, array $array, $default = NULL) {
*/
function elgg_sort_3d_array_by_value(&$array, $element, $sort_order = SORT_ASC, $sort_type = SORT_LOCALE_STRING) {
$sort = array();
-
+
foreach ($array as $k => $v) {
if (isset($v[$element])) {
$sort[] = strtolower($v[$element]);
@@ -2428,7 +2402,7 @@ function elgg_sort_3d_array_by_value(&$array, $element, $sort_order = SORT_ASC,
$sort[] = NULL;
}
};
-
+
return array_multisort($sort, $sort_order, $sort_type, $array);
}
@@ -2454,7 +2428,6 @@ define('REFERRER', -1);
define('REFERER', -1);
register_elgg_event_handler('init', 'system', 'elgg_init');
-register_elgg_event_handler('boot', 'system', 'elgg_boot', 1000);
register_plugin_hook('unit_test', 'system', 'elgg_api_test');
register_elgg_event_handler('init', 'system', 'add_custom_menu_items', 1000);