diff --git a/app/controllers/Admin/BannersController.php b/app/controllers/Admin/BannersController.php index cbfa47c..ba81727 100644 --- a/app/controllers/Admin/BannersController.php +++ b/app/controllers/Admin/BannersController.php @@ -30,7 +30,8 @@ public function addAction() { $this->assets->collection('bottom-js') ->addJs('js/moment/moment.min.js') ->addJs('js/moment/ru.js') - ->addJs('js/datetimepicker/js/bootstrap-datetimepicker.js'); + ->addJs('js/datetimepicker/js/bootstrap-datetimepicker.js') + ->addJs('js/banners_edit_sizes.js'); $this->assets->collection('css') ->addCss('js/datetimepicker/css/bootstrap-datetimepicker.min.css'); $banner = new Banners(); @@ -123,7 +124,8 @@ public function editAction() { $this->assets->collection('bottom-js') ->addJs('js/moment/moment.min.js') ->addJs('js/moment/ru.js') - ->addJs('js/datetimepicker/js/bootstrap-datetimepicker.js'); + ->addJs('js/datetimepicker/js/bootstrap-datetimepicker.js') + ->addJs('js/banners_edit_sizes.js'); $this->assets->collection('css') ->addCss('js/datetimepicker/css/bootstrap-datetimepicker.min.css'); $id = $this->dispatcher->getParam('id'); diff --git a/app/controllers/Admin/ZonesController.php b/app/controllers/Admin/ZonesController.php index 3a0825c..153ffc0 100644 --- a/app/controllers/Admin/ZonesController.php +++ b/app/controllers/Admin/ZonesController.php @@ -17,7 +17,7 @@ public function addAction() { $zone = new Zones(); if ($this->request->isPost()) { - if($zone->save($this->request->getPost(), array('name'))) + if($zone->save($this->request->getPost(), array('name', 'width', 'height'))) { $this->flashSession->success("Зона успешно создана"); return $this->response->redirect(array('for'=>'controller', 'controller'=>'zones')); @@ -63,7 +63,7 @@ public function editAction() { { if ($this->request->isPost()) { - if($zone->save($this->request->getPost(), array('name'))) + if($zone->save($this->request->getPost(), array('name', 'width', 'height'))) { $this->flashSession->success("Зона отредактирована"); return $this->response->redirect(array('for'=>'controller', 'controller'=>'zones')); diff --git a/app/models/Zones.php b/app/models/Zones.php index 3b78532..fe3d8a3 100644 --- a/app/models/Zones.php +++ b/app/models/Zones.php @@ -4,9 +4,11 @@ class Zones extends ModelBase { - public $id, $name; + public $id, $name, $height, $width; public $labels = array( - 'name' => 'Имя' + 'name' => 'Имя', + 'height' => 'Высота', + 'width' => 'Ширина' ); public function initialize() diff --git a/app/views/admin/banners/edit.phtml b/app/views/admin/banners/edit.phtml index 75472bb..aeb5a1a 100644 --- a/app/views/admin/banners/edit.phtml +++ b/app/views/admin/banners/edit.phtml @@ -118,8 +118,14 @@ $zones = \App\Models\Zones::find(); foreach($zones as $zone):?>