Skip to content

Commit

Permalink
Merge branch 'release/1.10.30'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Feb 7, 2022
2 parents 47f5e8b + 8b8515d commit df2202d
Show file tree
Hide file tree
Showing 136 changed files with 13,386 additions and 16,219 deletions.
8 changes: 4 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# EditorConfig is awesome: http://EditorConfig.org
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true
Expand All @@ -12,6 +12,6 @@ insert_final_newline = true
indent_style = space
indent_size = 2

# 2 space indentation
[*.{yaml,.yml}]
indent_size = 2
# 4 space indentation
[*.php]
indent_size = 4
29 changes: 26 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,40 @@
# v1.10.30
## 02/07/2022

1. [](#new)
* Require **Grav 1.7.30**
* Updated SCSS compiler to v1.10
* PageMedia can now be collapsed and thumbnails previewed smaller, in order to save room on the page. Selection will be remembered.
* DEPRECATED: Admin field `pages_list_display_field` is no longer available as an option [#2191](https://github.com/getgrav/grav-plugin-admin/issues/2191)
* When listing installable themes/plugins, it is now possible to sort them by [Premium](https://getgrav.org/premium)
2. [](#improved)
* Updated JavaScript dependencies
* Cleaned up JavaScript unused dependencies and warnings
* Removed unused style assets
* Plugins list rows now properly highlight on hover, no more guessing when wanting to disable a plugin!
3. [](#bugfix)
* Fixed `elements` field when it's used inside `list` field
* Fixed issue uploading non-images media when Resolution setting enabled in Admin [#2172](https://github.com/getgrav/grav-plugin-admin/issues/2172)
* Prevent fields from being toggled incorrectly by adding originalValue to childs of fieldset. [#2218](https://github.com/getgrav/grav-plugin-admin/pull/2218)
* Fixed persistent focus on Folder field when Adding page (Safari) [#2209](https://github.com/getgrav/grav-plugin-admin/issues/2209)
* Fixed performance of Plugins / Themes sort in the installation table
* Fixed list field with key/value pairs throwing an exception due to bad value [#2199](https://github.com/getgrav/grav-plugin-admin/issues/2199)
* Fixed disabling/enabling plugin from the list breaking the plugin configuration

# v1.10.29
## 01/28/2022

1. [](#new)
* Require **Grav 1.7.29**
3. [](#improved)
* Made path handling unicode-safe, use new `Utils::basename()` and `Utils::pathinfo()` everywhere
* Made path handling unicode-safe, use new `Utils::basename()` and `Utils::pathinfo()` everywhere

# v1.10.28
## 01/24/2022

1. [](#bugfix)
* Clean file names before displaying errors/metadata modals
* Recompiled JS for production [#2225](https://github.com/getgrav/grav-plugin-admin/issues/2225)
* Clean file names before displaying errors/metadata modals
* Recompiled JS for production [#2225](https://github.com/getgrav/grav-plugin-admin/issues/2225)

# v1.10.27
## 01/12/2022
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Grav Standard Administration Panel Plugin

This **admin plugin** for [Grav](http://github.com/getgrav/grav) is an HTML user interface that provides a convenient way to configure Grav and easily create and modify pages. This will remain a totally optional plugin, and is not in any way required or needed to use Grav effectively. In fact, the admin provides an intentionally limited view to ensure it remains easy to use and not overwhelming. I'm sure power users will still prefer to work with the configuration files directly.
This **admin plugin** for [Grav](https://github.com/getgrav/grav) is an HTML user interface that provides a convenient way to configure Grav and easily create and modify pages. This will remain a totally optional plugin, and is not in any way required or needed to use Grav effectively. In fact, the admin provides an intentionally limited view to ensure it remains easy to use and not overwhelming. I'm sure power users will still prefer to work with the configuration files directly.

![](assets/admin-dashboard.png)

Expand Down Expand Up @@ -33,7 +33,7 @@ This **admin plugin** for [Grav](http://github.com/getgrav/grav) is an HTML user

We have tested internally, but we hope to use this public beta phase to identify, isolate, and fix issues related to the plugin to ensure it is as solid and reliable as possible.

For **live chatting**, please use the dedicated [Slack Chat Room](https://getgrav.org/slack) for discussions directly related to Grav.
For **live chatting**, please use the dedicated [Discord Chat Room](https://getgrav.org/discord) for discussions directly related to Grav.

For **bugs, features, improvements**, please ensure you [create issues in the admin plugin GitHub repository](https://github.com/getgrav/grav-plugin-admin).

Expand Down Expand Up @@ -99,7 +99,7 @@ By default, you can access the admin by pointing your browser to `http://yoursit
# Standard Free & Paid Pro Versions

If you have been following the [blog](http://getgrav.org/blog), [Twitter](https://twitter.com/getgrav), [Slack chat](https://getgrav.org/slack), etc., you probably already know now that our intention is to provide two versions of this plugin.
If you have been following the [blog](https://getgrav.org/blog), [Twitter](https://twitter.com/getgrav), [Discord chat](https://getgrav.org/discord), etc., you probably already know now that our intention is to provide two versions of this plugin.

The **standard free version**, is very powerful, and has more functionality than most commercial flat-file CMS systems.

Expand Down
6 changes: 6 additions & 0 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ public function getFormFieldTypes()
'list' => [
'array' => true
],
'elements' => [
'input@' => false
],
'element' => [
'input@' => false
],
'file' => [
'array' => true,
'media_field' => true,
Expand Down
1 change: 0 additions & 1 deletion admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ session:
edit_mode: normal
frontend_preview_target: inline
show_github_msg: true
pages_list_display_field: title
admin_icons: line-awesome
enable_auto_updates_check: true
notifications:
Expand Down
12 changes: 3 additions & 9 deletions blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: Admin Panel
slug: admin
type: plugin
version: 1.10.29
version: 1.10.30
description: Adds an advanced administration panel to manage your site
icon: empire
author:
name: Team Grav
email: [email protected]
url: http://getgrav.org
url: https://getgrav.org
homepage: https://github.com/getgrav/grav-plugin-admin
keywords: admin, plugin, manager, panel
bugs: https://github.com/getgrav/grav-plugin-admin/issues
docs: https://github.com/getgrav/grav-plugin-admin/blob/develop/README.md
license: MIT

dependencies:
- { name: grav, version: '>=1.7.29' }
- { name: grav, version: '>=1.7.30' }
- { name: form, version: '>=5.1.0' }
- { name: login, version: '>=3.6.2' }
- { name: email, version: '>=3.1.0' }
Expand Down Expand Up @@ -202,12 +202,6 @@ form:
type: bool
help: PLUGIN_ADMIN.SHOW_GITHUB_LINK_HELP

pages_list_display_field:
type: text
size: small
label: PLUGIN_ADMIN.PAGES_LIST_DISPLAY_FIELD
help: PLUGIN_ADMIN.PAGES_LIST_DISPLAY_FIELD_HELP

enable_auto_updates_check:
type: toggle
label: PLUGIN_ADMIN.AUTO_UPDATES
Expand Down
38 changes: 30 additions & 8 deletions classes/plugin/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Grav\Common\Page\Page;
use Grav\Common\Page\Pages;
use Grav\Common\Page\Collection;
use Grav\Common\Plugins;
use Grav\Common\Security;
use Grav\Common\User\Interfaces\UserCollectionInterface;
use Grav\Common\User\Interfaces\UserInterface;
Expand All @@ -35,6 +36,7 @@
use Psr\Http\Message\ResponseInterface;
use RocketTheme\Toolbox\Event\Event;
use RocketTheme\Toolbox\File\File;
use RocketTheme\Toolbox\File\YamlFile;
use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
use Twig\Loader\FilesystemLoader;

Expand Down Expand Up @@ -629,10 +631,8 @@ public function taskEnable()
return false;
}

// Filter value and save it.
$this->post = ['enabled' => true];
$obj = $this->prepareData($this->post);
$obj->save();
$type = $this->getDataType();
$this->updatePluginState($type, ['enabled' => true]);

$this->post = ['_redirect' => 'plugins'];
if ($this->grav['uri']->param('redirect')) {
Expand Down Expand Up @@ -662,10 +662,8 @@ public function taskDisable()
return false;
}

// Filter value and save it.
$this->post = ['enabled' => false];
$obj = $this->prepareData($this->post);
$obj->save();
$type = $this->getDataType();
$this->updatePluginState($type, ['enabled' => false]);

$this->post = ['_redirect' => 'plugins'];
$this->admin->setMessage($this->admin::translate('PLUGIN_ADMIN.SUCCESSFULLY_DISABLED_PLUGIN'), 'info');
Expand All @@ -675,6 +673,30 @@ public function taskDisable()
return true;
}

/**
* @param string $type
* @param array $value
* @return void
*/
protected function updatePluginState(string $type, array $value): void
{
$obj = Plugins::get(preg_replace('|plugins/|', '', $type));
if (null === $obj) {
throw new \RuntimeException("Plugin '{$type}' doesn't exist!");
}

/** @var UniformResourceLocator $locator */
$locator = $this->grav['locator'];

// Configuration file will be saved to the existing config stream.
$filename = $locator->findResource('config://') . "/{$type}.yaml";

$file = YamlFile::instance($filename);
$contents = $value + $file->content();

$file->save($contents);
}

/**
* Set the default theme.
*
Expand Down
2 changes: 1 addition & 1 deletion classes/plugin/Gpm.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public static function selfupgrade()
$error[] = '<p>Grav has increased the minimum PHP requirement.<br />';
$error[] = 'You are currently running PHP <strong>' . phpversion() . '</strong>';
$error[] = ', but PHP <strong>' . $upgrader->minPHPVersion() . '</strong> is required.</p>';
$error[] = '<p><a href="http://getgrav.org/blog/changing-php-requirements-to-5.5" class="button button-small secondary">Additional information</a></p>';
$error[] = '<p><a href="https://getgrav.org/blog/changing-php-requirements-to-5.5" class="button button-small secondary">Additional information</a></p>';

Installer::setError(implode("\n", $error));

Expand Down
Loading

0 comments on commit df2202d

Please sign in to comment.