aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-04 21:05:45 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-04 21:05:45 +0000
commitfa82440351a6f05e0d16b8cb45524898d9f5f713 (patch)
tree987025b876f3a6b7e436fab12e796ae824898ad2
parent7d23531aad07826223531ad58a12a2cbaea38e89 (diff)
downloadelgg-fa82440351a6f05e0d16b8cb45524898d9f5f713.tar.gz
elgg-fa82440351a6f05e0d16b8cb45524898d9f5f713.tar.bz2
Further changes to the admin panel
git-svn-id: https://code.elgg.org/elgg/trunk@1694 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--admin/index.php4
-rw-r--r--admin/plugins/index.php2
-rw-r--r--admin/site/index.php2
-rw-r--r--admin/statistics/index.php2
-rw-r--r--admin/user/index.php26
-rw-r--r--engine/lib/admin.php17
-rw-r--r--engine/lib/entities.php5
-rw-r--r--views/default/account/forms/useradd.php15
-rw-r--r--views/default/admin/user_opt/adduser.php6
-rw-r--r--views/default/admin/user_opt/search.php9
10 files changed, 56 insertions, 32 deletions
diff --git a/admin/index.php b/admin/index.php
index 4a84b152e..6252e8cab 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -16,8 +16,6 @@
// Make sure only valid admin users can see this
admin_gatekeeper();
-
- // Display main admin menu
- page_draw(elgg_echo("admin"),elgg_view_layout("one_column", elgg_view("admin/main")));
+ forward('pg/admin/statistics/')
?> \ No newline at end of file
diff --git a/admin/plugins/index.php b/admin/plugins/index.php
index 14d830840..226dbdbd5 100644
--- a/admin/plugins/index.php
+++ b/admin/plugins/index.php
@@ -19,6 +19,6 @@
admin_gatekeeper();
// Display main admin menu
- page_draw(elgg_echo("admin:plugins"),elgg_view_layout("one_column", elgg_view("admin/plugins", array('installed_plugins' => get_installed_plugins()))));
+ page_draw(elgg_echo("admin:plugins"),elgg_view_layout("two_column_left_sidebar", '', elgg_view_title(elgg_echo('admin:plugins')) . elgg_view("admin/plugins", array('installed_plugins' => get_installed_plugins()))));
?> \ No newline at end of file
diff --git a/admin/site/index.php b/admin/site/index.php
index c3ffbc272..6df4eb3f5 100644
--- a/admin/site/index.php
+++ b/admin/site/index.php
@@ -18,6 +18,6 @@
admin_gatekeeper();
// Display main admin menu
- page_draw(elgg_echo("admin:site"),elgg_view_layout("one_column",elgg_view("admin/site")));
+ page_draw(elgg_echo("admin:site"),elgg_view_layout("two_column_left_sidebar",'', elgg_view_title(elgg_echo('admin:site')) . elgg_view("admin/site")));
?> \ No newline at end of file
diff --git a/admin/statistics/index.php b/admin/statistics/index.php
index ee3cb15a8..49a1c5c76 100644
--- a/admin/statistics/index.php
+++ b/admin/statistics/index.php
@@ -20,6 +20,6 @@
// Display main admin menu
- page_draw(elgg_echo("admin:statistics"),elgg_view_layout("one_column",elgg_view("admin/statistics")));
+ page_draw(elgg_echo("admin:statistics"),elgg_view_layout("two_column_left_sidebar",'',elgg_view_title(elgg_echo('admin:statistics')) . elgg_view("admin/statistics")));
?>
diff --git a/admin/user/index.php b/admin/user/index.php
index cd2b68d52..c18ed6c16 100644
--- a/admin/user/index.php
+++ b/admin/user/index.php
@@ -23,20 +23,20 @@
$offset = get_input('offset', 0);
$context = get_context();
+
+ $title = elgg_view_title(elgg_echo('admin:user'));
+
set_context('search');
-
- if ($search){
- $entities = search_for_user($search, $limit, $offset, "",false);
- $count = search_for_user($search, $limit, $offset, "",true);
-
- $result = elgg_view_entity_list($entities, $count, $offset, $limit, false);
- } else {
- $result = list_entities_from_metadata("", $tag, "user", "",0, $limit, false);
- }
-
-
+
+ $result = list_entities('user');
+
+ set_context('admin');
// Display main admin menu
- page_draw(elgg_echo("admin:user"),elgg_view_layout("one_column", elgg_view("admin/user") . $result));
- set_context($context);
+ page_draw(elgg_echo("admin:user"),
+ elgg_view_layout("two_column_left_sidebar",
+ '',
+ $title . elgg_view("admin/user") . $result)
+ );
+
?> \ No newline at end of file
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index abf3dad01..3d72eb1c4 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -52,6 +52,20 @@
// Register some actions
register_action('admin/site/update_basic', false, "", true); // Register basic site admin action
+ }
+
+ function admin_pagesetup() {
+
+ if (get_context() == 'admin') {
+
+ global $CONFIG;
+ add_submenu_item(elgg_echo('admin:statistics'), $CONFIG->wwwroot . 'pg/admin/statistics/');
+ add_submenu_item(elgg_echo('admin:site'), $CONFIG->wwwroot . 'pg/admin/site/');
+ add_submenu_item(elgg_echo('admin:user'), $CONFIG->wwwroot . 'pg/admin/user/');
+ add_submenu_item(elgg_echo('admin:plugins'), $CONFIG->wwwroot . 'pg/admin/plugins/');
+
+ }
+
}
/**
@@ -117,8 +131,9 @@
return delete_entity($guid);
}
- /// Register init function
+ /// Register init functions
register_elgg_event_handler('init','system','admin_init');
+ register_elgg_event_handler('pagesetup','system','admin_pagesetup');
// Register a plugin hook for permissions
register_plugin_hook('permissions_check','all','admin_permissions');
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index ff89a3142..2e0b7d21e 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1344,15 +1344,16 @@
* @param int $owner_guid The GUID of the owning user
* @param int $limit The number of entities to display per page (default: 10)
* @param true|false $fullview Whether or not to display the full view (default: true)
+ * @param true|false $viewtypetoggle Whether or not to allow gallery view
* @return string A viewable list of entities
*/
- function list_entities($type= "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true) {
+ function list_entities($type= "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = false) {
$offset = (int) get_input('offset');
$count = get_entities($type, $subtype, $owner_guid, "", $limit, $offset, true);
$entities = get_entities($type, $subtype, $owner_guid, "", $limit, $offset);
- return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview);
+ return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle);
}
diff --git a/views/default/account/forms/useradd.php b/views/default/account/forms/useradd.php
index f5957d6df..95249c784 100644
--- a/views/default/account/forms/useradd.php
+++ b/views/default/account/forms/useradd.php
@@ -19,11 +19,16 @@
<div id="add-box">
<h2><?php echo elgg_echo('adduser'); ?></h2>
<form action="<?php echo $vars['url']; ?>action/useradd" method="POST">
- <p><label><?php echo elgg_echo('name'); ?>: <input name="name" type="text" class="general-textarea" /></label><br />
- <label><?php echo elgg_echo('email'); ?>: <input name="email" type="text" class="general-textarea" /></label><br />
- <label><?php echo elgg_echo('username'); ?>: <input name="username" type="text" class="general-textarea" /></label><br />
- <label><?php echo elgg_echo('password'); ?>: <input name="password" type="password" class="general-textarea" /></label><br />
- <label><?php echo elgg_echo('passwordagain'); ?>: <input name="password2" type="password" class="general-textarea" /></label><br />
+ <p><label><?php echo elgg_echo('name'); ?>:
+ <?php echo elgg_view('input/text', array('internalname' => 'name')); ?></label><br />
+ <label><?php echo elgg_echo('email'); ?>:
+ <?php echo elgg_view('input/email', array('internalname' => 'email')); ?></label><br />
+ <label><?php echo elgg_echo('username'); ?>:
+ <?php echo elgg_view('input/text', array('internalname' => 'username')); ?></label><br />
+ <label><?php echo elgg_echo('password'); ?>:
+ <?php echo elgg_view('input/password', array('internalname' => 'password')); ?></label><br />
+ <label><?php echo elgg_echo('passwordagain'); ?>:
+ <?php echo elgg_view('input/password', array('internalname' => 'password2')); ?></label><br />
<?php
if ($admin_option) {
?>
diff --git a/views/default/admin/user_opt/adduser.php b/views/default/admin/user_opt/adduser.php
index 29827d798..b60bb9d52 100644
--- a/views/default/admin/user_opt/adduser.php
+++ b/views/default/admin/user_opt/adduser.php
@@ -12,9 +12,9 @@
*/
?>
-<div>
- <?php echo elgg_echo('admin:user:adduser:label'); ?>
+<div class="admin_adduser_link">
+ <a href="#" onclick="$('#add_user_showhide').toggle()"><?php echo elgg_echo('admin:user:adduser:label'); ?></a>
</div>
-<div id="add_user_showhide">
+<div id="add_user_showhide" style="display:none" >
<?php echo elgg_view('account/forms/useradd', array('show_admin'=>true)); ?>
</div> \ No newline at end of file
diff --git a/views/default/admin/user_opt/search.php b/views/default/admin/user_opt/search.php
index 32477e9cf..2c9e84f2e 100644
--- a/views/default/admin/user_opt/search.php
+++ b/views/default/admin/user_opt/search.php
@@ -11,9 +11,14 @@
*/
?>
<div id="search-box">
- <form>
+ <form action="<?php echo $vars['url']; ?>search/" method="get">
<b><?php echo elgg_echo('admin:user:label:search'); ?></b>
- <input type="text" name="s" />
+ <?php
+
+ echo elgg_view('input/text',array('internalname' => 'tag'));
+
+ ?>
+ <input type="hidden" name="object" value="user" />
<input type="submit" name="<?php echo elgg_echo('admin:user:label:seachbutton'); ?>"
value="<?php echo elgg_echo('admin:user:label:seachbutton'); ?>" />
</form>