Beispiel #1
0
<?php

use_helper('Field');
echo field_text_data_if_set($document, 'description', null, array('needs_translation' => $needs_translation, 'images' => $images, 'show_label' => false));
Beispiel #2
0
    $gear_inserted_text = '<ul class="text big_tips">' . implode('', $backpack_content_links) . "</ul>\n";
} else {
    $gear_inserted_text = '';
}
echo field_text_data_if_set($document, 'description', null, array('needs_translation' => $needs_translation, 'images' => $images, 'show_label' => false));
$remarks = field_text_data_if_set($document, 'remarks', null, array('needs_translation' => $needs_translation, 'show_images' => false));
$gear = field_text_data_if_set($document, 'gear', null, array('needs_translation' => $needs_translation, 'show_images' => false, 'inserted_text' => $gear_inserted_text));
if (!empty($remarks) || !empty($gear)) {
    echo '<div class="clearer"></div>';
    echo '<div class="col_left col_66">';
    if (!empty($remarks)) {
        echo $remarks;
    } else {
        echo $gear;
    }
    echo '</div>';
    if (!empty($remarks) && !empty($gear)) {
        echo '<div class="col_right col_33">';
        echo $gear;
        echo '</div>';
    }
    echo '<div class="clearer"></div>';
}
$inserted_text = '';
if (isset($associated_books) && count($associated_books)) {
    $main_id = isset($main_id) ? $main_id : null;
    $inserted_text = format_book_data($associated_books, 'br', $main_id, $sf_user->hasCredential('moderator'));
}
echo field_text_data_if_set($document, 'external_resources', null, array('needs_translation' => $needs_translation, 'inserted_text' => $inserted_text, 'images' => $images));
echo field_text_data_if_set($document, 'route_history', null, array('needs_translation' => $needs_translation, 'images' => $images));
Beispiel #3
0
<?php

use_helper('Field');
$activities = $document->getRaw('activities');
if (isset($preview) && $preview) {
    $participants = field_text_data_if_set($document, 'participants', null, array('show_images' => false));
    //
    if (!empty($participants)) {
        echo '<div class="all_associations col_left col_66">' . $participants . '</div>';
    }
}
// put here meta tags for microdata that cannot be inside ul tags
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=outings&id=' . $sf_params->get('id') . '&lang=' . $sf_params->get('lang')));
}
?>
<ul class="data col_left col_33">
    <?php 
