__( 'Settings', 'advanced-notifications' ), 'admin_menu_name' => __( 'Settings', 'advanced-notifications' ), 'admin_menu_parent' => 'edit.php?post_type=a_notifications', 'order' => 99, ); eis_register_interface('an_settings', $args); // NOTIFICATIONS $args = array( 'type' => 'meta_box', 'post_type' => 'a_notifications', 'tab_save' => false, 'meta_box_priority' => 'high', 'settings_title' => __( 'Notification settings', 'advanced-notifications' ), ); eis_register_interface('a_notifications', $args); // DESIGNS $args = array( 'type' => 'meta_box', 'post_type' => 'an_designs', 'tab_save' => false, 'meta_box_priority' => 'high', 'settings_title' => __( 'Designs settings', 'advanced-notifications' ), ); eis_register_interface('an_designs', $args); // TRIGGERS $args = array( 'type' => 'meta_box', 'post_type' => 'an_triggers', 'tab_save' => false, 'meta_box_priority' => 'high', 'settings_title' => __( 'Triggers settings', 'advanced-notifications' ), ); eis_register_interface('an_triggers', $args); // LOCATIONS $args = array( 'type' => 'meta_box', 'post_type' => 'an_locations', 'tab_save' => false, 'meta_box_priority' => 'high', 'settings_title' => __( 'Location settings', 'advanced-notifications' ), ); eis_register_interface('an_locations', $args); } add_action('add_eis_register_interface', 'an_interface'); function an_interface_options() { global $an_core, $an_functions, $an_api, $an_animations; // SETTINGS // eis_tab('an_settings', 'general', __('General', 'advanced-notifications') ); eis_tab('an_settings', 'layout', __('Layout', 'advanced-notifications') ); $yes_no = array ( 'yes' => __('Yes', 'advanced-notifications'), 'no' => __('No', 'advanced-notifications'), ); $no_yes = array ( 'no' => __('No', 'advanced-notifications'), 'yes' => __('Yes', 'advanced-notifications'), ); $no_yes_pro = array ( 'no' => __('No', 'advanced-notifications'), 'yes_eis_disabled' => __('Yes', 'advanced-notifications') . ' - ' . __('PRO', 'advanced-notifications'), ); // eis_tab_option( array( // 'interface_id' => 'an_settings', // 'tab_id' => 'general', // 'input_id' => 'test', // 'input_type' => 'date', // 'label' => __('TEST', 'advanced-notifications'), // )); // eis_tab_option( array( // 'interface_id' => 'an_settings', // 'tab_id' => 'general', // 'input_id' => 'test1', // 'input_type' => 'date', // 'label' => __('TEST', 'advanced-notifications'), // )); eis_tab_option( array( 'interface_id' => 'an_settings', 'tab_id' => 'layout', 'input_id' => 'mobile_breakpoint', 'input_type' => 'number', 'label' => __('Mobile Breakpoint (px)', 'advanced-notifications'), 'placeholder' => '767', 'default' => '767', // 'css_var' => 'mobile_breakpoint', // 'css_units' => 'px', )); eis_tab_option( array( 'interface_id' => 'an_settings', 'tab_id' => 'layout', 'input_id' => 'tablet_breakpoint', 'input_type' => 'number', 'label' => __('Tablet Breakpoint (px)', 'advanced-notifications'), 'placeholder' => '1024', 'default' => '1024', // 'css_var' => 'tablet_breakpoint', // 'css_units' => 'px', )); // NOTIFICATIONS eis_tab('a_notifications', 'general', __('General', 'advanced-notifications') ); eis_tab('a_notifications', 'display', __('Display', 'advanced-notifications') ); eis_tab('a_notifications', 'publish', __('Publish', 'advanced-notifications') ); eis_tab('a_notifications', 'rules', __('Rules', 'advanced-notifications') ); function an_position_unit() { return array( 'px' => __('px', 'advanced-notifications'), '%' => __('%', 'advanced-notifications'), ); } // general function an_add_pro_notification_types($notification_types) { global $an_core; if ($an_core->license_type() == 'basic') { $notification_types['elementor_eis_disabled'] = __('Elementor', 'advanced-notifications') . ' - ' . __('PRO', 'advanced-notifications'); $notification_types['product_eis_disabled'] = __('Product', 'advanced-notifications') . ' - ' . __('PRO', 'advanced-notifications'); } return $notification_types; } add_filter('an_notification_types', 'an_add_pro_notification_types'); $notification_types = $an_functions->notification_types(); $notification_role = array(); foreach ($an_functions->an_notification_roles() as $key => $role_name) { if ($key == 'all') { $notification_role['all'] = $role_name; } else { $notification_role[$key . '_eis_disabled'] = $role_name . ' - ' . __('PRO', 'advanced-notifications'); } } eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'general', 'input_id' => 'status', 'input_type' => 'checkbox', 'label' => __('Notification status', 'advanced-notifications'), 'description' => __('Enable / disable the notification, if checked the notification is active', 'advanced-notifications'), 'checkbox_checked' => true, 'order' => 1, )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'general', 'input_id' => 'type', 'input_type' => 'select', 'label' => __('Notification type', 'advanced-notifications'), 'description' => '', 'input_select_options' => $notification_types, 'order' => 2, )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'general', 'input_id' => 'type_html', 'input_type' => 'textarea', 'label' => __('Notification html', 'advanced-notifications'), 'description' => '', 'parent_name' => 'type', 'show_on_value' => 'html', 'multilingual' => true, 'shortcode' => true, )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'general', 'input_id' => 'type_image', 'input_type' => 'image', 'label' => __('Notification image', 'advanced-notifications'), 'description' => '', 'parent_name' => 'type', 'show_on_value' => 'image', 'multilingual' => true, )); if ($an_core->license_type() == 'basic') { eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'general', 'input_id' => 'role', 'input_type' => 'select', 'label' => __('Who can see?', 'advanced-notifications'), 'description' => '', 'input_select_options' => $notification_role, 'order' => 3, )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'general', 'input_id' => 'scheduled', 'input_type' => 'select', 'label' => __('Scheduled notification', 'advanced-notifications'), 'description' => '', 'input_select_options' => $no_yes_pro, 'order' => 4, )); } // display $devices_list = $an_functions->devices_list(); $locations = array(); foreach ($an_api->locations_list() as $location) { $locations[$location['id']] = $location['label']; } $designs = array(); foreach ($an_api->designs_list() as $design) { $designs[$design['id']] = $design['label']; } $show_when = $an_functions->show_when(); $animations_in = $an_animations->an_animations_in(); $animations_out = $an_animations->an_animations_out(); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'devices_list', 'input_type' => 'select', 'label' => __('Devices', 'advanced-notifications'), 'description' => '', 'input_select_options' => $devices_list, 'order' => 1, )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'location', 'input_type' => 'select', 'label' => __('Location', 'advanced-notifications'), 'description' => '', 'input_select_options' => apply_filters('an_locations_select_list', $locations), 'default' => (is_rtl() ? 'bottom_right' : 'bottom_left'), 'order' => 3, 'parent_name' => 'type', 'hide_on_value' => 'sidebar', )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'location_image', 'input_type' => 'image_preview', 'label' => __('Location preview', 'advanced-notifications'), 'note' => __('width', 'advanced-notifications') . ': 350px', 'image_preview_url' => ADVANCED_NOTIFICATIONS_URL_PATH . 'assets/images/bottom-left.png', 'parent_name' => 'location', 'show_on_value' => 'bottom_left', )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'location_image', 'input_type' => 'image_preview', 'label' => __('Location preview', 'advanced-notifications'), 'note' => __('width', 'advanced-notifications') . ': 350px', 'image_preview_url' => ADVANCED_NOTIFICATIONS_URL_PATH . 'assets/images/bottom-right.png', 'parent_name' => 'location', 'show_on_value' => 'bottom_right', )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'location_image', 'input_type' => 'image_preview', 'label' => __('Location preview', 'advanced-notifications'), 'note' => __('width', 'advanced-notifications') . ': 350px', 'image_preview_url' => ADVANCED_NOTIFICATIONS_URL_PATH . 'assets/images/top-left.png', 'parent_name' => 'location', 'show_on_value' => 'top_left', )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'location_image', 'input_type' => 'image_preview', 'label' => __('Location preview', 'advanced-notifications'), 'note' => __('width', 'advanced-notifications') . ': 350px', 'image_preview_url' => ADVANCED_NOTIFICATIONS_URL_PATH . 'assets/images/top-right.png', 'parent_name' => 'location', 'show_on_value' => 'top_right', )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'design', 'input_type' => 'select', 'label' => __('Design', 'advanced-notifications'), 'description' => '', 'input_select_options' => apply_filters('an_designs_select_list', $designs), 'default' => 'success', 'order' => 5, 'parent_name' => 'type', 'hide_on_value' => 'sidebar', )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'class', 'input_type' => 'text', 'label' => __('CSS Class', 'advanced-notifications'), 'description' => '', 'order' => 5, )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'show_when', 'input_type' => 'select', 'label' => __('Show when', 'advanced-notifications'), 'note' => __('The notification will be displayed after the page is loaded or in the defined triggers', 'advanced-notifications'), 'input_select_options' => $show_when, 'default' => 'page_loaded_trigers', 'order' => 6, )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'delay', 'input_type' => 'number', 'min' => '0', 'label' => __('Delay before show', 'advanced-notifications'), 'note' => __('The time it takes the notification to appear after the page is loaded (seconds)', 'advanced-notifications'), 'default' => 2, 'parent_name' => 'show_when', 'show_on_value' => 'page_loaded_trigers', 'order' => 7, )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'show_time', 'input_type' => 'number', 'min' => '0', 'label' => __('Show time', 'advanced-notifications'), 'note' => __('The duration of the notification will appear in seconds', 'advanced-notifications'), 'default' => 8, 'order' => 9, )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'animation_in', 'input_type' => 'select', 'label' => __('Animation In', 'advanced-notifications'), 'description' => '', 'input_select_options' => $animations_in, 'default' => (is_rtl() ? 'an-bounce-in-right' : 'an-bounce-in-left'), 'order' => 11, 'parent_name' => 'type', 'hide_on_value' => 'sidebar', )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'animation_in_duration', 'input_type' => 'number', 'min' => '0', 'label' => __('Animation In duration', 'advanced-notifications'), 'note' => __('The duration of the Animation will appear in seconds', 'advanced-notifications'), 'default' => 1, 'order' => 13, )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'animation_out', 'input_type' => 'select', 'label' => __('Animation Out', 'advanced-notifications'), 'description' => '', 'input_select_options' => $animations_out, 'default' => (is_rtl() ? 'an-slide-out-right' : 'an-slide-out-left'), 'order' => 15, 'parent_name' => 'type', 'hide_on_value' => 'sidebar', )); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'display', 'input_id' => 'animation_out_duration', 'input_type' => 'number', 'min' => '0', 'label' => __('Animation Out duration', 'advanced-notifications'), 'note' => __('The duration of the Animation will appear in seconds', 'advanced-notifications'), 'default' => 1, 'order' => 17, )); // publish $publish_type = $an_functions->publish_type(); function an_post_types_options($option) { global $an_functions; $input_id = $option['input_id']; $print_fun = '
'; return $print_fun; } $close_button_type = array( 'icon' => __('Icon', 'advanced-notifications'), 'button' => __('Button', 'advanced-notifications'), 'text' => __('Text', 'advanced-notifications'), ); $close_icon_style = array( '✕' => __('Style', 'advanced-notifications') . ' 1 - ✕', '✖' => __('Style', 'advanced-notifications') . ' 2 - ✖', '✗' => __('Style', 'advanced-notifications') . ' 3 - ', '✘' => __('Style', 'advanced-notifications') . ' 4 - ✘', '×' => __('Style', 'advanced-notifications') . ' 5 - ×', '❌' => __('Style', 'advanced-notifications') . ' 6 - ❌', '╳' => __('Style', 'advanced-notifications') . ' 7 - ╳', '🗙' => __('Style', 'advanced-notifications') . ' 8 - 🗙', ); $close_button_position = array( 'top_left' => __('Top & Left', 'advanced-notifications'), 'top_center' => __('Top & Center', 'advanced-notifications'), 'top_right' => __('Top & Right', 'advanced-notifications'), 'top_site_direction' => __('Top & Site direction', 'advanced-notifications'), 'top_opposite_site_direction' => __('Top & Opposite site direction', 'advanced-notifications'), 'bottom_left' => __('Bottom & Left', 'advanced-notifications'), 'bottom_center' => __('Bottom & Center', 'advanced-notifications'), 'bottom_right' => __('Bottom & Right', 'advanced-notifications'), 'bottom_site_direction' => __('Bottom & Site direction', 'advanced-notifications'), 'bottom_opposite_site_direction' => __('Bottom & Opposite site direction', 'advanced-notifications'), 'custom' => __('Custom', 'advanced-notifications'), ); $close_button_horizontal_position = array( 'right' => __('Right', 'advanced-notifications'), 'left' => __('Left', 'advanced-notifications'), ); $close_button_vertical_position = array( 'top' => __('Top', 'advanced-notifications'), 'bottom' => __('Bottom', 'advanced-notifications'), ); $border_style = array( 'solid' => 'solid', 'dashed' => 'dashed', 'dotted' => 'dotted', 'double' => 'double', 'groove' => 'groove', 'ridge' => 'ridge', 'inset' => 'inset', 'outset' => 'outset', ); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'design', 'input_id' => 'text_color', 'input_type' => 'color', 'label' => __('Text color', 'advanced-notifications'), 'description' => '', 'order' => 1, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'design', 'input_id' => 'link_color', 'input_type' => 'color', 'label' => __('Link color', 'advanced-notifications'), 'description' => '', 'order' => 3, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'design', 'input_id' => 'background_color', 'input_type' => 'color', 'label' => __('Background color', 'advanced-notifications'), 'description' => '', 'order' => 7, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'design', 'input_id' => 'background_image', 'input_type' => 'image', 'label' => __('Background image', 'advanced-notifications'), 'description' => '', 'order' => 9, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'design', 'input_id' => 'background_size', 'input_type' => 'select', 'label' => __('Background size', 'advanced-notifications'), 'description' => '', 'input_select_options' => $background_size, 'order' => 11, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'design', 'input_id' => 'background_repeat', 'input_type' => 'select', 'label' => __('Background repeat', 'advanced-notifications'), 'description' => '', 'input_select_options' => $background_repeat, 'order' => 13, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'design', 'input_id' => 'border_color', 'input_type' => 'color', 'label' => __('Border color', 'advanced-notifications'), 'description' => '', 'order' => 14, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'design', 'input_id' => 'border_style', 'input_type' => 'select', 'label' => __('Border style', 'advanced-notifications'), 'input_select_options' => $border_style, 'default' => 'solid', 'order' => 15, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'design', 'input_id' => 'desktop', 'input_type' => 'function', 'label' => __('Desktop', 'advanced-notifications'), 'description' => '', 'function_name' => 'an_design_screen', 'order' => 19, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'design', 'input_id' => 'tablet', 'input_type' => 'function', 'label' => __('Tablet', 'advanced-notifications'), 'description' => '', 'function_name' => 'an_design_screen', 'order' => 25, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'design', 'input_id' => 'mobile', 'input_type' => 'function', 'label' => __('Mobile', 'advanced-notifications'), 'description' => '', 'function_name' => 'an_design_screen', 'order' => 30, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'design', 'input_id' => 'active_shadow', 'input_type' => 'select', 'label' => __('Active shadow', 'advanced-notifications'), 'description' => '', 'input_select_options' => $no_yes, 'default' => 'no', 'order' => 32, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'design', 'input_id' => 'shadow', 'input_type' => 'function', 'label' => __('Shadow', 'advanced-notifications'), 'description' => '', 'function_name' => 'an_shadow', 'parent_name' => 'active_shadow', 'show_on_value' => 'yes', 'order' => 34, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'close_button_enable', 'input_type' => 'checkbox', 'label' => __('Enable', 'advanced-notifications'), 'description' => '', 'checkbox_checked' => true, 'order' => 1, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'close_button_type', 'input_type' => 'select', 'label' => __('Type', 'advanced-notifications'), 'description' => '', 'input_select_options' => $close_button_type, 'default' => 'icon', 'order' => 3, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'close_icon_style', 'input_type' => 'select', 'label' => __('Select close icon', 'advanced-notifications'), 'description' => '', 'input_select_options' => apply_filters('an_close_icon_style', $close_icon_style), 'default' => '✕', 'parent_name' => 'close_button_type', 'show_on_value' => 'icon', 'order' => 4, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'close_text', 'input_type' => 'text', 'label' => __('Close text', 'advanced-notifications'), 'description' => '', 'default' => __('Close', 'advanced-notifications'), 'placeholder' => __('Close', 'advanced-notifications'), 'parent_name' => 'close_button_type', 'show_on_value' => 'text,button', 'order' => 4, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'close_button_position', 'input_type' => 'select', 'label' => __('Position', 'advanced-notifications'), 'description' => '', 'input_select_options' => $close_button_position, 'default' => (is_rtl() ? 'top_left' : 'top_right'), 'order' => 6, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'close_button_horizontal_position', 'input_type' => 'select', 'label' => __('Horizontal position', 'advanced-notifications'), 'description' => '', 'input_select_options' => $close_button_horizontal_position, 'default' => (is_rtl() ? 'left' : 'right'), 'parent_name' => 'close_button_position', 'show_on_value' => 'custom', 'order' => 7, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'close_button_horizontal_position_val', 'input_type' => 'number', 'label' => __('Horizontal value', 'advanced-notifications'), 'description' => '', 'parent_name' => 'close_button_position', 'show_on_value' => 'custom', 'order' => 9, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'close_button_horizontal_position_unit', 'input_type' => 'select', 'label' => __('Horizontal position unit', 'advanced-notifications'), 'description' => '', 'input_select_options' => an_position_unit(), 'parent_name' => 'close_button_position', 'show_on_value' => 'custom', 'order' => 11, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'close_button_vertical_position', 'input_type' => 'select', 'label' => __('Vertical position', 'advanced-notifications'), 'description' => '', 'input_select_options' => $close_button_vertical_position, 'default' => 'top', 'parent_name' => 'close_button_position', 'show_on_value' => 'custom', 'order' => 13, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'close_button_vertical_position_val', 'input_type' => 'number', 'label' => __('Vertical value', 'advanced-notifications'), 'description' => '', 'parent_name' => 'close_button_position', 'show_on_value' => 'custom', 'order' => 15, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'close_button_vertical_position_unit', 'input_type' => 'select', 'label' => __('Vertical position unit', 'advanced-notifications'), 'description' => '', 'input_select_options' => an_position_unit(), 'parent_name' => 'close_button_position', 'show_on_value' => 'custom', 'order' => 17, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'close_button_color', 'input_type' => 'color', 'label' => __('Color', 'advanced-notifications'), 'description' => '', 'order' => 19, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'close_button_background_color', 'input_type' => 'color', 'label' => __('Background color', 'advanced-notifications'), 'description' => '', 'order' => 19, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'desktop_close_button', 'input_type' => 'function', 'label' => __('Desktop', 'advanced-notifications'), 'description' => '', 'function_name' => 'an_design_screen_close_button', 'order' => 25, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'tablet_close_button', 'input_type' => 'function', 'label' => __('Tablet', 'advanced-notifications'), 'description' => '', 'function_name' => 'an_design_screen_close_button', 'order' => 30, )); eis_tab_option( array( 'interface_id' => 'an_designs', 'tab_id' => 'close_button', 'input_id' => 'mobile_close_button', 'input_type' => 'function', 'label' => __('Mobile', 'advanced-notifications'), 'description' => '', 'function_name' => 'an_design_screen_close_button', 'order' => 30, )); // TRIGGERS eis_tab('an_triggers', 'trigger', __('Trigger settings', 'advanced-notifications') ); function an_add_pro_trigger_actions($trigger_actions) { global $an_core; if ($an_core->license_type() == 'basic') { $trigger_actions['close_eis_disabled'] = __('Close notification - PRO', 'advanced-notifications'); } return $trigger_actions; } add_filter('an_trigger_actions', 'an_add_pro_trigger_actions'); $trigger_actions = $an_functions->trigger_actions(); function an_add_pro_trigger_types($trigger_types) { global $an_core; if ($an_core->license_type() == 'basic') { $trigger_types['on_event_eis_disabled'] = __('On event - PRO', 'advanced-notifications'); $trigger_types['url_contains_eis_disabled'] = __('URL contains - PRO', 'advanced-notifications'); } return $trigger_types; } add_filter('an_trigger_types', 'an_add_pro_trigger_types'); $trigger_types = $an_functions->trigger_types(); $elements = array( 'class' => __('Class', 'advanced-notifications'), 'id' => __('ID', 'advanced-notifications'), 'tag' => __('Tag', 'advanced-notifications'), ); eis_tab_option( array( 'interface_id' => 'an_triggers', 'tab_id' => 'trigger', 'input_id' => 'trigger_action', 'input_type' => 'select', 'label' => __('Trigger action', 'advanced-notifications'), 'description' => '', 'input_select_options' => $trigger_actions, 'default' => 'show', )); eis_tab_option( array( 'interface_id' => 'an_triggers', 'tab_id' => 'trigger', 'input_id' => 'trigger_type', 'input_type' => 'select', 'label' => __('Trigger type', 'advanced-notifications'), 'description' => '', 'input_select_options' => $trigger_types, )); eis_tab_option( array( 'interface_id' => 'an_triggers', 'tab_id' => 'trigger', 'input_id' => 'trigger_element', 'input_type' => 'select', 'label' => __('Element tag / class / ID', 'advanced-notifications'), 'input_select_options' => $elements, 'parent_name' => 'trigger_type', 'show_on_value' => 'on_click,on_hover', )); eis_tab_option( array( 'interface_id' => 'an_triggers', 'tab_id' => 'trigger', 'input_id' => 'trigger_element_name', 'input_type' => 'text', 'label' => __('Element name', 'advanced-notifications'), 'parent_name' => 'trigger_type', 'show_on_value' => 'on_click,on_hover', 'note' => __('You can enter multiple values separated by commas', 'advanced-notifications'), )); eis_tab_option( array( 'interface_id' => 'an_triggers', 'tab_id' => 'trigger', 'input_id' => 'trigger_description', 'input_type' => 'text', 'label' => __('Trigger description', 'advanced-notifications'), 'note' => __('Will appear when a trigger is selected on the notification settings page', 'advanced-notifications'), 'multilingual' => true, )); // LOCATIONS eis_tab('an_locations', 'location', __('Location settings', 'advanced-notifications') ); function an_horizontal_position() { $horizontal_position = array( 'right' => __('Right', 'advanced-notifications'), 'left' => __('Left', 'advanced-notifications'), 'center_eis_disabled' => __('Center', 'advanced-notifications') . ' - ' . __('PRO', 'advanced-notifications'), ); return apply_filters( 'an_horizontal_position_list', $horizontal_position ); } function an_vertical_position() { $vertical_position = array( 'top' => __('Top', 'advanced-notifications'), 'bottom' => __('Bottom', 'advanced-notifications'), 'center_eis_disabled' => __('Center', 'advanced-notifications') . ' - ' . __('PRO', 'advanced-notifications'), ); return apply_filters( 'an_vertical_position_list', $vertical_position ); } function an_location_desktop($option) { $print_fun = ''; $print_fun .= ''; $print_fun .= ''; $print_fun .= ''; return $print_fun; } function an_location_tablet($option) { $print_fun = ''; $print_fun .= ''; $print_fun .= ''; $print_fun .= ''; $print_fun .= ''; return $print_fun; } function an_location_mobile($option) { $print_fun = ''; $print_fun .= ''; $print_fun .= ''; $print_fun .= ''; return $print_fun; } eis_tab_option( array( 'interface_id' => 'an_locations', 'tab_id' => 'location', 'input_id' => 'desktop', 'input_type' => 'function', 'label' => __('Desktop', 'advanced-notifications'), 'description' => '', 'function_name' => 'an_location_desktop', 'order' => 1, )); eis_tab_option( array( 'interface_id' => 'an_locations', 'tab_id' => 'location', 'input_id' => 'tablet', 'input_type' => 'function', 'label' => __('Tablet', 'advanced-notifications'), 'description' => '', 'function_name' => 'an_location_tablet', 'order' => 3, )); eis_tab_option( array( 'interface_id' => 'an_locations', 'tab_id' => 'location', 'input_id' => 'mobile', 'input_type' => 'function', 'label' => __('Mobile', 'advanced-notifications'), 'description' => '', 'function_name' => 'an_location_mobile', 'order' => 5, )); eis_tab_option( array( 'interface_id' => 'an_locations', 'tab_id' => 'location', 'input_id' => 'z_index', 'input_type' => 'number', 'label' => __('Front order', 'advanced-notifications'), 'description' => '', 'default' => '1', 'order' => 7, )); // triggers function an_eis_triggers($option) { global $an_api; $triggers_list = $an_api->triggers_list(); $triggers = array('0'=>__('None', 'advanced-notifications')); foreach ($triggers_list as $trigger) { $triggers[$trigger['id']] = $trigger['label']; } $triggers_rows = (is_array($option['value'])) ? $option['value'] : array(); $print_fun = ''; return $print_fun; } eis_tab('a_notifications', 'triggers', __('Triggers', 'advanced-notifications') ); eis_tab_option( array( 'interface_id' => 'a_notifications', 'tab_id' => 'triggers', 'input_id' => 'triggers', 'input_type' => 'function', 'function_name' => 'an_eis_triggers', 'label' => __('Triggers', 'advanced-notifications'), )); } add_action('add_eis_interface_options', 'an_interface_options');