Désactivation de l'import CSV et du panneau Configuration
This commit is contained in:
39
includes/trait-admin-page-config.php
Normal file
39
includes/trait-admin-page-config.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* Configuration panel — affiche les constantes API + bouton Test connexion.
|
||||
*
|
||||
* Désactivé via le feature flag Thalim_HAL_Admin_Page::CONFIG_PANEL_ENABLED.
|
||||
* Pour réactiver : basculer le flag à true dans class-admin-page.php.
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
trait Thalim_HAL_Config_Trait {
|
||||
|
||||
private function render_config() {
|
||||
?>
|
||||
<div class="card" style="max-width:800px;margin-bottom:20px">
|
||||
<h2>Configuration</h2>
|
||||
<table class="form-table">
|
||||
<tr><th>Structure ID</th><td><code><?php echo THALIM_HAL_STRUCT_ID; ?></code> (THALIM)</td></tr>
|
||||
<tr><th>Document Types</th><td><?php echo implode(', ', THALIM_HAL_DOC_TYPES); ?></td></tr>
|
||||
<tr><th>API Endpoint</th><td><code style="font-size:11px;word-break:break-all;"><?php echo esc_html($this->api->get_api_url(10)); ?></code></td></tr>
|
||||
</table>
|
||||
<form method="post" style="margin-top:15px">
|
||||
<?php wp_nonce_field('thalim_hal_action'); ?>
|
||||
<input type="hidden" name="thalim_hal_action" value="test_api">
|
||||
<button class="button button-primary">Test API Connection</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
private function handle_test_api() {
|
||||
$result = $this->api->test_connection();
|
||||
$this->message = is_wp_error($result)
|
||||
? ['error', 'API Error: ' . $result->get_error_message()]
|
||||
: ['success', "Connection OK! Found {$result['total']} publications."];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user