aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-24 02:02:46 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-24 02:02:46 +0000
commitde3b6654ddc28fe0fc7d6e1fb615ddb4fd3e3e47 (patch)
treeca658f3be6585f6a64a56693000bc46d7796289c /views/default
parent1cf47c89b8ca9f5c42f5e247c3cba939f9676564 (diff)
downloadelgg-de3b6654ddc28fe0fc7d6e1fb615ddb4fd3e3e47.tar.gz
elgg-de3b6654ddc28fe0fc7d6e1fb615ddb4fd3e3e47.tar.bz2
welcome to the admin dashboard
git-svn-id: http://code.elgg.org/elgg/trunk@7922 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default')
-rw-r--r--views/default/admin/dashboard.php11
-rw-r--r--views/default/admin/overview/statistics.php84
-rw-r--r--views/default/admin/statistics/overview.php77
-rw-r--r--views/default/css/admin.php124
-rw-r--r--views/default/layout/shells/widgets.php9
-rw-r--r--views/default/layout/shells/widgets/add_panel.php10
-rw-r--r--views/default/navigation/menu/elements/item.php4
-rw-r--r--views/default/widgets/content_stats/content.php18
-rw-r--r--views/default/widgets/new_users/content.php7
-rw-r--r--views/default/widgets/online_users/content.php3
10 files changed, 255 insertions, 92 deletions
diff --git a/views/default/admin/dashboard.php b/views/default/admin/dashboard.php
new file mode 100644
index 000000000..57e15308d
--- /dev/null
+++ b/views/default/admin/dashboard.php
@@ -0,0 +1,11 @@
+<?php
+
+elgg_set_page_owner_guid(get_loggedin_userid());
+
+$params = array(
+ 'num_columns' => 2,
+ 'exact_match' => true,
+);
+$widgets = elgg_view_layout('widgets', $params);
+
+echo $widgets; \ No newline at end of file
diff --git a/views/default/admin/overview/statistics.php b/views/default/admin/overview/statistics.php
deleted file mode 100644
index 52bd4ddb2..000000000
--- a/views/default/admin/overview/statistics.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-/**
- * Elgg statistics screen
- *
- * @package Elgg
- * @subpackage Core
- */
-
-// Work out number of users
-$users_stats = get_number_users();
-$total_users = get_number_users(true);
-
-// Get version information
-$version = get_version();
-$release = get_version(true);
-
-echo elgg_view('admin/statistics/extend');
-
-?>
-<div class="elgg-module elgg-inline-module">
- <div class="elgg-head">
- <h3><?php echo elgg_echo('admin:statistics:label:basic'); ?></h3>
- </div>
- <div class="elgg-body">
- <table class="elgg-table-alt">
- <tr class="odd">
- <td><b><?php echo elgg_echo('admin:statistics:label:version'); ?> :</b></td>
- <td><?php echo elgg_echo('admin:statistics:label:version:release'); ?> - <?php echo $release; ?>, <?php echo elgg_echo('admin:statistics:label:version:version'); ?> - <?php echo $version; ?></td>
- </tr>
- <tr class="even">
- <td><b><?php echo elgg_echo('admin:statistics:label:numusers'); ?> :</b></td>
- <td><?php echo $users_stats; ?> <?php echo elgg_echo('active'); ?> / <?php echo $total_users; ?> <?php echo elgg_echo('total') ?></td>
- </tr>
- </table>
- </div>
-</div>
-
-<?php
-
-// Get entity statistics
-$entity_stats = get_entity_statistics();
-$even_odd = "";
-?>
-<div class="elgg-module elgg-inline-module">
- <div class="elgg-head">
- <h3><?php echo elgg_echo('admin:statistics:label:numentities'); ?></h3>
- </div>
- <div class="elgg-body">
- <table class="elgg-table-alt">
- <?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>{$a}:</td>
- <td>{$b}</td>
- </tr>
-END;
- }
- }
- ?>
- </table>
- </div>
-</div> \ No newline at end of file
diff --git a/views/default/admin/statistics/overview.php b/views/default/admin/statistics/overview.php
new file mode 100644
index 000000000..09678fc9a
--- /dev/null
+++ b/views/default/admin/statistics/overview.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Elgg statistics screen
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+// Work out number of users
+$users_stats = get_number_users();
+$total_users = get_number_users(true);
+
+// Get version information
+$version = get_version();
+$release = get_version(true);
+
+?>
+<div class="admin_settings site_stats">
+ <?php echo elgg_view('overview/extend'); ?>
+ <h3><?php echo elgg_echo('admin:statistics:label:basic'); ?></h3>
+ <table class="styled">
+ <tr class="odd">
+ <td class="column-one"><b><?php echo elgg_echo('admin:statistics:label:version'); ?> :</b></td>
+ <td><?php echo elgg_echo('admin:statistics:label:version:release'); ?> - <?php echo $release; ?>, <?php echo elgg_echo('admin:statistics:label:version:version'); ?> - <?php echo $version; ?></td>
+ </tr>
+ <tr class="even">
+ <td class="column-one"><b><?php echo elgg_echo('admin:statistics:label:numusers'); ?> :</b></td>
+ <td><?php echo $users_stats; ?> <?php echo elgg_echo('active'); ?> / <?php echo $total_users; ?> <?php echo elgg_echo('total') ?></td>
+ </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/css/admin.php b/views/default/css/admin.php
index d92cf968c..9735de87f 100644
--- a/views/default/css/admin.php
+++ b/views/default/css/admin.php
@@ -385,7 +385,7 @@ input {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
}
-input[type="submit"], .elgg-submit-button {
+input[type="submit"], .elgg-submit-button, .elgg-action-button {
font-size: 14px;
font-weight: bold;
color: white;
@@ -400,12 +400,12 @@ input[type="submit"], .elgg-submit-button {
cursor: pointer;
outline: none;
}
-input[type="submit"]:hover, .elgg-submit-button:hover {
+input[type="submit"]:hover, .elgg-submit-button:hover, .elgg-action-button:hover {
color: white;
background-color: #000000;
text-decoration: none;
}
-.elgg-submit-button {
+.elgg-submit-button, .elgg-action-button {
padding: 4px 8px;
}
/* ***************************************
@@ -446,6 +446,124 @@ input[type="submit"]:hover, .elgg-submit-button:hover {
border-color: #555555;
}
+/* ***************************************
+ WIDGETS
+*************************************** */
+.elgg-widgets {
+ float: right;
+ min-height: 30px;
+}
+.elgg-widget-add-control {
+ text-align: right;
+ margin: 5px 5px 15px;
+}
+.elgg-widgets-add-panel {
+ padding: 10px;
+ margin: 0 5px 15px;
+ background: #eeeeee;
+ border: 1px solid #cccccc;
+}
+
+<?php //@todo location-dependent style: make an extension of elgg-gallery ?>
+.elgg-widgets-add-panel ul {
+ padding: 0;
+ margin: 0;
+}
+.elgg-widgets-add-panel li {
+ float: left;
+ margin: 2px 10px;
+ list-style: none;
+ width: 200px;
+ padding: 4px;
+ background-color: #eeeeee;
+ border: 1px solid #cccccc;
+ font-weight: bold;
+}
+.elgg-widgets-add-panel li a {
+ display: block;
+}
+
+<?php //@todo Convert to elgg-state-*? ?>
+.elgg-widget-available {
+ color: #333333;
+ cursor: pointer;
+}
+.elgg-widget-available:hover {
+ border-color: #aaaaaa;
+}
+.elgg-widget-unavailable {
+ color: #888888;
+}
+<?php //@todo extend elgg-module. Still too many location-dependent/overly-qualified styles ?>
+.elgg-widget {
+ background-color: #dedede;
+ padding: 1px;
+ margin: 0 5px 15px;
+ position: relative;
+}
+.elgg-widget:hover {
+ background-color: #cccccc;
+}
+.elgg-widget-title {
+ background-color: #f5f5f5;
+ height: 30px;
+ line-height: 30px;
+ overflow: hidden;
+}
+.elgg-widget-title h3 {
+ float: left;
+ padding: 0 45px 0 20px;
+ color: #333333;
+}
+.elgg-widget-controls a {
+ position: absolute;
+ top: 5px;
+ display: block;
+ width: 18px;
+ height: 18px;
+ border: 1px solid transparent;
+}
+a.elgg-widget-collapse-button {
+ left: 5px;
+ background:transparent url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat 0px -385px;
+}
+.elgg-widget-controls a.elgg-widget-collapsed {
+ background-position: 0px -365px;
+}
+a.elgg-widget-delete-button {
+ right: 5px;
+ background:transparent url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat -198px 3px;
+}
+a.elgg-widget-edit-button {
+ right: 25px;
+ background:transparent url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat -300px -1px;
+}
+a.elgg-widget-edit-button:hover, a.elgg-widget-delete-button:hover {
+ border: 1px solid #cccccc;
+}
+.elgg-widget-container {
+ border-top: 1px solid #dedede;
+ background-color: white;
+ width: 100%;
+ overflow: hidden;
+}
+.elgg-widget-edit {
+ display: none;
+ width: 96%;
+ padding: 2%;
+ border-bottom: 1px solid #dedede;
+}
+.elgg-widget-content {
+ padding: 10px;
+}
+.drag-handle {
+ cursor: move;
+}
+.elgg-widget-placeholder {
+ border: 2px dashed #dedede;
+ margin-bottom: 15px;
+}
+
diff --git a/views/default/layout/shells/widgets.php b/views/default/layout/shells/widgets.php
index 82489b37f..656a0e4c3 100644
--- a/views/default/layout/shells/widgets.php
+++ b/views/default/layout/shells/widgets.php
@@ -2,14 +2,16 @@
/**
* Elgg widgets layout
*
- * @uses $vars['box'] Optional display box at the top of layout
- * @uses $vars['num_columns'] Number of widget columns for this layout
- * @uses $vars['show_add_widgets'] Display the add widgets button and panel
+ * @uses $vars['box'] Optional display box at the top of layout
+ * @uses $vars['num_columns'] Number of widget columns for this layout (3)
+ * @uses $vars['show_add_widgets'] Display the add widgets button and panel (true)
+ * @uses $vars['exact_match'] Widgets must match the current context (false)
*/
$box = elgg_get_array_value('box', $vars, '');
$num_columns = elgg_get_array_value('num_columns', $vars, 3);
$show_add_widgets = elgg_get_array_value('show_add_widgets', $vars, true);
+$exact_match = elgg_get_array_value('exact_match', $vars, false);
$owner = elgg_get_page_owner();
$context = elgg_get_context();
@@ -24,6 +26,7 @@ if (elgg_can_edit_widget_layout($context)) {
$params = array(
'widgets' => $widgets,
'context' => $context,
+ 'exact_match' => $exact_match,
);
echo elgg_view('layout/shells/widgets/add_panel', $params);
}
diff --git a/views/default/layout/shells/widgets/add_panel.php b/views/default/layout/shells/widgets/add_panel.php
index 1e2dc3bbc..2d2a05a08 100644
--- a/views/default/layout/shells/widgets/add_panel.php
+++ b/views/default/layout/shells/widgets/add_panel.php
@@ -1,9 +1,17 @@
<?php
+/**
+ * Widget add panel
+ *
+ * @uses $vars['widgets'] Array of current widgets
+ * @uses $vars['context'] The context for this widget layout
+ * @uses $vars['exact_match'] Only use widgets that match the context
+ */
$widgets = $vars['widgets'];
$context = $vars['context'];
+$exact = elgg_get_array_value('exact_match', $vars, false);
-$widget_types = elgg_get_widget_types($context);
+$widget_types = elgg_get_widget_types($context, $exact);
$current_handlers = array();
foreach ($widgets as $column_widgets) {
diff --git a/views/default/navigation/menu/elements/item.php b/views/default/navigation/menu/elements/item.php
index 7903dbdc0..7c88c344c 100644
--- a/views/default/navigation/menu/elements/item.php
+++ b/views/default/navigation/menu/elements/item.php
@@ -3,15 +3,17 @@
$item = $vars['item'];
$class = '';
+$link_class = 'elgg-menu-closed';
if ($item->getSelected()) {
$class = 'class="selected"';
+ $link_class = 'elgg-menu-opened';
}
$link_vars = array();
$children = $item->getChildren();
if ($children) {
- $link_vars['class'] = 'elgg-menu-parent elgg-menu-closed';
+ $link_vars['class'] = "elgg-menu-parent $link_class";
}
echo "<li $class>";
diff --git a/views/default/widgets/content_stats/content.php b/views/default/widgets/content_stats/content.php
new file mode 100644
index 000000000..b5ea00e18
--- /dev/null
+++ b/views/default/widgets/content_stats/content.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Content stats widget
+ */
+
+$max = 5;
+
+$entity_stats = get_entity_statistics();
+$object_stats = $entity_stats['object'];
+arsort($object_stats);
+$object_stats = array_slice($object_stats, 0, $max);
+
+echo '<table class="elgg-table">';
+foreach ($object_stats as $subtype => $num) {
+ $name = elgg_echo("item:object:$subtype");
+ echo "<tr><td>$name</td><td>$num</td></tr>";
+}
+echo '</table>';
diff --git a/views/default/widgets/new_users/content.php b/views/default/widgets/new_users/content.php
new file mode 100644
index 000000000..cfa7d8bda
--- /dev/null
+++ b/views/default/widgets/new_users/content.php
@@ -0,0 +1,7 @@
+<?php
+
+echo elgg_list_entities(array(
+ 'type' => 'user',
+ 'subtype'=> null,
+ 'full_view' => FALSE
+)); \ No newline at end of file
diff --git a/views/default/widgets/online_users/content.php b/views/default/widgets/online_users/content.php
new file mode 100644
index 000000000..e1ff69811
--- /dev/null
+++ b/views/default/widgets/online_users/content.php
@@ -0,0 +1,3 @@
+<?php
+
+echo $users_online = get_online_users(); \ No newline at end of file