Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue/1309 #1312

Merged
merged 1 commit into from
Dec 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 74 additions & 74 deletions includes/admin/forms/class-metabox-form-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,80 +232,6 @@ function get_settings() {
),
) ),

/**
* Donation Goals
*/
'donation_goal_options' => apply_filters( 'give_donation_goal_options', array(
'id' => 'donation_goal_options',
'title' => esc_html__( 'Donation Goal', 'give' ),
'fields' => apply_filters( 'give_forms_donation_goal_metabox_fields', array(
// Goals
array(
'name' => esc_html__( 'Donation Goal', 'give' ),
'description' => esc_html__( 'Do you want to set a donation goal for this form?', 'give' ),
'id' => $prefix . 'goal_option',
'type' => 'radio_inline',
'default' => 'disabled',
'options' => array(
'enabled' => esc_html__( 'Enabled', 'give' ),
'disabled' => esc_html__( 'Disabled', 'give' ),
),
),
array(
'name' => esc_html__( 'Goal Amount', 'give' ),
'description' => esc_html__( 'This is the monetary goal amount you want to reach for this form.', 'give' ),
'id' => $prefix . 'set_goal',
'type' => 'text_small',
'data_type' => 'price',
'attributes' => array(
'placeholder' => give_format_decimal( '0.00' ),
'value' => give_format_decimal( $goal ),
'class' => 'give-money-field',
),
),

array(
'name' => esc_html__( 'Goal Format', 'give' ),
'description' => esc_html__( 'Do you want to display the total amount raised based on your monetary goal or a percentage? For instance, "$500 of $1,000 raised" or "50% funded".', 'give' ),
'id' => $prefix . 'goal_format',
'type' => 'radio_inline',
'default' => 'amount',
'options' => array(
'amount' => esc_html__( 'Amount', 'give' ),
'percentage' => esc_html__( 'Percentage', 'give' ),
),
),
array(
'name' => esc_html__( 'Progress Bar Color', 'give' ),
'desc' => esc_html__( 'Customize the color of the goal progress bar.', 'give' ),
'id' => $prefix . 'goal_color',
'type' => 'colorpicker',
'default' => '#2bc253',
),

array(
'name' => esc_html__( 'Close Form', 'give' ),
'desc' => esc_html__( 'Do you want to close the donation forms and stop accepting donations once this goal has been met?', 'give' ),
'id' => $prefix . 'close_form_when_goal_achieved',
'type' => 'radio_inline',
'default' => 'disabled',
'options' => array(
'enabled' => esc_html__( 'Enabled', 'give' ),
'disabled' => esc_html__( 'Disabled', 'give' ),
),
),
array(
'name' => esc_html__( 'Goal Achieved Message', 'give' ),
'desc' => esc_html__( 'Do you want to display a custom message when the goal is closed? If none is provided the default message will be displayed', 'give' ),
'id' => $prefix . 'form_goal_achieved_message',
'type' => 'textarea',
'attributes' => array(
'placeholder' => esc_attr__( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ),
),
),
) ),
) ),

/**
* Display Options
*/
Expand Down Expand Up @@ -392,6 +318,80 @@ function get_settings() {
)
),

/**
* Donation Goals
*/
'donation_goal_options' => apply_filters( 'give_donation_goal_options', array(
'id' => 'donation_goal_options',
'title' => esc_html__( 'Donation Goal', 'give' ),
'fields' => apply_filters( 'give_forms_donation_goal_metabox_fields', array(
// Goals
array(
'name' => esc_html__( 'Donation Goal', 'give' ),
'description' => esc_html__( 'Do you want to set a donation goal for this form?', 'give' ),
'id' => $prefix . 'goal_option',
'type' => 'radio_inline',
'default' => 'disabled',
'options' => array(
'enabled' => esc_html__( 'Enabled', 'give' ),
'disabled' => esc_html__( 'Disabled', 'give' ),
),
),
array(
'name' => esc_html__( 'Goal Amount', 'give' ),
'description' => esc_html__( 'This is the monetary goal amount you want to reach for this form.', 'give' ),
'id' => $prefix . 'set_goal',
'type' => 'text_small',
'data_type' => 'price',
'attributes' => array(
'placeholder' => give_format_decimal( '0.00' ),
'value' => give_format_decimal( $goal ),
'class' => 'give-money-field',
),
),

array(
'name' => esc_html__( 'Goal Format', 'give' ),
'description' => esc_html__( 'Do you want to display the total amount raised based on your monetary goal or a percentage? For instance, "$500 of $1,000 raised" or "50% funded".', 'give' ),
'id' => $prefix . 'goal_format',
'type' => 'radio_inline',
'default' => 'amount',
'options' => array(
'amount' => esc_html__( 'Amount', 'give' ),
'percentage' => esc_html__( 'Percentage', 'give' ),
),
),
array(
'name' => esc_html__( 'Progress Bar Color', 'give' ),
'desc' => esc_html__( 'Customize the color of the goal progress bar.', 'give' ),
'id' => $prefix . 'goal_color',
'type' => 'colorpicker',
'default' => '#2bc253',
),

array(
'name' => esc_html__( 'Close Form', 'give' ),
'desc' => esc_html__( 'Do you want to close the donation forms and stop accepting donations once this goal has been met?', 'give' ),
'id' => $prefix . 'close_form_when_goal_achieved',
'type' => 'radio_inline',
'default' => 'disabled',
'options' => array(
'enabled' => esc_html__( 'Enabled', 'give' ),
'disabled' => esc_html__( 'Disabled', 'give' ),
),
),
array(
'name' => esc_html__( 'Goal Achieved Message', 'give' ),
'desc' => esc_html__( 'Do you want to display a custom message when the goal is closed? If none is provided the default message will be displayed', 'give' ),
'id' => $prefix . 'form_goal_achieved_message',
'type' => 'textarea',
'attributes' => array(
'placeholder' => esc_attr__( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ),
),
),
) ),
) ),

/**
* Content Field
*/
Expand Down