Skip to content

Commit

Permalink
5648 moved form onsubmit to submit button onclick, and set cancel red…
Browse files Browse the repository at this point in the history
…irect
  • Loading branch information
gregrgay committed Mar 10, 2016
1 parent 60ea1bc commit 5df3ae6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions mods/_standard/tile_search/import.php
Expand Up @@ -15,7 +15,7 @@
define('AT_INCLUDE_PATH', '../../../include/');
define('TR_INCLUDE_PATH', '../../../include/');

if(isset($_POST['tile_course_id'], $_POST['aclcl'])){
if(isset($_POST['tile_course_id'], $_POST['aclcl']) && !isset($_POST['cancel'])){

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
ini_set("display_errors", 1);
Expand All @@ -32,10 +32,12 @@
$msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');

header('Location: index.php');
exit();
exit;
} else if(isset($_POST['cancel'])){
header('Location: index.php');
exit;
}

//define('AT_INCLUDE_PATH', '../../../include/');

require(AT_INCLUDE_PATH.'vitals.inc.php');
authenticate(AT_PRIV_CONTENT);

Expand Down Expand Up @@ -120,7 +122,7 @@ function print_menu_sections(&$menu, $parent_content_id = 0, $depth = 0, $orderi

?>

<form name="form1" method="post" action="<?php echo $action; ?>" onsubmit="openWindow('<?php echo AT_BASE_HREF; ?>tools/prog.php?tile=1');">
<form name="form1" method="post" action="<?php echo $action; ?>">
<?php
foreach($vars as $name => $value){
echo '<input type="hidden" value="'.$value.'" name="'.$name.'" />';
Expand All @@ -147,7 +149,7 @@ function print_menu_sections(&$menu, $parent_content_id = 0, $depth = 0, $orderi
</div>

<div class="row buttons">
<input type="submit" name="submit" value="<?php echo _AT('import'); ?>" /> <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />
<input type="submit" name="submit" value="<?php echo _AT('import'); ?>" onclick="openWindow('<?php echo AT_BASE_HREF; ?>tools/prog.php?tile=1');"/> <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />
</div>
</div>
</form>
Expand Down

0 comments on commit 5df3ae6

Please sign in to comment.