| 1 |
<?php |
| 2 |
|
| 3 |
// Create a section. |
| 4 |
CSF::createSection( |
| 5 |
$prefix, |
| 6 |
[ |
| 7 |
'title' => __('Forum Topics', 'forumax'), |
| 8 |
'id' => 'topics_fields', |
| 9 |
'icon' => 'dashicons dashicons-menu-alt3', |
| 10 |
'fields' => [ |
| 11 |
[ |
| 12 |
'title' => esc_html__('Title Prefix', 'forumax'), |
| 13 |
'subtitle' => esc_html__('Set the prefix text that appears before topic titles (e.g., "Q:").', 'forumax'), |
| 14 |
'id' => 'topic_title_prefix', |
| 15 |
'type' => 'text', |
| 16 |
'default' => esc_html__('Q:', 'forumax') |
| 17 |
], |
| 18 |
[ |
| 19 |
'id' => 'is_solved_topics', |
| 20 |
'type' => 'switcher', |
| 21 |
'default' => true, |
| 22 |
'title' => __('Solved Topics', 'forumax'), |
| 23 |
'subtitle' => __('Allow users and moderators to mark topics as solved.', 'forumax'), |
| 24 |
], |
| 25 |
[ |
| 26 |
'id' => 'auto_close_stale_topics', |
| 27 |
'type' => 'switcher', |
| 28 |
'title' => __('Auto-Close Stale Topics', 'forumax'), |
| 29 |
'subtitle' => __('Automatically close old topics that haven\'t received any recent replies.', 'forumax'), |
| 30 |
'default' => false, |
| 31 |
], |
| 32 |
[ |
| 33 |
'id' => 'auto_close_days', |
| 34 |
'type' => 'number', |
| 35 |
'title' => __('Close After (days)', 'forumax'), |
| 36 |
'subtitle' => __('Set the number of days of inactivity before a topic is automatically closed.', 'forumax'), |
| 37 |
'default' => 90, |
| 38 |
'dependency' => ['auto_close_stale_topics', '==', 'true'], |
| 39 |
], |
| 40 |
[ |
| 41 |
'id' => 'is_auto_approval_topics', |
| 42 |
'type' => 'switcher', |
| 43 |
'default' => false, |
| 44 |
'title' => __('Auto Approval', 'forumax'), |
| 45 |
'subtitle' => __('Automatically approve new topics so they are published without moderation.', 'forumax'), |
| 46 |
'class' => 'st-pro-notice', |
| 47 |
], |
| 48 |
[ |
| 49 |
'id' => 'topic_pending_notice', |
| 50 |
'type' => 'text', |
| 51 |
'title' => __('Pending Notice', 'forumax'), |
| 52 |
'subtitle' => __('Set the message displayed to users when their newly created topic is pending moderation.', 'forumax'), |
| 53 |
'default' => __('Your topic is awaiting for moderation.', 'forumax'), |
| 54 |
'dependency' => ['is_auto_approval_topics', '==', false], |
| 55 |
'class' => 'st-pro-notice', |
| 56 |
], |
| 57 |
[ |
| 58 |
'id' => 'anonymous_topic', |
| 59 |
'type' => 'switcher', |
| 60 |
'title' => __('Anonymous Topic', 'forumax'), |
| 61 |
'subtitle' => __('Allow visitors to create topics anonymously without creating an account.', 'forumax'), |
| 62 |
'class' => 'st-pro-notice', |
| 63 |
], |
| 64 |
[ |
| 65 |
'id' => 'anonymous_topic_label', |
| 66 |
'type' => 'text', |
| 67 |
'title' => __('Anonymous Label', 'forumax'), |
| 68 |
'subtitle' => __('Set the label for the checkbox that lets a user post anonymously.', 'forumax'), |
| 69 |
'default' => __('Post Anonymously', 'forumax'), |
| 70 |
'dependency' => ['anonymous_topic', '==', 'true',], |
| 71 |
'class' => 'st-pro-notice', |
| 72 |
], |
| 73 |
|
| 74 |
[ |
| 75 |
'type' => 'subheading', |
| 76 |
'title' => __('Reaction', 'forumax'), |
| 77 |
], |
| 78 |
|
| 79 |
[ |
| 80 |
'id' => 'topics_react_voting', |
| 81 |
'type' => 'switcher', |
| 82 |
'title' => __('React Reactions', 'forumax'), |
| 83 |
'subtitle' => __('Allow users to leave emoji reactions on topics.', 'forumax'), |
| 84 |
'class' => 'st-promax-notice', |
| 85 |
'default' => false |
| 86 |
], |
| 87 |
[ |
| 88 |
'id' => 'topics_react_label', |
| 89 |
'type' => 'text', |
| 90 |
'title' => __('React Button Text', 'forumax'), |
| 91 |
'subtitle' => __('Set the text for the button that opens the emoji reaction picker.', 'forumax'), |
| 92 |
'default' => __('React', 'forumax'), |
| 93 |
'class' => 'st-promax-notice', |
| 94 |
'dependency' => ['topics_react_voting', '==', 'true',] |
| 95 |
], |
| 96 |
|
| 97 |
[ |
| 98 |
'id' => 'reactions', |
| 99 |
'type' => 'group', |
| 100 |
'title' => __('Emoji Reactions', 'forumax'), |
| 101 |
'subtitle' => __('Add, remove, or modify the emoji reactions available for users.', 'forumax'), |
| 102 |
'class' => 'st-promax-notice', |
| 103 |
'fields' => [ |
| 104 |
[ |
| 105 |
'id' => 'icon', |
| 106 |
'type' => 'text', |
| 107 |
'title' => __('Icon (Emoji)', 'forumax'), |
| 108 |
], |
| 109 |
[ |
| 110 |
'id' => 'label', |
| 111 |
'type' => 'text', |
| 112 |
'title' => __('Label', 'forumax'), |
| 113 |
], |
| 114 |
], |
| 115 |
'default' => [ |
| 116 |
['icon' => '👍', 'label' => 'Like'], |
| 117 |
['icon' => '👎', 'label' => 'Dislike'], |
| 118 |
['icon' => '❤️', 'label' => 'Love'], |
| 119 |
['icon' => '😂', 'label' => 'Haha'], |
| 120 |
['icon' => '😮', 'label' => 'Wow'], |
| 121 |
['icon' => '😢', 'label' => 'Sad'], |
| 122 |
['icon' => '😡', 'label' => 'Angry'], |
| 123 |
], |
| 124 |
'dependency' => ['topics_react_voting', '==', 'true',], |
| 125 |
'button_title' => __('Add Reaction', 'forumax'), |
| 126 |
'button_remove' => true, |
| 127 |
'add_title' => __('Add New Reaction', 'forumax'), |
| 128 |
'remove_title' => __('Remove Reaction', 'forumax'), |
| 129 |
'accordion_title_auto' => true, |
| 130 |
'accordion_title_number' => true, |
| 131 |
'accordion_title_prefix' => __('Reaction:', 'forumax'), |
| 132 |
], |
| 133 |
[ |
| 134 |
'type' => 'subheading', |
| 135 |
'title' => __('Same Topic Voting', 'forumax'), |
| 136 |
], |
| 137 |
[ |
| 138 |
'id' => 'same_topic_voting', |
| 139 |
'type' => 'switcher', |
| 140 |
'title' => __('Enable / Disable', 'forumax'), |
| 141 |
'class' => 'st-pro-notice', |
| 142 |
], |
| 143 |
[ |
| 144 |
'id' => 'same_topic_settings', |
| 145 |
'type' => 'tabbed', |
| 146 |
'title' => __('Settings', 'forumax'), |
| 147 |
'subtitle' => __('Customize the text and colors for the "I have the same question" voting button.', 'forumax'), |
| 148 |
'dependency' => ['same_topic_voting', '==', 'true',], |
| 149 |
'tabs' => array( |
| 150 |
array( |
| 151 |
'title' => __('Button', 'forumax'), |
| 152 |
'fields' => array( |
| 153 |
[ |
| 154 |
'id' => 'same_topic_voting_label', |
| 155 |
'type' => 'text', |
| 156 |
'title' => __('Label', 'forumax'), |
| 157 |
'default' => __('I have the same question', 'forumax'), |
| 158 |
'class' => 'st-pro-notice' |
| 159 |
], |
| 160 |
[ |
| 161 |
'id' => 'same_topic_color', |
| 162 |
'type' => 'link_color', |
| 163 |
'title' => __('Color', 'forumax'), |
| 164 |
'output' => '.bbpc-same-topic-btn', |
| 165 |
'output_mode' => 'color', |
| 166 |
'output_important' => true, |
| 167 |
'class' => 'st-pro-notice' |
| 168 |
], |
| 169 |
[ |
| 170 |
'id' => 'same_topic_bg_color_normal', |
| 171 |
'type' => 'background', |
| 172 |
'title' => __('Background', 'forumax'), |
| 173 |
'background_image' => false, |
| 174 |
'background_attachment' => false, |
| 175 |
'background_position' => false, |
| 176 |
'background_repeat' => false, |
| 177 |
'background_size' => false, |
| 178 |
'output' => '.bbpc-same-topic-btn', |
| 179 |
'output_mode' => 'background', |
| 180 |
'output_important' => true, |
| 181 |
'class' => 'st-pro-notice' |
| 182 |
], |
| 183 |
[ |
| 184 |
'id' => 'same_topic_bg_color_hover', |
| 185 |
'type' => 'background', |
| 186 |
'title' => __('Hover Background', 'forumax'), |
| 187 |
'background_image' => false, |
| 188 |
'background_attachment' => false, |
| 189 |
'background_position' => false, |
| 190 |
'background_repeat' => false, |
| 191 |
'background_size' => false, |
| 192 |
'output' => '.bbpc-same-topic-btn:hover', |
| 193 |
'output_mode' => 'background', |
| 194 |
'output_important' => true, |
| 195 |
'class' => 'st-pro-notice' |
| 196 |
] |
| 197 |
) |
| 198 |
), |
| 199 |
array( |
| 200 |
'title' => __('Success', 'forumax'), |
| 201 |
'fields' => array( |
| 202 |
[ |
| 203 |
'id' => 'same_topic_voting_success', |
| 204 |
'type' => 'text', |
| 205 |
'title' => __('Text', 'forumax'), |
| 206 |
'default' => __('Updated vote successfully', 'forumax'), |
| 207 |
'class' => 'st-pro-notice' |
| 208 |
], |
| 209 |
[ |
| 210 |
'id' => 'same_topic_success_color', |
| 211 |
'type' => 'link_color', |
| 212 |
'title' => __('Color', 'forumax'), |
| 213 |
'default' => array( |
| 214 |
'color' => '#4a4a4a', |
| 215 |
'hover' => '#4a4a4a', |
| 216 |
), |
| 217 |
'output' => '.same-topic-voting-notice', |
| 218 |
'output_mode' => 'color', |
| 219 |
'output_important' => true, |
| 220 |
'class' => 'st-pro-notice' |
| 221 |
], |
| 222 |
[ |
| 223 |
'id' => 'same_topic_bg_success_color', |
| 224 |
'type' => 'background', |
| 225 |
'title' => __('Background', 'forumax'), |
| 226 |
'background_image' => false, |
| 227 |
'background_attachment' => false, |
| 228 |
'background_position' => false, |
| 229 |
'background_repeat' => false, |
| 230 |
'background_size' => false, |
| 231 |
'default' => [ |
| 232 |
'background-color' => '#f9f9f9' |
| 233 |
], |
| 234 |
'output' => '.same-topic-voting-notice', |
| 235 |
'output_mode' => 'background', |
| 236 |
'output_important' => true, |
| 237 |
'class' => 'st-pro-notice' |
| 238 |
], |
| 239 |
[ |
| 240 |
'id' => 'same_topic_bg_success_color_hover', |
| 241 |
'type' => 'background', |
| 242 |
'title' => __('Hover Background', 'forumax'), |
| 243 |
'background_image' => false, |
| 244 |
'background_attachment' => false, |
| 245 |
'background_position' => false, |
| 246 |
'background_repeat' => false, |
| 247 |
'background_size' => false, |
| 248 |
'default' => [ |
| 249 |
'background-color' => '#f9f9f9' |
| 250 |
], |
| 251 |
'output' => '.same-topic-voting-notice:hover', |
| 252 |
'output_mode' => 'background', |
| 253 |
'output_important' => true, |
| 254 |
'class' => 'st-pro-notice' |
| 255 |
] |
| 256 |
) |
| 257 |
) |
| 258 |
) |
| 259 |
], |
| 260 |
[ |
| 261 |
'type' => 'heading', |
| 262 |
'title' => esc_html__('Sharing Topics', 'forumax'), |
| 263 |
], |
| 264 |
[ |
| 265 |
'id' => 'is_social_links', |
| 266 |
'type' => 'switcher', |
| 267 |
'title' => esc_html__('Share Button', 'forumax'), |
| 268 |
'subtitle' => esc_html__('Enable the share button on topics so users can easily share them to social media.', 'forumax'), |
| 269 |
'text_on' => esc_html__('Enabled', 'forumax'), |
| 270 |
'text_off' => esc_html__('Disabled', 'forumax'), |
| 271 |
'text_width' => 92, |
| 272 |
'default' => true |
| 273 |
], |
| 274 |
[ |
| 275 |
'id' => 'share_btn_label', |
| 276 |
'type' => 'text', |
| 277 |
'title' => esc_html__('Share Button Label', 'forumax'), |
| 278 |
'subtitle' => esc_html__('Set the text for the button that opens the topic sharing menu.', 'forumax'), |
| 279 |
'default' => esc_html__('Share this Topic', 'forumax'), |
| 280 |
'dependency' => array( |
| 281 |
array('is_copy_link', '==', '1'), |
| 282 |
array('is_social_links', '==', '1'), |
| 283 |
) |
| 284 |
], |
| 285 |
[ |
| 286 |
'id' => 'is_copy_link', |
| 287 |
'type' => 'switcher', |
| 288 |
'title' => esc_html__('Copy Link Button', 'forumax'), |
| 289 |
'subtitle' => esc_html__('Show a button allowing users to easily copy the topic link to their clipboard.', 'forumax'), |
| 290 |
'dependency' => array('is_social_links', '==', '1'), |
| 291 |
'text_width' => 72, |
| 292 |
'default' => true, |
| 293 |
], |
| 294 |
[ |
| 295 |
'id' => 'copy_link_label', |
| 296 |
'type' => 'text', |
| 297 |
'title' => esc_html__('Copy Link Label', 'forumax'), |
| 298 |
'subtitle' => esc_html__('Set the text for the button that copies the topic link.', 'forumax'), |
| 299 |
'default' => esc_html__('Or copy link', 'forumax'), |
| 300 |
'dependency' => array( |
| 301 |
array('is_copy_link', '==', '1'), |
| 302 |
array('is_social_links', '==', '1'), |
| 303 |
) |
| 304 |
], |
| 305 |
[ |
| 306 |
'id' => 'copy_link_text_success', |
| 307 |
'type' => 'text', |
| 308 |
'title' => esc_html__('Success Message', 'forumax'), |
| 309 |
'subtitle' => esc_html__('Set the success message that appears when the link is copied to the clipboard.', 'forumax'), |
| 310 |
'default' => esc_html__('URL copied to clipboard', 'forumax'), |
| 311 |
'dependency' => array( |
| 312 |
array('is_copy_link', '==', '1'), |
| 313 |
array('is_social_links', '==', '1'), |
| 314 |
) |
| 315 |
], |
| 316 |
[ |
| 317 |
'type' => 'heading', |
| 318 |
'title' => __('Real-Time Alert', 'forumax'), |
| 319 |
], |
| 320 |
[ |
| 321 |
'id' => 'real_time_alerts_enabled', |
| 322 |
'type' => 'switcher', |
| 323 |
'title' => __('Real-Time Chat Notice', 'forumax'), |
| 324 |
'subtitle' => __('Enable a live notification bubble when new replies or topics are posted in real-time.', 'forumax'), |
| 325 |
'default' => false, |
| 326 |
'class' => 'st-promax-notice', |
| 327 |
], |
| 328 |
[ |
| 329 |
'id' => 'real_time_alerts_label', |
| 330 |
'type' => 'text', |
| 331 |
'title' => __('Alert Label', 'forumax'), |
| 332 |
'subtitle' => __('Set the text for the live alert button. Use %d to display the number of new topics.', 'forumax'), |
| 333 |
'default' => __('See %d new topics', 'forumax'), |
| 334 |
'dependency' => ['real_time_alerts_enabled', '==', 'true'], |
| 335 |
'class' => 'st-promax-notice', |
| 336 |
], |
| 337 |
[ |
| 338 |
'id' => 'real_time_alerts_interval', |
| 339 |
'type' => 'number', |
| 340 |
'title' => __('Polling Interval (seconds)', 'forumax'), |
| 341 |
'subtitle' => __('Set how often (in seconds) the system checks for new real-time topics.', 'forumax'), |
| 342 |
'default' => 30, |
| 343 |
'min' => 5, |
| 344 |
'max' => 300, |
| 345 |
'dependency' => ['real_time_alerts_enabled', '==', 'true'], |
| 346 |
'class' => 'st-promax-notice', |
| 347 |
], |
| 348 |
[ |
| 349 |
'id' => 'topic_subscription', |
| 350 |
'title' => esc_html__('Subscription', 'forumax'), |
| 351 |
'subtitle' => esc_html__('Manage how topic subscriptions act and appear for logged out visitors.', 'forumax'), |
| 352 |
'type' => 'subheading' |
| 353 |
], |
| 354 |
[ |
| 355 |
'title' => esc_html__('Enable / Disable', 'forumax'), |
| 356 |
'id' => 'is_topic_subscription', |
| 357 |
'type' => 'switcher', |
| 358 |
'subtitle' => esc_html__('Show a subscribe button to logged out users, prompting them to log in.', 'forumax'), |
| 359 |
'text_on' => esc_html__('Show', 'forumax'), |
| 360 |
'text_off' => esc_html__('Hide', 'forumax'), |
| 361 |
'default' => '1', |
| 362 |
'text_width' => 80, |
| 363 |
], |
| 364 |
[ |
| 365 |
'title' => esc_html__('Subscribe Button', 'forumax'), |
| 366 |
'id' => 'logout_subscription_btn', |
| 367 |
'type' => 'text', |
| 368 |
'subtitle' => esc_html__('Set the text for the subscribe button displayed to logged out users.', 'forumax'), |
| 369 |
'default' => esc_html__('Subscribe', 'forumax'), |
| 370 |
'dependency' => array( 'is_topic_subscription', '==', '1' ) |
| 371 |
], |
| 372 |
[ |
| 373 |
'title' => esc_html__('Title', 'forumax'), |
| 374 |
'id' => 'subscription_modal_title', |
| 375 |
'type' => 'text', |
| 376 |
'subtitle' => esc_html__('Set the title for the modal popup that prompts users to log in to subscribe.', 'forumax'), |
| 377 |
'default' => esc_html__('Login to the community', 'forumax'), |
| 378 |
'dependency' => array( 'is_topic_subscription', '==', '1' ) |
| 379 |
], |
| 380 |
[ |
| 381 |
'title' => esc_html__('Subtitle', 'forumax'), |
| 382 |
'id' => 'subscription_modal_subtitle', |
| 383 |
'type' => 'text', |
| 384 |
'subtitle' => esc_html__('Set the descriptive text for the login prompt modal popup.', 'forumax'), |
| 385 |
'default' => esc_html__('You must be logged in to subscribe to this topic.', 'forumax'), |
| 386 |
'dependency' => array( 'is_topic_subscription', '==', '1' ) |
| 387 |
], |
| 388 |
[ |
| 389 |
'title' => esc_html__('Login Button', 'forumax'), |
| 390 |
'id' => 'logout_login_btn', |
| 391 |
'type' => 'text', |
| 392 |
'subtitle' => esc_html__('Set the text for the login action button inside the modal.', 'forumax'), |
| 393 |
'default' => esc_html__('Login', 'forumax'), |
| 394 |
'dependency' => array( 'is_topic_subscription', '==', '1' ) |
| 395 |
], |
| 396 |
[ |
| 397 |
'title' => esc_html__('Login Type', 'forumax'), |
| 398 |
'id' => 'login_url_type', |
| 399 |
'type' => 'select', |
| 400 |
'subtitle' => esc_html__('Choose whether to redirect users to the default WordPress login or a custom page.', 'forumax'), |
| 401 |
'default' => 'default', |
| 402 |
'options' => array( |
| 403 |
'default' => esc_html__('Default Login', 'forumax'), |
| 404 |
'custom' => esc_html__('Custom Page', 'forumax'), |
| 405 |
), |
| 406 |
'dependency' => array( 'is_topic_subscription', '==', '1' ) |
| 407 |
], |
| 408 |
[ |
| 409 |
'title' => esc_html__('Select Page', 'forumax'), |
| 410 |
'id' => 'login_page', |
| 411 |
'type' => 'select', |
| 412 |
'subtitle' => esc_html__('Select the custom WordPress page to use for login redirection.', 'forumax'), |
| 413 |
'options' => 'pages', |
| 414 |
'dependency' => array( |
| 415 |
array( 'login_url_type', '==', 'custom' ), |
| 416 |
array( 'is_topic_subscription', '==', '1' ), |
| 417 |
) |
| 418 |
] |
| 419 |
] |
| 420 |
] |
| 421 |
); |
| 422 |
|