Beispiel #1
0
/**
 * Custom URL handler for thewire objects
 *
 * @param ElggEntity $entity the entity to make the URL for
 *
 * @return string the URL
 */
function thewire_tools_url_handler(ElggEntity $entity)
{
    if ($entity->getContainerEntity() instanceof ElggGroup) {
        $entity_url = elgg_get_site_url() . "thewire/group/" . $entity->getContainer();
    } else {
        $entity_url = elgg_get_site_url() . "thewire/owner/" . $entity->getOwnerEntity()->username;
    }
    return $entity_url;
}