output(); /* ================================================== * KtaiAdmin_Page_Form class ================================================== */ class KtaiAdmin_Page_Form { private $base; private $admin; private $orig_referer; private $message; private $messages; private $notices; public function __construct($base) { $this->base = $base; $this->admin = $base->admin; $this->orig_referer = wp_get_original_referer(); if ( isset($_GET['message']) ) { $this->message = intval( $_GET['message'] ); if ($this->message == 1 && ! $this->orig_referer) { $this->message = 4; } } $this->messages[1] = sprintf(__('Page updated. Continue editing below or go back.', 'ktai_style'), esc_attr($this->orig_referer)); $this->messages[2] = __('Custom field updated.', 'ktai_style'); $this->messages[3] = __('Custom field deleted.', 'ktai_style'); $this->messages[4] = __('Page updated.', 'ktai_style'); $this->messages[5] = __('Page published.', 'ktai_style'); $this->messages[6] = __('Page submitted.', 'ktai_style'); if ( isset($_GET['revision']) ) { $this->messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); } $this->notices[1] = __( 'There is an autosave of this page that is more recent than the version below. View the autosave.' ); global $post_ID, $temp_ID; $post_ID = isset($post_ID) ? intval($post_ID) : 0; $temp_ID = isset($temp_ID) ? intval($temp_ID) : 0; } // ================================================== public function output() { global $action, $post_ID, $temp_ID, $post, $post_referredby; $notice = false; if ( 0 == $post_ID ) { $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() $form_action = 'post'; $nonce_action = 'add-page'; $slug_optional = ' ' . __('(Optional)', 'ktai_style'); $form_extra = ''; } else { $form_action = 'editpost'; $nonce_action = 'update-page_' . $post_ID; $slug_optional = ''; $form_extra = ''; } $can_publish = current_user_can('publish_pages'); include dirname(__FILE__) . '/admin-header.php'; if ( $notice ) : ?>

message)) : ?>

messages[$this->message]; ?>

admin->sid_field(); ks_fix_encoding_form(); wp_nonce_field($nonce_action, "_wpnonce", false); ?> post_status) { ?>




admin->the_editor($post->post_content); ?>

orig_referer ? $this->orig_referer : $post_referredby; if ($referer && $referer != 'redo') { if (preg_match('!/page(-new)?\.php(\?|$)!', $referer)) { $referer = 'edit-pages.php'; } if ($this->message) { printf(__('Back to lists', 'ktai_style'), esc_attr($referer)); } else { printf(__('Cancel Edit', 'ktai_style'), esc_attr($referer)); } } ?> post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { if ( $can_publish ) { ?>ID)) { if (function_exists('wp_trash_post') && EMPTY_TRASH_DAYS) { $delete_url = sprintf('page.php?action=trash&post=%d', $post->ID); $delete_url = wp_nonce_url($delete_url, "trash-page_{$post->ID}"); $delete_text = __('Move to Trash'); } else { $delete_url = sprintf('page.php?action=delete&post=%d', $post->ID); $delete_text = __('Delete'); } ?>

post_status || 'private' == $post->post_status || $can_publish ) { _e('Status'); ?>:
post_status ) { $post->post_password = ''; $visibility = 'private'; $visibility_trans = __('Private'); } elseif ( !empty( $post->post_password ) ) { $visibility = 'password'; $visibility_trans = __('Password protected', 'ktai_style'); } else { $visibility = 'public'; $visibility_trans = __('Public', 'ktai_style'); } echo esc_html( $visibility_trans ); ?>


$post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?>
'; if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) { $last_user = get_userdata($last_id); printf(__('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); } else { printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); } } ?>