| 1 |
<?php |
| 2 |
// Create a section. |
| 3 |
CSF::createSection( |
| 4 |
$prefix, |
| 5 |
[ |
| 6 |
'title' => __( 'Voting', 'forumax' ), |
| 7 |
'icon' => 'dashicons dashicons-thumbs-up', |
| 8 |
'fields' => [ |
| 9 |
[ |
| 10 |
'id' => 'is_votes', |
| 11 |
'type' => 'switcher', |
| 12 |
'default' => 1, |
| 13 |
'title' => __( 'Enable BBP Voting Features?', 'forumax' ), |
| 14 |
], |
| 15 |
|
| 16 |
[ |
| 17 |
'id' => 'vote_numbers_display', |
| 18 |
'type' => 'select', |
| 19 |
'title' => __( 'Display Vote Numbers', 'forumax' ), |
| 20 |
'sub' => __( 'Choose how to display the number of up votes and down votes', 'forumax' ), |
| 21 |
'chosen' => true, |
| 22 |
'placeholder' => __( 'Select an option', 'forumax' ), |
| 23 |
'options' => [ |
| 24 |
'hover' => __( 'Hover', 'forumax' ), |
| 25 |
'always-show' => __( 'Always Show', 'forumax' ), |
| 26 |
'hide' => __( 'Hide', 'forumax' ), |
| 27 |
], |
| 28 |
'default' => 'hover', |
| 29 |
'dependency' => [ 'is_votes', '==', 'true' ] |
| 30 |
], |
| 31 |
|
| 32 |
[ |
| 33 |
'type' => 'subheading', |
| 34 |
'content' => __( 'Voting Buttons', 'forumax' ), |
| 35 |
'dependency' => [ 'is_votes', '==', 'true', ] |
| 36 |
], |
| 37 |
|
| 38 |
[ |
| 39 |
'id' => 'is_voting_disabled_topics', |
| 40 |
'type' => 'switcher', |
| 41 |
'default' => 0, |
| 42 |
'title' => __( 'Voting on Topics', 'forumax' ), |
| 43 |
'subtitle' => __( 'You can override this at the forum level', 'forumax' ), |
| 44 |
'dependency' => [ 'is_votes', '==', 'true', ] |
| 45 |
], |
| 46 |
|
| 47 |
[ |
| 48 |
'id' => 'is_voting_disabled_replies', |
| 49 |
'type' => 'switcher', |
| 50 |
'default' => 0, |
| 51 |
'title' => __( 'Voting on Replies', 'forumax' ), |
| 52 |
'subtitle' => __( 'You can override this at the forum level', 'forumax' ), |
| 53 |
'dependency' => [ 'is_votes', '==', 'true', ] |
| 54 |
], |
| 55 |
|
| 56 |
[ |
| 57 |
'id' => 'is_down_votes_disabled', |
| 58 |
'type' => 'switcher', |
| 59 |
'default' => 0, |
| 60 |
'title' => __( 'Down Votes', 'forumax' ), |
| 61 |
'subtitle' => __( 'Only Allow Up Votes', 'forumax' ), |
| 62 |
'dependency' => [ 'is_votes', '==', 'true', ] |
| 63 |
], |
| 64 |
|
| 65 |
[ |
| 66 |
'type' => 'subheading', |
| 67 |
'content' => __( 'View-Only Scores', 'forumax' ), |
| 68 |
'dependency' => [ 'is_votes', '==', 'true', ] |
| 69 |
], |
| 70 |
|
| 71 |
[ |
| 72 |
'id' => 'is_disabled_voting_for_non_logged_users', |
| 73 |
'type' => 'switcher', |
| 74 |
'default' => 0, |
| 75 |
'title' => __( 'Disable voting for visitors who are not logged in', 'forumax' ), |
| 76 |
'subtitle' => __( 'Scores will display (if configured to), but voting will be disabled if not logged in', 'forumax' ), |
| 77 |
'class' => 'st-pro-notice', |
| 78 |
'dependency' => [ 'is_votes', '==', 'true', ] |
| 79 |
], |
| 80 |
|
| 81 |
[ |
| 82 |
'id' => 'is_disabled_voting_closed_topics', |
| 83 |
'type' => 'switcher', |
| 84 |
'default' => 0, |
| 85 |
'title' => __( 'Disable adding new votes after a topic is closed', 'forumax' ), |
| 86 |
'subtitle' => __( 'Scores will display (if configured to), but new votes for the topic or the topic\'s replies will be disabled', 'forumax' ), |
| 87 |
'class' => 'st-pro-notice', |
| 88 |
'dependency' => [ 'is_votes', '==', 'true', ] |
| 89 |
], |
| 90 |
|
| 91 |
[ |
| 92 |
'id' => 'is_disabled_voting_own_topic_reply', |
| 93 |
'type' => 'switcher', |
| 94 |
'default' => 0, |
| 95 |
'title' => __( 'Don\'t allow authors to vote on their own topic/reply', 'forumax' ), |
| 96 |
'subtitle' => __( 'They can still vote on other people\'s topics/replies', 'forumax' ), |
| 97 |
'class' => 'st-pro-notice', |
| 98 |
'dependency' => [ 'is_votes', '==', 'true', ] |
| 99 |
], |
| 100 |
|
| 101 |
[ |
| 102 |
'type' => 'subheading', |
| 103 |
'content' => __( 'Admin Voting', 'forumax' ), |
| 104 |
'dependency' => [ 'is_votes', '==', 'true', ] |
| 105 |
], |
| 106 |
|
| 107 |
[ |
| 108 |
'id' => 'is_admin_can_vote_unlimited', |
| 109 |
'type' => 'switcher', |
| 110 |
'default' => 0, |
| 111 |
'title' => __( 'Allow any administrator user to vote as much as they want?', 'forumax' ), |
| 112 |
'class' => 'st-pro-notice', |
| 113 |
'dependency' => [ 'is_votes', '==', 'true', ] |
| 114 |
], |
| 115 |
|
| 116 |
[ |
| 117 |
'type' => 'subheading', |
| 118 |
'content' => __( 'Sort by Voting Scores', 'forumax' ), |
| 119 |
'dependency' => [ 'is_votes', '==', 'true', ] |
| 120 |
], |
| 121 |
|
| 122 |
[ |
| 123 |
'id' => 'is_sort_topic_by_votes', |
| 124 |
'type' => 'switcher', |
| 125 |
'default' => false, |
| 126 |
'title' => __( 'Sort topics in a forum using their voting scores?', 'forumax' ), |
| 127 |
'subtitle' => __( 'Highest voted topics on top', 'forumax' ), |
| 128 |
'class' => 'st-pro-notice', |
| 129 |
'dependency' => [ 'is_votes', '==', 'true', ] |
| 130 |
], |
| 131 |
|
| 132 |
[ |
| 133 |
'id' => 'is_sort_reply_by_votes', |
| 134 |
'type' => 'switcher', |
| 135 |
'default' => false, |
| 136 |
'title' => __( 'Sort replies on a topic using their voting scores?', 'forumax' ), |
| 137 |
'subtitle' => __( 'Highest voted replies on top', 'forumax' ), |
| 138 |
'class' => 'st-pro-notice', |
| 139 |
'dependency' => [ 'is_votes', '==', 'true', ] |
| 140 |
], |
| 141 |
|
| 142 |
[ |
| 143 |
'id' => 'is_lead_topic_broken', |
| 144 |
'type' => 'switcher', |
| 145 |
'default' => 1, |
| 146 |
'title' => __( ' Break out the lead topic to separate it from the replies', 'forumax' ), |
| 147 |
'subtitle' => __( 'Simply enabled the built-in hook, bbp_show_lead_topic. This is useful to resolve a bug when sort order is messed up when Threaded Replies are enabled.', 'forumax' ), |
| 148 |
'dependency' => [ 'is_votes', '==', 'true', ] |
| 149 |
], |
| 150 |
], |
| 151 |
] |
| 152 |
); |
| 153 |
|