示例#1
0
        public static function render_child($child, $callback_parent = 'ProSites_Helper_Tabs', $settings_header = array(), $options = array(), $persistent = array())
        {
            // Get options
            $defaults = array('header_save_button' => false, 'section_save_button' => false, 'nonce_name' => null, 'button_name' => null);
            $options = wp_parse_args($options, $defaults);
            extract($options);
            // Create $settings_header if not exist
            if (empty($settings_header)) {
                $settings_header = array('title' => __('This title needs a new name.', 'psts'), 'desc' => __('Pass it as argument 2 in render()', 'psts'));
            }
            // Note: IDE error, but it will be created from extract() function.
            if (!isset($settings_header['page_header']) || !$settings_header['page_header']) {
                $settings_header['header_save_button'] = $header_save_button;
            }
            $settings_header['button_name'] = $button_name;
            $tabs = call_user_func(array($child, 'get_tabs'));
            // Render tabbed interface.
            ?>
			<div class="psts-wrap wrap">
				<?php 
            if (!empty($nonce_name)) {
                $nonce_name = sanitize_text_field($nonce_name);
                wp_nonce_field($nonce_name);
            }
            ProSites_Helper_Settings::settings_header($settings_header);
            reset($tabs);
            // If the first key has already been used
            $active_tab = sanitize_html_class(@$_GET['tab'], key($tabs));
            self::vertical_tabs($tabs, $active_tab, $persistent);
            // Call the appropriate form to render.
            $callback_name = 'render_tab_' . str_replace('-', '_', $active_tab);
            if (method_exists($callback_parent, $callback_name)) {
                $render_callback = array($callback_parent, $callback_name);
            } else {
                $render_callback = array(get_class(), 'render_generic_tab');
            }
            //				$render_callback = apply_filters(
            //					'prosites_settings_tabs_render_callback',
            //					$render_callback,
            //					$active_tab,
            //					'ProSites_Helper_Tabs_Settings'
            //				);
            ?>
				<div class="psts-settings">
					<?php 
            //echo $callback_parent . '::' . $callback_name;
            $html = call_user_func($render_callback);
            if (!empty($section_save_button) && !empty($button_name)) {
                $html .= '<hr />
							<p class="section-save-button">
								<input type="submit" name="submit_' . esc_attr($button_name) . '_section" class="button-primary" value="' . esc_attr(__('Save Changes', 'psts')) . '"/>
							</p>';
            }
            $html = apply_filters('prosites_settings_tab_content_' . $callback_name, $html);
            echo $html;
            ?>
				</div>
			</div>
			<?php 
        }
