Commit 1d127dcf authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

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

parent ce26e375
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
$widgettitle = $widgetname . "_title"; $widgettitle = $widgetname . "_title";
$widgettitlelink = $widgetname . "_title_link"; $widgettitlelink = $widgetname . "_title_link";
if ($$widgettitle != ""): if (isset($$widgettitle)):
?> ?>
......
...@@ -273,6 +273,8 @@ function print_info_box_np($msg, $name="apply",$value="", $showapply=false) { ...@@ -273,6 +273,8 @@ function print_info_box_np($msg, $name="apply",$value="", $showapply=false) {
if($_POST['if']) if($_POST['if'])
$savebutton .= "<input type=\"hidden\" name=\"if\" value=\"" . htmlspecialchars($_POST['if']) . "\" />"; $savebutton .= "<input type=\"hidden\" name=\"if\" value=\"" . htmlspecialchars($_POST['if']) . "\" />";
$savebutton.="</form>"; $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_redbox = "#990000";
$nifty_blackbox = "#000000"; $nifty_blackbox = "#000000";
...@@ -289,10 +291,6 @@ function print_info_box_np($msg, $name="apply",$value="", $showapply=false) { ...@@ -289,10 +291,6 @@ function print_info_box_np($msg, $name="apply",$value="", $showapply=false) {
eval($toeval); 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 echo <<<EOFnp
<div class="col-xs-12"> <div class="col-xs-12">
<div class="alert alert-info alert-dismissible" role="alert"> <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 ...@@ -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\" 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}\" />"; $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']) . "\" />"; $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_redbox = "#990000";
$nifty_blackbox = "#000000"; $nifty_blackbox = "#000000";
...@@ -331,10 +331,6 @@ function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $und ...@@ -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']; $url = $_SERVER['REQUEST_URI'];
echo <<<EOFnp echo <<<EOFnp
...@@ -1004,23 +1000,6 @@ function rule_popup($src,$srcport,$dst,$dstport){ ...@@ -1004,23 +1000,6 @@ function rule_popup($src,$srcport,$dst,$dstport){
if (isset($config['aliases']['alias'])) { if (isset($config['aliases']['alias'])) {
$descriptions = array (); $descriptions = array ();
foreach ($config['aliases']['alias'] as $alias_id=>$alias_name){ 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) { if ($alias_name['name'] == $src) {
//var_dump($config['aliases']['alias'][$alias_id]); //var_dump($config['aliases']['alias'][$alias_id]);
$aliases_array['src']=$config['aliases']['alias'][$alias_id]; $aliases_array['src']=$config['aliases']['alias'][$alias_id];
......
...@@ -45,10 +45,6 @@ if (isset($_REQUEST['closenotice'])) { ...@@ -45,10 +45,6 @@ if (isset($_REQUEST['closenotice'])) {
echo get_menu_messages(); echo get_menu_messages();
exit; exit;
} }
if ($_REQUEST['act'] == 'alias_info_popup' && !preg_match("/\D/", $_REQUEST['aliasid'])) {
alias_info_popup($_REQUEST['aliasid']);
exit;
}
##build list of widgets ##build list of widgets
$directory = "/usr/local/www/widgets/widgets/"; $directory = "/usr/local/www/widgets/widgets/";
...@@ -159,7 +155,7 @@ if ($config['widgets'] && $config['widgets']['sequence'] != "") { ...@@ -159,7 +155,7 @@ if ($config['widgets'] && $config['widgets']['sequence'] != "") {
##find custom configurations of a particular widget and load its info to $pconfig ##find custom configurations of a particular widget and load its info to $pconfig
foreach ($widgetnames as $widget) { foreach ($widgetnames as $widget) {
if ($config['widgets'][$widget . '-config']) { if (isset($config['widgets'][$widget . '-config'])) {
$pconfig[$widget . '-config'] = $config['widgets'][$widget . '-config']; $pconfig[$widget . '-config'] = $config['widgets'][$widget . '-config'];
} }
} }
...@@ -446,8 +442,13 @@ endif; ?> ...@@ -446,8 +442,13 @@ endif; ?>
$nicename = ucwords($nicename); $nicename = ucwords($nicename);
} }
if ($config['widgets'] && $pconfig['sequence'] != "") { if (isset($config['widgets']) && isset($pconfig['sequence'])) {
switch($displayarray[$widgetcounter]){ if (isset($displayarray[$widgetcounter])) {
$disparr = $displayarray[$widgetcounter];
} else {
$disparr = null;
}
switch($disparr){
case "show": case "show":
$divdisplay = "block"; $divdisplay = "block";
$display = "block"; $display = "block";
...@@ -520,7 +521,7 @@ endif; ?> ...@@ -520,7 +521,7 @@ endif; ?>
<?php <?php
$widgettitle = $widgetname . "_title"; $widgettitle = $widgetname . "_title";
$widgettitlelink = $widgetname . "_title_link"; $widgettitlelink = $widgetname . "_title_link";
if ($$widgettitle != "") { if (isset($$widgettitle)) {
//only show link if defined //only show link if defined
if ($$widgettitlelink != "") { if ($$widgettitlelink != "") {
?> ?>
...@@ -529,19 +530,19 @@ endif; ?> ...@@ -529,19 +530,19 @@ endif; ?>
} }
//echo widget title //echo widget title
echo $$widgettitle; echo $$widgettitle;
if ($$widgettitlelink != "") { if (isset($$widgettitlelink)) {
?> ?>
</span></u> </span></u>
<?php <?php
} }
} else { } else {
if ($$widgettitlelink != "") { if (isset($$widgettitlelink)) {
?> ?>
<u><span onclick="location.href='/<?php echo $$widgettitlelink;?>'" style="cursor:pointer"> <u><span onclick="location.href='/<?php echo $$widgettitlelink;?>'" style="cursor:pointer">
<?php <?php
} }
echo $nicename; echo $nicename;
if ($$widgettitlelink != "") { if (isset($$widgettitlelink)) {
?> ?>
</span></u> </span></u>
<?php <?php
......
...@@ -37,6 +37,7 @@ require_once("functions.inc"); ...@@ -37,6 +37,7 @@ require_once("functions.inc");
require_once("widgets/include/interfaces.inc"); require_once("widgets/include/interfaces.inc");
$i = 0; $i = 0;
$iswireless=false;
$ifdescrs = get_configured_interface_with_descr(); $ifdescrs = get_configured_interface_with_descr();
?> ?>
...@@ -49,7 +50,7 @@ require_once("widgets/include/interfaces.inc"); ...@@ -49,7 +50,7 @@ require_once("widgets/include/interfaces.inc");
<tr> <tr>
<td class="vncellt" > <td class="vncellt" >
<?php <?php
if ($ifinfo['ppplink']) { if (isset($ifinfo['ppplink'])) {
?> <span alt="3g" class="glyphicon glyphicon-phone text-success"></span> <?php ?> <span alt="3g" class="glyphicon glyphicon-phone text-success"></span> <?php
} elseif ($iswireless) { } elseif ($iswireless) {
if ($ifinfo['status'] == 'associated' || $ifinfo['status'] == 'up') { if ($ifinfo['status'] == 'associated' || $ifinfo['status'] == 'up') {
...@@ -79,7 +80,7 @@ require_once("widgets/include/interfaces.inc"); ...@@ -79,7 +80,7 @@ require_once("widgets/include/interfaces.inc");
<span onclick="location.href='/interfaces.php?if=<?=$ifdescr; ?>'" style="cursor:pointer"> <span onclick="location.href='/interfaces.php?if=<?=$ifdescr; ?>'" style="cursor:pointer">
<?=htmlspecialchars($ifname);?></span></u></strong> <?=htmlspecialchars($ifname);?></span></u></strong>
<?php <?php
if ($ifinfo['dhcplink']) { if (isset($ifinfo['dhcplink'])) {
echo "&nbsp;(DHCP)"; echo "&nbsp;(DHCP)";
} }
?> ?>
......
...@@ -35,7 +35,7 @@ require_once('notices.inc'); ...@@ -35,7 +35,7 @@ require_once('notices.inc');
include_once("includes/functions.inc.php"); include_once("includes/functions.inc.php");
require_once("script/load_phalcon.php"); require_once("script/load_phalcon.php");
if ($_REQUEST['getupdatestatus']) { if (isset($_REQUEST['getupdatestatus'])) {
$pkg_json = trim(configd_run('firmware pkgstatus')); $pkg_json = trim(configd_run('firmware pkgstatus'));
if ($pkg_json != '') { if ($pkg_json != '') {
$pkg_status = json_decode($pkg_json, true); $pkg_status = json_decode($pkg_json, true);
...@@ -128,7 +128,7 @@ endif; ?> ...@@ -128,7 +128,7 @@ endif; ?>
endif; ?> endif; ?>
</td> </td>
</tr> </tr>
<?php if ($hwcrypto) : <?php if (isset($hwcrypto)) :
?> ?>
<tr> <tr>
<td width="25%" class="vncellt"><?=gettext("Hardware crypto");?></td> <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