diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2012-04-24 10:15:47 -0700 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2012-04-24 10:15:47 -0700 |
commit | 12e1aa2e380c6ea13251d2e626228483c4ab8da5 (patch) | |
tree | b8eb99079814e9a3d38d7a4a723d03b66833e688 /engine | |
parent | d7aa2b803949462c8939eb16f072ab53e174c85d (diff) | |
parent | 690932e832edcb8ca0178cd576737cd38a95d5b6 (diff) | |
download | elgg-12e1aa2e380c6ea13251d2e626228483c4ab8da5.tar.gz elgg-12e1aa2e380c6ea13251d2e626228483c4ab8da5.tar.bz2 |
Merge branch 'walled_garden' of https://github.com/cash/Elgg into 1.8
Diffstat (limited to 'engine')
-rw-r--r-- | engine/classes/ElggSite.php | 1 | ||||
-rw-r--r-- | engine/lib/elgglib.php | 28 |
2 files changed, 28 insertions, 1 deletions
diff --git a/engine/classes/ElggSite.php b/engine/classes/ElggSite.php index af3999321..6d07778a9 100644 --- a/engine/classes/ElggSite.php +++ b/engine/classes/ElggSite.php @@ -422,6 +422,7 @@ class ElggSite extends ElggEntity { // default public pages $defaults = array( + 'walled_garden/.*', 'action/login', 'register', 'action/register', diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 11bdc7285..b55958a6c 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -2021,8 +2021,14 @@ function elgg_walled_garden_index() { elgg_load_css('elgg.walled_garden'); elgg_load_js('elgg.walled_garden'); - $body = elgg_view('core/walled_garden/body'); + $content = elgg_view('core/walled_garden/login'); + $params = array( + 'content' => $content, + 'class' => 'elgg-walledgarden-double', + 'id' => 'elgg-walledgarden-login', + ); + $body = elgg_view_layout('walled_garden', $params); echo elgg_view_page('', $body, 'walled_garden'); // return true to prevent other plugins from adding a front page @@ -2030,6 +2036,24 @@ function elgg_walled_garden_index() { } /** + * Serve walled garden sections + * + * @param array $page Array of URL segments + * @return string + * @access private + */ +function _elgg_walled_garden_ajax_handler($page) { + $view = $page[0]; + $params = array( + 'content' => elgg_view("core/walled_garden/$view"), + 'class' => 'elgg-walledgarden-single hidden', + 'id' => str_replace('_', '-', "elgg-walledgarden-$view"), + ); + echo elgg_view_layout('walled_garden', $params); + return true; +} + +/** * Checks the status of the Walled Garden and forwards to a login page * if required. * @@ -2049,6 +2073,8 @@ function elgg_walled_garden() { elgg_register_css('elgg.walled_garden', '/css/walled_garden.css'); elgg_register_js('elgg.walled_garden', '/js/walled_garden.js'); + elgg_register_page_handler('walled_garden', '_elgg_walled_garden_ajax_handler'); + // check for external page view if (isset($CONFIG->site) && $CONFIG->site instanceof ElggSite) { $CONFIG->site->checkWalledGarden(); |