From a995d72ebd5f561e0a53183a1a7347bb24756758 Mon Sep 17 00:00:00 2001
From: Andrew Bauer <knnniggett@users.sourceforge.net>
Date: Sat, 22 Aug 2015 12:36:49 -0500
Subject: [PATCH] add warning and help text for maxfps fields

---
 web/lang/en_gb.php                  | 11 ++++++++++-
 web/skins/classic/views/monitor.php | 14 ++++++++++++--
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/web/lang/en_gb.php b/web/lang/en_gb.php
index bf0258caf..6112aaf8c 100644
--- a/web/lang/en_gb.php
+++ b/web/lang/en_gb.php
@@ -903,7 +903,16 @@ $OLANG = array(
 	'OPTIONS_EXIF' => array(
 		'Help' => "Enable this option to embed EXIF data into each jpeg frame."
 	),
-
+	'OPTIONS_MAXFPS' => array(
+		'Help' => "This field has certain limitations when used for non-local devices.~~ ".
+		          "Failure to adhere to these limitations will cause a delay in live video, irregular frame skipping, ".
+		          "and missed events~~".
+		          "For streaming IP cameras, do not use this field to reduce the frame rate. Set the frame rate in the".
+                          " camera, instead. You can, however, use a value that is slightly higher than the frame rate in the camera. ".
+		          "In this case, this helps keep the cpu from being overtaxed in the event of a network problem.~~". 
+		          "Some, mostly older, IP cameras support snapshot mode. In this case ZoneMinder is actively polling the camera ".
+		          "for new images. In this case, it is safe to use thie field."
+	),
 	
 //    'LANG_DEFAULT' => array(
 //        'Prompt' => "This is a new prompt for this option",
diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php
index 5920409ad..7935e4f5c 100644
--- a/web/skins/classic/views/monitor.php
+++ b/web/skins/classic/views/monitor.php
@@ -680,9 +680,19 @@ switch ( $tab )
               </td>
             </tr>
             <tr><td><?php echo translate('AnalysisFPS') ?></td><td><input type="text" name="newMonitor[AnalysisFPS]" value="<?php echo validHtmlStr($newMonitor['AnalysisFPS']) ?>" size="6"/></td></tr>
-            <tr><td><?php echo translate('MaximumFPS') ?></td><td><input type="text" name="newMonitor[MaxFPS]" value="<?php echo validHtmlStr($newMonitor['MaxFPS']) ?>" size="6"/></td></tr>
-            <tr><td><?php echo translate('AlarmMaximumFPS') ?></td><td><input type="text" name="newMonitor[AlarmMaxFPS]" value="<?php echo validHtmlStr($newMonitor['AlarmMaxFPS']) ?>" size="6"/></td></tr>
 <?php
+    if ( $newMonitor['Type'] != "Local" && $newMonitor['Type'] != "File" )
+    {
+?>
+            <tr><td><?php echo translate('MaximumFPS') ?>&nbsp;(<?php echo makePopupLink('?view=optionhelp&amp;option=OPTIONS_MAXFPS', 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" onclick="document.getElementById('newMonitor[MaxFPS]').innerHTML= ' CAUTION: See the help text'" name="newMonitor[MaxFPS]" value="<?php echo validHtmlStr($newMonitor['MaxFPS']) ?>" size="5"/><span id="newMonitor[MaxFPS]" style="color:red"></span></td></tr>
+            <tr><td><?php echo translate('AlarmMaximumFPS') ?>&nbsp;(<?php echo makePopupLink('?view=optionhelp&amp;option=OPTIONS_MAXFPS', 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" onclick="document.getElementById('newMonitor[AlarmMaxFPS]').innerHTML= ' CAUTION: See the help text'" name="newMonitor[AlarmMaxFPS]" value="<?php echo validHtmlStr($newMonitor['AlarmMaxFPS']) ?>" size="5"/><span id="newMonitor[AlarmMaxFPS]" style="color:red"></span></td></tr>
+<?php
+    } else {
+?>
+            <tr><td><?php echo translate('MaximumFPS') ?></td><td><input type="text" name="newMonitor[MaxFPS]" value="<?php echo validHtmlStr($newMonitor['MaxFPS']) ?>" size="5"/></td></tr>
+            <tr><td><?php echo translate('AlarmMaximumFPS') ?></td><td><input type="text" name="newMonitor[AlarmMaxFPS]" value="<?php echo validHtmlStr($newMonitor['AlarmMaxFPS']) ?>" size="5"/></td></tr>
+<?php
+    }
 	if ( ZM_FAST_IMAGE_BLENDS )
         {
 ?>