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

1.4.0

Compare
Choose a tag to compare
@bkader bkader released this 27 Apr 08:39
· 362 commits to 2.1/master since this release

FIRST THING TO DO

Make sure you apply the provided SQL dump FIRST.. It contains some added things to the options table. Once done, you'll notice changes to the settings page, uploads section.

PHP

  1. Modules now have their own routes set in their manifest.json files (example).
  2. Modules dashboard links can be translated the same way, within the manifest.json file (example).
{
    "name": "Module Name",
    "description": "Module Description",
    "version": "1.0.0",
    "author": "You Name",
    "author_uri": "https://yourweb.site",
    "author_email": "your@email.address",
    "license": "MIT",
    "enabled": true,

    "routes": {
        "whatever": "module/whatever",
        "get:whatever": "module/whatever",
        "post:whatever": "module/whatever",
        "whatever": "null"
      },

    "admin_menu": "Text On Dashboard",
    "admin_order": 5,

    "translations": {
    "admin_menu": {
        "french": "Utilisateurs",
        "arabic": "الأعضاء"
    }
  }
}
  1. Media manager enhanced with better design and additional bulk selection/deletion feature.
  2. Skeleton code rewritten a bit for better performance.
  3. The old safe url system is removed and replace with a fancy nonce system. You must provide an action that you will check on the next request.
// In your form:
echo form_open();
echo form_nonce('your-action-name');

// Then you check in your controller:
if (true !== $this->check_nonce('your-action-name')) {
    // Did no't pass.
}
  1. KB_Security.php created and handles nonces with its methods or their helpers: create_nonce and verify_nonce:
create_nonce('action-name');
verify_nonce('nonce', 'action-name');
  1. KB_form_helper.php saw more functions: form_nonce, form_referrer, _configure and _transfigure.
form_nonce('action-name'); // Creates the nonce hidden input + referrer.
form_referrer(); // Creates the hidden referrer input.
_translate() // Translates a string that contains "lang:.."
_configure(); // Gets a config value from string containing "config:...".
__transfigure(); // Gets a config or translation for the selected string.
  1. The dashboard comes with extra actions you can use:
    • admin_navbar: in case you want to add a navigation to the admin navbar.
    • admin_navbar_right: in case you want to add a navigation to the admin right navbar.
    • admin_user_menu: in case you want to add a navigation to the admin right navbar.
    • admin_page_header and admin_page_footer: located above and below your module's admin views.
    • in_admin_footer: located right above the footer.
    • admin_menu: to add anchors to the dashboard sidebar menu.
    • before_admin_menu and after_admin_menu: to add anything before or after sidebar navigation.

It comes with other filters:
* admn_logo: if you want to alter dashboard logo.
* admin_footer_text: if you want to change the footer "Thank you..." text.
* admin_version_text: If you want to replace the text displaying the version.

  1. KB_Upload (loaded using: $this->load->library('upload');) library added to give you freedom changing upload behavior from your plugins/themes. It comes with few filters that you can use:

    • upload_dir: In case you want to change the upload directory without changing the setting.
    • upload_xxx: used to change configuration. x stands for one of these parameters: allowed_types, max_size, max_width, max_height, min_width, min_height, file_ext_tolower, encrypt_name, remove_spaces.
  2. Table Library have a tag used to alter table tags: table_tags. It takes an array as argument, so you may change any tag you want then return the final array (important).

JavaScript (dashboard)

  1. We added a new csk.ui object useful for confirmation messages and alerts:
csk.ui.confirm("Are you sure?", trueCallback, falseCallback);
csk.ui.alert("You alert message", "success"); // success, error, info or warning.
  1. AJAX requests are queued for better performance. You can use the csk.ajax object to handle AJAX requests, so the next request will not fire unless the previous one is completed.
csk.ajax.request("your url", function () {
    type: "POST",
    data: {},
    complete: function () {}
});

Notice

To reduce used resources to the minimum (fonts), we may get rid of fonts we are using (Fira Sans, Oswald, Ruda, Droid Arabic Kufi and Dubai) and simply use availble ones. What do you think? Let us know on Facebook or even Twitter.