Compare commits
No commits in common. "v3.0" and "0.6-beta2" have entirely different histories.
874 changed files with 15360 additions and 68390 deletions
18
.github/issue_template.md
vendored
18
.github/issue_template.md
vendored
|
@ -1,18 +0,0 @@
|
|||
Please follow the next steps. The issue will be closed if the following steps are not completed. Thank you. (You can remove this line).
|
||||
|
||||
### Describe your problem
|
||||
Complete here.
|
||||
|
||||
### Steps to reproduce the problem
|
||||
Complete here.
|
||||
|
||||
### Bludit version
|
||||
Complete here.
|
||||
|
||||
### PHP version
|
||||
If you do not know remove this line.
|
||||
|
||||
### PHP logs
|
||||
If you do not know remove this line.
|
||||
|
||||
The default settings of the PHP Error Log file varies from OS to OS. The location of the error log file itself can be set manually in the php.ini file. On a Windows server, in IIS, it may be something like `error_log = C:\log_files\php_errors.log` in Linux it may be a value of `/var/log/php_errors.log`.
|
37
.gitignore
vendored
37
.gitignore
vendored
|
@ -1,32 +1,7 @@
|
|||
.DS_Store
|
||||
dbgenerator.php
|
||||
bl-content/*
|
||||
!bl-content/.keep
|
||||
bl-content-migrator
|
||||
bl-plugins/timemachine
|
||||
bl-plugins/timemachine-x
|
||||
bl-plugins/discovery
|
||||
bl-plugins/updater
|
||||
bl-plugins/medium-editor
|
||||
bl-plugins/quill
|
||||
bl-plugins/yandex-metrica/
|
||||
bl-plugins/domain-migrator/
|
||||
bl-plugins/tail-writer/
|
||||
bl-kernel/bludit.pro.php
|
||||
bl-kernel/admin/themes/gris
|
||||
bl-themes/docs
|
||||
bl-themes/typerite
|
||||
bl-themes/docsx
|
||||
bl-themes/editorial
|
||||
bl-themes/mediumish
|
||||
bl-themes/clean-blog
|
||||
bl-themes/grayscale
|
||||
bl-themes/massively
|
||||
bl-themes/hyperspace
|
||||
bl-themes/striped
|
||||
bl-themes/log
|
||||
bl-themes/micro
|
||||
bl-themes/tagg
|
||||
bl-themes/small
|
||||
bl-themes/future-imperfect
|
||||
bl-themes/social-network
|
||||
!themes/pure
|
||||
themes/*
|
||||
content/databases
|
||||
content/pages
|
||||
content/posts
|
||||
content/uploads
|
||||
|
|
|
@ -5,15 +5,11 @@ AddDefaultCharset UTF-8
|
|||
# Enable rewrite rules
|
||||
RewriteEngine on
|
||||
|
||||
# Base directory
|
||||
RewriteBase /
|
||||
|
||||
# Deny direct access to the next directories
|
||||
RewriteRule ^bl-content/(databases|workspaces|pages|tmp)/.*$ - [R=404,L]
|
||||
# Deny direct access to .txt files
|
||||
RewriteRule ^content/(.*)\.txt$ - [R=404,L]
|
||||
|
||||
# All URL process by index.php
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*) index.php [PT,L]
|
||||
|
||||
</IfModule>
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"useTabs": false,
|
||||
"tabWidth": 2,
|
||||
"printWidth": 100
|
||||
}
|
21
LICENSE
21
LICENSE
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-2023 Diego Najar
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
74
README.md
74
README.md
|
@ -1,52 +1,44 @@
|
|||
# [Bludit](https://www.bludit.com/)
|
||||
[Bludit](http://www.bludit.com/) — Flat file CMS
|
||||
================================================
|
||||
Create your own Blog in seconds.
|
||||
|
||||
Bludit the Simple, Fast, and Flexible CMS.
|
||||
Fast, simple, extensible and Flat file CMS.
|
||||
|
||||
With Bludit, you can build your own website or blog in just seconds. It’s completely free, open-source, and easy to use. Bludit stores content in JSON format, eliminating the need for database installation or configuration. All you need is a web server with PHP support.
|
||||
- [Documentation](http://docs.bludit.com)
|
||||
- [Help and Support](http://forum.bludit.com)
|
||||
- [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)
|
||||
|
||||
As a Flat-File CMS, Bludit offers unparalleled flexibility and speed. Plus, with support for both Markdown and HTML code, creating and managing content has never been easier.
|
||||
Social
|
||||
------
|
||||
|
||||
## Resources
|
||||
- [Twitter](https://twitter.com/bludit)
|
||||
- [Facebook](https://www.facebook.com/bluditcms)
|
||||
- [Google+](https://plus.google.com/+Bluditcms)
|
||||
|
||||
- [Plugins](https://plugins.bludit.com)
|
||||
- [Themes](https://themes.bludit.com)
|
||||
- [Documentation](https://docs.bludit.com)
|
||||
- News and announcement on [Twitter](https://twitter.com/bludit), [Facebook](https://www.facebook.com/bluditcms), and [Reddit](https://www.reddit.com/r/bludit/)
|
||||
- Talk & Chat on [Discord](https://discord.gg/CFaXEdZWds)
|
||||
- Help and Support on [Forum](https://forum.bludit.org)
|
||||
- Bugs reports on [Github Issues](https://github.com/bludit/bludit/issues)
|
||||
[](https://gitter.im/dignajar/bludit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
## Requirements
|
||||
Requirements
|
||||
------------
|
||||
|
||||
- Webserver with PHP support.
|
||||
- PHP v5.6 or higher version.
|
||||
You only need a web server with PHP support.
|
||||
|
||||
- PHP 5.3 or higher.
|
||||
- PHP [mbstring](http://php.net/manual/en/book.mbstring.php) module for full UTF-8 support.
|
||||
- PHP [gd](http://php.net/manual/en/book.image.php) module for image processing.
|
||||
- PHP [dom](http://php.net/manual/en/book.dom.php) module for DOM manipulation.
|
||||
- PHP [json](http://php.net/manual/en/book.json.php) module for JSON manipulation.
|
||||
- Webserver:
|
||||
* Apache with [mod_rewrite](http://httpd.apache.org/docs/current/mod/mod_rewrite.html) module.
|
||||
* Lighttpd with [mod_rewrite](http://redmine.lighttpd.net/projects/1/wiki/docs_modrewrite) module.
|
||||
* Nginx with [ngx_http_rewrite_module](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html) module.
|
||||
|
||||
## Installation
|
||||
Installation guide
|
||||
------------------
|
||||
|
||||
1. Download the latest version from the official page: [Bludit.com](https://www.bludit.com)
|
||||
2. Extract the zip file into a directory, such as `bludit`.
|
||||
3. Upload the `bludit` directory to your web server or hosting.
|
||||
4. Visit your domain (e.g., https://example.com/bludit/).
|
||||
5. Follow the Bludit Installer to set up your website.
|
||||
1. Download the latest version from http://www.bludit.com/bludit_latest.zip
|
||||
2. Extract the zip file into a directory like `bludit`.
|
||||
3. Upload the directory `bludit` to your hosting server.
|
||||
4. Done!
|
||||
|
||||
## Quick installation for testing
|
||||
|
||||
You can use PHP Built-in web server (`php -S localhost:8000`) or [Docker image](https://hub.docker.com/r/bludit/docker/)
|
||||
|
||||
## Support Bludit
|
||||
|
||||
Bludit is open-source and free to use, but if you find the project useful and would like to support its development, you can contribute on [Patreon](https://www.patreon.com/bePatron?c=921115&rid=2458860). As a token of our appreciation, supporters will receive Bludit PRO.
|
||||
|
||||
If you prefer, you can also make a one-time donation to buy us a coffee or beer. Every contribution helps us continue to improve Bludit and provide the best possible experience for our users.
|
||||
|
||||
- [PayPal](https://www.paypal.me/bludit/10)
|
||||
- BTC (Network BTC): bc1qtets5pdj73uyysjpegfh2gar4pfywra4rglcph
|
||||
- ETH (Network ETH): 0x0d7D58D848aA5f175D75Ce4bC746bAC107f331b7
|
||||
|
||||
## License
|
||||
|
||||
Bludit is open source software licensed under the [MIT license](https://tldrlegal.com/license/mit-license).
|
||||
License
|
||||
-------
|
||||
Bludit is opensource software licensed under the [MIT license](https://tldrlegal.com/license/mit-license)
|
||||
|
|
7
admin/README.md
Normal file
7
admin/README.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Bludit
|
||||
|
||||
If you are reading this, you must enable rewrite module.
|
||||
|
||||
Documentation:
|
||||
- http://docs.bludit.com/en/getting-started/requirements
|
||||
- http://docs.bludit.com/en/troubleshooting/browser-returns-not-found
|
|
@ -4,7 +4,10 @@
|
|||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
if($Login->role()!=='admin') {
|
||||
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
|
||||
Redirect::page('admin', 'dashboard');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
|
@ -20,7 +23,4 @@ checkRole(array('admin'));
|
|||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('Categories');
|
||||
// ============================================================================
|
85
admin/controllers/add-user.php
Normal file
85
admin/controllers/add-user.php
Normal file
|
@ -0,0 +1,85 @@
|
|||
<?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
|
||||
// ============================================================================
|
||||
|
||||
function addUser($args)
|
||||
{
|
||||
global $dbUsers;
|
||||
global $Language;
|
||||
|
||||
// Check empty username
|
||||
if( Text::isEmpty($args['new_username']) )
|
||||
{
|
||||
Alert::set($Language->g('username-field-is-empty'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check already exist username
|
||||
if( $dbUsers->userExists($args['new_username']) )
|
||||
{
|
||||
Alert::set($Language->g('username-already-exists'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Password length
|
||||
if( strlen($args['new_password']) < 6 )
|
||||
{
|
||||
Alert::set($Language->g('Password must be at least 6 characters long'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check new password and confirm password are equal
|
||||
if( $args['new_password'] != $args['confirm_password'] )
|
||||
{
|
||||
Alert::set($Language->g('The password and confirmation password do not match'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Filter form fields
|
||||
$tmp = array();
|
||||
$tmp['username'] = $args['new_username'];
|
||||
$tmp['password'] = $args['new_password'];
|
||||
$tmp['role'] = $args['role'];
|
||||
|
||||
// Add the user to the database
|
||||
if( $dbUsers->add($tmp) )
|
||||
{
|
||||
Alert::set($Language->g('user-has-been-added-successfully'), ALERT_STATUS_OK);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to create the account.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
if( addUser($_POST) ) {
|
||||
Redirect::page('admin', 'users');
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
|
@ -4,7 +4,10 @@
|
|||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
if($Login->role()!=='admin') {
|
||||
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
|
||||
Redirect::page('admin', 'dashboard');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
|
@ -13,32 +16,36 @@ checkRole(array('admin'));
|
|||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
$_Plugin = false;
|
||||
$pluginClassName = $layout['parameters'];
|
||||
|
||||
foreach($plugins['all'] as $P)
|
||||
{
|
||||
if($P->className()==$pluginClassName) {
|
||||
$_Plugin = $P;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the plugin exists.
|
||||
if($_Plugin===false) {
|
||||
Redirect::page('admin', 'plugins');
|
||||
}
|
||||
|
||||
// Check if the plugin has the method form()
|
||||
if(!method_exists($_Plugin, 'form')) {
|
||||
Redirect::page('admin', 'plugins');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
if ($_POST['action']=='delete') {
|
||||
deleteCategory($_POST);
|
||||
} elseif ($_POST['action']=='edit') {
|
||||
editCategory($_POST);
|
||||
}
|
||||
|
||||
Redirect::page('categories');
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
$_Plugin->setDb($_POST);
|
||||
Alert::set($Language->g('the-changes-have-been-saved'));
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
$categoryKey = $layout['parameters'];
|
||||
|
||||
if (!$categories->exists($categoryKey)) {
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to get the category: '.$categoryKey);
|
||||
Redirect::page('categories');
|
||||
}
|
||||
|
||||
$categoryMap = $categories->getMap($categoryKey);
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('Edit Category').' [ '.$categoryMap['name'] . ' ] ';
|
37
admin/controllers/dashboard.php
Normal file
37
admin/controllers/dashboard.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
$_draftPosts = array();
|
||||
$_scheduledPosts = array();
|
||||
foreach($posts as $Post)
|
||||
{
|
||||
if($Post->draft()) {
|
||||
array_push($_draftPosts, $Post);
|
||||
}
|
||||
elseif($Post->scheduled()) {
|
||||
array_push($_scheduledPosts, $Post);
|
||||
}
|
||||
}
|
||||
|
||||
$_draftPages = array();
|
||||
foreach($pages as $Page)
|
||||
{
|
||||
if(!$Page->published()) {
|
||||
array_push($_draftPages, $Page);
|
||||
}
|
||||
}
|
74
admin/controllers/edit-page.php
Normal file
74
admin/controllers/edit-page.php
Normal file
|
@ -0,0 +1,74 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
function editPage($args)
|
||||
{
|
||||
global $dbPages;
|
||||
global $Language;
|
||||
|
||||
if(!isset($args['parent'])) {
|
||||
$args['parent'] = NO_PARENT_CHAR;
|
||||
}
|
||||
|
||||
// Edit the page.
|
||||
if( $dbPages->edit($args) )
|
||||
{
|
||||
$dbPages->regenerateCli();
|
||||
|
||||
Alert::set($Language->g('The changes have been saved'));
|
||||
Redirect::page('admin', 'edit-page/'.$args['slug']);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to edit the page.');
|
||||
}
|
||||
}
|
||||
|
||||
function deletePage($key)
|
||||
{
|
||||
global $dbPages;
|
||||
global $Language;
|
||||
|
||||
if( $dbPages->delete($key) )
|
||||
{
|
||||
Alert::set($Language->g('The page has been deleted successfully'));
|
||||
Redirect::page('admin', 'manage-pages');
|
||||
}
|
||||
else
|
||||
{
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to delete the page.');
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
if( isset($_POST['delete-page']) ) {
|
||||
deletePage($_POST['key']);
|
||||
}
|
||||
else {
|
||||
editPage($_POST);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
$_Page = $pages[$layout['parameters']];
|
82
admin/controllers/edit-post.php
Normal file
82
admin/controllers/edit-post.php
Normal file
|
@ -0,0 +1,82 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
function editPost($args)
|
||||
{
|
||||
global $dbPosts;
|
||||
global $Language;
|
||||
|
||||
// Edit the post.
|
||||
if( $dbPosts->edit($args) )
|
||||
{
|
||||
// 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['slug']);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to edit the post.');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function deletePost($key)
|
||||
{
|
||||
global $dbPosts;
|
||||
global $Language;
|
||||
|
||||
if( $dbPosts->delete($key) )
|
||||
{
|
||||
// Reindex tags, this function is in 70.posts.php
|
||||
reIndexTagsPosts();
|
||||
|
||||
Alert::set($Language->g('The post has been deleted successfully'));
|
||||
Redirect::page('admin', 'manage-posts');
|
||||
}
|
||||
else
|
||||
{
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to delete the post.');
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
if( isset($_POST['delete-post']) ) {
|
||||
deletePost($_POST['key']);
|
||||
}
|
||||
else {
|
||||
editPost($_POST);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
$_Post = buildPost($layout['parameters']);
|
||||
|
||||
$layout['title'] .= ' - '.$Language->g('Edit post').' - '.$_Post->title();
|
95
admin/controllers/edit-user.php
Normal file
95
admin/controllers/edit-user.php
Normal file
|
@ -0,0 +1,95 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
function editUser($args)
|
||||
{
|
||||
global $dbUsers;
|
||||
global $Language;
|
||||
|
||||
if( $dbUsers->set($args) ) {
|
||||
Alert::set($Language->g('The changes have been saved'));
|
||||
}
|
||||
else {
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to edit the user.');
|
||||
}
|
||||
}
|
||||
|
||||
function deleteUser($args, $deleteContent=false)
|
||||
{
|
||||
global $dbUsers;
|
||||
global $dbPosts;
|
||||
global $Language;
|
||||
global $Login;
|
||||
|
||||
// The user admin cannot be deleted.
|
||||
if($args['username']=='admin') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// The editors cannot delete users.
|
||||
if($Login->role()!=='admin') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if($deleteContent) {
|
||||
$dbPosts->deletePostsByUser($args['username']);
|
||||
}
|
||||
else {
|
||||
$dbPosts->linkPostsToUser($args['username'], 'admin');
|
||||
}
|
||||
|
||||
if( $dbUsers->delete($args['username']) ) {
|
||||
Alert::set($Language->g('User deleted'));
|
||||
}
|
||||
else {
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to delete the user.');
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
// Prevent editors to administrate other users.
|
||||
if($Login->role()!=='admin')
|
||||
{
|
||||
$_POST['username'] = $Login->username();
|
||||
unset($_POST['role']);
|
||||
}
|
||||
|
||||
if(isset($_POST['delete-user-all'])) {
|
||||
deleteUser($_POST, true);
|
||||
}
|
||||
elseif(isset($_POST['delete-user-associate'])) {
|
||||
deleteUser($_POST, false);
|
||||
}
|
||||
else {
|
||||
editUser($_POST);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
if($Login->role()!=='admin') {
|
||||
$layout['parameters'] = $Login->username();
|
||||
}
|
||||
|
||||
$_user = $dbUsers->getDb($layout['parameters']);
|
||||
|
||||
// If the user doesn't exist, redirect to the users list.
|
||||
if($_user===false) {
|
||||
Redirect::page('admin', 'users');
|
||||
}
|
||||
|
||||
$_user['username'] = $layout['parameters'];
|
|
@ -4,7 +4,10 @@
|
|||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
if($Login->role()!=='admin') {
|
||||
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
|
||||
Redirect::page('admin', 'dashboard');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
|
@ -18,15 +21,16 @@ checkRole(array('admin'));
|
|||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
if (createCategory($_POST)) {
|
||||
Redirect::page('categories');
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
$pluginClassName = $layout['parameters'];
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('New category');
|
||||
foreach($plugins['all'] as $P)
|
||||
{
|
||||
if($P->className()==$pluginClassName) {
|
||||
$P->install();
|
||||
}
|
||||
}
|
||||
|
||||
Redirect::page('admin', 'plugins');
|
|
@ -4,7 +4,10 @@
|
|||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
if($Login->role()!=='admin') {
|
||||
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
|
||||
Redirect::page('admin', 'dashboard');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
|
@ -21,19 +24,16 @@ checkRole(array('admin'));
|
|||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
$pluginClassName = $layout['parameters'];
|
||||
if (!activatePlugin($pluginClassName)) {
|
||||
Log::set('Fail when try to activate the plugin.', LOG_TYPE_ERROR);
|
||||
$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);
|
||||
}
|
||||
|
||||
if (isset($plugins['all'][$pluginClassName])) {
|
||||
$plugin = $plugins['all'][$pluginClassName];
|
||||
} else {
|
||||
Redirect::page('plugins');
|
||||
}
|
||||
|
||||
if (method_exists($plugin, 'form')) {
|
||||
Redirect::page('configure-plugin/'.$pluginClassName);
|
||||
}
|
||||
|
||||
Redirect::page('plugins#'.$pluginClassName);
|
||||
Redirect::page('admin', 'themes');
|
122
admin/controllers/login-email.php
Normal file
122
admin/controllers/login-email.php
Normal file
|
@ -0,0 +1,122 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
function checkPost($args)
|
||||
{
|
||||
global $Security;
|
||||
global $Language;
|
||||
global $dbUsers;
|
||||
global $Site;
|
||||
|
||||
if($Security->isBlocked()) {
|
||||
Alert::set($Language->g('IP address has been blocked').'<br>'.$Language->g('Try again in a few minutes'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Remove illegal characters from email
|
||||
$email = Sanitize::email($args['email']);
|
||||
|
||||
if(Valid::email($email))
|
||||
{
|
||||
// Get username associated to an email.
|
||||
$username = $dbUsers->getByEmail($email);
|
||||
if($username!=false)
|
||||
{
|
||||
// Generate the token and the token expiration date.
|
||||
$token = $dbUsers->generateTokenEmail($username);
|
||||
|
||||
// ---- EMAIL ----
|
||||
$link = $Site->url().'admin/login-email?tokenEmail='.$token.'&username='.$username;
|
||||
$subject = $Language->g('BLUDIT Login access code');
|
||||
$message = Text::replaceAssoc(
|
||||
array(
|
||||
'{{WEBSITE_NAME}}'=>$Site->title(),
|
||||
'{{LINK}}'=>'<a href="'.$link.'">'.$link.'</a>'
|
||||
),
|
||||
$Language->g('email-notification-login-access-code')
|
||||
);
|
||||
|
||||
$sent = Email::send(array(
|
||||
'from'=>$Site->emailFrom(),
|
||||
'to'=>$email,
|
||||
'subject'=>$subject,
|
||||
'message'=>$message
|
||||
));
|
||||
|
||||
if($sent) {
|
||||
Alert::set($Language->g('check-your-inbox-for-your-login-access-code'));
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
Alert::set($Language->g('There was a problem sending the email'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Bruteforce protection, add IP to blacklist.
|
||||
$Security->addLoginFail();
|
||||
Alert::set($Language->g('check-your-inbox-for-your-login-access-code'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkGet($args)
|
||||
{
|
||||
global $Security;
|
||||
global $Language;
|
||||
global $Login;
|
||||
|
||||
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->verifyUserByToken($args['username'], $args['tokenEmail']) )
|
||||
{
|
||||
// Renew the tokenCRFS. 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();
|
||||
return false;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// GET Method
|
||||
// ============================================================================
|
||||
|
||||
if( !empty($_GET['tokenEmail']) && !empty($_GET['username']) )
|
||||
{
|
||||
checkGet($_GET);
|
||||
}
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
checkPost($_POST);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
|
@ -4,36 +4,36 @@
|
|||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
// This function is used on the VIEW to show the tables
|
||||
function printTable($title, $array) {
|
||||
echo '<h2 class="mb-2 mt-4">'.$title.'</h2>';
|
||||
echo '<table class="table table-striped mt-3">
|
||||
<tbody>
|
||||
';
|
||||
function checkPost($args)
|
||||
{
|
||||
global $Security;
|
||||
global $Login;
|
||||
global $Language;
|
||||
|
||||
foreach ($array as $key=>$value) {
|
||||
if($value===false) { $value = 'false'; }
|
||||
elseif($value===true) { $value = 'true'; }
|
||||
echo '<tr>';
|
||||
echo '<td>'.$key.'</td>';
|
||||
if (is_array($value)) {
|
||||
echo '<td>'.json_encode($value).'</td>';
|
||||
} else {
|
||||
echo '<td>'.Sanitize::html($value).'</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
if($Security->isBlocked()) {
|
||||
Alert::set($Language->g('IP address has been blocked').'<br>'.$Language->g('Try again in a few minutes'));
|
||||
return false;
|
||||
}
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
// 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;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -44,8 +44,11 @@ function printTable($title, $array) {
|
|||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
checkPost($_POST);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
$layout['title'] .= ' - '.$L->g('Developers');
|
||||
// ============================================================================
|
|
@ -20,6 +20,7 @@
|
|||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
if ($login->logout()) {
|
||||
Redirect::admin();
|
||||
}
|
||||
if( $Login->logout())
|
||||
{
|
||||
Redirect::home();
|
||||
}
|
|
@ -4,12 +4,27 @@
|
|||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
function addPage($args)
|
||||
{
|
||||
global $dbPages;
|
||||
global $Language;
|
||||
|
||||
// Add the page.
|
||||
if( $dbPages->add($args) )
|
||||
{
|
||||
Alert::set($Language->g('Page added successfully'));
|
||||
Redirect::page('admin', 'manage-pages');
|
||||
}
|
||||
else
|
||||
{
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to create the page.');
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
@ -18,15 +33,11 @@ checkRole(array('admin'));
|
|||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
if (createUser($_POST)) {
|
||||
Redirect::page('users');
|
||||
}
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
addPage($_POST);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('Add a new user');
|
||||
// ============================================================================
|
48
admin/controllers/new-post.php
Normal file
48
admin/controllers/new-post.php
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
function addPost($args)
|
||||
{
|
||||
global $dbPosts;
|
||||
global $Language;
|
||||
|
||||
// Add the page.
|
||||
if( $dbPosts->add($args) )
|
||||
{
|
||||
// Reindex tags, this function is in 70.posts.php
|
||||
reIndexTagsPosts();
|
||||
|
||||
Alert::set($Language->g('Post added successfully'));
|
||||
Redirect::page('admin', 'manage-posts');
|
||||
}
|
||||
else
|
||||
{
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to create the post.');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
addPost($_POST);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
|
@ -4,7 +4,10 @@
|
|||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
if($Login->role()!=='admin') {
|
||||
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
|
||||
Redirect::page('admin', 'dashboard');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
|
@ -20,7 +23,4 @@ checkRole(array('admin'));
|
|||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('Plugins');
|
||||
// ============================================================================
|
78
admin/controllers/settings-advanced.php
Normal file
78
admin/controllers/settings-advanced.php
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?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
|
||||
// ============================================================================
|
||||
|
||||
function setSettings($args)
|
||||
{
|
||||
global $Site;
|
||||
global $Language;
|
||||
|
||||
// Add slash at the begin and end.
|
||||
// This fields are in the settings->advanced mode
|
||||
$args['url'] = Text::addSlashes($args['url'],false,true);
|
||||
$args['uriPost'] = Text::addSlashes($args['uriPost']);
|
||||
$args['uriPage'] = Text::addSlashes($args['uriPage']);
|
||||
$args['uriTag'] = Text::addSlashes($args['uriTag']);
|
||||
|
||||
if(($args['uriPost']==$args['uriPage']) || ($args['uriPost']==$args['uriTag']) || ($args['uriPage']==$args['uriTag']) )
|
||||
{
|
||||
$args = array();
|
||||
}
|
||||
|
||||
if( $Site->set($args) ) {
|
||||
Alert::set($Language->g('the-changes-have-been-saved'));
|
||||
}
|
||||
else {
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the settings.');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
setSettings($_POST);
|
||||
Redirect::page('admin', $layout['controller']);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
}
|
80
admin/controllers/settings-general.php
Normal file
80
admin/controllers/settings-general.php
Normal file
|
@ -0,0 +1,80 @@
|
|||
<?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
|
||||
// ============================================================================
|
||||
|
||||
function setSettings($args)
|
||||
{
|
||||
global $Site;
|
||||
global $Language;
|
||||
|
||||
// Add slash at the begin and end.
|
||||
// This fields are in the settings->advanced mode
|
||||
if(isset($args['form-advanced'])) {
|
||||
$args['url'] = Text::addSlashes($args['url'],false,true);
|
||||
$args['uriPost'] = Text::addSlashes($args['uriPost']);
|
||||
$args['uriPage'] = Text::addSlashes($args['uriPage']);
|
||||
$args['uriTag'] = Text::addSlashes($args['uriTag']);
|
||||
|
||||
if(($args['uriPost']==$args['uriPage']) || ($args['uriPost']==$args['uriTag']) || ($args['uriPage']==$args['uriTag']) )
|
||||
{
|
||||
$args = array();
|
||||
}
|
||||
}
|
||||
|
||||
if( $Site->set($args) ) {
|
||||
Alert::set($Language->g('the-changes-have-been-saved'));
|
||||
}
|
||||
else {
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the settings.');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
setSettings($_POST);
|
||||
Redirect::page('admin', $layout['controller']);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
}
|
80
admin/controllers/settings-regional.php
Normal file
80
admin/controllers/settings-regional.php
Normal file
|
@ -0,0 +1,80 @@
|
|||
<?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
|
||||
// ============================================================================
|
||||
|
||||
function setSettings($args)
|
||||
{
|
||||
global $Site;
|
||||
global $Language;
|
||||
|
||||
// Add slash at the begin and end.
|
||||
// This fields are in the settings->advanced mode
|
||||
if(isset($args['form-advanced'])) {
|
||||
$args['url'] = Text::addSlashes($args['url'],false,true);
|
||||
$args['uriPost'] = Text::addSlashes($args['uriPost']);
|
||||
$args['uriPage'] = Text::addSlashes($args['uriPage']);
|
||||
$args['uriTag'] = Text::addSlashes($args['uriTag']);
|
||||
|
||||
if(($args['uriPost']==$args['uriPage']) || ($args['uriPost']==$args['uriTag']) || ($args['uriPage']==$args['uriTag']) )
|
||||
{
|
||||
$args = array();
|
||||
}
|
||||
}
|
||||
|
||||
if( $Site->set($args) ) {
|
||||
Alert::set($Language->g('the-changes-have-been-saved'));
|
||||
}
|
||||
else {
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the settings.');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
setSettings($_POST);
|
||||
Redirect::page('admin', $layout['controller']);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
}
|
80
admin/controllers/settings.php
Normal file
80
admin/controllers/settings.php
Normal file
|
@ -0,0 +1,80 @@
|
|||
<?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
|
||||
// ============================================================================
|
||||
|
||||
function setSettings($args)
|
||||
{
|
||||
global $Site;
|
||||
global $Language;
|
||||
|
||||
// Add slash at the begin and end.
|
||||
// This fields are in the settings->advanced mode
|
||||
if(isset($args['form-advanced'])) {
|
||||
$args['url'] = Text::addSlashes($args['url'],false,true);
|
||||
$args['uriPost'] = Text::addSlashes($args['uriPost']);
|
||||
$args['uriPage'] = Text::addSlashes($args['uriPage']);
|
||||
$args['uriTag'] = Text::addSlashes($args['uriTag']);
|
||||
|
||||
if(($args['uriPost']==$args['uriPage']) || ($args['uriPost']==$args['uriTag']) || ($args['uriPage']==$args['uriTag']) )
|
||||
{
|
||||
$args = array();
|
||||
}
|
||||
}
|
||||
|
||||
if( $Site->set($args) ) {
|
||||
Alert::set($Language->g('the-changes-have-been-saved'));
|
||||
}
|
||||
else {
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the settings.');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
setSettings($_POST);
|
||||
Redirect::page('admin', $layout['controller']);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
}
|
49
admin/controllers/themes.php
Normal file
49
admin/controllers/themes.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?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);
|
||||
|
||||
foreach($themesPaths as $themePath)
|
||||
{
|
||||
$langLocaleFile = $themePath.DS.'languages'.DS.$Site->locale().'.json';
|
||||
$langDefaultFile = $themePath.DS.'languages'.DS.'en_US.json';
|
||||
|
||||
// Check if exists default language
|
||||
if( Sanitize::pathFile($langDefaultFile) )
|
||||
{
|
||||
$database = new dbJSON($langDefaultFile, false);
|
||||
$databaseArray = $database->db;
|
||||
|
||||
// Check if exists locale language
|
||||
if( Sanitize::pathFile($langLocaleFile) ) {
|
||||
$database = new dbJSON($langLocaleFile, false);
|
||||
$databaseArray['theme-data'] = array_merge($databaseArray['theme-data'], $database->db['theme-data']);
|
||||
}
|
||||
|
||||
$databaseArray['theme-data']['dirname'] = basename($themePath);
|
||||
|
||||
// Theme data
|
||||
array_push($themes, $databaseArray['theme-data']);
|
||||
}
|
||||
}
|
|
@ -4,14 +4,17 @@
|
|||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
if($Login->role()!=='admin') {
|
||||
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
|
||||
Redirect::page('admin', 'dashboard');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
|
@ -22,5 +25,8 @@ checkRole(array('admin'));
|
|||
// Main after POST
|
||||
// ============================================================================
|
||||
$pluginClassName = $layout['parameters'];
|
||||
deactivatePlugin($pluginClassName);
|
||||
Redirect::page('plugins');
|
||||
|
||||
$Plugin = new $pluginClassName;
|
||||
$Plugin->uninstall();
|
||||
|
||||
Redirect::page('admin', 'plugins');
|
73
admin/controllers/user-password.php
Normal file
73
admin/controllers/user-password.php
Normal file
|
@ -0,0 +1,73 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
function setPassword($username, $new_password, $confirm_password)
|
||||
{
|
||||
global $dbUsers;
|
||||
global $Language;
|
||||
|
||||
// Password length
|
||||
if( strlen($new_password) < 6 )
|
||||
{
|
||||
Alert::set($Language->g('Password must be at least 6 characters long'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
if($new_password===$confirm_password)
|
||||
{
|
||||
if( $dbUsers->setPassword($username, $new_password) ) {
|
||||
Alert::set($Language->g('The changes have been saved'), ALERT_STATUS_OK);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to change the user password.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Alert::set($Language->g('The password and confirmation password do not match'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
// Prevent editors to administrate other users.
|
||||
if($Login->role()!=='admin')
|
||||
{
|
||||
$_POST['username'] = $Login->username();
|
||||
unset($_POST['role']);
|
||||
}
|
||||
|
||||
if( setPassword($_POST['username'], $_POST['new_password'], $_POST['confirm_password']) ) {
|
||||
Redirect::page('admin', 'users');
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
if($Login->role()!=='admin') {
|
||||
$layout['parameters'] = $Login->username();
|
||||
}
|
||||
|
||||
$_user = $dbUsers->getDb($layout['parameters']);
|
||||
|
||||
// If the user doesn't exist, redirect to the users list.
|
||||
if($_user===false) {
|
||||
Redirect::page('admin', 'users');
|
||||
}
|
||||
|
||||
$_user['username'] = $layout['parameters'];
|
|
@ -4,7 +4,10 @@
|
|||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
if($Login->role()!=='admin') {
|
||||
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
|
||||
Redirect::page('admin', 'dashboard');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
|
@ -20,12 +23,9 @@ checkRole(array('admin'));
|
|||
|
||||
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
||||
{
|
||||
$site->set($_POST);
|
||||
$Site->set($_POST);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('Users');
|
254
admin/themes/default/css/default.css
Normal file
254
admin/themes/default/css/default.css
Normal file
|
@ -0,0 +1,254 @@
|
|||
/* ----------- UIKIT HACKs FOR BLUDIT ----------- */
|
||||
.uk-navbar {
|
||||
background: #EEEEEE !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.uk-button {
|
||||
color: #ffffff;
|
||||
padding: 2px 22px;
|
||||
text-shadow: none;
|
||||
background: #888888;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.uk-button:hover,
|
||||
.uk-button:focus {
|
||||
background-color: #777777;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.uk-button-primary {
|
||||
background: #2672ec;
|
||||
}
|
||||
|
||||
.uk-button-primary:hover {
|
||||
background: #1F5FC4;
|
||||
}
|
||||
|
||||
.uk-navbar-nav > li > a {
|
||||
border: none;
|
||||
height: 70px;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.uk-nav-navbar > li > a:hover {
|
||||
background: #2672ec;
|
||||
}
|
||||
|
||||
.uk-form-label {
|
||||
color: #666666;
|
||||
font-weight: normal !important;
|
||||
}
|
||||
|
||||
.uk-form-help-block {
|
||||
color: #AAAAAA;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.uk-table th,
|
||||
.uk-table td {
|
||||
padding: 15px 10px;
|
||||
}
|
||||
|
||||
.uk-badge {
|
||||
margin-right: 5px !important;
|
||||
font-size: 0.9em;
|
||||
padding: 2px 7px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #2672ec;
|
||||
}
|
||||
|
||||
a.bludit-logo {
|
||||
color: #848484 !important;
|
||||
}
|
||||
|
||||
a.bludit-logo:hover {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
.uk-panel-box {
|
||||
background: #F9F9F9 !important;
|
||||
}
|
||||
|
||||
/* ----------- BLUDIT ----------- */
|
||||
|
||||
#logo {
|
||||
background: #f4f4f4;
|
||||
padding:20px 0;
|
||||
}
|
||||
|
||||
h2.title {
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
button.delete-button {
|
||||
background: none;
|
||||
border: 0 none;
|
||||
color: #da2727;
|
||||
cursor: pointer;
|
||||
font-size: 0.9em;
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
button.delete-button:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#jscontent {
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
|
||||
/* ----------- ALERT ----------- */
|
||||
|
||||
#alert {
|
||||
display: none;
|
||||
color: #ffffff;
|
||||
padding: 24px;
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.alert-ok {
|
||||
background: rgba(48, 102, 187, 0.91);
|
||||
}
|
||||
|
||||
.alert-fail {
|
||||
background: rgba(187, 48, 48, 0.91);
|
||||
}
|
||||
|
||||
/* ----------- LOGIN FORM ----------- */
|
||||
|
||||
div.login-box > h1 {
|
||||
font-weight: lighter;
|
||||
letter-spacing: 4px;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
div.login-form {
|
||||
background: #f1f1f1 none repeat scroll 0 0;
|
||||
padding: 20px;
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
/* ----------- DASHBOARD ----------- */
|
||||
|
||||
div.dashboard-links {
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
div.dashboard-links h4 {
|
||||
margin-bottom: -8px !important;
|
||||
}
|
||||
|
||||
div.dashboard-links a {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
/* ----------- PLUGIN LIST / THEME LIST ----------- */
|
||||
|
||||
div.plugin-links > a {
|
||||
display: inline-block;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
div.plugin-links > span.separator {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.label-draft,
|
||||
.label-empty-title,
|
||||
.label-time {
|
||||
background: #2672ec none repeat scroll 0 0;
|
||||
border-radius: 2px;
|
||||
color: #ffffff;
|
||||
display: inline-block;
|
||||
padding: 0 8px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
margin-right: 5px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.label-empty-title {
|
||||
background: #ED8F26;
|
||||
}
|
||||
|
||||
.label-time {
|
||||
font-style: italic;
|
||||
background: #ED3A26;
|
||||
}
|
||||
|
||||
/* ----------- PAGINATOR ----------- */
|
||||
|
||||
#paginator ul {
|
||||
list-style-type: none;
|
||||
margin: 15px 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;
|
||||
margin: 0px 15px;
|
||||
}
|
||||
|
||||
#paginator li.right {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
/* ----------- PLUGINS FORM ----------- */
|
||||
|
||||
#jsformplugin div {
|
||||
margin-bottom: 1.1em;
|
||||
}
|
||||
|
||||
#jsformplugin label {
|
||||
margin: 0 0 5px 0 !important;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#jsformplugin div.tip {
|
||||
font-size: 0.9em;
|
||||
color: #AAAAAA;
|
||||
}
|
||||
|
||||
#jsformplugin input[type=text] {
|
||||
min-width: 400px;
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
#jsformplugin input[type="checkbox"] {
|
||||
vertical-align: middle;
|
||||
margin-left: 0px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#jsformplugin label.forCheckbox {
|
||||
margin-left: 3px;
|
||||
margin-bottom: 10px;
|
||||
display: inline-block;
|
||||
}
|
2
admin/themes/default/css/form-file.min.css
vendored
Normal file
2
admin/themes/default/css/form-file.min.css
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
.uk-form-file{display:inline-block;vertical-align:middle;position:relative;overflow:hidden}.uk-form-file input[type=file]{position:absolute;top:0;z-index:1;width:100%;opacity:0;cursor:pointer;left:0;font-size:500px}
|
63
admin/themes/default/css/installer.css
Normal file
63
admin/themes/default/css/installer.css
Normal file
|
@ -0,0 +1,63 @@
|
|||
/* ----------- UIKIT HACKs FOR BLUDIT ----------- */
|
||||
html {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
.uk-button-primary {
|
||||
background: #444;
|
||||
}
|
||||
|
||||
.uk-button-primary:hover {
|
||||
background: #333;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="password"] {
|
||||
border-color: #FFF !important;
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
input:disabled {
|
||||
background: #ccc;
|
||||
}
|
||||
|
||||
.uk-vertical-align-middle {
|
||||
margin-top: -100px;
|
||||
}
|
||||
|
||||
.uk-panel {
|
||||
background: #ffffff;
|
||||
display: block;
|
||||
margin: 20px 0;
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/* ----------- BLUDIT ----------- */
|
||||
|
||||
h1.title {
|
||||
font-weight: lighter;
|
||||
letter-spacing: 4px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
.content {
|
||||
|
||||
}
|
||||
|
||||
#jsshowPassword {
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
font-size: 1em;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#jscompleteEmail {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
568
admin/themes/default/css/jquery.datetimepicker.css
Normal file
568
admin/themes/default/css/jquery.datetimepicker.css
Normal file
|
@ -0,0 +1,568 @@
|
|||
.xdsoft_datetimepicker {
|
||||
box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.506);
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #bbb;
|
||||
border-left: 1px solid #ccc;
|
||||
border-right: 1px solid #ccc;
|
||||
border-top: 1px solid #ccc;
|
||||
color: #333;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
padding: 8px;
|
||||
padding-left: 0;
|
||||
padding-top: 2px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
display: none;
|
||||
}
|
||||
.xdsoft_datetimepicker.xdsoft_rtl {
|
||||
padding: 8px 0 8px 8px;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker iframe {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 75px;
|
||||
height: 210px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/*For IE8 or lower*/
|
||||
.xdsoft_datetimepicker button {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.xdsoft_noselect {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.xdsoft_noselect::selection { background: transparent }
|
||||
.xdsoft_noselect::-moz-selection { background: transparent }
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_inline {
|
||||
display: inline-block;
|
||||
position: static;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker * {
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_datepicker, .xdsoft_datetimepicker .xdsoft_timepicker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_datepicker.active, .xdsoft_datetimepicker .xdsoft_timepicker.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_datepicker {
|
||||
width: 224px;
|
||||
float: left;
|
||||
margin-left: 8px;
|
||||
}
|
||||
.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_datepicker {
|
||||
float: right;
|
||||
margin-right: 8px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_datepicker {
|
||||
width: 256px;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_timepicker {
|
||||
width: 58px;
|
||||
float: left;
|
||||
text-align: center;
|
||||
margin-left: 8px;
|
||||
margin-top: 0;
|
||||
}
|
||||
.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker {
|
||||
float: right;
|
||||
margin-right: 8px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker {
|
||||
margin-top: 8px;
|
||||
margin-bottom: 3px
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_mounthpicker {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_label i,
|
||||
.xdsoft_datetimepicker .xdsoft_prev,
|
||||
.xdsoft_datetimepicker .xdsoft_next,
|
||||
.xdsoft_datetimepicker .xdsoft_today_button {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Q0NBRjI1NjM0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Q0NBRjI1NjQ0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDQ0FGMjU2MTQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDQ0FGMjU2MjQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoNEP54AAAIOSURBVHja7Jq9TsMwEMcxrZD4WpBYeKUCe+kTMCACHZh4BFfHO/AAIHZGFhYkBBsSEqxsLCAgXKhbXYOTxh9pfJVP+qutnZ5s/5Lz2Y5I03QhWji2GIcgAokWgfCxNvcOCCGKqiSqhUp0laHOne05vdEyGMfkdxJDVjgwDlEQgYQBgx+ULJaWSXXS6r/ER5FBVR8VfGftTKcITNs+a1XpcFoExREIDF14AVIFxgQUS+h520cdud6wNkC0UBw6BCO/HoCYwBhD8QCkQ/x1mwDyD4plh4D6DDV0TAGyo4HcawLIBBSLDkHeH0Mg2yVP3l4TQMZQDDsEOl/MgHQqhMNuE0D+oBh0CIr8MAKyazBH9WyBuKxDWgbXfjNf32TZ1KWm/Ap1oSk/R53UtQ5xTh3LUlMmT8gt6g51Q9p+SobxgJQ/qmsfZhWywGFSl0yBjCLJCMgXail3b7+rumdVJ2YRss4cN+r6qAHDkPWjPjdJCF4n9RmAD/V9A/Wp4NQassDjwlB6XBiCxcJQWmZZb8THFilfy/lfrTvLghq2TqTHrRMTKNJ0sIhdo15RT+RpyWwFdY96UZ/LdQKBGjcXpcc1AlSFEfLmouD+1knuxBDUVrvOBmoOC/rEcN7OQxKVeJTCiAdUzUJhA2Oez9QTkp72OTVcxDcXY8iKNkxGAJXmJCOQwOa6dhyXsOa6XwEGAKdeb5ET3rQdAAAAAElFTkSuQmCC);
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_label i {
|
||||
opacity: 0.5;
|
||||
background-position: -92px -19px;
|
||||
display: inline-block;
|
||||
width: 9px;
|
||||
height: 20px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_prev {
|
||||
float: left;
|
||||
background-position: -20px 0;
|
||||
}
|
||||
.xdsoft_datetimepicker .xdsoft_today_button {
|
||||
float: left;
|
||||
background-position: -70px 0;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_next {
|
||||
float: right;
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_next,
|
||||
.xdsoft_datetimepicker .xdsoft_prev ,
|
||||
.xdsoft_datetimepicker .xdsoft_today_button {
|
||||
background-color: transparent;
|
||||
background-repeat: no-repeat;
|
||||
border: 0 none;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
height: 30px;
|
||||
opacity: 0.5;
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
||||
outline: medium none;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
text-indent: 100%;
|
||||
white-space: nowrap;
|
||||
width: 20px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev,
|
||||
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_next {
|
||||
float: none;
|
||||
background-position: -40px -15px;
|
||||
height: 15px;
|
||||
width: 30px;
|
||||
display: block;
|
||||
margin-left: 14px;
|
||||
margin-top: 7px;
|
||||
}
|
||||
.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker .xdsoft_prev,
|
||||
.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_timepicker .xdsoft_next {
|
||||
float: none;
|
||||
margin-left: 0;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev {
|
||||
background-position: -40px 0;
|
||||
margin-bottom: 7px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box {
|
||||
height: 151px;
|
||||
overflow: hidden;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div {
|
||||
background: #f5f5f5;
|
||||
border-top: 1px solid #ddd;
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
border-collapse: collapse;
|
||||
cursor: pointer;
|
||||
border-bottom-width: 0;
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div > div:first-child {
|
||||
border-top-width: 0;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_today_button:hover,
|
||||
.xdsoft_datetimepicker .xdsoft_next:hover,
|
||||
.xdsoft_datetimepicker .xdsoft_prev:hover {
|
||||
opacity: 1;
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_label {
|
||||
display: inline;
|
||||
position: relative;
|
||||
z-index: 9999;
|
||||
margin: 0;
|
||||
padding: 5px 3px;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
font-weight: bold;
|
||||
background-color: #fff;
|
||||
float: left;
|
||||
width: 182px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_label:hover>span {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_label:hover i {
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select {
|
||||
border: 1px solid #ccc;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 30px;
|
||||
z-index: 101;
|
||||
display: none;
|
||||
background: #fff;
|
||||
max-height: 160px;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_monthselect{ right: -7px }
|
||||
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_yearselect{ right: 2px }
|
||||
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover {
|
||||
color: #fff;
|
||||
background: #ff8000;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option {
|
||||
padding: 2px 10px 2px 5px;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current {
|
||||
background: #33aaff;
|
||||
box-shadow: #178fe5 0 1px 3px 0 inset;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_month {
|
||||
width: 100px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_year{
|
||||
width: 48px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar td > div {
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar th {
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar td,.xdsoft_datetimepicker .xdsoft_calendar th {
|
||||
width: 14.2857142%;
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #ddd;
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
text-align: right;
|
||||
vertical-align: middle;
|
||||
padding: 0;
|
||||
border-collapse: collapse;
|
||||
cursor: pointer;
|
||||
height: 25px;
|
||||
}
|
||||
.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar td,.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar th {
|
||||
width: 12.5%;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar th {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today {
|
||||
color: #33aaff;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_default {
|
||||
background: #ffe9d2;
|
||||
box-shadow: #ffb871 0 1px 4px 0 inset;
|
||||
color: #000;
|
||||
}
|
||||
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_highlighted_mint {
|
||||
background: #c1ffc9;
|
||||
box-shadow: #00dd1c 0 1px 4px 0 inset;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default,
|
||||
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,
|
||||
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current {
|
||||
background: #33aaff;
|
||||
box-shadow: #178fe5 0 1px 3px 0 inset;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month,
|
||||
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled,
|
||||
.xdsoft_datetimepicker .xdsoft_time_box >div >div.xdsoft_disabled {
|
||||
opacity: 0.5;
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month.xdsoft_disabled {
|
||||
opacity: 0.2;
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar td:hover,
|
||||
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div:hover {
|
||||
color: #fff !important;
|
||||
background: #ff8000 !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current.xdsoft_disabled:hover,
|
||||
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box>div>div.xdsoft_current.xdsoft_disabled:hover {
|
||||
background: #33aaff !important;
|
||||
box-shadow: #178fe5 0 1px 3px 0 inset !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled:hover,
|
||||
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_disabled:hover {
|
||||
color: inherit !important;
|
||||
background: inherit !important;
|
||||
box-shadow: inherit !important;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_calendar th {
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_copyright {
|
||||
color: #ccc !important;
|
||||
font-size: 10px;
|
||||
clear: both;
|
||||
float: none;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker .xdsoft_copyright a { color: #eee !important }
|
||||
.xdsoft_datetimepicker .xdsoft_copyright a:hover { color: #aaa !important }
|
||||
|
||||
.xdsoft_time_box {
|
||||
position: relative;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
.xdsoft_scrollbar >.xdsoft_scroller {
|
||||
background: #ccc !important;
|
||||
height: 20px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.xdsoft_scrollbar {
|
||||
position: absolute;
|
||||
width: 7px;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
.xdsoft_datetimepicker.xdsoft_rtl .xdsoft_scrollbar {
|
||||
left: 0;
|
||||
right: auto;
|
||||
}
|
||||
.xdsoft_scroller_box {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_dark {
|
||||
box-shadow: 0 5px 15px -5px rgba(255, 255, 255, 0.506);
|
||||
background: #000;
|
||||
border-bottom: 1px solid #444;
|
||||
border-left: 1px solid #333;
|
||||
border-right: 1px solid #333;
|
||||
border-top: 1px solid #333;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box {
|
||||
border-bottom: 1px solid #222;
|
||||
}
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div {
|
||||
background: #0a0a0a;
|
||||
border-top: 1px solid #222;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label {
|
||||
background-color: #000;
|
||||
}
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select {
|
||||
border: 1px solid #333;
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover {
|
||||
color: #000;
|
||||
background: #007fff;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current {
|
||||
background: #cc5500;
|
||||
box-shadow: #b03e00 0 1px 3px 0 inset;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label i,
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_prev,
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_next,
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_today_button {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUExQUUzOTA0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUExQUUzOTE0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQTFBRTM4RTQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQTFBRTM4RjQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pp0VxGEAAAIASURBVHja7JrNSgMxEMebtgh+3MSLr1T1Xn2CHoSKB08+QmR8Bx9A8e7RixdB9CKCoNdexIugxFlJa7rNZneTbLIpM/CnNLsdMvNjM8l0mRCiQ9Ye61IKCAgZAUnH+mU3MMZaHYChBnJUDzWOFZdVfc5+ZFLbrWDeXPwbxIqrLLfaeS0hEBVGIRQCEiZoHQwtlGSByCCdYBl8g8egTTAWoKQMRBRBcZxYlhzhKegqMOageErsCHVkk3hXIFooDgHB1KkHIHVgzKB4ADJQ/A1jAFmAYhkQqA5TOBtocrKrgXwQA8gcFIuAIO8sQSA7hidvPwaQGZSaAYHOUWJABhWWw2EMIH9QagQERU4SArJXo0ZZL18uvaxejXt/Em8xjVBXmvFr1KVm/AJ10tRe2XnraNqaJvKE3KHuUbfK1E+VHB0q40/y3sdQSxY4FHWeKJCunP8UyDdqJZenT3ntVV5jIYCAh20vT7ioP8tpf6E2lfEMwERe+whV1MHjwZB7PBiCxcGQWwKZKD62lfGNnP/1poFAA60T7rF1UgcKd2id3KDeUS+oLWV8DfWAepOfq00CgQabi9zjcgJVYVD7PVzQUAUGAQkbNJTBICDhgwYTjDYD6XeW08ZKh+A4pYkzenOxXUbvZcWz7E8ykRMnIHGX1XPl+1m2vPYpL+2qdb8CDAARlKFEz/ZVkAAAAABJRU5ErkJggg==);
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td,
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th {
|
||||
background: #0a0a0a;
|
||||
border: 1px solid #222;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th {
|
||||
background: #0e0e0e;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_today {
|
||||
color: #cc5500;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_default {
|
||||
background: #ffe9d2;
|
||||
box-shadow: #ffb871 0 1px 4px 0 inset;
|
||||
color:#000;
|
||||
}
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_highlighted_mint {
|
||||
background: #c1ffc9;
|
||||
box-shadow: #00dd1c 0 1px 4px 0 inset;
|
||||
color:#000;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_default,
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_current,
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current {
|
||||
background: #cc5500;
|
||||
box-shadow: #b03e00 0 1px 3px 0 inset;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td:hover,
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div:hover {
|
||||
color: #000 !important;
|
||||
background: #007fff !important;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright { color: #333 !important }
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a { color: #111 !important }
|
||||
.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a:hover { color: #555 !important }
|
||||
|
||||
.xdsoft_dark .xdsoft_time_box {
|
||||
border: 1px solid #333;
|
||||
}
|
||||
|
||||
.xdsoft_dark .xdsoft_scrollbar >.xdsoft_scroller {
|
||||
background: #333 !important;
|
||||
}
|
||||
.xdsoft_datetimepicker .xdsoft_save_selected {
|
||||
display: block;
|
||||
border: 1px solid #dddddd !important;
|
||||
margin-top: 5px;
|
||||
width: 100%;
|
||||
color: #454551;
|
||||
font-size: 13px;
|
||||
}
|
||||
.xdsoft_datetimepicker .blue-gradient-button {
|
||||
font-family: "museo-sans", "Book Antiqua", sans-serif;
|
||||
font-size: 12px;
|
||||
font-weight: 300;
|
||||
color: #82878c;
|
||||
height: 28px;
|
||||
position: relative;
|
||||
padding: 4px 17px 4px 33px;
|
||||
border: 1px solid #d7d8da;
|
||||
background: -moz-linear-gradient(top, #fff 0%, #f4f8fa 73%);
|
||||
/* FF3.6+ */
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(73%, #f4f8fa));
|
||||
/* Chrome,Safari4+ */
|
||||
background: -webkit-linear-gradient(top, #fff 0%, #f4f8fa 73%);
|
||||
/* Chrome10+,Safari5.1+ */
|
||||
background: -o-linear-gradient(top, #fff 0%, #f4f8fa 73%);
|
||||
/* Opera 11.10+ */
|
||||
background: -ms-linear-gradient(top, #fff 0%, #f4f8fa 73%);
|
||||
/* IE10+ */
|
||||
background: linear-gradient(to bottom, #fff 0%, #f4f8fa 73%);
|
||||
/* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fff', endColorstr='#f4f8fa',GradientType=0 );
|
||||
/* IE6-9 */
|
||||
}
|
||||
.xdsoft_datetimepicker .blue-gradient-button:hover, .xdsoft_datetimepicker .blue-gradient-button:focus, .xdsoft_datetimepicker .blue-gradient-button:hover span, .xdsoft_datetimepicker .blue-gradient-button:focus span {
|
||||
color: #454551;
|
||||
background: -moz-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
|
||||
/* FF3.6+ */
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f4f8fa), color-stop(73%, #FFF));
|
||||
/* Chrome,Safari4+ */
|
||||
background: -webkit-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
|
||||
/* Chrome10+,Safari5.1+ */
|
||||
background: -o-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
|
||||
/* Opera 11.10+ */
|
||||
background: -ms-linear-gradient(top, #f4f8fa 0%, #FFF 73%);
|
||||
/* IE10+ */
|
||||
background: linear-gradient(to bottom, #f4f8fa 0%, #FFF 73%);
|
||||
/* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f8fa', endColorstr='#FFF',GradientType=0 );
|
||||
/* IE6-9 */
|
||||
}
|
45
admin/themes/default/css/login.css
Normal file
45
admin/themes/default/css/login.css
Normal file
|
@ -0,0 +1,45 @@
|
|||
/* ----------- UIKIT HACKs FOR BLUDIT ----------- */
|
||||
html {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
.uk-button-primary {
|
||||
background: #444;
|
||||
}
|
||||
|
||||
.uk-button-primary:hover {
|
||||
background: #333;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="password"] {
|
||||
border-color: #FFF !important;
|
||||
}
|
||||
|
||||
/* ----------- BLUDIT ----------- */
|
||||
|
||||
div.login-box > h1 {
|
||||
font-weight: lighter;
|
||||
letter-spacing: 4px;
|
||||
margin-bottom: 50px;
|
||||
margin-top: -100px;
|
||||
}
|
||||
|
||||
div.login-form {
|
||||
width: 400px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.login-form > h2 {
|
||||
color: #777;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
a.login-email {
|
||||
background: #f9f9f9 none repeat scroll 0 0;
|
||||
border: 1px solid #eeeeee;
|
||||
color: #777;
|
||||
display: block;
|
||||
padding: 20px;
|
||||
margin: 20px 0;
|
||||
}
|
2
admin/themes/default/css/placeholder.min.css
vendored
Normal file
2
admin/themes/default/css/placeholder.min.css
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
.uk-placeholder{margin-bottom:15px;padding:15px;border:1px dashed #ddd;background:#fafafa;color:#444}*+.uk-placeholder{margin-top:15px}.uk-placeholder>:last-child{margin-bottom:0}.uk-placeholder-large{padding-top:80px;padding-bottom:80px}
|
2
admin/themes/default/css/progress.min.css
vendored
Normal file
2
admin/themes/default/css/progress.min.css
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
.uk-progress{box-sizing:border-box;height:20px;margin-bottom:15px;background:#eee;overflow:hidden;line-height:20px}*+.uk-progress{margin-top:15px}.uk-progress-bar{width:0;height:100%;background:#00a8e6;float:left;-webkit-transition:width .6s ease;transition:width .6s ease;font-size:12px;color:#fff;text-align:center}.uk-progress-mini{height:6px}.uk-progress-small{height:12px}.uk-progress-success .uk-progress-bar{background-color:#8cc14c}.uk-progress-warning .uk-progress-bar{background-color:#faa732}.uk-progress-danger .uk-progress-bar{background-color:#da314b}.uk-progress-striped .uk-progress-bar{background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:30px 30px}.uk-progress-striped.uk-active .uk-progress-bar{-webkit-animation:uk-progress-bar-stripes 2s linear infinite;animation:uk-progress-bar-stripes 2s linear infinite}@-webkit-keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}@keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}
|
2
admin/themes/default/css/uikit.almost-flat.min.css
vendored
Normal file
2
admin/themes/default/css/uikit.almost-flat.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
2
admin/themes/default/css/upload.min.css
vendored
Normal file
2
admin/themes/default/css/upload.min.css
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
.uk-dragover{box-shadow:0 0 20px rgba(100,100,100,.3)}
|
BIN
admin/themes/default/fonts/FontAwesome.otf
Normal file
BIN
admin/themes/default/fonts/FontAwesome.otf
Normal file
Binary file not shown.
BIN
admin/themes/default/fonts/fontawesome-webfont.eot
Normal file
BIN
admin/themes/default/fonts/fontawesome-webfont.eot
Normal file
Binary file not shown.
BIN
admin/themes/default/fonts/fontawesome-webfont.ttf
Normal file
BIN
admin/themes/default/fonts/fontawesome-webfont.ttf
Normal file
Binary file not shown.
BIN
admin/themes/default/fonts/fontawesome-webfont.woff
Normal file
BIN
admin/themes/default/fonts/fontawesome-webfont.woff
Normal file
Binary file not shown.
BIN
admin/themes/default/fonts/fontawesome-webfont.woff2
Normal file
BIN
admin/themes/default/fonts/fontawesome-webfont.woff2
Normal file
Binary file not shown.
BIN
admin/themes/default/img/favicon.png
Normal file
BIN
admin/themes/default/img/favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1,005 B |
157
admin/themes/default/index.php
Normal file
157
admin/themes/default/index.php
Normal file
|
@ -0,0 +1,157 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<base href="<?php echo HTML_PATH_ADMIN_THEME ?>">
|
||||
<meta charset="<?php echo CHARSET ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noindex,nofollow">
|
||||
|
||||
<title><?php echo $layout['title'] ?></title>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" type="image/x-icon" href="./img/favicon.png">
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" type="text/css" href="./css/uikit.almost-flat.min.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||
<link rel="stylesheet" type="text/css" href="./css/default.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||
<link rel="stylesheet" type="text/css" href="./css/jquery.datetimepicker.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||
<link rel="stylesheet" type="text/css" href="./css/upload.min.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||
<link rel="stylesheet" type="text/css" href="./css/form-file.min.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||
<link rel="stylesheet" type="text/css" href="./css/placeholder.min.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||
<link rel="stylesheet" type="text/css" href="./css/progress.min.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||
|
||||
<!-- Javascript -->
|
||||
<script charset="utf-8" src="./js/jquery.min.js?version=<?php echo BLUDIT_VERSION ?>"></script>
|
||||
<script charset="utf-8" src="./js/uikit.min.js?version=<?php echo BLUDIT_VERSION ?>"></script>
|
||||
<script charset="utf-8" src="./js/jquery.datetimepicker.js?version=<?php echo BLUDIT_VERSION ?>"></script>
|
||||
<script charset="utf-8" src="./js/upload.min.js?version=<?php echo BLUDIT_VERSION ?>"></script>
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('adminHead') ?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('adminBodyBegin') ?>
|
||||
|
||||
<!-- Alert -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
<?php
|
||||
if( Alert::defined() ) {
|
||||
echo '$("#alert").slideDown().delay(3500).slideUp();';
|
||||
}
|
||||
?>
|
||||
$("#alert").click(function() {
|
||||
$(this).hide();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="alert" class="<?php echo (Alert::status()==ALERT_STATUS_OK)?'alert-ok':'alert-fail'; ?>">
|
||||
<?php Alert::p() ?>
|
||||
</div>
|
||||
|
||||
<!-- Navbar -->
|
||||
<nav class="uk-navbar">
|
||||
<div class="uk-container uk-container-center">
|
||||
|
||||
<ul class="uk-navbar-nav uk-hidden-small">
|
||||
<li><a target="_blank" class="bludit-logo" href="http://www.bludit.com">BLUDIT</a></li>
|
||||
<li <?php echo ($layout['view']=='dashboard')?'class="uk-active"':'' ?> ><a href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><i class="uk-icon-object-ungroup"></i> <?php $L->p('Dashboard') ?></a></li>
|
||||
<li <?php echo ($layout['view']=='new-post')?'class="uk-active"':'' ?>><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-post' ?>"><i class="uk-icon-pencil"></i> <?php $L->p('New post') ?></a></li>
|
||||
<li <?php echo ($layout['view']=='new-page')?'class="uk-active"':'' ?>><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-page' ?>"><i class="uk-icon-file-text-o"></i> <?php $L->p('New page') ?></a></li>
|
||||
|
||||
<li class="uk-parent" data-uk-dropdown>
|
||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-posts' ?>"><i class="uk-icon-clone"></i> <?php $L->p('Manage') ?> ▾</a>
|
||||
<div class="uk-dropdown uk-dropdown-navbar">
|
||||
<ul class="uk-nav uk-nav-navbar">
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-posts' ?>"><i class="uk-icon-folder-o"></i> <?php $L->p('Posts') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-pages' ?>"><i class="uk-icon-folder-o"></i> <?php $L->p('Pages') ?></a></li>
|
||||
<?php if($Login->role() == 'admin') { ?>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>"><i class="uk-icon-users"></i> <?php $L->p('Users') ?></a></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php if($Login->role() == 'admin') { ?>
|
||||
<li class="uk-parent" data-uk-dropdown>
|
||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-general' ?>"><i class="uk-icon-cog"></i> <?php $L->p('Settings') ?> ▾</a>
|
||||
<div class="uk-dropdown uk-dropdown-navbar">
|
||||
<ul class="uk-nav uk-nav-navbar">
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-general' ?>"><i class="uk-icon-th-large"></i> <?php $L->p('General') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-advanced' ?>"><i class="uk-icon-th"></i> <?php $L->p('Advanced') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-regional' ?>"><i class="uk-icon-globe"></i> <?php $L->p('Language and timezone') ?></a></li>
|
||||
<li class="uk-nav-divider"></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>"><i class="uk-icon-puzzle-piece"></i> <?php $L->p('Plugins') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'themes' ?>"><i class="uk-icon-paint-brush"></i> <?php $L->p('Themes') ?></a></li>
|
||||
<li class="uk-nav-divider"></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'about' ?>"><?php $L->p('About') ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="uk-navbar-flip uk-hidden-small">
|
||||
<ul class="uk-navbar-nav">
|
||||
<li class="uk-parent" data-uk-dropdown>
|
||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$Login->username() ?>"><i class="uk-icon-user"></i> <?php echo $Login->username() ?> ▾</a>
|
||||
<div class="uk-dropdown uk-dropdown-navbar">
|
||||
<ul class="uk-nav uk-nav-navbar">
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$Login->username() ?>"><?php $L->p('Profile') ?></a></li>
|
||||
<li class="uk-nav-divider"></li>
|
||||
<li><a target="_blank" href="<?php echo HTML_PATH_ROOT ?>"><?php $L->p('Website') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'logout' ?>"><?php $L->p('Logout') ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<a href="#offcanvas" class="uk-navbar-toggle uk-visible-small" data-uk-offcanvas></a>
|
||||
<div class="uk-navbar-brand uk-navbar-center uk-visible-small">Bludit</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Offcanvas -->
|
||||
<div id="offcanvas" class="uk-offcanvas">
|
||||
<div class="uk-offcanvas-bar">
|
||||
<ul class="uk-nav uk-nav-offcanvas">
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><?php $L->p('Dashboard') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-post' ?>"><?php $L->p('New post') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-page' ?>"><?php $L->p('New page') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-posts' ?>"><?php $L->p('Manage posts') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-pages' ?>"><?php $L->p('Manage pages') ?></a></li>
|
||||
<?php if($Login->role() == 'admin') { ?>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>"><?php $L->p('Manage users') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-general' ?>"><?php $L->p('General settings') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-advanced' ?>"><?php $L->p('Advanced settings') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-regional' ?>"><?php $L->p('Language and timezone') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>"><?php $L->p('Plugins') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'themes' ?>"><?php $L->p('Themes') ?></a></li>
|
||||
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'about' ?>"><?php $L->p('About') ?></a></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- View -->
|
||||
<div class="uk-container uk-container-center">
|
||||
<?php
|
||||
if( Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php') ) {
|
||||
include(PATH_ADMIN_VIEWS.$layout['view'].'.php');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- Javascript -->
|
||||
<?php include(PATH_JS.'functions.php') ?>
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('adminBodyEnd') ?>
|
||||
|
||||
</body>
|
||||
</html>
|
210
admin/themes/default/init.php
Normal file
210
admin/themes/default/init.php
Normal file
|
@ -0,0 +1,210 @@
|
|||
<?php
|
||||
|
||||
class HTML {
|
||||
|
||||
public static function title($args)
|
||||
{
|
||||
$html = '<h2 class="title"><i class="uk-icon-'.$args['icon'].'"></i> '.$args['title'].'</h2>';
|
||||
echo $html;
|
||||
}
|
||||
|
||||
public static function formOpen($args)
|
||||
{
|
||||
$class = empty($args['class']) ? '' : ' '.$args['class'];
|
||||
$id = empty($args['id']) ? '' : 'id="'.$args['id'].'"';
|
||||
|
||||
$html = '<form class="uk-form'.$class.'" '.$id.' method="post" action="" autocomplete="off">';
|
||||
echo $html;
|
||||
}
|
||||
|
||||
public static function formClose()
|
||||
{
|
||||
$html = '</form>';
|
||||
echo $html;
|
||||
}
|
||||
|
||||
// label, name, value, tip
|
||||
public static function formInputText($args)
|
||||
{
|
||||
$id = 'js'.$args['name'];
|
||||
$type = isset($args['type']) ? $args['type'] : 'text';
|
||||
$class = empty($args['class']) ? '' : 'class="'.$args['class'].'"';
|
||||
$placeholder = empty($args['placeholder']) ? '' : 'placeholder="'.$args['placeholder'].'"';
|
||||
$disabled = empty($args['disabled']) ? '' : 'disabled';
|
||||
|
||||
$html = '<div class="uk-form-row">';
|
||||
|
||||
if(!empty($args['label'])) {
|
||||
$html .= '<label for="'.$id.'" class="uk-form-label">'.$args['label'].'</label>';
|
||||
}
|
||||
|
||||
$html .= '<div class="uk-form-controls">';
|
||||
|
||||
$html .= '<input id="'.$id.'" name="'.$args['name'].'" type="'.$type.'" '.$class.' '.$placeholder.' autocomplete="off" '.$disabled.' value="'.$args['value'].'">';
|
||||
|
||||
if(!empty($args['tip'])) {
|
||||
$html .= '<p class="uk-form-help-block">'.$args['tip'].'</p>';
|
||||
}
|
||||
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
|
||||
echo $html;
|
||||
}
|
||||
|
||||
public static function formInputPassword($args)
|
||||
{
|
||||
$args['type'] = 'password';
|
||||
self::formInputText($args);
|
||||
}
|
||||
|
||||
public static function formTextarea($args)
|
||||
{
|
||||
$id = 'js'.$args['name'];
|
||||
$type = isset($args['type']) ? $args['type'] : 'text';
|
||||
$class = empty($args['class']) ? '' : 'class="'.$args['class'].'"';
|
||||
$placeholder = empty($args['placeholder']) ? '' : 'placeholder="'.$args['placeholder'].'"';
|
||||
$rows = empty($args['rows']) ? '' : 'rows="'.$args['rows'].'"';
|
||||
|
||||
$html = '<div class="uk-form-row">';
|
||||
|
||||
if(!empty($args['label'])) {
|
||||
$html .= '<label for="'.$id.'" class="uk-form-label">'.$args['label'].'</label>';
|
||||
}
|
||||
|
||||
$html .= '<div class="uk-form-controls">';
|
||||
|
||||
$html .= '<textarea id="'.$id.'" name="'.$args['name'].'" '.$class.' '.$placeholder.' '.$rows.'>'.$args['value'].'</textarea>';
|
||||
|
||||
if(!empty($args['tip'])) {
|
||||
$html .= '<p class="uk-form-help-block">'.$args['tip'].'</p>';
|
||||
}
|
||||
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
|
||||
echo $html;
|
||||
}
|
||||
|
||||
public static function formSelect($args)
|
||||
{
|
||||
$id = 'js'.$args['name'];
|
||||
$type = isset($args['type']) ? $args['type'] : 'text';
|
||||
$class = empty($args['class']) ? '' : 'class="'.$args['class'].'"';
|
||||
|
||||
$html = '<div class="uk-form-row">';
|
||||
$html .= '<label for="'.$id.'" class="uk-form-label">'.$args['label'].'</label>';
|
||||
$html .= '<div class="uk-form-controls">';
|
||||
$html .= '<select id="'.$id.'" name="'.$args['name'].'" '.$class.'>';
|
||||
foreach($args['options'] as $key=>$value) {
|
||||
$html .= '<option value="'.$key.'"'.( ($args['selected']==$key)?' selected="selected"':'').'>'.$value.'</option>';
|
||||
}
|
||||
$html .= '</select>';
|
||||
$html .= '<p class="uk-form-help-block">'.$args['tip'].'</p>';
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
|
||||
echo $html;
|
||||
}
|
||||
|
||||
public static function formInputHidden($args)
|
||||
{
|
||||
$id = 'js'.$args['name'];
|
||||
|
||||
$html = '<input type="hidden" id="'.$id.'" name="'.$args['name'].'" value="'.$args['value'].'">';
|
||||
echo $html;
|
||||
}
|
||||
|
||||
public static function legend($args)
|
||||
{
|
||||
$html = '<legend>'.$args['value'].'</legend>';
|
||||
echo $html;
|
||||
}
|
||||
|
||||
public static function formButtonSubmit($args)
|
||||
{
|
||||
$html = '';
|
||||
}
|
||||
|
||||
public static function uploader()
|
||||
{
|
||||
global $L;
|
||||
|
||||
$html = '
|
||||
<div id="upload-drop" class="uk-placeholder uk-text-center">
|
||||
<i class="uk-icon-cloud-upload uk-icon-medium uk-text-muted uk-margin-small-right"></i>'.$L->g('Upload Image').'<br><a class="uk-form-file">'.$L->g('Drag and drop or click here').'<input id="upload-select" type="file"></a>
|
||||
</div>
|
||||
|
||||
<div id="progressbar" class="uk-progress uk-hidden">
|
||||
<div class="uk-progress-bar" style="width: 0%;">0%</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
$html .= '<select id="jsimageList" class="uk-width-1-1" size="10">';
|
||||
$imagesList = Filesystem::listFiles(PATH_UPLOADS,'*','*',true);
|
||||
foreach($imagesList as $file) {
|
||||
$html .= '<option value="">'.basename($file).'</option>';
|
||||
}
|
||||
$html .= '</select>';
|
||||
|
||||
$html .= '
|
||||
<div class="uk-form-row uk-margin-top">
|
||||
<button id="jsaddImage" class="uk-button uk-button-primary" type="button"><i class="uk-icon-angle-double-left"></i> '.$L->g('Insert Image').'</button>
|
||||
</div>
|
||||
';
|
||||
|
||||
$html .= '
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#jsaddImage").on("click", function() {
|
||||
var filename = $("#jsimageList option:selected").text();
|
||||
if(!filename.trim()) {
|
||||
return false;
|
||||
}
|
||||
var textareaValue = $("#jscontent").val();
|
||||
$("#jscontent").val(textareaValue + "<img src=\""+filename+"\" alt=\"\">" + "\n");
|
||||
});
|
||||
|
||||
$(function()
|
||||
{
|
||||
var progressbar = $("#progressbar");
|
||||
var bar = progressbar.find(".uk-progress-bar");
|
||||
var settings =
|
||||
{
|
||||
type: "json",
|
||||
action: "'.HTML_PATH_ADMIN_ROOT.'ajax/uploader",
|
||||
allow : "*.(jpg|jpeg|gif|png)",
|
||||
|
||||
loadstart: function() {
|
||||
bar.css("width", "0%").text("0%");
|
||||
progressbar.removeClass("uk-hidden");
|
||||
},
|
||||
|
||||
progress: function(percent) {
|
||||
percent = Math.ceil(percent);
|
||||
bar.css("width", percent+"%").text(percent+"%");
|
||||
},
|
||||
|
||||
allcomplete: function(response) {
|
||||
bar.css("width", "100%").text("100%");
|
||||
setTimeout(function() { progressbar.addClass("uk-hidden"); }, 250);
|
||||
$("#jsimageList").prepend("<option value=\'"+response.filename+"\' selected=\'selected\'>"+response.filename+"</option>");
|
||||
},
|
||||
|
||||
notallowed: function(file, settings) {
|
||||
alert("'.$L->g('Supported image file types').' "+settings.allow);
|
||||
}
|
||||
};
|
||||
|
||||
var select = UIkit.uploadSelect($("#upload-select"), settings);
|
||||
var drop = UIkit.uploadDrop($("#upload-drop"), settings);
|
||||
});
|
||||
|
||||
});
|
||||
</script>';
|
||||
|
||||
echo $html;
|
||||
}
|
||||
|
||||
}
|
2092
admin/themes/default/js/jquery.datetimepicker.js
Normal file
2092
admin/themes/default/js/jquery.datetimepicker.js
Normal file
File diff suppressed because one or more lines are too long
4
admin/themes/default/js/jquery.min.js
vendored
Normal file
4
admin/themes/default/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
admin/themes/default/js/uikit.min.js
vendored
Normal file
3
admin/themes/default/js/uikit.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
admin/themes/default/js/upload.min.js
vendored
Normal file
2
admin/themes/default/js/upload.min.js
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(e){var t;window.UIkit&&(t=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-upload",["uikit"],function(){return t||e(UIkit)})}(function(e){"use strict";function t(o,a){function r(t,n){var o=new FormData,a=new XMLHttpRequest;if(n.before(n,t)!==!1){for(var r,i=0;r=t[i];i++)o.append(n.param,r);for(var l in n.params)o.append(l,n.params[l]);a.upload.addEventListener("progress",function(e){var t=e.loaded/e.total*100;n.progress(t,e)},!1),a.addEventListener("loadstart",function(e){n.loadstart(e)},!1),a.addEventListener("load",function(e){n.load(e)},!1),a.addEventListener("loadend",function(e){n.loadend(e)},!1),a.addEventListener("error",function(e){n.error(e)},!1),a.addEventListener("abort",function(e){n.abort(e)},!1),a.open(n.method,n.action,!0),"json"==n.type&&a.setRequestHeader("Accept","application/json"),a.onreadystatechange=function(){if(n.readystatechange(a),4==a.readyState){var t=a.responseText;if("json"==n.type)try{t=e.$.parseJSON(t)}catch(o){t=!1}n.complete(t,a)}},n.beforeSend(a),a.send(o)}}if(!e.support.ajaxupload)return this;if(a=e.$.extend({},t.defaults,a),o.length){if("*.*"!==a.allow)for(var i,l=0;i=o[l];l++)if(!n(a.allow,i.name))return"string"==typeof a.notallowed?alert(a.notallowed):a.notallowed(i,a),void 0;var s=a.complete;if(a.single){var d=o.length,f=0,p=!0;a.beforeAll(o),a.complete=function(e,t){f+=1,s(e,t),a.filelimit&&f>=a.filelimit&&(p=!1),p&&d>f?r([o[f]],a):a.allcomplete(e,t)},r([o[0]],a)}else a.complete=function(e,t){s(e,t),a.allcomplete(e,t)},r(o,a)}}function n(e,t){var n="^"+e.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")+"$";return n="^"+n+"$",null!==t.match(new RegExp(n,"i"))}return e.component("uploadSelect",{init:function(){var e=this;this.on("change",function(){t(e.element[0].files,e.options);var n=e.element.clone(!0).data("uploadSelect",e);e.element.replaceWith(n),e.element=n})}}),e.component("uploadDrop",{defaults:{dragoverClass:"uk-dragover"},init:function(){var e=this,n=!1;this.on("drop",function(n){n.dataTransfer&&n.dataTransfer.files&&(n.stopPropagation(),n.preventDefault(),e.element.removeClass(e.options.dragoverClass),e.element.trigger("dropped.uk.upload",[n.dataTransfer.files]),t(n.dataTransfer.files,e.options))}).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}).on("dragover",function(t){t.stopPropagation(),t.preventDefault(),n||(e.element.addClass(e.options.dragoverClass),n=!0)}).on("dragleave",function(t){t.stopPropagation(),t.preventDefault(),e.element.removeClass(e.options.dragoverClass),n=!1})}}),e.support.ajaxupload=function(){function e(){var e=document.createElement("INPUT");return e.type="file","files"in e}function t(){var e=new XMLHttpRequest;return!!(e&&"upload"in e&&"onprogress"in e.upload)}function n(){return!!window.FormData}return e()&&t()&&n()}(),e.support.ajaxupload&&e.$.event.props.push("dataTransfer"),t.defaults={action:"",single:!0,method:"POST",param:"files[]",params:{},allow:"*.*",type:"text",filelimit:!1,before:function(){},beforeSend:function(){},beforeAll:function(){},loadstart:function(){},load:function(){},loadend:function(){},error:function(){},abort:function(){},progress:function(){},complete:function(){},allcomplete:function(){},readystatechange:function(){},notallowed:function(e,t){alert("Only the following file types are allowed: "+t.allow)}},e.Utils.xhrupload=t,t});
|
49
admin/themes/default/login.php
Normal file
49
admin/themes/default/login.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html class="uk-height-1-1 uk-notouch">
|
||||
<head>
|
||||
<base href="<?php echo HTML_PATH_ADMIN_THEME ?>">
|
||||
<meta charset="<?php echo CHARSET ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noindex,nofollow">
|
||||
|
||||
<title>Bludit</title>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" type="image/x-icon" href="./img/favicon.png">
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" type="text/css" href="./css/uikit.almost-flat.min.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||
<link rel="stylesheet" type="text/css" href="./css/login.css?version=<?php echo BLUDIT_VERSION ?>">
|
||||
|
||||
<!-- Javascript -->
|
||||
<script charset="utf-8" src="./js/jquery.min.js?version=<?php echo BLUDIT_VERSION ?>"></script>
|
||||
<script charset="utf-8" src="./js/uikit.min.js?version=<?php echo BLUDIT_VERSION ?>"></script>
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('loginHead') ?>
|
||||
</head>
|
||||
<body class="uk-height-1-1">
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('loginBodyBegin') ?>
|
||||
|
||||
<div class="uk-vertical-align uk-text-center uk-height-1-1">
|
||||
<div class="uk-vertical-align-middle login-box">
|
||||
<h1>BLUDIT</h1>
|
||||
<?php
|
||||
if(Alert::defined()) {
|
||||
echo '<div class="uk-alert uk-alert-danger">'.Alert::get().'</div>';
|
||||
}
|
||||
|
||||
if( Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php') ) {
|
||||
include(PATH_ADMIN_VIEWS.$layout['view'].'.php');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('loginBodyEnd') ?>
|
||||
|
||||
</body>
|
||||
</html>
|
34
admin/views/about.php
Normal file
34
admin/views/about.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('About'), 'icon'=>'support'));
|
||||
|
||||
echo '
|
||||
<table class="uk-table uk-table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="uk-width-1-5"></th>
|
||||
<th class="uk-width-3-5"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
';
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td>Bludit</td>';
|
||||
echo '<td>'.BLUDIT_VERSION.' ('.BLUDIT_CODENAME.')</td>';
|
||||
echo '</tr>';
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td>PHP version</td>';
|
||||
echo '<td>'.phpversion().'</td>';
|
||||
echo '</tr>';
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td>PHP modules</td>';
|
||||
echo '<td>'.implode(', ',get_loaded_extensions()).')</td>';
|
||||
echo '</tr>';
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
60
admin/views/add-user.php
Normal file
60
admin/views/add-user.php
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('Add a new user'), 'icon'=>'user-plus'));
|
||||
|
||||
HTML::formOpen(array('id'=>'add-user-form', 'class'=>'uk-form-horizontal'));
|
||||
|
||||
// Security token
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$Security->getToken()
|
||||
));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'new_username',
|
||||
'label'=>$L->g('Username'),
|
||||
'value'=>(isset($_POST['new_username'])?$_POST['new_username']:''),
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
HTML::formInputPassword(array(
|
||||
'name'=>'new_password',
|
||||
'label'=>$L->g('Password'),
|
||||
'value'=>'',
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
HTML::formInputPassword(array(
|
||||
'name'=>'confirm_password',
|
||||
'label'=>$L->g('Confirm Password'),
|
||||
'value'=>'',
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
HTML::formSelect(array(
|
||||
'name'=>'role',
|
||||
'label'=>$L->g('Role'),
|
||||
'options'=>array('editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')),
|
||||
'selected'=>'editor',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'email',
|
||||
'label'=>$L->g('Email'),
|
||||
'value'=>(isset($_POST['email'])?$_POST['email']:''),
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo '<div class="uk-form-row">
|
||||
<div class="uk-form-controls">
|
||||
<button type="submit" class="uk-button uk-button-primary">'.$L->g('Save').'</button>
|
||||
<a href="'.HTML_PATH_ADMIN_ROOT.'users" class="uk-button">'.$L->g('Cancel').'</a>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
HTML::formClose();
|
22
admin/views/configure-plugin.php
Normal file
22
admin/views/configure-plugin.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$_Plugin->name(), 'icon'=>'puzzle-piece'));
|
||||
|
||||
HTML::formOpen(array('id'=>'jsformplugin'));
|
||||
|
||||
// Security token
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$Security->getToken()
|
||||
));
|
||||
|
||||
// Print the plugin form
|
||||
echo $_Plugin->form();
|
||||
|
||||
// Form buttons
|
||||
echo '<div class="uk-form-row uk-margin-bottom">
|
||||
<button class="uk-button uk-button-primary" type="submit">'.$L->g('Save').'</button>
|
||||
<a class="uk-button" href="'.HTML_PATH_ADMIN_ROOT.'plugins">'.$L->g('Cancel').'</a>
|
||||
</div>';
|
||||
|
||||
HTML::formClose();
|
131
admin/views/dashboard.php
Normal file
131
admin/views/dashboard.php
Normal file
|
@ -0,0 +1,131 @@
|
|||
<div class="uk-block uk-block-muted dashboard-links">
|
||||
<div class="uk-container">
|
||||
<div class="uk-grid uk-grid-match" data-uk-grid-margin="{target:'.uk-panel'}">
|
||||
|
||||
<div class="uk-width-medium-1-3">
|
||||
|
||||
<div class="uk-panel">
|
||||
<h4><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-post' ?>"><i class="uk-icon-pencil"></i> <?php $L->p('New post') ?></a></h4>
|
||||
<p><?php $L->p('Create a new article for your blog') ?></p>
|
||||
</div>
|
||||
|
||||
<div class="uk-panel">
|
||||
<h4><a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-posts' ?>"><i class="uk-icon-folder-o"></i> <?php $L->p('Manage posts') ?></a></h4>
|
||||
<p><?php $L->p('edit-or-remove-your-blogs-posts') ?></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="uk-width-medium-1-3" style="border-right: 1px solid #E6E6E6; border-left: 1px solid #E6E6E6">
|
||||
|
||||
<div class="uk-panel">
|
||||
<h4><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-page' ?>"><i class="uk-icon-file-text-o"></i> <?php $L->p('New page') ?></a></h4>
|
||||
<p><?php $L->p('Create a new page for your website') ?></p>
|
||||
</div>
|
||||
|
||||
<div class="uk-panel">
|
||||
<h4><a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-pages' ?>"><i class="uk-icon-folder-o"></i> <?php $L->p('Manage pages') ?></a></h4>
|
||||
<p><?php $L->p('edit-or-remove-your=pages') ?></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="uk-width-medium-1-3">
|
||||
|
||||
<?php if($Login->role() == 'admin') { ?>
|
||||
|
||||
<div class="uk-panel">
|
||||
<h4><a href="<?php echo HTML_PATH_ADMIN_ROOT.'add-user' ?>"><i class="uk-icon-user-plus"></i> <?php $L->p('Add a new user') ?></a></h4>
|
||||
<p><?php $L->p('Invite a friend to collaborate on your website') ?></p>
|
||||
</div>
|
||||
|
||||
<div class="uk-panel">
|
||||
<h4><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-regional' ?>"><i class="uk-icon-globe"></i> <?php $L->p('Language and timezone') ?></a></h4>
|
||||
<p><?php $L->p('Change your language and region settings') ?></p>
|
||||
</div>
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="uk-panel">
|
||||
<h4><a href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$Login->username() ?>"><i class="uk-icon-user"></i> <?php $L->p('Profile') ?></a></h4>
|
||||
<p><?php $L->p('View and edit your profile') ?></p>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="uk-grid" data-uk-grid-margin>
|
||||
|
||||
<div class="uk-width-medium-1-3">
|
||||
|
||||
<div class="uk-panel uk-panel-box">
|
||||
<h4><?php $L->p('Statistics') ?></h4>
|
||||
<table class="uk-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php $Language->p('Posts') ?></td>
|
||||
<td><?php echo $dbPosts->count() ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php $Language->p('Pages') ?></td>
|
||||
<td><?php echo $dbPages->count() ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php $Language->p('Users') ?></td>
|
||||
<td><?php echo $dbUsers->count() ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="uk-width-medium-1-3">
|
||||
|
||||
<div class="uk-panel uk-panel-box">
|
||||
<h4><?php $L->p('Drafts') ?></h4>
|
||||
<ul class="uk-list">
|
||||
<?php
|
||||
if( empty($_draftPosts) && empty($_draftPages) ) {
|
||||
echo '<li>'.$Language->g('There are no drafts').'</li>';
|
||||
}
|
||||
else {
|
||||
foreach($_draftPosts as $Post) {
|
||||
echo '<li><span class="label-draft">'.$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-draft">'.$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>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="uk-width-medium-1-3">
|
||||
|
||||
<div class="uk-panel uk-panel-box">
|
||||
<h4><?php $L->p('Scheduled posts') ?></h4>
|
||||
<ul class="uk-list">
|
||||
<?php
|
||||
if( empty($_scheduledPosts) ) {
|
||||
echo '<li>'.$Language->g('There are no scheduled posts').'</li>';
|
||||
}
|
||||
else {
|
||||
foreach($_scheduledPosts as $Post) {
|
||||
echo '<li><span class="label-time">'.$Post->date(SCHEDULED_DATE_FORMAT).'</span><a href="'.HTML_PATH_ADMIN_ROOT.'edit-post/'.$Post->key().'">'.($Post->title()?$Post->title():'['.$Language->g('Empty title').'] ').'</a></li>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
198
admin/views/edit-page.php
Normal file
198
admin/views/edit-page.php
Normal file
|
@ -0,0 +1,198 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('Edit page'), 'icon'=>'file-text-o'));
|
||||
|
||||
HTML::formOpen(array('class'=>'uk-form-stacked'));
|
||||
|
||||
// Security token
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$Security->getToken()
|
||||
));
|
||||
|
||||
// Key input
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'key',
|
||||
'value'=>$_Page->key()
|
||||
));
|
||||
|
||||
// ---- LEFT SIDE ----
|
||||
echo '<div class="uk-grid">';
|
||||
echo '<div class="uk-width-large-7-10">';
|
||||
|
||||
// Title input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'title',
|
||||
'value'=>$_Page->title(),
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'placeholder'=>$L->g('Title')
|
||||
));
|
||||
|
||||
// Content input
|
||||
HTML::formTextarea(array(
|
||||
'name'=>'content',
|
||||
'value'=>$_Page->contentRaw(false),
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'placeholder'=>$L->g('Content')
|
||||
));
|
||||
|
||||
|
||||
// Form buttons
|
||||
echo '<div class="uk-form-row uk-margin-bottom">';
|
||||
echo ' <button class="uk-button uk-button-primary" type="submit">'.$L->g('Save').'</button>';
|
||||
|
||||
if(count($_Page->children())===0)
|
||||
{
|
||||
echo ' <button id="jsdelete" name="delete-page" class="uk-button" type="submit">'.$L->g('Delete').'</button>';
|
||||
echo ' <a class="uk-button" href="'.HTML_PATH_ADMIN_ROOT.'manage-posts">'.$L->g('Cancel').'</a>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
// ---- RIGHT SIDE ----
|
||||
echo '<div class="uk-width-large-3-10">';
|
||||
|
||||
// Tabs, general and advanced mode
|
||||
echo '<ul class="uk-tab" data-uk-tab="{connect:\'#tab-options\'}">';
|
||||
echo '<li><a href="">'.$L->g('General').'</a></li>';
|
||||
echo '<li><a href="">'.$L->g('Images').'</a></li>';
|
||||
echo '<li><a href="">'.$L->g('Advanced').'</a></li>';
|
||||
echo '</ul>';
|
||||
|
||||
echo '<ul id="tab-options" class="uk-switcher uk-margin">';
|
||||
|
||||
// ---- GENERAL TAB ----
|
||||
echo '<li>';
|
||||
|
||||
// Description input
|
||||
HTML::formTextarea(array(
|
||||
'name'=>'description',
|
||||
'label'=>$L->g('description'),
|
||||
'value'=>$_Page->description(),
|
||||
'rows'=>'7',
|
||||
'class'=>'uk-width-1-1 uk-form-medium',
|
||||
'tip'=>$L->g('this-field-can-help-describe-the-content')
|
||||
));
|
||||
|
||||
// Tags input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'tags',
|
||||
'value'=>$_Page->tags(),
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'tip'=>$L->g('Write the tags separated by commas'),
|
||||
'label'=>$L->g('Tags')
|
||||
));
|
||||
|
||||
echo '</li>';
|
||||
|
||||
// ---- IMAGES TAB ----
|
||||
echo '<li>';
|
||||
|
||||
HTML::uploader();
|
||||
|
||||
echo '</li>';
|
||||
|
||||
// ---- ADVANCED TAB ----
|
||||
echo '<li>';
|
||||
|
||||
// If the page is parent then doesn't can have a parent.
|
||||
if(count($_Page->children())===0)
|
||||
{
|
||||
// Parent input
|
||||
$options = array();
|
||||
$options[NO_PARENT_CHAR] = '('.$Language->g('No parent').')';
|
||||
$options += $dbPages->parentKeyList();
|
||||
unset($options[$_Page->key()]);
|
||||
|
||||
HTML::formSelect(array(
|
||||
'name'=>'parent',
|
||||
'label'=>$L->g('Parent'),
|
||||
'class'=>'uk-width-1-1 uk-form-medium',
|
||||
'options'=>$options,
|
||||
'selected'=>$_Page->parentKey(),
|
||||
'tip'=>''
|
||||
));
|
||||
}
|
||||
|
||||
// Status input
|
||||
HTML::formSelect(array(
|
||||
'name'=>'status',
|
||||
'label'=>$L->g('Status'),
|
||||
'class'=>'uk-width-1-1 uk-form-medium',
|
||||
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
|
||||
'selected'=>($_Page->draft()?'draft':'published'),
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
// Position input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'position',
|
||||
'value'=>$_Page->position(),
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'label'=>$L->g('Position')
|
||||
));
|
||||
|
||||
// Slug input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'slug',
|
||||
'value'=>$_Page->slug(),
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'tip'=>$L->g('you-can-modify-the-url-which-identifies'),
|
||||
'label'=>$L->g('Friendly URL')
|
||||
));
|
||||
|
||||
echo '</li>';
|
||||
echo '</ul>';
|
||||
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
HTML::formClose();
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
var key = $("#jskey").val();
|
||||
|
||||
$("#jsslug").keyup(function() {
|
||||
var text = $(this).val();
|
||||
var parent = $("#jsparent").val();
|
||||
|
||||
checkSlugPage(text, parent, key, $("#jsslug"));
|
||||
});
|
||||
|
||||
$("#jstitle").keyup(function() {
|
||||
var text = $(this).val();
|
||||
var parent = $("#jsparent").val();
|
||||
|
||||
checkSlugPage(text, parent, key, $("#jsslug"));
|
||||
});
|
||||
|
||||
$("#jsparent").change(function() {
|
||||
var parent = $(this).val();
|
||||
var text = $("#jsslug").val();
|
||||
|
||||
if(parent==NO_PARENT_CHAR) {
|
||||
$("#jsparentExample").text("");
|
||||
}
|
||||
else {
|
||||
$("#jsparentExample").text(parent+"/");
|
||||
}
|
||||
|
||||
checkSlugPage(text, parent, key, $("#jsslug"));
|
||||
});
|
||||
|
||||
$("#jsdelete").click(function() {
|
||||
if(confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")==false) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
158
admin/views/edit-post.php
Normal file
158
admin/views/edit-post.php
Normal file
|
@ -0,0 +1,158 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('Edit post'), 'icon'=>'pencil'));
|
||||
|
||||
HTML::formOpen(array('class'=>'uk-form-stacked'));
|
||||
|
||||
// Security token
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$Security->getToken()
|
||||
));
|
||||
|
||||
// Key input
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'key',
|
||||
'value'=>$_Post->key()
|
||||
));
|
||||
|
||||
// ---- LEFT SIDE ----
|
||||
echo '<div class="uk-grid">';
|
||||
echo '<div class="uk-width-large-7-10">';
|
||||
|
||||
// Title input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'title',
|
||||
'value'=>$_Post->title(),
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'placeholder'=>$L->g('Title')
|
||||
));
|
||||
|
||||
// Content input
|
||||
HTML::formTextarea(array(
|
||||
'name'=>'content',
|
||||
'value'=>$_Post->contentRaw(false),
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'placeholder'=>$L->g('Content')
|
||||
));
|
||||
|
||||
// Form buttons
|
||||
echo '<div class="uk-form-row uk-margin-bottom">
|
||||
<button class="uk-button uk-button-primary" type="submit">'.$L->g('Save').'</button>
|
||||
<button id="jsdelete-post" name="delete-post" class="uk-button" type="submit">'.$L->g('Delete').'</button>
|
||||
<a class="uk-button" href="'.HTML_PATH_ADMIN_ROOT.'manage-posts">'.$L->g('Cancel').'</a>
|
||||
</div>';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
// ---- RIGHT SIDE ----
|
||||
echo '<div class="uk-width-large-3-10">';
|
||||
|
||||
// Tabs, general and advanced mode
|
||||
echo '<ul class="uk-tab" data-uk-tab="{connect:\'#tab-options\'}">';
|
||||
echo '<li><a href="">'.$L->g('General').'</a></li>';
|
||||
echo '<li><a href="">'.$L->g('Images').'</a></li>';
|
||||
echo '<li><a href="">'.$L->g('Advanced').'</a></li>';
|
||||
echo '</ul>';
|
||||
|
||||
echo '<ul id="tab-options" class="uk-switcher uk-margin">';
|
||||
|
||||
// ---- GENERAL TAB ----
|
||||
echo '<li>';
|
||||
|
||||
// Description input
|
||||
HTML::formTextarea(array(
|
||||
'name'=>'description',
|
||||
'label'=>$L->g('description'),
|
||||
'value'=>$_Post->description(),
|
||||
'rows'=>'7',
|
||||
'class'=>'uk-width-1-1 uk-form-medium',
|
||||
'tip'=>$L->g('this-field-can-help-describe-the-content')
|
||||
));
|
||||
|
||||
// Tags input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'tags',
|
||||
'value'=>$_Post->tags(),
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'tip'=>$L->g('Write the tags separated by commas'),
|
||||
'label'=>$L->g('Tags')
|
||||
));
|
||||
|
||||
echo '</li>';
|
||||
|
||||
// ---- IMAGES TAB ----
|
||||
echo '<li>';
|
||||
|
||||
HTML::uploader();
|
||||
|
||||
echo '</li>';
|
||||
|
||||
// ---- ADVANCED TAB ----
|
||||
echo '<li>';
|
||||
|
||||
// Date input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'date',
|
||||
'value'=>$_Post->date(),
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'tip'=>$L->g('To schedule the post just select the date and time'),
|
||||
'label'=>$L->g('Date')
|
||||
));
|
||||
|
||||
// Status input
|
||||
HTML::formSelect(array(
|
||||
'name'=>'status',
|
||||
'label'=>$L->g('Status'),
|
||||
'class'=>'uk-width-1-1 uk-form-medium',
|
||||
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
|
||||
'selected'=>($_Post->draft()?'draft':'published'),
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
// Slug input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'slug',
|
||||
'value'=>$_Post->slug(),
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'tip'=>$L->g('you-can-modify-the-url-which-identifies'),
|
||||
'label'=>$L->g('Friendly URL')
|
||||
));
|
||||
|
||||
echo '</li>';
|
||||
echo '</ul>';
|
||||
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
HTML::formClose();
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
var key = $("#jskey").val();
|
||||
|
||||
$("#jsdate").datetimepicker({format:"<?php echo DB_DATE_FORMAT ?>"});
|
||||
|
||||
$("#jstitle").keyup(function() {
|
||||
var slug = $(this).val();
|
||||
checkSlugPost(slug, key, $("#jsslug"));
|
||||
});
|
||||
|
||||
$("#jsslug").keyup(function() {
|
||||
var slug = $("#jsslug").val();
|
||||
checkSlugPost(slug, key, $("#jsslug"));
|
||||
});
|
||||
|
||||
$("#jsdelete-post").click(function() {
|
||||
if(confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")==false) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
115
admin/views/edit-user.php
Normal file
115
admin/views/edit-user.php
Normal file
|
@ -0,0 +1,115 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('Edit user'), 'icon'=>'user'));
|
||||
|
||||
HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal'));
|
||||
|
||||
// Security token
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$Security->getToken()
|
||||
));
|
||||
|
||||
// Security token
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'username',
|
||||
'value'=>$_user['username']
|
||||
));
|
||||
|
||||
HTML::legend(array('value'=>$L->g('Profile')));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'usernameDisable',
|
||||
'label'=>$L->g('Username'),
|
||||
'value'=>$_user['username'],
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'disabled'=>true,
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'firstName',
|
||||
'label'=>$L->g('First name'),
|
||||
'value'=>$_user['firstName'],
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'lastName',
|
||||
'label'=>$L->g('Last name'),
|
||||
'value'=>$_user['lastName'],
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo '<div class="uk-form-row">
|
||||
<label class="uk-form-label">Password</label>
|
||||
<div class="uk-form-controls">
|
||||
<a href="'.HTML_PATH_ADMIN_ROOT.'user-password/'.$_user['username'].'">'.$L->g('Change password').'</a>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
if($Login->role()==='admin') {
|
||||
|
||||
HTML::formSelect(array(
|
||||
'name'=>'role',
|
||||
'label'=>$L->g('Role'),
|
||||
'options'=>array('editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')),
|
||||
'selected'=>$_user['role'],
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'email',
|
||||
'label'=>$L->g('Email'),
|
||||
'value'=>$_user['email'],
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>$L->g('email-will-not-be-publicly-displayed')
|
||||
));
|
||||
|
||||
echo '<div class="uk-form-row">
|
||||
<div class="uk-form-controls">
|
||||
<button type="submit" class="uk-button uk-button-primary">'.$L->g('Save').'</button>
|
||||
<a href="'.HTML_PATH_ADMIN_ROOT.'users" class="uk-button">'.$L->g('Cancel').'</a>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
if( ($Login->role()==='admin') && ($_user['username']!='admin') ) {
|
||||
|
||||
HTML::legend(array('value'=>$L->g('Delete')));
|
||||
|
||||
echo '<div class="uk-form-row">
|
||||
<div class="uk-form-controls">
|
||||
<button type="submit" id="jsdelete-user-associate" class="delete-button" name="delete-user-associate"><i class="uk-icon-ban"></i> '.$L->g('Delete the user and associate its posts to admin user').'</button>
|
||||
<button type="submit" id="jsdelete-user-all" class="delete-button" name="delete-user-all"><i class="uk-icon-ban"></i> '.$L->g('Delete the user and all its posts').'</button>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
}
|
||||
|
||||
HTML::formClose();
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#jsdelete-user-associate").click(function() {
|
||||
if(confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")==false) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$("#jsdelete-user-all").click(function() {
|
||||
if(confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")==false) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
19
admin/views/login-email.php
Normal file
19
admin/views/login-email.php
Normal file
|
@ -0,0 +1,19 @@
|
|||
<div class="login-form">
|
||||
|
||||
<form method="post" action="<?php echo HTML_PATH_ADMIN_ROOT.'login-email' ?>" class="uk-form" autocomplete="off">
|
||||
|
||||
<input type="hidden" id="jstoken" name="tokenCSRF" value="<?php $Security->printToken() ?>">
|
||||
|
||||
<div class="uk-form-row">
|
||||
<input name="email" class="uk-width-1-1 uk-form-large" placeholder="<?php $L->p('Email') ?>" type="text">
|
||||
</div>
|
||||
|
||||
<div class="uk-form-row">
|
||||
<button type="submit" class="uk-width-1-1 uk-button uk-button-primary uk-button-large"><?php $L->p('Get login access code') ?></button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<a class="login-email" href="<?php echo HTML_PATH_ADMIN_ROOT.'login' ?>"><i class="uk-icon-chevron-left"></i> <?php $L->p('Back to login form') ?></a>
|
23
admin/views/login.php
Normal file
23
admin/views/login.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<div class="login-form">
|
||||
|
||||
<form method="post" action="<?php echo HTML_PATH_ADMIN_ROOT.'login' ?>" class="uk-form" autocomplete="off">
|
||||
|
||||
<input type="hidden" id="jstoken" name="tokenCSRF" value="<?php $Security->printToken() ?>">
|
||||
|
||||
<div class="uk-form-row">
|
||||
<input name="username" class="uk-width-1-1 uk-form-large" placeholder="<?php $L->p('Username') ?>" type="text">
|
||||
</div>
|
||||
|
||||
<div class="uk-form-row">
|
||||
<input name="password" class="uk-width-1-1 uk-form-large" placeholder="<?php $L->p('Password') ?>" type="password">
|
||||
</div>
|
||||
|
||||
<div class="uk-form-row">
|
||||
<button type="submit" class="uk-width-1-1 uk-button uk-button-primary uk-button-large"><?php $Language->p('Login') ?></button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<a class="login-email" href="<?php echo HTML_PATH_ADMIN_ROOT.'login-email' ?>"><i class="uk-icon-envelope-o"></i> <?php $L->p('Send me a login access code') ?></a>
|
41
admin/views/manage-pages.php
Normal file
41
admin/views/manage-pages.php
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('Manage pages'), 'icon'=>'folder'));
|
||||
|
||||
echo '
|
||||
<table class="uk-table uk-table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.$L->g('Title').'</th>
|
||||
<th>'.$L->g('Parent').'</th>
|
||||
<th class="uk-text-center">'.$L->g('Position').'</th>
|
||||
<th>'.$L->g('Friendly URL').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
';
|
||||
|
||||
foreach($pagesParents as $parentKey=>$pageList)
|
||||
{
|
||||
foreach($pageList as $Page)
|
||||
{
|
||||
if($parentKey!==NO_PARENT_CHAR) {
|
||||
$parentTitle = $pages[$Page->parentKey()]->title();
|
||||
}
|
||||
else {
|
||||
$parentTitle = '';
|
||||
}
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td>'.($Page->parentKey()?'- ':'').'<a href="'.HTML_PATH_ADMIN_ROOT.'edit-page/'.$Page->key().'">'.($Page->published()?'':'<span class="label-draft">'.$Language->g('Draft').'</span> ').($Page->title()?$Page->title():'<span class="label-empty-title">'.$Language->g('Empty title').'</span> ').'</a></td>';
|
||||
echo '<td>'.$parentTitle.'</td>';
|
||||
echo '<td class="uk-text-center">'.$Page->position().'</td>';
|
||||
echo '<td><a target="_blank" href="'.$Page->permalink().'">'.$Url->filters('page').'/'.$Page->key().'</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
55
admin/views/manage-posts.php
Normal file
55
admin/views/manage-posts.php
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('Manage posts'), 'icon'=>'folder'));
|
||||
|
||||
echo '
|
||||
<table class="uk-table uk-table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.$L->g('Title').'</th>
|
||||
<th class="uk-text-center">'.$L->g('Published date').'</th>
|
||||
<th>'.$L->g('Friendly URL').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
';
|
||||
|
||||
foreach($posts as $Post)
|
||||
{
|
||||
$status = false;
|
||||
if($Post->scheduled()) {
|
||||
$status = $Language->g('Scheduled');
|
||||
}
|
||||
elseif(!$Post->published()) {
|
||||
$status = $Language->g('Draft');
|
||||
}
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td><a href="'.HTML_PATH_ADMIN_ROOT.'edit-post/'.$Post->key().'">'.($status?'<span class="label-draft">'.$status.'</span>':'').($Post->title()?$Post->title():'<span class="label-empty-title">'.$Language->g('Empty title').'</span> ').'</a></td>';
|
||||
echo '<td class="uk-text-center">'.$Post->date().'</td>';
|
||||
echo '<td><a target="_blank" href="'.$Post->permalink().'">'.$Url->filters('post').'/'.$Post->key().'</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
|
||||
?>
|
||||
|
||||
<div id="paginator">
|
||||
<ul>
|
||||
<?php
|
||||
if(Paginator::get('showNewer')) {
|
||||
echo '<li class="previous"><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="next"><a href="'.HTML_PATH_ADMIN_ROOT.'manage-posts?page='.Paginator::get('nextPage').'">'.$Language->g('Next page').' »</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
173
admin/views/new-page.php
Normal file
173
admin/views/new-page.php
Normal file
|
@ -0,0 +1,173 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('New page'), 'icon'=>'file-text-o'));
|
||||
|
||||
HTML::formOpen(array('class'=>'uk-form-stacked'));
|
||||
|
||||
// Security token
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$Security->getToken()
|
||||
));
|
||||
|
||||
// ---- LEFT SIDE ----
|
||||
echo '<div class="uk-grid">';
|
||||
echo '<div class="uk-width-large-7-10">';
|
||||
|
||||
// Title input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'title',
|
||||
'value'=>'',
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'placeholder'=>$L->g('Title')
|
||||
));
|
||||
|
||||
// Content input
|
||||
HTML::formTextarea(array(
|
||||
'name'=>'content',
|
||||
'value'=>'',
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'placeholder'=>$L->g('Content')
|
||||
));
|
||||
|
||||
// Form buttons
|
||||
echo '<div class="uk-form-row uk-margin-bottom">
|
||||
<button class="uk-button uk-button-primary" type="submit">'.$L->g('Save').'</button>
|
||||
<a class="uk-button" href="'.HTML_PATH_ADMIN_ROOT.'manage-pages">'.$L->g('Cancel').'</a>
|
||||
</div>';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
// ---- RIGHT SIDE ----
|
||||
echo '<div class="uk-width-large-3-10">';
|
||||
|
||||
// Tabs, general and advanced mode
|
||||
echo '<ul class="uk-tab" data-uk-tab="{connect:\'#tab-options\'}">';
|
||||
echo '<li><a href="">'.$L->g('General').'</a></li>';
|
||||
echo '<li><a href="">'.$L->g('Images').'</a></li>';
|
||||
echo '<li><a href="">'.$L->g('Advanced').'</a></li>';
|
||||
echo '</ul>';
|
||||
|
||||
echo '<ul id="tab-options" class="uk-switcher uk-margin">';
|
||||
|
||||
// ---- GENERAL TAB ----
|
||||
echo '<li>';
|
||||
|
||||
// Description input
|
||||
HTML::formTextarea(array(
|
||||
'name'=>'description',
|
||||
'label'=>$L->g('description'),
|
||||
'value'=>'',
|
||||
'rows'=>'7',
|
||||
'class'=>'uk-width-1-1 uk-form-medium',
|
||||
'tip'=>$L->g('this-field-can-help-describe-the-content')
|
||||
));
|
||||
|
||||
// Tags input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'tags',
|
||||
'value'=>'',
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'tip'=>$L->g('Write the tags separated by commas'),
|
||||
'label'=>$L->g('Tags')
|
||||
));
|
||||
|
||||
echo '</li>';
|
||||
|
||||
// ---- IMAGES TAB ----
|
||||
echo '<li>';
|
||||
|
||||
HTML::uploader();
|
||||
|
||||
echo '</li>';
|
||||
|
||||
// ---- ADVANCED TAB ----
|
||||
echo '<li>';
|
||||
|
||||
// Parent input
|
||||
$options = array();
|
||||
$options[NO_PARENT_CHAR] = '('.$Language->g('No parent').')';
|
||||
$options += $dbPages->parentKeyList();
|
||||
|
||||
HTML::formSelect(array(
|
||||
'name'=>'parent',
|
||||
'label'=>$L->g('Parent'),
|
||||
'class'=>'uk-width-1-1 uk-form-medium',
|
||||
'options'=>$options,
|
||||
'selected'=>NO_PARENT_CHAR,
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
// Status input
|
||||
HTML::formSelect(array(
|
||||
'name'=>'status',
|
||||
'label'=>$L->g('Status'),
|
||||
'class'=>'uk-width-1-1 uk-form-medium',
|
||||
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
|
||||
'selected'=>'published',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
// Position input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'position',
|
||||
'value'=>'1',
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'label'=>$L->g('Position')
|
||||
));
|
||||
|
||||
// Slug input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'slug',
|
||||
'value'=>'',
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'tip'=>$L->g('you-can-modify-the-url-which-identifies'),
|
||||
'label'=>$L->g('Friendly URL')
|
||||
));
|
||||
|
||||
echo '</li>';
|
||||
echo '<ul>';
|
||||
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
HTML::formClose();
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
$("#jsslug").keyup(function() {
|
||||
var text = $(this).val();
|
||||
var parent = $("#jsparent").val();
|
||||
|
||||
checkSlugPage(text, parent, "", $("#jsslug"));
|
||||
});
|
||||
|
||||
$("#jstitle").keyup(function() {
|
||||
var text = $(this).val();
|
||||
var parent = $("#jsparent").val();
|
||||
|
||||
checkSlugPage(text, parent, "", $("#jsslug"));
|
||||
});
|
||||
|
||||
$("#jsparent").change(function() {
|
||||
var parent = $(this).val();
|
||||
var text = $("#jsslug").val();
|
||||
|
||||
if(parent==NO_PARENT_CHAR) {
|
||||
$("#jsparentExample").text("");
|
||||
}
|
||||
else {
|
||||
$("#jsparentExample").text(parent+"/");
|
||||
}
|
||||
|
||||
checkSlugPage(text, parent, "", $("#jsslug"));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
143
admin/views/new-post.php
Normal file
143
admin/views/new-post.php
Normal file
|
@ -0,0 +1,143 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('New post'), 'icon'=>'pencil'));
|
||||
|
||||
HTML::formOpen(array('class'=>'uk-form-stacked'));
|
||||
|
||||
// Security token
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$Security->getToken()
|
||||
));
|
||||
|
||||
// ---- LEFT SIDE ----
|
||||
echo '<div class="uk-grid">';
|
||||
echo '<div class="uk-width-large-7-10">';
|
||||
|
||||
// Title input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'title',
|
||||
'value'=>'',
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'placeholder'=>$L->g('Title')
|
||||
));
|
||||
|
||||
// Content input
|
||||
HTML::formTextarea(array(
|
||||
'name'=>'content',
|
||||
'value'=>'',
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'placeholder'=>$L->g('Content')
|
||||
));
|
||||
|
||||
// Form buttons
|
||||
echo '<div class="uk-form-row uk-margin-bottom">
|
||||
<button class="uk-button uk-button-primary" type="submit">'.$L->g('Save').'</button>
|
||||
<a class="uk-button" href="'.HTML_PATH_ADMIN_ROOT.'manage-posts">'.$L->g('Cancel').'</a>
|
||||
</div>';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
// ---- RIGHT SIDE ----
|
||||
echo '<div class="uk-width-large-3-10">';
|
||||
|
||||
// Tabs, general and advanced mode
|
||||
echo '<ul class="uk-tab" data-uk-tab="{connect:\'#tab-options\'}">';
|
||||
echo '<li><a href="">'.$L->g('General').'</a></li>';
|
||||
echo '<li><a href="">'.$L->g('Images').'</a></li>';
|
||||
echo '<li><a href="">'.$L->g('Advanced').'</a></li>';
|
||||
echo '</ul>';
|
||||
|
||||
echo '<ul id="tab-options" class="uk-switcher uk-margin">';
|
||||
|
||||
// ---- GENERAL TAB ----
|
||||
echo '<li>';
|
||||
|
||||
// Description input
|
||||
HTML::formTextarea(array(
|
||||
'name'=>'description',
|
||||
'label'=>$L->g('description'),
|
||||
'value'=>'',
|
||||
'rows'=>'7',
|
||||
'class'=>'uk-width-1-1 uk-form-medium',
|
||||
'tip'=>$L->g('this-field-can-help-describe-the-content')
|
||||
));
|
||||
|
||||
// Tags input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'tags',
|
||||
'value'=>'',
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'tip'=>$L->g('Write the tags separated by commas'),
|
||||
'label'=>$L->g('Tags')
|
||||
));
|
||||
|
||||
echo '</li>';
|
||||
|
||||
// ---- IMAGES TAB ----
|
||||
echo '<li>';
|
||||
|
||||
HTML::uploader();
|
||||
|
||||
echo '</li>';
|
||||
|
||||
// ---- ADVANCED TAB ----
|
||||
echo '<li>';
|
||||
|
||||
// Date input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'date',
|
||||
'value'=>Date::current(DB_DATE_FORMAT),
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'tip'=>$L->g('To schedule the post just select the date and time'),
|
||||
'label'=>$L->g('Date')
|
||||
));
|
||||
|
||||
// Status input
|
||||
HTML::formSelect(array(
|
||||
'name'=>'status',
|
||||
'label'=>$L->g('Status'),
|
||||
'class'=>'uk-width-1-1 uk-form-medium',
|
||||
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
|
||||
'selected'=>'published',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
// Slug input
|
||||
HTML::formInputText(array(
|
||||
'name'=>'slug',
|
||||
'value'=>'',
|
||||
'class'=>'uk-width-1-1 uk-form-large',
|
||||
'tip'=>$L->g('you-can-modify-the-url-which-identifies'),
|
||||
'label'=>$L->g('Friendly URL')
|
||||
));
|
||||
|
||||
echo '</li>';
|
||||
echo '</ul>';
|
||||
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
HTML::formClose();
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#jsdate").datetimepicker({format:"<?php echo DB_DATE_FORMAT ?>"});
|
||||
|
||||
$("#jstitle").keyup(function() {
|
||||
var slug = $(this).val();
|
||||
checkSlugPost(slug, "", $("#jsslug"));
|
||||
});
|
||||
|
||||
$("#jsslug").keyup(function() {
|
||||
var slug = $("#jsslug").val();
|
||||
checkSlugPost(slug, "", $("#jsslug"));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
52
admin/views/plugins.php
Normal file
52
admin/views/plugins.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('Plugins'), 'icon'=>'puzzle-piece'));
|
||||
|
||||
echo '
|
||||
<table class="uk-table uk-table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="uk-width-1-5">'.$L->g('Name').'</th>
|
||||
<th class="uk-width-3-5">'.$L->g('Description').'</th>
|
||||
<th class="uk-text-center">'.$L->g('Version').'</th>
|
||||
<th class="uk-text-center">'.$L->g('Author').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
';
|
||||
|
||||
foreach($plugins['all'] as $Plugin)
|
||||
{
|
||||
echo '
|
||||
<tr>
|
||||
<td>
|
||||
<div class="plugin-name">'.$Plugin->name().'</div>
|
||||
<div class="plugin-links">
|
||||
';
|
||||
|
||||
if($Plugin->installed()) {
|
||||
if(method_exists($Plugin, 'form')) {
|
||||
echo '<a class="configure" href="'.HTML_PATH_ADMIN_ROOT.'configure-plugin/'.$Plugin->className().'">'.$L->g('Configure').'</a>';
|
||||
echo '<span class="separator"> | </span>';
|
||||
}
|
||||
echo '<a class="uninstall" href="'.HTML_PATH_ADMIN_ROOT.'uninstall-plugin/'.$Plugin->className().'">'.$L->g('Uninstall').'</a>';
|
||||
}
|
||||
else {
|
||||
echo '<a class="install" href="'.HTML_PATH_ADMIN_ROOT.'install-plugin/'.$Plugin->className().'">'.$L->g('Install').'</a>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</div>
|
||||
</td>
|
||||
<td>'.$Plugin->description().'</td>
|
||||
<td class="uk-text-center">'.$Plugin->version().'</td>
|
||||
<td class="uk-text-center"><a targe="_blank" href="'.$Plugin->website().'">'.$Plugin->author().'</a></td>
|
||||
';
|
||||
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
91
admin/views/settings-advanced.php
Normal file
91
admin/views/settings-advanced.php
Normal file
|
@ -0,0 +1,91 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('Advanced settings'), 'icon'=>'cogs'));
|
||||
|
||||
HTML::formOpen(array('class'=>'uk-form-horizontal'));
|
||||
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$Security->getToken()
|
||||
));
|
||||
|
||||
HTML::formSelect(array(
|
||||
'name'=>'postsperpage',
|
||||
'label'=>$L->g('Posts per page'),
|
||||
'options'=>array('1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8'),
|
||||
'selected'=>$Site->postsPerPage(),
|
||||
'class'=>'uk-width-1-3 uk-form-medium',
|
||||
'tip'=>$L->g('number-of-posts-to-show-per-page')
|
||||
));
|
||||
|
||||
HTML::formSelect(array(
|
||||
'name'=>'homepage',
|
||||
'label'=>$L->g('Default home page'),
|
||||
'options'=>$_homePageList,
|
||||
'selected'=>$Site->homepage(),
|
||||
'class'=>'uk-width-1-3 uk-form-medium',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'url',
|
||||
'label'=>$L->g('Site URL'),
|
||||
'value'=>$Site->url(),
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>$L->g('the-url-of-your-site')
|
||||
));
|
||||
|
||||
HTML::legend(array('value'=>$L->g('Command Line Mode')));
|
||||
|
||||
HTML::formSelect(array(
|
||||
'name'=>'cliMode',
|
||||
'label'=>$L->g('Cli Mode'),
|
||||
'options'=>array('true'=>$L->g('Enabled'), 'false'=>$L->g('Disabled')),
|
||||
'selected'=>$Site->cliMode(),
|
||||
'class'=>'uk-width-1-3 uk-form-medium',
|
||||
'tip'=>$L->g('enable-the-command-line-mode-if-you-add-edit')
|
||||
));
|
||||
|
||||
HTML::legend(array('value'=>$L->g('Email account settings')));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'emailFrom',
|
||||
'label'=>$L->g('Sender email'),
|
||||
'value'=>$Site->emailFrom(),
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>$L->g('Emails will be sent from this address')
|
||||
));
|
||||
|
||||
HTML::legend(array('value'=>$L->g('URL Filters')));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'uriPost',
|
||||
'label'=>$L->g('Posts'),
|
||||
'value'=>$Site->uriFilters('post'),
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'uriPage',
|
||||
'label'=>$L->g('Pages'),
|
||||
'value'=>$Site->uriFilters('page'),
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'uriTag',
|
||||
'label'=>$L->g('Tags'),
|
||||
'value'=>$Site->uriFilters('tag'),
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo '<div class="uk-form-row">
|
||||
<div class="uk-form-controls">
|
||||
<button type="submit" class="uk-button uk-button-primary">'.$L->g('Save').'</button>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
HTML::formClose();
|
51
admin/views/settings-general.php
Normal file
51
admin/views/settings-general.php
Normal file
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('General settings'), 'icon'=>'cogs'));
|
||||
|
||||
HTML::formOpen(array('class'=>'uk-form-horizontal'));
|
||||
|
||||
// Security token
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$Security->getToken()
|
||||
));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'title',
|
||||
'label'=>$L->g('Site title'),
|
||||
'value'=>$Site->title(),
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>$L->g('use-this-field-to-name-your-site')
|
||||
));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'slogan',
|
||||
'label'=>$L->g('Site slogan'),
|
||||
'value'=>$Site->slogan(),
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>$L->g('use-this-field-to-add-a-catchy-phrase')
|
||||
));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'description',
|
||||
'label'=>$L->g('Site description'),
|
||||
'value'=>$Site->description(),
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>$L->g('you-can-add-a-site-description-to-provide')
|
||||
));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'footer',
|
||||
'label'=>$L->g('Footer text'),
|
||||
'value'=>$Site->footer(),
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>$L->g('you-can-add-a-small-text-on-the-bottom')
|
||||
));
|
||||
|
||||
echo '<div class="uk-form-row">
|
||||
<div class="uk-form-controls">
|
||||
<button type="submit" class="uk-button uk-button-primary">'.$L->g('Save').'</button>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
HTML::formClose();
|
59
admin/views/settings-regional.php
Normal file
59
admin/views/settings-regional.php
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('Language and timezone'), 'icon'=>'cogs'));
|
||||
|
||||
HTML::formOpen(array('class'=>'uk-form-horizontal'));
|
||||
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$Security->getToken()
|
||||
));
|
||||
|
||||
HTML::formSelect(array(
|
||||
'name'=>'language',
|
||||
'label'=>$L->g('Language'),
|
||||
'options'=>$Language->getLanguageList(),
|
||||
'selected'=>$Site->language(),
|
||||
'class'=>'uk-width-1-3 uk-form-medium',
|
||||
'tip'=>$L->g('select-your-sites-language')
|
||||
));
|
||||
|
||||
HTML::formSelect(array(
|
||||
'name'=>'timezone',
|
||||
'label'=>$L->g('Timezone'),
|
||||
'options'=>Date::timezoneList(),
|
||||
'selected'=>$Site->timezone(),
|
||||
'class'=>'uk-width-1-3 uk-form-medium',
|
||||
'tip'=>$L->g('select-a-timezone-for-a-correct')
|
||||
));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'locale',
|
||||
'label'=>$L->g('Locale'),
|
||||
'value'=>$Site->locale(),
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>$L->g('you-can-use-this-field-to-define-a-set-off')
|
||||
));
|
||||
|
||||
echo '<div class="uk-form-row">
|
||||
<div class="uk-form-controls">
|
||||
<button type="submit" class="uk-button uk-button-primary">'.$L->g('Save').'</button>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
HTML::formClose();
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#jslanguage").change(function () {
|
||||
var locale = $("#jslanguage option:selected").val();
|
||||
$("#jslocale").attr("value",locale);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
45
admin/views/themes.php
Normal file
45
admin/views/themes.php
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('Themes'), 'icon'=>'paint-brush'));
|
||||
|
||||
echo '
|
||||
<table class="uk-table uk-table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="uk-width-1-5">'.$L->g('Name').'</th>
|
||||
<th class="uk-width-3-5">'.$L->g('Description').'</th>
|
||||
<th class="uk-text-center">'.$L->g('Version').'</th>
|
||||
<th class="uk-text-center">'.$L->g('Author').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
';
|
||||
|
||||
foreach($themes as $theme)
|
||||
{
|
||||
echo '
|
||||
<tr>
|
||||
<td>
|
||||
<div class="plugin-name">'.$theme['name'].'</div>
|
||||
<div class="plugin-links">
|
||||
';
|
||||
|
||||
if($theme['dirname']!=$Site->theme()) {
|
||||
echo '<a class="install" href="'.HTML_PATH_ADMIN_ROOT.'install-theme/'.$theme['dirname'].'">'.$L->g('Install').'</a>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</div>
|
||||
</td>
|
||||
<td>'.$theme['description'].'</td>
|
||||
<td class="uk-text-center">'.$theme['version'].'</td>
|
||||
<td class="uk-text-center"><a targe="_blank" href="'.$theme['website'].'">'.$theme['author'].'</a></td>
|
||||
';
|
||||
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
55
admin/views/user-password.php
Normal file
55
admin/views/user-password.php
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('Change password'), 'icon'=>'key'));
|
||||
|
||||
HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal'));
|
||||
|
||||
// Security token
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$Security->getToken()
|
||||
));
|
||||
|
||||
// Hidden field username
|
||||
HTML::formInputHidden(array(
|
||||
'name'=>'username',
|
||||
'value'=>$_user['username']
|
||||
));
|
||||
|
||||
HTML::legend(array('value'=>$L->g('New password')));
|
||||
|
||||
HTML::formInputText(array(
|
||||
'name'=>'usernameDisable',
|
||||
'label'=>$L->g('Username'),
|
||||
'value'=>$_user['username'],
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'disabled'=>true,
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
HTML::formInputPassword(array(
|
||||
'name'=>'new_password',
|
||||
'label'=>$L->g('New password'),
|
||||
'value'=>'',
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
HTML::formInputPassword(array(
|
||||
'name'=>'confirm_password',
|
||||
'label'=>$L->g('Confirm password'),
|
||||
'value'=>'',
|
||||
'class'=>'uk-width-1-2 uk-form-medium',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo '<div class="uk-form-row">
|
||||
<div class="uk-form-controls">
|
||||
<button type="submit" class="uk-button uk-button-primary">'.$L->g('Save').'</button>
|
||||
<a href="'.HTML_PATH_ADMIN_ROOT.'edit-user/'.$_user['username'].'" class="uk-button">'.$L->g('Cancel').'</a>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
HTML::formClose();
|
||||
|
||||
?>
|
38
admin/views/users.php
Normal file
38
admin/views/users.php
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
HTML::title(array('title'=>$L->g('Users'), 'icon'=>'users'));
|
||||
|
||||
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'add-user"><i class="uk-icon-plus"></i> '.$L->g('add-a-new-user').'</a>';
|
||||
|
||||
echo '
|
||||
<table class="uk-table uk-table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.$L->g('Username').'</th>
|
||||
<th>'.$L->g('First name').'</th>
|
||||
<th>'.$L->g('Last name').'</th>
|
||||
<th>'.$L->g('Email').'</th>
|
||||
<th class="uk-text-center">'.$L->g('Role').'</th>
|
||||
<th class="uk-text-center">'.$L->g('Registered').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
';
|
||||
|
||||
$users = $dbUsers->getAll();
|
||||
foreach($users as $username=>$field)
|
||||
{
|
||||
echo '<tr>';
|
||||
echo '<td><a href="'.HTML_PATH_ADMIN_ROOT.'edit-user/'.$username.'">'.$username.'</a></td>';
|
||||
echo '<td>'.$field['firstName'].'</td>';
|
||||
echo '<td>'.$field['lastName'].'</td>';
|
||||
echo '<td>'.$field['email'].'</td>';
|
||||
echo '<td class="uk-text-center">'.$field['role'].'</td>';
|
||||
echo '<td class="uk-text-center">'.Date::format($field['registered'], DB_DATE_FORMAT, DB_DATE_FORMAT).'</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
|
@ -1,120 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
class dbJSON {
|
||||
|
||||
public $db;
|
||||
public $dbBackup;
|
||||
public $file;
|
||||
public $firstLine;
|
||||
|
||||
// $file, the JSON file.
|
||||
// $firstLine, TRUE if you want to remove the first line, FALSE otherwise
|
||||
function __construct($file, $firstLine=true)
|
||||
{
|
||||
$this->file = $file;
|
||||
$this->db = array();
|
||||
$this->dbBackup = array();
|
||||
$this->firstLine = $firstLine;
|
||||
|
||||
if (file_exists($file)) {
|
||||
// Read JSON file
|
||||
$lines = file($file);
|
||||
|
||||
// Remove the first line, the first line is for security reasons
|
||||
if ($firstLine) {
|
||||
unset($lines[0]);
|
||||
}
|
||||
|
||||
// Regenerate the JSON file
|
||||
$implode = implode($lines);
|
||||
|
||||
// Unserialize, JSON to Array
|
||||
$array = $this->unserialize($implode);
|
||||
if (empty($array)) {
|
||||
$this->db = array();
|
||||
$this->dbBackup = array();
|
||||
} else {
|
||||
$this->db = $array;
|
||||
$this->dbBackup = $array;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function restoreDB()
|
||||
{
|
||||
$this->db = $this->dbBackup;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Returns the number of rows in the database
|
||||
public function count()
|
||||
{
|
||||
return count($this->db);
|
||||
}
|
||||
|
||||
// Returns the value from the field
|
||||
public function getField($field)
|
||||
{
|
||||
if (isset($this->db[$field])) {
|
||||
return $this->db[$field];
|
||||
}
|
||||
return $this->dbFields[$field];
|
||||
}
|
||||
|
||||
// Save the JSON file
|
||||
public function save()
|
||||
{
|
||||
$data = '';
|
||||
if ($this->firstLine) {
|
||||
$data = "<?php defined('BLUDIT') or die('Bludit CMS.'); ?>".PHP_EOL;
|
||||
}
|
||||
|
||||
// Serialize database
|
||||
$data .= $this->serialize($this->db);
|
||||
|
||||
// Backup the new database.
|
||||
$this->dbBackup = $this->db;
|
||||
|
||||
// LOCK_EX flag to prevent anyone else writing to the file at the same time.
|
||||
if (file_put_contents($this->file, $data, LOCK_EX)) {
|
||||
return true;
|
||||
} else {
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to save the database file.', LOG_TYPE_ERROR);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Returns a JSON encoded string on success or FALSE on failure
|
||||
private function serialize($data)
|
||||
{
|
||||
if (DEBUG_MODE) {
|
||||
return json_encode($data, JSON_PRETTY_PRINT);
|
||||
}
|
||||
return json_encode($data);
|
||||
}
|
||||
|
||||
// Returns the value encoded in json in appropriate PHP type
|
||||
private function unserialize($data)
|
||||
{
|
||||
// NULL is returned if the json cannot be decoded
|
||||
$decode = json_decode($data, true);
|
||||
if ($decode===NULL) {
|
||||
Log::set(__METHOD__.LOG_SEP.'Error trying to read the JSON file: '.$this->file, LOG_TYPE_ERROR);
|
||||
return false;
|
||||
}
|
||||
return $decode;
|
||||
}
|
||||
|
||||
public function getDB()
|
||||
{
|
||||
return $this->db;
|
||||
}
|
||||
|
||||
// Truncate all the rows
|
||||
public function truncate()
|
||||
{
|
||||
$this->db = array();
|
||||
return $this->save();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,191 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
/*
|
||||
Database structure
|
||||
|
||||
{
|
||||
"videos": {
|
||||
"name": "Videos",
|
||||
"template: "",
|
||||
"description: "",
|
||||
"list": [ "my-page", "second-page" ]
|
||||
},
|
||||
"pets": {
|
||||
"name": "Pets",
|
||||
"template: "",
|
||||
"description: "",
|
||||
"list": [ "cats-and-dogs" ]
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
class dbList extends dbJSON
|
||||
{
|
||||
public $db = array();
|
||||
|
||||
function __construct($file)
|
||||
{
|
||||
parent::__construct($file);
|
||||
}
|
||||
|
||||
public function keys()
|
||||
{
|
||||
return array_keys($this->db);
|
||||
}
|
||||
|
||||
// Returns the list of keys filter by pageNumber
|
||||
// $pageNumber start in 1
|
||||
public function getList($key, $pageNumber, $numberOfItems)
|
||||
{
|
||||
if (!isset($this->db[$key])) {
|
||||
Log::set(__METHOD__.LOG_SEP.'Error key does not exist '.$key);
|
||||
return false;
|
||||
}
|
||||
|
||||
// List of keys
|
||||
$list = $this->db[$key]['list'];
|
||||
|
||||
// Returns all the items from the list
|
||||
if ($numberOfItems==-1) {
|
||||
return $list;
|
||||
}
|
||||
|
||||
// The first page number is 1, so the real is 0
|
||||
$realPageNumber = $pageNumber - 1;
|
||||
$chunks = array_chunk($list, $numberOfItems);
|
||||
if (isset($chunks[$realPageNumber])) {
|
||||
return $chunks[$realPageNumber];
|
||||
}
|
||||
|
||||
// Out of index,returns FALSE
|
||||
return false;
|
||||
}
|
||||
|
||||
public function generateKey($name)
|
||||
{
|
||||
global $L;
|
||||
|
||||
$key = Text::cleanUrl($name);
|
||||
if (Text::isEmpty($key)) {
|
||||
$key = $L->g('empty');
|
||||
}
|
||||
while (isset($this->db[$key])) {
|
||||
$key++;
|
||||
}
|
||||
return $key;
|
||||
}
|
||||
|
||||
// Add a new item to the dblist
|
||||
// $args => 'name', 'template', 'description', list'
|
||||
public function add($args)
|
||||
{
|
||||
$key = $this->generateKey($args['name']);
|
||||
|
||||
$this->db[$key]['name'] = Sanitize::removeTags($args['name']);
|
||||
$this->db[$key]['template'] = isset($args['template'])?Sanitize::removeTags($args['template']):'';
|
||||
$this->db[$key]['description'] = isset($args['description'])?Sanitize::removeTags($args['description']):'';
|
||||
$this->db[$key]['list'] = isset($args['list'])?$args['list']:array();
|
||||
|
||||
$this->sortAlphanumeric();
|
||||
$this->save();
|
||||
return $key;
|
||||
}
|
||||
|
||||
public function remove($key)
|
||||
{
|
||||
if (!isset($this->db[$key])) {
|
||||
Log::set(__METHOD__.LOG_SEP.'The key does not exist, key: '.$key);
|
||||
return false;
|
||||
}
|
||||
|
||||
unset($this->db[$key]);
|
||||
return $this->save();
|
||||
}
|
||||
|
||||
// Edit an item to the dblist
|
||||
// $args => 'name', 'oldkey', 'newKey', 'template', 'description'
|
||||
public function edit($args)
|
||||
{
|
||||
if ( isset($this->db[$args['newKey']]) && ($args['newKey']!==$args['oldKey']) ) {
|
||||
Log::set(__METHOD__.LOG_SEP.'The new key already exists. Key: '.$args['newKey'], LOG_TYPE_WARN);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->db[$args['newKey']]['name'] = Sanitize::removeTags($args['name']);
|
||||
$this->db[$args['newKey']]['template'] = isset($args['template'])?Sanitize::removeTags($args['template']):'';
|
||||
$this->db[$args['newKey']]['description'] = isset($args['description'])?Sanitize::removeTags($args['description']):'';
|
||||
$this->db[$args['newKey']]['list'] = $this->db[$args['oldKey']]['list'];
|
||||
|
||||
// Remove the old category
|
||||
if ($args['oldKey'] !== $args['newKey']) {
|
||||
unset( $this->db[$args['oldKey']] );
|
||||
}
|
||||
|
||||
$this->sortAlphanumeric();
|
||||
$this->save();
|
||||
return $args['newKey'];
|
||||
}
|
||||
|
||||
// Sort the categories by "Natural order"
|
||||
public function sortAlphanumeric()
|
||||
{
|
||||
// Sort key alphanumeric strings, a01, a10, b10, c02
|
||||
return ksort($this->db);
|
||||
}
|
||||
|
||||
// Returns the name associated to the key, FALSE if the key doesn't exist
|
||||
public function getName($key)
|
||||
{
|
||||
if (isset($this->db[$key])) {
|
||||
return $this->db[$key]['name'];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Returns an array with key=>name of the list
|
||||
public function getKeyNameArray()
|
||||
{
|
||||
$tmp = array();
|
||||
foreach($this->db as $key=>$fields) {
|
||||
$tmp[$key] = $fields['name'];
|
||||
}
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
// Returns the number of items in the list
|
||||
public function countItems($key)
|
||||
{
|
||||
if (isset($this->db[$key])) {
|
||||
return count($this->db[$key]['list']);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function exists($key)
|
||||
{
|
||||
return isset( $this->db[$key] );
|
||||
}
|
||||
|
||||
public function existsName($name)
|
||||
{
|
||||
foreach ($this->db as $key=>$fields) {
|
||||
if ($name==$fields['name']) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Returns an array with a portion of the database filtered by key
|
||||
// Returns array( 'key'=>'', 'name'=>'', 'template'=>'', 'description'=>'', list'=>array() )
|
||||
public function getMap($key)
|
||||
{
|
||||
if (isset($this->db[$key])) {
|
||||
$tmp = $this->db[$key];
|
||||
$tmp['key'] = $key;
|
||||
return $tmp;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,354 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
class Plugin
|
||||
{
|
||||
|
||||
// (string) directory name, just the name
|
||||
// Ex: sitemap
|
||||
public $directoryName;
|
||||
|
||||
// (string) Absolute database filename and path
|
||||
// Ex: /www/bludit/bl-content/plugins/sitemap/db.php
|
||||
public $filenameDb;
|
||||
|
||||
// (string) Absolute metadata filename and path
|
||||
// Ex: /www/bludit/bl-plugins/sitemap/metadata.json
|
||||
public $filenameMetadata;
|
||||
|
||||
// (array) Plugin metadata
|
||||
// Ex: array('author'=>'',...., 'notes'=>'')
|
||||
public $metadata;
|
||||
|
||||
// (string) Class name
|
||||
// Ex: pluginSitemap
|
||||
public $className;
|
||||
|
||||
// (array) Database unserialized
|
||||
public $db;
|
||||
|
||||
// (array) Database fields, only for initialize
|
||||
public $dbFields;
|
||||
|
||||
// (boolean) Enable or disable default Save and Cancel button on plugin settings
|
||||
public $formButtons;
|
||||
|
||||
// (array) List of custom hooks
|
||||
public $customHooks;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->dbFields = array();
|
||||
$this->customHooks = array();
|
||||
|
||||
$reflector = new ReflectionClass(get_class($this));
|
||||
|
||||
// Directory name
|
||||
$this->directoryName = basename(dirname($reflector->getFileName()));
|
||||
|
||||
// Class Name
|
||||
$this->className = $reflector->getName();
|
||||
|
||||
$this->formButtons = true;
|
||||
|
||||
// Call the method init() from the children
|
||||
$this->init();
|
||||
|
||||
// Init empty database with default values
|
||||
$this->db = $this->dbFields;
|
||||
|
||||
$this->filenameDb = PATH_PLUGINS_DATABASES . $this->directoryName . DS . 'db.php';
|
||||
|
||||
// --- Metadata ---
|
||||
$this->filenameMetadata = PATH_PLUGINS . $this->directoryName() . DS . 'metadata.json';
|
||||
$metadataString = file_get_contents($this->filenameMetadata);
|
||||
$this->metadata = json_decode($metadataString, true);
|
||||
|
||||
// If the plugin is installed then get the database
|
||||
if ($this->installed()) {
|
||||
$Tmp = new dbJSON($this->filenameDb);
|
||||
$this->db = $Tmp->db;
|
||||
$this->prepare();
|
||||
}
|
||||
}
|
||||
|
||||
public function save()
|
||||
{
|
||||
$tmp = new dbJSON($this->filenameDb);
|
||||
$tmp->db = $this->db;
|
||||
return $tmp->save();
|
||||
}
|
||||
|
||||
public function includeCSS($filename)
|
||||
{
|
||||
return '<link rel="stylesheet" type="text/css" href="' . $this->domainPath() . 'css/' . $filename . '?version=' . BLUDIT_VERSION . '">' . PHP_EOL;
|
||||
}
|
||||
|
||||
public function includeJS($filename)
|
||||
{
|
||||
return '<script charset="utf-8" src="' . $this->domainPath() . 'js/' . $filename . '?version=' . BLUDIT_VERSION . '"></script>' . PHP_EOL;
|
||||
}
|
||||
|
||||
// Returns absolute URL and path of the plugin directory
|
||||
// This function helps to include CSS or Javascript files with absolute URL
|
||||
public function domainPath()
|
||||
{
|
||||
return DOMAIN_PLUGINS . $this->directoryName . '/';
|
||||
}
|
||||
|
||||
// Returns relative path of the plugin directory
|
||||
// This function helps to include CSS or Javascript files with relative URL
|
||||
public function htmlPath()
|
||||
{
|
||||
return HTML_PATH_PLUGINS . $this->directoryName . '/';
|
||||
}
|
||||
|
||||
// Returns absolute path of the plugin directory
|
||||
// This function helps to include PHP libraries or some file at server level
|
||||
public function phpPath()
|
||||
{
|
||||
return PATH_PLUGINS . $this->directoryName . DS;
|
||||
}
|
||||
|
||||
public function phpPathDB()
|
||||
{
|
||||
return PATH_PLUGINS_DATABASES . $this->directoryName . DS;
|
||||
}
|
||||
|
||||
// Returns the value of the key from the metadata of the plugin, FALSE if the key doesn't exist
|
||||
public function getMetadata($key)
|
||||
{
|
||||
if (isset($this->metadata[$key])) {
|
||||
return $this->metadata[$key];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set a key / value on the metadata of the plugin
|
||||
public function setMetadata($key, $value)
|
||||
{
|
||||
$this->metadata[$key] = $value;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Returns the value of the field from the database
|
||||
// (string) $field
|
||||
// (boolean) $html, TRUE returns the value sanitized, FALSE unsanitized
|
||||
public function getValue($field, $html = true)
|
||||
{
|
||||
if (isset($this->db[$field])) {
|
||||
if ($html) {
|
||||
return $this->db[$field];
|
||||
} else {
|
||||
return Sanitize::htmlDecode($this->db[$field]);
|
||||
}
|
||||
}
|
||||
return $this->dbFields[$field];
|
||||
}
|
||||
|
||||
public function label()
|
||||
{
|
||||
return $this->getMetadata('label');
|
||||
}
|
||||
|
||||
public function name()
|
||||
{
|
||||
return $this->getMetadata('name');
|
||||
}
|
||||
|
||||
public function description()
|
||||
{
|
||||
return $this->getMetadata('description');
|
||||
}
|
||||
|
||||
public function author()
|
||||
{
|
||||
return $this->getMetadata('author');
|
||||
}
|
||||
|
||||
public function email()
|
||||
{
|
||||
return $this->getMetadata('email');
|
||||
}
|
||||
|
||||
public function website()
|
||||
{
|
||||
return $this->getMetadata('website');
|
||||
}
|
||||
|
||||
public function position()
|
||||
{
|
||||
return $this->getValue('position');
|
||||
}
|
||||
|
||||
public function version()
|
||||
{
|
||||
return $this->getMetadata('version');
|
||||
}
|
||||
|
||||
public function releaseDate()
|
||||
{
|
||||
return $this->getMetadata('releaseDate');
|
||||
}
|
||||
|
||||
public function className()
|
||||
{
|
||||
return $this->className;
|
||||
}
|
||||
|
||||
public function formButtons()
|
||||
{
|
||||
return $this->formButtons;
|
||||
}
|
||||
|
||||
public function isCompatible()
|
||||
{
|
||||
$bluditRoot = explode('.', BLUDIT_VERSION);
|
||||
$compatible = explode(',', $this->getMetadata('compatible'));
|
||||
foreach ($compatible as $version) {
|
||||
$root = explode('.', $version);
|
||||
if ($root[0] == $bluditRoot[0] && $root[1] == $bluditRoot[1]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function directoryName()
|
||||
{
|
||||
return $this->directoryName;
|
||||
}
|
||||
|
||||
// Return TRUE if the installation success, otherwise FALSE.
|
||||
public function install($position = 1)
|
||||
{
|
||||
if ($this->installed()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create workspace
|
||||
$workspace = $this->workspace();
|
||||
mkdir($workspace, DIR_PERMISSIONS, true);
|
||||
|
||||
// Create plugin directory for the database
|
||||
mkdir(PATH_PLUGINS_DATABASES . $this->directoryName, DIR_PERMISSIONS, true);
|
||||
|
||||
$this->dbFields['position'] = $position;
|
||||
// Sanitize default values to store in the file
|
||||
foreach ($this->dbFields as $key => $value) {
|
||||
$value = Sanitize::html($value);
|
||||
settype($value, gettype($this->dbFields[$key]));
|
||||
$this->db[$key] = $value;
|
||||
}
|
||||
|
||||
// Create the database
|
||||
return $this->save();
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
// Delete database
|
||||
$path = PATH_PLUGINS_DATABASES . $this->directoryName;
|
||||
Filesystem::deleteRecursive($path);
|
||||
|
||||
// Delete workspace
|
||||
$workspace = $this->workspace();
|
||||
Filesystem::deleteRecursive($workspace);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Returns TRUE if the plugin is installed
|
||||
// This function just check if the database of the plugin is created
|
||||
public function installed()
|
||||
{
|
||||
return file_exists($this->filenameDb);
|
||||
}
|
||||
|
||||
public function workspace()
|
||||
{
|
||||
return PATH_WORKSPACES . $this->directoryName . DS;
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
// This method is used on children classes
|
||||
// The user can define his own field of the database
|
||||
}
|
||||
|
||||
public function prepare()
|
||||
{
|
||||
// This method is used on children classes
|
||||
// The user can prepare the plugin, when it is installed
|
||||
}
|
||||
|
||||
public function post()
|
||||
{
|
||||
$args = $_POST;
|
||||
foreach ($this->dbFields as $field => $value) {
|
||||
if (isset($args[$field])) {
|
||||
$finalValue = Sanitize::html($args[$field]);
|
||||
if ($finalValue === 'false') {
|
||||
$finalValue = false;
|
||||
} elseif ($finalValue === 'true') {
|
||||
$finalValue = true;
|
||||
}
|
||||
settype($finalValue, gettype($value));
|
||||
$this->db[$field] = $finalValue;
|
||||
}
|
||||
}
|
||||
return $this->save();
|
||||
}
|
||||
|
||||
public function type()
|
||||
{
|
||||
return $this->getMetadata('type');
|
||||
}
|
||||
|
||||
public function setField($field, $value)
|
||||
{
|
||||
$this->db[$field] = Sanitize::html($value);
|
||||
return $this->save();
|
||||
}
|
||||
|
||||
public function setPosition($position)
|
||||
{
|
||||
return $this->setField('position', $position);
|
||||
}
|
||||
|
||||
// Returns the parameters after the URI, FALSE if the URI doesn't match with the webhook
|
||||
// Example: https://www.mybludit.com/api/foo/bar
|
||||
public function webhook($URI = false, $returnsAfterURI = false, $fixed = true)
|
||||
{
|
||||
global $url;
|
||||
|
||||
if (empty($URI)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check URI start with the webhook
|
||||
$startString = HTML_PATH_ROOT . $URI;
|
||||
$URI = $url->uri();
|
||||
$length = mb_strlen($startString, CHARSET);
|
||||
if (mb_substr($URI, 0, $length) != $startString) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$afterURI = mb_substr($URI, $length);
|
||||
if (!empty($afterURI)) {
|
||||
if ($fixed) {
|
||||
return false;
|
||||
}
|
||||
if ($afterURI[0] != '/') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($returnsAfterURI) {
|
||||
return $afterURI;
|
||||
}
|
||||
|
||||
Log::set(__METHOD__ . LOG_SEP . 'Webhook requested.');
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] = $L->g('About') . ' - ' . $layout['title'];
|
|
@ -1,40 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
activatePlugin('pluginAPI');
|
||||
$apiURL = DOMAIN_BASE.'api/';
|
||||
$pluginAPI = getPlugin('pluginAPI');
|
||||
$apiToken = $pluginAPI->getToken();
|
||||
$username = $login->username();
|
||||
$admin = new User($username);
|
||||
$authToken = $admin->tokenAuth();
|
||||
$output = array(
|
||||
'apiURL'=>$apiURL,
|
||||
'username'=>$username,
|
||||
'apiToken'=>$apiToken,
|
||||
'authToken'=>$authToken
|
||||
);
|
||||
exit(json_encode($output));
|
||||
|
||||
?>
|
|
@ -1,53 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
$plugin = false;
|
||||
$pluginClassName = $layout['parameters'];
|
||||
|
||||
// Check if the plugin exists
|
||||
if (isset($plugins['all'][$pluginClassName])) {
|
||||
$plugin = $plugins['all'][$pluginClassName];
|
||||
} else {
|
||||
Redirect::page('plugins');
|
||||
}
|
||||
|
||||
// Check if the plugin has the method form()
|
||||
if (!method_exists($plugin, 'form')) {
|
||||
Redirect::page('plugins');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
// Add to syslog
|
||||
$syslog->add(array(
|
||||
'dictionaryKey'=>'plugin-configured',
|
||||
'notes'=>$plugin->name()
|
||||
));
|
||||
|
||||
// Call the method post of the plugin
|
||||
$plugin->post();
|
||||
Alert::set( $L->g('The changes have been saved') );
|
||||
Redirect::page('configure-plugin/'.$plugin->className());
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] = $L->g('Plugin').' - '.$plugin->name().' - '.$layout['title'];
|
|
@ -1,60 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin', 'editor', 'author'));
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
// Returns the content belongs to the current user if the user has the role Editor
|
||||
function filterContentOwner($list) {
|
||||
global $login;
|
||||
global $pages;
|
||||
$tmp = array();
|
||||
foreach ($list as $pageKey) {
|
||||
if ($pages->db[$pageKey]['username']==$login->username()) {
|
||||
array_push($tmp, $pageKey);
|
||||
}
|
||||
}
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
$published = $pages->getList($url->pageNumber(), ITEMS_PER_PAGE_ADMIN);
|
||||
$drafts = $pages->getDraftDB(true);
|
||||
$scheduled = $pages->getScheduledDB(true);
|
||||
$static = $pages->getStaticDB(true);
|
||||
$sticky = $pages->getStickyDB(true);
|
||||
$autosave = $pages->getAutosaveDB(true);
|
||||
|
||||
// If the user is an Author filter the content he/she can edit
|
||||
if (checkRole(array('author'), false)) {
|
||||
$published = filterContentOwner($published);
|
||||
$drafts = filterContentOwner($drafts);
|
||||
$scheduled = filterContentOwner($scheduled);
|
||||
$static = filterContentOwner($static);
|
||||
$sticky = filterContentOwner($sticky);
|
||||
}
|
||||
|
||||
// Check if out of range the pageNumber
|
||||
if (empty($published) && $url->pageNumber()>1) {
|
||||
Redirect::page('content');
|
||||
}
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('Manage content');
|
|
@ -1,66 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
function updateBludit() {
|
||||
global $site;
|
||||
global $syslog;
|
||||
|
||||
// New installation
|
||||
if ($site->currentBuild()==0) {
|
||||
$site->set(array('currentBuild'=>BLUDIT_BUILD));
|
||||
}
|
||||
|
||||
// Check if Bludit need to be update
|
||||
if ( ($site->currentBuild() < BLUDIT_BUILD) || isset($_GET['update']) ) {
|
||||
Log::set('UPDATE SYSTEM - Starting.');
|
||||
|
||||
// Updates only for version less than Bludit v3.0 rc-3
|
||||
if ($site->currentBuild()<='20180910') {
|
||||
@mkdir(PATH_WORKSPACES, DIR_PERMISSIONS, true);
|
||||
$plugins = array('simple-stats', 'pluginRSS', 'pluginSitemap', 'pluginTimeMachineX', 'pluginBackup');
|
||||
foreach ($plugins as $plugin) {
|
||||
if (pluginActivated($plugin)) {
|
||||
Log::set('UPDATE SYSTEM - Re-enable plugin: '.$plugin);
|
||||
deactivatePlugin($plugin);
|
||||
activatePlugin($plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Updates only for version less than Bludit v3.1
|
||||
if ($site->currentBuild()<='20180921') {
|
||||
@mkdir(PATH_UPLOADS_PAGES, DIR_PERMISSIONS, true);
|
||||
$site->set(array('imageRelativeToAbsolute'=>true, 'imageRestrict'=>false));
|
||||
}
|
||||
|
||||
// Set the current build number
|
||||
$site->set(array('currentBuild'=>BLUDIT_BUILD));
|
||||
Log::set('UPDATE SYSTEM - Finished.');
|
||||
|
||||
// Add to syslog
|
||||
$syslog->add(array(
|
||||
'dictionaryKey'=>'system-updated',
|
||||
'notes'=>'Bludit v'.BLUDIT_VERSION
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// Try update Bludit
|
||||
updateBludit();
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('Dashboard');
|
|
@ -1,86 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
if (checkRole(array('author'), false)) {
|
||||
try {
|
||||
$pageKey = isset($_POST['key']) ? $_POST['key'] : $layout['parameters'];
|
||||
$page = new Page($pageKey);
|
||||
} catch (Exception $e) {
|
||||
Alert::set($L->g('You do not have sufficient permissions'));
|
||||
Redirect::page('dashboard');
|
||||
}
|
||||
|
||||
if ($page->username()!==$login->username()) {
|
||||
// Add to syslog
|
||||
$syslog->add(array(
|
||||
'dictionaryKey'=>'access-denied',
|
||||
'notes'=>$login->username()
|
||||
));
|
||||
|
||||
Alert::set($L->g('You do not have sufficient permissions'));
|
||||
Redirect::page('dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
if ($_POST['type']==='delete') {
|
||||
if (deletePage($_POST['key'])) {
|
||||
Alert::set( $L->g('The changes have been saved') );
|
||||
}
|
||||
} else {
|
||||
$key = editPage($_POST);
|
||||
if ($key!==false) {
|
||||
Alert::set( $L->g('The changes have been saved') );
|
||||
Redirect::page('edit-content/'.$key);
|
||||
}
|
||||
}
|
||||
|
||||
Redirect::page('content');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
try {
|
||||
$pageKey = $layout['parameters'];
|
||||
$page = new Page($pageKey);
|
||||
} catch (Exception $e) {
|
||||
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to get the page: '.$pageKey, LOG_TYPE_ERROR);
|
||||
Redirect::page('content');
|
||||
}
|
||||
|
||||
// Images prefix directory
|
||||
define('PAGE_IMAGES_KEY', $page->uuid());
|
||||
|
||||
// Images and thubmnails directories
|
||||
if (IMAGE_RESTRICT) {
|
||||
define('PAGE_IMAGES_DIRECTORY', (IMAGE_RELATIVE_TO_ABSOLUTE? '' : HTML_PATH_UPLOADS_PAGES.PAGE_IMAGES_KEY.'/'));
|
||||
define('PAGE_IMAGES_URL', (IMAGE_RELATIVE_TO_ABSOLUTE? '' : DOMAIN_UPLOADS_PAGES.PAGE_IMAGES_KEY.'/'));
|
||||
define('PAGE_THUMBNAILS_DIRECTORY', PATH_UPLOADS_PAGES.PAGE_IMAGES_KEY.DS.'thumbnails'.DS);
|
||||
define('PAGE_THUMBNAILS_HTML', HTML_PATH_UPLOADS_PAGES.PAGE_IMAGES_KEY.'/thumbnails/');
|
||||
define('PAGE_THUMBNAILS_URL', DOMAIN_UPLOADS_PAGES.PAGE_IMAGES_KEY.'/thumbnails/');
|
||||
} else {
|
||||
define('PAGE_IMAGES_DIRECTORY', (IMAGE_RELATIVE_TO_ABSOLUTE? '' : HTML_PATH_UPLOADS));
|
||||
define('PAGE_IMAGES_URL', (IMAGE_RELATIVE_TO_ABSOLUTE? '' : DOMAIN_UPLOADS));
|
||||
define('PAGE_THUMBNAILS_DIRECTORY', PATH_UPLOADS_THUMBNAILS);
|
||||
define('PAGE_THUMBNAILS_HTML', HTML_PATH_UPLOADS_THUMBNAILS);
|
||||
define('PAGE_THUMBNAILS_URL', DOMAIN_UPLOADS_THUMBNAILS);
|
||||
}
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('Edit content').' - '.$page->title();
|
|
@ -1,60 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
// Prevent non-administrators to change other users
|
||||
if ($login->role()!=='admin') {
|
||||
$_POST['username'] = $login->username();
|
||||
unset($_POST['role']);
|
||||
}
|
||||
|
||||
if (isset($_POST['deleteUserAndDeleteContent']) && ($login->role()==='admin')) {
|
||||
$_POST['deleteContent'] = true;
|
||||
deleteUser($_POST);
|
||||
} elseif (isset($_POST['deleteUserAndKeepContent']) && ($login->role()==='admin')) {
|
||||
$_POST['deleteContent'] = false;
|
||||
deleteUser($_POST);
|
||||
} elseif (isset($_POST['disableUser']) && ($login->role()==='admin')) {
|
||||
disableUser(array('username'=>$_POST['username']));
|
||||
} else {
|
||||
editUser($_POST);
|
||||
}
|
||||
|
||||
Alert::set($L->g('The changes have been saved'));
|
||||
|
||||
if ($login->role()==='admin') {
|
||||
Redirect::page('users');
|
||||
}
|
||||
Redirect::page('edit-user/'.$login->username());
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
$username = $layout['parameters'];
|
||||
|
||||
// Prevent non-administrators to change other users
|
||||
if ($login->role()!=='admin') {
|
||||
$username = $login->username();
|
||||
}
|
||||
|
||||
try {
|
||||
$user = new User($username);
|
||||
} catch (Exception $e) {
|
||||
Redirect::page('users');
|
||||
}
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] = $L->g('Edit user').' - '.$layout['title'];
|
|
@ -1,30 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
$themeDirectory = $layout['parameters'];
|
||||
|
||||
// Activate theme
|
||||
activateTheme($themeDirectory);
|
||||
|
||||
// Redirect
|
||||
Redirect::page('themes');
|
|
@ -1,80 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
function checkLogin($args)
|
||||
{
|
||||
global $security;
|
||||
global $login;
|
||||
global $L;
|
||||
|
||||
if ($security->isBlocked()) {
|
||||
Alert::set($L->g('IP address has been blocked').'<br>'.$L->g('Try again in a few minutes'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($login->verifyUser($_POST['username'], $_POST['password'])) {
|
||||
if (isset($_POST['remember'])) {
|
||||
$login->setRememberMe($_POST['username']);
|
||||
}
|
||||
// Renew the token. This token will be the same inside the session for multiple forms.
|
||||
$security->generateTokenCSRF();
|
||||
|
||||
if (isset($_GET['enableAPI'])) {
|
||||
Redirect::page('api');
|
||||
}
|
||||
Redirect::page('dashboard');
|
||||
return true;
|
||||
}
|
||||
|
||||
// Bruteforce protection, add IP to the blacklist
|
||||
$security->addToBlacklist();
|
||||
|
||||
// Create alert
|
||||
Alert::set($L->g('Username or password incorrect'), ALERT_STATUS_FAIL);
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkRememberMe()
|
||||
{
|
||||
global $security;
|
||||
global $login;
|
||||
|
||||
if ($security->isBlocked()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($login->verifyUserByRemember()) {
|
||||
$security->generateTokenCSRF();
|
||||
Redirect::page('dashboard');
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD']!=='POST') {
|
||||
checkRememberMe();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD']=='POST') {
|
||||
checkLogin($_POST);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
|
@ -1,52 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin', 'editor', 'author'));
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
createPage($_POST);
|
||||
Redirect::page('content');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// UUID of the page is need it for autosave and media manager
|
||||
$uuid = $pages->generateUUID();
|
||||
|
||||
// Images prefix directory
|
||||
define('PAGE_IMAGES_KEY', $uuid);
|
||||
|
||||
// Images and thubmnails directories
|
||||
if (IMAGE_RESTRICT) {
|
||||
define('PAGE_IMAGES_DIRECTORY', (IMAGE_RELATIVE_TO_ABSOLUTE? '' : HTML_PATH_UPLOADS_PAGES.PAGE_IMAGES_KEY.'/'));
|
||||
define('PAGE_IMAGES_URL', (IMAGE_RELATIVE_TO_ABSOLUTE? '' : DOMAIN_UPLOADS_PAGES.PAGE_IMAGES_KEY.'/'));
|
||||
define('PAGE_THUMBNAILS_DIRECTORY', PATH_UPLOADS_PAGES.PAGE_IMAGES_KEY.DS.'thumbnails'.DS);
|
||||
define('PAGE_THUMBNAILS_HTML', HTML_PATH_UPLOADS_PAGES.PAGE_IMAGES_KEY.'/thumbnails/');
|
||||
define('PAGE_THUMBNAILS_URL', DOMAIN_UPLOADS_PAGES.PAGE_IMAGES_KEY.'/thumbnails/');
|
||||
} else {
|
||||
define('PAGE_IMAGES_DIRECTORY', (IMAGE_RELATIVE_TO_ABSOLUTE? '' : HTML_PATH_UPLOADS));
|
||||
define('PAGE_IMAGES_URL', (IMAGE_RELATIVE_TO_ABSOLUTE? '' : DOMAIN_UPLOADS));
|
||||
define('PAGE_THUMBNAILS_DIRECTORY', PATH_UPLOADS_THUMBNAILS);
|
||||
define('PAGE_THUMBNAILS_HTML', HTML_PATH_UPLOADS_THUMBNAILS);
|
||||
define('PAGE_THUMBNAILS_URL', DOMAIN_UPLOADS_THUMBNAILS);
|
||||
}
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] = $L->g('New content').' - '.$layout['title'];
|
|
@ -1,29 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
changePluginsPosition(explode(',',$_POST['plugin-list']));
|
||||
Redirect::page('plugins-position');
|
||||
}
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('Plugins');
|
|
@ -1,31 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
editSettings($_POST);
|
||||
Redirect::page('settings');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('Advanced Settings');
|
|
@ -1,24 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
$themes = buildThemes();
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('Themes');
|
|
@ -1,51 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
// Prevent non-administrators to change other users
|
||||
$username = $_POST['username'];
|
||||
if ($login->role()!=='admin') {
|
||||
$username = $login->username();
|
||||
}
|
||||
|
||||
if (changeUserPassword(array(
|
||||
'username'=>$username,
|
||||
'newPassword'=>$_POST['newPassword'],
|
||||
'confirmPassword'=>$_POST['confirmPassword']
|
||||
))) {
|
||||
if ($login->role()==='admin') {
|
||||
Redirect::page('users');
|
||||
}
|
||||
Redirect::page('edit-user/'.$login->username());
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// Prevent non-administrators to change other users
|
||||
if ($login->role()!=='admin') {
|
||||
$layout['parameters'] = $login->username();
|
||||
}
|
||||
|
||||
try {
|
||||
$username = $layout['parameters'];
|
||||
$user = new User($username);
|
||||
} catch (Exception $e) {
|
||||
Redirect::page('users');
|
||||
}
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] = $L->g('Change password').' - '.$layout['title'];
|
|
@ -1,58 +0,0 @@
|
|||
a {
|
||||
color: #0078D4;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #003f6f;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.bg-success {
|
||||
background-color: #8BC34A!important;
|
||||
}
|
||||
|
||||
.text-primary {
|
||||
color: #0078D4!important;
|
||||
}
|
||||
|
||||
.text-danger {
|
||||
color: #D40000!important;
|
||||
}
|
||||
a.text-danger:focus,
|
||||
a.text-danger:hover {
|
||||
color: #790000!important;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.btn-primary {
|
||||
background-color: #0078D4;
|
||||
border-color: #0078D4;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background-color: #4585CF;
|
||||
border-color: #4a90e2;
|
||||
}
|
||||
|
||||
.btn-light.focus, .btn-light:focus {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.btn.focus, .btn:focus {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* Form */
|
||||
.form-control:focus {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* Tables */
|
||||
.table-striped tbody tr:nth-of-type(odd) {
|
||||
background-color: rgba(0, 0, 0, 0.02);
|
||||
}
|
||||
|
||||
.table thead th {
|
||||
font-size: 0.8em;
|
||||
text-transform: uppercase!important;
|
||||
}
|
|
@ -1,367 +0,0 @@
|
|||
html {
|
||||
height: 100%;
|
||||
font-size: 0.9rem;
|
||||
background: #fcfcfc;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #fcfcfc;
|
||||
}
|
||||
|
||||
/* Prevent events in iframes */
|
||||
/* iframe{
|
||||
pointer-events: none;
|
||||
} */
|
||||
|
||||
/*
|
||||
ICONS
|
||||
*/
|
||||
.fa {
|
||||
margin-right: .5rem !important;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
/*
|
||||
SIDEBAR
|
||||
*/
|
||||
|
||||
div.sidebar .nav-item a {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
color: #555;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
div.sidebar .nav-item a:hover {
|
||||
color: #0078D4;
|
||||
}
|
||||
|
||||
div.sidebar .nav-item h4 {
|
||||
font-size: 1.2em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 400;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/*
|
||||
AUTOCOMPLETE SEARCH
|
||||
*/
|
||||
.search-suggestion {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.search-suggestion-options {
|
||||
font-size: 0.9em;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
/*
|
||||
BOOTSTRAP Hacks
|
||||
*/
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.container {
|
||||
max-width: 1250px;
|
||||
}
|
||||
}
|
||||
|
||||
/* for small devices */
|
||||
@media (max-width: 575.98px) {
|
||||
|
||||
#jsmediaManagerButton,
|
||||
#jscategoryButton,
|
||||
#jsdescriptionButton {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.btn-light {
|
||||
color: #212529;
|
||||
background-color: #f3f3f3;
|
||||
border-color: #ced4d9;
|
||||
}
|
||||
|
||||
.btn-form {
|
||||
background-color: #F3F3F3;
|
||||
border-color: #DDD;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-form:hover {
|
||||
background-color: rgb(228, 228, 228);
|
||||
border-color: #DDD;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
|
||||
|
||||
code {
|
||||
padding: 3px 5px 2px;
|
||||
margin: 0 1px;
|
||||
background: #eaeaea;
|
||||
background: rgba(0, 0, 0, .07);
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.list-group-sortable {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
background-color: rgb(247, 247, 247);
|
||||
}
|
||||
|
||||
.modal-dialog .btn-link {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/*
|
||||
LOGIN
|
||||
*/
|
||||
|
||||
body.login {
|
||||
background: rgb(255, 255, 255);
|
||||
background: linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(250, 250, 250, 1) 53%);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
DASHBOARD
|
||||
*/
|
||||
|
||||
#dashboard ul.list-group.list-group-striped li {
|
||||
border: none;
|
||||
word-break: break-word;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#dashboard ul.list-group.list-group-striped li:nth-of-type(even) {
|
||||
background: #f1f1f1;
|
||||
|
||||
}
|
||||
|
||||
#dashboard div.quick-links-icons {
|
||||
font-size: 3em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#dashboard a.quick-links {
|
||||
color: #777;
|
||||
}
|
||||
|
||||
#dashboard a.quick-links:hover {
|
||||
text-decoration: none;
|
||||
color: #4586d4;
|
||||
}
|
||||
|
||||
#hello-message {
|
||||
padding: 10px 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#hello-message span.oi {
|
||||
top: 3px;
|
||||
}
|
||||
|
||||
.ct-series-a .ct-line {
|
||||
/* Set the colour of this series line */
|
||||
stroke: #4a90e2;
|
||||
/* Control the thikness of your lines */
|
||||
stroke-width: 2px;
|
||||
/* Create a dashed line with a pattern */
|
||||
}
|
||||
|
||||
.ct-series-a .ct-point {
|
||||
/* Colour of your points */
|
||||
stroke: #4a90e2;
|
||||
/* Size of your points */
|
||||
stroke-width: 8px;
|
||||
}
|
||||
|
||||
/*
|
||||
ALERT
|
||||
*/
|
||||
|
||||
#alert {
|
||||
display: none;
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
border-radius: 0px;
|
||||
border: 0;
|
||||
z-index: 1000;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.alert-success {
|
||||
background-color: #4586d4;
|
||||
border-left: 6px solid #abd1ff !important;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.alert-danger {
|
||||
background-color: #d44545;
|
||||
border-left: 6px solid #ff9c9c !important;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
PLUGINS
|
||||
*/
|
||||
|
||||
.plugin-form label {
|
||||
display: block;
|
||||
margin-top: 1rem !important;
|
||||
}
|
||||
|
||||
.plugin-form input[type="text"],
|
||||
.plugin-form textarea,
|
||||
.plugin-form select {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: .375rem .75rem;
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
color: #495057;
|
||||
background-color: #fff;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid #ced4da;
|
||||
border-radius: .25rem;
|
||||
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
||||
}
|
||||
|
||||
.plugin-form textarea {
|
||||
min-height: 120px;
|
||||
}
|
||||
|
||||
.plugin-form span.tip {
|
||||
display: block;
|
||||
font-size: 80%;
|
||||
font-weight: 400;
|
||||
margin-top: .25rem;
|
||||
color: #6c757d !important;
|
||||
}
|
||||
|
||||
/*
|
||||
Manage > Content
|
||||
*/
|
||||
|
||||
td.child {
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
/*
|
||||
Manage > New Content
|
||||
*/
|
||||
|
||||
#jseditor {
|
||||
background: #fff;
|
||||
padding: 10px 5% !important;
|
||||
font-size: 16px;
|
||||
line-height: 1.5em;
|
||||
border: 1px solid #ced4da;
|
||||
}
|
||||
|
||||
#jseditorSidebar {
|
||||
display: none;
|
||||
height: calc(100% - 45px);
|
||||
width: 50%;
|
||||
max-width: 350px;
|
||||
position: absolute;
|
||||
z-index: 50;
|
||||
top: 45px;
|
||||
right: 15px;
|
||||
background-color: #fff;
|
||||
overflow-x: hidden;
|
||||
transition: 0.5s;
|
||||
border-left: 1px solid #ccc;
|
||||
border-right: 1px solid #ccc;
|
||||
border-top: 1px solid #ccc;
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
#jseditorSidebar {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
#jseditorToolbarRight button {
|
||||
font-size: 0px !important;
|
||||
}
|
||||
|
||||
#jseditorToolbarRight button span {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
|
||||
.contentTools .btn {
|
||||
font-size: 0px !important;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.contentTools .btn span {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
}
|
||||
|
||||
#jseditorSidebar nav {
|
||||
background: #f3f3f3;
|
||||
}
|
||||
|
||||
#jseditorSidebar nav a {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#jseditorSidebar .nav-tabs .nav-link {
|
||||
border: none;
|
||||
}
|
||||
|
||||
#jseditorSidebar .nav-link.active {
|
||||
background: none;
|
||||
border: none;
|
||||
border-bottom: 3px solid #ccc;
|
||||
}
|
||||
|
||||
#jsshadow {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: rgba(72, 72, 72, 0.7);
|
||||
z-index: 10;
|
||||
display: none;
|
||||
}
|
||||
|
||||
img.profilePicture {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 30px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
/* Switch button */
|
||||
.switch-button {
|
||||
font-size: 0.9em;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.switch-icon-publish {
|
||||
color: #1cb11c;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<script charset="utf-8">
|
||||
function showAlert(text) {
|
||||
console.log("[INFO] Function showAlert() called.");
|
||||
$("#alert").html(text);
|
||||
$("#alert").slideDown().delay(<?php echo ALERT_DISAPPEAR_IN*1000 ?>).slideUp();
|
||||
}
|
||||
|
||||
<?php if (Alert::defined()): ?>
|
||||
setTimeout(function(){ showAlert("<?php echo Alert::get() ?>") }, 500);
|
||||
<?php endif; ?>
|
||||
|
||||
$(window).click(function() {
|
||||
$("#alert").hide();
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="alert" class="alert <?php echo (Alert::status()==ALERT_STATUS_FAIL)?'alert-danger':'alert-success' ?>"></div>
|
|
@ -1,262 +0,0 @@
|
|||
<?php
|
||||
// Preload the first 10 files to not call via AJAX when the user open the first time the media manager
|
||||
$listOfFilesByPage = Filesystem::listFiles(PAGE_THUMBNAILS_DIRECTORY, '*', '*', MEDIA_MANAGER_SORT_BY_DATE, MEDIA_MANAGER_NUMBER_OF_FILES);
|
||||
$preLoadFiles = array();
|
||||
if (!empty($listOfFilesByPage[0])) {
|
||||
foreach ($listOfFilesByPage[0] as $file) {
|
||||
$filename = Filesystem::filename($file);
|
||||
array_push($preLoadFiles, $filename);
|
||||
}
|
||||
}
|
||||
|
||||
// Amount of pages for the paginator
|
||||
$numberOfPages = count($listOfFilesByPage);
|
||||
?>
|
||||
|
||||
<div id="jsmediaManagerModal" class="modal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col p-3">
|
||||
|
||||
<!--
|
||||
UPLOAD INPUT
|
||||
-->
|
||||
<h3 class="mt-2 mb-3"><i class="fa fa-image"></i> <?php $L->p('Images'); ?></h3>
|
||||
|
||||
<div id="jsalertMedia" class="alert alert-warning d-none" role="alert"></div>
|
||||
|
||||
<!-- Form and Input file -->
|
||||
<form name="bluditFormUpload" id="jsbluditFormUpload" enctype="multipart/form-data">
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" id="jsimages" name="images[]" multiple>
|
||||
<label class="custom-file-label" for="jsimages"><?php $L->p('Choose images to upload'); ?></label>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Progress bar -->
|
||||
<div class="progress mt-3">
|
||||
<div id="jsbluditProgressBar" class="progress-bar bg-primary" role="progressbar" style="width:0%"></div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
IMAGES LIST
|
||||
-->
|
||||
<!-- Table for list files -->
|
||||
<table id="jsbluditMediaTable" class="table mt-3">
|
||||
<tr>
|
||||
<td><?php $L->p('There are no images'); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- Paginator -->
|
||||
<nav id="jsbluditMediaTablePagination"></nav>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
<?php
|
||||
echo 'var preLoadFiles = '.json_encode($preLoadFiles).';';
|
||||
?>
|
||||
|
||||
function openMediaManager() {
|
||||
$('#jsmediaManagerModal').modal('show');
|
||||
}
|
||||
|
||||
function closeMediaManager() {
|
||||
$('#jsmediaManagerModal').modal('hide');
|
||||
}
|
||||
|
||||
// Remove all files from the table
|
||||
function cleanTable() {
|
||||
$('#jsbluditMediaTable').empty();
|
||||
}
|
||||
|
||||
function showMediaAlert(message) {
|
||||
$("#jsalertMedia").html(message).removeClass('d-none');
|
||||
}
|
||||
|
||||
function hideMediaAlert() {
|
||||
$("#jsalertMedia").addClass('d-none');
|
||||
}
|
||||
|
||||
// Show the files in the table
|
||||
function displayFiles(files, numberOfPages = <?= $numberOfPages ?>) {
|
||||
if (!Array.isArray(files)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clean table
|
||||
cleanTable();
|
||||
|
||||
// Regenerate the table
|
||||
if (files.length > 0) {
|
||||
$.each(files, function(key, filename) {
|
||||
var thumbnail = "<?php echo PAGE_THUMBNAILS_URL; ?>"+filename;
|
||||
var image = "<?php echo PAGE_IMAGES_URL; ?>"+filename;
|
||||
|
||||
tableRow = '<tr id="js'+filename+'">'+
|
||||
'<td style="width:80px"><img class="img-thumbnail" alt="200x200" src="'+thumbnail+'" style="width: 50px; height: 50px;"><\/td>'+
|
||||
'<td class="information">'+
|
||||
'<div class="text-secondary pb-2">'+filename+'<\/div>'+
|
||||
'<div>'+
|
||||
'<a href="#" class="mr-3 text-primary" onClick="editorInsertMedia(\''+image+'\'); closeMediaManager();"><i class="fa fa-plus-circle"></i><?php $L->p('Insert') ?><\/a>'+
|
||||
'<a href="#" class="mr-3 text-primary" onClick="editorInsertMedia(\''+thumbnail+'\'); closeMediaManager();"><i class="fa fa-image"></i><?php $L->p('Insert thumbnail') ?><\/a>'+
|
||||
'<a href="#" class="mr-3 text-primary" onClick="editorInsertLinkedMedia(\''+thumbnail+'\',\''+image+'\'); closeMediaManager();"><i class="fa fa-link"></i><?php $L->p('Insert linked thumbnail') ?><\/a>'+
|
||||
'<a href="#" class="text-primary" onClick="setCoverImage(\''+filename+'\'); closeMediaManager();"><i class="fa fa-desktop"></i><?php $L->p('Set as cover image') ?><\/button>'+
|
||||
'<a href="#" class="float-right text-danger" onClick="deleteMedia(\''+filename+'\')"><i class="fa fa-trash-o"></i><?php $L->p('Delete') ?><\/a>'+
|
||||
'<\/div>'+
|
||||
'<\/td>'+
|
||||
'<\/tr>';
|
||||
$('#jsbluditMediaTable').append(tableRow);
|
||||
});
|
||||
|
||||
mediaPagination = '<ul class="pagination justify-content-center flex-wrap">';
|
||||
for (var i = 1; i <= numberOfPages; i++) {
|
||||
mediaPagination += '<li class="page-item"><button type="button" class="btn btn-link page-link" onClick="getFiles('+i+')">'+i+'</button></li>';
|
||||
}
|
||||
mediaPagination += '</ul>';
|
||||
$('#jsbluditMediaTablePagination').html(mediaPagination);
|
||||
|
||||
}
|
||||
|
||||
if (files.length == 0) {
|
||||
$('#jsbluditMediaTable').html("<p><?php (IMAGE_RESTRICT ? $L->p('There are no images for the page') : $L->p('There are no images')) ?></p>");
|
||||
$('#jsbluditMediaTablePagination').html('');
|
||||
}
|
||||
}
|
||||
|
||||
// Get the list of files via AJAX, filter by the page number
|
||||
function getFiles(pageNumber) {
|
||||
$.post(HTML_PATH_ADMIN_ROOT+"ajax/list-images",
|
||||
{ tokenCSRF: tokenCSRF,
|
||||
pageNumber: pageNumber,
|
||||
uuid: "<?php echo PAGE_IMAGES_KEY ?>",
|
||||
path: "thumbnails" // the paths are defined in ajax/list-images
|
||||
},
|
||||
function(data) { // success function
|
||||
if (data.status==0) {
|
||||
displayFiles(data.files, data.numberOfPages);
|
||||
} else {
|
||||
console.log(data.message);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// Delete the file and the thumbnail if exist
|
||||
function deleteMedia(filename) {
|
||||
$.post(HTML_PATH_ADMIN_ROOT+"ajax/delete-image",
|
||||
{ tokenCSRF: tokenCSRF,
|
||||
filename: filename,
|
||||
uuid: "<?php echo PAGE_IMAGES_KEY; ?>"
|
||||
},
|
||||
function(data) { // success function
|
||||
if (data.status==0) {
|
||||
getFiles(1);
|
||||
} else {
|
||||
console.log(data.message);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function setCoverImage(filename) {
|
||||
var image = "<?php echo PAGE_IMAGES_URL; ?>"+filename;
|
||||
$("#jscoverImage").val(filename);
|
||||
$("#jscoverImagePreview").attr("src", image);
|
||||
}
|
||||
|
||||
function uploadImages() {
|
||||
// Remove current alerts
|
||||
hideMediaAlert();
|
||||
|
||||
var images = $("#jsimages")[0].files;
|
||||
for (var i=0; i < images.length; i++) {
|
||||
// Check file type/extension
|
||||
const validImageTypes = ['image/gif', 'image/jpeg', 'image/png', 'image/svg+xml', 'image/webp'];
|
||||
if (!validImageTypes.includes(images[i].type)) {
|
||||
showMediaAlert("<?php echo $L->g('File type is not supported. Allowed types:').' '.implode(', ',$GLOBALS['ALLOWED_IMG_EXTENSION']) ?>");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check file size and compare with PHP upload_max_filesize
|
||||
if (images[i].size > UPLOAD_MAX_FILESIZE) {
|
||||
showMediaAlert("<?php echo $L->g('Maximum load file size allowed:').' '.ini_get('upload_max_filesize') ?>");
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// Clean progress bar
|
||||
$("#jsbluditProgressBar").removeClass().addClass("progress-bar bg-primary");
|
||||
$("#jsbluditProgressBar").width("0");
|
||||
|
||||
// Data to send via AJAX
|
||||
var formData = new FormData($("#jsbluditFormUpload")[0]);
|
||||
formData.append("uuid", "<?php echo PAGE_IMAGES_KEY ?>");
|
||||
formData.append("tokenCSRF", tokenCSRF);
|
||||
|
||||
$.ajax({
|
||||
url: HTML_PATH_ADMIN_ROOT+"ajax/upload-images",
|
||||
type: "POST",
|
||||
data: formData,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
xhr: function() {
|
||||
var xhr = $.ajaxSettings.xhr();
|
||||
if (xhr.upload) {
|
||||
xhr.upload.addEventListener("progress", function(e) {
|
||||
if (e.lengthComputable) {
|
||||
var percentComplete = (e.loaded / e.total)*100;
|
||||
$("#jsbluditProgressBar").width(percentComplete+"%");
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
return xhr;
|
||||
}
|
||||
}).done(function(data) {
|
||||
if (data.status==0) {
|
||||
$("#jsbluditProgressBar").removeClass("bg-primary").addClass("bg-success");
|
||||
// Get the files for the first page, this include the files uploaded
|
||||
getFiles(1);
|
||||
} else {
|
||||
$("#jsbluditProgressBar").removeClass("bg-primary").addClass("bg-danger");
|
||||
showMediaAlert(data.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
// Display the files preloaded for the first time
|
||||
displayFiles(preLoadFiles);
|
||||
|
||||
// Select image event
|
||||
$("#jsimages").on("change", function(e) {
|
||||
uploadImages();
|
||||
});
|
||||
|
||||
// Drag and drop image
|
||||
$(window).on("dragover dragenter", function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
openMediaManager();
|
||||
});
|
||||
|
||||
// Drag and drop image
|
||||
$(window).on("drop", function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
$("#jsimages").prop("files", e.originalEvent.dataTransfer.files);
|
||||
uploadImages();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
|
@ -1,77 +0,0 @@
|
|||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark text-uppercase d-block d-lg-none">
|
||||
<div class="container">
|
||||
<span class="navbar-brand">
|
||||
<?php echo (defined('BLUDIT_PRO'))?'BLUDIT PRO':'BLUDIT' ?></span>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false"
|
||||
aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>">
|
||||
<?php $L->p('Dashboard') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ROOT ?>">
|
||||
<?php $L->p('Website') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'new-content' ?>">
|
||||
<?php $L->p('New content') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'content' ?>">
|
||||
<?php $L->p('Content') ?></a>
|
||||
</li>
|
||||
<?php if (!checkRole(array('admin'),false)): ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$login->username() ?>">
|
||||
<?php $L->p('Profile') ?></a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (checkRole(array('admin'),false)): ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'categories' ?>">
|
||||
<?php $L->p('Categories') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>">
|
||||
<?php $L->p('Users') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'settings' ?>">
|
||||
<?php $L->p('Settings') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>">
|
||||
<?php $L->p('Plugins') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'themes' ?>">
|
||||
<?php $L->p('Themes') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'about' ?>">
|
||||
<?php $L->p('About') ?></a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (checkRole(array('admin'),false)): ?>
|
||||
<?php
|
||||
if (!empty($plugins['adminSidebar'])) {
|
||||
foreach ($plugins['adminSidebar'] as $pluginSidebar) {
|
||||
echo '<li class="nav-item">';
|
||||
echo $pluginSidebar->adminSidebar();
|
||||
echo '</li>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'logout' ?>">
|
||||
<?php $L->p('Logout') ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
|
@ -1,80 +0,0 @@
|
|||
<!-- Use .flex-column to set a vertical direction -->
|
||||
<ul class="nav flex-column pt-4">
|
||||
|
||||
<li class="nav-item mb-4" style="margin-left: -4px;">
|
||||
<img src="<?php echo HTML_PATH_CORE_IMG ?>logo.svg" width="20" height="20" alt="bludit-logo"><span class="ml-2 align-middle"><?php echo (defined('BLUDIT_PRO'))?'BLUDIT PRO':'BLUDIT' ?></span>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><span class="fa fa-dashboard"></span><?php $L->p('Dashboard') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" target="_blank" href="<?php echo HTML_PATH_ROOT ?>"><span class="fa fa-home"></span><?php $L->p('Website') ?></a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item mt-3">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'new-content' ?>"><span style="color: #0078D4;" class="fa fa-plus-circle"></span><?php $L->p('New content') ?></a>
|
||||
</li>
|
||||
|
||||
<?php if (!checkRole(array('admin'),false)): ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'content' ?>"><span class="fa fa-archive"></span><?php $L->p('Content') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$login->username() ?>"><span class="fa fa-user"></span><?php $L->p('Profile') ?></a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (checkRole(array('admin'),false)): ?>
|
||||
|
||||
<li class="nav-item mt-3">
|
||||
<h4><?php $L->p('Manage') ?></h4>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'content' ?>"><span class="fa fa-folder"></span><?php $L->p('Content') ?></a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'categories' ?>"><span class="fa fa-bookmark"></span><?php $L->p('Categories') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>"><span class="fa fa-users"></span><?php $L->p('Users') ?></a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item mt-3">
|
||||
<h4><?php $L->p('Settings') ?></h4>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'settings' ?>"><span class="fa fa-gear"></span><?php $L->p('General') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>"><span class="fa fa-puzzle-piece"></span><?php $L->p('Plugins') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'themes' ?>"><span class="fa fa-desktop"></span><?php $L->p('Themes') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'about' ?>"><span class="fa fa-info"></span><?php $L->p('About') ?></a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (checkRole(array('admin', 'editor'),false)): ?>
|
||||
|
||||
<?php
|
||||
if (!empty($plugins['adminSidebar'])) {
|
||||
echo '<li class="nav-item"><hr></li>';
|
||||
foreach ($plugins['adminSidebar'] as $pluginSidebar) {
|
||||
echo '<li class="nav-item">';
|
||||
echo $pluginSidebar->adminSidebar();
|
||||
echo '</li>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<li class="nav-item mt-5">
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'logout' ?>"><span class="fa fa-arrow-circle-right"></span><?php $L->p('Logout') ?></a>
|
||||
</li>
|
||||
</ul>
|
|
@ -1,98 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?php echo $layout['title'] ?></title>
|
||||
<meta charset="<?php echo CHARSET ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="robots" content="noindex,nofollow">
|
||||
<meta name="generator" content="Bludit">
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" type="image/x-icon" href="<?php echo HTML_PATH_CORE_IMG.'favicon.png?version='.BLUDIT_VERSION ?>">
|
||||
|
||||
<!-- CSS -->
|
||||
<?php
|
||||
echo Theme::cssBootstrap();
|
||||
echo Theme::cssLineAwesome();
|
||||
echo Theme::css(array(
|
||||
'bludit.css',
|
||||
'bludit.bootstrap.css'
|
||||
), DOMAIN_ADMIN_THEME_CSS);
|
||||
echo Theme::css(array(
|
||||
'jquery.datetimepicker.min.css',
|
||||
'select2.min.css',
|
||||
'select2-bootstrap4.min.css'
|
||||
), DOMAIN_CORE_CSS);
|
||||
?>
|
||||
|
||||
<!-- Javascript -->
|
||||
<?php
|
||||
echo Theme::jquery();
|
||||
echo Theme::jsBootstrap();
|
||||
echo Theme::jsSortable();
|
||||
echo Theme::js(array(
|
||||
'jquery.datetimepicker.full.min.js',
|
||||
'select2.full.min.js',
|
||||
'functions.js'
|
||||
), DOMAIN_CORE_JS, null);
|
||||
?>
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('adminHead') ?>
|
||||
|
||||
</head>
|
||||
<body class="h-100">
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('adminBodyBegin') ?>
|
||||
|
||||
<!-- Javascript dynamic generated by PHP -->
|
||||
<?php
|
||||
echo '<script charset="utf-8">'.PHP_EOL;
|
||||
include(PATH_CORE_JS.'variables.php');
|
||||
echo '</script>'.PHP_EOL;
|
||||
|
||||
echo '<script charset="utf-8">'.PHP_EOL;
|
||||
include(PATH_CORE_JS.'bludit-ajax.php');
|
||||
echo '</script>'.PHP_EOL;
|
||||
?>
|
||||
|
||||
<!-- Overlay background -->
|
||||
<div id="jsshadow"></div>
|
||||
|
||||
<!-- Alert -->
|
||||
<?php include('html/alert.php'); ?>
|
||||
|
||||
<!-- Navbar, only for small devices -->
|
||||
<?php include('html/navbar.php'); ?>
|
||||
|
||||
<div class="container h-100">
|
||||
<!-- 25%/75% split on large devices, small, medium devices hide -->
|
||||
<div class="row h-100">
|
||||
|
||||
<!-- LEFT SIDEBAR - Display only on large devices -->
|
||||
<div class="sidebar col-lg-2 d-none d-lg-block">
|
||||
<?php include('html/sidebar.php'); ?>
|
||||
</div>
|
||||
|
||||
<!-- RIGHT MAIN -->
|
||||
<div class="col-lg-10 pt-3 pb-1 h-100">
|
||||
<?php
|
||||
if (Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php')) {
|
||||
include(PATH_ADMIN_VIEWS.$layout['view'].'.php');
|
||||
} elseif ($layout['plugin'] && method_exists($layout['plugin'], 'adminView')) {
|
||||
echo $layout['plugin']->adminView();
|
||||
} else {
|
||||
echo '<h1 class="text-center">'.$L->g('Page not found').'</h1>';
|
||||
echo '<h2 class="text-center">'.$L->g('Choose a page from the sidebar.').'</h2>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('adminBodyEnd') ?>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,403 +0,0 @@
|
|||
<?php
|
||||
|
||||
class Bootstrap
|
||||
{
|
||||
|
||||
public static function modal($args)
|
||||
{
|
||||
|
||||
$buttonSecondary = $args['buttonSecondary'];
|
||||
$buttonSecondaryClass = $args['buttonSecondaryClass'];
|
||||
|
||||
$buttonPrimary = $args['buttonPrimary'];
|
||||
$buttonPrimaryClass = $args['buttonPrimaryClass'];
|
||||
|
||||
$modalText = $args['modalText'];
|
||||
$modalTitle = $args['modalTitle'];
|
||||
$modalId = $args['modalId'];
|
||||
|
||||
|
||||
return <<<EOF
|
||||
<div id="$modalId" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h3>$modalTitle</h3>
|
||||
<p>$modalText</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn $buttonSecondaryClass" data-dismiss="modal">$buttonSecondary</button>
|
||||
<button type="button" class="btn $buttonPrimaryClass">$buttonPrimary</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
EOF;
|
||||
}
|
||||
|
||||
public static function link($args)
|
||||
{
|
||||
$options = 'href="' . $args['href'] . '"';
|
||||
if (isset($args['class'])) {
|
||||
$options .= ' class="' . $args['class'] . '"';
|
||||
}
|
||||
if (isset($args['target'])) {
|
||||
$options .= ' target="' . $args['target'] . '"';
|
||||
}
|
||||
|
||||
if (isset($args['icon'])) {
|
||||
return '<a ' . $options . '><span class="fa fa-' . $args['icon'] . '"></span>' . $args['title'] . '</a>';
|
||||
}
|
||||
|
||||
return '<a ' . $options . '>' . $args['title'] . '</a>';
|
||||
}
|
||||
|
||||
public static function pageTitle($args)
|
||||
{
|
||||
$icon = $args['icon'];
|
||||
$title = $args['title'];
|
||||
return <<<EOF
|
||||
<h2 class="mt-0 mb-3">
|
||||
<span class="fa fa-$icon" style="font-size: 0.9em;"></span><span>$title</span>
|
||||
</h2>
|
||||
EOF;
|
||||
}
|
||||
|
||||
public static function formOpen($args)
|
||||
{
|
||||
$class = empty($args['class']) ? '' : 'class="' . $args['class'] . '"';
|
||||
$id = empty($args['id']) ? '' : 'id="' . $args['id'] . '"';
|
||||
$enctype = empty($args['enctype']) ? '' : 'enctype="' . $args['enctype'] . '"';
|
||||
$action = empty($args['action']) ? 'action=""' : 'action="' . $args['action'] . '"';
|
||||
$method = empty($args['method']) ? 'method="post"' : 'method="' . $args['method'] . '"';
|
||||
$style = empty($args['style']) ? '' : 'style="' . $args['style'] . '"';
|
||||
|
||||
return <<<EOF
|
||||
<form $class $enctype $id $method $action $style autocomplete="off">
|
||||
EOF;
|
||||
}
|
||||
|
||||
public static function formClose()
|
||||
{
|
||||
return <<<EOF
|
||||
</form>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Prevent the form submit when press enter key.
|
||||
$("form").keypress(function(e) {
|
||||
if ((e.which == 13) && (e.target.type !== "textarea")) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
EOF;
|
||||
}
|
||||
|
||||
public static function formTitle($args)
|
||||
{
|
||||
$title = $args['title'];
|
||||
return <<<EOF
|
||||
<h6 class="mt-4 mb-2 pb-2 border-bottom text-uppercase">$title</h6>
|
||||
EOF;
|
||||
}
|
||||
|
||||
public static function formInputTextBlock($args)
|
||||
{
|
||||
$name = $args['name'];
|
||||
$disabled = empty($args['disabled']) ? '' : 'disabled';
|
||||
$placeholder = isset($args['placeholder']) ? $args['placeholder'] : '';
|
||||
$value = isset($args['value']) ? $args['value'] : '';
|
||||
|
||||
$id = 'js' . $name;
|
||||
if (isset($args['id'])) {
|
||||
$id = $args['id'];
|
||||
}
|
||||
|
||||
$tip = '';
|
||||
if (!empty($args['tip'])) {
|
||||
$tip = '<small class="form-text text-muted">' . $args['tip'] . '</small>';
|
||||
}
|
||||
|
||||
$class = 'form-group m-0';
|
||||
if (isset($args['class'])) {
|
||||
$class = $args['class'];
|
||||
}
|
||||
|
||||
$labelClass = 'mt-4 mb-2 pb-2 border-bottom text-uppercase w-100';
|
||||
if (isset($args['labelClass'])) {
|
||||
$labelClass = $args['labelClass'];
|
||||
}
|
||||
|
||||
$label = '';
|
||||
if (!empty($args['label'])) {
|
||||
$label = '<label class="' . $labelClass . '" for="' . $id . '">' . $args['label'] . '</label>';
|
||||
}
|
||||
|
||||
$type = 'text';
|
||||
if (isset($args['type'])) {
|
||||
$type = $args['type'];
|
||||
}
|
||||
|
||||
return <<<EOF
|
||||
<div class="$class">
|
||||
$label
|
||||
<input type="text" dir="auto" value="$value" class="form-control" id="$id" name="$name" placeholder="$placeholder" $disabled>
|
||||
$tip
|
||||
</div>
|
||||
EOF;
|
||||
}
|
||||
|
||||
public static function formInputFile($args)
|
||||
{
|
||||
$id = 'js' . $args['name'];
|
||||
if (isset($args['id'])) {
|
||||
$id = $args['id'];
|
||||
}
|
||||
|
||||
$class = 'custom-file';
|
||||
if (isset($args['class'])) {
|
||||
$class = $class . ' ' . $args['class'];
|
||||
}
|
||||
|
||||
$html = '<div class="' . $class . '">';
|
||||
$html .= '<input type="file" class="custom-file-input" id="' . $id . '">';
|
||||
$html .= '<label class="custom-file-label" for="' . $id . '">' . $args['label'] . '</label>';
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function formTextarea($args)
|
||||
{
|
||||
$id = 'js' . $args['name'];
|
||||
if (isset($args['id'])) {
|
||||
$id = $args['id'];
|
||||
}
|
||||
|
||||
$class = 'form-control';
|
||||
if (isset($args['class'])) {
|
||||
$class = $class . ' ' . $args['class'];
|
||||
}
|
||||
|
||||
$html = '<div class="form-group row">';
|
||||
|
||||
if (!empty($args['label'])) {
|
||||
$html .= '<label for="' . $id . '" class="col-sm-2 col-form-label">' . $args['label'] . '</label>';
|
||||
}
|
||||
|
||||
$html .= '<div class="col-sm-10">';
|
||||
$html .= '<textarea class="' . $class . '" id="' . $id . '" name="' . $args['name'] . '" rows="' . $args['rows'] . '" placeholder="' . $args['placeholder'] . '">' . $args['value'] . '</textarea>';
|
||||
if (isset($args['tip'])) {
|
||||
$html .= '<small class="form-text text-muted">' . $args['tip'] . '</small>';
|
||||
}
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function formTextareaBlock($args)
|
||||
{
|
||||
$id = 'js' . $args['name'];
|
||||
if (isset($args['id'])) {
|
||||
$id = $args['id'];
|
||||
}
|
||||
|
||||
$class = 'form-control';
|
||||
if (!empty($args['class'])) {
|
||||
$class = $class . ' ' . $args['class'];
|
||||
}
|
||||
|
||||
$html = '<div class="form-group m-0">';
|
||||
if (!empty($args['label'])) {
|
||||
$html .= '<label class="mt-4 mb-2 pb-2 border-bottom text-uppercase w-100" for="' . $id . '">' . $args['label'] . '</label>';
|
||||
}
|
||||
|
||||
$html .= '<textarea class="' . $class . '" id="' . $id . '" name="' . $args['name'] . '" rows="' . $args['rows'] . '" placeholder="' . $args['placeholder'] . '">' . $args['value'] . '</textarea>';
|
||||
if (!empty($args['tip'])) {
|
||||
$html .= '<small class="form-text text-muted">' . $args['tip'] . '</small>';
|
||||
}
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function formInputText($args)
|
||||
{
|
||||
$name = $args['name'];
|
||||
$disabled = empty($args['disabled']) ? '' : 'disabled';
|
||||
$readonly = empty($args['readonly']) ? '' : 'readonly';
|
||||
$placeholder = isset($args['placeholder']) ? $args['placeholder'] : '';
|
||||
$value = isset($args['value']) ? $args['value'] : '';
|
||||
|
||||
$id = 'js' . $name;
|
||||
if (isset($args['id'])) {
|
||||
$id = $args['id'];
|
||||
}
|
||||
|
||||
$tip = '';
|
||||
if (isset($args['tip'])) {
|
||||
$tip = '<small class="form-text text-muted">' . $args['tip'] . '</small>';
|
||||
}
|
||||
|
||||
$label = '';
|
||||
if (isset($args['label'])) {
|
||||
$label = '<label for="' . $id . '" class="col-sm-2 col-form-label">' . $args['label'] . '</label>';
|
||||
}
|
||||
|
||||
$class = 'form-control';
|
||||
if (isset($args['class'])) {
|
||||
$class = $class . ' ' . $args['class'];
|
||||
}
|
||||
|
||||
$type = 'text';
|
||||
if (isset($args['type'])) {
|
||||
$type = $args['type'];
|
||||
}
|
||||
|
||||
return <<<EOF
|
||||
<div class="form-group row">
|
||||
$label
|
||||
<div class="col-sm-10">
|
||||
<input class="$class" id="$id" name="$name" value="$value" placeholder="$placeholder" type="$type" dir="auto" $disabled $readonly>
|
||||
$tip
|
||||
</div>
|
||||
</div>
|
||||
EOF;
|
||||
}
|
||||
|
||||
public static function formCheckbox($args)
|
||||
{
|
||||
$labelForCheckbox = isset($args['labelForCheckbox']) ? $args['labelForCheckbox'] : '';
|
||||
$placeholder = isset($args['placeholder']) ? $args['placeholder'] : '';
|
||||
$tip = isset($args['tip']) ? '<small class="form-text text-muted">' . $args['tip'] . '</small>' : '';
|
||||
$value = isset($args['value']) ? $args['value'] : '';
|
||||
$name = $args['name'];
|
||||
$id = 'js' . $name;
|
||||
if (isset($args['id'])) {
|
||||
$id = $args['id'];
|
||||
}
|
||||
$disabled = isset($args['disabled']) ? 'disabled' : '';
|
||||
|
||||
$class = 'form-group m-0';
|
||||
if (isset($args['class'])) {
|
||||
$class = $args['class'];
|
||||
}
|
||||
|
||||
$labelClass = 'mt-4 mb-2 pb-2 border-bottom text-uppercase w-100';
|
||||
if (isset($args['labelClass'])) {
|
||||
$labelClass = $args['labelClass'];
|
||||
}
|
||||
|
||||
$type = 'text';
|
||||
if (isset($args['type'])) {
|
||||
$type = $args['type'];
|
||||
}
|
||||
|
||||
$label = '';
|
||||
if (!empty($args['label'])) {
|
||||
$label = '<label class="' . $labelClass . '">' . $args['label'] . '</label>';
|
||||
}
|
||||
|
||||
$checked = $args['checked'] ? 'checked' : '';
|
||||
$value = $checked ? '1' : '0';
|
||||
|
||||
return <<<EOF
|
||||
<div class="$class">
|
||||
$label
|
||||
<div class="form-check">
|
||||
<input type="hidden" name="$name" value="$value"><input id="$id" type="checkbox" class="form-check-input" onclick="this.previousSibling.value=1-this.previousSibling.value" $checked>
|
||||
<label class="form-check-label" for="$id">$labelForCheckbox</label>
|
||||
$tip
|
||||
</div>
|
||||
</div>
|
||||
EOF;
|
||||
}
|
||||
|
||||
public static function formSelect($args)
|
||||
{
|
||||
$id = 'js' . $args['name'];
|
||||
if (isset($args['id'])) {
|
||||
$id = $args['id'];
|
||||
}
|
||||
|
||||
$class = 'custom-select';
|
||||
if (isset($args['class'])) {
|
||||
$class = $class . ' ' . $args['class'];
|
||||
}
|
||||
|
||||
$html = '<div class="form-group row">';
|
||||
|
||||
if (isset($args['label'])) {
|
||||
$html .= '<label for="' . $id . '" class="col-sm-2 col-form-label">' . $args['label'] . '</label>';
|
||||
}
|
||||
|
||||
$html .= '<div class="col-sm-10">';
|
||||
$html .= '<select id="' . $id . '" name="' . $args['name'] . '" class="' . $class . '">';
|
||||
foreach ($args['options'] as $key => $value) {
|
||||
$html .= '<option ' . (($key == $args['selected']) ? 'selected' : '') . ' value="' . $key . '">' . $value . '</option>';
|
||||
}
|
||||
$html .= '</select>';
|
||||
if (isset($args['tip'])) {
|
||||
$html .= '<small class="form-text text-muted">' . $args['tip'] . '</small>';
|
||||
}
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function formSelectBlock($args)
|
||||
{
|
||||
$id = 'js' . $args['name'];
|
||||
if (isset($args['id'])) {
|
||||
$id = $args['id'];
|
||||
}
|
||||
|
||||
$class = 'custom-select';
|
||||
if (!empty($args['class'])) {
|
||||
$class = $class . ' ' . $args['class'];
|
||||
}
|
||||
|
||||
$html = '<div class="form-group m-0">';
|
||||
|
||||
if (!empty($args['label'])) {
|
||||
$html .= '<label class="mt-4 mb-2 pb-2 border-bottom text-uppercase w-100" for="' . $id . '">' . $args['label'] . '</label>';
|
||||
}
|
||||
|
||||
$html .= '<select id="' . $id . '" name="' . $args['name'] . '" class="' . $class . '">';
|
||||
if (!empty($args['emptyOption'])) {
|
||||
$html .= '<option value="">' . $args['emptyOption'] . '</option>';
|
||||
}
|
||||
foreach ($args['options'] as $key => $value) {
|
||||
$html .= '<option ' . (($key == $args['selected']) ? 'selected' : '') . ' value="' . $key . '">' . $value . '</option>';
|
||||
}
|
||||
$html .= '</select>';
|
||||
if (!empty($args['tip'])) {
|
||||
$html .= '<small class="form-text text-muted">' . $args['tip'] . '</small>';
|
||||
}
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public static function formInputHidden($args)
|
||||
{
|
||||
return '<input type="hidden" id="js' . $args['name'] . '" name="' . $args['name'] . '" value="' . $args['value'] . '">';
|
||||
}
|
||||
|
||||
public static function alert($args)
|
||||
{
|
||||
$class = 'alert';
|
||||
if (!empty($args['class'])) {
|
||||
$class = $class . ' ' . $args['class'];
|
||||
}
|
||||
|
||||
$text = $args['text'];
|
||||
|
||||
return <<<EOF
|
||||
<div class="$class" role="alert">$text</div>
|
||||
EOF;
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Bludit</title>
|
||||
<meta charset="<?php echo CHARSET ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="robots" content="noindex,nofollow">
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" type="image/x-icon" href="<?php echo HTML_PATH_CORE_IMG . 'favicon.png?version=' . BLUDIT_VERSION ?>">
|
||||
|
||||
<!-- CSS -->
|
||||
<?php
|
||||
echo Theme::cssBootstrap();
|
||||
echo Theme::css(array(
|
||||
'bludit.css',
|
||||
'bludit.bootstrap.css'
|
||||
), DOMAIN_ADMIN_THEME_CSS);
|
||||
?>
|
||||
|
||||
<!-- Javascript -->
|
||||
<?php
|
||||
echo Theme::jquery();
|
||||
echo Theme::jsBootstrap();
|
||||
?>
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('loginHead') ?>
|
||||
</head>
|
||||
|
||||
<body class="login">
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('loginBodyBegin') ?>
|
||||
|
||||
<!-- Alert -->
|
||||
<?php include('html/alert.php'); ?>
|
||||
|
||||
<div class="container">
|
||||
<div class="row justify-content-md-center pt-5">
|
||||
<div class="col-md-4 mt-5 p-5 shadow-sm bg-white rounded border">
|
||||
<?php
|
||||
if (Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'] . '.php')) {
|
||||
include(PATH_ADMIN_VIEWS . $layout['view'] . '.php');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('loginBodyEnd') ?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,47 +0,0 @@
|
|||
<?php
|
||||
|
||||
echo Bootstrap::pageTitle(array('title'=>$L->g('About'), 'icon'=>'info-circle'));
|
||||
|
||||
echo '
|
||||
<table class="table table-striped mt-3">
|
||||
<tbody>
|
||||
';
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td>Bludit Edition</td>';
|
||||
if (defined('BLUDIT_PRO')) {
|
||||
echo '<td>PRO - '.$L->g('Thanks for supporting Bludit').' <span class="fa fa-heart" style="color: #ffc107"></span></td>';
|
||||
} else {
|
||||
echo '<td>Standard - <a target="_blank" href="https://pro.bludit.com">'.$L->g('Upgrade to Bludit PRO').'</a></td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td>Bludit Version</td>';
|
||||
echo '<td>'.BLUDIT_VERSION.'</td>';
|
||||
echo '</tr>';
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td>Bludit Codename</td>';
|
||||
echo '<td>'.BLUDIT_CODENAME.'</td>';
|
||||
echo '</tr>';
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td>Bludit Build Number</td>';
|
||||
echo '<td>'.BLUDIT_BUILD.'</td>';
|
||||
echo '</tr>';
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td>Disk usage</td>';
|
||||
echo '<td>'.Filesystem::bytesToHumanFileSize(Filesystem::getSize(PATH_ROOT)).'</td>';
|
||||
echo '</tr>';
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td><a href="'.HTML_PATH_ADMIN_ROOT.'developers'.'">Bludit Developers</a></td>';
|
||||
echo '<td></td>';
|
||||
echo '</tr>';
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue