*/
$live_update_div = '<div id="live-network"></div>' . "\r\n"
. "<script> var profile_uid = " . $_SESSION['uid']
- . "; var netargs = '" . substr($a->cmd, 8)
+ . "; var netargs = '" . substr(DI::args()->getCommand(), 8)
. '?f='
. (!empty($_GET['cid']) ? '&cid=' . rawurlencode($_GET['cid']) : '')
. (!empty($_GET['search']) ? '&search=' . rawurlencode($_GET['search']) : '')
if (!$update) {
$live_update_div = '<div id="live-community"></div>' . "\r\n"
- . "<script> var profile_uid = -1; var netargs = '" . substr($a->cmd, 10)
+ . "<script> var profile_uid = -1; var netargs = '" . substr(DI::args()->getCommand(), 10)
."/?f='; var profile_page = " . $pager->getPage() . "; </script>\r\n";
}
} elseif ($mode === 'contacts') {
if (!$update) {
$live_update_div = '<div id="live-contacts"></div>' . "\r\n"
- . "<script> var profile_uid = -1; var netargs = '" . substr($a->cmd, 9)
+ . "<script> var profile_uid = -1; var netargs = '" . substr(DI::args()->getCommand(), 9)
."/?f='; var profile_page = " . $pager->getPage() . "; </script>\r\n";
}
} elseif ($mode === 'search') {
function api_content(App $a)
{
- if ($a->cmd == 'api/oauth/authorize') {
+ if (DI::args()->getCommand() == 'api/oauth/authorize') {
/*
* api/oauth/authorize interact with the user. return a standard page
*/
foreach ($r as $rr) {
$j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j');
if (empty($links[$j])) {
- $links[$j] = System::baseUrl() . '/' . $a->cmd . '#link-' . $j;
+ $links[$j] = System::baseUrl() . '/' . DI::args()->getCommand() . '#link-' . $j;
}
}
}
$url = Network::isUrlValid($url);
if (!$url) {
notice(L10n::t('Invalid profile URL.') . EOL);
- DI::baseUrl()->redirect($a->cmd);
+ DI::baseUrl()->redirect(DI::args()->getCommand());
return; // NOTREACHED
}
if (!Network::isUrlAllowed($url)) {
notice(L10n::t('Disallowed profile URL.') . EOL);
- DI::baseUrl()->redirect($a->cmd);
+ DI::baseUrl()->redirect(DI::args()->getCommand());
return; // NOTREACHED
}
if (Network::isUrlBlocked($url)) {
notice(L10n::t('Blocked domain') . EOL);
- DI::baseUrl()->redirect($a->cmd);
+ DI::baseUrl()->redirect(DI::args()->getCommand());
return; // NOTREACHED
}
if (!count($parms)) {
notice(L10n::t('Profile location is not valid or does not contain profile information.') . EOL);
- DI::baseUrl()->redirect($a->cmd);
+ DI::baseUrl()->redirect(DI::args()->getCommand());
} else {
if (empty($parms['fn'])) {
notice(L10n::t('Warning: profile location has no identifiable owner name.') . EOL);
}
if ($a->argc == 1) {
- $_SESSION['return_path'] = $a->cmd;
+ $_SESSION['return_path'] = DI::args()->getCommand();
}
if (($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) {
foreach ($r as $rr) {
$j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j');
if (empty($links[$j])) {
- $links[$j] = System::baseUrl() . '/' . $a->cmd . '#link-' . $j;
+ $links[$j] = System::baseUrl() . '/' . DI::args()->getCommand() . '#link-' . $j;
}
}
}
use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Util\Network;
$a->page['aside'] .= Widget::findPeople();
$a->page['aside'] .= Widget::follow();
- $_SESSION['return_path'] = $a->cmd;
+ $_SESSION['return_path'] = DI::args()->getCommand();
$profile = Profile::getByUID(local_user());
$a->argc = 2;
$a->argv[1] = 'new';
} else {
- DI::baseUrl()->redirect($a->cmd . '/' . $ret);
+ DI::baseUrl()->redirect(DI::args()->getCommand() . '/' . $ret);
}
}
$all_active = 'active';
}
- $cmd = $a->cmd;
+ $cmd = DI::args()->getCommand();
// tabs
$tabs = [
$phototypes = Images::supportedTypes();
- $_SESSION['photo_return'] = $a->cmd;
+ $_SESSION['photo_return'] = DI::args()->getCommand();
// Parse arguments
$datum = null;
if (!empty($link_item['id']) && !empty($link_item['uri'])) {
$cmnt_tpl = Renderer::getMarkupTemplate('comment_item.tpl');
$tpl = Renderer::getMarkupTemplate('photo_item.tpl');
- $return_path = $a->cmd;
+ $return_path = DI::args()->getCommand();
if ($cmd === 'view' && ($can_post || Security::canWriteToUserWall($owner_uid))) {
$like_tpl = Renderer::getMarkupTemplate('like_noshare.tpl');
{
$xml = Network::postdata();
- Logger::log('Feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $a->cmd . ' with user-agent: ' . $_SERVER['HTTP_USER_AGENT']);
+ Logger::log('Feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . DI::args()->getCommand() . ' with user-agent: ' . $_SERVER['HTTP_USER_AGENT']);
Logger::log('Data: ' . $xml, Logger::DATA);
$nick = (($a->argc > 1) ? Strings::escapeTags(trim($a->argv[1])) : '');
return;
}
- $_SESSION['return_path'] = $a->cmd;
+ $_SESSION['return_path'] = DI::args()->getCommand();
$a->page['aside'] .= Widget::findPeople();
$a->page['aside'] .= Widget::follow();
//$phototypes = Photo::supportedTypes();
- $_SESSION['video_return'] = $a->cmd;
+ $_SESSION['video_return'] = DI::args()->getCommand();
//
// Parse arguments
public $page_contact;
public $content;
public $data = [];
- /** @deprecated 2019.09 - use App\Arguments->getCommand() */
- public $cmd = '';
/** @deprecated 2019.09 - use App\Arguments->getArgv() or Arguments->get() */
public $argv;
/** @deprecated 2019.09 - use App\Arguments->getArgc() */
$this->args = $args;
$this->process = $process;
- $this->cmd = $args->getCommand();
$this->argv = $args->getArgv();
$this->argc = $args->getArgc();
$this->module = $module->getName();
$addr = $_GET['addr'] ?? $my_url;
- $arr = ['zrl' => $my_url, 'url' => $a->cmd];
+ $arr = ['zrl' => $my_url, 'url' => DI::args()->getCommand()];
Hook::callAll('zrl_init', $arr);
// Try to find the public contact entry of the visitor.
'$desc' => L10n::t('Search your contacts'),
'$finding' => $searching ? L10n::t('Results for: %s', $search) : '',
'$submit' => L10n::t('Find'),
- '$cmd' => $a->cmd,
+ '$cmd' => DI::args()->getCommand(),
'$contacts' => $contacts,
'$contact_drop_confirm' => L10n::t('Do you really want to delete this contact?'),
'multiselect' => 1,
'received' => $item['received'],
'commented' => $item['commented'],
'created_date' => $item['created'],
- 'return' => ($a->cmd) ? bin2hex($a->cmd) : '',
+ 'return' => (DI::args()->getCommand()) ? bin2hex(DI::args()->getCommand()) : '',
'delivery' => [
'queue_count' => $item['delivery_queue_count'],
'queue_done' => $item['delivery_queue_done'] + $item['delivery_queue_failed'], /// @todo Possibly display it separately in the future