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

jTaby - I've found this special char error. It's caused in "inflector_helper.php" file, bu line:
return ucwords(preg_replace('/[_]+/', ' ', strtolower(trim($str))));
And more precisley by: "strtolower" wich cuts some unicode characters...

The worst thing is that, we don't have good replacement for this, but for quick fix, i've added one extra function called 'nationalise':

// --------------------------------------------------------------------

* Nationalize
* Takes multiple words separated by underscores and changes them to spaces
* It also have special fix for special national chars (for instance polish)
* @access    public
* @param    string
* @return    str

if (! function_exists('nationalise'))
    function nationalise($str)
        $en_up_pattern = '[ABCDEFGHIJKLMNOPQRSTUVWXYZ]';
        $en_lw_pattern = '[abcdefghijklmnopqrstuvwxyz]';
        $special_up_pattern = '[ĄĆĘŁŃÓŚŹŻ]';
        $special_lw_pattern = '[ąćęłńóśźż]';
        return ucwords(preg_replace('/[_]+/', ' ', strtr((trim($str)), $en_up_pattern.$special_up_pattern, $en_lw_pattern.$special_lw_pattern)));
It makes an simple replacement with all English characters + additionally replaces Polish special chars. I don't know how efficient it is, but it's simple, dummy and it works.

If you want use it, you should change the lines with link names like:
if(strcmp(humanize($name),humanize($this->page_header)) == 0) echo ' id="active-page"';
echo '>'.anchor($link,humanize($name))."</li>\n"; ?&gt;


if(strcmp(humanize($name),humanize($this->page_header)) == 0) echo ' id="active-page"';
echo '>'.anchor($link,nationalise($name))."</li>\n"; ?&gt;

It should help a bit.

[eluser]Majd Taby[/eluser]
abmcr, you want $this->CI->codexadmin->rules....codexadmin is a library in the CI object

[eluser]Majd Taby[/eluser]
irvin, if you are having trouble with the inflector, then that is a CI issue which needs to be addressed in the Feature Requests or Bug Reports section, i'll try to fix the issue in codex though

I like to put all my backend files under the public directory, so that would include the codex app. Doing so however makes it imposable to access the CSS and any other file stored in the template directory. Might look at moving that to the assets folder rather than inside of the application folder.


This is a great little extension--it's already saved me a bunch of time, in just the past day.

I'd like to extend the package a bit to handle timestamps a little differently. CE automagically takes care of timestamp fields in the database. That's nice, but if I have 2 timestamp fields in a table, the second one never gets touched.

Here's what I want to do: track a create time stamp and an update time stamp. I don't want the user to see either of the fields, but I need access to them. The create time stamp (and update time stamp) will get set when CE adds a new record to the database. Only the update time stamp will get modified when CE edits the record.

Can you point me to the code where I should be starting? I can't find any references to timestamp fields in the code (with a few quick grep's). Perhaps you're just letting the SQL server deal with them?


I have a problem if i want to set a callback as rules....
in my controller i have this code
&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');


class Example extends codexController
    function Example ()
        // Load the CodexController

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

        $config = array(
                    'db_table' => 'example', //The name of the table associated with this controller
                    'form_setup' => $this->spyc->YAMLLOAD($this->codexadmin->getDefinitionFileName('example_form')), //The array that holds our elements
                    '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
    function username_check($str)
        if ($str == 'test')
            $this->validation->set_message('username_check', 'The %s field can not be the word "test"');
            return FALSE;
            return TRUE;

And the callback not work... Why?

Another small bug: the Select all link in the display mode not work...

[quote author="jTaby" date="1211413715"]abmcr, you want $this->CI->codexadmin->rules....codexadmin is a library in the CI object[/quote]

ok .... i have made this small feature for get a rule required indicator as in attached image
in the codexforms.php librarie insert this function

     * The function create a * symbol for a field with a rule required
    function required($field){
        $this->CI = &get;_instance();
        if (isset($this->CI->codexadmin->rules)){
            if (array_key_exists($field,$this->CI->codexadmin->rules)) {
                //search if a rule is 'required' in the rules
                $required=((in_array("required", $rules))?"<span class='required'>*</span>":NULL);
        return $required;

after, in each plugin where you want the symbol change the lines
$html .= '
            <label for="'.$this->element_name.'">
$html .= '
            <label for="'.$this->element_name.'">
Finally, insert into the css a .required class.

I have translate the language for italian user... send me an email for get it....ciao

[eluser]Majd Taby[/eluser]
abmcr, the callback worked fine with me, except that you need to change $this->validation to $this->codexvalidation.

also, for your required extension, I would add a function to codexforms and call it at the end of the initiate method, that way it can all be done automatically.

[eluser]Majd Taby[/eluser]
Hey guys, just wanted to let you all know that a new release has been posted (RC14.2) which mainly addresses issues found with RC14. The main post has been updated.

EDIT: I prematurely released 14.2, I have since fixed the downoad, but if you downloaded it before and it's not working, then please just download again...sorry about that.

Thank you JTaby for the new release.... i have insert another little feature: the table hover effect (see the attached image) and see this page for a demo.
Simply, insert into assets/js the file you download at http://p.sohei.org/jquery-plugins/tablehover/.
After, edit the css file of ypur template and insert these lines
/*class for zebra like table*/
tr.odd {

tr.even {
/*jquery table hover*/
td.click, th.click {
td.hover, tr.hover {
th.hover, tfoot td.hover {
td.hovercell, th.hovercell {
td.hoverrow, th.hoverrow {
Edit views/table.php and edit as
//this line insert the table hover effect:
//attach the file you have downloaded, in this example is jquery.tablehover.min.js

$table_sorter_js = "

    $(document).ready(function() {
         $('#main-table').tableHover({clickClass: 'click'});
            .tablesorter({widthFixed: true, widgets: ['zebra']})
That's all

Theme © iAndrew 2016 - Forum software by © MyBB