示例#2
0
function affiliate_supporter_settings()
{
    global $psts;
    if (function_exists('get_site_option')) {
        $getoption = 'get_site_option';
    } else {
        $getoption = 'get_option';
    }
    $psts_tabs = 3.5 >= $psts->version ? true : false;
    ?>
	<?php 
    if (!$psts_tabs) {
        ?>
		<div class="postbox">
		<h3 class="hndle" style="cursor:auto;"><span><?php 
        _e('Affiliate Settings', 'affiliate');
        ?>
</span></h3>
	<?php 
    } else {
        $tab = ProSites_Helper_Tabs_Settings::get_active_tab();
        ProSites_Helper_Settings::settings_header($tab);
    }
    ?>
        <div class="inside">
			<?php 
    $prosites_currency = $psts->get_setting('currency');
    $affiliate_currency = aff_get_option('affiliate-currency-paypal-masspay', 'USD');
    //echo "prosites_currency[". $prosites_currency ."] affiliate_currency[". $affiliate_currency ."]<br />";
    if ($prosites_currency != $affiliate_currency) {
        ?>
<p class="error"><?php 
        echo sprintf(__('Currency mismatch. Your Pro Sites currency is set to <strong>%s</strong> but Affiliate currency is set to <strong>%s</strong>. Please ensure both are set correctly.'), $prosites_currency, $affiliate_currency);
        ?>
</p><?php 
    }
    ?>

          <table class="form-table">
            <tr valign="top">
            <th scope="row"><?php 
    _e('1 Month payment', 'affiliate');
    ?>
</th>
            <td>
				<select name="supporter_1_whole_payment">
				<?php 
    $supporter_1_whole_payment = $getoption("supporter_1_whole_payment");
    $counter = 0;
    for ($counter = 0; $counter <= 300; $counter += 1) {
        echo '<option value="' . $counter . '"' . ($counter == $supporter_1_whole_payment ? ' selected' : '') . '>' . $counter . '</option>' . "\n";
    }
    ?>
		        </select>
		        .
				<select name="supporter_1_partial_payment">
				<?php 
    $supporter_1_partial_payment = $getoption("supporter_1_partial_payment");
    $counter = 0;
    echo '<option value="00"' . ('00' == $supporter_1_partial_payment ? ' selected' : '') . '>00</option>' . "\n";
    for ($counter = 1; $counter <= 99; $counter += 1) {
        if ($counter < 10) {
            $number = '0' . $counter;
        } else {
            $number = $counter;
        }
        echo '<option value="' . $number . '"' . ($number == $supporter_1_partial_payment ? ' selected' : '') . '>' . $number . '</option>' . "\n";
    }
    ?>
		        </select>
				&nbsp;
				<?php 
    $supporter_1_payment_type = $getoption("supporter_1_payment_type", 'actual');
    ?>
				<select name="supporter_1_payment_type">
					<option value='actual' <?php 
    selected($supporter_1_payment_type, 'actual');
    ?>
><?php 
    echo esc_html($affiliate_currency);
    ?>
</option>
					<option value='percentage' <?php 
    selected($supporter_1_payment_type, 'percentage');
    ?>
><?php 
    _e('%', 'membership');
    ?>
</option>
				</select>
		        <br /><?php 
    _e('Affiliate payment for one month.');
    ?>
            </td>
            </tr>

			<tr valign="top">
            <th scope="row"><?php 
    _e('3 Month payment', 'affiliate');
    ?>
</th>
            <td>
				<select name="supporter_3_whole_payment">
				<?php 
    $supporter_3_whole_payment = $getoption("supporter_3_whole_payment");
    $counter = 0;
    for ($counter = 0; $counter <= 300; $counter += 1) {
        echo '<option value="' . $counter . '"' . ($counter == $supporter_3_whole_payment ? ' selected' : '') . '>' . $counter . '</option>' . "\n";
    }
    ?>
		        </select>
		        .
				<select name="supporter_3_partial_payment">
				<?php 
    $supporter_3_partial_payment = $getoption("supporter_3_partial_payment");
    $counter = 0;
    echo '<option value="00"' . ('00' == $supporter_3_partial_payment ? ' selected' : '') . '>00</option>' . "\n";
    for ($counter = 1; $counter <= 99; $counter += 1) {
        if ($counter < 10) {
            $number = '0' . $counter;
        } else {
            $number = $counter;
        }
        echo '<option value="' . $number . '"' . ($number == $supporter_3_partial_payment ? ' selected' : '') . '>' . $number . '</option>' . "\n";
    }
    ?>
		        </select>
				&nbsp;
				<?php 
    $supporter_3_payment_type = $getoption("supporter_3_payment_type", 'actual');
    ?>
				<select name="supporter_3_payment_type">
					<option value='actual' <?php 
    selected($supporter_3_payment_type, 'actual');
    ?>
><?php 
    echo esc_html($affiliate_currency);
    ?>
</option>
					<option value='percentage' <?php 
    selected($supporter_3_payment_type, 'percentage');
    ?>
><?php 
    _e('%', 'membership');
    ?>
</option>
				</select>
		        <br /><?php 
    _e('Affiliate payment for three months.');
    ?>
            </td>
            </tr>

			<tr valign="top">
            <th scope="row"><?php 
    _e('12 Month payment', 'affiliate');
    ?>
</th>
            <td>
				<select name="supporter_12_whole_payment">
				<?php 
    $supporter_12_whole_payment = $getoption("supporter_12_whole_payment");
    $counter = 0;
    for ($counter = 0; $counter <= 300; $counter += 1) {
        echo '<option value="' . $counter . '"' . ($counter == $supporter_12_whole_payment ? ' selected' : '') . '>' . $counter . '</option>' . "\n";
    }
    ?>
		        </select>
		        .
				<select name="supporter_12_partial_payment">
				<?php 
    $supporter_12_partial_payment = $getoption("supporter_12_partial_payment");
    $counter = 0;
    echo '<option value="00"' . ('00' == $supporter_12_partial_payment ? ' selected' : '') . '>00</option>' . "\n";
    for ($counter = 1; $counter <= 99; $counter += 1) {
        if ($counter < 10) {
            $number = '0' . $counter;
        } else {
            $number = $counter;
        }
        echo '<option value="' . $number . '"' . ($number == $supporter_12_partial_payment ? ' selected' : '') . '>' . $number . '</option>' . "\n";
    }
    ?>
		        </select>
				&nbsp;
				<?php 
    $supporter_12_payment_type = $getoption("supporter_12_payment_type", 'actual');
    ?>
				<select name="supporter_12_payment_type">
					<option value='actual' <?php 
    selected($supporter_12_payment_type, 'actual');
    ?>
><?php 
    echo esc_html($affiliate_currency);
    ?>
</option>
					<option value='percentage' <?php 
    selected($supporter_12_payment_type, 'percentage');
    ?>
><?php 
    _e('%', 'membership');
    ?>
</option>
				</select>
	            <?php 
    if ($psts_tabs) {
        echo '<input type="hidden" name="active_tab" value="affiliate" />';
    }
    ?>
		        <br /><?php 
    _e('Affiliate payment for twelve months.');
    ?>
            </td>
            </tr>

          </table>
        </div>
	<?php 
    if (!$psts_tabs) {
        ?>
		</div>
	<?php 
    }
}
示例#3
0
 /**
  * 'Restrict XML-RPC'
  *
  * @return string
  */
 public static function render_tab_xmlrpc()
 {
     ProSites_Helper_Settings::settings_header(ProSites_Helper_Tabs_Settings::get_active_tab());
     $module = new ProSites_Module_XMLRPC();
     echo $module->settings();
 }
