PageRenderTime 14ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/input.php

https://github.com/toastbrot/datenlandkarte
PHP | 711 lines | 657 code | 35 blank | 19 comment | 82 complexity | ed6ad26935533692b2a298064c78754e MD5 | raw file
  1<?php
  2    require_once('lib.php');
  3
  4    if ($_POST) {
  5        $invalid = check_userinput($_POST);
  6        $keys = get_keys_by_vis($_POST);
  7        $data = get_data($_POST, $keys);
  8
  9        if (!$invalid && is_array($data))
 10        {
 11            unset($keys);
 12            unset($data);
 13            include 'select.php';
 14            die();
 15        }
 16    }
 17
 18    // Remove any old created files if there are any
 19    if (!delete_old_created_file($location_creation))
 20    {
 21        die('Could not delete old files. Don\'t want to continue!');
 22    }
 23
 24    // AJAX Request handler
 25    if ($_GET['method'] === 'check_svg') {
 26        $path = (string)select_svg_file($_GET);
 27        if (!file_exists($path))
 28        {
 29            die('Leider ist keine Basiskarte für diese Auswahl verfügbar.');
 30        }
 31        die();
 32    } else if ($_GET['method'] === 'get_data' && !empty($_GET['vis'])) {
 33        $keys = get_keys_by_vis($_GET);
 34        $error_msg_keys_missing = 'Die notwendigen Datensätze sind leider '.
 35            'noch nicht verfügbar';
 36        $error_msg_keys_missing_html = '        <p class="error">'."\n".
 37            '          '.$error_msg_keys_missing."\n".'        </p>'."\n";
 38        if ($_GET['interface'] == 'manual')
 39        {
 40            // 'No key values found' case
 41            if (empty($keys)) {
 42                die($error_msg_keys_missing_html); 
 43            }
 44?>
 45        <table cellpadding="6">
 46<?php
 47            foreach ($keys as $key => $value) {
 48?>
 49          <tr>
 50            <td><?=htmlspecialchars($value, ENT_NOQUOTES); ?>:</td>
 51            <td><input type="text" name="manual<?=$key; ?>"></td>
 52          </tr>
 53<?php
 54            }
 55?>
 56        </table>
 57<?php
 58            die();
 59        }
 60            elseif ($_GET['interface'] == 'kvalloc')
 61        {
 62            $keys = get_keys_by_vis($_GET);
 63            if (empty($keys)) {
 64                die($error_msg_keys_missing);
 65            }
 66            $i = 0;
 67            foreach ($keys as $key => $value) {
 68                if ($i == (count($keys)-1))
 69                    echo $value.';Wert für '.$value;
 70                else
 71                    echo $value.';Wert für '.$value."\n";
 72                $i++;
 73            }
 74            die();
 75        }
 76            elseif ($_GET['interface'] == 'list')
 77        {
 78            $keys = get_keys_by_vis($_GET);
 79            if (empty($keys)) {
 80                die($error_msg_keys_missing);
 81            }
 82            $i = 0;
 83            foreach ($keys as $key => $value) {
 84                if ($i == (count($keys)-1))
 85                    echo 'Wert für '.$value;
 86                else
 87                    echo 'Wert für '.$value."\n";
 88                $i++;
 89            }
 90            die();
 91        }
 92            elseif ($_GET['interface'] == 'json')
 93        {
 94            $keys = get_keys_by_vis($_GET);
 95            if (empty($keys)) {
 96                die($error_msg_keys_missing);
 97            }
 98            echo "{\n";
 99            $i = 0;
100            foreach ($keys as $key => $value) {
101                if ($i != count($keys)-1)
102                    echo '    "'.$value.'" : "Wert für '.$value.'",'."\n";
103                else
104                    echo '    "'.$value.'" : "Wert für '.$value.'"'."\n";
105                $i++;
106            }
107            die('}');
108        }
109    }
110
111    // Defaultvalues
112    // Will be overwritten, if there was an POST Request
113    // with invalid data. Has to be HTML.
114    $defaults = array(
115        'title' => '',
116        'subtitle' => '',
117        'fac' => 1,
118        'dec' => 2,
119        'colors' => 6,
120        'grad' => 0,
121        # visualisation
122        'vis' => 'bl',
123        'bz_spec' => 'bl',
124        'bz_bl' => 1,
125        'gm_spec' => 'bl',
126        'gm_bl' => 1,
127        # format
128        'format' => 'manual',
129        'data' => '',
130        'list_delim' => '\n',
131        'kvalloc_delim1' => '\n',
132        'kvalloc_delim2' => ';'
133    );
134    // Overwrite defaults now
135    if ($_POST)
136    {
137        foreach ($defaults as $key => $d)
138        {
139            if (array_key_exists($key, $_POST) && !in_array($key, $invalid))
140            {
141                $defaults[$key] = htmlspecialchars($_POST[$key], ENT_NOQUOTES);
142            }
143        }
144        if ($_POST['format'] == 'manual')
145        {
146            $i = 1;
147            while (isset($_POST['manual'.$i]))
148            {
149                $defaults['manual'.$i] = htmlspecialchars($_POST['manual'.$i], ENT_NOQUOTES);
150                $i++;
151            }
152        }
153    }
154    // Default for shareit
155    $defaults['shareit'] = ($_POST['shareit'] == 'on') ? ' checked="checked"' : '';
156?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
157<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="de-DE"
158 xmlns:og='http://opengraphprotocol.org/schema/'>
159<head profile="http://gmpg.org/xfn/11">
160<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
161
162<title>Datenlandkarte erstellen » Datenlandkarten.at</title>
163<meta name="description" content="Hier können Sie selbst Datenlandkarten erstellen. Gleichzeitig werden, falls Sie diese Option aktiviert lassen, die Rohdaten der Visualisierung gespeichert und" />
164<meta name="keywords" content="Bezirke, Kärnten, Alle, Ebenen, Daten, Bundesländer" />
165<meta name="robots" content="index, follow" />
166<link rel="canonical" href="http://www.datenlandkarten.at/datenlandkarte-erstellen/" />
167
168<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
169
170<link rel="stylesheet" href="http://www.datenlandkarten.at/wp-content/themes/datenlandkarten/style.css" type="text/css" media="screen" />
171<!--[if IE 6]><link rel="stylesheet" href="http://www.datenlandkarten.at/wp-content/themes/datenlandkarten/style.ie6.css" type="text/css" media="screen" /><![endif]-->
172<!--[if IE 7]><link rel="stylesheet" href="http://www.datenlandkarten.at/wp-content/themes/datenlandkarten/style.ie7.css" type="text/css" media="screen" /><![endif]-->
173<link rel="pingback" href="http://www.datenlandkarten.at/xmlrpc.php" />
174<link rel="alternate" type="application/rss+xml" title="Datenlandkarten.at &raquo; Feed" href="http://www.datenlandkarten.at/feed/" />
175<link rel="alternate" type="application/rss+xml" title="Datenlandkarten.at &raquo; Kommentar Feed" href="http://www.datenlandkarten.at/comments/feed/" />
176<link rel='stylesheet' id='NextGEN-css'  href='http://www.datenlandkarten.at/wp-content/plugins/nextgen-gallery/css/nggallery.css?ver=1.0.0' type='text/css' media='screen' />
177<link rel='stylesheet' id='shutter-css'  href='http://www.datenlandkarten.at/wp-content/plugins/nextgen-gallery/shutter/shutter-reloaded.css?ver=1.3.0' type='text/css' media='screen' />
178<link rel='stylesheet' id='feedreading_style-css'  href='http://www.datenlandkarten.at/wp-content/plugins/feed-reading-blogroll/css/feedreading_blogroll.css?ver=1.5.6' type='text/css' media='all' />
179<link rel='stylesheet' id='prlipro-post-css'  href='http://www.datenlandkarten.at/wp-content/plugins/pretty-link/pro/css/prlipro-post.css?ver=3.0.4' type='text/css' media='all' />
180<script type='text/javascript' src='http://www.datenlandkarten.at/wp-content/plugins/nextgen-gallery/shutter/shutter-reloaded.js?ver=1.3.0'></script>
181<script type='text/javascript' src='http://www.datenlandkarten.at/wp-includes/js/swfobject.js?ver=2.2'></script>
182<script type='text/javascript' src='http://www.datenlandkarten.at/wp-includes/js/jquery/jquery.js?ver=1.4.2'></script>
183<script type='text/javascript' src='http://www.datenlandkarten.at/wp-includes/js/comment-reply.js?ver=20090102'></script>
184<script type='text/javascript' src='http://www.datenlandkarten.at/wp-content/feedreading_blogroll.js?ver=1.5.6'></script>
185<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.datenlandkarten.at/xmlrpc.php?rsd" />
186<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://www.datenlandkarten.at/wp-includes/wlwmanifest.xml" /> 
187<link rel='index' title='Datenlandkarten.at' href='http://www.datenlandkarten.at/' />
188<link rel='next' title='Galerie' href='http://www.datenlandkarten.at/galerie/' />
189				<meta name="DC.publisher" content="Datenlandkarten.at" />
190		<meta name="DC.publisher.url" content="http://www.datenlandkarten.at/" />
191		<meta name="DC.title" content="Datenlandkarte erstellen" />
192		<meta name="DC.identifier" content="http://www.datenlandkarten.at/datenlandkarte-erstellen/" />
193		<meta name="DC.date.created" scheme="WTN8601" content="2011-02-02T20:09:28" />
194		<meta name="DC.created" scheme="WTN8601" content="2011-02-02T20:09:28" />
195		<meta name="DC.date" scheme="WTN8601" content="2011-02-02T20:09:28" />
196		<meta name="DC.creator.name" content="Harm, Robert" />
197		<meta name="DC.creator" content="Harm, Robert" />
198		<meta name="DC.rights.rightsHolder" content="@RobertHarm" />		
199		<meta name="DC.language" content="de-DE" scheme="rfc1766" />
200		<meta name="DC.rights.license" content="http://creativecommons.org/licenses/by/3.0/at/" />
201		<meta name="DC.license" content="http://creativecommons.org/licenses/by/3.0/at/" />
202	<!--Facebook Like Button OpenGraph Settings Start-->
203	<meta property="og:site_name" content="Datenlandkarten.at"/>
204	<meta property="og:title" content="Datenlandkarte erstellen"/>
205		<meta property="og:description" content="Hier können Sie selbst Datenlandkarten erstellen. Gleichzeitig werden, falls Sie diese Option aktiviert lassen, die Rohdaten der Visualisie"/>
206	
207	<meta property="og:url" content="http://www.datenlandkarten.at/datenlandkarte-erstellen/"/>
208	<meta property="fb:admins" content="1039929046" />
209	<meta property="fb:app_id" content="192140977480316" />
210	<meta property="og:image" content="http://www.datenlandkarten.at/wp-content/uploads/opengraph.png" />
211	<meta property="og:type" content="article" />
212		<!--Facebook Like Button OpenGraph Settings End-->
213	      <link rel="shorturl" href="http://datenlandkarte.at/gs8" />
214    
215<meta name='NextGEN' content='1.7.3' />
216<script type="text/javascript" src="http://www.datenlandkarten.at/wp-content/themes/datenlandkarten/script.js"></script>
217<script type="text/javascript">
218<!--
219    /* jQuery ftw */
220    jQuery(document).ready(function () {
221        var selected = (function (name) {
222            return jQuery('input[name=' + name + ']:checked').val();
223        });
224        var write_svg_error = function(data) {jQuery('#svg_error').text(data);};
225        var write = (function(interfac) {
226            if (interfac == 'manual')
227                return (function(data) { jQuery('#manual').html(data); });
228            else
229                return (function(data) {
230                    jQuery('textarea[name=data]').val(data); });
231        });
232
233        var update_data_form = (function (todo, interfac) {
234            var vis = selected('vis');
235            var bz_spec = selected('bz_spec');
236            var gm_spec = selected('gm_spec');
237            var bz_bl = selected('bz_bl');
238            var gm_bl = selected('gm_bl');
239
240            var data = { 'method' : 'get_data', 'interface' : interfac,
241                'vis' : vis, 'bz_spec' : bz_spec, 'gm_spec' : gm_spec,
242                'bz_bl' : bz_bl, 'gm_bl' : gm_bl };
243
244            jQuery.get('input.php', data, todo);
245        });
246        var check_svg_exist = (function (todo) {
247            var vis = selected('vis');
248            var bz_spec = selected('bz_spec');
249            var gm_spec = selected('gm_spec');
250            var bz_bl = selected('bz_bl');
251            var gm_bl = selected('gm_bl');
252
253            var data = { 'method' : 'check_svg', 'vis' : vis,
254                'bz_spec' : bz_spec, 'gm_spec' : gm_spec,
255                'bz_bl' : bz_bl, 'gm_bl' : gm_bl };
256
257            jQuery.get('input.php', data, todo);
258        });
259
260        // hide specialized input field
261        jQuery('#bz_select, #gm_select, #list').hide();
262        jQuery('#data_list, #kvalloc').hide();
263
264        // logic
265        jQuery('input').click(function () {
266            jQuery('#' + jQuery(this).attr('id') + '_select').show();
267        });
268        jQuery('#format, input[type=radio]').change(function () {
269            var v = jQuery('#format option:selected').val();
270            update_data_form(write(v), v);
271            check_svg_exist(write_svg_error);
272            switch (v)
273            {
274                case 'manual':
275                    jQuery('#manual').show();
276                    jQuery('#data_list, #kvalloc, #list').hide();
277                    break;
278                case 'list':
279                    jQuery('#list').show();
280                case 'json':
281                    if (v == 'json') jQuery('#list').hide();
282                    jQuery('#data_list').show();
283                    jQuery('#kvalloc, #manual').hide();
284                    break;
285                case 'kvalloc':
286                    jQuery('#data_list, #kvalloc').show();
287                    jQuery('#manual, #list').hide();
288                    break;
289            }
290        });
291        jQuery('#submit').click(function () {
292            if (jQuery('#manual').text().substring(0, 14) == 'Die notwendigen'
293                || jQuery('#svg_error').text().length != 0)
294                return false;
295            else
296                return true;
297        });
298    });
299-->
300</script>
301<style type="text/css">
302<!--
303    table {
304        width: 100%;
305    }
306    td {
307        vertical-align: top;
308    }
309    select {
310        min-width: 50%;
311    }
312    textarea {
313        width: 100%;
314    }
315    input, textarea { background-color: #CCC; }
316    input:hover, textarea:hover { background-color: #EEE; }
317
318    .error {
319        color: #F00;
320    }
321    .subselect {
322        margin-left: 30px;
323    }
324    .download {
325        background-color: #EEE;
326        margin: 20px;
327        clear: both;
328        padding: 10px;
329    }
330    #data_list {
331        font-family: "Courier New", Courier, monospace;
332    }
333    #cc_header {
334        border: 2px dashed #000;
335        padding: 10px;
336    }
337    #cc_header_img {
338        float: left;
339    }
340    #cc_header_text {
341        margin-left: 80px;
342    }
343-->
344</style>
345</head>
346<body class="page page-id-2 page-template page-template-default">
347<div id="art-main">
348    <div class="art-sheet">
349        <div class="art-sheet-tl"></div>
350        <div class="art-sheet-tr"></div>
351        <div class="art-sheet-bl"></div>
352        <div class="art-sheet-br"></div>
353        <div class="art-sheet-tc"></div>
354        <div class="art-sheet-bc"></div>
355        <div class="art-sheet-cl"></div>
356        <div class="art-sheet-cr"></div>
357        <div class="art-sheet-cc"></div>
358        <div class="art-sheet-body">
359            <div class="art-header">
360                <div class="art-header-center">
361                    <div class="art-header-png"></div>
362                    <div class="art-header-jpeg"></div>
363                </div>
364                <div class="art-headerobject"></div>
365                <div class="art-logo">
366                                <h1 id="name-text" class="art-logo-name"><a href="http://www.datenlandkarten.at/">Datenlandkarten.at</a></h1>
367                                                    <h2 id="slogan-text" class="art-logo-text">Erstelle deine eigene Visualisierung von Gemeinde-, Bezirks-, und Bundesland-Daten</h2>
368                                </div>
369            </div>
370            <div class="art-nav">
371            	<div class="art-nav-l"></div>
372            	<div class="art-nav-r"></div>
373            	
374<ul class="art-menu">
375	<li><a href="http://www.datenlandkarten.at" title="Startseite"><span class="l"> </span><span class="r"> </span><span class="t">Startseite</span></a>
376	</li>
377	<li class="art-menu-li-separator"><span class="art-menu-separator"> </span></li>
378	<li class="active"><a class="active" href="http://www.datenlandkarten.at/datenlandkarte-erstellen/" title="Datenlandkarte erstellen"><span class="l"> </span><span class="r"> </span><span class="t">Datenlandkarte erstellen</span></a>
379	</li>
380	<li class="art-menu-li-separator"><span class="art-menu-separator"> </span></li>
381	<li><a href="http://www.datenlandkarten.at/rohdaten/" title="Rohdaten"><span class="l"> </span><span class="r"> </span><span class="t">Rohdaten</span></a>
382	</li>
383	<li class="art-menu-li-separator"><span class="art-menu-separator"> </span></li>
384	<li><a href="http://www.datenlandkarten.at/galerie/" title="Galerie"><span class="l"> </span><span class="r"> </span><span class="t">Galerie</span></a>
385	</li>
386	<li class="art-menu-li-separator"><span class="art-menu-separator"> </span></li>
387	<li><a href="http://www.datenlandkarten.at/blog/" title="Blog"><span class="l"> </span><span class="r"> </span><span class="t">Blog</span></a>
388	</li>
389	<li class="art-menu-li-separator"><span class="art-menu-separator"> </span></li>
390	<li><a href="http://www.datenlandkarten.at/impressum/" title="Impressum"><span class="l"> </span><span class="r"> </span><span class="t">Impressum</span></a>
391	</li>
392</ul>
393            </div>
394<div class="art-content-layout">
395    <div class="art-content-layout-row">
396        <div class="art-layout-cell art-content">
397			
398
399
400<div class="art-post post-2 page type-page hentry" id="post-2">
401	    <div class="art-post-body">
402	            <div class="art-post-inner art-article">
403          <form action="input.php" method="post">
404
405
406        <h2 class="art-postheader">Datenlandkarte erstellen</h2>
407        <div class="art-postcontent">
408          <noscript>
409            <p>
410              Dieses Formular arbeitet mit Javascript. Bitte aktivieren
411              Sie Javascript in ihrem Browser, wenn möglich.
412            </p>
413          </noscript>
414          <p style="border:1px solid #000000;padding:10px;background:#e59a9a;margin-bottom:10px;font-size:1.3em;line-height:100%;">
415            <strong>Hinweis:</strong> <br/>
416            <span style="font-style:italic">
417              An diesem Feature wird derzeit noch gearbeitet &ndash;
418              bitte abonnieren Sie unseren
419              <a class="liexternal" target="_blank" href="http://feeds.feedburner.com/datenlandkarten">RSS-Feed</a> <br />
420              oder folgen Sie uns auf
421              <a class="liexternal" target="_blank"
422              href="http://twitter.com/datenlandkarten">Twitter</a>, um
423              über die Fertigstellung informiert zu werden!
424            </span>
425          </p>
426
427          <div id="cc_header">
428            <div id="cc_header_img">
429              <img src="img/cc.png" alt="Creative Commons" width="64">
430            </div>
431            <div id="cc_header_text">
432              <p>
433                <input type="checkbox" name="shareit" id="check_share"<?=$defaults['shareit']; ?>>
434                <strong><label for="check_share">
435                  Ja, ich möchte meine Daten öffentlich teilen.
436                </label></strong><br><br>
437
438                Ich stimme zu, dass ich die Daten zuverlässig gesammelt oder
439                aus einer verlässlichen Quelle gewonnen habe. Ebenso
440                bestätige ich im zweiteren Fall das Recht zu haben, die
441                gewonnenen Daten unter der Creative-Commons-Lizenz (XY)
442                weitergeben zu dürfen. Ich bin damit einverstanden, dass die
443                eingegebenen Daten langfristig gespeichert werden und der
444                Öffentlichkeit zugänglich bleiben.
445              </p>
446            </div>
447          </div>
448
449          <p>
450            Fehlende (leere) Angaben werden in der Graphik weiß dargestellt.
451          </p>
452
453<?php
454    // a stupid error handler
455    function o($msg) { echo '            <li>'.$msg."</li>\n"; }
456    if ($_POST && ($invalid || !is_array($data))) {
457?>
458          <p style="font-size:120%" class="error">Es traten Fehler auf:</p>
459          <ul>
460<?php
461        if ($invalid) {
462            foreach ($invalid as $field) {
463                if ($field == 'title')
464                    o('Invalider Titel-Parameter. Darf maximal '.
465                        '50 Zeichen lang sein');
466                if ($field == 'subtitle')
467                    o('Invalider Untertitel-Parameter. Darf maximal '.
468                        '120 Zeichen lang sein');
469                if ($field == 'fac')
470                    o('Hebefaktor darf nicht 0 sein.');
471                if ($field == 'dec')
472                    o('Anzahl der Nachkommastellen muss zwischen 0 '.
473                        'und 3 (inklusive) liegen');
474                if ($field == 'colors')
475                    o('Anzahl der Farben muss zwischen 2 und 10 '.
476                        '(inklusive) liegen');
477                if ($field == 'data')
478                    o('Bitte füllen Sie das Feld "Daten" aus');
479            }
480        } else {
481            $msg = _error_msg_for_data($data);
482            if ($msg !== false)
483            {
484                o(htmlspecialchars($msg, ENT_NOQUOTES));
485            }
486        }
487?>
488          </ul>
489<?php
490    }
491    // I am sorry for the following source code:
492?>
493
494          <table cellpadding="6">
495            <tr>
496              <td>Titel:</td>
497              <td><input type="text" maxlength="50" tabindex="1" name="title" value="<?=$defaults['title']; ?>"></td>
498            </tr>
499            <tr>
500              <td>Untertitel:</td>
501              <td><input type="text" maxlength="120" tabindex="2" name="subtitle" value="<?=$defaults['subtitle']; ?>"></td>
502            </tr>
503            <tr>
504              <td>Visualisierung:</td>
505              <td>
506<?php if ($defaults['vis'] === 'bl') { ?>
507                  <input type="radio" name="vis" value="bl" id="bls" checked="checked">
508                    <label for="bls">Bundesländer Österreichs</label> <br>
509<?php } else { ?>
510                  <input type="radio" name="vis" value="bl" id="bls">
511                    <label for="bls">Bundesländer Österreichs</label> <br>
512<?php } if ($defaults['vis'] === 'eu') { ?>
513                  <input type="radio" name="vis" value="eu" id="eu" checked="checked">
514                    <label for="eu">Europas Staaten</label> <br>
515<?php } else { ?>
516                  <input type="radio" name="vis" value="eu" id="eu">
517                    <label for="eu">Europas Staaten</label> <br>
518<?php } if ($defaults['vis'] === 'bz') { ?>
519                  <input type="radio" name="vis" value="bz" id="bz" checked="checked">
520                    <label for="bz">Bezirke</label> <br>
521<?php } else { ?>
522                  <input type="radio" name="vis" value="bz" id="bz">
523                    <label for="bz">Bezirke</label> <br>
524<?php } ?>
525                  <div id="bz_select" class="subselect">
526<?php if ($defaults['bz_spec'] === 'bl') { ?>
527                      <input type="radio" name="bz_spec" value="bl" id="bl" checked="checked">
528                        <label for="bl">eines Bundeslands</label> <br>
529<?php } else { ?>
530                      <input type="radio" name="bz_spec" value="bl" id="bl">
531                        <label for="bl">eines Bundeslands</label> <br>
532<?php } ?>
533                      <div id="bz_bl_select" class="subselect">
534<?php
535    foreach (get('bundeslaender') as $key => $bl) {
536        if ($defaults['bz_bl'] == $key)
537            $ch = ' checked="checked"';
538        else
539            $ch = '';
540?>
541                          <input type="radio" name="bz_bl" id="bz_bl<?=$key; ?>" value="<?=$key; ?>"<?=$ch; ?>>
542                            <label for="bz_bl<?=$key; ?>"><?=$bl; ?></label> <br>
543<?php } ?>
544                      </div>
545<?php if ($defaults['bz_spec'] === 'oe') { ?>
546                      <input type="radio" name="bz_spec" id="oe" value="oe" checked="checked">
547                        <label for="oe">von Österreich</label>
548<?php } else { ?>
549                      <input type="radio" name="bz_spec" id="oe" value="oe">
550                        <label for="oe">von Österreich</label>
551<?php } ?>
552                  </div>
553<?php if ($defaults['vis'] === 'gm') { ?>
554                  <input type="radio" name="vis" value="gm" id="gm" checked="checked">
555                    <label for="gm">Gemeinden</label> <br>
556<?php } else { ?>
557                  <input type="radio" name="vis" value="gm" id="gm">
558                    <label for="gm">Gemeinden</label> <br>
559<?php } ?>
560                  <div id="gm_select" class="subselect">
561<?php if ($defaults['gm_spec'] === 'bl') { ?>
562                      <input type="radio" name="gm_spec" id="gm_spec" value="bl" checked="checked">
563                        <label for="gm_spec">eines Bundeslands</label> <br>
564<?php } else { ?>
565                      <input type="radio" name="gm_spec" id="gm_spec" value="bl">
566                        <label for="gm_spec">eines Bundeslands</label> <br>
567<?php } ?>
568                      <div id="gm_bl_select" class="subselect">
569<?php
570    foreach (get('bundeslaender') as $key => $bl) {
571        if ($defaults['gm_bl'] == $key)
572            $ch = ' checked="checked"';
573        else
574            $ch = '';
575?>
576                          <input type="radio" name="gm_bl" id="gm_bl<?=$key; ?>" value="<?=$key; ?>"<?=$ch; ?>>
577                            <label for="gm_bl<?=$key; ?>"><?=$bl; ?></label> <br>
578<?php } ?>
579                      </div>
580<?php if ($defaults['gm_spec'] === 'oe') { ?>
581                      <input type="radio" name="gm_spec" id="gm_spec" value="oe" checked="checked">
582                        <label for="gm_spec">von Österreich</label>
583<?php } else { ?>
584                      <input type="radio" name="gm_spec" id="gm_spec" value="oe">
585                        <label for="gm_spec">von Österreich</label>
586<?php } ?>
587                  </div>
588                  <div id="svg_error" class="error"></div>
589              </td>
590            </tr>
591            <tr>
592              <td>Hebefaktor:</td>
593              <td><input type="text" name="fac" value="<?=$defaults['fac']; ?>"></td>
594            </tr>
595            <tr>
596              <td>Anzahl der Nachkommastellen (0-3):</td>
597              <td><input type="text" name="dec" maxlength="1" value="<?=$defaults['dec']; ?>"></td>
598            </tr>
599            <tr>
600              <td>Anzahl der Farben (2-10):</td>
601              <td><input type="text" name="colors" maxlength="2" value="<?=$defaults['colors']; ?>"></td>
602            </tr>
603            <tr>
604              <td>Farbrichtung:</td>
605              <td>
606                <select name="grad">
607<?php
608    foreach ($color_allocation as $key => $c)
609    {
610        if ($key == (int)$defaults['grad']) 
611            $ch = ' selected="selected"';
612        else
613            $ch = '';
614?>
615                  <option value="<?=$key; ?>"<?=$ch?>><?=$c; ?></option>
616<?php } ?>
617                </select>
618              </td>
619            </tr>
620            <tr>
621              <td colspan="2">
622                  <strong>Eingabeformat:</strong>
623                  <select name="format" id="format">
624<?php
625    $formats = array(
626        'manual' => 'Manuell', 'list' => 'Liste',
627        'json' => 'Javascript Object Notation (JSON)', 'kvalloc' => 'Schlüssel-Wert-Zuordnung'
628    );
629
630    foreach ($formats as $key => $f) {
631        if ($key === $defaults['format']) 
632            $ch = ' selected="selected"';
633        else
634            $ch = '';
635?>
636                    <option value="<?=$key; ?>"<?=$ch?>><?=htmlspecialchars($f, ENT_NOQUOTES); ?></option>
637<?php } ?>
638                  </select> <br>
639
640                  <strong>Daten:</strong><br>
641                  <div id="manual">
642                    <table cellpadding="6">
643<?php
644    $i = 1;
645    if (!$_POST)
646        $keys = get('bundeslaender');
647    foreach ($keys as $key => $bl) {
648?>
649                      <tr>
650                        <td><?=htmlspecialchars($bl, ENT_NOQUOTES); ?>:</td>
651                        <td><input type="text" name="manual<?=$key; ?>" value="<?=$defaults['manual'.($i++)]; ?>"></td>
652                      </tr>
653<?php } ?>
654                    </table>
655                  </div>
656                  <textarea name="data" rows="5" id="data_list"></textarea>
657                  <div id="list">
658                    Trennzeichen zwischen Datensätzen: (\n für Zeilenumbruch, \\ für Backslash)
659                    <input type="text" name="list_delim" value="<?=$defaults['list_delim']; ?>" size="1" style="float:right; height:15px">
660                  </div>
661                  <div id="kvalloc">
662                    Erstes Trennzeichen (zw. Schlüssel-Wert-Elementen) (\n für Zeilenumbruch, \\ für Backslash)
663                    <input type="text" name="kvalloc_delim1" value="<?=$defaults['kvalloc_delim1']; ?>" size="1" style="float:right; height: 15px"> <br>
664                    Zweites Trennzeichen (zw. Schlüssel und Wert)
665                    <input type="text" name="kvalloc_delim2" value="<?=$defaults['kvalloc_delim2']; ?>" size="1" style="float:right; height: 15px">
666                  </div>
667              </td>
668            </tr>
669            <tr>
670              <td>&nbsp;</td>
671              <td><input type="submit" id="submit" value="Erstellen"></td>
672            </tr>
673          </table>
674          </form>
675        </div>
676                    <div class="cleared"></div>
677                                    </div>
678            <div class="cleared"></div>
679        </div>
680    </div>
681
682
683          <div class="cleared"></div>
684        </div>
685</div>
686<div class="cleared"></div>
687    <div class="art-footer">
688                <div class="art-footer-t"></div>
689                <div class="art-footer-l"></div>
690                <div class="art-footer-b"></div>
691                <div class="art-footer-r"></div>
692                <div class="art-footer-body">
693
694
695                  <div class="art-footer-text">
696                      <p><div style="float:left;"><a href="http://www.open3.at" target="_blank" title="Webseite open3.at aufrufen"><img src="http://www.datenlandkarten.at/wp-content/uploads/open3logo.png" width="177" height="33"></a></div>
697<div style="float:right;text-align:right;"><a href="http://www.opendefinition.org/okd/deutsch/" target="_blank" title="Definition "Offenes Wissen" auf http://opendefinition.org/ anzeigen"><img src="http://www.datenlandkarten.at/wp-content/uploads/badge-od.png" width="80" height="15"> <img src="http://www.datenlandkarten.at/wp-content/uploads/badge-ok.png" width="80" height="15"> <img src="http://www.datenlandkarten.at/wp-content/uploads/badge-oc.png" width="80" height="15"></a><br/>
698<a href="/impressum" style="text-decoration:none;" title="Impressum anzeigen">Ein Projekt von open3, dem Netzwerk zur Förderung von openSociety, openGovernment und OpenData</a></p></div>                  </div>
699                    <div class="cleared"></div>
700                </div>
701            </div>
702            <div class="cleared"></div>
703        </div>
704    </div>
705    <div class="cleared"></div>
706    <p class="art-page-footer"></p>
707</div>
708    <div id="wp-footer">
709    </div>
710</body>
711</html>