Browse Source

rework autocomplete: some polishing

tags/3.5
rabuzarus 4 years ago
parent
commit
ce1faf17d1
5 changed files with 12 additions and 8 deletions
  1. +4
    -2
      include/DirSearch.php
  2. +4
    -2
      include/Smilies.php
  3. +2
    -2
      include/acl_selectors.php
  4. +1
    -1
      include/network.php
  5. +1
    -1
      mod/smilies.php

+ 4
- 2
include/DirSearch.php 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;
}



+ 4
- 2
include/Smilies.php 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)


+ 2
- 2
include/acl_selectors.php 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;
}
}

+ 1
- 1
include/network.php 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");


+ 1
- 1
mod/smilies.php View File

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

Loading…
Cancel
Save