function step_pages()
    {
        global $bp, $nxtdb;
        // Make sure that page info is pulled from bp_get_root_blog_id() (except when in
        // multisite mode)
        if (!empty($nxtdb->blogid) && $nxtdb->blogid != bp_get_root_blog_id() && !defined('BP_ENABLE_MULTIBLOG')) {
            switch_to_blog(bp_get_root_blog_id());
        }
        if (!current_user_can('activate_plugins')) {
            return false;
        }
        $existing_pages = bp_core_update_get_page_meta();
        // Provide empty indexes to avoid PHP errors with nxt_dropdown_pages()
        $indexes = array('members', 'activity', 'groups', 'forums', 'blogs', 'register', 'activate');
        foreach ($indexes as $index) {
            if (!isset($existing_pages[$index])) {
                $existing_pages[$index] = '';
            }
        }
        if (!empty($existing_pages['blogs'])) {
            $existing_blog_page = '&selected=' . $existing_pages['blogs'];
        } else {
            $existing_blog_page = '';
        }
        // Get active components
        $active_components = apply_filters('bp_active_components', bp_get_option('bp-active-components'));
        // Check for defined slugs
        $members_slug = !empty($bp->members->slug) ? $bp->members->slug : __('members', 'buddypress');
        // Groups
        $groups_slug = !empty($bp->groups->slug) ? $bp->groups->slug : __('groups', 'buddypress');
        // Activity
        $activity_slug = !empty($bp->activity->slug) ? $bp->activity->slug : __('activity', 'buddypress');
        // Forums
        $forums_slug = !empty($bp->forums->slug) ? $bp->forums->slug : __('forums', 'buddypress');
        // Blogs
        $blogs_slug = !empty($bp->blogs->slug) ? $bp->blogs->slug : __('blogs', 'buddypress');
        // Register
        $register_slug = !empty($bp->register->slug) ? $bp->register->slug : __('register', 'buddypress');
        // Activation
        $activation_slug = !empty($bp->activation->slug) ? $bp->activation->slug : __('activate', 'buddypress');
        ?>

		<script type="text/javascript">
			jQuery( document ).ready( function() {
				jQuery( 'select' ).change( function() {
					jQuery( this ).siblings( 'input[@type=radio]' ).click();
				});
			});
		</script>

		<p><?php 
        _e('BuddyPress now uses NXTClass pages to display content. This allows you to easily change the names of pages or move them to a sub page.', 'buddypress');
        ?>
</p>

		<p><?php 
        _e('Either choose an existing page or let BuddyPress auto-create pages for you. To manually create custom pages, come back to this step once you are finished.', 'buddypress');
        ?>
</p>

		<p><strong><?php 
        _e('Please Note:', 'buddypress');
        ?>
</strong> <?php 
        _e('If you have manually added BuddyPress navigation links in your theme you may need to remove these from your header.php to avoid duplicate links.', 'buddypress');
        ?>
</p>

		<table class="form-table">

			<tr valign="top">
				<th scope="row">
					<h5><?php 
        _e('Members', 'buddypress');
        ?>
</h5>
					<p><?php 
        _e('Displays member profiles, and a directory of all site members.', 'buddypress');
        ?>
</p>
				</th>
				<td>
					<p><label><input type="radio" name="bp_pages[members]" <?php 
        checked(empty($existing_pages['members']));
        ?>
  value="<?php 
        echo $members_slug;
        ?>
" /> <?php 
        _e('Automatically create a page at:', 'buddypress');
        ?>
 <?php 
        echo home_url($members_slug);
        ?>
/</label></p>
					<p><label><input type="radio" name="bp_pages[members]" <?php 
        checked(!empty($existing_pages['members']));
        ?>
 value="page" /> <?php 
        _e('Use an existing page:', 'buddypress');
        ?>
 <?php 
        echo nxt_dropdown_pages("name=bp-members-page&echo=0&show_option_none=" . __('- Select -', 'buddypress') . "&selected=" . $existing_pages['members']);
        ?>
</label></p>
				</td>
			</tr>

			<?php 
        if (isset($active_components['activity'])) {
            ?>

				<tr valign="top">
					<th scope="row">
						<h5><?php 
            _e('Site Activity', 'buddypress');
            ?>
</h5>
						<p><?php 
            _e("Displays the activity for the entire site, a member's friends, groups and @mentions.", 'buddypress');
            ?>
</p>
					</th>
					<td>
						<p><label><input type="radio" name="bp_pages[activity]" <?php 
            checked(empty($existing_pages['activity']));
            ?>
  value="<?php 
            echo $activity_slug;
            ?>
" /> <?php 
            _e('Automatically create a page at:', 'buddypress');
            ?>
 <?php 
            echo home_url($activity_slug);
            ?>
/</label></p>
						<p><label><input type="radio" name="bp_pages[activity]" <?php 
            checked(!empty($existing_pages['activity']));
            ?>
 value="page" /> <?php 
            _e('Use an existing page:', 'buddypress');
            ?>
 <?php 
            echo nxt_dropdown_pages("name=bp-activity-page&echo=0&show_option_none=" . __('- Select -', 'buddypress') . "&selected=" . $existing_pages['activity']);
            ?>
</label></p>
					</td>
				</tr>

			<?php 
        }
        ?>

			<?php 
        if (isset($active_components['groups'])) {
            ?>

				<tr valign="top">
					<th scope="row">
						<h5><?php 
            _e('Groups', 'buddypress');
            ?>
</h5>
						<p><?php 
            _e('Displays individual groups as well as a directory of groups.', 'buddypress');
            ?>
</p>
					</th>
					<td>
						<p><label><input type="radio" name="bp_pages[groups]" <?php 
            checked(empty($existing_pages['groups']));
            ?>
  value="<?php 
            echo $groups_slug;
            ?>
" /> <?php 
            _e('Automatically create a page at:', 'buddypress');
            ?>
 <?php 
            echo home_url($groups_slug);
            ?>
/</label></p>
						<p><label><input type="radio" name="bp_pages[groups]" <?php 
            checked(!empty($existing_pages['groups']));
            ?>
 value="page" /> <?php 
            _e('Use an existing page:', 'buddypress');
            ?>
 <?php 
            echo nxt_dropdown_pages("name=bp-groups-page&echo=0&show_option_none=" . __('- Select -', 'buddypress') . "&selected=" . $existing_pages['groups']);
            ?>
</label></p>
					</td>
				</tr>

			<?php 
        }
        ?>

			<?php 
        if (isset($active_components['forums'])) {
            ?>

				<tr valign="top">
					<th scope="row">
						<h5><?php 
            _e('Forums', 'buddypress');
            ?>
</h5>
						<p><?php 
            _e('Displays a directory of public forum topics.', 'buddypress');
            ?>
</p>
					</th>
					<td>
						<p><label><input type="radio" name="bp_pages[forums]" <?php 
            checked(empty($existing_pages['forums']));
            ?>
  value="<?php 
            echo $forums_slug;
            ?>
" /> <?php 
            _e('Automatically create a page at:', 'buddypress');
            ?>
 <?php 
            echo home_url($forums_slug);
            ?>
/</label></p>
						<p><label><input type="radio" name="bp_pages[forums]" <?php 
            checked(!empty($existing_pages['forums']));
            ?>
 value="page" /> <?php 
            _e('Use an existing page:', 'buddypress');
            ?>
 <?php 
            echo nxt_dropdown_pages("name=bp-forums-page&echo=0&show_option_none=" . __('- Select -', 'buddypress') . "&selected=" . $existing_pages['forums']);
            ?>
</label></p>
					</td>
				</tr>

			<?php 
        }
        ?>

			<?php 
        /* The Blogs component only needs a directory page when Multisite is enabled */
        ?>
			<?php 
        if (is_multisite() && isset($active_components['blogs'])) {
            ?>

				<tr valign="top">
					<th scope="row">
						<h5><?php 
            _e('Sites', 'buddypress');
            ?>
</h5>
						<p><?php 
            _e('Displays a directory of the sites in your network.', 'buddypress');
            ?>
</p>
					</th>
					<td>
						<p><label><input type="radio" name="bp_pages[blogs]" <?php 
            checked(empty($existing_pages['blogs']));
            ?>
  value="<?php 
            echo $blogs_slug;
            ?>
" /> <?php 
            _e('Automatically create a page at:', 'buddypress');
            ?>
 <?php 
            echo home_url($blogs_slug);
            ?>
/</label></p>
						<p><label><input type="radio" name="bp_pages[blogs]" <?php 
            checked(!empty($existing_pages['blogs']));
            ?>
 value="page" /> <?php 
            _e('Use an existing page:', 'buddypress');
            ?>
 <?php 
            echo nxt_dropdown_pages("name=bp-blogs-page&echo=0&show_option_none=" . __('- Select -', 'buddypress') . "&selected=" . $existing_pages['blogs']);
            ?>
</label></p>
					</td>
				</tr>

			<?php 
        }
        ?>

			<tr valign="top">
				<th scope="row">
					<h5><?php 
        _e('Register', 'buddypress');
        ?>
</h5>
					<p><?php 
        _e('Displays a site registration page where users can create new accounts.', 'buddypress');
        ?>
</p>
				</th>
				<td>
					<p><label><input type="radio" name="bp_pages[register]" <?php 
        checked(empty($existing_pages['register']));
        ?>
  value="<?php 
        echo $register_slug;
        ?>
" /> <?php 
        _e('Automatically create a page at:', 'buddypress');
        ?>
 <?php 
        echo home_url($register_slug);
        ?>
/</label></p>
					<p><label><input type="radio" name="bp_pages[register]" <?php 
        checked(!empty($existing_pages['register']));
        ?>
 value="page" /> <?php 
        _e('Use an existing page:', 'buddypress');
        ?>
 <?php 
        echo nxt_dropdown_pages("name=bp-register-page&echo=0&show_option_none=" . __('- Select -', 'buddypress') . "&selected=" . $existing_pages['register']);
        ?>
</label></p>
				</td>
			</tr>

			<tr valign="top">
				<th scope="row">
					<h5><?php 
        _e('Activate', 'buddypress');
        ?>
</h5>
					<p><?php 
        _e('The page users will visit to activate their account once they have registered.', 'buddypress');
        ?>
</p>
				</th>
				<td>
					<p><label><input type="radio" name="bp_pages[activate]" <?php 
        checked(empty($existing_pages['activate']));
        ?>
  value="<?php 
        echo $activation_slug;
        ?>
" /> <?php 
        _e('Automatically create a page at:', 'buddypress');
        ?>
 <?php 
        echo home_url($activation_slug);
        ?>
/</label></p>
					<p><label><input type="radio" name="bp_pages[activate]" <?php 
        checked(!empty($existing_pages['activate']));
        ?>
 value="page" /> <?php 
        _e('Use an existing page:', 'buddypress');
        ?>
 <?php 
        echo nxt_dropdown_pages("name=bp-activate-page&echo=0&show_option_none=" . __('- Select -', 'buddypress') . "&selected=" . $existing_pages['activate']);
        ?>
</label></p>
				</td>
			</tr>
		</table>

		<div class="submit clear">
			<input type="hidden" name="save" value="pages" />
			<input type="hidden" name="step" value="<?php 
        echo esc_attr($this->current_step);
        ?>
" />

			<?php 
        nxt_nonce_field('bpwizard_pages');
        ?>

		</div>

		<?php 
        restore_current_blog();
    }
Beispiel #2
0
		<input name="show_on_front" type="radio" value="page" class="tog" <?php 
    checked('page', get_option('show_on_front'));
    ?>
 />
		<?php 
    printf(__('A <a href="%s">static page</a> (select below)'), 'edit.php?post_type=page');
    ?>
	</label>
	</p>
