Skip to content

Instantly share code, notes, and snippets.

@bovine
Created April 1, 2012 06:23
Show Gist options
  • Save bovine/2271967 to your computer and use it in GitHub Desktop.
Save bovine/2271967 to your computer and use it in GitHub Desktop.
Zoneminder 1.25.0 patch: display configuration help in a tooltip or alert box rather than a new window. make configuration radio buttons easier to click by using labels.
--- web/skins/classic/views/options.php (revision 3648)
+++ web/skins/classic/views/options.php (working copy)
@@ -211,10 +211,13 @@
{
$shortName = preg_replace( '/^ZM_/', '', $name );
$optionPromptText = !empty($OLANG[$shortName])?$OLANG[$shortName]:$value['Prompt'];
+
+ $optionHelpText = !empty($OLANG[$shortName])?$OLANG[$shortName]:$config[$name]['Help'];
+ $optionHelpText = preg_replace( "/~~/", "\n", $optionHelpText );
?>
<tr>
<td><?= $shortName ?></td>
- <td><?= validHtmlStr($optionPromptText) ?>&nbsp;(<?= makePopupLink( '?view=optionhelp&amp;option='.$name, 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td>
+ <td><?= validHtmlStr($optionPromptText) ?>&nbsp;(<a href="#" onclick="alert(this.getAttribute('title'))" title="<?= htmlentities($optionHelpText) ?>)">?</a>)</td>
<?php
if ( $value['Type'] == "boolean" )
{
@@ -266,7 +269,7 @@
$optionLabel = $optionValue = $option;
}
?>
- <span><input type="radio" id="<?= $name.'_'.preg_replace( '/[^a-zA-Z0-9]/', '', $optionValue ) ?>" name="newConfig[<?= $name ?>]" value="<?= $optionValue ?>"<?php if ( $value['Value'] == $optionValue ) { ?> checked="checked"<?php } ?><?= $canEdit?'':' disabled="disabled"' ?>/>&nbsp;<?= htmlspecialchars($optionLabel) ?></span>
+ <span><input type="radio" id="<?= $name.'_'.preg_replace( '/[^a-zA-Z0-9]/', '', $optionValue ) ?>" name="newConfig[<?= $name ?>]" value="<?= $optionValue ?>"<?php if ( $value['Value'] == $optionValue ) { ?> checked="checked"<?php } ?><?= $canEdit?'':' disabled="disabled"' ?>/>&nbsp;<label for="<?= $name.'_'.preg_replace( '/[^a-zA-Z0-9]/', '', $optionValue ) ?>"><?= htmlspecialchars($optionLabel) ?></label></span>
<?php
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment