forked from Wavyzz/dolibarr
Fix copy of templates during activation of module
This commit is contained in:
@@ -158,7 +158,7 @@ class modWebsite extends DolibarrModules
|
||||
// Remove permissions and default values
|
||||
$this->remove($options);
|
||||
|
||||
// Copy flags and octicons directoru
|
||||
// Copy flags and octicons directory
|
||||
$dirarray=array('common/flags', 'common/octicons');
|
||||
foreach($dirarray as $dir)
|
||||
{
|
||||
@@ -179,6 +179,26 @@ class modWebsite extends DolibarrModules
|
||||
}
|
||||
}
|
||||
|
||||
// Website templates
|
||||
$srcroot=DOL_DOCUMENT_ROOT.'/install/doctemplates/websites';
|
||||
$destroot=DOL_DATA_ROOT.'/doctemplates/websites';
|
||||
|
||||
dol_mkdir($destroot);
|
||||
|
||||
$docs=dol_dir_list($srcroot, 'files', 0, 'website_.*(\.zip|\.jpg)$');
|
||||
foreach($docs as $cursorfile)
|
||||
{
|
||||
$src=$srcroot.'/'.$cursorfile['name'];
|
||||
$dest=$destroot.'/'.$cursorfile['name'];
|
||||
|
||||
$result=dol_copy($src, $dest, 0, 0);
|
||||
if ($result < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorFailToCopyFile', $src, $dest);
|
||||
}
|
||||
}
|
||||
|
||||
$sql = array();
|
||||
|
||||
return $this->_init($sql, $options);
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 274 KiB |
Reference in New Issue
Block a user