| | |
| | | | Author: Thomas Bruederli <roundcube@gmail.com> | |
| | | +-----------------------------------------------------------------------+ |
| | | |
| | | $Id: $ |
| | | $Id$ |
| | | |
| | | */ |
| | | |
| | |
| | | { |
| | | $fpath = $this->home.'/'.$fname; |
| | | $rcmail = rcmail::get_instance(); |
| | | if (!$rcmail->config->load_from_file($fpath)) { |
| | | if (is_file($fpath) && !$rcmail->config->load_from_file($fpath, false)) { |
| | | raise_error(array('code' => 527, 'type' => 'php', 'message' => "Failed to load config from $fpath"), true, false); |
| | | return false; |
| | | } |
| | |
| | | $this->api->add_content($this->api->output->button($p), $container); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Generate an absolute URL to the given resource within the current |
| | | * plugin directory |
| | | * |
| | | * @param string The file name |
| | | * @return string Absolute URL to the given resource |
| | | */ |
| | | public function url($fn) |
| | | { |
| | | return $this->api->url . $this->resource_url($fn); |
| | | } |
| | | |
| | | /** |
| | | * Make the given file name link into the plugin directory |
| | |
| | | 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 |