function url_historyjs_html_head() { print "<script type='text/javascript' src='lib/history.js/scripts/bundled/html4+html5/native.history.js'></script>\n"; $path_name=$_SERVER['SCRIPT_NAME']; if(preg_match("/^(.*)index.php$/", $path_name, $m)) $path_name=$m[1]; html_export_var(array("url_historyjs_base_url"=>"http://{$_SERVER['HTTP_HOST']}{$path_name}")); }
function importance_init() { global $importance_levels; global $importance_zoom; html_export_var(array( "importance_levels" =>$importance_levels, "importance_zoom" =>$importance_zoom, )); }
function plugins_html_head($plugin) { global $plugins_dir; global $plugins_list; global $plugins_include_files; global $plugins; global $version_string; global $plugins_available; $plugins_script=""; $str=""; foreach($plugins_list as $plugin=>$tags) { $var_active="{$plugin}_active"; $var_depend="{$plugin}_depend"; $var_tags="{$plugin}_tags"; global $$var_active; global $$var_depend; global $$var_tags; if(!isset($$var_tags)) $$var_tags=new tags(array()); $plugins_script.="var {$var_active}=true;\n"; $plugins_script.="var {$var_depend}=".html_var_to_js($$var_depend).";\n"; $plugins_script.="var {$var_tags}=new tags(".html_var_to_js($$var_tags->data()).");\n"; if(file_exists("$plugins_dir/$plugin/code.js")) $plugins_include_files[$plugin][]="code.js"; if(file_exists("$plugins_dir/$plugin/style.css")) $plugins_include_files[$plugin][]="style.css"; if(isset($plugins_include_files[$plugin])) foreach($plugins_include_files[$plugin] as $file) { if(preg_match("/\.js$/", $file)) $str.="<script type='text/javascript' src='plugins/$plugin/$file{$version_string}'></script>\n"; if(preg_match("/\.css$/", $file)) $str.="<link rel='stylesheet' type='text/css' href=\"plugins/$plugin/$file{$version_string}\">\n"; } } $plugins_script.="var plugins=".html_var_to_js($plugins).";\n"; $plugins_script.="var plugins_list={\n "; $list=array(); foreach($plugins_list as $plugin=>$tags) { $list[]="$plugin: {$plugin}_tags"; } $plugins_script.=implode(",\n ", $list); $plugins_script.="\n};\n"; print "<script type='text/javascript'>\n$plugins_script\n</script>\n"; print $str; html_export_var(array("plugins_available"=>$plugins_available)); }
function html_done_list() { global $category_list; global $overlays; html_export_var(array("category_list"=>$category_list, "overlays"=>$overlays)); }
function overlays_html_done() { global $overlays_layers; html_export_var(array("overlays_add"=>$overlays_layers)); }
function debug_html_end() { global $debug_list; html_export_var(array("debug_list"=>$debug_list)); real_export(); }
function html_done_overlay() { global $overlays_list; html_export_var(array("overlays_list"=>$overlays_list)); }
function cloudmade_basemap_init() { global $key_cloudmade_api; html_export_var(array("key_cloudmade_api"=>$key_cloudmade_api)); }
function basemap_init() { global $basemaps; html_export_var(array("basemaps"=>$basemaps)); }
elseif(isset($_REQUEST['mlon'])) { $start_location['lon']=$mlon; $start_location['lat']=$mlat; } else { if(isset($my_lat)) { $start_location['lat']=$my_lat; $start_location['lon']=$my_lon; $start_location['zoom']=12; } } if(isset($_REQUEST['zoom'])) $start_location['zoom']=$_REQUEST['zoom']; html_export_var(array("start_location"=>$start_location, "first_load"=>$first_load)); if(isset($mlon)) print "var marker_pos={ lon: $mlon, lat: $mlat };\n"; else print "var marker_pos=null;\n"; if(isset($my_lat)) print "var my_pos={ lon: $my_lon, lat: $my_lat };\n"; else print "var my_pos=null;\n"; ?> </script> <div id='content'> <div id='sidebar_container'> <div id='sidebar'>
<?php html_export_var(array('maki_icons' => json_decode(file_get_contents('icons/maki.json'), true)));
function lang_init() { global $lang_str; global $ui_lang; global $ui_langs; global $data_lang; global $language_list; global $design_hidden; global $lang_genders; global $version_string; lang_load($ui_lang); // Define a language string for every language foreach($language_list as $abbr=>$lang) { $lang_str["lang_native:".$abbr]=$lang; } html_export_var(array("ui_lang"=>$ui_lang, "data_lang"=>$data_lang, "ui_langs"=>$ui_langs, "lang_str"=>$lang_str, "language_list"=>$language_list, "lang_genders"=>$lang_genders)); add_html_header("<meta http-equiv=\"content-language\" content=\"{$ui_lang}\">"); }
function categories_init() { global $default_categories; global $category_tiles_url; if(isset($default_categories)) html_export_var(array("default_categories"=>$default_categories)); if(isset($category_tiles_url)) html_export_var(array("category_tiles_url"=>$category_tiles_url)); }