aboutsummaryrefslogtreecommitdiff
path: root/views/default/admin
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/admin')
-rw-r--r--views/default/admin/appearance/menu_items.php (renamed from views/default/admin/menu_items.php)2
-rw-r--r--views/default/admin/components/admin_page_layout.php36
-rw-r--r--views/default/admin/components/plugin.php (renamed from views/default/admin/plugins_opt/plugin.php)10
-rw-r--r--views/default/admin/components/plugin_settings.php21
-rw-r--r--views/default/admin/components/sidemenu.php105
-rw-r--r--views/default/admin/main.php12
-rw-r--r--views/default/admin/main_opt/plugins.php17
-rw-r--r--views/default/admin/main_opt/site.php15
-rw-r--r--views/default/admin/main_opt/statistics.php15
-rw-r--r--views/default/admin/main_opt/user.php15
-rw-r--r--views/default/admin/overview.php (renamed from views/default/admin/statistics_opt/basic.php)45
-rw-r--r--views/default/admin/overview/numentities.php (renamed from views/default/admin/statistics.php)2
-rw-r--r--views/default/admin/overview/online.php (renamed from views/default/admin/statistics_opt/online.php)2
-rw-r--r--views/default/admin/plugins/advanced.php (renamed from views/default/admin/plugins.php)63
-rw-r--r--views/default/admin/plugins/simple.php96
-rw-r--r--views/default/admin/site.php16
-rw-r--r--views/default/admin/site/advanced.php50
-rw-r--r--views/default/admin/site/basic.php30
-rw-r--r--views/default/admin/statistics_opt/numentities.php51
-rw-r--r--views/default/admin/user.php21
-rw-r--r--views/default/admin/user_opt/adduser.php0
-rw-r--r--views/default/admin/users/add.php6
-rw-r--r--views/default/admin/users/find.php (renamed from views/default/admin/user_opt/search.php)4
-rw-r--r--views/default/admin/users/online.php14
24 files changed, 452 insertions, 196 deletions
diff --git a/views/default/admin/menu_items.php b/views/default/admin/appearance/menu_items.php
index 2bf71f083..0f2637ba6 100644
--- a/views/default/admin/menu_items.php
+++ b/views/default/admin/appearance/menu_items.php
@@ -8,7 +8,7 @@
* @link http://elgg.org/
*/
-$menu_items = $vars['menu_items'];
+$menu_items = get_register('menu');
$featured_urls = get_config('menu_items_featured_urls');
// get an alphabetical sort of the items + urls
diff --git a/views/default/admin/components/admin_page_layout.php b/views/default/admin/components/admin_page_layout.php
new file mode 100644
index 000000000..4f2a67d48
--- /dev/null
+++ b/views/default/admin/components/admin_page_layout.php
@@ -0,0 +1,36 @@
+<?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/plugins_opt/plugin.php b/views/default/admin/components/plugin.php
index 61a197043..e56cdd4ef 100644
--- a/views/default/admin/plugins_opt/plugin.php
+++ b/views/default/admin/components/plugin.php
@@ -100,18 +100,14 @@ if ($manifest['screenshot']) {
<?php
if (elgg_view_exists("settings/{$plugin}/edit")) {
-
- $settings_link = "<a class='plugin_settings small link'>[". elgg_echo('settings') ."]</a>";
-
- $settings_panel = "<div class='pluginsettings hidden'>";
- $settings_panel .= elgg_view("object/plugin", array('plugin' => $plugin, 'entity' => find_plugin_settings($plugin)));
- $settings_panel .= "</div>";
+ $link = "{$vars['url']}pg/admin/plugin_settings/$plugin";
+ $settings_link = "<a class='plugin_settings small link' href='$link'>[". elgg_echo('settings') ."]</a>";
}
?>
<h3><?php echo "$plugin_pretty_name $settings_link"; ?></h3>
<?php
echo $settings_panel;
-
+
if ($manifest) {
?>
<div class="plugin_description"><?php echo elgg_view('output/longtext',array('value' => $manifest['description'])); ?></div>
diff --git a/views/default/admin/components/plugin_settings.php b/views/default/admin/components/plugin_settings.php
new file mode 100644
index 000000000..22544e45f
--- /dev/null
+++ b/views/default/admin/components/plugin_settings.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Elgg plugin settings
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+$plugin = $vars['plugin'];
+$plugin_info = load_plugin_manifest($plugin);
+
+$form_body = elgg_view("settings/{$plugin}/edit", $vars);
+$form_body .= elgg_view('input/hidden', array('internalname' => 'plugin', 'value' => $plugin));
+$form_body .= '<p>' . elgg_view('input/submit', array('value' => elgg_echo('save')));
+$form_body .= elgg_view('input/reset', array('value' => elgg_echo('reset'))) . '</p>';
+
+echo elgg_view_title($plugin_info['name']);
+
+echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$vars['url']}action/plugins/settings/save")); \ No newline at end of file
diff --git a/views/default/admin/components/sidemenu.php b/views/default/admin/components/sidemenu.php
new file mode 100644
index 000000000..4e02eecd9
--- /dev/null
+++ b/views/default/admin/components/sidemenu.php
@@ -0,0 +1,105 @@
+<?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
diff --git a/views/default/admin/main.php b/views/default/admin/main.php
deleted file mode 100644
index e345f56d6..000000000
--- a/views/default/admin/main.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-/**
- * Elgg administration main screen
- *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
- */
-
-// Description of what's going on
-echo elgg_view('output/longtext', array('value' => elgg_echo("admin:description")));
diff --git a/views/default/admin/main_opt/plugins.php b/views/default/admin/main_opt/plugins.php
deleted file mode 100644
index b8ae611d3..000000000
--- a/views/default/admin/main_opt/plugins.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/**
- * Elgg plugin sub-component on the main menu.
- *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
- */
-
-global $CONFIG;
-?>
-<div class="menu_admin_option">
- <h2><?php echo elgg_echo('admin:plugins'); ?> </h2>
- <p><?php echo elgg_echo('admin:plugins:opt:description'); ?><br />
- <a href="<?php echo $CONFIG->wwwroot . "pg/admin/plugins/"; ?>"><?php echo elgg_echo('admin:plugins:opt:linktext'); ?></a></p>
-</div> \ No newline at end of file
diff --git a/views/default/admin/main_opt/site.php b/views/default/admin/main_opt/site.php
deleted file mode 100644
index e21dcc3fe..000000000
--- a/views/default/admin/main_opt/site.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-/**
- * Elgg site sub-component on the main menu.
- *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
- */
-?>
-<div class="menu_admin_option">
- <h2><?php echo elgg_echo('admin:site'); ?> </h2>
- <p><?php echo elgg_echo('admin:site:opt:description'); ?><br />
- <a href="<?php echo $CONFIG->wwwroot . "pg/admin/site/"; ?>"><?php echo elgg_echo('admin:site:opt:linktext'); ?></a></p>
-</div> \ No newline at end of file
diff --git a/views/default/admin/main_opt/statistics.php b/views/default/admin/main_opt/statistics.php
deleted file mode 100644
index 5b063b82e..000000000
--- a/views/default/admin/main_opt/statistics.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-/**
- * Elgg satistics sub-component on the main menu.
- *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
- */
-?>
-<div class="menu_admin_option">
- <h2><?php echo elgg_echo('admin:statistics'); ?> </h2>
- <p><?php echo elgg_echo('admin:statistics:opt:description'); ?><br />
- <a href="<?php echo $CONFIG->wwwroot . "pg/admin/statistics/"; ?>"><?php echo elgg_echo('admin:statistics:opt:linktext'); ?></a></p>
-</div>
diff --git a/views/default/admin/main_opt/user.php b/views/default/admin/main_opt/user.php
deleted file mode 100644
index f1dc28e5e..000000000
--- a/views/default/admin/main_opt/user.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-/**
- * Elgg user sub-component on the main menu.
- *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
- */
-?>
-<div class="menu_admin_option">
- <h2><?php echo elgg_echo('admin:user'); ?> </h2>
- <p><?php echo elgg_echo('admin:user:opt:description'); ?><br />
- <a href="<?php echo $CONFIG->wwwroot . "pg/admin/user/"; ?>"><?php echo elgg_echo('admin:user:opt:linktext'); ?></a></p>
-</div> \ No newline at end of file
diff --git a/views/default/admin/statistics_opt/basic.php b/views/default/admin/overview.php
index f89314fef..6fe0bcd45 100644
--- a/views/default/admin/statistics_opt/basic.php
+++ b/views/default/admin/overview.php
@@ -32,4 +32,49 @@ $release = get_version(true);
</tr>
</table>
+</div>
+
+<?php
+
+
+// Get entity statistics
+$entity_stats = get_entity_statistics();
+$even_odd = "";
+?>
+<div class="admin_settings site_entities">
+ <h3><?php echo elgg_echo('admin:statistics:label:numentities'); ?></h3>
+ <table class="styled">
+ <?php
+ foreach ($entity_stats as $k => $entry) {
+ arsort($entry);
+ foreach ($entry as $a => $b) {
+
+ //This function controls the alternating class
+ $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
+
+ if ($a == "__base__") {
+ $a = elgg_echo("item:{$k}");
+ if (empty($a))
+ $a = $k;
+ } else {
+ if (empty($a)) {
+ $a = elgg_echo("item:{$k}");
+ } else {
+ $a = elgg_echo("item:{$k}:{$a}");
+ }
+
+ if (empty($a)) {
+ $a = "$k $a";
+ }
+ }
+ echo <<< END
+ <tr class="{$even_odd}">
+ <td class="column_one">{$a}:</td>
+ <td>{$b}</td>
+ </tr>
+END;
+ }
+ }
+ ?>
+ </table>
</div> \ No newline at end of file
diff --git a/views/default/admin/statistics.php b/views/default/admin/overview/numentities.php
index 7c987a607..0d0e1b83b 100644
--- a/views/default/admin/statistics.php
+++ b/views/default/admin/overview/numentities.php
@@ -7,5 +7,3 @@
* @author Curverider Ltd
* @link http://elgg.org/
*/
-
-global $CONFIG; \ No newline at end of file
diff --git a/views/default/admin/statistics_opt/online.php b/views/default/admin/overview/online.php
index 6485a3bac..0045f8299 100644
--- a/views/default/admin/statistics_opt/online.php
+++ b/views/default/admin/overview/online.php
@@ -14,7 +14,7 @@ if( (is_plugin_enabled('search')) && (is_plugin_enabled('profile')) ) {
$users_online = get_online_users();
get_context('admin');
?>
-
+
<div class="admin_settings members_list users_online">
<h3><?php echo elgg_echo('admin:statistics:label:onlineusers'); ?></h3>
<?php echo $users_online; ?>
diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins/advanced.php
index 5a5d37f8c..d5def1eb1 100644
--- a/views/default/admin/plugins.php
+++ b/views/default/admin/plugins/advanced.php
@@ -1,6 +1,8 @@
<?php
/**
- * Elgg administration plugin main screen
+ * Elgg administration advanced plugin screen
+ *
+ * Shows a list of all plugins sorted by load order.
*
* @package Elgg
* @subpackage Core
@@ -8,16 +10,39 @@
* @link http://elgg.org/
*/
-global $CONFIG;
+regenerate_plugin_list();
+$installed_plugins = get_installed_plugins();
+$plugin_list = array();
+$show_category = get_input('category', NULL);
+
+// Get a list of the all categories
+// and trim down the plugin list if we're not viewing all categories.
+// @todo this could be cached somewhere after have the manifest loaded
+$categories = array();
+
+foreach ($installed_plugins as $id => $plugin) {
+ $plugin_categories = $plugin['manifest']['category'];
+
+ // handle plugins that don't declare categories
+ if ((!$plugin_categories && $show_category) || ($show_category && !in_array($show_category, $plugin_categories))) {
+ unset($installed_plugins[$id]);
+ }
+
+ foreach ($plugin_categories as $category) {
+ if (!array_key_exists($category, $categories)) {
+ $categories[$category] = elgg_echo("admin:plugins:label:moreinfo:categories:$category");
+ }
+ }
+}
$ts = time();
$token = generate_action_token($ts);
-$categories = array_merge(array('' => elgg_echo('admin:plugins:categories:all')), $vars['categories']);
+$categories = array_merge(array('' => elgg_echo('admin:plugins:categories:all')), $categories);
$category_pulldown = elgg_view('input/pulldown', array(
'internalname' => 'category',
'options_values' => $categories,
- 'value' => $vars['show_category']
+ 'value' => $show_category
));
$category_button = elgg_view('input/button', array(
@@ -33,7 +58,7 @@ $category_form = elgg_view('input/form', array(
$title = elgg_view_title(elgg_echo('admin:plugins'));
// @todo Until "en/disable all" means "All plugins on this page" hide when not looking at all.
-if (!isset($vars['show_category']) || empty($vars['show_category'])) {
+if (!isset($show_category) || empty($show_category)) {
$buttons = "<a class='action_button' href=\"{$CONFIG->url}action/admin/plugins/enableall?__elgg_token=$token&amp;__elgg_ts=$ts\">".elgg_echo('enableall')."</a> <a class='action_button disabled' href=\"{$CONFIG->url}action/admin/plugins/disableall?__elgg_token=$token&amp;__elgg_ts=$ts\">".elgg_echo('disableall')."</a> ";
$buttons .= "<br /><br />";
} else {
@@ -48,16 +73,12 @@ $buttons .= $category_form;
<div class="content_header_title"><?php echo $title ?></div>
<div class="content_header_options"><?php echo $buttons ?></div>
</div>
+<br />
<?php
-echo elgg_view('output/longtext', array('value' => elgg_echo("admin:plugins:description")));
$limit = get_input('limit', 10);
$offset = get_input('offset', 0);
-// Get the installed plugins
-$installed_plugins = $vars['installed_plugins'];
-$count = count($installed_plugins);
-
$plugin_list = get_plugin_list();
$max = 0;
foreach($plugin_list as $key => $foo) {
@@ -67,19 +88,19 @@ foreach($plugin_list as $key => $foo) {
// Display list of plugins
$n = 0;
foreach ($installed_plugins as $plugin => $data) {
- echo elgg_view("admin/plugins_opt/plugin", array('plugin' => $plugin, 'details' => $data, 'maxorder' => $max, 'order' => array_search($plugin, $plugin_list)));
+ echo elgg_view('admin/components/plugin', array(
+ 'plugin' => $plugin,
+ 'details' => $data,
+ 'maxorder' => $max,
+ 'order' => array_search($plugin, $plugin_list)
+ ));
$n++;
}
-
?>
-
<script type="text/javascript">
-$(document).ready(function() {
- $('a.plugin_settings.link').click(function() {
- elgg_slide_toggle($(this), '.plugin_details', '.pluginsettings');
- });
- $('a.manifest_details.link').click(function() {
- elgg_slide_toggle($(this), '.plugin_details', '.manifest_file');
+ $(document).ready(function() {
+ $('a.manifest_details.link').click(function() {
+ elgg_slide_toggle($(this), '.plugin_details', '.manifest_file');
+ });
});
-});
-</script>
+</script> \ No newline at end of file
diff --git a/views/default/admin/plugins/simple.php b/views/default/admin/plugins/simple.php
new file mode 100644
index 000000000..ad85f9ce0
--- /dev/null
+++ b/views/default/admin/plugins/simple.php
@@ -0,0 +1,96 @@
+<?php
+/**
+ * Elgg administration simple plugin screen
+ *
+ * Shows an alphabetical list of "simple" plugins.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+regenerate_plugin_list();
+$installed_plugins = get_installed_plugins();
+$plugin_list = array();
+$title = elgg_view_title(elgg_echo('admin:plugins'));
+
+foreach ($installed_plugins as $installed_name => $plugin) {
+ if (!isset($plugin['manifest']['admin_interface']) || $plugin['manifest']['admin_interface'] == 'advanced') {
+ continue;
+ }
+
+ $plugin['installed_name'] = $installed_name;
+
+ $plugin_list[$plugin['manifest']['name']] = $plugin;
+}
+
+ksort($plugin_list);
+$form_body .= <<<___END
+ <div id="content_header" class="clearfloat">
+ <div class="content_header_title">$title</div>
+ </div>
+ <ul class="admin_plugins margin_top">
+___END;
+
+foreach ($plugin_list as $name => $info) {
+ $manifest = $info['manifest'];
+ $version_valid = (isset($manifest['elgg_version'])) ? check_plugin_compatibility($manifest['elgg_version']) : FALSE;
+ if ($info['active']) {
+ $active_class = 'active';
+ $checked = 'checked="checked"';
+ } else {
+ $active_class = 'not_active';
+ $checked = '';
+ }
+
+ $author = $link = $version = $settings = '';
+
+ if (isset($manifest['author'])) {
+ $author = sprintf(elgg_echo('admin:plugins:author'), $manifest['author']);
+ }
+
+ if (isset($manifest['version'])) {
+ $version = ' | ' . sprintf(elgg_echo('admin:plugins:version'), $manifest['version']);
+ }
+
+ if (isset($manifest['website'])) {
+ $link = " | <a href=\"{$manifest['website']}\">" . elgg_echo('admin:plugins:plugin_website') . '</a>';
+ }
+
+ if (elgg_view_exists("settings/{$info['installed_name']}/edit")) {
+ $settings_href = "{$vars['url']}pg/admin/plugin_settings/{$info['installed_name']}";
+ $settings = " | <a class='plugin_settings link' href='$settings_href'>". elgg_echo('settings') ."</a>";
+ }
+
+ $form_body .= <<<___END
+ <li class="plugin_details $active_class">
+ <span class="plugin_controls">
+ <input type="checkbox" id="{$info['installed_name']}" class="plugin_enabled" $checked name="enabled_plugins[]" value="{$info['installed_name']}"/>
+ <label for="{$info['installed_name']}">$name</label>
+ </span>
+
+ <span class="plugin_info">
+ <span class="plugin_description">
+ {$manifest['description']}
+ </span>
+ <span class="plugin_metadata small">
+ $author
+ $version
+ $link
+ $settings
+ </span>
+ </span>
+ </li>
+___END;
+}
+
+$form_body .= '</ul>';
+$form_body .= elgg_view('input/submit', array('value' => elgg_echo('save')));
+$form_body .= elgg_view('input/reset', array('value' => elgg_echo('reset'), 'class' => 'action_button disabled'));
+
+echo elgg_view('input/form', array(
+ 'action' => "{$vars['url']}action/admin/plugins/simple_update_states",
+ 'body' => $form_body,
+ 'class' => 'admin_plugins_simpleview'
+)); \ No newline at end of file
diff --git a/views/default/admin/site.php b/views/default/admin/site.php
deleted file mode 100644
index 2c2775ad0..000000000
--- a/views/default/admin/site.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-/**
- * Elgg administration site main screen
- *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
- */
-
-global $CONFIG;
-
-// Description of what's going on
-echo "<div class='margin_top'>".elgg_view('output/longtext', array('value' => elgg_echo("admin:site:description")))."</div>";
-
-echo elgg_view("settings/system",array("action" => $CONFIG->wwwroot."action/admin/site/update_basic")); // Always want to do this first. \ No newline at end of file
diff --git a/views/default/admin/site/advanced.php b/views/default/admin/site/advanced.php
new file mode 100644
index 000000000..da7b98a1a
--- /dev/null
+++ b/views/default/admin/site/advanced.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Elgg administration site advanced settings
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+$action = $vars['url'] . "action/admin/site/update_advanced";
+
+$form_body = "";
+
+foreach(array('wwwroot', 'path', 'dataroot', 'view') as $field) {
+ $form_body .= "<p>";
+ $form_body .= elgg_echo('installation:' . $field) . "<br />";
+ $warning = elgg_echo('installation:warning:' . $field);
+ if ($warning != 'installation:warning:' . $field) echo "<b>" . $warning . "</b><br />";
+ $value = $vars['config']->$field;
+ $form_body .= elgg_view("input/text",array('internalname' => $field, 'value' => $value));
+ $form_body .= "</p>";
+}
+
+$form_body .= "<p>" . elgg_echo('admin:site:access:warning') . "<br />";
+$form_body .= elgg_echo('installation:sitepermissions') . elgg_view('input/access', array('internalname' => 'default_access','value' => $vars['config']->default_access)) . "</p>";
+$form_body .= "<p>" . elgg_echo('installation:allow_user_default_access:description') . "<br />" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:allow_user_default_access:label')), 'internalname' => 'allow_user_default_access', 'value' => ($vars['config']->allow_user_default_access ? elgg_echo('installation:allow_user_default_access:label') : "") )) . "</p>";
+$form_body .= "<p>" . elgg_echo('installation:simplecache:description') . "<br />" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:simplecache:label')), 'internalname' => 'simplecache_enabled', 'value' => ($vars['config']->simplecache_enabled ? elgg_echo('installation:simplecache:label') : "") )) . "</p>";
+$form_body .= "<p>" . elgg_echo('installation:viewpathcache:description') . "<br />" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:viewpathcache:label')), 'internalname' => 'viewpath_cache_enabled', 'value' => (($vars['config']->viewpath_cache_enabled) ? elgg_echo('installation:viewpathcache:label') : "") )) . "</p>";
+
+$debug_options = array('0' => elgg_echo('installation:debug:none'), 'ERROR' => elgg_echo('installation:debug:error'), 'WARNING' => elgg_echo('installation:debug:warning'), 'NOTICE' => elgg_echo('installation:debug:notice'));
+$form_body .= "<p>" . elgg_echo('installation:debug');
+$form_body .= elgg_view('input/pulldown', array('options_values' => $debug_options, 'internalname' => 'debug', 'value' => $vars['config']->debug));
+$form_body .= '</p>';
+
+$form_body .= "<p>" . elgg_echo('installation:httpslogin') . "<br />" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:httpslogin:label')), 'internalname' => 'https_login', 'value' => ($vars['config']->https_login ? elgg_echo('installation:httpslogin:label') : "") )) . "</p>";
+
+$form_body .= "<p>" . elgg_echo('installation:disableapi') . "<br />";
+$on = elgg_echo('installation:disableapi:label');
+if ((isset($CONFIG->disable_api)) && ($CONFIG->disable_api == true)) {
+ $on = ($vars['config']->disable_api ? "" : elgg_echo('installation:disableapi:label'));
+}
+$form_body .= elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:disableapi:label')), 'internalname' => 'api', 'value' => $on ));
+$form_body .= "</p>";
+
+$form_body .= elgg_view('input/hidden', array('internalname' => 'settings', 'value' => 'go'));
+
+$form_body .= "<div class='divider'></div>".elgg_view('input/submit', array('value' => elgg_echo("save")));
+$form_body = "<div class='admin_settings site_admin margin_top'>".$form_body."</div>";
+echo elgg_view('input/form', array('action' => $action, 'body' => $form_body));
diff --git a/views/default/admin/site/basic.php b/views/default/admin/site/basic.php
new file mode 100644
index 000000000..104823a28
--- /dev/null
+++ b/views/default/admin/site/basic.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Elgg administration site basic settings
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+$action = $vars['url'] . "action/admin/site/update_basic";
+
+$form_body = "";
+
+foreach(array('sitename','sitedescription', 'siteemail') as $field) {
+ $form_body .= "<p>";
+ $form_body .= elgg_echo('installation:' . $field) . "<br />";
+ $warning = elgg_echo('installation:warning:' . $field);
+ if ($warning != 'installation:warning:' . $field) echo "<b>" . $warning . "</b><br />";
+ $value = $vars['config']->$field;
+ $form_body .= elgg_view("input/text",array('internalname' => $field, 'value' => $value));
+ $form_body .= "</p>";
+}
+
+$languages = get_installed_translations();
+$form_body .= "<p>" . elgg_echo('installation:language') . elgg_view("input/pulldown", array('internalname' => 'language', 'value' => $vars['config']->language, 'options_values' => $languages)) . "</p>";
+
+$form_body .= "<div class='divider'></div>".elgg_view('input/submit', array('value' => elgg_echo("save")));
+$form_body = "<div class='admin_settings site_admin margin_top'>".$form_body."</div>";
+echo elgg_view('input/form', array('action' => $action, 'body' => $form_body));
diff --git a/views/default/admin/statistics_opt/numentities.php b/views/default/admin/statistics_opt/numentities.php
deleted file mode 100644
index 4336c5a82..000000000
--- a/views/default/admin/statistics_opt/numentities.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-/**
- * Elgg statistics screen
- *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
- */
-
-// Get entity statistics
-$entity_stats = get_entity_statistics();
-$even_odd = "";
-?>
-<div class="admin_settings site_entities">
- <h3><?php echo elgg_echo('admin:statistics:label:numentities'); ?></h3>
- <table class="styled">
- <?php
- foreach ($entity_stats as $k => $entry) {
- arsort($entry);
- foreach ($entry as $a => $b) {
-
- //This function controls the alternating class
- $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
-
- if ($a == "__base__") {
- $a = elgg_echo("item:{$k}");
- if (empty($a))
- $a = $k;
- } else {
- if (empty($a)) {
- $a = elgg_echo("item:{$k}");
- } else {
- $a = elgg_echo("item:{$k}:{$a}");
- }
-
- if (empty($a)) {
- $a = "$k $a";
- }
- }
- echo <<< END
- <tr class="{$even_odd}">
- <td class="column_one">{$a}:</td>
- <td>{$b}</td>
- </tr>
-END;
- }
- }
- ?>
- </table>
-</div> \ No newline at end of file
diff --git a/views/default/admin/user.php b/views/default/admin/user.php
deleted file mode 100644
index ba7eb3d4a..000000000
--- a/views/default/admin/user.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-/**
- * Elgg administration user main screen
- *
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
- */
-
-// Intro
-echo "<div class='margin_top'>".elgg_view('output/longtext', array('value' => elgg_echo("admin:user:description")))."</div>";
-//echo elgg_view("admin/user_opt/adduser");
-// add a new user form
-echo elgg_view('account/forms/useradd', array('show_admin'=>true));
-// search for a user
-echo elgg_view("admin/user_opt/search");
-
-if ($vars['list']) {
- echo $vars['list'];
-} \ No newline at end of file
diff --git a/views/default/admin/user_opt/adduser.php b/views/default/admin/user_opt/adduser.php
deleted file mode 100644
index e69de29bb..000000000
--- a/views/default/admin/user_opt/adduser.php
+++ /dev/null
diff --git a/views/default/admin/users/add.php b/views/default/admin/users/add.php
new file mode 100644
index 000000000..4275b27e1
--- /dev/null
+++ b/views/default/admin/users/add.php
@@ -0,0 +1,6 @@
+<?php
+/**
+ * Display an add user form.
+ */
+
+echo elgg_view('account/forms/useradd', array('show_admin'=>true)); \ No newline at end of file
diff --git a/views/default/admin/user_opt/search.php b/views/default/admin/users/find.php
index f853dcf3c..9684cb88c 100644
--- a/views/default/admin/user_opt/search.php
+++ b/views/default/admin/users/find.php
@@ -7,8 +7,8 @@
* @author Curverider Ltd
* @link http://elgg.org/
*/
-
-if( (is_plugin_enabled('search')) && (is_plugin_enabled('profile')) ) {
+
+if( (is_plugin_enabled('search')) && (is_plugin_enabled('profile')) ) {
?>
<div class="admin_settings user_search">
<form action="<?php echo $vars['url']; ?>pg/search/" method="get">
diff --git a/views/default/admin/users/online.php b/views/default/admin/users/online.php
new file mode 100644
index 000000000..22b183da8
--- /dev/null
+++ b/views/default/admin/users/online.php
@@ -0,0 +1,14 @@
+<?php
+// users online
+if ((is_plugin_enabled('search')) && (is_plugin_enabled('profile'))) {
+ get_context('search');
+ $users_online = get_online_users();
+ get_context('admin');
+ ?>
+
+ <div class="admin_settings members_list users_online">
+ <h3><?php echo elgg_echo('admin:statistics:label:onlineusers'); ?></h3>
+ <?php echo $users_online; ?>
+ </div>
+<?php
+} \ No newline at end of file