diff --git a/ground/controllers/JsonController.php b/ground/controllers/JsonController.php index 759d9c1..b1270c7 100644 --- a/ground/controllers/JsonController.php +++ b/ground/controllers/JsonController.php @@ -183,6 +183,9 @@ class JsonController extends Controller 'ord' => $key, )); Image::createAllSizes($photo); + if ($ordering[$key] == 'FILE') { + PhotoLinks::addLink($photo, $_POST['photoLinks'][$key]); + } } $point = Point::model()->getByPK($id); diff --git a/ground/views/modals/addPoint.php b/ground/views/modals/addPoint.php index 5817901..061e7f4 100644 --- a/ground/views/modals/addPoint.php +++ b/ground/views/modals/addPoint.php @@ -64,6 +64,7 @@
+
@@ -100,7 +101,8 @@ { $('.ordering', container).val('FILE'); $('.ico span', container).removeClass('glyphicon-link').addClass('glyphicon-paperclip'); - $('.form-control', container).attr('type', 'file').attr('name', 'photos[]'); + $('.form-control.images', container).attr('type', 'file').attr('name', 'photos[]'); + $('.form-control.photoLinks', container).show(); container.removeClass('asLink'); el.attr('title', 'Указать ссылку на изображение'); $('.input-group-addon.type.ico', container).attr('title', 'Загрузите файл с изображением'); @@ -110,7 +112,8 @@ { $('.ordering', container).val('LINK'); $('.ico span', container).removeClass('glyphicon-paperclip').addClass('glyphicon-link'); - $('.form-control', container).attr('type', 'text').attr('name', 'imgs[]'); + $('.form-control.images', container).attr('type', 'text').attr('name', 'imgs[]'); + $('.form-control.photoLinks', container).hide(); container.addClass('asLink'); el.attr('title', 'Загрузить файл'); $('.input-group-addon.type.ico', container).attr('title', 'Укажите ссылку на изображение');