* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see . */
/**
* Generic Image Widget
* @author Daniel Preussker
* @copyright 2015 Daniel Preussker, QuxLabs UG
* @license GPL
* @package LibreNMS
* @subpackage Widgets
*/
if (defined('SHOW_SETTINGS') || empty($widget_settings)) {
$common_output[] = '
';
} else {
$widget_settings['title'] = $widget_settings['image_title'];
if (strstr($widget_settings['image_url'], '@AUTO_HEIGHT@')) {
$widget_settings['image_url'] = str_replace('@AUTO_HEIGHT@', $widget_dimensions['y'], $widget_settings['image_url']);
}
if (strstr($widget_settings['image_url'], '@AUTO_WIDTH@')) {
$widget_settings['image_url'] = str_replace('@AUTO_WIDTH@', $widget_dimensions['x'], $widget_settings['image_url']);
}
if (strstr($widget_settings['image_url'], '?')) {
$widget_settings['image_url'] .= "&".mt_rand();
} else {
$widget_settings['image_url'] .= "?".mt_rand();
}
$common_output[] = '
';
}