X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Ftext.php;h=66918e9a66e1c1fae6412acf91d0d07b7d25a093;hb=0fe832ef8aeafa1ddba793a8b084005cf070f1f4;hp=838785eaacb541d4cce3cf3de03969f6fe39e560;hpb=eb031e7ee26bcd47762b9407986a71a565e8f749;p=friendica.git diff --git a/include/text.php b/include/text.php index 838785eaac..66918e9a66 100644 --- a/include/text.php +++ b/include/text.php @@ -10,6 +10,8 @@ use Friendica\Core\Config; use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Database\DBM; +use Friendica\Model\Profile; +use Friendica\Model\Term; use Friendica\Util\Map; require_once "include/friendica_smarty.php"; @@ -1010,7 +1012,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) { $url = $redirect_url; $sparkle = ' sparkle'; } else { - $url = zrl($url); + $url = Profile::zrl($url); } } @@ -1033,14 +1035,14 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) { } /** - * @brief Search box. + * Search box. * * @param string $s Search query. * @param string $id HTML id * @param string $url Search url. * @param bool $save Show save search button. * @param bool $aside Display the search widgit aside. - * + * * @return string Formatted HTML. */ function search($s, $id = 'search-box', $url = 'search', $save = false, $aside = true) @@ -1907,9 +1909,8 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') { return true; } -function file_tag_save_file($uid, $item, $file) { - require_once "include/files.php"; - +function file_tag_save_file($uid, $item, $file) +{ if (! intval($uid)) { return false; } @@ -1927,7 +1928,7 @@ function file_tag_save_file($uid, $item, $file) { ); } - create_files_from_item($item); + Term::createFromItem($item); $saved = PConfig::get($uid, 'system', 'filetags'); if (!strlen($saved) || !stristr($saved, '[' . file_tag_encode($file) . ']')) { @@ -1938,9 +1939,8 @@ function file_tag_save_file($uid, $item, $file) { return true; } -function file_tag_unsave_file($uid, $item, $file, $cat = false) { - require_once "include/files.php"; - +function file_tag_unsave_file($uid, $item, $file, $cat = false) +{ if (! intval($uid)) { return false; } @@ -1967,7 +1967,7 @@ function file_tag_unsave_file($uid, $item, $file, $cat = false) { intval($uid) ); - create_files_from_item($item); + Term::createFromItem($item); $r = q("SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d", dbesc($file), @@ -2107,7 +2107,8 @@ function text_highlight($s, $lang) { } $renderer = new Text_Highlighter_Renderer_Html($options); - $hl = Text_Highlighter::factory($lang); + $factory = new Text_Highlighter(); + $hl = $factory->factory($lang); $hl->setRenderer($renderer); $o = $hl->highlight($s); $o = str_replace("\n", '', $o);