Compare commits
No commits in common. "v3.0" and "3.8.0" have entirely different histories.
17
.github/issue_template.md
vendored
|
@ -1,18 +1,9 @@
|
|||
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.
|
||||
|
||||
### Expected behavior
|
||||
|
||||
### Actual behavior
|
||||
|
||||
### 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`.
|
||||
|
|
8
.gitignore
vendored
|
@ -1,7 +1,6 @@
|
|||
.DS_Store
|
||||
dbgenerator.php
|
||||
bl-content/*
|
||||
!bl-content/.keep
|
||||
bl-content-migrator
|
||||
bl-plugins/timemachine
|
||||
bl-plugins/timemachine-x
|
||||
|
@ -13,9 +12,8 @@ bl-plugins/yandex-metrica/
|
|||
bl-plugins/domain-migrator/
|
||||
bl-plugins/tail-writer/
|
||||
bl-kernel/bludit.pro.php
|
||||
bl-kernel/admin/themes/gris
|
||||
bl-kernel/admin/themes/grizzly/*
|
||||
bl-themes/docs
|
||||
bl-themes/typerite
|
||||
bl-themes/docsx
|
||||
bl-themes/editorial
|
||||
bl-themes/mediumish
|
||||
|
@ -26,7 +24,3 @@ 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
|
||||
|
|
|
@ -6,14 +6,13 @@ AddDefaultCharset UTF-8
|
|||
RewriteEngine on
|
||||
|
||||
# Base directory
|
||||
RewriteBase /
|
||||
# RewriteBase /
|
||||
|
||||
# Deny direct access to the next directories
|
||||
RewriteRule ^bl-content/(databases|workspaces|pages|tmp)/.*$ - [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
|
||||
}
|
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-2023 Diego Najar
|
||||
Copyright (c) 2015-2018 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
|
||||
|
|
80
README.md
|
@ -1,52 +1,72 @@
|
|||
# [Bludit](https://www.bludit.com/)
|
||||
[Bludit](https://www.bludit.com/)
|
||||
================================
|
||||
**Simple**, **Fast** and **Flexible** CMS
|
||||
|
||||
Bludit the Simple, Fast, and Flexible CMS.
|
||||
Bludit is a web application to build your own **website** or **blog** in seconds, it's completely **free and open source**. Bludit uses files in JSON format to store the content, you don't need to install or configure a database. You only need a web server with PHP support.
|
||||
|
||||
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.
|
||||
Bludit is a **Flat-File** CMS.
|
||||
|
||||
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.
|
||||
|
||||
## Resources
|
||||
Bludit supports **Markdown** and **HTML code** for the content.
|
||||
|
||||
- [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)
|
||||
- Help and Support [Forum](https://forum.bludit.org) and [Chat](https://gitter.im/bludit/support)
|
||||
|
||||
## Requirements
|
||||
[](https://pro.bludit.com/)
|
||||
|
||||
- Webserver with PHP support.
|
||||
- PHP v5.6 or higher version.
|
||||
Social Networks
|
||||
---------------
|
||||
|
||||
- [Twitter](https://twitter.com/bludit)
|
||||
- [Facebook](https://www.facebook.com/bluditcms)
|
||||
- [Youtube](https://www.youtube.com/channel/UCuLu0Z_CHBsTiYTDz129x9Q?view_as=subscriber)
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
You just need a web server with PHP support.
|
||||
|
||||
- PHP v5.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.
|
||||
- Supported web servers:
|
||||
* Bludit supports almost every web server
|
||||
* PHP Built-in web server (`php -S localhost:8000`)
|
||||
|
||||
## 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 the official page. [Bludit.com](https://www.bludit.com)
|
||||
2. Extract the zip file into a directory like `bludit`.
|
||||
3. Upload the directory `bludit` to your web server or hosting.
|
||||
4. Visit your domain https://example.com/bludit/
|
||||
5. Follow the Bludit Installer to configure the website.
|
||||
|
||||
## Quick installation for testing
|
||||
Docker Image
|
||||
------------
|
||||
Bludit provides an official Docker image.
|
||||
- https://hub.docker.com/r/bludit/docker/
|
||||
|
||||
You can use PHP Built-in web server (`php -S localhost:8000`) or [Docker image](https://hub.docker.com/r/bludit/docker/)
|
||||
Backers
|
||||
-------
|
||||
Become a **Backer** and support Bludit with a monthly contribution to help us continue development.
|
||||
- [Become a Backer](https://www.patreon.com/bePatron?c=921115&rid=2458859)
|
||||
|
||||
## Support Bludit
|
||||
Sponsors
|
||||
--------
|
||||
Become a **Sponsor** and support Bludit with a monthly contribution to help us continue development.
|
||||
|
||||
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.
|
||||
[](https://www.patreon.com/bePatron?c=921115&rid=2458860)
|
||||
|
||||
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
|
||||
- <a href="https://www.patreon.com/clickwork" target="_blank">Clickwork</a>
|
||||
- <a href="https://www.patreon.com/user/creators?u=10331784" target="_blank">KreativMind</a>
|
||||
- <a href="https://www.patreon.com/user/creators?u=3969453" target="_blank">Martin Cajzer</a>
|
||||
- <a href="https://www.patreon.com/user/creators?u=12261033" target="_blank">Jan Rippl</a>
|
||||
- <a href="https://www.patreon.com/user/creators?u=9828204" target="_blank">Wesleigh Walker</a>
|
||||
|
||||
License
|
||||
-------
|
||||
Bludit is open source software licensed under the [MIT license](https://tldrlegal.com/license/mit-license).
|
||||
|
|
|
@ -30,9 +30,11 @@ class dbJSON {
|
|||
|
||||
// Unserialize, JSON to Array
|
||||
$array = $this->unserialize($implode);
|
||||
|
||||
if (empty($array)) {
|
||||
$this->db = array();
|
||||
$this->dbBackup = array();
|
||||
Log::set(__METHOD__.LOG_SEP.'Error trying to read the JSON file: '.$file, LOG_TYPE_ERROR);
|
||||
} else {
|
||||
$this->db = $array;
|
||||
$this->dbBackup = $array;
|
||||
|
@ -98,8 +100,7 @@ class dbJSON {
|
|||
{
|
||||
// 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);
|
||||
if (empty($decode)) {
|
||||
return false;
|
||||
}
|
||||
return $decode;
|
||||
|
|
|
@ -34,7 +34,6 @@ class dbList extends dbJSON
|
|||
}
|
||||
|
||||
// Returns the list of keys filter by pageNumber
|
||||
// $pageNumber start in 1
|
||||
public function getList($key, $pageNumber, $numberOfItems)
|
||||
{
|
||||
if (!isset($this->db[$key])) {
|
||||
|
@ -81,9 +80,9 @@ class dbList extends dbJSON
|
|||
{
|
||||
$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]['name'] = $args['name'];
|
||||
$this->db[$key]['template'] = isset($args['template'])?$args['template']:'';
|
||||
$this->db[$key]['description'] = isset($args['description'])?$args['description']:'';
|
||||
$this->db[$key]['list'] = isset($args['list'])?$args['list']:array();
|
||||
|
||||
$this->sortAlphanumeric();
|
||||
|
@ -111,9 +110,9 @@ class dbList extends dbJSON
|
|||
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']]['name'] = $args['name'];
|
||||
$this->db[$args['newKey']]['template'] = isset($args['template'])?$args['template']:'';
|
||||
$this->db[$args['newKey']]['description'] = isset($args['description'])?$args['description']:'';
|
||||
$this->db[$args['newKey']]['list'] = $this->db[$args['oldKey']]['list'];
|
||||
|
||||
// Remove the old category
|
||||
|
@ -127,7 +126,7 @@ class dbList extends dbJSON
|
|||
}
|
||||
|
||||
// Sort the categories by "Natural order"
|
||||
public function sortAlphanumeric()
|
||||
private function sortAlphanumeric()
|
||||
{
|
||||
// Sort key alphanumeric strings, a01, a10, b10, c02
|
||||
return ksort($this->db);
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
class Plugin
|
||||
{
|
||||
class Plugin {
|
||||
|
||||
// (string) directory name, just the name
|
||||
// Ex: sitemap
|
||||
public $directoryName;
|
||||
|
||||
// (string) Absolute database filename and path
|
||||
// (string) Absoulute database filename and path
|
||||
// Ex: /www/bludit/bl-content/plugins/sitemap/db.php
|
||||
public $filenameDb;
|
||||
|
||||
// (string) Absolute metadata filename and path
|
||||
// (string) Absoulute metadata filename and path
|
||||
// Ex: /www/bludit/bl-plugins/sitemap/metadata.json
|
||||
public $filenameMetadata;
|
||||
|
||||
|
@ -32,13 +31,9 @@ class Plugin
|
|||
// (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));
|
||||
|
||||
|
@ -56,10 +51,10 @@ class Plugin
|
|||
// Init empty database with default values
|
||||
$this->db = $this->dbFields;
|
||||
|
||||
$this->filenameDb = PATH_PLUGINS_DATABASES . $this->directoryName . DS . 'db.php';
|
||||
$this->filenameDb = PATH_PLUGINS_DATABASES.$this->directoryName.DS.'db.php';
|
||||
|
||||
// --- Metadata ---
|
||||
$this->filenameMetadata = PATH_PLUGINS . $this->directoryName() . DS . 'metadata.json';
|
||||
$this->filenameMetadata = PATH_PLUGINS.$this->directoryName().DS.'metadata.json';
|
||||
$metadataString = file_get_contents($this->filenameMetadata);
|
||||
$this->metadata = json_decode($metadataString, true);
|
||||
|
||||
|
@ -67,7 +62,6 @@ class Plugin
|
|||
if ($this->installed()) {
|
||||
$Tmp = new dbJSON($this->filenameDb);
|
||||
$this->db = $Tmp->db;
|
||||
$this->prepare();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,44 +74,44 @@ class Plugin
|
|||
|
||||
public function includeCSS($filename)
|
||||
{
|
||||
return '<link rel="stylesheet" type="text/css" href="' . $this->domainPath() . 'css/' . $filename . '?version=' . BLUDIT_VERSION . '">' . PHP_EOL;
|
||||
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;
|
||||
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 . '/';
|
||||
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 . '/';
|
||||
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;
|
||||
return PATH_PLUGINS.$this->directoryName.DS;
|
||||
}
|
||||
|
||||
public function phpPathDB()
|
||||
{
|
||||
return PATH_PLUGINS_DATABASES . $this->directoryName . DS;
|
||||
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
|
||||
// Returns the value of the key from the metadata of the plugin, FALSE if the key doen't exit
|
||||
public function getMetadata($key)
|
||||
{
|
||||
if (isset($this->metadata[$key])) {
|
||||
if(isset($this->metadata[$key])) {
|
||||
return $this->metadata[$key];
|
||||
}
|
||||
|
||||
|
@ -134,7 +128,7 @@ class Plugin
|
|||
// 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)
|
||||
public function getValue($field, $html=true)
|
||||
{
|
||||
if (isset($this->db[$field])) {
|
||||
if ($html) {
|
||||
|
@ -205,9 +199,9 @@ class Plugin
|
|||
{
|
||||
$bluditRoot = explode('.', BLUDIT_VERSION);
|
||||
$compatible = explode(',', $this->getMetadata('compatible'));
|
||||
foreach ($compatible as $version) {
|
||||
foreach( $compatible as $version ) {
|
||||
$root = explode('.', $version);
|
||||
if ($root[0] == $bluditRoot[0] && $root[1] == $bluditRoot[1]) {
|
||||
if( $root[0]==$bluditRoot[0] && $root[1]==$bluditRoot[1] ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +214,7 @@ class Plugin
|
|||
}
|
||||
|
||||
// Return TRUE if the installation success, otherwise FALSE.
|
||||
public function install($position = 1)
|
||||
public function install($position=1)
|
||||
{
|
||||
if ($this->installed()) {
|
||||
return false;
|
||||
|
@ -231,11 +225,11 @@ class Plugin
|
|||
mkdir($workspace, DIR_PERMISSIONS, true);
|
||||
|
||||
// Create plugin directory for the database
|
||||
mkdir(PATH_PLUGINS_DATABASES . $this->directoryName, DIR_PERMISSIONS, true);
|
||||
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) {
|
||||
foreach ($this->dbFields as $key=>$value) {
|
||||
$value = Sanitize::html($value);
|
||||
settype($value, gettype($this->dbFields[$key]));
|
||||
$this->db[$key] = $value;
|
||||
|
@ -248,7 +242,7 @@ class Plugin
|
|||
public function uninstall()
|
||||
{
|
||||
// Delete database
|
||||
$path = PATH_PLUGINS_DATABASES . $this->directoryName;
|
||||
$path = PATH_PLUGINS_DATABASES.$this->directoryName;
|
||||
Filesystem::deleteRecursive($path);
|
||||
|
||||
// Delete workspace
|
||||
|
@ -258,8 +252,6 @@ class Plugin
|
|||
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);
|
||||
|
@ -267,44 +259,30 @@ class Plugin
|
|||
|
||||
public function workspace()
|
||||
{
|
||||
return PATH_WORKSPACES . $this->directoryName . DS;
|
||||
return PATH_WORKSPACES.$this->directoryName.DS;
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
// This method is used on children classes
|
||||
// This method is used on childre 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;
|
||||
foreach ($this->dbFields as $key=>$value) {
|
||||
if (isset($args[$key])) {
|
||||
$value = Sanitize::html( $args[$key] );
|
||||
if ($value==='false') { $value = false; }
|
||||
elseif ($value==='true') { $value = true; }
|
||||
settype($value, gettype($this->dbFields[$key]));
|
||||
$this->db[$key] = $value;
|
||||
}
|
||||
}
|
||||
return $this->save();
|
||||
}
|
||||
|
||||
public function type()
|
||||
{
|
||||
return $this->getMetadata('type');
|
||||
}
|
||||
|
||||
public function setField($field, $value)
|
||||
{
|
||||
$this->db[$field] = Sanitize::html($value);
|
||||
|
@ -318,7 +296,7 @@ class Plugin
|
|||
|
||||
// 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)
|
||||
public function webhook($URI=false, $returnsAfterURI=false, $fixed=true)
|
||||
{
|
||||
global $url;
|
||||
|
||||
|
@ -327,10 +305,10 @@ class Plugin
|
|||
}
|
||||
|
||||
// Check URI start with the webhook
|
||||
$startString = HTML_PATH_ROOT . $URI;
|
||||
$startString = HTML_PATH_ROOT.$URI;
|
||||
$URI = $url->uri();
|
||||
$length = mb_strlen($startString, CHARSET);
|
||||
if (mb_substr($URI, 0, $length) != $startString) {
|
||||
if (mb_substr($URI, 0, $length)!=$startString) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -339,7 +317,7 @@ class Plugin
|
|||
if ($fixed) {
|
||||
return false;
|
||||
}
|
||||
if ($afterURI[0] != '/') {
|
||||
if ($afterURI[0]!='/') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -348,7 +326,8 @@ class Plugin
|
|||
return $afterURI;
|
||||
}
|
||||
|
||||
Log::set(__METHOD__ . LOG_SEP . 'Webhook requested.');
|
||||
Log::set(__METHOD__.LOG_SEP.'Webhook requested.');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
38
bl-kernel/admin/controllers/blocks.php
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// ============================================================================
|
||||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin'));
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
|
||||
foreach ($_POST['key'] as $key=>$value) {
|
||||
$blocks->add(array(
|
||||
'title'=>$_POST['title'][$key],
|
||||
'value'=>$_POST['value'][$key],
|
||||
'key'=>$_POST['key'][$key]
|
||||
));
|
||||
}
|
||||
|
||||
// Add to syslog
|
||||
$syslog->add(array(
|
||||
'dictionaryKey'=>'blocks-configured',
|
||||
'notes'=>''
|
||||
));
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('Blocks');
|
|
@ -4,25 +4,12 @@
|
|||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin', 'editor', 'author'));
|
||||
checkRole(array('admin', 'editor'));
|
||||
|
||||
// ============================================================================
|
||||
// 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
|
||||
// ============================================================================
|
||||
|
@ -35,26 +22,21 @@ function filterContentOwner($list) {
|
|||
// 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);
|
||||
}
|
||||
// List of published pages
|
||||
$onlyPublished = true;
|
||||
$numberOfItems = ITEMS_PER_PAGE_ADMIN;
|
||||
$pageNumber = $url->pageNumber();
|
||||
$published = $pages->getList($pageNumber, $numberOfItems, $onlyPublished);
|
||||
|
||||
// Check if out of range the pageNumber
|
||||
if (empty($published) && $url->pageNumber()>1) {
|
||||
Redirect::page('content');
|
||||
}
|
||||
|
||||
$drafts = $pages->getDraftDB(true);
|
||||
$scheduled = $pages->getScheduledDB(true);
|
||||
$static = $pages->getStaticDB(true);
|
||||
$sticky = $pages->getStickyDB(true);
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('Manage content');
|
|
@ -4,7 +4,7 @@
|
|||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
if (checkRole(array('author'), false)) {
|
||||
if (!checkRole(array('admin','editor'), false)) {
|
||||
try {
|
||||
$pageKey = isset($_POST['key']) ? $_POST['key'] : $layout['parameters'];
|
||||
$page = new Page($pageKey);
|
||||
|
@ -43,6 +43,11 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|||
Alert::set( $L->g('The changes have been saved') );
|
||||
}
|
||||
} else {
|
||||
// If the checkbox is not selected the form doesn't send the field
|
||||
$_POST['noindex'] = isset($_POST['noindex'])?true:false;
|
||||
$_POST['nofollow'] = isset($_POST['nofollow'])?true:false;
|
||||
$_POST['noarchive'] = isset($_POST['noarchive'])?true:false;
|
||||
|
||||
$key = editPage($_POST);
|
||||
if ($key!==false) {
|
||||
Alert::set( $L->g('The changes have been saved') );
|
||||
|
@ -59,28 +64,11 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|||
try {
|
||||
$pageKey = $layout['parameters'];
|
||||
$page = new Page($pageKey);
|
||||
$uuid = $page->uuid();
|
||||
} 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();
|
|
@ -26,9 +26,6 @@ function checkLogin($args)
|
|||
// 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;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// Check role
|
||||
// ============================================================================
|
||||
|
||||
checkRole(array('admin', 'editor', 'author'));
|
||||
checkRole(array('admin', 'editor'));
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
|
@ -19,6 +19,11 @@ checkRole(array('admin', 'editor', 'author'));
|
|||
// ============================================================================
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
// If the checkbox is not selected the form doesn't send the field
|
||||
$_POST['noindex'] = isset($_POST['noindex'])?true:false;
|
||||
$_POST['nofollow'] = isset($_POST['nofollow'])?true:false;
|
||||
$_POST['noarchive'] = isset($_POST['noarchive'])?true:false;
|
||||
|
||||
createPage($_POST);
|
||||
Redirect::page('content');
|
||||
}
|
||||
|
@ -30,23 +35,5 @@ if ($_SERVER['REQUEST_METHOD'] == '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'];
|
|
@ -11,30 +11,21 @@ checkRole(array('admin'));
|
|||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// ============================================================================
|
||||
// POST Method
|
||||
// ============================================================================
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
editSettings($_POST);
|
||||
Redirect::page('settings-general');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// 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));
|
||||
|
||||
?>
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('General Settings');
|
31
bl-kernel/admin/controllers/settings-regional.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?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-regional');
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Main after POST
|
||||
// ============================================================================
|
||||
|
||||
// Title of the page
|
||||
$layout['title'] .= ' - '.$L->g('Language and timezone');
|
|
@ -4,6 +4,8 @@
|
|||
// Functions
|
||||
// ============================================================================
|
||||
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Main before POST
|
||||
// ============================================================================
|
||||
|
@ -13,14 +15,8 @@
|
|||
// ============================================================================
|
||||
|
||||
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,
|
||||
'username'=>$_POST['username'],
|
||||
'newPassword'=>$_POST['newPassword'],
|
||||
'confirmPassword'=>$_POST['confirmPassword']
|
||||
))) {
|
||||
|
|
|
@ -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,3 +1,4 @@
|
|||
|
||||
html {
|
||||
height: 100%;
|
||||
font-size: 0.9rem;
|
||||
|
@ -8,54 +9,6 @@ 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
|
||||
*/
|
||||
|
@ -68,7 +21,6 @@ div.sidebar .nav-item h4 {
|
|||
|
||||
/* for small devices */
|
||||
@media (max-width: 575.98px) {
|
||||
|
||||
#jsmediaManagerButton,
|
||||
#jscategoryButton,
|
||||
#jsdescriptionButton {
|
||||
|
@ -77,8 +29,27 @@ div.sidebar .nav-item h4 {
|
|||
}
|
||||
}
|
||||
|
||||
a {
|
||||
color: #4a90e2;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #4a90e2;
|
||||
}
|
||||
|
||||
.btn {
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: #4F93E0;
|
||||
border-color: #4a90e2;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background-color: #4585CF;
|
||||
border-color: #4a90e2;
|
||||
}
|
||||
|
||||
.btn-light {
|
||||
color: #212529;
|
||||
|
@ -98,13 +69,11 @@ div.sidebar .nav-item h4 {
|
|||
color: #000;
|
||||
}
|
||||
|
||||
|
||||
|
||||
code {
|
||||
padding: 3px 5px 2px;
|
||||
margin: 0 1px;
|
||||
background: #eaeaea;
|
||||
background: rgba(0, 0, 0, .07);
|
||||
background: rgba(0,0,0,.07);
|
||||
color: #444;
|
||||
}
|
||||
|
||||
|
@ -129,8 +98,8 @@ code {
|
|||
*/
|
||||
|
||||
body.login {
|
||||
background: rgb(255, 255, 255);
|
||||
background: linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(250, 250, 250, 1) 53%);
|
||||
background: rgb(255,255,255);
|
||||
background: linear-gradient(0deg, rgba(255,255,255,1) 0%, rgba(250,250,250,1) 53%);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
@ -168,6 +137,7 @@ body.login {
|
|||
|
||||
#hello-message {
|
||||
padding: 10px 0;
|
||||
color: #777;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
|
@ -218,7 +188,34 @@ body.login {
|
|||
color: #ffffff;
|
||||
}
|
||||
|
||||
/*
|
||||
SIDEBAR
|
||||
*/
|
||||
|
||||
div.sidebar .nav-item a {
|
||||
padding-left:0;
|
||||
padding-right:0;
|
||||
color: #777;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
div.sidebar .nav-item a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
div.sidebar .nav-item h4 {
|
||||
font-size: 1.3em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 400;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
div.sidebar .nav-item span.oi {
|
||||
color: #000;
|
||||
font-size: 0.8em;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
/*
|
||||
PLUGINS
|
||||
|
@ -242,7 +239,7 @@ body.login {
|
|||
background-clip: padding-box;
|
||||
border: 1px solid #ced4da;
|
||||
border-radius: .25rem;
|
||||
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
||||
transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
|
||||
}
|
||||
|
||||
.plugin-form textarea {
|
||||
|
@ -300,20 +297,16 @@ td.child {
|
|||
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;
|
||||
}
|
||||
|
@ -343,7 +336,7 @@ td.child {
|
|||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: rgba(72, 72, 72, 0.7);
|
||||
background-color: rgba(255,255,255,0.7);
|
||||
z-index: 10;
|
||||
display: none;
|
||||
}
|
||||
|
@ -356,12 +349,61 @@ img.profilePicture {
|
|||
}
|
||||
|
||||
/* Switch button */
|
||||
.switch-button {
|
||||
font-size: 0.9em;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
.switch {
|
||||
position: relative;
|
||||
height: 26px;
|
||||
width: 140px;
|
||||
background: #f3f3f3;
|
||||
border: 1px solid #ced4d9;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.switch-icon-publish {
|
||||
color: #1cb11c;
|
||||
.switch-label {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
float: left;
|
||||
width: 50%;
|
||||
line-height: 25px;
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
margin: 0 !important;
|
||||
}
|
||||
.switch-label:active {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.switch-label-off {
|
||||
padding-left: 2px;
|
||||
}
|
||||
|
||||
.switch-label-on {
|
||||
padding-right: 2px;
|
||||
}
|
||||
|
||||
.switch-input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.switch-input:checked + .switch-label {
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
transition: 0.15s ease-out;
|
||||
transition-property: color, text-shadow;
|
||||
}
|
||||
.switch-input:checked + .switch-label-on ~ .switch-selection {
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
.switch-selection {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 2px;
|
||||
left: 2px;
|
||||
display: block;
|
||||
width: 50%;
|
||||
height: 21px;
|
||||
border-radius: 2px;
|
||||
background-color: #6c757d;
|
||||
transition: left 0.15s ease-out;
|
||||
}
|
||||
|
|
1
bl-kernel/admin/themes/booty/css/chartist.min.css
vendored
Normal file
BIN
bl-kernel/admin/themes/booty/css/fonts/open-iconic.eot
Executable file
BIN
bl-kernel/admin/themes/booty/css/fonts/open-iconic.otf
Executable file
543
bl-kernel/admin/themes/booty/css/fonts/open-iconic.svg
Executable file
|
@ -0,0 +1,543 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<!--
|
||||
2014-7-1: Created.
|
||||
-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>
|
||||
Created by FontForge 20120731 at Tue Jul 1 20:39:22 2014
|
||||
By P.J. Onori
|
||||
Created by P.J. Onori with FontForge 2.0 (http://fontforge.sf.net)
|
||||
</metadata>
|
||||
<defs>
|
||||
<font id="open-iconic" horiz-adv-x="800" >
|
||||
<font-face
|
||||
font-family="Icons"
|
||||
font-weight="400"
|
||||
font-stretch="normal"
|
||||
units-per-em="800"
|
||||
panose-1="2 0 5 3 0 0 0 0 0 0"
|
||||
ascent="800"
|
||||
descent="0"
|
||||
bbox="-0.5 -101 802 800.126"
|
||||
underline-thickness="50"
|
||||
underline-position="-100"
|
||||
unicode-range="U+E000-E0DE"
|
||||
/>
|
||||
<missing-glyph />
|
||||
<glyph glyph-name="" unicode=""
|
||||
d="M300 700h500v-700h-500v100h400v500h-400v100zM400 500l200 -150l-200 -150v100h-400v100h400v100z" />
|
||||
<glyph glyph-name="1" unicode=""
|
||||
d="M300 700h500v-700h-500v100h400v500h-400v100zM200 500v-100h400v-100h-400v-100l-200 150z" />
|
||||
<glyph glyph-name="2" unicode=""
|
||||
d="M350 700c193 0 350 -157 350 -350v-50h100l-200 -200l-200 200h100v50c0 138 -112 250 -250 250s-250 -112 -250 -250c0 193 157 350 350 350z" />
|
||||
<glyph glyph-name="3" unicode=""
|
||||
d="M450 700c193 0 350 -157 350 -350c0 138 -112 250 -250 250s-250 -112 -250 -250v-50h100l-200 -200l-200 200h100v50c0 193 157 350 350 350z" />
|
||||
<glyph glyph-name="4" unicode=""
|
||||
d="M0 700h800v-100h-800v100zM100 500h600v-100h-600v100zM0 300h800v-100h-800v100zM100 100h600v-100h-600v100z" />
|
||||
<glyph glyph-name="5" unicode=""
|
||||
d="M0 700h800v-100h-800v100zM0 500h600v-100h-600v100zM0 300h800v-100h-800v100zM0 100h600v-100h-600v100z" />
|
||||
<glyph glyph-name="6" unicode=""
|
||||
d="M0 700h800v-100h-800v100zM200 500h600v-100h-600v100zM0 300h800v-100h-800v100zM200 100h600v-100h-600v100z" />
|
||||
<glyph glyph-name="7" unicode=""
|
||||
d="M400 700c75 0 146 -23 206 -59l-75 -225l-322 234c57 31 122 50 191 50zM125 588l191 -138l-310 -222c-4 24 -6 47 -6 72c0 114 49 215 125 288zM688 575c69 -72 112 -168 112 -275c0 -35 -8 -68 -16 -100h-218zM216 253l112 -347c-128 23 -232 109 -287 222zM372 100
|
||||
h372c-64 -109 -177 -185 -310 -197z" />
|
||||
<glyph glyph-name="8" unicode="" horiz-adv-x="600"
|
||||
d="M200 800h100v-500h200l-247 -300l-253 300h200v500z" />
|
||||
<glyph glyph-name="9" unicode=""
|
||||
d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM300 700v-300h-200l300 -300l300 300h-200v300h-200z" />
|
||||
<glyph glyph-name="a" unicode=""
|
||||
d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM400 700l-300 -300l300 -300v200h300v200h-300v200z" />
|
||||
<glyph glyph-name="b" unicode=""
|
||||
d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM400 700v-200h-300v-200h300v-200l300 300z" />
|
||||
<glyph glyph-name="c" unicode=""
|
||||
d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM400 700l-300 -300h200v-300h200v300h200z" />
|
||||
<glyph glyph-name="d" unicode=""
|
||||
d="M300 600v-200h500v-100h-500v-200l-300 247z" />
|
||||
<glyph glyph-name="e" unicode=""
|
||||
d="M500 600l300 -247l-300 -253v200h-500v100h500v200z" />
|
||||
<glyph glyph-name="f" unicode="" horiz-adv-x="600"
|
||||
d="M200 800h200v-500h200l-297 -300l-303 300h200v500z" />
|
||||
<glyph glyph-name="10" unicode=""
|
||||
d="M300 700v-200h500v-200h-500v-200l-300 297z" />
|
||||
<glyph glyph-name="11" unicode=""
|
||||
d="M500 700l300 -297l-300 -303v200h-500v200h500v200z" />
|
||||
<glyph glyph-name="12" unicode="" horiz-adv-x="600"
|
||||
d="M297 800l303 -300h-200v-500h-200v500h-200z" />
|
||||
<glyph glyph-name="13" unicode="" horiz-adv-x="600"
|
||||
d="M247 800l253 -300h-200v-500h-100v500h-200z" />
|
||||
<glyph glyph-name="14" unicode=""
|
||||
d="M400 800h100v-800h-100v800zM200 700h100v-600h-100v600zM600 600h100v-400h-100v400zM0 500h100v-200h-100v200z" />
|
||||
<glyph glyph-name="15" unicode=""
|
||||
d="M116 600l72 -72c-54 -54 -88 -126 -88 -209s34 -159 88 -213l-72 -72c-72 72 -116 175 -116 285s44 209 116 281zM684 600c72 -72 116 -171 116 -281s-44 -213 -116 -285l-72 72c54 54 88 130 88 213s-34 155 -88 209zM259 460l69 -72c-18 -18 -28 -41 -28 -69
|
||||
s10 -54 28 -72l-69 -72c-36 36 -59 89 -59 144s23 105 59 141zM541 459c36 -36 59 -85 59 -140s-23 -108 -59 -144l-69 72c18 18 28 44 28 72s-10 51 -28 69z" />
|
||||
<glyph glyph-name="16" unicode="" horiz-adv-x="400"
|
||||
d="M200 800c110 0 200 -90 200 -200s-90 -200 -200 -200s-200 90 -200 200s90 200 200 200zM100 319c31 -11 65 -19 100 -19s68 8 100 19v-319l-100 100l-100 -100v319z" />
|
||||
<glyph glyph-name="17" unicode=""
|
||||
d="M400 800c220 0 400 -180 400 -400s-180 -400 -400 -400s-400 180 -400 400s180 400 400 400zM400 700c-166 0 -300 -134 -300 -300c0 -66 21 -126 56 -175l419 419c-49 35 -109 56 -175 56zM644 575l-419 -419c49 -35 109 -56 175 -56c166 0 300 134 300 300
|
||||
c0 66 -21 126 -56 175z" />
|
||||
<glyph glyph-name="18" unicode=""
|
||||
d="M0 700h100v-600h700v-100h-800v700zM500 700h200v-500h-200v500zM200 500h200v-300h-200v300z" />
|
||||
<glyph glyph-name="19" unicode=""
|
||||
d="M397 800c13 1 23 -4 34 -13c2 -2 214 -254 241 -287h128v-100h-100v-366c0 -18 -16 -34 -34 -34h-532c-18 0 -34 16 -34 34v366h-100v100h128l234 281c9 11 22 18 35 19zM400 672l-144 -172h288zM250 300c-28 0 -50 -22 -50 -50v-100c0 -28 22 -50 50 -50s50 22 50 50
|
||||
v100c0 28 -22 50 -50 50zM550 300c-28 0 -50 -22 -50 -50v-100c0 -28 22 -50 50 -50s50 22 50 50v100c0 28 -22 50 -50 50z" />
|
||||
<glyph glyph-name="1a" unicode=""
|
||||
d="M9 700h682c6 0 9 -4 9 -10v-190h100v-200h-100v-191c0 -6 -3 -9 -9 -9h-682c-6 0 -9 3 -9 9v582c0 6 3 9 9 9zM100 600v-400h500v400h-500z" />
|
||||
<glyph glyph-name="1b" unicode=""
|
||||
d="M9 700h682c6 0 9 -4 9 -10v-190h100v-200h-100v-191c0 -6 -3 -9 -9 -9h-682c-6 0 -9 3 -9 9v582c0 6 3 9 9 9z" />
|
||||
<glyph glyph-name="1c" unicode=""
|
||||
d="M92 650c0 23 19 50 45 50h3h5h5h500c28 0 50 -22 50 -50s-22 -50 -50 -50h-50v-141c9 -17 120 -231 166 -309c16 -26 34 -61 34 -106c0 -39 -15 -77 -41 -103h-3c-26 -25 -62 -41 -100 -41h-512c-39 0 -77 15 -103 41s-41 64 -41 103c0 46 18 80 34 106
|
||||
c46 78 157 292 166 309v141h-50c-2 0 -6 -1 -8 -1c-28 0 -50 23 -50 51zM500 600h-200v-162l-6 -10s-63 -123 -119 -228h450c-56 105 -119 228 -119 228l-6 10v162z" />
|
||||
<glyph glyph-name="1d" unicode=""
|
||||
d="M400 800c110 0 200 -90 200 -200c0 -104 52 -198 134 -266c41 -34 66 -82 66 -134h-800c0 52 25 100 66 134c82 68 134 162 134 266c0 110 90 200 200 200zM300 100h200c0 -55 -45 -100 -100 -100s-100 45 -100 100z" />
|
||||
<glyph glyph-name="1e" unicode="" horiz-adv-x="600"
|
||||
d="M150 800h50l350 -250l-225 -147l225 -153l-350 -250h-50v250l-75 -75l-75 75l150 150l-150 150l75 75l75 -75v250zM250 650v-200l150 100zM250 350v-200l150 100z" />
|
||||
<glyph glyph-name="1f" unicode=""
|
||||
d="M0 800h500c110 0 200 -90 200 -200c0 -47 -17 -91 -44 -125c85 -40 144 -125 144 -225c0 -138 -112 -250 -250 -250h-550v100c55 0 100 45 100 100v400c0 55 -45 100 -100 100v100zM300 700v-200h100c55 0 100 45 100 100s-45 100 -100 100h-100zM300 400v-300h150
|
||||
c83 0 150 67 150 150s-67 150 -150 150h-150z" />
|
||||
<glyph glyph-name="20" unicode="" horiz-adv-x="600"
|
||||
d="M300 800v-300h200l-300 -500v300h-200z" />
|
||||
<glyph glyph-name="21" unicode=""
|
||||
d="M100 800h300v-300l100 100l100 -100v300h50c28 0 50 -22 50 -50v-550h-550c-28 0 -50 -22 -50 -50s22 -50 50 -50h550v-100h-550c-83 0 -150 67 -150 150v550l3 19c8 39 39 70 78 78z" />
|
||||
<glyph glyph-name="22" unicode="" horiz-adv-x="400"
|
||||
d="M0 800h400v-800l-200 200l-200 -200v800z" />
|
||||
<glyph glyph-name="23" unicode=""
|
||||
d="M0 800h800v-100h-800v100zM0 600h300v-103h203v103h297v-591c0 -6 -3 -9 -9 -9h-782c-6 0 -9 3 -9 9v591z" />
|
||||
<glyph glyph-name="24" unicode=""
|
||||
d="M300 800h200c55 0 100 -45 100 -100v-100h191c6 0 9 -3 9 -9v-241c0 -28 -22 -50 -50 -50h-700c-28 0 -50 22 -50 50v241c0 6 3 9 9 9h191v100c0 55 45 100 100 100zM300 700v-100h200v100h-200zM0 209c16 -6 32 -9 50 -9h700c18 0 34 3 50 9v-200c0 -6 -3 -9 -9 -9h-782
|
||||
c-6 0 -9 3 -9 9v200z" />
|
||||
<glyph glyph-name="25" unicode="" horiz-adv-x="600"
|
||||
d="M300 800c58 0 110 -16 147 -53s53 -89 53 -147h-100c0 39 -11 61 -25 75s-36 25 -75 25c-35 0 -55 -10 -72 -31s-28 -55 -28 -94c0 -51 20 -107 28 -175h172v-100h-178c-14 -60 -49 -127 -113 -200h491v-100h-600v122l16 12c69 69 95 121 106 166h-122v100h125
|
||||
c-8 50 -25 106 -25 175c0 58 16 114 50 156c34 43 88 69 150 69z" />
|
||||
<glyph glyph-name="26" unicode=""
|
||||
d="M34 700h4h3h4h5h700c28 0 50 -22 50 -50v-700c0 -28 -22 -50 -50 -50h-700c-28 0 -50 22 -50 50v700v2c0 20 15 42 34 48zM150 600c-28 0 -50 -22 -50 -50s22 -50 50 -50s50 22 50 50s-22 50 -50 50zM350 600c-28 0 -50 -22 -50 -50s22 -50 50 -50h300c28 0 50 22 50 50
|
||||
s-22 50 -50 50h-300zM100 400v-400h600v400h-600z" />
|
||||
<glyph glyph-name="27" unicode=""
|
||||
d="M744 797l6 -3l44 -44c4 -4 3 -8 0 -12l-266 -375l-15 -13l-25 -12c-23 72 -78 127 -150 150l12 25l13 15l375 266zM266 400c74 0 134 -60 134 -134c0 -147 -119 -266 -266 -266c-48 0 -95 12 -134 34c80 46 134 133 134 232c0 74 58 134 132 134z" />
|
||||
<glyph glyph-name="28" unicode=""
|
||||
d="M9 451c0 23 19 50 46 50c8 0 19 -3 26 -7l131 -66l29 22c-79 81 -1 250 118 250s197 -167 119 -250l28 -22l131 66c6 4 12 7 21 7c28 0 50 -22 50 -50c0 -17 -12 -37 -27 -45l-115 -56c9 -16 19 -33 25 -50h68c28 0 50 -22 50 -50s-22 -50 -50 -50h-50
|
||||
c0 -23 -2 -45 -6 -66l78 -40c21 -5 37 -28 37 -49c0 -28 -22 -50 -50 -50c-10 0 -23 5 -31 11l-65 35c-24 -46 -62 -86 -103 -110c-35 19 -60 45 -60 72v135v4v5v6v5v5v87c0 28 -22 50 -50 50c-24 0 -45 -17 -50 -40c1 -3 1 -8 1 -11s0 -8 -1 -11v-82v-4v-5v-144
|
||||
c0 -28 -24 -53 -59 -72c-41 25 -79 64 -103 110l-66 -35c-8 -6 -21 -11 -31 -11c-28 0 -50 22 -50 50c0 21 16 44 37 49l78 40c-4 21 -6 43 -6 66h-50h-5c-28 0 -50 22 -50 50c0 26 22 50 50 50h5h69c6 17 16 34 25 50l-116 56c-16 7 -28 27 -28 45z" />
|
||||
<glyph glyph-name="29" unicode=""
|
||||
d="M600 700h91c6 0 9 -3 9 -9v-582c0 -6 -3 -9 -9 -9h-91v600zM210 503l290 147v-500l-250 125v-3c-15 0 -25 -8 -28 -22l75 -178c11 -25 0 -58 -25 -69s-58 0 -69 25l-103 272h-91c-6 0 -9 3 -9 9v182c0 6 3 9 9 9h182z" />
|
||||
<glyph glyph-name="2a" unicode=""
|
||||
d="M9 800h682c6 0 9 -3 9 -9v-782c0 -6 -3 -9 -9 -9h-682c-6 0 -9 3 -9 9v782c0 6 3 9 9 9zM100 700v-200h500v200h-500zM100 400v-100h100v100h-100zM300 400v-100h100v100h-100zM500 400v-300h100v300h-100zM100 200v-100h100v100h-100zM300 200v-100h100v100h-100z" />
|
||||
<glyph glyph-name="2b" unicode=""
|
||||
d="M0 800h700v-200h-700v200zM0 500h700v-491c0 -6 -3 -9 -9 -9h-682c-6 0 -9 3 -9 9v491zM100 400v-100h100v100h-100zM300 400v-100h100v100h-100zM500 400v-100h100v100h-100zM100 200v-100h100v100h-100zM300 200v-100h100v100h-100z" />
|
||||
<glyph glyph-name="2c" unicode=""
|
||||
d="M409 800h182c6 0 10 -4 12 -9l94 -182c2 -5 6 -9 12 -9h82c6 0 9 -3 9 -9v-582c0 -6 -3 -9 -9 -9h-782c-6 0 -9 3 -9 9v441c0 83 67 150 150 150h141c6 0 10 4 12 9l94 182c2 5 6 9 12 9zM150 500c-28 0 -50 -22 -50 -50s22 -50 50 -50s50 22 50 50s-22 50 -50 50z
|
||||
M500 500c-110 0 -200 -90 -200 -200s90 -200 200 -200s200 90 200 200s-90 200 -200 200zM500 400c55 0 100 -45 100 -100s-45 -100 -100 -100s-100 45 -100 100s45 100 100 100z" />
|
||||
<glyph glyph-name="2d" unicode=""
|
||||
d="M0 600h800l-400 -400z" />
|
||||
<glyph glyph-name="2e" unicode="" horiz-adv-x="400"
|
||||
d="M400 800v-800l-400 400z" />
|
||||
<glyph glyph-name="2f" unicode="" horiz-adv-x="400"
|
||||
d="M0 800l400 -400l-400 -400v800z" />
|
||||
<glyph glyph-name="30" unicode=""
|
||||
d="M400 600l400 -400h-800z" />
|
||||
<glyph glyph-name="31" unicode=""
|
||||
d="M0 550c0 23 20 50 46 50h3h5h4h200c17 0 37 -13 44 -28l38 -72h444c14 0 19 -12 15 -25l-81 -250c-4 -13 -21 -25 -35 -25h-350c-14 0 -30 12 -34 25c-27 83 -54 167 -81 250l-10 25h-150c-2 0 -5 -1 -7 -1c-28 0 -51 23 -51 51zM358 100c28 0 50 -22 50 -50
|
||||
s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM658 100c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50z" />
|
||||
<glyph glyph-name="32" unicode=""
|
||||
d="M0 700h500v-100h-300v-300h-100l-100 -100v500zM300 500h500v-500l-100 100h-400v400z" />
|
||||
<glyph glyph-name="33" unicode=""
|
||||
d="M641 700l143 -141l-493 -493c-71 76 -146 148 -219 222l-72 71l141 141c50 -51 101 -101 153 -150c116 117 234 231 347 350z" />
|
||||
<glyph glyph-name="34" unicode=""
|
||||
d="M150 600l250 -250l250 250l150 -150l-400 -400l-400 400z" />
|
||||
<glyph glyph-name="35" unicode="" horiz-adv-x="600"
|
||||
d="M400 800l150 -150l-250 -250l250 -250l-150 -150l-400 400z" />
|
||||
<glyph glyph-name="36" unicode="" horiz-adv-x="600"
|
||||
d="M150 800l400 -400l-400 -400l-150 150l250 250l-250 250z" />
|
||||
<glyph glyph-name="37" unicode=""
|
||||
d="M400 600l400 -400l-150 -150l-250 250l-250 -250l-150 150z" />
|
||||
<glyph glyph-name="38" unicode=""
|
||||
d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM600 622l-250 -250l-100 100l-72 -72l172 -172l322 322z" />
|
||||
<glyph glyph-name="39" unicode=""
|
||||
d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM250 622l-72 -72l150 -150l-150 -150l72 -72l150 150l150 -150l72 72l-150 150l150 150l-72 72l-150 -150z" />
|
||||
<glyph glyph-name="3a" unicode=""
|
||||
d="M350 800c28 0 50 -22 50 -50v-50h75c14 0 25 -11 25 -25v-75h-300v75c0 14 11 25 25 25h75v50c0 28 22 50 50 50zM25 700h75v-200h500v200h75c14 0 25 -11 25 -25v-650c0 -14 -11 -25 -25 -25h-650c-14 0 -25 11 -25 25v650c0 14 11 25 25 25z" />
|
||||
<glyph glyph-name="3b" unicode=""
|
||||
d="M400 800c220 0 400 -180 400 -400s-180 -400 -400 -400s-400 180 -400 400s180 400 400 400zM400 700c-166 0 -300 -134 -300 -300s134 -300 300 -300s300 134 300 300s-134 300 -300 300zM350 600h100v-181c23 -24 47 -47 72 -69l-72 -72c-27 30 -55 59 -84 88l-16 12
|
||||
v222z" />
|
||||
<glyph glyph-name="3c" unicode=""
|
||||
d="M450 800c138 0 250 -112 250 -250v-50c58 -21 100 -85 100 -150c0 -18 -3 -34 -9 -50h-191v50c0 83 -67 150 -150 150s-150 -67 -150 -150v-50h-272c-17 30 -28 63 -28 100c0 110 90 200 200 200c23 114 129 200 250 200zM434 400h3h4c3 0 6 1 9 1c28 0 50 -22 50 -50v-1
|
||||
v-150h150l-200 -200l-200 200h150v150v2c0 20 15 42 34 48z" />
|
||||
<glyph glyph-name="3d" unicode=""
|
||||
d="M450 800c138 0 250 -112 250 -250v-50c58 -21 100 -85 100 -150c0 -18 -3 -34 -9 -50h-141l-200 200l-200 -200h-222c-17 30 -28 63 -28 100c0 110 90 200 200 200c23 114 129 200 250 200zM450 350l250 -250h-200v-50c0 -28 -22 -50 -50 -50s-50 22 -50 50v50h-200z" />
|
||||
<glyph glyph-name="3e" unicode=""
|
||||
d="M450 700c138 0 250 -112 250 -250v-50c58 -21 100 -85 100 -150c0 -83 -67 -150 -150 -150h-450c-110 0 -200 90 -200 200s90 200 200 200c23 114 129 200 250 200z" />
|
||||
<glyph glyph-name="3f" unicode=""
|
||||
d="M250 800c82 0 154 -40 200 -100c-143 0 -270 -85 -325 -209c-36 -10 -70 -25 -100 -47c-16 33 -25 67 -25 106c0 138 112 250 250 250zM450 600c138 0 250 -112 250 -250v-50c58 -21 100 -85 100 -150c0 -83 -67 -150 -150 -150h-450c-110 0 -200 90 -200 200
|
||||
s90 200 200 200c23 114 129 200 250 200z" />
|
||||
<glyph glyph-name="40" unicode=""
|
||||
d="M500 700h100l-300 -600h-100zM100 600h100l-100 -200l100 -200h-100l-100 200zM600 600h100l100 -200l-100 -200h-100l100 200z" />
|
||||
<glyph glyph-name="41" unicode=""
|
||||
d="M350 800h100l50 -119l28 -12l119 50l72 -72l-50 -119l12 -28l119 -50v-100l-119 -50l-12 -28l50 -119l-72 -72l-119 50l-28 -12l-50 -119h-100l-50 119l-28 12l-119 -50l-72 72l50 119l-12 28l-119 50v100l119 50l12 28l-50 119l72 72l119 -50l28 12zM400 550
|
||||
c-83 0 -150 -67 -150 -150s67 -150 150 -150s150 67 150 150s-67 150 -150 150z" />
|
||||
<glyph glyph-name="42" unicode=""
|
||||
d="M0 800h800v-200h-800v200zM200 500h400l-200 -200zM0 100h800v-100h-800v100z" />
|
||||
<glyph glyph-name="43" unicode=""
|
||||
d="M0 800h100v-800h-100v800zM600 800h200v-800h-200v800zM500 600v-400l-200 200z" />
|
||||
<glyph glyph-name="44" unicode=""
|
||||
d="M0 800h200v-800h-200v800zM700 800h100v-800h-100v800zM300 600l200 -200l-200 -200v400z" />
|
||||
<glyph glyph-name="45" unicode=""
|
||||
d="M0 800h800v-100h-800v100zM400 500l200 -200h-400zM0 200h800v-200h-800v200z" />
|
||||
<glyph glyph-name="46" unicode=""
|
||||
d="M150 700c83 0 150 -67 150 -150v-50h100v50c0 83 67 150 150 150s150 -67 150 -150s-67 -150 -150 -150h-50v-100h50c83 0 150 -67 150 -150s-67 -150 -150 -150s-150 67 -150 150v50h-100v-50c0 -83 -67 -150 -150 -150s-150 67 -150 150s67 150 150 150h50v100h-50
|
||||
c-83 0 -150 67 -150 150s67 150 150 150zM150 600c-28 0 -50 -22 -50 -50s22 -50 50 -50h50v50c0 28 -22 50 -50 50zM550 600c-28 0 -50 -22 -50 -50v-50h50c28 0 50 22 50 50s-22 50 -50 50zM300 400v-100h100v100h-100zM150 200c-28 0 -50 -22 -50 -50s22 -50 50 -50
|
||||
s50 22 50 50v50h-50zM500 200v-50c0 -28 22 -50 50 -50s50 22 50 50s-22 50 -50 50h-50z" />
|
||||
<glyph glyph-name="47" unicode=""
|
||||
d="M0 791c0 5 4 9 9 9h782c6 0 9 -4 9 -10v-790l-200 200h-591c-6 0 -9 3 -9 9v582z" />
|
||||
<glyph glyph-name="48" unicode=""
|
||||
d="M400 800c220 0 400 -180 400 -400s-180 -400 -400 -400s-400 180 -400 400s180 400 400 400zM400 700c-166 0 -300 -134 -300 -300s134 -300 300 -300s300 134 300 300s-134 300 -300 300zM600 600l-100 -300l-300 -100l100 300zM400 450c-28 0 -50 -22 -50 -50
|
||||
s22 -50 50 -50s50 22 50 50s-22 50 -50 50z" />
|
||||
<glyph glyph-name="49" unicode=""
|
||||
d="M400 800c220 0 400 -180 400 -400s-180 -400 -400 -400s-400 180 -400 400s180 400 400 400zM400 700v-600c166 0 300 134 300 300s-134 300 -300 300z" />
|
||||
<glyph glyph-name="4a" unicode=""
|
||||
d="M0 800h800v-100h-800v100zM0 600h500v-100h-500v100zM0 300h800v-100h-800v100zM0 100h600v-100h-600v100zM750 100c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50z" />
|
||||
<glyph glyph-name="4b" unicode=""
|
||||
d="M25 700h750c14 0 25 -11 25 -25v-75h-800v75c0 14 11 25 25 25zM0 500h800v-375c0 -14 -11 -25 -25 -25h-750c-14 0 -25 11 -25 25v375zM100 300v-100h100v100h-100zM300 300v-100h100v100h-100z" />
|
||||
<glyph glyph-name="4c" unicode=""
|
||||
d="M100 800h100v-100h450l100 100l50 -50l-100 -100v-450h100v-100h-100v-100h-100v100h-500v500h-100v100h100v100zM200 600v-350l350 350h-350zM600 550l-350 -350h350v350z" />
|
||||
<glyph glyph-name="4d" unicode=""
|
||||
d="M400 800c220 0 400 -180 400 -400s-180 -400 -400 -400s-400 180 -400 400s180 400 400 400zM400 700c-166 0 -300 -134 -300 -300s134 -300 300 -300s300 134 300 300s-134 300 -300 300zM400 600c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50z
|
||||
M200 452c0 20 15 42 34 48h3h3h8c12 0 28 -7 36 -16l91 -90l25 6c55 0 100 -45 100 -100s-45 -100 -100 -100s-100 45 -100 100l6 25l-90 91c-9 8 -16 24 -16 36zM550 500c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50z" />
|
||||
<glyph glyph-name="4e" unicode=""
|
||||
d="M300 800h200v-300h200l-300 -300l-300 300h200v300zM0 100h800v-100h-800v100z" />
|
||||
<glyph glyph-name="4f" unicode=""
|
||||
d="M0 800h800v-100h-800v100zM400 600l300 -300h-200v-300h-200v300h-200z" />
|
||||
<glyph glyph-name="50" unicode=""
|
||||
d="M200 700h600v-600h-600l-200 300zM350 622l-72 -72l150 -150l-150 -150l72 -72l150 150l150 -150l72 72l-150 150l150 150l-72 72l-150 -150z" />
|
||||
<glyph glyph-name="51" unicode=""
|
||||
d="M400 700c220 0 400 -180 400 -400h-100c0 166 -134 300 -300 300s-300 -134 -300 -300h-100c0 220 180 400 400 400zM341 491l59 -88l59 88c81 -25 141 -101 141 -191c0 -110 -90 -200 -200 -200s-200 90 -200 200c0 90 60 166 141 191z" />
|
||||
<glyph glyph-name="52" unicode=""
|
||||
d="M0 800h300v-400h400v-400h-700v800zM400 800l300 -300h-300v300zM100 600v-100h100v100h-100zM100 400v-100h100v100h-100zM100 200v-100h400v100h-400z" />
|
||||
<glyph glyph-name="53" unicode="" horiz-adv-x="600"
|
||||
d="M200 700h100v-100h75c30 0 58 -6 81 -22s44 -44 44 -78v-100h-100v94c-4 3 -13 6 -25 6h-250c-14 0 -25 -11 -25 -25v-50c0 -15 20 -40 34 -44l257 -65c66 -16 109 -73 109 -141v-50c0 -68 -57 -125 -125 -125h-75v-100h-100v100h-75c-30 0 -58 6 -81 22s-44 44 -44 78
|
||||
v100h100v-94c4 -3 13 -6 25 -6h250c14 0 25 11 25 25v50c0 15 -20 40 -34 44l-257 65c-66 16 -109 73 -109 141v50c0 68 57 125 125 125h75v100z" />
|
||||
<glyph glyph-name="54" unicode=""
|
||||
d="M0 700h300v-300l-300 -300v600zM500 700h300v-300l-300 -300v600z" />
|
||||
<glyph glyph-name="55" unicode=""
|
||||
d="M300 700v-600h-300v300zM800 700v-600h-300v300z" />
|
||||
<glyph glyph-name="56" unicode=""
|
||||
d="M300 700v-100c-111 0 -200 -89 -200 -200h200v-300h-300v300c0 165 135 300 300 300zM800 700v-100c-111 0 -200 -89 -200 -200h200v-300h-300v300c0 165 135 300 300 300z" />
|
||||
<glyph glyph-name="57" unicode=""
|
||||
d="M0 700h300v-300c0 -165 -135 -300 -300 -300v100c111 0 200 89 200 200h-200v300zM500 700h300v-300c0 -165 -135 -300 -300 -300v100c111 0 200 89 200 200h-200v300z" />
|
||||
<glyph glyph-name="58" unicode="" horiz-adv-x="600"
|
||||
d="M300 800l34 -34c11 -11 266 -270 266 -488c0 -165 -135 -300 -300 -300s-300 135 -300 300c0 218 255 477 266 488zM150 328c-28 0 -50 -22 -50 -50c0 -110 90 -200 200 -200c28 0 50 22 50 50s-22 50 -50 50c-55 0 -100 45 -100 100c0 28 -22 50 -50 50z" />
|
||||
<glyph glyph-name="59" unicode=""
|
||||
d="M400 800l400 -500h-800zM0 200h800v-200h-800v200z" />
|
||||
<glyph glyph-name="5a" unicode="" horiz-adv-x="600"
|
||||
d="M300 800l300 -300h-600zM0 300h600l-300 -300z" />
|
||||
<glyph glyph-name="5b" unicode=""
|
||||
d="M0 500h200v-200h-200v200zM300 500h200v-200h-200v200zM600 500h200v-200h-200v200z" />
|
||||
<glyph glyph-name="5c" unicode=""
|
||||
d="M0 700h800v-100l-400 -200l-400 200v100zM0 500l400 -200l400 200v-400h-800v400z" />
|
||||
<glyph glyph-name="5d" unicode=""
|
||||
d="M400 800l400 -200v-600h-800v600zM400 688l-300 -150v-188l300 -150l300 150v188zM200 500h400v-100l-200 -100l-200 100v100z" />
|
||||
<glyph glyph-name="5e" unicode=""
|
||||
d="M600 700c69 0 134 -19 191 -50l-16 -106c-49 35 -109 56 -175 56c-131 0 -240 -84 -281 -200h331l-16 -100h-334c0 -36 8 -68 19 -100h297l-16 -100h-222c55 -61 133 -100 222 -100c78 0 147 30 200 78v-122c-59 -35 -127 -56 -200 -56c-147 0 -274 82 -344 200h-256
|
||||
l19 100h197c-8 32 -16 66 -16 100h-200l25 100h191c45 172 198 300 384 300z" />
|
||||
<glyph glyph-name="5f" unicode=""
|
||||
d="M0 700h700v-100h-700v100zM0 500h500v-100h-500v100zM0 300h800v-100h-800v100zM0 100h100v-100h-100v100zM200 100h100v-100h-100v100zM400 100h100v-100h-100v100z" />
|
||||
<glyph glyph-name="60" unicode=""
|
||||
d="M0 800h800v-100h-800v100zM200 600h400l-200 -200zM0 200h800v-200h-800v200z" />
|
||||
<glyph glyph-name="61" unicode=""
|
||||
d="M0 800h100v-800h-100v800zM600 800h200v-800h-200v800zM200 600l200 -200l-200 -200v400z" />
|
||||
<glyph glyph-name="62" unicode=""
|
||||
d="M0 800h200v-800h-200v800zM700 800h100v-800h-100v800zM600 600v-400l-200 200z" />
|
||||
<glyph glyph-name="63" unicode=""
|
||||
d="M0 800h800v-200h-800v200zM400 400l200 -200h-400zM0 100h800v-100h-800v100z" />
|
||||
<glyph glyph-name="64" unicode=""
|
||||
d="M0 800h200v-100h-100v-600h600v100h100v-200h-800v800zM400 800h400v-400l-150 150l-250 -250l-100 100l250 250z" />
|
||||
<glyph glyph-name="65" unicode=""
|
||||
d="M403 700c247 0 397 -300 397 -300s-150 -300 -397 -300c-253 0 -403 300 -403 300s150 300 403 300zM400 600c-110 0 -200 -90 -200 -200s90 -200 200 -200s200 90 200 200s-90 200 -200 200zM400 500c10 0 19 -3 28 -6c-16 -8 -28 -24 -28 -44c0 -28 22 -50 50 -50
|
||||
c20 0 36 12 44 28c3 -9 6 -18 6 -28c0 -55 -45 -100 -100 -100s-100 45 -100 100s45 100 100 100z" />
|
||||
<glyph glyph-name="66" unicode="" horiz-adv-x="900"
|
||||
d="M331 700h3h3c3 1 7 1 10 1c12 0 29 -8 37 -17l94 -93l66 65c57 57 155 57 212 0c58 -58 58 -154 0 -212l-65 -66l93 -94c10 -8 18 -25 18 -38c0 -28 -22 -50 -50 -50c-13 0 -32 9 -40 20l-62 65l-381 -381h-269v272l375 381l-63 63c-9 8 -16 24 -16 36c0 20 16 42 35 48z
|
||||
M447 481l-313 -315l128 -132l316 316z" />
|
||||
<glyph glyph-name="67" unicode=""
|
||||
d="M0 800h300v-400h400v-400h-700v800zM400 800l300 -300h-300v300z" />
|
||||
<glyph glyph-name="68" unicode=""
|
||||
d="M200 800c0 0 200 -100 200 -300s-298 -302 -200 -500c0 0 -200 100 -200 300s300 300 200 500zM500 500c0 0 200 -100 200 -300c0 -150 -60 -200 -100 -200h-300c0 200 300 300 200 500z" />
|
||||
<glyph glyph-name="69" unicode=""
|
||||
d="M0 800h100v-800h-100v800zM200 800h300v-100h300l-200 -203l200 -197h-400v100h-200v400z" />
|
||||
<glyph glyph-name="6a" unicode="" horiz-adv-x="400"
|
||||
d="M150 800h150l-100 -200h200l-150 -300h150l-300 -300l-100 300h134l66 200h-200z" />
|
||||
<glyph glyph-name="6b" unicode=""
|
||||
d="M0 800h300v-100h500v-100h-800v200zM0 500h800v-450c0 -28 -22 -50 -50 -50h-700c-28 0 -50 22 -50 50v450z" />
|
||||
<glyph glyph-name="6c" unicode=""
|
||||
d="M150 800c83 0 150 -67 150 -150c0 -66 -41 -121 -100 -141v-118c15 5 33 9 50 9h200c28 0 50 22 50 50v59c-59 20 -100 75 -100 141c0 83 67 150 150 150s150 -67 150 -150c0 -66 -41 -121 -100 -141v-59c0 -82 -68 -150 -150 -150h-200c-14 0 -25 -7 -34 -16
|
||||
c50 -24 84 -74 84 -134c0 -83 -67 -150 -150 -150s-150 67 -150 150c0 66 41 121 100 141v218c-59 20 -100 75 -100 141c0 83 67 150 150 150z" />
|
||||
<glyph glyph-name="6d" unicode=""
|
||||
d="M0 800h400l-150 -150l150 -150l-100 -100l-150 150l-150 -150v400zM500 400l150 -150l150 150v-400h-400l150 150l-150 150z" />
|
||||
<glyph glyph-name="6e" unicode=""
|
||||
d="M100 800l150 -150l150 150v-400h-400l150 150l-150 150zM400 400h400l-150 -150l150 -150l-100 -100l-150 150l-150 -150v400z" />
|
||||
<glyph glyph-name="6f" unicode=""
|
||||
d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM400 700c-56 0 -108 -17 -153 -44l22 -19c33 -18 13 -48 -13 -59c-30 -13 -77 10 -65 -41c13 -55 -27 -3 -47 -15c-42 -26 49 -152 31 -156l-59 34c-8 0 -13 -5 -16 -10
|
||||
c1 -30 10 -57 19 -84c28 -11 77 -2 100 -25c47 -28 97 -115 75 -159c34 -13 68 -22 106 -22c101 0 193 48 247 125c3 24 -8 44 -50 44c-69 0 -156 13 -153 97c2 46 101 108 66 143c-30 30 12 39 12 66c0 37 -65 32 -69 50s20 36 41 56c-30 10 -60 19 -94 19zM631 591
|
||||
c-38 -11 -94 -35 -87 -53c6 -15 52 -1 65 -13c11 -10 16 -59 44 -31l22 22v3c-11 26 -26 50 -44 72z" />
|
||||
<glyph glyph-name="70" unicode=""
|
||||
d="M703 800l97 -100l-400 -400l-100 100l-200 -203l-100 100l300 303l100 -100zM0 100h800v-100h-800v100z" />
|
||||
<glyph glyph-name="71" unicode=""
|
||||
d="M0 700h100v-100h-100v100zM200 700h100v-100h-100v100zM400 700h100v-100h-100v100zM600 700h100v-100h-100v100zM0 500h100v-100h-100v100zM200 500h100v-100h-100v100zM400 500h100v-100h-100v100zM600 500h100v-100h-100v100zM0 300h100v-100h-100v100zM200 300h100
|
||||
v-100h-100v100zM400 300h100v-100h-100v100zM600 300h100v-100h-100v100zM0 100h100v-100h-100v100zM200 100h100v-100h-100v100zM400 100h100v-100h-100v100zM600 100h100v-100h-100v100z" />
|
||||
<glyph glyph-name="72" unicode=""
|
||||
d="M0 800h200v-200h-200v200zM300 800h200v-200h-200v200zM600 800h200v-200h-200v200zM0 500h200v-200h-200v200zM300 500h200v-200h-200v200zM600 500h200v-200h-200v200zM0 200h200v-200h-200v200zM300 200h200v-200h-200v200zM600 200h200v-200h-200v200z" />
|
||||
<glyph glyph-name="73" unicode=""
|
||||
d="M0 800h300v-300h-300v300zM500 800h300v-300h-300v300zM0 300h300v-300h-300v300zM500 300h300v-300h-300v300z" />
|
||||
<glyph glyph-name="74" unicode=""
|
||||
d="M19 800h662c11 0 19 -8 19 -19v-331c0 -28 -22 -50 -50 -50h-600c-28 0 -50 22 -50 50v331c0 11 8 19 19 19zM0 309c16 -6 32 -9 50 -9h600c18 0 34 3 50 9v-290c0 -11 -8 -19 -19 -19h-662c-11 0 -19 8 -19 19v290zM550 200c-28 0 -50 -22 -50 -50s22 -50 50 -50
|
||||
s50 22 50 50s-22 50 -50 50z" />
|
||||
<glyph glyph-name="75" unicode=""
|
||||
d="M0 700h300v-100h-50c-28 0 -50 -22 -50 -50v-150h300v150c0 28 -22 50 -50 50h-50v100h300v-100h-50c-28 0 -50 -22 -50 -50v-400c0 -28 22 -50 50 -50h50v-100h-300v100h50c28 0 50 22 50 50v150h-300v-150c0 -28 22 -50 50 -50h50v-100h-300v100h50c28 0 50 22 50 50
|
||||
v400c0 28 -22 50 -50 50h-50v100z" />
|
||||
<glyph glyph-name="76" unicode=""
|
||||
d="M400 700c165 0 300 -135 300 -300v-100h50c28 0 50 -22 50 -50v-200c0 -28 -22 -50 -50 -50h-100c-28 0 -50 22 -50 50v350c0 111 -89 200 -200 200s-200 -89 -200 -200v-350c0 -28 -22 -50 -50 -50h-100c-28 0 -50 22 -50 50v200c0 28 22 50 50 50h50v100
|
||||
c0 165 135 300 300 300z" />
|
||||
<glyph glyph-name="77" unicode=""
|
||||
d="M0 500c0 109 91 200 200 200s200 -91 200 -200c0 109 91 200 200 200s200 -91 200 -200c0 -55 -23 -105 -59 -141l-341 -340l-341 340c-36 36 -59 86 -59 141z" />
|
||||
<glyph glyph-name="78" unicode=""
|
||||
d="M400 700l400 -300l-100 3v-403h-200v200h-200v-200h-200v400h-100z" />
|
||||
<glyph glyph-name="79" unicode=""
|
||||
d="M0 800h800v-800h-800v800zM100 700v-300l100 100l400 -400h100v100l-200 200l100 100l100 -100v300h-600z" />
|
||||
<glyph glyph-name="7a" unicode=""
|
||||
d="M19 800h762c11 0 19 -8 19 -19v-762c0 -11 -8 -19 -19 -19h-762c-11 0 -19 8 -19 19v762c0 11 8 19 19 19zM100 600v-300h100l100 -100h200l100 100h100v300h-600z" />
|
||||
<glyph glyph-name="7b" unicode=""
|
||||
d="M200 600c80 0 142 -56 200 -122c58 66 119 122 200 122c131 0 200 -101 200 -200s-69 -200 -200 -200c-81 0 -142 56 -200 122c-58 -66 -121 -122 -200 -122c-131 0 -200 101 -200 200s69 200 200 200zM200 500c-74 0 -100 -54 -100 -100s26 -100 100 -100
|
||||
c42 0 88 47 134 100c-46 53 -92 100 -134 100zM600 500c-43 0 -88 -47 -134 -100c46 -53 91 -100 134 -100c74 0 100 54 100 100s-26 100 -100 100z" />
|
||||
<glyph glyph-name="7c" unicode="" horiz-adv-x="400"
|
||||
d="M300 800c55 0 100 -45 100 -100s-45 -100 -100 -100s-100 45 -100 100s45 100 100 100zM150 550c83 0 150 -69 150 -150c0 -66 -100 -214 -100 -250c0 -28 22 -50 50 -50s50 22 50 50h100c0 -83 -67 -150 -150 -150s-150 64 -150 150s100 222 100 250s-22 50 -50 50
|
||||
s-50 -22 -50 -50h-100c0 83 67 150 150 150z" />
|
||||
<glyph glyph-name="7d" unicode=""
|
||||
d="M200 800h500v-100h-122c-77 -197 -156 -392 -234 -588l-6 -12h162v-100h-500v100h122c77 197 156 392 234 588l7 12h-163v100z" />
|
||||
<glyph glyph-name="7e" unicode=""
|
||||
d="M0 700h800v-100h-800v100zM0 500h800v-100h-800v100zM0 300h800v-100h-800v100zM100 100h600v-100h-600v100z" />
|
||||
<glyph glyph-name="7f" unicode=""
|
||||
d="M0 700h800v-100h-800v100zM0 500h800v-100h-800v100zM0 300h800v-100h-800v100zM0 100h600v-100h-600v100z" />
|
||||
<glyph glyph-name="80" unicode=""
|
||||
d="M0 700h800v-100h-800v100zM0 500h800v-100h-800v100zM0 300h800v-100h-800v100zM200 100h600v-100h-600v100z" />
|
||||
<glyph glyph-name="81" unicode=""
|
||||
d="M550 800c138 0 250 -112 250 -250s-112 -250 -250 -250c-16 0 -32 0 -47 3l-3 -3v-100h-200v-200h-300v200l303 303c-3 15 -3 31 -3 47c0 138 112 250 250 250zM600 700c-55 0 -100 -45 -100 -100s45 -100 100 -100s100 45 100 100s-45 100 -100 100z" />
|
||||
<glyph glyph-name="82" unicode=""
|
||||
d="M134 600h3h4h4h5h500c28 0 50 -22 50 -50v-350h100v-150c0 -28 -22 -50 -50 -50h-700c-28 0 -50 22 -50 50v150h100v350v2c0 20 15 42 34 48zM200 500v-300h100v-100h200v100h100v300h-400z" />
|
||||
<glyph glyph-name="83" unicode=""
|
||||
d="M0 800h400v-400h-400v400zM500 600h100v-400h-400v100h300v300zM700 400h100v-400h-400v100h300v300z" />
|
||||
<glyph glyph-name="84" unicode="" horiz-adv-x="600"
|
||||
d="M337 694c6 4 12 7 21 7c28 0 50 -22 50 -50c0 -17 -12 -37 -27 -45l-300 -150c-8 -6 -21 -11 -31 -11c-28 0 -50 22 -50 50c0 21 16 44 37 49zM437 544c6 4 12 7 21 7c28 0 50 -22 50 -50c0 -17 -12 -37 -27 -45l-400 -200c-8 -6 -21 -11 -31 -11c-28 0 -50 22 -50 50
|
||||
c0 21 16 44 37 49zM437 344c6 4 12 7 21 7c28 0 50 -22 50 -50c0 -17 -12 -37 -27 -45l-106 -56c24 -4 43 -26 43 -50c0 -28 -23 -51 -51 -51c-2 0 -6 1 -8 1h-200c-26 1 -48 24 -48 50c0 16 12 36 26 44zM151 -50c0 23 20 50 46 50h3h4h5h100c28 0 50 -22 50 -50
|
||||
s-22 -50 -50 -50h-100c-2 0 -6 -1 -8 -1c-28 0 -50 23 -50 51z" />
|
||||
<glyph glyph-name="85" unicode=""
|
||||
d="M199 800h100v-200h-200v100h100v100zM586 797h1c18 1 38 1 56 -3c36 -8 69 -26 97 -54c78 -78 78 -203 0 -281l-150 -150c-8 -13 -28 -24 -43 -24c-28 0 -50 22 -50 50c0 15 11 35 24 43l150 150c40 40 39 105 0 144c-41 41 -110 34 -144 0l-44 -44
|
||||
c-8 -13 -27 -24 -42 -24c-28 0 -50 22 -50 50c0 15 11 35 24 43l43 44c32 33 72 53 128 56zM208 490c4 5 14 16 22 16h3c2 0 6 1 8 1c28 0 50 -22 50 -50c0 -11 -6 -27 -14 -35l-150 -150c-40 -40 -39 -105 0 -144c41 -41 110 -34 144 0l44 44c8 13 27 24 42 24
|
||||
c28 0 50 -22 50 -50c0 -15 -11 -35 -24 -43l-43 -44c-22 -22 -48 -37 -75 -47c-70 -25 -151 -9 -207 47c-78 78 -78 203 0 281zM499 200h200v-100h-100v-100h-100v200z" />
|
||||
<glyph glyph-name="86" unicode=""
|
||||
d="M586 797c18 1 39 1 57 -3c36 -8 69 -26 97 -54c78 -78 78 -203 0 -281l-150 -150c-62 -62 -132 -81 -182 -78s-69 17 -84 25s-26 27 -26 44c0 28 22 51 50 51c8 0 19 -3 26 -7c0 0 15 -11 41 -13s62 3 106 47l150 150c40 40 39 105 0 144c-41 41 -110 34 -144 0
|
||||
c-8 -13 -28 -24 -43 -24c-28 0 -50 22 -50 50c0 15 11 35 24 43c32 33 72 53 128 56zM386 566c50 -2 64 -17 85 -22s37 -28 37 -49c0 -28 -22 -50 -50 -50c-10 0 -23 5 -31 11c0 0 -19 9 -47 10s-63 -4 -103 -44l-150 -150c-40 -40 -39 -105 0 -144c41 -41 110 -34 144 0
|
||||
c8 13 27 24 42 24c28 0 50 -22 50 -50c0 -15 -10 -35 -23 -43c-22 -22 -48 -37 -75 -47c-70 -25 -151 -9 -207 47c-78 78 -78 203 0 281l150 150c60 60 128 78 178 76z" />
|
||||
<glyph glyph-name="87" unicode=""
|
||||
d="M0 700h300v-300h-300v300zM400 700h400v-100h-400v100zM400 500h300v-100h-300v100zM0 300h300v-300h-300v300zM400 300h400v-100h-400v100zM400 100h300v-100h-300v100z" />
|
||||
<glyph glyph-name="88" unicode=""
|
||||
d="M50 700c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM200 700h600v-100h-600v100zM50 500c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM200 500h600v-100h-600v100zM50 300c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50
|
||||
s22 50 50 50zM200 300h600v-100h-600v100zM50 100c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM200 100h600v-100h-600v100z" />
|
||||
<glyph glyph-name="89" unicode=""
|
||||
d="M800 800l-400 -800l-100 300l-300 100z" />
|
||||
<glyph glyph-name="8a" unicode="" horiz-adv-x="600"
|
||||
d="M300 700c110 0 200 -90 200 -200v-100h100v-400h-600v400h100v100c0 110 90 200 200 200zM300 600c-56 0 -100 -44 -100 -100v-100h200v100c0 56 -44 100 -100 100z" />
|
||||
<glyph glyph-name="8b" unicode="" horiz-adv-x="600"
|
||||
d="M300 800c110 0 200 -90 200 -200v-200h100v-400h-600v400h400v200c0 56 -44 100 -100 100s-100 -44 -100 -100h-100c0 110 90 200 200 200z" />
|
||||
<glyph glyph-name="8c" unicode=""
|
||||
d="M400 700v-100c-111 0 -200 -89 -200 -200h100l-150 -200l-150 200h100c0 165 135 300 300 300zM650 600l150 -200h-100c0 -165 -135 -300 -300 -300v100c111 0 200 89 200 200h-100z" />
|
||||
<glyph glyph-name="8d" unicode=""
|
||||
d="M100 800h600v-300h100l-150 -250l-150 250h100v200h-400v-100h-100v200zM150 550l150 -250h-100v-200h400v100h100v-200h-600v300h-100z" />
|
||||
<glyph glyph-name="8e" unicode=""
|
||||
d="M600 700l200 -150l-200 -150v100h-500v-100h-100v100c0 55 45 100 100 100h500v100zM200 300v-100h500v100h100v-100c0 -55 -45 -100 -100 -100h-500v-100l-200 150z" />
|
||||
<glyph glyph-name="8f" unicode="" horiz-adv-x="900"
|
||||
d="M350 800c193 0 350 -157 350 -350c0 -60 -17 -117 -44 -166c5 -3 12 -8 16 -12l100 -100c16 -16 30 -49 30 -72c0 -56 -46 -102 -102 -102c-23 0 -56 14 -72 30l-100 100c-4 3 -9 9 -12 13c-49 -26 -107 -41 -166 -41c-193 0 -350 157 -350 350s157 350 350 350zM350 200
|
||||
c142 0 250 108 250 250c0 139 -111 250 -250 250s-250 -111 -250 -250s111 -250 250 -250z" />
|
||||
<glyph glyph-name="90" unicode="" horiz-adv-x="600"
|
||||
d="M300 800c166 0 300 -134 300 -300c0 -200 -300 -500 -300 -500s-300 300 -300 500c0 166 134 300 300 300zM300 700c-110 0 -200 -90 -200 -200s90 -200 200 -200s200 90 200 200s-90 200 -200 200z" />
|
||||
<glyph glyph-name="91" unicode="" horiz-adv-x="900"
|
||||
d="M0 800h800v-541c1 -3 1 -8 1 -11s0 -7 -1 -10v-238h-800v800zM495 250c0 26 22 50 50 50h5h150v400h-600v-600h600v100h-150h-5c-28 0 -50 22 -50 50zM350 600c83 0 150 -67 150 -150c0 -100 -150 -250 -150 -250s-150 150 -150 250c0 83 67 150 150 150zM350 500
|
||||
c-28 0 -50 -22 -50 -50s22 -50 50 -50s50 22 50 50s-22 50 -50 50z" />
|
||||
<glyph glyph-name="92" unicode="" horiz-adv-x="600"
|
||||
d="M0 700h200v-600h-200v600zM400 700h200v-600h-200v600z" />
|
||||
<glyph glyph-name="93" unicode="" horiz-adv-x="600"
|
||||
d="M0 700l600 -300l-600 -300v600z" />
|
||||
<glyph glyph-name="94" unicode="" horiz-adv-x="600"
|
||||
d="M300 700c166 0 300 -134 300 -300s-134 -300 -300 -300s-300 134 -300 300s134 300 300 300z" />
|
||||
<glyph glyph-name="95" unicode=""
|
||||
d="M400 700v-600l-400 300zM400 400l400 300v-600z" />
|
||||
<glyph glyph-name="96" unicode=""
|
||||
d="M0 700l400 -300l-400 -300v600zM400 100v600l400 -300z" />
|
||||
<glyph glyph-name="97" unicode=""
|
||||
d="M0 700h200v-600h-200v600zM200 400l500 300v-600z" />
|
||||
<glyph glyph-name="98" unicode=""
|
||||
d="M0 700l500 -300l-500 -300v600zM500 100v600h200v-600h-200z" />
|
||||
<glyph glyph-name="99" unicode="" horiz-adv-x="600"
|
||||
d="M0 700h600v-600h-600v600z" />
|
||||
<glyph glyph-name="9a" unicode=""
|
||||
d="M200 800h400v-200h200v-400h-200v-200h-400v200h-200v400h200v200z" />
|
||||
<glyph glyph-name="9b" unicode=""
|
||||
d="M0 700h800v-100h-800v100zM0 403h800v-100h-800v100zM0 103h800v-100h-800v100z" />
|
||||
<glyph glyph-name="9c" unicode="" horiz-adv-x="600"
|
||||
d="M278 700c7 2 13 4 22 4c55 0 100 -45 100 -100v-4v-200c0 -55 -45 -100 -100 -100s-100 45 -100 100v200v2c0 44 35 88 78 98zM34 500h4h3c3 0 6 1 9 1c28 0 50 -22 50 -50v-1v-50c0 -111 89 -200 200 -200s200 89 200 200v50c0 28 22 50 50 50s50 -22 50 -50v-50
|
||||
c0 -148 -109 -270 -250 -294v-106h50c55 0 100 -45 100 -100h-400c0 55 45 100 100 100h50v106c-141 24 -250 146 -250 294v50v2c0 20 15 42 34 48z" />
|
||||
<glyph glyph-name="9d" unicode=""
|
||||
d="M0 500h800v-200h-800v200z" />
|
||||
<glyph glyph-name="9e" unicode=""
|
||||
d="M34 700h4h3h4h5h700c28 0 50 -22 50 -50v-500c0 -28 -22 -50 -50 -50h-250v-100h100c55 0 100 -45 100 -100h-600c0 55 45 100 100 100h100v100h-250c-28 0 -50 22 -50 50v500v2c0 20 15 42 34 48zM100 600v-400h600v400h-600z" />
|
||||
<glyph glyph-name="9f" unicode=""
|
||||
d="M272 700c-14 -40 -22 -83 -22 -128c0 -221 179 -400 400 -400c45 0 88 8 128 22c-53 -158 -202 -272 -378 -272c-221 0 -400 179 -400 400c0 176 114 325 272 378z" />
|
||||
<glyph glyph-name="a0" unicode=""
|
||||
d="M350 700l150 -150h-100v-150h150v100l150 -150l-150 -150v100h-150v-150h100l-150 -150l-150 150h100v150h-150v-100l-150 150l150 150v-100h150v150h-100z" />
|
||||
<glyph glyph-name="a1" unicode=""
|
||||
d="M800 800v-550c0 -83 -67 -150 -150 -150s-150 67 -150 150s67 150 150 150c17 0 35 -4 50 -9v206c-201 -6 -327 -27 -400 -50v-397c0 -83 -67 -150 -150 -150s-150 67 -150 150s67 150 150 150c17 0 35 -4 50 -9v409s100 100 600 100z" />
|
||||
<glyph glyph-name="a2" unicode="" horiz-adv-x="700"
|
||||
d="M499 700c51 0 102 -20 141 -59c78 -78 78 -203 0 -281l-250 -244c-48 -48 -127 -48 -175 0s-48 127 0 175l96 97l69 -69l-90 -94l-7 -3c-10 -10 -10 -28 0 -38s28 -10 38 0l250 247c37 40 39 102 0 141s-104 40 -144 0l-278 -275c-66 -69 -68 -179 0 -247
|
||||
c69 -69 181 -69 250 0l9 12l116 113l69 -69l-125 -125c-107 -107 -281 -107 -388 0s-107 281 0 388l278 272c39 39 90 59 141 59z" />
|
||||
<glyph glyph-name="a3" unicode=""
|
||||
d="M600 800l200 -200l-100 -100l-200 200zM400 600l200 -200l-400 -400h-200v200z" />
|
||||
<glyph glyph-name="a4" unicode=""
|
||||
d="M550 800c83 0 150 -90 150 -200s-67 -200 -150 -200c-22 0 -40 8 -59 19c6 26 9 52 9 81c0 84 -27 158 -72 212c27 52 71 88 122 88zM250 700c83 0 150 -90 150 -200s-67 -200 -150 -200s-150 90 -150 200s67 200 150 200zM725 384c44 -22 75 -66 75 -118v-166h-200v66
|
||||
c0 50 -17 96 -44 134c66 2 126 33 169 84zM75 284c45 -53 106 -84 175 -84s130 31 175 84c44 -22 75 -66 75 -118v-166h-500v166c0 52 31 96 75 118z" />
|
||||
<glyph glyph-name="a5" unicode=""
|
||||
d="M400 800c110 0 200 -112 200 -250s-90 -250 -200 -250s-200 112 -200 250s90 250 200 250zM191 300c54 -61 128 -100 209 -100s155 39 209 100c106 -5 191 -92 191 -200v-100h-800v100c0 108 85 195 191 200z" />
|
||||
<glyph glyph-name="a6" unicode="" horiz-adv-x="600"
|
||||
d="M19 800h462c11 0 19 -8 19 -19v-762c0 -11 -8 -19 -19 -19h-462c-11 0 -19 8 -19 19v762c0 11 8 19 19 19zM100 700v-500h300v500h-300zM250 150c-28 0 -50 -22 -50 -50s22 -50 50 -50s50 22 50 50s-22 50 -50 50z" />
|
||||
<glyph glyph-name="a7" unicode=""
|
||||
d="M350 800c17 0 34 -1 50 -3v-397l-297 297c63 64 150 103 247 103zM500 694c169 -25 300 -168 300 -344c0 -193 -157 -350 -350 -350c-85 0 -161 31 -222 81l272 272v341zM91 562l237 -234l-212 -212c-70 55 -116 138 -116 234c0 84 35 158 91 212z" />
|
||||
<glyph glyph-name="a8" unicode=""
|
||||
d="M92 650c0 23 20 50 46 50h3h4h5h400c28 0 50 -22 50 -50s-22 -50 -50 -50h-50v-200h100c55 0 100 -45 100 -100h-300v-300l-56 -100l-44 100v300h-300c0 55 45 100 100 100h100v200h-50c-2 0 -6 -1 -8 -1c-28 0 -50 23 -50 51z" />
|
||||
<glyph glyph-name="a9" unicode=""
|
||||
d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM300 600v-400l300 200z" />
|
||||
<glyph glyph-name="aa" unicode=""
|
||||
d="M300 800h200v-300h300v-200h-300v-300h-200v300h-300v200h300v300z" />
|
||||
<glyph glyph-name="ab" unicode=""
|
||||
d="M300 800h100v-400h-100v400zM172 656l62 -78l-40 -31c-58 -46 -94 -117 -94 -197c0 -139 111 -250 250 -250s250 111 250 250c0 80 -39 151 -97 197l-37 31l62 78l38 -31c82 -64 134 -164 134 -275c0 -193 -157 -350 -350 -350s-350 157 -350 350c0 111 53 211 134 275z
|
||||
" />
|
||||
<glyph glyph-name="ac" unicode=""
|
||||
d="M200 800h400v-200h-400v200zM9 500h782c6 0 9 -3 9 -9v-282c0 -6 -3 -9 -9 -9h-91v200h-600v-200h-91c-6 0 -9 3 -9 9v282c0 6 3 9 9 9zM200 300h400v-300h-400v300z" />
|
||||
<glyph glyph-name="ad" unicode=""
|
||||
d="M0 700h100v-700h-100v700zM700 700h100v-700h-100v700zM200 600h200v-100h-200v100zM300 400h200v-100h-200v100zM400 200h200v-100h-200v100z" />
|
||||
<glyph glyph-name="ae" unicode=""
|
||||
d="M325 700c42 -141 87 -280 131 -419c29 74 59 148 88 222c30 -57 58 -114 87 -172h169v-100h-231l-13 28c-37 -92 -74 -184 -112 -275c-38 129 -79 257 -119 385c-42 -133 -83 -267 -125 -400c-28 88 -56 175 -84 262h-116v100h188l9 -34l3 -6c42 137 83 273 125 409z" />
|
||||
<glyph glyph-name="af" unicode=""
|
||||
d="M200 600c0 57 43 100 100 100s100 -43 100 -100c0 -28 -18 -48 -28 -72c-3 -6 -3 -16 -3 -28h231v-231c12 0 22 0 28 3c24 10 44 28 72 28c57 0 100 -43 100 -100s-43 -100 -100 -100c-28 0 -48 18 -72 28c-6 3 -16 3 -28 3v-231h-231c0 12 0 22 3 28c10 24 28 44 28 72
|
||||
c0 57 -43 100 -100 100s-100 -43 -100 -100c0 -28 18 -48 28 -72c3 -6 3 -16 3 -28h-231v600h231c0 12 0 22 -3 28c-10 24 -28 44 -28 72z" />
|
||||
<glyph glyph-name="b0" unicode="" horiz-adv-x="500"
|
||||
d="M247 700c84 0 148 -20 191 -59s59 -93 59 -141c0 -117 -69 -181 -119 -225s-81 -67 -81 -150v-25h-100v25c0 117 65 181 115 225s85 67 85 150c0 25 -8 48 -28 66s-56 34 -122 34s-97 -18 -116 -37s-27 -43 -31 -69l-100 12c5 38 19 88 59 128s103 66 188 66zM197 0h100
|
||||
v-100h-100v100z" />
|
||||
<glyph glyph-name="b1" unicode=""
|
||||
d="M450 800c138 0 250 -112 250 -250v-50c58 -21 100 -85 100 -150c0 -69 -48 -127 -112 -144c-22 55 -75 94 -138 94c-20 0 -39 -5 -56 -12c-17 64 -75 112 -144 112s-127 -48 -144 -112c-17 7 -36 12 -56 12c-37 0 -71 -12 -97 -34c-33 36 -53 82 -53 134
|
||||
c0 110 90 200 200 200c23 114 129 200 250 200zM334 300h4h3c3 0 6 1 9 1c28 0 50 -22 50 -50v-1v-200c0 -28 -22 -50 -50 -50s-50 22 -50 50v200v2c0 20 15 42 34 48zM134 200h4h3c3 0 6 1 9 1c28 0 50 -22 50 -50v-1v-100c0 -28 -22 -50 -50 -50s-50 22 -50 50v100v2
|
||||
c0 20 15 42 34 48zM534 200h3h4c3 0 6 1 9 1c28 0 50 -22 50 -50v-1v-100c0 -28 -22 -50 -50 -50s-50 22 -50 50v100v2c0 20 15 42 34 48z" />
|
||||
<glyph glyph-name="b2" unicode=""
|
||||
d="M600 800l200 -150l-200 -150v100h-50l-153 -191l175 -206l6 -3h22v100l200 -150l-200 -150v100h-25c-35 0 -56 12 -78 38l-166 190l-153 -190c-22 -27 -43 -38 -78 -38h-100v100h100l166 206l-163 191l-3 3h-100v100h100c34 0 56 -12 78 -38l153 -178l141 178
|
||||
c22 27 43 38 78 38h50v100z" />
|
||||
<glyph glyph-name="b3" unicode=""
|
||||
d="M400 800c110 0 209 -47 281 -119l119 119v-300h-300l109 109c-54 55 -126 91 -209 91c-166 0 -300 -134 -300 -300s134 -300 300 -300c83 0 158 34 212 88l72 -72c-72 -72 -174 -116 -284 -116c-220 0 -400 180 -400 400s180 400 400 400z" />
|
||||
<glyph glyph-name="b4" unicode=""
|
||||
d="M400 800h400v-400l-166 166l-400 -400l166 -166h-400v400l166 -166l400 400z" />
|
||||
<glyph glyph-name="b5" unicode="" horiz-adv-x="600"
|
||||
d="M250 800l250 -300h-200v-200h200l-250 -300l-250 300h200v200h-200z" />
|
||||
<glyph glyph-name="b6" unicode=""
|
||||
d="M300 600v-200h200v200l300 -250l-300 -250v200h-200v-200l-300 250z" />
|
||||
<glyph glyph-name="b7" unicode=""
|
||||
d="M0 800c441 0 800 -359 800 -800h-200c0 333 -267 600 -600 600v200zM0 500c275 0 500 -225 500 -500h-200c0 167 -133 300 -300 300v200zM0 200c110 0 200 -90 200 -200h-200v200z" />
|
||||
<glyph glyph-name="b8" unicode=""
|
||||
d="M100 800c386 0 700 -314 700 -700h-100c0 332 -268 600 -600 600v100zM100 600c276 0 500 -224 500 -500h-100c0 222 -178 400 -400 400v100zM100 400c165 0 300 -135 300 -300h-100c0 111 -89 200 -200 200v100zM100 200c55 0 100 -45 100 -100s-45 -100 -100 -100
|
||||
s-100 45 -100 100s45 100 100 100z" />
|
||||
<glyph glyph-name="b9" unicode=""
|
||||
d="M300 800h400c55 0 100 -45 100 -100v-200h-400v150c0 28 -22 50 -50 50s-50 -22 -50 -50v-250h400v-300c0 -55 -45 -100 -100 -100h-500c-55 0 -100 45 -100 100v200h100v-150c0 -28 22 -50 50 -50s50 22 50 50v550c0 55 45 100 100 100z" />
|
||||
<glyph glyph-name="ba" unicode=""
|
||||
d="M75 700h225v-100h-200v-500h400v100h100v-125c0 -41 -34 -75 -75 -75h-450c-41 0 -75 34 -75 75v550c0 41 34 75 75 75zM600 700l200 -200l-200 -200v100h-200c-94 0 -173 -65 -194 -153c23 199 189 353 394 353v100z" />
|
||||
<glyph glyph-name="bb" unicode=""
|
||||
d="M500 700l300 -284l-300 -316v200h-100c-200 0 -348 -102 -400 -300c0 295 100 500 500 500v200z" />
|
||||
<glyph glyph-name="bc" unicode=""
|
||||
d="M381 791l19 9l19 -9c127 -53 253 -108 381 -160v-31c0 -166 -67 -313 -147 -419c-40 -53 -83 -97 -125 -128s-82 -53 -128 -53s-86 22 -128 53s-85 75 -125 128c-80 107 -147 253 -147 419v31c128 52 254 107 381 160zM400 100v591l-294 -122c8 -126 58 -243 122 -328
|
||||
c35 -46 73 -86 106 -110s62 -31 66 -31z" />
|
||||
<glyph glyph-name="bd" unicode=""
|
||||
d="M600 800h100v-800h-100v800zM400 700h100v-700h-100v700zM200 500h100v-500h-100v500zM0 300h100v-300h-100v300z" />
|
||||
<glyph glyph-name="be" unicode=""
|
||||
d="M300 800h100v-200h200l100 -100l-100 -100h-200v-400h-100v500h-200l-100 100l100 100h200v100z" />
|
||||
<glyph glyph-name="bf" unicode=""
|
||||
d="M200 800h100v-600h200l-250 -200l-250 200h200v600zM400 800h200v-100h-200v100zM400 600h300v-100h-300v100zM400 400h400v-100h-400v100z" />
|
||||
<glyph glyph-name="c0" unicode=""
|
||||
d="M200 800h100v-600h200l-250 -200l-250 200h200v600zM400 800h400v-100h-400v100zM400 600h300v-100h-300v100zM400 400h200v-100h-200v100z" />
|
||||
<glyph glyph-name="c1" unicode=""
|
||||
d="M75 700h650c41 0 75 -34 75 -75v-550c0 -41 -34 -75 -75 -75h-650c-41 0 -75 34 -75 75v550c0 41 34 75 75 75zM100 600v-100h100v100h-100zM300 600v-100h400v100h-400zM100 400v-100h100v100h-100zM300 400v-100h400v100h-400zM100 200v-100h100v100h-100zM300 200
|
||||
v-100h400v100h-400z" />
|
||||
<glyph glyph-name="c2" unicode=""
|
||||
d="M400 800l100 -300h300l-250 -200l100 -300l-250 200l-250 -200l100 300l-250 200h300z" />
|
||||
<glyph glyph-name="c3" unicode=""
|
||||
d="M400 800c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM150 700c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM650 700c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM400 600c110 0 200 -90 200 -200
|
||||
s-90 -200 -200 -200s-200 90 -200 200s90 200 200 200zM50 450c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM750 450c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM150 200c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50
|
||||
s22 50 50 50zM650 200c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM400 100c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50z" />
|
||||
<glyph glyph-name="c4" unicode=""
|
||||
d="M34 800h632c18 0 34 -16 34 -34v-732c0 -18 -16 -34 -34 -34h-632c-18 0 -34 16 -34 34v732c0 18 16 34 34 34zM100 700v-500h500v500h-500zM350 150c-38 0 -63 -42 -44 -75s69 -33 88 0s-6 75 -44 75z" />
|
||||
<glyph glyph-name="c5" unicode=""
|
||||
d="M0 800h300l500 -500l-300 -300l-500 500v300zM200 700c-55 0 -100 -45 -100 -100s45 -100 100 -100s100 45 100 100s-45 100 -100 100z" />
|
||||
<glyph glyph-name="c6" unicode=""
|
||||
d="M0 600h200l300 -300l-200 -200l-300 300v200zM340 600h160l300 -300l-200 -200l-78 78l119 122zM150 500c-28 0 -50 -22 -50 -50s22 -50 50 -50s50 22 50 50s-22 50 -50 50z" />
|
||||
<glyph glyph-name="c7" unicode=""
|
||||
d="M400 800c220 0 400 -180 400 -400s-180 -400 -400 -400s-400 180 -400 400s180 400 400 400zM400 700c-166 0 -300 -134 -300 -300s134 -300 300 -300s300 134 300 300s-134 300 -300 300zM400 600c110 0 200 -90 200 -200s-90 -200 -200 -200s-200 90 -200 200
|
||||
s90 200 200 200zM400 500c-56 0 -100 -44 -100 -100s44 -100 100 -100s100 44 100 100s-44 100 -100 100z" />
|
||||
<glyph glyph-name="c8" unicode=""
|
||||
d="M0 700h559l-100 -100h-359v-500h500v159l100 100v-359h-700v700zM700 700l100 -100l-400 -400l-200 200l100 100l100 -100z" />
|
||||
<glyph glyph-name="c9" unicode=""
|
||||
d="M9 800h782c6 0 9 -3 9 -9v-782c0 -6 -3 -9 -9 -9h-782c-6 0 -9 3 -9 9v782c0 6 3 9 9 9zM150 722l-72 -72l100 -100l-100 -100l72 -72l172 172zM400 500v-100h300v100h-300z" />
|
||||
<glyph glyph-name="ca" unicode=""
|
||||
d="M0 800h800v-200h-50c0 55 -45 100 -100 100h-150v-550c0 -28 22 -50 50 -50h50v-100h-400v100h50c28 0 50 22 50 50v550h-150c-55 0 -100 -45 -100 -100h-50v200z" />
|
||||
<glyph glyph-name="cb" unicode=""
|
||||
d="M0 700h100v-400h-100v400zM200 700h350c21 0 39 -13 47 -31c0 0 103 -291 103 -319s-22 -50 -50 -50h-150c-28 0 -50 -25 -50 -50s39 -158 47 -184s-5 -55 -31 -63s-52 5 -66 31s-109 219 -128 238s-44 28 -72 28v400z" />
|
||||
<glyph glyph-name="cc" unicode=""
|
||||
d="M400 666c10 19 28 32 47 34l19 -3c26 -8 39 -37 31 -63s-47 -159 -47 -184s22 -50 50 -50h150c28 0 50 -22 50 -50s-103 -319 -103 -319c-8 -18 -26 -31 -47 -31h-350v400c28 0 53 9 72 28s114 212 128 238zM0 400h100v-400h-100v400z" />
|
||||
<glyph glyph-name="cd" unicode=""
|
||||
d="M200 700h300v-100h-100v-6c25 -4 50 -8 72 -16l-34 -94c-28 11 -58 16 -88 16c-139 0 -250 -111 -250 -250s111 -250 250 -250s250 111 250 250c0 31 -5 60 -16 88l91 37c14 -38 25 -81 25 -125c0 -193 -157 -350 -350 -350s-350 157 -350 350c0 176 130 323 300 347v3
|
||||
h-100v100zM700 584c0 0 -296 -348 -316 -368s-48 -20 -68 0s-20 48 0 68s384 300 384 300z" />
|
||||
<glyph glyph-name="ce" unicode=""
|
||||
d="M600 700l200 -150l-200 -150v100h-600v100h600v100zM200 300v-100h600v-100h-600v-100l-200 150z" />
|
||||
<glyph glyph-name="cf" unicode=""
|
||||
d="M300 800h100c55 0 100 -45 100 -100h100c55 0 100 -45 100 -100h-700c0 55 45 100 100 100h100c0 55 45 100 100 100zM100 500h100v-350c0 -28 22 -50 50 -50s50 22 50 50v350h100v-350c0 -28 22 -50 50 -50s50 22 50 50v350h100v-481c0 -11 -8 -19 -19 -19h-462
|
||||
c-11 0 -19 8 -19 19v481z" />
|
||||
<glyph glyph-name="d0" unicode=""
|
||||
d="M100 800h200v-400c0 -55 45 -100 100 -100s100 45 100 100v400h100v-400c0 -110 -90 -200 -200 -200h-50c-138 0 -250 90 -250 200v400zM0 100h700v-100h-700v100z" />
|
||||
<glyph glyph-name="d1" unicode=""
|
||||
d="M9 700h182c6 0 9 -3 9 -9v-482c0 -6 -3 -9 -9 -9h-182c-6 0 -9 3 -9 9v482c0 6 3 9 9 9zM609 700h182c6 0 9 -3 9 -9v-482c0 -6 -3 -9 -9 -9h-182c-6 0 -9 3 -9 9v482c0 6 3 9 9 9zM309 500h182c6 0 9 -3 9 -9v-282c0 -6 -3 -9 -9 -9h-182c-6 0 -9 3 -9 9v282
|
||||
c0 6 3 9 9 9zM0 100h800v-100h-800v100z" />
|
||||
<glyph glyph-name="d2" unicode=""
|
||||
d="M10 700h181c6 0 9 -3 9 -9v-191h-200v191c0 6 4 9 10 9zM610 700h181c6 0 9 -3 9 -9v-191h-200v191c0 6 5 9 10 9zM310 600h181c6 0 9 -3 9 -9v-91h-200v91c0 6 4 9 10 9zM0 400h800v-100h-800v100zM0 200h200v-191c0 -6 -3 -9 -9 -9h-182c-6 0 -9 3 -9 9v191zM300 200
|
||||
h200v-91c0 -6 -3 -9 -9 -9h-181c-6 0 -10 3 -10 9v91zM600 200h200v-191c0 -6 -3 -9 -9 -9h-181c-6 0 -10 3 -10 9v191z" />
|
||||
<glyph glyph-name="d3" unicode=""
|
||||
d="M0 700h800v-100h-800v100zM9 500h182c6 0 9 -3 9 -9v-482c0 -6 -3 -9 -9 -9h-182c-6 0 -9 3 -9 9v482c0 6 3 9 9 9zM309 500h182c6 0 9 -3 9 -9v-282c0 -6 -3 -9 -9 -9h-182c-6 0 -9 3 -9 9v282c0 6 3 9 9 9zM609 500h182c6 0 9 -3 9 -9v-482c0 -6 -3 -9 -9 -9h-182
|
||||
c-6 0 -9 3 -9 9v482c0 6 3 9 9 9z" />
|
||||
<glyph glyph-name="d4" unicode=""
|
||||
d="M50 600h500c28 0 50 -22 50 -50v-150l100 100h100v-300h-100l-100 100v-150c0 -28 -22 -50 -50 -50h-500c-28 0 -50 22 -50 50v400c0 28 22 50 50 50z" />
|
||||
<glyph glyph-name="d5" unicode=""
|
||||
d="M334 800h66v-800h-66l-134 200h-200v400h200zM500 600v100c26 0 52 -4 75 -10c130 -33 225 -150 225 -290s-95 -258 -225 -291h-3c-23 -6 -47 -9 -72 -9v100c17 0 34 2 50 6c86 22 150 100 150 194s-64 172 -150 194c-16 4 -33 6 -50 6zM500 500l25 -3
|
||||
c44 -11 75 -51 75 -97s-32 -86 -75 -97l-25 -3v200z" />
|
||||
<glyph glyph-name="d6" unicode="" horiz-adv-x="600"
|
||||
d="M334 800h66v-800h-66l-134 200h-200v400h200zM500 500l25 -3c44 -11 75 -51 75 -97s-32 -86 -75 -97l-25 -3v200z" />
|
||||
<glyph glyph-name="d7" unicode="" horiz-adv-x="400"
|
||||
d="M334 800h66v-800h-66l-134 200h-200v400h200z" />
|
||||
<glyph glyph-name="d8" unicode=""
|
||||
d="M309 800h82c6 0 10 -4 12 -9l294 -682l3 -19v-81c0 -6 -3 -9 -9 -9h-682c-6 0 -9 3 -9 9v81l3 19l294 682c2 5 6 9 12 9zM300 500v-200h100v200h-100zM300 200v-100h100v100h-100z" />
|
||||
<glyph glyph-name="d9" unicode=""
|
||||
d="M375 800c138 0 269 -39 378 -109l-53 -82c-93 60 -205 91 -325 91c-119 0 -229 -32 -322 -91l-53 82c109 70 237 109 375 109zM375 500c78 0 154 -23 216 -62l-53 -85c-46 30 -104 47 -163 47c-60 0 -112 -17 -159 -47l-54 85c62 40 134 62 213 62zM375 200
|
||||
c55 0 100 -45 100 -100s-45 -100 -100 -100s-100 45 -100 100s45 100 100 100z" />
|
||||
<glyph glyph-name="da" unicode="" horiz-adv-x="900"
|
||||
d="M551 800c16 0 32 0 47 -3l-97 -97v-200h200l97 97c3 -15 3 -31 3 -47c0 -138 -112 -250 -250 -250c-32 0 -62 8 -90 19l-288 -291c-20 -20 -46 -28 -72 -28s-52 8 -72 28c-39 39 -39 105 0 144l291 287c-11 28 -19 59 -19 91c0 138 112 250 250 250zM101 150
|
||||
c-28 0 -50 -22 -50 -50s22 -50 50 -50s50 22 50 50s-22 50 -50 50z" />
|
||||
<glyph glyph-name="db" unicode=""
|
||||
d="M141 700c84 -84 169 -167 253 -250c82 83 167 165 247 250l143 -141l-253 -253c84 -82 167 -166 253 -247l-143 -143c-81 86 -165 169 -247 253l-253 -253l-141 143c85 80 167 164 250 247c-83 84 -166 169 -250 253z" />
|
||||
<glyph glyph-name="dc" unicode=""
|
||||
d="M0 800h100l231 -300h38l231 300h100l-225 -300h225v-100h-300v-100h300v-100h-300v-200h-100v200h-300v100h300v100h-300v100h225z" />
|
||||
<glyph glyph-name="dd" unicode="" horiz-adv-x="900"
|
||||
d="M350 800c193 0 350 -157 350 -350c0 -61 -17 -119 -44 -169c4 -2 10 -6 13 -9l103 -100c16 -16 30 -49 30 -72c0 -56 -46 -102 -102 -102c-23 0 -56 14 -72 30l-100 103c-3 3 -7 9 -9 13c-50 -28 -108 -44 -169 -44c-193 0 -350 157 -350 350s157 350 350 350zM350 700
|
||||
c-139 0 -250 -111 -250 -250s111 -250 250 -250c62 0 119 23 163 60c7 11 19 25 31 31l3 3c34 43 53 97 53 156c0 139 -111 250 -250 250zM300 600h100v-100h100v-100h-100v-100h-100v100h-100v100h100v100z" />
|
||||
<glyph glyph-name="de" unicode="" horiz-adv-x="900"
|
||||
d="M350 800c193 0 350 -157 350 -350c0 -61 -17 -119 -44 -169c4 -2 10 -6 13 -9l103 -100c16 -16 30 -49 30 -72c0 -56 -46 -102 -102 -102c-23 0 -56 14 -72 30l-100 103c-3 3 -7 9 -9 13c-50 -28 -108 -44 -169 -44c-193 0 -350 157 -350 350s157 350 350 350zM350 700
|
||||
c-139 0 -250 -111 -250 -250s111 -250 250 -250c62 0 119 23 163 60c7 11 19 25 31 31l3 3c34 43 53 97 53 156c0 139 -111 250 -250 250zM200 500h300v-100h-300v100z" />
|
||||
</font>
|
||||
</defs></svg>
|
After Width: | Height: | Size: 54 KiB |
BIN
bl-kernel/admin/themes/booty/css/fonts/open-iconic.ttf
Executable file
BIN
bl-kernel/admin/themes/booty/css/fonts/open-iconic.woff
Executable file
9
bl-kernel/admin/themes/booty/css/jquery-auto-complete.css
Executable file
|
@ -0,0 +1,9 @@
|
|||
.autocomplete-suggestions {
|
||||
text-align: left; cursor: default; border: 1px solid #ccc; border-top: 0; background: #fff; box-shadow: -1px 1px 3px rgba(0,0,0,.1);
|
||||
|
||||
/* core styles should not be changed */
|
||||
position: absolute; display: none; z-index: 9999; max-height: 254px; overflow: hidden; overflow-y: auto; box-sizing: border-box;
|
||||
}
|
||||
.autocomplete-suggestion { position: relative; padding: 0 .6em; line-height: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.02em; color: #333; }
|
||||
.autocomplete-suggestion b { font-weight: normal; color: #1f8dd6; }
|
||||
.autocomplete-suggestion.selected { background: #f0f0f0; }
|
1
bl-kernel/admin/themes/booty/css/open-iconic-bootstrap.min.css
vendored
Executable file
|
@ -2,7 +2,7 @@
|
|||
function showAlert(text) {
|
||||
console.log("[INFO] Function showAlert() called.");
|
||||
$("#alert").html(text);
|
||||
$("#alert").slideDown().delay(<?php echo ALERT_DISAPPEAR_IN*1000 ?>).slideUp();
|
||||
$("#alert").slideDown().delay(<?php echo $GLOBALS['ALERT_DISSAPEAR_IN']*1000 ?>).slideUp();
|
||||
}
|
||||
|
||||
<?php if (Alert::defined()): ?>
|
||||
|
|
|
@ -1,14 +1,26 @@
|
|||
<?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);
|
||||
if (IMAGE_RESTRICT) {
|
||||
$imagesDirectory = (IMAGE_RELATIVE_TO_ABSOLUTE? '' : HTML_PATH_UPLOADS_PAGES.$uuid.'/');
|
||||
$imagesURL = (IMAGE_RELATIVE_TO_ABSOLUTE? '' : DOMAIN_UPLOADS_PAGES.$uuid.'/');
|
||||
$thumbnailDirectory = PATH_UPLOADS_PAGES.$uuid.DS.'thumbnails'.DS;
|
||||
$thumbnailHTML = HTML_PATH_UPLOADS_PAGES.$uuid.'/thumbnails/';
|
||||
$thumbnailURL = DOMAIN_UPLOADS_PAGES.$uuid.'/thumbnails/';
|
||||
} else {
|
||||
$imagesDirectory = (IMAGE_RELATIVE_TO_ABSOLUTE? '' : HTML_PATH_UPLOADS);
|
||||
$imagesURL = (IMAGE_RELATIVE_TO_ABSOLUTE? '' : DOMAIN_UPLOADS);
|
||||
$thumbnailDirectory = PATH_UPLOADS_THUMBNAILS;
|
||||
$thumbnailHTML = HTML_PATH_UPLOADS_THUMBNAILS;
|
||||
$thumbnailURL = DOMAIN_UPLOADS_THUMBNAILS;
|
||||
}
|
||||
$listOfFilesByPage = Filesystem::listFiles($thumbnailDirectory, '*', '*', $GLOBALS['MEDIA_MANAGER_SORT_BY_DATE'], $GLOBALS['MEDIA_MANAGER_NUMBER_OF_FILES']);
|
||||
$preLoadFiles = array();
|
||||
if (!empty($listOfFilesByPage[0])) {
|
||||
foreach ($listOfFilesByPage[0] as $file) {
|
||||
$filename = Filesystem::filename($file);
|
||||
$filename = basename($file);
|
||||
array_push($preLoadFiles, $filename);
|
||||
}
|
||||
}
|
||||
|
||||
// Amount of pages for the paginator
|
||||
$numberOfPages = count($listOfFilesByPage);
|
||||
?>
|
||||
|
@ -23,35 +35,43 @@ $numberOfPages = count($listOfFilesByPage);
|
|||
<!--
|
||||
UPLOAD INPUT
|
||||
-->
|
||||
<h3 class="mt-2 mb-3"><i class="fa fa-image"></i> <?php $L->p('Images'); ?></h3>
|
||||
<h3 class="mt-2 mb-3"><?php $L->p('Upload'); ?></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>
|
||||
<input type="file" class="custom-file-input" id="jsbluditInputFiles" name="bluditInputFiles[]" multiple>
|
||||
<label class="custom-file-label" for="jsbluditInputFiles"><?php $L->p('Choose images to upload'); ?></label>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Progress bar -->
|
||||
<div class="progress mt-3">
|
||||
<div class="progress mt-2">
|
||||
<div id="jsbluditProgressBar" class="progress-bar bg-primary" role="progressbar" style="width:0%"></div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
IMAGES LIST
|
||||
MANAGER
|
||||
-->
|
||||
<h3 class="mt-4 mb-3"><?php $L->p('Manage'); ?></h3>
|
||||
|
||||
<!-- Table for list files -->
|
||||
<table id="jsbluditMediaTable" class="table mt-3">
|
||||
<table id="jsbluditMediaTable" class="table">
|
||||
<tr>
|
||||
<td><?php $L->p('There are no images'); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- Paginator -->
|
||||
<nav id="jsbluditMediaTablePagination"></nav>
|
||||
<nav>
|
||||
<ul class="pagination justify-content-center">
|
||||
<?php for ($i=1; $i<=$numberOfPages; $i++): ?>
|
||||
<li class="page-item"><button type="button" class="btn btn-link page-link" onClick="getFiles(<?php echo $i ?>)"><?php echo $i ?></button></li>
|
||||
<?php endfor; ?>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -88,7 +108,7 @@ function hideMediaAlert() {
|
|||
}
|
||||
|
||||
// Show the files in the table
|
||||
function displayFiles(files, numberOfPages = <?= $numberOfPages ?>) {
|
||||
function displayFiles(files) {
|
||||
if (!Array.isArray(files)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -99,37 +119,26 @@ function displayFiles(files, numberOfPages = <?= $numberOfPages ?>) {
|
|||
// 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;
|
||||
var thumbnail = "<?php echo $thumbnailURL; ?>"+filename;
|
||||
var image = "<?php echo $imagesURL; ?>"+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 class="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>'+
|
||||
'<button type="button" class="btn btn-primary btn-sm mr-2" onClick="editorInsertMedia(\''+image+'\'); closeMediaManager();"><?php $L->p('Insert') ?><\/button>'+
|
||||
'<button type="button" class="btn btn-primary btn-sm" onClick="setCoverImage(\''+filename+'\'); closeMediaManager();"><?php $L->p('Set as cover image') ?><\/button>'+
|
||||
'<button type="button" class="btn btn-danger btn-sm float-right" onClick="deleteMedia(\''+filename+'\')"><?php $L->p('Delete') ?><\/button>'+
|
||||
'<\/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('');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,12 +147,12 @@ function getFiles(pageNumber) {
|
|||
$.post(HTML_PATH_ADMIN_ROOT+"ajax/list-images",
|
||||
{ tokenCSRF: tokenCSRF,
|
||||
pageNumber: pageNumber,
|
||||
uuid: "<?php echo PAGE_IMAGES_KEY ?>",
|
||||
uuid: "<?php echo $uuid; ?>",
|
||||
path: "thumbnails" // the paths are defined in ajax/list-images
|
||||
},
|
||||
function(data) { // success function
|
||||
if (data.status==0) {
|
||||
displayFiles(data.files, data.numberOfPages);
|
||||
displayFiles(data.files);
|
||||
} else {
|
||||
console.log(data.message);
|
||||
}
|
||||
|
@ -156,7 +165,7 @@ function deleteMedia(filename) {
|
|||
$.post(HTML_PATH_ADMIN_ROOT+"ajax/delete-image",
|
||||
{ tokenCSRF: tokenCSRF,
|
||||
filename: filename,
|
||||
uuid: "<?php echo PAGE_IMAGES_KEY; ?>"
|
||||
uuid: "<?php echo $uuid; ?>"
|
||||
},
|
||||
function(data) { // success function
|
||||
if (data.status==0) {
|
||||
|
@ -169,93 +178,58 @@ function deleteMedia(filename) {
|
|||
}
|
||||
|
||||
function setCoverImage(filename) {
|
||||
var image = "<?php echo PAGE_IMAGES_URL; ?>"+filename;
|
||||
var image = "<?php echo $imagesURL; ?>"+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();
|
||||
});
|
||||
// Event to wait the selected files
|
||||
$("#jsbluditInputFiles").on("change", function() {
|
||||
|
||||
// Drag and drop image
|
||||
$(window).on("dragover dragenter", function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
openMediaManager();
|
||||
});
|
||||
// Check file size ?
|
||||
// Check file type/extension ?
|
||||
$("#jsbluditProgressBar").removeClass().addClass("progress-bar bg-primary");
|
||||
$("#jsbluditProgressBar").width("0");
|
||||
|
||||
// Drag and drop image
|
||||
$(window).on("drop", function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
$("#jsimages").prop("files", e.originalEvent.dataTransfer.files);
|
||||
uploadImages();
|
||||
// Data to send via AJAX
|
||||
var uuid = $("#jsuuid").val();
|
||||
var formData = new FormData($("#jsbluditFormUpload")[0]);
|
||||
formData.append('uuid', uuid);
|
||||
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);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -24,52 +24,29 @@
|
|||
<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>
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -2,26 +2,27 @@
|
|||
<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>
|
||||
<img src="<?php echo HTML_PATH_ADMIN_THEME ?>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>
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><span class="oi oi-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>
|
||||
<a class="nav-link" target="_blank" href="<?php echo HTML_PATH_ROOT ?>"><span class="oi oi-external-link"></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>
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'new-content' ?>"><span style="color: #007bff;" class="oi oi-plus"></span><?php $L->p('New content') ?></a>
|
||||
</li>
|
||||
|
||||
<?php if (!checkRole(array('admin'),false)): ?>
|
||||
<?php if (checkRole(array('editor'),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>
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'content' ?>"><span class="oi oi-layers"></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>
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$login->username() ?>"><span class="oi oi-person"></span><?php $L->p('Profile') ?></a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
|
@ -31,36 +32,32 @@
|
|||
<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>
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'content' ?>"><?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>
|
||||
<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' ?>"><span class="fa fa-users"></span><?php $L->p('Users') ?></a>
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>"><?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>
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'settings' ?>"><?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>
|
||||
<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' ?>"><span class="fa fa-desktop"></span><?php $L->p('Themes') ?></a>
|
||||
<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' ?>"><span class="fa fa-info"></span><?php $L->p('About') ?></a>
|
||||
<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', 'editor'),false)): ?>
|
||||
|
||||
<?php
|
||||
if (!empty($plugins['adminSidebar'])) {
|
||||
echo '<li class="nav-item"><hr></li>';
|
||||
|
@ -71,10 +68,9 @@
|
|||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?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>
|
||||
<a class="nav-link" href="<?php echo HTML_PATH_ADMIN_ROOT.'logout' ?>"><span class="oi oi-account-logout"></span><?php $L->p('Logout') ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
11
bl-kernel/admin/themes/booty/html/user-logged.php
Normal file
|
@ -0,0 +1,11 @@
|
|||
<!-- Check if the user is logged -->
|
||||
|
||||
<!-- DEBUG: Each request increase the count of simple stats -->
|
||||
|
||||
<!-- <script>
|
||||
setInterval(
|
||||
function() {
|
||||
var ajax = new bluditAjax();
|
||||
ajax.userLogged(showAlert);
|
||||
}, 15000);
|
||||
</script> -->
|
Before Width: | Height: | Size: 456 B After Width: | Height: | Size: 456 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
@ -8,33 +8,28 @@
|
|||
<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 ?>">
|
||||
<link rel="shortcut icon" type="image/x-icon" href="<?php echo DOMAIN_ADMIN_THEME.'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-auto-complete.css',
|
||||
'open-iconic-bootstrap.min.css',
|
||||
'jquery.datetimepicker.min.css',
|
||||
'select2.min.css',
|
||||
'select2-bootstrap4.min.css'
|
||||
), DOMAIN_CORE_CSS);
|
||||
'bludit.css'
|
||||
), DOMAIN_ADMIN_THEME_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);
|
||||
'jquery-auto-complete.min.js',
|
||||
'jquery.datetimepicker.full.min.js'
|
||||
), DOMAIN_ADMIN_THEME_JS);
|
||||
echo Theme::jsSortable();
|
||||
?>
|
||||
|
||||
<!-- Plugins -->
|
||||
|
@ -80,8 +75,6 @@
|
|||
<?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>';
|
||||
|
@ -91,6 +84,9 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Check user logged and Internet connection -->
|
||||
<?php include('html/user-logged.php'); ?>
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('adminBodyEnd') ?>
|
||||
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
<?php
|
||||
|
||||
class Bootstrap
|
||||
{
|
||||
class Bootstrap {
|
||||
|
||||
public static function modal($args)
|
||||
{
|
||||
public static function modal($args) {
|
||||
|
||||
$buttonSecondary = $args['buttonSecondary'];
|
||||
$buttonSecondaryClass = $args['buttonSecondaryClass'];
|
||||
|
@ -17,7 +15,7 @@ class Bootstrap
|
|||
$modalId = $args['modalId'];
|
||||
|
||||
|
||||
return <<<EOF
|
||||
return <<<EOF
|
||||
<div id="$modalId" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
|
@ -37,49 +35,49 @@ EOF;
|
|||
|
||||
public static function link($args)
|
||||
{
|
||||
$options = 'href="' . $args['href'] . '"';
|
||||
$options = 'href="'.$args['href'].'"';
|
||||
if (isset($args['class'])) {
|
||||
$options .= ' class="' . $args['class'] . '"';
|
||||
$options .= ' class="'.$args['class'].'"';
|
||||
}
|
||||
if (isset($args['target'])) {
|
||||
$options .= ' target="' . $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.'><span class="oi oi-'.$args['icon'].'" style="font-size: 0.7em;"></span> '.$args['title'].'</a>';
|
||||
}
|
||||
|
||||
return '<a ' . $options . '>' . $args['title'] . '</a>';
|
||||
return '<a '.$options.'>'.$args['title'].'</a>';
|
||||
}
|
||||
|
||||
public static function pageTitle($args)
|
||||
{
|
||||
$icon = $args['icon'];
|
||||
$title = $args['title'];
|
||||
return <<<EOF
|
||||
return <<<EOF
|
||||
<h2 class="mt-0 mb-3">
|
||||
<span class="fa fa-$icon" style="font-size: 0.9em;"></span><span>$title</span>
|
||||
<span class="oi oi-$icon" style="font-size: 0.7em;"></span> $title
|
||||
</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'] . '"';
|
||||
$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
|
||||
return <<<EOF
|
||||
<form $class $enctype $id $method $action $style autocomplete="off">
|
||||
EOF;
|
||||
}
|
||||
|
||||
public static function formClose()
|
||||
{
|
||||
return <<<EOF
|
||||
return <<<EOF
|
||||
</form>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
@ -97,7 +95,7 @@ EOF;
|
|||
public static function formTitle($args)
|
||||
{
|
||||
$title = $args['title'];
|
||||
return <<<EOF
|
||||
return <<<EOF
|
||||
<h6 class="mt-4 mb-2 pb-2 border-bottom text-uppercase">$title</h6>
|
||||
EOF;
|
||||
}
|
||||
|
@ -105,33 +103,28 @@ 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'] : '';
|
||||
$disabled = empty($args['disabled'])?'':'disabled';
|
||||
$placeholder = isset($args['placeholder'])?$args['placeholder']:'';
|
||||
$value = isset($args['value'])?$args['value']:'';
|
||||
|
||||
$id = 'js' . $name;
|
||||
$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'];
|
||||
if (isset($args['tip'])) {
|
||||
$tip = '<small class="form-text text-muted">'.$args['tip'].'</small>';
|
||||
}
|
||||
|
||||
$label = '';
|
||||
if (!empty($args['label'])) {
|
||||
$label = '<label class="' . $labelClass . '" for="' . $id . '">' . $args['label'] . '</label>';
|
||||
if (isset($args['label'])) {
|
||||
$label = '<label class="mt-4 mb-2 pb-2 border-bottom text-uppercase w-100" for="'.$id.'">'.$args['label'].'</label>';
|
||||
}
|
||||
|
||||
$class = 'form-control';
|
||||
if (isset($args['class'])) {
|
||||
$class = $class.' '.$args['class'];
|
||||
}
|
||||
|
||||
$type = 'text';
|
||||
|
@ -139,10 +132,10 @@ EOF;
|
|||
$type = $args['type'];
|
||||
}
|
||||
|
||||
return <<<EOF
|
||||
<div class="$class">
|
||||
return <<<EOF
|
||||
<div class="form-group m-0">
|
||||
$label
|
||||
<input type="text" dir="auto" value="$value" class="form-control" id="$id" name="$name" placeholder="$placeholder" $disabled>
|
||||
<input type="text" value="$value" class="$class" id="$id" name="$name" placeholder="$placeholder" $disabled>
|
||||
$tip
|
||||
</div>
|
||||
EOF;
|
||||
|
@ -150,19 +143,19 @@ EOF;
|
|||
|
||||
public static function formInputFile($args)
|
||||
{
|
||||
$id = 'js' . $args['name'];
|
||||
$id = 'js'.$args['name'];
|
||||
if (isset($args['id'])) {
|
||||
$id = $args['id'];
|
||||
}
|
||||
|
||||
$class = 'custom-file';
|
||||
if (isset($args['class'])) {
|
||||
$class = $class . ' ' . $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 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;
|
||||
|
@ -170,26 +163,26 @@ EOF;
|
|||
|
||||
public static function formTextarea($args)
|
||||
{
|
||||
$id = 'js' . $args['name'];
|
||||
$id = 'js'.$args['name'];
|
||||
if (isset($args['id'])) {
|
||||
$id = $args['id'];
|
||||
}
|
||||
|
||||
$class = 'form-control';
|
||||
if (isset($args['class'])) {
|
||||
$class = $class . ' ' . $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>';
|
||||
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 .= '<textarea class="' . $class . '" id="' . $id . '" name="' . $args['name'] . '" rows="' . $args['rows'] . '" placeholder="' . $args['placeholder'] . '">' . $args['value'] . '</textarea>';
|
||||
$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 .= '<small class="form-text text-muted">'.$args['tip'].'</small>';
|
||||
}
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
|
@ -199,24 +192,24 @@ EOF;
|
|||
|
||||
public static function formTextareaBlock($args)
|
||||
{
|
||||
$id = 'js' . $args['name'];
|
||||
$id = 'js'.$args['name'];
|
||||
if (isset($args['id'])) {
|
||||
$id = $args['id'];
|
||||
}
|
||||
|
||||
$class = 'form-control';
|
||||
if (!empty($args['class'])) {
|
||||
$class = $class . ' ' . $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 .= '<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>';
|
||||
$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 .= '<small class="form-text text-muted">'.$args['tip'].'</small>';
|
||||
}
|
||||
$html .= '</div>';
|
||||
|
||||
|
@ -226,29 +219,29 @@ EOF;
|
|||
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'] : '';
|
||||
$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;
|
||||
$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>';
|
||||
$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>';
|
||||
$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'];
|
||||
$class = $class.' '.$args['class'];
|
||||
}
|
||||
|
||||
$type = 'text';
|
||||
|
@ -256,11 +249,11 @@ EOF;
|
|||
$type = $args['type'];
|
||||
}
|
||||
|
||||
return <<<EOF
|
||||
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>
|
||||
<input class="$class" id="$id" name="$name" value="$value" placeholder="$placeholder" type="$type" $disabled $readonly>
|
||||
$tip
|
||||
</div>
|
||||
</div>
|
||||
|
@ -269,25 +262,20 @@ 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'] : '';
|
||||
$labelForCheckbox = isset($args['labelForCheckbox'])?$args['labelForCheckbox']:'';
|
||||
$placeholder = isset($args['placeholder'])?$args['placeholder']:'';
|
||||
$tip = isset($args['tip'])?$args['tip']:' ';
|
||||
$value = isset($args['value'])?$args['value']:'';
|
||||
$name = $args['name'];
|
||||
$id = 'js' . $name;
|
||||
$id = 'js'.$name;
|
||||
if (isset($args['id'])) {
|
||||
$id = $args['id'];
|
||||
}
|
||||
$disabled = isset($args['disabled']) ? 'disabled' : '';
|
||||
$disabled = isset($args['disabled'])?'disabled':'';
|
||||
|
||||
$class = 'form-group m-0';
|
||||
$class = 'form-group';
|
||||
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'];
|
||||
$class = $class.' '.$args['class'];
|
||||
}
|
||||
|
||||
$type = 'text';
|
||||
|
@ -297,19 +285,18 @@ EOF;
|
|||
|
||||
$label = '';
|
||||
if (!empty($args['label'])) {
|
||||
$label = '<label class="' . $labelClass . '">' . $args['label'] . '</label>';
|
||||
$label = '<label class="mt-4 mb-2 pb-2 border-bottom text-uppercase w-100">'.$args['label'].'</label>';
|
||||
}
|
||||
|
||||
$checked = $args['checked'] ? 'checked' : '';
|
||||
$value = $checked ? '1' : '0';
|
||||
$checked = $args['checked']?'checked':'';
|
||||
|
||||
return <<<EOF
|
||||
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>
|
||||
<input name="$name" class="form-check-input" type="checkbox" id="$id" $checked>
|
||||
<label class="form-check-label" for="$id">$labelForCheckbox</label>
|
||||
$tip
|
||||
<small class="form-text text-muted">$tip</small>
|
||||
</div>
|
||||
</div>
|
||||
EOF;
|
||||
|
@ -317,30 +304,30 @@ EOF;
|
|||
|
||||
public static function formSelect($args)
|
||||
{
|
||||
$id = 'js' . $args['name'];
|
||||
$id = 'js'.$args['name'];
|
||||
if (isset($args['id'])) {
|
||||
$id = $args['id'];
|
||||
}
|
||||
|
||||
$class = 'custom-select';
|
||||
if (isset($args['class'])) {
|
||||
$class = $class . ' ' . $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 .= '<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 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 .= '<small class="form-text text-muted">'.$args['tip'].'</small>';
|
||||
}
|
||||
$html .= '</div>';
|
||||
$html .= '</div>';
|
||||
|
@ -350,32 +337,32 @@ EOF;
|
|||
|
||||
public static function formSelectBlock($args)
|
||||
{
|
||||
$id = 'js' . $args['name'];
|
||||
$id = 'js'.$args['name'];
|
||||
if (isset($args['id'])) {
|
||||
$id = $args['id'];
|
||||
}
|
||||
|
||||
$class = 'custom-select';
|
||||
if (!empty($args['class'])) {
|
||||
$class = $class . ' ' . $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 .= '<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 . '">';
|
||||
$html .= '<select id="'.$id.'" name="'.$args['name'].'" class="'.$class.'">';
|
||||
if (!empty($args['emptyOption'])) {
|
||||
$html .= '<option value="">' . $args['emptyOption'] . '</option>';
|
||||
$html .= '<option value="">'.$args['emptyOption'].'</option>';
|
||||
}
|
||||
foreach ($args['options'] as $key => $value) {
|
||||
$html .= '<option ' . (($key == $args['selected']) ? 'selected' : '') . ' value="' . $key . '">' . $value . '</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 .= '<small class="form-text text-muted">'.$args['tip'].'</small>';
|
||||
}
|
||||
$html .= '</div>';
|
||||
|
||||
|
@ -384,19 +371,19 @@ EOF;
|
|||
|
||||
public static function formInputHidden($args)
|
||||
{
|
||||
return '<input type="hidden" id="js' . $args['name'] . '" name="' . $args['name'] . '" value="' . $args['value'] . '">';
|
||||
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'];
|
||||
$class = $class.' '.$args['class'];
|
||||
}
|
||||
|
||||
$text = $args['text'];
|
||||
|
||||
return <<<EOF
|
||||
return <<<EOF
|
||||
<div class="$class" role="alert">$text</div>
|
||||
EOF;
|
||||
}
|
||||
|
|
3
bl-kernel/admin/themes/booty/js/jquery-auto-complete.min.js
vendored
Executable file
|
@ -0,0 +1,3 @@
|
|||
// jQuery autoComplete v1.0.7
|
||||
// https://github.com/Pixabay/jQuery-autoComplete
|
||||
!function(e){e.fn.autoComplete=function(t){var o=e.extend({},e.fn.autoComplete.defaults,t);return"string"==typeof t?(this.each(function(){var o=e(this);"destroy"==t&&(e(window).off("resize.autocomplete",o.updateSC),o.off("blur.autocomplete focus.autocomplete keydown.autocomplete keyup.autocomplete"),o.data("autocomplete")?o.attr("autocomplete",o.data("autocomplete")):o.removeAttr("autocomplete"),e(o.data("sc")).remove(),o.removeData("sc").removeData("autocomplete"))}),this):this.each(function(){function t(e){var t=s.val();if(s.cache[t]=e,e.length&&t.length>=o.minChars){for(var a="",c=0;c<e.length;c++)a+=o.renderItem(e[c],t);s.sc.html(a),s.updateSC(0)}else s.sc.hide()}var s=e(this);s.sc=e('<div class="autocomplete-suggestions '+o.menuClass+'"></div>'),s.data("sc",s.sc).data("autocomplete",s.attr("autocomplete")),s.attr("autocomplete","off"),s.cache={},s.last_val="",s.updateSC=function(t,o){if(s.sc.css({top:s.offset().top+s.outerHeight(),left:s.offset().left,width:s.outerWidth()}),!t&&(s.sc.show(),s.sc.maxHeight||(s.sc.maxHeight=parseInt(s.sc.css("max-height"))),s.sc.suggestionHeight||(s.sc.suggestionHeight=e(".autocomplete-suggestion",s.sc).first().outerHeight()),s.sc.suggestionHeight))if(o){var a=s.sc.scrollTop(),c=o.offset().top-s.sc.offset().top;c+s.sc.suggestionHeight-s.sc.maxHeight>0?s.sc.scrollTop(c+s.sc.suggestionHeight+a-s.sc.maxHeight):0>c&&s.sc.scrollTop(c+a)}else s.sc.scrollTop(0)},e(window).on("resize.autocomplete",s.updateSC),s.sc.appendTo("body"),s.sc.on("mouseleave",".autocomplete-suggestion",function(){e(".autocomplete-suggestion.selected").removeClass("selected")}),s.sc.on("mouseenter",".autocomplete-suggestion",function(){e(".autocomplete-suggestion.selected").removeClass("selected"),e(this).addClass("selected")}),s.sc.on("mousedown click",".autocomplete-suggestion",function(t){var a=e(this),c=a.data("val");return(c||a.hasClass("autocomplete-suggestion"))&&(s.val(c),o.onSelect(t,c,a),s.sc.hide()),!1}),s.on("blur.autocomplete",function(){try{over_sb=e(".autocomplete-suggestions:hover").length}catch(t){over_sb=0}over_sb?s.is(":focus")||setTimeout(function(){s.focus()},20):(s.last_val=s.val(),s.sc.hide(),setTimeout(function(){s.sc.hide()},350))}),o.minChars||s.on("focus.autocomplete",function(){s.last_val="\n",s.trigger("keyup.autocomplete")}),s.on("keydown.autocomplete",function(t){if((40==t.which||38==t.which)&&s.sc.html()){var a,c=e(".autocomplete-suggestion.selected",s.sc);return c.length?(a=40==t.which?c.next(".autocomplete-suggestion"):c.prev(".autocomplete-suggestion"),a.length?(c.removeClass("selected"),s.val(a.addClass("selected").data("val"))):(c.removeClass("selected"),s.val(s.last_val),a=0)):(a=40==t.which?e(".autocomplete-suggestion",s.sc).first():e(".autocomplete-suggestion",s.sc).last(),s.val(a.addClass("selected").data("val"))),s.updateSC(0,a),!1}if(27==t.which)s.val(s.last_val).sc.hide();else if(13==t.which||9==t.which){var c=e(".autocomplete-suggestion.selected",s.sc);c.length&&s.sc.is(":visible")&&(o.onSelect(t,c.data("val"),c),setTimeout(function(){s.sc.hide()},20))}}),s.on("keyup.autocomplete",function(a){if(!~e.inArray(a.which,[13,27,35,36,37,38,39,40])){var c=s.val();if(c.length>=o.minChars){if(c!=s.last_val){if(s.last_val=c,clearTimeout(s.timer),o.cache){if(c in s.cache)return void t(s.cache[c]);for(var l=1;l<c.length-o.minChars;l++){var i=c.slice(0,c.length-l);if(i in s.cache&&!s.cache[i].length)return void t([])}}s.timer=setTimeout(function(){o.source(c,t)},o.delay)}}else s.last_val=c,s.sc.hide()}})})},e.fn.autoComplete.defaults={source:0,minChars:3,delay:150,cache:1,menuClass:"",renderItem:function(e,t){t=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");var o=new RegExp("("+t.split(" ").join("|")+")","gi");return'<div class="autocomplete-suggestion" data-val="'+e+'">'+e.replace(o,"<b>$1</b>")+"</div>"},onSelect:function(e,t,o){}}}(jQuery);
|
|
@ -1,57 +1,53 @@
|
|||
<!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">
|
||||
<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 ?>">
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" type="image/x-icon" href="<?php echo HTML_PATH_ADMIN_THEME.'img/favicon.png?version='.BLUDIT_VERSION ?>">
|
||||
|
||||
<!-- CSS -->
|
||||
<?php
|
||||
echo Theme::cssBootstrap();
|
||||
echo Theme::css(array(
|
||||
'bludit.css',
|
||||
'bludit.bootstrap.css'
|
||||
), DOMAIN_ADMIN_THEME_CSS);
|
||||
?>
|
||||
<!-- CSS -->
|
||||
<?php
|
||||
echo Theme::cssBootstrap();
|
||||
echo Theme::css(array(
|
||||
'bludit.css'
|
||||
), DOMAIN_ADMIN_THEME_CSS);
|
||||
?>
|
||||
|
||||
<!-- Javascript -->
|
||||
<?php
|
||||
echo Theme::jquery();
|
||||
echo Theme::jsBootstrap();
|
||||
?>
|
||||
<!-- Javascript -->
|
||||
<?php
|
||||
echo Theme::jquery();
|
||||
echo Theme::jsBootstrap();
|
||||
?>
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('loginHead') ?>
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('loginHead') ?>
|
||||
</head>
|
||||
|
||||
<body class="login">
|
||||
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('loginBodyBegin') ?>
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('loginBodyBegin') ?>
|
||||
|
||||
<!-- Alert -->
|
||||
<?php include('html/alert.php'); ?>
|
||||
<!-- 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>
|
||||
<div class="container">
|
||||
<div class="row justify-content-md-center pt-5">
|
||||
<div class="col-md-4 pt-5">
|
||||
<?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') ?>
|
||||
<!-- Plugins -->
|
||||
<?php Theme::plugins('loginBodyEnd') ?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
echo Bootstrap::pageTitle(array('title'=>$L->g('About'), 'icon'=>'info-circle'));
|
||||
echo Bootstrap::pageTitle(array('title'=>$L->g('About'), 'icon'=>'info'));
|
||||
|
||||
echo '
|
||||
<table class="table table-striped mt-3">
|
||||
|
@ -10,7 +10,7 @@ echo '
|
|||
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>';
|
||||
echo '<td>PRO - '.$L->g('Thanks for support Bludit').'</td>';
|
||||
} else {
|
||||
echo '<td>Standard - <a target="_blank" href="https://pro.bludit.com">'.$L->g('Upgrade to Bludit PRO').'</a></td>';
|
||||
}
|
||||
|
@ -31,11 +31,6 @@ 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>';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
echo Bootstrap::pageTitle(array('title'=>$L->g('Content'), 'icon'=>'archive'));
|
||||
echo Bootstrap::pageTitle(array('title'=>$L->g('Content'), 'icon'=>'layers'));
|
||||
|
||||
function table($type) {
|
||||
global $url;
|
||||
|
@ -10,7 +10,6 @@ function table($type) {
|
|||
global $scheduled;
|
||||
global $static;
|
||||
global $sticky;
|
||||
global $autosave;
|
||||
|
||||
if ($type=='published') {
|
||||
$list = $published;
|
||||
|
@ -52,32 +51,25 @@ function table($type) {
|
|||
echo '</p>';
|
||||
return false;
|
||||
}
|
||||
} elseif ($type=='autosave') {
|
||||
$list = $autosave;
|
||||
}
|
||||
|
||||
echo '
|
||||
<table class="table mt-3">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="border-0" scope="col">'.$L->g('Title').'</th>
|
||||
';
|
||||
|
||||
if ($type=='published' || $type=='static' || $type=='sticky') {
|
||||
echo '<th class="border-0 d-none d-lg-table-cell" scope="col">'.$L->g('URL').'</th>';
|
||||
}
|
||||
|
||||
echo ' <th class="border-0 text-center d-sm-table-cell" scope="col">'.$L->g('Actions').'</th>
|
||||
<th style="font-size: 0.8em;" class="border-0 text-uppercase text-muted" scope="col">'.$L->g('Title').'</th>
|
||||
<th style="font-size: 0.8em;" class="border-0 d-none d-lg-table-cell text-uppercase text-muted" scope="col">'.$L->g('URL').'</th>
|
||||
<th style="font-size: 0.8em;" class="border-0 text-center d-none d-sm-table-cell text-uppercase text-muted" scope="col">'.$L->g('Actions').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
';
|
||||
|
||||
if ( (ORDER_BY=='position') || $type=='static' ) {
|
||||
if (ORDER_BY=='position') {
|
||||
foreach ($list as $pageKey) {
|
||||
try {
|
||||
$page = new Page($pageKey);
|
||||
if (!$page->isChild()) {
|
||||
if (!$page->isChild() || $type!='published') {
|
||||
echo '<tr>
|
||||
<td>
|
||||
<div>
|
||||
|
@ -90,23 +82,20 @@ function table($type) {
|
|||
</div>
|
||||
</td>';
|
||||
|
||||
if ($type=='published' || $type=='static' || $type=='sticky') {
|
||||
$friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$page->key() : '/'.$url->filters('page').'/'.$page->key();
|
||||
echo '<td class="d-none d-lg-table-cell"><a target="_blank" href="'.$page->permalink().'">'.$friendlyURL.'</a></td>';
|
||||
}
|
||||
|
||||
echo '<td class="contentTools pt-3 text-center d-sm-table-cell">'.PHP_EOL;
|
||||
echo '<a class="text-secondary d-none d-md-inline" target="_blank" href="'.$page->permalink().'"><i class="fa fa-desktop"></i>'.$L->g('View').'</a>'.PHP_EOL;
|
||||
echo '<a class="text-secondary d-none d-md-inline ml-2" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><i class="fa fa-edit"></i>'.$L->g('Edit').'</a>'.PHP_EOL;
|
||||
echo '<td class="contentTools pt-3 text-center d-sm-table-cell w-25">'.PHP_EOL;
|
||||
echo '<a class="btn btn-outline-secondary btn-sm mb-1" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><span class="oi oi-pencil"></span> '.$L->g('Edit').'</a>'.PHP_EOL;
|
||||
if (count($page->children())==0) {
|
||||
echo '<a href="#" class="ml-2 text-danger deletePageButton d-block d-sm-inline" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'.$page->key().'"><i class="fa fa-trash"></i>'.$L->g('Delete').'</a>'.PHP_EOL;
|
||||
echo '<button type="button" class="btn btn-outline-danger btn-sm deletePageButton mb-1" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'.$page->key().'"><span class="oi oi-trash"></span> '.$L->g('Delete').'</button>'.PHP_EOL;
|
||||
}
|
||||
echo '</td>';
|
||||
|
||||
echo '</tr>';
|
||||
|
||||
foreach ($page->children() as $child) {
|
||||
//if ($child->published()) {
|
||||
if ($child->published()) {
|
||||
echo '<tr>
|
||||
<td class="child">
|
||||
<div>
|
||||
|
@ -119,21 +108,16 @@ function table($type) {
|
|||
</div>
|
||||
</td>';
|
||||
|
||||
if ($type=='published' || $type=='static' || $type=='sticky') {
|
||||
$friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$child->key() : '/'.$url->filters('page').'/'.$child->key();
|
||||
echo '<td class="d-none d-lg-table-cell"><a target="_blank" href="'.$child->permalink().'">'.$friendlyURL.'</a></td>';
|
||||
}
|
||||
echo '<td><a target="_blank" href="'.$child->permalink().'">'.$friendlyURL.'</a></td>';
|
||||
|
||||
echo '<td class="contentTools pt-3 text-center d-sm-table-cell">'.PHP_EOL;
|
||||
if ($type=='published' || $type=='static' || $type=='sticky') {
|
||||
echo '<a class="text-secondary d-none d-md-inline" target="_blank" href="'.$child->permalink().'"><i class="fa fa-desktop"></i>'.$L->g('View').'</a>'.PHP_EOL;
|
||||
}
|
||||
echo '<a class="text-secondary d-none d-md-inline ml-2" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$child->key().'"><i class="fa fa-edit"></i>'.$L->g('Edit').'</a>'.PHP_EOL;
|
||||
echo '<a class="ml-2 text-danger deletePageButton d-block d-sm-inline" href="#" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'.$child->key().'"><i class="fa fa-trash"></i>'.$L->g('Delete').'</a>'.PHP_EOL;
|
||||
echo '<td class="contentTools pt-3 text-center d-sm-table-cell w-25">'.PHP_EOL;
|
||||
echo '<a class="btn btn-outline-secondary btn-sm mb-1" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$child->key().'"><span class="oi oi-pencil"></span> '.$L->g('Edit').'</a>'.PHP_EOL;
|
||||
echo '<button type="button" class="btn btn-outline-danger btn-sm deletePageButton mb-1" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'.$child->key().'"><span class="oi oi-trash"></span> '.$L->g('Delete').'</button>'.PHP_EOL;
|
||||
echo '</td>';
|
||||
|
||||
echo '</tr>';
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
|
@ -156,18 +140,13 @@ function table($type) {
|
|||
</div>
|
||||
</td>';
|
||||
|
||||
if ($type=='published' || $type=='static' || $type=='sticky') {
|
||||
$friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$page->key() : '/'.$url->filters('page').'/'.$page->key();
|
||||
echo '<td class="pt-3 d-none d-lg-table-cell"><a target="_blank" href="'.$page->permalink().'">'.$friendlyURL.'</a></td>';
|
||||
}
|
||||
|
||||
echo '<td class="contentTools pt-3 text-center d-sm-table-cell">'.PHP_EOL;
|
||||
if ($type=='published' || $type=='static' || $type=='sticky') {
|
||||
echo '<a class="text-secondary d-none d-md-inline" target="_blank" href="'.$page->permalink().'"><i class="fa fa-desktop"></i>'.$L->g('View').'</a>'.PHP_EOL;
|
||||
}
|
||||
echo '<a class="text-secondary d-none d-md-inline ml-2" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><i class="fa fa-edit"></i>'.$L->g('Edit').'</a>'.PHP_EOL;
|
||||
echo '<td class="contentTools pt-3 text-center d-sm-table-cell w-25">'.PHP_EOL;
|
||||
echo '<a class="btn btn-outline-secondary btn-sm mb-1" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><span class="oi oi-pencil"></span> '.$L->g('Edit').'</a>'.PHP_EOL;
|
||||
if (count($page->children())==0) {
|
||||
echo '<a href="#" class="ml-2 text-danger deletePageButton d-block d-sm-inline" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'.$page->key().'"><i class="fa fa-trash"></i>'.$L->g('Delete').'</a>'.PHP_EOL;
|
||||
echo '<button type="button" class="btn btn-outline-danger btn-sm deletePageButton mb-1" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'.$page->key().'"><span class="oi oi-trash"></span> '.$L->g('Delete').'</button>'.PHP_EOL;
|
||||
}
|
||||
echo '</td>';
|
||||
|
||||
|
@ -201,18 +180,12 @@ function table($type) {
|
|||
<a class="nav-link" id="scheduled-tab" data-toggle="tab" href="#scheduled" role="tab"><?php $L->p('Scheduled') ?> <?php if (count($scheduled)>0) { echo '<span class="badge badge-danger">'.count($scheduled).'</span>'; } ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="draft-tab" data-toggle="tab" href="#draft" role="tab"><?php $L->p('Draft') ?></a>
|
||||
<a class="nav-link" id="draft-tab" data-toggle="tab" href="#draft" role="tab"><?php $L->p('Draft') ?> <?php if (count($drafts)>0) { echo '<span class="badge badge-danger">'.count($drafts).'</span>'; } ?></a>
|
||||
</li>
|
||||
<?php if (!empty($autosave)): ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="autosave-tab" data-toggle="tab" href="#autosave" role="tab"><?php $L->p('Autosave') ?></a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<!-- TABS PAGES -->
|
||||
<div class="tab-pane show active" id="pages" role="tabpanel">
|
||||
|
||||
<?php table('published'); ?>
|
||||
|
||||
<?php if (Paginator::numberOfPages() > 1): ?>
|
||||
|
@ -222,7 +195,7 @@ function table($type) {
|
|||
|
||||
<!-- First button -->
|
||||
<li class="page-item <?php if (!Paginator::showPrev()) echo 'disabled' ?>">
|
||||
<a class="page-link" href="<?php echo Paginator::firstPageUrl() ?>"><span class="align-middle fa fa-media-skip-backward"></span> <?php echo $L->get('First'); ?></a>
|
||||
<a class="page-link" href="<?php echo Paginator::firstPageUrl() ?>"><span class="align-middle oi oi-media-skip-backward"></span> <?php echo $L->get('First'); ?></a>
|
||||
</li>
|
||||
|
||||
<!-- Previous button -->
|
||||
|
@ -237,7 +210,7 @@ function table($type) {
|
|||
|
||||
<!-- Last button -->
|
||||
<li class="page-item <?php if (!Paginator::showNext()) echo 'disabled' ?>">
|
||||
<a class="page-link" href="<?php echo Paginator::lastPageUrl() ?>"><?php echo $L->get('Last'); ?> <span class="align-middle fa fa-media-skip-forward"></span></a>
|
||||
<a class="page-link" href="<?php echo Paginator::lastPageUrl() ?>"><?php echo $L->get('Last'); ?> <span class="align-middle oi oi-media-skip-forward"></span></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -264,13 +237,6 @@ function table($type) {
|
|||
<div class="tab-pane" id="draft" role="tabpanel">
|
||||
<?php table('draft'); ?>
|
||||
</div>
|
||||
|
||||
<!-- TABS AUTOSAVE -->
|
||||
<?php if (!empty($autosave)): ?>
|
||||
<div class="tab-pane" id="autosave" role="tabpanel">
|
||||
<?php table('autosave'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!-- Modal for delete page -->
|
||||
|
|
|
@ -1,140 +1,101 @@
|
|||
<div id="dashboard" class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<div class="row">
|
||||
<div class="col-md-7 d-none d-sm-block">
|
||||
|
||||
<!-- Good message -->
|
||||
<div>
|
||||
<h2 id="hello-message" class="pt-0">
|
||||
<?php
|
||||
$username = $login->username();
|
||||
$user = new User($username);
|
||||
$name = '';
|
||||
if ($user->nickname()) {
|
||||
$name = $user->nickname();
|
||||
} elseif ($user->firstName()) {
|
||||
$name = $user->firstName();
|
||||
}
|
||||
?>
|
||||
<span class="fa fa-hand-spock-o"></span><span><?php echo $L->g('welcome') ?></span>
|
||||
</h2>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#hello-message").fadeOut(2400, function() {
|
||||
var date = new Date()
|
||||
var hours = date.getHours()
|
||||
if (hours >= 6 && hours < 12) {
|
||||
$(this).html('<span class="fa fa-sun-o"></span><?php echo $L->g('good-morning') . ', ' . $name ?>');
|
||||
} else if (hours >= 12 && hours < 18) {
|
||||
$(this).html('<span class="fa fa-sun-o"></span><?php echo $L->g('good-afternoon') . ', ' . $name ?>');
|
||||
} else if (hours >= 18 && hours < 22) {
|
||||
$(this).html('<span class="fa fa-moon-o"></span><?php echo $L->g('good-evening') . ', ' . $name ?>');
|
||||
} else {
|
||||
$(this).html('<span class="fa fa-moon-o"></span><span><?php echo $L->g('good-night') . ', ' . $name ?></span>');
|
||||
}
|
||||
}).fadeIn(1000);
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<!-- Good message -->
|
||||
<div>
|
||||
<h2 id="hello-message"><?php echo $L->g('hello') ?></h2>
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
$("#hello-message").fadeOut(1000, function() {
|
||||
var date = new Date()
|
||||
var hours = date.getHours()
|
||||
if (hours > 6 && hours < 12) {
|
||||
$(this).html('<span class="oi oi-sun"></span> <?php echo $L->g('good-morning') ?>');
|
||||
} else if (hours > 12 && hours < 18) {
|
||||
$(this).html('<span class="oi oi-sun"></span> <?php echo $L->g('good-afternoon') ?>');
|
||||
} else if (hours > 18 && hours < 22) {
|
||||
$(this).html('<span class="oi oi-moon"></span> <?php echo $L->g('good-evening') ?>');
|
||||
} else {
|
||||
$(this).html('<span class="oi oi-moon"></span> <?php echo $L->g('good-night') ?>');
|
||||
}
|
||||
}).fadeIn(1000);
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<!-- Quick Links -->
|
||||
<div class="container pb-5" id="jsclippyContainer">
|
||||
<!-- Quick Links -->
|
||||
<div class="container border-bottom pb-4">
|
||||
<h4 class="pb-3"><?php $L->p('Quick links') ?></h4>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<a class="quick-links text-center" style="color: #4586d4" href="<?php echo HTML_PATH_ADMIN_ROOT.'new-content' ?>">
|
||||
<div class="oi oi-justify-left quick-links-icons"></div>
|
||||
<div><?php $L->p('New content') ?></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col border-left border-right">
|
||||
<a class="quick-links text-center" href="<?php echo HTML_PATH_ADMIN_ROOT.'categories' ?>">
|
||||
<div class="oi oi-tags quick-links-icons"></div>
|
||||
<div><?php $L->p('Categories') ?></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col">
|
||||
<a class="quick-links text-center" href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>">
|
||||
<div class="oi oi-people quick-links-icons"></div>
|
||||
<div><?php $L->p('Users') ?></div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container mt-4">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<a class="quick-links text-center" target="_blank" href="https://docs.bludit.com">
|
||||
<div class="oi oi-compass quick-links-icons"></div>
|
||||
<div><?php $L->p('Documentation') ?></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col border-left border-right">
|
||||
<a class="quick-links text-center" target="_blank" href="https://forum.bludit.org">
|
||||
<div class="oi oi-loop-square quick-links-icons"></div>
|
||||
<div><?php $L->p('Forum support') ?></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col">
|
||||
<a class="quick-links text-center" target="_blank" href="https://gitter.im/bludit/support">
|
||||
<div class="oi oi-chat quick-links-icons"></div>
|
||||
<div><?php $L->p('Chat support') ?></div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col p-0">
|
||||
<div class="form-group">
|
||||
<select id="jsclippy" class="clippy" name="state"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php Theme::plugins('dashboard') ?>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
<!-- Notifications -->
|
||||
<ul class="list-group list-group-striped b-0">
|
||||
<li class="list-group-item pt-0"><h4><?php $L->p('Notifications') ?></h4></li>
|
||||
<?php
|
||||
$logs = array_slice($syslog->db, 0, NOTIFICATIONS_AMOUNT);
|
||||
foreach ($logs as $log) {
|
||||
$phrase = $L->g($log['dictionaryKey']);
|
||||
echo '<li class="list-group-item">';
|
||||
echo $phrase;
|
||||
if (!empty($log['notes'])) {
|
||||
echo ' « <b>'.$log['notes'].'</b> »';
|
||||
}
|
||||
echo '<br><span class="notification-date"><small>';
|
||||
echo Date::format($log['date'], DB_DATE_FORMAT, NOTIFICATIONS_DATE_FORMAT);
|
||||
echo ' [ '.$log['username'] .' ]';
|
||||
echo '</small></span>';
|
||||
echo '</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
var clippy = $("#jsclippy").select2({
|
||||
placeholder: "<?php $L->p('Start typing to see a list of suggestions') ?>",
|
||||
allowClear: true,
|
||||
width: "100%",
|
||||
theme: "bootstrap4",
|
||||
minimumInputLength: 2,
|
||||
dropdownParent: "#jsclippyContainer",
|
||||
language: {
|
||||
inputTooShort: function() {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
ajax: {
|
||||
url: HTML_PATH_ADMIN_ROOT + "ajax/clippy",
|
||||
data: function(params) {
|
||||
var query = {
|
||||
query: params.term
|
||||
}
|
||||
return query;
|
||||
},
|
||||
processResults: function(data) {
|
||||
return data;
|
||||
}
|
||||
},
|
||||
templateResult: function(data) {
|
||||
// console.log(data);
|
||||
var html = '';
|
||||
if (data.type == 'menu') {
|
||||
html += '<a href="' + data.url + '"><div class="search-suggestion">';
|
||||
html += '<span class="fa fa-' + data.icon + '"></span>' + data.text + '</div></a>';
|
||||
} else {
|
||||
if (typeof data.id === 'undefined') {
|
||||
return '';
|
||||
}
|
||||
html += '<div class="search-suggestion">';
|
||||
html += '<div class="search-suggestion-item">' + data.text + ' <span class="badge badge-pill badge-light">' + data.type + '</span></div>';
|
||||
html += '<div class="search-suggestion-options">';
|
||||
html += '<a target="_blank" href="' + DOMAIN_PAGES + data.id + '"><?php $L->p('view') ?></a>';
|
||||
html += '<a class="ml-2" href="' + DOMAIN_ADMIN + 'edit-content/' + data.id + '"><?php $L->p('edit') ?></a>';
|
||||
html += '</div></div>';
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
escapeMarkup: function(markup) {
|
||||
return markup;
|
||||
}
|
||||
}).on("select2:closing", function(e) {
|
||||
e.preventDefault();
|
||||
}).on("select2:closed", function(e) {
|
||||
clippy.select2("open");
|
||||
});
|
||||
clippy.select2("open");
|
||||
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<?php Theme::plugins('dashboard') ?>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
|
||||
<!-- Notifications -->
|
||||
<ul class="list-group list-group-striped b-0">
|
||||
<li class="list-group-item pt-0">
|
||||
<h4 class="m-0"><?php $L->p('Notifications') ?></h4>
|
||||
</li>
|
||||
<?php
|
||||
$logs = array_slice($syslog->db, 0, NOTIFICATIONS_AMOUNT);
|
||||
foreach ($logs as $log) {
|
||||
$phrase = $L->g($log['dictionaryKey']);
|
||||
echo '<li class="list-group-item">';
|
||||
echo $phrase;
|
||||
if (!empty($log['notes'])) {
|
||||
echo ' « <b>' . $log['notes'] . '</b> »';
|
||||
}
|
||||
echo '<br><span class="notification-date"><small>';
|
||||
echo Date::format($log['date'], DB_DATE_FORMAT, NOTIFICATIONS_DATE_FORMAT);
|
||||
echo ' [ ' . $log['username'] . ' ]';
|
||||
echo '</small></span>';
|
||||
echo '</li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
echo Bootstrap::pageTitle(array('title'=>$L->g('Developers'), 'icon'=>'gears'));
|
||||
echo Bootstrap::pageTitle(array('title'=>$L->g('Developers'), 'icon'=>'beaker'));
|
||||
|
||||
echo '<h2 class="mb-4 mt-4"><b>PHP version: '.phpversion().'</b></h2>';
|
||||
|
||||
|
@ -34,5 +34,5 @@ $constants = get_defined_constants(true);
|
|||
printTable('Bludit Constants', $constants['user']);
|
||||
|
||||
// Site object
|
||||
printTable('$site object database',$site->db);
|
||||
printTable('$Site object database',$site->db);
|
||||
|
||||
|
|
|
@ -4,63 +4,81 @@
|
|||
|
||||
// FORM START
|
||||
echo Bootstrap::formOpen(array(
|
||||
'id' => 'jsform',
|
||||
'class' => 'd-flex flex-column h-100'
|
||||
'id'=>'jsform',
|
||||
'class'=>'d-flex flex-column h-100'
|
||||
));
|
||||
|
||||
// Token CSRF
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name' => 'tokenCSRF',
|
||||
'value' => $security->getTokenCSRF()
|
||||
));
|
||||
// Token CSRF
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$security->getTokenCSRF()
|
||||
));
|
||||
|
||||
// UUID
|
||||
// The UUID is generated in the controller
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name' => 'uuid',
|
||||
'value' => $page->uuid()
|
||||
));
|
||||
// Parent
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'parent',
|
||||
'value'=>$page->parent()
|
||||
));
|
||||
|
||||
// Type = published, draft, sticky, static
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name' => 'type',
|
||||
'value' => $page->type()
|
||||
));
|
||||
// UUID
|
||||
// The UUID is generated in the controller
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'uuid',
|
||||
'value'=>$uuid
|
||||
));
|
||||
|
||||
// Cover image
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name' => 'coverImage',
|
||||
'value' => $page->coverImage(false)
|
||||
));
|
||||
// Type = published, draft, sticky, static
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'type',
|
||||
'value'=>$page->type()
|
||||
));
|
||||
|
||||
// Content
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name' => 'content',
|
||||
'value' => ''
|
||||
));
|
||||
// Cover image
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'coverImage',
|
||||
'value'=>$page->coverImage(false)
|
||||
));
|
||||
|
||||
// Current page key
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name' => 'key',
|
||||
'value' => $page->key()
|
||||
));
|
||||
// Content
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'content',
|
||||
'value'=>''
|
||||
));
|
||||
|
||||
// Current page key
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'key',
|
||||
'value'=>$page->key()
|
||||
));
|
||||
?>
|
||||
|
||||
<!-- TOOLBAR -->
|
||||
<div id="jseditorToolbar" class="mb-1">
|
||||
<div id="jseditorToolbar">
|
||||
<div id="jseditorToolbarRight" class="btn-group btn-group-sm float-right" role="group" aria-label="Toolbar right">
|
||||
<button type="button" class="btn btn-light" id="jsmediaManagerOpenModal" data-toggle="modal" data-target="#jsmediaManagerModal"><span class="fa fa-image"></span> <?php $L->p('Images') ?></button>
|
||||
<button type="button" class="btn btn-light" id="jsoptionsSidebar" style="z-index:30"><span class="fa fa-cog"></span> <?php $L->p('Options') ?></button>
|
||||
<button type="button" class="btn btn-light" id="jsmediaManagerOpenModal" data-toggle="modal" data-target="#jsmediaManagerModal"><span class="oi oi-image"></span> <?php $L->p('Images') ?></button>
|
||||
<button type="button" class="btn btn-light" id="jsoptionsSidebar" style="z-index:30"><span class="oi oi-cog"></span> <?php $L->p('Options') ?></button>
|
||||
</div>
|
||||
|
||||
<div id="jseditorToolbarLeft">
|
||||
<button type="button" class="btn btn-sm btn-primary" id="jsbuttonSave"><?php echo $L->g('Save') ?></button>
|
||||
<button id="jsbuttonPreview" type="button" class="btn btn-sm btn-secondary"><?php $L->p('Preview') ?></button>
|
||||
<span id="jsswitchButton" data-switch="<?php echo ($page->draft() ? 'draft' : 'publish') ?>" class="ml-2 text-secondary switch-button"><i class="fa fa-square switch-icon-<?php echo ($page->draft() ? 'draft' : 'publish') ?>"></i> <?php echo ($page->draft() ? $L->g('Draft') : $L->g('Publish')) ?></span>
|
||||
|
||||
<!-- <?php if (count($page->children())==0): ?>
|
||||
<button type="button" class="btn btn-sm btn-danger" id="jsbuttonDelete" data-toggle="modal" data-target="#jsdeletePageModal"><?php $L->p('Delete') ?></button>
|
||||
<?php endif; ?> -->
|
||||
|
||||
<span class="d-inline-block align-middle ml-1">
|
||||
<div class="switch" style="width:<?php echo max(100,Text::length($L->g('Publish'))* 15) ?>px">
|
||||
<input type="radio" class="switch-input" name="switch" value="" id="jsPublishSwitch" <?php echo (!$page->draft()?'checked':'') ?>>
|
||||
<label for="jsPublishSwitch" class="switch-label switch-label-off"><?php $L->p('Publish') ?></label>
|
||||
<input type="radio" class="switch-input" name="switch" value="" id="jsDraftSwitch" <?php echo ($page->draft()?'checked':'') ?>>
|
||||
<label for="jsDraftSwitch" class="switch-label switch-label-on"><?php $L->p('Draft') ?></label>
|
||||
<span class="switch-selection"></span>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<?php if ($page->scheduled()) : ?>
|
||||
<div class="alert alert-warning p-1 mt-1 mb-0"><?php $L->p('scheduled') ?>: <?php echo $page->date(SCHEDULED_DATE_FORMAT) ?></div>
|
||||
<?php if($page->scheduled()): ?>
|
||||
<div class="alert alert-warning p-1 mt-1 mb-0"><?php $L->p('scheduled') ?>: <?php echo $page->date(SCHEDULED_DATE_FORMAT) ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<script>
|
||||
|
@ -81,11 +99,8 @@ echo Bootstrap::formInputHidden(array(
|
|||
<div id="jseditorSidebar">
|
||||
<nav>
|
||||
<div class="nav nav-tabs" id="nav-tab" role="tablist">
|
||||
<a class="nav-link active show" id="nav-general-tab" data-toggle="tab" href="#nav-general" role="tab" aria-controls="general"><?php $L->p('General') ?></a>
|
||||
<a class="nav-link active show" id="nav-general-tab" data-toggle="tab" href="#nav-general" role="tab" aria-controls="general"><?php $L->p('General') ?></a>
|
||||
<a class="nav-link" id="nav-advanced-tab" data-toggle="tab" href="#nav-advanced" role="tab" aria-controls="advanced"><?php $L->p('Advanced') ?></a>
|
||||
<?php if (!empty($site->customFields())) : ?>
|
||||
<a class="nav-link" id="nav-custom-tab" data-toggle="tab" href="#nav-custom" role="tab" aria-controls="custom"><?php $L->p('Custom') ?></a>
|
||||
<?php endif ?>
|
||||
<a class="nav-link" id="nav-seo-tab" data-toggle="tab" href="#nav-seo" role="tab" aria-controls="seo"><?php $L->p('SEO') ?></a>
|
||||
</div>
|
||||
</nav>
|
||||
|
@ -93,40 +108,40 @@ echo Bootstrap::formInputHidden(array(
|
|||
<div class="tab-content pr-3 pl-3 pb-3">
|
||||
<div id="nav-general" class="tab-pane fade show active" role="tabpanel" aria-labelledby="general-tab">
|
||||
<?php
|
||||
// Category
|
||||
echo Bootstrap::formSelectBlock(array(
|
||||
'name' => 'category',
|
||||
'label' => $L->g('Category'),
|
||||
'selected' => $page->categoryKey(),
|
||||
'class' => '',
|
||||
'emptyOption' => '- ' . $L->g('Uncategorized') . ' -',
|
||||
'options' => $categories->getKeyNameArray()
|
||||
));
|
||||
// Category
|
||||
echo Bootstrap::formSelectBlock(array(
|
||||
'name'=>'category',
|
||||
'label'=>$L->g('Category'),
|
||||
'selected'=>$page->categoryKey(),
|
||||
'class'=>'',
|
||||
'emptyOption'=>'- '.$L->g('Uncategorized').' -',
|
||||
'options'=>$categories->getKeyNameArray()
|
||||
));
|
||||
|
||||
// Description
|
||||
echo Bootstrap::formTextareaBlock(array(
|
||||
'name' => 'description',
|
||||
'label' => $L->g('Description'),
|
||||
'selected' => '',
|
||||
'class' => '',
|
||||
'value' => $page->description(),
|
||||
'rows' => 5,
|
||||
'placeholder' => $L->get('this-field-can-help-describe-the-content')
|
||||
));
|
||||
// Description
|
||||
echo Bootstrap::formTextareaBlock(array(
|
||||
'name'=>'description',
|
||||
'label'=>$L->g('Description'),
|
||||
'selected'=>'',
|
||||
'class'=>'',
|
||||
'value'=>$page->description(),
|
||||
'rows'=>3,
|
||||
'placeholder'=>$L->get('this-field-can-help-describe-the-content')
|
||||
));
|
||||
?>
|
||||
|
||||
<!-- Cover Image -->
|
||||
<?php
|
||||
$coverImage = $page->coverImage(false);
|
||||
$externalCoverImage = '';
|
||||
if (filter_var($coverImage, FILTER_VALIDATE_URL)) {
|
||||
$coverImage = '';
|
||||
$externalCoverImage = $page->coverImage(false);
|
||||
}
|
||||
$coverImage = $page->coverImage(false);
|
||||
$externalCoverImage = '';
|
||||
if (filter_var($coverImage, FILTER_VALIDATE_URL)) {
|
||||
$coverImage = '';
|
||||
$externalCoverImage = $page->coverImage(false);
|
||||
}
|
||||
?>
|
||||
<label class="mt-4 mb-2 pb-2 border-bottom text-uppercase w-100"><?php $L->p('Cover Image') ?></label>
|
||||
<div>
|
||||
<img id="jscoverImagePreview" class="mx-auto d-block w-100" alt="Cover image preview" src="<?php echo (empty($coverImage) ? HTML_PATH_CORE_IMG . 'default.svg' : $page->coverImage()) ?>" />
|
||||
<img id="jscoverImagePreview" class="mx-auto d-block w-100" alt="Cover image preview" src="<?php echo (empty($coverImage) ? HTML_PATH_ADMIN_THEME_IMG.'default.svg' : $page->coverImage() ) ?>" />
|
||||
</div>
|
||||
<div class="mt-2 text-center">
|
||||
<button type="button" id="jsbuttonSelectCoverImage" class="btn btn-primary btn-sm"><?php echo $L->g('Select cover image') ?></button>
|
||||
|
@ -144,296 +159,195 @@ echo Bootstrap::formInputHidden(array(
|
|||
|
||||
$("#jsbuttonRemoveCoverImage").on("click", function() {
|
||||
$("#jscoverImage").val('');
|
||||
$("#jscoverImagePreview").attr('src', HTML_PATH_CORE_IMG + 'default.svg');
|
||||
$("#jscoverImagePreview").attr('src', HTML_PATH_ADMIN_THEME_IMG+'default.svg');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<div id="nav-advanced" class="tab-pane fade" role="tabpanel" aria-labelledby="advanced-tab">
|
||||
<?php
|
||||
// Date
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'date',
|
||||
'label' => $L->g('Date'),
|
||||
'placeholder' => '',
|
||||
'value' => $page->dateRaw(),
|
||||
'tip' => $L->g('date-format-format')
|
||||
));
|
||||
// Date
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'date',
|
||||
'label'=>$L->g('Date'),
|
||||
'placeholder'=>'',
|
||||
'value'=>$page->dateRaw(),
|
||||
'tip'=>$L->g('date-format-format')
|
||||
));
|
||||
|
||||
// Type
|
||||
echo Bootstrap::formSelectBlock(array(
|
||||
'name' => 'typeSelector',
|
||||
'label' => $L->g('Type'),
|
||||
'selected' => $page->type(),
|
||||
'options' => array(
|
||||
'published' => '- ' . $L->g('Default') . ' -',
|
||||
'sticky' => $L->g('Sticky'),
|
||||
'static' => $L->g('Static')
|
||||
),
|
||||
'tip' => ''
|
||||
));
|
||||
// Type
|
||||
echo Bootstrap::formSelectBlock(array(
|
||||
'name'=>'typeSelector',
|
||||
'label'=>$L->g('Type'),
|
||||
'selected'=>$page->type(),
|
||||
'options'=>array(
|
||||
'published'=>'- '.$L->g('Default').' -',
|
||||
'sticky'=>$L->g('Sticky'),
|
||||
'static'=>$L->g('Static')
|
||||
),
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
// Position
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'position',
|
||||
'label' => $L->g('Position'),
|
||||
'tip' => $L->g('Field used when ordering content by position'),
|
||||
'value' => $page->position()
|
||||
));
|
||||
// Position
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'position',
|
||||
'label'=>$L->g('Position'),
|
||||
'tip'=>$L->g('Field used when ordering content by position'),
|
||||
'value'=>$page->position()
|
||||
));
|
||||
|
||||
// Tags
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'tags',
|
||||
'label' => $L->g('Tags'),
|
||||
'placeholder' => '',
|
||||
'tip' => $L->g('Write the tags separated by comma'),
|
||||
'value' => $page->tags()
|
||||
));
|
||||
// Tags
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'tags',
|
||||
'label'=>$L->g('Tags'),
|
||||
'placeholder'=>'',
|
||||
'tip'=>$L->g('Write the tags separated by comma'),
|
||||
'value'=>$page->tags()
|
||||
));
|
||||
|
||||
// Parent
|
||||
try {
|
||||
$options = array();
|
||||
$parentKey = $page->parent();
|
||||
if (!empty($parentKey)) {
|
||||
// Parent
|
||||
try {
|
||||
$parentKey = $page->parent();
|
||||
$parent = new Page($parentKey);
|
||||
$options = array($parentKey => $parent->title());
|
||||
$parentValue = $parent->title();
|
||||
} catch (Exception $e) {
|
||||
$parentValue = '';
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// continue
|
||||
}
|
||||
echo Bootstrap::formSelectBlock(array(
|
||||
'name' => 'parent',
|
||||
'label' => $L->g('Parent'),
|
||||
'options' => $options,
|
||||
'selected' => false,
|
||||
'class' => '',
|
||||
'tip' => $L->g('Start typing a page title to see a list of suggestions.'),
|
||||
));
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'parentTMP',
|
||||
'label'=>$L->g('Parent'),
|
||||
'placeholder'=>'',
|
||||
'tip'=>$L->g('Start typing a page title to see a list of suggestions.'),
|
||||
'value'=>$parentValue
|
||||
));
|
||||
|
||||
// Template
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'template',
|
||||
'label'=>$L->g('Template'),
|
||||
'placeholder'=>'',
|
||||
'value'=>$page->template(),
|
||||
'tip'=>$L->g('Write a template name to filter the page in the theme and change the style of the page.')
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'externalCoverImage',
|
||||
'label'=>$L->g('External cover image'),
|
||||
'placeholder'=>"https://",
|
||||
'value'=>$externalCoverImage,
|
||||
'tip'=>$L->g('Set a cover image from external URL, such as a CDN or some server dedicated for images.')
|
||||
));
|
||||
|
||||
// Username
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'',
|
||||
'label'=>$L->g('Author'),
|
||||
'placeholder'=>'',
|
||||
'value'=>$page->username(),
|
||||
'tip'=>'',
|
||||
'disabled'=>true
|
||||
));
|
||||
?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var parent = $("#jsparent").select2({
|
||||
placeholder: "",
|
||||
allowClear: true,
|
||||
theme: "bootstrap4",
|
||||
minimumInputLength: 2,
|
||||
ajax: {
|
||||
url: HTML_PATH_ADMIN_ROOT + "ajax/get-published",
|
||||
data: function(params) {
|
||||
var query = {
|
||||
checkIsParent: true,
|
||||
query: params.term
|
||||
$(document).ready(function() {
|
||||
// Changes in External cover image input
|
||||
$("#jsexternalCoverImage").change(function() {
|
||||
$("#jscoverImage").val( $(this).val() );
|
||||
});
|
||||
|
||||
// Parent
|
||||
$("#jsparentTMP").change(function() {
|
||||
var parent = $("#jsparentTMP").val();
|
||||
if (parent.length===0) {
|
||||
$("#jsparent").val("");
|
||||
}
|
||||
});
|
||||
|
||||
// Datepicker
|
||||
$("#jsdate").datetimepicker({format:DB_DATE_FORMAT});
|
||||
|
||||
// Parent autocomplete
|
||||
var parentsXHR;
|
||||
var parentsList; // Keep the parent list returned to get the key by the title page
|
||||
$("#jsparentTMP").autoComplete({
|
||||
minChars: 1,
|
||||
source: function(term, response) {
|
||||
// Prevent call inmediatly another ajax request
|
||||
try { parentsXHR.abort(); } catch(e){}
|
||||
// Get the list of parent pages by title (term)
|
||||
parentsXHR = $.getJSON(HTML_PATH_ADMIN_ROOT+"ajax/get-parents", {query: term},
|
||||
function(data) {
|
||||
parentsList = data;
|
||||
term = term.toLowerCase();
|
||||
var matches = [];
|
||||
for (var title in data) {
|
||||
if (~title.toLowerCase().indexOf(term))
|
||||
matches.push(title);
|
||||
}
|
||||
return query;
|
||||
},
|
||||
processResults: function(data) {
|
||||
return data;
|
||||
}
|
||||
},
|
||||
escapeMarkup: function(markup) {
|
||||
return markup;
|
||||
},
|
||||
templateResult: function(data) {
|
||||
var html = data.text
|
||||
if (data.type == "static") {
|
||||
html += '<span class="badge badge-pill badge-light">' + data.type + '</span>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
// Template
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'template',
|
||||
'label' => $L->g('Template'),
|
||||
'placeholder' => '',
|
||||
'value' => $page->template(),
|
||||
'tip' => $L->g('Write a template name to filter the page in the theme and change the style of the page.')
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'externalCoverImage',
|
||||
'label' => $L->g('External cover image'),
|
||||
'placeholder' => "https://",
|
||||
'value' => $externalCoverImage,
|
||||
'tip' => $L->g('Set a cover image from external URL, such as a CDN or some server dedicated for images.')
|
||||
));
|
||||
|
||||
// Username
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => '',
|
||||
'label' => $L->g('Author'),
|
||||
'placeholder' => '',
|
||||
'value' => $page->username(),
|
||||
'tip' => '',
|
||||
'disabled' => true
|
||||
));
|
||||
?>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Changes in External cover image input
|
||||
$("#jsexternalCoverImage").change(function() {
|
||||
$("#jscoverImage").val($(this).val());
|
||||
});
|
||||
|
||||
// Datepicker
|
||||
$("#jsdate").datetimepicker({
|
||||
format: DB_DATE_FORMAT
|
||||
});
|
||||
response(matches);
|
||||
});
|
||||
},
|
||||
onSelect: function(event, term, item) {
|
||||
// parentsList = array( pageTitle => pageKey )
|
||||
var parentKey = parentsList[term];
|
||||
$("#jsparent").attr("value", parentKey);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($site->customFields())) : ?>
|
||||
<div id="nav-custom" class="tab-pane fade" role="tabpanel" aria-labelledby="custom-tab">
|
||||
<?php
|
||||
$customFields = $site->customFields();
|
||||
foreach ($customFields as $field => $options) {
|
||||
if (!isset($options['position'])) {
|
||||
if ($options['type'] == "string") {
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'custom[' . $field . ']',
|
||||
'value' => (isset($options['default']) ? $options['default'] : ''),
|
||||
'tip' => (isset($options['tip']) ? $options['tip'] : ''),
|
||||
'label' => (isset($options['label']) ? $options['label'] : ''),
|
||||
'placeholder' => (isset($options['placeholder']) ? $options['placeholder'] : ''),
|
||||
'value' => $page->custom($field)
|
||||
));
|
||||
} elseif ($options['type'] == "bool") {
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name' => 'custom[' . $field . ']',
|
||||
'label' => (isset($options['label']) ? $options['label'] : ''),
|
||||
'placeholder' => (isset($options['placeholder']) ? $options['placeholder'] : ''),
|
||||
'checked' => $page->custom($field),
|
||||
'labelForCheckbox' => (isset($options['tip']) ? $options['tip'] : '')
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<div id="nav-seo" class="tab-pane fade" role="tabpanel" aria-labelledby="seo-tab">
|
||||
<?php
|
||||
// Friendly URL
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'slug',
|
||||
'tip' => $L->g('URL associated with the content'),
|
||||
'label' => $L->g('Friendly URL'),
|
||||
'placeholder' => $L->g('Leave empty for autocomplete by Bludit.'),
|
||||
'value' => $page->slug()
|
||||
));
|
||||
// Friendly URL
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'slug',
|
||||
'tip'=>$L->g('URL associated with the content'),
|
||||
'label'=>$L->g('Friendly URL'),
|
||||
'placeholder'=>$L->g('Leave empty for autocomplete by Bludit.'),
|
||||
'value'=>$page->slug()
|
||||
));
|
||||
|
||||
// Robots
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name' => 'noindex',
|
||||
'label' => 'Robots',
|
||||
'labelForCheckbox' => $L->g('apply-code-noindex-code-to-this-page'),
|
||||
'placeholder' => '',
|
||||
'checked' => $page->noindex(),
|
||||
'tip' => $L->g('This tells search engines not to show this page in their search results.')
|
||||
));
|
||||
// Robots
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name'=>'noindex',
|
||||
'label'=>'Robots',
|
||||
'labelForCheckbox'=>$L->g('apply-code-noindex-code-to-this-page'),
|
||||
'placeholder'=>'',
|
||||
'checked'=>$page->noindex(),
|
||||
'tip'=>$L->g('This tells search engines not to show this page in their search results.')
|
||||
));
|
||||
|
||||
// Robots
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name' => 'nofollow',
|
||||
'label' => '',
|
||||
'labelForCheckbox' => $L->g('apply-code-nofollow-code-to-this-page'),
|
||||
'placeholder' => '',
|
||||
'checked' => $page->nofollow(),
|
||||
'tip' => $L->g('This tells search engines not to follow links on this page.')
|
||||
));
|
||||
// Robots
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name'=>'nofollow',
|
||||
'label'=>'',
|
||||
'labelForCheckbox'=>$L->g('apply-code-nofollow-code-to-this-page'),
|
||||
'placeholder'=>'',
|
||||
'checked'=>$page->nofollow(),
|
||||
'tip'=>$L->g('This tells search engines not to follow links on this page.')
|
||||
));
|
||||
|
||||
// Robots
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name' => 'noarchive',
|
||||
'label' => '',
|
||||
'labelForCheckbox' => $L->g('apply-code-noarchive-code-to-this-page'),
|
||||
'placeholder' => '',
|
||||
'checked' => $page->noarchive(),
|
||||
'tip' => $L->g('This tells search engines not to save a cached copy of this page.')
|
||||
));
|
||||
// Robots
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name'=>'noarchive',
|
||||
'label'=>'',
|
||||
'labelForCheckbox'=>$L->g('apply-code-noarchive-code-to-this-page'),
|
||||
'placeholder'=>'',
|
||||
'checked'=>$page->noarchive(),
|
||||
'tip'=>$L->g('This tells search engines not to save a cached copy of this page.')
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Custom fields: TOP -->
|
||||
<?php
|
||||
$customFields = $site->customFields();
|
||||
foreach ($customFields as $field => $options) {
|
||||
if (isset($options['position']) && ($options['position'] == 'top')) {
|
||||
if ($options['type'] == "string") {
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'custom[' . $field . ']',
|
||||
'label' => (isset($options['label']) ? $options['label'] : ''),
|
||||
'value' => $page->custom($field),
|
||||
'tip' => (isset($options['tip']) ? $options['tip'] : ''),
|
||||
'placeholder' => (isset($options['placeholder']) ? $options['placeholder'] : ''),
|
||||
'class' => 'mb-2',
|
||||
'labelClass' => 'mb-2 pb-2 border-bottom text-uppercase w-100'
|
||||
|
||||
));
|
||||
} elseif ($options['type'] == "bool") {
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name' => 'custom[' . $field . ']',
|
||||
'label' => (isset($options['label']) ? $options['label'] : ''),
|
||||
'placeholder' => (isset($options['placeholder']) ? $options['placeholder'] : ''),
|
||||
'checked' => $page->custom($field),
|
||||
'labelForCheckbox' => (isset($options['tip']) ? $options['tip'] : ''),
|
||||
'class' => 'mb-2',
|
||||
'labelClass' => 'mb-2 pb-2 border-bottom text-uppercase w-100'
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- Title -->
|
||||
<div class="form-group mb-1">
|
||||
<input id="jstitle" name="title" type="text" dir="auto" class="form-control form-control-lg rounded-0" value="<?php echo $page->title() ?>" placeholder="<?php $L->p('Enter title') ?>">
|
||||
<div class="form-group mt-1 mb-1">
|
||||
<input id="jstitle" name="title" type="text" class="form-control form-control-lg rounded-0" value="<?php echo $page->title() ?>" placeholder="<?php $L->p('Enter title') ?>">
|
||||
</div>
|
||||
|
||||
<!-- Editor -->
|
||||
<textarea id="jseditor" class="editable h-100" style=""><?php echo $page->contentRaw(true) ?></textarea>
|
||||
|
||||
<!-- Custom fields: BOTTOM -->
|
||||
<?php
|
||||
$customFields = $site->customFields();
|
||||
foreach ($customFields as $field => $options) {
|
||||
if (isset($options['position']) && ($options['position'] == 'bottom')) {
|
||||
if ($options['type'] == "string") {
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'custom[' . $field . ']',
|
||||
'label' => (isset($options['label']) ? $options['label'] : ''),
|
||||
'value' => $page->custom($field),
|
||||
'tip' => (isset($options['tip']) ? $options['tip'] : ''),
|
||||
'placeholder' => (isset($options['placeholder']) ? $options['placeholder'] : ''),
|
||||
'class' => 'mt-2',
|
||||
'labelClass' => 'mb-2 pb-2 border-bottom text-uppercase w-100'
|
||||
|
||||
));
|
||||
} elseif ($options['type'] == "bool") {
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name' => 'custom[' . $field . ']',
|
||||
'label' => (isset($options['label']) ? $options['label'] : ''),
|
||||
'placeholder' => (isset($options['placeholder']) ? $options['placeholder'] : ''),
|
||||
'checked' => $page->custom($field),
|
||||
'labelForCheckbox' => (isset($options['tip']) ? $options['tip'] : ''),
|
||||
'class' => 'mt-2',
|
||||
'labelClass' => 'mb-2 pb-2 border-bottom text-uppercase w-100'
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<textarea id="jseditor" class="editable h-100" style=""><?php echo $page->contentRaw(false) ?></textarea>
|
||||
|
||||
</form>
|
||||
|
||||
|
@ -452,112 +366,79 @@ foreach ($customFields as $field => $options) {
|
|||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#jsbuttonDeleteAccept").on("click", function() {
|
||||
$("#jstype").val("delete");
|
||||
$("#jscontent").val("");
|
||||
$("#jsform").submit();
|
||||
});
|
||||
$(document).ready(function() {
|
||||
$("#jsbuttonDeleteAccept").on("click", function() {
|
||||
$("#jstype").val("delete");
|
||||
$("#jscontent").val("");
|
||||
$("#jsform").submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<!-- Modal for Media Manager -->
|
||||
<?php include(PATH_ADMIN_THEMES . 'booty/html/media.php'); ?>
|
||||
<?php include(PATH_ADMIN_THEMES.'booty/html/media.php'); ?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function() {
|
||||
|
||||
// Define function if they doesn't exist
|
||||
// This helps if the user doesn't activate any plugin as editor
|
||||
if (typeof editorGetContent != "function") {
|
||||
window.editorGetContent = function() {
|
||||
return $("#jseditor").val();
|
||||
};
|
||||
}
|
||||
if (typeof editorInsertMedia != "function") {
|
||||
window.editorInsertMedia = function(filename) {
|
||||
$("#jseditor").val($('#jseditor').val() + '<img src="' + filename + '" alt="">');
|
||||
};
|
||||
}
|
||||
if (typeof editorInsertLinkedMedia != "function") {
|
||||
window.editorInsertLinkedMedia = function(filename, link) {
|
||||
$("#jseditor").val($('#jseditor').val() + '<a href="' + link + '"><img src="' + filename + '" alt=""></a>');
|
||||
};
|
||||
// Define function if they doesn't exist
|
||||
// This helps if the user doesn't activate any plugin as editor
|
||||
if (typeof editorGetContent != "function") {
|
||||
window.editorGetContent = function(){
|
||||
return $("#jseditor").val();
|
||||
};
|
||||
}
|
||||
if (typeof editorInsertMedia != "function") {
|
||||
window.editorInsertMedia = function(filename){
|
||||
$("#jseditor").val($('#jseditor').val()+'<img src="'+filename+'" alt="">');
|
||||
};
|
||||
}
|
||||
|
||||
// Button Save
|
||||
$("#jsbuttonSave").on("click", function() {
|
||||
// If the switch is setted to "published", get the value from the selector
|
||||
if ($("#jsPublishSwitch").is(':checked')) {
|
||||
var value = $("#jstypeSelector option:selected").val();
|
||||
$("#jstype").val(value);
|
||||
} else {
|
||||
$("#jstype").val("draft");
|
||||
}
|
||||
|
||||
// Button switch
|
||||
$("#jsswitchButton").on("click", function() {
|
||||
if ($(this).data("switch") == "publish") {
|
||||
$(this).html('<i class="fa fa-square switch-icon-draft"></i> <?php $L->p('Draft') ?>');
|
||||
$(this).data("switch", "draft");
|
||||
} else {
|
||||
$(this).html('<i class="fa fa-square switch-icon-publish"></i> <?php $L->p('Publish') ?>');
|
||||
$(this).data("switch", "publish");
|
||||
}
|
||||
});
|
||||
// Get the content
|
||||
$("#jscontent").val( editorGetContent() );
|
||||
|
||||
// Button preview
|
||||
$("#jsbuttonPreview").on("click", function() {
|
||||
// Submit the form
|
||||
$("#jsform").submit();
|
||||
});
|
||||
|
||||
// Button Save as draft
|
||||
$("#jsbuttonDraft").on("click", function() {
|
||||
// Set the type as draft
|
||||
$("#jstype").val("draft");
|
||||
|
||||
// Get the content
|
||||
$("#jscontent").val( editorGetContent() );
|
||||
|
||||
// Submit the form
|
||||
$("#jsform").submit();
|
||||
});
|
||||
|
||||
// Autosave
|
||||
// Autosave works when the content of the page is bigger than 100 characters
|
||||
var currentContent = editorGetContent();
|
||||
setInterval(function() {
|
||||
var uuid = $("#jsuuid").val();
|
||||
var title = $("#jstitle").val();
|
||||
var content = editorGetContent();
|
||||
var ajax = new bluditAjax();
|
||||
bluditAjax.saveAsDraft(uuid, title, content).then(function(data) {
|
||||
var preview = window.open("<?php echo DOMAIN_PAGES . 'autosave-' . $page->uuid() . '?preview=' . md5('autosave-' . $page->uuid()) ?>", "bludit-preview");
|
||||
preview.focus();
|
||||
});
|
||||
});
|
||||
|
||||
// Button Save
|
||||
$("#jsbuttonSave").on("click", function() {
|
||||
// If the switch is setted to "published", get the value from the selector
|
||||
if ($("#jsswitchButton").data("switch") == "publish") {
|
||||
var value = $("#jstypeSelector option:selected").val();
|
||||
$("#jstype").val(value);
|
||||
} else {
|
||||
$("#jstype").val("draft");
|
||||
}
|
||||
|
||||
// Get the content
|
||||
$("#jscontent").val(editorGetContent());
|
||||
|
||||
// Submit the form
|
||||
$("#jsform").submit();
|
||||
});
|
||||
|
||||
// Button Save as draft
|
||||
$("#jsbuttonDraft").on("click", function() {
|
||||
// Set the type as draft
|
||||
$("#jstype").val("draft");
|
||||
|
||||
// Get the content
|
||||
$("#jscontent").val(editorGetContent());
|
||||
|
||||
// Submit the form
|
||||
$("#jsform").submit();
|
||||
});
|
||||
|
||||
// Autosave
|
||||
var currentContent = editorGetContent();
|
||||
setInterval(function() {
|
||||
var uuid = $("#jsuuid").val();
|
||||
var title = $("#jstitle").val() + "[<?php $L->p('Autosave') ?>]";
|
||||
var content = editorGetContent();
|
||||
// Autosave when content has at least 100 characters
|
||||
if (content.length < 100) {
|
||||
return false;
|
||||
}
|
||||
// Autosave only when the user change the content
|
||||
if (currentContent != content) {
|
||||
// Call autosave only when the user change the content
|
||||
if (currentContent!=content) {
|
||||
currentContent = content;
|
||||
bluditAjax.saveAsDraft(uuid, title, content).then(function(data) {
|
||||
if (data.status == 0) {
|
||||
showAlert("<?php $L->p('Autosave') ?>");
|
||||
}
|
||||
});
|
||||
// showAlert is the function to display an alert defined in alert.php
|
||||
ajax.autosave(uuid, title, content, showAlert);
|
||||
}
|
||||
}, 1000 * 60 * AUTOSAVE_INTERVAL);
|
||||
},1000*60*AUTOSAVE_INTERVAL);
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.'); ?>
|
||||
|
||||
<?php echo Bootstrap::formOpen(array('id' => 'jsform', 'class' => 'tab-content')); ?>
|
||||
<?php echo Bootstrap::formOpen(array('id'=>'jsform', 'class'=>'tab-content')); ?>
|
||||
|
||||
<div class="align-middle">
|
||||
<div class="float-right mt-1">
|
||||
<button type="submit" class="btn btn-primary btn-sm" name="save"><?php $L->p('Save') ?></button>
|
||||
<a class="btn btn-secondary btn-sm" href="<?php echo HTML_PATH_ADMIN_ROOT . 'users' ?>" role="button"><?php $L->p('Cancel') ?></a>
|
||||
<a class="btn btn-secondary btn-sm" href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>" role="button"><?php $L->p('Cancel') ?></a>
|
||||
</div>
|
||||
<?php echo Bootstrap::pageTitle(array('title' => $L->g('Edit user'), 'icon' => 'user')); ?>
|
||||
<?php echo Bootstrap::pageTitle(array('title'=>$L->g('Edit user'), 'icon'=>'person')); ?>
|
||||
</div>
|
||||
|
||||
<!-- TABS -->
|
||||
|
@ -21,160 +21,144 @@
|
|||
</nav>
|
||||
|
||||
<?php
|
||||
// Token CSRF
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name' => 'tokenCSRF',
|
||||
'value' => $security->getTokenCSRF()
|
||||
));
|
||||
// Token CSRF
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$security->getTokenCSRF()
|
||||
));
|
||||
|
||||
// Username
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name' => 'username',
|
||||
'value' => $user->username()
|
||||
));
|
||||
// Username
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'username',
|
||||
'value'=>$user->username()
|
||||
));
|
||||
?>
|
||||
|
||||
<div class="tab-content" id="nav-tabContent">
|
||||
<!-- Profile tab -->
|
||||
<div class="tab-pane fade show active" id="profile" role="tabpanel" aria-labelledby="nav-profile-tab">
|
||||
<?php
|
||||
<?php
|
||||
// Display username but disable the field
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'usernameDisabled',
|
||||
'label' => $L->g('Username'),
|
||||
'value' => $user->username(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'disabled' => true,
|
||||
'tip' => ''
|
||||
'name'=>'usernameDisabled',
|
||||
'label'=>$L->g('Username'),
|
||||
'value'=>$user->username(),
|
||||
'class'=>'',
|
||||
'placeholder'=>'',
|
||||
'disabled'=>true,
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
if ($login->role() === 'admin') {
|
||||
if ($login->role()==='admin') {
|
||||
echo Bootstrap::formSelect(array(
|
||||
'name' => 'role',
|
||||
'label' => $L->g('Role'),
|
||||
'options' => array('author' => $L->g('Author'), 'editor' => $L->g('Editor'), 'admin' => $L->g('Administrator')),
|
||||
'selected' => $user->role(),
|
||||
'class' => '',
|
||||
'tip' => $L->g('author-can-write-and-edit-their-own-content')
|
||||
'name'=>'role',
|
||||
'label'=>$L->g('Role'),
|
||||
'options'=>array('editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')),
|
||||
'selected'=>$user->role(),
|
||||
'class'=>'',
|
||||
'tip'=>''
|
||||
));
|
||||
}
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'email',
|
||||
'label' => $L->g('Email'),
|
||||
'value' => $user->email(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => ''
|
||||
'name'=>'email',
|
||||
'label'=>$L->g('Email'),
|
||||
'value'=>$user->email(),
|
||||
'class'=>'',
|
||||
'placeholder'=>'',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'nickname',
|
||||
'label' => $L->g('Nickname'),
|
||||
'value' => $user->nickname(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => $L->g('The nickname is almost used in the themes to display the author of the content')
|
||||
'name'=>'nickname',
|
||||
'label'=>$L->g('Nickname'),
|
||||
'value'=>$user->nickname(),
|
||||
'class'=>'',
|
||||
'placeholder'=>'',
|
||||
'tip'=>$L->g('The nickname is almost used in the themes to display the author of the content')
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'firstName',
|
||||
'label' => $L->g('First Name'),
|
||||
'value' => $user->firstName(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => ''
|
||||
'name'=>'firstName',
|
||||
'label'=>$L->g('First Name'),
|
||||
'value'=>$user->firstName(),
|
||||
'class'=>'',
|
||||
'placeholder'=>'',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'lastName',
|
||||
'label' => $L->g('Last Name'),
|
||||
'value' => $user->lastName(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => ''
|
||||
'name'=>'lastName',
|
||||
'label'=>$L->g('Last Name'),
|
||||
'value'=>$user->lastName(),
|
||||
'class'=>'',
|
||||
'placeholder'=>'',
|
||||
'tip'=>''
|
||||
));
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- Profile picture tab -->
|
||||
<div class="tab-pane fade" id="picture" role="tabpanel" aria-labelledby="nav-picture-tab">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-sm-12 p-0 pr-2">
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" id="jsprofilePictureInputFile" name="profilePictureInputFile">
|
||||
<label class="custom-file-label" for="jsprofilePictureInputFile"><?php $L->p('Upload image'); ?></label>
|
||||
</div>
|
||||
<!-- <button id="jsbuttonRemovePicture" type="button" class="btn btn-primary w-100 mt-4 mb-4"><i class="fa fa-trash"></i> Remove picture</button> -->
|
||||
</div>
|
||||
<div class="col-lg-8 col-sm-12 p-0 text-center">
|
||||
<img id="jsprofilePicturePreview" class="img-fluid img-thumbnail" alt="Profile picture preview" src="<?php echo (Sanitize::pathFile(PATH_UPLOADS_PROFILES . $user->username() . '.png') ? DOMAIN_UPLOADS_PROFILES . $user->username() . '.png?version=' . time() : HTML_PATH_CORE_IMG . 'default.svg') ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="custom-file mb-2">
|
||||
<input type="file" class="custom-file-input" id="jsprofilePictureInputFile" name="profilePictureInputFile">
|
||||
<label class="custom-file-label" for="jsprofilePictureInputFile"><?php $L->p('Choose images to upload'); ?></label>
|
||||
</div>
|
||||
<div>
|
||||
<img id="jsprofilePicturePreview" class="img-fluid img-thumbnail" alt="Profile picture preview" src="<?php echo (Sanitize::pathFile(PATH_UPLOADS_PROFILES.$user->username().'.png')?DOMAIN_UPLOADS_PROFILES.$user->username().'.png?version='.time():HTML_PATH_ADMIN_THEME_IMG.'default.svg') ?>" />
|
||||
</div>
|
||||
<script>
|
||||
// $("#jsbuttonRemovePicture").on("click", function() {
|
||||
// var username = $("#jsusername").val();
|
||||
// bluditAjax.removeProfilePicture(username);
|
||||
// $("#jsprofilePicturePreview").attr("src", "<?php echo HTML_PATH_CORE_IMG . 'default.svg' ?>");
|
||||
// });
|
||||
|
||||
$("#jsprofilePictureInputFile").on("change", function() {
|
||||
var formData = new FormData();
|
||||
formData.append('tokenCSRF', tokenCSRF);
|
||||
formData.append('profilePictureInputFile', $(this)[0].files[0]);
|
||||
formData.append('username', $("#jsusername").val());
|
||||
$.ajax({
|
||||
url: HTML_PATH_ADMIN_ROOT + "ajax/profile-picture-upload",
|
||||
type: "POST",
|
||||
data: formData,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false
|
||||
}).done(function(data) {
|
||||
if (data.status == 0) {
|
||||
$("#jsprofilePicturePreview").attr('src', data.absoluteURL + "?time=" + Math.random());
|
||||
} else {
|
||||
showAlert(data.message);
|
||||
}
|
||||
});
|
||||
$("#jsprofilePictureInputFile").on("change", function() {
|
||||
var formData = new FormData();
|
||||
formData.append('tokenCSRF', tokenCSRF);
|
||||
formData.append('profilePictureInputFile', $(this)[0].files[0]);
|
||||
formData.append('username', $("#jsusername").val());
|
||||
$.ajax({
|
||||
url: HTML_PATH_ADMIN_ROOT+"ajax/upload-profile-picture",
|
||||
type: "POST",
|
||||
data: formData,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false
|
||||
}).done(function(json) {
|
||||
console.log(json);
|
||||
$("#jsprofilePicturePreview").attr('src',json.absoluteURL+"?time="+Math.random());
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<!-- Security tab -->
|
||||
<div class="tab-pane fade" id="security" role="tabpanel" aria-labelledby="nav-security-tab">
|
||||
<?php
|
||||
echo Bootstrap::formTitle(array('title' => $L->g('Password')));
|
||||
<?php
|
||||
echo Bootstrap::formTitle(array('title'=>$L->g('Password')));
|
||||
|
||||
echo '
|
||||
<div class="form-group">
|
||||
<a href="' . HTML_PATH_ADMIN_ROOT . 'user-password/' . $user->username() . '" class="btn btn-primary mr-2">' . $L->g('Change password') . '</a>
|
||||
<a href="'.HTML_PATH_ADMIN_ROOT.'user-password/'.$user->username().'" class="btn btn-primary mr-2">'.$L->g('Change password').'</a>
|
||||
</div>
|
||||
';
|
||||
|
||||
echo Bootstrap::formTitle(array('title' => $L->g('Authentication Token')));
|
||||
echo Bootstrap::formTitle(array('title'=>$L->g('Authentication Token')));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'tokenAuth',
|
||||
'label' => $L->g('Token'),
|
||||
'value' => $user->tokenAuth(),
|
||||
'class' => '',
|
||||
'tip' => $L->g('this-token-is-similar-to-a-password-it-should-not-be-shared')
|
||||
'name'=>'tokenAuth',
|
||||
'label'=>$L->g('Token'),
|
||||
'value'=>$user->tokenAuth(),
|
||||
'class'=>'',
|
||||
'tip'=>$L->g('this-token-is-similar-to-a-password-it-should-not-be-shared')
|
||||
));
|
||||
|
||||
if (checkRole(array('admin'), false)) {
|
||||
echo Bootstrap::formTitle(array('title' => $L->g('Status')));
|
||||
if (checkRole(array('admin'),false)) {
|
||||
echo Bootstrap::formTitle(array('title'=>$L->g('Status')));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'status',
|
||||
'label' => $L->g('Current status'),
|
||||
'value' => $user->enabled() ? $L->g('Enabled') : $L->g('Disabled'),
|
||||
'class' => '',
|
||||
'disabled' => true,
|
||||
'tip' => $user->enabled() ? '' : $L->g('To enable the user you must set a new password')
|
||||
'name'=>'status',
|
||||
'label'=>$L->g('Current status'),
|
||||
'value'=>$user->enabled()?$L->g('Enabled'):$L->g('Disabled'),
|
||||
'class'=>'',
|
||||
'disabled'=>true,
|
||||
'tip'=>$user->enabled()?'':$L->g('To enable the user you must set a new password')
|
||||
));
|
||||
|
||||
if ($user->enabled()) {
|
||||
|
@ -182,135 +166,93 @@ echo Bootstrap::formInputHidden(array(
|
|||
<div class="form-group row">
|
||||
<div class="col-sm-2"></div>
|
||||
<div class="col-sm-10">
|
||||
<button type="submit" class="btn btn-warning mr-2" id="jsdisableUser" name="disableUser">' . $L->g('Disable user') . '</button>
|
||||
<button type="submit" class="btn btn-danger mr-2" id="jsdeleteUserAndKeepContent" name="deleteUserAndKeepContent">' . $L->g('Delete user and keep content') . '</button>
|
||||
<button type="submit" class="btn btn-danger mr-2" id="jsdeleteUserAndDeleteContent" name="deleteUserAndDeleteContent">' . $L->g('Delete user and delete content') . '</button>
|
||||
<button type="submit" class="btn btn-warning mr-2" id="jsdisableUser" name="disableUser">'.$L->g('Disable user').'</button>
|
||||
<button type="submit" class="btn btn-danger mr-2" id="jsdeleteUserAndKeepContent" name="deleteUserAndKeepContent">'.$L->g('Delete user and keep content').'</button>
|
||||
<button type="submit" class="btn btn-danger mr-2" id="jsdeleteUserAndDeleteContent" name="deleteUserAndDeleteContent">'.$L->g('Delete user and delete content').'</button>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- Social Networks tab -->
|
||||
<div class="tab-pane fade" id="social" role="tabpanel" aria-labelledby="nav-social-tab">
|
||||
<?php
|
||||
<?php
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'twitter',
|
||||
'label' => 'Twitter',
|
||||
'value' => $user->twitter(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => ''
|
||||
'name'=>'twitter',
|
||||
'label'=>'Twitter',
|
||||
'value'=>$user->twitter(),
|
||||
'class'=>'',
|
||||
'placeholder'=>'',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'facebook',
|
||||
'label' => 'Facebook',
|
||||
'value' => $user->facebook(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => ''
|
||||
'name'=>'facebook',
|
||||
'label'=>'Facebook',
|
||||
'value'=>$user->facebook(),
|
||||
'class'=>'',
|
||||
'placeholder'=>'',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'codepen',
|
||||
'label' => 'CodePen',
|
||||
'value' => $user->codepen(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => ''
|
||||
'name'=>'codepen',
|
||||
'label'=>'CodePen',
|
||||
'value'=>$user->codepen(),
|
||||
'class'=>'',
|
||||
'placeholder'=>'',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'instagram',
|
||||
'label' => 'Instagram',
|
||||
'value' => $user->instagram(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => ''
|
||||
'name'=>'instagram',
|
||||
'label'=>'Instagram',
|
||||
'value'=>$user->instagram(),
|
||||
'class'=>'',
|
||||
'placeholder'=>'',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'gitlab',
|
||||
'label' => 'GitLab',
|
||||
'value' => $user->gitlab(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => ''
|
||||
'name'=>'gitlab',
|
||||
'label'=>'GitLab',
|
||||
'value'=>$user->gitlab(),
|
||||
'class'=>'',
|
||||
'placeholder'=>'',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'github',
|
||||
'label' => 'GitHub',
|
||||
'value' => $user->github(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => ''
|
||||
'name'=>'github',
|
||||
'label'=>'GitHub',
|
||||
'value'=>$user->github(),
|
||||
'class'=>'',
|
||||
'placeholder'=>'',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'linkedin',
|
||||
'label' => 'LinkedIn',
|
||||
'value' => $user->linkedin(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => ''
|
||||
'name'=>'linkedin',
|
||||
'label'=>'LinkedIn',
|
||||
'value'=>$user->linkedin(),
|
||||
'class'=>'',
|
||||
'placeholder'=>'',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'xing',
|
||||
'label' => 'Xing',
|
||||
'value' => $user->xing(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => ''
|
||||
'name'=>'mastodon',
|
||||
'label'=>'Mastodon',
|
||||
'value'=>$user->mastodon(),
|
||||
'class'=>'',
|
||||
'placeholder'=>'',
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'telegram',
|
||||
'label' => 'Telegram',
|
||||
'value' => $user->telegram(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => ''
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'mastodon',
|
||||
'label' => 'Mastodon',
|
||||
'value' => $user->mastodon(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => ''
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
'name' => 'vk',
|
||||
'label' => 'VK',
|
||||
'value' => $user->vk(),
|
||||
'class' => '',
|
||||
'placeholder' => '',
|
||||
'tip' => ''
|
||||
));
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php echo Bootstrap::formClose(); ?>
|
||||
|
||||
<script>
|
||||
// Open current tab after refresh page
|
||||
$(function() {
|
||||
$('a[data-toggle="tab"]').on('click', function(e) {
|
||||
window.localStorage.setItem('activeTab', $(e.target).attr('href'));
|
||||
console.log($(e.target).attr('href'));
|
||||
});
|
||||
var activeTab = window.localStorage.getItem('activeTab');
|
||||
if (activeTab) {
|
||||
$('#nav-tab a[href="' + activeTab + '"]').tab('show');
|
||||
//window.localStorage.removeItem("activeTab");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<?php echo Bootstrap::formClose(); ?>
|
|
@ -1,37 +1,37 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
echo '<h1 class="text-center mb-3 mt-3 font-weight-normal" style="color: #555;">' . $site->title() . '</h1>';
|
||||
echo '<h1 class="text-center mb-5 mt-5 font-weight-normal" style="color: #555;">BLUDIT</h1>';
|
||||
|
||||
echo Bootstrap::formOpen(array());
|
||||
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name' => 'tokenCSRF',
|
||||
'value' => $security->getTokenCSRF()
|
||||
));
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$security->getTokenCSRF()
|
||||
));
|
||||
|
||||
echo '
|
||||
echo '
|
||||
<div class="form-group">
|
||||
<input type="text" dir="auto" value="' . (isset($_POST['username']) ? Sanitize::html($_POST['username']) : '') . '" class="form-control form-control-lg" id="jsusername" name="username" placeholder="' . $L->g('Username') . '" autofocus>
|
||||
<input type="text" value="'.(isset($_POST['username'])?$_POST['username']:'').'" class="form-control form-control-lg" id="jsusername" name="username" placeholder="'.$L->g('Username').'" autofocus>
|
||||
</div>
|
||||
';
|
||||
|
||||
echo '
|
||||
echo '
|
||||
<div class="form-group">
|
||||
<input type="password" class="form-control form-control-lg" id="jspassword" name="password" placeholder="' . $L->g('Password') . '">
|
||||
<input type="password" class="form-control form-control-lg" id="jspassword" name="password" placeholder="'.$L->g('Password').'">
|
||||
</div>
|
||||
';
|
||||
|
||||
echo '
|
||||
echo '
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" value="true" id="jsremember" name="remember">
|
||||
<label class="form-check-label" for="jsremember">' . $L->g('Remember me') . '</label>
|
||||
<label class="form-check-label" for="jsremember">'.$L->g('Remember me').'</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-3">
|
||||
<button type="submit" class="btn btn-primary btn-lg mr-2 w-100" name="save">' . $L->g('Login') . '</button>
|
||||
<div class="form-group mt-4">
|
||||
<button type="submit" class="btn btn-primary btn-lg mr-2 w-100" name="save">'.$L->g('Login').'</button>
|
||||
</div>
|
||||
';
|
||||
|
||||
echo '</form>';
|
||||
|
||||
echo '<p class="mt-3 text-right">' . $L->g('Powered by Bludit') . ((defined('BLUDIT_PRO')) ? ' PRO' : '') . '</p>';
|
||||
?>
|
||||
|
|
|
@ -4,53 +4,66 @@
|
|||
|
||||
// Start form
|
||||
echo Bootstrap::formOpen(array(
|
||||
'id' => 'jsform',
|
||||
'class' => 'd-flex flex-column h-100'
|
||||
'id'=>'jsform',
|
||||
'class'=>'d-flex flex-column h-100'
|
||||
));
|
||||
|
||||
// Token CSRF
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name' => 'tokenCSRF',
|
||||
'value' => $security->getTokenCSRF()
|
||||
));
|
||||
// Token CSRF
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'tokenCSRF',
|
||||
'value'=>$security->getTokenCSRF()
|
||||
));
|
||||
|
||||
// UUID
|
||||
// The UUID is generated in the controller
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name' => 'uuid',
|
||||
'value' => $uuid
|
||||
));
|
||||
// Parent
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'parent',
|
||||
'value'=>''
|
||||
));
|
||||
|
||||
// Type = published, draft, sticky, static
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name' => 'type',
|
||||
'value' => 'published'
|
||||
));
|
||||
// UUID
|
||||
// The UUID is generated in the controller
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'uuid',
|
||||
'value'=>$uuid
|
||||
));
|
||||
|
||||
// Cover image
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name' => 'coverImage',
|
||||
'value' => ''
|
||||
));
|
||||
// Type = published, draft, sticky, static
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'type',
|
||||
'value'=>'published'
|
||||
));
|
||||
|
||||
// Content
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name' => 'content',
|
||||
'value' => ''
|
||||
));
|
||||
// Cover image
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'coverImage',
|
||||
'value'=>''
|
||||
));
|
||||
|
||||
// Content
|
||||
echo Bootstrap::formInputHidden(array(
|
||||
'name'=>'content',
|
||||
'value'=>''
|
||||
));
|
||||
?>
|
||||
|
||||
<!-- TOOLBAR -->
|
||||
<div id="jseditorToolbar" class="mb-1">
|
||||
<div id="jseditorToolbar">
|
||||
<div id="jseditorToolbarRight" class="btn-group btn-group-sm float-right" role="group" aria-label="Toolbar right">
|
||||
<button type="button" class="btn btn-light" id="jsmediaManagerOpenModal" data-toggle="modal" data-target="#jsmediaManagerModal"><span class="fa fa-image"></span> <?php $L->p('Images') ?></button>
|
||||
<button type="button" class="btn btn-light" id="jsoptionsSidebar" style="z-index:30"><span class="fa fa-cog"></span> <?php $L->p('Options') ?></button>
|
||||
<button type="button" class="btn btn-light" id="jsmediaManagerOpenModal" data-toggle="modal" data-target="#jsmediaManagerModal"><span class="oi oi-image"></span> <?php $L->p('Images') ?></button>
|
||||
<button type="button" class="btn btn-light" id="jsoptionsSidebar" style="z-index:30"><span class="oi oi-cog"></span> <?php $L->p('Options') ?></button>
|
||||
</div>
|
||||
|
||||
<div id="jseditorToolbarLeft">
|
||||
<button id="jsbuttonSave" type="button" class="btn btn-sm btn-primary"><?php $L->p('Save') ?></button>
|
||||
<button id="jsbuttonPreview" type="button" class="btn btn-sm btn-secondary"><?php $L->p('Preview') ?></button>
|
||||
<span id="jsbuttonSwitch" data-switch="publish" class="ml-2 text-secondary switch-button"><i class="fa fa-square switch-icon-publish"></i> <?php $L->p('Publish') ?></span>
|
||||
<button type="button" class="btn btn-sm btn-primary" id="jsbuttonSave"><?php $L->p('Save') ?></button>
|
||||
<span class="d-inline-block align-middle ml-1">
|
||||
<div class="switch" style="width:<?php echo max(100,Text::length($L->g('Publish'))* 15) ?>px">
|
||||
<input type="radio" class="switch-input" name="switch" value="" id="jsPublishSwitch" checked>
|
||||
<label for="jsPublishSwitch" class="switch-label switch-label-off"><?php $L->p('Publish') ?></label>
|
||||
<input type="radio" class="switch-input" name="switch" value="" id="jsDraftSwitch">
|
||||
<label for="jsDraftSwitch" class="switch-label switch-label-on"><?php $L->p('Draft') ?></label>
|
||||
<span class="switch-selection"></span>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
@ -71,11 +84,8 @@ echo Bootstrap::formInputHidden(array(
|
|||
<div id="jseditorSidebar">
|
||||
<nav>
|
||||
<div class="nav nav-tabs" id="nav-tab" role="tablist">
|
||||
<a class="nav-link active show" id="nav-general-tab" data-toggle="tab" href="#nav-general" role="tab" aria-controls="general"><?php $L->p('General') ?></a>
|
||||
<a class="nav-link active show" id="nav-general-tab" data-toggle="tab" href="#nav-general" role="tab" aria-controls="general"><?php $L->p('General') ?></a>
|
||||
<a class="nav-link" id="nav-advanced-tab" data-toggle="tab" href="#nav-advanced" role="tab" aria-controls="advanced"><?php $L->p('Advanced') ?></a>
|
||||
<?php if (!empty($site->customFields())) : ?>
|
||||
<a class="nav-link" id="nav-custom-tab" data-toggle="tab" href="#nav-custom" role="tab" aria-controls="custom"><?php $L->p('Custom') ?></a>
|
||||
<?php endif ?>
|
||||
<a class="nav-link" id="nav-seo-tab" data-toggle="tab" href="#nav-seo" role="tab" aria-controls="seo"><?php $L->p('SEO') ?></a>
|
||||
</div>
|
||||
</nav>
|
||||
|
@ -83,32 +93,32 @@ echo Bootstrap::formInputHidden(array(
|
|||
<div class="tab-content pr-3 pl-3 pb-3">
|
||||
<div id="nav-general" class="tab-pane fade show active" role="tabpanel" aria-labelledby="general-tab">
|
||||
<?php
|
||||
// Category
|
||||
echo Bootstrap::formSelectBlock(array(
|
||||
'name' => 'category',
|
||||
'label' => $L->g('Category'),
|
||||
'selected' => '',
|
||||
'class' => '',
|
||||
'emptyOption' => '- ' . $L->g('Uncategorized') . ' -',
|
||||
'options' => $categories->getKeyNameArray()
|
||||
));
|
||||
// Category
|
||||
echo Bootstrap::formSelectBlock(array(
|
||||
'name'=>'category',
|
||||
'label'=>$L->g('Category'),
|
||||
'selected'=>'',
|
||||
'class'=>'',
|
||||
'emptyOption'=>'- '.$L->g('Uncategorized').' -',
|
||||
'options'=>$categories->getKeyNameArray()
|
||||
));
|
||||
|
||||
// Description
|
||||
echo Bootstrap::formTextareaBlock(array(
|
||||
'name' => 'description',
|
||||
'label' => $L->g('Description'),
|
||||
'selected' => '',
|
||||
'class' => '',
|
||||
'value' => '',
|
||||
'rows' => 5,
|
||||
'placeholder' => $L->get('this-field-can-help-describe-the-content')
|
||||
));
|
||||
// Description
|
||||
echo Bootstrap::formTextareaBlock(array(
|
||||
'name'=>'description',
|
||||
'label'=>$L->g('Description'),
|
||||
'selected'=>'',
|
||||
'class'=>'',
|
||||
'value'=>'',
|
||||
'rows'=>3,
|
||||
'placeholder'=>$L->get('this-field-can-help-describe-the-content')
|
||||
));
|
||||
?>
|
||||
|
||||
<!-- Cover Image -->
|
||||
<label class="mt-4 mb-2 pb-2 border-bottom text-uppercase w-100"><?php $L->p('Cover Image') ?></label>
|
||||
<div>
|
||||
<img id="jscoverImagePreview" class="mx-auto d-block w-100" alt="Cover image preview" src="<?php echo HTML_PATH_CORE_IMG ?>default.svg" />
|
||||
<img id="jscoverImagePreview" class="mx-auto d-block w-100" alt="Cover image preview" src="<?php echo HTML_PATH_ADMIN_THEME_IMG ?>default.svg" />
|
||||
</div>
|
||||
<div class="mt-2 text-center">
|
||||
<button type="button" id="jsbuttonSelectCoverImage" class="btn btn-primary btn-sm"><?php echo $L->g('Select cover image') ?></button>
|
||||
|
@ -126,386 +136,237 @@ echo Bootstrap::formInputHidden(array(
|
|||
|
||||
$("#jsbuttonRemoveCoverImage").on("click", function() {
|
||||
$("#jscoverImage").val('');
|
||||
$("#jscoverImagePreview").attr('src', HTML_PATH_CORE_IMG + 'default.svg');
|
||||
$("#jscoverImagePreview").attr('src', HTML_PATH_ADMIN_THEME_IMG+'default.svg');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<div id="nav-advanced" class="tab-pane fade" role="tabpanel" aria-labelledby="advanced-tab">
|
||||
<?php
|
||||
// Date
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'date',
|
||||
'label' => $L->g('Date'),
|
||||
'placeholder' => '',
|
||||
'value' => Date::current(DB_DATE_FORMAT),
|
||||
'tip' => $L->g('date-format-format')
|
||||
));
|
||||
// Date
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'date',
|
||||
'label'=>$L->g('Date'),
|
||||
'placeholder'=>'',
|
||||
'value'=>Date::current(DB_DATE_FORMAT),
|
||||
'tip'=>$L->g('date-format-format')
|
||||
));
|
||||
|
||||
// Type
|
||||
echo Bootstrap::formSelectBlock(array(
|
||||
'name' => 'typeSelector',
|
||||
'label' => $L->g('Type'),
|
||||
'selected' => '',
|
||||
'options' => array(
|
||||
'published' => '- ' . $L->g('Default') . ' -',
|
||||
'sticky' => $L->g('Sticky'),
|
||||
'static' => $L->g('Static')
|
||||
),
|
||||
'tip' => ''
|
||||
));
|
||||
// Type
|
||||
echo Bootstrap::formSelectBlock(array(
|
||||
'name'=>'typeSelector',
|
||||
'label'=>$L->g('Type'),
|
||||
'selected'=>'',
|
||||
'options'=>array(
|
||||
'published'=>'- '.$L->g('Default').' -',
|
||||
'sticky'=>$L->g('Sticky'),
|
||||
'static'=>$L->g('Static')
|
||||
),
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
// Position
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'position',
|
||||
'label' => $L->g('Position'),
|
||||
'tip' => $L->g('Field used when ordering content by position'),
|
||||
'value' => $pages->nextPositionNumber()
|
||||
));
|
||||
// Position
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'position',
|
||||
'label'=>$L->g('Position'),
|
||||
'tip'=>$L->g('Field used when ordering content by position'),
|
||||
'value'=>$pages->nextPositionNumber()
|
||||
));
|
||||
|
||||
// Tags
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'tags',
|
||||
'label' => $L->g('Tags'),
|
||||
'placeholder' => '',
|
||||
'tip' => $L->g('Write the tags separated by comma')
|
||||
));
|
||||
// Tags
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'tags',
|
||||
'label'=>$L->g('Tags'),
|
||||
'placeholder'=>'',
|
||||
'tip'=>$L->g('Write the tags separated by comma')
|
||||
));
|
||||
|
||||
// Parent
|
||||
echo Bootstrap::formSelectBlock(array(
|
||||
'name' => 'parent',
|
||||
'label' => $L->g('Parent'),
|
||||
'options' => array(),
|
||||
'selected' => false,
|
||||
'class' => '',
|
||||
'tip' => $L->g('Start typing a page title to see a list of suggestions.'),
|
||||
));
|
||||
// Parent
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'parentTMP',
|
||||
'label'=>$L->g('Parent'),
|
||||
'placeholder'=>'',
|
||||
'tip'=>$L->g('Start typing a page title to see a list of suggestions.'),
|
||||
'value'=>''
|
||||
));
|
||||
|
||||
// Template
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'template',
|
||||
'label'=>$L->g('Template'),
|
||||
'placeholder'=>'',
|
||||
'value'=>'',
|
||||
'tip'=>$L->g('Write a template name to filter the page in the theme and change the style of the page.')
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'externalCoverImage',
|
||||
'label'=>$L->g('External cover image'),
|
||||
'placeholder'=>"https://",
|
||||
'value'=>'',
|
||||
'tip'=>$L->g('Set a cover image from external URL, such as a CDN or some server dedicated for images.')
|
||||
));
|
||||
|
||||
// Username
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'',
|
||||
'label'=>$L->g('Author'),
|
||||
'placeholder'=>'',
|
||||
'value'=>$login->username(),
|
||||
'tip'=>'',
|
||||
'disabled'=>true
|
||||
));
|
||||
?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var parent = $("#jsparent").select2({
|
||||
placeholder: "",
|
||||
allowClear: true,
|
||||
theme: "bootstrap4",
|
||||
minimumInputLength: 2,
|
||||
ajax: {
|
||||
url: HTML_PATH_ADMIN_ROOT + "ajax/get-published",
|
||||
data: function(params) {
|
||||
var query = {
|
||||
checkIsParent: true,
|
||||
query: params.term
|
||||
$(document).ready(function() {
|
||||
// Changes in External cover image input
|
||||
$("#jsexternalCoverImage").change(function() {
|
||||
$("#jscoverImage").val( $(this).val() );
|
||||
});
|
||||
|
||||
// Generate slug when the user type the title
|
||||
$("#jstitle").keyup(function() {
|
||||
var text = $(this).val();
|
||||
var parent = $("#jsparent").val();
|
||||
var currentKey = "";
|
||||
var ajax = new bluditAjax();
|
||||
var callBack = $("#jsslug");
|
||||
ajax.generateSlug(text, parent, currentKey, callBack);
|
||||
});
|
||||
|
||||
// Datepicker
|
||||
$("#jsdate").datetimepicker({format:DB_DATE_FORMAT});
|
||||
|
||||
// Parent autocomplete
|
||||
var parentsXHR;
|
||||
var parentsList; // Keep the parent list returned to get the key by the title page
|
||||
$("#jsparentTMP").autoComplete({
|
||||
minChars: 1,
|
||||
source: function(term, response) {
|
||||
// Prevent call inmediatly another ajax request
|
||||
try { parentsXHR.abort(); } catch(e){}
|
||||
// Get the list of parent pages by title (term)
|
||||
parentsXHR = $.getJSON(HTML_PATH_ADMIN_ROOT+"ajax/get-parents", {query: term},
|
||||
function(data) {
|
||||
parentsList = data;
|
||||
term = term.toLowerCase();
|
||||
var matches = [];
|
||||
for (var title in data) {
|
||||
if (~title.toLowerCase().indexOf(term))
|
||||
matches.push(title);
|
||||
}
|
||||
return query;
|
||||
},
|
||||
processResults: function(data) {
|
||||
return data;
|
||||
}
|
||||
},
|
||||
escapeMarkup: function(markup) {
|
||||
return markup;
|
||||
},
|
||||
templateResult: function(data) {
|
||||
var html = data.text;
|
||||
if (data.type == "static") {
|
||||
html += '<span class="badge badge-pill badge-light">' + data.type + '</span>';
|
||||
}
|
||||
return html;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
// Template
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'template',
|
||||
'label' => $L->g('Template'),
|
||||
'placeholder' => '',
|
||||
'value' => '',
|
||||
'tip' => $L->g('Write a template name to filter the page in the theme and change the style of the page.')
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'externalCoverImage',
|
||||
'label' => $L->g('External cover image'),
|
||||
'placeholder' => "https://",
|
||||
'value' => '',
|
||||
'tip' => $L->g('Set a cover image from external URL, such as a CDN or some server dedicated for images.')
|
||||
));
|
||||
|
||||
// Username
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => '',
|
||||
'label' => $L->g('Author'),
|
||||
'placeholder' => '',
|
||||
'value' => $login->username(),
|
||||
'tip' => '',
|
||||
'disabled' => true
|
||||
));
|
||||
?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
// Changes in External cover image input
|
||||
$("#jsexternalCoverImage").change(function() {
|
||||
$("#jscoverImage").val($(this).val());
|
||||
});
|
||||
|
||||
// Generate slug when the user type the title
|
||||
$("#jstitle").keyup(function() {
|
||||
var text = $(this).val();
|
||||
var parent = $("#jsparent").val();
|
||||
var currentKey = "";
|
||||
var ajax = new bluditAjax();
|
||||
var callBack = $("#jsslug");
|
||||
ajax.generateSlug(text, parent, currentKey, callBack);
|
||||
});
|
||||
|
||||
// Datepicker
|
||||
$("#jsdate").datetimepicker({
|
||||
format: DB_DATE_FORMAT
|
||||
});
|
||||
|
||||
|
||||
response(matches);
|
||||
});
|
||||
},
|
||||
onSelect: function(event, term, item) {
|
||||
// parentsList = array( pageTitle => pageKey )
|
||||
var parentKey = parentsList[term];
|
||||
$("#jsparent").attr("value", parentKey);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<?php if (!empty($site->customFields())) : ?>
|
||||
<div id="nav-custom" class="tab-pane fade" role="tabpanel" aria-labelledby="custom-tab">
|
||||
<?php
|
||||
$customFields = $site->customFields();
|
||||
foreach ($customFields as $field => $options) {
|
||||
if (!isset($options['position'])) {
|
||||
if ($options['type'] == "string") {
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'custom[' . $field . ']',
|
||||
'label' => (isset($options['label']) ? $options['label'] : ''),
|
||||
'value' => (isset($options['default']) ? $options['default'] : ''),
|
||||
'tip' => (isset($options['tip']) ? $options['tip'] : ''),
|
||||
'placeholder' => (isset($options['placeholder']) ? $options['placeholder'] : '')
|
||||
));
|
||||
} elseif ($options['type'] == "bool") {
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name' => 'custom[' . $field . ']',
|
||||
'label' => (isset($options['label']) ? $options['label'] : ''),
|
||||
'placeholder' => (isset($options['placeholder']) ? $options['placeholder'] : ''),
|
||||
'checked' => (isset($options['checked']) ? true : false),
|
||||
'labelForCheckbox' => (isset($options['tip']) ? $options['tip'] : '')
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<div id="nav-seo" class="tab-pane fade" role="tabpanel" aria-labelledby="seo-tab">
|
||||
<?php
|
||||
// Friendly URL
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'slug',
|
||||
'tip' => $L->g('URL associated with the content'),
|
||||
'label' => $L->g('Friendly URL'),
|
||||
'placeholder' => $L->g('Leave empty for autocomplete by Bludit.')
|
||||
));
|
||||
// Friendly URL
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name'=>'slug',
|
||||
'tip'=>$L->g('URL associated with the content'),
|
||||
'label'=>$L->g('Friendly URL'),
|
||||
'placeholder'=>$L->g('Leave empty for autocomplete by Bludit.')
|
||||
));
|
||||
|
||||
// Robots
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name' => 'noindex',
|
||||
'label' => 'Robots',
|
||||
'labelForCheckbox' => $L->g('apply-code-noindex-code-to-this-page'),
|
||||
'placeholder' => '',
|
||||
'checked' => false,
|
||||
'tip' => $L->g('This tells search engines not to show this page in their search results.')
|
||||
));
|
||||
// Robots
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name'=>'noindex',
|
||||
'label'=>'Robots',
|
||||
'labelForCheckbox'=>$L->g('apply-code-noindex-code-to-this-page'),
|
||||
'placeholder'=>'',
|
||||
'checked'=>false,
|
||||
'tip'=>$L->g('This tells search engines not to show this page in their search results.')
|
||||
));
|
||||
|
||||
// Robots
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name' => 'nofollow',
|
||||
'label' => '',
|
||||
'labelForCheckbox' => $L->g('apply-code-nofollow-code-to-this-page'),
|
||||
'placeholder' => '',
|
||||
'checked' => false,
|
||||
'tip' => $L->g('This tells search engines not to follow links on this page.')
|
||||
));
|
||||
// Robots
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name'=>'nofollow',
|
||||
'label'=>'',
|
||||
'labelForCheckbox'=>$L->g('apply-code-nofollow-code-to-this-page'),
|
||||
'placeholder'=>'',
|
||||
'checked'=>false,
|
||||
'tip'=>$L->g('This tells search engines not to follow links on this page.')
|
||||
));
|
||||
|
||||
// Robots
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name' => 'noarchive',
|
||||
'label' => '',
|
||||
'labelForCheckbox' => $L->g('apply-code-noarchive-code-to-this-page'),
|
||||
'placeholder' => '',
|
||||
'checked' => false,
|
||||
'tip' => $L->g('This tells search engines not to save a cached copy of this page.')
|
||||
));
|
||||
// Robots
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name'=>'noarchive',
|
||||
'label'=>'',
|
||||
'labelForCheckbox'=>$L->g('apply-code-noarchive-code-to-this-page'),
|
||||
'placeholder'=>'',
|
||||
'checked'=>false,
|
||||
'tip'=>$L->g('This tells search engines not to save a cached copy of this page.')
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Custom fields: TOP -->
|
||||
<?php
|
||||
$customFields = $site->customFields();
|
||||
foreach ($customFields as $field => $options) {
|
||||
if (isset($options['position']) && ($options['position'] == 'top')) {
|
||||
if ($options['type'] == "string") {
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'custom[' . $field . ']',
|
||||
'label' => (isset($options['label']) ? $options['label'] : ''),
|
||||
'value' => (isset($options['default']) ? $options['default'] : ''),
|
||||
'tip' => (isset($options['tip']) ? $options['tip'] : ''),
|
||||
'placeholder' => (isset($options['placeholder']) ? $options['placeholder'] : ''),
|
||||
'class' => 'mb-2',
|
||||
'labelClass' => 'mb-2 pb-2 border-bottom text-uppercase w-100'
|
||||
|
||||
));
|
||||
} elseif ($options['type'] == "bool") {
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name' => 'custom[' . $field . ']',
|
||||
'label' => (isset($options['label']) ? $options['label'] : ''),
|
||||
'placeholder' => (isset($options['placeholder']) ? $options['placeholder'] : ''),
|
||||
'checked' => (isset($options['checked']) ? true : false),
|
||||
'labelForCheckbox' => (isset($options['tip']) ? $options['tip'] : ''),
|
||||
'class' => 'mb-2',
|
||||
'labelClass' => 'mb-2 pb-2 border-bottom text-uppercase w-100'
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<!-- Title -->
|
||||
<div id="jseditorTitle" class="form-group mb-1">
|
||||
<input id="jstitle" name="title" type="text" dir="auto" class="form-control form-control-lg rounded-0" value="" placeholder="<?php $L->p('Enter title') ?>">
|
||||
<div id="jseditorTitle" class="form-group mt-1 mb-1">
|
||||
<input id="jstitle" name="title" type="text" class="form-control form-control-lg rounded-0" value="" placeholder="<?php $L->p('Enter title') ?>">
|
||||
</div>
|
||||
|
||||
<!-- Editor -->
|
||||
<textarea id="jseditor" class="editable h-100 mb-1"></textarea>
|
||||
|
||||
<!-- Custom fields: BOTTOM -->
|
||||
<?php
|
||||
$customFields = $site->customFields();
|
||||
foreach ($customFields as $field => $options) {
|
||||
if (isset($options['position']) && ($options['position'] == 'bottom')) {
|
||||
if ($options['type'] == "string") {
|
||||
echo Bootstrap::formInputTextBlock(array(
|
||||
'name' => 'custom[' . $field . ']',
|
||||
'label' => (isset($options['label']) ? $options['label'] : ''),
|
||||
'value' => (isset($options['default']) ? $options['default'] : ''),
|
||||
'tip' => (isset($options['tip']) ? $options['tip'] : ''),
|
||||
'placeholder' => (isset($options['placeholder']) ? $options['placeholder'] : ''),
|
||||
'class' => 'mt-2',
|
||||
'labelClass' => 'mb-2 pb-2 border-bottom text-uppercase w-100'
|
||||
|
||||
));
|
||||
} elseif ($options['type'] == "bool") {
|
||||
echo Bootstrap::formCheckbox(array(
|
||||
'name' => 'custom[' . $field . ']',
|
||||
'label' => (isset($options['label']) ? $options['label'] : ''),
|
||||
'placeholder' => (isset($options['placeholder']) ? $options['placeholder'] : ''),
|
||||
'checked' => (isset($options['checked']) ? true : false),
|
||||
'labelForCheckbox' => (isset($options['tip']) ? $options['tip'] : ''),
|
||||
'class' => 'mt-2',
|
||||
'labelClass' => 'mb-2 pb-2 border-bottom text-uppercase w-100'
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- Modal for Media Manager -->
|
||||
<?php include(PATH_ADMIN_THEMES . 'booty/html/media.php'); ?>
|
||||
<?php include(PATH_ADMIN_THEMES.'booty/html/media.php'); ?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function() {
|
||||
|
||||
// Define function if they doesn't exist
|
||||
// This helps if the user doesn't activate any plugin as editor
|
||||
if (typeof editorGetContent != "function") {
|
||||
window.editorGetContent = function() {
|
||||
return $("#jseditor").val();
|
||||
};
|
||||
}
|
||||
if (typeof editorInsertMedia != "function") {
|
||||
window.editorInsertMedia = function(filename) {
|
||||
$("#jseditor").val($('#jseditor').val() + '<img src="' + filename + '" alt="">');
|
||||
};
|
||||
}
|
||||
if (typeof editorInsertLinkedMedia != "function") {
|
||||
window.editorInsertLinkedMedia = function(filename, link) {
|
||||
$("#jseditor").val($('#jseditor').val() + '<a href="' + link + '"><img src="' + filename + '" alt=""></a>');
|
||||
};
|
||||
// Define function if they doesn't exist
|
||||
// This helps if the user doesn't activate any plugin as editor
|
||||
if (typeof editorGetContent != "function") {
|
||||
window.editorGetContent = function(){
|
||||
return $("#jseditor").val();
|
||||
};
|
||||
}
|
||||
if (typeof editorInsertMedia != "function") {
|
||||
window.editorInsertMedia = function(filename){
|
||||
$("#jseditor").val($('#jseditor').val()+'<img src="'+filename+'" alt="">');
|
||||
};
|
||||
}
|
||||
|
||||
// Button Save
|
||||
$("#jsbuttonSave").on("click", function() {
|
||||
// If the switch is setted to "published", get the value from the selector
|
||||
if ($("#jsPublishSwitch").is(':checked')) {
|
||||
var value = $("#jstypeSelector option:selected").val();
|
||||
$("#jstype").val(value);
|
||||
} else {
|
||||
$("#jstype").val("draft");
|
||||
}
|
||||
|
||||
// Button switch
|
||||
$("#jsbuttonSwitch").on("click", function() {
|
||||
if ($(this).data("switch") == "publish") {
|
||||
$(this).html('<i class="fa fa-square switch-icon-draft"></i> <?php $L->p('Draft') ?>');
|
||||
$(this).data("switch", "draft");
|
||||
} else {
|
||||
$(this).html('<i class="fa fa-square switch-icon-publish"></i> <?php $L->p('Publish') ?>');
|
||||
$(this).data("switch", "publish");
|
||||
}
|
||||
});
|
||||
// Get the content
|
||||
$("#jscontent").val( editorGetContent() );
|
||||
|
||||
// Button preview
|
||||
$("#jsbuttonPreview").on("click", function() {
|
||||
// Submit the form
|
||||
$("#jsform").submit();
|
||||
});
|
||||
|
||||
// Autosave
|
||||
// Autosave works when the content of the page is bigger than 100 characters
|
||||
setInterval(function() {
|
||||
var uuid = $("#jsuuid").val();
|
||||
var title = $("#jstitle").val();
|
||||
var content = editorGetContent();
|
||||
bluditAjax.saveAsDraft(uuid, title, content).then(function(data) {
|
||||
var preview = window.open("<?php echo DOMAIN_PAGES . 'autosave-' . $uuid . '?preview=' . md5('autosave-' . $uuid) ?>", "bludit-preview");
|
||||
preview.focus();
|
||||
});
|
||||
});
|
||||
var ajax = new bluditAjax();
|
||||
// showAlert is the function to display an alert defined in alert.php
|
||||
ajax.autosave(uuid, title, content, showAlert);
|
||||
},1000*60*AUTOSAVE_INTERVAL);
|
||||
|
||||
// Button Save
|
||||
$("#jsbuttonSave").on("click", function() {
|
||||
let actionParameters = '';
|
||||
|
||||
// If the switch is setted to "published", get the value from the selector
|
||||
if ($("#jsbuttonSwitch").data("switch") == "publish") {
|
||||
var value = $("#jstypeSelector option:selected").val();
|
||||
$("#jstype").val(value);
|
||||
actionParameters = '#' + value;
|
||||
} else {
|
||||
$("#jstype").val("draft");
|
||||
actionParameters = '#draft';
|
||||
}
|
||||
|
||||
// Get the content
|
||||
$("#jscontent").val(editorGetContent());
|
||||
|
||||
// Submit the form
|
||||
$("#jsform").attr('action', actionParameters);
|
||||
$("#jsform").submit();
|
||||
});
|
||||
|
||||
// Autosave
|
||||
var currentContent = editorGetContent();
|
||||
setInterval(function() {
|
||||
var uuid = $("#jsuuid").val();
|
||||
var title = $("#jstitle").val() + "[<?php $L->p('Autosave') ?>]";
|
||||
var content = editorGetContent();
|
||||
// Autosave when content has at least 100 characters
|
||||
if (content.length < 100) {
|
||||
return false;
|
||||
}
|
||||
// Autosave only when the user change the content
|
||||
if (currentContent != content) {
|
||||
currentContent = content;
|
||||
bluditAjax.saveAsDraft(uuid, title, content).then(function(data) {
|
||||
if (data.status == 0) {
|
||||
showAlert("<?php $L->p('Autosave') ?>");
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 1000 * 60 * AUTOSAVE_INTERVAL);
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<button type="submit" class="btn btn-primary btn-sm" name="save"><?php $L->p('Save') ?></button>
|
||||
<a class="btn btn-secondary btn-sm" href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>" role="button"><?php $L->p('Cancel') ?></a>
|
||||
</div>
|
||||
<?php echo Bootstrap::pageTitle(array('title'=>$L->g('Add a new user'), 'icon'=>'user')); ?>
|
||||
<?php echo Bootstrap::pageTitle(array('title'=>$L->g('Add a new user'), 'icon'=>'person')); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
@ -48,10 +48,10 @@
|
|||
echo Bootstrap::formSelect(array(
|
||||
'name'=>'role',
|
||||
'label'=>$L->g('Role'),
|
||||
'options'=>array('author'=>$L->g('Author'), 'editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')),
|
||||
'selected'=>'Author',
|
||||
'options'=>array('editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')),
|
||||
'selected'=>'Editor',
|
||||
'class'=>'',
|
||||
'tip'=>$L->g('author-can-write-and-edit-their-own-content')
|
||||
'tip'=>''
|
||||
));
|
||||
|
||||
echo Bootstrap::formInputText(array(
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
echo '<ul class="list-group list-group-sortable">';
|
||||
foreach ($plugins['siteSidebar'] as $Plugin) {
|
||||
echo '<li class="list-group-item" data-plugin="'.$Plugin->className().'"><span class="fa fa-arrows-v"></span> '.$Plugin->name().'</li>';
|
||||
echo '<li class="list-group-item" data-plugin="'.$Plugin->className().'"><span class="oi oi-move"></span> '.$Plugin->name().'</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
?>
|
||||
|
|
|
@ -1,75 +1,55 @@
|
|||
<?php
|
||||
|
||||
echo Bootstrap::pageTitle(array('title' => $L->g('Plugins'), 'icon' => 'puzzle-piece'));
|
||||
echo Bootstrap::pageTitle(array('title'=>$L->g('Plugins'), 'icon'=>'puzzle-piece'));
|
||||
|
||||
echo Bootstrap::link(array(
|
||||
'title' => $L->g('Change the position of the plugins'),
|
||||
'href' => HTML_PATH_ADMIN_ROOT . 'plugins-position',
|
||||
'icon' => 'arrows'
|
||||
'title'=>$L->g('Change the position of the plugins'),
|
||||
'href'=>HTML_PATH_ADMIN_ROOT.'plugins-position',
|
||||
'icon'=>'elevator'
|
||||
));
|
||||
|
||||
echo Bootstrap::formTitle(array('title' => $L->g('Search plugins')));
|
||||
|
||||
?>
|
||||
|
||||
<input type="text" dir="auto" class="form-control" id="search" placeholder="<?php $L->p('Search') ?>">
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#search").on("keyup", function() {
|
||||
var textToSearch = $(this).val().toLowerCase();
|
||||
$(".searchItem").each(function() {
|
||||
var item = $(this);
|
||||
item.hide();
|
||||
item.find(".searchText").each(function() {
|
||||
var element = $(this).text().toLowerCase();
|
||||
if (element.indexOf(textToSearch) != -1) {
|
||||
item.show();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
echo Bootstrap::formTitle(array('title' => $L->g('Enabled plugins')));
|
||||
|
||||
echo '
|
||||
<table class="table">
|
||||
<table class="table mt-3">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="border-bottom-0 w-25" scope="col">'.$L->g('Name').'</th>
|
||||
<th class="border-bottom-0 d-none d-sm-table-cell" scope="col">'.$L->g('Description').'</th>
|
||||
<th class="text-center border-bottom-0 d-none d-lg-table-cell" scope="col">'.$L->g('Version').'</th>
|
||||
<th class="text-center border-bottom-0 d-none d-lg-table-cell" scope="col">'.$L->g('Author').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
';
|
||||
|
||||
// Show installed plugins
|
||||
foreach ($pluginsInstalled as $plugin) {
|
||||
foreach ($plugins['all'] as $plugin) {
|
||||
echo '<tr id="'.$plugin->className().'" '.($plugin->installed()?'class="bg-light"':'').'>
|
||||
|
||||
if ($plugin->type() == 'theme') {
|
||||
// Do not display theme's plugins
|
||||
continue;
|
||||
}
|
||||
|
||||
echo '<tr id="' . $plugin->className() . '" class="bg-light searchItem">';
|
||||
|
||||
echo '<td class="align-middle pt-3 pb-3 w-25">
|
||||
<div class="searchText">' . $plugin->name() . '</div>
|
||||
<td class="align-middle pt-3 pb-3">
|
||||
<div>'.$plugin->name().'</div>
|
||||
<div class="mt-1">';
|
||||
if (method_exists($plugin, 'form')) {
|
||||
echo '<a class="mr-3" href="' . HTML_PATH_ADMIN_ROOT . 'configure-plugin/' . $plugin->className() . '">' . $L->g('Settings') . '</a>';
|
||||
}
|
||||
echo '<a href="' . HTML_PATH_ADMIN_ROOT . 'uninstall-plugin/' . $plugin->className() . '">' . $L->g('Deactivate') . '</a>';
|
||||
echo '</div>';
|
||||
|
||||
if ($plugin->installed()) {
|
||||
if (method_exists($plugin, 'form')) {
|
||||
echo '<a class="mr-3" href="'.HTML_PATH_ADMIN_ROOT.'configure-plugin/'.$plugin->className().'">'.$L->g('Settings').'</a>';
|
||||
}
|
||||
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'uninstall-plugin/'.$plugin->className().'">'.$L->g('Deactivate').'</a>';
|
||||
} else {
|
||||
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'install-plugin/'.$plugin->className().'">'.$L->g('Activate').'</a>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</td>';
|
||||
|
||||
echo '<td class="searchText align-middle d-none d-sm-table-cell">';
|
||||
echo $plugin->description();
|
||||
echo '<td class="align-middle d-none d-sm-table-cell">';
|
||||
echo $plugin->description();
|
||||
echo '</td>';
|
||||
|
||||
echo '<td class="text-center align-middle d-none d-lg-table-cell">';
|
||||
echo '<span>' . $plugin->version() . '</span>';
|
||||
echo '<span>'.$plugin->version().'</span>';
|
||||
echo '</td>';
|
||||
|
||||
echo '<td class="text-center align-middle d-none d-lg-table-cell">
|
||||
<a target="_blank" href="' . $plugin->website() . '">' . $plugin->author() . '</a>
|
||||
<a target="_blank" href="'.$plugin->website().'">'.$plugin->author().'</a>
|
||||
</td>';
|
||||
|
||||
echo '</tr>';
|
||||
|
@ -78,48 +58,4 @@ foreach ($pluginsInstalled as $plugin) {
|
|||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
|
||||
echo Bootstrap::formTitle(array('title' => $L->g('Disabled plugins')));
|
||||
|
||||
echo '
|
||||
<table class="table">
|
||||
<tbody>
|
||||
';
|
||||
|
||||
// Plugins not installed
|
||||
$pluginsNotInstalled = array_diff_key($plugins['all'], $pluginsInstalled);
|
||||
foreach ($pluginsNotInstalled as $plugin) {
|
||||
|
||||
if ($plugin->type() == 'theme') {
|
||||
// Do not display theme's plugins
|
||||
continue;
|
||||
}
|
||||
echo '<tr id="' . $plugin->className() . '" class="searchItem">';
|
||||
|
||||
echo '<td class="align-middle pt-3 pb-3 w-25">
|
||||
<div class="searchText">' . $plugin->name() . '</div>
|
||||
<div class="mt-1">
|
||||
<a href="' . HTML_PATH_ADMIN_ROOT . 'install-plugin/' . $plugin->className() . '">' . $L->g('Activate') . '</a>
|
||||
</div>
|
||||
</td>';
|
||||
|
||||
echo '<td class="searchText align-middle d-none d-sm-table-cell">';
|
||||
echo $plugin->description();
|
||||
echo '</td>';
|
||||
|
||||
echo '<td class="text-center align-middle d-none d-lg-table-cell">';
|
||||
echo '<span>' . $plugin->version() . '</span>';
|
||||
echo '</td>';
|
||||
|
||||
echo '<td class="text-center align-middle d-none d-lg-table-cell">
|
||||
<a target="_blank" href="' . $plugin->website() . '">' . $plugin->author() . '</a>
|
||||
</td>';
|
||||
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
';
|
|
@ -1,57 +1,53 @@
|
|||
<?php
|
||||
|
||||
echo Bootstrap::pageTitle(array('title' => $L->g('Themes'), 'icon' => 'desktop'));
|
||||
echo Bootstrap::pageTitle(array('title'=>$L->g('Themes'), 'icon'=>'eye'));
|
||||
|
||||
echo '
|
||||
<table class="table mt-3">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="border-bottom-0 w-25" scope="col">' . $L->g('Name') . '</th>
|
||||
<th class="border-bottom-0 d-none d-sm-table-cell" scope="col">' . $L->g('Description') . '</th>
|
||||
<th class="text-center border-bottom-0 d-none d-lg-table-cell" scope="col">' . $L->g('Version') . '</th>
|
||||
<th class="text-center border-bottom-0 d-none d-lg-table-cell" scope="col">' . $L->g('Author') . '</th>
|
||||
<th class="border-bottom-0 w-25" scope="col">'.$L->g('Name').'</th>
|
||||
<th class="border-bottom-0 d-none d-sm-table-cell" scope="col">'.$L->g('Description').'</th>
|
||||
<th class="text-center border-bottom-0 d-none d-lg-table-cell" scope="col">'.$L->g('Version').'</th>
|
||||
<th class="text-center border-bottom-0 d-none d-lg-table-cell" scope="col">'.$L->g('Author').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
';
|
||||
|
||||
foreach ($themes as $theme) {
|
||||
echo '
|
||||
<tr ' . ($theme['dirname'] == $site->theme() ? 'class="bg-light"' : '') . '>
|
||||
echo '
|
||||
<tr '.($theme['dirname']==$site->theme()?'class="bg-light"':'').'>
|
||||
<td class="align-middle pt-3 pb-3">
|
||||
<div>'.$theme['name'].($theme['dirname']==$site->theme()?'<span class="badge badge-primary ml-2">'.$L->g('Active').'</span>':'').'</div>
|
||||
<div>'.$theme['name'].'</div>
|
||||
<div class="mt-1">
|
||||
';
|
||||
|
||||
if ($theme['dirname'] != $site->theme()) {
|
||||
echo '<a href="' . HTML_PATH_ADMIN_ROOT . 'install-theme/' . $theme['dirname'] . '">' . $L->g('Activate') . '</a>';
|
||||
} else {
|
||||
if (isset($theme['plugin'])) {
|
||||
echo '<a href="' . HTML_PATH_ADMIN_ROOT . 'configure-plugin/' . $theme['plugin'] . '">' . $L->g('Settings') . '</a>';
|
||||
}
|
||||
}
|
||||
if ($theme['dirname']!=$site->theme()) {
|
||||
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'install-theme/'.$theme['dirname'].'">'.$L->g('Activate').'</a>';
|
||||
}
|
||||
|
||||
echo '
|
||||
echo '
|
||||
</div>
|
||||
</td>
|
||||
';
|
||||
|
||||
echo '<td class="align-middle d-none d-sm-table-cell">';
|
||||
echo $theme['description'];
|
||||
echo '</td>';
|
||||
echo '<td class="align-middle d-none d-sm-table-cell">';
|
||||
echo $theme['description'];
|
||||
echo '</td>';
|
||||
|
||||
echo '<td class="text-center align-middle d-none d-lg-table-cell">';
|
||||
echo '<span>' . $theme['version'] . '</span>';
|
||||
echo '</td>';
|
||||
echo '<td class="text-center align-middle d-none d-lg-table-cell">';
|
||||
echo '<span>'.$theme['version'].'</span>';
|
||||
echo '</td>';
|
||||
|
||||
echo '<td class="text-center align-middle d-none d-lg-table-cell">
|
||||
<a target="_blank" href="' . $theme['website'] . '">' . $theme['author'] . '</a>
|
||||
echo '<td class="text-center align-middle d-none d-lg-table-cell">
|
||||
<a target="_blank" href="'.$theme['website'].'">'.$theme['author'].'</a>
|
||||
</td>';
|
||||
|
||||
echo '</tr>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
';
|
|
@ -7,7 +7,7 @@
|
|||
<button type="submit" class="btn btn-primary btn-sm" name="save"><?php $L->p('Save') ?></button>
|
||||
<a class="btn btn-secondary btn-sm" href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$user->username() ?>" role="button"><?php $L->p('Cancel') ?></a>
|
||||
</div>
|
||||
<?php echo Bootstrap::pageTitle(array('title'=>$L->g('Change password'), 'icon'=>'user')); ?>
|
||||
<?php echo Bootstrap::pageTitle(array('title'=>$L->g('Change password'), 'icon'=>'person')); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<?php
|
||||
|
||||
echo Bootstrap::pageTitle(array('title'=>$L->g('Users'), 'icon'=>'users'));
|
||||
echo Bootstrap::pageTitle(array('title'=>$L->g('Users'), 'icon'=>'people'));
|
||||
|
||||
echo Bootstrap::link(array(
|
||||
'title'=>$L->g('add-a-new-user'),
|
||||
|
@ -30,7 +30,7 @@ foreach ($list as $username) {
|
|||
try {
|
||||
$user = new User($username);
|
||||
echo '<tr>';
|
||||
echo '<td><img class="profilePicture mr-1" alt="" src="'.(Sanitize::pathFile(PATH_UPLOADS_PROFILES.$user->username().'.png')?DOMAIN_UPLOADS_PROFILES.$user->username().'.png':HTML_PATH_CORE_IMG.'default.svg').'" /><a href="'.HTML_PATH_ADMIN_ROOT.'edit-user/'.$username.'">'.$username.'</a></td>';
|
||||
echo '<td><img class="profilePicture mr-1" alt="" src="'.(Sanitize::pathFile(PATH_UPLOADS_PROFILES.$user->username().'.png')?DOMAIN_UPLOADS_PROFILES.$user->username().'.png':HTML_PATH_ADMIN_THEME_IMG.'default.svg').'" /><a href="'.HTML_PATH_ADMIN_ROOT.'edit-user/'.$username.'">'.$username.'</a></td>';
|
||||
echo '<td class="d-none d-lg-table-cell">'.$user->nickname().'</td>';
|
||||
echo '<td>'.$user->email().'</td>';
|
||||
echo '<td>'.($user->enabled()?'<b>'.$L->g('Enabled').'</b>':$L->g('Disabled')).'</td>';
|
||||
|
@ -38,8 +38,6 @@ foreach ($list as $username) {
|
|||
echo '<td>'.$L->g('Administrator').'</td>';
|
||||
} elseif ($user->role()=='editor') {
|
||||
echo '<td>'.$L->g('Editor').'</td>';
|
||||
} elseif ($user->role()=='author') {
|
||||
echo '<td>'.$L->g('Author').'</td>';
|
||||
} else {
|
||||
echo '<td>'.$L->g('Reader').'</td>';
|
||||
}
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// $_GET
|
||||
// ----------------------------------------------------------------------------
|
||||
// (string) $_GET['query']
|
||||
$query = isset($_GET['query']) ? Text::lowercase($_GET['query']) : false;
|
||||
// ----------------------------------------------------------------------------
|
||||
if ($query===false) {
|
||||
ajaxResponse(1, 'Invalid query.');
|
||||
}
|
||||
|
||||
$result = array();
|
||||
|
||||
// MENU
|
||||
if (Text::stringContains(Text::lowercase($L->g('New content')), $query)) {
|
||||
$tmp = array('disabled'=>true, 'icon'=>'plus-circle', 'type'=>'menu');
|
||||
$tmp['text'] = $L->g('New content');
|
||||
$tmp['url'] = HTML_PATH_ADMIN_ROOT.'new-content';
|
||||
array_push($result, $tmp);
|
||||
}
|
||||
if (Text::stringContains(Text::lowercase($L->g('New category')), $query)) {
|
||||
$tmp = array('disabled'=>true, 'icon'=>'tag', 'type'=>'menu');
|
||||
$tmp['text'] = $L->g('New category');
|
||||
$tmp['url'] = HTML_PATH_ADMIN_ROOT.'new-category';
|
||||
array_push($result, $tmp);
|
||||
}
|
||||
if (Text::stringContains(Text::lowercase($L->g('New user')), $query)) {
|
||||
$tmp = array('disabled'=>true, 'icon'=>'user', 'type'=>'menu');
|
||||
$tmp['text'] = $L->g('New user');
|
||||
$tmp['url'] = HTML_PATH_ADMIN_ROOT.'new-user';
|
||||
array_push($result, $tmp);
|
||||
}
|
||||
if (Text::stringContains(Text::lowercase($L->g('Categories')), $query)) {
|
||||
$tmp = array('disabled'=>true, 'icon'=>'tags', 'type'=>'menu');
|
||||
$tmp['text'] = $L->g('Categories');
|
||||
$tmp['url'] = HTML_PATH_ADMIN_ROOT.'categories';
|
||||
array_push($result, $tmp);
|
||||
}
|
||||
if (Text::stringContains(Text::lowercase($L->g('Users')), $query)) {
|
||||
$tmp = array('disabled'=>true, 'icon'=>'users', 'type'=>'menu');
|
||||
$tmp['text'] = $L->g('Users');
|
||||
$tmp['url'] = HTML_PATH_ADMIN_ROOT.'users';
|
||||
array_push($result, $tmp);
|
||||
}
|
||||
|
||||
|
||||
// PAGES
|
||||
$pagesKey = $pages->getDB();
|
||||
foreach ($pagesKey as $pageKey) {
|
||||
try {
|
||||
$page = new Page($pageKey);
|
||||
$lowerTitle = Text::lowercase($page->title());
|
||||
if (Text::stringContains($lowerTitle, $query)) {
|
||||
$tmp = array('disabled'=>true);
|
||||
$tmp['id'] = $page->key();
|
||||
$tmp['text'] = $page->title();
|
||||
$tmp['type'] = $page->type();
|
||||
array_push($result, $tmp);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// continue
|
||||
}
|
||||
}
|
||||
|
||||
exit (json_encode(array('results'=>$result)));
|
||||
|
||||
?>
|
|
@ -1,49 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
header('Content-Type: application/json');
|
||||
|
||||
/*
|
||||
| Search for pages that have in the title the string $query and returns the array of pages
|
||||
|
|
||||
| @_GET['published'] boolean True to search in published database
|
||||
| @_GET['static'] boolean True to search in static database
|
||||
| @_GET['sticky'] boolean True to search in sticky database
|
||||
| @_GET['scheduled'] boolean True to search in scheduled database
|
||||
| @_GET['draft'] boolean True to search in draft database
|
||||
| @_GET['query'] string Text to search in the title
|
||||
|
|
||||
| @return array
|
||||
*/
|
||||
|
||||
// $_GET
|
||||
// ----------------------------------------------------------------------------
|
||||
$published = empty($_GET['published']) ? false:true;
|
||||
$static = empty($_GET['static']) ? false:true;
|
||||
$sticky = empty($_GET['sticky']) ? false:true;
|
||||
$scheduled = empty($_GET['scheduled']) ? false:true;
|
||||
$draft = empty($_GET['draft']) ? false:true;
|
||||
$query = isset($_GET['query']) ? Text::lowercase($_GET['query']) : false;
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
if ($query===false) {
|
||||
ajaxResponse(1, 'Invalid query.');
|
||||
}
|
||||
|
||||
$pageNumber = 1;
|
||||
$numberOfItems = -1;
|
||||
$pagesKey = $pages->getList($pageNumber, $numberOfItems, $published, $static, $sticky, $draft, $scheduled);
|
||||
$tmp = array();
|
||||
foreach ($pagesKey as $pageKey) {
|
||||
try {
|
||||
$page = new Page($pageKey);
|
||||
$lowerTitle = Text::lowercase($page->title());
|
||||
if (Text::stringContains($lowerTitle, $query)) {
|
||||
$tmp[$page->key()] = $page->json(true);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// continue
|
||||
}
|
||||
}
|
||||
|
||||
exit (json_encode($tmp));
|
||||
|
||||
?>
|
|
@ -1,22 +1,16 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
header('Content-Type: application/json');
|
||||
|
||||
/*
|
||||
| Delete an image from a particular page
|
||||
|
|
||||
| @_POST['filename'] string Name of the file to delete
|
||||
| @_POST['uuid'] string Page UUID
|
||||
|
|
||||
| @return array
|
||||
*/
|
||||
|
||||
// $_POST
|
||||
// ----------------------------------------------------------------------------
|
||||
// (string) $_POST['path'] Name of file to delete, just the filename
|
||||
$filename = isset($_POST['filename']) ? $_POST['filename'] : false;
|
||||
|
||||
// (string) $_POST['uuid']
|
||||
$uuid = empty($_POST['uuid']) ? false : $_POST['uuid'];
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
if ($filename===false) {
|
||||
if ($filename==false) {
|
||||
ajaxResponse(1, 'The filename is empty.');
|
||||
}
|
||||
|
||||
|
|
|
@ -1,22 +1,9 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
header('Content-Type: application/json');
|
||||
|
||||
/*
|
||||
| Generate an slug text for the URL
|
||||
|
|
||||
| @_POST['text'] string The text from where is generated the slug
|
||||
| @_POST['parentKey'] string The parent key if the page has one
|
||||
| @_POST['currentKey'] string The current page key
|
||||
|
|
||||
| @return array
|
||||
*/
|
||||
|
||||
// $_POST
|
||||
// ----------------------------------------------------------------------------
|
||||
$text = isset($_POST['text']) ? $_POST['text'] : '';
|
||||
$parent = isset($_POST['parentKey']) ? $_POST['parentKey'] : '';
|
||||
$oldKey = isset($_POST['currentKey']) ? $_POST['currentKey'] : '';
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
$slug = $pages->generateKey($text, $parent, $returnSlug=true, $oldKey);
|
||||
|
||||
|
|
24
bl-kernel/ajax/get-parents.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// $_GET
|
||||
// ----------------------------------------------------------------------------
|
||||
// (string) $_GET['query']
|
||||
$query = isset($_GET['query']) ? Text::lowercase($_GET['query']) : false;
|
||||
// ----------------------------------------------------------------------------
|
||||
if ($query===false) {
|
||||
ajaxResponse(1, 'Invalid query.');
|
||||
}
|
||||
|
||||
$tmp = array();
|
||||
$parents = buildParentPages();
|
||||
foreach ($parents as $parent) {
|
||||
$lowerTitle = Text::lowercase($parent->title());
|
||||
if (Text::stringContains($lowerTitle, $query)) {
|
||||
$tmp[$parent->title()] = $parent->key();
|
||||
}
|
||||
}
|
||||
|
||||
exit (json_encode($tmp));
|
||||
|
||||
?>
|
|
@ -1,43 +1,26 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
header('Content-Type: application/json');
|
||||
|
||||
/*
|
||||
| Returns a list of pages and the title contains the query string
|
||||
| The returned list have published, sticky and statics pages
|
||||
|
|
||||
| @_POST['query'] string The string to search in the title of the pages
|
||||
|
|
||||
| @return array
|
||||
*/
|
||||
|
||||
// $_GET
|
||||
// ----------------------------------------------------------------------------
|
||||
// (string) $_GET['query']
|
||||
$query = isset($_GET['query']) ? Text::lowercase($_GET['query']) : false;
|
||||
// (boolean) $_GET['checkIsParent']
|
||||
$checkIsParent = empty($_GET['checkIsParent']) ? false : true;
|
||||
// ----------------------------------------------------------------------------
|
||||
if ($query===false) {
|
||||
ajaxResponse(1, 'Invalid query.');
|
||||
}
|
||||
|
||||
$result = array();
|
||||
$pagesKey = $pages->getDB();
|
||||
$tmp = array();
|
||||
$published = $pages->getPublishedDB();
|
||||
$statics = $pages->getStaticDB();
|
||||
$pagesKey = array_merge($published, $statics);
|
||||
foreach ($pagesKey as $pageKey) {
|
||||
try {
|
||||
$page = new Page($pageKey);
|
||||
if ($page->isParent() || !$checkIsParent) {
|
||||
// Check page status
|
||||
if ($page->published() || $page->sticky() || $page->isStatic()) {
|
||||
// Check if the query contains in the title
|
||||
$lowerTitle = Text::lowercase($page->title());
|
||||
if (Text::stringContains($lowerTitle, $query)) {
|
||||
$tmp = array('disabled'=>false);
|
||||
$tmp['id'] = $page->key();
|
||||
$tmp['text'] = $page->title();
|
||||
$tmp['type'] = $page->type();
|
||||
array_push($result, $tmp);
|
||||
}
|
||||
if ($page->isParent()) {
|
||||
$lowerTitle = Text::lowercase($page->title());
|
||||
if (Text::stringContains($lowerTitle, $query)) {
|
||||
$tmp[$page->title()] = $page->key();
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
|
@ -45,6 +28,6 @@ foreach ($pagesKey as $pageKey) {
|
|||
}
|
||||
}
|
||||
|
||||
exit (json_encode(array('results'=>$result)));
|
||||
exit (json_encode($tmp));
|
||||
|
||||
?>
|
|
@ -1,23 +1,16 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
header('Content-Type: application/json');
|
||||
|
||||
/*
|
||||
| Returns a list of images from a particular page
|
||||
|
|
||||
| @_POST['pageNumber'] int Page number for the paginator
|
||||
| @_POST['path'] string Pre-defined name for the directory to read, its pre-defined to avoid security issues
|
||||
| @_POST['uuid'] string Page UUID
|
||||
|
|
||||
| @return array
|
||||
*/
|
||||
|
||||
// $_POST
|
||||
// ----------------------------------------------------------------------------
|
||||
// $_POST['pageNumber'] > 0
|
||||
// (integer) $_POST['pageNumber'] > 0
|
||||
$pageNumber = empty($_POST['pageNumber']) ? 1 : (int)$_POST['pageNumber'];
|
||||
$pageNumber = $pageNumber - 1;
|
||||
|
||||
// (string) $_POST['path']
|
||||
$path = empty($_POST['path']) ? false : $_POST['path'];
|
||||
|
||||
// (string) $_POST['uuid']
|
||||
$uuid = empty($_POST['uuid']) ? false : $_POST['uuid'];
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
@ -34,7 +27,7 @@ if ($path=='thumbnails') {
|
|||
|
||||
// Get all files from the directory $path, also split the array by numberOfItems
|
||||
// The function listFiles split in chunks
|
||||
$listOfFilesByPage = Filesystem::listFiles($path, '*', '*', MEDIA_MANAGER_SORT_BY_DATE, MEDIA_MANAGER_NUMBER_OF_FILES);
|
||||
$listOfFilesByPage = Filesystem::listFiles($path, '*', '*', $GLOBALS['MEDIA_MANAGER_SORT_BY_DATE'], $GLOBALS['MEDIA_MANAGER_NUMBER_OF_FILES']);
|
||||
|
||||
// Check if the page number exists in the chunks
|
||||
if (isset($listOfFilesByPage[$pageNumber])) {
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
header('Content-Type: application/json');
|
||||
|
||||
/*
|
||||
| Delete the site logo
|
||||
| This script delete the file and set and empty string in the database
|
||||
|
|
||||
| @return array
|
||||
*/
|
||||
|
||||
// Delete the file
|
||||
$logoFilename = $site->logo(false);
|
||||
if ($logoFilename) {
|
||||
Filesystem::rmfile(PATH_UPLOADS.$logoFilename);
|
||||
}
|
||||
|
||||
// Remove the logo from the database
|
||||
$site->set(array('logo'=>''));
|
||||
|
||||
ajaxResponse(0, 'Logo removed.');
|
||||
|
||||
?>
|
|
@ -1,70 +0,0 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
header('Content-Type: application/json');
|
||||
|
||||
/*
|
||||
| Upload site logo
|
||||
| The final filename is the site's name and the extension is the same as the file uploaded
|
||||
|
|
||||
| @_FILES['inputFile'] multipart/form-data File from form
|
||||
|
|
||||
| @return array
|
||||
*/
|
||||
|
||||
if (!isset($_FILES['inputFile'])) {
|
||||
ajaxResponse(1, 'Error trying to upload the site logo.');
|
||||
}
|
||||
|
||||
// Check path traversal on $filename
|
||||
if (Text::stringContains($_FILES['inputFile']['name'], DS, false)) {
|
||||
$message = 'Path traversal detected.';
|
||||
Log::set($message, LOG_TYPE_ERROR);
|
||||
ajaxResponse(1, $message);
|
||||
}
|
||||
|
||||
// File extension
|
||||
$fileExtension = Filesystem::extension($_FILES['inputFile']['name']);
|
||||
$fileExtension = Text::lowercase($fileExtension);
|
||||
if (!in_array($fileExtension, $GLOBALS['ALLOWED_IMG_EXTENSION'])) {
|
||||
$message = $L->g('File type is not supported. Allowed types:').' '.implode(', ',$GLOBALS['ALLOWED_IMG_EXTENSION']);
|
||||
Log::set($message, LOG_TYPE_ERROR);
|
||||
ajaxResponse(1, $message);
|
||||
}
|
||||
|
||||
// File MIME Type
|
||||
$fileMimeType = Filesystem::mimeType($_FILES['inputFile']['tmp_name']);
|
||||
if ($fileMimeType!==false) {
|
||||
if (!in_array($fileMimeType, $GLOBALS['ALLOWED_IMG_MIMETYPES'])) {
|
||||
$message = $L->g('File mime type is not supported. Allowed types:').' '.implode(', ',$GLOBALS['ALLOWED_IMG_MIMETYPES']);
|
||||
Log::set($message, LOG_TYPE_ERROR);
|
||||
ajaxResponse(1, $message);
|
||||
}
|
||||
}
|
||||
|
||||
// Final filename
|
||||
$filename = 'logo.'.$fileExtension;
|
||||
if (Text::isNotEmpty( $site->title() )) {
|
||||
$filename = $site->title().'.'.$fileExtension;
|
||||
}
|
||||
|
||||
// Delete old image
|
||||
$oldFilename = $site->logo(false);
|
||||
if ($oldFilename) {
|
||||
Filesystem::rmfile(PATH_UPLOADS.$oldFilename);
|
||||
}
|
||||
|
||||
// Move from temporary directory to uploads
|
||||
Filesystem::mv($_FILES['inputFile']['tmp_name'], PATH_UPLOADS.$filename);
|
||||
|
||||
// Permissions
|
||||
chmod(PATH_UPLOADS.$filename, 0644);
|
||||
|
||||
// Store the filename in the database
|
||||
$site->set(array('logo'=>$filename));
|
||||
|
||||
ajaxResponse(0, 'Image uploaded.', array(
|
||||
'filename'=>$filename,
|
||||
'absoluteURL'=>DOMAIN_UPLOADS.$filename,
|
||||
'absolutePath'=>PATH_UPLOADS.$filename
|
||||
));
|
||||
|
||||
?>
|
|
@ -1,52 +1,48 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
header('Content-Type: application/json');
|
||||
|
||||
/*
|
||||
| Create/edit a page and save as draft
|
||||
| If the UUID already exists the page is updated
|
||||
|
|
||||
| @_POST['title'] string Page title
|
||||
| @_POST['content'] string Page content
|
||||
| @_POST['uuid'] string Page uuid
|
||||
| @_POST['uuid'] string Page type, by default is draft
|
||||
|
|
||||
| @return array
|
||||
*/
|
||||
|
||||
// $_POST
|
||||
// ----------------------------------------------------------------------------
|
||||
// (string) $_POST['title']
|
||||
$title = isset($_POST['title']) ? $_POST['title'] : false;
|
||||
// (string) $_POST['content']
|
||||
$content = isset($_POST['content']) ? $_POST['content'] : false;
|
||||
// (string) $_POST['uuid']
|
||||
$uuid = isset($_POST['uuid']) ? $_POST['uuid'] : false;
|
||||
$type = isset($_POST['type']) ? $_POST['type'] : 'draft';
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Check UUID
|
||||
if (empty($uuid)) {
|
||||
ajaxResponse(1, 'Save as draft fail. UUID not defined.');
|
||||
ajaxResponse(1, 'Autosave fail. UUID not defined.');
|
||||
}
|
||||
|
||||
// Check content length to create the autosave page
|
||||
if (Text::length($content)<100) {
|
||||
ajaxResponse(1, 'Autosave not completed. The content length is less than 100 characters.');
|
||||
}
|
||||
|
||||
$autosaveUUID = 'autosave-'.$uuid;
|
||||
$page = array(
|
||||
'uuid'=>$uuid,
|
||||
'key'=>$uuid,
|
||||
'slug'=>$uuid,
|
||||
'title'=>$title,
|
||||
'uuid'=>$autosaveUUID,
|
||||
'key'=>$autosaveUUID,
|
||||
'slug'=>$autosaveUUID,
|
||||
'title'=>$title.' [ Autosave ] ',
|
||||
'content'=>$content,
|
||||
'type'=>$type
|
||||
'type'=>'draft'
|
||||
);
|
||||
|
||||
// Get the page key by the UUID
|
||||
$pageKey = $pages->getByUUID($uuid);
|
||||
$pageKey = $pages->getByUUID($autosaveUUID);
|
||||
|
||||
// if pageKey is empty means the page doesn't exist
|
||||
// if pageKey is empty means the autosave page doesn't exist
|
||||
if (empty($pageKey)) {
|
||||
createPage($page);
|
||||
} else {
|
||||
editPage($page);
|
||||
}
|
||||
|
||||
ajaxResponse(0, 'Save as draft successfully.', array(
|
||||
'uuid'=>$uuid
|
||||
ajaxResponse(0, 'Autosave successfully.', array(
|
||||
'uuid'=>$autosaveUUID
|
||||
));
|
||||
|
||||
?>
|
|
@ -1,45 +1,40 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
header('Content-Type: application/json');
|
||||
|
||||
/*
|
||||
| Upload an image to a particular page
|
||||
|
|
||||
| @_POST['uuid'] string Page uuid
|
||||
|
|
||||
| @return array
|
||||
*/
|
||||
|
||||
// $_POST
|
||||
// ----------------------------------------------------------------------------
|
||||
// (string) $_POST['uuid']
|
||||
$uuid = empty($_POST['uuid']) ? false : $_POST['uuid'];
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Check path traversal on $uuid
|
||||
if ($uuid) {
|
||||
if (Text::stringContains($uuid, DS, false)) {
|
||||
$message = 'Path traversal detected.';
|
||||
Log::set($message, LOG_TYPE_ERROR);
|
||||
ajaxResponse(1, $message);
|
||||
}
|
||||
}
|
||||
|
||||
// Set upload directory
|
||||
if ($uuid && IMAGE_RESTRICT) {
|
||||
$imageDirectory = PATH_UPLOADS_PAGES . $uuid . DS;
|
||||
$thumbnailDirectory = $imageDirectory . 'thumbnails' . DS;
|
||||
if (!Filesystem::directoryExists($thumbnailDirectory)) {
|
||||
Filesystem::mkdir($thumbnailDirectory, true);
|
||||
}
|
||||
$uploadDirectory = PATH_UPLOADS_PAGES.$uuid.DS;
|
||||
$thumbnailDirectory = $uploadDirectory.'thumbnails'.DS;
|
||||
} else {
|
||||
$imageDirectory = PATH_UPLOADS;
|
||||
$uploadDirectory = PATH_UPLOADS;
|
||||
$thumbnailDirectory = PATH_UPLOADS_THUMBNAILS;
|
||||
}
|
||||
|
||||
$images = array();
|
||||
foreach ($_FILES['images']['name'] as $uuid => $filename) {
|
||||
// Create directory for images
|
||||
if (!is_dir($uploadDirectory)){
|
||||
Filesystem::mkdir($uploadDirectory, true);
|
||||
}
|
||||
|
||||
// Create directory for thumbnails
|
||||
if (!is_dir($thumbnailDirectory)){
|
||||
Filesystem::mkdir($thumbnailDirectory, true);
|
||||
}
|
||||
|
||||
// File extensions allowed
|
||||
$allowedExtensions = array('gif', 'png', 'jpg', 'jpeg', 'svg');
|
||||
|
||||
// Upload all images
|
||||
foreach ($_FILES['bluditInputFiles']['name'] as $key=>$filename) {
|
||||
|
||||
// Check for errors
|
||||
if ($_FILES['images']['error'][$uuid] != 0) {
|
||||
$message = $L->g('Maximum load file size allowed:') . ' ' . ini_get('upload_max_filesize');
|
||||
if ($_FILES['bluditInputFiles']['error'][$key] != 0) {
|
||||
$message = $L->g('Maximum load file size allowed:').' '.ini_get('upload_max_filesize');
|
||||
Log::set($message, LOG_TYPE_ERROR);
|
||||
ajaxResponse(1, $message);
|
||||
}
|
||||
|
@ -47,49 +42,35 @@ foreach ($_FILES['images']['name'] as $uuid => $filename) {
|
|||
// Convert URL characters such as spaces or quotes to characters
|
||||
$filename = urldecode($filename);
|
||||
|
||||
// Check path traversal on $filename
|
||||
if (Text::stringContains($filename, DS, false)) {
|
||||
$message = 'Path traversal detected.';
|
||||
Log::set($message, LOG_TYPE_ERROR);
|
||||
ajaxResponse(1, $message);
|
||||
}
|
||||
|
||||
// Check file extension
|
||||
$fileExtension = Filesystem::extension($filename);
|
||||
$fileExtension = pathinfo($filename, PATHINFO_EXTENSION);
|
||||
$fileExtension = Text::lowercase($fileExtension);
|
||||
if (!in_array($fileExtension, $GLOBALS['ALLOWED_IMG_EXTENSION'])) {
|
||||
$message = $L->g('File type is not supported. Allowed types:') . ' ' . implode(', ', $GLOBALS['ALLOWED_IMG_EXTENSION']);
|
||||
if (!in_array($fileExtension, $allowedExtensions) ) {
|
||||
$message = $L->g('File type is not supported. Allowed types:').' '.implode(', ',$allowedExtensions);
|
||||
Log::set($message, LOG_TYPE_ERROR);
|
||||
ajaxResponse(1, $message);
|
||||
}
|
||||
|
||||
// Check file MIME Type
|
||||
$fileMimeType = Filesystem::mimeType($_FILES['images']['tmp_name'][$uuid]);
|
||||
if ($fileMimeType !== false) {
|
||||
if (!in_array($fileMimeType, $GLOBALS['ALLOWED_IMG_MIMETYPES'])) {
|
||||
$message = $L->g('File mime type is not supported. Allowed types:') . ' ' . implode(', ', $GLOBALS['ALLOWED_IMG_MIMETYPES']);
|
||||
Log::set($message, LOG_TYPE_ERROR);
|
||||
ajaxResponse(1, $message);
|
||||
}
|
||||
}
|
||||
// Generate the next filename to not overwrite the original file
|
||||
$nextFilename = Filesystem::nextFilename($uploadDirectory, $filename);
|
||||
|
||||
// Move from PHP tmp file to Bludit tmp directory
|
||||
Filesystem::mv($_FILES['images']['tmp_name'][$uuid], PATH_TMP . $filename);
|
||||
// Move from temporary directory to uploads folder
|
||||
rename($_FILES['bluditInputFiles']['tmp_name'][$key], $uploadDirectory.$nextFilename);
|
||||
chmod($uploadDirectory.$nextFilename, 0644);
|
||||
|
||||
// Transform the image and generate the thumbnail
|
||||
$image = transformImage(PATH_TMP . $filename, $imageDirectory, $thumbnailDirectory);
|
||||
|
||||
if ($image) {
|
||||
chmod($image, 0644);
|
||||
$filename = Filesystem::filename($image);
|
||||
array_push($images, $filename);
|
||||
// Generate Thumbnail
|
||||
// Exclude generate thumbnail for SVG format and generate a symlink to the svg
|
||||
if ($fileExtension == 'svg') {
|
||||
symlink($uploadDirectory.$nextFilename, $thumbnailDirectory.$nextFilename);
|
||||
} else {
|
||||
$message = 'Error after transformImage() function.';
|
||||
Log::set($message, LOG_TYPE_ERROR);
|
||||
ajaxResponse(1, $message);
|
||||
$Image = new Image();
|
||||
$Image->setImage($uploadDirectory.$nextFilename, $site->thumbnailWidth(), $site->thumbnailHeight(), 'crop');
|
||||
$Image->saveImage($thumbnailDirectory.$nextFilename, $site->thumbnailQuality(), true);
|
||||
}
|
||||
}
|
||||
|
||||
ajaxResponse(0, 'Images uploaded.', array(
|
||||
'images' => $images
|
||||
ajaxResponse(0, 'List of files and number of chunks.', array(
|
||||
'filename'=>$nextFilename
|
||||
));
|
||||
|
||||
?>
|
38
bl-kernel/ajax/upload-logo.php
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
header('Content-Type: application/json');
|
||||
|
||||
if (!isset($_FILES['inputFile'])) {
|
||||
ajaxResponse(1, 'Error trying to upload the site logo.');
|
||||
}
|
||||
|
||||
// File extension
|
||||
$fileExtension = pathinfo($_FILES['inputFile']['name'], PATHINFO_EXTENSION);
|
||||
|
||||
// Final filename
|
||||
$filename = 'logo.'.$fileExtension;
|
||||
if (Text::isNotEmpty( $site->title() )) {
|
||||
$filename = $site->title().'.'.$fileExtension;
|
||||
}
|
||||
|
||||
// Delete old image
|
||||
$oldFilename = $site->logo(false);
|
||||
if ($oldFilename) {
|
||||
Filesystem::rmfile(PATH_UPLOADS.$oldFilename);
|
||||
}
|
||||
|
||||
// Move from temporary directory to uploads
|
||||
rename($_FILES['inputFile']['tmp_name'], PATH_UPLOADS.$filename);
|
||||
|
||||
// Permissions
|
||||
chmod(PATH_UPLOADS.$filename, 0644);
|
||||
|
||||
// Store the filename in the database
|
||||
$site->set(array('logo'=>$filename));
|
||||
|
||||
ajaxResponse(0, 'Image uploaded.', array(
|
||||
'filename'=>$filename,
|
||||
'absoluteURL'=>DOMAIN_UPLOADS.$filename,
|
||||
'absolutePath'=>PATH_UPLOADS.$filename
|
||||
));
|
||||
|
||||
?>
|
|
@ -11,43 +11,14 @@ if ($username===false) {
|
|||
ajaxResponse(1, 'Error in username.');
|
||||
}
|
||||
|
||||
if ( ($login->role()!='admin') && ($login->username()!=$username) ) {
|
||||
ajaxResponse(1, 'Error in username.');
|
||||
}
|
||||
|
||||
if (!isset($_FILES['profilePictureInputFile'])) {
|
||||
ajaxResponse(1, 'Error trying to upload the profile picture.');
|
||||
}
|
||||
|
||||
// Check path traversal
|
||||
if (Text::stringContains($username, DS, false)) {
|
||||
$message = 'Path traversal detected.';
|
||||
Log::set($message, LOG_TYPE_ERROR);
|
||||
ajaxResponse(1, $message);
|
||||
}
|
||||
|
||||
// Check file extension
|
||||
$fileExtension = Filesystem::extension($_FILES['profilePictureInputFile']['name']);
|
||||
$fileExtension = Text::lowercase($fileExtension);
|
||||
if (!in_array($fileExtension, $GLOBALS['ALLOWED_IMG_EXTENSION']) ) {
|
||||
$message = $L->g('File type is not supported. Allowed types:').' '.implode(', ',$GLOBALS['ALLOWED_IMG_EXTENSION']);
|
||||
Log::set($message, LOG_TYPE_ERROR);
|
||||
ajaxResponse(1, $message);
|
||||
}
|
||||
|
||||
// Check file MIME Type
|
||||
$fileMimeType = Filesystem::mimeType($_FILES['profilePictureInputFile']['tmp_name']);
|
||||
if ($fileMimeType!==false) {
|
||||
if (!in_array($fileMimeType, $GLOBALS['ALLOWED_IMG_MIMETYPES'])) {
|
||||
$message = $L->g('File mime type is not supported. Allowed types:').' '.implode(', ',$GLOBALS['ALLOWED_IMG_MIMETYPES']);
|
||||
Log::set($message, LOG_TYPE_ERROR);
|
||||
ajaxResponse(1, $message);
|
||||
}
|
||||
}
|
||||
|
||||
// File extension
|
||||
$fileExtension = pathinfo($_FILES['profilePictureInputFile']['name'], PATHINFO_EXTENSION);
|
||||
// Tmp filename
|
||||
$tmpFilename = $username.'.'.$fileExtension;
|
||||
|
||||
// Final filename
|
||||
$filename = $username.'.png';
|
||||
|
||||
|
@ -59,8 +30,8 @@ $image = new Image();
|
|||
$image->setImage(PATH_TMP.$tmpFilename, PROFILE_IMG_WIDTH, PROFILE_IMG_HEIGHT, 'crop');
|
||||
$image->saveImage(PATH_UPLOADS_PROFILES.$filename, PROFILE_IMG_QUALITY, false, true);
|
||||
|
||||
// Delete temporary file
|
||||
Filesystem::rmfile(PATH_TMP.$tmpFilename);
|
||||
// Remove the tmp file
|
||||
unlink(PATH_TMP.$tmpFilename);
|
||||
|
||||
// Permissions
|
||||
chmod(PATH_UPLOADS_PROFILES.$filename, 0644);
|
||||
|
@ -71,4 +42,4 @@ ajaxResponse(0, 'Image uploaded.', array(
|
|||
'absolutePath'=>PATH_UPLOADS_PROFILES.$filename
|
||||
));
|
||||
|
||||
?>
|
||||
?>
|
24
bl-kernel/ajax/user-logged.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
header('Content-Type: application/json');
|
||||
|
||||
/*
|
||||
*
|
||||
* This script check if the user is logged
|
||||
*
|
||||
*/
|
||||
|
||||
// Check UUID
|
||||
if ($login->isLogged()) {
|
||||
exit (json_encode(array(
|
||||
'status'=>1,
|
||||
'message'=>'The user is logged.'
|
||||
)));
|
||||
}
|
||||
|
||||
exit (json_encode(array(
|
||||
'status'=>0,
|
||||
'message'=>'The user is NOT logged.'
|
||||
)));
|
||||
|
||||
|
||||
?>
|
|
@ -1,10 +1,9 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// Start the session
|
||||
// If the session is not possible to start the admin area is not available
|
||||
Session::start($site->urlPath(), $site->isHTTPS());
|
||||
// Session
|
||||
Session::start();
|
||||
if (Session::started()===false) {
|
||||
exit('Bludit CMS. Session initialization failed.');
|
||||
exit('Bludit CMS. Session initialization failure.');
|
||||
}
|
||||
|
||||
$login = new Login();
|
||||
|
@ -14,30 +13,26 @@ $layout = array(
|
|||
'view'=>null,
|
||||
'template'=>'index.php',
|
||||
'slug'=>null,
|
||||
'plugin'=>false,
|
||||
'parameters'=>null,
|
||||
'title'=>'Bludit'
|
||||
);
|
||||
|
||||
// Get the Controller
|
||||
// Get the view, controller, and the parameters from the URL.
|
||||
$explodeSlug = $url->explodeSlug();
|
||||
$layout['controller'] = $layout['view'] = $layout['slug'] = empty($explodeSlug[0])?'dashboard':$explodeSlug[0];
|
||||
unset($explodeSlug[0]);
|
||||
$layout['parameters'] = implode('/', $explodeSlug);
|
||||
|
||||
// Get the Plugins
|
||||
include(PATH_RULES.'60.plugins.php');
|
||||
// Check if the user want to access to an admin controller or view from a plugin
|
||||
if ($layout['controller'] === 'plugin' && !empty($explodeSlug)) {
|
||||
// Lowercase plugins class name to search by case-insensitive
|
||||
$pluginsLowerCases = array_change_key_case($pluginsInstalled);
|
||||
$pluginName = Text::lowercase(array_shift($explodeSlug));
|
||||
if (isset($pluginsLowerCases[$pluginName])) {
|
||||
$layout['plugin'] = $pluginsLowerCases[$pluginName];
|
||||
}
|
||||
// Disable Magic Quotes.
|
||||
// Thanks, http://stackoverflow.com/questions/517008/how-to-turn-off-magic-quotes-on-shared-hosting
|
||||
if ( in_array( strtolower( ini_get( 'magic_quotes_gpc' ) ), array( '1', 'on' ) ) ) {
|
||||
$_POST = array_map('stripslashes', $_POST);
|
||||
$_GET = array_map('stripslashes', $_GET);
|
||||
$_COOKIE = array_map('stripslashes', $_COOKIE);
|
||||
}
|
||||
|
||||
// Get the URL parameters
|
||||
$layout['parameters'] = implode('/', $explodeSlug);
|
||||
// Boot plugins rules
|
||||
include(PATH_RULES.'60.plugins.php');
|
||||
|
||||
// --- AJAX ---
|
||||
if ($layout['slug']==='ajax') {
|
||||
|
@ -68,8 +63,8 @@ else
|
|||
// Slug is login.
|
||||
if ($url->notFound() || !$login->isLogged() || ($url->slug()==='login') ) {
|
||||
$layout['controller'] = 'login';
|
||||
$layout['view'] = 'login';
|
||||
$layout['template'] = 'login.php';
|
||||
$layout['view'] = 'login';
|
||||
$layout['template'] = 'login.php';
|
||||
|
||||
// Generate the tokenCSRF for the user not logged, when the user log-in the token will be change.
|
||||
$security->generateTokenCSRF();
|
||||
|
@ -90,8 +85,6 @@ else
|
|||
// Load controller.
|
||||
if (Sanitize::pathFile(PATH_ADMIN_CONTROLLERS, $layout['controller'].'.php')) {
|
||||
include(PATH_ADMIN_CONTROLLERS.$layout['controller'].'.php');
|
||||
} elseif ($layout['plugin'] && method_exists($layout['plugin'], 'adminController')) {
|
||||
$layout['plugin']->adminController();
|
||||
}
|
||||
|
||||
// Load view and theme.
|
||||
|
|
|
@ -1,77 +1,73 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
// Bludit version
|
||||
define('BLUDIT_VERSION', '3.16.2');
|
||||
define('BLUDIT_CODENAME', 'Valencia');
|
||||
define('BLUDIT_RELEASE_DATE', '2024-08-23');
|
||||
define('BLUDIT_BUILD', '20240806');
|
||||
define('BLUDIT_VERSION', '3.8.0');
|
||||
define('BLUDIT_CODENAME', 'APA');
|
||||
define('BLUDIT_RELEASE_DATE', '2019-02-22');
|
||||
define('BLUDIT_BUILD', '20190222');
|
||||
|
||||
// Change to TRUE for debugging
|
||||
// Debug mode
|
||||
// Change to FALSE, for prevent warning or errors on browser
|
||||
define('DEBUG_MODE', TRUE);
|
||||
define('DEBUG_TYPE', 'INFO'); // INFO, TRACE
|
||||
|
||||
// This determines whether errors should be printed to the screen as part of the output or if they should be hidden from the user.
|
||||
ini_set("display_errors", 0);
|
||||
|
||||
// Even when display_errors is on, errors that occur during PHP's startup sequence are not displayed.
|
||||
// It's strongly recommended to keep display_startup_errors off, except for debugging.
|
||||
ini_set('display_startup_errors', 0);
|
||||
|
||||
// If disabled, error message will be solely plain text instead HTML code.
|
||||
ini_set("html_errors", 0);
|
||||
|
||||
// Tells whether script error messages should be logged to the server's error log or error_log.
|
||||
ini_set('log_errors', 1);
|
||||
|
||||
error_reporting(0); // Turn off all error reporting
|
||||
if (DEBUG_MODE) {
|
||||
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
|
||||
} else {
|
||||
error_reporting(E_ERROR);
|
||||
// Turn on all error reporting
|
||||
ini_set("display_errors", 0);
|
||||
ini_set('display_startup_errors',0);
|
||||
ini_set("html_errors", 1);
|
||||
ini_set('log_errors', 1);
|
||||
error_reporting(E_ALL | E_STRICT | E_NOTICE);
|
||||
}
|
||||
|
||||
// PHP paths
|
||||
// PATH_ROOT and PATH_BOOT are defined in index.php
|
||||
define('PATH_LANGUAGES', PATH_ROOT . 'bl-languages' . DS);
|
||||
define('PATH_THEMES', PATH_ROOT . 'bl-themes' . DS);
|
||||
define('PATH_PLUGINS', PATH_ROOT . 'bl-plugins' . DS);
|
||||
define('PATH_KERNEL', PATH_ROOT . 'bl-kernel' . DS);
|
||||
define('PATH_CONTENT', PATH_ROOT . 'bl-content' . DS);
|
||||
define('PATH_LANGUAGES', PATH_ROOT.'bl-languages'.DS);
|
||||
define('PATH_THEMES', PATH_ROOT.'bl-themes'.DS);
|
||||
define('PATH_PLUGINS', PATH_ROOT.'bl-plugins'.DS);
|
||||
define('PATH_KERNEL', PATH_ROOT.'bl-kernel'.DS);
|
||||
define('PATH_CONTENT', PATH_ROOT.'bl-content'.DS);
|
||||
|
||||
define('PATH_ABSTRACT', PATH_KERNEL . 'abstract' . DS);
|
||||
define('PATH_RULES', PATH_KERNEL . 'boot' . DS . 'rules' . DS);
|
||||
define('PATH_HELPERS', PATH_KERNEL . 'helpers' . DS);
|
||||
define('PATH_AJAX', PATH_KERNEL . 'ajax' . DS);
|
||||
define('PATH_CORE_JS', PATH_KERNEL . 'js' . DS);
|
||||
define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS);
|
||||
define('PATH_RULES', PATH_KERNEL.'boot'.DS.'rules'.DS);
|
||||
define('PATH_HELPERS', PATH_KERNEL.'helpers'.DS);
|
||||
define('PATH_AJAX', PATH_KERNEL.'ajax'.DS);
|
||||
define('PATH_CORE_JS', PATH_KERNEL.'js'.DS);
|
||||
|
||||
define('PATH_PAGES', PATH_CONTENT . 'pages' . DS);
|
||||
define('PATH_DATABASES', PATH_CONTENT . 'databases' . DS);
|
||||
define('PATH_PLUGINS_DATABASES', PATH_CONTENT . 'databases' . DS . 'plugins' . DS);
|
||||
define('PATH_TMP', PATH_CONTENT . 'tmp' . DS);
|
||||
define('PATH_UPLOADS', PATH_CONTENT . 'uploads' . DS);
|
||||
define('PATH_WORKSPACES', PATH_CONTENT . 'workspaces' . DS);
|
||||
define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
|
||||
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
|
||||
define('PATH_PLUGINS_DATABASES', PATH_CONTENT.'databases'.DS.'plugins'.DS);
|
||||
define('PATH_TMP', PATH_CONTENT.'tmp'.DS);
|
||||
define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS);
|
||||
define('PATH_WORKSPACES', PATH_CONTENT.'workspaces'.DS);
|
||||
|
||||
define('PATH_UPLOADS_PAGES', PATH_UPLOADS . 'pages' . DS);
|
||||
define('PATH_UPLOADS_PROFILES', PATH_UPLOADS . 'profiles' . DS);
|
||||
define('PATH_UPLOADS_THUMBNAILS', PATH_UPLOADS . 'thumbnails' . DS);
|
||||
define('PATH_UPLOADS_PAGES', PATH_UPLOADS.'pages'.DS);
|
||||
define('PATH_UPLOADS_PROFILES', PATH_UPLOADS.'profiles'.DS);
|
||||
define('PATH_UPLOADS_THUMBNAILS', PATH_UPLOADS.'thumbnails'.DS);
|
||||
|
||||
define('PATH_ADMIN', PATH_KERNEL . 'admin' . DS);
|
||||
define('PATH_ADMIN_THEMES', PATH_ADMIN . 'themes' . DS);
|
||||
define('PATH_ADMIN_CONTROLLERS', PATH_ADMIN . 'controllers' . DS);
|
||||
define('PATH_ADMIN_VIEWS', PATH_ADMIN . 'views' . DS);
|
||||
define('PATH_ADMIN', PATH_KERNEL.'admin'.DS);
|
||||
define('PATH_ADMIN_THEMES', PATH_ADMIN.'themes'.DS);
|
||||
define('PATH_ADMIN_CONTROLLERS', PATH_ADMIN.'controllers'.DS);
|
||||
define('PATH_ADMIN_VIEWS', PATH_ADMIN.'views'.DS);
|
||||
|
||||
define('DEBUG_FILE', PATH_CONTENT . 'debug.txt');
|
||||
define('DEBUG_FILE', PATH_CONTENT.'debug.txt');
|
||||
|
||||
// PAGES DATABASE
|
||||
define('DB_PAGES', PATH_DATABASES . 'pages.php');
|
||||
define('DB_SITE', PATH_DATABASES . 'site.php');
|
||||
define('DB_CATEGORIES', PATH_DATABASES . 'categories.php');
|
||||
define('DB_TAGS', PATH_DATABASES . 'tags.php');
|
||||
define('DB_SYSLOG', PATH_DATABASES . 'syslog.php');
|
||||
define('DB_USERS', PATH_DATABASES . 'users.php');
|
||||
define('DB_SECURITY', PATH_DATABASES . 'security.php');
|
||||
define('DB_PAGES', PATH_DATABASES.'pages.php');
|
||||
define('DB_SITE', PATH_DATABASES.'site.php');
|
||||
define('DB_CATEGORIES', PATH_DATABASES.'categories.php');
|
||||
define('DB_TAGS', PATH_DATABASES.'tags.php');
|
||||
define('DB_SYSLOG', PATH_DATABASES.'syslog.php');
|
||||
define('DB_USERS', PATH_DATABASES.'users.php');
|
||||
define('DB_SECURITY', PATH_DATABASES.'security.php');
|
||||
|
||||
// JSON pretty print
|
||||
if (!defined('JSON_PRETTY_PRINT')) {
|
||||
define('JSON_PRETTY_PRINT', 128);
|
||||
}
|
||||
|
||||
// User environment variables
|
||||
include(PATH_KERNEL . 'boot' . DS . 'variables.php');
|
||||
include(PATH_KERNEL.'boot'.DS.'variables.php');
|
||||
|
||||
// Set internal character encoding
|
||||
mb_internal_encoding(CHARSET);
|
||||
|
@ -80,57 +76,57 @@ mb_internal_encoding(CHARSET);
|
|||
mb_http_output(CHARSET);
|
||||
|
||||
// Inclde Abstract Classes
|
||||
include(PATH_ABSTRACT . 'dbjson.class.php');
|
||||
include(PATH_ABSTRACT . 'dblist.class.php');
|
||||
include(PATH_ABSTRACT . 'plugin.class.php');
|
||||
include(PATH_ABSTRACT.'dbjson.class.php');
|
||||
include(PATH_ABSTRACT.'dblist.class.php');
|
||||
include(PATH_ABSTRACT.'plugin.class.php');
|
||||
|
||||
// Inclde Classes
|
||||
include(PATH_KERNEL . 'pages.class.php');
|
||||
include(PATH_KERNEL . 'users.class.php');
|
||||
include(PATH_KERNEL . 'tags.class.php');
|
||||
include(PATH_KERNEL . 'language.class.php');
|
||||
include(PATH_KERNEL . 'site.class.php');
|
||||
include(PATH_KERNEL . 'categories.class.php');
|
||||
include(PATH_KERNEL . 'syslog.class.php');
|
||||
include(PATH_KERNEL . 'pagex.class.php');
|
||||
include(PATH_KERNEL . 'category.class.php');
|
||||
include(PATH_KERNEL . 'tag.class.php');
|
||||
include(PATH_KERNEL . 'user.class.php');
|
||||
include(PATH_KERNEL . 'url.class.php');
|
||||
include(PATH_KERNEL . 'login.class.php');
|
||||
include(PATH_KERNEL . 'parsedown.class.php');
|
||||
include(PATH_KERNEL . 'security.class.php');
|
||||
include(PATH_KERNEL.'pages.class.php');
|
||||
include(PATH_KERNEL.'users.class.php');
|
||||
include(PATH_KERNEL.'tags.class.php');
|
||||
include(PATH_KERNEL.'language.class.php');
|
||||
include(PATH_KERNEL.'site.class.php');
|
||||
include(PATH_KERNEL.'categories.class.php');
|
||||
include(PATH_KERNEL.'syslog.class.php');
|
||||
include(PATH_KERNEL.'pagex.class.php');
|
||||
include(PATH_KERNEL.'category.class.php');
|
||||
include(PATH_KERNEL.'tag.class.php');
|
||||
include(PATH_KERNEL.'user.class.php');
|
||||
include(PATH_KERNEL.'url.class.php');
|
||||
include(PATH_KERNEL.'login.class.php');
|
||||
include(PATH_KERNEL.'parsedown.class.php');
|
||||
include(PATH_KERNEL.'security.class.php');
|
||||
|
||||
// Include functions
|
||||
include(PATH_KERNEL . 'functions.php');
|
||||
include(PATH_KERNEL.'functions.php');
|
||||
|
||||
// Include Helpers Classes
|
||||
include(PATH_HELPERS . 'text.class.php');
|
||||
include(PATH_HELPERS . 'log.class.php');
|
||||
include(PATH_HELPERS . 'date.class.php');
|
||||
include(PATH_HELPERS . 'theme.class.php');
|
||||
include(PATH_HELPERS . 'session.class.php');
|
||||
include(PATH_HELPERS . 'redirect.class.php');
|
||||
include(PATH_HELPERS . 'sanitize.class.php');
|
||||
include(PATH_HELPERS . 'valid.class.php');
|
||||
include(PATH_HELPERS . 'email.class.php');
|
||||
include(PATH_HELPERS . 'filesystem.class.php');
|
||||
include(PATH_HELPERS . 'alert.class.php');
|
||||
include(PATH_HELPERS . 'paginator.class.php');
|
||||
include(PATH_HELPERS . 'image.class.php');
|
||||
include(PATH_HELPERS . 'tcp.class.php');
|
||||
include(PATH_HELPERS . 'dom.class.php');
|
||||
include(PATH_HELPERS . 'cookie.class.php');
|
||||
include(PATH_HELPERS.'text.class.php');
|
||||
include(PATH_HELPERS.'log.class.php');
|
||||
include(PATH_HELPERS.'date.class.php');
|
||||
include(PATH_HELPERS.'theme.class.php');
|
||||
include(PATH_HELPERS.'session.class.php');
|
||||
include(PATH_HELPERS.'redirect.class.php');
|
||||
include(PATH_HELPERS.'sanitize.class.php');
|
||||
include(PATH_HELPERS.'valid.class.php');
|
||||
include(PATH_HELPERS.'email.class.php');
|
||||
include(PATH_HELPERS.'filesystem.class.php');
|
||||
include(PATH_HELPERS.'alert.class.php');
|
||||
include(PATH_HELPERS.'paginator.class.php');
|
||||
include(PATH_HELPERS.'image.class.php');
|
||||
include(PATH_HELPERS.'tcp.class.php');
|
||||
include(PATH_HELPERS.'dom.class.php');
|
||||
include(PATH_HELPERS.'cookie.class.php');
|
||||
|
||||
if (file_exists(PATH_KERNEL . 'bludit.pro.php')) {
|
||||
include(PATH_KERNEL . 'bludit.pro.php');
|
||||
if (file_exists(PATH_KERNEL.'bludit.pro.php')) {
|
||||
include(PATH_KERNEL.'bludit.pro.php');
|
||||
}
|
||||
|
||||
// Objects
|
||||
$pages = new Pages();
|
||||
$users = new Users();
|
||||
$tags = new Tags();
|
||||
$categories = new Categories();
|
||||
$categories = new Categories();
|
||||
$site = new Site();
|
||||
$url = new Url();
|
||||
$security = new Security();
|
||||
|
@ -148,43 +144,43 @@ if (!empty($_SERVER['DOCUMENT_ROOT']) && !empty($_SERVER['SCRIPT_NAME']) && empt
|
|||
$base = str_replace($_SERVER['DOCUMENT_ROOT'], '', $_SERVER['SCRIPT_NAME']);
|
||||
$base = dirname($base);
|
||||
} elseif (empty($base)) {
|
||||
$base = empty($_SERVER['SCRIPT_NAME']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
|
||||
$base = empty( $_SERVER['SCRIPT_NAME'] ) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
|
||||
$base = dirname($base);
|
||||
}
|
||||
|
||||
if (strpos($_SERVER['REQUEST_URI'], $base) !== 0) {
|
||||
if (strpos($_SERVER['REQUEST_URI'], $base)!==0) {
|
||||
$base = '/';
|
||||
} elseif ($base != DS) {
|
||||
} elseif ($base!=DS) {
|
||||
$base = trim($base, '/');
|
||||
$base = '/' . $base . '/';
|
||||
$base = '/'.$base.'/';
|
||||
} else {
|
||||
// Workaround for Windows Web Servers
|
||||
$base = '/';
|
||||
}
|
||||
|
||||
define('HTML_PATH_ROOT', $base);
|
||||
define('HTML_PATH_THEMES', HTML_PATH_ROOT . 'bl-themes/');
|
||||
define('HTML_PATH_THEME', HTML_PATH_THEMES . $site->theme() . '/');
|
||||
define('HTML_PATH_THEME_CSS', HTML_PATH_THEME . 'css/');
|
||||
define('HTML_PATH_THEME_JS', HTML_PATH_THEME . 'js/');
|
||||
define('HTML_PATH_THEME_IMG', HTML_PATH_THEME . 'img/');
|
||||
define('HTML_PATH_ADMIN_ROOT', HTML_PATH_ROOT . ADMIN_URI_FILTER . '/');
|
||||
define('HTML_PATH_ADMIN_THEME', HTML_PATH_ROOT . 'bl-kernel/admin/themes/' . $site->adminTheme() . '/');
|
||||
define('HTML_PATH_ADMIN_THEME_JS', HTML_PATH_ADMIN_THEME . 'js/');
|
||||
define('HTML_PATH_ADMIN_THEME_CSS', HTML_PATH_ADMIN_THEME . 'css/');
|
||||
define('HTML_PATH_CORE_JS', HTML_PATH_ROOT . 'bl-kernel/js/');
|
||||
define('HTML_PATH_CORE_CSS', HTML_PATH_ROOT . 'bl-kernel/css/');
|
||||
define('HTML_PATH_CORE_IMG', HTML_PATH_ROOT . 'bl-kernel/img/');
|
||||
define('HTML_PATH_CONTENT', HTML_PATH_ROOT . 'bl-content/');
|
||||
define('HTML_PATH_UPLOADS', HTML_PATH_ROOT . 'bl-content/uploads/');
|
||||
define('HTML_PATH_UPLOADS_PAGES', HTML_PATH_UPLOADS . 'pages/');
|
||||
define('HTML_PATH_UPLOADS_PROFILES', HTML_PATH_UPLOADS . 'profiles/');
|
||||
define('HTML_PATH_UPLOADS_THUMBNAILS', HTML_PATH_UPLOADS . 'thumbnails/');
|
||||
define('HTML_PATH_PLUGINS', HTML_PATH_ROOT . 'bl-plugins/');
|
||||
define('HTML_PATH_THEMES', HTML_PATH_ROOT.'bl-themes/');
|
||||
define('HTML_PATH_THEME', HTML_PATH_THEMES.$site->theme().'/');
|
||||
define('HTML_PATH_THEME_CSS', HTML_PATH_THEME.'css/');
|
||||
define('HTML_PATH_THEME_JS', HTML_PATH_THEME.'js/');
|
||||
define('HTML_PATH_THEME_IMG', HTML_PATH_THEME.'img/');
|
||||
define('HTML_PATH_ADMIN_ROOT', HTML_PATH_ROOT.ADMIN_URI_FILTER.'/');
|
||||
define('HTML_PATH_ADMIN_THEME', HTML_PATH_ROOT.'bl-kernel/admin/themes/'.$site->adminTheme().'/');
|
||||
define('HTML_PATH_ADMIN_THEME_JS', HTML_PATH_ADMIN_THEME.'js/');
|
||||
define('HTML_PATH_ADMIN_THEME_CSS', HTML_PATH_ADMIN_THEME.'css/');
|
||||
define('HTML_PATH_ADMIN_THEME_IMG', HTML_PATH_ADMIN_THEME.'img/');
|
||||
define('HTML_PATH_CORE_JS', HTML_PATH_ROOT.'bl-kernel/js/');
|
||||
define('HTML_PATH_CORE_CSS', HTML_PATH_ROOT.'bl-kernel/css/');
|
||||
define('HTML_PATH_CONTENT', HTML_PATH_ROOT.'bl-content/');
|
||||
define('HTML_PATH_UPLOADS', HTML_PATH_ROOT.'bl-content/uploads/');
|
||||
define('HTML_PATH_UPLOADS_PAGES', HTML_PATH_UPLOADS.'pages/');
|
||||
define('HTML_PATH_UPLOADS_PROFILES', HTML_PATH_UPLOADS.'profiles/');
|
||||
define('HTML_PATH_UPLOADS_THUMBNAILS', HTML_PATH_UPLOADS.'thumbnails/');
|
||||
define('HTML_PATH_PLUGINS', HTML_PATH_ROOT.'bl-plugins/');
|
||||
|
||||
// --- Objects with dependency ---
|
||||
$language = new Language($site->language());
|
||||
$url->checkFilters($site->uriFilters());
|
||||
$language = new Language( $site->language() );
|
||||
$url->checkFilters( $site->uriFilters() );
|
||||
|
||||
// --- CONSTANTS with dependency ---
|
||||
|
||||
|
@ -212,43 +208,40 @@ define('IMAGE_RESTRICT', $site->imageRestrict());
|
|||
// TRUE to convert relatives images to absoultes, FALSE No changes apply
|
||||
define('IMAGE_RELATIVE_TO_ABSOLUTE', $site->imageRelativeToAbsolute());
|
||||
|
||||
// TRUE if the markdown parser is enabled
|
||||
define('MARKDOWN_PARSER', $site->markdownParser());
|
||||
|
||||
// --- PHP paths with dependency ---
|
||||
// This paths are absolutes for the OS
|
||||
define('THEME_DIR', PATH_ROOT . 'bl-themes' . DS . $site->theme() . DS);
|
||||
define('THEME_DIR_PHP', THEME_DIR . 'php' . DS);
|
||||
define('THEME_DIR_CSS', THEME_DIR . 'css' . DS);
|
||||
define('THEME_DIR_JS', THEME_DIR . 'js' . DS);
|
||||
define('THEME_DIR_IMG', THEME_DIR . 'img' . DS);
|
||||
define('THEME_DIR_LANG', THEME_DIR . 'languages' . DS);
|
||||
define('THEME_DIR', PATH_ROOT.'bl-themes'.DS.$site->theme().DS);
|
||||
define('THEME_DIR_PHP', THEME_DIR.'php'.DS);
|
||||
define('THEME_DIR_CSS', THEME_DIR.'css'.DS);
|
||||
define('THEME_DIR_JS', THEME_DIR.'js'.DS);
|
||||
define('THEME_DIR_IMG', THEME_DIR.'img'.DS);
|
||||
define('THEME_DIR_LANG', THEME_DIR.'languages'.DS);
|
||||
|
||||
// --- Absolute paths with domain ---
|
||||
// This paths are absolutes for the user / web browsing.
|
||||
define('DOMAIN', $site->domain());
|
||||
define('DOMAIN_BASE', DOMAIN . HTML_PATH_ROOT);
|
||||
define('DOMAIN_CORE_JS', DOMAIN . HTML_PATH_CORE_JS);
|
||||
define('DOMAIN_CORE_CSS', DOMAIN . HTML_PATH_CORE_CSS);
|
||||
define('DOMAIN_THEME', DOMAIN . HTML_PATH_THEME);
|
||||
define('DOMAIN_THEME_CSS', DOMAIN . HTML_PATH_THEME_CSS);
|
||||
define('DOMAIN_THEME_JS', DOMAIN . HTML_PATH_THEME_JS);
|
||||
define('DOMAIN_THEME_IMG', DOMAIN . HTML_PATH_THEME_IMG);
|
||||
define('DOMAIN_ADMIN_THEME', DOMAIN . HTML_PATH_ADMIN_THEME);
|
||||
define('DOMAIN_ADMIN_THEME_CSS', DOMAIN . HTML_PATH_ADMIN_THEME_CSS);
|
||||
define('DOMAIN_ADMIN_THEME_JS', DOMAIN . HTML_PATH_ADMIN_THEME_JS);
|
||||
define('DOMAIN_UPLOADS', DOMAIN . HTML_PATH_UPLOADS);
|
||||
define('DOMAIN_UPLOADS_PAGES', DOMAIN . HTML_PATH_UPLOADS_PAGES);
|
||||
define('DOMAIN_UPLOADS_PROFILES', DOMAIN . HTML_PATH_UPLOADS_PROFILES);
|
||||
define('DOMAIN_UPLOADS_THUMBNAILS', DOMAIN . HTML_PATH_UPLOADS_THUMBNAILS);
|
||||
define('DOMAIN_PLUGINS', DOMAIN . HTML_PATH_PLUGINS);
|
||||
define('DOMAIN_CONTENT', DOMAIN . HTML_PATH_CONTENT);
|
||||
define('DOMAIN_BASE', DOMAIN.HTML_PATH_ROOT);
|
||||
define('DOMAIN_CORE_JS', DOMAIN.HTML_PATH_CORE_JS);
|
||||
define('DOMAIN_CORE_CSS', DOMAIN.HTML_PATH_CORE_CSS);
|
||||
define('DOMAIN_THEME', DOMAIN.HTML_PATH_THEME);
|
||||
define('DOMAIN_THEME_CSS', DOMAIN.HTML_PATH_THEME_CSS);
|
||||
define('DOMAIN_THEME_JS', DOMAIN.HTML_PATH_THEME_JS);
|
||||
define('DOMAIN_THEME_IMG', DOMAIN.HTML_PATH_THEME_IMG);
|
||||
define('DOMAIN_ADMIN_THEME', DOMAIN.HTML_PATH_ADMIN_THEME);
|
||||
define('DOMAIN_ADMIN_THEME_CSS', DOMAIN.HTML_PATH_ADMIN_THEME_CSS);
|
||||
define('DOMAIN_ADMIN_THEME_JS', DOMAIN.HTML_PATH_ADMIN_THEME_JS);
|
||||
define('DOMAIN_UPLOADS', DOMAIN.HTML_PATH_UPLOADS);
|
||||
define('DOMAIN_UPLOADS_PAGES', DOMAIN.HTML_PATH_UPLOADS_PAGES);
|
||||
define('DOMAIN_UPLOADS_PROFILES', DOMAIN.HTML_PATH_UPLOADS_PROFILES);
|
||||
define('DOMAIN_UPLOADS_THUMBNAILS', DOMAIN.HTML_PATH_UPLOADS_THUMBNAILS);
|
||||
define('DOMAIN_PLUGINS', DOMAIN.HTML_PATH_PLUGINS);
|
||||
define('DOMAIN_CONTENT', DOMAIN.HTML_PATH_CONTENT);
|
||||
|
||||
define('DOMAIN_ADMIN', DOMAIN_BASE . ADMIN_URI_FILTER . '/');
|
||||
define('DOMAIN_ADMIN', DOMAIN_BASE.ADMIN_URI_FILTER.'/');
|
||||
|
||||
define('DOMAIN_TAGS', Text::addSlashes(DOMAIN_BASE . TAG_URI_FILTER, false, true));
|
||||
define('DOMAIN_CATEGORIES', Text::addSlashes(DOMAIN_BASE . CATEGORY_URI_FILTER, false, true));
|
||||
define('DOMAIN_PAGES', Text::addSlashes(DOMAIN_BASE . PAGE_URI_FILTER, false, true));
|
||||
define('DOMAIN_TAGS', Text::addSlashes(DOMAIN_BASE.TAG_URI_FILTER, false, true));
|
||||
define('DOMAIN_CATEGORIES', Text::addSlashes(DOMAIN_BASE.CATEGORY_URI_FILTER, false, true));
|
||||
define('DOMAIN_PAGES', Text::addSlashes(DOMAIN_BASE.PAGE_URI_FILTER, false, true));
|
||||
|
||||
$ADMIN_CONTROLLER = '';
|
||||
$ADMIN_VIEW = '';
|
||||
|
|
|
@ -43,8 +43,6 @@ $plugins = array(
|
|||
$pluginsEvents = $plugins;
|
||||
unset($pluginsEvents['all']);
|
||||
|
||||
$pluginsInstalled = array();
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
// ============================================================================
|
||||
|
@ -53,20 +51,20 @@ function buildPlugins()
|
|||
{
|
||||
global $plugins;
|
||||
global $pluginsEvents;
|
||||
global $pluginsInstalled;
|
||||
global $L;
|
||||
global $site;
|
||||
|
||||
// List plugins directories
|
||||
$list = Filesystem::listDirectories(PATH_PLUGINS);
|
||||
|
||||
// Get declared clasess BEFORE load plugins clasess
|
||||
$currentDeclaredClasess = get_declared_classes();
|
||||
|
||||
// List plugins directories
|
||||
$list = Filesystem::listDirectories(PATH_PLUGINS);
|
||||
// Load each plugin clasess
|
||||
foreach ($list as $pluginPath) {
|
||||
// Check if the directory has the plugin.php
|
||||
if (file_exists($pluginPath.DS.'plugin.php')) {
|
||||
include_once($pluginPath.DS.'plugin.php');
|
||||
include($pluginPath.DS.'plugin.php');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,7 +76,7 @@ function buildPlugins()
|
|||
|
||||
// Check if the plugin is translated
|
||||
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.$site->language().'.json';
|
||||
if (!Sanitize::pathFile($languageFilename)) {
|
||||
if( !Sanitize::pathFile($languageFilename) ) {
|
||||
$languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.DEFAULT_LANGUAGE_FILE;
|
||||
}
|
||||
|
||||
|
@ -101,17 +99,6 @@ function buildPlugins()
|
|||
|
||||
// If the plugin is installed insert on the hooks
|
||||
if ($Plugin->installed()) {
|
||||
// Include custom hooks
|
||||
if (!empty($Plugin->customHooks)) {
|
||||
foreach ($Plugin->customHooks as $customHook) {
|
||||
if (!isset($plugins[$customHook])) {
|
||||
$plugins[$customHook] = array();
|
||||
$pluginsEvents[$customHook] = array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$pluginsInstalled[$pluginClass] = $Plugin;
|
||||
foreach ($pluginsEvents as $event=>$value) {
|
||||
if (method_exists($Plugin, $event)) {
|
||||
array_push($plugins[$event], $Plugin);
|
||||
|
@ -119,11 +106,10 @@ function buildPlugins()
|
|||
}
|
||||
}
|
||||
|
||||
// Sort the plugins by the position for the site sidebar
|
||||
uasort($plugins['siteSidebar'], function ($a, $b) {
|
||||
return $a->position()>$b->position();
|
||||
}
|
||||
);
|
||||
return $a->position()>$b->position();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ if ($pages->scheduler()) {
|
|||
));
|
||||
}
|
||||
|
||||
// Set home page if the user defined one
|
||||
// Set home page if the user defined them
|
||||
if ($site->homepage() && $url->whereAmI()==='home') {
|
||||
$pageKey = $site->homepage();
|
||||
if ($pages->exists($pageKey)) {
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
// ============================================================================
|
||||
// Variables
|
||||
// ============================================================================
|
||||
$themePlugin = getPlugin($site->theme()); // Returns plugin object or False
|
||||
|
||||
// ============================================================================
|
||||
// Functions
|
||||
|
@ -16,18 +15,20 @@ function buildThemes()
|
|||
$themes = array();
|
||||
$themesPaths = Filesystem::listDirectories(PATH_THEMES);
|
||||
|
||||
foreach ($themesPaths as $themePath) {
|
||||
foreach($themesPaths as $themePath)
|
||||
{
|
||||
// Check if the theme is translated.
|
||||
$languageFilename = $themePath . DS . 'languages' . DS . $site->language() . '.json';
|
||||
if (!Sanitize::pathFile($languageFilename)) {
|
||||
$languageFilename = $themePath . DS . 'languages' . DS . DEFAULT_LANGUAGE_FILE;
|
||||
$languageFilename = $themePath.DS.'languages'.DS.$site->language().'.json';
|
||||
if( !Sanitize::pathFile($languageFilename) ) {
|
||||
$languageFilename = $themePath.DS.'languages'.DS.DEFAULT_LANGUAGE_FILE;
|
||||
}
|
||||
|
||||
if (Sanitize::pathFile($languageFilename)) {
|
||||
if( Sanitize::pathFile($languageFilename) )
|
||||
{
|
||||
$database = file_get_contents($languageFilename);
|
||||
$database = json_decode($database, true);
|
||||
if (empty($database)) {
|
||||
Log::set('99.themes.php' . LOG_SEP . 'Language file error on theme ' . $themePath);
|
||||
if(empty($database)) {
|
||||
Log::set('99.themes.php'.LOG_SEP.'Language file error on theme '.$themePath);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -36,19 +37,20 @@ function buildThemes()
|
|||
$database['dirname'] = basename($themePath);
|
||||
|
||||
// --- Metadata ---
|
||||
$filenameMetadata = $themePath . DS . 'metadata.json';
|
||||
$filenameMetadata = $themePath.DS.'metadata.json';
|
||||
|
||||
if (Sanitize::pathFile($filenameMetadata)) {
|
||||
if( Sanitize::pathFile($filenameMetadata) )
|
||||
{
|
||||
$metadataString = file_get_contents($filenameMetadata);
|
||||
$metadata = json_decode($metadataString, true);
|
||||
|
||||
$database['compatible'] = false;
|
||||
if (!empty($metadata['compatible'])) {
|
||||
if( !empty($metadata['compatible']) ) {
|
||||
$bluditRoot = explode('.', BLUDIT_VERSION);
|
||||
$compatible = explode(',', $metadata['compatible']);
|
||||
foreach ($compatible as $version) {
|
||||
foreach( $compatible as $version ) {
|
||||
$root = explode('.', $version);
|
||||
if ($root[0] == $bluditRoot[0] && $root[1] == $bluditRoot[1]) {
|
||||
if( $root[0]==$bluditRoot[0] && $root[1]==$bluditRoot[1] ) {
|
||||
$database['compatible'] = true;
|
||||
}
|
||||
}
|
||||
|
@ -68,12 +70,13 @@ function buildThemes()
|
|||
// ============================================================================
|
||||
|
||||
// Load the language file
|
||||
$languageFilename = THEME_DIR . 'languages' . DS . $site->language() . '.json';
|
||||
if (!Sanitize::pathFile($languageFilename)) {
|
||||
$languageFilename = THEME_DIR . 'languages' . DS . DEFAULT_LANGUAGE_FILE;
|
||||
$languageFilename = THEME_DIR.'languages'.DS.$site->language().'.json';
|
||||
if( !Sanitize::pathFile($languageFilename) ) {
|
||||
$languageFilename = THEME_DIR.'languages'.DS.DEFAULT_LANGUAGE_FILE;
|
||||
}
|
||||
|
||||
if (Sanitize::pathFile($languageFilename)) {
|
||||
if( Sanitize::pathFile($languageFilename) )
|
||||
{
|
||||
$database = file_get_contents($languageFilename);
|
||||
$database = json_decode($database, true);
|
||||
|
||||
|
@ -81,7 +84,7 @@ if (Sanitize::pathFile($languageFilename)) {
|
|||
unset($database['theme-data']);
|
||||
|
||||
// Load words from the theme language
|
||||
if (!empty($database)) {
|
||||
if(!empty($database)) {
|
||||
$L->add($database);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
/*
|
||||
Environment variables
|
||||
If you are going to do some changes is recommended do it before the installation
|
||||
If you are going to do some changes in the variable, is recommended do it before the installation
|
||||
*/
|
||||
|
||||
// Log
|
||||
|
@ -92,22 +92,12 @@ define('SESSION_GC_MAXLIFETIME', 3600);
|
|||
// The value 0 means until the browser is closed
|
||||
define('SESSION_COOKIE_LIFE_TIME', 0);
|
||||
|
||||
// Alert notification disappear in X seconds
|
||||
define('ALERT_DISAPPEAR_IN', 3);
|
||||
// Alert notification dissappear in X seconds
|
||||
$GLOBALS['ALERT_DISSAPEAR_IN'] = 3; // Seconds
|
||||
|
||||
// Number of images to show in the media manager per page
|
||||
define('MEDIA_MANAGER_NUMBER_OF_FILES', 5);
|
||||
$GLOBALS['MEDIA_MANAGER_NUMBER_OF_FILES'] = 5;
|
||||
|
||||
// Sort the image by date
|
||||
define('MEDIA_MANAGER_SORT_BY_DATE', true);
|
||||
$GLOBALS['MEDIA_MANAGER_SORT_BY_DATE'] = true;
|
||||
|
||||
// Constant arrays using define are not allowed in PHP 5.6 or earlier
|
||||
|
||||
// Type of pages included in the tag database
|
||||
$GLOBALS['DB_TAGS_TYPES'] = array('published','static','sticky');
|
||||
|
||||
// Allowed image extensions
|
||||
$GLOBALS['ALLOWED_IMG_EXTENSION'] = array('gif', 'png', 'jpg', 'jpeg', 'svg', 'webp');
|
||||
|
||||
// Allowed image mime types
|
||||
$GLOBALS['ALLOWED_IMG_MIMETYPES'] = array('image/gif', 'image/png', 'image/jpeg', 'image/svg+xml', 'image/webp');
|
||||
|
|
|
@ -21,19 +21,13 @@ class Categories extends dbList {
|
|||
$this->db[$key]['list'] = array();
|
||||
}
|
||||
|
||||
// Get pages database
|
||||
$db = $pages->getDB(false);
|
||||
// Get a database with published pages
|
||||
$db = $pages->getPublishedDB(false);
|
||||
foreach ($db as $pageKey=>$pageFields) {
|
||||
if (!empty($pageFields['category'])) {
|
||||
$categoryKey = $pageFields['category'];
|
||||
if (isset($this->db[$categoryKey]['list'])) {
|
||||
if (
|
||||
($db[$pageKey]['type']=='published') ||
|
||||
($db[$pageKey]['type']=='sticky') ||
|
||||
($db[$pageKey]['type']=='static')
|
||||
) {
|
||||
array_push($this->db[$categoryKey]['list'], $pageKey);
|
||||
}
|
||||
array_push($this->db[$categoryKey]['list'], $pageKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,20 +59,4 @@ class Category {
|
|||
{
|
||||
return $this->getValue('list');
|
||||
}
|
||||
|
||||
// Returns an array in json format with all the data of the tag
|
||||
public function json($returnsArray=false)
|
||||
{
|
||||
$tmp['key'] = $this->key();
|
||||
$tmp['name'] = $this->name();
|
||||
$tmp['description'] = $this->description();
|
||||
$tmp['permalink'] = $this->permalink();
|
||||
$tmp['pages'] = $this->pages();
|
||||
|
||||
if ($returnsArray) {
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
return json_encode($tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
1345
bl-kernel/css/bootstrap-icons/bootstrap-icons.css
vendored
10
bl-kernel/css/bootstrap.min.css
vendored
Before Width: | Height: | Size: 424 KiB |
1
bl-kernel/css/select2-bootstrap4.min.css
vendored
1
bl-kernel/css/select2.min.css
vendored
|
@ -20,15 +20,10 @@ class Cookie {
|
|||
$expire = time()+60*60*24*$daysToExpire;
|
||||
setcookie($key, $value, $expire);
|
||||
}
|
||||
|
||||
public static function remove($key)
|
||||
{
|
||||
unset($_COOKIE[$key]);
|
||||
setcookie($key, null, time()-3600);
|
||||
}
|
||||
|
||||
public static function isEmpty($key)
|
||||
{
|
||||
return empty($_COOKIE[$key]);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,23 +1,21 @@
|
|||
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||
|
||||
class Filesystem
|
||||
{
|
||||
class Filesystem {
|
||||
|
||||
// Returns an array with the absolutes directories.
|
||||
public static function listDirectories($path, $regex = '*', $sortByDate = false)
|
||||
public static function listDirectories($path, $regex='*', $sortByDate=false)
|
||||
{
|
||||
$directories = glob($path . $regex, GLOB_ONLYDIR);
|
||||
$directories = glob($path.$regex, GLOB_ONLYDIR);
|
||||
|
||||
if (empty($directories)) {
|
||||
if(empty($directories)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
if ($sortByDate) {
|
||||
usort(
|
||||
$directories,
|
||||
function ($a, $b) {
|
||||
return filemtime($b) - filemtime($a);
|
||||
}
|
||||
if($sortByDate) {
|
||||
usort($directories,
|
||||
function($a, $b) {
|
||||
return filemtime($b) - filemtime($a);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -27,19 +25,17 @@ class Filesystem
|
|||
// Returns an array with the list of files with the absolute path
|
||||
// $sortByDate = TRUE, the first file is the newer file
|
||||
// $chunk = amount of chunks, FALSE if you don't want to chunk
|
||||
public static function listFiles($path, $regex = '*', $extension = '*', $sortByDate = false, $chunk = false)
|
||||
public static function listFiles($path, $regex='*', $extension='*', $sortByDate=false, $chunk=false)
|
||||
{
|
||||
error_log($path . $regex . '.' . $extension);
|
||||
$files = glob($path . $regex . '.' . $extension);
|
||||
$files = glob($path.$regex.'.'.$extension);
|
||||
|
||||
if (empty($files)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
if ($sortByDate) {
|
||||
usort(
|
||||
$files,
|
||||
function ($a, $b) {
|
||||
usort($files,
|
||||
function($a, $b) {
|
||||
return filemtime($b) - filemtime($a);
|
||||
}
|
||||
);
|
||||
|
@ -54,27 +50,23 @@ class Filesystem
|
|||
return $files;
|
||||
}
|
||||
|
||||
public static function mkdir($pathname, $recursive = false)
|
||||
public static function mkdir($pathname, $recursive=false)
|
||||
{
|
||||
Log::set('mkdir ' . $pathname . ' recursive = ' . $recursive, LOG_TYPE_INFO);
|
||||
return mkdir($pathname, DIR_PERMISSIONS, $recursive);
|
||||
}
|
||||
|
||||
public static function rmdir($pathname)
|
||||
{
|
||||
Log::set('rmdir = ' . $pathname, LOG_TYPE_INFO);
|
||||
return rmdir($pathname);
|
||||
}
|
||||
|
||||
public static function mv($oldname, $newname)
|
||||
{
|
||||
Log::set('mv ' . $oldname . ' ' . $newname, LOG_TYPE_INFO);
|
||||
return rename($oldname, $newname);
|
||||
}
|
||||
|
||||
public static function rmfile($filename)
|
||||
{
|
||||
Log::set('rmfile = ' . $filename, LOG_TYPE_INFO);
|
||||
return unlink($filename);
|
||||
}
|
||||
|
||||
|
@ -92,7 +84,7 @@ class Filesystem
|
|||
// If the destination directory not exists is created
|
||||
// $source = /home/diego/example or /home/diego/example/
|
||||
// $destination = /home/diego/newplace or /home/diego/newplace/
|
||||
public static function copyRecursive($source, $destination, $skipDirectory = false)
|
||||
public static function copyRecursive($source, $destination, $skipDirectory=false)
|
||||
{
|
||||
$source = rtrim($source, DS);
|
||||
$destination = rtrim($destination, DS);
|
||||
|
@ -111,16 +103,15 @@ class Filesystem
|
|||
}
|
||||
|
||||
foreach ($iterator = new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
|
||||
RecursiveIteratorIterator::SELF_FIRST
|
||||
) as $item) {
|
||||
new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
|
||||
RecursiveIteratorIterator::SELF_FIRST) as $item) {
|
||||
|
||||
$currentDirectory = dirname($item->getPathName());
|
||||
if ($skipDirectory !== $currentDirectory) {
|
||||
if ($item->isDir()) {
|
||||
@mkdir($destination . DS . $iterator->getSubPathName());
|
||||
@mkdir($destination.DS.$iterator->getSubPathName());
|
||||
} else {
|
||||
copy($item, $destination . DS . $iterator->getSubPathName());
|
||||
copy($item, $destination.DS.$iterator->getSubPathName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -130,23 +121,20 @@ class Filesystem
|
|||
|
||||
// Delete a file or directory recursive
|
||||
// The directory is delete
|
||||
public static function deleteRecursive($source, $deleteDirectory = true)
|
||||
public static function deleteRecursive($source, $deleteDirectory=true)
|
||||
{
|
||||
Log::set('deleteRecursive = ' . $source, LOG_TYPE_INFO);
|
||||
|
||||
if (!self::directoryExists($source)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (new RecursiveIteratorIterator(
|
||||
new RecursiveDirectoryIterator($source, FilesystemIterator::SKIP_DOTS),
|
||||
RecursiveIteratorIterator::CHILD_FIRST
|
||||
) as $item) {
|
||||
if ($item->isFile() || $item->isLink()) {
|
||||
unlink($item);
|
||||
} else {
|
||||
rmdir($item);
|
||||
}
|
||||
RecursiveIteratorIterator::CHILD_FIRST) as $item) {
|
||||
if ($item->isFile()) {
|
||||
unlink($item);
|
||||
} else {
|
||||
rmdir($item);
|
||||
}
|
||||
}
|
||||
|
||||
if ($deleteDirectory) {
|
||||
|
@ -181,9 +169,9 @@ class Filesystem
|
|||
foreach ($files as $file) {
|
||||
$file = realpath($file);
|
||||
if (is_dir($file)) {
|
||||
$zip->addEmptyDir(ltrim(str_replace($source, '', $file), "/\\"));
|
||||
$zip->addEmptyDir(str_replace($source, '', $file));
|
||||
} elseif (is_file($file)) {
|
||||
$zip->addFromString(ltrim(str_replace($source, '', $file), "/\\"), file_get_contents($file));
|
||||
$zip->addFromString(str_replace($source, '', $file), file_get_contents($file));
|
||||
}
|
||||
}
|
||||
} elseif (is_file($source)) {
|
||||
|
@ -215,16 +203,8 @@ class Filesystem
|
|||
return $zip->close();
|
||||
}
|
||||
|
||||
/*
|
||||
| Returns the next filename if the filename already exist otherwise returns the original filename
|
||||
|
|
||||
| @path string Path
|
||||
| @filename string Filename
|
||||
|
|
||||
| @return string
|
||||
*/
|
||||
public static function nextFilename($filename, $path = PATH_UPLOADS)
|
||||
{
|
||||
// Returns the next filename if the filename already exist
|
||||
public static function nextFilename($path=PATH_UPLOADS, $filename) {
|
||||
// Clean filename and get extension
|
||||
$fileExtension = pathinfo($filename, PATHINFO_EXTENSION);
|
||||
$fileExtension = Text::lowercase($fileExtension);
|
||||
|
@ -233,114 +213,15 @@ class Filesystem
|
|||
$filename = Text::removeQuotes($filename);
|
||||
|
||||
// Search for the next filename
|
||||
$tmpName = $filename . '.' . $fileExtension;
|
||||
if (Sanitize::pathFile($path . $tmpName)) {
|
||||
$tmpName = $filename.'.'.$fileExtension;
|
||||
if (Sanitize::pathFile($path.$tmpName)) {
|
||||
$number = 0;
|
||||
$tmpName = $filename . '_' . $number . '.' . $fileExtension;
|
||||
while (Sanitize::pathFile($path . $tmpName)) {
|
||||
$tmpName = $filename.'_'.$number.'.'.$fileExtension;
|
||||
while (Sanitize::pathFile($path.$tmpName)) {
|
||||
$number = $number + 1;
|
||||
$tmpName = $filename . '_' . $number . '.' . $fileExtension;
|
||||
$tmpName = $filename.'_'.$number.'.'.$fileExtension;
|
||||
}
|
||||
}
|
||||
return $tmpName;
|
||||
}
|
||||
|
||||
/*
|
||||
| Returns the filename
|
||||
| Example:
|
||||
| @file /home/diego/dog.jpg
|
||||
| @return dog.jpg
|
||||
|
|
||||
| @file string Full path of the file
|
||||
|
|
||||
| @return string
|
||||
*/
|
||||
public static function filename($file)
|
||||
{
|
||||
return basename($file);
|
||||
}
|
||||
|
||||
/*
|
||||
| Returns the file extension
|
||||
| Example:
|
||||
| @file /home/diego/dog.jpg
|
||||
| @return jpg
|
||||
|
|
||||
| @file string Full path of the file
|
||||
|
|
||||
| @return string
|
||||
*/
|
||||
public static function extension($file)
|
||||
{
|
||||
return pathinfo($file, PATHINFO_EXTENSION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Size of file or directory in bytes
|
||||
* @param [string] $fileOrDirectory
|
||||
* @return [int|bool] [bytes or false on error]
|
||||
*/
|
||||
public static function getSize($fileOrDirectory)
|
||||
{
|
||||
// Files
|
||||
if (is_file($fileOrDirectory)) {
|
||||
return filesize($fileOrDirectory);
|
||||
}
|
||||
// Directories
|
||||
if (file_exists($fileOrDirectory)) {
|
||||
$size = 0;
|
||||
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($fileOrDirectory, FilesystemIterator::SKIP_DOTS)) as $file) {
|
||||
try {
|
||||
$size += $file->getSize();
|
||||
} catch (Exception $e) {
|
||||
// SplFileInfo::getSize RuntimeException will be thrown on broken symlinks/errors
|
||||
}
|
||||
}
|
||||
return $size;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function bytesToHumanFileSize($bytes, $decimals = 2)
|
||||
{
|
||||
$size = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||
$factor = floor((strlen($bytes) - 1) / 3);
|
||||
return sprintf("%.{$decimals}f ", $bytes / pow(1024, $factor)) . @$size[$factor];
|
||||
}
|
||||
|
||||
/*
|
||||
| Returns the mime type of the file
|
||||
| Example:
|
||||
| @file /home/diego/dog.jpg
|
||||
| @return image/jpeg
|
||||
|
|
||||
| @file [string] Full path of the file
|
||||
|
|
||||
| @return [string|bool] Mime type as string or FALSE if not possible to get the mime type
|
||||
*/
|
||||
public static function mimeType($file)
|
||||
{
|
||||
if (function_exists('mime_content_type')) {
|
||||
return mime_content_type($file);
|
||||
}
|
||||
|
||||
if (function_exists('finfo_file')) {
|
||||
$fileinfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
$mimeType = finfo_file($fileinfo, $file);
|
||||
finfo_close($fileinfo);
|
||||
return $mimeType;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function symlink($from, $to)
|
||||
{
|
||||
if (function_exists('symlink')) {
|
||||
Log::set('symlink from = ' . $from . ' to = ' . $to, LOG_TYPE_INFO);
|
||||
return symlink($from, $to);
|
||||
} else {
|
||||
return copy($from, $to);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,245 +2,236 @@
|
|||
|
||||
class Image {
|
||||
|
||||
private $image;
|
||||
private $width;
|
||||
private $height;
|
||||
private $imageResized;
|
||||
private $image;
|
||||
private $width;
|
||||
private $height;
|
||||
private $imageResized;
|
||||
|
||||
public function setImage($fileName, $newWidth, $newHeight, $option="auto")
|
||||
{
|
||||
// *** Open up the file
|
||||
$this->image = $this->openImage($fileName);
|
||||
public function setImage($fileName, $newWidth, $newHeight, $option="auto")
|
||||
{
|
||||
// *** Open up the file
|
||||
$this->image = $this->openImage($fileName);
|
||||
|
||||
// *** Get width and height
|
||||
$this->width = imagesx($this->image);
|
||||
$this->height = imagesy($this->image);
|
||||
// *** Get width and height
|
||||
$this->width = imagesx($this->image);
|
||||
$this->height = imagesy($this->image);
|
||||
|
||||
$this->resizeImage($newWidth, $newHeight, $option);
|
||||
}
|
||||
$this->resizeImage($newWidth, $newHeight, $option);
|
||||
}
|
||||
|
||||
public function saveImage($savePath, $imageQuality="100", $forceJPG=false, $forcePNG=false)
|
||||
{
|
||||
$extension = strtolower(pathinfo($savePath, PATHINFO_EXTENSION));
|
||||
public function saveImage($savePath, $imageQuality="100", $forceJPG=false, $forcePNG=false)
|
||||
{
|
||||
$extension = strtolower(pathinfo($savePath, PATHINFO_EXTENSION));
|
||||
|
||||
// Remove the extension
|
||||
$filename = substr($savePath, 0,strrpos($savePath,'.'));
|
||||
// Remove the extension
|
||||
$filename = substr($savePath, 0,strrpos($savePath,'.'));
|
||||
|
||||
$path_complete = $filename.'.'.$extension;
|
||||
$path_complete = $filename.'.'.$extension;
|
||||
|
||||
if ($forcePNG) {
|
||||
$extension = 'png';
|
||||
} elseif ($forceJPG) {
|
||||
$extension = 'jpg';
|
||||
}
|
||||
if ($forcePNG) {
|
||||
$extension = 'png';
|
||||
} elseif ($forceJPG) {
|
||||
$extension = 'jpg';
|
||||
}
|
||||
|
||||
switch ($extension) {
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
// Checking for JPG support
|
||||
if (imagetypes() & IMG_JPG) {
|
||||
imagejpeg($this->imageResized, $path_complete, $imageQuality);
|
||||
}
|
||||
break;
|
||||
switch ($extension) {
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
// Checking for JPG support
|
||||
if (imagetypes() & IMG_JPG) {
|
||||
imagejpeg($this->imageResized, $path_complete, $imageQuality);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'gif':
|
||||
// Checking for GIF support
|
||||
if (imagetypes() & IMG_GIF) {
|
||||
imagegif($this->imageResized, $path_complete);
|
||||
}
|
||||
break;
|
||||
case 'gif':
|
||||
// Checking for GIF support
|
||||
if (imagetypes() & IMG_GIF) {
|
||||
imagegif($this->imageResized, $path_complete);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'png':
|
||||
// *** Scale quality from 0-100 to 0-9
|
||||
$scaleQuality = round(($imageQuality/100) * 9);
|
||||
case 'png':
|
||||
// *** Scale quality from 0-100 to 0-9
|
||||
$scaleQuality = round(($imageQuality/100) * 9);
|
||||
|
||||
// *** Invert quality setting as 0 is best, not 9
|
||||
$invertScaleQuality = 9 - $scaleQuality;
|
||||
// *** Invert quality setting as 0 is best, not 9
|
||||
$invertScaleQuality = 9 - $scaleQuality;
|
||||
|
||||
// Checking for PNG support
|
||||
if (imagetypes() & IMG_PNG) {
|
||||
imagepng($this->imageResized, $path_complete, $invertScaleQuality);
|
||||
}
|
||||
break;
|
||||
case 'webp':
|
||||
// Checking for JPG support
|
||||
if (imagetypes() & IMG_WEBP) {
|
||||
imagewebp($this->imageResized, $path_complete, $imageQuality);
|
||||
}
|
||||
break;
|
||||
// Checking for PNG support
|
||||
if (imagetypes() & IMG_PNG) {
|
||||
imagepng($this->imageResized, $path_complete, $invertScaleQuality);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Fail extension detection
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// Fail extension detection
|
||||
break;
|
||||
}
|
||||
|
||||
imagedestroy($this->imageResized);
|
||||
}
|
||||
imagedestroy($this->imageResized);
|
||||
}
|
||||
|
||||
private function openImage($file)
|
||||
{
|
||||
// *** Get extension
|
||||
$extension = strtolower(strrchr($file, '.'));
|
||||
private function openImage($file)
|
||||
{
|
||||
// *** Get extension
|
||||
$extension = strtolower(strrchr($file, '.'));
|
||||
|
||||
switch($extension)
|
||||
{
|
||||
case '.jpg':
|
||||
case '.jpeg':
|
||||
$img = imagecreatefromjpeg($file);
|
||||
break;
|
||||
case '.gif':
|
||||
$img = imagecreatefromgif($file);
|
||||
break;
|
||||
case '.png':
|
||||
$img = imagecreatefrompng($file);
|
||||
break;
|
||||
case '.webp':
|
||||
$img = imagecreatefromwebp($file);
|
||||
break;
|
||||
default:
|
||||
$img = false;
|
||||
break;
|
||||
}
|
||||
return $img;
|
||||
}
|
||||
switch($extension)
|
||||
{
|
||||
case '.jpg':
|
||||
case '.jpeg':
|
||||
$img = imagecreatefromjpeg($file);
|
||||
break;
|
||||
case '.gif':
|
||||
$img = imagecreatefromgif($file);
|
||||
break;
|
||||
case '.png':
|
||||
$img = imagecreatefrompng($file);
|
||||
break;
|
||||
default:
|
||||
$img = false;
|
||||
break;
|
||||
}
|
||||
return $img;
|
||||
}
|
||||
|
||||
private function resizeImage($newWidth, $newHeight, $option)
|
||||
{
|
||||
// *** Get optimal width and height - based on $option
|
||||
$optionArray = $this->getDimensions($newWidth, $newHeight, $option);
|
||||
private function resizeImage($newWidth, $newHeight, $option)
|
||||
{
|
||||
// *** Get optimal width and height - based on $option
|
||||
$optionArray = $this->getDimensions($newWidth, $newHeight, $option);
|
||||
|
||||
$optimalWidth = $optionArray['optimalWidth'];
|
||||
$optimalHeight = $optionArray['optimalHeight'];
|
||||
$optimalWidth = $optionArray['optimalWidth'];
|
||||
$optimalHeight = $optionArray['optimalHeight'];
|
||||
|
||||
|
||||
// *** Resample - create image canvas of x, y size
|
||||
$this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight);
|
||||
imagealphablending($this->imageResized, false);
|
||||
imagesavealpha($this->imageResized, true);
|
||||
imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height);
|
||||
// *** Resample - create image canvas of x, y size
|
||||
$this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight);
|
||||
imagealphablending($this->imageResized, false);
|
||||
imagesavealpha($this->imageResized, true);
|
||||
imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height);
|
||||
|
||||
|
||||
// *** if option is 'crop', then crop too
|
||||
if ($option == 'crop') {
|
||||
$this->crop($optimalWidth, $optimalHeight, $newWidth, $newHeight);
|
||||
}
|
||||
}
|
||||
// *** if option is 'crop', then crop too
|
||||
if ($option == 'crop') {
|
||||
$this->crop($optimalWidth, $optimalHeight, $newWidth, $newHeight);
|
||||
}
|
||||
}
|
||||
|
||||
private function getDimensions($newWidth, $newHeight, $option)
|
||||
{
|
||||
private function getDimensions($newWidth, $newHeight, $option)
|
||||
{
|
||||
|
||||
if( ($this->width < $newWidth) and ($this->height < $newHeight) )
|
||||
{
|
||||
return array('optimalWidth' => $this->width, 'optimalHeight' => $this->height);
|
||||
}
|
||||
if( ($this->width < $newWidth) and ($this->height < $newHeight) )
|
||||
{
|
||||
return array('optimalWidth' => $this->width, 'optimalHeight' => $this->height);
|
||||
}
|
||||
|
||||
switch ($option)
|
||||
{
|
||||
case 'exact':
|
||||
$optimalWidth = $newWidth;
|
||||
$optimalHeight= $newHeight;
|
||||
break;
|
||||
case 'portrait':
|
||||
$optimalWidth = $this->getSizeByFixedHeight($newHeight);
|
||||
$optimalHeight= $newHeight;
|
||||
break;
|
||||
case 'landscape':
|
||||
$optimalWidth = $newWidth;
|
||||
$optimalHeight= $this->getSizeByFixedWidth($newWidth);
|
||||
break;
|
||||
case 'auto':
|
||||
$optionArray = $this->getSizeByAuto($newWidth, $newHeight);
|
||||
$optimalWidth = $optionArray['optimalWidth'];
|
||||
$optimalHeight = $optionArray['optimalHeight'];
|
||||
break;
|
||||
case 'crop':
|
||||
$optionArray = $this->getOptimalCrop($newWidth, $newHeight);
|
||||
$optimalWidth = $optionArray['optimalWidth'];
|
||||
$optimalHeight = $optionArray['optimalHeight'];
|
||||
break;
|
||||
}
|
||||
switch ($option)
|
||||
{
|
||||
case 'exact':
|
||||
$optimalWidth = $newWidth;
|
||||
$optimalHeight= $newHeight;
|
||||
break;
|
||||
case 'portrait':
|
||||
$optimalWidth = $this->getSizeByFixedHeight($newHeight);
|
||||
$optimalHeight= $newHeight;
|
||||
break;
|
||||
case 'landscape':
|
||||
$optimalWidth = $newWidth;
|
||||
$optimalHeight= $this->getSizeByFixedWidth($newWidth);
|
||||
break;
|
||||
case 'auto':
|
||||
$optionArray = $this->getSizeByAuto($newWidth, $newHeight);
|
||||
$optimalWidth = $optionArray['optimalWidth'];
|
||||
$optimalHeight = $optionArray['optimalHeight'];
|
||||
break;
|
||||
case 'crop':
|
||||
$optionArray = $this->getOptimalCrop($newWidth, $newHeight);
|
||||
$optimalWidth = $optionArray['optimalWidth'];
|
||||
$optimalHeight = $optionArray['optimalHeight'];
|
||||
break;
|
||||
}
|
||||
|
||||
return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
|
||||
}
|
||||
return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
|
||||
}
|
||||
|
||||
private function getSizeByFixedHeight($newHeight)
|
||||
{
|
||||
$ratio = $this->width / $this->height;
|
||||
$newWidth = $newHeight * $ratio;
|
||||
return $newWidth;
|
||||
}
|
||||
private function getSizeByFixedHeight($newHeight)
|
||||
{
|
||||
$ratio = $this->width / $this->height;
|
||||
$newWidth = $newHeight * $ratio;
|
||||
return $newWidth;
|
||||
}
|
||||
|
||||
private function getSizeByFixedWidth($newWidth)
|
||||
{
|
||||
$ratio = $this->height / $this->width;
|
||||
$newHeight = $newWidth * $ratio;
|
||||
return $newHeight;
|
||||
}
|
||||
private function getSizeByFixedWidth($newWidth)
|
||||
{
|
||||
$ratio = $this->height / $this->width;
|
||||
$newHeight = $newWidth * $ratio;
|
||||
return $newHeight;
|
||||
}
|
||||
|
||||
private function getSizeByAuto($newWidth, $newHeight)
|
||||
{
|
||||
if ($this->height < $this->width)
|
||||
// *** Image to be resized is wider (landscape)
|
||||
{
|
||||
$optimalWidth = $newWidth;
|
||||
$optimalHeight= $this->getSizeByFixedWidth($newWidth);
|
||||
}
|
||||
elseif ($this->height > $this->width)
|
||||
// *** Image to be resized is taller (portrait)
|
||||
{
|
||||
$optimalWidth = $this->getSizeByFixedHeight($newHeight);
|
||||
$optimalHeight= $newHeight;
|
||||
}
|
||||
else
|
||||
// *** Image to be resizerd is a square
|
||||
{
|
||||
if ($newHeight < $newWidth) {
|
||||
$optimalWidth = $newWidth;
|
||||
$optimalHeight= $this->getSizeByFixedWidth($newWidth);
|
||||
} else if ($newHeight > $newWidth) {
|
||||
$optimalWidth = $this->getSizeByFixedHeight($newHeight);
|
||||
$optimalHeight= $newHeight;
|
||||
} else {
|
||||
// *** Sqaure being resized to a square
|
||||
$optimalWidth = $newWidth;
|
||||
$optimalHeight= $newHeight;
|
||||
}
|
||||
}
|
||||
private function getSizeByAuto($newWidth, $newHeight)
|
||||
{
|
||||
if ($this->height < $this->width)
|
||||
// *** Image to be resized is wider (landscape)
|
||||
{
|
||||
$optimalWidth = $newWidth;
|
||||
$optimalHeight= $this->getSizeByFixedWidth($newWidth);
|
||||
}
|
||||
elseif ($this->height > $this->width)
|
||||
// *** Image to be resized is taller (portrait)
|
||||
{
|
||||
$optimalWidth = $this->getSizeByFixedHeight($newHeight);
|
||||
$optimalHeight= $newHeight;
|
||||
}
|
||||
else
|
||||
// *** Image to be resizerd is a square
|
||||
{
|
||||
if ($newHeight < $newWidth) {
|
||||
$optimalWidth = $newWidth;
|
||||
$optimalHeight= $this->getSizeByFixedWidth($newWidth);
|
||||
} else if ($newHeight > $newWidth) {
|
||||
$optimalWidth = $this->getSizeByFixedHeight($newHeight);
|
||||
$optimalHeight= $newHeight;
|
||||
} else {
|
||||
// *** Sqaure being resized to a square
|
||||
$optimalWidth = $newWidth;
|
||||
$optimalHeight= $newHeight;
|
||||
}
|
||||
}
|
||||
|
||||
return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
|
||||
}
|
||||
return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
|
||||
}
|
||||
|
||||
private function getOptimalCrop($newWidth, $newHeight)
|
||||
{
|
||||
private function getOptimalCrop($newWidth, $newHeight)
|
||||
{
|
||||
|
||||
$heightRatio = $this->height / $newHeight;
|
||||
$widthRatio = $this->width / $newWidth;
|
||||
$heightRatio = $this->height / $newHeight;
|
||||
$widthRatio = $this->width / $newWidth;
|
||||
|
||||
if ($heightRatio < $widthRatio) {
|
||||
$optimalRatio = $heightRatio;
|
||||
} else {
|
||||
$optimalRatio = $widthRatio;
|
||||
}
|
||||
if ($heightRatio < $widthRatio) {
|
||||
$optimalRatio = $heightRatio;
|
||||
} else {
|
||||
$optimalRatio = $widthRatio;
|
||||
}
|
||||
|
||||
$optimalHeight = $this->height / $optimalRatio;
|
||||
$optimalWidth = $this->width / $optimalRatio;
|
||||
$optimalHeight = $this->height / $optimalRatio;
|
||||
$optimalWidth = $this->width / $optimalRatio;
|
||||
|
||||
return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
|
||||
}
|
||||
return array('optimalWidth' => $optimalWidth, 'optimalHeight' => $optimalHeight);
|
||||
}
|
||||
|
||||
private function crop($optimalWidth, $optimalHeight, $newWidth, $newHeight)
|
||||
{
|
||||
// *** Find center - this will be used for the crop
|
||||
$cropStartX = ( $optimalWidth / 2) - ( $newWidth /2 );
|
||||
$cropStartY = ( $optimalHeight/ 2) - ( $newHeight/2 );
|
||||
private function crop($optimalWidth, $optimalHeight, $newWidth, $newHeight)
|
||||
{
|
||||
// *** Find center - this will be used for the crop
|
||||
$cropStartX = ( $optimalWidth / 2) - ( $newWidth /2 );
|
||||
$cropStartY = ( $optimalHeight/ 2) - ( $newHeight/2 );
|
||||
|
||||
$crop = $this->imageResized;
|
||||
//imagedestroy($this->imageResized);
|
||||
$crop = $this->imageResized;
|
||||
//imagedestroy($this->imageResized);
|
||||
|
||||
// *** Now crop from center to exact requested size
|
||||
$this->imageResized = imagecreatetruecolor($newWidth , $newHeight);
|
||||
imagealphablending($this->imageResized, false);
|
||||
imagesavealpha($this->imageResized, true);
|
||||
imagecopyresampled($this->imageResized, $crop , 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight , $newWidth, $newHeight);
|
||||
}
|
||||
// *** Now crop from center to exact requested size
|
||||
$this->imageResized = imagecreatetruecolor($newWidth , $newHeight);
|
||||
imagealphablending($this->imageResized, false);
|
||||
imagesavealpha($this->imageResized, true);
|
||||
imagecopyresampled($this->imageResized, $crop , 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight , $newWidth, $newHeight);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
class Sanitize {
|
||||
|
||||
public static function removeTags($text) {
|
||||
return strip_tags($text);
|
||||
}
|
||||
// new
|
||||
|
||||
// Convert special characters to HTML entities
|
||||
public static function html($text)
|
||||
|
@ -32,28 +30,30 @@ class Sanitize {
|
|||
|
||||
public static function pathFile($path, $file=false)
|
||||
{
|
||||
if ($file!==false){
|
||||
if($file!==false){
|
||||
$fullPath = $path.$file;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$fullPath = $path;
|
||||
}
|
||||
|
||||
// Fix for Windows on paths. eg: $path = c:\diego/page/subpage convert to c:\diego\page\subpages
|
||||
$fullPath = str_replace('/', DS, $fullPath);
|
||||
|
||||
if (CHECK_SYMBOLIC_LINKS) {
|
||||
if(CHECK_SYMBOLIC_LINKS) {
|
||||
$real = realpath($fullPath);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$real = file_exists($fullPath)?$fullPath:false;
|
||||
}
|
||||
|
||||
// If $real is FALSE the file does not exist.
|
||||
if ($real===false) {
|
||||
if($real===false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the $real path does not start with the systemPath then this is Path Traversal.
|
||||
if (strpos($fullPath, $real)!==0) {
|
||||
if(strpos($fullPath, $real)!==0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,29 +5,27 @@ class Session {
|
|||
private static $started = false;
|
||||
private static $sessionName = 'BLUDIT-KEY';
|
||||
|
||||
public static function start($path, $secure)
|
||||
public static function start()
|
||||
{
|
||||
// Try to set the session timeout on server side, 1 hour of timeout
|
||||
ini_set('session.gc_maxlifetime', SESSION_GC_MAXLIFETIME);
|
||||
|
||||
// If TRUE cookie will only be sent over secure connections.
|
||||
$secure = false;
|
||||
|
||||
// If set to TRUE then PHP will attempt to send the httponly flag when setting the session cookie.
|
||||
$httponly = true;
|
||||
|
||||
// Gets current cookies params.
|
||||
$cookieParams = session_get_cookie_params();
|
||||
|
||||
if (empty($path)) {
|
||||
$httponly = true;
|
||||
$path = '/';
|
||||
}
|
||||
|
||||
session_set_cookie_params([
|
||||
'lifetime' => $cookieParams["lifetime"],
|
||||
'path' => $path,
|
||||
'domain' => $cookieParams["domain"],
|
||||
'secure' => $secure,
|
||||
'httponly' => true
|
||||
]);
|
||||
session_set_cookie_params(
|
||||
SESSION_COOKIE_LIFE_TIME,
|
||||
$cookieParams["path"],
|
||||
$cookieParams["domain"],
|
||||
$secure,
|
||||
$httponly
|
||||
);
|
||||
|
||||
// Sets the session name to the one set above.
|
||||
session_name(self::$sessionName);
|
||||
|
@ -75,11 +73,4 @@ class Session {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function remove($key)
|
||||
{
|
||||
$key = 's_'.$key;
|
||||
|
||||
unset($_SESSION[$key]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ class Text {
|
|||
$characteres = "1234567890abcdefghijklmnopqrstuvwxyz!@#%^&*";
|
||||
$text = '';
|
||||
for($i=0; $i<$length; $i++) {
|
||||
$text .= $characteres[rand(0,41)];
|
||||
$text .= $characteres{rand(0,41)};
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ class Text {
|
|||
}
|
||||
}
|
||||
|
||||
$string = preg_replace("/[^a-zA-Z0-9\/_|+. -]/", '', $string);
|
||||
$string = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $string);
|
||||
$string = self::lowercase($string);
|
||||
$string = preg_replace("/[\/_|+ -]+/", $separator, $string);
|
||||
$string = trim($string, '-');
|
||||
|
@ -297,10 +297,4 @@ class Text {
|
|||
return $truncate;
|
||||
}
|
||||
|
||||
public static function toBytes($value) {
|
||||
$value = trim($value);
|
||||
$s = [ 'g'=> 1<<30, 'm' => 1<<20, 'k' => 1<<10 ];
|
||||
return intval($value) * ($s[strtolower(substr($value,-1))] ?: 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,27 +1,20 @@
|
|||
<?php
|
||||
|
||||
class Theme
|
||||
{
|
||||
class Theme {
|
||||
|
||||
public static function socialNetworks()
|
||||
{
|
||||
global $site;
|
||||
$socialNetworks = array(
|
||||
'github' => 'Github',
|
||||
'gitlab' => 'GitLab',
|
||||
'twitter' => 'Twitter',
|
||||
'facebook' => 'Facebook',
|
||||
'instagram' => 'Instagram',
|
||||
'codepen' => 'Codepen',
|
||||
'linkedin' => 'Linkedin',
|
||||
'xing' => 'Xing',
|
||||
'telegram' => 'Telegram',
|
||||
'mastodon' => 'Mastodon',
|
||||
'vk' => 'VK',
|
||||
'dribbble' => 'Dribbble'
|
||||
'github'=>'Github',
|
||||
'twitter'=>'Twitter',
|
||||
'facebook'=>'Facebook',
|
||||
'instagram'=>'Instagram',
|
||||
'codepen'=>'Codepen',
|
||||
'linkedin'=>'Linkedin'
|
||||
);
|
||||
|
||||
foreach ($socialNetworks as $key => $label) {
|
||||
foreach ($socialNetworks as $key=>$label) {
|
||||
if (!$site->{$key}()) {
|
||||
unset($socialNetworks[$key]);
|
||||
}
|
||||
|
@ -62,7 +55,7 @@ class Theme
|
|||
public static function rssUrl()
|
||||
{
|
||||
if (pluginActivated('pluginRSS')) {
|
||||
return DOMAIN_BASE . 'rss.xml';
|
||||
return DOMAIN_BASE.'rss.xml';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -70,7 +63,7 @@ class Theme
|
|||
public static function sitemapUrl()
|
||||
{
|
||||
if (pluginActivated('pluginSitemap')) {
|
||||
return DOMAIN_BASE . 'sitemap.xml';
|
||||
return DOMAIN_BASE.'sitemap.xml';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -93,9 +86,9 @@ class Theme
|
|||
|
||||
public static function metaTags($tag)
|
||||
{
|
||||
if ($tag == 'title') {
|
||||
if ($tag=='title') {
|
||||
return self::metaTagTitle();
|
||||
} elseif ($tag == 'description') {
|
||||
} elseif ($tag=='description') {
|
||||
return self::metaTagDescription();
|
||||
}
|
||||
}
|
||||
|
@ -109,11 +102,11 @@ class Theme
|
|||
global $WHERE_AM_I;
|
||||
global $page;
|
||||
|
||||
if ($WHERE_AM_I == 'page') {
|
||||
if ($WHERE_AM_I=='page') {
|
||||
$format = $site->titleFormatPages();
|
||||
$format = Text::replace('{{page-title}}', $page->title(), $format);
|
||||
$format = Text::replace('{{page-description}}', $page->description(), $format);
|
||||
} elseif ($WHERE_AM_I == 'tag') {
|
||||
} elseif ($WHERE_AM_I=='tag') {
|
||||
try {
|
||||
$tagKey = $url->slug();
|
||||
$tag = new Tag($tagKey);
|
||||
|
@ -122,7 +115,8 @@ class Theme
|
|||
} catch (Exception $e) {
|
||||
// Tag doesn't exist
|
||||
}
|
||||
} elseif ($WHERE_AM_I == 'category') {
|
||||
|
||||
} elseif ($WHERE_AM_I=='category') {
|
||||
try {
|
||||
$categoryKey = $url->slug();
|
||||
$category = new Category($categoryKey);
|
||||
|
@ -139,7 +133,7 @@ class Theme
|
|||
$format = Text::replace('{{site-slogan}}', $site->slogan(), $format);
|
||||
$format = Text::replace('{{site-description}}', $site->description(), $format);
|
||||
|
||||
return '<title>' . $format . '</title>' . PHP_EOL;
|
||||
return '<title>'.$format.'</title>'.PHP_EOL;
|
||||
}
|
||||
|
||||
public static function metaTagDescription()
|
||||
|
@ -151,9 +145,9 @@ class Theme
|
|||
|
||||
$description = $site->description();
|
||||
|
||||
if ($WHERE_AM_I == 'page') {
|
||||
if ($WHERE_AM_I=='page') {
|
||||
$description = $page->description();
|
||||
} elseif ($WHERE_AM_I == 'category') {
|
||||
} elseif ($WHERE_AM_I=='category') {
|
||||
try {
|
||||
$categoryKey = $url->slug();
|
||||
$category = new Category($categoryKey);
|
||||
|
@ -163,7 +157,7 @@ class Theme
|
|||
}
|
||||
}
|
||||
|
||||
return '<meta name="description" content="' . $description . '">' . PHP_EOL;
|
||||
return '<meta name="description" content="'.$description.'">'.PHP_EOL;
|
||||
}
|
||||
|
||||
// DEPRECATED v3.0.0
|
||||
|
@ -182,63 +176,63 @@ class Theme
|
|||
|
||||
public static function charset($charset)
|
||||
{
|
||||
return '<meta charset="' . $charset . '">' . PHP_EOL;
|
||||
return '<meta charset="'.$charset.'">'.PHP_EOL;
|
||||
}
|
||||
|
||||
public static function viewport($content)
|
||||
{
|
||||
return '<meta name="viewport" content="' . $content . '">' . PHP_EOL;
|
||||
return '<meta name="viewport" content="'.$content.'">'.PHP_EOL;
|
||||
}
|
||||
|
||||
public static function src($file, $base = DOMAIN_THEME)
|
||||
public static function src($file, $base=DOMAIN_THEME)
|
||||
{
|
||||
return $base . $file;
|
||||
return $base.$file;
|
||||
}
|
||||
|
||||
public static function css($files, $base = DOMAIN_THEME)
|
||||
public static function css($files, $base=DOMAIN_THEME)
|
||||
{
|
||||
if (!is_array($files)) {
|
||||
if( !is_array($files) ) {
|
||||
$files = array($files);
|
||||
}
|
||||
|
||||
$links = '';
|
||||
foreach ($files as $file) {
|
||||
$links .= '<link rel="stylesheet" type="text/css" href="' . $base . $file . '?version=' . BLUDIT_VERSION . '">' . PHP_EOL;
|
||||
foreach($files as $file) {
|
||||
$links .= '<link rel="stylesheet" type="text/css" href="'.$base.$file.'?version='.BLUDIT_VERSION.'">'.PHP_EOL;
|
||||
}
|
||||
|
||||
return $links;
|
||||
}
|
||||
|
||||
public static function javascript($files, $base = DOMAIN_THEME, $attributes = '')
|
||||
public static function javascript($files, $base=DOMAIN_THEME)
|
||||
{
|
||||
if (!is_array($files)) {
|
||||
if( !is_array($files) ) {
|
||||
$files = array($files);
|
||||
}
|
||||
|
||||
$scripts = '';
|
||||
foreach ($files as $file) {
|
||||
$scripts .= '<script ' . $attributes . ' src="' . $base . $file . '?version=' . BLUDIT_VERSION . '"></script>' . PHP_EOL;
|
||||
foreach($files as $file) {
|
||||
$scripts .= '<script src="'.$base.$file.'?version='.BLUDIT_VERSION.'"></script>'.PHP_EOL;
|
||||
}
|
||||
|
||||
return $scripts;
|
||||
}
|
||||
|
||||
public static function js($files, $base = DOMAIN_THEME, $attributes = '')
|
||||
public static function js($files, $base=DOMAIN_THEME)
|
||||
{
|
||||
return self::javascript($files, $base, $attributes);
|
||||
return self::javascript($files, $base);
|
||||
}
|
||||
|
||||
public static function plugins($type, $args = array())
|
||||
public static function plugins($type)
|
||||
{
|
||||
global $plugins;
|
||||
foreach ($plugins[$type] as $plugin) {
|
||||
echo call_user_func_array(array($plugin, $type), $args);
|
||||
echo call_user_func(array($plugin, $type));
|
||||
}
|
||||
}
|
||||
|
||||
public static function favicon($file = 'favicon.png', $typeIcon = 'image/png')
|
||||
public static function favicon($file='favicon.png', $typeIcon='image/png')
|
||||
{
|
||||
return '<link rel="icon" href="' . DOMAIN_THEME . $file . '" type="' . $typeIcon . '">' . PHP_EOL;
|
||||
return '<link rel="shortcut icon" href="'.DOMAIN_THEME.$file.'" type="'.$typeIcon.'">'.PHP_EOL;
|
||||
}
|
||||
|
||||
public static function keywords($keywords)
|
||||
|
@ -246,38 +240,29 @@ class Theme
|
|||
if (is_array($keywords)) {
|
||||
$keywords = implode(',', $keywords);
|
||||
}
|
||||
return '<meta name="keywords" content="' . $keywords . '">' . PHP_EOL;
|
||||
return '<meta name="keywords" content="'.$keywords.'">'.PHP_EOL;
|
||||
}
|
||||
|
||||
public static function jquery()
|
||||
{
|
||||
return '<script src="' . DOMAIN_CORE_JS . 'jquery.min.js?version=' . BLUDIT_VERSION . '"></script>' . PHP_EOL;
|
||||
return '<script src="'.DOMAIN_CORE_JS.'jquery.min.js?version='.BLUDIT_VERSION.'"></script>'.PHP_EOL;
|
||||
}
|
||||
|
||||
public static function jsBootstrap($attributes = '')
|
||||
public static function jsBootstrap()
|
||||
{
|
||||
return '<script ' . $attributes . ' src="' . DOMAIN_CORE_JS . 'bootstrap.bundle.min.js?version=' . BLUDIT_VERSION . '"></script>' . PHP_EOL;
|
||||
return '<script src="'.DOMAIN_CORE_JS.'bootstrap.bundle.min.js?version='.BLUDIT_VERSION.'"></script>'.PHP_EOL;
|
||||
}
|
||||
|
||||
public static function cssBootstrap()
|
||||
{
|
||||
return '<link rel="stylesheet" type="text/css" href="' . DOMAIN_CORE_CSS . 'bootstrap.min.css?version=' . BLUDIT_VERSION . '">' . PHP_EOL;
|
||||
return '<link rel="stylesheet" type="text/css" href="'.DOMAIN_CORE_CSS.'bootstrap.min.css?version='.BLUDIT_VERSION.'">'.PHP_EOL;
|
||||
}
|
||||
|
||||
public static function cssBootstrapIcons()
|
||||
{
|
||||
// https://icons.getbootstrap.com/
|
||||
return '<link rel="stylesheet" type="text/css" href="' . DOMAIN_CORE_CSS . 'bootstrap-icons/bootstrap-icons.css?version=' . BLUDIT_VERSION . '">' . PHP_EOL;
|
||||
}
|
||||
|
||||
public static function cssLineAwesome()
|
||||
{
|
||||
return '<link rel="stylesheet" type="text/css" href="' . DOMAIN_CORE_CSS . 'line-awesome/css/line-awesome-font-awesome.min.css?version=' . BLUDIT_VERSION . '">' . PHP_EOL;
|
||||
}
|
||||
|
||||
public static function jsSortable($attributes = '')
|
||||
public static function jsSortable()
|
||||
{
|
||||
// https://github.com/psfpro/bootstrap-html5sortable
|
||||
return '<script ' . $attributes . ' src="' . DOMAIN_CORE_JS . 'jquery.sortable.min.js?version=' . BLUDIT_VERSION . '"></script>' . PHP_EOL;
|
||||
return '<script src="'.DOMAIN_CORE_JS.'jquery.sortable.min.js?version='.BLUDIT_VERSION.'"></script>'.PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|