add photo_view_filter hook and fix minor issue with unset auto_save_draft variable which resultet in a javascript error
This commit is contained in:
parent
d12744011a
commit
7894fed741
@ -1122,6 +1122,7 @@ class Photos extends \Zotlabs\Web\Controller {
|
|||||||
$comments = '';
|
$comments = '';
|
||||||
if(! $r) {
|
if(! $r) {
|
||||||
if($observer && ($can_post || $can_comment)) {
|
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(
|
$commentbox = replace_macros($cmnt_tpl,array(
|
||||||
'$return_path' => '',
|
'$return_path' => '',
|
||||||
'$mode' => 'photos',
|
'$mode' => 'photos',
|
||||||
@ -1137,7 +1138,8 @@ class Photos extends \Zotlabs\Web\Controller {
|
|||||||
'$submit' => t('Submit'),
|
'$submit' => t('Submit'),
|
||||||
'$preview' => t('Preview'),
|
'$preview' => t('Preview'),
|
||||||
'$ww' => '',
|
'$ww' => '',
|
||||||
'$feature_encrypt' => false
|
'$feature_encrypt' => false,
|
||||||
|
'$auto_save_draft' => $feature_auto_save_draft
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1270,9 +1272,15 @@ class Photos extends \Zotlabs\Web\Controller {
|
|||||||
if(feature_enabled($owner_uid,'dislike'))
|
if(feature_enabled($owner_uid,'dislike'))
|
||||||
$response_verbs[] = 'dislike';
|
$response_verbs[] = 'dislike';
|
||||||
|
|
||||||
|
|
||||||
$responses = get_responses($conv_responses,$response_verbs,'',$link_item);
|
$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');
|
$photo_tpl = get_markup_template('photo_view.tpl');
|
||||||
$o .= replace_macros($photo_tpl, array(
|
$o .= replace_macros($photo_tpl, array(
|
||||||
'$id' => $ph[0]['id'],
|
'$id' => $ph[0]['id'],
|
||||||
@ -1309,6 +1317,7 @@ class Photos extends \Zotlabs\Web\Controller {
|
|||||||
'$comments' => $comments,
|
'$comments' => $comments,
|
||||||
'$commentbox' => $commentbox,
|
'$commentbox' => $commentbox,
|
||||||
'$paginate' => $paginate,
|
'$paginate' => $paginate,
|
||||||
|
'$onclick' => $hookdata['onclick']
|
||||||
));
|
));
|
||||||
|
|
||||||
\App::$data['photo_html'] = $o;
|
\App::$data['photo_html'] = $o;
|
||||||
|
1
doc/hook/photo_view_filter.bb
Normal file
1
doc/hook/photo_view_filter.bb
Normal file
@ -0,0 +1 @@
|
|||||||
|
[h2]photo_view_filter[/h2]
|
@ -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]
|
[zrl=[baseurl]/help/hook/photo_upload_form]photo_upload_form[/zrl]
|
||||||
Called when generating a photo upload form
|
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]
|
[zrl=[baseurl]/help/hook/poke_verbs]poke_verbs[/zrl]
|
||||||
Called when generating the list of actions for "poke" module
|
Called when generating the list of actions for "poke" module
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
<div id="photo-edit-end" class="clear"></div>
|
<div id="photo-edit-end" class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="photo-view-wrapper">
|
<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>
|
<div id="photo-photo-end" class="clear"></div>
|
||||||
{{if $tags}}
|
{{if $tags}}
|
||||||
<div class="photo-item-tools-left" id="in-this-photo">
|
<div class="photo-item-tools-left" id="in-this-photo">
|
||||||
|
Reference in New Issue
Block a user