Merge 3737623dd75e0890cba58bd954ad3ad5f5b6ca6e into 1e0e663c23140182ca4202e565e915ae10d316e8
This commit is contained in:
commit
2a00980559
23
bl-kernel/abstract/plugin.class.php
Normal file → Executable file
23
bl-kernel/abstract/plugin.class.php
Normal file → Executable file
@ -22,8 +22,13 @@ class Plugin {
|
|||||||
// (array) Plugin's information.
|
// (array) Plugin's information.
|
||||||
public $metadata;
|
public $metadata;
|
||||||
|
|
||||||
|
// (dbLanguage) Plugin's localisation.
|
||||||
|
public $language;
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
|
global $Site;
|
||||||
|
|
||||||
$this->dbFields = array();
|
$this->dbFields = array();
|
||||||
|
|
||||||
$reflector = new ReflectionClass(get_class($this));
|
$reflector = new ReflectionClass(get_class($this));
|
||||||
@ -47,6 +52,16 @@ class Plugin {
|
|||||||
$metadataString = file_get_contents($this->filenameMetadata);
|
$metadataString = file_get_contents($this->filenameMetadata);
|
||||||
$this->metadata = json_decode($metadataString, true);
|
$this->metadata = json_decode($metadataString, true);
|
||||||
|
|
||||||
|
// Load localisation
|
||||||
|
$tmp = new dbLanguage($Site->locale(), PATH_PLUGINS.$this->directoryName.DS.'languages'.DS);
|
||||||
|
// Set name and description from the language file.
|
||||||
|
$this->setMetadata('name',$tmp->db['plugin-data']['name']);
|
||||||
|
$this->setMetadata('description',$tmp->db['plugin-data']['description']);
|
||||||
|
|
||||||
|
// Remove name and description
|
||||||
|
unset($tmp->db['plugin-data']);
|
||||||
|
$this->language = $tmp;
|
||||||
|
|
||||||
// If the plugin is installed then get the database.
|
// If the plugin is installed then get the database.
|
||||||
if($this->installed())
|
if($this->installed())
|
||||||
{
|
{
|
||||||
@ -218,8 +233,12 @@ class Plugin {
|
|||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
// This method is used on childre classes.
|
// This method is used on child classes.
|
||||||
// The user can define your own dbFields.
|
// The user can define their own dbFields.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function L($key)
|
||||||
|
{
|
||||||
|
return $this->language->get($key);
|
||||||
|
}
|
||||||
}
|
}
|
242
bl-kernel/admin/themes/default/index.php
Normal file → Executable file
242
bl-kernel/admin/themes/default/index.php
Normal file → Executable file
@ -30,134 +30,136 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<!-- Plugins -->
|
<!-- Plugins -->
|
||||||
<?php Theme::plugins('adminBodyBegin') ?>
|
<?php Theme::plugins('adminBodyBegin') ?>
|
||||||
|
|
||||||
<!-- Alert -->
|
<!-- Alert -->
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
<?php
|
|
||||||
if( Alert::defined() ) {
|
|
||||||
echo '$("#alert").slideDown().delay(3500).slideUp();';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
$(window).click(function() {
|
|
||||||
$("#alert").hide();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div id="alert" class="<?php echo (Alert::status()==ALERT_STATUS_OK)?'alert-ok':'alert-fail'; ?>">
|
|
||||||
<?php Alert::p() ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Offcanvas for Mobile -->
|
|
||||||
<a href="#offcanvas" class="uk-navbar-toggle uk-hidden-large" data-uk-offcanvas></a>
|
|
||||||
<div id="offcanvas" class="uk-offcanvas">
|
|
||||||
<div class="uk-offcanvas-bar">
|
|
||||||
<ul class="uk-nav uk-nav-offcanvas">
|
|
||||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><?php $L->p('Dashboard') ?></a></li>
|
|
||||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-post' ?>"><?php $L->p('New post') ?></a></li>
|
|
||||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-page' ?>"><?php $L->p('New page') ?></a></li>
|
|
||||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-posts' ?>"><?php $L->p('Manage posts') ?></a></li>
|
|
||||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-pages' ?>"><?php $L->p('Manage pages') ?></a></li>
|
|
||||||
<?php if($Login->role() == 'admin') { ?>
|
|
||||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>"><?php $L->p('Manage users') ?></a></li>
|
|
||||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-general' ?>"><?php $L->p('General settings') ?></a></li>
|
|
||||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-advanced' ?>"><?php $L->p('Advanced settings') ?></a></li>
|
|
||||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-regional' ?>"><?php $L->p('Language and timezone') ?></a></li>
|
|
||||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>"><?php $L->p('Plugins') ?></a></li>
|
|
||||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'themes' ?>"><?php $L->p('Themes') ?></a></li>
|
|
||||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'about' ?>"><?php $L->p('About') ?></a></li>
|
|
||||||
<?php } ?>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="bl-navbar-bg">
|
|
||||||
<nav id="bl-navbar">
|
|
||||||
<a href="" class="bl-brand">BLUDIT</a>
|
|
||||||
|
|
||||||
<div class="bl-navbar-right">
|
|
||||||
<?php $L->p('Welcome') ?> <?php echo $Login->username() ?> -
|
|
||||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'logout' ?>"><?php $L->p('Logout') ?></a>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="bl-container">
|
|
||||||
|
|
||||||
<div class="uk-grid uk-grid-small">
|
|
||||||
|
|
||||||
<div id="bl-sidebar" class="uk-width-1-4 uk-visible-large">
|
|
||||||
|
|
||||||
<ul class="uk-nav">
|
|
||||||
|
|
||||||
<li <?php echo ($layout['view']=='dashboard')?'class="uk-active"':'' ?>>
|
|
||||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><?php $L->p('Dashboard') ?></a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a target="_blank" href="<?php echo HTML_PATH_ROOT ?>"><?php $L->p('Website') ?></a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="uk-nav-header"><?php $L->p('Publish') ?></li>
|
|
||||||
<li <?php echo ($layout['view']=='new-post')?'class="uk-active"':'' ?>>
|
|
||||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-post' ?>"><?php $L->p('New post') ?></a>
|
|
||||||
</li>
|
|
||||||
<li <?php echo ($layout['view']=='new-page')?'class="uk-active"':'' ?>>
|
|
||||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-page' ?>"><?php $L->p('New page') ?></a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="uk-nav-header"><?php $L->p('Manage') ?></li>
|
|
||||||
<li <?php echo ($layout['view']=='manage-posts')?'class="uk-active"':'' ?>>
|
|
||||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-posts' ?>"><?php $L->p('Posts') ?></a>
|
|
||||||
</li>
|
|
||||||
<li <?php echo ($layout['view']=='manage-pages')?'class="uk-active"':'' ?>>
|
|
||||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-pages' ?>"><?php $L->p('Pages') ?></a>
|
|
||||||
</li>
|
|
||||||
<li <?php echo ($layout['view']=='users')?'class="uk-active"':'' ?>>
|
|
||||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>"><?php $L->p('Users') ?></a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="uk-nav-header"><?php $L->p('Settings') ?></li>
|
|
||||||
<li <?php echo ($layout['view']=='settings-general')?'class="uk-active"':'' ?>>
|
|
||||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-general' ?>"><?php $L->p('General') ?></a>
|
|
||||||
</li>
|
|
||||||
<li <?php echo ($layout['view']=='settings-advanced')?'class="uk-active"':'' ?>>
|
|
||||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-advanced' ?>"><?php $L->p('Advanced') ?></a>
|
|
||||||
</li>
|
|
||||||
<li <?php echo ($layout['view']=='settings-regional')?'class="uk-active"':'' ?>>
|
|
||||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-regional' ?>"><?php $L->p('Language and timezone') ?></a>
|
|
||||||
</li>
|
|
||||||
<li <?php echo ($layout['view']=='plugins')?'class="uk-active"':'' ?>>
|
|
||||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>"><?php $L->p('Plugins') ?></a>
|
|
||||||
</li>
|
|
||||||
<li <?php echo ($layout['view']=='themes')?'class="uk-active"':'' ?>>
|
|
||||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'themes' ?>"><?php $L->p('Themes') ?></a>
|
|
||||||
</li>
|
|
||||||
<li <?php echo ($layout['view']=='about')?'class="uk-active"':'' ?>>
|
|
||||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'about' ?>"><?php $L->p('About') ?></a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="bl-view" class="uk-width-3-4">
|
|
||||||
<?php
|
<?php
|
||||||
if( Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php') ) {
|
if( Alert::defined() ) {
|
||||||
include(PATH_ADMIN_VIEWS.$layout['view'].'.php');
|
echo '$("#alert").slideDown().delay(3500).slideUp();';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
$(window).click(function() {
|
||||||
|
$("#alert").hide();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div id="alert" class="<?php echo (Alert::status()==ALERT_STATUS_OK)?'alert-ok':'alert-fail'; ?>">
|
||||||
|
<?php Alert::p() ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Offcanvas for Mobile -->
|
||||||
|
<a href="#offcanvas" class="uk-navbar-toggle uk-hidden-large" data-uk-offcanvas></a>
|
||||||
|
<div id="offcanvas" class="uk-offcanvas">
|
||||||
|
<div class="uk-offcanvas-bar">
|
||||||
|
<ul class="uk-nav uk-nav-offcanvas">
|
||||||
|
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><?php $L->p('Dashboard') ?></a></li>
|
||||||
|
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-post' ?>"><?php $L->p('New post') ?></a></li>
|
||||||
|
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-page' ?>"><?php $L->p('New page') ?></a></li>
|
||||||
|
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-posts' ?>"><?php $L->p('Manage posts') ?></a></li>
|
||||||
|
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-pages' ?>"><?php $L->p('Manage pages') ?></a></li>
|
||||||
|
<?php if($Login->role() == 'admin') { ?>
|
||||||
|
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>"><?php $L->p('Manage users') ?></a></li>
|
||||||
|
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-general' ?>"><?php $L->p('General settings') ?></a></li>
|
||||||
|
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-advanced' ?>"><?php $L->p('Advanced settings') ?></a></li>
|
||||||
|
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-regional' ?>"><?php $L->p('Language and timezone') ?></a></li>
|
||||||
|
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>"><?php $L->p('Plugins') ?></a></li>
|
||||||
|
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'themes' ?>"><?php $L->p('Themes') ?></a></li>
|
||||||
|
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'about' ?>"><?php $L->p('About') ?></a></li>
|
||||||
|
<?php } ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="bl-navbar-bg">
|
||||||
|
<nav id="bl-navbar">
|
||||||
|
<a href="" class="bl-brand">BLUDIT</a>
|
||||||
|
|
||||||
|
<div class="bl-navbar-right">
|
||||||
|
<?php $L->p('Welcome') ?> <?php echo $Login->username() ?> -
|
||||||
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'logout' ?>"><?php $L->p('Logout') ?></a>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="bl-container">
|
||||||
|
|
||||||
|
<div class="uk-grid uk-grid-small">
|
||||||
|
|
||||||
|
<div id="bl-sidebar" class="uk-width-1-4 uk-visible-large">
|
||||||
|
|
||||||
|
<ul class="uk-nav">
|
||||||
|
|
||||||
|
<li <?php echo ($layout['view']=='dashboard')?'class="uk-active"':'' ?>>
|
||||||
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><?php $L->p('Dashboard') ?></a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a target="_blank" href="<?php echo HTML_PATH_ROOT ?>"><?php $L->p('Website') ?></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="uk-nav-header"><?php $L->p('Publish') ?></li>
|
||||||
|
<li <?php echo ($layout['view']=='new-post')?'class="uk-active"':'' ?>>
|
||||||
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-post' ?>"><?php $L->p('New post') ?></a>
|
||||||
|
</li>
|
||||||
|
<li <?php echo ($layout['view']=='new-page')?'class="uk-active"':'' ?>>
|
||||||
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-page' ?>"><?php $L->p('New page') ?></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="uk-nav-header"><?php $L->p('Manage') ?></li>
|
||||||
|
<li <?php echo ($layout['view']=='manage-posts')?'class="uk-active"':'' ?>>
|
||||||
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-posts' ?>"><?php $L->p('Posts') ?></a>
|
||||||
|
</li>
|
||||||
|
<li <?php echo ($layout['view']=='manage-pages')?'class="uk-active"':'' ?>>
|
||||||
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-pages' ?>"><?php $L->p('Pages') ?></a>
|
||||||
|
</li>
|
||||||
|
<li <?php echo ($layout['view']=='users')?'class="uk-active"':'' ?>>
|
||||||
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>"><?php $L->p('Users') ?></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="uk-nav-header"><?php $L->p('Settings') ?></li>
|
||||||
|
<li <?php echo ($layout['view']=='settings-general')?'class="uk-active"':'' ?>>
|
||||||
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-general' ?>"><?php $L->p('General') ?></a>
|
||||||
|
</li>
|
||||||
|
<li <?php echo ($layout['view']=='settings-advanced')?'class="uk-active"':'' ?>>
|
||||||
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-advanced' ?>"><?php $L->p('Advanced') ?></a>
|
||||||
|
</li>
|
||||||
|
<li <?php echo ($layout['view']=='settings-regional')?'class="uk-active"':'' ?>>
|
||||||
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-regional' ?>"><?php $L->p('Language and timezone') ?></a>
|
||||||
|
</li>
|
||||||
|
<li <?php echo ($layout['view']=='plugins')?'class="uk-active"':'' ?>>
|
||||||
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>"><?php $L->p('Plugins') ?></a>
|
||||||
|
</li>
|
||||||
|
<li <?php echo ($layout['view']=='themes')?'class="uk-active"':'' ?>>
|
||||||
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'themes' ?>"><?php $L->p('Themes') ?></a>
|
||||||
|
</li>
|
||||||
|
<li <?php echo ($layout['view']=='about')?'class="uk-active"':'' ?>>
|
||||||
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'about' ?>"><?php $L->p('About') ?></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="bl-view" class="uk-width-3-4">
|
||||||
|
<?php
|
||||||
|
if( Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php') ) {
|
||||||
|
include(PATH_ADMIN_VIEWS.$layout['view'].'.php');
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Javascript -->
|
<!-- Javascript -->
|
||||||
<?php include(PATH_JS.'functions.php') ?>
|
<?php include(PATH_JS.'functions.php') ?>
|
||||||
|
|
||||||
<!-- Plugins -->
|
<!-- Plugins -->
|
||||||
<?php Theme::plugins('adminBodyEnd') ?>
|
<?php Theme::plugins('adminBodyEnd') ?>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
23
bl-kernel/boot/rules/60.plugins.php
Normal file → Executable file
23
bl-kernel/boot/rules/60.plugins.php
Normal file → Executable file
@ -75,26 +75,13 @@ function buildPlugins()
|
|||||||
|
|
||||||
foreach($pluginsDeclaredClasess as $pluginClass)
|
foreach($pluginsDeclaredClasess as $pluginClass)
|
||||||
{
|
{
|
||||||
$Plugin = new $pluginClass;
|
// Ignore non-plugin classes
|
||||||
|
if ( !is_subclass_of( $pluginClass, 'Plugin' ) )
|
||||||
// Check if the plugin is translated.
|
{
|
||||||
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.$Site->locale().'.json';
|
continue;
|
||||||
if( !Sanitize::pathFile($languageFilename) ) {
|
|
||||||
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.'en_US.json';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$database = file_get_contents($languageFilename);
|
$Plugin = new $pluginClass();
|
||||||
$database = json_decode($database, true);
|
|
||||||
|
|
||||||
// Set name and description from the language file.
|
|
||||||
$Plugin->setMetadata('name',$database['plugin-data']['name']);
|
|
||||||
$Plugin->setMetadata('description',$database['plugin-data']['description']);
|
|
||||||
|
|
||||||
// Remove name and description, and add new words if there are.
|
|
||||||
unset($database['plugin-data']);
|
|
||||||
if(!empty($database)) {
|
|
||||||
$Language->add($database);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Push Plugin to array all plugins installed and not installed.
|
// Push Plugin to array all plugins installed and not installed.
|
||||||
$plugins['all'][$pluginClass] = $Plugin;
|
$plugins['all'][$pluginClass] = $Plugin;
|
||||||
|
17
bl-kernel/dblanguage.class.php
Normal file → Executable file
17
bl-kernel/dblanguage.class.php
Normal file → Executable file
@ -6,22 +6,24 @@ class dbLanguage extends dbJSON
|
|||||||
public $db;
|
public $db;
|
||||||
public $currentLocale;
|
public $currentLocale;
|
||||||
|
|
||||||
function __construct($locale)
|
function __construct( $locale, $path = null )
|
||||||
{
|
{
|
||||||
|
$path = $path ? $path : PATH_LANGUAGES;
|
||||||
|
|
||||||
$this->data = array();
|
$this->data = array();
|
||||||
$this->db = array();
|
$this->db = array();
|
||||||
$this->currentLocale = 'en_US';
|
$this->currentLocale = 'en_US';
|
||||||
|
|
||||||
// Default language en_US
|
// Default language en_US
|
||||||
$filename = PATH_LANGUAGES.'en_US.json';
|
$filename = $path.'en_US.json';
|
||||||
if( Sanitize::pathFile($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 = $Tmp->db;
|
||||||
}
|
}
|
||||||
|
|
||||||
// User language
|
// User language
|
||||||
$filename = PATH_LANGUAGES.$locale.'.json';
|
$filename = $path.$locale.'.json';
|
||||||
if( Sanitize::pathFile($filename) && ($locale!=="en_US") )
|
if( Sanitize::pathFile($filename) && ($locale!=="en_US") )
|
||||||
{
|
{
|
||||||
$this->currentLocale = $locale;
|
$this->currentLocale = $locale;
|
||||||
@ -29,8 +31,11 @@ class dbLanguage extends dbJSON
|
|||||||
$this->db = array_merge($this->db, $Tmp->db);
|
$this->db = array_merge($this->db, $Tmp->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->data = $this->db['language-data'];
|
if ( $this->data )
|
||||||
unset($this->db['language-data']);
|
{
|
||||||
|
$this->data = $this->db['language-data'];
|
||||||
|
unset($this->db['language-data']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCurrentLocale()
|
public function getCurrentLocale()
|
||||||
|
6
bl-plugins/about/plugin.php
Normal file → Executable file
6
bl-plugins/about/plugin.php
Normal file → Executable file
@ -12,14 +12,12 @@ class pluginAbout extends Plugin {
|
|||||||
|
|
||||||
public function form()
|
public function form()
|
||||||
{
|
{
|
||||||
global $Language;
|
|
||||||
|
|
||||||
$html = '<div>';
|
$html = '<div>';
|
||||||
$html .= '<label>'.$Language->get('Plugin label').'</label>';
|
$html .= '<label>'.$this->L('Plugin label').'</label>';
|
||||||
$html .= '<input name="label" id="jslabel" type="text" value="'.$this->getDbField('label').'">';
|
$html .= '<input name="label" id="jslabel" type="text" value="'.$this->getDbField('label').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<label>'.$Language->get('About').'</label>';
|
$html .= '<label>'.$this->L('About').'</label>';
|
||||||
$html .= '<textarea name="text" id="jstext">'.$this->getDbField('text').'</textarea>';
|
$html .= '<textarea name="text" id="jstext">'.$this->getDbField('text').'</textarea>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
|
10
bl-plugins/disqus/plugin.php
Normal file → Executable file
10
bl-plugins/disqus/plugin.php
Normal file → Executable file
@ -36,29 +36,27 @@ class pluginDisqus extends Plugin {
|
|||||||
|
|
||||||
public function form()
|
public function form()
|
||||||
{
|
{
|
||||||
global $Language;
|
|
||||||
|
|
||||||
$html = '<div>';
|
$html = '<div>';
|
||||||
$html .= '<label>'.$Language->get('Disqus shortname').'</label>';
|
$html .= '<label>'.$this->L('Disqus shortname').'</label>';
|
||||||
$html .= '<input name="shortname" id="jsshortname" type="text" value="'.$this->getDbField('shortname').'">';
|
$html .= '<input name="shortname" id="jsshortname" type="text" value="'.$this->getDbField('shortname').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<input type="hidden" name="enablePages" value="0">';
|
$html .= '<input type="hidden" name="enablePages" value="0">';
|
||||||
$html .= '<input name="enablePages" id="jsenablePages" type="checkbox" value="1" '.($this->getDbField('enablePages')?'checked':'').'>';
|
$html .= '<input name="enablePages" id="jsenablePages" type="checkbox" value="1" '.($this->getDbField('enablePages')?'checked':'').'>';
|
||||||
$html .= '<label class="forCheckbox" for="jsenablePages">'.$Language->get('Enable Disqus on pages').'</label>';
|
$html .= '<label class="forCheckbox" for="jsenablePages">'.$this->L('Enable Disqus on pages').'</label>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<input type="hidden" name="enablePosts" value="0">';
|
$html .= '<input type="hidden" name="enablePosts" value="0">';
|
||||||
$html .= '<input name="enablePosts" id="jsenablePosts" type="checkbox" value="1" '.($this->getDbField('enablePosts')?'checked':'').'>';
|
$html .= '<input name="enablePosts" id="jsenablePosts" type="checkbox" value="1" '.($this->getDbField('enablePosts')?'checked':'').'>';
|
||||||
$html .= '<label class="forCheckbox" for="jsenablePosts">'.$Language->get('Enable Disqus on posts').'</label>';
|
$html .= '<label class="forCheckbox" for="jsenablePosts">'.$this->L('Enable Disqus on posts').'</label>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<input type="hidden" name="enableDefaultHomePage" value="0">';
|
$html .= '<input type="hidden" name="enableDefaultHomePage" value="0">';
|
||||||
$html .= '<input name="enableDefaultHomePage" id="jsenableDefaultHomePage" type="checkbox" value="1" '.($this->getDbField('enableDefaultHomePage')?'checked':'').'>';
|
$html .= '<input name="enableDefaultHomePage" id="jsenableDefaultHomePage" type="checkbox" value="1" '.($this->getDbField('enableDefaultHomePage')?'checked':'').'>';
|
||||||
$html .= '<label class="forCheckbox" for="jsenableDefaultHomePage">'.$Language->get('Enable Disqus on default home page').'</label>';
|
$html .= '<label class="forCheckbox" for="jsenableDefaultHomePage">'.$this->L('Enable Disqus on default home page').'</label>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
|
10
bl-plugins/googletools/plugin.php
Normal file → Executable file
10
bl-plugins/googletools/plugin.php
Normal file → Executable file
@ -12,18 +12,16 @@ class pluginGoogleTools extends Plugin {
|
|||||||
|
|
||||||
public function form()
|
public function form()
|
||||||
{
|
{
|
||||||
global $Language;
|
|
||||||
|
|
||||||
$html = '<div>';
|
$html = '<div>';
|
||||||
$html .= '<label for="jsgoogle-site-verification">'.$Language->get('Google Webmasters tools').'</label>';
|
$html .= '<label for="jsgoogle-site-verification">'.$this->L('Google Webmasters tools').'</label>';
|
||||||
$html .= '<input id="jsgoogle-site-verification" type="text" name="google-site-verification" value="'.$this->getDbField('google-site-verification').'">';
|
$html .= '<input id="jsgoogle-site-verification" type="text" name="google-site-verification" value="'.$this->getDbField('google-site-verification').'">';
|
||||||
$html .= '<div class="tip">'.$Language->get('complete-this-field-with-the-google-site-verification').'</div>';
|
$html .= '<div class="tip">'.$this->L('complete-this-field-with-the-google-site-verification').'</div>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<label for="jstracking-id">'.$Language->get('Google Analytics Tracking ID').'</label>';
|
$html .= '<label for="jstracking-id">'.$this->L('Google Analytics Tracking ID').'</label>';
|
||||||
$html .= '<input id="jstracking-id" type="text" name="tracking-id" value="'.$this->getDbField('tracking-id').'">';
|
$html .= '<input id="jstracking-id" type="text" name="tracking-id" value="'.$this->getDbField('tracking-id').'">';
|
||||||
$html .= '<div class="tip">'.$Language->get('complete-this-field-with-the-tracking-id').'</div>';
|
$html .= '<div class="tip">'.$this->L('complete-this-field-with-the-tracking-id').'</div>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
|
6
bl-plugins/latest_posts/plugin.php
Normal file → Executable file
6
bl-plugins/latest_posts/plugin.php
Normal file → Executable file
@ -12,15 +12,13 @@ class pluginLatestPosts extends Plugin {
|
|||||||
|
|
||||||
public function form()
|
public function form()
|
||||||
{
|
{
|
||||||
global $Language;
|
|
||||||
|
|
||||||
$html = '<div>';
|
$html = '<div>';
|
||||||
$html .= '<label>'.$Language->get('Plugin label').'</label>';
|
$html .= '<label>'.$this->L('Plugin label').'</label>';
|
||||||
$html .= '<input name="label" id="jslabel" type="text" value="'.$this->getDbField('label').'">';
|
$html .= '<input name="label" id="jslabel" type="text" value="'.$this->getDbField('label').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<label>'.$Language->get('Amount of posts').'</label>';
|
$html .= '<label>'.$this->L('Amount of posts').'</label>';
|
||||||
$html .= '<input name="amount" id="jsamount" type="text" value="'.$this->getDbField('amount').'">';
|
$html .= '<input name="amount" id="jsamount" type="text" value="'.$this->getDbField('amount').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
|
6
bl-plugins/maintenancemode/plugin.php
Normal file → Executable file
6
bl-plugins/maintenancemode/plugin.php
Normal file → Executable file
@ -12,16 +12,14 @@ class pluginMaintenanceMode extends Plugin {
|
|||||||
|
|
||||||
public function form()
|
public function form()
|
||||||
{
|
{
|
||||||
global $Language;
|
|
||||||
|
|
||||||
$html = '<div>';
|
$html = '<div>';
|
||||||
$html .= '<input type="hidden" name="enable" value="0">';
|
$html .= '<input type="hidden" name="enable" value="0">';
|
||||||
$html .= '<input name="enable" id="jsenable" type="checkbox" value="1" '.($this->getDbField('enable')?'checked':'').'>';
|
$html .= '<input name="enable" id="jsenable" type="checkbox" value="1" '.($this->getDbField('enable')?'checked':'').'>';
|
||||||
$html .= '<label class="forCheckbox" for="jsenable">'.$Language->get('Enable maintenance mode').'</label>';
|
$html .= '<label class="forCheckbox" for="jsenable">'.$this->L('Enable maintenance mode').'</label>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<label>'.$Language->get('Message').'</label>';
|
$html .= '<label>'.$this->L('Message').'</label>';
|
||||||
$html .= '<input name="message" id="jsmessage" type="text" value="'.$this->getDbField('message').'">';
|
$html .= '<input name="message" id="jsmessage" type="text" value="'.$this->getDbField('message').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
|
9
bl-plugins/pages/plugin.php
Normal file → Executable file
9
bl-plugins/pages/plugin.php
Normal file → Executable file
@ -13,17 +13,15 @@ class pluginPages extends Plugin {
|
|||||||
|
|
||||||
public function form()
|
public function form()
|
||||||
{
|
{
|
||||||
global $Language;
|
|
||||||
|
|
||||||
$html = '<div>';
|
$html = '<div>';
|
||||||
$html .= '<label>'.$Language->get('Plugin label').'</label>';
|
$html .= '<label>'.$this->L('Plugin label').'</label>';
|
||||||
$html .= '<input name="label" id="jslabel" type="text" value="'.$this->getDbField('label').'">';
|
$html .= '<input name="label" id="jslabel" type="text" value="'.$this->getDbField('label').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<input type="hidden" name="homeLink" value="0">';
|
$html .= '<input type="hidden" name="homeLink" value="0">';
|
||||||
$html .= '<input name="homeLink" id="jshomeLink" type="checkbox" value="1" '.($this->getDbField('homeLink')?'checked':'').'>';
|
$html .= '<input name="homeLink" id="jshomeLink" type="checkbox" value="1" '.($this->getDbField('homeLink')?'checked':'').'>';
|
||||||
$html .= '<label class="forCheckbox" for="jshomeLink">'.$Language->get('Show home link').'</label>';
|
$html .= '<label class="forCheckbox" for="jshomeLink">'.$this->L('Show home link').'</label>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
@ -37,7 +35,6 @@ class pluginPages extends Plugin {
|
|||||||
|
|
||||||
public function siteSidebar()
|
public function siteSidebar()
|
||||||
{
|
{
|
||||||
global $Language;
|
|
||||||
global $pagesParents;
|
global $pagesParents;
|
||||||
global $Site, $Url;
|
global $Site, $Url;
|
||||||
|
|
||||||
@ -55,7 +52,7 @@ class pluginPages extends Plugin {
|
|||||||
// Show home link ?
|
// Show home link ?
|
||||||
if($this->getDbField('homeLink')) {
|
if($this->getDbField('homeLink')) {
|
||||||
$html .= '<li>';
|
$html .= '<li>';
|
||||||
$html .= '<a class="parent'.( ($Url->whereAmI()=='home')?' active':'').'" href="'.$Site->homeLink().'">'.$Language->get('Home').'</a>';
|
$html .= '<a class="parent'.( ($Url->whereAmI()=='home')?' active':'').'" href="'.$Site->homeLink().'">'.$this->L('Home').'</a>';
|
||||||
$html .= '</li>';
|
$html .= '</li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
bl-plugins/simplemde/plugin.php
Normal file → Executable file
12
bl-plugins/simplemde/plugin.php
Normal file → Executable file
@ -21,22 +21,20 @@ class pluginsimpleMDE extends Plugin {
|
|||||||
|
|
||||||
public function form()
|
public function form()
|
||||||
{
|
{
|
||||||
global $Language;
|
|
||||||
|
|
||||||
$html = '<div>';
|
$html = '<div>';
|
||||||
$html .= '<label>'.$Language->get('Toolbar').'</label>';
|
$html .= '<label>'.$this->L('Toolbar').'</label>';
|
||||||
$html .= '<input name="toolbar" id="jstoolbar" type="text" value="'.$this->getDbField('toolbar').'">';
|
$html .= '<input name="toolbar" id="jstoolbar" type="text" value="'.$this->getDbField('toolbar').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<label>'.$Language->get('Tab size').'</label>';
|
$html .= '<label>'.$this->L('Tab size').'</label>';
|
||||||
$html .= '<input name="tabSize" id="jstabSize" type="text" value="'.$this->getDbField('tabSize').'">';
|
$html .= '<input name="tabSize" id="jstabSize" type="text" value="'.$this->getDbField('tabSize').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<input type="hidden" name="autosave" value="0">';
|
$html .= '<input type="hidden" name="autosave" value="0">';
|
||||||
$html .= '<input name="autosave" id="jsautosave" type="checkbox" value="1" '.($this->getDbField('autosave')?'checked':'').'>';
|
$html .= '<input name="autosave" id="jsautosave" type="checkbox" value="1" '.($this->getDbField('autosave')?'checked':'').'>';
|
||||||
$html .= '<label class="forCheckbox" for="jsautosave">'.$Language->get('Autosave').'</label>';
|
$html .= '<label class="forCheckbox" for="jsautosave">'.$this->L('Autosave').'</label>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
@ -85,8 +83,6 @@ class pluginsimpleMDE extends Plugin {
|
|||||||
public function adminBodyEnd()
|
public function adminBodyEnd()
|
||||||
{
|
{
|
||||||
global $layout;
|
global $layout;
|
||||||
global $Language;
|
|
||||||
|
|
||||||
$html = '';
|
$html = '';
|
||||||
|
|
||||||
// Load CSS and JS only on Controllers in array.
|
// Load CSS and JS only on Controllers in array.
|
||||||
@ -119,7 +115,7 @@ class pluginsimpleMDE extends Plugin {
|
|||||||
|
|
||||||
// This function is necesary on each Editor, it is used by Bludit Images v8.
|
// This function is necesary on each Editor, it is used by Bludit Images v8.
|
||||||
$html .= 'function editorAddImage(filename) {
|
$html .= 'function editorAddImage(filename) {
|
||||||
addContentSimpleMDE("");
|
addContentSimpleMDE("");
|
||||||
}'.PHP_EOL;
|
}'.PHP_EOL;
|
||||||
|
|
||||||
$html .= '$(document).ready(function() { '.PHP_EOL;
|
$html .= '$(document).ready(function() { '.PHP_EOL;
|
||||||
|
11
bl-plugins/tags/plugin.php
Normal file → Executable file
11
bl-plugins/tags/plugin.php
Normal file → Executable file
@ -12,23 +12,21 @@ class pluginTags extends Plugin {
|
|||||||
|
|
||||||
public function form()
|
public function form()
|
||||||
{
|
{
|
||||||
global $Language;
|
|
||||||
|
|
||||||
$html = '<div>';
|
$html = '<div>';
|
||||||
$html .= '<label>'.$Language->get('Plugin label').'</label>';
|
$html .= '<label>'.$this->L('Plugin label').'</label>';
|
||||||
$html .= '<input name="label" id="jslabel" type="text" value="'.$this->getDbField('label').'">';
|
$html .= '<input name="label" id="jslabel" type="text" value="'.$this->getDbField('label').'">';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= $Language->get('Sort the tag list by').': <select name="sort">';
|
$html .= $this->L('Sort the tag list by').': <select name="sort">';
|
||||||
|
|
||||||
foreach(array('alpha' => 'Alphabetical order',
|
foreach(array('alpha' => 'Alphabetical order',
|
||||||
'count' => 'Number of times each tag has been used',
|
'count' => 'Number of times each tag has been used',
|
||||||
'date' => 'Date each tag was first used') as $key=>$value) {
|
'date' => 'Date each tag was first used') as $key=>$value) {
|
||||||
if ($key == $this->getDbField('sort')) {
|
if ($key == $this->getDbField('sort')) {
|
||||||
$html .= '<option value="'.$key.'" selected>'.$Language->get($value).'</option>';
|
$html .= '<option value="'.$key.'" selected>'.$this->L($value).'</option>';
|
||||||
} else {
|
} else {
|
||||||
$html .= '<option value="'.$key.'">'.$Language->get($value).'</option>';
|
$html .= '<option value="'.$key.'">'.$this->L($value).'</option>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$html .= '</select>';
|
$html .= '</select>';
|
||||||
@ -39,7 +37,6 @@ class pluginTags extends Plugin {
|
|||||||
|
|
||||||
public function siteSidebar()
|
public function siteSidebar()
|
||||||
{
|
{
|
||||||
global $Language;
|
|
||||||
global $dbTags;
|
global $dbTags;
|
||||||
global $Url;
|
global $Url;
|
||||||
|
|
||||||
|
@ -4,6 +4,12 @@
|
|||||||
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$( window ).on( 'load', function() {
|
||||||
|
setTimeout( function() {
|
||||||
|
$('body').removeClass('is-loading');
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
(function($) {
|
(function($) {
|
||||||
|
|
||||||
skel.breakpoints({
|
skel.breakpoints({
|
||||||
@ -25,12 +31,6 @@
|
|||||||
// Disable animations/transitions until the page has loaded.
|
// Disable animations/transitions until the page has loaded.
|
||||||
$body.addClass('is-loading');
|
$body.addClass('is-loading');
|
||||||
|
|
||||||
$window.on('load', function() {
|
|
||||||
window.setTimeout(function() {
|
|
||||||
$body.removeClass('is-loading');
|
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Fix: Placeholder polyfill.
|
// Fix: Placeholder polyfill.
|
||||||
$('form').placeholder();
|
$('form').placeholder();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user