<?php
/**
 * Copyright 2008 Chris Abernethy
 *
 * This file is part of Member Access.
 * 
 * Member Access is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Member Access is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Member Access.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
?>
<div class="wrap">

    <h2><?php echo wp_specialchars($this->heading) ?></h2>

    <form method="post" action="">

        <?php wp_nonce_field($this->nonce_action) ?>

        <table class="form-table">

            <tr valign="top">
                <th scope="row"><?php echo wp_specialchars(__('Page Settings', 'member_access')) ?></th>
                <td>

                    <label class="selectit"><input name="<?php echo attribute_escape($this->plugin_label . '_pages_private')?>" type="checkbox" value="1" <?php echo $this->pages_private ? 'checked="checked"' : ''?>/> <?php echo wp_specialchars(__('By default, only members can view pages', 'member_access')) ?></label>
                    <p><?php echo wp_specialchars(__('If this option is enabled, only members will be able to view pages. This setting can be overridden for individual pages.')) ?></p>

                    <label class="selectit"><input name="<?php echo attribute_escape($this->plugin_label . '_pages_redirect')?>" type="checkbox" value="1" <?php echo $this->pages_redirect ? 'checked="checked"' : ''?>/> <?php echo wp_specialchars(__('Perform redirect for non-members', 'member_access')) ?></label><br/>
                    <p>
                        <?php echo wp_specialchars(__('If a non-member accesses a page that is viewable only by members, should the user be redirected? If this option is enabled, the user will be redirected to the page chosen in the dropdown, otherwise, the standard "Not Found" page will be displayed.', 'member_access')) ?>
                    </p>
                    <p>
                        <select name="<?php echo attribute_escape($this->plugin_label . '_pages_redirect_page') ?>">
                            <option value="0"><?php echo wp_specialchars(__('Wordpress Login Page', 'member_access')) ?></option>
                            <?php parent_dropdown($this->pages_redirect_page) ?>
                        </select>
                    </p>
                    <p>
                        <?php echo wp_specialchars(__('Note that if you select "Wordpress Login Page" from the dropdown, the user will be sent back to the originally requested page after logging in.', 'member_access')) ?>
                    </p>

                </td>
            </tr>

            <tr valign="top">
                <th scope="row"><?php echo wp_specialchars(__('Post Settings', 'member_access')) ?></th>
                <td>

                    <label class="selectit"><input name="<?php echo attribute_escape($this->plugin_label . '_posts_private')?>" type="checkbox" value="1" <?php echo $this->posts_private ? 'checked="checked"' : ''?>/> <?php echo wp_specialchars(__('By default, only members can view posts', 'member_access')) ?></label>
                    <p><?php echo wp_specialchars(__('If this option is enabled, only members will be able to view posts. This setting can be overridden for individual posts.')) ?></p>

                    <label class="selectit"><input name="<?php echo attribute_escape($this->plugin_label . '_posts_redirect')?>" type="checkbox" value="1" <?php echo $this->posts_redirect ? 'checked="checked"' : ''?>/> <?php echo wp_specialchars(__('Perform redirect for non-members', 'member_access')) ?></label><br/>
                    <p>
                        <?php echo wp_specialchars(__('If a non-member accesses a post that is viewable only by members, should the user be redirected? If this option is enabled, the user will be redirected to the page chosen in the dropdown, otherwise, the standard "Not Found" page will be displayed.', 'member_access')) ?>
                    </p>
                    <p>
                        <select name="<?php echo attribute_escape($this->plugin_label . '_posts_redirect_page') ?>">
                            <option value="0"><?php echo wp_specialchars(__('Wordpress Login Page', 'member_access')) ?></option>
                            <?php parent_dropdown($this->posts_redirect_page) ?>
                        </select>
                    </p>
                    <p>
                        <?php echo wp_specialchars(__('Note that if you select "Wordpress Login Page" from the dropdown, the user will be sent back to the originally requested page after logging in.', 'member_access')) ?>
                    </p>

                </td>
            </tr>

            <tr valign="top">
                <th scope="row"><?php echo wp_specialchars(__('Posts Page Settings', 'member_access')) ?></th>
                <td>

                    <label class="selectit"><input name="<?php echo attribute_escape($this->plugin_label . '_postspage_excerpts')?>" type="checkbox" value="1" <?php echo $this->postspage_excerpts ? 'checked="checked"' : ''?>/> <?php echo wp_specialchars(__('Posts page includes excerpts of content viewable only by members', 'member_access')) ?></label>
                    <p><?php echo wp_specialchars(__('Your posts page is configured in Settings->Reading, and is either your home page when you elect to display your latest posts on the home page, or it is the static page that you designate as your posts page. Do you want your posts page to include excerpts of items that are viewable only by members? If this option is not enabled, these items will be omitted entirely from your posts page.')) ?></p>

                    <label class="selectit"><input name="<?php echo attribute_escape($this->plugin_label . '_postspage_redirect')?>" type="checkbox" value="1" <?php echo $this->postspage_redirect ? 'checked="checked"' : ''?>/> <?php echo wp_specialchars(__('Perform redirect if all available posts page items are viewable only by members', 'member_access')) ?></label><br/>
                    <p>
                        <?php echo wp_specialchars(__('If a non-member accesses the posts page, all items are viewable only to members, and you have not opted to include excerpts of those items on the posts page pages, should the user be redirected? If this option is enabled, the user will be redirected to the page chosen in the dropdown, otherwise, the standard "Not Found" page will be displayed.', 'member_access')) ?>
                    </p>
                    <p>
                        <select name="<?php echo attribute_escape($this->plugin_label . '_postspage_redirect_page') ?>">
                            <option value="0"><?php echo wp_specialchars(__('Wordpress Login Page', 'member_access')) ?></option>
                            <?php parent_dropdown($this->postspate_redirect_page) ?>
                        </select>
                    </p>
                    <p>
                        <?php echo wp_specialchars(__('Note that if you select "Wordpress Login Page" from the dropdown, the user will be sent back to the posts page after logging in.', 'member_access')) ?>
                    </p>

                </td>
            </tr>

            <tr valign="top">
                <th scope="row"><?php echo wp_specialchars(__('Archive Settings', 'member_access')) ?></th>
                <td>

                    <label class="selectit"><input name="<?php echo attribute_escape($this->plugin_label . '_archive_excerpts')?>" type="checkbox" value="1" <?php echo $this->archive_excerpts ? 'checked="checked"' : ''?>/> <?php echo wp_specialchars(__('Archive pages include excerpts of content viewable only by members', 'member_access')) ?></label>
                    <p><?php echo wp_specialchars(__('Do you want archive pages to include excerpts of items that are viewable only by members? If this option is not enabled, these items will be omitted entirely from archive pages.')) ?></p>

                    <label class="selectit"><input name="<?php echo attribute_escape($this->plugin_label . '_archive_redirect')?>" type="checkbox" value="1" <?php echo $this->archive_redirect ? 'checked="checked"' : ''?>/> <?php echo wp_specialchars(__('Perform redirect if all available archive items are viewable only by members', 'member_access')) ?></label><br/>
                    <p>
                        <?php echo wp_specialchars(__('If a non-member accesses an archive page for which all items are viewable only to members, and you have not opted to include excerpts of those items on archive pages, should the user be redirected? If this option is enabled, the user will be redirected to the page chosen in the dropdown, otherwise, the standard "Not Found" page will be displayed.', 'member_access')) ?>
                    </p>
                    <p>
                        <select name="<?php echo attribute_escape($this->plugin_label . '_archive_redirect_page') ?>">
                            <option value="0"><?php echo wp_specialchars(__('Wordpress Login Page', 'member_access')) ?></option>
                            <?php parent_dropdown($this->archive_redirect_page) ?>
                        </select>
                    </p>
                    <p>
                        <?php echo wp_specialchars(__('Note that if you select "Wordpress Login Page" from the dropdown, the user will be sent back to the originally requested page after logging in.', 'member_access')) ?>
                    </p>

                </td>
            </tr>

            <tr valign="top">
                <th scope="row"><?php echo wp_specialchars(__('Search Settings', 'member_access')) ?></th>
                <td>

                    <label class="selectit"><input name="<?php echo attribute_escape($this->plugin_label . '_search_excerpts')?>" type="checkbox" value="1" <?php echo $this->search_excerpts ? 'checked="checked"' : ''?>/> <?php echo wp_specialchars(__('Search results include excerpts of content viewable only by members', 'member_access')) ?></label>
                    <p><?php echo wp_specialchars(__('Do you want search results to include excerpts of items viewable only by members? If this option is not enabled, these items will be omitted entirely from search results.')) ?></p>

                    <label class="selectit"><input name="<?php echo attribute_escape($this->plugin_label . '_search_redirect')?>" type="checkbox" value="1" <?php echo $this->search_redirect ? 'checked="checked"' : ''?>/> <?php echo wp_specialchars(__('Perform redirect if all search results are viewable only by members', 'member_access')) ?></label><br/>
                    <p>
                        <?php echo wp_specialchars(__('If a non-member performs a search for which all results are viewable only to members, and you have not opted to include excerpts of those items in search results, should the user be redirected? If this option is enabled, the user will be redirected to the page chosen in the dropdown, otherwise, the standard "Not Found" page will be displayed.', 'member_access')) ?>
                    </p>
                    <p>
                        <select name="<?php echo attribute_escape($this->plugin_label . '_search_redirect_page') ?>">
                            <option value="0"><?php echo wp_specialchars(__('Wordpress Login Page', 'member_access')) ?></option>
                            <?php parent_dropdown($this->search_redirect_page) ?>
                        </select>
                    </p>
                    <p>
                        <?php echo wp_specialchars(__('Note that if you select "Wordpress Login Page" from the dropdown, the user will be sent back to the original search result listing after logging in.', 'member_access')) ?>
                    </p>

                </td>
            </tr>

            <tr valign="top">
                <th scope="row"><?php echo wp_specialchars(__('RSS Settings', 'member_access')) ?></th>
                <td>

                    <label class="selectit"><input name="<?php echo attribute_escape($this->plugin_label . '_rss_excerpts')?>" type="checkbox" value="1" <?php echo $this->rss_excerpts ? 'checked="checked"' : ''?>/> <?php echo wp_specialchars(__('RSS feeds include excerpts of content viewable only by members', 'member_access')) ?></label>
                    <p><?php echo wp_specialchars(__('Do you want RSS feeds to include excerpts of items viewable only by members? If this option is not enabled, these items will be omitted entirely from RSS feeds.')) ?></p>

                </td>
            </tr>

        </table>

        <input type="hidden" name="action" value="update"/>

        <p class="submit">
            <input type="submit" name="<?php echo attribute_escape($this->plugin_label . '_submit') ?>" value="<?php echo wp_specialchars(__('Save Changes', 'member_access')) ?>" />
            <input type="submit" name="<?php echo attribute_escape($this->plugin_label . '_clear_post_overrides') ?>" value="<?php echo wp_specialchars(__('Clear Post Overrides', 'member_access')) ?>" />
            <input type="submit" name="<?php echo attribute_escape($this->plugin_label . '_clear_page_overrides') ?>" value="<?php echo wp_specialchars(__('Clear Page Overrides', 'member_access')) ?>" />
        </p>

    </form>

</div>
