Commit 9dcb7e97 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) let's try default index dashboard without warnings and notices from php

parent 0fd34a4c
......@@ -41,7 +41,7 @@
$widgettitle = $widgetname . "_title";
$widgettitlelink = $widgetname . "_title_link";
if ($$widgettitle != ""):
if (isset($$widgettitle)):
?>
......
......@@ -273,6 +273,8 @@ function print_info_box_np($msg, $name="apply",$value="", $showapply=false) {
if($_POST['if'])
$savebutton .= "<input type=\"hidden\" name=\"if\" value=\"" . htmlspecialchars($_POST['if']) . "\" />";
$savebutton.="</form>";
} else {
$savebutton = '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
}
$nifty_redbox = "#990000";
$nifty_blackbox = "#000000";
......@@ -289,10 +291,6 @@ function print_info_box_np($msg, $name="apply",$value="", $showapply=false) {
eval($toeval);
}
if(!$savebutton) {
$savebutton = '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
}
echo <<<EOFnp
<div class="col-xs-12">
<div class="alert alert-info alert-dismissible" role="alert">
......@@ -312,8 +310,10 @@ function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $und
$savebutton .= "<input class=\"btn btn-default\" type=\"button\" value=\"". gettext("Undo") . "\" onclick=\"document.location='{$undo}'\" />";
$savebutton .= "<input class=\"btn btn-default\" name=\"{$name}\" type=\"submit\" class=\"formbtn\" id=\"${name}\" value=\"{$value}\" />";
if($_POST['if'])
if(isset($_POST['if']))
$savebutton .= "<input type=\"hidden\" name=\"if\" value=\"" . htmlspecialchars($_POST['if']) . "\" />";
} else {
$savebutton = "<input class=\"btn btn-default\" value=\"" . gettext("Close") . "\" type=\"button\" onclick=\"$('#redboxtable').hide();\" />";
}
$nifty_redbox = "#990000";
$nifty_blackbox = "#000000";
......@@ -331,10 +331,6 @@ function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $und
}
if(!$savebutton) {
$savebutton = "<input class=\"btn btn-default\" value=\"" . gettext("Close") . "\" type=\"button\" onclick=\"$('#redboxtable').hide();\" />";
}
$url = $_SERVER['REQUEST_URI'];
echo <<<EOFnp
......@@ -1004,23 +1000,6 @@ function rule_popup($src,$srcport,$dst,$dstport){
if (isset($config['aliases']['alias'])) {
$descriptions = array ();
foreach ($config['aliases']['alias'] as $alias_id=>$alias_name){
//$loading_image="<a><img src=\'/themes/{$g['theme']}/images/misc/loader.gif\' alt=\'loader\' /> " .gettext("loading...")."</a>";
//switch ($alias_name['type']){
//case "port":
// $width="250";
// break;
//case "urltable":
// $width="500";
// break;
//default:
// $width="350";
// break;
//}
//$span_begin = "<span style=\"cursor: help;\" onmouseover=\"var response_html=domTT_activate(this, event, 'id','ttalias_{$alias_id}','content','{$loading_image}', 'trail', true, 'delay', 300, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle','type','velcro','width',{$width});alias_popup('{$alias_id}','{$g['theme']}','".gettext('loading...')."');\" onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\"><u>";
//$span_begin ="<span style=\"cursor: help;\"><u>";
//$span_end = "</u></span>";
//$span_begin=$span_begin.$config['aliases']['alias'][$alias_id]['name'];
//var_dump($config['aliases']['alias'][$alias_id]);
if ($alias_name['name'] == $src) {
//var_dump($config['aliases']['alias'][$alias_id]);
$aliases_array['src']=$config['aliases']['alias'][$alias_id];
......
......@@ -45,10 +45,6 @@ if (isset($_REQUEST['closenotice'])) {
echo get_menu_messages();
exit;
}
if ($_REQUEST['act'] == 'alias_info_popup' && !preg_match("/\D/", $_REQUEST['aliasid'])) {
alias_info_popup($_REQUEST['aliasid']);
exit;
}
##build list of widgets
$directory = "/usr/local/www/widgets/widgets/";
......@@ -159,7 +155,7 @@ if ($config['widgets'] && $config['widgets']['sequence'] != "") {
##find custom configurations of a particular widget and load its info to $pconfig
foreach ($widgetnames as $widget) {
if ($config['widgets'][$widget . '-config']) {
if (isset($config['widgets'][$widget . '-config'])) {
$pconfig[$widget . '-config'] = $config['widgets'][$widget . '-config'];
}
}
......@@ -446,8 +442,13 @@ endif; ?>
$nicename = ucwords($nicename);
}
if ($config['widgets'] && $pconfig['sequence'] != "") {
switch($displayarray[$widgetcounter]){
if (isset($config['widgets']) && isset($pconfig['sequence'])) {
if (isset($displayarray[$widgetcounter])) {
$disparr = $displayarray[$widgetcounter];
} else {
$disparr = null;
}
switch($disparr){
case "show":
$divdisplay = "block";
$display = "block";
......@@ -520,7 +521,7 @@ endif; ?>
<?php
$widgettitle = $widgetname . "_title";
$widgettitlelink = $widgetname . "_title_link";
if ($$widgettitle != "") {
if (isset($$widgettitle)) {
//only show link if defined
if ($$widgettitlelink != "") {
?>
......@@ -529,19 +530,19 @@ endif; ?>
}
//echo widget title
echo $$widgettitle;
if ($$widgettitlelink != "") {
if (isset($$widgettitlelink)) {
?>
</span></u>
<?php
}
} else {
if ($$widgettitlelink != "") {
if (isset($$widgettitlelink)) {
?>
<u><span onclick="location.href='/<?php echo $$widgettitlelink;?>'" style="cursor:pointer">
<?php
}
echo $nicename;
if ($$widgettitlelink != "") {
if (isset($$widgettitlelink)) {
?>
</span></u>
<?php
......
......@@ -37,6 +37,7 @@ require_once("functions.inc");
require_once("widgets/include/interfaces.inc");
$i = 0;
$iswireless=false;
$ifdescrs = get_configured_interface_with_descr();
?>
......@@ -49,7 +50,7 @@ require_once("widgets/include/interfaces.inc");
<tr>
<td class="vncellt" >
<?php
if ($ifinfo['ppplink']) {
if (isset($ifinfo['ppplink'])) {
?> <span alt="3g" class="glyphicon glyphicon-phone text-success"></span> <?php
} elseif ($iswireless) {
if ($ifinfo['status'] == "associated") {
......@@ -79,7 +80,7 @@ require_once("widgets/include/interfaces.inc");
<span onclick="location.href='/interfaces.php?if=<?=$ifdescr; ?>'" style="cursor:pointer">
<?=htmlspecialchars($ifname);?></span></u></strong>
<?php
if ($ifinfo['dhcplink']) {
if (isset($ifinfo['dhcplink'])) {
echo "&nbsp;(DHCP)";
}
?>
......
......@@ -35,7 +35,7 @@ require_once('notices.inc');
include_once("includes/functions.inc.php");
require_once("script/load_phalcon.php");
if ($_REQUEST['getupdatestatus']) {
if (isset($_REQUEST['getupdatestatus'])) {
$pkg_json = trim(configd_run('firmware pkgstatus'));
if ($pkg_json != '') {
$pkg_status = json_decode($pkg_json, true);
......@@ -128,7 +128,7 @@ endif; ?>
endif; ?>
</td>
</tr>
<?php if ($hwcrypto) :
<?php if (isset($hwcrypto)) :
?>
<tr>
<td width="25%" class="vncellt"><?=gettext("Hardware crypto");?></td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment