}
function delete_image_if_unused ($imgpath, $con) {
+ if (!isset ($imgpath) || (strlen ($imgpath) == 0)) {
+ return;
+ }
if ($con->imgpath_exists ($imgpath)) {
return false;
}
<?php
+/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
+ license. */
+
$translations['en'] = array(
// your name
"_translator_name" => "arno renevier",
#!/usr/bin/php
<?php
+/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
+ license. */
// only execute from command line
if (!(isset ($argc)) || !(isset ($argv))) {
exit (0);
}
-$ROOTDIR="../../";
-$SCRIPTS=array("admin", "index", "wizard"); // scripts in rootdir we need to link to
+$ROOTDIR = "../../";
+// scripts in rootdir we need to link to
+$SCRIPTS = array ("admin", "index", "wizard");
function usage() {
global $argv;
}
function escape_newline ($str, $tab) {
- return str_replace("\n", "\\n\" .\n$tab$tab\"", $str);
+ return str_replace ("\n", "\\n\" .\n$tab$tab\"", $str);
}
function escape_slash ($str) {
- $res = str_replace("\\", "\\\\", $str);
- $res = str_replace("\"", "\\\"", $res);
+ $res = str_replace ("\\", "\\\\", $str);
+ $res = str_replace ("\"", "\\\"", $res);
return $res;
}
return $str;
}
-function updatelang($lang, $rootdir, $scripts) {
+function updatelang ($lang, $rootdir, $scripts) {
if (!preg_match ('/^[a-zA-Z]{2,3}(-[a-zA-Z]{2,3})?$/', $lang)) {
warn ("$lang is not a valid lang format.\n");
return false;
warn ("en is reference language. It must be managed manually.\n");
return false;
}
-
+
if (!is_dir ($lang)) {
if (!mkdir ($lang)) {
error ("could not create $lang directory.\n");
$tab = str_repeat (" ", 4);
$tmpname = tempnam ("", "");
- $output = fopen($tmpname, "w");
+ $output = fopen ($tmpname, "w");
fwrite ($output, "<?php\n");
error ("could not set permissions to $lang/sys.php");
return false;
}
-
+
foreach ($scripts as $script) {
$link = $rootdir . "/" . $script . "." . $lang . ".php";
$target = $script . ".php";
if (preg_match ('/^\s*([a-zA-Z-]+)\s*$/', $acc, $matches)) {
$possibilities [$matches [1]] = 1.0;
}
- if (preg_match ('/^\s*([a-zA-Z-]+)\s*;\s*q\s*=\s*([0-9\.]+)\s*$/',
+ if (preg_match ('/^\s*([a-zA-Z-]+)\s*;\s*q\s*=\s*([0-9\.]+)\s*$/',
$acc, $matches)) {
$val = floatval ($matches [2]);
if ($val > 1.0) {
if ($dotpos !== false) {
$script = substr ($script, 0, $dotpos);
}
-
+
global $translations;
$links = Array ();
foreach ($translations as $lang => $obj) {
function main ($features) {
- header("Cache-control: no-cache");
+ header ("Cache-control: no-cache");
echo '<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
init: function() {
this.map = new OpenLayers.Map("map", {
controls:[
+ new OpenLayers.Control.SypAttribution(),
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PanZoom(),
- new OpenLayers.Control.Permalink(),
- new OpenLayers.Control.SypAttribution()
+ new OpenLayers.Control.Permalink()
],
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326")
this.map.events.unregister("movestart", this, this._unselect);
return;
}
- popup = feature.popup;
+ var popup = feature.popup;
if (popup.visible()) {
popup.hide();
}
<?php
+/* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
+ license. */
require_once ("./inc/settings.php");
#login_error {
display: none;
}
-
-/*
- * add feature
- */
return $date;
}
+// method from http://diveintomark.org/archives/2004/05/28/howto-atom-id#other
function unique_id_from_feature ($feature) {
- // method from http://diveintomark.org/archives/2004/05/28/howto-atom-id#other
$date = date('Y-m-d', $feature->date);
$res = sprintf("tag:%s,%s:%d", gethost(), $date, $feature->id);
return $res;
}
function main ($features) {
- print "<?xml version=\"1.0\" encoding=\"utf-8\"?>
+ printf ("<?xml version=\"1.0\" encoding=\"utf-8\"?>
<feed xmlns=\"http://www.w3.org/2005/Atom\"
- xmlns:georss=\"http://www.georss.org/georss\">\n";
+ xmlns:georss=\"http://www.georss.org/georss\">\n");
printf(" <link rel=\"alternate\" type=\"text/html\" href=\"%s\"/>\n",
full_url_from_path (""));
printf(" </author>\n");
}
- print "\n";
+ printf ("\n");
foreach ($features as $feature) {
- print (" <entry>\n");
+ printf (" <entry>\n");
if ($feature->title) {
$title = htmlspecialchars ($feature->title, ENT_QUOTES);
}
if (strlen ($contentHTML) != 0) {
- printf(" <content type=\"html\">
+ printf (" <content type=\"html\">
%s
</content>\n", htmlspecialchars ($contentHTML));
}
printf(" </entry>\n\n");
}
- print '</feed>';
+ printf ("</feed>");
}
try {