more work on photos
This commit is contained in:
parent
c909b8be06
commit
11e8fe3085
@ -855,16 +855,14 @@ function photos_content(&$a) {
|
|||||||
$tools = array(
|
$tools = array(
|
||||||
'profile'=>array($a->get_baseurl() . '/profile_photo/use/'.$ph[0]['resource_id'], t('Use as profile photo')),
|
'profile'=>array($a->get_baseurl() . '/profile_photo/use/'.$ph[0]['resource_id'], t('Use as profile photo')),
|
||||||
);
|
);
|
||||||
|
|
||||||
// lock
|
|
||||||
$lock = ( ( ($ph[0]['uid'] == local_user()) && (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid'])
|
|
||||||
|| strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid'])) )
|
|
||||||
? t('Private Message')
|
|
||||||
: Null);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// lock
|
||||||
|
$lock = ( ( (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid'])
|
||||||
|
|| strlen($ph[0]['deny_cid']) || strlen($ph[0]['deny_gid'])) )
|
||||||
|
? t('Private Photo')
|
||||||
|
: Null);
|
||||||
|
|
||||||
$a->page['htmlhead'] .= '<script>$(document).keydown(function(event) {' . "\n";
|
$a->page['htmlhead'] .= '<script>$(document).keydown(function(event) {' . "\n";
|
||||||
if($prevlink)
|
if($prevlink)
|
||||||
$a->page['htmlhead'] .= 'if(event.ctrlKey && event.keyCode == 37) { event.preventDefault(); window.location.href = \'' . $prevlink . '\'; }' . "\n";
|
$a->page['htmlhead'] .= 'if(event.ctrlKey && event.keyCode == 37) { event.preventDefault(); window.location.href = \'' . $prevlink . '\'; }' . "\n";
|
||||||
@ -873,7 +871,7 @@ function photos_content(&$a) {
|
|||||||
$a->page['htmlhead'] .= '});</script>';
|
$a->page['htmlhead'] .= '});</script>';
|
||||||
|
|
||||||
if($prevlink)
|
if($prevlink)
|
||||||
$prevlink = array($prevlink, '<i class="icon-backward photo-icons""></i>') ;
|
$prevlink = array($prevlink, t('Previous'));
|
||||||
|
|
||||||
$photo = array(
|
$photo = array(
|
||||||
'href' => $a->get_baseurl() . '/photo/' . $hires['resource_id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
|
'href' => $a->get_baseurl() . '/photo/' . $hires['resource_id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
|
||||||
@ -882,7 +880,7 @@ function photos_content(&$a) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if($nextlink)
|
if($nextlink)
|
||||||
$nextlink = array($nextlink, '<i class="icon-forward photo-icons"></i>');
|
$nextlink = array($nextlink, t('Next'));
|
||||||
|
|
||||||
|
|
||||||
// Do we have an item for this photo?
|
// Do we have an item for this photo?
|
||||||
@ -1122,6 +1120,8 @@ function photos_content(&$a) {
|
|||||||
'$prevlink' => $prevlink,
|
'$prevlink' => $prevlink,
|
||||||
'$nextlink' => $nextlink,
|
'$nextlink' => $nextlink,
|
||||||
'$desc' => $ph[0]['description'],
|
'$desc' => $ph[0]['description'],
|
||||||
|
'$filename' => $ph[0]['filename'],
|
||||||
|
'$unknown' => t('Unknown'),
|
||||||
'$tag_hdr' => t('In This Photo:'),
|
'$tag_hdr' => t('In This Photo:'),
|
||||||
'$tags' => $tags,
|
'$tags' => $tags,
|
||||||
'$edit' => $edit,
|
'$edit' => $edit,
|
||||||
|
@ -3,19 +3,9 @@
|
|||||||
margin-bottom: 25px;
|
margin-bottom: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#photo-view-wrapper {
|
|
||||||
float:left;
|
|
||||||
min-width: 500px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
#photo-prev-link, #photo-next-link {
|
|
||||||
padding: 10px;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
#photo-photo {
|
#photo-photo {
|
||||||
float: left;
|
display: table;
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
#photo-photo-end {
|
#photo-photo-end {
|
||||||
|
@ -1,39 +1,33 @@
|
|||||||
<div id="live-photos"></div>
|
<div id="live-photos"></div>
|
||||||
<div class="generic-content-wrapper-styled">
|
<div class="generic-content-wrapper">
|
||||||
<h3><a href="{{$album.0}}">{{$album.1}}</a></h3>
|
|
||||||
|
|
||||||
|
<div class="section-title-wrapper">
|
||||||
|
|
||||||
|
<div class="btn-group btn-group-xs pull-right">
|
||||||
|
{{if $prevlink}}
|
||||||
|
<a href="{{$prevlink.0}}" class="btn btn-default" title="{{$prevlink.1}}"><i class="icon-backward"></i></a>
|
||||||
|
{{/if}}
|
||||||
|
{{if $nextlink}}
|
||||||
|
<a href="{{$nextlink.0}}" class="btn btn-default" title="{{$nextlink.1}}"><i class="icon-forward"></i></a>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
<div class="btn-group btn-group-xs pull-right dropdown">
|
||||||
|
{{if $edit}}
|
||||||
|
<i class="icon-pencil btn btn-default" title="{{$edit.edit}}" onclick="openClose('photo-edit-edit');"></i>
|
||||||
|
{{/if}}
|
||||||
|
{{if $lock}}
|
||||||
|
<i class="icon-lock btn btn-default dropdown-toggle" data-toggle="dropdown" title="{{$lock}}" onclick="lockview(event,{{$id}});" ></i><ul id="panel-{{$id}}" class="lockview-panel dropdown-menu"></ul>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2>{{if $desc}}{{$desc}}{{elseif $filename}}{{$filename}}{{else}}{{$unknown}}{{/if}}</h2>
|
||||||
|
<div class="clear"></div>
|
||||||
|
</div>
|
||||||
<div id="photo-edit-link-wrap">
|
<div id="photo-edit-link-wrap">
|
||||||
|
|
||||||
{{if $lock}}
|
|
||||||
<div class="wall-item-lock dropdown">
|
|
||||||
<i class="icon-lock lockview dropdown-toggle" data-toggle="dropdown" title="{{$lock}}" onclick="lockview(event,{{$id}});" ></i><ul id="panel-{{$id}}" class="lockview-panel dropdown-menu"></ul>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
|
|
||||||
{{if $tools}}
|
|
||||||
<div>
|
|
||||||
<a id="photo-toprofile-link" href="{{$tools.profile.0}}">{{$tools.profile.1}}</a>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
||||||
{{if $prevlink}}<div id="photo-prev-link"><a href="{{$prevlink.0}}"><i class="icon-backward photo-icons"></i></div>{{/if}}
|
|
||||||
<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="max-width: 100%;" src="{{$photo.src}}"></a></div>
|
|
||||||
<div id="photo-photo-end"></div>
|
|
||||||
<div id="photo-caption">{{$desc}}</div>
|
|
||||||
{{if $tags}}
|
|
||||||
<div id="in-this-photo-text">{{$tag_hdr}}</div>
|
|
||||||
{{foreach $tags as $t}}
|
|
||||||
<div id="in-this-photo">{{$t.0}}</div>
|
|
||||||
{{if $edit}}<div id="tag-remove"><a href="{{$t.1}}">{{$t.2}}</a></div>{{/if}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{if $edit}}
|
|
||||||
<div id="photo-edit-edit-wrapper" class="btn btn-default fakelink" onclick="openClose('photo-edit-edit'); closeOpen('photo-photo-delete-button')">{{$edit.edit}}</div>
|
|
||||||
<div id="photo-edit-edit" style="display: none;">
|
<div id="photo-edit-edit" style="display: none;">
|
||||||
<form action="photos/{{$edit.nickname}}/{{$edit.resource_id}}" method="post" id="photo_edit_form">
|
<form action="photos/{{$edit.nickname}}/{{$edit.resource_id}}" method="post" id="photo_edit_form">
|
||||||
|
|
||||||
@ -87,11 +81,26 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form action="photos/{{$edit.nickname}}/{{$edit.resource_id}}" method="post">
|
{{if $tools}}
|
||||||
<input id="photo-photo-delete-button" type="submit" name="delete" value="{{$edit.delete}}" onclick="return confirmDelete();">
|
<div>
|
||||||
</form>
|
<a id="photo-toprofile-link" href="{{$tools.profile.0}}">{{$tools.profile.1}}</a>
|
||||||
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
<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-end"></div>
|
||||||
|
|
||||||
|
{{if $tags}}
|
||||||
|
<div id="in-this-photo-text">{{$tag_hdr}}</div>
|
||||||
|
{{foreach $tags as $t}}
|
||||||
|
<div id="in-this-photo">{{$t.0}}</div>
|
||||||
|
{{if $edit}}<div id="tag-remove"><a href="{{$t.1}}">{{$t.2}}</a></div>{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{if $likebuttons}}
|
{{if $likebuttons}}
|
||||||
<div id="photo-like-div">
|
<div id="photo-like-div">
|
||||||
{{$likebuttons}}
|
{{$likebuttons}}
|
||||||
@ -108,8 +117,6 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{if $nextlink}}<div id="photo-next-link"><a href="{{$nextlink.0}}"><i class="icon-forward photo-icons"></i></a></div>{{/if}}
|
|
||||||
|
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user