mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 11:26:04 +01:00
Support for Premium Resources (#809)
* Initial premium preparation for licenses and gpm handling * Premium styling * Removed unused import * Synced CSS * Updated selectize
This commit is contained in:
@@ -5,6 +5,7 @@ use DateTime;
|
||||
use Grav\Common\Data;
|
||||
use Grav\Common\File\CompiledYamlFile;
|
||||
use Grav\Common\GPM\GPM;
|
||||
use Grav\Common\GPM\Licenses;
|
||||
use Grav\Common\GPM\Response;
|
||||
use Grav\Common\Grav;
|
||||
use Grav\Common\Language\LanguageCodes;
|
||||
@@ -472,7 +473,7 @@ class Admin
|
||||
*
|
||||
* @param bool $local
|
||||
*
|
||||
* @return array
|
||||
* @return mixed
|
||||
*/
|
||||
public function plugins($local = true)
|
||||
{
|
||||
@@ -500,6 +501,11 @@ class Admin
|
||||
return $package;
|
||||
}
|
||||
|
||||
public function license($package_slug)
|
||||
{
|
||||
return Licenses::get($package_slug);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an array of dependencies for a package, used to generate a list of
|
||||
* packages that can be removed when removing a package.
|
||||
@@ -932,6 +938,22 @@ class Admin
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the plugin or theme info passed is premium
|
||||
*
|
||||
* @param object $info Plugin or Theme info object
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isPremiumProduct($info)
|
||||
{
|
||||
if (isset($info['premium'])) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders phpinfo
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user