ID, 'am-'.$profile['filed'], true);
$parts = $this->convertFormParts($profile['filed_type'], $profile['filed'], $val);
$form_parts .= <<<__HTML__
|
{$profile['label']}
|
{$parts}
|
__HTML__;
}
}
echo <<<__HTML__
__HTML__;
}
//------------------------------------------------
// フォームパーツを変換する
//------------------------------------------------
function convertFormParts($type, $name, $value)
{
switch($type)
{
case "text":
case "date":
return <<<__HTML__
__HTML__;
case "textarea":
return <<<__HTML__
__HTML__;
default:
return;
}
}
//------------------------------------------------
// 管理メニューを追加する
//------------------------------------------------
function escort_menu()
{
add_menu_page(
'All in ONE ES',
'All in ONE ES',
'administrator',
'escort_main_menu',
array($this, 'escort_viewer')
);
add_submenu_page(
'escort_main_menu',
'Add-ons',
'Add-ons',
'administrator',
'escort_main_menu_3',
array($this, 'escort_add_ons')
);
add_submenu_page(
'escort_main_menu',
'システム設定',
'システム設定',
'administrator',
'escort_main_menu_1',
array($this, 'escort_edit_setting')
);
add_submenu_page(
'escort_main_menu',
'料金設定',
'料金設定',
'administrator',
'escort_main_menu_2',
array($this, 'escort_price_setting')
);
}
function custom_enqueue($hook_suffix)
{
wp_enqueue_script('custom_js', ES_PLUGIN_URL . '/js/escort.js', array('jquery'));
wp_enqueue_style('custom_css', ES_PLUGIN_URL . '/css/style.css');
}
function escort_add_ons()
{
echo <<<__HTML__
ALL IN ONE ESCORT PACK プラグインに機能を追加するアドオンが利用できます。
それぞれのアドオンは、個別のプラグインとしてインストールする(管理画面で更新できる)か、テーマに含める(管理画面で更新できない)かしてください。
キャストの出勤情報を登録・表示を簡単に設定できます。
__HTML__;
}
function escort_price_setting()
{
if(isset($_POST['delete_id']))
{
list($a, $delete_id) = explode('-', $_POST['delete_id']);
unset($_POST['postdata'][$delete_id]);
unset($_POST['delete_id']);
$post_data = json_encode($_POST['postdata']);
update_option('escort_post_type_price', $post_data);
$mes =<<<__HTML__
__HTML__;
}
elseif (isset($_POST['postdata']))
{
$post_data = json_encode($_POST['postdata']);
update_option('escort_post_type_price', $post_data);
$mes =<<<__HTML__
__HTML__;
}
$ecort_profile = json_decode(get_option('escort_post_type_price'), true);
?>
削除しました。
__HTML__;
}
elseif (isset($_POST['postdata']))
{
$post_data = json_encode($_POST['postdata']);
update_option('escort_post_type_system', $post_data);
$mes =<<<__HTML__
__HTML__;
}
$ecort_profile = json_decode(get_option('escort_post_type_system'), true);
?>
削除しました。
__HTML__;
}
elseif (isset($_POST['postdata']))
{
$post_data = json_encode($_POST['postdata']);
update_option('escort_post_type_profile', $post_data);
$mes =<<<__HTML__
__HTML__;
}
$ecort_profile = json_decode(get_option('escort_post_type_profile'), true);
?>
$value)
{
$this->save_custom_data($key, $post_id);
}
}
}
//------------------------------------------------
//投稿データをチェックして登録する
//------------------------------------------------
function save_custom_data($key, $post_id)
{
if(isset($_POST["custom_data"][$key]))
{
$data = $_POST["custom_data"][$key];
}
else
{
$data = '';
}
//-1になると項目が変わったことになるので、項目を更新する
if( strcmp($data, get_post_meta($post_id, $key, true)) != 0 )
{
update_post_meta($post_id, $key, $data);
}
elseif($data == "")
{
delete_post_meta($post_id, $key ,get_post_meta($post_id, $key ,true));
}
}
}
//-- /end class
?>