| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin Panel Interface |
| 4 |
* |
| 5 |
* @package Forge12\DoubleOptIn\Integration |
| 6 |
* @since 4.0.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace Forge12\DoubleOptIn\Integration; |
| 10 |
|
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit; |
| 13 |
} |
| 14 |
|
| 15 |
/** |
| 16 |
* Interface AdminPanelInterface |
| 17 |
* |
| 18 |
* Contract for integrations that provide an admin configuration panel. |
| 19 |
* This interface extends the basic FormIntegrationInterface with admin UI capabilities. |
| 20 |
*/ |
| 21 |
interface AdminPanelInterface { |
| 22 |
|
| 23 |
/** |
| 24 |
* Register admin hooks for the panel. |
| 25 |
* |
| 26 |
* Called during admin_init to set up editor panels, metaboxes, etc. |
| 27 |
* |
| 28 |
* @return void |
| 29 |
*/ |
| 30 |
public function registerAdminHooks(): void; |
| 31 |
|
| 32 |
/** |
| 33 |
* Enqueue admin scripts and styles. |
| 34 |
* |
| 35 |
* @param string $hook The current admin page hook. |
| 36 |
* |
| 37 |
* @return void |
| 38 |
*/ |
| 39 |
public function enqueueAdminAssets( string $hook ): void; |
| 40 |
|
| 41 |
/** |
| 42 |
* Render the admin panel. |
| 43 |
* |
| 44 |
* @param mixed $form The form object (type depends on form system). |
| 45 |
* @param array $metadata The current form settings. |
| 46 |
* |
| 47 |
* @return void |
| 48 |
*/ |
| 49 |
public function render( $form, array $metadata ): void; |
| 50 |
|
| 51 |
/** |
| 52 |
* Save the admin panel settings. |
| 53 |
* |
| 54 |
* @param int $formId The form ID. |
| 55 |
* @param array $data The submitted form data. |
| 56 |
* |
| 57 |
* @return bool True if save was successful. |
| 58 |
*/ |
| 59 |
public function save( int $formId, array $data ): bool; |
| 60 |
|
| 61 |
/** |
| 62 |
* Get the panel title for display in tabs/metaboxes. |
| 63 |
* |
| 64 |
* @return string The panel title. |
| 65 |
*/ |
| 66 |
public function getPanelTitle(): string; |
| 67 |
|
| 68 |
/** |
| 69 |
* Get available email templates. |
| 70 |
* |
| 71 |
* @return array<string, string> Template key => Template label. |
| 72 |
*/ |
| 73 |
public function getAvailableTemplates(): array; |
| 74 |
|
| 75 |
/** |
| 76 |
* Get available categories for the form. |
| 77 |
* |
| 78 |
* @return array<int, string> Category ID => Category name. |
| 79 |
*/ |
| 80 |
public function getAvailableCategories(): array; |
| 81 |
} |
| 82 |
|