Пример #1
0
 /**
  *
  *
  * @since 1.1.1
  * */
 function init_metabox()
 {
     //Room
     $this->metabox[] = array('id' => 'room_metabox', 'title' => __('Room Setting', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('hotel_room'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('General', ST_TEXTDOMAIN), 'id' => 'room_reneral_tab', 'type' => 'tab'), array('label' => __('Hotel', ST_TEXTDOMAIN), 'id' => 'room_parent', 'type' => 'post_select_ajax', 'desc' => __('Choose the hotel that the room belongs to', ST_TEXTDOMAIN), 'post_type' => 'st_hotel', 'placeholder' => __('Search for a Hotel', ST_TEXTDOMAIN)), array('label' => __('Number of Rooms', ST_TEXTDOMAIN), 'id' => 'number_room', 'type' => 'text', 'desc' => __('Number of rooms available for booking', ST_TEXTDOMAIN), 'std' => 1), array('label' => __('Gallery', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery'), array('label' => __('Hotel Room Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Hotel Room Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('hotel_room')), array('label' => __('Room Price', ST_TEXTDOMAIN), 'id' => 'room_price_tab', 'type' => 'tab'), array('label' => sprintf(__('Price (%s)', ST_TEXTDOMAIN), TravelHelper::get_default_currency('symbol')), 'id' => 'price', 'type' => 'text', 'desc' => __('Per night', ST_TEXTDOMAIN)), array('label' => __('Extra Price', ST_TEXTDOMAIN), 'id' => 'extra_price', 'type' => 'list-item', 'settings' => array(array('id' => 'extra_name', 'type' => 'text', 'std' => 'extra_', 'label' => __('Name of Item', ST_TEXTDOMAIN)), array('id' => 'extra_max_number', 'type' => 'text', 'std' => '', 'label' => __('Max of Number', ST_TEXTDOMAIN)), array('id' => 'extra_price', 'type' => 'text', 'std' => '', 'label' => __('Price', ST_TEXTDOMAIN), 'desc' => __('per 1 Item', ST_TEXTDOMAIN)))), array('label' => __('Discount Rate', ST_TEXTDOMAIN), 'id' => 'discount_rate', 'type' => 'text', 'desc' => __('Discount by %', ST_TEXTDOMAIN)), array('label' => __('Sale Schedule', ST_TEXTDOMAIN), 'id' => 'is_sale_schedule', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Sale Price Date From', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date From', ST_TEXTDOMAIN), 'id' => 'sale_price_from', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Sale Price Date To', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date To', ST_TEXTDOMAIN), 'id' => 'sale_price_to', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('id' => 'deposit_payment_status', 'label' => __("Deposit payment options", ST_TEXTDOMAIN), 'desc' => __('You can select <code>Disallow Deposit</code>, <code>Deposit by percent</code>, <code>Deposit by amount</code>'), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Disallow Deposit', ST_TEXTDOMAIN)), array('value' => 'percent', 'label' => __('Deposit by percent', ST_TEXTDOMAIN)), array('value' => 'amount', 'label' => __('Deposit by amount', ST_TEXTDOMAIN)))), array('label' => __('Deposit payment amount', ST_TEXTDOMAIN), 'desc' => __('Leave empty for disallow deposit payment', ST_TEXTDOMAIN), 'id' => 'deposit_payment_amount', 'type' => 'text', 'condition' => 'deposit_payment_status:not()'), array('label' => __('Room Facility', ST_TEXTDOMAIN), 'id' => 'room_detail_tab', 'type' => 'tab'), array('label' => __('No. adults', ST_TEXTDOMAIN), 'id' => 'adult_number', 'type' => 'text', 'desc' => __('Number of Adults in room', ST_TEXTDOMAIN), 'std' => 1), array('label' => __('No. children', ST_TEXTDOMAIN), 'id' => 'children_number', 'type' => 'text', 'desc' => __('Number of Children in room', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('No. beds', ST_TEXTDOMAIN), 'id' => 'bed_number', 'type' => 'text', 'desc' => __('Number of Beds in room', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Room footage (square feet)', ST_TEXTDOMAIN), 'desc' => __('Room footage (square feet)', ST_TEXTDOMAIN), 'id' => 'room_footage', 'type' => 'text'), array('label' => __('Room external booking', ST_TEXTDOMAIN), 'id' => 'st_room_external_booking', 'type' => 'on-off', 'std' => "off"), array('label' => __('Room external booking', ST_TEXTDOMAIN), 'id' => 'st_room_external_booking_link', 'type' => 'text', 'std' => "", 'condition' => 'st_room_external_booking:is(on)', 'desc' => "<em>" . __('Notice: Must be http://...', ST_TEXTDOMAIN) . "</em>"), array('label' => __('Other facility', ST_TEXTDOMAIN), 'id' => 'other_facility', 'type' => 'tab'), array('label' => __('Add a facility', ST_TEXTDOMAIN), 'id' => 'add_new_facility', 'type' => 'list-item', 'settings' => array(array('id' => 'facility_value', 'type' => 'text', 'std' => '', 'label' => __('Value', ST_TEXTDOMAIN)), array('id' => 'facility_icon', 'type' => 'text', 'std' => '', 'label' => __('Icon', ST_TEXTDOMAIN), 'desc' => __('Support: fonticon <code>(eg: fa-facebook)</code>', ST_TEXTDOMAIN)))), array('label' => __('Description', ST_TEXTDOMAIN), 'id' => 'room_description', 'type' => 'textarea', 'std' => ''), array('label' => __('Availability', ST_TEXTDOMAIN), 'id' => 'availability_tab', 'type' => 'tab'), array('label' => __("Default State", ST_TEXTDOMAIN), 'id' => 'default_state', 'type' => 'select', 'choices' => array(array('value' => "available", 'label' => __("Available", ST_TEXTDOMAIN)), array('value' => "not_available", 'label' => __("Not Available", ST_TEXTDOMAIN)))), array('label' => __('Hotel Calendar', ST_TEXTDOMAIN), 'id' => 'st_hotel_calendar', 'type' => 'st_hotel_calendar')));
     $data_paypment = STPaymentGateways::get_payment_gateways();
     if (!empty($data_paypment) and is_array($data_paypment)) {
         $this->metabox[0]['fields'][] = array('label' => __('Payment', ST_TEXTDOMAIN), 'id' => 'payment_detail_tab', 'type' => 'tab');
         foreach ($data_paypment as $k => $v) {
             $this->metabox[0]['fields'][] = array('label' => $v->get_name(), 'id' => 'is_meta_payment_gateway_' . $k, 'type' => 'on-off', 'desc' => $v->get_name(), 'std' => 'on');
         }
     }
     parent::register_metabox($this->metabox);
 }
