Merge branch 'develop' into feature/integrate-with-admin-pro

This commit is contained in:
Flavio Copes
2015-11-21 16:40:18 +01:00
41 changed files with 1264 additions and 119 deletions

View File

@@ -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
*