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
41 changes: 19 additions & 22 deletions admin/class-bread-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ function pwsix_process_settings_admin()
if (!$this->current_user_can_modify()) {
return;
}
if ($this->bread->getRequestedSetting() == 1) {
if ($this->bread->getRequestedSetting() === 1) {
return;
}
$this->bread->deleteSetting($this->bread->getRequestedSetting());
Expand Down Expand Up @@ -610,14 +610,14 @@ function process_customize_form()
$this->bread->setOption('front_page_line_height', $_POST['front_page_line_height']);
$this->bread->setOption('front_page_font_size', floatval($_POST['front_page_font_size']));
$this->bread->setOption('content_font_size', floatval($_POST['content_font_size']));
$this->bread->setOption('suppress_heading', floatval($_POST['suppress_heading']));
$this->bread->setOption('suppress_heading', isset($_POST['suppress_heading']));
$this->bread->setOption('header_font_size', floatval($_POST['header_font_size']));
$this->bread->setOption('header_text_color', sanitize_hex_color($_POST['header_text_color']));
$this->bread->setOption('header_background_color', sanitize_hex_color($_POST['header_background_color']));
$this->bread->setOption('header_uppercase', intval($_POST['header_uppercase']));
$this->bread->setOption('header_bold', intval($_POST['header_bold']));
$this->bread->setOption('header_uppercase', isset($_POST['header_uppercase']));
$this->bread->setOption('header_bold', isset($_POST['header_bold']));
$this->bread->setOption('sub_header_shown', sanitize_text_field($_POST['sub_header_shown']));
$this->bread->setOption('cont_header_shown', intval($_POST['cont_header_shown']));
$this->bread->setOption('cont_header_shown', isset($_POST['cont_header_shown']));
$this->bread->setOption(
'column_gap',
isset($_POST['column_gap']) ?
Expand All @@ -641,11 +641,8 @@ function process_customize_form()
$this->bread->setOption('page_size', sanitize_text_field($_POST['page_size']));
$this->bread->setOption('page_orientation', sanitize_text_field($_POST['page_orientation']));
$this->bread->setOption('page_fold', sanitize_text_field($_POST['page_fold']));
$this->bread->setOption(
'booklet_pages',
isset($_POST['booklet_pages']) ?
boolval($_POST['booklet_pages']) : false
);
$this->bread->setOption('booklet_pages', isset($_POST['booklet_pages']));
$this->bread->setOption('booklet_columns', $_POST['booklet_columns'] ? intval($_POST['booklet_columns']) : 1);
$this->bread->setOption('meeting_sort', sanitize_text_field($_POST['meeting_sort']));
$this->bread->setOption('main_grouping', sanitize_text_field($_POST['main_grouping']));
$this->bread->setOption('subgrouping', sanitize_text_field($_POST['subgrouping']));
Expand All @@ -655,11 +652,7 @@ function process_customize_form()
$this->bread->setOption('city_suffix', sanitize_text_field($_POST['city_suffix']));
$this->bread->setOption('meeting_template_content', wp_kses_post($_POST['meeting_template_content']));
$this->bread->setOption('additional_list_template_content', wp_kses_post($_POST['additional_list_template_content']));
$this->bread->setOption(
'column_line',
isset($_POST['column_line']) ?
boolval($_POST['column_line']) : 0
);
$this->bread->setOption('column_line', isset($_POST['column_line']));
$this->bread->setOption(
'col_color',
isset($_POST['col_color']) ?
Expand All @@ -674,9 +667,14 @@ function process_customize_form()
floatval($_POST['pagenumbering_font_size']) : '9'
);
$this->bread->setOption('used_format_1', isset($_POST['used_format_1']) ? sanitize_text_field($_POST['used_format_1']) : '');
$this->bread->setOption('recurse_service_bodies', isset($_POST['recurse_service_bodies']) ? 1 : 0);
$this->bread->setOption('extra_meetings_enabled', isset($_POST['extra_meetings_enabled']) ? intval($_POST['extra_meetings_enabled']) : 0);
$this->bread->setOption('include_protection', boolval($_POST['include_protection']));
$this->bread->setOption('recurse_service_bodies', isset($_POST['recurse_service_bodies']));
$this->bread->setOption('extra_meetings_enabled', isset($_POST['extra_meetings_enabled']));
$this->bread->setOption('include_protection', isset($_POST['include_protection']));
if ($this->bread->getOption('include_protection')) {
$this->bread->setOption('protection_password', sanitize_text_field($_POST['protection_password']));
} else {
$this->bread->setOption('protection_password', '');
}
$this->bread->setOption('weekday_language', sanitize_text_field($_POST['weekday_language']));
$this->bread->setOption('additional_list_language', sanitize_text_field($_POST['additional_list_language']));
$this->bread->setOption('weekday_start', sanitize_text_field($_POST['weekday_start']));
Expand All @@ -695,24 +693,23 @@ function process_customize_form()
isset($_POST['nonmeeting_footer']) ?
sanitize_text_field($_POST['nonmeeting_footer']) : ''
);
$this->bread->setOption('include_additional_list', boolval($_POST['include_additional_list']));
$this->bread->setOption('include_additional_list', isset($_POST['include_additional_list']));
$this->bread->setOption('additional_list_format_key', sanitize_text_field($_POST['additional_list_format_key']));
$this->bread->setOption('additional_list_sort_order', sanitize_text_field($_POST['additional_list_sort_order']));
$this->bread->setOption('base_font', sanitize_text_field($_POST['base_font']));
$this->bread->setOption('colorspace', sanitize_text_field($_POST['colorspace']));
$this->bread->setOption('wheelchair_size', sanitize_text_field($_POST['wheelchair_size']));
$this->bread->setOption('protection_password', sanitize_text_field($_POST['protection_password']));
$this->bread->setOption('time_clock', sanitize_text_field($_POST['time_clock']));
$this->bread->setOption('time_option', intval($_POST['time_option']));
$this->bread->setOption('remove_space', boolval($_POST['remove_space']));
$this->bread->setOption('remove_space', boolval($_POST['remove_space'])); // It's a radio button, not a checkbox, so we can't just check isset
$this->bread->setOption('content_line_height', floatval($_POST['content_line_height']));
$this->bread->setOption('root_server', sanitize_url($_POST['root_server']));
$this->bread->setOption('service_bodies', isset($_POST['service_bodies']) ? array_map('sanitize_text_field', $_POST['service_bodies']) : array());
$this->bread->setOption('cache_time', intval($_POST['cache_time']));
$this->bread->setOption('custom_query', sanitize_text_field($_POST['custom_query']));
$this->bread->setOption('additional_list_custom_query', sanitize_text_field($_POST['additional_list_custom_query']));
$this->bread->setOption('user_agent', isset($_POST['user_agent']) ? sanitize_text_field($_POST['user_agent']) : 'None');
$this->bread->setOption('sslverify', isset($_POST['sslverify']) ? '1' : '0');
$this->bread->setOption('sslverify', isset($_POST['sslverify']));
$this->bread->setOption('extra_meetings', array());
if (isset($_POST['extra_meetings'])) {
foreach ($_POST['extra_meetings'] as $extra) {
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 @@ -54,7 +54,7 @@ function Bread_bmlt_server_setup_page_render(Bread_AdminDisplay $breadAdmin)
</select>
</p>
<div>
<input type="checkbox" name="recurse_service_bodies" id="recurse_service_bodies" value="1" <?php echo ($bread->getOption('recurse_service_bodies') == 1 ? 'checked' : '') ?> /> <?php esc_html_e('Recurse Service Bodies', 'bread') ?>
<input type="checkbox" name="recurse_service_bodies" id="recurse_service_bodies" value="1" <?php echo ($bread->getOption('recurse_service_bodies') ? 'checked' : '') ?> /> <?php esc_html_e('Recurse Service Bodies', 'bread') ?>
</div>
</div>
</div>
Expand Down Expand Up @@ -93,7 +93,7 @@ function Bread_bmlt_server_setup_page_render(Bread_AdminDisplay $breadAdmin)
</select>
<p id="extra_meetings_hint"><?php esc_html_e('Hint: Type a group name, weekday or area to narrow down your choices.', 'bread') ?></p>
<div>
<input type="checkbox" id="extra_meetings_enabled" name="extra_meetings_enabled" value="1" <?php echo (!$bread->emptyOption('extra_meetings_enabled') && $bread->getOption('extra_meetings_enabled') == 1 ? 'checked' : '') ?> /><?php esc_html_e('Extra Meetings Enabled', 'bread') ?>
<input type="checkbox" id="extra_meetings_enabled" name="extra_meetings_enabled" value="1" <?php echo ($bread->getOption('extra_meetings_enabled') ? 'checked' : '') ?> /><?php esc_html_e('Extra Meetings Enabled', 'bread') ?>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions admin/partials/_custom_fonts_setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ function prepare_items()
if (isset($_GET['view']) && $_GET['view'] != 'all') {
$this->items = array_filter($this->items, function ($font) {
$bool = in_array($font['slug'], $this->active);
return ($_GET['view'] == 'active') ? $bool : !$bool;
return ($_GET['view'] === 'active') ? $bool : !$bool;
});
}
}
private function selected($a, $b)
{
return ($a == $b) ? 'selected' : '';
return ($a === $b) ? 'selected' : '';
}
private function getAllScripts(): array
{
Expand Down
Loading
Loading