aboutsummaryrefslogtreecommitdiff
path: root/mod/custom_index_widgets/index.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2013-11-09 16:19:23 +0100
committerSem <sembrestels@riseup.net>2013-11-09 16:19:23 +0100
commitd44f0965e80edd003dca4c85f5bdbc462affbe8a (patch)
tree9ef0b1374ab77f3512e10335107175f2281b80cf /mod/custom_index_widgets/index.php
parented6d980dcb06a66e1746fe4959aa138c39fb4e9e (diff)
parentc76018e381332ccb4aed03fbebd80a6b151cd5e5 (diff)
downloadelgg-d44f0965e80edd003dca4c85f5bdbc462affbe8a.tar.gz
elgg-d44f0965e80edd003dca4c85f5bdbc462affbe8a.tar.bz2
Add 'mod/custom_index_widgets/' from commit 'c76018e381332ccb4aed03fbebd80a6b151cd5e5'
git-subtree-dir: mod/custom_index_widgets git-subtree-mainline: ed6d980dcb06a66e1746fe4959aa138c39fb4e9e git-subtree-split: c76018e381332ccb4aed03fbebd80a6b151cd5e5
Diffstat (limited to 'mod/custom_index_widgets/index.php')
-rw-r--r--mod/custom_index_widgets/index.php66
1 files changed, 66 insertions, 0 deletions
diff --git a/mod/custom_index_widgets/index.php b/mod/custom_index_widgets/index.php
new file mode 100644
index 000000000..dac0db036
--- /dev/null
+++ b/mod/custom_index_widgets/index.php
@@ -0,0 +1,66 @@
+<?php
+
+ elgg_set_context('custom_index_widgets');
+ elgg_set_page_owner_guid(elgg_get_config('site_guid'));
+
+ $widgettypes = elgg_get_widget_types();
+
+ $page_owner = elgg_get_page_owner_guid();
+ $ciw_layout = elgg_get_plugin_setting("ciw_layout", "custom_index_widgets");
+ $ciw_showdashboard = elgg_get_plugin_setting("ciw_showdashboard", "custom_index_widgets");
+
+ $customwidgets = elgg_get_widgets($page_owner, elgg_get_context());
+ $area1widgets = isset($customwidgets[1]) ? $customwidgets[1] : FALSE;
+ $area2widgets = isset($customwidgets[2]) ? $customwidgets[2] : FALSE;
+ $area3widgets = isset($customwidgets[3]) ? $customwidgets[3] : FALSE;
+ /*
+ $area1widgets = elgg_get_widgets($page_owner,elgg_get_context(),1);
+ $area2widgets = elgg_get_widgets($page_owner,elgg_get_context(),2);
+ $area3widgets = elgg_get_widgets($page_owner,elgg_get_context(),3);
+ */
+
+ if (empty($area1widgets) && empty($area2widgets) && empty($area3widgets)) {
+
+ if (isset($vars['area3'])) $vars['area1'] = $vars['area3'];
+ if (isset($vars['area4'])) $vars['area2'] = $vars['area4'];
+ }
+
+ $leftcolumn_widgets_view = custom_index_build_columns($area1widgets,$widgettypes);
+ $middlecolumn_widgets_view = custom_index_build_columns($area2widgets,$widgettypes);
+ $rightcolumn_widgets_view = custom_index_build_columns($area3widgets,$widgettypes);
+
+
+ $content = elgg_view_layout($ciw_layout, array('area1' => $leftcolumn_widgets_view,'area2' => $middlecolumn_widgets_view,'area3' => $rightcolumn_widgets_view, 'layoutmode' => 'index_mode') );
+
+ if (elgg_is_logged_in() && $ciw_showdashboard=="yes"){
+
+ $user_guid = elgg_get_logged_in_user_guid();
+ elgg_set_page_owner_guid($user_guid);
+ elgg_set_context('dashboard');
+
+
+ $dashboardwidgets = elgg_get_widgets($user_guid, elgg_get_context());
+ $area1widgets = isset($dashboardwidgets[1]) ? $dashboardwidgets[1] : FALSE;
+ $area2widgets = isset($dashboardwidgets[2]) ? $dashboardwidgets[2] : FALSE;
+ $area3widgets = isset($dashboardwidgets[3]) ? $dashboardwidgets[3] : FALSE;
+ /*
+ $area1widgets = elgg_get_widgets($user_guid,elgg_get_context(),1);
+ $area2widgets = elgg_get_widgets($user_guid,elgg_get_context(),2);
+ $area3widgets = elgg_get_widgets($user_guid,elgg_get_context(),3);
+ */
+ if (empty($area1widgets) && empty($area2widgets) && empty($area3widgets)) {
+
+ if (isset($vars['area3'])) $vars['area1'] = $vars['area3'];
+ if (isset($vars['area4'])) $vars['area2'] = $vars['area4'];
+
+ }
+
+ $leftcolumn_widgets_view = custom_index_build_columns($area1widgets,$widgettypes);
+ $middlecolumn_widgets_view = custom_index_build_columns($area2widgets,$widgettypes);
+ $rightcolumn_widgets_view = custom_index_build_columns($area3widgets,$widgettypes);
+
+ $content .= elgg_view_layout($ciw_layout, array('area1' => $leftcolumn_widgets_view,'area2' => $middlecolumn_widgets_view,'area3' => $rightcolumn_widgets_view, 'layoutmode' => 'index_mode') );
+ }
+
+ echo elgg_view_page('Index', $content);
+?> \ No newline at end of file