コード例 #1
0
ファイル: code.php プロジェクト: plepe/OpenStreetBrowser
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}"));
}
コード例 #2
0
ファイル: code.php プロジェクト: plepe/OpenStreetBrowser
function importance_init() {
  global $importance_levels;
  global $importance_zoom;

  html_export_var(array(
    "importance_levels" =>$importance_levels,
    "importance_zoom"   =>$importance_zoom,
  ));
}
コード例 #3
0
ファイル: plugins.php プロジェクト: plepe/OpenStreetBrowser
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));
}
コード例 #4
0
ファイル: list.php プロジェクト: plepe/OpenStreetBrowser
function html_done_list() {
  global $category_list;
  global $overlays;

  html_export_var(array("category_list"=>$category_list, "overlays"=>$overlays));
}
コード例 #5
0
ファイル: code.php プロジェクト: plepe/OpenStreetBrowser
function overlays_html_done() {
  global $overlays_layers;

  html_export_var(array("overlays_add"=>$overlays_layers));
}
コード例 #6
0
ファイル: debug.php プロジェクト: plepe/OpenStreetBrowser
function debug_html_end() {
  global $debug_list;
  html_export_var(array("debug_list"=>$debug_list));
  real_export();
}
コード例 #7
0
ファイル: overlays.php プロジェクト: plepe/OpenStreetBrowser
function html_done_overlay() {
  global $overlays_list;

  html_export_var(array("overlays_list"=>$overlays_list));
}
コード例 #8
0
ファイル: code.php プロジェクト: plepe/OpenStreetBrowser
function cloudmade_basemap_init() {
  global $key_cloudmade_api;

  html_export_var(array("key_cloudmade_api"=>$key_cloudmade_api));
}
コード例 #9
0
ファイル: basemap.php プロジェクト: plepe/OpenStreetBrowser
function basemap_init() {
  global $basemaps;

  html_export_var(array("basemaps"=>$basemaps));
}
コード例 #10
0
ファイル: index.php プロジェクト: plepe/OpenStreetBrowser
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'>
コード例 #11
0
ファイル: maki.php プロジェクト: plepe/geowiki
<?php

html_export_var(array('maki_icons' => json_decode(file_get_contents('icons/maki.json'), true)));
コード例 #12
0
ファイル: lang.php プロジェクト: plepe/OpenStreetBrowser
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}\">");
}
コード例 #13
0
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));
}