Esempio n. 1
0
     if (!$is_doc) {
         $url = "@document_by_id_lang?module={$module}&id={$doc_id}" . '&lang=' . $doc['culture'];
     }
 }
 echo $is_doc ? '<span class="current">' . $name . '</span>' : link_to($name, $url);
 // elevation info
 if (isset($doc['lowest_elevation']) && is_scalar($doc['lowest_elevation']) && $doc['lowest_elevation'] != $doc['elevation']) {
     echo '&nbsp; ' . $doc['lowest_elevation'] . __('meters') . __('range separator') . $doc['elevation'] . __('meters');
 } else {
     if (isset($doc['elevation']) && is_scalar($doc['elevation'])) {
         echo '&nbsp; ' . $doc['elevation'] . __('meters');
     }
 }
 // public transportation info
 if (isset($doc['public_transportation_types'])) {
     echo field_pt_picto_if_set($doc, true, ' - ', '', false);
 }
 if ($has_route_list_link) {
     $param1 = "{$module}={$doc_id}";
     if ($route_list_linked) {
         $url = $base_url . $param1 . '&' . $param2;
     } else {
         $url = $base_url . $param2 . '&' . $param1;
     }
     echo ' ' . link_to($link_text, $url, array('title' => __($title), 'class' => 'hide', 'rel' => 'nofollow'));
 }
 // display tools for manipulating associations if user is moderator and displayed doc
 // is directly linked to current doc
 if ($show_link_to_delete && isset($doc['directly_linked'])) {
     $tips = isset($doc['ghost_id']) && isset($ghost_module) ? 'Delete the association with this ' . $module : null;
     echo c2c_link_to_delete_element($type, $revert_ids ? $id : $doc_id, $revert_ids ? $doc_id : $id, false, (int) $strict, null, 'indicator', $tips);
Esempio n. 2
0
        $data_temp = field_data_if_set($document, 'lowest_elevation', array('suffix' => 'meters'));
        if (!empty($data_temp)) {
            $data[] = $data_temp;
        }
    }
    $data_temp = field_data_from_list_if_set($document, 'snow_clearance_rating', 'mod_parkings_snow_clearance_ratings_list', array('raw' => true));
    if (!empty($data_temp)) {
        $data[] = $data_temp;
    }
    $data = implode(' - ', $data);
    if (!empty($data)) {
        $data_list[] = $data;
    }
}
$data = field_data_from_list_if_set($document, 'public_transportation_rating', 'app_parkings_public_transportation_ratings', array('title' => __('public_transportation_rating short')));
$data .= field_pt_picto_if_set($document, true, ' - ');
if (!empty($data)) {
    $data_list[] = $data;
}
$description = $document->getRaw('public_transportation_description');
if (!empty($description)) {
    $description = truncate_description($description, $route);
} else {
    $description = '';
}
$image = make_thumbnail_slideshow($associated_images);
if (!$raw && $image) {
    echo insert_popup_js();
}
if (!empty($data_list) || $description || $image) {
    $class = 'popup_desc';
Esempio n. 3
0
<?php

use_helper('Field');
$html = array();
foreach ($parkings as $parking) {
    $name = ucfirst($parking['ParkingI18n'][0]['name']);
    $culture = $parking['ParkingI18n'][0]['culture'];
    $url = '@document_by_id_lang_slug?module=parkings&id=' . $parking['id'] . '&lang=' . $culture . '&slug=' . make_slug($parking['ParkingI18n'][0]['name']);
    $link = link_to($name, $url, array('hreflang' => $culture));
    if (isset($parking['lowest_elevation']) && is_scalar($parking['lowest_elevation']) && $parking['lowest_elevation'] != $parking['elevation']) {
        $link .= '&nbsp; ' . $parking['lowest_elevation'] . __('meters') . __('range separator') . $parking['elevation'] . __('meters');
    } else {
        if (isset($parking['elevation']) && is_scalar($parking['elevation'])) {
            $link .= '&nbsp; ' . $parking['elevation'] . __('meters');
        }
    }
    if (isset($parking['public_transportation_types'])) {
        $link .= field_pt_picto_if_set($parking, true, ' - ');
    }
    $html[] = $link;
}
echo implode('<br />', $html);
?>
<div><?php 
echo list_link($item_i18n, 'parkings');
?>
</div>
<div><?php 
$snow_clearance_rating = $item['snow_clearance_rating'];
$elevation_field = '';
if (isset($item['lowest_elevation']) && is_scalar($item['lowest_elevation']) && $item['lowest_elevation'] != $item['elevation'] && $snow_clearance_rating != 4) {
    $elevation_field = $item['lowest_elevation'] . __('meters') . __('range separator') . $item['elevation'] . __('meters');
} else {
    if (isset($item['elevation']) && is_scalar($item['elevation'])) {
        $elevation_field = $item['elevation'] . __('meters');
    }
}
$snow_field = '';
if (is_int($snow_clearance_rating) && $snow_clearance_rating != 4) {
    $snow_field = get_paginated_value($item['snow_clearance_rating'], 'mod_parkings_snow_clearance_ratings_list');
}
echo _implode(' - ', array($elevation_field, field_pt_picto_if_set($item, true) . ' ' . get_paginated_value($item['public_transportation_rating'], 'app_parkings_public_transportation_ratings'), $snow_field));
?>
</div>
<div><?php 
include_partial('documents/regions4list', array('geoassociations' => $item['geoassociations']));
?>
</div>
<div><?php 
echo picto_tag('picto_images', __('nb_linked_images')), ' ', isset($item['nb_images']) ? $item['nb_images'] : '0', ' ', picto_tag('action_comment', __('nb_comments')), ' ', isset($item['nb_comments']) ? link_to($item['nb_comments'], '@document_comment?module=parkings&id=' . $item_i18n['id'] . '&lang=' . $item_i18n['culture']) : '0', ' ', picto_tag('picto_routes', __('nb_routes')), ' ', isset($item['nb_linked_docs']) ? $item['nb_linked_docs'] : '0';
?>
</div>
Esempio n. 5
0
echo microdata_meta('name', $document->getName());
if (isset($nb_comments) && $nb_comments) {
    echo microdata_meta('interactionCount', $nb_comments . ' UserComments');
    echo microdata_meta('discussionUrl', url_for('@document_comment?module=images&id=' . $sf_params->get('id') . '&lang=' . $sf_params->get('lang')));
}
?>
<ul id="article_gauche_5050" class="data">
    <?php 
disp_doc_type('parking');
if (check_not_empty_doc($document, 'elevation') || check_not_empty_doc($document, 'lon')) {
    echo '<li><ul itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">';
    li(field_data($document, 'elevation', array('suffix' => 'meters', 'microdata' => 'elevation')));
    if ($document->get('lowest_elevation') != $document->get('elevation') && $document->get('snow_clearance_rating') && $document->get('snow_clearance_rating') != 4) {
        li(field_data($document, 'lowest_elevation', array('suffix' => 'meters')));
    }
    li(field_coord_data_if_set($document, 'lon', array('microdata' => 'longitude')));
    li(field_coord_data_if_set($document, 'lat', array('microdata' => 'latitude')));
    li(field_swiss_coords($document));
    echo '</ul></li>';
}
li(field_data_from_list($document, 'public_transportation_rating', 'app_parkings_public_transportation_ratings'));
li(field_pt_picto_if_set($document));
if ($document->get('snow_clearance_rating') != 4) {
    li(field_data_from_list($document, 'snow_clearance_rating', 'mod_parkings_snow_clearance_ratings_list'));
}
if ($document->get('geom_wkt')) {
    li(field_export($document->get('module'), $sf_params->get('id'), $sf_params->get('lang'), $sf_params->get('version')), array('class' => 'separator'));
}
?>
</ul>
Esempio n. 6
0
$snow_clearance_rating = $item['snow_clearance_rating'];
if (isset($item['lowest_elevation']) && is_scalar($item['lowest_elevation']) && $item['lowest_elevation'] != $item['elevation'] && $snow_clearance_rating != 4) {
    echo $item['lowest_elevation'] . __('meters') . __('range separator') . $item['elevation'] . __('meters');
} else {
    if (isset($item['elevation']) && is_scalar($item['elevation'])) {
        echo $item['elevation'] . __('meters');
    }
}
?>
</td>
<td><?php 
echo get_paginated_value($item['public_transportation_rating'], 'app_parkings_public_transportation_ratings');
?>
</td>
<td><?php 
echo field_pt_picto_if_set($item, true);
?>
</td>
<td><?php 
if (is_int($snow_clearance_rating) && $snow_clearance_rating != 4) {
    echo get_paginated_value($item['snow_clearance_rating'], 'mod_parkings_snow_clearance_ratings_list');
}
?>
</td>
<td><?php 
include_partial('documents/regions4list', array('geoassociations' => $item['geoassociations']));
?>
</td>
<td><?php 
echo isset($item['nb_images']) ? $item['nb_images'] : '';
?>