Installer improves
This commit is contained in:
parent
9594be73e0
commit
5d70ba3171
|
@ -8,6 +8,10 @@ a:hover {
|
||||||
text-decoration: none !important;
|
text-decoration: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------- FONTS AWESOME ----------- */
|
/* ----------- FONTS AWESOME ----------- */
|
||||||
.fa-right {
|
.fa-right {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
|
@ -16,7 +20,7 @@ a:hover {
|
||||||
/* ----------- ----------- */
|
/* ----------- ----------- */
|
||||||
div.main {
|
div.main {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 30px 0;
|
margin: 50px 0 0 0;
|
||||||
}
|
}
|
||||||
h1.title {
|
h1.title {
|
||||||
font-weight: lighter;
|
font-weight: lighter;
|
||||||
|
@ -27,6 +31,10 @@ td {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.boxInstallerForm {
|
||||||
|
margin-top: 30px !important;
|
||||||
|
}
|
||||||
|
|
||||||
.tools-message {
|
.tools-message {
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
@ -23,7 +23,7 @@ define('BLUDIT', true);
|
||||||
// Directory separator
|
// Directory separator
|
||||||
define('DS', DIRECTORY_SEPARATOR);
|
define('DS', DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
// PHP paths
|
// PHP paths for init
|
||||||
define('PATH_ROOT', __DIR__.DS);
|
define('PATH_ROOT', __DIR__.DS);
|
||||||
define('PATH_BOOT', PATH_ROOT.'kernel'.DS.'boot'.DS);
|
define('PATH_BOOT', PATH_ROOT.'kernel'.DS.'boot'.DS);
|
||||||
|
|
||||||
|
|
154
install.php
154
install.php
|
@ -6,13 +6,14 @@
|
||||||
* Author Diego Najar
|
* Author Diego Najar
|
||||||
* Bludit is opensource software licensed under the MIT license.
|
* Bludit is opensource software licensed under the MIT license.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Security constant
|
// Security constant
|
||||||
define('BLUDIT', true);
|
define('BLUDIT', true);
|
||||||
|
|
||||||
// Directory separator
|
// Directory separator
|
||||||
define('DS', DIRECTORY_SEPARATOR);
|
define('DS', DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
// PATHs
|
// PHP paths
|
||||||
define('PATH_ROOT', __DIR__.DS);
|
define('PATH_ROOT', __DIR__.DS);
|
||||||
define('PATH_CONTENT', PATH_ROOT.'content'.DS);
|
define('PATH_CONTENT', PATH_ROOT.'content'.DS);
|
||||||
define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
|
define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
|
||||||
|
@ -30,6 +31,9 @@ define('DOMAIN', getenv('HTTP_HOST'));
|
||||||
$base = (dirname(getenv('SCRIPT_NAME'))==DS)?'/':dirname(getenv('SCRIPT_NAME')).'/';
|
$base = (dirname(getenv('SCRIPT_NAME'))==DS)?'/':dirname(getenv('SCRIPT_NAME')).'/';
|
||||||
define('HTML_PATH_ROOT', $base);
|
define('HTML_PATH_ROOT', $base);
|
||||||
|
|
||||||
|
// Log separator
|
||||||
|
define('LOG_SEP', ' | ');
|
||||||
|
|
||||||
// JSON
|
// JSON
|
||||||
if(!defined('JSON_PRETTY_PRINT')) {
|
if(!defined('JSON_PRETTY_PRINT')) {
|
||||||
define('JSON_PRETTY_PRINT', 128);
|
define('JSON_PRETTY_PRINT', 128);
|
||||||
|
@ -38,17 +42,18 @@ if(!defined('JSON_PRETTY_PRINT')) {
|
||||||
// Check if JSON encode and decode are enabled.
|
// Check if JSON encode and decode are enabled.
|
||||||
define('JSON', function_exists('json_encode'));
|
define('JSON', function_exists('json_encode'));
|
||||||
|
|
||||||
// Multibyte string / UTF-8
|
// Charset, default UTF-8.
|
||||||
define('MB_STRING', extension_loaded('mbstring'));
|
|
||||||
|
|
||||||
define('CHARSET', 'UTF-8');
|
define('CHARSET', 'UTF-8');
|
||||||
|
|
||||||
|
// Multibyte string extension loaded.
|
||||||
|
define('MB_STRING', extension_loaded('mbstring'));
|
||||||
|
|
||||||
if(MB_STRING)
|
if(MB_STRING)
|
||||||
{
|
{
|
||||||
// Tell PHP that we're using UTF-8 strings until the end of the script.
|
// Set internal character encoding.
|
||||||
mb_internal_encoding(CHARSET);
|
mb_internal_encoding(CHARSET);
|
||||||
|
|
||||||
// Tell PHP that we'll be outputting UTF-8 to the browser.
|
// Set HTTP output character encoding.
|
||||||
mb_http_output(CHARSET);
|
mb_http_output(CHARSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,15 +63,16 @@ include(PATH_HELPERS.'valid.class.php');
|
||||||
include(PATH_HELPERS.'text.class.php');
|
include(PATH_HELPERS.'text.class.php');
|
||||||
include(PATH_ABSTRACT.'dbjson.class.php');
|
include(PATH_ABSTRACT.'dbjson.class.php');
|
||||||
include(PATH_KERNEL.'dblanguage.class.php');
|
include(PATH_KERNEL.'dblanguage.class.php');
|
||||||
|
include(PATH_HELPERS.'log.class.php');
|
||||||
|
|
||||||
// Load language
|
// Load language
|
||||||
$HTTP_ACCEPT_LANGUAGE = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
$localeFromHTTP = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||||
if (file_exists(PATH_LANGUAGES.$HTTP_ACCEPT_LANGUAGE. '.json')) {
|
|
||||||
$locale = $HTTP_ACCEPT_LANGUAGE;
|
if(isset($_GET['language'])) {
|
||||||
} else {
|
$localeFromHTTP = Sanitize::html($_GET['language']);
|
||||||
$locale = 'en_US';
|
|
||||||
}
|
}
|
||||||
$Language = new dbLanguage($locale);
|
|
||||||
|
$Language = new dbLanguage($localeFromHTTP);
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// FUNCTIONS
|
// FUNCTIONS
|
||||||
|
@ -152,9 +158,9 @@ function checkSystem()
|
||||||
return $stdOut;
|
return $stdOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
function install($adminPassword, $email, $locale)
|
function install($adminPassword, $email)
|
||||||
{
|
{
|
||||||
$Language = new dbLanguage($locale);
|
global $Language;
|
||||||
|
|
||||||
$stdOut = array();
|
$stdOut = array();
|
||||||
|
|
||||||
|
@ -230,9 +236,9 @@ function install($adminPassword, $email, $locale)
|
||||||
'title'=>'Bludit',
|
'title'=>'Bludit',
|
||||||
'slogan'=>'cms',
|
'slogan'=>'cms',
|
||||||
'description'=>'',
|
'description'=>'',
|
||||||
'footer'=>'©2015',
|
'footer'=>'',
|
||||||
'language'=>$locale,
|
'language'=>$Language->getCurrentLocale(),
|
||||||
'locale'=>$locale,
|
'locale'=>$Language->getCurrentLocale(),
|
||||||
'timezone'=>'UTC',
|
'timezone'=>'UTC',
|
||||||
'theme'=>'pure',
|
'theme'=>'pure',
|
||||||
'adminTheme'=>'default',
|
'adminTheme'=>'default',
|
||||||
|
@ -303,10 +309,12 @@ Content:
|
||||||
|
|
||||||
function checkPOST($args)
|
function checkPOST($args)
|
||||||
{
|
{
|
||||||
|
global $Language;
|
||||||
|
|
||||||
// Check empty password
|
// Check empty password
|
||||||
if(empty($args['password']))
|
if(empty($args['password']))
|
||||||
{
|
{
|
||||||
return '<div>The password field is empty</div>';
|
return '<div>'.$Language->g('The password field is empty').'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check invalid email
|
// Check invalid email
|
||||||
|
@ -369,21 +377,37 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="units-row">
|
<div class="units-row">
|
||||||
<div class="unit-centered unit-60">
|
<div class="unit-centered unit-60">
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<h1 class="title"><?php echo $Language->get('Bludit Installer') ?></h1>
|
|
||||||
<p><?php echo $Language->get('Welcome to the Bludit installer') ?></p>
|
|
||||||
|
|
||||||
<?php
|
<h1 class="title"><?php echo $Language->get('Bludit Installer') ?></h1>
|
||||||
$system = checkSystem();
|
<p><?php echo $Language->get('Welcome to the Bludit installer') ?></p>
|
||||||
|
|
||||||
if(empty($system))
|
<?php
|
||||||
{
|
|
||||||
?>
|
|
||||||
|
|
||||||
<p><?php echo $Language->get('Complete the form, choose a password for the username « admin »') ?></p>
|
$system = checkSystem();
|
||||||
|
|
||||||
<div class="unit-centered unit-40">
|
// Missing requirements
|
||||||
|
if(!empty($system))
|
||||||
|
{
|
||||||
|
echo '<div class="unit-centered unit-50">';
|
||||||
|
echo '<table class="table-stripped">';
|
||||||
|
|
||||||
|
foreach($system as $value) {
|
||||||
|
echo '<tr><td>'.$value.'</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '</table>';
|
||||||
|
echo '</div>';
|
||||||
|
}
|
||||||
|
// Second step
|
||||||
|
elseif(isset($_GET['language']))
|
||||||
|
{
|
||||||
|
|
||||||
|
?>
|
||||||
|
<p><?php echo $Language->get('Complete the form choose a password for the username admin') ?></p>
|
||||||
|
|
||||||
|
<div class="boxInstallerForm unit-centered unit-40">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if(!empty($error)) {
|
if(!empty($error)) {
|
||||||
|
@ -394,66 +418,68 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
<form id="jsformInstaller" method="post" action="" class="forms" autocomplete="off">
|
<form id="jsformInstaller" method="post" action="" class="forms" autocomplete="off">
|
||||||
|
|
||||||
<input type="hidden" name="noCheckEmail" id="jsnoCheckEmail" value="0">
|
<input type="hidden" name="noCheckEmail" id="jsnoCheckEmail" value="0">
|
||||||
|
<input type="hidden" name="language" id="jslanguage" value="<?php echo $localeFromHTTP ?>">
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<input type="text" value="admin" disabled="disabled" class="width-100">
|
<input type="text" value="admin" disabled="disabled" class="width-100">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<input type="text" name="password" id="jspassword" placeholder="<?php echo $Language->get('Password, visible field!') ?>" class="width-100" autocomplete="off" maxlength="100" value="<?php echo isset($_POST['password'])?$_POST['password']:'' ?>">
|
<input type="text" name="password" id="jspassword" placeholder="<?php echo $Language->get('Password visible field') ?>" class="width-100" autocomplete="off" maxlength="100" value="<?php echo isset($_POST['password'])?$_POST['password']:'' ?>">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<input type="text" name="email" id="jsemail" placeholder="<?php echo $Language->get('Email') ?>" class="width-100" autocomplete="off" maxlength="100">
|
<input type="text" name="email" id="jsemail" placeholder="<?php echo $Language->get('Email') ?>" class="width-100" autocomplete="off" maxlength="100">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<p><button class="btn btn-blue width-100"><?php echo $Language->get('Install') ?></button>
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
} // END elseif(isset($_GET['language']))
|
||||||
|
else
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<p><?php echo $Language->get('Choose your language') ?></p>
|
||||||
|
|
||||||
|
<div class="boxInstallerForm unit-centered unit-40">
|
||||||
|
|
||||||
|
<form id="jsformLanguage" method="get" action="" class="forms" autocomplete="off">
|
||||||
|
|
||||||
<label for="jslanguage">
|
<label for="jslanguage">
|
||||||
<select id="jslanguage" name="language" class="width-100" onchange="this.form.submit()">
|
<select id="jslanguage" name="language" class="width-100">
|
||||||
<?php
|
<?php
|
||||||
$htmlOptions = getLanguageList();
|
$htmlOptions = getLanguageList();
|
||||||
foreach($htmlOptions as $locale=>$nativeName) {
|
foreach($htmlOptions as $locale=>$nativeName) {
|
||||||
echo '<option value="'.$locale.'">'.$nativeName.'</option>';
|
echo '<option value="'.$locale.'"'.( ($localeFromHTTP===$locale)?' selected="selected"':'').'>'.$nativeName.'</option>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<p>
|
<p><button class="btn btn-blue width-100"><?php echo $Language->get('Next') ?></button>
|
||||||
<button class="btn btn-blue width-100"><?php echo $Language->get('Install') ?></button>
|
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<?php
|
||||||
|
} // END else
|
||||||
|
?>
|
||||||
|
|
||||||
<?php
|
</div>
|
||||||
}
|
</div>
|
||||||
else
|
|
||||||
{
|
|
||||||
echo '<div class="unit-centered unit-50">';
|
|
||||||
echo '<table class="table-stripped">';
|
|
||||||
|
|
||||||
foreach ($system as $value)
|
<script>
|
||||||
{
|
$(document).ready(function()
|
||||||
echo '<tr><td>'.$value.'</td></tr>';
|
{
|
||||||
}
|
$("#jscompleteEmail").on("click", function() {
|
||||||
|
$("#jsnoCheckEmail").val("1");
|
||||||
echo '</table>';
|
if(!$("jspassword").val()) {
|
||||||
echo '</div';
|
$("#jsformInstaller").submit();
|
||||||
}
|
}
|
||||||
?>
|
});
|
||||||
</div>
|
});
|
||||||
</div>
|
</script>
|
||||||
|
|
||||||
<script>
|
|
||||||
$(document).ready(function()
|
|
||||||
{
|
|
||||||
$("#jscompleteEmail").on("click", function() {
|
|
||||||
$("#jsnoCheckEmail").val("1");
|
|
||||||
if(!$("jspassword").val()) {
|
|
||||||
$("#jsformInstaller").submit();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||||
|
|
||||||
|
// Bludit version
|
||||||
|
define('BLUDIT_VERSION', 'githubVersion');
|
||||||
|
define('BLUDIT_CODENAME', '');
|
||||||
|
define('BLUDIT_RELEASE_DATE', '');
|
||||||
|
|
||||||
// Debug mode
|
// Debug mode
|
||||||
define('DEBUG_MODE', TRUE);
|
define('DEBUG_MODE', TRUE);
|
||||||
|
error_reporting(0); // Turn off all error reporting
|
||||||
// Turn off all error reporting
|
|
||||||
error_reporting(0);
|
|
||||||
|
|
||||||
// Turn on all error reporting
|
|
||||||
if(DEBUG_MODE)
|
if(DEBUG_MODE)
|
||||||
{
|
{
|
||||||
|
// Turn on all error reporting
|
||||||
ini_set("display_errors", 1);
|
ini_set("display_errors", 1);
|
||||||
ini_set('display_startup_errors',1);
|
ini_set('display_startup_errors',1);
|
||||||
ini_set("track_errors", 1);
|
ini_set("track_errors", 1);
|
||||||
|
@ -16,35 +18,31 @@ if(DEBUG_MODE)
|
||||||
error_reporting(E_ALL | E_STRICT | E_NOTICE);
|
error_reporting(E_ALL | E_STRICT | E_NOTICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log separator
|
// PHP paths
|
||||||
define('LOG_SEP', ' | ');
|
|
||||||
|
|
||||||
// PHP PATHS
|
|
||||||
|
|
||||||
// PATH_ROOT and PATH_BOOT are defined in index.php
|
// PATH_ROOT and PATH_BOOT are defined in index.php
|
||||||
define('PATH_LANGUAGES', PATH_ROOT.'languages'.DS);
|
define('PATH_LANGUAGES', PATH_ROOT.'languages'.DS);
|
||||||
define('PATH_THEMES', PATH_ROOT.'themes'.DS);
|
define('PATH_THEMES', PATH_ROOT.'themes'.DS);
|
||||||
define('PATH_PLUGINS', PATH_ROOT.'plugins'.DS);
|
define('PATH_PLUGINS', PATH_ROOT.'plugins'.DS);
|
||||||
|
|
||||||
define('PATH_KERNEL', PATH_ROOT.'kernel'.DS);
|
define('PATH_KERNEL', PATH_ROOT.'kernel'.DS);
|
||||||
define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS);
|
define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS);
|
||||||
define('PATH_RULES', PATH_KERNEL.'boot'.DS.'rules'.DS);
|
define('PATH_RULES', PATH_KERNEL.'boot'.DS.'rules'.DS);
|
||||||
define('PATH_HELPERS', PATH_KERNEL.'helpers'.DS);
|
define('PATH_HELPERS', PATH_KERNEL.'helpers'.DS);
|
||||||
define('PATH_AJAX', PATH_KERNEL.'ajax'.DS);
|
define('PATH_AJAX', PATH_KERNEL.'ajax'.DS);
|
||||||
define('PATH_JS', PATH_KERNEL.'js'.DS);
|
define('PATH_JS', PATH_KERNEL.'js'.DS);
|
||||||
|
|
||||||
define('PATH_CONTENT', PATH_ROOT.'content'.DS);
|
define('PATH_CONTENT', PATH_ROOT.'content'.DS);
|
||||||
define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
|
define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
|
||||||
define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
|
define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
|
||||||
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
|
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
|
||||||
define('PATH_PLUGINS_DATABASES', PATH_CONTENT.'databases'.DS.'plugins'.DS);
|
define('PATH_PLUGINS_DATABASES', PATH_CONTENT.'databases'.DS.'plugins'.DS);
|
||||||
define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS);
|
define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS);
|
||||||
|
|
||||||
define('PATH_ADMIN', PATH_ROOT.'admin'.DS);
|
define('PATH_ADMIN', PATH_ROOT.'admin'.DS);
|
||||||
define('PATH_ADMIN_THEMES', PATH_ADMIN.'themes'.DS);
|
define('PATH_ADMIN_THEMES', PATH_ADMIN.'themes'.DS);
|
||||||
define('PATH_ADMIN_CONTROLLERS', PATH_ADMIN.'controllers'.DS);
|
define('PATH_ADMIN_CONTROLLERS', PATH_ADMIN.'controllers'.DS);
|
||||||
define('PATH_ADMIN_VIEWS', PATH_ADMIN.'views'.DS);
|
define('PATH_ADMIN_VIEWS', PATH_ADMIN.'views'.DS);
|
||||||
|
|
||||||
|
// Log separator
|
||||||
|
define('LOG_SEP', ' | ');
|
||||||
|
|
||||||
// JSON pretty print
|
// JSON pretty print
|
||||||
if(!defined('JSON_PRETTY_PRINT')) {
|
if(!defined('JSON_PRETTY_PRINT')) {
|
||||||
define('JSON_PRETTY_PRINT', 128);
|
define('JSON_PRETTY_PRINT', 128);
|
||||||
|
@ -56,56 +54,51 @@ define('SALT_LENGTH', 8);
|
||||||
// Page brake string
|
// Page brake string
|
||||||
define('PAGE_BREAK', '<!-- pagebreak -->');
|
define('PAGE_BREAK', '<!-- pagebreak -->');
|
||||||
|
|
||||||
// Bludit version
|
// No parent character
|
||||||
define('BLUDIT_VERSION', 'githubVersion');
|
|
||||||
define('BLUDIT_CODENAME', '');
|
|
||||||
define('BLUDIT_RELEASE_DATE', '');
|
|
||||||
|
|
||||||
//
|
|
||||||
define('NO_PARENT_CHAR', '—');
|
define('NO_PARENT_CHAR', '—');
|
||||||
|
|
||||||
// Post per page on Manage->Posts
|
// Post per page on Manage->Posts
|
||||||
define('POSTS_PER_PAGE_ADMIN', 10);
|
define('POSTS_PER_PAGE_ADMIN', 10);
|
||||||
|
|
||||||
// Multibyte string / UTF-8
|
|
||||||
define('MB_STRING', extension_loaded('mbstring'));
|
|
||||||
|
|
||||||
// Check if JSON encode and decode are enabled.
|
// Check if JSON encode and decode are enabled.
|
||||||
define('JSON', function_exists('json_encode'));
|
define('JSON', function_exists('json_encode'));
|
||||||
|
|
||||||
// TRUE if new posts hand-made set published, or FALSE for draft.
|
// TRUE if new posts hand-made set published, or FALSE for draft.
|
||||||
define('HANDMADE_PUBLISHED', true);
|
define('HANDMADE_PUBLISHED', true);
|
||||||
|
|
||||||
|
// Charset, default UTF-8.
|
||||||
define('CHARSET', 'UTF-8');
|
define('CHARSET', 'UTF-8');
|
||||||
|
|
||||||
|
// Multibyte string extension loaded.
|
||||||
|
define('MB_STRING', extension_loaded('mbstring'));
|
||||||
|
|
||||||
if(MB_STRING)
|
if(MB_STRING)
|
||||||
{
|
{
|
||||||
// Tell PHP that we're using UTF-8 strings until the end of the script.
|
// Set internal character encoding.
|
||||||
mb_internal_encoding(CHARSET);
|
mb_internal_encoding(CHARSET);
|
||||||
|
|
||||||
// Tell PHP that we'll be outputting UTF-8 to the browser.
|
// Set HTTP output character encoding.
|
||||||
mb_http_output(CHARSET);
|
mb_http_output(CHARSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Abstract Classes
|
// Inclde Abstract Classes
|
||||||
include(PATH_ABSTRACT.'dbjson.class.php');
|
include(PATH_ABSTRACT.'dbjson.class.php');
|
||||||
include(PATH_ABSTRACT.'filecontent.class.php');
|
include(PATH_ABSTRACT.'filecontent.class.php');
|
||||||
include(PATH_ABSTRACT.'plugin.class.php');
|
include(PATH_ABSTRACT.'plugin.class.php');
|
||||||
|
|
||||||
|
// Inclde Classes
|
||||||
include(PATH_KERNEL.'dbposts.class.php');
|
include(PATH_KERNEL.'dbposts.class.php');
|
||||||
include(PATH_KERNEL.'dbpages.class.php');
|
include(PATH_KERNEL.'dbpages.class.php');
|
||||||
include(PATH_KERNEL.'dbusers.class.php');
|
include(PATH_KERNEL.'dbusers.class.php');
|
||||||
include(PATH_KERNEL.'dblanguage.class.php');
|
include(PATH_KERNEL.'dblanguage.class.php');
|
||||||
include(PATH_KERNEL.'dbsite.class.php');
|
include(PATH_KERNEL.'dbsite.class.php');
|
||||||
|
|
||||||
include(PATH_KERNEL.'post.class.php');
|
include(PATH_KERNEL.'post.class.php');
|
||||||
include(PATH_KERNEL.'page.class.php');
|
include(PATH_KERNEL.'page.class.php');
|
||||||
|
|
||||||
include(PATH_KERNEL.'url.class.php');
|
include(PATH_KERNEL.'url.class.php');
|
||||||
include(PATH_KERNEL.'login.class.php');
|
include(PATH_KERNEL.'login.class.php');
|
||||||
include(PATH_KERNEL.'parsedown.class.php');
|
include(PATH_KERNEL.'parsedown.class.php');
|
||||||
|
|
||||||
// Helpers Classes
|
// Include Helpers Classes
|
||||||
include(PATH_HELPERS.'text.class.php');
|
include(PATH_HELPERS.'text.class.php');
|
||||||
include(PATH_HELPERS.'log.class.php');
|
include(PATH_HELPERS.'log.class.php');
|
||||||
include(PATH_HELPERS.'date.class.php');
|
include(PATH_HELPERS.'date.class.php');
|
||||||
|
@ -146,7 +139,7 @@ define('HTML_PATH_ADMIN_ROOT', HTML_PATH_ROOT.'admin/');
|
||||||
define('HTML_PATH_UPLOADS', HTML_PATH_ROOT.'content/uploads/');
|
define('HTML_PATH_UPLOADS', HTML_PATH_ROOT.'content/uploads/');
|
||||||
define('HTML_PATH_PLUGINS', HTML_PATH_ROOT.'plugins/');
|
define('HTML_PATH_PLUGINS', HTML_PATH_ROOT.'plugins/');
|
||||||
|
|
||||||
// PHP PATHs with dependency
|
// PHP paths with dependency
|
||||||
define('PATH_THEME', PATH_ROOT.'themes/'.$Site->theme().'/');
|
define('PATH_THEME', PATH_ROOT.'themes/'.$Site->theme().'/');
|
||||||
|
|
||||||
// Objects with dependency
|
// Objects with dependency
|
||||||
|
|
|
@ -5,5 +5,3 @@ if($Url->notFound())
|
||||||
{
|
{
|
||||||
header('HTTP/1.0 404 Not Found');
|
header('HTTP/1.0 404 Not Found');
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
|
@ -4,24 +4,27 @@ class dbLanguage extends dbJSON
|
||||||
{
|
{
|
||||||
public $data;
|
public $data;
|
||||||
public $db;
|
public $db;
|
||||||
|
public $currentLocale;
|
||||||
|
|
||||||
function __construct($language)
|
function __construct($locale)
|
||||||
{
|
{
|
||||||
$this->data = array();
|
$this->data = array();
|
||||||
$this->db = array();
|
$this->db = array();
|
||||||
|
$this->currentLocale = 'en_US';
|
||||||
|
|
||||||
// Default language en_US
|
// Default language en_US
|
||||||
$filename = PATH_LANGUAGES.'en_US.json';
|
$filename = PATH_LANGUAGES.'en_US.json';
|
||||||
if(file_exists($filename))
|
if( Sanitize::pathFile($filename) )
|
||||||
{
|
{
|
||||||
$Tmp = new dbJSON($filename, false);
|
$Tmp = new dbJSON($filename, false);
|
||||||
$this->db = array_merge($this->db, $Tmp->db);
|
$this->db = array_merge($this->db, $Tmp->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
// User language
|
// User language
|
||||||
$filename = PATH_LANGUAGES.$language.'.json';
|
$filename = PATH_LANGUAGES.$locale.'.json';
|
||||||
if( file_exists($filename) && ($language!=="en_US") )
|
if( Sanitize::pathFile($filename) && ($locale!=="en_US") )
|
||||||
{
|
{
|
||||||
|
$this->currentLocale = $locale;
|
||||||
$Tmp = new dbJSON($filename, false);
|
$Tmp = new dbJSON($filename, false);
|
||||||
$this->db = array_merge($this->db, $Tmp->db);
|
$this->db = array_merge($this->db, $Tmp->db);
|
||||||
}
|
}
|
||||||
|
@ -30,6 +33,11 @@ class dbLanguage extends dbJSON
|
||||||
unset($this->db['language-data']);
|
unset($this->db['language-data']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCurrentLocale()
|
||||||
|
{
|
||||||
|
return $this->currentLocale;
|
||||||
|
}
|
||||||
|
|
||||||
// Return the translation, if the translation does'n exist then return the English translation.
|
// Return the translation, if the translation does'n exist then return the English translation.
|
||||||
public function get($string)
|
public function get($string)
|
||||||
{
|
{
|
||||||
|
@ -73,7 +81,7 @@ class dbLanguage extends dbJSON
|
||||||
return $this->data[$key];
|
return $this->data[$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns an array with all dictionaries.
|
// Returns an array with all dictionaries.
|
||||||
|
|
|
@ -5,14 +5,14 @@ class dbPages extends dbJSON
|
||||||
private $parentKeyList = array();
|
private $parentKeyList = array();
|
||||||
|
|
||||||
private $dbFields = array(
|
private $dbFields = array(
|
||||||
'title'=> array('inFile'=>true, 'value'=>''),
|
'title'=> array('inFile'=>true, 'value'=>''),
|
||||||
'content'=> array('inFile'=>true, 'value'=>''),
|
'content'=> array('inFile'=>true, 'value'=>''),
|
||||||
'description'=> array('inFile'=>false, 'value'=>''),
|
'description'=> array('inFile'=>false, 'value'=>''),
|
||||||
'username'=> array('inFile'=>false, 'value'=>''),
|
'username'=> array('inFile'=>false, 'value'=>''),
|
||||||
'tags'=> array('inFile'=>false, 'value'=>''),
|
'tags'=> array('inFile'=>false, 'value'=>''),
|
||||||
'status'=> array('inFile'=>false, 'value'=>'draft'),
|
'status'=> array('inFile'=>false, 'value'=>'draft'),
|
||||||
'unixTimeCreated'=> array('inFile'=>false, 'value'=>0),
|
'unixTimeCreated'=> array('inFile'=>false, 'value'=>0),
|
||||||
'unixTimeModified'=>array('inFile'=>false, 'value'=>0),
|
'unixTimeModified'=> array('inFile'=>false, 'value'=>0),
|
||||||
'position'=> array('inFile'=>false, 'value'=>0)
|
'position'=> array('inFile'=>false, 'value'=>0)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,7 @@
|
||||||
"email": "",
|
"email": "",
|
||||||
"website": ""
|
"website": ""
|
||||||
},
|
},
|
||||||
|
|
||||||
"bludit-installer": "Bludit Installer",
|
|
||||||
"welcome-to-the-bludit-installer": "Welcome to the Bludit installer",
|
|
||||||
"complete-the-form,-choose-a-password-for-the-username-«-admin-»": "Complete the form, choose a password for the username « admin »",
|
|
||||||
"password,-visible-field!": "Password, visible field!",
|
|
||||||
"install": "Install",
|
|
||||||
"username": "Username",
|
"username": "Username",
|
||||||
"password": "Password",
|
"password": "Password",
|
||||||
"confirm-password": "Confirm Password",
|
"confirm-password": "Confirm Password",
|
||||||
|
@ -149,6 +144,13 @@
|
||||||
"read-the-documentation-for-more-information": "Read the [documentation](http://docs.bludit.com) for more information",
|
"read-the-documentation-for-more-information": "Read the [documentation](http://docs.bludit.com) for more information",
|
||||||
"share-with-your-friends-and-enjoy": "Share with your friends and enjoy",
|
"share-with-your-friends-and-enjoy": "Share with your friends and enjoy",
|
||||||
"the-page-has-not-been-found": "The page has not been found.",
|
"the-page-has-not-been-found": "The page has not been found.",
|
||||||
"error": "Error"
|
"error": "Error",
|
||||||
|
"bludit-installer": "Bludit Installer",
|
||||||
|
"welcome-to-the-bludit-installer": "Welcome to the Bludit installer",
|
||||||
|
"complete-the-form-choose-a-password-for-the-username-admin": "Complete the form, choose a password for the username « admin »",
|
||||||
|
"password-visible-field": "Password, visible field!",
|
||||||
|
"install": "Install",
|
||||||
|
"choose-your-language": "Choose your language",
|
||||||
|
"next": "Next",
|
||||||
|
"the-password-field-is-empty": "The password field is empty"
|
||||||
}
|
}
|
|
@ -144,5 +144,11 @@
|
||||||
"read-the-documentation-for-more-information": "Lea la [documentacion](http://docs.bludit.com) para mas informacion",
|
"read-the-documentation-for-more-information": "Lea la [documentacion](http://docs.bludit.com) para mas informacion",
|
||||||
"share-with-your-friends-and-enjoy": "Comparti con tus amigos y a disfrutar",
|
"share-with-your-friends-and-enjoy": "Comparti con tus amigos y a disfrutar",
|
||||||
"the-page-has-not-been-found": "La pagina no fue encontrada.",
|
"the-page-has-not-been-found": "La pagina no fue encontrada.",
|
||||||
"error": "Error"
|
"error": "Error",
|
||||||
|
"bludit-installer": "Bludit Instalador",
|
||||||
|
"welcome-to-the-bludit-installer": "Bienvenido al asistente para la instalación de Bludit.",
|
||||||
|
"complete-the-form-choose-a-password-for-the-username-admin": "Complete el formulario y elija una contraseña para el usuario « admin »",
|
||||||
|
"password-visible-field": "Contraseña, este campo es visible!",
|
||||||
|
"install": "Instalar",
|
||||||
|
"the-password-field-is-empty": "Debe completar el campo contraseña"
|
||||||
}
|
}
|
|
@ -8,12 +8,7 @@
|
||||||
"email": "",
|
"email": "",
|
||||||
"website": ""
|
"website": ""
|
||||||
},
|
},
|
||||||
|
|
||||||
"bludit-installer": "Installation de Bludit",
|
|
||||||
"welcome-to-the-bludit-installer": "Bienvenue dans l’assistant d’installation de Bludit",
|
|
||||||
"complete-the-form,-choose-a-password-for-the-username-«-admin-»": "Complétez le formulaire et choisissez un mot de passe pour l’utilisateur « admin »",
|
|
||||||
"password,-visible-field!": "Mot de passe, champ visible !",
|
|
||||||
"install": "Installer",
|
|
||||||
"username": "Nom d’utilisateur",
|
"username": "Nom d’utilisateur",
|
||||||
"password": "Mot de passe",
|
"password": "Mot de passe",
|
||||||
"confirm-password": "Confirmation du mot de passe",
|
"confirm-password": "Confirmation du mot de passe",
|
||||||
|
@ -40,7 +35,7 @@
|
||||||
"position": "Position",
|
"position": "Position",
|
||||||
"save": "Sauvegarder",
|
"save": "Sauvegarder",
|
||||||
"draft": "Brouillon",
|
"draft": "Brouillon",
|
||||||
"delete": "Supprimer",
|
"delete": "Supprimer",
|
||||||
"registered": "Inscrit",
|
"registered": "Inscrit",
|
||||||
"Notifications": "Notifications",
|
"Notifications": "Notifications",
|
||||||
"profile": "Profil",
|
"profile": "Profil",
|
||||||
|
@ -149,6 +144,10 @@
|
||||||
"read-the-documentation-for-more-information": "Lisez la [documentation](http://docs.bludit.com) pour plus d’information",
|
"read-the-documentation-for-more-information": "Lisez la [documentation](http://docs.bludit.com) pour plus d’information",
|
||||||
"share-with-your-friends-and-enjoy": "Partagez avec vos amis et apprécier !",
|
"share-with-your-friends-and-enjoy": "Partagez avec vos amis et apprécier !",
|
||||||
"the-page-has-not-been-found": "La page n’a pas été trouvée.",
|
"the-page-has-not-been-found": "La page n’a pas été trouvée.",
|
||||||
"error": "Erreur"
|
"error": "Erreur",
|
||||||
|
"bludit-installer": "Installation de Bludit",
|
||||||
|
"welcome-to-the-bludit-installer": "Bienvenue dans l’assistant d’installation de Bludit",
|
||||||
|
"complete-the-form-choose-a-password-for-the-username-admin": "Complétez le formulaire et choisissez un mot de passe pour l’utilisateur « admin »",
|
||||||
|
"password-visible-field": "Mot de passe, champ visible !",
|
||||||
|
"install": "Installer"
|
||||||
}
|
}
|
Loading…
Reference in New Issue