PluginProbe
Borderless – Addons and Templates for Elementor / trunk
Borderless – Addons and Templates for Elementor vtrunk
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 All 78 releases
borderless / includes / library / inc / ViewHelpers.php

ViewHelpers.php in Borderless – Addons and Templates for Elementor trunk, at includes/library/inc/ViewHelpers.php

50 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace LIBRARY;
4
5 class ViewHelpers {
6
7 public static function plugin_header_output() {
8 ob_start(); ?>
9 <nav class="borderless-library__header navbar py-3 sticky-top">
10 <div class="container-fluid">
11 <a class="navbar-brand" href="#">
12 <img src=<?php echo BORDERLESS__ASSETS . "img/borderless.svg" ?> alt="Logo">
13 </a>
14 </div>
15 </nav>
16 <?php $plugin_title = ob_get_clean();
17
18 return Helpers::apply_filters( 'library/plugin_page_title', $plugin_title );
19 }
20
21 public static function small_theme_card( $selected = null ) {
22 $theme = wp_get_theme();
23 $screenshot = $theme->get_screenshot();
24 $name = $theme->name;
25
26 if ( isset( $selected ) ) {
27 $library = BorderlessLibraryImporter::get_instance();
28 $selected_data = $library->import_files[ $selected ];
29 $name = ! empty( $selected_data['import_file_name'] ) ? $selected_data['import_file_name'] : $name;
30 $screenshot = ! empty( $selected_data['import_preview_image_url'] ) ? $selected_data['import_preview_image_url'] : $screenshot;
31 }
32
33 ob_start(); ?>
34 <div class="library__card library__card--theme">
35 <div class="library__card-content">
36 <?php if ( $screenshot ) : ?>
37 <div class="screenshot"><img src="<?php echo esc_url( $screenshot ); ?>" alt="<?php esc_attr_e( 'Theme screenshot', 'borderless' ); ?>" /></div>
38 <?php else : ?>
39 <div class="screenshot blank"></div>
40 <?php endif; ?>
41 </div>
42 <div class="library__card-footer">
43 <h3><?php echo esc_html( $name ); ?></h3>
44 </div>
45 </div>
46 <?php
47 return ob_get_clean();
48 }
49 }
50