]> git.mxchange.org Git - friendica.git/commitdiff
functions moved to HTML class
authorAdam Magness <adam.magness@gmail.com>
Tue, 6 Nov 2018 02:06:26 +0000 (21:06 -0500)
committerAdam Magness <adam.magness@gmail.com>
Tue, 6 Nov 2018 02:06:26 +0000 (21:06 -0500)
update function calls to moved class.

include/api.php
mod/network.php
mod/profperm.php
mod/search.php
src/Content/ForumManager.php
src/Content/Text/HTML.php
src/Model/Profile.php
src/Protocol/DFRN.php

index 246a716facaa1f2454c7297d8667a7d8e25b6849..10c0a5c91e7d077e503abe3dbb60390535eb8aeb 100644 (file)
@@ -1046,7 +1046,7 @@ function api_statuses_mediap($type)
        //$txt = urldecode(requestdata('status'));
 
        if ((strpos($txt, '<') !== false) || (strpos($txt, '>') !== false)) {
-               $txt = html2bb_video($txt);
+               $txt = HTML::htmlToBBVideo($txt);
                $config = HTMLPurifier_Config::createDefault();
                $config->set('Cache.DefinitionImpl', null);
                $purifier = new HTMLPurifier($config);
@@ -1092,7 +1092,7 @@ function api_statuses_update($type)
        if (requestdata('htmlstatus')) {
                $txt = requestdata('htmlstatus');
                if ((strpos($txt, '<') !== false) || (strpos($txt, '>') !== false)) {
-                       $txt = html2bb_video($txt);
+                       $txt = HTML::htmlToBBVideo($txt);
 
                        $config = HTMLPurifier_Config::createDefault();
                        $config->set('Cache.DefinitionImpl', null);
index 11b297329d0d19855ff271e35730722c5a1461c6..26458a7a0e4719b3c42203827c609de5beb59395 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\Content\ForumManager;
 use Friendica\Content\Nav;
 use Friendica\Content\Pager;
 use Friendica\Content\Widget;
+use Friendica\Content\Text\HTML;
 use Friendica\Core\ACL;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
@@ -205,7 +206,7 @@ function saved_searches($search)
        $o = Renderer::replaceMacros($tpl, [
                '$title'     => L10n::t('Saved Searches'),
                '$add'       => L10n::t('add'),
-               '$searchbox' => search($search, 'netsearch-box', $srchurl, true),
+               '$searchbox' => HTML::search($search, 'netsearch-box', $srchurl, true),
                '$saved'     => $saved,
        ]);
 
@@ -348,7 +349,7 @@ function networkConversation(App $a, $items, Pager $pager, $mode, $update, $orde
 
        if (!$update) {
                if (PConfig::get(local_user(), 'system', 'infinite_scroll')) {
-                       $o .= scroll_loader();
+                       $o .= HTML::scrollLoader();
                } else {
                        $o .= $pager->renderMinimal(count($items));
                }
index ee5e2f23d7aef3746e1dae71ab271211c2b94394..5d7d8ed94bc8c07265cef703b147151bc8df6256 100644 (file)
@@ -7,6 +7,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
 use Friendica\Core\Protocol;
+use Friendica\Content\Text\HTML;
 use Friendica\Database\DBA;
 use Friendica\Model\Profile;
 
@@ -133,7 +134,7 @@ function profperm_content(App $a) {
        foreach($members as $member) {
                if ($member['url']) {
                        $member['click'] = 'profChangeMember(' . $profile['id'] . ',' . $member['id'] . '); return true;';
-                       $o .= micropro($member,true,'mpprof', $textmode);
+                       $o .= HTML::micropro($member,true,'mpprof', $textmode);
                }
        }
        $o .= '</div><div id="prof-members-end"></div>';
@@ -155,7 +156,7 @@ function profperm_content(App $a) {
                        foreach($r as $member) {
                                if (!in_array($member['id'],$ingroup)) {
                                        $member['click'] = 'profChangeMember(' . $profile['id'] . ',' . $member['id'] . '); return true;';
-                                       $o .= micropro($member,true,'mpprof',$textmode);
+                                       $o .= HTML::micropro($member,true,'mpprof',$textmode);
                                }
                        }
                }
index 37dacadddf1131c8810a4af4236c1cbc7b2403d6..809a6f7e86e50f013546c90545289cf9d71ad3bc 100644 (file)
@@ -7,6 +7,7 @@ use Friendica\App;
 use Friendica\Content\Feature;
 use Friendica\Content\Nav;
 use Friendica\Content\Pager;
+use Friendica\Content\Text\HTML;
 use Friendica\Core\Cache;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
@@ -163,7 +164,7 @@ function search_content(App $a) {
                'name' => "search-header",
                '$title' => L10n::t("Search"),
                '$title_size' => 3,
-               '$content' => search($search,'search-box','search',((local_user()) ? true : false), false)
+               '$content' => HTML::search($search,'search-box','search',((local_user()) ? true : false), false)
        ]);
 
        if (strpos($search,'#') === 0) {
index a47d70ab38b2a60ebe037d0ec98594b33e268bcc..97917cfd2a9911b5b6c703af9a9197e720785985 100644 (file)
@@ -7,6 +7,7 @@ namespace Friendica\Content;
 
 use Friendica\Core\Protocol;
 use Friendica\Content\Feature;
+use Friendica\Content\Text\HTML;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Core\System;
@@ -169,7 +170,7 @@ class ForumManager
                $total_shown = 0;
                $forumlist = '';
                foreach ($contacts as $contact) {
-                       $forumlist .= micropro($contact, false, 'forumlist-profile-advanced');
+                       $forumlist .= HTML::micropro($contact, false, 'forumlist-profile-advanced');
                        $total_shown ++;
                        if ($total_shown == $show_total) {
                                break;
index 893b59c3efb85e407a92f62b09793ec94a6e6fdf..3b46165138b55f1a3270829a3e7925f7af82de7d 100644 (file)
@@ -862,7 +862,7 @@ class HTML
                                        $contacts = L10n::tt('%d Contact', '%d Contacts', $total);
                                        $micropro = [];
                                        foreach ($r as $rr) {
-                                               $micropro[] = micropro($rr, true, 'mpfriend');
+                                               $micropro[] = self::micropro($rr, true, 'mpfriend');
                                        }
                                }
                        }
index 2cd3f7a86c67b46bbaf17c4583e196dabd1b8e94..81a7630bbdda6027222d28a4bf04f2ee99f1af5a 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\App;
 use Friendica\Content\Feature;
 use Friendica\Content\ForumManager;
 use Friendica\Content\Text\BBCode;
+use Friendica\Content\Text\HTML;
 use Friendica\Core\Addon;
 use Friendica\Core\Cache;
 use Friendica\Core\Config;
@@ -467,7 +468,7 @@ class Profile
                $updated = '';
                $contacts = 0;
                if (!$block) {
-                       $contact_block = contact_block();
+                       $contact_block = HTML::contactBlock();
 
                        if (is_array($a->profile) && !$a->profile['hide-friends']) {
                                $r = q(
@@ -785,11 +786,11 @@ class Profile
                        }
 
                        if ($a->profile['homepage']) {
-                               $profile['homepage'] = [L10n::t('Homepage:'), linkify($a->profile['homepage'])];
+                               $profile['homepage'] = [L10n::t('Homepage:'), HTML::toLink($a->profile['homepage'])];
                        }
 
                        if ($a->profile['hometown']) {
-                               $profile['hometown'] = [L10n::t('Hometown:'), linkify($a->profile['hometown'])];
+                               $profile['hometown'] = [L10n::t('Hometown:'), HTML::toLink($a->profile['hometown'])];
                        }
 
                        if ($a->profile['pub_keywords']) {
index 33df28d92b4fa710b68993a43ba81274a1284722..91910e96e335ab3b93eb7f17cd7ecc807d0a19d1 100644 (file)
@@ -2500,9 +2500,9 @@ class DFRN
                /// @todo Do we really need this check for HTML elements? (It was copied from the old function)
                if ((strpos($item['body'], '<') !== false) && (strpos($item['body'], '>') !== false)) {
                        $base_url = get_app()->getBaseURL();
-                       $item['body'] = reltoabs($item['body'], $base_url);
+                       $item['body'] = HTML::relToAbs($item['body'], $base_url);
 
-                       $item['body'] = html2bb_video($item['body']);
+                       $item['body'] = HTML::htmlToBBVideo($item['body']);
 
                        $item['body'] = OEmbed::HTML2BBCode($item['body']);