aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-17 19:09:09 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-17 19:09:09 +0000
commitff6f2152bb6f0a759bffbcc213a82aecc0237ae6 (patch)
treea0ed026661677ab315069274ca05f7395e6248c5 /views
parent99d5f4b0d22e99109da860dd9118265c883a668e (diff)
downloadelgg-ff6f2152bb6f0a759bffbcc213a82aecc0237ae6.tar.gz
elgg-ff6f2152bb6f0a759bffbcc213a82aecc0237ae6.tar.bz2
Added config options for tabs and menu items.
git-svn-id: http://code.elgg.org/elgg/trunk@5431 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views')
-rw-r--r--views/default/admin/menu_items.php61
-rw-r--r--views/default/navigation/site_nav.php76
-rw-r--r--views/default/navigation/topbar_tools.php5
3 files changed, 78 insertions, 64 deletions
diff --git a/views/default/admin/menu_items.php b/views/default/admin/menu_items.php
new file mode 100644
index 000000000..68f3688d8
--- /dev/null
+++ b/views/default/admin/menu_items.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Elgg administration menu items
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+$menu_items = $vars['menu_items'];
+$featured_urls = get_config('menu_items_featured_urls');
+
+// get an alphabetical sort of the items + urls
+foreach ($menu_items as $name => $info) {
+ $menu_sorted[$info->name] = $info->value->url;
+}
+
+ksort($menu_sorted);
+
+$pulldown_values = array_flip($menu_sorted);
+$pulldown_values[''] = elgg_echo('none');
+
+echo elgg_view_title(elgg_echo('admin:menu_items'));
+echo elgg_view('output/longtext', array('value' => elgg_echo("admin:menu_items:description")));
+
+$form_body = '';
+
+// @todo Could probably make this number configurable
+for ($i=0; $i<7; $i++) {
+ if (array_key_exists($i, $featured_urls)) {
+ $current_value = $featured_urls[$i]->value->url;
+ } else {
+ $current_value = '';
+ }
+
+ $form_body .= elgg_view('input/pulldown', array(
+ 'options_values' => $pulldown_values,
+ 'internalname' => 'featured_urls[]',
+ 'value' => $current_value
+ ));
+}
+$form_body .= '<br /><br />';
+$form_body .= '<label for="menu_items_hide_toolbar_entries">'
+ . elgg_echo('admin:menu_items:hide_toolbar_entries') . '</label>';
+$form_body .= elgg_view('input/pulldown', array(
+ 'internalname' => 'menu_items_hide_toolbar_entries',
+ 'internalid' => 'menu_items_hide_toolbar_entries',
+ 'value' => get_config('menu_items_hide_toolbar_entries'),
+ 'options_values' => array(
+ 'yes' => elgg_echo('option:yes'),
+ 'no' => elgg_echo('option:no')
+)));
+
+$form_body .= '<br /><br />';
+$form_body .= elgg_view('input/submit', array('value' => elgg_echo('save')));
+
+echo elgg_view('input/form', array(
+ 'body' => $form_body,
+ 'action' => "{$vars['url']}action/admin/menu_items"
+)); \ No newline at end of file
diff --git a/views/default/navigation/site_nav.php b/views/default/navigation/site_nav.php
index 8431188d8..965eb7e63 100644
--- a/views/default/navigation/site_nav.php
+++ b/views/default/navigation/site_nav.php
@@ -2,67 +2,21 @@
/**
* Main site-wide navigation
**/
-
-echo "<div id='elgg_main_nav' class='clearfloat'>";
-echo "<ul class='navigation'>";
-if(is_plugin_enabled('riverdashboard')){
- if(get_context() == 'riverdashboard')
- $selected = 'class="selected"';
- else
- $selected = "";
- echo "<li {$selected}><a href=\"{$vars['url']}mod/riverdashboard/\" title='Activity'><span>Activity</span></a></li>";
-}
-if(is_plugin_enabled('thewire') && isloggedin()){
- if(get_context() == 'thewire')
- $selected = 'class="selected"';
- else
- $selected = "";
- echo "<li {$selected}><a href=\"{$vars['url']}mod/thewire/everyone.php\" title='The Wire'><span>" . elgg_echo('thewire:title') . "</span></a></li>";
-}
-if(is_plugin_enabled('conversations') && isloggedin()){
- if(get_context() == 'conversations')
- $selected = 'class="selected"';
- else
- $selected = "";
- echo "<li {$selected}><a href=\"{$vars['url']}mod/conversations/all.php\" title='Conversations'><span>" . elgg_echo('conversations') . "</span></a></li>";
-}
-if(is_plugin_enabled('blog')){
- if(get_context() == 'blog')
- $selected = 'class="selected"';
- else
- $selected = "";
- echo "<li {$selected}><a href=\"{$vars['url']}mod/blog/all.php\" title='Blogs'><span>Blogs</span></a></li>";
-}
-if(is_plugin_enabled('pages')){
- if(get_context() == 'pages')
- $selected = 'class="selected"';
- else
- $selected = "";
- echo "<li {$selected}><a href=\"{$vars['url']}mod/pages/all.php\" title='Pages'><span>Pages</span></a></li>";
-}
-if(is_plugin_enabled('file')){
- if(get_context() == 'file')
- $selected = 'class="selected"';
- else
- $selected = "";
- echo "<li {$selected}><a href=\"{$vars['url']}pg/file/world/world/\" title='Files'><span>Files</span></a></li>";
-}
-if(is_plugin_enabled('bookmarks')){
- if(get_context() == 'bookmarks')
- $selected = 'class="selected"';
- else
- $selected = "";
- echo "<li {$selected}><a href=\"{$vars['url']}mod/bookmarks/all.php\" title='Bookmarks'><span>Bookmarks</span></a></li>";
-}
-if(is_plugin_enabled('groups')){
- if(get_context() == 'groups')
- $selected = 'class="selected"';
- else
- $selected = "";
- echo "<li {$selected}><a href=\"{$vars['url']}pg/groups/world/\" title='Groups'><span>". elgg_echo('groups') . "</span></a></li>";
+$featured = $vars['config']->menu_items['featured_urls'];
+$current_context = get_context();
+
+echo '<div id="elgg_main_nav" class="clearfloat">
+ <ul class="navigation">';
+
+foreach ($featured as $info) {
+ $selected = ($info->value->context == $current_context) ? 'class="selected"' : '';
+ $title = htmlentities($info->name, ENT_QUOTES, 'UTF-8');
+ $url = htmlentities($info->value->url, ENT_QUOTES, 'UTF-8');
+
+ echo "<li $selected><a href=\"$url\" title=\"$title\"><span>$title</span></a></li>";
}
-echo "</ul>";
-echo "</div>";
-?> \ No newline at end of file
+echo '
+ </ul>
+</div>'; \ No newline at end of file
diff --git a/views/default/navigation/topbar_tools.php b/views/default/navigation/topbar_tools.php
index 0e0eec097..2e48a4a85 100644
--- a/views/default/navigation/topbar_tools.php
+++ b/views/default/navigation/topbar_tools.php
@@ -9,8 +9,7 @@
* @link http://elgg.org/
*
*/
-
-$menu = get_register('menu');
+$menu = $vars['config']->menu_items['toolbar'];
if (is_array($menu) && sizeof($menu) > 0) {
$alphamenu = array();
@@ -26,7 +25,7 @@ if (is_array($menu) && sizeof($menu) > 0) {
<ul>
<?php
foreach($alphamenu as $item) {
- echo "<li><a href=\"{$item->value}\">" . $item->name . "</a></li>";
+ echo "<li><a href=\"{$item->value->url}\">" . $item->name . "</a></li>";
}
?>
</ul>