Enable/Disable Snapshots based on ZM_FEATURES_SNAPSHOTS config setting

This commit is contained in:
Isaac Connor 2021-05-04 13:19:40 -04:00
parent 9ee5e983d6
commit 0b6e414998
4 changed files with 10 additions and 2 deletions

View File

@ -718,7 +718,7 @@ function getMontageReviewHTML($view) {
function getSnapshotsHTML($view) {
$result = '';
if ( canView('Snapshots') ) {
if (defined('ZM_FEATURES_SNAPSHOTS') and ZM_FEATURES_SNAPSHOTS and canView('Snapshots')) {
$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;
}

View File

@ -200,10 +200,12 @@ if ( canView('System') ) {
<button type="button" value="Cancel" data-on-click-this="cancel_layout"><?php echo translate('Cancel') ?></button>
</span>
<?php if (defined('ZM_FEATURES_SNAPSHOTS') and ZM_FEATURES_SNAPSHOTS) { ?>
<button type="button" name="snapshotBtn" data-on-click-this="takeSnapshot">
<i class="material-icons md-18">camera_enhance</i>
&nbsp;<?php echo translate('Snapshot') ?>
</button>
<?php } ?>
</form>
</div>
</div>

View File

@ -18,9 +18,12 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
if ( !canView('Snapshots') ) {
if (!canView('Snapshots')) {
$view = 'error';
return;
} else if (!ZM_FEATURES_SNAPSHOTS) {
$view = 'console';
return;
}
require_once('includes/Event.php');

View File

@ -21,6 +21,9 @@
if (!canView('Snapshots')) {
$view = 'error';
return;
} else if (!ZM_FEATURES_SNAPSHOTS) {
$view = 'console';
return;
}
require_once('includes/Event.php');