Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge

This commit is contained in:
zotlabs 2018-12-13 16:13:13 -08:00
commit fc78206049
10 changed files with 493 additions and 438 deletions

View File

@ -139,7 +139,7 @@ class Photo extends \Zotlabs\Web\Controller {
$resolution = 1;
}
$r = q("SELECT uid, photo_usage, expires, display_path FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1",
$r = q("SELECT uid, photo_usage, display_path FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1",
dbesc($photo),
intval($resolution)
);
@ -156,20 +156,17 @@ class Photo extends \Zotlabs\Web\Controller {
if(! in_array($resolution,[4,5,6]))
$allowed = (-1);
if($u === PHOTO_CACHE) {
// Cached image leak protection
if(! (local_channel() || $cache_mode['leak'])) {
header("Location: " . $r[0]['display_path']);
killme();
}
// Revalidate cache
if($cache_mode['on'] && strtotime($r[0]['expires']) - 60 < time()) {
$cache = array(
'url' => $r[0]['display_path'],
'uid' => $r[0]['uid']
);
// Validate cache
$cache = array(
'resid' => $photo,
'uid' => $r[0]['uid'],
'status' => false
);
if($cache_mode['on'])
call_hooks('cache_url_hook', $cache);
if(! $cache['status'])
http_status_exit(404,'not found');
if(! $cache['status']) {
header("Location: " . htmlspecialchars_decode($r[0]['display_path']));
killme();
}
}
}
@ -184,7 +181,7 @@ class Photo extends \Zotlabs\Web\Controller {
dbesc($photo),
intval($resolution)
);
$exists = (($e) ? true : false);
if($exists && $allowed) {

View File

@ -1122,6 +1122,7 @@ class Photos extends \Zotlabs\Web\Controller {
$comments = '';
if(! $r) {
if($observer && ($can_post || $can_comment)) {
$feature_auto_save_draft = ((feature_enabled($owner_uid, 'auto_save_draft')) ? "true" : "false");
$commentbox = replace_macros($cmnt_tpl,array(
'$return_path' => '',
'$mode' => 'photos',
@ -1137,7 +1138,8 @@ class Photos extends \Zotlabs\Web\Controller {
'$submit' => t('Submit'),
'$preview' => t('Preview'),
'$ww' => '',
'$feature_encrypt' => false
'$feature_encrypt' => false,
'$auto_save_draft' => $feature_auto_save_draft
));
}
}
@ -1270,8 +1272,14 @@ class Photos extends \Zotlabs\Web\Controller {
if(feature_enabled($owner_uid,'dislike'))
$response_verbs[] = 'dislike';
$responses = get_responses($conv_responses,$response_verbs,'',$link_item);
$hookdata = [
'onclick' => '$.colorbox({href: \'' . $photo['href'] . '\'}); return false;',
'raw_photo' => $ph[0],
'nickname' => \App::$data['channel']['channel_address']
];
call_hooks('photo_view_filter', $hookdata);
$photo_tpl = get_markup_template('photo_view.tpl');
$o .= replace_macros($photo_tpl, array(
@ -1309,6 +1317,7 @@ class Photos extends \Zotlabs\Web\Controller {
'$comments' => $comments,
'$commentbox' => $commentbox,
'$paginate' => $paginate,
'$onclick' => $hookdata['onclick']
));
\App::$data['photo_html'] = $o;

View File

@ -0,0 +1 @@
[h2]photo_view_filter[/h2]

View File

@ -502,6 +502,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the
[zrl=[baseurl]/help/hook/photo_upload_form]photo_upload_form[/zrl]
Called when generating a photo upload form
[zrl=[baseurl]/help/hook/photo_view_filter]photo_view_filter[/zrl]
Called before the data is handed over to the photo_view template
[zrl=[baseurl]/help/hook/poke_verbs]poke_verbs[/zrl]
Called when generating the list of actions for "poke" module

View File

@ -420,7 +420,7 @@ function post_activity_item($arr, $allow_code = false, $deliver = true) {
$arr['comment_policy'] = map_scope(PermissionLimits::Get($channel['channel_id'],'post_comments'));
if ((! $arr['plink']) && (intval($arr['item_thread_top']))) {
$arr['plink'] = substr(z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . urlencode($arr['mid']),0,190);
$arr['plink'] = substr(z_root() . '/channel/' . $channel['channel_address'] . '/' . (filter_var($arr['mid'], FILTER_VALIDATE_URL) === false ? '?f=&mid=' : '') . urlencode($arr['mid']),0,190);
}

View File

@ -36,6 +36,7 @@ class photo_imagick extends photo_driver {
}
catch (Exception $e) {
logger('imagick readImageBlob() exception:' . print_r($e,true));
return;
}
/**

File diff suppressed because it is too large Load Diff

View File

@ -2489,7 +2489,7 @@ App::$strings["New Network Activity Notifications"] = "Новые уведомл
App::$strings["View your network activity"] = "Просмотреть вашу сетевую активность";
App::$strings["Mark all notifications read"] = "Пометить уведомления как прочитанные";
App::$strings["Show new posts only"] = "Показывать только новые публикации";
App::$strings["Filter by name"] = "Отфильтровать по имени";
App::$strings["Filter by name or address"] = "Фильтровать по имени или адресу";
App::$strings["New Home Activity"] = "Новая локальная активность";
App::$strings["New Home Activity Notifications"] = "Новые уведомления локальной активности";
App::$strings["View your home activity"] = "Просмотреть локальную активность";
@ -2597,6 +2597,7 @@ App::$strings["Show posts that mention or involve me"] = "Показывать
App::$strings["Show posts that I have filed to %s"] = "Показывать публикации которые я добавил в %s";
App::$strings["Show filed post categories"] = "Показывать категории добавленных публикаций";
App::$strings["Panel search"] = "Панель поиска";
App::$strings["Filter by name"] = "Отфильтровать по имени";
App::$strings["Remove active filter"] = "Удалить активный фильтр";
App::$strings["Stream Filters"] = "Фильтры потока";
App::$strings["Chat Members"] = "Участники чата";
@ -2855,24 +2856,24 @@ App::$strings["0 or blank to import all available"] = "0 или пусто дл
App::$strings["A simple gallery for your photo albums"] = "Простая галлерея для ваших фотоальбомов";
App::$strings["Gallery"] = "Галерея";
App::$strings["Photo Gallery"] = "Фотогалерея";
App::$strings["Post to Friendica"] = "Опубликовать в Friendica";
App::$strings["rtof Settings saved."] = "Настройки rtof сохранены.";
App::$strings["Allow posting to Friendica"] = "Разрешить публиковать в Friendica";
App::$strings["Friendica Crosspost Connector Settings saved."] = "Настройки пересылки публикаций Friendica сохранены.";
App::$strings["Relay public postings to a connected Friendica account"] = "Ретранслировать общедоступные публикации на подключённую учётную запись Friendica";
App::$strings["Send public postings to Friendica by default"] = "Отправлять общедоступные публикации во Friendica по умолчанию";
App::$strings["Friendica API Path"] = "Путь к Friendica API";
App::$strings["https://{sitename}/api"] = "";
App::$strings["Friendica login name"] = "Имя входа Friendica";
App::$strings["Friendica password"] = "Пароль Friendica";
App::$strings["Hubzilla to Friendica Post Settings"] = "Настройки публикаций Hubzilla для Friendica";
App::$strings["Friendica Crosspost Connector"] = "Пересылка публикаций Friendica";
App::$strings["Post to Friendica"] = "Опубликовать в Friendica";
App::$strings["An account has been created for you."] = "Учётная запись, которая была для вас создана.";
App::$strings["Authentication successful but rejected: account creation is disabled."] = "Аутентификация выполнена успешно, но отклонена: создание учетной записи отключено.";
App::$strings["Post to Insanejournal"] = "Опубликовать в InsaneJournal";
App::$strings["Enable InsaneJournal Post Plugin"] = "Включить плагин публикаций InsaneJournal";
App::$strings["InsaneJournal username"] = "Имя пользователя InsaneJournal";
App::$strings["InsaneJournal password"] = "Пароль InsaneJournal";
App::$strings["Post to InsaneJournal by default"] = "Публиковать в InsaneJournal по умолчанию";
App::$strings["InsaneJournal Post Settings"] = "Настройки публикаций в InsaneJournal";
App::$strings["Insane Journal Settings saved."] = "Настройки InsaneJournal сохранены.";
App::$strings["Post to Insane Journal"] = "Опубликовать в Insane Journal";
App::$strings["Insane Journal Crosspost Connector Settings saved."] = "Настройки пересылки публикаций Insane Journal сохранены.";
App::$strings["Relay public postings to Insane Journal"] = "Ретранслировать общедоступные публикации в Insane Journal";
App::$strings["InsaneJournal username"] = "Имя пользователя Insane Journal";
App::$strings["InsaneJournal password"] = "Пароль Insane Journal";
App::$strings["Post to InsaneJournal by default"] = "Публиковать в Insane Journal по умолчанию";
App::$strings["Insane Journal Crosspost Connector"] = "Пересылка публикаций Insane Journal";
App::$strings["Your account on %s will expire in a few days."] = "Ваш аккаунт на %s перестанет работать через несколько дней.";
App::$strings["Your $Productname test account is about to expire."] = "Ваш тестовый аккаунт в $Productname близок к окончанию срока действия.";
App::$strings["Redmatrix File Storage Import"] = "Импорт файлового хранилища Redmatrix";
@ -2994,6 +2995,11 @@ App::$strings["Default zoom"] = "Масштаб по умолчанию";
App::$strings["The default zoom level. (1:world, 18:highest, also depends on tile server)"] = "Уровень размера по умолчанию (1 - весь мир, 18 - максимальный; зависит от сервера).";
App::$strings["Include marker on map"] = "Включите маркер на карте";
App::$strings["Include a marker on the map."] = "Включить маркер на карте";
App::$strings["Photo Cache settings saved."] = "Настройки Photo Cache сохранены.";
App::$strings["Photo Cache addon saves a copy of images from external sites locally to increase your anonymity in the web."] = "Приложение Photo Cache сохраняет копию изображений с внешних сайтов локально для повышения вашей анонимности в Интернет.";
App::$strings["Minimal photo size for caching"] = "Минимальный размер фотографии для кэширования";
App::$strings["In pixels. 0 will be replaced with system default, from 1 up to 1024 (large images will be scaled to this value)."] = "В пискелях. 0 будет заменён значением по умолчанию, от 1 до 1024 (большие изображения будут масштабированы до этого значения).";
App::$strings["Photo Cache"] = "";
App::$strings["Activate addon"] = "Активировать расширение";
App::$strings["Hide Jappixmini Chat-Widget from the webinterface"] = "Скрыть виджет чата Jappixmini из веб-интерфейса";
App::$strings["Jabber username"] = "Имя пользователя Jabber";
@ -3105,10 +3111,10 @@ App::$strings["Livejournal username"] = "Имя пользователя Livejou
App::$strings["Livejournal password"] = "Пароль Livejournal";
App::$strings["Post to Livejournal by default"] = "Публиковать в Livejournal по умолчанию";
App::$strings["Livejournal Post Settings"] = "Настройки публикации в Livejournal";
App::$strings["Post to GNU social"] = "Опубликовать в GNU Social";
App::$strings["Please contact your site administrator.<br />The provided API URL is not valid."] = "Пожалуйста свяжитесь с администратором сайта. <br />Предоставленный URL API недействителен.";
App::$strings["We could not contact the GNU social API with the Path you entered."] = "Нам не удалось установить контакт с GNU Social API по введённому вами пути";
App::$strings["GNU social settings updated."] = "Настройки GNU Social обновлены.";
App::$strings["Relay public postings to a connected GNU social account (formerly StatusNet)"] = "Ретранслировать общедоступные публикации на подключённую учётную запись GNU social (бывшая StatusNet)";
App::$strings["Globally Available GNU social OAuthKeys"] = "Глобально доступные ключи OAuthKeys GNU Social";
App::$strings["There are preconfigured OAuth key pairs for some GNU social servers available. If you are using one of them, please use these credentials.<br />If not feel free to connect to any other GNU social instance (see below)."] = "Существуют предварительно настроенные пары ключей OAuth для некоторых доступных серверов GNU social. Если вы используете один из них, используйте эти учетные данные. <br />Если вы не хотите подключаться к какому-либо другому серверу GNU social (см. ниже).";
App::$strings["Provide your own OAuth Credentials"] = "Предоставьте ваши собственные регистрационные данные OAuth";
@ -3125,11 +3131,10 @@ App::$strings["Cancel Connection Process"] = "Отменить процесс п
App::$strings["Current GNU social API is"] = "Текущий GNU social API";
App::$strings["Cancel GNU social Connection"] = "Отменить подключение с GNU social";
App::$strings["<strong>Note</strong>: Due your privacy settings (<em>Hide your profile details from unknown viewers?</em>) the link potentially included in public postings relayed to GNU social will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted."] = "<strong>Замечание</strong>: Из-за настроек конфиденциальности (<em>скрыть данные своего профиля от неизвестных зрителей?</em>) cсылка, потенциально включенная в общедоступные публикации, переданные в GNU social, приведет посетителя к пустой странице, информирующей его о том, что доступ к вашему профилю был ограничен.";
App::$strings["Allow posting to GNU social"] = "Разрешить публиковать в GNU social";
App::$strings["If enabled your public postings can be posted to the associated GNU-social account"] = "Если включено, ваши общедоступные публикации будут опубликованы в связанной учётной записи GNU social";
App::$strings["Post to GNU social by default"] = "Публиковать в GNU social по умолчанию";
App::$strings["If enabled your public postings will be posted to the associated GNU-social account by default"] = "Если включено, ваши общедоступные публикации будут опубликованы в связанной учётной записи GNU social по умолчанию";
App::$strings["GNU social Post Settings"] = "Настройки публикаций GNU social";
App::$strings["GNU-Social Crosspost Connector"] = "";
App::$strings["Post to GNU social"] = "Опубликовать в GNU Social";
App::$strings["API URL"] = "";
App::$strings["Application name"] = "Название приложения";
App::$strings["Access Denied"] = "Доступ запрещён";
@ -3400,15 +3405,15 @@ App::$strings["Libertree site URL"] = "URL сайта Libertree";
App::$strings["Post to Libertree by default"] = "Публиковать в Libertree по умолчанию";
App::$strings["Libertree Post Settings"] = "Настройки публикаций в Libertree";
App::$strings["Libertree Settings saved."] = "Настройки Libertree сохранены.";
App::$strings["Post to Red"] = "Опубликовать в Red";
App::$strings["Channel is required."] = "Необходим канал.";
App::$strings["redred Settings saved."] = "Настройки RedRed сохранены.";
App::$strings["Allow posting to another Hubzilla Channel"] = "Разрешить публиковать в другой канал Hubzilla";
App::$strings["Hubzilla Crosspost Connector Settings saved."] = "";
App::$strings["Relay public postings to another Hubzilla channel"] = "Ретранслировать общедоступные публикации в другой канал Hubzilla";
App::$strings["Send public postings to Hubzilla channel by default"] = "Отправлять общедоступные публикации в канал Hubzilla по умолчанию";
App::$strings["Hubzilla API Path"] = "Путь к Hubzilla API";
App::$strings["Hubzilla login name"] = "Имя входа Hubzilla";
App::$strings["Hubzilla channel name"] = "Название канала Hubzilla";
App::$strings["Hubzilla Crosspost Settings"] = "Настройки перекрёстных публикаций Hubzilla";
App::$strings["Hubzilla Crosspost Connector"] = "";
App::$strings["Post to Hubzilla"] = "";
App::$strings["ActivityPub Protocol Settings updated."] = "Настройки протокола ActivityPub обновлены.";
App::$strings["The activitypub protocol does not support location independence. Connections you make within that network may be unreachable from alternate channel locations."] = "Протокол ActivityPub не поддерживает независимость от расположения. Ваши контакты установленные в этой сети могут быть недоступны из альтернативных мест размещения канала.";
App::$strings["Deliver to ActivityPub recipients in privacy groups"] = "Доставить получателям ActivityPub в группах безопасности";
@ -3450,3 +3455,4 @@ App::$strings["Skeleton Settings"] = "Настройки скелета";
App::$strings["__ctx:opensearch__ Search %1\$s (%2\$s)"] = "Искать %1\$s (%2\$s)";
App::$strings["__ctx:opensearch__ \$Projectname"] = "";
App::$strings["Search \$Projectname"] = "Поиск \$Projectname";
App::$strings["Cover Photo"] = "";

View File

@ -326,6 +326,17 @@ a.text-dark:focus, a.text-dark:hover {
color: #ddd !important;
}
.badge-warning {
background-color: #ffc927;
}
.badge-warning a.text-dark {
color: #333 !important;
}
.badge-warning a.text-dark:focus, .badge-warning a.text-dark:hover {
color: red !important;
text-decoration: none;
}
.group-selected, .fileas-selected, .categories-selected, .search-selected, a.active {
color: #fff !important;
text-decoration: underline !important;
@ -480,3 +491,11 @@ pre {
.widget-nav-pills-checkbox:hover + a {
background-color: #222;
}
/* change color of [hl] tag: */
div.wall-item-body span /*strong:only-of-type */{
color: #1212b6;
padding: 2px 3px;
/* font-weight: 500; */
white-space: nowrap;
}

View File

@ -99,7 +99,7 @@
<div id="photo-edit-end" class="clear"></div>
</div>
<div id="photo-view-wrapper">
<div id="photo-photo"><a href="{{$photo.href}}" title="{{$photo.title}}" onclick="$.colorbox({href: '{{$photo.href}}'}); return false;"><img style="width: 100%;" src="{{$photo.src}}"></a></div>
<div id="photo-photo"><a href="{{$photo.href}}" title="{{$photo.title}}" onclick="{{$onclick}}"><img style="width: 100%;" src="{{$photo.src}}"></a></div>
<div id="photo-photo-end" class="clear"></div>
{{if $tags}}
<div class="photo-item-tools-left" id="in-this-photo">