Skip to content

Commit

Permalink
Add "go back" button
Browse files Browse the repository at this point in the history
  • Loading branch information
otrok7 committed Dec 1, 2024
1 parent d4885ad commit 07feebe
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
4 changes: 2 additions & 2 deletions admin/class-bread-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ function pwsix_process_wizard()
}
$settings = json_decode($encode_options, true);
$ncols = substr_count($settings['meeting_template_content'], '<td');
$id = $this->bread->getMaxSetting() + 1;
$id = (is_numeric($_POST['wizard_setting_id'])) ? intval($_POST['wizard_setting_id']) : $this->bread->getMaxSetting() + 1;
$optionsName = $this->bread->generateOptionName($id);
$settings['authors'] = array();
$settings['root_server'] = sanitize_url($_POST['wizard_root_server']);
Expand Down Expand Up @@ -496,7 +496,7 @@ function pwsix_process_wizard()
}
update_option($optionsName, $settings);
$setting_name = sanitize_title($_POST['wizard-setting-name']);
$setting_name = $setting_name == '' ? $setting_name : 'Setting ' . $id;
$setting_name = $setting_name == '' ? 'Setting ' . $id : $setting_name;
$this->bread->setAndSaveSetting($id, $setting_name);
$this->bread->getMLOptions($id);
$this->bread->setRequestedSetting($id);
Expand Down
10 changes: 8 additions & 2 deletions admin/js/bread-wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,23 @@ jQuery(document).ready(function($){
});
}
var href;
var setting;
finalInstructions = function(response) {
$('#wizard-before-create').hide();
$('#wizard-after-create').show();
href = window.location.href.substring(0, window.location.href.indexOf('/wp-admin'));
href = href+"?current-meeting-list="+response.result.setting;
const tag = '<pre>&lt;a href="'+href+'"&gt;'+href+'</pre>';
setting = response.result.setting;
href = href+"?current-meeting-list="+setting;
const tag = '<div class="step-description"><pre>'+href+'</pre>';
$('#wizard-show-link').html(tag);
}
BreadWizard.prototype.generate_meeting_list = function() {
window.open(href, '_blank').focus();
}
BreadWizard.prototype.redo_layout = function() {
$('#wizard_setting_id').val(setting);
$('#bread-wizard').smartWizard("goToStep", 2);
}
BreadWizard.prototype.test_root_server = function() {
ask_bmlt("switcher=GetServerInfo",
(info) => {
Expand Down
4 changes: 2 additions & 2 deletions admin/partials/_bmlt_server_setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
<h3 class="hndle">Include Extra Meetings<span class="my-tooltip" data-tooltip-content="#extrameetings-tooltip-content"><span class="tooltipster-icon">(?)</span></span></h3>
<div class="inside">
<p class="ctrl_key" style="display:none; color: #00AD00;">Hold CTRL Key down to select multiple meetings.</p>
<select class="chosen-select" style="width: 100%;" data-placeholder="
<?php
<select class="chosen-select" style="width: 100%;" data-placeholder=
"<?php
if ($this->bread->getOption('extra_meetings_enabled') == 0) {
echo 'Not Enabled';
} elseif (!$this->connected) {
Expand Down
13 changes: 9 additions & 4 deletions admin/partials/_bread_wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<form method="post" id="wizard_form">
<?php wp_nonce_field('pwsix_wizard_nonce', 'pwsix_wizard_nonce'); ?>
<input type="hidden" name="pwsix_action" value="wizard" />
<input type="hidden" id="wizard_setting_id" name="wizard_setting_id" value="" />
<div class="tab-content">
<div id="step-1" class="tab-pane" role="tabpanel" aria-labelledby="step-1">
<h3>Step 1: Enter your BMLT root server</h3>
Expand Down Expand Up @@ -83,10 +84,12 @@
<h3>Step 3: Page Layout</h3>
<div class="step-description">
<p>Most areas try to fit their meetings onto a single sheet of paper. And it is particularly adventageous to
use a tri-fold format, so that the list can be printed at home and placed along side the pamphlets. Remember though, that when fonts become
too small, the meeting list becomes unreadable. For many areas, a booklet format is better, even
if the reqire more effort or expense to print.</p>
<p>In this step we suggest suitible formats based on your meeting count.</p>
use a tri-fold format, so that the list can be printed at home and placed along side the pamphlets. The priority should always be that the
meeting list is readable. For many areas, a booklet format is better, even if the reqire more effort or expense to print.</p>
<p>In this step we suggest suitible formats based on your meeting count. Having the meetings fit on a single side has the advantage
that the list can be posted on a bulleitin board, and this will be used when suggesting a page layout. However, you may
also wish to have the meetings "overflow" on to the back side of the paper. If so, select a layout <em>above</em> layout
that the wizard pre-selects for you.</p>
</div>
<p>Number of meetings on list: <span id="wizard_meeting_count"></span></p>
<p>Select one of the layouts appropriate to the number of meetings</p>
Expand Down Expand Up @@ -139,6 +142,8 @@
<p>
To add a link to the meeting list on your website, use the following link.
</p><div id="wizard-show-link"></div>
<p>If you want to try a different layout: <button type="button" class="btn btn-primary" onClick="breadWizard.redo_layout()">Go Back</button>
</p><div id="wizard-show-link"></div>
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion includes/class-bread.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,9 @@ function fillUnsetOptionsInner()
$this->fillUnsetStringOption('city_suffix', 'City');
$this->fillUnsetStringOption('meeting_template_content', '');
//TODO:remove....clean up after a bug...
if (is_array($this->options['additional_list_template_content']))
if (is_array($this->options['additional_list_template_content'])) {
$this->options['additional_list_template_content'] = join('', $this->options['additional_list_template_content']);
}
$this->fillUnsetStringOption('additional_list_template_content', '');
$this->fillUnsetOption('column_line', 0);
$this->fillUnsetOption('col_color', '#bfbfbf');
Expand Down

0 comments on commit 07feebe

Please sign in to comment.