diff --git a/admin/controllers/themes.php b/admin/controllers/themes.php new file mode 100644 index 00000000..901e8d82 --- /dev/null +++ b/admin/controllers/themes.php @@ -0,0 +1,23 @@ +role()!=='admin') { + Alert::set($Language->g('you-do-not-have-sufficient-permissions')); + Redirect::page('admin', 'dashboard'); +} + +// ============================================================================ +// POST Method +// ============================================================================ + +if( $_SERVER['REQUEST_METHOD'] == 'POST' ) +{ + $Site->set($_POST); +} + +// ============================================================================ +// Main +// ============================================================================ diff --git a/admin/themes/default/css/default.css b/admin/themes/default/css/default.css index 155aff8e..07a95df2 100644 --- a/admin/themes/default/css/default.css +++ b/admin/themes/default/css/default.css @@ -63,7 +63,7 @@ body { } #sidebar li { - + } /* ----------- ALERT ----------- */ @@ -163,7 +163,7 @@ div.dashboardBox ul.menu a { } div.dashboardBox ul.menu li.title { - + } div.dashboardBox ul.menu li.description { @@ -173,6 +173,10 @@ div.dashboardBox ul.menu li.description { color: #555; } +div.dashboardBox ul.menu li.description:last-child { + border-bottom: 0 !important; + margin-bottom: 0 !important; +} /* ----------- FORMS ----------- */ @@ -235,8 +239,8 @@ a.btn-red:hover { margin-left: 10px; } +/* ----------- THEMES ----------- */ -/* ----------- PLUGINS ----------- */ div.pluginBox { box-shadow: 0 1px 2px rgba(0,0,0,.26); background-color: #fff; @@ -251,9 +255,54 @@ div.pluginBox p { margin-bottom: 10px; } -div.pluginBox span.version { - color: #ccc; +div.pluginBox span.author { + color: #999; margin-left: 10px; + float: right; +} + +div.pluginBox span.version { + color: #999; + margin-left: 10px; + float: right; +} + +/* ----------- PLUGINS ----------- */ +div.pluginBox { + box-shadow: 0 1px 2px rgba(0,0,0,.26); + background-color: #fff; + border-radius: 2px; + box-sizing: border-box; + padding: 15px 20px; + width: 70%; + margin-bottom: 20px; +} + +div.pluginBox p { + margin-bottom: 6px; +} + +div.pluginBox p.name { + border-bottom: 1px dashed #ccc; +} + +div.pluginBox a.btn-smaller { + padding: 4px 10px; + margin-right: 10px; +} + +div.pluginBox span.author { + color: #777; + margin-left: 10px; + float: right; + font-size: 0.9em; +} + +div.pluginBox span.version { + color: #777; + margin-left: 10px; + float: right; + font-size: 0.9em; } /* ----------- PLUGINS FORM ----------- */ diff --git a/admin/views/dashboard.php b/admin/views/dashboard.php index 666c5d49..8efb064b 100644 --- a/admin/views/dashboard.php +++ b/admin/views/dashboard.php @@ -8,18 +8,18 @@

Start here!

