appa dn plugin udpates for integrationa dn final touches

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-13 09:23:54 +00:00
parent e053655962
commit d2b733640c
13 changed files with 236 additions and 337 deletions

View File

@@ -1,7 +1,7 @@
<?php
/**
* Settings Page (Renamed from Controls)
* Simplified post type and taxonomy management
* Settings Page
* Configure post types, taxonomies, and sync settings
*
* @package Igny8Bridge
*/
@@ -34,7 +34,7 @@ foreach ($all_post_types as $pt) {
?>
<div class="igny8-page-header">
<div style="display: flex; justify-content: space-between; align-items: flex-start;">
<div style="display: flex; justify-content: space-between; align-items: flex-start; width: 100%;">
<div>
<h1><?php _e('Settings', 'igny8-bridge'); ?></h1>
<p><?php _e('Configure post types, taxonomies, and sync settings', 'igny8-bridge'); ?></p>
@@ -49,50 +49,130 @@ foreach ($all_post_types as $pt) {
<form method="post" action="options.php" id="igny8-settings-form">
<?php settings_fields('igny8_bridge_controls'); ?>
<!-- Post Types Section -->
<div class="igny8-card" style="margin-bottom: 24px;">
<div class="igny8-card-header">
<h2>
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 20px; height: 20px;">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
<?php _e('Post Types', 'igny8-bridge'); ?>
</h2>
</div>
<p style="margin-bottom: 16px; color: var(--igny8-text-dim);">
<?php _e('Enable post types to sync with IGNY8. Only enabled post types will show their taxonomy configuration below.', 'igny8-bridge'); ?>
</p>
<!-- Top Row: Post Types (1/3) + Default Settings (1/3) + IGNY8 Sync (1/3) -->
<div class="igny8-grid igny8-grid-3" style="margin-bottom: 24px;">
<div style="display: grid; gap: 12px;">
<?php foreach ($public_post_types as $slug => $pt) :
$is_posts = ($slug === 'post');
$is_enabled = in_array($slug, $enabled_post_types, true);
?>
<label class="igny8-post-type-toggle" style="display: flex; align-items: center; cursor: pointer; padding: 12px 16px; border: 1px solid var(--igny8-stroke); border-radius: var(--igny8-radius-base); background: var(--igny8-surface);">
<input
type="checkbox"
name="igny8_enabled_post_types[]"
value="<?php echo esc_attr($slug); ?>"
class="igny8-post-type-checkbox"
data-post-type="<?php echo esc_attr($slug); ?>"
<?php checked($is_enabled); ?>
style="margin-right: 12px;"
/>
<div style="flex: 1;">
<span style="font-weight: 600;">
<!-- Post Types Card (1/3) -->
<div class="igny8-card">
<div class="igny8-card-header">
<h2>
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 20px; height: 20px;">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
<?php _e('Post Types', 'igny8-bridge'); ?>
</h2>
</div>
<p style="margin-bottom: 16px; color: var(--igny8-text-dim); font-size: 13px;">
<?php _e('Enable post types to sync with IGNY8.', 'igny8-bridge'); ?>
</p>
<div style="display: grid; gap: 8px;">
<?php foreach ($public_post_types as $slug => $pt) :
$is_posts = ($slug === 'post');
$is_enabled = in_array($slug, $enabled_post_types, true);
?>
<label class="igny8-post-type-toggle" style="display: flex; align-items: center; cursor: pointer; padding: 10px 12px; border: 1px solid var(--igny8-stroke); border-radius: var(--igny8-radius-sm); background: var(--igny8-surface);">
<input
type="checkbox"
name="igny8_enabled_post_types[]"
value="<?php echo esc_attr($slug); ?>"
class="igny8-post-type-checkbox"
data-post-type="<?php echo esc_attr($slug); ?>"
<?php checked($is_enabled); ?>
style="margin-right: 10px;"
/>
<span style="flex: 1; font-weight: 500; font-size: 14px;">
<?php echo esc_html($pt->label); ?>
</span>
<?php if (!$is_posts) : ?>
<span class="igny8-badge igny8-badge-warning" style="margin-left: 8px;">
<span class="igny8-badge igny8-badge-warning">
<?php _e('Coming Soon', 'igny8-bridge'); ?>
</span>
<?php else: ?>
<span style="color: var(--igny8-text-dim); font-size: 12px;"><?php echo esc_html($slug); ?></span>
<?php endif; ?>
</label>
<?php endforeach; ?>
</div>
</div>
<!-- Default Post Status Card (1/3) -->
<div class="igny8-card">
<div class="igny8-card-header">
<h2>
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 20px; height: 20px;">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/>
</svg>
<?php _e('Default Post Status', 'igny8-bridge'); ?>
</h2>
</div>
<p style="margin-bottom: 16px; color: var(--igny8-text-dim); font-size: 13px;">
<?php _e('Set default status for published content.', 'igny8-bridge'); ?>
</p>
<div style="display: grid; gap: 8px;">
<label style="display: flex; align-items: center; cursor: pointer; padding: 12px; border: 1px solid var(--igny8-stroke); border-radius: var(--igny8-radius-sm); <?php echo $default_post_status === 'draft' ? 'background: var(--igny8-primary-subtle); border-color: var(--igny8-primary);' : ''; ?>">
<input
type="radio"
name="igny8_default_post_status"
value="draft"
<?php checked($default_post_status, 'draft'); ?>
style="margin-right: 10px;"
/>
<div>
<strong style="font-size: 14px;"><?php _e('Draft', 'igny8-bridge'); ?></strong>
<span style="display: block; font-size: 12px; color: var(--igny8-text-dim);">
<?php _e('Review before publishing', 'igny8-bridge'); ?>
</span>
</div>
<span style="color: var(--igny8-text-dim); font-size: 13px;">
<?php echo esc_html($slug); ?>
</span>
</label>
<?php endforeach; ?>
<label style="display: flex; align-items: center; cursor: pointer; padding: 12px; border: 1px solid var(--igny8-stroke); border-radius: var(--igny8-radius-sm); <?php echo $default_post_status === 'publish' ? 'background: var(--igny8-primary-subtle); border-color: var(--igny8-primary);' : ''; ?>">
<input
type="radio"
name="igny8_default_post_status"
value="publish"
<?php checked($default_post_status, 'publish'); ?>
style="margin-right: 10px;"
/>
<div>
<strong style="font-size: 14px;"><?php _e('Publish', 'igny8-bridge'); ?></strong>
<span style="display: block; font-size: 12px; color: var(--igny8-text-dim);">
<?php _e('Publish immediately', 'igny8-bridge'); ?>
</span>
</div>
</label>
</div>
</div>
<!-- IGNY8 Sync Card (1/3) -->
<div class="igny8-card">
<div class="igny8-card-header">
<h2>
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 20px; height: 20px;">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/>
</svg>
<?php _e('IGNY8 Sync', 'igny8-bridge'); ?>
</h2>
</div>
<p style="margin-bottom: 16px; color: var(--igny8-text-dim); font-size: 13px;">
<?php _e('Control content publishing from IGNY8.', 'igny8-bridge'); ?>
</p>
<label style="display: flex; align-items: flex-start; cursor: pointer; padding: 14px; border: 1px solid var(--igny8-stroke); border-radius: var(--igny8-radius-sm); background: var(--igny8-surface);">
<input
type="checkbox"
name="igny8_sync_enabled"
value="1"
<?php checked($sync_enabled, 1); ?>
style="margin-right: 12px; margin-top: 2px; width: 18px; height: 18px;"
/>
<div>
<strong style="font-size: 14px; display: block;"><?php _e('Enable IGNY8 Sync', 'igny8-bridge'); ?></strong>
<span style="display: block; font-size: 12px; color: var(--igny8-text-dim); margin-top: 4px;">
<?php _e('Allow IGNY8 to publish content to this site', 'igny8-bridge'); ?>
</span>
</div>
</label>
</div>
</div>
@@ -133,7 +213,7 @@ foreach ($all_post_types as $pt) {
<?php else : ?>
<span style="font-size: 20px;">📁</span>
<?php endif; ?>
<?php echo esc_html(strtoupper($pt->label)); ?>
<?php echo esc_html(strtoupper($pt->label)); ?> <?php _e('Taxonomies', 'igny8-bridge'); ?>
</h2>
<?php if (!$is_posts) : ?>
<span class="igny8-badge igny8-badge-warning">
@@ -142,14 +222,8 @@ foreach ($all_post_types as $pt) {
<?php endif; ?>
</div>
<p style="margin-bottom: 16px; color: var(--igny8-text-dim); font-size: 14px;">
<?php printf(__('Taxonomies for %s:', 'igny8-bridge'), esc_html($pt->label)); ?>
</p>
<div style="display: grid; gap: 8px;">
<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px;">
<?php foreach ($public_taxonomies as $tax_slug => $tax) :
// Default enabled: category, post_tag, product_cat, product_tag, igny8_sectors, igny8_clusters
$default_enabled = in_array($tax_slug, array('category', 'post_tag', 'product_cat', 'product_tag', 'igny8_sectors', 'igny8_clusters'), true);
$is_tax_enabled = in_array($tax_slug, $enabled_taxonomies, true);
?>
<label style="display: flex; align-items: center; cursor: pointer; padding: 10px 14px; border: 1px solid var(--igny8-stroke); border-radius: var(--igny8-radius-sm); background: var(--igny8-bg);">
@@ -160,90 +234,13 @@ foreach ($all_post_types as $pt) {
<?php checked($is_tax_enabled); ?>
style="margin-right: 10px;"
/>
<span style="flex: 1;"><?php echo esc_html($tax->label); ?></span>
<span style="color: var(--igny8-text-dim); font-size: 12px;"><?php echo esc_html($tax_slug); ?></span>
<span style="flex: 1; font-size: 14px;"><?php echo esc_html($tax->label); ?></span>
</label>
<?php endforeach; ?>
</div>
</div>
<?php endforeach; ?>
<!-- Default Settings -->
<div class="igny8-card" style="margin-bottom: 24px;">
<div class="igny8-card-header">
<h2>
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 20px; height: 20px;">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
</svg>
<?php _e('Default Settings', 'igny8-bridge'); ?>
</h2>
</div>
<div class="igny8-grid igny8-grid-2" style="gap: 24px;">
<!-- Default Post Status -->
<div>
<label style="display: block; font-weight: 600; margin-bottom: 12px;">
<?php _e('Default Post Status', 'igny8-bridge'); ?>
</label>
<div style="display: grid; gap: 8px;">
<label style="display: flex; align-items: center; cursor: pointer; padding: 12px; border: 1px solid var(--igny8-stroke); border-radius: var(--igny8-radius-sm); <?php echo $default_post_status === 'draft' ? 'background: var(--igny8-primary-subtle); border-color: var(--igny8-primary);' : ''; ?>">
<input
type="radio"
name="igny8_default_post_status"
value="draft"
<?php checked($default_post_status, 'draft'); ?>
style="margin-right: 10px;"
/>
<div>
<strong><?php _e('Draft', 'igny8-bridge'); ?></strong>
<span style="display: block; font-size: 12px; color: var(--igny8-text-dim);">
<?php _e('Review before publishing', 'igny8-bridge'); ?>
</span>
</div>
</label>
<label style="display: flex; align-items: center; cursor: pointer; padding: 12px; border: 1px solid var(--igny8-stroke); border-radius: var(--igny8-radius-sm); <?php echo $default_post_status === 'publish' ? 'background: var(--igny8-primary-subtle); border-color: var(--igny8-primary);' : ''; ?>">
<input
type="radio"
name="igny8_default_post_status"
value="publish"
<?php checked($default_post_status, 'publish'); ?>
style="margin-right: 10px;"
/>
<div>
<strong><?php _e('Publish', 'igny8-bridge'); ?></strong>
<span style="display: block; font-size: 12px; color: var(--igny8-text-dim);">
<?php _e('Publish immediately', 'igny8-bridge'); ?>
</span>
</div>
</label>
</div>
</div>
<!-- Enable Sync -->
<div>
<label style="display: block; font-weight: 600; margin-bottom: 12px;">
<?php _e('IGNY8 Sync', 'igny8-bridge'); ?>
</label>
<label style="display: flex; align-items: center; cursor: pointer; padding: 16px; border: 1px solid var(--igny8-stroke); border-radius: var(--igny8-radius-sm); background: var(--igny8-surface);">
<input
type="checkbox"
name="igny8_sync_enabled"
value="1"
<?php checked($sync_enabled, 1); ?>
style="margin-right: 12px; width: 20px; height: 20px;"
/>
<div>
<strong><?php _e('Enable IGNY8 Sync', 'igny8-bridge'); ?></strong>
<span style="display: block; font-size: 12px; color: var(--igny8-text-dim);">
<?php _e('Allow IGNY8 to publish content to this site', 'igny8-bridge'); ?>
</span>
</div>
</label>
</div>
</div>
</div>
<button type="submit" class="igny8-btn igny8-btn-primary">
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 16px; height: 16px;">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
@@ -266,10 +263,6 @@ foreach ($all_post_types as $pt) {
background: #fef3c7;
color: #92400e;
}
.igny8-badge-success {
background: #d1fae5;
color: #065f46;
}
.igny8-post-type-toggle:hover {
border-color: var(--igny8-primary);
}