diff options
author | Renato Botelho <renato@netgate.com> | 2017-05-10 15:27:41 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-05-10 15:27:41 -0300 |
commit | c79376011dc17a285678939b08f751ce78c4ff27 (patch) | |
tree | f719d384cec7eb84f24c7ba65408f8789c373709 /src | |
parent | dd3f0e7d43846fb77bea99cc699185db552d4705 (diff) | |
parent | f14e891ddcdaf952b9923cef0871c086d8c77a13 (diff) | |
download | pfsense-c79376011dc17a285678939b08f751ce78c4ff27.zip pfsense-c79376011dc17a285678939b08f751ce78c4ff27.tar.gz |
Merge pull request #3726 from phil-davis/multi-widget-optional
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/index.php | 14 | ||||
-rw-r--r-- | src/usr/local/www/widgets/include/dyn_dns_status.inc | 1 | ||||
-rw-r--r-- | src/usr/local/www/widgets/include/gateways.inc | 1 | ||||
-rw-r--r-- | src/usr/local/www/widgets/include/interface_statistics.inc | 1 | ||||
-rw-r--r-- | src/usr/local/www/widgets/include/interfaces.inc | 1 | ||||
-rw-r--r-- | src/usr/local/www/widgets/include/log.inc | 1 | ||||
-rw-r--r-- | src/usr/local/www/widgets/include/openvpn.inc | 1 | ||||
-rw-r--r-- | src/usr/local/www/widgets/include/picture.inc | 24 | ||||
-rw-r--r-- | src/usr/local/www/widgets/include/rss.inc | 24 | ||||
-rw-r--r-- | src/usr/local/www/widgets/include/services_status.inc | 1 | ||||
-rw-r--r-- | src/usr/local/www/widgets/include/smart_status.inc | 1 | ||||
-rw-r--r-- | src/usr/local/www/widgets/include/system_information.inc | 24 | ||||
-rw-r--r-- | src/usr/local/www/widgets/include/thermal_sensors.inc | 1 | ||||
-rw-r--r-- | src/usr/local/www/widgets/include/wake_on_lan.inc | 1 |
14 files changed, 95 insertions, 1 deletions
diff --git a/src/usr/local/www/index.php b/src/usr/local/www/index.php index a06b44e..1a29bda 100644 --- a/src/usr/local/www/index.php +++ b/src/usr/local/www/index.php @@ -117,7 +117,12 @@ foreach (glob("/usr/local/www/widgets/widgets/*.widget.php") as $file) { $widgettitle = ucwords(str_replace('_', ' ', $basename)); } - $known_widgets[$basename . '-0'] = array('basename' => $basename, 'title' => $widgettitle, 'display' => 'none'); + $known_widgets[$basename . '-0'] = array( + 'basename' => $basename, + 'title' => $widgettitle, + 'display' => 'none', + 'multicopy' => ${$basename . '_allow_multiple_widget_copies'} + ); } ##if no config entry found, initialize config entry @@ -322,7 +327,11 @@ if ($user_settings['widgets']['sequence'] != "") { 'col' => $col, 'display' => $display, 'copynum' => $copynum, + 'multicopy' => ${$basename . '_allow_multiple_widget_copies'} ); + + // Update the known_widgets entry so we know if any copy of the widget is being displayed + $known_widgets[$basename . '-0']['display'] = $display; } // add widgets that may not be in the saved configuration, in case they are to be displayed later @@ -379,8 +388,11 @@ $available = $known_widgets; uasort($available, function($a, $b){ return strcasecmp($a['title'], $b['title']); }); foreach ($available as $widgetkey => $widgetconfig): + // If the widget supports multiple copies, or no copies are displayed yet, then it is available to add + if (($widgetconfig['multicopy']) || ($widgetconfig['display'] == 'none')): ?> <div class="col-sm-3"><a href="#" id="btnadd-<?=$widgetconfig['basename']?>"><i class="fa fa-plus"></i> <?=$widgetconfig['title']?></a></div> + <?php endif; ?> <?php endforeach; ?> </div> </div> diff --git a/src/usr/local/www/widgets/include/dyn_dns_status.inc b/src/usr/local/www/widgets/include/dyn_dns_status.inc index 628fbc6..43dc05c 100644 --- a/src/usr/local/www/widgets/include/dyn_dns_status.inc +++ b/src/usr/local/www/widgets/include/dyn_dns_status.inc @@ -23,5 +23,6 @@ //set variable for custom title $dyn_dns_status_title = gettext("Dynamic DNS Status"); $dyn_dns_status_title_link = "services_dyndns.php"; +$dyn_dns_status_allow_multiple_widget_copies = true; ?> diff --git a/src/usr/local/www/widgets/include/gateways.inc b/src/usr/local/www/widgets/include/gateways.inc index b2a1577..ec3e7dc 100644 --- a/src/usr/local/www/widgets/include/gateways.inc +++ b/src/usr/local/www/widgets/include/gateways.inc @@ -22,4 +22,5 @@ //set variable for custom title $gateways_title = gettext("Gateways"); $gateways_title_link = "status_gateways.php"; +$gateways_allow_multiple_widget_copies = true; ?> diff --git a/src/usr/local/www/widgets/include/interface_statistics.inc b/src/usr/local/www/widgets/include/interface_statistics.inc index 25edeb3..f1c4a8f 100644 --- a/src/usr/local/www/widgets/include/interface_statistics.inc +++ b/src/usr/local/www/widgets/include/interface_statistics.inc @@ -22,4 +22,5 @@ //set variable for custom title $interface_statistics_title = gettext("Interface Statistics"); $interface_statistics_title_link = "status_interfaces.php"; +$interface_statistics_allow_multiple_widget_copies = true; ?> diff --git a/src/usr/local/www/widgets/include/interfaces.inc b/src/usr/local/www/widgets/include/interfaces.inc index e17add4..fd96ef6 100644 --- a/src/usr/local/www/widgets/include/interfaces.inc +++ b/src/usr/local/www/widgets/include/interfaces.inc @@ -22,5 +22,6 @@ //set variable for custom title $interfaces_title = gettext("Interfaces"); $interfaces_title_link = "status_interfaces.php"; +$interfaces_allow_multiple_widget_copies = true; ?> diff --git a/src/usr/local/www/widgets/include/log.inc b/src/usr/local/www/widgets/include/log.inc index c55fb44..e17dd7e 100644 --- a/src/usr/local/www/widgets/include/log.inc +++ b/src/usr/local/www/widgets/include/log.inc @@ -22,5 +22,6 @@ //set variable for custom title $log_title = gettext("Firewall Logs"); $log_title_link = "status_logs_filter.php"; +$log_allow_multiple_widget_copies = true; ?> diff --git a/src/usr/local/www/widgets/include/openvpn.inc b/src/usr/local/www/widgets/include/openvpn.inc index 65ce59b..43ac809 100644 --- a/src/usr/local/www/widgets/include/openvpn.inc +++ b/src/usr/local/www/widgets/include/openvpn.inc @@ -21,4 +21,5 @@ $openvpn_title = gettext("OpenVPN"); $openvpn_title_link = "status_openvpn.php"; +$openvpn_allow_multiple_widget_copies = true; ?> diff --git a/src/usr/local/www/widgets/include/picture.inc b/src/usr/local/www/widgets/include/picture.inc new file mode 100644 index 0000000..19a5d2b --- /dev/null +++ b/src/usr/local/www/widgets/include/picture.inc @@ -0,0 +1,24 @@ +<?php +/* + * picture.inc + * + * part of pfSense (https://www.pfsense.org) + * Copyright (c) 2004-2017 Rubicon Communications, LLC (Netgate) + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +$picture_title = gettext("Picture"); +$picture_allow_multiple_widget_copies = true; +?> diff --git a/src/usr/local/www/widgets/include/rss.inc b/src/usr/local/www/widgets/include/rss.inc new file mode 100644 index 0000000..be40ec4 --- /dev/null +++ b/src/usr/local/www/widgets/include/rss.inc @@ -0,0 +1,24 @@ +<?php +/* + * rss.inc + * + * part of pfSense (https://www.pfsense.org) + * Copyright (c) 2004-2017 Rubicon Communications, LLC (Netgate) + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +$rss_title = gettext("RSS"); +$rss_allow_multiple_widget_copies = true; +?> diff --git a/src/usr/local/www/widgets/include/services_status.inc b/src/usr/local/www/widgets/include/services_status.inc index 7d13c53..f3719d6 100644 --- a/src/usr/local/www/widgets/include/services_status.inc +++ b/src/usr/local/www/widgets/include/services_status.inc @@ -23,5 +23,6 @@ //set variable for custom title $services_status_title = gettext("Services Status"); $services_status_title_link = "status_services.php"; +$services_status_allow_multiple_widget_copies = true; ?> diff --git a/src/usr/local/www/widgets/include/smart_status.inc b/src/usr/local/www/widgets/include/smart_status.inc index 6b236b2..2658b8d 100644 --- a/src/usr/local/www/widgets/include/smart_status.inc +++ b/src/usr/local/www/widgets/include/smart_status.inc @@ -22,4 +22,5 @@ //set variable for custom title $smart_status_title = gettext("S.M.A.R.T. Status"); $smart_status_title_link = "diag_smart.php"; +$smart_status_allow_multiple_widget_copies = true; ?> diff --git a/src/usr/local/www/widgets/include/system_information.inc b/src/usr/local/www/widgets/include/system_information.inc new file mode 100644 index 0000000..d882f0b --- /dev/null +++ b/src/usr/local/www/widgets/include/system_information.inc @@ -0,0 +1,24 @@ +<?php +/* + * system_information.inc + * + * part of pfSense (https://www.pfsense.org) + * Copyright (c) 2004-2017 Rubicon Communications, LLC (Netgate) + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +$system_information_title = gettext("System Information"); +$system_information_allow_multiple_widget_copies = true; +?> diff --git a/src/usr/local/www/widgets/include/thermal_sensors.inc b/src/usr/local/www/widgets/include/thermal_sensors.inc index 192214a..28d8fd2 100644 --- a/src/usr/local/www/widgets/include/thermal_sensors.inc +++ b/src/usr/local/www/widgets/include/thermal_sensors.inc @@ -23,6 +23,7 @@ //set variable for custom title $thermal_sensors_widget_title = gettext("Thermal Sensors"); //$thermal_sensors_widget_link = "thermal_sensors.php"; +$thermal_sensors_allow_multiple_widget_copies = true; //returns core temp data (from coretemp.ko or amdtemp.ko driver) as "|"-delimited string. diff --git a/src/usr/local/www/widgets/include/wake_on_lan.inc b/src/usr/local/www/widgets/include/wake_on_lan.inc index 1120b4b..d7cda1f 100644 --- a/src/usr/local/www/widgets/include/wake_on_lan.inc +++ b/src/usr/local/www/widgets/include/wake_on_lan.inc @@ -23,5 +23,6 @@ //set variable for custom title $wake_on_lan_title = gettext("Wake-on-Lan"); $wake_on_lan_title_link = "services_wol.php"; +$wake_on_lan_allow_multiple_widget_copies = true; ?> |