li(field_activities_data($document));
li(field_bool_data($document, 'partial_trip', array('show_only_yes' => true)));
li(field_data_range_if_set($document, 'min_elevation', 'max_elevation', array('separator' => 'elevation separator', 'suffix' => 'meters')));
li(field_data_range_if_set($document, 'height_diff_up', 'height_diff_down', array('separator' => 'height diff separator', 'prefix_min' => '+', 'prefix_max' => '-', 'suffix' => 'meters', 'range_only' => true)));
li(field_data_if_set($document, 'outing_length', array('suffix' => 'kilometers')));
if ($document->get('geom_wkt')) {
    li(field_export($document->get('module'), $sf_params->get('id'), $sf_params->get('lang'), $sf_params->get('version')));
}
li(field_bool_data($document, 'outing_with_public_transportation', array('show_only_yes' => true)));
$access_elevation = field_data_if_set($document, 'access_elevation', array('suffix' => 'meters'));
if (empty($access_elevation)) {
Beispiel #4
0
<?php

use_helper('Field');
$id = $document->get('id');
echo field_text_data($document, 'description', 'road access', array('needs_translation' => $needs_translation, 'images' => $images, 'class' => 'hfirst'));
if ($document->get('geom_wkt')) {
    echo field_getdirections($id);
}
$has_pt_access = $document->get('public_transportation_rating') != 3;
if ($has_pt_access) {
    echo field_text_data($document, 'public_transportation_description', null, array('needs_translation' => $needs_translation, 'images' => $images));
    if ($sf_params->get('action') != 'preview') {
        $link_text = __('outings using PT from this access point');
        $url = "outings/list?parkings={$ids}&owtp=yes&orderby=date&order=desc";
        echo '<p class="big_tips">' . link_to($link_text, $url, array('rel' => 'nofollow')) . "</p>\n";
    }
} else {
    echo field_text_data_if_set($document, 'public_transportation_description', null, array('needs_translation' => $needs_translation, 'images' => $images));
}
echo field_text_data_if_set($document, 'snow_clearance_comment', null, array('needs_translation' => $needs_translation, 'images' => $images));
echo field_text_data_if_set($document, 'accommodation', null, array('needs_translation' => $needs_translation, 'images' => $images));
Beispiel #5
0
<?php

use_helper('Field');
$id = $sf_params->get('id');
$is_connected = $sf_user->isConnected();
$is_not_archive = !$document->isArchive();
$is_not_merged = !$document->get('redirects_to');
$mobile_version = c2cTools::mobileVersion();
$is_gite_camping = $document->get('shelter_type') == 5 || $document->get('shelter_type') == 6;
$show_link_tool = !$is_gite_camping && $is_not_archive && $is_not_merged && $is_connected && !$mobile_version;
if ($is_gite_camping) {
    $access_label = 'access';
} else {
    $access_label = null;
}
echo field_text_data_if_set($document, 'staffed_period', null, array('needs_translation' => $needs_translation, 'images' => $images));
echo field_text_data_if_set($document, 'description', null, array('needs_translation' => $needs_translation, 'images' => $images));
if (count($associated_routes)) {
    echo field_text_data($document, 'pedestrian_access', $access_label, array('needs_translation' => $needs_translation, 'images' => $images));
    include_partial('routes/linked_routes', array('associated_routes' => $associated_routes, 'document' => $document, 'id' => $id, 'module' => 'huts', 'type' => '', 'strict' => true, 'show_list_link' => false));
} else {
    echo field_text_data_if_set($document, 'pedestrian_access', $access_label, array('needs_translation' => $needs_translation, 'images' => $images));
}
if ($show_link_tool) {
    echo '<div class="add_content">' . link_to(picto_tag('picto_add', __('Associate new access')) . __('Associate new access'), "@hut_addroute?document_id={$id}") . '</div>';
}
Beispiel #6
0
            $conditions_string = '<div class="field_value"' . $lang . '>' . $conditions_string . '</div>';
        }
        $conditions_string = $outing_route_desc_string . $conditions_title . $conditions_levels_string . '</div>' . '<div class="col_left col_66">' . $conditions_string . $avalanche_string . '</div>' . $other_conditions;
    } else {
        $conditions_string = '<div class="col_left col_66 hfirst">' . $outing_route_desc_string . $conditions_title . $conditions_string . '</div>' . $avalanche_string . $other_conditions . '</div>';
    }
    echo $conditions_string;
} elseif (!empty($other_conditions)) {
    echo $other_conditions;
}
$col_weather_or_timing = $has_weather_or_timing && ($has_conditions || !$has_conditions_levels && !empty($other_conditions) && $has_access_or_hut || $has_access_or_hut);
if ($has_weather_or_timing) {
    if ($col_weather_or_timing) {
        $class = 'col_right col_33 hfirst';
    } else {
        $class = 'col_left';
    }
    echo '<div class="' . $class . '">';
    echo field_text_data_if_set($document, 'weather', null, array('needs_translation' => $needs_translation, 'show_images' => false));
    echo field_text_data_if_set($document, 'timing', null, array('needs_translation' => $needs_translation, 'show_images' => false));
    echo '</div>';
}
if ($has_access_or_hut) {
    echo '<div class="col_left col_66">';
    echo field_text_data_if_set($document, 'access_comments', null, array('needs_translation' => $needs_translation, 'images' => $images, 'filter_image_type' => false));
    echo field_text_data_if_set($document, 'hut_comments', null, array('needs_translation' => $needs_translation, 'images' => $images, 'filter_image_type' => false));
    echo '</div>';
}
echo '<div class="clearer"></div>';
echo field_text_data_if_set($document, 'description', 'comments', array('needs_translation' => $needs_translation, 'images' => $images, 'filter_image_type' => false));
} else {
    $participants_0 = '';
}
if (isset($participants[1])) {
    $participants_1 = _format_text_data('participants', $participants[1], null, array('needs_translation' => $needs_translation, 'show_label' => $document->isArchive(), 'show_images' => false));
} else {
    $participants_1 = '';
}
echo '<div class="all_associations col_left col_66">';
if ($is_not_archive && $is_not_merged) {
    include_partial('documents/association', array('associated_docs' => $associated_users, 'extra_docs' => array($participants_1), 'module' => 'users', 'document' => $document, 'inline' => true, 'merge_inline' => $participants_0, 'show_link_to_delete' => $show_link_to_delete, 'type' => 'uo', 'strict' => true));
    include_partial('routes/association', array('associated_docs' => $associated_routes, 'module' => 'routes', 'document' => $document, 'show_link_to_delete' => $show_link_to_delete, 'type' => 'ro', 'strict' => true, 'display_info' => true));
    include_partial('documents/association', array('associated_docs' => $associated_sites, 'module' => 'sites', 'document' => $document, 'show_link_to_delete' => $show_link_to_delete, 'type' => 'to', 'strict' => false));
    // no strict looking for main_id in column main of Association table
} else {
    echo field_text_data_if_set($document, 'participants', null, array('needs_translation' => $needs_translation, 'show_images' => false));
}
echo '</div>';
if ($is_not_archive) {
    // if the user is not a moderator, but connected, use javascript to distinguish
    // between document authors and others
    if ($is_connected && !$is_moderator && $is_not_merged) {
        $associated_users_ids = array();
        foreach ($associated_users as $user) {
            $associated_users_ids[] = $user['id'];
        }
        echo javascript_tag('if ([' . implode(',', $associated_users_ids) . '].indexOf(parseInt(document.getElementById("name_to_use").getAttribute("data-user-id"))) != -1) {
          document.body.setAttribute("data-user-author", true);
        }');
    }
    echo '<div class="all_associations col_right col_33">';