aboutsummaryrefslogtreecommitdiff
path: root/views/default/admin/components
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-10 16:00:52 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-10 16:00:52 +0000
commit37446557462b35b5c6690f7f8f739c4dd861b85b (patch)
treeef72ca9f73bf31583350af4cb174f1a6c0ff3bab /views/default/admin/components
parentf40da8fcaaeb193b155f8e51081bcaef468d9770 (diff)
downloadelgg-37446557462b35b5c6690f7f8f739c4dd861b85b.tar.gz
elgg-37446557462b35b5c6690f7f8f739c4dd861b85b.tar.bz2
Admin area now uses standard submenu tools.
git-svn-id: http://code.elgg.org/elgg/trunk@5992 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/admin/components')
-rw-r--r--views/default/admin/components/admin_page_layout.php36
-rw-r--r--views/default/admin/components/sidemenu.php105
2 files changed, 0 insertions, 141 deletions
diff --git a/views/default/admin/components/admin_page_layout.php b/views/default/admin/components/admin_page_layout.php
deleted file mode 100644
index 4f2a67d48..000000000
--- a/views/default/admin/components/admin_page_layout.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/**
- * Elgg admin page layout. Includes the admin sidebar and the ownerblock (for legacy support)
- *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
- */
-
-$notices_html = '';
-if ($notices = elgg_get_admin_notices()) {
- foreach ($notices as $notice) {
- $notices_html .= elgg_view_entity($notice);
- }
-}
-
-?>
-<div id="elgg_content" class="clearfloat sidebar">
- <div id="elgg_sidebar">
- <?php
- echo elgg_view('admin/components/sidemenu', $vars);
- echo '<hr />';
- echo elgg_view('page_elements/owner_block');
- ?>
- </div>
-
- <div id="elgg_page_contents" class="clearfloat">
- <?php
- if ($notices) {
- echo "<div class=\"admin_notices\">$notices_html</div>";
- }
- echo $vars['content'];
- ?>
- </div>
-</div>
diff --git a/views/default/admin/components/sidemenu.php b/views/default/admin/components/sidemenu.php
deleted file mode 100644
index 4e02eecd9..000000000
--- a/views/default/admin/components/sidemenu.php
+++ /dev/null
@@ -1,105 +0,0 @@
-<?php
-/**
- * Elgg admin sidebar
- *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
- */
-
-$sections = $vars['config']->admin_sections;
-$current_section = $vars['page'][0];
-$child_section = (isset($vars['page'][1])) ? $vars['page'][1] : NULL;
-
-// "Plugin Settings" is a special sidemenu item that is added automatically
-// it's calculated here instead of in admin_init() because of preformance concerns.
-$installed_plugins = get_installed_plugins();
-$plugin_settings_children = $sort = array();
-foreach ($installed_plugins as $plugin_id => $info) {
- if (!$info['active']) {
- continue;
- }
-
- // @todo might not need to check if plugin is enabled here because
- // this view wouldn't exist if it's not. right?
- if (is_plugin_enabled($plugin_id) && elgg_view_exists("settings/{$plugin_id}/edit")) {
- $plugin_settings_children[$plugin_id] = array(
- 'title' => $info['manifest']['name']
- );
- $sort[] = elgg_strtolower($info['manifest']['name']);
- }
-}
-
-array_multisort($sort, SORT_ASC, SORT_STRING, $plugin_settings_children);
-
-if ($plugin_settings_children) {
- // merge in legacy support with new support.
- if (!isset($sections['plugin_settings'])) {
- $sections['plugin_settings'] = array(
- 'title' => elgg_echo('admin:plugin_settings'),
- 'children' => $plugin_settings_children
- );
- } else {
- $sections['plugin_settings']['title'] = elgg_echo('admin:plugin_settings');
- if (isset($sections['plugin_settings']['children'])) {
- $children = array_merge($plugin_settings_children, $sections['plugin_settings']['children']);
- $sections['plugin_settings']['children'] = $children;
- }
- }
-}
-
-?>
-
-<ul class="admin submenu">
- <?php foreach ($sections as $id => $info) {
- $parent_class = ($current_section == $id) ? 'selected' : '';
- $link = "{$vars['url']}pg/admin/$id";
-
- $expand_child = $children_menu = $expanded = '';
- // parent menu items with children default to the first child element.
- if (isset($info['children']) && $info['children']) {
- $link = '';
- if ($current_section == $id) {
- $hidden = '';
- $expanded = '-';
- } else {
- $hidden = 'style="display: none;"';
- $expanded = '+';
- }
- $expand_child = "<span class=\"expand_child\">$expanded</span> ";
- $children_menu = "<ul class=\"admin child_submenu\" $hidden>";
- foreach ($info['children'] as $child_id => $child_info) {
- $child_selected = ($child_section == $child_id) ? "class=\"selected\"" : '';
- $child_link = "{$vars['url']}pg/admin/$id/$child_id";
- if (!$link) {
- $link = $child_link;
- }
- $children_menu .= "<li $child_selected><a href=\"$child_link\">{$child_info['title']}</a></li>";
- }
- $children_menu .= '</ul>';
- }
-
- $parent_class = ($parent_class) ? "class=\"$parent_class\"" : '';
-
- echo "<li $parent_class><a href=\"$link\">$expand_child{$info['title']}</a>
- $children_menu
- </li>";
- }
- ?>
-</ul>
-
-<script type="text/javascript">
- $('a span.expand_child').click(function() {
- var submenu = $(this).parent().parent().find('ul.child_submenu');
- submenu.slideToggle();
-
- if ($(this).html() == '+') {
- $(this).html('-');
- } else {
- $(this).html('+');
- }
-
- return false;
- });
-</script> \ No newline at end of file