sauvegarder js et css des pages

This commit is contained in:
fredtempez 2022-03-08 08:54:43 +01:00
parent dfde4ee228
commit a5cb27611f
2 changed files with 16 additions and 4 deletions

View File

@ -2772,7 +2772,7 @@ class core extends common {
'contentLeft' => $this->getData(['page',$this->getUrl(0),'barLeft']) 'contentLeft' => $this->getData(['page',$this->getUrl(0),'barLeft'])
//file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barLeft']), 'content'])) //file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barLeft']), 'content']))
? $this->getPage($this->getData(['page',$this->getUrl(0),'barLeft']), self::$i18n) ? $this->getPage($this->getData(['page',$this->getUrl(0),'barLeft']), self::$i18n)
: '', : ''
]); ]);
} }
// Importe le module // Importe le module
@ -2799,7 +2799,7 @@ class core extends common {
'contentLeft' => $this->getData(['page',$this->getUrl(0),'barLeft']) 'contentLeft' => $this->getData(['page',$this->getUrl(0),'barLeft'])
// ? file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barLeft']), 'content'])) // ? file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barLeft']), 'content']))
? $this->getPage($this->getData(['page',$this->getUrl(0),'barLeft']), self::$i18n) ? $this->getPage($this->getData(['page',$this->getUrl(0),'barLeft']), self::$i18n)
: '', : ''
]); ]);
//$pageContent = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getUrl(0), 'content'])); //$pageContent = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getUrl(0), 'content']));
$pageContent = $this->getPage($this->getUrl(0), self::$i18n); $pageContent = $this->getPage($this->getUrl(0), self::$i18n);
@ -2888,6 +2888,13 @@ class core extends common {
'content' => $output['content'] 'content' => $output['content']
]); ]);
} }
// Incorporer le style perso stocké avec la page
if ( !empty($this->getData(['page', $this->getUrl(0), 'css'])) ) {
$this->addOutput([
'style' => $this->output['style'] . $this->getData(['page', $this->getUrl(0), 'css'])
]);
}
// Contenu par vue // Contenu par vue
elseif($output['view']) { elseif($output['view']) {
// Chemin en fonction d'un module du coeur ou d'un module // Chemin en fonction d'un module du coeur ou d'un module
@ -2904,6 +2911,7 @@ class core extends common {
'style' => $this->output['style'] . file_get_contents($output['style']) 'style' => $this->output['style'] . file_get_contents($output['style'])
]); ]);
} }
// JS // JS
$scriptPath = $modulePath . 'module/' . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.js.php'; $scriptPath = $modulePath . 'module/' . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.js.php';
if(file_exists($scriptPath)) { if(file_exists($scriptPath)) {

View File

@ -155,7 +155,9 @@ class page extends common {
'displayMenu' => '0', 'displayMenu' => '0',
'hideMenuSide' => false, 'hideMenuSide' => false,
'hideMenuHead' => false, 'hideMenuHead' => false,
'hideMenuChildren' => false 'hideMenuChildren' => false,
'js' => '',
'css' => ''
] ]
]); ]);
// Creation du contenu de la page // Creation du contenu de la page
@ -478,7 +480,9 @@ class page extends common {
'hideMenuSide' => $this->getinput('pageEditHideMenuSide', helper::FILTER_BOOLEAN), 'hideMenuSide' => $this->getinput('pageEditHideMenuSide', helper::FILTER_BOOLEAN),
'hideMenuHead' => $this->getinput('pageEditHideMenuHead', helper::FILTER_BOOLEAN), 'hideMenuHead' => $this->getinput('pageEditHideMenuHead', helper::FILTER_BOOLEAN),
'hideMenuChildren' => $this->getinput('pageEditHideMenuChildren', helper::FILTER_BOOLEAN), 'hideMenuChildren' => $this->getinput('pageEditHideMenuChildren', helper::FILTER_BOOLEAN),
'extraPosition' => $this->getinput('pageEditExtraPosition', helper::FILTER_BOOLEAN) 'extraPosition' => $this->getinput('pageEditExtraPosition', helper::FILTER_BOOLEAN),
'css' => $this->getData(['page', $pageId, 'css']),
'js' => $this->getData(['page', $pageId, 'js'])
] ]
]); ]);