|
| 1 | +<?php |
| 2 | + |
| 3 | +function themeSettings() |
| 4 | +{ |
| 5 | + /****************************************** |
| 6 | + ** Section "Captcha wall text contents" ** |
| 7 | + *****************************************/ |
| 8 | + |
| 9 | + add_settings_section('crowdsec_theme_captcha_texts', 'Adapt the wording of the Captcha Wall', function () { |
| 10 | + echo 'You can customize the text display on the captcha wall.'; |
| 11 | + }, 'crowdsec_theme_settings'); |
| 12 | + |
| 13 | + // Field "crowdsec_theme_text_captcha_wall_tab_title" |
| 14 | + addFieldString('crowdsec_theme_text_captcha_wall_tab_title', 'Browser tab text', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_captcha_texts', function ($input) { |
| 15 | + return $input; |
| 16 | + }, '<p>The text in the browser tab of the captcha wall page.</p>', 'Tab text', 'width: 150px;', 'text'); |
| 17 | + |
| 18 | + // Field "crowdsec_theme_text_captcha_wall_title" |
| 19 | + addFieldString('crowdsec_theme_text_captcha_wall_title', 'Title text', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_captcha_texts', function ($input) { |
| 20 | + return $input; |
| 21 | + }, '<p>The title text of the captcha wall page.</p>', 'Subtitle text', '', 'text'); |
| 22 | + |
| 23 | + // Field "crowdsec_theme_text_captcha_wall_subtitle" |
| 24 | + addFieldString('crowdsec_theme_text_captcha_wall_subtitle', 'Subtitle text', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_captcha_texts', function ($input) { |
| 25 | + return $input; |
| 26 | + }, '<p>The subtitle text of the captcha wall page.</p>', 'Subtitle text', '', 'text'); |
| 27 | + |
| 28 | + // Field "crowdsec_theme_text_captcha_wall_refresh_image_link" |
| 29 | + addFieldString('crowdsec_theme_text_captcha_wall_refresh_image_link', 'Refresh image text', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_captcha_texts', function ($input) { |
| 30 | + return $input; |
| 31 | + }, '<p>The "refresh image" text of the captcha wall page.</p>', 'Refresh image text', '', 'text'); |
| 32 | + |
| 33 | + // Field "crowdsec_theme_text_captcha_wall_captcha_placeholder" |
| 34 | + addFieldString('crowdsec_theme_text_captcha_wall_captcha_placeholder', 'Input placeholder', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_captcha_texts', function ($input) { |
| 35 | + return $input; |
| 36 | + }, '<p>The "refresh image" text of the captcha wall page.</p>', 'Captcha input placeholder', '', 'text'); |
| 37 | + |
| 38 | + // Field "crowdsec_theme_text_captcha_wall_send_button" |
| 39 | + addFieldString('crowdsec_theme_text_captcha_wall_send_button', 'Send button text', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_captcha_texts', function ($input) { |
| 40 | + return $input; |
| 41 | + }, '<p>The "refresh image" text of the captcha wall page.</p>', 'Send button text', '', 'text'); |
| 42 | + |
| 43 | + // Field "crowdsec_theme_text_captcha_wall_error_message" |
| 44 | + addFieldString('crowdsec_theme_text_captcha_wall_error_message', 'Error message', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_captcha_texts', function ($input) { |
| 45 | + return $input; |
| 46 | + }, '<p>The "error message" text of the captcha wall page when a captcha is not successfuly resolved.</p>', 'Error message', '', 'text'); |
| 47 | + |
| 48 | + // Field "crowdsec_theme_text_captcha_wall_footer" |
| 49 | + addFieldString('crowdsec_theme_text_captcha_wall_footer', 'Footer custom message', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_captcha_texts', function ($input) { |
| 50 | + return $input; |
| 51 | + }, '<p>You can add a custom footer text.</p>', 'Custom footer text', '', 'text'); |
| 52 | + |
| 53 | + /************************************** |
| 54 | + ** Section "Ban wall text contents" ** |
| 55 | + *************************************/ |
| 56 | + |
| 57 | + add_settings_section('crowdsec_theme_ban_texts', 'Adapt the wording of the Ban Wall', function () { |
| 58 | + echo 'You can customize the text display on the ban wall.'; |
| 59 | + }, 'crowdsec_theme_settings'); |
| 60 | + |
| 61 | + // Field "crowdsec_theme_text_ban_wall_tab_title" |
| 62 | + addFieldString('crowdsec_theme_text_ban_wall_tab_title', 'Browser tab text', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_ban_texts', function ($input) { |
| 63 | + return $input; |
| 64 | + }, '<p>The text in the browser tab of the ban wall page.</p>', 'Tab text', 'width: 150px;', 'text'); |
| 65 | + |
| 66 | + // Field "crowdsec_theme_text_ban_wall_title" |
| 67 | + addFieldString('crowdsec_theme_text_ban_wall_title', 'Title text', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_ban_texts', function ($input) { |
| 68 | + return $input; |
| 69 | + }, '<p>The title text of the ban wall page.</p>', 'Subtitle text', '', 'text'); |
| 70 | + |
| 71 | + // Field "crowdsec_theme_text_ban_wall_subtitle" |
| 72 | + addFieldString('crowdsec_theme_text_ban_wall_subtitle', 'Subtitle text', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_ban_texts', function ($input) { |
| 73 | + return $input; |
| 74 | + }, '<p>The subtitle text of the ban wall page.</p>', 'Subtitle text', '', 'text'); |
| 75 | + |
| 76 | + // Field "crowdsec_theme_text_ban_wall_footer" |
| 77 | + addFieldString('crowdsec_theme_text_ban_wall_footer', 'Footer custom message', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_ban_texts', function ($input) { |
| 78 | + return $input; |
| 79 | + }, '<p>You can add a custom footer text.</p>', 'Custom footer text', '', 'text'); |
| 80 | + |
| 81 | + /********************** |
| 82 | + ** Section "Colors" ** |
| 83 | + *********************/ |
| 84 | + |
| 85 | + add_settings_section('crowdsec_theme_colors', 'Use your own colors!', function () { |
| 86 | + echo 'You can customize remediation wall colors (ban wall and captcha wall).'; |
| 87 | + }, 'crowdsec_theme_settings'); |
| 88 | + |
| 89 | + // Field "crowdsec_theme_color_text_primary" |
| 90 | + addFieldString('crowdsec_theme_color_text_primary', 'Primary text color', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_colors', function ($input) { |
| 91 | + return $input; |
| 92 | + }, '<p>The color used for primary text on the two pages.</p>', 'CSS color', 'width: 100px;', 'text'); |
| 93 | + |
| 94 | + // Field "crowdsec_theme_color_text_secondary" |
| 95 | + addFieldString('crowdsec_theme_color_text_secondary', 'Secondary text color', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_colors', function ($input) { |
| 96 | + return $input; |
| 97 | + }, '<p>The color used for secondary text on the two pages.</p>', 'CSS color', 'width: 100px;', 'text'); |
| 98 | + |
| 99 | + // Field "crowdsec_theme_color_text_button" |
| 100 | + addFieldString('crowdsec_theme_color_text_button', 'Button text color', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_colors', function ($input) { |
| 101 | + return $input; |
| 102 | + }, '<p>The color of the text of the button on the captcha wall page.</p>', 'CSS color', 'width: 100px;', 'text'); |
| 103 | + |
| 104 | + // Field "crowdsec_theme_color_text_error_message" |
| 105 | + addFieldString('crowdsec_theme_color_text_error_message', 'Error message text color', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_colors', function ($input) { |
| 106 | + return $input; |
| 107 | + }, '<p>The color used for the error message (when captcha resolution failed).</p>', 'CSS color', 'width: 100px;', 'text'); |
| 108 | + |
| 109 | + // Field "crowdsec_theme_color_background_page" |
| 110 | + addFieldString('crowdsec_theme_color_background_page', 'Page background color', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_colors', function ($input) { |
| 111 | + return $input; |
| 112 | + }, '<p>The background color used of the two pages.</p>', 'CSS color', 'width: 100px;', 'text'); |
| 113 | + |
| 114 | + // Field "crowdsec_theme_color_background_container" |
| 115 | + addFieldString('crowdsec_theme_color_background_container', 'Container background color', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_colors', function ($input) { |
| 116 | + return $input; |
| 117 | + }, '<p>The background color used for the central block on the two pages</p>', 'CSS color', 'width: 100px;', 'text'); |
| 118 | + |
| 119 | + // Field "crowdsec_theme_color_background_button" |
| 120 | + addFieldString('crowdsec_theme_color_background_button', 'Button background color', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_colors', function ($input) { |
| 121 | + return $input; |
| 122 | + }, '<p>The background color used for the captcha validation button.</p>', 'CSS color', 'width: 100px;', 'text'); |
| 123 | + |
| 124 | + // Field "crowdsec_theme_color_background_button_hover" |
| 125 | + addFieldString('crowdsec_theme_color_background_button_hover', 'Button background color (hover)', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_colors', function ($input) { |
| 126 | + return $input; |
| 127 | + }, '<p>The background color used for the captcha validation button when it\'s hover.</p>', 'CSS color', 'width: 100px;', 'text'); |
| 128 | + |
| 129 | + /************************** |
| 130 | + ** Section "Custom CSS" ** |
| 131 | + *************************/ |
| 132 | + |
| 133 | + add_settings_section('crowdsec_theme_css', 'Use your own CSS code!', function () { |
| 134 | + echo 'You can customize remediation walls with CSS code (ban wall and captcha wall).'; |
| 135 | + }, 'crowdsec_theme_settings'); |
| 136 | + |
| 137 | + // Field "crowdsec_theme_custom_css" |
| 138 | + addFieldString('crowdsec_theme_custom_css', 'Custom CSS code', 'crowdsec_plugin_theme_settings', 'crowdsec_theme_settings', 'crowdsec_theme_css', function ($input) { |
| 139 | + return $input; |
| 140 | + }, '<p>The CSS code to use in the remediation wall (ban wall and captcha wall).</p>', 'CSS code...', '', 'text'); |
| 141 | +} |
0 commit comments