Exemplo n.º 1
0
 private function DeleteFaction(\bbdkp\controller\games\Game $editgame)
 {
     global $phpbb_admin_path, $phpEx, $user;
     if (confirm_box(true)) {
         $faction = new \bbdkp\controller\games\Faction();
         $faction->game_id = request_var('hidden_game_id', '');
         $faction->faction_id = request_var('hidden_faction_id', 0);
         $faction->get();
         $faction->Delete();
         $log_action = array('header' => 'L_ACTION_FACTION_DELETED', 'L_GAME' => $faction->game_id, 'L_FACTION' => $faction->faction_name);
         $this->log_insert(array('log_type' => 'L_ACTION_FACTION_DELETED', 'log_result' => 'L_SUCCESS', 'log_action' => $log_action));
         meta_refresh(1, append_sid("{$phpbb_admin_path}index.{$phpEx}", "i=dkp_game&mode=editgames&" . URI_GAME . "={$faction->game_id}"));
         trigger_error(sprintf($user->lang['ADMIN_DELETE_FACTION_SUCCESS'], $faction->game_id, $faction->faction_name) . $this->link, E_USER_WARNING);
     } else {
         $faction = new \bbdkp\controller\games\Faction();
         $faction->game_id = $editgame->game_id;
         $faction->faction_id = request_var('id', 0);
         $faction->get();
         $s_hidden_fields = build_hidden_fields(array('factiondelete' => true, 'hidden_faction_id' => $faction->faction_id, 'hidden_game_id' => $faction->game_id));
         confirm_box(false, sprintf($user->lang['CONFIRM_DELETE_FACTION'], $faction->faction_name), $s_hidden_fields);
     }
     $this->showgame($editgame);
 }