]> git.mxchange.org Git - friendica.git/blobdiff - include/text.php
Update functions and calls
[friendica.git] / include / text.php
index cafc82a3546565f48d442cea7c4e201b6994cb08..66918e9a66e1c1fae6412acf91d0d07b7d25a093 100644 (file)
@@ -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);
                }
        }
 
@@ -1040,7 +1042,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
  * @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);