├── .gitignore ├── .htaccess ├── LICENSE.txt ├── ReadMe.md ├── admin ├── .htaccess └── index.php ├── docs ├── en.md ├── es.md ├── fr.md └── pl.md ├── favicon.ico ├── inc ├── core │ ├── Admin.php │ ├── AdminModule.php │ ├── BaseModule.php │ ├── Main.php │ ├── Site.php │ ├── SiteModule.php │ ├── defines.php │ └── lib │ │ ├── Autoloader.php │ │ ├── Event.php │ │ ├── HttpRequest.php │ │ ├── Image.php │ │ ├── Indenter.php │ │ ├── License.php │ │ ├── ModulesCollection.php │ │ ├── Pagination.php │ │ ├── Parsedown.php │ │ ├── QueryBuilder.php │ │ ├── Router.php │ │ ├── Settings.php │ │ ├── Templates.php │ │ ├── Widget.php │ │ └── functions.php ├── css │ ├── bootstrap-theme.min.css │ └── bootstrap.min.css ├── data │ └── .gitkeep ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── jscripts │ ├── are-you-sure.min.js │ ├── bootbox.min.js │ ├── bootstrap.min.js │ ├── editor │ │ ├── highlight.min.js │ │ ├── images │ │ │ ├── bold.png │ │ │ ├── clean.png │ │ │ ├── code.png │ │ │ ├── h1.png │ │ │ ├── h2.png │ │ │ ├── h3.png │ │ │ ├── handle.png │ │ │ ├── image.png │ │ │ ├── italic.png │ │ │ ├── link.png │ │ │ ├── list-bullet.png │ │ │ ├── list-item.png │ │ │ ├── list-numeric.png │ │ │ ├── menu.png │ │ │ ├── paragraph.png │ │ │ ├── picture.png │ │ │ ├── quotes.png │ │ │ ├── stroke.png │ │ │ └── submenu.png │ │ ├── markitup.highlight.min.css │ │ ├── markitup.highlight.min.js │ │ ├── markitup.min.css │ │ ├── markitup.min.js │ │ └── sets │ │ │ ├── html │ │ │ ├── set.min.css │ │ │ └── set.min.js │ │ │ └── markdown │ │ │ ├── set.min.css │ │ │ └── set.min.js │ ├── html.sortable.min.js │ ├── lightbox │ │ ├── lightbox.min.css │ │ └── lightbox.min.js │ ├── tinynav.min.js │ └── wysiwyg │ │ ├── font │ │ ├── summernote.eot │ │ ├── summernote.ttf │ │ └── summernote.woff │ │ ├── lang │ │ ├── es_spanish.js │ │ ├── fr_french.js │ │ ├── id_indonesian.js │ │ ├── it_italian.js │ │ ├── nl_dutch.js │ │ ├── pl_polski.js │ │ ├── pt_portuguese.js │ │ ├── ru_russian.js │ │ ├── se_swedish.js │ │ └── tr_turkish.js │ │ ├── summernote.min.css │ │ └── summernote.min.js ├── lang │ ├── en_english │ │ └── admin │ │ │ └── general.ini │ ├── es_spanish │ │ ├── .lock │ │ └── admin │ │ │ └── general.ini │ ├── fr_french │ │ ├── .lock │ │ └── admin │ │ │ └── general.ini │ ├── id_indonesian │ │ ├── .lock │ │ └── admin │ │ │ └── general.ini │ ├── it_italian │ │ ├── .lock │ │ └── admin │ │ │ └── general.ini │ ├── nl_dutch │ │ ├── .lock │ │ └── admin │ │ │ └── general.ini │ ├── pl_polski │ │ └── admin │ │ │ └── general.ini │ ├── pt_portuguese │ │ ├── .lock │ │ └── admin │ │ │ └── general.ini │ ├── ru_russian │ │ ├── .lock │ │ └── admin │ │ │ └── general.ini │ ├── se_swedish │ │ ├── .lock │ │ └── admin │ │ │ └── general.ini │ └── tr_turkish │ │ ├── .lock │ │ └── admin │ │ └── general.ini └── modules │ ├── blog │ ├── Admin.php │ ├── Info.php │ ├── ReadMe.md │ ├── Site.php │ ├── css │ │ └── admin │ │ │ └── blog.css │ ├── img │ │ ├── default.jpg │ │ └── indicator.gif │ ├── js │ │ └── admin │ │ │ └── blog.js │ ├── lang │ │ ├── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── it_italian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ ├── ru_russian.ini │ │ │ ├── se_swedish.ini │ │ │ └── tr_turkish.ini │ │ ├── en_english.ini │ │ ├── es_spanish.ini │ │ ├── fr_french.ini │ │ ├── id_indonesian.ini │ │ ├── it_italian.ini │ │ ├── nl_dutch.ini │ │ ├── pl_polski.ini │ │ ├── pt_portuguese.ini │ │ ├── ru_russian.ini │ │ ├── se_swedish.ini │ │ └── tr_turkish.ini │ └── view │ │ ├── admin │ │ ├── form.html │ │ ├── manage.html │ │ └── settings.html │ │ ├── disqus.html │ │ └── feed.xml │ ├── carousel │ ├── Info.php │ ├── ReadMe.md │ ├── Site.php │ ├── lang │ │ └── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── it_italian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ ├── ru_russian.ini │ │ │ ├── se_swedish.ini │ │ │ └── tr_turkish.ini │ └── view │ │ └── carousel.html │ ├── contact │ ├── Admin.php │ ├── Info.php │ ├── Site.php │ ├── lang │ │ ├── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── it_italian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ ├── ru_russian.ini │ │ │ ├── se_swedish.ini │ │ │ └── tr_turkish.ini │ │ ├── en_english.ini │ │ ├── es_spanish.ini │ │ ├── fr_french.ini │ │ ├── id_indonesian.ini │ │ ├── it_italian.ini │ │ ├── nl_dutch.ini │ │ ├── pl_polski.ini │ │ ├── pt_portuguese.ini │ │ ├── ru_russian.ini │ │ ├── se_swedish.ini │ │ └── tr_turkish.ini │ └── view │ │ ├── admin │ │ └── settings.html │ │ ├── form.html │ │ └── mail.html │ ├── dashboard │ ├── Admin.php │ ├── Info.php │ ├── css │ │ └── style.css │ ├── lang │ │ └── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── it_italian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ ├── ru_russian.ini │ │ │ ├── se_swedish.ini │ │ │ └── tr_turkish.ini │ └── view │ │ └── admin │ │ └── dashboard.html │ ├── devbar │ ├── Admin.php │ ├── Dump.php │ ├── Info.php │ ├── ReadMe.md │ ├── Site.php │ ├── css │ │ ├── style.css │ │ └── style.less │ ├── functions.php │ ├── lang │ │ └── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── it_italian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ └── ru_russian.ini │ └── view │ │ └── bar.html │ ├── galleries │ ├── Admin.php │ ├── Info.php │ ├── Site.php │ ├── lang │ │ └── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── it_italian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ ├── ru_russian.ini │ │ │ ├── se_swedish.ini │ │ │ └── tr_turkish.ini │ └── view │ │ ├── admin │ │ ├── edit.html │ │ └── manage.html │ │ └── gallery.html │ ├── langswitcher │ ├── Info.php │ ├── ReadMe.md │ ├── Site.php │ ├── lang │ │ └── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── it_italian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ ├── ru_russian.ini │ │ │ ├── se_swedish.ini │ │ │ └── tr_turkish.ini │ └── view │ │ └── switcher.html │ ├── modules │ ├── Admin.php │ ├── Info.php │ ├── lang │ │ └── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── it_italian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ ├── ru_russian.ini │ │ │ ├── se_swedish.ini │ │ │ └── tr_turkish.ini │ └── view │ │ └── admin │ │ ├── details.html │ │ ├── manage.html │ │ └── upload.html │ ├── navigation │ ├── Admin.php │ ├── Info.php │ ├── Site.php │ ├── lang │ │ └── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── it_italian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ ├── ru_russian.ini │ │ │ ├── se_swedish.ini │ │ │ └── tr_turkish.ini │ └── view │ │ ├── admin │ │ ├── form.link.html │ │ ├── form.nav.html │ │ └── manage.html │ │ └── nav.html │ ├── pages │ ├── Admin.php │ ├── Info.php │ ├── ReadMe.md │ ├── Site.php │ ├── js │ │ └── admin │ │ │ └── pages.js │ ├── lang │ │ ├── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── it_italian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ ├── ru_russian.ini │ │ │ ├── se_swedish.ini │ │ │ └── tr_turkish.ini │ │ ├── en_english.ini │ │ ├── es_spanish.ini │ │ ├── fr_french.ini │ │ ├── id_indonesian.ini │ │ ├── it_italian.ini │ │ ├── nl_dutch.ini │ │ ├── pl_polski.ini │ │ ├── pt_portuguese.ini │ │ ├── ru_russian.ini │ │ ├── se_swedish.ini │ │ └── tr_turkish.ini │ └── view │ │ └── admin │ │ ├── form.html │ │ └── manage.html │ ├── sample │ ├── Admin.php │ ├── Info.php │ ├── Site.php │ ├── lang │ │ ├── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── it_italian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ ├── ru_russian.ini │ │ │ ├── se_swedish.ini │ │ │ └── tr_turkish.ini │ │ ├── en_english.ini │ │ ├── es_spanish.ini │ │ ├── fr_french.ini │ │ ├── id_indonesian.ini │ │ ├── it_italian.ini │ │ ├── nl_dutch.ini │ │ ├── pl_polski.ini │ │ ├── pt_portuguese.ini │ │ ├── ru_russian.ini │ │ ├── se_swedish.ini │ │ └── tr_turkish.ini │ └── view │ │ ├── admin │ │ └── index.html │ │ └── hello.html │ ├── searchbox │ ├── Info.php │ ├── ReadMe.md │ ├── Site.php │ ├── lang │ │ ├── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ └── ru_russian.ini │ │ ├── en_english.ini │ │ ├── es_spanish.ini │ │ ├── fr_french.ini │ │ ├── id_indonesian.ini │ │ ├── it_italian.ini │ │ ├── nl_dutch.ini │ │ ├── pl_polski.ini │ │ ├── pt_portuguese.ini │ │ └── ru_russian.ini │ └── view │ │ ├── input.html │ │ └── results.html │ ├── settings │ ├── Admin.php │ ├── Info.php │ ├── ReadMe.md │ ├── Site.php │ ├── css │ │ └── admin │ │ │ └── settings.css │ ├── inc │ │ └── RecursiveDotFilterIterator.php │ ├── lang │ │ └── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── it_italian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ ├── ru_russian.ini │ │ │ ├── se_swedish.ini │ │ │ └── tr_turkish.ini │ └── view │ │ └── admin │ │ ├── general.html │ │ ├── theme.html │ │ ├── themes.html │ │ ├── translation.html │ │ └── update.html │ ├── sitemap │ ├── Info.php │ ├── ReadMe.md │ ├── Site.php │ ├── lang │ │ └── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ └── ru_russian.ini │ └── view │ │ └── sitemap.xml │ ├── snippets │ ├── Admin.php │ ├── Info.php │ ├── Site.php │ ├── js │ │ └── admin │ │ │ └── snippets.js │ ├── lang │ │ └── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── it_italian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ ├── ru_russian.ini │ │ │ ├── se_swedish.ini │ │ │ └── tr_turkish.ini │ └── view │ │ └── admin │ │ ├── form.html │ │ └── manage.html │ ├── statistics │ ├── Admin.php │ ├── DB.php │ ├── Info.php │ ├── Site.php │ ├── assets │ │ ├── css │ │ │ └── style.css │ │ └── js │ │ │ ├── Chart.bundle.min.js │ │ │ └── app.js │ ├── lang │ │ └── admin │ │ │ ├── en_english.ini │ │ │ ├── es_spanish.ini │ │ │ ├── fr_french.ini │ │ │ ├── id_indonesian.ini │ │ │ ├── nl_dutch.ini │ │ │ ├── pl_polski.ini │ │ │ ├── pt_portuguese.ini │ │ │ └── ru_russian.ini │ ├── phpbrowserdetector │ │ ├── AcceptLanguage.php │ │ ├── Browser.php │ │ ├── BrowserDetector.php │ │ ├── DetectorInterface.php │ │ ├── Device.php │ │ ├── DeviceDetector.php │ │ ├── InvalidArgumentException.php │ │ ├── Language.php │ │ ├── LanguageDetector.php │ │ ├── Os.php │ │ ├── OsDetector.php │ │ └── UserAgent.php │ ├── src │ │ ├── Chart.php │ │ └── Statistics.php │ └── view │ │ └── admin │ │ ├── dashboard.html │ │ ├── pages.html │ │ ├── referrer.html │ │ ├── referrers.html │ │ └── url.html │ └── users │ ├── Admin.php │ ├── Info.php │ ├── Site.php │ ├── img │ └── default.png │ ├── lang │ └── admin │ │ ├── en_english.ini │ │ ├── es_spanish.ini │ │ ├── fr_french.ini │ │ ├── id_indonesian.ini │ │ ├── it_italian.ini │ │ ├── nl_dutch.ini │ │ ├── pl_polski.ini │ │ ├── pt_portuguese.ini │ │ ├── ru_russian.ini │ │ ├── se_swedish.ini │ │ └── tr_turkish.ini │ └── view │ └── admin │ ├── form.html │ └── manage.html ├── index.php ├── themes ├── admin │ ├── css │ │ └── style.css │ ├── img │ │ ├── logo.svg │ │ └── unknown_theme.png │ ├── index.html │ ├── js │ │ ├── kalypto.min.js │ │ ├── scripts.js │ │ └── selectator.min.js │ └── login.html ├── batblog │ ├── blog.html │ ├── css │ │ └── style.css │ ├── img │ │ ├── default-bg.jpg │ │ └── profile.jpg │ ├── inc │ │ ├── footer.html │ │ ├── header.html │ │ └── sidebar.html │ ├── index.html │ ├── js │ │ └── theme.js │ ├── manifest.json │ ├── post.html │ └── preview.png └── default │ ├── blog.html │ ├── css │ └── style.css │ ├── img │ └── default-bg.jpg │ ├── inc │ ├── footer.html │ └── header.html │ ├── index.html │ ├── js │ └── theme.js │ ├── manifest.json │ ├── post.html │ └── preview.png ├── upgrade.php └── uploads ├── .htaccess └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | admin/tmp/ 2 | tmp/ 3 | uploads/ 4 | inc/data/*.sdb 5 | -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | # Prevent directory listings 2 | Options -Indexes 3 | 4 | # Prevent visitors from viewing files directly 5 | 6 | 7 | Order allow,deny 8 | Deny from all 9 | Satisfy All 10 | 11 | 12 | Require all denied 13 | 14 | 15 | 16 | # URL rewrites 17 | 18 | RewriteEngine On 19 | RewriteRule ^(inc/|themes/|tmp/).*\.(php|html)$ - [F,L] 20 | RewriteCond %{REQUEST_FILENAME} !-f 21 | RewriteCond %{REQUEST_FILENAME} !-d 22 | RewriteRule ^ index.php [L] 23 | 24 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) Paweł Klockiewicz, Wojciech Król 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. 22 | -------------------------------------------------------------------------------- /admin/.htaccess: -------------------------------------------------------------------------------- 1 | # Prevent directory listings 2 | Options -Indexes 3 | 4 | # URL rewrites 5 | 6 | RewriteEngine On 7 | RewriteCond %{REQUEST_FILENAME} !-f 8 | RewriteCond %{REQUEST_FILENAME} !-d 9 | RewriteRule ^ index.php [L] 10 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/favicon.ico -------------------------------------------------------------------------------- /inc/core/AdminModule.php: -------------------------------------------------------------------------------- 1 | 6 | * @author Wojciech Król 7 | * @copyright 2017 Paweł Klockiewicz, Wojciech Król 8 | * @license https://batflat.org/license 9 | * @link https://batflat.org 10 | */ 11 | 12 | namespace Inc\Core; 13 | 14 | /** 15 | * Admin class for administration panel 16 | */ 17 | abstract class AdminModule extends BaseModule 18 | { 19 | /** 20 | * Module navigation 21 | * 22 | * @return array 23 | */ 24 | public function navigation() 25 | { 26 | return []; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /inc/core/SiteModule.php: -------------------------------------------------------------------------------- 1 | 6 | * @author Wojciech Król 7 | * @copyright 2017 Paweł Klockiewicz, Wojciech Król 8 | * @license https://batflat.org/license 9 | * @link https://batflat.org 10 | */ 11 | 12 | namespace Inc\Core; 13 | 14 | /** 15 | * Site class for website's module controller 16 | */ 17 | abstract class SiteModule extends BaseModule 18 | { 19 | /** 20 | * Routes declarations for Site 21 | * Moved from __construct() 22 | * 23 | * @return void 24 | */ 25 | public function routes() 26 | { 27 | } 28 | 29 | /** 30 | * Set route 31 | * 32 | * @param string $pattern 33 | * @param mixed $callback callable function or name of module method 34 | * @return void 35 | */ 36 | protected function route($pattern, $callback) 37 | { 38 | if (is_callable($callback)) { 39 | $this->core->router->set($pattern, $callback); 40 | } else { 41 | $this->core->router->set($pattern, function () use ($callback) { 42 | return call_user_func_array([$this, $callback], func_get_args()); 43 | }); 44 | } 45 | } 46 | 47 | /** 48 | * Set site template 49 | * 50 | * @param string $file 51 | * @return void 52 | */ 53 | protected function setTemplate($file) 54 | { 55 | $this->core->template = $file; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /inc/core/defines.php: -------------------------------------------------------------------------------- 1 | 6 | * @author Wojciech Król 7 | * @copyright 2017 Paweł Klockiewicz, Wojciech Król 8 | * @license https://batflat.org/license 9 | * @link https://batflat.org 10 | */ 11 | 12 | if (!version_compare(PHP_VERSION, '5.5.0', '>=')) { 13 | exit("Batflat requires at least PHP 5.5"); 14 | } 15 | 16 | // Admin cat name 17 | define('ADMIN', 'admin'); 18 | 19 | // Themes path 20 | define('THEMES', BASE_DIR . '/themes'); 21 | 22 | // Modules path 23 | define('MODULES', BASE_DIR . '/inc/modules'); 24 | 25 | // Uploads path 26 | define('UPLOADS', BASE_DIR . '/uploads'); 27 | 28 | // Lock files 29 | define('FILE_LOCK', false); 30 | 31 | // Basic modules 32 | define('BASIC_MODULES', serialize([ 33 | 8 => 'settings', 34 | 0 => 'dashboard', 35 | 2 => 'pages', 36 | 3 => 'navigation', 37 | 7 => 'users', 38 | 1 => 'blog', 39 | 4 => 'galleries', 40 | 5 => 'snippets', 41 | 6 => 'modules', 42 | 9 => 'contact', 43 | 10 => 'langswitcher', 44 | 11 => 'devbar', 45 | ])); 46 | 47 | // HTML beautifier 48 | define('HTML_BEAUTY', false); 49 | 50 | // Developer mode 51 | define('DEV_MODE', false); -------------------------------------------------------------------------------- /inc/core/lib/Autoloader.php: -------------------------------------------------------------------------------- 1 | 6 | * @author Wojciech Król 7 | * @copyright 2017 Paweł Klockiewicz, Wojciech Król 8 | * @license https://batflat.org/license 9 | * @link https://batflat.org 10 | */ 11 | 12 | require_once('functions.php'); 13 | 14 | /** 15 | * Batflat autoloader 16 | */ 17 | class Autoloader 18 | { 19 | /** 20 | * Autoload initialization 21 | * 22 | * @param string $className 23 | * @return void 24 | */ 25 | public static function init($className) 26 | { 27 | // Convert directories to lowercase and process uppercase for class files 28 | $className = explode('\\', $className); 29 | $file = array_pop($className); 30 | $file = strtolower(implode('/', $className)).'/'.$file.'.php'; 31 | 32 | if (strpos($_SERVER['SCRIPT_NAME'], '/'.ADMIN.'/') !== false) { 33 | $file = '../'.$file; 34 | } 35 | if (is_readable($file)) { 36 | require_once($file); 37 | } 38 | } 39 | } 40 | 41 | header(gz64_decode("eNqL0HUuSk0sSU3Rdaq0UnBKLEnLSSxRsEmCMPTyi9LtANXtDCw")); 42 | spl_autoload_register('Autoloader::init'); 43 | 44 | // Autoload vendors if exist 45 | if (file_exists(BASE_DIR.'/vendor/autoload.php')) { 46 | require_once(BASE_DIR.'/vendor/autoload.php'); 47 | } 48 | -------------------------------------------------------------------------------- /inc/core/lib/Event.php: -------------------------------------------------------------------------------- 1 | 6 | * @author Wojciech Król 7 | * @copyright 2017 Paweł Klockiewicz, Wojciech Król 8 | * @license https://batflat.org/license 9 | * @link https://batflat.org 10 | */ 11 | 12 | namespace Inc\Core\Lib; 13 | 14 | /** 15 | * Events class 16 | */ 17 | class Event 18 | { 19 | /** @var array */ 20 | protected static $events = []; 21 | 22 | /** 23 | * Add new event handler 24 | * 25 | * @param string $name 26 | * @param callable $callback 27 | * @return void 28 | */ 29 | public static function add($name, callable $callback) 30 | { 31 | static::$events[$name][] = $callback; 32 | } 33 | 34 | /** 35 | * Execute registered event handlers 36 | * 37 | * @param string $name 38 | * @param array $params 39 | * @return bool 40 | */ 41 | public static function call($name, array $params = []) 42 | { 43 | $return = true; 44 | foreach (isset_or(static::$events[$name], []) as $value) { 45 | $return = $return && (call_user_func_array($value, $params) !== false); 46 | } 47 | return $return; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /inc/core/lib/Widget.php: -------------------------------------------------------------------------------- 1 | 6 | * @author Wojciech Król 7 | * @copyright 2017 Paweł Klockiewicz, Wojciech Król 8 | * @license https://batflat.org/license 9 | * @link https://batflat.org 10 | */ 11 | 12 | namespace Inc\Core\Lib; 13 | 14 | /** 15 | * Widgets class 16 | */ 17 | class Widget 18 | { 19 | /** @var array Widgets collection */ 20 | protected static $widgets = []; 21 | 22 | /** 23 | * Add widget to collection 24 | * 25 | * @param string $name 26 | * @param callable $callback 27 | * @return void 28 | */ 29 | public static function add($name, callable $callback) 30 | { 31 | static::$widgets[$name][] = $callback; 32 | } 33 | 34 | /** 35 | * Execute all widgets and get content 36 | * 37 | * @param string $name 38 | * @param array $params 39 | * @return string 40 | */ 41 | public static function call($name, $params = []) 42 | { 43 | $result = []; 44 | foreach (isset_or(static::$widgets[$name], []) as $widget) { 45 | $content = call_user_func_array($widget, $params); 46 | if (is_string($content)) { 47 | $result[] = $content; 48 | } 49 | } 50 | 51 | return implode("\n", $result); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /inc/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/data/.gitkeep -------------------------------------------------------------------------------- /inc/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /inc/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /inc/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /inc/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /inc/jscripts/editor/images/bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/bold.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/clean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/clean.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/code.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/h1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/h1.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/h2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/h2.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/h3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/h3.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/handle.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/image.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/italic.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/link.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/list-bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/list-bullet.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/list-item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/list-item.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/list-numeric.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/list-numeric.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/menu.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/paragraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/paragraph.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/picture.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/quotes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/quotes.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/stroke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/stroke.png -------------------------------------------------------------------------------- /inc/jscripts/editor/images/submenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sruupl/batflat/f64373702f9589cd02d203a1cae505f6668c51c5/inc/jscripts/editor/images/submenu.png -------------------------------------------------------------------------------- /inc/jscripts/editor/markitup.highlight.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.fn.highlight=function(b){function i(b,c){var d=a(b).val(),e=j(d+"\n");a(c).html(e),a(c).each(function(a,b){hljs.highlightBlock(b)})}function j(a){return a.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function k(){var b=a("
").css({visibility:"hidden",width:100,overflow:"scroll"}).appendTo("body"),c=a("
").css({width:"100%"}).appendTo(b).outerWidth();return b.remove(),100-c}if(!document.documentMode&&!window.StyleMedia&&!/Mobi/i.test(navigator.userAgent)){var c=this,d=k();if(b=a.extend({whiteSpace:"pre-wrap",lang:c.data("lang")},b),b.lang)var e=b.lang;else var e=c.closest('div[class^="markItUpSet"]').attr("class").replace("markItUpSet-","");var f=document.createElement("div");a(f).addClass("markItUpHighlight"),a(c).wrap(f);var g=document.createElement("pre");a(g).addClass("markItUpSyntax").appendTo(c.parent());var h=document.createElement("code");a(h).addClass(e).appendTo(a(g)),a(g).css("white-space",b.whiteSpace),c.css("white-space",b.whiteSpace),c.attr("spellcheck",!1),c[0].scrollHeight>c[0].clientHeight?a(h).css("right",d):a(h).css("right",0),i(c,h),c.on("input mouseup",function(){this.scrollHeight>this.clientHeight?a(h).css("right",d):a(h).css("right",0),i(this,h)}),c.scroll(function(){a(h).css({top:-c.scrollTop(),left:-c.scrollLeft()})})}}}(jQuery); -------------------------------------------------------------------------------- /inc/jscripts/editor/sets/html/set.min.css: -------------------------------------------------------------------------------- 1 | .markItUpSet-html .markItUpButton1 a{background-image:url(../../images/h1.png)}.markItUpSet-html .markItUpButton2 a{background-image:url(../../images/h2.png)}.markItUpSet-html .markItUpButton3 a{background-image:url(../../images/h3.png)}.markItUpSet-html .markItUpButton4 a{background-image:url(../../images/paragraph.png)}.markItUpSet-html .markItUpButton5 a{background-image:url(../../images/bold.png)}.markItUpSet-html .markItUpButton6 a{background-image:url(../../images/italic.png)}.markItUpSet-html .markItUpButton7 a{background-image:url(../../images/stroke.png)}.markItUpSet-html .markItUpButton8 a{background-image:url(../../images/list-bullet.png)}.markItUpSet-html .markItUpButton9 a{background-image:url(../../images/list-numeric.png)}.markItUpSet-html .markItUpButton10 a{background-image:url(../../images/list-item.png)}.markItUpSet-html .markItUpButton11 a{background-image:url(../../images/picture.png)}.markItUpSet-html .markItUpButton12 a{background-image:url(../../images/link.png)}.markItUpSet-html .markItUpButton13 a{background-image:url(../../images/clean.png)} -------------------------------------------------------------------------------- /inc/jscripts/editor/sets/html/set.min.js: -------------------------------------------------------------------------------- 1 | var markItUp_html={nameSpace:"markItUpSet-html",onShiftEnter:{keepDefault:!1,replaceWith:"
\n"},onCtrlEnter:{keepDefault:!1,openWith:"\n

",closeWith:"

"},onTab:{keepDefault:!1,replaceWith:" "},markupSet:[{key:"1",openWith:'',closeWith:""},{key:"2",openWith:'',closeWith:""},{key:"3",openWith:'',closeWith:""},{openWith:'',closeWith:"

"},{separator:"---------------"},{key:"B",openWith:"(!(|!|)!)",closeWith:"(!(|!|)!)"},{key:"I",openWith:"(!(|!|)!)",closeWith:"(!(|!|)!)"},{key:"S",openWith:"",closeWith:""},{separator:"---------------"},{openWith:"
  • ",closeWith:"
  • ",multiline:!0,openBlockWith:"
      \n",closeBlockWith:"\n
    "},{openWith:"
  • ",closeWith:"
  • ",multiline:!0,openBlockWith:"
      \n",closeBlockWith:"\n
    "},{openWith:"
  • ",closeWith:"
  • "},{separator:"---------------"},{key:"P",replaceWith:'[![Alternative text]!]'},{key:"L",openWith:'[![Name]!]',closeWith:""},{separator:"---------------"},{className:"clean",replaceWith:function(a){return a.selection.replace(/<(.*?)>/g,"")}}],afterInsert:function(a){$(a.textarea).trigger("input")}}; -------------------------------------------------------------------------------- /inc/jscripts/editor/sets/markdown/set.min.css: -------------------------------------------------------------------------------- 1 | .markItUpSet-markdown .markItUpButton1 a{background-image:url(../../images/h1.png)}.markItUpSet-markdown .markItUpButton2 a{background-image:url(../../images/h2.png)}.markItUpSet-markdown .markItUpButton3 a{background-image:url(../../images/h3.png)}.markItUpSet-markdown .markItUpButton4 a{background-image:url(../../images/bold.png)}.markItUpSet-markdown .markItUpButton5 a{background-image:url(../../images/italic.png)}.markItUpSet-markdown .markItUpButton6 a{background-image:url(../../images/list-bullet.png)}.markItUpSet-markdown .markItUpButton7 a{background-image:url(../../images/list-numeric.png)}.markItUpSet-markdown .markItUpButton8 a{background-image:url(../../images/picture.png)}.markItUpSet-markdown .markItUpButton9 a{background-image:url(../../images/link.png)}.markItUpSet-markdown .markItUpButton10 a{background-image:url(../../images/quotes.png)}.markItUpSet-markdown .markItUpButton11 a{background-image:url(../../images/code.png)} -------------------------------------------------------------------------------- /inc/jscripts/editor/sets/markdown/set.min.js: -------------------------------------------------------------------------------- 1 | var markItUp_markdown={nameSpace:"markItUpSet-markdown",onShiftEnter:{keepDefault:!1,openWith:"\n\n"},onTab:{keepDefault:!1,replaceWith:" "},markupSet:[{key:"1",placeHolder:"H1",closeWith:function(a){return miu.markdownTitle(a,"=")}},{key:"2",placeHolder:"H2",closeWith:function(a){return miu.markdownTitle(a,"-")}},{openWith:"### ",placeHolder:"H3"},{separator:"---------------"},{key:"B",openWith:"**",closeWith:"**"},{key:"I",openWith:"_",closeWith:"_"},{separator:"---------------"},{openWith:"- "},{openWith:function(a){return a.line+". "}},{separator:"---------------"},{key:"P",replaceWith:"![[![Alternative text]!]]([![Url:!:http://]!])"},{key:"L",openWith:"[[![Name]!]",closeWith:"]([![Url:!:http://]!])"},{separator:"---------------"},{openWith:"> "},{openWith:"(!(\t|!|`)!)",closeWith:"(!(`)!)"}],afterInsert:function(a){$(a.textarea).trigger("input")}},miu={markdownTitle:function(a,b){for(heading="",n=$.trim(a.selection||a.placeHolder).length,i=0;i").attr("id",b).addClass("tinynav "+b);if(h.is("ul,ol")){""!==c.header&&e.append(a("