assets
3 years ago
sections
4 years ago
views
3 years ago
Actions.php
4 years ago
Sequoia.php
4 years ago
optionConfig.php
4 years ago
optionConfig.php
353 lines
| 1 | <?php |
| 2 | |
| 3 | use Give\Form\Template\Options; |
| 4 | use Give\Helpers\Form\Template\Utils\Frontend as FrontendFormTemplateUtils; |
| 5 | |
| 6 | global $pagenow; |
| 7 | $formInfo = get_post(FrontendFormTemplateUtils::getFormId()); |
| 8 | |
| 9 | // Setup dynamic defaults |
| 10 | $introHeadline = ( ! $formInfo->post_title || 'post-new.php' === $pagenow) ? __( |
| 11 | 'Support Our Cause', |
| 12 | 'give' |
| 13 | ) : $formInfo->post_title; |
| 14 | |
| 15 | $introDescription = $formInfo->post_excerpt ?: esc_html__( |
| 16 | 'Help our organization by donating today! All donations go directly to making a difference for our cause.', |
| 17 | 'give' |
| 18 | ); |
| 19 | |
| 20 | |
| 21 | return [ |
| 22 | 'visual_appearance' => [ |
| 23 | 'name' => esc_html__('Visual Appearance', 'give'), |
| 24 | 'fields' => [ |
| 25 | [ |
| 26 | 'id' => 'primary_color', |
| 27 | 'name' => __('Primary Color', 'give'), |
| 28 | 'desc' => __( |
| 29 | 'The primary color is used throughout the Form Template for various elements including buttons, line breaks, and focus/hover elements. Set a color that reflects your brand or main featured image for best results.', |
| 30 | 'give' |
| 31 | ), |
| 32 | 'type' => 'colorpicker', |
| 33 | 'default' => '#28C77B', |
| 34 | ], |
| 35 | [ |
| 36 | 'name' => esc_html__('Primary Font', 'give'), |
| 37 | 'desc' => esc_html__( |
| 38 | 'The default font for this donation form uses the Montserrat Google Font. The System Font option uses the system font of a particular operating system and can boost performance but impact visual appearance.', |
| 39 | 'give' |
| 40 | ), |
| 41 | 'id' => 'google-fonts', |
| 42 | 'type' => 'radio', |
| 43 | 'options' => [ |
| 44 | 'enabled' => esc_html__('Montserrat Google Font', 'give'), |
| 45 | 'disabled' => esc_html__('User’s System Font', 'give'), |
| 46 | ], |
| 47 | 'default' => 'enabled', |
| 48 | ], |
| 49 | [ |
| 50 | 'id' => 'decimals_enabled', |
| 51 | 'name' => __('Decimal amounts', 'give'), |
| 52 | 'desc' => __( |
| 53 | 'Do you want to enable decimal amounts? When the setting is disabled, decimal values are rounded.', |
| 54 | 'give' |
| 55 | ), |
| 56 | 'type' => 'radio_inline', |
| 57 | 'default' => 'disabled', |
| 58 | 'options' => [ |
| 59 | 'disabled' => __('Disabled', 'give'), |
| 60 | 'enabled' => __('Enabled', 'give'), |
| 61 | ], |
| 62 | ], |
| 63 | ], |
| 64 | ], |
| 65 | 'introduction' => [ |
| 66 | 'name' => sprintf(__('%1$s Step 1: %2$s Introduction', 'give'), '<strong>', '</strong>'), |
| 67 | 'desc' => __('Step description goes here.', 'give'), |
| 68 | 'fields' => [ |
| 69 | [ |
| 70 | 'name' => __('Include Step One', 'give'), |
| 71 | 'desc' => __( |
| 72 | 'If enabled, a headline and description show for the first step of the donation process.', |
| 73 | 'give' |
| 74 | ), |
| 75 | 'id' => 'enabled', |
| 76 | 'type' => 'radio_inline', |
| 77 | 'options' => [ |
| 78 | 'enabled' => __('Enabled', 'give'), |
| 79 | 'disabled' => __('Disabled', 'give'), |
| 80 | ], |
| 81 | 'default' => 'enabled', |
| 82 | ], |
| 83 | [ |
| 84 | 'id' => 'headline', |
| 85 | 'name' => __('Headline', 'give'), |
| 86 | 'desc' => __( |
| 87 | 'The headline displays at the top of step one, and defaults to the Form Title. Best practice: limit the headline to fewer than 8 words.', |
| 88 | 'give' |
| 89 | ), |
| 90 | 'type' => 'text', |
| 91 | 'attributes' => [ |
| 92 | 'placeholder' => $introHeadline, |
| 93 | ], |
| 94 | 'default' => $introHeadline, |
| 95 | ], |
| 96 | [ |
| 97 | 'id' => 'description', |
| 98 | 'name' => __('Description', 'give'), |
| 99 | 'desc' => __( |
| 100 | 'The description displays below the headline, and defaults to the Donation Form\'s excerpt, if present. Best practice: limit the description to short sentences that drive the donor toward the next step.', |
| 101 | 'give' |
| 102 | ), |
| 103 | 'type' => 'textarea', |
| 104 | 'attributes' => [ |
| 105 | 'placeholder' => $introDescription, |
| 106 | ], |
| 107 | 'default' => $introDescription, |
| 108 | ], |
| 109 | [ |
| 110 | 'id' => 'image', |
| 111 | 'name' => __('Image', 'give'), |
| 112 | 'desc' => __( |
| 113 | 'Upload an eye-catching image that reflects your cause. For best results use an image in 16x9 aspect ratio at least 680x400px.', |
| 114 | 'give' |
| 115 | ), |
| 116 | 'type' => 'file', |
| 117 | ], |
| 118 | [ |
| 119 | 'id' => 'donate_label', |
| 120 | 'name' => __('Donate Button', 'give'), |
| 121 | 'desc' => __('Customize the text that appears prompting the user to go to the next step.', 'give'), |
| 122 | 'type' => 'text_medium', |
| 123 | 'attributes' => [ |
| 124 | 'placeholder' => __('Donate Now', 'give'), |
| 125 | ], |
| 126 | 'default' => __('Donate Now', 'give'), |
| 127 | ], |
| 128 | ], |
| 129 | ], |
| 130 | 'payment_amount' => [ |
| 131 | 'name' => sprintf(__('%1$s Step 2: %2$s Payment Amount', 'give'), '<strong>', '</strong>'), |
| 132 | 'desc' => __('Step description goes here.', 'give'), |
| 133 | 'fields' => [ |
| 134 | [ |
| 135 | 'id' => 'header_label', |
| 136 | 'name' => __('Header Label', 'give'), |
| 137 | 'desc' => __( |
| 138 | 'The Header Label displays at the top of this step, and is designed to focus the donor\'s attention on what this step is about. Best Practice: limit this to fewer than 4 words.', |
| 139 | 'give' |
| 140 | ), |
| 141 | 'type' => 'text', |
| 142 | 'attributes' => [ |
| 143 | 'placeholder' => __('Choose Amount', 'give'), |
| 144 | ], |
| 145 | 'default' => __('Choose Amount', 'give'), |
| 146 | ], |
| 147 | [ |
| 148 | 'id' => 'content', |
| 149 | 'name' => __('Content', 'give'), |
| 150 | 'desc' => __( |
| 151 | 'Content displays before the level amounts, and is designed to provide context for those levels. Best practice: limit this to 1-2 short sentences crafted to drive the donor to decide and to remove friction.', |
| 152 | 'give' |
| 153 | ), |
| 154 | 'type' => 'textarea', |
| 155 | 'attributes' => [ |
| 156 | 'placeholder' => sprintf( |
| 157 | __( |
| 158 | 'How much would you like to donate? As a contributor to %s we make sure your donation goes directly to supporting our cause. Thank you for your generosity!', |
| 159 | 'give' |
| 160 | ), |
| 161 | get_bloginfo('sitename') |
| 162 | ), |
| 163 | ], |
| 164 | 'default' => sprintf( |
| 165 | __( |
| 166 | 'How much would you like to donate? As a contributor to %s we make sure your donation goes directly to supporting our cause. Thank you for your generosity!', |
| 167 | 'give' |
| 168 | ), |
| 169 | get_bloginfo('sitename') |
| 170 | ), |
| 171 | ], |
| 172 | [ |
| 173 | 'id' => 'next_label', |
| 174 | 'name' => __('Continue Button', 'give'), |
| 175 | 'desc' => __('Customize the text that appears prompting the user to go to the next step.', 'give'), |
| 176 | 'type' => 'text_medium', |
| 177 | 'attributes' => [ |
| 178 | 'placeholder' => __('Continue', 'give'), |
| 179 | ], |
| 180 | 'default' => __('Continue', 'give'), |
| 181 | ], |
| 182 | ], |
| 183 | ], |
| 184 | 'payment_information' => [ |
| 185 | 'name' => sprintf(__('%1$s Step 3: %2$s Payment Information', 'give'), '<strong>', '</strong>'), |
| 186 | 'desc' => __('Step description goes here.', 'give'), |
| 187 | 'fields' => [ |
| 188 | [ |
| 189 | 'id' => 'header_label', |
| 190 | 'name' => __('Header Label', 'give'), |
| 191 | 'desc' => __( |
| 192 | 'The Header Label displays at the top of this step, and is designed to focus the donor\'s attention on what this step is about. Best Practice: limit this to fewer than 4 words.', |
| 193 | 'give' |
| 194 | ), |
| 195 | 'type' => 'text', |
| 196 | 'attributes' => [ |
| 197 | 'placeholder' => __('Add Your Information', 'give'), |
| 198 | ], |
| 199 | 'default' => __('Add Your Information', 'give'), |
| 200 | ], |
| 201 | [ |
| 202 | 'id' => 'headline', |
| 203 | 'name' => __('Headline', 'give'), |
| 204 | 'desc' => __( |
| 205 | 'The Headline introduces the section where donors provide information about themselves. Best practice: limit the headline to fewer than 5 words.', |
| 206 | 'give' |
| 207 | ), |
| 208 | 'type' => 'text', |
| 209 | 'attributes' => [ |
| 210 | 'placeholder' => __("Who's giving today?", 'give'), |
| 211 | ], |
| 212 | 'default' => __("Who's giving today?", 'give'), |
| 213 | ], |
| 214 | [ |
| 215 | 'id' => 'description', |
| 216 | 'name' => __('Description', 'give'), |
| 217 | 'desc' => __( |
| 218 | 'The description displays below the checkout step, and is designed to remove obstacles from donating. Best practice: use this section to reassure donors that they are making a wise decision.', |
| 219 | 'give' |
| 220 | ), |
| 221 | 'type' => 'textarea', |
| 222 | 'attributes' => [ |
| 223 | 'placeholder' => __('We’ll never share this information with anyone.', 'give'), |
| 224 | ], |
| 225 | 'default' => __('We’ll never share this information with anyone.', 'give'), |
| 226 | ], |
| 227 | [ |
| 228 | 'id' => 'donation_summary_enabled', |
| 229 | 'name' => __('Donation Summary', 'give'), |
| 230 | 'desc' => __('Display a summary of the donation on the Payment Information step', 'give'), |
| 231 | 'type' => 'radio_inline', |
| 232 | 'options' => [ |
| 233 | 'enabled' => __('Enabled', 'give'), |
| 234 | 'disabled' => __('Disabled', 'give'), |
| 235 | ], |
| 236 | 'default' => 'enabled', |
| 237 | ], |
| 238 | [ |
| 239 | 'id' => 'donation_summary_heading', |
| 240 | 'name' => __('Summary Heading', 'give'), |
| 241 | 'desc' => __( |
| 242 | 'This text displays above the donation summary table and is designed to help introduce the donation breakdown to the visitor. Leave blank to remove.', |
| 243 | 'give' |
| 244 | ), |
| 245 | 'type' => 'text', |
| 246 | 'default' => __('Here\'s what you\'re about to donate:', 'give'), |
| 247 | ], |
| 248 | [ |
| 249 | 'id' => 'donation_summary_location', |
| 250 | 'name' => __('Summary Location', 'give'), |
| 251 | 'desc' => __('Where should the donation summary be placed?', 'give'), |
| 252 | 'type' => 'radio_inline', |
| 253 | 'options' => [ |
| 254 | 'give_donation_form_user_info' => __('Before Payment Fields', 'give'), |
| 255 | 'give_donation_form_before_submit' => __('After Payment Fields', 'give'), |
| 256 | ], |
| 257 | 'default' => 'give_donation_form_before_submit', |
| 258 | ], |
| 259 | Options::getCheckoutLabelField(), |
| 260 | ], |
| 261 | ], |
| 262 | 'thank-you' => [ |
| 263 | 'name' => sprintf(__('%1$s Step 4: %2$s Thank You', 'give'), '<strong>', '</strong>'), |
| 264 | 'desc' => __('Step description goes here.', 'give'), |
| 265 | 'fields' => [ |
| 266 | [ |
| 267 | 'id' => 'image', |
| 268 | 'name' => __('Image', 'give'), |
| 269 | 'desc' => __( |
| 270 | 'This image appears above the main thank you content. If no image is provided, a check mark icon will appear. For best results use an image in 16x9 aspect ratio at least 680x400px.', |
| 271 | 'give' |
| 272 | ), |
| 273 | 'type' => 'file', |
| 274 | ], |
| 275 | [ |
| 276 | 'id' => 'headline', |
| 277 | 'name' => __('Headline', 'give'), |
| 278 | 'desc' => __( |
| 279 | 'This message displays in large font on the thank you screen. Best practice: short, sweet, and sincere works best.', |
| 280 | 'give' |
| 281 | ), |
| 282 | 'type' => 'text', |
| 283 | 'attributes' => [ |
| 284 | 'placeholder' => __('A great big thank you!', 'give'), |
| 285 | ], |
| 286 | 'default' => __('A great big thank you!', 'give'), |
| 287 | ], |
| 288 | [ |
| 289 | 'id' => 'description', |
| 290 | 'name' => __('Description', 'give'), |
| 291 | 'desc' => __( |
| 292 | 'The description is displayed directly below the main headline and should be 1-2 sentences. You may use <a href="http://docs.givewp.com/email-tags" target="_blank">any of the available template tags</a> within this message.', |
| 293 | 'give' |
| 294 | ), |
| 295 | 'type' => 'wysiwyg', |
| 296 | 'attributes' => [ |
| 297 | 'placeholder' => __( |
| 298 | '{name}, your contribution means a lot and will be put to good use in making a difference. We’ve sent your donation receipt to {donor_email}. ', |
| 299 | 'give' |
| 300 | ), |
| 301 | ], |
| 302 | 'default' => __( |
| 303 | '{name}, your contribution means a lot and will be put to good use in making a difference. We’ve sent your donation receipt to {donor_email}. ', |
| 304 | 'give' |
| 305 | ), |
| 306 | ], |
| 307 | [ |
| 308 | 'name' => __('Social Sharing', 'give'), |
| 309 | 'desc' => __('Enable to display links for donors to share on social media that they donated.', 'give'), |
| 310 | 'id' => 'sharing', |
| 311 | 'type' => 'radio_inline', |
| 312 | 'options' => [ |
| 313 | 'enabled' => __('Enabled', 'give'), |
| 314 | 'disabled' => __('Disabled', 'give'), |
| 315 | ], |
| 316 | 'default' => 'enabled', |
| 317 | ], |
| 318 | [ |
| 319 | 'id' => 'sharing_instruction', |
| 320 | 'name' => __('Sharing Instruction', 'give'), |
| 321 | 'desc' => __( |
| 322 | 'Sharing instructions display above the social sharing buttons. Best practice: be direct, bold, and confident here. Donors share when they are asked to.', |
| 323 | 'give' |
| 324 | ), |
| 325 | 'type' => 'text', |
| 326 | 'attributes' => [ |
| 327 | 'placeholder' => __( |
| 328 | 'Help spread the word by sharing your support with your friends and followers!', |
| 329 | 'give' |
| 330 | ), |
| 331 | ], |
| 332 | 'default' => __( |
| 333 | 'Help spread the word by sharing your support with your friends and followers!', |
| 334 | 'give' |
| 335 | ), |
| 336 | ], |
| 337 | [ |
| 338 | 'id' => 'twitter_message', |
| 339 | 'name' => __('Twitter Message', 'give'), |
| 340 | 'desc' => __( |
| 341 | 'This puts "words in the mouth" of your donor to share with their Twitter followers.', |
| 342 | 'give' |
| 343 | ), |
| 344 | 'type' => 'text', |
| 345 | 'attributes' => [ |
| 346 | 'placeholder' => __('I just gave to this cause. Who\'s next?', 'give'), |
| 347 | ], |
| 348 | 'default' => __('I just gave to this cause. Who\'s next?', 'give'), |
| 349 | ], |
| 350 | ], |
| 351 | ], |
| 352 | ]; |
| 353 |