forked from ZwiiCMS-Team/ZwiiCMS
Merge branch '114_dev' into 12_dev
This commit is contained in:
commit
9fd078bdaa
@ -662,57 +662,6 @@ class config extends common {
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Met à jour les données de site avec l'adresse transmise
|
||||
*/
|
||||
public function updateBaseUrl ($url) {
|
||||
// Supprimer l'information de redirection
|
||||
$c3 = 0;
|
||||
$success = false ;
|
||||
// Boucler sur les pages
|
||||
foreach($this->getHierarchy(null,null,null) as $parentId => $childIds) {
|
||||
$content = $this->getPage($parentId, self::$i18n);
|
||||
$titre = $this->getData(['page', $parentId, 'title']);
|
||||
$content = $titre . ' ' . $content ;
|
||||
$replace = str_replace( 'href="' . $url , 'href="'. '' , stripslashes($content),$c1) ;
|
||||
$replace = str_replace( 'src="' . $url , 'src="'. '' , stripslashes($replace),$c2) ;
|
||||
|
||||
if ($c1 > 0 || $c2 > 0) {
|
||||
$success = true;
|
||||
$this->setPage($parentId, $replace, self::$i18n);
|
||||
$c3 += $c1 + $c2;
|
||||
}
|
||||
foreach($childIds as $childId) {
|
||||
$content = $this->getPage($childId, self::$i18n);
|
||||
$content = $titre . ' ' . $content ;
|
||||
$replace = str_replace( 'href="' . $url , 'href="'. '' , stripslashes($content),$c1) ;
|
||||
$replace = str_replace( 'src="' . $url , 'src="'. '' , stripslashes($replace),$c2) ;
|
||||
if ($c1 > 0 || $c2 > 0) {
|
||||
$success = true;
|
||||
$this->setPage($childId, $replace, self::$i18n);
|
||||
$c3 += $c1 + $c2;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Traiter les modules dont la redirection
|
||||
$content = $this->getdata(['module']);
|
||||
$replace = $this->recursive_array_replace('href="' . $url , 'href="'. '', $content, $c1);
|
||||
$replace = $this->recursive_array_replace('src="' . $url , 'src="'. '', $replace, $c2);
|
||||
if ($content !== $replace) {
|
||||
$this->setdata(['module',$replace]);
|
||||
$c3 += $c1 + $c2;
|
||||
$success = true;
|
||||
}
|
||||
// Mettre à jour la base URl
|
||||
$this->setData(['core','baseUrl',helper::baseUrl(true,false)]);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => 'Restaurer',
|
||||
'view' => 'restore',
|
||||
'notification' => $success ? $c3. ' conversion' . ($c3 > 1 ? 's' : '') . ' effectuée' . ($c3 > 1 ? 's' : '') : 'Aucune conversion',
|
||||
'state' => $success ? true : false
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Vider le fichier de log
|
||||
|
@ -422,8 +422,6 @@ class theme extends common {
|
||||
if($this->isPost()) {
|
||||
// Modification des URL des images dans la bannière perso
|
||||
$featureContent = $this->getInput('themeHeaderText', null);
|
||||
// $featureContent = str_replace(helper::baseUrl(false,false), './', $featureContent);
|
||||
|
||||
/**
|
||||
* Stocker les images incluses dans la bannière perso dans un tableau
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user