mirror of
https://github.com/flextype/flextype.git
synced 2025-08-11 07:34:22 +02:00
Merge branch 'dev'
This commit is contained in:
18
.editorconfig
Normal file
18
.editorconfig
Normal file
@@ -0,0 +1,18 @@
|
||||
# EditorConfig: http://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# 2 space indentation
|
||||
[*.yaml, *.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
23
CHANGELOG.md
23
CHANGELOG.md
@@ -1,3 +1,26 @@
|
||||
## [0.8.1] - 2019-01-07
|
||||
### Added
|
||||
- Flextype Core: Glide/Intervention Image Implemented for Image manipulation!
|
||||
- Flextype Core: Cache - ability to delete glide cache folder added.
|
||||
|
||||
### Changed
|
||||
- Flextype Core: Thunderer Shortcode updated to 0.7.0 - over 10x performance and memory usage improvement!
|
||||
- Flextype Core: Default settings updates.
|
||||
- Flextype Core: Arr Components updated to 1.2.4.
|
||||
- Flextype Core: Default theme - Twitter Bootstrap update to 4.2.1
|
||||
- Admin Panel: Media Manager - uploader improvements
|
||||
- Admin Panel: Menus Manager - menus name are clickable now.
|
||||
- Admin Panel: Fieldsets Manager - fieldsets name are clickable now.
|
||||
- Admin Panel: Templates Manager - templates and partials name are clickable now.
|
||||
- Admin Panel: Snippets Manager - snippets name are clickable now.
|
||||
- Admin Panel: Settings Manager - look and feel improvements.
|
||||
- Admin Panel: Twitter Bootstrap update to 4.2.1
|
||||
|
||||
### Fixed
|
||||
- Admin Panel: Snippets Manager - shortcode issue - fixed.
|
||||
- Admin Panel: gulpfile - issue with duplicated codemirror - fixed.
|
||||
- Admin Panel: Trumbowyg styles fixes.
|
||||
- Admin Panel: Plugins Manager - issue with broken homepage url in the Info Modal - fixed.
|
||||
|
||||
## [0.8.0] - 2018-12-28
|
||||
### Added
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Flextype
|
||||
[](https://discordapp.com/invite/CCKPKVG)
|
||||

|
||||

|
||||

|
||||
|
||||

|
||||
|
@@ -19,8 +19,8 @@
|
||||
"php": ">=7.1.3",
|
||||
"doctrine/cache": "1.8.0",
|
||||
"symfony/yaml": "4.2.1",
|
||||
"thunderer/shortcode": "0.6.5",
|
||||
"flextype-components/arr" : "1.2.3",
|
||||
"thunderer/shortcode": "0.7.0",
|
||||
"flextype-components/arr" : "1.2.4",
|
||||
"flextype-components/assets" : "1.0.1",
|
||||
"flextype-components/cookie" : "1.2.0",
|
||||
"flextype-components/date" : "1.0.0",
|
||||
@@ -38,7 +38,8 @@
|
||||
"flextype-components/session" : "1.1.1",
|
||||
"flextype-components/token" : "1.2.0",
|
||||
"flextype-components/view" : "1.1.1",
|
||||
"flextype-components/text" : "1.1.0"
|
||||
"flextype-components/text" : "1.1.0",
|
||||
"league/glide": "^1.4"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
@@ -273,8 +273,9 @@ class Cache
|
||||
// Clear opcache
|
||||
function_exists('opcache_reset') and @opcache_reset();
|
||||
|
||||
// Remove cache dir
|
||||
// Remove cache dirs
|
||||
Filesystem::deleteDir(PATH['cache'] . '/doctrine/');
|
||||
Filesystem::deleteDir(PATH['cache'] . '/glide/');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -25,7 +25,7 @@ class Flextype
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '0.8.0';
|
||||
const VERSION = '0.8.1';
|
||||
|
||||
/**
|
||||
* An instance of the Flextype class
|
||||
@@ -93,6 +93,9 @@ class Flextype
|
||||
// Get Cache Instance
|
||||
Cache::getInstance();
|
||||
|
||||
// Get Images Instance
|
||||
Images::getInstance();
|
||||
|
||||
// Get Themes Instance
|
||||
Themes::getInstance();
|
||||
|
||||
|
273
flextype/Images.php
Normal file
273
flextype/Images.php
Normal file
@@ -0,0 +1,273 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Flextype
|
||||
*
|
||||
* @author Sergey Romanenko <awilum@yandex.ru>
|
||||
* @link http://flextype.org
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flextype;
|
||||
|
||||
use Flextype\Component\Http\Http;
|
||||
use Flextype\Component\Event\Event;
|
||||
use Flextype\Component\Html\Html;
|
||||
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
|
||||
|
||||
// Event: onShortcodesInitialized
|
||||
Event::addListener('onShortcodesInitialized', function () {
|
||||
|
||||
// Shortcode: [image path="home/image.jpg"]
|
||||
// Result: Display image
|
||||
Entries::shortcode()->addHandler('image', function(ShortcodeInterface $s) {
|
||||
$params = [];
|
||||
$attributes = [];
|
||||
|
||||
// API
|
||||
// http://glide.thephpleague.com/1.0/api/quick-reference/
|
||||
($s->getParameter('or')) and $params['or'] = $s->getParameter('or');
|
||||
($s->getParameter('flip')) and $params['flip'] = $s->getParameter('flip');
|
||||
($s->getParameter('crop')) and $params['crop'] = $s->getParameter('crop');
|
||||
($s->getParameter('w')) and $params['w'] = $s->getParameter('w');
|
||||
($s->getParameter('h')) and $params['h'] = $s->getParameter('h');
|
||||
($s->getParameter('fit')) and $params['fit'] = $s->getParameter('fit');
|
||||
($s->getParameter('dpr')) and $params['dpr'] = $s->getParameter('dpr');
|
||||
($s->getParameter('bri')) and $params['bri'] = $s->getParameter('bri');
|
||||
($s->getParameter('con')) and $params['con'] = $s->getParameter('con');
|
||||
($s->getParameter('gam')) and $params['gam'] = $s->getParameter('gam');
|
||||
($s->getParameter('sharp')) and $params['sharp'] = $s->getParameter('sharp');
|
||||
($s->getParameter('blur')) and $params['blur'] = $s->getParameter('blur');
|
||||
($s->getParameter('pixel')) and $params['pixel'] = $s->getParameter('pixel');
|
||||
($s->getParameter('filt')) and $params['filt'] = $s->getParameter('filt');
|
||||
($s->getParameter('mark')) and $params['mark'] = $s->getParameter('mark');
|
||||
($s->getParameter('markw')) and $params['markw'] = $s->getParameter('markw');
|
||||
($s->getParameter('markh')) and $params['markh'] = $s->getParameter('markh');
|
||||
($s->getParameter('markx')) and $params['markx'] = $s->getParameter('markx');
|
||||
($s->getParameter('marky')) and $params['marky'] = $s->getParameter('marky');
|
||||
($s->getParameter('markpad')) and $params['markpad'] = $s->getParameter('markpad');
|
||||
($s->getParameter('markpos')) and $params['markpos'] = $s->getParameter('markpos');
|
||||
($s->getParameter('markalpha')) and $params['markalpha'] = $s->getParameter('markalpha');
|
||||
($s->getParameter('bg')) and $params['bg'] = $s->getParameter('bg');
|
||||
($s->getParameter('border')) and $params['border'] = $s->getParameter('border');
|
||||
($s->getParameter('q')) and $params['q'] = $s->getParameter('q');
|
||||
($s->getParameter('fm')) and $params['fm'] = $s->getParameter('fm');
|
||||
|
||||
($s->getParameter('width')) and $attributes['width'] = $s->getParameter('width');
|
||||
($s->getParameter('height')) and $attributes['height'] = $s->getParameter('height');
|
||||
($s->getParameter('class')) and $attributes['class'] = $s->getParameter('class');
|
||||
($s->getParameter('id')) and $attributes['id'] = $s->getParameter('id');
|
||||
($s->getParameter('alt')) and $attributes['alt'] = $s->getParameter('alt');
|
||||
|
||||
return Images::getImage($s->getParameter('path'), $params, $attributes);
|
||||
});
|
||||
|
||||
// Shortcode: [image_url path="home/image.jpg"]
|
||||
// Result: Display image url
|
||||
Entries::shortcode()->addHandler('image_url', function(ShortcodeInterface $s) {
|
||||
$params = [];
|
||||
|
||||
// API
|
||||
// http://glide.thephpleague.com/1.0/api/quick-reference/
|
||||
($s->getParameter('or')) and $params['or'] = $s->getParameter('or');
|
||||
($s->getParameter('flip')) and $params['flip'] = $s->getParameter('flip');
|
||||
($s->getParameter('crop')) and $params['crop'] = $s->getParameter('crop');
|
||||
($s->getParameter('w')) and $params['w'] = $s->getParameter('w');
|
||||
($s->getParameter('h')) and $params['h'] = $s->getParameter('h');
|
||||
($s->getParameter('fit')) and $params['fit'] = $s->getParameter('fit');
|
||||
($s->getParameter('dpr')) and $params['dpr'] = $s->getParameter('dpr');
|
||||
($s->getParameter('bri')) and $params['bri'] = $s->getParameter('bri');
|
||||
($s->getParameter('con')) and $params['con'] = $s->getParameter('con');
|
||||
($s->getParameter('gam')) and $params['gam'] = $s->getParameter('gam');
|
||||
($s->getParameter('sharp')) and $params['sharp'] = $s->getParameter('sharp');
|
||||
($s->getParameter('blur')) and $params['blur'] = $s->getParameter('blur');
|
||||
($s->getParameter('pixel')) and $params['pixel'] = $s->getParameter('pixel');
|
||||
($s->getParameter('filt')) and $params['filt'] = $s->getParameter('filt');
|
||||
($s->getParameter('mark')) and $params['mark'] = $s->getParameter('mark');
|
||||
($s->getParameter('markw')) and $params['markw'] = $s->getParameter('markw');
|
||||
($s->getParameter('markh')) and $params['markh'] = $s->getParameter('markh');
|
||||
($s->getParameter('markx')) and $params['markx'] = $s->getParameter('markx');
|
||||
($s->getParameter('marky')) and $params['marky'] = $s->getParameter('marky');
|
||||
($s->getParameter('markpad')) and $params['markpad'] = $s->getParameter('markpad');
|
||||
($s->getParameter('markpos')) and $params['markpos'] = $s->getParameter('markpos');
|
||||
($s->getParameter('markalpha')) and $params['markalpha'] = $s->getParameter('markalpha');
|
||||
($s->getParameter('bg')) and $params['bg'] = $s->getParameter('bg');
|
||||
($s->getParameter('border')) and $params['border'] = $s->getParameter('border');
|
||||
($s->getParameter('q')) and $params['q'] = $s->getParameter('q');
|
||||
($s->getParameter('fm')) and $params['fm'] = $s->getParameter('fm');
|
||||
|
||||
return Images::getImageUrl($s->getParameter('path'), $params);
|
||||
});
|
||||
});
|
||||
|
||||
class Images
|
||||
{
|
||||
/**
|
||||
* An instance of the Themes class
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
private static $instance = null;
|
||||
|
||||
/**
|
||||
* Images Server
|
||||
*
|
||||
* @var
|
||||
*/
|
||||
protected static $server;
|
||||
|
||||
/**
|
||||
* Private clone method to enforce singleton behavior.
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function __clone()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Private wakeup method to enforce singleton behavior.
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function __wakeup()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Private construct method to enforce singleton behavior.
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function __construct()
|
||||
{
|
||||
Images::init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Init Images
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
*/
|
||||
private static function init() : void
|
||||
{
|
||||
// Set source filesystem
|
||||
$source = new \League\Flysystem\Filesystem(
|
||||
new \League\Flysystem\Adapter\Local(PATH['entries'])
|
||||
);
|
||||
|
||||
// Set cache filesystem
|
||||
$cache = new \League\Flysystem\Filesystem(
|
||||
new \League\Flysystem\Adapter\Local(PATH['cache'] . '/glide')
|
||||
);
|
||||
|
||||
// Set watermarks filesystem
|
||||
$watermarks = new \League\Flysystem\Filesystem(
|
||||
new \League\Flysystem\Adapter\Local(PATH['site'] . '/watermarks')
|
||||
);
|
||||
|
||||
// Set image manager
|
||||
$imageManager = new \Intervention\Image\ImageManager([
|
||||
'driver' => 'gd',
|
||||
]);
|
||||
|
||||
// Set manipulators
|
||||
$manipulators = [
|
||||
new \League\Glide\Manipulators\Orientation(),
|
||||
new \League\Glide\Manipulators\Crop(),
|
||||
new \League\Glide\Manipulators\Size(2000*2000),
|
||||
new \League\Glide\Manipulators\Brightness(),
|
||||
new \League\Glide\Manipulators\Contrast(),
|
||||
new \League\Glide\Manipulators\Gamma(),
|
||||
new \League\Glide\Manipulators\Sharpen(),
|
||||
new \League\Glide\Manipulators\Filter(),
|
||||
new \League\Glide\Manipulators\Blur(),
|
||||
new \League\Glide\Manipulators\Pixelate(),
|
||||
new \League\Glide\Manipulators\Watermark($watermarks),
|
||||
new \League\Glide\Manipulators\Background(),
|
||||
new \League\Glide\Manipulators\Border(),
|
||||
new \League\Glide\Manipulators\Encode(),
|
||||
];
|
||||
|
||||
// Set API
|
||||
$api = new \League\Glide\Api\Api($imageManager, $manipulators);
|
||||
|
||||
// Setup Glide server
|
||||
$server = new \League\Glide\Server(
|
||||
$source,
|
||||
$cache,
|
||||
$api
|
||||
);
|
||||
|
||||
Images::$server = $server;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get image url
|
||||
*
|
||||
* Images::getImageUrl('page-name/image.jpg', [w => '200']);
|
||||
* http://glide.thephpleague.com/1.0/api/quick-reference/
|
||||
*
|
||||
* @access public
|
||||
* @param string $path Image path
|
||||
* @param array $params Image params
|
||||
* @return string Returns the image url
|
||||
*/
|
||||
public static function getImageUrl($path, array $params)
|
||||
{
|
||||
if (file_exists(PATH['entries'] . '/' . $path)) {
|
||||
return Http::getBaseUrl() . '/site/cache/glide/' . Images::$server->makeImage($path, $params);
|
||||
} else {
|
||||
return "File {$path} does not exist.";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get image
|
||||
*
|
||||
* Images::getImage('page-name/image.jpg', [w => '200']);
|
||||
* http://glide.thephpleague.com/1.0/api/quick-reference/
|
||||
*
|
||||
* @access public
|
||||
* @param string $path Image path
|
||||
* @param array $params Image params
|
||||
* @return string Returns the image url
|
||||
*/
|
||||
public static function getImage($path, array $params, array $attributes = [])
|
||||
{
|
||||
if (file_exists(PATH['entries'] . '/' . $path)) {
|
||||
return '<img '.Html::attributes($attributes).' src="'. Images::getImageUrl($path, $params) .'">';
|
||||
} else {
|
||||
return "File {$path} does not exist.";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns server variable
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public static function server()
|
||||
{
|
||||
return Images::$server;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Image instance.
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
if (is_null(Images::$instance)) {
|
||||
Images::$instance = new self;
|
||||
}
|
||||
|
||||
return Images::$instance;
|
||||
}
|
||||
}
|
@@ -14,12 +14,13 @@ namespace Flextype;
|
||||
|
||||
use Flextype\Component\Filesystem\Filesystem;
|
||||
use Flextype\Component\Event\Event;
|
||||
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
|
||||
|
||||
// Event: onShortcodesInitialized
|
||||
Event::addListener('onShortcodesInitialized', function () {
|
||||
|
||||
// Shortcode: [snippet name=snippet-name]
|
||||
Content::shortcode()->addHandler('snippet', function(ShortcodeInterface $s) {
|
||||
Entries::shortcode()->addHandler('snippet', function(ShortcodeInterface $s) {
|
||||
return Snippet::get($s->getParameter('name'));
|
||||
});
|
||||
});
|
||||
|
@@ -1,8 +1,14 @@
|
||||
# The title of the website
|
||||
title: "Site title here"
|
||||
title: "Flextype"
|
||||
|
||||
# The description of the website
|
||||
description: "Site description here"
|
||||
description: "Modern Open Source Flat-File Content Management System"
|
||||
|
||||
# The keywords of the website
|
||||
keywords: "flextype, php, cms, flat-file cms, flat cms, flatfile cms, html"
|
||||
|
||||
# The robots of the website
|
||||
robots: "index, follow"
|
||||
|
||||
# The name and email address of the website author
|
||||
author:
|
||||
@@ -31,33 +37,35 @@ date_format: "F d Y H:i:s"
|
||||
# Don't edit the provided theme templates directly, because they get updated
|
||||
# in next releases. If you wish to modify a default theme, copy its folder, and
|
||||
# change the name here accordingly.
|
||||
theme: simple
|
||||
theme: default
|
||||
|
||||
# The locale that'll be used by the Flextype.
|
||||
locale: "en"
|
||||
|
||||
# The default page to use for the homepage.
|
||||
# The entries settings
|
||||
# Define the file types (extensions to be exact) that are acceptable for upload.
|
||||
entries:
|
||||
main: home
|
||||
media:
|
||||
upload_images_quality: 70
|
||||
upload_images_width: 1600
|
||||
upload_images_height: 0
|
||||
accept_file_types: "gif, jpg, jpeg, png, ico, zip, tgz, txt, md, doc, docx, pdf, epub, xls, xlsx, ppt, pptx, mp3, ogg, wav, m4a, mp4, m4v, ogv, wmv, avi, webm, svg"
|
||||
error404:
|
||||
title: "Error 404"
|
||||
description: "We're sorry but the page you are looking for doesn't appear to exist!"
|
||||
content: "We're sorry but the page you are looking for doesn't appear to exist!"
|
||||
template: "default"
|
||||
|
||||
|
||||
# Display errors
|
||||
errors:
|
||||
display: true
|
||||
display: false
|
||||
|
||||
# Cache
|
||||
# available drivers: auto (will get one from installed cache drivers), apcu,
|
||||
# apc, wincache, xcache, memcache, memcached, redis, file.
|
||||
cache:
|
||||
enabled: true
|
||||
prefix: Flextype
|
||||
prefix: flextype
|
||||
driver: auto
|
||||
lifetime: 604800
|
||||
|
||||
# Define the file types (extensions to be exact) that are acceptable for upload.
|
||||
accept_file_types: [ gif, jpg, jpeg, png, ico, zip, tgz, txt, md, doc, docx, pdf, epub, xls, xlsx, ppt, pptx, mp3, ogg, wav, m4a, mp4, m4v, ogv, wmv, avi, webm, svg]
|
||||
|
@@ -1,55 +0,0 @@
|
||||
title: 'Flextype'
|
||||
description: 'Modern Open Source Flat-File Content Management System'
|
||||
author:
|
||||
name: ''
|
||||
email: ''
|
||||
timezone: UTC
|
||||
charset: UTF-8
|
||||
date_format: 'F d Y H:i:s'
|
||||
theme: default
|
||||
locale: en
|
||||
entries:
|
||||
main: home
|
||||
error404:
|
||||
title: 'Error 404'
|
||||
description: 'We''re sorry but the page you are looking for doesn''t appear to exist!'
|
||||
content: 'We''re sorry but the page you are looking for doesn''t appear to exist!'
|
||||
template: default
|
||||
errors:
|
||||
display: false
|
||||
cache:
|
||||
enabled: true
|
||||
prefix: flextype
|
||||
driver: auto
|
||||
lifetime: 604800
|
||||
accept_file_types:
|
||||
- gif
|
||||
- jpg
|
||||
- jpeg
|
||||
- png
|
||||
- ico
|
||||
- zip
|
||||
- tgz
|
||||
- txt
|
||||
- md
|
||||
- doc
|
||||
- docx
|
||||
- pdf
|
||||
- epub
|
||||
- xls
|
||||
- xlsx
|
||||
- ppt
|
||||
- pptx
|
||||
- mp3
|
||||
- ogg
|
||||
- wav
|
||||
- m4a
|
||||
- mp4
|
||||
- m4v
|
||||
- ogv
|
||||
- wmv
|
||||
- avi
|
||||
- webm
|
||||
- svg
|
||||
keywords: 'flextype, php, cms, flat-file cms, flat cms, flatfile cms, html'
|
||||
robots: 'index, follow'
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 MiB |
@@ -1,9 +1,10 @@
|
||||
---
|
||||
title: About
|
||||
image: 5c2357585623aOb4Xk_yQclo.jpg
|
||||
image: lilia.jpg
|
||||
template: about
|
||||
fieldset: about
|
||||
date: 'December 26 2018 10:26:04'
|
||||
|
||||
---
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
BIN
site/entries/about/lilia.jpg
Normal file
BIN
site/entries/about/lilia.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 125 KiB |
@@ -21,4 +21,4 @@ date: 'December 25 2018 23:16:47'
|
||||
</p>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
<br>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
|
@@ -6,7 +6,8 @@
|
||||
h4,
|
||||
h5,
|
||||
p,
|
||||
pre {
|
||||
pre,
|
||||
table {
|
||||
color: #fff !important;
|
||||
}
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@ use Flextype\Component\Form\Form;
|
||||
use Flextype\Component\Notification\Notification;
|
||||
use function Flextype\Component\I18n\__;
|
||||
use Gajus\Dindent\Indenter;
|
||||
use Intervention\Image\ImageManagerStatic as Image;
|
||||
|
||||
class EntriesManager
|
||||
{
|
||||
@@ -331,7 +332,7 @@ class EntriesManager
|
||||
{
|
||||
$files = [];
|
||||
foreach (array_diff(scandir(PATH['entries'] . '/' . $entry), ['..', '.']) as $file) {
|
||||
if (in_array($file_ext = substr(strrchr($file, '.'), 1), Registry::get('settings.accept_file_types'))) {
|
||||
if (strpos(Registry::get('settings.entries.media.accept_file_types'), $file_ext = substr(strrchr($file, '.'), 1)) !== false) {
|
||||
if (strpos($file, strtolower($file_ext), 1)) {
|
||||
if ($path) {
|
||||
$files[Http::getBaseUrl().'/'.$entry.'/'.$file] = Http::getBaseUrl().'/'.$entry.'/'.$file;
|
||||
@@ -460,12 +461,199 @@ class EntriesManager
|
||||
|
||||
if (Http::post('upload_file')) {
|
||||
if (Token::check(Http::post('token'))) {
|
||||
Filesystem::uploadFile($_FILES['file'], $files_directory, Registry::get('settings.accept_file_types'), 7000000);
|
||||
Notification::set('success', __('admin_message_entry_file_uploaded'));
|
||||
Http::redirect(Http::getBaseUrl().'/admin/entries/edit?entry='.Http::get('entry').'&media=true');
|
||||
//echo Registry::get('settings.entries.media.accept_file_types');
|
||||
|
||||
$file = EntriesManager::uploadFile($_FILES['file'], $files_directory, Registry::get('settings.entries.media.accept_file_types'), 17000000);
|
||||
|
||||
if($file !== false) {
|
||||
|
||||
if (in_array(pathinfo($file)['extension'], ['jpg', 'jpeg', 'png', 'gif'])) {
|
||||
|
||||
// open an image file
|
||||
$img = Image::make($file);
|
||||
|
||||
// now you are able to resize the instance
|
||||
if (Registry::get('settings.entries.media.upload_images_width') > 0 && Registry::get('settings.entries.media.upload_images_height') > 0) {
|
||||
$img->resize(Registry::get('settings.entries.media.upload_images_width'), Registry::get('settings.entries.media.upload_images_height'), function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
$constraint->upsize();
|
||||
});
|
||||
} elseif (Registry::get('settings.entries.media.upload_images_width') > 0) {
|
||||
$img->resize(Registry::get('settings.entries.media.upload_images_width'), null, function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
$constraint->upsize();
|
||||
});
|
||||
} elseif (Registry::get('settings.entries.media.upload_images_height') > 0) {
|
||||
$img->resize(null, Registry::get('settings.entries.media.upload_images_height'), function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
$constraint->upsize();
|
||||
});
|
||||
}
|
||||
|
||||
// finally we save the image as a new file
|
||||
$img->save($file, Registry::get('settings.entries.media.upload_images_quality'));
|
||||
|
||||
// destroy
|
||||
$img->destroy();
|
||||
}
|
||||
|
||||
Notification::set('success', __('admin_message_entry_file_uploaded'));
|
||||
Http::redirect(Http::getBaseUrl().'/admin/entries/edit?entry='.Http::get('entry').'&media=true');
|
||||
} else {
|
||||
Notification::set('error', __('admin_message_entry_file_not_uploaded'));
|
||||
Http::redirect(Http::getBaseUrl().'/admin/entries/edit?entry='.Http::get('entry').'&media=true');
|
||||
}
|
||||
|
||||
} else {
|
||||
die('Request was denied because it contained an invalid security token. Please refresh the entry and try again.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload files on the Server with several type of Validations!
|
||||
*
|
||||
* Entries::uploadFile($_FILES['file'], $files_directory);
|
||||
*
|
||||
* @param array $file Uploaded file data
|
||||
* @param string $upload_directory Upload directory
|
||||
* @param string $allowed Allowed file extensions
|
||||
* @param int $max_size Max file size in bytes
|
||||
* @param string $filename New filename
|
||||
* @param bool $remove_spaces Remove spaces from the filename
|
||||
* @param int $max_width Maximum width of image
|
||||
* @param int $max_height Maximum height of image
|
||||
* @param bool $exact Match width and height exactly?
|
||||
* @param int $chmod Chmod mask
|
||||
* @return string on success, full path to new file
|
||||
* @return false on failure
|
||||
*/
|
||||
public static function uploadFile(
|
||||
array $file,
|
||||
string $upload_directory,
|
||||
string $allowed = 'jpeg, png, gif, jpg',
|
||||
int $max_size = 3000000,
|
||||
string $filename = null,
|
||||
bool $remove_spaces = true,
|
||||
int $max_width = null,
|
||||
int $max_height = null,
|
||||
bool $exact = false,
|
||||
int $chmod = 0644
|
||||
) {
|
||||
//
|
||||
// Tests if a successful upload has been made.
|
||||
//
|
||||
if (isset($file['error'])
|
||||
and isset($file['tmp_name'])
|
||||
and $file['error'] === UPLOAD_ERR_OK
|
||||
and is_uploaded_file($file['tmp_name'])) {
|
||||
|
||||
//
|
||||
// Tests if upload data is valid, even if no file was uploaded.
|
||||
//
|
||||
if (isset($file['error'])
|
||||
and isset($file['name'])
|
||||
and isset($file['type'])
|
||||
and isset($file['tmp_name'])
|
||||
and isset($file['size'])) {
|
||||
|
||||
//
|
||||
// Test if an uploaded file is an allowed file type, by extension.
|
||||
//
|
||||
if (strpos($allowed, strtolower(pathinfo($file['name'], PATHINFO_EXTENSION))) !== false) {
|
||||
|
||||
//
|
||||
// Validation rule to test if an uploaded file is allowed by file size.
|
||||
//
|
||||
if (($file['error'] != UPLOAD_ERR_INI_SIZE)
|
||||
and ($file['error'] == UPLOAD_ERR_OK)
|
||||
and ($file['size'] <= $max_size)) {
|
||||
|
||||
//
|
||||
// Validation rule to test if an upload is an image and, optionally, is the correct size.
|
||||
//
|
||||
if (in_array(mime_content_type($file['tmp_name']), ['image/jpeg', 'image/jpg', 'image/png','image/gif'])) {
|
||||
function validateImage($file, $max_width, $max_height, $exact)
|
||||
{
|
||||
try {
|
||||
// Get the width and height from the uploaded image
|
||||
list($width, $height) = getimagesize($file['tmp_name']);
|
||||
} catch (ErrorException $e) {
|
||||
// Ignore read errors
|
||||
}
|
||||
|
||||
if (empty($width) or empty($height)) {
|
||||
// Cannot get image size, cannot validate
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! $max_width) {
|
||||
// No limit, use the image width
|
||||
$max_width = $width;
|
||||
}
|
||||
|
||||
if (! $max_height) {
|
||||
// No limit, use the image height
|
||||
$max_height = $height;
|
||||
}
|
||||
|
||||
if ($exact) {
|
||||
// Check if dimensions match exactly
|
||||
return ($width === $max_width and $height === $max_height);
|
||||
} else {
|
||||
// Check if size is within maximum dimensions
|
||||
return ($width <= $max_width and $height <= $max_height);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (validateImage($file, $max_width, $max_height, $exact) === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (! isset($file['tmp_name']) or ! is_uploaded_file($file['tmp_name'])) {
|
||||
|
||||
// Ignore corrupted uploads
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($filename === null) {
|
||||
|
||||
// Use the default filename
|
||||
$filename = $file['name'];
|
||||
}
|
||||
|
||||
if ($remove_spaces === true) {
|
||||
|
||||
// Remove spaces from the filename
|
||||
$filename = Text::safeString(pathinfo($filename)['filename'], '-', true) . '.' . pathinfo($filename)['extension'];
|
||||
}
|
||||
|
||||
if (! is_dir($upload_directory) or ! is_writable(realpath($upload_directory))) {
|
||||
throw new \RuntimeException("Directory {$upload_directory} must be writable");
|
||||
}
|
||||
|
||||
// Make the filename into a complete path
|
||||
$filename = realpath($upload_directory).DIRECTORY_SEPARATOR.$filename;
|
||||
|
||||
if (move_uploaded_file($file['tmp_name'], $filename)) {
|
||||
|
||||
if ($chmod !== false) {
|
||||
// Set permissions on filename
|
||||
chmod($filename, $chmod);
|
||||
}
|
||||
|
||||
// Return new file path
|
||||
return $filename;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -46,6 +46,9 @@ class SettingsManager
|
||||
Arr::set($settings, 'errors.display', (Http::post('errors.display') == '1' ? true : false));
|
||||
Arr::set($settings, 'cache.enabled', (Http::post('cache.enabled') == '1' ? true : false));
|
||||
Arr::set($settings, 'cache.lifetime', (int) Http::post('cache.lifetime'));
|
||||
Arr::set($settings, 'entries.media.upload_images_quality', (int) Http::post('entries.media.upload_images_quality'));
|
||||
Arr::set($settings, 'entries.media.upload_images_width', (int) Http::post('entries.media.upload_images_width'));
|
||||
Arr::set($settings, 'entries.media.upload_images_height', (int) Http::post('entries.media.upload_images_height'));
|
||||
|
||||
if (Filesystem::setFileContent(PATH['config']['site'] . '/settings.yaml', YamlParser::encode(array_merge(Registry::get('settings'), $settings)))) {
|
||||
Notification::set('success', __('admin_message_settings_saved'));
|
||||
|
@@ -57,7 +57,6 @@ gulp.task('js', function(){
|
||||
'node_modules/trumbowyg/dist/plugins/noembed/trumbowyg.noembed.js',
|
||||
'node_modules/trumbowyg/dist/plugins/table/trumbowyg.table.js',
|
||||
'node_modules/codemirror/lib/codemirror.js',
|
||||
'node_modules/codemirror/lib/codemirror.js',
|
||||
'node_modules/codemirror/mode/htmlmixed/htmlmixed.js',
|
||||
'node_modules/codemirror/mode/xml/xml.js',
|
||||
'node_modules/codemirror/mode/javascript/javascript.js',
|
||||
|
@@ -31,6 +31,7 @@ admin_message_entry_created: "Entry created"
|
||||
admin_message_entry_deleted: "Entry deleted"
|
||||
admin_message_entry_file_deleted: "File successfully deleted"
|
||||
admin_message_entry_file_uploaded: "File successfully uploaded"
|
||||
admin_message_entry_file_not_uploaded: "File was not uploaded"
|
||||
admin_message_entry_moved: "Entry moved"
|
||||
admin_message_entry_renamed: "Entry renamed"
|
||||
admin_message_settings_saved: "Settings saved"
|
||||
@@ -95,7 +96,7 @@ admin_plugins_bugs: "Bugs"
|
||||
admin_plugins_description: "Description"
|
||||
admin_plugins_get_more_plugins: "Get More Plugins"
|
||||
admin_plugins_heading: "Plugins"
|
||||
admin_plugins_homeentry: "Homeentry"
|
||||
admin_plugins_homepage: "Homepage"
|
||||
admin_plugins_info: "Info"
|
||||
admin_plugins_license: "License"
|
||||
admin_plugins_name: "Name"
|
||||
@@ -120,6 +121,10 @@ admin_system_settings_system_entries_error404_content: "Error404 entry content"
|
||||
admin_system_settings_system_entries_error404_template: "Error404 entry template"
|
||||
admin_system_settings_heading: "Settings"
|
||||
admin_system_settings_site: "Site"
|
||||
admin_system_settings_general: "General"
|
||||
admin_system_settings_error_404_page: "Error 404 page"
|
||||
admin_system_settings_debuggig: "Debugging"
|
||||
admin_system_settings_cache: "Cache"
|
||||
admin_system_settings_site_author_email: "Author email"
|
||||
admin_system_settings_site_author_name: "Author name"
|
||||
admin_system_settings_site_description: "Site description"
|
||||
@@ -206,3 +211,12 @@ admin_fieldsets_error_name_empty_input: "Name has to be an alphanumeric value (f
|
||||
admin_fieldsets_error_title_empty_input: "Title has to be an alphanumeric value (from 1 chars)"
|
||||
admin_templates_error_name_empty_input: "Name has to be an alphanumeric value (from 1 chars)"
|
||||
admin_snippets_error_name_empty_input: "Name has to be an alphanumeric value (from 1 chars)"
|
||||
admin_system_settings_system_cache_enabled_false: "Off"
|
||||
admin_system_settings_system_cache_enabled_true: "On"
|
||||
admin_system_settings_system_errors_enabled_false: "Off"
|
||||
admin_system_settings_system_errors_enabled_true: "On"
|
||||
admin_system_settings_media: "Media"
|
||||
admin_system_settings_system_upload_images_quality: "Quality"
|
||||
admin_system_settings_system_upload_images_width: "Width"
|
||||
admin_system_settings_system_upload_images_height: "Height"
|
||||
admin_system_settings_system_upload_accept_file_types: "Accept file types"
|
||||
|
@@ -82,7 +82,7 @@ admin_menu_logout: "Выйти из системы"
|
||||
admin_menu_profile: "Профиль пользователя"
|
||||
admin_menu_system: "Система"
|
||||
admin_menu_system_information: "Информация"
|
||||
admin_menu_system_settings: "Настройки системы"
|
||||
admin_menu_system_settings: "Настройки"
|
||||
admin_menu_view_site: "Просмотр сайта"
|
||||
admin_menus: "Меню"
|
||||
admin_menus_create_new_category: "Создать новую категорию"
|
||||
@@ -100,6 +100,7 @@ admin_message_entry_created: "Успешно - Создана новая стр
|
||||
admin_message_entry_deleted: "Удалена страница из списка"
|
||||
admin_message_entry_file_deleted: "Файл удален из списка"
|
||||
admin_message_entry_file_uploaded: "Успешно - загружен новый файл"
|
||||
admin_message_entry_file_not_uploaded: "Файл не был загружен"
|
||||
admin_message_entry_moved: "Страница перемещена"
|
||||
admin_message_entry_renamed: "Страница переименована"
|
||||
admin_message_fieldset_created: "Создать новое поле"
|
||||
@@ -140,10 +141,10 @@ admin_plugins_bugs: "Ошибки"
|
||||
admin_plugins_description: "Описание"
|
||||
admin_plugins_get_more_plugins: "Добавить новый плагин"
|
||||
admin_plugins_heading: "Список плагинов"
|
||||
admin_plugins_homeentry: "Домашняя страница"
|
||||
admin_plugins_homepage: "Домашняя страница"
|
||||
admin_plugins_info: "Информация о плагине"
|
||||
admin_plugins_license: "Лицензия"
|
||||
admin_plugins_name: "Название установленного плагина"
|
||||
admin_plugins_name: "Название"
|
||||
admin_plugins_status: "Статус"
|
||||
admin_plugins_status_disabled: "выключен"
|
||||
admin_plugins_status_enabled: "включен"
|
||||
@@ -164,8 +165,12 @@ admin_snippets: "Список сниппетов"
|
||||
admin_summary: "Краткое изложение"
|
||||
admin_system: "Система"
|
||||
admin_system_clear_cache: "Очистить кеш"
|
||||
admin_system_settings_heading: "Настройки системы управления"
|
||||
admin_system_settings_heading: "Настройки"
|
||||
admin_system_settings_site: "Сайт"
|
||||
admin_system_settings_general: "Основные"
|
||||
admin_system_settings_error_404_page: "Страница ошибки 404"
|
||||
admin_system_settings_debuggig: "Дебаггинг"
|
||||
admin_system_settings_cache: "Кеш"
|
||||
admin_system_settings_site_author_email: "Емейл автора"
|
||||
admin_system_settings_site_author_name: "Имя автора"
|
||||
admin_system_settings_site_description: "Краткое описание сайта"
|
||||
@@ -174,20 +179,20 @@ admin_system_settings_site_robots: "Информация для индексац
|
||||
admin_system_settings_site_title: "Заголовок сайта"
|
||||
admin_system_settings_system: "Система"
|
||||
admin_system_settings_system_cache_driver: "Драйвер кеша"
|
||||
admin_system_settings_system_cache_enabled: "Сохранять кеш?"
|
||||
admin_system_settings_system_cache_enabled: "Сохранение кеша"
|
||||
admin_system_settings_system_cache_lifetime: "Время хранения кеша (в секундах)"
|
||||
admin_system_settings_system_cache_prefix: "Префикс кеша"
|
||||
admin_system_settings_system_charset: "Кодировка страницы по умолчанию (если не знаете - лучше не менять)"
|
||||
admin_system_settings_system_charset: "Кодировка системы"
|
||||
admin_system_settings_system_date_format: "Формат отображения даты"
|
||||
admin_system_settings_system_entries_error404_content: "Контент страницы Error 404"
|
||||
admin_system_settings_system_entries_error404_description: "Описание страницы Error 404"
|
||||
admin_system_settings_system_entries_error404_template: "Шаблон страницы Error 404"
|
||||
admin_system_settings_system_entries_error404_title: "Заголовок страницы Error 404"
|
||||
admin_system_settings_system_entries_main: "Главная страница на сайте по умолчанию"
|
||||
admin_system_settings_system_errors_display: "Отображать или нет ошибки?"
|
||||
admin_system_settings_system_locale: "Язык перевода"
|
||||
admin_system_settings_system_entries_main: "Главная страница сайта"
|
||||
admin_system_settings_system_errors_display: "Отображение ошибок"
|
||||
admin_system_settings_system_locale: "Язык"
|
||||
admin_system_settings_system_theme: "Тема"
|
||||
admin_system_settings_system_timezone: "Временная зона (если не знаете - лучше не менять)"
|
||||
admin_system_settings_system_timezone: "Временная зона"
|
||||
admin_template: "Шаблон"
|
||||
admin_template_create_new: "Добавить новый шаблон"
|
||||
admin_templates: "Список шаблонов"
|
||||
@@ -206,3 +211,12 @@ admin_fieldsets_error_name_empty_input: "Имя должно быть букве
|
||||
admin_fieldsets_error_title_empty_input: "Название должно быть буквенно-цифровым значением (от 1-го символа)"
|
||||
admin_templates_error_name_empty_input: "Имя должно быть буквенно-цифровым значением (от 1-го символа)"
|
||||
admin_snippets_error_name_empty_input: "Название должно быть буквенно-цифровым значением (от 1-го символа)"
|
||||
admin_system_settings_system_cache_enabled_false: "Выключен"
|
||||
admin_system_settings_system_cache_enabled_true: "Включен"
|
||||
admin_system_settings_system_errors_enabled_false: "Выключено"
|
||||
admin_system_settings_system_errors_enabled_true: "Включено"
|
||||
admin_system_settings_media: "Медиа"
|
||||
admin_system_settings_system_upload_images_quality: "Качество (0 - 100)"
|
||||
admin_system_settings_system_upload_images_width: "Ширина"
|
||||
admin_system_settings_system_upload_images_height: "Высота"
|
||||
admin_system_settings_system_upload_accept_file_types: "Допустимые типы файлов для загрузки"
|
||||
|
@@ -3,7 +3,7 @@
|
||||
"version": "0.0.0",
|
||||
"devDependencies": {
|
||||
"animate.css": "^3.7.0",
|
||||
"bootstrap": "^4.1.3",
|
||||
"bootstrap": "^4.2.1",
|
||||
"codemirror": "5.42.0",
|
||||
"del": "^3.0.0",
|
||||
"es6-promise": "^4.2.5",
|
||||
|
@@ -101,7 +101,7 @@ use Flextype\Component\{Http\Http, Event\Event, Registry\Registry, Assets\Assets
|
||||
$('.js-plugin-author-name-placeholder').html($(this).attr('data-author-name'));
|
||||
$('.js-plugin-author-email-placeholder').html($(this).attr('data-author-email'));
|
||||
$('.js-plugin-author-url-placeholder').html($(this).attr('data-author-url'));
|
||||
$('.js-plugin-homeentry-placeholder').html($(this).attr('data-homeentry'));
|
||||
$('.js-plugin-homepage-placeholder').html($(this).attr('data-homepage'));
|
||||
$('.js-plugin-bugs-placeholder').html($(this).attr('data-bugs'));
|
||||
$('.js-plugin-license-placeholder').html($(this).attr('data-license'));
|
||||
});
|
||||
@@ -137,7 +137,7 @@ use Flextype\Component\{Http\Http, Event\Event, Registry\Registry, Assets\Assets
|
||||
theme: "monokai",
|
||||
styleActiveLine: true,
|
||||
});
|
||||
|
||||
|
||||
editor.addKeyMap({
|
||||
"Tab": function (cm) {
|
||||
if (cm.somethingSelected()) {
|
||||
|
@@ -46,7 +46,7 @@ use function Flextype\Component\I18n\__;
|
||||
<a href="javascript:;"
|
||||
<?php $file_ext = substr(strrchr($file, '.'), 1) ?>
|
||||
<?php if(in_array($file_ext, ['jpeg', 'png', 'gif', 'jpg'])): ?>
|
||||
style="background-image: url('<?= Http::getBaseUrl() . '/site/entries/' . Http::get('entry') . '/' . basename($file) ?>')"
|
||||
style="background-image: url('<?= Images::getImageUrl(Http::get('entry') . '/' . basename($file), ['w'=>'200']) ?>')"
|
||||
<?php else: ?>
|
||||
style="background: #000;"
|
||||
<?php endif ?>
|
||||
|
@@ -33,7 +33,7 @@
|
||||
<?php foreach ($fieldsets_list as $name => $fieldset): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= $fieldset ?>
|
||||
<a href="<?= Http::getBaseUrl() ?>/admin/fieldsets/edit?fieldset=<?= $name ?>"><?= $fieldset ?></a>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
|
@@ -33,7 +33,7 @@
|
||||
<?php foreach ($menus_list as $name => $menu): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= $menu['title'] ?>
|
||||
<a href="<?= Http::getBaseUrl() ?>/admin/menus/edit?menu=<?= $name ?>"><?= $menu['title'] ?></a>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
|
@@ -83,7 +83,7 @@ Themes::view('admin/views/partials/content-start')->display();
|
||||
<p><b><?= __('admin_plugins_author_name') ?>: </b><span class="js-plugin-author-name-placeholder"></span></p>
|
||||
<p><b><?= __('admin_plugins_author_email') ?>: </b><span class="js-plugin-author-email-placeholder"></span></p>
|
||||
<p><b><?= __('admin_plugins_author_url') ?>: </b><span class="js-plugin-author-url-placeholder"></span></p>
|
||||
<p><b><?= __('admin_plugins_homeentry') ?>: </b><span class="js-plugin-homepage-placeholder"></span></p>
|
||||
<p><b><?= __('admin_plugins_homepage') ?>: </b><span class="js-plugin-homepage-placeholder"></span></p>
|
||||
<p><b><?= __('admin_plugins_bugs') ?>: </b><span class="js-plugin-bugs-placeholder"></span></p>
|
||||
<p><b><?= __('admin_plugins_license') ?>: </b><span class="js-plugin-license-placeholder"></span></p>
|
||||
</div>
|
||||
|
@@ -33,7 +33,7 @@
|
||||
<?php foreach ($snippets_list as $snippet): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= basename($snippet, '.php') ?>
|
||||
<a href="<?= Http::getBaseUrl() ?>/admin/snippets/edit?snippet=<?= basename($snippet, '.php') ?>"><?= basename($snippet, '.php') ?></a>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
|
@@ -35,7 +35,7 @@
|
||||
<?php foreach ($templates_list as $template): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= $template ?>
|
||||
<a href="<?= Http::getBaseUrl() ?>/admin/templates/edit?template=<?= $template ?>"><?= $template ?></a>
|
||||
</td>
|
||||
<td><?= Text::lowercase(__('admin_template')) ?></td>
|
||||
<td class="text-right">
|
||||
@@ -58,7 +58,7 @@
|
||||
<?php foreach ($partials_list as $partial): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= $partial ?>
|
||||
<a href="<?= Http::getBaseUrl() ?>/admin/templates/edit?template=<?= $partial ?>&type=partial"><?= $partial ?></a>
|
||||
</td>
|
||||
<td><?= Text::lowercase(__('admin_partial')) ?></td>
|
||||
<td class="text-right">
|
||||
|
@@ -32,6 +32,12 @@ Themes::view('admin/views/partials/content-start')->display();
|
||||
<?= Form::hidden('token', Token::generate()) ?>
|
||||
<?= Form::hidden('action', 'save-form') ?>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
<h3 class="h3"><?= __('admin_system_settings_site'); ?></h3>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('title', __('admin_system_settings_site_title'), ['for' => 'systemSettingsSiteTitle']) ?>
|
||||
@@ -39,12 +45,14 @@ Themes::view('admin/views/partials/content-start')->display();
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('description', __('admin_system_settings_site_description'), ['for' => 'systemSettingsSiteDescription']) ?>
|
||||
<?= Form::textarea('description', $settings['description'], ['class' => 'form-control margin-hard-bottom', 'id' => 'systemSettingsSiteDescription']) ?>
|
||||
<?= Form::input('description', $settings['description'], ['class' => 'form-control margin-hard-bottom', 'id' => 'systemSettingsSiteDescription']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('keywords', __('admin_system_settings_site_keywords'), ['for' => 'systemSettingsSiteKeywords']) ?>
|
||||
<?= Form::input('keywords', $settings['keywords'], ['class' => 'form-control', 'id' => 'systemSettingsSiteKeywords', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('robots', __('admin_system_settings_site_robots'), ['for' => 'systemSettingsSiteRobots']) ?>
|
||||
<?= Form::input('robots', $settings['robots'], ['class' => 'form-control', 'id' => 'systemSettingsSiteRobots', 'required']) ?>
|
||||
@@ -58,6 +66,13 @@ Themes::view('admin/views/partials/content-start')->display();
|
||||
<?= Form::input('author[email]', $settings['author']['email'], ['class' => 'form-control', 'id' => 'systemSettingsSiteAuthorEmail', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<br>
|
||||
<h3 class="h3"><?= __('admin_system_settings_general'); ?></h3>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('timezone', __('admin_system_settings_system_timezone'), ['for' => 'systemSettingsSystemTimezone']) ?>
|
||||
@@ -71,6 +86,8 @@ Themes::view('admin/views/partials/content-start')->display();
|
||||
<?= Form::label('charset', __('admin_system_settings_system_charset'), ['for' => 'systemSettingsSystemCharset']) ?>
|
||||
<?= Form::input('charset', $settings['charset'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCharset', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('theme', __('admin_system_settings_system_theme'), ['for' => 'systemSettingsSystemTheme']) ?>
|
||||
<?= Form::input('theme', $settings['theme'], ['class' => 'form-control', 'id' => 'systemSettingsSystemTheme', 'required']) ?>
|
||||
@@ -83,6 +100,42 @@ Themes::view('admin/views/partials/content-start')->display();
|
||||
<?= Form::label('entries[main]', __('admin_system_settings_system_entries_main'), ['for' => 'systemSettingsSystemEntriesMain']) ?>
|
||||
<?= Form::input('entries[main]', $settings['entries']['main'], ['class' => 'form-control', 'id' => 'systemSettingsSystemEntriesMain', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<br>
|
||||
<h3 class="h3"><?= __('admin_system_settings_media'); ?></h3>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[media][upload_images_quality]', __('admin_system_settings_system_upload_images_quality'), ['for' => 'systemSettingsSystemTheme']) ?>
|
||||
<?= Form::input('entries[media][upload_images_quality]', $settings['entries']['media']['upload_images_quality'], ['class' => 'form-control', 'id' => 'systemSettingsSystemTheme', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[media][accept_file_types]', __('admin_system_settings_system_upload_accept_file_types'), ['for' => 'systemSettingsSystemTheme']) ?>
|
||||
<?= Form::input('entries[media][accept_file_types]', $settings['entries']['media']['accept_file_types'] , ['class' => 'form-control', 'id' => 'systemSettingsSystemTheme', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[media][upload_images_width]', __('admin_system_settings_system_upload_images_width'), ['for' => 'systemSettingsSystemTheme']) ?>
|
||||
<?= Form::input('entries[media][upload_images_width]', $settings['entries']['media']['upload_images_width'], ['class' => 'form-control', 'id' => 'systemSettingsSystemTheme', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[media][upload_images_height]', __('admin_system_settings_system_upload_images_height'), ['for' => 'systemSettingsSystemEntriesMain']) ?>
|
||||
<?= Form::input('entries[media][upload_images_height]', $settings['entries']['media']['upload_images_height'], ['class' => 'form-control', 'id' => 'systemSettingsSystemEntriesMain', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<br>
|
||||
<h3 class="h3"><?= __('admin_system_settings_error_404_page'); ?></h3>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[error404][title]', __('admin_system_settings_system_entries_error404_title'), ['for' => 'systemSettingsSystemEntriesError404Title']) ?>
|
||||
<?= Form::input('entries[error404][title]', $settings['entries']['error404']['title'], ['class' => 'form-control', 'id' => 'systemSettingsSystemEntriesError404Title', 'required']) ?>
|
||||
@@ -91,6 +144,8 @@ Themes::view('admin/views/partials/content-start')->display();
|
||||
<?= Form::label('entries[error404][description]', __('admin_system_settings_system_entries_error404_description'), ['for' => 'systemSettingsSystemEntriesError404Description']) ?>
|
||||
<?= Form::input('entries[error404][description]', $settings['entries']['error404']['description'], ['class' => 'form-control', 'id' => 'systemSettingsSystemEntriesError404Description', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('entries[error404][content]', __('admin_system_settings_system_entries_error404_content'), ['for' => 'systemSettingsSystemEntriesError404Content']) ?>
|
||||
<?= Form::input('entries[error404][content]', $settings['entries']['error404']['content'], ['class' => 'form-control', 'id' => 'systemSettingsSystemEntriesError404Content', 'required']) ?>
|
||||
@@ -99,18 +154,39 @@ Themes::view('admin/views/partials/content-start')->display();
|
||||
<?= Form::label('entries[error404][template]', __('admin_system_settings_system_entries_error404_template'), ['for' => 'systemSettingsSystemEntriesError404Template']) ?>
|
||||
<?= Form::input('entries[error404][template]', $settings['entries']['error404']['template'], ['class' => 'form-control', 'id' => 'systemSettingsSystemEntriesError404Template', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<br>
|
||||
<h3 class="h3"><?= __('admin_system_settings_debuggig'); ?></h3>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('errors[display]', __('admin_system_settings_system_errors_display'), ['for' => 'systemSettingsSystemErrorsDisplay']) ?>
|
||||
<?= Form::select('errors[display]', [0 => 'false', 1 => 'true'], $settings['errors']['display'], ['class' => 'form-control', 'id' => 'systemSettingsSystemErrorsDisplay', 'required']) ?>
|
||||
<?= Form::select('errors[display]', [0 => __('admin_system_settings_system_errors_enabled_false'), 1 => __('admin_system_settings_system_errors_enabled_true')], $settings['errors']['display'], ['class' => 'form-control', 'id' => 'systemSettingsSystemErrorsDisplay', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<br>
|
||||
<h3 class="h3"><?= __('admin_system_settings_cache'); ?></h3>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[enabled]', __('admin_system_settings_system_cache_enabled'), ['for' => 'systemSettingsSystemCacheEnabled']) ?>
|
||||
<?= Form::select('cache[enabled]', [0 => 'false', 1 => 'true'], $settings['cache']['enabled'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheEnabled', 'required']) ?>
|
||||
<?= Form::select('cache[enabled]', [0 => __('admin_system_settings_system_cache_enabled_false'), 1 => __('admin_system_settings_system_cache_enabled_true')], $settings['cache']['enabled'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheEnabled', 'required']) ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[prefix]', __('admin_system_settings_system_cache_prefix'), ['for' => 'systemSettingsSystemCachePrefix']) ?>
|
||||
<?= Form::input('cache[prefix]', $settings['cache']['prefix'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCachePrefix', 'required']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<?= Form::label('cache[driver]', __('admin_system_settings_system_cache_driver'), ['for' => 'systemSettingsSystemCacheDriver']) ?>
|
||||
<?= Form::input('cache[driver]', $settings['cache']['driver'], ['class' => 'form-control', 'id' => 'systemSettingsSystemCacheDriver', 'required']) ?>
|
||||
|
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
body,button,html,input,p,select,textarea{font-family:Helvetica,arial,sans-serif;color:#000}body,html{font-size:16px;height:100%;background:#fff}body,button,input,p,select,textarea{font-weight:400}body,p{line-height:24px}pre{background:#f0f0f0;padding:20px}.content{padding-top:40px}.navbar-brand{letter-spacing:3px;text-transform:uppercase}.powered{padding-top:30px}
|
11
site/themes/default/assets/dist/js/simple.min.js
vendored
11
site/themes/default/assets/dist/js/simple.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -19,14 +19,14 @@ gulp.task('simple-css', function() {
|
||||
cascade: false
|
||||
}))
|
||||
.pipe(csso())
|
||||
.pipe(concat('simple.min.css'))
|
||||
.pipe(concat('default.min.css'))
|
||||
.pipe(gulp.dest('assets/dist/css/'));
|
||||
});
|
||||
|
||||
gulp.task('js', function(){
|
||||
return gulp.src(['node_modules/jquery/dist/jquery.slim.min.js', 'node_modules/bootstrap/dist/js/bootstrap.min.js'])
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(concat('simple.min.js'))
|
||||
.pipe(concat('default.min.js'))
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest('assets/dist/js/'));
|
||||
});
|
||||
|
@@ -9,7 +9,7 @@
|
||||
"gulp-sass": "^4.0.1",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-sourcemaps": "^2.6.4",
|
||||
"bootstrap": "^4.1.1",
|
||||
"bootstrap": "^4.2.1",
|
||||
"jquery": "^3.3.1"
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700' rel='stylesheet' type='text/css'>
|
||||
|
||||
<?php Assets::add('css', Http::getBaseUrl() . '/site/themes/' . Registry::get('settings.theme') . '/assets/dist/css/bootstrap.min.css', 'site', 1) ?>
|
||||
<?php Assets::add('css', Http::getBaseUrl() . '/site/themes/' . Registry::get('settings.theme') . '/assets/dist/css/simple.min.css', 'site', 2) ?>
|
||||
<?php Assets::add('css', Http::getBaseUrl() . '/site/themes/' . Registry::get('settings.theme') . '/assets/dist/css/default.min.css', 'site', 2) ?>
|
||||
<?php foreach(Assets::get('css', 'site') as $assets_by_priorities): ?>
|
||||
<?php foreach($assets_by_priorities as $assets): ?>
|
||||
<link href="<?= $assets['asset'] ?>" rel="stylesheet">
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php namespace Flextype ?>
|
||||
<?php use Flextype\Component\{Event\Event, Http\Http, Registry\Registry, Assets\Assets} ?>
|
||||
<?php Assets::add('js', Http::getBaseUrl() . '/site/themes/' . Registry::get('settings.theme') . '/assets/dist/js/simple.min.js', 'site', 1) ?>
|
||||
<?php Assets::add('js', Http::getBaseUrl() . '/site/themes/' . Registry::get('settings.theme') . '/assets/dist/js/default.min.js', 'site', 1) ?>
|
||||
<?php foreach(Assets::get('js', 'site') as $assets_by_priorities): ?>
|
||||
<?php foreach($assets_by_priorities as $assets): ?>
|
||||
<script src="<?= $assets['asset'] ?>"></script>
|
||||
|
@@ -2,5 +2,5 @@
|
||||
<?php Themes::view('partials/head')->display() ?>
|
||||
<h1><?= $entry['title'] ?></h1>
|
||||
<?= $entry['content'] ?>
|
||||
<img src="<?= $entry['base_url'] ?>/<?= $entry['slug'] ?>/<?= $entry['image'] ?>">
|
||||
<img src="<?= Images::getImageUrl($entry['slug'] .'/'. $entry['image'], ['w' => '670', 'dpr' => '2']) ?>">
|
||||
<?php Themes::view('partials/footer')->display() ?>
|
||||
|
Reference in New Issue
Block a user