Support export/import of logo site in web site templates
This commit is contained in:
parent
f2d53e80e5
commit
0a4d80012a
@ -783,7 +783,7 @@ class Website extends CommonObject
|
||||
*/
|
||||
function exportWebSite()
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $mysoc;
|
||||
|
||||
$website = $this;
|
||||
|
||||
@ -904,6 +904,9 @@ class Website extends CommonObject
|
||||
$stringtoexport = str_replace('file=js/'.$website->ref.'/', "file=js/__WEBSITE_KEY__/", $stringtoexport);
|
||||
$stringtoexport = str_replace('medias/image/'.$website->ref.'/', "medias/image/__WEBSITE_KEY__/", $stringtoexport);
|
||||
$stringtoexport = str_replace('medias/js/'.$website->ref.'/', "medias/js/__WEBSITE_KEY__/", $stringtoexport);
|
||||
$stringtoexport = str_replace('file=logos%2Fthumbs%2F'.$mysoc->logo_small, "file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__", $stringtoexport);
|
||||
$stringtoexport = str_replace('file=logos%2Fthumbs%2F'.$mysoc->logo_mini, "file=logos%2Fthumbs%2F__LOGO_MINI_KEY__", $stringtoexport);
|
||||
$stringtoexport = str_replace('file=logos%2Fthumbs%2F'.$mysoc->logo, "file=logos%2Fthumbs%2F__LOGO_KEY__", $stringtoexport);
|
||||
$line.= "'".$this->db->escape(str_replace(array("\r\n","\r","\n"), "__N__", $stringtoexport))."', "; // Replace \r \n to have record on 1 line
|
||||
|
||||
$stringtoexport = $objectpageold->content;
|
||||
@ -912,6 +915,9 @@ class Website extends CommonObject
|
||||
$stringtoexport = str_replace('file=js/'.$website->ref.'/', "file=js/__WEBSITE_KEY__/", $stringtoexport);
|
||||
$stringtoexport = str_replace('medias/image/'.$website->ref.'/', "medias/image/__WEBSITE_KEY__/", $stringtoexport);
|
||||
$stringtoexport = str_replace('medias/js/'.$website->ref.'/', "medias/js/__WEBSITE_KEY__/", $stringtoexport);
|
||||
$stringtoexport = str_replace('file=logos%2Fthumbs%2F'.$mysoc->logo_small, "file=logos%2Fthumbs%2F__LOGO_SMALL_KEY__", $stringtoexport);
|
||||
$stringtoexport = str_replace('file=logos%2Fthumbs%2F'.$mysoc->logo_mini, "file=logos%2Fthumbs%2F__LOGO_MINI_KEY__", $stringtoexport);
|
||||
$stringtoexport = str_replace('file=logos%2Fthumbs%2F'.$mysoc->logo, "file=logos%2Fthumbs%2F__LOGO_KEY__", $stringtoexport);
|
||||
$line.= "'".$this->db->escape($stringtoexport)."'"; // Replace \r \n to have record on 1 line
|
||||
$line.= ");";
|
||||
$line.= "\n";
|
||||
@ -951,7 +957,7 @@ class Website extends CommonObject
|
||||
*/
|
||||
function importWebSite($pathtofile)
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $mysoc;
|
||||
|
||||
$error = 0;
|
||||
|
||||
@ -1000,6 +1006,9 @@ class Website extends CommonObject
|
||||
$arrayreplacement['__WEBSITE_ID__'] = $object->id;
|
||||
$arrayreplacement['__WEBSITE_KEY__'] = $object->ref;
|
||||
$arrayreplacement['__N__'] = $this->db->escape("\n"); // Restore \n
|
||||
$arrayreplacement['__LOGO_SMALL_KEY__'] = $this->db->escape($mysoc->logo_small);
|
||||
$arrayreplacement['__LOGO_MINI_KEY__'] = $this->db->escape($mysoc->logo_mini);
|
||||
$arrayreplacement['__LOGO_KEY__'] = $this->db->escape($mysoc->logo);
|
||||
$result = dolReplaceInFile($sqlfile, $arrayreplacement);
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user