<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>hook msglist_format</title> 
  <pubDate>Fri, 10 Apr 2026 13:16:50 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7891</link> 
  <atom:link rel="self" type="application/rss+xml" title="hook msglist_format" href="https://bugs.horde.org/ticket/7891/rss" /> 
  <description>hook msglist_format</description> 
 
   
   
  <item> 
   <title>I&#039;m getting the following warnings when enabling $conf[hooks</title> 
   <description>I&#039;m getting the following warnings when enabling $conf[hooks][msglist_format]



Notice: Undefined index: status in /var/www/html/horde/imp/config/hooks.php on line 245

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/html/horde/imp/mailbox.php on line 26



patches: 

--- hooks.php.org	2009-01-26 12:21:21.000000000 +0100

+++ hooks.php	2009-01-26 12:25:22.000000000 +0100

@@ -220,7 +220,8 @@

         foreach ($uids as $uid) {

             $tmp = array();

             $res_ptr = &amp;$imap_res[$uid];

-			

+            $tmp[&#039;status&#039;];

+

             // Add attachment information

             if (($attachment = $imp_ui-&gt;getAttachmentType($res_ptr[&#039;structure&#039;]-&gt;getType()))) {

                 switch ($mode) {



--- mailbox.php.org	2009-01-26 12:22:58.000000000 +0100

+++ mailbox.php	2009-01-26 12:26:31.000000000 +0100

@@ -23,7 +23,8 @@

             $ptr = &amp;$msgs[$uid];

 

             if (!empty($val[&#039;class&#039;])) {

-                $ptr[&#039;bg&#039;] = array_merge($ptr[&#039;bg&#039;], $val[&#039;class&#039;]);

+                $tmp[&#039;bg&#039;] = $ptr[&#039;bg&#039;];

+                $ptr[&#039;bg&#039;] = array_merge($tmp, $val[&#039;class&#039;]);

             }

 

             if (!empty($val[&#039;flagbits&#039;])) {

</description> 
   <pubDate>Mon, 26 Jan 2009 11:26:53 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7891#t51959</link> 
  </item> 
   
  <item> 
   <title> --- hooks.php.org	2009-01-26 12:21:21.000000000 +0100

 +++</title> 
   <description> --- hooks.php.org	2009-01-26 12:21:21.000000000 +0100

 +++ hooks.php	2009-01-26 12:25:22.000000000 +0100

 @@ -220,7 +220,8 @@

          foreach ($uids as $uid) {

              $tmp = array();

              $res_ptr = &amp;$imap_res[$uid];

 -

 +            $tmp[&#039;status&#039;] = &#039;&#039;;

 +

              // Add attachment information

              if (($attachment = 

 $imp_ui-&gt;getAttachmentType($res_ptr[&#039;structure&#039;]-&gt;getType()))) {

                  switch ($mode) {

</description> 
   <pubDate>Mon, 26 Jan 2009 11:30:33 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7891#t51960</link> 
  </item> 
   
  <item> 
   <title>You are either not using IMP git, or you have not updated yo</title> 
   <description>You are either not using IMP git, or you have not updated your hooks.php file.</description> 
   <pubDate>Tue, 27 Jan 2009 19:07:09 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7891#t52009</link> 
  </item> 
   
  <item> 
   <title>&gt; You are either not using IMP git, or you have not updated </title> 
   <description>&gt; You are either not using IMP git, or you have not updated your 

&gt; hooks.php file.



I do use imp from horde-hatchery

more horde/imp/docs/CHANGES

--------

v5.0-git

--------



[mms] Add ability to download attachments in MIMP (Request #2925).

[mms] Revamp JS event handling model.

[mms] ESC in DIMP search box now clears the search (Request #7196).

[mms] Enhancements to status icon view (Request #7519) (DIMP).

...





Here is the msglist_format hook (this is the only hook activated):



if (!function_exists(&#039;_imp_hook_msglist_format&#039;)) {

    function _imp_hook_msglist_format($mbox, $uids, $mode)

    {

        try {

            $imap_res = $GLOBALS[&#039;imp_imap&#039;]-&gt;ob-&gt;fetch($mbox, array(

                Horde_Imap_Client::FETCH_HEADERS =&gt; array(array(&#039;headers&#039; =&gt; array(&#039;x-priority&#039;), &#039;label&#039; =&gt; &#039;hdr_search&#039;, &#039;parse&#039; =&gt; true, &#039;peek&#039; =&gt; true)),

                Horde_Imap_Client::FETCH_STRUCTURE =&gt; array(&#039;parse&#039; =&gt; true)

            ), array(&#039;ids&#039; =&gt; array_values($uids)));

        } catch (Horde_Imap_Client_Exception $e) {

            return array();

        }



        $alt_list = IMP_UI_Mailbox::getAttachmentAltList();

        $imp_ui = new IMP_UI_Mailbox($mbox);

        $imp_msg_ui = new IMP_UI_Message();

        $ret = array();



        foreach ($uids as $uid) {

            $tmp = array();

            $res_ptr = &amp;$imap_res[$uid];

            $tmp[&#039;status&#039;] = &#039;&#039;;



            // Add attachment information

            if (($attachment = $imp_ui-&gt;getAttachmentType($res_ptr[&#039;structure&#039;]-&gt;getType()))) {

                switch ($mode) {

                case &#039;imp&#039;:

                    $alt_text = (isset($alt_list[$attachment]))

                        ? $alt_list[$attachment]

                        : $alt_list[&#039;attachment&#039;];

                    $tmp[&#039;status&#039;] = Horde::img($attachment . &#039;.png&#039;, $alt_text, array(&#039;title&#039; =&gt; $alt_text));

                    break;



                case &#039;dimp&#039;:

                    $tmp[&#039;atc&#039;] = $attachment;

                    break;

                }

            }



            // Add X-Priority information

            switch ($imp_msg_ui-&gt;getXpriority($res_ptr[&#039;headers&#039;][&#039;hdr_search&#039;]-&gt;getValue(&#039;x-priority&#039;))) {

            case &#039;high&#039;:

                if ($mode == &#039;imp&#039;) {

                    $tmp[&#039;flagbits&#039;] = IMP::FLAG_FLAGGED;

                    $tmp[&#039;status&#039;] .= Horde::img(&#039;mail_priority_high.png&#039;, _(&quot;High Priority&quot;), array(&#039;title&#039; =&gt; _(&quot;High Priority&quot;)));

                }

                $tmp[&#039;class&#039;][] = &#039;important&#039;;

                break;



            case &#039;low&#039;:

                if ($mode == &#039;imp&#039;) {

                    $tmp[&#039;status&#039;] .= Horde::img(&#039;mail_priority_low.png&#039;, _(&quot;Low Priority&quot;), array(&#039;title&#039; =&gt; _(&quot;Low Priority&quot;)));

                }

                $tmp[&#039;class&#039;][] = &#039;unimportant&#039;;

                break;

            }



            if (!empty($tmp)) {

                $ret[$uid] = $tmp;

            }

        }



        return $ret;

    }

}</description> 
   <pubDate>Wed, 28 Jan 2009 08:28:53 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7891#t52040</link> 
  </item> 
   
  <item> 
   <title>Also,

in configuration tab  &#039;Dynamic View (dimp) Options&#039; 
</title> 
   <description>Also,

in configuration tab  &#039;Dynamic View (dimp) Options&#039; 

$conf[dimp][hooks][msglist_format]  = Should we use a custom function to provide additional information/custom formatting of messages in the mailbox message list? If so, make sure you define _dimp_hook_msglist_format() in config/hooks.php.





Is it using _dimp_hook_msglist_format() or _imp_hook_msglist_format() ? Typo ?



</description> 
   <pubDate>Wed, 28 Jan 2009 08:38:42 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7891#t52041</link> 
  </item> 
   
  <item> 
   <title>Guess I must have grepped the wrong file.  Regardless, the f</title> 
   <description>Guess I must have grepped the wrong file.  Regardless, the fixes listed in this ticket aren&#039;t correct - I have fixed the issues in Git master.</description> 
   <pubDate>Thu, 29 Jan 2009 17:21:07 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7891#t52100</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git for this ticket:

Bug #7891: F</title> 
   <description>Changes have been made in Git for this ticket:

Bug #7891: Fix some dimp-&gt;imp hook conversion issues.

 create mode 100644 imp/templates/index/index-dimp.inc
 delete mode 100644 imp/templates/index/index.inc
http://git.horde.org/diff.php/imp/config/conf.xml?rt=horde-git&amp;r1=6a839412944d9486aceb6da1022209b4576e3a0b&amp;r2=c4120b38445a72b10568e2627c88f6de27ec16e6
http://git.horde.org/diff.php/imp/config/hooks.php.dist?rt=horde-git&amp;r1=b8e9f72e5b48e3cd101bfd5263e6ecf3c0dd3d18&amp;r2=c4120b38445a72b10568e2627c88f6de27ec16e6
http://git.horde.org/diff.php/imp/index-dimp.php?rt=horde-git&amp;r1=2813aaf25aa91219930609fa899932116e2f0771&amp;r2=c4120b38445a72b10568e2627c88f6de27ec16e6
http://git.horde.org/diff.php/imp/mailbox.php?rt=horde-git&amp;r1=d81811acb02d3754c4061e0cf3a6c86c9b851dd8&amp;r2=c4120b38445a72b10568e2627c88f6de27ec16e6
http://git.horde.org/co.php/imp/templates/index/index-dimp.inc?rt=horde-git&amp;r=c4120b38445a72b10568e2627c88f6de27ec16e6
http://git.horde.org/diff.php/imp/templates/index/index.inc?rt=horde-git&amp;r1=d9721f070d090c24bfdb2face6ecfa871d853a02&amp;r2=c4120b38445a72b10568e2627c88f6de27ec16e6</description> 
   <pubDate>Tue, 12 Jan 2010 23:58:17 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7891#t57502</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
