thomascube
2009-10-28 01accaff5b52d8fa53a1821d452f265aef67cef1
Add fallback to default skin if the selected one is not available in plugin directory

3 files modified
20 ■■■■ changed files
plugins/archive/archive.php 4 ●●●● patch | view | raw | blame | history
plugins/markasjunk/markasjunk.php 2 ●●● patch | view | raw | blame | history
program/include/rcube_plugin.php 14 ●●●●● patch | view | raw | blame | history
plugins/archive/archive.php
@@ -24,8 +24,8 @@
    if ($rcmail->task == 'mail' && ($rcmail->action == '' || $rcmail->action == 'show')
      && ($archive_folder = $rcmail->config->get('archive_mbox'))) {
      $skin_path = 'skins/'.$rcmail->output->config['skin'];
      $skin_path = $this->local_skin_path();
      $this->include_script('archive.js');
      $this->add_texts('localization', true);
      $this->add_button(
plugins/markasjunk/markasjunk.php
@@ -19,7 +19,7 @@
    
    $rcmail = rcmail::get_instance();
    if ($rcmail->action == '' || $rcmail->action == 'show') {
      $skin_path = 'skins/'.$rcmail->output->config['skin'];
      $skin_path = $this->local_skin_path();;
      $this->include_script('markasjunk.js');
      $this->add_texts('localization', true);
      $this->add_button(array(
program/include/rcube_plugin.php
@@ -231,6 +231,20 @@
    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