Przeglądaj źródła

More PhpDocumentor works

alex-brainstorm 21 lat temu
rodzic
commit
8d260fef9e
2 zmienionych plików z 56 dodań i 32 usunięć
  1. 11 11
      functions/imap_asearch.php
  2. 45 21
      src/search.php

+ 11 - 11
functions/imap_asearch.php

@@ -430,8 +430,8 @@ function sqimap_run_sort($imapConnection, $search_string, $search_charset, $sort
  * @param string $search_charset mandatory charset
  * @param string $search_charset mandatory charset
  * @param string $thread_algorithm the threading algorithm "ORDEREDSUBJECT" or "REFERENCES"
  * @param string $thread_algorithm the threading algorithm "ORDEREDSUBJECT" or "REFERENCES"
  * @return array an IDs or UIDs array of matching messages or an empty array
  * @return array an IDs or UIDs array of matching messages or an empty array
- * @global array $thread_new will be used by thread view in mailbox_display
- * @global array $server_sort_array will be used by thread view in mailbox_display
+ * @global array thread_new will be used by thread view in mailbox_display
+ * @global array server_sort_array will be used by thread view in mailbox_display
  */
  */
 function sqimap_run_thread($imapConnection, $search_string, $search_charset, $thread_algorithm)
 function sqimap_run_thread($imapConnection, $search_string, $search_charset, $thread_algorithm)
 {
 {
@@ -556,8 +556,8 @@ function sqimap_asearch_get_charset()
  * - reverse order by using REVERSE
  * - reverse order by using REVERSE
  * @param string $mailbox mailbox name to sort
  * @param string $mailbox mailbox name to sort
  * @param integer $sort_by sm sort criteria index
  * @param integer $sort_by sm sort criteria index
- * @global bool $internal_date_sort sort by arrival date instead of message date
- * @global string $sent_folder sent folder name
+ * @global bool internal_date_sort sort by arrival date instead of message date
+ * @global string sent_folder sent folder name
  * @return string imap sort criteria
  * @return string imap sort criteria
  */
  */
 function sqimap_asearch_get_sort_criteria($mailbox, $sort_by)
 function sqimap_asearch_get_sort_criteria($mailbox, $sort_by)
@@ -601,13 +601,13 @@ function sqimap_asearch_get_sub_mailboxes($cur_mailbox, $mboxes_array)
  * @param array $exclude_array
  * @param array $exclude_array
  * @param array $sub_array
  * @param array $sub_array
  * @param array $mboxes_array selectable unformatted mailboxes names
  * @param array $mboxes_array selectable unformatted mailboxes names
- * @global bool $allow_server_sort comes from config.php
- * @global integer $sort sm internal sort order
- * @global bool $allow_thread_sort comes from config.php
- * @global bool $thread_sort_messages does it really need to global?
- * @global integer $sort_by_ref thread by references
- * @global string $data_dir
- * @global string $username
+ * @global bool allow_server_sort comes from config.php
+ * @global integer sort sm internal sort order
+ * @global bool allow_thread_sort comes from config.php
+ * @global bool thread_sort_messages does it really need to global?
+ * @global integer sort_by_ref thread by references
+ * @global string data_dir
+ * @global string username
  * @return array $mbox_msgs array(mailbox => array(UIDs))
  * @return array $mbox_msgs array(mailbox => array(UIDs))
  */
  */
 function sqimap_asearch($imapConnection, $mailbox_array, $biop_array, $unop_array, $where_array, $what_array, $exclude_array, $sub_array, $mboxes_array)
 function sqimap_asearch($imapConnection, $mailbox_array, $biop_array, $unop_array, $where_array, $what_array, $exclude_array, $sub_array, $mboxes_array)

+ 45 - 21
src/search.php

@@ -303,7 +303,7 @@ function asearch_push_recent($data_dir, $username, $mailbox_array, $biop_array,
 
 
 /**
 /**
  * Edit a recent search
  * Edit a recent search
- * @global array $mailbox_array
+ * @global array mailbox_array searched mailboxes
  */
  */
 function asearch_edit_recent($data_dir, $username, $index)
 function asearch_edit_recent($data_dir, $username, $index)
 {
 {
@@ -785,26 +785,29 @@ $imap_asearch_biops = array(
 	'OR' => _("Or")
 	'OR' => _("Or")
 );
 );
 
 
-/*
-	unset : Enter key, or called from outside (eg read_body)
-	$search_button_text : Search button
-	'Search_no_update' : Search but don't update recent
-	'Search_last' : Same as no_update but reload and search last
-	'Search_silent' : Same as no_update but only display results
-	$add_criteria_button_text : Add New Criteria button
-	$del_excluded_button_text : Remove Excluded Criteria button
-	$del_all_button_text : Remove All Criteria button
-	'save_recent'
-	'search_recent'
-	'forget_recent'
-	'edit_saved'
-	'search_saved'
-	'delete_saved'
-*/
+/** How we did enter the form
+ * - unset : Enter key, or called from outside (eg read_body)
+ * - $search_button_text : Search button
+ * - 'Search_no_update' : Search but don't update recent
+ * - 'Search_last' : Same as no_update but reload and search last
+ * - 'Search_silent' : Same as no_update but only display results
+ * - $add_criteria_button_text : Add New Criteria button
+ * - $del_excluded_button_text : Remove Excluded Criteria button
+ * - $del_all_button_text : Remove All Criteria button
+ * - 'save_recent'
+ * - 'search_recent'
+ * - 'forget_recent'
+ * - 'edit_saved'
+ * - 'search_saved'
+ * - 'delete_saved'
+ * @global string $submit
+ */
 if (isset($_GET['submit']))
 if (isset($_GET['submit']))
 	$submit = strip_tags($_GET['submit']);
 	$submit = strip_tags($_GET['submit']);
 
 
-/* Used by search */
+/** Searched mailboxes
+ * @global array $mailbox_array
+ */
 if (isset($_GET['mailbox'])) {
 if (isset($_GET['mailbox'])) {
 	$mailbox_array = $_GET['mailbox'];
 	$mailbox_array = $_GET['mailbox'];
 	if (!is_array($mailbox_array))
 	if (!is_array($mailbox_array))
@@ -813,6 +816,9 @@ if (isset($_GET['mailbox'])) {
 else
 else
 	$mailbox_array = array();
 	$mailbox_array = array();
 
 
+/** Binary operators
+ * @global array $biop_array
+ */
 if (isset($_GET['biop'])) {
 if (isset($_GET['biop'])) {
 	$biop_array = $_GET['biop'];
 	$biop_array = $_GET['biop'];
 	if (!is_array($biop_array))
 	if (!is_array($biop_array))
@@ -821,6 +827,9 @@ if (isset($_GET['biop'])) {
 else
 else
 	$biop_array = array();
 	$biop_array = array();
 
 
+/** Unary operators
+ * @global array $unop_array
+ */
 if (isset($_GET['unop'])) {
 if (isset($_GET['unop'])) {
 	$unop_array = $_GET['unop'];
 	$unop_array = $_GET['unop'];
 	if (!is_array($unop_array))
 	if (!is_array($unop_array))
@@ -829,6 +838,9 @@ if (isset($_GET['unop'])) {
 else
 else
 	$unop_array = array();
 	$unop_array = array();
 
 
+/** Where to search
+ * @global array $where_array
+ */
 if (isset($_GET['where'])) {
 if (isset($_GET['where'])) {
 	$where_array = $_GET['where'];
 	$where_array = $_GET['where'];
 	if (!is_array($where_array))
 	if (!is_array($where_array))
@@ -837,6 +849,9 @@ if (isset($_GET['where'])) {
 else
 else
 	$where_array = array();
 	$where_array = array();
 
 
+/** What to search
+ * @global array $what_array
+ */
 if (isset($_GET['what'])) {
 if (isset($_GET['what'])) {
 	$what_array = $_GET['what'];
 	$what_array = $_GET['what'];
 	if (!is_array($what_array))
 	if (!is_array($what_array))
@@ -845,21 +860,29 @@ if (isset($_GET['what'])) {
 else
 else
 	$what_array = array();
 	$what_array = array();
 
 
+/** Whether to exclude this criteria from search
+ * @global array $exclude_array
+ */
 if (isset($_GET['exclude']))
 if (isset($_GET['exclude']))
 	$exclude_array = $_GET['exclude'];
 	$exclude_array = $_GET['exclude'];
 else
 else
 	$exclude_array = array();
 	$exclude_array = array();
 
 
+/** Search within subfolders
+ * @global array $sub_array
+ */
 if (isset($_GET['sub']))
 if (isset($_GET['sub']))
 	$sub_array = $_GET['sub'];
 	$sub_array = $_GET['sub'];
 else
 else
 	$sub_array = array();
 	$sub_array = array();
 
 
-/* Used by recent and saved stuff */
+/** Row number used by recent and saved stuff
+ */
 if (isset($_GET['rownum']))
 if (isset($_GET['rownum']))
     $submit_rownum = strip_tags($_GET['rownum']);
     $submit_rownum = strip_tags($_GET['rownum']);
 
 
-/* Change global sort */
+/** Change global sort
+ */
 if (sqgetGlobalVar('newsort', $newsort, SQ_GET)) {
 if (sqgetGlobalVar('newsort', $newsort, SQ_GET)) {
 	setPref($data_dir, $username, 'sort', $newsort);
 	setPref($data_dir, $username, 'sort', $newsort);
 	$sort = $newsort;
 	$sort = $newsort;
@@ -867,7 +890,8 @@ if (sqgetGlobalVar('newsort', $newsort, SQ_GET)) {
 	asearch_edit_last($data_dir, $username);
 	asearch_edit_last($data_dir, $username);
 }
 }
 
 
-/* Change mailbox threading */
+/** Change mailbox threading
+ */
 if (sqgetGlobalVar('set_thread', $set_thread, SQ_GET)) {
 if (sqgetGlobalVar('set_thread', $set_thread, SQ_GET)) {
 	setPref($data_dir, $username, 'thread_' . $mailbox_array[0], ($set_thread == 1) ? 1 : 0 );
 	setPref($data_dir, $username, 'thread_' . $mailbox_array[0], ($set_thread == 1) ? 1 : 0 );
 	asearch_edit_last($data_dir, $username);
 	asearch_edit_last($data_dir, $username);