2015-12-08 20:34:32 +00:00
< ? php
2015-12-08 20:44:24 +00:00
/*
* LibreNMS
*
* Copyright (c) 2015 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
2016-08-18 20:28:22 -05:00
if ( defined ( 'SHOW_SETTINGS' ) || empty ( $widget_settings )) {
2015-12-08 20:34:32 +00:00
$common_output [] = '
<form class="form-horizontal" onsubmit="widget_settings(this); return false;">
2015-12-08 20:47:50 +00:00
<div class="form-group">
<div class="col-sm-12">
2018-02-11 03:27:04 +00:00
The following html tags are supported: <b>, <iframe>, <i>, <ul>, <ol>, <li>, <h1>, <h2>, <h3>, <h4>, <br>, <p>. If you want just text then wrap in <pre></pre>
2015-12-08 20:47:50 +00:00
</div>
</div>
2015-12-08 20:34:32 +00:00
<div class="form-group">
<label for="' . $unique_id . '_notes" class="col-sm-1" control-label"></label>
<div class="col-sm-11">
<textarea name="notes" id="' . $unique_id . '_notes" rows="3" class="form-control">' . htmlspecialchars ( $widget_settings [ 'notes' ]) . '</textarea>
</div>
</div>
<div class="form-group">
<div class="col-sm-1">
<button type="submit" class="btn btn-sm btn-primary">Set</button>
</div>
</div>
</form>' ;
2016-08-18 20:28:22 -05:00
} else {
2017-04-04 08:08:23 +01:00
$tmp_config = array (
2018-02-11 03:27:04 +00:00
'HTML.Allowed' => 'b,iframe[frameborder|src|width|height],i,ul,ol,li,h1,h2,h3,h4,br,p,pre' ,
2017-04-04 08:08:23 +01:00
'HTML.Trusted' => true ,
'HTML.SafeIframe' => true ,
2017-06-03 17:14:16 +01:00
'URI.SafeIframeRegexp' => '%^(https?:)?//%' ,
2017-04-04 08:08:23 +01:00
);
$common_output [] = display ( nl2br ( $widget_settings [ 'notes' ]), $tmp_config );
unset ( $tmp_config );
2015-12-08 20:34:32 +00:00
}