Skip to content

Commit

Permalink
Don't show ONVIf probe link when ONVIF support is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
knight-of-ni committed Feb 21, 2015
1 parent 42744f4 commit 4182fb3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,12 @@ if(NOT ZM_NO_MMAP)
set(ZM_MMAP_PERLPACKAGE "Sys::Mmap")
endif(NOT ZM_NO_MMAP)

# Check for the ONVIF flag and enable ZM_HAS_ONVIF accordingly
set(ZM_HAS_ONVIF 0)
if(ZM_ONVIF)
set(ZM_HAS_ONVIF 1)
endif(ZM_ONVIF)

# Check for authenication functions
if(HAVE_OPENSSL_MD5_H)
set(CMAKE_REQUIRED_LIBRARIES "${OPENSSL_LIBRARIES}")
Expand Down
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ AM_CONDITIONAL([COND_ONVIF], [test "$enable_onvif" = yes])

# Compiler
AC_LANG_CPLUSPLUS
if test "$ENABLE_ONVIF" == "yes"; then
AC_SUBST(ZM_HAS_ONVIF,1)
else
AC_SUBST(ZM_HAS_ONVIF,0)
fi

# Checks for programs.
AC_PROG_CXX
Expand Down
5 changes: 5 additions & 0 deletions web/includes/config.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ define( "ZM_HAS_V4L2", "@ZM_HAS_V4L2@" ); // V4L2 support enabled
define( "ZM_HAS_V4L1", "@ZM_HAS_V4L1@" ); // V4L1 support enabled
define( "ZM_HAS_V4L", "@ZM_HAS_V4L@" ); // V4L support enabled

//
// If ONVIF support has been built in
//
define( "ZM_HAS_ONVIF", "@ZM_HAS_ONVIF@" ); // ONVIF support enabled

//
// If PCRE dev libraries are installed
//
Expand Down
9 changes: 8 additions & 1 deletion web/skins/classic/views/monitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,14 @@ function fourcc( $a, $b, $c, $d )
?>
<div id="headerButtons">
<a href="#" onclick="createPopup( '?view=monitorprobe&amp;mid=<?php echo $monitor['Id'] ?>', 'zmMonitorProbe<?php echo $monitor['Id'] ?>', 'monitorprobe' ); return( false );"><?php echo $SLANG['Probe'] ?></a>
<a href="#" onclick="createPopup( '?view=onvifprobe&amp;mid=<?php echo $monitor['Id'] ?>', 'zmOnvifProbe<?php echo $monitor['Id'] ?>', 'onvifprobe' ); return( false );"><?php echo $SLANG['OnvifProbe'] ?></a>
<?php
if ( ZM_HAS_ONVIF )
{
?>
<a href="#" onclick="createPopup( '?view=onvifprobe&amp;mid=<?php echo $monitor['Id'] ?>', 'zmOnvifProbe<?php echo $monitor['Id'] ?>', 'onvifprobe' ); return( false );"><?php echo $SLANG['OnvifProbe'] ?></a>
<?php
}
?>
<a href="#" onclick="createPopup( '?view=monitorpreset&amp;mid=<?php echo $monitor['Id'] ?>', 'zmMonitorPreset<?php echo $monitor['Id'] ?>', 'monitorpreset' ); return( false );"><?php echo $SLANG['Presets'] ?></a>
</div>
<?php
Expand Down

0 comments on commit 4182fb3

Please sign in to comment.