示例#4
0
        /**
         * Pricing Table
         *
         * @return string
         */
        public static function render_tab_comparison_table()
        {
            global $psts;
            $active_tab = ProSites_Helper_Tabs_Pricing::get_active_tab();
            ProSites_Helper_Settings::settings_header($active_tab);
            $plans_table_enabled = $psts->get_setting('comparison_table_enabled');
            $checked = 'enabled' == $plans_table_enabled ? 'enabled' : 'disabled';
            $level_list = get_site_option('psts_levels');
            $last_level = is_array($level_list) ? count($level_list) : 0;
            $table_settings = ProSites_Model_Pricing::load_feature_settings();
            $enabled_modules = $psts->get_setting('modules_enabled', array());
            ?>
			<input type="hidden" name="pricing_settings" value="<?php 
            echo esc_attr($active_tab['tab_key']);
            ?>
"/>
			<table class="form-table">
				<tr>
					<th scope="row"><?php 
            _e('Enable Feature Table', 'psts');
            ?>
</th>
					<td>
						<input type="checkbox" name="psts[comparison_table_enabled]" value="1" <?php 
            checked($checked, 'enabled');
            ?>
 />
					</td>
				</tr>

				<!-- MODULE TABLE -->
				<tr id="module-comparison-table">
					<td colspan="2">
						<div class="form-description"><?php 
            _e('Use the form below to build your feature comparison table.', 'psts');
            ?>
</div>
						<div class="level-select-bar">
							<?php 
            //								_e( 'Select level: ', 'psts' );
            if (is_array($level_list) && count($level_list)) {
                foreach ($level_list as $key => $level) {
                    $class = 1 == $key ? 'selected' : '';
                    echo '<strong><a data-id="' . $key . '" class="' . $class . '">' . $level['name'] . '</a></strong>';
                    if ($key != count($level_list)) {
                        echo ' | ';
                    }
                }
            }
            ?>
							<input type="hidden" name="current_level" value="1"/>
						</div>

						<?php 
            // define the columns to display, the syntax is 'internal name' => 'display name'
            $posts_columns = array('order' => array('title' => __('#', 'psts'), 'width' => '8px', 'class' => ''), 'visible' => array('title' => __('Visible', 'psts'), 'width' => '36px', 'class' => ''), 'name' => array('title' => __('Name', 'psts'), 'small' => __('(double-click to change)'), 'width' => '150px', 'class' => ''), 'description' => array('title' => __('Description', 'psts'), 'small' => __('(double-click to change)'), 'width' => '', 'class' => ''), 'tick_cross' => array('title' => __('Indicator', 'psts'), 'small' => __('(for selected level)', 'psts'), 'width' => '60px', 'class' => 'level-settings'), 'custom' => array('title' => __('Custom text', 'psts'), 'small' => __('(for selected level)', 'psts'), 'width' => '', 'class' => ''));
            $status_array_normal = array('tick' => '&#x2713', 'cross' => '&#x2718');
            $status_array_module = array('module' => __('Level: %s', 'psts'), 'inverse' => __('Invert: %s', 'psts'));
            $hover_actions = array('edit' => __('edit', 'psts'), 'save' => __('change', 'psts'), 'reset' => __('reset', 'psts'));
            $feature_order = array();
            ?>

						<table width="100%" cellpadding="3" cellspacing="3" class="widefat feature-table" id="prosites-level-list">
							<thead>
								<tr>
								<?php 
            foreach ($posts_columns as $col) {
                $style = !empty($col['width']) ? ' style="max-width:' . $col['width'] . '"' : '';
                $class = !empty($col['class']) ? ' class="' . $col['class'] . '"' : '';
                $small = !empty($col['small']) ? ' <small>' . esc_html($col['small']) . '</small>' : '';
                echo '<th scope="col"' . $style . $class . '>' . esc_html($col['title']) . $small . '</th>';
            }
            ?>
								</tr>
							</thead>
							<tbody id="the-list">
								<?php 
            if (!empty($table_settings)) {
                $bgcolor = $class = '';
                $count = 0;
                $modules_array = array();
                foreach ($table_settings as $key => $setting) {
                    if ('modules' == $key || 'feature_order' == $key || 'levels' == $key) {
                        continue;
                    }
                    // don't show disabled modules
                    if (isset($setting['module']) && !in_array($setting['module'], $enabled_modules)) {
                        continue;
                    }
                    $feature_order[] = $key;
                    $count += 1;
                    $level_code = 0;
                    //										$level = $level_list[ $order ];
                    $class = $count % 2 == 0 ? '' : 'alternate';
                    $class .= empty($setting['module']) ? ' custom' : ' module';
                    echo '<tr class="' . $class . ' blog-row" data-level="' . $level_code . '">';
                    foreach ($posts_columns as $column_name => $column) {
                        switch ($column_name) {
                            case 'order':
                                $style = !empty($column['width']) ? ' max-width:' . $column['width'] . ';' : '';
                                ?>
													<td scope="row" style="padding-left: 10px; <?php 
                                echo $style;
                                ?>
" class="order-col">
														<div class="position"><?php 
                                echo $count;
                                ?>
</div>
														<?php 
                                if (isset($setting['custom'])) {
                                    echo '<input type="hidden" name="psts[feature_table][' . $key . '][custom]" value="' . esc_attr($setting['custom']) . '" />';
                                    echo '<a class="delete"><span class="dashicons dashicons-trash"></span></a>';
                                }
                                if (isset($setting['module'])) {
                                    $modules_array[] = $setting['module'];
                                    echo '<input type="hidden" name="psts[feature_table][' . $key . '][module]" value="' . esc_attr($setting['module']) . '" />';
                                    echo '<input type="hidden" name="psts[feature_table][' . $key . '][module_key]" value="' . $key . '" />';
                                }
                                ?>
													</td>
													<?php 
                                break;
                            case 'visible':
                                ?>
													<td scope="row" style="padding-left: 20px;">
														<?php 
                                if (!isset($setting['visible'])) {
                                    $setting['visible'] = false;
                                }
                                ?>
														<input type="checkbox" name="psts[feature_table][<?php 
                                echo $key;
                                ?>
][visible]" value="1" <?php 
                                checked($setting['visible']);
                                ?>
>
													</td>
													<?php 
                                break;
                            case 'name':
                                $original_value = '';
                                if (isset($setting['module']) && !empty($setting['module'])) {
                                    if (method_exists($setting['module'], 'get_name')) {
                                        $original_value = call_user_func($setting['module'] . '::get_name');
                                    }
                                }
                                if (isset($setting['custom']) && !empty($setting['custom'])) {
                                    $original_value = $setting['name'];
                                }
                                ?>
													<td scope="row">
														<div class="text-item"><?php 
                                echo esc_html($setting['name']);
                                ?>
</div>
														<div class="edit-box" style="display:none">
															<input class="editor" type="text" name="psts[feature_table][<?php 
                                echo $key;
                                ?>
][name]" value="<?php 
                                echo esc_html($setting['name']);
                                ?>
"/><br/>
															<span><a class="save-link"><?php 
                                echo esc_html($hover_actions['save']);
                                ?>
</a> <a style="margin-left: 10px;" class="reset-link"><?php 
                                echo esc_html($hover_actions['reset']);
                                ?>
</a></span>
														</div>
														<input type="hidden" value="<?php 
                                echo esc_html($original_value);
                                ?>
"/>
													</td>
													<?php 
                                break;
                            case 'description':
                                if (isset($setting['module']) && !empty($setting['module'])) {
                                    if (method_exists($setting['module'], 'get_description')) {
                                        $original_value = call_user_func($setting['module'] . '::get_description');
                                    }
                                }
                                if (isset($setting['custom']) && !empty($setting['custom'])) {
                                    $original_value = $setting['description'];
                                }
                                ?>
													<td scope="row">
														<div class="text-item"><?php 
                                echo esc_html($setting['description']);
                                ?>
</div>
														<div class="edit-box" style="display:none">
															<textarea class="editor" type="text" name="psts[feature_table][<?php 
                                echo $key;
                                ?>
][description]"><?php 
                                echo esc_html($setting['description']);
                                ?>
</textarea><br/>
															<span><a class="save-link"><?php 
                                echo esc_html($hover_actions['save']);
                                ?>
</a> <a style="margin-left: 10px;" class="reset-link"><?php 
                                echo esc_html($hover_actions['reset']);
                                ?>
</a></span>
														</div>
														<input type="hidden" value="<?php 
                                echo esc_html($original_value);
                                ?>
"/>
													</td>
													<?php 
                                break;
                            case 'tick_cross':
                                ?>
													<td scope="row" class="<?php 
                                echo esc_attr($column['class']);
                                ?>
">
														<?php 
                                // We're working with level based settings
                                if (is_array($level_list) && count($level_list)) {
                                    foreach ($level_list as $level_id => $level) {
                                        if (!empty($setting['levels'][$level_id]['status']) && !is_array($setting['levels'][$level_id]['status'])) {
                                            $status = $setting['levels'][$level_id]['status'];
                                            $level_status = '';
                                            if (isset($setting['module']) && method_exists($setting['module'], 'get_level_status')) {
                                                $level_status = call_user_func($setting['module'] . '::get_level_status', $level_id);
                                            }
                                            if (!empty($setting['module'])) {
                                                $chosen_array = $status_array_module;
                                                $invert = 'tick' == $level_status ? 'cross' : 'tick';
                                                $chosen_array['module'] = sprintf($chosen_array['module'], $status_array_normal[$level_status]);
                                                $chosen_array['inverse'] = sprintf($chosen_array['inverse'], $status_array_normal[$invert]);
                                            } else {
                                                $chosen_array = $status_array_normal;
                                            }
                                            if (!empty($setting['module'])) {
                                                //																	echo '*hide* ' . $setting['levels'][ $key ]['status'];
                                            } else {
                                                //																	echo '*hide* Not a module';
                                            }
                                            ?>
																	<!-- Change name... -->
																	<select class="chosen" name="psts[feature_table][<?php 
                                            echo $key;
                                            ?>
][levels][<?php 
                                            echo $level_id;
                                            ?>
][status]" data-level="level-<?php 
                                            echo $level_id;
                                            ?>
[status]">
																    <?php 
                                            foreach ($chosen_array as $item_key => $item) {
                                                echo '<option value="' . esc_attr($item_key) . '" ' . selected($status, $item_key) . '>' . $item . '</option>';
                                            }
                                            echo '<option value="none" ' . selected($status, 'none') . '>' . __('None', 'psts') . '</option>';
                                            ?>
																	</select>
																<?php 
                                        } elseif (isset($setting['levels'][$level_id]['status']) && is_array($setting['levels'][$level_id]['status'])) {
                                            //																	$new_status = $setting['levels'][ $level_id ]['status'];
                                            //																	if( method_exists( $setting[ 'module' ], 'get_level_status' ) ) {
                                            //																		$new_status = call_user_func( $setting[ 'module' ] . '::get_level_status', $level_id );
                                            //																		$old_status = $setting['levels'][ $level_id ]['status'] ;
                                            //																		if( 'none' != $old_status['selection'] ) {
                                            //																			$new_status['selection'] = $new_status['value'];
                                            //																		} else {
                                            //																			$new_status['selection'] = 'none';
                                            //																		}
                                            //
                                            //																	}
                                            //																	$keys = array_keys( $new_status );
                                            $keys = array_keys($setting['levels'][$level_id]['status']);
                                            foreach ($keys as $index) {
                                                echo '<input type="hidden" name="psts[feature_table][' . $key . '][levels][' . $level_id . '][status][' . $index . ']" value="' . $setting['levels'][$level_id]['status'][$index] . '" />';
                                            }
                                            ?>

																	<select class="chosen" name="psts[feature_table][<?php 
                                            echo $key;
                                            ?>
][levels][<?php 
                                            echo $level_id;
                                            ?>
][status][selection]">
																    <?php 
                                            $value = $setting['levels'][$level_id]['status']['value'];
                                            $selection = isset($setting['levels'][$level_id]['status']['selection']) ? $setting['levels'][$level_id]['status']['selection'] : $value;
                                            $selected = selected($selection, $value, false);
                                            echo '<option value="' . esc_attr($value) . '" ' . $selected . '>' . esc_html($setting['levels'][$level_id]['status']['display']) . '</option>';
                                            echo '<option value="none" ' . selected($selection, 'none') . '>' . __('None', 'psts') . '</option>';
                                            ?>
																	</select>
																<?php 
                                        }
                                    }
                                }
                                // There are no level specific settings
                                if (isset($setting['active']) && (!empty($setting['active']) || false === $setting['active'])) {
                                    $module_active = true;
                                    if (method_exists($setting['module'], 'is_active')) {
                                        $module_active = call_user_func($setting['module'] . '::is_active');
                                    }
                                    $active_status = array('active' => array('title' => __('Active: %s', 'psts'), 'status' => 'tick'), 'inactive' => array('title' => __('Not active: %s', 'psts'), 'status' => 'cross'));
                                    $value = $setting['active'];
                                    if ($module_active) {
                                        $option = '<option value="module" ' . selected($value, 'module', false) . '>' . sprintf($active_status['active']['title'], $status_array_normal[$active_status['active']['status']]) . '</option>';
                                    } else {
                                        $option = '<option value="module" ' . selected($value, 'module', false) . '>' . sprintf($active_status['inactive']['title'], $status_array_normal[$active_status['inactive']['status']]) . '</option>';
                                    }
                                    ?>
															<select class="chosen" name="psts[feature_table][<?php 
                                    echo $key;
                                    ?>
][active]">
															    <?php 
                                    echo $option;
                                    echo '<option value="none" ' . selected($value, 'none') . '>' . __('None', 'psts') . '</option>';
                                    ?>
																</select>
														<?php 
                                }
                                ?>
													</td>
													<?php 
                                break;
                            case 'custom':
                                ?>
													<td scope="row">
														<?php 
                                $x = '';
                                if (is_array($level_list) && count($level_list)) {
                                    foreach ($level_list as $level_id => $level) {
                                        ?>
																<textarea name="psts[feature_table][<?php 
                                        echo $key;
                                        ?>
][levels][<?php 
                                        echo $level_id;
                                        ?>
][text]"><?php 
                                        echo esc_html($setting['levels'][$level_id]['text']);
                                        ?>
</textarea>
															<?php 
                                    }
                                }
                                ?>
													</td>
													<?php 
                                break;
                        }
                    }
                    ?>
									</tr>
								<?php 
                    $level_keys = array_keys($level_list);
                    $level_keys = implode(',', $level_keys);
                }
                ?>
										<input type="hidden" name="psts[feature_table][modules]" value="<?php 
                echo implode(',', $modules_array);
                ?>
