Skip to content

Commit

Permalink
Framework for wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
otrok7 committed Nov 26, 2024
1 parent ed32414 commit 6d83fef
Show file tree
Hide file tree
Showing 14 changed files with 1,801 additions and 53 deletions.
55 changes: 31 additions & 24 deletions admin/class-bread-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public function enqueue_styles($hook)
wp_enqueue_style("tooltipster-noir", plugin_dir_url(__FILE__) . "css/tooltipster-sideTip-noir.min.css", false, "1.2", 'all');
wp_enqueue_style("admin", plugin_dir_url(__FILE__) . "css/admin.css", false, "1.2", 'all');
wp_enqueue_style("chosen", plugin_dir_url(__FILE__) . "css/chosen.min.css", false, "1.2", 'all');
wp_enqueue_style("smartWizard-dots", plugin_dir_url(__FILE__) . "css/smart_wizard_dots.css", false, "6.0.6", 'all');
}

/**
Expand All @@ -96,10 +97,13 @@ public function enqueue_scripts($hook)
wp_enqueue_script('jquery-ui-tabs');
wp_enqueue_script('jquery-ui-accordion');
wp_enqueue_script('jquery-ui-dialog');
wp_enqueue_script("bmlt_meeting_list", plugin_dir_url(__FILE__) . "js/bmlt_meeting_list.js", array('jquery'), "1.2", true);
wp_enqueue_script("bmlt_meeting_list", plugin_dir_url(__FILE__) . "js/bmlt_meeting_list.js", array('jquery'), "2.8.0", true);
wp_enqueue_script("tooltipster", plugin_dir_url(__FILE__) . "js/tooltipster.bundle.min.js", array('jquery'), "1.2", true);
wp_enqueue_script("spectrum", plugin_dir_url(__FILE__) . "js/spectrum.min.js", array('jquery'), "1.2", true);
wp_enqueue_script("chosen", plugin_dir_url(__FILE__) . "js/chosen.jquery.min.js", array('jquery'), "1.2", true);
wp_enqueue_script("fetch-jsonp", plugin_dir_url(__FILE__) . "js/fetch-jsonp.js", array('jquery'), "1.30", true);
wp_enqueue_script("smartWizard", plugin_dir_url(__FILE__) . "js/jquery.smartWizard.js", array('jquery'), "6.0.6", true);
wp_enqueue_script("breadWizard", plugin_dir_url(__FILE__) . "js/bread-Wizard.js", array('smartWizard'), "2.8.0", true);
}

function ml_default_editor()
Expand Down Expand Up @@ -190,12 +194,6 @@ function is_root_server_missing()

function pwsix_process_rename_settings()
{
if (isset($_POST['bmltmeetinglistsave']) && $_POST['bmltmeetinglistsave'] == 'Save Changes') {
return;
}
if (empty($_POST['pwsix_action']) || 'rename_setting' != $_POST['pwsix_action']) {
return;
}
if (! wp_verify_nonce($_POST['pwsix_rename_nonce'], 'pwsix_rename_nonce')) {
return;
}
Expand All @@ -210,12 +208,6 @@ function pwsix_process_rename_settings()
*/
function pwsix_process_settings_export()
{
if (isset($_POST['bmltmeetinglistsave']) && $_POST['bmltmeetinglistsave'] == 'Save Changes') {
return;
}
if (empty($_REQUEST['pwsix_action']) || 'export_settings' != $_REQUEST['pwsix_action']) {
return;
}
if (! wp_verify_nonce($_POST['pwsix_export_nonce'], 'pwsix_export_nonce')) {
return;
}
Expand Down Expand Up @@ -271,12 +263,6 @@ function current_user_can_create()
*/
function pwsix_process_settings_import()
{
if (isset($_POST['bmltmeetinglistsave']) && $_POST['bmltmeetinglistsave'] == 'Save Changes') {
return;
}
if (empty($_REQUEST['pwsix_action']) || 'import_settings' != $_REQUEST['pwsix_action']) {
return;
}
if (empty($_REQUEST['pwsix_import_nonce']) || !wp_verify_nonce($_REQUEST['pwsix_import_nonce'], 'pwsix_import_nonce')) {
return;
}
Expand Down Expand Up @@ -391,17 +377,38 @@ function admin_submenu_link($parent_slug)
}
function admin_options_page()
{
if (!empty($_POST['pwsix_action']) && (!isset($_POST['bmltmeetinglistsave']) || $_POST['bmltmeetinglistsave'] != 'Save Changes')) {
switch ($_POST['pwsix_action']) {
case 'settings_admin':
$this->pwsix_process_settings_admin();
break;
case 'rename_setting':
$this->pwsix_process_rename_settings();
break;
case 'export_settings':
$this->pwsix_process_settings_export();
break;
case 'import_settings':
$this->pwsix_process_settings_import();
break;
case 'import_settings':
$this->pwsix_process_wizard();
break;
default:
break;
}
}
include_once plugin_dir_path(__FILE__).'partials/bread-admin-display.php';
(new Bread_AdminDisplay($this))->admin_options_page();
}
function pwsix_process_settings_admin()
function pwsix_process_wizard()
{
if (isset($_POST['bmltmeetinglistsave']) && $_POST['bmltmeetinglistsave'] == 'Save Changes') {
return;
}
if (empty($_POST['pwsix_action']) || 'settings_admin' != $_POST['pwsix_action']) {
if (! wp_verify_nonce($_POST['pwsix_wizard_nonce'], 'pwsix_wizard_nonce')) {
return;
}
}
function pwsix_process_settings_admin()
{
if (! wp_verify_nonce($_POST['pwsix_settings_admin_nonce'], 'pwsix_settings_admin_nonce')) {
return;
}
Expand Down
Loading

0 comments on commit 6d83fef

Please sign in to comment.