PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.18.0
GiveWP – Donation Plugin and Fundraising Platform v4.18.0
4.18.0 4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 All 257 releases
give / src / DonationForms / resources / views / form-skeleton.php

form-skeleton.php in GiveWP – Donation Plugin and Fundraising Platform 4.18.0, at src/DonationForms/resources/views/form-skeleton.php

47 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The form skeleton: a grey sketch of the form that holds its space while it loads. Rendered by
4 * Give\DonationForms\Actions\RenderFormSkeleton, which validates the design id; the parts live in
5 * the form-skeleton directory. The bars are decorative, so the whole sketch is hidden from
6 * assistive tech and the element that embeds it carries the loading announcement.
7 *
8 * @since 4.17.0
9 *
10 * @var string $design One of classic, multi-step, two-panel-steps.
11 * @var bool $header Whether the form shows a header.
12 * @var bool $goal Whether the header has a goal bar.
13 * @var bool $image Whether the header has an image that takes space.
14 * @var string[][] $sections Block names per section, in form order.
15 * @var int $gateways Enabled gateways, one row each.
16 * @var string[] $variants Block name to field variant, for the section part.
17 */
18
19 use Give\Framework\Views\View;
20
21 $modifier = $design === 'two-panel-steps' ? 'two-panel' : $design;
22 $headerHtml = $header ? View::load('DonationForms.form-skeleton/header', compact('goal', 'image')) : '';
23 $firstSectionHtml = View::load('DonationForms.form-skeleton/section', [
24 'blocks' => $sections[0] ?? [],
25 'gateways' => $gateways,
26 'variants' => $variants,
27 ]);
28 ?>
29 <div class="givewp-embed-skeleton givewp-embed-skeleton--<?= esc_attr($modifier) ?>" aria-hidden="true">
30 <?php if ($design === 'classic') : ?>
31 <?= $headerHtml ?>
32 <div class="givewp-embed-skeleton__form">
33 <?php foreach ($sections as $blocks) : ?>
34 <?= View::load('DonationForms.form-skeleton/section', compact('blocks', 'gateways', 'variants')) ?>
35 <?php endforeach; ?>
36 <div class="givewp-embed-skeleton__section">
37 <span class="givewp-embed-skeleton__bar givewp-embed-skeleton__button"></span>
38 </div>
39 </div>
40 <?php elseif ($design === 'two-panel-steps') : ?>
41 <?= $headerHtml ?>
42 <?= View::load('DonationForms.form-skeleton/step', ['content' => $firstSectionHtml]) ?>
43 <?php else : ?>
44 <?= View::load('DonationForms.form-skeleton/step', ['content' => $header ? $headerHtml : $firstSectionHtml]) ?>
45 <?php endif; ?>
46 </div>
47