]> git.mxchange.org Git - friendica.git/blobdiff - mod/suggest.php
Replace x() by isset(), !empty() or defaults()
[friendica.git] / mod / suggest.php
index 1a4dbc5a13c2e25ab380cdced9d0459bc3591102..7f1fe3386c139f297244f88f0ea45f2d23aba310 100644 (file)
@@ -7,18 +7,20 @@ use Friendica\App;
 use Friendica\Content\ContactSelector;
 use Friendica\Content\Widget;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\GContact;
 use Friendica\Util\Proxy as ProxyUtils;
 
-function suggest_init(App $a) {
+function suggest_init(App $a)
+{
        if (! local_user()) {
                return;
        }
 
-       if (x($_GET,'ignore') && intval($_GET['ignore'])) {
+       if (!empty($_GET['ignore'])) {
                // Check if we should do HTML-based delete confirmation
                if ($_REQUEST['confirm']) {
                        // <form> can't take arguments in its "action" parameter
@@ -32,7 +34,7 @@ function suggest_init(App $a) {
                                }
                        }
 
-                       $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
+                       $a->page['content'] = Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
                                '$method' => 'get',
                                '$message' => L10n::t('Do you really want to delete this suggestion?'),
                                '$extra_inputs' => $inputs,
@@ -61,7 +63,7 @@ function suggest_content(App $a)
                return;
        }
 
-       $_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd;
+       $_SESSION['return_path'] = $a->cmd;
 
        $a->page['aside'] .= Widget::findPeople();
        $a->page['aside'] .= Widget::follow();
@@ -110,9 +112,9 @@ function suggest_content(App $a)
                $entries[] = $entry;
        }
 
-       $tpl = get_markup_template('viewcontact_template.tpl');
+       $tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');
 
-       $o .= replace_macros($tpl,[
+       $o .= Renderer::replaceMacros($tpl,[
                '$title' => L10n::t('Friend Suggestions'),
                '$contacts' => $entries,
        ]);