From fa6a1cc2fb31cc647a0b09e0ed536b820eb8c047 Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Sun, 31 May 2015 13:51:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=B2=D0=BE=D0=B4=20=D0=B0=D0=B4?= =?UTF-8?q?=D0=BC=D0=B8=D0=BD=D0=B8=D1=81=D1=82=D1=80=D0=B0=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D1=83=20=D1=82=D0=BE=D1=87=D0=B5=D0=BA=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BC=D0=BE=D0=B4=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ground/controllers/PageController.php | 24 ++++++++++++++++++++++++ ground/views/pointsTemplate.php | 12 ++++++++++++ 2 files changed, 36 insertions(+) diff --git a/ground/controllers/PageController.php b/ground/controllers/PageController.php index c7c21e0..9bb0a62 100644 --- a/ground/controllers/PageController.php +++ b/ground/controllers/PageController.php @@ -12,6 +12,29 @@ class PageController extends Controller self::addStyle('/css/bootstrap.min.css'); self::addStyle('/css/bootstrap-theme.min.css'); + $notModeratedPoints = $result = array(); + + // On moderation + if (App::$user && App::$user->isAdmin) { + $param['order']='id DESC'; + $param['where']= '`moderate` = 0'; + $points = Point::model()->getAll($param); + $categories = Category::model()->getAll(array('order' => 'ord ASC')); + + foreach ($points as $point) { + $id = $point->id; + $result[$id]['id'] = $point->id; + $result[$id]['name'] = $point->name; + $result[$id]['lat'] = $point->lat; + $result[$id]['lng'] = $point->lng; + $result[$id]['author'] = $point->authorUser->nick; + $result[$id]['categoryId'] = $point->categoryId; + $result[$id]['categoryIcon'] = $categories[$point->categoryId]->icon; + } + $notModeratedPoints = $result; + } + // ------------------------------------------ + $param['order']='id DESC'; $param['where']=App::getParam('category') ? 'categoryId = '.(int)App::getParam('category') : ''; $points = Point::model()->getAll($param); @@ -37,6 +60,7 @@ class PageController extends Controller 'categories' => $categories, 'user' => App::$user, 'points' => $result, + 'notModeratedPoints' => $notModeratedPoints, )); } diff --git a/ground/views/pointsTemplate.php b/ground/views/pointsTemplate.php index 8661ab0..182bfa4 100644 --- a/ground/views/pointsTemplate.php +++ b/ground/views/pointsTemplate.php @@ -1,3 +1,15 @@ + +

Точки на модерации

+ + # + + + +
+ +
+ +

Список точек