// - highest linked summits with coordinates if (check_not_empty_doc($document, 'lon')) { $options['suggest_near_docs'] = array('lon' => $document['lon'], 'lat' => $document['lat']); } else { $summits_with_geom = array_filter($sf_data->getRaw('associated_summits'), function ($n) { return isset($n['pointwkt']); }); if (count($summits_with_geom)) { $ref_summit = c2cTools::extractHighest($summits_with_geom); $options['suggest_near_docs'] = array('lon' => $ref_summit['lon'], 'lat' => $ref_summit['lat']); } } if (isset($options['suggest_near_docs'])) { $options['suggest_exclude'] = array('summits' => get_directly_linked_ids($associated_summits), 'sites' => get_directly_linked_ids($associated_sites), 'huts' => get_directly_linked_ids($associated_huts), 'parkings' => get_directly_linked_ids($associated_parkings)); } echo c2c_form_add_multi_module('routes', $id, $modules_list, 3, $options); } echo '</div>'; } include_partial('documents/geom_warning', array('document' => $document, 'message' => 'No GPX track, please edit this document to add some')); } echo end_section_tag(); // lang-dependent content echo start_section_tag('Description', 'description'); if (!isset($associated_books)) { $associated_books = null; } include_partial('documents/i18n_section', array('document' => $document, 'languages' => $sf_data->getRaw('languages'), 'needs_translation' => $needs_translation, 'associated_books' => $associated_books, 'images' => $associated_images)); echo end_section_tag(); // map if ($is_not_archive && $is_not_merged) {
// strict looking for main_id in column main of Association table include_partial('documents/association', array('associated_docs' => $associated_products, 'module' => 'products', 'document' => $document, 'show_link_to_delete' => $show_link_to_delete, 'type' => 'pf', 'strict' => true)); // strict looking for main_id in column main of Association table } include_partial('areas/association', array('associated_docs' => $associated_areas, 'module' => 'areas', 'weather' => true, 'avalanche_bulletin' => true, 'lat' => $lat, 'lon' => $lon, 'elevation' => $elevation)); include_partial('documents/association', array('associated_docs' => $associated_maps, 'module' => 'maps')); if ($is_not_merged) { include_partial('documents/association', array('associated_docs' => $associated_articles, 'module' => 'articles', 'document' => $document, 'show_link_to_delete' => $show_link_to_delete, 'type' => 'pc', 'strict' => true)); if ($show_link_tool) { $modules_list = array('parkings', 'huts', 'sites', 'routes', 'products', 'articles'); $options = array('field_prefix' => 'multi_1'); if (check_not_empty_doc($document, 'lon')) { $options['suggest_near_docs'] = array('lon' => $document['lon'], 'lat' => $document['lat']); $options['suggest_exclude'] = array('parkings' => array_merge(array((int) $id), get_directly_linked_ids($associated_parkings)), 'sites' => get_directly_linked_ids($associated_sites), 'huts' => get_directly_linked_ids($associated_huts), 'products' => get_directly_linked_ids($associated_products)); } echo c2c_form_add_multi_module('parkings', $id, $modules_list, 10, $options); } } echo '</div>'; include_partial('documents/geom_warning', array('document' => $document)); } echo end_section_tag(); // lang-dependent content echo start_section_tag('Description', 'description'); include_partial('documents/i18n_section', array('document' => $document, 'languages' => $sf_data->getRaw('languages'), 'needs_translation' => $needs_translation, 'images' => $associated_images, 'ids' => $ids)); echo end_section_tag(); include_partial($mobile_version ? 'documents/mobile_map_section' : 'documents/map_section', array('document' => $document)); if ($is_not_archive && $is_not_merged) { echo start_section_tag('Linked routes', 'routes'); include_partial('routes/linked_routes', array('associated_routes' => $associated_routes, 'document' => $document, 'id' => $ids, 'module' => 'parkings', 'type' => 'pr', 'strict' => true)); echo end_section_tag();
if ($section_list['sites']) { echo start_section_tag('Linked sites', 'linked_sites'); include_partial('sites/linked_sites', array('associated_sites' => $associated_sites, 'document' => $document, 'type' => 'bt', 'strict' => true)); echo end_section_tag(); } if ($section_list['docs'] || $show_link_tool) { echo start_section_tag('Linked documents', 'associated_docs'); $id_no_associated_docs = "no_associated_docs"; $id_list_associated_docs = "list_associated_docs"; if ($section_list['docs']) { echo '<p class="default_text" id="' . $id_no_associated_docs . '">' . __('No associated document found') . '</p>'; } if ($show_link_tool) { echo '<ul id="' . $id_list_associated_docs . '"><li style="display:none"></li></ul>', '<div id="association_tool" class="plus">', '<p>', __('You can associate this book with existing document using the following tool:'), '</p>'; $modules_list = array('summits', 'sites', 'routes', 'huts', 'articles'); echo c2c_form_add_multi_module('books', $id, $modules_list, 13, array('field_prefix' => $id_list_associated_docs, 'hide' => false, 'removed_id' => $id_no_associated_docs)); echo '</div>'; } echo end_section_tag(); } include_partial('documents/images', array('images' => $associated_images, 'document_id' => $id, 'dissociation' => 'moderator', 'is_protected' => $document->get('is_protected'))); if ($document['isbn']) { // TODO checks on ISBN value (multiple isbns?) $script = minify_get_combined_files_url('/static/js/books.js'); $isbn_or_issn = 'ISBN:'; foreach ($document['book_types'] as $type) { if ($type == '18') { $isbn_or_issn = 'ISSN:'; break; } }
$extra_maps = ''; } include_partial('documents/association', array('associated_docs' => $associated_maps, 'extra_docs' => $extra_maps, 'module' => 'maps')); if ($is_not_merged) { include_partial('documents/association', array('associated_docs' => $associated_articles, 'module' => 'articles', 'document' => $document, 'show_link_to_delete' => $show_link_to_delete, 'type' => 'sc', 'strict' => true)); } echo '</div>'; if ($show_link_tool) { echo '<div class="all_associations col_left col_66">'; $modules_list = array('summits', 'sites', 'books', 'articles'); $options = array('field_prefix' => 'multi_1'); if (check_not_empty_doc($document, 'lon')) { $options['suggest_near_docs'] = array('lon' => $document['lon'], 'lat' => $document['lat']); $options['suggest_exclude'] = array('summits' => array_merge(get_directly_linked_ids($associated_summits), array((int) $id)), 'sites' => get_directly_linked_ids($associated_sites)); } echo c2c_form_add_multi_module('summits', $id, $modules_list, 3, $options); echo '</div>'; } include_partial('documents/geom_warning', array('document' => $document)); } else { echo '</div>'; } echo end_section_tag(); // lang-dependent content starts here echo start_section_tag('Description', 'description'); include_partial('documents/i18n_section', array('document' => $document, 'languages' => $sf_data->getRaw('languages'), 'needs_translation' => $needs_translation, 'images' => $associated_images, 'ids' => $ids)); echo end_section_tag(); // instead of $languages: XSS protection deactivation // map section starts here include_partial($mobile_version ? 'documents/mobile_map_section' : 'documents/map_section', array('document' => $document)); // associated routes section starts here
echo '</ul>'; } elseif ($show_link_tool) { echo '<ul id="' . $id_list_associated_docs . '"><li style="display:none"></li></ul>'; } if ($show_link_tool) { ?> <div id="association_tool" class="plus"> <p><?php echo __('You can associate this picture with any existing document using the following tool:'); ?> </p> <?php $linkable_modules = sfConfig::get('app_modules_list'); unset($linkable_modules[1]); // documents echo c2c_form_add_multi_module('images', $id, $linkable_modules, 3, array('field_prefix' => $id_list_associated_docs, 'hide' => false, 'removed_id' => $id_no_associated_docs)); ?> </div> <?php } echo end_section_tag(); // only display images section if they are some images // (since we don't propose the link to add images to an image anyway) if (count($associated_images)) { include_partial('documents/images', array('images' => $associated_images, 'document_id' => $id, 'dissociation' => 'moderator', 'is_protected' => $document->get('is_protected'))); } if ($mobile_version) { include_partial('documents/mobile_comments', array('id' => $id, 'lang' => $lang, 'nb_comments' => $nb_comments)); } include_partial('documents/annex_docs', array('related_portals' => $related_portals)); }
if ($is_not_merged) { if ($show_link_tool) { if ($is_gite_camping) { $modules_list = array('parkings', 'sites', 'books', 'articles'); } else { $modules_list = array('parkings', 'routes', 'sites', 'books', 'articles'); } if ($is_moderator) { $modules_list[] = 'summits'; } $options = array('field_prefix' => 'multi_1'); if (check_not_empty_doc($document, 'lon')) { $options['suggest_near_docs'] = array('lon' => $document['lon'], 'lat' => $document['lat']); $options['suggest_exclude'] = array('parkings' => get_directly_linked_ids($associated_parkings), 'sites' => get_directly_linked_ids($associated_sites)); } echo c2c_form_add_multi_module('huts', $id, $modules_list, 9, $options); } } echo '</div>'; include_partial('documents/geom_warning', array('document' => $document)); } echo end_section_tag(); // lang-dependent content echo start_section_tag('Description', 'description'); include_partial('documents/i18n_section', array('document' => $document, 'languages' => $sf_data->getRaw('languages'), 'needs_translation' => $needs_translation, 'images' => $associated_images, 'associated_routes' => $associated_summit_routes)); echo end_section_tag(); if ($is_not_archive && $is_not_merged) { $document->parkings = $associated_parkings; } include_partial($mobile_version ? 'documents/mobile_map_section' : 'documents/map_section', array('document' => $document)); if ($is_not_archive && $is_not_merged) {
$ref_summit = c2cTools::extractHighest($summits_with_geom); $options['suggest_near_docs'] = array('lon' => $ref_summit['lon'], 'lat' => $ref_summit['lat']); } else { $sites_with_geom = array_filter($sf_data->getRaw('associated_sites'), function ($n) { return isset($n['lon']); }); if (count($sites_with_geom)) { $options['suggest_near_docs'] = array('lon' => reset($sites_with_geom)['lon'], 'lat' => reset($sites_with_geom)['lat']); } } } if (isset($options['suggest_near_docs'])) { $options['suggest_exclude'] = array('sites' => get_directly_linked_ids($associated_sites), 'users' => get_directly_linked_ids($associated_users)); } echo '<div class="all_associations empty_content col_left col_66">'; echo c2c_form_add_multi_module('outings', $id, $modules_list, 2, $options); echo '</div>'; } echo end_section_tag(); if ($show_link_tool && !$is_moderator) { echo javascript_tag("if (!document.body.hasAttribute('data-user-author')) document.getElementById('multi_1_form_association').style.display = 'none';"); } // lang-dependent content echo start_section_tag('Description', 'description'); include_partial('documents/i18n_section', array('document' => $document, 'languages' => $sf_data->getRaw('languages'), 'needs_translation' => $needs_translation, 'images' => $associated_images, 'associated_areas' => isset($associated_areas) ? $associated_areas : null)); echo end_section_tag(); include_partial($mobile_version ? 'documents/mobile_map_section' : 'documents/map_section', array('document' => $document)); if ($has_wkt) { include_partial('documents/elevation_profile_section', array('id' => $id)); } if ($is_not_archive && $is_not_merged && (count($associated_images) || $is_connected)) {
} ?> </div> </div> <?php if (!$mobile_version) { echo start_section_tag('Information', 'data'); if ($is_not_archive && $is_not_merged) { $document->associated_areas = $associated_areas; } if ($is_not_archive) { echo '<div class="all_associations">'; include_partial('areas/association', array('associated_docs' => $associated_areas, 'module' => 'areas', 'weather' => true, 'avalanche_bulletin' => true)); if ($is_not_merged) { if ($show_link_tool) { $modules_list = array('areas'); echo c2c_form_add_multi_module('portals', $id, $modules_list, 4, array('field_prefix' => 'multi_1')); } } echo '</div>'; } include_partial('data', array('document' => $document)); echo end_section_tag(); if ($is_not_archive && $is_not_merged && $is_moderator) { include_partial('documents/images', array('images' => $associated_images, 'document_id' => $id, 'dissociation' => 'moderator', 'is_protected' => $document->get('is_protected'))); } } include_partial('documents/license', array('license' => 'by-sa')); echo end_content_tag(); include_partial('common/content_bottom');
if ($is_not_archive && $is_not_merged) { $document->associated_areas = $associated_areas; } include_partial('data', array('document' => $document, 'nb_comments' => $nb_comments)); if ($is_not_archive) { echo '<div class="all_associations">'; if ($is_not_merged) { include_partial('documents/association', array('associated_docs' => $associated_parkings, 'module' => 'parkings', 'route_list_module' => 'products', 'route_list_ids' => $id, 'route_list_linked' => true, 'document' => $document, 'show_link_to_delete' => $show_link_to_delete, 'type' => 'pf', 'strict' => true)); } include_partial('areas/association', array('associated_docs' => $associated_areas, 'module' => 'areas')); include_partial('documents/association', array('associated_docs' => $associated_maps, 'module' => 'maps')); if ($is_not_merged) { include_partial('documents/association', array('associated_docs' => $associated_articles, 'module' => 'articles', 'document' => $document, 'show_link_to_delete' => $show_link_to_delete, 'type' => 'fc', 'strict' => true)); if ($show_link_tool) { $modules_list = array('parkings', 'articles'); echo c2c_form_add_multi_module('products', $id, $modules_list, 9, array('field_prefix' => 'multi_1')); } } echo '</div>'; include_partial('documents/geom_warning', array('document' => $document)); } echo end_section_tag(); // lang-dependent content echo start_section_tag('Description', 'description'); include_partial('documents/i18n_section', array('document' => $document, 'languages' => $sf_data->getRaw('languages'), 'needs_translation' => $needs_translation, 'images' => $associated_images)); echo end_section_tag(); if ($is_not_archive && $is_not_merged) { include_partial($mobile_version ? 'documents/mobile_map_section' : 'documents/map_section', array('document' => $document)); include_partial('documents/images', array('images' => $associated_images, 'document_id' => $id, 'dissociation' => 'moderator', 'is_protected' => $document->get('is_protected'))); if ($mobile_version) { include_partial('documents/mobile_comments', array('id' => $id, 'lang' => $lang, 'nb_comments' => $nb_comments));