forked from ZwiiCMS-Team/ZwiiCampus
courseContent
This commit is contained in:
parent
dda7074034
commit
9135ea3db0
@ -913,7 +913,7 @@ class layout extends common
|
||||
if (is_dir(self::DATA_DIR . $key)) {
|
||||
$c++;
|
||||
$location = helper::baseUrl() . 'language/content/' . $key;
|
||||
$leftItem .= '<option name="' . $key . '" value="' . $location . '" ' . ($key === self::$classesContent ? 'selected' : '') . '>' . $value . '</option>';
|
||||
$leftItem .= '<option name="' . $key . '" value="' . $location . '" ' . ($key === self::$courseContent ? 'selected' : '') . '>' . $value . '</option>';
|
||||
}
|
||||
}
|
||||
if ($c > 1) {
|
||||
|
@ -611,10 +611,10 @@ class core extends common
|
||||
$inlineScript[] = $this->getData(['page', $this->getUrl(0), 'js']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'js']);
|
||||
|
||||
// Importe le contenu, le CSS et le script des barres
|
||||
$contentRight = $this->getData(['page', $this->getUrl(0), 'barRight']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), self::$classesContent) : '';
|
||||
$contentRight = $this->getData(['page', $this->getUrl(0), 'barRight']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), self::$courseContent) : '';
|
||||
$inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']);
|
||||
$inlineScript[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']);
|
||||
$contentLeft = $this->getData(['page', $this->getUrl(0), 'barLeft']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), self::$classesContent) : '';
|
||||
$contentLeft = $this->getData(['page', $this->getUrl(0), 'barLeft']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), self::$courseContent) : '';
|
||||
$inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']);
|
||||
$inlineScript[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']);
|
||||
|
||||
@ -632,7 +632,7 @@ class core extends common
|
||||
|
||||
$this->addOutput([
|
||||
'title' => $title,
|
||||
'content' => $this->getPage($this->getUrl(0), self::$classesContent),
|
||||
'content' => $this->getPage($this->getUrl(0), self::$courseContent),
|
||||
'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']),
|
||||
'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']),
|
||||
'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']),
|
||||
@ -658,7 +658,7 @@ class core extends common
|
||||
: $this->getData(['page', $this->getUrl(0), 'metaDescription']);
|
||||
|
||||
// Importe le CSS de la page principale
|
||||
$pageContent = $this->getPage($this->getUrl(0), self::$classesContent);
|
||||
$pageContent = $this->getPage($this->getUrl(0), self::$courseContent);
|
||||
|
||||
$this->addOutput([
|
||||
'title' => $title,
|
||||
|
@ -26,10 +26,9 @@ class common
|
||||
const DISPLAY_LAYOUT_LIGHT = 5;
|
||||
const GROUP_BANNED = -1;
|
||||
const GROUP_VISITOR = 0;
|
||||
const GROUP_MEMBER = 1;
|
||||
const GROUP_EDITOR = 2;
|
||||
const GROUP_STUDENT = 1;
|
||||
const GROUP_TEACHER = 2;
|
||||
// Groupe MODERATOR, compatibilité avec les anciens modules :
|
||||
const GROUP_MODERATOR = 2;
|
||||
const GROUP_ADMIN = 3;
|
||||
const SIGNATURE_ID = 1;
|
||||
const SIGNATURE_PSEUDO = 2;
|
||||
@ -170,7 +169,7 @@ class common
|
||||
// Langue de l'interface sélectionnée
|
||||
public static $i18nUI = 'fr_FR';
|
||||
// Langues de contenu
|
||||
public static $classesContent = '';
|
||||
public static $courseContent = 'home';
|
||||
public static $languages = [
|
||||
'de' => 'Deutsch',
|
||||
'en_EN' => 'English',
|
||||
@ -302,23 +301,23 @@ class common
|
||||
// Extraction de la sesion
|
||||
// $this->input['_SESSION'] = $_SESSION;
|
||||
|
||||
// Déterminer la langue du contenu du site
|
||||
// Déterminer le contenu du site
|
||||
if (isset($_SESSION['ZWII_COURSE'])) {
|
||||
// Déterminé par la session présente
|
||||
self::$classesContent = $_SESSION['ZWII_COURSE'];
|
||||
self::$courseContent = $_SESSION['ZWII_COURSE'];
|
||||
}
|
||||
|
||||
// Instanciation de la classe des entrées / sorties
|
||||
$this->jsonDB(self::$classesContent);
|
||||
$this->jsonDB(self::$courseContent);
|
||||
|
||||
// Installation fraîche, initialisation des modules
|
||||
if ($this->user === []) {
|
||||
foreach ($this->dataFiles as $stageId => $item) {
|
||||
$folder = $this->dataPath($stageId, self::$classesContent);
|
||||
$folder = $this->dataPath($stageId, self::$courseContent);
|
||||
if (
|
||||
file_exists($folder . $stageId . '.json') === false
|
||||
) {
|
||||
$this->initData($stageId, self::$classesContent);
|
||||
$this->initData($stageId, self::$courseContent);
|
||||
common::$coreNotices[] = $stageId;
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class maintenance extends common
|
||||
? ''
|
||||
: $this->getData(['page', $this->getData(['config', 'page302']), 'title']),
|
||||
//'content' => $this->getdata(['page',$this->getData(['config','page302']),'content']),
|
||||
'content' => $this->getPage($this->getData(['config', 'page302']), self::$classesContent),
|
||||
'content' => $this->getPage($this->getData(['config', 'page302']), self::$courseContent),
|
||||
'view' => 'index'
|
||||
]);
|
||||
} else {
|
||||
|
@ -174,11 +174,11 @@ class page extends common
|
||||
]
|
||||
]);
|
||||
// Creation du contenu de la page
|
||||
if (!is_dir(self::DATA_DIR . self::$classesContent . '/content')) {
|
||||
mkdir(self::DATA_DIR . self::$classesContent . '/content', 0755);
|
||||
if (!is_dir(self::DATA_DIR . self::$courseContent . '/content')) {
|
||||
mkdir(self::DATA_DIR . self::$courseContent . '/content', 0755);
|
||||
}
|
||||
//file_put_contents(self::DATA_DIR . self::$classesContent . '/content/' . $pageId . '.html', '<p>Contenu de votre nouvelle page.</p>');
|
||||
$this->setPage($pageId, '<p>Contenu de votre nouvelle page.</p>', self::$classesContent);
|
||||
//file_put_contents(self::DATA_DIR . self::$courseContent . '/content/' . $pageId . '.html', '<p>Contenu de votre nouvelle page.</p>');
|
||||
$this->setPage($pageId, '<p>Contenu de votre nouvelle page.</p>', self::$courseContent);
|
||||
|
||||
// Met à jour le sitemap
|
||||
$this->updateSitemap();
|
||||
@ -279,8 +279,8 @@ class page extends common
|
||||
}
|
||||
// Effacer la page
|
||||
$this->deleteData(['page', $page]);
|
||||
if (file_exists(self::DATA_DIR . self::$classesContent . '/content/' . $page . '.html')) {
|
||||
unlink(self::DATA_DIR . self::$classesContent . '/content/' . $page . '.html');
|
||||
if (file_exists(self::DATA_DIR . self::$courseContent . '/content/' . $page . '.html')) {
|
||||
unlink(self::DATA_DIR . self::$courseContent . '/content/' . $page . '.html');
|
||||
}
|
||||
$this->deleteData(['module', $page]);
|
||||
|
||||
@ -369,8 +369,8 @@ class page extends common
|
||||
// Supprime l'ancienne page si l'id a changée
|
||||
if ($pageId !== $this->getUrl(2)) {
|
||||
$this->deleteData(['page', $this->getUrl(2)]);
|
||||
if (file_exists(self::DATA_DIR . self::$classesContent . '/content/' . $this->getUrl(2) . '.html')) {
|
||||
unlink(self::DATA_DIR . self::$classesContent . '/content/' . $this->getUrl(2) . '.html');
|
||||
if (file_exists(self::DATA_DIR . self::$courseContent . '/content/' . $this->getUrl(2) . '.html')) {
|
||||
unlink(self::DATA_DIR . self::$courseContent . '/content/' . $this->getUrl(2) . '.html');
|
||||
}
|
||||
}
|
||||
// Traitement des pages spéciales affectées dans la config :
|
||||
@ -508,11 +508,11 @@ class page extends common
|
||||
]);
|
||||
|
||||
// Creation du contenu de la page
|
||||
if (!is_dir(self::DATA_DIR . self::$classesContent . '/content')) {
|
||||
mkdir(self::DATA_DIR . self::$classesContent . '/content', 0755);
|
||||
if (!is_dir(self::DATA_DIR . self::$courseContent . '/content')) {
|
||||
mkdir(self::DATA_DIR . self::$courseContent . '/content', 0755);
|
||||
}
|
||||
$content = empty($this->getInput('pageEditContent', null)) ? '<p></p>' : str_replace('<p></p>', '<p> </p>', $this->getInput('pageEditContent', null));
|
||||
$this->setPage($pageId, $content, self::$classesContent);
|
||||
$this->setPage($pageId, $content, self::$courseContent);
|
||||
|
||||
// Met à jour le sitemap
|
||||
$this->updateSitemap();
|
||||
|
@ -108,7 +108,7 @@
|
||||
<div class="col12">
|
||||
<?php echo template::textarea('pageEditContent', [
|
||||
'class' => 'editorWysiwyg',
|
||||
'value' => $this->getPage($this->getUrl(2), self::$classesContent)
|
||||
'value' => $this->getPage($this->getUrl(2), self::$courseContent)
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -537,19 +537,19 @@ class plugin extends common
|
||||
$infoModules[$pagesInfos[$keyi18n][$keyPage]['moduleId']]['version'],
|
||||
template::flag($keyi18n, '20px') . ' <a href ="' . helper::baseUrl() . $keyPage . '" target="_blank">' . $pagesInfos[$keyi18n][$keyPage]['title'] . ' (' . $keyPage . ')</a>',
|
||||
template::button('dataExport' . $keyPage, [
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/dataExport/filemanager/' . self::$classesContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage,
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/dataExport/filemanager/' . self::$courseContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage,
|
||||
// appel de fonction vaut exécution, utiliser un paramètre
|
||||
'value' => template::ico('download-cloud'),
|
||||
'help' => 'Sauvegarder les données du module dans le gestionnaire de fichiers'
|
||||
]),
|
||||
template::button('dataExport' . $keyPage, [
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/dataExport/download/' . self::$classesContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage,
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/dataExport/download/' . self::$courseContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage,
|
||||
// appel de fonction vaut exécution, utiliser un paramètre
|
||||
'value' => template::ico('download'),
|
||||
'help' => 'Sauvegarder et télécharger les données du module'
|
||||
]),
|
||||
template::button('dataDelete' . $keyPage, [
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/dataDelete/' . self::$classesContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage,
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/dataDelete/' . self::$courseContent . '/' . $pagesInfos[$keyi18n][$keyPage]['moduleId'] . '/' . $keyPage,
|
||||
// appel de fonction vaut exécution, utiliser un paramètre
|
||||
'value' => template::ico('trash'),
|
||||
'class' => 'buttonRed dataDelete',
|
||||
|
@ -213,8 +213,8 @@ class search extends common
|
||||
) {
|
||||
$url = $parentId;
|
||||
$titre = $this->getData(['page', $parentId, 'title']);
|
||||
//$content = file_get_contents(self::DATA_DIR . self::$classesContent . '/content/' . $this->getData(['page', $parentId, 'content']));
|
||||
$content = $this->getPage($parentId, self::$classesContent);
|
||||
//$content = file_get_contents(self::DATA_DIR . self::$courseContent . '/content/' . $this->getData(['page', $parentId, 'content']));
|
||||
$content = $this->getPage($parentId, self::$courseContent);
|
||||
$content = $titre . ' ' . $content;
|
||||
// Pages sauf pages filles et articles de blog
|
||||
$tempData = $this->occurrence($url, $titre, $content, $motclef, self::$motentier);
|
||||
@ -232,8 +232,8 @@ class search extends common
|
||||
) {
|
||||
$url = $childId;
|
||||
$titre = $this->getData(['page', $childId, 'title']);
|
||||
//$content = file_get_contents(self::DATA_DIR . self::$classesContent . '/content/' . $this->getData(['page', $childId, 'content']));
|
||||
$content = $this->getPage($childId, self::$classesContent);
|
||||
//$content = file_get_contents(self::DATA_DIR . self::$courseContent . '/content/' . $this->getData(['page', $childId, 'content']));
|
||||
$content = $this->getPage($childId, self::$courseContent);
|
||||
$content = $titre . ' ' . $content;
|
||||
//Pages filles
|
||||
$tempData = $this->occurrence($url, $titre, $content, $motclef, self::$motentier);
|
||||
|
Loading…
Reference in New Issue
Block a user