| 1 |
<?php |
| 2 |
|
| 3 |
CSF::createSection( |
| 4 |
$prefix, |
| 5 |
[ |
| 6 |
'title' => __( 'Attachments', 'bbp-core' ), |
| 7 |
'icon' => 'dashicons dashicons-media-default', |
| 8 |
'fields' => [ |
| 9 |
[ |
| 10 |
'id' => 'is_attachment', |
| 11 |
'type' => 'switcher', |
| 12 |
'default' => true, |
| 13 |
'title' => __( 'Show attachments on topic replies.', 'bbp-core' ), |
| 14 |
], |
| 15 |
|
| 16 |
[ |
| 17 |
'id' => 'max_file_size', |
| 18 |
'type' => 'number', |
| 19 |
'title' => _x( 'Maximum File Size', 'bbp core maximum file size upload', 'bbp-core' ), |
| 20 |
'subtitle' => __( 'Input the values in Kilo Bytes (KB)', 'bbp-core' ), |
| 21 |
'default' => 512, |
| 22 |
'unit' => 'KB', |
| 23 |
'class' => 'st-pro-notice', |
| 24 |
], |
| 25 |
|
| 26 |
[ |
| 27 |
'id' => 'max_file_uploads', |
| 28 |
'type' => 'number', |
| 29 |
'title' => _x( 'Maximum number of file to upload at once', 'bbp core maximum file size upload', 'bbp-core' ), |
| 30 |
'default' => 4, |
| 31 |
'class' => 'st-pro-notice', |
| 32 |
], |
| 33 |
|
| 34 |
[ |
| 35 |
'id' => 'is_hide_attachment', |
| 36 |
'type' => 'switcher', |
| 37 |
'default' => true, |
| 38 |
'title' => __( 'Hide Attachment from visitors', 'bbp-core' ), |
| 39 |
'text_on' => __( 'Hide', 'bbp-core' ), |
| 40 |
'text_off' => __( 'Show', 'bbp-core' ), |
| 41 |
'text_width' => 85 |
| 42 |
], |
| 43 |
|
| 44 |
[ |
| 45 |
'type' => 'subheading', |
| 46 |
'content' => __( 'Who can upload files ', 'bbp-core' ), |
| 47 |
], |
| 48 |
|
| 49 |
[ |
| 50 |
'id' => 'users_can_upload', |
| 51 |
'type' => 'checkbox', |
| 52 |
'title' => __( 'Users who can upload attachments.', 'bbp-core' ), |
| 53 |
'options' => [ |
| 54 |
'keymaster' => __( 'Keymaster', 'bbp-core' ), |
| 55 |
'moderator' => __( 'Moderator', 'bbp-core' ), |
| 56 |
'participant' => __( 'Participant', 'bbp-core' ), |
| 57 |
'spectator' => __( 'Spectator', 'bbp-core' ), |
| 58 |
'blocked' => __( 'Blocked', 'bbp-core' ), |
| 59 |
], |
| 60 |
'default' => [ 'keymaster', 'moderator', 'participant', 'spectator', 'blocked' ], |
| 61 |
], |
| 62 |
|
| 63 |
[ |
| 64 |
'type' => 'subheading', |
| 65 |
'content' => __( 'When an associated Topic or Reply has been deleted', 'bbp-core' ), |
| 66 |
], |
| 67 |
|
| 68 |
[ |
| 69 |
'id' => 'is_attachment_deletion', |
| 70 |
'type' => 'switcher', |
| 71 |
'default' => false, |
| 72 |
'title' => __( 'Delete the attachment along with forum/topic.', 'bbp-core' ), |
| 73 |
'class' => 'st-pro-notice', |
| 74 |
], |
| 75 |
|
| 76 |
[ |
| 77 |
'type' => 'subheading', |
| 78 |
'content' => __( 'Forums integration', 'bbp-core' ), |
| 79 |
], |
| 80 |
|
| 81 |
[ |
| 82 |
'type' => 'content', |
| 83 |
'content' => __( 'With these options you can modify the forums to include attachment elements.', 'bbp-core' ), |
| 84 |
], |
| 85 |
|
| 86 |
[ |
| 87 |
'id' => 'is_attachment_icon', |
| 88 |
'type' => 'switcher', |
| 89 |
'title' => __( 'Attachment Icon', 'bbp-core' ), |
| 90 |
'default' => true, |
| 91 |
], |
| 92 |
|
| 93 |
[ |
| 94 |
'id' => 'is_file_type_icon', |
| 95 |
'type' => 'switcher', |
| 96 |
'title' => __( 'File type Icons', 'bbp-core' ), |
| 97 |
'default' => true, |
| 98 |
], |
| 99 |
|
| 100 |
[ |
| 101 |
'type' => 'subheading', |
| 102 |
'content' => __( 'Display of image attachments', 'bbp-core' ), |
| 103 |
], |
| 104 |
|
| 105 |
[ |
| 106 |
'type' => 'content', |
| 107 |
'content' => __( 'Attached images can be displayed as thumbnails, and from here you can control this.', 'bbp-core' ), |
| 108 |
], |
| 109 |
|
| 110 |
[ |
| 111 |
'id' => 'image_thumbnail_caption', |
| 112 |
'type' => 'switcher', |
| 113 |
'title' => __( 'With Caption', 'bbp-core' ), |
| 114 |
'default' => true, |
| 115 |
], |
| 116 |
|
| 117 |
[ |
| 118 |
'id' => 'image_link_type', |
| 119 |
'type' => 'select', |
| 120 |
'title' => __( 'Image Link Type', 'bbp-core' ), |
| 121 |
'options' => [ |
| 122 |
'download' => __( 'Download', 'bbp-core' ), |
| 123 |
'lightbox' => __( 'Lightbox', 'bbp-core' ), |
| 124 |
], |
| 125 |
'default' => 'download', |
| 126 |
'class' => 'st-pro-notice', |
| 127 |
'chosen' => true |
| 128 |
], |
| 129 |
|
| 130 |
[ |
| 131 |
'type' => 'subheading', |
| 132 |
'content' => __( 'Image thumbnails size', 'bbp-core' ), |
| 133 |
], |
| 134 |
|
| 135 |
[ |
| 136 |
'type' => 'content', |
| 137 |
'content' => __( 'Changing thumbnails size affects only new image attachments. To use new size for old attachments, resize them using Regenerate Thumbnails plugin.', 'bbp-core' ), |
| 138 |
], |
| 139 |
|
| 140 |
[ |
| 141 |
'id' => 'attachment_image_x', |
| 142 |
'type' => 'number', |
| 143 |
'title' => __( 'Thumbnail width', 'bbp-core' ), |
| 144 |
'unit' => 'px', |
| 145 |
], |
| 146 |
|
| 147 |
[ |
| 148 |
'id' => 'attachment_image_y', |
| 149 |
'type' => 'number', |
| 150 |
'title' => __( 'Thumbnail height', 'bbp-core' ), |
| 151 |
'unit' => 'px', |
| 152 |
], |
| 153 |
], |
| 154 |
] |
| 155 |
); |
| 156 |
|