087 conversion URL ok

This commit is contained in:
Fred Tempez 2020-05-07 15:07:26 +02:00
parent 4bab683c2b
commit 67bdd386e2
3 changed files with 9 additions and 7 deletions

View File

@ -493,28 +493,30 @@ class config extends common {
$success = false ;
// Boucler sur les pages
foreach($this->getHierarchy(null,null,null) as $parentId => $childIds) {
$content = $this->getData(['page',$parentId,'content']);
$replace = str_replace( $old , $new , stripslashes($content),$count) ;
if ($count > 0) {
$content = $this->getData(['page',$parentId,'content']);
$replace = str_replace( 'href="' . $old , 'href="'. $new , stripslashes($content),$c1) ;
$replace = str_replace( 'src="' . $old , 'src="'. $new , stripslashes($replace),$c2) ;
if ($c1 > 0 || $c2 > 0) {
$success = true;
$this->setData(['page',$parentId,'content', $replace ]);
}
foreach($childIds as $childId) {
$content = $this->getData(['page',$childId,'content']);
$replace = str_replace( $old , $new, stripslashes($content),$count) ;
if ($count > 0) {
$replace = str_replace( 'href="' . $old , 'href="'. $new , stripslashes($content),$c1) ;
$replace = str_replace( 'src="' . $old , 'src="'. $new , stripslashes($replace),$c2) ;
if ($c1 > 0 || $c2 > 0) {
$success = true;
$this->setData(['page',$childId,'content', $replace ]);
}
}
}
}
if ($success === true) {
$this->setData(['core','baseUrl',helper::baseUrl(true,false)]);
}
// Valeurs en sortie
$this->addOutput([
'notification' => $success ? 'Conversion effectuée' : 'Aucune conversion',
'redirect' => helper::baseUrl() . 'config/restore',
'redirect' => helper::baseUrl() . 'config/manage',
'state' => $success ? true : false
]);
}

0
module/gallery/view/gallery/gallery.css Normal file → Executable file
View File

0
module/gallery/view/index/index.css Normal file → Executable file
View File