Commit 220cdcc2 authored by neutrinet-site's avatar neutrinet-site Committed by Site-sync-Neutrinet
Browse files

(Grav GitSync) Automatic Commit from neutrinet-site

parent 028fb982
---
title: 'Invitation A.G. 2022'
subtitle: "Et aussi des tables rondes sur différents sujets !"
date: '06/03/2022 22:00 pm'
date: '03/06/2022 10:00 pm'
published: true
taxonomy:
category:
......@@ -82,4 +82,4 @@ Si vous avez des questions ou remarques n'hésitez pas à nous le faire savoir s
Au plaisir de vous rencontrer lors de l'ag,
Neutrinet asbl
\ No newline at end of file
Neutrinet asbl
# EditorConfig is awesome: http://EditorConfig.org
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
......@@ -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
# v1.10.30.2
## 02/09/2022
1. [](#bugfix)
* Fixed regression preventing new `elements` field from saving its state
# v1.10.30.1
## 02/09/2022
1. [](#improved)
* List field items will now require confirmation before getting deleted
# 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
# 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
......
# 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)
......@@ -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).
......@@ -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.
......
......@@ -119,6 +119,12 @@ class AdminPlugin extends Plugin
'list' => [
'array' => true
],
'elements' => [
'input@' => true
],
'element' => [
'input@' => false
],
'file' => [
'array' => true,
'media_field' => true,
......@@ -480,7 +486,7 @@ class AdminPlugin extends Plugin
Admin::DEBUG && Admin::addDebugMessage("Admin page: {$this->template}");
$page->init(new \SplFileInfo(__DIR__ . "/pages/admin/{$this->template}.md"));
$page->slug(basename($this->template));
$page->slug(Utils::basename($this->template));
return $page;
}
......@@ -501,7 +507,7 @@ class AdminPlugin extends Plugin
Admin::DEBUG && Admin::addDebugMessage("Admin page: plugin {$plugin->name}/{$this->template}");
$page->init(new \SplFileInfo($path));
$page->slug(basename($this->template));
$page->slug(Utils::basename($this->template));
return $page;
}
......@@ -525,7 +531,7 @@ class AdminPlugin extends Plugin
$error_file = $this->grav['locator']->findResource('plugins://admin/pages/admin/error.md');
$page = new Page();
$page->init(new \SplFileInfo($error_file));
$page->slug(basename($this->route));
$page->slug(Utils::basename($this->route));
$page->routable(true);
}
......@@ -537,7 +543,7 @@ class AdminPlugin extends Plugin
$login_file = $this->grav['locator']->findResource('plugins://admin/pages/admin/login.md');
$page = new Page();
$page->init(new \SplFileInfo($login_file));
$page->slug(basename($this->route));
$page->slug(Utils::basename($this->route));
unset($this->grav['page']);
$this->grav['page'] = $page;
}
......@@ -1304,7 +1310,7 @@ class AdminPlugin extends Plugin
$options = [];
$theme_files = glob(__dir__ . '/themes/grav/css/codemirror/themes/*.css');
foreach ($theme_files as $theme_file) {
$theme = basename(basename($theme_file, '.css'));
$theme = Utils::basename(Utils::basename($theme_file, '.css'));
$options[$theme] = Inflector::titleize($theme);
}
}
......
......@@ -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:
......
name: Admin Panel
slug: admin
type: plugin
version: 1.10.28
version: 1.10.30.2
description: Adds an advanced administration panel to manage your site
icon: empire
author:
name: Team Grav
email: devs@getgrav.org
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
......@@ -15,7 +15,7 @@ docs: https://github.com/getgrav/grav-plugin-admin/blob/develop/README.md
license: MIT
dependencies:
- { name: grav, version: '>=1.7.28' }
- { name: grav, version: '>=1.7.30' }
- { name: form, version: '>=5.1.0' }
- { name: login, version: '>=3.6.2' }
- { name: email, version: '>=3.1.0' }
......@@ -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
......
......@@ -980,7 +980,7 @@ class Admin
$obj->file = $file;
$obj->page = $pages->get(dirname($obj->path));
$fileInfo = pathinfo($obj->title);
$fileInfo = Utils::pathinfo($obj->title);
$filename = str_replace(['@3x', '@2x'], '', $fileInfo['filename']);
if (isset($fileInfo['extension'])) {
$filename .= '.' . $fileInfo['extension'];
......@@ -1979,7 +1979,7 @@ class Admin
$page = $path ? $pages->find($path, true) : $pages->root();
if (!$page) {
$slug = basename($path);
$slug = Utils::basename($path);
if ($slug === '') {
return null;
......
......@@ -374,7 +374,7 @@ class AdminBaseController
// since php removes it from the upload location
$tmp_dir = Admin::getTempDir();
$tmp_file = $upload->file->tmp_name;
$tmp = $tmp_dir . '/uploaded-files/' . basename($tmp_file);
$tmp = $tmp_dir . '/uploaded-files/' . Utils::basename($tmp_file);
Folder::create(dirname($tmp));
if (!move_uploaded_file($tmp_file, $tmp)) {
......@@ -423,7 +423,7 @@ class AdminBaseController
// Generate random name if required
if ($settings->random_name) { // TODO: document
$extension = pathinfo($upload->file->name, PATHINFO_EXTENSION);
$extension = Utils::pathinfo($upload->file->name, PATHINFO_EXTENSION);
$upload->file->name = Utils::generateRandomString(15) . '.' . $extension;
}
......@@ -929,7 +929,7 @@ class AdminBaseController
$type = $uri->param('type');
$field = $uri->param('field');
$filename = basename($this->post['filename'] ?? '');
$filename = Utils::basename($this->post['filename'] ?? '');
if ($filename === '') {
$this->admin->json_response = [
'status' => 'error',
......@@ -1068,7 +1068,7 @@ class AdminBaseController
if ($file->exists()) {
$resultRemoveMedia = $file->delete();
$fileParts = pathinfo($filename);
$fileParts = Utils::pathinfo($filename);
foreach (scandir($fileParts['dirname']) as $file) {
$regex_pattern = '/' . preg_quote($fileParts['filename'], '/') . "@\d+x\." . $fileParts['extension'] . "(?:\.meta\.yaml)?$|" . preg_quote($fileParts['basename'], '/') . "\.meta\.yaml$/";
......
......@@ -22,6 +22,7 @@ use Grav\Common\Page\Medium\Medium;
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;
......@@ -35,6 +36,7 @@ use PicoFeed\Parser\MalformedXmlException;
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;
......@@ -521,7 +523,7 @@ class AdminController extends AdminBaseController
try {
if ($download) {
$filename = basename(base64_decode(urldecode($download)));
$filename = Utils::basename(base64_decode(urldecode($download)));
$file = $this->grav['locator']->findResource("backup://{$filename}", true);
if (!$file || !Utils::endsWith($filename, '.zip', false)) {
header('HTTP/1.1 401 Unauthorized');
......@@ -584,7 +586,7 @@ class AdminController extends AdminBaseController
$backup = $this->grav['uri']->param('backup', null);
if (null !== $backup) {
$filename = basename(base64_decode(urldecode($backup)));
$filename = Utils::basename(base64_decode(urldecode($backup)));
$file = $this->grav['locator']->findResource("backup://{$filename}", true);
if ($file && Utils::endsWith($filename, '.zip', false)) {
......@@ -629,10 +631,8 @@ class AdminController extends AdminBaseController
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')) {
......@@ -662,10 +662,8 @@ class AdminController extends AdminBaseController
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');
......@@ -675,6 +673,30 @@ class AdminController extends AdminBaseController
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.
*
......@@ -2244,7 +2266,7 @@ class AdminController extends AdminBaseController
// Check extension
$extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
$extension = strtolower(Utils::pathinfo($filename, PATHINFO_EXTENSION));
// If not a supported type, return
if (!$extension || !$config->get("media.types.{$extension}")) {
......@@ -2293,7 +2315,7 @@ class AdminController extends AdminBaseController
// Add metadata if needed
$include_metadata = Grav::instance()['config']->get('system.media.auto_metadata_exif', false);
$basename = str_replace(['@3x', '@2x'], '', pathinfo($filename, PATHINFO_BASENAME));
$basename = str_replace(['@3x', '@2x'], '', Utils::pathinfo($filename, PATHINFO_BASENAME));
$metadata = [];
......@@ -2423,7 +2445,7 @@ class AdminController extends AdminBaseController
return false;
}
$filename = !empty($this->post['filename']) ? basename($this->post['filename']) : null;
$filename = !empty($this->post['filename']) ? Utils::basename($this->post['filename']) : null;
// Handle bad filenames.
if (!$filename || !Utils::checkFilename($filename)) {
......@@ -2442,7 +2464,7 @@ class AdminController extends AdminBaseController
if ($locator->isStream($targetPath)) {
$targetPath = $locator->findResource($targetPath, true, true);
}
$fileParts = pathinfo($filename);
$fileParts = Utils::pathinfo($filename);
$found = false;
......@@ -2626,7 +2648,7 @@ class AdminController extends AdminBaseController
$payload = [
'name' => $file_page ? $file_page->title() : $fileName,
'value' => $file_page ? $file_page->rawRoute() : $file_path,
'item-key' => basename($file_page ? $file_page->route() : $file_path),
'item-key' => Utils::basename($file_page ? $file_page->route() : $file_path),
'filename' => $fileName,
'extension' => $type === 'dir' ? '' : $fileInfo->getExtension(),
'type' => $type,
......
......@@ -15,6 +15,7 @@ use Grav\Common\Page\Pages;
use Grav\Common\Uri;
use Grav\Common\User\Interfaces\UserCollectionInterface;
use Grav\Common\User\Interfaces\UserInterface;
use Grav\Common\Utils;
use Grav\Framework\RequestHandler\Exception\PageExpiredException;
use Grav\Framework\RequestHandler\Exception\RequestException;
use Grav\Plugin\Admin\Admin;
......@@ -111,7 +112,7 @@ class LoginController extends AdminController
{
$uri = (string)$this->getRequest()->getUri();
$ext = pathinfo($uri, PATHINFO_EXTENSION);
$ext = Utils::pathinfo($uri, PATHINFO_EXTENSION);
$accept = $this->getAccept(['application/json', 'text/html']);
if ($ext === 'json' || $accept === 'application/json') {
return $this->createErrorResponse(new RequestException($this->getRequest(), $this->translate('PLUGIN_ADMIN.LOGGED_OUT'), 401));
......
......@@ -316,7 +316,7 @@ class Gpm
$bad_chars = array_merge(array_map('chr', range(0, 31)), ['<', '>', ':', '"', '/', '\\', '|', '?', '*']);
$filename = $package->slug . str_replace($bad_chars, '', basename($package->zipball_url));
$filename = $package->slug . str_replace($bad_chars, '', \Grav\Common\Utils::basename($package->zipball_url));
$filename = preg_replace('/[\\\\\/:"*?&<>|]+/m', '-', $filename);
file_put_contents($tmp_dir . DS . $filename . '.zip', $contents);
......@@ -363,7 +363,7 @@ class Gpm
$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));
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
PLUGIN_ADMIN:
ADMIN_BETA_MSG: "هذا إصدار بيتا! استخدم هذا في الإنتاج على مسؤوليتك الخاصة..."
ADMIN_REPORT_ISSUE: "وجدت مشكلة؟ الرجاء الإبلاغ عن GitHub."
EMAIL_FOOTER: "<a href=\"http://getgrav.org\">Powered by Grav</a> - The Modern Flat File CMS"
EMAIL_FOOTER: "<a href=\"https://getgrav.org\">Powered by Grav</a> - The Modern Flat File CMS"
LOGIN_BTN: "تسجل الدخول"
LOGIN_BTN_FORGOT: "نسيت"
LOGIN_BTN_RESET: "إعادة تعيين كلمة المرور"
......
......@@ -2,7 +2,7 @@
PLUGIN_ADMIN:
ADMIN_BETA_MSG: "Това е Бета версия! Използвате на ваша отговорност..."
ADMIN_REPORT_ISSUE: "Открили сте проблем? Моля, съобщете за него в GitHub."
EMAIL_FOOTER: "<a href=\"http://getgrav.org\">Задвижван от Grav</a> - Модерният Флат Файл CMS"
EMAIL_FOOTER: "<a href=\"https://getgrav.org\">Задвижван от Grav</a> - Модерният Флат Файл CMS"
LOGIN_BTN: "Вход"
LOGIN_BTN_FORGOT: "Забравена парола"
LOGIN_BTN_RESET: "Промяна на паролата"
......
......@@ -2,7 +2,7 @@
PLUGIN_ADMIN:
ADMIN_BETA_MSG: "Un ermaeziadenn beta an hini eo! Arverit en endro produadur gant evezh..."
ADMIN_REPORT_ISSUE: "Kavet hoc'h eus ur gudenn? Danevellit anezhi war Github."
EMAIL_FOOTER: "<a href=\"http://getgrav.org\">Lusket gant Grav</a> - Ar CMS Restr plad modern"
EMAIL_FOOTER: "<a href=\"https://getgrav.org\">Lusket gant Grav</a> - Ar CMS Restr plad modern"
LOGIN_BTN: "Anv arveriad"
LOGIN_BTN_FORGOT: "Ankouaet"
LOGIN_BTN_RESET: "Adderaouekaat ar ger-tremen"
......
......@@ -2,7 +2,7 @@
PLUGIN_ADMIN:
ADMIN_BETA_MSG: "Aquesta és una versió beta! Utilitza-la en producció sota el teu propi risc..."
ADMIN_REPORT_ISSUE: "Has trobat algun problema? Sisplau, reporta'l a GitHub."
EMAIL_FOOTER: "<a href=\"http://getgrav.org\">Funcionant amb Grav</a> - El CMS de fitxers plans modern"
EMAIL_FOOTER: "<a href=\"https://getgrav.org\">Funcionant amb Grav</a> - El CMS de fitxers plans modern"
LOGIN_BTN: "Inicia sessió"
LOGIN_BTN_FORGOT: "Ho he oblidat"
LOGIN_BTN_RESET: "Restablir contrasenya"
......
......@@ -3,7 +3,7 @@ PLUGIN_ADMIN:
ADMIN_NOSCRIPT_MSG: "Prosím povolte JavaScript ve vašem prohlížeči."
ADMIN_BETA_MSG: "Jedná se o beta verzi! V ostrém provozu používejte pouze na vlastní nebezpečí..."
ADMIN_REPORT_ISSUE: "Objevili jste problém? Nahlaste ho, prosím, na GitHub."
EMAIL_FOOTER: "<a href=\"http://getgrav.org\">Beží na Grav CMS</a> - Moderní správce obsahu pomocí souborů prostých textů"
EMAIL_FOOTER: "<a href=\"https://getgrav.org\">Beží na Grav CMS</a> - Moderní správce obsahu pomocí souborů prostých textů"
LOGIN_BTN: "Přihlásit"
LOGIN_BTN_FORGOT: "Obnovit heslo"
LOGIN_BTN_RESET: "Obnovit heslo"
......
......@@ -2,7 +2,7 @@
PLUGIN_ADMIN:
ADMIN_BETA_MSG: "Mae hwn yn fersiwn beta! Defnyddio hwn yn cynhyrchu ar risg eich hun..."
ADMIN_REPORT_ISSUE: "Canfod problem? Rhowch wybod ar GitHub."
EMAIL_FOOTER: "<a href=\"http://getgrav.org\"> wedi'u pweru gan Grav</a>-ffeil fflat Modern CMS"
EMAIL_FOOTER: "<a href=\"https://getgrav.org\"> wedi'u pweru gan Grav</a>-ffeil fflat Modern CMS"
LOGIN_BTN: "Mewngofnodi"
LOGIN_BTN_FORGOT: "Anghofio"
LOGIN_BTN_RESET: "Ailosod cyfrinair"
......
......@@ -3,7 +3,7 @@ PLUGIN_ADMIN:
ADMIN_NOSCRIPT_MSG: "Aktivér JavaScript i din browser."
ADMIN_BETA_MSG: "Dette er en beta-udgivelse! Brug i produktionsmiljøer er egen risiko..."
ADMIN_REPORT_ISSUE: "Har du fundet et problem? bedes du rapportere det GitHub."
EMAIL_FOOTER: "<a href=\"http://getgrav.org\">Drevet af Grav</a> - det moderne fladfil-CMS"
EMAIL_FOOTER: "<a href=\"https://getgrav.org\">Drevet af Grav</a> - det moderne fladfil-CMS"
LOGIN_BTN: "Login"
LOGIN_BTN_FORGOT: "Glemt"
LOGIN_BTN_RESET: "Nulstil adgangskode"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment