diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2020-09-25 21:18:18 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2020-09-25 21:28:55 +0200 |
commit | 378881378aab5454c84cb1fecbbcc675f64dc27f (patch) | |
tree | f8bbe239c2a87cc61bec05b987099e4401dd2693 /ratatoeskr/sys/plugin_api.php | |
parent | 78c0350b3b7fc025ba565e19bfa195b68e95bb88 (diff) | |
download | ratatoeskr-cms-378881378aab5454c84cb1fecbbcc675f64dc27f.tar.gz ratatoeskr-cms-378881378aab5454c84cb1fecbbcc675f64dc27f.tar.bz2 ratatoeskr-cms-378881378aab5454c84cb1fecbbcc675f64dc27f.zip |
Refactor textprocessors
They are now managed by TextprocessorRepository and are instances of
Textprocessor. This replaces the global $textprocessors variable.
Diffstat (limited to 'ratatoeskr/sys/plugin_api.php')
-rw-r--r-- | ratatoeskr/sys/plugin_api.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ratatoeskr/sys/plugin_api.php b/ratatoeskr/sys/plugin_api.php index c286fdc..b85ce57 100644 --- a/ratatoeskr/sys/plugin_api.php +++ b/ratatoeskr/sys/plugin_api.php @@ -10,6 +10,8 @@ */ use r7r\ste\STECore; +use r7r\cms\sys\Env; +use r7r\cms\sys\textprocessors\LegacyTextprocessor; require_once(dirname(__FILE__) . "/models.php"); require_once(dirname(__FILE__) . "/textprocessors.php"); @@ -50,6 +52,9 @@ abstract class RatatoeskrPlugin { private $id; + /** @var Env */ + private $env; + /** @var PluginKVStorage The Key-Value-Storage for the Plugin */ protected $kvstorage; @@ -70,6 +75,7 @@ abstract class RatatoeskrPlugin global $ste, $rel_path_to_root; $this->id = $id; + $this->env = Env::getGlobal(); $this->kvstorage = new PluginKVStorage($id); $this->ste = $ste; $this->rel_path_to_root = $rel_path_to_root; @@ -151,7 +157,7 @@ abstract class RatatoeskrPlugin */ final protected function register_textprocessor($name, $fx, $visible_in_backend=true) { - textprocessor_register($name, $fx, $visible_in_backend); + $this->env->textprocessors()->register($name, new LegacyTextprocessor($fx, (bool)$visible_in_backend)); } /** |