Improves on GUI and Installer

This commit is contained in:
Diego Najar 2017-01-10 13:43:38 -03:00
parent 1e0e663c23
commit 2e2d5e1000
10 changed files with 344 additions and 217 deletions

View File

@ -209,9 +209,36 @@ div.dashboard-links h4 {
font-size: 0.9em !important; font-size: 0.9em !important;
} }
.bl-publish-sidebar ul {
margin: 0;
padding: 0;
}
.bl-publish-sidebar li {
margin: 0;
padding: 0;
list-style: none;
}
.bl-publish-sidebar li:not(:first-child) {
margin-top: 10px;
}
.bl-publish-sidebar .uk-form-label { .bl-publish-sidebar .uk-form-label {
font-size: 0.9em; font-size: 0.9em;
text-transform: uppercase; text-transform: uppercase;
font-weight: normal;
}
.bl-publish-sidebar .sidebar-view {
display: none;
}
.bl-publish-sidebar h2.sidebar-button {
font-size: 0.9em;
text-transform: uppercase;
border-bottom: 1px solid #ddd;
cursor: pointer;
} }
.uk-form legend { .uk-form legend {
@ -340,19 +367,19 @@ table.statistics tr:last-child td {
} }
#bludit-tags .uk-button { #bludit-tags .uk-button {
padding: 0 12px !important; margin-top: 5px;
margin-left: 10px;
} }
#jstagList { #jstagList {
margin-top: 15px; margin-top: 15px;
font-size: 0.9em;
} }
#jstagList span.unselect, #jstagList span.unselect,
#jstagList span.select { #jstagList span.select {
margin-top: 5px; margin-top: 7px;
margin-right: 5px; margin-right: 7px;
padding: 2px 15px; padding: 1px 15px;
cursor: pointer; cursor: pointer;
display: inline-block; display: inline-block;
border-radius: 3px; border-radius: 3px;

View File

