aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-02-10 07:24:11 -0500
committerCash Costello <cash.costello@gmail.com>2012-02-10 07:24:11 -0500
commit69786dcc8ad1c193f3b4fff36807e6dc92da1d8d (patch)
tree32d65b2a50b9e32caabd1db47152cd0cecfab228 /engine/lib/elgglib.php
parentd26a5cb9cd5c49ec2c3fe94a1bbbc7f8b81cd010 (diff)
downloadelgg-69786dcc8ad1c193f3b4fff36807e6dc92da1d8d.tar.gz
elgg-69786dcc8ad1c193f3b4fff36807e6dc92da1d8d.tar.bz2
new layout and ajax loading for walled garden
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php26
1 files changed, 25 insertions, 1 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 11bdc7285..5c444c2f5 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -2021,8 +2021,13 @@ 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',
+ );
+ $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 +2035,23 @@ 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',
+ );
+ 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 +2071,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();