/** * Admin configuration form */ public static function admin_config_form() { $html = ''; $html .= '<tr>'; $html .= ' <td class="wpsc_CC_details">'; $html .= ' ' . __('Configuration', 'pronamic_ideal'); $html .= ' </td>'; $html .= ' <td>'; $html .= Pronamic_WP_Pay_Admin::dropdown_configs(array('name' => Pronamic_WP_Pay_Extensions_WPeCommerce_Extension::OPTION_IDEAL_CONFIG_ID, 'echo' => false)); $html .= ' </td>'; $html .= '</tr>'; return $html; }
/** * Admin configuration form */ public static function admin_config_form() { $html = ''; $html .= '<tr>'; $html .= ' <td class="wpsc_CC_details">'; $html .= ' ' . __('Configuration', 'pronamic_ideal'); $html .= ' </td>'; $html .= ' <td>'; $html .= Pronamic_WP_Pay_Admin::dropdown_configs(array('name' => Pronamic_WP_Pay_Extensions_WPeCommerce_Extension::OPTION_PRONAMIC_CONFIG_ID, 'echo' => false)); $html .= ' </td>'; $html .= '</tr>'; $config_id = get_option(Pronamic_WP_Pay_Extensions_WPeCommerce_Extension::OPTION_PRONAMIC_CONFIG_ID); $gateway = Pronamic_WP_Pay_Plugin::get_gateway($config_id); if ($gateway) { $payment_method_field = $gateway->get_payment_method_field(); if ($payment_method_field) { $choices = $payment_method_field['choices']; $name = Pronamic_WP_Pay_Extensions_WPeCommerce_Extension::OPTION_PRONAMIC_PAYMENT_METHOD; $payment_method = get_option($name); $options = Pronamic_WP_HTML_Helper::select_options_grouped($choices, $payment_method); // Double quotes are not working, se we replace them with an single quote $options = str_replace('"', '\'', $options); $html .= '<tr>'; $html .= ' <td class="wpsc_CC_details">'; $html .= ' ' . __('Payment Method', 'pronamic_ideal'); $html .= ' </td>'; $html .= ' <td>'; $html .= sprintf("<select name='%s' id='%s'>", $name, $name); $html .= sprintf('%s', $options); $html .= sprintf('</select>'); $html .= ' </td>'; $html .= '</tr>'; } } return $html; }
/** * Display settings * * @see https://github.com/eventespresso/event-espresso-core/blob/4.2.2.reg/core/db_classes/EE_Gateway.class.php#L85 */ protected function _display_settings() { ?> <tr> <th> <label><?php _e('Configuration', 'pronamic_ideal'); ?> </label> </th> <td> <?php echo Pronamic_WP_Pay_Admin::dropdown_configs(array('name' => 'config_id', 'selected' => $this->_payment_settings['config_id'])); ?> </td> </tr> <?php }
wp_nonce_field('pronamic_pay_save_form_options', 'pronamic_pay_nonce'); ?> <table class="form-table"> <tr> <th scope="row"> <label for="_pronamic_payment_form_config_id"> <?php esc_html_e('Gateway', 'pronamic_ideal'); ?> </label> </th> <td> <?php $config_id = get_post_meta($post->ID, '_pronamic_payment_form_config_id', true); Pronamic_WP_Pay_Admin::dropdown_configs(array('name' => '_pronamic_payment_form_config_id', 'selected' => $config_id)); ?> </td> </tr> <tr> <th scope="row"> <label for="_pronamic_payment_form_button_text"> <?php esc_html_e('Button Text', 'pronamic_ideal'); ?> </label> </th> <td> <?php $button_text = get_post_meta($post->ID, '_pronamic_payment_form_button_text', true); ?>
/** * Display gateway settings */ public static function display_gateway_settings() { global $espresso_premium, $active_gateways; // Handle request if (isset($_REQUEST['activate_pronamic_ideal'])) { $active_gateways['pronamic_ideal'] = dirname(__FILE__); update_option('event_espresso_active_gateways', $active_gateways); } if (isset($_REQUEST['deactivate_pronamic_ideal'])) { unset($active_gateways['pronamic_ideal']); update_option('event_espresso_active_gateways', $active_gateways); } // Config $config_id = get_option(self::OPTION_CONFIG_ID); if (filter_has_var(INPUT_POST, self::OPTION_CONFIG_ID)) { $config_id = filter_input(INPUT_POST, self::OPTION_CONFIG_ID, FILTER_VALIDATE_INT); update_option(self::OPTION_CONFIG_ID, $config_id); } // Active $is_active = array_key_exists('pronamic_ideal', $active_gateways); // Postbox style $postbox_style = ''; if (!$is_active) { $postbox_style = 'closed'; } // URL $url = add_query_arg('page', 'payment_gateways', admin_url('admin.php')); ?> <div class="metabox-holder"> <div class="postbox <?php echo $postbox_style; ?> "> <div title="<?php esc_attr_e('Click to toggle', 'pronamic_ideal'); ?> " class="handlediv"><br /></div> <h3 class="hndle"> <?php _e('Pronamic iDEAL', 'pronamic_ideal'); ?> </h3> <div class="inside"> <div class="padding"> <ul> <?php if ($is_active) { ?> <li class="red_alert pointer" onclick="location.href='<?php echo add_query_arg('deactivate_pronamic_ideal', true, $url); ?> ';" style="width:30%;"> <strong><?php _e('Deactivate Pronamic iDEAL?', 'pronamic_ideal'); ?> </strong> </li> <form method="post" action=""> <table width="99%" border="0" cellspacing="5" cellpadding="5"> <tr> <td valign="top"> <ul> <li> <label for="pronamic_pay_ideal_event_espresso_config_id"> <?php _e('Configuration', 'pronamic_ideal'); ?> </label> <br /> <?php Pronamic_WP_Pay_Admin::dropdown_configs(array('name' => self::OPTION_CONFIG_ID, 'selected' => $config_id)); ?> <br /> </li> </ul> </td> </tr> </table> <?php submit_button(__('Update Settings', 'pronamic_ideal')); ?> </form> <?php } else { ?> <li class="green_alert pointer" onclick="location.href='<?php echo add_query_arg('activate_pronamic_ideal', true, $url); ?> ';" style="width:30%;"> <strong><?php _e('Activate Pronamic iDEAL?', 'pronamic_ideal'); ?> </strong> </li> <?php } ?> </ul> </div> </div> </div> </div> <?php }
global $eshop_metabox_plugin, $eshopoptions; ?> <fieldset> <?php $eshop_metabox_plugin->show_img('pronamic_ideal'); ?> <p class="cbox"> <input id="eshop_method_pronamic_ideal" name="eshop_method[]" type="checkbox" value="pronamic_ideal" <?php checked(in_array('pronamic_ideal', (array) $eshopoptions['method'])); ?> /> <label for="eshop_method_pronamic_ideal" class="eshopmethod"> <?php esc_html_e('Accept payment by iDEAL', 'pronamic_ideal'); ?> </label> </p> <label for="eshop_pronamic_ideal_config_id"> <?php esc_html_e('Configuration', 'pronamic_ideal'); ?> </label> <?php Pronamic_WP_Pay_Admin::dropdown_configs(array('name' => 'eshop_pronamic_ideal_config_id', 'selected' => @$eshopoptions['pronamic_ideal']['config_id'])); ?> </fieldset>
/** * Page settings * * @return boolean */ public function page_settings() { return Pronamic_WP_Pay_Admin::render_view('membership/settings'); }