From 46f7b7096450939fe03c95aa81ce06ae4bfca89d Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 28 Mar 2016 06:51:43 -0400
Subject: [PATCH] Enable reply/reply-all/forward buttons also in preview frame of message/rfc822

---
 program/include/rcmail_utils.php |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/program/include/rcmail_utils.php b/program/include/rcmail_utils.php
index cc2ff73..6de4f18 100644
--- a/program/include/rcmail_utils.php
+++ b/program/include/rcmail_utils.php
@@ -1,6 +1,6 @@
 <?php
 
-/*
+/**
  +-----------------------------------------------------------------------+
  | program/include/rcmail_utils.php                                      |
  |                                                                       |
@@ -327,8 +327,9 @@
      * @param string Option name
      * @param string Option value
      * @param int    Optional user identifier
+     * @param string Optional value type (bool, int, string)
      */
-    public static function mod_pref($name, $value, $userid = null)
+    public static function mod_pref($name, $value, $userid = null, $type = 'string')
     {
         $db = self::db();
 
@@ -339,6 +340,15 @@
             $query = '1=1';
         }
 
+        $type = strtolower($type);
+
+        if ($type == 'bool' || $type == 'boolean') {
+            $value = rcube_utils::get_boolean($value);
+        }
+        else if ($type == 'int' || $type == 'integer') {
+            $value = (int) $value;
+        }
+
         // iterate over all users
         $sql_result = $db->query("SELECT * FROM " . $db->table_name('users', true) . " WHERE $query");
 

--
Gitblit v1.9.1