" />
										<input type="hidden" name="psts[feature_table][levels]" value="<?php 
                echo $level_keys;
                ?>
" />
<!--										<input type="hidden" name="psts[pricing_levels_order]" value="--><?php 
                //echo implode( ',' , $pricing_levels_order );
                ?>
<!--" />-->
									<?php 
            } else {
                ?>
									<tr class='no-features'>
										<td colspan="6"><?php 
                _e('No features added yet.', 'psts');
                ?>
</td>
									</tr>
								<?php 
            }
            // end if levels
            ?>

							</tbody>
						</table>

						<?php 
            // Add order...
            $feature_order = implode(',', $feature_order);
            echo '<input type="hidden" name="psts[feature_table][feature_order]" value="' . $feature_order . '" />';
            // Mark for delete...
            echo '<input type="hidden" name="mark_for_delete" value="" />';
            ?>

					</td>
				</tr>


				<tr id="add-feature-box">
					<td colspan="2">
						<strong><?php 
            _e('Add custom feature', 'psts');
            ?>
</strong>
						<table id="add-pricing-feature" class="form-table">
							<thead>
							<tr>
								<th><?php 
            _e('Name', 'psts');
            ?>
</th>
								<th><?php 
            _e('Description', 'psts');
            ?>
</th>
								<th><?php 
            _e('Custom text', 'psts');
            ?>
