Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
0354ea06ad
@ -1,5 +1,24 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Editor for Geometry data types.
|
||||
*
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
/**
|
||||
* Escapes special characters if the variable is set.
|
||||
* Returns an empty string otherwise.
|
||||
*
|
||||
* @param string $variable variable to be escaped
|
||||
*
|
||||
* @return escaped variable
|
||||
*/
|
||||
function escape($variable)
|
||||
{
|
||||
return isset($variable) ? htmlspecialchars($variable) : '';
|
||||
}
|
||||
|
||||
require_once 'libraries/common.inc.php';
|
||||
require_once 'libraries/gis/pma_gis_factory.php';
|
||||
require_once 'libraries/gis_visualization.lib.php';
|
||||
@ -82,16 +101,19 @@ if (isset($_REQUEST['generate']) && $_REQUEST['generate'] == true) {
|
||||
}
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
<form id="gis_data_editor_form" action="gis_data_editor.php" method="post">
|
||||
<input type="hidden" id="pmaThemeImage" value="<?php echo($GLOBALS['pmaThemeImage']); ?>" />
|
||||
<div id="gis_data_editor">
|
||||
<h3>
|
||||
<?php
|
||||
|
||||
echo '<form id="gis_data_editor_form" action="gis_data_editor.php" method="post">';
|
||||
echo '<input type="hidden" id="pmaThemeImage"'
|
||||
. ' value="' . $GLOBALS['pmaThemeImage'] . '" />';
|
||||
echo '<div id="gis_data_editor">';
|
||||
|
||||
echo '<h3>';
|
||||
printf(
|
||||
__('Value for the column "%s"'), htmlspecialchars($_REQUEST['field'])
|
||||
__('Value for the column "%s"'),
|
||||
htmlspecialchars($_REQUEST['field'])
|
||||
);
|
||||
echo '</h3>';
|
||||
|
||||
echo '<input type="hidden" name="field" value="'
|
||||
. htmlspecialchars($_REQUEST['field']) . '" />';
|
||||
// The input field to which the final result should be added
|
||||
@ -101,40 +123,32 @@ if (isset($_REQUEST['input_name'])) {
|
||||
. htmlspecialchars($_REQUEST['input_name']) . '" />';
|
||||
}
|
||||
echo PMA_generate_common_hidden_inputs();
|
||||
?>
|
||||
<!-- Visualization section -->
|
||||
<div id="placeholder" style="width:450px;height:300px;
|
||||
<?php
|
||||
if ($srid != 0) {
|
||||
echo 'display:none;';
|
||||
}
|
||||
echo '">' . $visualization;
|
||||
?> </div>
|
||||
<div id="openlayersmap" style="width:450px;height:300px;
|
||||
<?php
|
||||
if ($srid == 0) {
|
||||
echo 'display:none;';
|
||||
}
|
||||
?> ">
|
||||
</div>
|
||||
<div class="choice" style="float:right;clear:right;">
|
||||
<input type="checkbox" id="choice" value="useBaseLayer"
|
||||
<?php
|
||||
if ($srid != 0) {
|
||||
echo ' checked="checked"';
|
||||
}
|
||||
?> />
|
||||
<label for="choice"><?php echo __("Use OpenStreetMaps as Base Layer"); ?></label>
|
||||
</div>
|
||||
<script language="javascript" type="text/javascript">
|
||||
<?php echo($open_layers); ?>
|
||||
</script>
|
||||
<!-- End of visualization section -->
|
||||
|
||||
<!-- Header section - Inclueds GIS type selector and input field for SRID -->
|
||||
<div id="gis_data_header">
|
||||
<select name="gis_data[gis_type]" class="gis_type">
|
||||
<?php
|
||||
echo '<!-- Visualization section -->';
|
||||
echo '<div id="placeholder" style="width:450px;height:300px;'
|
||||
. ($srid != 0 ? 'display:none;' : '') . '">';
|
||||
echo $visualization;
|
||||
echo '</div>';
|
||||
|
||||
echo '<div id="openlayersmap" style="width:450px;height:300px;'
|
||||
. ($srid == 0 ? 'display:none;' : '') . '">';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="choice" style="float:right;clear:right;">';
|
||||
echo '<input type="checkbox" id="choice" value="useBaseLayer"'
|
||||
. ($srid != 0 ? ' checked="checked"' : '') . '/>';
|
||||
echo '<label for="choice">' . __("Use OpenStreetMaps as Base Layer") . '</label>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<script language="javascript" type="text/javascript">';
|
||||
echo $open_layers;
|
||||
echo '</script>';
|
||||
echo '<!-- End of visualization section -->';
|
||||
|
||||
|
||||
echo '<!-- Header section - Inclueds GIS type selector and input field for SRID -->';
|
||||
echo '<div id="gis_data_header">';
|
||||
echo '<select name="gis_data[gis_type]" class="gis_type">';
|
||||
foreach ($gis_types as $gis_type) {
|
||||
echo '<option value="' . $gis_type . '"';
|
||||
if ($geom_type == $gis_type) {
|
||||
@ -142,16 +156,16 @@ foreach ($gis_types as $gis_type) {
|
||||
}
|
||||
echo '>' . $gis_type . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<label for="srid"><?php echo __("SRID"); ?>: </label>
|
||||
<input name="gis_data[srid]" type="text" value="<?php echo($srid); ?>" />
|
||||
</div>
|
||||
<!-- End of header section -->
|
||||
echo '</select>';
|
||||
echo ' ';
|
||||
echo '<label for="srid">' . __("SRID") . ':</label>';
|
||||
echo '<input name="gis_data[srid]" type="text" value="' . $srid . '" />';
|
||||
echo '</div>';
|
||||
echo '<!-- End of header section -->';
|
||||
|
||||
echo '<!-- Data section -->';
|
||||
echo '<div id="gis_data">';
|
||||
|
||||
<!-- Data section -->
|
||||
<div id="gis_data">
|
||||
<?php
|
||||
$geom_count = 1;
|
||||
if ($geom_type == 'GEOMETRYCOLLECTION') {
|
||||
$geom_count = (isset($gis_data[$geom_type]['geom_count']))
|
||||
@ -160,36 +174,43 @@ if ($geom_type == 'GEOMETRYCOLLECTION') {
|
||||
$geom_count++;
|
||||
}
|
||||
echo '<input type="hidden" name="gis_data[GEOMETRYCOLLECTION][geom_count]"'
|
||||
. ' value="' . $geom_count . '">';
|
||||
. ' value="' . $geom_count . '" />';
|
||||
}
|
||||
|
||||
for ($a = 0; $a < $geom_count; $a++) {
|
||||
|
||||
if ($geom_type == 'GEOMETRYCOLLECTION') {
|
||||
echo('<br/><br/>'); echo __("Geometry"); echo($a + 1 . ':<br/>');
|
||||
echo '<br/><br/>';
|
||||
echo __("Geometry") . ' ' . ($a + 1) . ': ';
|
||||
echo '<br/>';
|
||||
if (isset($gis_data[$a]['gis_type'])) {
|
||||
$type = $gis_data[$a]['gis_type'];
|
||||
} else {
|
||||
$type = $gis_types[0];
|
||||
}
|
||||
echo('<select name="gis_data[' . $a . '][gis_type]" class="gis_type">');
|
||||
echo '<select name="gis_data[' . $a . '][gis_type]" class="gis_type">';
|
||||
foreach (array_slice($gis_types, 0, 6) as $gis_type) {
|
||||
echo('<option value="' . $gis_type . '"');
|
||||
echo '<option value="' . $gis_type . '"';
|
||||
if ($type == $gis_type) {
|
||||
echo(' selected="selected"');
|
||||
echo ' selected="selected"';
|
||||
}
|
||||
echo('>' . $gis_type . '</option>');
|
||||
echo '>' . $gis_type . '</option>';
|
||||
}
|
||||
echo('</select>');
|
||||
echo '</select>';
|
||||
} else {
|
||||
$type = $geom_type;
|
||||
}
|
||||
|
||||
if ($type == 'POINT') {
|
||||
echo('<br/>'); echo __("Point"); echo(' :');
|
||||
?> <label for="x"><?php echo __("X"); ?></label>
|
||||
<input name="gis_data[<?php echo($a); ?>][POINT][x]" type="text" value="<?php echo(isset($gis_data[$a]['POINT']['x']) ? htmlspecialchars($gis_data[$a]['POINT']['x']) : ''); ?>" />
|
||||
<label for="y"><?php echo __("Y"); ?></label>
|
||||
<input name="gis_data[<?php echo($a); ?>][POINT][y]" type="text" value="<?php echo(isset($gis_data[$a]['POINT']['y']) ? htmlspecialchars($gis_data[$a]['POINT']['y']) : ''); ?>" />
|
||||
<?php
|
||||
echo '<br/>';
|
||||
echo __("Point") . ': ';
|
||||
echo '<label for="x">' . __("X") . '</label>';
|
||||
echo '<input name="gis_data[' . $a . '][POINT][x]" type="text"'
|
||||
. ' value="' . escape($gis_data[$a]['POINT']['x']) . '" />';
|
||||
echo '<label for="y">' . __("Y") . '</label>';
|
||||
echo '<input name="gis_data[' . $a . '][POINT][y]" type="text"'
|
||||
. ' value="' . escape($gis_data[$a]['POINT']['y']) . '" />';
|
||||
|
||||
} elseif ($type == 'MULTIPOINT' || $type == 'LINESTRING') {
|
||||
$no_of_points = isset($gis_data[$a][$type]['no_of_points'])
|
||||
? $gis_data[$a][$type]['no_of_points'] : 1;
|
||||
@ -203,22 +224,26 @@ for ($a = 0; $a < $geom_count; $a++) {
|
||||
if (isset($gis_data[$a][$type]['add_point'])) {
|
||||
$no_of_points++;
|
||||
}
|
||||
echo('<input type="hidden" name="gis_data[' . $a . '][' . $type
|
||||
. '][no_of_points]" value="' . $no_of_points . '">');
|
||||
echo '<input type="hidden" value="' . $no_of_points . '"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][no_of_points]" />';
|
||||
|
||||
for ($i = 0; $i < $no_of_points; $i++) {
|
||||
echo '<br/>';
|
||||
printf(__('Point %d'), $i + 1);
|
||||
echo ':';
|
||||
?> <label for="x"><?php echo __("X"); ?></label>
|
||||
<input type="text" name="gis_data[<?php echo($a); ?>][<?php echo($type); ?>][<?php echo($i); ?>][x]" value="<?php echo(isset($gis_data[$a][$type][$i]['x']) ? htmlspecialchars($gis_data[$a][$type][$i]['x']) : ''); ?>" />
|
||||
<label for="y"><?php echo __("Y"); ?></label>
|
||||
<input type="text" name="gis_data[<?php echo($a); ?>][<?php echo($type); ?>][<?php echo($i); ?>][y]" value="<?php echo(isset($gis_data[$a][$type][$i]['y']) ? htmlspecialchars($gis_data[$a][$type][$i]['y']) : ''); ?>" />
|
||||
<?php
|
||||
echo ': ';
|
||||
echo '<label for="x">' . __("X") . '</label>';
|
||||
echo '<input type="text"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][' . $i . '][x]"'
|
||||
. ' value="' . escape($gis_data[$a][$type][$i]['x']) . '" />';
|
||||
echo '<label for="y">' . __("Y") . '</label>';
|
||||
echo '<input type="text"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][' . $i . '][y]"'
|
||||
. ' value="' . escape($gis_data[$a][$type][$i]['y']). '" />';
|
||||
}
|
||||
?>
|
||||
<input type="submit" name="gis_data[<?php echo($a); ?>][<?php echo($type); ?>][add_point]" class="add addPoint" value="<?php echo __("Add a point"); ?>">
|
||||
<?php
|
||||
echo '<input type="submit"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][add_point]"'
|
||||
. ' class="add addPoint" value="' . __("Add a point") . '" />';
|
||||
|
||||
} elseif ($type == 'MULTILINESTRING' || $type == 'POLYGON') {
|
||||
$no_of_lines = isset($gis_data[$a][$type]['no_of_lines'])
|
||||
? $gis_data[$a][$type]['no_of_lines'] : 1;
|
||||
@ -228,18 +253,18 @@ for ($a = 0; $a < $geom_count; $a++) {
|
||||
if (isset($gis_data[$a][$type]['add_line'])) {
|
||||
$no_of_lines++;
|
||||
}
|
||||
echo '<input type="hidden" name="gis_data[' . $a . '][' . $type
|
||||
. '][no_of_lines]" value="' . $no_of_lines . '">';
|
||||
echo '<input type="hidden" value="' . $no_of_lines . '"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][no_of_lines]" />';
|
||||
|
||||
for ($i = 0; $i < $no_of_lines; $i++) {
|
||||
echo '<br/>';
|
||||
if ($type == 'MULTILINESTRING') {
|
||||
echo __("Linestring"); echo ($i + 1) . ':';
|
||||
echo __("Linestring") . ' ' . ($i + 1) . ':';
|
||||
} else {
|
||||
if ($i == 0) {
|
||||
echo __("Outer Ring") . ':';
|
||||
} else {
|
||||
echo __("Inner Ring"); echo $i . ':';
|
||||
echo __("Inner Ring") . ' ' . $i . ':';
|
||||
}
|
||||
}
|
||||
|
||||
@ -254,26 +279,34 @@ for ($a = 0; $a < $geom_count; $a++) {
|
||||
if (isset($gis_data[$a][$type][$i]['add_point'])) {
|
||||
$no_of_points++;
|
||||
}
|
||||
echo '<input type="hidden" name="gis_data[' . $a . '][' . $type
|
||||
. '][' . $i . '][no_of_points]" value="' . $no_of_points . '">';
|
||||
echo '<input type="hidden" value="' . $no_of_points . '"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][' . $i . '][no_of_points]" />';
|
||||
|
||||
for ($j = 0; $j < $no_of_points; $j++) {
|
||||
echo('<br/>');
|
||||
printf(__('Point %d'), $j + 1);
|
||||
echo ':';
|
||||
?> <label for="x"><?php echo __("X"); ?></label>
|
||||
<input type="text" name="gis_data[<?php echo($a); ?>][<?php echo($type); ?>][<?php echo($i); ?>][<?php echo($j); ?>][x]" value="<?php echo(isset($gis_data[$a][$type][$i][$j]['x']) ? htmlspecialchars($gis_data[$a][$type][$i][$j]['x']) : ''); ?>" />
|
||||
<label for="y"><?php echo __("Y"); ?></label>
|
||||
<input type="text" name="gis_data[<?php echo($a); ?>][<?php echo($type); ?>][<?php echo($i); ?>][<?php echo($j); ?>][y]" value="<?php echo(isset($gis_data[$a][$type][$i][$j]['x']) ? htmlspecialchars($gis_data[$a][$type][$i][$j]['y']) : ''); ?>" />
|
||||
<?php
|
||||
echo ': ';
|
||||
echo '<label for="x">' . __("X") . '</label>';
|
||||
echo '<input type="text"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][' . $i . '][' . $j . '][x]"'
|
||||
. ' value="' . escape($gis_data[$a][$type][$i][$j]['x']) . '" />';
|
||||
echo '<label for="y">' . __("Y") . '</label>';
|
||||
echo '<input type="text"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][' . $i . '][' . $j . '][y]"'
|
||||
. ' value="' . escape($gis_data[$a][$type][$i][$j]['x']) . '" />';
|
||||
}
|
||||
?> <input type="submit" name="gis_data[<?php echo($a); ?>][<?php echo($type); ?>][<?php echo($i); ?>][add_point]" class="add addPoint" value="<?php echo __("Add a point"); ?>">
|
||||
<?php
|
||||
echo '<input type="submit"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][' . $i . '][add_point]"'
|
||||
. ' class="add addPoint" value="' . __("Add a point") . '" />';
|
||||
}
|
||||
$caption = ($type == 'MULTILINESTRING')
|
||||
? __('Add a linestring') : __('Add an inner ring');
|
||||
?> <br/><input type="submit" name="gis_data[<?php echo($a); ?>][<?php echo($type); ?>][add_line]" class="add addLine" value="<?php echo($caption); ?>">
|
||||
<?php
|
||||
? __('Add a linestring')
|
||||
: __('Add an inner ring');
|
||||
echo '<br/>';
|
||||
echo '<input type="submit"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][add_line]"'
|
||||
. ' class="add addLine" value="' . $caption . '" />';
|
||||
|
||||
} elseif ($type == 'MULTIPOLYGON') {
|
||||
$no_of_polygons = isset($gis_data[$a][$type]['no_of_polygons'])
|
||||
? $gis_data[$a][$type]['no_of_polygons'] : 1;
|
||||
@ -283,11 +316,13 @@ for ($a = 0; $a < $geom_count; $a++) {
|
||||
if (isset($gis_data[$a][$type]['add_polygon'])) {
|
||||
$no_of_polygons++;
|
||||
}
|
||||
echo('<input type="hidden" name="gis_data[' . $a . '][' . $type
|
||||
. '][no_of_polygons]" value="' . $no_of_polygons . '">');
|
||||
echo '<input type="hidden"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][no_of_polygons]"'
|
||||
. ' value="' . $no_of_polygons . '" />';
|
||||
|
||||
for ($k = 0; $k < $no_of_polygons; $k++) {
|
||||
echo('<br/>'); echo __("Polygon"); echo($k + 1 . ':');
|
||||
echo '<br/>';
|
||||
echo __("Polygon") . ' ' . ($k + 1) . ':';
|
||||
$no_of_lines = isset($gis_data[$a][$type][$k]['no_of_lines'])
|
||||
? $gis_data[$a][$type][$k]['no_of_lines'] : 1;
|
||||
if ($no_of_lines < 1) {
|
||||
@ -296,15 +331,16 @@ for ($a = 0; $a < $geom_count; $a++) {
|
||||
if (isset($gis_data[$a][$type][$k]['add_line'])) {
|
||||
$no_of_lines++;
|
||||
}
|
||||
echo('<input type="hidden" name="gis_data[' . $a . '][' . $type
|
||||
. '][' . $k . '][no_of_lines]" value="' . $no_of_lines . '">');
|
||||
echo '<input type="hidden"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][' . $k . '][no_of_lines]"'
|
||||
. ' value="' . $no_of_lines . '" />';
|
||||
|
||||
for ($i = 0; $i < $no_of_lines; $i++) {
|
||||
echo('<br/><br/>');
|
||||
echo '<br/><br/>';
|
||||
if ($i == 0) {
|
||||
echo __("Outer Ring") . ':';
|
||||
} else {
|
||||
echo __("Inner Ring"); echo($i . ':');
|
||||
echo __("Inner Ring") . ' ' . $i . ':';
|
||||
}
|
||||
|
||||
$no_of_points = isset($gis_data[$a][$type][$k][$i]['no_of_points'])
|
||||
@ -315,54 +351,65 @@ for ($a = 0; $a < $geom_count; $a++) {
|
||||
if (isset($gis_data[$a][$type][$k][$i]['add_point'])) {
|
||||
$no_of_points++;
|
||||
}
|
||||
echo('<input type="hidden" name="gis_data[' . $a . '][' . $type
|
||||
. '][' . $k . '][' . $i . '][no_of_points]" value="'
|
||||
. $no_of_points . '">');
|
||||
echo '<input type="hidden"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][' . $k . '][' . $i . '][no_of_points]"'
|
||||
. ' value="' . $no_of_points . '" />';
|
||||
|
||||
for ($j = 0; $j < $no_of_points; $j++) {
|
||||
echo('<br/>');
|
||||
echo '<br/>';
|
||||
printf(__('Point %d'), $j + 1);
|
||||
echo ':';
|
||||
?> <label for="x"><?php echo __("X"); ?></label>
|
||||
<input type="text" name="<?php echo("gis_data[" . $a . "][" . $type . "][" . $k . "][" . $i . "][" . $j . "][x]"); ?>" value="<?php echo(isset($gis_data[$a][$type][$k][$i][$j]['x']) ? htmlspecialchars($gis_data[$a][$type][$k][$i][$j]['x']) : ''); ?>" />
|
||||
<label for="y"><?php echo __("Y"); ?></label>
|
||||
<input type="text" name="<?php echo("gis_data[" . $a . "][" . $type . "][" . $k . "][" . $i . "][" . $j . "][y]"); ?>" value="<?php echo(isset($gis_data[$a][$type][$k][$i][$j]['y']) ? htmlspecialchars($gis_data[$a][$type][$k][$i][$j]['y']) : ''); ?>" />
|
||||
<?php
|
||||
echo ': ';
|
||||
echo '<label for="x">' . __("X") . '</label>';
|
||||
echo '<input type="text"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][' . $k . '][' . $i . '][' . $j . '][x]"'
|
||||
. ' value="' . escape($gis_data[$a][$type][$k][$i][$j]['x']). '" />';
|
||||
echo '<label for="y">' . __("Y") . '</label>';
|
||||
echo '<input type="text"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][' . $k . '][' . $i . '][' . $j . '][y]"'
|
||||
. ' value="' . escape($gis_data[$a][$type][$k][$i][$j]['y']) . '" />';
|
||||
}
|
||||
?> <input type="submit" name="<?php echo("gis_data[" . $a . "][" . $type . "][" . $k . "][" . $i . "][add_point]"); ?>" class="add addPoint" value="<?php echo __("Add a point"); ?>">
|
||||
<?php
|
||||
echo '<input type="submit"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][' . $k . '][' . $i . '][add_point]"'
|
||||
. ' class="add addPoint" value="' . __("Add a point") . '" />';
|
||||
}
|
||||
?> <br/><input type="submit" name="<?php echo("gis_data[" . $a . "][" . $type . "][" . $k . "][add_line]"); ?>" class="add addLine" value="<?php echo __('Add an inner ring') ?>"><br/>
|
||||
<?php
|
||||
echo '<br/>';
|
||||
echo '<input type="submit"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][' . $k . '][add_line]"'
|
||||
. ' class="add addLine" value="' . __('Add an inner ring'). '" />';
|
||||
echo '<br/>';
|
||||
}
|
||||
?> <br/><input type="submit" name="<?php echo("gis_data[" . $a . "][" . $type . "][add_polygon]"); ?>" class="add addPolygon" value="<?php echo __('Add a polygon') ?>">
|
||||
<?php
|
||||
echo '<br/>';
|
||||
echo '<input type="submit"'
|
||||
. ' name="gis_data[' . $a . '][' . $type . '][add_polygon]"'
|
||||
. ' class="add addPolygon" value="' . __('Add a polygon') . '" />';
|
||||
}
|
||||
}
|
||||
if ($geom_type == 'GEOMETRYCOLLECTION') {
|
||||
?> <br/><br/><input type="submit" name="gis_data[GEOMETRYCOLLECTION][add_geom]" class="add addGeom" value="<?php echo __("Add geometry"); ?>" />
|
||||
<?php
|
||||
echo '<br/><br/>';
|
||||
echo '<input type="submit" name="gis_data[GEOMETRYCOLLECTION][add_geom]"'
|
||||
. 'class="add addGeom" value="' . __("Add geometry") . '" />';
|
||||
}
|
||||
?> </div>
|
||||
<!-- End of data section -->
|
||||
echo '</div>';
|
||||
echo '<!-- End of data section -->';
|
||||
|
||||
<br/><input type="submit" name="gis_data[save]" value="<?php echo __('Go') ?>">
|
||||
<div id="gis_data_output">
|
||||
<h3><?php echo __('Output'); ?></h3>
|
||||
<p><?php
|
||||
echo '<br/>';
|
||||
echo '<input type="submit" name="gis_data[save]" value="' . __('Go') . '" />';
|
||||
|
||||
echo '<div id="gis_data_output">';
|
||||
echo '<h3>' . __('Output') . '</h3>';
|
||||
echo '<p>';
|
||||
echo __(
|
||||
'Choose "GeomFromText" from the "Function" column and paste the'
|
||||
. ' string below into the "Value" field'
|
||||
);
|
||||
?></p>
|
||||
<textarea id="gis_data_textarea" cols="95" rows="5">
|
||||
<?php
|
||||
);
|
||||
echo '</p>';
|
||||
echo '<textarea id="gis_data_textarea" cols="95" rows="5">';
|
||||
echo $result;
|
||||
?> </textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
echo '</textarea>';
|
||||
echo '</div>';
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
PMA_Response::getInstance()->addJSON('gis_editor', ob_get_contents());
|
||||
ob_end_clean();
|
||||
|
||||
@ -56,10 +56,10 @@ function prepareJSVersion() {
|
||||
* @returns the HTML for a data point
|
||||
*/
|
||||
function addDataPoint(pointNumber, prefix) {
|
||||
return '<br>' + $.sprintf(PMA_messages['strPointN'], (pointNumber + 1)) + ':'
|
||||
+ '<label for="x"> ' + PMA_messages['strX'] + ' </label>'
|
||||
return '<br>' + $.sprintf(PMA_messages['strPointN'], (pointNumber + 1)) + ': '
|
||||
+ '<label for="x">' + PMA_messages['strX'] + '</label>'
|
||||
+ '<input type="text" name="' + prefix + '[' + pointNumber + '][x]" value="">'
|
||||
+ '<label for="y"> ' + PMA_messages['strY'] + ' </label>'
|
||||
+ '<label for="y">' + PMA_messages['strY'] + '</label>'
|
||||
+ '<input type="text" name="' + prefix + '[' + pointNumber + '][y]" value="">';
|
||||
}
|
||||
|
||||
@ -300,10 +300,10 @@ $(function() {
|
||||
// Add the new linesting of inner ring based on the type
|
||||
var html = '<br>';
|
||||
if (type == 'MULTILINESTRING') {
|
||||
html += PMA_messages['strLineString'] + (noOfLines + 1) + ':';
|
||||
html += PMA_messages['strLineString'] + ' ' + (noOfLines + 1) + ':';
|
||||
var noOfPoints = 2;
|
||||
} else {
|
||||
html += PMA_messages['strInnerRing'] + noOfLines + ':';
|
||||
html += PMA_messages['strInnerRing'] + ' ' + noOfLines + ':';
|
||||
var noOfPoints = 4;
|
||||
}
|
||||
html += '<input type="hidden" name="' + prefix + '[' + noOfLines + '][no_of_points]" value="' + noOfPoints + '">';
|
||||
@ -330,7 +330,7 @@ $(function() {
|
||||
var noOfPolygons = parseInt($noOfPolygonsInput.val());
|
||||
|
||||
// Add the new polygon
|
||||
var html = PMA_messages['strPolygon'] + (noOfPolygons + 1) + ':<br>';
|
||||
var html = PMA_messages['strPolygon'] + ' ' + (noOfPolygons + 1) + ':<br>';
|
||||
html += '<input type="hidden" name="' + prefix + '[' + noOfPolygons + '][no_of_lines]" value="1">';
|
||||
+ '<br>' + PMA_messages['strOuterRing'] + ':';
|
||||
+ '<input type="hidden" name="' + prefix + '[' + noOfPolygons + '][0][no_of_points]" value="4">';
|
||||
@ -356,7 +356,7 @@ $(function() {
|
||||
var $noOfGeomsInput = $("input[name='" + prefix + "[geom_count]" + "']");
|
||||
var noOfGeoms = parseInt($noOfGeomsInput.val());
|
||||
|
||||
var html1 = PMA_messages['strGeometry'] + (noOfGeoms + 1) + ':<br>';
|
||||
var html1 = PMA_messages['strGeometry'] + ' ' + (noOfGeoms + 1) + ':<br>';
|
||||
var $geomType = $("select[name='gis_data[" + (noOfGeoms - 1) + "][gis_type]']").clone();
|
||||
$geomType.attr('name', 'gis_data[' + noOfGeoms + '][gis_type]').val('POINT');
|
||||
var html2 = '<br>' + PMA_messages['strPoint'] + ' :'
|
||||
|
||||
@ -410,8 +410,7 @@ class PMA_Message
|
||||
/**
|
||||
* set string (does not take effect if raw message is set)
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @param string $string
|
||||
* @param boolean $sanitize whether to sanitize $string or not
|
||||
*
|
||||
* @return void
|
||||
@ -427,7 +426,7 @@ class PMA_Message
|
||||
/**
|
||||
* set message type number
|
||||
*
|
||||
* @param integer $number
|
||||
* @param integer $number message type number to set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@ -162,6 +162,7 @@ class PMA_Drizzle extends Drizzle
|
||||
* Wrapper around DrizzleCon class
|
||||
*
|
||||
* Its main task is to wrap results with PMA_DrizzleResult class
|
||||
*
|
||||
* @package PhpMyAdmin-DBI
|
||||
* @subpackage Drizzle
|
||||
*/
|
||||
@ -183,6 +184,8 @@ class PMA_DrizzleCon
|
||||
* Constructor
|
||||
*
|
||||
* @param DrizzleCon $dcon
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(DrizzleCon $dcon)
|
||||
{
|
||||
@ -258,6 +261,7 @@ class PMA_DrizzleCon
|
||||
*
|
||||
* Allows for reading result rows as an associative array and hides complexity
|
||||
* behind buffering.
|
||||
*
|
||||
* @package PhpMyAdmin-DBI
|
||||
* @subpackage Drizzle
|
||||
*/
|
||||
@ -313,6 +317,8 @@ class PMA_DrizzleResult
|
||||
* Sets fetch mode
|
||||
*
|
||||
* @param int $fetchMode
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setFetchMode($fetchMode)
|
||||
{
|
||||
@ -323,6 +329,8 @@ class PMA_DrizzleResult
|
||||
/**
|
||||
* Reads information about columns contained in current result
|
||||
* set into {@see $columns} and {@see $columnNames} arrays
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function _readColumns()
|
||||
{
|
||||
@ -372,6 +380,8 @@ class PMA_DrizzleResult
|
||||
*
|
||||
* @param mixed &$row
|
||||
* @param int $fetchMode
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function _transformResultRow(&$row, $fetchMode)
|
||||
{
|
||||
@ -479,6 +489,8 @@ class PMA_DrizzleResult
|
||||
|
||||
/**
|
||||
* Frees resources taken by this result
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function free()
|
||||
{_dlog();
|
||||
|
||||
@ -287,7 +287,7 @@ function PMA_DBI_next_result()
|
||||
/**
|
||||
* Returns a string representing the type of connection used
|
||||
*
|
||||
* @param PMA_DrizzleCon $link connection object
|
||||
* @param PMA_DrizzleCon $link connection object
|
||||
*
|
||||
* @return string type of connection used
|
||||
*/
|
||||
@ -310,7 +310,7 @@ function PMA_DBI_get_host_info($link = null)
|
||||
/**
|
||||
* Returns the version of the Drizzle protocol used
|
||||
*
|
||||
* @param PMA_DrizzleCon $link connection object
|
||||
* @param PMA_DrizzleCon $link connection object
|
||||
*
|
||||
* @return int version of the Drizzle protocol used
|
||||
*/
|
||||
@ -329,6 +329,7 @@ function PMA_DBI_get_proto_info($link = null)
|
||||
|
||||
/**
|
||||
* returns a string that represents the client library version
|
||||
*
|
||||
* @return string Drizzle client library version
|
||||
*/
|
||||
function PMA_DBI_get_client_info()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user