New Bludit Images system v8 and Cover image
This commit is contained in:
parent
e0e78920fe
commit
64863d7038
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -128,6 +128,221 @@ class HTML {
|
|||
$html = '';
|
||||
}
|
||||
|
||||
public static function bluditQuickImages()
|
||||
{
|
||||
|
||||
$html = '<!-- BLUDIT QUICK IMAGES -->';
|
||||
$html .= '
|
||||
<div id="bludit-quick-images">
|
||||
<h4 class="label">Images</h4>
|
||||
|
||||
<div id="bludit-quick-images-thumbnails">
|
||||
';
|
||||
|
||||
$thumbnailList = Filesystem::listFiles(PATH_UPLOADS_THUMBNAILS,'*','*',true);
|
||||
array_splice($thumbnailList, THUMBNAILS_AMOUNT);
|
||||
foreach($thumbnailList as $file) {
|
||||
$filename = basename($file);
|
||||
$html .= '<img class="bludit-thumbnail uk-thumbnail" data-filename="'.$filename.'" src="'.HTML_PATH_UPLOADS_THUMBNAILS.$filename.'" alt="Thumbnail">';
|
||||
}
|
||||
|
||||
$html .= '
|
||||
</div>
|
||||
|
||||
<a data-uk-modal href="#bludit-images-v8" class="moreImages uk-button">More images</a>
|
||||
|
||||
</div>
|
||||
';
|
||||
|
||||
echo $html;
|
||||
}
|
||||
|
||||
public static function bluditCoverImage()
|
||||
{
|
||||
global $L;
|
||||
|
||||
$html = '<!-- BLUDIT COVER IMAGE -->';
|
||||
$html .= '
|
||||
<div id="bludit-cover-image">
|
||||
<div id="cover-image-thumbnail" class="uk-form-file uk-placeholder uk-text-center">
|
||||
|
||||
<div id="cover-image-upload">
|
||||
<div><i class="uk-icon-picture-o"></i> '.$L->g('Cover image').'</div>
|
||||
<div>'.$L->g('Drag and drop or click here').'<input id="cover-image-file-select" type="file"></div>
|
||||
</div>
|
||||
|
||||
<div id="cover-image-delete">
|
||||
<div><i class="uk-icon-trash-o"></i></div>
|
||||
</div>
|
||||
|
||||
<div id="cover-image-progressbar" class="uk-progress">
|
||||
<div class="uk-progress-bar" style="width: 0%;">0%</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
$script = '
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#cover-image-delete").on("click", function() {
|
||||
$("#cover-image-thumbnail").attr("style","");
|
||||
$("#cover-image-delete").hide();
|
||||
$("#cover-image-upload").show();
|
||||
});
|
||||
|
||||
var settings =
|
||||
{
|
||||
type: "json",
|
||||
action: HTML_PATH_ADMIN_ROOT+"ajax/uploader",
|
||||
allow : "*.(jpg|jpeg|gif|png)",
|
||||
params: {"type":"cover-image"},
|
||||
|
||||
loadstart: function() {
|
||||
$("#cover-image-progressbar").find(".uk-progress-bar").css("width", "0%").text("0%");
|
||||
$("#cover-image-progressbar").hide();
|
||||
$("#cover-image-delete").hide();
|
||||
$("#cover-image-upload").hide();
|
||||
},
|
||||
|
||||
progress: function(percent) {
|
||||
percent = Math.ceil(percent);
|
||||
$("#cover-image-progressbar").find(".uk-progress-bar").css("width", percent+"%").text(percent+"%");
|
||||
},
|
||||
|
||||
allcomplete: function(response) {
|
||||
$("#cover-image-progressbar").find(".uk-progress-bar").css("width", "100%").text("100%");
|
||||
$("#cover-image-progressbar").hide();
|
||||
|
||||
var imageSrc = HTML_PATH_UPLOADS_THUMBNAILS+response.filename;
|
||||
$("#cover-image-thumbnail").attr("style","background-image: url("+imageSrc+")");
|
||||
$("#cover-image-delete").show();
|
||||
|
||||
$("img:last-child", "#bludit-quick-images-thumbnails").remove();
|
||||
$("#bludit-quick-images-thumbnails").prepend("<img class=\"bludit-thumbnail uk-thumbnail\" data-filename=\""+response.filename+"\" src=\""+imageSrc+"\" alt=\"Thumbnail\">");
|
||||
},
|
||||
|
||||
notallowed: function(file, settings) {
|
||||
alert("'.$L->g('Supported image file types').' "+settings.allow);
|
||||
}
|
||||
};
|
||||
|
||||
UIkit.uploadSelect($("#cover-image-file-select"), settings);
|
||||
UIkit.uploadDrop($("#cover-image-thumbnail"), settings);
|
||||
|
||||
});
|
||||
</script>
|
||||
';
|
||||
echo $html.$script;
|
||||
}
|
||||
|
||||
public static function bluditImagesV8()
|
||||
{
|
||||
global $L;
|
||||
|
||||
$html = '<!-- BLUDIT IMAGES V8 -->';
|
||||
$html .= '
|
||||
<div id="bludit-images-v8" class="uk-modal">
|
||||
<div class="uk-modal-dialog">
|
||||
|
||||
<div id="bludit-images-v8-upload" class="uk-form-file uk-placeholder uk-text-center">
|
||||
|
||||
<div id="bludit-images-v8-drag-drop">
|
||||
<div><i class="uk-icon-picture-o"></i> '.$L->g('Upload image').'</div>
|
||||
<div>'.$L->g('Drag and drop or click here').'<input id="bludit-images-v8-file-select" type="file"></div>
|
||||
</div>
|
||||
|
||||
<div id="bludit-images-v8-progressbar" class="uk-progress">
|
||||
<div class="uk-progress-bar" style="width: 0%;">0%</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="bludit-images-v8-thumbnails">
|
||||
';
|
||||
|
||||
$thumbnailList = Filesystem::listFiles(PATH_UPLOADS_THUMBNAILS,'*','*',true);
|
||||
foreach($thumbnailList as $file) {
|
||||
$filename = basename($file);
|
||||
$html .= '<img class="bludit-thumbnail uk-thumbnail" src="'.HTML_PATH_UPLOADS_THUMBNAILS.$filename.'" data-filename="'.$filename.'" alt="Thumbnail">';
|
||||
}
|
||||
|
||||
$html .= '
|
||||
</div>
|
||||
|
||||
<div class="uk-modal-footer">
|
||||
Double click on the image to add it or <a href="" class="uk-modal-close">click here to cancel</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
$script = '
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
// Add border when select an thumbnail
|
||||
$("body").on("click", "img.bludit-thumbnail", function() {
|
||||
$(".bludit-thumbnail").css("border", "1px solid #ddd");
|
||||
$(this).css("border", "solid 3px orange");
|
||||
});
|
||||
|
||||
// Hide the modal when double click on thumbnail.
|
||||
$("body").on("dblclick", "img.bludit-thumbnail", function() {
|
||||
var modal = UIkit.modal("#bludit-images-v8");
|
||||
if ( modal.isActive() ) {
|
||||
modal.hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Event for double click for insert the image is in each editor plugin
|
||||
// ..
|
||||
|
||||
var settings =
|
||||
{
|
||||
type: "json",
|
||||
action: HTML_PATH_ADMIN_ROOT+"ajax/uploader",
|
||||
allow : "*.(jpg|jpeg|gif|png)",
|
||||
params: {"type":"bludit-images-v8"},
|
||||
|
||||
loadstart: function() {
|
||||
$("#bludit-images-v8-progressbar").find(".uk-progress-bar").css("width", "0%").text("0%");
|
||||
},
|
||||
|
||||
progress: function(percent) {
|
||||
percent = Math.ceil(percent);
|
||||
$("#bludit-images-v8-progressbar").find(".uk-progress-bar").css("width", percent+"%").text(percent+"%");
|
||||
},
|
||||
|
||||
allcomplete: function(response) {
|
||||
$("#bludit-images-v8-progressbar").find(".uk-progress-bar").css("width", "100%").text("100%");
|
||||
$("#bludit-images-v8-progressbar").hide();
|
||||
|
||||
// Images V8 Thumbnails
|
||||
var imageSrc = HTML_PATH_UPLOADS_THUMBNAILS+response.filename;
|
||||
$("#bludit-images-v8-thumbnails").prepend("<img class=\"bludit-thumbnail uk-thumbnail\" data-filename=\""+response.filename+"\" src=\""+imageSrc+"\" alt=\"Thumbnail\">");
|
||||
|
||||
// Quick images Thumbnails
|
||||
$("img:last-child", "#bludit-quick-images-thumbnails").remove();
|
||||
$("#bludit-quick-images-thumbnails").prepend("<img class=\"bludit-thumbnail uk-thumbnail\" data-filename=\""+response.filename+"\" src=\""+imageSrc+"\" alt=\"Thumbnail\">");
|
||||
},
|
||||
|
||||
notallowed: function(file, settings) {
|
||||
alert("'.$L->g('Supported image file types').' "+settings.allow);
|
||||
}
|
||||
};
|
||||
|
||||
UIkit.uploadSelect($("#bludit-images-v8-file-select"), settings);
|
||||
UIkit.uploadDrop($("#bludit-images-v8-upload"), settings);
|
||||
});
|
||||
</script>
|
||||
';
|
||||
echo $html.$script;
|
||||
}
|
||||
|
||||
public static function uploader()
|
||||
{
|
||||
global $L;
|
||||
|
|
|
@ -18,7 +18,7 @@ HTML::formOpen(array('class'=>'uk-form-stacked'));
|
|||
|
||||
// ---- LEFT SIDE ----
|
||||
echo '<div class="uk-grid">';
|
||||
echo '<div class="uk-width-large-7-10">';
|
||||
echo '<div class="uk-width-large-8-10">';
|
||||
|
||||
// Title input
|
||||
HTML::formInputText(array(
|
||||
|
@ -52,7 +52,7 @@ if(count($_Page->children())===0)
|
|||
echo '</div>';
|
||||
|
||||
// ---- RIGHT SIDE ----
|
||||
echo '<div class="uk-width-large-3-10">';
|
||||
echo '<div class="sidebar uk-width-large-2-10">';
|
||||
|
||||
// Tabs, general and advanced mode
|
||||
echo '<ul class="uk-tab" data-uk-tab="{connect:\'#tab-options\'}">';
|
||||
|
@ -71,7 +71,7 @@ echo '<div class="uk-width-large-3-10">';
|
|||
'name'=>'description',
|
||||
'label'=>$L->g('description'),
|
||||
'value'=>$_Page->description(),
|
||||
'rows'=>'7',
|
||||
'rows'=>'4',
|
||||
'class'=>'uk-width-1-1 uk-form-medium',
|
||||
'tip'=>$L->g('this-field-can-help-describe-the-content')
|
||||
));
|
||||
|
@ -90,7 +90,14 @@ echo '<div class="uk-width-large-3-10">';
|
|||
// ---- IMAGES TAB ----
|
||||
echo '<li>';
|
||||
|
||||
HTML::uploader();
|
||||
// --- BLUDIT COVER IMAGE ---
|
||||
HTML::bluditCoverImage();
|
||||
|
||||
// --- BLUDIT QUICK IMAGES ---
|
||||
HTML::bluditQuickImages();
|
||||
|
||||
// --- BLUDIT IMAGES V8 ---
|
||||
HTML::bluditImagesV8();
|
||||
|
||||
echo '</li>';
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ HTML::formOpen(array('class'=>'uk-form-stacked'));
|
|||
|
||||
// ---- LEFT SIDE ----
|
||||
echo '<div class="uk-grid">';
|
||||
echo '<div class="uk-width-large-7-10">';
|
||||
echo '<div class="uk-width-large-8-10">';
|
||||
|
||||
// Title input
|
||||
HTML::formInputText(array(
|
||||
|
@ -46,7 +46,7 @@ echo '<div class="uk-width-large-7-10">';
|
|||
echo '</div>';
|
||||
|
||||
// ---- RIGHT SIDE ----
|
||||
echo '<div class="uk-width-large-3-10">';
|
||||
echo '<div class="sidebar uk-width-large-2-10">';
|
||||
|
||||
// Tabs, general and advanced mode
|
||||
echo '<ul class="uk-tab" data-uk-tab="{connect:\'#tab-options\'}">';
|
||||
|
@ -65,7 +65,7 @@ echo '<div class="uk-width-large-3-10">';
|
|||
'name'=>'description',
|
||||
'label'=>$L->g('description'),
|
||||
'value'=>$_Post->description(),
|
||||
'rows'=>'7',
|
||||
'rows'=>'4',
|
||||
'class'=>'uk-width-1-1 uk-form-medium',
|
||||
'tip'=>$L->g('this-field-can-help-describe-the-content')
|
||||
));
|
||||
|
@ -84,7 +84,14 @@ echo '<div class="uk-width-large-3-10">';
|
|||
// ---- IMAGES TAB ----
|
||||
echo '<li>';
|
||||
|
||||
HTML::uploader();
|
||||
// --- BLUDIT COVER IMAGE ---
|
||||
HTML::bluditCoverImage();
|
||||
|
||||
// --- BLUDIT QUICK IMAGES ---
|
||||
HTML::bluditQuickImages();
|
||||
|
||||
// --- BLUDIT IMAGES V8 ---
|
||||
HTML::bluditImagesV8();
|
||||
|
||||
echo '</li>';
|
||||
|
||||
|
|
|
@ -64,7 +64,6 @@ if($Login->role()==='admin') {
|
|||
));
|
||||
|
||||
}
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'email',
|
||||
'label'=>$L->g('Email'),
|
||||
|
@ -73,6 +72,16 @@ if($Login->role()==='admin') {
|
|||
'tip'=>$L->g('email-will-not-be-publicly-displayed')
|
||||
));
|
||||
|
||||
HTML::legend(array('value'=>$L->g('Social network')));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'twitterUsername',
|
||||
'label'=>$L->g('Twitter username'),
|
||||
'value'=>$_user['twitterUsername'],
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo '<div class="uk-form-row">
|
||||
<div class="uk-form-controls">
|
||||
<button type="submit" class="uk-button uk-button-primary">'.$L->g('Save').'</button>
|
||||
|
|
|
@ -12,7 +12,7 @@ HTML::formOpen(array('class'=>'uk-form-stacked'));
|
|||
|
||||
// ---- LEFT SIDE ----
|
||||
echo '<div class="uk-grid">';
|
||||
echo '<div class="uk-width-large-7-10">';
|
||||
echo '<div class="uk-width-large-8-10">';
|
||||
|
||||
// Title input
|
||||
HTML::formInputText(array(
|
||||
|
@ -39,7 +39,7 @@ echo '<div class="uk-width-large-7-10">';
|
|||
echo '</div>';
|
||||
|
||||
// ---- RIGHT SIDE ----
|
||||
echo '<div class="uk-width-large-3-10">';
|
||||
echo '<div class="sidebar uk-width-large-2-10">';
|
||||
|
||||
// Tabs, general and advanced mode
|
||||
echo '<ul class="uk-tab" data-uk-tab="{connect:\'#tab-options\'}">';
|
||||
|
@ -58,7 +58,7 @@ echo '<div class="uk-width-large-3-10">';
|
|||
'name'=>'description',
|
||||
'label'=>$L->g('description'),
|
||||
'value'=>'',
|
||||
'rows'=>'7',
|
||||
'rows'=>'4',
|
||||
'class'=>'uk-width-1-1 uk-form-medium',
|
||||
'tip'=>$L->g('this-field-can-help-describe-the-content')
|
||||
));
|
||||
|
@ -77,7 +77,14 @@ echo '<div class="uk-width-large-3-10">';
|
|||
// ---- IMAGES TAB ----
|
||||
echo '<li>';
|
||||
|
||||
HTML::uploader();
|
||||
// --- BLUDIT COVER IMAGE ---
|
||||
HTML::bluditCoverImage();
|
||||
|
||||
// --- BLUDIT QUICK IMAGES ---
|
||||
HTML::bluditQuickImages();
|
||||
|
||||
// --- BLUDIT IMAGES V8 ---
|
||||
HTML::bluditImagesV8();
|
||||
|
||||
echo '</li>';
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ HTML::formOpen(array('class'=>'uk-form-stacked'));
|
|||
|
||||
// ---- LEFT SIDE ----
|
||||
echo '<div class="uk-grid">';
|
||||
echo '<div class="uk-width-large-7-10">';
|
||||
echo '<div class="uk-width-large-8-10">';
|
||||
|
||||
// Title input
|
||||
HTML::formInputText(array(
|
||||
|
@ -39,7 +39,7 @@ echo '<div class="uk-width-large-7-10">';
|
|||
echo '</div>';
|
||||
|
||||
// ---- RIGHT SIDE ----
|
||||
echo '<div class="uk-width-large-3-10">';
|
||||
echo '<div class="sidebar uk-width-large-2-10">';
|
||||
|
||||
// Tabs, general and advanced mode
|
||||
echo '<ul class="uk-tab" data-uk-tab="{connect:\'#tab-options\'}">';
|
||||
|
@ -58,7 +58,7 @@ echo '<div class="uk-width-large-3-10">';
|
|||
'name'=>'description',
|
||||
'label'=>$L->g('description'),
|
||||
'value'=>'',
|
||||
'rows'=>'7',
|
||||
'rows'=>'4',
|
||||
'class'=>'uk-width-1-1 uk-form-medium',
|
||||
'tip'=>$L->g('this-field-can-help-describe-the-content')
|
||||
));
|
||||
|
@ -77,7 +77,14 @@ echo '<div class="uk-width-large-3-10">';
|
|||
// ---- IMAGES TAB ----
|
||||
echo '<li>';
|
||||
|
||||
HTML::uploader();
|
||||
// --- BLUDIT COVER IMAGE ---
|
||||
HTML::bluditCoverImage();
|
||||
|
||||
// --- BLUDIT QUICK IMAGES ---
|
||||
HTML::bluditQuickImages();
|
||||
|
||||
// --- BLUDIT IMAGES V8 ---
|
||||
HTML::bluditImagesV8();
|
||||
|
||||
echo '</li>';
|
||||
|
||||
|
|
|
@ -8,17 +8,19 @@ if(!empty($_POST['type'])) {
|
|||
$type = Sanitize::html($_POST['type']);
|
||||
}
|
||||
|
||||
// Source
|
||||
// Source.
|
||||
$source = $_FILES['files']['tmp_name'][0];
|
||||
|
||||
// Filename
|
||||
// Filename and extension.
|
||||
$filename = Text::lowercase($_FILES['files']['name'][0]);
|
||||
$fileExtension = pathinfo($filename, PATHINFO_EXTENSION);
|
||||
$filename = pathinfo($filename, PATHINFO_FILENAME);
|
||||
$filename = Text::replace(' ', '', $filename);
|
||||
$filename = Text::replace('_', '', $filename);
|
||||
|
||||
if( file_exists(PATH_UPLOADS.$filename.'.'.$fileExtension) )
|
||||
// Generate the next filename if the filename already exist.
|
||||
$tmpName = $filename.'.'.$fileExtension;
|
||||
if( file_exists(PATH_UPLOADS.$tmpName) )
|
||||
{
|
||||
$number = 0;
|
||||
$tmpName = $filename.'_'.$number.'.'.$fileExtension;
|
||||
|
@ -28,29 +30,33 @@ if( file_exists(PATH_UPLOADS.$filename.'.'.$fileExtension) )
|
|||
}
|
||||
}
|
||||
|
||||
if(empty($tmpName)) {
|
||||
$tmpName = $filename.'.'.$fileExtension;
|
||||
}
|
||||
// Move from temporary PHP folder to temporary Bludit folder.
|
||||
move_uploaded_file($source, PATH_TMP.'original'.'.'.$fileExtension);
|
||||
|
||||
// --- PROFILE PICTURE ---
|
||||
if($type=='profilePicture')
|
||||
{
|
||||
// Move to tmp file
|
||||
move_uploaded_file($source, PATH_UPLOADS_PROFILES.'tmp'.'.'.$fileExtension);
|
||||
|
||||
// Resize and crop profile image.
|
||||
$username = Sanitize::html($_POST['username']);
|
||||
$tmpName = $username.'.jpg';
|
||||
$Image = new Image();
|
||||
$Image->setImage(PATH_UPLOADS_PROFILES.'tmp'.'.'.$fileExtension, '200', '200', 'crop');
|
||||
$Image->setImage(PATH_TMP.'original'.'.'.$fileExtension, '200', '200', 'crop');
|
||||
$Image->saveImage(PATH_UPLOADS_PROFILES.$tmpName, 100, true);
|
||||
|
||||
// Remove tmp file
|
||||
unlink(PATH_UPLOADS_PROFILES.'tmp'.'.'.$fileExtension);
|
||||
}
|
||||
// --- OTHERS ---
|
||||
else {
|
||||
move_uploaded_file($source, PATH_UPLOADS.$tmpName);
|
||||
// Generate the thumbnail
|
||||
$Image = new Image();
|
||||
$Image->setImage(PATH_TMP.'original'.'.'.$fileExtension, THUMBNAILS_WIDTH, THUMBNAILS_HEIGHT, 'crop');
|
||||
$Image->saveImage(PATH_UPLOADS_THUMBNAILS.$tmpName, 100, true);
|
||||
|
||||
// Move the original to the upload folder.
|
||||
rename(PATH_TMP.'original'.'.'.$fileExtension, PATH_UPLOADS.$tmpName);
|
||||
}
|
||||
|
||||
// Remove the Bludit temporary file.
|
||||
if(file_exists(PATH_TMP.'original'.'.'.$fileExtension)) {
|
||||
unlink(PATH_TMP.'original'.'.'.$fileExtension);
|
||||
}
|
||||
|
||||
exit(json_encode(array(
|
||||
|
|
|
@ -35,8 +35,10 @@ define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
|
|||
define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
|
||||
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
|
||||
define('PATH_PLUGINS_DATABASES', PATH_CONTENT.'databases'.DS.'plugins'.DS);
|
||||
define('PATH_TMP', PATH_CONTENT.'tmp'.DS);
|
||||
define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS);
|
||||
define('PATH_UPLOADS_PROFILES', PATH_UPLOADS.'profiles'.DS);
|
||||
define('PATH_UPLOADS_THUMBNAILS', PATH_UPLOADS.'thumbnails'.DS);
|
||||
define('PATH_ADMIN', PATH_KERNEL.'admin'.DS);
|
||||
define('PATH_ADMIN_THEMES', PATH_ADMIN.'themes'.DS);
|
||||
define('PATH_ADMIN_CONTROLLERS', PATH_ADMIN.'controllers'.DS);
|
||||
|
@ -56,6 +58,12 @@ define('ALERT_STATUS_OK', 0);
|
|||
// Alert status fail
|
||||
define('ALERT_STATUS_FAIL', 1);
|
||||
|
||||
// Salt length
|
||||
define('THUMBNAILS_WIDTH', 400);
|
||||
define('THUMBNAILS_HEIGHT', 400);
|
||||
|
||||
define('THUMBNAILS_AMOUNT', 6);
|
||||
|
||||
// Salt length
|
||||
define('SALT_LENGTH', 8);
|
||||
|
||||
|
@ -87,7 +95,7 @@ define('TOKEN_EMAIL_TTL', '+15 minutes');
|
|||
define('CHARSET', 'UTF-8');
|
||||
|
||||
// Directory permissions
|
||||
define('DIR_PERMISSIONS', '0755');
|
||||
define('DIR_PERMISSIONS', 0755);
|
||||
|
||||
// Multibyte string extension loaded.
|
||||
define('MB_STRING', extension_loaded('mbstring'));
|
||||
|
@ -193,6 +201,7 @@ define('HTML_PATH_ADMIN_THEME_IMG', HTML_PATH_ADMIN_THEME.'img/');
|
|||
|
||||
define('HTML_PATH_UPLOADS', HTML_PATH_ROOT.'content/uploads/');
|
||||
define('HTML_PATH_UPLOADS_PROFILES', HTML_PATH_UPLOADS.'profiles/');
|
||||
define('HTML_PATH_UPLOADS_THUMBNAILS', HTML_PATH_UPLOADS.'thumbnails/');
|
||||
define('HTML_PATH_PLUGINS', HTML_PATH_ROOT.'plugins/');
|
||||
|
||||
define('JQUERY', HTML_PATH_ADMIN_THEME_JS.'jquery.min.js');
|
||||
|
|
|
@ -6,7 +6,7 @@ echo 'var HTML_PATH_ROOT = "'.HTML_PATH_ROOT.'";'.PHP_EOL;
|
|||
echo 'var HTML_PATH_ADMIN_ROOT = "'.HTML_PATH_ADMIN_ROOT.'";'.PHP_EOL;
|
||||
echo 'var HTML_PATH_ADMIN_THEME = "'.HTML_PATH_ADMIN_THEME.'";'.PHP_EOL;
|
||||
echo 'var HTML_PATH_UPLOADS = "'.HTML_PATH_UPLOADS.'";'.PHP_EOL;
|
||||
|
||||
echo 'var HTML_PATH_UPLOADS_THUMBNAILS = "'.HTML_PATH_UPLOADS_THUMBNAILS.'";'.PHP_EOL;
|
||||
echo 'var NO_PARENT_CHAR = "'.NO_PARENT_CHAR.'";'.PHP_EOL;
|
||||
|
||||
echo '</script>';
|
||||
|
|
|
@ -218,5 +218,7 @@
|
|||
"site-information": "Site information",
|
||||
"date-and-time-formats": "Date and time formats",
|
||||
"activate": "Activate",
|
||||
"deactivate": "Deactivate"
|
||||
"deactivate": "Deactivate",
|
||||
|
||||
"cover-image": "Cover image"
|
||||
}
|
|
@ -0,0 +1,166 @@
|
|||
{
|
||||
"language-data":
|
||||
{
|
||||
"native": "Nederlands",
|
||||
"english-name": "Dutch",
|
||||
"last-update": "2015-12-11",
|
||||
"author": "",
|
||||
"email": "",
|
||||
"website": ""
|
||||
},
|
||||
|
||||
"username": "Gebruikersnaam",
|
||||
"password": "Wachtwoord",
|
||||
"confirm-password": "Bevestig wachtwoord",
|
||||
"editor": "Editor",
|
||||
"dashboard": "Dashboard",
|
||||
"role": "Rol",
|
||||
"post": "Artikel",
|
||||
"posts": "Artikelen",
|
||||
"users": "Gebruikers",
|
||||
"administrator": "Administrator",
|
||||
"add": "Voeg toe",
|
||||
"cancel": "Annuleer",
|
||||
"content": "Inhoud",
|
||||
"title": "Titel",
|
||||
"no-parent": "Geen bovenliggend item",
|
||||
"edit-page": "Pagina aanpassen",
|
||||
"edit-post": "Artikel aanpassen",
|
||||
"add-a-new-user": "Voeg een nieuwe gebruiker toe",
|
||||
"parent": "Parent",
|
||||
"friendly-url": "Gebruiksvriendelijke URL",
|
||||
"description": "Omschrijving",
|
||||
"posted-by": "Geplaatst door",
|
||||
"tags": "Tags",
|
||||
"position": "Positie",
|
||||
"save": "Opslaan",
|
||||
"draft": "Concept",
|
||||
"delete": "Verwijder",
|
||||
"registered": "Geregistreerd",
|
||||
"Notifications": "Berichtgevingen",
|
||||
"profile": "Profiel",
|
||||
"email": "Email",
|
||||
"settings": "Instellingen",
|
||||
"general": "Algemeen",
|
||||
"Advanced": "Geadvanceerd",
|
||||
"regional": "Taal/Tijd/Locatie",
|
||||
"about": "Over",
|
||||
"login": "Aanmelden",
|
||||
"logout": "Afmelden",
|
||||
"manage": "Aanpassen",
|
||||
"themes": "Thema",
|
||||
"prev-page": "Vorige pagina",
|
||||
"next-page": "Volgende pagina",
|
||||
"configure-plugin": "Configureer de plugin",
|
||||
"confirm-delete-this-action-cannot-be-undone": "Bevestig het verwijderen,dit kan niet ongedaan worden gemaakt.",
|
||||
"site-title": "Titel van de site",
|
||||
"site-slogan": "Slogan voor de site",
|
||||
"site-description": "Omschrijving van de site",
|
||||
"footer-text": "Footer tekst",
|
||||
"posts-per-page": "Artikelen per pagina",
|
||||
"site-url": "De url van de site",
|
||||
"writting-settings": "Schrijf instellingen",
|
||||
"url-filters": "URL filters",
|
||||
"page": "Pagina",
|
||||
"pages": "Pagina's",
|
||||
"home": "Home",
|
||||
"welcome-back": "Welkom terug",
|
||||
"language": "Taal",
|
||||
"website": "Website",
|
||||
"timezone": "Tijdzone",
|
||||
"locale": "Lokaal",
|
||||
"new-post": "Nieuw artikel",
|
||||
"html-and-markdown-code-supported": "HTML en Markdown code worden ondersteund",
|
||||
"new-page": "Nieuwe pagina",
|
||||
"manage-posts": "Beheer artikelen",
|
||||
"published-date": "Publicatie datum",
|
||||
"modified-date": "Aanpassingsdatum",
|
||||
"empty-title": "Lege titel",
|
||||
"plugins": "Plugins",
|
||||
"install-plugin": "Installeer plugin",
|
||||
"uninstall-plugin": "Verwijder plugin",
|
||||
"new-password": "Nieuw wachtwoord",
|
||||
"edit-user": "Gebruiker aanpassen",
|
||||
"publish-now": "Publiceer nu",
|
||||
"first-name": "Voornaam",
|
||||
"last-name": "Achternaam",
|
||||
"bludit-version": "Bludit Versie",
|
||||
"powered-by": "Aangestuurd door",
|
||||
"recent-posts": "Recente artikelen",
|
||||
"manage-pages": "Beheer pagina's",
|
||||
"advanced-options": "Geadvanceerde opties",
|
||||
"user-deleted": "Gebruiker verwijderd",
|
||||
"page-added-successfully": "Pagina succesvol toegevoegd",
|
||||
"post-added-successfully": "Artikel succesvol toegevoegd",
|
||||
"the-post-has-been-deleted-successfully": "Artikel succesvol verwijderd",
|
||||
"the-page-has-been-deleted-successfully": "Pagina succesvol verwijderd",
|
||||
"username-or-password-incorrect": "Gebruikersnaam of wachtwoord is onjuist",
|
||||
"database-regenerated": "Database opnieuw aangemaakt",
|
||||
"the-changes-have-been-saved": "De veranderingen zijn opgeslagen",
|
||||
"enable-more-features-at": "Voeg meer opties toe",
|
||||
"username-already-exists": "Gebruikersnaam bestaat al",
|
||||
"username-field-is-empty": "Gebruikersnaam is leeg",
|
||||
"the-password-and-confirmation-password-do-not-match":"Ingevoerde wachtwoorden zijn niet gelijk aan elkaar",
|
||||
"user-has-been-added-successfully": "Gebruiker toegevoegd",
|
||||
"you-do-not-have-sufficient-permissions": "Onvoldoende rechten voor deze uitvoering",
|
||||
"settings-advanced-writting-settings": "Instellingen-> Geadvanceerd-> Schrijf instellingen",
|
||||
"new-posts-and-pages-synchronized": "Pagina's en artikelen zijn gesynchroniseerd.",
|
||||
"you-can-choose-the-users-privilege": "Stel hier privileges in. De editor rol kan alleen pagina's en artikelen plaatsen.",
|
||||
"email-will-not-be-publicly-displayed": "Email(afgeschermd). Aanbevolen voor vergeten wachtwoord en notificaties ",
|
||||
"use-this-field-to-name-your-site": "Titel van de site,wordt op iedere pagina weergegeven.",
|
||||
"use-this-field-to-add-a-catchy-phrase": "Slogan voor je site.",
|
||||
"you-can-add-a-site-description-to-provide": "Korte Omschrijving van je site.",
|
||||
"you-can-add-a-small-text-on-the-bottom": "Plaats hier een korte tekst( bijv.copyright / datum / merknaam )",
|
||||
"number-of-posts-to-show-per-page": "Aantal artikelen per pagina.",
|
||||
"the-url-of-your-site": "De url van je site.",
|
||||
"add-or-edit-description-tags-or": "Plaats of bewerk omschrijving / tags / gebruiksvriendelijke URL.",
|
||||
"select-your-sites-language": "Selecteer taal.",
|
||||
"select-a-timezone-for-a-correct": "Selecteer de tijdzone.",
|
||||
"you-can-use-this-field-to-define-a-set-of": "Speciale instellingen voor tijd / datum.",
|
||||
"you-can-modify-the-url-which-identifies":"Plaats hier de tekst voor gebruiksvriendelijke URL / niet meer dan 150 leestekens.",
|
||||
"this-field-can-help-describe-the-content": "Omschrijving voor gebruiksvriendelijke URL / niet meer dan 150 leestekens.",
|
||||
"write-the-tags-separeted-by-comma": "Tags verdeeld door komma's bijv: tag1, tag2, tag3",
|
||||
"delete-the-user-and-all-its-posts":"Verwijder gebruiker en door gebruiker geplaatste artikelen",
|
||||
"delete-the-user-and-associate-its-posts-to-admin-user": "Verwijder gebruiker en plaats alle artikelen onder administrator ",
|
||||
"read-more": "Meer ...",
|
||||
"show-blog": "Bekijk blog",
|
||||
"default-home-page": "Home pagina",
|
||||
"version": "Versie",
|
||||
"there-are-no-drafts": "Er zijn geen concepten.",
|
||||
"create-a-new-article-for-your-blog":"Nieuw artikel.",
|
||||
"create-a-new-page-for-your-website":"Nieuwe pagina.",
|
||||
"invite-a-friend-to-collaborate-on-your-website":"Nodig iemand uit om samen de site te bewerken.",
|
||||
"change-your-language-and-region-settings":"Instellingen voor taal en locatie.",
|
||||
"language-and-timezone":"Taal en tijdzone",
|
||||
"author": "Auteur",
|
||||
"start-here": "Begin hier",
|
||||
"install-theme": "Installeer thema",
|
||||
"first-post": "Eerste artikel",
|
||||
"congratulations-you-have-successfully-installed-your-bludit": "Gefeliciteerd **Bludit** is succesvol geinstalleerd",
|
||||
"whats-next": "En nu?",
|
||||
"manage-your-bludit-from-the-admin-panel": "Beheer Bludit via het administratie omgeving(./admin/)",
|
||||
"follow-bludit-on": "Volg Bludit via",
|
||||
"visit-the-support-forum": "Bezoek het [forum](http://forum.bludit.com) voor ondersteuning(Engels)",
|
||||
"read-the-documentation-for-more-information": "Lees de [documentatie](http://docs.bludit.com) voor meer informatie(Engels)",
|
||||
"share-with-your-friends-and-enjoy": "Deel met je vrienden en veel plezier",
|
||||
"the-page-has-not-been-found": "De pagina werd niet gevonden.",
|
||||
"error": "Error",
|
||||
"bludit-installer": "Bludit installatie programma",
|
||||
"welcome-to-the-bludit-installer": "Welkom bij het Bludit installatie programma",
|
||||
"complete-the-form-choose-a-password-for-the-username-admin": "Vul het formulier in, kies een gebruikersnaam en wachtwoord « admin »",
|
||||
"password-visible-field": "Wachtwoord, zichtbaar veld!",
|
||||
"install": "Installeer",
|
||||
"choose-your-language":"Kies je taal",
|
||||
"next": "Volgende",
|
||||
"the-password-field-is-empty": "Geen wachtwoord ingevuld",
|
||||
"your-email-address-is-invalid":"Het email adres is ongeldig.",
|
||||
"proceed-anyway": "Toch doorgaan!",
|
||||
"drafts":"Concepten",
|
||||
"ip-address-has-been-blocked": "IP adres is geblokkeerd.",
|
||||
"try-again-in-a-few-minutes": "Probeer het over een paar minuten nog eens.",
|
||||
"date": "Datum",
|
||||
"you-can-schedule-the-post-just-select-the-date-and-time": "Je kunt je artikel later plaatsen,voer datum en tijd in",
|
||||
"scheduled": "Ingepland",
|
||||
"publish": "Publiceer",
|
||||
"please-check-your-theme-configuration": "Denk om de thema instellingen."
|
||||
}
|
|
@ -80,8 +80,16 @@ class pluginsimpleMDE extends Plugin {
|
|||
$pluginPath = $this->htmlPath();
|
||||
|
||||
$html = '<script>'.PHP_EOL;
|
||||
|
||||
$html .= 'var simplemde = null;'.PHP_EOL;
|
||||
|
||||
$html .= 'function addContentSimpleMDE(content) {
|
||||
var text = simplemde.value();
|
||||
simplemde.value(text + content + "\n");
|
||||
}'.PHP_EOL;
|
||||
|
||||
$html .= '$(document).ready(function() { '.PHP_EOL;
|
||||
$html .= 'var simplemde = new SimpleMDE({
|
||||
$html .= 'simplemde = new SimpleMDE({
|
||||
element: document.getElementById("jscontent"),
|
||||
status: false,
|
||||
toolbarTips: true,
|
||||
|
@ -95,13 +103,21 @@ class pluginsimpleMDE extends Plugin {
|
|||
toolbar: ['.Sanitize::htmlDecode($this->getDbField('toolbar')).']
|
||||
});';
|
||||
|
||||
/*
|
||||
$html .= '$("#jsaddImage").on("click", function() {
|
||||
var filename = $("#jsimageList option:selected" ).text();
|
||||
if(!filename.trim()) {
|
||||
|
||||
if(!imageFilename.trim()) {
|
||||
return false;
|
||||
}
|
||||
var text = simplemde.value();
|
||||
simplemde.value(text + "![alt text]("+filename+")" + "\n");
|
||||
simplemde.value(text + "![alt text]("+imageFilename+")" + "\n");
|
||||
});';
|
||||
*/
|
||||
|
||||
// This is the event for Bludit images
|
||||
$html .= '$("body").on("dblclick", "img.bludit-thumbnail", function() {
|
||||
var filename = $(this).data("filename");
|
||||
addContentSimpleMDE("![alt text]("+filename+")");
|
||||
});';
|
||||
|
||||
$html .= '}); </script>';
|
||||
|
|
Loading…
Reference in New Issue