Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

jQuery validation and more

Compare
Choose a tag to compare
@bkader bkader released this 30 Apr 04:11
· 362 commits to 2.1/master since this release
  • Dashboard cached assets are stored within the application/cache/assets folder instead of Skeleton's to allow multiple applications sharing the same installation.

  • Added the do_extension method to Theme library so that extensions are put back in case of using no_extension method first.

$this->theme->no_extension()->add(...);
// Right after do:
$this->theme->do_extension();
  • Added jQuery validation library and automatic messages generation from set rules. when using the prep_form method, pass your form jQuery selector as the second argument. If you want to apply filters to the plugins parameters, pass the filter suffix as the third parameter (option because it will be automatically generated if not provided):
$this->prep_form($rules, $selector, $filter);
// Example
$this->prep_form(array(
    array('field' => 'username',
             'label' => 'Username', // Or: "lang:username"
             'rules' => 'trim|required|min_length[5])
), '#login');

// To add a filter (example: submitHanlder):
add_filter('jquery_validate_submitHandler-login', function ($handler) {
    // Do whatever you want as long as you return it.
});
  • Functions with safe_ as prefix were renamed to nonce_ for better understanding but old ones were kept for backward compatibility (safe_urlnonce_url).

  • Modules dashboard links can have their submenus displayed if defined in their manifest.json files and they can even be translated:

{
    "submenu": {
        "uri1": "Title 1",
        "uri2": "Title 2"
    },

    "translations": {
        "uri1": {
            "french": "Anything",
            "arabic": "Bla Bla bla"
        }
    }
}
  • KB_Image_lib.php added for better image resizing/cropping. See example of usage.

  • Fixed issue with Kbcore_entities.php library not applying url_title to usernames.

  • Added jQuery validation to Admin.php controllers of the following modules: settings, users, menus and media.

  • Fixed CodeIgniter typo #5462.