A ready-to-use CodeIgniter skeleton with tons of new features and a whole new concept of hooks (actions and filters) as well as a ready-to-use and application-free themes and plugins system.
We simply fixed minor (or medium) errors:
remove_all_filters
function without arguments [88f0298].prep_form
method with jQuery Validation
, scripts are added to your list of enqueued assets! The problem is that we forgot to add files extensions. So we added them [771dd51].views/layouts
if the active theme does not provide them [7956c23]. Views are: login.php
, recover.php
, register.php
, resend.php
, reset.php
and restore.php
within THEME_VIEWS_PATH/users/_file_
.Updated to CodeIgniter 3.1.9.
Seel full changelog.
Minor fixes were done on the code and some hooks were added for more flexibility.
Theme.php
Theme.php
getting always the current theme details when retrieving all themes - 9381313.// For modules:
add_action('modules_headers', function($headers) {
$headers['new_key'] = 'Default value';
return $headers;
});
// For plugins:
add_action('plugins_headers', function($headers) {
$headers['new_key'] = 'Default value';
return $headers;
});
// For themes, your only need to add keys.
add_action('themes_headers', function($headers) {
$headers[] = 'new_key';
return $headers;
});
__
function instead of line
when translating lines.Ajax.php
controller to their respective controllers.site_url
function from KB_url_helper.php
and added _uri_string
that will handle finding named routes [f05243b] and added the possibility to chain named routes [f4c90d1].menus.js
file because an independent Menus Manager module will be developed [
9878d1b].base.php
file [view all].admin_url
, admin_anchor
, nonce_admin_url
and nonce_admin_anchor
for a better modules contexts guess [6f132a4].Dummy Module
to demonstrate how to add content to dashboard without having views, using only init.php
file and few actions.Autoloader
class which you can use to register classes without having to include
or require
them [view file].PHP-Gettext
[6fe9c63].Theme.php
library to KB_Router.php
class [ecfe906].siteinfo
and get_siteinfo
functions [152b089].Folders structure has been changed:
application
which contains your applicaiton files.content
contains all publicly accessible folders and files.skeleton
contains Skeleton and CodeIgniter files, so make sure you know/remember what you edit in case of future updates.No more modules within Skeleton
folder. Modules are only within your application folder or public modules folder.
Media manage and menus manager will be developed separately so noone will be forced to have them If he/she doesn't want them.
Lots of useful function were added. You can see skeleton/third_party/bkader
folder for more details.
More useful vendor libraries and their helpers were added:
deep_xss_clean
.password_hash
and password_verify
. Simply use: phpass_hash
and phpass_check
.yaml_read_file
and yaml_write_file
. We will talk more about this later.json_read_file
and json_write_file
. Do they need to be explained?More functions can be found in skeleton/third_party/bkader
.
The core has been hugely rewritten for better performance (you'll notice that) and easy use.
New dashboard look and modules contexts. See the dashboard homepage for more details.
Plugins and modules use manifest.json
files while themes use their style.css
to hold themes details. We may get back to use manifest file for even better performance.
The dasboard has its own login page. If the current theme does not have views user for authentication or registration methods, Skeleton will fall-back to its default views (don't worry, they're quit cool).
Lots of filters/actions are available and they allow you to change logo, copyright, image to the right, lots of texts and images on the dashboard so you can customize it the way you wish.
More changes were done, so many changes that we might certainly have missed some. Try the demo if you want to test the product first.
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();
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_url
→ nonce_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.
<pre>
tags content (351f1cd).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.
manifest.json
files (example).manifest.json
file (example).{
"name": "Module Name",
"description": "Module Description",
"version": "1.0.0",
"author": "You Name",
"author_uri": "https://yourweb.site",
"author_email": "[email protected]",
"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": "الأعضاء"
}
}
}
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.
}
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');
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.
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.
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
.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).
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.
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 () {}
});
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.