diff options
-rw-r--r-- | CHANGELOG | 10 | ||||
-rw-r--r-- | Zotlabs/Lib/ThreadItem.php | 15 | ||||
-rw-r--r-- | Zotlabs/Module/Oep.php | 11 | ||||
-rw-r--r-- | Zotlabs/Module/Viewsrc.php | 4 | ||||
-rwxr-xr-x | boot.php | 1 | ||||
-rw-r--r-- | doc/hook/jot_header_tpl_filter.bb | 5 | ||||
-rw-r--r-- | doc/hook/jot_tpl_filter.bb | 5 | ||||
-rw-r--r-- | doc/hooklist.bb | 6 | ||||
-rw-r--r-- | include/conversation.php | 19 | ||||
-rw-r--r-- | include/text.php | 2 | ||||
-rw-r--r-- | view/ru/hmessages.po | 4 | ||||
-rw-r--r-- | view/ru/hstrings.php | 4 | ||||
-rwxr-xr-x | view/tpl/jot.tpl | 12 |
13 files changed, 80 insertions, 18 deletions
@@ -1,3 +1,13 @@ +Hubzilla 3.8.9 (2018-02-03) + - Fix typos in mod oep + - Fix page jumping when liking collapsed/expanded post + - Fix failure to import mail in mod import + - Fix wrong channel count in mod new_channel + - Fix diaspora addon regression + - Remove deprecated diaspora addon endpoint + - Fix wrong function call in gallery addon + + Hubzilla 3.8.8 (2018-12-22) - Fix issue with linkinfo - Fix cURL with HTTP/2 diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 83d243177..7ce0d0f9e 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -101,6 +101,7 @@ class ThreadItem { || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) ? t('Private Message') : false); + $shareable = ((($conv->get_profile_owner() == local_channel() && local_channel()) && ($item['item_private'] != 1)) ? true : false); // allow an exemption for sharing stuff from your private feeds @@ -115,6 +116,16 @@ class ThreadItem { $privacy_warning = true; } + if ($lock) { + if (count(get_terms_oftype($item['term'],TERM_FORUM))) { + $privacy_warning = true; + } + } + + if ($lock && $privacy_warning) { + $lock = t('Privacy conflict. Discretion advised.'); + } + $mode = $conv->get_mode(); switch($item['item_type']) { @@ -411,9 +422,9 @@ class ThreadItem { 'rawmid' => $item['mid'], 'plink' => get_plink($item), 'edpost' => $edpost, // ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''), - 'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''), + 'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts') && ($item['item_type'] == ITEM_TYPE_POST)) ? $star : ''), 'tagger' => ((feature_enabled($conv->get_profile_owner(),'commtag')) ? $tagger : ''), - 'filer' => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''), + 'filer' => ((feature_enabled($conv->get_profile_owner(),'filing') && ($item['item_type'] == ITEM_TYPE_POST)) ? $filer : ''), 'bookmark' => (($conv->get_profile_owner() == local_channel() && local_channel() && $has_bookmarks) ? t('Save Bookmarks') : ''), 'addtocal' => (($has_event) ? t('Add to Calendar') : ''), 'drop' => $drop, diff --git a/Zotlabs/Module/Oep.php b/Zotlabs/Module/Oep.php index 0f20a5f9a..c0d8e15e5 100644 --- a/Zotlabs/Module/Oep.php +++ b/Zotlabs/Module/Oep.php @@ -181,7 +181,7 @@ class Oep extends \Zotlabs\Web\Controller { dbesc($res) ); if($r) { - $sql_extra = "and item.id = " . intval($r[0]['iid']) . " "; + $sql_extra .= " and item.id = " . intval($r[0]['iid']) . " "; } else { return $ret; @@ -194,6 +194,9 @@ class Oep extends \Zotlabs\Web\Controller { intval(ITEM_TYPE_CARD) ); + if(! $r) + return; + $item_normal = " and item.item_hidden = 0 and item.item_type in (0,6) and item.item_deleted = 0 and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0 and item.item_blocked = 0 "; @@ -255,7 +258,6 @@ class Oep extends \Zotlabs\Web\Controller { if(! $channel) return $ret; - if(! perm_is_allowed($channel['channel_id'],get_observer_hash(),'view_pages')) return $ret; @@ -265,7 +267,7 @@ class Oep extends \Zotlabs\Web\Controller { dbesc($res) ); if($r) { - $sql_extra = "and item.id = " . intval($r[0]['iid']) . " "; + $sql_extra .= " and item.id = " . intval($r[0]['iid']) . " "; } else { return $ret; @@ -278,6 +280,9 @@ class Oep extends \Zotlabs\Web\Controller { intval(ITEM_TYPE_ARTICLE) ); + if(! $r) + return; + $item_normal = " and item.item_hidden = 0 and item.item_type in (0,7) and item.item_deleted = 0 and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0 and item.item_blocked = 0 "; diff --git a/Zotlabs/Module/Viewsrc.php b/Zotlabs/Module/Viewsrc.php index 119990b57..b73d81283 100644 --- a/Zotlabs/Module/Viewsrc.php +++ b/Zotlabs/Module/Viewsrc.php @@ -28,7 +28,7 @@ class Viewsrc extends \Zotlabs\Web\Controller { $item_normal = item_normal(); if(local_channel() && $item_id) { - $r = q("select id, item_flags, mimetype, item_obscured, body, llink, plink from item where uid in (%d , %d) and id = %d $item_normal limit 1", + $r = q("select id, mid, item_flags, mimetype, item_obscured, body, llink, plink from item where uid in (%d , %d) and id = %d $item_normal limit 1", intval(local_channel()), intval($sys['channel_id']), intval($item_id) @@ -53,7 +53,7 @@ class Viewsrc extends \Zotlabs\Web\Controller { if(is_ajax()) { echo '<div class="p-1">'; - echo '<div>id: ' . $r[0]['id'] . ' | <a href="' . $r[0]['plink'] . '" target="_blank">plink</a> | <a href="' . $r[0]['llink'] . '" target="_blank">llink</a></div>'; + echo '<div>id: ' . $r[0]['id'] . ' | <a href="' . $r[0]['plink'] . '" target="_blank">plink</a> | <a href="' . $r[0]['llink'] . '" target="_blank">llink</a><br>mid: ' . $r[0]['mid'] . '</div>'; echo '<hr>'; echo '<pre class="p-1">' . $o . '</pre>'; echo '</div>'; @@ -513,6 +513,7 @@ define ( 'ACTIVITY_MOOD', NAMESPACE_ZOT . '/activity/mood' ); define ( 'ACTIVITY_OBJ_COMMENT', NAMESPACE_ACTIVITY_SCHEMA . 'comment' ); define ( 'ACTIVITY_OBJ_ACTIVITY',NAMESPACE_ACTIVITY_SCHEMA . 'activity' ); define ( 'ACTIVITY_OBJ_NOTE', NAMESPACE_ACTIVITY_SCHEMA . 'note' ); +define ( 'ACTIVITY_OBJ_ARTICLE', NAMESPACE_ACTIVITY_SCHEMA . 'article' ); define ( 'ACTIVITY_OBJ_PERSON', NAMESPACE_ACTIVITY_SCHEMA . 'person' ); define ( 'ACTIVITY_OBJ_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'photo' ); define ( 'ACTIVITY_OBJ_P_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'profile-photo' ); diff --git a/doc/hook/jot_header_tpl_filter.bb b/doc/hook/jot_header_tpl_filter.bb new file mode 100644 index 000000000..b17d81d03 --- /dev/null +++ b/doc/hook/jot_header_tpl_filter.bb @@ -0,0 +1,5 @@ +[h2]jot_header_tpl_filter[/h2] + +Allows addon developers to modify the values of replacements fed into jot-header.tpl + +cxref: include/conversation.php diff --git a/doc/hook/jot_tpl_filter.bb b/doc/hook/jot_tpl_filter.bb new file mode 100644 index 000000000..426da3c56 --- /dev/null +++ b/doc/hook/jot_tpl_filter.bb @@ -0,0 +1,5 @@ +[h2]jot_tpl_filter[/h2] + +Allows addon developers to alter the macro replacements prior to being fed into jot.tpl + +cxref: include/conversation.php diff --git a/doc/hooklist.bb b/doc/hooklist.bb index 6d56d5e71..5a804c819 100644 --- a/doc/hooklist.bb +++ b/doc/hooklist.bb @@ -370,6 +370,12 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the [zrl=[baseurl]/help/hook/jot_tool]jot_tool[/zrl] Deprecated and possibly obsolete. Allows one to add action buttons to the post editor. +[zrl=[baseurl]/help/hook/jot_tpl_filter]jot_tpl_filter[/zrl] + Called to filter template vars before replacement in jot.tpl. + +[zrl=[baseurl]/help/hook/jot_header_tpl_filter]jot_header_tpl_filter[/zrl] + Called to filter template vars before replacement in jot_header.tpl. + [zrl=[baseurl]/help/hook/legal_webbie]legal_webbie[/zrl] Called to validate a channel address diff --git a/include/conversation.php b/include/conversation.php index 041994b90..e2dd02ffc 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1328,7 +1328,7 @@ function hz_status_editor($a, $x, $popup = false) { $tpl = get_markup_template('jot-header.tpl'); - App::$page['htmlhead'] .= replace_macros($tpl, array( + $tplmacros = [ '$baseurl' => z_root(), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$pretext' => ((x($x,'pretext')) ? $x['pretext'] : ''), @@ -1349,7 +1349,10 @@ function hz_status_editor($a, $x, $popup = false) { '$nocomment_disabled' => t('Comments disabled'), '$auto_save_draft' => $feature_auto_save_draft, '$reset' => $reset - )); + ]; + + call_hooks('jot_header_tpl_filter',$tplmacros); + App::$page['htmlhead'] .= replace_macros($tpl, $tplmacros); $tpl = get_markup_template('jot.tpl'); @@ -1389,7 +1392,7 @@ function hz_status_editor($a, $x, $popup = false) { $sharebutton = (x($x,'button') ? $x['button'] : t('Share')); $placeholdtext = (x($x,'content_label') ? $x['content_label'] : $sharebutton); - $o .= replace_macros($tpl, array( + $tplmacros = [ '$return_path' => ((x($x, 'return_path')) ? $x['return_path'] : App::$query_string), '$action' => z_root() . '/item', '$share' => $sharebutton, @@ -1463,9 +1466,15 @@ function hz_status_editor($a, $x, $popup = false) { '$bbcode' => ((x($x, 'bbcode')) ? $x['bbcode'] : false), '$parent' => ((array_key_exists('parent',$x) && $x['parent']) ? $x['parent'] : 0), '$reset' => $reset, - '$is_owner' => ((local_channel() && (local_channel() == $x['profile_uid'])) ? true : false) - )); + '$is_owner' => ((local_channel() && (local_channel() == $x['profile_uid'])) ? true : false), + '$custommoretoolsdropdown' => '', + '$custommoretoolsbuttons' => '', + '$customsubmitright' => [] + ]; + + call_hooks('jot_tpl_filter',$tplmacros); + $o .= replace_macros($tpl, $tplmacros); if ($popup === true) { $o = '<div id="jot-popup" style="display:none">' . $o . '</div>'; } diff --git a/include/text.php b/include/text.php index d94196662..b017b038a 100644 --- a/include/text.php +++ b/include/text.php @@ -1107,7 +1107,7 @@ function searchbox($s,$id='search-box',$url='/search',$save = false) { * @return string */ function linkify($s, $me = false) { - $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\_\@\~\#\'\%\$\!\+\,\@]*)/u", (($me) ? ' <a href="$1" rel="me" >$1</a>' : ' <a href="$1" >$1</a>'), $s); + $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\_\@\~\#\'\%\$\!\+\,\@]*)/u", (($me) ? ' <a href="$1" rel="me nofollow" >$1</a>' : ' <a href="$1" >$1</a>'), $s); $s = preg_replace("/\<(.*?)(src|href)=(.*?)\&\;(.*?)\>/ism",'<$1$2=$3&$4>',$s); return($s); diff --git a/view/ru/hmessages.po b/view/ru/hmessages.po index f8c34f95d..79808438a 100644 --- a/view/ru/hmessages.po +++ b/view/ru/hmessages.po @@ -2230,7 +2230,7 @@ msgstr "Не удалось сохранить информацию аккаун #: ../../include/account.php:314 #, php-format msgid "Registration confirmation for %s" -msgstr "Подтверждение регистрации для %s" +msgstr "Подтверждение регистрации на %s" #: ../../include/account.php:385 #, php-format @@ -4523,7 +4523,7 @@ msgid "" "A verification token was sent to your email address [%s]. Enter that token " "here to complete the account verification step. Please allow a few minutes " "for delivery, and check your spam folder if you do not see the message." -msgstr "Проверочный токен был выслн на ваш адрес электронной почты [%s]. Введите этот токен здесь для завершения этапа проверки учётной записи. Пожалуйста, подождите несколько минут для завершения доставки и проверьте вашу папку \"Спам\" если вы не видите письма." +msgstr "Проверочный токен был отправлен на ваш адрес электронной почты [%s]. Введите этот токен здесь для завершения этапа проверки учётной записи. Пожалуйста, подождите несколько минут для завершения доставки и проверьте вашу папку \"Спам\" если вы не видите письма." #: ../../Zotlabs/Module/Email_validation.php:38 msgid "Resend Email" diff --git a/view/ru/hstrings.php b/view/ru/hstrings.php index ee4c31619..90bb2b855 100644 --- a/view/ru/hstrings.php +++ b/view/ru/hstrings.php @@ -444,7 +444,7 @@ App::$strings["An invitation is required."] = "Требуется приглаш App::$strings["Invitation could not be verified."] = "Не удалось проверить приглашение."; App::$strings["Please enter the required information."] = "Пожалуйста, введите необходимую информацию."; App::$strings["Failed to store account information."] = "Не удалось сохранить информацию аккаунта."; -App::$strings["Registration confirmation for %s"] = "Подтверждение регистрации для %s"; +App::$strings["Registration confirmation for %s"] = "Подтверждение регистрации на %s"; App::$strings["Registration request at %s"] = "Запрос регистрации на %s"; App::$strings["your registration password"] = "ваш пароль регистрации"; App::$strings["Registration details for %s"] = "Регистрационные данные для %s"; @@ -998,7 +998,7 @@ App::$strings["Privacy group: "] = "Группа безопасности: "; App::$strings["Invalid channel."] = "Недействительный канал."; App::$strings["Token verification failed."] = "Не удалось выполнить проверку токена."; App::$strings["Email Verification Required"] = "Требуется проверка адреса email"; -App::$strings["A verification token was sent to your email address [%s]. Enter that token here to complete the account verification step. Please allow a few minutes for delivery, and check your spam folder if you do not see the message."] = "Проверочный токен был выслн на ваш адрес электронной почты [%s]. Введите этот токен здесь для завершения этапа проверки учётной записи. Пожалуйста, подождите несколько минут для завершения доставки и проверьте вашу папку \"Спам\" если вы не видите письма."; +App::$strings["A verification token was sent to your email address [%s]. Enter that token here to complete the account verification step. Please allow a few minutes for delivery, and check your spam folder if you do not see the message."] = "Проверочный токен был отправлен на ваш адрес электронной почты [%s]. Введите этот токен здесь для завершения этапа проверки учётной записи. Пожалуйста, подождите несколько минут для завершения доставки и проверьте вашу папку \"Спам\" если вы не видите письма."; App::$strings["Resend Email"] = "Выслать повторно"; App::$strings["Validation token"] = "Проверочный токен"; App::$strings["No channel."] = "Канала нет."; diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index 4eae33d13..12509fc59 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -137,8 +137,11 @@ <i id="profile-nocomment" class="fa fa-comments jot-icons"></i> </button> {{/if}} + {{if $custommoretoolsbuttons}} + {{$custommoretoolsbuttons}} + {{/if}} </div> - {{if $writefiles || $weblink || $setloc || $clearloc || $feature_expire || $feature_encrypt || $feature_voting}} + {{if $writefiles || $weblink || $setloc || $clearloc || $feature_expire || $feature_encrypt || $feature_voting || $custommoretoolsdropdown}} <div class="btn-group d-lg-none"> <button type="button" id="more-tools" class="btn btn-outline-secondary btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> <i id="more-tools-icon" class="fa fa-cog jot-icons"></i> @@ -176,6 +179,8 @@ {{if $feature_nocomment}} <a class="dropdown-item" href="#" onclick="toggleNoComment(); return false;"><i id="profile-nocomment-sub" class="fa fa-comments"></i> {{$nocommenttitlesub}}</a> {{/if}} + <hr /> + {{$custommoretoolsdropdown}} </div> </div> {{/if}} @@ -186,6 +191,11 @@ </div> </div> <div id="profile-jot-submit-right" class="btn-group float-right"> + {{foreach $customsubmitright as $csr}} + <button class="btn btn-outline-secondary btn-sm" {{$csr.buttonparams}} title="{{$csr.preview}}"> + {{$csr.buttoncontent}} + </button> + {{/foreach}} {{if $preview}} <button class="btn btn-outline-secondary btn-sm" onclick="preview_post();return false;" title="{{$preview}}"> <i class="fa fa-eye jot-icons" ></i> |