From 1a0f60b332b254b130a830d0d8f5bf9ab4223324 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 09 Dec 2011 04:38:34 -0500
Subject: [PATCH] Allow custom content (from config dir) showing up on the about page

---
 program/include/rcube_template.php |   25 +++++++++++++++++++++++++
 skins/default/templates/about.html |    1 +
 2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php
index 433b22a..06503f2 100755
--- a/program/include/rcube_template.php
+++ b/program/include/rcube_template.php
@@ -94,6 +94,7 @@
             'username'        => array($this, 'current_username'),
             'message'         => array($this, 'message_container'),
             'charsetselector' => array($this, 'charset_selector'),
+            'aboutcontent'    => array($this, 'about_content'),
         ));
     }
 
@@ -1335,6 +1336,30 @@
         return $select->show($set);
     }
 
+    /**
+     * Include content from config/about.<LANG>.html if available
+     */
+    private function about_content($attrib)
+    {
+        $content = '';
+        $filenames = array(
+            'about.' . $_SESSION['language'] . '.html',
+            'about.' . substr($_SESSION['language'], 0, 2) . '.html',
+            'about.html',
+        );
+        foreach ($filenames as $file) {
+            $fn = RCMAIL_CONFIG_DIR . '/' . $file;
+            if (is_readable($fn)) {
+                $content = file_get_contents($fn);
+                $content = $this->parse_conditions($content);
+                $content = $this->parse_xml($content);
+                break;
+            }
+        }
+
+        return $content;
+    }
+
 }  // end class rcube_template
 
 
diff --git a/skins/default/templates/about.html b/skins/default/templates/about.html
index 1af7bea..2a78d51 100644
--- a/skins/default/templates/about.html
+++ b/skins/default/templates/about.html
@@ -14,6 +14,7 @@
 <div id="mainscreen" class="box darkbg crop">
 <div class="readtext">
 <div id="license">
+<roundcube:object name="aboutcontent" />
 <h2 class="sysname">Roundcube Webmail <roundcube:object name="version" /></h2>
 <p class="copyright">Copyright &copy; 2005-2011, The Roundcube Dev Team</p>
 <p class="license">This program is free software; you can redistribute it and/or modify

--
Gitblit v1.9.1