rework autocomplete: some polishing

This commit is contained in:
rabuzarus 2016-04-14 17:05:19 +02:00
parent 01b02dbcaa
commit ce1faf17d1
5 changed files with 12 additions and 8 deletions

View File

@ -1,7 +1,8 @@
<?php
/**
* @file include/dir.php
* @file include/DirSearch.php
* @brief This file includes the DirSearch class with directory related functions
*/
@ -15,7 +16,7 @@ class DirSearch {
* *
* @param string $search Name or nick
* @param string $mode Search mode
* @return array
* @return array with search results
*/
public static function global_search_by_name($search, $mode = '') {
@ -51,6 +52,7 @@ class DirSearch {
intval(local_user()), dbesc(CONTACT_IS_SHARING), dbesc(CONTACT_IS_FRIEND),
dbesc(NETWORK_DFRN), dbesc($ostatus), dbesc($diaspora),
dbesc(escape_tags($search)), dbesc(escape_tags($search)));
return $results;
}

View File

@ -122,7 +122,7 @@ class Smilies {
* @param string $s
* @param boolean $sample
*
* @return string
* @return string HML Output of the Smilie
*/
public static function replace($s, $sample = false) {
if(intval(get_config('system','no_smilies'))
@ -165,7 +165,9 @@ class Smilies {
* @brief expand <3333 to the correct number of hearts
*
* @param string $x
* @return string
* @return string HTML Output
*
* @todo: Rework because it doesn't work correctly
*/
private function preg_heart($x) {
if(strlen($x[1]) == 1)

View File

@ -663,7 +663,7 @@ function acl_lookup(&$a, $out_type = 'json') {
* @brief Searching for global contacts for autocompletion
*
* @param App $a
* @return array
* @return array with the search results
*/
function navbar_complete(&$a) {
@ -704,4 +704,4 @@ function navbar_complete(&$a) {
}
}
return;
}
}

View File

@ -1294,7 +1294,7 @@ function short_link($url) {
* and adds an application/json HTTP header to the output.
* After finishing the process is getting killed.
*
* @param array $x
* @param array $x The input content
*/
function json_return_and_die($x) {
header("content-type: application/json");

View File

@ -16,6 +16,6 @@ function smilies_content(&$a) {
json_return_and_die($results);
}
else {
return smilies('',true);
return Smilies::replace('',true);
}
}