</th>
								<th></th>
							</tr>
							</thead>
							<tbody>
							<tr class="alternate">
								<td>
									<input name="new-feature-name" type="text"/>
									<input name="new-feature-levels" type="hidden" value="<?php 
            echo count($level_list);
            ?>
"/>
								</td>
								<td><textarea name="new-feature-description"></textarea></td>
								<td><textarea name="new-feature-text"></textarea></td>
								<td><input type="button" class="button" name="add-feature-button" id="add-feature-button" value="Add"/></td>

							</tr>
							</tbody>
						</table>

					</td>
				</tr>

			</table>
			<?php 
            //			$gateway = new ProSites_Gateway_2Checkout();
            //			echo $gateway->settings();
        }
示例#5
0
        public static function render_tab_pricing_style()
        {
            global $psts;
            $active_tab = ProSites_Helper_Tabs_Pricing::get_active_tab();
            ProSites_Helper_Settings::settings_header($active_tab);
            ?>
			<div class="pricing-styles">
				<input type="hidden" name="pricing_settings" value="<?php 
            echo esc_attr($active_tab['tab_key']);
            ?>
"/>
				<h3><?php 
            esc_html_e('Table Layout', 'psts');
            ?>
</h3>
				<div class="table-layout">
					<label>
						<input type="radio" name="psts[pricing_table_layout]" value="option1" <?php 
            checked($psts->get_setting('pricing_table_layout', 'option1'), 'option1');
            ?>
 />
						<div class="layout-img option1"></div>
					</label>
					<label>
						<input type="radio" name="psts[pricing_table_layout]" value="option2" <?php 
            checked($psts->get_setting('pricing_table_layout', 'option1'), 'option2');
            ?>
 />
						<div class="layout-img option2"></div>
					</label>
					<label>
						<input type="radio" name="psts[pricing_table_layout]" value="option3" <?php 
            checked($psts->get_setting('pricing_table_layout', 'option1'), 'option3');
            ?>
 />
						<div class="layout-img option3"></div>
					</label>
					<label>
						<input type="radio" name="psts[pricing_table_layout]" value="option4" <?php 
            checked($psts->get_setting('pricing_table_layout', 'option1'), 'option4');
            ?>
 />
						<div class="layout-img option4"></div>
					</label>
					<label>
						<input type="radio" name="psts[pricing_table_layout]" value="option5" <?php 
            checked($psts->get_setting('pricing_table_layout', 'option1'), 'option5');
            ?>
 />
						<div class="layout-img option5"></div>
					</label>
				</div>
				<p class="description clear"><?php 
            esc_html_e('Select the base layout for the pricing tables. This will provide the initial CSS for your pricing tables.', 'psts');
            ?>
					<br/>
					<?php 
            esc_html_e('For more detailed customisation you will need to alter the CSS in your theme, use a custom CSS plugin or the custom CSS box on this page.', 'psts');
            ?>
</p>

				<?php 
            $normal_heading = __('Normal Level', 'psts');
            $selected_heading = __('Selected Level', 'psts');
            $featured_heading = __('Featured Level', 'psts');
            $styles = $psts->get_setting('checkout_style');
            ?>
				<h3><?php 
            esc_html_e('Customise Columns', 'psts');
            ?>
</h3>
				<p class="description clear"><?php 
            esc_html_e('Use the settings below to customize your checkout table. Each column here represents the state of your level in the checkout table: normal, selected level or featured level. Note: This overrides the defaults for each of the layouts above.', 'psts');
            ?>
				<table class="form-table checkout_style">
					<tr>
						<th></th>
						<th scope="row"><?php 
            echo esc_html($normal_heading);
            ?>
</th>
						<th scope="row"><?php 
            echo esc_html($selected_heading);
            ?>
</th>
						<th scope="row"><?php 
            echo esc_html($featured_heading);
            ?>
</th>
					</tr>
					<tr>
						<td><?php 
            _e('Columns Background', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_column_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_column_bg', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_column_bg_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_column_bg_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_column_bg_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_column_bg_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Columns Border Color', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_border_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_border_color', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_border_color_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_border_color_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_border_color_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_border_color_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Columns Border Width', 'psts');
            ?>
</td>
						<td>
							<select name="psts[checkout_style][pricing_style_border_width]" class="chosen">
								<?php 
            $border_width = self::get_style('pricing_style_border_width', $styles);
            $border_width_options = '';
            for ($counter = 0; $counter <= 50; $counter++) {
                $border_width_options .= '<option value="' . $counter . '"' . ($counter == $border_width ? ' selected' : '') . '>' . ($counter ? $counter : 'default') . '</option>' . "\n";
            }
            echo $border_width_options;
            ?>
							</select>
						</td>
						<td>
							<select name="psts[checkout_style][pricing_style_border_width_selected]" class="chosen">
								<?php 
            $border_width = self::get_style('pricing_style_border_width_selected', $styles);
            $border_width_options = '';
            for ($counter = 0; $counter <= 50; $counter++) {
                $border_width_options .= '<option value="' . $counter . '"' . ($counter == $border_width ? ' selected' : '') . '>' . ($counter ? $counter : 'default') . '</option>' . "\n";
            }
            echo $border_width_options;
            ?>
							</select>
						</td>
						<td>
							<select name="psts[checkout_style][pricing_style_border_width_featured]" class="chosen">
								<?php 
            $border_width = self::get_style('pricing_style_border_width_featured', $styles);
            $border_width_options = '';
            for ($counter = 0; $counter <= 50; $counter++) {
                $border_width_options .= '<option value="' . $counter . '"' . ($counter == $border_width ? ' selected' : '') . '>' . ($counter ? $counter : 'default') . '</option>' . "\n";
            }
            echo $border_width_options;
            ?>
							</select>
						</td>
					</tr>
					<tr>
						<td><?php 
            _e('Title Text', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_title_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_title_color', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_title_color_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_title_color_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_title_color_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_title_color_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Title Background', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_title_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_title_bg', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_title_bg_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_title_bg_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_title_bg_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_title_bg_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Price Text', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_price_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_price_color', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_price_color_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_price_color_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_price_color_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_price_color_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Price Background', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_price_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_price_bg', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_price_bg_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_price_bg_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_price_bg_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_price_bg_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Price Summary Text', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_price_summary_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_price_summary_color', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_price_summary_color_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_price_summary_color_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_price_summary_color_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_price_summary_color_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Price Summary Background', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_price_summary_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_price_summary_bg', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_price_summary_bg_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_price_summary_bg_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_price_summary_bg_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_price_summary_bg_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Subtitle Text', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_subtitle_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_subtitle_color', '', $styles);
            ?>
"/></td>
						<td><!-- <input type="text" name="psts[checkout_style][pricing_style_subtitle_color_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_subtitle_color_selected', '', $styles);
            ?>
"/> --></td>
						<td><!-- <input type="text" name="psts[checkout_style][pricing_style_subtitle_color_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_subtitle_color_featured', '', $styles);
            ?>
"/> --></td>
					</tr>
					<tr>
						<td><?php 
            _e('Subtitle Background', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_subtitle_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_subtitle_bg', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_subtitle_bg_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_subtitle_bg_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_subtitle_bg_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_subtitle_bg_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Features Row Text', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_features_text_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_features_text_color', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_features_text_color_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_features_text_color_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_features_text_color_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_features_text_color_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Features Row Background', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_features_text_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_features_text_bg', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_features_text_bg_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_features_text_bg_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_features_text_bg_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_features_text_bg_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Features Row Text (Alternate/Odd)', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_features_alt_text_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_features_alt_text_color', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_features_alt_text_color_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_features_alt_text_color_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_features_alt_text_color_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_features_alt_text_color_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Features Row Background (Alternate/Odd)', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_features_alt_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_features_alt_bg', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_features_alt_bg_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_features_alt_bg_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_features_alt_bg_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_features_alt_bg_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Button Container', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_container]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_container', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_container_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_container_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_container_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_container_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Button Text', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_text_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_text_color', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_text_color_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_text_color_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_text_color_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_text_color_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Button Background', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_bg', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_bg_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_bg_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_bg_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_bg_featured', '', $styles);
            ?>
"/></td>

					</tr>
					<tr>
						<td><?php 
            _e('Button Text (Hover)', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_hover_text_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_hover_text_color', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_hover_text_color_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_hover_text_color_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_hover_text_color_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_hover_text_color_featured', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Button Background (Hover)', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_hover_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_hover_bg', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_hover_bg_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_hover_bg_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_button_hover_bg_featured]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_button_hover_bg_featured', '', $styles);
            ?>
"/></td>
					</tr>
				</table>

				<?php 
            $normal_heading = __('Normal', 'psts');
            $selected_heading = __('Selected', 'psts');
            $hover_heading = __('Hover', 'psts');
            ?>
				<h3><?php 
            esc_html_e('Period Selector', 'psts');
            ?>
</h3>
				<p class="description clear"><?php 
            esc_html_e('Change the styles of the period selector if shown above the table.', 'psts');
            ?>
				<table class="form-table checkout_style">
					<tr>
						<th></th>
						<th scope="row"><?php 
            echo esc_html($normal_heading);
            ?>
</th>
						<th scope="row"><?php 
            echo esc_html($selected_heading);
            ?>
</th>
						<th scope="row"><?php 
            echo esc_html($hover_heading);
            ?>
</th>
					</tr>
					<tr>
						<td><?php 
            _e('Border Color', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_period_border_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_period_border_color', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_period_border_color_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_period_border_color_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_period_border_color_hover]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_period_border_color_hover', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Monthly Text', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_monthly_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_monthly_color', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_monthly_color_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_monthly_color_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_monthly_color_hover]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_monthly_color_hover', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Monthly Background', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_monthly_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_monthly_bg', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_monthly_bg_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_monthly_bg_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_monthly_bg_hover]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_monthly_bg_hover', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Quarterly Text', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_quarterly_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_quarterly_color', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_quarterly_color_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_quarterly_color_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_quarterly_color_hover]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_quarterly_color_hover', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Quarterly Background', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_quarterly_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_quarterly_bg', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_quarterly_bg_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_quarterly_bg_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_quarterly_bg_hover]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_quarterly_bg_hover', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Annually Text', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_annually_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_annually_color', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_annually_color_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_annually_color_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_annually_color_hover]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_annually_color_hover', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Annually Background', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_annually_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_annually_bg', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_annually_bg_selected]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_annually_bg_selected', '', $styles);
            ?>
