Commit 54f9f1c2 authored by Laurent Lécluse's avatar Laurent Lécluse
Browse files

Possibilité de personnaliser l'URL pour utiliser ACE via le parametre de...

Possibilité de personnaliser l'URL pour utiliser ACE via le parametre de config js_ace_url (par défaut rien ne change)
parent a8f8c074
Pipeline #11518 passed with stage
in 23 seconds
CHANGELOG
=========
3.1.7 (16/11/2021)
------------------
- Possibilité de personnaliser l'URL pour utiliser ACE via le parametre de config js_ace_url (par défaut rien ne change)
3.1.6 (04/10/2021)
------------------
- Suppression de la dépendance inutile à UnicaenOracle
......
......@@ -18,5 +18,7 @@ return [
// Code unique de la source à injecter (null pour désactiver le mécanisme).
'source_code' => null,
],
'js_ace_url' => '/vendor/unicaen/import/ace-builds-master/src-min/ace.js',
],
];
\ No newline at end of file
......@@ -5,6 +5,7 @@ namespace UnicaenImport\Controller\Factory;
use Interop\Container\ContainerInterface;
use UnicaenImport\Controller\TableController;
use UnicaenImport\Form\TableForm;
use UnicaenImport\Options\ModuleOptions;
use UnicaenImport\Processus\ImportProcessus;
use UnicaenImport\Service\SchemaService;
use UnicaenImport\Service\TableService;
......@@ -32,6 +33,7 @@ class TableControllerFactory
$controller->setServiceSchema($container->get(SchemaService::class));
$controller->setFormTable($container->get('FormElementManager')->get(TableForm::class));
$controller->setProcessusImport($container->get(ImportProcessus::class));
$controller->setOptionsModule($container->get(ModuleOptions::class));
return $controller;
}
......
......@@ -3,6 +3,7 @@
namespace UnicaenImport\Controller;
use UnicaenImport\Form\Traits\TableFormAwareTrait;
use UnicaenImport\Options\Traits\ModuleOptionsAwareTrait;
use UnicaenImport\Processus\Traits\ImportProcessusAwareTrait;
use UnicaenImport\Service\Traits\SchemaServiceAwareTrait;
use UnicaenImport\Service\Traits\TableServiceAwareTrait;
......@@ -21,6 +22,7 @@ class TableController extends AbstractActionController
use SchemaServiceAwareTrait;
use TableFormAwareTrait;
use ImportProcessusAwareTrait;
use ModuleOptionsAwareTrait;
......@@ -29,8 +31,9 @@ class TableController extends AbstractActionController
$tables = $this->getServiceTable()->getList();
$views = $this->getServiceSchema()->getImportViews();
$hasNonReferenced = !empty($this->getServiceSchema()->getNonReferencedImportTables());
$jsAceUrl = $this->getOptionsModule()->getJsAceUrl();
return compact('tables', 'hasNonReferenced', 'views');
return compact('tables', 'hasNonReferenced', 'views', 'jsAceUrl');
}
......
......@@ -27,6 +27,11 @@ class ModuleOptions extends AbstractOptions
*/
protected $entitySourceInjector;
/**
* @var string
*/
protected $jsAceUrl = '/vendor/unicaen/import/ace-builds-master/src-min/ace.js';
/**
......@@ -98,4 +103,29 @@ class ModuleOptions extends AbstractOptions
return $this;
}
/**
* @return string
*/
public function getJsAceUrl(): string
{
return $this->jsAceUrl;
}
/**
* @param string $jsAceUrl
*
* @return ModuleOptions
*/
public function setJsAceUrl(string $jsAceUrl): ModuleOptions
{
$this->jsAceUrl = $jsAceUrl;
return $this;
}
}
\ No newline at end of file
......@@ -6,12 +6,13 @@ use UnicaenImport\Provider\Privilege\Privileges;
/* @var $tables Table[] */
/* @var $hasNonReferenced boolean */
/* @var $views string[] */
/* @var $jsAceUrl string */
$title = 'Tables';
$canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_TABLES_EDITION));
echo $this->inlinescript()->appendFile($this->basePath() . '/vendor/unicaen/import/ace-builds-master/src-min/ace.js');
echo $this->inlinescript()->appendFile($this->basePath() . $jsAceUrl);
$this->headTitle()->append($title);
echo $this->tag('h1', ['class' => 'page-header'])->text($title);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment