Files
backPRO/templates/sites/create.php
Jacek Pyziak b653cea252 Add installer functionality for WordPress with FTP and database configuration
- Create SQL migration for prompt templates used in article and image generation.
- Add migration to change publish interval from days to hours in the sites table.
- Implement InstallerController to handle installation requests and validation.
- Develop FtpService for FTP connections and file uploads.
- Create InstallerService to manage the WordPress installation process, including downloading, extracting, and configuring WordPress.
- Add index view for the installer with form inputs for FTP, database, and WordPress admin settings.
- Implement progress tracking for the installation process with AJAX polling.
2026-02-16 21:55:24 +01:00

87 lines
4.7 KiB
PHP

<h2 class="mb-4">Dodaj stronę WordPress</h2>
<div class="row g-4">
<div class="col-lg-7">
<div class="card">
<div class="card-header"><h5 class="mb-0">Ustawienia strony</h5></div>
<div class="card-body">
<form method="post" action="/sites" id="siteForm">
<div class="mb-3">
<label for="name" class="form-label">Nazwa strony</label>
<input type="text" class="form-control" id="name" name="name" required placeholder="np. Blog Ogrodniczy">
</div>
<div class="mb-3">
<label for="url" class="form-label">URL WordPressa</label>
<input type="url" class="form-control" id="url" name="url" required placeholder="https://example.com">
<div class="form-text">Podaj pełny URL strony WordPress (bez końcowego /)</div>
</div>
<div class="mb-3">
<label for="api_user" class="form-label">Użytkownik API (WordPress)</label>
<input type="text" class="form-control" id="api_user" name="api_user" required>
<div class="form-text">Login użytkownika WordPress z uprawnieniami do publikacji</div>
</div>
<div class="mb-3">
<label for="api_token" class="form-label">Application Password</label>
<input type="text" class="form-control" id="api_token" name="api_token" required>
<div class="form-text">Wygeneruj w WP: Użytkownicy &rarr; Profil &rarr; Application Passwords</div>
</div>
<div class="mb-3">
<label for="publish_interval_hours" class="form-label">Interwał publikacji (godziny)</label>
<input type="number" class="form-control" id="publish_interval_hours" name="publish_interval_hours" value="24" min="1" max="720">
<div class="form-text">Co ile godzin publikować nowy artykuł na tej stronie</div>
</div>
<div class="mb-3">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="is_multisite" name="is_multisite" value="1">
<label class="form-check-label" for="is_multisite">Strona wielotematyczna</label>
<div class="form-text">Zaznacz, jeśli strona ma wiele tematów - system będzie równomiernie rozkładał publikacje</div>
</div>
</div>
<div class="mb-3">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="is_active" name="is_active" value="1" checked>
<label class="form-check-label" for="is_active">Aktywna</label>
</div>
</div>
<div class="d-flex gap-2">
<button type="submit" class="btn btn-primary">Zapisz</button>
<a href="/sites" class="btn btn-outline-secondary">Anuluj</a>
</div>
</form>
</div>
</div>
</div>
<div class="col-lg-5">
<div class="card">
<div class="card-header"><h5 class="mb-0">Tematy do publikacji</h5></div>
<div class="card-body">
<p class="text-muted small mb-3">Wybierz tematy, o których będą publikowane artykuły. Możesz je później zmienić w edycji strony.</p>
<?php foreach ($globalTopics as $cat): ?>
<?php if (!empty($cat['children'])): ?>
<div class="mb-3">
<label class="form-label fw-bold mb-1"><?= htmlspecialchars($cat['name']) ?></label>
<?php foreach ($cat['children'] as $child): ?>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="topic_<?= $child['id'] ?>" form="siteForm" name="topics[]" value="<?= $child['id'] ?>">
<label class="form-check-label" for="topic_<?= $child['id'] ?>">
<?= htmlspecialchars($child['name']) ?>
</label>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
</div>
</div>