aboutsummaryrefslogtreecommitdiff
path: root/views/default/widgets/friends
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/friends
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/friends')
-rw-r--r--views/default/widgets/friends/edit.php63
1 files changed, 29 insertions, 34 deletions
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 @@
<?php
-
/**
- * Elgg Friends
* Friend widget options
*
- * @package ElggFriends
- * @subpackage Core
*/
-$selections = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 20, 30, 50, 100);
-$icon_sizes = array('small', 'tiny');
-
-// set defaults
+// set default value for display number
if (!isset($vars['entity']->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';
}
-?>
-<p>
- <?php echo elgg_echo("friends:num_display"); ?>:
- <select name="params[num_display]">
-<?php
-foreach ($selections as $selection) {
- $selected = '';
- if ($vars['entity']->num_display == $selection) {
- $selected = 'selected="selected"';
- }
- echo "<option value=\"$selection\" $selected>$selection</option>";
+// set default value for icon size
+if (!isset($vars['entity']->icon_size)) {
+ $vars['entity']->icon_size = 'small';
}
+
+$params = array(
+ 'internalname' => 'params[icon_size]',
+ 'value' => $vars['entity']->icon_size,
+ 'options_values' => array(
+ 'small' => elgg_echo('friends:small'),
+ 'tiny' => elgg_echo('friends:tiny'),
+ ),
+);
+$size_dropdown = elgg_view('input/pulldown', $params);
+
+
?>
- </select>
+<p>
+ <?php echo elgg_echo('friends:num_display'); ?>:
+ <?php echo $display_dropdown; ?>
</p>
<p>
- <?php echo elgg_echo("friends:icon_size"); ?>
- <select name="params[icon_size]">
-<?php
-foreach ($icon_sizes as $size) {
- $selected = '';
- if ($vars['entity']->icon_size == $size) {
- $selected = 'selected="selected"';
- }
- $label = elgg_echo("friends:$size");
- echo "<option value=\"$size\" $selected>$label</option>";
-}
-?>
- </select>
+ <?php echo elgg_echo('friends:icon_size'); ?>:
+ <?php echo $size_dropdown; ?>
</p>