diff --git a/flextype/config/settings.yaml b/flextype/config/settings.yaml index 0ee1aea1..808f595e 100644 --- a/flextype/config/settings.yaml +++ b/flextype/config/settings.yaml @@ -1,20 +1,3 @@ -# The title of the website -title: Flextype - -# The description of the website -description: Build fast, flexible, easier to manage websites with Flextype. - -# 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: - email: '' - name: '' - # Set the timezone to be used on the website. # For a list of valid timezone settings, see: # http://php.net/manual/en/timezones.php @@ -52,15 +35,7 @@ date_display_format: 'd-m-y G:i' # - media.upload_images_quality: Image quality # - media.accept_file_types: Define the file types (extensions to be exact) that are acceptable for upload. entries: - items_view_default: list 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! diff --git a/site/plugins/admin/app/Controllers/EntriesController.php b/site/plugins/admin/app/Controllers/EntriesController.php index e5b73c2d..88931a98 100644 --- a/site/plugins/admin/app/Controllers/EntriesController.php +++ b/site/plugins/admin/app/Controllers/EntriesController.php @@ -94,7 +94,7 @@ class EntriesController extends Controller if (isset($entry_current['items_view'])) { $items_view = $entry_current['items_view']; } else { - $items_view = $this->registry->get('settings.entries.items_view_default'); + $items_view = $this->registry->get('plugins.admin.entries.items_view_default'); } return $this->view->render( @@ -892,31 +892,31 @@ class EntriesController extends Controller $files_directory = PATH['entries'] . '/' . $id . '/'; - $file = $this->_uploadFile($_FILES['file'], $files_directory, $this->registry->get('settings.entries.media.accept_file_types'), 27000000); + $file = $this->_uploadFile($_FILES['file'], $files_directory, $this->registry->get('plugins.admin.entries.media.accept_file_types'), 27000000); 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 ($this->registry->get('settings.entries.media.upload_images_width') > 0 && $this->registry->get('settings.entries.media.upload_images_height') > 0) { - $img->resize($this->registry->get('settings.entries.media.upload_images_width'), $this->registry->get('settings.entries.media.upload_images_height'), function($constraint) { + if ($this->registry->get('plugins.admin.entries.media.upload_images_width') > 0 && $this->registry->get('plugins.admin.entries.media.upload_images_height') > 0) { + $img->resize($this->registry->get('plugins.admin.entries.media.upload_images_width'), $this->registry->get('plugins.admin.entries.media.upload_images_height'), function($constraint) { $constraint->aspectRatio(); $constraint->upsize(); }); - } elseif ($this->registry->get('settings.entries.media.upload_images_width') > 0) { - $img->resize($this->registry->get('settings.entries.media.upload_images_width'), null, function($constraint) { + } elseif ($this->registry->get('plugins.admin.entries.media.upload_images_width') > 0) { + $img->resize($this->registry->get('plugins.admin.entries.media.upload_images_width'), null, function($constraint) { $constraint->aspectRatio(); $constraint->upsize(); }); - } elseif ($this->registry->get('settings.entries.media.upload_images_height') > 0) { - $img->resize(null, $this->registry->get('settings.entries.media.upload_images_height'), function($constraint) { + } elseif ($this->registry->get('plugins.admin.entries.media.upload_images_height') > 0) { + $img->resize(null, $this->registry->get('plugins.admin.entries.media.upload_images_height'), function($constraint) { $constraint->aspectRatio(); $constraint->upsize(); }); } // finally we save the image as a new file - $img->save($file, $this->registry->get('settings.entries.media.upload_images_quality')); + $img->save($file, $this->registry->get('plugins.admin.entries.media.upload_images_quality')); // destroy $img->destroy(); @@ -1066,7 +1066,7 @@ class EntriesController extends Controller $base_url = \Slim\Http\Uri::createFromEnvironment(new \Slim\Http\Environment($_SERVER))->getBaseUrl(); $files = []; foreach (array_diff(scandir(PATH['entries'] . '/' . $id), ['..', '.']) as $file) { - if (strpos($this->registry->get('settings.entries.media.accept_file_types'), $file_ext = substr(strrchr($file, '.'), 1)) !== false) { + if (strpos($this->registry->get('plugins.admin.entries.media.accept_file_types'), $file_ext = substr(strrchr($file, '.'), 1)) !== false) { if (strpos($file, strtolower($file_ext), 1)) { if ($file !== 'entry.md') { if ($path) { diff --git a/site/plugins/admin/settings.yaml b/site/plugins/admin/settings.yaml index 4c44313f..b21de9d8 100644 --- a/site/plugins/admin/settings.yaml +++ b/site/plugins/admin/settings.yaml @@ -1,2 +1,14 @@ +# enabled: true or false to disable the plugin enabled: true + +# custom admin pane route route: admin + +# entries settings +entries: + items_view_default: list + 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 diff --git a/site/plugins/site/settings.yaml b/site/plugins/site/settings.yaml index 13200497..885df8f5 100644 --- a/site/plugins/site/settings.yaml +++ b/site/plugins/site/settings.yaml @@ -1,2 +1,22 @@ +# enabled: true or false to disable the plugin enabled: true + +# Site plugin priority priority: -1000000 + +# The title of the website +title: Flextype + +# The description of the website +description: Build fast, flexible, easier to manage websites with Flextype. + +# 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: + email: '' + name: '' diff --git a/site/themes/default/templates/partials/base.html b/site/themes/default/templates/partials/base.html index 0344b47f..7ecc2716 100644 --- a/site/themes/default/templates/partials/base.html +++ b/site/themes/default/templates/partials/base.html @@ -4,43 +4,55 @@ {% block head %} - - - - + + + + - {% do emitter.emit('onThemeMeta') %} + {% do + emitter.emit('onThemeMeta') %} - {% if entry.title %}{{ entry.title|e('html') }} | {% endif %}{{ registry.settings.title|e('html') }} + + {% if entry.title %}{{ entry.title|e('html') }} + | + {% endif %}{{ registry.settings.title|e('html') }} {% set build_css = base_url() ~ '/site/themes/' ~ registry.settings.theme ~ '/assets/dist/css/build.min.css' %} - {% do assets.add('css', build_css, 'site', 1) %} + {% do + assets.add('css', build_css, 'site', 1) %} {% for assets_site in assets.get('css', 'site') %} {% for assets_by_priorities in assets_site %} {% endfor %} {% endfor %} - {% do emitter.emit('onThemeHeader') %} + {% do + emitter.emit('onThemeHeader') %} {{ snippets.exec('google-analytics')|raw }} {% endblock %}
@@ -75,6 +87,7 @@
- {% do emitter.emit('onThemeTail') %} + {% do + emitter.emit('onThemeTail') %} - + \ No newline at end of file