Skip to content

Commit d7e591e

Browse files
committed
Merge branch 'build3' Fixed #1, Fixed #6, Fixed $10.
2 parents dbcce8b + 0cf6973 commit d7e591e

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

models/basic.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,18 @@ static function init() {
211211
if (get_option('chained_csv_delim') == '') {
212212
update_option('chained_csv_delim', ',');
213213
update_option('chained_csv_quotes', '1');
214+
}
215+
216+
// default debug mode
217+
if (get_option('chained_debug_mode') == '') {
218+
update_option('chained_debug_mode', 'off');
214219
}
215-
220+
221+
// default delete data
222+
if (get_option('chained_delete_data') == '') {
223+
update_option('chained_delete_data', 'no');
224+
}
225+
216226
// Go ahead and activate the plugin now by running the install script.
217227
self::install(true);
218228
}
@@ -255,7 +265,7 @@ static function options() {
255265
$delim = get_option('chained_csv_delim');
256266

257267
// Uninstall settings
258-
/** PLACEHOLDER FOR FUTURE CODE */
268+
update_option('chained_delete_data', sanitize_text_field($_POST['delete_data']));
259269

260270
// Debug Mode
261271
update_option('chained_debug_mode', sanitize_text_field($_POST['debug_mode']));

views/results.html.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<?php foreach($results as $result):?>
1414
<form method="post" onsubmit="return validateChainedResult(this);">
1515
<p><label><?php _e('Result Title', 'chained')?></label> <input type="text" name="title" size="60" value="<?php echo $result->title?>"></p>
16+
<p><?php _e('Min. Points:', 'chained')?> <input type="text" size="4" name="points_bottom" value="<?php echo $result->points_bottom?>">&nbsp;&nbsp;&nbsp;
17+
<?php _e('Max. Points:', 'chained')?> <input type="text" size="4" name="points_top" value="<?php echo $result->points_top?>"></p>
1618
<p><label><?php _e('Result Description', 'chained')?></label> <?php echo wp_editor(stripslashes($result->description), 'description'.$result->id, array("textarea_rows" => 3))?></p>
1719
<div>
1820
<div class="one-line">
@@ -34,8 +36,6 @@
3436
<textarea rows="3" cols="40" name="plan<?php echo $result->id?>"><?php echo stripslashes($result->plan);?></textarea>
3537
</div>
3638
</div>
37-
<p><?php _e('Min. Points:', 'chained')?> <input type="text" size="4" name="points_bottom" value="<?php echo $result->points_bottom?>">
38-
<?php _e('Max. Points:', 'chained')?> <input type="text" size="4" name="points_top" value="<?php echo $result->points_top?>"></p>
3939
<p><label><?php _e('Optional redirect URL', 'chained')?></label> <input type="text" name="redirect_url" size="60" value="<?php echo $result->redirect_url?>"><br />
4040
<i><?php _e('If you enter this, the quiz will redirect to the URL instead of showing the "Final Output".', 'chained');?></i></p>
4141
<p><input type="submit" name="save" value="<?php _e('Save Result', 'chained')?>" class="button-primary">
@@ -50,6 +50,8 @@
5050
<!-- Add a new result. -->
5151
<form method="post" onsubmit="return validateChainedResult(this);">
5252
<p><label><?php _e('Result Title', 'chained')?></label> <input type="text" name="title" size="60"></p>
53+
<p><?php _e('Min. Points:', 'chained')?> <input type="text" size="4" name="points_bottom">&nbsp;&nbsp;&nbsp;
54+
<?php _e('Max. Points:', 'chained')?> <input type="text" size="4" name="points_top"></p>
5355
<p><label><?php _e('Result Description', 'chained')?></label> <?php echo wp_editor('', 'description', array("textarea_rows" => 3))?></p>
5456
<div>
5557
<div class="one-line">
@@ -71,8 +73,6 @@
7173
<textarea rows="3" cols="40" name="plan"></textarea>
7274
</div>
7375
</div>
74-
<p><?php _e('Min. Points:', 'chained')?> <input type="text" size="4" name="points_bottom">
75-
<?php _e('Max. Points:', 'chained')?> <input type="text" size="4" name="points_top"></p>
7676
<p><label><?php _e('Optional redirect URL', 'chained')?></label> <input type="text" name="redirect_url" size="60"><br />
7777
<i><?php _e('The Algorithm will redirect to the URL instead of showing the "Final Output".', 'chained');?></i></p>
7878
<p><input type="submit" name="add" value="<?php _e('Add Result', 'chained')?>" class="button-primary"></p>

0 commit comments

Comments
 (0)