checkCsrf()) { $pass = $areaslib->update_areas(); if ($pass !== true) { Feedback::error($pass . ' ' . tra('No update was made.')); $smarty->assign_by_ref('error', $pass); } else { Feedback::success(tra('Areas were updated.')); } } // building overview $areas_table = $areaslib->table('tiki_areas'); $result = $areas_table->fetchAll(['categId', 'perspectives', 'exclusive', 'share_common', 'enabled']); $areas = []; $perspectivelib = TikiLib::lib('perspective'); $perspectives = []; foreach ($result as $item) { $area = []; $area['categId'] = $item['categId']; $area['exclusive'] = $item['exclusive']; $area['share_common'] = $item['share_common']; $area['enabled'] = $item['enabled']; $area['perspectives'] = []; foreach (unserialize($item['perspectives']) as $pers) { if (! array_key_exists($pers, $perspectives)) { $perspectives[$pers] = $perspectivelib->get_perspective($pers); } $area['perspectives'][] = $perspectives[$pers]; } $area['categName'] = $areaslib->get_category_name($item['categId']); $area['description'] = $areaslib->get_category_description($item['categId']); $areas[] = $area; } $smarty->assign_by_ref('areas', $areas); }