aboutsummaryrefslogtreecommitdiff
path: root/views/default/admin/appearance
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-05 19:14:48 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-05 19:14:48 +0000
commitff31226fdeb972aac2f37f0098240cb366a9bb26 (patch)
tree1f0caa75c9a340cf28ce9a81a4cbe3230d13abf3 /views/default/admin/appearance
parent81ffac29fabc175eebdbf95578da046f4f00611b (diff)
downloadelgg-ff31226fdeb972aac2f37f0098240cb366a9bb26.tar.gz
elgg-ff31226fdeb972aac2f37f0098240cb366a9bb26.tar.bz2
Merged 18_new_admin branch to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@5977 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/admin/appearance')
-rw-r--r--views/default/admin/appearance/menu_items.php89
1 files changed, 89 insertions, 0 deletions
diff --git a/views/default/admin/appearance/menu_items.php b/views/default/admin/appearance/menu_items.php
new file mode 100644
index 000000000..0f2637ba6
--- /dev/null
+++ b/views/default/admin/appearance/menu_items.php
@@ -0,0 +1,89 @@
+<?php
+/**
+ * Elgg administration menu items
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+$menu_items = get_register('menu');
+$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 "<div class='admin_settings menuitems'><h3>".elgg_echo('admin:menu_items:configure')."</h3>";
+echo "<p class='margin_top'>".strip_tags(elgg_view('output/longtext', array('value' => elgg_echo("admin:menu_items:description"))))."</p>";
+$form_body = '';
+
+// @todo Could probably make this number configurable
+for ($i=0; $i<6; $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
+ ));
+}
+
+// add arbitrary links
+$form_body .= "<h3>".elgg_echo('admin:add_menu_item')."</h3>";
+$form_body .= elgg_view('output/longtext', array('value' => elgg_echo("admin:add_menu_item:description")));
+
+$custom_items = get_config('menu_items_custom_items');
+
+$name_str = elgg_echo('name');
+$url_str = elgg_echo('admin:plugins:label:website');
+
+$form_body .= '<ul>';
+
+if (is_array($custom_items)) {
+ foreach ($custom_items as $url => $name) {
+ $name_input = elgg_view('input/text', array(
+ 'internalname' => 'custom_item_names[]',
+ 'value' => $name
+ ));
+
+ $url_input = elgg_view('input/text', array(
+ 'internalname' => 'custom_item_urls[]',
+ 'value' => $url
+ ));
+
+ $form_body .= "<li class='custom_menuitem'>$name_str: $name_input $url_str: $url_input $delete</li>";
+ }
+}
+
+$new = elgg_echo('new');
+$name_input = elgg_view('input/text', array(
+ 'internalname' => 'custom_item_names[]',
+));
+
+$url_input = elgg_view('input/text', array(
+ 'internalname' => 'custom_item_urls[]',
+));
+
+$form_body .= "<li class='custom_menuitem'>$name_str: $name_input $url_str: $url_input</li>
+</ul>";
+
+$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"
+));
+echo "</div>"; \ No newline at end of file