Changes on variables names for Language
This commit is contained in:
parent
786f73cc5a
commit
1caddac331
@ -1,4 +1,4 @@
|
||||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] = $Language->g('About') . ' - ' . $layout['title'];
|
||||
$layout['title'] = $language->g('About') . ' - ' . $layout['title'];
|
@ -23,4 +23,4 @@ checkRole(array('admin'));
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$Language->g('Categories');
|
||||
$layout['title'] .= ' - '.$language->g('Categories');
|
@ -41,10 +41,10 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
|
||||
// Call the method post of the plugin
|
||||
if ($plugin->post()) {
|
||||
Alert::set( $Language->g('The changes have been saved') );
|
||||
Alert::set( $language->g('The changes have been saved') );
|
||||
Redirect::page('configure-plugin/'.$plugin->className());
|
||||
} else {
|
||||
Alert::set( $Language->g('Complete all fields') );
|
||||
Alert::set( $language->g('Complete all fields') );
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,4 +53,4 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] = $Language->g('Plugin').' - '.$plugin->name().' - '.$layout['title'];
|
||||
$layout['title'] = $language->g('Plugin').' - '.$plugin->name().' - '.$layout['title'];
|
@ -39,4 +39,4 @@ $static = $pages->getStaticDB(true);
|
||||
$sticky = $pages->getStickyDB(true);
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$Language->g('Manage content');
|
||||
$layout['title'] .= ' - '.$language->g('Manage content');
|
@ -36,4 +36,4 @@ function updateBludit() {
|
||||
updateBludit();
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$Language->g('Dashboard');
|
||||
$layout['title'] .= ' - '.$language->g('Dashboard');
|
@ -48,4 +48,4 @@ function printTable($title, $array) {
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
$layout['title'] .= ' - '.$Language->g('Developers');
|
||||
$layout['title'] .= ' - '.$language->g('Developers');
|
@ -41,4 +41,4 @@ if (!$categories->exists($categoryKey)) {
|
||||
$categoryMap = $categories->getMap($categoryKey);
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$Language->g('Edit Category').' [ '.$categoryMap['name'] . ' ] ';
|
||||
$layout['title'] .= ' - '.$language->g('Edit Category').' [ '.$categoryMap['name'] . ' ] ';
|
@ -9,7 +9,7 @@ if (!checkRole(array('admin','editor'), false)) {
|
||||
$pageKey = isset($_POST['key']) ? $_POST['key'] : $layout['parameters'];
|
||||
$page = new Page($pageKey);
|
||||
} catch (Exception $e) {
|
||||
Alert::set($Language->g('You do not have sufficient permissions'));
|
||||
Alert::set($language->g('You do not have sufficient permissions'));
|
||||
Redirect::page('dashboard');
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ if (!checkRole(array('admin','editor'), false)) {
|
||||
'notes'=>$login->username()
|
||||
));
|
||||
|
||||
Alert::set($Language->g('You do not have sufficient permissions'));
|
||||
Alert::set($language->g('You do not have sufficient permissions'));
|
||||
Redirect::page('dashboard');
|
||||
}
|
||||
}
|
||||
@ -40,7 +40,7 @@ if (!checkRole(array('admin','editor'), false)) {
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
if ($_POST['type']==='delete') {
|
||||
if (deletePage($_POST['key'])) {
|
||||
Alert::set( $Language->g('The changes have been saved') );
|
||||
Alert::set( $language->g('The changes have been saved') );
|
||||
}
|
||||
} else {
|
||||
// If the checkbox is not selected the form doesn't send the field
|
||||
@ -50,7 +50,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
|
||||
$key = editPage($_POST);
|
||||
if ($key!==false) {
|
||||
Alert::set( $Language->g('The changes have been saved') );
|
||||
Alert::set( $language->g('The changes have been saved') );
|
||||
Redirect::page('edit-content/'.$key);
|
||||
}
|
||||
}
|
||||
@ -70,4 +70,4 @@ try {
|
||||
}
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$Language->g('Edit content').' - '.$page->title();
|
||||
$layout['title'] .= ' - '.$language->g('Edit content').' - '.$page->title();
|
@ -31,7 +31,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
editUser($_POST);
|
||||
}
|
||||
|
||||
Alert::set($Language->g('The changes have been saved'));
|
||||
Alert::set($language->g('The changes have been saved'));
|
||||
Redirect::page('users');
|
||||
}
|
||||
|
||||
@ -53,4 +53,4 @@ try {
|
||||
}
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] = $Language->g('Edit user').' - '.$layout['title'];
|
||||
$layout['title'] = $language->g('Edit user').' - '.$layout['title'];
|
@ -33,7 +33,7 @@ if (Sanitize::pathFile(PATH_THEMES.$themeDirname)) {
|
||||
));
|
||||
|
||||
// Create an alert
|
||||
Alert::set( $Language->g('The changes have been saved') );
|
||||
Alert::set( $language->g('The changes have been saved') );
|
||||
}
|
||||
|
||||
// Redirect
|
||||
|
@ -12,10 +12,10 @@ function checkLogin($args)
|
||||
{
|
||||
global $security;
|
||||
global $login;
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
if ($security->isBlocked()) {
|
||||
Alert::set($Language->g('IP address has been blocked').'<br>'.$Language->g('Try again in a few minutes'), ALERT_STATUS_FAIL);
|
||||
Alert::set($language->g('IP address has been blocked').'<br>'.$language->g('Try again in a few minutes'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ function checkLogin($args)
|
||||
$security->addToBlacklist();
|
||||
|
||||
// Create alert
|
||||
Alert::set($Language->g('Username or password incorrect'), ALERT_STATUS_FAIL);
|
||||
Alert::set($language->g('Username or password incorrect'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -29,4 +29,4 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$Language->g('New category');
|
||||
$layout['title'] .= ' - '.$language->g('New category');
|
@ -33,4 +33,4 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] = $Language->g('New content').' - '.$layout['title'];
|
||||
$layout['title'] = $language->g('New content').' - '.$layout['title'];
|
@ -29,4 +29,4 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$Language->g('Add a new user');
|
||||
$layout['title'] .= ' - '.$language->g('Add a new user');
|
@ -26,4 +26,4 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$Language->g('Plugins');
|
||||
$layout['title'] .= ' - '.$language->g('Plugins');
|
@ -23,4 +23,4 @@ checkRole(array('admin'));
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$Language->g('Plugins');
|
||||
$layout['title'] .= ' - '.$language->g('Plugins');
|
@ -28,4 +28,4 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$Language->g('General Settings');
|
||||
$layout['title'] .= ' - '.$language->g('General Settings');
|
@ -28,4 +28,4 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$Language->g('Language and timezone');
|
||||
$layout['title'] .= ' - '.$language->g('Language and timezone');
|
@ -28,4 +28,4 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$Language->g('Advanced Settings');
|
||||
$layout['title'] .= ' - '.$language->g('Advanced Settings');
|
@ -21,4 +21,4 @@ checkRole(array('admin'));
|
||||
$themes = buildThemes();
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$Language->g('Themes');
|
||||
$layout['title'] .= ' - '.$language->g('Themes');
|
@ -41,4 +41,4 @@ try {
|
||||
}
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] = $Language->g('Change password').' - '.$layout['title'];
|
||||
$layout['title'] = $language->g('Change password').' - '.$layout['title'];
|
@ -28,4 +28,4 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$Language->g('Users');
|
||||
$layout['title'] .= ' - '.$language->g('Users');
|
@ -4,7 +4,7 @@ echo Bootstrap::pageTitle(array('title'=>$L->g('Content'), 'icon'=>'layers'));
|
||||
|
||||
function table($type) {
|
||||
global $url;
|
||||
global $Language;
|
||||
global $language;
|
||||
global $published;
|
||||
global $drafts;
|
||||
global $scheduled;
|
||||
@ -15,7 +15,7 @@ function table($type) {
|
||||
$list = $published;
|
||||
if (empty($list)) {
|
||||
echo '<p class="mt-4 text-muted">';
|
||||
echo $Language->g('There are no pages at this moment.');
|
||||
echo $language->g('There are no pages at this moment.');
|
||||
echo '</p>';
|
||||
return false;
|
||||
}
|
||||
@ -23,7 +23,7 @@ function table($type) {
|
||||
$list = $drafts;
|
||||
if (empty($list)) {
|
||||
echo '<p class="mt-4 text-muted">';
|
||||
echo $Language->g('There are no draft pages at this moment.');
|
||||
echo $language->g('There are no draft pages at this moment.');
|
||||
echo '</p>';
|
||||
return false;
|
||||
}
|
||||
@ -31,7 +31,7 @@ function table($type) {
|
||||
$list = $scheduled;
|
||||
if (empty($list)) {
|
||||
echo '<p class="mt-4 text-muted">';
|
||||
echo $Language->g('There are no scheduled pages at this moment.');
|
||||
echo $language->g('There are no scheduled pages at this moment.');
|
||||
echo '</p>';
|
||||
return false;
|
||||
}
|
||||
@ -39,7 +39,7 @@ function table($type) {
|
||||
$list = $static;
|
||||
if (empty($list)) {
|
||||
echo '<p class="mt-4 text-muted">';
|
||||
echo $Language->g('There are no static pages at this moment.');
|
||||
echo $language->g('There are no static pages at this moment.');
|
||||
echo '</p>';
|
||||
return false;
|
||||
}
|
||||
@ -47,7 +47,7 @@ function table($type) {
|
||||
$list = $sticky;
|
||||
if (empty($list)) {
|
||||
echo '<p class="mt-4 text-muted">';
|
||||
echo $Language->g('There are no sticky pages at this moment.');
|
||||
echo $language->g('There are no sticky pages at this moment.');
|
||||
echo '</p>';
|
||||
return false;
|
||||
}
|
||||
@ -57,8 +57,8 @@ function table($type) {
|
||||
<table class="table mt-3">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="font-size: 0.8em;" class="border-0 text-uppercase text-muted" scope="col">'.$Language->g('Title').'</th>
|
||||
<th style="font-size: 0.8em;" class="border-0 d-none d-lg-table-cell text-uppercase text-muted" scope="col">'.$Language->g('URL').'</th>
|
||||
<th style="font-size: 0.8em;" class="border-0 text-uppercase text-muted" scope="col">'.$language->g('Title').'</th>
|
||||
<th style="font-size: 0.8em;" class="border-0 d-none d-lg-table-cell text-uppercase text-muted" scope="col">'.$language->g('URL').'</th>
|
||||
<th style="font-size: 0.8em;" class="border-0 text-center d-none d-sm-table-cell text-uppercase text-muted" scope="col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -73,7 +73,7 @@ function table($type) {
|
||||
echo '<tr>
|
||||
<td>
|
||||
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'">'
|
||||
.($page->title()?$page->title():'<span>'.$Language->g('Empty title').'</span> ')
|
||||
.($page->title()?$page->title():'<span>'.$language->g('Empty title').'</span> ')
|
||||
.'</a>
|
||||
</td>';
|
||||
|
||||
@ -89,7 +89,7 @@ function table($type) {
|
||||
echo '<tr>
|
||||
<td>
|
||||
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$child->key().'">'
|
||||
.($child->title()?$child->title():'<span>'.$Language->g('Empty title').'</span> ')
|
||||
.($child->title()?$child->title():'<span>'.$language->g('Empty title').'</span> ')
|
||||
.'</a>
|
||||
</td>';
|
||||
|
||||
@ -114,7 +114,7 @@ function table($type) {
|
||||
echo '<td class="pt-3">
|
||||
<div>
|
||||
<a style="font-size: 1.1em" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'">'
|
||||
.($page->title()?$page->title():'<span class="label-empty-title">'.$Language->g('Empty title').'</span> ')
|
||||
.($page->title()?$page->title():'<span class="label-empty-title">'.$language->g('Empty title').'</span> ')
|
||||
.'</a>
|
||||
</div>
|
||||
<div>
|
||||
@ -175,22 +175,22 @@ function table($type) {
|
||||
|
||||
<!-- First button -->
|
||||
<li class="page-item <?php if (!Paginator::showPrev()) echo 'disabled' ?>">
|
||||
<a class="page-link" href="<?php echo Paginator::firstPageUrl() ?>"><span class="align-middle oi oi-media-skip-backward"></span> <?php echo $Language->get('First'); ?></a>
|
||||
<a class="page-link" href="<?php echo Paginator::firstPageUrl() ?>"><span class="align-middle oi oi-media-skip-backward"></span> <?php echo $language->get('First'); ?></a>
|
||||
</li>
|
||||
|
||||
<!-- Previous button -->
|
||||
<li class="page-item <?php if (!Paginator::showPrev()) echo 'disabled' ?>">
|
||||
<a class="page-link" href="<?php echo Paginator::previousPageUrl() ?>"><?php echo $Language->get('Previous'); ?></a>
|
||||
<a class="page-link" href="<?php echo Paginator::previousPageUrl() ?>"><?php echo $language->get('Previous'); ?></a>
|
||||
</li>
|
||||
|
||||
<!-- Next button -->
|
||||
<li class="page-item <?php if (!Paginator::showNext()) echo 'disabled' ?>">
|
||||
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>"><?php echo $Language->get('Next'); ?></a>
|
||||
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>"><?php echo $language->get('Next'); ?></a>
|
||||
</li>
|
||||
|
||||
<!-- Last button -->
|
||||
<li class="page-item <?php if (!Paginator::showNext()) echo 'disabled' ?>">
|
||||
<a class="page-link" href="<?php echo Paginator::lastPageUrl() ?>"><?php echo $Language->get('Last'); ?> <span class="align-middle oi oi-media-skip-forward"></span></a>
|
||||
<a class="page-link" href="<?php echo Paginator::lastPageUrl() ?>"><?php echo $language->get('Last'); ?> <span class="align-middle oi oi-media-skip-forward"></span></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -344,7 +344,7 @@
|
||||
'class'=>'',
|
||||
'value'=>$page->description(),
|
||||
'rows'=>3,
|
||||
'placeholder'=>$Language->get('this-field-can-help-describe-the-content')
|
||||
'placeholder'=>$language->get('this-field-can-help-describe-the-content')
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
|
@ -229,13 +229,13 @@ echo '
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#jsdeleteUserAndDeleteContent").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;
|
||||
}
|
||||
});
|
||||
|
||||
$("#jsdeleteUserAndKeepContent").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;
|
||||
}
|
||||
});
|
||||
|
@ -278,7 +278,7 @@
|
||||
'class'=>'',
|
||||
'value'=>'',
|
||||
'rows'=>3,
|
||||
'placeholder'=>$Language->get('this-field-can-help-describe-the-content')
|
||||
'placeholder'=>$language->get('this-field-can-help-describe-the-content')
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
|
@ -366,7 +366,7 @@ echo Bootstrap::pageTitle(array('title'=>$L->g('Settings'), 'icon'=>'cog'));
|
||||
echo Bootstrap::formSelect(array(
|
||||
'name'=>'language',
|
||||
'label'=>$L->g('Language'),
|
||||
'options'=>$Language->getLanguageList(),
|
||||
'options'=>$language->getLanguageList(),
|
||||
'selected'=>$site->language(),
|
||||
'class'=>'',
|
||||
'tip'=>$L->g('select-your-sites-language')
|
||||
|
@ -50,7 +50,7 @@ function buildPlugins()
|
||||
{
|
||||
global $plugins;
|
||||
global $pluginsEvents;
|
||||
global $Language;
|
||||
global $language;
|
||||
global $site;
|
||||
|
||||
// List plugins directories
|
||||
@ -90,7 +90,7 @@ function buildPlugins()
|
||||
// This function overwrite the key=>value
|
||||
unset($database['plugin-data']);
|
||||
if (!empty($database)) {
|
||||
$Language->add($database);
|
||||
$language->add($database);
|
||||
}
|
||||
|
||||
// $plugins['all'] Array with all plugins, installed and not installed
|
||||
|
@ -85,6 +85,6 @@ if( Sanitize::pathFile($languageFilename) )
|
||||
|
||||
// Load words from the theme language
|
||||
if(!empty($database)) {
|
||||
$Language->add($database);
|
||||
$language->add($database);
|
||||
}
|
||||
}
|
@ -31,7 +31,7 @@ if (Sanitize::pathFile(PATH_THEMES, $site->theme().DS.'init.php')) {
|
||||
if (Sanitize::pathFile(PATH_THEMES, $site->theme().DS.'index.php')) {
|
||||
include(PATH_THEMES.$site->theme().DS.'index.php');
|
||||
} else {
|
||||
$Language->p('Please check your theme configuration');
|
||||
$language->p('Please check your theme configuration');
|
||||
}
|
||||
|
||||
// Plugins after site loaded
|
||||
|
@ -18,7 +18,6 @@ function reindexTags() {
|
||||
function buildErrorPage() {
|
||||
global $site;
|
||||
global $language;
|
||||
global $users;
|
||||
|
||||
try {
|
||||
$pageNotFoundKey = $site->pageNotFound();
|
||||
@ -198,7 +197,7 @@ function pluginActivated($pluginClassName) {
|
||||
function activatePlugin($pluginClassName) {
|
||||
global $plugins;
|
||||
global $syslog;
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
// Check if the plugin exists
|
||||
if (isset($plugins['all'][$pluginClassName])) {
|
||||
@ -211,7 +210,7 @@ function activatePlugin($pluginClassName) {
|
||||
));
|
||||
|
||||
// Create an alert
|
||||
Alert::set($Language->g('plugin-activated'));
|
||||
Alert::set($language->g('plugin-activated'));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -221,7 +220,7 @@ function activatePlugin($pluginClassName) {
|
||||
function deactivatePlugin($pluginClassName) {
|
||||
global $plugins;
|
||||
global $syslog;
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
// Check if the plugin exists
|
||||
if (isset($plugins['all'][$pluginClassName])) {
|
||||
@ -235,7 +234,7 @@ function deactivatePlugin($pluginClassName) {
|
||||
));
|
||||
|
||||
// Create an alert
|
||||
Alert::set($Language->g('plugin-deactivated'));
|
||||
Alert::set($language->g('plugin-deactivated'));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -245,7 +244,7 @@ function deactivatePlugin($pluginClassName) {
|
||||
function changePluginsPosition($pluginClassList) {
|
||||
global $plugins;
|
||||
global $syslog;
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
foreach ($pluginClassList as $position=>$pluginClassName) {
|
||||
if (isset($plugins['all'][$pluginClassName])) {
|
||||
@ -260,14 +259,14 @@ function changePluginsPosition($pluginClassList) {
|
||||
'notes'=>''
|
||||
));
|
||||
|
||||
Alert::set($Language->g('The changes have been saved'));
|
||||
Alert::set($language->g('The changes have been saved'));
|
||||
return true;
|
||||
}
|
||||
|
||||
function createPage($args) {
|
||||
global $pages;
|
||||
global $syslog;
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
// Check if the autosave page exists for this new page and delete it
|
||||
if (isset($args['uuid'])) {
|
||||
@ -299,7 +298,7 @@ function createPage($args) {
|
||||
'notes'=>$args['title']
|
||||
));
|
||||
|
||||
Alert::set( $Language->g('new-content-created') );
|
||||
Alert::set( $language->g('new-content-created') );
|
||||
return $key;
|
||||
}
|
||||
|
||||
@ -489,30 +488,30 @@ function deleteUser($args) {
|
||||
|
||||
function createUser($args) {
|
||||
global $users;
|
||||
global $Language;
|
||||
global $language;
|
||||
global $syslog;
|
||||
|
||||
// Check empty username
|
||||
if (Text::isEmpty($args['new_username'])) {
|
||||
Alert::set($Language->g('username-field-is-empty'), ALERT_STATUS_FAIL);
|
||||
Alert::set($language->g('username-field-is-empty'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check already exist username
|
||||
if ($users->exists($args['new_username'])) {
|
||||
Alert::set($Language->g('username-already-exists'), ALERT_STATUS_FAIL);
|
||||
Alert::set($language->g('username-already-exists'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Password length
|
||||
if (Text::length($args['new_password']) < PASSWORD_LENGTH) {
|
||||
Alert::set($Language->g('Password must be at least '.PASSWORD_LENGTH.' characters long'), ALERT_STATUS_FAIL);
|
||||
Alert::set($language->g('Password must be at least '.PASSWORD_LENGTH.' characters long'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check new password and confirm password are equal
|
||||
if ($args['new_password'] != $args['confirm_password']) {
|
||||
Alert::set($Language->g('The password and confirmation password do not match'), ALERT_STATUS_FAIL);
|
||||
Alert::set($language->g('The password and confirmation password do not match'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -540,7 +539,7 @@ function createUser($args) {
|
||||
function editSettings($args) {
|
||||
global $site;
|
||||
global $syslog;
|
||||
global $Language;
|
||||
global $language;
|
||||
global $pages;
|
||||
|
||||
if (isset($args['language'])) {
|
||||
@ -592,7 +591,7 @@ function editSettings($args) {
|
||||
));
|
||||
|
||||
// Create alert
|
||||
Alert::set($Language->g('The changes have been saved'));
|
||||
Alert::set($language->g('The changes have been saved'));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -601,7 +600,7 @@ function editSettings($args) {
|
||||
|
||||
function changeUserPassword($args) {
|
||||
global $users;
|
||||
global $Language;
|
||||
global $language;
|
||||
global $syslog;
|
||||
|
||||
// Arguments
|
||||
@ -611,12 +610,12 @@ function changeUserPassword($args) {
|
||||
|
||||
// Password length
|
||||
if (Text::length($newPassword) < 6) {
|
||||
Alert::set($Language->g('Password must be at least 6 characters long'), ALERT_STATUS_FAIL);
|
||||
Alert::set($language->g('Password must be at least 6 characters long'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($newPassword!=$confirmPassword) {
|
||||
Alert::set($Language->g('The password and confirmation password do not match'), ALERT_STATUS_FAIL);
|
||||
Alert::set($language->g('The password and confirmation password do not match'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -627,7 +626,7 @@ function changeUserPassword($args) {
|
||||
'notes'=>$username
|
||||
));
|
||||
|
||||
Alert::set($Language->g('The changes have been saved'), ALERT_STATUS_OK);
|
||||
Alert::set($language->g('The changes have been saved'), ALERT_STATUS_OK);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -637,7 +636,7 @@ function changeUserPassword($args) {
|
||||
// Returns true if the user is allowed to procceded
|
||||
function checkRole($allowRoles, $redirect=true) {
|
||||
global $login;
|
||||
global $Language;
|
||||
global $language;
|
||||
global $syslog;
|
||||
|
||||
$userRole = $login->role();
|
||||
@ -652,7 +651,7 @@ function checkRole($allowRoles, $redirect=true) {
|
||||
'notes'=>$login->username()
|
||||
));
|
||||
|
||||
Alert::set($Language->g('You do not have sufficient permissions'));
|
||||
Alert::set($language->g('You do not have sufficient permissions'));
|
||||
if ($userRole=='reader') {
|
||||
Redirect::home();
|
||||
}
|
||||
@ -665,11 +664,11 @@ function checkRole($allowRoles, $redirect=true) {
|
||||
// Returns TRUE is successfully added, FALSE otherwise
|
||||
function createCategory($category) {
|
||||
global $categories;
|
||||
global $Language;
|
||||
global $language;
|
||||
global $syslog;
|
||||
|
||||
if (Text::isEmpty($category)) {
|
||||
Alert::set($Language->g('Category name is empty'), ALERT_STATUS_FAIL);
|
||||
Alert::set($language->g('Category name is empty'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -680,29 +679,29 @@ function createCategory($category) {
|
||||
'notes'=>$category
|
||||
));
|
||||
|
||||
Alert::set($Language->g('Category added'), ALERT_STATUS_OK);
|
||||
Alert::set($language->g('Category added'), ALERT_STATUS_OK);
|
||||
return true;
|
||||
}
|
||||
|
||||
Alert::set($Language->g('The category already exists'), ALERT_STATUS_FAIL);
|
||||
Alert::set($language->g('The category already exists'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
function editCategory($args) {
|
||||
global $Language;
|
||||
global $language;
|
||||
global $pages;
|
||||
global $categories;
|
||||
global $syslog;
|
||||
|
||||
if (Text::isEmpty($args['name']) || Text::isEmpty($args['newKey']) ) {
|
||||
Alert::set($Language->g('Empty fields'));
|
||||
Alert::set($language->g('Empty fields'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$newCategoryKey = $categories->edit($args);
|
||||
|
||||
if ($newCategoryKey==false) {
|
||||
Alert::set($Language->g('The category already exists'));
|
||||
Alert::set($language->g('The category already exists'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -715,12 +714,12 @@ function editCategory($args) {
|
||||
'notes'=>$newCategoryKey
|
||||
));
|
||||
|
||||
Alert::set($Language->g('The changes have been saved'));
|
||||
Alert::set($language->g('The changes have been saved'));
|
||||
return true;
|
||||
}
|
||||
|
||||
function deleteCategory($args) {
|
||||
global $Language;
|
||||
global $language;
|
||||
global $categories;
|
||||
global $syslog;
|
||||
|
||||
@ -735,7 +734,7 @@ function deleteCategory($args) {
|
||||
'notes'=>$args['oldKey']
|
||||
));
|
||||
|
||||
Alert::set($Language->g('The changes have been saved'));
|
||||
Alert::set($language->g('The changes have been saved'));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -797,7 +796,7 @@ function activateTheme($themeDirectory) {
|
||||
'notes'=>$themeDirname
|
||||
));
|
||||
|
||||
Alert::set( $Language->g('The changes have been saved') );
|
||||
Alert::set( $language->g('The changes have been saved') );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -6,15 +6,15 @@ class Date {
|
||||
// Example: $date = 'Mon, 27th March' > 'Lun, 27th Marzo'
|
||||
public static function translate($date)
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
// If English default language don't translate
|
||||
if ($Language->currentLanguage()=='en') {
|
||||
if ($language->currentLanguage()=='en') {
|
||||
return $date;
|
||||
}
|
||||
|
||||
// Get the array of dates from the language file
|
||||
$dates = $Language->getDates();
|
||||
$dates = $language->getDates();
|
||||
foreach ($dates as $english=>$anotherLang) {
|
||||
$date = preg_replace('/\b'.$english.'\b/u', $anotherLang, $date);
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ class Paginator {
|
||||
|
||||
public static function html($textPrevPage=false, $textNextPage=false, $showPageNumber=false)
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div id="paginator">';
|
||||
$html .= '<ul>';
|
||||
@ -112,7 +112,7 @@ class Paginator {
|
||||
if(self::get('showNext'))
|
||||
{
|
||||
if($textPrevPage===false) {
|
||||
$textPrevPage = '« '.$Language->g('Previous page');
|
||||
$textPrevPage = '« '.$language->g('Previous page');
|
||||
}
|
||||
|
||||
$html .= '<li class="left">';
|
||||
@ -127,7 +127,7 @@ class Paginator {
|
||||
if(self::get('showPrev'))
|
||||
{
|
||||
if($textNextPage===false) {
|
||||
$textNextPage = $Language->g('Next page').' »';
|
||||
$textNextPage = $language->g('Next page').' »';
|
||||
}
|
||||
|
||||
$html .= '<li class="right">';
|
||||
|
@ -126,7 +126,7 @@ class Text {
|
||||
// This function can return an empty string
|
||||
public static function cleanUrl($string, $separator='-')
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
if (EXTREME_FRIENDLY_URL) {
|
||||
$string = self::lowercase($string);
|
||||
@ -137,7 +137,7 @@ class Text {
|
||||
}
|
||||
|
||||
// Transliterate characters to ASCII
|
||||
$specialCharsFromDictionary = $Language->getSpecialChars();
|
||||
$specialCharsFromDictionary = $language->getSpecialChars();
|
||||
$string = str_replace(array_keys($specialCharsFromDictionary), $specialCharsFromDictionary, $string);
|
||||
$string = str_replace(array_keys(self::$specialChars), self::$specialChars, $string);
|
||||
|
||||
|
@ -484,7 +484,7 @@ class Page {
|
||||
|
||||
// Returns the amount of minutes takes to read the page
|
||||
public function readingTime() {
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$words = $this->content(true);
|
||||
$words = strip_tags($words);
|
||||
@ -493,10 +493,10 @@ class Page {
|
||||
$minutes = round($average);
|
||||
|
||||
if ($minutes>0) {
|
||||
return $minutes.' '.$Language->get('minutes');
|
||||
return $minutes.' '.$language->get('minutes');
|
||||
}
|
||||
|
||||
return '~1 '.$Language->get('minute');
|
||||
return '~1 '.$language->get('minute');
|
||||
}
|
||||
|
||||
// Returns relative time (e.g. "1 minute ago")
|
||||
|
@ -39,7 +39,7 @@ class Syslog extends dbJSON {
|
||||
|
||||
public function add($args)
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$data = array();
|
||||
$data['date'] = Date::current(DB_DATE_FORMAT);
|
||||
|
@ -12,20 +12,20 @@ class pluginAbout extends Plugin {
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Label').'</label>';
|
||||
$html .= '<label>'.$language->get('Label').'</label>';
|
||||
$html .= '<input name="label" type="text" value="'.$this->getValue('label').'">';
|
||||
$html .= '<span class="tip">'.$Language->get('This title is almost always used in the sidebar of the site').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('This title is almost always used in the sidebar of the site').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('About').'</label>';
|
||||
$html .= '<label>'.$language->get('About').'</label>';
|
||||
$html .= '<textarea name="text" id="jstext">'.$this->getValue('text').'</textarea>';
|
||||
$html .= '</div>';
|
||||
|
||||
|
@ -17,22 +17,22 @@ class pluginAPI extends Plugin {
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('API Token').'</label>';
|
||||
$html .= '<label>'.$language->get('API Token').'</label>';
|
||||
$html .= '<input name="token" type="text" value="'.$this->getValue('token').'">';
|
||||
$html .= '<span class="tip">'.$Language->get('This token is for read only and is regenerated every time you install the plugin').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('This token is for read only and is regenerated every time you install the plugin').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Amount of pages').'</label>';
|
||||
$html .= '<label>'.$language->get('Amount of pages').'</label>';
|
||||
$html .= '<input id="jsamountOfItems" name="amountOfItems" type="text" value="'.$this->getValue('amountOfItems').'">';
|
||||
$html .= '<span class="tip">'.$Language->get('This is the maximum of pages to return when you call to').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('This is the maximum of pages to return when you call to').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
|
@ -64,19 +64,19 @@ class pluginBackup extends Plugin {
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$backups = $this->backupList();
|
||||
|
||||
$html = '';
|
||||
if (empty($backups)) {
|
||||
$html .= '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $Language->get('There are no backups for the moment');
|
||||
$html .= $language->get('There are no backups for the moment');
|
||||
$html .= '</div>';
|
||||
}
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<button name="createBackup" value="true" class="btn btn-primary" type="submit"><span class="oi oi-play-circle"></span> '.$Language->get('create-backup').'</button>';
|
||||
$html .= '<button name="createBackup" value="true" class="btn btn-primary" type="submit"><span class="oi oi-play-circle"></span> '.$language->get('create-backup').'</button>';
|
||||
$html .= '</div>';
|
||||
$html .= '<hr>';
|
||||
|
||||
@ -88,10 +88,10 @@ class pluginBackup extends Plugin {
|
||||
$html .= '<h4 class="font-weight-normal">'.Date::format($filename, BACKUP_DATE_FORMAT, 'F j, Y, g:i a').'</h4>';
|
||||
// Allow download if a zip file
|
||||
if ($this->zip) {
|
||||
$html .= '<a class="btn btn-secondary mr-3" href="'.DOMAIN_CONTENT.'backup/'.$filename.'.zip"><span class="oi oi-data-transfer-download"></span> '.$Language->get('download').'</a>';
|
||||
$html .= '<a class="btn btn-secondary mr-3" href="'.DOMAIN_CONTENT.'backup/'.$filename.'.zip"><span class="oi oi-data-transfer-download"></span> '.$language->get('download').'</a>';
|
||||
}
|
||||
$html .= '<button name="restoreBackup" value="'.$filename.'" class="btn btn-secondary mr-3" type="submit"><span class="oi oi-timer"></span> '.$Language->get('restore-backup').'</button>';
|
||||
$html .= '<button name="deleteBackup" value="'.$filename.'" class="btn btn-secondary mr-3" type="submit"><span class="oi oi-delete"></span> '.$Language->get('delete-backup').'</button>';
|
||||
$html .= '<button name="restoreBackup" value="'.$filename.'" class="btn btn-secondary mr-3" type="submit"><span class="oi oi-timer"></span> '.$language->get('restore-backup').'</button>';
|
||||
$html .= '<button name="deleteBackup" value="'.$filename.'" class="btn btn-secondary mr-3" type="submit"><span class="oi oi-delete"></span> '.$language->get('delete-backup').'</button>';
|
||||
$html .= '</div>';
|
||||
$html .= '<hr>';
|
||||
}
|
||||
|
@ -14,23 +14,23 @@ class pluginCategories extends Plugin {
|
||||
// Method called on the settings of the plugin on the admin area
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Label').'</label>';
|
||||
$html .= '<label>'.$language->get('Label').'</label>';
|
||||
$html .= '<input name="label" type="text" value="'.$this->getValue('label').'">';
|
||||
$html .= '<span class="tip">'.$Language->get('This title is almost always used in the sidebar of the site').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('This title is almost always used in the sidebar of the site').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Hide Categories without content').'</label>';
|
||||
$html .= '<label>'.$language->get('Hide Categories without content').'</label>';
|
||||
$html .= '<select name="hideCero">';
|
||||
$html .= '<option value="true" '.($this->getValue('hideCero')===true?'selected':'').'>'.$Language->get('Enabled').'</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('hideCero')===false?'selected':'').'>'.$Language->get('Disabled').'</option>';
|
||||
$html .= '<option value="true" '.($this->getValue('hideCero')===true?'selected':'').'>'.$language->get('Enabled').'</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('hideCero')===false?'selected':'').'>'.$language->get('Disabled').'</option>';
|
||||
$html .= '</select>';
|
||||
$html .= '</div>';
|
||||
|
||||
@ -40,7 +40,7 @@ class pluginCategories extends Plugin {
|
||||
// Method called on the sidebar of the website
|
||||
public function siteSidebar()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
global $categories;
|
||||
|
||||
// HTML for sidebar
|
||||
|
@ -13,29 +13,29 @@ class pluginDisqus extends Plugin {
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('disqus-shortname').'</label>';
|
||||
$html .= '<label>'.$language->get('disqus-shortname').'</label>';
|
||||
$html .= '<input name="shortname" id="jsshortname" type="text" value="'.$this->getValue('shortname').'">';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('enable-disqus-on-pages').'</label>';
|
||||
$html .= '<label>'.$language->get('enable-disqus-on-pages').'</label>';
|
||||
$html .= '<select name="enablePages">';
|
||||
$html .= '<option value="true" '.($this->getValue('enablePages')===true?'selected':'').'>'.$Language->get('enabled').'</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('enablePages')===false?'selected':'').'>'.$Language->get('disabled').'</option>';
|
||||
$html .= '<option value="true" '.($this->getValue('enablePages')===true?'selected':'').'>'.$language->get('enabled').'</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('enablePages')===false?'selected':'').'>'.$language->get('disabled').'</option>';
|
||||
$html .= '</select>';
|
||||
$html .= '</div>';
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('enable-disqus-on-posts').'</label>';
|
||||
$html .= '<label>'.$language->get('enable-disqus-on-posts').'</label>';
|
||||
$html .= '<select name="enablePosts">';
|
||||
$html .= '<option value="true" '.($this->getValue('enablePosts')===true?'selected':'').'>'.$Language->get('enabled').'</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('enablePosts')===false?'selected':'').'>'.$Language->get('disabled').'</option>';
|
||||
$html .= '<option value="true" '.($this->getValue('enablePosts')===true?'selected':'').'>'.$language->get('enabled').'</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('enablePosts')===false?'selected':'').'>'.$language->get('disabled').'</option>';
|
||||
$html .= '</select>';
|
||||
$html .= '</div>';
|
||||
|
||||
|
@ -13,7 +13,7 @@ class pluginHTMLCode extends Plugin {
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
@ -22,19 +22,19 @@ class pluginHTMLCode extends Plugin {
|
||||
$html .= '<div>';
|
||||
$html .= '<label>Site Head</label>';
|
||||
$html .= '<textarea name="head" id="jshead">'.$this->getValue('head').'</textarea>';
|
||||
$html .= '<span class="tip">'.$Language->get('insert-code-in-the-theme-inside-the-tag-head').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('insert-code-in-the-theme-inside-the-tag-head').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>Site Header</label>';
|
||||
$html .= '<textarea name="header" id="jsheader">'.$this->getValue('header').'</textarea>';
|
||||
$html .= '<span class="tip">'.$Language->get('insert-code-in-the-theme-at-the-top').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('insert-code-in-the-theme-at-the-top').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>Site Footer</label>';
|
||||
$html .= '<textarea name="footer" id="jsfooter">'.$this->getValue('footer').'</textarea>';
|
||||
$html .= '<span class="tip">'.$Language->get('insert-code-in-the-theme-at-the-bottom').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('insert-code-in-the-theme-at-the-bottom').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
|
@ -62,54 +62,54 @@ class pluginLinks extends Plugin {
|
||||
// Method called on plugin settings on the admin area
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div>';
|
||||
$html .= '<label>'.$Language->get('Label').'</label>';
|
||||
$html .= '<label>'.$language->get('Label').'</label>';
|
||||
$html .= '<input name="label" type="text" value="'.$this->getValue('label').'">';
|
||||
$html .= '<span class="tip">'.$Language->get('This title is almost always used in the sidebar of the site').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('This title is almost always used in the sidebar of the site').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<button name="save" class="btn btn-primary" type="submit">'.$Language->get('Save').'</button>';
|
||||
$html .= '<button name="save" class="btn btn-primary" type="submit">'.$language->get('Save').'</button>';
|
||||
$html .= '</div>';
|
||||
|
||||
// New link, when the user click on save button this call the method post()
|
||||
// and the new link is added to the database
|
||||
$html .= '<legend>'.$Language->get('Add a new link').'</legend>';
|
||||
$html .= '<legend>'.$language->get('Add a new link').'</legend>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Name').'</label>';
|
||||
$html .= '<label>'.$language->get('Name').'</label>';
|
||||
$html .= '<input name="linkName" type="text" value="">';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Url').'</label>';
|
||||
$html .= '<label>'.$language->get('Url').'</label>';
|
||||
$html .= '<input name="linkURL" type="text" value="">';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<button name="addLink" class="blue" type="submit">'.$Language->get('Add').'</button>';
|
||||
$html .= '<button name="addLink" class="blue" type="submit">'.$language->get('Add').'</button>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<legend>'.$Language->get('Links').'</legend>';
|
||||
$html .= '<legend>'.$language->get('Links').'</legend>';
|
||||
|
||||
// Get the JSON DB, getValue() with the option unsanitized HTML code
|
||||
$jsondb = $this->getValue('jsondb', $unsanitized=false);
|
||||
$links = json_decode($jsondb, true);
|
||||
foreach($links as $name=>$url) {
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Name').'</label>';
|
||||
$html .= '<label>'.$language->get('Name').'</label>';
|
||||
$html .= '<input type="text" value="'.$name.'" disabled>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Url').'</label>';
|
||||
$html .= '<label>'.$language->get('Url').'</label>';
|
||||
$html .= '<input type="text" value="'.$url.'" disabled>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<button name="deleteLink" type="submit" value="'.$name.'">'.$Language->get('Delete').'</button>';
|
||||
$html .= '<button name="deleteLink" type="submit" value="'.$name.'">'.$language->get('Delete').'</button>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '</br>';
|
||||
@ -121,7 +121,7 @@ class pluginLinks extends Plugin {
|
||||
// Method called on the sidebar of the website
|
||||
public function siteSidebar()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
// HTML for sidebar
|
||||
$html = '<div class="plugin plugin-pages">';
|
||||
|
@ -12,14 +12,14 @@ class pluginMaintenanceMode extends Plugin {
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Enable maintenance mode').'</label>';
|
||||
$html .= '<label>'.$language->get('Enable maintenance mode').'</label>';
|
||||
$html .= '<select name="enable">';
|
||||
$html .= '<option value="true" '.($this->getValue('enable')===true?'selected':'').'>Enabled</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('enable')===false?'selected':'').'>Disabled</option>';
|
||||
@ -27,7 +27,7 @@ class pluginMaintenanceMode extends Plugin {
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Message').'</label>';
|
||||
$html .= '<label>'.$language->get('Message').'</label>';
|
||||
$html .= '<input name="message" id="jsmessage" type="text" value="'.$this->getValue('message').'">';
|
||||
$html .= '</div>';
|
||||
|
||||
|
@ -15,30 +15,30 @@ class pluginNavigation extends Plugin {
|
||||
// Method called on the settings of the plugin on the admin area
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Label').'</label>';
|
||||
$html .= '<label>'.$language->get('Label').'</label>';
|
||||
$html .= '<input id="jslabel" name="label" type="text" value="'.$this->getValue('label').'">';
|
||||
$html .= '<span class="tip">'.$Language->get('This title is almost always used in the sidebar of the site').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('This title is almost always used in the sidebar of the site').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Home link').'</label>';
|
||||
$html .= '<label>'.$language->get('Home link').'</label>';
|
||||
$html .= '<select name="homeLink">';
|
||||
$html .= '<option value="true" '.($this->getValue('homeLink')===true?'selected':'').'>'.$Language->get('Enabled').'</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('homeLink')===false?'selected':'').'>'.$Language->get('Disabled').'</option>';
|
||||
$html .= '<option value="true" '.($this->getValue('homeLink')===true?'selected':'').'>'.$language->get('Enabled').'</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('homeLink')===false?'selected':'').'>'.$language->get('Disabled').'</option>';
|
||||
$html .= '</select>';
|
||||
$html .= '<span class="tip">'.$Language->get('Show the home link on the sidebar').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('Show the home link on the sidebar').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
if (ORDER_BY=='date') {
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Amount of items').'</label>';
|
||||
$html .= '<label>'.$language->get('Amount of items').'</label>';
|
||||
$html .= '<input id="jsamountOfItems" name="amountOfItems" type="text" value="'.$this->getValue('amountOfItems').'">';
|
||||
$html .= '</div>';
|
||||
}
|
||||
@ -49,7 +49,7 @@ class pluginNavigation extends Plugin {
|
||||
// Method called on the sidebar of the website
|
||||
public function siteSidebar()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
global $url;
|
||||
global $site;
|
||||
global $pages;
|
||||
@ -69,7 +69,7 @@ class pluginNavigation extends Plugin {
|
||||
// Show Home page link
|
||||
if ($this->getValue('homeLink')) {
|
||||
$html .= '<li>';
|
||||
$html .= '<a href="' . $site->url() . '">' . $Language->get('Home page') . '</a>';
|
||||
$html .= '<a href="' . $site->url() . '">' . $language->get('Home page') . '</a>';
|
||||
$html .= '</li>';
|
||||
}
|
||||
|
||||
|
@ -12,14 +12,14 @@ class pluginOpenGraph extends Plugin {
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Default image').'</label>';
|
||||
$html .= '<label>'.$language->get('Default image').'</label>';
|
||||
$html .= '<input id="jsdefaultImage" name="defaultImage" type="text" value="'.$this->getValue('defaultImage').'" placeholder="https://">';
|
||||
$html .= '<span class="tip">Set a default image for the content without pictures.</span>';
|
||||
$html .= '</div>';
|
||||
|
@ -13,21 +13,21 @@ class pluginRSS extends Plugin {
|
||||
// Method called on the settings of the plugin on the admin area
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('RSS URL').'</label>';
|
||||
$html .= '<label>'.$language->get('RSS URL').'</label>';
|
||||
$html .= '<a href="'.Theme::rssUrl().'">'.Theme::rssUrl().'</a>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Amount of items').'</label>';
|
||||
$html .= '<label>'.$language->get('Amount of items').'</label>';
|
||||
$html .= '<input id="jsamountOfItems" name="amountOfItems" type="text" value="'.$this->getValue('amountOfItems').'">';
|
||||
$html .= '<span class="tip">'.$Language->get('Amount of items to show on the feed').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('Amount of items to show on the feed').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
|
@ -20,24 +20,24 @@ class pluginSimpleStats extends Plugin {
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Label').'</label>';
|
||||
$html .= '<label>'.$language->get('Label').'</label>';
|
||||
$html .= '<input id="jslabel" name="label" type="text" value="'.$this->getValue('label').'">';
|
||||
$html .= '<span class="tip">'.$Language->get('This title is almost always used in the sidebar of the site').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('This title is almost always used in the sidebar of the site').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
if (defined('BLUDIT_PRO')) {
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Exclude administrators users').'</label>';
|
||||
$html .= '<label>'.$language->get('Exclude administrators users').'</label>';
|
||||
$html .= '<select name="excludeAdmins">';
|
||||
$html .= '<option value="true" '.($this->getValue('excludeAdmins')===true?'selected':'').'>'.$Language->get('Enabled').'</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('excludeAdmins')===false?'selected':'').'>'.$Language->get('Disabled').'</option>';
|
||||
$html .= '<option value="true" '.($this->getValue('excludeAdmins')===true?'selected':'').'>'.$language->get('Enabled').'</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('excludeAdmins')===false?'selected':'').'>'.$language->get('Disabled').'</option>';
|
||||
$html .= '</select>';
|
||||
$html .= '</div>';
|
||||
}
|
||||
|
@ -18,23 +18,23 @@ class pluginsimpleMDE extends Plugin {
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div>';
|
||||
$html .= '<label>'.$Language->get('toolbar').'</label>';
|
||||
$html .= '<label>'.$language->get('toolbar').'</label>';
|
||||
$html .= '<input name="toolbar" id="jstoolbar" type="text" value="'.$this->getValue('toolbar').'">';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('tab-size').'</label>';
|
||||
$html .= '<label>'.$language->get('tab-size').'</label>';
|
||||
$html .= '<input name="tabSize" id="jstabSize" type="text" value="'.$this->getValue('tabSize').'">';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('spell-checker').'</label>';
|
||||
$html .= '<label>'.$language->get('spell-checker').'</label>';
|
||||
$html .= '<select name="spellChecker">';
|
||||
$html .= '<option value="true" '.($this->getValue('spellChecker')===true?'selected':'').'>'.$Language->get('enabled').'</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('spellChecker')===false?'selected':'').'>'.$Language->get('disabled').'</option>';
|
||||
$html .= '<option value="true" '.($this->getValue('spellChecker')===true?'selected':'').'>'.$language->get('enabled').'</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('spellChecker')===false?'selected':'').'>'.$language->get('disabled').'</option>';
|
||||
$html .= '</select>';
|
||||
$html .= '</div>';
|
||||
|
||||
@ -55,7 +55,7 @@ class pluginsimpleMDE extends Plugin {
|
||||
|
||||
public function adminBodyEnd()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
if (!in_array($GLOBALS['ADMIN_CONTROLLER'], $this->loadOnController)) {
|
||||
return false;
|
||||
@ -85,7 +85,7 @@ class pluginsimpleMDE extends Plugin {
|
||||
// Function required for Media Manager
|
||||
// Insert an image on the editor in the cursor position
|
||||
$html .= 'function editorInsertMedia(filename) {
|
||||
addContentSimpleMDE("!['.$Language->get('Image description').']("+filename+")");
|
||||
addContentSimpleMDE("!['.$language->get('Image description').']("+filename+")");
|
||||
}'.PHP_EOL;
|
||||
|
||||
$html .= '$(document).ready(function() { '.PHP_EOL;
|
||||
@ -96,7 +96,7 @@ class pluginsimpleMDE extends Plugin {
|
||||
toolbarTips: true,
|
||||
toolbarGuideIcon: true,
|
||||
autofocus: false,
|
||||
placeholder: "'.$Language->get('content-here-supports-markdown-and-html-code').'",
|
||||
placeholder: "'.$language->get('content-here-supports-markdown-and-html-code').'",
|
||||
lineWrapping: true,
|
||||
autoDownloadFontAwesome: false,
|
||||
indentWithTabs: true,
|
||||
@ -112,7 +112,7 @@ class pluginsimpleMDE extends Plugin {
|
||||
cm.replaceSelection(output);
|
||||
},
|
||||
className: "oi oi-crop",
|
||||
title: "'.$Language->get('Pagebreak').'",
|
||||
title: "'.$language->get('Pagebreak').'",
|
||||
}]
|
||||
});';
|
||||
$html .= '}); </script>';
|
||||
|
@ -10,10 +10,10 @@ class pluginSitemap extends Plugin {
|
||||
// Method called on the settings of the plugin on the admin area
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div>';
|
||||
$html .= '<label>'.$Language->get('Sitemap URL').'</label>';
|
||||
$html .= '<label>'.$language->get('Sitemap URL').'</label>';
|
||||
$html .= '<a href="'.Theme::sitemapUrl().'">'.Theme::sitemapUrl().'</a>';
|
||||
$html .= '</div>';
|
||||
|
||||
|
@ -14,25 +14,25 @@ class pluginStaticPages extends Plugin {
|
||||
// Method called on the settings of the plugin on the admin area
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Label').'</label>';
|
||||
$html .= '<label>'.$language->get('Label').'</label>';
|
||||
$html .= '<input id="jslabel" name="label" type="text" value="'.$this->getValue('label').'">';
|
||||
$html .= '<span class="tip">'.$Language->get('This title is almost always used in the sidebar of the site').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('This title is almost always used in the sidebar of the site').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Home link').'</label>';
|
||||
$html .= '<label>'.$language->get('Home link').'</label>';
|
||||
$html .= '<select name="homeLink">';
|
||||
$html .= '<option value="true" '.($this->getValue('homeLink')===true?'selected':'').'>'.$Language->get('Enabled').'</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('homeLink')===false?'selected':'').'>'.$Language->get('Disabled').'</option>';
|
||||
$html .= '<option value="true" '.($this->getValue('homeLink')===true?'selected':'').'>'.$language->get('Enabled').'</option>';
|
||||
$html .= '<option value="false" '.($this->getValue('homeLink')===false?'selected':'').'>'.$language->get('Disabled').'</option>';
|
||||
$html .= '</select>';
|
||||
$html .= '<span class="tip">'.$Language->get('show-the-home-link-on-the-sidebar').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('show-the-home-link-on-the-sidebar').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
@ -41,7 +41,7 @@ class pluginStaticPages extends Plugin {
|
||||
// Method called on the sidebar of the website
|
||||
public function siteSidebar()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
global $url;
|
||||
global $site;
|
||||
global $pages;
|
||||
@ -61,7 +61,7 @@ class pluginStaticPages extends Plugin {
|
||||
// Show Home page link
|
||||
if ($this->getValue('homeLink')) {
|
||||
$html .= '<li>';
|
||||
$html .= '<a href="' . $site->url() . '">' . $Language->get('Home page') . '</a>';
|
||||
$html .= '<a href="' . $site->url() . '">' . $language->get('Home page') . '</a>';
|
||||
$html .= '</li>';
|
||||
}
|
||||
|
||||
|
@ -11,16 +11,16 @@ class pluginTags extends Plugin {
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Label').'</label>';
|
||||
$html .= '<label>'.$language->get('Label').'</label>';
|
||||
$html .= '<input id="jslabel" name="label" type="text" value="'.$this->getValue('label').'">';
|
||||
$html .= '<span class="tip">'.$Language->get('This title is almost always used in the sidebar of the site').'</span>';
|
||||
$html .= '<span class="tip">'.$language->get('This title is almost always used in the sidebar of the site').'</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
@ -28,7 +28,7 @@ class pluginTags extends Plugin {
|
||||
|
||||
public function siteSidebar()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
global $tags;
|
||||
global $url;
|
||||
|
||||
|
@ -18,20 +18,20 @@ class pluginTinymce extends Plugin {
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div>';
|
||||
$html .= '<label>'.$Language->get('Toolbar top').'</label>';
|
||||
$html .= '<label>'.$language->get('Toolbar top').'</label>';
|
||||
$html .= '<input name="toolbar1" id="jstoolbar1" type="text" value="'.$this->getValue('toolbar1').'">';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Toolbar bottom').'</label>';
|
||||
$html .= '<label>'.$language->get('Toolbar bottom').'</label>';
|
||||
$html .= '<input name="toolbar2" id="jstoolbar2" type="text" value="'.$this->getValue('toolbar2').'">';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Plugins').'</label>';
|
||||
$html .= '<label>'.$language->get('Plugins').'</label>';
|
||||
$html .= '<input name="plugins" id="jsplugins" type="text" value="'.$this->getValue('plugins').'">';
|
||||
$html .= '</div>';
|
||||
|
||||
@ -53,17 +53,17 @@ class pluginTinymce extends Plugin {
|
||||
return false;
|
||||
}
|
||||
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$toolbar1 = $this->getValue('toolbar1');
|
||||
$toolbar2 = $this->getValue('toolbar2');
|
||||
$plugins = $this->getValue('plugins');
|
||||
|
||||
$lang = 'en';
|
||||
if (file_exists($this->phpPath().'tinymce'.DS.'langs'.DS.$Language->currentLanguage().'.js')) {
|
||||
$lang = $Language->currentLanguage();
|
||||
} elseif (file_exists($this->phpPath().'tinymce'.DS.'langs'.DS.$Language->currentLanguageShortVersion().'.js')) {
|
||||
$lang = $Language->currentLanguageShortVersion();
|
||||
if (file_exists($this->phpPath().'tinymce'.DS.'langs'.DS.$language->currentLanguage().'.js')) {
|
||||
$lang = $language->currentLanguage();
|
||||
} elseif (file_exists($this->phpPath().'tinymce'.DS.'langs'.DS.$language->currentLanguageShortVersion().'.js')) {
|
||||
$lang = $language->currentLanguageShortVersion();
|
||||
}
|
||||
|
||||
$script = <<<EOF
|
||||
|
@ -12,14 +12,14 @@ class pluginTwitterCards extends Plugin {
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
$html = '<div class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Default image').'</label>';
|
||||
$html .= '<label>'.$language->get('Default image').'</label>';
|
||||
$html .= '<input id="jsdefaultImage" name="defaultImage" type="text" value="'.$this->getValue('defaultImage').'" placeholder="https://">';
|
||||
$html .= '</div>';
|
||||
|
||||
|
@ -104,7 +104,7 @@ class pluginUpdater extends Plugin {
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
return '<div class="alert alert-success">This plugin is not yet complete</div>';
|
||||
|
||||
@ -113,7 +113,7 @@ class pluginUpdater extends Plugin {
|
||||
}
|
||||
|
||||
$html = '<div>';
|
||||
$html .= '<button name="updateNow" value="true" class="btn btn-primary" type="submit">'.$Language->get('Update Now').'</button>';
|
||||
$html .= '<button name="updateNow" value="true" class="btn btn-primary" type="submit">'.$language->get('Update Now').'</button>';
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
|
@ -4,9 +4,9 @@ class pluginVersion extends Plugin {
|
||||
|
||||
public function adminSidebar()
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
$html = '<a id="current-version" class="nav-link" href="'.HTML_PATH_ADMIN_ROOT.'about'.'">Version '.(defined('BLUDIT_PRO')?'<span class="oi oi-heart" style="color: #ffc107"></span>':'').'<span class="badge badge-warning badge-pill">'.BLUDIT_VERSION.'</span></a>';
|
||||
$html .= '<a id="new-version" style="display: none;" target="_blank" href="https://www.bludit.com">'.$Language->get('New version available').' <span class="oi oi-bell" style="color: red"></span></a>';
|
||||
$html .= '<a id="new-version" style="display: none;" target="_blank" href="https://www.bludit.com">'.$language->get('New version available').' <span class="oi oi-bell" style="color: red"></span></a>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
<!-- Shows "read more" button if necessary -->
|
||||
<?php if ($page->readMore()): ?>
|
||||
<div class="text-right pt-3">
|
||||
<a class="btn btn-primary btn-sm" href="<?php echo $page->permalink(); ?>" role="button"><?php echo $Language->get('Read more'); ?></a>
|
||||
<a class="btn btn-primary btn-sm" href="<?php echo $page->permalink(); ?>" role="button"><?php echo $language->get('Read more'); ?></a>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
<!-- Previous button -->
|
||||
<li class="page-item mr-2 <?php if (!Paginator::showPrev()) echo 'disabled' ?>">
|
||||
<a class="page-link" href="<?php echo Paginator::previousPageUrl() ?>" tabindex="-1">◀ <?php echo $Language->get('Previous'); ?></a>
|
||||
<a class="page-link" href="<?php echo Paginator::previousPageUrl() ?>" tabindex="-1">◀ <?php echo $language->get('Previous'); ?></a>
|
||||
</li>
|
||||
|
||||
<!-- Home button -->
|
||||
@ -64,7 +64,7 @@
|
||||
|
||||
<!-- Next button -->
|
||||
<li class="page-item ml-2 <?php if (!Paginator::showNext()) echo 'disabled' ?>">
|
||||
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>"><?php echo $Language->get('Next'); ?> ►</a>
|
||||
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>"><?php echo $language->get('Next'); ?> ►</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -18,14 +18,14 @@
|
||||
</a>
|
||||
|
||||
<!-- Creation date -->
|
||||
<h6 class="card-subtitle mb-3 text-muted"><?php echo $page->date(); ?> - <?php echo $Language->get('Reading time') . ': ' . $page->readingTime(); ?></h6>
|
||||
<h6 class="card-subtitle mb-3 text-muted"><?php echo $page->date(); ?> - <?php echo $language->get('Reading time') . ': ' . $page->readingTime(); ?></h6>
|
||||
|
||||
<!-- Breaked content -->
|
||||
<?php echo $page->contentBreak(); ?>
|
||||
|
||||
<!-- "Read more" button -->
|
||||
<?php if ($page->readMore()): ?>
|
||||
<a href="<?php echo $page->permalink(); ?>"><?php echo $Language->get('Read more'); ?></a>
|
||||
<a href="<?php echo $page->permalink(); ?>"><?php echo $language->get('Read more'); ?></a>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
@ -46,7 +46,7 @@
|
||||
|
||||
<!-- Previous button -->
|
||||
<li class="page-item mr-2 <?php if (!Paginator::showPrev()) echo 'disabled' ?>">
|
||||
<a class="page-link" href="<?php echo Paginator::previousPageUrl() ?>" tabindex="-1">◀ <?php echo $Language->get('Previous'); ?></a>
|
||||
<a class="page-link" href="<?php echo Paginator::previousPageUrl() ?>" tabindex="-1">◀ <?php echo $language->get('Previous'); ?></a>
|
||||
</li>
|
||||
|
||||
<!-- Home button -->
|
||||
@ -56,7 +56,7 @@
|
||||
|
||||
<!-- Next button -->
|
||||
<li class="page-item ml-2 <?php if (!Paginator::showNext()) echo 'disabled' ?>">
|
||||
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>"><?php echo $Language->get('Next'); ?> ►</a>
|
||||
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>"><?php echo $language->get('Next'); ?> ►</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
<?php if (!$page->isStatic() && !$url->notFound()): ?>
|
||||
<!-- Creation date -->
|
||||
<h6 class="card-subtitle mb-3 text-muted"><?php echo $page->date(); ?> - <?php echo $Language->get('Reading time') . ': ' . $page->readingTime() ?></h6>
|
||||
<h6 class="card-subtitle mb-3 text-muted"><?php echo $page->date(); ?> - <?php echo $language->get('Reading time') . ': ' . $page->readingTime() ?></h6>
|
||||
<?php endif ?>
|
||||
|
||||
<!-- Full content -->
|
||||
|
46
install.php
46
install.php
@ -253,7 +253,7 @@ RewriteRule ^(.*) index.php [PT,L]
|
||||
// Install Bludit
|
||||
function install($adminPassword, $timezone)
|
||||
{
|
||||
global $Language;
|
||||
global $language;
|
||||
|
||||
if (!date_default_timezone_set($timezone)) {
|
||||
date_default_timezone_set('UTC');
|
||||
@ -268,8 +268,8 @@ function install($adminPassword, $timezone)
|
||||
// Directories for initial pages
|
||||
$pagesToInstall = array('example-page-1-slug', 'example-page-2-slug', 'example-page-3-slug', 'example-page-4-slug');
|
||||
foreach ($pagesToInstall as $page) {
|
||||
if (!mkdir(PATH_PAGES.$Language->get($page), DIR_PERMISSIONS, true)) {
|
||||
$errorText = 'Error when trying to created the directory=>'.PATH_PAGES.$Language->get($page);
|
||||
if (!mkdir(PATH_PAGES.$language->get($page), DIR_PERMISSIONS, true)) {
|
||||
$errorText = 'Error when trying to created the directory=>'.PATH_PAGES.$language->get($page);
|
||||
error_log('[ERROR] '.$errorText, 0);
|
||||
}
|
||||
}
|
||||
@ -312,8 +312,8 @@ function install($adminPassword, $timezone)
|
||||
$title = Text::replace('slug','title', $slug);
|
||||
$content = Text::replace('slug','content', $slug);
|
||||
|
||||
$data[$Language->get($slug)]= array(
|
||||
'title'=>$Language->get($title),
|
||||
$data[$language->get($slug)]= array(
|
||||
'title'=>$language->get($title),
|
||||
'description'=>'',
|
||||
'username'=>'admin',
|
||||
'tags'=>array(),
|
||||
@ -333,7 +333,7 @@ function install($adminPassword, $timezone)
|
||||
'noarchive'=>false
|
||||
);
|
||||
|
||||
file_put_contents(PATH_PAGES.$Language->get($slug).DS.FILENAME, $Language->get($content), LOCK_EX);
|
||||
file_put_contents(PATH_PAGES.$language->get($slug).DS.FILENAME, $language->get($content), LOCK_EX);
|
||||
}
|
||||
file_put_contents(PATH_DATABASES.'pages.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
||||
|
||||
@ -349,12 +349,12 @@ function install($adminPassword, $timezone)
|
||||
}
|
||||
$data = array(
|
||||
'title'=>'BLUDIT',
|
||||
'slogan'=>$Language->get('welcome-to-bludit'),
|
||||
'description'=>$Language->get('congratulations-you-have-successfully-installed-your-bludit'),
|
||||
'slogan'=>$language->get('welcome-to-bludit'),
|
||||
'description'=>$language->get('congratulations-you-have-successfully-installed-your-bludit'),
|
||||
'footer'=>'Copyright © '.Date::current('Y'),
|
||||
'itemsPerPage'=>6,
|
||||
'language'=>$Language->currentLanguage(),
|
||||
'locale'=>$Language->locale(),
|
||||
'language'=>$language->currentLanguage(),
|
||||
'locale'=>$language->locale(),
|
||||
'timezone'=>$timezone,
|
||||
'theme'=>'alternative',
|
||||
'adminTheme'=>'booty',
|
||||
@ -394,7 +394,7 @@ function install($adminPassword, $timezone)
|
||||
$data = array(
|
||||
'admin'=>array(
|
||||
'nickname'=>'Admin',
|
||||
'firstName'=>$Language->get('Administrator'),
|
||||
'firstName'=>$language->get('Administrator'),
|
||||
'lastName'=>'',
|
||||
'role'=>'admin',
|
||||
'password'=>$passwordHash,
|
||||
@ -458,8 +458,8 @@ function install($adminPassword, $timezone)
|
||||
$dataHead.json_encode(
|
||||
array(
|
||||
'position'=>1,
|
||||
'label'=>$Language->get('About'),
|
||||
'text'=>$Language->get('this-is-a-brief-description-of-yourself-our-your-site')
|
||||
'label'=>$language->get('About'),
|
||||
'text'=>$language->get('this-is-a-brief-description-of-yourself-our-your-site')
|
||||
),
|
||||
JSON_PRETTY_PRINT),
|
||||
LOCK_EX
|
||||
@ -471,7 +471,7 @@ function install($adminPassword, $timezone)
|
||||
$dataHead.json_encode(
|
||||
array(
|
||||
'position'=>2,
|
||||
'label'=>$Language->get('Tags')
|
||||
'label'=>$language->get('Tags')
|
||||
),
|
||||
JSON_PRETTY_PRINT),
|
||||
LOCK_EX
|
||||
@ -483,7 +483,7 @@ function install($adminPassword, $timezone)
|
||||
$dataHead.json_encode(
|
||||
array(
|
||||
'numberOfDays'=>7,
|
||||
'label'=>$Language->get('Visits'),
|
||||
'label'=>$language->get('Visits'),
|
||||
'excludeAdmins'=>false,
|
||||
'position'=>1
|
||||
),
|
||||
@ -555,7 +555,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?php echo $Language->get('Bludit Installer') ?></title>
|
||||
<title><?php echo $language->get('Bludit Installer') ?></title>
|
||||
<meta charset="<?php echo CHARSET ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="robots" content="noindex,nofollow">
|
||||
@ -576,7 +576,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
<div class="container">
|
||||
<div class="row justify-content-md-center pt-5">
|
||||
<div class="col-md-4 pt-5">
|
||||
<h1 class="text-center mb-5 mt-5 font-weight-normal text-uppercase" style="color: #555;"><?php echo $Language->get('Bludit Installer') ?></h1>
|
||||
<h1 class="text-center mb-5 mt-5 font-weight-normal text-uppercase" style="color: #555;"><?php echo $language->get('Bludit Installer') ?></h1>
|
||||
<?php
|
||||
$system = checkSystem();
|
||||
if (!empty($system)) {
|
||||
@ -591,7 +591,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
elseif (isset($_GET['language']))
|
||||
{
|
||||
?>
|
||||
<p><?php echo $Language->get('Choose a password for the username admin') ?></p>
|
||||
<p><?php echo $language->get('Choose a password for the username admin') ?></p>
|
||||
|
||||
<form id="jsformInstaller" method="post" action="" autocomplete="off">
|
||||
<input type="hidden" name="timezone" id="jstimezone" value="UTC">
|
||||
@ -601,12 +601,12 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-0">
|
||||
<input type="password" class="form-control form-control-lg" id="jspassword" name="password" placeholder="<?php $Language->p('Password') ?>">
|
||||
<input type="password" class="form-control form-control-lg" id="jspassword" name="password" placeholder="<?php $language->p('Password') ?>">
|
||||
</div>
|
||||
<div id="jsshowPassword" style="cursor: pointer;" class="text-center pt-0 text-muted"><?php $Language->p('Show password') ?></div>
|
||||
<div id="jsshowPassword" style="cursor: pointer;" class="text-center pt-0 text-muted"><?php $language->p('Show password') ?></div>
|
||||
|
||||
<div class="form-group mt-4">
|
||||
<button type="submit" class="btn btn-primary mr-2 w-100" name="install"><?php $Language->p('Install') ?></button>
|
||||
<button type="submit" class="btn btn-primary mr-2 w-100" name="install"><?php $language->p('Install') ?></button>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
@ -615,7 +615,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
{
|
||||
?>
|
||||
<form id="jsformLanguage" method="get" action="" autocomplete="off">
|
||||
<label for="jslanguage"><?php echo $Language->get('Choose your language') ?></label>
|
||||
<label for="jslanguage"><?php echo $language->get('Choose your language') ?></label>
|
||||
<select id="jslanguage" name="language" class="form-control form-control-lg">
|
||||
<?php
|
||||
$htmlOptions = getLanguageList();
|
||||
@ -626,7 +626,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
</select>
|
||||
|
||||
<div class="form-group mt-4">
|
||||
<button type="submit" class="btn btn-primary mr-2 w-100"><?php $Language->p('Next') ?></button>
|
||||
<button type="submit" class="btn btn-primary mr-2 w-100"><?php $language->p('Next') ?></button>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
|
Loading…
Reference in New Issue
Block a user