<commit_before><?php
use_helper('Form', 'Javascript');

function show_map($container_div, $document)
{
    // define div identifiers
    $map_container_div_id   = $container_div . '_section_container';
    $app_static_url = sfConfig::get('app_static_url');
    
    // TODO: get interface language
    
    // TODO: add linked objects
    $objects_list = sprintf("{id: %d, type: '%s', wkt: '%s'}",
                            $document->get('id'), $document->get('module'), $document->get('geom_wkt'));
    $html = javascript_tag("var objectsToShow = [$objects_list];");
    
    $html .= '<div class="section" id="' . $map_container_div_id . '"><div class="article_contenu">';
    $html .= '<div id="map" style="height:300px;width:100%">';
    $html .= '<div id="mapLoading"><img src="' . $app_static_url . '/static/images/indicator.gif" alt="" />';
    $html .= _('Map is loading...') . '</div>';
    $html .= '</div>';
    $html .= '<div id="scale"></div>';
    $html .= '<div id="fake_clear"></div>';
    $html .= '</div></div>';

    return $html;
}

function _loadJsMapTools()
{
    $response = sfContext::getInstance()->getResponse();

    $app_static_url = sfConfig::get('app_static_url');

    use_stylesheet($app_static_url . '/static/js/mapfish/mfbase/ext/resources/css/ext-all.css', 'last');
    use_stylesheet($app_static_url . '/static/js/mapfish/mfbase/ext/resources/css/xtheme-gray.css', 'last');
    use_stylesheet($app_static_url . '/static/js/mapfish/mfbase/geoext/resources/css/gxtheme-gray.css', 'last');
    use_stylesheet($app_static_url . '/static/js/mapfish/mfbase/openlayers/theme/default/style.css', 'last');

    use_stylesheet($app_static_url . '/static/js/mapfish/MapFishApi/css/api.css', 'last');
    use_stylesheet($app_static_url . '/static/js/mapfish/c2corgApi/css/api.css', 'last');
    
    use_javascript($app_static_url . '/static/js/mapfish/mfbase/ext/adapter/ext/ext-base.js', 'last');
    use_javascript($app_static_url . '/static/js/mapfish/mfbase/ext/ext-all.js', 'last');
    //use_javascript($app_static_url . '/static/js/mapfish/mfbase/ext/ext-all-debug.js', 'last');
    
    use_javascript($app_static_url . '/static/js/mapfish/build/c2corgApi.js', 'last');
    use_javascript($app_static_url . '/static/js/docmap.js', 'last');
}

_loadJsMapTools();
?><commit_msg>added missing popup CSS/JS in embedded maps<commit_after><?php
use_helper('Form', 'Javascript');

function show_map($container_div, $document)
{
    // define div identifiers
    $map_container_div_id   = $container_div . '_section_container';
    $app_static_url = sfConfig::get('app_static_url');
    
    // TODO: get interface language
    
    // TODO: add linked objects
    $objects_list = sprintf("{id: %d, type: '%s', wkt: '%s'}",
                            $document->get('id'), $document->get('module'), $document->get('geom_wkt'));
    $html = javascript_tag("var objectsToShow = [$objects_list];");
    
    $html .= '<div class="section" id="' . $map_container_div_id . '"><div class="article_contenu">';
    $html .= '<div id="map" style="height:300px;width:100%">';
    $html .= '<div id="mapLoading"><img src="' . $app_static_url . '/static/images/indicator.gif" alt="" />';
    $html .= _('Map is loading...') . '</div>';
    $html .= '</div>';
    $html .= '<div id="scale"></div>';
    $html .= '<div id="fake_clear"></div>';
    $html .= '</div></div>';

    return $html;
}

function _loadJsMapTools()
{
    $response = sfContext::getInstance()->getResponse();

    $app_static_url = sfConfig::get('app_static_url');

    use_stylesheet($app_static_url . '/static/js/mapfish/mfbase/ext/resources/css/ext-all.css', 'last');
    use_stylesheet($app_static_url . '/static/js/mapfish/mfbase/ext/resources/css/xtheme-gray.css', 'last');
    use_stylesheet($app_static_url . '/static/js/mapfish/mfbase/geoext/resources/css/gxtheme-gray.css', 'last');
    use_stylesheet($app_static_url . '/static/js/mapfish/mfbase/openlayers/theme/default/style.css', 'last');

    use_stylesheet($app_static_url . '/static/css/popup.css', 'last');
    use_stylesheet($app_static_url . '/static/js/mapfish/MapFishApi/css/api.css', 'last');
    use_stylesheet($app_static_url . '/static/js/mapfish/c2corgApi/css/api.css', 'last');
    
    use_javascript($app_static_url . '/static/js/mapfish/mfbase/ext/adapter/ext/ext-base.js', 'last');
    use_javascript($app_static_url . '/static/js/mapfish/mfbase/ext/ext-all.js', 'last');
    //use_javascript($app_static_url . '/static/js/mapfish/mfbase/ext/ext-all-debug.js', 'last');
    
    use_javascript($app_static_url . '/static/js/mapfish/build/c2corgApi.js', 'last');
    use_javascript($app_static_url . '/static/js/popup.js', 'last');
    use_javascript($app_static_url . '/static/js/docmap.js', 'last');
}

_loadJsMapTools();
?>
{'fraction_non_alphanumeric': 0.20254484772632458, 'fraction_numerical': 0.003337505214851898, 'mean_word_length': 3.92299794661191, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4213436', 'n_tokens_mistral': 1688, 'n_tokens_neox': 1658, 'n_words': 234}