Новая всплывайка доюбавления точки, фикс ошибки с буфером вывода
This commit is contained in:
parent
b4b0d690b4
commit
d708e69649
|
|
@ -37,7 +37,10 @@ abstract class Controller
|
||||||
return 'Template not found';
|
return 'Template not found';
|
||||||
|
|
||||||
if ($return)
|
if ($return)
|
||||||
|
{
|
||||||
$oldContentFormBuffer_temp = ob_get_clean();
|
$oldContentFormBuffer_temp = ob_get_clean();
|
||||||
|
ob_start();
|
||||||
|
}
|
||||||
|
|
||||||
extract($data);
|
extract($data);
|
||||||
|
|
||||||
|
|
@ -46,6 +49,7 @@ abstract class Controller
|
||||||
if ($return)
|
if ($return)
|
||||||
{
|
{
|
||||||
$newContentFormBuffer_temp = ob_get_clean();
|
$newContentFormBuffer_temp = ob_get_clean();
|
||||||
|
ob_start();
|
||||||
echo $oldContentFormBuffer_temp;
|
echo $oldContentFormBuffer_temp;
|
||||||
return $newContentFormBuffer_temp;
|
return $newContentFormBuffer_temp;
|
||||||
}
|
}
|
||||||
|
|
@ -76,6 +80,7 @@ abstract class Controller
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
echo $result;
|
echo $result;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ class IndexController extends Controller
|
||||||
$category = new Category();
|
$category = new Category();
|
||||||
|
|
||||||
self::render('indexTemplate.php', array(
|
self::render('indexTemplate.php', array(
|
||||||
'category' => $category->getAll(),
|
'categories' => $category->getAll(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,3 +23,51 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="modal fade" id="addPointModal" tabindex="-1" role="dialog" aria-labelledby="Добавление новой точки" aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
<h4 class="modal-title" id="myModalLabel">Добавление новой точки</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form method="POST" action="/json/addpoint/" id="addPointForm">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="name">Название</label>
|
||||||
|
<input type="text" id="name" name="name" class="form-control" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="img">URL изображения</label>
|
||||||
|
<input type="text" id="img" name="img" class="form-control" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="description">Описание</label>
|
||||||
|
<textarea id="description" name="description" class="form-control"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="categoryId">Тип</label>
|
||||||
|
<select id="categoryId" name="categoryId" class="form-control">
|
||||||
|
<?php foreach ($categories as $category): ?>
|
||||||
|
<option value="<?=$category['id']?>"><?=$category['name']?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="source">Источник</label>
|
||||||
|
<input type="text" id="source" name="source" class="form-control" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="hidden" id="lat" name="lat" value="'+coords[0].toPrecision(11)+'" />
|
||||||
|
<input type="hidden" id="lng" name="lng" value="'+coords[1].toPrecision(11)+'" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Отмена</button>
|
||||||
|
<button type="button" class="btn btn-primary" onclick="$('#addPointForm').submit();">Сохранить</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -25,29 +25,10 @@ function init() {
|
||||||
if (!myMap.balloon.isOpen()) {
|
if (!myMap.balloon.isOpen()) {
|
||||||
if ( $('#addPointButton').hasClass('btn-success') )
|
if ( $('#addPointButton').hasClass('btn-success') )
|
||||||
{
|
{
|
||||||
var coords = e.get('coordPosition');
|
coords = e.get('coordPosition');
|
||||||
myMap.balloon.open(coords, {
|
$('#lat').val(coords[0].toPrecision(11));
|
||||||
contentHeader:'Добавление точки',
|
$('#lng').val(coords[1].toPrecision(11));
|
||||||
contentBody:
|
$('#addPointModal').modal('show');
|
||||||
'<form method="POST" action="/json/addpoint/" width="400px" height="300px">' +
|
|
||||||
'<p>Название:<br/>' +
|
|
||||||
'<input type="text" id="name" name="name" /></p>' +
|
|
||||||
'<p>URL изображения:<br/>' +
|
|
||||||
'<input type="text" id="img" name="img" /></p>' +
|
|
||||||
'<p>Описание:<br/>' +
|
|
||||||
'<textarea id="description" name="description"></textarea></p>' +
|
|
||||||
'<p>Тип:<br/>' +
|
|
||||||
'<select id="categoryId" name="categoryId">' +
|
|
||||||
categories +
|
|
||||||
'</select>' +
|
|
||||||
'<p>Источник:<br/>' +
|
|
||||||
'<input type="text" id="source" name="source" /></p>' +
|
|
||||||
|
|
||||||
'<input type="hidden" id="lat" name="lat" value="'+coords[0].toPrecision(11)+'" />' +
|
|
||||||
'<input type="hidden" id="lng" name="lng" value="'+coords[1].toPrecision(11)+'" />' +
|
|
||||||
'<input type="submit" id="add" onclick="addNewPoint()" value="Добавить">' +
|
|
||||||
'</form>'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue