Ejemplo n.º 1
0
	</li>
</ul>

<p><label><input type="radio" name="content" value="pages" /> <?php 
_e('Pages');
?>
</label></p>
<ul id="page-filters" class="export-filters">
	<li>
		<label><?php 
_e('Authors:');
?>
</label>
<?php 
$authors = $nxtdb->get_col("SELECT DISTINCT post_author FROM {$nxtdb->posts} WHERE post_type = 'page'");
nxt_dropdown_users(array('include' => $authors, 'name' => 'page_author', 'multi' => true, 'show_option_all' => __('All')));
?>
	</li>
	<li>
		<label><?php 
_e('Date range:');
?>
</label>
		<select name="page_start_date">
			<option value="0"><?php 
_e('Start Date');
?>
</option>
			<?php 
export_date_options();
?>
    /**
     * 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 
    }
Ejemplo n.º 3
0
/**
 * Display form field with list of authors.
 *
 * @since 2.6.0
 *
 * @param object $post
 */
function post_author_meta_box($post)
{
    global $user_ID;
    ?>
<label class="screen-reader-text" for="post_author_override"><?php 
    _e('Author');
    ?>
</label>
<?php 
    nxt_dropdown_users(array('who' => 'authors', 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author, 'include_selected' => true));
}
Ejemplo n.º 4
0
        if ($go_delete) {
            ?>
	<fieldset><p><legend><?php 
            echo _n('What should be done with posts and links owned by this user?', 'What should be done with posts and links owned by these users?', $go_delete);
            ?>
</legend></p>
	<ul style="list-style:none;">
		<li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" checked="checked" />
		<?php 
            _e('Delete all posts and links.');
            ?>
</label></li>
		<li><input type="radio" id="delete_option1" name="delete_option" value="reassign" />
		<?php 
            echo '<label for="delete_option1">' . __('Attribute all posts and links to:') . '</label>';
            nxt_dropdown_users(array('name' => 'reassign_user', 'exclude' => array_diff($userids, array($current_user->ID))));
            ?>
</li>
	</ul></fieldset>
	<input type="hidden" name="action" value="dodelete" />
	<?php 
            submit_button(__('Confirm Deletion'), 'secondary');
        } else {
            ?>
	<p><?php 
            _e('There are no valid users selected for deletion.');
            ?>
</p>
<?php 
        }
        ?>
Ejemplo n.º 5
0
 /**
  * Display import options for an individual author. That is, either create
  * a new user based on import info or map to an existing user
  *
  * @param int $n Index for each author in the form
  * @param array $author Author information, e.g. login, display name, email
  */
 function author_select($n, $author)
 {
     _e('Import author:', 'nxtclass-importer');
     echo ' <strong>' . esc_html($author['author_display_name']);
     if ($this->version != '1.0') {
         echo ' (' . esc_html($author['author_login']) . ')';
     }
     echo '</strong><br />';
     if ($this->version != '1.0') {
         echo '<div style="margin-left:18px">';
     }
     $create_users = $this->allow_create_users();
     if ($create_users) {
         if ($this->version != '1.0') {
             _e('or create new user with login name:', 'nxtclass-importer');
             $value = '';
         } else {
             _e('as a new user:'******'nxtclass-importer');
             $value = esc_attr(sanitize_user($author['author_login'], true));
         }
         echo ' <input type="text" name="user_new[' . $n . ']" value="' . $value . '" /><br />';
     }
     if (!$create_users && $this->version == '1.0') {
         _e('assign posts to an existing user:'******'nxtclass-importer');
     } else {
         _e('or assign posts to an existing user:'******'nxtclass-importer');
     }
     nxt_dropdown_users(array('name' => "user_map[{$n}]", 'multi' => true, 'show_option_all' => __('- Select -', 'nxtclass-importer')));
     echo '<input type="hidden" name="imported_authors[' . $n . ']" value="' . esc_attr($author['author_login']) . '" />';
     if ($this->version != '1.0') {
         echo '</div>';
     }
 }