Use Snapshots permission instead of Events permission for Snapshots
This commit is contained in:
parent
1b50314f9e
commit
f59a72a638
|
@ -718,7 +718,7 @@ function getMontageReviewHTML($view) {
|
||||||
function getSnapshotsHTML($view) {
|
function getSnapshotsHTML($view) {
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
if ( canView('Events') ) {
|
if ( canView('Snapshots') ) {
|
||||||
$class = $view == 'snapshots' ? ' selected' : '';
|
$class = $view == 'snapshots' ? ' selected' : '';
|
||||||
$result .= '<li id="getSnapshotsHTML" class="nav-item dropdown"><a class="nav-link'.$class.'" href="?view=snapshots">' .translate('Snapshots'). '</a></li>'.PHP_EOL;
|
$result .= '<li id="getSnapshotsHTML" class="nav-item dropdown"><a class="nav-link'.$class.'" href="?view=snapshots">' .translate('Snapshots'). '</a></li>'.PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
//
|
//
|
||||||
|
|
||||||
if ( !canView('Events') ) {
|
if ( !canView('Snapshots') ) {
|
||||||
$view = 'error';
|
$view = 'error';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ if ( !$snapshot->Id() ) {
|
||||||
<div id="content" class="justify-content-center">
|
<div id="content" class="justify-content-center">
|
||||||
<?php
|
<?php
|
||||||
$events = $snapshot->Events();
|
$events = $snapshot->Events();
|
||||||
$width = 100 / ( ( count($events) < 4 ) ? count($events) : 4 ) -1;
|
$width = 100 / ( count($events) < 2 ? 1 : ( ( count($events) < 4 ) ? count($events) : 4 ) )-1;
|
||||||
foreach ( $snapshot->Events() as $event ) {
|
foreach ( $snapshot->Events() as $event ) {
|
||||||
$imgSrc = $event->getThumbnailSrc(array(), '&');
|
$imgSrc = $event->getThumbnailSrc(array(), '&');
|
||||||
echo '<img src="?view=image&eid='.$event->Id().'&fid=snapshot" width="'.$width.'%"/>';
|
echo '<img src="?view=image&eid='.$event->Id().'&fid=snapshot" width="'.$width.'%"/>';
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
//
|
//
|
||||||
|
|
||||||
if ( !canView('Events') || (!empty($_REQUEST['execute']) && !canEdit('Events')) ) {
|
if (!canView('Snapshots')) {
|
||||||
$view = 'error';
|
$view = 'error';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue