From 5328c11135888671be7b952ab76069f8d34dbb78 Mon Sep 17 00:00:00 2001 From: thomasb Date: Wed, 28 Oct 2009 22:53:40 +0000 Subject: Add fallback to default skin if the selected one is not available in plugin directory git-svn-id: https://svn.roundcube.net/trunk@3076 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/include/rcube_plugin.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'roundcubemail/program/include/rcube_plugin.php') diff --git a/roundcubemail/program/include/rcube_plugin.php b/roundcubemail/program/include/rcube_plugin.php index 5e37764c4..ed30e8f17 100644 --- a/roundcubemail/program/include/rcube_plugin.php +++ b/roundcubemail/program/include/rcube_plugin.php @@ -231,6 +231,20 @@ abstract class rcube_plugin else return $fn; } + + /** + * Provide path to the currently selected skin folder within the plugin directory + * with a fallback to the default skin folder. + * + * @return string Skin path relative to plugins directory + */ + protected function local_skin_path() + { + $skin_path = 'skins/'.$this->api->output->config['skin']; + if (!is_dir(realpath(slashify($this->home) . $skin_path))) + $skin_path = 'skins/default'; + return $skin_path; + } /** * Callback function for array_map -- cgit v1.2.3