<?php use_helper('Language', 'Sections', 'Viewer', 'Ajax', 'AutoComplete', 'Field', 'SmartFormat', 'sfBBCode', 'Pagination'); $is_connected = $sf_user->isConnected(); $is_moderator = $sf_user->hasCredential(sfConfig::get('app_credentials_moderator')); $id = $sf_params->get('id'); $lang = $document->getCulture(); $date = field_semantic_date_data($document, 'date'); $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; $activities = $document->getRaw('activities'); $has_wkt = (bool) $document->get('geom_wkt'); $section_list = array('map' => $has_wkt, 'elevation_profile' => $has_wkt, 'images' => $is_connected || count($associated_images)); display_page_header('outings', $document, $id, $metadata, $current_version, array('prepend' => $date, 'separator' => ', ', 'nav_options' => $section_list, 'item_type' => 'http://schema.org/Article', 'nb_comments' => $nb_comments)); // lang-independent content starts here echo start_section_tag('Information', 'data'); $participants = explode("\n", $document->get('participants'), 2); $participants_str = trim($participants[0]); if (!empty($participants_str)) { $participants_0 = parse_links(parse_bbcode_simple($participants_str)); } 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 = ''; }
if (count($associated_documents)) { echo '<ul id="' . $id_list_associated_docs . '">'; foreach ($associated_documents as $doc) { $doc_id = $doc->get('id'); $module = $doc['module']; if (empty($fixed_type)) { $type = c2cTools::Module2Letter($module) . 'c'; } else { $type = $fixed_type; } $idstring = $type . '_' . $doc_id; echo '<li id="' . $idstring . '">'; echo picto_tag('picto_' . $module, __($module)); echo ' ' . list_link($doc, $module); if ($module == 'outings') { echo ' - ' . field_activities_data($doc, array('raw' => true)) . ' - ' . field_semantic_date_data($doc, 'date'); } if ($show_link_to_delete) { $strict = $type == 'cc' ? 0 : 1; if (empty($fixed_type)) { echo c2c_link_to_delete_element($type, $doc_id, $id, false, $strict); } else { echo c2c_link_to_delete_element($type, $id, $doc_id, true, $strict); } } echo '</li>'; } echo '</ul>'; } elseif ($show_link_tool) { echo '<ul id="' . $id_list_associated_docs . '"><li style="display:none"></li></ul>'; }