@ -151,6 +151,20 @@ $(document).ready(function() {
?> ?>
</div> </div>
<?php
if( AUTO_SCROLL ) {
?>
<script>
// Auto scroll
$(document).ready(function () {
$('html, body').animate({
scrollTop: $('#bl-view').offset().top
}, 'slow');
});
</script>
<?php
}
?>
</div> </div>
<!-- Javascript --> <!-- Javascript -->

View File

@ -4,7 +4,9 @@ class HTML {
public static function title($args) public static function title($args)
{ {
$html = '<h2 class="title"><i class="uk-icon-'.$args['icon'].'"></i> '.$args['title'].'</h2>'; $id = empty($args['id']) ? '' : 'id="'.$args['id'].'"';
$html = '<h2 class="title" '.$id.'><i class="uk-icon-'.$args['icon'].'"></i> '.$args['title'].'</h2>';
echo $html; echo $html;
} }
@ -81,7 +83,7 @@ class HTML {
$html .= '<label for="jstagInput" class="uk-form-label">'.$args['label'].'</label>'; $html .= '<label for="jstagInput" class="uk-form-label">'.$args['label'].'</label>';
$html .= '<div class="uk-form-controls">'; $html .= '<div class="uk-form-controls">';
$html .= '<input id="jstagInput" type="text" class="uk-width-1-2" autocomplete="off">'; $html .= '<input id="jstagInput" type="text" class="uk-width-1-1" autocomplete="off">';
$html .= '<button id="jstagAdd" class="uk-button">'.$L->g('Add').'</button>'; $html .= '<button id="jstagAdd" class="uk-button">'.$L->g('Add').'</button>';
$html .= '<div id="jstagList">'; $html .= '<div id="jstagList">';

View File

@ -16,7 +16,8 @@ HTML::formOpen(array('class'=>'uk-form-stacked'));
'value'=>$_Page->key() 'value'=>$_Page->key()
)); ));
// ---- LEFT SIDE ---- // LEFT SIDE
// --------------------------------------------------------------------
echo '<div class="uk-grid uk-grid-medium">'; echo '<div class="uk-grid uk-grid-medium">';
echo '<div class="bl-publish-view uk-width-8-10">'; echo '<div class="bl-publish-view uk-width-8-10">';
@ -38,7 +39,10 @@ echo '<div class="bl-publish-view uk-width-8-10">';
// Form buttons // Form buttons
echo '<div class="uk-form-row uk-margin-bottom">'; echo '<div class="uk-form-row uk-margin-bottom">';
echo ' <button class="uk-button uk-button-primary" type="submit">'.$L->g('Save').'</button>'; echo '
<button class="uk-button uk-button-primary" type="submit">'.$L->g('Save').'</button>
<button class="uk-button uk-button-primary" type="button" id="jsSaveDraft">'.$L->g('Save as draft').'</button>
';
if(count($_Page->children())===0) if(count($_Page->children())===0)
{ {
@ -50,20 +54,16 @@ if(count($_Page->children())===0)
echo '</div>'; echo '</div>';
// ---- RIGHT SIDE ---- // RIGHT SIDE
// --------------------------------------------------------------------
echo '<div class="bl-publish-sidebar uk-width-2-10">'; echo '<div class="bl-publish-sidebar uk-width-2-10">';
// Tabs, general and advanced mode echo '<ul>';
echo '<ul class="uk-tab" data-uk-tab="{connect:\'#tab-options\'}">';
echo '<li><a href="">'.$L->g('General').'</a></li>';
echo '<li><a href="">'.$L->g('Images').'</a></li>';
echo '<li><a href="">'.$L->g('Advanced').'</a></li>';
echo '</ul>';
echo '<ul id="tab-options" class="uk-switcher uk-margin">'; // GENERAL TAB
// --------------------------------------------------------------------
// ---- GENERAL TAB ---- echo '<li><h2 class="sidebar-button" data-view="sidebar-general-view"><i class="uk-icon-angle-down"></i> GENERAL</h2></li>';
echo '<li>'; echo '<li id="sidebar-general-view" class="sidebar-view">';
// Description input // Description input
HTML::formTextarea(array( HTML::formTextarea(array(
@ -75,23 +75,15 @@ echo '<div class="bl-publish-sidebar uk-width-2-10">';
'tip'=>$L->g('this-field-can-help-describe-the-content') 'tip'=>$L->g('this-field-can-help-describe-the-content')
)); ));
// Tags input
HTML::tags(array(
'name'=>'tags',
'label'=>$L->g('Tags'),
'allTags'=>$dbTags->getAll(),
'selectedTags'=>$_Page->tags(true)
));
echo '</li>'; echo '</li>';
// ---- IMAGES TAB ---- // IMAGES TAB
echo '<li>'; // --------------------------------------------------------------------
echo '<li><h2 class="sidebar-button" data-view="sidebar-images-view"><i class="uk-icon-angle-down"></i> Images</h2></li>';
echo '<li id="sidebar-images-view" class="sidebar-view">';
// --- BLUDIT COVER IMAGE --- // --- BLUDIT COVER IMAGE ---
echo '<hr>';
HTML::bluditCoverImage($_Page->coverImage(false)); HTML::bluditCoverImage($_Page->coverImage(false));
echo '<hr>';
// --- BLUDIT QUICK IMAGES --- // --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages(); HTML::bluditQuickImages();
@ -104,8 +96,26 @@ echo '<div class="bl-publish-sidebar uk-width-2-10">';
echo '</li>'; echo '</li>';
// ---- ADVANCED TAB ----
echo '<li>'; // TAGS
// --------------------------------------------------------------------
echo '<li><h2 class="sidebar-button" data-view="sidebar-tags-view"><i class="uk-icon-angle-down"></i> '.$L->g('Tags').'</h2></li>';
echo '<li id="sidebar-tags-view" class="sidebar-view">';
// Tags input
HTML::tags(array(
'name'=>'tags',
'label'=>$L->g('Tags'),
'allTags'=>$dbTags->getAll(),
'selectedTags'=>$_Page->tags(true)
));
echo '</li>';
// ADVANCED TAB
// --------------------------------------------------------------------
echo '<li><h2 class="sidebar-button" data-view="sidebar-advanced-view"><i class="uk-icon-angle-down"></i> ADVANCED</h2></li>';
echo '<li id="sidebar-advanced-view" class="sidebar-view">';
// Status input // Status input
HTML::formSelect(array( HTML::formSelect(array(
@ -167,41 +177,60 @@ HTML::formClose();
$(document).ready(function() $(document).ready(function()
{ {
var key = $("#jskey").val(); var key = $("#jskey").val();
$("#jsslug").keyup(function() { $("#jsslug").keyup(function() {
var text = $(this).val(); var text = $(this).val();
var parent = $("#jsparent").val(); var parent = $("#jsparent").val();
checkSlugPage(text, parent, key, $("#jsslug")); checkSlugPage(text, parent, key, $("#jsslug"));
}); });
$("#jstitle").keyup(function() { $("#jstitle").keyup(function() {
var text = $(this).val(); var text = $(this).val();
var parent = $("#jsparent").val(); var parent = $("#jsparent").val();
checkSlugPage(text, parent, key, $("#jsslug")); checkSlugPage(text, parent, key, $("#jsslug"));
}); });
$("#jsparent").change(function() { $("#jsparent").change(function() {
var parent = $(this).val(); var parent = $(this).val();
var text = $("#jsslug").val(); var text = $("#jsslug").val();
if(parent==NO_PARENT_CHAR) { if(parent==NO_PARENT_CHAR) {
$("#jsparentExample").text(""); $("#jsparentExample").text("");
} }
else { else {
$("#jsparentExample").text(parent+"/"); $("#jsparentExample").text(parent+"/");
} }
checkSlugPage(text, parent, key, $("#jsslug")); checkSlugPage(text, parent, key, $("#jsslug"));
}); });
$("#jsdelete").click(function() { $("#jsdelete").click(function() {
if(confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")==false) { if(confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")==false) {
return false; return false;
} }
}); });
// Button Save as draft
$("#jsSaveDraft").on("click", function() {
$("#jsstatus").val("draft");
$(".uk-form").submit();
});
// Right sidebar
$(".sidebar-button").click(function() {
var view = "#" + $(this).data("view");
if( $(view).is(":visible") ) {
$(view).hide();
}
else {
$(".sidebar-view").hide();
$(view).show();
}
});
}); });

View File

@ -16,7 +16,8 @@ HTML::formOpen(array('class'=>'uk-form-stacked'));
'value'=>$_Post->key() 'value'=>$_Post->key()
)); ));
// ---- LEFT SIDE ---- // LEFT SIDE
// --------------------------------------------------------------------
echo '<div class="uk-grid uk-grid-medium">'; echo '<div class="uk-grid uk-grid-medium">';
echo '<div class="bl-publish-view uk-width-8-10">'; echo '<div class="bl-publish-view uk-width-8-10">';
@ -39,26 +40,23 @@ echo '<div class="bl-publish-view uk-width-8-10">';
// Form buttons // Form buttons
echo '<div class="uk-form-row uk-margin-bottom"> echo '<div class="uk-form-row uk-margin-bottom">
<button class="uk-button uk-button-primary" type="submit">'.$L->g('Save').'</button> <button class="uk-button uk-button-primary" type="submit">'.$L->g('Save').'</button>
<button class="uk-button uk-button-primary" type="button" id="jsSaveDraft">'.$L->g('Save as draft').'</button>
<button id="jsdelete-post" name="delete-post" class="uk-button" type="submit">'.$L->g('Delete').'</button> <button id="jsdelete-post" name="delete-post" class="uk-button" type="submit">'.$L->g('Delete').'</button>
<a class="uk-button" href="'.HTML_PATH_ADMIN_ROOT.'manage-posts">'.$L->g('Cancel').'</a> <a class="uk-button" href="'.HTML_PATH_ADMIN_ROOT.'manage-posts">'.$L->g('Cancel').'</a>
</div>'; </div>';
echo '</div>'; echo '</div>';
// ---- RIGHT SIDE ---- // RIGHT SIDE
// --------------------------------------------------------------------
echo '<div class="bl-publish-sidebar uk-width-2-10">'; echo '<div class="bl-publish-sidebar uk-width-2-10">';
// Tabs, general and advanced mode echo '<ul>';
echo '<ul class="uk-tab" data-uk-tab="{connect:\'#tab-options\'}">';
echo '<li><a href="">'.$L->g('General').'</a></li>';
echo '<li><a href="">'.$L->g('Images').'</a></li>';
echo '<li><a href="">'.$L->g('Advanced').'</a></li>';
echo '</ul>';
echo '<ul id="tab-options" class="uk-switcher uk-margin">'; // GENERAL TAB
// --------------------------------------------------------------------
// ---- GENERAL TAB ---- echo '<li><h2 class="sidebar-button" data-view="sidebar-general-view"><i class="uk-icon-angle-down"></i> GENERAL</h2></li>';
echo '<li>'; echo '<li id="sidebar-general-view" class="sidebar-view">';
// Description input // Description input
HTML::formTextarea(array( HTML::formTextarea(array(
@ -70,23 +68,15 @@ echo '<div class="bl-publish-sidebar uk-width-2-10">';
'tip'=>$L->g('this-field-can-help-describe-the-content') 'tip'=>$L->g('this-field-can-help-describe-the-content')
)); ));
// Tags input
HTML::tags(array(
'name'=>'tags',
'label'=>$L->g('Tags'),
'allTags'=>$dbTags->getAll(),
'selectedTags'=>$_Post->tags(true)
));
echo '</li>'; echo '</li>';
// ---- IMAGES TAB ---- // IMAGES TAB
echo '<li>'; // --------------------------------------------------------------------
echo '<li><h2 class="sidebar-button" data-view="sidebar-images-view"><i class="uk-icon-angle-down"></i> Images</h2></li>';
echo '<li id="sidebar-images-view" class="sidebar-view">';
// --- BLUDIT COVER IMAGE --- // --- BLUDIT COVER IMAGE ---
echo '<hr>';
HTML::bluditCoverImage($_Post->coverImage(false)); HTML::bluditCoverImage($_Post->coverImage(false));
echo '<hr>';
// --- BLUDIT QUICK IMAGES --- // --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages(); HTML::bluditQuickImages();
@ -99,8 +89,25 @@ echo '<div class="bl-publish-sidebar uk-width-2-10">';
echo '</li>'; echo '</li>';
// ---- ADVANCED TAB ---- // TAGS
echo '<li>'; // --------------------------------------------------------------------
echo '<li><h2 class="sidebar-button" data-view="sidebar-tags-view"><i class="uk-icon-angle-down"></i> '.$L->g('Tags').'</h2></li>';
echo '<li id="sidebar-tags-view" class="sidebar-view">';
// Tags input
HTML::tags(array(
'name'=>'tags',
'label'=>$L->g('Tags'),
'allTags'=>$dbTags->getAll(),
'selectedTags'=>$_Post->tags(true)
));
echo '</li>';
// ADVANCED TAB
// --------------------------------------------------------------------
echo '<li><h2 class="sidebar-button" data-view="sidebar-advanced-view"><i class="uk-icon-angle-down"></i> ADVANCED</h2></li>';
echo '<li id="sidebar-advanced-view" class="sidebar-view">';
// Status input // Status input
HTML::formSelect(array( HTML::formSelect(array(
@ -164,6 +171,25 @@ $(document).ready(function() {
} }
}); });
// Button Save as draft
$("#jsSaveDraft").on("click", function() {
$("#jsstatus").val("draft");
$(".uk-form").submit();
});
// Right sidebar
$(".sidebar-button").click(function() {
var view = "#" + $(this).data("view");
if( $(view).is(":visible") ) {
$(view).hide();
}
else {
$(".sidebar-view").hide();
$(view).show();
}
});
}); });
</script> </script>

