Ejemplo n.º 1
0
        include_partial('documents/association', array('associated_docs' => $associated_sites, 'module' => 'sites', 'document' => $document, 'show_link_to_delete' => $show_link_to_delete, 'type' => 'pt', 'strict' => true));
        include_partial('documents/association', array('associated_docs' => $associated_huts, 'module' => 'huts', 'route_list_module' => 'parkings', 'route_list_ids' => $ids, 'route_list_linked' => true, 'document' => $document, 'show_link_to_delete' => $show_link_to_delete, 'type' => 'ph', 'strict' => true));
        // 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');
Ejemplo n.º 2
0
        $extra_maps = array_map('trim', explode('\\', $extra_maps));
    } else {
        $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
Ejemplo n.º 3
0
            // try to determine the "center" of the route:
            // - centroid if it has track
            // - 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();
Ejemplo n.º 4
0
            return isset($n['lon']);
        });
        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']);
        } 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) {