diff --git a/ground/classes/Controller.php b/ground/classes/Controller.php index d53d630..d01a369 100644 --- a/ground/classes/Controller.php +++ b/ground/classes/Controller.php @@ -37,7 +37,10 @@ abstract class Controller return 'Template not found'; if ($return) + { $oldContentFormBuffer_temp = ob_get_clean(); + ob_start(); + } extract($data); @@ -46,6 +49,7 @@ abstract class Controller if ($return) { $newContentFormBuffer_temp = ob_get_clean(); + ob_start(); echo $oldContentFormBuffer_temp; return $newContentFormBuffer_temp; } @@ -76,6 +80,7 @@ abstract class Controller } else { echo $result; + return true; } } diff --git a/ground/controllers/IndexController.php b/ground/controllers/IndexController.php index 0bb351a..ed30b40 100644 --- a/ground/controllers/IndexController.php +++ b/ground/controllers/IndexController.php @@ -19,7 +19,7 @@ class IndexController extends Controller $category = new Category(); self::render('indexTemplate.php', array( - 'category' => $category->getAll(), + 'categories' => $category->getAll(), )); } diff --git a/ground/views/indexTemplate.php b/ground/views/indexTemplate.php index 644287b..0d32b60 100644 --- a/ground/views/indexTemplate.php +++ b/ground/views/indexTemplate.php @@ -23,3 +23,51 @@ + diff --git a/public/js/main.js b/public/js/main.js index 6e7a2a5..9f9e6a6 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -25,29 +25,10 @@ function init() { if (!myMap.balloon.isOpen()) { if ( $('#addPointButton').hasClass('btn-success') ) { - var coords = e.get('coordPosition'); - myMap.balloon.open(coords, { - contentHeader:'Добавление точки', - contentBody: - '
' + - '

Название:
' + - '

' + - '

URL изображения:
' + - '

' + - '

Описание:
' + - '

' + - '

Тип:
' + - '' + - '

Источник:
' + - '

' + - - '' + - '' + - '' + - '
' - }); + coords = e.get('coordPosition'); + $('#lat').val(coords[0].toPrecision(11)); + $('#lng').val(coords[1].toPrecision(11)); + $('#addPointModal').modal('show'); } } else {