template_type =='' || $mytemplate->template_type == null) {
$importmessage = 'Unknown template type!';
}else {
$my_post = array(
'post_title' => $mytemplate->title,
'post_type' => ATKP_TEMPLATE_POSTTYPE,
'post_status' => 'publish',
);
// Insert the post into the database
$post_id = wp_insert_post( $my_post );
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_disabledisclaimer', $mytemplate->disableddisclaimer);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_extendedview', $mytemplate->extendedview);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_template_type', $mytemplate->template_type);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_header', $mytemplate->header);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_body_header', $mytemplate->bodyheader);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_detail_header', $mytemplate->detailheader);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_detail_footer', $mytemplate->detailfooter);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_body', $mytemplate->body);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_body_footer', $mytemplate->bodyfooter);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_footer', $mytemplate->footer);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_css', $mytemplate->css);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_comparevalues', $mytemplate->comparevalues);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_horizontalscrollbars', $mytemplate->horizontalscrollbars);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_hideheaders', $mytemplate->hideheaders);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_maxmobileproducts', $mytemplate->maxmobileproducts);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_maxproducts', $mytemplate->maxproducts);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_viewtype', $mytemplate->viewtype);
ATKPTools::set_post_setting( $post_id, ATKP_TEMPLATE_POSTTYPE.'_mobilebody', $mytemplate->mobilebody);
$imported = true;
}
} catch (Exception $e) {
$importmessage = 'Unknown content!
'.'Fehler: '. $e->getMessage();
}
}
} else {
$importmessage = 'file not found';
}
}
$mytab = ATKPTools::get_get_parameter( 'tab', 'int');
if ($mytab != 0 ) $tab = $mytab; else $tab = 1;
?>