use Friendica\Content\Pager;
use Friendica\Content\Text\BBCode;
use Friendica\Core\ACL;
+use Friendica\Core\Addon;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
}
$album = hex2bin($a->argv[3]);
- if ($album === DI::l10n()->t('Profile Photos') || $album === 'Contact Photos' || $album === DI::l10n()->t('Contact Photos')) {
+ if ($album === DI::l10n()->t('Profile Photos') || $album === Photo::CONTACT_PHOTOS || $album === DI::l10n()->t(Photo::CONTACT_PHOTOS)) {
DI::baseUrl()->redirect($_SESSION['photo_return']);
return; // NOTREACHED
}
$albumselect .= '<option value="" ' . (!$selname ? ' selected="selected" ' : '') . '><current year></option>';
if (!empty($a->data['albums'])) {
foreach ($a->data['albums'] as $album) {
- if (($album['album'] === '') || ($album['album'] === 'Contact Photos') || ($album['album'] === DI::l10n()->t('Contact Photos'))) {
+ if (($album['album'] === '') || ($album['album'] === Photo::CONTACT_PHOTOS) || ($album['album'] === DI::l10n()->t(Photo::CONTACT_PHOTOS))) {
continue;
}
$selected = (($selname === $album['album']) ? ' selected="selected" ' : '');
'$uploadurl' => $ret['post_url'],
// ACL permissions box
- '$group_perms' => DI::l10n()->t('Show to Groups'),
- '$contact_perms' => DI::l10n()->t('Show to Contacts'),
'$return_path' => DI::args()->getQueryString(),
]);
return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
'$method' => 'post',
'$message' => DI::l10n()->t('Do you really want to delete this photo album and all its photos?'),
- '$extra_inputs' => [],
'$confirm' => DI::l10n()->t('Delete Album'),
'$confirm_url' => $drop_url,
'$confirm_name' => 'dropalbum',
// edit album name
if ($cmd === 'edit') {
- if (($album !== DI::l10n()->t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== DI::l10n()->t('Contact Photos'))) {
+ if (($album !== DI::l10n()->t('Profile Photos')) && ($album !== Photo::CONTACT_PHOTOS) && ($album !== DI::l10n()->t(Photo::CONTACT_PHOTOS))) {
if ($can_post) {
$edit_tpl = Renderer::getMarkupTemplate('album_edit.tpl');
}
}
} else {
- if (($album !== DI::l10n()->t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== DI::l10n()->t('Contact Photos')) && $can_post) {
+ if (($album !== DI::l10n()->t('Profile Photos')) && ($album !== Photo::CONTACT_PHOTOS) && ($album !== DI::l10n()->t(Photo::CONTACT_PHOTOS)) && $can_post) {
$edit = [DI::l10n()->t('Edit Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit'];
$drop = [DI::l10n()->t('Drop Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/drop'];
}
return Renderer::replaceMacros(Renderer::getMarkupTemplate('confirm.tpl'), [
'$method' => 'post',
'$message' => DI::l10n()->t('Do you really want to delete this photo?'),
- '$extra_inputs' => [],
'$confirm' => DI::l10n()->t('Delete Photo'),
'$confirm_url' => $drop_url,
'$confirm_name' => 'delete',
'$delete' => DI::l10n()->t('Delete Photo'),
// ACL permissions box
- '$group_perms' => DI::l10n()->t('Show to Groups'),
- '$contact_perms' => DI::l10n()->t('Show to Contacts'),
'$return_path' => DI::args()->getQueryString(),
]);
}
if (!DBA::isResult($items)) {
if (($can_post || Security::canWriteToUserWall($owner_uid))) {
+ /*
+ * Hmmm, code depending on the presence of a particular addon?
+ * This should be better if done by a hook
+ */
+ $qcomment = null;
+ if (Addon::isEnabled('qcomment')) {
+ $words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
+ $qcomment = $words ? explode("\n", $words) : [];
+ }
+
$comments .= Renderer::replaceMacros($cmnt_tpl, [
'$return_path' => '',
'$jsreload' => $return_path,
'$preview' => DI::l10n()->t('Preview'),
'$loading' => DI::l10n()->t('Loading...'),
'$sourceapp' => DI::l10n()->t($a->sourcename),
- '$ww' => '',
+ '$qcomment' => $qcomment,
'$rand_num' => Crypto::randomDigits(12)
]);
}
}
if (($can_post || Security::canWriteToUserWall($owner_uid))) {
+ /*
+ * Hmmm, code depending on the presence of a particular addon?
+ * This should be better if done by a hook
+ */
+ $qcomment = null;
+ if (Addon::isEnabled('qcomment')) {
+ $words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
+ $qcomment = $words ? explode("\n", $words) : [];
+ }
+
$comments .= Renderer::replaceMacros($cmnt_tpl,[
'$return_path' => '',
'$jsreload' => $return_path,
'$submit' => DI::l10n()->t('Submit'),
'$preview' => DI::l10n()->t('Preview'),
'$sourceapp' => DI::l10n()->t($a->sourcename),
- '$ww' => '',
+ '$qcomment' => $qcomment,
'$rand_num' => Crypto::randomDigits(12)
]);
}
]);
if (($can_post || Security::canWriteToUserWall($owner_uid))) {
+ /*
+ * Hmmm, code depending on the presence of a particular addon?
+ * This should be better if done by a hook
+ */
+ $qcomment = null;
+ if (Addon::isEnabled('qcomment')) {
+ $words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
+ $qcomment = $words ? explode("\n", $words) : [];
+ }
+
$comments .= Renderer::replaceMacros($cmnt_tpl, [
'$return_path' => '',
'$jsreload' => $return_path,
'$submit' => DI::l10n()->t('Submit'),
'$preview' => DI::l10n()->t('Preview'),
'$sourceapp' => DI::l10n()->t($a->sourcename),
- '$ww' => '',
+ '$qcomment' => $qcomment,
'$rand_num' => Crypto::randomDigits(12)
]);
}
$r = q("SELECT `resource-id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s'
$sql_extra GROUP BY `resource-id`",
intval($a->data['user']['uid']),
- DBA::escape('Contact Photos'),
- DBA::escape(DI::l10n()->t('Contact Photos'))
+ DBA::escape(Photo::CONTACT_PHOTOS),
+ DBA::escape(DI::l10n()->t(Photo::CONTACT_PHOTOS))
);
if (DBA::isResult($r)) {
$total = count($r);
WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s'
$sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d",
intval($a->data['user']['uid']),
- DBA::escape('Contact Photos'),
- DBA::escape(DI::l10n()->t('Contact Photos')),
+ DBA::escape(Photo::CONTACT_PHOTOS),
+ DBA::escape(DI::l10n()->t(Photo::CONTACT_PHOTOS)),
$pager->getStart(),
$pager->getItemsPerPage()
);