Merge remote-tracking branch 'dignajar/master'

This commit is contained in:
Frédéric K 2016-01-04 10:33:45 +01:00
commit 83e442b305
58 changed files with 1443 additions and 302 deletions

View File

@ -24,6 +24,7 @@ define('PATH_CONTENT', PATH_ROOT.'content'.DS);
define('PATH_POSTS', PATH_CONTENT.'posts'.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_PAGES', PATH_CONTENT.'pages'.DS);
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
define('PATH_PLUGINS_DATABASES',PATH_CONTENT.'databases'.DS.'plugins'.DS);
@ -319,9 +320,9 @@ function install($adminPassword, $email, $timezoneOffset)
error_log($errorText, 0);
}
if(!mkdir(PATH_PLUGINS_DATABASES.'tinymce', $dirpermissions, true))
if(!mkdir(PATH_PLUGINS_DATABASES.'simplemde', $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'tinymce';
$errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'simplemde';
error_log($errorText, 0);
}
@ -343,6 +344,12 @@ function install($adminPassword, $email, $timezoneOffset)
error_log($errorText, 0);
}
if(!mkdir(PATH_UPLOADS_THUMBNAILS, $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_UPLOADS_THUMBNAILS;
error_log($errorText, 0);
}
// ============================================================================
// Create files
// ============================================================================
@ -484,14 +491,14 @@ function install($adminPassword, $email, $timezoneOffset)
LOCK_EX
);
// File plugins/tinymce/db.php
// File plugins/simplemde/db.php
file_put_contents(
PATH_PLUGINS_DATABASES.'tinymce'.DS.'db.php',
PATH_PLUGINS_DATABASES.'simplemde'.DS.'db.php',
$dataHead.json_encode(
array(
'position'=>0,
'plugins'=>'autoresize, fullscreen, pagebreak, link, textcolor, code',
'toolbar'=>'bold italic underline strikethrough | alignleft aligncenter alignright | bullist numlist | styleselect | link forecolor backcolor removeformat | pagebreak code fullscreen'
'tabSize'=>4,
'toolbar'=>'"bold", "italic", "heading", "|", "quote", "unordered-list", "|", "link", "image", "code", "horizontal-rule", "|", "preview", "side-by-side", "fullscreen", "guide"'
),
JSON_PRETTY_PRINT),
LOCK_EX

View File

@ -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');
}
}

View File

