<?php

namespace FSPoster\App\view;

use FSPoster\App\Providers\Helper;

defined( 'MODAL' ) or exit();
?>

<link rel="stylesheet" href="<?php
print Helper::assets( 'css/schedule/add.css', TRUE ) ?>"/>
<script type="text/javascript" src="<?php
print Helper::assets( 'js/schedule/add.js?5.2', TRUE ) ?>" id="schedule_script" data-id="0" data-mn="<?php
print $mn ?>" data-keep-logs="<?php
print Helper::getOption( 'keep_logs', 1 ) ?>"></script>

<link rel="stylesheet" href="<?php
print Helper::assets( 'css/jquery-ui.css' ) ?>">
<script src="<?php
print Helper::assets( 'js/jquery-ui.js' ) ?>"></script>

<span class="close" data-modal-close="true">&times;</span>

<div id="schedule_popup">

    <div class="fs_modal_header_bg"><?php
		print $parameters['title'] ?></div>

    <div class="schedule_popup_body">

        <div class="schedule-mdl-tabs">
            <div data-tab-id="accounts" class="active-tab"><span>1</span> <?php
				print esc_html__( 'Accounts', 'fs-poster' ) ?></div>
            <div data-tab-id="custom_messages"><span>2</span> <?php
				print esc_html__( 'Custom messages', 'fs-poster' ) ?></div>
        </div>

        <div class="schedule_popup_tabs">
            <div data-oppen-tab-id="accounts">
                <div class="schedule_accounts_section">
                    <div class="sn_tabs">
                        <div data-tab-id="fb" class="active-sn"><i class="fab fa-facebook-square"></i> <?php
							print esc_html__( 'Facebook', 'fs-poster' ) ?></div>
                        <div data-tab-id="instagram"><i class="fab fa-instagram"></i> <?php
							print esc_html__( 'Instagram', 'fs-poster' ) ?></div>
                        <div data-tab-id="twitter"><i class="fab fa-twitter-square"></i> <?php
							print esc_html__( 'Twitter', 'fs-poster' ) ?></div>
                        <div data-tab-id="linkedin"><i class="fab fa-linkedin"></i> <?php
							print esc_html__( 'Linkedin', 'fs-poster' ) ?></div>
                        <div data-tab-id="tumblr"><i class="fab fa-tumblr-square"></i> <?php
							print esc_html__( 'Tumblr', 'fs-poster' ) ?></div>
                        <div data-tab-id="reddit"><i class="fab fa-reddit-square"></i> <?php
							print esc_html__( 'Reddit', 'fs-poster' ) ?></div>
                        <div data-tab-id="vk"><i class="fab fa-vk"></i> <?php
							print esc_html__( 'VK.com', 'fs-poster' ) ?></div>
                        <div data-tab-id="ok"><i class="fab fa-odnoklassniki"></i> <?php
							print esc_html__( 'OK.ru', 'fs-poster' ) ?></div>
                        <div data-tab-id="pinterest"><i class="fab fa-pinterest-square"></i> <?php
							print esc_html__( 'Pinterest', 'fs-poster' ) ?></div>
                        <div data-tab-id="google_b"><i class="fab fa-google"></i> <?php
							print esc_html__( 'Google MyBusiness', 'fs-poster' ) ?></div>
                        <div data-tab-id="telegram"><i class="fab fa-telegram"></i> <?php
							print esc_html__( 'Telegram', 'fs-poster' ) ?></div>
                        <div data-tab-id="medium"><i class="fab fa-medium"></i> <?php
							print esc_html__( 'Medium', 'fs-poster' ) ?></div>
                        <div data-tab-id="wordpress"><i class="fab fa-wordpress"></i> <?php
							print esc_html__( 'WordPress', 'fs-poster' ) ?></div>
                    </div>
                    <div class="schedule_accounts_customization_section">
                        <div class="fs_share_box_items" id="share_box1">
							<?php
							foreach ( $parameters['activeNodes'] as $nodeInf )
							{
								?>
                                <div class="fs_share_box_node" data-tab="<?php
								print esc_html( $nodeInf['driver'] ) ?>">
                                    <input type="hidden" name="share_on_nodes[]" value="<?php
									print esc_html( $nodeInf['node_type'] ) . ':' . (int) $nodeInf['id'] ?>">
                                    <div class="node_img"><img src="<?php
										print Helper::profilePic( $nodeInf ) ?>"
                                                               onerror="this.src = FSPosterData.assets_url + 'images/no-photo.png';">
                                    </div>
                                    <div class="node_label">
                                        <div>
											<?php
											print esc_html( $nodeInf['name'] ); ?>
                                            <a href="<?php
											print Helper::profileLink( $nodeInf ) ?>" target="_blank"
                                               class="ws_btn schedule_profile_link" title="<?php
											print esc_html__( 'Profile link', 'fs-poster' ) ?>"><i
                                                        class="fa fa-external-link fa-external-link-alt"></i></a>
                                        </div>
                                        <div class="node_label_help"><?php
											print esc_html( $nodeInf['node_type'] ); ?><?php
											print empty( $nodeInf['title_text'] ) ? '' : '<i class="fa fa-filter" title="' . esc_html( $nodeInf['title_text'] ) . '"></i>' ?></div>
                                    </div>
                                    <div class="node_remove">
                                        <div class="node_remove_btn" type="button"><i class="fa fa-times"></i></div>
                                    </div>
                                </div>
								<?php
							}
							?>
                        </div>
                        <div class="schedule_accounts_customization_actions">
                            <div class="ws_bg_default ws_btn add_to_list_btn"><i class="fa fa-plus"></i> <?php
								print esc_html__( 'add account', 'fs-poster' ) ?></div>
                            <div class="ws_bg_warning ws_btn remove_all_from_list"><i class="fa fa-times"></i> <?php
								print esc_html__( 'empty list', 'fs-poster' ) ?></div>
                        </div>
                    </div>
                </div>

            </div>
            <div data-oppen-tab-id="custom_messages">

                <div class="schedule_custom_messages_section">
                    <div class="custom-messages-sn">
                        <div data-sn-id="fb" class="active-sn"><i class="fab fa-facebook-square"></i> <?php
							print esc_html__( 'Facebook', 'fs-poster' ) ?></div>
                        <div data-sn-id="instagram"><i class="fab fa-instagram"></i> <?php
							print esc_html__( 'Instagram ( post )', 'fs-poster' ) ?></div>
                        <div data-sn-id="instagram_h"><i class="fab fa-instagram"></i> <?php
							print esc_html__( 'Instagram ( story )', 'fs-poster' ) ?></div>
                        <div data-sn-id="twitter"><i class="fab fa-twitter-square"></i> <?php
							print esc_html__( 'Twitter', 'fs-poster' ) ?></div>
                        <div data-sn-id="linkedin"><i class="fab fa-linkedin"></i> <?php
							print esc_html__( 'Linkedin', 'fs-poster' ) ?></div>
                        <div data-sn-id="tumblr"><i class="fab fa-tumblr-square"></i> <?php
							print esc_html__( 'Tumblr', 'fs-poster' ) ?></div>
                        <div data-sn-id="reddit"><i class="fab fa-reddit-square"></i> <?php
							print esc_html__( 'Reddit', 'fs-poster' ) ?></div>
                        <div data-sn-id="vk"><i class="fab fa-vk"></i> <?php
							print esc_html__( 'VK.com', 'fs-poster' ) ?></div>
                        <div data-sn-id="ok"><i class="fab fa-odnoklassniki"></i> <?php
							print esc_html__( 'OK.ru', 'fs-poster' ) ?></div>
                        <div data-sn-id="pinterest"><i class="fab fa-pinterest-square"></i> <?php
							print esc_html__( 'Pinterest', 'fs-poster' ) ?></div>
                        <div data-sn-id="google_b"><i class="fab fa-google"></i> <?php
							print esc_html__( 'Google MyBusiness', 'fs-poster' ) ?></div>
                        <div data-sn-id="telegram"><i class="fab fa-telegram"></i> <?php
							print esc_html__( 'Telegram', 'fs-poster' ) ?></div>
                        <div data-sn-id="medium"><i class="fab fa-medium"></i> <?php
							print esc_html__( 'Medium', 'fs-poster' ) ?></div>
                        <div data-sn-id="wordpress"><i class="fab fa-wordpress"></i> <?php
							print esc_html__( 'WordPress', 'fs-poster' ) ?></div>
                    </div>
                    <div class="schedule_custom_messages_body">
                        <div><?php
							print esc_html__( 'Custom text:', 'fs-poster' ) ?></div>
                        <div class="social_network_custom_texts">
                            <textarea class="ws_form_element2" data-sn-id="fb"><?php
								print esc_html( $parameters['customMessages']['fb'] ) ?></textarea>
                            <textarea class="ws_form_element2" data-sn-id="instagram"><?php
								print esc_html( $parameters['customMessages']['instagram'] ) ?></textarea>
                            <textarea class="ws_form_element2" data-sn-id="instagram_h"><?php
								print esc_html( $parameters['customMessages']['instagram_h'] ) ?></textarea>
                            <textarea class="ws_form_element2" data-sn-id="twitter"><?php
								print esc_html( $parameters['customMessages']['twitter'] ) ?></textarea>
                            <textarea class="ws_form_element2" data-sn-id="linkedin"><?php
								print esc_html( $parameters['customMessages']['linkedin'] ) ?></textarea>
                            <textarea class="ws_form_element2" data-sn-id="tumblr"><?php
								print esc_html( $parameters['customMessages']['tumblr'] ) ?></textarea>
                            <textarea class="ws_form_element2" data-sn-id="reddit"><?php
								print esc_html( $parameters['customMessages']['reddit'] ) ?></textarea>
                            <textarea class="ws_form_element2" data-sn-id="vk"><?php
								print esc_html( $parameters['customMessages']['vk'] ) ?></textarea>
                            <textarea class="ws_form_element2" data-sn-id="ok"><?php
								print esc_html( $parameters['customMessages']['ok'] ) ?></textarea>
                            <textarea class="ws_form_element2" data-sn-id="pinterest"><?php
								print esc_html( $parameters['customMessages']['pinterest'] ) ?></textarea>
                            <textarea class="ws_form_element2" data-sn-id="google_b"><?php
								print esc_html( $parameters['customMessages']['google_b'] ) ?></textarea>
                            <textarea class="ws_form_element2" data-sn-id="telegram"><?php
								print esc_html( $parameters['customMessages']['telegram'] ) ?></textarea>
                            <textarea class="ws_form_element2" data-sn-id="medium"><?php
								print esc_html( $parameters['customMessages']['medium'] ) ?></textarea>
                            <textarea class="ws_form_element2" data-sn-id="wordpress"><?php
								print esc_html( $parameters['customMessages']['wordpress'] ) ?></textarea>
                        </div>
                        <div class="schedule_custom_messages_keywords_section">
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'Post ID', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{id}
                                </div>
                            </div>
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'Post title', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{title}
                                </div>
                            </div>
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'Post excerpt', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{excerpt}
                                </div>
                            </div>
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'Post author name', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{author}
                                </div>
                            </div>
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'Post content (first 40 symbols)', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{content_short_40}
                                </div>
                            </div>
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'Post content Full', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{content_full}
                                </div>
                            </div>
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'Post link', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{link}
                                </div>
                            </div>
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'Post short link', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{short_link}
                                </div>
                            </div>
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'Featured image URL', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{featured_image_url}
                                </div>
                            </div>
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'WooCommerce - product price', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{product_regular_price}
                                </div>
                            </div>
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'WooCommerce - product sale price', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{product_sale_price}
                                </div>
                            </div>
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'Unique ID', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{uniq_id}
                                </div>
                            </div>
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'Post Tags', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{tags}
                                </div>
                            </div>
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'Post Categories', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{categories}
                                </div>
                            </div>
                            <div class="fs_text_codes">
                                <div><?php
									print esc_html__( 'Custom fields', 'fs-poster' ) ?></div>
                                <div class="ws_tooltip ws_color_info append_to_text" data-title="<?php
								print esc_html__( 'Click to append in text', 'fs-poster' ) ?>">{cf_KEY}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>

        <div class="schedule_popup_footer">
            <button type="button" class="ws_btn ws_bg_warning wp_native_schedule_save_btn" data-post_id="<?php
			echo $parameters['info']['post_id']; ?>" data-info="<?php
			echo esc_html( json_encode( $parameters['info'] ) ); ?>"><?php
				print $parameters['btn_title'] ?></button>
            <button type="button" class="ws_btn" data-modal-close="true"><?php
				print esc_html__( 'Close', 'fs-poster' ) ?></button>
            <span class="schedule_matches_section<?php
			print isset( $parameters['post_ids_count'] ) && $parameters['post_ids_count'] == 1 ? ' fs_hidden' : '' ?>">
				<?php
				print esc_html__( 'Posts matching your filters:', 'fs-poster' ) ?>
				<b class="schedule_matches_count">...</b>
			</span>
        </div>

    </div>
</div>