Пример #1
0
        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;
    }
    echo show_map('map_container', $document, $sf_user->getCulture(), $layers_list, $height, $center, $has_geom, $sf_user->isConnected());
    echo end_section_tag(true);
    // fold_init_map.js ~ 390b
    ?>
<script>
!function(e,t){var n=e.setSectionStatus
e.setSectionStatus=function(i,o,c){if(n(i,o,c)){var a=e.section_open,l=t.getElementById(i+"_section_container")
l.style.display="none",l.title=a
var s=t.getElementById(i+"_toggle")
s.className=s.className.replace("picto_close","picto_open"),s.alt="+",s.title=a,t.getElementById("tip_"+i).innerHTML="["+a+"]"}}}(window.C2C=window.C2C||{},document)
</script>
    <?php 
    $cookie_position = array_search('map_container', sfConfig::get('app_personalization_cookie_fold_positions'));
    ?>
    <script>
    C2C.setSectionStatus('map_container', <?php 
    echo $cookie_position;
Пример #2
0
    $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();
include_partial('common/content_bottom');
                    case 'parkings':
                        $marker = _marker_url('parkings');
                        break;
                    case 'summits':
                        $marker = _marker_url('summits', $doc['summit_type']);
                        break;
                    case 'huts':
                        $marker = _marker_url('huts', $doc['shelter_type']);
                        break;
                }
                if (!isset($markers[$marker])) {
                    $markers[$marker] = [];
                }
                $nb_printed_docs++;
                array_push($markers[$marker], sprintf('%6f,%6f', floatval($doc['lat']), floatval($doc['lon'])));
            }
        }
    }
    foreach ($markers as $icon => $items) {
        $map_options[] = 'markers=shadow:false|icon:' . $icon . '|' . implode('|', $items);
    }
    // if only one linked doc is displayed, without any trace, set zoom
    if ($nb_printed_docs <= 1 && !(bool) $document->get('geom_wkt')) {
        $map_options[] = 'zoom=12';
    }
    $map_url .= implode('&amp;', $map_options);
    echo image_tag($map_url, array('alt' => __('map')));
    echo '</div>', end_section_tag(true);
    $cookie_position = array_search('map_container', sfConfig::get('app_personalization_cookie_fold_positions'));
    echo javascript_tag('C2C.setSectionStatus(\'map_container\', ' . $cookie_position . ', true);');
}