Fixed gh-120 that allows export of component with language translations
This commit is contained in:
@ -54,7 +54,7 @@ class Compiler extends Infusion
|
||||
// fixed pathes
|
||||
protected $dynamicIntegration = false;
|
||||
protected $backupPath = false;
|
||||
protected $gitPath = false;
|
||||
protected $repoPath = false;
|
||||
protected $addCustomCodeAt = array();
|
||||
|
||||
/**
|
||||
@ -76,9 +76,9 @@ class Compiler extends Infusion
|
||||
$this->backupPath = $this->params->get('backup_folder_path', $this->tempPath).'/'.$this->componentBackupName.'.zip';
|
||||
$this->dynamicIntegration = true;
|
||||
}
|
||||
if ($config['addGit'])
|
||||
if ($config['addRepo'])
|
||||
{
|
||||
$this->gitPath = $this->params->get('git_folder_path', null);
|
||||
$this->repoPath = $this->params->get('git_folder_path', null);
|
||||
}
|
||||
// remove site folder if not needed (TODO add check if custom script was moved to site folder then we must do a more complex cleanup here)
|
||||
if ($this->removeSiteFolder)
|
||||
@ -402,15 +402,15 @@ class Compiler extends Infusion
|
||||
|
||||
private function zipComponent()
|
||||
{
|
||||
// before we zip the component we first need to move it to the git folder if set
|
||||
if (ComponentbuilderHelper::checkString($this->gitPath))
|
||||
// before we zip the component we first need to move it to the repo folder if set
|
||||
if (ComponentbuilderHelper::checkString($this->repoPath))
|
||||
{
|
||||
// set the git path
|
||||
$this->gitPath = $this->gitPath.'/com_'.$this->componentData->sales_name.'__joomla_'.$this->joomlaVersion;
|
||||
// set the repo path
|
||||
$repoFullPath = $this->repoPath.'/com_'.$this->componentData->sales_name.'__joomla_'.$this->joomlaVersion;
|
||||
// remove old data
|
||||
$this->removeFolder($this->gitPath, $this->componentData->toignore);
|
||||
$this->removeFolder($repoFullPath, $this->componentData->toignore);
|
||||
// set the new data
|
||||
JFolder::copy($this->componentPath, $this->gitPath, '', true);
|
||||
JFolder::copy($this->componentPath, $repoFullPath, '', true);
|
||||
}
|
||||
// the name of the zip file to create
|
||||
$this->filepath = $this->tempPath.'/'.$this->componentFolderName.'.zip';
|
||||
|
@ -1051,7 +1051,7 @@ class Get
|
||||
$component->sales_server_ftp = 0;
|
||||
$component->add_sales_server = 0;
|
||||
}
|
||||
// set the ignore folders for git if found
|
||||
// set the ignore folders for repo if found
|
||||
if (isset($component->toignore) && ComponentbuilderHelper::checkString($component->toignore))
|
||||
{
|
||||
if (strpos($component->toignore, ',') !== false)
|
||||
@ -1065,7 +1065,7 @@ class Get
|
||||
}
|
||||
else
|
||||
{
|
||||
// the default is to ignore the git folder
|
||||
// the default is to ignore the repo folder
|
||||
$component->toignore = array('.git');
|
||||
}
|
||||
|
||||
@ -3387,26 +3387,24 @@ class Get
|
||||
}
|
||||
// if we have an array continue
|
||||
if (isset($this->multiLangString[$string]['translation'])
|
||||
&& ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation'])
|
||||
&& isset($this->multiLangString[$string]['translation']['translation'])
|
||||
&& isset($this->multiLangString[$string]['translation']['language'])
|
||||
&& ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation']['language'])
|
||||
&& ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation']['translation']))
|
||||
&& ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation']))
|
||||
{
|
||||
// great lets build the multi languages strings
|
||||
foreach ($this->multiLangString[$string]['translation']['translation'] as $at => $lang)
|
||||
foreach ($this->multiLangString[$string]['translation'] as $translations)
|
||||
{
|
||||
$_tag = $this->multiLangString[$string]['translation']['language'][$at];
|
||||
// build arrays
|
||||
if (!isset($this->languages[$_tag]))
|
||||
if (isset($translations['language']) && isset($translations['translation']))
|
||||
{
|
||||
$this->languages[$_tag] = array();
|
||||
// build arrays
|
||||
if (!isset($this->languages[$translations['language']]))
|
||||
{
|
||||
$this->languages[$translations['language']] = array();
|
||||
}
|
||||
if (!isset($this->languages[$translations['language']][$area]))
|
||||
{
|
||||
$this->languages[$translations['language']][$area] = array();
|
||||
}
|
||||
$this->languages[$translations['language']][$area][$placeholder] = $translations['translation'];
|
||||
}
|
||||
if (!isset($this->languages[$_tag][$area]))
|
||||
{
|
||||
$this->languages[$_tag][$area] = array();
|
||||
}
|
||||
$this->languages[$_tag][$area][$placeholder] = $lang;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -3628,7 +3626,7 @@ class Get
|
||||
elseif (ComponentbuilderHelper::checkJson($item['translation']))
|
||||
{
|
||||
$translation = json_decode($item['translation'], true);
|
||||
if (ComponentbuilderHelper::checkArray($translation) && ComponentbuilderHelper::checkArray($translation['translation']))
|
||||
if (ComponentbuilderHelper::checkArray($translation))
|
||||
{
|
||||
// only archive the item and update the string to unlink the current component
|
||||
$this->setUpdateExistingLangStrings($item['id'], $components, 2, $today, $counterUpdate);
|
||||
|
@ -810,14 +810,14 @@ class Structure extends Get
|
||||
|
||||
/**
|
||||
* Set the Static File & Folder
|
||||
*
|
||||
* @param array $target The main target and name
|
||||
*
|
||||
* @param array $target The main target and name
|
||||
* @param string $type The type in the target
|
||||
* @param string $fileName The custom file name
|
||||
* @param array $cofig to add more data to the files info
|
||||
*
|
||||
* @param array $cofig to add more data to the files info
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function buildDynamique($target, $type, $fileName = false, $config = false)
|
||||
{
|
||||
@ -1099,14 +1099,14 @@ class Structure extends Get
|
||||
/**
|
||||
* Remove folders with files
|
||||
*
|
||||
* @param string $dir The path to folder to remove
|
||||
* @param boolean $git if there is a git folder in that must not be removed
|
||||
* @param string $dir The path to folder to remove
|
||||
* @param boolean $ignore The files and folders to ignore
|
||||
*
|
||||
* @return boolean True if all is removed
|
||||
*
|
||||
*/
|
||||
protected function removeFolder($dir, $git = false)
|
||||
protected function removeFolder($dir, $ignore = false)
|
||||
{
|
||||
return ComponentbuilderHelper::removeFolder($dir, $git);
|
||||
return ComponentbuilderHelper::removeFolder($dir, $ignore);
|
||||
}
|
||||
}
|
||||
|
@ -3760,7 +3760,7 @@ class Interpretation extends Fields
|
||||
$script .= PHP_EOL."\t\t\t{";
|
||||
$script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." JSON Decode ".$jsonString.".";
|
||||
if (isset($this->jsonItemBuilderArray[$view])
|
||||
&& ComponentbuilderHelper::checkArray($this->jsonStringBuilderArray[$view])
|
||||
&& ComponentbuilderHelper::checkArray($this->jsonItemBuilderArray[$view])
|
||||
&& in_array($jsonString, $this->jsonItemBuilderArray[$view]))
|
||||
{
|
||||
$makeArray = ',true';
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.4
|
||||
@build 13th September, 2017
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.4
|
||||
@build 13th September, 2017
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage componentbuilderemail.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.4
|
||||
@build 13th September, 2017
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage headercheck.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.4
|
||||
@build 13th September, 2017
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage batch_.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.4
|
||||
@build 13th September, 2017
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage indenter.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.4
|
||||
@build 13th September, 2017
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage js.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.4
|
||||
@build 13th September, 2017
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage minify.php
|
||||
|
Reference in New Issue
Block a user