<ul>
	<li><label for="page_on_front"><?php 
    printf(__('Front page: %s'), nxt_dropdown_pages(array('name' => 'page_on_front', 'echo' => 0, 'show_option_none' => __('&mdash; Select &mdash;'), 'option_none_value' => '0', 'selected' => get_option('page_on_front'))));
    ?>
</label></li>
	<li><label for="page_for_posts"><?php 
    printf(__('Posts page: %s'), nxt_dropdown_pages(array('name' => 'page_for_posts', 'echo' => 0, 'show_option_none' => __('&mdash; Select &mdash;'), 'option_none_value' => '0', 'selected' => get_option('page_for_posts'))));
    ?>
</label></li>
</ul>
<?php 
    if ('page' == get_option('show_on_front') && get_option('page_for_posts') == get_option('page_on_front')) {
        ?>
<div id="front-page-warning" class="error inline"><p><?php 
        _e('<strong>Warning:</strong> these pages should not be the same!');
        ?>
</p></div>
<?php 
    }
    ?>
</fieldset></td>
</tr>
/**
 * Creates reusable markup for page setup on the Components and Pages dashboard panel.
 *
 * This markup has been abstracted so that it can be used both during the setup wizard as well as
 * when BP has been fully installed.
 *
 * @package BuddyPress Core
 * @since 1.5
 */
function bp_core_admin_page_options()
{
    global $bp;
    // Get the existing nxt pages
    $existing_pages = bp_core_get_directory_page_ids();
    // Set up an array of components (along with component names) that have
    // directory pages.
    $directory_pages = array();
    foreach ($bp->loaded_components as $component_slug => $component_id) {
        // Only components that need directories should be listed here
        if (isset($bp->{$component_id}) && !empty($bp->{$component_id}->has_directory)) {
            // component->name was introduced in BP 1.5, so we must provide a fallback
            $component_name = !empty($bp->{$component_id}->name) ? $bp->{$component_id}->name : ucwords($component_id);
            $directory_pages[$component_id] = $component_name;
        }
    }
    $directory_pages = apply_filters('bp_directory_pages', $directory_pages);
    ?>

	<h3><?php 
    _e('Directories', 'buddypress');
    ?>
</h3>

	<p><?php 
    _e('Associate a NXTClass Page with each BuddyPress component directory.', 'buddypress');
    ?>
</p>

	<table class="form-table">
		<tbody>

			<?php 
    foreach ($directory_pages as $name => $label) {
        ?>
				<?php 
        $disabled = !bp_is_active($name) ? ' disabled="disabled"' : '';
        ?>

				<tr valign="top">
					<th scope="row">
						<label for="bp_pages[<?php 
        echo esc_attr($name);
        ?>
]"><?php 
        echo esc_html($label);
        ?>
</label>
					</th>

					<td>
						<?php 
        if (!bp_is_root_blog()) {
            switch_to_blog(bp_get_root_blog_id());
        }
        ?>

						<?php 
        echo nxt_dropdown_pages(array('name' => 'bp_pages[' . esc_attr($name) . ']', 'echo' => false, 'show_option_none' => __('- None -', 'buddypress'), 'selected' => !empty($existing_pages[$name]) ? $existing_pages[$name] : false));
        ?>

						<a href="<?php 
        echo admin_url(add_query_arg(array('post_type' => 'page'), 'post-new.php'));
        ?>
" class="button-secondary"><?php 
        _e('New Page');
        ?>
</a>
						<input class="button-primary" type="submit" name="bp-admin-pages-single" value="<?php 
        _e('Save', 'buddypress');
        ?>
" />

						<?php 
        if (!empty($existing_pages[$name])) {
            ?>

							<a href="<?php 
            echo get_permalink($existing_pages[$name]);
            ?>
" class="button-secondary" target="_bp"><?php 
            _e('View');
            ?>
</a>

						<?php 
        }
        ?>

						<?php 
        if (!bp_is_root_blog()) {
            restore_current_blog();
        }
        ?>

					</td>
				</tr>


			<?php 
    }
    ?>

			<?php 
    do_action('bp_active_external_directories');
    ?>

		</tbody>
	</table>

	<?php 
    // Static pages
    $static_pages = array('register' => __('Register', 'buddypress'), 'activate' => __('Activate', 'buddypress'));
    ?>

	<h3><?php 
    _e('Registration', 'buddypress');
    ?>
</h3>

	<p><?php 
    _e('Associate NXTClass Pages with the following BuddyPress Registration pages.', 'buddypress');
    ?>
</p>

	<table class="form-table">
		<tbody>

			<?php 
    foreach ($static_pages as $name => $label) {
        ?>

				<tr valign="top">
					<th scope="row">
						<label for="bp_pages[<?php 
        echo esc_attr($name);
        ?>
]"><?php 
        echo esc_html($label);
        ?>
</label>
					</th>

					<td>
						<?php 
        echo nxt_dropdown_pages(array('name' => 'bp_pages[' . esc_attr($name) . ']', 'echo' => false, 'show_option_none' => __('- None -', 'buddypress'), 'selected' => !empty($existing_pages[$name]) ? $existing_pages[$name] : false));
        ?>

						<a href="<?php 
        echo admin_url(add_query_arg(array('post_type' => 'page'), 'post-new.php'));
        ?>
" class="button-secondary"><?php 
        _e('New Page');
        ?>
</a>
						<input class="button-primary" type="submit" name="bp-admin-pages-single" value="<?php 
        _e('Save', 'buddypress');
        ?>
