/**
  * fields definition
  * @param $sections
  */
 public function get_fields(&$sections)
 {
     //install plugins link
     if (is_plugin_active('multi-image-metabox')) {
         $install_multi_image_link = hw_install_plugin_link('multi-image-metabox', 'Cài đặt');
     } else {
         $install_multi_image_link = '';
     }
     //help for multi image metabox
     if (class_exists('HW_HELP_HOANGWEB', false)) {
         //$multi_image_help = HW_HELP_HOANGWEB::current()->help_static_link('multi-image-metabox.html');
         $multi_image_help = HW_HELP::generate_help_popup(array('HW_HELP_HOANGWEB', 'multi-image-metabox.html'), 'Hướng dẫn.', 'Hướng dẫn Multi Image Metabox');
     } else {
         $multi_image_help = '';
     }
     //gallery
     $sections['gallery'] = array('icon' => NHP_OPTIONS_URL . 'img/glyphicons/glyphicons_001_leaf.png', 'title' => 'Gallery', 'fields' => array('enable_multi_images' => array('id' => 'enable_multi_images', 'type' => 'checkbox', 'title' => 'Kích hoạt gallery ảnh', 'desc' => 'Kích hoạt gallery ảnh cho mỗi bài viết/post type. ' . $install_multi_image_link, 'sub_desc' => $multi_image_help), 'posttype_multi_images' => array('id' => 'posttype_multi_images', 'type' => 'hw_post_type_multi_select', 'title' => 'Chọn post types cho multi-images.', 'sub_desc' => 'Chọn một hoặc nhiều post type sử dụng tính năng gallery ảnh.', 'size' => 8), 'multi_images_num' => array('id' => 'multi_images_num', 'type' => 'text', 'title' => 'Số lượng multi-images.', 'sub_desc' => 'Số lượng ảnh gallery cho phép sử dụng.', 'std' => '200'), 'divide' => array('type' => 'hw_divide', 'label' => 'Envira Gallery'), 'envira_exclude_posttypes' => array('id' => 'envira_exclude_posttypes', 'type' => 'hw_post_type_multi_select', 'title' => 'Loại bỏ post types', 'sub_desc' => 'Chọn một hoặc nhiều post type không muốn tích hợp Envira gallery.')));
 }
 public function get_fields(&$sections)
 {
     //effects
     $effects = array('0' => 'Không hiệu ứng', 'snow' => 'Tuyết rơi', 'fireworks' => 'Pháo hoa');
     if (class_exists('AWC_WidgetFeature_fancybox')) {
         $fancybox_options = AWC_WidgetFeature_fancybox::get_options_definition();
     } else {
         $fancybox_options = array();
     }
     //fancybox help
     if (class_exists('HW_HELP')) {
         //$fancybox_help = HW_HELP_HOANGWEB::current()->help_static_link('fancybox.html');
         $fancybox_help = HW_HELP::generate_help_popup(array('HW_HELP_HOANGWEB', 'fancybox.html'), 'Hướng dẫn', 'Hướng dẫn fancybox');
         //HW_HELP::generate_help_popup(array('HW_HELP_HOANGWEB','fancybox.html'), 'Hướng dẫn');     //other approach
     } else {
         $fancybox_help = '';
     }
     //features
     $sections['features'] = array('icon' => NHP_OPTIONS_URL . 'img/glyphicons/glyphicons_280_settings.png', 'title' => 'Chức năng', 'fields' => array('debug' => array('id' => 'debug', 'type' => 'checkbox', 'title' => 'Kích hoạt debug', 'desc' => 'Kích hoạt debug lỗi.'), 'scroll2top' => array('id' => 'scroll2top', 'type' => 'checkbox', 'title' => 'Kích hoạt scroll to top', 'desc' => 'Kích hoạt tính năng nút cuộn trang.'), 'scroll2top_skin' => array('id' => 'scroll2top_skin', 'type' => 'hw_skin_link', 'title' => 'Chọn giao diện nút cuộn nội dung website.', 'desc' => 'Chọn giao diện nút cuộn nội dung website.', 'external_skins_folder' => 'hw_scroll2top_skins', 'skin_filename' => 'hw-scroll2top.php', 'enable_external_callback' => false, 'skins_folder' => 'skins', 'apply_current_path' => plugin_dir_path(dirname(dirname(__FILE__))), 'plugin_url' => plugins_url('', dirname(dirname(__FILE__))), 'files_skin_folder' => 'images', 'display' => 'ddslick', 'group' => 'scroll2top'), 'nice_scrollbar' => array('id' => 'nice_scrollbar', 'type' => 'select', 'title' => 'Giao diện thanh cuộn', 'desc' => 'Chọn thanh cuộn đẹp cho website.', 'options' => array()), 'effect' => array('id' => 'effect', 'type' => 'select', 'title' => 'Hiệu ứng nền', 'desc' => 'Sử dụng hiệu ứng nền', 'options' => $effects), 'fancybox' => array('id' => 'fancybox', 'type' => 'checkbox', 'title' => 'Bật tính năng fancybox', 'desc' => 'Bật tính năng fancybox', 'sub_desc' => $fancybox_help), 'fancybox_settings' => array('id' => 'fancybox_settings', 'type' => 'hw_options', 'title' => 'Thiết lập cấu hình fancybox', 'desc' => 'Thiết lập cấu hình fancybox', 'settings' => $fancybox_options)));
 }
 public function get_fields(&$sections)
 {
     //get all my custom metaslider
     if (class_exists('HWML_Slider_Settings_Metabox')) {
         $edit_slider_link = HWML_Slider_Settings_Metabox::get_edit_sliders_url();
         $edit_hw_slider_link = HWML_Slider_Settings_Metabox::get_edit_hw_sliders_url();
         $ml_slides = HWML_Slider_Settings_Metabox::get_all_mlsliders();
         $hw_sliders = hwml_get_all_sliders();
         //hwml_shortcode posts list
     } else {
         $edit_slider_link = admin_url('admin.php?page=hw-metaslider');
         $edit_hw_slider_link = '';
         $ml_slides = array();
         $hw_sliders = array();
     }
     if (class_exists('HW_HELP')) {
         //$gmap_help = HW_HELP_HOANGWEB::current()->help_static_link('gmap.html');  //old way
         $gmap_help = HW_HELP::generate_help_popup(array('HW_HELP_HOANGWEB', 'gmap.html'), 'Hướng dẫn.');
     } else {
         $gmap_help = '';
     }
     //general settings
     $sections['general'] = array('icon' => NHP_OPTIONS_URL . 'img/glyphicons/glyphicons_151_edit.png', 'title' => 'Thông tin', 'fields' => array('site_name' => array('id' => 'site_name', 'type' => 'text', 'title' => 'Tên website'), 'slogan' => array('id' => 'slogan', 'type' => 'text', 'title' => 'Khẩu hiệu'), 'admin_logo' => array('id' => 'admin_logo', 'type' => 'upload', 'title' => 'Logo', 'desc' => 'Logo hiển thị ở trang đăng nhập và trên website.', 'validate_callback' => array($this, 'validate_header_fields_cb')), 'site_banner' => array('id' => 'site_banner', 'type' => 'upload', 'title' => 'Banner', 'desc' => 'Banner hiển thị ở phần header của website.', 'validate_callback' => array($this, 'validate_header_fields_cb')), 'phone' => array('id' => 'phone', 'type' => 'text', 'title' => 'Số điện thoại', 'desc' => 'Nhập số hotline hiển thị trên web'), 'admin_email' => array('id' => 'admin_email', 'type' => 'text', 'title' => 'Email', 'desc' => 'Địa chỉ email.', 'validate' => 'email'), 'address' => array('id' => 'address', 'type' => 'text', 'title' => 'Địa chỉ bản đồ', 'desc' => 'Nhập khu vực/địa chỉ của bạn muốn xuất hiện trên bản đồ. ', 'sub_desc' => $gmap_help), 'home_slider_id' => array('id' => 'main_slider_id', 'type' => 'select', 'title' => 'Slider', 'desc' => 'Chọn slider', 'sub_desc' => 'Chọn slider chính. Thêm/sửa slider <a href="' . $edit_slider_link . '" target="_blank">tại đây</a>.', 'options' => $ml_slides), 'main_hw_slider' => array('id' => 'main_hw_slider', 'type' => 'select', 'title' => 'Hoangweb slider', 'sub_desc' => 'Chọn hoangweb slider. Thêm/sửa sliders, <a href="' . $edit_hw_slider_link . '" target="_blank">tại đây</a>', 'options' => $hw_sliders), 'testimonials' => array('id' => 'testimonials', 'type' => 'hw_ckeditor', 'title' => 'Testimonials', 'desc' => 'Lời chứng thực ở trang chủ.'), 'wp_head_script' => array('id' => 'wp_head_script', 'type' => 'textarea', 'title' => 'Chèn thêm scripts vào thẻ < head'), 'wp_footer_code' => array('id' => 'wp_footer_code', 'type' => 'textarea', 'title' => 'Chèn mã HTML, JS, CSS vào dưới chân website')));
 }
 /**
  * load form settings
  * @param unknown $oAdminPage
  */
 public function load_hw_social_option($oAdminPage)
 {
     // load_{page slug}
     $HW_Socials_fields = hwss_option();
     //get list of pages
     $pages = get_pages();
     $list = array('__all__' => 'Tất cả', '__home__' => 'Trang Chủ');
     foreach ($pages as $page) {
         $list[$page->post_name] = $page->post_title;
     }
     //get socials button & also order by user
     $socials = self::get_sort_socials_selected();
     //list avaiable sharing services
     $services = array();
     foreach (HW_SocialShare_widget::$sharing_services as $key => $item) {
         if (isset($item['enable']) && !$item['enable']) {
             continue;
         }
         $services[$key] = ucfirst($item['text']);
     }
     //default custom css
     $custom_css_def = '';
     if (!empty($HW_Socials_fields['wrap_id'])) {
         $custom_css_def = '#' . $HW_Socials_fields['wrap_id'] . '{position:relative;}';
     }
     //help popup
     if (class_exists('HW_HELP')) {
         $guide_link = 'Xem ' . HW_HELP::generate_help_popup(array('HW_HELP_SHARE', 'share.html'), 'hướng dẫn chi tiết', 'hướng dẫn tạo nút chia sẻ');
     } else {
         $guide_link = '';
     }
     $this->addSettingSections('hw_social_option', array('section_id' => 'my_first_section', 'title' => 'My First Form Section', 'description' => 'This section is for text fields.'), array('section_id' => 'my_second_section', 'title' => 'My Second Form Section', 'description' => 'This section is for selectors.'));
     $this->addSettingFields(array('field_id' => 'help', 'type' => 'title', 'description' => $guide_link), array('field_id' => 'enable_side_share_bar', 'type' => 'checkbox', 'title' => __('Kích hoạt', 'hwss'), 'description' => __('Kích hoạt thanh chia sẻ ở sườn website.', 'hwss')), array('field_id' => 'sharing_service', 'type' => 'select', 'title' => __('Chọn dịch vụ', 'hwss'), 'description' => __('Lựa chọn dịch vụ chia sẻ như addthis, sharethis,..', 'hwss'), 'label' => $services), array('field_id' => 'wrap_id', 'type' => 'text', 'title' => __('Wrap DIV selector', 'hwss'), 'description' => __('ID/class thẻ div bao khung website. Cần chỉ định giá trị này để hiển thị nút chia sẻ ở sườn website.<br/>VD: .site-inner', 'hwss'), 'default' => ''), array('field_id' => 'pages_list', 'type' => 'select', 'title' => __('Hiển thị ở trang', 'hwss'), 'description' => __('Chọn trang hiển thị.', 'hwss'), 'label' => $list, 'is_multiple' => true, 'attributes' => array('select' => array('size' => 5))), array('field_id' => 'socials_button', 'type' => 'socials_button_picker', 'title' => __('Chọn nút & xắp xếp', 'hwss'), 'description' => __('Chọn một hoặc nhiều nút mạng xã hội, bạn có thể di chuyển xắp lại thứ tự hiển thị.', 'hwss'), 'label' => $socials, 'is_multiple' => true, 'attributes' => array('select' => array('size' => 10))), array('field_id' => 'custom_css', 'type' => 'textarea', 'title' => __('Tùy biến CSS', 'hwss'), 'description' => __('Chèn thêm CSS.', 'hwss'), 'default' => '/*chèn CSS ở đây*/' . $custom_css_def), array('field_id' => 'button_size', 'type' => 'text', 'title' => 'Kích thước', 'description' => 'Kích thước co dãn. VD: 1 (small), 1.5 (medium),..', 'default' => '1'), array('field_id' => 'socials_button_hidden', 'type' => 'hidden'), array('field_id' => 'enable_standard_buttons_in_post', 'type' => 'checkbox', 'title' => __('Kích hoạt trong bài viết.', 'hwss'), 'description' => __('Kích hoạt nút socials chuẩn trong bài viết chi tiết.', 'hwss')), array('field_id' => 'submit_button', 'type' => 'submit'));
 }