[eluser]Majd Taby[/eluser]
i had this functionality built into CodeExtinguisher. It was called 'extra_uri_segments' and they would be carried around the system until they were replaced. However, I deprecated that when query_strings were introduced since query_strings are a more robust solution. But to answer your question. I would add the primary key to userdata. So something like this:
Code:
if(!$id = $this->codexsession->userdata('lines_of_sale')){
if($id = $this->uri->segment(3)){
$this->db->where('sale_id',$id);
} else {
show_error('no id found');
}
} else {
$this->db->where('sale_id',$id);
}
Of course, this code isn't that good (you can factor out the common code and combine the conditions..but it should give you and idea.
But to answer your question. Don't forget that all the links that codex uses are set in codexcontroller:
etConfig() so if you want to modify them so that they always maintain the extra uri segments, it's very easy to do so. Here's what you would have to do:
1) Add $this->extra_uri_segment = implode('/',$this->uri->uri_to_assoc(3)); in codexcontroller:
etConfig()
2) Append .'/'.$this->extra_uri_segments to all the links and form actions in codexcontroller:
etConfig