" />

						<?php 
        if (!empty($existing_pages[$name])) {
            ?>

							<a href="<?php 
            echo get_permalink($existing_pages[$name]);
            ?>
" class="button-secondary" target="_bp"><?php 
            _e('View');
            ?>
</a>

						<?php 
        }
        ?>

					</td>
				</tr>

			<?php 
    }
    ?>

			<?php 
    do_action('bp_active_external_pages');
    ?>

		</tbody>
	</table>

	<?php 
}
    /**
     * Outputs the hidden row displayed when inline editing
     *
     * @since 3.1.0
     */
    function inline_edit()
    {
        global $mode;
        $screen = get_current_screen();
        $post = get_default_post_to_edit($screen->post_type);
        $post_type_object = get_post_type_object($screen->post_type);
        $taxonomy_names = get_object_taxonomies($screen->post_type);
        $hierarchical_taxonomies = array();
        $flat_taxonomies = array();
        foreach ($taxonomy_names as $taxonomy_name) {
            $taxonomy = get_taxonomy($taxonomy_name);
            if (!$taxonomy->show_ui) {
                continue;
            }
            if ($taxonomy->hierarchical) {
                $hierarchical_taxonomies[] = $taxonomy;
            } else {
                $flat_taxonomies[] = $taxonomy;
            }
        }
        $m = isset($mode) && 'excerpt' == $mode ? 'excerpt' : 'list';
        $can_publish = current_user_can($post_type_object->cap->publish_posts);
        $core_columns = array('cb' => true, 'date' => true, 'title' => true, 'categories' => true, 'tags' => true, 'comments' => true, 'author' => true);
        ?>

	<form method="get" action=""><table style="display: none"><tbody id="inlineedit">
		<?php 
        $hclass = count($hierarchical_taxonomies) ? 'post' : 'page';
        $bulk = 0;
        while ($bulk < 2) {
            ?>

		<tr id="<?php 
            echo $bulk ? 'bulk-edit' : 'inline-edit';
            ?>
" class="inline-edit-row inline-edit-row-<?php 
            echo "{$hclass} inline-edit-{$screen->post_type} ";
            echo $bulk ? "bulk-edit-row bulk-edit-row-{$hclass} bulk-edit-{$screen->post_type}" : "quick-edit-row quick-edit-row-{$hclass} inline-edit-{$screen->post_type}";
            ?>
" style="display: none"><td colspan="<?php 
            echo $this->get_column_count();
            ?>
" class="colspanchange">

		<fieldset class="inline-edit-col-left"><div class="inline-edit-col">
			<h4><?php 
            echo $bulk ? __('Bulk Edit') : __('Quick Edit');
            ?>
</h4>
	<?php 
            if (post_type_supports($screen->post_type, 'title')) {
                if ($bulk) {
                    ?>
			<div id="bulk-title-div">
				<div id="bulk-titles"></div>
			</div>

	<?php 
                } else {
                    // $bulk
                    ?>

			<label>
				<span class="title"><?php 
                    _e('Title');
                    ?>
</span>
				<span class="input-text-wrap"><input type="text" name="post_title" class="ptitle" value="" /></span>
			</label>

			<label>
				<span class="title"><?php 
                    _e('Slug');
                    ?>
</span>
				<span class="input-text-wrap"><input type="text" name="post_name" value="" /></span>
			</label>

	<?php 
                }
                // $bulk
            }
            // post_type_supports title
            ?>

	<?php 
            if (!$bulk) {
                ?>
			<label><span class="title"><?php 
                _e('Date');
                ?>
</span></label>
			<div class="inline-edit-date">
				<?php 
                touch_time(1, 1, 4, 1);
                ?>
			</div>
			<br class="clear" />
	<?php 
            }
            // $bulk
            if (post_type_supports($screen->post_type, 'author')) {
                $authors_dropdown = '';
                if (is_super_admin() || current_user_can($post_type_object->cap->edit_others_posts)) {
                    $users_opt = array('hide_if_only_one_author' => false, 'who' => 'authors', 'name' => 'post_author', 'class' => 'authors', 'multi' => 1, 'echo' => 0);
                    if ($bulk) {
                        $users_opt['show_option_none'] = __('&mdash; No Change &mdash;');
                    }
                    if ($authors = nxt_dropdown_users($users_opt)) {
                        $authors_dropdown = '<label class="inline-edit-author">';
                        $authors_dropdown .= '<span class="title">' . __('Author') . '</span>';
                        $authors_dropdown .= $authors;
                        $authors_dropdown .= '</label>';
                    }
                }
                // authors
                ?>

	<?php 
                if (!$bulk) {
                    echo $authors_dropdown;
                }
            }
            // post_type_supports author
            if (!$bulk) {
                ?>

			<div class="inline-edit-group">
				<label class="alignleft">
					<span class="title"><?php 
                _e('Password');
                ?>
</span>
					<span class="input-text-wrap"><input type="text" name="post_password" class="inline-edit-password-input" value="" /></span>
				</label>

				<em style="margin:5px 10px 0 0" class="alignleft">
					<?php 
                /* translators: Between password field and private checkbox on post quick edit interface */
                echo __('&ndash;OR&ndash;');
                ?>
				</em>
				<label class="alignleft inline-edit-private">
					<input type="checkbox" name="keep_private" value="private" />
					<span class="checkbox-title"><?php 
                echo __('Private');
                ?>
</span>
				</label>
			</div>

	<?php 
            }
            ?>

		</div></fieldset>

	<?php 
            if (count($hierarchical_taxonomies) && !$bulk) {
                ?>

		<fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col">

	<?php 
                foreach ($hierarchical_taxonomies as $taxonomy) {
                    ?>

			<span class="title inline-edit-categories-label"><?php 
                    echo esc_html($taxonomy->labels->name);
                    ?>
				<span class="catshow"><?php 
                    _e('[more]');
                    ?>
</span>
				<span class="cathide" style="display:none;"><?php 
                    _e('[less]');
                    ?>
</span>
			</span>
			<input type="hidden" name="<?php 
                    echo $taxonomy->name == 'category' ? 'post_category[]' : 'tax_input[' . esc_attr($taxonomy->name) . '][]';
                    ?>
" value="0" />
			<ul class="cat-checklist <?php 
                    echo esc_attr($taxonomy->name);
                    ?>
-checklist">
				<?php 
                    nxt_terms_checklist(null, array('taxonomy' => $taxonomy->name));
                    ?>
			</ul>

	<?php 
                }
                //$hierarchical_taxonomies as $taxonomy
                ?>

		</div></fieldset>

	<?php 
            }
            // count( $hierarchical_taxonomies ) && !$bulk
            ?>

		<fieldset class="inline-edit-col-right"><div class="inline-edit-col">

	<?php 
            if (post_type_supports($screen->post_type, 'author') && $bulk) {
                echo $authors_dropdown;
            }
            if (post_type_supports($screen->post_type, 'page-attributes')) {
                if ($post_type_object->hierarchical) {
                    ?>
			<label>
				<span class="title"><?php 
                    _e('Parent');
                    ?>
</span>
	<?php 
                    $dropdown_args = array('post_type' => $post_type_object->name, 'selected' => $post->post_parent, 'name' => 'post_parent', 'show_option_none' => __('Main Page (no parent)'), 'option_none_value' => 0, 'sort_column' => 'menu_order, post_title');
                    if ($bulk) {
                        $dropdown_args['show_option_no_change'] = __('&mdash; No Change &mdash;');
                    }
                    $dropdown_args = apply_filters('quick_edit_dropdown_pages_args', $dropdown_args);
                    nxt_dropdown_pages($dropdown_args);
                    ?>
			</label>

	<?php 
                }
                // hierarchical
                if (!$bulk) {
                    ?>

			<label>
				<span class="title"><?php 
                    _e('Order');
                    ?>
</span>
				<span class="input-text-wrap"><input type="text" name="menu_order" class="inline-edit-menu-order-input" value="<?php 
                    echo $post->menu_order;
                    ?>
" /></span>
			</label>

	<?php 
                }
                // !$bulk
                if ('page' == $screen->post_type) {
                    ?>

			<label>
				<span class="title"><?php 
                    _e('Template');
                    ?>
</span>
				<select name="page_template">
	<?php 
                    if ($bulk) {
                        ?>
					<option value="-1"><?php 
                        _e('&mdash; No Change &mdash;');
                        ?>
</option>
	<?php 
                    }
                    // $bulk
                    ?>
					<option value="default"><?php 
                    _e('Default Template');
                    ?>
</option>
					<?php 
                    page_template_dropdown();
                    ?>
				</select>
			</label>

	<?php 
                }
                // page post_type
            }
            // page-attributes
            ?>

	<?php 
            if (count($flat_taxonomies) && !$bulk) {
                ?>

	<?php 
                foreach ($flat_taxonomies as $taxonomy) {
                    ?>
		<?php 
                    if (current_user_can($taxonomy->cap->assign_terms)) {
                        ?>
			<label class="inline-edit-tags">
				<span class="title"><?php 
                        echo esc_html($taxonomy->labels->name);
                        ?>
</span>
				<textarea cols="22" rows="1" name="tax_input[<?php 
                        echo esc_attr($taxonomy->name);
                        ?>
]" class="tax_input_<?php 
                        echo esc_attr($taxonomy->name);
                        ?>
"></textarea>
			</label>
		<?php 
                    }
                    ?>

	<?php 
                }
                //$flat_taxonomies as $taxonomy
                ?>

	<?php 
            }
            // count( $flat_taxonomies ) && !$bulk
            ?>

	<?php 
            if (post_type_supports($screen->post_type, 'comments') || post_type_supports($screen->post_type, 'trackbacks')) {
                if ($bulk) {
                    ?>

			<div class="inline-edit-group">
		<?php 
                    if (post_type_supports($screen->post_type, 'comments')) {
                        ?>
			<label class="alignleft">
				<span class="title"><?php 
                        _e('Comments');
                        ?>
</span>
				<select name="comment_status">
					<option value=""><?php 
                        _e('&mdash; No Change &mdash;');
                        ?>
</option>
					<option value="open"><?php 
                        _e('Allow');
                        ?>
</option>
					<option value="closed"><?php 
                        _e('Do not allow');
                        ?>
</option>
				</select>
			</label>
		<?php 
                    }
                    if (post_type_supports($screen->post_type, 'trackbacks')) {
                        ?>
			<label class="alignright">
				<span class="title"><?php 
                        _e('Pings');
                        ?>
</span>
				<select name="ping_status">
					<option value=""><?php 
                        _e('&mdash; No Change &mdash;');
                        ?>
</option>
					<option value="open"><?php 
                        _e('Allow');
                        ?>
</option>
					<option value="closed"><?php 
                        _e('Do not allow');
                        ?>
</option>
				</select>
			</label>
		<?php 
                    }
                    ?>
			</div>

	<?php 
                } else {
                    // $bulk
                    ?>

			<div class="inline-edit-group">
			<?php 
                    if (post_type_supports($screen->post_type, 'comments')) {
                        ?>
				<label class="alignleft">
					<input type="checkbox" name="comment_status" value="open" />
					<span class="checkbox-title"><?php 
                        _e('Allow Comments');
                        ?>
</span>
				</label>
			<?php 
                    }
                    if (post_type_supports($screen->post_type, 'trackbacks')) {
                        ?>
				<label class="alignleft">
					<input type="checkbox" name="ping_status" value="open" />
					<span class="checkbox-title"><?php 
                        _e('Allow Pings');
                        ?>
</span>
				</label>
			<?php 
                    }
                    ?>
			</div>

	<?php 
                }
                // $bulk
            }
            // post_type_supports comments or pings
            ?>

			<div class="inline-edit-group">
				<label class="inline-edit-status alignleft">
					<span class="title"><?php 
            _e('Status');
            ?>
</span>
					<select name="_status">
	<?php 
            if ($bulk) {
                ?>
						<option value="-1"><?php 
                _e('&mdash; No Change &mdash;');
                ?>
</option>
	<?php 
            }
            // $bulk
            ?>
					<?php 
            if ($can_publish) {
                // Contributors only get "Unpublished" and "Pending Review"
                ?>
						<option value="publish"><?php 
                _e('Published');
                ?>
</option>
						<option value="future"><?php 
                _e('Scheduled');
                ?>
</option>
	<?php 
                if ($bulk) {
                    ?>
						<option value="private"><?php 
                    _e('Private');
                    ?>
</option>
	<?php 
                }
                // $bulk
                ?>
					<?php 
            }
            ?>
						<option value="pending"><?php 
            _e('Pending Review');
            ?>
</option>
						<option value="draft"><?php 
            _e('Draft');
            ?>
</option>
					</select>
				</label>

	<?php 
            if ('post' == $screen->post_type && $can_publish && current_user_can($post_type_object->cap->edit_others_posts)) {
                ?>

	<?php 
                if ($bulk) {
                    ?>

				<label class="alignright">
					<span class="title"><?php 
                    _e('Sticky');
                    ?>
</span>
					<select name="sticky">
						<option value="-1"><?php 
                    _e('&mdash; No Change &mdash;');
                    ?>
</option>
						<option value="sticky"><?php 
                    _e('Sticky');
                    ?>
</option>
						<option value="unsticky"><?php 
                    _e('Not Sticky');
                    ?>
</option>
					</select>
				</label>

	<?php 
                } else {
                    // $bulk
                    ?>

				<label class="alignleft">
					<input type="checkbox" name="sticky" value="sticky" />
					<span class="checkbox-title"><?php 
                    _e('Make this post sticky');
                    ?>
</span>
				</label>

	<?php 
                }
                // $bulk
                ?>

	<?php 
            }
            // 'post' && $can_publish && current_user_can( 'edit_others_cap' )
            ?>

			</div>

	<?php 
            if (post_type_supports($screen->post_type, 'post-formats') && current_theme_supports('post-formats')) {
                $post_formats = get_theme_support('post-formats');
                if (isset($post_formats[0]) && is_array($post_formats[0])) {
                    $all_post_formats = get_post_format_strings();
                    ?>
			<div class="inline-edit-group">
				<label class="alignleft" for="post_format">
				<span class="title"><?php 
                    _e('Post Format');
                    ?>
</span>
				<select name="post_format">
				<?php 
                    if ($bulk) {
                        ?>
					<option value="-1"><?php 
                        _e('&mdash; No Change &mdash;');
                        ?>
</option>
				<?php 
                    }
                    ?>
					<option value="0"><?php 
                    _ex('Standard', 'Post format');
                    ?>
</option>
				<?php 
                    foreach ($all_post_formats as $slug => $format) {
                        if ($slug != 'standard') {
                            ?>
					<option value="<?php 
                            echo esc_attr($slug);
                            ?>
"<?php 
                            if (!in_array($slug, $post_formats[0])) {
                                echo ' class="unsupported"';
                            }
                            ?>
><?php 
                            echo esc_html($format);
                            ?>
</option>
					<?php 
                        }
                    }
                    ?>
				</select></label>
			</div>
		<?php 
                }
                ?>
	<?php 
            }
            // post-formats
            ?>

		</div></fieldset>

	<?php 
            list($columns) = $this->get_column_info();
            foreach ($columns as $column_name => $column_display_name) {
                if (isset($core_columns[$column_name])) {
                    continue;
                }
                do_action($bulk ? 'bulk_edit_custom_box' : 'quick_edit_custom_box', $column_name, $screen->post_type);
            }
            ?>
		<p class="submit inline-edit-save">
			<a accesskey="c" href="#inline-edit" title="<?php 
            esc_attr_e('Cancel');
            ?>
" class="button-secondary cancel alignleft"><?php 
            _e('Cancel');
            ?>
</a>
			<?php 
            if (!$bulk) {
                nxt_nonce_field('inlineeditnonce', '_inline_edit', false);
                $update_text = __('Update');
                ?>
				<a accesskey="s" href="#inline-edit" title="<?php 
                esc_attr_e('Update');
                ?>
" class="button-primary save alignright"><?php 
                echo esc_attr($update_text);
                ?>
</a>
				<img class="waiting" style="display:none;" src="<?php 
                echo esc_url(admin_url('images/nxtspin_light.gif'));
                ?>
" alt="" />
			<?php 
            } else {
                submit_button(__('Update'), 'button-primary alignright', 'bulk_edit', false, array('accesskey' => 's'));
            }
            ?>
			<input type="hidden" name="post_view" value="<?php 
            echo esc_attr($m);
            ?>
" />
			<input type="hidden" name="screen" value="<?php 
            echo esc_attr($screen->id);
            ?>
" />
			<span class="error" style="display:none"></span>
			<br class="clear" />
		</p>
		</td></tr>
	<?php 
            $bulk++;
        }
        ?>
		</tbody></table></form>
<?php 
    }
