diff options
Diffstat (limited to 'views/default/widgets')
52 files changed, 341 insertions, 2211 deletions
diff --git a/views/default/widgets/admin_welcome/content.php b/views/default/widgets/admin_welcome/content.php new file mode 100644 index 000000000..f4b92ea66 --- /dev/null +++ b/views/default/widgets/admin_welcome/content.php @@ -0,0 +1,19 @@ +<?php +/** + * Welcome widget for admins + */ + +// section => string replacements. +$sections = array( + 'intro' => array(), + 'admin_overview' => array(), + 'outro' => array() +); + +// don't use longtext because it filters output. +// that's annoying. +echo '<div class="elgg-output">'; +foreach ($sections as $section => $strings) { + echo '<p>' . elgg_echo("admin:widget:admin_welcome:$section", $strings) . '</p>'; +} +echo '</div>';
\ No newline at end of file diff --git a/views/default/widgets/cloud_generic_index/content.php b/views/default/widgets/cloud_generic_index/content.php deleted file mode 100644 index bee459e1d..000000000 --- a/views/default/widgets/cloud_generic_index/content.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php
-$maintype = "object";
-$subtype = $vars["entity"]->widget_subtype;
-if (empty($subtype) || $subtype == 'All') {
- $subtype = ELGG_ENTITIES_ANY_VALUE;
-}
-
-if ($subtype == 'user') {$maintype='user';}
-if ($subtype == 'group') {$maintype='group';}
-
-
-$num_items = $vars['entity']->num_items;
-if (!isset($num_items))
- $num_items = 20;
-
-$created_time_limit = $vars['entity']->created_time_limit;
-if (!isset($created_time_limit) || $created_time_limit == 'all') {
- $created_time = ELGG_ENTITIES_ANY_VALUE;
-}
-elseif ($created_time_limit == 'day') {
- $created_time = time()-(3600*24);
-}
-elseif ($created_time_limit == 'week') {
- $created_time = time()-(3600*24*7);
-}
-elseif ($created_time_limit == 'month') {
- $created_time = time()-(3600*24*30);
-}
-
-$metadata_name = $vars['entity']->metadata_name;
-if (!isset($metadata_name)) {
- $metadata_name = 'tags';
-} else {
- $metadata_name = $metadata_name;
-}
-
-$threshold = $vars['entity']->threshold;
-if (!isset($threshold))
- $threshold = 1;
-
-$widget_group = $vars["entity"]->widget_group;
-if (empty($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
-
-
-elgg_push_context('tags');
-$options = array('threshold' => $threshold,
- 'limit' => $num_items,
- 'type' => $maintype,
- 'subtype' => $subtype,
- 'tag_name' => $metadata_name,
- 'created_time_lower' => $created_time,
- 'container_guid' => $widget_group);
-
-$body = elgg_view_tagcloud($options);
-elgg_pop_context();
-
-echo $body;
-
-?>
diff --git a/views/default/widgets/cloud_generic_index/edit.php b/views/default/widgets/cloud_generic_index/edit.php deleted file mode 100644 index 84b2fa861..000000000 --- a/views/default/widgets/cloud_generic_index/edit.php +++ /dev/null @@ -1,120 +0,0 @@ - <?php - $num_items = $vars['entity']->num_items; - if (!isset($num_items)) $num_items = 10; - - $created_time_limit = $vars['entity']->created_time_limit; - if (!isset($created_time_limit)) $created_time_limit = 'all'; - - $widget_group = $vars["entity"]->widget_group; - if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE; - - $metadata_name = $vars['entity']->metadata_name; - if (!isset($metadata_name)) $metadata_name = ""; - - $threshold = $vars['entity']->threshold; - if (!isset($threshold)) $threshold = 1; - - $widget_title = $vars['entity']->widget_title; - $widget_group = $vars["entity"]->widget_group; - $widget_subtype = $vars["entity"]->widget_subtype; - - $guest_only = $vars['entity']->guest_only; - if (!isset($guest_only)) $guest_only = "no"; - - $box_style = $vars['entity']->box_style; - if (!isset($box_style)) $box_style = "collapsable"; - ?> - <p> - <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> - : - <?php - echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:widget_subtype'); ?> - : - <?php - - $subtypes = get_data("SELECT subtype from {$CONFIG->dbprefix}entity_subtypes"); - $subtype_list = array(); - $subtype_list['All'] = ''; - $subtype_list['user'] = 'user'; - $subtype_list['group'] = 'group'; - - if ($subtypes) { - foreach ($subtypes as $data) { - $subtype_list[$data->subtype] = $data->subtype; - } - } - echo elgg_view('input/dropdown', array('name'=>'params[widget_subtype]', 'options_values'=>$subtype_list, 'value'=>$widget_subtype)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:widget_created_time_limit'); ?> - : - <?php - - $limits = array('all', 'month', 'week', 'day'); - $limit_list = array(); - foreach($limits as $limit) { - $limit_list[$limit] = elgg_echo("custom_index_widgets:time_limit:$limit"); - } - echo '<p>'.elgg_view('input/dropdown', array('name'=>'params[created_time_limit]', 'options_values'=>$limit_list, 'value'=>$created_time_limit))."</p>"; - ?> - </p> - - <p> - <?php echo elgg_echo('group'); ?> - : - <?php - $groups = elgg_get_entities(array("type"=>'group','limit'=>100)); - $group_list = array(); - $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); - if ($groups) { - foreach ($groups as $group) { - $group_list[$group->getGUID()] = $group->name; - } - } - echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:threshold'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[threshold]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$thresholds)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:num_items'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:metadata_name'); ?> - : - <?php - echo elgg_view('input/text', array('name'=>'params[metadata_name]', 'value'=>$metadata_name)); - ?> - </p> -<p> - <?php echo elgg_echo('custom_index_widgets:box_style'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[box_style]', - 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), - 'value'=>$box_style)); - ?> -</p> -<p> - <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', - 'options_values'=>array('yes'=>'yes', 'no'=>'no'), - 'value'=>$guest_only)); - ?> -</p> diff --git a/views/default/widgets/content_stats/content.php b/views/default/widgets/content_stats/content.php new file mode 100644 index 000000000..56772047d --- /dev/null +++ b/views/default/widgets/content_stats/content.php @@ -0,0 +1,28 @@ +<?php +/** + * Content stats widget + */ + +$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-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 '<div class="mtm">'; +echo elgg_view('output/url', array( + 'href' => 'admin/statistics/overview', + 'text' => elgg_echo('more'), + 'is_trusted' => true, +)); +echo '</div>'; diff --git a/views/default/widgets/content_stats/edit.php b/views/default/widgets/content_stats/edit.php new file mode 100644 index 000000000..f1a050df8 --- /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( + 'name' => 'params[num_display]', + 'value' => $vars['entity']->num_display, + 'options' => array(5, 8, 10, 12, 15, 20), +); +$dropdown = elgg_view('input/dropdown', $params); + +?> +<p> + <?php echo elgg_echo('widget:numbertodisplay'); ?>: + <?php echo $dropdown; ?> +</p> diff --git a/views/default/widgets/control_panel/content.php b/views/default/widgets/control_panel/content.php new file mode 100644 index 000000000..a348d612f --- /dev/null +++ b/views/default/widgets/control_panel/content.php @@ -0,0 +1,38 @@ +<?php +/** + * Admin control panel widget + */ + +elgg_register_menu_item('admin_control_panel', array( + 'name' => 'flush', + 'text' => elgg_echo('admin:cache:flush'), + 'href' => 'action/admin/site/flush_cache', + 'is_action' => true, + 'link_class' => 'elgg-button elgg-button-action', +)); + +// @todo Move in this in ElggUpgradeManager::isLocked() when #4682 fixed +$is_locked = _elgg_upgrade_is_locked(); + +if (!$is_locked) { + elgg_register_menu_item('admin_control_panel', array( + 'name' => 'upgrade', + 'text' => elgg_echo('upgrade'), + 'href' => 'upgrade.php', + 'link_class' => 'elgg-button elgg-button-action', + )); +} else { + elgg_register_menu_item('admin_control_panel', array( + 'name' => 'unlock_upgrade', + 'text' => elgg_echo('upgrade:unlock'), + 'href' => 'action/admin/site/unlock_upgrade', + 'is_action' => true, + 'link_class' => 'elgg-button elgg-button-action', + 'confirm' => elgg_echo('upgrade:unlock:confirm'), + )); +} + +echo elgg_view_menu('admin_control_panel', array( + 'class' => 'elgg-menu-hz', + 'item_class' => 'mrm', +)); diff --git a/views/default/widgets/feed_reader_index/content.php b/views/default/widgets/feed_reader_index/content.php deleted file mode 100644 index 2695315d5..000000000 --- a/views/default/widgets/feed_reader_index/content.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php
-
- include elgg_get_plugins_path() . 'simplepie/views/default/widgets/feed_reader/content.php';
-
- //$body = elgg_view("simplepie/widgets/feed_reader/content", $vars);
- //echo $body;
-
-?>
diff --git a/views/default/widgets/feed_reader_index/edit.php b/views/default/widgets/feed_reader_index/edit.php deleted file mode 100644 index 5fc36bc54..000000000 --- a/views/default/widgets/feed_reader_index/edit.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php
- include elgg_get_plugins_path() . 'simplepie/views/default/widgets/feed_reader/edit.php';
- //echo elgg_view("simplepie/edit", $vars);
-?>
-
diff --git a/views/default/widgets/friends/content.php b/views/default/widgets/friends/content.php new file mode 100644 index 000000000..98814c244 --- /dev/null +++ b/views/default/widgets/friends/content.php @@ -0,0 +1,25 @@ +<?php +/** + * Friend widget display view + * + */ + +// owner of the widget +$owner = $vars['entity']->getOwnerEntity(); + +// the number of friends to display +$num = (int) $vars['entity']->num_display; + +// get the correct size +$size = $vars['entity']->icon_size; + +if (elgg_instanceof($owner, 'user')) { + $html = $owner->listFriends('', $num, array( + 'size' => $size, + 'list_type' => 'gallery', + 'pagination' => false + )); + if ($html) { + echo $html; + } +} diff --git a/views/default/widgets/friends/edit.php b/views/default/widgets/friends/edit.php new file mode 100644 index 000000000..c7e6b06ff --- /dev/null +++ b/views/default/widgets/friends/edit.php @@ -0,0 +1,52 @@ +<?php +/** + * Friend widget options + * + */ + +// set default value for display number +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 12; +} + +$params = array( + 'name' => '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/dropdown', $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'; +} + +// set default value for icon size +if (!isset($vars['entity']->icon_size)) { + $vars['entity']->icon_size = 'small'; +} + +$params = array( + 'name' => '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/dropdown', $params); + + +?> +<p> + <?php echo elgg_echo('friends:num_display'); ?>: + <?php echo $display_dropdown; ?> +</p> + +<p> + <?php echo elgg_echo('friends:icon_size'); ?>: + <?php echo $size_dropdown; ?> +</p> diff --git a/views/default/widgets/inline_content_index/content.php b/views/default/widgets/inline_content_index/content.php deleted file mode 100644 index 6ed53f197..000000000 --- a/views/default/widgets/inline_content_index/content.php +++ /dev/null @@ -1,7 +0,0 @@ -<div class="contentWrapper">
- <?php
- echo $vars[entity]->html_content;
- ?>
- <div class="clearfloat">
- </div>
-</div>
diff --git a/views/default/widgets/inline_content_index/edit.php b/views/default/widgets/inline_content_index/edit.php deleted file mode 100644 index e5c319bf1..000000000 --- a/views/default/widgets/inline_content_index/edit.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php
- $widget_title = $vars['entity']->widget_title;
- $html_content = $vars['entity']->html_content;
- - $guest_only = $vars['entity']->guest_only;
- if (!isset($guest_only)) $guest_only = "no"; - - $box_style = $vars['entity']->box_style;
- if (!isset($box_style)) $box_style = "collapsable";
-?>
-<p>
- <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>:
- <?php
- echo elgg_view('input/text', array(
- 'name' => 'params[widget_title]',
- 'value' => $widget_title
- ));
- ?>
-</p>
-<p>
-<?php echo elgg_echo('custom_index_widgets:html_content'); ?>
-<?php
- echo elgg_view('input/longtext', array(
- 'name' => 'params[html_content]',
- 'value' => $html_content
- ));
- ?>
-</p> -<p>
- <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[box_style]', - 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), - 'value'=>$box_style));
- ?> -</p>
-<p>
- <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
- 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
- 'value'=>$guest_only));
- ?>
-</p>
\ No newline at end of file diff --git a/views/default/widgets/latest_activity_index/content.php b/views/default/widgets/latest_activity_index/content.php deleted file mode 100644 index 4010e0cb4..000000000 --- a/views/default/widgets/latest_activity_index/content.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php
-
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items)) $num_items = 10;
-
- $widget_group = $vars["entity"]->widget_group;
- if (!isset($widget_group)) $widget_group = 0;
-
- /*
- $site_categories = $vars['config']->site->categories;
- $widget_categorie = $vars['entity']->widget_categorie;
- $widget_context_mode = $vars['entity']->widget_context_mode;
- if (!isset($widget_context_mode)) $widget_context_mode = 'search';
- elgg_set_context($widget_context_mode);
- */
- $widget_datas = elgg_list_river(0, $widget_group, '', '', '', '', $num_items,0,0,false);
-
- echo $widget_datas;
-?>
-
diff --git a/views/default/widgets/latest_activity_index/edit.php b/views/default/widgets/latest_activity_index/edit.php deleted file mode 100644 index 622655307..000000000 --- a/views/default/widgets/latest_activity_index/edit.php +++ /dev/null @@ -1,64 +0,0 @@ - <?php
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items)) $num_items = 10;
-
- $widget_group = $vars["entity"]->widget_group;
- if (!isset($widget_group)) $widget_group = 0;
-
- $widget_title = $vars['entity']->widget_title;
- $widget_group = $vars["entity"]->widget_group;
-
- $guest_only = $vars['entity']->guest_only;
- if (!isset($guest_only)) $guest_only = "no";
-
- $box_style = $vars['entity']->box_style;
- if (!isset($box_style)) $box_style = "collapsable";
- ?>
- <p>
- <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>
- :
- <?php
- echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('group'); ?>
- :
- <?php
- //$groups = elgg_get_entities(array("type"=>'group','limit'=>100));
- $groups = elgg_get_entities(array('type'=>'group'));
- $group_list = array();
- $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups');
- if ($groups) {
- foreach ($groups as $group) {
- $group_list[$group->getGUID()] = $group->name;
- }
- }
- echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:num_items'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
- 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
- 'value'=>$box_style));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
- 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
- 'value'=>$guest_only));
- ?>
- </p>
diff --git a/views/default/widgets/latest_album_index/content.php b/views/default/widgets/latest_album_index/content.php deleted file mode 100644 index c511a775a..000000000 --- a/views/default/widgets/latest_album_index/content.php +++ /dev/null @@ -1,64 +0,0 @@ -<div class="contentWrapper"> -<?php - - $object_type ='album'; - - $num_items = $vars['entity']->num_items; - if (!isset($num_items)) - $num_items = 10; - - $widget_group = $vars["entity"]->widget_group; - if (!isset($widget_group)) - $widget_group = 0; - - $site_categories = $vars['config']->site->categories; - $widget_categorie = $vars['entity']->widget_categorie; - $widget_context_mode = $vars['entity']->widget_context_mode; - if (!isset($widget_context_mode)) - $widget_context_mode = 'search'; - elgg_set_context($widget_context_mode); - - $owner_albums = elgg_get_entities("object", $object_type, $widget_group, "", $num_items, 0, false); - - echo '<div id="tidypics_album_widget_container">'; - - if ($owner_albums) { - foreach($owner_albums as $album) { - - if($album->cover) - $album_cover = '<img src="'.$vars['url'].'mod/tidypics/thumbnail.php?file_guid='.$album->cover.'&size=small" class="tidypics_album_cover" alt="' . $album->title . '"/>'; - else - $album_cover = '<img src="'.$vars['url'].'mod/tidypics/graphics/empty_album.png" class="tidypics_album_cover" alt="' . $album->title . '">'; -?> - <div class="tidypics_album_widget_single_item"> - <div class="tidypics_album_widget_title"><a href="<?php echo $album->getURL();?>"><?php echo $album->title;?></a></div> - <div class="tidypics_album_widget_timestamp"> <?php echo elgg_echo("album:created:on") . ' ' . elgg_get_friendly_time($album->time_created);?></div> -<?php - //get the number of comments - $numcomments = $album->countComments(); - if ($numcomments) - echo "<a href=\"{$album->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a><br>"; -?> - <a href="<?php echo $album->getURL();?>"><?php echo $album_cover;?></a> - </div> -<?php - } //end of foreach loop - - // bottom link to all group/user albums - /*if (is_null($owner->username) || empty($owner->username)) { - echo '<p class="profile_info_edit_buttons"><a href="' . $vars['url'] . 'pg/photos/world">' . elgg_echo('album:all') . '</a></p>'; - } else { - echo '<p class="tidypics_download"><a href="' . $vars['url'] . 'pg/photos/owned/' . $owner->username . '">' . elgg_echo('album:more') . '</a></p>'; - }*/ - - } - - /*if (can_write_to_container(0, $owner->guid)) { - echo '<p class="tidypics_download"><a href=' . $CONFIG->wwwroot .'pg/photos/new/' . $owner->username . '>' . elgg_echo("album:create") . '</a></p>'; - }*/ - - - //close album_widget_container div - echo "</div>"; -?> -</div>
\ No newline at end of file diff --git a/views/default/widgets/latest_album_index/edit.php b/views/default/widgets/latest_album_index/edit.php deleted file mode 100644 index 86eaa19cc..000000000 --- a/views/default/widgets/latest_album_index/edit.php +++ /dev/null @@ -1,64 +0,0 @@ - <?php - $num_items = $vars['entity']->num_items; - if (!isset($num_items)) $num_items = 10; - - $widget_group = $vars["entity"]->widget_group; - if (!isset($widget_group)) $widget_group = 0; - - - $widget_title = $vars['entity']->widget_title; - $widget_group = $vars["entity"]->widget_group; - - $guest_only = $vars['entity']->guest_only; - if (!isset($guest_only)) $guest_only = "no"; - - $box_style = $vars['entity']->box_style; - if (!isset($box_style)) $box_style = "collapsable"; - ?> - <p> - <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> - : - <?php - echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); - ?> - </p> - <p> - <?php echo elgg_echo('group'); ?> - : - <?php - $groups = elgg_get_entities(array("type"=>'group','limit'=>100)); - $group_list = array(); - $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); - if ($groups) { - foreach ($groups as $group) { - $group_list[$group->getGUID()] = $group->name; - } - } - echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:num_items'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:box_style'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[box_style]', - 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), - 'value'=>$box_style)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', - 'options_values'=>array('yes'=>'yes', 'no'=>'no'), - 'value'=>$guest_only)); - ?> - </p>
\ No newline at end of file diff --git a/views/default/widgets/latest_blogs_index/content.php b/views/default/widgets/latest_blogs_index/content.php deleted file mode 100644 index cce94185d..000000000 --- a/views/default/widgets/latest_blogs_index/content.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php
-$object_type = 'blog';
-
-$num_items = $vars['entity']->num_items;
-if (!isset($num_items))
- $num_items = 10;
-
-$widget_group = $vars["entity"]->widget_group;
-if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
-
-$site_categories = $vars['config']->site->categories;
-$widget_categorie = $vars['entity']->widget_categorie;
-$widget_context_mode = $vars['entity']->widget_context_mode;
-if (!isset($widget_context_mode))
- $widget_context_mode = 'search';
-elgg_set_context($widget_context_mode);
-
-if ($site_categories == NULL || $widget_categorie == NULL) {
- $widget_datas = elgg_list_entities(array(
- 'type'=>'object',
- 'subtype'=>$object_type,
- 'container_guids' => $widget_group,
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false));
-} else {
-
- $widget_datas = elgg_list_entities_from_metadata(array(
- 'type'=>'object',
- 'subtype'=>$object_type,
- 'container_guids' => $widget_group,
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false,
- 'metadata_name' => 'universal_categories',
- 'metadata_value' => $widget_categorie,
- ));
-}
-echo $widget_datas;
-?>
-
diff --git a/views/default/widgets/latest_blogs_index/edit.php b/views/default/widgets/latest_blogs_index/edit.php deleted file mode 100644 index e89a68304..000000000 --- a/views/default/widgets/latest_blogs_index/edit.php +++ /dev/null @@ -1,85 +0,0 @@ - <?php - $num_items = $vars['entity']->num_items; - if (!isset($num_items)) $num_items = 10; - - $widget_group = $vars["entity"]->widget_group; - if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE; - - $site_categories = $vars['config']->site->categories; - $widget_categorie = $vars['entity']->widget_categorie; - $widget_context_mode = $vars['entity']->widget_context_mode; - if (!isset($widget_context_mode)) $widget_context_mode = 'search'; - - $widget_title = $vars['entity']->widget_title; - $widget_group = $vars["entity"]->widget_group; - - $guest_only = $vars['entity']->guest_only; - if (!isset($guest_only)) $guest_only = "no"; - - $box_style = $vars['entity']->box_style; - if (!isset($box_style)) $box_style = "collapsable"; - ?> - <p> - <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> - : - <?php - echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); - ?> - </p> - <p> - <?php echo elgg_echo('group'); ?> - : - <?php - $groups = elgg_get_entities(array("type"=>'group','limit'=>100)); - $group_list = array(); - $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); - if ($groups) { - foreach ($groups as $group) { - $group_list[$group->getGUID()] = $group->name; - } - } - echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); - ?> - </p> - <?php if ($site_categories != NULL) { ?> - <p> - <?php echo elgg_echo('categories'); ?> - : - <?php - $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories)); - echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie)); - ?> - </p> - <?php } ?> - <p> - <?php echo elgg_echo('custom_index_widgets:context_mode'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:num_items'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:box_style'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[box_style]', - 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), - 'value'=>$box_style)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', - 'options_values'=>array('yes'=>'yes', 'no'=>'no'), - 'value'=>$guest_only)); - ?> - </p> diff --git a/views/default/widgets/latest_bookmarks_index/content.php b/views/default/widgets/latest_bookmarks_index/content.php deleted file mode 100644 index 2622a63ea..000000000 --- a/views/default/widgets/latest_bookmarks_index/content.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php
-
- $object_type ='bookmarks';
-
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items)) $num_items = 10;
-
- $widget_group = $vars["entity"]->widget_group;
- if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
-
- $site_categories = $vars['config']->site->categories;
- $widget_categorie = $vars['entity']->widget_categorie;
- $widget_context_mode = $vars['entity']->widget_context_mode;
- if (!isset($widget_context_mode)) $widget_context_mode = 'search';
- elgg_set_context($widget_context_mode);
-
- if ($site_categories == NULL || $widget_categorie == NULL) {
- $widget_datas = elgg_list_entities(array(
- 'type'=>'object',
- 'subtype'=>$object_type,
- 'container_guids' => $widget_group,
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false));
-} else {
-
- $widget_datas = elgg_list_entities_from_metadata(array(
- 'type'=>'object',
- 'subtype'=>$object_type,
- 'container_guids' => $widget_group,
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false,
- 'metadata_name' => 'universal_categories',
- 'metadata_value' => $widget_categorie,
- ));
-}
-
-echo $widget_datas;
-?>
-
diff --git a/views/default/widgets/latest_bookmarks_index/edit.php b/views/default/widgets/latest_bookmarks_index/edit.php deleted file mode 100644 index 1a15cea49..000000000 --- a/views/default/widgets/latest_bookmarks_index/edit.php +++ /dev/null @@ -1,85 +0,0 @@ - <?php
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items)) $num_items = 10;
-
- $widget_group = $vars["entity"]->widget_group;
- if (!isset($widget_group)) $widget_group = 0;
-
- $site_categories = $vars['config']->site->categories;
- $widget_categorie = $vars['entity']->widget_categorie;
- $widget_context_mode = $vars['entity']->widget_context_mode;
- if (!isset($widget_context_mode)) $widget_context_mode = 'search';
-
- $widget_title = $vars['entity']->widget_title;
- $widget_group = $vars["entity"]->widget_group;
-
- $guest_only = $vars['entity']->guest_only;
- if (!isset($guest_only)) $guest_only = "no";
-
- $box_style = $vars['entity']->box_style;
- if (!isset($box_style)) $box_style = "collapsable";
- ?>
- <p>
- <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>
- :
- <?php
- echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('group'); ?>
- :
- <?php
- $groups = elgg_get_entities(array("type"=>'group','limit'=>100));
- $group_list = array();
- $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups');
- if ($groups) {
- foreach ($groups as $group) {
- $group_list[$group->getGUID()] = $group->name;
- }
- }
- echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group));
- ?>
- </p>
- <?php if ($site_categories != NULL) { ?>
- <p>
- <?php echo elgg_echo('categories'); ?>
- :
- <?php
- $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories));
- echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie));
- ?>
- </p>
- <?php } ?>
- <p>
- <?php echo elgg_echo('custom_index_widgets:context_mode'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:num_items'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
- 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
- 'value'=>$box_style));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
- 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
- 'value'=>$guest_only));
- ?>
- </p>
diff --git a/views/default/widgets/latest_events_index/content.php b/views/default/widgets/latest_events_index/content.php deleted file mode 100644 index 7c5ae40f3..000000000 --- a/views/default/widgets/latest_events_index/content.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php - - require_once($CONFIG->pluginspath.'event_calendar/models/model.php'); - - if(!function_exists('getLastDayOfMonth')){ - function getLastDayOfMonth($month,$year) { - return idate('d', mktime(0, 0, 0, ($month + 1), 0, $year)); - } - } - - $object_type ='event_calendar';
-
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items))
- $num_items = 10;
-
- $widget_group = $vars["entity"]->widget_group;
- if (!isset($widget_group))
- $widget_group = 0; - - $mode = $vars['mode']->mode;
- if (!isset($mode))
- $mode = "month";
-
- $site_categories = $vars['config']->site->categories;
- $widget_categorie = $vars['entity']->widget_categorie;
- $widget_context_mode = $vars['entity']->widget_context_mode;
- if (!isset($widget_context_mode))
- $widget_context_mode = 'search';
- - elgg_set_context($widget_context_mode); -
- - $original_start_date = date('Y-m-d'); - $day = 60*60*24;
- $week = 7*$day;
- $month = 31*$day;
-
- - if ($mode == "day") {
- $start_date = $original_start_date;
- $end_date = $start_date;
- $start_ts = strtotime($start_date);
- $end_ts = strtotime($end_date)+$day-1;
- } else if ($mode == "week") {
-
- $start_ts = strtotime($original_start_date);
- $start_ts -= date("w",$start_ts)*$day;
- $end_ts = $start_ts + 6*$day;
-
- $start_date = date('Y-m-d',$start_ts);
- $end_date = date('Y-m-d',$end_ts);
- } else {
- $start_ts = strtotime($original_start_date);
- $month = date('m',$start_ts);
- $year = date('Y',$start_ts);
- $start_date = $year.'-'.$month.'-1';
- $end_date = $year.'-'.$month.'-'.getLastDayOfMonth($month,$year);
- }
-
- if ($event_calendar_first_date && ($start_date < $event_calendar_first_date)) {
- $start_date = $event_calendar_first_date;
- }
-
- if ($event_calendar_last_date && ($end_date > $event_calendar_last_date)) {
- $end_date = $event_calendar_last_date;
- }
-
- $start_ts = strtotime($start_date);
-
- if ($mode == "day") {
- $end_ts = strtotime($end_date)+$day-1;
- } else if ($mode == "week") {
- $end_ts = $start_ts + 6*$day;
- } else {
- $end_ts = strtotime($end_date);
- } - - $count = event_calendar_get_events_between($start_ts,$end_ts,true,$num_items,0,$widget_group,'-');
- $events = event_calendar_get_events_between($start_ts,$end_ts,false,$num_items,0,$widget_group,'-'); - //$widget_datas= $event_list = elgg_view_entity_list($events, $count, 0, $num_items, false, false); - - $options = array( - 'list_class' => 'elgg-list-entity', - 'full_view' => FALSE, - 'pagination' => TRUE, - 'list_type' => 'listing', - 'list_type_toggle' => FALSE, - 'offset' => $vars['offset'], - 'limit' => $vars['limit'], - ); - $widget_datas = elgg_view_entity_list($events, $options); - echo $widget_datas;
-?>
-
diff --git a/views/default/widgets/latest_events_index/edit.php b/views/default/widgets/latest_events_index/edit.php deleted file mode 100644 index 3aa20f574..000000000 --- a/views/default/widgets/latest_events_index/edit.php +++ /dev/null @@ -1,96 +0,0 @@ - <?php
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items)) $num_items = 10;
-
- $widget_group = $vars["entity"]->widget_group;
- if (!isset($widget_group)) $widget_group = 0;
-
- $site_categories = $vars['config']->site->categories;
- $widget_categorie = $vars['entity']->widget_categorie;
- $widget_context_mode = $vars['entity']->widget_context_mode;
- if (!isset($widget_context_mode)) $widget_context_mode = 'search';
-
- $widget_title = $vars['entity']->widget_title;
- $widget_group = $vars["entity"]->widget_group;
-
- $guest_only = $vars['entity']->guest_only;
- if (!isset($guest_only)) $guest_only = "no";
-
- $box_style = $vars['entity']->box_style;
- if (!isset($box_style)) $box_style = "collapsable";
- ?>
- <p>
- <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>
- :
- <?php
- echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('group'); ?>
- :
- <?php
- $groups = elgg_get_entities(array("type"=>'group','limit'=>100));
- $group_list = array();
- $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups');
- if ($groups) {
- foreach ($groups as $group) {
- $group_list[$group->getGUID()] = $group->name;
- }
- }
- echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group));
- ?>
- </p>
- <?php if ($site_categories != NULL) { ?>
- <p>
- <?php echo elgg_echo('categories'); ?>
- :
- <?php
- $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories));
- echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie));
- ?>
- </p>
- <?php } ?>
- <p>
- <?php echo elgg_echo('custom_index_widgets:context_mode'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:num_items'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items));
- ?>
- </p> - <p>
- <?php echo elgg_echo('event_calendar:widget_title'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[mode]', - 'options_values'=>array('day'=>elgg_echo('event_calendar:day_label'), - 'week'=>elgg_echo('event_calendar:week_label'), - 'month'=>elgg_echo('event_calendar:month_label')), - 'value'=>$num_items));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
- 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
- 'value'=>$box_style));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
- 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
- 'value'=>$guest_only));
- ?>
- </p>
diff --git a/views/default/widgets/latest_files_index/content.php b/views/default/widgets/latest_files_index/content.php deleted file mode 100644 index b726efe70..000000000 --- a/views/default/widgets/latest_files_index/content.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - - $object_type ='file'; - - $num_items = $vars['entity']->num_items; - if (!isset($num_items)) $num_items = 10; - - $widget_group = $vars["entity"]->widget_group; - if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE; - - - $site_categories = $vars['config']->site->categories; - $widget_categorie = $vars['entity']->widget_categorie; - $widget_context_mode = $vars['entity']->widget_context_mode; - if (!isset($widget_context_mode)) $widget_context_mode = 'search'; - elgg_set_context($widget_context_mode); - - if ($site_categories == NULL || $widget_categorie == NULL) { - $widget_datas = elgg_list_entities(array( - 'type'=>'object', - 'subtype'=>$object_type, - 'container_guids' => $widget_group, - 'limit'=>$num_items, - 'full_view' => false, - 'view_type_toggle' => false, - 'pagination' => false)); -} else { - - $widget_datas = elgg_list_entities_from_metadata(array( - 'type'=>'object', - 'subtype'=>$object_type, - 'container_guids' => $widget_group, - 'limit'=>$num_items, - 'full_view' => false, - 'view_type_toggle' => false, - 'pagination' => false, - 'metadata_name' => 'universal_categories', - 'metadata_value' => $widget_categorie, - )); -} - - echo $widget_datas; -?> - diff --git a/views/default/widgets/latest_files_index/edit.php b/views/default/widgets/latest_files_index/edit.php deleted file mode 100644 index 5625eca44..000000000 --- a/views/default/widgets/latest_files_index/edit.php +++ /dev/null @@ -1,86 +0,0 @@ - <?php
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items)) $num_items = 10;
-
- $widget_group = $vars["entity"]->widget_group;
- if (!isset($widget_group)) $widget_group = 0;
-
- $site_categories = $vars['config']->site->categories;
- $widget_categorie = $vars['entity']->widget_categorie;
- $widget_context_mode = $vars['entity']->widget_context_mode;
- if (!isset($widget_context_mode)) $widget_context_mode = 'search';
-
- $widget_title = $vars['entity']->widget_title;
- $widget_group = $vars["entity"]->widget_group;
-
- $guest_only = $vars['entity']->guest_only;
- if (!isset($guest_only)) $guest_only = "no";
-
- $box_style = $vars['entity']->box_style;
- if (!isset($box_style)) $box_style = "collapsable";
- ?>
- <p>
- <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>
- :
- <?php
- echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('group'); ?>
- :
- <?php
- //$groups = elgg_get_entities(array("type"=>'group','limit'=>100));
- $groups = elgg_get_entities(array('type'=>'group'));
- $group_list = array();
- $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups');
- if ($groups) {
- foreach ($groups as $group) {
- $group_list[$group->getGUID()] = $group->name;
- }
- }
- echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group));
- ?>
- </p>
- <?php if ($site_categories != NULL) { ?>
- <p>
- <?php echo elgg_echo('categories'); ?>
- :
- <?php
- $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories));
- echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie));
- ?>
- </p>
- <?php } ?>
- <p>
- <?php echo elgg_echo('custom_index_widgets:context_mode'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:num_items'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
- 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
- 'value'=>$box_style));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
- 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
- 'value'=>$guest_only));
- ?>
- </p>
diff --git a/views/default/widgets/latest_generic_index/content.php b/views/default/widgets/latest_generic_index/content.php deleted file mode 100644 index 941b5ebeb..000000000 --- a/views/default/widgets/latest_generic_index/content.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php
-
-$object_type = $vars["entity"]->widget_subtype;
-if (!isset($object_type))
- $object_type = 'ELGG_ENTITIES_ANY_VALUE';
-
-$num_items = $vars['entity']->num_items;
-if (!isset($num_items))
- $num_items = 10;
-
-$widget_group = $vars["entity"]->widget_group;
-if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
-
-$site_categories = $vars['config']->site->categories;
-$widget_categorie = $vars['entity']->widget_categorie;
-$widget_context_mode = $vars['entity']->widget_context_mode;
-if (!isset($widget_context_mode))
- $widget_context_mode = 'search';
-elgg_set_context($widget_context_mode);
-
-if ($site_categories == NULL || $widget_categorie == NULL) {
- $widget_datas = elgg_list_entities(array(
- 'type'=>'object',
- 'subtype'=>$object_type,
- 'container_guids' => $widget_group,
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false));
-} else {
-
- $widget_datas = elgg_list_entities_from_metadata(array(
- 'type'=>'object',
- 'subtype'=>$object_type,
- 'container_guids' => $widget_group,
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false,
- 'metadata_name' => 'universal_categories',
- 'metadata_value' => $widget_categorie,
- ));
-}
-
-echo $widget_datas;
-?>
-
diff --git a/views/default/widgets/latest_generic_index/edit.php b/views/default/widgets/latest_generic_index/edit.php deleted file mode 100644 index f7584a847..000000000 --- a/views/default/widgets/latest_generic_index/edit.php +++ /dev/null @@ -1,103 +0,0 @@ - <?php - $num_items = $vars['entity']->num_items; - if (!isset($num_items)) $num_items = 10; - - $widget_group = $vars["entity"]->widget_group; - if (!isset($widget_group)) $widget_group = 0; - - $site_categories = $vars['config']->site->categories; - $widget_categorie = $vars['entity']->widget_categorie; - $widget_context_mode = $vars['entity']->widget_context_mode; - if (!isset($widget_context_mode)) $widget_context_mode = 'search'; - - $widget_title = $vars['entity']->widget_title; - $widget_group = $vars["entity"]->widget_group; - $widget_subtype = $vars["entity"]->widget_subtype; - - $guest_only = $vars['entity']->guest_only; - if (!isset($guest_only)) $guest_only = "no"; - - $box_style = $vars['entity']->box_style; - if (!isset($box_style)) $box_style = "collapsable"; - ?> - <p> - <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> - : - <?php - echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:widget_subtype'); ?> - : - <?php - - $subtypes = get_data("SELECT subtype from {$CONFIG->dbprefix}entity_subtypes"); - $subtype_list = array(); - if ($subtypes) { - foreach ($subtypes as $data) { - $subtype_list[$data->subtype] = $data->subtype; - } - } - echo elgg_view('input/dropdown', array('name'=>'params[widget_subtype]', 'options_values'=>$subtype_list, 'value'=>$widget_subtype)); - ?> - </p> - <p> - <?php echo elgg_echo('group'); ?> - : - <?php - //$groups = elgg_get_entities(array("type"=>'group','limit'=>100)); - $groups = elgg_get_entities(array('type'=>'group')); - $group_list = array(); - $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); - - if ($groups) { - foreach ($groups as $group) { - $group_list[$group->getGUID()] = $group->name; - } - } - echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); - ?> - </p> - <?php if ($site_categories != NULL) { ?> - <p> - <?php echo elgg_echo('categories'); ?> - : - <?php - $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories)); - echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie)); - ?> - </p> - <?php } ?> - <p> - <?php echo elgg_echo('custom_index_widgets:context_mode'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:num_items'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:box_style'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[box_style]', - 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), - 'value'=>$box_style)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', - 'options_values'=>array('yes'=>'yes', 'no'=>'no'), - 'value'=>$guest_only)); - ?> - </p> diff --git a/views/default/widgets/latest_groups_index/content.php b/views/default/widgets/latest_groups_index/content.php deleted file mode 100644 index 0557f874e..000000000 --- a/views/default/widgets/latest_groups_index/content.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php
-
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items)) $num_items = 10;
-
- $widget_context_mode = $vars['entity']->widget_context_mode;
- if (!isset($widget_context_mode)) $widget_context_mode = 'search';
- elgg_set_context($widget_context_mode);
-
- $widget_datas = elgg_list_entities(array(
- 'type'=>'group',
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false));
-
-
-
-echo $widget_datas;
-?>
-
diff --git a/views/default/widgets/latest_groups_index/edit.php b/views/default/widgets/latest_groups_index/edit.php deleted file mode 100644 index 71f7d6be8..000000000 --- a/views/default/widgets/latest_groups_index/edit.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items)) $num_items = 10;
-
- $widget_title = $vars['entity']->widget_title;
-
- $guest_only = $vars['entity']->guest_only;
- if (!isset($guest_only)) $guest_only = "no";
-
- $box_style = $vars['entity']->box_style;
- if (!isset($box_style)) $box_style = "collapsable";
-
-?>
-<p>
- <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>:
- <?php
- echo elgg_view('input/text', array(
- 'name' => 'params[widget_title]',
- 'value' => $widget_title
- ));
- ?>
- </p>
-<p>
-<?php echo elgg_echo('custom_index_widgets:num_items'); ?>
-
-<?php
- echo elgg_view('input/dropdown', array(
- 'name' => 'params[num_items]',
- 'options_values' => array( '1' => '1',
- '3' => '3',
- '5' => '5',
- '8' => '8',
- '10' => '10',
- '12' => '12',
- '15' => '15',
- '20' => '20',
- '30' => '30',
- '40' => '40',
- '50' => '50',
- '100' => '100',
- ),
- 'value' => $num_items
- ));
-?>
-</p>
-<p>
- <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
- 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
- 'value'=>$box_style));
- ?>
-</p>
-<p>
- <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
- 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
- 'value'=>$guest_only));
- ?>
-</p>
\ No newline at end of file diff --git a/views/default/widgets/latest_izap_videos_index/content.php b/views/default/widgets/latest_izap_videos_index/content.php deleted file mode 100644 index 22b15b37c..000000000 --- a/views/default/widgets/latest_izap_videos_index/content.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php
-$object_type = 'izap_videos';
-
-$num_items = $vars['entity']->num_items;
-if (!isset($num_items))
- $num_items = 10;
-
-$widget_group = $vars["entity"]->widget_group;
-if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
-
-$site_categories = $vars['config']->site->categories;
-$widget_categorie = $vars['entity']->widget_categorie;
-$widget_context_mode = $vars['entity']->widget_context_mode;
-if (!isset($widget_context_mode))
- $widget_context_mode = 'search';
-elgg_set_context($widget_context_mode);
-
-if ($site_categories == NULL || $widget_categorie == NULL) {
- $widget_datas = elgg_list_entities(array(
- 'type'=>'object',
- 'subtype'=>$object_type,
- 'container_guids' => $widget_group,
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false));
-} else {
-
- $widget_datas = elgg_list_entities_from_metadata(array(
- 'type'=>'object',
- 'subtype'=>$object_type,
- 'container_guids' => $widget_group,
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false,
- 'metadata_name' => 'universal_categories',
- 'metadata_value' => $widget_categorie,
- ));
-}
-?>
-<div class="contentWrapper">
- <?php
- if (isset($widget_datas)) {
- echo $widget_datas;
- }
- ?>
- <div class="clearfloat">
- </div>
-</div>
diff --git a/views/default/widgets/latest_izap_videos_index/edit.php b/views/default/widgets/latest_izap_videos_index/edit.php deleted file mode 100644 index 54c41e1a9..000000000 --- a/views/default/widgets/latest_izap_videos_index/edit.php +++ /dev/null @@ -1,86 +0,0 @@ - <?php - $num_items = $vars['entity']->num_items; - if (!isset($num_items)) $num_items = 10; - - $widget_group = $vars["entity"]->widget_group; - if (!isset($widget_group)) $widget_group = 0; - - $site_categories = $vars['config']->site->categories; - $widget_categorie = $vars['entity']->widget_categorie; - $widget_context_mode = $vars['entity']->widget_context_mode; - if (!isset($widget_context_mode)) $widget_context_mode = 'search'; - - $widget_title = $vars['entity']->widget_title; - $widget_group = $vars["entity"]->widget_group; - - $guest_only = $vars['entity']->guest_only; - if (!isset($guest_only)) $guest_only = "no"; - - $box_style = $vars['entity']->box_style; - if (!isset($box_style)) $box_style = "collapsable"; - - ?> - <p> - <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> - : - <?php - echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); - ?> - </p> - <p> - <?php echo elgg_echo('group'); ?> - : - <?php - $groups = elgg_get_entities(array("type"=>'group','limit'=>100)); - $group_list = array(); - $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); - if ($groups) { - foreach ($groups as $group) { - $group_list[$group->getGUID()] = $group->name; - } - } - echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); - ?> - </p> - <?php if ($site_categories != NULL) { ?> - <p> - <?php echo elgg_echo('categories'); ?> - : - <?php - $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories)); - echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie)); - ?> - </p> - <?php } ?> - <p> - <?php echo elgg_echo('custom_index_widgets:context_mode'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:num_items'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:box_style'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[box_style]', - 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), - 'value'=>$box_style)); - ?> -</p> -<p> - <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', - 'options_values'=>array('yes'=>'yes', 'no'=>'no'), - 'value'=>$guest_only)); - ?> -</p> diff --git a/views/default/widgets/latest_members_index/content.php b/views/default/widgets/latest_members_index/content.php deleted file mode 100644 index c4f95a77d..000000000 --- a/views/default/widgets/latest_members_index/content.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php
-
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items)) $num_items = 10;
- $display_avatar = $vars['entity']->display_avatar;
- if (!isset($display_avatar)) $display_avatar = 'yes';
-
- $widget_datas = elgg_list_entities_from_metadata(array(
- 'metadata_names' => 'icontime',
- 'types' => 'user',
- 'limit' => $num_items,
- 'full_view' => false,
- 'pagination' => false,
- 'size' => 'small',
- ));
-
-echo $widget_datas;
-?>
-
-
diff --git a/views/default/widgets/latest_members_index/edit.php b/views/default/widgets/latest_members_index/edit.php deleted file mode 100644 index 856d5ed0b..000000000 --- a/views/default/widgets/latest_members_index/edit.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items)) $num_items = 10;
-
- $display_avatar = $vars['entity']->display_avatar;
- if (!isset($display_avatar)) $display_avatar = 'yes';
-
- $widget_title = $vars['entity']->widget_title;
-
- $guest_only = $vars['entity']->guest_only;
- if (!isset($guest_only)) $guest_only = "no";
-
- $box_style = $vars['entity']->box_style;
- if (!isset($box_style)) $box_style = "collapsable";
-
-
-?>
-<p>
- <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>:
- <?php
- echo elgg_view('input/text', array(
- 'name' => 'params[widget_title]',
- 'value' => $widget_title
- ));
- ?>
-</p>
-<p>
-<?php echo elgg_echo('custom_index_widgets:num_items'); ?>
-
-<?php
- echo elgg_view('input/dropdown', array(
- 'name' => 'params[num_items]',
- 'options_values' => array(
- '7' => '7',
- '14' => '14',
- '21' => '21',
- '28' => '28',
- '35' => '35',
- '42' => '42',
- '49' => '49',
- '56' => '56',
- '100' => '100',
- ),
- 'value' => $num_items
- ));
-?>
-</p>
-<p>
-<?php echo elgg_echo('custom_index_widgets:display_avatar'); ?>
-
-<?php
- echo elgg_view('input/dropdown', array(
- 'name' => 'params[display_avatar]',
- 'options_values' => array( 'yes' => 'yes',
- 'no' => 'no',
-
- ),
- 'value' => $display_avatar
- ));
-?>
-</p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
- 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
- 'value'=>$box_style));
- ?>
-</p>
-<p>
- <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
- 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
- 'value'=>$guest_only));
- ?>
-</p>
diff --git a/views/default/widgets/latest_news_index/content.php b/views/default/widgets/latest_news_index/content.php deleted file mode 100644 index 8a10093b1..000000000 --- a/views/default/widgets/latest_news_index/content.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php
-
- $object_type ='news';
-
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items))
- $num_items = 10;
-
- $widget_group = $vars["entity"]->widget_group;
- if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
-
- $site_categories = $vars['config']->site->categories;
- $widget_categorie = $vars['entity']->widget_categorie;
- $widget_context_mode = $vars['entity']->widget_context_mode;
- if (!isset($widget_context_mode))
- $widget_context_mode = 'search';
- elgg_set_context($widget_context_mode);
-
- if ($site_categories == NULL || $widget_categorie == NULL) {
- $widget_datas = elgg_list_entities(array(
- 'type'=>'object',
- 'subtype'=>$object_type,
- 'container_guids' => $widget_group,
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false));
-} else {
-
- $widget_datas = elgg_list_entities_from_metadata(array(
- 'type'=>'object',
- 'subtype'=>$object_type,
- 'container_guids' => $widget_group,
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false,
- 'metadata_name' => 'universal_categories',
- 'metadata_value' => $widget_categorie,
- ));
-}
-
-echo $widget_datas;
-?>
-
-
-
diff --git a/views/default/widgets/latest_news_index/edit.php b/views/default/widgets/latest_news_index/edit.php deleted file mode 100644 index 063b5ddc1..000000000 --- a/views/default/widgets/latest_news_index/edit.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php - $num_items = $vars['entity']->num_items; - if (!isset($num_items)) $num_items = 10; - - $widget_group = $vars["entity"]->widget_group; - if (!isset($widget_group)) $widget_group = 0; - - $site_categories = $vars['config']->site->categories; - $widget_categorie = $vars['entity']->widget_categorie; - $widget_context_mode = $vars['entity']->widget_context_mode; - if (!isset($widget_context_mode)) $widget_context_mode = 'search'; - - $widget_title = $vars['entity']->widget_title; - $widget_group = $vars["entity"]->widget_group; - - $guest_only = $vars['entity']->guest_only; - if (!isset($guest_only)) $guest_only = "no"; - - $box_style = $vars['entity']->box_style; - if (!isset($box_style)) $box_style = "collapsable"; - ?> - <p> - <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> - : - <?php - echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); - ?> - </p> - <p> - <?php echo elgg_echo('group'); ?> - : - <?php - $groups = elgg_get_entities(array("type"=>'group','limit'=>100)); - $group_list = array(); - $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); - if ($groups) { - foreach ($groups as $group) { - $group_list[$group->getGUID()] = $group->name; - } - } - echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); - ?> - </p> - <?php if ($site_categories != NULL) { ?> - <p> - <?php echo elgg_echo('categories'); ?> - : - <?php - $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories)); - echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie)); - ?> - </p> - <?php } ?> - <p> - <?php echo elgg_echo('custom_index_widgets:context_mode'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:num_items'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:box_style'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[box_style]', - 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), - 'value'=>$box_style)); - ?> -</p> -<p> - <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', - 'options_values'=>array('yes'=>'yes', 'no'=>'no'), - 'value'=>$guest_only)); - ?> -</p> diff --git a/views/default/widgets/latest_pages_index/content.php b/views/default/widgets/latest_pages_index/content.php deleted file mode 100644 index cc8a46d55..000000000 --- a/views/default/widgets/latest_pages_index/content.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php
-
- $object_type ='page_top';
-
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items))
- $num_items = 10;
-
- $widget_group = $vars["entity"]->widget_group;
- if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
-
- $site_categories = $vars['config']->site->categories;
- $widget_categorie = $vars['entity']->widget_categorie;
- $widget_context_mode = $vars['entity']->widget_context_mode;
- if (!isset($widget_context_mode))
- $widget_context_mode = 'search';
- elgg_set_context($widget_context_mode);
-
- if ($site_categories == NULL || $widget_categorie == NULL) {
- $widget_datas = elgg_list_entities(array(
- 'type'=>'object',
- 'subtype'=>$object_type,
- 'container_guids' => $widget_group,
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false));
-} else {
-
- $widget_datas = elgg_list_entities_from_metadata(array(
- 'type'=>'object',
- 'subtype'=>$object_type,
- 'container_guids' => $widget_group,
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false,
- 'metadata_name' => 'universal_categories',
- 'metadata_value' => $widget_categorie,
- ));
-}
-
-echo $widget_datas;
-?>
-
diff --git a/views/default/widgets/latest_pages_index/edit.php b/views/default/widgets/latest_pages_index/edit.php deleted file mode 100644 index a14371b02..000000000 --- a/views/default/widgets/latest_pages_index/edit.php +++ /dev/null @@ -1,86 +0,0 @@ - <?php - $num_items = $vars['entity']->num_items; - if (!isset($num_items)) $num_items = 10; - - $widget_group = $vars["entity"]->widget_group; - if (!isset($widget_group)) $widget_group = 0; - - $site_categories = $vars['config']->site->categories; - $widget_categorie = $vars['entity']->widget_categorie; - $widget_context_mode = $vars['entity']->widget_context_mode; - if (!isset($widget_context_mode)) $widget_context_mode = 'search'; - - $widget_title = $vars['entity']->widget_title; - $widget_group = $vars["entity"]->widget_group; - - $guest_only = $vars['entity']->guest_only; - if (!isset($guest_only)) $guest_only = "no"; - - $box_style = $vars['entity']->box_style; - if (!isset($box_style)) $box_style = "collapsable"; - ?> - <p> - <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> - : - <?php - echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); - ?> - </p> - <p> - <?php echo elgg_echo('group'); ?> - : - <?php - //$groups = elgg_get_entities(array("type"=>'group','limit'=>100)); - $groups = elgg_get_entities(array('type'=>'group')); - $group_list = array(); - $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); - if ($groups) { - foreach ($groups as $group) { - $group_list[$group->getGUID()] = $group->name; - } - } - echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); - ?> - </p> - <?php if ($site_categories != NULL) { ?> - <p> - <?php echo elgg_echo('categories'); ?> - : - <?php - $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories)); - echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie)); - ?> - </p> - <?php } ?> - <p> - <?php echo elgg_echo('custom_index_widgets:context_mode'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:num_items'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:box_style'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[box_style]', - 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), - 'value'=>$box_style)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', - 'options_values'=>array('yes'=>'yes', 'no'=>'no'), - 'value'=>$guest_only)); - ?> - </p> diff --git a/views/default/widgets/latest_photos_index/content.php b/views/default/widgets/latest_photos_index/content.php deleted file mode 100644 index bb83cac40..000000000 --- a/views/default/widgets/latest_photos_index/content.php +++ /dev/null @@ -1,25 +0,0 @@ -<div class="contentWrapper"> -<?php - - $num_items = $vars['entity']->num_items; - if (!isset($num_items)) $num_items = 10; - - $widget_group = $vars["entity"]->widget_group; - if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE; - - if ($widget_group != 0){ - $album = elgg_get_entities("object", 'album', $widget_group, "", 1, 0, false); - $album_guid = $album[0]->getGUID(); - $entities = elgg_get_entities("object", "image", $album_guid, '', 999); - elgg_set_context('front'); - $widgetdatas = elgg_view_entity_list($entities); - }else{ - $widgetdatas = tp_get_latest_photos($num_items, 0); - } - - echo '<div class="icon_latest">'; - echo $widgetdatas; - echo '</div>'; - -?> -</div>
\ No newline at end of file diff --git a/views/default/widgets/latest_photos_index/edit.php b/views/default/widgets/latest_photos_index/edit.php deleted file mode 100644 index 0ef5e53a1..000000000 --- a/views/default/widgets/latest_photos_index/edit.php +++ /dev/null @@ -1,64 +0,0 @@ - <?php - $num_items = $vars['entity']->num_items; - if (!isset($num_items)) $num_items = 10; - - $widget_group = $vars["entity"]->widget_group; - if (!isset($widget_group)) $widget_group = 0; - - - $widget_title = $vars['entity']->widget_title; - $widget_group = $vars["entity"]->widget_group; - - $guest_only = $vars['entity']->guest_only; - if (!isset($guest_only)) $guest_only = "no"; - - $box_style = $vars['entity']->box_style; - if (!isset($box_style)) $box_style = "collapsable"; - ?> - <p> - <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> - : - <?php - echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); - ?> - </p> - <p> - <?php echo elgg_echo('group'); ?> - : - <?php - $groups = elgg_get_entities(array("type"=>'group','limit'=>100)); - $group_list = array(); - $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); - if ($groups) { - foreach ($groups as $group) { - $group_list[$group->getGUID()] = $group->name; - } - } - echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:num_items'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:box_style'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[box_style]', - 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), - 'value'=>$box_style)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', - 'options_values'=>array('yes'=>'yes', 'no'=>'no'), - 'value'=>$guest_only)); - ?> - </p> diff --git a/views/default/widgets/latest_tasks_index/content.php b/views/default/widgets/latest_tasks_index/content.php deleted file mode 100644 index 1f06a0db1..000000000 --- a/views/default/widgets/latest_tasks_index/content.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php
-
- $object_type ='task_top';
-
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items)) $num_items = 10;
-
- $widget_group = $vars["entity"]->widget_group;
- if (!isset($widget_group)) $widget_group = ELGG_ENTITIES_ANY_VALUE;
-
- $site_categories = $vars['config']->site->categories;
- $widget_categorie = $vars['entity']->widget_categorie;
- $widget_context_mode = $vars['entity']->widget_context_mode;
- if (!isset($widget_context_mode)) $widget_context_mode = 'search';
- elgg_set_context($widget_context_mode);
-
- if ($site_categories == NULL || $widget_categorie == NULL) {
- $widget_datas = elgg_list_entities(array(
- 'type'=>'object',
- 'subtype'=>$object_type,
- 'container_guids' => $widget_group,
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false));
-} else {
-
- $widget_datas = elgg_list_entities_from_metadata(array(
- 'type'=>'object',
- 'subtype'=>$object_type,
- 'container_guids' => $widget_group,
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false,
- 'metadata_name' => 'universal_categories',
- 'metadata_value' => $widget_categorie,
- ));
-}
-
-echo $widget_datas;
-?>
-
-
-
diff --git a/views/default/widgets/latest_tasks_index/edit.php b/views/default/widgets/latest_tasks_index/edit.php deleted file mode 100644 index c587bc184..000000000 --- a/views/default/widgets/latest_tasks_index/edit.php +++ /dev/null @@ -1,85 +0,0 @@ - <?php - $num_items = $vars['entity']->num_items; - if (!isset($num_items)) $num_items = 10; - - $widget_group = $vars["entity"]->widget_group; - if (!isset($widget_group)) $widget_group = 0; - - $site_categories = $vars['config']->site->categories; - $widget_categorie = $vars['entity']->widget_categorie; - $widget_context_mode = $vars['entity']->widget_context_mode; - if (!isset($widget_context_mode)) $widget_context_mode = 'search'; - - $widget_title = $vars['entity']->widget_title; - $widget_group = $vars["entity"]->widget_group; - - $guest_only = $vars['entity']->guest_only; - if (!isset($guest_only)) $guest_only = "no"; - - $box_style = $vars['entity']->box_style; - if (!isset($box_style)) $box_style = "collapsable"; - ?> - <p> - <?php echo elgg_echo('custom_index_widgets:widget_title'); ?> - : - <?php - echo elgg_view('input/text', array('name'=>'params[widget_title]', 'value'=>$widget_title)); - ?> - </p> - <p> - <?php echo elgg_echo('group'); ?> - : - <?php - $groups = elgg_get_entities(array("type"=>'group','limit'=>100)); - $group_list = array(); - $group_list[0] = elgg_echo('custom_index_widgets:widget_all_groups'); - if ($groups) { - foreach ($groups as $group) { - $group_list[$group->getGUID()] = $group->name; - } - } - echo elgg_view('input/dropdown', array('name'=>'params[widget_group]', 'options_values'=>$group_list, 'value'=>$widget_group)); - ?> - </p> - <?php if ($site_categories != NULL) { ?> - <p> - <?php echo elgg_echo('categories'); ?> - : - <?php - $categories_with_empty_choice = array_merge(array('-1'=>''), array_combine($site_categories, $site_categories)); - echo elgg_view('input/dropdown', array('name'=>'params[widget_categorie]', 'options_values'=>$categories_with_empty_choice, 'value'=>$widget_categorie)); - ?> - </p> - <?php } ?> - <p> - <?php echo elgg_echo('custom_index_widgets:context_mode'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[widget_context_mode]', 'options_values'=>array('search'=>elgg_echo('custom_index_widgets:context_list'), 'detail'=>elgg_echo('custom_index_widgets:context_detail')), 'value'=>$widget_context_mode)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:num_items'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[num_items]', 'options_values'=>array('1'=>'1', '3'=>'3', '5'=>'5', '8'=>'8', '10'=>'10', '12'=>'12', '15'=>'15', '20'=>'20', '30'=>'30', '40'=>'40', '50'=>'50', '100'=>'100', ), 'value'=>$num_items)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:box_style'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[box_style]', - 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'), - 'value'=>$box_style)); - ?> - </p> - <p> - <?php echo elgg_echo('custom_index_widgets:guest_only'); ?> - : - <?php - echo elgg_view('input/dropdown', array('name'=>'params[guest_only]', - 'options_values'=>array('yes'=>'yes', 'no'=>'no'), - 'value'=>$guest_only)); - ?> - </p> diff --git a/views/default/widgets/latest_wire_index/content.php b/views/default/widgets/latest_wire_index/content.php deleted file mode 100644 index 98d3b43e1..000000000 --- a/views/default/widgets/latest_wire_index/content.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items)) $num_items = 10;
- elgg_set_context('search');
-
- $widget_datas = elgg_list_entities(array(
- 'type'=>'object',
- 'subtype'=>'thewire',
- 'limit'=>$num_items,
- 'full_view' => false,
- 'view_type_toggle' => false,
- 'pagination' => false));
-
- echo $widget_datas;
-?>
-
-
diff --git a/views/default/widgets/latest_wire_index/edit.php b/views/default/widgets/latest_wire_index/edit.php deleted file mode 100644 index d08066648..000000000 --- a/views/default/widgets/latest_wire_index/edit.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php
- $num_items = $vars['entity']->num_items;
- if (!isset($num_items)) $num_items = 10;
-
- $widget_title = $vars['entity']->widget_title;
-
- $guest_only = $vars['entity']->guest_only;
- if (!isset($guest_only)) $guest_only = "no";
-
- $box_style = $vars['entity']->box_style;
- if (!isset($box_style)) $box_style = "collapsable";
-
-?>
-<p>
- <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>:
- <?php
- echo elgg_view('input/text', array(
- 'name' => 'params[widget_title]',
- 'value' => $widget_title
- ));
- ?>
- </p>
-<p>
-<?php echo elgg_echo('custom_index_widgets:num_items'); ?>
-<?php
- echo elgg_view('input/dropdown', array(
- 'name' => 'params[num_items]',
- 'options_values' => array( '1' => '1',
- '3' => '3',
- '5' => '5',
- '8' => '8',
- '10' => '10',
- '12' => '12',
- '15' => '15',
- '20' => '20',
- '30' => '30',
- '40' => '40',
- '50' => '50',
- '100' => '100',
- ),
- 'value' => $num_items
- ));
-?>
-</p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
- 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
- 'value'=>$box_style));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
- 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
- 'value'=>$guest_only));
- ?>
- </p>
diff --git a/views/default/widgets/login_index/content.php b/views/default/widgets/login_index/content.php deleted file mode 100644 index 1e82df544..000000000 --- a/views/default/widgets/login_index/content.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php
-
-if (elgg_is_logged_in()) {
- $top_box = "<h2>" . elgg_echo("welcome") . " ";
- $top_box .= elgg_get_logged_in_user_entity()->name;
- $top_box .= "</h2>";
-} else {
- $top_box = elgg_view("core/account/login_box");
-}
-
-echo $top_box;
-?>
-
-
-
diff --git a/views/default/widgets/login_index/edit.php b/views/default/widgets/login_index/edit.php deleted file mode 100644 index 149008323..000000000 --- a/views/default/widgets/login_index/edit.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php
- $widget_title = $vars['entity']->widget_title;
- - $show_welcome = $vars['entity']->show_welcome;
- if (!isset($show_welcome)) $show_welcome = "yes";
-
- $guest_only = $vars['entity']->guest_only;
- if (!isset($guest_only)) $guest_only = "no"; -?>
-<p>
- <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>:
- <?php
- echo elgg_view('input/text', array(
- 'name' => 'params[widget_title]',
- 'value' => $widget_title
- ));
- ?>
-</p>
-<p>
- <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
- 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
- 'value'=>$guest_only));
- ?>
-</p>
\ No newline at end of file diff --git a/views/default/widgets/new_users/content.php b/views/default/widgets/new_users/content.php new file mode 100644 index 000000000..ba85e7421 --- /dev/null +++ b/views/default/widgets/new_users/content.php @@ -0,0 +1,11 @@ +<?php +/** + * New users admin widget + */ + +echo elgg_list_entities(array( + 'type' => 'user', + 'subtype'=> null, + 'full_view' => false, + 'pagination' => false, +));
\ No newline at end of file diff --git a/views/default/widgets/new_users/edit.php b/views/default/widgets/new_users/edit.php new file mode 100644 index 000000000..ed07213cb --- /dev/null +++ b/views/default/widgets/new_users/edit.php @@ -0,0 +1,23 @@ +<?php +/** + * New users widget edit view + */ + + +// set default value +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 5; +} + +$params = array( + 'name' => 'params[num_display]', + 'value' => $vars['entity']->num_display, + 'options' => array(5, 8, 10, 12, 15, 20), +); +$dropdown = elgg_view('input/dropdown', $params); + +?> +<p> + <?php echo elgg_echo('widget:numbertodisplay'); ?>: + <?php echo $dropdown; ?> +</p> diff --git a/views/default/widgets/online_users/content.php b/views/default/widgets/online_users/content.php new file mode 100644 index 000000000..6e0cc7abb --- /dev/null +++ b/views/default/widgets/online_users/content.php @@ -0,0 +1,15 @@ +<?php +/** + * Online users widget + */ + +$count = find_active_users(600, 10, 0, true); +$objects = find_active_users(600, 10); + +if ($objects) { + echo elgg_view_entity_list($objects, array( + 'count' => $count, + 'limit' => 10, + 'pagination' => false, + )); +} diff --git a/views/default/widgets/online_users/edit.php b/views/default/widgets/online_users/edit.php new file mode 100644 index 000000000..66f03a745 --- /dev/null +++ b/views/default/widgets/online_users/edit.php @@ -0,0 +1,22 @@ +<?php +/** + * Online users widget edit view + */ + +// set default value +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 8; +} + +$params = array( + 'name' => 'params[num_display]', + 'value' => $vars['entity']->num_display, + 'options' => array(5, 8, 10, 12, 15, 20), +); +$dropdown = elgg_view('input/dropdown', $params); + +?> +<p> + <?php echo elgg_echo('widget:numbertodisplay'); ?>: + <?php echo $dropdown; ?> +</p> diff --git a/views/default/widgets/rich_media_index/content.php b/views/default/widgets/rich_media_index/content.php deleted file mode 100644 index dddc32bd7..000000000 --- a/views/default/widgets/rich_media_index/content.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php
-
- $widget_video_width = $vars['entity']->widget_video_width;
- $widget_video_height = $vars['entity']->widget_video_height;
- $widget_video_url = $vars['entity']->widget_video_url;
- $widget_video_caption = $vars['entity']->widget_video_caption;
-
- if (!isset($widget_video_width)){
- $widget_video_width = '250';
- }
- if (!isset($widget_video_height)){
- $widget_video_height = '250';
- }
-
-?>
-
-<div class="contentWrapper" align="center">
- <a id="media<?php echo $vars['entity']->getGUID();?>" class="media" href="<?php echo $widget_video_url;?>"><?php echo $widget_video_title;?></a> <div class="clearfloat">
- </div>
-</div>
-<?php if (isset($widget_video_url)) { ?>
-<script type="text/javascript">
- jQuery(document).ready(function($){
- $('#media<?php echo $vars['entity']->getGUID();?>').media({width:<?php echo $widget_video_width;?>, height:<?php echo $widget_video_height;?>, autoplay: true});
- });
-</script>
-<?php } ?>
\ No newline at end of file diff --git a/views/default/widgets/rich_media_index/edit.php b/views/default/widgets/rich_media_index/edit.php deleted file mode 100644 index a3956159c..000000000 --- a/views/default/widgets/rich_media_index/edit.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php
- $widget_title = $vars['entity']->widget_title;
- $widget_video_width = $vars['entity']->widget_video_width;
- $widget_video_height = $vars['entity']->widget_video_height;
- $widget_video_url = $vars['entity']->widget_video_url;
- $widget_video_title = $vars['entity']->widget_video_title;
-
- $guest_only = $vars['entity']->guest_only;
- if (!isset($guest_only)) $guest_only = "no";
-
- $box_style = $vars['entity']->box_style;
- if (!isset($box_style)) $box_style = "collapsable";
-
-?>
-<p>
- <?php echo elgg_echo('custom_index_widgets:widget_title'); ?>:
- <?php
- echo elgg_view('input/text', array(
- 'name' => 'params[widget_title]',
- 'value' => $widget_title
- ));
- ?>
-</p>
-<p>
-<?php echo elgg_echo('custom_index_widgets:widget_video_caption'); ?>
-<?php
- echo elgg_view('input/text', array(
- 'name' => 'params[widget_video_caption]',
- 'value' => $widget_video_caption
- ));
- ?>
-</p>
-<p>
-<?php echo elgg_echo('custom_index_widgets:widget_video_url'); ?>
-<?php
- echo elgg_view('input/text', array(
- 'name' => 'params[widget_video_url]',
- 'value' => $widget_video_url
- ));
- ?>
-</p>
-<p>
-<?php echo elgg_echo('custom_index_widgets:widget_video_width'); ?>
-<?php
- echo elgg_view('input/text', array(
- 'name' => 'params[widget_video_width]',
- 'value' => $widget_video_width
- ));
- ?>
-</p>
-<p>
-<?php echo elgg_echo('custom_index_widgets:widget_video_height'); ?>
-<?php
- echo elgg_view('input/text', array(
- 'name' => 'params[widget_video_height]',
- 'value' => $widget_video_height
- ));
- ?>
-</p>
-<p>
- <?php echo elgg_echo('custom_index_widgets:box_style'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[box_style]',
- 'options_values'=>array('plain'=>'Plain', 'plain collapsable'=>'Plain and collapsable', 'collapsable'=>'Collapsable', 'standard' => 'No Collapsable'),
- 'value'=>$box_style));
- ?>
- </p>
- <p>
- <?php echo elgg_echo('custom_index_widgets:guest_only'); ?>
- :
- <?php
- echo elgg_view('input/dropdown', array('name'=>'params[guest_only]',
- 'options_values'=>array('yes'=>'yes', 'no'=>'no'),
- 'value'=>$guest_only));
- ?>
- </p>
-
diff --git a/views/default/widgets/river_widget/content.php b/views/default/widgets/river_widget/content.php new file mode 100644 index 000000000..867fc9db6 --- /dev/null +++ b/views/default/widgets/river_widget/content.php @@ -0,0 +1,27 @@ +<?php +/** + * Activity widget content view + */ + +$num = (int) $vars['entity']->num_display; + +$options = array( + 'limit' => $num, + 'pagination' => false, +); + +if (elgg_in_context('dashboard')) { + if ($vars['entity']->content_type == 'friends') { + $options['relationship_guid'] = elgg_get_page_owner_guid(); + $options['relationship'] = 'friend'; + } +} else { + $options['subject_guid'] = elgg_get_page_owner_guid(); +} + +$content = elgg_list_river($options); +if (!$content) { + $content = elgg_echo('river:none'); +} + +echo $content; diff --git a/views/default/widgets/river_widget/edit.php b/views/default/widgets/river_widget/edit.php new file mode 100644 index 000000000..228212e47 --- /dev/null +++ b/views/default/widgets/river_widget/edit.php @@ -0,0 +1,58 @@ +<?php +/** + * Edit settings for river widget + */ + +// dashboard widget has type parameter +if (elgg_in_context('dashboard')) { + if (!isset($vars['entity']->content_type)) { + $vars['entity']->content_type = 'friends'; + } + $params = array( + 'name' => 'params[content_type]', + 'value' => $vars['entity']->content_type, + 'options_values' => array( + 'friends' => elgg_echo('river:widgets:friends'), + 'all' => elgg_echo('river:widgets:all'), + ), + ); + $type_dropdown = elgg_view('input/dropdown', $params); + ?> + <div> + <?php echo elgg_echo('river:widget:type'); ?>: + <?php echo $type_dropdown; ?> + </div> + <?php +} + + +// set default value for number to display +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 8; +} + +$params = array( + 'name' => 'params[num_display]', + 'value' => $vars['entity']->num_display, + 'options' => array(5, 8, 10, 12, 15, 20), +); +$num_dropdown = elgg_view('input/dropdown', $params); + +?> +<div> + <?php echo elgg_echo('widget:numbertodisplay'); ?>: + <?php echo $num_dropdown; ?> +</div> + +<?php +// pass the context so we have the correct output upon save. +if (elgg_in_context('dashboard')) { + $context = 'dashboard'; +} else { + $context = 'profile'; +} + +echo elgg_view('input/hidden', array( + 'name' => 'context', + 'value' => $context +));
\ No newline at end of file |