From 96aad27c4fbcf83f3052a4c62a5e0fb6e280d131 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 15 Feb 2011 18:18:13 +0100 Subject: rework cli_client support Signed-off-by: Florian Pritz --- application/models/file_mod.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'application/models') diff --git a/application/models/file_mod.php b/application/models/file_mod.php index f781e1676..dfb203226 100644 --- a/application/models/file_mod.php +++ b/application/models/file_mod.php @@ -126,15 +126,14 @@ class File_mod extends CI_Model { } if ($this->var->cli_client) { - echo $data['url']."\n"; + $redirect = false; + } + if ($redirect) { + redirect($data['url']); } else { - if ($redirect) { - redirect($data['url']); - } else { - $this->load->view('file/header', $data); - $this->load->view('file/show_url', $data); - $this->load->view('file/footer', $data); - } + $this->load->view($this->var->view_dir.'/header', $data); + $this->load->view($this->var->view_dir.'/show_url', $data); + $this->load->view($this->var->view_dir.'/footer', $data); } } @@ -142,9 +141,9 @@ class File_mod extends CI_Model { { $data["title"] = "Not Found"; $this->output->set_status_header(404); - $this->load->view('file/header', $data); - $this->load->view('file/non_existent', $data); - $this->load->view('file/footer', $data); + $this->load->view($this->var->view_dir.'/header', $data); + $this->load->view($this->var->view_dir.'/non_existent', $data); + $this->load->view($this->var->view_dir.'/footer', $data); } function check_client_version() @@ -239,7 +238,7 @@ class File_mod extends CI_Model { } else { $data['timeout'] = "never"; } - echo $this->load->view('file/html_header', $data, true); + echo $this->load->view($this->var->view_dir.'/html_header', $data, true); $this->load->library("MemcacheLibrary"); if (! $cached = $this->memcachelibrary->get($filedata['hash'].'_'.$mode)) { ob_start(); @@ -260,7 +259,7 @@ class File_mod extends CI_Model { $this->memcachelibrary->set($filedata['hash'].'_'.$mode, $cached, 100); } echo $cached; - echo $this->load->view('file/html_footer', $data, true); + echo $this->load->view($this->var->view_dir.'/html_footer', $data, true); } else { if ($mode == 'plain') { header("Content-Type: text/plain\n"); -- cgit v1.2.3-24-g4f1b