Example #1
0
$owner_link = elgg_view('output/url', array('href' => "sharemaps/owner/{$owner->username}", 'text' => $owner->name, 'is_trusted' => true));
$author_text = elgg_echo('byline', array($owner_link));
$owner_icon = elgg_view_entity_icon($owner, 'small');
$date = elgg_view_friendly_time($entity->time_created);
$comments_count = $entity->countComments();
//only display if there are commments
if ($comments_count != 0) {
    $text = elgg_echo("comments") . " ({$comments_count})";
    $comments_link = elgg_view('output/url', array('href' => $entity->getURL() . '#comments', 'text' => $text, 'is_trusted' => true));
} else {
    $comments_link = '';
}
$metadata = elgg_view_menu('entity', array('entity' => $vars['entity'], 'handler' => 'sharemaps/drawmap', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
$subtitle = "{$author_text} {$date} {$comments_link}";
//Read map width and height from settings
$vars['map_width'] = sharemaps_get_map_width();
$vars['map_height'] = sharemaps_get_map_height();
// do not show the metadata and controls in widget view
if (elgg_in_context('widgets')) {
    $metadata = '';
}
if ($full && !elgg_in_context('gallery')) {
    $params = array('entity' => $entity, 'metadata' => $metadata, 'subtitle' => $subtitle);
    $params = $params + $vars;
    $summary = elgg_view('object/elements/summary', $params);
    if (sharemaps_display_map_before_description()) {
        $text = elgg_view('sharemaps/map_draw_box', $vars);
        $text .= elgg_view('output/longtext', array('value' => $entity->description));
    } else {
        $text = elgg_view('output/longtext', array('value' => $entity->description));
        $text .= elgg_view('sharemaps/map_draw_box', $vars);
Example #2
0
if ($comments_count != 0) {
    $text = elgg_echo("comments") . " ({$comments_count})";
    $comments_link = elgg_view('output/url', array('href' => $sharemaps->getURL() . '#comments', 'text' => $text, 'is_trusted' => true));
} else {
    $comments_link = '';
}
$metadata = elgg_view_menu('entity', array('entity' => $vars['entity'], 'handler' => 'sharemaps', 'sort_by' => 'priority', 'class' => 'elgg-menu-hz'));
$subtitle = "{$author_text} {$date} {$comments_link}";
// do not show the metadata and controls in widget view
if (elgg_in_context('widgets')) {
    $metadata = '';
}
if ($full && !elgg_in_context('gallery')) {
    /************************ map start ************************/
    //Read map width and height from settings
    $map_width = sharemaps_get_map_width();
    $map_height = sharemaps_get_map_height();
    $mapbox = '';
    if (empty($sharemaps->originalfilename)) {
        // in case of gmap link
        if (!empty($sharemaps->gmaplink)) {
            $mapbox .= '<br />';
            $mapbox .= '<div>';
            $mapbox .= '<iframe style="border:1px solid #eee;" width="' . $map_width . '" height="' . $map_height . '" scrolling="no" marginheight="0" marginwidth="0" src="' . $sharemaps->gmaplink . '&amp;output=embed"></iframe>';
            $mapbox .= '</div>';
        }
    } else {
        // kml or kmz or gpx file
        $mapfile = $sharemaps->getFilenameOnFilestore();
        $gpxfile = true;
        // by default we set that it is gpx file