Browse Source

general cleanup

Thijs Kinkhorst 19 years ago
parent
commit
cb5833a4e3
2 changed files with 5 additions and 51 deletions
  1. 2 43
      functions/imap_asearch.php
  2. 3 8
      src/search.php

+ 2 - 43
functions/imap_asearch.php

@@ -121,23 +121,7 @@ function sqimap_asearch_error_box($response, $query, $message, $link = '')
     else
     else
         $message_title = _("Possible reason:");
         $message_title = _("Possible reason:");
     $message_title .= ' ';
     $message_title .= ' ';
-    if (function_exists('sqimap_error_box'))
-        sqimap_error_box($title, $query, $message_title, $message, $link);
-    else {    //Straight copy of 1.5 imap_general.php:sqimap_error_box(). Can be removed at a later time
-        global $color;
-    require_once(SM_PATH . 'functions/display_messages.php');
-    $string = "<font color=\"$color[2]\"><b>\n" . $title . "</b><br />\n";
-    if ($query != '')
-        $string .= _("Query:") . ' ' . htmlspecialchars($query) . '<br />';
-    if ($message_title != '')
-        $string .= $message_title;
-    if ($message != '')
-        $string .= htmlspecialchars($message);
-    if ($link != '')
-        $string .= $link;
-    $string .= "</font><br />\n";
-    error_box($string,$color);
-    }
+    sqimap_error_box($title, $query, $message_title, $message, $link);
 }
 }
 
 
 /**
 /**
@@ -170,31 +154,6 @@ function asearch_unhtmlentities($string) {
  */
  */
 }
 }
 
 
-/**
- * Provide an easy way to dump the IMAP dialogue if $imap_asearch_debug_dump is TRUE
- * @global bool imap_asearch_debug_dump
- * @param string $var_name
- * @param string $var_var
- * @deprecated contains workarounds for 1.4.0 and older code.
- *   code without workarounds uses regular sm 1.4.2+ functions.
- *   it is not compatible with 1.4.1
- * @todo remove debugging function
- */
-function s_debug_dump($var_name, $var_var)
-{
-    global $imap_asearch_debug_dump;
-    if ($imap_asearch_debug_dump) {
-        if (function_exists('sm_print_r'))      //Only exists since 1.4.2
-            sm_print_r($var_name, $var_var);    //Better be the 'varargs' version ;)
-        else {
-            echo '<pre>';
-            echo htmlentities($var_name);
-            print_r($var_var);
-            echo '</pre>';
-        }
-    }
-}
-
 /** Encode a string to quoted or literal as defined in rfc 3501
 /** Encode a string to quoted or literal as defined in rfc 3501
  *
  *
  * -  4.3 String:
  * -  4.3 String:
@@ -529,4 +488,4 @@ function sqimap_asearch($imapConnection, &$mailbox_array, &$biop_array, &$unop_a
     return ($mbox_search);
     return ($mbox_search);
 }
 }
 
 
-?>
+?>

+ 3 - 8
src/search.php

@@ -728,12 +728,10 @@ function asearch_get_form_mailbox($imapConnection, &$boxes, $mailbox, $row_num =
 }
 }
 
 
 /** Build the Include subfolders checkbox
 /** Build the Include subfolders checkbox
- * @todo if(function_exists('addCheckBox')) ?
  */
  */
 function asearch_get_form_sub($sub, $row_num = 0)
 function asearch_get_form_sub($sub, $row_num = 0)
 {
 {
-    return function_exists('addCheckBox') ? addCheckBox('sub[' . $row_num .']', $sub)
-    : '<input type="checkbox" name="sub[' . $row_num .']"' . ($sub ? ' checked="checked"' : '') . ' />';
+    return addCheckBox('sub[' . $row_num .']', $sub);
 }
 }
 
 
 /** Build the 2 unop and where selects
 /** Build the 2 unop and where selects
@@ -750,17 +748,14 @@ function asearch_get_form_location($unop, $where, $row_num = 0)
  */
  */
 function asearch_get_form_what($what, $row_num = 0)
 function asearch_get_form_what($what, $row_num = 0)
 {
 {
-    return function_exists('addInput') ? addInput('what[' . $row_num . ']', $what, '35')
-    : '<input type="text" size="35" name="what[' . $row_num . ']" value="' . htmlspecialchars($what) . '" />';
+    return addInput('what[' . $row_num . ']', $what, '35');
 }
 }
 
 
 /** Build the Exclude criteria checkbox
 /** Build the Exclude criteria checkbox
- * @todo if(function_exists('addCheckBox')) ?
  */
  */
 function asearch_get_form_exclude($exclude, $row_num = 0)
 function asearch_get_form_exclude($exclude, $row_num = 0)
 {
 {
-    return function_exists('addCheckBox') ? addCheckBox('exclude['.$row_num.']', $exclude)
-    : '<input type="checkbox" name="exclude[' . $row_num .']"' . ($exclude ? ' checked="checked"' : '') . ' />';
+    return addCheckBox('exclude['.$row_num.']', $exclude);
 }
 }
 
 
 /** Print one advanced form row
 /** Print one advanced form row