Closed jadin closed 11 years ago
Hi Jadin, are the other pages showed correctly? BTW, can you please check the "only content" option of "gis_generate" in navigation management? If it is checked, then un-check it.
Hi goFrendi,
The option "only content" is inactive. And yes, all other pages show correctly.
Hi Jadin. This is quiet strange. In your controller, do you extend CMS_Controller or CMS_Priv_Strict_Controller?
Are you sure that your controller only contains this one?:
$this->view('gis/gis_generate', 'gis_generate');
I'm afraid there is something like "accidental" redirection which call $this->load->view instead of $this->view
But if it is not the case, don't you mind to send me the module? I still can't make sure, but this could be a bug.
Thanks
Hi Jadin, how is it? Have you solve the problem?
Hi Gofrendi,
No not solved unfortunately. I'm extending CMS_Controller. My controller contains two functions, the index function contains:
$this->view('gis/gis_generate', 'gis_generate');
while the another function contains:
$this->view($this->cms_module_path().'/gis_index_list', $data);
The idea is that the module first loads the first view through index, and then when the user presses the generate button, I want to load another view (below is the full controller class)
If you can let me know how I can send you the module to at least make sure it's not a bug?
Thanks a lot.
view($this->cms_module_path().'/gis_generate');
$this->view('gis/gis_generate', 'gis_generate');
}
public function generate (){
$this->load->Model($this->cms_module_path().'/Map_Model');
$latest_exists = $this->Map_Model->get_latest();
if($latest_exists== false) {
//$map = $this->Map_Model->get_data();
$kml = $this->Map_Model->get_kml();
$zip_name = 'Sites '.date('Y-m-d His').'.kmz';
$zip = $this->Map_Model->zip_file($kml, $zip_name);
if($zip == true){
//Add Code
} else {
//Add code
}
$data = array("result"=> $zip_name);
}
else {
$data = array("result"=> $latest_exists);
}
$this->view($this->cms_module_path().'/gis_index_list', $data);
}
public function download($file_name){
$this->load->helper('path');
$directory = "modules/gis/assets/archive/";
$path = set_realpath($directory);
$this->load->helper('download');
$data = file_get_contents($path.rawurldecode($file_name));
force_download($file_name, $data );
}
```
}
?>
Seems nothing wrong. But, can you try to change this line:
$this->view('gis/gis_generate', 'gis_generate');
into this:
$this->view('gis/gis_generate', NULL, 'gis_generate');
Hi,
Thanks, that worked :) the first view is loading correctly. But the second view in the generate function is not (same issue, banner...etc. disappears.). there is no navigation associated with this view.
$this->view($this->cms_module_path().'/gis_index_list', $data);
The view is simply an anchor:
GIS
Your file has been generated:
Okay, I think I see what the problem really is. And surprisingly enough (I'm not aware of it :p)
$this->view()
has at least 3 parameters. The first one is the view location
, the second one is data
, and the third one is navigation code
. So, for the second case, it should be
$this->view($this->cms_module_path().'/gis_index_list', $data, 'gis_generate');
This is not bug (at least not crucial one), But as long as I remember, the program can guess the navigation code automatically. I'll check it later though.
Thanks a lot GoFrendi, that worked as well :)
Automatic navigation_code
guessing has been fixed in 0.6.2
Hi,
This is an issue causing me some grief. I have the following view called gis_generate.php (note: I removed some of tags on purpose because it simply parses the html)
I'm loading it in the index function as follows:
The module installer adds the navigation as follows:
But the end result is the attached file. Basically the view loads, but everything else disappears (menus, banners...etc.) I cannot tell if this due to an error in the above or some sort of bug.