summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-09-13 17:48:12 +0200
committerFlorian Pritz <bluewind@xinu.at>2011-09-13 17:48:12 +0200
commit495c3114d74e61cf8a8a3451cd1916fa82d30bda (patch)
tree1acd092e280343ca1f049a40b39219c2a72d04ec
parent4a35d5693a65c05e34abf1f9a01b8ff638bc907e (diff)
fix undefined variables in upload_form when using a cli client
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--application/controllers/file.php15
1 files changed, 11 insertions, 4 deletions
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);
}