Changeset 1217932
- Timestamp:
- 08/11/2015 07:04:12 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
min-calendar/trunk/admin/class-admin-controller.php
r1217917 r1217932 5 5 * 6 6 * @property MC_List_Table $list_table 7 * @property MC_Post_Form $ post_form7 * @property MC_Post_Form $form 8 8 * @property MC_Appearance $appearance 9 * @property MC_Manage_Form_Action $ action9 * @property MC_Manage_Form_Action $form_action 10 10 */ 11 11 class MC_Admin_Controller 12 12 { 13 13 /** @var MC_Post_Form */ 14 public $form; 14 15 /** @var MC_Manage_Form_Action */ 15 public $action; 16 /** @var MC_Post_Form */ 17 public $porst_form; 16 public $form_action; 18 17 /** @var MC_Appearance */ 19 18 public $appearance; … … 21 20 public $list_table; 22 21 23 24 22 function __construct() 25 23 { 26 $this-> porst_form= new MC_Post_Form();27 $this-> action= new MC_Manage_Form_Action();28 $this->appearance = new MC_Appearance();24 $this->form = new MC_Post_Form(); 25 $this->form_action = new MC_Manage_Form_Action(); 26 $this->appearance = new MC_Appearance(); 29 27 } 30 28 … … 32 30 * 管理画面作成 33 31 */ 34 public function setup() { 32 public function setup() 33 { 35 34 add_action( 'admin_menu', array( &$this, 'admin_menu' ), 9 ); 36 35 add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue_scripts' ) ); … … 61 60 ); 62 61 // MC_Manage_Form_Action->manage_postをコールバックに設定 63 add_action( 'load-' . $list_page, array( $this-> action, 'manage_post' ) );62 add_action( 'load-' . $list_page, array( $this->form_action, 'manage_post' ) ); 64 63 // 外観ページ(カレンダーオプション) 65 64 add_submenu_page( … … 81 80 public function admin_management_page() 82 81 { 83 $post_wrapper = $this-> action->get_post_wrapper();82 $post_wrapper = $this->form_action->get_post_wrapper(); 84 83 if ( $post_wrapper ) { 85 84 // 編集画面 86 echo $this->get_edit_page( $post_wrapper);85 echo $this->get_edit_page( $post_wrapper ); 87 86 } else { 88 87 // 一覧画面 … … 90 89 } 91 90 } 92 91 93 92 /** 94 93 * 編集画面マークアップ取得 95 * 94 * 96 95 * @return string マークアップ 97 96 */ 98 public function get_edit_page($post_wrapper) { 99 $post_form = new MC_Post_Form(); 100 $html = $post_form->get_form( $post_wrapper ); 97 public function get_edit_page( $post_wrapper ) 98 { 99 $form = new MC_Post_Form(); 100 $html = $form->get_form( $post_wrapper ); 101 101 MC_Custom_Field::set_field( $post_wrapper, $html ); 102 102 // get_htmlはエスケープ済みマークアップを返す … … 106 106 /** 107 107 * 一覧画面マークアップ取得 108 * 108 * 109 109 * @return string マークアップ 110 110 */ 111 public function get_list_page() { 111 public function get_list_page() 112 { 112 113 $this->list_table = new MC_List_Table(); 113 114 $this->list_table->prepare_items(); … … 137 138 138 139 $html .= '</form>' . PHP_EOL . '</div>'; 139 140 140 141 return $html; 141 142 } … … 211 212 } 212 213 213 214 214 /** 215 215 * add_meta_boxのコールバック関数 … … 221 221 MC_Custom_Field::set_field( $params[0], $params[1] ); 222 222 } 223 224 223 }
Note: See TracChangeset
for help on using the changeset viewer.