test_interface('header'); // set in wphone.php plugin if( !isset($this->context) || ( ($this->context != 'post') && ($this->context != 'page') ) ) { $this->context = 'post'; } $this->check_user_permissions('edit_' . $this->context . 's'); if ( file_exists( ABSPATH . 'wp-admin/includes/admin.php' ) ) require_once( ABSPATH . 'wp-admin/includes/admin.php' ); else require_once( ABSPATH . 'wp-admin/admin-functions.php' ); $fancy_text = __( ucfirst($this->context), 'wphone' ); global $post, $user_ID, $wp_version; $subcontext = 'add'; $post_ID_field = ''; $post_categories = array(); $post_tags = ''; $post_ID = (int) $_GET['post']; $tags_compat = ( ($this->context == 'post') && ( function_exists('get_tags_to_edit') ) ) ? TRUE : FALSE; // Generate form details if ( 0 == $post_ID ) { $form_action = 'post'; $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() $form_extra = ""; } else { $post_ID = (int) $post_ID; $form_action = 'editpost'; $form_extra = ""; } // Generate nonce ID and stuff if ( 'page' == $this->context ) { if ( 0 == $post_ID ) $nonce_action = 'add-page'; else $nonce_action = 'update-page_' . $post_ID; $fancy_type = __('Page', 'wphone'); $redirect = 'edit-pages.php'; } else { if ( 0 == $post_ID ) { $nonce_action = 'add-post'; $fancy_type = __('Draft', 'wphone'); } else { $nonce_action = 'update-post_' . $post_ID; $fancy_type = __('Post', 'wphone'); } $redirect = 'edit.php'; } if ( !empty($post_ID) ) { $this->check_user_permissions('edit_post', $post_ID); if ( $post = get_post($post_ID) ) { $subcontext = 'edit'; $post_categories = wp_get_post_categories($post_ID); if ($tags_compat) $post_tags = get_tags_to_edit( $post_ID ); } } $form_id = $this->context . '-' . $nonce_action; if ( ! $this->iscompat ) { // note we need this one conditional because the same form is used in multiple contexts echo '

' . $fancy_text . "

\n"; } ?>
iscompat) echo ' selected="true" target="_self"'; ?>> context == 'post' ) : ?> to_ping) ); ?>"/>



post_status ) { echo 'htmltarget('_blank', TRUE) . '>' . __('View »') . "\n"; } elseif ( 'edit' == $subcontext ) { echo 'htmltarget('_blank', TRUE) . '>' . __('Preview »') . "\n"; } if ( $this->context == 'post' ) { $identifier = $this->context.'-categories-'.$post_ID; if ($this->iscompat) { $onclick = "WPhone.toggleElement('$identifier-container');"; $this->panel_button('button', $identifier.'-toggle', __('Categories'), $onclick); } else { echo '

' . __('Categories') . "

\n"; } // Important: must have "accessible" as a css class to be auto-hidden. // Can be reuse for other panels hide/show features. // Multiple classes allowed. echo '
'."\n"; $categories = get_categories('orderby=name&hide_empty=0'); foreach ($categories as $category) { echo '
' . "\n"; echo 'cat_ID, $post_categories), TRUE ); echo " />\n' . "\n"; if ($this->iscompat) { $toggled = ( in_array($category->cat_ID, $post_categories) ) ? 'true' : 'false'; echo '
ONOFF
' . "\n"; } echo "
\n"; } echo "
\n"; } $identifier = $this->context.'-advanced-'.$post_ID; if ($this->iscompat) { $onclick = "WPhone.toggleElement('$identifier-container');"; $this->panel_button('button', $identifier.'-toggle', __('Advanced', 'wphone'), $onclick); } else { echo '

' . __('Advanced', 'wphone') . "

\n"; } ?>




comment_status == 'open') ? 'checked="checked"' : ''; echo '' . "\n"; if ($this->iscompat) { $toggled = ( $checked ) ? 'true' : 'false'; echo '
ONOFF
' . "\n"; } ?>

ping_status == 'open') ? 'checked="checked"' : ''; echo '' . "\n"; if ($this->iscompat) { $toggled = ( $checked ) ? 'true' : 'false'; echo '
ONOFF
' . "\n"; } ?>
id ); if ( $post->post_author && !in_array($post->post_author, $authors) ) $authors[] = $post->post_author; if ( $authors && count( $authors ) > 1 ) { echo '
'; echo '
' . "\n"; if ( 2.3 <= floatval($wp_version) ) { // adapted from /wp-admin/edit-form-advanced.php (2.3) wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author) ); } else { // adapted from /wp-admin/edit-form-advanced.php (2.2.2) echo '' . "\n"; } echo "
\n"; } ?> context == 'page' ) : ?>



panel_button('submit', 'save', __('Save and Continue Editing')); $this->panel_button('submit', 'submit', __('Save')); if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post_ID ) { if ( current_user_can('publish_posts') ) { $this->panel_button('submit', 'publish', __('Publish')); } else{ $this->panel_button('submit', 'publish', __('Submit for Review')); } } if ( $subcontext == 'edit' ) { $question = sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title ); $url = wp_nonce_url('post.php?action=delete&post=' . $post->ID . '&_wp_http_referer=' . $redirect, 'delete-post_' . $post->ID); $this->panel_delete_button(sprintf( __('Delete This %s'), $fancy_type), $question, $url ); } ?>
test_interface('footer'); ?>