Minor changes
This commit is contained in:
parent
519826ddac
commit
a4fe50a162
35
admin/controllers/install-theme.php
Normal file
35
admin/controllers/install-theme.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
if($Login->role()!=='admin') {
|
||||
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
|
||||
Redirect::page('admin', 'dashboard');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main
|
||||
// ============================================================================
|
||||
$themeDirname = $layout['parameters'];
|
||||
|
||||
if( Sanitize::pathFile(PATH_THEMES.$themeDirname) )
|
||||
{
|
||||
$Site->set(array('theme'=>$themeDirname));
|
||||
Alert::set($Language->g('The changes have been saved'));
|
||||
}
|
||||
else
|
||||
{
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to install the theme: '.$themeDirname);
|
||||
}
|
||||
|
||||
Redirect::page('admin', 'themes');
|
@ -13,18 +13,35 @@ if($Login->role()!=='admin') {
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
$Site->set($_POST);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main
|
||||
// ============================================================================
|
||||
|
||||
$themes = Filesystem::listDirectories(PATH_THEMES);
|
||||
$themes = array();
|
||||
$themesPaths = Filesystem::listDirectories(PATH_THEMES);
|
||||
|
||||
// Load each plugin clasess
|
||||
foreach($themes as $themePath) {
|
||||
// include($themePath.DS.'plugin.php');
|
||||
}
|
||||
foreach($themesPaths as $themePath)
|
||||
{
|
||||
$langLocaleFile = $themePath.DS.'language'.DS.$Site->locale().'.json';
|
||||
$langDefaultFile = $themePath.DS.'language'.DS.'en_US.json';
|
||||
$database = false;
|
||||
|
||||
// Check if exists locale language
|
||||
if( Sanitize::pathFile($langLocaleFile) ) {
|
||||
$database = new dbJSON($langLocaleFile, false);
|
||||
}
|
||||
// Check if exists default language
|
||||
elseif( Sanitize::pathFile($langDefaultFile) ) {
|
||||
$database = new dbJSON($langDefaultFile, false);
|
||||
}
|
||||
|
||||
if($database!==false)
|
||||
{
|
||||
$databaseArray = $database->db;
|
||||
$databaseArray['theme-data']['dirname'] = basename($themePath);
|
||||
|
||||
// Theme data
|
||||
array_push($themes, $databaseArray['theme-data']);
|
||||
}
|
||||
}
|
||||
|
@ -70,6 +70,13 @@ div.unit-80 {
|
||||
|
||||
}
|
||||
|
||||
/* ----------- FOOTER ----------- */
|
||||
#footer {
|
||||
color: #777;
|
||||
font-size: 0.9em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* ----------- ALERT ----------- */
|
||||
#alert {
|
||||
top: 0 !important;
|
||||
@ -253,6 +260,11 @@ div.themeBox {
|
||||
padding: 15px 20px;
|
||||
width: 70%;
|
||||
margin-bottom: 20px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
div.themeBoxInstalled {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
div.themeBox p {
|
||||
@ -291,6 +303,7 @@ div.pluginBox {
|
||||
padding: 15px 20px;
|
||||
width: 70%;
|
||||
margin-bottom: 20px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
div.pluginBox p {
|
||||
|
@ -95,8 +95,7 @@ $(document).ready(function() {
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('onAdminBodyEnd') ?>
|
||||
|
||||
<?php
|
||||
echo "DEBUG: Load time: ".(microtime(true) - $loadTime).'<br>';
|
||||
?>
|
||||
<div id="footer">Bludit <?php echo BLUDIT_VERSION ?> | Load time <?php echo (microtime(true) - $loadTime) ?></div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,2 +1,24 @@
|
||||
<h2 class="title"><i class="fa fa-adjust"></i> <?php $Language->p('Themes') ?></h2>
|
||||
|
||||
<?php
|
||||
foreach($themes as $theme)
|
||||
{
|
||||
$installed = '';
|
||||
if($theme['dirname']==$Site->theme()) {
|
||||
$installed = 'themeBoxInstalled';
|
||||
}
|
||||
|
||||
echo '<div class="themeBox '.$installed.'">';
|
||||
|
||||
echo '<p class="name">'.$theme['name'].'</p>';
|
||||
echo '<p>'.$theme['description'].'</p>';
|
||||
echo '<span class="version">'.$Language->g('Version').': '.$theme['version'].'</span><span class="author">'.$Language->g('author').': '.$theme['author'].'</span>';
|
||||
|
||||
if($theme['dirname']!=$Site->theme()) {
|
||||
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'install-theme/'.$theme['dirname'].'" class="btn btn-red btn-smaller">Install theme</a>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
?>
|
12
themes/eventually/language/en_US.json
Executable file
12
themes/eventually/language/en_US.json
Executable file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"theme-data":
|
||||
{
|
||||
"name": "Eventually",
|
||||
"description": "Eventually is design by HTML5 UP. Website http://html5up.net",
|
||||
"author": "Bludit",
|
||||
"email": "",
|
||||
"website": "http://www.bludit.com",
|
||||
"version": "0.1",
|
||||
"releaseDate": "2015-08-02"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user