First commit
This commit is contained in:
parent
31347b30cb
commit
5c5635e44b
|
|
@ -1,19 +1,11 @@
|
||||||
// assets/admin-settings.js
|
|
||||||
(function ($) {
|
(function ($) {
|
||||||
const toggleSections = () => {
|
function toggleSections() {
|
||||||
const adapter = $('#flysystem-offload-adapter').val();
|
const adapter = $('#flysystem-offload-adapter').val();
|
||||||
$('.flysystem-offload-adapter-section').hide();
|
$('.flysystem-offload-adapter-section').hide();
|
||||||
$(`.flysystem-offload-adapter-section[data-adapter="${adapter}"]`).show();
|
$(`.flysystem-offload-adapter-section[data-adapter="${adapter}"]`).show();
|
||||||
};
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
const $heading = $('h2:contains("Amazon S3 / Compatible")');
|
|
||||||
const $table = $heading.next('table');
|
|
||||||
|
|
||||||
if ($heading.length && $table.length) {
|
|
||||||
$heading.add($table).wrapAll('<div class="flysystem-offload-adapter-section" data-adapter="s3"></div>');
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleSections();
|
toggleSections();
|
||||||
$('#flysystem-offload-adapter').on('change', toggleSections);
|
$('#flysystem-offload-adapter').on('change', toggleSections);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
# Realizando push para um repositório existente por linha de comando
|
||||||
|
cd /ruta/de/tu/proyecto
|
||||||
|
git init
|
||||||
|
git add .
|
||||||
|
git commit -m "First commit"
|
||||||
|
git remote add origin https://git.brasdrive.com.br/Brasdrive/flysystem-offload.git
|
||||||
|
git push -u origin main
|
||||||
|
|
||||||
|
----------------
|
||||||
|
# Criando um novo repositório por linha de comando
|
||||||
|
touch README.md
|
||||||
|
git init
|
||||||
|
git checkout -b main
|
||||||
|
git add README.md
|
||||||
|
git commit -m "First commit"
|
||||||
|
git remote add origin https://git.brasdrive.com.br/Brasdrive/flysystem-offload.git
|
||||||
|
git push -u origin main
|
||||||
|
|
@ -188,7 +188,10 @@ class SettingsPage
|
||||||
<form method="post" action="options.php">
|
<form method="post" action="options.php">
|
||||||
<?php
|
<?php
|
||||||
settings_fields('flysystem_offload');
|
settings_fields('flysystem_offload');
|
||||||
do_settings_sections('flysystem-offload');
|
|
||||||
|
$sectionsHtml = $this->generateSectionsMarkup();
|
||||||
|
echo $sectionsHtml; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||||
|
|
||||||
submit_button(__('Guardar cambios', 'flysystem-offload'));
|
submit_button(__('Guardar cambios', 'flysystem-offload'));
|
||||||
?>
|
?>
|
||||||
</form>
|
</form>
|
||||||
|
|
@ -196,6 +199,23 @@ class SettingsPage
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function generateSectionsMarkup(): string
|
||||||
|
{
|
||||||
|
ob_start();
|
||||||
|
do_settings_sections('flysystem-offload');
|
||||||
|
$html = ob_get_clean();
|
||||||
|
|
||||||
|
$label = preg_quote(__('Amazon S3 / Compatible', 'flysystem-offload'), '/');
|
||||||
|
|
||||||
|
$pattern = '/(<h2[^>]*>\s*' . $label . '\s*<\/h2>\s*<table[^>]*>.*?<\/table>)/is';
|
||||||
|
|
||||||
|
return preg_replace(
|
||||||
|
$pattern,
|
||||||
|
'<div class="flysystem-offload-adapter-section" data-adapter="s3">$1</div>',
|
||||||
|
$html
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function renderAdapterField(): void
|
public function renderAdapterField(): void
|
||||||
{
|
{
|
||||||
$settings = get_option('flysystem_offload_settings', []);
|
$settings = get_option('flysystem_offload_settings', []);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue