WIP symbolic links

This commit is contained in:
Eric Espie
2026-04-02 16:52:36 +02:00
parent 7bec8d9ad0
commit 271fed210a
4 changed files with 23 additions and 38 deletions

View File

@@ -17,6 +17,7 @@
*
* You should have received a copy of the GNU Affero General Public License
*/
use Combodo\iTop\Application\WebPage\WebPage;
/**
@@ -29,24 +30,13 @@ abstract class AbstractWizStepMiscParams extends WizardStep
*/
final protected function AddUseSymlinksFlagOption(WebPage $oPage): void
{
if (MFCompiler::CanUseSymbolicLinksFlagBeUsed()) {
$sChecked = (MFCompiler::IsUseSymbolicLinksFlagPresent()) ? ' checked' : '';
if (MFCompiler::CanUseSymbolicLinks()) {
$sChecked = $this->oWizard->GetParameter('use-symbolic-links', MFCompiler::UseSymbolicLinks()) ? ' checked ' : '';
$oPage->add('<fieldset>');
$oPage->add('<legend>Dev parameters</legend>');
$oPage->p('<input id="use-symbolic-links" type="checkbox"'.$sChecked.'><label for="use-symbolic-links">&nbsp;Create symbolic links instead of creating a copy in env-production (useful for debugging extensions)');
$oPage->p('<input id="use-symbolic-links" name="use-symbolic-links" type="checkbox"'.$sChecked.'><label for="use-symbolic-links">&nbsp;Create symbolic links instead of creating a copy in env-production (useful for debugging extensions)');
$oPage->add('</fieldset>');
$oPage->add_ready_script(
<<<'JS'
$("#use-symbolic-links").on("click", function() {
var $this = $(this),
bUseSymbolicLinks = $this.prop("checked");
var sAuthent = $('#authent_token').val();
var oAjaxParams = { operation: 'toggle_use_symbolic_links', bUseSymbolicLinks: bUseSymbolicLinks, authent: sAuthent};
$.post(GetAbsoluteUrlAppRoot()+'setup/ajax.dataloader.php', oAjaxParams);
});
JS
);
}
}