예제 #1
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 
        }
예제 #2
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();
        }
예제 #3
0
 public static function process_form()
 {
     global $psts;
     //process form
     if (isset($_POST['submit_pricing']) || isset($_POST['submit_pricing_section']) || isset($_POST['submit_pricing_header'])) {
         //check nonce
         check_admin_referer('psts_pricing_settings');
         // get settings
         $old_settings = get_site_option('psts_settings');
         $active_tab = ProSites_Helper_Tabs_Pricing::get_active_tab();
         $active_tab = $active_tab['tab_key'];
         switch ($active_tab) {
             case 'pricing_table':
                 if (isset($_POST['psts']['plans_table_enabled'])) {
                     $_POST['psts']['plans_table_enabled'] = 'enabled';
                 } else {
                     $_POST['psts']['plans_table_enabled'] = 'disabled';
                 }
                 if (isset($_POST['psts']['coupons_enabled'])) {
                     $_POST['psts']['coupons_enabled'] = 'enabled';
                 } else {
                     $_POST['psts']['coupons_enabled'] = 'disabled';
                 }
                 if (isset($_POST['psts']['psts_checkout_show_featured'])) {
                     $_POST['psts']['psts_checkout_show_featured'] = 'enabled';
                 } else {
                     $_POST['psts']['psts_checkout_show_featured'] = 'disabled';
                 }
                 if (isset($_POST['psts']['pricing_gateways_tabbed'])) {
                     $_POST['psts']['pricing_gateways_tabbed'] = 'enabled';
                 } else {
                     $_POST['psts']['pricing_gateways_tabbed'] = 'disabled';
                 }
                 break;
             case 'comparison_table':
                 if (isset($_POST['psts']['comparison_table_enabled'])) {
                     $_POST['psts']['comparison_table_enabled'] = 'enabled';
                 } else {
                     $_POST['psts']['comparison_table_enabled'] = 'disabled';
                 }
                 if (isset($_POST['psts']['feature_table'])) {
                     $_POST['psts']['feature_table'] = self::sanitize_post_vars($_POST['psts']['feature_table']);
                 }
                 // Delete custom features
                 if (isset($_POST['mark_for_delete'])) {
                     $marked = sanitize_text_field($_POST['mark_for_delete']);
                     $marked = explode(',', $marked);
                     $marked = array_filter($marked);
                     if (!empty($marked)) {
                         foreach ($marked as $item) {
                             unset($_POST['psts']['feature_table'][$item]);
                         }
                     }
                 }
                 break;
             case 'pricing_style':
                 // Sanitize the custom CSS
                 if (isset($_POST['psts']['pricing_table_custom_css'])) {
                     if (!class_exists('CSSTidy_Sanitize_WP')) {
                         require $psts->plugin_dir . 'lib/external/csstidy/class.csstidy_sanitize_wp.php';
                     }
                     $_POST['psts']['pricing_table_custom_css'] = CSSTidy_Sanitize_WP::sanitize_css($_POST['psts']['pricing_table_custom_css']);
                 }
                 break;
         }
         if (isset($_POST['psts'])) {
             $settings = array_merge($old_settings, apply_filters('psts_settings_filter', $_POST['psts'], $active_tab));
             update_site_option('psts_settings', $settings);
         }
         do_action('psts_pricing_settings_process', $active_tab);
         echo '<div id="message" class="updated fade"><p>' . __('Pricing Table settings saved!', 'psts') . '</p></div>';
     }
 }