if ($a->argc > 3 && $a->argv[2] === 'album') {
if (!Strings::isHex($a->argv[3])) {
- $a->internalRedirect('photos/' . $a->data['user']['nickname'] . '/album');
+ DI::baseUrl()->redirect('photos/' . $a->data['user']['nickname'] . '/album');
}
$album = hex2bin($a->argv[3]);
if ($album === L10n::t('Profile Photos') || $album === 'Contact Photos' || $album === L10n::t('Contact Photos')) {
- $a->internalRedirect($_SESSION['photo_return']);
+ DI::baseUrl()->redirect($_SESSION['photo_return']);
return; // NOTREACHED
}
if (!DBA::isResult($r)) {
notice(L10n::t('Album not found.') . EOL);
- $a->internalRedirect($_SESSION['photo_return']);
+ DI::baseUrl()->redirect($_SESSION['photo_return']);
return; // NOTREACHED
}
// Check if the user has responded to a delete confirmation query
if (!empty($_REQUEST['canceled'])) {
- $a->internalRedirect($_SESSION['photo_return']);
+ DI::baseUrl()->redirect($_SESSION['photo_return']);
}
// RENAME photo album
// Update the photo albums cache
Photo::clearAlbumCache($page_owner_uid);
- $a->internalRedirect('photos/' . $a->user['nickname'] . '/album/' . bin2hex($newalbum));
+ DI::baseUrl()->redirect('photos/' . $a->user['nickname'] . '/album/' . bin2hex($newalbum));
return; // NOTREACHED
}
}
}
- $a->internalRedirect('photos/' . $a->argv[1]);
+ DI::baseUrl()->redirect('photos/' . $a->argv[1]);
}
if ($a->argc > 3 && $a->argv[2] === 'image') {
// Check if the user has responded to a delete confirmation query for a single photo
if (!empty($_POST['canceled'])) {
- $a->internalRedirect('photos/' . $a->argv[1] . '/image/' . $a->argv[3]);
+ DI::baseUrl()->redirect('photos/' . $a->argv[1] . '/image/' . $a->argv[3]);
}
if (!empty($_POST['delete'])) {
notice('Successfully deleted the photo.');
} else {
notice('Failed to delete the photo.');
- $a->internalRedirect('photos/' . $a->argv[1] . '/image/' . $a->argv[3]);
+ DI::baseUrl()->redirect('photos/' . $a->argv[1] . '/image/' . $a->argv[3]);
}
- $a->internalRedirect('photos/' . $a->argv[1]);
+ DI::baseUrl()->redirect('photos/' . $a->argv[1]);
return; // NOTREACHED
}
}
}
}
}
- $a->internalRedirect($_SESSION['photo_return']);
+ DI::baseUrl()->redirect($_SESSION['photo_return']);
return; // NOTREACHED
}
// addon uploaders should call "killme()" [e.g. exit] within the photo_post_end hook
// if they do not wish to be redirected
- $a->internalRedirect($_SESSION['photo_return']);
+ DI::baseUrl()->redirect($_SESSION['photo_return']);
// NOTREACHED
}
$phototypes = Images::supportedTypes();
- $_SESSION['photo_return'] = $a->cmd;
+ $_SESSION['photo_return'] = DI::args()->getCommand();
// Parse arguments
$datum = null;
// ACL permissions box
'$group_perms' => L10n::t('Show to Groups'),
'$contact_perms' => L10n::t('Show to Contacts'),
- '$return_path' => $a->query_string,
+ '$return_path' => DI::args()->getQueryString(),
]);
return $o;
if ($datatype === 'album') {
// if $datum is not a valid hex, redirect to the default page
if (!Strings::isHex($datum)) {
- $a->internalRedirect('photos/' . $a->data['user']['nickname']. '/album');
+ DI::baseUrl()->redirect('photos/' . $a->data['user']['nickname']. '/album');
}
$album = hex2bin($datum);
$total = count($r);
}
- $pager = new Pager($a->query_string, 20);
+ $pager = new Pager(DI::args()->getQueryString(), 20);
/// @TODO I have seen this many times, maybe generalize it script-wide and encapsulate it?
$order_field = $_GET['order'] ?? '';
);
if ($cmd === 'drop') {
- $drop_url = $a->query_string;
+ $drop_url = DI::args()->getQueryString();
return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
'$method' => 'post',
}
if ($cmd === 'drop') {
- $drop_url = $a->query_string;
+ $drop_url = DI::args()->getQueryString();
return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
'$method' => 'post',
$condition = ["`parent` = ? AND `parent` != `id`", $link_item['parent']];
$total = DBA::count('item', $condition);
- $pager = new Pager($a->query_string);
+ $pager = new Pager(DI::args()->getQueryString());
$params = ['order' => ['id'], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
$result = Item::selectForUser($link_item['uid'], Item::ITEM_FIELDLIST, $condition, $params);
// ACL permissions box
'$group_perms' => L10n::t('Show to Groups'),
'$contact_perms' => L10n::t('Show to Contacts'),
- '$return_path' => $a->query_string,
+ '$return_path' => DI::args()->getQueryString(),
]);
}
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');
'$likethis' => L10n::t("I like this \x28toggle\x29"),
'$nolike' => L10n::t("I don't like this \x28toggle\x29"),
'$wait' => L10n::t('Please wait'),
- '$return_path' => $a->query_string,
+ '$return_path' => DI::args()->getQueryString(),
]);
}
$total = count($r);
}
- $pager = new Pager($a->query_string, 20);
+ $pager = new Pager(DI::args()->getQueryString(), 20);
$r = q("SELECT `resource-id`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`filename`) AS `filename`,
ANY_VALUE(`type`) AS `type`, ANY_VALUE(`album`) AS `album`, max(`scale`) AS `scale`,