Project

General

Profile

« Previous | Next » 

Revision 01752a98

Added by Sjon Hortensius over 10 years ago

Fix "Apply" button in dialogs #101

View differences:

usr/local/www/guiconfig.inc
287 287
}
288 288

  
289 289
function print_info_box_np($msg, $name="apply",$value="", $showapply=false) {
290
	global $g, $nifty_redbox, $nifty_blackbox, $nifty_background;
290
	global $g;
291 291

  
292 292
	if(empty($value)) {
293 293
		$value = gettext("Apply changes");
294 294
	}
295 295

  
296
	// Set the Nifty background color if one is not set already (defaults to white)
297
	if($nifty_background == "")
298
		$nifty_background = "#FFF";
296
	if (stristr($msg, gettext("apply")) != false || stristr($msg, gettext("save")) != false || stristr($msg, gettext("create")) != false || $showapply) {
297
		$msg .= '<form method="post"><input type="submit" class="btn btn-default" name="apply" value="'.$value.'" />';
299 298

  
300
	if(stristr($msg, gettext("apply")) != false || stristr($msg, gettext("save")) != false || stristr($msg, gettext("create")) != false || $showapply) {
301
		$dismiss = "alert-dismissible";
302
		$button = '<button type="submit" class="btn btn-primary" name="login" value="'.$value.'">'.$name.'</button>';
299
		if ($_POST['if'])
300
			$msg .= "<input type=\"hidden\" name=\"if\" value=\"" . htmlspecialchars($_POST['if']) . "\" />";
303 301

  
304
		if($_POST['if'])
305
			$savebutton .= "<input type=\"hidden\" name=\"if\" value=\"" . htmlspecialchars($_POST['if']) . "\" />";
302
		$msg .'</form>';
306 303
	} else
307
		$button = '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>';
304
		$msg = '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>'. $msg;
308 305

  
309 306
	echo '<div class="alert alert-warning" role="alert">'.$msg.'</div>';
310 307
}
......
577 574
		}
578 575
	}
579 576
	echo "\n";
580
	
577

  
581 578
	foreach ($logarr as $logent) {
582 579
			$logent = preg_split("/\s+/", $logent, 6);
583 580

  

Also available in: Unified diff