Browse Source

sauvegarder js et css des pages

12_dev
fredtempez 4 months ago
parent
commit
a5cb27611f
  1. 12
      core/core.php
  2. 8
      core/module/page/page.php

12
core/core.php

@ -2772,7 +2772,7 @@ class core extends common {
'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']))
? $this->getPage($this->getData(['page',$this->getUrl(0),'barLeft']), self::$i18n)
: '',
: ''
]);
}
// Importe le module
@ -2799,7 +2799,7 @@ class core extends common {
'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']))
? $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 = $this->getPage($this->getUrl(0), self::$i18n);
@ -2888,6 +2888,13 @@ class core extends common {
'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
elseif($output['view']) {
// 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'])
]);
}
// JS
$scriptPath = $modulePath . 'module/' . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.js.php';
if(file_exists($scriptPath)) {

8
core/module/page/page.php

@ -155,7 +155,9 @@ class page extends common {
'displayMenu' => '0',
'hideMenuSide' => false,
'hideMenuHead' => false,
'hideMenuChildren' => false
'hideMenuChildren' => false,
'js' => '',
'css' => ''
]
]);
// Creation du contenu de la page
@ -478,7 +480,9 @@ class page extends common {
'hideMenuSide' => $this->getinput('pageEditHideMenuSide', helper::FILTER_BOOLEAN),
'hideMenuHead' => $this->getinput('pageEditHideMenuHead', 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'])
]
]);

Loading…
Cancel
Save