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

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