From f8c2b83a94954d491616b17f3a7ee0075dd14271 Mon Sep 17 00:00:00 2001 From: xamgore <xamgore@ya.ru> Date: Thu, 3 Sep 2015 02:11:46 +0300 Subject: [PATCH] Fixes menu displaying for admins & deans Ternary operator is left-associated in PHP (right in C++), so we have: (...) ? one : second; I have put an extra braces to improve the evaluation order. --- .../classes/Controller/Environment/Office.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/~dev_rating/application/classes/Controller/Environment/Office.php b/~dev_rating/application/classes/Controller/Environment/Office.php index 84cf02a91..6a32e4c08 100644 --- a/~dev_rating/application/classes/Controller/Environment/Office.php +++ b/~dev_rating/application/classes/Controller/Environment/Office.php @@ -15,11 +15,11 @@ class Controller_Environment_Office extends Controller_Environment_User // todo: move to twig $menu = Model_System::loadConfig( - $this->user->isAdmin() - ? 'sidePanel/admin.json' - : $this->user->isDean() - ? 'sidePanel/dean.json' - : []); + $this->user->isAdmin() ? + 'sidePanel/admin.json' : ( + $this->user->isDean() ? + 'sidePanel/dean.json' : [] + )); $this->twig->set_global('SidePanel', $menu); } -- GitLab