From 667d09305c7c9ebfdb1731f54ae1c094ea118d15 Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Sun, 31 May 2015 15:01:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B8=D1=81=D1=82=D0=BE=D1=87=D0=BD=D0=B8?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BF=D1=80=D0=B8=20=D0=B7=D0=B0=D0=B3=D1=80?= =?UTF-8?q?=D1=83=D0=B7=D0=BA=D0=B5=20=D1=84=D0=BE=D1=82=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D1=82=D0=BE=D1=87=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ground/controllers/JsonController.php | 3 +++ ground/views/modals/addPoint.php | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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', 'Укажите ссылку на изображение');