Welcome Guest, Not a member yet? Register   Sign In
CodeExtinguisher 2.0 Release Candidate 14.2
#21

[eluser]unsub[/eluser]
@JTaby:

Tnx very much for your answer, that has cleared up several things for me in one go Big Grin
yer awsome!

So... there's an auth system right in there? I think I must have been reading too fast when I started digging into this system.

I wonder if there is any reading material on the subject of user signup / authentication in codex that someone knows of? I will of course keep looking about for it myself, but if anyone has a link to such a thing, I sure would be grateful Big Grin

cheers all.
#22

[eluser]abmcr[/eluser]
[quote author="jTaby" date="1211232240"]abmcr, The prepForDelete function is optional, to get the id of the record being deleted, then you can use $this->codexadmin->active_id
[/quote]
Please be patient..... i have set this controller
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

include("codexcontroller.php");

class Example extends codexController
{
    function Example ()
    {
        // Load the CodexController
        codexController::codexController();

      
        $rules['textbox_test'] = "trim|required";

        $config = array(
                    'db_table' => 'example', //The name of the table associated with this controller
                    'form_setup' => $this->spyc->YAMLLOAD($this->codexadmin->getDefinitionFileName('example_form')),
                    'controller_name' => 'Example', //The name of the controller, so that it can be used when generating the URLs
                    'primary_key' => 'my_id', //The name of the controller, so that it can be used when generating the URLs
                    'display_fields'=>array('textbox_test','date_test','related_example'),
                    'rules'=>$rules
                    );
        $this->setConfig($config);
    }
    
    function prepForDelete($table,$id)
    {
        # deleting the related records in the related table...
        $this->db->delete('related_table', array('id' => $id));
        # send an email
        mail("[email protected]","example","Deleted record");
        
        
    }
}
?>
but nothing event is fire..... :-(
My error is to call the prepForDelete into the controller?

In the plugin file, i want to read the $rules[] array.... but a simple print_r($rules) or print_r($this->rules) don't work..... It is possible?

Thank you for all .... ciao!!!
#23

[eluser]Majd Taby[/eluser]
Unsub, go to config/access_levels.php. There, you can specify permissions on a controller or method level. Now, Because the automatically generated CRUDS don't have a controller specified with them, you can't specify permissions on them, but I plan on addressing that in the next release. There is also a User Registration controller that allows you to add users. Finally, you can define a default system-wide access level, and a level which you define as the "public" level (which means no login would be required)

abmcr, the prepForDelete function doesn't go in your controller, it goes in your plugins. If you want to override what happens in an event, then you can add a new event (look up Khaos::EventManager for docs)
#24

[eluser]got 2 doodle[/eluser]
Just a quick note, the online date picker looks like this on my system (Firefox + XP). I don't know if this has been addressed yet.
#25

[eluser]got 2 doodle[/eluser]
Sorry that was confusing, by online I meant the online preview, not something that I have set up.
#26

[eluser]abmcr[/eluser]
page 2 of this post: i have insert the bug fix ;-)
#27

[eluser]got 2 doodle[/eluser]
thanks, I should have done a little research before posting.
#28

[eluser]abmcr[/eluser]
[quote author="jTaby" date="1211389576"]abmcr, the prepForDelete function doesn't go in your controller, it goes in your plugins. If you want to override what happens in an event, then you can add a new event (look up Khaos::EventManager for docs)[/quote]

Please excuse me... be patient please: i have set a code into the codexevents.php (line 86 for preDeletHook) and all work fine, but my question is how to override an event only into a single controller: it is possible to intercept an event? In the old documentation an example is show, but, obvious the Kaos event manger is different.... do you post an example? Thank you (i repeat my excuses for my not ability.... and for my bad language)


A little contribution: in my edit view, i need to signal with an * the required field (see the attached image). My goal is to build this symbol in auto, but my ability is not sufficient
I have found a simple system, i.e. set into the yml file
Code:
textbox_test:
                class: TextBox
                params:
                    required: yes

and in the plugin set
Code:
$html .= '
            <label for="'.$this->element_name.'">
                '.$this->label.(isset($this->required)?NULL:"*").'
            </label>';
#29

[eluser]Majd Taby[/eluser]
got 2 doodle, the issue has been fixed for the next release (thanks to abmcr)

abmcr, no need to apologize, really. There is no way as of right now to intercept an event in your controllers. The way I usually do what it seems you are trying to do is by overriding execute_add and execute_edit (and in this case, delete() ). As far as your contribution, why not build the list of required items from $this->codexadmin->rules? Smile
#30

[eluser]abmcr[/eluser]
I have try to use

print_r($this->codexadmin->rules);

into the plugin, but i get an error message... :-(

Quote:The way I usually do what it seems you are trying to do is by overriding execute_add and execute_edit (and in this case, delete() ).

It is possible to see a code for this :-( ?




Theme © iAndrew 2016 - Forum software by © MyBB