public function edittheme($fname) { $datafile = $_POST['code']; if (isset($_POST['langfile'])) { $folder = $this->input->post('langfile'); $path_to_view = get_lang_path($folder, $fname); } else { $path_to_view = get_view_path($fname); } if (!write_file('' . $path_to_view . '', $datafile)) { echo 'Unable to write the file'; } else { $filename = $fname . ".php"; $data = array("filename" => $filename, "files" => $datafile, "filepath" => $fname); $this->load->view('admin-kh4it/theme-editor', $data); } }
public function edittheme($fname) { $this->load->helper('file'); $this->load->helper('url'); $this->load->helper('mygetpath'); $datafile = $this->input->post('code'); if ($this->input->post('langfile') != null) { $folder = $this->input->post('langfile'); $path_to_view = get_lang_path($folder, $fname); } else { $path_to_view = get_view_path($fname); } if (!write_file('' . $path_to_view . '', $datafile)) { echo 'Unable to write the file'; } else { $filename = $fname . ".php"; $data = array("filename" => $filename, "files" => $datafile, "filepath" => $fname); $this->load->view('admin/theme', $data); } }