52 lines
1.2 KiB
PHP
52 lines
1.2 KiB
PHP
<?php namespace Tps\Reklama;
|
|
|
|
use Config;
|
|
use System\Classes\PluginBase;
|
|
|
|
class Plugin extends PluginBase
|
|
{
|
|
public function registerComponents()
|
|
{
|
|
return [
|
|
'Tps\Reklama\Components\Advertisement' => 'adverts',
|
|
];
|
|
}
|
|
|
|
public function registerSettings()
|
|
{
|
|
}
|
|
public function registerPermissions()
|
|
{
|
|
return [
|
|
'tps.reklama.statistics' => [
|
|
'tab' => 'Reklama',
|
|
'label' => 'statistika',
|
|
'order' => 100,
|
|
'roles' => ['developer']
|
|
],
|
|
'tps.reklama.adverts' => [
|
|
'tab' => 'Reklama',
|
|
'label' => 'reklamalar',
|
|
'order' => 200,
|
|
'roles' => ['developer']
|
|
]
|
|
];
|
|
}
|
|
|
|
public function registerMarkupTags() {
|
|
return [
|
|
'filters' => [
|
|
// A global function, i.e str_plural()
|
|
'media_cdn' => [$this, 'absoluteMediaUrl'],
|
|
],
|
|
];
|
|
}
|
|
|
|
public function absoluteMediaUrl($file) {
|
|
$original = \System\Classes\MediaLibrary::url($file);
|
|
|
|
// modify here and return
|
|
return Config::get('cms.cdn').$original;
|
|
}
|
|
}
|