"/></td>
						<td><input type="text" name="psts[checkout_style][pricing_style_annually_bg_hover]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_annually_bg_hover', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Alignment', 'psts');
            ?>
</td>
						<td>
							<label>
								<input type="radio" name="psts[checkout_style][pricing_style_period_align]" value="left" <?php 
            checked(self::get_style('pricing_style_period_align', 'none', $styles), 'left');
            ?>
 />
								<?php 
            esc_html_e('Left ', 'psts');
            ?>
							</label>&nbsp;
							<label>
								<input type="radio" name="psts[checkout_style][pricing_style_period_align]" value="none" <?php 
            checked(self::get_style('pricing_style_period_align', 'none', $styles), 'none');
            ?>
 />
								<?php 
            esc_html_e('Center ', 'psts');
            ?>
							</label>&nbsp;
							<label>
								<input type="radio" name="psts[checkout_style][pricing_style_period_align]" value="right" <?php 
            checked(self::get_style('pricing_style_period_align', 'none', $styles), 'right');
            ?>
 />
								<?php 
            esc_html_e('Right ', 'psts');
            ?>
							</label>
						</td>
					</tr>
				</table>

				<h3><?php 
            esc_html_e('Detached Coupon Box', 'psts');
            ?>
</h3>
				<p class="description clear"><?php 
            esc_html_e('Change the display of the coupon box (if its not attached to the table).', 'psts');
            ?>
				<table class="form-table checkout_style">
					<tr>
						<td><?php 
            _e('Background', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_coupon_column_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_coupon_column_bg', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Border Color', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_coupon_border_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_coupon_border_color', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Border Width', 'psts');
            ?>
