aboutsummaryrefslogtreecommitdiff
path: root/views/default/admin/menu_items.php
blob: c9bdc5bca91c86650de29c4eb7433e116382feb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?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<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
	));
}

$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"
));