├── content
├── uploads
│ ├── bkader.jpg
│ └── index.html
├── themes
│ ├── default
│ │ ├── screenshot.png
│ │ ├── assets
│ │ │ ├── css
│ │ │ │ ├── style.css
│ │ │ │ ├── index.html
│ │ │ │ └── bootstrap-theme.min.css
│ │ │ ├── fonts
│ │ │ │ ├── glyphicons-halflings-regular.eot
│ │ │ │ ├── glyphicons-halflings-regular.ttf
│ │ │ │ ├── glyphicons-halflings-regular.woff
│ │ │ │ ├── glyphicons-halflings-regular.woff2
│ │ │ │ └── index.html
│ │ │ ├── index.html
│ │ │ ├── img
│ │ │ │ └── index.html
│ │ │ └── js
│ │ │ │ ├── index.html
│ │ │ │ └── bootstrap.min.js
│ │ ├── views
│ │ │ ├── .htaccess
│ │ │ ├── index.html
│ │ │ ├── _layouts
│ │ │ │ ├── index.html
│ │ │ │ └── default.php
│ │ │ ├── _master
│ │ │ │ ├── index.html
│ │ │ │ └── default.php
│ │ │ ├── _modules
│ │ │ │ └── index.html
│ │ │ ├── _partials
│ │ │ │ ├── index.html
│ │ │ │ ├── alert.php
│ │ │ │ ├── sidebar.php
│ │ │ │ ├── footer.php
│ │ │ │ └── header.php
│ │ │ ├── example.php
│ │ │ └── admin.php
│ │ ├── index.html
│ │ ├── manifest.json
│ │ └── functions.php
│ ├── semantic
│ │ ├── screenshot.png
│ │ ├── manifest.json
│ │ ├── assets
│ │ │ ├── js
│ │ │ │ ├── scripts.js
│ │ │ │ └── index.html
│ │ │ ├── css
│ │ │ │ ├── themes
│ │ │ │ │ ├── basic
│ │ │ │ │ │ └── assets
│ │ │ │ │ │ │ └── fonts
│ │ │ │ │ │ │ ├── icons.eot
│ │ │ │ │ │ │ ├── icons.ttf
│ │ │ │ │ │ │ └── icons.woff
│ │ │ │ │ ├── default
│ │ │ │ │ │ └── assets
│ │ │ │ │ │ │ ├── fonts
│ │ │ │ │ │ │ ├── icons.eot
│ │ │ │ │ │ │ ├── icons.otf
│ │ │ │ │ │ │ ├── icons.ttf
│ │ │ │ │ │ │ ├── icons.woff
│ │ │ │ │ │ │ └── icons.woff2
│ │ │ │ │ │ │ └── images
│ │ │ │ │ │ │ └── flags.png
│ │ │ │ │ ├── material
│ │ │ │ │ │ └── assets
│ │ │ │ │ │ │ └── fonts
│ │ │ │ │ │ │ ├── icons.eot
│ │ │ │ │ │ │ ├── icons.ttf
│ │ │ │ │ │ │ ├── icons.woff
│ │ │ │ │ │ │ └── icons.woff2
│ │ │ │ │ └── github
│ │ │ │ │ │ └── assets
│ │ │ │ │ │ └── fonts
│ │ │ │ │ │ ├── octicons.ttf
│ │ │ │ │ │ ├── octicons.woff
│ │ │ │ │ │ └── octicons-local.ttf
│ │ │ │ ├── index.html
│ │ │ │ └── style.css
│ │ │ ├── index.html
│ │ │ ├── img
│ │ │ │ └── index.html
│ │ │ └── fonts
│ │ │ │ └── index.html
│ │ ├── views
│ │ │ ├── .htaccess
│ │ │ ├── _partials
│ │ │ │ ├── alert.php
│ │ │ │ ├── index.html
│ │ │ │ ├── sidebar.php
│ │ │ │ ├── footer.php
│ │ │ │ └── header.php
│ │ │ ├── index.html
│ │ │ ├── _layouts
│ │ │ │ ├── index.html
│ │ │ │ └── default.php
│ │ │ ├── _modules
│ │ │ │ ├── index.html
│ │ │ │ └── admin
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── dashboard.php
│ │ │ ├── example.php
│ │ │ ├── admin.php
│ │ │ └── _master
│ │ │ │ └── default.php
│ │ ├── index.html
│ │ └── functions.php
│ └── index.html
├── index.html
└── common
│ ├── index.html
│ ├── css
│ └── index.html
│ ├── fonts
│ └── index.html
│ ├── img
│ └── index.html
│ └── js
│ ├── index.html
│ ├── html5shiv-3.7.3.min.js
│ ├── respond-1.4.2.min.js
│ └── modernizr-2.8.3.min.js
├── .gitignore
├── LICENSE
├── application
├── controllers
│ ├── Admin.php
│ └── Example.php
├── config
│ └── theme.php
├── libraries
│ └── Events.php
└── helpers
│ └── theme_helper.php
├── ci-theme.sublime-completions
└── README.md
/content/uploads/bkader.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/uploads/bkader.jpg
--------------------------------------------------------------------------------
/content/themes/default/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/default/screenshot.png
--------------------------------------------------------------------------------
/content/themes/semantic/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/screenshot.png
--------------------------------------------------------------------------------
/content/themes/default/assets/css/style.css:
--------------------------------------------------------------------------------
1 | @charset "utf8";
2 |
3 | body {
4 | background-color: #e6e6e6;
5 | padding-top: 66px;
6 | }
--------------------------------------------------------------------------------
/content/themes/semantic/manifest.json:
--------------------------------------------------------------------------------
1 | {"name": "Semantic UI","author": "Kader Bouyakoub","website": "https://www.ianhub.com/","screenshot": "screenshot.jpg"}
--------------------------------------------------------------------------------
/content/themes/semantic/assets/js/scripts.js:
--------------------------------------------------------------------------------
1 | (function($) {
2 | $('.message .close').on('click', function() {
3 | $(this).closest('.message').remove();
4 | });
5 | })(jQuery);
--------------------------------------------------------------------------------
/content/themes/default/views/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | Require all denied
3 |
4 |
5 | Deny from all
6 |
--------------------------------------------------------------------------------
/content/themes/semantic/views/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | Require all denied
3 |
4 |
5 | Deny from all
6 |
--------------------------------------------------------------------------------
/content/themes/default/assets/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/default/assets/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/content/themes/default/assets/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/default/assets/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/content/themes/default/assets/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/default/assets/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/content/themes/default/assets/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/default/assets/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/basic/assets/fonts/icons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/basic/assets/fonts/icons.eot
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/basic/assets/fonts/icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/basic/assets/fonts/icons.ttf
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/basic/assets/fonts/icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/basic/assets/fonts/icons.woff
--------------------------------------------------------------------------------
/content/themes/semantic/views/_partials/alert.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/default/assets/fonts/icons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/default/assets/fonts/icons.eot
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/default/assets/fonts/icons.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/default/assets/fonts/icons.otf
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/default/assets/fonts/icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/default/assets/fonts/icons.ttf
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/default/assets/fonts/icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/default/assets/fonts/icons.woff
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/default/assets/images/flags.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/default/assets/images/flags.png
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/material/assets/fonts/icons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/material/assets/fonts/icons.eot
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/material/assets/fonts/icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/material/assets/fonts/icons.ttf
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/default/assets/fonts/icons.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/default/assets/fonts/icons.woff2
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/github/assets/fonts/octicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/github/assets/fonts/octicons.ttf
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/github/assets/fonts/octicons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/github/assets/fonts/octicons.woff
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/material/assets/fonts/icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/material/assets/fonts/icons.woff
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/material/assets/fonts/icons.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/material/assets/fonts/icons.woff2
--------------------------------------------------------------------------------
/content/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/common/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/themes/github/assets/fonts/octicons-local.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bkader/ci-theme/HEAD/content/themes/semantic/assets/css/themes/github/assets/fonts/octicons-local.ttf
--------------------------------------------------------------------------------
/content/uploads/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/common/css/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/common/fonts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/common/img/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/common/js/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/default/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/semantic/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/default/assets/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/default/views/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/semantic/assets/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/semantic/views/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/default/assets/css/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/default/assets/fonts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/default/assets/img/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/default/assets/js/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/semantic/assets/img/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/semantic/assets/js/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/default/views/_layouts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/default/views/_master/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/default/views/_modules/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/default/views/_partials/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/semantic/assets/fonts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/semantic/views/_layouts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/semantic/views/_modules/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/semantic/views/_partials/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/semantic/views/_modules/admin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/content/themes/default/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Bootstrap",
3 | "description": "Default CI-Theme theme using Bootstrap v3.3.7",
4 | "author": "Kader Bouyakoub",
5 | "website": "https://www.ianhub.com/",
6 | "screenshot": "screenshot.jpg"
7 | }
--------------------------------------------------------------------------------
/content/themes/default/views/_layouts/default.php:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/content/themes/default/views/_partials/alert.php:
--------------------------------------------------------------------------------
1 |
2 | ×
3 |
4 |
--------------------------------------------------------------------------------
/content/themes/semantic/views/_layouts/default.php:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/content/themes/semantic/assets/css/style.css:
--------------------------------------------------------------------------------
1 | @charset "utf8";
2 |
3 | body {
4 | background-color: #e6e6e6;
5 | padding-top: 59px;
6 | }
7 |
8 | body>.ui.grid.container {
9 | padding-top: 0 !important;
10 | }
11 |
12 | footer {
13 | width: 100%;
14 | background-color: #fff;
15 | padding-top: 1rem;
16 | border-top: 1px solid #ddd;
17 | margin-top: 1rem;
18 | }
19 |
20 | @media (min-width: 768px) {
21 | footer {
22 | position: fixed;
23 | left: 0;
24 | bottom: 0;
25 | z-index: 1051;
26 | }
27 | }
28 |
29 | code,
30 | kbd,
31 | pre,
32 | samp {
33 | font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
34 | }
35 |
36 | code {
37 | padding: 2px 4px;
38 | font-size: 90%;
39 | color: #c7254e;
40 | background-color: #f9f2f4;
41 | border-radius: 4px;
42 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .phpintel
2 |
3 | # remove application files & folder
4 | !.gitignore
5 | !LICENSE
6 | !README.md
7 | application/cache/*
8 | application/config/*
9 | !application/config/theme.php
10 | application/controllers/*
11 | !application/controllers/Example.php
12 | !application/controllers/Admin.php
13 | application/core/*
14 | application/helpers/*
15 | !application/helpers/theme_helper.php
16 | application/hooks/*
17 | application/language/*
18 | application/libraries/*
19 | !application/libraries/Theme.php
20 | !application/libraries/Events.php
21 | application/logs/*
22 | application/models/*
23 | application/third_party/*
24 | application/views/*
25 | application/.htaccess
26 | application/index.html
27 |
28 | # remove system files & folder
29 | system/*
30 |
31 | # Keepin content folder
32 | !content/*
33 |
34 | # Remove index.php
35 | index.php
36 |
37 | ## Sublime Text cache files
38 | *.tmlanguage.cache
39 | *.tmPreferences.cache
40 | *.stTheme.cache
41 | *.sublime-workspace
42 | *.sublime-project
43 |
--------------------------------------------------------------------------------
/content/themes/semantic/views/_partials/sidebar.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
This view is located in:
4 |
www/content/themes/semantic/views/_partials/sidebar.php
5 |
6 |
7 |
8 |
content/uploads/
9 |
10 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/content/themes/default/views/example.php:
--------------------------------------------------------------------------------
1 |
2 | print_alert() function.'); ?>
3 |
4 |
5 |
6 |
7 |
8 |
The page you are looking at is being generated dynamically by CodeIgniter.
9 |
10 |
If you would like to edit this page you'll find it located at:
11 |
www/content/themes/default/views/welcome.php
12 |
13 |
The corresponding controller for this page is found at:
14 |
application/controllers/Welcome.php
15 |
16 |
If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide .
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/content/themes/semantic/views/example.php:
--------------------------------------------------------------------------------
1 |
2 | print_alert() function.'); ?>
3 |
4 |
5 |
6 |
The page you are looking at is being generated dynamically by CodeIgniter.
7 |
8 |
If you would like to edit this page you'll find it located at:
9 |
www/content/themes/default/views/welcome.php
10 |
11 |
The corresponding controller for this page is found at:
12 |
application/controllers/Welcome.php
13 |
14 |
If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide .
15 |
16 |
17 |
--------------------------------------------------------------------------------
/content/themes/default/views/_partials/sidebar.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
This view is located in:
5 |
www/content/themes/default/views/_partials/sidebar.php
6 |
7 |
8 |
9 |
content/uploads/
10 |
11 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2017, Kader Bouyakoub
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------
/content/themes/default/views/_partials/footer.php:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/content/themes/semantic/views/_partials/footer.php:
--------------------------------------------------------------------------------
1 |
21 |
--------------------------------------------------------------------------------
/content/themes/semantic/views/_modules/admin/dashboard.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
Each module can have its own admin area. All you need to do is to create the admin controller:
6 |
./application/modules/module_name /controllers/Admin.php
7 |
This controller should extends Admin_Controller and I guess you know why (don't you?!! ).
8 |
A module called admin is provided to display admin panel main page. Feel free to add anything to it.
9 |
10 |
More Details
11 |
Let's suppose you have a module called users that has as many controllers, libraries ... as you want. If you want to create an admin area to this module, simply create the Admin.php controller. DONE!
12 |
Next, you will have to create views! The best thing to do is to create views inside one of the following folders:
13 |
14 |
15 | ../themes/theme_name /modules/module_name /admin/view_file.php
16 | ../themes/theme_name /views/admin/view_file.php
17 | ../application/modules/module_name /views/admin/view_file.php
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/content/themes/default/views/admin.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
If you use my CodeIgniter Starter Kit , each module can have its own admin area. All you need to do is to create the admin controller:
6 |
./application/modules/module_name /controllers/Admin.php
7 |
This controller should extends Admin_Controller and I guess you know why (don't you?!! ).
8 |
A module called admin is provided to display admin panel main page. Feel free to add anything to it.
9 |
10 |
More Details
11 |
Let's suppose you have a module called users that has as many controllers, libraries ... as you want. If you want to create an admin area to this module, simply create the Admin.php controller. DONE!
12 |
Next, you will have to create views! The best thing to do is to create views inside one of the following folders:
13 |
14 |
15 | ../themes/theme_name /views/_modules/module_name /admin/view_file.php
16 | ../themes/theme_name /views/admin/view_file.php
17 | ../application/modules/module_name /views/admin/view_file.php
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/content/themes/semantic/views/admin.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
If you use my CodeIgniter Starter Kit , each module can have its own admin area. All you need to do is to create the admin controller:
6 |
./application/modules/module_name /controllers/Admin.php
7 |
This controller should extends Admin_Controller and I guess you know why (don't you?!! ).
8 |
A module called admin is provided to display admin panel main page. Feel free to add anything to it.
9 |
10 |
More Details
11 |
Let's suppose you have a module called users that has as many controllers, libraries ... as you want. If you want to create an admin area to this module, simply create the Admin.php controller. DONE!
12 |
Next, you will have to create views! The best thing to do is to create views inside one of the following folders:
13 |
14 |
15 | ../themes/theme_name /views/_modules/module_name /admin/view_file.php
16 | ../themes/theme_name /views/admin/view_file.php
17 | ../application/modules/module_name /views/admin/view_file.php
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/content/themes/semantic/views/_partials/header.php:
--------------------------------------------------------------------------------
1 |
38 |
--------------------------------------------------------------------------------
/content/themes/default/views/_master/default.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
20 |
21 |
22 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | 'UA-XXXXX-Y')): ?>
35 |
36 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/content/themes/semantic/views/_master/default.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
20 |
21 |
22 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | 'UA-XXXXX-Y')): ?>
35 |
36 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/content/themes/default/views/_partials/header.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
15 |
16 |
32 |
33 |
38 |
39 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/content/common/js/html5shiv-3.7.3.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
3 | */
4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML=" ",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);
5 |
--------------------------------------------------------------------------------
/application/controllers/Admin.php:
--------------------------------------------------------------------------------
1 |
10 | *
11 | * Permission is hereby granted, free of charge, to any person obtaining a copy
12 | * of this software and associated documentation files (the "Software"), to deal
13 | * in the Software without restriction, including without limitation the rights
14 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | * copies of the Software, and to permit persons to whom the Software is
16 | * furnished to do so, subject to the following conditions:
17 | *
18 | * The above copyright notice and this permission notice shall be included in
19 | * all copies or substantial portions of the Software.
20 | *
21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 | * THE SOFTWARE.
28 | *
29 | * @package CodeIgniter
30 | * @author Kader Bouyakoub
31 | * @copyright Copyright (c) 2017 - 2018, Kader Bouyakoub
32 | * @license http://opensource.org/licenses/MIT MIT License
33 | * @link https://github.com/bkader
34 | * @since Version 1.0.0
35 | */
36 | defined('BASEPATH') OR exit('No direct script access allowed');
37 |
38 | /**
39 | * Admin Module
40 | *
41 | * @package CodeIgniter\CI-Theme
42 | * @category Controllers
43 | * @author Kader Bouyakoub
44 | * @link https://github.com/bkader
45 | */
46 |
47 | // class Admin extends Admin_Controller
48 | class Admin extends CI_Controller
49 | {
50 | /**
51 | * Class constructot
52 | * Used only to load the library.
53 | */
54 | public function __construct()
55 | {
56 | parent::__construct();
57 | $this->load->library('theme');
58 | // Github buttons (Remove this please)
59 | $this->theme->add_js('https://buttons.github.io/buttons.js');
60 | }
61 |
62 | /**
63 | * Admin panel homepage.
64 | */
65 | public function index()
66 | {
67 | $this->theme->title('Admin Panel')
68 | ->add_partial('header')
69 | ->add_partial('footer')
70 | ->add_partial('sidebar')
71 | ->load('admin');
72 | }
73 |
74 | /**
75 | * Admin panel using Semantic UI theme.
76 | */
77 | public function semantic()
78 | {
79 | $this->theme->theme('semantic')
80 | ->add_partial('header')
81 | ->add_partial('footer')
82 | ->add_partial('sidebar')
83 | ->title('Admin Panel')
84 | ->load('admin');
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/ci-theme.sublime-completions:
--------------------------------------------------------------------------------
1 | {
2 | "scope": "source.php",
3 | "completions":
4 | [
5 | {"trigger": "theme_set", "contents": "\\$this->theme->set('${1:var}', '${2:value}'${3:, false});"},
6 | {"trigger": "theme_get", "contents": "\\$this->theme->get('${1:name}'${2:, 'index'});"},
7 | {"trigger": "theme_theme", "contents": "\\$this->theme->theme('${1:default}');"},
8 | {"trigger": "theme_master", "contents": "\\$this->theme->master('${1:default}');"},
9 | {"trigger": "theme_layout", "contents": "\\$this->theme->layout('${1:default}');"},
10 | {"trigger": "theme_title", "contents": "\\$this->theme->title('${1:Page Title}');"},
11 | {"trigger": "theme_description", "contents": "\\$this->theme->description('${1:This is a dummy page description}');"},
12 | {"trigger": "theme_keywords", "contents": "\\$this->theme->keywords('${1:these, are, dummy, keywords}');"},
13 | {"trigger": "theme_add_meta", "contents": "\\$this->theme->add_meta('${1:name}', '${2:content}');"},
14 | {"trigger": "theme_meta", "contents": "\\$this->theme->meta('${1:name}', '${2:content}'${3:, 'attributes'}${4:, 'type'});"},
15 | {"trigger": "theme_css", "contents": "\\$this->theme->css('${1:files}'${2:, 'CDN_URL'}${3:, 'attributes'}${4:, 'folder'});"},
16 | {"trigger": "theme_add_css", "contents": "\\$this->theme->add_css('${1:files}');"},
17 | {"trigger": "theme_prepend_css", "contents": "\\$this->theme->prepend_css('${1:files}');"},
18 | {"trigger": "theme_remove_css", "contents": "\\$this->theme->remove_css('${1:files}');"},
19 | {"trigger": "theme_replace_css", "contents": "\\$this->theme->replace_css('${1:files}');"},
20 | {"trigger": "theme_js", "contents": "\\$this->theme->js('${1:files}'${2:, 'CDN_URL'}${3:, 'attributes'}${4:, 'folder'});"},
21 | {"trigger": "theme_add_js", "contents": "\\$this->theme->add_js('${1:files}');"},
22 | {"trigger": "theme_prepend_js", "contents": "\\$this->theme->prepend_js('${1:files}');"},
23 | {"trigger": "theme_remove_js", "contents": "\\$this->theme->remove_js('${1:files}');"},
24 | {"trigger": "theme_replace_js", "contents": "\\$this->theme->replace_js('${1:files}');"},
25 | {"trigger": "theme_partial", "contents": "\\$this->theme->partial('${1:view}'${2:, \\$data}${3:, false});"},
26 | {"trigger": "theme_add_partial", "contents": "\\$this->theme->add_partial('${1:view}'${2:, \\$data}${3:, 'name'});"},
27 | {"trigger": "theme_remove_partial", "contents": "\\$this->theme->remove_partial('${1:partials}');"},
28 | {"trigger": "theme_replace_partial", "contents": "\\$this->theme->replace_partial('${1:old}', '${2:new}'${3:, \\$data});"},
29 | {"trigger": "theme_view", "contents": "\\$this->theme->view('${1:name}'${2:, \\$data}${3:, false});"},
30 | {"trigger": "theme_load", "contents": "\\$this->theme->load('${1:name}'${2:, \\$data}${3:, false}${4:, 'default'});"},
31 | {"trigger": "theme_render", "contents": "\\$this->theme->render(\n\t'${1:view}'${2:, \n\t\\$data}${3:, \n\t'Page Title'}${4:, \n\tarray()}${5:, \n\tfalse}\n);"},
32 | {"trigger": "theme_build", "contents": "\\$this->theme->build(\n\t'${1:view}'${2:, \n\t\\$data}${3:, \n\t'Page Title'}${4:, \n\tarray()}\n);"}
33 | ]
34 | }
--------------------------------------------------------------------------------
/application/controllers/Example.php:
--------------------------------------------------------------------------------
1 |
10 | *
11 | * Permission is hereby granted, free of charge, to any person obtaining a copy
12 | * of this software and associated documentation files (the "Software"), to deal
13 | * in the Software without restriction, including without limitation the rights
14 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | * copies of the Software, and to permit persons to whom the Software is
16 | * furnished to do so, subject to the following conditions:
17 | *
18 | * The above copyright notice and this permission notice shall be included in
19 | * all copies or substantial portions of the Software.
20 | *
21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 | * THE SOFTWARE.
28 | *
29 | * @package CodeIgniter
30 | * @author Kader Bouyakoub
31 | * @copyright Copyright (c) 2017 - 2018, Kader Bouyakoub
32 | * @license http://opensource.org/licenses/MIT MIT License
33 | * @link https://github.com/bkader
34 | * @since Version 1.0.0
35 | */
36 | defined('BASEPATH') OR exit('No direct script access allowed');
37 |
38 | class Example extends CI_Controller
39 | {
40 | public function __construct()
41 | {
42 | parent::__construct();
43 |
44 | // Make sure you remove this once you use the library.
45 | $this->config->set_item('base_url', 'http://localhost/ci-theme/');
46 |
47 | // You should probabely autoload it.
48 | $this->load->library('theme');
49 |
50 | // Github buttons (Remove this please)
51 | $this->theme->add_js('https://buttons.github.io/buttons.js');
52 | }
53 |
54 | public function index()
55 | {
56 | // These are used to add partial views.
57 | $this->theme
58 | ->add_partial('header')
59 | ->add_partial('sidebar')
60 | ->add_partial('footer');
61 |
62 | // You can use this syntax here,
63 | // $this->theme->title('Example');
64 | // $this->theme->load('example');
65 |
66 | /**
67 | * Or for the shorthand version.
68 | * @see Theme.php:1057
69 | */
70 | render('example', null, 'Example');
71 | }
72 |
73 | /**
74 | * Example to use Semantic UI
75 | *
76 | * @return void
77 | */
78 | public function semantic()
79 | {
80 | $this->theme
81 | ->theme('semantic')
82 | ->add_partial('header')
83 | ->add_partial('sidebar')
84 | ->add_partial('footer');
85 |
86 | // As the method above, you can use
87 | // either the long or the short version.
88 | // $this->theme
89 | // ->title('Semantic Theme')
90 | // ->add_css('style')
91 | // ->add_js('scripts')
92 | // ->load('example');
93 |
94 | /**
95 | * Or for the shorthand version.
96 | * @see Theme.php:1057
97 | */
98 | render('example', null, 'Semantic Theme');
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/content/common/js/respond-1.4.2.min.js:
--------------------------------------------------------------------------------
1 | /*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
2 | * Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
3 | * */
4 |
5 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b
10 | *
11 | * Permission is hereby granted, free of charge, to any person obtaining a copy
12 | * of this software and associated documentation files (the "Software"), to deal
13 | * in the Software without restriction, including without limitation the rights
14 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | * copies of the Software, and to permit persons to whom the Software is
16 | * furnished to do so, subject to the following conditions:
17 | *
18 | * The above copyright notice and this permission notice shall be included in
19 | * all copies or substantial portions of the Software.
20 | *
21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 | * THE SOFTWARE.
28 | *
29 | * @package CodeIgniter
30 | * @author Kader Bouyakoub
31 | * @copyright Copyright (c) 2017 - 2018, Kader Bouyakoub
32 | * @license http://opensource.org/licenses/MIT MIT License
33 | * @link https://github.com/bkader
34 | * @since Version 1.0.0
35 | */
36 | defined('BASEPATH') OR exit('No direct script access allowed');
37 |
38 | /**
39 | * Theme Library Configuration
40 | *
41 | * This files holds theme settings
42 | *
43 | * @package CodeIgniter
44 | * @category Configuration
45 | * @author Kader Bouyakoub
46 | * @link https://github.com/bkader
47 | * @link https://twitter.com/KaderBouyakoub
48 | */
49 |
50 | /*
51 | | -------------------------------------------------------------------
52 | | Theme Settings
53 | | -------------------------------------------------------------------
54 | |
55 | | 'theme.theme' the activated site theme.
56 | | 'theme.master' theme default master view file.
57 | | 'theme.layout' theme default layout file.
58 | | 'theme.title_sep' string to be used as title separator.
59 | | 'theme.compress' whether to compress HTML output to not.
60 | | 'theme.cache_lifetime' whether to cache output or not.
61 | |
62 | | CDN settings:
63 | | 'theme.cdn_enabled' If true, the 2nd param of css(), js() is used.
64 | | 'theme.cdn_server' If your host your assets on a CDN, privide URL.
65 | */
66 |
67 | // Site default theme
68 | $config['theme']['theme'] = 'default';
69 |
70 | // Site default master view file.
71 | $config['theme']['master'] = 'default';
72 |
73 | // Site default layout file
74 | $config['theme']['layout'] = 'default';
75 |
76 | // Site title separator
77 | $config['theme']['title_sep'] = '';
78 |
79 | // Minify HTML Output
80 | $config['theme']['compress'] = (defined('ENVIRONMENT') && ENVIRONMENT == 'production');
81 |
82 | // Cache life time
83 | $config['theme']['cache_lifetime'] = 0;
84 |
85 | // Enable CDN (to use 2nd argument of css() & js() functions)
86 | $config['theme']['cdn_enabled'] = (defined('ENVIRONMENT') && ENVIRONMENT == 'production');
87 |
88 | // The CDN URL if you host your files there
89 | $config['theme']['cdn_server'] = ''; // i.e: 'http://static.myhost.com/';
90 |
91 | // ------------------------------------------------------------------------
92 | // Backup plan :D for site name, desription & keywords
93 | // ------------------------------------------------------------------------
94 |
95 | // Default site name, description and keywords.
96 | $config['theme']['site_name'] = 'CI-Theme';
97 | $config['theme']['site_description'] = 'Simply makes your CI-based applications themable. Easy and fun to use.';
98 | $config['theme']['site_keywords'] = 'codeigniter, themes, libraries, bkader, bouyakoub';
99 |
100 | /* End of file theme.php */
101 | /* Location: ./application/config/theme.php */
102 |
--------------------------------------------------------------------------------
/application/libraries/Events.php:
--------------------------------------------------------------------------------
1 |
13 | * @author Dan Horrigan
14 | * @license Apache License v2.0
15 | * @copyright 2010 Dan Horrigan
16 | *
17 | * Licensed under the Apache License, Version 2.0 (the "License");
18 | * you may not use this file except in compliance with the License.
19 | * You may obtain a copy of the License at
20 | *
21 | * http://www.apache.org/licenses/LICENSE-2.0
22 | *
23 | * Unless required by applicable law or agreed to in writing, software
24 | * distributed under the License is distributed on an "AS IS" BASIS,
25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26 | * See the License for the specific language governing permissions and
27 | * limitations under the License.
28 | */
29 |
30 | /**
31 | * Events Library
32 | */
33 | class Events
34 | {
35 |
36 | /**
37 | * @var array An array of listeners
38 | */
39 | protected static $_listeners = array();
40 |
41 | // ------------------------------------------------------------------------
42 |
43 | /**
44 | * Register
45 | *
46 | * Registers a Callback for a given event
47 | *
48 | * @access public
49 | * @param string The name of the event
50 | * @param array The callback for the Event
51 | * @return void
52 | */
53 | public static function register($event, array $callback)
54 | {
55 | $key = get_class($callback[0]).'::'.$callback[1];
56 | self::$_listeners[$event][$key] = $callback;
57 | self::log_message('debug', 'Events::register() - Registered "'.$key.' with event "'.$event.'"');
58 | }
59 |
60 | // ------------------------------------------------------------------------
61 |
62 | /**
63 | * Trigger
64 | *
65 | * Triggers an event and returns the results. The results can be returned
66 | * in the following formats:
67 | *
68 | * 'array'
69 | * 'json'
70 | * 'serialized'
71 | * 'string'
72 | *
73 | * @access public
74 | * @param string The name of the event
75 | * @param mixed Any data that is to be passed to the listener
76 | * @param string The return type
77 | * @return mixed The return of the listeners, in the return type
78 | */
79 | public static function trigger($event, $data = '', $return_type = 'string')
80 | {
81 | self::log_message('debug', 'Events::trigger() - Triggering event "'.$event.'"');
82 |
83 | $calls = array();
84 |
85 | if (self::has_listeners($event))
86 | {
87 | foreach (self::$_listeners[$event] as $listener)
88 | {
89 | if (is_callable($listener))
90 | {
91 | $calls[] = call_user_func($listener, $data);
92 | }
93 | }
94 | }
95 |
96 | return (empty($calls)) ? $data : self::_format_return($calls, $return_type);
97 | }
98 |
99 | // ------------------------------------------------------------------------
100 |
101 | /**
102 | * Format Return
103 | *
104 | * Formats the return in the given type
105 | *
106 | * @access protected
107 | * @param array The array of returns
108 | * @param string The return type
109 | * @return mixed The formatted return
110 | */
111 | protected static function _format_return(array $calls, $return_type)
112 | {
113 | self::log_message('debug', 'Events::_format_return() - Formating calls in type "'.$return_type.'"');
114 |
115 | switch ($return_type)
116 | {
117 | case 'json':
118 | return json_encode($calls);
119 | break;
120 | case 'serialized':
121 | return serialize($calls);
122 | break;
123 | case 'string':
124 | $str = '';
125 | foreach ($calls as $call)
126 | {
127 | $str .= $call;
128 | }
129 | return $str;
130 | break;
131 | default:
132 | return $calls;
133 | break;
134 | }
135 |
136 | return FALSE;
137 | }
138 |
139 | // ------------------------------------------------------------------------
140 |
141 | /**
142 | * Has Listeners
143 | *
144 | * Checks if the event has listeners
145 | *
146 | * @access public
147 | * @param string The name of the event
148 | * @return bool Whether the event has listeners
149 | */
150 | public static function has_listeners($event)
151 | {
152 | self::log_message('debug', 'Events::has_listeners() - Checking if event "'.$event.'" has listeners.');
153 |
154 | if (isset(self::$_listeners[$event]) AND count(self::$_listeners[$event]) > 0)
155 | {
156 | return TRUE;
157 | }
158 | return FALSE;
159 | }
160 |
161 | // ------------------------------------------------------------------------
162 |
163 | /**
164 | * Log Message
165 | *
166 | * Pulled out for unit testing
167 | *
168 | * @param string $type
169 | * @param string $message
170 | * @return void
171 | */
172 | public static function log_message($type = 'debug', $message = '')
173 | {
174 | if (function_exists('log_message'))
175 | {
176 | log_message($type, $message);
177 | }
178 | }
179 | }
180 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CodeIgniter Theme Library
2 | There are plenty of CodeIgniter template library. I tried most of them and I must say that they rock. Though, I had to make my own that suits my needs and that may be easy to implement, easy to understand and easy to use.
3 |
4 | ### UPDATED (2018/01/14 @ 05:00 AM).
5 | I have added [Event](https://github.com/ericbarnes/CodeIgniter-Events) so themes would be able to enqueue their own CSS files, JS files an meta tags. They can even manipulate html and body classes.
6 | This is the first part of it, other things will be added later. You register as many events as you want as long as you trigger them in the library.
7 | To see how it's done, go the provided themes **functions.php** files ([default](https://github.com/bkader/ci-theme/blob/acb698e766475286ce941bcb5b8f2037ad0c8ae1/content/themes/default/functions.php#L56) and [semantic](https://github.com/bkader/ci-theme/blob/acb698e766475286ce941bcb5b8f2037ad0c8ae1/content/themes/semantic/functions.php#L55)) to see how it's done.
8 | Don't forget to take a look at master view files as well([default](https://github.com/bkader/ci-theme/blob/master/content/themes/default/views/_master/default.php) and [semantic](https://github.com/bkader/ci-theme/blob/master/content/themes/semantic/views/_master/default.php)).
9 |
10 | ### UPDATED
11 | **assets_url()** removed because it was kind of useless but the following methods were added:
12 | * get_theme_url()
13 | * theme_url()
14 | * get_theme_path()
15 | * theme_path()
16 | * get_upload_url()
17 | * upload_url()
18 | * get_upload_path()
19 | * upload_path()
20 | * get_common_url()
21 | * common_url()
22 | * get_common_path()
23 | * common_path()
24 |
25 | All methods with **get_** will simply return the string while those without it will echo it.
26 | Example:
27 | theme_url('css/style.css'); // Output: ...com/content/themes/THEME/css/style.css
28 |
29 |
30 | ## What is this library about?
31 | It offers you the possibility to implement theming feature to your CodeIgniter applications with simple folders structure and ease of use (It works even when using **HMVC**).
32 |
33 | ## How to install?
34 | All you have to do is to download provided files into your CodeIgniter install and you are done. Of course, some configuration need to be done and THEN you are really done.
35 |
36 | ## Files provided
37 | This library comes in two (**2**) parts, the first goes into your application folder and the other in your public accessible folder (_public_html_, _www_...)
38 |
39 | #### Folders structure
40 |
41 | - application
42 | - config/theme.php
43 | - helpers/theme_helper.php (_NOT NEEDED_)
44 | - libraries/Theme.php
45 |
46 | - content
47 | - common
48 | - themes
49 | - default
50 | - assets/
51 | - views/
52 | - _layouts/
53 | - default.php
54 | - _master/
55 | - default.php
56 | - _modules/
57 | - _partials/
58 | - alert.php
59 | - footer.php
60 | - header.php
61 | - sidebar.php
62 | - semantic (same as above)
63 | - uploads
64 | Other files are simply either **css**, **js** or **images**.
65 |
66 | ##Library Methods
67 |
68 | - **set**: sets variables to pass to view files.
69 | - **get**: get something from theme config property.
70 | - **theme**: changes the current theme.
71 | - **master**: changes the master view file to use.
72 | - **layout**: use a different layout.
73 | - **title**, **description**, **keywords**: set page's meta tags content.
74 | - **add_meta**, **meta**: the first one appends a meta tag and the other one displays the full html <meta> tag.
75 | - **assets_url** and **uploads_url**: both return the full URL to their respective folders. (_content/assets_ and _content/uploads_)
76 | - Methods on **CSS** and **JS** (I use **x** to represente them both):
77 | - **add_x**: adds the file to files list.
78 | - **prepend_x**: adds the at the beginning of files list.
79 | - **remove_x**: remove a file from files list.
80 | - **replace_x**: replaces a file by a new one.
81 | - **get_x**: returns an array of loaded **X** files.
82 | - **x_url**: returns the full url to **X** file.
83 | - **x**: css() or js() display full html tag with the given file.
84 |
85 | ## Where are files located?
86 | CI-Theme library looks for views in a particular order so that everything can be overridden. Here is in order where files should be:
87 |
88 | #### Views:
89 | 2. themes/**theme_name**/views/_modules/**module_name**/
90 | 3. themes/**theme_name**/views/
91 | 4. **module_location**/**module_name**/views/
92 | 5. **views_path** (which is by default **APPPATH/views/**)
93 |
94 | #### Partials:
95 | 1. themes/**theme_name**/views/_modules/**module_name**/_partials/
96 | 3. themes/**theme_name**/views/_partials/
97 | 4. **module_location**/**module_name**/views/_partials/
98 | 5. **views_path**/_partials/
99 |
100 | #### Layouts:
101 | 1. themes/**theme_name**/views/_modules/**module_name**/_layouts/
102 | 3. themes/**theme_name**/views/_layouts/
103 | 4. **module_location**/**module_name**/views/_layouts/
104 | 5. **views_path**/_layouts/.
105 |
106 | #### Master View:
107 | The master view is named **default.php** by default but it can be overridden (4th parameter of Theme::load()).
108 | The library will search inside these folders in the following order:
109 | 1. themes/**theme_name**/views/_modules/**module_name**/_master/
110 | 3. themes/**theme_name**/views/_master/
111 | 4. **module_location**/**module_name**/views/_master/
112 | 5. **views_path**/_master/
113 |
114 | ## How to use?
115 | Load the library where you want to use or you can autoload it inside **autoload.php** file.
116 |
117 | `$autoload['libraries'] = array('theme');`
118 |
119 | In your controller, simple use library's method or chain them (ones that can be chained). Example (see: *controllers/Example.php*)
120 |
121 | $this->theme
122 | ->title('Title Goes Here')
123 | ->add_css('added_css1', 'added_css2')
124 | ->prepend_css('prepended_css1'),
125 | ->add_js('added_js1'),
126 | ->prepend_js('prepended_js1')
127 | ->add_partial('header')
128 | ->load('view_file', $data);
129 |
130 | There is a short version of all this but in case you want to add partial views you have to use `$this->theme->add_partial()` before using the function.
131 |
132 | $this->theme
133 | ->add_partial('header')
134 | ->add_partial('footer');
135 |
136 | render('view_file', $data, 'Title Goes Here', array(
137 | // Available options.
138 | 'css' => array('added_css1', 'added_css2'),
139 | 'prepend_css' => 'prepended_css1',
140 | 'js' => 'added_js1',
141 | 'prepend_js' => 'prepended_js1',
142 | ));
143 |
144 | Feel free to explore the library to know more about it and if you have any questions, I am here to answer as long as I am still alive.
145 |
146 | #CREDITS
147 | All credits go to their respective owners: **CodeIgniter**, **Bootstrap**, **Semantic-UI** and **Ericbarnes**. (and some of it for my work :D)
148 |
--------------------------------------------------------------------------------
/content/themes/default/functions.php:
--------------------------------------------------------------------------------
1 |
10 | *
11 | * Permission is hereby granted, free of charge, to any person obtaining a copy
12 | * of this software and associated documentation files (the "Software"), to deal
13 | * in the Software without restriction, including without limitation the rights
14 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | * copies of the Software, and to permit persons to whom the Software is
16 | * furnished to do so, subject to the following conditions:
17 | *
18 | * The above copyright notice and this permission notice shall be included in
19 | * all copies or substantial portions of the Software.
20 | *
21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 | * THE SOFTWARE.
28 | *
29 | * @package CodeIgniter
30 | * @author Kader Bouyakoub
31 | * @copyright Copyright (c) 2017 - 2018, Kader Bouyakoub
32 | * @license http://opensource.org/licenses/MIT MIT License
33 | * @link https://github.com/bkader
34 | * @since Version 1.0.0
35 | */
36 | defined('BASEPATH') OR exit('No direct script access allowed');
37 |
38 | /**
39 | * Default theme functions file.
40 | *
41 | * This file contain any type of helpers used by the current theme.
42 | *
43 | * @package CodeIgniter
44 | * @subpackage CI-Theme
45 | * @category Theme Helpers
46 | * @author Kader Bouyakoub
47 | * @link https://github.com/bkader
48 | * @link https://twitter.com/KaderBouyakoub
49 | */
50 |
51 |
52 | /**
53 | * This class is here to demonstrate the use of
54 | * Events library with Theme library.
55 | */
56 | class Theme_class
57 | {
58 | public function __construct()
59 | {
60 | /**
61 | * With this event registered, theme can independently enqueue
62 | * all needed StyleSheets without adding them in controllers.
63 | */
64 | Events::register('enqueue_styles', array($this, 'styles'));
65 |
66 | /**
67 | * With this event registered, theme can independently enqueue
68 | * all needed JS files without adding them in controllers.
69 | */
70 | Events::register('enqueue_scripts', array($this, 'scripts'));
71 |
72 | /**
73 | * With this event registered, theme can independently enqueue
74 | * all needed meta tags without adding them in controllers.
75 | */
76 | Events::register('enqueue_metadata', array($this, 'metadata'));
77 |
78 | // Manipulating class.
79 | Events::register('html_class', array($this, 'html_class'));
80 |
81 | // Manipulating class.
82 | Events::register('body_class', array($this, 'body_class'));
83 | }
84 |
85 | // ------------------------------------------------------------------------
86 |
87 | /**
88 | * Enqueue all theme's StyleSheets.
89 | * @access public
90 | * @return void
91 | */
92 | public function styles()
93 | {
94 | // Let's add bootstrap css file.
95 | add_style('assets/css/bootstrap.min');
96 |
97 | // Now we add the the default StyleSheet.
98 | add_style('assets/css/style');
99 | }
100 |
101 | // ------------------------------------------------------------------------
102 |
103 | /**
104 | * Enqueue all theme's JavaScripts.
105 | * @access public
106 | * @return void
107 | */
108 | public function scripts()
109 | {
110 | // Let's add bootstrap js file.
111 | prepend_script('assets/js/bootstrap.min');
112 | }
113 |
114 | // ------------------------------------------------------------------------
115 |
116 | /**
117 | * Enqueue all theme's Meta tags.
118 | * @access public
119 | * @return void
120 | */
121 | public function metadata()
122 | {
123 | add_meta('generator', 'CI-Theme Library');
124 | add_meta('author', 'Kader Bouyakoub');
125 | add_meta('author', 'https://github.com/bkader', 'rel');
126 |
127 | // Let's add some extra tags.
128 | add_meta('twitter:card', 'summary');
129 | add_meta('twitter:site', '@KaderBouyakoub');
130 | add_meta('twitter:creator', '@KaderBouyakoub');
131 | add_meta('og:url', current_url());
132 | add_meta('og:title', 'CI-Theme Library');
133 | add_meta('og:description', 'Simply makes your CI-based applications themable. Easy and fun to use.');
134 | add_meta('og:image', get_theme_url('screenshot.png'));
135 |
136 | // And why not more!
137 | add_meta('manifest', base_url('site.webmanifest'), 'rel');
138 | add_meta('apple-touch-icon', base_url('icon.png'), 'rel');
139 | }
140 |
141 | // ------------------------------------------------------------------------
142 |
143 | /**
144 | * Let's manipulate html class.
145 | * @access public
146 | * @param string $class
147 | * @return string
148 | */
149 | public function html_class($class)
150 | {
151 | // You can add class for a specific module!
152 | // if (is_module('module_name')) {}
153 | // if (is_module('mod_1, mod_2'))
154 |
155 | // Or set class for a specific controller.
156 | if (is_controller('example'))
157 | {
158 | return 'html-class-default-theme controller-example';
159 | }
160 |
161 | if (is_controller('admin'))
162 | {
163 | return 'html-class-default-theme controller-admin';
164 | }
165 |
166 | // You can as well set if for a specific method.
167 | // if (is_method(...)) {}
168 |
169 | // And you can chain all.
170 | // if (is_controller('example') && is_method('index')) {}
171 |
172 | return $class;
173 | }
174 |
175 | // ------------------------------------------------------------------------
176 |
177 | /**
178 | * Manipulating class.
179 | * @access public
180 | * @param string $class
181 | * @return string
182 | */
183 | public function body_class($class)
184 | {
185 | return 'body-class-default-theme';
186 | }
187 |
188 | }
189 |
190 | // Always instantiate the class so trigger get registered.
191 | $theme_class = new Theme_class;
192 |
193 | // ------------------------------------------------------------------------
194 |
195 | if ( ! function_exists('bs_alert'))
196 | {
197 | /**
198 | * Returns a Bootstrap alert.
199 | *
200 | * @param string $message the message to be displayed.
201 | * @return string Bootstrap full alert.
202 | */
203 | function bs_alert($message = '', $type = 'info')
204 | {
205 | if (empty($message))
206 | {
207 | return;
208 | }
209 |
210 | // Turn 'error' into 'danger' because it does not exist on bootstrap.
211 | $type == 'error' && $type = 'danger';
212 |
213 | $alert =<<
215 | ×
216 | {message}
217 |
218 | END;
219 | return str_replace(
220 | array('{type}', '{message}'),
221 | array($type, $message),
222 | $alert
223 | );
224 | }
225 | }
226 |
--------------------------------------------------------------------------------
/content/themes/semantic/functions.php:
--------------------------------------------------------------------------------
1 |
10 | *
11 | * Permission is hereby granted, free of charge, to any person obtaining a copy
12 | * of this software and associated documentation files (the "Software"), to deal
13 | * in the Software without restriction, including without limitation the rights
14 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | * copies of the Software, and to permit persons to whom the Software is
16 | * furnished to do so, subject to the following conditions:
17 | *
18 | * The above copyright notice and this permission notice shall be included in
19 | * all copies or substantial portions of the Software.
20 | *
21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 | * THE SOFTWARE.
28 | *
29 | * @package CodeIgniter
30 | * @author Kader Bouyakoub
31 | * @copyright Copyright (c) 2017 - 2018, Kader Bouyakoub
32 | * @license http://opensource.org/licenses/MIT MIT License
33 | * @link https://github.com/bkader
34 | * @since Version 1.0.0
35 | */
36 | defined('BASEPATH') OR exit('No direct script access allowed');
37 |
38 | /**
39 | * Default theme functions file.
40 | *
41 | * This file contain any type of helpers used by the current theme.
42 | *
43 | * @package CodeIgniter
44 | * @subpackage CI-Theme
45 | * @category Theme Helpers
46 | * @author Kader Bouyakoub
47 | * @link https://github.com/bkader
48 | * @link https://twitter.com/KaderBouyakoub
49 | */
50 |
51 | /**
52 | * This class is here to demonstrate the use of
53 | * Events library with Theme library.
54 | */
55 | class Theme_class
56 | {
57 | public function __construct()
58 | {
59 | /**
60 | * With this event registered, theme can independently enqueue
61 | * all needed StyleSheets without adding them in controllers.
62 | */
63 | Events::register('enqueue_styles', array($this, 'styles'));
64 |
65 | /**
66 | * With this event registered, theme can independently enqueue
67 | * all needed JS files without adding them in controllers.
68 | */
69 | Events::register('enqueue_scripts', array($this, 'scripts'));
70 |
71 | /**
72 | * With this event registered, theme can independently enqueue
73 | * all needed meta tags without adding them in controllers.
74 | */
75 | Events::register('enqueue_metadata', array($this, 'metadata'));
76 |
77 | // Manipulating class.
78 | Events::register('html_class', array($this, 'html_class'));
79 |
80 | // Manipulating class.
81 | Events::register('body_class', array($this, 'body_class'));
82 | }
83 |
84 | // ------------------------------------------------------------------------
85 |
86 | /**
87 | * Enqueue all theme's StyleSheets.
88 | * @access public
89 | * @return void
90 | */
91 | public function styles()
92 | {
93 | // Let's add semantic css file.
94 | add_style('assets/css/semantic.min');
95 |
96 | // Now we add the the default StyleSheet.
97 | add_style('assets/css/style');
98 |
99 | }
100 |
101 | // ------------------------------------------------------------------------
102 |
103 | /**
104 | * Enqueue all theme's JavaScripts.
105 | * @access public
106 | * @return void
107 | */
108 | public function scripts()
109 | {
110 | // Let's add semantic js file.
111 | prepend_script('assets/js/semantic.min');
112 | add_script('assets/js/scripts');
113 | }
114 |
115 | // ------------------------------------------------------------------------
116 |
117 | /**
118 | * Enqueue all theme's Meta tags.
119 | * @access public
120 | * @return void
121 | */
122 | public function metadata()
123 | {
124 | add_meta('generator', 'CI-Theme Library');
125 | add_meta('author', 'Kader Bouyakoub');
126 | add_meta('author', 'https://github.com/bkader', 'rel');
127 |
128 | // Let's add some extra tags.
129 | add_meta('twitter:card', 'summary');
130 | add_meta('twitter:site', '@KaderBouyakoub');
131 | add_meta('twitter:creator', '@KaderBouyakoub');
132 | add_meta('og:url', current_url());
133 | add_meta('og:title', 'CI-Theme Library');
134 | add_meta('og:description', 'Simply makes your CI-based applications themable. Easy and fun to use.');
135 | add_meta('og:image', get_theme_url('screenshot.png'));
136 |
137 | // And why not more!
138 | add_meta('manifest', base_url('site.webmanifest'), 'rel');
139 | add_meta('apple-touch-icon', base_url('icon.png'), 'rel');
140 | }
141 |
142 | // ------------------------------------------------------------------------
143 |
144 | /**
145 | * Let's manipulate html class.
146 | * @access public
147 | * @param string $class
148 | * @return string
149 | */
150 | public function html_class($class)
151 | {
152 | // You can add class for a specific module!
153 | // if (is_module('module_name')) {}
154 | // if (is_module('mod_1, mod_2'))
155 |
156 | // Or set class for a specific controller.
157 | if (is_controller('example'))
158 | {
159 | return 'html-class-semantic-theme controller-example';
160 | }
161 |
162 | if (is_controller('admin'))
163 | {
164 | return 'html-class-semantic-theme controller-admin';
165 | }
166 |
167 | // You can as well set if for a specific method.
168 | // if (is_method(...)) {}
169 |
170 | // And you can chain all.
171 | // if (is_controller('example') && is_method('index')) {}
172 |
173 | return $class;
174 | }
175 |
176 | // ------------------------------------------------------------------------
177 |
178 | /**
179 | * Manipulating class.
180 | * @access public
181 | * @param string $class
182 | * @return string
183 | */
184 | public function body_class($class)
185 | {
186 | return 'body-class-semantic-theme';
187 | }
188 |
189 | }
190 |
191 | // Always instantiate the class so trigger get registered.
192 | $theme_class = new Theme_class;
193 |
194 | // ------------------------------------------------------------------------
195 |
196 | if ( ! function_exists('bs_alert'))
197 | {
198 | /**
199 | * Returns a Bootstrap alert.
200 | *
201 | * @param string $message the message to be displayed.
202 | * @return string Bootstrap full alert.
203 | */
204 | function bs_alert($message = '', $type = 'info')
205 | {
206 | if (empty($message))
207 | {
208 | return;
209 | }
210 |
211 | // Turn 'error' into 'danger' because it does not exist on bootstrap.
212 | $type == 'error' && $type = 'danger';
213 |
214 | $alert =<<
216 | ×
217 | {message}
218 |
219 | END;
220 | return str_replace(
221 | array('{type}', '{message}'),
222 | array($type, $message),
223 | $alert
224 | );
225 | }
226 | }
227 |
--------------------------------------------------------------------------------
/content/common/js/modernizr-2.8.3.min.js:
--------------------------------------------------------------------------------
1 | window.Modernizr=function(e,t,n){function r(e){b.cssText=e}function o(e,t){return r(S.join(e+";")+(t||""))}function a(e,t){return typeof e===t}function i(e,t){return!!~(""+e).indexOf(t)}function c(e,t){for(var r in e){var o=e[r];if(!i(o,"-")&&b[o]!==n)return"pfx"==t?o:!0}return!1}function s(e,t,r){for(var o in e){var i=t[e[o]];if(i!==n)return r===!1?e[o]:a(i,"function")?i.bind(r||t):i}return!1}function u(e,t,n){var r=e.charAt(0).toUpperCase()+e.slice(1),o=(e+" "+k.join(r+" ")+r).split(" ");return a(t,"string")||a(t,"undefined")?c(o,t):(o=(e+" "+T.join(r+" ")+r).split(" "),s(o,t,n))}function l(){p.input=function(n){for(var r=0,o=n.length;o>r;r++)j[n[r]]=!!(n[r]in E);return j.list&&(j.list=!(!t.createElement("datalist")||!e.HTMLDataListElement)),j}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),p.inputtypes=function(e){for(var r,o,a,i=0,c=e.length;c>i;i++)E.setAttribute("type",o=e[i]),r="text"!==E.type,r&&(E.value=x,E.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(o)&&E.style.WebkitAppearance!==n?(g.appendChild(E),a=t.defaultView,r=a.getComputedStyle&&"textfield"!==a.getComputedStyle(E,null).WebkitAppearance&&0!==E.offsetHeight,g.removeChild(E)):/^(search|tel)$/.test(o)||(r=/^(url|email)$/.test(o)?E.checkValidity&&E.checkValidity()===!1:E.value!=x)),P[e[i]]=!!r;return P}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d,f,m="2.8.3",p={},h=!0,g=t.documentElement,v="modernizr",y=t.createElement(v),b=y.style,E=t.createElement("input"),x=":)",w={}.toString,S=" -webkit- -moz- -o- -ms- ".split(" "),C="Webkit Moz O ms",k=C.split(" "),T=C.toLowerCase().split(" "),N={svg:"http://www.w3.org/2000/svg"},M={},P={},j={},$=[],D=$.slice,F=function(e,n,r,o){var a,i,c,s,u=t.createElement("div"),l=t.body,d=l||t.createElement("body");if(parseInt(r,10))for(;r--;)c=t.createElement("div"),c.id=o?o[r]:v+(r+1),u.appendChild(c);return a=["",'"].join(""),u.id=v,(l?u:d).innerHTML+=a,d.appendChild(u),l||(d.style.background="",d.style.overflow="hidden",s=g.style.overflow,g.style.overflow="hidden",g.appendChild(d)),i=n(u,e),l?u.parentNode.removeChild(u):(d.parentNode.removeChild(d),g.style.overflow=s),!!i},z=function(t){var n=e.matchMedia||e.msMatchMedia;if(n)return n(t)&&n(t).matches||!1;var r;return F("@media "+t+" { #"+v+" { position: absolute; } }",function(t){r="absolute"==(e.getComputedStyle?getComputedStyle(t,null):t.currentStyle).position}),r},A=function(){function e(e,o){o=o||t.createElement(r[e]||"div"),e="on"+e;var i=e in o;return i||(o.setAttribute||(o=t.createElement("div")),o.setAttribute&&o.removeAttribute&&(o.setAttribute(e,""),i=a(o[e],"function"),a(o[e],"undefined")||(o[e]=n),o.removeAttribute(e))),o=null,i}var r={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return e}(),L={}.hasOwnProperty;f=a(L,"undefined")||a(L.call,"undefined")?function(e,t){return t in e&&a(e.constructor.prototype[t],"undefined")}:function(e,t){return L.call(e,t)},Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError;var n=D.call(arguments,1),r=function(){if(this instanceof r){var o=function(){};o.prototype=t.prototype;var a=new o,i=t.apply(a,n.concat(D.call(arguments)));return Object(i)===i?i:a}return t.apply(e,n.concat(D.call(arguments)))};return r}),M.flexbox=function(){return u("flexWrap")},M.flexboxlegacy=function(){return u("boxDirection")},M.canvas=function(){var e=t.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))},M.canvastext=function(){return!(!p.canvas||!a(t.createElement("canvas").getContext("2d").fillText,"function"))},M.webgl=function(){return!!e.WebGLRenderingContext},M.touch=function(){var n;return"ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch?n=!0:F(["@media (",S.join("touch-enabled),("),v,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(e){n=9===e.offsetTop}),n},M.geolocation=function(){return"geolocation"in navigator},M.postmessage=function(){return!!e.postMessage},M.websqldatabase=function(){return!!e.openDatabase},M.indexedDB=function(){return!!u("indexedDB",e)},M.hashchange=function(){return A("hashchange",e)&&(t.documentMode===n||t.documentMode>7)},M.history=function(){return!(!e.history||!history.pushState)},M.draganddrop=function(){var e=t.createElement("div");return"draggable"in e||"ondragstart"in e&&"ondrop"in e},M.websockets=function(){return"WebSocket"in e||"MozWebSocket"in e},M.rgba=function(){return r("background-color:rgba(150,255,150,.5)"),i(b.backgroundColor,"rgba")},M.hsla=function(){return r("background-color:hsla(120,40%,100%,.5)"),i(b.backgroundColor,"rgba")||i(b.backgroundColor,"hsla")},M.multiplebgs=function(){return r("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(b.background)},M.backgroundsize=function(){return u("backgroundSize")},M.borderimage=function(){return u("borderImage")},M.borderradius=function(){return u("borderRadius")},M.boxshadow=function(){return u("boxShadow")},M.textshadow=function(){return""===t.createElement("div").style.textShadow},M.opacity=function(){return o("opacity:.55"),/^0.55$/.test(b.opacity)},M.cssanimations=function(){return u("animationName")},M.csscolumns=function(){return u("columnCount")},M.cssgradients=function(){var e="background-image:",t="gradient(linear,left top,right bottom,from(#9f9),to(white));",n="linear-gradient(left top,#9f9, white);";return r((e+"-webkit- ".split(" ").join(t+e)+S.join(n+e)).slice(0,-e.length)),i(b.backgroundImage,"gradient")},M.cssreflections=function(){return u("boxReflect")},M.csstransforms=function(){return!!u("transform")},M.csstransforms3d=function(){var e=!!u("perspective");return e&&"webkitPerspective"in g.style&&F("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(t){e=9===t.offsetLeft&&3===t.offsetHeight}),e},M.csstransitions=function(){return u("transition")},M.fontface=function(){var e;return F('@font-face {font-family:"font";src:url("https://")}',function(n,r){var o=t.getElementById("smodernizr"),a=o.sheet||o.styleSheet,i=a?a.cssRules&&a.cssRules[0]?a.cssRules[0].cssText:a.cssText||"":"";e=/src/i.test(i)&&0===i.indexOf(r.split(" ")[0])}),e},M.generatedcontent=function(){var e;return F(["#",v,"{font:0/0 a}#",v,':after{content:"',x,'";visibility:hidden;font:3px/1 a}'].join(""),function(t){e=t.offsetHeight>=3}),e},M.video=function(){var e=t.createElement("video"),n=!1;try{(n=!!e.canPlayType)&&(n=new Boolean(n),n.ogg=e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),n.h264=e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),n.webm=e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""))}catch(r){}return n},M.audio=function(){var e=t.createElement("audio"),n=!1;try{(n=!!e.canPlayType)&&(n=new Boolean(n),n.ogg=e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),n.mp3=e.canPlayType("audio/mpeg;").replace(/^no$/,""),n.wav=e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),n.m4a=(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(r){}return n},M.localstorage=function(){try{return localStorage.setItem(v,v),localStorage.removeItem(v),!0}catch(e){return!1}},M.sessionstorage=function(){try{return sessionStorage.setItem(v,v),sessionStorage.removeItem(v),!0}catch(e){return!1}},M.webworkers=function(){return!!e.Worker},M.applicationcache=function(){return!!e.applicationCache},M.svg=function(){return!!t.createElementNS&&!!t.createElementNS(N.svg,"svg").createSVGRect},M.inlinesvg=function(){var e=t.createElement("div");return e.innerHTML=" ",(e.firstChild&&e.firstChild.namespaceURI)==N.svg},M.smil=function(){return!!t.createElementNS&&/SVGAnimate/.test(w.call(t.createElementNS(N.svg,"animate")))},M.svgclippaths=function(){return!!t.createElementNS&&/SVGClipPath/.test(w.call(t.createElementNS(N.svg,"clipPath")))};for(var H in M)f(M,H)&&(d=H.toLowerCase(),p[d]=M[H](),$.push((p[d]?"":"no-")+d));return p.input||l(),p.addTest=function(e,t){if("object"==typeof e)for(var r in e)f(e,r)&&p.addTest(r,e[r]);else{if(e=e.toLowerCase(),p[e]!==n)return p;t="function"==typeof t?t():t,"undefined"!=typeof h&&h&&(g.className+=" "+(t?"":"no-")+e),p[e]=t}return p},r(""),y=E=null,function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=y.elements;return"string"==typeof e?e.split(" "):e}function o(e){var t=v[e[h]];return t||(t={},g++,e[h]=g,v[g]=t),t}function a(e,n,r){if(n||(n=t),l)return n.createElement(e);r||(r=o(n));var a;return a=r.cache[e]?r.cache[e].cloneNode():p.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!a.canHaveChildren||m.test(e)||a.tagUrn?a:r.frag.appendChild(a)}function i(e,n){if(e||(e=t),l)return e.createDocumentFragment();n=n||o(e);for(var a=n.frag.cloneNode(),i=0,c=r(),s=c.length;s>i;i++)a.createElement(c[i]);return a}function c(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return y.shivMethods?a(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(y,t.frag)}function s(e){e||(e=t);var r=o(e);return!y.shivCSS||u||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||c(e,r),e}var u,l,d="3.7.0",f=e.html5||{},m=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,h="_html5shiv",g=0,v={};!function(){try{var e=t.createElement("a");e.innerHTML=" ",u="hidden"in e,l=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){u=!0,l=!0}}();var y={elements:f.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:d,shivCSS:f.shivCSS!==!1,supportsUnknownElements:l,shivMethods:f.shivMethods!==!1,type:"default",shivDocument:s,createElement:a,createDocumentFragment:i};e.html5=y,s(t)}(this,t),p._version=m,p._prefixes=S,p._domPrefixes=T,p._cssomPrefixes=k,p.mq=z,p.hasEvent=A,p.testProp=function(e){return c([e])},p.testAllProps=u,p.testStyles=F,p.prefixed=function(e,t,n){return t?u(e,t,n):u(e,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(h?" js "+$.join(" "):""),p}(this,this.document);
2 |
--------------------------------------------------------------------------------
/application/helpers/theme_helper.php:
--------------------------------------------------------------------------------
1 |
10 | *
11 | * Permission is hereby granted, free of charge, to any person obtaining a copy
12 | * of this software and associated documentation files (the "Software"), to deal
13 | * in the Software without restriction, including without limitation the rights
14 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | * copies of the Software, and to permit persons to whom the Software is
16 | * furnished to do so, subject to the following conditions:
17 | *
18 | * The above copyright notice and this permission notice shall be included in
19 | * all copies or substantial portions of the Software.
20 | *
21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27 | * THE SOFTWARE.
28 | *
29 | * @package CodeIgniter
30 | * @author Kader Bouyakoub
31 | * @copyright Copyright (c) 2018, Kader Bouyakoub
32 | * @license http://opensource.org/licenses/MIT MIT License
33 | * @link https://github.com/bkader
34 | * @since Version 1.0.0
35 | */
36 | defined('BASEPATH') OR exit('No direct script access allowed');
37 |
38 | /**
39 | * Theme Helper
40 | *
41 | * This helper goes with Theme library provided as a package for CI-Base
42 | *
43 | * @package CodeIgniter
44 | * @category Helpers
45 | * @author Kader Bouyakoub
46 | * @link http://www.bkader.com/
47 | */
48 |
49 | if ( ! function_exists('build_path'))
50 | {
51 | /**
52 | * This function smartly builds a path using DIRECTORY_SEPARATOR
53 | *
54 | * @param mixed strings or array
55 | * @return string the full path built
56 | * @author Kader Bouyakoub
57 | * @link http://www.bkader.com/
58 | */
59 | function build_path()
60 | {
61 | // We build the path only if arguments are passed
62 | if ( ! empty($args = func_get_args()))
63 | {
64 | // Make sure arguments are an array but not a mutidimensional one
65 | isset($args[0]) && is_array($args[0]) && $args = $args[0];
66 |
67 | return implode(DIRECTORY_SEPARATOR, array_map('rtrim', $args, array(DIRECTORY_SEPARATOR))).DIRECTORY_SEPARATOR;
68 | }
69 |
70 | return null;
71 | }
72 | }
73 |
74 | // ------------------------------------------------------------------------
75 |
76 | if ( ! function_exists('assets_url'))
77 | {
78 | /**
79 | * Returns Assets URL
80 | * @param string $uri URI to append to URL
81 | * @param string $folder In case of a distinct folder
82 | * @return string
83 | */
84 | function assets_url($uri = '', $folder = null)
85 | {
86 | (class_exists('Theme', false)) OR get_instance()->load->library('theme');
87 | return get_instance()->theme->assets_url($uri, $folder);
88 | }
89 | }
90 |
91 | // ------------------------------------------------------------------------
92 |
93 | if ( ! function_exists('css_url'))
94 | {
95 | /**
96 | * Returns the full url to css file
97 | * @param string $file filename with or without .css extension
98 | * @return string
99 | */
100 | function css_url($file = null, $folder = null)
101 | {
102 | (class_exists('Theme', false)) OR get_instance()->load->library('theme');
103 | return get_instance()->theme->css_url($file, $folder);
104 | }
105 | }
106 |
107 | if ( ! function_exists('css'))
108 | {
109 | /**
110 | * Returns the full css tag
111 | * @param string $file filename to load
112 | * @param string $cdn to use in case of CDN user
113 | * @param mixed $attr attributes to append to string
114 | * @return string
115 | */
116 | function css($file = null, $cdn = null, $attrs = '', $folder = null)
117 | {
118 | (class_exists('Theme', false)) OR get_instance()->load->library('theme');
119 | return get_instance()->theme->css($file, $cdn, $attrs, $folder);
120 | }
121 | }
122 |
123 | // ----------------------------------------------------------------------------
124 |
125 | if ( ! function_exists('js_url'))
126 | {
127 | /**
128 | * Returns the full url to js file
129 | * @param string $file filename with or without .js extension
130 | * @return string
131 | */
132 | function js_url($file, $folder = null)
133 | {
134 | (class_exists('Theme', false)) OR get_instance()->load->library('theme');
135 | return get_instance()->theme->js_url($file, $folder);
136 | }
137 | }
138 |
139 | if ( ! function_exists('js'))
140 | {
141 | /**
142 | * Returns the full JS