aboutsummaryrefslogtreecommitdiff
path: root/views/default/widgets/content_stats
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-26 12:13:37 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-26 12:13:37 +0000
commitcff53c3045e0c4c44375496bdb0531812aff7b6a (patch)
treeb53ecb80993fb59306c16e14311d90f1cca76928 /views/default/widgets/content_stats
parent68803264c6476fd96311bc83937f04164348cce4 (diff)
downloadelgg-cff53c3045e0c4c44375496bdb0531812aff7b6a.tar.gz
elgg-cff53c3045e0c4c44375496bdb0531812aff7b6a.tar.bz2
added edit views for admin widgets
git-svn-id: http://code.elgg.org/elgg/trunk@7939 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/widgets/content_stats')
-rw-r--r--views/default/widgets/content_stats/content.php11
-rw-r--r--views/default/widgets/content_stats/edit.php23
2 files changed, 32 insertions, 2 deletions
diff --git a/views/default/widgets/content_stats/content.php b/views/default/widgets/content_stats/content.php
index b5ea00e18..568ebeeff 100644
--- a/views/default/widgets/content_stats/content.php
+++ b/views/default/widgets/content_stats/content.php
@@ -3,16 +3,23 @@
* Content stats widget
*/
-$max = 5;
+$max = $vars['entity']->num_display;
$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">';
+echo '<table class="elgg-table-alt">';
+echo '<tr><th>' . elgg_echo('widget:content_stats:type') . '</th>';
+echo '<th>' . elgg_echo('widget:content_stats:number') . '</th></tr>';
foreach ($object_stats as $subtype => $num) {
$name = elgg_echo("item:object:$subtype");
echo "<tr><td>$name</td><td>$num</td></tr>";
}
echo '</table>';
+
+echo elgg_view('output/url', array(
+ 'href' => 'pg/admin/statistics/overview',
+ 'text' => 'more',
+));
diff --git a/views/default/widgets/content_stats/edit.php b/views/default/widgets/content_stats/edit.php
new file mode 100644
index 000000000..681a96d48
--- /dev/null
+++ b/views/default/widgets/content_stats/edit.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Content statistics widget edit view
+ */
+
+
+// set default value
+if (!isset($vars['entity']->num_display)) {
+ $vars['entity']->num_display = 8;
+}
+
+$params = array(
+ 'internalname' => 'params[num_display]',
+ 'value' => $vars['entity']->num_display,
+ 'options' => array(5, 8, 10, 12, 15, 20),
+);
+$dropdown = elgg_view('input/pulldown', $params);
+
+?>
+<p>
+ <?php echo elgg_echo('widget:numbertodisplay'); ?>:
+ <?php echo $dropdown; ?>
+</p>