} 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(); echo start_section_tag('Latest outings', 'outings'); include_partial('outings/linked_outings', array('id' => $ids, 'module' => 'parkings', 'items' => $latest_outings, 'nb_outings' => $nb_routes_outings, 'lat' => $lat, 'lon' => $lon)); echo end_section_tag(); if ($section_list['books']) { echo start_section_tag('Linked books', 'linked_books'); include_partial('books/linked_books', array('associated_books' => $associated_books, 'document' => $document, 'type' => 'bp', 'strict' => true)); echo end_section_tag(); } 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)); } include_partial('documents/license', array('license' => 'by-sa', 'version' => $current_version, 'created_at' => isset($created_at) ? $created_at : null, 'timer' => $timer)); echo end_content_tag(); if (!$mobile_version) { $js = 'if ("geolocation" in navigator) { navigator.geolocation.getCurrentPosition(function(position) { $("#get_directions").next().each(function() {
if ($is_not_archive && $is_not_merged) { $is_personal_article = $document->get('article_type') == 2; // if the user is not a moderator, and personal article, use javascript to distinguish // between document author(s) and others $author_specific = !$is_moderator && $is_connected && $is_personal_article; if ($author_specific) { $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); }'); } if (!$is_personal_article || count($associated_documents) || $is_connected) { echo start_section_tag('Linked documents', 'associated_docs'); include_partial('articles/association', array('document' => $document, 'associated_documents' => $associated_documents)); echo end_section_tag(); } if (!$is_personal_article || count($associated_images) || $is_connected) { include_partial('documents/images', array('images' => $associated_images, 'document_id' => $id, 'dissociation' => 'moderator', 'author_specific' => $author_specific, '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)); $licenses_array = sfConfig::get('app_licenses_list'); $license = $licenses_array[$document->get('article_type')]; include_partial('documents/license', array('license' => $license, 'version' => $current_version, 'created_at' => isset($created_at) ? $created_at : null, 'timer' => $timer, 'large' => $show_link_tool)); echo end_content_tag();
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) { $document->parkings = $associated_parkings; $document->summits = $associated_summits; $document->huts = $associated_huts; } include_partial($mobile_version ? 'documents/mobile_map_section' : 'documents/map_section', array('document' => $document)); if ($is_not_archive && $is_not_merged) { // associated outings section starts here echo start_section_tag('Linked outings', 'outings'); if ($nb_outings == 0) { ?> <p class="default_text"><?php echo __('No linked outing'); ?> </p> <?php } else { if (!isset($nb_main_outings)) { $nb_main_outings = $nb_outings; } if (!isset($nb_routes_outings)) { $nb_routes_outings = 0; } // main outings (= outings associated to this route)
$show_map = false; } if ($has_geom || $show_map) { if (!isset($home_section)) { $home_section = false; } if (!isset($section_title)) { $section_title = 'Interactive map'; } if (!isset($show_tip)) { $show_tip = true; } if ($home_section) { include_partial('documents/home_section_title', array('module' => 'maps', 'home_section' => false, 'custom_title_text' => __($section_title), 'has_title_link' => false, 'custom_section_id' => 'map_container')); } else { echo start_section_tag($section_title, 'map_container', 'opened', true, false, false, $show_tip); } if (!empty($help_text)) { echo __($help_text); } use_helper('Map'); if (!isset($layers_list)) { $layers_list = null; } if (!isset($height)) { $height = null; } if (isset($center)) { $center = $sf_data->getRaw('center'); } else { $center = null;
if ($is_connected && !$is_moderator && $is_not_merged) { echo javascript_tag('if (' . $id . ' == document.getElementById("name_to_use").getAttribute("data-user-id")) { document.body.setAttribute("data-user-author", true); }'); } } echo end_section_tag(); 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, 'filter_image_type' => false)); 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('User outings', 'outings'); include_partial('outings/linked_outings', array('id' => $id, 'module' => 'users', 'items' => $associated_outings, 'nb_outings' => $nb_outings, 'nb_outings_limit' => $nb_outings_limit, 'empty_list_tips' => 'This user does not have any associated outing.')); echo end_section_tag(); echo start_section_tag('User contributions', 'contributions'); ?> <ul class="contribs"> <li><span class="picto action_comment"></span> <?php echo f_link_to(__('User-s messages'), 'search.php?action=search&author_id=' . $id) . ' - ' . f_link_to(__('topics'), 'search.php?action=show_user_topics&user_id=' . $id); ?> </li> <li><span class="picto picto_images"></span> <?php echo link_to(__('Images uploaded by this user'), "images/list?users={$id}") . ' - ' . link_to(__('collaborative images'), "images/list?ityp=1&users={$id}") . ' - ' . link_to(__('personal images'), "images/list?ityp=2&users={$id}"); ?> </li> <li><span class="picto picto_articles"></span> <?php echo link_to(__('Personal articles'), "articles/list?users={$id}"); ?> </li> <li><span class="picto action_description"></span> <?php
use_helper('ModalBox', 'Link', 'Lightbox', 'Javascript', 'MyImage', 'General', 'Url'); $module_name = $sf_context->getModuleName(); $nb_images = count($images); $mobile_version = c2cTools::mobileVersion(); $connected = $sf_user->isConnected(); $moderator = $sf_user->hasCredential(sfConfig::get('app_credentials_moderator')); if (!$mobile_version) { // add lightbox ressources addLbMinimalRessources(); } else { use_javascript('/static/js/swipe.js', 'last'); use_javascript('/static/js/swipe.wrapper.js', 'last'); } // FIXME Why is this useful ? $sf_user->setAttribute('module', $module_name); echo start_section_tag('Images', 'images'); if ($dissociation == 'user') { $specifics_rights = true; } else { if ($dissociation == 'moderator') { $specifics_rights = $moderator; } } // TODO due to cache it is impossible to have owner as special_rights // For the moment only moderators can dissociate images $user_can_dissociate = $sf_user->isConnected() && $specifics_rights; if ($nb_images == 0) { ?> <p class="default_text"><?php echo __('No image linked to this document'); ?>
use_helper('Language', 'Sections', 'Viewer'); $is_connected = $sf_user->isConnected(); $is_moderator = $sf_user->hasCredential(sfConfig::get('app_credentials_moderator')); $id = $sf_params->get('id'); $is_not_archive = !$document->isArchive(); $is_not_merged = !$document->get('redirects_to'); $mobile_version = c2cTools::mobileVersion(); $show_link_to_delete = $is_not_archive && $is_not_merged && $is_moderator && !$mobile_version; $show_link_tool = $is_not_archive && $is_not_merged && $is_connected && !$mobile_version; display_page_header('maps', $document, $id, $metadata, $current_version, array('nb_comments' => $nb_comments)); // lang-independent content starts here echo start_section_tag('Information', 'data'); include_partial('data', array('document' => $document)); if ($is_not_archive) { echo '<div class="all_associations">'; include_partial('areas/association', array('associated_docs' => $associated_areas, 'module' => 'areas')); echo '</div>'; } 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(); include_partial($mobile_version ? 'documents/mobile_map_section' : 'documents/map_section', array('document' => $document)); if ($is_not_archive && $is_not_merged) { include_partial('documents/images', array('images' => $associated_images, 'document_id' => $id, 'dissociation' => 'moderator', 'is_protected' => $document->get('is_protected'))); include_partial('documents/annex_docs', array('related_portals' => $related_portals)); } include_partial('documents/license', array('license' => 'by-sa', 'version' => $current_version, 'created_at' => isset($created_at) ? $created_at : null, 'timer' => $timer)); echo end_content_tag(); include_partial('common/content_bottom');
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; } } echo start_section_tag('Buy the book', 'buy_books', 'opened', false, false, true); echo javascript_queue("\$.extend(C2C.GoogleBooks = C2C.GoogleBooks || {}, {\n preview_logo_src: 'http://books.google.com/intl/{$lang}/googlebooks/images/gbs_preview_button1.png'," . "\n translation: '" . __('Google Book Search') . "'," . "\n book_isbn: '" . $isbn_or_issn . $document['isbn'] . "'});\n \$.ajax({\n url: '{$script}',\n dataType: 'script',\n cache: true })\n .done(function() {\n C2C.GoogleBooks.search();\n });"); echo end_section_tag(); } 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)); } include_partial('documents/license', array('license' => 'by-sa', 'version' => $current_version, 'created_at' => isset($created_at) ? $created_at : null, 'timer' => $timer)); echo end_content_tag(); include_partial('common/content_bottom');
} elseif ($module == 'amateurs') { $criteria = "/users/list?areas={$id}&ucat=1"; $picto = 'users'; } elseif ($module == 'pros') { $criteria = "/users/list?areas={$id}&ucat=2"; $picto = 'users'; } elseif ($module == 'clubs') { $criteria = "/users/list?areas={$id}&ucat=3"; $picto = 'users'; } ?> <li><?php echo picto_tag("picto_{$picto}") . ' ' . link_to(ucfirst(__($module)), $criteria); ?> </li> <?php } ?> </ul> </div> <?php echo end_section_tag(); echo start_section_tag('Latest outings', 'outings'); include_partial('outings/linked_outings', array('id' => $id, 'module' => 'areas', 'items' => $latest_outings, 'nb_outings' => $nb_outings)); echo end_section_tag(); include_partial('documents/images', array('images' => $associated_images, 'document_id' => $id, 'dissociation' => 'moderator', 'is_protected' => $document->get('is_protected'))); include_partial('documents/annex_docs', array('related_portals' => $related_portals)); } include_partial('documents/license', array('license' => 'by-sa', 'version' => $current_version, 'created_at' => isset($created_at) ? $created_at : null, 'timer' => $timer)); echo end_content_tag(); include_partial('common/content_bottom');
if (!empty($article_url_params)) { $custom_title_link .= '?' . $article_url_params; $custom_rss_link .= '?' . $article_url_params; } include_partial('articles/latest', array('items' => $latest_articles, 'culture' => $culture, 'default_open' => true, 'custom_title_link' => $custom_title_link, 'custom_rss_link' => $custom_rss_link)); } if ($mobile_version) { include_partial('documents/prepare', array('sf_cache_key' => $culture, 'default_open' => true)); } ?> </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));
<?php use_helper('MyMinify', 'JavascriptQueue'); $mobile = c2cTools::mobileVersion(); echo start_section_tag('Elevation profile', 'elevation_profile_container', 'closed'); ?> <div class="elevation_profile_loading ui-spinner"> <span class="side side-left"><span class="fill"></span></span> <span class="side side-right"><span class="fill"></span></span> </div> <div class="elevation_profile_controls" style="display: none;"> <div> <!-- TODO add some information here? like number of points, ... And later on, options like move the map, ... --> </div> <form class="xaxis-dimension"> <span class="xaxis-label"><?php echo __('x axis:'); ?> </span> <label><input type="radio" name="profile_mode" value="distance" checked /> <?php echo __('Distance'); ?> </label> <label><input type="radio" name="profile_mode" value="time" /> <?php echo __('Time'); ?> </label> </form> </div> <div id="elevation_profile">
<?php use_helper('Sections', 'Field'); if (!isset($related_articles)) { $related_articles = array(); } if (count($related_articles) || count($related_portals)) { echo start_section_tag('Annex', 'annex'); if (count($related_articles)) { $module = $document->get('module'); $fixed_type = c2cTools::Module2Letter($module) . 'c'; include_partial('articles/association', array('document' => $document, 'associated_documents' => $related_articles, 'show_link_to_delete' => $show_link_to_delete, 'show_link_tool' => false, 'show_default_text' => false, 'fixed_type' => $fixed_type, 'id_list_associated_docs' => 'list_associated_articles')); } if (count($related_portals)) { echo '<ul id="list_related_portals" class="no_print">'; foreach ($related_portals as $portal) { $portal_config = sfConfig::get('app_portals_' . $portal); $text = __($portal_config['name']); if (isset($portal_config['url']) || isset($portal_config['annex_url'])) { if (isset($portal_config['url'])) { $portal_url = $portal_config['url']; } else { $portal_url = $portal_config['annex_url']; } $portal_url = $portal_url; } else { $portal_url = '@document_by_id?module=portals&id=' . $portal_config['id']; } $html = link_to($text, $portal_url); echo li(picto_tag('picto_portals') . ' ' . $html); }
<?php use_helper('Link'); echo start_section_tag('Comments', 'comments'); $module = sfContext::getInstance()->getModuleName(); echo '<p>', picto_tag('action_comment'), ' ', format_number_choice('[0]No comment|[1]1 comment|(1,+Inf]%1% comments', array('%1%' => $nb_comments), $nb_comments) . '</p>'; if ($nb_comments) { $link = '<p>' . link_to(__('comments_tab_help'), "@document_comment?module={$module}&id={$id}&lang={$lang}") . '</p>'; } else { // check if anonymous users can create comments if (!sfContext::getInstance()->getUser()->isConnected() && !in_array($lang, sfConfig::get('app_anonymous_comments_allowed_list'))) { $link = ''; } else { $link = '<p>' . content_tag('a', __('comments_tab_help'), array('href' => '/forums/post.php?fid=1&subject=' . $id . '_' . $lang)) . '</p>'; } } echo $link; echo end_section_tag();