Merge pull request #1 from dignajar/master

update to v0.2
This commit is contained in:
Сергей Ворон 2015-09-29 13:24:44 +08:00
commit 2a4a9b6d4a
224 changed files with 8514 additions and 13032 deletions

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
.DS_Store
!themes/pure
themes/*
content/databases
content/pages
content/posts

View File

@ -10,6 +10,6 @@ RewriteRule ^content/(.*)\.txt$ - [R=404,L]
# All URL process by index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [L]
RewriteRule ^(.*) index.php [PT,L]
</IfModule>

View File

@ -5,7 +5,16 @@ Bludit is a fast, simple, extensible and Flat file CMS.
- [Documentation](http://docs.bludit.com/en/)
- [Help and Support](http://forum.bludit.com)
- Follow Bludit on [Twitter](https://twitter.com/bludit) and [Facebook](https://www.facebook.com/pages/Bludit/239255789455913)
- [Plugins](https://github.com/dignajar/bludit-plugins)
- [Themes](https://github.com/dignajar/bludit-themes)
- [More plugins and themes](http://forum.bludit.com/viewforum.php?f=14)
Social
------
- [Twitter](https://twitter.com/bludit)
- [Facebook](https://www.facebook.com/bluditcms)
- [Google+](https://plus.google.com/+Bluditcms)
Requirements
------------
@ -18,7 +27,6 @@ You only need a Webserver with PHP support.
* Apache with module [mod_rewrite](http://httpd.apache.org/docs/current/mod/mod_rewrite.html)
* Ngnix with module [ngx_http_rewrite_module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html)
Installation guide
------------------
@ -26,3 +34,7 @@ Installation guide
2. Extract the zip file into a directory like `bludit`.
3. Upload the directory `bludit` on your hosting.
4. Done!
License
-------
Bludit is opensource software licensed under the [MIT license](https://tldrlegal.com/license/mit-license)

7
admin/README Normal file
View File

@ -0,0 +1,7 @@
# Bludit
If you are reading this, you must enable rewrite module.
Documentation:
- http://docs.bludit.com/en/getting-started/requirements
- http://docs.bludit.com/en/troubleshooting/browser-returns-not-found

View File

@ -5,7 +5,7 @@
// ============================================================================
if($Login->role()!=='admin') {
Alert::set('You do not have sufficient permissions to access this page, contact the administrator.');
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
Redirect::page('admin', 'dashboard');
}
@ -16,34 +16,45 @@ if($Login->role()!=='admin') {
function addUser($args)
{
global $dbUsers;
global $Language;
// Check if the username already exist in db.
if( $dbUsers->userExists($args['username']) || Text::isEmpty($args['username']) )
if( Text::isEmpty($args['username']) )
{
Alert::set('Username already exists or is empty');
Alert::set($Language->g('username-field-is-empty'));
return false;
}
if( $dbUsers->userExists($args['username']) )
{
Alert::set($Language->g('username-already-exists'));
return false;
}
// Validate password.
if( ($args['password'] != $args['confirm-password'] ) || Text::isEmpty($args['password']) )
{
Alert::set('The password and confirmation password do not match');
Alert::set($Language->g('The password and confirmation password do not match'));
return false;
}
// Add the user.
if( $dbUsers->add($args) )
{
Alert::set('User has been added successfull');
Alert::set($Language->g('user-has-been-added-successfully'));
return true;
}
else
{
Alert::set('Error occurred when trying to add a new user');
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to create the account.');
return false;
}
}
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
@ -56,5 +67,5 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
}
// ============================================================================
// Main
// Main after POST
// ============================================================================

View File

@ -5,7 +5,7 @@
// ============================================================================
if($Login->role()!=='admin') {
Alert::set('You do not have sufficient permissions to access this page, contact the administrator.');
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
Redirect::page('admin', 'dashboard');
}
@ -17,10 +17,11 @@ if($Login->role()!=='admin') {
// Main before POST
// ============================================================================
$_Plugin = false;
$pluginClassName = $layout['parameters'];
foreach($plugins['all'] as $P)
{
if($P->className()==$layout['parameters']) {
if($P->className()==$pluginClassName) {
$_Plugin = $P;
}
}
@ -30,8 +31,8 @@ if($_Plugin===false) {
Redirect::page('admin', 'plugins');
}
// Check if the plugin has the method form.
if($_Plugin->form()===false) {
// Check if the plugin has the method form()
if(!method_exists($_Plugin, 'form')) {
Redirect::page('admin', 'plugins');
}
@ -42,7 +43,7 @@ if($_Plugin->form()===false) {
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
$_Plugin->setDb($_POST);
Alert::set('Configuration has been saved successfully');
Alert::set($Language->g('the-changes-have-been-saved'));
}
// ============================================================================

View File

@ -4,13 +4,35 @@
// Functions
// ============================================================================
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
// Main
// Main after POST
// ============================================================================
$_newPosts = $dbPosts->regenerate();
$_newPages = $dbPages->regenerate();
//$_newPosts = $dbPosts->regenerateCli();
$_newPages = $dbPages->regenerateCli();
$_newPages = $_newPosts = array();
$_draftPosts = array();
foreach($posts as $Post)
{
if($Post->draft()) {
array_push($_draftPosts, $Post);
}
}
$_draftPages = array();
foreach($pages as $Page)
{
if(!$Page->published()) {
array_push($_draftPages, $Page);
}
}

View File

@ -7,6 +7,7 @@
function editPage($args)
{
global $dbPages;
global $Language;
// Page status, published or draft.
if( isset($args['publish']) ) {
@ -23,32 +24,37 @@ function editPage($args)
// Edit the page.
if( $dbPages->edit($args) )
{
$dbPages->regenerate();
$dbPages->regenerateCli();
Alert::set('The page has been saved successfully');
Alert::set($Language->g('The changes have been saved'));
Redirect::page('admin', 'edit-page/'.$args['key']);
}
else
{
Alert::set('Error occurred when trying to edit the page');
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to edit the page.');
}
}
function deletePage($key)
{
global $dbPages;
global $Language;
if( $dbPages->delete($key) )
{
Alert::set('The page has been deleted successfully');
Alert::set($Language->g('The page has been deleted successfully'));
Redirect::page('admin', 'manage-pages');
}
else
{
Alert::set('Error occurred when trying to delete the page');
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to delete the page.');
}
}
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
@ -64,10 +70,12 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
}
// ============================================================================
// Main
// Main after POST
// ============================================================================
if(!$dbPages->pageExists($layout['parameters'])) {
if(!$dbPages->pageExists($layout['parameters']))
{
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to get the page: '.$layout['parameters']);
Redirect::page('admin', 'manage-pages');
}

View File

@ -1,5 +1,9 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
// ============================================================================
// Functions
// ============================================================================
@ -7,6 +11,7 @@
function editPost($args)
{
global $dbPosts;
global $Language;
// Post status, published or draft.
if( isset($args['publish']) ) {
@ -19,30 +24,43 @@ function editPost($args)
// Edit the post.
if( $dbPosts->edit($args) )
{
Alert::set('The post has been saved successfull');
// Reindex tags, this function is in 70.posts.php
reIndexTagsPosts();
Alert::set($Language->g('The changes have been saved'));
Redirect::page('admin', 'edit-post/'.$args['key']);
}
else
{
Alert::set('Error occurred when trying to edit the post');
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to edit the post.');
}
return false;
}
function deletePost($key)
{
global $dbPosts;
global $Language;
if( $dbPosts->delete($key) )
{
Alert::set('The post has been deleted successfull');
// Reindex tags, this function is in 70.posts.php
reIndexTagsPosts();
Alert::set($Language->g('The post has been deleted successfully'));
Redirect::page('admin', 'manage-posts');
}
else
{
Alert::set('Error occurred when trying to delete the post');
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to delete the post.');
}
}
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
@ -58,10 +76,12 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
}
// ============================================================================
// Main
// Main after POST
// ============================================================================
if(!$dbPosts->postExists($layout['parameters'])) {
if(!$dbPosts->postExists($layout['parameters']))
{
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to get the post: '.$layout['parameters']);
Redirect::page('admin', 'manage-posts');
}

View File

@ -7,51 +7,102 @@
function editUser($args)
{
global $dbUsers;
global $Language;
if(isset($args['password']))
{
if( ($args['password']===$args['confirm-password']) && !Text::isEmpty($args['password']) ) {
return $dbUsers->setPassword($args);
}
else {
Alert::set('Passwords are differents');
return false;
}
if( $dbUsers->set($args) ) {
Alert::set($Language->g('The changes have been saved'));
}
else
{
return $dbUsers->set($args);
else {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to edit the user.');
}
}
function setPassword($args)
{
global $dbUsers;
global $Language;
if( ($args['password']===$args['confirm-password']) && !Text::isEmpty($args['password']) )
{
if( $dbUsers->setPassword($args) ) {
Alert::set($Language->g('The changes have been saved'));
}
else {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to change the user password.');
}
}
else {
Alert::set($Language->g('The password and confirmation password do not match'));
return false;
}
}
function deleteUser($args, $deleteContent=false)
{
global $dbUsers;
global $dbPosts;
global $Language;
// The user admin cannot be deleted.
if($args['username']=='admin') {
return false;
}
if($deleteContent) {
$dbPosts->deletePostsByUser($args['username']);
}
else {
$dbPosts->linkPostsToUser($args['username'], 'admin');
}
if( $dbUsers->delete($args['username']) ) {
Alert::set($Language->g('User deleted'));
}
else {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to delete the user.');
}
}
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
// Prevent editors users to administrate other users.
if($Login->role()!=='admin')
{
$_POST['username'] = $Login->username();
unset($_POST['role']);
}
if( editUser($_POST) ) {
Alert::set('User saved successfuly');
if(isset($_POST['delete-user-all'])) {
deleteUser($_POST, true);
}
elseif(isset($_POST['delete-user-associate'])) {
deleteUser($_POST, false);
}
elseif(isset($_POST['change-password'])) {
setPassword($_POST);
}
elseif(isset($_POST['edit-user'])) {
editUser($_POST);
}
}
// ============================================================================
// Main
// Main after POST
// ============================================================================
if($Login->role()!=='admin') {
$layout['parameters'] = $Login->username();
}
$_user = $dbUsers->get($layout['parameters']);
$_user = $dbUsers->getDb($layout['parameters']);
// If the user doesn't exist, redirect to the users list.
if($_user===false) {

View File

@ -5,7 +5,7 @@
// ============================================================================
if($Login->role()!=='admin') {
Alert::set('You do not have sufficient permissions to access this page, contact the administrator.');
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
Redirect::page('admin', 'dashboard');
}
@ -13,16 +13,24 @@ if($Login->role()!=='admin') {
// Functions
// ============================================================================
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
// Main
// Main after POST
// ============================================================================
$pluginClassName = $layout['parameters'];
$Plugin = new $pluginClassName;
$Plugin->install();
foreach($plugins['all'] as $P)
{
if($P->className()==$pluginClassName) {
$P->install();
}
}
Redirect::page('admin', 'plugins');

View File

@ -0,0 +1,39 @@
<?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
// ============================================================================
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
// Main after POST
// ============================================================================
$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');

View File

@ -1,16 +1,54 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
// ============================================================================
// Functions
// ============================================================================
function checkPost($args)
{
global $Security;
global $Login;
global $Language;
if($Security->isBlocked()) {
Alert::set($Language->g('IP address has been blocked').'<br>'.$Language->g('Try again in a few minutes'));
return false;
}
// Verify User sanitize the input
if( $Login->verifyUser($_POST['username'], $_POST['password']) )
{
// Renew the token. This token will be the same inside the session for multiple forms.
$Security->generateToken();
Redirect::page('admin', 'dashboard');
return true;
}
// Bruteforce protection, add IP to blacklist.
$Security->addLoginFail();
Alert::set($Language->g('Username or password incorrect'));
return false;
}
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
$username = Sanitize::html($_POST['username']);
$password = Sanitize::html($_POST['password']);
if( $Login->verifyUser($username, $password) )
{
Redirect::page('admin', 'dashboard');
}
else
{
Alert::set('Username or password incorrect');
}
checkPost($_POST);
}
// ============================================================================
// Main after POST
// ============================================================================

View File

@ -1,5 +1,25 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
// ============================================================================
// Functions
// ============================================================================
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
// Main after POST
// ============================================================================
if( $Login->logout())
{
Redirect::home();

View File

@ -1,5 +1,9 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
// ============================================================================
// Functions
// ============================================================================
@ -7,6 +11,7 @@
function addPage($args)
{
global $dbPages;
global $Language;
// Page status, published or draft.
if( isset($args['publish']) ) {
@ -19,15 +24,19 @@ function addPage($args)
// Add the page.
if( $dbPages->add($args) )
{
Alert::set('Page added successfuly');
Alert::set($Language->g('Page added successfully'));
Redirect::page('admin', 'manage-pages');
}
else
{
Alert::set('Error occurred when trying to create the page');
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to create the page.');
}
}
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
@ -36,3 +45,7 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
addPage($_POST);
}
// ============================================================================
// Main after POST
// ============================================================================

View File

@ -1,5 +1,9 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
// ============================================================================
// Functions
// ============================================================================
@ -7,6 +11,7 @@
function addPost($args)
{
global $dbPosts;
global $Language;
// Page status, published or draft.
if( isset($args['publish']) ) {
@ -19,15 +24,24 @@ function addPost($args)
// Add the page.
if( $dbPosts->add($args) )
{
Alert::set('Post added successfuly');
// Reindex tags, this function is in 70.posts.php
reIndexTagsPosts();
Alert::set($Language->g('Post added successfully'));
Redirect::page('admin', 'manage-posts');
}
else
{
Alert::set('Error occurred when trying to create the post');
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to create the post.');
}
return false;
}
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
@ -36,3 +50,7 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
addPost($_POST);
}
// ============================================================================
// Main after POST
// ============================================================================

View File

@ -0,0 +1,26 @@
<?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
// ============================================================================
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
// Main after POST
// ============================================================================

View File

@ -5,7 +5,7 @@
// ============================================================================
if($Login->role()!=='admin') {
Alert::set('You do not have sufficient permissions to access this page, contact the administrator.');
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
Redirect::page('admin', 'dashboard');
}
@ -16,28 +16,36 @@ if($Login->role()!=='admin') {
function setSettings($args)
{
global $Site;
if(!isset($args['advancedOptions'])) {
$args['advancedOptions'] = 'false';
}
global $Language;
// Add slash at the begin and end.
// This fields are in the settings->advanced mode
if(isset($args['advanced'])) {
if(isset($args['form-advanced'])) {
$args['url'] = Text::addSlashes($args['url'],false,true);
$args['uriPost'] = Text::addSlashes($args['uriPost']);
$args['uriPage'] = Text::addSlashes($args['uriPage']);
$args['uriTag'] = Text::addSlashes($args['uriTag']);
if(($args['uriPost']==$args['uriPage']) || ($args['uriPost']==$args['uriTag']) || ($args['uriPage']==$args['uriTag']) )
{
$args = array();
}
}
if( $Site->set($args) ) {
Alert::set('Settings has been saved successfully');
Alert::set($Language->g('the-changes-have-been-saved'));
}
else {
Alert::set('Error occurred when trying to saved the settings');
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the settings.');
}
return true;
}
// ============================================================================
// Main after POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
@ -45,8 +53,28 @@ function setSettings($args)
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
setSettings($_POST);
Redirect::page('admin', $layout['controller']);
}
// ============================================================================
// Main
// Main after POST
// ============================================================================
// Default home page
$_homePageList = array(''=>$Language->g('Show blog'));
foreach($pagesParents as $parentKey=>$pageList)
{
foreach($pageList as $Page)
{
if($parentKey!==NO_PARENT_CHAR) {
$parentTitle = $pages[$Page->parentKey()]->title().'->';
}
else {
$parentTitle = '';
}
if($Page->published()) {
$_homePageList[$Page->key()] = $Language->g('Page').': '.$parentTitle.$Page->title();
}
}
}

View File

@ -0,0 +1,51 @@
<?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');
}
// ============================================================================
// Main after POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
// Main after POST
// ============================================================================
$themes = array();
$themesPaths = Filesystem::listDirectories(PATH_THEMES);
// Load each plugin clasess
foreach($themesPaths as $themePath)
{
$langLocaleFile = $themePath.DS.'languages'.DS.$Site->locale().'.json';
$langDefaultFile = $themePath.DS.'languages'.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']);
}
}

View File

@ -5,7 +5,7 @@
// ============================================================================
if($Login->role()!=='admin') {
Alert::set('You do not have sufficient permissions to access this page, contact the administrator.');
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
Redirect::page('admin', 'dashboard');
}
@ -13,12 +13,16 @@ if($Login->role()!=='admin') {
// Functions
// ============================================================================
// ============================================================================
// Main after POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
// Main
// Main after POST
// ============================================================================
$pluginClassName = $layout['parameters'];

View File

@ -5,10 +5,18 @@
// ============================================================================
if($Login->role()!=='admin') {
Alert::set('You do not have sufficient permissions to access this page, contact the administrator.');
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
Redirect::page('admin', 'dashboard');
}
// ============================================================================
// Functions
// ============================================================================
// ============================================================================
// Main after POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
@ -19,5 +27,5 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
}
// ============================================================================
// Main
// Main after POST
// ============================================================================

View File

@ -1,15 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Bludit - Test rewrite module</title>
</head>
<body>
<p>Error, enable rewrite module.</p>
<p>
<b>Documentation:</b><br>
<a href="http://docs.bludit.com/en/getting-started/requirements">http://docs.bludit.com/en/getting-started/requirements</a> <br>
<a href="http://docs.bludit.com/en/troubleshooting/browser-returns-not-found">http://docs.bludit.com/en/troubleshooting/browser-returns-not-found</a><br>
</p>
</p>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -12,6 +12,18 @@ body {
background-color: #f9f9f9;
}
div.unit-80 {
margin-left: 1% !important;
}
.tools-alert {
text-align: center;
}
span.label {
margin-right: 8px;
}
/* ----------- FONTS AWESOME ----------- */
.fa-right {
margin-right: 5px;
@ -20,7 +32,7 @@ body {
/* ----------- HEAD ----------- */
#head {
overflow: auto;
border-top: 10px #f1f1f1 solid;
border-top: 10px #eee solid;
border-bottom: 1px solid #f1f1f1;
padding: 10px 0;
}
@ -66,6 +78,13 @@ body {
}
/* ----------- FOOTER ----------- */
#footer {
color: #777;
font-size: 0.9em;
text-align: center;
}
/* ----------- ALERT ----------- */
#alert {
top: 0 !important;
@ -86,6 +105,10 @@ h2.title {
font-weight: normal;
}
h2.title i.fa {
margin-right: 8px;
}
/* ----------- TABLE ----------- */
table {
background-color: #fff;
@ -126,7 +149,11 @@ div.dashboardBox .nav {
margin: 0 !important;
}
div.dashboardBox .nav a {
padding: 0 !important;
display: inline-block;
margin-left: 8px;
}
div.dashboardBox i.iconContent {
bottom: -1rem;
@ -140,6 +167,11 @@ div.dashboardBox div.bigContent {
font-weight: bold;
}
div.dashboardBox span {
display: inline-block !important;
padding: 3px 6px;
}
div.dashboardBox h2 {
color: #666;
font-size: 1.1em;
@ -148,10 +180,35 @@ div.dashboardBox h2 {
padding: 10px 20px;
}
div.dashboardBox ul.menu {
list-style-type: none;
margin: 0;
padding: 0;
text-align: center;
}
div.dashboardBox ul.menu a {
color: #2672ec;
}
div.dashboardBox ul.menu li.title {
}
div.dashboardBox ul.menu li.description {
border-bottom: 1px dashed #ddd;
margin-bottom: 10px;
padding-bottom: 10px;
color: #555;
}
div.dashboardBox ul.menu li.description:last-child {
border-bottom: 0 !important;
margin-bottom: 0 !important;
}
/* ----------- FORMS ----------- */
form h4 {
border-bottom: 1px solid #e2e2e2;
font-weight: 300;
@ -160,9 +217,27 @@ form h4 {
width: 60%;
}
p.advOptions {
color: #777;
font-size: 0.8em;
#jsadvancedButton {
display: block;
margin-bottom: 1.1em;
}
#jsadvancedOptions {
display: none;
}
.btn {
color: #fff;
background: #999999;
padding: 0.3em 1.3em !important;
}
.btn-blue {
background: #2672ec;
}
.btn-red {
background: #EC2626;
}
a.btn:hover {
@ -178,6 +253,82 @@ a.btn-red:hover {
color: rgba(255, 255, 255, 0.6) !important;
}
/* ----------- PAGINATOR ----------- */
#paginator ul {
list-style-type: none;
margin: 0;
padding: 0;
font-size: 0.9em;
text-align: center;
}
#paginator a {
color: #2672ec;
}
#paginator li {
display: inline;
float: none !important;
}
#paginator li.left {
margin-right: 10px;
}
#paginator li.list {
background: #e0e0e0;
color: #747474;
padding: 2px 11px;
}
#paginator li.right {
margin-left: 10px;
}
/* ----------- THEMES ----------- */
div.themeBox {
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;
overflow: auto;
}
div.themeBoxInstalled {
background-color: #f1f1f1;
}
div.themeBox p {
margin-bottom: 6px;
}
div.themeBox p.name {
border-bottom: 1px dashed #ccc;
}
div.themeBox a.btn-smaller {
padding: 4px 10px;
margin-right: 10px;
}
div.themeBox span.author {
color: #777;
margin-left: 10px;
float: right;
font-size: 0.9em;
}
div.themeBox span.version {
color: #777;
margin-left: 10px;
float: right;
font-size: 0.9em;
}
/* ----------- PLUGINS ----------- */
div.pluginBox {
@ -185,13 +336,37 @@ div.pluginBox {
background-color: #fff;
border-radius: 2px;
box-sizing: border-box;
padding: 20px;
padding: 15px 20px;
width: 70%;
margin-bottom: 20px;
overflow: auto;
}
div.pluginBox p {
margin-bottom: 10px;
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 ----------- */

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 B

View File

@ -8,6 +8,10 @@ a:hover {
text-decoration: none !important;
}
p {
margin-bottom: 0;
}
/* ----------- FONTS AWESOME ----------- */
.fa-right {
margin-right: 5px;
@ -16,7 +20,7 @@ a:hover {
/* ----------- ----------- */
div.main {
text-align: center;
margin: 30px 0;
margin: 50px 0 0 0;
}
h1.title {
font-weight: lighter;
@ -26,3 +30,24 @@ h1.title {
td {
text-align: center;
}
.boxInstallerForm {
margin-top: 30px !important;
}
.tools-message {
display: block;
position: relative;
top: 0;
right: 0;
left: 0;
bottom: 0;
max-width: none;
margin-bottom: 30px;
}
#jscompleteEmail {
border-bottom: 1px solid #fff;
display: inline-block;
cursor: pointer;
}

View File

@ -0,0 +1,568 @@
.xdsoft_datetimepicker {
box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.506);
background: #fff;
border-bottom: 1px solid #bbb;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
border-top: 1px solid #ccc;
color: #333;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
padding: 8px;
padding-left: 0;
padding-top: 2px;
position: absolute;
z-index: 9999;
-moz-box-sizing: border-box;
box-sizing: border-box;
display: none;
}
.xdsoft_datetimepicker.xdsoft_rtl {
padding: 8px 0 8px 8px;
}
.xdsoft_datetimepicker iframe {
position: absolute;
left: 0;
top: 0;
width: 75px;
height: 210px;
background: transparent;
border: none;
}
/*For IE8 or lower*/
.xdsoft_datetimepicker button {
border: none !important;
}
.xdsoft_noselect {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.xdsoft_noselect::selection { background: transparent }
.xdsoft_noselect::-moz-selection { background: transparent }
.xdsoft_datetimepicker.xdsoft_inline {
display: inline-block;
position: static;
box-shadow: none;
}
.xdsoft_datetimepicker * {
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
margin: 0;
}
.xdsoft_datetimepicker .xdsoft_datepicker, .xdsoft_datetimepicker .xdsoft_timepicker {
display: none;
}
.xdsoft_datetimepicker .xdsoft_datepicker.active, .xdsoft_datetimepicker .xdsoft_timepicker.active {
display: block;
}
.xdsoft_datetimepicker .xdsoft_datepicker {
width: 224px;
float: left;
margin-left: 8px;
}
.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_datepicker {
float: right;
margin-right: 8px;
margin-left: 0;
}
.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_datepicker {
width: 256px;
}
.xdsoft_datetimepicker .xdsoft_timepicker {
width: 58px;
float: left;
text-align: center;
margin-left: 8px;
margin-top: 0;
}
.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker {
float: right;
margin-right: 8px;
margin-left: 0;
}
.xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker {
margin-top: 8px;
margin-bottom: 3px
}
.xdsoft_datetimepicker .xdsoft_mounthpicker {
position: relative;
text-align: center;
}
.xdsoft_datetimepicker .xdsoft_label i,
.xdsoft_datetimepicker .xdsoft_prev,
.xdsoft_datetimepicker .xdsoft_next,
.xdsoft_datetimepicker .xdsoft_today_button {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Q0NBRjI1NjM0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Q0NBRjI1NjQ0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDQ0FGMjU2MTQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDQ0FGMjU2MjQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoNEP54AAAIOSURBVHja7Jq9TsMwEMcxrZD4WpBYeKUCe+kTMCACHZh4BFfHO/AAIHZGFhYkBBsSEqxsLCAgXKhbXYOTxh9pfJVP+qutnZ5s/5Lz2Y5I03QhWji2GIcgAokWgfCxNvcOCCGKqiSqhUp0laHOne05vdEyGMfkdxJDVjgwDlEQgYQBgx+ULJaWSXXS6r/ER5FBVR8VfGftTKcITNs+a1XpcFoExREIDF14AVIFxgQUS+h520cdud6wNkC0UBw6BCO/HoCYwBhD8QCkQ/x1mwDyD4plh4D6DDV0TAGyo4HcawLIBBSLDkHeH0Mg2yVP3l4TQMZQDDsEOl/MgHQqhMNuE0D+oBh0CIr8MAKyazBH9WyBuKxDWgbXfjNf32TZ1KWm/Ap1oSk/R53UtQ5xTh3LUlMmT8gt6g51Q9p+SobxgJQ/qmsfZhWywGFSl0yBjCLJCMgXail3b7+rumdVJ2YRss4cN+r6qAHDkPWjPjdJCF4n9RmAD/V9A/Wp4NQassDjwlB6XBiCxcJQWmZZb8THFilfy/lfrTvLghq2TqTHrRMTKNJ0sIhdo15RT+RpyWwFdY96UZ/LdQKBGjcXpcc1AlSFEfLmouD+1knuxBDUVrvOBmoOC/rEcN7OQxKVeJTCiAdUzUJhA2Oez9QTkp72OTVcxDcXY8iKNkxGAJXmJCOQwOa6dhyXsOa6XwEGAKdeb5ET3rQdAAAAAElFTkSuQmCC);
}
.xdsoft_datetimepicker .xdsoft_label i {
opacity: 0.5;
background-position: -92px -19px;
display: inline-block;
width: 9px;
height: 20px;
vertical-align: middle;
}
.xdsoft_datetimepicker .xdsoft_prev {
float: left;
background-position: -20px 0;
}
.xdsoft_datetimepicker .xdsoft_today_button {
float: left;
background-position: -70px 0;
margin-left: 5px;
}
.xdsoft_datetimepicker .xdsoft_next {
float: right;
background-position: 0 0;
}
.xdsoft_datetimepicker .xdsoft_next,
.xdsoft_datetimepicker .xdsoft_prev ,
.xdsoft_datetimepicker .xdsoft_today_button {
background-color: transparent;
background-repeat: no-repeat;
border: 0 none;
cursor: pointer;
display: block;
height: 30px;
opacity: 0.5;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
outline: medium none;
overflow: hidden;
padding: 0;
position: relative;
text-indent: 100%;
white-space: nowrap;
width: 20px;
min-width: 0;
}
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev,
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_next {
float: none;
background-position: -40px -15px;
height: 15px;
width: 30px;
display: block;
margin-left: 14px;
margin-top: 7px;
}
.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker .xdsoft_prev,
.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker .xdsoft_next {
float: none;
margin-left: 0;
margin-right: 14px;
}
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev {
background-position: -40px 0;
margin-bottom: 7px;
margin-top: 0;
}
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box {
height: 151px;
overflow: hidden;
border-bottom: 1px solid #ddd;
}
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div {
background: #f5f5f5;
border-top: 1px solid #ddd;
color: #666;
font-size: 12px;
text-align: center;
border-collapse: collapse;
cursor: pointer;
border-bottom-width: 0;
height: 25px;
line-height: 25px;
}
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div > div:first-child {
border-top-width: 0;
}
.xdsoft_datetimepicker .xdsoft_today_button:hover,
.xdsoft_datetimepicker .xdsoft_next:hover,
.xdsoft_datetimepicker .xdsoft_prev:hover {
opacity: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
}
.xdsoft_datetimepicker .xdsoft_label {
display: inline;
position: relative;
z-index: 9999;
margin: 0;
padding: 5px 3px;
font-size: 14px;
line-height: 20px;
font-weight: bold;
background-color: #fff;
float: left;
width: 182px;
text-align: center;
cursor: pointer;
}
.xdsoft_datetimepicker .xdsoft_label:hover>span {
text-decoration: underline;
}
.xdsoft_datetimepicker .xdsoft_label:hover i {
opacity: 1.0;
}
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select {
border: 1px solid #ccc;
position: absolute;
right: 0;
top: 30px;
z-index: 101;
display: none;
background: #fff;
max-height: 160px;
overflow-y: hidden;
}
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_monthselect{ right: -7px }
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_yearselect{ right: 2px }
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover {
color: #fff;
background: #ff8000;
}
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option {
padding: 2px 10px 2px 5px;
text-decoration: none !important;
}
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current {
background: #33aaff;
box-shadow: #178fe5 0 1px 3px 0 inset;
color: #fff;
font-weight: 700;
}
.xdsoft_datetimepicker .xdsoft_month {
width: 100px;
text-align: right;
}
.xdsoft_datetimepicker .xdsoft_calendar {
clear: both;
}
.xdsoft_datetimepicker .xdsoft_year{
width: 48px;
margin-left: 5px;
}
.xdsoft_datetimepicker .xdsoft_calendar table {
border-collapse: collapse;
width: 100%;
}
.xdsoft_datetimepicker .xdsoft_calendar td > div {
padding-right: 5px;
}
.xdsoft_datetimepicker .xdsoft_calendar th {
height: 25px;
}
.xdsoft_datetimepicker .xdsoft_calendar td,.xdsoft_datetimepicker .xdsoft_calendar th {
width: 14.2857142%;
background: #f5f5f5;
border: 1px solid #ddd;
color: #666;
font-size: 12px;
text-align: right;
vertical-align: middle;
padding: 0;
border-collapse: collapse;
cursor: pointer;
height: 25px;
}
.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar td,.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar th {
width: 12.5%;
}
.xdsoft_datetimepicker .xdsoft_calendar th {
background: #f1f1f1;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today {
color: #33aaff;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_default {
background: #ffe9d2;
box-shadow: #ffb871 0 1px 4px 0 inset;
color: #000;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_mint {
background: #c1ffc9;
box-shadow: #00dd1c 0 1px 4px 0 inset;
color: #000;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default,
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current {
background: #33aaff;
box-shadow: #178fe5 0 1px 3px 0 inset;
color: #fff;
font-weight: 700;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month,
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled,
.xdsoft_datetimepicker .xdsoft_time_box >div >div.xdsoft_disabled {
opacity: 0.5;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
cursor: default;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month.xdsoft_disabled {
opacity: 0.2;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
}
.xdsoft_datetimepicker .xdsoft_calendar td:hover,
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div:hover {
color: #fff !important;
background: #ff8000 !important;
box-shadow: none !important;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current.xdsoft_disabled:hover,
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current.xdsoft_disabled:hover {
background: #33aaff !important;
box-shadow: #178fe5 0 1px 3px 0 inset !important;
color: #fff !important;
}
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled:hover,
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_disabled:hover {
color: inherit !important;
background: inherit !important;
box-shadow: inherit !important;
}
.xdsoft_datetimepicker .xdsoft_calendar th {
font-weight: 700;
text-align: center;
color: #999;
cursor: default;
}
.xdsoft_datetimepicker .xdsoft_copyright {
color: #ccc !important;
font-size: 10px;
clear: both;
float: none;
margin-left: 8px;
}
.xdsoft_datetimepicker .xdsoft_copyright a { color: #eee !important }
.xdsoft_datetimepicker .xdsoft_copyright a:hover { color: #aaa !important }
.xdsoft_time_box {
position: relative;
border: 1px solid #ccc;
}
.xdsoft_scrollbar >.xdsoft_scroller {
background: #ccc !important;
height: 20px;
border-radius: 3px;
}
.xdsoft_scrollbar {
position: absolute;
width: 7px;
right: 0;
top: 0;
bottom: 0;
cursor: pointer;
}
.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_scrollbar {
left: 0;
right: auto;
}
.xdsoft_scroller_box {
position: relative;
}
.xdsoft_datetimepicker.xdsoft_dark {
box-shadow: 0 5px 15px -5px rgba(255, 255, 255, 0.506);
background: #000;
border-bottom: 1px solid #444;
border-left: 1px solid #333;
border-right: 1px solid #333;
border-top: 1px solid #333;
color: #ccc;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box {
border-bottom: 1px solid #222;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div {
background: #0a0a0a;
border-top: 1px solid #222;
color: #999;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label {
background-color: #000;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select {
border: 1px solid #333;
background: #000;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover {
color: #000;
background: #007fff;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current {
background: #cc5500;
box-shadow: #b03e00 0 1px 3px 0 inset;
color: #000;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label i,
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_prev,
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_next,
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_today_button {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUExQUUzOTA0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUExQUUzOTE0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQTFBRTM4RTQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQTFBRTM4RjQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pp0VxGEAAAIASURBVHja7JrNSgMxEMebtgh+3MSLr1T1Xn2CHoSKB08+QmR8Bx9A8e7RixdB9CKCoNdexIugxFlJa7rNZneTbLIpM/CnNLsdMvNjM8l0mRCiQ9Ye61IKCAgZAUnH+mU3MMZaHYChBnJUDzWOFZdVfc5+ZFLbrWDeXPwbxIqrLLfaeS0hEBVGIRQCEiZoHQwtlGSByCCdYBl8g8egTTAWoKQMRBRBcZxYlhzhKegqMOageErsCHVkk3hXIFooDgHB1KkHIHVgzKB4ADJQ/A1jAFmAYhkQqA5TOBtocrKrgXwQA8gcFIuAIO8sQSA7hidvPwaQGZSaAYHOUWJABhWWw2EMIH9QagQERU4SArJXo0ZZL18uvaxejXt/Em8xjVBXmvFr1KVm/AJ10tRe2XnraNqaJvKE3KHuUbfK1E+VHB0q40/y3sdQSxY4FHWeKJCunP8UyDdqJZenT3ntVV5jIYCAh20vT7ioP8tpf6E2lfEMwERe+whV1MHjwZB7PBiCxcGQWwKZKD62lfGNnP/1poFAA60T7rF1UgcKd2id3KDeUS+oLWV8DfWAepOfq00CgQabi9zjcgJVYVD7PVzQUAUGAQkbNJTBICDhgwYTjDYD6XeW08ZKh+A4pYkzenOxXUbvZcWz7E8ykRMnIHGX1XPl+1m2vPYpL+2qdb8CDAARlKFEz/ZVkAAAAABJRU5ErkJggg==);
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td,
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th {
background: #0a0a0a;
border: 1px solid #222;
color: #999;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th {
background: #0e0e0e;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_today {
color: #cc5500;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_default {
background: #ffe9d2;
box-shadow: #ffb871 0 1px 4px 0 inset;
color:#000;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_mint {
background: #c1ffc9;
box-shadow: #00dd1c 0 1px 4px 0 inset;
color:#000;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_default,
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_current,
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current {
background: #cc5500;
box-shadow: #b03e00 0 1px 3px 0 inset;
color: #000;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td:hover,
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div:hover {
color: #000 !important;
background: #007fff !important;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th {
color: #666;
}
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright { color: #333 !important }
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a { color: #111 !important }
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a:hover { color: #555 !important }
.xdsoft_dark .xdsoft_time_box {
border: 1px solid #333;
}
.xdsoft_dark .xdsoft_scrollbar >.xdsoft_scroller {
background: #333 !important;
}
.xdsoft_datetimepicker .xdsoft_save_selected {
display: block;
border: 1px solid #dddddd !important;
margin-top: 5px;
width: 100%;
color: #454551;
font-size: 13px;
}
.xdsoft_datetimepicker .blue-gradient-button {
font-family: "museo-sans", "Book Antiqua", sans-serif;
font-size: 12px;
font-weight: 300;
color: #82878c;
height: 28px;
position: relative;
padding: 4px 17px 4px 33px;
border: 1px solid #d7d8da;
background: -moz-linear-gradient(top, #fff 0%, #f4f8fa 73%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(73%, #f4f8fa));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #fff 0%, #f4f8fa 73%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #fff 0%, #f4f8fa 73%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #fff 0%, #f4f8fa 73%);
/* IE10+ */
background: linear-gradient(to bottom, #fff 0%, #f4f8fa 73%);
/* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fff', endColorstr='#f4f8fa',GradientType=0 );
/* IE6-9 */
}
.xdsoft_datetimepicker .blue-gradient-button:hover, .xdsoft_datetimepicker .blue-gradient-button:focus, .xdsoft_datetimepicker .blue-gradient-button:hover span, .xdsoft_datetimepicker .blue-gradient-button:focus span {
color: #454551;
background: -moz-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f4f8fa), color-stop(73%, #FFF));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
/* IE10+ */
background: linear-gradient(to bottom, #f4f8fa 0%, #FFF 73%);
/* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f8fa', endColorstr='#FFF',GradientType=0 );
/* IE6-9 */
}

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,32 @@
<!doctype html>
<!DOCTYPE HTML>
<html>
<head>
<base href="<?php echo HTML_PATH_ADMIN_THEME ?>">
<meta charset="utf-8">
<meta charset="<?php echo CHARSET ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="noindex,nofollow">
<title><?php echo $layout['title'] ?></title>
<link rel="stylesheet" href="./css/kube.min.css">
<link rel="stylesheet" href="./css/default.css">
<link rel="stylesheet" href="./css/css/font-awesome.css">
<link rel="shortcut icon" type="image/x-icon" href="./css/favicon.png">
<script src="./js/jquery.min.js"></script>
<script src="./js/kube.min.js"></script>
<link rel="stylesheet" type="text/css" href="./css/kube.min.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/default.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/jquery.datetimepicker.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" type="text/css" href="./css/css/font-awesome.css?version=<?php echo BLUDIT_VERSION ?>">
<script charset="utf-8" src="./js/jquery.min.js?version=<?php echo BLUDIT_VERSION ?>"></script>
<script charset="utf-8" src="./js/kube.min.js?version=<?php echo BLUDIT_VERSION ?>"></script>
<script charset="utf-8" src="./js/jquery.datetimepicker.js?version=<?php echo BLUDIT_VERSION ?>"></script>
<!-- Plugins -->
<?php
Theme::plugins('onAdminHead');
?>
<?php Theme::plugins('adminHead') ?>
</head>
<body>
<!-- Plugins -->
<?php Theme::plugins('adminBodyBegin') ?>
<!-- ALERT -->
<script>
$(document).ready(function() {
@ -55,7 +61,7 @@ $(document).ready(function() {
<div id="sidebar" class="nav">
<ul>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>dashboard"><i class="fa fa-sun-o"></i><?php $Language->p('Dasbhoard') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>dashboard"><i class="fa fa-sun-o"></i><?php $Language->p('Dashboard') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>new-post"><i class="fa fa-pencil-square-o"></i><?php $Language->p('New post') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>new-page"><i class="fa fa-pencil"></i><?php $Language->p('New page') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>manage-posts"><i class="fa fa-file-text-o"></i><?php $Language->p('Manage') ?></a></li>
@ -91,12 +97,9 @@ $(document).ready(function() {
?>
<!-- Plugins -->
<?php
Theme::plugins('onAdminBody');
?>
<?php Theme::plugins('adminBodyEnd') ?>
<div id="footer">Bludit <?php echo BLUDIT_VERSION ?> | Load time <?php echo round((microtime(true) - $loadTime), 5) ?></div>
<?php
echo "DEBUG: Load time: ".(microtime(true) - $loadTime).'<br>';
?>
</body>
</html>

View File

@ -3,15 +3,16 @@
function makeNavbar($type)
{
global $layout;
global $Language;
$navbar['users'] = array(
'users'=>array('text'=>'Users'),
'add-user'=>array('text'=>'Add new user')
'users'=>array('text'=>$Language->g('Users')),
'add-user'=>array('text'=>$Language->g('Add a new user'))
);
$navbar['manage'] = array(
'manage-posts'=>array('text'=>'Manage posts'),
'manage-pages'=>array('text'=>'Manage pages')
'manage-posts'=>array('text'=>$Language->g('Manage posts')),
'manage-pages'=>array('text'=>$Language->g('Manage pages'))
);
echo '<nav class="navbar sublinks"><ul>';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -2,38 +2,42 @@
<html>
<head>
<base href="<?php echo HTML_PATH_ADMIN_THEME ?>">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="<?php echo CHARSET ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bludit Login</title>
<title>Bludit</title>
<link rel="stylesheet" href="./css/kube.min.css">
<link rel="stylesheet" href="./css/default.css">
<link rel="stylesheet" href="./css/css/font-awesome.css">
<link rel="stylesheet" href="./css/kube.min.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" href="./css/default.css?version=<?php echo BLUDIT_VERSION ?>">
<link rel="stylesheet" href="./css/css/font-awesome.css?version=<?php echo BLUDIT_VERSION ?>">
<!-- Plugins Login Head -->
<?php Theme::plugins('loginHead') ?>
</head>
<body>
<!-- Plugins Login Body Begin -->
<?php Theme::plugins('loginBodyBegin') ?>
<div id="head">
<nav class="navbar nav-fullwidth">
<h1>Bludit</h1>
<ul>
<li><a href="<?php echo HTML_PATH_ROOT ?>"><?php $Language->p('Home') ?></a></li>
</ul>
<ul>
<li><a href="<?php echo HTML_PATH_ROOT ?>"><?php $Language->p('Website') ?></a></li>
</ul>
</nav>
</div>
<div class="units-row">
<!-- CONTENT -->
<div class="unit-centered unit-40" style="max-width: 500px">
<div class="unit-centered unit-40" style="max-width: 400px">
<div id="content">
<?php
if(Alert::defined()) {
echo '<div class="tools-alert tools-alert-red">'.Alert::get().'</div>';
echo '<div class="tools-alert tools-alert-green">'.Alert::get().'</div>';
}
// Load view
@ -46,8 +50,9 @@
</div>
</div>
<?php
echo "DEBUG: Load time: ".(microtime(true) - $loadTime).'<br>';
?>
<!-- Plugins Login Body Begin -->
<?php Theme::plugins('loginBodyEnd') ?>
</body>
</html>

View File

@ -1,38 +1,41 @@
<h2 class="title"><i class="fa fa-user-plus"></i> <?php $Language->p('Add a new user') ?></h2>
<h2 class="title"><i class="fa fa-user-plus"></i><?php $Language->p('Add a new user') ?></h2>
<?php makeNavbar('users'); ?>
<form method="post" action="" class="forms">
<label>
<?php $Language->p('Username') ?>
<input type="text" name="username" class="width-50">
</label>
<form method="post" action="" class="forms" autocomplete="off">
<label>
<?php $Language->p('Password') ?>
<input type="password" name="password" class="width-50">
</label>
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
<label>
<?php $Language->p('Confirm Password') ?>
<input type="password" name="confirm-password" class="width-50">
</label>
<label>
<?php $Language->p('Username') ?>
<input type="text" name="username" class="width-50" value="<?php echo (isset($_POST['username'])?$_POST['username']:'') ?>">
</label>
<label for="country">
<?php $Language->p('Role') ?>
<select name="role" class="width-50">
<option value="editor"><?php $Language->p('Editor') ?></option>
<option value="admin"><?php $Language->p('Administrator') ?></option>
</select>
<div class="forms-desc"><?php $Language->p('you-can-choose-the-users-privilege') ?></div>
</label>
<label>
<?php $Language->p('Password') ?>
<input type="password" name="password" class="width-50">
</label>
<label>
Email
<input type="text" name="email" class="width-50">
<div class="forms-desc"><?php $Language->p('email-will-not-be-publicly-displayed') ?></div>
</label>
<label>
<?php $Language->p('Confirm Password') ?>
<input type="password" name="confirm-password" class="width-50">
</label>
<input type="submit" class="btn btn-blue" value="<?php $Language->p('Add') ?>" name="add-user">
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>" class="btn"><?php $Language->p('Cancel') ?></a>
<label for="country">
<?php $Language->p('Role') ?>
<select name="role" class="width-50">
<option value="editor"><?php $Language->p('Editor') ?></option>
<option value="admin"><?php $Language->p('Administrator') ?></option>
</select>
<div class="forms-desc"><?php $Language->p('you-can-choose-the-users-privilege') ?></div>
</label>
<label>
<?php $Language->p('Email') ?>
<input type="text" name="email" class="width-50" value="<?php echo (isset($_POST['email'])?$_POST['email']:'') ?>">
<div class="forms-desc"><?php $Language->p('email-will-not-be-publicly-displayed') ?></div>
</label>
<input type="submit" class="btn btn-blue" value="<?php $Language->p('Add') ?>" name="add-user">
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>" class="btn"><?php $Language->p('Cancel') ?></a>
</form>

View File

@ -2,14 +2,15 @@
<form id="jsformplugin" method="post" action="" class="forms">
<input type="hidden" id="jskey" name="key" value="">
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
<input type="hidden" id="jskey" name="key" value="">
<?php
echo $_Plugin->form();
?>
<?php
echo $_Plugin->form();
?>
<div>
<button class="btn btn-blue" name="publish"><?php echo $Language->p('Save') ?></button>
</div>
<div>
<button class="btn btn-blue" name="publish"><?php echo $Language->p('Save') ?></button>
</div>
</form>

View File

@ -2,7 +2,36 @@
<div class="units-row">
<div class="unit-40">
<div class="unit-50">
<div class="dashboardBox">
<h2><?php $Language->p('Start here') ?></h2>
<div class="content">
<ul class="menu">
<li class="title"><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>new-post"><?php $Language->p('New post') ?></a></li>
<li class="description"><?php $Language->p('Create a new article for your blog') ?></li>
<li class="title"><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>new-page"><?php $Language->p('New page') ?></a></li>
<li class="description"><?php $Language->p('Create a new page for your website') ?></li>
<li class="title"><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>add-user"><?php $Language->p('Add a new user') ?></a></li>
<li class="description"><?php $Language->p('Invite a friend to collaborate on your website') ?></li>
<li class="title"><a href="<?php echo HTML_PATH_ADMIN_ROOT ?>settings#regional"><?php $Language->p('Language and timezone') ?></a></li>
<li class="description"><?php $Language->p('Change your language and region settings') ?></li>
</ul>
</div>
</div>
</div>
<div class="unit-50">
<?php if($_newPosts || $_newPages) { ?>
<div class="dashboardBox">
<div class="content contentGreen">
<div class="bigContent"><?php $Language->p('database-regenerated') ?></div>
<div class="littleContent"><?php $Language->p('new-posts-and-pages-synchronized') ?></div>
<i class="iconContent fa fa-pie-chart"></i>
</div>
</div>
<?php } ?>
<div class="dashboardBox">
<div class="content contentBlue">
@ -20,36 +49,31 @@
</div>
</div>
</div>
<div class="unit-60">
<?php if($_newPosts || $_newPages) { ?>
<div class="dashboardBox">
<div class="content contentGreen">
<div class="bigContent"><?php $Language->p('database-regenerated') ?></div>
<div class="littleContent"><?php $Language->p('new-posts-and-pages-synchronized') ?></div>
<i class="iconContent fa fa-pie-chart"></i>
</div>
</div>
<?php } ?>
<div class="dashboardBox">
<h2><?php $Language->p('notifications') ?></h2>
<h2><?php $Language->p('Drafts') ?></h2>
<div class="content">
<nav class="nav">
<ul>
<li>New comment</li>
<li>Admin session started at 07:00pm</li>
<li>Failed login with username diego</li>
<li>Database regenerated</li>
<li>New session started at 01:00pm</li>
<li>New post added</li>
<li>New page added</li>
<?php
if( empty($_draftPosts) && empty($_draftPages) )
{
echo '<li>'.$Language->g('There are no drafts').'</li>';
}
else
{
foreach($_draftPosts as $Post)
{
echo '<li><span class="label label-outline label-blue smaller">'.$Language->g('Post').'</span><a href="'.HTML_PATH_ADMIN_ROOT.'edit-post/'.$Post->key().'">'.($Post->title()?$Post->title():'['.$Language->g('Empty title').'] ').'</a></li>';
}
foreach($_draftPages as $Page)
{
echo '<li><span class="label label-outline label-green smaller">'.$Language->g('Page').'</span><a href="'.HTML_PATH_ADMIN_ROOT.'edit-page/'.$Page->key().'">'.($Page->title()?$Page->title():'['.$Language->g('Empty title').'] ').'</a></li>';
}
}
?>
</ul>
</nav>
</div>
</div>
</div>
</div>

View File

@ -1,31 +1,23 @@
<h2 class="title"><i class="fa fa-pencil"></i> <?php $Language->p('Edit page') ?></h2>
<h2 class="title"><i class="fa fa-pencil"></i><?php $Language->p('Edit page') ?></h2>
<form id="jsform" method="post" action="" class="forms">
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
<input type="hidden" id="jskey" name="key" value="<?php echo $_Page->key() ?>">
<label>
<?php $Language->p('Title') ?>
<input id="jstitle" name="title" type="text" class="width-70" value="<?php echo $_Page->title() ?>">
<input id="jstitle" name="title" type="text" class="width-90" value="<?php echo $_Page->title() ?>">
</label>
<label>
<label class="width-90">
<?php $Language->p('Content') ?> <span class="forms-desc"><?php $Language->p('HTML and Markdown code supported') ?></span>
<textarea name="content" rows="10" class="width-70"><?php echo $_Page->contentRaw(true, false) ?></textarea>
<textarea id="jscontent" name="content" rows="15"><?php echo $_Page->contentRaw(false) ?></textarea>
</label>
<?php
if($Site->advancedOptions()) {
echo '<div id="jsadvancedOptions">';
}
else
{
echo '<p class="advOptions">'.$Language->g('Enable more features at').' <a href="'.HTML_PATH_ADMIN_ROOT.'settings#advanced">'.$Language->g('settings-advanced-writting-settings').'</a></p>';
echo '<div id="jsadvancedOptions" style="display:none">';
}
?>
<button id="jsadvancedButton" class="btn btn-smaller"><?php $Language->p('Advanced options') ?></button>
<h4><?php $Language->p('Advanced options') ?></h4>
<div id="jsadvancedOptions">
<?php
// Remove setting pages parents if the page is a parent.
@ -45,7 +37,6 @@
}
?>
</select>
<div class="forms-desc">Tip/Help ???</div>
</label>
<?php } ?>
@ -56,19 +47,19 @@
<span class="input-prepend"><?php echo $Site->url() ?><span id="jsparentExample"><?php echo $_Page->parentKey()?$_Page->parentKey().'/':''; ?></span></span>
<input id="jsslug" type="text" name="slug" value="<?php echo $_Page->slug() ?>">
</div>
<span class="forms-desc">You can modify the URL which identifies a page or post using human-readable keywords. No more than 150 characters.</span>
<span class="forms-desc"><?php $Language->p('you-can-modify-the-url-which-identifies') ?></span>
</label>
<label>
<?php $Language->p('Description') ?>
<input id="jsdescription" type="text" name="description" class="width-50" value="<?php echo $_Page->description() ?>">
<span class="forms-desc">This field can help describe the content in a few words. No more than 150 characters.</span>
<span class="forms-desc"><?php $Language->p('this-field-can-help-describe-the-content') ?></span>
</label>
<label>
<?php $Language->p('Tags') ?>
<input id="jstags" name="tags" type="text" class="width-50" value="<?php echo $_Page->tags() ?>">
<span class="forms-desc">Write the tags separeted by comma. eg: tag1, tag2, tag3</span>
<span class="forms-desc"><?php $Language->p('write-the-tags-separeted-by-comma') ?></span>
</label>
<label>
@ -122,11 +113,16 @@ $(document).ready(function()
});
$("#jsdelete").click(function() {
if(!confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")) {
event.preventDefault();
if(confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")==false) {
return false;
}
});
$("#jsadvancedButton").click(function() {
$("#jsadvancedOptions").slideToggle();
return false;
});
});
</script>

View File

@ -1,57 +1,56 @@
<h2 class="title"><i class="fa fa-pencil"></i> <?php $Language->p('Edit post') ?></h2>
<h2 class="title"><i class="fa fa-pencil"></i><?php $Language->p('Edit post') ?></h2>
<form method="post" action="" class="forms">
<input type="hidden" id="jskey" name="key" value="<?php echo $_Post->key() ?>">
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
<input type="hidden" id="jskey" name="key" value="<?php echo $_Post->key() ?>">
<label>
<?php $Language->p('Title') ?>
<input id="jstitle" name="title" type="text" class="width-70" value="<?php echo $_Post->title() ?>">
</label>
<label>
<?php $Language->p('Title') ?>
<input id="jstitle" name="title" type="text" class="width-90" value="<?php echo $_Post->title() ?>">
</label>
<label>
<?php $Language->p('Content') ?> <span class="forms-desc"><?php $Language->p('HTML and Markdown code supported') ?></span>
<textarea id="jscontent" name="content" rows="10" class="width-70"><?php echo $_Post->contentRaw(true, false) ?></textarea>
</label>
<label class="width-90">
<?php $Language->p('Content') ?> <span class="forms-desc"><?php $Language->p('HTML and Markdown code supported') ?></span>
<textarea id="jscontent" name="content" rows="15"><?php echo $_Post->contentRaw(false) ?></textarea>
</label>
<?php
if($Site->advancedOptions()) {
echo '<div id="jsadvancedOptions">';
}
else
{
echo '<p class="advOptions">'.$Language->g('Enable more features at').' <a href="'.HTML_PATH_ADMIN_ROOT.'settings#advanced">'.$Language->g('settings-advanced-writting-settings').'</a></p>';
echo '<div id="jsadvancedOptions" style="display:none">';
}
?>
<button id="jsadvancedButton" class="btn btn-smaller"><?php $Language->p('Advanced options') ?></button>
<h4><?php $Language->p('Advanced options') ?></h4>
<div id="jsadvancedOptions">
<label>
<?php $Language->p('Friendly Url') ?>
<div class="input-groups width-50">
<span class="input-prepend"><?php echo $Site->urlPost() ?><span id="jsparentExample"></span></span>
<input id="jsslug" type="text" name="slug" value="<?php echo $_Post->slug() ?>">
</div>
<span class="forms-desc">Short text no more than 150 characters. Special characters not allowed.</span>
</label>
<label>
<?php $Language->p('Date') ?>
<input name="date" id="jsdate" type="text" value="<?php echo $_Post->date() ?>">
<span class="forms-desc"><?php $Language->p('You can schedule the post just select the date and time') ?></span>
</label>
<label>
<?php $Language->p('Description') ?>
<input id="jsdescription" type="text" name="description" class="width-50" value="<?php echo $_Post->description() ?>">
<span class="forms-desc">This field is for Twitter/Facebook/Google+ descriptions. No more than 150 characters.</span>
</label>
<label>
<?php $Language->p('Friendly Url') ?>
<div class="input-groups width-50">
<span class="input-prepend"><?php echo $Site->urlPost() ?><span id="jsparentExample"></span></span>
<input id="jsslug" type="text" name="slug" value="<?php echo $_Post->slug() ?>">
</div>
<span class="forms-desc"><?php $Language->p('you-can-modify-the-url-which-identifies') ?></span>
</label>
<label>
<?php $Language->p('Tags') ?>
<input id="jstags" name="tags" type="text" class="width-50" value="<?php echo $_Post->tags() ?>">
<span class="forms-desc">Write the tags separeted by comma. eg: tag1, tag2, tag3</span>
</label>
</div>
<label>
<?php $Language->p('Description') ?>
<input id="jsdescription" type="text" name="description" class="width-50" value="<?php echo $_Post->description() ?>">
<span class="forms-desc"><?php $Language->p('this-field-can-help-describe-the-content') ?></span>
</label>
<button class="btn btn-blue" name="publish"><?php echo ($_Post->published()?$Language->p('Save'):$Language->p('Publish now')) ?></button>
<button class="btn" name="draft"><?php $Language->p('Draft') ?></button>
<button id="jsdelete" class="btn" name="delete"><?php $Language->p('Delete') ?></button>
<label>
<?php $Language->p('Tags') ?>
<input id="jstags" name="tags" type="text" class="width-50" value="<?php echo $_Post->tags() ?>">
<span class="forms-desc"><?php $Language->p('write-the-tags-separeted-by-comma') ?></span>
</label>
</div>
<button class="btn btn-blue" name="publish"><?php echo ($_Post->published()?$Language->p('Save'):$Language->p('Publish')) ?></button>
<button class="btn" name="draft"><?php $Language->p('Draft') ?></button>
<button id="jsdelete" class="btn" name="delete"><?php $Language->p('Delete') ?></button>
</form>
@ -59,25 +58,30 @@
$(document).ready(function()
{
var key = $("#jskey").val();
var key = $("#jskey").val();
$("#jstitle").keyup(function() {
var slug = $(this).val();
$("#jsdate").datetimepicker({format:"<?php echo DB_DATE_FORMAT ?>"});
checkSlugPost(slug, key, $("#jsslug"));
});
$("#jstitle").keyup(function() {
var slug = $(this).val();
checkSlugPost(slug, key, $("#jsslug"));
});
$("#jsslug").keyup(function() {
var slug = $("#jsslug").val();
$("#jsslug").keyup(function() {
var slug = $("#jsslug").val();
checkSlugPost(slug, key, $("#jsslug"));
});
checkSlugPost(slug, key, $("#jsslug"));
});
$("#jsdelete").click(function() {
if(confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")==false) {
return false;
}
});
$("#jsdelete").click(function() {
if(!confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")) {
event.preventDefault();
}
});
$("#jsadvancedButton").click(function() {
$("#jsadvancedOptions").slideToggle();
return false;
});
});

View File

@ -1,10 +1,14 @@
<h2 class="title"><i class="fa fa-user"></i> <?php $Language->p('Edit user') ?></h2>
<h2 class="title"><i class="fa fa-user"></i><?php $Language->p('Edit user') ?></h2>
<nav class="navbar nav-pills sublinks" data-tools="tabs" data-active="#profile">
<ul>
<li><a href="#profile"><?php $Language->p('Profile') ?></a></li>
<li><a href="#email"><?php $Language->p('Email') ?></a></li>
<li><a href="#password"><?php $Language->p('Password') ?></a></li>
<?php if($_user['username']!=='admin') { ?>
<li><a href="#delete"><?php $Language->p('Delete') ?></a></li>
<?php } ?>
</ul>
</nav>
@ -14,6 +18,9 @@
<div id="profile">
<form method="post" action="" class="forms">
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
<input type="hidden" name="edit-user" value="true">
<input type="hidden" name="username" value="<?php echo $_user['username'] ?>">
<label>
@ -26,10 +33,8 @@
<input type="text" name="lastName" class="width-50" value="<?php echo $_user['lastName'] ?>">
</label>
<?php
if($Login->username()==='admin')
{
?>
<?php if($Login->username()==='admin') { ?>
<label for="role">
<?php $Language->p('Role') ?>
<select name="role" class="width-50">
@ -42,10 +47,10 @@
</select>
<div class="forms-desc"><?php $Language->p('you-can-choose-the-users-privilege') ?></div>
</label>
<?php
}
?>
<input type="submit" class="btn btn-blue" value="Save" name="user-profile">
<?php } ?>
<input type="submit" class="btn btn-blue" value="<?php $Language->p('Save') ?>" name="user-profile">
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>" class="btn"><?php $Language->p('Cancel') ?></a>
</form>
</div>
@ -56,6 +61,7 @@
<div id="email">
<form method="post" action="" class="forms">
<input type="hidden" name="edit-user" value="true">
<input type="hidden" name="username" value="<?php echo $_user['username'] ?>">
<label>
@ -64,7 +70,7 @@
<div class="forms-desc"><?php $Language->p('email-will-not-be-publicly-displayed') ?></div>
</label>
<input type="submit" class="btn btn-blue" value="Save" name="user-email">
<input type="submit" class="btn btn-blue" value="<?php $Language->p('Save') ?>" name="user-email">
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>" class="btn"><?php $Language->p('Cancel') ?></a>
</form>
</div>
@ -75,6 +81,7 @@
<div id="password">
<form method="post" action="" class="forms">
<input type="hidden" name="change-password" value="true">
<input type="hidden" name="username" value="<?php echo $_user['username'] ?>">
<label>
@ -87,7 +94,32 @@
<input type="password" name="confirm-password" class="width-50">
</label>
<input type="submit" class="btn btn-blue" value="Save" name="user-password">
<input type="submit" class="btn btn-blue" value="<?php $Language->p('Save') ?>" name="user-password">
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>" class="btn"><?php $Language->p('Cancel') ?></a>
</form>
</div>
<!-- ===================================== -->
<!-- Delete -->
<!-- ===================================== -->
<?php if($_user['username']!=='admin') { ?>
<div id="delete">
<form method="post" action="" class="forms">
<input type="hidden" name="delete-user-all" value="true">
<input type="hidden" name="username" value="<?php echo $_user['username'] ?>">
<p><input type="submit" class="btn btn-blue" value="<?php $Language->p('Delete the user and all its posts') ?>"></p>
</form>
<form method="post" action="" class="forms">
<input type="hidden" name="delete-user-associate" value="true">
<input type="hidden" name="username" value="<?php echo $_user['username'] ?>">
<p><input type="submit" class="btn btn-blue" value="<?php $Language->p('Delete the user and associate its posts to admin user') ?>"></p>
</form>
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>" class="btn"><?php $Language->p('Cancel') ?></a>
</div>
<?php } ?>

View File

@ -1,13 +1,18 @@
<h2 class="title"><?php $Language->p('Login') ?></h2>
<form method="post" action="<?php echo HTML_PATH_ADMIN_ROOT.'login' ?>" class="forms" autocomplete="off">
<label>
<input type="text" name="username" placeholder="<?php $Language->p('Username') ?>" class="width-100" autocomplete="off">
</label>
<label>
<input type="password" name="password" placeholder="<?php $Language->p('Password') ?>" class="width-100" autocomplete="off">
</label>
<p>
<button class="btn btn-blue width-100"><?php $Language->p('Login') ?></button>
</p>
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
<label>
<input type="text" name="username" placeholder="<?php $Language->p('Username') ?>" class="width-100" autocomplete="off">
</label>
<label>
<input type="password" name="password" placeholder="<?php $Language->p('Password') ?>" class="width-100" autocomplete="off">
</label>
<p>
<button class="btn btn-blue width-100"><?php $Language->p('Login') ?></button>
</p>
</form>

View File

@ -1,4 +1,4 @@
<h2 class="title"><i class="fa fa-file-text-o"></i> <?php $Language->p('Manage pages') ?></h2>
<h2 class="title"><i class="fa fa-file-text-o"></i><?php $Language->p('Manage pages') ?></h2>
<?php makeNavbar('manage'); ?>
@ -7,6 +7,8 @@
<tr>
<th><?php $Language->p('Title') ?></th>
<th><?php $Language->p('Parent') ?></th>
<th><?php $Language->p('Friendly URL') ?></th>
<th class="text-centered"><?php $Language->p('Position') ?></th>
</tr>
</thead>
<tbody>
@ -24,8 +26,10 @@
}
echo '<tr>';
echo '<td>'.($Page->parentKey()?NO_PARENT_CHAR:'').'<a href="'.HTML_PATH_ADMIN_ROOT.'edit-page/'.$Page->key().'">'.($Page->published()?'':'['.$Language->g('Draft').'] ').($Page->title()?$Page->title():'['.$Language->g('Empty title').'] ').'</a></td>';
echo '<td>'.($Page->parentKey()?NO_PARENT_CHAR:'').'<a href="'.HTML_PATH_ADMIN_ROOT.'edit-page/'.$Page->key().'">'.($Page->published()?'':'<span class="label label-outline label-red smaller">'.$Language->g('Draft').'</span> ').($Page->title()?$Page->title():'<span class="label label-outline label-blue smaller">'.$Language->g('Empty title').'</span> ').'</a></td>';
echo '<td>'.$parentTitle.'</td>';
echo '<td><a target="_blank" href="'.$Page->permalink().'">'.$Url->filters('page').'/'.$Page->key().'</a></td>';
echo '<td class="text-centered">'.$Page->position().'</td>';
echo '</tr>';
}
}

View File

@ -1,4 +1,4 @@
<h2 class="title"><i class="fa fa-file-text-o"></i> <?php $Language->p('Manage posts') ?></h2>
<h2 class="title"><i class="fa fa-file-text-o"></i><?php $Language->p('Manage posts') ?></h2>
<?php makeNavbar('manage'); ?>
@ -6,8 +6,8 @@
<thead>
<tr>
<th><?php $Language->p('Title') ?></th>
<th><?php $Language->p('Published date') ?></th>
<th><?php $Language->p('Modified date') ?></th>
<th class="text-centered"><?php $Language->p('Published date') ?></th>
<th><?php $Language->p('Friendly URL') ?></th>
</tr>
</thead>
<tbody>
@ -15,13 +15,37 @@
foreach($posts as $Post)
{
$status = false;
if($Post->scheduled()) {
$status = $Language->g('Scheduled');
}
elseif(!$Post->published()) {
$status = $Language->g('Draft');
}
echo '<tr>';
echo '<td><a href="'.HTML_PATH_ADMIN_ROOT.'edit-post/'.$Post->key().'">'.($Post->published()?'':'['.$Language->g('Draft').'] ').($Post->title()?$Post->title():'['.$Language->g('Empty title').'] ').'</a></td>';
echo '<td>'.$Post->dateCreated().'</td>';
echo '<td>'.$Post->timeago().'</td>';
echo '<td><a href="'.HTML_PATH_ADMIN_ROOT.'edit-post/'.$Post->key().'">'.($status?'<span class="label label-outline label-red smaller">'.$status.'</span>':'').($Post->title()?$Post->title():'<span class="label label-outline label-blue smaller">'.$Language->g('Empty title').'</span> ').'</a></td>';
echo '<td class="text-centered">'.$Post->date().'</td>';
echo '<td><a target="_blank" href="'.$Post->permalink().'">'.$Url->filters('post').'/'.$Post->key().'</a></td>';
echo '</tr>';
}
?>
</tbody>
</table>
<div id="paginator">
<ul>
<?php
if(Paginator::get('showNewer')) {
echo '<li class="left"><a href="'.HTML_PATH_ADMIN_ROOT.'manage-posts?page='.Paginator::get('prevPage').'">« '.$Language->g('Prev page').'</a></li>';
}
echo '<li class="list">'.(Paginator::get('currentPage')+1).' / '.(Paginator::get('numberOfPages')+1).'</li>';
if(Paginator::get('showOlder')) {
echo '<li class="right"><a href="'.HTML_PATH_ADMIN_ROOT.'manage-posts?page='.Paginator::get('nextPage').'">'.$Language->g('Next page').' »</a></li>';
}
?>
</ul>
</div>

View File

@ -2,28 +2,21 @@
<form method="post" action="" class="forms">
<label>
<?php $Language->p('Title') ?>
<input id="jstitle" name="title" type="text" class="width-70">
</label>
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
<label>
<?php $Language->p('Title') ?>
<input id="jstitle" name="title" type="text" class="width-90">
</label>
<label class="width-90">
<?php $Language->p('Content') ?> <span class="forms-desc"><?php $Language->p('HTML and Markdown code supported') ?></span>
<textarea id="jscontent" name="content" rows="10" class="width-70"></textarea>
<textarea id="jscontent" name="content" rows="15"></textarea>
</label>
<?php
if($Site->advancedOptions()) {
echo '<div id="jsadvancedOptions">';
}
else
{
echo '<p class="advOptions">'.$Language->g('Enable more features at').' <a href="'.HTML_PATH_ADMIN_ROOT.'settings#advanced">'.$Language->g('settings-advanced-writting-settings').'</a></p>';
echo '<div id="jsadvancedOptions" style="display:none">';
}
?>
<button id="jsadvancedButton" class="btn btn-smaller"><?php $Language->p('Advanced options') ?></button>
<h4><?php $Language->p('Advanced options') ?></h4>
<div id="jsadvancedOptions">
<label for="jsparent">
<?php $Language->p('Parent') ?>
@ -36,7 +29,6 @@
}
?>
</select>
<div class="forms-desc">Tip/Help ???</div>
</label>
<label>
@ -45,19 +37,19 @@
<span class="input-prepend"><?php echo $Site->urlPage() ?><span id="jsparentExample"></span></span>
<input id="jsslug" name="slug" type="text">
</div>
<span class="forms-desc">Short text no more than 150 characters. Special characters not allowed.</span>
<span class="forms-desc"><?php $Language->p('you-can-modify-the-url-which-identifies') ?></span>
</label>
<label>
<?php $Language->p('Description') ?>
<input id="jsdescription" name="description" type="text" class="width-50">
<span class="forms-desc">This field is for Twitter/Facebook/Google+ descriptions. No more than 150 characters.</span>
<span class="forms-desc"><?php $Language->p('this-field-can-help-describe-the-content') ?></span>
</label>
<label>
<?php $Language->p('Tags') ?>
<input id="jstags" name="tags" type="text" class="width-50">
<span class="forms-desc">Write the tags separeted by comma. eg: tag1, tag2, tag3</span>
<span class="forms-desc"><?php $Language->p('write-the-tags-separeted-by-comma') ?></span>
</label>
<label>
@ -105,6 +97,11 @@ $(document).ready(function()
checkSlugPage(text, parent, "", $("#jsslug"));
});
$("#jsadvancedButton").click(function() {
$("#jsadvancedOptions").slideToggle();
return false;
});
});
</script>

View File

@ -1,55 +1,54 @@
<h2 class="title"><i class="fa fa-pencil"></i> <?php $Language->p('New post') ?></h2>
<h2 class="title"><i class="fa fa-pencil"></i><?php $Language->p('New post') ?></h2>
<form method="post" action="" class="forms">
<label>
<?php $Language->p('Title') ?>
<input id="jstitle" name="title" type="text" class="width-70">
</label>
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
<label>
<?php $Language->p('Content') ?> <span class="forms-desc"><?php $Language->p('HTML and Markdown code supported') ?></span>
<textarea id="jscontent" name="content" rows="10" class="width-70"></textarea>
</label>
<label>
<?php $Language->p('Title') ?>
<input id="jstitle" name="title" type="text" class="width-90">
</label>
<?php
if($Site->advancedOptions()) {
echo '<div id="jsadvancedOptions">';
}
else
{
echo '<p class="advOptions">'.$Language->g('Enable more features at').' <a href="'.HTML_PATH_ADMIN_ROOT.'settings#advanced">'.$Language->g('settings-advanced-writting-settings').'</a></p>';
echo '<div id="jsadvancedOptions" style="display:none">';
}
?>
<label class="width-90">
<?php $Language->p('Content') ?> <span class="forms-desc"><?php $Language->p('HTML and Markdown code supported') ?></span>
<textarea id="jscontent" name="content" rows="15" ></textarea>
</label>
<h4><?php $Language->p('Advanced options') ?></h4>
<button id="jsadvancedButton" class="btn btn-smaller"><?php $Language->p('Advanced options') ?></button>
<label>
<?php $Language->p('Friendly Url') ?>
<div class="input-groups width-50">
<span class="input-prepend"><?php echo $Site->urlPost() ?><span id="jsparentExample"></span></span>
<input id="jsslug" name="slug" type="text">
</div>
<span class="forms-desc">Short text no more than 150 characters. Special characters not allowed.</span>
</label>
<div id="jsadvancedOptions">
<label>
<?php $Language->p('Description') ?>
<input id="jsdescription" name="description" type="text" class="width-50">
<span class="forms-desc">This field is for Twitter/Facebook/Google+ descriptions. No more than 150 characters.</span>
</label>
<label>
<?php $Language->p('Date') ?>
<input name="date" id="jsdate" type="text">
<span class="forms-desc"><?php $Language->p('You can schedule the post just select the date and time') ?></span>
</label>
<label>
<?php $Language->p('Tags') ?>
<input id="jstags" name="tags" type="text" class="width-50">
<span class="forms-desc">Write the tags separeted by comma. eg: tag1, tag2, tag3</span>
</label>
<label>
<?php $Language->p('Friendly Url') ?>
<div class="input-groups width-50">
<span class="input-prepend"><?php echo $Site->urlPost() ?><span id="jsparentExample"></span></span>
<input id="jsslug" name="slug" type="text">
</div>
<span class="forms-desc"><?php $Language->p('you-can-modify-the-url-which-identifies') ?></span>
</label>
</div>
<label>
<?php $Language->p('Description') ?>
<input id="jsdescription" name="description" type="text" class="width-50">
<span class="forms-desc"><?php $Language->p('this-field-can-help-describe-the-content') ?></span>
</label>
<button class="btn btn-blue" name="publish"><?php $Language->p('Publish now') ?></button>
<button class="btn" name="draft"><?php $Language->p('Draft') ?></button>
<label>
<?php $Language->p('Tags') ?>
<input id="jstags" name="tags" type="text" class="width-50">
<span class="forms-desc"><?php $Language->p('write-the-tags-separeted-by-comma') ?></span>
</label>
</div>
<button class="btn btn-blue" name="publish"><?php $Language->p('Publish') ?></button>
<button class="btn" name="draft"><?php $Language->p('Draft') ?></button>
</form>
@ -57,18 +56,24 @@
$(document).ready(function()
{
$("#jsdate").datetimepicker({format:"<?php echo DB_DATE_FORMAT ?>"});
$("#jstitle").keyup(function() {
var slug = $(this).val();
$("#jstitle").keyup(function() {
var slug = $(this).val();
checkSlugPost(slug, "", $("#jsslug"));
});
checkSlugPost(slug, "", $("#jsslug"));
});
$("#jsslug").keyup(function() {
var slug = $("#jsslug").val();
$("#jsslug").keyup(function() {
var slug = $("#jsslug").val();
checkSlugPost(slug, "", $("#jsslug"));
});
checkSlugPost(slug, "", $("#jsslug"));
});
$("#jsadvancedButton").click(function() {
$("#jsadvancedOptions").slideToggle();
return false;
});
});

View File

@ -1,21 +1,22 @@
<h2 class="title"><i class="fa fa-rocket"></i> <?php $Language->p('Plugins') ?></h2>
<h2 class="title"><i class="fa fa-rocket"></i><?php $Language->p('Plugins') ?></h2>
<?php
foreach($plugins['all'] as $Plugin)
{
echo '<div class="pluginBox">';
echo '<p>'.$Plugin->name().'</p>';
echo '<p class="name">'.$Plugin->name().'</p>';
echo '<p>'.$Plugin->description().'</p>';
echo '<span class="version">'.$Language->g('Version').': '.$Plugin->version().'</span><span class="author">'.$Language->g('author').': <a targe="_blank" href="'.$Plugin->website().'">'.$Plugin->author().'</a></span>';
if($Plugin->installed()) {
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'uninstall-plugin/'.$Plugin->className().'" class="btn btn-red btn-small">'.$Language->g('Uninstall plugin').'</a>';
if($Plugin->form()) {
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'configure-plugin/'.$Plugin->className().'" class="btn btn-small">'.$Language->g('Configure plugin').'</a>';
if(method_exists($Plugin, 'form')) {
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'configure-plugin/'.$Plugin->className().'" class="btn btn-smaller">'.$Language->g('Configure plugin').'</a>';
}
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'uninstall-plugin/'.$Plugin->className().'" class="btn btn-red btn-smaller">'.$Language->g('Uninstall plugin').'</a>';
}
else {
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'install-plugin/'.$Plugin->className().'" class="btn btn-blue btn-small">'.$Language->g('Install plugin').'</a>';
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'install-plugin/'.$Plugin->className().'" class="btn btn-blue btn-smaller">'.$Language->g('Install plugin').'</a>';
}
echo '</div>';

View File

@ -1,4 +1,4 @@
<h2 class="title"><i class="fa fa-cogs"></i> <?php $Language->p('Settings') ?></h2>
<h2 class="title"><i class="fa fa-cogs"></i><?php $Language->p('Settings') ?></h2>
<nav class="navbar nav-pills sublinks" data-tools="tabs" data-active="#general">
<ul>
@ -15,6 +15,9 @@
<div id="general">
<form method="post" action="" class="forms">
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
<label>
<?php $Language->p('Site title') ?>
<input type="text" name="title" class="width-50" value="<?php echo $Site->title() ?>">
@ -24,7 +27,7 @@
<label>
<?php $Language->p('Site slogan') ?>
<input type="text" name="slogan" class="width-50" value="<?php echo $Site->slogan() ?>">
<div class="forms-desc"><?php $Language->p('use-this-field-to-add-a-catchy-prhase') ?></div>
<div class="forms-desc"><?php $Language->p('use-this-field-to-add-a-catchy-phrase') ?></div>
</label>
<label>
@ -50,6 +53,9 @@
<div id="advanced">
<form method="post" action="" class="forms">
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
<label for="postsperpage">
<?php $Language->p('Posts per page') ?>
<select name="postsperpage" class="width-50">
@ -63,22 +69,24 @@
<div class="forms-desc"><?php $Language->p('number-of-posts-to-show-per-page') ?></div>
</label>
<label for="homepage">
<?php $Language->p('Default home page') ?>
<select name="homepage" class="width-50">
<?php
$htmlOptions = $_homePageList;
foreach($htmlOptions as $value=>$text) {
echo '<option value="'.$value.'"'.( ($Site->homepage()===$value)?' selected="selected"':'').'>'.$text.'</option>';
}
?>
</select>
</label>
<label>
<?php $Language->p('Site URL') ?>
<input type="text" name="url" class="width-50" value="<?php echo $Site->url() ?>">
<div class="forms-desc"><?php $Language->p('the-url-of-your-site') ?></div>
</label>
<h4><?php $Language->p('Writting settings') ?></h4>
<ul class="forms-list">
<li>
<input type="checkbox" name="advancedOptions" id="advancedOptions" value="true" <?php echo $Site->advancedOptions()?'checked':'' ?>>
<label for="advancedOptions"><?php $Language->p('Advanced options') ?></label>
<div class="forms-desc"><?php $Language->p('add-or-edit-description-tags-or') ?></div>
</li>
</ul>
<h4><?php $Language->p('URL Filters') ?></h4>
<label>
@ -110,6 +118,9 @@
<div id="regional">
<form method="post" action="" class="forms" name="form-regional">
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
<label for="jslanguage">
<?php $Language->p('Language') ?>
<select id="jslanguage" name="language" class="width-50">
@ -164,5 +175,5 @@ $(document).ready(function() {
<!-- ===================================== -->
<div id="about">
<p><i class="fa fa-pencil-square-o"></i> Bludit version <?php echo BLUDIT_VERSION.' ('.BLUDIT_RELEASE_DATE.')' ?></p>
<p><i class="fa fa-pencil-square-o"></i> <?php $Language->p('Bludit version') ?>: <?php echo BLUDIT_VERSION.' ('.BLUDIT_RELEASE_DATE.')' ?></p>
</div>

View File

@ -1,2 +1,24 @@
<h2 class="title"><i class="fa fa-adjust"></i> Themes</h2>
<p>Not implemented...</p>
<h2 class="title"><i class="fa fa-adjust"></i><?php $Language->p('Themes') ?></h2>
<?php
foreach($themes as $theme)
{
$installedCSS = '';
if($theme['dirname']==$Site->theme()) {
$installedCSS = 'themeBoxInstalled';
}
echo '<div class="themeBox '.$installedCSS.'">';
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').': <a targe="_blank" href="'.$theme['website'].'">'.$theme['author'].'</a></span>';
if($theme['dirname']!=$Site->theme()) {
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'install-theme/'.$theme['dirname'].'" class="btn btn-red btn-smaller">'.$Language->g('Install theme').'</a>';
}
echo '</div>';
}
?>

View File

@ -1,4 +1,4 @@
<h2 class="title"><i class="fa fa-users"></i> <?php $Language->p('Users') ?></h2>
<h2 class="title"><i class="fa fa-users"></i><?php $Language->p('Users') ?></h2>
<?php makeNavbar('users'); ?>
@ -24,7 +24,7 @@
echo '<td>'.$field['lastName'].'</td>';
echo '<td>'.$field['role'].'</td>';
echo '<td>'.$field['email'].'</td>';
echo '<td>'.Date::format($field['registered'], '%d %B').'</td>';
echo '<td>'.Date::format($field['registered'], DB_DATE_FORMAT, DB_DATE_FORMAT).'</td>';
echo '</tr>';
}
?>

6
content/README Normal file
View File

@ -0,0 +1,6 @@
# Bludit
Set the correct permissions on this directory.
Documentation:
- http://docs.bludit.com/en/troubleshooting/writing-test-failure-err205

View File

@ -38,10 +38,23 @@ Si cambia el parent
verificar parent
mover directorio adentro del parent
—————————
Nuevo post
- Reindex dbtags
—————————
Editar usuario
1- Usuario logueado
2- Ver si el usuario es administrador o si es el mismo usuario que se esta editando.
—————————
dbTags
Regenerate posts list
- Al momento de regenerarla deberia enviarle la lista de post ordenada por fecha.
- De esta forma la estructura esta ordenada para mostrarla.
- El que hace el trabajo es el administrador
—————————
New post->Publish->Manage posts
New page->Publish->Manage pages

View File

@ -4,7 +4,7 @@
* Bludit
* http://www.bludit.com
* Author Diego Najar
* All Bludit code is released under the GNU General Public License.
* Bludit is opensource software licensed under the MIT license.
*/
// Check installation
@ -14,7 +14,7 @@ if( !file_exists('content/databases/site.php') )
exit('<a href="./install.php">First, install Bludit</a>');
}
// DEBUG:
// Load time init
$loadTime = microtime(true);
// Security constant
@ -23,27 +23,18 @@ define('BLUDIT', true);
// Directory separator
define('DS', DIRECTORY_SEPARATOR);
// PHP paths
// PHP paths for init
define('PATH_ROOT', __DIR__.DS);
define('PATH_BOOT', PATH_ROOT.'kernel'.DS.'boot'.DS);
define('PATH_BOOT', PATH_ROOT.'kernel'.DS.'boot'.DS);
// Init
require(PATH_BOOT.'init.php');
// Admin area
if($Url->whereAmI()==='admin')
{
if($Url->whereAmI()==='admin') {
require(PATH_BOOT.'admin.php');
}
// Site
else
{
else {
require(PATH_BOOT.'site.php');
}
// DEBUG:
// Print all variables/objects
//print_r(get_defined_vars());
//var_dump($_SESSION);
//var_dump($Login->fingerPrint());

View File

@ -1,254 +1,433 @@
<?php
/*
* Bludit
* http://www.bludit.com
* Author Diego Najar
* Bludit is opensource software licensed under the MIT license.
*/
// Security constant
define('BLUDIT', true);
// Directory separator
define('DS', DIRECTORY_SEPARATOR);
// PATHs
define('PATH_ROOT', __DIR__.DS);
define('PATH_CONTENT', PATH_ROOT.'content'.DS);
define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS);
define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
define('PATH_PLUGINS_DATABASES', PATH_CONTENT.'databases'.DS.'plugins'.DS);
define('DOMAIN', getenv('HTTP_HOST'));
// PHP paths
define('PATH_ROOT', __DIR__.DS);
define('PATH_CONTENT', PATH_ROOT.'content'.DS);
define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS);
define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
define('PATH_PLUGINS_DATABASES',PATH_CONTENT.'databases'.DS.'plugins'.DS);
define('PATH_KERNEL', PATH_ROOT.'kernel'.DS);
define('PATH_HELPERS', PATH_KERNEL.'helpers'.DS);
define('PATH_LANGUAGES', PATH_ROOT.'languages'.DS);
define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS);
define('DOMAIN', getenv('HTTP_HOST'));
// HTML PATHs
$base = (dirname(getenv('SCRIPT_NAME'))==DS)?'/':dirname(getenv('SCRIPT_NAME')).'/';
define('HTML_PATH_ROOT', $base);
// Log separator
define('LOG_SEP', ' | ');
// JSON
if(!defined('JSON_PRETTY_PRINT')) {
define('JSON_PRETTY_PRINT', 128);
}
// Check if JSON encode and decode are enabled.
define('JSON', function_exists('json_encode'));
// Database format date
define('DB_DATE_FORMAT', 'Y-m-d H:i');
// Charset, default UTF-8.
define('CHARSET', 'UTF-8');
// Multibyte string extension loaded.
define('MB_STRING', extension_loaded('mbstring'));
if(MB_STRING)
{
// Set internal character encoding.
mb_internal_encoding(CHARSET);
// Set HTTP output character encoding.
mb_http_output(CHARSET);
}
// PHP Classes
include(PATH_HELPERS.'sanitize.class.php');
include(PATH_HELPERS.'valid.class.php');
include(PATH_HELPERS.'text.class.php');
include(PATH_ABSTRACT.'dbjson.class.php');
include(PATH_KERNEL.'dblanguage.class.php');
include(PATH_HELPERS.'log.class.php');
include(PATH_HELPERS.'date.class.php');
// Try to detect language from HTTP
$explode = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
$localeFromHTTP = empty($explode[0])?'en_US':str_replace('-', '_', $explode[0]);
if(isset($_GET['language'])) {
$localeFromHTTP = Sanitize::html($_GET['language']);
}
$Language = new dbLanguage($localeFromHTTP);
// ============================================================================
// FUNCTIONS
// ============================================================================
// Generate a random string
function getLanguageList()
{
$files = glob(PATH_LANGUAGES.'*.json');
$tmp = array();
foreach($files as $file)
{
$t = new dbJSON($file, false);
$native = $t->db['language-data']['native'];
$locale = basename($file, '.json');
$tmp[$locale] = $native;
}
return $tmp;
}
// Generate a random string.
// Thanks, http://stackoverflow.com/questions/4356289/php-random-string-generator
function getRandomString($length = 10) {
return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);
}
function alreadyInstalled()
{
// Check if Bludit is installed.
function alreadyInstalled() {
return file_exists(PATH_DATABASES.'site.php');
}
// Check the system, permissions, php version, modules, etc.
// Returns an array with the problems otherwise empty array.
function checkSystem()
{
$stdOut = array();
$dirpermissions = 0755;
$phpModules = array();
$stdOut = array();
$dirpermissions = 0755;
$phpModules = array();
if(function_exists('get_loaded_extensions'))
{
$phpModules = get_loaded_extensions();
}
if(function_exists('get_loaded_extensions')) {
$phpModules = get_loaded_extensions();
}
if(!version_compare(phpversion(), '5.3', '>='))
{
$errorText = 'Current PHP version '.phpversion().', you need > 5.3. (ERR_202)';
error_log($errorText, 0);
array_push($stdOut, $errorText);
if(!version_compare(phpversion(), '5.3', '>='))
{
$errorText = 'Current PHP version '.phpversion().', you need > 5.3. (ERR_202)';
error_log($errorText, 0);
array_push($stdOut, $errorText);
return $stdOut;
}
return $stdOut;
}
if(!file_exists(PATH_ROOT.'.htaccess'))
{
$errorText = 'Missing file, upload the file .htaccess (ERR_201)';
error_log($errorText, 0);
array_push($stdOut, $errorText);
}
if(!file_exists(PATH_ROOT.'.htaccess'))
{
$errorText = 'Missing file, upload the file .htaccess (ERR_201)';
error_log($errorText, 0);
array_push($stdOut, $errorText);
}
if(!in_array('dom', $phpModules))
{
$errorText = 'PHP module DOM does not exist. (ERR_203)';
error_log($errorText, 0);
array_push($stdOut, $errorText);
}
if(!in_array('dom', $phpModules))
{
$errorText = 'PHP module DOM is not installed. (ERR_203)';
error_log($errorText, 0);
array_push($stdOut, $errorText);
}
if(!in_array('json', $phpModules))
{
$errorText = 'PHP module JSON does not exist. (ERR_204)';
error_log($errorText, 0);
array_push($stdOut, $errorText);
}
if(!in_array('json', $phpModules))
{
$errorText = 'PHP module JSON is not installed. (ERR_204)';
error_log($errorText, 0);
array_push($stdOut, $errorText);
}
if(!is_writable(PATH_CONTENT))
{
$errorText = 'Writing test failure, check directory content permissions. (ERR_205)';
error_log($errorText, 0);
array_push($stdOut, $errorText);
}
if(!is_writable(PATH_CONTENT))
{
$errorText = 'Writing test failure, check directory content permissions. (ERR_205)';
error_log($errorText, 0);
array_push($stdOut, $errorText);
}
return $stdOut;
return $stdOut;
}
function install($adminPassword, $email)
{
$stdOut = array();
global $Language;
// ============================================================================
// Create directories
// ============================================================================
$stdOut = array();
// 7=read,write,execute | 5=read,execute
$dirpermissions = 0755;
$firstPostSlug = 'first-post';
$currentDate = Date::current(DB_DATE_FORMAT);
if(!mkdir(PATH_POSTS.$firstPostSlug, $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_POSTS.$firstPostSlug;
error_log($errorText, 0);
}
// ============================================================================
// Create directories
// ============================================================================
if(!mkdir(PATH_PAGES.'error', $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_PAGES.'error';
error_log($errorText, 0);
}
// 7=read,write,execute | 5=read,execute
$dirpermissions = 0755;
$firstPostSlug = 'first-post';
if(!mkdir(PATH_PLUGINS_DATABASES, $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES;
error_log($errorText, 0);
}
if(!mkdir(PATH_POSTS.$firstPostSlug, $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_POSTS.$firstPostSlug;
error_log($errorText, 0);
}
if(!mkdir(PATH_UPLOADS, $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_UPLOADS;
error_log($errorText, 0);
}
if(!mkdir(PATH_PAGES.'error', $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_PAGES.'error';
error_log($errorText, 0);
}
// ============================================================================
// Create files
// ============================================================================
if(!mkdir(PATH_PLUGINS_DATABASES.'pages', $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'pages';
error_log($errorText, 0);
}
$dataHead = "<?php defined('BLUDIT') or die('Bludit CMS.'); ?>".PHP_EOL;
if(!mkdir(PATH_PLUGINS_DATABASES.'simplemde', $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'simplemde';
error_log($errorText, 0);
}
// File pages.php
$data = array(
'error'=>array(
'description'=>'Error page',
'username'=>'admin',
'tags'=>'',
'status'=>'published',
'unixTimeCreated'=>1430686755,
'unixTimeModified'=>0,
'position'=>0
)
);
if(!mkdir(PATH_PLUGINS_DATABASES.'tags', $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'tags';
error_log($errorText, 0);
}
file_put_contents(PATH_DATABASES.'pages.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
if(!mkdir(PATH_UPLOADS, $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_UPLOADS;
error_log($errorText, 0);
}
// File posts.php
$data = array(
$firstPostSlug=>array(
'description'=>'Welcome to Bludit',
'username'=>'admin',
'status'=>'published',
'tags'=>'welcome, bludit, cms',
'allowComments'=>false,
'unixTimeCreated'=>1430875199,
'unixTimeModified'=>0
)
);
file_put_contents(PATH_DATABASES.'posts.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
// ============================================================================
// Create files
// ============================================================================
// File site.php
$data = array(
'title'=>'Bludit',
'slogan'=>'cms',
'description'=>'',
'footer'=>'Footer text - ©2015',
'language'=>'english',
'locale'=>'en_US',
'timezone'=>'UTC',
'theme'=>'pure',
'adminTheme'=>'default',
'homepage'=>'',
'postsperpage'=>'6',
'uriPost'=>'/post/',
'uriPage'=>'/',
'uriTag'=>'/tag/',
'advancedOptions'=>'false',
'url'=>'http://'.DOMAIN.HTML_PATH_ROOT
);
$dataHead = "<?php defined('BLUDIT') or die('Bludit CMS.'); ?>".PHP_EOL;
file_put_contents(PATH_DATABASES.'site.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
// File pages.php
$data = array(
'error'=>array(
'description'=>'Error page',
'username'=>'admin',
'tags'=>array(),
'status'=>'published',
'date'=>$currentDate,
'position'=>0
)
);
$salt = getRandomString();
$passwordHash = sha1($adminPassword.$salt);
$registered = time();
file_put_contents(PATH_DATABASES.'pages.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
// File users.php
$data = array(
'admin'=>array(
'firstName'=>'',
'lastName'=>'',
'twitter'=>'',
'role'=>'admin',
'password'=>$passwordHash,
'salt'=>$salt,
'email'=>$email,
'registered'=>$registered
)
);
// File posts.php
$data = array(
$firstPostSlug=>array(
'description'=>'Welcome to Bludit',
'username'=>'admin',
'status'=>'published',
'tags'=>array('bludit'=>'Bludit','cms'=>'CMS','flat-files'=>'Flat files'),
'allowComments'=>false,
'date'=>$currentDate
)
);
file_put_contents(PATH_DATABASES.'posts.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
file_put_contents(PATH_DATABASES.'users.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
// File site.php
$data = array(
'title'=>'Bludit',
'slogan'=>'cms',
'description'=>'',
'footer'=>Date::current('Y'),
'language'=>$Language->getCurrentLocale(),
'locale'=>$Language->getCurrentLocale(),
'timezone'=>'UTC',
'theme'=>'pure',
'adminTheme'=>'default',
'homepage'=>'',
'postsperpage'=>'6',
'uriPost'=>'/post/',
'uriPage'=>'/',
'uriTag'=>'/tag/',
'url'=>'http://'.DOMAIN.HTML_PATH_ROOT,
'cliMode'=>true
);
// File index.txt for error page
$data = 'Title: Error
Content: The page has not been found.';
file_put_contents(PATH_DATABASES.'site.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
file_put_contents(PATH_PAGES.'error'.DS.'index.txt', $data, LOCK_EX);
$salt = getRandomString();
$passwordHash = sha1($adminPassword.$salt);
// File index.txt for welcome post
$data = 'title: First post
// File users.php
$data = array(
'admin'=>array(
'firstName'=>'',
'lastName'=>'',
'twitter'=>'',
'role'=>'admin',
'password'=>$passwordHash,
'salt'=>$salt,
'email'=>$email,
'registered'=>$currentDate
)
);
file_put_contents(PATH_DATABASES.'users.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
// File security.php
$data = array(
'minutesBlocked'=>5,
'numberFailuresAllowed'=>10,
'blackList'=>array()
);
file_put_contents(PATH_DATABASES.'security.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
// File tags.php
file_put_contents(
PATH_DATABASES.'tags.php',
$dataHead.json_encode(
array(
'postsIndex'=>array(
'bludit'=>array('name'=>'Bludit', 'posts'=>array('first-post')),
'cms'=>array('name'=>'CMS', 'posts'=>array('first-post')),
'flat-files'=>array('name'=>'Flat files', 'posts'=>array('first-post'))
),
'pagesIndex'=>array()
),
JSON_PRETTY_PRINT),
LOCK_EX
);
// PLUGINS
// File plugins/pages/db.php
file_put_contents(
PATH_PLUGINS_DATABASES.'pages'.DS.'db.php',
$dataHead.json_encode(
array(
'position'=>0,
'homeLink'=>true,
'label'=>$Language->get('Pages')
),
JSON_PRETTY_PRINT),
LOCK_EX
);
// File plugins/simplemde/db.php
file_put_contents(
PATH_PLUGINS_DATABASES.'simplemde'.DS.'db.php',
$dataHead.json_encode(
array(
'position'=>0,
'tabSize'=>4,
'toolbar'=>'&quot;bold&quot;, &quot;italic&quot;, &quot;heading&quot;, &quot;|&quot;, &quot;quote&quot;, &quot;unordered-list&quot;, &quot;|&quot;, &quot;link&quot;, &quot;image&quot;, &quot;code&quot;, &quot;horizontal-rule&quot;, &quot;|&quot;, &quot;preview&quot;, &quot;side-by-side&quot;, &quot;fullscreen&quot;, &quot;guide&quot;'
),
JSON_PRETTY_PRINT),
LOCK_EX
);
// File plugins/tags/db.php
file_put_contents(
PATH_PLUGINS_DATABASES.'tags'.DS.'db.php',
$dataHead.json_encode(
array(
'position'=>0,
'label'=>$Language->get('Tags')
),
JSON_PRETTY_PRINT),
LOCK_EX
);
// File index.txt for error page
$data = 'Title: '.$Language->get('Error').'
Content: '.$Language->get('The page has not been found');
file_put_contents(PATH_PAGES.'error'.DS.'index.txt', $data, LOCK_EX);
// File index.txt for welcome post
$data = 'Title: '.$Language->get('First post').'
Content:
Congratulations, you have installed **Bludit** successfully!
---
## '.$Language->get('Congratulations you have successfully installed your Bludit').'
What\'s next:
---
- Administrate your Bludit from the [admin area](./admin/)
- Follow Bludit on [Twitter](https://twitter.com/bludit) / [Facebook](https://www.facebook.com/pages/Bludit/239255789455913) / [Google+](https://plus.google.com/+Bluditcms)
- Visit the [forum](http://forum.bludit.com) for support
- Read the [documentation](http://docs.bludit.com) for more information
- Share with your friend :D';
### '.$Language->get('Whats next').'
- '.$Language->get('Manage your Bludit from the admin panel').'
- '.$Language->get('Follow Bludit on').' [Twitter](https://twitter.com/bludit) / [Facebook](https://www.facebook.com/pages/Bludit/239255789455913) / [Google+](https://plus.google.com/+Bluditcms)
- '.$Language->get('Visit the support forum').'
- '.$Language->get('Read the documentation for more information').'
- '.$Language->get('Share with your friends and enjoy');
file_put_contents(PATH_POSTS.$firstPostSlug.DS.'index.txt', $data, LOCK_EX);
file_put_contents(PATH_POSTS.$firstPostSlug.DS.'index.txt', $data, LOCK_EX);
return true;
return true;
}
function checkPOST($args)
{
global $Language;
// Check empty password
if(empty($args['password']))
{
return '<div>'.$Language->g('The password field is empty').'</div>';
}
// Check invalid email
if( !Valid::email($args['email']) && ($args['noCheckEmail']=='0') )
{
return '<div>'.$Language->g('Your email address is invalid').'</div><div id="jscompleteEmail">'.$Language->g('Proceed anyway').'</div>';
}
// Sanitize email
$email = sanitize::email($args['email']);
// Install Bludit
install($args['password'], $email, $args['language']);
return true;
}
// ============================================================================
// MAIN
// ============================================================================
if( alreadyInstalled() )
{
exit('Bludit already installed');
$error = '';
if( alreadyInstalled() ) {
exit('Bludit already installed');
}
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
if(install($_POST['password'],$_POST['email']))
{
if(!headers_sent())
{
header("Location:".HTML_PATH_ROOT, TRUE, 302);
exit;
}
$error = checkPOST($_POST);
exit('<meta http-equiv="refresh" content="0; url="'.HTML_PATH_ROOT.'" />');
}
if($error===true)
{
if(!headers_sent())
{
header("Location:".HTML_PATH_ROOT, TRUE, 302);
exit;
}
exit('<meta http-equiv="refresh" content="0; url="'.HTML_PATH_ROOT.'">');
}
}
?>
@ -256,73 +435,124 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
<!doctype html>
<html lang="en">
<head>
<base href="admin/themes/default/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="admin/themes/default/">
<meta charset="<?php echo CHARSET ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bludit Installer</title>
<title><?php echo $Language->get('Bludit Installer') ?></title>
<link rel="stylesheet" href="./css/kube.min.css">
<link rel="stylesheet" href="./css/installer.css">
<link rel="stylesheet" href="./css/kube.min.css">
<link rel="stylesheet" href="./css/installer.css">
<script src="./js/jquery.min.js"></script>
<script src="./js/kube.min.js"></script>
<script src="./js/jquery.min.js"></script>
<script src="./js/kube.min.js"></script>
</head>
<body>
<div class="units-row">
<div class="unit-centered unit-60">
<div class="main">
<h1 class="title">Bludit Installer</h1>
<p>Welcome to the Bludit installer</p>
<div class="unit-centered unit-60">
<div class="main">
<?php
$system = checkSystem();
<h1 class="title"><?php echo $Language->get('Bludit Installer') ?></h1>
<p><?php echo $Language->get('Welcome to the Bludit installer') ?></p>
if(empty($system))
{
?>
<?php
<p>Complete the form, choose a password for the username <strong>admin</strong></p>
<div class="unit-centered unit-40">
<form method="post" action="" class="forms" autocomplete="off">
$system = checkSystem();
<label>
<input type="text" value="admin" disabled="disabled" class="width-100">
</label>
// Missing requirements
if(!empty($system))
{
echo '<div class="boxInstallerForm unit-centered unit-50">';
echo '<table class="table-stripped">';
<label>
<input type="password" name="password" placeholder="Password" class="width-100" autocomplete="off">
</label>
foreach($system as $value) {
echo '<tr><td>'.$value.'</td></tr>';
}
<label>
<input type="text" name="email" placeholder="Email" class="width-100" autocomplete="off">
</label>
echo '</table>';
echo '</div>';
}
// Second step
elseif(isset($_GET['language']))
{
<p>
<button class="btn btn-blue width-100">Install</button>
</p>
</form>
</div>
?>
<p><?php echo $Language->get('Complete the form choose a password for the username admin') ?></p>
<?php
}
else
{
echo '<div class="unit-centered unit-40">';
echo '<table class="table-stripped">';
<div class="boxInstallerForm unit-centered unit-40">
foreach ($system as $value)
{
echo '<tr><td>'.$value.'</td></tr>';
}
<?php
if(!empty($error)) {
echo '<div class="tools-message tools-message-red">'.$error.'</div>';
}
?>
echo '</table>';
echo '</div';
}
?>
<form id="jsformInstaller" method="post" action="" class="forms" autocomplete="off">
<input type="hidden" name="noCheckEmail" id="jsnoCheckEmail" value="0">
<input type="hidden" name="language" id="jslanguage" value="<?php echo $localeFromHTTP ?>">
<label>
<input type="text" value="admin" disabled="disabled" class="width-100">
</label>
<label>
<input type="text" name="password" id="jspassword" placeholder="<?php echo $Language->get('Password visible field') ?>" class="width-100" autocomplete="off" maxlength="100" value="<?php echo isset($_POST['password'])?$_POST['password']:'' ?>">
</label>
<label>
<input type="text" name="email" id="jsemail" placeholder="<?php echo $Language->get('Email') ?>" class="width-100" autocomplete="off" maxlength="100">
</label>
<p><button class="btn btn-blue width-100"><?php echo $Language->get('Install') ?></button>
</p>
</form>
</div>
<?php
} // END elseif(isset($_GET['language']))
else
{
?>
<p><?php echo $Language->get('Choose your language') ?></p>
<div class="boxInstallerForm unit-centered unit-40">
<form id="jsformLanguage" method="get" action="" class="forms" autocomplete="off">
<label for="jslanguage">
<select id="jslanguage" name="language" class="width-100">
<?php
$htmlOptions = getLanguageList();
foreach($htmlOptions as $locale=>$nativeName) {
echo '<option value="'.$locale.'"'.( ($localeFromHTTP===$locale)?' selected="selected"':'').'>'.$nativeName.'</option>';
}
?>
</select>
</label>
<p><button class="btn btn-blue width-100"><?php echo $Language->get('Next') ?></button>
</p>
</form>
</div>
<?php
} // END else
?>
</div>
</div>
<script>
$(document).ready(function()
{
$("#jscompleteEmail").on("click", function() {
$("#jsnoCheckEmail").val("1");
if(!$("jspassword").val()) {
$("#jsformInstaller").submit();
}
});
});
</script>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,105 +0,0 @@
<?php
class Content
{
public $vars;
public $path;
function __construct($slug)
{
if($this->build($slug)===false)
$this->vars = false;
}
// Return true if valid post
public function valid()
{
return($this->vars!==false);
}
public function get_field($field)
{
if(isset($this->vars[$field]))
return $this->vars[$field];
return false;
}
// $notoverwrite true if you don't want to replace the value if are set previusly
public function setField($field, $value, $overwrite=true)
{
if($overwrite || empty($this->vars[$field]))
{
$this->vars[$field] = $value;
return true;
}
return true;
}
// DEBUG, se puede borrar
public function show()
{
print_r($this->vars);
}
private function build($slug)
{
// Check if directory exists for the slug
/*$path = glob($this->path.$slug, GLOB_ONLYDIR);
if(empty($path))
return false;
// Get the first element from the directories array
//$path = $path[0];
*/
$path = $this->path.$slug;
if(!is_dir($path))
return false;
// Path
$this->setField('path', $path);
// Slug
$this->setField('slug', $slug);
// Check if file exists
$file = $path.'/index.txt';
if(!file_exists($file))
return false;
$tmp = 0;
$lines = file($file);
foreach($lines as $lineNumber=>$line)
{
$parts = array_map('trim', explode(':', $line, 2));
// Lowercase variable
$parts[0] = Text::lowercase($parts[0]);
if($parts[0]==='content')
{
$tmp = $lineNumber;
break;
}
if( !empty($parts[0]) && !empty($parts[1]) )
$this->vars[$parts[0]] = $parts[1];
}
// Content
if($tmp!=0)
{
$tmp++; // Next line after Content:
$output = array_slice($lines, $tmp); // Lines after Content
$this->vars['content'] = implode($output);
}
//
}
}
?>

View File

@ -1,78 +0,0 @@
<?php
// Database serialize
class DB_SERIALIZE
{
public $vars;
public $file;
public $firstLine;
function __construct($file, $firstLine=true)
{
$this->file = $file;
$lines = file($file);
$this->firstLine = $firstLine;
if($firstLine)
{
// Remove the first line.
unset($lines[0]);
}
$implode = implode($lines);
$this->vars = $this->unserialize($implode);
}
public function save()
{
if($this->firstLine)
$data = "<?php defined('BLUDIT') or die('Bludit CMS.'); ?>".PHP_EOL;
else
$data = '';
$data .= $this->serialize($this->vars);
// LOCK_EX flag to prevent anyone else writing to the file at the same time.
return file_put_contents($this->file, $data, LOCK_EX);
}
// DEBUG, ver si sirve para la instalacion, sino borrar
public function setDb($db)
{
$this->vars = $db;
return $this->save();
}
private function serialize($data)
{
// DEBUG: La idea es siempre serializar en json, habria que ver si siempre esta cargado json_enconde y decode
if(JSON)
return json_encode($data, JSON_PRETTY_PRINT);
return serialize($data);
}
private function unserialize($data)
{
// DEBUG: La idea es siempre serializar en json, habria que ver si siempre esta cargado json_enconde y decode
if(JSON)
return json_decode($data, true);
return unserialize($data);
}
// DEBUG, se puede borrar
function show()
{
var_dump($this->vars);
}
}
?>

View File

@ -3,6 +3,7 @@
class dbJSON
{
public $db;
public $dbBackup;
public $file;
public $firstLine;
@ -12,6 +13,7 @@ class dbJSON
{
$this->file = $file;
$this->db = array();
$this->dbBackup = array();
$this->firstLine = $firstLine;
if(file_exists($file))
@ -28,7 +30,15 @@ class dbJSON
$implode = implode($lines);
// Unserialize, JSON to Array.
$this->db = $this->unserialize($implode);
$array = $this->unserialize($implode);
if(empty($array)) {
Log::set(__METHOD__.LOG_SEP.'Invalid JSON file: '.$file.', cannot be decoded. Check the file content.');
}
else {
$this->db = $array;
$this->dbBackup = $array;
}
}
else
{
@ -36,18 +46,10 @@ class dbJSON
}
}
// Get database.
public function get()
public function restoreDb()
{
return $this->db;
}
// Set and save database.
public function set($db)
{
$this->db = $db;
return $this->save();
$this->db = $this->dbBackup;
return true;
}
// Returns the amount of database items.
@ -59,17 +61,20 @@ class dbJSON
// Save the JSON file.
public function save()
{
$data = '';
if($this->firstLine) {
$data = "<?php defined('BLUDIT') or die('Bludit CMS.'); ?>".PHP_EOL;
}
else {
$data = '';
}
// Serialize database
$data .= $this->serialize($this->db);
// Backup the new database.
$this->dbBackup = $this->db;
// LOCK_EX flag to prevent anyone else writing to the file at the same time.
file_put_contents($this->file, $data, LOCK_EX);
return file_put_contents($this->file, $data, LOCK_EX);
}
private function serialize($data)

View File

@ -2,7 +2,7 @@
class Plugin {
// (string) Plugin's directory
// (string) Plugin's directory name
public $directoryName;
// (string) Database path and filename
@ -27,7 +27,9 @@ class Plugin {
'description'=>'',
'author'=>'',
'email'=>'',
'website'=>''
'website'=>'',
'version'=>'',
'releaseDate'=>''
);
$this->dbFields = array();
@ -35,7 +37,7 @@ class Plugin {
$reflector = new ReflectionClass(get_class($this));
// Directory name
$this->directoryName = basename(dirname($reflector->getFileName())).DS;
$this->directoryName = basename(dirname($reflector->getFileName()));
// Class Name
$this->className = $reflector->getName();
@ -46,7 +48,7 @@ class Plugin {
// Init empty database
$this->db = $this->dbFields;
$this->filenameDb = PATH_PLUGINS_DATABASES.$this->directoryName.'db.php';
$this->filenameDb = PATH_PLUGINS_DATABASES.$this->directoryName.DS.'db.php';
// If the plugin installed then get the database.
if($this->installed())
@ -56,6 +58,11 @@ class Plugin {
}
}
public function htmlPath()
{
return HTML_PATH_PLUGINS.$this->directoryName.'/';
}
// Returns the item from plugin-data.
public function getData($key)
{
@ -71,10 +78,18 @@ class Plugin {
$this->data = $array;
}
public function getDbField($key)
public function getDbField($key, $html=true)
{
if(isset($this->db[$key])) {
return $this->db[$key];
if($html) {
// All fields from DBField are sanitized.
return $this->db[$key];
}
else {
// Decode HTML tags, this action unsanitized the variable.
return Sanitize::htmlDecode($this->db[$key]);
}
}
return '';
@ -122,6 +137,16 @@ class Plugin {
return $this->getData('website');
}
public function version()
{
return $this->getData('version');
}
public function releaseDate()
{
return $this->getData('releaseDate');
}
public function className()
{
return $this->className;
@ -133,7 +158,7 @@ class Plugin {
}
// Return TRUE if the installation success, otherwise FALSE.
public function install()
public function install($position=0)
{
if($this->installed()) {
return false;
@ -143,8 +168,8 @@ class Plugin {
mkdir(PATH_PLUGINS_DATABASES.$this->directoryName, 0755, true);
// Create database
$Tmp = new dbJSON($this->filenameDb);
$Tmp->set($this->dbFields);
$this->dbFields['position'] = $position;
$this->setDb($this->dbFields);
return true;
}
@ -166,65 +191,4 @@ class Plugin {
// The user can define your own dbFields.
}
// EVENTS
public function form()
{
return false;
}
// Before the posts load.
public function beforePostsLoad()
{
return false;
}
// After the posts load.
public function afterPostsLoad()
{
return false;
}
// Before the pages load.
public function beforePagesLoad()
{
return false;
}
// After the pages load.
public function afterPagesLoad()
{
return false;
}
public function onSiteHead()
{
return false;
}
public function onSiteBody()
{
return false;
}
public function onAdminHead()
{
return false;
}
public function onAdminBody()
{
return false;
}
public function onSiteSidebar()
{
return false;
}
public function onAdminSidebar()
{
return false;
}
}

View File

@ -19,46 +19,62 @@ $layout['parameters'] = implode('/', $explodeSlug);
// Thanks, http://stackoverflow.com/questions/517008/how-to-turn-off-magic-quotes-on-shared-hosting
if ( in_array( strtolower( ini_get( 'magic_quotes_gpc' ) ), array( '1', 'on' ) ) )
{
$_POST = array_map('stripslashes', $_POST);
$_GET = array_map('stripslashes', $_GET);
$_POST = array_map('stripslashes', $_POST);
$_GET = array_map('stripslashes', $_GET);
$_COOKIE = array_map('stripslashes', $_COOKIE);
}
// AJAX
if( $Login->isLogged() && ($layout['slug']==='ajax') )
if( $layout['slug']==='ajax' )
{
// Boot rules
// Ajax doesn't needs load rules
// Load AJAX file
if( Sanitize::pathFile(PATH_AJAX, $layout['parameters'].'.php') )
include(PATH_AJAX.$layout['parameters'].'.php');
if($Login->isLogged())
{
// Load AJAX file
if( Sanitize::pathFile(PATH_AJAX, $layout['parameters'].'.php') ) {
include(PATH_AJAX.$layout['parameters'].'.php');
}
}
}
// ADMIN AREA
else
{
// Boot rules
include(PATH_RULES.'70.build_posts.php');
include(PATH_RULES.'70.build_pages.php');
include(PATH_RULES.'70.posts.php');
include(PATH_RULES.'70.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');
include(PATH_RULES.'99.security.php');
if($Url->notFound() || !$Login->isLogged() || ($Url->slug()==='login') )
{
$layout['controller'] = 'login';
$layout['view'] = 'login';
$layout['template'] = 'login.php';
$layout['view'] = 'login';
$layout['template'] = 'login.php';
// Generate the token for the user not logged, when the user is loggued the token will be change.
$Security->generateToken();
}
// Plugins before admin area loaded
Theme::plugins('beforeAdminLoad');
// Admin theme init.php
if( Sanitize::pathFile(PATH_ADMIN_THEMES, $Site->adminTheme().DS.'init.php') )
if( Sanitize::pathFile(PATH_ADMIN_THEMES, $Site->adminTheme().DS.'init.php') ) {
include(PATH_ADMIN_THEMES.$Site->adminTheme().DS.'init.php');
}
// Load controller
if( Sanitize::pathFile(PATH_ADMIN_CONTROLLERS, $layout['controller'].'.php') )
if( Sanitize::pathFile(PATH_ADMIN_CONTROLLERS, $layout['controller'].'.php') ) {
include(PATH_ADMIN_CONTROLLERS.$layout['controller'].'.php');
}
// Load view and theme
if( Sanitize::pathFile(PATH_ADMIN_THEMES, $Site->adminTheme().DS.$layout['template']) )
if( Sanitize::pathFile(PATH_ADMIN_THEMES, $Site->adminTheme().DS.$layout['template']) ) {
include(PATH_ADMIN_THEMES.$Site->adminTheme().DS.$layout['template']);
}
// Plugins after admin area loaded
Theme::plugins('afterAdminLoad');
}

View File

@ -1,34 +1,48 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// Bludit version
define('BLUDIT_VERSION', 'githubVersion');
define('BLUDIT_CODENAME', '');
define('BLUDIT_RELEASE_DATE', '');
// Debug mode
define('DEBUG_MODE', TRUE);
error_reporting(0); // Turn off all error reporting
if(DEBUG_MODE)
{
// Turn on all error reporting
ini_set("display_errors", 1);
ini_set('display_startup_errors',1);
ini_set("track_errors", 1);
ini_set("html_errors", 1);
error_reporting(E_ALL | E_STRICT | E_NOTICE);
}
// PHP paths
// PATH_ROOT and PATH_BOOT are defined in index.php
define('PATH_LANGUAGES', PATH_ROOT.'languages'.DS);
define('PATH_THEMES', PATH_ROOT.'themes'.DS);
define('PATH_PLUGINS', PATH_ROOT.'plugins'.DS);
define('PATH_KERNEL', PATH_ROOT.'kernel'.DS);
define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS);
define('PATH_RULES', PATH_KERNEL.'boot'.DS.'rules'.DS);
define('PATH_HELPERS', PATH_KERNEL.'helpers'.DS);
define('PATH_AJAX', PATH_KERNEL.'ajax'.DS);
define('PATH_JS', PATH_KERNEL.'js'.DS);
define('PATH_CONTENT', PATH_ROOT.'content'.DS);
define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
define('PATH_PLUGINS_DATABASES', PATH_CONTENT.'databases'.DS.'plugins'.DS);
define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS);
define('PATH_ADMIN', PATH_ROOT.'admin'.DS);
define('PATH_ADMIN_THEMES', PATH_ADMIN.'themes'.DS);
define('PATH_ADMIN_CONTROLLERS', PATH_ADMIN.'controllers'.DS);
define('PATH_ADMIN_VIEWS', PATH_ADMIN.'views'.DS);
// Log separator
define('LOG_SEP', ' | ');
// PHP PATHS
// PATH_ROOT and PATH_BOOT are defined in index.php
define('PATH_LANGUAGES', PATH_ROOT.'languages'.DS);
define('PATH_THEMES', PATH_ROOT.'themes'.DS);
define('PATH_PLUGINS', PATH_ROOT.'plugins'.DS);
define('PATH_KERNEL', PATH_ROOT.'kernel'.DS);
define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS);
define('PATH_RULES', PATH_KERNEL.'boot'.DS.'rules'.DS);
define('PATH_HELPERS', PATH_KERNEL.'helpers'.DS);
define('PATH_AJAX', PATH_KERNEL.'ajax'.DS);
define('PATH_JS', PATH_KERNEL.'js'.DS);
define('PATH_CONTENT', PATH_ROOT.'content'.DS);
define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
define('PATH_PLUGINS_DATABASES', PATH_CONTENT.'databases'.DS.'plugins'.DS);
define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS);
define('PATH_ADMIN', PATH_ROOT.'admin'.DS);
define('PATH_ADMIN_THEMES', PATH_ADMIN.'themes'.DS);
define('PATH_ADMIN_CONTROLLERS', PATH_ADMIN.'controllers'.DS);
define('PATH_ADMIN_VIEWS', PATH_ADMIN.'views'.DS);
// JSON pretty print
if(!defined('JSON_PRETTY_PRINT')) {
define('JSON_PRETTY_PRINT', 128);
@ -38,55 +52,58 @@ if(!defined('JSON_PRETTY_PRINT')) {
define('SALT_LENGTH', 8);
// Page brake string
define('PAGE_BRAKE', '<!-- pagebreak -->');
define('PAGE_BREAK', '<!-- pagebreak -->');
// Bludit version
define('BLUDIT_VERSION', 'githubVersion');
define('BLUDIT_CODENAME', '');
define('BLUDIT_RELEASE_DATE', '');
//
// No parent character
define('NO_PARENT_CHAR', '—');
// Multibyte string / UTF-8
define('MB_STRING', extension_loaded('mbstring'));
// Post per page on Manage->Posts
define('POSTS_PER_PAGE_ADMIN', 10);
// Check if JSON encode and decode are enabled.
define('JSON', function_exists('json_encode'));
// TRUE if new posts hand-made set published, or FALSE for draft.
define('HANDMADE_PUBLISHED', true);
define('CLI_STATUS', 'published');
// Database format date
define('DB_DATE_FORMAT', 'Y-m-d H:i');
// Charset, default UTF-8.
define('CHARSET', 'UTF-8');
// Multibyte string extension loaded.
define('MB_STRING', extension_loaded('mbstring'));
if(MB_STRING)
{
// Tell PHP that we're using UTF-8 strings until the end of the script.
// Set internal character encoding.
mb_internal_encoding(CHARSET);
// Tell PHP that we'll be outputting UTF-8 to the browser.
// Set HTTP output character encoding.
mb_http_output(CHARSET);
}
// Abstract Classes
// Inclde Abstract Classes
include(PATH_ABSTRACT.'dbjson.class.php');
include(PATH_ABSTRACT.'filecontent.class.php');
include(PATH_ABSTRACT.'plugin.class.php');
// Inclde Classes
include(PATH_KERNEL.'dbposts.class.php');
include(PATH_KERNEL.'dbpages.class.php');
include(PATH_KERNEL.'dbusers.class.php');
include(PATH_KERNEL.'dbtags.class.php');
include(PATH_KERNEL.'dblanguage.class.php');
include(PATH_KERNEL.'dbsite.class.php');
include(PATH_KERNEL.'post.class.php');
include(PATH_KERNEL.'page.class.php');
include(PATH_KERNEL.'url.class.php');
include(PATH_KERNEL.'login.class.php');
include(PATH_KERNEL.'parsedown.class.php');
include(PATH_KERNEL.'security.class.php');
// Helpers Classes
// Include Helpers Classes
include(PATH_HELPERS.'text.class.php');
include(PATH_HELPERS.'log.class.php');
include(PATH_HELPERS.'date.class.php');
@ -94,8 +111,10 @@ include(PATH_HELPERS.'theme.class.php');
include(PATH_HELPERS.'session.class.php');
include(PATH_HELPERS.'redirect.class.php');
include(PATH_HELPERS.'sanitize.class.php');
include(PATH_HELPERS.'valid.class.php');
include(PATH_HELPERS.'filesystem.class.php');
include(PATH_HELPERS.'alert.class.php');
include(PATH_HELPERS.'paginator.class.php');
// Session
Session::start();
@ -108,20 +127,45 @@ if(Session::started()===false) {
$dbPosts = new dbPosts();
$dbPages = new dbPages();
$dbUsers = new dbUsers();
$dbTags = new dbTags();
$Site = new dbSite();
$Url = new Url();
$Parsedown = new Parsedown();
$Security = new Security();
// HTML PATHs
$base = (dirname(getenv('SCRIPT_NAME'))==DS)?'/':dirname(getenv('SCRIPT_NAME')).'/';
//$base = (dirname(getenv('SCRIPT_NAME'))==DS)?'/':dirname(getenv('SCRIPT_NAME')).'/';
$base = empty( $_SERVER['SCRIPT_NAME'] ) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
$base = dirname($base);
if($base!=DS) {
$base = $base.'/';
}
define('HTML_PATH_ROOT', $base);
// Paths for themes
define('HTML_PATH_THEMES', HTML_PATH_ROOT.'themes/');
define('HTML_PATH_THEME', HTML_PATH_ROOT.'themes/'.$Site->theme().'/');
define('HTML_PATH_THEME_CSS', HTML_PATH_THEME.'css/');
define('HTML_PATH_THEME_JS', HTML_PATH_THEME.'js/');
define('HTML_PATH_ADMIN_THEME', HTML_PATH_ROOT.'admin/themes/'.$Site->adminTheme().'/');
define('HTML_PATH_ADMIN_ROOT', HTML_PATH_ROOT.'admin/');
define('HTML_PATH_THEME_CSS', HTML_PATH_THEME.'css/');
define('HTML_PATH_THEME_JS', HTML_PATH_THEME.'js/');
define('HTML_PATH_THEME_IMG', HTML_PATH_THEME.'img/');
define('HTML_PATH_ADMIN_THEME', HTML_PATH_ROOT.'admin/themes/'.$Site->adminTheme().'/');
define('HTML_PATH_ADMIN_THEME_JS', HTML_PATH_ADMIN_THEME.'js/');
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/');
define('JQUERY', HTML_PATH_ADMIN_THEME_JS.'jquery.min.js');
// PHP paths with dependency
define('PATH_THEME', PATH_ROOT.'themes/'.$Site->theme().'/');
define('PATH_THEME_PHP', PATH_THEME.'php'.DS);
define('PATH_THEME_CSS', PATH_THEME.'css'.DS);
define('PATH_THEME_JS', PATH_THEME.'js'.DS);
define('PATH_THEME_IMG', PATH_THEME.'img'.DS);
define('PATH_THEME_LANG', PATH_THEME.'languages'.DS);
// Objects with dependency
$Language = new dbLanguage( $Site->locale() );

View File

@ -1,130 +0,0 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Variables
// ============================================================================
$posts = array();
// ============================================================================
// Functions
// ============================================================================
function buildPost($key)
{
global $dbPosts;
global $dbUsers;
global $Parsedown;
// Post object.
$Post = new Post($key);
if( !$Post->isValid() ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying build the post from file with key: '.$key);
return false;
}
// Page database.
$db = $dbPosts->getDb($key);
if( !$db ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying build the post from database with key: '.$key);
return false;
}
// Foreach field from database.
foreach($db as $field=>$value)
{
if($field=='unixTimeCreated')
{
// Format dates, not overwrite from file fields.
$Post->setField('unixTimeCreated', $value, false);
$Post->setField('date', Date::format($value, '%d %B'), false);
$Post->setField('timeago', Date::timeago($value), false);
}
else
{
// Other fields, not overwrite from file fields.
$Post->setField($field, $value, false);
}
}
// Content in raw format
$Post->setField('contentRaw', $Post->content(), true);
// Parse the content
$content = $Parsedown->text( $Post->content() );
$Post->setField('content', $content, true);
// Parse username for the post.
if( $dbUsers->userExists( $Post->username() ) )
{
$user = $dbUsers->get( $Post->username() );
$Post->setField('authorFirstName', $user['firstName'], false);
$Post->setField('authorLastName', $user['lastName'], false);
}
return $Post;
}
function build_posts_per_page($pageNumber=0, $amount=5, $draftPosts=false)
{
global $dbPosts;
global $posts;
global $Url;
$list = $dbPosts->getPage($pageNumber, $amount, $draftPosts);
// There are not post for the pageNumber then NotFound page
if(empty($list) && $pageNumber>0) {
$Url->setNotFound(true);
}
foreach($list as $slug=>$db)
{
$Post = buildPost($slug);
if($Post!==false) {
array_push($posts, $Post);
}
}
}
// ============================================================================
// Main
// ============================================================================
// Filter by post, then build it
if( ($Url->whereAmI()==='post') && ($Url->notFound()===false) )
{
$Post = buildPost( $Url->slug() );
if($Post===false)
{
$Url->setNotFound(true);
unset($Post);
}
elseif( !$Post->published() )
{
$Url->setNotFound(true);
unset($Post);
}
else
{
$posts[0] = $Post;
}
}
// Build post per page
else
{
if($Url->whereAmI()==='admin') {
// Build post for admin area with drafts
build_posts_per_page($Url->pageNumber(), $Site->postsPerPage(), true);
}
else
{
// Build post for the site, without the drafts posts
build_posts_per_page($Url->pageNumber(), $Site->postsPerPage(), false);
}
}

View File

@ -30,46 +30,37 @@ function build_page($key)
global $dbUsers;
global $Parsedown;
// Page object.
// Page object, content from FILE.
$Page = new Page($key);
if( !$Page->isValid() ) {
return false;
}
// Page database.
// Page database, content from DATABASE JSON.
$db = $dbPages->getDb($key);
if( !$db ) {
return false;
}
// Foreach field from database.
foreach($db as $field=>$value)
{
if($field=='unixTimeCreated')
{
// Format dates, not overwrite from file fields.
$Page->setField('unixTimeCreated', $value, false);
$Page->setField('date', Date::format($value, '%d %B'), false);
$Page->setField('timeago', Date::timeago($value), false);
}
else
{
// Other fields, not overwrite from file fields.
$Page->setField($field, $value, false);
}
// Foreach field from DATABASE.
foreach($db as $field=>$value) {
$Page->setField($field, $value);
}
// Content in raw format
$contentRaw = $Page->content();
$Page->setField('contentRaw', $Page->content(), true);
// Parse markdown content.
$content = $Parsedown->text( $Page->content() );
$content = Text::pre2htmlentities($contentRaw); // Parse pre code with htmlentities
$content = $Parsedown->text($content); // Parse Markdown.
$content = Text::imgRel2Abs($content, HTML_PATH_UPLOADS); // Parse img src relative to absolute.
$Page->setField('content', $content, true);
// Parse username for the page.
if( $dbUsers->userExists( $Page->username() ) )
{
$user = $dbUsers->get( $Page->username() );
$user = $dbUsers->getDb( $Page->username() );
$Page->setField('authorFirstName', $user['firstName'], false);
@ -145,6 +136,11 @@ function build_all_pages()
// Main
// ============================================================================
// Search for changes on pages by the user.
if( $Site->cliMode() ) {
$dbPages->regenerateCli();
}
// Filter by page, then build it
if( ($Url->whereAmI()==='page') && ($Url->notFound()===false) )
{
@ -165,14 +161,13 @@ if( ($Url->whereAmI()==='page') && ($Url->notFound()===false) )
// Default homepage
if($Url->notFound()===false)
{
if( ($Site->homepage()!=='home') && ($Url->whereAmI()==='home') )
if( Text::isNotEmpty($Site->homepage()) && ($Url->whereAmI()==='home') )
{
$Url->setWhereAmI('page');
$Page = build_page( $Site->homepage() );
if($Page===false)
{
if($Page===false) {
$Url->setWhereAmI('home');
}
}

View File

@ -0,0 +1,168 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Variables
// ============================================================================
$posts = array();
// ============================================================================
// Functions
// ============================================================================
function reIndexTagsPosts()
{
global $dbPosts;
global $dbTags;
// Remove unpublished.
$dbPosts->removeUnpublished();
// Regenerate the tags index for posts
$dbTags->reindexPosts( $dbPosts->db );
// Restore de db on dbPost
$dbPosts->restoreDb();
return true;
}
function buildPost($key)
{
global $dbPosts;
global $dbUsers;
global $Parsedown;
global $Site;
// Post object, content from FILE.
$Post = new Post($key);
if( !$Post->isValid() ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying build the post from file with key: '.$key);
return false;
}
// Post database, content from DATABASE JSON.
$db = $dbPosts->getDb($key);
if( !$db ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying build the post from database with key: '.$key);
return false;
}
// Foreach field from DATABASE.
foreach($db as $field=>$value) {
$Post->setField($field, $value);
}
// Content in raw format
$contentRaw = $Post->content();
$Post->setField('contentRaw', $contentRaw, true);
// Parse the content
$content = Text::pre2htmlentities($contentRaw); // Parse pre code with htmlentities
$content = $Parsedown->text($content); // Parse Markdown.
$content = Text::imgRel2Abs($content, HTML_PATH_UPLOADS); // Parse img src relative to absolute.
$Post->setField('content', $content, true);
// Pagebrake
$explode = explode(PAGE_BREAK, $content);
$Post->setField('breakContent', $explode[0], true);
$Post->setField('readMore', !empty($explode[1]), true);
// Parse username for the post.
if( $dbUsers->userExists( $Post->username() ) )
{
$user = $dbUsers->getDb( $Post->username() );
$Post->setField('authorFirstName', $user['firstName'], false);
$Post->setField('authorLastName', $user['lastName'], false);
}
return $Post;
}
function buildPostsForPage($pageNumber=0, $amount=POSTS_PER_PAGE_ADMIN, $removeUnpublished=true, $tagKey=false)
{
global $dbPosts;
global $dbTags;
global $posts;
global $Url;
if($tagKey) {
// Get the keys list from tags database, this database is optimized for this case.
$list = $dbTags->getList($pageNumber, $amount, $tagKey);
}
else {
// Get the keys list from posts database.
$list = $dbPosts->getList($pageNumber, $amount, $removeUnpublished);
}
// There are not posts for the page number then set the page notfound
if(empty($list) && $pageNumber>0) {
$Url->setNotFound(true);
}
// Foreach post key, build the post.
foreach($list as $postKey=>$values)
{
$Post = buildPost($postKey);
if($Post!==false) {
array_push($posts, $Post);
}
}
}
// ============================================================================
// Main
// ============================================================================
// Search for changes on posts by the user.
if( $Site->cliMode() ) {
if($dbPosts->regenerateCli()) {
reIndexTagsPosts();
}
}
// Execute the scheduler.
if( $dbPosts->scheduler() ) {
// Reindex dbTags.
reIndexTagsPosts();
}
// Build specific post.
if( ($Url->whereAmI()==='post') && ($Url->notFound()===false) )
{
$Post = buildPost( $Url->slug() );
if($Post===false)
{
$Url->setNotFound(true);
unset($Post);
}
elseif( !$Post->published() )
{
$Url->setNotFound(true);
unset($Post);
}
else
{
$posts[0] = $Post;
}
}
// Build posts by specific tag.
elseif( ($Url->whereAmI()==='tag') && ($Url->notFound()===false) )
{
buildPostsForPage($Url->pageNumber(), $Site->postsPerPage(), true, $Url->slug());
}
// Build posts for homepage or admin area.
else
{
// Posts for admin area.
if($Url->whereAmI()==='admin') {
buildPostsForPage($Url->pageNumber(), POSTS_PER_PAGE_ADMIN, false);
}
// Posts for homepage
else {
buildPostsForPage($Url->pageNumber(), $Site->postsPerPage(), true);
}
}

View File

@ -5,16 +5,29 @@
// ============================================================================
$plugins = array(
'onSiteHead'=>array(),
'onSiteBody'=>array(),
'onSiteSidebar'=>array(),
'onAdminHead'=>array(),
'onAdminBody'=>array(),
'onAdminSidebar'=>array(),
'beforePostsLoad'=>array(),
'afterPostsLoad'=>array(),
'beforePagesLoad'=>array(),
'afterPagesLoad'=>array(),
'siteHead'=>array(),
'siteBodyBegin'=>array(),
'siteBodyEnd'=>array(),
'siteSidebar'=>array(),
'beforeSiteLoad'=>array(),
'afterSiteLoad'=>array(),
'pageBegin'=>array(),
'pageEnd'=>array(),
'postBegin'=>array(),
'postEnd'=>array(),
'adminHead'=>array(),
'adminBodyBegin'=>array(),
'adminBodyEnd'=>array(),
'adminSidebar'=>array(),
'beforeAdminLoad'=>array(),
'afterAdminLoad'=>array(),
'loginHead'=>array(),
'loginBodyBegin'=>array(),
'loginBodyEnd'=>array(),
'all'=>array()
);
@ -51,18 +64,18 @@ function build_plugins()
$Plugin = new $pluginClass;
// Set Plugin data
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().'language'.DS.$Site->locale().'.json';
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.$Site->locale().'.json';
if( Sanitize::pathFile($languageFilename) )
{
$database = new dbJSON($languageFilename, false);
}
else
{
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().'language'.DS.'en_US.json';
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.'en_US.json';
$database = new dbJSON($languageFilename, false);
}
$databaseArray = $database->get();
$databaseArray = $database->db;
$Plugin->setData( $databaseArray['plugin-data'] );
// Add words to language dictionary.
@ -70,18 +83,14 @@ function build_plugins()
$Language->add($databaseArray);
// Push Plugin to array all plugins installed and not installed.
array_push($plugins['all'], $Plugin);
$plugins['all'][$pluginClass] = $Plugin;
// If the plugin installed
if($Plugin->installed())
{
foreach($pluginsEvents as $event=>$value)
{
/*
if($Plugin->onSiteHead()!==false)
array_push($plugins['onSiteHead'], $Plugin);
*/
if($Plugin->{$event}()!==false) {
if(method_exists($Plugin, $event)) {
array_push($plugins[$event], $Plugin);
}
}

View File

@ -5,5 +5,3 @@ if($Url->notFound())
{
header('HTTP/1.0 404 Not Found');
}
?>

View File

@ -0,0 +1,39 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// Current page number.
$currentPage = $Url->pageNumber();
Paginator::set('currentPage', $currentPage);
// Number of pages.
if($Url->whereAmI()=='admin') {
$postPerPage = POSTS_PER_PAGE_ADMIN;
$numberOfPosts = $dbPosts->numberPost(true); // published and drafts
}
else {
$postPerPage = $Site->postsPerPage();
$numberOfPosts = $dbPosts->numberPost(false); // published
}
// Post per page.
Paginator::set('postPerPage', $postPerPage);
// Number of posts
Paginator::set('numberOfPosts', $numberOfPosts);
$numberOfPages = (int) ceil($numberOfPosts / $postPerPage) -1;
Paginator::set('numberOfPages', $numberOfPages);
$showOlder = $numberOfPages > $currentPage;
Paginator::set('showOlder', $showOlder);
$showNewer = $currentPage > 0;
Paginator::set('showNewer', $showNewer);
$show = $showNewer && $showOlder;
Paginator::set('show', true);
$nextPage = max(0, $currentPage+1);
Paginator::set('nextPage', $nextPage);
$prevPage = min($numberOfPages, $currentPage-1);
Paginator::set('prevPage', $prevPage);

View File

@ -0,0 +1,41 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Variables
// ============================================================================
// ============================================================================
// Functions
// ============================================================================
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
$token = isset($_POST['token']) ? Sanitize::html($_POST['token']) : false;
if( !$Security->validateToken($token) )
{
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying validate the token. Token ID: '.$token);
// Destroy the session.
Session::destroy();
// Redirect to login panel.
Redirect::page('admin', 'login');
}
else
{
unset($_POST['token']);
}
}
// ============================================================================
// Main after POST
// ============================================================================

View File

@ -0,0 +1,50 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Variables
// ============================================================================
$theme = array(
'name'=>'',
'description'=>'',
'author'=>'',
'email'=>'',
'website'=>'',
'version'=>'',
'releaseDate'=>''
);
// ============================================================================
// Functions
// ============================================================================
// ============================================================================
// Main
// ============================================================================
$langLocaleFile = PATH_THEME.'languages'.DS.$Site->locale().'.json';
$langDefaultFile = PATH_THEME.'languages'.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);
}

View File

@ -1,15 +1,28 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// Boot rules
include(PATH_RULES.'70.build_posts.php');
include(PATH_RULES.'70.build_pages.php');
include(PATH_RULES.'70.posts.php');
include(PATH_RULES.'70.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');
// Theme init.php
if( Sanitize::pathFile(PATH_THEMES, $Site->theme().DS.'init.php') )
if( Sanitize::pathFile(PATH_THEMES, $Site->theme().DS.'init.php') ) {
include(PATH_THEMES.$Site->theme().DS.'init.php');
}
// Theme HTML
if( Sanitize::pathFile(PATH_THEMES, $Site->theme().DS.'index.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');
}
// Plugins after site loaded
Theme::plugins('afterSiteLoad');

View File

@ -4,32 +4,40 @@ class dbLanguage extends dbJSON
{
public $data;
public $db;
public $currentLocale;
function __construct($language)
function __construct($locale)
{
$this->data = array();
$this->db = array();
$this->currentLocale = 'en_US';
// Default language en_US
$filename = PATH_LANGUAGES.'en_US.json';
if(file_exists($filename))
if( Sanitize::pathFile($filename) )
{
$Tmp = new dbJSON($filename, false);
$this->db += $Tmp->db;
$this->db = array_merge($this->db, $Tmp->db);
}
// User language
$filename = PATH_LANGUAGES.$language.'.json';
if(file_exists($filename))
$filename = PATH_LANGUAGES.$locale.'.json';
if( Sanitize::pathFile($filename) && ($locale!=="en_US") )
{
$this->currentLocale = $locale;
$Tmp = new dbJSON($filename, false);
$this->db += $Tmp->db;
$this->db = array_merge($this->db, $Tmp->db);
}
$this->data = $this->db['language-data'];
unset($this->db['language-data']);
}
public function getCurrentLocale()
{
return $this->currentLocale;
}
// Return the translation, if the translation does'n exist then return the English translation.
public function get($string)
{
@ -49,6 +57,12 @@ class dbLanguage extends dbJSON
return $this->get($string);
}
// Print translation.
public function printMe($string)
{
echo $this->get($string);
}
// Print translation.
public function p($string)
{
@ -57,7 +71,7 @@ class dbLanguage extends dbJSON
public function add($array)
{
$this->db += $array;
$this->db = array_merge($this->db, $array);
}
// Returns the item from plugin-data.
@ -73,7 +87,7 @@ class dbLanguage extends dbJSON
// Returns an array with all dictionaries.
public function getLanguageList()
{
$files = glob(PATH_LANGUAGES.'*.json');
$files = Filesystem::listFiles(PATH_LANGUAGES, '*', 'json');
$tmp = array();

View File

@ -5,14 +5,13 @@ class dbPages extends dbJSON
private $parentKeyList = array();
private $dbFields = array(
'title'=> array('inFile'=>true, 'value'=>''),
'content'=> array('inFile'=>true, 'value'=>''),
'title'=> array('inFile'=>true, 'value'=>''),
'content'=> array('inFile'=>true, 'value'=>''),
'description'=> array('inFile'=>false, 'value'=>''),
'username'=> array('inFile'=>false, 'value'=>''),
'tags'=> array('inFile'=>false, 'value'=>''),
'status'=> array('inFile'=>false, 'value'=>'draft'),
'unixTimeCreated'=> array('inFile'=>false, 'value'=>0),
'unixTimeModified'=>array('inFile'=>false, 'value'=>0),
'tags'=> array('inFile'=>false, 'value'=>array()),
'status'=> array('inFile'=>false, 'value'=>'draft'),
'date'=> array('inFile'=>false, 'value'=>0),
'position'=> array('inFile'=>false, 'value'=>0)
);
@ -27,9 +26,6 @@ class dbPages extends dbJSON
$dataForFile = array(); // This data will be saved in the file
$key = $this->generateKey($args['slug'], $args['parent']);
if($key===false) {
return false;
}
// The user is always the one loggued.
$args['username'] = Session::get('username');
@ -37,20 +33,27 @@ class dbPages extends dbJSON
return false;
}
// The current unix time stamp.
$args['unixTimeCreated'] = Date::unixTime();
// Current date.
if(empty($args['date'])) {
$args['date'] = Date::current(DB_DATE_FORMAT);
}
// Verify arguments with the database fields.
foreach($this->dbFields as $field=>$options)
{
if( isset($args[$field]) )
{
// Sanitize if will be saved on database.
if( !$options['inFile'] ) {
$tmpValue = Sanitize::html($args[$field]);
if($field=='tags') {
$tmpValue = $this->generateTags($args['tags']);
}
else {
$tmpValue = $args[$field];
// Sanitize if will be saved on database.
if( !$options['inFile'] ) {
$tmpValue = Sanitize::html($args[$field]);
}
else {
$tmpValue = $args[$field];
}
}
}
// Default value for the field.
@ -109,21 +112,30 @@ class dbPages extends dbJSON
return false;
}
// Unix time created and modified.
$args['unixTimeCreated'] = $this->db[$args['key']]['unixTimeCreated'];
$args['unixTimeModified'] = Date::unixTime();
// If the page is draft then the time created is now.
if( $this->db[$args['key']]['status']=='draft' ) {
$args['date'] = Date::current(DB_DATE_FORMAT);
}
else {
$args['date'] = $this->db[$args['key']]['date'];
}
// Verify arguments with the database fields.
foreach($this->dbFields as $field=>$options)
{
if( isset($args[$field]) )
{
// Sanitize if will be saved on database.
if( !$options['inFile'] ) {
$tmpValue = Sanitize::html($args[$field]);
if($field=='tags') {
$tmpValue = $this->generateTags($args['tags']);
}
else {
$tmpValue = $args[$field];
// Sanitize if will be saved on database.
if( !$options['inFile'] ) {
$tmpValue = Sanitize::html($args[$field]);
}
else {
$tmpValue = $args[$field];
}
}
}
// Default value for the field.
@ -283,62 +295,113 @@ class dbPages extends dbJSON
return $this->db;
}
public function regenerate()
// Returns an Array, array('tagSlug'=>'tagName')
// (string) $tags, tag list separeted by comma.
public function generateTags($tags)
{
$tmp = array();
$tags = trim($tags);
if(empty($tags)) {
return $tmp;
}
// Make array
$tags = explode(',', $tags);
foreach($tags as $tag)
{
$tag = trim($tag);
$tagKey = Text::cleanUrl($tag);
$tmp[$tagKey] = $tag;
}
return $tmp;
}
public function regenerateCli()
{
$db = $this->db;
$paths = array();
$newPaths = array();
$fields = array();
// Complete $fields with the default values.
// Default fields and value
foreach($this->dbFields as $field=>$options) {
if(!$options['inFile']) {
$fields[$field] = $options['value'];
}
}
// Foreach new page set the unix time stamp.
$fields['unixTimeCreated'] = Date::unixTime();
// Foreach new page set the owner admin.
$fields['username'] = 'admin';
// Foreach new page set the status.
if(HANDMADE_PUBLISHED) {
$fields['status']='published';
}
// Get the pages from the first level of directories
$tmpPaths = glob(PATH_PAGES.'*', GLOB_ONLYDIR);
//$tmpPaths = glob(PATH_PAGES.'*', GLOB_ONLYDIR);
$tmpPaths = Filesystem::listDirectories(PATH_PAGES);
foreach($tmpPaths as $directory)
{
$key = basename($directory);
if(file_exists($directory.DS.'index.txt')){
if(file_exists($directory.DS.'index.txt')) {
// The key is the directory name
$paths[$key] = true;
$newPaths[$key] = true;
}
// Recovery pages from subdirectories
$subPaths = glob($directory.DS.'*', GLOB_ONLYDIR);
//$subPaths = glob($directory.DS.'*', GLOB_ONLYDIR);
$subPaths = Filesystem::listDirectories($directory.DS);
foreach($subPaths as $subDirectory)
{
$subKey = basename($subDirectory);
if(file_exists($subDirectory.DS.'index.txt')) {
// The key is composed by the directory/subdirectory
$paths[$key.'/'.$subKey] = true;
$newPaths[$key.'/'.$subKey] = true;
}
}
}
// Remove old posts from db
foreach( array_diff_key($db, $paths) as $slug=>$data ) {
unset($this->db[$slug]);
foreach($newPaths as $key=>$value)
{
if(!isset($this->db[$key]))
{
// Default values for the new pages.
$fields['status'] = CLI_STATUS;
$fields['date'] = Date::current(DB_DATE_FORMAT);
$fields['username'] = 'admin';
// Create the entry for the new page.
$this->db[$key] = $fields;
}
$Page = new Page($key);
// Update all fields from FILE to DATABASE.
foreach($fields as $f=>$v)
{
// If the field exists on the FILE, update it.
if($Page->getField($f))
{
$valueFromFile = $Page->getField($f);
if($f=='tags') {
// Generate tags array.
$this->db[$key]['tags'] = $this->generateTags($valueFromFile);
}
elseif($f=='date') {
// Validate Date from file
if(Valid::date($valueFromFile, DB_DATE_FORMAT)) {
$this->db[$key]['date'] = $valueFromFile;
}
}
else {
// Sanitize the values from file.
$this->db[$key][$f] = Sanitize::html($valueFromFile);
}
}
}
}
// Insert new posts to db
foreach( array_diff_key($paths, $db) as $slug=>$data ) {
$this->db[$slug] = $fields;
// Remove old pages from db
foreach( array_diff_key($db, $newPaths) as $key=>$data ) {
unset($this->db[$key]);
}
// Save the database.
@ -349,5 +412,4 @@ class dbPages extends dbJSON
return $this->db!=$db;
}
}

View File

@ -3,23 +3,38 @@
class dbPosts extends dbJSON
{
private $dbFields = array(
'title'=> array('inFile'=>true, 'value'=>''),
'content'=> array('inFile'=>true, 'value'=>''),
'description'=> array('inFile'=>false, 'value'=>''),
'username'=> array('inFile'=>false, 'value'=>''),
'status'=> array('inFile'=>false, 'value'=>'draft'),
'tags'=> array('inFile'=>false, 'value'=>''),
'allowComments'=> array('inFile'=>false, 'value'=>false),
'unixTimeCreated'=> array('inFile'=>false, 'value'=>0),
'unixTimeModified'=>array('inFile'=>false, 'value'=>0)
'title'=> array('inFile'=>true, 'value'=>''),
'content'=> array('inFile'=>true, 'value'=>''),
'description'=> array('inFile'=>false, 'value'=>''),
'username'=> array('inFile'=>false, 'value'=>''),
'status'=> array('inFile'=>false, 'value'=>'draft'), // published, draft, scheduled
'tags'=> array('inFile'=>false, 'value'=>array()),
'allowComments'=> array('inFile'=>false, 'value'=>false),
'date'=> array('inFile'=>false, 'value'=>'')
);
private $numberPosts = array(
'total'=>0,
'published'=>0
);
function __construct()
{
parent::__construct(PATH_DATABASES.'posts.php');
$this->numberPosts['total'] = count($this->db);
}
// Return an array with the database for a page, FALSE otherwise.
public function numberPost($total=false)
{
if($total) {
return $this->numberPosts['total'];
}
return $this->numberPosts['published'];
}
// Return an array with the post's database, FALSE otherwise.
public function getDb($key)
{
if($this->postExists($key)) {
@ -29,6 +44,15 @@ class dbPosts extends dbJSON
return false;
}
public function setDb($key, $field, $value)
{
if($this->postExists($key)) {
$this->db[$key][$field] = $value;
}
return false;
}
// Return TRUE if the post exists, FALSE otherwise.
public function postExists($key)
{
@ -67,35 +91,47 @@ class dbPosts extends dbJSON
{
$dataForDb = array(); // This data will be saved in the database
$dataForFile = array(); // This data will be saved in the file
$currentDate = Date::current(DB_DATE_FORMAT);
// Generate the database key.
$key = $this->generateKey($args['slug']);
// The user is always the one loggued.
// The user is always the who is loggued.
$args['username'] = Session::get('username');
if( Text::isEmpty($args['username']) ) {
return false;
}
// The current unix time stamp.
if(empty($args['unixTimeCreated'])) {
$args['unixTimeCreated'] = Date::unixTime();
// Date
if(!Valid::date($args['date'], DB_DATE_FORMAT)) {
$args['date'] = $currentDate;
}
// Schedule post?
if( ($args['date']>$currentDate) && ($args['status']=='published') ) {
$args['status'] = 'scheduled';
}
// Verify arguments with the database fields.
foreach($this->dbFields as $field=>$options)
{
// If the field is in the arguments.
if( isset($args[$field]) )
{
// Sanitize if will be saved on database.
if( !$options['inFile'] ) {
$tmpValue = Sanitize::html($args[$field]);
if($field=='tags') {
$tmpValue = $this->generateTags($args['tags']);
}
else {
$tmpValue = $args[$field];
// Sanitize if will be saved on database.
if( !$options['inFile'] ) {
$tmpValue = Sanitize::html($args[$field]);
}
else {
$tmpValue = $args[$field];
}
}
}
// Default value for the field.
// Default value if not in the arguments.
else
{
$tmpValue = $options['value'];
@ -130,6 +166,10 @@ class dbPosts extends dbJSON
// Save the database
$this->db[$key] = $dataForDb;
// Sort posts before save.
$this->sortByDate();
if( $this->save() === false ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.');
return false;
@ -140,10 +180,6 @@ class dbPosts extends dbJSON
public function edit($args)
{
// Unix time created and modified.
$args['unixTimeCreated'] = $this->db[$args['key']]['unixTimeCreated'];
$args['unixTimeModified'] = Date::unixTime();
if( $this->delete($args['key']) ) {
return $this->add($args);
}
@ -180,50 +216,246 @@ class dbPosts extends dbJSON
return true;
}
public function regenerate()
// Returns an array with a list of posts keys, filtered by a page number.
public function getList($pageNumber, $postPerPage, $removeUnpublished=true)
{
$totalPosts = $this->numberPosts['total'];
// Remove the unpublished posts.
if($removeUnpublished) {
$this->removeUnpublished();
$totalPosts = $this->numberPosts['published'];
}
$init = (int) $postPerPage * $pageNumber;
$end = (int) min( ($init + $postPerPage - 1), $totalPosts - 1 );
$outrange = $init<0 ? true : $init>$end;
if(!$outrange) {
return array_slice($this->db, $init, $postPerPage, true);
}
return array();
}
// Delete all posts from an user.
public function deletePostsByUser($username)
{
foreach($this->db as $key=>$value)
{
if($value['username']==$username) {
unset($this->db[$key]);
}
}
// Save the database.
if( $this->save() === false ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.');
return false;
}
return true;
}
// Link-up all posts from an user to another user.
public function linkPostsToUser($oldUsername, $newUsername)
{
foreach($this->db as $key=>$value)
{
if($value['username']==$oldUsername) {
$this->db[$key]['username'] = $newUsername;
}
}
// Sort posts before save.
$this->sortByDate();
// Save the database.
if( $this->save() === false ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.');
return false;
}
return true;
}
// Remove unpublished posts, status != published.
public function removeUnpublished()
{
foreach($this->db as $key=>$values)
{
if($values['status']!='published') {
unset($this->db[$key]);
}
}
$this->numberPosts['published'] = count($this->db);
return true;
}
// Return TRUE if there are new posts published, FALSE otherwise.
public function scheduler()
{
// Get current date.
$currentDate = Date::current(DB_DATE_FORMAT);
$saveDatabase = false;
// Check scheduled posts and publish.
foreach($this->db as $postKey=>$values)
{
if($values['status']=='scheduled')
{
// Publish post.
if($values['date']<=$currentDate) {
$this->db[$postKey]['status'] = 'published';
$saveDatabase = true;
}
}
elseif($values['status']=='published') {
break;
}
}
// Save the database.
if($saveDatabase)
{
if( $this->save() === false ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.');
return false;
}
return true;
}
return false;
}
// Returns an Array, array('tagSlug'=>'tagName')
// (string) $tags, tag list separeted by comma.
public function generateTags($tags)
{
$tmp = array();
$tags = trim($tags);
if(empty($tags)) {
return $tmp;
}
// Make array
$tags = explode(',', $tags);
foreach($tags as $tag)
{
$tag = trim($tag);
$tagKey = Text::cleanUrl($tag);
$tmp[$tagKey] = $tag;
}
return $tmp;
}
// Sort posts by date.
public function sortByDate($HighToLow=true)
{
if($HighToLow) {
uasort($this->db, array($this, 'sortHighToLow'));
}
else {
uasort($this->db, array($this, 'sortLowToHigh'));
}
return true;
}
private function sortLowToHigh($a, $b) {
return $a['date']>$b['date'];
}
private function sortHighToLow($a, $b) {
return $a['date']<$b['date'];
}
// Return TRUE if there are new posts, FALSE otherwise.
public function regenerateCli()
{
$db = $this->db;
$paths = array();
$allPosts = array();
$fields = array();
$currentDate = Date::current(DB_DATE_FORMAT);
// Default fields and value
// Generate default fields and values.
foreach($this->dbFields as $field=>$options) {
if(!$options['inFile']) {
$fields[$field] = $options['value'];
}
}
// Unix time stamp
$fields['unixTimeCreated'] = Date::unixTime();
// Username
$fields['status'] = CLI_STATUS;
$fields['date'] = $currentDate;
$fields['username'] = 'admin';
if(HANDMADE_PUBLISHED) {
$fields['status']='published';
}
// Recovery pages from the first level of directories
$tmpPaths = glob(PATH_POSTS.'*', GLOB_ONLYDIR);
// Recovery posts from the first level of directories
$tmpPaths = Filesystem::listDirectories(PATH_POSTS);
foreach($tmpPaths as $directory)
{
$key = basename($directory);
if(file_exists($directory.DS.'index.txt'))
{
// The key is the directory name.
$key = basename($directory);
if(file_exists($directory.DS.'index.txt')) {
// The key is the directory name
$paths[$key] = true;
// All keys posts
$allPosts[$key] = true;
// Create the new entry if not exists on DATABASE.
if(!isset($this->db[$key])) {
// New entry on database
$this->db[$key] = $fields;
}
// Create the post from FILE.
$Post = new Post($key);
// Update all fields from FILE to DATABASE.
foreach($fields as $f=>$v)
{
// If the field exists on the FILE, update it.
if($Post->getField($f))
{
$valueFromFile = $Post->getField($f);
if($f=='tags') {
// Generate tags array.
$this->db[$key]['tags'] = $this->generateTags($valueFromFile);
}
elseif($f=='date') {
// Validate Date from file
if(Valid::date($valueFromFile, DB_DATE_FORMAT)) {
$this->db[$key]['date'] = $valueFromFile;
if( $valueFromFile>$currentDate ) {
$this->db[$key]['status'] = 'scheduled';
}
}
}
else {
// Sanitize the values from file.
$this->db[$key][$f] = Sanitize::html($valueFromFile);
}
}
}
}
}
// Remove old posts from db
foreach( array_diff_key($db, $paths) as $slug=>$data ) {
unset($this->db[$slug]);
// Remove orphan posts from db, the orphan posts are posts deleted by hand (directory deleted).
foreach( array_diff_key($db, $allPosts) as $key=>$data ) {
unset($this->db[$key]);
}
// Insert new posts to db
foreach( array_diff_key($paths, $db) as $slug=>$data ) {
$this->db[$slug] = $fields;
}
// Sort posts before save.
$this->sortByDate();
// Save the database.
if( $this->save() === false ) {
@ -234,63 +466,4 @@ class dbPosts extends dbJSON
return $this->db!=$db;
}
public function getPage($pageNumber, $postPerPage, $draftPosts=false)
{
$init = (int) $postPerPage * $pageNumber;
$end = (int) min( ($init + $postPerPage - 1), count($this->db) - 1 );
$outrange = $init<0 ? true : $init > $end;
// DEBUG: Ver una mejor manera de eliminar draft post antes de ordenarlos
// DEBUG: Se eliminan antes de ordenarlos porque sino los draft cuentan como publicados en el PostPerPage.
if(!$draftPosts){
$this->removeUnpublished();
}
$tmp = $this->sortByDate();
if(!$outrange) {
return array_slice($tmp, $init, $end+1, true);
}
return array();
}
// DEBUG: Ver una mejor manera de eliminar draft post antes de ordenarlos
private function removeUnpublished()
{
$tmp = array();
foreach($this->db as $key=>$value)
{
if($value['status']==='published') {
$tmp[$key]=$value;
}
}
$this->db = $tmp;
}
private function sortByDate($low_to_high=false)
{
// high to low
function high_to_low($a, $b) {
return $a['unixTimeCreated']<$b['unixTimeCreated'];
}
// low to high
function low_to_high($a, $b) {
return $a['unixTimeCreated']>$b['unixTimeCreated'];
}
$tmp = $this->db;
if($low_to_high)
uasort($tmp, 'low_to_high');
else
uasort($tmp, 'high_to_low');
return $tmp;
}
}

View File

@ -3,22 +3,22 @@
class dbSite extends dbJSON
{
private $dbFields = array(
'title'=> array('inFile'=>false, 'value'=>''),
'title'=> array('inFile'=>false, 'value'=>'I am Guybrush Threepwood, mighty developer'),
'slogan'=> array('inFile'=>false, 'value'=>''),
'description'=> array('inFile'=>false, 'value'=>''),
'footer'=> array('inFile'=>false, 'value'=>''),
'postsperpage'=>array('inFile'=>false, 'value'=>''),
'language'=> array('inFile'=>false, 'value'=>'en'),
'description'=> array('inFile'=>false, 'value'=>''),
'footer'=> array('inFile'=>false, 'value'=>'I wanna be a pirate!'),
'postsperpage'=> array('inFile'=>false, 'value'=>''),
'language'=> array('inFile'=>false, 'value'=>'en'),
'locale'=> array('inFile'=>false, 'value'=>'en_US'),
'timezone'=> array('inFile'=>false, 'value'=>'America/Argentina/Buenos_Aires'),
'timezone'=> array('inFile'=>false, 'value'=>'America/Argentina/Buenos_Aires'),
'theme'=> array('inFile'=>false, 'value'=>'pure'),
'adminTheme'=> array('inFile'=>false, 'value'=>'kure'),
'homepage'=> array('inFile'=>false, 'value'=>''),
'adminTheme'=> array('inFile'=>false, 'value'=>'default'),
'homepage'=> array('inFile'=>false, 'value'=>''),
'uriPage'=> array('inFile'=>false, 'value'=>'/'),
'uriPost'=> array('inFile'=>false, 'value'=>'/post/'),
'uriTag'=> array('inFile'=>false, 'value'=>'/tag/'),
'url'=> array('inFile'=>false, 'value'=>''),
'advancedOptions'=> array('inFile'=>false, 'value'=>'false')
'cliMode'=> array('inFile'=>false, 'value'=>true)
);
function __construct()
@ -64,8 +64,9 @@ class dbSite extends dbJSON
$filters['page'] = $this->db['uriPage'];
$filters['tag'] = $this->db['uriTag'];
if(empty($filter))
if(empty($filter)) {
return $filters;
}
return $filters[$filter];
}
@ -97,15 +98,6 @@ class dbSite extends dbJSON
return $this->db['slogan'];
}
public function advancedOptions()
{
if($this->db['advancedOptions']==='true') {
return true;
}
return false;
}
// Returns the site description.
public function description()
{
@ -136,10 +128,16 @@ class dbSite extends dbJSON
return $this->db['url'];
}
// Returns TRUE if the cli mode is enabled, otherwise FALSE.
public function cliMode()
{
return $this->db['cliMode'];
}
// Returns the relative home link
public function homeLink()
{
return HTML_PATH_ROOT;
return HTML_PATH_ROOT;
}
// Returns the timezone.
@ -166,6 +164,16 @@ class dbSite extends dbJSON
return $this->db['locale'];
}
// Returns the current language in short format.
public function shortLanguage()
{
$locale = $this->locale();
$explode = explode('_', $locale);
$short = array_shift($explode);
return $short;
}
// Returns the current homepage.
public function homepage()
{

87
kernel/dbtags.class.php Normal file
View File

@ -0,0 +1,87 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
class dbTags extends dbJSON
{
/*
$postsIndex['tag1']['name'] = 'Tag 1';
$postsIndex['tag1']['posts'] = array('post1','post2','post3');
$postsIndex['tag2']['name'] = 'Tag 2';
$postsIndex['tag2']['posts'] = array('post1','post5');
*/
private $dbFields = array(
'postsIndex'=>array('inFile'=>false, 'value'=>array()),
'pagesIndex'=>array('inFile'=>false, 'value'=>array())
);
function __construct()
{
parent::__construct(PATH_DATABASES.'tags.php');
}
// Returns an array with a list of posts keys, filtered by a page number and a tag key.
public function getList($pageNumber, $postPerPage, $tagKey)
{
if( !isset($this->db['postsIndex'][$tagKey]) ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying get the posts list by the tag key: '.$tagKey);
return array();
}
$init = (int) $postPerPage * $pageNumber;
$end = (int) min( ($init + $postPerPage - 1), $this->countPostsByTag($tagKey) - 1 );
$outrange = $init<0 ? true : $init > $end;
if(!$outrange) {
$list = $this->db['postsIndex'][$tagKey]['posts'];
$tmp = array_flip($list); // Change the posts keys list in the array key.
return array_slice($tmp, $init, $postPerPage, true);
}
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying get the list of posts, out of range?. Pagenumber: '.$pageNumber);
return array();
}
public function countPostsByTag($tagKey)
{
if( isset($this->db['postsIndex'][$tagKey]) ) {
return count($this->db['postsIndex'][$tagKey]['posts']);
}
return 0;
}
// Regenerate the posts index for each tag.
// (array) $db, the $db must be sorted by date and the posts published only.
public function reindexPosts($db)
{
$tagsIndex = array();
$currentDate = Date::current(DB_DATE_FORMAT);
// Foreach post
foreach($db as $postKey=>$values)
{
$tags = $values['tags'];
// Foreach tag from post
foreach($tags as $tagKey=>$tagName)
{
if( isset($tagsIndex[$tagKey]) ) {
array_push($tagsIndex[$tagKey]['posts'], $postKey);
}
else {
$tagsIndex[$tagKey]['name'] = $tagName;
$tagsIndex[$tagKey]['posts'] = array($postKey);
}
}
}
$this->db['postsIndex'] = $tagsIndex;
if( $this->save() === false ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.');
return false;
}
return true;
}
}

View File

@ -6,11 +6,11 @@ class dbUsers extends dbJSON
'firstName'=> array('inFile'=>false, 'value'=>''),
'lastName'=> array('inFile'=>false, 'value'=>''),
'username'=> array('inFile'=>false, 'value'=>''),
'role'=> array('inFile'=>false, 'value'=>'editor'),
'role'=> array('inFile'=>false, 'value'=>'editor'),
'password'=> array('inFile'=>false, 'value'=>''),
'salt'=> array('inFile'=>false, 'value'=>'!Pink Floyd!Welcome to the machine!'),
'email'=> array('inFile'=>false, 'value'=>''),
'registered'=> array('inFile'=>false, 'value'=>0)
'salt'=> array('inFile'=>false, 'value'=>'!Pink Floyd!Welcome to the machine!'),
'email'=> array('inFile'=>false, 'value'=>''),
'registered'=> array('inFile'=>false, 'value'=>'1985-03-15 10:00')
);
function __construct()
@ -19,7 +19,7 @@ class dbUsers extends dbJSON
}
// Return an array with the username databases
public function get($username)
public function getDb($username)
{
if($this->userExists($username))
{
@ -57,7 +57,7 @@ class dbUsers extends dbJSON
{
$dataForDb = array();
$user = $this->get($args['username']);
$user = $this->getDb($args['username']);
if($user===false)
{
@ -70,10 +70,10 @@ class dbUsers extends dbJSON
{
if( isset($this->dbFields[$field]) )
{
// Sanitize if will be saved on database.
// Sanitize.
$tmpValue = Sanitize::html($value);
// Set type
// Set type.
settype($tmpValue, gettype($this->dbFields[$field]['value']));
$user[$field] = $tmpValue;
@ -90,6 +90,18 @@ class dbUsers extends dbJSON
return true;
}
public function delete($username)
{
unset($this->db[$username]);
if( $this->save() === false ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.');
return false;
}
return true;
}
public function add($args)
{
$dataForDb = array();
@ -126,8 +138,8 @@ class dbUsers extends dbJSON
return false;
}
// The current unix time stamp.
$dataForDb['registered'] = Date::unixTime();
// Current date.
$dataForDb['registered'] = Date::current(DB_DATE_FORMAT);
// Password
$dataForDb['salt'] = Text::randomText(SALT_LENGTH);

View File

@ -1,13 +1,4 @@
<?php
/*
* Nibbleblog -
* http://www.nibbleblog.com
* Author Diego Najar
* All Nibbleblog code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*/
<?php defined('BLUDIT') or die('Bludit CMS.');
class Cookie {
@ -26,11 +17,9 @@ class Cookie {
setcookie($name, $value, time() + ($expire * 60));
}
public static function is_set($name)
public static function isSet($name)
{
return(isset($_COOKIE[$name]));
}
}
?>

View File

@ -1,13 +1,4 @@
<?php
/*
* Nibbleblog -
* http://www.nibbleblog.com
* Author Diego Najar
* All Nibbleblog code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*/
<?php defined('BLUDIT') or die('Bludit CMS.');
class Crypt {
@ -41,12 +32,10 @@ class Crypt {
return('---');
}
public static function get_hash($string, $salt = '$#!')
public static function getHash($string, $salt = '$#!')
{
$sha1 = sha1($string.$salt);
return($sha1);
}
}
?>

View File

@ -8,12 +8,19 @@ class Date {
return time();
}
// Format a local time/date according to locale settings
public static function format($time, $format)
// Return the local time/date according to locale settings.
public static function current($format)
{
$date = strftime($format, $time);
$Date = new DateTime();
return $Date->format($format);
}
return $date;
// Format a local time/date according to locale settings.
public static function format($date, $currentFormat, $outputFormat)
{
$Date = DateTime::createFromFormat($currentFormat, $date);
return $Date->format($outputFormat);
}
public static function timeago($time)
@ -64,39 +71,4 @@ class Date {
return $tmp;
}
// Old
public static function set_locale($string)
{
if(setlocale(LC_ALL,$string.'.UTF-8')!==false)
return true;
if(setlocale(LC_ALL,$string.'.UTF8')!==false)
return true;
return setlocale(LC_ALL,$string);
}
public static function set_timezone($string)
{
return(date_default_timezone_set($string));
}
// Format a GMT/UTC+0 date/time
public static function format_gmt($time, $format)
{
$date = gmdate($format, $time);
return( $date );
}
public static function atom($time)
{
$date = date(DATE_ATOM, $time);
return( $date );
}
}

View File

@ -1,13 +1,4 @@
<?php
/*
* Nibbleblog -
* http://www.nibbleblog.com
* Author Diego Najar
* All Nibbleblog code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*/
<?php defined('BLUDIT') or die('Bludit CMS.');
class Email {
@ -19,20 +10,18 @@ class Email {
$headers .= 'From: '.$args['from']."\r\n";
$message = '<html>
<head>
<title>Nibbleblog</title>
</head>
<body>
<div style="margin: 0px auto; border: 1px solid #F1F1F1; padding: 10px;">
<div style="font-size: 26px; padding: 10px; background-color: #F1F1F1;">Nibbleblog</div>
'.$args['message'].'
</div>
</body>
</html>';
<head>
<title>Bludit</title>
</head>
<body>
<div style="margin: 0px auto; border: 1px solid #F1F1F1; padding: 10px;">
<div style="font-size: 26px; padding: 10px; background-color: #F1F1F1;">Nibbleblog</div>
'.$args['message'].'
</div>
</body>
</html>';
return mail($args['to'], $args['subject'], $message, $headers);
}
}
?>

View File

@ -3,9 +3,28 @@
class Filesystem {
// NEW
// Returns an array with the absolutes directories.
public static function listDirectories($path, $regex='*')
{
return glob($path.$regex, GLOB_ONLYDIR);
$directories = glob($path.$regex, GLOB_ONLYDIR);
if(empty($directories)) {
return array();
}
return $directories;
}
public static function listFiles($path, $regex='*', $extension)
{
$files = glob($path.$regex.'.'.$extension);
if(empty($files)) {
return array();
}
return $files;
}
public static function mkdir($pathname, $recursive=false)

View File

@ -1,251 +0,0 @@
<?php
/*
* Nibbleblog -
* http://www.nibbleblog.com
* Author Diego Najar
* All Nibbleblog code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*/
class Html {
private static function get_attributes($array = array())
{
unset($array['content']);
$attributes = '';
if(isset($array['hidden']) && $array['hidden'])
{
$attributes .= 'style="display:none" ';
}
unset($array['hidden']);
foreach( $array as $key=>$value )
{
$attributes .= $key.'="'.$value.'" ';
}
return($attributes);
}
public static function h1($array = array())
{
$attributes = self::get_attributes($array);
return( '<h1 '.$attributes.'>'.$array['content'].'</h1>' );
}
public static function h2($array = array())
{
$attributes = self::get_attributes($array);
return( '<h2 '.$attributes.'>'.$array['content'].'</h2>' );
}
public static function h3($array = array())
{
$attributes = self::get_attributes($array);
return( '<h3 '.$attributes.'>'.$array['content'].'</h3>' );
}
public static function h4($array = array())
{
$attributes = self::get_attributes($array);
return( '<h4 '.$attributes.'>'.$array['content'].'</h4>' );
}
public static function blockquote($array = array())
{
$attributes = self::get_attributes($array);
return( '<blockquote '.$attributes.'>'.$array['content'].'</blockquote>' );
}
public static function p($array = array())
{
$attributes = self::get_attributes($array);
return( '<p '.$attributes.'>'.$array['content'].'</p>' );
}
public static function separator($array = array(), $top=false, $hidden=false)
{
if(isset($array['class']))
{
$array['class'] = 'separator '.$array['class'];
}
else
{
$array['class'] = 'separator';
}
if($hidden)
$hidden = 'style="display:none"';
else
$hidden = '';
$attributes = self::get_attributes($array);
return( '<header '.$hidden.' class="'.($top?'separator_top':'separator').'"><div '.$attributes.'>'.$array['content'].'</div></header>' );
}
public static function form_open($array = array())
{
$attributes = self::get_attributes($array);
return( '<form '.$attributes.' >' );
}
public static function form_close()
{
return( '</form>' );
}
public static function input($array = array())
{
$attributes = self::get_attributes($array);
return( '<input '.$attributes.'/>' );
}
public static function checkbox($array = array(), $checked = false)
{
$attributes = self::get_attributes($array);
if( $checked )
return( '<input type="checkbox" '.$attributes.' checked="checked" value="1" />' );
else
return( '<input type="checkbox" '.$attributes.' value="1"/>' );
}
public static function radio($array = array(), $checked = false)
{
$attributes = self::get_attributes($array);
if( $checked )
return( '<input type="radio" '.$attributes.' checked="checked" />' );
else
return( '<input type="radio" '.$attributes.'/>' );
}
public static function textarea($array = array())
{
$attributes = self::get_attributes($array);
return( '<textarea '.$attributes.'>'.$array['content'].'</textarea>' );
}
public static function label($array = array())
{
$attributes = self::get_attributes($array);
return( '<label '.$attributes.'>'.$array['content'].'</label>' );
}
public static function select($array = array(), $options = array(), $selected)
{
$attributes = self::get_attributes($array);
$tmp = '<select '.$attributes.'>';
foreach( $options as $key=>$value )
{
if( $key == $selected)
$attr = 'selected="selected"';
else
$attr = '';
$tmp .= '<option value="'.$key.'" '.$attr.'>'.$value.'</option>';
}
$tmp .= '</select>';
return( $tmp );
}
public static function div($array = array())
{
$attributes = self::get_attributes($array);
return( '<div '.$attributes.'>'.$array['content'].'</div>' );
}
public static function div_open($array = array())
{
$attributes = self::get_attributes($array);
return( '<div '.$attributes.'>' );
}
public static function div_close()
{
return( '</div>' );
}
public static function article_open($array = array())
{
$attributes = self::get_attributes($array);
return( '<article '.$attributes.'>' );
}
public static function article_close()
{
return( '</article>' );
}
public static function header_open($array = array())
{
$attributes = self::get_attributes($array);
return( '<header '.$attributes.'>' );
}
public static function header_close()
{
return( '</header>' );
}
public static function link($array = array())
{
$attributes = self::get_attributes($array);
return( '<a '.$attributes.'>'.$array['content'].'</a>' );
}
public static function span($array = array())
{
$attributes = self::get_attributes($array);
return( '<span '.$attributes.'>'.$array['content'].'</span>' );
}
public static function img($array = array())
{
$attributes = self::get_attributes($array);
return( '<img '.$attributes.'/>' );
}
public static function ul($array = array())
{
$attributes = self::get_attributes($array);
return( '<ul '.$attributes.'>'.$array['content'].'</ul>' );
}
public static function banner($msg, $success, $error)
{
if( $success )
return('<div class="notification_success">'.$msg.'</div>');
elseif( $error )
return('<div class="notification_error">'.$msg.'</div>');
}
}
?>

View File

@ -1,58 +0,0 @@
<?php
/*
* Nibbleblog -
* http://www.nibbleblog.com
* Author Diego Najar
* All Nibbleblog code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*/
class Net {
public static function get_user_ip()
{
if(getenv('HTTP_X_FORWARDED_FOR'))
$ip = getenv('HTTP_X_FORWARDED_FOR');
elseif(getenv('HTTP_CLIENT_IP'))
$ip = getenv('HTTP_CLIENT_IP');
else
$ip = getenv('REMOTE_ADDR');
if(filter_var($ip, FILTER_VALIDATE_IP))
return $ip;
return getenv('REMOTE_ADDR');
}
public static function get_user_agent()
{
return getenv('HTTP_USER_AGENT');
}
public static function check_http_code($url, $code)
{
if(in_array('curl', get_loaded_extensions()))
{
$curl = curl_init();
curl_setopt_array($curl, array(CURLOPT_RETURNTRANSFER=>true, CURLOPT_URL=>$url));
curl_exec($curl);
$http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close( $curl );
return($http_code==$code);
}
// If curl is not installed, use get_headers
$headers = get_headers($url);
if(strpos($headers[0], (string)$code) == false)
return false;
return true;
}
}
?>

View File

@ -0,0 +1,66 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
class Paginator {
public static $pager = array(
'numberOfPostsAndDraft'=>0,
'numberOfPosts'=>0,
'numberOfPages'=>0,
'nextPage'=>0,
'prevPage'=>0,
'currentPage'=>0,
'showOlder'=>false,
'showNewer'=>false,
'show'=>false
);
public static function set($key, $value)
{
self::$pager[$key] = $value;
}
public static function get($key)
{
return self::$pager[$key];
}
public static function html($textPrevPage=false, $textNextPage=false, $showPageNumber=false)
{
global $Language;
$html = '<div id="paginator">';
$html .= '<ul>';
if(self::get('showNewer'))
{
if($textPrevPage===false) {
$textPrevPage = '« '.$Language->g('Prev page');
}
$html .= '<li class="left">';
$html .= '<a href="'.HTML_PATH_ROOT.'?page='.self::get('prevPage').'">'.$textPrevPage.'</a>';
$html .= '</li>';
}
if($showPageNumber) {
$html .= '<li class="list">'.(self::get('currentPage')+1).' / '.(self::get('numberOfPages')+1).'</li>';
}
if(self::get('showOlder'))
{
if($textNextPage===false) {
$textNextPage = $Language->g('Next page').' »';
}
$html .= '<li class="right">';
$html .= '<a href="'.HTML_PATH_ROOT.'?page='.self::get('nextPage').'">'.$textNextPage.'</a>';
$html .= '</li>';
}
$html .= '</ul>';
$html .= '</div>';
return $html;
}
}

View File

@ -55,35 +55,17 @@ class Sanitize {
return true;
}
// old
public static function ip($ip)
public static function email($email)
{
return filter_var($ip, FILTER_VALIDATE_IP);
return( filter_var($email, FILTER_SANITIZE_EMAIL) );
}
public static function mail($mail)
public static function url($url)
{
return filter_var($mail, FILTER_VALIDATE_EMAIL);
return( filter_var($url, FILTER_SANITIZE_URL) );
}
public static function int($int)
{
if($int === 0)
return( true );
elseif (filter_var($int, FILTER_VALIDATE_INT) === false )
return( false );
else
return( true );
}
// Remove all characters except digits
public static function sanitize_float($value)
{
return( filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_THOUSAND) );
}
// Valid an integer positive
public static function sanitize_int($value)
public static function int($value)
{
$value = (int)$value;
@ -93,17 +75,4 @@ class Sanitize {
return 0;
}
public static function sanitize_email($value)
{
return( filter_var($value, FILTER_SANITIZE_EMAIL) );
}
public static function sanitize_url($value)
{
return( filter_var($value, FILTER_SANITIZE_URL) );
}
// Convert all applicable characters to HTML entities incluye acentos
}

View File

@ -1,6 +1,6 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
class Session {
class Session {
private static $started = false;
@ -10,43 +10,41 @@ class Session {
// return true;
// DEBUG: Ver un nombre con alguna llave random al momentode instalar.
$session_name = 'Bludit-KEY';
$session_name = 'Bludit-KEY';
// If TRUE cookie will only be sent over secure connections.
$secure = false;
// If TRUE cookie will only be sent over secure connections.
$secure = false;
// If set to TRUE then PHP will attempt to send the httponly flag when setting the session cookie.
$httponly = true;
// If set to TRUE then PHP will attempt to send the httponly flag when setting the session cookie.
$httponly = true;
// This specifies the lifetime of the cookie in seconds which is sent to the browser.
// The value 0 means until the browser is closed.
$cookieLifetime = 0;
// This specifies the lifetime of the cookie in seconds which is sent to the browser.
// The value 0 means until the browser is closed.
$cookieLifetime = 0;
// Gets current cookies params.
$cookieParams = session_get_cookie_params();
session_set_cookie_params($cookieLifetime,
$cookieParams["path"],
$cookieParams["domain"],
$secure,
$httponly
);
session_set_cookie_params(
$cookieLifetime,
$cookieParams["path"],
$cookieParams["domain"],
$secure,
$httponly
);
// Sets the session name to the one set above.
session_name($session_name);
// Sets the session name to the one set above.
session_name($session_name);
// Start session.
self::$started = session_start();
// Start session.
self::$started = session_start();
// Regenerated the session, delete the old one. There are problems with AJAX.
//session_regenerate_id(true);
if(self::$started) {
Log::set(__METHOD__.LOG_SEP.'Session started.');
}
else {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to start the session.');
}
if(!self::$started) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to start the session.');
}
}
public static function started()

View File

@ -54,21 +54,14 @@ class Text {
public static function cleanUrl($string, $separator='-')
{
// Delete characters
$string = str_replace(array("", "", "!", "*", "&#039;", "&quot;", "(", ")", ";", ":", "@", "&amp", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]", "|"),'',$string);
$string = preg_replace('![^\\pL\d]+!u', $separator, $string);
if(function_exists('iconv')) {
$string = iconv('UTF-8', 'ASCII//TRANSLIT', $string);
}
// Remove spaces
$string = str_replace(' ',$separator, $string);
//remove any additional characters that might appear after translit
//$string = preg_replace('![^-\w]+!', '', $string);
// Replace multiple dashes
$string = preg_replace('/-{2,}/', $separator, $string);
// Make a string lowercase
$string = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $string);
$string = trim($string, '-');
$string = self::lowercase($string);
$string = preg_replace("/[\/_|+ -]+/", $separator, $string);
return $string;
}
@ -153,4 +146,16 @@ class Text {
return !self::isEmpty($string);
}
public static function imgRel2Abs($string, $base)
{
return preg_replace('/(src)="([^:"]*)(?:")/', "$1=\"$base$2\"", $string);
}
public static function pre2htmlentities($string)
{
return preg_replace_callback('/<pre.*?><code(.*?)>(.*?)<\/code><\/pre>/imsu',
create_function('$input', 'return "<pre><code $input[1]>".htmlentities($input[2])."</code></pre>";'),
$string);
}
}

View File

@ -4,6 +4,17 @@ class Theme {
// NEW
public static function favicon($file='favicon.png', $path=HTML_PATH_THEME_IMG, $echo=true)
{
$tmp = '<link rel="shortcut icon" href="'.$path.$file.'" type="image/x-icon">'.PHP_EOL;
if($echo) {
echo $tmp;
}
return $tmp;
}
public static function css($files, $path=HTML_PATH_THEME_CSS, $echo=true)
{
if(!is_array($files)) {
@ -109,6 +120,16 @@ class Theme {
}
}
public static function jquery($echo=true)
{
$tmp = '<script src="'.JQUERY.'"></script>'.PHP_EOL;
if($echo) {
echo $tmp;
}
return $tmp;
}
// OLD
@ -120,17 +141,8 @@ class Theme {
return BLOG_URL;
}
public static function jquery($path=JS_JQUERY)
{
$tmp = '<script src="'.$path.'"></script>'.PHP_EOL;
return $tmp;
}
public static function favicon()
{
return '<link rel="shortcut icon" href="'.HTML_THEME_CSS.'img/favicon.ico" type="image/x-icon">'.PHP_EOL;
}
public static function name()
{

View File

@ -0,0 +1,35 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
class Valid {
public static function ip($ip)
{
return filter_var($ip, FILTER_VALIDATE_IP);
}
public static function email($email)
{
return filter_var($email, FILTER_VALIDATE_EMAIL);
}
public static function int($int)
{
if($int === 0) {
return true;
}
elseif(filter_var($int, FILTER_VALIDATE_INT) === false ) {
return false;
}
return true;
}
// Thanks, http://php.net/manual/en/function.checkdate.php#113205
public static function date($date, $format='Y-m-d H:i:s')
{
$tmp = DateTime::createFromFormat($format, $date);
return $tmp && $tmp->format($format)==$date;
}
}

View File

@ -1,69 +0,0 @@
<?php
/*
* Nibbleblog -
* http://www.nibbleblog.com
* Author Diego Najar
* All Nibbleblog code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*/
class Validation {
public static function ip($ip)
{
return filter_var($ip, FILTER_VALIDATE_IP);
}
public static function mail($mail)
{
return filter_var($mail, FILTER_VALIDATE_EMAIL);
}
public static function int($int)
{
if($int === 0)
return( true );
elseif (filter_var($int, FILTER_VALIDATE_INT) === false )
return( false );
else
return( true );
}
// Remove all characters except digits
public static function sanitize_float($value)
{
return( filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_THOUSAND) );
}
// Valid an integer positive
public static function sanitize_int($value)
{
$value = (int)$value;
if($value>=0)
return $value;
else
return 0;
}
public static function sanitize_email($value)
{
return( filter_var($value, FILTER_SANITIZE_EMAIL) );
}
public static function sanitize_url($value)
{
return( filter_var($value, FILTER_SANITIZE_URL) );
}
// Convert all applicable characters to HTML entities incluye acentos
public static function sanitize_html($text)
{
return(htmlspecialchars($text, ENT_QUOTES, 'UTF-8'));
}
}
?>

View File

@ -23,8 +23,8 @@ class Login {
{
Session::set('username', $username);
Session::set('role', $role);
Session::set('fingerPrint', $this->fingerPrint());
Session::set('sessionTime', time());
Session::set('fingerPrint', $this->fingerPrint());
Session::set('sessionTime', time());
Log::set(__METHOD__.LOG_SEP.'Set fingerPrint: '.$this->fingerPrint());
}
@ -52,6 +52,9 @@ class Login {
public function verifyUser($username, $password)
{
$username = Sanitize::html($username);
$password = Sanitize::html($password);
$username = trim($username);
$password = trim($password);
@ -60,9 +63,9 @@ class Login {
return false;
}
$user = $this->dbUsers->get($username);
$user = $this->dbUsers->getDb($username);
if($user==false) {
Log::set(__METHOD__.LOG_SEP.'Username not exist: '.$username);
Log::set(__METHOD__.LOG_SEP.'Username does not exist: '.$username);
return false;
}
@ -75,7 +78,7 @@ class Login {
return true;
}
else {
Log::set(__METHOD__.LOG_SEP.'Password are differents.');
Log::set(__METHOD__.LOG_SEP.'Password incorrect.');
}
return false;

View File

@ -16,21 +16,13 @@ class Page extends fileContent
return $this->getField('title');
}
// Returns the content.
// This content is markdown parser.
// $fullContent, TRUE returns all content, if FALSE returns the first part of the content.
// $html, TRUE returns the content without satinize, FALSE otherwise.
public function content($fullContent=true, $html=true)
// Returns the content. This content is markdown parser.
// (boolean) $html, TRUE returns the content without satinize, FALSE otherwise.
public function content($html=true)
{
// This content is not sanitized.
$content = $this->getField('content');
if(!$fullContent)
{
$explode = explode(PAGE_BRAKE, $content);
$content = $explode[0];
}
if($html) {
return $content;
}
@ -38,22 +30,14 @@ class Page extends fileContent
return Sanitize::html($content);
}
// Returns the content.
// This content is not markdown parser.
// $fullContent, TRUE returns all content, if FALSE returns the first part of the content.
// $html, TRUE returns the content without satinize, FALSE otherwise.
public function contentRaw($fullContent=true, $html=true)
// Returns the content. This content is not markdown parser.
// (boolean) $raw, TRUE returns the content without sanitized, FALSE otherwise.
public function contentRaw($raw=true)
{
// This content is not sanitized.
$content = $this->getField('contentRaw');
if(!$fullContent)
{
$explode = explode(PAGE_BRAKE, $content);
$content = $explode[0];
}
if($html) {
if($raw) {
return $content;
}
@ -65,15 +49,28 @@ class Page extends fileContent
return $this->getField('description');
}
public function tags()
public function tags($returnsArray=false)
{
return $this->getField('tags');
}
global $Url;
public function tagsArray()
{
$tags = $this->getField('tags');
return explode(',', $tags);
if($returnsArray) {
if($tags==false) {
return array();
}
return $tags;
}
else {
if($tags==false) {
return false;
}
// Return string with tags separeted by comma.
return implode(', ', $tags);
}
}
public function position()
@ -81,44 +78,17 @@ class Page extends fileContent
return $this->getField('position');
}
// Returns the post date in unix timestamp format, UTC-0.
public function unixTimeCreated()
{
return $this->getField('unixTimeCreated');
}
public function unixTimeModified()
{
return $this->getField('unixTimeModified');
}
// Returns the post date according to locale settings and format settings.
public function dateCreated($format=false)
public function date($format=false)
{
if($format===false) {
return $this->getField('date');
$date = $this->getField('date');
if($format) {
// En %d %b deberia ir el formato definido por el usuario
return Date::format($date, DB_DATE_FORMAT, '%d %B');
}
$unixTimeCreated = $this->unixTimeCreated();
return Date::format($unixTimeCreated, $format);
}
public function dateModified($format=false)
{
if($format===false) {
return $this->getField('date');
}
$unixTimeModified = $this->unixTimeModified();
return Date::format($unixTimeModified, $format);
}
// Returns the time ago
public function timeago()
{
return $this->getField('timeago');
return $date;
}
// Returns the page slug.
@ -184,7 +154,8 @@ class Page extends fileContent
public function children()
{
$tmp = array();
$paths = glob(PATH_PAGES.$this->getField('key').DS.'*', GLOB_ONLYDIR);
//$paths = glob(PATH_PAGES.$this->getField('key').DS.'*', GLOB_ONLYDIR);
$paths = Filesystem::listDirectories(PATH_PAGES.$this->getField('key').DS);
foreach($paths as $path) {
array_push($tmp, basename($path));
}

View File

@ -17,7 +17,7 @@ class Parsedown
{
# ~
const version = '1.5.3';
const version = '1.5.4';
# ~
@ -107,12 +107,6 @@ class Parsedown
# ~
protected $DefinitionTypes = array(
'[' => array('Reference'),
);
# ~
protected $unmarkedBlockTypes = array(
'Code',
);
@ -169,7 +163,7 @@ class Parsedown
# ~
if (isset($CurrentBlock['incomplete']))
if (isset($CurrentBlock['continuable']))
{
$Block = $this->{'block'.$CurrentBlock['type'].'Continue'}($Line, $CurrentBlock);
@ -185,8 +179,6 @@ class Parsedown
{
$CurrentBlock = $this->{'block'.$CurrentBlock['type'].'Complete'}($CurrentBlock);
}
unset($CurrentBlock['incomplete']);
}
}
@ -226,7 +218,7 @@ class Parsedown
if (method_exists($this, 'block'.$blockType.'Continue'))
{
$Block['incomplete'] = true;
$Block['continuable'] = true;
}
$CurrentBlock = $Block;
@ -253,7 +245,7 @@ class Parsedown
# ~
if (isset($CurrentBlock['incomplete']) and method_exists($this, 'block'.$CurrentBlock['type'].'Complete'))
if (isset($CurrentBlock['continuable']) and method_exists($this, 'block'.$CurrentBlock['type'].'Complete'))
{
$CurrentBlock = $this->{'block'.$CurrentBlock['type'].'Complete'}($CurrentBlock);
}
@ -394,16 +386,16 @@ class Parsedown
protected function blockFencedCode($Line)
{
if (preg_match('/^(['.$Line['text'][0].']{3,})[ ]*([\w-]+)?[ ]*$/', $Line['text'], $matches))
if (preg_match('/^['.$Line['text'][0].']{3,}[ ]*([\w-]+)?[ ]*$/', $Line['text'], $matches))
{
$Element = array(
'name' => 'code',
'text' => '',
);
if (isset($matches[2]))
if (isset($matches[1]))
{
$class = 'language-'.$matches[2];
$class = 'language-'.$matches[1];
$Element['attributes'] = array(
'class' => $class,
@ -673,7 +665,9 @@ class Parsedown
if (preg_match('/^<(\w*)(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*(\/)?>/', $Line['text'], $matches))
{
if (in_array($matches[1], $this->textLevelElements))
$element = strtolower($matches[1]);
if (in_array($element, $this->textLevelElements))
{
return;
}
@ -987,15 +981,13 @@ class Parsedown
{
$markup = '';
$unexaminedText = $text;
# $excerpt is based on the first occurrence of a marker
$markerPosition = 0;
while ($excerpt = strpbrk($unexaminedText, $this->inlineMarkerList))
while ($excerpt = strpbrk($text, $this->inlineMarkerList))
{
$marker = $excerpt[0];
$markerPosition += strpos($unexaminedText, $marker);
$markerPosition = strpos($text, $marker);
$Excerpt = array('text' => $excerpt, 'context' => $text);
@ -1008,34 +1000,42 @@ class Parsedown
continue;
}
if (isset($Inline['position']) and $Inline['position'] > $markerPosition) # position is ahead of marker
# makes sure that the inline belongs to "our" marker
if (isset($Inline['position']) and $Inline['position'] > $markerPosition)
{
continue;
}
# sets a default inline position
if ( ! isset($Inline['position']))
{
$Inline['position'] = $markerPosition;
}
# the text that comes before the inline
$unmarkedText = substr($text, 0, $Inline['position']);
# compile the unmarked text
$markup .= $this->unmarkedText($unmarkedText);
# compile the inline
$markup .= isset($Inline['markup']) ? $Inline['markup'] : $this->element($Inline['element']);
# remove the examined text
$text = substr($text, $Inline['position'] + $Inline['extent']);
$unexaminedText = $text;
$markerPosition = 0;
continue 2;
}
$unexaminedText = substr($excerpt, 1);
# the marker does not belong to an inline
$markerPosition ++;
$unmarkedText = substr($text, 0, $markerPosition + 1);
$markup .= $this->unmarkedText($unmarkedText);
$text = substr($text, $markerPosition + 1);
}
$markup .= $this->unmarkedText($text);
@ -1476,7 +1476,7 @@ class Parsedown
return self::$instances[$name];
}
$instance = new self();
$instance = new static();
self::$instances[$name] = $instance;

View File

@ -18,42 +18,37 @@ class Post extends fileContent
// Returns the content.
// This content is markdown parser.
// $fullContent, TRUE returns all content, if FALSE returns the first part of the content.
// $html, TRUE returns the content without satinize, FALSE otherwise.
public function content($fullContent=true, $html=true)
// (boolean) $fullContent, TRUE returns all content, if FALSE returns the first part of the content.
// (boolean) $raw, TRUE returns the content without sanitized, FALSE otherwise.
public function content($fullContent=true, $raw=true)
{
// This content is not sanitized.
$content = $this->getField('content');
if(!$fullContent)
{
$explode = explode(PAGE_BRAKE, $content);
$content = $explode[0];
if(!$fullContent) {
$content = $this->getField('breakContent');
}
if($html) {
if($raw) {
return $content;
}
return Sanitize::html($content);
}
// Returns the content.
// This content is not markdown parser.
// $fullContent, TRUE returns all content, if FALSE returns the first part of the content.
// $html, TRUE returns the content without satinize, FALSE otherwise.
public function contentRaw($fullContent=true, $html=true)
public function readMore()
{
return $this->getField('readMore');
}
// Returns the content. This content is not markdown parser.
// (boolean) $raw, TRUE returns the content without sanitized, FALSE otherwise.
public function contentRaw($raw=true)
{
// This content is not sanitized.
$content = $this->getField('contentRaw');
if(!$fullContent)
{
$explode = explode(PAGE_BRAKE, $content);
$content = $explode[0];
}
if($html) {
if($raw) {
return $content;
}
@ -71,6 +66,18 @@ class Post extends fileContent
return ($this->getField('status')==='published');
}
// Returns TRUE if the post is scheduled, FALSE otherwise.
public function scheduled()
{
return ($this->getField('status')==='scheduled');
}
// Returns TRUE if the post is draft, FALSE otherwise.
public function draft()
{
return ($this->getField('status')=='draft');
}
public function username()
{
return $this->getField('username');
@ -91,46 +98,41 @@ class Post extends fileContent
return $this->getField('description');
}
public function unixTimeCreated()
// Returns the post date according to locale settings and format settings.
public function date($format=false)
{
return $this->getField('unixTimeCreated');
}
$date = $this->getField('date');
public function unixTimeModified()
{
return $this->getField('unixTimeModified');
}
public function dateCreated($format=false)
{
if($format===false) {
return $this->getField('date');
if($format) {
// En %d %b deberia ir el formato definido por el usuario
return Date::format($date, DB_DATE_FORMAT, '%d %B');
}
$unixTimeCreated = $this->unixTimeCreated();
return Date::format($unixTimeCreated, $format);
return $date;
}
public function dateModified($format=false)
public function tags($returnsArray=false)
{
if($format===false) {
return $this->getField('date');
global $Url;
$tags = $this->getField('tags');
if($returnsArray) {
if($tags==false) {
return array();
}
return $tags;
}
else {
if($tags==false) {
return false;
}
$unixTimeModified = $this->unixTimeModified();
return Date::format($unixTimeModified, $format);
}
public function timeago()
{
return $this->getField('timeago');
}
public function tags()
{
return $this->getField('tags');
// Return string with tags separeted by comma.
return implode(', ', $tags);
}
}
public function slug()

136
kernel/security.class.php Normal file
View File

@ -0,0 +1,136 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
class Security extends dbJSON
{
private $dbFields = array(
'minutesBlocked'=>5,
'numberFailuresAllowed'=>10,
'blackList'=>array()
);
function __construct()
{
parent::__construct(PATH_DATABASES.'security.php');
}
// ====================================================
// TOKEN FOR CSRF
// ====================================================
// Generate and save the token in Session.
public function generateToken()
{
$token = Text::randomText(8);
$token = sha1($token);
Session::set('token', $token);
}
// Validate the token.
public function validateToken($token)
{
$sessionToken = Session::get('token');
return ( !empty($sessionToken) && ($sessionToken===$token) );
}
// Returns the token.
public function getToken()
{
return Session::get('token');
}
public function printToken()
{
echo Session::get('token');
}
// ====================================================
// BRUTE FORCE PROTECTION
// ====================================================
public function isBlocked()
{
$ip = $this->getUserIp();
if(!isset($this->db['blackList'][$ip])) {
return false;
}
$currentTime = time();
$userBlack = $this->db['blackList'][$ip];
$numberFailures = $userBlack['numberFailures'];
$lastFailure = $userBlack['lastFailure'];
// Check if the IP is expired, then is not blocked.
if($currentTime > $lastFailure + ($this->db['minutesBlocked']*60)) {
return false;
}
// The IP has more failures than number of failures, then the IP is blocked.
if($numberFailures >= $this->db['numberFailuresAllowed']) {
Log::set(__METHOD__.LOG_SEP.'IP Blocked:'.$ip);
return true;
}
// Otherwise the IP is not blocked.
return false;
}
public function addLoginFail()
{
$ip = $this->getUserIp();
$currentTime = time();
$numberFailures = 1;
if(isset($this->db['blackList'][$ip]))
{
$userBlack = $this->db['blackList'][$ip];
$lastFailure = $userBlack['lastFailure'];
// Check if the IP is expired, then renew the number of failures.
if($currentTime <= $lastFailure + ($this->db['minutesBlocked']*60))
{
$numberFailures = $userBlack['numberFailures'];
$numberFailures = $numberFailures + 1;
}
}
$this->db['blackList'][$ip] = array('lastFailure'=>$currentTime, 'numberFailures'=>$numberFailures);
Log::set(__METHOD__.LOG_SEP.'Blacklist, IP:'.$ip.', Number of failures:'.$numberFailures);
// Save the database
if( $this->save() === false ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.');
return false;
}
return true;
}
public function getNumberFailures($ip=null)
{
if(empty($ip)) {
$ip = $this->getUserIp();
}
if(isset($this->db['blackList'][$ip])) {
$userBlack = $this->db['blackList'][$ip];
return $userBlack['numberFailures'];
}
}
public function getUserIp()
{
// User IP
if(getenv('HTTP_X_FORWARDED_FOR'))
$ip = getenv('HTTP_X_FORWARDED_FOR');
elseif(getenv('HTTP_CLIENT_IP'))
$ip = getenv('HTTP_CLIENT_IP');
else
$ip = getenv('REMOTE_ADDR');
return $ip;
}
}

View File

@ -15,10 +15,9 @@ class Url
// Decodes any %## encoding in the given string. Plus symbols ('+') are decoded to a space character.
$decode = urldecode($_SERVER['REQUEST_URI']);
// Parse, http://php.net/parse_url
$parse = parse_url($decode);
$this->uri = $parse['path'];
// remove parameters GET, do not use parse_url because has problem with utf-8.
$explode = explode('?', $decode);
$this->uri = $explode[0];
$this->parameters = $_GET;
@ -101,9 +100,15 @@ class Url
}
// Return the filter used
public function filters($type)
public function filters($type, $trim=true)
{
return $this->filters[$type];
$filter = $this->filters[$type];
if($trim) {
$filter = trim($filter, '/');
}
return $filter;
}
// Return: home, tag, post

148
languages/cs_CZ.json Normal file
View File

@ -0,0 +1,148 @@
{
"language-data":
{
"native": "Czech (Czech Republik)",
"english-name": "Czech",
"last-update": "2015-06-14",
"author": "honigp",
"email": "honigp@seznam.cz",
"website": "honigp.cz"
},
"username": "Jméno",
"password": "Heslo",
"confirm-password": "Heslo znovu",
"editor": "Editor",
"dashboard": "Nástěnka",
"role": "Úroveň",
"post": "Zveřejnit",
"posts": "Počet příspěvků",
"users": "Počet uživatelů",
"administrator": "Administrátor",
"add": "Přidat",
"cancel": "Zrušit",
"content": "Obsah",
"title": "Nadpis",
"no-parent": "Bez zdroje",
"edit-page": "Upravit stránku",
"edit-post": "Upravit příspěvek",
"add-a-new-user": "Přidání nového uživatele",
"parent": "Zdroj",
"friendly-url": "Pěkné URL",
"description": "Popis",
"posted-by": "Přidat",
"tags": "Štítky",
"position": "Umístit",
"save": "Uložit",
"draft": "Návrh",
"delete": "Smazat",
"registered": "Registrace",
"Notifications": "Oznámení",
"profile": "Profil",
"email": "Email",
"settings": "Nastavení",
"general": "Obecné",
"advanced": "Pokročilé",
"regional": "Region",
"about": "O systému",
"login": "Přihlásit",
"logout": "Odhlásit",
"manage": "Správa obsahu",
"themes": "Motiv",
"prev-page": "Předchozí stránka",
"next-page": "Následující stránka",
"configure-plugin": "nastavení pluginů",
"confirm-delete-this-action-cannot-be-undone": "Potvrdit odstranění,tato akce nelze vrátit zpět.",
"site-title": "Název webu",
"site-slogan": "Slogan webu",
"site-description": "Popis webu",
"footer-text": "Patička text",
"posts-per-page": "Příspěvků na stránku",
"site-url": "Adresa webu",
"writting-settings": "Nastavení psaní",
"url-filters": "URL filtr",
"page": "Stránka",
"pages": "Stránky",
"home": "Domů",
"welcome-back": "Vítejte",
"language": "Jazyk",
"website": "Stránka",
"timezone": "Časová zóna",
"locale": "Místní",
"new-post": "Nový příspěvek",
"html-and-markdown-code-supported": "Podpora HTML a Markdown",
"new-page": "Nová stránka",
"manage-posts": "Správa příspěvků",
"published-date": "Publikováno",
"modified-date": "Datum úpravy",
"empty-title": "Prázdný titul",
"plugins": "Pluginy",
"install-plugin": "Instalovat plugin",
"uninstall-plugin": "Odinstalovat plugin",
"new-password": "Nové heslo",
"edit-user": "Upravit uživatele",
"publish-now": "Publikovat nyní",
"first-name": "Jméno",
"last-name": "Příjmení",
"bludit-version": "Bludit verze",
"powered-by": "Powered by",
"recent-posts": "Poslední příspěvky",
"manage-pages": "Správa stránek",
"advanced-options": "Pokročilé možnosti",
"user-deleted": "Uživatel smazán",
"page-added-successfully": "Stránka přidána",
"post-added-successfully": "Příspěvek přidán",
"the-post-has-been-deleted-successfully": "Příspěvek byl úspěšně smazán",
"the-page-has-been-deleted-successfully": "Stránka byla úspěšně smazána",
"username-or-password-incorrect": "Uživatelské jméno nebo heslo není správné",
"database-regenerated": "Databáze regeneruje",
"the-changes-have-been-saved": "Změny byly uloženy",
"enable-more-features-at": "Další funkce na",
"username-already-exists": "Uživatelské jméno již existuje",
"username-field-is-empty": "Uživatelské jméno je prázdné",
"the-password-and-confirmation-password-do-not-match":"Heslo a potvrzení hesla se neshodují",
"user-has-been-added-successfully": "Uživatel byl úspěšně přidán",
"you-do-not-have-sufficient-permissions": "Nemáte dostatečná oprávnění pro přístup k této stránce, obraťte se na správce.",
"settings-advanced-writting-settings": "Nastavení->Pokročilé->Nastavení psaní",
"new-posts-and-pages-synchronized": "Nové příspěvky a stránky synchronizované.",
"you-can-choose-the-users-privilege": "Můžete si vybrat oprávnění uživatele.Editor může jen psát stránky a příspěvky.",
"email-will-not-be-publicly-displayed": "E-mail nebude veřejně zobrazen. Doporučuje se heslo pro obnovení a oznámení.",
"use-this-field-to-name-your-site": "V tomto poli lze pojmenovat vaše stránky, zobrazí se v horní části každé stránky vašeho webu.",
"use-this-field-to-add-a-catchy-prhase": "Pomocí tohoto pole přidejte chytlavý slogan na vašem webu.",
"you-can-add-a-site-description-to-provide": "Můžete přidat popis webu nebo krátký životopis.",
"you-can-add-a-small-text-on-the-bottom": "Můžete přidat text v patičce každé stránky. např: autorská práva, vlastník, data, atd",
"number-of-posts-to-show-per-page": "Počet příspěvků na stránce.",
"the-url-of-your-site": "Adresa URL vašich stránek.",
"add-or-edit-description-tags-or": "Přidat nebo upravit popis,značky,pěkné URL.",
"select-your-sites-language": "Vyberte jazyk svých stránek.",
"select-a-timezone-for-a-correct": "Vyberte časové pásmo pro správné zobrazení data / času na vašem webu.",
"you-can-use-this-field-to-define-a-set-of": "Můžete použít toto pole pro definování parametrů souvisejících s jazykem a zemí.",
"you-can-modify-the-url-which-identifies":"Můžete upravit adresu URL, která identifikuje stránku. Ne víc než 150 znaků.",
"this-field-can-help-describe-the-content": "Zde můžete napsat obsah několika slovy. Ne víc než 150 znaků.",
"write-the-tags-separeted-by-comma": "Napište štítky oddělené čárkou. např: štítek1, štítek2, štítek3",
"delete-the-user-and-all-its-posts":"Odstranit uživatele a všechny jeho příspěvky",
"delete-the-user-and-associate-its-posts-to-admin-user": "Odstranit uživatele a spojit své příspěvky na uživatele admin",
"read-more": "Čtěte více",
"show-blog": "Zobrazit blog",
"default-home-page": "Výchozí domovská stránka",
"version": "Verze",
"there-are-no-drafts": "Nejsou k dispozici žádné návrhy.",
"create-a-new-article-for-your-blog":"Vytvořte nový článek pro váš blog.",
"create-a-new-page-for-your-website":"Vytvořte novou stránku pro vaše webové stránky.",
"invite-a-friend-to-collaborate-on-your-website":"Pozvěte přátele ke spolupráci na svých webových stránkách.",
"change-your-language-and-region-settings":"Změna nastavení jazyka a regionu.",
"language-and-timezone":"Jazyk a časová zóna",
"author": "Autor",
"start-here": "Začněte zde",
"install-theme": "Instalovat motiv",
"first-post": "První příspěvek",
"congratulations-you-have-successfully-installed-your-bludit": "Blahopřejeme právě jste nainstalovaly **Bludit**",
"whats-next": "Kam dál",
"manage-your-bludit-from-the-admin-panel": "Správa vašeho webu [admin area](./admin/)",
"follow-bludit-on": "Follow Bludit on",
"visit-the-support-forum": "Navštivte [forum](http://forum.bludit.com) fórum",
"read-the-documentation-for-more-information": "Čtětě [documentation](http://docs.bludit.com) více informaví",
"share-with-your-friends-and-enjoy": "Podělte se se svými přáteli a užívejte si",
"the-page-has-not-been-found": "Stránka nenalezena.",
"error": "Error"
}

166
languages/de_DE.json Normal file
View File

@ -0,0 +1,166 @@
{
"language-data":
{
"native": "Deutsch (Deutschland)",
"english-name": "German",
"last-update": "2015-09-22",
"author": "Edi",
"email": "egoetschel@clickwork.ch",
"website": "http://www.clickwork.ch"
},
"username": "Benutzername",
"password": "Passwort",
"confirm-password": "Passwort wiederholen",
"editor": "Editor",
"dashboard": "Dashboard",
"role": "Rolle",
"post": "Beitrag",
"posts": "Beiträge",
"users": "Benutzer",
"administrator": "Administrator",
"add": "Hinzufügen",
"cancel": "Abbrechen",
"content": "Inhalt",
"title": "Titel",
"no-parent": "Keine übergeordnete Seite",
"edit-page": "Seite bearbeiten",
"edit-post": "Beitrag bearbeiten",
"add-a-new-user": "Neuer Benutzer",
"parent": "Übergeordnete Seite",
"friendly-url": "Pretty URL",
"description": "Beschreibung",
"posted-by": "Veröffentlicht von",
"tags": "Schlagwörter",
"position": "Position",
"save": "Speichern",
"draft": "Entwurf",
"delete": "Löschen",
"registered": "Hinzugefügt",
"Notifications": "Benachrichtigungen",
"profile": "Profil",
"email": "E-Mail",
"settings": "Einstellungen",
"general": "Allgemein",
"advanced": "Erweitert",
"regional": "Lokalisierung",
"about": "Systeminformation",
"login": "Anmelden",
"logout": "Abmelden",
"manage": "Verwaltung",
"themes": "Themes",
"prev-page": "Vorhergehende Seite",
"next-page": "Nächste Seite",
"configure-plugin": "Plugin konfigurieren",
"confirm-delete-this-action-cannot-be-undone": "Bestätige das Löschen, dieser Vorgang kann nicht rückgängig gemacht werden.",
"site-title": "Titel der Webseite",
"site-slogan": "Untertitel",
"site-description": "Informationen zur Website",
"footer-text": "Footer-Text",
"posts-per-page": "Beiträge pro Seite",
"site-url": "URL der Website",
"writting-settings": "Beitrags- und Seiteneinstellungen",
"url-filters": "URL-Erweiterungen",
"page": "Seite",
"pages": "Seiten",
"home": "Hauptseite",
"welcome-back": "Willkommen",
"language": "Sprache",
"website": "Zur Website",
"timezone": "Zeitzone",
"locale": "Locale",
"new-post": "Neuer Beitrag",
"html-and-markdown-code-supported": "HTML und Markdown werden unterstützt",
"new-page": "Neue Seite",
"manage-posts": "Beiträge verwalten",
"published-date": "Veröffentlicht",
"modified-date": "Letzte Änderung",
"empty-title": "Kein Titel",
"plugins": "Plugins",
"install-plugin": "Plugin installieren",
"uninstall-plugin": "Plugin deinstallieren",
"new-password": "Neues Passwort",
"edit-user": "Benutzer bearbeiten",
"publish-now": "Veröffentlichen",
"first-name": "Vorname",
"last-name": "Nachname",
"bludit-version": "Bludit Version",
"powered-by": "Diese Website wurde eingerichtet mit",
"recent-posts": "Neueste Beiträge",
"manage-pages": "Seiten verwalten",
"advanced-options": "Erweiterte Einstellungen",
"user-deleted": "Der Benutzer wurde gelöscht.",
"page-added-successfully": "Die Seite wurde veröffentlicht.",
"post-added-successfully": "Der Veitrag wurde veröffentlicht.",
"the-post-has-been-deleted-successfully": "Der Beitrag wurde gelöscht.",
"the-page-has-been-deleted-successfully": "Die Seite wurde gelöscht.",
"username-or-password-incorrect": "Der Benutzername oder das Passwort ist falsch.",
"database-regenerated": "Die Datenbank wurde neu aufgebaut.",
"the-changes-have-been-saved": "Die Änderungen wurden gespeichert.",
"enable-more-features-at": "Zusätzlich Felder können aktiviert werden unter",
"username-already-exists": "Diesen Benutzernamen gibt es bereits.",
"username-field-is-empty": "Es muss ein Benutzername eingegeben werden.",
"the-password-and-confirmation-password-do-not-match":"Die eingegebenen Passwörter stimmen nicht überein.",
"user-has-been-added-successfully": "Der Benutzer wurde hinzugefügt.",
"you-do-not-have-sufficient-permissions": "Du bist nicht berechtigt, die Seite aufzurufen.",
"settings-advanced-writting-settings": "Einstellungen > Erweitert > Beitrags- und Seiteneinstellungen",
"new-posts-and-pages-synchronized": "Neue Beiträge und Seiten wurden synchronisiert.",
"you-can-choose-the-users-privilege": "Rechte des Benutzers. Ein Editor kann nur Seiten anlegen und Beiträge schreiben.",
"email-will-not-be-publicly-displayed": "Die E-Mail wird nicht öffentlich gezeigt. Sie wird für die Wiederherstellung des Passworts und Benachrichtigungen verwendet.",
"use-this-field-to-name-your-site": "Name der Website, wie er auf jeder Seite angezeigt wird.",
"use-this-field-to-add-a-catchy-phrase": "Untertitel oder Slogan der Website.",
"you-can-add-a-site-description-to-provide": "Kurze Beschreibung der Website für Suchmaschinen.",
"you-can-add-a-small-text-on-the-bottom": "Text im Fussbereich jeder Seite. Beispielsweise: Copyright-Hinweis, Eigentümer der Website usw.",
"number-of-posts-to-show-per-page": "Anzahl der Beiträge, die auf einer Seite gezeigt werden.",
"the-url-of-your-site": "URL der Website.",
"add-or-edit-description-tags-or": "Beschreibungen, Schlagwörter und Pretty URL hinzufügen oder ändern.",
"select-your-sites-language": "Sprache der Website.",
"select-a-timezone-for-a-correct": "Zeitzone für die richtige Anzeige des Datums und der Zeit auf der Website.",
"you-can-use-this-field-to-define-a-set-of": "Parameter mit Bezug auf die verwendete Sprache und das Land. Beispielsweise: de_DE, de_CH usw.",
"you-can-modify-the-url-which-identifies":"Der URL kann selbst angepasst werden. Möglich sind höchstens 150 Zeichen.",
"this-field-can-help-describe-the-content": "Kurze Inhaltsbeschreibung. Möglich sind höchstens 150 Zeichen.",
"write-the-tags-separeted-by-comma": "Schlagwörter getrennt durch Kommas. Beispielsweise: Schlagwort1, Schlagwort2, Schlagwort3",
"delete-the-user-and-all-its-posts":"Benutzer und alle seine Beiträge löschen",
"delete-the-user-and-associate-its-posts-to-admin-user": "Benutzer löschen und seine Beiträge dem Administrator zuordnen",
"read-more": "Weiterlesen",
"show-blog": "Blog zeigen",
"default-home-page": "Hauptseite",
"version": "Version",
"there-are-no-drafts": "Es sind keine Entwürfe vorhanden.",
"create-a-new-article-for-your-blog": "Einen neuen Beitrag schreiben.",
"create-a-new-page-for-your-website": "Eine neue Seite anlegen.",
"invite-a-friend-to-collaborate-on-your-website": "Einen neuen Benutzer hinzufügen.",
"change-your-language-and-region-settings": "Sprache ändern und Lokalisierung.",
"language-and-timezone": "Sprache und Zeitzone",
"author": "Autor",
"start-here": "Direktzugriff",
"install-theme": "Theme installieren",
"first-post": "Erster Beitrag",
"congratulations-you-have-successfully-installed-your-bludit": "Gratulation, Du hast **Bludit** erfolgreich installiert!",
"whats-next": "Und so geht es weiter:",
"manage-your-bludit-from-the-admin-panel": "Verwalte Bludit im [Administrationsbereich](./admin/).",
"follow-bludit-on": "Folge Bludit bei",
"visit-the-support-forum": "Besuche das [Forum](http://forum.bludit.com), um Hilfe zu erhalten.",
"read-the-documentation-for-more-information": "Lies die [Dokumentation](http://docs.bludit.com) für weitere Informationen.",
"share-with-your-friends-and-enjoy": "Erzähle Deinen Freunden Bludit und habe Spass daran.",
"the-page-has-not-been-found": "Die Seite wurde nicht gefunden.",
"error": "Fehler",
"bludit-installer": "Bludit-Installer",
"welcome-to-the-bludit-installer": "Willkommen beim Bludit-Installer!",
"complete-the-form-choose-a-password-for-the-username-admin": "Bitte ein Passwort für den Benutzer « admin » wählen<br>und eine E-Mail-Adresse eingeben.",
"password-visible-field": "Das Passwort wird in Klartext angezeigt!",
"install": "Installieren",
"choose-your-language": "Sprache wählen",
"next": "Weiter",
"the-password-field-is-empty": "Das Passwort-Feld ist leer.",
"your-email-address-is-invalid": "Die E-Mail-Adresse scheint ungültig zu sein.",
"proceed-anyway": "Trotzdem fortfahren...",
"drafts": "Entwürfe",
"ip-address-has-been-blocked": "Die IP-Adresse wurde blockiert.",
"try-again-in-a-few-minutes": "Bitte es nach einigen Minuten noch einmal versuchen.",
"date": "Datum",
"you-can-schedule-the-post-just-select-the-date-and-time": "Um den Beitrag zu einem bestimmten Zeitpunkt zu veröffentlichen, Datum und Zeit wählen.",
"scheduled": "Zeitpunkt bestimmt.",
"publish": "Veröffentlichen",
"please-check-your-theme-configuration": "Bitte die Einstellungen des Themes prüfen."
}

View File

@ -1,7 +1,7 @@
{
"language-data":
{
"native": "English (United State)",
"native": "English (United States)",
"english-name": "English",
"last-update": "2015-06-28",
"author": "Diego",
@ -9,101 +9,159 @@
"website": ""
},
"username": "Username",
"password": "Password",
"confirm-password": "Confirm Password",
"editor": "Editor",
"dashboard": "Dashboard",
"role": "Role",
"posts": "Posts",
"users": "Users",
"administrator": "Administrator",
"add": "Add",
"cancel": "Cancel",
"content": "Content",
"title": "Title",
"no-parent": "No parent",
"edit-page": "Edit page",
"edit-post": "Edit post",
"add-a-new-user": "Add a new user",
"parent": "Parent",
"friendly-url": "Friendly URL",
"description": "Description",
"posted-by": "Posted by",
"tags": "Tags",
"position": "Position",
"save": "Save",
"draft": "Draft",
"delete": "Delete",
"registered": "Registered",
"Notifications": "Notifications",
"profile": "Profile",
"email": "Email",
"settings": "Settings",
"general": "General",
"advanced": "Advanced",
"regional": "Regional",
"about": "About",
"login": "Log in",
"logout": "Log out",
"dasbhoard": "Dasbhoard",
"manage": "Manage",
"themes": "Themes",
"configure-plugin": "Configure plugin",
"confirm-delete-this-action-cannot-be-undone": "Confirm delete, this action cannot be undone.",
"site-title": "Site title",
"site-slogan": "Site slogan",
"site-description": "Site description",
"footer-text": "Footer text",
"posts-per-page": "Posts per page",
"site-url": "Site url",
"writting-settings": "Writting settings",
"url-filters": "URL filters",
"pages": "Pages",
"home": "Home",
"welcome-back": "Welcome back",
"language": "Language",
"website": "Website",
"timezone": "Timezone",
"locale": "Locale",
"notifications": "Notifications",
"new-post": "New post",
"html-and-markdown-code-supported": "HTML and Markdown code supported",
"new-page": "New page",
"manage-posts": "Manage posts",
"published-date": "Published date",
"modified-date": "Modified date",
"empty-title": "Empty title",
"plugins": "Plugins",
"install-plugin": "Install plugin",
"uninstall-plugin": "Uninstall plugin",
"new-password": "New password",
"edit-user": "Edit user",
"publish-now": "Publish now",
"first-name": "First name",
"last-name": "Last name",
"manage-pages": "Manage pages",
"advanced-options": "Advanced options",
"database-regenerated": "Database regenerated",
"html-markdown-code-supported": "HTML and Markdown code supported.",
"enable-more-features-at": "Enable more features at",
"settings-advanced-writting-settings": "Settings->Advanced->Writting Settings",
"new-posts-and-pages-synchronized": "New posts and pages synchronized.",
"you-can-choose-the-users-privilege": "You can choose the user's privilege. The editor role only can write pages and posts.",
"email-will-not-be-publicly-displayed": "Email will not be publicly displayed. Recommended for recovery password and notifications.",
"use-this-field-to-name-your-site": "Use this field to name your site, it will appear at the top of every page of your site.",
"use-this-field-to-add-a-catchy-prhase": "Use this field to add a catchy prhase on your site.",
"you-can-add-a-site-description-to-provide": "You can add a site description to provide a short bio or description of your site.",
"you-can-add-a-small-text-on-the-bottom": "You can add a small text on the bottom of every page. eg: copyright, owner, dates, etc.",
"number-of-posts-to-show-per-page": "Number of posts to show per page.",
"the-url-of-your-site": "The URL of your site.",
"add-or-edit-description-tags-or": "Add or edit description, tags or modify the friendly URL.",
"select-your-sites-language": "Select your site's language.",
"select-a-timezone-for-a-correct": "Select a timezone for a correct date/time display on your site.",
"you-can-use-this-field-to-define-a-set-of": "You can use this field to define a set of parameters related to the languege, country and special preferences.",
"email": "Email",
"email": "Email",
"email": "Email",
"email": "Email",
"email": "Email"
"username": "Username",
"password": "Password",
"confirm-password": "Confirm Password",
"editor": "Editor",
"dashboard": "Dashboard",
"role": "Role",
"post": "Post",
"posts": "Posts",
"users": "Users",
"administrator": "Administrator",
"add": "Add",
"cancel": "Cancel",
"content": "Content",
"title": "Title",
"no-parent": "No parent",
"edit-page": "Edit page",
"edit-post": "Edit post",
"add-a-new-user": "Add a new user",
"parent": "Parent",
"friendly-url": "Friendly URL",
"description": "Description",
"posted-by": "Posted by",
"tags": "Tags",
"position": "Position",
"save": "Save",
"draft": "Draft",
"delete": "Delete",
"registered": "Registered",
"Notifications": "Notifications",
"profile": "Profile",
"email": "Email",
"settings": "Settings",
"general": "General",
"advanced": "Advanced",
"regional": "Regional",
"about": "About",
"login": "Log in",
"logout": "Log out",
"manage": "Manage",
"themes": "Themes",
"prev-page": "Prev page",
"next-page": "Next page",
"configure-plugin": "Configure plugin",
"confirm-delete-this-action-cannot-be-undone": "Confirm delete, this action cannot be undone.",
"site-title": "Site title",
"site-slogan": "Site slogan",
"site-description": "Site description",
"footer-text": "Footer text",
"posts-per-page": "Posts per page",
"site-url": "Site url",
"writting-settings": "Writting settings",
"url-filters": "URL filters",
"page": "Page",
"pages": "Pages",
"home": "Home",
"welcome-back": "Welcome back",
"language": "Language",
"website": "Website",
"timezone": "Timezone",
"locale": "Locale",
"new-post": "New post",
"html-and-markdown-code-supported": "HTML and Markdown code supported",
"new-page": "New page",
"manage-posts": "Manage posts",
"published-date": "Published date",
"modified-date": "Modified date",
"empty-title": "Empty title",
"plugins": "Plugins",
"install-plugin": "Install plugin",
"uninstall-plugin": "Uninstall plugin",
"new-password": "New password",
"edit-user": "Edit user",
"publish-now": "Publish now",
"first-name": "First name",
"last-name": "Last name",
"bludit-version": "Bludit version",
"powered-by": "Powered by",
"recent-posts": "Recent Posts",
"manage-pages": "Manage pages",
"advanced-options": "Advanced options",
"user-deleted": "User deleted",
"page-added-successfully": "Page added successfully",
"post-added-successfully": "Post added successfully",
"the-post-has-been-deleted-successfully": "The post has been deleted successfully",
"the-page-has-been-deleted-successfully": "The page has been deleted successfully",
"username-or-password-incorrect": "Username or password incorrect",
"database-regenerated": "Database regenerated",
"the-changes-have-been-saved": "The changes have been saved",
"enable-more-features-at": "Enable more features at",
"username-already-exists": "Username already exists",
"username-field-is-empty": "Username field is empty",
"the-password-and-confirmation-password-do-not-match":"The password and confirmation password do not match",
"user-has-been-added-successfully": "User has been added successfully",
"you-do-not-have-sufficient-permissions": "You do not have sufficient permissions to access this page, contact the administrator.",
"settings-advanced-writting-settings": "Settings->Advanced->Writting Settings",
"new-posts-and-pages-synchronized": "New posts and pages synchronized.",
"you-can-choose-the-users-privilege": "You can choose the user's privilege. The editor role only can write pages and posts.",
"email-will-not-be-publicly-displayed": "Email will not be publicly displayed. Recommended for recovery password and notifications.",
"use-this-field-to-name-your-site": "Use this field to name your site, it will appear at the top of every page of your site.",
"use-this-field-to-add-a-catchy-phrase": "Use this field to add a catchy phrase on your site.",
"you-can-add-a-site-description-to-provide": "You can add a site description to provide a short bio or description of your site.",
"you-can-add-a-small-text-on-the-bottom": "You can add a small text on the bottom of every page. eg: copyright, owner, dates, etc.",
"number-of-posts-to-show-per-page": "Number of posts to show per page.",
"the-url-of-your-site": "The URL of your site.",
"add-or-edit-description-tags-or": "Add or edit description, tags or modify the friendly URL.",
"select-your-sites-language": "Select your site's language.",
"select-a-timezone-for-a-correct": "Select a timezone for a correct date/time display on your site.",
"you-can-use-this-field-to-define-a-set-of": "You can use this field to define a set of parameters related to the languege, country and special preferences.",
"you-can-modify-the-url-which-identifies":"You can modify the URL which identifies a page or post using human-readable keywords. No more than 150 characters.",
"this-field-can-help-describe-the-content": "This field can help describe the content in a few words. No more than 150 characters.",
"write-the-tags-separeted-by-comma": "Write the tags separeted by comma. eg: tag1, tag2, tag3",
"delete-the-user-and-all-its-posts":"Delete the user and all its posts",
"delete-the-user-and-associate-its-posts-to-admin-user": "Delete the user and associate its posts to admin user",
"read-more": "Read more",
"show-blog": "Show blog",
"default-home-page": "Default home page",
"version": "Version",
"there-are-no-drafts": "There are no drafts.",
"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",
"start-here": "Start here",
"install-theme": "Install theme",
"first-post": "First post",
"congratulations-you-have-successfully-installed-your-bludit": "Congratulations you have successfully installed your **Bludit**",
"whats-next": "What's Next",
"manage-your-bludit-from-the-admin-panel": "Manage your Bludit from the [admin area](./admin/)",
"follow-bludit-on": "Follow Bludit on",
"visit-the-support-forum": "Visit the [forum](http://forum.bludit.com) for support",
"read-the-documentation-for-more-information": "Read the [documentation](http://docs.bludit.com) for more information",
"share-with-your-friends-and-enjoy": "Share with your friends and enjoy",
"the-page-has-not-been-found": "The page has not been found.",
"error": "Error",
"bludit-installer": "Bludit Installer",
"welcome-to-the-bludit-installer": "Welcome to the Bludit installer",
"complete-the-form-choose-a-password-for-the-username-admin": "Complete the form, choose a password for the username « admin »",
"password-visible-field": "Password, visible field!",
"install": "Install",
"choose-your-language": "Choose your language",
"next": "Next",
"the-password-field-is-empty": "The password field is empty",
"your-email-address-is-invalid":"Your email address is invalid.",
"proceed-anyway": "Proceed anyway!",
"drafts":"Drafts",
"ip-address-has-been-blocked": "IP address has been blocked.",
"try-again-in-a-few-minutes": "Try again in a few minutes.",
"date": "Date",
"you-can-schedule-the-post-just-select-the-date-and-time": "You can schedule the post, just select the date and time.",
"scheduled": "Scheduled",
"publish": "Publish",
"please-check-your-theme-configuration": "Please check your theme configuration.",
"plugin-label": "Plugin label"
}

View File

@ -3,11 +3,157 @@
{
"native": "Español (Argentina)",
"english-name": "Spanish",
"last-update": "2015-06-28",
"last-update": "2015-08-16",
"author": "Diego",
"email": "",
"website": ""
},
"test":"test"
"username": "Nombre de usuario",
"password": "Contraseña",
"confirm-password": "Confirmar contraseña",
"editor": "Editor",
"dashboard": "Panel",
"role": "Rol",
"post": "Post",
"posts": "Posts",
"users": "Usuarios",
"administrator": "Administrador",
"add": "Agregar",
"cancel": "Cancel",
"content": "Contenido",
"title": "Titulo",
"no-parent": "Sin padre",
"edit-page": "Editar página",
"edit-post": "Editar post",
"add-a-new-user": "Agregar nuevo usuario",
"parent": "Padre",
"friendly-url": "URL Amistosa",
"description": "Descripción",
"posted-by": "Publicado por",
"tags": "Etiquetas",
"position": "Posición",
"save": "Guardar",
"draft": "Borrador",
"delete": "Eliminar",
"registered": "Registrado",
"Notifications": "Notificaciones",
"profile": "Perfil",
"email": "Correo electrónico",
"settings": "Ajustes",
"general": "General",
"advanced": "Avanzado",
"regional": "Regional",
"about": "Acerca de",
"login": "Iniciar sesión",
"logout": "Cerrar sesión",
"manage": "Administrar",
"themes": "Temas",
"prev-page": "Pag. anterior",
"next-page": "Pag. siguiente",
"configure-plugin": "Configurar plugin",
"confirm-delete-this-action-cannot-be-undone": "Confirmar eliminación, esta operación no se puede deshacer.",
"site-title": "Titulo del sitio",
"site-slogan": "Slogan del sitio",
"site-description": "Descripción del sitio",
"footer-text": "Texto de pie de página",
"posts-per-page": "Posts por página",
"site-url": "URL del sitio",
"writting-settings": "Ajustes de redacción",
"url-filters": "Filtros URL",
"page": "página",
"pages": "páginas",
"home": "Inicio",
"welcome-back": "Bienvenido",
"language": "Lenguaje",
"website": "Sitio web",
"timezone": "Zona horaria",
"locale": "Locale",
"new-post": "Nuevo post",
"new-page": "Nueva página",
"html-and-markdown-code-supported": "Código HTML y Markdown soportado",
"manage-posts": "Administrar posts",
"published-date": "Fecha de publicación",
"modified-date": "Fecha de modificación",
"empty-title": "Titulo vacío",
"plugins": "Plugins",
"install-plugin": "Instalar plugin",
"uninstall-plugin": "Desinstalar plugin",
"new-password": "Nueva contraseña",
"edit-user": "Editar usuario",
"publish-now": "Publicar",
"first-name": "Nombre",
"last-name": "Apellido",
"bludit-version": "Bludit versión",
"powered-by": "Corriendo con",
"recent-posts": "Posts recientes",
"manage-pages": "Administrar páginas",
"advanced-options": "Opciones avanzadas",
"user-deleted": "Usuario eliminado",
"page-added-successfully": "Página agregada con éxito",
"post-added-successfully": "Post agregado con éxito ",
"the-post-has-been-deleted-successfully": "El post fue eliminado con éxito",
"the-page-has-been-deleted-successfully": "La página fue eliminada con éxito",
"username-or-password-incorrect": "Nombre de usuario o contraseña incorrectos",
"database-regenerated": "Base de datos regenerada",
"the-changes-have-been-saved": "Los cambios fueron guardados",
"enable-more-features-at": "Habilitar más funciones en",
"username-already-exists": "El nombre de usuario ya existe",
"username-field-is-empty": "El campo nombre de usuario esta vacío",
"the-password-and-confirmation-password-do-not-match": "Las contraseña no coinciden",
"user-has-been-added-successfully": "El usuario fue creado con éxito",
"you-do-not-have-sufficient-permissions": "No tiene suficientes permisos para acceder a esta página, contacte al administrador.",
"settings-advanced-writting-settings": "Ajustes->Avanzado->Ajustes de redacción",
"new-posts-and-pages-synchronized": "Nuevos posts y páginas sincronizados.",
"you-can-choose-the-users-privilege": "Puede elegir los privilegios del usuario. El rol editor solo puede redactar páginas y post.",
"email-will-not-be-publicly-displayed": "El correo electrónico no será visible. Recomendado para recuperar la contraseña y notificaciones.",
"use-this-field-to-name-your-site": "Utilice este campo para nombrar su sitio, aparecerá en la parte superior de cada página de su sitio.",
"use-this-field-to-add-a-catchy-phrase": "Utilice este campo para agregar un slogan a su sitio.",
"you-can-add-a-site-description-to-provide": "Puede agregar una descripción del sitio para proporcionar una breve biografía o descripción de su sitio.",
"you-can-add-a-small-text-on-the-bottom": "Puede agregar un pequeño texto en el pie de página. ej: copyright, autor, fechas, etc.",
"number-of-posts-to-show-per-page": "Numero de posts a mostrar por página.",
"the-url-of-your-site": "URL de su sitio.",
"add-or-edit-description-tags-or": "Agregar o editar la descripción, tags y modificar la URL amigable.",
"select-your-sites-language": "Seleccione el lenguaje de su sitio.",
"select-a-timezone-for-a-correct": "Seleccione la zona horaria para una correcta visualización de las fechas.",
"you-can-use-this-field-to-define-a-set-of": "Puede utilizar este campo para definir un conjunto de parámetros relacionados con el idioma, país y preferencias especiales.",
"you-can-modify-the-url-which-identifies": "Puede modificar la dirección URL que identifica una página o post usando palabras clave legible. No mas de 150 caracteres.",
"this-field-can-help-describe-the-content": "Este campo puede ayudar a describir el contenido en pocas palabras. No mas de 150 caracteres.",
"write-the-tags-separeted-by-comma": "Escribir los tags separados por comas. ej: tag1, tag2, tag3",
"delete-the-user-and-all-its-posts": "Eliminar el usuario y sus posts",
"delete-the-user-and-associate-its-posts-to-admin-user": "Eliminar el usuario y asociar los posts al usuario admin",
"read-more": "Leer mas",
"show-blog": "Mostrar blog",
"default-home-page": "página de inicio predeterminada",
"version": "Version",
"there-are-no-drafts": "No hay borradores.",
"create-a-new-article-for-your-blog":"Crear un nuevo articulo para su blog.",
"create-a-new-page-for-your-website":"Crear una nueva página para su sitio web.",
"invite-a-friend-to-collaborate-on-your-website":"Invite a un amigo para colaborar en el sitio web.",
"change-your-language-and-region-settings":"Cambiar la configuración de idioma y región.",
"language-and-timezone":"Lenguage y zona horaria",
"author": "Autor",
"start-here": "Comience aquí",
"install-theme": "Instalar tema",
"first-post": "Primer post",
"congratulations-you-have-successfully-installed-your-bludit": "Felicitación, usted ha instalado **Bludit** exitosamente",
"whats-next": "Siguientes pasos",
"manage-your-bludit-from-the-admin-panel": "Administre su Bludit desde el [panel de administración](./admin/)",
"follow-bludit-on": "Siga Bludit en",
"visit-the-support-forum": "Visite el [foro](http://forum.bludit.com) para soporte",
"read-the-documentation-for-more-information": "Lea la [documentación](http://docs.bludit.com) para mas información",
"share-with-your-friends-and-enjoy": "Compartí con tus amigos y a disfrutar",
"the-page-has-not-been-found": "La página no fue encontrada.",
"error": "Error",
"bludit-installer": "Bludit Instalador",
"welcome-to-the-bludit-installer": "Bienvenido al asistente para la instalación de Bludit",
"complete-the-form-choose-a-password-for-the-username-admin": "Complete el formulario y elija una contraseña para el usuario « admin »",
"password-visible-field": "Contraseña, este campo es visible!",
"install": "Instalar",
"the-password-field-is-empty": "Debe completar el campo contraseña",
"your-email-address-is-invalid":"Su dirección de correo es invalida.",
"proceed-anyway": "Continuar de todas formas!",
"drafts":"Borradores",
"ip-address-has-been-blocked":"La direccion IP fue bloqueada.",
"try-again-in-a-few-minutes": "Vuelva a intentar en unos minutos."
}

159
languages/es_ES.json Normal file
View File

@ -0,0 +1,159 @@
{
"language-data":
{
"native": "Español (España)",
"english-name": "Spanish",
"last-update": "2015-08-28",
"author": "Tak-MK",
"email": "snavarrotd {at} gmail {dot} com",
"website": "http://sevendats.com"
},
"username": "Nombre de usuario",
"password": "Contraseña",
"confirm-password": "Confirmar contraseña",
"editor": "Editor",
"dashboard": "Panel",
"role": "Rol",
"post": "Post",
"posts": "Posts",
"users": "Usuarios",
"administrator": "Administrador",
"add": "Agregar",
"cancel": "Cancel",
"content": "Contenido",
"title": "Título",
"no-parent": "Sin padre",
"edit-page": "Editar página",
"edit-post": "Editar post",
"add-a-new-user": "Agregar nuevo usuario",
"parent": "Padre",
"friendly-url": "URL Amigable",
"description": "Descripción",
"posted-by": "Publicado por",
"tags": "Etiquetas",
"position": "Posición",
"save": "Guardar",
"draft": "Borrador",
"delete": "Eliminar",
"registered": "Registrado",
"Notifications": "Notificaciones",
"profile": "Perfil",
"email": "Correo electrónico",
"settings": "Ajustes",
"general": "General",
"advanced": "Avanzado",
"regional": "Regional",
"about": "Acerca de",
"login": "Iniciar sesión",
"logout": "Cerrar sesión",
"manage": "Administrar",
"themes": "Temas",
"prev-page": "Pag. anterior",
"next-page": "Pag. siguiente",
"configure-plugin": "Configurar plugin",
"confirm-delete-this-action-cannot-be-undone": "Confirmar eliminación, esta operación no se puede deshacer.",
"site-title": "Título del sitio",
"site-slogan": "Eslogan del sitio",
"site-description": "Descripción del sitio",
"footer-text": "Texto de pie de página",
"posts-per-page": "Posts por página",
"site-url": "URL del sitio",
"writting-settings": "Ajustes de redacción",
"url-filters": "Filtros URL",
"page": "página",
"pages": "páginas",
"home": "Inicio",
"welcome-back": "Bienvenido",
"language": "Lenguaje",
"website": "Sitio web",
"timezone": "Zona horaria",
"locale": "Codificación",
"new-post": "Nuevo post",
"new-page": "Nueva página",
"html-and-markdown-code-supported": "Código HTML y Markdown soportado",
"manage-posts": "Administrar posts",
"published-date": "Fecha de publicación",
"modified-date": "Fecha de modificación",
"empty-title": "Título vacío",
"plugins": "Plugins",
"install-plugin": "Instalar plugin",
"uninstall-plugin": "Desinstalar plugin",
"new-password": "Nueva contraseña",
"edit-user": "Editar usuario",
"publish-now": "Publicar",
"first-name": "Nombre",
"last-name": "Apellido",
"bludit-version": "Bludit versión",
"powered-by": "Corriendo con",
"recent-posts": "Posts recientes",
"manage-pages": "Administrar páginas",
"advanced-options": "Opciones avanzadas",
"user-deleted": "Usuario eliminado",
"page-added-successfully": "Página agregada con éxito",
"post-added-successfully": "Post agregado con éxito ",
"the-post-has-been-deleted-successfully": "El post ha sido eliminado con éxito",
"the-page-has-been-deleted-successfully": "La página ha sido eliminada con éxito",
"username-or-password-incorrect": "Nombre de usuario o contraseña incorrectos",
"database-regenerated": "Base de datos regenerada",
"the-changes-have-been-saved": "Los cambios han sido guardados",
"enable-more-features-at": "Habilitar más funciones en",
"username-already-exists": "El nombre de usuario ya existe",
"username-field-is-empty": "El campo nombre de usuario esta vacío",
"the-password-and-confirmation-password-do-not-match": "Las contraseñas no coinciden",
"user-has-been-added-successfully": "El usuario ha sido creado con éxito",
"you-do-not-have-sufficient-permissions": "No tiene suficientes permisos para acceder a esta página, contacta con el administrador.",
"settings-advanced-writting-settings": "Ajustes->Avanzado->Ajustes de redacción",
"new-posts-and-pages-synchronized": "Nuevos posts y páginas sincronizados.",
"you-can-choose-the-users-privilege": "Puede elegir los privilegios del usuario. El rol editor solo puede redactar páginas y post.",
"email-will-not-be-publicly-displayed": "El correo electrónico no será visible. Recomendado para recuperar la contraseña y notificaciones.",
"use-this-field-to-name-your-site": "Utilice este campo para nombrar su sitio, aparecerá en la parte superior de cada página de su sitio.",
"use-this-field-to-add-a-catchy-phrase": "Utilice este campo para agregar un slogan a su sitio.",
"you-can-add-a-site-description-to-provide": "Puede agregar una descripción del sitio para proporcionar una breve biografía o descripción de su sitio.",
"you-can-add-a-small-text-on-the-bottom": "Puede agregar un pequeño texto en el pie de página. ej: copyright, autor, fechas, etc.",
"number-of-posts-to-show-per-page": "Numero de posts a mostrar por página.",
"the-url-of-your-site": "URL de su sitio.",
"add-or-edit-description-tags-or": "Agregar o editar la descripción, tags y modificar la URL amigable.",
"select-your-sites-language": "Seleccione el lenguaje de su sitio.",
"select-a-timezone-for-a-correct": "Seleccione la zona horaria para una correcta visualización de las fechas.",
"you-can-use-this-field-to-define-a-set-of": "Puede utilizar este campo para definir un conjunto de parámetros relacionados con el idioma, país y preferencias especiales.",
"you-can-modify-the-url-which-identifies": "Puede modificar la dirección URL que identifica una página o post usando palabras clave legible. No más de 150 caracteres.",
"this-field-can-help-describe-the-content": "Este campo puede ayudar a describir el contenido en pocas palabras. No más de 150 caracteres.",
"write-the-tags-separeted-by-comma": "Escribir los tags separados por comas. ej: tag1, tag2, tag3",
"delete-the-user-and-all-its-posts": "Eliminar el usuario y sus posts",
"delete-the-user-and-associate-its-posts-to-admin-user": "Eliminar el usuario y asociar los posts al usuario admin",
"read-more": "Leer más",
"show-blog": "Mostrar blog",
"default-home-page": "página de inicio predeterminada",
"version": "Versión",
"there-are-no-drafts": "No hay borradores",
"create-a-new-article-for-your-blog":"Crear un nuevo artículo para su blog.",
"create-a-new-page-for-your-website":"Crear una nueva página para su sitio web.",
"invite-a-friend-to-collaborate-on-your-website":"Invite a un amigo para colaborar en el sitio web.",
"change-your-language-and-region-settings":"Cambiar la configuración de idioma y región.",
"language-and-timezone":"Idioma y zona horaria",
"author": "Autor",
"start-here": "Comience aquí",
"install-theme": "Instalar tema",
"first-post": "Primer post",
"congratulations-you-have-successfully-installed-your-bludit": "Felicitación, usted ha instalado **Bludit** exitosamente",
"whats-next": "Siguientes pasos",
"manage-your-bludit-from-the-admin-panel": "Administre su Bludit desde el [panel de administración](./admin/)",
"follow-bludit-on": "Siga Bludit en",
"visit-the-support-forum": "Visite el [foro](http://forum.bludit.com) para soporte",
"read-the-documentation-for-more-information": "Lea la [documentación](http://docs.bludit.com) para mas información",
"share-with-your-friends-and-enjoy": "Compartí con tus amigos y a disfrutar",
"the-page-has-not-been-found": "La página no fue encontrada.",
"error": "Error",
"bludit-installer": "Instalador de Bludit",
"welcome-to-the-bludit-installer": "Bienvenido al asistente para la instalación de Bludit",
"complete-the-form-choose-a-password-for-the-username-admin": "Complete el formulario y elija una contraseña para el usuario « admin »",
"password-visible-field": "Contraseña, ¡este campo es visible!",
"install": "Instalar",
"the-password-field-is-empty": "Debe completar el campo contraseña",
"your-email-address-is-invalid":"Su dirección de correo es inválida.",
"proceed-anyway": "¡Continuar de todas formas!",
"drafts":"Borradores",
"ip-address-has-been-blocked":"La dirección IP fue bloqueada.",
"try-again-in-a-few-minutes": "Vuelva a intentar en unos minutos."
}

129
languages/es_VE.json Normal file
View File

@ -0,0 +1,129 @@
{
"language-data":
{
"native": "Español (Venezuela)",
"english-name": "Spanish",
"last-update": "2015-07-27",
"author": "c-sanchez",
"email": "",
"website": ""
},
"username": "Usuario",
"password": "Contraseña",
"confirm-password": "Confirmar contraseña",
"editor": "Editor",
"dashboard": "Tablero",
"role": "Papel",
"post": "Mensaje",
"posts": "Entrada",
"users": "Usuarios",
"administrator": "Administrador",
"add": "Agregar",
"cancel": "Cancelar",
"content": "Contenido",
"title": "Título",
"no-parent": "Ningún padre",
"edit-page": "Editar página",
"edit-post": "Editar entrada",
"add-a-new-user": "Agregar un nuevo usuario",
"parent": "Padre",
"friendly-url": "URL amigable",
"description": "Descripción",
"posted-by": "Publicado por",
"tags": "Etiquetas",
"position": "Posición",
"save": "Guardar",
"draft": "Borrador",
"delete": "Eliminar",
"registered": "Registrado",
"Notifications": "Notificaciones",
"profile": "Perfil",
"email": "Email",
"settings": "Ajustes",
"general": "General",
"advanced": "Avanzado",
"regional": "Regional",
"about": "Acerca de...",
"login": "Ingresar",
"logout": "Salir",
"manage": "Administrar",
"themes": "Temas",
"prev-page": "Página Anterior",
"next-page": "Siguiente página",
"configure-plugin": "Configurar complemento",
"confirm-delete-this-action-cannot-be-undone": "Confirmar eliminar, esta acción no se puede deshacer.",
"site-title": "Título del sitio",
"site-slogan": "Lema del sitio",
"site-description": "Descripción del sitio",
"footer-text": "Texto de pie de página",
"posts-per-page": "Entradas por página",
"site-url": "URL del sitio",
"writting-settings": "Ajustes de redacción",
"url-filters": "Filtros de URL",
"page": "Página",
"pages": "Páginas",
"home": "Página de inicio",
"welcome-back": "Bienvenido",
"language": "Idioma",
"website": "Sitio web",
"timezone": "Zona Horaria",
"locale": "Localización",
"notifications": "Notificaciones",
"new-post": "Nueva entrada",
"html-and-markdown-code-supported": "Código HTML y Markdown soportado",
"new-page": "Nueva página",
"manage-posts": "Administrar mensajes",
"published-date": "Fecha de publicación",
"modified-date": "Fecha de modificación",
"empty-title": "Título vacío",
"plugins": "Complementos",
"install-plugin": "Instalar complemento",
"uninstall-plugin": "Desinstalar complemento",
"new-password": "Nueva contraseña",
"edit-user": "Editar usuario",
"publish-now": "Publicar ahora",
"first-name": "Nombre",
"last-name": "Apellido",
"bludit-version": "Versión de Bludit",
"powered-by": "Impulsado por",
"recent-posts": "Mensajes recientes",
"manage-pages": "Administrar páginas",
"advanced-options": "Opciones avanzadas",
"user-deleted": "Usuario eliminado",
"page-added-successfully": "Página agregada correctamente",
"post-added-successfully": "Mensaje agregado correctamente",
"the-post-has-been-deleted-successfully": "El mensaje ha sido eliminado correctamente",
"the-page-has-been-deleted-successfully": "La página ha sido eliminado correctamente",
"username-or-password-incorrect": "Usuario o contraseña incorrecto",
"database-regenerated": "Base de datos regenerada",
"the-changes-have-been-saved": "Los cambios han sido guardados",
"html-markdown-code-supported": "Código HTML y Markdown soportado.",
"enable-more-features-at": "Activar más funciones en",
"username-already-exists": "Ya existe nombre de usuario",
"username-field-is-empty": "Está vacío el campo de nombre de usuario ",
"the-password-and-confirmation-password-do-not-match":"La contraseña y la contraseña de confirmación no coinciden",
"user-has-been-added-successfully": "El usuario se ha agregado correctamente",
"you-do-not-have-sufficient-permissions": "No tienes permisos suficientes para acceder a esta página, póngase en contacto con el administrador.",
"settings-advanced-writting-settings": "Ajustes->Avanzado->Ajustes de redacción",
"new-posts-and-pages-synchronized": "Nuevos mensajes y páginas sincronizadas.",
"you-can-choose-the-users-privilege": "Usted puede elegir los privilegios del usuario. El papel del editor sólo puede escribir páginas y mensajes.",
"email-will-not-be-publicly-displayed": "El correo electrónico no se mostrará públicamente. Recomendado para notificaciones y recuperación contraseña.",
"use-this-field-to-name-your-site": "Use este campo para el nombre de su sitio, aparecerá en la parte superior de cada página de su sitio.",
"use-this-field-to-add-a-catchy-phrase": "Use este campo para agregar una frase pegadiza en su sitio.",
"you-can-add-a-site-description-to-provide": "Puede agregar una descripción del sitio para proporcionar una breve biografía o descripción de su sitio.",
"you-can-add-a-small-text-on-the-bottom": "Puede añadir un pequeño texto en la parte inferior de cada página. por ejemplo: derechos de autor, propietario, fechas, etc.",
"number-of-posts-to-show-per-page": "Número de mensajes a mostrar por página.",
"the-url-of-your-site": "La URL de su sitio.",
"add-or-edit-description-tags-or": "Agregar o editar la descripción, etiquetas o modificar la URL amigable.",
"select-your-sites-language": "Seleccionar el idioma de su sitio.",
"select-a-timezone-for-a-correct": "Seleccione una zona horaria para mostrar correctamente la fecha y hora en su sitio.",
"you-can-use-this-field-to-define-a-set-of": "Puede usar este campo para definir un conjunto de parámetros relacionados con la languege, el país y preferencias especiales.",
"you-can-modify-the-url-which-identifies":"You can modify the URL which identifies a page or post using human-readable keywords. No more than 150 characters.",
"this-field-can-help-describe-the-content": "Este campo puede ayudar a describir el contenido en pocas palabras. No más de 150 caracteres.",
"write-the-tags-separeted-by-comma": "Escribir las etiquetas separadas por comas. por ejemplo: etiqueta1, etiqueta2, etiqueta3",
"delete": "Delete",
"delete-the-user-and-all-its-posts":"Eliminar el usuario y todos sus mensajes",
"delete-the-user-and-associate-its-posts-to-admin-user": "Eliminar el usuario y asociar sus mensajes al usuario administrador",
"read-more": "Leer más"
}

Some files were not shown because too many files have changed in this diff Show More