From 495c3114d74e61cf8a8a3451cd1916fa82d30bda Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 13 Sep 2011 17:48:12 +0200 Subject: fix undefined variables in upload_form when using a cli client Signed-off-by: Florian Pritz --- application/controllers/file.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'application/controllers') diff --git a/application/controllers/file.php b/application/controllers/file.php index 7b2d70cbf..32eb369d0 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -17,6 +17,7 @@ class File extends CI_Controller { $this->load->model('file_mod'); $this->var->cli_client = false; $this->file_mod->var->cli_client =& $this->var->cli_client; + $this->var->latest_client = false; if (file_exists(FCPATH.'data/client/latest')) { $this->var->latest_client = trim(file_get_contents(FCPATH.'data/client/latest')); } @@ -56,19 +57,25 @@ class File extends CI_Controller { } } - function client() + function client($load_header = true) { $data['title'] = 'Client'; if ($this->var->latest_client) { $data['client_link'] = base_url().'data/client/fb-'.$this->var->latest_client.'.tar.gz'; + } else { + $data['client_link'] = "none"; } $data['client_link_dir'] = base_url().'data/client/'; $data['client_link_deb'] = base_url().'data/client/deb/'; $data['client_link_slackware'] = base_url().'data/client/slackware/'; - $this->load->view($this->var->view_dir.'/header', $data); + if ($load_header) { + $this->load->view($this->var->view_dir.'/header', $data); + } $this->load->view($this->var->view_dir.'/client', $data); - $this->load->view($this->var->view_dir.'/footer', $data); + if ($load_header) { + $this->load->view($this->var->view_dir.'/footer', $data); + } } function upload_form() @@ -83,7 +90,7 @@ class File extends CI_Controller { $this->load->view($this->var->view_dir.'/header', $data); $this->load->view($this->var->view_dir.'/upload_form', $data); if ($this->var->cli_client) { - $this->load->view($this->var->view_dir.'/client', $data); + $this->client(false); } $this->load->view($this->var->view_dir.'/footer', $data); } -- cgit v1.2.3-24-g4f1b