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:
Djamil Legato
2016-10-13 10:13:18 -07:00
committed by GitHub
parent d3556255c2
commit 02eeca78e8
16 changed files with 110 additions and 15 deletions

View File

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