TEST convert URL
This commit is contained in:
parent
5b19187df4
commit
f19094ba48
@ -265,7 +265,7 @@ class config extends common {
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => $success === true ? 'Image tag réinitialisée' : "Erreur : image tag non créée",
|
||||
'notification' => $success === true ? 'Image tag réinitialisée' : 'Erreur : image tag non créée',
|
||||
'redirect' => helper::baseUrl() . 'config',
|
||||
'state' => $success
|
||||
]);
|
||||
@ -475,29 +475,44 @@ class config extends common {
|
||||
// Récuperer les données
|
||||
// Les contrôles ont été effectués sur la page de formulaire
|
||||
$old = $this->getData(['core', 'baseUrl']);
|
||||
$oldCheckRw = strpos($old,'/?') > 0 ? false : true;
|
||||
$new = helper::baseUrl(true,false);
|
||||
$newCheckRw = strpos($new,'/?') > 0 ? false : true;
|
||||
var_dump($oldCheckRw);
|
||||
echo "-";
|
||||
echo strpos($new,'?') ;
|
||||
var_dump($newCheckRw);
|
||||
die();
|
||||
// Boucler sur les pages
|
||||
foreach($this->getHierarchy(null,null,null) as $parentId => $childIds) {
|
||||
$content = $this->getData(['page',$parentId,'content']);
|
||||
$replace = str_replace( $old , $new , $content,$count) ;
|
||||
$this->setData(['page',$parentId,'content', $replace ]);
|
||||
if (strpos($old,'?') > 0) {
|
||||
$replace = str_replace( str_replace('?','',$old) , $new , $content,$count) ;
|
||||
if ($oldCheckRw === helper::checkRewrite() ||
|
||||
($oldCheckRw === false && helper::checkRewrite() === true)
|
||||
) {
|
||||
$replace = str_replace( $old , $new , $content);
|
||||
$this->setData(['page',$parentId,'content', $replace ]);
|
||||
} elseif ($oldCheckRw === true && helper::checkRewrite() === false) {
|
||||
die();
|
||||
}
|
||||
|
||||
foreach($childIds as $childId) {
|
||||
$content = $this->getData(['page',$childId,'content']);
|
||||
$replace = str_replace( $old , $new, $content,$count) ;
|
||||
if (strpos($old,'?') > 0) {
|
||||
$replace = str_replace( str_replace('?','',$old) , $new , $content,$count) ;
|
||||
if ($oldCheckRw === helper::checkRewrite() ||
|
||||
$oldCheckRw === false && helper::checkRewrite() === true
|
||||
) {
|
||||
$replace = str_replace( $old , $new , $content);
|
||||
$this->setData(['page',$childId,'content', $replace ]);
|
||||
}
|
||||
$this->setData(['page',$childId,'content', $replace ]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->setData(['core','baseUrl',helper::baseUrl(true,false)]);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => 'Sauvegarder / Restaurer',
|
||||
'view' => 'manage'
|
||||
'notification' => 'Conversion effectuée',
|
||||
'redirect' => helper::baseUrl() . 'config/manage',
|
||||
'state' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user