commit
2a4a9b6d4a
|
@ -1,4 +1,6 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
!themes/pure
|
||||||
|
themes/*
|
||||||
content/databases
|
content/databases
|
||||||
content/pages
|
content/pages
|
||||||
content/posts
|
content/posts
|
||||||
|
|
|
@ -10,6 +10,6 @@ RewriteRule ^content/(.*)\.txt$ - [R=404,L]
|
||||||
|
|
||||||
# All URL process by index.php
|
# All URL process by index.php
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
RewriteRule ^(.*) index.php [L]
|
RewriteRule ^(.*) index.php [PT,L]
|
||||||
|
|
||||||
</IfModule>
|
</IfModule>
|
16
README.md
16
README.md
|
@ -5,7 +5,16 @@ Bludit is a fast, simple, extensible and Flat file CMS.
|
||||||
|
|
||||||
- [Documentation](http://docs.bludit.com/en/)
|
- [Documentation](http://docs.bludit.com/en/)
|
||||||
- [Help and Support](http://forum.bludit.com)
|
- [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
|
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)
|
* 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)
|
* Ngnix with module [ngx_http_rewrite_module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html)
|
||||||
|
|
||||||
|
|
||||||
Installation guide
|
Installation guide
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
@ -26,3 +34,7 @@ Installation guide
|
||||||
2. Extract the zip file into a directory like `bludit`.
|
2. Extract the zip file into a directory like `bludit`.
|
||||||
3. Upload the directory `bludit` on your hosting.
|
3. Upload the directory `bludit` on your hosting.
|
||||||
4. Done!
|
4. Done!
|
||||||
|
|
||||||
|
License
|
||||||
|
-------
|
||||||
|
Bludit is opensource software licensed under the [MIT license](https://tldrlegal.com/license/mit-license)
|
||||||
|
|
|
@ -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
|
|
@ -5,7 +5,7 @@
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
if($Login->role()!=='admin') {
|
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');
|
Redirect::page('admin', 'dashboard');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,34 +16,45 @@ if($Login->role()!=='admin') {
|
||||||
function addUser($args)
|
function addUser($args)
|
||||||
{
|
{
|
||||||
global $dbUsers;
|
global $dbUsers;
|
||||||
|
global $Language;
|
||||||
|
|
||||||
// Check if the username already exist in db.
|
// 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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate password.
|
// Validate password.
|
||||||
if( ($args['password'] != $args['confirm-password'] ) || Text::isEmpty($args['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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the user.
|
// Add the user.
|
||||||
if( $dbUsers->add($args) )
|
if( $dbUsers->add($args) )
|
||||||
{
|
{
|
||||||
Alert::set('User has been added successfull');
|
Alert::set($Language->g('user-has-been-added-successfully'));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Main before POST
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// POST Method
|
// POST Method
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@ -56,5 +67,5 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Main
|
// Main after POST
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
if($Login->role()!=='admin') {
|
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');
|
Redirect::page('admin', 'dashboard');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,10 +17,11 @@ if($Login->role()!=='admin') {
|
||||||
// Main before POST
|
// Main before POST
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
$_Plugin = false;
|
$_Plugin = false;
|
||||||
|
$pluginClassName = $layout['parameters'];
|
||||||
|
|
||||||
foreach($plugins['all'] as $P)
|
foreach($plugins['all'] as $P)
|
||||||
{
|
{
|
||||||
if($P->className()==$layout['parameters']) {
|
if($P->className()==$pluginClassName) {
|
||||||
$_Plugin = $P;
|
$_Plugin = $P;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,8 +31,8 @@ if($_Plugin===false) {
|
||||||
Redirect::page('admin', 'plugins');
|
Redirect::page('admin', 'plugins');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the plugin has the method form.
|
// Check if the plugin has the method form()
|
||||||
if($_Plugin->form()===false) {
|
if(!method_exists($_Plugin, 'form')) {
|
||||||
Redirect::page('admin', 'plugins');
|
Redirect::page('admin', 'plugins');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +43,7 @@ if($_Plugin->form()===false) {
|
||||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
{
|
{
|
||||||
$_Plugin->setDb($_POST);
|
$_Plugin->setDb($_POST);
|
||||||
Alert::set('Configuration has been saved successfully');
|
Alert::set($Language->g('the-changes-have-been-saved'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
|
@ -4,13 +4,35 @@
|
||||||
// Functions
|
// Functions
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Main before POST
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// POST Method
|
// POST Method
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Main
|
// Main after POST
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
$_newPosts = $dbPosts->regenerate();
|
//$_newPosts = $dbPosts->regenerateCli();
|
||||||
$_newPages = $dbPages->regenerate();
|
$_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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
function editPage($args)
|
function editPage($args)
|
||||||
{
|
{
|
||||||
global $dbPages;
|
global $dbPages;
|
||||||
|
global $Language;
|
||||||
|
|
||||||
// Page status, published or draft.
|
// Page status, published or draft.
|
||||||
if( isset($args['publish']) ) {
|
if( isset($args['publish']) ) {
|
||||||
|
@ -23,32 +24,37 @@ function editPage($args)
|
||||||
// Edit the page.
|
// Edit the page.
|
||||||
if( $dbPages->edit($args) )
|
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']);
|
Redirect::page('admin', 'edit-page/'.$args['key']);
|
||||||
}
|
}
|
||||||
else
|
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)
|
function deletePage($key)
|
||||||
{
|
{
|
||||||
global $dbPages;
|
global $dbPages;
|
||||||
|
global $Language;
|
||||||
|
|
||||||
if( $dbPages->delete($key) )
|
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');
|
Redirect::page('admin', 'manage-pages');
|
||||||
}
|
}
|
||||||
else
|
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
|
// 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');
|
Redirect::page('admin', 'manage-pages');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Check role
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Functions
|
// Functions
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@ -7,6 +11,7 @@
|
||||||
function editPost($args)
|
function editPost($args)
|
||||||
{
|
{
|
||||||
global $dbPosts;
|
global $dbPosts;
|
||||||
|
global $Language;
|
||||||
|
|
||||||
// Post status, published or draft.
|
// Post status, published or draft.
|
||||||
if( isset($args['publish']) ) {
|
if( isset($args['publish']) ) {
|
||||||
|
@ -19,30 +24,43 @@ function editPost($args)
|
||||||
// Edit the post.
|
// Edit the post.
|
||||||
if( $dbPosts->edit($args) )
|
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']);
|
Redirect::page('admin', 'edit-post/'.$args['key']);
|
||||||
}
|
}
|
||||||
else
|
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)
|
function deletePost($key)
|
||||||
{
|
{
|
||||||
global $dbPosts;
|
global $dbPosts;
|
||||||
|
global $Language;
|
||||||
|
|
||||||
if( $dbPosts->delete($key) )
|
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');
|
Redirect::page('admin', 'manage-posts');
|
||||||
}
|
}
|
||||||
else
|
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
|
// 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');
|
Redirect::page('admin', 'manage-posts');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,51 +7,102 @@
|
||||||
function editUser($args)
|
function editUser($args)
|
||||||
{
|
{
|
||||||
global $dbUsers;
|
global $dbUsers;
|
||||||
|
global $Language;
|
||||||
|
|
||||||
if(isset($args['password']))
|
if( $dbUsers->set($args) ) {
|
||||||
{
|
Alert::set($Language->g('The changes have been saved'));
|
||||||
if( ($args['password']===$args['confirm-password']) && !Text::isEmpty($args['password']) ) {
|
|
||||||
return $dbUsers->setPassword($args);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Alert::set('Passwords are differents');
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
function deleteUser($args, $deleteContent=false)
|
||||||
{
|
{
|
||||||
return $dbUsers->set($args);
|
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
|
// POST Method
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
{
|
{
|
||||||
|
// Prevent editors users to administrate other users.
|
||||||
if($Login->role()!=='admin')
|
if($Login->role()!=='admin')
|
||||||
{
|
{
|
||||||
$_POST['username'] = $Login->username();
|
$_POST['username'] = $Login->username();
|
||||||
unset($_POST['role']);
|
unset($_POST['role']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( editUser($_POST) ) {
|
if(isset($_POST['delete-user-all'])) {
|
||||||
Alert::set('User saved successfuly');
|
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') {
|
if($Login->role()!=='admin') {
|
||||||
$layout['parameters'] = $Login->username();
|
$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 the user doesn't exist, redirect to the users list.
|
||||||
if($_user===false) {
|
if($_user===false) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
if($Login->role()!=='admin') {
|
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');
|
Redirect::page('admin', 'dashboard');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,16 +13,24 @@ if($Login->role()!=='admin') {
|
||||||
// Functions
|
// Functions
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Main before POST
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// POST Method
|
// POST Method
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Main
|
// Main after POST
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
$pluginClassName = $layout['parameters'];
|
$pluginClassName = $layout['parameters'];
|
||||||
|
|
||||||
$Plugin = new $pluginClassName;
|
foreach($plugins['all'] as $P)
|
||||||
$Plugin->install();
|
{
|
||||||
|
if($P->className()==$pluginClassName) {
|
||||||
|
$P->install();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Redirect::page('admin', 'plugins');
|
Redirect::page('admin', 'plugins');
|
|
@ -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');
|
|
@ -1,16 +1,54 @@
|
||||||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
<?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' )
|
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
{
|
{
|
||||||
$username = Sanitize::html($_POST['username']);
|
checkPost($_POST);
|
||||||
$password = Sanitize::html($_POST['password']);
|
}
|
||||||
|
|
||||||
if( $Login->verifyUser($username, $password) )
|
// ============================================================================
|
||||||
{
|
// Main after POST
|
||||||
Redirect::page('admin', 'dashboard');
|
// ============================================================================
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Alert::set('Username or password incorrect');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +1,25 @@
|
||||||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Check role
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Functions
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Main before POST
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// POST Method
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Main after POST
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
if( $Login->logout())
|
if( $Login->logout())
|
||||||
{
|
{
|
||||||
Redirect::home();
|
Redirect::home();
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Check role
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Functions
|
// Functions
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@ -7,6 +11,7 @@
|
||||||
function addPage($args)
|
function addPage($args)
|
||||||
{
|
{
|
||||||
global $dbPages;
|
global $dbPages;
|
||||||
|
global $Language;
|
||||||
|
|
||||||
// Page status, published or draft.
|
// Page status, published or draft.
|
||||||
if( isset($args['publish']) ) {
|
if( isset($args['publish']) ) {
|
||||||
|
@ -19,15 +24,19 @@ function addPage($args)
|
||||||
// Add the page.
|
// Add the page.
|
||||||
if( $dbPages->add($args) )
|
if( $dbPages->add($args) )
|
||||||
{
|
{
|
||||||
Alert::set('Page added successfuly');
|
Alert::set($Language->g('Page added successfully'));
|
||||||
Redirect::page('admin', 'manage-pages');
|
Redirect::page('admin', 'manage-pages');
|
||||||
}
|
}
|
||||||
else
|
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
|
// POST Method
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@ -36,3 +45,7 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
{
|
{
|
||||||
addPage($_POST);
|
addPage($_POST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Main after POST
|
||||||
|
// ============================================================================
|
|
@ -1,5 +1,9 @@
|
||||||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Check role
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Functions
|
// Functions
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@ -7,6 +11,7 @@
|
||||||
function addPost($args)
|
function addPost($args)
|
||||||
{
|
{
|
||||||
global $dbPosts;
|
global $dbPosts;
|
||||||
|
global $Language;
|
||||||
|
|
||||||
// Page status, published or draft.
|
// Page status, published or draft.
|
||||||
if( isset($args['publish']) ) {
|
if( isset($args['publish']) ) {
|
||||||
|
@ -19,15 +24,24 @@ function addPost($args)
|
||||||
// Add the page.
|
// Add the page.
|
||||||
if( $dbPosts->add($args) )
|
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');
|
Redirect::page('admin', 'manage-posts');
|
||||||
}
|
}
|
||||||
else
|
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
|
// POST Method
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@ -36,3 +50,7 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
{
|
{
|
||||||
addPost($_POST);
|
addPost($_POST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Main after POST
|
||||||
|
// ============================================================================
|
|
@ -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
|
||||||
|
// ============================================================================
|
|
@ -5,7 +5,7 @@
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
if($Login->role()!=='admin') {
|
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');
|
Redirect::page('admin', 'dashboard');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,28 +16,36 @@ if($Login->role()!=='admin') {
|
||||||
function setSettings($args)
|
function setSettings($args)
|
||||||
{
|
{
|
||||||
global $Site;
|
global $Site;
|
||||||
|
global $Language;
|
||||||
if(!isset($args['advancedOptions'])) {
|
|
||||||
$args['advancedOptions'] = 'false';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add slash at the begin and end.
|
// Add slash at the begin and end.
|
||||||
// This fields are in the settings->advanced mode
|
// 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['url'] = Text::addSlashes($args['url'],false,true);
|
||||||
$args['uriPost'] = Text::addSlashes($args['uriPost']);
|
$args['uriPost'] = Text::addSlashes($args['uriPost']);
|
||||||
$args['uriPage'] = Text::addSlashes($args['uriPage']);
|
$args['uriPage'] = Text::addSlashes($args['uriPage']);
|
||||||
$args['uriTag'] = Text::addSlashes($args['uriTag']);
|
$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) ) {
|
if( $Site->set($args) ) {
|
||||||
Alert::set('Settings has been saved successfully');
|
Alert::set($Language->g('the-changes-have-been-saved'));
|
||||||
}
|
}
|
||||||
else {
|
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
|
// POST Method
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@ -45,8 +53,28 @@ function setSettings($args)
|
||||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
{
|
{
|
||||||
setSettings($_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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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']);
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,7 +5,7 @@
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
if($Login->role()!=='admin') {
|
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');
|
Redirect::page('admin', 'dashboard');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,12 +13,16 @@ if($Login->role()!=='admin') {
|
||||||
// Functions
|
// Functions
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Main after POST
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// POST Method
|
// POST Method
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Main
|
// Main after POST
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
$pluginClassName = $layout['parameters'];
|
$pluginClassName = $layout['parameters'];
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,18 @@
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
if($Login->role()!=='admin') {
|
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');
|
Redirect::page('admin', 'dashboard');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Functions
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// Main after POST
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// POST Method
|
// POST Method
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@ -19,5 +27,5 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Main
|
// Main after POST
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
|
@ -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
|
@ -12,6 +12,18 @@ body {
|
||||||
background-color: #f9f9f9;
|
background-color: #f9f9f9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.unit-80 {
|
||||||
|
margin-left: 1% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tools-alert {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.label {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------- FONTS AWESOME ----------- */
|
/* ----------- FONTS AWESOME ----------- */
|
||||||
.fa-right {
|
.fa-right {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
|
@ -20,7 +32,7 @@ body {
|
||||||
/* ----------- HEAD ----------- */
|
/* ----------- HEAD ----------- */
|
||||||
#head {
|
#head {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border-top: 10px #f1f1f1 solid;
|
border-top: 10px #eee solid;
|
||||||
border-bottom: 1px solid #f1f1f1;
|
border-bottom: 1px solid #f1f1f1;
|
||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
}
|
}
|
||||||
|
@ -66,6 +78,13 @@ body {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ----------- FOOTER ----------- */
|
||||||
|
#footer {
|
||||||
|
color: #777;
|
||||||
|
font-size: 0.9em;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------- ALERT ----------- */
|
/* ----------- ALERT ----------- */
|
||||||
#alert {
|
#alert {
|
||||||
top: 0 !important;
|
top: 0 !important;
|
||||||
|
@ -86,6 +105,10 @@ h2.title {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h2.title i.fa {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------- TABLE ----------- */
|
/* ----------- TABLE ----------- */
|
||||||
table {
|
table {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
@ -126,7 +149,11 @@ div.dashboardBox .nav {
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.dashboardBox .nav a {
|
||||||
|
padding: 0 !important;
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
div.dashboardBox i.iconContent {
|
div.dashboardBox i.iconContent {
|
||||||
bottom: -1rem;
|
bottom: -1rem;
|
||||||
|
@ -140,6 +167,11 @@ div.dashboardBox div.bigContent {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.dashboardBox span {
|
||||||
|
display: inline-block !important;
|
||||||
|
padding: 3px 6px;
|
||||||
|
}
|
||||||
|
|
||||||
div.dashboardBox h2 {
|
div.dashboardBox h2 {
|
||||||
color: #666;
|
color: #666;
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
|
@ -148,10 +180,35 @@ div.dashboardBox h2 {
|
||||||
padding: 10px 20px;
|
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 ----------- */
|
/* ----------- FORMS ----------- */
|
||||||
|
|
||||||
form h4 {
|
form h4 {
|
||||||
border-bottom: 1px solid #e2e2e2;
|
border-bottom: 1px solid #e2e2e2;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
|
@ -160,9 +217,27 @@ form h4 {
|
||||||
width: 60%;
|
width: 60%;
|
||||||
}
|
}
|
||||||
|
|
||||||
p.advOptions {
|
#jsadvancedButton {
|
||||||
color: #777;
|
display: block;
|
||||||
font-size: 0.8em;
|
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 {
|
a.btn:hover {
|
||||||
|
@ -178,6 +253,82 @@ a.btn-red:hover {
|
||||||
color: rgba(255, 255, 255, 0.6) !important;
|
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 ----------- */
|
/* ----------- PLUGINS ----------- */
|
||||||
div.pluginBox {
|
div.pluginBox {
|
||||||
|
@ -185,13 +336,37 @@ div.pluginBox {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 20px;
|
padding: 15px 20px;
|
||||||
width: 70%;
|
width: 70%;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.pluginBox p {
|
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 ----------- */
|
/* ----------- PLUGINS FORM ----------- */
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1005 B |
|
@ -8,6 +8,10 @@ a:hover {
|
||||||
text-decoration: none !important;
|
text-decoration: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------- FONTS AWESOME ----------- */
|
/* ----------- FONTS AWESOME ----------- */
|
||||||
.fa-right {
|
.fa-right {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
|
@ -16,7 +20,7 @@ a:hover {
|
||||||
/* ----------- ----------- */
|
/* ----------- ----------- */
|
||||||
div.main {
|
div.main {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 30px 0;
|
margin: 50px 0 0 0;
|
||||||
}
|
}
|
||||||
h1.title {
|
h1.title {
|
||||||
font-weight: lighter;
|
font-weight: lighter;
|
||||||
|
@ -26,3 +30,24 @@ h1.title {
|
||||||
td {
|
td {
|
||||||
text-align: center;
|
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;
|
||||||
|
}
|
|
@ -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
|
@ -1,26 +1,32 @@
|
||||||
<!doctype html>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<base href="<?php echo HTML_PATH_ADMIN_THEME ?>">
|
<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="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="robots" content="noindex,nofollow">
|
||||||
|
|
||||||
<title><?php echo $layout['title'] ?></title>
|
<title><?php echo $layout['title'] ?></title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="./css/kube.min.css">
|
<link rel="shortcut icon" type="image/x-icon" href="./css/favicon.png">
|
||||||
<link rel="stylesheet" href="./css/default.css">
|
|
||||||
<link rel="stylesheet" href="./css/css/font-awesome.css">
|
|
||||||
|
|
||||||
<script src="./js/jquery.min.js"></script>
|
<link rel="stylesheet" type="text/css" href="./css/kube.min.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||||
<script src="./js/kube.min.js"></script>
|
<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 -->
|
<!-- Plugins -->
|
||||||
<?php
|
<?php Theme::plugins('adminHead') ?>
|
||||||
Theme::plugins('onAdminHead');
|
|
||||||
?>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<!-- Plugins -->
|
||||||
|
<?php Theme::plugins('adminBodyBegin') ?>
|
||||||
|
|
||||||
<!-- ALERT -->
|
<!-- ALERT -->
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
@ -55,7 +61,7 @@ $(document).ready(function() {
|
||||||
<div id="sidebar" class="nav">
|
<div id="sidebar" class="nav">
|
||||||
|
|
||||||
<ul>
|
<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-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 ?>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>
|
<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 -->
|
<!-- Plugins -->
|
||||||
<?php
|
<?php Theme::plugins('adminBodyEnd') ?>
|
||||||
Theme::plugins('onAdminBody');
|
|
||||||
?>
|
<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>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -3,15 +3,16 @@
|
||||||
function makeNavbar($type)
|
function makeNavbar($type)
|
||||||
{
|
{
|
||||||
global $layout;
|
global $layout;
|
||||||
|
global $Language;
|
||||||
|
|
||||||
$navbar['users'] = array(
|
$navbar['users'] = array(
|
||||||
'users'=>array('text'=>'Users'),
|
'users'=>array('text'=>$Language->g('Users')),
|
||||||
'add-user'=>array('text'=>'Add new user')
|
'add-user'=>array('text'=>$Language->g('Add a new user'))
|
||||||
);
|
);
|
||||||
|
|
||||||
$navbar['manage'] = array(
|
$navbar['manage'] = array(
|
||||||
'manage-posts'=>array('text'=>'Manage posts'),
|
'manage-posts'=>array('text'=>$Language->g('Manage posts')),
|
||||||
'manage-pages'=>array('text'=>'Manage pages')
|
'manage-pages'=>array('text'=>$Language->g('Manage pages'))
|
||||||
);
|
);
|
||||||
|
|
||||||
echo '<nav class="navbar sublinks"><ul>';
|
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
|
@ -2,24 +2,28 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<base href="<?php echo HTML_PATH_ADMIN_THEME ?>">
|
<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="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/kube.min.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||||
<link rel="stylesheet" href="./css/default.css">
|
<link rel="stylesheet" href="./css/default.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||||
<link rel="stylesheet" href="./css/css/font-awesome.css">
|
<link rel="stylesheet" href="./css/css/font-awesome.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||||
|
|
||||||
|
<!-- Plugins Login Head -->
|
||||||
|
<?php Theme::plugins('loginHead') ?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<!-- Plugins Login Body Begin -->
|
||||||
|
<?php Theme::plugins('loginBodyBegin') ?>
|
||||||
|
|
||||||
<div id="head">
|
<div id="head">
|
||||||
<nav class="navbar nav-fullwidth">
|
<nav class="navbar nav-fullwidth">
|
||||||
<h1>Bludit</h1>
|
<h1>Bludit</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="<?php echo HTML_PATH_ROOT ?>"><?php $Language->p('Home') ?></a></li>
|
<li><a href="<?php echo HTML_PATH_ROOT ?>"><?php $Language->p('Website') ?></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
@ -27,13 +31,13 @@
|
||||||
<div class="units-row">
|
<div class="units-row">
|
||||||
|
|
||||||
<!-- CONTENT -->
|
<!-- CONTENT -->
|
||||||
<div class="unit-centered unit-40" style="max-width: 500px">
|
<div class="unit-centered unit-40" style="max-width: 400px">
|
||||||
<div id="content">
|
<div id="content">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(Alert::defined()) {
|
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
|
// Load view
|
||||||
|
@ -46,8 +50,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?php
|
|
||||||
echo "DEBUG: Load time: ".(microtime(true) - $loadTime).'<br>';
|
<!-- Plugins Login Body Begin -->
|
||||||
?>
|
<?php Theme::plugins('loginBodyEnd') ?>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -2,10 +2,13 @@
|
||||||
|
|
||||||
<?php makeNavbar('users'); ?>
|
<?php makeNavbar('users'); ?>
|
||||||
|
|
||||||
<form method="post" action="" class="forms">
|
<form method="post" action="" class="forms" autocomplete="off">
|
||||||
|
|
||||||
|
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Username') ?>
|
<?php $Language->p('Username') ?>
|
||||||
<input type="text" name="username" class="width-50">
|
<input type="text" name="username" class="width-50" value="<?php echo (isset($_POST['username'])?$_POST['username']:'') ?>">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
|
@ -28,8 +31,8 @@
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
Email
|
<?php $Language->p('Email') ?>
|
||||||
<input type="text" name="email" class="width-50">
|
<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>
|
<div class="forms-desc"><?php $Language->p('email-will-not-be-publicly-displayed') ?></div>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
<form id="jsformplugin" method="post" action="" class="forms">
|
<form id="jsformplugin" method="post" action="" class="forms">
|
||||||
|
|
||||||
|
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
|
||||||
<input type="hidden" id="jskey" name="key" value="">
|
<input type="hidden" id="jskey" name="key" value="">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -2,7 +2,36 @@
|
||||||
|
|
||||||
<div class="units-row">
|
<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="dashboardBox">
|
||||||
<div class="content contentBlue">
|
<div class="content contentBlue">
|
||||||
|
@ -20,36 +49,31 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="unit-60">
|
|
||||||
<?php if($_newPosts || $_newPages) { ?>
|
|
||||||
<div class="dashboardBox">
|
<div class="dashboardBox">
|
||||||
<div class="content contentGreen">
|
<h2><?php $Language->p('Drafts') ?></h2>
|
||||||
<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>
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<nav class="nav">
|
<nav class="nav">
|
||||||
<ul>
|
<ul>
|
||||||
<li>New comment</li>
|
<?php
|
||||||
<li>Admin session started at 07:00pm</li>
|
if( empty($_draftPosts) && empty($_draftPages) )
|
||||||
<li>Failed login with username diego</li>
|
{
|
||||||
<li>Database regenerated</li>
|
echo '<li>'.$Language->g('There are no drafts').'</li>';
|
||||||
<li>New session started at 01:00pm</li>
|
}
|
||||||
<li>New post added</li>
|
else
|
||||||
<li>New page added</li>
|
{
|
||||||
|
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>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
|
@ -2,30 +2,22 @@
|
||||||
|
|
||||||
<form id="jsform" method="post" action="" class="forms">
|
<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() ?>">
|
<input type="hidden" id="jskey" name="key" value="<?php echo $_Page->key() ?>">
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Title') ?>
|
<?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>
|
<label class="width-90">
|
||||||
<?php $Language->p('Content') ?> <span class="forms-desc"><?php $Language->p('HTML and Markdown code supported') ?></span>
|
<?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>
|
</label>
|
||||||
|
|
||||||
<?php
|
<button id="jsadvancedButton" class="btn btn-smaller"><?php $Language->p('Advanced options') ?></button>
|
||||||
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">';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<h4><?php $Language->p('Advanced options') ?></h4>
|
<div id="jsadvancedOptions">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// Remove setting pages parents if the page is a parent.
|
// Remove setting pages parents if the page is a parent.
|
||||||
|
@ -45,7 +37,6 @@
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
<div class="forms-desc">Tip/Help ???</div>
|
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
@ -56,19 +47,19 @@
|
||||||
<span class="input-prepend"><?php echo $Site->url() ?><span id="jsparentExample"><?php echo $_Page->parentKey()?$_Page->parentKey().'/':''; ?></span></span>
|
<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() ?>">
|
<input id="jsslug" type="text" name="slug" value="<?php echo $_Page->slug() ?>">
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Description') ?>
|
<?php $Language->p('Description') ?>
|
||||||
<input id="jsdescription" type="text" name="description" class="width-50" value="<?php echo $_Page->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>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Tags') ?>
|
<?php $Language->p('Tags') ?>
|
||||||
<input id="jstags" name="tags" type="text" class="width-50" value="<?php echo $_Page->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>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
|
@ -122,11 +113,16 @@ $(document).ready(function()
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#jsdelete").click(function() {
|
$("#jsdelete").click(function() {
|
||||||
if(!confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")) {
|
if(confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")==false) {
|
||||||
event.preventDefault();
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#jsadvancedButton").click(function() {
|
||||||
|
$("#jsadvancedOptions").slideToggle();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
|
@ -2,54 +2,53 @@
|
||||||
|
|
||||||
<form method="post" action="" class="forms">
|
<form 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 $_Post->key() ?>">
|
<input type="hidden" id="jskey" name="key" value="<?php echo $_Post->key() ?>">
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Title') ?>
|
<?php $Language->p('Title') ?>
|
||||||
<input id="jstitle" name="title" type="text" class="width-70" value="<?php echo $_Post->title() ?>">
|
<input id="jstitle" name="title" type="text" class="width-90" value="<?php echo $_Post->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 id="jscontent" name="content" rows="15"><?php echo $_Post->contentRaw(false) ?></textarea>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<button id="jsadvancedButton" class="btn btn-smaller"><?php $Language->p('Advanced options') ?></button>
|
||||||
|
|
||||||
|
<div id="jsadvancedOptions">
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Content') ?> <span class="forms-desc"><?php $Language->p('HTML and Markdown code supported') ?></span>
|
<?php $Language->p('Date') ?>
|
||||||
<textarea id="jscontent" name="content" rows="10" class="width-70"><?php echo $_Post->contentRaw(true, false) ?></textarea>
|
<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
|
|
||||||
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">';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<h4><?php $Language->p('Advanced options') ?></h4>
|
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Friendly Url') ?>
|
<?php $Language->p('Friendly Url') ?>
|
||||||
<div class="input-groups width-50">
|
<div class="input-groups width-50">
|
||||||
<span class="input-prepend"><?php echo $Site->urlPost() ?><span id="jsparentExample"></span></span>
|
<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() ?>">
|
<input id="jsslug" type="text" name="slug" value="<?php echo $_Post->slug() ?>">
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Description') ?>
|
<?php $Language->p('Description') ?>
|
||||||
<input id="jsdescription" type="text" name="description" class="width-50" value="<?php echo $_Post->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>
|
<span class="forms-desc"><?php $Language->p('this-field-can-help-describe-the-content') ?></span>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Tags') ?>
|
<?php $Language->p('Tags') ?>
|
||||||
<input id="jstags" name="tags" type="text" class="width-50" value="<?php echo $_Post->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>
|
<span class="forms-desc"><?php $Language->p('write-the-tags-separeted-by-comma') ?></span>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="btn btn-blue" name="publish"><?php echo ($_Post->published()?$Language->p('Save'):$Language->p('Publish now')) ?></button>
|
<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 class="btn" name="draft"><?php $Language->p('Draft') ?></button>
|
||||||
<button id="jsdelete" class="btn" name="delete"><?php $Language->p('Delete') ?></button>
|
<button id="jsdelete" class="btn" name="delete"><?php $Language->p('Delete') ?></button>
|
||||||
|
|
||||||
|
@ -61,24 +60,29 @@ $(document).ready(function()
|
||||||
{
|
{
|
||||||
var key = $("#jskey").val();
|
var key = $("#jskey").val();
|
||||||
|
|
||||||
|
$("#jsdate").datetimepicker({format:"<?php echo DB_DATE_FORMAT ?>"});
|
||||||
|
|
||||||
$("#jstitle").keyup(function() {
|
$("#jstitle").keyup(function() {
|
||||||
var slug = $(this).val();
|
var slug = $(this).val();
|
||||||
|
|
||||||
checkSlugPost(slug, key, $("#jsslug"));
|
checkSlugPost(slug, key, $("#jsslug"));
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#jsslug").keyup(function() {
|
$("#jsslug").keyup(function() {
|
||||||
var slug = $("#jsslug").val();
|
var slug = $("#jsslug").val();
|
||||||
|
|
||||||
checkSlugPost(slug, key, $("#jsslug"));
|
checkSlugPost(slug, key, $("#jsslug"));
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#jsdelete").click(function() {
|
$("#jsdelete").click(function() {
|
||||||
if(!confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")) {
|
if(confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")==false) {
|
||||||
event.preventDefault();
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#jsadvancedButton").click(function() {
|
||||||
|
$("#jsadvancedOptions").slideToggle();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
|
@ -5,6 +5,10 @@
|
||||||
<li><a href="#profile"><?php $Language->p('Profile') ?></a></li>
|
<li><a href="#profile"><?php $Language->p('Profile') ?></a></li>
|
||||||
<li><a href="#email"><?php $Language->p('Email') ?></a></li>
|
<li><a href="#email"><?php $Language->p('Email') ?></a></li>
|
||||||
<li><a href="#password"><?php $Language->p('Password') ?></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>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
@ -14,6 +18,9 @@
|
||||||
|
|
||||||
<div id="profile">
|
<div id="profile">
|
||||||
<form method="post" action="" class="forms">
|
<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'] ?>">
|
<input type="hidden" name="username" value="<?php echo $_user['username'] ?>">
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
|
@ -26,10 +33,8 @@
|
||||||
<input type="text" name="lastName" class="width-50" value="<?php echo $_user['lastName'] ?>">
|
<input type="text" name="lastName" class="width-50" value="<?php echo $_user['lastName'] ?>">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<?php
|
<?php if($Login->username()==='admin') { ?>
|
||||||
if($Login->username()==='admin')
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<label for="role">
|
<label for="role">
|
||||||
<?php $Language->p('Role') ?>
|
<?php $Language->p('Role') ?>
|
||||||
<select name="role" class="width-50">
|
<select name="role" class="width-50">
|
||||||
|
@ -42,10 +47,10 @@
|
||||||
</select>
|
</select>
|
||||||
<div class="forms-desc"><?php $Language->p('you-can-choose-the-users-privilege') ?></div>
|
<div class="forms-desc"><?php $Language->p('you-can-choose-the-users-privilege') ?></div>
|
||||||
</label>
|
</label>
|
||||||
<?php
|
|
||||||
}
|
<?php } ?>
|
||||||
?>
|
|
||||||
<input type="submit" class="btn btn-blue" value="Save" name="user-profile">
|
<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>
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>" class="btn"><?php $Language->p('Cancel') ?></a>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -56,6 +61,7 @@
|
||||||
|
|
||||||
<div id="email">
|
<div id="email">
|
||||||
<form method="post" action="" class="forms">
|
<form method="post" action="" class="forms">
|
||||||
|
<input type="hidden" name="edit-user" value="true">
|
||||||
<input type="hidden" name="username" value="<?php echo $_user['username'] ?>">
|
<input type="hidden" name="username" value="<?php echo $_user['username'] ?>">
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
|
@ -64,7 +70,7 @@
|
||||||
<div class="forms-desc"><?php $Language->p('email-will-not-be-publicly-displayed') ?></div>
|
<div class="forms-desc"><?php $Language->p('email-will-not-be-publicly-displayed') ?></div>
|
||||||
</label>
|
</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>
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>" class="btn"><?php $Language->p('Cancel') ?></a>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -75,6 +81,7 @@
|
||||||
|
|
||||||
<div id="password">
|
<div id="password">
|
||||||
<form method="post" action="" class="forms">
|
<form method="post" action="" class="forms">
|
||||||
|
<input type="hidden" name="change-password" value="true">
|
||||||
<input type="hidden" name="username" value="<?php echo $_user['username'] ?>">
|
<input type="hidden" name="username" value="<?php echo $_user['username'] ?>">
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
|
@ -87,7 +94,32 @@
|
||||||
<input type="password" name="confirm-password" class="width-50">
|
<input type="password" name="confirm-password" class="width-50">
|
||||||
</label>
|
</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>
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>" class="btn"><?php $Language->p('Cancel') ?></a>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</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 } ?>
|
|
@ -1,12 +1,17 @@
|
||||||
<h2 class="title"><?php $Language->p('Login') ?></h2>
|
<h2 class="title"><?php $Language->p('Login') ?></h2>
|
||||||
|
|
||||||
<form method="post" action="<?php echo HTML_PATH_ADMIN_ROOT.'login' ?>" class="forms" autocomplete="off">
|
<form method="post" action="<?php echo HTML_PATH_ADMIN_ROOT.'login' ?>" class="forms" autocomplete="off">
|
||||||
|
|
||||||
|
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<input type="text" name="username" placeholder="<?php $Language->p('Username') ?>" class="width-100" autocomplete="off">
|
<input type="text" name="username" placeholder="<?php $Language->p('Username') ?>" class="width-100" autocomplete="off">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<input type="password" name="password" placeholder="<?php $Language->p('Password') ?>" class="width-100" autocomplete="off">
|
<input type="password" name="password" placeholder="<?php $Language->p('Password') ?>" class="width-100" autocomplete="off">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<button class="btn btn-blue width-100"><?php $Language->p('Login') ?></button>
|
<button class="btn btn-blue width-100"><?php $Language->p('Login') ?></button>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php $Language->p('Title') ?></th>
|
<th><?php $Language->p('Title') ?></th>
|
||||||
<th><?php $Language->p('Parent') ?></th>
|
<th><?php $Language->p('Parent') ?></th>
|
||||||
|
<th><?php $Language->p('Friendly URL') ?></th>
|
||||||
|
<th class="text-centered"><?php $Language->p('Position') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -24,8 +26,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<tr>';
|
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>'.$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>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php $Language->p('Title') ?></th>
|
<th><?php $Language->p('Title') ?></th>
|
||||||
<th><?php $Language->p('Published date') ?></th>
|
<th class="text-centered"><?php $Language->p('Published date') ?></th>
|
||||||
<th><?php $Language->p('Modified date') ?></th>
|
<th><?php $Language->p('Friendly URL') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -15,13 +15,37 @@
|
||||||
|
|
||||||
foreach($posts as $Post)
|
foreach($posts as $Post)
|
||||||
{
|
{
|
||||||
|
$status = false;
|
||||||
|
if($Post->scheduled()) {
|
||||||
|
$status = $Language->g('Scheduled');
|
||||||
|
}
|
||||||
|
elseif(!$Post->published()) {
|
||||||
|
$status = $Language->g('Draft');
|
||||||
|
}
|
||||||
|
|
||||||
echo '<tr>';
|
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><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>'.$Post->dateCreated().'</td>';
|
echo '<td class="text-centered">'.$Post->date().'</td>';
|
||||||
echo '<td>'.$Post->timeago().'</td>';
|
echo '<td><a target="_blank" href="'.$Post->permalink().'">'.$Url->filters('post').'/'.$Post->key().'</a></td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</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>
|
|
@ -2,28 +2,21 @@
|
||||||
|
|
||||||
<form method="post" action="" class="forms">
|
<form method="post" action="" class="forms">
|
||||||
|
|
||||||
|
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Title') ?>
|
<?php $Language->p('Title') ?>
|
||||||
<input id="jstitle" name="title" type="text" class="width-70">
|
<input id="jstitle" name="title" type="text" class="width-90">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label class="width-90">
|
||||||
<?php $Language->p('Content') ?> <span class="forms-desc"><?php $Language->p('HTML and Markdown code supported') ?></span>
|
<?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>
|
</label>
|
||||||
|
|
||||||
<?php
|
<button id="jsadvancedButton" class="btn btn-smaller"><?php $Language->p('Advanced options') ?></button>
|
||||||
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">';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<h4><?php $Language->p('Advanced options') ?></h4>
|
<div id="jsadvancedOptions">
|
||||||
|
|
||||||
<label for="jsparent">
|
<label for="jsparent">
|
||||||
<?php $Language->p('Parent') ?>
|
<?php $Language->p('Parent') ?>
|
||||||
|
@ -36,7 +29,6 @@
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
<div class="forms-desc">Tip/Help ???</div>
|
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
|
@ -45,19 +37,19 @@
|
||||||
<span class="input-prepend"><?php echo $Site->urlPage() ?><span id="jsparentExample"></span></span>
|
<span class="input-prepend"><?php echo $Site->urlPage() ?><span id="jsparentExample"></span></span>
|
||||||
<input id="jsslug" name="slug" type="text">
|
<input id="jsslug" name="slug" type="text">
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Description') ?>
|
<?php $Language->p('Description') ?>
|
||||||
<input id="jsdescription" name="description" type="text" class="width-50">
|
<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>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Tags') ?>
|
<?php $Language->p('Tags') ?>
|
||||||
<input id="jstags" name="tags" type="text" class="width-50">
|
<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>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
|
@ -105,6 +97,11 @@ $(document).ready(function()
|
||||||
checkSlugPage(text, parent, "", $("#jsslug"));
|
checkSlugPage(text, parent, "", $("#jsslug"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#jsadvancedButton").click(function() {
|
||||||
|
$("#jsadvancedOptions").slideToggle();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
|
@ -2,53 +2,52 @@
|
||||||
|
|
||||||
<form method="post" action="" class="forms">
|
<form method="post" action="" class="forms">
|
||||||
|
|
||||||
|
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Title') ?>
|
<?php $Language->p('Title') ?>
|
||||||
<input id="jstitle" name="title" type="text" class="width-70">
|
<input id="jstitle" name="title" type="text" class="width-90">
|
||||||
</label>
|
</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" ></textarea>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<button id="jsadvancedButton" class="btn btn-smaller"><?php $Language->p('Advanced options') ?></button>
|
||||||
|
|
||||||
|
<div id="jsadvancedOptions">
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Content') ?> <span class="forms-desc"><?php $Language->p('HTML and Markdown code supported') ?></span>
|
<?php $Language->p('Date') ?>
|
||||||
<textarea id="jscontent" name="content" rows="10" class="width-70"></textarea>
|
<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
|
|
||||||
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">';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<h4><?php $Language->p('Advanced options') ?></h4>
|
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Friendly Url') ?>
|
<?php $Language->p('Friendly Url') ?>
|
||||||
<div class="input-groups width-50">
|
<div class="input-groups width-50">
|
||||||
<span class="input-prepend"><?php echo $Site->urlPost() ?><span id="jsparentExample"></span></span>
|
<span class="input-prepend"><?php echo $Site->urlPost() ?><span id="jsparentExample"></span></span>
|
||||||
<input id="jsslug" name="slug" type="text">
|
<input id="jsslug" name="slug" type="text">
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Description') ?>
|
<?php $Language->p('Description') ?>
|
||||||
<input id="jsdescription" name="description" type="text" class="width-50">
|
<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>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Tags') ?>
|
<?php $Language->p('Tags') ?>
|
||||||
<input id="jstags" name="tags" type="text" class="width-50">
|
<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>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="btn btn-blue" name="publish"><?php $Language->p('Publish now') ?></button>
|
<button class="btn btn-blue" name="publish"><?php $Language->p('Publish') ?></button>
|
||||||
<button class="btn" name="draft"><?php $Language->p('Draft') ?></button>
|
<button class="btn" name="draft"><?php $Language->p('Draft') ?></button>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
@ -57,6 +56,7 @@
|
||||||
|
|
||||||
$(document).ready(function()
|
$(document).ready(function()
|
||||||
{
|
{
|
||||||
|
$("#jsdate").datetimepicker({format:"<?php echo DB_DATE_FORMAT ?>"});
|
||||||
|
|
||||||
$("#jstitle").keyup(function() {
|
$("#jstitle").keyup(function() {
|
||||||
var slug = $(this).val();
|
var slug = $(this).val();
|
||||||
|
@ -70,6 +70,11 @@ $(document).ready(function()
|
||||||
checkSlugPost(slug, "", $("#jsslug"));
|
checkSlugPost(slug, "", $("#jsslug"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#jsadvancedButton").click(function() {
|
||||||
|
$("#jsadvancedOptions").slideToggle();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
|
@ -5,17 +5,18 @@
|
||||||
{
|
{
|
||||||
echo '<div class="pluginBox">';
|
echo '<div class="pluginBox">';
|
||||||
|
|
||||||
echo '<p>'.$Plugin->name().'</p>';
|
echo '<p class="name">'.$Plugin->name().'</p>';
|
||||||
echo '<p>'.$Plugin->description().'</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()) {
|
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(method_exists($Plugin, 'form')) {
|
||||||
if($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.'configure-plugin/'.$Plugin->className().'" class="btn btn-small">'.$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 {
|
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>';
|
echo '</div>';
|
||||||
|
|
|
@ -15,6 +15,9 @@
|
||||||
|
|
||||||
<div id="general">
|
<div id="general">
|
||||||
<form method="post" action="" class="forms">
|
<form method="post" action="" class="forms">
|
||||||
|
|
||||||
|
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Site title') ?>
|
<?php $Language->p('Site title') ?>
|
||||||
<input type="text" name="title" class="width-50" value="<?php echo $Site->title() ?>">
|
<input type="text" name="title" class="width-50" value="<?php echo $Site->title() ?>">
|
||||||
|
@ -24,7 +27,7 @@
|
||||||
<label>
|
<label>
|
||||||
<?php $Language->p('Site slogan') ?>
|
<?php $Language->p('Site slogan') ?>
|
||||||
<input type="text" name="slogan" class="width-50" value="<?php echo $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>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
|
@ -50,6 +53,9 @@
|
||||||
|
|
||||||
<div id="advanced">
|
<div id="advanced">
|
||||||
<form method="post" action="" class="forms">
|
<form method="post" action="" class="forms">
|
||||||
|
|
||||||
|
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
|
||||||
|
|
||||||
<label for="postsperpage">
|
<label for="postsperpage">
|
||||||
<?php $Language->p('Posts per page') ?>
|
<?php $Language->p('Posts per page') ?>
|
||||||
<select name="postsperpage" class="width-50">
|
<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>
|
<div class="forms-desc"><?php $Language->p('number-of-posts-to-show-per-page') ?></div>
|
||||||
</label>
|
</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>
|
<label>
|
||||||
<?php $Language->p('Site URL') ?>
|
<?php $Language->p('Site URL') ?>
|
||||||
<input type="text" name="url" class="width-50" value="<?php echo $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>
|
<div class="forms-desc"><?php $Language->p('the-url-of-your-site') ?></div>
|
||||||
</label>
|
</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>
|
<h4><?php $Language->p('URL Filters') ?></h4>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
|
@ -110,6 +118,9 @@
|
||||||
|
|
||||||
<div id="regional">
|
<div id="regional">
|
||||||
<form method="post" action="" class="forms" name="form-regional">
|
<form method="post" action="" class="forms" name="form-regional">
|
||||||
|
|
||||||
|
<input type="hidden" id="jstoken" name="token" value="<?php $Security->printToken() ?>">
|
||||||
|
|
||||||
<label for="jslanguage">
|
<label for="jslanguage">
|
||||||
<?php $Language->p('Language') ?>
|
<?php $Language->p('Language') ?>
|
||||||
<select id="jslanguage" name="language" class="width-50">
|
<select id="jslanguage" name="language" class="width-50">
|
||||||
|
@ -164,5 +175,5 @@ $(document).ready(function() {
|
||||||
<!-- ===================================== -->
|
<!-- ===================================== -->
|
||||||
|
|
||||||
<div id="about">
|
<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>
|
</div>
|
|
@ -1,2 +1,24 @@
|
||||||
<h2 class="title"><i class="fa fa-adjust"></i> Themes</h2>
|
<h2 class="title"><i class="fa fa-adjust"></i><?php $Language->p('Themes') ?></h2>
|
||||||
<p>Not implemented...</p>
|
|
||||||
|
<?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>';
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
|
@ -24,7 +24,7 @@
|
||||||
echo '<td>'.$field['lastName'].'</td>';
|
echo '<td>'.$field['lastName'].'</td>';
|
||||||
echo '<td>'.$field['role'].'</td>';
|
echo '<td>'.$field['role'].'</td>';
|
||||||
echo '<td>'.$field['email'].'</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>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Bludit
|
||||||
|
|
||||||
|
Set the correct permissions on this directory.
|
||||||
|
|
||||||
|
Documentation:
|
||||||
|
- http://docs.bludit.com/en/troubleshooting/writing-test-failure-err205
|
13
features.txt
13
features.txt
|
@ -38,10 +38,23 @@ Si cambia el parent
|
||||||
verificar parent
|
verificar parent
|
||||||
mover directorio adentro del parent
|
mover directorio adentro del parent
|
||||||
|
|
||||||
|
—————————
|
||||||
|
Nuevo post
|
||||||
|
- Reindex dbtags
|
||||||
|
|
||||||
|
—————————
|
||||||
|
|
||||||
Editar usuario
|
Editar usuario
|
||||||
1- Usuario logueado
|
1- Usuario logueado
|
||||||
2- Ver si el usuario es administrador o si es el mismo usuario que se esta editando.
|
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 post->Publish->Manage posts
|
||||||
New page->Publish->Manage pages
|
New page->Publish->Manage pages
|
||||||
|
|
19
index.php
19
index.php
|
@ -4,7 +4,7 @@
|
||||||
* Bludit
|
* Bludit
|
||||||
* http://www.bludit.com
|
* http://www.bludit.com
|
||||||
* Author Diego Najar
|
* 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
|
// Check installation
|
||||||
|
@ -14,7 +14,7 @@ if( !file_exists('content/databases/site.php') )
|
||||||
exit('<a href="./install.php">First, install Bludit</a>');
|
exit('<a href="./install.php">First, install Bludit</a>');
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEBUG:
|
// Load time init
|
||||||
$loadTime = microtime(true);
|
$loadTime = microtime(true);
|
||||||
|
|
||||||
// Security constant
|
// Security constant
|
||||||
|
@ -23,7 +23,7 @@ define('BLUDIT', true);
|
||||||
// Directory separator
|
// Directory separator
|
||||||
define('DS', DIRECTORY_SEPARATOR);
|
define('DS', DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
// PHP paths
|
// PHP paths for init
|
||||||
define('PATH_ROOT', __DIR__.DS);
|
define('PATH_ROOT', __DIR__.DS);
|
||||||
define('PATH_BOOT', PATH_ROOT.'kernel'.DS.'boot'.DS);
|
define('PATH_BOOT', PATH_ROOT.'kernel'.DS.'boot'.DS);
|
||||||
|
|
||||||
|
@ -31,19 +31,10 @@ define('PATH_BOOT', PATH_ROOT.'kernel'.DS.'boot'.DS);
|
||||||
require(PATH_BOOT.'init.php');
|
require(PATH_BOOT.'init.php');
|
||||||
|
|
||||||
// Admin area
|
// Admin area
|
||||||
if($Url->whereAmI()==='admin')
|
if($Url->whereAmI()==='admin') {
|
||||||
{
|
|
||||||
require(PATH_BOOT.'admin.php');
|
require(PATH_BOOT.'admin.php');
|
||||||
}
|
}
|
||||||
// Site
|
// Site
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
require(PATH_BOOT.'site.php');
|
require(PATH_BOOT.'site.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEBUG:
|
|
||||||
// Print all variables/objects
|
|
||||||
//print_r(get_defined_vars());
|
|
||||||
|
|
||||||
//var_dump($_SESSION);
|
|
||||||
//var_dump($Login->fingerPrint());
|
|
||||||
|
|
352
install.php
352
install.php
|
@ -1,11 +1,19 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Bludit
|
||||||
|
* http://www.bludit.com
|
||||||
|
* Author Diego Najar
|
||||||
|
* Bludit is opensource software licensed under the MIT license.
|
||||||
|
*/
|
||||||
|
|
||||||
// Security constant
|
// Security constant
|
||||||
define('BLUDIT', true);
|
define('BLUDIT', true);
|
||||||
|
|
||||||
// Directory separator
|
// Directory separator
|
||||||
define('DS', DIRECTORY_SEPARATOR);
|
define('DS', DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
// PATHs
|
// PHP paths
|
||||||
define('PATH_ROOT', __DIR__.DS);
|
define('PATH_ROOT', __DIR__.DS);
|
||||||
define('PATH_CONTENT', PATH_ROOT.'content'.DS);
|
define('PATH_CONTENT', PATH_ROOT.'content'.DS);
|
||||||
define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
|
define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
|
||||||
|
@ -13,39 +21,105 @@ define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS);
|
||||||
define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
|
define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
|
||||||
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
|
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
|
||||||
define('PATH_PLUGINS_DATABASES',PATH_CONTENT.'databases'.DS.'plugins'.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'));
|
define('DOMAIN', getenv('HTTP_HOST'));
|
||||||
|
|
||||||
// HTML PATHs
|
// HTML PATHs
|
||||||
$base = (dirname(getenv('SCRIPT_NAME'))==DS)?'/':dirname(getenv('SCRIPT_NAME')).'/';
|
$base = (dirname(getenv('SCRIPT_NAME'))==DS)?'/':dirname(getenv('SCRIPT_NAME')).'/';
|
||||||
define('HTML_PATH_ROOT', $base);
|
define('HTML_PATH_ROOT', $base);
|
||||||
|
|
||||||
|
// Log separator
|
||||||
|
define('LOG_SEP', ' | ');
|
||||||
|
|
||||||
|
// JSON
|
||||||
if(!defined('JSON_PRETTY_PRINT')) {
|
if(!defined('JSON_PRETTY_PRINT')) {
|
||||||
define('JSON_PRETTY_PRINT', 128);
|
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
|
// 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
|
// Thanks, http://stackoverflow.com/questions/4356289/php-random-string-generator
|
||||||
function getRandomString($length = 10) {
|
function getRandomString($length = 10) {
|
||||||
return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);
|
return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);
|
||||||
}
|
}
|
||||||
|
|
||||||
function alreadyInstalled()
|
// Check if Bludit is installed.
|
||||||
{
|
function alreadyInstalled() {
|
||||||
return file_exists(PATH_DATABASES.'site.php');
|
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()
|
function checkSystem()
|
||||||
{
|
{
|
||||||
$stdOut = array();
|
$stdOut = array();
|
||||||
$dirpermissions = 0755;
|
$dirpermissions = 0755;
|
||||||
$phpModules = array();
|
$phpModules = array();
|
||||||
|
|
||||||
if(function_exists('get_loaded_extensions'))
|
if(function_exists('get_loaded_extensions')) {
|
||||||
{
|
|
||||||
$phpModules = get_loaded_extensions();
|
$phpModules = get_loaded_extensions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,14 +141,14 @@ function checkSystem()
|
||||||
|
|
||||||
if(!in_array('dom', $phpModules))
|
if(!in_array('dom', $phpModules))
|
||||||
{
|
{
|
||||||
$errorText = 'PHP module DOM does not exist. (ERR_203)';
|
$errorText = 'PHP module DOM is not installed. (ERR_203)';
|
||||||
error_log($errorText, 0);
|
error_log($errorText, 0);
|
||||||
array_push($stdOut, $errorText);
|
array_push($stdOut, $errorText);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!in_array('json', $phpModules))
|
if(!in_array('json', $phpModules))
|
||||||
{
|
{
|
||||||
$errorText = 'PHP module JSON does not exist. (ERR_204)';
|
$errorText = 'PHP module JSON is not installed. (ERR_204)';
|
||||||
error_log($errorText, 0);
|
error_log($errorText, 0);
|
||||||
array_push($stdOut, $errorText);
|
array_push($stdOut, $errorText);
|
||||||
}
|
}
|
||||||
|
@ -91,8 +165,12 @@ function checkSystem()
|
||||||
|
|
||||||
function install($adminPassword, $email)
|
function install($adminPassword, $email)
|
||||||
{
|
{
|
||||||
|
global $Language;
|
||||||
|
|
||||||
$stdOut = array();
|
$stdOut = array();
|
||||||
|
|
||||||
|
$currentDate = Date::current(DB_DATE_FORMAT);
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Create directories
|
// Create directories
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@ -113,9 +191,21 @@ function install($adminPassword, $email)
|
||||||
error_log($errorText, 0);
|
error_log($errorText, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!mkdir(PATH_PLUGINS_DATABASES, $dirpermissions, true))
|
if(!mkdir(PATH_PLUGINS_DATABASES.'pages', $dirpermissions, true))
|
||||||
{
|
{
|
||||||
$errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES;
|
$errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'pages';
|
||||||
|
error_log($errorText, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!mkdir(PATH_PLUGINS_DATABASES.'simplemde', $dirpermissions, true))
|
||||||
|
{
|
||||||
|
$errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'simplemde';
|
||||||
|
error_log($errorText, 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);
|
error_log($errorText, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,10 +226,9 @@ function install($adminPassword, $email)
|
||||||
'error'=>array(
|
'error'=>array(
|
||||||
'description'=>'Error page',
|
'description'=>'Error page',
|
||||||
'username'=>'admin',
|
'username'=>'admin',
|
||||||
'tags'=>'',
|
'tags'=>array(),
|
||||||
'status'=>'published',
|
'status'=>'published',
|
||||||
'unixTimeCreated'=>1430686755,
|
'date'=>$currentDate,
|
||||||
'unixTimeModified'=>0,
|
|
||||||
'position'=>0
|
'position'=>0
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -152,10 +241,9 @@ function install($adminPassword, $email)
|
||||||
'description'=>'Welcome to Bludit',
|
'description'=>'Welcome to Bludit',
|
||||||
'username'=>'admin',
|
'username'=>'admin',
|
||||||
'status'=>'published',
|
'status'=>'published',
|
||||||
'tags'=>'welcome, bludit, cms',
|
'tags'=>array('bludit'=>'Bludit','cms'=>'CMS','flat-files'=>'Flat files'),
|
||||||
'allowComments'=>false,
|
'allowComments'=>false,
|
||||||
'unixTimeCreated'=>1430875199,
|
'date'=>$currentDate
|
||||||
'unixTimeModified'=>0
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
file_put_contents(PATH_DATABASES.'posts.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
file_put_contents(PATH_DATABASES.'posts.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
||||||
|
@ -165,9 +253,9 @@ function install($adminPassword, $email)
|
||||||
'title'=>'Bludit',
|
'title'=>'Bludit',
|
||||||
'slogan'=>'cms',
|
'slogan'=>'cms',
|
||||||
'description'=>'',
|
'description'=>'',
|
||||||
'footer'=>'Footer text - ©2015',
|
'footer'=>Date::current('Y'),
|
||||||
'language'=>'english',
|
'language'=>$Language->getCurrentLocale(),
|
||||||
'locale'=>'en_US',
|
'locale'=>$Language->getCurrentLocale(),
|
||||||
'timezone'=>'UTC',
|
'timezone'=>'UTC',
|
||||||
'theme'=>'pure',
|
'theme'=>'pure',
|
||||||
'adminTheme'=>'default',
|
'adminTheme'=>'default',
|
||||||
|
@ -176,15 +264,14 @@ function install($adminPassword, $email)
|
||||||
'uriPost'=>'/post/',
|
'uriPost'=>'/post/',
|
||||||
'uriPage'=>'/',
|
'uriPage'=>'/',
|
||||||
'uriTag'=>'/tag/',
|
'uriTag'=>'/tag/',
|
||||||
'advancedOptions'=>'false',
|
'url'=>'http://'.DOMAIN.HTML_PATH_ROOT,
|
||||||
'url'=>'http://'.DOMAIN.HTML_PATH_ROOT
|
'cliMode'=>true
|
||||||
);
|
);
|
||||||
|
|
||||||
file_put_contents(PATH_DATABASES.'site.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
file_put_contents(PATH_DATABASES.'site.php', $dataHead.json_encode($data, JSON_PRETTY_PRINT), LOCK_EX);
|
||||||
|
|
||||||
$salt = getRandomString();
|
$salt = getRandomString();
|
||||||
$passwordHash = sha1($adminPassword.$salt);
|
$passwordHash = sha1($adminPassword.$salt);
|
||||||
$registered = time();
|
|
||||||
|
|
||||||
// File users.php
|
// File users.php
|
||||||
$data = array(
|
$data = array(
|
||||||
|
@ -196,50 +283,142 @@ function install($adminPassword, $email)
|
||||||
'password'=>$passwordHash,
|
'password'=>$passwordHash,
|
||||||
'salt'=>$salt,
|
'salt'=>$salt,
|
||||||
'email'=>$email,
|
'email'=>$email,
|
||||||
'registered'=>$registered
|
'registered'=>$currentDate
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
file_put_contents(PATH_DATABASES.'users.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 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'=>'"bold", "italic", "heading", "|", "quote", "unordered-list", "|", "link", "image", "code", "horizontal-rule", "|", "preview", "side-by-side", "fullscreen", "guide"'
|
||||||
|
),
|
||||||
|
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
|
// File index.txt for error page
|
||||||
$data = 'Title: Error
|
$data = 'Title: '.$Language->get('Error').'
|
||||||
Content: The page has not been found.';
|
Content: '.$Language->get('The page has not been found');
|
||||||
|
|
||||||
file_put_contents(PATH_PAGES.'error'.DS.'index.txt', $data, LOCK_EX);
|
file_put_contents(PATH_PAGES.'error'.DS.'index.txt', $data, LOCK_EX);
|
||||||
|
|
||||||
// File index.txt for welcome post
|
// File index.txt for welcome post
|
||||||
$data = 'title: First post
|
$data = 'Title: '.$Language->get('First post').'
|
||||||
Content:
|
Content:
|
||||||
|
|
||||||
Congratulations, you have installed **Bludit** successfully!
|
## '.$Language->get('Congratulations you have successfully installed your Bludit').'
|
||||||
---
|
|
||||||
|
|
||||||
What\'s next:
|
### '.$Language->get('Whats next').'
|
||||||
---
|
- '.$Language->get('Manage your Bludit from the admin panel').'
|
||||||
- Administrate your Bludit from the [admin area](./admin/)
|
- '.$Language->get('Follow Bludit on').' [Twitter](https://twitter.com/bludit) / [Facebook](https://www.facebook.com/pages/Bludit/239255789455913) / [Google+](https://plus.google.com/+Bluditcms)
|
||||||
- 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').'
|
||||||
- Visit the [forum](http://forum.bludit.com) for support
|
- '.$Language->get('Read the documentation for more information').'
|
||||||
- Read the [documentation](http://docs.bludit.com) for more information
|
- '.$Language->get('Share with your friends and enjoy');
|
||||||
- Share with your friend :D';
|
|
||||||
|
|
||||||
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
|
// MAIN
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
if( alreadyInstalled() )
|
$error = '';
|
||||||
{
|
|
||||||
|
if( alreadyInstalled() ) {
|
||||||
exit('Bludit already installed');
|
exit('Bludit already installed');
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
{
|
{
|
||||||
if(install($_POST['password'],$_POST['email']))
|
$error = checkPOST($_POST);
|
||||||
|
|
||||||
|
if($error===true)
|
||||||
{
|
{
|
||||||
if(!headers_sent())
|
if(!headers_sent())
|
||||||
{
|
{
|
||||||
|
@ -247,7 +426,7 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit('<meta http-equiv="refresh" content="0; url="'.HTML_PATH_ROOT.'" />');
|
exit('<meta http-equiv="refresh" content="0; url="'.HTML_PATH_ROOT.'">');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,10 +436,10 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<base href="admin/themes/default/">
|
<base href="admin/themes/default/">
|
||||||
<meta charset="utf-8">
|
<meta charset="<?php echo CHARSET ?>">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<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/kube.min.css">
|
||||||
<link rel="stylesheet" href="./css/installer.css">
|
<link rel="stylesheet" href="./css/installer.css">
|
||||||
|
@ -272,57 +451,108 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||||
<div class="units-row">
|
<div class="units-row">
|
||||||
<div class="unit-centered unit-60">
|
<div class="unit-centered unit-60">
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<h1 class="title">Bludit Installer</h1>
|
|
||||||
<p>Welcome to the Bludit installer</p>
|
<h1 class="title"><?php echo $Language->get('Bludit Installer') ?></h1>
|
||||||
|
<p><?php echo $Language->get('Welcome to the Bludit installer') ?></p>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$system = checkSystem();
|
$system = checkSystem();
|
||||||
|
|
||||||
if(empty($system))
|
// Missing requirements
|
||||||
|
if(!empty($system))
|
||||||
{
|
{
|
||||||
|
echo '<div class="boxInstallerForm unit-centered unit-50">';
|
||||||
|
echo '<table class="table-stripped">';
|
||||||
|
|
||||||
|
foreach($system as $value) {
|
||||||
|
echo '<tr><td>'.$value.'</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '</table>';
|
||||||
|
echo '</div>';
|
||||||
|
}
|
||||||
|
// Second step
|
||||||
|
elseif(isset($_GET['language']))
|
||||||
|
{
|
||||||
|
|
||||||
|
?>
|
||||||
|
<p><?php echo $Language->get('Complete the form choose a password for the username admin') ?></p>
|
||||||
|
|
||||||
|
<div class="boxInstallerForm unit-centered unit-40">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if(!empty($error)) {
|
||||||
|
echo '<div class="tools-message tools-message-red">'.$error.'</div>';
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<p>Complete the form, choose a password for the username <strong>admin</strong></p>
|
<form id="jsformInstaller" method="post" action="" class="forms" autocomplete="off">
|
||||||
<div class="unit-centered unit-40">
|
|
||||||
<form 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>
|
<label>
|
||||||
<input type="text" value="admin" disabled="disabled" class="width-100">
|
<input type="text" value="admin" disabled="disabled" class="width-100">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<input type="password" name="password" placeholder="Password" class="width-100" autocomplete="off">
|
<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>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<input type="text" name="email" placeholder="Email" class="width-100" autocomplete="off">
|
<input type="text" name="email" id="jsemail" placeholder="<?php echo $Language->get('Email') ?>" class="width-100" autocomplete="off" maxlength="100">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<p>
|
<p><button class="btn btn-blue width-100"><?php echo $Language->get('Install') ?></button>
|
||||||
<button class="btn btn-blue width-100">Install</button>
|
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
} // END elseif(isset($_GET['language']))
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo '<div class="unit-centered unit-40">';
|
?>
|
||||||
echo '<table class="table-stripped">';
|
<p><?php echo $Language->get('Choose your language') ?></p>
|
||||||
|
|
||||||
foreach ($system as $value)
|
<div class="boxInstallerForm unit-centered unit-40">
|
||||||
{
|
|
||||||
echo '<tr><td>'.$value.'</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '</table>';
|
<form id="jsformLanguage" method="get" action="" class="forms" autocomplete="off">
|
||||||
echo '</div';
|
|
||||||
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function()
|
||||||
|
{
|
||||||
|
$("#jscompleteEmail").on("click", function() {
|
||||||
|
$("#jsnoCheckEmail").val("1");
|
||||||
|
if(!$("jspassword").val()) {
|
||||||
|
$("#jsformInstaller").submit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
|
@ -3,6 +3,7 @@
|
||||||
class dbJSON
|
class dbJSON
|
||||||
{
|
{
|
||||||
public $db;
|
public $db;
|
||||||
|
public $dbBackup;
|
||||||
public $file;
|
public $file;
|
||||||
public $firstLine;
|
public $firstLine;
|
||||||
|
|
||||||
|
@ -12,6 +13,7 @@ class dbJSON
|
||||||
{
|
{
|
||||||
$this->file = $file;
|
$this->file = $file;
|
||||||
$this->db = array();
|
$this->db = array();
|
||||||
|
$this->dbBackup = array();
|
||||||
$this->firstLine = $firstLine;
|
$this->firstLine = $firstLine;
|
||||||
|
|
||||||
if(file_exists($file))
|
if(file_exists($file))
|
||||||
|
@ -28,7 +30,15 @@ class dbJSON
|
||||||
$implode = implode($lines);
|
$implode = implode($lines);
|
||||||
|
|
||||||
// Unserialize, JSON to Array.
|
// 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
|
else
|
||||||
{
|
{
|
||||||
|
@ -36,18 +46,10 @@ class dbJSON
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get database.
|
public function restoreDb()
|
||||||
public function get()
|
|
||||||
{
|
{
|
||||||
return $this->db;
|
$this->db = $this->dbBackup;
|
||||||
}
|
return true;
|
||||||
|
|
||||||
// Set and save database.
|
|
||||||
public function set($db)
|
|
||||||
{
|
|
||||||
$this->db = $db;
|
|
||||||
|
|
||||||
return $this->save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the amount of database items.
|
// Returns the amount of database items.
|
||||||
|
@ -59,17 +61,20 @@ class dbJSON
|
||||||
// Save the JSON file.
|
// Save the JSON file.
|
||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
|
$data = '';
|
||||||
|
|
||||||
if($this->firstLine) {
|
if($this->firstLine) {
|
||||||
$data = "<?php defined('BLUDIT') or die('Bludit CMS.'); ?>".PHP_EOL;
|
$data = "<?php defined('BLUDIT') or die('Bludit CMS.'); ?>".PHP_EOL;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
$data = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Serialize database
|
||||||
$data .= $this->serialize($this->db);
|
$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.
|
// 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)
|
private function serialize($data)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class Plugin {
|
class Plugin {
|
||||||
|
|
||||||
// (string) Plugin's directory
|
// (string) Plugin's directory name
|
||||||
public $directoryName;
|
public $directoryName;
|
||||||
|
|
||||||
// (string) Database path and filename
|
// (string) Database path and filename
|
||||||
|
@ -27,7 +27,9 @@ class Plugin {
|
||||||
'description'=>'',
|
'description'=>'',
|
||||||
'author'=>'',
|
'author'=>'',
|
||||||
'email'=>'',
|
'email'=>'',
|
||||||
'website'=>''
|
'website'=>'',
|
||||||
|
'version'=>'',
|
||||||
|
'releaseDate'=>''
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->dbFields = array();
|
$this->dbFields = array();
|
||||||
|
@ -35,7 +37,7 @@ class Plugin {
|
||||||
$reflector = new ReflectionClass(get_class($this));
|
$reflector = new ReflectionClass(get_class($this));
|
||||||
|
|
||||||
// Directory name
|
// Directory name
|
||||||
$this->directoryName = basename(dirname($reflector->getFileName())).DS;
|
$this->directoryName = basename(dirname($reflector->getFileName()));
|
||||||
|
|
||||||
// Class Name
|
// Class Name
|
||||||
$this->className = $reflector->getName();
|
$this->className = $reflector->getName();
|
||||||
|
@ -46,7 +48,7 @@ class Plugin {
|
||||||
// Init empty database
|
// Init empty database
|
||||||
$this->db = $this->dbFields;
|
$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 the plugin installed then get the database.
|
||||||
if($this->installed())
|
if($this->installed())
|
||||||
|
@ -56,6 +58,11 @@ class Plugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function htmlPath()
|
||||||
|
{
|
||||||
|
return HTML_PATH_PLUGINS.$this->directoryName.'/';
|
||||||
|
}
|
||||||
|
|
||||||
// Returns the item from plugin-data.
|
// Returns the item from plugin-data.
|
||||||
public function getData($key)
|
public function getData($key)
|
||||||
{
|
{
|
||||||
|
@ -71,11 +78,19 @@ class Plugin {
|
||||||
$this->data = $array;
|
$this->data = $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDbField($key)
|
public function getDbField($key, $html=true)
|
||||||
{
|
{
|
||||||
if(isset($this->db[$key])) {
|
if(isset($this->db[$key])) {
|
||||||
|
|
||||||
|
if($html) {
|
||||||
|
// All fields from DBField are sanitized.
|
||||||
return $this->db[$key];
|
return $this->db[$key];
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// Decode HTML tags, this action unsanitized the variable.
|
||||||
|
return Sanitize::htmlDecode($this->db[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
@ -122,6 +137,16 @@ class Plugin {
|
||||||
return $this->getData('website');
|
return $this->getData('website');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function version()
|
||||||
|
{
|
||||||
|
return $this->getData('version');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function releaseDate()
|
||||||
|
{
|
||||||
|
return $this->getData('releaseDate');
|
||||||
|
}
|
||||||
|
|
||||||
public function className()
|
public function className()
|
||||||
{
|
{
|
||||||
return $this->className;
|
return $this->className;
|
||||||
|
@ -133,7 +158,7 @@ class Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return TRUE if the installation success, otherwise FALSE.
|
// Return TRUE if the installation success, otherwise FALSE.
|
||||||
public function install()
|
public function install($position=0)
|
||||||
{
|
{
|
||||||
if($this->installed()) {
|
if($this->installed()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -143,8 +168,8 @@ class Plugin {
|
||||||
mkdir(PATH_PLUGINS_DATABASES.$this->directoryName, 0755, true);
|
mkdir(PATH_PLUGINS_DATABASES.$this->directoryName, 0755, true);
|
||||||
|
|
||||||
// Create database
|
// Create database
|
||||||
$Tmp = new dbJSON($this->filenameDb);
|
$this->dbFields['position'] = $position;
|
||||||
$Tmp->set($this->dbFields);
|
$this->setDb($this->dbFields);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -166,65 +191,4 @@ class Plugin {
|
||||||
// The user can define your own dbFields.
|
// 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -25,40 +25,56 @@ if ( in_array( strtolower( ini_get( 'magic_quotes_gpc' ) ), array( '1', 'on' ) )
|
||||||
}
|
}
|
||||||
|
|
||||||
// AJAX
|
// AJAX
|
||||||
if( $Login->isLogged() && ($layout['slug']==='ajax') )
|
if( $layout['slug']==='ajax' )
|
||||||
|
{
|
||||||
|
if($Login->isLogged())
|
||||||
{
|
{
|
||||||
// Boot rules
|
|
||||||
// Ajax doesn't needs load rules
|
|
||||||
|
|
||||||
// Load AJAX file
|
// Load AJAX file
|
||||||
if( Sanitize::pathFile(PATH_AJAX, $layout['parameters'].'.php') )
|
if( Sanitize::pathFile(PATH_AJAX, $layout['parameters'].'.php') ) {
|
||||||
include(PATH_AJAX.$layout['parameters'].'.php');
|
include(PATH_AJAX.$layout['parameters'].'.php');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// ADMIN AREA
|
// ADMIN AREA
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Boot rules
|
// Boot rules
|
||||||
include(PATH_RULES.'70.build_posts.php');
|
include(PATH_RULES.'70.posts.php');
|
||||||
include(PATH_RULES.'70.build_pages.php');
|
include(PATH_RULES.'70.pages.php');
|
||||||
include(PATH_RULES.'80.plugins.php');
|
include(PATH_RULES.'80.plugins.php');
|
||||||
include(PATH_RULES.'99.header.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') )
|
if($Url->notFound() || !$Login->isLogged() || ($Url->slug()==='login') )
|
||||||
{
|
{
|
||||||
$layout['controller'] = 'login';
|
$layout['controller'] = 'login';
|
||||||
$layout['view'] = 'login';
|
$layout['view'] = 'login';
|
||||||
$layout['template'] = 'login.php';
|
$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
|
// 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');
|
include(PATH_ADMIN_THEMES.$Site->adminTheme().DS.'init.php');
|
||||||
|
}
|
||||||
|
|
||||||
// Load controller
|
// 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');
|
include(PATH_ADMIN_CONTROLLERS.$layout['controller'].'.php');
|
||||||
|
}
|
||||||
|
|
||||||
// Load view and theme
|
// 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']);
|
include(PATH_ADMIN_THEMES.$Site->adminTheme().DS.$layout['template']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Plugins after admin area loaded
|
||||||
|
Theme::plugins('afterAdminLoad');
|
||||||
|
}
|
|
@ -1,34 +1,48 @@
|
||||||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||||
|
|
||||||
// Log separator
|
// Bludit version
|
||||||
define('LOG_SEP', ' | ');
|
define('BLUDIT_VERSION', 'githubVersion');
|
||||||
|
define('BLUDIT_CODENAME', '');
|
||||||
|
define('BLUDIT_RELEASE_DATE', '');
|
||||||
|
|
||||||
// PHP PATHS
|
// 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
|
// PATH_ROOT and PATH_BOOT are defined in index.php
|
||||||
define('PATH_LANGUAGES', PATH_ROOT.'languages'.DS);
|
define('PATH_LANGUAGES', PATH_ROOT.'languages'.DS);
|
||||||
define('PATH_THEMES', PATH_ROOT.'themes'.DS);
|
define('PATH_THEMES', PATH_ROOT.'themes'.DS);
|
||||||
define('PATH_PLUGINS', PATH_ROOT.'plugins'.DS);
|
define('PATH_PLUGINS', PATH_ROOT.'plugins'.DS);
|
||||||
|
|
||||||
define('PATH_KERNEL', PATH_ROOT.'kernel'.DS);
|
define('PATH_KERNEL', PATH_ROOT.'kernel'.DS);
|
||||||
define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS);
|
define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS);
|
||||||
define('PATH_RULES', PATH_KERNEL.'boot'.DS.'rules'.DS);
|
define('PATH_RULES', PATH_KERNEL.'boot'.DS.'rules'.DS);
|
||||||
define('PATH_HELPERS', PATH_KERNEL.'helpers'.DS);
|
define('PATH_HELPERS', PATH_KERNEL.'helpers'.DS);
|
||||||
define('PATH_AJAX', PATH_KERNEL.'ajax'.DS);
|
define('PATH_AJAX', PATH_KERNEL.'ajax'.DS);
|
||||||
define('PATH_JS', PATH_KERNEL.'js'.DS);
|
define('PATH_JS', PATH_KERNEL.'js'.DS);
|
||||||
|
|
||||||
define('PATH_CONTENT', PATH_ROOT.'content'.DS);
|
define('PATH_CONTENT', PATH_ROOT.'content'.DS);
|
||||||
define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
|
define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
|
||||||
define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
|
define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
|
||||||
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
|
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
|
||||||
define('PATH_PLUGINS_DATABASES', PATH_CONTENT.'databases'.DS.'plugins'.DS);
|
define('PATH_PLUGINS_DATABASES', PATH_CONTENT.'databases'.DS.'plugins'.DS);
|
||||||
define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS);
|
define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS);
|
||||||
|
|
||||||
define('PATH_ADMIN', PATH_ROOT.'admin'.DS);
|
define('PATH_ADMIN', PATH_ROOT.'admin'.DS);
|
||||||
define('PATH_ADMIN_THEMES', PATH_ADMIN.'themes'.DS);
|
define('PATH_ADMIN_THEMES', PATH_ADMIN.'themes'.DS);
|
||||||
define('PATH_ADMIN_CONTROLLERS', PATH_ADMIN.'controllers'.DS);
|
define('PATH_ADMIN_CONTROLLERS', PATH_ADMIN.'controllers'.DS);
|
||||||
define('PATH_ADMIN_VIEWS', PATH_ADMIN.'views'.DS);
|
define('PATH_ADMIN_VIEWS', PATH_ADMIN.'views'.DS);
|
||||||
|
|
||||||
|
// Log separator
|
||||||
|
define('LOG_SEP', ' | ');
|
||||||
|
|
||||||
// JSON pretty print
|
// JSON pretty print
|
||||||
if(!defined('JSON_PRETTY_PRINT')) {
|
if(!defined('JSON_PRETTY_PRINT')) {
|
||||||
define('JSON_PRETTY_PRINT', 128);
|
define('JSON_PRETTY_PRINT', 128);
|
||||||
|
@ -38,55 +52,58 @@ if(!defined('JSON_PRETTY_PRINT')) {
|
||||||
define('SALT_LENGTH', 8);
|
define('SALT_LENGTH', 8);
|
||||||
|
|
||||||
// Page brake string
|
// Page brake string
|
||||||
define('PAGE_BRAKE', '<!-- pagebreak -->');
|
define('PAGE_BREAK', '<!-- pagebreak -->');
|
||||||
|
|
||||||
// Bludit version
|
// No parent character
|
||||||
define('BLUDIT_VERSION', 'githubVersion');
|
|
||||||
define('BLUDIT_CODENAME', '');
|
|
||||||
define('BLUDIT_RELEASE_DATE', '');
|
|
||||||
|
|
||||||
//
|
|
||||||
define('NO_PARENT_CHAR', '—');
|
define('NO_PARENT_CHAR', '—');
|
||||||
|
|
||||||
// Multibyte string / UTF-8
|
// Post per page on Manage->Posts
|
||||||
define('MB_STRING', extension_loaded('mbstring'));
|
define('POSTS_PER_PAGE_ADMIN', 10);
|
||||||
|
|
||||||
// Check if JSON encode and decode are enabled.
|
// Check if JSON encode and decode are enabled.
|
||||||
define('JSON', function_exists('json_encode'));
|
define('JSON', function_exists('json_encode'));
|
||||||
|
|
||||||
// TRUE if new posts hand-made set published, or FALSE for draft.
|
// 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');
|
define('CHARSET', 'UTF-8');
|
||||||
|
|
||||||
|
// Multibyte string extension loaded.
|
||||||
|
define('MB_STRING', extension_loaded('mbstring'));
|
||||||
|
|
||||||
if(MB_STRING)
|
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);
|
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);
|
mb_http_output(CHARSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Abstract Classes
|
// Inclde Abstract Classes
|
||||||
include(PATH_ABSTRACT.'dbjson.class.php');
|
include(PATH_ABSTRACT.'dbjson.class.php');
|
||||||
include(PATH_ABSTRACT.'filecontent.class.php');
|
include(PATH_ABSTRACT.'filecontent.class.php');
|
||||||
include(PATH_ABSTRACT.'plugin.class.php');
|
include(PATH_ABSTRACT.'plugin.class.php');
|
||||||
|
|
||||||
|
// Inclde Classes
|
||||||
include(PATH_KERNEL.'dbposts.class.php');
|
include(PATH_KERNEL.'dbposts.class.php');
|
||||||
include(PATH_KERNEL.'dbpages.class.php');
|
include(PATH_KERNEL.'dbpages.class.php');
|
||||||
include(PATH_KERNEL.'dbusers.class.php');
|
include(PATH_KERNEL.'dbusers.class.php');
|
||||||
|
include(PATH_KERNEL.'dbtags.class.php');
|
||||||
include(PATH_KERNEL.'dblanguage.class.php');
|
include(PATH_KERNEL.'dblanguage.class.php');
|
||||||
include(PATH_KERNEL.'dbsite.class.php');
|
include(PATH_KERNEL.'dbsite.class.php');
|
||||||
|
|
||||||
include(PATH_KERNEL.'post.class.php');
|
include(PATH_KERNEL.'post.class.php');
|
||||||
include(PATH_KERNEL.'page.class.php');
|
include(PATH_KERNEL.'page.class.php');
|
||||||
|
|
||||||
include(PATH_KERNEL.'url.class.php');
|
include(PATH_KERNEL.'url.class.php');
|
||||||
include(PATH_KERNEL.'login.class.php');
|
include(PATH_KERNEL.'login.class.php');
|
||||||
include(PATH_KERNEL.'parsedown.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.'text.class.php');
|
||||||
include(PATH_HELPERS.'log.class.php');
|
include(PATH_HELPERS.'log.class.php');
|
||||||
include(PATH_HELPERS.'date.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.'session.class.php');
|
||||||
include(PATH_HELPERS.'redirect.class.php');
|
include(PATH_HELPERS.'redirect.class.php');
|
||||||
include(PATH_HELPERS.'sanitize.class.php');
|
include(PATH_HELPERS.'sanitize.class.php');
|
||||||
|
include(PATH_HELPERS.'valid.class.php');
|
||||||
include(PATH_HELPERS.'filesystem.class.php');
|
include(PATH_HELPERS.'filesystem.class.php');
|
||||||
include(PATH_HELPERS.'alert.class.php');
|
include(PATH_HELPERS.'alert.class.php');
|
||||||
|
include(PATH_HELPERS.'paginator.class.php');
|
||||||
|
|
||||||
// Session
|
// Session
|
||||||
Session::start();
|
Session::start();
|
||||||
|
@ -108,20 +127,45 @@ if(Session::started()===false) {
|
||||||
$dbPosts = new dbPosts();
|
$dbPosts = new dbPosts();
|
||||||
$dbPages = new dbPages();
|
$dbPages = new dbPages();
|
||||||
$dbUsers = new dbUsers();
|
$dbUsers = new dbUsers();
|
||||||
|
$dbTags = new dbTags();
|
||||||
$Site = new dbSite();
|
$Site = new dbSite();
|
||||||
$Url = new Url();
|
$Url = new Url();
|
||||||
$Parsedown = new Parsedown();
|
$Parsedown = new Parsedown();
|
||||||
|
$Security = new Security();
|
||||||
|
|
||||||
// HTML PATHs
|
// 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);
|
define('HTML_PATH_ROOT', $base);
|
||||||
|
|
||||||
|
// Paths for themes
|
||||||
define('HTML_PATH_THEMES', HTML_PATH_ROOT.'themes/');
|
define('HTML_PATH_THEMES', HTML_PATH_ROOT.'themes/');
|
||||||
define('HTML_PATH_THEME', HTML_PATH_ROOT.'themes/'.$Site->theme().'/');
|
define('HTML_PATH_THEME', HTML_PATH_ROOT.'themes/'.$Site->theme().'/');
|
||||||
define('HTML_PATH_THEME_CSS', HTML_PATH_THEME.'css/');
|
define('HTML_PATH_THEME_CSS', HTML_PATH_THEME.'css/');
|
||||||
define('HTML_PATH_THEME_JS', HTML_PATH_THEME.'js/');
|
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', 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_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
|
// Objects with dependency
|
||||||
$Language = new dbLanguage( $Site->locale() );
|
$Language = new dbLanguage( $Site->locale() );
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -30,46 +30,37 @@ function build_page($key)
|
||||||
global $dbUsers;
|
global $dbUsers;
|
||||||
global $Parsedown;
|
global $Parsedown;
|
||||||
|
|
||||||
// Page object.
|
// Page object, content from FILE.
|
||||||
$Page = new Page($key);
|
$Page = new Page($key);
|
||||||
if( !$Page->isValid() ) {
|
if( !$Page->isValid() ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Page database.
|
// Page database, content from DATABASE JSON.
|
||||||
$db = $dbPages->getDb($key);
|
$db = $dbPages->getDb($key);
|
||||||
if( !$db ) {
|
if( !$db ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Foreach field from database.
|
// Foreach field from DATABASE.
|
||||||
foreach($db as $field=>$value)
|
foreach($db as $field=>$value) {
|
||||||
{
|
$Page->setField($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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Content in raw format
|
// Content in raw format
|
||||||
|
$contentRaw = $Page->content();
|
||||||
$Page->setField('contentRaw', $Page->content(), true);
|
$Page->setField('contentRaw', $Page->content(), true);
|
||||||
|
|
||||||
// Parse markdown content.
|
// 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);
|
$Page->setField('content', $content, true);
|
||||||
|
|
||||||
// Parse username for the page.
|
// Parse username for the page.
|
||||||
if( $dbUsers->userExists( $Page->username() ) )
|
if( $dbUsers->userExists( $Page->username() ) )
|
||||||
{
|
{
|
||||||
$user = $dbUsers->get( $Page->username() );
|
$user = $dbUsers->getDb( $Page->username() );
|
||||||
|
|
||||||
$Page->setField('authorFirstName', $user['firstName'], false);
|
$Page->setField('authorFirstName', $user['firstName'], false);
|
||||||
|
|
||||||
|
@ -145,6 +136,11 @@ function build_all_pages()
|
||||||
// Main
|
// Main
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
|
// Search for changes on pages by the user.
|
||||||
|
if( $Site->cliMode() ) {
|
||||||
|
$dbPages->regenerateCli();
|
||||||
|
}
|
||||||
|
|
||||||
// Filter by page, then build it
|
// Filter by page, then build it
|
||||||
if( ($Url->whereAmI()==='page') && ($Url->notFound()===false) )
|
if( ($Url->whereAmI()==='page') && ($Url->notFound()===false) )
|
||||||
{
|
{
|
||||||
|
@ -165,14 +161,13 @@ if( ($Url->whereAmI()==='page') && ($Url->notFound()===false) )
|
||||||
// Default homepage
|
// Default homepage
|
||||||
if($Url->notFound()===false)
|
if($Url->notFound()===false)
|
||||||
{
|
{
|
||||||
if( ($Site->homepage()!=='home') && ($Url->whereAmI()==='home') )
|
if( Text::isNotEmpty($Site->homepage()) && ($Url->whereAmI()==='home') )
|
||||||
{
|
{
|
||||||
$Url->setWhereAmI('page');
|
$Url->setWhereAmI('page');
|
||||||
|
|
||||||
$Page = build_page( $Site->homepage() );
|
$Page = build_page( $Site->homepage() );
|
||||||
|
|
||||||
if($Page===false)
|
if($Page===false) {
|
||||||
{
|
|
||||||
$Url->setWhereAmI('home');
|
$Url->setWhereAmI('home');
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,16 +5,29 @@
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
$plugins = array(
|
$plugins = array(
|
||||||
'onSiteHead'=>array(),
|
'siteHead'=>array(),
|
||||||
'onSiteBody'=>array(),
|
'siteBodyBegin'=>array(),
|
||||||
'onSiteSidebar'=>array(),
|
'siteBodyEnd'=>array(),
|
||||||
'onAdminHead'=>array(),
|
'siteSidebar'=>array(),
|
||||||
'onAdminBody'=>array(),
|
'beforeSiteLoad'=>array(),
|
||||||
'onAdminSidebar'=>array(),
|
'afterSiteLoad'=>array(),
|
||||||
'beforePostsLoad'=>array(),
|
|
||||||
'afterPostsLoad'=>array(),
|
'pageBegin'=>array(),
|
||||||
'beforePagesLoad'=>array(),
|
'pageEnd'=>array(),
|
||||||
'afterPagesLoad'=>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()
|
'all'=>array()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -51,18 +64,18 @@ function build_plugins()
|
||||||
$Plugin = new $pluginClass;
|
$Plugin = new $pluginClass;
|
||||||
|
|
||||||
// Set Plugin data
|
// 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) )
|
if( Sanitize::pathFile($languageFilename) )
|
||||||
{
|
{
|
||||||
$database = new dbJSON($languageFilename, false);
|
$database = new dbJSON($languageFilename, false);
|
||||||
}
|
}
|
||||||
else
|
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);
|
$database = new dbJSON($languageFilename, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$databaseArray = $database->get();
|
$databaseArray = $database->db;
|
||||||
$Plugin->setData( $databaseArray['plugin-data'] );
|
$Plugin->setData( $databaseArray['plugin-data'] );
|
||||||
|
|
||||||
// Add words to language dictionary.
|
// Add words to language dictionary.
|
||||||
|
@ -70,18 +83,14 @@ function build_plugins()
|
||||||
$Language->add($databaseArray);
|
$Language->add($databaseArray);
|
||||||
|
|
||||||
// Push Plugin to array all plugins installed and not installed.
|
// Push Plugin to array all plugins installed and not installed.
|
||||||
array_push($plugins['all'], $Plugin);
|
$plugins['all'][$pluginClass] = $Plugin;
|
||||||
|
|
||||||
// If the plugin installed
|
// If the plugin installed
|
||||||
if($Plugin->installed())
|
if($Plugin->installed())
|
||||||
{
|
{
|
||||||
foreach($pluginsEvents as $event=>$value)
|
foreach($pluginsEvents as $event=>$value)
|
||||||
{
|
{
|
||||||
/*
|
if(method_exists($Plugin, $event)) {
|
||||||
if($Plugin->onSiteHead()!==false)
|
|
||||||
array_push($plugins['onSiteHead'], $Plugin);
|
|
||||||
*/
|
|
||||||
if($Plugin->{$event}()!==false) {
|
|
||||||
array_push($plugins[$event], $Plugin);
|
array_push($plugins[$event], $Plugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,5 +5,3 @@ if($Url->notFound())
|
||||||
{
|
{
|
||||||
header('HTTP/1.0 404 Not Found');
|
header('HTTP/1.0 404 Not Found');
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
|
@ -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);
|
|
@ -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
|
||||||
|
// ============================================================================
|
|
@ -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);
|
||||||
|
}
|
|
@ -1,15 +1,28 @@
|
||||||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||||
|
|
||||||
// Boot rules
|
// Boot rules
|
||||||
include(PATH_RULES.'70.build_posts.php');
|
include(PATH_RULES.'70.posts.php');
|
||||||
include(PATH_RULES.'70.build_pages.php');
|
include(PATH_RULES.'70.pages.php');
|
||||||
include(PATH_RULES.'80.plugins.php');
|
include(PATH_RULES.'80.plugins.php');
|
||||||
include(PATH_RULES.'99.header.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
|
// 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');
|
include(PATH_THEMES.$Site->theme().DS.'init.php');
|
||||||
|
}
|
||||||
|
|
||||||
// Theme HTML
|
// 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');
|
include(PATH_THEMES.$Site->theme().DS.'index.php');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$Language->p('Please check your theme configuration');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Plugins after site loaded
|
||||||
|
Theme::plugins('afterSiteLoad');
|
|
@ -4,32 +4,40 @@ class dbLanguage extends dbJSON
|
||||||
{
|
{
|
||||||
public $data;
|
public $data;
|
||||||
public $db;
|
public $db;
|
||||||
|
public $currentLocale;
|
||||||
|
|
||||||
function __construct($language)
|
function __construct($locale)
|
||||||
{
|
{
|
||||||
$this->data = array();
|
$this->data = array();
|
||||||
$this->db = array();
|
$this->db = array();
|
||||||
|
$this->currentLocale = 'en_US';
|
||||||
|
|
||||||
// Default language en_US
|
// Default language en_US
|
||||||
$filename = PATH_LANGUAGES.'en_US.json';
|
$filename = PATH_LANGUAGES.'en_US.json';
|
||||||
if(file_exists($filename))
|
if( Sanitize::pathFile($filename) )
|
||||||
{
|
{
|
||||||
$Tmp = new dbJSON($filename, false);
|
$Tmp = new dbJSON($filename, false);
|
||||||
$this->db += $Tmp->db;
|
$this->db = array_merge($this->db, $Tmp->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
// User language
|
// User language
|
||||||
$filename = PATH_LANGUAGES.$language.'.json';
|
$filename = PATH_LANGUAGES.$locale.'.json';
|
||||||
if(file_exists($filename))
|
if( Sanitize::pathFile($filename) && ($locale!=="en_US") )
|
||||||
{
|
{
|
||||||
|
$this->currentLocale = $locale;
|
||||||
$Tmp = new dbJSON($filename, false);
|
$Tmp = new dbJSON($filename, false);
|
||||||
$this->db += $Tmp->db;
|
$this->db = array_merge($this->db, $Tmp->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->data = $this->db['language-data'];
|
$this->data = $this->db['language-data'];
|
||||||
unset($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.
|
// Return the translation, if the translation does'n exist then return the English translation.
|
||||||
public function get($string)
|
public function get($string)
|
||||||
{
|
{
|
||||||
|
@ -49,6 +57,12 @@ class dbLanguage extends dbJSON
|
||||||
return $this->get($string);
|
return $this->get($string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Print translation.
|
||||||
|
public function printMe($string)
|
||||||
|
{
|
||||||
|
echo $this->get($string);
|
||||||
|
}
|
||||||
|
|
||||||
// Print translation.
|
// Print translation.
|
||||||
public function p($string)
|
public function p($string)
|
||||||
{
|
{
|
||||||
|
@ -57,7 +71,7 @@ class dbLanguage extends dbJSON
|
||||||
|
|
||||||
public function add($array)
|
public function add($array)
|
||||||
{
|
{
|
||||||
$this->db += $array;
|
$this->db = array_merge($this->db, $array);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the item from plugin-data.
|
// Returns the item from plugin-data.
|
||||||
|
@ -73,7 +87,7 @@ class dbLanguage extends dbJSON
|
||||||
// Returns an array with all dictionaries.
|
// Returns an array with all dictionaries.
|
||||||
public function getLanguageList()
|
public function getLanguageList()
|
||||||
{
|
{
|
||||||
$files = glob(PATH_LANGUAGES.'*.json');
|
$files = Filesystem::listFiles(PATH_LANGUAGES, '*', 'json');
|
||||||
|
|
||||||
$tmp = array();
|
$tmp = array();
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,9 @@ class dbPages extends dbJSON
|
||||||
'content'=> array('inFile'=>true, 'value'=>''),
|
'content'=> array('inFile'=>true, 'value'=>''),
|
||||||
'description'=> array('inFile'=>false, 'value'=>''),
|
'description'=> array('inFile'=>false, 'value'=>''),
|
||||||
'username'=> array('inFile'=>false, 'value'=>''),
|
'username'=> array('inFile'=>false, 'value'=>''),
|
||||||
'tags'=> array('inFile'=>false, 'value'=>''),
|
'tags'=> array('inFile'=>false, 'value'=>array()),
|
||||||
'status'=> array('inFile'=>false, 'value'=>'draft'),
|
'status'=> array('inFile'=>false, 'value'=>'draft'),
|
||||||
'unixTimeCreated'=> array('inFile'=>false, 'value'=>0),
|
'date'=> array('inFile'=>false, 'value'=>0),
|
||||||
'unixTimeModified'=>array('inFile'=>false, 'value'=>0),
|
|
||||||
'position'=> 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
|
$dataForFile = array(); // This data will be saved in the file
|
||||||
|
|
||||||
$key = $this->generateKey($args['slug'], $args['parent']);
|
$key = $this->generateKey($args['slug'], $args['parent']);
|
||||||
if($key===false) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The user is always the one loggued.
|
// The user is always the one loggued.
|
||||||
$args['username'] = Session::get('username');
|
$args['username'] = Session::get('username');
|
||||||
|
@ -37,14 +33,20 @@ class dbPages extends dbJSON
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The current unix time stamp.
|
// Current date.
|
||||||
$args['unixTimeCreated'] = Date::unixTime();
|
if(empty($args['date'])) {
|
||||||
|
$args['date'] = Date::current(DB_DATE_FORMAT);
|
||||||
|
}
|
||||||
|
|
||||||
// Verify arguments with the database fields.
|
// Verify arguments with the database fields.
|
||||||
foreach($this->dbFields as $field=>$options)
|
foreach($this->dbFields as $field=>$options)
|
||||||
{
|
{
|
||||||
if( isset($args[$field]) )
|
if( isset($args[$field]) )
|
||||||
{
|
{
|
||||||
|
if($field=='tags') {
|
||||||
|
$tmpValue = $this->generateTags($args['tags']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
// Sanitize if will be saved on database.
|
// Sanitize if will be saved on database.
|
||||||
if( !$options['inFile'] ) {
|
if( !$options['inFile'] ) {
|
||||||
$tmpValue = Sanitize::html($args[$field]);
|
$tmpValue = Sanitize::html($args[$field]);
|
||||||
|
@ -53,6 +55,7 @@ class dbPages extends dbJSON
|
||||||
$tmpValue = $args[$field];
|
$tmpValue = $args[$field];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Default value for the field.
|
// Default value for the field.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -109,15 +112,23 @@ class dbPages extends dbJSON
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unix time created and modified.
|
// If the page is draft then the time created is now.
|
||||||
$args['unixTimeCreated'] = $this->db[$args['key']]['unixTimeCreated'];
|
if( $this->db[$args['key']]['status']=='draft' ) {
|
||||||
$args['unixTimeModified'] = Date::unixTime();
|
$args['date'] = Date::current(DB_DATE_FORMAT);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$args['date'] = $this->db[$args['key']]['date'];
|
||||||
|
}
|
||||||
|
|
||||||
// Verify arguments with the database fields.
|
// Verify arguments with the database fields.
|
||||||
foreach($this->dbFields as $field=>$options)
|
foreach($this->dbFields as $field=>$options)
|
||||||
{
|
{
|
||||||
if( isset($args[$field]) )
|
if( isset($args[$field]) )
|
||||||
{
|
{
|
||||||
|
if($field=='tags') {
|
||||||
|
$tmpValue = $this->generateTags($args['tags']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
// Sanitize if will be saved on database.
|
// Sanitize if will be saved on database.
|
||||||
if( !$options['inFile'] ) {
|
if( !$options['inFile'] ) {
|
||||||
$tmpValue = Sanitize::html($args[$field]);
|
$tmpValue = Sanitize::html($args[$field]);
|
||||||
|
@ -126,6 +137,7 @@ class dbPages extends dbJSON
|
||||||
$tmpValue = $args[$field];
|
$tmpValue = $args[$field];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Default value for the field.
|
// Default value for the field.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -283,62 +295,113 @@ class dbPages extends dbJSON
|
||||||
return $this->db;
|
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;
|
$db = $this->db;
|
||||||
$paths = array();
|
$newPaths = array();
|
||||||
$fields = array();
|
$fields = array();
|
||||||
|
|
||||||
// Complete $fields with the default values.
|
// Default fields and value
|
||||||
foreach($this->dbFields as $field=>$options) {
|
foreach($this->dbFields as $field=>$options) {
|
||||||
if(!$options['inFile']) {
|
if(!$options['inFile']) {
|
||||||
$fields[$field] = $options['value'];
|
$fields[$field] = $options['value'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Foreach new page set the unix time stamp.
|
//$tmpPaths = glob(PATH_PAGES.'*', GLOB_ONLYDIR);
|
||||||
$fields['unixTimeCreated'] = Date::unixTime();
|
$tmpPaths = Filesystem::listDirectories(PATH_PAGES);
|
||||||
|
|
||||||
// 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);
|
|
||||||
foreach($tmpPaths as $directory)
|
foreach($tmpPaths as $directory)
|
||||||
{
|
{
|
||||||
$key = basename($directory);
|
$key = basename($directory);
|
||||||
|
|
||||||
if(file_exists($directory.DS.'index.txt')) {
|
if(file_exists($directory.DS.'index.txt')) {
|
||||||
// The key is the directory name
|
// The key is the directory name
|
||||||
$paths[$key] = true;
|
$newPaths[$key] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recovery pages from subdirectories
|
// 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)
|
foreach($subPaths as $subDirectory)
|
||||||
{
|
{
|
||||||
$subKey = basename($subDirectory);
|
$subKey = basename($subDirectory);
|
||||||
|
|
||||||
if(file_exists($subDirectory.DS.'index.txt')) {
|
if(file_exists($subDirectory.DS.'index.txt')) {
|
||||||
// The key is composed by the directory/subdirectory
|
// The key is composed by the directory/subdirectory
|
||||||
$paths[$key.'/'.$subKey] = true;
|
$newPaths[$key.'/'.$subKey] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove old posts from db
|
foreach($newPaths as $key=>$value)
|
||||||
foreach( array_diff_key($db, $paths) as $slug=>$data ) {
|
{
|
||||||
unset($this->db[$slug]);
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert new posts to db
|
$Page = new Page($key);
|
||||||
foreach( array_diff_key($paths, $db) as $slug=>$data ) {
|
|
||||||
$this->db[$slug] = $fields;
|
// 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove old pages from db
|
||||||
|
foreach( array_diff_key($db, $newPaths) as $key=>$data ) {
|
||||||
|
unset($this->db[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the database.
|
// Save the database.
|
||||||
|
@ -349,5 +412,4 @@ class dbPages extends dbJSON
|
||||||
|
|
||||||
return $this->db!=$db;
|
return $this->db!=$db;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -7,19 +7,34 @@ class dbPosts extends dbJSON
|
||||||
'content'=> array('inFile'=>true, 'value'=>''),
|
'content'=> array('inFile'=>true, 'value'=>''),
|
||||||
'description'=> array('inFile'=>false, 'value'=>''),
|
'description'=> array('inFile'=>false, 'value'=>''),
|
||||||
'username'=> array('inFile'=>false, 'value'=>''),
|
'username'=> array('inFile'=>false, 'value'=>''),
|
||||||
'status'=> array('inFile'=>false, 'value'=>'draft'),
|
'status'=> array('inFile'=>false, 'value'=>'draft'), // published, draft, scheduled
|
||||||
'tags'=> array('inFile'=>false, 'value'=>''),
|
'tags'=> array('inFile'=>false, 'value'=>array()),
|
||||||
'allowComments'=> array('inFile'=>false, 'value'=>false),
|
'allowComments'=> array('inFile'=>false, 'value'=>false),
|
||||||
'unixTimeCreated'=> array('inFile'=>false, 'value'=>0),
|
'date'=> array('inFile'=>false, 'value'=>'')
|
||||||
'unixTimeModified'=>array('inFile'=>false, 'value'=>0)
|
);
|
||||||
|
|
||||||
|
private $numberPosts = array(
|
||||||
|
'total'=>0,
|
||||||
|
'published'=>0
|
||||||
);
|
);
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct(PATH_DATABASES.'posts.php');
|
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)
|
public function getDb($key)
|
||||||
{
|
{
|
||||||
if($this->postExists($key)) {
|
if($this->postExists($key)) {
|
||||||
|
@ -29,6 +44,15 @@ class dbPosts extends dbJSON
|
||||||
return false;
|
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.
|
// Return TRUE if the post exists, FALSE otherwise.
|
||||||
public function postExists($key)
|
public function postExists($key)
|
||||||
{
|
{
|
||||||
|
@ -67,26 +91,37 @@ class dbPosts extends dbJSON
|
||||||
{
|
{
|
||||||
$dataForDb = array(); // This data will be saved in the database
|
$dataForDb = array(); // This data will be saved in the database
|
||||||
$dataForFile = array(); // This data will be saved in the file
|
$dataForFile = array(); // This data will be saved in the file
|
||||||
|
$currentDate = Date::current(DB_DATE_FORMAT);
|
||||||
|
|
||||||
// Generate the database key.
|
// Generate the database key.
|
||||||
$key = $this->generateKey($args['slug']);
|
$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');
|
$args['username'] = Session::get('username');
|
||||||
if( Text::isEmpty($args['username']) ) {
|
if( Text::isEmpty($args['username']) ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The current unix time stamp.
|
// Date
|
||||||
if(empty($args['unixTimeCreated'])) {
|
if(!Valid::date($args['date'], DB_DATE_FORMAT)) {
|
||||||
$args['unixTimeCreated'] = Date::unixTime();
|
$args['date'] = $currentDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Schedule post?
|
||||||
|
if( ($args['date']>$currentDate) && ($args['status']=='published') ) {
|
||||||
|
$args['status'] = 'scheduled';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify arguments with the database fields.
|
// Verify arguments with the database fields.
|
||||||
foreach($this->dbFields as $field=>$options)
|
foreach($this->dbFields as $field=>$options)
|
||||||
{
|
{
|
||||||
|
// If the field is in the arguments.
|
||||||
if( isset($args[$field]) )
|
if( isset($args[$field]) )
|
||||||
{
|
{
|
||||||
|
if($field=='tags') {
|
||||||
|
$tmpValue = $this->generateTags($args['tags']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
// Sanitize if will be saved on database.
|
// Sanitize if will be saved on database.
|
||||||
if( !$options['inFile'] ) {
|
if( !$options['inFile'] ) {
|
||||||
$tmpValue = Sanitize::html($args[$field]);
|
$tmpValue = Sanitize::html($args[$field]);
|
||||||
|
@ -95,7 +130,8 @@ class dbPosts extends dbJSON
|
||||||
$tmpValue = $args[$field];
|
$tmpValue = $args[$field];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Default value for the field.
|
}
|
||||||
|
// Default value if not in the arguments.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$tmpValue = $options['value'];
|
$tmpValue = $options['value'];
|
||||||
|
@ -130,6 +166,10 @@ class dbPosts extends dbJSON
|
||||||
|
|
||||||
// Save the database
|
// Save the database
|
||||||
$this->db[$key] = $dataForDb;
|
$this->db[$key] = $dataForDb;
|
||||||
|
|
||||||
|
// Sort posts before save.
|
||||||
|
$this->sortByDate();
|
||||||
|
|
||||||
if( $this->save() === false ) {
|
if( $this->save() === false ) {
|
||||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.');
|
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.');
|
||||||
return false;
|
return false;
|
||||||
|
@ -140,10 +180,6 @@ class dbPosts extends dbJSON
|
||||||
|
|
||||||
public function edit($args)
|
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']) ) {
|
if( $this->delete($args['key']) ) {
|
||||||
return $this->add($args);
|
return $this->add($args);
|
||||||
}
|
}
|
||||||
|
@ -180,50 +216,246 @@ class dbPosts extends dbJSON
|
||||||
return true;
|
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;
|
$db = $this->db;
|
||||||
$paths = array();
|
$allPosts = array();
|
||||||
$fields = array();
|
$fields = array();
|
||||||
|
$currentDate = Date::current(DB_DATE_FORMAT);
|
||||||
|
|
||||||
// Default fields and value
|
// Generate default fields and values.
|
||||||
foreach($this->dbFields as $field=>$options) {
|
foreach($this->dbFields as $field=>$options) {
|
||||||
if(!$options['inFile']) {
|
if(!$options['inFile']) {
|
||||||
$fields[$field] = $options['value'];
|
$fields[$field] = $options['value'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unix time stamp
|
$fields['status'] = CLI_STATUS;
|
||||||
$fields['unixTimeCreated'] = Date::unixTime();
|
$fields['date'] = $currentDate;
|
||||||
|
|
||||||
// Username
|
|
||||||
$fields['username'] = 'admin';
|
$fields['username'] = 'admin';
|
||||||
|
|
||||||
if(HANDMADE_PUBLISHED) {
|
// Recovery posts from the first level of directories
|
||||||
$fields['status']='published';
|
$tmpPaths = Filesystem::listDirectories(PATH_POSTS);
|
||||||
}
|
|
||||||
|
|
||||||
// Recovery pages from the first level of directories
|
|
||||||
$tmpPaths = glob(PATH_POSTS.'*', GLOB_ONLYDIR);
|
|
||||||
foreach($tmpPaths as $directory)
|
foreach($tmpPaths as $directory)
|
||||||
{
|
{
|
||||||
|
if(file_exists($directory.DS.'index.txt'))
|
||||||
|
{
|
||||||
|
// The key is the directory name.
|
||||||
$key = basename($directory);
|
$key = basename($directory);
|
||||||
|
|
||||||
if(file_exists($directory.DS.'index.txt')) {
|
// All keys posts
|
||||||
// The key is the directory name
|
$allPosts[$key] = true;
|
||||||
$paths[$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
|
// Remove orphan posts from db, the orphan posts are posts deleted by hand (directory deleted).
|
||||||
foreach( array_diff_key($db, $paths) as $slug=>$data ) {
|
foreach( array_diff_key($db, $allPosts) as $key=>$data ) {
|
||||||
unset($this->db[$slug]);
|
unset($this->db[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert new posts to db
|
// Sort posts before save.
|
||||||
foreach( array_diff_key($paths, $db) as $slug=>$data ) {
|
$this->sortByDate();
|
||||||
$this->db[$slug] = $fields;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save the database.
|
// Save the database.
|
||||||
if( $this->save() === false ) {
|
if( $this->save() === false ) {
|
||||||
|
@ -234,63 +466,4 @@ class dbPosts extends dbJSON
|
||||||
return $this->db!=$db;
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -3,22 +3,22 @@
|
||||||
class dbSite extends dbJSON
|
class dbSite extends dbJSON
|
||||||
{
|
{
|
||||||
private $dbFields = array(
|
private $dbFields = array(
|
||||||
'title'=> array('inFile'=>false, 'value'=>''),
|
'title'=> array('inFile'=>false, 'value'=>'I am Guybrush Threepwood, mighty developer'),
|
||||||
'slogan'=> array('inFile'=>false, 'value'=>''),
|
'slogan'=> array('inFile'=>false, 'value'=>''),
|
||||||
'description'=> array('inFile'=>false, 'value'=>''),
|
'description'=> array('inFile'=>false, 'value'=>''),
|
||||||
'footer'=> array('inFile'=>false, 'value'=>''),
|
'footer'=> array('inFile'=>false, 'value'=>'I wanna be a pirate!'),
|
||||||
'postsperpage'=> array('inFile'=>false, 'value'=>''),
|
'postsperpage'=> array('inFile'=>false, 'value'=>''),
|
||||||
'language'=> array('inFile'=>false, 'value'=>'en'),
|
'language'=> array('inFile'=>false, 'value'=>'en'),
|
||||||
'locale'=> array('inFile'=>false, 'value'=>'en_US'),
|
'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'),
|
'theme'=> array('inFile'=>false, 'value'=>'pure'),
|
||||||
'adminTheme'=> array('inFile'=>false, 'value'=>'kure'),
|
'adminTheme'=> array('inFile'=>false, 'value'=>'default'),
|
||||||
'homepage'=> array('inFile'=>false, 'value'=>''),
|
'homepage'=> array('inFile'=>false, 'value'=>''),
|
||||||
'uriPage'=> array('inFile'=>false, 'value'=>'/'),
|
'uriPage'=> array('inFile'=>false, 'value'=>'/'),
|
||||||
'uriPost'=> array('inFile'=>false, 'value'=>'/post/'),
|
'uriPost'=> array('inFile'=>false, 'value'=>'/post/'),
|
||||||
'uriTag'=> array('inFile'=>false, 'value'=>'/tag/'),
|
'uriTag'=> array('inFile'=>false, 'value'=>'/tag/'),
|
||||||
'url'=> array('inFile'=>false, 'value'=>''),
|
'url'=> array('inFile'=>false, 'value'=>''),
|
||||||
'advancedOptions'=> array('inFile'=>false, 'value'=>'false')
|
'cliMode'=> array('inFile'=>false, 'value'=>true)
|
||||||
);
|
);
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
|
@ -64,8 +64,9 @@ class dbSite extends dbJSON
|
||||||
$filters['page'] = $this->db['uriPage'];
|
$filters['page'] = $this->db['uriPage'];
|
||||||
$filters['tag'] = $this->db['uriTag'];
|
$filters['tag'] = $this->db['uriTag'];
|
||||||
|
|
||||||
if(empty($filter))
|
if(empty($filter)) {
|
||||||
return $filters;
|
return $filters;
|
||||||
|
}
|
||||||
|
|
||||||
return $filters[$filter];
|
return $filters[$filter];
|
||||||
}
|
}
|
||||||
|
@ -97,15 +98,6 @@ class dbSite extends dbJSON
|
||||||
return $this->db['slogan'];
|
return $this->db['slogan'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function advancedOptions()
|
|
||||||
{
|
|
||||||
if($this->db['advancedOptions']==='true') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns the site description.
|
// Returns the site description.
|
||||||
public function description()
|
public function description()
|
||||||
{
|
{
|
||||||
|
@ -136,6 +128,12 @@ class dbSite extends dbJSON
|
||||||
return $this->db['url'];
|
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
|
// Returns the relative home link
|
||||||
public function homeLink()
|
public function homeLink()
|
||||||
{
|
{
|
||||||
|
@ -166,6 +164,16 @@ class dbSite extends dbJSON
|
||||||
return $this->db['locale'];
|
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.
|
// Returns the current homepage.
|
||||||
public function homepage()
|
public function homepage()
|
||||||
{
|
{
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -10,7 +10,7 @@ class dbUsers extends dbJSON
|
||||||
'password'=> array('inFile'=>false, 'value'=>''),
|
'password'=> array('inFile'=>false, 'value'=>''),
|
||||||
'salt'=> array('inFile'=>false, 'value'=>'!Pink Floyd!Welcome to the machine!'),
|
'salt'=> array('inFile'=>false, 'value'=>'!Pink Floyd!Welcome to the machine!'),
|
||||||
'email'=> array('inFile'=>false, 'value'=>''),
|
'email'=> array('inFile'=>false, 'value'=>''),
|
||||||
'registered'=> array('inFile'=>false, 'value'=>0)
|
'registered'=> array('inFile'=>false, 'value'=>'1985-03-15 10:00')
|
||||||
);
|
);
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
|
@ -19,7 +19,7 @@ class dbUsers extends dbJSON
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return an array with the username databases
|
// Return an array with the username databases
|
||||||
public function get($username)
|
public function getDb($username)
|
||||||
{
|
{
|
||||||
if($this->userExists($username))
|
if($this->userExists($username))
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,7 @@ class dbUsers extends dbJSON
|
||||||
{
|
{
|
||||||
$dataForDb = array();
|
$dataForDb = array();
|
||||||
|
|
||||||
$user = $this->get($args['username']);
|
$user = $this->getDb($args['username']);
|
||||||
|
|
||||||
if($user===false)
|
if($user===false)
|
||||||
{
|
{
|
||||||
|
@ -70,10 +70,10 @@ class dbUsers extends dbJSON
|
||||||
{
|
{
|
||||||
if( isset($this->dbFields[$field]) )
|
if( isset($this->dbFields[$field]) )
|
||||||
{
|
{
|
||||||
// Sanitize if will be saved on database.
|
// Sanitize.
|
||||||
$tmpValue = Sanitize::html($value);
|
$tmpValue = Sanitize::html($value);
|
||||||
|
|
||||||
// Set type
|
// Set type.
|
||||||
settype($tmpValue, gettype($this->dbFields[$field]['value']));
|
settype($tmpValue, gettype($this->dbFields[$field]['value']));
|
||||||
|
|
||||||
$user[$field] = $tmpValue;
|
$user[$field] = $tmpValue;
|
||||||
|
@ -90,6 +90,18 @@ class dbUsers extends dbJSON
|
||||||
return true;
|
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)
|
public function add($args)
|
||||||
{
|
{
|
||||||
$dataForDb = array();
|
$dataForDb = array();
|
||||||
|
@ -126,8 +138,8 @@ class dbUsers extends dbJSON
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The current unix time stamp.
|
// Current date.
|
||||||
$dataForDb['registered'] = Date::unixTime();
|
$dataForDb['registered'] = Date::current(DB_DATE_FORMAT);
|
||||||
|
|
||||||
// Password
|
// Password
|
||||||
$dataForDb['salt'] = Text::randomText(SALT_LENGTH);
|
$dataForDb['salt'] = Text::randomText(SALT_LENGTH);
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
<?php
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||||
|
|
||||||
/*
|
|
||||||
* 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 Cookie {
|
class Cookie {
|
||||||
|
|
||||||
|
@ -26,11 +17,9 @@ class Cookie {
|
||||||
setcookie($name, $value, time() + ($expire * 60));
|
setcookie($name, $value, time() + ($expire * 60));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function is_set($name)
|
public static function isSet($name)
|
||||||
{
|
{
|
||||||
return(isset($_COOKIE[$name]));
|
return(isset($_COOKIE[$name]));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
<?php
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||||
|
|
||||||
/*
|
|
||||||
* 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 Crypt {
|
class Crypt {
|
||||||
|
|
||||||
|
@ -41,12 +32,10 @@ class Crypt {
|
||||||
return('---');
|
return('---');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function get_hash($string, $salt = '$#!')
|
public static function getHash($string, $salt = '$#!')
|
||||||
{
|
{
|
||||||
$sha1 = sha1($string.$salt);
|
$sha1 = sha1($string.$salt);
|
||||||
|
|
||||||
return($sha1);
|
return($sha1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
|
@ -8,12 +8,19 @@ class Date {
|
||||||
return time();
|
return time();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Format a local time/date according to locale settings
|
// Return the local time/date according to locale settings.
|
||||||
public static function format($time, $format)
|
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)
|
public static function timeago($time)
|
||||||
|
@ -64,39 +71,4 @@ class Date {
|
||||||
|
|
||||||
return $tmp;
|
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 );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
<?php
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||||
|
|
||||||
/*
|
|
||||||
* 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 Email {
|
class Email {
|
||||||
|
|
||||||
|
@ -20,7 +11,7 @@ class Email {
|
||||||
|
|
||||||
$message = '<html>
|
$message = '<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Nibbleblog</title>
|
<title>Bludit</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div style="margin: 0px auto; border: 1px solid #F1F1F1; padding: 10px;">
|
<div style="margin: 0px auto; border: 1px solid #F1F1F1; padding: 10px;">
|
||||||
|
@ -34,5 +25,3 @@ class Email {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
|
@ -3,9 +3,28 @@
|
||||||
class Filesystem {
|
class Filesystem {
|
||||||
|
|
||||||
// NEW
|
// NEW
|
||||||
|
|
||||||
|
// Returns an array with the absolutes directories.
|
||||||
public static function listDirectories($path, $regex='*')
|
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)
|
public static function mkdir($pathname, $recursive=false)
|
||||||
|
|
|
@ -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>');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -55,35 +55,17 @@ class Sanitize {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// old
|
public static function email($email)
|
||||||
public static function ip($ip)
|
|
||||||
{
|
{
|
||||||
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)
|
public static function int($value)
|
||||||
{
|
|
||||||
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;
|
$value = (int)$value;
|
||||||
|
|
||||||
|
@ -93,17 +75,4 @@ class Sanitize {
|
||||||
return 0;
|
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
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -25,7 +25,8 @@ class Session {
|
||||||
// Gets current cookies params.
|
// Gets current cookies params.
|
||||||
$cookieParams = session_get_cookie_params();
|
$cookieParams = session_get_cookie_params();
|
||||||
|
|
||||||
session_set_cookie_params($cookieLifetime,
|
session_set_cookie_params(
|
||||||
|
$cookieLifetime,
|
||||||
$cookieParams["path"],
|
$cookieParams["path"],
|
||||||
$cookieParams["domain"],
|
$cookieParams["domain"],
|
||||||
$secure,
|
$secure,
|
||||||
|
@ -41,10 +42,7 @@ class Session {
|
||||||
// Regenerated the session, delete the old one. There are problems with AJAX.
|
// Regenerated the session, delete the old one. There are problems with AJAX.
|
||||||
//session_regenerate_id(true);
|
//session_regenerate_id(true);
|
||||||
|
|
||||||
if(self::$started) {
|
if(!self::$started) {
|
||||||
Log::set(__METHOD__.LOG_SEP.'Session started.');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to start the session.');
|
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to start the session.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,21 +54,14 @@ class Text {
|
||||||
|
|
||||||
public static function cleanUrl($string, $separator='-')
|
public static function cleanUrl($string, $separator='-')
|
||||||
{
|
{
|
||||||
// Delete characters
|
if(function_exists('iconv')) {
|
||||||
$string = str_replace(array("“", "”", "!", "*", "'", """, "(", ")", ";", ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]", "|"),'',$string);
|
$string = iconv('UTF-8', 'ASCII//TRANSLIT', $string);
|
||||||
$string = preg_replace('![^\\pL\d]+!u', $separator, $string);
|
}
|
||||||
|
|
||||||
// Remove spaces
|
$string = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $string);
|
||||||
$string = str_replace(' ',$separator, $string);
|
$string = trim($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 = self::lowercase($string);
|
$string = self::lowercase($string);
|
||||||
|
$string = preg_replace("/[\/_|+ -]+/", $separator, $string);
|
||||||
|
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
@ -153,4 +146,16 @@ class Text {
|
||||||
return !self::isEmpty($string);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -4,6 +4,17 @@ class Theme {
|
||||||
|
|
||||||
// NEW
|
// 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)
|
public static function css($files, $path=HTML_PATH_THEME_CSS, $echo=true)
|
||||||
{
|
{
|
||||||
if(!is_array($files)) {
|
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
|
// OLD
|
||||||
|
|
||||||
|
@ -120,17 +141,8 @@ class Theme {
|
||||||
return BLOG_URL;
|
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()
|
public static function name()
|
||||||
{
|
{
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -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'));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
|
@ -52,6 +52,9 @@ class Login {
|
||||||
|
|
||||||
public function verifyUser($username, $password)
|
public function verifyUser($username, $password)
|
||||||
{
|
{
|
||||||
|
$username = Sanitize::html($username);
|
||||||
|
$password = Sanitize::html($password);
|
||||||
|
|
||||||
$username = trim($username);
|
$username = trim($username);
|
||||||
$password = trim($password);
|
$password = trim($password);
|
||||||
|
|
||||||
|
@ -60,9 +63,9 @@ class Login {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = $this->dbUsers->get($username);
|
$user = $this->dbUsers->getDb($username);
|
||||||
if($user==false) {
|
if($user==false) {
|
||||||
Log::set(__METHOD__.LOG_SEP.'Username not exist: '.$username);
|
Log::set(__METHOD__.LOG_SEP.'Username does not exist: '.$username);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +78,7 @@ class Login {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Log::set(__METHOD__.LOG_SEP.'Password are differents.');
|
Log::set(__METHOD__.LOG_SEP.'Password incorrect.');
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -16,21 +16,13 @@ class Page extends fileContent
|
||||||
return $this->getField('title');
|
return $this->getField('title');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the content.
|
// Returns the content. This content is markdown parser.
|
||||||
// This content is markdown parser.
|
// (boolean) $html, TRUE returns the content without satinize, FALSE otherwise.
|
||||||
// $fullContent, TRUE returns all content, if FALSE returns the first part of the content.
|
public function content($html=true)
|
||||||
// $html, TRUE returns the content without satinize, FALSE otherwise.
|
|
||||||
public function content($fullContent=true, $html=true)
|
|
||||||
{
|
{
|
||||||
// This content is not sanitized.
|
// This content is not sanitized.
|
||||||
$content = $this->getField('content');
|
$content = $this->getField('content');
|
||||||
|
|
||||||
if(!$fullContent)
|
|
||||||
{
|
|
||||||
$explode = explode(PAGE_BRAKE, $content);
|
|
||||||
$content = $explode[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
if($html) {
|
if($html) {
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
@ -38,22 +30,14 @@ class Page extends fileContent
|
||||||
return Sanitize::html($content);
|
return Sanitize::html($content);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the content.
|
// Returns the content. This content is not markdown parser.
|
||||||
// This content is not markdown parser.
|
// (boolean) $raw, TRUE returns the content without sanitized, FALSE otherwise.
|
||||||
// $fullContent, TRUE returns all content, if FALSE returns the first part of the content.
|
public function contentRaw($raw=true)
|
||||||
// $html, TRUE returns the content without satinize, FALSE otherwise.
|
|
||||||
public function contentRaw($fullContent=true, $html=true)
|
|
||||||
{
|
{
|
||||||
// This content is not sanitized.
|
// This content is not sanitized.
|
||||||
$content = $this->getField('contentRaw');
|
$content = $this->getField('contentRaw');
|
||||||
|
|
||||||
if(!$fullContent)
|
if($raw) {
|
||||||
{
|
|
||||||
$explode = explode(PAGE_BRAKE, $content);
|
|
||||||
$content = $explode[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
if($html) {
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,15 +49,28 @@ class Page extends fileContent
|
||||||
return $this->getField('description');
|
return $this->getField('description');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tags()
|
public function tags($returnsArray=false)
|
||||||
{
|
{
|
||||||
return $this->getField('tags');
|
global $Url;
|
||||||
|
|
||||||
|
$tags = $this->getField('tags');
|
||||||
|
|
||||||
|
if($returnsArray) {
|
||||||
|
|
||||||
|
if($tags==false) {
|
||||||
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tagsArray()
|
return $tags;
|
||||||
{
|
}
|
||||||
$tags = $this->getField('tags');
|
else {
|
||||||
return explode(',', $tags);
|
if($tags==false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return string with tags separeted by comma.
|
||||||
|
return implode(', ', $tags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function position()
|
public function position()
|
||||||
|
@ -81,44 +78,17 @@ class Page extends fileContent
|
||||||
return $this->getField('position');
|
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.
|
// Returns the post date according to locale settings and format settings.
|
||||||
public function dateCreated($format=false)
|
public function date($format=false)
|
||||||
{
|
{
|
||||||
if($format===false) {
|
$date = $this->getField('date');
|
||||||
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;
|
||||||
|
|
||||||
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');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the page slug.
|
// Returns the page slug.
|
||||||
|
@ -184,7 +154,8 @@ class Page extends fileContent
|
||||||
public function children()
|
public function children()
|
||||||
{
|
{
|
||||||
$tmp = array();
|
$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) {
|
foreach($paths as $path) {
|
||||||
array_push($tmp, basename($path));
|
array_push($tmp, basename($path));
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(
|
protected $unmarkedBlockTypes = array(
|
||||||
'Code',
|
'Code',
|
||||||
);
|
);
|
||||||
|
@ -169,7 +163,7 @@ class Parsedown
|
||||||
|
|
||||||
# ~
|
# ~
|
||||||
|
|
||||||
if (isset($CurrentBlock['incomplete']))
|
if (isset($CurrentBlock['continuable']))
|
||||||
{
|
{
|
||||||
$Block = $this->{'block'.$CurrentBlock['type'].'Continue'}($Line, $CurrentBlock);
|
$Block = $this->{'block'.$CurrentBlock['type'].'Continue'}($Line, $CurrentBlock);
|
||||||
|
|
||||||
|
@ -185,8 +179,6 @@ class Parsedown
|
||||||
{
|
{
|
||||||
$CurrentBlock = $this->{'block'.$CurrentBlock['type'].'Complete'}($CurrentBlock);
|
$CurrentBlock = $this->{'block'.$CurrentBlock['type'].'Complete'}($CurrentBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($CurrentBlock['incomplete']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,7 +218,7 @@ class Parsedown
|
||||||
|
|
||||||
if (method_exists($this, 'block'.$blockType.'Continue'))
|
if (method_exists($this, 'block'.$blockType.'Continue'))
|
||||||
{
|
{
|
||||||
$Block['incomplete'] = true;
|
$Block['continuable'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$CurrentBlock = $Block;
|
$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);
|
$CurrentBlock = $this->{'block'.$CurrentBlock['type'].'Complete'}($CurrentBlock);
|
||||||
}
|
}
|
||||||
|
@ -394,16 +386,16 @@ class Parsedown
|
||||||
|
|
||||||
protected function blockFencedCode($Line)
|
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(
|
$Element = array(
|
||||||
'name' => 'code',
|
'name' => 'code',
|
||||||
'text' => '',
|
'text' => '',
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($matches[2]))
|
if (isset($matches[1]))
|
||||||
{
|
{
|
||||||
$class = 'language-'.$matches[2];
|
$class = 'language-'.$matches[1];
|
||||||
|
|
||||||
$Element['attributes'] = array(
|
$Element['attributes'] = array(
|
||||||
'class' => $class,
|
'class' => $class,
|
||||||
|
@ -673,7 +665,9 @@ class Parsedown
|
||||||
|
|
||||||
if (preg_match('/^<(\w*)(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*(\/)?>/', $Line['text'], $matches))
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -987,15 +981,13 @@ class Parsedown
|
||||||
{
|
{
|
||||||
$markup = '';
|
$markup = '';
|
||||||
|
|
||||||
$unexaminedText = $text;
|
# $excerpt is based on the first occurrence of a marker
|
||||||
|
|
||||||
$markerPosition = 0;
|
while ($excerpt = strpbrk($text, $this->inlineMarkerList))
|
||||||
|
|
||||||
while ($excerpt = strpbrk($unexaminedText, $this->inlineMarkerList))
|
|
||||||
{
|
{
|
||||||
$marker = $excerpt[0];
|
$marker = $excerpt[0];
|
||||||
|
|
||||||
$markerPosition += strpos($unexaminedText, $marker);
|
$markerPosition = strpos($text, $marker);
|
||||||
|
|
||||||
$Excerpt = array('text' => $excerpt, 'context' => $text);
|
$Excerpt = array('text' => $excerpt, 'context' => $text);
|
||||||
|
|
||||||
|
@ -1008,34 +1000,42 @@ class Parsedown
|
||||||
continue;
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# sets a default inline position
|
||||||
|
|
||||||
if ( ! isset($Inline['position']))
|
if ( ! isset($Inline['position']))
|
||||||
{
|
{
|
||||||
$Inline['position'] = $markerPosition;
|
$Inline['position'] = $markerPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# the text that comes before the inline
|
||||||
$unmarkedText = substr($text, 0, $Inline['position']);
|
$unmarkedText = substr($text, 0, $Inline['position']);
|
||||||
|
|
||||||
|
# compile the unmarked text
|
||||||
$markup .= $this->unmarkedText($unmarkedText);
|
$markup .= $this->unmarkedText($unmarkedText);
|
||||||
|
|
||||||
|
# compile the inline
|
||||||
$markup .= isset($Inline['markup']) ? $Inline['markup'] : $this->element($Inline['element']);
|
$markup .= isset($Inline['markup']) ? $Inline['markup'] : $this->element($Inline['element']);
|
||||||
|
|
||||||
|
# remove the examined text
|
||||||
$text = substr($text, $Inline['position'] + $Inline['extent']);
|
$text = substr($text, $Inline['position'] + $Inline['extent']);
|
||||||
|
|
||||||
$unexaminedText = $text;
|
|
||||||
|
|
||||||
$markerPosition = 0;
|
|
||||||
|
|
||||||
continue 2;
|
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);
|
$markup .= $this->unmarkedText($text);
|
||||||
|
@ -1476,7 +1476,7 @@ class Parsedown
|
||||||
return self::$instances[$name];
|
return self::$instances[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
$instance = new self();
|
$instance = new static();
|
||||||
|
|
||||||
self::$instances[$name] = $instance;
|
self::$instances[$name] = $instance;
|
||||||
|
|
||||||
|
|
|
@ -18,42 +18,37 @@ class Post extends fileContent
|
||||||
|
|
||||||
// Returns the content.
|
// Returns the content.
|
||||||
// This content is markdown parser.
|
// This content is markdown parser.
|
||||||
// $fullContent, TRUE returns all content, if FALSE returns the first part of the content.
|
// (boolean) $fullContent, TRUE returns all content, if FALSE returns the first part of the content.
|
||||||
// $html, TRUE returns the content without satinize, FALSE otherwise.
|
// (boolean) $raw, TRUE returns the content without sanitized, FALSE otherwise.
|
||||||
public function content($fullContent=true, $html=true)
|
public function content($fullContent=true, $raw=true)
|
||||||
{
|
{
|
||||||
// This content is not sanitized.
|
// This content is not sanitized.
|
||||||
$content = $this->getField('content');
|
$content = $this->getField('content');
|
||||||
|
|
||||||
if(!$fullContent)
|
if(!$fullContent) {
|
||||||
{
|
$content = $this->getField('breakContent');
|
||||||
$explode = explode(PAGE_BRAKE, $content);
|
|
||||||
$content = $explode[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($html) {
|
if($raw) {
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Sanitize::html($content);
|
return Sanitize::html($content);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the content.
|
public function readMore()
|
||||||
// This content is not markdown parser.
|
{
|
||||||
// $fullContent, TRUE returns all content, if FALSE returns the first part of the content.
|
return $this->getField('readMore');
|
||||||
// $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.
|
// This content is not sanitized.
|
||||||
$content = $this->getField('contentRaw');
|
$content = $this->getField('contentRaw');
|
||||||
|
|
||||||
if(!$fullContent)
|
if($raw) {
|
||||||
{
|
|
||||||
$explode = explode(PAGE_BRAKE, $content);
|
|
||||||
$content = $explode[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
if($html) {
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,6 +66,18 @@ class Post extends fileContent
|
||||||
return ($this->getField('status')==='published');
|
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()
|
public function username()
|
||||||
{
|
{
|
||||||
return $this->getField('username');
|
return $this->getField('username');
|
||||||
|
@ -91,46 +98,41 @@ class Post extends fileContent
|
||||||
return $this->getField('description');
|
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');
|
||||||
|
|
||||||
|
if($format) {
|
||||||
|
// En %d %b deberia ir el formato definido por el usuario
|
||||||
|
return Date::format($date, DB_DATE_FORMAT, '%d %B');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function unixTimeModified()
|
return $date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function tags($returnsArray=false)
|
||||||
{
|
{
|
||||||
return $this->getField('unixTimeModified');
|
global $Url;
|
||||||
|
|
||||||
|
$tags = $this->getField('tags');
|
||||||
|
|
||||||
|
if($returnsArray) {
|
||||||
|
|
||||||
|
if($tags==false) {
|
||||||
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dateCreated($format=false)
|
return $tags;
|
||||||
{
|
}
|
||||||
if($format===false) {
|
else {
|
||||||
return $this->getField('date');
|
if($tags==false) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$unixTimeCreated = $this->unixTimeCreated();
|
// Return string with tags separeted by comma.
|
||||||
|
return implode(', ', $tags);
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function timeago()
|
|
||||||
{
|
|
||||||
return $this->getField('timeago');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function tags()
|
|
||||||
{
|
|
||||||
return $this->getField('tags');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function slug()
|
public function slug()
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,10 +15,9 @@ class Url
|
||||||
// Decodes any %## encoding in the given string. Plus symbols ('+') are decoded to a space character.
|
// Decodes any %## encoding in the given string. Plus symbols ('+') are decoded to a space character.
|
||||||
$decode = urldecode($_SERVER['REQUEST_URI']);
|
$decode = urldecode($_SERVER['REQUEST_URI']);
|
||||||
|
|
||||||
// Parse, http://php.net/parse_url
|
// remove parameters GET, do not use parse_url because has problem with utf-8.
|
||||||
$parse = parse_url($decode);
|
$explode = explode('?', $decode);
|
||||||
|
$this->uri = $explode[0];
|
||||||
$this->uri = $parse['path'];
|
|
||||||
|
|
||||||
$this->parameters = $_GET;
|
$this->parameters = $_GET;
|
||||||
|
|
||||||
|
@ -101,9 +100,15 @@ class Url
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the filter used
|
// 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
|
// Return: home, tag, post
|
||||||
|
|
|
@ -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"
|
||||||
|
}
|
|
@ -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."
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"language-data":
|
"language-data":
|
||||||
{
|
{
|
||||||
"native": "English (United State)",
|
"native": "English (United States)",
|
||||||
"english-name": "English",
|
"english-name": "English",
|
||||||
"last-update": "2015-06-28",
|
"last-update": "2015-06-28",
|
||||||
"author": "Diego",
|
"author": "Diego",
|
||||||
|
@ -15,6 +15,7 @@
|
||||||
"editor": "Editor",
|
"editor": "Editor",
|
||||||
"dashboard": "Dashboard",
|
"dashboard": "Dashboard",
|
||||||
"role": "Role",
|
"role": "Role",
|
||||||
|
"post": "Post",
|
||||||
"posts": "Posts",
|
"posts": "Posts",
|
||||||
"users": "Users",
|
"users": "Users",
|
||||||
"administrator": "Administrator",
|
"administrator": "Administrator",
|
||||||
|
@ -46,9 +47,10 @@
|
||||||
"about": "About",
|
"about": "About",
|
||||||
"login": "Log in",
|
"login": "Log in",
|
||||||
"logout": "Log out",
|
"logout": "Log out",
|
||||||
"dasbhoard": "Dasbhoard",
|
|
||||||
"manage": "Manage",
|
"manage": "Manage",
|
||||||
"themes": "Themes",
|
"themes": "Themes",
|
||||||
|
"prev-page": "Prev page",
|
||||||
|
"next-page": "Next page",
|
||||||
"configure-plugin": "Configure plugin",
|
"configure-plugin": "Configure plugin",
|
||||||
"confirm-delete-this-action-cannot-be-undone": "Confirm delete, this action cannot be undone.",
|
"confirm-delete-this-action-cannot-be-undone": "Confirm delete, this action cannot be undone.",
|
||||||
"site-title": "Site title",
|
"site-title": "Site title",
|
||||||
|
@ -59,6 +61,7 @@
|
||||||
"site-url": "Site url",
|
"site-url": "Site url",
|
||||||
"writting-settings": "Writting settings",
|
"writting-settings": "Writting settings",
|
||||||
"url-filters": "URL filters",
|
"url-filters": "URL filters",
|
||||||
|
"page": "Page",
|
||||||
"pages": "Pages",
|
"pages": "Pages",
|
||||||
"home": "Home",
|
"home": "Home",
|
||||||
"welcome-back": "Welcome back",
|
"welcome-back": "Welcome back",
|
||||||
|
@ -66,7 +69,6 @@
|
||||||
"website": "Website",
|
"website": "Website",
|
||||||
"timezone": "Timezone",
|
"timezone": "Timezone",
|
||||||
"locale": "Locale",
|
"locale": "Locale",
|
||||||
"notifications": "Notifications",
|
|
||||||
"new-post": "New post",
|
"new-post": "New post",
|
||||||
"html-and-markdown-code-supported": "HTML and Markdown code supported",
|
"html-and-markdown-code-supported": "HTML and Markdown code supported",
|
||||||
"new-page": "New page",
|
"new-page": "New page",
|
||||||
|
@ -82,17 +84,31 @@
|
||||||
"publish-now": "Publish now",
|
"publish-now": "Publish now",
|
||||||
"first-name": "First name",
|
"first-name": "First name",
|
||||||
"last-name": "Last name",
|
"last-name": "Last name",
|
||||||
|
"bludit-version": "Bludit version",
|
||||||
|
"powered-by": "Powered by",
|
||||||
|
"recent-posts": "Recent Posts",
|
||||||
"manage-pages": "Manage pages",
|
"manage-pages": "Manage pages",
|
||||||
"advanced-options": "Advanced options",
|
"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",
|
"database-regenerated": "Database regenerated",
|
||||||
"html-markdown-code-supported": "HTML and Markdown code supported.",
|
"the-changes-have-been-saved": "The changes have been saved",
|
||||||
"enable-more-features-at": "Enable more features at",
|
"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",
|
"settings-advanced-writting-settings": "Settings->Advanced->Writting Settings",
|
||||||
"new-posts-and-pages-synchronized": "New posts and pages synchronized.",
|
"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.",
|
"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.",
|
"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-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.",
|
"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-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.",
|
"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.",
|
"number-of-posts-to-show-per-page": "Number of posts to show per page.",
|
||||||
|
@ -101,9 +117,51 @@
|
||||||
"select-your-sites-language": "Select your site's language.",
|
"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.",
|
"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-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",
|
"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.",
|
||||||
"email": "Email",
|
"this-field-can-help-describe-the-content": "This field can help describe the content in a few words. No more than 150 characters.",
|
||||||
"email": "Email",
|
"write-the-tags-separeted-by-comma": "Write the tags separeted by comma. eg: tag1, tag2, tag3",
|
||||||
"email": "Email",
|
"delete-the-user-and-all-its-posts":"Delete the user and all its posts",
|
||||||
"email": "Email"
|
"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"
|
||||||
}
|
}
|
|
@ -3,11 +3,157 @@
|
||||||
{
|
{
|
||||||
"native": "Español (Argentina)",
|
"native": "Español (Argentina)",
|
||||||
"english-name": "Spanish",
|
"english-name": "Spanish",
|
||||||
"last-update": "2015-06-28",
|
"last-update": "2015-08-16",
|
||||||
"author": "Diego",
|
"author": "Diego",
|
||||||
"email": "",
|
"email": "",
|
||||||
"website": ""
|
"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."
|
||||||
}
|
}
|
|
@ -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."
|
||||||
|
}
|
|
@ -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
Loading…
Reference in New Issue