From 64863d70386ec05a827b9ebef08a6c3aec18bf41 Mon Sep 17 00:00:00 2001 From: dignajar Date: Mon, 28 Dec 2015 19:28:42 -0300 Subject: [PATCH] New Bludit Images system v8 and Cover image --- kernel/admin/controllers/dashboard.php | 13 +- kernel/admin/themes/default/css/default.css | 110 ++++++++++ kernel/admin/themes/default/init.php | 215 ++++++++++++++++++++ kernel/admin/views/edit-page.php | 15 +- kernel/admin/views/edit-post.php | 15 +- kernel/admin/views/edit-user.php | 11 +- kernel/admin/views/new-page.php | 15 +- kernel/admin/views/new-post.php | 15 +- kernel/ajax/uploader.php | 36 ++-- kernel/boot/init.php | 11 +- kernel/js/functions.php | 2 +- languages/en_US.json | 4 +- languages/nl_NL.json | 166 +++++++++++++++ plugins/simplemde/plugin.php | 24 ++- 14 files changed, 611 insertions(+), 41 deletions(-) create mode 100644 languages/nl_NL.json diff --git a/kernel/admin/controllers/dashboard.php b/kernel/admin/controllers/dashboard.php index f3f8216a..0fd2967f 100644 --- a/kernel/admin/controllers/dashboard.php +++ b/kernel/admin/controllers/dashboard.php @@ -8,9 +8,16 @@ function updateBludit() global $Site; // Check if Bludit need to be update. - if($Site->currentBuild() < BLUDIT_BUILD) + if( ($Site->currentBuild() < BLUDIT_BUILD) || isset($_GET['update']) ) { - $directories = array(PATH_POSTS, PATH_PAGES, PATH_PLUGINS_DATABASES, PATH_UPLOADS_PROFILES); + $directories = array( + PATH_POSTS, + PATH_PAGES, + PATH_PLUGINS_DATABASES, + PATH_UPLOADS_PROFILES, + PATH_UPLOADS_THUMBNAILS, + PATH_TMP + ); foreach($directories as $dir) { @@ -23,6 +30,8 @@ function updateBludit() // Set and save the database. $Site->set(array('currentBuild'=>BLUDIT_BUILD)); + + Log::set('updateBludit'.LOG_SEP.'System updated'); } } diff --git a/kernel/admin/themes/default/css/default.css b/kernel/admin/themes/default/css/default.css index 63abb971..260e2800 100644 --- a/kernel/admin/themes/default/css/default.css +++ b/kernel/admin/themes/default/css/default.css @@ -87,6 +87,26 @@ li.bludit-logo { background: #F9F9F9 !important; } +.uk-container { + max-width: 1280px !important; +} + +.uk-width-large-4-5, +.uk-width-large-8-10 { + width: 75% !important; +} + +.uk-width-large-1-5, +.uk-width-large-2-10 { + width: 25% !important; +} + +.uk-thumbnail { + margin: 2px 4px !important; + max-width: 30% !important; + padding: 0 !important; +} + /* ----------- BLUDIT ----------- */ #logo { @@ -143,6 +163,91 @@ button.delete-button:hover { background: rgba(187, 48, 48, 0.91); } + + +/* ----------- BLUDIT IMAGES V8 ----------- */ +#bludit-images-v8 { + +} + +#bludit-images-v8 img.uk-thumbnail { + width: 15% !important; +} + +#bludit-images-v8-upload { + width: 100%; + padding: 0; +} + +#bludit-images-v8-drag-drop { + padding: 20px; +} + +#bludit-images-v8-progressbar { + display: none; +} + +#bludit-images-v8-thumbnails { + height: 350px; + overflow: auto; +} + +/* ----------- BLUDIT QUICK IMAGES ----------- */ +#bludit-quick-images { + +} + +#bludit-quick-images a.moreImages { + margin: 15px 0 0; + width: 100%; + background: #F5F5F5 !important; + color: #555; +} + +#bludit-quick-images h4.label { + background: #f8f8f8; + color: #aaa; + padding: 2px 5px; + font-size: 0.9em; +} + +/* ----------- BLUDIT COVER IMAGE ----------- */ +#bludit-cover-image { + +} + +#cover-image-thumbnail { + background-position: center center; + background-repeat: no-repeat; + background-size: cover; + color: #666; + height: 130px; + padding: 0; + width: 100%; +} + +#cover-image-upload { + color: #999; + position: relative; + top: 35%; +} + +#cover-image-delete { + background: rgba(255, 255, 255, 0.7); + bottom: 0; + color: #000; + display: none; + font-size: 2.2em; + padding: 4px 10px; + position: absolute; + right: 0; + cursor: pointer; +} + +#cover-image-progressbar { + display: none; +} + /* ----------- LOGIN FORM ----------- */ div.login-box > h1 { @@ -171,6 +276,11 @@ div.dashboard-links a { color: #555; } +/* NEW POST */ +h3.titleOptions { + font-size: 1em; +} + /* ----------- PLUGIN LIST / THEME LIST ----------- */ div.plugin-links > a { diff --git a/kernel/admin/themes/default/init.php b/kernel/admin/themes/default/init.php index c8a0d408..d86250b7 100644 --- a/kernel/admin/themes/default/init.php +++ b/kernel/admin/themes/default/init.php @@ -128,6 +128,221 @@ class HTML { $html = ''; } + public static function bluditQuickImages() + { + +$html = ''; +$html .= ' +
+

Images

+ +
+'; + +$thumbnailList = Filesystem::listFiles(PATH_UPLOADS_THUMBNAILS,'*','*',true); +array_splice($thumbnailList, THUMBNAILS_AMOUNT); +foreach($thumbnailList as $file) { + $filename = basename($file); + $html .= 'Thumbnail'; +} + +$html .= ' +
+ +More images + +
+'; + + echo $html; + } + + public static function bluditCoverImage() + { + global $L; + +$html = ''; +$html .= ' +
+
+ +
+
'.$L->g('Cover image').'
+
'.$L->g('Drag and drop or click here').'
+
+ +
+
+
+ +
+
0%
+
+ +
+
+'; + +$script = ' + +'; + echo $html.$script; + } + + public static function bluditImagesV8() + { + global $L; + +$html = ''; +$html .= ' +
+
+ +
+ +
+
'.$L->g('Upload image').'
+
'.$L->g('Drag and drop or click here').'
+
+ +
+
0%
+
+ +
+ +
+'; + + $thumbnailList = Filesystem::listFiles(PATH_UPLOADS_THUMBNAILS,'*','*',true); + foreach($thumbnailList as $file) { + $filename = basename($file); + $html .= 'Thumbnail'; + } + +$html .= ' +
+ + + +
+
+'; + +$script = ' + +'; + echo $html.$script; + } + public static function uploader() { global $L; diff --git a/kernel/admin/views/edit-page.php b/kernel/admin/views/edit-page.php index 2e876200..d41c43d8 100644 --- a/kernel/admin/views/edit-page.php +++ b/kernel/admin/views/edit-page.php @@ -18,7 +18,7 @@ HTML::formOpen(array('class'=>'uk-form-stacked')); // ---- LEFT SIDE ---- echo '
'; -echo '
'; +echo '
'; // Title input HTML::formInputText(array( @@ -52,7 +52,7 @@ if(count($_Page->children())===0) echo '
'; // ---- RIGHT SIDE ---- -echo '
'; +echo '