From 9d4123cee1867ee7199b06bdc92d40611f547ecc Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 21 Jul 2021 14:54:07 -0500 Subject: Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/. --- .../class-astra-builder-ui-controller.php | 490 +++++++++++++++++++++ 1 file changed, 490 insertions(+) create mode 100644 inc/builder/controllers/class-astra-builder-ui-controller.php (limited to 'inc/builder/controllers/class-astra-builder-ui-controller.php') diff --git a/inc/builder/controllers/class-astra-builder-ui-controller.php b/inc/builder/controllers/class-astra-builder-ui-controller.php new file mode 100644 index 0000000..0363351 --- /dev/null +++ b/inc/builder/controllers/class-astra-builder-ui-controller.php @@ -0,0 +1,490 @@ +'; + + 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 .= ''; + + 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 '
'; + + if ( is_customize_preview() ) { + self::render_customizer_edit_button(); + } + + echo ''; + echo '
'; + } + + /** + * 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 ''; + } + } + + /** + * Prepare Edit icon inside customizer. + */ + public static function render_customizer_edit_button() { + ?> +
+ +
+ +
+ +
+ +
+ +
+ '; // 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 ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } + + /** + * Site Identity. + */ + public static function render_site_identity() { + ?> + +
'site-branding ast-site-identity', + ) + ); + ?> + > + +
+ + +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+ + + + + + + + + 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 ) . ''; + ?> + > + + + + + + + + + + + +
+ + -- cgit v1.2.3-70-g09d2