| 1 |
<?php |
| 2 |
/** |
| 3 |
* Form panel (Lite upgrade-prompt stub). |
| 4 |
* |
| 5 |
* Lite does not ship the visual form builder. This panel renders only the |
| 6 |
* navigation button; clicking it opens an upgrade modal instead of switching |
| 7 |
* views. The full panel is provided by Charitable Pro. |
| 8 |
* |
| 9 |
* @package Charitable |
| 10 |
* @author David Bisset |
| 11 |
* @copyright Copyright (c) 2026, WP Charitable LLC |
| 12 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 13 |
* @since 1.8.10.5 |
| 14 |
* @version 1.8.10.5 |
| 15 |
*/ |
| 16 |
|
| 17 |
if ( ! defined( 'ABSPATH' ) ) { |
| 18 |
exit; |
| 19 |
} |
| 20 |
|
| 21 |
if ( ! class_exists( 'Charitable_Builder_Panel_Form' ) ) : |
| 22 |
|
| 23 |
/** |
| 24 |
* Form panel (Lite upgrade stub). |
| 25 |
* |
| 26 |
* @since 1.8.10.5 |
| 27 |
*/ |
| 28 |
class Charitable_Builder_Panel_Form extends Charitable_Builder_Panel { |
| 29 |
|
| 30 |
/** |
| 31 |
* All systems go. |
| 32 |
* |
| 33 |
* @since 1.8.10.5 |
| 34 |
*/ |
| 35 |
public function init() { |
| 36 |
|
| 37 |
$this->name = esc_html__( 'Form', 'charitable' ); |
| 38 |
$this->slug = 'form'; |
| 39 |
$this->icon = 'panel_form.svg'; |
| 40 |
$this->order = 25; |
| 41 |
$this->sidebar = false; |
| 42 |
} |
| 43 |
|
| 44 |
/** |
| 45 |
* Render the navigation button. |
| 46 |
* |
| 47 |
* Overrides the base implementation so the button does not carry a |
| 48 |
* `data-panel` attribute — we intercept the click in JS and open an |
| 49 |
* upgrade modal rather than switching panels. |
| 50 |
* |
| 51 |
* @since 1.8.10.5 |
| 52 |
* |
| 53 |
* @param mixed $campaign Current campaign object. |
| 54 |
* @param string $view The current view. |
| 55 |
*/ |
| 56 |
public function button( $campaign, $view ) { |
| 57 |
?> |
| 58 |
<button type="button" class="charitable-panel-<?php echo esc_attr( $this->slug ); ?>-button charitable-panel-form-upgrade"> |
| 59 |
<img class="topbar_icon" src="<?php echo esc_url( charitable()->get_path( 'assets', false ) . 'images/icons/' . $this->icon ); ?>" /> |
| 60 |
<span><?php echo esc_html( $this->name ); ?></span> |
| 61 |
</button> |
| 62 |
<?php |
| 63 |
} |
| 64 |
|
| 65 |
/** |
| 66 |
* Suppress panel output — Lite has no Form panel content. |
| 67 |
* |
| 68 |
* @since 1.8.10.5 |
| 69 |
* |
| 70 |
* @param object $campaign Current campaign object. |
| 71 |
* @param string $view Active Campaign Builder view (panel). |
| 72 |
*/ |
| 73 |
public function panel_output( $campaign, $view = 'design' ) { |
| 74 |
} |
| 75 |
} |
| 76 |
|
| 77 |
endif; |
| 78 |
|
| 79 |
new Charitable_Builder_Panel_Form(); |
| 80 |
|