Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions admin/class-bread-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,7 @@ function pwsix_process_settings_import()
$settings['authors'] = array(wp_get_current_user()->ID);
$this->bread->setOptions($settings);
update_option($this->bread->getOptionsName(), $this->bread->getOptions());
setcookie('current-meeting-list', $this->bread->getRequestedSetting(), time() + 10);
setcookie('bread_import_file', $import_file, time() + 10);
wp_safe_redirect(admin_url('?page=bmlt-enabled-bread'));
return $file_name;
}
function my_theme_add_editor_styles()
{
Expand Down Expand Up @@ -469,6 +467,7 @@ function admin_submenu_link($parent_slug)
}
function admin_options_page()
{
$filename = '';
if (!empty($_POST['pwsix_action']) && (!isset($_POST['bmltmeetinglistsave']) || $_POST['bmltmeetinglistsave'] != 'Save Changes')) {
switch ($_POST['pwsix_action']) {
case 'settings_admin':
Expand All @@ -481,7 +480,7 @@ function admin_options_page()
$this->pwsix_process_settings_export();
break;
case 'import_settings':
$this->pwsix_process_settings_import();
$filename = $this->pwsix_process_settings_import();
break;
default:
break;
Expand All @@ -491,7 +490,7 @@ function admin_options_page()
$this->bread->getConfigurationForSettingId($this->bread->getRequestedSetting());
}
include_once plugin_dir_path(__FILE__) . 'partials/bread-admin-display.php';
(new Bread_AdminDisplay($this))->admin_options_page();
(new Bread_AdminDisplay($this))->admin_options_page($filename);
}
function pwsix_process_wizard()
{
Expand Down
30 changes: 14 additions & 16 deletions admin/partials/bread-admin-display.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,36 +98,36 @@ private function select_service_body_options(int $i)
<option <?php echo esc_attr($selected); ?> value="<?php echo esc_html($area) ?>"><?php echo esc_html($descr) ?></option><?php
}
}
/**
* Main function for the admin page.
*
* @return void
*/
function admin_options_page()
function admin_options_page($filename = '')
{
?>
<div class="connecting"></div>
<div class="saving"></div>
<?php
set_transient('admin_notice', 'Please put down your weapon. You have 20 seconds to comply.');
echo '<div class="updated">';
if (isset($_COOKIE['bread_import_file'])) {
echo '<p style="color: #F00;">'.esc_html(__('File loaded', 'bread')).'</p>';
if (!empty($filename)) {
echo '<div class="notice notice-success is-dismissible">';
echo '<p style="color: #000;">'.esc_html(__('File loaded: ', 'bread')).esc_html($filename).'</p>';
echo '</div>';
delete_transient($this->bread->get_TransientKey($this->bread->getRequestedSetting()));
} elseif (isset($_POST['bmltmeetinglistsave']) && $_POST['bmltmeetinglistsave']) {
}

if (isset($_POST['bmltmeetinglistsave']) && $_POST['bmltmeetinglistsave']) {
if (!$this->admin->current_user_can_modify()) {
echo '<div class="notice notice-error is-dismissible">';
echo '<p style="color: #F00;">'.esc_html(__('You do not have permission to save this configuation!', 'bread')).'</p>';
echo '</div>';
} else {
$this->admin->save_admin_options();
echo '<p style="color: #F00;">'.esc_html(__('Your changes were successfully saved!', 'bread')).'</p>';
echo '<div class="notice notice-success is-dismissible">';
echo '<p style="color: #000;">'.esc_html(__('Your changes were successfully saved!', 'bread')).'</p>';
$num = delete_transient($this->bread->get_TransientKey($this->bread->getRequestedSetting()));
if ($num > 0) {
/* translators: string is number of cache entries deleted */
echo "<p>" . esc_html(sprintf(__('%s Cache entries deleted', 'bread')), esc_attr($num))."</p>";
echo "<p>" . esc_html(sprintf(__('%s Cache entries deleted', 'bread'), esc_attr($num), 'bread'))."</p>";
}
echo '</div>';
}
}
echo '</div>';

$this->bread->fillUnsetOptions();
$dir = str_starts_with(get_locale(), 'fa') ? 'rtl' : 'ltr';
Expand Down Expand Up @@ -193,5 +193,3 @@ function admin_options_page()
}
}
?>

<!-- This file should primarily consist of HTML with a little bit of PHP. -->
4 changes: 2 additions & 2 deletions bmlt-meeting-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Bread
* Plugin URI: https://bmlt.app
* Description: Maintains and generates PDF Meeting Lists from BMLT.
* Version: 2.9.11
* Version: 2.9.12
* Author: bmlt-enabled
* Author URI: https://bmlt.app/
* License: GPL-2.0+
Expand All @@ -30,7 +30,7 @@
* Start at version 2.8.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define('BREAD_VERSION', '2.9.7');
define('BREAD_VERSION', '2.9.12');

/**
* The code that runs during plugin activation.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
],
"require": {
"mpdf/mpdf": "8.2.3",
"mpdf/mpdf": "8.3.1",
"monolog/monolog": "3.8.1",
"mpdf/qrcode": "^1.0",
"myclabs/deep-copy": "1.11.1"
Expand Down
Loading
Loading