[9.0.05-dev.c] TinyMCE link on page
This commit is contained in:
parent
ff222a610b
commit
0e40dbe4c0
@ -30,7 +30,7 @@ class common {
|
||||
// Désactive l'update auto
|
||||
// const ZWII_VERSION = '9.0.00-dev27';
|
||||
// Numéro de version stable
|
||||
const ZWII_VERSION = '9.0.05-dev.b';
|
||||
const ZWII_VERSION = '9.0.05-dev.c';
|
||||
|
||||
|
||||
public static $actions = [];
|
||||
@ -625,6 +625,9 @@ class common {
|
||||
$this->url = $this->getData(['config', 'homePageId']);
|
||||
}
|
||||
}
|
||||
|
||||
// Mise à jour de la liste des pages pour TinyMCE
|
||||
$this->linkList();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -820,8 +823,6 @@ class common {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Accède à une valeur des variables http (ordre de recherche en l'absence de type : _COOKIE, _POST)
|
||||
* @param string $key Clé de la valeur
|
||||
@ -942,7 +943,6 @@ class common {
|
||||
// Pause de 10 millisecondes
|
||||
usleep(10000);
|
||||
}
|
||||
|
||||
// Save theme
|
||||
// dernière clé principale
|
||||
// Trois tentatives
|
||||
@ -955,6 +955,40 @@ class common {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Génére un fichier json avec la liste des
|
||||
*/
|
||||
public function linkList() {
|
||||
// Sauve la liste des pages pour TinyMCE
|
||||
$parents = [];
|
||||
$children = [];
|
||||
$rewrite = (helper::checkRewrite()) ? '' : '?';
|
||||
foreach($this->getHierarchy(null,false,false) as $parentId => $childIds) {
|
||||
// Exclure les barres
|
||||
if ($this->getData(['page', $parentId, 'block']) !== 'bar' ) {
|
||||
$parents [] = ['title' => $this->getData(['page', $parentId, 'title']) ,
|
||||
'value'=> $rewrite.$parentId
|
||||
];
|
||||
}
|
||||
//if (!empty($childIds)) {
|
||||
foreach($childIds as $childId) {
|
||||
$parents [] = ['title' => '› ' . $this->getData(['page', $childId, 'title']) ,
|
||||
'value'=> $rewrite.$childId
|
||||
];
|
||||
}
|
||||
// $parents [] = [ 'menu' => $children];
|
||||
//}
|
||||
}
|
||||
// 3 tentatives
|
||||
for($i = 0; $i < 3; $i++) {
|
||||
if (file_put_contents ('core/vendor/tinymce/link_list.json', json_encode($parents), LOCK_EX) !== false) {
|
||||
break;
|
||||
}
|
||||
// Pause de 10 millisecondes
|
||||
usleep(10000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Envoi un mail
|
||||
|
14
core/vendor/tinymce/init.js
vendored
14
core/vendor/tinymce/init.js
vendored
@ -20,11 +20,11 @@ tinymce.init({
|
||||
lineNumbers: true
|
||||
},
|
||||
width: 800, // Default value is 800
|
||||
height: 500, // Default value is 550
|
||||
jsFiles: [ // Additional JS files to load
|
||||
'mode/clike/clike.js',
|
||||
'mode/php/php.js'
|
||||
]
|
||||
height: 500 // Default value is 550
|
||||
//jsFiles: [ // Additional JS files to load
|
||||
// 'mode/clike/clike.js',
|
||||
// 'mode/php/php.js'
|
||||
//]
|
||||
},
|
||||
// Contenu du menu contextuel
|
||||
contextmenu: "cut copy paste pastetext | selectall searchreplace | link image inserttable | cell row column deletetable",
|
||||
@ -35,6 +35,9 @@ tinymce.init({
|
||||
baseUrl + "site/data/theme.css",
|
||||
baseUrl + "site/data/custom.css"
|
||||
],
|
||||
// Pages internes
|
||||
link_list: "core/vendor/tinymce/links.php",
|
||||
// Thème mobile
|
||||
// Classe à ajouter à la balise body dans l'iframe
|
||||
body_class: "editorWysiwyg",
|
||||
// Cache les menus
|
||||
@ -143,6 +146,7 @@ tinymce.init({
|
||||
});
|
||||
|
||||
|
||||
|
||||
tinymce.PluginManager.add('stickytoolbar', function(editor, url) {
|
||||
editor.on('init', function() {
|
||||
setSticky();
|
||||
|
4
core/vendor/tinymce/links.php
vendored
Normal file
4
core/vendor/tinymce/links.php
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
<?php header("Content-type: text/javascript");
|
||||
header("pragma: no-cache");
|
||||
header("expires: 0");
|
||||
echo file_get_contents('link_list.json');
|
Loading…
Reference in New Issue
Block a user