</td>
						<td>
							<select name="psts[checkout_style][pricing_style_coupon_border_width]" class="chosen">
								<?php 
            $border_width = self::get_style('pricing_style_coupon_border_width', $styles);
            $border_width_options = '';
            for ($counter = 0; $counter <= 50; $counter++) {
                $border_width_options .= '<option value="' . $counter . '"' . ($counter == $border_width ? ' selected' : '') . '>' . ($counter ? $counter : 'default') . '</option>' . "\n";
            }
            echo $border_width_options;
            ?>
							</select>
						</td>
					</tr>
					<tr>
						<td><?php 
            _e('Button Text', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_coupon_button_text_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_coupon_button_text_color', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Button Background', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_coupon_button_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_coupon_button_bg', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Button Text (Hover)', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_coupon_button_hover_text_color]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_coupon_button_hover_text_color', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Button Background (Hover)', 'psts');
            ?>
</td>
						<td><input type="text" name="psts[checkout_style][pricing_style_coupon_button_hover_bg]" class="color-picker" value="<?php 
            echo self::get_style('pricing_style_coupon_button_hover_bg', '', $styles);
            ?>
"/></td>
					</tr>
					<tr>
						<td><?php 
            _e('Alignment', 'psts');
            ?>
</td>
						<td>
							<label>
								<input type="radio" name="psts[checkout_style][pricing_style_coupon_align]" value="left" <?php 
            checked(self::get_style('pricing_style_coupon_align', 'none', $styles), 'left');
            ?>
 />
								<?php 
            esc_html_e('Left ', 'psts');
            ?>
							</label>&nbsp;
							<label>
								<input type="radio" name="psts[checkout_style][pricing_style_coupon_align]" value="none" <?php 
            checked(self::get_style('pricing_style_coupon_align', 'none', $styles), 'none');
            ?>
 />
								<?php 
            esc_html_e('Center ', 'psts');
            ?>
							</label>&nbsp;
							<label>
								<input type="radio" name="psts[checkout_style][pricing_style_coupon_align]" value="right" <?php 
            checked(self::get_style('pricing_style_coupon_align', 'none', $styles), 'right');
            ?>
 />
								<?php 
            esc_html_e('Right ', 'psts');
            ?>
							</label>
						</td>
					</tr>
				</table>

				<h3><?php 
            esc_html_e('Custom CSS', 'psts');
            ?>
