class-content-box-large.php
2 months ago
class-encryption-notice.php
2 months ago
class-enhancement-settings-component.php
2 months ago
class-feature-request-box.php
2 months ago
class-input-api-key.php
2 months ago
class-input-checkbox.php
2 months ago
class-link-box.php
2 months ago
class-modal-feedback.php
2 months ago
class-modal.php
2 months ago
class-navigation.php
2 months ago
class-newsletter-form.php
2 months ago
class-outdated-browser-warning.php
2 months ago
class-premium-box.php
2 months ago
class-premium-feature-list.php
2 months ago
class-review-box.php
2 months ago
class-support-box.php
2 months ago
class-support-link-boxes.php
2 months ago
class-enhancement-settings-component.php
66 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SuperbAddons\Components\Admin; |
| 4 | |
| 5 | defined('ABSPATH') || exit(); |
| 6 | |
| 7 | use SuperbAddons\Gutenberg\Controllers\GutenbergEnhancementsController; |
| 8 | |
| 9 | class EnhancementSettingsComponent |
| 10 | { |
| 11 | private $Settings; |
| 12 | |
| 13 | public function __construct() |
| 14 | { |
| 15 | $this->Settings = GutenbergEnhancementsController::GetEnhancementsOptions(get_current_user_id()); |
| 16 | $this->Render(); |
| 17 | } |
| 18 | |
| 19 | private function Render() |
| 20 | { |
| 21 | ?> |
| 22 | <div class="superbaddons-dashboard-section-header"> |
| 23 | <h4 class="superbaddons-element-text-sm superbaddons-element-text-dark superbaddons-element-text-800 superbaddons-element-m0"><?php echo esc_html__("Editor Preferences", "superb-blocks"); ?></h4> |
| 24 | </div> |
| 25 | <p class="superbaddons-element-text-xs superbaddons-element-text-gray superbaddons-help-text-inline"><?php echo esc_html__("These settings apply only to your account.", "superb-blocks"); ?></p> |
| 26 | |
| 27 | <div class="superbaddons-editor-settings-highlights-wrapper"> |
| 28 | <h5 class="superbaddons-element-flex-center superbaddons-element-text-xs superbaddons-element-text-dark superbaddons-element-text-800 superbaddons-element-m0 superbaddons-element-mb1"><img class="superbaddons-admindashboard-content-icon superbaddons-element-mr1" src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/purple-selection-plus.svg'); ?>" /><?php echo esc_html__("Editor Outlines", "superb-blocks"); ?></h5> |
| 29 | <?php new InputCheckbox('superbaddons-enhancement-highlights-input', GutenbergEnhancementsController::HIGHLIGHTS_KEY, __("Enable Outlines", "superb-blocks"), __("When this setting is enabled, related block and editable text will be outlined whenever you hover over a block with your mouse, making it easy to visualize your layout structure.", "superb-blocks"), $this->Settings[GutenbergEnhancementsController::HIGHLIGHTS_KEY], '/img/selection-plus.svg'); ?> |
| 30 | <div class="superbaddons-enhancement-children" data-parent="superbaddons-enhancement-highlights-input" <?php echo !$this->Settings[GutenbergEnhancementsController::HIGHLIGHTS_KEY] ? ' style="opacity:0.5;pointer-events:none;"' : ''; ?>> |
| 31 | <?php new InputCheckbox('superbaddons-enhancement-highlights-quickoptions-input', GutenbergEnhancementsController::HIGHLIGHTS_QUICKOPTIONS_KEY, __("Quick Options", "superb-blocks"), __("Enables a quick options panel at the top of the highlighted or selected block.", "superb-blocks"), $this->Settings[GutenbergEnhancementsController::HIGHLIGHTS_QUICKOPTIONS_KEY]); ?> |
| 32 | <div class="superbaddons-enhancement-children" data-parent="superbaddons-enhancement-highlights-quickoptions-input" <?php echo !$this->Settings[GutenbergEnhancementsController::HIGHLIGHTS_QUICKOPTIONS_KEY] ? ' style="opacity:0.5;pointer-events:none;"' : ''; ?>> |
| 33 | <?php new InputCheckbox('superbaddons-enhancement-highlights-quickoptions-bottom-input', GutenbergEnhancementsController::HIGHLIGHTS_QUICKOPTIONS_BOTTOM_KEY, __("Position Quick Options at Bottom", "superb-blocks"), __("Moves the quick options panel to the bottom of the highlighted or selected block instead of the top.", "superb-blocks"), $this->Settings[GutenbergEnhancementsController::HIGHLIGHTS_QUICKOPTIONS_BOTTOM_KEY]); ?> |
| 34 | </div> |
| 35 | </div> |
| 36 | </div> |
| 37 | <div class="superbaddons-editor-settings-panel-state-wrapper"> |
| 38 | <div class="superbaddons-element-separator"></div> |
| 39 | <div class="superb-addons-checkbox-input-wrapper" style="margin-top: 16px; margin-bottom: 0;"> |
| 40 | <div class="superbaddons-setting-row" style="border: none; padding-bottom: 0;"> |
| 41 | <div class="superbaddons-setting-row-label"> |
| 42 | <label class="superbaddons-element-text-xs superbaddons-element-text-gray" for="superbaddons-enhancement-panel-state-select"> |
| 43 | <?php echo esc_html__("Enhancement Panel Default State", "superb-blocks"); ?> |
| 44 | <button type="button" class="superbaddons-help-toggle" aria-label="<?php echo esc_attr__('Toggle help text', 'superb-blocks'); ?>">i</button> |
| 45 | </label> |
| 46 | </div> |
| 47 | <div class="superbaddons-setting-row-control"> |
| 48 | <select id="superbaddons-enhancement-panel-state-select" data-action="<?php echo esc_attr(GutenbergEnhancementsController::PANEL_DEFAULT_STATE_KEY); ?>" class="superbaddons-enhancement-select"> |
| 49 | <option value="open" <?php echo $this->Settings[GutenbergEnhancementsController::PANEL_DEFAULT_STATE_KEY] === 'open' ? ' selected' : ''; ?>><?php echo esc_html__("Open", "superb-blocks"); ?></option> |
| 50 | <option value="closed" <?php echo $this->Settings[GutenbergEnhancementsController::PANEL_DEFAULT_STATE_KEY] === 'closed' ? ' selected' : ''; ?>><?php echo esc_html__("Closed", "superb-blocks"); ?></option> |
| 51 | <option value="dynamic" <?php echo $this->Settings[GutenbergEnhancementsController::PANEL_DEFAULT_STATE_KEY] === 'dynamic' ? ' selected' : ''; ?>><?php echo esc_html__("Dynamic", "superb-blocks"); ?></option> |
| 52 | </select> |
| 53 | </div> |
| 54 | </div> |
| 55 | <p class="superbaddons-element-text-xxs superbaddons-element-text-gray superbaddons-help-text"><?php echo esc_html__("Controls how enhancement panels behave in the block settings sidebar when a block is selected.", "superb-blocks"); ?></p> |
| 56 | <ul class="superbaddons-help-text" style="padding-left: 16px;"> |
| 57 | <li class="superbaddons-element-text-xxs superbaddons-element-text-gray"><?php echo esc_html__("Open: always expanded.", "superb-blocks"); ?></li> |
| 58 | <li class="superbaddons-element-text-xxs superbaddons-element-text-gray"><?php echo esc_html__("Closed: always collapsed.", "superb-blocks"); ?></li> |
| 59 | <li class="superbaddons-element-text-xxs superbaddons-element-text-gray"><?php echo esc_html__("Dynamic: collapsed by default, but expanded when the panel's features are in use on the selected block.", "superb-blocks"); ?></li> |
| 60 | </ul> |
| 61 | </div> |
| 62 | </div> |
| 63 | <?php |
| 64 | } |
| 65 | } |
| 66 |