rework autocomplete: some polishing

This commit is contained in:
rabuzarus 2016-04-14 17:05:19 +02:00 committed by Roland Haeder
parent 535f382c4e
commit db581c08d0
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
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

@ -121,7 +121,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'))
@ -164,7 +164,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);
}
}