CodeIgniter Forums
CodeExtinguisher 2.0 Release Candidate 14.2 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: CodeExtinguisher 2.0 Release Candidate 14.2 (/showthread.php?tid=8451)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49


CodeExtinguisher 2.0 Release Candidate 14.2 - El Forum - 06-06-2008

[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:ConfusedetConfig() 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:ConfusedetConfig()
2) Append .'/'.$this->extra_uri_segments to all the links and form actions in codexcontroller:ConfusedetConfig


CodeExtinguisher 2.0 Release Candidate 14.2 - El Forum - 06-06-2008

[eluser]Donald Hughes[/eluser]
How do I increase the length of a TextBox?


CodeExtinguisher 2.0 Release Candidate 14.2 - El Forum - 06-06-2008

[eluser]Majd Taby[/eluser]
although you can define your attributes, textboxes are styled in css, so you'd have to define them.


CodeExtinguisher 2.0 Release Candidate 14.2 - El Forum - 06-06-2008

[eluser]gusa[/eluser]
[quote author="abmcr" date="1212753097"]
IN few words, in the overview mode, i create a link to the second table (in your case lines_of_sale) with
Code:
$config = array(
                    'db_table' => 'example',
                    'form_setup' => $this->spyc->YAMLLOAD($this->codexadmin->getDefinitionFileName('example_form')),
                    'controller_name' => 'Example',
                    'primary_key' => 'my_id',
                    'display_fields'=>array('textbox_test','checkbox_test','related2'),
                    'order_by' => 'textbox_test',
                    'order_type' => 'DESC',
                    'table_access_restriction'=>array('my_id '=>$this->uri->segment(3)),
                    'rules'=>$rules
                    );
        $this->setConfig($config);
[/quote]

thanks abmcr and jtaby. i made something similar by creating a plugin called LinkTo. in your example linkto would be the plugin for 'related2'. the problem is that when i execute the code it seems that codex tries to select the column 'related2' from the database.

can i create a field that's not associated to any field in the database? how?


CodeExtinguisher 2.0 Release Candidate 14.2 - El Forum - 06-06-2008

[eluser]Majd Taby[/eluser]
in your plugin, right this:

Code:
function getFieldName(){ return NULL; }
function prepForDb(){ return NULL; }

If those functions return NULL, they will be eliminated from their respective query.


CodeExtinguisher 2.0 Release Candidate 14.2 - El Forum - 06-06-2008

[eluser]gusa[/eluser]
[quote author="jTaby" date="1212795267"]in your plugin, right this:

Code:
function getFieldName(){ return NULL; }
function prepForDb(){ return NULL; }

If those functions return NULL, they will be eliminated from their respective query.[/quote]

are you sure that's working?
i defined getFieldName as:

Code:
function getFieldName(){
    echo 'over here!';
    die;
}

and the code is never executed.


CodeExtinguisher 2.0 Release Candidate 14.2 - El Forum - 06-08-2008

[eluser]abmcr[/eluser]
[quote author="gusa" date="1212786046"] i made something similar by creating a plugin called LinkTo. in your example linkto would be the plugin for 'related2'......[/quote]
I have a very interest for this feature, gusa.... tell me if you want to share with us your plugin.. ciao


CodeExtinguisher 2.0 Release Candidate 14.2 - El Forum - 06-09-2008

[eluser]ocergyNohtna[/eluser]
I have no idea what I did to cause this. Everything appears fine, but all of the sudden one of my DbDropdowns doesn't display when editing now. It shows when adding but not editing. Any idea where I can look to see why this is happening??


CodeExtinguisher 2.0 Release Candidate 14.2 - El Forum - 06-09-2008

[eluser]Majd Taby[/eluser]
could you show us what is happening? try to print_r() some info on getHTML, look into the HTML source, are there any hidden PHP errors in the html?


CodeExtinguisher 2.0 Release Candidate 14.2 - El Forum - 06-09-2008

[eluser]ocergyNohtna[/eluser]
hmmmm....so i dug through DbDropDown for an hour before looking in Dropdown and noticed that at the end of getHTML i had this:
Code:
if($this->CI->uri->segment(2) == 'add') {
    return $html;
} else {
    return '';
}
was this suppose to be there? maybe i was just running on such little sleep recently i put it there by accident.