$role_variables = array_merge($role_variables, $data); } $role_variables = array_flip($role_variables); $role->name = $name; $errors = $role->IsValidData(); if (count($errors) == 0) { $db = db_class::get_instance(); $db->begin(); $role->Save(); $role->DeleteRoleActions(); reset($role_actions); $role_action = new role_action(); $role_action->role_id = $role->id_role; while (list($key, ) = each($role_actions)) { $role_action->module_action_id = $key; $role_action->Save(); } $role->DeleteRoleVariables(); reset($role_variables); $role_variable = new role_variable(); $role_variable->role_id = $role->id_role; while (list($key, ) = each($role_variables)) { $role_variable->variable_id = $key; $role_variable->Save(); } $db->commit(); } } include SITE_FILE_ROOT . 'template/simple_header.php'; include SITE_FILE_ROOT . 'template/' . $STORAGE['module'] . '/' . $STORAGE['action'] . '.php'; include SITE_FILE_ROOT . 'template/simple_footer.php';