Add a message if installed on Grav < 1.1.0-beta.1

This commit is contained in:
Flavio Copes
2016-04-26 18:53:13 +02:00
parent ed6c4dd481
commit c56c2103aa
2 changed files with 6 additions and 0 deletions

View File

@@ -243,6 +243,11 @@ class AdminPlugin extends Plugin
// Only activate admin if we're inside the admin path.
if ($this->active) {
if (version_compare(GRAV_VERSION, '1.1.0-beta.1', '<')) {
$messages = $this->grav['messages'];
$messages->add($this->grav['language']->translate('PLUGIN_ADMIN.NEEDS_GRAV_1_1'), 'error');
}
// Have a unique Admin-only Cache key
if (method_exists($this->grav['cache'], 'setKey')){
$cache = $this->grav['cache'];

View File

@@ -523,3 +523,4 @@ PLUGIN_ADMIN:
FRONTMATTER_IGNORE_FIELDS: "Ignore frontmatter fields"
FRONTMATTER_IGNORE_FIELDS_HELP: "Certain frontmatter fields may contain Twig but should not be processed, such as 'forms'"
PACKAGE_X_INSTALLED_SUCCESSFULLY: "Package %s installed successfully"
NEEDS_GRAV_1_1: "<strong>IMPORTANT</strong>: The Admin plugin version 1.1 <strong>requires Grav 1.1</strong>. You are running Grav 1.0. <strong>Update Grav now</strong>."