/**
 * Displays a list of user objects of a particular subtype, with navigation.
 *
 * @see elgg_view_entity_list
 *
 * @param int    $user_guid      The GUID of the user
 * @param string $subtype        The object subtype
 * @param int    $limit          The number of entities to display on a page
 * @param bool   $fullview       Whether or not to display the full view (default: true)
 * @param bool   $listtypetoggle Whether or not to allow gallery view (default: true)
 * @param bool   $pagination     Whether to display pagination (default: true)
 * @param int    $timelower      The earliest time the entity can have been created. Default: all
 * @param int    $timeupper      The latest time the entity can have been created. Default: all
 *
 * @return string The list in a form suitable to display
 * @deprecated 1.8 Use elgg_list_entities() instead
 */
function list_user_objects($user_guid, $subtype = ELGG_ENTITIES_ANY_VALUE, $limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true, $timelower = 0, $timeupper = 0)
{
    elgg_deprecated_notice("list_user_objects() was deprecated in favor of elgg_list_entities()", 1.8);
    $offset = (int) get_input('offset');
    $limit = (int) $limit;
    $count = (int) count_user_objects($user_guid, $subtype, $timelower, $timeupper);
    $entities = get_user_objects($user_guid, $subtype, $limit, $offset, $timelower, $timeupper);
    return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $listtypetoggle, $pagination);
}
Beispiel #2
0
<?php

/**
 * Widget content
 */
//the page owner
$owner = $vars['entity']->owner_guid;
$owner_entity = get_entity($owner);
//the number of files to display
$number = (int) $vars['entity']->num_display;
if (!$number) {
    $number = 4;
}
//get the user's plugin projects
$plugins = get_user_objects($vars['entity']->owner_guid, "plugin_project", $number, 0);
if ($plugins) {
    echo "<div id=\"pluginsrepo_widget_layout\">";
    //display in list mode
    $context = get_context();
    set_context('widget');
    foreach ($plugins as $plugin) {
        echo elgg_view_entity($plugin);
    }
    set_context($context);
    //get a link to the user's plugins
    $users_file_url = $vars['url'] . "pg/plugins/developer/" . $owner_entity->username;
    echo "<div class=\"pluginsrepo_widget_singleitem_more\"><a href=\"{$users_file_url}\">" . elgg_echo('plugins:more') . "</a></div>";
    echo "</div>";
} else {
    echo "<div class=\"contentWrapper\">" . elgg_echo("plugins:none") . "</div>";
}
 /**
  * Get an array of ElggObjects owned by this user.
  *
  * @param string $subtype The subtype of the objects, if any
  * @param int $limit Number of results to return
  * @param int $offset Any indexing offset
  */
 public function getObjects($subtype = "", $limit = 10, $offset = 0)
 {
     return get_user_objects($this->getGUID(), $subtype, $limit, $offset);
 }
//the page owner
$owner = $vars['entity']->owner_guid;
//the number of files to display
$number = (int) $vars['entity']->num_display;
if (!$number) {
    $number = 1;
}
//get the layout view which is set by the user in the edit panel
$get_view = (int) $vars['entity']->gallery_list;
if (!$get_view || $get_view == 1) {
    $view = "list";
} else {
    $view = "gallery";
}
//get the user's files
$files = get_user_objects($vars['entity']->owner_guid, "file", $number, 0);
//if there are some files, go get them
if ($files) {
    echo "<div id=\"filerepo_widget_layout\">";
    if ($view == "gallery") {
        echo "<div class=\"filerepo_widget_galleryview\">";
        //display in gallery mode
        foreach ($files as $f) {
            $mime = $f->mimetype;
            echo "<a href=\"{$f->getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $f->thumbnail, 'file_guid' => $f->guid)) . "</a>";
        }
        echo "</div>";
    } else {
        //display in list mode
        foreach ($files as $f) {
            $mime = $f->mimetype;