コード例 #1
0
 function add_pack()
 {
     $this->data['subtitle'] = "Add New Pack";
     if ($_POST) {
         if ($this->form_validation->run('add_pack') == FALSE) {
             $this->content_view = "mod/add_pack";
             $this->data['error'] = true;
         } else {
             Pack::create_pack($this->input->post('name'), $this->input->post('abbreviation'), $this->input->post('download_link'));
             $log_string = $this->session->userdata('username') . " (" . $this->session->userdata('display_name') . ") added new pack: " . $this->input->post('name') . " " . $this->input->post('download_link');
             write_to_mod_log($log_string);
             $this->content_view = "mod/add_pack_success";
         }
     } else {
         $this->data['error'] = false;
         $this->content_view = "mod/add_pack";
     }
 }