Beispiel #5
0
 /**
  * Render a page select box
  */
 public function render_field()
 {
     $args = array('depth' => 0, 'child_of' => 0, 'echo' => true, 'selected' => $this->get(), 'name' => $this->name);
     // call the nxt function
     nxt_dropdown_pages($args);
 }
        function handle_options_panel()
        {
            global $action, $page, $M_options;
            nxt_reset_vars(array('action', 'page'));
            $M_options = get_option('membership_options', array());
            $messages = array();
            $messages[1] = __('Your options have been updated.', 'membership');
            ?>
			<div class='wrap nosubsub'>
				<div class="icon32" id="icon-options-general"><br></div>
				<h2><?php 
            _e('Edit Options', 'membership');
            ?>
</h2>

				<?php 
            if (isset($_GET['msg'])) {
                echo '<div id="message" class="updated fade"><p>' . $messages[(int) $_GET['msg']] . '</p></div>';
                $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
            }
            ?>

				<form action='?page=<?php 
            echo $page;
            ?>
' method='post'>

					<input type='hidden' name='page' value='<?php 
            echo $page;
            ?>
' />
					<input type='hidden' name='action' value='updateoptions' />

					<?php 
            nxt_nonce_field('update-membership-options');
            ?>

					<h3><?php 
            _e('Stranger settings', 'membership');
            ?>
</h3>
					<p><?php 
            _e('A &quot;stranger&quot; is a visitor to your website who is either not logged in, or does not have an active membership or subscription to your website.', 'membership');
            ?>
</p>

					<table class="form-table">
					<tbody>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Use membership level', 'membership');
            ?>
</th>
							<td>
								<select name='strangerlevel' id='strangerlevel'>
									<option value="0"><?php 
            _e('None - No access to content', 'membership');
            ?>
</option>
								<?php 
            $levels = $this->get_membership_levels();
            if ($levels) {
                foreach ($levels as $key => $level) {
                    ?>
											<option value="<?php 
                    echo $level->id;
                    ?>
" <?php 
                    if (isset($M_options['strangerlevel']) && $M_options['strangerlevel'] == $level->id) {
                        echo "selected='selected'";
                    }
                    ?>
><?php 
                    echo esc_html($level->level_title);
                    ?>
</option>
											<?php 
                }
            }
            ?>
								</select>
							</td>
						</tr>
					</tbody>
					</table>
					<p><?php 
            _e('If the above is set to &quot;None&quot; then you can pick the page you want strangers directed to below under the &quot;Protected content page&quot; heading.', 'membership');
            ?>
</p>


					<h3><?php 
            _e('User registration', 'membership');
            ?>
</h3>
					<p><?php 
            _e('If you have free user registration enabled on your site, select the subscription they will be assigned to initially.', 'membership');
            ?>
</p>
					<p><?php 
            _e('If you are using a paid subscription model - it is probably best to set this to &quot;none&quot;.', 'membership');
            ?>
</p>

					<table class="form-table">
					<tbody>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Use subscription', 'membership');
            ?>
</th>
							<td>
								<select name='freeusersubscription' id='freeusersubscription'>
									<option value="0"><?php 
            _e('None', 'membership');
            ?>
</option>
								<?php 
            $subs = $this->get_subscriptions(array('sub_status' => 'active'));
            if ($subs) {
                foreach ($subs as $key => $sub) {
                    ?>
											<option value="<?php 
                    echo $sub->id;
                    ?>
" <?php 
                    if (isset($M_options['freeusersubscription']) && $M_options['freeusersubscription'] == $sub->id) {
                        echo "selected='selected'";
                    }
                    ?>
><?php 
                    echo esc_html($sub->sub_name);
                    ?>
</option>
											<?php 
                }
            }
            ?>
								</select>
							</td>
						</tr>
					</tbody>
					</table>

					<p><?php 
            _e('The default setting for the membership plugin is to disable user accounts that do not complete their subscription signup.', 'membership');
            ?>
</p>
					<p><?php 
            _e('If you want to change this, then use the option below.', 'membership');
            ?>
</p>

					<table class="form-table">
					<tbody>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Enable incomplete signup accounts', 'membership');
            ?>
							</em>
							</th>
							<td>
								<input type='checkbox' name='enableincompletesignups' id='enableincompletesignups' value='yes' <?php 
            checked('yes', $M_options['enableincompletesignups']);
            ?>
 />
							</td>
						</tr>
					</tbody>
					</table>

					<h3><?php 
            _e('Registration page', 'membership');
            ?>
</h3>
					<p><?php 
            _e('This is the page a new user will be redirected to when they want to register on your site.', 'membership');
            ?>
</p>
					<p><?php 
            _e('It can contain any content you want but <strong>must</strong> contain the [subscriptionform] shortcode in some location.', 'membership');
            ?>
</p>

					<table class="form-table">
					<tbody>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Registration page', 'membership');
            ?>
<br/>
								<em style='font-size:smaller;'><?php 
            _e("Select a page to use for the registration form.", 'membership');
            ?>
</em>
							</th>
							<td>
								<?php 
            $pages = nxt_dropdown_pages(array('post_type' => 'page', 'selected' => $M_options['registration_page'], 'name' => 'registration_page', 'show_option_none' => __('None', 'membership'), 'sort_column' => 'menu_order, post_title', 'echo' => 0));
            echo $pages;
            ?>
							</td>
						</tr>
					</tbody>
					</table>

					<h3><?php 
            _e('Account page', 'membership');
            ?>
</h3>
					<p><?php 
            _e('This is the page a user will be redirected to when they want to view their account or make a payment on their account.', 'membership');
            ?>
</p>
					<p><?php 
            _e('It can contain any content you want but <strong>must</strong> contain the [accountform] shortcode in some location.', 'membership');
            ?>
</p>
					<p><?php 
            _e('If you would like your users to be able to see their subscription details and upgrade / renew them then also add the shortcode [renewform] on this or a linked page.', 'membership');
            ?>
</p>

					<table class="form-table">
					<tbody>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Account page', 'membership');
            ?>
							</th>
							<td>
								<?php 
            $pages = nxt_dropdown_pages(array('post_type' => 'page', 'selected' => $M_options['account_page'], 'name' => 'account_page', 'show_option_none' => __('Select a page', 'membership'), 'sort_column' => 'menu_order, post_title', 'echo' => 0));
            echo $pages;
            ?>
							</td>
						</tr>
					</tbody>
					</table>

					<h3><?php 
            _e('Protected content page', 'membership');
            ?>
</h3>
					<p><?php 
            _e('If a post / page / content is not available to a user, this is the page that they user will be directed to.', 'membership');
            ?>
</p>
					<p><?php 
            _e('This page will only be displayed if the user has tried to access the post / page / content directly or via a link.', 'membership');
            ?>
</p>

					<table class="form-table">
					<tbody>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Protected content page', 'membership');
            ?>
							</th>
							<td>
								<?php 
            $pages = nxt_dropdown_pages(array('post_type' => 'page', 'selected' => $M_options['nocontent_page'], 'name' => 'nocontent_page', 'show_option_none' => __('Select a page', 'membership'), 'sort_column' => 'menu_order, post_title', 'echo' => 0));
            echo $pages;
            ?>
							</td>
						</tr>
					</tbody>
					</table>

					<h3><?php 
            _e('Shortcode protected content', 'membership');
            ?>
</h3>
					<p><?php 
            _e('You can protect parts of a post or pages content by enclosing it in NXTClass shortcodes.', 'membership');
            ?>
</p>
					<p><?php 
            _e('Create as many shortcodes as you want by entering them below, each shortcode should be on a separate line.', 'membership');
            ?>
</p>

					<table class="form-table">
					<tbody>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Shortcodes', 'membership');
            ?>
<br/>
								<em style='font-size:smaller;'><?php 
            _e("Place each shortcode on a new line, removing used shortcodes will leave content visible to all users/members.", 'membership');
            ?>
								</em>
							</th>
							<td>
								<textarea name='membershipshortcodes' id='membershipshortcodes' rows='10' cols='40'><?php 
            if (!empty($M_options['membershipshortcodes'])) {
                foreach ($M_options['membershipshortcodes'] as $key => $value) {
                    if (!empty($value)) {
                        esc_html_e(stripslashes($value)) . "\n";
                    }
                }
            }
            ?>
</textarea>
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Shortcode visibility default', 'membership');
            ?>
<br/>
								<em style='font-size:smaller;'><?php 
            _e("Should the shortcodes above be visible or protected by default.", 'membership');
            ?>
								</em>
							</th>
							<td>
								<select name='shortcodedefault' id='shortcodedefault'>
									<option value="yes" <?php 
            if (isset($M_options['shortcodedefault']) && $M_options['shortcodedefault'] == 'yes') {
                echo "selected='selected'";
            }
            ?>
><?php 
            _e('Yes - Shortcodes are visible by default', 'membership');
            ?>
</option>
									<option value="no" <?php 
            if (isset($M_options['shortcodedefault']) && $M_options['shortcodedefault'] == 'no') {
                echo "selected='selected'";
            }
            ?>
><?php 
            _e('No - Shortcodes are protected by default', 'membership');
            ?>
</option>
								</select>
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('No access message', 'membership');
            ?>
<br/>
							<em style='font-size:smaller;'><?php 
            _e("This is the message that is displayed when the content protected by the shortcode can't be shown.", 'membership');
            ?>
<br/>
							<?php 
            _e("Leave blank for no message.", 'membership');
            ?>
<br/>
							<?php 
            _e("HTML allowed.", 'membership');
            ?>
							</em>
							</th>
							<td>
								<textarea name='shortcodemessage' id='shortcodemessage' rows='5' cols='40'><?php 
            esc_html_e(stripslashes($M_options['shortcodemessage']));
            ?>
</textarea>
							</td>
						</tr>
					</tbody>
					</table>

					<h3><?php 
            _e('Downloads / Media protection', 'membership');
            ?>
</h3>
					<p><?php 
            _e('Downloads and media files can be protected by remapping their perceived location.', 'membership');
            ?>
</p>
					<p><?php 
            _e('Note: If a user determines a files actual location on your server, there is very little we can do to prevent its download, so please be careful about giving out URLs.', 'membership');
            ?>
</p>

					<table class="form-table">
					<tbody>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Actual download URL', 'membership');
            ?>
<br/>
								<em style='font-size:smaller;'><?php 
            _e("This is a system generated URL, you shouldn't need to change this.", 'membership');
            ?>
								</em>
							</th>
							<td>
								<?php 
            $membershipurl = $M_options['original_url'];
            if (empty($membershipurl)) {
                $membershipurl = membership_upload_path();
            }
            ?>
								<input type='text' name='original_url' id='original_url' value='<?php 
            esc_attr_e($membershipurl);
            ?>
' class='wide' />
							</td>
						</tr>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Masked download URL', 'membership');
            ?>
<br/>
								<em style='font-size:smaller;'><?php 
            _e("This is the URL that the user will see.", 'membership');
            ?>
<br/>
								<?php 
            _e("Change the end part to something unique.", 'membership');
            ?>
								</em>
							</th>
							<td>
								<?php 
            esc_html_e(trailingslashit(get_option('home')));
            ?>
&nbsp;<input type='text' name='masked_url' id='masked_url' value='<?php 
            esc_attr_e($M_options['masked_url']);
            ?>
' />
							</td>
						</tr>

						<tr valign="top">
							<th scope="row"><?php 
            _e('Protected groups', 'membership');
            ?>
<br/>
								<em style='font-size:smaller;'><?php 
            _e("Place each download group name on a new line, removing used groups will leave content visible to all users/members.", 'membership');
            ?>
								</em>
							</th>
							<td>
								<textarea name='membershipdownloadgroups' id='membershipdownloadgroups' rows='10' cols='40'><?php 
            if (!empty($M_options['membershipdownloadgroups'])) {
                foreach ($M_options['membershipdownloadgroups'] as $key => $value) {
                    if (!empty($value)) {
                        esc_html_e(stripslashes($value)) . "\n";
                    }
                }
            }
            ?>
</textarea>
							</td>
						</tr>

					</tbody>
					</table>

					<h3><?php 
            _e('More tag default', 'membership');
            ?>
</h3>
					<p><?php 
            _e('Content placed after the More tag in a post or page can be protected by setting the visibility below. This setting can be overridden within each individual level.', 'membership');
            ?>
</p>

					<table class="form-table">
					<tbody>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Show content after the More tag', 'membership');
            ?>
</th>
							<td>
								<select name='moretagdefault' id='moretagdefault'>
									<option value="yes" <?php 
            if (isset($M_options['moretagdefault']) && $M_options['moretagdefault'] == 'yes') {
                echo "selected='selected'";
            }
            ?>
><?php 
            _e('Yes - More tag content is visible', 'membership');
            ?>
</option>
									<option value="no" <?php 
            if (isset($M_options['moretagdefault']) && $M_options['moretagdefault'] == 'no') {
                echo "selected='selected'";
            }
            ?>
><?php 
            _e('No - More tag content not visible', 'membership');
            ?>
</option>
								</select>
							</td>
						</tr>

						<tr valign="top">
							<th scope="row"><?php 
            _e('No access message', 'membership');
            ?>
<br/>
							<em style='font-size:smaller;'><?php 
            _e("This is the message that is displayed when the content protected by the moretag can't be shown.", 'membership');
            ?>
<br/>
							<?php 
            _e("Leave blank for no message.", 'membership');
            ?>
<br/>
							<?php 
            _e("HTML allowed.", 'membership');
            ?>
							</em>
							</th>
							<td>
								<textarea name='moretagmessage' id='moretagmessage' rows='5' cols='40'><?php 
            esc_html_e(stripslashes($M_options['moretagmessage']));
            ?>
</textarea>
							</td>
						</tr>
					</tbody>
					</table>

					<h3><?php 
            _e('Payments currency', 'membership');
            ?>
</h3>
					<p><?php 
            _e('This is the currency that will be used across all gateways. Note: Some gateways have a limited number of currencies available.', 'membership');
            ?>
</p>

					<table class="form-table">
					<tbody>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Payment currencys', 'membership');
            ?>
</th>
							<td>
								<select name="paymentcurrency">
								  <?php 
            $currency = $M_options['paymentcurrency'];
            $sel_currency = empty($currency) ? 'USD' : $currency;
            $currencies = array('AUD' => 'AUD - Australian Dollar', 'BRL' => 'BRL - Brazilian Real', 'CAD' => 'CAD - Canadian Dollar', 'CHF' => 'CHF - Swiss Franc', 'CZK' => 'CZK - Czech Koruna', 'DKK' => 'DKK - Danish Krone', 'EUR' => 'EUR - Euro', 'GBP' => 'GBP - Pound Sterling', 'ILS' => 'ILS - Israeli Shekel', 'HKD' => 'HKD - Hong Kong Dollar', 'HUF' => 'HUF - Hungarian Forint', 'JPY' => 'JPY - Japanese Yen', 'MYR' => 'MYR - Malaysian Ringgits', 'MXN' => 'MXN - Mexican Peso', 'NOK' => 'NOK - Norwegian Krone', 'NZD' => 'NZD - New Zealand Dollar', 'PHP' => 'PHP - Philippine Pesos', 'PLN' => 'PLN - Polish Zloty', 'SEK' => 'SEK - Swedish Krona', 'SGD' => 'SGD - Singapore Dollar', 'TWD' => 'TWD - Taiwan New Dollars', 'THB' => 'THB - Thai Baht', 'USD' => 'USD - U.S. Dollar');
            $currencies = apply_filters('membership_available_currencies', $currencies);
            foreach ($currencies as $key => $value) {
                echo '<option value="' . esc_attr($key) . '"';
                if ($key == $sel_currency) {
                    echo 'selected="selected"';
                }
                echo '>' . esc_html($value) . '</option>' . "\n";
            }
            ?>
								  </select>
							</td>
						</tr>
					</tbody>
					</table>

					<h3><?php 
            _e('Membership renewal', 'membership');
            ?>
</h3>
					<p><?php 
            _e('If you are using single payment gateways, then you should set the number of days before expiry that the renewal form is displayed on the Account page.', 'membership');
            ?>
</p>


					<table class="form-table">
					<tbody>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Renewal period limit', 'membership');
            ?>
</th>
							<td>
								<select name="renewalperiod">
								  <?php 
            $renewalperiod = $M_options['renewalperiod'];
            for ($n = 1; $n <= 365; $n++) {
                echo '<option value="' . esc_attr($n) . '"';
                if ($n == $renewalperiod) {
                    echo 'selected="selected"';
                }
                echo '>' . esc_html($n) . '</option>' . "\n";
            }
            ?>
								  </select>&nbsp;<?php 
            _e('day(s)', 'membership');
            ?>
							</td>
						</tr>
					</tbody>
					</table>

					<h3><?php 
            _e('Membership upgrades', 'membership');
            ?>
</h3>
					<p><?php 
            _e('You should limit the amount of time allowed between membership upgrades in order to prevent members abusing the upgrade process.', 'membership');
            ?>
</p>


					<table class="form-table">
					<tbody>
						<tr valign="top">
							<th scope="row"><?php 
            _e('Upgrades period limit', 'membership');
            ?>
</th>
							<td>
								<select name="upgradeperiod">
								  <?php 
            $upgradeperiod = $M_options['upgradeperiod'];
            for ($n = 1; $n <= 365; $n++) {
                echo '<option value="' . esc_attr($n) . '"';
                if ($n == $upgradeperiod) {
                    echo 'selected="selected"';
                }
                echo '>' . esc_html($n) . '</option>' . "\n";
            }
            ?>
								  </select>&nbsp;<?php 
            _e('day(s)', 'membership');
            ?>
							</td>
						</tr>
					</tbody>
					</table>

					<?php 
            do_action('membership_options_page');
            ?>

					<p class="submit">
						<input type="submit" name="Submit" class="button-primary" value="<?php 
            esc_attr_e('Save Changes');
            ?>
" />
					</p>

				</form>

			</div> <!-- wrap -->
			<?php 
        }