</h3>
				<p class="description clear"><?php 
            esc_html_e('You can use this box to enter your CSS, customise your theme or use a custom CSS plugin. You can avoid altering the CSS of the rest of your site by prefixing all rules you specify with "#prosites-checkout-table". Note: The CSS you specify in this box will be filtered before saving to protect your site. Any non-CSS text will be removed.', 'psts');
            ?>
</p>
				<textarea class="custom-css" name="psts[checkout_style][pricing_table_custom_css]"><?php 
            echo sprintf(self::get_style('pricing_table_custom_css', '', $styles));
            ?>
</textarea>

			</div>
		<?php 
        }
示例#6
0
        /**
         * Manual Payments
         *
         * @return string
         */
        public static function render_tab_manual()
        {
            global $psts;
            ProSites_Helper_Settings::settings_header(ProSites_Helper_Tabs_Gateways::get_active_tab());
            $class_name = 'ProSites_Gateway_Manual';
            $active_gateways = (array) $psts->get_setting('gateways_enabled');
            $checked = in_array($class_name, $active_gateways) ? 'on' : 'off';
            ?>
			<table class="form-table">
				<tr>
					<th scope="row"><?php 
            _e('Enable Gateway', 'psts');
            ?>
</th>
					<td>
						<input type="hidden" name="gateway" value="<?php 
            echo esc_attr($class_name);
            ?>
" />
						<input type="checkbox" name="gateway_active" value="1" <?php 
            checked($checked, 'on');
            ?>
 />
					</td>
				</tr>
			</table>
			<?php 
            $gateway = new ProSites_Gateway_Manual();
            echo $gateway->settings();
        }