diff options
Diffstat (limited to 'mod/file/views/default/widgets/filerepo')
-rw-r--r-- | mod/file/views/default/widgets/filerepo/content.php | 33 | ||||
-rw-r--r-- | mod/file/views/default/widgets/filerepo/edit.php | 25 |
2 files changed, 58 insertions, 0 deletions
diff --git a/mod/file/views/default/widgets/filerepo/content.php b/mod/file/views/default/widgets/filerepo/content.php new file mode 100644 index 000000000..f3e152de3 --- /dev/null +++ b/mod/file/views/default/widgets/filerepo/content.php @@ -0,0 +1,33 @@ +<?php +/** + * Elgg file widget view + * + * @package ElggFile + */ + + +$num = $vars['entity']->num_display; + +$options = array( + 'type' => 'object', + 'subtype' => 'file', + 'container_guid' => $vars['entity']->owner_guid, + 'limit' => $num, + 'full_view' => FALSE, + 'pagination' => FALSE, +); +$content = elgg_list_entities($options); + +echo $content; + +if ($content) { + $url = "file/owner/" . elgg_get_page_owner_entity()->username; + $more_link = elgg_view('output/url', array( + 'href' => $url, + 'text' => elgg_echo('file:more'), + 'is_trusted' => true, + )); + echo "<span class=\"elgg-widget-more\">$more_link</span>"; +} else { + echo elgg_echo('file:none'); +} diff --git a/mod/file/views/default/widgets/filerepo/edit.php b/mod/file/views/default/widgets/filerepo/edit.php new file mode 100644 index 000000000..cab35b6ef --- /dev/null +++ b/mod/file/views/default/widgets/filerepo/edit.php @@ -0,0 +1,25 @@ +<?php +/** + * Elgg file widget edit view + * + * @package ElggFile + */ + + +// set default value +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 4; +} + +$params = array( + 'name' => 'params[num_display]', + 'value' => $vars['entity']->num_display, + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20), +); +$dropdown = elgg_view('input/dropdown', $params); + +?> +<div> + <?php echo elgg_echo('file:num_files'); ?>: + <?php echo $dropdown; ?> +</div> |