From: cash Date: Wed, 26 Jan 2011 12:13:37 +0000 (+0000) Subject: added edit views for admin widgets X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=cff53c3045e0c4c44375496bdb0531812aff7b6a;p=lorea%2Felgg.git added edit views for admin widgets git-svn-id: http://code.elgg.org/elgg/trunk@7939 36083f99-b078-4883-b0ff-0f9b5a30f544 --- diff --git a/languages/en.php b/languages/en.php index d02a13f23..9b5a69eb3 100644 --- a/languages/en.php +++ b/languages/en.php @@ -261,6 +261,7 @@ $english = array( 'widgets:add:description' => "Click on any widget button below to add it to your page.", 'widgets:position:fixed' => '(Fixed position on page)', 'widget:unavailable' => 'You have already added this widget', + 'widget:numbertodisplay' => 'Number of items to display', 'widget:delete' => 'Remove %s', 'widget:edit' => 'Customize this widget', @@ -466,8 +467,6 @@ $english = array( 'adduser:ok' => "You have successfully added a new user.", 'adduser:bad' => "The new user could not be created.", - 'item:object:reported_content' => "Reported items", - 'user:set:name' => "Account name settings", 'user:name:label' => "My display name", 'user:name:success' => "Successfully changed your name on the system.", @@ -543,8 +542,10 @@ $english = array( 'admin:widget:online_users:help' => 'Lists the users currently on the site', 'admin:widget:new_users' => 'New users', 'admin:widget:new_users:help' => 'Lists the newest users', - 'admin:widget:content_stats' => 'Content Statistics', + 'admin:widget:content_stats' => 'Content statistics', 'admin:widget:content_stats:help' => 'Keep track of the content created by your users', + 'widget:content_stats:type' => 'Content type', + 'widget:content_stats:number' => 'Number', /** * Plugins diff --git a/views/default/css/admin.php b/views/default/css/admin.php index 0b0fae692..f7562d0d5 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -871,28 +871,6 @@ a.elgg-longtext-control { text-shadow:0 -1px 0 #999999; } -/* ECML */ -.ecml_admin_table { - width:100%; -} -.ecml_admin_table td, th { - border: 1px solid gray; - text-align: center; - padding: 5px; -} -.ecml_admin_table th, .ecml_keyword_desc { - font-weight: bold; -} -.ecml_row_odd { - background-color: #EEE; -} -.ecml_row_even { - -} -.ecml_restricted { - color: #555; -} - .admin_plugin_reorder { float:right; width:200px; 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 ''; +echo '
'; +echo ''; +echo ''; foreach ($object_stats as $subtype => $num) { $name = elgg_echo("item:object:$subtype"); echo ""; } echo '
' . elgg_echo('widget:content_stats:type') . '' . elgg_echo('widget:content_stats:number') . '
$name$num
'; + +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 @@ +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); + +?> +

+ : + +

diff --git a/views/default/widgets/friends/edit.php b/views/default/widgets/friends/edit.php index 9a6499ede..d36ebcdb8 100644 --- a/views/default/widgets/friends/edit.php +++ b/views/default/widgets/friends/edit.php @@ -1,57 +1,52 @@ num_display)) { $vars['entity']->num_display = 12; - $vars['entity']->icon_size = 'small'; } +$params = array( + 'internalname' => 'params[num_display]', + 'value' => $vars['entity']->num_display, + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 20, 30, 50, 100), +); +$display_dropdown = elgg_view('input/pulldown', $params); + + // handle upgrade to 1.7.2 from previous versions if ($vars['entity']->icon_size == 1) { $vars['entity']->icon_size = 'small'; } elseif ($vars['entity']->icon_size == 2) { $vars['entity']->icon_size = 'tiny'; } -?> -

- : - +

+ : +

- - + : +

diff --git a/views/default/widgets/new_users/edit.php b/views/default/widgets/new_users/edit.php new file mode 100644 index 000000000..78c8941ad --- /dev/null +++ b/views/default/widgets/new_users/edit.php @@ -0,0 +1,23 @@ +num_display)) { + $vars['entity']->num_display = 5; +} + +$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); + +?> +

+ : + +

diff --git a/views/default/widgets/online_users/edit.php b/views/default/widgets/online_users/edit.php new file mode 100644 index 000000000..192e901ba --- /dev/null +++ b/views/default/widgets/online_users/edit.php @@ -0,0 +1,22 @@ +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); + +?> +

+ : + +