From 37446557462b35b5c6690f7f8f739c4dd861b85b Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 10 May 2010 16:00:52 +0000 Subject: Admin area now uses standard submenu tools. git-svn-id: http://code.elgg.org/elgg/trunk@5992 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../default/admin/components/admin_page_layout.php | 36 ------- views/default/admin/components/sidemenu.php | 105 --------------------- views/default/navigation/submenu_item.php | 16 +++- views/default/output/url.php | 13 ++- views/default/page_elements/owner_block.php | 9 +- 5 files changed, 26 insertions(+), 153 deletions(-) delete mode 100644 views/default/admin/components/admin_page_layout.php delete mode 100644 views/default/admin/components/sidemenu.php (limited to 'views') 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 @@ - - - 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 @@ -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; - } - } -} - -?> - - - - \ No newline at end of file diff --git a/views/default/navigation/submenu_item.php b/views/default/navigation/submenu_item.php index c64f8a679..ff2cc48d1 100644 --- a/views/default/navigation/submenu_item.php +++ b/views/default/navigation/submenu_item.php @@ -13,7 +13,7 @@ $group = (isset($vars['group'])) ? $vars['group'] : 'default'; $item = (isset($vars['item'])) ? $vars['item'] : FALSE; -$children_html = (isset($vars['children_html'])) ? $vars['children_html'] : FALSE; +$children_html = (isset($vars['children_html'])) ? $vars['children_html'] : ''; if ($item) { @@ -34,8 +34,16 @@ if ($item) { $child_indicator = "$child_indicator "; } - $url = htmlentities($item->url); + $url = htmlentities($item->href); $text = $child_indicator . htmlentities($item->text); + + $link_vars = array_merge($vars, array( + 'href' => $item->href, + 'text' => $text, + 'encode_text' => FALSE + )); + + $link = elgg_view('output/url', $link_vars); } -?> -
  • >>
  • + +echo "
  • $link$children_html
  • "; diff --git a/views/default/output/url.php b/views/default/output/url.php index 87d3a68a1..19ad331e1 100644 --- a/views/default/output/url.php +++ b/views/default/output/url.php @@ -10,7 +10,8 @@ * * @uses string $vars['href'] The string to display in the tags * @uses string $vars['text'] The string between the tags. - * @uses bool $vars['target'] Set the target="" attribute. + * @uses string $vars['target'] Set the target="" attribute. + * @uses bool $vars['encode_text'] Run $vars['text'] through htmlentities()? * @uses string $vars['class'] what to add in class="" * @uses string $vars['js'] Javascript to insert in tag * @uses bool $vars['is_action'] Is this a link to an action? @@ -39,13 +40,17 @@ if (!empty($url)) { } if (array_key_exists('text', $vars) && $vars['text']) { - $text = htmlentities($vars['text'], ENT_QUOTES, 'UTF-8'); + if (isset($vars['encode_text']) && $vars['encode_text']) { + $text = htmlentities($vars['text'], ENT_QUOTES, 'UTF-8'); + } else { + $text = $vars['text']; + } } else { $text = htmlentities($url, ENT_QUOTES, 'UTF-8'); } - if ((substr_count($url, "http://") == 0) && (substr_count($url, "https://") == 0)) { - $url = "http://" . $url; + if ((substr_count($url, "http://") == 0) && (substr_count($url, "https://") == 0)) { + $url = "http://" . $url; } if (array_key_exists('is_action', $vars) && $vars['is_action']) { diff --git a/views/default/page_elements/owner_block.php b/views/default/page_elements/owner_block.php index a45fad826..ef77d6895 100644 --- a/views/default/page_elements/owner_block.php +++ b/views/default/page_elements/owner_block.php @@ -38,14 +38,14 @@ if(is_plugin_enabled('profile')) { } $display = "
    " . $icon . "
    "; $display .= "
    " . $info; - + if ($owner->briefdescription) { $desc = $owner->briefdescription; $display .= "

    " . $desc . "

    "; } $display .= "

    {$location}

    "; $display .= "
    "; // close owner_block_contents - + $contents .= "
    ".$display."
    "; } } @@ -58,9 +58,10 @@ if (isset($vars['content'])) $contents .= $vars['content']; // Initialise the current tool/page submenu (plugins can add to the submenu) -$submenu = get_submenu(); +$submenu = elgg_get_submenu(); + if (!empty($submenu)) - $contents .= $submenu; + $contents .= $submenu; if (!empty($contents)) { echo $contents; -- cgit v1.2.3