diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-12-10 10:37:29 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-12-10 10:37:29 +0100 |
commit | 7894fed7413ab3bd782bf939b17ca70bf0196d28 (patch) | |
tree | ecc25ba39873fabab3623445f5c8911ba586a060 /Zotlabs | |
parent | d12744011affe7f6b79201442ad9fce6e083bdbb (diff) | |
download | volse-hubzilla-7894fed7413ab3bd782bf939b17ca70bf0196d28.tar.gz volse-hubzilla-7894fed7413ab3bd782bf939b17ca70bf0196d28.tar.bz2 volse-hubzilla-7894fed7413ab3bd782bf939b17ca70bf0196d28.zip |
add photo_view_filter hook and fix minor issue with unset auto_save_draft variable which resultet in a javascript error
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Photos.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index 21f6293ef..b87c586da 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -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; |