2021-01-02 22:06:56 +00:00
|
|
|
<?php namespace JasonWilliams\ImgCache;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The plugin.php file (called the plugin initialization script) defines the plugin information class.
|
|
|
|
*/
|
|
|
|
|
|
|
|
use System\Classes\PluginBase;
|
2021-01-03 01:31:29 +00:00
|
|
|
use JasonWilliams\ImgCache\Classes\Image;
|
2021-01-02 22:06:56 +00:00
|
|
|
|
|
|
|
class Plugin extends PluginBase
|
|
|
|
{
|
|
|
|
|
|
|
|
public function pluginDetails()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'name' => 'Image Cache',
|
|
|
|
'description' => 'Saves external images locally and presents them via a twig filter.',
|
|
|
|
'author' => 'Jason Williams',
|
|
|
|
'icon' => 'oc-icon-cloud'
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function registerMarkupTags()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'filters' => [
|
|
|
|
'imgcache' => function($imgurl) {
|
2021-01-03 01:31:29 +00:00
|
|
|
$image = new Image($imgurl);
|
|
|
|
return $image;
|
2021-01-02 22:06:56 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|