PluginProbe
Elementor Website Builder – more than just a page builder / 3.34.0-beta1
Elementor Website Builder – more than just a page builder v3.34.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 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 All 457 releases
elementor / includes / editor-templates / templates.php

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

743 lines 39.0 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 <span class="source-option-badge site-badge variant-b-only" style="display: none;">
130 <i class="eicon-users" aria-hidden="true"></i>
131 <?php echo esc_html__( 'Anyone on this site', 'elementor' ); ?>
132 </span>
133 <span class="source-option-badge cloud-badge variant-b-only" style="display: none;">
134 <i class="eicon-lock" aria-hidden="true"></i>
135 <?php echo esc_html__( 'My Elementor account', 'elementor' ); ?>
136 </span>
137 <# } #>
138
139 <div class="elementor-template-library-filter-toolbar-side-actions">
140 <# if ( 'cloud' === activeSource ) { #>
141 <div id="elementor-template-library-add-new-folder" class="elementor-template-library-action-item">
142 <i class="eicon-folder-plus" aria-hidden="true"></i>
143 <span class="elementor-screen-only"><?php echo esc_html__( 'Create a New Folder', 'elementor' ); ?></span>
144 </div>
145 <span class="divider"></span>
146 <div id="elementor-template-library-view-grid" class="elementor-template-library-action-item">
147 <i class="eicon-library-grid" aria-hidden="true"></i>
148 <span class="elementor-screen-only"><?php echo esc_html__( 'Grid view', 'elementor' ); ?></span>
149 </div>
150 <div id="elementor-template-library-view-list" class="elementor-template-library-action-item">
151 <i class="eicon-library-list" aria-hidden="true"></i>
152 <span class="elementor-screen-only"><?php echo esc_html__( 'List view', 'elementor' ); ?></span>
153 </div>
154 <# } #>
155 <div id="elementor-template-library-filter-text-wrapper">
156 <label for="elementor-template-library-filter-text" class="elementor-screen-only"><?php echo esc_html__( 'Search Templates:', 'elementor' ); ?></label>
157 <input id="elementor-template-library-filter-text" placeholder="<?php echo esc_attr__( 'Search', 'elementor' ); ?>">
158 <i class="eicon-search"></i>
159 </div>
160 </div>
161 </div>
162 <# if ( 'local' === activeSource || 'cloud' === activeSource ) { #>
163 <div class="toolbar-container">
164 <div class="bulk-selection-action-bar">
165 <span class="clear-bulk-selections"><i class="eicon-editor-close"></i></span>
166 <span class="selected-count"></span>
167 <# if ( elementor.templates.hasCloudLibraryQuota() && ! elementor.templates.cloudLibraryIsDeactivated() ) { #>
168 <span class="bulk-copy"><i class="eicon-library-copy" aria-hidden="true" title="<?php esc_attr_e( 'Copy', 'elementor' ); ?>"></i></span>
169 <span class="bulk-move"><i class="eicon-library-move" aria-hidden="true" title="<?php esc_attr_e( 'Move', 'elementor' ); ?>"></i></span>
170 <# } #>
171 <span class="bulk-delete"><i class="eicon-library-delete" aria-hidden="true" title="<?php esc_attr_e( 'Delete', 'elementor' ); ?>"></i></span>
172 </div>
173 <div id="elementor-template-library-navigation-container"></div>
174
175 <# if ( 'cloud' === activeSource ) { #>
176 <div class="quota-progress-container">
177 <span class="quota-progress-info">
178 <?php echo esc_html__( 'Usage', 'elementor' ); ?>
179 </span>
180 <div class="progress-bar-container">
181 <div class="quota-progress-bar quota-progress-bar-normal">
182 <div class="quota-progress-bar-fill"></div>
183 </div>
184 <span class="quota-warning"></span>
185 </div>
186 <div class="quota-progress-bar-value"></div>
187 </div>
188 <# } #>
189 </div>
190 <div id="elementor-template-library-order-toolbar-local">
191 <div class="elementor-template-library-local-column-1">
192 <input type="checkbox" id="bulk-select-all">
193 <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">
194 <label for="elementor-template-library-order-local-title" class="elementor-template-library-order-label"><?php echo esc_html__( 'Name', 'elementor' ); ?></label>
195 </div>
196 <div class="elementor-template-library-local-column-2">
197 <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">
198 <label for="elementor-template-library-order-local-type" class="elementor-template-library-order-label"><?php echo esc_html__( 'Type', 'elementor' ); ?></label>
199 </div>
200 <div class="elementor-template-library-local-column-3">
201 <# if ( 'cloud' !== activeSource ) { #>
202 <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">
203 <# } #>
204 <label for="elementor-template-library-order-local-author" class="elementor-template-library-order-label"><?php echo esc_html__( 'Created By', 'elementor' ); ?></label>
205 </div>
206 <div class="elementor-template-library-local-column-4">
207 <input type="radio" id="elementor-template-library-order-local-date" class="elementor-template-library-order-input" name="elementor-template-library-order-local" value="date">
208 <label for="elementor-template-library-order-local-date" class="elementor-template-library-order-label"><?php echo esc_html__( 'Creation Date', 'elementor' ); ?></label>
209 </div>
210 <div class="elementor-template-library-local-column-5">
211 <div class="elementor-template-library-order-label"><?php echo esc_html__( 'Actions', 'elementor' ); ?></div>
212 </div>
213 </div>
214 <# } #>
215 <div id="elementor-template-library-templates-container"></div>
216 <# if ( isRemote ) { #>
217 <div id="elementor-template-library-footer-banner">
218 <img class="elementor-nerd-box-icon" src="<?php
219 Utils::print_unescaped_internal_string( ELEMENTOR_ASSETS_URL . 'images/information.svg' );
220 ?>" loading="lazy" alt="<?php echo esc_attr__( 'Elementor', 'elementor' ); ?>" />
221 <div class="elementor-excerpt"><?php echo esc_html__( 'Stay tuned! More awesome templates coming real soon.', 'elementor' ); ?></div>
222 </div>
223 <# } #>
224 <# if ( 'cloud' === activeSource ) { #>
225 <div id="elementor-template-library-load-more-anchor" class="elementor-visibility-hidden"><i class="eicon-loading eicon-animation-spin"></i></div>
226 <# } #>
227 </script>
228
229 <script type="text/template" id="tmpl-elementor-template-library-navigation-container">
230 <button class="elementor-template-library-navigation-back-button elementor-button e-button">
231 <i class="eicon-chevron-left"></i>
232 <?php echo esc_html__( 'Back', 'elementor' ); ?>
233 </button>
234 <span class="elementor-template-library-current-folder-title"></span>
235 </script>
236
237 <script type="text/template" id="tmpl-elementor-template-library-template-remote">
238 <div class="elementor-template-library-template-body">
239 <?php // 'lp' stands for Landing Pages Library type. ?>
240 <# if ( 'page' === type || 'lp' === type ) { #>
241 <div class="elementor-template-library-template-screenshot" style="background-image: url({{ thumbnail }});"></div>
242 <# } else { #>
243 <img src="{{ thumbnail }}" loading="lazy">
244 <# } #>
245 <div class="elementor-template-library-template-preview">
246 <i class="eicon-zoom-in-bold" aria-hidden="true"></i>
247 </div>
248 </div>
249 <div class="elementor-template-library-template-footer">
250 {{{ elementor.templates.layout.getTemplateActionButton( obj ) }}}
251 <div class="elementor-template-library-template-name">{{{ title }}} - {{{ type }}}</div>
252 <div class="elementor-template-library-favorite">
253 <input id="elementor-template-library-template-{{ template_id }}-favorite-input" class="elementor-template-library-template-favorite-input" type="checkbox"{{ favorite ? " checked" : "" }}>
254 <label for="elementor-template-library-template-{{ template_id }}-favorite-input" class="elementor-template-library-template-favorite-label">
255 <i class="eicon-heart-o" aria-hidden="true"></i>
256 <span class="elementor-screen-only"><?php echo esc_html__( 'Favorite', 'elementor' ); ?></span>
257 </label>
258 </div>
259 </div>
260 </script>
261
262 <script type="text/template" id="tmpl-elementor-template-library-template-local">
263 <#
264 const activeSource = elementor.templates.getFilter('source');
265 const view = elementor.templates.getFilter('view') ?? elementor.templates.getViewSelection() ?? 'list';
266
267 if ( ( 'cloud' === activeSource && view === 'list' ) || 'local' === activeSource ) {
268 #>
269 <div class="elementor-template-library-template-name elementor-template-library-local-column-1">
270 <input type="checkbox" class="bulk-selection-item-checkbox" data-template_id="{{ template_id }}" data-type="{{ type }}" data-status="{{ status }}">
271 <# if ( 'cloud' === activeSource ) {
272 const sourceIcon = typeof subType !== 'undefined' && 'FOLDER' === subType
273 ? '<i class="eicon-library-folder" aria-hidden="true"></i>'
274 : 'locked' === status
275 ? '<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>'
276 : '<i class="eicon-global-colors" aria-hidden="true"></i>';
277
278 print( sourceIcon );
279 } #>
280 <span>{{ title }}</span>
281 </div>
282 <div class="elementor-template-library-template-meta elementor-template-library-template-type elementor-template-library-local-column-2">{{{ elementor.translate( type ) }}}</div>
283 <div class="elementor-template-library-template-meta elementor-template-library-template-author elementor-template-library-local-column-3">{{{ author }}}</div>
284 <div class="elementor-template-library-template-meta elementor-template-library-template-date elementor-template-library-local-column-4">{{{ human_date }}}</div>
285 <div class="elementor-template-library-template-controls elementor-template-library-local-column-5">
286 <#
287 const previewClass = typeof subType !== 'undefined' && 'FOLDER' !== subType
288 ? 'elementor-hidden'
289 : '';
290 #>
291 <div class="elementor-template-library-template-preview elementor-button e-btn-txt {{{previewClass}}}">
292 <#
293 const actionText = typeof subType === 'undefined' || 'FOLDER' !== subType
294 ? '<?php echo esc_html__( 'Preview', 'elementor' ); ?>'
295 : '<?php echo esc_html__( 'Open', 'elementor' ); ?>';
296 #>
297 <i class="eicon-preview-medium" aria-hidden="true"></i>
298 <span class="elementor-template-library-template-control-title">{{{ actionText }}}</span>
299 </div>
300 <# if ( typeof subType === 'undefined' || 'FOLDER' !== subType ) { #>
301 <button class="elementor-template-library-template-action elementor-template-library-template-insert elementor-button e-primary e-btn-txt">
302 <i class="eicon-library-download" aria-hidden="true"></i>
303 <span class="elementor-button-title"><?php echo esc_html__( 'Insert', 'elementor' ); ?></span>
304 </button>
305 <# } #>
306 <div class="elementor-template-library-template-more-toggle">
307 <i class="eicon-ellipsis-h" aria-hidden="true"></i>
308 <span class="elementor-screen-only"><?php echo esc_html__( 'More actions', 'elementor' ); ?></span>
309 </div>
310 <div class="elementor-template-library-template-more">
311 <# if ( ( typeof subType === 'undefined' || 'FOLDER' !== subType ) && elementor.templates.hasCloudLibraryQuota() && ! elementor.templates.cloudLibraryIsDeactivated() ) { #>
312 <div class="elementor-template-library-template-move">
313 <i class="eicon-library-move" aria-hidden="true"></i>
314 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Move to', 'elementor' ); ?></span>
315 </div>
316 <div class="elementor-template-library-template-copy">
317 <i class="eicon-library-copy" aria-hidden="true"></i>
318 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Copy to', 'elementor' ); ?></span>
319 </div>
320 <# } #>
321 <div class="elementor-template-library-template-export">
322 <a href="{{ export_link }}">
323 <i class="eicon-library-download" aria-hidden="true"></i>
324 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Export', 'elementor' ); ?></span>
325 </a>
326 </div>
327 <div class="elementor-template-library-template-rename">
328 <i class="eicon-library-edit" aria-hidden="true"></i>
329 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Rename', 'elementor' ); ?></span>
330 </div>
331 <div class="elementor-template-library-template-delete">
332 <i class="eicon-library-delete" aria-hidden="true"></i>
333 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Delete', 'elementor' ); ?></span>
334 </div>
335 </div>
336 </div>
337 <# } else {
338 if ( typeof subType !== 'undefined' && 'FOLDER' === subType ) {
339 #>
340 <div class="elementor-template-library-template-type-icon">
341 <i class="eicon-library-folder-view" aria-hidden="true"></i>
342 <span class="elementor-screen-only"><?php echo esc_html__( 'Folder', 'elementor' ); ?></span>
343 </div>
344 <div class="elementor-template-library-template-name">
345 <span>{{ title }}</span>
346 </div>
347 <div class="elementor-template-library-template-more-toggle">
348 <i class="eicon-ellipsis-v" aria-hidden="true"></i>
349 <span class="elementor-screen-only"><?php echo esc_html__( 'More actions', 'elementor' ); ?></span>
350 </div>
351 <div class="elementor-template-library-template-more" style="display: none;">
352 <div class="elementor-template-library-template-export">
353 <a href="{{ export_link }}">
354 <i class="eicon-library-download" aria-hidden="true"></i>
355 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Export', 'elementor' ); ?></span>
356 </a>
357 </div>
358 <div class="elementor-template-library-template-rename">
359 <i class="eicon-library-edit" aria-hidden="true"></i>
360 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Rename', 'elementor' ); ?></span>
361 </div>
362 <div class="elementor-template-library-template-delete">
363 <i class="eicon-library-delete" aria-hidden="true"></i>
364 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Delete', 'elementor' ); ?></span>
365 </div>
366 </div>
367 <# } else { #>
368 <#
369 const imageSource = preview_url || '<?php echo esc_html( ELEMENTOR_ASSETS_URL . 'images/placeholder-cloud-grid.png' ); ?>';
370 #>
371 <div class="elementor-template-library-template-thumbnail">
372 <img src="{{{ imageSource }}}"/>
373 <div class="elementor-template-library-template-preview"></div>
374 </div>
375 <div class="elementor-template-library-card-footer">
376 <div class="elementor-template-library-template-name">
377 <# if ( 'locked' === status ) { #>
378 <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>
379 <# } #>
380 <span>{{ title }}</span>
381 </div>
382 <div class="elementor-template-library-template-card-footer-overlay">
383 <button class="elementor-template-library-template-action elementor-template-library-template-insert elementor-button e-primary">
384 <i class="eicon-library-download" aria-hidden="true"></i>
385 <span class="elementor-button-title"><?php echo esc_html__( 'Insert', 'elementor' ); ?></span>
386 </button>
387 <div class="elementor-template-library-template-card-footer-overlay-info">
388 <div class="elementor-template-library-template-meta">{{{ author }}}</div>
389 <div class="elementor-template-library-template-meta">{{{ human_date }}}</div>
390 </div>
391 </div>
392 <div class="elementor-template-library-template-more-toggle">
393 <i class="eicon-ellipsis-v" aria-hidden="true"></i>
394 <span class="elementor-screen-only"><?php echo esc_html__( 'More actions', 'elementor' ); ?></span>
395 </div>
396 <div class="elementor-template-library-template-more" style="display: none;">
397 <div class="elementor-template-library-template-move">
398 <i class="eicon-library-move" aria-hidden="true"></i>
399 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Move to', 'elementor' ); ?></span>
400 </div>
401 <div class="elementor-template-library-template-copy">
402 <i class="eicon-library-copy" aria-hidden="true"></i>
403 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Copy to', 'elementor' ); ?></span>
404 </div>
405 <div class="elementor-template-library-template-export">
406 <a href="{{ export_link }}">
407 <i class="eicon-library-download" aria-hidden="true"></i>
408 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Export', 'elementor' ); ?></span>
409 </a>
410 </div>
411 <div class="elementor-template-library-template-rename">
412 <i class="eicon-library-edit" aria-hidden="true"></i>
413 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Rename', 'elementor' ); ?></span>
414 </div>
415 <div class="elementor-template-library-template-delete">
416 <i class="eicon-library-delete" aria-hidden="true"></i>
417 <span class="elementor-template-library-template-control-title"><?php echo esc_html__( 'Delete', 'elementor' ); ?></span>
418 </div>
419 </div>
420 </div>
421 <# } } #>
422 </script>
423
424 <script type="text/template" id="tmpl-elementor-template-library-insert-button">
425 <a class="elementor-template-library-template-action elementor-template-library-template-insert elementor-button e-primary">
426 <i class="eicon-library-download" aria-hidden="true"></i>
427 <span class="elementor-button-title"><?php echo esc_html__( 'Insert', 'elementor' ); ?></span>
428 </a>
429 </script>
430
431 <script type="text/template" id="tmpl-elementor-template-library-apply-ai-button">
432 <a class="elementor-template-library-template-action elementor-template-library-template-apply-ai elementor-button e-primary">
433 <i class="eicon-file-download" aria-hidden="true"></i>
434 <span class="elementor-button-title"><?php echo esc_html__( 'Apply', 'elementor' ); ?></span>
435 </a>
436 </script>
437
438 <script type="text/template" id="tmpl-elementor-template-library-insert-and-ai-variations-buttons">
439 <a class="elementor-template-library-template-action elementor-template-library-template-insert elementor-button e-primary">
440 <i class="eicon-library-download" aria-hidden="true"></i>
441 <span class="elementor-button-title"><?php echo esc_html__( 'Insert', 'elementor' ); ?></span>
442 </a>
443 <a class="elementor-template-library-template-action elementor-template-library-template-generate-variation elementor-button e-btn-txt e-btn-txt-border">
444 <i class="eicon-ai" aria-hidden="true"></i>
445 <span class="elementor-button-title"><?php echo esc_html__( 'Generate Variations', 'elementor' ); ?></span>
446 </a>
447 </script>
448
449 <script type="text/template" id="tmpl-elementor-template-library-upgrade-plan-button">
450 <a
451 class="elementor-template-library-template-action elementor-button go-pro"
452 href="{{{ promotionLink }}}"
453 target="_blank"
454 >
455 <span class="elementor-button-title">{{{ promotionText }}}</span>
456 </a>
457 </script>
458
459 <script type="text/template" id="tmpl-elementor-template-library-save-template">
460 <div class="elementor-template-library-blank-icon">
461 <#
462 const templateIcon = typeof icon === 'undefined' ? '<i class="eicon-library-upload" aria-hidden="true"></i>' : icon;
463 print( templateIcon );
464 #>
465 <span class="elementor-screen-only"><?php echo esc_html__( 'Save', 'elementor' ); ?></span>
466 </div>
467 <div class="elementor-template-library-blank-title">{{{ title }}}</div>
468 <div class="elementor-template-library-blank-message">{{{ description }}}</div>
469 <form id="elementor-template-library-save-template-form">
470 <input type="hidden" name="post_id" value="<?php echo esc_attr( get_the_ID() ); ?>">
471 <# if ( typeof canSaveToCloud === 'undefined' || ! canSaveToCloud ) { #>
472 <input id="elementor-template-library-save-template-name" name="title" placeholder="<?php echo esc_attr__( 'Enter Template Name', 'elementor' ); ?>" required>
473 <button id="elementor-template-library-save-template-submit" class="elementor-button e-primary">
474 <span class="elementor-state-icon">
475 <i class="eicon-loading eicon-animation-spin" aria-hidden="true"></i>
476 </span>
477 <?php echo esc_html__( 'Save', 'elementor' ); ?>
478 </button>
479 <# } else { #>
480 <div class="cloud-library-form-inputs">
481 <input id="elementor-template-library-save-template-name" name="title" placeholder="<?php echo esc_attr__( 'Give your template a name', 'elementor' ); ?>" required>
482 <div class="source-selections">
483 <div class="cloud-folder-selection-dropdown">
484 <div class="cloud-folder-selection-dropdown-list"></div>
485 </div>
486 <div class="source-selections-input cloud">
487 <input type="checkbox" id="cloud" name="cloud" value="cloud">
488 <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>
489 <span class="selected-folder">
490 <span class="selected-folder-text"></span>
491 <i class="eicon-editor-close" aria-hidden="true"></i>
492 </span>
493 <# if ( elementor.config.library_connect.is_connected ) { #>
494 <#
495 const goLink = elementor.templates.hasCloudLibraryQuota()
496 ? 'https://go.elementor.com/go-pro-cloud-templates-save-to-100-usage-badge'
497 : 'https://go.elementor.com/go-pro-cloud-templates-save-to-free-badge/';
498 #>
499 <span class="upgrade-badge">
500 <a href="{{{ goLink }}}" target="_blank">
501 <i class="eicon-upgrade-crown"></i><?php echo esc_html__( 'Upgrade', 'elementor' ); ?>
502 </a>
503 </span>
504 <i class="eicon-info upgrade-tooltip" aria-hidden="true"></i>
505 <# } else { #>
506 <span class="connect-badge">
507 <span class="connect-divider">|</span>
508 <a id="elementor-template-library-connect__badge" href="{{{ elementorAppConfig?.[ 'cloud-library' ]?.library_connect_url }}}">
509 <?php echo esc_html__( 'Connect', 'elementor' ); ?>
510 </a>
511 </span>
512 <# } #>
513 </div>
514 <div class="source-selections-input local">
515 <input type="checkbox" id="local" name="local" value="local">
516 <label for="local"> <?php echo esc_html__( 'Site Templates', 'elementor' ); ?></label><br>
517 </div>
518 <input type="hidden" name="parentId" id="parentId" />
519 </div>
520 <div class="quota-cta">
521 <p>
522 <?php echo esc_html__( 'You’ve saved 100% of the templates in your plan.', 'elementor' ); ?>
523 <br>
524 <?php printf(
525 /* translators: %s is the "Upgrade now" link */
526 esc_html__( 'To get more space %s', 'elementor' ),
527 '<a href="https://go.elementor.com/go-pro-cloud-templates-save-to-100-usage-notice">' . esc_html__( 'Upgrade now', 'elementor' ) . '</a>'
528 ); ?>
529 </p>
530 </div>
531 <button id="elementor-template-library-save-template-submit" class="elementor-button e-primary">
532 <span class="elementor-state-icon">
533 <i class="eicon-loading eicon-animation-spin" aria-hidden="true"></i>
534 </span>
535 {{{ saveBtnText }}}
536 </button>
537 </div>
538 <# } #>
539 </form>
540 <div class="elementor-template-library-blank-footer">
541 <?php echo esc_html__( 'Learn more about the', 'elementor' ); ?>
542 <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>
543 </div>
544 </script>
545
546 <script type="text/template" id="tmpl-elementor-template-library-save-template-variant-b">
547 <div class="elementor-template-library-blank-icon">
548 <#
549 const templateIcon = typeof icon === 'undefined' ? '<i class="eicon-library-upload" aria-hidden="true"></i>' : icon;
550 print( templateIcon );
551 #>
552 <span class="elementor-screen-only"><?php echo esc_html__( 'Save', 'elementor' ); ?></span>
553 </div>
554 <div class="elementor-template-library-blank-title">{{{ title }}}</div>
555 <div class="elementor-template-library-blank-message">{{{ description }}}</div>
556 <form id="elementor-template-library-save-template-form">
557 <input type="hidden" name="post_id" value="<?php echo esc_attr( get_the_ID() ); ?>">
558 <# if ( typeof canSaveToCloud === 'undefined' || ! canSaveToCloud ) { #>
559 <input id="elementor-template-library-save-template-name" name="title" placeholder="<?php echo esc_attr__( 'Enter Template Name', 'elementor' ); ?>" required>
560 <button id="elementor-template-library-save-template-submit" class="elementor-button e-primary">
561 <span class="elementor-state-icon">
562 <i class="eicon-loading eicon-animation-spin" aria-hidden="true"></i>
563 </span>
564 <?php echo esc_html__( 'Save', 'elementor' ); ?>
565 </button>
566 <# } else { #>
567 <div class="cloud-library-form-inputs variant-b">
568 <label class="template-name-label"><?php echo esc_html__( 'Page Name', 'elementor' ); ?></label>
569 <input id="elementor-template-library-save-template-name" name="title" placeholder="<?php echo esc_attr__( 'Type the page here', 'elementor' ); ?>" required>
570 <div class="source-selections variant-b">
571 <label class="save-location-label"><?php echo esc_html__( 'Where would you like to save this page?', 'elementor' ); ?></label>
572 <div class="cloud-folder-selection-dropdown">
573 <div class="cloud-folder-selection-dropdown-list"></div>
574 </div>
575 <div class="source-selections-input cloud variant-b">
576 <input type="checkbox" id="cloud-variant-b" name="cloud" value="cloud">
577 <i class="eicon-library-cloud-empty" aria-hidden="true"></i>
578 <label for="cloud-variant-b"><?php echo esc_html__( 'Cloud Templates', 'elementor' ); ?></label>
579 <span class="divider">/</span>
580 <div class="ellipsis-container">
581 <?php echo esc_html__( 'Select folder', 'elementor' ); ?>
582 </div>
583 <span class="selected-folder">
584 <span class="selected-folder-text"></span>
585 <i class="eicon-editor-close" aria-hidden="true"></i>
586 </span>
587 <# if ( elementor.config.library_connect.is_connected ) { #>
588 <#
589 const goLink = elementor.templates.hasCloudLibraryQuota()
590 ? 'https://go.elementor.com/go-pro-cloud-templates-save-to-100-usage-badge'
591 : 'https://go.elementor.com/go-pro-cloud-templates-save-to-free-badge/';
592 #>
593 <span class="upgrade-badge">
594 <a href="{{{ goLink }}}" target="_blank">
595 <i class="eicon-upgrade-crown"></i><?php echo esc_html__( 'Upgrade', 'elementor' ); ?>
596 </a>
597 </span>
598 <# } else { #>
599 <span class="connect-badge">
600 <a id="elementor-template-library-connect__badge-variant-b" href="{{{ elementorAppConfig?.[ 'cloud-library' ]?.library_connect_url }}}">
601 <?php echo esc_html__( 'Connect', 'elementor' ); ?>
602 </a>
603 </span>
604 <# } #>
605 <span class="account-badge cloud-account-badge" type="button" id="elementor-template-library-connect__badge-variant-b-button" aria-hidden="true">
606 <i class="eicon-lock" aria-hidden="true"></i>
607 <?php echo esc_html__( 'My Elementor account', 'elementor' ); ?>
608 </span>
609 </div>
610 <div class="source-selections-input local variant-b">
611 <input type="checkbox" id="local-variant-b" name="local" value="local">
612 <i class="eicon-header" aria-hidden="true"></i>
613 <label for="local-variant-b"><?php echo esc_html__( 'Site Templates', 'elementor' ); ?></label>
614 <span class="account-badge site-account-badge" type="button" aria-hidden="true">
615 <i class="eicon-users" aria-hidden="true"></i>
616 <?php echo esc_html__( 'Anyone on this site', 'elementor' ); ?>
617 </span>
618 </div>
619 <input type="hidden" name="parentId" id="parentId" />
620 </div>
621 <div class="quota-cta">
622 <p>
623 <?php echo esc_html__( 'You’ve saved 100% of the templates in your plan.', 'elementor' ); ?>
624 <br>
625 <?php printf(
626 /* translators: %s is the "Upgrade now" link */
627 esc_html__( 'To get more space %s', 'elementor' ),
628 '<a href="https://go.elementor.com/go-pro-cloud-templates-save-to-100-usage-notice">' . esc_html__( 'Upgrade now', 'elementor' ) . '</a>'
629 ); ?>
630 </p>
631 </div>
632 <button id="elementor-template-library-save-template-submit" class="elementor-button e-primary" disabled>
633 <span class="elementor-state-icon">
634 <i class="eicon-loading eicon-animation-spin" aria-hidden="true"></i>
635 </span>
636 {{{ saveBtnText }}}
637 </button>
638 </div>
639 <# } #>
640 </form>
641 <div class="elementor-template-library-blank-footer">
642 <?php echo esc_html__( 'Learn more about the', 'elementor' ); ?>
643 <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>
644 </div>
645 </script>
646
647 <script type="text/template" id="tmpl-elementor-template-library-import">
648 <form id="elementor-template-library-import-form">
649 <div class="elementor-template-library-blank-icon">
650 <i class="eicon-library-upload" aria-hidden="true"></i>
651 </div>
652 <div class="elementor-template-library-blank-title"><?php echo esc_html__( 'Import Template to Your Library', 'elementor' ); ?></div>
653 <div class="elementor-template-library-blank-message"><?php echo esc_html__( 'Drag & drop your .JSON or .zip template file', 'elementor' ); ?></div>
654 <div id="elementor-template-library-import-form-or"><?php echo esc_html__( 'or', 'elementor' ); ?></div>
655 <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>
656 <input id="elementor-template-library-import-form-input" type="file" name="file" accept=".json,.zip" required/>
657 <div class="elementor-template-library-blank-footer">
658 <?php echo esc_html__( 'Learn more about the', 'elementor' ); ?>
659 <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>
660 </div>
661 </form>
662 </script>
663
664 <script type="text/template" id="tmpl-elementor-template-library-templates-empty">
665 <div class="elementor-template-library-blank-icon"></div>
666 <div class="elementor-template-library-blank-title"></div>
667 <div class="elementor-template-library-blank-message"></div>
668
669 <div class="elementor-template-library-cloud-empty__button"></div>
670
671 <div class="elementor-template-library-blank-footer">
672 <?php echo esc_html__( 'Learn more about the', 'elementor' ); ?>
673 <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>
674 </div>
675 </script>
676
677 <script type="text/template" id="tmpl-elementor-template-library-preview">
678 <iframe></iframe>
679 </script>
680
681 <script type="text/template" id="tmpl-elementor-template-library-connect">
682 <div id="elementor-template-library-connect-logo" class="e-logo-wrapper">
683 <i class="eicon-elementor" aria-hidden="true"></i>
684 </div>
685 <div class="elementor-template-library-blank-title">
686 {{{ title }}}
687 </div>
688 <div class="elementor-template-library-blank-message">
689 {{{ message }}}
690 </div>
691 <?php
692 $url = Plugin::$instance->common->get_component( 'connect' )->get_app( 'library' )->get_admin_url( 'authorize', [
693 'utm_source' => 'template-library',
694 'utm_medium' => 'wp-dash',
695 'utm_campaign' => 'library-connect',
696 'utm_content' => '%%template_type%%', // will be replaced in the frontend
697 ] );
698 ?>
699 <a id="elementor-template-library-connect__button" class="elementor-button e-primary" href="<?php echo esc_url( $url ); ?>">
700 {{{ button }}}
701 </a>
702 <?php
703 $base_images_url = $this->get_assets_base_url() . '/assets/images/library-connect/';
704
705 $images = [ 'left-1', 'left-2', 'right-1', 'right-2' ];
706
707 foreach ( $images as $image ) : ?>
708 <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" />
709 <?php endforeach; ?>
710 </script>
711
712 <script type="text/template" id="tmpl-elementor-template-library-connect-states">
713 <#
714 const activeSource = elementor.templates.getFilter( 'source' );
715 #>
716 <div id="elementor-template-library-filter-toolbar-local" class="elementor-template-library-filter-toolbar" style="padding-block-end:80px;">
717 <div id="elementor-template-library-filter">
718 <div class="elementor-template-library-filter-select-source">
719 <div class="source-option<# if ( activeSource === 'local' ) { #> selected<# } #>" data-source="local">
720 <i class="eicon-header" aria-hidden="true"></i>
721 <?php echo esc_html__( 'Site templates', 'elementor' ); ?>
722 </div>
723 <div class="source-option<# if ( activeSource === 'cloud' ) { #> selected<# } #>" data-source="cloud">
724 <i class="eicon-library-cloud-empty" aria-hidden="true"></i>
725 <?php echo esc_html__( 'Cloud templates', 'elementor' ); ?>
726 <#
727 const tabIcon = elementor.templates.hasCloudLibraryQuota()
728 ? '<span class="new-badge"><?php echo esc_html__( 'New', 'elementor' ); ?></span>'
729 : '<span class="new-badge"><i class="eicon-upgrade-crown" style="margin-inline-end: 0;"></i> <?php echo esc_html__( 'Pro', 'elementor' ); ?></span>';
730
731 print( tabIcon );
732 #>
733 </div>
734 </div>
735 </div>
736 </div>
737 <div class="elementor-template-library-blank-icon"></div>
738 <div class="elementor-template-library-blank-title"></div>
739 <div class="elementor-template-library-blank-message"></div>
740
741 <div class="elementor-template-library-cloud-empty__button"></div>
742 </script>
743