'date_c', 'order' => 'DESC', 'page' => $curPage, 'limit' => $pageSize, 'drafts' => true, 'groups' => true ]; if( ! empty($_GET['filter']) && $_GET['filter'] === 'all' ) { $userFilters = true; $showAllSlider = true; $urlParamFilter = htmlentities($_GET['filter']); $filters['exclude'] = []; } if( ! empty($_GET['filter']) && $_GET['filter'] === 'hidden') { $userFilters = true; $showHiddenItems = true; $urlParamFilter = htmlentities($_GET['filter']); $filters['exclude'] = []; $filters['where'] = "flag_deleted = '1'"; } if( ! empty($_GET['filter']) && $_GET['filter'] === 'popup') { $userFilters = true; $showPopupSlider = true; $urlParamFilter = htmlentities($_GET['filter']); $filters['exclude'] = []; $filters['where'] = "flag_popup = '1'"; } if( ! empty($_GET['order']) ) { $userFilters = true; $urlParamOrder = $_GET['order']; $filters['orderby'] = htmlentities($_GET['order']); if( $_GET['order'] === 'name' ) { $filters['order'] = 'ASC'; } } if( ! empty($_GET['term']) ) { $userFilters = true; $urlParamTerm = htmlentities($_GET['term']); $filters['groups'] = false; $filters['where'] = "name LIKE '%".esc_sql($_GET['term'])."%' OR slug LIKE '%".esc_sql($_GET['term'])."%' OR id = '".esc_sql($_GET['term'])."' OR keywords LIKE '%".esc_sql($_GET['term'])."%'"; } // Find sliders $sliders = LS_Sliders::find( $filters ); //$sliders = false; // Pager $maxItem = LS_Sliders::$count; $maxPage = ceil( $maxItem / $pageSize ); $maxPage = $maxPage ? $maxPage : 1; // License & updates $code = get_option('layerslider-purchase-code', ''); $validity = LS_Config::isActivatedSite(); $channel = get_option('layerslider-release-channel', 'stable'); // License key $codeFormatted = ''; if(!empty($code)) { $start = substr($code, 0, -6); $end = substr($code, -6); $codeFormatted = preg_replace("/[a-zA-Z0-9]/", '⦁', $start) . $end; $codeFormatted = str_replace('-', ' ', $codeFormatted); } // Template store data $lsStoreData = LS_RemoteData::get('templates', [] ); $lsStoreLastViewed = get_user_meta( $userID, 'ls-store-last-viewed', true); // Update last visited date if( empty( $lsStoreLastViewed ) ) { $lsStoreLastViewed = date('Y-m-d'); update_user_meta( $userID, 'ls-store-last-viewed', date('Y-m-d')); } $lsStoreHasUpdate = ( ! empty($lsStoreData['last_updated']) && $lsStoreLastViewed < $lsStoreData['last_updated'] ); //$lsStoreHasUpdate = true; // Notifications panel contents $bellNotifications = LS_Notifications::bellNotifications(); $inlineNotifications = LS_Notifications::inlineNotifications(); $pluginUpdates = get_plugin_updates(); $lBoxOrder = LS_RemoteData::get('license-box-order'); $lsReleaseLog = LS_RemoteData::get('release-log'); // Notification messages $notificationsItemCount = ! empty( $_GET['count'] ) ? (int)$_GET['count'] : 0; $notifications = [ 'updateStore' => __('LayerSlider Templates have been updated', 'LayerSlider'), 'hideSelectError' => __('Select an item to hide', 'LayerSlider'), 'hideSuccess' => sprintf( _n( '%d item has been hidden', '%d items have been hidden', $notificationsItemCount, 'LayerSlider' ), $notificationsItemCount ), 'duplicateSuccess' => sprintf( _n( '%d item has been duplicated', '%d items have been duplicated', $notificationsItemCount, 'LayerSlider' ), $notificationsItemCount ), 'duplicateSuccess' => sprintf( _n( '%d item has been duplicated', '%d items have been duplicated', $notificationsItemCount, 'LayerSlider' ), $notificationsItemCount ), 'deleteSelectError' => __('Select an item to delete', 'LayerSlider'), 'deleteSuccess' => sprintf( _n( '%d item has been deleted', '%d items have been deleted', $notificationsItemCount, 'LayerSlider' ), $notificationsItemCount ), 'groupSuccess' => sprintf( _n( '%d item has been grouped', '%d items have been grouped', $notificationsItemCount, 'LayerSlider' ), $notificationsItemCount ), 'groupSelectError' => __('Select at least 2 items to group them', 'LayerSlider'), 'mergeSelectError' => __('Select at least 2 items to merge them', 'LayerSlider'), 'mergeSuccess' => sprintf( __('%d items have been merged as new', 'LayerSlider'), $notificationsItemCount ), 'restoreSelectError' => __('Select an item to restore', 'LayerSlider'), 'restoreSuccess' => sprintf( _n( '%d item has been restored', '%d items have been restored', $notificationsItemCount, 'LayerSlider' ), $notificationsItemCount ), 'exportNotFound' => __('No items were found to export', 'LayerSlider'), 'exportSelectError' => __('Select an item to export', 'LayerSlider'), 'exportZipError' => __('The PHP ZipArchive extension is required to import .zip files', 'LayerSlider'), 'importSelectError' => __('Choose a file to import', 'LayerSlider'), 'importFailed' => __('The import file seems to be invalid or corrupted', 'LayerSlider'), 'importSuccess' => sprintf( _n( '%d item has been imported', '%d items have been imported', $notificationsItemCount, 'LayerSlider' ), $notificationsItemCount ), 'importLRPartial' => sprintf( __('Some projects couldn’t be imported. Please %sregister your license%s to import premium templates.', 'LayerSlider'), '', ''), 'importLSEmpty' => sprintf( __('Please %sregister your license%s to import premium templates.', 'LayerSlider'), '', ''), 'generalUpdated' => __('Settings saved', 'LayerSlider'), 'cacheEmpty' => __('LayerSlider caches has been emptied', 'LayerSlider'), 'googleFontsEmpty' => __('Google Fonts has been emptied', 'LayerSlider') ]; wp_localize_script('ls-dashboard', 'LS_slidersMeta', [ 'isActivatedSite' => $validity ]); wp_localize_script('ls-dashboard', 'LS_pageMeta', [ 'assetsPath' => LS_ROOT_URL, 'skinsPath' => LS_ROOT_URL.'/static/layerslider/skins/', 'dashboardNonce' => wp_create_nonce('ls-dashboard-nonce') ]); // Notify OSD if( isset( $_GET['message'] ) ) { wp_localize_script('ls-dashboard', 'LS_statusMessage', [ 'icon' => isset( $_GET['error'] ) ? 'error' : 'success', 'iconColor' => isset( $_GET['error'] ) ? '#ff2323' : '#8BC34A', 'text' => $notifications[ $_GET['message'] ], 'timeout' => 8000 ]); } // Icons wp_localize_script('ls-dashboard', 'LS_InterfaceIcons', [ 'notifications' => [ 'error' => lsGetSVGIcon('exclamation-triangle'), 'success' => lsGetSVGIcon('check'), ], 'easteregg' => [ 'check' => lsGetSVGIcon('check'), 'cat' => lsGetSVGIcon('cat-space', 'duotone'), 'heart' => lsGetSVGIcon('heart'), 'rocket' => lsGetSVGIcon('rocket-launch'), 'hourglass' => lsGetSVGIcon('hourglass-half', 'duotone'), 'ufo' => lsGetSVGIcon('ufo', 'duotone'), 'station' => lsGetSVGIcon('space-station-moon', 'duotone'), 'alien' => lsGetSVGIcon('alien-monster', 'duotone'), 'galaxy' => lsGetSVGIcon('galaxy', 'duotone') ] ]); ?>