Beispiel #7
0
/**
 * Display page attributes form fields.
 *
 * @since 2.7.0
 *
 * @param object $post
 */
function page_attributes_meta_box($post)
{
    $post_type_object = get_post_type_object($post->post_type);
    if ($post_type_object->hierarchical) {
        $dropdown_args = array('post_type' => $post->post_type, 'exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('(no parent)'), 'sort_column' => 'menu_order, post_title', 'echo' => 0);
        $dropdown_args = apply_filters('page_attributes_dropdown_pages_args', $dropdown_args, $post);
        $pages = nxt_dropdown_pages($dropdown_args);
        if (!empty($pages)) {
            ?>
<p><strong><?php 
            _e('Parent');
            ?>
</strong></p>
<label class="screen-reader-text" for="parent_id"><?php 
            _e('Parent');
            ?>
</label>
<?php 
            echo $pages;
        }
        // end empty pages check
    }
    // end hierarchical check.
    if ('page' == $post->post_type && 0 != count(get_page_templates())) {
        $template = !empty($post->page_template) ? $post->page_template : false;
        ?>
<p><strong><?php 
        _e('Template');
        ?>
</strong></p>
<label class="screen-reader-text" for="page_template"><?php 
        _e('Page Template');
        ?>
</label><select name="page_template" id="page_template">
<option value='default'><?php 
        _e('Default Template');
        ?>
</option>
<?php 
        page_template_dropdown($template);
        ?>
</select>
<?php 
    }
    ?>
<p><strong><?php 
    _e('Order');
    ?>
</strong></p>
<p><label class="screen-reader-text" for="menu_order"><?php 
    _e('Order');
    ?>
</label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php 
    echo esc_attr($post->menu_order);
    ?>
" /></p>
<p><?php 
    if ('page' == $post->post_type) {
        _e('Need help? Use the Help tab in the upper right of your screen.');
    }
    ?>
</p>
<?php 
}
 function woo_options()
 {
     // THEME VARIABLES
     $themename = "Swatch";
     $themeslug = "swatch";
     // STANDARD VARIABLES. DO NOT TOUCH!
     $shortname = "woo";
     $manualurl = 'http://www.woothemes.com/support/theme-documentation/' . $themeslug . '/';
     //Access the NXTClass Categories via an Array
     $woo_categories = array();
     $woo_categories_obj = get_categories('hide_empty=0');
     foreach ($woo_categories_obj as $woo_cat) {
         $woo_categories[$woo_cat->cat_ID] = $woo_cat->cat_name;
     }
     $categories_tmp = array_unshift($woo_categories, "Select a category:");
     //Access the NXTClass Pages via an Array
     $woo_pages = array();
     $woo_pages_obj = get_pages('sort_column=post_parent,menu_order');
     foreach ($woo_pages_obj as $woo_page) {
         $woo_pages[$woo_page->ID] = $woo_page->post_name;
     }
     $woo_pages_tmp = array_unshift($woo_pages, "Select a page:");
     //Stylesheets Reader
     $alt_stylesheet_path = get_template_directory() . '/styles/';
     $alt_stylesheets = array();
     if (is_dir($alt_stylesheet_path)) {
         if ($alt_stylesheet_dir = opendir($alt_stylesheet_path)) {
             while (($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false) {
                 if (stristr($alt_stylesheet_file, ".css") !== false) {
                     $alt_stylesheets[] = $alt_stylesheet_file;
                 }
             }
         }
     }
     //More Options
     $other_entries = array("Select a number:", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19");
     //URL Shorteners
     if (_iscurlinstalled()) {
         $options_select = array("Off", "TinyURL", "Bit.ly");
         $short_url_msg = 'Select the URL shortening service you would like to use.';
     } else {
         $options_select = array("Off");
         $short_url_msg = '<strong>cURL was not detected on your server, and is required in order to use the URL shortening services.</strong>';
     }
     // Setup an array of pages for a dropdown.
     $args = array('echo' => 0);
     $pages_dropdown = nxt_dropdown_pages($args);
     $pages = array();
     // Quick string hack to make sure we get the pages with the indents.
     $pages_dropdown = str_replace('<select name="page_id" id="page_id">', '', $pages_dropdown);
     $pages_dropdown = str_replace('</select>', '', $pages_dropdown);
     $pages_split = explode('</option>', $pages_dropdown);
     $pages[] = __('Select a Page:', 'woothemes');
     foreach ($pages_split as $k => $v) {
         $id = '';
         // Get the ID value.
         preg_match('/value="(.*?)"/i', $v, $matches);
         if (isset($matches[1])) {
             $id = $matches[1];
             $pages[$id] = trim(strip_tags($v));
         }
     }
     // End FOREACH Loop
     $woo_pages = $pages;
     // THIS IS THE DIFFERENT FIELDS
     $options = array();
     /* General */
     $options[] = array("name" => __('General Settings', 'woothemes'), "type" => "heading", "icon" => "general");
     $options[] = array("name" => __('Theme Stylesheet', 'woothemes'), "desc" => __('Select your themes alternative color scheme.', 'woothemes'), "id" => $shortname . "_alt_stylesheet", "std" => "default.css", "type" => "select", "options" => $alt_stylesheets);
     $options[] = array("name" => __('Custom Logo', 'woothemes'), "desc" => __('Upload a logo for your theme, or specify an image URL directly.', 'woothemes'), "id" => $shortname . "_logo", "std" => "", "type" => "upload");
     $options[] = array("name" => __('Text Title', 'woothemes'), "desc" => sprintf(__('Enable text-based Site Title and Tagline. Setup title & tagline in %1$s.', 'woothemes'), '<a href="' . home_url() . '/nxt-admin/options-general.php">' . __('General Settings', 'woothemes') . '</a>'), "id" => $shortname . "_texttitle", "std" => "false", "class" => "collapsed", "type" => "checkbox");
     $options[] = array("name" => __('Site Title', 'woothemes'), "desc" => __('Change the site title typography.', 'woothemes'), "id" => $shortname . "_font_site_title", "std" => array('size' => '70', 'unit' => 'px', 'face' => 'StMarie-Thin', 'style' => 'normal', 'color' => '#3E3E3E'), "class" => "hidden", "type" => "typography");
     $options[] = array("name" => __('Site Description', 'woothemes'), "desc" => __('Enable the site description/tagline under site title.', 'woothemes'), "id" => $shortname . "_tagline", "class" => "hidden", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => __('Site Description', 'woothemes'), "desc" => __('Change the site description typography.', 'woothemes'), "id" => $shortname . "_font_tagline", "std" => array('size' => '26', 'unit' => 'px', 'face' => 'BergamoStd-Italic', 'style' => 'italic', 'color' => '#3E3E3E'), "class" => "hidden last", "type" => "typography");
     $options[] = array("name" => __('Custom Favicon', 'woothemes'), "desc" => __('Upload a 16px x 16px <a href="http://www.faviconr.com/">ico image</a> that will represent your website\'s favicon.', 'woothemes'), "id" => $shortname . "_custom_favicon", "std" => "", "type" => "upload");
     $options[] = array("name" => __('Tracking Code', 'woothemes'), "desc" => __('Paste your Google Analytics (or other) tracking code here. This will be added into the footer template of your theme.', 'woothemes'), "id" => $shortname . "_google_analytics", "std" => "", "type" => "textarea");
     $options[] = array("name" => __('RSS URL', 'woothemes'), "desc" => __('Enter your preferred RSS URL. (Feedburner or other)', 'woothemes'), "id" => $shortname . "_feed_url", "std" => "", "type" => "text");
     $options[] = array("name" => __('E-Mail Subscription URL', 'woothemes'), "desc" => __('Enter your preferred E-mail subscription URL. (Feedburner or other)', 'woothemes'), "id" => $shortname . "_subscribe_email", "std" => "", "type" => "text");
     $options[] = array("name" => __('Contact Form E-Mail', 'woothemes'), "desc" => __('Enter your E-mail address to use on the Contact Form Page Template. Add the contact form by adding a new page and selecting "Contact Form" as page template.', 'woothemes'), "id" => $shortname . "_contactform_email", "std" => "", "type" => "text");
     $options[] = array("name" => __('Custom CSS', 'woothemes'), "desc" => __('Quickly add some CSS to your theme by adding it to this block.', 'woothemes'), "id" => $shortname . "_custom_css", "std" => "", "type" => "textarea");
     $options[] = array("name" => __('Post/Page Comments', 'woothemes'), "desc" => __('Select if you want to enable/disable comments on posts and/or pages.', 'woothemes'), "id" => $shortname . "_comments", "std" => "both", "type" => "select2", "options" => array("post" => __('Posts Only', 'woothemes'), "page" => __('Pages Only', 'woothemes'), "both" => __('Pages / Posts', 'woothemes'), "none" => __('None', 'woothemes')));
     $options[] = array("name" => __('Post Content', 'woothemes'), "desc" => __('Select if you want to show the full content or the excerpt on posts.', 'woothemes'), "id" => $shortname . "_post_content", "type" => "select2", "options" => array("excerpt" => __('The Excerpt', 'woothemes'), "content" => __('Full Content', 'woothemes')));
     $options[] = array("name" => __('Post Author Box', 'woothemes'), "desc" => sprintf(__('This will enable the post author box on the single posts page. Edit description in %1$s.', 'woothemes'), '<a href="' . home_url() . '/nxt-admin/profile.php">' . __('Profile', 'woothemes') . '</a>'), "id" => $shortname . "_post_author", "std" => "true", "type" => "checkbox");
     $options[] = array("name" => __('Display Breadcrumbs', 'woothemes'), "desc" => __('Display dynamic breadcrumbs on each page of your website.', 'woothemes'), "id" => $shortname . "_breadcrumbs_show", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => __('Pagination Style', 'woothemes'), "desc" => __('Select the style of pagination you would like to use on the blog.', 'woothemes'), "id" => $shortname . "_pagination_type", "type" => "select2", "options" => array("paginated_links" => __('Numbers', 'woothemes'), "simple" => __('Next/Previous', 'woothemes')));
     /* Styling */
     $options[] = array("name" => __('Styling Options', 'woothemes'), "type" => "heading", "icon" => "styling");
     $options[] = array("name" => __('Body Background Color', 'woothemes'), "desc" => __('Pick a custom color for background color of the theme e.g. #697e09', 'woothemes'), "id" => "woo_body_color", "std" => "", "type" => "color");
     $options[] = array("name" => __('Body background image', 'woothemes'), "desc" => __('Upload an image for the theme\'s background', 'woothemes'), "id" => $shortname . "_body_img", "std" => "", "type" => "upload");
     $options[] = array("name" => __('Background image repeat', 'woothemes'), "desc" => __('Select how you would like to repeat the background-image', 'woothemes'), "id" => $shortname . "_body_repeat", "std" => "no-repeat", "type" => "select", "options" => array("no-repeat", "repeat-x", "repeat-y", "repeat"));
     $options[] = array("name" => __('Background image position', 'woothemes'), "desc" => __('Select how you would like to position the background', 'woothemes'), "id" => $shortname . "_body_pos", "std" => "top", "type" => "select", "options" => array("top left", "top center", "top right", "center left", "center center", "center right", "bottom left", "bottom center", "bottom right"));
     $options[] = array("name" => __('Link Color', 'woothemes'), "desc" => __('Pick a custom color for links or add a hex color code e.g. #697e09', 'woothemes'), "id" => "woo_link_color", "std" => "", "type" => "color");
     $options[] = array("name" => __('Link Hover Color', 'woothemes'), "desc" => __('Pick a custom color for links hover or add a hex color code e.g. #697e09', 'woothemes'), "id" => "woo_link_hover_color", "std" => "", "type" => "color");
     $options[] = array("name" => __('Button Color', 'woothemes'), "desc" => __('Pick a custom color for buttons or add a hex color code e.g. #697e09', 'woothemes'), "id" => "woo_button_color", "std" => "", "type" => "color");
     /* Typography */
     $options[] = array("name" => __('Typography', 'woothemes'), "type" => "heading", "icon" => "typography");
     $options[] = array("name" => __('Enable Custom Typography', 'woothemes'), "desc" => __('Enable the use of custom typography for your site. Custom styling will be output in your sites HEAD.', 'woothemes'), "id" => $shortname . "_typography", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => __('General Typography', 'woothemes'), "desc" => __('Change the general font.', 'woothemes'), "id" => $shortname . "_font_body", "std" => array('size' => '14', 'unit' => 'px', 'face' => 'Arial', 'style' => '', 'color' => '#444444'), "type" => "typography");
     $options[] = array("name" => __('Navigation', 'woothemes'), "desc" => __('Change the navigation font.', 'woothemes'), "id" => $shortname . "_font_nav", "std" => array('size' => '13', 'unit' => 'px', 'face' => 'Arial', 'style' => '', 'color' => '#FFFFFF'), "type" => "typography");
     $options[] = array("name" => __('Post Title', 'woothemes'), "desc" => __('Change the post title.', 'woothemes'), "id" => $shortname . "_font_post_title", "std" => array('size' => '30', 'unit' => 'px', 'face' => 'Arial', 'style' => 'bold', 'color' => '#444444'), "type" => "typography");
     $options[] = array("name" => __('Post Meta', 'woothemes'), "desc" => __('Change the post meta.', 'woothemes'), "id" => $shortname . "_font_post_meta", "std" => array('size' => '12', 'unit' => 'px', 'face' => 'Lucida Grande', 'style' => '', 'color' => '#444444'), "type" => "typography");
     $options[] = array("name" => __('Post Entry', 'woothemes'), "desc" => __('Change the post entry.', 'woothemes'), "id" => $shortname . "_font_post_entry", "std" => array('size' => '14', 'unit' => 'px', 'face' => 'Arial', 'style' => '', 'color' => '#444444'), "type" => "typography");
     $options[] = array("name" => __('Sidebar Widget Titles', 'woothemes'), "desc" => __('Change the sidebar widget titles.', 'woothemes'), "id" => $shortname . "_font_widget_titles", "std" => array('size' => '16', 'unit' => 'px', 'face' => 'Georgia', 'style' => 'bold', 'color' => '#444444'), "type" => "typography");
     $options[] = array("name" => __('Footer Widget Titles', 'woothemes'), "desc" => __('Change the footer widget titles.', 'woothemes'), "id" => $shortname . "_font_footer_widget_titles", "std" => array('size' => '10', 'unit' => 'px', 'face' => 'Arial', 'style' => 'normal', 'color' => '#AAA8A8'), "type" => "typography");
     /* Layout */
     $options[] = array("name" => __('Layout Options', 'woothemes'), "type" => "heading", "icon" => "layout");
     $url = get_template_directory_uri() . '/functions/images/';
     $options[] = array("name" => __('Main Layout', 'woothemes'), "desc" => __('Select which layout you want for your site.', 'woothemes'), "id" => $shortname . "_site_layout", "std" => "layout-left-content", "type" => "images", "options" => array('layout-left-content' => $url . '2cl.png', 'layout-right-content' => $url . '2cr.png'));
     $options[] = array("name" => __('Category Exclude - Homepage', 'woothemes'), "desc" => __('Specify a comma seperated list of category IDs or slugs that you\'d like to exclude from your homepage (eg: uncategorized).', 'woothemes'), "id" => $shortname . "_exclude_cats_home", "std" => "", "type" => "text");
     $options[] = array("name" => __('Category Exclude - Blog Page Template', 'woothemes'), "desc" => __('Specify a comma seperated list of category IDs or slugs that you\'d like to exclude from your \'Blog\' page template (eg: uncategorized).', 'woothemes'), "id" => $shortname . "_exclude_cats_blog", "std" => "", "type" => "text");
     /* Slider */
     $options[] = array("name" => __('Homepage Slider', 'woothemes'), "icon" => "slider", "type" => "heading");
     $options[] = array("name" => __('Enable Slider', 'woothemes'), "desc" => __('Enable the slider on the homepage.', 'woothemes'), "id" => $shortname . "_slider", "std" => "true", "type" => "checkbox");
     $options[] = array("name" => __('Slider Entries', 'woothemes'), "desc" => __('Select the number of entries that should appear in the home page slider.', 'woothemes'), "id" => $shortname . "_slider_entries", "std" => "3", "type" => "select", "options" => $other_entries);
     $options[] = array("name" => __('Effect', 'woothemes'), "desc" => __('Select the animation effect.', 'woothemes'), "id" => $shortname . "_slider_effect", "type" => "select2", "options" => array("slide" => __('Slide', 'woothemes'), "fade" => __('Fade', 'woothemes')));
     $options[] = array("name" => __('Hover Pause', 'woothemes'), "desc" => __('Hovering over slideshow will pause it', 'woothemes'), "id" => $shortname . "_slider_hover", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => __('Animation Speed', 'woothemes'), "desc" => __('The time in <b>seconds</b> the animation between frames will take.', 'woothemes'), "id" => $shortname . "_slider_speed", "std" => "0.6", "type" => "select", "options" => array('0.0', '0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1.0', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', '2.0'));
     $options[] = array("name" => __('Auto Start', 'woothemes'), "desc" => __('Set the slider to start sliding automatically.', 'woothemes'), "id" => $shortname . "_slider_auto", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => __('Auto Slide Interval', 'woothemes'), "desc" => __('The time in <b>seconds</b> each slide pauses for, before sliding to the next.', 'woothemes'), "id" => $shortname . "_slider_interval", "std" => "4", "type" => "select", "options" => array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10'));
     $options[] = array("name" => __('Auto Height', 'woothemes'), "desc" => __('Set the slider to adjust automatically depending on the height of the current slide contents.', 'woothemes'), "id" => $shortname . "_slider_autoheight", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => __('Show Title with Image Background', 'woothemes'), "desc" => __('Show the post title when using an image as slider background.', 'woothemes'), "id" => $shortname . "_slider_title", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => __('Show Excerpt with Image Background', 'woothemes'), "desc" => __('Show the post excerpt when using an image as slider background.', 'woothemes'), "id" => $shortname . "_slider_content", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => __('Next/Previous', 'woothemes'), "desc" => __('Select to display next/previous buttons.', 'woothemes'), "id" => $shortname . "_slider_nextprev", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => __('Pagination', 'woothemes'), "desc" => __('Select to display pagination.', 'woothemes'), "id" => $shortname . "_slider_pagination", "std" => "true", "type" => "checkbox");
     /* Homepage */
     $options[] = array("name" => __('Homepage', 'woothemes'), "type" => "heading", 'icon' => 'homepage');
     $options[] = array("name" => __('Mini-Features Area', 'woothemes'), "desc" => __('Enable the front page Mini-Features features area.', 'woothemes'), "id" => $shortname . "_mini_features", "std" => "true", "type" => "checkbox");
     $options[] = array("name" => __('Homepage Content', 'woothemes'), "desc" => __('(Optional) Select a page that you\'d like to display on the front page.', 'woothemes'), "id" => $shortname . "_main_page", "std" => __('Select a page:', 'woothemes'), "type" => "select2", "options" => $woo_pages);
     /* Portfolio */
     $options[] = array("name" => __('Portfolio Settings', 'woothemes'), "icon" => "portfolio", "type" => "heading");
     $options[] = array("name" => __('Enable Single Portfolio Gallery', 'woothemes'), "desc" => __('Enable the gallery feature in the single portfolio page layout.', 'woothemes'), "id" => $shortname . "_portfolio_gallery", "std" => "true", "type" => "checkbox");
     $options[] = array("name" => __('Portfolio Items URL Base', 'woothemes'), "desc" => sprintf(__('The base of all portfolio item URLs (visit the %s screen after changing this setting).', 'woothemes'), '<a href="' . admin_url('options-permalink.php') . '">' . __('Settings- Permalinks', 'woothemes') . '</a>'), "id" => $shortname . "_portfolioitems_rewrite", "std" => "portfolio-items", "type" => "text");
     $options[] = array("name" => __('Exclude Galleries from the Portfolio Navigation', 'woothemes'), "desc" => __('Optionally exclude portfolio galleries from the portfolio gallery navigation switcher. Place the gallery slugs here, separated by commas <br />(eg: one,two,three)', 'woothemes'), "id" => $shortname . "_portfolio_excludenav", "std" => "", "type" => "text");
     $options[] = array("name" => __('Portfolio Thumbnail Dimensions', 'woothemes'), "desc" => __('Enter an integer value i.e. 250 for the image size.', 'woothemes'), "id" => $shortname . "_portfolio_thumb_dimensions", "std" => "", "type" => array(array('id' => $shortname . '_portfolio_thumb_width', 'type' => 'text', 'std' => 242, 'meta' => __('Width', 'woothemes')), array('id' => $shortname . '_portfolio_thumb_height', 'type' => 'text', 'std' => 160, 'meta' => __('Height', 'woothemes'))));
     $options[] = array("name" => __('Exclude Portfolio Items from Search Results', 'woothemes'), "desc" => __('Exclude portfolio items from results when searching your website.', 'woothemes'), "id" => $shortname . "_portfolio_excludesearch", "std" => "false", "type" => "checkbox");
     /* Testimonials */
     $options[] = array("name" => __('Feedback Settings', 'woothemes'), "icon" => "misc", "type" => "heading");
     $options[] = array("name" => __('Disable Feedback Manager', 'woothemes'), "desc" => __('Disable the feedback functionality.', 'woothemes'), "id" => $shortname . "_feedback_disable", "std" => "false", "type" => "checkbox");
     /* Dynamic Images */
     $options[] = array("name" => __('Dynamic Images', 'woothemes'), "type" => "heading", "icon" => "image");
     $options[] = array("name" => __('Dynamic Image Resizing', 'woothemes'), "desc" => "", "id" => $shortname . "_nxtthumb_notice", "std" => __('There are two alternative methods of dynamically resizing the thumbnails in the theme, <strong>nxt Post Thumbnail</strong> or <strong>TimThumb - Custom Settings panel</strong>. We recommend using nxt Post Thumbnail option.', 'woothemes'), "type" => "info");
     $options[] = array("name" => __('nxt Post Thumbnail', 'woothemes'), "desc" => __('Use NXTClass post thumbnail to assign a post thumbnail. Will enable the <strong>Featured Image panel</strong> in your post sidebar where you can assign a post thumbnail.', 'woothemes'), "id" => $shortname . "_post_image_support", "std" => "true", "class" => "collapsed", "type" => "checkbox");
     $options[] = array("name" => __('nxt Post Thumbnail - Dynamic Image Resizing', 'woothemes'), "desc" => __('The post thumbnail will be dynamically resized using native nxt resize functionality. <em>(Requires PHP 5.2+)</em>', 'woothemes'), "id" => $shortname . "_pis_resize", "std" => "true", "class" => "hidden", "type" => "checkbox");
     $options[] = array("name" => __('nxt Post Thumbnail - Hard Crop', 'woothemes'), "desc" => __('The post thumbnail will be cropped to match the target aspect ratio (only used if "Dynamic Image Resizing" is enabled).', 'woothemes'), "id" => $shortname . "_pis_hard_crop", "std" => "true", "class" => "hidden last", "type" => "checkbox");
     $options[] = array("name" => __('TimThumb - Custom Settings Panel', 'woothemes'), "desc" => sprintf(__('This will enable the %1$s (thumb.php) script which dynamically resizes images added through the <strong>custom settings panel below the post</strong>. Make sure your themes <em>cache</em> folder is writable. %2$s', 'woothemes'), '<a href="http://code.google.com/p/timthumb/">TimThumb</a>', '<a href="http://www.woothemes.com/2008/10/troubleshooting-image-resizer-thumbphp/">Need help?</a>'), "id" => $shortname . "_resize", "std" => "true", "type" => "checkbox");
     $options[] = array("name" => __('Automatic Image Thumbnail', 'woothemes'), "desc" => __('If no thumbnail is specifified then the first uploaded image in the post is used.', 'woothemes'), "id" => $shortname . "_auto_img", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => __('Thumbnail Image Dimensions', 'woothemes'), "desc" => __('Enter an integer value i.e. 250 for the desired size which will be used when dynamically creating the images.', 'woothemes'), "id" => $shortname . "_image_dimensions", "std" => "", "type" => array(array('id' => $shortname . '_thumb_w', 'type' => 'text', 'std' => 100, 'meta' => __('Width', 'woothemes')), array('id' => $shortname . '_thumb_h', 'type' => 'text', 'std' => 100, 'meta' => __('Height', 'woothemes'))));
     $options[] = array("name" => __('Thumbnail Image alignment', 'woothemes'), "desc" => __('Select how to align your thumbnails with posts.', 'woothemes'), "id" => $shortname . "_thumb_align", "std" => "alignright", "type" => "radio", "options" => array("alignleft" => __('Left', 'woothemes'), "alignright" => __('Right', 'woothemes'), "aligncenter" => __('Center', 'woothemes')));
     $options[] = array("name" => __('Show thumbnail in Single Posts', 'woothemes'), "desc" => __('Show the attached image in the single post page.', 'woothemes'), "id" => $shortname . "_thumb_single", "class" => "collapsed", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => __('Single Image Dimensions', 'woothemes'), "desc" => __('"Enter an integer value i.e. 250 for the image size. Max width is 576.', 'woothemes'), "id" => $shortname . "_image_dimensions", "std" => "", "class" => "hidden last", "type" => array(array('id' => $shortname . '_single_w', 'type' => 'text', 'std' => 200, 'meta' => __('Width', 'woothemes')), array('id' => $shortname . '_single_h', 'type' => 'text', 'std' => 200, 'meta' => __('Height', 'woothemes'))));
     $options[] = array("name" => __('Single Post Image alignment', 'woothemes'), "desc" => __('Select how to align your thumbnail with single posts.', 'woothemes'), "id" => $shortname . "_thumb_single_align", "std" => "alignright", "type" => "radio", "class" => "hidden", "options" => array("alignleft" => __('Left', 'woothemes'), "alignright" => __('Right', 'woothemes'), "aligncenter" => __('Center', 'woothemes')));
     $options[] = array("name" => __('Add thumbnail to RSS feed', 'woothemes'), "desc" => __('Add the the image uploaded via your Custom Settings to your RSS feed', 'woothemes'), "id" => $shortname . "_rss_thumb", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => __('Enable Lightbox', 'woothemes'), "desc" => __('Enable the PrettyPhoto lighbox script on images within your website\'s content.', 'woothemes'), "id" => $shortname . "_enable_lightbox", "std" => "false", "type" => "checkbox");
     /* Footer */
     $options[] = array("name" => __('Footer Customization', 'woothemes'), "type" => "heading", "icon" => "footer");
     $options[] = array("name" => __('Title', 'woothemes'), "desc" => __('Add a heading for the widgetized footer regions.', 'woothemes'), "id" => $shortname . "_footer_title", "std" => '', "type" => "text");
     $url = get_template_directory_uri() . '/functions/images/';
     $options[] = array("name" => __('Footer Widget Areas', 'woothemes'), "desc" => __('Select how many footer widget areas you want to display.', 'woothemes'), "id" => $shortname . "_footer_sidebars", "std" => "4", "type" => "images", "options" => array('0' => $url . 'layout-off.png', '1' => $url . 'footer-widgets-1.png', '2' => $url . 'footer-widgets-2.png', '3' => $url . 'footer-widgets-3.png', '4' => $url . 'footer-widgets-4.png'));
     $options[] = array("name" => __('Custom Affiliate Link', 'woothemes'), "desc" => __('Add an affiliate link to the WooThemes logo in the footer of the theme.', 'woothemes'), "id" => $shortname . "_footer_aff_link", "std" => "", "type" => "text");
     $options[] = array("name" => __('Enable Custom Footer (Left)', 'woothemes'), "desc" => __('Activate to add the custom text below to the theme footer.', 'woothemes'), "id" => $shortname . "_footer_left", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => __('Custom Text (Left)', 'woothemes'), "desc" => __('Custom HTML and Text that will appear in the footer of your theme.', 'woothemes'), "id" => $shortname . "_footer_left_text", "std" => "", "type" => "textarea");
     $options[] = array("name" => __('Enable Custom Footer (Right)', 'woothemes'), "desc" => __('Activate to add the custom text below to the theme footer.', 'woothemes'), "id" => $shortname . "_footer_right", "std" => "false", "type" => "checkbox");
     $options[] = array("name" => __('Custom Text (Right)', 'woothemes'), "desc" => __('Custom HTML and Text that will appear in the footer of your theme.', 'woothemes'), "id" => $shortname . "_footer_right_text", "std" => "", "type" => "textarea");
     /* Subscribe & Connect */
     $options[] = array("name" => __('Subscribe & Connect', 'woothemes'), "type" => "heading", "icon" => "connect");
     $options[] = array("name" => __('Enable Subscribe & Connect - Single Post', 'woothemes'), "desc" => sprintf(__('Enable the subscribe & connect area on single posts. You can also add this as a %1$s in your sidebar.', 'woothemes'), '<a href="' . home_url() . '/nxt-admin/widgets.php">widget</a>'), "id" => $shortname . "_connect", "std" => 'false', "type" => "checkbox");
     $options[] = array("name" => __('Subscribe Title', 'woothemes'), "desc" => __('Enter the title to show in your subscribe & connect area.', 'woothemes'), "id" => $shortname . "_connect_title", "std" => '', "type" => "text");
     $options[] = array("name" => __('Text', 'woothemes'), "desc" => __('Change the default text in this area.', 'woothemes'), "id" => $shortname . "_connect_content", "std" => '', "type" => "textarea");
     $options[] = array("name" => __('Subscribe By E-mail ID (Feedburner)', 'woothemes'), "desc" => __('Enter your <a href="http://www.google.com/support/feedburner/bin/answer.py?hl=en&answer=78982">Feedburner ID</a> for the e-mail subscription form.', 'woothemes'), "id" => $shortname . "_connect_newsletter_id", "std" => '', "type" => "text");
     $options[] = array("name" => __('Subscribe By E-mail to MailChimp', 'woothemes', 'woothemes'), "desc" => __('If you have a MailChimp account you can enter the <a href="http://woochimp.heroku.com" target="_blank">MailChimp List Subscribe URL</a> to allow your users to subscribe to a MailChimp List.', 'woothemes'), "id" => $shortname . "_connect_mailchimp_list_url", "std" => '', "type" => "text");
     $options[] = array("name" => __('Enable RSS', 'woothemes'), "desc" => __('Enable the subscribe and RSS icon.', 'woothemes'), "id" => $shortname . "_connect_rss", "std" => 'true', "type" => "checkbox");
     $options[] = array("name" => __('Twitter URL', 'woothemes'), "desc" => __('Enter your  <a href="http://www.twitter.com/">Twitter</a> URL e.g. http://www.twitter.com/woothemes', 'woothemes'), "id" => $shortname . "_connect_twitter", "std" => '', "type" => "text");
     $options[] = array("name" => __('Facebook URL', 'woothemes'), "desc" => __('Enter your  <a href="http://www.facebook.com/">Facebook</a> URL e.g. http://www.facebook.com/woothemes', 'woothemes'), "id" => $shortname . "_connect_facebook", "std" => '', "type" => "text");
     $options[] = array("name" => __('YouTube URL', 'woothemes'), "desc" => __('Enter your  <a href="http://www.youtube.com/">YouTube</a> URL e.g. http://www.youtube.com/woothemes', 'woothemes'), "id" => $shortname . "_connect_youtube", "std" => '', "type" => "text");
     $options[] = array("name" => __('Flickr URL', 'woothemes'), "desc" => __('Enter your  <a href="http://www.flickr.com/">Flickr</a> URL e.g. http://www.flickr.com/woothemes', 'woothemes'), "id" => $shortname . "_connect_flickr", "std" => '', "type" => "text");
     $options[] = array("name" => __('LinkedIn URL', 'woothemes'), "desc" => __('Enter your  <a href="http://www.www.linkedin.com.com/">LinkedIn</a> URL e.g. http://www.linkedin.com/in/woothemes', 'woothemes'), "id" => $shortname . "_connect_linkedin", "std" => '', "type" => "text");
     $options[] = array("name" => __('Delicious URL', 'woothemes'), "desc" => __('Enter your <a href="http://www.delicious.com/">Delicious</a> URL e.g. http://www.delicious.com/woothemes', 'woothemes'), "id" => $shortname . "_connect_delicious", "std" => '', "type" => "text");
     $options[] = array("name" => __('Google+ URL', 'woothemes'), "desc" => __('Enter your <a href="http://plus.google.com/">Google+</a> URL e.g. https://plus.google.com/104560124403688998123/', 'woothemes'), "id" => $shortname . "_connect_googleplus", "std" => '', "type" => "text");
     $options[] = array("name" => __('Enable Related Posts', 'woothemes'), "desc" => __('Enable related posts in the subscribe area. Uses posts with the same <strong>tags</strong> to find related posts. Note: Will not show in the Subscribe widget.', 'woothemes'), "id" => $shortname . "_connect_related", "std" => 'true', "type" => "checkbox");
     // Add extra options through function
     if (function_exists("woo_options_add")) {
         $options = woo_options_add($options);
     }
     if (get_option('woo_template') != $options) {
         update_option('woo_template', $options);
     }
     if (get_option('woo_themename') != $themename) {
         update_option('woo_themename', $themename);
     }
     if (get_option('woo_shortname') != $shortname) {
         update_option('woo_shortname', $shortname);
     }
     if (get_option('woo_manual') != $manualurl) {
         update_option('woo_manual', $manualurl);
     }
     // Woo Metabox Options
     // Start name with underscore to hide custom key from the user
     $woo_metaboxes = array();
     global $post;
     /* "portfolio" Custom Post Type. */
     if (get_post_type() == 'portfolio' || !get_post_type()) {
         $woo_metaboxes[] = array("name" => "portfolio-image", "label" => __('Portfolio Image', 'woothemes'), "type" => "upload", "desc" => __('Upload an image or enter an URL to your portfolio image', 'woothemes'));
         if (get_option('woo_resize') == "true") {
             $woo_metaboxes[] = array("name" => "_image_alignment", "std" => "c", "label" => __('Image Crop Alignment', 'woothemes'), "type" => "select2", "desc" => __('Select crop alignment for resized image', 'woothemes'), "options" => array("c" => __('Center', 'woothemes'), "t" => __('Top', 'woothemes'), "b" => __('Bottom', 'woothemes'), "l" => __('Left', 'woothemes'), "r" => __('Right', 'woothemes')));
         }
         $woo_metaboxes[] = array("name" => "embed", "std" => "", "label" => __('Video Embed Code', 'woothemes'), "type" => "textarea", "desc" => __('Enter the video embed code for your video (YouTube, Vimeo or similar). Will show instead of your image.', 'woothemes'));
         $woo_metaboxes['lightbox-description'] = array("name" => "lightbox-description", "label" => __('Custom Lightbox Description', 'woothemes'), "type" => "textarea", "desc" => sprintf(__('Enter an optional description to show in the %s for this portfolio item. This will be the description for all items in the gallery, if one is available.', 'woothemes'), '<a href="http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/">' . __('PrettyPhoto lightbox', 'woothemes') . '</a>'));
         $woo_metaboxes['lightbox-url'] = array("name" => "lightbox-url", "label" => __('Lightbox URL', 'woothemes'), "type" => "text", "desc" => sprintf(__('Enter an optional URL to show in the %s for this portfolio item.', 'woothemes'), '<a href="http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/">' . __('PrettyPhoto lightbox', 'woothemes') . '</a>'));
         $woo_metaboxes['testimonial'] = array("name" => "testimonial", "label" => __('Testimonial', 'woothemes'), "type" => "textarea", "desc" => __('Enter a testimonial from your client to be displayed on the single portfolio page', 'woothemes'));
         $woo_metaboxes['testimonial_author'] = array("name" => "testimonial_author", "label" => __('Testimonial Author', 'woothemes'), "type" => "text", "desc" => __('Enter the name of the author of the testimonial e.g. Joe Bloggs', 'woothemes'));
         $woo_metaboxes[] = array("name" => "url", "label" => __('URL', 'woothemes'), "type" => "text", "desc" => __('Enter URL of your clients site. (optional)', 'woothemes'));
     }
     //End portfolio
     if (get_post_type() == 'post' || !get_post_type()) {
         $woo_metaboxes[] = array("name" => "image", "label" => __('Image', 'woothemes'), "type" => "upload", "desc" => __('Upload an image or enter an URL.', 'woothemes'));
         if (get_option('woo_resize') == "true") {
             $woo_metaboxes[] = array("name" => "_image_alignment", "std" => "c", "label" => __('Image Crop Alignment', 'woothemes'), "type" => "select2", "desc" => __('Select crop alignment for resized image', 'woothemes'), "options" => array("c" => __('Center', 'woothemes'), "t" => __('Top', 'woothemes'), "b" => __('Bottom', 'woothemes'), "l" => __('Left', 'woothemes'), "r" => __('Right', 'woothemes')));
         }
         $woo_metaboxes[] = array("name" => "embed", "std" => "", "label" => __('Video Embed Code', 'woothemes'), "type" => "textarea", "desc" => __('Enter the video embed code for your video (YouTube, Vimeo or similar)', 'woothemes'));
     }
     // End post
     if (get_post_type() == 'slide' || !get_post_type()) {
         $woo_metaboxes[] = array("name" => "image", "label" => __('Slide Image', 'woothemes'), "type" => "upload", "desc" => __('Upload an image or enter an URL to your slide image', 'woothemes'));
         $woo_metaboxes[] = array("name" => "embed", "std" => "", "label" => __('Video Embed Code', 'woothemes'), "type" => "textarea", "desc" => __('Enter the video embed code for your video (YouTube, Vimeo or similar). Will show instead of your image.', 'woothemes'));
         $woo_metaboxes[] = array("name" => "url", "label" => __('URL', 'woothemes'), "type" => "text", "desc" => __('Enter URL if you want to add a link to the uploaded image and title. (optional)', 'woothemes'));
     }
     //End slide
     if (get_post_type() == 'infobox' || !get_post_type()) {
         $woo_metaboxes[] = array("name" => "mini", "label" => __('Mini-features Icon', 'woothemes'), "type" => "upload", "desc" => __('Upload icon for use with the Mini-Feature on the homepage (optimal size: 32x32px) (optional)', 'woothemes'));
         $woo_metaboxes[] = array("name" => "mini_excerpt", "label" => __('Mini-features Excerpt', 'woothemes'), "type" => "textarea", "desc" => __('Enter the text to show in your Mini-Feature.', 'woothemes'));
         $woo_metaboxes[] = array("name" => "mini_readmore", "std" => "", "label" => __('Mini-features URL', 'woothemes'), "type" => "text", "desc" => __('Add an URL for your Read More button in your Mini-Feature on homepage (optional)', 'woothemes'));
     }
     // End mini
     if (get_post_type() == 'feedback' || !get_post_type()) {
         $woo_metaboxes['feedback_author'] = array("name" => "feedback_author", "label" => __('Feedback Author', 'woothemes'), "type" => "text", "desc" => __('Enter the name of the author of the feedback e.g. Joe Bloggs', 'woothemes'));
         $woo_metaboxes['feedback_url'] = array("name" => "feedback_url", "label" => __('Feedback URL', 'woothemes'), "type" => "text", "desc" => __('(optional) Enter the URL to the feedback author e.g. http://www.woothemes.com', 'woothemes'));
     }
     // End feedback
     if (in_array(get_post_type(), array('page', 'post', 'portfolio')) || !get_post_type()) {
         $woo_metaboxes[] = array("name" => "_layout", "std" => "normal", "label" => __('Layout', 'woothemes'), "type" => "images", "desc" => __('Select the layout you want on this specific post/page.', 'woothemes'), "options" => array('layout-default' => $url . 'layout-off.png', 'layout-full' => get_template_directory_uri() . '/functions/images/' . '1c.png', 'layout-left-content' => get_template_directory_uri() . '/functions/images/' . '2cl.png', 'layout-right-content' => get_template_directory_uri() . '/functions/images/' . '2cr.png'));
     }
     // Add extra metaboxes through function
     if (function_exists("woo_metaboxes_add")) {
         $woo_metaboxes = woo_metaboxes_add($woo_metaboxes);
     }
     if (get_option('woo_custom_template') != $woo_metaboxes) {
         update_option('woo_custom_template', $woo_metaboxes);
     }
 }