| 1 |
<?php |
| 2 |
add_filter( 'wpas_plugin_settings', 'wpas_core_settings_advanced', 95, 1 ); |
| 3 |
/** |
| 4 |
* Add plugin advanced settings. |
| 5 |
* |
| 6 |
* @param (array) $def Array of existing settings |
| 7 |
* @return (array) Updated settings |
| 8 |
*/ |
| 9 |
function wpas_core_settings_advanced( $def ) { |
| 10 |
|
| 11 |
// translators: %s is the link to the guide. |
| 12 |
$desc = __( 'Only use this option if you know how to create your own registration page, otherwise you might create an infinite redirect. If you need help on creating a registration page you should <a href="%s" target="_blank">start by reading this guide</a>.', 'awesome-support' ); |
| 13 |
|
| 14 |
// translators: %s is the link to the Awesome Support SAAS Importer. |
| 15 |
$desc1 = __( 'If you use the <a href="%s" target="_blank">Awesome Support SAAS Importer</a> to import data from Zendesk, Helpscout or Ticksy, there is a reference field that contains the original ticket ID. The options below control what to do with that field. ' , 'awesome-support' ); |
| 16 |
|
| 17 |
$settings = array( |
| 18 |
'advanced' => array( |
| 19 |
'name' => __( 'Advanced', 'awesome-support' ), |
| 20 |
'options' => array( |
| 21 |
array( |
| 22 |
'name' => __( 'Custom Login / Registration Page', 'awesome-support' ), |
| 23 |
'id' => 'login_page', |
| 24 |
'type' => 'select', |
| 25 |
'desc' => sprintf( $desc, esc_url( 'http://codex.wordpress.org/Customizing_the_Registration_Form' ) ), |
| 26 |
'default' => '', |
| 27 |
'options' => wpas_list_pages() |
| 28 |
), |
| 29 |
array( |
| 30 |
'name' => __( 'Admins See All', 'awesome-support' ), |
| 31 |
'id' => 'admin_see_all', |
| 32 |
'type' => 'checkbox', |
| 33 |
'desc' => __( 'Administrators can see all tickets in the tickets list. If unchecked admins will only see tickets assigned to them.', 'awesome-support' ), |
| 34 |
'default' => true |
| 35 |
), |
| 36 |
array( |
| 37 |
'name' => __( 'Agent See All', 'awesome-support' ), |
| 38 |
'id' => 'agent_see_all', |
| 39 |
'type' => 'checkbox', |
| 40 |
'desc' => __( 'Agents can see all tickets in the tickets list. If unchecked agents will only see tickets assigned to them.', 'awesome-support' ), |
| 41 |
'default' => false |
| 42 |
), |
| 43 |
array( |
| 44 |
'name' => __( 'Ticket Topic Slug', 'awesome-support' ), |
| 45 |
'id' => 'ticket_topic_slug', |
| 46 |
'type' => 'radio', |
| 47 |
'desc' => __( 'What to use for the indivdual ticket slug. The default is the ticket topic transformed into a slug.', 'awesome-support' ), |
| 48 |
'options' => array( 'default' => __( 'Default', 'awesome-support' ), 'ticketid' => __( 'Ticket ID', 'awesome-support' ), 'randomnumber' => __( 'Random Number', 'awesome-support' ), 'guid' => __( 'GUID', 'awesome-support' ) ), |
| 49 |
'default' => 'ASC' |
| 50 |
), |
| 51 |
|
| 52 |
array( |
| 53 |
'name' => __( 'Importer Integration', 'awesome-support' ), |
| 54 |
'type' => 'heading', |
| 55 |
'desc' => sprintf( $desc1, esc_url( 'https://getawesomesupport.com/addons/awesome-support-importer/' ) ), |
| 56 |
), |
| 57 |
array( |
| 58 |
'name' => __( 'Enable the Original Ticket ID Field?', 'awesome-support' ), |
| 59 |
'id' => 'importer_id_enable', |
| 60 |
'type' => 'checkbox', |
| 61 |
'desc' => __( 'Show this field in the admin screen?', 'awesome-support' ), |
| 62 |
'default' => false, |
| 63 |
), |
| 64 |
array( |
| 65 |
'name' => __( 'Show Original Ticket ID In Column List?', 'awesome-support' ), |
| 66 |
'id' => 'importer_id_show_in_tkt_list', |
| 67 |
'type' => 'checkbox', |
| 68 |
'desc' => __( 'Would you like to show the Original Ticket ID field in the ticket listing?', 'awesome-support' ), |
| 69 |
'default' => false, |
| 70 |
), |
| 71 |
array( |
| 72 |
'name' => __( 'Label', 'awesome-support' ), |
| 73 |
'id' => 'importer_id_label', |
| 74 |
'type' => 'text', |
| 75 |
'desc' => __( 'What should the field be named on the screen?', 'awesome-support' ), |
| 76 |
'default' => 'Help Desk SaaS Ticket ID', |
| 77 |
), |
| 78 |
|
| 79 |
|
| 80 |
array( |
| 81 |
'name' => __( 'Attachment Overrides', 'awesome-support' ), |
| 82 |
'type' => 'heading', |
| 83 |
'desc' => __('Modifications to this section has major security implications so be careful!','awesome-support' ), |
| 84 |
), |
| 85 |
array( |
| 86 |
'name' => __( 'Do Not Mask Attachment Links', 'awesome-support' ), |
| 87 |
'id' => 'unmask_attachment_links', |
| 88 |
'type' => 'checkbox', |
| 89 |
'desc' => __( 'There are some server configurations that do not work with our masked links. Try checking this box to make them work. This only works on NEW tickets. Old tickets retain their prior links!', 'awesome-support' ), |
| 90 |
'default' => false |
| 91 |
), |
| 92 |
array( |
| 93 |
'name' => __( 'Render Method', 'awesome-support' ), |
| 94 |
'id' => 'attachment_render_method', |
| 95 |
'type' => 'radio', |
| 96 |
'desc' => __( 'How should the attachment be rendered when attachments are using masked links? In-line will try to show attachments in the browser. Download will always download the attachment, regardless of what type it is.', 'awesome-support' ), |
| 97 |
'default' => 'inline', |
| 98 |
'options' => array( |
| 99 |
'inline' => __( 'Inline', 'awesome-support' ), |
| 100 |
'attachment' => __( 'Download', 'awesome-support' ), |
| 101 |
), |
| 102 |
), |
| 103 |
|
| 104 |
array( |
| 105 |
'name' => __( '.htaccess Contents', 'awesome-support' ), |
| 106 |
'id' => 'htaccess_contents_for_attachment_folders', |
| 107 |
'type' => 'textarea', |
| 108 |
'desc' => __( 'The contents of your ticket uploads folder can be protected by an htaccess file on apache servers. <br />If this is left empty then the value of <b>options -Indexes</b> is automatically added to the file to prevent others from browsing the directory. <br />Add to this only if you are a super-duper apache server expert! <br /> No technical support is available for modifications to this setting!', 'awesome-support' ) |
| 109 |
), |
| 110 |
|
| 111 |
array( |
| 112 |
'name' => __( 'Compatibility', 'awesome-support' ), |
| 113 |
'type' => 'heading', |
| 114 |
'desc' => __('Settings in this section might help with compatibility with certain themes and plugins - please experiment to see if one of these settings work for you before contacting our support center. NOTE: Changing ANYTHING in this section will require ALL CACHES to be flushed including CDNs, BROWSER CACHES. Also, its possible that you would need a restart of the PHP service or your WEB SERVER in order to become fully activated!', 'awesome-support' ), |
| 115 |
), |
| 116 |
|
| 117 |
array( |
| 118 |
'name' => __( 'Select2 Version', 'awesome-support' ), |
| 119 |
'id' => 'select2_version', |
| 120 |
'type' => 'radio', |
| 121 |
'desc' => __( 'Which version of the select2 library should we load?', 'awesome-support' ), |
| 122 |
'options' => array( 'select2-4-0-5' => __( '4.0.5', 'awesome-support' ), 'select2-4-0-4' => __( '4.0.4', 'awesome-support' ), 'select2-4-0-3' => __( '4.0.3', 'awesome-support' ), 'select2-4-0-2' => __( '4.0.2', 'awesome-support' ) ), |
| 123 |
'default' => 'select2-4-0-5' |
| 124 |
), |
| 125 |
|
| 126 |
array( |
| 127 |
'name' => __( 'Select2 JS File', 'awesome-support' ), |
| 128 |
'id' => 'select2_js_file', |
| 129 |
'type' => 'radio', |
| 130 |
'desc' => __( 'Which select2 file should be loaded? Minimized version of files will load faster but cannot be used for debugging.', 'awesome-support' ), |
| 131 |
'options' => array( 'full' => __( 'Full', 'awesome-support' ), 'full-min' => __( 'Full - Minimized', 'awesome-support' ), 'partial' => __( 'Partial', 'awesome-support' ), 'partial-min' => __( 'Partial Minimized', 'awesome-support' ) ), |
| 132 |
'default' => 'partial-min' |
| 133 |
), |
| 134 |
|
| 135 |
array( |
| 136 |
'name' => __( 'Select2 CSS File', 'awesome-support' ), |
| 137 |
'id' => 'select2_css_file', |
| 138 |
'type' => 'radio', |
| 139 |
'desc' => __( 'Which select2 css file should be loaded? Minimized version of files will load faster but cannot be used for debugging.', 'awesome-support' ), |
| 140 |
'options' => array( 'min' => __( 'Minimized', 'awesome-support' ), 'full' => __( 'Full', 'awesome-support' ) ), |
| 141 |
'default' => 'min' |
| 142 |
), |
| 143 |
|
| 144 |
array( |
| 145 |
'name' => __( 'Bootstrap Support (Experimental)', 'awesome-support' ), |
| 146 |
'type' => 'heading', |
| 147 |
'desc' => __('Options for loading bootstrap files. While you can enable this now please be aware that not all elements in the plugin renders properly.', 'awesome-support' ), |
| 148 |
), |
| 149 |
array( |
| 150 |
'name' => __( 'Load BootStrap Files on Front-end?', 'awesome-support' ), |
| 151 |
'id' => 'load_bs4_files_fe', |
| 152 |
'type' => 'radio', |
| 153 |
'options' => array( '0' => __( 'Do not load bootstrap files', 'awesome-support' ), '1' => __( 'Load bootstrap 4 files located on maxcdn', 'awesome-support'), '2' => __( 'Load bootstrap 3 files located on maxcdn', 'awesome-support' ) ), |
| 154 |
'default' => '0' |
| 155 |
), |
| 156 |
array( |
| 157 |
'name' => __( 'Load BootStrap Files on Back-end?', 'awesome-support' ), |
| 158 |
'id' => 'load_bs4_files_be', |
| 159 |
'type' => 'radio', |
| 160 |
'options' => array( '0' => __( 'Do not load bootstrap files', 'awesome-support' ), '1' => __( 'Load bootstrap 4 files located on maxcdn', 'awesome-support'), '2' => __( 'Load bootstrap 3 files located on maxcdn', 'awesome-support' ) ), |
| 161 |
'default' => '0' |
| 162 |
), |
| 163 |
|
| 164 |
array( |
| 165 |
'name' => __( 'Bootstrap 4 Theme', 'awesome-support' ), |
| 166 |
'id' => 'bs4_theme', |
| 167 |
'type' => 'select', |
| 168 |
'options' => array( 'default' => __( 'Default', 'awesome-support' ), |
| 169 |
'awesome'=> __( 'Future Awesome Support BS4 Theme', 'awesome-support' ), |
| 170 |
'cerulean' => __( 'Cerulean', 'awesome-support' ), |
| 171 |
'cosmo' => __( 'Cosmo', 'awesome-support' ), |
| 172 |
'cyborg' => __( 'Cyborg', 'awesome-support' ), |
| 173 |
'darkly' => __( 'Darkly', 'awesome-support' ), |
| 174 |
'flatly' => __( 'Flatly', 'awesome-support'), |
| 175 |
'journal' => __( 'Journal', 'awesome-support'), |
| 176 |
'litera' => __( 'Litera', 'awesome-support'), |
| 177 |
'lumen' => __( 'Lumen', 'awesome-support'), |
| 178 |
'lux' => __( 'Lux', 'awesome-support'), |
| 179 |
'materia' => __( 'Materia', 'awesome-support'), |
| 180 |
'minty' => __( 'Minty', 'awesome-support'), |
| 181 |
'pulse' => __( 'Pulse', 'awesome-support' ), |
| 182 |
'sandstone' => __( 'Sandstone', 'awesome-support' ), |
| 183 |
'simplex' => __( 'Simplex', 'awesome-support' ), |
| 184 |
'slate' => __( 'Slate', 'awesome-support' ), |
| 185 |
'solar' => __( 'Solar', 'awesome-support' ), |
| 186 |
'spacelab' => __( 'spacelab', 'awesome-support' ), |
| 187 |
'united' => __( 'United', 'awesome-support' ), |
| 188 |
'yeti' => __( 'Yeti', 'awesome-support' ), |
| 189 |
'custom' => __( 'Custom theme', 'awesome-support' ), |
| 190 |
), |
| 191 |
'default' => 'default' |
| 192 |
), |
| 193 |
|
| 194 |
array( |
| 195 |
'name' => __( 'Sessions and Cookie Management', 'awesome-support' ), |
| 196 |
'type' => 'heading', |
| 197 |
), |
| 198 |
array( |
| 199 |
'name' => __( 'Secure Cookies', 'awesome-support' ), |
| 200 |
'id' => 'secure_cookies', |
| 201 |
'type' => 'checkbox', |
| 202 |
'default' => false |
| 203 |
), |
| 204 |
array( |
| 205 |
'name' => __( 'HTTP Only', 'awesome-support' ), |
| 206 |
'id' => 'cookie_http_only', |
| 207 |
'type' => 'checkbox', |
| 208 |
'default' => false |
| 209 |
), |
| 210 |
array( |
| 211 |
'name' => __( 'Expired Sessions Cleanup Batch Size', 'awesome-support' ), |
| 212 |
'id' => 'session_delete_batch_size', |
| 213 |
'type' => 'number', |
| 214 |
'default' => 1000, |
| 215 |
'min' => 1000, |
| 216 |
'max' => 100000, |
| 217 |
), |
| 218 |
|
| 219 |
array( |
| 220 |
'name' => __( 'Log Files', 'awesome-support' ), |
| 221 |
'type' => 'heading', |
| 222 |
'desc' => __( 'Awesome Support creates log files for certain events. These are different from WordPress, PHP and your webserver log files. Please tell us where you would like these files to be placed.', 'awesome-support' ), |
| 223 |
), |
| 224 |
|
| 225 |
array( |
| 226 |
'name' => __( 'Where Should Log Files Be Stored?', 'awesome-support' ), |
| 227 |
'id' => 'log_file_location', |
| 228 |
'type' => 'radio', |
| 229 |
'options' => array( '0' => __( 'Default', 'awesome-support' ), '1' => __( 'WordPress Uploads Folder', 'awesome-support'), '2' => __( 'In The Absolute Path Specified Below', 'awesome-support') ), |
| 230 |
'default' => '0' |
| 231 |
), |
| 232 |
array( |
| 233 |
'name' => __( 'None Of The Above - Place Log Files Here ', 'awesome-support' ), |
| 234 |
'id' => 'log_file_location_absolute', |
| 235 |
'type' => 'text', |
| 236 |
'desc' => __( 'The absolute path to the log file location. This must be relative to the server user account and must NOT end in a forward slash!', 'awesome-support' ) |
| 237 |
), |
| 238 |
|
| 239 |
array( |
| 240 |
'name' => __( 'Danger Zone', 'awesome-support' ), |
| 241 |
'type' => 'heading', |
| 242 |
), |
| 243 |
array( |
| 244 |
'name' => __( 'Delete Data', 'awesome-support' ), |
| 245 |
'id' => 'delete_data', |
| 246 |
'type' => 'checkbox', |
| 247 |
'default' => false, |
| 248 |
'desc' => __( 'Delete ALL plugin data on uninstall? This cannot be undone.', 'awesome-support' ) |
| 249 |
), |
| 250 |
) |
| 251 |
), |
| 252 |
); |
| 253 |
|
| 254 |
return array_merge( $def, apply_filters('wpas_settings_advanced', $settings ) ); |
| 255 |
|
| 256 |
} |