<form action="options.php" method="post">
	<?php settings_fields( EXPANDABLE_PAYWALL_SLUG . '_paywall' ); ?>
    <div id="basic_paywall" <?php if ( 'basic' !== Emoxie\Expandable_Paywall\Helper::active_paywall() ): echo 'style="display:none;"'; endif; ?>>
        <h3><?php _e( 'Basic Paywall / Hard Paywall', 'expandable-paywall' ); ?></h3>
        <p><?php _e( 'The Basic Paywall simply checks if the user is logged in or not.  You can put any short codes into the paywall text below.  This could direct the users to a registration form, a product purchase, etc.', 'expandable-paywall' ); ?></p>

        <table class="form-table">

            <tbody>

            <tr valign="top">
                <th scope="row" class="titledesc">
                    <label for="<?php echo EXPANDABLE_PAYWALL_SLUG; ?>_paywall_basic_post_types"><?php esc_attr_e( 'Which post types do you want the paywall wall to be displayed on?', 'expandable-paywall' ); ?></label>
                </th>
                <td class="forminp">
                    <select id="<?php echo EXPANDABLE_PAYWALL_SLUG; ?>_paywall_basic_post_types"
                            name="<?php echo EXPANDABLE_PAYWALL_SLUG; ?>_paywall_basic_post_types[]"
                            class="emoxie-select2" style="width: 75%" multiple="multiple">
                        <optgroup label="Available System Post Types">
							<?php foreach ( $this->all_post_types() as $post_type ): ?>
                                <option value="<?php echo $post_type; ?>" <?php if ( in_array( $post_type, (array) get_option( EXPANDABLE_PAYWALL_SLUG . '_paywall_basic_post_types' ) ) ): ?> selected="selected" <?php endif; ?>><?php echo $post_type; ?></option>
							<?php endforeach; ?>
                        </optgroup>
                    </select>
                </td>
            </tr>
            <tr valign="top">
                <th scope="row" class="titledesc">
                    <label for="<?php echo EXPANDABLE_PAYWALL_SLUG . '_paywall_basic_include_categories'; ?>"><?php _e( 'Show paywall to following categories.', 'expandable-paywall' ); ?></label>
                </th>
                <td class="forminp">
                    <select style="width: 75%" multiple="multiple"
                            id="<?php echo EXPANDABLE_PAYWALL_SLUG . '_paywall_basic_include_categories'; ?>"
                            name="<?php echo EXPANDABLE_PAYWALL_SLUG . '_paywall_basic_include_categories'; ?>[]" class="emoxie-select2">
						<?php echo Emoxie\Expandable_Paywall\Helper::get_categories_dropdown() ?>
                    </select>
                    <p class="description"><?php _e( 'Posts that are in these categories will show paywall to non-logged in members.', 'expandable-paywall' ); ?></p>
                </td>
            </tr>


            <tr valign="top">
                <th scope="row" class="titledesc">
                    <label><?php _e( 'Roles allowed to bypass paywall', 'expandable-paywall' ); ?></label>
                </th>
                <td class="forminp">
					<?php if ( is_multisite() ): ?>
                        <code>network_administrator</code>
					<?php endif; ?>
					<?php foreach ( \Emoxie\Expandable_Paywall\Helper::roles_that_bypass_paywall() as $role ): ?>
                        <code><?= $role; ?></code>
					<?php endforeach; ?>
                    <p class="description"><?php _e( 'These user roles will bypass the paywall no matter what.  These roles can be changed using the filter <code style="font-size:12px"> ' . EXPANDABLE_PAYWALL_SLUG . '_roles_that_bypass_paywall</code>', 'expandable-paywall' ); ?></p>
                </td>
            </tr>


            <tr valign="top">
                <th scope="row" class="titledesc" colspan="2">
                    <label for="<?php echo EXPANDABLE_PAYWALL_SLUG . '_paywall_basic_paywall_content'; ?>"><?php _e( 'Paywall Content', 'expandable-paywall' ); ?></label>
                    <br>
					<?php wp_editor( get_option( EXPANDABLE_PAYWALL_SLUG . '_paywall_basic_paywall_content', _x('<p style="text-align: center;">To continue reading this article you must be a subscriber.</p><hr /><p style="text-align: center;"><a href="{{login_url}}">Login</a> or <a href="{{register_url}}">Register</a></p>', 'expndable-paywall') ), EXPANDABLE_PAYWALL_SLUG . '_paywall_basic_paywall_content' ); ?>
                    <p class="description">
						<?php _e( '<strong>Note: </strong> You can use <code>{{login_url}}</code> and <code>{{register_url}}</code> tokens anywhere in the text above and they will be automatically replaced with the default wordpress login and registration urls.', 'registration-wall' ); ?>
                    </p>
                </th>
            </tr>
            <tr valign="top">
                <th scope="row" class="titledesc" colspan="2">
                    <label>
                        <input type="checkbox" value="1" class="<?php echo EXPANDABLE_PAYWALL_SLUG; ?>_paywall_show_locks" name="<?php echo EXPANDABLE_PAYWALL_SLUG; ?>_paywall_show_locks" <?php checked( get_option( EXPANDABLE_PAYWALL_SLUG . '_paywall_show_locks' ) ); ?>> <?php esc_attr_e( 'Show lock icon next to post title for locked articles', 'registration-wall' ); ?>
                    </label>
                    <p class="description">
		                <?php _e( 'Turning this on will display a Lock icon <span>&#x1F512;</span> next to each protected post TITLE.  You can use the filter <code>' . EXPANDABLE_PAYWALL_SLUG . '_locked_icon</code> to change the icon to whatever you would like.', 'wc_pay_per_post' ); ?>
                    </p>
                </th>
            </tr>
            <tr valign="top">
                <th scope="row" class="titledesc" colspan="2">
                    <label>
                        <input type="checkbox" value="1" class="<?php echo EXPANDABLE_PAYWALL_SLUG; ?>_paywall_show_fade" name="<?php echo EXPANDABLE_PAYWALL_SLUG; ?>_paywall_show_fade" <?php checked( get_option( EXPANDABLE_PAYWALL_SLUG . '_paywall_show_fade' ) ); ?>> <?php esc_attr_e( 'Fade out the excerpt text into the paywall?', 'registration-wall' ); ?>
                    </label>
                    <p class="description">
			            <?php _e( 'Turning this on will cause the excerpt text to fade out into the paywall.', 'wc_pay_per_post' ); ?>
                    </p>
                </th>
            </tr>
            <tr valign="top">
                <th scope="row" class="titledesc" colspan="2">
                    <label>
                        <input type="checkbox" value="1" class="<?php echo EXPANDABLE_PAYWALL_SLUG; ?>_paywall_enable_structured_data" name="<?php echo EXPANDABLE_PAYWALL_SLUG; ?>_paywall_enable_structured_data" <?php checked( get_option( EXPANDABLE_PAYWALL_SLUG . '_paywall_enable_structured_data' ) ); ?>> <?php esc_attr_e( 'Enable Structured Data for Search Engines?', 'registration-wall' ); ?>
                    </label>
                    <p class="description">
			            <?php _e( 'Turning this on will expose the protected content in the source of your page, it will not be viewable to the average user, but is viewable to search engines in a structured data format.  Read More at <a href="https://developers.google.com/search/docs/data-types/paywalled-content" target="_blank">https://developers.google.com/search/docs/data-types/paywalled-content</a>', 'wc_pay_per_post' ); ?>
                    </p>
                </th>
            </tr>




            </tbody>
        </table>
		<?php submit_button( __( 'Save Paywall Options', 'expandable-paywall' ) ); ?>
    </div>
</form>