X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsuggest.php;h=81030842dcdf4dc220d05518e51a6fe2b157600f;hb=3a751f056298f95a1ddefed796c7a01f27101252;hp=af16197a04d827a938a8f656cbd8a890ed8a198a;hpb=5c0b550f38dba890f9d79b5356661bf1bf2f82b6;p=friendica.git diff --git a/mod/suggest.php b/mod/suggest.php index af16197a04..81030842dc 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -1,99 +1,122 @@ can't take arguments in its "action" parameter // so add any arguments as hidden inputs $query = explode_querystring($a->query_string); - $inputs = array(); - foreach($query['args'] as $arg) { - if(strpos($arg, 'confirm=') === false) { + $inputs = []; + foreach ($query['args'] as $arg) { + if (strpos($arg, 'confirm=') === false) { $arg_parts = explode('=', $arg); - $inputs[] = array('name' => $arg_parts[0], 'value' => $arg_parts[1]); + $inputs[] = ['name' => $arg_parts[0], 'value' => $arg_parts[1]]; } } - $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), array( + $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [ '$method' => 'get', - '$message' => t('Do you really want to delete this suggestion?'), + '$message' => L10n::t('Do you really want to delete this suggestion?'), '$extra_inputs' => $inputs, - '$confirm' => t('Yes'), + '$confirm' => L10n::t('Yes'), '$confirm_url' => $query['base'], '$confirm_name' => 'confirmed', - '$cancel' => t('Cancel'), - )); + '$cancel' => L10n::t('Cancel'), + ]); $a->error = 1; // Set $a->error so the other module functions don't execute return; } // Now check how the user responded to the confirmation query - if(!$_REQUEST['canceled']) { - q("insert into gcign ( uid, gcid ) values ( %d, %d ) ", - intval(local_user()), - intval($_GET['ignore']) - ); + if (!$_REQUEST['canceled']) { + DBA::insert('gcign', ['uid' => local_user(), 'gcid' => $_GET['ignore']]); } } } - - - - -function suggest_content(&$a) { - - require_once("mod/proxy.php"); - +function suggest_content(App $a) +{ $o = ''; - if(! local_user()) { - notice( t('Permission denied.') . EOL); + + if (! local_user()) { + notice(L10n::t('Permission denied.') . EOL); return; } - $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd; - - $a->page['aside'] .= follow_widget(); - $a->page['aside'] .= findpeople_widget(); + $_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd; + $a->page['aside'] .= Widget::findPeople(); + $a->page['aside'] .= Widget::follow(); - $o .= '