[Svn] r3076 - in trunk/roundcubemail: plugins/archive plugins/markasjunk program/include

trac at roundcube.net trac at roundcube.net
Wed Oct 28 23:53:40 CET 2009


Author: thomasb
Date: 2009-10-28 17:53:40 -0500 (Wed, 28 Oct 2009)
New Revision: 3076

Modified:
   trunk/roundcubemail/plugins/archive/archive.php
   trunk/roundcubemail/plugins/markasjunk/markasjunk.php
   trunk/roundcubemail/program/include/rcube_plugin.php
Log:
Add fallback to default skin if the selected one is not available in plugin directory

Modified: trunk/roundcubemail/plugins/archive/archive.php
===================================================================
--- trunk/roundcubemail/plugins/archive/archive.php	2009-10-28 18:37:59 UTC (rev 3075)
+++ trunk/roundcubemail/plugins/archive/archive.php	2009-10-28 22:53:40 UTC (rev 3076)
@@ -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(

Modified: trunk/roundcubemail/plugins/markasjunk/markasjunk.php
===================================================================
--- trunk/roundcubemail/plugins/markasjunk/markasjunk.php	2009-10-28 18:37:59 UTC (rev 3075)
+++ trunk/roundcubemail/plugins/markasjunk/markasjunk.php	2009-10-28 22:53:40 UTC (rev 3076)
@@ -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(

Modified: trunk/roundcubemail/program/include/rcube_plugin.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_plugin.php	2009-10-28 18:37:59 UTC (rev 3075)
+++ trunk/roundcubemail/program/include/rcube_plugin.php	2009-10-28 22:53:40 UTC (rev 3076)
@@ -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

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list