View File

@ -10,7 +10,8 @@ HTML::formOpen(array('class'=>'uk-form-stacked'));
'value'=>$Security->getTokenCSRF() 'value'=>$Security->getTokenCSRF()
)); ));
// ---- LEFT SIDE ---- // LEFT SIDE
// --------------------------------------------------------------------
echo '<div class="uk-grid uk-grid-medium">'; echo '<div class="uk-grid uk-grid-medium">';
echo '<div class="bl-publish-view uk-width-8-10">'; echo '<div class="bl-publish-view uk-width-8-10">';
@ -33,25 +34,22 @@ echo '<div class="bl-publish-view uk-width-8-10">';
// Form buttons // Form buttons
echo '<div class="uk-form-row uk-margin-bottom"> echo '<div class="uk-form-row uk-margin-bottom">
<button class="uk-button uk-button-primary" type="submit">'.$L->g('Save').'</button> <button class="uk-button uk-button-primary" type="submit">'.$L->g('Save').'</button>
<a class="uk-button" href="'.HTML_PATH_ADMIN_ROOT.'manage-pages">'.$L->g('Cancel').'</a> <button class="uk-button uk-button-primary" type="button" id="jsSaveDraft">'.$L->g('Save as draft').'</button>
<a class="uk-button" href="'.HTML_PATH_ADMIN_ROOT.'manage-posts">'.$L->g('Cancel').'</a>
</div>'; </div>';
echo '</div>'; echo '</div>';
// ---- RIGHT SIDE ---- // RIGHT SIDE
// --------------------------------------------------------------------
echo '<div class="bl-publish-sidebar uk-width-2-10">'; echo '<div class="bl-publish-sidebar uk-width-2-10">';
// Tabs, general and advanced mode echo '<ul>';
echo '<ul class="uk-tab" data-uk-tab="{connect:\'#tab-options\'}">';
echo '<li><a href="">'.$L->g('General').'</a></li>';
echo '<li><a href="">'.$L->g('Images').'</a></li>';
echo '<li><a href="">'.$L->g('Advanced').'</a></li>';
echo '</ul>';
echo '<ul id="tab-options" class="uk-switcher uk-margin">'; // GENERAL TAB
// --------------------------------------------------------------------
// ---- GENERAL TAB ---- echo '<li><h2 class="sidebar-button" data-view="sidebar-general-view"><i class="uk-icon-angle-down"></i> GENERAL</h2></li>';
echo '<li>'; echo '<li id="sidebar-general-view" class="sidebar-view">';
// Description input // Description input
HTML::formTextarea(array( HTML::formTextarea(array(
@ -63,23 +61,15 @@ echo '<div class="bl-publish-sidebar uk-width-2-10">';
'tip'=>$L->g('this-field-can-help-describe-the-content') 'tip'=>$L->g('this-field-can-help-describe-the-content')
)); ));
// Tags input
HTML::tags(array(
'name'=>'tags',
'label'=>$L->g('Tags'),
'allTags'=>$dbTags->getAll(),
'selectedTags'=>array()
));
echo '</li>'; echo '</li>';
// ---- IMAGES TAB ---- // IMAGES TAB
echo '<li>'; // --------------------------------------------------------------------
echo '<li><h2 class="sidebar-button" data-view="sidebar-images-view"><i class="uk-icon-angle-down"></i> Images</h2></li>';
echo '<li id="sidebar-images-view" class="sidebar-view">';
// --- BLUDIT COVER IMAGE --- // --- BLUDIT COVER IMAGE ---
echo '<hr>';
HTML::bluditCoverImage(); HTML::bluditCoverImage();
echo '<hr>';
// --- BLUDIT QUICK IMAGES --- // --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages(); HTML::bluditQuickImages();
@ -92,8 +82,25 @@ echo '<div class="bl-publish-sidebar uk-width-2-10">';
echo '</li>'; echo '</li>';
// ---- ADVANCED TAB ---- // TAGS
echo '<li>'; // --------------------------------------------------------------------
echo '<li><h2 class="sidebar-button" data-view="sidebar-tags-view"><i class="uk-icon-angle-down"></i> '.$L->g('Tags').'</h2></li>';
echo '<li id="sidebar-tags-view" class="sidebar-view">';
// Tags input
HTML::tags(array(
'name'=>'tags',
'label'=>'',
'allTags'=>$dbTags->getAll(),
'selectedTags'=>array()
));
echo '</li>';
// ADVANCED TAB
// --------------------------------------------------------------------
echo '<li><h2 class="sidebar-button" data-view="sidebar-advanced-view"><i class="uk-icon-angle-down"></i> ADVANCED</h2></li>';
echo '<li id="sidebar-advanced-view" class="sidebar-view">';
// Status input // Status input
HTML::formSelect(array( HTML::formSelect(array(
@ -151,33 +158,52 @@ HTML::formClose();
$(document).ready(function() $(document).ready(function()
{ {
$("#jsslug").keyup(function() { $("#jsslug").keyup(function() {
var text = $(this).val(); var text = $(this).val();
var parent = $("#jsparent").val(); var parent = $("#jsparent").val();
checkSlugPage(text, parent, "", $("#jsslug")); checkSlugPage(text, parent, "", $("#jsslug"));
}); });
$("#jstitle").keyup(function() { $("#jstitle").keyup(function() {
var text = $(this).val(); var text = $(this).val();
var parent = $("#jsparent").val(); var parent = $("#jsparent").val();
checkSlugPage(text, parent, "", $("#jsslug")); checkSlugPage(text, parent, "", $("#jsslug"));
}); });
$("#jsparent").change(function() { $("#jsparent").change(function() {
var parent = $(this).val(); var parent = $(this).val();
var text = $("#jsslug").val(); var text = $("#jsslug").val();
if(parent==NO_PARENT_CHAR) { if(parent==NO_PARENT_CHAR) {
$("#jsparentExample").text(""); $("#jsparentExample").text("");
} }
else { else {
$("#jsparentExample").text(parent+"/"); $("#jsparentExample").text(parent+"/");
} }
checkSlugPage(text, parent, "", $("#jsslug")); checkSlugPage(text, parent, "", $("#jsslug"));
}); });
// Button Save as draft
$("#jsSaveDraft").on("click", function() {
$("#jsstatus").val("draft");
$(".uk-form").submit();
});
// Right sidebar
$(".sidebar-button").click(function() {
var view = "#" + $(this).data("view");
if( $(view).is(":visible") ) {
$(view).hide();
}
else {
$(".sidebar-view").hide();
$(view).show();
}
});
}); });

View File

@ -10,7 +10,8 @@ HTML::formOpen(array('class'=>'uk-form-stacked'));
'value'=>$Security->getTokenCSRF() 'value'=>$Security->getTokenCSRF()
)); ));
// ---- LEFT SIDE ---- // LEFT SIDE
// --------------------------------------------------------------------
echo '<div class="uk-grid uk-grid-medium">'; echo '<div class="uk-grid uk-grid-medium">';
echo '<div class="bl-publish-view uk-width-8-10">'; echo '<div class="bl-publish-view uk-width-8-10">';
@ -33,25 +34,22 @@ echo '<div class="bl-publish-view uk-width-8-10">';
// Form buttons // Form buttons
echo '<div class="uk-form-row uk-margin-bottom"> echo '<div class="uk-form-row uk-margin-bottom">
<button class="uk-button uk-button-primary" type="submit">'.$L->g('Save').'</button> <button class="uk-button uk-button-primary" type="submit">'.$L->g('Save').'</button>
<button class="uk-button uk-button-primary" type="button" id="jsSaveDraft">'.$L->g('Save as draft').'</button>
<a class="uk-button" href="'.HTML_PATH_ADMIN_ROOT.'manage-posts">'.$L->g('Cancel').'</a> <a class="uk-button" href="'.HTML_PATH_ADMIN_ROOT.'manage-posts">'.$L->g('Cancel').'</a>
</div>'; </div>';
echo '</div>'; echo '</div>';
// ---- RIGHT SIDE ---- // RIGHT SIDE
// --------------------------------------------------------------------
echo '<div class="bl-publish-sidebar uk-width-2-10">'; echo '<div class="bl-publish-sidebar uk-width-2-10">';
// Tabs, general and advanced mode echo '<ul>';
echo '<ul class="uk-tab" data-uk-tab="{connect:\'#tab-options\'}">';
echo '<li><a href="">'.$L->g('General').'</a></li>';
echo '<li><a href="">'.$L->g('Images').'</a></li>';
echo '<li><a href="">'.$L->g('Advanced').'</a></li>';
echo '</ul>';
echo '<ul id="tab-options" class="uk-switcher uk-margin">'; // GENERAL TAB
// --------------------------------------------------------------------
// ---- GENERAL TAB ---- echo '<li><h2 class="sidebar-button" data-view="sidebar-general-view"><i class="uk-icon-angle-down"></i> GENERAL</h2></li>';
echo '<li>'; echo '<li id="sidebar-general-view" class="sidebar-view">';
// Description input // Description input
HTML::formTextarea(array( HTML::formTextarea(array(
@ -63,23 +61,15 @@ echo '<div class="bl-publish-sidebar uk-width-2-10">';
'tip'=>$L->g('this-field-can-help-describe-the-content') 'tip'=>$L->g('this-field-can-help-describe-the-content')
)); ));
// Tags input
HTML::tags(array(
'name'=>'tags',
'label'=>$L->g('Tags'),
'allTags'=>$dbTags->getAll(),
'selectedTags'=>array()
));
echo '</li>'; echo '</li>';
// ---- IMAGES TAB ---- // IMAGES TAB
echo '<li>'; // --------------------------------------------------------------------
echo '<li><h2 class="sidebar-button" data-view="sidebar-images-view"><i class="uk-icon-angle-down"></i> Images</h2></li>';
echo '<li id="sidebar-images-view" class="sidebar-view">';
// --- BLUDIT COVER IMAGE --- // --- BLUDIT COVER IMAGE ---
echo '<hr>';
HTML::bluditCoverImage(); HTML::bluditCoverImage();
echo '<hr>';
// --- BLUDIT QUICK IMAGES --- // --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages(); HTML::bluditQuickImages();
@ -92,8 +82,25 @@ echo '<div class="bl-publish-sidebar uk-width-2-10">';
echo '</li>'; echo '</li>';
// ---- ADVANCED TAB ---- // TAGS
echo '<li>'; // --------------------------------------------------------------------
echo '<li><h2 class="sidebar-button" data-view="sidebar-tags-view"><i class="uk-icon-angle-down"></i> '.$L->g('Tags').'</h2></li>';
echo '<li id="sidebar-tags-view" class="sidebar-view">';
// Tags input
HTML::tags(array(
'name'=>'tags',
'label'=>'',
'allTags'=>$dbTags->getAll(),
'selectedTags'=>array()
));
echo '</li>';
// ADVANCED TAB
// --------------------------------------------------------------------
echo '<li><h2 class="sidebar-button" data-view="sidebar-advanced-view"><i class="uk-icon-angle-down"></i> ADVANCED</h2></li>';
echo '<li id="sidebar-advanced-view" class="sidebar-view">';
// Status input // Status input
HTML::formSelect(array( HTML::formSelect(array(
@ -149,6 +156,25 @@ $(document).ready(function() {
checkSlugPost(slug, "", $("#jsslug")); checkSlugPost(slug, "", $("#jsslug"));
}); });
// Button Save as draft
$("#jsSaveDraft").on("click", function() {
$("#jsstatus").val("draft");
$(".uk-form").submit();
});
// Right sidebar
$(".sidebar-button").click(function() {
var view = "#" + $(this).data("view");
if( $(view).is(":visible") ) {
$(view).hide();
}
else {
$(".sidebar-view").hide();
$(view).show();
}
});
}); });
</script> </script>

View File

@ -1,10 +1,10 @@
<?php defined('BLUDIT') or die('Bludit CMS.'); <?php defined('BLUDIT') or die('Bludit CMS.');
// Bludit version // Bludit version
define('BLUDIT_VERSION', '1.5.2'); define('BLUDIT_VERSION', '1.6-beta');
define('BLUDIT_CODENAME', 'Learning To Fly'); define('BLUDIT_CODENAME', '');
define('BLUDIT_RELEASE_DATE', '2016-10-11'); define('BLUDIT_RELEASE_DATE', '');
define('BLUDIT_BUILD', '20161011'); define('BLUDIT_BUILD', '');
// Debug mode // Debug mode
// Change to FALSE, for prevent warning or error on browser // Change to FALSE, for prevent warning or error on browser
@ -59,6 +59,9 @@ if(!defined('JSON_PRETTY_PRINT')) {
// Protecting against Symlink attacks. // Protecting against Symlink attacks.
define('CHECK_SYMBOLIC_LINKS', TRUE); define('CHECK_SYMBOLIC_LINKS', TRUE);
// Auto scroll
define('AUTO_SCROLL', TRUE);
// Alert status ok // Alert status ok
define('ALERT_STATUS_OK', 0); define('ALERT_STATUS_OK', 0);

View File

@ -247,5 +247,7 @@
"сurrent-status" : "Status", "сurrent-status" : "Status",
"disable-the-user" : "Disable the user", "disable-the-user" : "Disable the user",
"add-a-new-page": "Add a new page", "add-a-new-page": "Add a new page",
"add-a-new-post": "Add a new post" "add-a-new-post": "Add a new post",
"save-as-draft": "Save as draft"
} }