Пример #2
0
 /**
  *
  * @since 1.0.9
  * */
 function _add_metabox()
 {
     $this->metabox[] = array('id' => 'st_location', 'title' => __('Rental Details', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('st_rental'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'location_tab', 'type' => 'tab'), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'multi_location', 'type' => 'list_item_post_type', 'desc' => __('Rental Location', ST_TEXTDOMAIN), 'post_type' => 'location'), array('label' => __('Address', ST_TEXTDOMAIN), 'id' => 'address', 'type' => 'text', 'desc' => __('Rental Address ', ST_TEXTDOMAIN)), array('label' => __('Maps', ST_TEXTDOMAIN), 'id' => 'st_google_map', 'type' => 'bt_gmap', 'desc' => __('Maps', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Rental Information', ST_TEXTDOMAIN), 'id' => 'detail_tab', 'type' => 'tab'), array('label' => __('Set as Featured', ST_TEXTDOMAIN), 'id' => 'is_featured', 'type' => 'on-off', 'desc' => __('Set this location is featured', ST_TEXTDOMAIN), 'std' => 'off'), array('id' => 'rental_number', 'label' => __('Numbers', ST_TEXTDOMAIN), 'desc' => __('Number of rental available for booking', ST_TEXTDOMAIN), 'type' => 'text', 'std' => '1'), array('id' => 'rental_max_adult', 'label' => __('Max Adults', ST_TEXTDOMAIN), 'desc' => __('Max Adults', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,1', 'std' => 1), array('id' => 'rental_max_children', 'label' => __('Max Children', ST_TEXTDOMAIN), 'desc' => __('Max Children', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,1', 'std' => 1), array('label' => __('Custom Layout', ST_TEXTDOMAIN), 'id' => 'custom_layout', 'post_type' => 'st_layouts', 'type' => 'select', 'choices' => st_get_layout('st_rental')), array('label' => __('Gallery', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery', 'desc' => __('Rental Gallery', ST_TEXTDOMAIN)), array('label' => __('Video', ST_TEXTDOMAIN), 'id' => 'video', 'type' => 'text', 'desc' => __('Youtube or Video url', ST_TEXTDOMAIN)), array('label' => __('Agent Information', ST_TEXTDOMAIN), 'id' => 'agent_tab', 'type' => 'tab'), array('label' => __('Agent Email', ST_TEXTDOMAIN), 'id' => 'agent_email', 'type' => 'text', 'desc' => __('Agent Email. This email will receive emails notifying new booking', ST_TEXTDOMAIN)), array('label' => __('Agent Website', ST_TEXTDOMAIN), 'id' => 'agent_website', 'type' => 'text', 'desc' => __('Agent Website', ST_TEXTDOMAIN)), array('label' => __('Agent Phone', ST_TEXTDOMAIN), 'id' => 'agent_phone', 'type' => 'text', 'desc' => __('Agent Phone', ST_TEXTDOMAIN)), array('label' => __('Rental Price', ST_TEXTDOMAIN), 'id' => 'price_tab', 'type' => 'tab'), array('label' => sprintf(__('Price (%s)', ST_TEXTDOMAIN), TravelHelper::get_default_currency('symbol')), 'id' => 'price', 'type' => 'text', 'desc' => __('Regular Price', ST_TEXTDOMAIN)), array('label' => __('Extra Price', ST_TEXTDOMAIN), 'id' => 'extra_price', 'type' => 'list-item', 'settings' => array(array('id' => 'extra_name', 'type' => 'text', 'std' => 'extra_', 'label' => __('Name of Item', ST_TEXTDOMAIN)), array('id' => 'extra_max_number', 'type' => 'text', 'std' => '', 'label' => __('Max of Number', ST_TEXTDOMAIN)), array('id' => 'extra_price', 'type' => 'text', 'std' => '', 'label' => __('Price', ST_TEXTDOMAIN), 'desc' => __('per 1 Item', ST_TEXTDOMAIN)))), array('label' => __('Discount Rate', ST_TEXTDOMAIN), 'id' => 'discount_rate', 'type' => 'text', 'desc' => __('Discount Rate By %', ST_TEXTDOMAIN)), array('label' => __('Sale Schedule', ST_TEXTDOMAIN), 'id' => 'is_sale_schedule', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Sale Price Date From', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date From', ST_TEXTDOMAIN), 'id' => 'sale_price_from', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Sale Price Date To', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date To', ST_TEXTDOMAIN), 'id' => 'sale_price_to', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('id' => 'deposit_payment_status', 'label' => __("Deposit payment options", ST_TEXTDOMAIN), 'desc' => __('You can select <code>Disallow Deposit</code>, <code>Deposit by percent</code>, <code>Deposit by amount</code>'), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Disallow Deposit', ST_TEXTDOMAIN)), array('value' => 'percent', 'label' => __('Deposit by percent', ST_TEXTDOMAIN)), array('value' => 'amount', 'label' => __('Deposit by amount', ST_TEXTDOMAIN)))), array('label' => __('Deposit payment amount', ST_TEXTDOMAIN), 'desc' => __('Leave empty for disallow deposit payment', ST_TEXTDOMAIN), 'id' => 'deposit_payment_amount', 'type' => 'text', 'condition' => 'deposit_payment_status:not()'), array('label' => __('Availability', ST_TEXTDOMAIN), 'id' => 'availability_tab', 'type' => 'tab'), array('label' => __('Rental Calendar', ST_TEXTDOMAIN), 'id' => 'st_rental_calendar', 'type' => 'st_rental_calendar'), array('label' => __('Rental Option', ST_TEXTDOMAIN), 'id' => 'rental_options', 'type' => 'tab'), array('label' => __('Minimum days to book before arrival', ST_TEXTDOMAIN), 'id' => 'rentals_booking_period', 'type' => 'numeric-slider', 'min_max_step' => '0,30,1', 'std' => 0, 'desc' => __('The time period allowed booking.', ST_TEXTDOMAIN)), array('label' => __('Rental external booking', ST_TEXTDOMAIN), 'id' => 'st_rental_external_booking', 'type' => 'on-off', 'std' => "off"), array('label' => __('Rental external booking link', ST_TEXTDOMAIN), 'id' => 'st_rental_external_booking_link', 'type' => 'text', 'std' => "", 'condition' => 'st_rental_external_booking:is(on)', 'desc' => "<em>" . __('Notice: Must be http://...', ST_TEXTDOMAIN) . "</em>")));
     $data_paypment = STPaymentGateways::get_payment_gateways();
     if (!empty($data_paypment) and is_array($data_paypment)) {
         $this->metabox[0]['fields'][] = array('label' => __('Payment', ST_TEXTDOMAIN), 'id' => 'payment_detail_tab', 'type' => 'tab');
         foreach ($data_paypment as $k => $v) {
             $this->metabox[0]['fields'][] = array('label' => $v->get_name(), 'id' => 'is_meta_payment_gateway_' . $k, 'type' => 'on-off', 'desc' => $v->get_name(), 'std' => 'on');
         }
     }
     $custom_field = self::get_custom_fields();
     if (!empty($custom_field) and is_array($custom_field)) {
         $this->metabox[0]['fields'][] = array('label' => __('Custom fields', ST_TEXTDOMAIN), 'id' => 'custom_field_tab', 'type' => 'tab');
         foreach ($custom_field as $k => $v) {
             $key = str_ireplace('-', '_', 'st_custom_' . sanitize_title($v['title']));
             $this->metabox[0]['fields'][] = array('label' => $v['title'], 'id' => $key, 'type' => $v['type_field'], 'desc' => '<input value=\'[st_custom_meta key="' . $key . '"]\' type=text readonly />', 'std' => $v['default_field']);
         }
     }
     parent::register_metabox($this->metabox);
 }
 /**
  *
  *
  * @since 1.1.1
  * */
 function init_metabox()
 {
     //Room
     $this->metabox[] = array('id' => 'room_metabox', 'title' => __('Activity Setting', ST_TEXTDOMAIN), 'pages' => array('st_activity'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('General', ST_TEXTDOMAIN), 'id' => 'room_reneral_tab', 'type' => 'tab'), array('label' => __('Set as Featured', ST_TEXTDOMAIN), 'id' => 'is_featured', 'type' => 'on-off', 'desc' => __('Set this location is featured', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Custom Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Detail Tour Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('st_activity')), array('label' => __('Gallery', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery'), array('label' => __('Gallery style', ST_TEXTDOMAIN), 'id' => 'gallery_style', 'type' => 'select', 'choices' => array(array('value' => 'grid', 'label' => __('Grid', ST_TEXTDOMAIN)), array('value' => 'slider', 'label' => __('Slider', ST_TEXTDOMAIN)))), array('label' => __('Contact email addresses', ST_TEXTDOMAIN), 'id' => 'contact_email', 'type' => 'text', 'desc' => __('Contact email addresses', ST_TEXTDOMAIN)), array('label' => __('Website', ST_TEXTDOMAIN), 'id' => 'contact_web', 'type' => 'text', 'desc' => __('Website', ST_TEXTDOMAIN)), array('label' => __('Phone', ST_TEXTDOMAIN), 'id' => 'contact_phone', 'type' => 'text', 'desc' => __('Phone', ST_TEXTDOMAIN)), array('label' => __('Video', ST_TEXTDOMAIN), 'id' => 'video', 'type' => 'text', 'desc' => __('Please use youtube or vimeo video', ST_TEXTDOMAIN)), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'location_reneral_tab', 'type' => 'tab'), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'id_location', 'type' => 'post_select_ajax', 'post_type' => 'location'), array('label' => __('Address', ST_TEXTDOMAIN), 'id' => 'address', 'type' => 'text'), array('label' => __('Latitude', ST_TEXTDOMAIN), 'id' => 'map_lat', 'type' => 'text', 'desc' => __('Latitude <a href="http://www.latlong.net/" target="_blank">Get here</a>', ST_TEXTDOMAIN)), array('label' => __('Longitude', ST_TEXTDOMAIN), 'id' => 'map_lng', 'type' => 'text', 'desc' => __('Longitude', ST_TEXTDOMAIN)), array('label' => __('Map Zoom', ST_TEXTDOMAIN), 'id' => 'map_zoom', 'type' => 'text', 'desc' => __('Map Zoom', ST_TEXTDOMAIN), 'std' => 13), array('label' => __('Info setting', ST_TEXTDOMAIN), 'id' => 'activity_time_number_tab', 'type' => 'tab'), array('label' => __('Check In', ST_TEXTDOMAIN), 'id' => 'check_in', 'type' => 'date_picker'), array('label' => __('Check Out', ST_TEXTDOMAIN), 'id' => 'check_out', 'type' => 'date_picker'), array('label' => __('Activity Time', ST_TEXTDOMAIN), 'id' => 'activity-time', 'type' => 'text', 'desc' => __('The departure time of an activity', ST_TEXTDOMAIN)), array('label' => __('Duration', ST_TEXTDOMAIN), 'id' => 'duration', 'type' => 'text', 'desc' => __('The total time to take each activity package', ST_TEXTDOMAIN)), array('label' => __('Venue Facilities', ST_TEXTDOMAIN), 'id' => 'venue-facilities', 'type' => 'text', 'desc' => __('The facilities that customer may experience during activities', ST_TEXTDOMAIN)), array('label' => __('Price setting', ST_TEXTDOMAIN), 'id' => 'price_number_tab', 'type' => 'tab'), array('label' => __('Type Price', ST_TEXTDOMAIN), 'id' => 'type_price', 'type' => 'select', 'desc' => __('Type Price', ST_TEXTDOMAIN), 'choices' => array(array('value' => 'activity_price', 'label' => __('Price / Activity', ST_TEXTDOMAIN)), array('value' => 'people_price', 'label' => __('Price / Person', ST_TEXTDOMAIN)))), array('label' => sprintf(__('Price (%s)', ST_TEXTDOMAIN), TravelHelper::get_default_currency('symbol')), 'id' => 'price', 'type' => 'text', 'desc' => __('Price of this Activity', ST_TEXTDOMAIN), 'std' => 0, 'condition' => 'type_price:is(activity_price)'), array('label' => __('Adult Price', ST_TEXTDOMAIN), 'id' => 'adult_price', 'type' => 'text', 'desc' => __('Price per Adult', ST_TEXTDOMAIN), 'std' => 0, 'condition' => 'type_price:is(people_price)'), array('label' => __('Child Price', ST_TEXTDOMAIN), 'id' => 'child_price', 'type' => 'text', 'desc' => __('Price per Child', ST_TEXTDOMAIN), 'std' => 0, 'condition' => 'type_price:is(people_price)'), array('label' => __('Discount', ST_TEXTDOMAIN), 'desc' => __('Discount', ST_TEXTDOMAIN), 'id' => 'discount', 'type' => 'text', 'std' => 0), array('label' => __('Sale Schedule', ST_TEXTDOMAIN), 'id' => 'is_sale_schedule', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Sale Price Date From', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date From', ST_TEXTDOMAIN), 'id' => 'sale_price_from', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Sale Price Date To', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date To', ST_TEXTDOMAIN), 'id' => 'sale_price_to', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Best Price Guarantee', ST_TEXTDOMAIN), 'id' => 'best-price-guarantee', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Best Price Guarantee Text', ST_TEXTDOMAIN), 'id' => 'best-price-guarantee-text', 'type' => 'textarea', 'rows' => '2', 'condition' => 'best-price-guarantee:is(on)'), array('label' => __('Activity external booking', ST_TEXTDOMAIN), 'id' => 'st_activity_external_booking', 'type' => 'on-off', 'std' => "off"), array('label' => __('Activity external booking', ST_TEXTDOMAIN), 'id' => 'st_activity_external_booking_link', 'type' => 'text', 'std' => "", 'condition' => 'st_activity_external_booking:is(on)', 'desc' => "<em>" . __('Notice: Must be http://...', ST_TEXTDOMAIN) . "</em>"), array('id' => 'deposit_payment_status', 'label' => __("Deposit payment options", ST_TEXTDOMAIN), 'desc' => __('You can select <code>Disallow Deposit</code>, <code>Deposit by percent</code>, <code>Deposit by amount</code>'), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Disallow Deposit', ST_TEXTDOMAIN)), array('value' => 'percent', 'label' => __('Deposit by percent', ST_TEXTDOMAIN)), array('value' => 'amount', 'label' => __('Deposit by amount', ST_TEXTDOMAIN)))), array('label' => __('Deposit payment amount', ST_TEXTDOMAIN), 'desc' => __('Leave empty for disallow deposit payment', ST_TEXTDOMAIN), 'id' => 'deposit_payment_amount', 'type' => 'text', 'condition' => 'deposit_payment_status:not()')));
     $data_paypment = STPaymentGateways::$_payment_gateways;
     if (!empty($data_paypment) and is_array($data_paypment)) {
         $this->metabox[0]['fields'][] = array('label' => __('Payment', ST_TEXTDOMAIN), 'id' => 'payment_detail_tab', 'type' => 'tab');
         foreach ($data_paypment as $k => $v) {
             $this->metabox[0]['fields'][] = array('label' => $v->get_name(), 'id' => 'is_meta_payment_gateway_' . $k, 'type' => 'on-off', 'desc' => $v->get_name(), 'std' => 'on');
         }
     }
     $custom_field = st()->get_option('st_activity_unlimited_custom_field');
     if (!empty($custom_field) and is_array($custom_field)) {
         $this->metabox[0]['fields'][] = array('label' => __('Custom fields', ST_TEXTDOMAIN), 'id' => 'custom_field_tab', 'type' => 'tab');
         foreach ($custom_field as $k => $v) {
             $key = str_ireplace('-', '_', 'st_custom_' . sanitize_title($v['title']));
             $this->metabox[0]['fields'][] = array('label' => $v['title'], 'id' => $key, 'type' => $v['type_field'], 'desc' => '<input value=\'[st_custom_meta key="' . $key . '"]\' type=text readonly />', 'std' => $v['default_field']);
         }
     }
     parent::register_metabox($this->metabox);
 }
Пример #4
0
 /**
  *
  *
  * @since 1.1.1
  * @update 1.1.2
  * */
 function init_metabox()
 {
     //Room
     $this->metabox[] = array('id' => 'room_metabox', 'title' => __('Holiday Setting', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('st_holidays'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'location_reneral_tab', 'type' => 'tab'), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'multi_location', 'type' => 'list_item_post_type', 'desc' => __('Holiday Location', ST_TEXTDOMAIN), 'post_type' => 'location'), array('label' => __('Address', ST_TEXTDOMAIN), 'id' => 'address', 'type' => 'text', 'desc' => __('Address', ST_TEXTDOMAIN)), array('label' => __('Maps', ST_TEXTDOMAIN), 'id' => 'st_google_map', 'type' => 'bt_gmap', 'desc' => __('Maps', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('General', ST_TEXTDOMAIN), 'id' => 'room_reneral_tab', 'type' => 'tab'), array('label' => __('Set as Featured', ST_TEXTDOMAIN), 'id' => 'is_featured', 'type' => 'on-off', 'desc' => __('This is set as featured', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Custom Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Detail Holiday Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('st_holidays')), array('label' => __('Gallery', ST_TEXTDOMAIN), 'desc' => __('Select images for holiday', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery'), array('label' => __('Contact email addresses', ST_TEXTDOMAIN), 'id' => 'contact_email', 'type' => 'text', 'desc' => __('Contact email addresses', ST_TEXTDOMAIN)), array('label' => __('Video', ST_TEXTDOMAIN), 'id' => 'video', 'type' => 'text', 'desc' => __('Please use youtube or vimeo video', ST_TEXTDOMAIN)), array('label' => __('Price setting', ST_TEXTDOMAIN), 'id' => 'price_number_tab', 'type' => 'tab'), array('label' => __('Adult Price', ST_TEXTDOMAIN), 'id' => 'adult_price', 'type' => 'text', 'desc' => __('Price per Adult', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Fields list discount by Adult number booking', ST_TEXTDOMAIN), 'id' => 'discount_by_adult', 'type' => 'list-item', 'desc' => __('Fields list discount by Adult number booking', ST_TEXTDOMAIN), 'std' => 0, 'settings' => array(array('id' => 'key', 'label' => __('Number of Adult', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'value', 'label' => __('Value percent of discount', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,0.5'))), array('label' => __('Child Price', ST_TEXTDOMAIN), 'id' => 'child_price', 'type' => 'text', 'desc' => __('Price per Child', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Fields list discount by Child number booking', ST_TEXTDOMAIN), 'id' => 'discount_by_child', 'type' => 'list-item', 'desc' => __('Fields list discount by Child number booking', ST_TEXTDOMAIN), 'std' => 0, 'settings' => array(array('id' => 'key', 'label' => __('Number of Children', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'value', 'label' => __('Value percent of discount', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,0.5'))), array('label' => __('Infant Price', ST_TEXTDOMAIN), 'id' => 'infant_price', 'type' => 'text', 'desc' => __('Price per Infant', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Discount by percent', ST_TEXTDOMAIN), 'id' => 'discount', 'type' => 'numeric-slider', 'min_max_step' => '0,100,1', 'desc' => __('Discount of this holiday, by percent', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Sale Schedule', ST_TEXTDOMAIN), 'id' => 'is_sale_schedule', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Sale Start Date', ST_TEXTDOMAIN), 'desc' => __('Sale Start Date', ST_TEXTDOMAIN), 'id' => 'sale_price_from', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Sale End Date', ST_TEXTDOMAIN), 'desc' => __('Sale End Date', ST_TEXTDOMAIN), 'id' => 'sale_price_to', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('id' => 'deposit_payment_status', 'label' => __("Deposit payment options", ST_TEXTDOMAIN), 'desc' => __('You can select <code>Disallow Deposit</code>, <code>Deposit by percent</code>, <code>Deposit by amount</code>'), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Disallow Deposit', ST_TEXTDOMAIN)), array('value' => 'percent', 'label' => __('Deposit by percent', ST_TEXTDOMAIN)), array('value' => 'amount', 'label' => __('Deposit by amount', ST_TEXTDOMAIN)))), array('label' => __('Deposit payment amount', ST_TEXTDOMAIN), 'desc' => __('Leave empty for disallow deposit payment', ST_TEXTDOMAIN), 'id' => 'deposit_payment_amount', 'type' => 'text', 'condition' => 'deposit_payment_status:not()'), array('label' => __('Information', ST_TEXTDOMAIN), 'id' => 'st_info_holidays_tab', 'type' => 'tab'), array('label' => __('Holiday Type', ST_TEXTDOMAIN), 'id' => 'type_holiday', 'type' => 'select', 'desc' => __('Holiday Type', ST_TEXTDOMAIN), 'choices' => array(array('value' => 'daily_holiday', 'label' => __('Daily Holiday', ST_TEXTDOMAIN)), array('value' => 'specific_date', 'label' => __('Specific Date', ST_TEXTDOMAIN)))), array('label' => __('Duration', ST_TEXTDOMAIN), 'id' => 'duration_day', 'type' => 'text', 'desc' => __('Duration', ST_TEXTDOMAIN), 'std' => '1', 'condition' => 'type_holiday:is(daily_holiday)'), array('label' => __('Duration unit', ST_TEXTDOMAIN), 'id' => 'duration_unit', 'type' => 'select', 'desc' => __('Select your duration unit', ST_TEXTDOMAIN), 'std' => __('day', ST_TEXTDOMAIN), 'choices' => array(array('value' => 'day', 'label' => __('Days', ST_TEXTDOMAIN)), array('value' => 'hour', 'label' => __('Hours', ST_TEXTDOMAIN)), array('value' => 'week', 'label' => __('Weeks', ST_TEXTDOMAIN)), array('value' => 'month', 'label' => __('Months', ST_TEXTDOMAIN))), 'condition' => 'type_holiday:is(daily_holiday)'), array('label' => __('Minimum days to book before departure', ST_TEXTDOMAIN), 'desc' => __('Minimum days to book before departure', ST_TEXTDOMAIN), 'id' => 'holidays_booking_period', 'type' => 'numeric-slider', 'min_max_step' => '0,30,1', 'std' => 0), array('label' => __('Holiday external booking', ST_TEXTDOMAIN), 'id' => 'st_holiday_external_booking', 'type' => 'on-off', 'std' => "off"), array('label' => __('Holiday external booking link ', ST_TEXTDOMAIN), 'id' => 'st_holiday_external_booking_link', 'type' => 'text', 'std' => "", 'condition' => 'st_holiday_external_booking:is(on)', 'desc' => "<em>" . __('Notice: Must be http://...', ST_TEXTDOMAIN) . "</em>"), array('label' => __('Max No. People', ST_TEXTDOMAIN), 'id' => 'max_people', 'type' => 'text', 'desc' => __('Max No. People', ST_TEXTDOMAIN), 'std' => '1'), array('id' => 'holidays_program', 'label' => __("Holiday program", ST_TEXTDOMAIN), 'type' => 'list-item', 'settings' => array(array('id' => 'desc', 'label' => __('Description', ST_TEXTDOMAIN), 'type' => 'textarea', 'rows' => '5'))), array('label' => __('Availability', ST_TEXTDOMAIN), 'id' => 'availability_tab', 'type' => 'tab'), array('label' => __('Holiday Calendar', ST_TEXTDOMAIN), 'id' => 'st_holiday_calendar', 'type' => 'st_holiday_calendar')));
     $data_paypment = STPaymentGateways::get_payment_gateways();
     if (!empty($data_paypment) and is_array($data_paypment)) {
         $this->metabox[0]['fields'][] = array('label' => __('Payment', ST_TEXTDOMAIN), 'id' => 'payment_detail_tab', 'type' => 'tab');
         foreach ($data_paypment as $k => $v) {
             $this->metabox[0]['fields'][] = array('label' => $v->get_name(), 'id' => 'is_meta_payment_gateway_' . $k, 'type' => 'on-off', 'desc' => $v->get_name(), 'std' => 'on');
         }
     }
     $custom_field = st()->get_option('holidays_unlimited_custom_field');
     if (!empty($custom_field) and is_array($custom_field)) {
         $this->metabox[0]['fields'][] = array('label' => __('Custom fields', ST_TEXTDOMAIN), 'id' => 'custom_field_tab', 'type' => 'tab');
         foreach ($custom_field as $k => $v) {
             $key = str_ireplace('-', '_', 'st_custom_' . sanitize_title($v['title']));
             $this->metabox[0]['fields'][] = array('label' => $v['title'], 'id' => $key, 'type' => $v['type_field'], 'desc' => '<input value=\'[st_custom_meta key="' . $key . '"]\' type=text readonly />', 'std' => $v['default_field']);
         }
     }
     parent::register_metabox($this->metabox);
 }
 /**
  *
  * @since 1.1.1
  * */
 function init_metabox()
 {
     $this->metabox[] = array('id' => 'Restaurent_metabox', 'title' => __('Restaurent Information', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('st_restaurent'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('Restaurent Detail', ST_TEXTDOMAIN), 'id' => 'detail_tab', 'type' => 'tab'), array('label' => __('Set as Featured', ST_TEXTDOMAIN), 'id' => 'is_featured', 'type' => 'on-off', 'desc' => __('Set this location is featured', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Restaurent Logo', ST_TEXTDOMAIN), 'id' => 'logo', 'type' => 'upload', 'class' => 'ot-upload-attachment-id', 'desc' => __('Upload your Restaurent\'s logo; Recommend: 260px x 195px', ST_TEXTDOMAIN)), array('label' => __('Card Accepted', ST_TEXTDOMAIN), 'desc' => __('Card Accepted', ST_TEXTDOMAIN), 'id' => 'card_accepted', 'type' => 'checkbox', 'choices' => $this->get_card_accepted_list()), array('label' => __('Min Price', ST_TEXTDOMAIN), 'id' => 'min_price', 'type' => 'text', 'desc' => __('Min price of this Restaurent', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Custom Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Detail Restaurent Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('st_restaurent')), array('label' => __('Restaurent Email', ST_TEXTDOMAIN), 'id' => 'email', 'type' => 'text', 'desc' => __('Restaurent Email Address, this address will received email when have new booking', ST_TEXTDOMAIN)), array('label' => __('Restaurent Website', ST_TEXTDOMAIN), 'id' => 'website', 'type' => 'text', 'desc' => __('Restaurent Website. Ex: <em>http://domain.com</em>', ST_TEXTDOMAIN)), array('label' => __('Restaurent Phone', ST_TEXTDOMAIN), 'id' => 'phone', 'type' => 'text', 'desc' => __('Restaurent Phone Number', ST_TEXTDOMAIN)), array('label' => __('Fax Number', ST_TEXTDOMAIN), 'id' => 'fax', 'type' => 'text', 'desc' => __('Restaurent Fax Number', ST_TEXTDOMAIN)), array('label' => __('Gallery', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery', 'desc' => __('Pick your own image for this Restaurent', ST_TEXTDOMAIN)), array('label' => __('Restaurent Video', ST_TEXTDOMAIN), 'id' => 'video', 'type' => 'text', 'desc' => __('Please use youtube or vimeo video', ST_TEXTDOMAIN)), array('label' => __('Star Rating', ST_TEXTDOMAIN), 'desc' => __('Star Rating', ST_TEXTDOMAIN), 'id' => 'Restaurent_star', 'type' => 'numeric-slider', 'min_max_step' => '0,5,1', 'std' => 0), array('label' => __('Restaurent Location', ST_TEXTDOMAIN), 'id' => 'location_tab', 'type' => 'tab'), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'id_location', 'type' => 'post_select_ajax', 'desc' => __('Search for location', ST_TEXTDOMAIN), 'post_type' => 'location'), array('label' => __('Address', ST_TEXTDOMAIN), 'id' => 'address', 'type' => 'text', 'desc' => __('Restaurent Address', ST_TEXTDOMAIN)), array('label' => __('Latitude', ST_TEXTDOMAIN), 'id' => 'map_lat', 'type' => 'text', 'desc' => __('Latitude <a href="http://www.latlong.net/" target="_blank">Get here</a>', ST_TEXTDOMAIN)), array('label' => __('Longitude', ST_TEXTDOMAIN), 'id' => 'map_lng', 'type' => 'text', 'desc' => __('Longitude', ST_TEXTDOMAIN)), array('label' => __('Map Zoom', ST_TEXTDOMAIN), 'id' => 'map_zoom', 'type' => 'text', 'desc' => __('Map Zoom', ST_TEXTDOMAIN), 'std' => 13), array('label' => __('Sale & Price setting', ST_TEXTDOMAIN), 'id' => 'sale_number_tab', 'type' => 'tab'), array('label' => __('Total Sale Number', ST_TEXTDOMAIN), 'id' => 'total_sale_number', 'type' => 'text', 'desc' => __('Total Number Booking of this Restaurent', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Auto calculate price avg', ST_TEXTDOMAIN), 'id' => 'is_auto_caculate', 'type' => 'on-off', 'desc' => __('Auto calculate price avg', ST_TEXTDOMAIN), 'std' => 'on'), array('label' => __('Price AVG', ST_TEXTDOMAIN), 'id' => 'price_avg', 'type' => 'text', 'desc' => __('Price AVG', ST_TEXTDOMAIN), 'std' => 0, 'conditions' => 'is_auto_caculate:is(on)'), array('label' => __("Min Price", ST_TEXTDOMAIN), 'desc' => __("Min Price", ST_TEXTDOMAIN), 'id' => 'min_price', 'type' => 'text', 'std' => 0), array('label' => __('Other Options', ST_TEXTDOMAIN), 'id' => 'Restaurent_options', 'type' => 'tab'), array('label' => __('Booking Period', ST_TEXTDOMAIN), 'id' => 'Restaurent_booking_period', 'type' => 'numeric-slider', 'min_max_step' => '0,30,1', 'std' => 0, 'desc' => __('The time period allowed booking.', ST_TEXTDOMAIN))));
     $custom_field = st()->get_option('Restaurent_unlimited_custom_field');
     if (!empty($custom_field) and is_array($custom_field)) {
         $this->metabox[0]['fields'][] = array('label' => __('Custom fields', ST_TEXTDOMAIN), 'id' => 'custom_field_tab', 'type' => 'tab');
         foreach ($custom_field as $k => $v) {
             $key = str_ireplace('-', '_', 'st_custom_' . sanitize_title($v['title']));
             $this->metabox[0]['fields'][] = array('label' => $v['title'], 'id' => $key, 'type' => $v['type_field'], 'desc' => '<input value=\'[st_custom_meta key="' . $key . '"]\' type=text readonly />', 'std' => $v['default_field']);
         }
     }
     parent::register_metabox($this->metabox);
 }
 /**
  *
  *
  * @since 1.1.1
  * @update 1.1.2
  * */
 function init_metabox()
 {
     //Room
     $this->metabox[] = array('id' => 'room_metabox', 'title' => __('Tour Setting', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('st_tours'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('General', ST_TEXTDOMAIN), 'id' => 'room_reneral_tab', 'type' => 'tab'), array('label' => __('Set as Featured', ST_TEXTDOMAIN), 'id' => 'is_featured', 'type' => 'on-off', 'desc' => __('Set this location is featured', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Custom Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Detail Tour Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('st_tours')), array('label' => __('Gallery', ST_TEXTDOMAIN), 'desc' => __('Select images for tour', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery'), array('label' => __('Gallery style', ST_TEXTDOMAIN), 'id' => 'gallery_style', 'type' => 'select', 'choices' => array(array('value' => 'grid', 'label' => __('Grid', ST_TEXTDOMAIN)), array('value' => 'slider', 'label' => __('Slider', ST_TEXTDOMAIN)))), array('label' => __('Contact email addresses', ST_TEXTDOMAIN), 'id' => 'contact_email', 'type' => 'text', 'desc' => __('Contact email addresses', ST_TEXTDOMAIN)), array('label' => __('Video', ST_TEXTDOMAIN), 'id' => 'video', 'type' => 'text', 'desc' => __('Please use youtube or vimeo video', ST_TEXTDOMAIN)), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'location_reneral_tab', 'type' => 'tab'), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'id_location', 'type' => 'post_select_ajax', 'post_type' => 'location'), array('label' => __('Address', ST_TEXTDOMAIN), 'id' => 'address', 'type' => 'text', 'desc' => __('Address', ST_TEXTDOMAIN)), array('label' => __('Latitude', ST_TEXTDOMAIN), 'id' => 'map_lat', 'type' => 'text', 'desc' => __('Latitude <a href="http://www.latlong.net/" target="_blank">Get here</a>', ST_TEXTDOMAIN)), array('label' => __('Longitude', ST_TEXTDOMAIN), 'id' => 'map_lng', 'type' => 'text', 'desc' => __('Longitude', ST_TEXTDOMAIN)), array('label' => __('Map Zoom', ST_TEXTDOMAIN), 'id' => 'map_zoom', 'type' => 'text', 'desc' => __('Map Zoom', ST_TEXTDOMAIN), 'std' => 13), array('label' => __('Price setting', ST_TEXTDOMAIN), 'id' => 'price_number_tab', 'type' => 'tab'), array('label' => __('Type Price', ST_TEXTDOMAIN), 'id' => 'type_price', 'type' => 'select', 'desc' => __('Type Price', ST_TEXTDOMAIN), 'choices' => array(array('value' => 'tour_price', 'label' => __('Price / Tour', ST_TEXTDOMAIN)), array('value' => 'people_price', 'label' => __('Price / Person', ST_TEXTDOMAIN)))), array('label' => __('Price', ST_TEXTDOMAIN), 'id' => 'price', 'type' => 'text', 'desc' => __('Price of this tour', ST_TEXTDOMAIN), 'std' => 0, 'condition' => 'type_price:is(tour_price)'), array('label' => __('Adult Price', ST_TEXTDOMAIN), 'id' => 'adult_price', 'type' => 'text', 'desc' => __('Price per Adult', ST_TEXTDOMAIN), 'std' => 0, 'condition' => 'type_price:is(people_price)'), array('label' => __('Fields list discount by Adult number booking', ST_TEXTDOMAIN), 'id' => 'discount_by_adult', 'type' => 'list-item', 'desc' => __('Fields list discount by Adult number booking', ST_TEXTDOMAIN), 'std' => 0, 'condition' => 'type_price:is(people_price)', 'settings' => array(array('id' => 'key', 'label' => __('Key number', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'value', 'label' => __('Value percent of discount', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,1'))), array('label' => __('Child Price', ST_TEXTDOMAIN), 'id' => 'child_price', 'type' => 'text', 'desc' => __('Price per Child', ST_TEXTDOMAIN), 'std' => 0, 'condition' => 'type_price:is(people_price)'), array('label' => __('Fields list discount by Child number booking', ST_TEXTDOMAIN), 'id' => 'discount_by_child', 'type' => 'list-item', 'desc' => __('Fields list discount by Child number booking', ST_TEXTDOMAIN), 'std' => 0, 'condition' => 'type_price:is(people_price)', 'settings' => array(array('id' => 'key', 'label' => __('Key number', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'value', 'label' => __('Value percent of discount', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,1'))), array('label' => __('Discount by percent', ST_TEXTDOMAIN), 'id' => 'discount', 'type' => 'numeric-slider', 'min_max_step' => '0,100,1', 'desc' => __('Discount of this tour, by percent', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Sale Schedule', ST_TEXTDOMAIN), 'id' => 'is_sale_schedule', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Sale Start Date', ST_TEXTDOMAIN), 'desc' => __('Sale Start Date', ST_TEXTDOMAIN), 'id' => 'sale_price_from', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Sale End Date', ST_TEXTDOMAIN), 'desc' => __('Sale End Date', ST_TEXTDOMAIN), 'id' => 'sale_price_to', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('id' => 'deposit_payment_status', 'label' => __("Deposit payment options", ST_TEXTDOMAIN), 'desc' => __('You can select <code>Disallow Deposit</code>, <code>Deposit by percent</code>, <code>Deposit by amount</code>'), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Disallow Deposit', ST_TEXTDOMAIN)), array('value' => 'percent', 'label' => __('Deposit by percent', ST_TEXTDOMAIN)), array('value' => 'amount', 'label' => __('Deposit by amount', ST_TEXTDOMAIN)))), array('label' => __('Deposit payment amount', ST_TEXTDOMAIN), 'desc' => __('Leave empty for disallow deposit payment', ST_TEXTDOMAIN), 'id' => 'deposit_payment_amount', 'type' => 'text', 'condition' => 'deposit_payment_status:not()'), array('label' => __('Information', ST_TEXTDOMAIN), 'id' => 'st_info_tours_tab', 'type' => 'tab'), array('label' => __('Type Tour', ST_TEXTDOMAIN), 'id' => 'type_tour', 'type' => 'select', 'desc' => __('Type Tour', ST_TEXTDOMAIN), 'choices' => array(array('value' => 'daily_tour', 'label' => __('Daily Tour', ST_TEXTDOMAIN)), array('value' => 'specific_date', 'label' => __('Specific Date', ST_TEXTDOMAIN)))), array('label' => __('Departure date ', ST_TEXTDOMAIN), 'id' => 'check_in', 'type' => 'date_picker', 'condition' => 'type_tour:is(specific_date)', 'desc' => __('Departure date ', ST_TEXTDOMAIN)), array('label' => __('Arrive date', ST_TEXTDOMAIN), 'id' => 'check_out', 'type' => 'date_picker', 'condition' => 'type_tour:is(specific_date)', 'desc' => __('Arrive date', ST_TEXTDOMAIN)), array('label' => __('Duration (days)', ST_TEXTDOMAIN), 'id' => 'duration_day', 'type' => 'text', 'desc' => __('Duration (days)', ST_TEXTDOMAIN), 'std' => '1', 'condition' => 'type_tour:is(daily_tour)'), array('label' => __('Booking Period', ST_TEXTDOMAIN), 'desc' => __('Booking Period', ST_TEXTDOMAIN), 'id' => 'tours_booking_period', 'type' => 'numeric-slider', 'min_max_step' => '0,30,1', 'std' => 0, 'condition' => 'type_tour:is(daily_tour)'), array('label' => __('Tour external booking', ST_TEXTDOMAIN), 'id' => 'st_tour_external_booking', 'type' => 'on-off', 'std' => "off"), array('label' => __('Tour external booking link ', ST_TEXTDOMAIN), 'id' => 'st_tour_external_booking_link', 'type' => 'text', 'std' => "", 'condition' => 'st_tour_external_booking:is(on)', 'desc' => "<em>" . __('Notice: Must be http://...', ST_TEXTDOMAIN) . "</em>"), array('label' => __('Max number of people', ST_TEXTDOMAIN), 'id' => 'max_people', 'type' => 'text', 'desc' => __('Max number of people', ST_TEXTDOMAIN), 'std' => '1'), array('id' => 'tours_program', 'label' => __("Tour's program ", ST_TEXTDOMAIN), 'type' => 'list-item', 'settings' => array(array('id' => 'desc', 'label' => __('Description', ST_TEXTDOMAIN), 'type' => 'textarea', 'rows' => '5')))));
     $data_paypment = STPaymentGateways::$_payment_gateways;
     if (!empty($data_paypment) and is_array($data_paypment)) {
         $this->metabox[0]['fields'][] = array('label' => __('Payment', ST_TEXTDOMAIN), 'id' => 'payment_detail_tab', 'type' => 'tab');
         foreach ($data_paypment as $k => $v) {
             $this->metabox[0]['fields'][] = array('label' => $v->get_name(), 'id' => 'is_meta_payment_gateway_' . $k, 'type' => 'on-off', 'desc' => $v->get_name(), 'std' => 'on');
         }
     }
     $custom_field = st()->get_option('tours_unlimited_custom_field');
     if (!empty($custom_field) and is_array($custom_field)) {
         $this->metabox[0]['fields'][] = array('label' => __('Custom fields', ST_TEXTDOMAIN), 'id' => 'custom_field_tab', 'type' => 'tab');
         foreach ($custom_field as $k => $v) {
             $key = str_ireplace('-', '_', 'st_custom_' . sanitize_title($v['title']));
             $this->metabox[0]['fields'][] = array('label' => $v['title'], 'id' => $key, 'type' => $v['type_field'], 'desc' => '<input value=\'[st_custom_meta key="' . $key . '"]\' type=text readonly />', 'std' => $v['default_field']);
         }
     }
     parent::register_metabox($this->metabox);
 }
Пример #7
0
 /**
  *
  *
  * @since 1.1.1
  * */
 function init_metabox()
 {
     $this->metabox[] = array('id' => 'cars_metabox', 'title' => __('Cars Setting', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('st_cars'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'location_tab', 'type' => 'tab'), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'multi_location', 'type' => 'list_item_post_type', 'desc' => __('Car Location', ST_TEXTDOMAIN), 'post_type' => 'location'), array('label' => __('Address', ST_TEXTDOMAIN), 'id' => 'cars_address', 'type' => 'text', 'desc' => __('Address', ST_TEXTDOMAIN)), array('label' => __('Maps', ST_TEXTDOMAIN), 'id' => 'st_google_map', 'type' => 'bt_gmap', 'desc' => __('Maps', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Car Details', ST_TEXTDOMAIN), 'id' => 'room_car_tab', 'type' => 'tab'), array('label' => __('Set as Featured', ST_TEXTDOMAIN), 'id' => 'is_featured', 'type' => 'on-off', 'desc' => __('This is set as featured', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Detail Car Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Detail Car Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('st_cars')), array('label' => __('Gallery', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery'), array('label' => __('Equipment Price List', ST_TEXTDOMAIN), 'desc' => __('Equipment Price List', ST_TEXTDOMAIN), 'id' => 'cars_equipment_list', 'type' => 'list-item', 'settings' => array(array('id' => 'cars_equipment_list_price', 'label' => __('Price', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'price_unit', 'label' => __('Price Unit', ST_TEXTDOMAIN), 'desc' => __('You can choose <code>Fixed Price</code>, <code>Price per Hour</code>, <code>Price per Day</code>', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Fixed Price', ST_TEXTDOMAIN)), array('value' => 'per_hour', 'label' => __('Price per Hour', ST_TEXTDOMAIN)), array('value' => 'per_day', 'label' => __('Price per Day', ST_TEXTDOMAIN)))), array('id' => 'cars_equipment_list_price_max', 'label' => __('Price Max', ST_TEXTDOMAIN), 'type' => 'text', 'condition' => 'price_unit:not()'))), array('label' => __('Features', ST_TEXTDOMAIN), 'desc' => __('Features', ST_TEXTDOMAIN), 'id' => 'cars_equipment_info', 'type' => 'list-item', 'settings' => array(array('id' => 'cars_equipment_taxonomy_id', 'label' => __('Taxonomy', ST_TEXTDOMAIN), 'type' => 'select', 'operator' => 'and', 'choices' => self::$data_term), array('id' => 'cars_equipment_taxonomy_info', 'label' => __('Taxonomy Info', ST_TEXTDOMAIN), 'type' => 'text'))), array('label' => __('Video', ST_TEXTDOMAIN), 'id' => 'video', 'type' => 'text', 'desc' => __('Please use youtube or vimeo video', ST_TEXTDOMAIN)), array('label' => __('Contact Details', ST_TEXTDOMAIN), 'id' => 'room_contact_tab', 'type' => 'tab'), array('label' => __('Logo', ST_TEXTDOMAIN), 'id' => 'cars_logo', 'type' => 'upload', 'desc' => __('Logo', ST_TEXTDOMAIN)), array('label' => __('Car manufacturer name', ST_TEXTDOMAIN), 'id' => 'cars_name', 'type' => 'text', 'desc' => __('Car manufacturer name', ST_TEXTDOMAIN)), array('label' => __('Email', ST_TEXTDOMAIN), 'id' => 'cars_email', 'type' => 'text', 'desc' => __('E-mail Car Agent, this address will received email when have new booking', ST_TEXTDOMAIN)), array('label' => __('Phone', ST_TEXTDOMAIN), 'id' => 'cars_phone', 'type' => 'text', 'desc' => __('Phone', ST_TEXTDOMAIN)), array('label' => __('About', ST_TEXTDOMAIN), 'desc' => __('About', ST_TEXTDOMAIN), 'id' => 'cars_about', 'type' => 'textarea'), array('label' => __('Price setting', ST_TEXTDOMAIN), 'id' => '_price_car_tab', 'type' => 'tab'), array('label' => sprintf(__('Price (%s)', ST_TEXTDOMAIN), TravelHelper::get_default_currency('symbol')), 'id' => 'cars_price', 'type' => 'text', 'desc' => __('Price', ST_TEXTDOMAIN)), array('label' => __('Custom Price', ST_TEXTDOMAIN), 'id' => 'is_custom_price', 'std' => 'off', 'type' => 'select', 'choices' => array(array('value' => 'price_by_number', 'label' => __('Price by number of day|hour', ST_TEXTDOMAIN)), array('value' => 'price_by_date', 'label' => __('Price by Date', ST_TEXTDOMAIN)))), array('label' => __("Price by Date", ST_TEXTDOMAIN), 'id' => 'st_custom_price_by_date', 'type' => 'st_custom_price', 'desc' => __('Price by Date', ST_TEXTDOMAIN), 'condition' => 'is_custom_price:is(price_by_date)'), array('label' => __("Price by number of day/hour", ST_TEXTDOMAIN), 'id' => 'price_by_number_of_day_hour', 'desc' => __('Price by number of day/hour', ST_TEXTDOMAIN), 'type' => 'list-item', 'condition' => 'is_custom_price:is(price_by_number)', 'settings' => array(array('id' => 'number_start', 'label' => __('Number Start', ST_TEXTDOMAIN), 'type' => 'text', 'operator' => 'and'), array('id' => 'number_end', 'label' => __('Number End', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'price', 'label' => sprintf(__('Price (%s)', ST_TEXTDOMAIN), TravelHelper::get_default_currency('symbol')), 'type' => 'text'))), array('label' => __('Discount', ST_TEXTDOMAIN), 'id' => 'discount', 'type' => 'text', 'desc' => __('%', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Sale Schedule', ST_TEXTDOMAIN), 'id' => 'is_sale_schedule', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Sale Price Date From', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date From', ST_TEXTDOMAIN), 'id' => 'sale_price_from', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Sale Price Date To', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date To', ST_TEXTDOMAIN), 'id' => 'sale_price_to', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Number of car for Rent', ST_TEXTDOMAIN), 'desc' => __('Number of car for Rent', ST_TEXTDOMAIN), 'id' => 'number_car', 'type' => 'text', 'std' => 1), array('id' => 'deposit_payment_status', 'label' => __("Deposit payment options", ST_TEXTDOMAIN), 'desc' => __('You can select <code>Disallow Deposit</code>, <code>Deposit by percent</code>, <code>Deposit by amount</code>'), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Disallow Deposit', ST_TEXTDOMAIN)), array('value' => 'percent', 'label' => __('Deposit by percent', ST_TEXTDOMAIN)), array('value' => 'amount', 'label' => __('Deposit by amount', ST_TEXTDOMAIN)))), array('label' => __('Deposit payment amount', ST_TEXTDOMAIN), 'desc' => __('Leave empty for disallow deposit payment', ST_TEXTDOMAIN), 'id' => 'deposit_payment_amount', 'type' => 'text', 'condition' => 'deposit_payment_status:not()'), array('label' => __('Car Options', ST_TEXTDOMAIN), 'id' => 'cars_options', 'type' => 'tab'), array('label' => __('Minimum days to book before rental', ST_TEXTDOMAIN), 'id' => 'cars_booking_period', 'type' => 'numeric-slider', 'min_max_step' => '0,30,1', 'std' => 0, 'desc' => __('The time period allowed booking.', ST_TEXTDOMAIN)), st()->get_option('cars_price_unit', 'day') == 'day' ? array('label' => __('Minimum days to book', ST_TEXTDOMAIN), 'id' => 'cars_booking_min_day', 'type' => 'numeric-slider', 'min_max_step' => '0,7,1', 'std' => 0, 'desc' => __('Minimum days to book', ST_TEXTDOMAIN)) : array('label' => __('Minimum hours to book', ST_TEXTDOMAIN), 'id' => 'cars_booking_min_hour', 'type' => 'numeric-slider', 'min_max_step' => '0,168,1', 'std' => 0, 'desc' => __('Minimum hours to book', ST_TEXTDOMAIN)), array('label' => __('Car external booking', ST_TEXTDOMAIN), 'id' => 'st_car_external_booking', 'type' => 'on-off', 'std' => "off"), array('label' => __('Car external booking link', ST_TEXTDOMAIN), 'id' => 'st_car_external_booking_link', 'type' => 'text', 'std' => "", 'condition' => 'st_car_external_booking:is(on)', 'desc' => "<i>" . __("Must be http://") . "</i>")));
     $data_paypment = STPaymentGateways::get_payment_gateways();
     if (!empty($data_paypment) and is_array($data_paypment)) {
         $this->metabox[0]['fields'][] = array('label' => __('Payment', ST_TEXTDOMAIN), 'id' => 'payment_detail_tab', 'type' => 'tab');
         foreach ($data_paypment as $k => $v) {
             $this->metabox[0]['fields'][] = array('label' => $v->get_name(), 'id' => 'is_meta_payment_gateway_' . $k, 'type' => 'on-off', 'desc' => $v->get_name(), 'std' => 'on');
         }
     }
     $custom_field = st()->get_option('st_cars_unlimited_custom_field');
     if (!empty($custom_field) and is_array($custom_field)) {
         $this->metabox[0]['fields'][] = array('label' => __('Custom fields', ST_TEXTDOMAIN), 'id' => 'custom_field_tab', 'type' => 'tab');
         foreach ($custom_field as $k => $v) {
             $key = str_ireplace('-', '_', 'st_custom_' . sanitize_title($v['title']));
             $this->metabox[0]['fields'][] = array('label' => $v['title'], 'id' => $key, 'type' => $v['type_field'], 'desc' => '<input value=\'[st_custom_meta key="' . $key . '"]\' type=text readonly />', 'std' => $v['default_field']);
         }
     }
     parent::register_metabox($this->metabox);
 }
 /**
  *@since 1.1.3
  **/
 public function init_metabox()
 {
     $this->metabox[] = array('id' => 'rental_room_metabox', 'title' => __('Room Setting', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('rental_room'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('General', ST_TEXTDOMAIN), 'id' => 'room_reneral_tab', 'type' => 'tab'), array('label' => __('Rental', ST_TEXTDOMAIN), 'id' => 'room_parent', 'type' => 'post_select_ajax', 'desc' => __('Choose the rental that the room belongs to', ST_TEXTDOMAIN), 'post_type' => 'st_rental', 'placeholder' => __('Search for a Rental', ST_TEXTDOMAIN)), array('label' => __('Gallery', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery'), array('label' => __('Rental Room Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Rental Room Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('rental_room')), array('label' => __('Room Facility', ST_TEXTDOMAIN), 'id' => 'rental_facility', 'type' => 'tab'), array('label' => __('No. Adults', ST_TEXTDOMAIN), 'id' => 'adult_number', 'type' => 'text', 'desc' => __('Number of Adults in room', ST_TEXTDOMAIN), 'std' => '1'), array('label' => __('No. Children', ST_TEXTDOMAIN), 'id' => 'children_number', 'type' => 'text', 'desc' => __('Number of Children in room', ST_TEXTDOMAIN), 'std' => '0'), array('label' => __('No. Beds', ST_TEXTDOMAIN), 'id' => 'bed_number', 'type' => 'text', 'desc' => __('Number of Beds in room', ST_TEXTDOMAIN), 'std' => '0'), array('label' => __('Room footage (square feet)', ST_TEXTDOMAIN), 'desc' => __('Room footage (square feet)', ST_TEXTDOMAIN), 'id' => 'room_footage', 'type' => 'text'), array('label' => __('Add a custom facility', ST_TEXTDOMAIN), 'id' => 'add_new_facility', 'type' => 'list-item', 'settings' => array(array('id' => 'value', 'type' => 'text', 'std' => '', 'label' => __('Value', ST_TEXTDOMAIN)), array('id' => 'facility_icon', 'type' => 'text', 'std' => '', 'label' => __('Icon', ST_TEXTDOMAIN), 'desc' => __('Support: fonticon <code>(eg: fa-facebook)</code>', ST_TEXTDOMAIN)))), array('label' => __('Description', ST_TEXTDOMAIN), 'id' => 'room_description', 'type' => 'textarea', 'std' => '')));
     parent::register_metabox($this->metabox);
 }
Пример #9
0
 /**
  *
  * @since 1.1.1
  * */
 function init_metabox()
 {
     $this->metabox[] = array('id' => 'hotel_metabox', 'title' => __('Hotel Information', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('st_hotel'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'location_tab', 'type' => 'tab'), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'multi_location', 'type' => 'list_item_post_type', 'desc' => __('Hotel Location', ST_TEXTDOMAIN), 'post_type' => 'location'), array('label' => __('Address', ST_TEXTDOMAIN), 'id' => 'address', 'type' => 'text', 'desc' => __('Hotel Address', ST_TEXTDOMAIN)), array('label' => __('Maps', ST_TEXTDOMAIN), 'id' => 'st_google_map', 'type' => 'bt_gmap', 'desc' => __('Maps', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Hotel Detail', ST_TEXTDOMAIN), 'id' => 'detail_tab', 'type' => 'tab'), array('label' => __('Set as Featured', ST_TEXTDOMAIN), 'id' => 'is_featured', 'type' => 'on-off', 'desc' => __('This is set as featured', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Hotel Logo', ST_TEXTDOMAIN), 'id' => 'logo', 'type' => 'upload', 'class' => '', 'desc' => __('Upload your hotel logo; Recommend: 260px x 195px', ST_TEXTDOMAIN)), array('label' => __('Card Accepted', ST_TEXTDOMAIN), 'desc' => __('Card Accepted', ST_TEXTDOMAIN), 'id' => 'card_accepted', 'type' => 'checkbox', 'choices' => $this->get_card_accepted_list()), array('label' => __('Custom Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Detail Hotel Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('st_hotel')), array('label' => __('Hotel Email', ST_TEXTDOMAIN), 'id' => 'email', 'type' => 'text', 'desc' => __('Hotel Email Address, this address will received email when have new booking', ST_TEXTDOMAIN)), array('label' => __('Hotel Website', ST_TEXTDOMAIN), 'id' => 'website', 'type' => 'text', 'desc' => __('Hotel Website. Ex: <em>http://domain.com</em>', ST_TEXTDOMAIN)), array('label' => __('Hotel Phone', ST_TEXTDOMAIN), 'id' => 'phone', 'type' => 'text', 'desc' => __('Hotel Phone Number', ST_TEXTDOMAIN)), array('label' => __('Fax Number', ST_TEXTDOMAIN), 'id' => 'fax', 'type' => 'text', 'desc' => __('Hotel Fax Number', ST_TEXTDOMAIN)), array('label' => __('Gallery', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery', 'desc' => __('Pick your own image for this hotel', ST_TEXTDOMAIN)), array('label' => __('Hotel Video', ST_TEXTDOMAIN), 'id' => 'video', 'type' => 'text', 'desc' => __('Please use youtube or vimeo video', ST_TEXTDOMAIN)), array('label' => __('Star Rating', ST_TEXTDOMAIN), 'desc' => __('Star Rating', ST_TEXTDOMAIN), 'id' => 'hotel_star', 'type' => 'numeric-slider', 'min_max_step' => '0,5,1', 'std' => 0), array('label' => __('Price', ST_TEXTDOMAIN), 'id' => 'sale_number_tab', 'type' => 'tab'), array('label' => __('Auto calculate average price', ST_TEXTDOMAIN), 'id' => 'is_auto_caculate', 'type' => 'on-off', 'desc' => __('Average price is automatically calculated', ST_TEXTDOMAIN), 'std' => 'on'), array('label' => __('Average price', ST_TEXTDOMAIN), 'id' => 'price_avg', 'type' => 'text', 'desc' => __('Average price', ST_TEXTDOMAIN), 'std' => 0, 'conditions' => 'is_auto_caculate:is(on)'), array('label' => __("Min Price", ST_TEXTDOMAIN), 'desc' => __("Min Price", ST_TEXTDOMAIN), 'id' => 'min_price', 'type' => 'text', 'std' => 0), array('label' => __('Check in/out time', ST_TEXTDOMAIN), 'id' => 'check_in_out_time', 'type' => 'tab'), array('label' => __('Allow booking full day', ST_TEXTDOMAIN), 'id' => 'allow_full_day', 'type' => 'on-off', 'std' => 'on', 'desc' => __('Allow hotel is booked full day', ST_TEXTDOMAIN)), array('label' => __('Check in time', ST_TEXTDOMAIN), 'id' => 'check_in_time', 'type' => 'st_timepicker', 'std' => '12:00 pm', 'desc' => __('Check in time', ST_TEXTDOMAIN)), array('label' => __('Check out time', ST_TEXTDOMAIN), 'id' => 'check_out_time', 'type' => 'st_timepicker', 'std' => '12:00 pm', 'desc' => __('Check out time in the next day', ST_TEXTDOMAIN)), array('label' => __('Other Options', ST_TEXTDOMAIN), 'id' => 'hotel_options', 'type' => 'tab'), array('label' => __('Minimum days to book before arrival', ST_TEXTDOMAIN), 'id' => 'hotel_booking_period', 'type' => 'numeric-slider', 'min_max_step' => '0,30,1', 'std' => 0, 'desc' => __('The time period allowed booking.', ST_TEXTDOMAIN)), array('label' => __('Minimum days to book room', ST_TEXTDOMAIN), 'id' => 'min_book_room', 'type' => 'numeric-slider', 'min_max_step' => '0,30,1', 'std' => 0, 'desc' => __('The Minium days allowed to book room.', ST_TEXTDOMAIN)), array('label' => __('Hotel policy', ST_TEXTDOMAIN), 'id' => 'hotel_policy_tab', 'type' => 'tab'), array('label' => __('Hotel policy', ST_TEXTDOMAIN), 'id' => 'hotel_policy', 'type' => 'list-item', 'settings' => array(array('label' => __('Policy Description', ST_TEXTDOMAIN), 'id' => 'policy_description', 'type' => 'textarea'))), array('label' => __('Discount Flash', ST_TEXTDOMAIN), 'id' => 'discount_banner_tab', 'type' => 'tab'), array('label' => __('Discount Text', ST_TEXTDOMAIN), 'desc' => __('Discount Text', ST_TEXTDOMAIN), 'id' => 'discount_text', 'type' => 'text')));
     $custom_field = st()->get_option('hotel_unlimited_custom_field');
     if (!empty($custom_field) and is_array($custom_field)) {
         $this->metabox[0]['fields'][] = array('label' => __('Custom fields', ST_TEXTDOMAIN), 'id' => 'custom_field_tab', 'type' => 'tab');
         foreach ($custom_field as $k => $v) {
             $key = str_ireplace('-', '_', 'st_custom_' . sanitize_title($v['title']));
             $this->metabox[0]['fields'][] = array('label' => $v['title'], 'id' => $key, 'type' => $v['type_field'], 'desc' => '<input value=\'[st_custom_meta key="' . $key . '"]\' type=text readonly />', 'std' => $v['default_field']);
         }
     }
     parent::register_metabox($this->metabox);
 }
 /**
  *@since 1.1.3
  **/
 public function init_metabox()
 {
     $this->metabox[] = array('id' => 'rental_room_metabox', 'title' => __('Room Setting', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('rental_room'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('General', ST_TEXTDOMAIN), 'id' => 'room_reneral_tab', 'type' => 'tab'), array('label' => __('Rental', ST_TEXTDOMAIN), 'id' => 'room_parent', 'type' => 'post_select_ajax', 'desc' => __('Choose the rental that the room belong', ST_TEXTDOMAIN), 'post_type' => 'st_rental', 'placeholder' => __('Search for a Rental', ST_TEXTDOMAIN)), array('label' => __('Gallery', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery'), array('label' => __('Rental Room Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Rental Room Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('rental_room'))));
     parent::register_metabox($this->metabox);
 }
Пример #11
0
 /**
  *
  *
  * @since 1.1.1
  * @update 1.1.2
  * */
 function init_metabox()
 {
     //Room
     $this->metabox[] = array('id' => 'room_metabox', 'title' => __('Restaurent Details', ST_TEXTDOMAIN), 'desc' => '', 'pages' => array('st_food'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('General', ST_TEXTDOMAIN), 'id' => 'room_reneral_tab', 'type' => 'tab'), array('label' => __('Set as Featured', ST_TEXTDOMAIN), 'id' => 'is_featured', 'type' => 'on-off', 'desc' => __('Set this location is featured', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Gallery', ST_TEXTDOMAIN), 'desc' => __('Select food images ', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery'), array('label' => __('Gallery style', ST_TEXTDOMAIN), 'id' => 'gallery_style', 'type' => 'select', 'choices' => array(array('value' => 'grid', 'label' => __('Grid', ST_TEXTDOMAIN)), array('value' => 'slider', 'label' => __('Slider', ST_TEXTDOMAIN)))), array('label' => __('Website', ST_TEXTDOMAIN), 'id' => 'website', 'type' => 'text', 'desc' => __('Website addresses', ST_TEXTDOMAIN)), array('label' => __('Contact email addresses', ST_TEXTDOMAIN), 'id' => 'contact_email', 'type' => 'text', 'desc' => __('Contact email addresses', ST_TEXTDOMAIN)), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'location_reneral_tab', 'type' => 'tab'), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'id_location', 'type' => 'post_select_ajax', 'post_type' => 'location'), array('label' => __('Address', ST_TEXTDOMAIN), 'id' => 'address', 'type' => 'text', 'desc' => __('Address', ST_TEXTDOMAIN)), array('label' => __('Latitude', ST_TEXTDOMAIN), 'id' => 'map_lat', 'type' => 'text', 'desc' => __('Latitude <a href="http://www.latlong.net/" target="_blank">Get here</a>', ST_TEXTDOMAIN)), array('label' => __('Longitude', ST_TEXTDOMAIN), 'id' => 'map_lng', 'type' => 'text', 'desc' => __('Longitude', ST_TEXTDOMAIN)), array('label' => __('Map Zoom', ST_TEXTDOMAIN), 'id' => 'map_zoom', 'type' => 'text', 'desc' => __('Map Zoom', ST_TEXTDOMAIN), 'std' => 13), array('label' => __('Price setting', ST_TEXTDOMAIN), 'id' => 'price_number_tab', 'type' => 'tab'), array('label' => __('Type Price', ST_TEXTDOMAIN), 'id' => 'type_price', 'type' => 'select', 'desc' => __('Type Price', ST_TEXTDOMAIN), 'choices' => array(array('value' => 'group_price', 'label' => __('Price / Group', ST_TEXTDOMAIN)), array('value' => 'people_price', 'label' => __('Price / Person', ST_TEXTDOMAIN)))), array('label' => __('Price', ST_TEXTDOMAIN), 'id' => 'price', 'type' => 'text', 'desc' => __('Price ', ST_TEXTDOMAIN), 'std' => 0, 'condition' => 'type_price:is(tour_price)'), array('label' => __('Adult Price', ST_TEXTDOMAIN), 'id' => 'adult_price', 'type' => 'text', 'desc' => __('Price per Adult', ST_TEXTDOMAIN), 'std' => 0, 'condition' => 'type_price:is(people_price)'), array('label' => __('Fields list discount by Adult number booking', ST_TEXTDOMAIN), 'id' => 'discount_by_adult', 'type' => 'list-item', 'desc' => __('Fields list discount by Adult number booking', ST_TEXTDOMAIN), 'std' => 0, 'condition' => 'type_price:is(people_price)', 'settings' => array(array('id' => 'key', 'label' => __('Key number', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'value', 'label' => __('Value percent of discount', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,1'))), array('label' => __('Child Price', ST_TEXTDOMAIN), 'id' => 'child_price', 'type' => 'text', 'desc' => __('Price per Child', ST_TEXTDOMAIN), 'std' => 0, 'condition' => 'type_price:is(people_price)'), array('label' => __('Fields list discount by Child number booking', ST_TEXTDOMAIN), 'id' => 'discount_by_child', 'type' => 'list-item', 'desc' => __('Fields list discount by Child number booking', ST_TEXTDOMAIN), 'std' => 0, 'condition' => 'type_price:is(people_price)', 'settings' => array(array('id' => 'key', 'label' => __('Key number', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'value', 'label' => __('Value percent of discount', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,1'))), array('label' => __('Discount by percent', ST_TEXTDOMAIN), 'id' => 'discount', 'type' => 'numeric-slider', 'min_max_step' => '0,100,1', 'desc' => __('Discount of this tour, by percent', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Sale Schedule', ST_TEXTDOMAIN), 'id' => 'is_sale_schedule', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Sale Start Date', ST_TEXTDOMAIN), 'desc' => __('Sale Start Date', ST_TEXTDOMAIN), 'id' => 'sale_price_from', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Sale End Date', ST_TEXTDOMAIN), 'desc' => __('Sale End Date', ST_TEXTDOMAIN), 'id' => 'sale_price_to', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('id' => 'deposit_payment_status', 'label' => __("Deposit payment options", ST_TEXTDOMAIN), 'desc' => __('You can select <code>Disallow Deposit</code>, <code>Deposit by percent</code>, <code>Deposit by amount</code>'), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Disallow Deposit', ST_TEXTDOMAIN)), array('value' => 'percent', 'label' => __('Deposit by percent', ST_TEXTDOMAIN)), array('value' => 'amount', 'label' => __('Deposit by amount', ST_TEXTDOMAIN)))), array('label' => __('Deposit payment amount', ST_TEXTDOMAIN), 'desc' => __('Leave empty for disallow deposit payment', ST_TEXTDOMAIN), 'id' => 'deposit_payment_amount', 'type' => 'text', 'condition' => 'deposit_payment_status:not()')));
     $data_paypment = STPaymentGateways::$_payment_gateways;
     if (!empty($data_paypment) and is_array($data_paypment)) {
         $this->metabox[0]['fields'][] = array('label' => __('Payment', ST_TEXTDOMAIN), 'id' => 'payment_detail_tab', 'type' => 'tab');
         foreach ($data_paypment as $k => $v) {
             $this->metabox[0]['fields'][] = array('label' => $v->get_name(), 'id' => 'is_meta_payment_gateway_' . $k, 'type' => 'on-off', 'desc' => $v->get_name(), 'std' => 'on');
         }
     }
     $custom_field = st()->get_option('tours_unlimited_custom_field');
     if (!empty($custom_field) and is_array($custom_field)) {
         $this->metabox[0]['fields'][] = array('label' => __('Custom fields', ST_TEXTDOMAIN), 'id' => 'custom_field_tab', 'type' => 'tab');
         foreach ($custom_field as $k => $v) {
             $key = str_ireplace('-', '_', 'st_custom_' . sanitize_title($v['title']));
             $this->metabox[0]['fields'][] = array('label' => $v['title'], 'id' => $key, 'type' => $v['type_field'], 'desc' => '<input value=\'[st_custom_meta key="' . $key . '"]\' type=text readonly />', 'std' => $v['default_field']);
         }
     }
     parent::register_metabox($this->metabox);
 }
Пример #12
0
 /**
  *
  *
  * @since 1.1.1
  * */
 function init_metabox()
 {
     //Room
     $this->metabox[] = array('id' => 'room_metabox', 'title' => __('Activity Setting', ST_TEXTDOMAIN), 'pages' => array('st_activity'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'location_reneral_tab', 'type' => 'tab'), array('label' => __('Location', ST_TEXTDOMAIN), 'id' => 'multi_location', 'type' => 'list_item_post_type', 'desc' => __('Tour Location', ST_TEXTDOMAIN), 'post_type' => 'location'), array('label' => __('Address', ST_TEXTDOMAIN), 'id' => 'address', 'type' => 'text'), array('label' => __('Maps', ST_TEXTDOMAIN), 'id' => 'st_google_map', 'type' => 'bt_gmap', 'desc' => __('Maps', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('General', ST_TEXTDOMAIN), 'id' => 'room_reneral_tab', 'type' => 'tab'), array('label' => __('Set as Featured', ST_TEXTDOMAIN), 'id' => 'is_featured', 'type' => 'on-off', 'desc' => __('This is set as featured', ST_TEXTDOMAIN), 'std' => 'off'), array('label' => __('Custom Layout', ST_TEXTDOMAIN), 'id' => 'st_custom_layout', 'post_type' => 'st_layouts', 'desc' => __('Detail Tour Layout', ST_TEXTDOMAIN), 'type' => 'select', 'choices' => st_get_layout('st_activity')), array('label' => __('Gallery', ST_TEXTDOMAIN), 'id' => 'gallery', 'type' => 'gallery'), array('label' => __('Contact email address', ST_TEXTDOMAIN), 'id' => 'contact_email', 'type' => 'text', 'desc' => __('Contact email address', ST_TEXTDOMAIN)), array('label' => __('Website', ST_TEXTDOMAIN), 'id' => 'contact_web', 'type' => 'text', 'desc' => __('Website', ST_TEXTDOMAIN)), array('label' => __('Phone', ST_TEXTDOMAIN), 'id' => 'contact_phone', 'type' => 'text', 'desc' => __('Phone', ST_TEXTDOMAIN)), array('label' => __('Video', ST_TEXTDOMAIN), 'id' => 'video', 'type' => 'text', 'desc' => __('Please use youtube or vimeo video', ST_TEXTDOMAIN)), array('label' => __('Info setting', ST_TEXTDOMAIN), 'id' => 'activity_time_number_tab', 'type' => 'tab'), array('label' => __('Activity Type', ST_TEXTDOMAIN), 'id' => 'type_activity', 'type' => 'select', 'desc' => __('Activity Type', ST_TEXTDOMAIN), 'choices' => array(array('value' => 'specific_date', 'label' => __('Specific Date', ST_TEXTDOMAIN)), array('value' => 'daily_activity', 'label' => __('Daily Activity', ST_TEXTDOMAIN)))), array('label' => __('Check In', ST_TEXTDOMAIN), 'id' => 'check_in', 'type' => 'date_picker', 'condition' => 'type_activity:is(specific_date)', 'desc' => __('Check In', ST_TEXTDOMAIN)), array('label' => __('Check Out', ST_TEXTDOMAIN), 'id' => 'check_out', 'type' => 'date_picker', 'condition' => 'type_activity:is(specific_date)', 'desc' => __('Check Out', ST_TEXTDOMAIN)), array('label' => __('Duration', ST_TEXTDOMAIN), 'id' => 'duration', 'type' => 'text', 'condition' => 'type_activity:is(daily_activity)', 'desc' => __('The total time to take each activity package', ST_TEXTDOMAIN)), array('label' => __('Booking Period', ST_TEXTDOMAIN), 'id' => 'activity_booking_period', 'type' => 'numeric-slider', 'min_max_step' => '0,30,1', 'std' => 0, 'condition' => 'type_activity:is(daily_activity)', 'desc' => __('The time period allowed booking.', ST_TEXTDOMAIN)), array('label' => __('Activity Time', ST_TEXTDOMAIN), 'id' => 'activity-time', 'type' => 'text', 'desc' => __('The departure time of an activity', ST_TEXTDOMAIN)), array('label' => __('Max number of people', ST_TEXTDOMAIN), 'id' => 'max_people', 'type' => 'text', 'desc' => __('Max number of people', ST_TEXTDOMAIN), 'std' => '1'), array('label' => __('Venue Facilities', ST_TEXTDOMAIN), 'id' => 'venue-facilities', 'type' => 'text', 'desc' => __('The facilities that customer may experience during activities', ST_TEXTDOMAIN)), array('label' => __('Price setting', ST_TEXTDOMAIN), 'id' => 'price_number_tab', 'type' => 'tab'), array('label' => __('Adult Price', ST_TEXTDOMAIN), 'id' => 'adult_price', 'type' => 'text', 'desc' => __('Price per Adult', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Fields list discount by Adult number booking', ST_TEXTDOMAIN), 'id' => 'discount_by_adult', 'type' => 'list-item', 'desc' => __('Fields list discount by Adult number booking', ST_TEXTDOMAIN), 'std' => 0, 'settings' => array(array('id' => 'key', 'label' => __('Number of Adult', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'value', 'label' => __('Value percent of discount', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,1'))), array('label' => __('Child Price', ST_TEXTDOMAIN), 'id' => 'child_price', 'type' => 'text', 'desc' => __('Price per Child', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Fields list discount by Child number booking', ST_TEXTDOMAIN), 'id' => 'discount_by_child', 'type' => 'list-item', 'desc' => __('Fields list discount by Child number booking', ST_TEXTDOMAIN), 'std' => 0, 'settings' => array(array('id' => 'key', 'label' => __('Number of Children', ST_TEXTDOMAIN), 'type' => 'text'), array('id' => 'value', 'label' => __('Value percent of discount', ST_TEXTDOMAIN), 'type' => 'numeric-slider', 'min_max_step' => '0,100,1'))), array('label' => __('Infant Price', ST_TEXTDOMAIN), 'id' => 'infant_price', 'type' => 'text', 'desc' => __('Price per Infant', ST_TEXTDOMAIN), 'std' => 0), array('label' => __('Discount', ST_TEXTDOMAIN), 'desc' => __('Discount', ST_TEXTDOMAIN), 'id' => 'discount', 'type' => 'numeric-slider', 'std' => 0), array('label' => __('Sale Schedule', ST_TEXTDOMAIN), 'id' => 'is_sale_schedule', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Sale Price Date From', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date From', ST_TEXTDOMAIN), 'id' => 'sale_price_from', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Sale Price Date To', ST_TEXTDOMAIN), 'desc' => __('Sale Price Date To', ST_TEXTDOMAIN), 'id' => 'sale_price_to', 'type' => 'date-picker', 'condition' => 'is_sale_schedule:is(on)'), array('label' => __('Best Price Guarantee', ST_TEXTDOMAIN), 'id' => 'best-price-guarantee', 'type' => 'on-off', 'std' => 'off'), array('label' => __('Best Price Guarantee Text', ST_TEXTDOMAIN), 'id' => 'best-price-guarantee-text', 'type' => 'textarea', 'rows' => '2', 'condition' => 'best-price-guarantee:is(on)'), array('label' => __('Activity external booking', ST_TEXTDOMAIN), 'id' => 'st_activity_external_booking', 'type' => 'on-off', 'std' => "off"), array('label' => __('Activity external booking', ST_TEXTDOMAIN), 'id' => 'st_activity_external_booking_link', 'type' => 'text', 'std' => "", 'condition' => 'st_activity_external_booking:is(on)', 'desc' => "<em>" . __('Notice: Must be http://...', ST_TEXTDOMAIN) . "</em>"), array('id' => 'deposit_payment_status', 'label' => __("Deposit payment options", ST_TEXTDOMAIN), 'desc' => __('You can select <code>Disallow Deposit</code>, <code>Deposit by percent</code>, <code>Deposit by amount</code>'), 'type' => 'select', 'choices' => array(array('value' => '', 'label' => __('Disallow Deposit', ST_TEXTDOMAIN)), array('value' => 'percent', 'label' => __('Deposit by percent', ST_TEXTDOMAIN)), array('value' => 'amount', 'label' => __('Deposit by amount', ST_TEXTDOMAIN)))), array('label' => __('Deposit payment amount', ST_TEXTDOMAIN), 'desc' => __('Leave empty for disallow deposit payment', ST_TEXTDOMAIN), 'id' => 'deposit_payment_amount', 'type' => 'text', 'condition' => 'deposit_payment_status:not()')));
     $data_paypment = STPaymentGateways::get_payment_gateways();
     if (!empty($data_paypment) and is_array($data_paypment)) {
         $this->metabox[0]['fields'][] = array('label' => __('Payment', ST_TEXTDOMAIN), 'id' => 'payment_detail_tab', 'type' => 'tab');
         foreach ($data_paypment as $k => $v) {
             $this->metabox[0]['fields'][] = array('label' => $v->get_name(), 'id' => 'is_meta_payment_gateway_' . $k, 'type' => 'on-off', 'desc' => $v->get_name(), 'std' => 'on');
         }
     }
     $custom_field = st()->get_option('st_activity_unlimited_custom_field');
     if (!empty($custom_field) and is_array($custom_field)) {
         $this->metabox[0]['fields'][] = array('label' => __('Custom fields', ST_TEXTDOMAIN), 'id' => 'custom_field_tab', 'type' => 'tab');
         foreach ($custom_field as $k => $v) {
             $key = str_ireplace('-', '_', 'st_custom_' . sanitize_title($v['title']));
             $this->metabox[0]['fields'][] = array('label' => $v['title'], 'id' => $key, 'type' => $v['type_field'], 'desc' => '<input value=\'[st_custom_meta key="' . $key . '"]\' type=text readonly />', 'std' => $v['default_field']);
         }
     }
     parent::register_metabox($this->metabox);
 }