mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-08-06 09:19:03 +02:00
Merge branch 'develop' into feature/integrate-with-admin-pro
This commit is contained in:
@@ -12,6 +12,7 @@ use Grav\Common\Plugins;
|
||||
use Grav\Common\Themes;
|
||||
use Grav\Common\Uri;
|
||||
use Grav\Common\User\User;
|
||||
use Grav\Common\Utils;
|
||||
use RocketTheme\Toolbox\File\File;
|
||||
use RocketTheme\Toolbox\File\JsonFile;
|
||||
use RocketTheme\Toolbox\File\LogFile;
|
||||
@@ -312,6 +313,9 @@ class Admin
|
||||
/** @var Plugins $plugins */
|
||||
$plugins = $this->grav['plugins'];
|
||||
$obj = $plugins->get(preg_replace('|plugins/|', '', $type));
|
||||
|
||||
if (!$obj) { return []; }
|
||||
|
||||
$obj->merge($post);
|
||||
$obj->file($file);
|
||||
|
||||
@@ -320,6 +324,9 @@ class Admin
|
||||
/** @var Themes $themes */
|
||||
$themes = $this->grav['themes'];
|
||||
$obj = $themes->get(preg_replace('|themes/|', '', $type));
|
||||
|
||||
if (!$obj) { return []; }
|
||||
|
||||
$obj->merge($post);
|
||||
$obj->file($file);
|
||||
|
||||
@@ -707,6 +714,17 @@ class Admin
|
||||
return $parent_route;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static helper method to return the admin form nonce
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getNonce()
|
||||
{
|
||||
$action = 'admin-form';
|
||||
return Utils::getNonce($action);
|
||||
}
|
||||
|
||||
/**
|
||||
* Static helper method to return the last used page name
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user