View File

@ -12,6 +12,23 @@ if(version_compare(phpversion(), '5.3', '<')) {
exit('Current PHP version '.phpversion().', you need > 5.3. (ERR_202)'); exit('Current PHP version '.phpversion().', you need > 5.3. (ERR_202)');
} }
// Check PHP modules
if(!extension_loaded('mbstring')) {
exit('PHP module mbstring is not installed. Check the requirements.');
}
if(!extension_loaded('json')) {
exit('PHP module json is not installed. Check the requirements.');
}
if(!extension_loaded('gd')) {
exit('PHP module gd is not installed. Check the requirements.');
}
if(!extension_loaded('dom')) {
exit('PHP module dom is not installed. Check the requirements.');
}
// Security constant // Security constant
define('BLUDIT', true); define('BLUDIT', true);
@ -184,14 +201,10 @@ function checkSystem()
{ {
$stdOut = array(); $stdOut = array();
$dirpermissions = 0755; $dirpermissions = 0755;
$phpModules = array();
if(function_exists('get_loaded_extensions')) {
$phpModules = get_loaded_extensions();
}
// Check .htaccess file for different webservers // Check .htaccess file for different webservers
if( !file_exists(PATH_ROOT.'.htaccess') ) { if( !file_exists(PATH_ROOT.'.htaccess') )
{
if ( !isset($_SERVER['SERVER_SOFTWARE']) || if ( !isset($_SERVER['SERVER_SOFTWARE']) ||
stripos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || stripos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false ||
@ -203,50 +216,9 @@ function checkSystem()
$tmp['title'] = 'File .htaccess'; $tmp['title'] = 'File .htaccess';
$tmp['errorText'] = $errorText; $tmp['errorText'] = $errorText;
array_push($stdOut, $tmp); array_push($stdOut, $tmp);
} }
} }
if(!in_array('gd', $phpModules))
{
$errorText = 'PHP module GD is not installed.';
error_log($errorText, 0);
$tmp['title'] = 'PHP module';
$tmp['errorText'] = $errorText;
array_push($stdOut, $tmp);
}
if(!in_array('dom', $phpModules))
{
$errorText = 'PHP module DOM is not installed. (ERR_203)';
error_log($errorText, 0);
$tmp['title'] = 'PHP module';
$tmp['errorText'] = $errorText;
array_push($stdOut, $tmp);
}
if(!in_array('json', $phpModules))
{
$errorText = 'PHP module JSON is not installed. (ERR_204)';
error_log($errorText, 0);
$tmp['title'] = 'PHP module';
$tmp['errorText'] = $errorText;
array_push($stdOut, $tmp);
}
if(!in_array('mbstring', $phpModules))
{
$errorText = 'PHP module Multibyte String (mbstring) is not installed. (ERR_206)';
error_log($errorText, 0);
$tmp['title'] = 'PHP module';
$tmp['errorText'] = $errorText;
array_push($stdOut, $tmp);
}
// Try to create the directory content // Try to create the directory content
@mkdir(PATH_CONTENT, $dirpermissions, true); @mkdir(PATH_CONTENT, $dirpermissions, true);