PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.4
Elementor Website Builder – more than just a page builder v3.32.4
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / includes / editor-templates / templates.php

templates.php in Elementor Website Builder – more than just a page builder 3.32.4, at includes/editor-templates/templates.php

634 lines 33.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor;
3
4 use Elementor\Plugin;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly.
8 }
9 ?>
10 <script type="text/template" id="tmpl-elementor-template-library-header-actions">
11 <?php if ( User::is_current_user_can_upload_json() ) { ?>
12 <div id="elementor-template-library-header-import" class="elementor-templates-modal__header__item">
13 <i class="eicon-upload-circle-o" aria-hidden="true"></i>
14 <span class="elementor-screen-only"><?php echo esc_html__( 'Import Template', 'elementor' ); ?></span>
15 </div>
16 <?php } ?>
17 <div id="elementor-template-library-header-sync" class="elementor-templates-modal__header__item">
18 <i class="eicon-sync" aria-hidden="true"></i>
19 <span class="elementor-screen-only"><?php echo esc_html__( 'Sync Library', 'elementor' ); ?></span>
20 </div>
21 <div id="elementor-template-library-header-save" class="elementor-templates-modal__header__item">
22 <i class="eicon-save-o" aria-hidden="true"></i>
23 <span class="elementor-screen-only"><?php echo esc_html__( 'Save', 'elementor' ); ?></span>
24 </div>
25 </script>
26
27 <script type="text/template" id="tmpl-elementor-template-library-header-menu">
28 <# jQuery.each( tabs, ( tab, args ) => { #>
29 <div class="elementor-component-tab elementor-template-library-menu-item" data-tab="{{{ tab }}}">{{{ args.title }}}</div>
30 <# } ); #>
31 </script>
32
33 <script type="text/template" id="tmpl-elementor-template-library-header-preview">
34 <div id="elementor-template-library-header-preview-insert-wrapper" class="elementor-templates-modal__header__item">
35 {{{ elementor.templates.layout.getTemplateActionButton( obj ) }}}
36 </div>
37 </script>
38
39 <script type="text/template" id="tmpl-elementor-template-library-header-back">
40 <i class="eicon-chevron-left" aria-hidden="true"></i>
41 <span><?php echo esc_html__( 'Back to Library', 'elementor' ); ?></span>
42 </script>
43
44 <script type="text/template" id="tmpl-elementor-template-library-loading">
45 <div class="elementor-loader-wrapper">
46 <div class="elementor-loader">
47 <div class="elementor-loader-boxes">
48 <div class="elementor-loader-box"></div>
49 <div class="elementor-loader-box"></div>
50 <div class="elementor-loader-box"></div>
51 <div class="elementor-loader-box"></div>
52 </div>
53 </div>
54 <div class="elementor-loading-title"><?php echo esc_html__( 'Loading', 'elementor' ); ?></div>
55 </div>
56 </script>
57
58 <script type="text/template" id="tmpl-elementor-template-library-templates">
59 <#
60 var activeSource = elementor.templates.getFilter('source');
61 /**
62 * Filter template source.
63 *
64 * @param bool isRemote - If `true` the source is a remote source.
65 * @param string activeSource - The current template source.
66 */
67 const isRemote = elementor.hooks.applyFilters( 'templates/source/is-remote', activeSource === 'remote', activeSource );
68 #>
69 <div id="elementor-template-library-toolbar">
70 <# if ( isRemote ) {
71 var activeType = elementor.templates.getFilter('type');
72 #>
73 <div id="elementor-template-library-filter-toolbar-remote" class="elementor-template-library-filter-toolbar">
74 <# if ( 'page' === activeType ) { #>
75 <div id="elementor-template-library-order">
76 <input type="radio" id="elementor-template-library-order-new" class="elementor-template-library-order-input" name="elementor-template-library-order" value="date">
77 <label for="elementor-template-library-order-new" class="elementor-template-library-order-label"><?php echo esc_html__( 'New', 'elementor' ); ?></label>
78 <input type="radio" id="elementor-template-library-order-trend" class="elementor-template-library-order-input" name="elementor-template-library-order" value="trendIndex">
79 <label for="elementor-template-library-order-trend" class="elementor-template-library-order-label"><?php echo esc_html__( 'Trend', 'elementor' ); ?></label>
80 <input type="radio" id="elementor-template-library-order-popular" class="elementor-template-library-order-input" name="elementor-template-library-order" value="popularityIndex">
81 <label for="elementor-template-library-order-popular" class="elementor-template-library-order-label"><?php echo esc_html__( 'Popular', 'elementor' ); ?></label>
82 </div>
83 <# } else if ( 'lb' !== activeType ) {
84 var config = elementor.templates.getConfig( activeType );
85 if ( config.categories ) { #>
86 <div id="elementor-template-library-filter">
87 <select id="elementor-template-library-filter-subtype" class="elementor-template-library-filter-select" data-elementor-filter="subtype">
88 <option></option>
89 <# config.categories.forEach( function( category ) {
90 var selected = category === elementor.templates.getFilter( 'subtype' ) ? ' selected' : '';
91 #>
92 <option value="{{ category }}"{{{ selected }}}>{{{ category }}}</option>
93 <# } ); #>
94 </select>
95 </div>
96 <# }
97 } #>
98 <div id="elementor-template-library-my-favorites">
99 <# var checked = elementor.templates.getFilter( 'favorite' ) ? ' checked' : ''; #>
100 <input id="elementor-template-library-filter-my-favorites" type="checkbox"{{{ checked }}}>
101 <label id="elementor-template-library-filter-my-favorites-label" for="elementor-template-library-filter-my-favorites">
102 <i class="eicon" aria-hidden="true"></i>
103 <?php echo esc_html__( 'My Favorites', 'elementor' ); ?>
104 </label>
105 </div>
106 </div>
107 <# } else { #>
108 <div id="elementor-template-library-filter-toolbar-local" class="elementor-template-library-filter-toolbar">
109 <div id="elementor-template-library-filter">
110 <div class="elementor-template-library-filter-select-source">
111 <div class="source-option<# if ( activeSource === 'local' ) { #> selected<# } #>" data-source="local">
112 <i class="eicon-header" aria-hidden="true"></i>
113 <?php echo esc_html__( 'Site templates', 'elementor' ); ?>
114 </div>
115 <div class="source-option<# if ( activeSource === 'cloud' ) { #> selected<# } #>" data-source="cloud">
116 <i class="eicon-library-cloud-empty" aria-hidden="true"></i>
117 <?php echo esc_html__( 'Cloud templates', 'elementor' ); ?>
118 <#
119 const tabIcon = elementor.templates.hasCloudLibraryQuota()
120 ? '<span class="new-badge"><?php echo esc_html__( 'New', 'elementor' ); ?></span>'
121 : '<span class="new-badge"><i class="eicon-upgrade-crown" style="margin-inline-end: 0;"></i> <?php echo esc_html__( 'Pro', 'elementor' ); ?></span>';
122
123 print( tabIcon );
124 #>
125 </div>
126 </div>
127 </div>
128 </div>
129 <# } #>
130
131 <div class="elementor-template-library-filter-toolbar-side-actions">
132 <# if ( 'cloud' === activeSource ) { #>
133 <div id="elementor-template-library-add-new-folder" class="elementor-template-library-action-item">
134 <i class="eicon-folder-plus" aria-hidden="true"></i>
135 <span class="elementor-screen-only"><?php echo esc_html__( 'Create a New Folder', 'elementor' ); ?></span>
136 </div>
137 <span class="divider"></span>
138 <div id="elementor-template-library-view-grid" class="elementor-template-library-action-item">
139 <i class="eicon-library-grid" aria-hidden="true"></i>
140 <span class="elementor-screen-only"><?php echo esc_html__( 'Grid view', 'elementor' ); ?></span>
141 </div>
142 <div id="elementor-template-library-view-list" class="elementor-template-library-action-item">
143 <i class="eicon-library-list" aria-hidden="true"></i>
144 <span class="elementor-screen-only"><?php echo esc_html__( 'List view', 'elementor' ); ?></span>
145 </div>
146 <# } #>
147 <div id="elementor-template-library-filter-text-wrapper">
148 <label for="elementor-template-library-filter-text" class="elementor-screen-only"><?php echo esc_html__( 'Search Templates:', 'elementor' ); ?></label>
149 <input id="elementor-template-library-filter-text" placeholder="<?php echo esc_attr__( 'Search', 'elementor' ); ?>">
150 <i class="eicon-search"></i>
151 </div>
152 </div>
153 </div>
154 <# if ( 'local' === activeSource || 'cloud' === activeSource ) { #>
155 <div class="toolbar-container">
156 <div class="bulk-selection-action-bar">
157 <span class="clear-bulk-selections"><i class="eicon-editor-close"></i></span>
158 <span class="selected-count"></span>
159 <# if ( elementor.templates.hasCloudLibraryQuota() && ! elementor.templates.cloudLibraryIsDeactivated() ) { #>
160 <span class="bulk-copy"><i class="eicon-library-copy" aria-hidden="true" title="<?php esc_attr_e( 'Copy', 'elementor' ); ?>"></i></span>
161 <span class="bulk-move"><i class="eicon-library-move" aria-hidden="true" title="<?php esc_attr_e( 'Move', 'elementor' ); ?>"></i></span>
162 <# } #>
163 <span class="bulk-delete"><i class="eicon-library-delete" aria-hidden="true" title="<?php esc_attr_e( 'Delete', 'elementor' ); ?>"></i></span>
164 </div>
165 <div id="elementor-template-library-navigation-container"></div>
166
167 <# if ( 'cloud' === activeSource ) { #>
168 <div class="quota-progress-container">
169 <span class="quota-progress-info">
170 <?php echo esc_html__( 'Usage', 'elementor' ); ?>
171 </span>
172 <div class="progress-bar-container">
173 <div class="quota-progress-bar quota-progress-bar-normal">
174 <div class="quota-progress-bar-fill"></div>
175 </div>
176 <span class="quota-warning"></span>
177 </div>
178 <div class="quota-progress-bar-value"></div>
179 </div>
180 <# } #>
181 </div>
182 <div id="elementor-template-library-order-toolbar-local">
183 <div class="elementor-template-library-local-column-1">
184 <input type="checkbox" id="bulk-select-all">
185 <input type="radio" id="elementor-template-library-order-local-title" class="elementor-template-library-order-input" name="elementor-template-library-order-local" value="title" data-default-ordering-direction="asc">
186 <label for="elementor-template-library-order-local-title" class="elementor-template-library-order-label"><?php echo esc_html__( 'Name', 'elementor' ); ?></label>
187 </div>
188 <div class="elementor-template-library-local-column-2">
189 <input type="radio" id="elementor-template-library-order-local-type" class="elementor-template-library-order-input" name="elementor-template-library-order-local" value="type" data-default-ordering-direction="asc">
190 <label for="elementor-template-library-order-local-type" class="elementor-template-library-order-label"><?php echo esc_html__( 'Type', 'elementor' ); ?></label>
191 </div>
192 <div class="elementor-template-library-local-column-3">
193 <# if ( 'cloud' !== activeSource ) { #>
194 <input type="radio" id="elementor-template-library-order-local-author" class="elementor-template-library-order-input" name="elementor-template-library-order-local" value="author" data-default-ordering-direction="asc">
195 <# } #>
196 <label for="elementor-template-library-order-local-author" class="elementor-template-library-order-label"><?php echo esc_html__( 'Created By', 'elementor' ); ?></label>
197 </div>
198 <div class="elementor-template-library-local-column-4">
199 <input type="radio" id="elementor-template-library-order-local-date" class="elementor-template-library-order-input" name="elementor-template-library-order-local" value="date">
200 <label for="elementor-template-library-order-local-date" class="elementor-template-library-order-label"><?php echo esc_html__( 'Creation Date', 'elementor' ); ?></label>
201 </div>
202 <div class="elementor-template-library-local-column-5">
203 <div class="elementor-template-library-order-label"><?php echo esc_html__( 'Actions', 'elementor' ); ?></div>
204 </div>
205 </div>
206 <# } #>
207 <div id="elementor-template-library-templates-container"></div>
208 <# if ( isRemote ) { #>
209 <div id="elementor-template-library-footer-banner">
210 <img class="elementor-nerd-box-icon" src="<?php
211 Utils::print_unescaped_internal_string( ELEMENTOR_ASSETS_URL . 'images/information.svg' );
212 ?>" loading="lazy" alt="<?php echo esc_attr__( 'Elementor', 'elementor' ); ?>" />
213 <div class="elementor-excerpt"><?php echo esc_html__( 'Stay tuned! More awesome templates coming real soon.', 'elementor' ); ?></div>
214 </div>
215 <# } #>
216 <# if ( 'cloud' === activeSource ) { #>
217 <div id="elementor-template-library-load-more-anchor" class="elementor-visibility-hidden"><i class="eicon-loading eicon-animation-spin"></i></div>
218 <# } #>
219 </script>
220
221 <script type="text/template" id="tmpl-elementor-template-library-navigation-container">
222 <button class="elementor-template-library-navigation-back-button elementor-button e-button">
223 <i class="eicon-chevron-left"></i>
224 <?php echo esc_html__( 'Back', 'elementor' ); ?>
225 </button>
226 <span class="elementor-template-library-current-folder-title"></span>
227 </script>
228
229 <script type="text/template" id="tmpl-elementor-template-library-template-remote">
230 <div class="elementor-template-library-template-body">
231 <?php // 'lp' stands for Landing Pages Library type. ?>
232 <# if ( 'page' === type || 'lp' === type ) { #>
233 <div class="elementor-template-library-template-screenshot" style="background-image: url({{ thumbnail }});"></div>
234 <# } else { #>
235 <img src="{{ thumbnail }}" loading="lazy">
236 <# } #>
237 <div class="elementor-template-library-template-preview">
238 <i class="eicon-zoom-in-bold" aria-hidden="true"></i>
239 </div>
240 </div>
241 <div class="elementor-template-library-template-footer">
242 {{{ elementor.templates.layout.getTemplateActionButton( obj ) }}}
243 <div class="elementor-template-library-template-name">{{{ title }}} - {{{ type }}}</div>
244 <div class="elementor-template-library-favorite">
245 <input id="elementor-template-library-template-{{ template_id }}-favorite-input" class="elementor-template-library-template-favorite-input" type="checkbox"{{ favorite ? " checked" : "" }}>
246 <label for="elementor-template-library-template-{{ template_id }}-favorite-input" class="elementor-template-library-template-favorite-label">
247 <i class="eicon-heart-o" aria-hidden="true"></i>
248 <span class="elementor-screen-only"><?php echo esc_html__( 'Favorite', 'elementor' ); ?></span>
249 </label>
250 </div>
251 </div>
252 </script>
253
254 <script type="text/template" id="tmpl-elementor-template-library-template-local">
255 <#
256 const activeSource = elementor.templates.getFilter('source');
257 const view = elementor.templates.getFilter('view') ?? elementor.templates.getViewSelection() ?? 'list';
258
259 if ( ( 'cloud' === activeSource && view === 'list' ) || 'local' === activeSource ) {
260 #>
261 <div class="elementor-template-library-template-name elementor-template-library-local-column-1">
262 <input type="checkbox" class="bulk-selection-item-checkbox" data-template_id="{{ template_id }}" data-type="{{ type }}" data-status="{{ status }}">
263 <# if ( 'cloud' === activeSource ) {
264 const sourceIcon = typeof subType !== 'undefined' && 'FOLDER' === subType
265 ? '<i class="eicon-library-folder" aria-hidden="true"></i>'
266 : 'locked' === status
267 ? '<i class="eicon-lock-outline" aria-hidden="true" title="<?php esc_attr_e( 'Upgrade to get more storage space or delete old templates to make room.', 'elementor' ); ?>"></i>'
268 : '<i class="eicon-global-colors" aria-hidden="true"></i>';
269
270 print( sourceIcon );
271 } #>
272 <span>{{ title }}</span>
273 </div>
274 <div class="elementor-template-library-template-meta elementor-template-library-template-type elementor-template-library-local-column-2">{{{ elementor.translate( type ) }}}</div>
275 <div class="elementor-template-library-template-meta elementor-template-library-template-author elementor-template-library-local-column-3">{{{ author }}}</div>
276 <div class="elementor-template-library-template-meta elementor-template-library-template-date elementor-template-library-local-column-4">{{{ human_date }}}</div>
277 <div class="elementor-template-library-template-controls elementor-template-library-local-column-5">
278 <#
279 const previewClass = typeof subType !== 'undefined' && 'FOLDER' !== subType
280 ? 'elementor-hidden'
281 : '';
282 #>
283 <div class="elementor-template-library-template-preview elementor-button e-btn-txt {{{previewClass}}}">
284 <#
285 const actionText = typeof subType === 'undefined' || 'FOLDER' !== subType
286 ? '<?php echo esc_html__( 'Preview', 'elementor' ); ?>'
287 : '<?php echo esc_html__( 'Open', 'elementor' ); ?>';
288 #>
289 <i class="eicon-preview-medium" aria-hidden="true"></i>
290 <span class="elementor-template-library-template-control-title">{{{ actionText }}}</span>
291 </div>
292 <# if ( typeof subType === 'undefined' || 'FOLDER' !== subType ) { #>
293 <button class="elementor-template-library-template-action elementor-template-library-template-insert elementor-button e-primary e-btn-txt">
294 <i class="eicon-library-download" aria-hidden="true"></i>
295 <span class="elementor-button-title"><?php echo esc_html__( 'Insert', 'elementor' ); ?></span>
296 </button>
297 <# } #>
298 <div class="elementor-template-library-template-more-toggle">
299 <i class="eicon-ellipsis-h" aria-hidden="true"></i>
300 <span class="elementor-screen-only"><?php echo esc_html__( 'More actions', 'elementor' ); ?></span>
301 </div>
302 <div class="elementor-template-library-template-more">
303 <# if ( ( typeof subType === 'undefined' || 'FOLDER' !== subType ) && elementor.templates.hasCloudLibraryQuota() && ! elementor.templates.cloudLibraryIsDeactivated() ) { #>
304 <div class="elementor-template-library-template-move">
305 <i class="eicon-library-move" aria-hidden="true"></i>
306 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Move to', 'elementor' ); ?></span>
307 </div>
308 <div class="elementor-template-library-template-copy">
309 <i class="eicon-library-copy" aria-hidden="true"></i>
310 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Copy to', 'elementor' ); ?></span>
311 </div>
312 <# } #>
313 <div class="elementor-template-library-template-export">
314 <a href="{{ export_link }}">
315 <i class="eicon-library-download" aria-hidden="true"></i>
316 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Export', 'elementor' ); ?></span>
317 </a>
318 </div>
319 <div class="elementor-template-library-template-rename">
320 <i class="eicon-library-edit" aria-hidden="true"></i>
321 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Rename', 'elementor' ); ?></span>
322 </div>
323 <div class="elementor-template-library-template-delete">
324 <i class="eicon-library-delete" aria-hidden="true"></i>
325 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Delete', 'elementor' ); ?></span>
326 </div>
327 </div>
328 </div>
329 <# } else {
330 if ( typeof subType !== 'undefined' && 'FOLDER' === subType ) {
331 #>
332 <div class="elementor-template-library-template-type-icon">
333 <i class="eicon-library-folder-view" aria-hidden="true"></i>
334 <span class="elementor-screen-only"><?php echo esc_html__( 'Folder', 'elementor' ); ?></span>
335 </div>
336 <div class="elementor-template-library-template-name">
337 <span>{{ title }}</span>
338 </div>
339 <div class="elementor-template-library-template-more-toggle">
340 <i class="eicon-ellipsis-v" aria-hidden="true"></i>
341 <span class="elementor-screen-only"><?php echo esc_html__( 'More actions', 'elementor' ); ?></span>
342 </div>
343 <div class="elementor-template-library-template-more" style="display: none;">
344 <div class="elementor-template-library-template-export">
345 <a href="{{ export_link }}">
346 <i class="eicon-library-download" aria-hidden="true"></i>
347 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Export', 'elementor' ); ?></span>
348 </a>
349 </div>
350 <div class="elementor-template-library-template-rename">
351 <i class="eicon-library-edit" aria-hidden="true"></i>
352 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Rename', 'elementor' ); ?></span>
353 </div>
354 <div class="elementor-template-library-template-delete">
355 <i class="eicon-library-delete" aria-hidden="true"></i>
356 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Delete', 'elementor' ); ?></span>
357 </div>
358 </div>
359 <# } else { #>
360 <#
361 const imageSource = preview_url || '<?php echo esc_html( ELEMENTOR_ASSETS_URL . 'images/placeholder-cloud-grid.png' ); ?>';
362 #>
363 <div class="elementor-template-library-template-thumbnail">
364 <img src="{{{ imageSource }}}"/>
365 <div class="elementor-template-library-template-preview"></div>
366 </div>
367 <div class="elementor-template-library-card-footer">
368 <div class="elementor-template-library-template-name">
369 <# if ( 'locked' === status ) { #>
370 <i class="eicon-lock-outline" aria-hidden="true" title="<?php esc_attr_e( 'Upgrade to get more storage space or delete old templates to make room.', 'elementor' ); ?>"></i>
371 <# } #>
372 <span>{{ title }}</span>
373 </div>
374 <div class="elementor-template-library-template-card-footer-overlay">
375 <button class="elementor-template-library-template-action elementor-template-library-template-insert elementor-button e-primary">
376 <i class="eicon-library-download" aria-hidden="true"></i>
377 <span class="elementor-button-title"><?php echo esc_html__( 'Insert', 'elementor' ); ?></span>
378 </button>
379 <div class="elementor-template-library-template-card-footer-overlay-info">
380 <div class="elementor-template-library-template-meta">{{{ author }}}</div>
381 <div class="elementor-template-library-template-meta">{{{ human_date }}}</div>
382 </div>
383 </div>
384 <div class="elementor-template-library-template-more-toggle">
385 <i class="eicon-ellipsis-v" aria-hidden="true"></i>
386 <span class="elementor-screen-only"><?php echo esc_html__( 'More actions', 'elementor' ); ?></span>
387 </div>
388 <div class="elementor-template-library-template-more" style="display: none;">
389 <div class="elementor-template-library-template-move">
390 <i class="eicon-library-move" aria-hidden="true"></i>
391 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Move to', 'elementor' ); ?></span>
392 </div>
393 <div class="elementor-template-library-template-copy">
394 <i class="eicon-library-copy" aria-hidden="true"></i>
395 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Copy to', 'elementor' ); ?></span>
396 </div>
397 <div class="elementor-template-library-template-export">
398 <a href="{{ export_link }}">
399 <i class="eicon-library-download" aria-hidden="true"></i>
400 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Export', 'elementor' ); ?></span>
401 </a>
402 </div>
403 <div class="elementor-template-library-template-rename">
404 <i class="eicon-library-edit" aria-hidden="true"></i>
405 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Rename', 'elementor' ); ?></span>
406 </div>
407 <div class="elementor-template-library-template-delete">
408 <i class="eicon-library-delete" aria-hidden="true"></i>
409 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Delete', 'elementor' ); ?></span>
410 </div>
411 </div>
412 </div>
413 <# } } #>
414 </script>
415
416 <script type="text/template" id="tmpl-elementor-template-library-insert-button">
417 <a class="elementor-template-library-template-action elementor-template-library-template-insert elementor-button e-primary">
418 <i class="eicon-library-download" aria-hidden="true"></i>
419 <span class="elementor-button-title"><?php echo esc_html__( 'Insert', 'elementor' ); ?></span>
420 </a>
421 </script>
422
423 <script type="text/template" id="tmpl-elementor-template-library-apply-ai-button">
424 <a class="elementor-template-library-template-action elementor-template-library-template-apply-ai elementor-button e-primary">
425 <i class="eicon-file-download" aria-hidden="true"></i>
426 <span class="elementor-button-title"><?php echo esc_html__( 'Apply', 'elementor' ); ?></span>
427 </a>
428 </script>
429
430 <script type="text/template" id="tmpl-elementor-template-library-insert-and-ai-variations-buttons">
431 <a class="elementor-template-library-template-action elementor-template-library-template-insert elementor-button e-primary">
432 <i class="eicon-library-download" aria-hidden="true"></i>
433 <span class="elementor-button-title"><?php echo esc_html__( 'Insert', 'elementor' ); ?></span>
434 </a>
435 <a class="elementor-template-library-template-action elementor-template-library-template-generate-variation elementor-button e-btn-txt e-btn-txt-border">
436 <i class="eicon-ai" aria-hidden="true"></i>
437 <span class="elementor-button-title"><?php echo esc_html__( 'Generate Variations', 'elementor' ); ?></span>
438 </a>
439 </script>
440
441 <script type="text/template" id="tmpl-elementor-template-library-upgrade-plan-button">
442 <a
443 class="elementor-template-library-template-action elementor-button go-pro"
444 href="{{{ promotionLink }}}"
445 target="_blank"
446 >
447 <span class="elementor-button-title">{{{ promotionText }}}</span>
448 </a>
449 </script>
450
451 <script type="text/template" id="tmpl-elementor-template-library-save-template">
452 <div class="elementor-template-library-blank-icon">
453 <#
454 const templateIcon = typeof icon === 'undefined' ? '<i class="eicon-library-upload" aria-hidden="true"></i>' : icon;
455 print( templateIcon );
456 #>
457 <span class="elementor-screen-only"><?php echo esc_html__( 'Save', 'elementor' ); ?></span>
458 </div>
459 <div class="elementor-template-library-blank-title">{{{ title }}}</div>
460 <div class="elementor-template-library-blank-message">{{{ description }}}</div>
461 <form id="elementor-template-library-save-template-form">
462 <input type="hidden" name="post_id" value="<?php echo esc_attr( get_the_ID() ); ?>">
463 <# if ( typeof canSaveToCloud === 'undefined' || ! canSaveToCloud ) { #>
464 <input id="elementor-template-library-save-template-name" name="title" placeholder="<?php echo esc_attr__( 'Enter Template Name', 'elementor' ); ?>" required>
465 <button id="elementor-template-library-save-template-submit" class="elementor-button e-primary">
466 <span class="elementor-state-icon">
467 <i class="eicon-loading eicon-animation-spin" aria-hidden="true"></i>
468 </span>
469 <?php echo esc_html__( 'Save', 'elementor' ); ?>
470 </button>
471 <# } else { #>
472 <div class="cloud-library-form-inputs">
473 <input id="elementor-template-library-save-template-name" name="title" placeholder="<?php echo esc_attr__( 'Give your template a name', 'elementor' ); ?>" required>
474 <div class="source-selections">
475 <div class="cloud-folder-selection-dropdown">
476 <div class="cloud-folder-selection-dropdown-list"></div>
477 </div>
478 <div class="source-selections-input cloud">
479 <input type="checkbox" id="cloud" name="cloud" value="cloud">
480 <label for="cloud"> <?php echo esc_html__( 'Cloud Templates', 'elementor' ); ?></label> <span class="divider">/</span> <div class="ellipsis-container"><i class="eicon-ellipsis-h"></i></div>
481 <span class="selected-folder">
482 <span class="selected-folder-text"></span>
483 <i class="eicon-editor-close" aria-hidden="true"></i>
484 </span>
485 <# if ( elementor.config.library_connect.is_connected ) { #>
486 <#
487 const goLink = elementor.templates.hasCloudLibraryQuota()
488 ? 'https://go.elementor.com/go-pro-cloud-templates-save-to-100-usage-badge'
489 : 'https://go.elementor.com/go-pro-cloud-templates-save-to-free-badge/';
490 #>
491 <span class="upgrade-badge">
492 <a href="{{{ goLink }}}" target="_blank">
493 <i class="eicon-upgrade-crown"></i><?php echo esc_html__( 'Upgrade', 'elementor' ); ?>
494 </a>
495 </span>
496 <i class="eicon-info upgrade-tooltip" aria-hidden="true"></i>
497 <# } else { #>
498 <span class="connect-badge">
499 <span class="connect-divider">|</span>
500 <a id="elementor-template-library-connect__badge" href="{{{ elementorAppConfig?.[ 'cloud-library' ]?.library_connect_url }}}">
501 <?php echo esc_html__( 'Connect', 'elementor' ); ?>
502 </a>
503 </span>
504 <# } #>
505 </div>
506 <div class="source-selections-input local">
507 <input type="checkbox" id="local" name="local" value="local">
508 <label for="local"> <?php echo esc_html__( 'Site Templates', 'elementor' ); ?></label><br>
509 </div>
510 <input type="hidden" name="parentId" id="parentId" />
511 </div>
512 <div class="quota-cta">
513 <p>
514 <?php echo esc_html__( 'You’ve saved 100% of the templates in your plan.', 'elementor' ); ?>
515 <br>
516 <?php printf(
517 /* translators: %s is the "Upgrade now" link */
518 esc_html__( 'To get more space %s', 'elementor' ),
519 '<a href="https://go.elementor.com/go-pro-cloud-templates-save-to-100-usage-notice">' . esc_html__( 'Upgrade now', 'elementor' ) . '</a>'
520 ); ?>
521 </p>
522 </div>
523 <button id="elementor-template-library-save-template-submit" class="elementor-button e-primary">
524 <span class="elementor-state-icon">
525 <i class="eicon-loading eicon-animation-spin" aria-hidden="true"></i>
526 </span>
527 {{{ saveBtnText }}}
528 </button>
529 </div>
530 <# } #>
531 </form>
532 <div class="elementor-template-library-blank-footer">
533 <?php echo esc_html__( 'Learn more about the', 'elementor' ); ?>
534 <a class="elementor-template-library-blank-footer-link" href="https://go.elementor.com/docs-library/" target="_blank"><?php echo esc_html__( 'Template Library', 'elementor' ); ?></a>
535 </div>
536 </script>
537
538 <script type="text/template" id="tmpl-elementor-template-library-import">
539 <form id="elementor-template-library-import-form">
540 <div class="elementor-template-library-blank-icon">
541 <i class="eicon-library-upload" aria-hidden="true"></i>
542 </div>
543 <div class="elementor-template-library-blank-title"><?php echo esc_html__( 'Import Template to Your Library', 'elementor' ); ?></div>
544 <div class="elementor-template-library-blank-message"><?php echo esc_html__( 'Drag & drop your .JSON or .zip template file', 'elementor' ); ?></div>
545 <div id="elementor-template-library-import-form-or"><?php echo esc_html__( 'or', 'elementor' ); ?></div>
546 <label for="elementor-template-library-import-form-input" id="elementor-template-library-import-form-label" class="elementor-button e-primary"><?php echo esc_html__( 'Select File', 'elementor' ); ?></label>
547 <input id="elementor-template-library-import-form-input" type="file" name="file" accept=".json,.zip" required/>
548 <div class="elementor-template-library-blank-footer">
549 <?php echo esc_html__( 'Learn more about the', 'elementor' ); ?>
550 <a class="elementor-template-library-blank-footer-link" href="https://go.elementor.com/docs-library/" target="_blank"><?php echo esc_html__( 'Template Library', 'elementor' ); ?></a>
551 </div>
552 </form>
553 </script>
554
555 <script type="text/template" id="tmpl-elementor-template-library-templates-empty">
556 <div class="elementor-template-library-blank-icon"></div>
557 <div class="elementor-template-library-blank-title"></div>
558 <div class="elementor-template-library-blank-message"></div>
559
560 <div class="elementor-template-library-cloud-empty__button"></div>
561
562 <div class="elementor-template-library-blank-footer">
563 <?php echo esc_html__( 'Learn more about the', 'elementor' ); ?>
564 <a class="elementor-template-library-blank-footer-link" href="https://go.elementor.com/docs-library/" target="_blank"><?php echo esc_html__( 'Template Library', 'elementor' ); ?></a>
565 </div>
566 </script>
567
568 <script type="text/template" id="tmpl-elementor-template-library-preview">
569 <iframe></iframe>
570 </script>
571
572 <script type="text/template" id="tmpl-elementor-template-library-connect">
573 <div id="elementor-template-library-connect-logo" class="e-logo-wrapper">
574 <i class="eicon-elementor" aria-hidden="true"></i>
575 </div>
576 <div class="elementor-template-library-blank-title">
577 {{{ title }}}
578 </div>
579 <div class="elementor-template-library-blank-message">
580 {{{ message }}}
581 </div>
582 <?php
583 $url = Plugin::$instance->common->get_component( 'connect' )->get_app( 'library' )->get_admin_url( 'authorize', [
584 'utm_source' => 'template-library',
585 'utm_medium' => 'wp-dash',
586 'utm_campaign' => 'library-connect',
587 'utm_content' => '%%template_type%%', // will be replaced in the frontend
588 ] );
589 ?>
590 <a id="elementor-template-library-connect__button" class="elementor-button e-primary" href="<?php echo esc_url( $url ); ?>">
591 {{{ button }}}
592 </a>
593 <?php
594 $base_images_url = $this->get_assets_base_url() . '/assets/images/library-connect/';
595
596 $images = [ 'left-1', 'left-2', 'right-1', 'right-2' ];
597
598 foreach ( $images as $image ) : ?>
599 <img id="elementor-template-library-connect__background-image-<?php Utils::print_unescaped_internal_string( $image ); ?>" class="elementor-template-library-connect__background-image" src="<?php Utils::print_unescaped_internal_string( $base_images_url . $image ); ?>.png" draggable="false" loading="lazy" />
600 <?php endforeach; ?>
601 </script>
602
603 <script type="text/template" id="tmpl-elementor-template-library-connect-states">
604 <#
605 const activeSource = elementor.templates.getFilter( 'source' );
606 #>
607 <div id="elementor-template-library-filter-toolbar-local" class="elementor-template-library-filter-toolbar" style="padding-block-end:80px;">
608 <div id="elementor-template-library-filter">
609 <div class="elementor-template-library-filter-select-source">
610 <div class="source-option<# if ( activeSource === 'local' ) { #> selected<# } #>" data-source="local">
611 <i class="eicon-header" aria-hidden="true"></i>
612 <?php echo esc_html__( 'Site templates', 'elementor' ); ?>
613 </div>
614 <div class="source-option<# if ( activeSource === 'cloud' ) { #> selected<# } #>" data-source="cloud">
615 <i class="eicon-library-cloud-empty" aria-hidden="true"></i>
616 <?php echo esc_html__( 'Cloud templates', 'elementor' ); ?>
617 <#
618 const tabIcon = elementor.templates.hasCloudLibraryQuota()
619 ? '<span class="new-badge"><?php echo esc_html__( 'New', 'elementor' ); ?></span>'
620 : '<span class="new-badge"><i class="eicon-upgrade-crown" style="margin-inline-end: 0;"></i> <?php echo esc_html__( 'Pro', 'elementor' ); ?></span>';
621
622 print( tabIcon );
623 #>
624 </div>
625 </div>
626 </div>
627 </div>
628 <div class="elementor-template-library-blank-icon"></div>
629 <div class="elementor-template-library-blank-title"></div>
630 <div class="elementor-template-library-blank-message"></div>
631
632 <div class="elementor-template-library-cloud-empty__button"></div>
633 </script>
634