Subversion Repositories oidplus

Rev

Rev 1116 | Rev 1201 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1116 Rev 1130
Line 37... Line 37...
37
                        }
37
                        }
38
                });
38
                });
39
        }
39
        }
40
 
40
 
41
        /**
41
        /**
42
         * @param $params
42
         * @param array $params
43
         * @param $is_searching
43
         * @param bool $is_searching
44
         * @return void
44
         * @return void
45
         */
45
         */
46
        private function prepareSearchParams(&$params, $is_searching) {
46
        private function prepareSearchParams(array &$params, bool $is_searching) {
47
                $params['term'] = isset($params['term']) ? trim($params['term']) : '';
47
                $params['term'] = isset($params['term']) ? trim($params['term']) : '';
48
                $params['namespace'] = isset($params['namespace']) ? trim($params['namespace']) : '';
48
                $params['namespace'] = isset($params['namespace']) ? trim($params['namespace']) : '';
49
 
49
 
50
                // Default criteria selection:
50
                // Default criteria selection:
51
                if ($is_searching) {
51
                if ($is_searching) {
Line 60... Line 60...
60
                        $params['search_iri'] = true;
60
                        $params['search_iri'] = true;
61
                }
61
                }
62
        }
62
        }
63
 
63
 
64
        /**
64
        /**
65
         * @param $html
65
         * @param string $html
66
         * @param $term
66
         * @param string $term
67
         * @return array|string|string[]
67
         * @return string
68
         */
68
         */
69
        private function highlight_match($html, $term) {
69
        private function highlight_match(string $html, string $term): string {
70
                return str_replace(htmlentities($term), '<font color="red">'.htmlentities($term).'</font>', $html);
70
                return str_replace(htmlentities($term), '<font color="red">'.htmlentities($term).'</font>', $html);
71
        }
71
        }
72
 
72
 
73
        /**
73
        /**
74
         * @param $params
74
         * @param array $params
75
         * @return string
75
         * @return string
76
         * @throws OIDplusException
76
         * @throws OIDplusException
77
         */
77
         */
78
        private function doSearch($params) {
78
        private function doSearch(array $params): string {
79
                $output = '';
79
                $output = '';
80
 
80
 
81
                // Note: The SQL collation defines if search is case sensitive or case insensitive
81
                // Note: The SQL collation defines if search is case sensitive or case insensitive
82
 
82
 
83
                $min_length = OIDplus::config()->getValue('search_min_term_length');
83
                $min_length = OIDplus::config()->getValue('search_min_term_length');