ORIENT/plugins/tps/reklama/Plugin.php

51 lines
1.2 KiB
PHP
Raw Normal View History

2021-04-01 06:04:39 +00:00
<?php namespace Tps\Reklama;
use System\Classes\PluginBase;
class Plugin extends PluginBase
{
public function registerComponents()
{
return [
'Tps\Reklama\Components\Advertisement' => 'adverts',
];
}
public function registerSettings()
{
}
2021-04-08 08:08:59 +00:00
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']
]
];
}
2021-04-29 12:56:22 +00:00
public function registerMarkupTags() {
return [
'filters' => [
// A global function, i.e str_plural()
'mediator' => [$this, 'absoluteMediaUrl'],
],
];
}
public function absoluteMediaUrl($file) {
2021-04-29 13:10:05 +00:00
$original = \System\Classes\MediaLibrary::url($file);
2021-04-29 12:56:22 +00:00
// modify here and return
2021-04-29 13:10:05 +00:00
return Config::get('cms.linkPolicy').$original;
2021-04-29 12:56:22 +00:00
}
2021-04-01 06:04:39 +00:00
}