File manager - Edit - /home/premiey/www/wp-includes/images/media/controllers.tar
Back
class-admin-menu.php 0000666 00000010465 15165473201 0010430 0 ustar 00 <?php namespace QuadLayers\QLWAPP\Controllers; use QuadLayers\QLWAPP\Api\Admin_Menu_Routes_Library; use QuadLayers\QLWAPP\Services\Entity_Options; class Admin_Menu { protected static $instance; protected static $menu_slug = 'wp-whatsapp-chat'; private function __construct() { /** * Admin Menu */ add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); add_action( 'admin_menu', array( $this, 'add_menu' ) ); } public function register_scripts() { $menu = include QLWAPP_PLUGIN_DIR . 'build/admin-menu/js/index.asset.php'; $entity_options = Entity_Options::instance(); wp_register_script( 'qlwapp-admin-menu', plugins_url( '/build/admin-menu/js/index.js', QLWAPP_PLUGIN_FILE ), $menu['dependencies'], $menu['version'], true ); wp_register_style( 'qlwapp-admin-menu', plugins_url( '/build/admin-menu/css/style.css', QLWAPP_PLUGIN_FILE ), array( 'qlwapp-components', 'media-views', 'wp-components', ), QLWAPP_PLUGIN_VERSION ); wp_localize_script( 'qlwapp-admin-menu', 'qlwappApiAdminMenu', array( 'QLWAPP_API_REST_ROUTES' => $this->get_endpoints(), 'QLWAPP_DISPLAY_POST_TYPES' => $entity_options->get_entries(), 'QLWAPP_DISPLAY_TAXONOMIES' => $entity_options->get_taxonomies(), ) ); wp_enqueue_editor(); } private function get_endpoints() { $route_library = Admin_Menu_Routes_Library::instance(); $endpoints = $route_library->get_routes(); $endpoints_array = array(); foreach ( $endpoints as $endpoint ) { $endpoint_key = str_replace( '/', '_', $endpoint::get_rest_route() ); if ( ! isset( $endpoints_array[ $endpoint_key ] ) ) { $endpoints_array[ $endpoint_key ] = $endpoint::get_rest_path(); } } return $endpoints_array; } public function enqueue_scripts() { if ( ! isset( $_GET['page'] ) || self::get_menu_slug() !== $_GET['page'] ) { return; } wp_enqueue_media(); wp_enqueue_script( 'qlwapp-admin-menu' ); wp_enqueue_style( 'qlwapp-admin-menu' ); } public function add_menu() { $menu_slug = self::get_menu_slug(); add_menu_page( QLWAPP_PLUGIN_NAME, QLWAPP_PLUGIN_NAME, 'edit_posts', $menu_slug, '__return_null', 'dashicons-whatsapp' ); add_submenu_page( $menu_slug, esc_html__( 'Welcome', 'wp-whatsapp-chat' ), esc_html__( 'Welcome', 'wp-whatsapp-chat' ), 'edit_posts', $menu_slug, '__return_null' ); add_submenu_page( $menu_slug, esc_html__( 'Premium', 'wp-whatsapp-chat' ), esc_html__( 'Premium', 'wp-whatsapp-chat' ), 'edit_posts', "$menu_slug&tab=premium", '__return_null' ); add_submenu_page( $menu_slug, esc_html__( 'Button', 'wp-whatsapp-chat' ), esc_html__( 'Button', 'wp-whatsapp-chat' ), 'manage_options', "{$menu_slug}&tab=button", '__return_null' ); add_submenu_page( $menu_slug, esc_html__( 'Box', 'wp-whatsapp-chat' ), esc_html__( 'Box', 'wp-whatsapp-chat' ), 'manage_options', "{$menu_slug}&tab=box", '__return_null' ); add_submenu_page( $menu_slug, esc_html__( 'Contacts', 'wp-whatsapp-chat' ), esc_html__( 'Contacts', 'wp-whatsapp-chat' ), 'manage_options', "{$menu_slug}&tab=contacts", '__return_null' ); add_submenu_page( $menu_slug, esc_html__( 'Display', 'wp-whatsapp-chat' ), esc_html__( 'Display', 'wp-whatsapp-chat' ), 'manage_options', "{$menu_slug}&tab=display", '__return_null' ); add_submenu_page( $menu_slug, esc_html__( 'Settings', 'wp-whatsapp-chat' ), esc_html__( 'Settings', 'wp-whatsapp-chat' ), 'manage_options', "{$menu_slug}&tab=settings", '__return_null' ); add_submenu_page( $menu_slug, esc_html__( 'Scheme', 'wp-whatsapp-chat' ), esc_html__( 'Scheme', 'wp-whatsapp-chat' ), 'manage_options', "{$menu_slug}&tab=scheme", '__return_null' ); add_submenu_page( $menu_slug, esc_html__( 'Suggestions', 'wp-whatsapp-chat' ), esc_html__( 'Suggestions', 'wp-whatsapp-chat' ), 'manage_options', "{$menu_slug}&tab=suggestions", '__return_null' ); } public static function get_menu_slug() { return self::$menu_slug; } public static function instance() { if ( is_null( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } } class-components.php 0000666 00000002173 15165473201 0010560 0 ustar 00 <?php namespace QuadLayers\QLWAPP\Controllers; class Components { protected static $instance; private function __construct() { add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); } public function register_scripts() { $components = include QLWAPP_PLUGIN_DIR . 'build/components/js/index.asset.php'; /** * Register components assets */ wp_register_script( 'qlwapp-components', plugins_url( '/build/components/js/index.js', QLWAPP_PLUGIN_FILE ), $components['dependencies'], $components['version'], true ); wp_register_style( 'qlwapp-components', plugins_url( '/build/components/css/style.css', QLWAPP_PLUGIN_FILE ), array( 'wp-components', 'media-views', ), QLWAPP_PLUGIN_VERSION ); } public function enqueue_scripts() { wp_enqueue_media(); wp_enqueue_script( 'qlwapp-admin-menu' ); wp_enqueue_style( 'qlwapp-admin-menu' ); } public static function instance() { if ( is_null( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } } class-helpers.php 0000666 00000003501 15165473201 0010031 0 ustar 00 <?php namespace QuadLayers\QLWAPP\Controllers; use QuadLayers\QLWAPP\Models\Button as Models_Button; class Helpers { protected static $instance; private function __construct() { add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ) ); } public function register_scripts() { $helpers = include QLWAPP_PLUGIN_DIR . 'build/helpers/js/index.asset.php'; $timezone_options = qlwapp_get_timezone_options(); /** * Register helpers assets */ wp_register_script( 'qlwapp-helpers', plugins_url( '/build/helpers/js/index.js', QLWAPP_PLUGIN_FILE ), $helpers['dependencies'], $helpers['version'], true ); global $wp_version; wp_localize_script( 'qlwapp-helpers', 'qlwappHelpers', array( 'WP_LANGUAGE' => get_locale(), 'WP_STATUSES' => get_post_statuses(), 'WP_VERSION' => $wp_version, 'QLWAPP_PLUGIN_URL' => plugins_url( '/', QLWAPP_PLUGIN_FILE ), 'QLWAPP_PLUGIN_NAME' => QLWAPP_PLUGIN_NAME, 'QLWAPP_PLUGIN_VERSION' => QLWAPP_PLUGIN_VERSION, 'QLWAPP_PLUGIN_FILE' => QLWAPP_PLUGIN_FILE, 'QLWAPP_PLUGIN_DIR' => QLWAPP_PLUGIN_DIR, 'QLWAPP_WORDPRESS_URL' => QLWAPP_WORDPRESS_URL, 'QLWAPP_DEMO_URL' => QLWAPP_DEMO_URL, 'QLWAPP_PREMIUM_SELL_URL' => QLWAPP_PREMIUM_SELL_URL, 'QLWAPP_SUPPORT_URL' => QLWAPP_SUPPORT_URL, 'QLWAPP_DOCUMENTATION_URL' => QLWAPP_DOCUMENTATION_URL, 'QLWAPP_GROUP_URL' => QLWAPP_GROUP_URL, 'QLWAPP_TIMEZONE_OPTIONS' => $timezone_options, 'QLWAPP_MESSAGE_REPLACEMENTS' => qlwapp_get_replacements_text(), ) ); } public static function instance() { if ( is_null( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } } class-admin-menu-woocommerce.php 0000666 00000002711 15165473201 0012740 0 ustar 00 <?php namespace QuadLayers\QLWAPP\Controllers; class Admin_Menu_WooCommerce extends Admin_Menu { protected static $instance; private function __construct() { add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); add_action( 'admin_menu', array( $this, 'add_menu' ) ); } public function register_scripts() { $woocommerce = include QLWAPP_PLUGIN_DIR . 'build/admin-menu-woocommerce/js/index.asset.php'; wp_register_script( 'qlwapp-admin-menu-woocommerce', plugins_url( '/build/admin-menu-woocommerce/js/index.js', QLWAPP_PLUGIN_FILE ), $woocommerce['dependencies'], $woocommerce['version'], true ); } public function enqueue_scripts() { if ( ! class_exists( 'WooCommerce' ) ) { return; } if ( ! isset( $_GET['page'] ) || self::get_menu_slug() !== $_GET['page'] ) { return; } wp_enqueue_script( 'qlwapp-admin-menu-woocommerce' ); } public function add_menu() { if ( ! class_exists( 'WooCommerce' ) ) { return; } $menu_slug = self::get_menu_slug(); add_submenu_page( $menu_slug, esc_html__( 'WooCommerce', 'wp-whatsapp-chat' ), esc_html__( 'WooCommerce', 'wp-whatsapp-chat' ), 'manage_options', "{$menu_slug}&tab=woocommerce", '__return_null' ); } public static function instance() { if ( is_null( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } } class-astra-builder-ui-controller.php 0000666 00000046342 15165504212 0013730 0 ustar 00 <?php /** * Astra Builder UI Controller. * * @package astra-builder */ // No direct access, please. if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Astra_Builder_UI_Controller' ) ) { /** * Class Astra_Builder_UI_Controller. */ final class Astra_Builder_UI_Controller { /** * Astra SVGs. * * @var ast_svgs */ private static $ast_svgs = null; /** * Get an SVG Icon * * @param string $icon the icon name. * @param bool $base if the baseline class should be added. */ public static function fetch_svg_icon( $icon = '', $base = true ) { $output = '<span class="ahfb-svg-iconset ast-inline-flex' . ( $base ? ' svg-baseline' : '' ) . '">'; /** @psalm-suppress DocblockTypeContradiction */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( ! self::$ast_svgs ) { ob_start(); include_once ASTRA_THEME_DIR . 'assets/svg/svgs.json'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound self::$ast_svgs = json_decode( ob_get_clean(), true ); self::$ast_svgs = apply_filters( 'astra_svg_icons', self::$ast_svgs ); } $output .= isset( self::$ast_svgs[ $icon ] ) ? self::$ast_svgs[ $icon ] : ''; $output .= '</span>'; return $output; } /** * Prepare Social Icon HTML. * * @param string $index The Index of the social icon. * @param string $builder_type the type of the builder. */ public static function render_social_icon( $index, $builder_type = 'header' ) { $items = astra_get_option( $builder_type . '-social-icons-' . $index ); $items = isset( $items['items'] ) ? $items['items'] : array(); $show_label = astra_get_option( $builder_type . '-social-' . $index . '-label-toggle' ); $color_type = astra_get_option( $builder_type . '-social-' . $index . '-color-type' ); $social_stack = astra_get_option( $builder_type . '-social-' . $index . '-stack', 'none' ); echo '<div class="ast-' . esc_attr( $builder_type ) . '-social-' . esc_attr( $index ) . '-wrap ast-' . esc_attr( $builder_type ) . '-social-wrap">'; if ( is_customize_preview() ) { self::render_customizer_edit_button(); } echo '<div class="' . esc_attr( $builder_type ) . '-social-inner-wrap element-social-inner-wrap social-show-label-' . ( $show_label ? 'true' : 'false' ) . ' ast-social-color-type-' . esc_attr( $color_type ) . ' ast-social-stack-' . esc_attr( $social_stack ) . ' ast-social-element-style-filled">'; if ( is_array( $items ) && ! empty( $items ) ) { foreach ( $items as $item ) { if ( $item['enabled'] ) { $link = $item['url']; switch ( $item['id'] ) { case 'phone': $link = 'tel:' . $item['url']; break; case 'email': $link = 'mailto:' . $item['url']; break; case 'whatsapp': $link = 'https://api.whatsapp.com/send?phone=' . $item['url']; break; } echo '<a href="' . esc_url( $link ) . '"' . esc_attr( $item['label'] ? ' aria-label=' . $item['label'] . '' : ' aria-label=' . $item['id'] . '' ) . ' ' . ( 'phone' === $item['id'] || 'email' === $item['id'] ? '' : 'target="_blank" rel="noopener noreferrer" ' ) . 'style="--color: ' . esc_attr( ! empty( $item['color'] ) ? $item['color'] : '#3a3a3a' ) . '; --background-color: ' . esc_attr( ! empty( $item['background'] ) ? $item['background'] : 'transparent' ) . ';" class="ast-builder-social-element ast-inline-flex ast-' . esc_attr( $item['id'] ) . ' ' . esc_attr( $builder_type ) . '-social-item">'; echo self::fetch_svg_icon( $item['icon'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped if ( $show_label ) { echo '<span class="social-item-label">' . esc_html( $item['label'] ) . '</span>'; } echo '</a>'; } } } echo apply_filters( 'astra_social_icons_after', '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo '</div>'; echo '</div>'; } /** * Prepare HTML Markup. * * @param string $index Key of the HTML Control. */ public static function render_html_markup( $index = 'header-html-1' ) { $theme_author = astra_get_theme_author_details(); $content = astra_get_option( $index ); if ( $content || is_customize_preview() ) { $link_style = ''; echo '<div class="ast-header-html inner-link-style-' . esc_attr( $link_style ) . '">'; if ( is_customize_preview() ) { self::render_customizer_edit_button(); } echo '<div class="ast-builder-html-element">'; $content = str_replace( '[copyright]', '©', $content ); $content = str_replace( '[current_year]', gmdate( 'Y' ), $content ); $content = str_replace( '[site_title]', get_bloginfo( 'name' ), $content ); $content = str_replace( '[theme_author]', '<a href=" ' . esc_url( $theme_author['theme_author_url'] ) . '" rel="nofollow noopener" target="_blank">' . $theme_author['theme_name'] . '</a>', $content ); echo do_shortcode( wpautop( $content ) ); echo '</div>'; echo '</div>'; } } /** * Prepare Edit icon inside customizer. * * @param string $class custom class. * @since 3.9.4 */ public static function render_customizer_edit_button( $class = '' ) { ?> <div class="customize-partial-edit-shortcut <?php echo esc_attr( $class ); ?>" data-id="ahfb"> <button aria-label="<?php esc_attr_e( 'Click to edit this element.', 'astra' ); ?>" title="<?php esc_attr_e( 'Click to edit this element.', 'astra' ); ?>" class="customize-partial-edit-shortcut-button item-customizer-focus"> <?php echo self::fetch_svg_icon( 'edit' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </button> </div> <?php } /** * Prepare Special Edit navigatory trigger for Builder Grid Rows in customizer. * * @param string $type Header / Footer row type. * @param string $row_position Above / Primary / Below. * * @since 3.0.0 */ public static function render_grid_row_customizer_edit_button( $type, $row_position ) { switch ( $row_position ) { case 'primary': /* translators: %s: icon term */ $row_label = sprintf( __( 'Primary %s', 'astra' ), $type ); break; case 'above': /* translators: %s: icon term */ $row_label = sprintf( __( 'Above %s', 'astra' ), $type ); break; case 'below': /* translators: %s: icon term */ $row_label = sprintf( __( 'Below %s', 'astra' ), $type ); break; default: $row_label = $type; break; } ?> <div class="customize-partial-edit-shortcut row-editor-shortcut" data-id="ahfb"> <button aria-label="<?php esc_attr_e( 'Click to edit this element.', 'astra' ); ?>" title="<?php esc_attr_e( 'Click to edit this Row.', 'astra' ); ?>" class="item-customizer-focus"> <?php echo self::fetch_svg_icon( 'edit' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </button> </div> <?php } /** * Prepare Edit navigatory trigger for Banner Section in customizer. * * @since 3.9.0 */ public static function render_banner_customizer_edit_button() { ?> <div class="customize-partial-edit-shortcut banner-editor-shortcut" data-id="ahfb"> <button aria-label="<?php esc_attr_e( 'Click to edit this element.', 'astra' ); ?>" title="<?php esc_attr_e( 'Click to edit this Row.', 'astra' ); ?>" class="item-customizer-focus"> <?php echo self::fetch_svg_icon( 'edit' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </button> </div> <?php } /** * Render Trigger Markup. * * @since 3.0.0 */ public static function render_mobile_trigger() { $icon = astra_get_option( 'header-trigger-icon' ); $mobile_label = astra_get_option( 'mobile-header-menu-label' ); $toggle_btn_style = astra_get_option( 'mobile-header-toggle-btn-style' ); $aria_controls = ''; if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { $aria_controls = 'aria-controls="primary-menu"'; } ?> <div class="ast-button-wrap"> <button type="button" class="menu-toggle main-header-menu-toggle ast-mobile-menu-trigger-<?php echo esc_attr( $toggle_btn_style ); ?>" <?php echo apply_filters( 'astra_nav_toggle_data_attrs', '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> <?php echo esc_attr( $aria_controls ); ?> aria-expanded="false"> <span class="screen-reader-text">Main Menu</span> <span class="mobile-menu-toggle-icon"> <?php echo self::fetch_svg_icon( $icon ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo self::fetch_svg_icon( 'close' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </span> <?php if ( isset( $mobile_label ) && ! empty( $mobile_label ) ) { ?> <span class="mobile-menu-wrap"> <span class="mobile-menu"><?php echo esc_html( $mobile_label ); ?></span> </span> <?php } ?> </button> </div> <?php } /** * Prepare Button HTML. * * @param string $index The Index of the button. * @param string $builder_type the type of the builder. */ public static function render_button( $index, $builder_type = 'header' ) { if ( is_customize_preview() ) { self::render_customizer_edit_button(); } $button_size = astra_get_option( $builder_type . '-button' . $index . '-size' ); echo '<div class="ast-builder-button-wrap ast-builder-button-size-' . $button_size . '">'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo astra_get_custom_button( $builder_type . '-button' . $index . '-text', $builder_type . '-button' . $index . '-link-option', 'header-button' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Site Identity. * * @param string $device Device name. */ public static function render_site_identity( $device ) { ?> <?php if ( is_customize_preview() ) { self::render_customizer_edit_button(); } ?> <div <?php echo astra_attr( 'site-identity', array( 'class' => 'site-branding ast-site-identity', ) ); ?> > <?php astra_logo( $device ); ?> </div> <!-- .site-branding --> <?php } /** * Render Mobile Cart Flyout Markup. * * @since 3.1.0 */ public static function render_mobile_cart_flyout_markup() { $flyout_cart_width = astra_get_option( 'woo-slide-in-cart-width' ); $flyout_cart_width_desktop = ( isset( $flyout_cart_width['desktop'] ) ) ? $flyout_cart_width['desktop'] : ''; $flyout_cart_width_desktop_unit = ( isset( $flyout_cart_width['desktop-unit'] ) ) ? $flyout_cart_width['desktop-unit'] : ''; $flyout_cart_unit_breakpoint = 'px' === $flyout_cart_width_desktop_unit ? 500 : 50; $is_width_long = $flyout_cart_width_desktop && $flyout_cart_width_desktop > $flyout_cart_unit_breakpoint ? 'ast-large-view' : ''; ?> <div class="astra-mobile-cart-overlay"></div> <div id="astra-mobile-cart-drawer" class="astra-cart-drawer"> <div class="astra-cart-drawer-header"> <button type="button" class="astra-cart-drawer-close" aria-label="<?php echo esc_attr__( 'Close Cart Drawer', 'astra' ); ?>"> <?php echo self::fetch_svg_icon( 'close' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </button> <div class="astra-cart-drawer-title"> <?php echo apply_filters( 'astra_header_cart_flyout_shopping_cart_text', __( 'Shopping Cart', 'astra' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </div> </div> <div class="astra-cart-drawer-content <?php echo esc_attr( $is_width_long ); ?>"> <?php if ( class_exists( 'Astra_Woocommerce' ) ) { the_widget( 'WC_Widget_Cart', 'title=' ); } if ( class_exists( 'Easy_Digital_Downloads' ) ) { the_widget( 'edd_cart_widget', 'title=' ); } ?> </div> </div> <?php } /** * Account HTML. */ public static function render_account() { $is_logged_in = is_user_logged_in(); $link_href = ''; $new_tab = ''; $link_rel = ''; $account_link = ''; $link_url = ''; $logout_preview = astra_get_option( 'header-account-logout-preview' ); $is_customizer = is_customize_preview(); $logged_out_style = astra_get_option( 'header-account-logout-style' ); if ( ! $is_logged_in && 'none' === $logged_out_style ) { return; } $icon_skin = ( '' !== astra_get_option( 'header-account-icon-type' ) ) ? astra_get_option( 'header-account-icon-type' ) : 'account-1'; ?> <div class="ast-header-account-wrap"> <?php if ( $is_customizer ) { self::render_customizer_edit_button(); } /** @psalm-suppress RedundantConditionGivenDocblockType */ // phpcs:ignore Generic.Commenting.DocComment.MissingShort if ( $is_logged_in && ( ( ( ( ! $logout_preview ) || ( 'none' === $logged_out_style && $logout_preview ) ) && $is_customizer ) || ( ! $is_customizer ) ) ) { $account_type = astra_get_option( 'header-account-type' ); $login_profile_type = astra_get_option( 'header-account-login-style' ); $action_type = astra_get_option( 'header-account-action-type' ); $link_type = astra_get_option( 'header-account-link-type' ); $account_link = astra_get_option( 'header-account-login-link' ); $logged_in_text = astra_get_option( 'header-account-logged-in-text' ); if ( 'default' !== $account_type && 'default' === $link_type && defined( 'ASTRA_EXT_VER' ) ) { $new_tab = 'target=_self'; if ( 'woocommerce' === $account_type && class_exists( 'WooCommerce' ) ) { $woocommerce_link = get_permalink( get_option( 'woocommerce_myaccount_page_id' ) ); $link_url = ( $woocommerce_link ) ? $woocommerce_link : ''; } elseif ( 'lifterlms' === $account_type && class_exists( 'LifterLMS' ) ) { $lifterlms_link = get_permalink( llms_get_page_id( 'myaccount' ) ); $link_url = ( $lifterlms_link ) ? $lifterlms_link : ''; } } elseif ( '' !== $account_link && '' !== $account_link['url'] ) { $link_url = $account_link['url']; $new_tab = ( $account_link['new_tab'] ? 'target=_blank' : 'target=_self' ); $link_rel = ( ! empty( $account_link['link_rel'] ) ? 'rel=' . esc_attr( $account_link['link_rel'] ) : '' ); } $link_href = ( '' !== $link_url ) ? 'href=' . esc_url( $link_url ) : ''; $link_classes = 'ast-header-account-link ast-header-account-type-' . $login_profile_type . ' ast-account-action-' . $action_type; ?> <div class="ast-header-account-inner-wrap"> <a class="<?php echo esc_attr( $link_classes ); ?>" role="link" aria-label="<?php esc_attr_e( 'Account icon link', 'astra' ); ?>" <?php echo esc_attr( $link_href . ' ' . $new_tab . ' ' . $link_rel ); ?> > <?php if ( 'avatar' === $login_profile_type ) { echo get_avatar( get_current_user_id() ); } elseif ( 'icon' === $login_profile_type ) { echo self::fetch_svg_icon( $icon_skin ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } elseif ( 'text' === $login_profile_type ) { ?> <span class="ast-header-account-text"><?php echo esc_html( $logged_in_text ); ?></span> <?php } ?> </a> <?php if ( defined( 'ASTRA_EXT_VER' ) && 'menu' === $action_type ) { Astra_Header_Account_Component::account_menu_markup(); } ?> </div> <?php } elseif ( ( 'none' !== $logged_out_style ) && ( ( ! $is_logged_in ) || ( $is_logged_in && $logout_preview && $is_customizer ) ) ) { ?> <?php $logged_out_style_class = ''; $action_type = astra_get_option( 'header-account-logout-action' ); $logged_out_style_class = 'ast-header-account-link ast-header-account-type-' . $logged_out_style . ' ast-account-action-' . $action_type; $logged_out_text = astra_get_option( 'header-account-logged-out-text' ); $login_link = astra_get_option( 'header-account-logout-link' ); $show_lost_password = astra_get_option( 'header-account-login-lostpass' ); $show_register = ( get_option( 'users_can_register' ) && astra_get_option( 'header-account-login-register' ) ); if ( '' !== $login_link && '' !== $login_link['url'] ) { $current_url = home_url( add_query_arg( array(), $GLOBALS['wp']->request ) ); $default_login = wp_login_url(); if ( $default_login === $login_link['url'] ) { $login_link['url'] = wp_login_url( $current_url ); } $link_url = $login_link['url']; $new_tab = ( $login_link['new_tab'] ? 'target=_blank' : 'target=_self' ); $link_rel = ( ! empty( $login_link['link_rel'] ) ? 'rel=' . esc_attr( $login_link['link_rel'] ) : '' ); } $link_href = 'href=' . esc_url( $link_url ) . ''; ?> <a class="<?php echo esc_attr( $logged_out_style_class ); ?>" aria-label="<?php esc_attr_e( 'Account icon link', 'astra' ); ?>" <?php echo esc_attr( $link_href . ' ' . $new_tab . ' ' . $link_rel ); ?> > <?php if ( 'icon' === $logged_out_style ) { ?> <?php echo self::fetch_svg_icon( $icon_skin ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> <?php } elseif ( 'text' === $logged_out_style ) { ?> <span class="ast-header-account-text"><?php echo esc_html( $logged_out_text ); ?></span> <?php } ?> </a> <?php if ( defined( 'ASTRA_EXT_VER' ) && 'login' === $action_type ) { ?> <div id="ast-hb-account-login-wrap" class="ast-hb-account-login-wrapper"> <div class="ast-hb-account-login-bg"></div> <div class="ast-hb-account-login"> <div class="ast-hb-login-header"> <button id="ast-hb-login-close" class="ast-hb-login-close" aria-label="Close popup"> <span class="ast-svg-iconset"> <?php echo self::fetch_svg_icon( 'close' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </span> </button> </div> <div class="ast-hb-login-body"> <div class="ast-hb-account-login-form"> <?php $args = array( 'echo' => true, 'remember' => true, 'value_remember' => true, ); echo wp_login_form( $args ); ?> </div> <div class="ast-hb-account-login-form-footer"> <?php if ( $show_lost_password || $show_register ) { if ( $show_register ) { $register_url = wp_registration_url(); ?> <a class="ast-header-account-footer-link" href="<?php echo esc_url( $register_url ); ?>" > <span class="ast-header-account-register"><?php echo esc_html( __( 'Register', 'astra' ) ); ?></span> </a> <?php } if ( $show_lost_password ) { $lostpass_url = wp_lostpassword_url(); ?> <a class="ast-header-account-footer-link" href="<?php echo esc_url( $lostpass_url ); ?>" > <span class="ast-header-account-lostpass"><?php echo esc_html( __( 'Lost your password?', 'astra' ) ); ?></span> </a> <?php } } ?> </div> </div> </div> </div> <?php } ?> <?php } ?> </div> <?php } } } ?> class-astra-builder-widget-controller.php 0000666 00000006233 15165504212 0014571 0 ustar 00 <?php /** * Astra Builder Widget Controller. * * @package astra-builder */ // No direct access, please. if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( 'Astra_Builder_Widget_Controller' ) ) { /** * Class Astra_Builder_Widget_Controller. */ final class Astra_Builder_Widget_Controller { /** * Member Variable * * @var instance */ private static $instance = null; /** * Initiator */ public static function get_instance() { if ( is_null( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } /** * Constructor */ public function __construct() { add_action( 'widgets_init', array( $this, 'widget_init' ) ); add_filter( 'customize_section_active', array( $this, 'display_sidebar' ), 99, 2 ); } /** * Display sidebar as section. * * @param bool $active ios active. * @param object $section section. * @return bool */ public function display_sidebar( $active, $section ) { if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { return $active; } if ( strpos( $section->id, 'widgets-footer-widget-' ) || strpos( $section->id, 'widgets-header-widget-' ) ) { $active = true; } return $active; } /** * Initiate Astra Widgets. */ public function widget_init() { if ( false === Astra_Builder_Helper::$is_header_footer_builder_active ) { return; } // Register Footer Widgets. $component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_footer_widgets; for ( $index = 1; $index <= $component_limit; $index++ ) { if ( ! is_customize_preview() && ! Astra_Builder_Helper::is_component_loaded( 'widget-' . $index, 'footer' ) ) { continue; } $this->register_sidebar( $index, 'footer' ); } $component_limit = defined( 'ASTRA_EXT_VER' ) ? Astra_Builder_Helper::$component_limit : Astra_Builder_Helper::$num_of_header_widgets; for ( $index = 1; $index <= $component_limit; $index++ ) { if ( ! is_customize_preview() && ! Astra_Builder_Helper::is_component_loaded( 'widget-' . $index, 'header' ) ) { continue; } $this->register_sidebar( $index, 'header' ); } } /** * Register widget for the builder. * * @param integer $index index of widget. * @param string $builder_type builder type. */ public function register_sidebar( $index, $builder_type = 'header' ) { register_sidebar( apply_filters( 'astra_' . $builder_type . '_widget_' . $index . 'args', array( 'name' => ucfirst( $builder_type ) . ' Builder Widget ' . $index, 'id' => $builder_type . '-widget-' . $index, 'description' => esc_html__( 'Add widgets here:', 'astra' ), 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>', ) ) ); } } /** * Prepare if class 'Astra_Builder_Widget_Controller' exist. * Kicking this off by calling 'get_instance()' method */ Astra_Builder_Widget_Controller::get_instance(); }
| ver. 1.4 |
Github
|
.
| PHP 5.4.45 | Generation time: 0 |
proxy
|
phpinfo
|
Settings