@ -85,11 +85,9 @@ if($Login->role()!=='admin') {
$layout['parameters'] = $Login->username();
}
$_user = $dbUsers->getDb($layout['parameters']);
$_User = $dbUsers->getUser($layout['parameters']);
// If the user doesn't exist, redirect to the users list.
if($_user===false) {
if($_User===false) {
Redirect::page('admin', 'users');
}
$_user['username'] = $layout['parameters'];

View File

@ -41,7 +41,8 @@ legend.first-child {
padding: 15px;
}
.uk-nav-navbar > li > a:hover {
.uk-nav-navbar > li > a:hover,
.uk-nav-navbar > li > a:focus {
background: #2672ec;
}
@ -87,6 +88,34 @@ 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 3px !important;
max-width: 30% !important;
padding: 0 !important;
}
.uk-progress-bar {
background: #2672ec !important;
}
.uk-placeholder {
margin-bottom: 0 !important;
}
/* ----------- BLUDIT ----------- */
#logo {
@ -143,6 +172,139 @@ button.delete-button:hover {
background: rgba(187, 48, 48, 0.91);
}
/* ----------- FORM ----------- */
.sidebar .uk-form-label {
font-size: 0.9em;
text-transform: uppercase;
}
/* ----------- BLUDIT IMAGES V8 ----------- */
#bludit-images-v8 {
}
#bludit-images-v8 .bludit-thumbnail {
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
display: inline-block;
height: auto;
margin: 2px;
padding: 0;
width: 15% !important;
}
#bludit-images-v8-upload {
width: 100%;
padding: 0;
margin-bottom: 15px !important;
}
#bludit-images-v8-drag-drop {
padding: 20px;
}
#bludit-images-v8-progressbar {
display: none;
margin: 20px;
}
#bludit-images-v8-thumbnails {
max-height: 350px;
overflow: auto;
font-size: 0;
}
/* ----------- 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-quick-images-thumbnails {
font-size: 0;
}
#bludit-quick-images .bludit-thumbnail {
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
display: inline-block;
height: auto;
margin: 2px;
padding: 0;
width: 31% !important;
}
/* ----------- 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;
left: 5%;
position: relative;
top: 33%;
width: 90%;
}
/* ----------- BLUDIT PROFILE PICTURE ----------- */
#bludit-profile-picture-drag-drop {
width: 100%;
padding: 15px 0;
}
#bludit-profile-picture-progressbar {
display: none;
margin: 15px 0 0;
width: 100%;
}
/* ----------- LOGIN FORM ----------- */
div.login-box > h1 {
@ -171,6 +333,11 @@ div.dashboard-links a {
color: #555;
}
/* NEW POST */
h3.titleOptions {
font-size: 1em;
}
/* ----------- PLUGIN LIST / THEME LIST ----------- */
div.plugin-links > a {

BIN
kernel/admin/themes/default/css/fonts/FontAwesome.otf Normal file → Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

2
kernel/admin/themes/default/css/uikit/form-file.almost-flat.min.css vendored Normal file → Executable file
View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-form-file{display:inline-block;vertical-align:middle;position:relative;overflow:hidden}.uk-form-file input[type=file]{position:absolute;top:0;z-index:1;width:100%;opacity:0;cursor:pointer;left:0;font-size:500px}

View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-placeholder{margin-bottom:15px;padding:15px;border:1px dashed #ddd;background:#fafafa;color:#444}*+.uk-placeholder{margin-top:15px}.uk-placeholder>:last-child{margin-bottom:0}.uk-placeholder-large{padding-top:80px;padding-bottom:80px}

2
kernel/admin/themes/default/css/uikit/progress.almost-flat.min.css vendored Normal file → Executable file
View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-progress{box-sizing:border-box;height:20px;margin-bottom:15px;background:#f5f5f5;overflow:hidden;line-height:20px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);border-radius:4px}*+.uk-progress{margin-top:15px}.uk-progress-bar{width:0;height:100%;background:#00a8e6;float:left;-webkit-transition:width .6s ease;transition:width .6s ease;font-size:12px;color:#fff;text-align:center;box-shadow:inset 0 0 5px rgba(0,0,0,.05);text-shadow:0 -1px 0 rgba(0,0,0,.1)}.uk-progress-mini{height:6px}.uk-progress-small{height:12px}.uk-progress-success .uk-progress-bar{background-color:#8cc14c}.uk-progress-warning .uk-progress-bar{background-color:#faa732}.uk-progress-danger .uk-progress-bar{background-color:#da314b}.uk-progress-striped .uk-progress-bar{background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:30px 30px}.uk-progress-striped.uk-active .uk-progress-bar{-webkit-animation:uk-progress-bar-stripes 2s linear infinite;animation:uk-progress-bar-stripes 2s linear infinite}@-webkit-keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}@keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}.uk-progress-mini,.uk-progress-small{border-radius:500px}

4
kernel/admin/themes/default/css/uikit/uikit.almost-flat.min.css vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

2
kernel/admin/themes/default/css/uikit/upload.almost-flat.min.css vendored Normal file → Executable file
View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-dragover{box-shadow:0 0 20px rgba(100,100,100,.3)}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -102,9 +102,9 @@ $(document).ready(function() {
<ul class="uk-navbar-nav">
<li class="uk-parent" data-uk-dropdown>
<?php
$profilePictureSrc = HTML_PATH_ADMIN_THEME_IMG.'default.jpg';
if(file_exists(PATH_UPLOADS_PROFILES.$Login->username().'.jpg')) {
$profilePictureSrc = HTML_PATH_UPLOADS_PROFILES.$Login->username().'.jpg';
$profilePictureSrc = HTML_PATH_ADMIN_THEME_IMG.'default.png';
if(file_exists(PATH_UPLOADS_PROFILES.$Login->username().'.png')) {
$profilePictureSrc = HTML_PATH_UPLOADS_PROFILES.$Login->username().'.png';
}
?>
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$Login->username() ?>">

View File

@ -128,70 +128,148 @@ class HTML {
$html = '';
}
public static function uploader()
public static function bluditQuickImages()
{
$html = '<!-- BLUDIT QUICK IMAGES -->';
$html .= '
<div id="bludit-quick-images">
<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" data-filename="'.$filename.'" src="'.HTML_PATH_UPLOADS_THUMBNAILS.$filename.'" alt="Thumbnail">';
}
$html .= '
</div>
';
if(empty($thumbnailList)) {
$html .= '<div class="empty-images uk-block uk-text-center uk-block-muted">There are no images, upload someone to make your site more cheerful.</div>';
}
$html .= '
<a data-uk-modal href="#bludit-images-v8" class="moreImages uk-button">More images</a>
</div>
';
$script = '
<script>
// Add thumbnail to Quick Images
function addQuickImages(filename)
{
var imageSrc = HTML_PATH_UPLOADS_THUMBNAILS + filename;
// Remove element if there are more than 6 thumbnails
if ($("#bludit-quick-images-thumbnails > img").length > 5) {
$("img:last-child", "#bludit-quick-images-thumbnails").remove();
}
// Add the new thumbnail to Quick images
$("#bludit-quick-images-thumbnails").prepend("<img class=\"bludit-thumbnail\" data-filename=\""+filename+"\" src=\""+imageSrc+"\" alt=\"Thumbnail\">");
}
</script>
';
echo $html.$script;
}
public static function bluditCoverImage($coverImage="")
{
global $L;
$html = '
<div id="upload-drop" class="uk-placeholder uk-text-center">
<i class="uk-icon-cloud-upload uk-icon-medium uk-text-muted uk-margin-small-right"></i>'.$L->g('Upload Image').'<br><a class="uk-form-file">'.$L->g('Drag and drop or click here').'<input id="upload-select" type="file"></a>
$style = '';
if(!empty($coverImage)) {
$style = 'background-image: url('.HTML_PATH_UPLOADS_THUMBNAILS.$coverImage.')';
}
$html = '<!-- BLUDIT COVER IMAGE -->';
$html .= '
<div id="bludit-cover-image">
<div id="cover-image-thumbnail" class="uk-form-file uk-placeholder uk-text-center" style="'.$style.'">
<input type="hidden" name="coverImage" id="cover-image-upload-filename" value="'.$coverImage.'">
<div id="cover-image-upload" '.( empty($coverImage)?'':'style="display: none;"' ).'>
<div><i class="uk-icon-picture-o"></i> '.$L->g('Cover image').'</div>
<div style="font-size:0.8em;">'.$L->g('Drag and drop or click here').'<input id="cover-image-file-select" type="file"></div>
</div>
<div id="progressbar" class="uk-progress uk-hidden">
<div id="cover-image-delete" '.( empty($coverImage)?'':'style="display: block;"' ).'>
<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>
';
$html .= '<select id="jsimageList" class="uk-width-1-1" size="10">';
$imagesList = Filesystem::listFiles(PATH_UPLOADS,'*','*',true);
foreach($imagesList as $file) {
$html .= '<option value="">'.basename($file).'</option>';
}
$html .= '</select>';
</div>
</div>
';
$html .= '
<div class="uk-form-row uk-margin-top">
<button id="jsaddImage" class="uk-button uk-button-primary" type="button"><i class="uk-icon-angle-double-left"></i> '.$L->g('Insert Image').'</button>
</div>
';
$script = '
<script>
$html .= '
<script>
$(document).ready(function() {
function addCoverImage(filename)
{
var imageSrc = HTML_PATH_UPLOADS_THUMBNAILS + filename;
$("#jsaddImage").on("click", function() {
var filename = $("#jsimageList option:selected").text();
if(!filename.trim()) {
return false;
}
var textareaValue = $("#jscontent").val();
$("#jscontent").val(textareaValue + "<img src=\""+filename+"\" alt=\"\">" + "\n");
// Cover image background
$("#cover-image-thumbnail").attr("style","background-image: url("+imageSrc+")");
// Form attribute
$("#cover-image-upload-filename").attr("value", filename);
}
$(document).ready(function() {
$("#cover-image-delete").on("click", function() {
$("#cover-image-thumbnail").attr("style","");
$("#cover-image-upload-filename").attr("value","");
$("#cover-image-delete").hide();
$("#cover-image-upload").show();
});
$(function()
{
var progressbar = $("#progressbar");
var bar = progressbar.find(".uk-progress-bar");
var settings =
{
type: "json",
action: "'.HTML_PATH_ADMIN_ROOT.'ajax/uploader",
action: HTML_PATH_ADMIN_ROOT+"ajax/uploader",
allow : "*.(jpg|jpeg|gif|png)",
params: {"type":"cover-image"},
loadstart: function() {
bar.css("width", "0%").text("0%");
progressbar.removeClass("uk-hidden");
$("#cover-image-progressbar").find(".uk-progress-bar").css("width", "0%").text("0%");
$("#cover-image-progressbar").show();
$("#cover-image-delete").hide();
$("#cover-image-upload").hide();
},
progress: function(percent) {
percent = Math.ceil(percent);
bar.css("width", percent+"%").text(percent+"%");
$("#cover-image-progressbar").find(".uk-progress-bar").css("width", percent+"%").text(percent+"%");
},
allcomplete: function(response) {
bar.css("width", "100%").text("100%");
setTimeout(function() { progressbar.addClass("uk-hidden"); }, 250);
$("#jsimageList").prepend("<option value=\'"+response.filename+"\' selected=\'selected\'>"+response.filename+"</option>");
$("#cover-image-progressbar").find(".uk-progress-bar").css("width", "100%").text("100%");
$("#cover-image-progressbar").hide();
$("#cover-image-delete").show();
$(".empty-images").hide();
// Add Cover Image
addCoverImage(response.filename);
// Add thumbnail to Quick Images
addQuickImages(response.filename);
// Add thumbnail to Bludit Images V8
addBluditImagev8(response.filename);
},
notallowed: function(file, settings) {
@ -199,59 +277,197 @@ class HTML {
}
};
var select = UIkit.uploadSelect($("#upload-select"), settings);
var drop = UIkit.uploadDrop($("#upload-drop"), settings);
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 style="font-size:0.8em;">'.$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" src="'.HTML_PATH_UPLOADS_THUMBNAILS.$filename.'" data-filename="'.$filename.'" alt="Thumbnail">';
}
$html .= '
</div>
';
if(empty($thumbnailList)) {
$html .= '<div class="empty-images uk-block uk-text-center uk-block-muted">There are no images, upload someone to make your site more cheerful.</div>';
}
$html .= '
<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>
// Add thumbnail to Bludit Images v8
function addBluditImagev8(filename)
{
var imageSrc = HTML_PATH_UPLOADS_THUMBNAILS + filename;
// Add the new thumbnail to Bludit Images v8
$("#bludit-images-v8-thumbnails").prepend("<img class=\"bludit-thumbnail\" data-filename=\""+filename+"\" src=\""+imageSrc+"\" alt=\"Thumbnail\">");
}
$(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();
}
});
</script>';
echo $html;
// 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%");
$("#bludit-images-v8-drag-drop").hide();
$("#bludit-images-v8-progressbar").show();
},
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();
$("#bludit-images-v8-drag-drop").show();
$(".empty-images").hide();
// Add thumbnail to Bludit Images V8
addBluditImagev8(response.filename);
// Add thumbnail to Quick Images
addQuickImages(response.filename);
},
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 profileUploader($username)
{
global $L;
$html = '
<div id="jsprogressBar" class="uk-progress uk-hidden">
$html = '<!-- BLUDIT PROFILE UPLOADER -->';
$html .= '
<div id="bludit-profile-picture">
<div id="bludit-profile-picture-image">';
if(file_exists(PATH_UPLOADS_PROFILES.$username.'.png')) {
$html .= '<img class="uk-border-rounded" src="'.HTML_PATH_UPLOADS_PROFILES.$username.'.png" alt="Profile picture">';
}
else {
$html .= '<div class="uk-block uk-border-rounded uk-block-muted uk-block-large">'.$L->g('Profile picture').'</div>';
}
$html .= '
</div>
<div id="bludit-profile-picture-progressbar" class="uk-progress">
<div class="uk-progress-bar" style="width: 0%;">0%</div>
</div>
<div id="upload-drop" class="uk-placeholder uk-text-center">
<i class="uk-icon-cloud-upload uk-margin-small-right"></i>'.$L->g('Upload Image').'<br><a class="uk-form-file">'.$L->g('Drag and drop or click here').'<input id="upload-select" type="file"></a>
<div id="bludit-profile-picture-drag-drop" class="uk-form-file uk-placeholder uk-text-center">
<div>'.$L->g('Upload image').'</div>
<div style="font-size:0.8em;">'.$L->g('Drag and drop or click here').'<input id="bludit-profile-picture-file-select" type="file"></div>
</div>
';
$html .= '
<script>
$(document).ready(function() {
</div>
';
$script = '
<script>
$(document).ready(function() {
$(function()
{
var progressbar = $("#jsprogressBar");
var bar = progressbar.find(".uk-progress-bar");
var settings =
{
type: "json",
action: "'.HTML_PATH_ADMIN_ROOT.'ajax/uploader",
action: HTML_PATH_ADMIN_ROOT+"ajax/uploader",
allow : "*.(jpg|jpeg|gif|png)",
params: {"type":"profilePicture", "username":"'.$username.'"},
loadstart: function() {
bar.css("width", "0%").text("0%");
progressbar.removeClass("uk-hidden");
$("#bludit-profile-picture-progressbar").find(".uk-progress-bar").css("width", "0%").text("0%");
$("#bludit-profile-picture-progressbar").show();
},
progress: function(percent) {
percent = Math.ceil(percent);
bar.css("width", percent+"%").text(percent+"%");
$("#bludit-profile-picture-progressbar").find(".uk-progress-bar").css("width", percent+"%").text(percent+"%");
},
allcomplete: function(response) {
bar.css("width", "100%").text("100%");
progressbar.addClass("uk-hidden");
$("#jsprofilePicture").html("<img class=\"uk-border-rounded\" src=\"'.HTML_PATH_UPLOADS_PROFILES.$username.'.jpg\">");
$("#bludit-profile-picture-progressbar").find(".uk-progress-bar").css("width", "100%").text("100%");
$("#bludit-profile-picture-progressbar").hide();
$("#bludit-profile-picture-image").html("<img class=\"uk-border-rounded\" src=\"'.HTML_PATH_UPLOADS_PROFILES.$username.'.png?time='.time().'\">");
},
notallowed: function(file, settings) {
@ -259,14 +475,14 @@ class HTML {
}
};
var select = UIkit.uploadSelect($("#upload-select"), settings);
var drop = UIkit.uploadDrop($("#upload-drop"), settings);
});
UIkit.uploadSelect($("#bludit-profile-picture-file-select"), settings);
UIkit.uploadDrop($("#bludit-profile-picture-drag-drop"), settings);
});
</script>';
});
</script>
';
echo $html;
echo $html.$script;
}
}

6
kernel/admin/themes/default/js/uikit/uikit.min.js vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

2
kernel/admin/themes/default/js/uikit/upload.min.js vendored Normal file → Executable file
View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
!function(e){var t;window.UIkit&&(t=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-upload",["uikit"],function(){return t||e(UIkit)})}(function(e){"use strict";function t(o,a){function r(t,n){var o=new FormData,a=new XMLHttpRequest;if(n.before(n,t)!==!1){for(var r,i=0;r=t[i];i++)o.append(n.param,r);for(var l in n.params)o.append(l,n.params[l]);a.upload.addEventListener("progress",function(e){var t=e.loaded/e.total*100;n.progress(t,e)},!1),a.addEventListener("loadstart",function(e){n.loadstart(e)},!1),a.addEventListener("load",function(e){n.load(e)},!1),a.addEventListener("loadend",function(e){n.loadend(e)},!1),a.addEventListener("error",function(e){n.error(e)},!1),a.addEventListener("abort",function(e){n.abort(e)},!1),a.open(n.method,n.action,!0),"json"==n.type&&a.setRequestHeader("Accept","application/json"),a.onreadystatechange=function(){if(n.readystatechange(a),4==a.readyState){var t=a.responseText;if("json"==n.type)try{t=e.$.parseJSON(t)}catch(o){t=!1}n.complete(t,a)}},n.beforeSend(a),a.send(o)}}if(!e.support.ajaxupload)return this;if(a=e.$.extend({},t.defaults,a),o.length){if("*.*"!==a.allow)for(var i,l=0;i=o[l];l++)if(!n(a.allow,i.name))return"string"==typeof a.notallowed?alert(a.notallowed):a.notallowed(i,a),void 0;var s=a.complete;if(a.single){var d=o.length,f=0,p=!0;a.beforeAll(o),a.complete=function(e,t){f+=1,s(e,t),a.filelimit&&f>=a.filelimit&&(p=!1),p&&d>f?r([o[f]],a):a.allcomplete(e,t)},r([o[0]],a)}else a.complete=function(e,t){s(e,t),a.allcomplete(e,t)},r(o,a)}}function n(e,t){var n="^"+e.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")+"$";return n="^"+n+"$",null!==t.match(new RegExp(n,"i"))}return e.component("uploadSelect",{init:function(){var e=this;this.on("change",function(){t(e.element[0].files,e.options);var n=e.element.clone(!0).data("uploadSelect",e);e.element.replaceWith(n),e.element=n})}}),e.component("uploadDrop",{defaults:{dragoverClass:"uk-dragover"},init:function(){var e=this,n=!1;this.on("drop",function(n){n.dataTransfer&&n.dataTransfer.files&&(n.stopPropagation(),n.preventDefault(),e.element.removeClass(e.options.dragoverClass),e.element.trigger("dropped.uk.upload",[n.dataTransfer.files]),t(n.dataTransfer.files,e.options))}).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}).on("dragover",function(t){t.stopPropagation(),t.preventDefault(),n||(e.element.addClass(e.options.dragoverClass),n=!0)}).on("dragleave",function(t){t.stopPropagation(),t.preventDefault(),e.element.removeClass(e.options.dragoverClass),n=!1})}}),e.support.ajaxupload=function(){function e(){var e=document.createElement("INPUT");return e.type="file","files"in e}function t(){var e=new XMLHttpRequest;return!!(e&&"upload"in e&&"onprogress"in e.upload)}function n(){return!!window.FormData}return e()&&t()&&n()}(),e.support.ajaxupload&&e.$.event.props.push("dataTransfer"),t.defaults={action:"",single:!0,method:"POST",param:"files[]",params:{},allow:"*.*",type:"text",filelimit:!1,before:function(){},beforeSend:function(){},beforeAll:function(){},loadstart:function(){},load:function(){},loadend:function(){},error:function(){},abort:function(){},progress:function(){},complete:function(){},allcomplete:function(){},readystatechange:function(){},notallowed:function(e,t){alert("Only the following file types are allowed: "+t.allow)}},e.Utils.xhrupload=t,t});

View File

@ -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,13 +90,32 @@ echo '<div class="uk-width-large-3-10">';
// ---- IMAGES TAB ----
echo '<li>';
HTML::uploader();
// --- BLUDIT COVER IMAGE ---
echo '<hr>';
HTML::bluditCoverImage($_Page->coverImage(false));
echo '<hr>';
// --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages();
// --- BLUDIT IMAGES V8 ---
HTML::bluditImagesV8();
echo '</li>';
// ---- ADVANCED TAB ----
echo '<li>';
// Status input
HTML::formSelect(array(
'name'=>'status',
'label'=>$L->g('Status'),
'class'=>'uk-width-1-1 uk-form-medium',
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
'selected'=>($_Page->draft()?'draft':'published'),
'tip'=>''
));
// If the page is parent then doesn't can have a parent.
if(count($_Page->children())===0)
{
@ -116,16 +135,6 @@ if(count($_Page->children())===0)
));
}
// Status input
HTML::formSelect(array(
'name'=>'status',
'label'=>$L->g('Status'),
'class'=>'uk-width-1-1 uk-form-medium',
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
'selected'=>($_Page->draft()?'draft':'published'),
'tip'=>''
));
// Position input
HTML::formInputText(array(
'name'=>'position',

View File

@ -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,22 +84,22 @@ echo '<div class="uk-width-large-3-10">';
// ---- IMAGES TAB ----
echo '<li>';
HTML::uploader();
// --- BLUDIT COVER IMAGE ---
echo '<hr>';
HTML::bluditCoverImage($_Post->coverImage(false));
echo '<hr>';
// --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages();
// --- BLUDIT IMAGES V8 ---
HTML::bluditImagesV8();
echo '</li>';
// ---- ADVANCED TAB ----
echo '<li>';
// Date input
HTML::formInputText(array(
'name'=>'date',
'value'=>$_Post->dateRaw(),
'class'=>'uk-width-1-1 uk-form-large',
'tip'=>$L->g('To schedule the post just select the date and time'),
'label'=>$L->g('Date')
));
// Status input
HTML::formSelect(array(
'name'=>'status',
@ -110,6 +110,15 @@ echo '<div class="uk-width-large-3-10">';
'tip'=>''
));
// Date input
HTML::formInputText(array(
'name'=>'date',
'value'=>$_Post->dateRaw(),
'class'=>'uk-width-1-1 uk-form-large',
'tip'=>$L->g('To schedule the post just select the date and time'),
'label'=>$L->g('Date')
));
// Slug input
HTML::formInputText(array(
'name'=>'slug',

View File

@ -16,7 +16,7 @@ HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal
// Security token
HTML::formInputHidden(array(
'name'=>'username',
'value'=>$_user['username']
'value'=>$_User->username()
));
HTML::legend(array('value'=>$L->g('Profile'), 'class'=>'first-child'));
@ -24,7 +24,7 @@ HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal
HTML::formInputText(array(
'name'=>'usernameDisable',
'label'=>$L->g('Username'),
'value'=>$_user['username'],
'value'=>$_User->username(),
'class'=>'uk-width-1-2 uk-form-medium',
'disabled'=>true,
'tip'=>''
@ -33,7 +33,7 @@ HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal
HTML::formInputText(array(
'name'=>'firstName',
'label'=>$L->g('First name'),
'value'=>$_user['firstName'],
'value'=>$_User->firstName(),
'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>''
));
@ -41,7 +41,7 @@ HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal
HTML::formInputText(array(
'name'=>'lastName',
'label'=>$L->g('Last name'),
'value'=>$_user['lastName'],
'value'=>$_User->lastName(),
'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>''
));
@ -49,7 +49,7 @@ HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal
echo '<div class="uk-form-row">
<label class="uk-form-label">Password</label>
<div class="uk-form-controls">
<a href="'.HTML_PATH_ADMIN_ROOT.'user-password/'.$_user['username'].'">'.$L->g('Change password').'</a>
<a href="'.HTML_PATH_ADMIN_ROOT.'user-password/'.$_User->username().'">'.$L->g('Change password').'</a>
</div>
</div>';
@ -59,20 +59,53 @@ if($Login->role()==='admin') {
'name'=>'role',
'label'=>$L->g('Role'),
'options'=>array('editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')),
'selected'=>$_user['role'],
'selected'=>$_User->role(),
'tip'=>''
));
}
HTML::formInputText(array(
'name'=>'email',
'label'=>$L->g('Email'),
'value'=>$_user['email'],
'value'=>$_User->email(),
'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>$L->g('email-will-not-be-publicly-displayed')
));
HTML::legend(array('value'=>'Social networks'));
HTML::formInputText(array(
'name'=>'twitterUsername',
'label'=>'Twitter username',
'value'=>$_User->twitterUsername(),
'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>''
));
HTML::formInputText(array(
'name'=>'facebookUsername',
'label'=>'Facebook username',
'value'=>$_User->facebookUsername(),
'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>''
));
HTML::formInputText(array(
'name'=>'googleUsername',
'label'=>'Google username',
'value'=>$_User->googleUsername(),
'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>''
));
HTML::formInputText(array(
'name'=>'instagramUsername',
'label'=>'Instagram username',
'value'=>$_User->instagramUsername(),
'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>
@ -80,7 +113,7 @@ if($Login->role()==='admin') {
</div>
</div>';
if( ($Login->role()==='admin') && ($_user['username']!='admin') ) {
if( ($Login->role()==='admin') && ($_User->username()!='admin') ) {
HTML::legend(array('value'=>$L->g('Delete')));
@ -96,18 +129,10 @@ if( ($Login->role()==='admin') && ($_user['username']!='admin') ) {
HTML::formClose();
echo '</div>';
echo '<div class="uk-width-3-10" style="margin-top: 50px; text-align: center;">';
echo '<div id="jsprofilePicture">';
if(file_exists(PATH_UPLOADS_PROFILES.$_user['username'].'.jpg')) {
echo '<img class="uk-border-rounded" src="'.HTML_PATH_UPLOADS_PROFILES.$_user['username'].'.jpg" alt="">';
}
else {
echo '<div class="uk-block uk-border-rounded uk-block-muted uk-block-large">'.$L->g('Profile picture').'</div>';
}
echo '</div>';
HTML::profileUploader($_user['username']);
HTML::profileUploader($_User->username());
echo '</div>';
echo '</div>';

View File

@ -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,13 +77,32 @@ echo '<div class="uk-width-large-3-10">';
// ---- IMAGES TAB ----
echo '<li>';
HTML::uploader();
// --- BLUDIT COVER IMAGE ---
echo '<hr>';
HTML::bluditCoverImage();
echo '<hr>';
// --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages();
// --- BLUDIT IMAGES V8 ---
HTML::bluditImagesV8();
echo '</li>';
// ---- ADVANCED TAB ----
echo '<li>';
// Status input
HTML::formSelect(array(
'name'=>'status',
'label'=>$L->g('Status'),
'class'=>'uk-width-1-1 uk-form-medium',
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
'selected'=>'published',
'tip'=>''
));
// Parent input
$options = array();
$options[NO_PARENT_CHAR] = '('.$Language->g('No parent').')';
@ -98,16 +117,6 @@ echo '<div class="uk-width-large-3-10">';
'tip'=>''
));
// Status input
HTML::formSelect(array(
'name'=>'status',
'label'=>$L->g('Status'),
'class'=>'uk-width-1-1 uk-form-medium',
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
'selected'=>'published',
'tip'=>''
));
// Position input
HTML::formInputText(array(
'name'=>'position',

View File

@ -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,22 +77,22 @@ echo '<div class="uk-width-large-3-10">';
// ---- IMAGES TAB ----
echo '<li>';
HTML::uploader();
// --- BLUDIT COVER IMAGE ---
echo '<hr>';
HTML::bluditCoverImage();
echo '<hr>';
// --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages();
// --- BLUDIT IMAGES V8 ---
HTML::bluditImagesV8();
echo '</li>';
// ---- ADVANCED TAB ----
echo '<li>';
// Date input
HTML::formInputText(array(
'name'=>'date',
'value'=>Date::current(DB_DATE_FORMAT),
'class'=>'uk-width-1-1 uk-form-large',
'tip'=>$L->g('To schedule the post just select the date and time'),
'label'=>$L->g('Date')
));
// Status input
HTML::formSelect(array(
'name'=>'status',
@ -103,6 +103,15 @@ echo '<div class="uk-width-large-3-10">';
'tip'=>''
));
// Date input
HTML::formInputText(array(
'name'=>'date',
'value'=>Date::current(DB_DATE_FORMAT),
'class'=>'uk-width-1-1 uk-form-large',
'tip'=>$L->g('To schedule the post just select the date and time'),
'label'=>$L->g('Date')
));
// Slug input
HTML::formInputText(array(
'name'=>'slug',

View File

@ -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';
$tmpName = $username.'.png';
$Image = new Image();
$Image->setImage(PATH_UPLOADS_PROFILES.'tmp'.'.'.$fileExtension, '200', '200', 'crop');
$Image->saveImage(PATH_UPLOADS_PROFILES.$tmpName, 100, true);
// Remove tmp file
unlink(PATH_UPLOADS_PROFILES.'tmp'.'.'.$fileExtension);
$Image->setImage(PATH_TMP.'original'.'.'.$fileExtension, '400', '400', 'crop');
$Image->saveImage(PATH_UPLOADS_PROFILES.$tmpName, 100, false, true);
}
// --- 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(

View File

@ -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'));
@ -115,12 +123,14 @@ include(PATH_KERNEL.'dblanguage.class.php');
include(PATH_KERNEL.'dbsite.class.php');
include(PATH_KERNEL.'post.class.php');
include(PATH_KERNEL.'page.class.php');
include(PATH_KERNEL.'user.class.php');
include(PATH_KERNEL.'url.class.php');
include(PATH_KERNEL.'login.class.php');
include(PATH_KERNEL.'parsedown.class.php');
include(PATH_KERNEL.'parsedownextra.class.php');
include(PATH_KERNEL.'security.class.php');
// Include Helpers Classes
include(PATH_HELPERS.'text.class.php');
include(PATH_HELPERS.'log.class.php');
@ -193,6 +203,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');

View File

@ -66,14 +66,9 @@ function build_page($key)
$pageDateFormated = $Page->dateRaw( $Site->dateFormat() );
$Page->setField('date', $pageDateFormated, true);
// Parse username for the page.
if( $dbUsers->userExists( $Page->username() ) )
{
$user = $dbUsers->getDb( $Page->username() );
$Page->setField('authorFirstName', $user['firstName'], false);
$Page->setField('authorLastName', $user['lastName'], false);
}
// User object
$username = $Page->username();
$Page->setField('user', $dbUsers->getUser($username));
return $Page;
}

View File

@ -75,14 +75,9 @@ function buildPost($key)
$postDateFormated = $Post->dateRaw( $Site->dateFormat() );
$Post->setField('date', $postDateFormated, true);
// Parse username for the post.
if( $dbUsers->userExists( $Post->username() ) )
{
$user = $dbUsers->getDb( $Post->username() );
$Post->setField('authorFirstName', $user['firstName'], false);
$Post->setField('authorLastName', $user['lastName'], false);
}
// User object
$username = $Post->username();
$Post->setField('user', $dbUsers->getUser($username));
return $Post;
}

View File

@ -12,7 +12,8 @@ class dbPages extends dbJSON
'tags'=> array('inFile'=>false, 'value'=>array()),
'status'=> array('inFile'=>false, 'value'=>'draft'),
'date'=> array('inFile'=>false, 'value'=>''),
'position'=> array('inFile'=>false, 'value'=>0)
'position'=> array('inFile'=>false, 'value'=>0),
'coverImage'=> array('inFile'=>false, 'value'=>''),
);
function __construct()

View File

@ -10,7 +10,8 @@ class dbPosts extends dbJSON
'status'=> array('inFile'=>false, 'value'=>'draft'), // published, draft, scheduled
'tags'=> array('inFile'=>false, 'value'=>array()),
'allowComments'=> array('inFile'=>false, 'value'=>false),
'date'=> array('inFile'=>false, 'value'=>'')
'date'=> array('inFile'=>false, 'value'=>''),
'coverImage'=> array('inFile'=>false, 'value'=>''),
);
private $numberPosts = array(

View File

@ -18,6 +18,16 @@ class dbTags extends dbJSON
parent::__construct(PATH_DATABASES.'tags.php');
}
// Returns an array with all tags names
public function getAll()
{
$tmp = array();
foreach($this->db['postsIndex'] as $tagSlug=>$tagInfo) {
$tmp[$tagSlug] = $tagInfo['name'];
}
return $tmp;
}
// Returns an array with a list of posts keys, filtered by a page number and a tag key.
public function getList($pageNumber, $postPerPage, $tagKey)
{

View File

@ -24,6 +24,24 @@ class dbUsers extends dbJSON
parent::__construct(PATH_DATABASES.'users.php');
}
public function getUser($username)
{
$User = new User();
if($this->userExists($username))
{
$User->setField('username', $username);
foreach($this->db[$username] as $key=>$value) {
$User->setField($key, $value);
}
return $User;
}
return false;
}
public function getAll()
{
return $this->db;

View File

@ -19,7 +19,7 @@ class Image {
$this->resizeImage($newWidth, $newHeight, $option);
}
public function saveImage($savePath, $imageQuality="100", $forceJPG=false)
public function saveImage($savePath, $imageQuality="100", $forceJPG=false, $forcePNG=false)
{
$extension = strtolower(pathinfo($savePath, PATHINFO_EXTENSION));
@ -28,21 +28,25 @@ class Image {
$path_complete = $filename.'.'.$extension;
if($forceJPG) {
imagejpeg($this->imageResized, $filename.'.jpg', $imageQuality);
if($forcePNG) {
$extension = 'png';
}
else
{
elseif($forceJPG) {
$extension = 'jpg';
}
switch($extension)
{
case 'jpg':
case 'jpeg':
// Checking for JPG support
if (imagetypes() & IMG_JPG) {
imagejpeg($this->imageResized, $path_complete, $imageQuality);
}
break;
case 'gif':
// Checking for GIF support
if (imagetypes() & IMG_GIF) {
imagegif($this->imageResized, $path_complete);
}
@ -55,16 +59,16 @@ class Image {
// *** Invert quality setting as 0 is best, not 9
$invertScaleQuality = 9 - $scaleQuality;
// Checking for PNG support
if (imagetypes() & IMG_PNG) {
imagepng($this->imageResized, $path_complete, $invertScaleQuality);
}
break;
default:
// *** No extension - No save.
// Fail extension detection
break;
}
}
imagedestroy($this->imageResized);
}

View File

@ -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>';

View File

@ -111,6 +111,17 @@ class Page extends fileContent
return $this->getField('key');
}
public function coverImage($absolute=true)
{
$fileName = $this->getField('coverImage');
if($absolute) {
return HTML_PATH_UPLOADS.$fileName;
}
return $fileName;
}
// Returns TRUE if the page is published, FALSE otherwise.
public function published()
{
@ -187,16 +198,32 @@ class Page extends fileContent
return $tmp;
}
// Returns the user object if $field is false, otherwise returns the field's value.
public function user($field=false)
{
// Get the user object.
$User = $this->getField('user');
if($field) {
return $User->getField($field);
}
return $User;
}
// DEPRECATED
public function username()
{
return $this->getField('username');
}
// DEPRECATED
public function authorFirstName()
{
return $this->getField('authorFirstName');
}
// DEPRECATED
public function authorLastName()
{
return $this->getField('authorLastName');

View File

@ -78,9 +78,15 @@ class Post extends fileContent
return ($this->getField('status')=='draft');
}
public function username()
public function coverImage($absolute=true)
{
return $this->getField('username');
$fileName = $this->getField('coverImage');
if($absolute) {
return HTML_PATH_UPLOADS.$fileName;
}
return $fileName;
}
public function profilePicture()
@ -88,11 +94,32 @@ class Post extends fileContent
return HTML_PATH_UPLOADS_PROFILES.$this->username().'.jpg';
}
// Returns the user object if $field is false, otherwise returns the field's value.
public function user($field=false)
{
// Get the user object.
$User = $this->getField('user');
if($field) {
return $User->getField($field);
}
return $User;
}
// DEPRECATED
public function username()
{
return $this->getField('username');
}
// DEPRECATED
public function authorFirstName()
{
return $this->getField('authorFirstName');
}
// DEPRECATED
public function authorLastName()
{
return $this->getField('authorLastName');

95
kernel/user.class.php Normal file
View File

@ -0,0 +1,95 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
class User
{
public $db;
public function setField($field, $value)
{
$this->db[$field] = $value;
return true;
}
public function getField($field)
{
if(isset($this->db[$field])) {
return $this->db[$field];
}
return false;
}
// Returns username
public function username()
{
return $this->getField('username');
}
public function firstName()
{
return $this->getField('firstName');
}
public function lastName()
{
return $this->getField('lastName');
}
public function role()
{
return $this->getField('role');
}
public function password()
{
return $this->getField('password');
}
public function salt()
{
return $this->getField('salt');
}
public function email()
{
return $this->getField('email');
}
public function registered()
{
return $this->getField('registered');
}
public function twitterUsername()
{
return $this->getField('twitterUsername');
}
public function facebookUsername()
{
return $this->getField('facebookUsername');
}
public function googleUsername()
{
return $this->getField('googleUsername');
}
public function instagramUsername()
{
return $this->getField('instagramUsername');
}
public function profilePicture($absolute=true)
{
$filename = $this->getField('username').'.png';
if($absolute) {
return HTML_PATH_UPLOADS_PROFILES.$filename;
}
return $filename;
}
}

View File

@ -77,7 +77,7 @@
"published-date": "Дата на побликуване",
"modified-date": "Промяна на дата",
"empty-title": "Без заглавие",
"plugins": "Плъгини",
"plugins": "Компоненти",
"install-plugin": "Добави",
"uninstall-plugin": "Премахни",
"new-password": "Нова парола",
@ -164,7 +164,7 @@
"scheduled": "Планирано",
"publish": "Публикувай",
"please-check-your-theme-configuration": "Моля, проверете конфигурацията на вашата тема.",
"plugin-label": "Заглавие плъгин",
"plugin-label": "Заглавие на компонент",
"enabled": "Разреши",
"disabled": "Забрани",
"cli-mode": "Режим CLI",

219
languages/de_CH.json Normal file
View File

@ -0,0 +1,219 @@
{
"language-data":
{
"native": "Deutsch (Schweiz)",
"english-name": "German",
"last-update": "2015-12-15",
"author": "Clickwork",
"email": "egoetschel@clickwork.ch",
"website": "https://www.clickwork.ch"
},
"username": "Benutzername",
"password": "Passwort",
"confirm-password": "Passwort wiederholen",
"editor": "Editor",
"dashboard": "Dashboard",
"role": "Rolle",
"post": "Beitrag",
"posts": "Beiträge",
"users": "Benutzer",
"administrator": "Administrator",
"add": "Hinzufügen",
"cancel": "Abbrechen",
"content": "Inhalt",
"title": "Titel",
"no-parent": "Keine übergeordnete Seite",
"edit-page": "Seite bearbeiten",
"edit-post": "Beitrag bearbeiten",
"add-a-new-user": "Neuer Benutzer",
"parent": "Übergeordnete Seite",
"friendly-url": "Pretty URL",
"description": "Beschreibung",
"posted-by": "Veröffentlicht von",
"tags": "Schlagwörter",
"position": "Position",
"save": "Speichern",
"draft": "Entwurf",
"delete": "Löschen",
"registered": "Hinzugefügt",
"Notifications": "Benachrichtigungen",
"profile": "Profil",
"email": "E-Mail",
"settings": "Einstellungen",
"general": "Allgemein",
"advanced": "Erweitert",
"regional": "Lokalisierung",
"about": "Über",
"login": "Anmelden",
"logout": "Abmelden",
"manage": "Verwaltung",
"themes": "Themes",
"prev-page": "Vorhergehende Seite",
"next-page": "Nächste Seite",
"configure-plugin": "Plugin konfigurieren",
"confirm-delete-this-action-cannot-be-undone": "Bestätige das Löschen, dieser Vorgang kann nicht rückgängig gemacht werden.",
"site-title": "Titel der Webseite",
"site-slogan": "Untertitel",
"site-description": "Informationen zur Website",
"footer-text": "Footer-Text",
"posts-per-page": "Beiträge pro Seite",
"site-url": "URL der Website",
"writting-settings": "Beitrags- und Seiteneinstellungen",
"url-filters": "URL-Erweiterungen",
"page": "Seite",
"pages": "Seiten",
"home": "Hauptseite",
"welcome-back": "Willkommen",
"language": "Sprache",
"website": "Zur Website",
"timezone": "Zeitzone",
"locale": "Lokalisierung",
"new-post": "Neuer Beitrag",
"html-and-markdown-code-supported": "HTML und Markdown werden unterstützt",
"new-page": "Neue Seite",
"manage-posts": "Beiträge verwalten",
"published-date": "Veröffentlicht",
"modified-date": "Letzte Änderung",
"empty-title": "Kein Titel",
"plugins": "Plugins",
"install-plugin": "Plugin aktivieren",
"uninstall-plugin": "Plugin deaktivieren",
"new-password": "Neues Passwort",
"edit-user": "Benutzer bearbeiten",
"publish-now": "Veröffentlichen",
"first-name": "Vorname",
"last-name": "Nachname",
"bludit-version": "Bludit Version",
"powered-by": "Diese Website wurde eingerichtet mit",
"recent-posts": "Neueste Beiträge",
"manage-pages": "Seiten verwalten",
"advanced-options": "Erweiterte Einstellungen",
"user-deleted": "Der Benutzer wurde gelöscht.",
"page-added-successfully": "Die Seite wurde veröffentlicht.",
"post-added-successfully": "Der Beitrag wurde veröffentlicht.",
"the-post-has-been-deleted-successfully": "Der Beitrag wurde gelöscht.",
"the-page-has-been-deleted-successfully": "Die Seite wurde gelöscht.",
"username-or-password-incorrect": "Der Benutzername oder das Passwort stimmt nicht.",
"database-regenerated": "Die Datenbank wurde neu aufgebaut.",
"the-changes-have-been-saved": "Die Änderungen wurden gespeichert.",
"enable-more-features-at": "Zusätzlich Felder können aktiviert werden unter",
"username-already-exists": "Diesen Benutzernamen gibt es bereits.",
"username-field-is-empty": "Es muss ein Benutzername eingegeben werden.",
"the-password-and-confirmation-password-do-not-match":"Die eingegebenen Passwörter stimmen nicht überein.",
"user-has-been-added-successfully": "Der Benutzer wurde hinzugefügt.",
"you-do-not-have-sufficient-permissions": "Du bist nicht berechtigt, die Seite aufzurufen.",
"settings-advanced-writting-settings": "Einstellungen > Erweitert > Beitrags- und Seiteneinstellungen",
"new-posts-and-pages-synchronized": "Neue Beiträge und Seiten wurden synchronisiert.",
"you-can-choose-the-users-privilege": "Rechte des Benutzers. Ein Editor kann nur Seiten anlegen und Beiträge schreiben.",
"email-will-not-be-publicly-displayed": "Die E-Mail wird nicht öffentlich gezeigt. Sie wird für die Wiederherstellung des Passworts und Benachrichtigungen verwendet.",
"use-this-field-to-name-your-site": "Name der Website, wie er auf jeder Seite angezeigt wird.",
"use-this-field-to-add-a-catchy-phrase": "Untertitel oder Slogan der Website.",
"you-can-add-a-site-description-to-provide": "Kurze Beschreibung der Website für Suchmaschinen.",
"you-can-add-a-small-text-on-the-bottom": "Text im Fussbereich jeder Seite. Beispielsweise: Copyright-Hinweis, Eigentümer der Website usw.",
"number-of-posts-to-show-per-page": "Anzahl der Beiträge, die auf einer Seite gezeigt werden.",
"the-url-of-your-site": "URL der Website.",
"add-or-edit-description-tags-or": "Beschreibungen, Schlagwörter und Pretty URL hinzufügen oder ändern.",
"select-your-sites-language": "Sprache der Website.",
"select-a-timezone-for-a-correct": "Zeitzone für die richtige Anzeige des Datums und der Zeit auf der Website.",
"you-can-use-this-field-to-define-a-set-of": "Parameter mit Bezug auf die verwendete Sprache und das Land. Beispielsweise: de_DE, de_CH usw.",
"you-can-modify-the-url-which-identifies":"Der URL kann selbst angepasst werden. Möglich sind bis zu 150 Zeichen.",
"this-field-can-help-describe-the-content": "Kurze Inhaltsbeschreibung. Möglich sind bis zu 150 Zeichen.",
"write-the-tags-separated-by-comma": "Schlagwörter getrennt durch Kommas. Beispielsweise: Schlagwort1, Schlagwort2, Schlagwort3",
"delete-the-user-and-all-its-posts":"Benutzer und alle seine Beiträge löschen",
"delete-the-user-and-associate-its-posts-to-admin-user": "Benutzer löschen und seine Beiträge dem Administrator zuordnen",
"read-more": "Weiterlesen",
"show-blog": "Blog zeigen",
"default-home-page": "Hauptseite",
"version": "Version",
"there-are-no-drafts": "Es sind keine Entwürfe vorhanden.",
"create-a-new-article-for-your-blog": "Einen neuen Beitrag schreiben.",
"create-a-new-page-for-your-website": "Eine neue Seite anlegen.",
"invite-a-friend-to-collaborate-on-your-website": "Einen neuen Benutzer hinzufügen.",
"change-your-language-and-region-settings": "Sprache ändern und Lokalisierung einstellen.",
"language-and-timezone": "Sprache und Zeitzone",
"author": "Autor",
"start-here": "Direktzugriff",
"install-theme": "Theme aktivieren",
"first-post": "Erster Beitrag",
"congratulations-you-have-successfully-installed-your-bludit": "Gratulation, du hast **Bludit** erfolgreich installiert!",
"whats-next": "Und so geht es weiter:",
"manage-your-bludit-from-the-admin-panel": "Verwalte Bludit im [Administrationsbereich](./admin/).",
"follow-bludit-on": "Folge Bludit bei",
"visit-the-support-forum": "Besuche das [Forum](http://forum.bludit.com), um Hilfe zu erhalten.",
"read-the-documentation-for-more-information": "Lies die [Dokumentation](http://docs.bludit.com) und das [Bludit-Tutorial](https://bludit-tutorial.ch) für weitere Informationen.",
"share-with-your-friends-and-enjoy": "Erzähle deinen Freunden von Bludit und habe Spass daran.",
"the-page-has-not-been-found": "Die Seite wurde nicht gefunden.",
"error": "Fehler",
"bludit-installer": "Bludit-Installer",
"welcome-to-the-bludit-installer": "Willkommen beim Bludit-Installer!",
"complete-the-form-choose-a-password-for-the-username-admin": "Bitte ein Passwort für den Benutzer \"admin\" wählen<br>und eine E-Mail-Adresse eingeben.",
"password-visible-field": "Das Passwort wird in Klartext angezeigt!",
"install": "Installieren",
"choose-your-language": "Sprache wählen",
"next": "Weiter",
"the-password-field-is-empty": "Das Passwort-Feld ist leer.",
"your-email-address-is-invalid": "Die E-Mail-Adresse scheint ungültig zu sein.",
"proceed-anyway": "Trotzdem fortfahren...",
"drafts": "Entwürfe",
"ip-address-has-been-blocked": "Die IP-Adresse wurde blockiert.",
"try-again-in-a-few-minutes": "Bitte versuche es in einigen Minuten noch einmal.",
"date": "Datum und Zeit",
"you-can-schedule-the-post-just-select-the-date-and-time": "Um den Beitrag zu einem späteren Zeitpunkt zu veröffentlichen, wähle ein Datum und die Zeit aus.",
"scheduled": "Veröffentlichung geplant.",
"publish": "Veröffentlichen",
"please-check-your-theme-configuration": "Bitte die Einstellungen des Themes prüfen.",
"plugin-label": "Titel auf der Website",
"enabled": "Aktiviert",
"disabled": "Deaktiviert",
"cli-mode": "CLI-Modus",
"command-line-mode": "Kommandozeilen-Modus",
"enable-the-command-line-mode-if-you-add-edit": "Verwende den Kommandozeilen-Modus, wenn du Beiträge und Seiten im Dateisystem hinzufügen, ändern oder löschen möchtest.",
"configure": "Konfiguration",
"uninstall": "Deinstallieren",
"change-password": "Neues Passwort",
"to-schedule-the-post-just-select-the-date-and-time": "Um einen Beitrag zu einem bestimmten Zeitpunkt zu veröffentlichen, Datum und Zeit wählen.",
"write-the-tags-separated-by-commas": "Schlagwörter durch Kommas getrennt.",
"status": "Status",
"published": "Veröffentlicht",
"scheduled-posts": "Veröffentlichung planen",
"statistics": "Statistiken",
"name": "Name",
"email-account-settings":"E-Mail-Adresse",
"sender-email": "Absender",
"emails-will-be-sent-from-this-address":"E-Mails werden mit dieser E-Mail-Adresse als Absender verschickt.",
"bludit-login-access-code": "BLUDIT - Zugangscode",
"check-your-inbox-for-your-login-access-code":"Der Zugangscode wurde dir geschickt.",
"there-was-a-problem-sending-the-email":"Es besteht ein Pronlem mit dem Verschicken dieser E-Mail.",
"back-to-login-form": "Zurück zum Login",
"send-me-a-login-access-code": "Zugangscode zuschicken",
"get-login-access-code": "Zugangscode schicken",
"email-notification-login-access-code": "<p>Du hast einen Zugangscode für die Website {{WEBSITE_NAME}} angefordert.</p><p>Bitte klicke folgenden Link an oder kopiere ihn, um ihn in der Adresszeile des Browsers einzugeben:</p><p>{{LINK}}</p>",
"there-are-no-scheduled-posts": "Es sind keine geplanten Beiträge vorhanden.",
"show-password": "Passwort zeigen",
"edit-or-remove-your=pages": "Seiten bearbeiten oder löschen.",
"edit-or-remove-your-blogs-posts": "Beiträge bearbeiten oder löschen.",
"general-settings": "Allgemein",
"advanced-settings": "Erweitert",
"manage-users": "Benutzerverwaltung",
"view-and-edit-your-profile": "Profil anschauen und bearbeiten.",
"password-must-be-at-least-6-characters-long": "Das Passwort muss mindestens 6 Zeichen lang sein",
"images": "Bilder",
"upload-image": "Bild hochladen",
"drag-and-drop-or-click-here": "Drag and Drop oder klicke hier",
"insert-image": "Bild einfügen",
"supported-image-file-types": "Unterstützte Datei-Formate",
"date-format": "Datumsformat",
"time-format": "Zeitformat",
"chat-with-developers-and-users-on-gitter":"Chatte mit Entwicklern und Benutzern bei [Gitter](https://gitter.im/dignajar/bludit)",
"this-is-a-brief-description-of-yourself-our-your-site":"Dies ist eine kurze Beschreibung, wer du bist, oder deiner Website. Um diesen Text zu ändern, gehe im Admin-Panel zu den Einstellungen und konfiguriere unter \"Plugins\" das Plugin \"Über\".",
"profile-picture": "Profil-Bild",
"the-about-page-is-very-important": "Die Seite \"Über\" ist wichtig und wirkungsvoll beispielsweise für zukünfige Kunden und Partner. Für alle, die wissen möchten, wer hinter der Website steht, ist die \"Über\"-Seite die erste Informationsquelle.",
"change-this-pages-content-on-the-admin-panel": "Der Inhalt dieser Seite kann im Admin-Panel unter \"Verwaltung\" > \"Seiten\" geändert werden.",
"about-your-site-or-yourself": "Über dich oder deine Website",
"welcome-to-bludit": "Willkommen bei Bludit",
"site-information": "Angaben zur Website",
"date-and-time-formats": "Datum und Zeit",
"activate": "Aktivieren",
"deactivate": "Deaktivieren"
}

View File

@ -142,7 +142,7 @@
"follow-bludit-on": "Folge Bludit bei",
"visit-the-support-forum": "Besuche das [Forum](http://forum.bludit.com), um Hilfe zu erhalten.",
"read-the-documentation-for-more-information": "Lies die [Dokumentation](http://docs.bludit.com) und das [Bludit-Tutorial](https://bludit-tutorial.ch) für weitere Informationen.",
"share-with-your-friends-and-enjoy": "Erzähle deinen Freunden von Bludit und habe Spass daran.",
"share-with-your-friends-and-enjoy": "Erzähle deinen Freunden von Bludit und habe Spaß daran.",
"the-page-has-not-been-found": "Die Seite wurde nicht gefunden.",
"error": "Fehler",
"bludit-installer": "Bludit-Installer",
@ -184,7 +184,7 @@
"emails-will-be-sent-from-this-address":"E-Mails werden mit dieser E-Mail-Adresse als Absender verschickt.",
"bludit-login-access-code": "BLUDIT - Zugangscode",
"check-your-inbox-for-your-login-access-code":"Der Zugangscode wurde dir geschickt.",
"there-was-a-problem-sending-the-email":"Es besteht ein Pronlem mit dem Verschicken dieser E-Mail.",
"there-was-a-problem-sending-the-email":"Es besteht ein Problem mit dem Verschicken dieser E-Mail.",
"back-to-login-form": "Zurück zum Login",
"send-me-a-login-access-code": "Zugangscode zuschicken",
"get-login-access-code": "Zugangscode schicken",

View File

@ -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"
}

View File

@ -3,7 +3,7 @@
{
"native": "Italiano (Italia)",
"english-name": "Italian",
"last-update": "2015-12-22",
"last-update": "2015-12-30",
"author": "Daniele La Pira",
"email": "daniele.lapira@gmail.com",
"website": "https://github.com/danielelapira"
@ -98,7 +98,7 @@
"database-regenerated": "Database rigenerato",
"the-changes-have-been-saved": "Le modifiche sono state salvate",
"enable-more-features-at": "Abilita altre funzioni a",
"username-already-exists": "Il nome utente esiste già",
"username-already-exists": "Nome utente già esistente",
"username-field-is-empty": "Campo nome utente vuoto",
"the-password-and-confirmation-password-do-not-match":"Le password non corrispondono",
"user-has-been-added-successfully": "Utente aggiunto con successo",
@ -109,7 +109,7 @@
"email-will-not-be-publicly-displayed": "L'indirizzo Email non sarà visibile. Raccomandato per il recupero della password e per ricevere notifiche.",
"use-this-field-to-name-your-site": "Usa questo campo per dare un nome al tuo sito. Apparirà nella parte superiore in ogni pagina del tuo sito.",
"use-this-field-to-add-a-catchy-phrase": "Usa questo campo per aggiungere uno slogan al tuo sito.",
"you-can-add-a-site-description-to-provide": "Puoi aggiungere una descrizione del tuo sito e una breve biografia.",
"you-can-add-a-site-description-to-provide": "Puoi aggiungere una descrizione del tuo sito e una tua breve biografia.",
"you-can-add-a-small-text-on-the-bottom": "Puoi aggiungere un breve testo in fondo ad ogni pagina. Ad es. copyright, autore, date, ecc.",
"number-of-posts-to-show-per-page": "Numero di articoli da mostrare per pagina.",
"the-url-of-your-site": "Indirizzo URL del tuo sito.",
@ -183,7 +183,7 @@
"email-account-settings":"Impostazioni dell'account email",
"sender-email": "Mittente email",
"emails-will-be-sent-from-this-address":"Le emails saranno inviate da questo indirizzo.",
"bludit-login-access-code": "BLUDIT - Login access code",
"bludit-login-access-code": "BLUDIT - Codice di accesso",
"check-your-inbox-for-your-login-access-code":"Controlla la tua posta in ingresso per il codice di accesso",
"there-was-a-problem-sending-the-email":"C'è stato un problema nell'invio dell' email",
"back-to-login-form": "Torna indietro alla pagina di accesso",
@ -193,7 +193,7 @@
"there-are-no-scheduled-posts": "Non ci sono articoli programmati.",
"show-password": "Mostra password",
"edit-or-remove-your=pages": "Modifica o elimina pagine.",
"edit-or-remove-your-blogs-posts": "Modifica o elimina gli articoli del tuo blog.",
"edit-or-remove-your-blogs-posts": "Modifica o elimina articoli del blog.",
"general-settings": "Impostazioni generali",
"advanced-settings": "Impostazioni avanzate",
"manage-users": "Gestisci utenti",
@ -205,18 +205,20 @@
"drag-and-drop-or-click-here": "Trascina e rilascia oppure clicca quì",
"insert-image": "Inserisci immagine",
"supported-image-file-types": "Formati file immagine supportati",
"date-format": "Formato data",
"date-format": "Formato data",
"time-format": "Formato ora",
"chat-with-developers-and-users-on-gitter":"Chatta con gli sviluppatori e gli utenti su [Gitter](https://gitter.im/dignajar/bludit)",
"this-is-a-brief-description-of-yourself-our-your-site":"Questa è una breve descrizione del tuo sito. Per cambiare il testo vai nel pannello di amministrazione, impostazioni, plugins e configura il plugin about.",
"profile-picture": "Foto del profilo",
"the-about-page-is-very-important": "La pagina << about >> è molto utile. Fornisce ai tuoi visitatori importanti informazioni sul sito. Uno strumento efficace per acquisire potenziali clienti e partners.",
"the-about-page-is-very-important": "La pagina << about >> è molto utile. Fornisce ai visitatori importanti informazioni sul sito ed il suo autore. Uno strumento efficace per acquisire potenziali clienti e partners.",
"change-this-pages-content-on-the-admin-panel": "Cambia il contenuto di questa pagina sul pannello di amministrazione, Amministra -> Pagine e Clicca sulla pagina << about >> per modificare.",
"about-your-site-or-yourself": "A proposito di te e del tuo sito.",
"welcome-to-bludit": "Benvenuti su Bludit"
"welcome-to-bludit": "Benvenuti su Bludit",
"site-information": "Informazioni sul sito",
"date-and-time-formats": "Formati data e ora",
"activate": "Attiva",
"deactivate": "Disattiva"
"deactivate": "Disattiva",
"cover-image": "Immagine di copertina"
}

166
languages/nl_NL.json Normal file
View File

@ -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."
}

View File

@ -218,5 +218,7 @@
"site-information": "Информация о сайте",
"date-and-time-formats": "Форматы даты и времени",
"activate": "Активировать",
"deactivate": "Деактивировать"
"deactivate": "Деактивировать",
"cover-image": "Обложка"
}

View File

@ -213,5 +213,12 @@
"the-about-page-is-very-important": "Bu sayfa potansiyel müşteriler ve ortaklar için oldukça önemli ve güçlü bir araçtır. Bu siteyi kimin yaptığını merak edenler ilk olarak hakkında kısmına bakarlar.",
"change-this-pages-content-on-the-admin-panel": "Bu sayfanın içeriğini düzenlemek için admin paneli -> yönet -> sayfalar -> hakkında sayfası .",
"about-your-site-or-yourself": "Site veya senin hakkında",
"welcome-to-bludit": "Bludit'e Hoşgeldiniz"
"welcome-to-bludit": "Bludit'e Hoşgeldiniz",
"site-information": "Site bilgisi",
"date-and-time-formats": "Tarih ve saat formatları",
"activate": "Aktifleştir",
"deactivate": "Deaktive et",
"cover-image": "Kapak resmi"
}

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Über",
"description": "Kurzer Text über die Website oder zu dir."
}
}

View File

@ -0,0 +1,11 @@
{
"plugin-data":
{
"name": "Disqus",
"description": "Disqus ist eine Kommentar-Plattform für Websites. Um das Plugin verwenden zu können, muss ein Konto bei Disqus.com eingerichtet werden."
},
"disqus-shortname": "Disqus shortname",
"enable-disqus-on-pages": "Disqus auf Seiten verwenden",
"enable-disqus-on-posts": "Disqus bei Beiträgen verwenden",
"enable-disqus-on-default-home-page": "Disqus auf der Hauptseite verwenden"
}

View File

@ -0,0 +1,11 @@
{
"plugin-data":
{
"name": "Google-Tools",
"description": "Dieses Plugin erzeugt den Meta-Tag, um deine Website mit den Google Webmasters Tools zu verbinden, und den Code für das JavaScript, der benötigt wird, um Google Analytics verwenden zu können."
},
"google-webmasters-tools": "Google Webmasters Tools",
"google-analytics-tracking-id": "Google Analytics ID",
"complete-this-field-with-the-google-site-verification": "Gib hier den Google Analytics-Tracking-Code ein, um zu bestätigen, dass die Website Dir gehört.",
"complete-this-field-with-the-tracking-id": "Gib hier die Tracking ID ein."
}

View File

@ -0,0 +1,10 @@
{
"plugin-data":
{
"name": "Wartungsmodus",
"description": "Wartungsmodus für die Website mit Zugang zum Admin-Bereich."
},
"enable-maintence-mode": "Aktivierung des Wartungsmodus",
"message": "Auf der Website angezeigter Hinweis"
}

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "Plugin zur Verwendung des Open Graph Protocols."
}
}

View File

@ -0,0 +1,10 @@
{
"plugin-data":
{
"name": "Menü aller Seiten",
"description": "Anzeige eines Menüs aller Seiten in der Seitenleiste (bei Themes mit Seitenleiste)."
},
"home": "Hauptseite",
"show-home-link": "Hauptseite zeigen"
}

View File

@ -1,8 +1,8 @@
{
"plugin-data":
{
"name": "Anzeige aller Seiten",
"description": "Anzeige aller Seiten in der Seitenleiste (bei Themes mit Seitenleiste)."
"name": "Menü aller Seiten",
"description": "Anzeige eines Menüs aller Seiten in der Seitenleiste (bei Themes mit Seitenleiste)."
},
"home": "Hauptseite",

View File

@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "SimpleMDE",
"description": "Ein einfacher und schöner JavaScript-Editor für die Verwendung von Markdown von @WesCossick. Von Diego Najar für Bludit angpasst."
},
"toolbar": "Werkzeugleiste",
"tab-size": "Abstände der Tabstopps"
}

View File

@ -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>';

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Anzeige aller Schlagwörter",
"description": "Anzeige aller Schlagwörter in der Seitenleiste (bei Themes mit Seitenleiste)."
}
}

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "TinyMCE",
"description": "TinyMCE ist ein einfacher HTML-Editor mit zahlreichen Plugins und Konfigurationsmöglichkeiten."
}
}

View File

@ -2,6 +2,6 @@
"plugin-data":
{
"name": "TinyMCE",
"description": "TinyMCE ist ein einfacher HTML-Editor mit zahlreichen Plugins Und Anpassungsmöglichkeiten."
"description": "TinyMCE ist ein einfacher HTML-Editor mit zahlreichen Plugins und Konfigurationsmöglichkeiten."
}
}

View File

@ -22,11 +22,11 @@
<?php
echo $Language->get('Posted By').' ';
if( Text::isNotEmpty($Post->authorFirstName()) || Text::isNotEmpty($Post->authorLastName()) ) {
echo $Post->authorFirstName().' '.$Post->authorLastName();
if( Text::isNotEmpty($Post->user('firstName')) || Text::isNotEmpty($Post->user('lastName')) ) {
echo $Post->user('firstName').' '.$Post->user('lastName');
}
else {
echo $Post->username();
echo $Post->user('username');
}
?>
</span>