- -
@@ -32,7 +32,7 @@
- +
count() ?>
diff --git a/admin/views/plugins.php b/admin/views/plugins.php index 86cb3fa1..f047834f 100644 --- a/admin/views/plugins.php +++ b/admin/views/plugins.php @@ -5,17 +5,18 @@ { echo '
'; - echo '

'.$Plugin->name().''.$Language->g('Version').': '.$Plugin->version().'

'; + echo '

'.$Plugin->name().'

'; echo '

'.$Plugin->description().'

'; + echo ''.$Language->g('Version').': '.$Plugin->version().''.$Language->g('author').': '.$Plugin->author().''; if($Plugin->installed()) { - echo ''.$Language->g('Uninstall plugin').''; if($Plugin->form()) { - echo ''.$Language->g('Configure plugin').''; + echo ''.$Language->g('Configure plugin').''; } + echo ''.$Language->g('Uninstall plugin').''; } else { - echo ''.$Language->g('Install plugin').''; + echo ''.$Language->g('Install plugin').''; } echo '
'; diff --git a/admin/views/themes.php b/admin/views/themes.php index 6e521df3..cd99ad29 100644 --- a/admin/views/themes.php +++ b/admin/views/themes.php @@ -1,2 +1,2 @@ -

Themes

-

Not implemented...

+

p('Themes') ?>

+ diff --git a/kernel/boot/admin.php b/kernel/boot/admin.php index f4b9e937..1c6e42fb 100644 --- a/kernel/boot/admin.php +++ b/kernel/boot/admin.php @@ -43,6 +43,7 @@ else include(PATH_RULES.'80.plugins.php'); include(PATH_RULES.'99.header.php'); include(PATH_RULES.'99.paginator.php'); + include(PATH_RULES.'99.themes.php'); if($Url->notFound() || !$Login->isLogged() || ($Url->slug()==='login') ) { diff --git a/kernel/boot/init.php b/kernel/boot/init.php index 4fe54cc2..112d8550 100644 --- a/kernel/boot/init.php +++ b/kernel/boot/init.php @@ -145,6 +145,9 @@ define('HTML_PATH_ADMIN_ROOT', HTML_PATH_ROOT.'admin/'); define('HTML_PATH_UPLOADS', HTML_PATH_ROOT.'content/uploads/'); define('HTML_PATH_PLUGINS', HTML_PATH_ROOT.'plugins/'); +// PHP PATHs with dependency +define('PATH_THEME', PATH_ROOT.'themes/'.$Site->theme().'/'); + // Objects with dependency $Language = new dbLanguage( $Site->locale() ); $Login = new Login( $dbUsers ); diff --git a/kernel/boot/rules/99.themes.php b/kernel/boot/rules/99.themes.php new file mode 100644 index 00000000..ee1fb042 --- /dev/null +++ b/kernel/boot/rules/99.themes.php @@ -0,0 +1,50 @@ +'', + 'description'=>'', + 'author'=>'', + 'email'=>'', + 'website'=>'', + 'version'=>'', + 'releaseDate'=>'' +); + +// ============================================================================ +// Functions +// ============================================================================ + +// ============================================================================ +// Main +// ============================================================================ + +$langLocaleFile = PATH_THEME.'language'.DS.$Site->locale().'.json'; +$langDefaultFile = PATH_THEME.'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; + + // Theme data + $theme = $databaseArray['theme-data']; + + // Remove theme data + unset($databaseArray['theme-data']); + + // Add new words from language theme + $Language->add($databaseArray); +} \ No newline at end of file diff --git a/kernel/boot/site.php b/kernel/boot/site.php index f426611b..19c99ed0 100644 --- a/kernel/boot/site.php +++ b/kernel/boot/site.php @@ -6,6 +6,7 @@ include(PATH_RULES.'70.build_pages.php'); include(PATH_RULES.'80.plugins.php'); include(PATH_RULES.'99.header.php'); include(PATH_RULES.'99.paginator.php'); +include(PATH_RULES.'99.themes.php'); // Plugins before site loaded Theme::plugins('beforeSiteLoad'); diff --git a/languages/en_US.json b/languages/en_US.json index f7b00786..658729eb 100644 --- a/languages/en_US.json +++ b/languages/en_US.json @@ -131,5 +131,10 @@ "default-home-page": "Default home page", "version": "Version", "there-are-no-drafts": "There are no drafts.", - "plugin-label": "Plugin label" + "create-a-new-article-for-your-blog":"Create a new article for your blog.", + "create-a-new-page-for-your-website":"Create a new page for your website.", + "invite-a-friend-to-collaborate-on-your-website":"Invite a friend to collaborate on your website.", + "change-your-language-and-region-settings":"Change your language and region settings.", + "language-and-timezone":"Language and timezone", + "author": "Author" } \ No newline at end of file diff --git a/themes/pure/language/en_US.json b/themes/pure/language/en_US.json new file mode 100755 index 00000000..3f81ffb6 --- /dev/null +++ b/themes/pure/language/en_US.json @@ -0,0 +1,12 @@ +{ + "theme-data": + { + "name": "Pure", + "description": "Pure is based on the framework Pure.css. Website: http://purecss.io", + "author": "Diego", + "email": "", + "website": "", + "version": "0.1", + "releaseDate": "" + } +} \ No newline at end of file diff --git a/themes/pure/screenshot.jpg b/themes/pure/screenshot.jpg new file mode 100644 index 00000000..3f039100 Binary files /dev/null and b/themes/pure/screenshot.jpg differ