diff --git a/lib/AbstractPicoPlugin.php b/lib/AbstractPicoPlugin.php index 144170f..bdfaf9c 100644 --- a/lib/AbstractPicoPlugin.php +++ b/lib/AbstractPicoPlugin.php @@ -193,6 +193,30 @@ abstract class AbstractPicoPlugin implements PicoPluginInterface return isset($pluginConfig[$configName]) ? $pluginConfig[$configName] : $default; } + /** + * Passes all not satisfiable method calls to Pico + * + * @see PicoPluginInterface::getPico() + * + * @deprecated 2.1.0 + * + * @param string $methodName name of the method to call + * @param array $params parameters to pass + * + * @return mixed return value of the called method + */ + public function __call($methodName, array $params) + { + if (method_exists($this->getPico(), $methodName)) { + return call_user_func_array(array($this->getPico(), $methodName), $params); + } + + throw new BadMethodCallException( + 'Call to undefined method ' . get_class($this->getPico()) . '::' . $methodName . '() ' + . 'through ' . get_called_class() . '::__call()' + ); + } + /** * Enables all plugins which this plugin depends on * diff --git a/lib/Pico.php b/lib/Pico.php index 663a413..f92d9eb 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -2373,6 +2373,20 @@ class Pico return substr($path, $contentDirLength, -$contentExtLength) ?: null; } + /** + * Returns the URL of the themes folder of this Pico instance + * + * @see Pico::getUrlFromPath() + * + * @deprecated 2.1.0 + * + * @return string + */ + public function getBaseThemeUrl() + { + return $this->getConfig('themes_url'); + } + /** * Substitutes URL placeholders (e.g. %base_url%) *