Merge branch 'bludit:main' into preview
This commit is contained in:
commit
825bd5f509
11 changed files with 184 additions and 71 deletions
|
@ -135,12 +135,21 @@
|
||||||
// Ctrl+S or Command+S
|
// Ctrl+S or Command+S
|
||||||
if ((event.ctrlKey || event.metaKey) && event.which == 83) {
|
if ((event.ctrlKey || event.metaKey) && event.which == 83) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
|
// Parse all custom fields inputs
|
||||||
var customFields = {}
|
var customFields = {}
|
||||||
$('input[name^="custom"]').each(function() {
|
$('input[name^="custom"]').each(function() {
|
||||||
var field = $(this).data('field')
|
var field = $(this).data('field')
|
||||||
var value = $(this).val()
|
var value = $(this).val()
|
||||||
customFields[field] = value
|
customFields[field] = value
|
||||||
});
|
});
|
||||||
|
$('select[name^="custom"]').each(function() {
|
||||||
|
var field = $(this).data('field');
|
||||||
|
var value = $(this).val();
|
||||||
|
customFields[field] = value;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create array with all inputs
|
||||||
var args = {
|
var args = {
|
||||||
slug: $('#friendlyURL').val(),
|
slug: $('#friendlyURL').val(),
|
||||||
title: $('#title').val(),
|
title: $('#title').val(),
|
||||||
|
@ -190,12 +199,20 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#btnSave').on('click', function() {
|
$('#btnSave').on('click', function() {
|
||||||
|
// Parse all custom fields inputs
|
||||||
var customFields = {}
|
var customFields = {}
|
||||||
$('input[name^="custom"]').each(function() {
|
$('input[name^="custom"]').each(function() {
|
||||||
var field = $(this).data('field')
|
var field = $(this).data('field')
|
||||||
var value = $(this).val()
|
var value = $(this).val()
|
||||||
customFields[field] = value
|
customFields[field] = value
|
||||||
});
|
});
|
||||||
|
$('select[name^="custom"]').each(function() {
|
||||||
|
var field = $(this).data('field');
|
||||||
|
var value = $(this).val();
|
||||||
|
customFields[field] = value;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create array with all inputs
|
||||||
var args = {
|
var args = {
|
||||||
slug: $('#friendlyURL').val(),
|
slug: $('#friendlyURL').val(),
|
||||||
title: $('#title').val(),
|
title: $('#title').val(),
|
||||||
|
@ -393,13 +410,20 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Parse all custom fields inputs
|
||||||
var customFields = {}
|
var customFields = {}
|
||||||
$('input[name^="custom"]').each(function() {
|
$('input[name^="custom"]').each(function() {
|
||||||
var field = $(this).data('field')
|
var field = $(this).data('field')
|
||||||
var value = $(this).val()
|
var value = $(this).val()
|
||||||
customFields[field] = value
|
customFields[field] = value
|
||||||
});
|
});
|
||||||
|
$('select[name^="custom"]').each(function() {
|
||||||
|
var field = $(this).data('field');
|
||||||
|
var value = $(this).val();
|
||||||
|
customFields[field] = value;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create array with all inputs
|
||||||
var args = {
|
var args = {
|
||||||
slug: $('#friendlyURL').val(),
|
slug: $('#friendlyURL').val(),
|
||||||
title: $('#title').val(),
|
title: $('#title').val(),
|
||||||
|
@ -697,12 +721,12 @@
|
||||||
'data' => array('field' => $field)
|
'data' => array('field' => $field)
|
||||||
));
|
));
|
||||||
} elseif ($options['type']=="bool") {
|
} elseif ($options['type']=="bool") {
|
||||||
echo Bootstrap::formCheckbox(array(
|
echo Bootstrap::formSelectBlock(array(
|
||||||
'name' => 'custom['.$field.']',
|
'name' => 'custom['.$field.']',
|
||||||
'label' => (isset($options['label'])?$options['label']:''),
|
'label' => (isset($options['label'])?$options['label']:''),
|
||||||
'placeholder'=>(isset($options['placeholder'])?$options['placeholder']:''),
|
'options' => array('true' => $L->g('Enabled'), 'false' => $L->g('Disabled')),
|
||||||
'checked'=>(($pageKey && $page->custom($field))?true:false),
|
'selected' => (($pageKey && $page->custom($field))?'true':'false'),
|
||||||
'labelForCheckbox'=>(isset($options['tip'])?$options['tip']:''),
|
'tip' => (isset($options['tip'])?$options['tip']:''),
|
||||||
'data' => array('field' => $field)
|
'data' => array('field' => $field)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -732,12 +756,12 @@
|
||||||
'data' => array('field' => $field)
|
'data' => array('field' => $field)
|
||||||
));
|
));
|
||||||
} elseif ($options['type']=="bool") {
|
} elseif ($options['type']=="bool") {
|
||||||
echo Bootstrap::formCheckbox(array(
|
echo Bootstrap::formSelectBlock(array(
|
||||||
'name' => 'custom['.$field.']',
|
'name' => 'custom['.$field.']',
|
||||||
'label' => (isset($options['label'])?$options['label']:''),
|
'label' => (isset($options['label'])?$options['label']:''),
|
||||||
'placeholder'=>(isset($options['placeholder'])?$options['placeholder']:''),
|
'options' => array('true' => $L->g('Enabled'), 'false' => $L->g('Disabled')),
|
||||||
'checked'=>(($pageKey && $page->custom($field))?true:false),
|
'selected' => (($pageKey && $page->custom($field))?'true':'false'),
|
||||||
'labelForCheckbox'=>(isset($options['tip'])?$options['tip']:''),
|
'tip' => (isset($options['tip'])?$options['tip']:''),
|
||||||
'data' => array('field' => $field)
|
'data' => array('field' => $field)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -810,6 +834,37 @@
|
||||||
</script>
|
</script>
|
||||||
<!-- End Tags -->
|
<!-- End Tags -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Custom fields menu position -->
|
||||||
|
<?php
|
||||||
|
$customFields = $site->customFields();
|
||||||
|
foreach ($customFields as $field=>$options) {
|
||||||
|
if ( isset($options['position']) && ($options['position']=='menu') ) {
|
||||||
|
if ($options['type']=="string") {
|
||||||
|
echo '<h6 class="text-uppercase mt-4">'.(isset($options['label'])?$options['label']:'').'</h6>';
|
||||||
|
echo Bootstrap::formInputTextBlock(array(
|
||||||
|
'name'=>'custom['.$field.']',
|
||||||
|
'value'=>(($pageKey && $page->custom($field))?$page->custom($field):''),
|
||||||
|
'tip'=>(isset($options['tip'])?$options['tip']:''),
|
||||||
|
'placeholder'=>(isset($options['placeholder'])?$options['placeholder']:''),
|
||||||
|
'class'=>'',
|
||||||
|
'data' => array('field' => $field)
|
||||||
|
));
|
||||||
|
} elseif ($options['type']=="bool") {
|
||||||
|
echo '<h6 class="text-uppercase mt-4">'.(isset($options['label'])?$options['label']:'').'</h6>';
|
||||||
|
echo Bootstrap::formSelectBlock(array(
|
||||||
|
'name' => 'custom['.$field.']',
|
||||||
|
'label' => '',
|
||||||
|
'options' => array('true' => $L->g('Enabled'), 'false' => $L->g('Disabled')),
|
||||||
|
'selected' => (($pageKey && $page->custom($field))?true:false),
|
||||||
|
'tip' => (isset($options['tip'])?$options['tip']:''),
|
||||||
|
'data' => array('field' => $field)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<h6 class="text-uppercase mt-4"><?php $L->p('More options') ?></h6>
|
<h6 class="text-uppercase mt-4"><?php $L->p('More options') ?></h6>
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
<li class="list-group-item p-0 pt-3 bg-transparent border-0"><a onclick="fmOpen()" href="#"><i class="bi bi-files"></i><?php $L->p('Files & images') ?></a></li>
|
<li class="list-group-item p-0 pt-3 bg-transparent border-0"><a onclick="fmOpen()" href="#"><i class="bi bi-files"></i><?php $L->p('Files & images') ?></a></li>
|
||||||
|
|
|
@ -24,9 +24,10 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php
|
<img class="mx-auto d-block w-25 mb-4" alt="logo" src="<?php echo HTML_PATH_CORE_IMG . 'logo.svg' ?>" />
|
||||||
|
<h1 class="text-center text-uppercase mb-4"><?php echo $site->title() ?></h1>
|
||||||
|
|
||||||
echo '<h1 class="text-center fw-normal mb-5">'.$site->title().'</h1>';
|
<?php
|
||||||
|
|
||||||
echo Bootstrap::formOpen(array('name'=>'login'));
|
echo Bootstrap::formOpen(array('name'=>'login'));
|
||||||
|
|
||||||
|
@ -60,7 +61,7 @@ echo Bootstrap::formOpen(array('name'=>'login'));
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<button type="submit" class="btn btn-primary btn-lg me-2 w-100" name="save">'.$L->g('Login').'</button>
|
<button type="submit" class="btn btn-secondary btn-lg me-2 w-100" name="save">'.$L->g('Login').'</button>
|
||||||
</div>
|
</div>
|
||||||
';
|
';
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,12 @@
|
||||||
args[key] = value;
|
args[key] = value;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!isJson($('#customFields').val())) {
|
||||||
|
logs('Invalid JSON format for custom fields.');
|
||||||
|
showAlertError("<?php $L->p('Invalid JSON format for custom fields') ?>");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
api.saveSettings(args).then(function(response) {
|
api.saveSettings(args).then(function(response) {
|
||||||
if (response.status == 0) {
|
if (response.status == 0) {
|
||||||
logs('Settings saved.');
|
logs('Settings saved.');
|
||||||
|
@ -685,7 +691,8 @@
|
||||||
'value' => json_encode($site->customFields(), JSON_PRETTY_PRINT),
|
'value' => json_encode($site->customFields(), JSON_PRETTY_PRINT),
|
||||||
'tip' => $L->g('define-custom-fields-for-the-content'),
|
'tip' => $L->g('define-custom-fields-for-the-content'),
|
||||||
'rows' => 15,
|
'rows' => 15,
|
||||||
'data' => array('save' => 'true')
|
'data' => array('save' => 'true'),
|
||||||
|
'disable-current-value' => false
|
||||||
));
|
));
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,17 +7,16 @@ define('BLUDIT_RELEASE_DATE', '2021-05-23');
|
||||||
define('BLUDIT_BUILD', '20210523');
|
define('BLUDIT_BUILD', '20210523');
|
||||||
|
|
||||||
// Debug mode
|
// Debug mode
|
||||||
// Change to FALSE, for prevent warning or errors on browser
|
|
||||||
define('DEBUG_MODE', TRUE);
|
define('DEBUG_MODE', TRUE);
|
||||||
define('DEBUG_TYPE', 'INFO'); // INFO, TRACE
|
define('DEBUG_TYPE', 'INFO'); // INFO, TRACE
|
||||||
error_reporting(0); // Turn off all error reporting
|
error_reporting(0); // Turn off all error reporting
|
||||||
if (DEBUG_MODE) {
|
ini_set("display_errors", 0); // Turn off display errors in browser
|
||||||
// Turn on all error reporting
|
|
||||||
ini_set("display_errors", 0);
|
|
||||||
ini_set('display_startup_errors', 0);
|
ini_set('display_startup_errors', 0);
|
||||||
|
if (DEBUG_MODE) {
|
||||||
|
// Turn on all error reporting, will be display in log server
|
||||||
ini_set("html_errors", 1);
|
ini_set("html_errors", 1);
|
||||||
ini_set('log_errors', 1);
|
ini_set('log_errors', 1);
|
||||||
error_reporting(E_ALL | E_STRICT | E_NOTICE);
|
error_reporting(E_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// PHP paths
|
// PHP paths
|
||||||
|
|
|
@ -8,7 +8,7 @@ class Bootstrap {
|
||||||
$id = isset($args['id'])?$args['id']:$name;
|
$id = isset($args['id'])?$args['id']:$name;
|
||||||
$value = isset($args['value'])?$args['value']:'';
|
$value = isset($args['value'])?$args['value']:'';
|
||||||
|
|
||||||
return '<input type="hidden" id="'.$id.'" name="'.$name.'" value="'.$value.'">';
|
return '<input type="hidden" id="'.$id.'" name="'.$name.'" value="'.$value.'" autocomplete="off">';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Floating Labels
|
// Floating Labels
|
||||||
|
@ -30,7 +30,7 @@ class Bootstrap {
|
||||||
|
|
||||||
return <<<EOF
|
return <<<EOF
|
||||||
<div class="form-floating mb-3">
|
<div class="form-floating mb-3">
|
||||||
<input type="$type" class="$class" id="$id" name="$name" value="$value" placeholder="$placeholder">
|
<input type="$type" class="$class" id="$id" name="$name" value="$value" placeholder="$placeholder" autocomplete="off">
|
||||||
<label for="$id">$label</label>
|
<label for="$id">$label</label>
|
||||||
</div>
|
</div>
|
||||||
EOF;
|
EOF;
|
||||||
|
@ -84,15 +84,30 @@ EOF;
|
||||||
$class = $class.' '.$args['class'];
|
$class = $class.' '.$args['class'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$html = '<div>';
|
$tip = '';
|
||||||
if (!empty($args['label'])) {
|
if (!empty($args['tip'])) {
|
||||||
$html .= '<label for="'.$id.'">'.$args['label'].'</label>';
|
$tip = '<div class="form-text">'.$args['tip'].'</div>';
|
||||||
}
|
}
|
||||||
$html .= '<select id="'.$id.'" name="'.$name.'" class="'.$class.'">';
|
|
||||||
|
$data = 'data-current-value="'.$args['selected'].'"';
|
||||||
|
if (isset($args['data'])) {
|
||||||
|
if (is_array($args['data'])) {
|
||||||
|
foreach ($args['data'] as $x => $y) {
|
||||||
|
$data .= 'data-'.$x.' = "'.$y.'"';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$html = '<div class="mb-2">';
|
||||||
|
if (!empty($args['label'])) {
|
||||||
|
$html .= '<label class="col-sm-2 col-form-label" for="'.$id.'">'.$args['label'].'</label>';
|
||||||
|
}
|
||||||
|
$html .= '<select id="'.$id.'" name="'.$name.'" class="'.$class.'" '.$data.'>';
|
||||||
foreach ($args['options'] as $key=>$value) {
|
foreach ($args['options'] as $key=>$value) {
|
||||||
$html .= '<option '.(($key==$args['selected'])?'selected':'').' value="'.$key.'">'.$value.'</option>';
|
$html .= '<option '.(($key==$args['selected'])?'selected':'').' value="'.$key.'">'.$value.'</option>';
|
||||||
}
|
}
|
||||||
$html .= '</select>';
|
$html .= '</select>';
|
||||||
|
$html .= $tip;
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
|
@ -121,7 +136,9 @@ EOF;
|
||||||
$class = $class.' '.$args['class'];
|
$class = $class.' '.$args['class'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($args['disable-current-value'])) {
|
||||||
$data = 'data-current-value="'.$value.'"';
|
$data = 'data-current-value="'.$value.'"';
|
||||||
|
}
|
||||||
if (isset($args['data'])) {
|
if (isset($args['data'])) {
|
||||||
if (is_array($args['data'])) {
|
if (is_array($args['data'])) {
|
||||||
foreach ($args['data'] as $x => $y) {
|
foreach ($args['data'] as $x => $y) {
|
||||||
|
@ -179,7 +196,7 @@ return <<<EOF
|
||||||
<div class="mb-3 row">
|
<div class="mb-3 row">
|
||||||
$label
|
$label
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input class="$class" $data id="$id" name="$name" value="$value" placeholder="$placeholder" type="$type" $disabled $readonly>
|
<input class="$class" $data id="$id" name="$name" value="$value" placeholder="$placeholder" type="$type" autocomplete="off" $disabled $readonly>
|
||||||
$tip
|
$tip
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -263,7 +280,7 @@ EOF;
|
||||||
return <<<EOF
|
return <<<EOF
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
$label
|
$label
|
||||||
<input class="$class" $data id="$id" name="$name" value="$value" placeholder="$placeholder" type="$type" $disabled $readonly>
|
<input class="$class" $data id="$id" name="$name" value="$value" placeholder="$placeholder" type="$type" autocomplete="off" $disabled $readonly>
|
||||||
$tip
|
$tip
|
||||||
</div>
|
</div>
|
||||||
EOF;
|
EOF;
|
||||||
|
@ -285,7 +302,7 @@ EOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
$html = '<div class="'.$class.'">';
|
$html = '<div class="'.$class.'">';
|
||||||
$html .= '<input type="file" class="custom-file-input" id="'.$id.'">';
|
$html .= '<input type="file" class="custom-file-input" id="'.$id.'" autocomplete="off">';
|
||||||
$html .= '<label class="custom-file-label" for="'.$id.'">'.$args['label'].'</label>';
|
$html .= '<label class="custom-file-label" for="'.$id.'">'.$args['label'].'</label>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
|
@ -369,7 +386,7 @@ return <<<EOF
|
||||||
<div class="$class">
|
<div class="$class">
|
||||||
$label
|
$label
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input type="hidden" $data name="$name" value="$value"><input id="$id" type="checkbox" class="form-check-input" onclick="this.previousSibling.value=1-this.previousSibling.value" $checked>
|
<input type="hidden" $data name="$name" value="$value" autocomplete="off"><input id="$id" type="checkbox" class="form-check-input" onclick="this.previousSibling.value=1-this.previousSibling.value" autocomplete="off" $checked>
|
||||||
<label class="form-check-label" for="$id">$labelForCheckbox</label>
|
<label class="form-check-label" for="$id">$labelForCheckbox</label>
|
||||||
$tip
|
$tip
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -126,6 +126,13 @@ class Text {
|
||||||
return str_replace(array_keys($replace), array_values($replace), $text);
|
return str_replace(array_keys($replace), array_values($replace), $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove HTML entities from the string
|
||||||
|
// HTML entities: & " ' < >
|
||||||
|
public static function removeHTMLEntities($string)
|
||||||
|
{
|
||||||
|
return preg_replace("/&#?[a-z0-9]+;/i", "", $string);
|
||||||
|
}
|
||||||
|
|
||||||
public static function removeSpecialCharacters($string, $replace='')
|
public static function removeSpecialCharacters($string, $replace='')
|
||||||
{
|
{
|
||||||
return preg_replace("/[\/_|+:!@#$%^&*()'\"<>\\\`}{;=,?\[\]~. -]+/", $replace, $string);
|
return preg_replace("/[\/_|+:!@#$%^&*()'\"<>\\\`}{;=,?\[\]~. -]+/", $replace, $string);
|
||||||
|
@ -156,6 +163,8 @@ class Text {
|
||||||
{
|
{
|
||||||
global $L;
|
global $L;
|
||||||
|
|
||||||
|
$string = self::removeHTMLEntities($string);
|
||||||
|
|
||||||
if (EXTREME_FRIENDLY_URL && $allowExtremeFriendlyURL) {
|
if (EXTREME_FRIENDLY_URL && $allowExtremeFriendlyURL) {
|
||||||
$string = self::lowercase($string);
|
$string = self::lowercase($string);
|
||||||
$string = trim($string, $separator);
|
$string = trim($string, $separator);
|
||||||
|
@ -176,6 +185,7 @@ class Text {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clean
|
||||||
$string = preg_replace("/[^a-zA-Z0-9\/_|+. -]/", '', $string);
|
$string = preg_replace("/[^a-zA-Z0-9\/_|+. -]/", '', $string);
|
||||||
$string = self::lowercase($string);
|
$string = self::lowercase($string);
|
||||||
$string = preg_replace("/[\/_|+ -]+/", $separator, $string);
|
$string = preg_replace("/[\/_|+ -]+/", $separator, $string);
|
||||||
|
|
|
@ -56,3 +56,15 @@ function formatBytes(bytes, decimals = 2) {
|
||||||
|
|
||||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Returns TRUE if the JSON text is valid, FALSE otherwise
|
||||||
|
*/
|
||||||
|
function isJson(text) {
|
||||||
|
try {
|
||||||
|
JSON.parse(text);
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
|
@ -213,7 +213,15 @@ class Pages extends dbJSON {
|
||||||
$html = Sanitize::html($customValue);
|
$html = Sanitize::html($customValue);
|
||||||
// Store the custom field as defined type
|
// Store the custom field as defined type
|
||||||
if (isset($customFields[$customField])) {
|
if (isset($customFields[$customField])) {
|
||||||
|
if ($customFields[$customField]['type']=='bool') {
|
||||||
|
if ($html==='false' or $html===false) {
|
||||||
|
$html = false;
|
||||||
|
} else {
|
||||||
|
$html = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
settype($html, $customFields[$customField]['type']);
|
settype($html, $customFields[$customField]['type']);
|
||||||
|
}
|
||||||
$row['custom'][$customField]['value'] = $html;
|
$row['custom'][$customField]['value'] = $html;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -853,12 +861,8 @@ class Pages extends dbJSON {
|
||||||
// The structure for the custom fields need to be a valid JSON format
|
// The structure for the custom fields need to be a valid JSON format
|
||||||
// The custom fields are incremental, this means the custom fields are never deleted
|
// The custom fields are incremental, this means the custom fields are never deleted
|
||||||
// The pages only store the value of the custom field, the structure of the custom fields are in the database site.php
|
// The pages only store the value of the custom field, the structure of the custom fields are in the database site.php
|
||||||
public function setCustomFields($fields)
|
public function setCustomFields($customFields)
|
||||||
{
|
{
|
||||||
$customFields = json_decode($fields, true);
|
|
||||||
if (json_last_error() != JSON_ERROR_NONE) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
foreach ($this->db as $pageKey=>$pageFields) {
|
foreach ($this->db as $pageKey=>$pageFields) {
|
||||||
foreach ($customFields as $customField=>$customValues) {
|
foreach ($customFields as $customField=>$customValues) {
|
||||||
if (!isset($pageFields['custom'][$customField])) {
|
if (!isset($pageFields['custom'][$customField])) {
|
||||||
|
@ -870,7 +874,6 @@ class Pages extends dbJSON {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->save();
|
return $this->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,18 +9,18 @@ $examples = array(
|
||||||
'description' => 'A warm welcome to your new website.',
|
'description' => 'A warm welcome to your new website.',
|
||||||
'tags' => array('Welcome', 'Plugins', 'Themes', 'Bludit'),
|
'tags' => array('Welcome', 'Plugins', 'Themes', 'Bludit'),
|
||||||
'content' =>
|
'content' =>
|
||||||
'<p>Thanks for chose Bludit and welcome to our community, we are growing up everyday and is awesome.</p>
|
'<p>Thank you for choosing Bludit and welcome to our community, we are growing every day and it\'s amazing.</p>
|
||||||
<p>Follow Bludit in different social networks:</p>
|
<p>Follow Bludit on different social networks:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://twitter.com/bludit">https://twitter.com/bludit</a></li>
|
<li><a href="https://twitter.com/bludit">https://twitter.com/bludit</a></li>
|
||||||
<li><a href="https://www.facebook.com/bluditcms">https://www.facebook.com/bluditcms</a></li>
|
<li><a href="https://www.facebook.com/bluditcms">https://www.facebook.com/bluditcms</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Take a look to the plugins and themes:</p>
|
<p>Take a look at the plugins and themes:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://plugins.bludit.com">https://plugins.bludit.com</a></li>
|
<li><a href="https://plugins.bludit.com">https://plugins.bludit.com</a></li>
|
||||||
<li><a href="https://themes.bludit.com">https://themes.bludit.com</a></li>
|
<li><a href="https://themes.bludit.com">https://themes.bludit.com</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Do you need support or you want to read about Bludit, check our official documentation or participate in our forum.</p>
|
<p>Do you need support? or want to read about Bludit, consult our official documentation or participate in our forum</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://forum.bludit.org">https://forum.bludit.org</a></li>
|
<li><a href="https://forum.bludit.org">https://forum.bludit.org</a></li>
|
||||||
<li><a href="https://docs.bludit.com">https://docs.bludit.com</a></li>
|
<li><a href="https://docs.bludit.com">https://docs.bludit.com</a></li>
|
||||||
|
@ -36,7 +36,7 @@ $examples = array(
|
||||||
'tags' => array('Language', 'Timezone', 'Markdown', 'Bludit'),
|
'tags' => array('Language', 'Timezone', 'Markdown', 'Bludit'),
|
||||||
'content' =>
|
'content' =>
|
||||||
'<h2>Site information</h2>
|
'<h2>Site information</h2>
|
||||||
<p>Improve your site information and metadata. Include a site description to refine your ranking on the search engines, add social networks, include a site logo with your brand.</p>
|
<p>Improve your site information and metadata. Include a site description to refine your ranking on the search engines, add social networks, and include a site logo with your brand.</p>
|
||||||
<h2>Language and Timezone</h2>
|
<h2>Language and Timezone</h2>
|
||||||
<p>Bludit supports a variety of languages and time zones. Choose the option that best suits you and your visitors.</p>
|
<p>Bludit supports a variety of languages and time zones. Choose the option that best suits you and your visitors.</p>
|
||||||
<h2>Admin panel</h2>
|
<h2>Admin panel</h2>
|
||||||
|
@ -48,7 +48,7 @@ $examples = array(
|
||||||
<p>Bludit supports Markdown, you just need to enable the right editor to work with it.</p>
|
<p>Bludit supports Markdown, you just need to enable the right editor to work with it.</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>Go to the Admin panel</li>
|
<li>Go to the Admin panel</li>
|
||||||
<li>Go to Plugins section</li>
|
<li>Go to the plugins section</li>
|
||||||
<li>Disable TinyMCE plugin</li>
|
<li>Disable TinyMCE plugin</li>
|
||||||
<li>Enable EasyMDE plugin</li>
|
<li>Enable EasyMDE plugin</li>
|
||||||
</ol>'
|
</ol>'
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"native": "Italiano (Italia)",
|
"native": "Italiano (Italia)",
|
||||||
"english-name": "Italian",
|
"english-name": "Italian",
|
||||||
"last-update": "2022-04-07",
|
"last-update": "2022-04-07",
|
||||||
"locale": "it, it_IT"
|
"locale": "it, it_IT",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Daniele La Pira https:\/\/github.com\/danielelapira",
|
"Daniele La Pira https:\/\/github.com\/danielelapira",
|
||||||
"Giuseppe Pignataro https:\/\/github.com\/fastbyte01",
|
"Giuseppe Pignataro https:\/\/github.com\/fastbyte01",
|
||||||
|
@ -285,18 +285,6 @@
|
||||||
"there-are-no-sticky-pages-at-this-moment": "Non c'è nessuna pagina sticky in questo momento.",
|
"there-are-no-sticky-pages-at-this-moment": "Non c'è nessuna pagina sticky in questo momento.",
|
||||||
"there-are-no-scheduled-pages-at-this-moment": "Non c'è nessuna pagina programmata in questo momento.",
|
"there-are-no-scheduled-pages-at-this-moment": "Non c'è nessuna pagina programmata in questo momento.",
|
||||||
"update": "Aggiorna",
|
"update": "Aggiorna",
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"template": "Template",
|
"template": "Template",
|
||||||
"nickname": "Nickname",
|
"nickname": "Nickname",
|
||||||
"disable-user": "Disabilita utente",
|
"disable-user": "Disabilita utente",
|
||||||
|
@ -308,7 +296,6 @@
|
||||||
"extreme-friendly-url": "URL estremamente friendly",
|
"extreme-friendly-url": "URL estremamente friendly",
|
||||||
"title-formats": "Formati titolo",
|
"title-formats": "Formati titolo",
|
||||||
"delete-content": "Elimina contenuto",
|
"delete-content": "Elimina contenuto",
|
||||||
|
|
||||||
"sticky": "Sticky",
|
"sticky": "Sticky",
|
||||||
"actions": "Azioni",
|
"actions": "Azioni",
|
||||||
"edit": "Modifica",
|
"edit": "Modifica",
|
||||||
|
@ -335,8 +322,6 @@
|
||||||
"allow-unicode": "Permetti Unicode",
|
"allow-unicode": "Permetti Unicode",
|
||||||
"allow-unicode-characters-in-the-url-and-some-part-of-the-system": "Permette i caratteri Unicode nell'URL e in alcune parti del sistema.",
|
"allow-unicode-characters-in-the-url-and-some-part-of-the-system": "Permette i caratteri Unicode nell'URL e in alcune parti del sistema.",
|
||||||
"variables-allowed": "Variabili permesse",
|
"variables-allowed": "Variabili permesse",
|
||||||
|
|
||||||
|
|
||||||
"tag": "Tag",
|
"tag": "Tag",
|
||||||
"drag-and-drop-to-sort-the-plugins": "Sposta e trascina per ordinare i plugin.",
|
"drag-and-drop-to-sort-the-plugins": "Sposta e trascina per ordinare i plugin.",
|
||||||
"seo": "SEO",
|
"seo": "SEO",
|
||||||
|
@ -393,7 +378,7 @@
|
||||||
"custom-fields": "Campi personalizzati",
|
"custom-fields": "Campi personalizzati",
|
||||||
"define-custom-fields-for-the-content": "Definisci campi personalizzati per il contenuto. Scopri di più sui campi personalizzati nella <a href='https:\/\/docs.bludit.com\/en\/content\/custom-fields'>documentazione<\/a>.",
|
"define-custom-fields-for-the-content": "Definisci campi personalizzati per il contenuto. Scopri di più sui campi personalizzati nella <a href='https:\/\/docs.bludit.com\/en\/content\/custom-fields'>documentazione<\/a>.",
|
||||||
"start-typing-to-see-a-list-of-suggestions": "Inizia a scrivere per vedere un elenco di suggerimenti.",
|
"start-typing-to-see-a-list-of-suggestions": "Inizia a scrivere per vedere un elenco di suggerimenti.",
|
||||||
"view": "Visualizza"
|
"view": "Visualizza",
|
||||||
"confirm": "Conferma",
|
"confirm": "Conferma",
|
||||||
"current-password": "Password attuale",
|
"current-password": "Password attuale",
|
||||||
"are-you-sure-you-want-to-disable-this-user": "Sei sicuro di voler disabilitare questo utente?",
|
"are-you-sure-you-want-to-disable-this-user": "Sei sicuro di voler disabilitare questo utente?",
|
||||||
|
|
26
install.php
26
install.php
|
@ -44,6 +44,31 @@ if ($modulesRequiredExit) {
|
||||||
// Bludit constanst, variables, language and locale settings
|
// Bludit constanst, variables, language and locale settings
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
|
// Bludit version
|
||||||
|
define('BLUDIT_VERSION', '4.0.0');
|
||||||
|
define('BLUDIT_CODENAME', '');
|
||||||
|
define('BLUDIT_RELEASE_DATE', '2021-05-23');
|
||||||
|
define('BLUDIT_BUILD', '20210523');
|
||||||
|
|
||||||
|
// Log
|
||||||
|
define('LOG_SEP', ' | ');
|
||||||
|
define('LOG_TYPE_INFO', '[INFO]');
|
||||||
|
define('LOG_TYPE_WARN', '[WARN]');
|
||||||
|
define('LOG_TYPE_ERROR', '[ERROR]');
|
||||||
|
|
||||||
|
// Debug mode
|
||||||
|
define('DEBUG_MODE', TRUE);
|
||||||
|
define('DEBUG_TYPE', 'INFO'); // INFO, TRACE
|
||||||
|
error_reporting(0); // Turn off all error reporting
|
||||||
|
ini_set("display_errors", 0); // Turn off display errors in browser
|
||||||
|
ini_set('display_startup_errors', 0);
|
||||||
|
if (DEBUG_MODE) {
|
||||||
|
// Turn on all error reporting, will be display in log server
|
||||||
|
ini_set("html_errors", 1);
|
||||||
|
ini_set('log_errors', 1);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
}
|
||||||
|
|
||||||
// Security constant
|
// Security constant
|
||||||
define('BLUDIT', true);
|
define('BLUDIT', true);
|
||||||
|
|
||||||
|
@ -70,7 +95,6 @@ define('PATH_ABSTRACT', PATH_KERNEL . 'abstract' . DS);
|
||||||
// Protecting against Symlink attacks
|
// Protecting against Symlink attacks
|
||||||
define('CHECK_SYMBOLIC_LINKS', TRUE);
|
define('CHECK_SYMBOLIC_LINKS', TRUE);
|
||||||
define('FILENAME', 'index.txt');
|
define('FILENAME', 'index.txt');
|
||||||
define('LOG_SEP', ' | ');
|
|
||||||
define('DB_DATE_FORMAT', 'Y-m-d H:i:s');
|
define('DB_DATE_FORMAT', 'Y-m-d H:i:s');
|
||||||
define('CHARSET', 'UTF-8');
|
define('CHARSET', 'UTF-8');
|
||||||
define('DEFAULT_LANGUAGE_FILE', 'en.json');
|
define('DEFAULT_LANGUAGE_FILE', 'en.json');
|
||||||
|
|
Loading…
Add table
Reference in a new issue