diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-19 19:30:24 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-19 19:30:24 +0000 |
commit | 93cf8041ef996eae3912116cee572f7ff26efc92 (patch) | |
tree | a4d843ebd49c4550a775f420b40e5e81f00ddab8 /views/default/admin | |
parent | 7dfe81901f078340a9d7fb0bd9edf70d66c0b723 (diff) | |
download | elgg-93cf8041ef996eae3912116cee572f7ff26efc92.tar.gz elgg-93cf8041ef996eae3912116cee572f7ff26efc92.tar.bz2 |
Refs #2753. Missed this one.
git-svn-id: http://code.elgg.org/elgg/trunk@8343 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/admin')
-rw-r--r-- | views/default/admin/appearance/default_widgets.php | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/views/default/admin/appearance/default_widgets.php b/views/default/admin/appearance/default_widgets.php new file mode 100644 index 000000000..45d2f5652 --- /dev/null +++ b/views/default/admin/appearance/default_widgets.php @@ -0,0 +1,63 @@ +<?php +/** + * Default widgets landing page. + * + * @package Elgg.Core + * @subpackage Administration.DefaultWidgets + */ + +elgg_push_context('default_widgets'); +$widget_context = get_input('widget_context'); +$list = elgg_trigger_plugin_hook('get_list', 'default_widgets', null, array()); + +// default to something if we can +if (!$widget_context && $list) { + $widget_context = $list[0]['widget_context']; +} + +$current_info = null; +$tabs = array(); +foreach ($list as $info) { + $url = "pg/admin/appearance/default_widgets?widget_context={$info['widget_context']}"; + $selected = false; + if ($widget_context == $info['widget_context']) { + $selected = true; + $current_info = $info; + } + + $tabs[] = array( + 'title' => $info['name'], + 'url' => $url, + 'selected' => $selected + ); +} + +$tabs_vars = array( + 'tabs' => $tabs +); + +echo elgg_view('navigation/tabs', $tabs_vars); + +if (!$current_info) { + $content = elgg_echo('admin:appearance:default_widgets:unknown_type'); +} else { + // default widgets are owned and saved to the site. + elgg_set_page_owner_guid(elgg_get_config('site_guid')); + elgg_push_context($current_info['widget_context']); + + $default_widgets_input = elgg_view('input/hidden', array( + 'name' => 'default_widgets', + 'value' => 1 + )); + + $params = array( + 'content' => $default_widgets_input, + 'num_columns' => $current_info['widget_columns'], + ); + + $content = elgg_view_layout('widgets', $params); + elgg_pop_context(); +} +elgg_pop_context(); + +echo $content;
\ No newline at end of file |