Updated compiler to allow dynamic update for language strings. Started adding the field relationship feature requested in gh-287

This commit is contained in:
2018-05-22 21:01:36 +02:00
parent 8488392fac
commit 2543d11277
61 changed files with 4858 additions and 1057 deletions

View File

@ -72,7 +72,7 @@ class Compiler extends Infusion
// first remove the files and folders
$this->removeFolder($this->componentPath . '/site');
// clear form component xml
$xmlPath = $this->componentPath . '/' . $this->fileContentStatic['###component###'] . '.xml';
$xmlPath = $this->componentPath . '/' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '.xml';
$componentXML = ComponentbuilderHelper::getFileContents($xmlPath);
$textToSite = ComponentbuilderHelper::getBetween($componentXML, '<files folder="site">', '</files>');
$textToSiteLang = ComponentbuilderHelper::getBetween($componentXML, '<languages folder="site">', '</languages>');
@ -215,16 +215,16 @@ class Compiler extends Infusion
{
if (JFile::exists($static['path']))
{
$this->fileContentStatic['###FILENAME###'] = $static['name'];
$this->fileContentStatic[$this->hhh . 'FILENAME' . $this->hhh] = $static['name'];
$php = '';
if (ComponentbuilderHelper::checkFileType($static['name'], 'php'))
{
$php = "<?php\n";
}
$string = ComponentbuilderHelper::getFileContents($static['path']);
if (strpos($string, '###BOM###') !== false)
if (strpos($string, $this->hhh . 'BOM' . $this->hhh) !== false)
{
list($wast, $code) = explode('###BOM###', $string);
list($wast, $code) = explode($this->hhh . 'BOM' . $this->hhh, $string);
$string = $php . $bom . $code;
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
// add to zip array
@ -250,7 +250,7 @@ class Compiler extends Infusion
{
if (JFile::exists($file['path']))
{
$this->fileContentStatic['###FILENAME###'] = $file['name'];
$this->fileContentStatic[$this->hhh . 'FILENAME' . $this->hhh] = $file['name'];
// do some weird stuff to improve the verion and dates being added to the license
$this->fixLicenseValues($file);
$php = '';
@ -259,9 +259,9 @@ class Compiler extends Infusion
$php = "<?php\n";
}
$string = ComponentbuilderHelper::getFileContents($file['path']);
if (strpos($string, '###BOM###') !== false)
if (strpos($string, $this->hhh . 'BOM' . $this->hhh) !== false)
{
list($bin, $code) = explode('###BOM###', $string);
list($bin, $code) = explode($this->hhh . 'BOM' . $this->hhh, $string);
$string = $php . $bom . $code;
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
$answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3);
@ -321,7 +321,7 @@ class Compiler extends Infusion
{
foreach ($data['config'] as $key => $value)
{
if ('###VERSION###' === $key)
if ($this->hhh . 'VERSION' . $this->hhh === $key)
{
// hmm we sould in some way make it known that this version number
// is not in relation the the project but to the file only... any ideas?
@ -340,9 +340,9 @@ class Compiler extends Infusion
return true;
}
// else insure to reset to global
$this->fileContentStatic['###CREATIONDATE###'] = $this->fileContentStatic['###CREATIONDATE###GLOBAL'];
$this->fileContentStatic['###BUILDDATE###'] = $this->fileContentStatic['###BUILDDATE###GLOBAL'];
$this->fileContentStatic['###VERSION###'] = $this->fileContentStatic['###VERSION###GLOBAL'];
$this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh . 'GLOBAL'];
$this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh . 'GLOBAL'];
$this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh . 'GLOBAL'];
}
// set all global numbers
@ -399,7 +399,7 @@ class Compiler extends Infusion
private function setReadMe($path)
{
// set readme data if not set already
if (!isset($this->fileContentStatic['###LINE_COUNT###']) || $this->fileContentStatic['###LINE_COUNT###'] != $this->lineCount)
if (!isset($this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh]) || $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] != $this->lineCount)
{
$this->buildReadMeData();
}
@ -414,39 +414,39 @@ class Compiler extends Infusion
private function buildReadMeData()
{
// set some defaults
$this->fileContentStatic['###LINE_COUNT###'] = $this->lineCount;
$this->fileContentStatic['###FIELD_COUNT###'] = $this->fieldCount;
$this->fileContentStatic['###FILE_COUNT###'] = $this->fileCount;
$this->fileContentStatic['###FOLDER_COUNT###'] = $this->folderCount;
$this->fileContentStatic['###PAGE_COUNT###'] = $this->pageCount;
$this->fileContentStatic['###folders###'] = $this->folderSeconds;
$this->fileContentStatic['###foldersSeconds###'] = $this->folderSeconds;
$this->fileContentStatic['###files###'] = $this->fileSeconds;
$this->fileContentStatic['###filesSeconds###'] = $this->fileSeconds;
$this->fileContentStatic['###lines###'] = $this->lineSeconds;
$this->fileContentStatic['###linesSeconds###'] = $this->lineSeconds;
$this->fileContentStatic['###seconds###'] = $this->actualSeconds;
$this->fileContentStatic['###actualSeconds###'] = $this->actualSeconds;
$this->fileContentStatic['###totalHours###'] = $this->totalHours;
$this->fileContentStatic['###totalDays###'] = $this->totalDays;
$this->fileContentStatic['###debugging###'] = $this->secondsDebugging;
$this->fileContentStatic['###secondsDebugging###'] = $this->secondsDebugging;
$this->fileContentStatic['###planning###'] = $this->secondsPlanning;
$this->fileContentStatic['###secondsPlanning###'] = $this->secondsPlanning;
$this->fileContentStatic['###mapping###'] = $this->secondsMapping;
$this->fileContentStatic['###secondsMapping###'] = $this->secondsMapping;
$this->fileContentStatic['###office###'] = $this->secondsOffice;
$this->fileContentStatic['###secondsOffice###'] = $this->secondsOffice;
$this->fileContentStatic['###actualTotalHours###'] = $this->actualTotalHours;
$this->fileContentStatic['###actualTotalDays###'] = $this->actualTotalDays;
$this->fileContentStatic['###debuggingHours###'] = $this->debuggingHours;
$this->fileContentStatic['###planningHours###'] = $this->planningHours;
$this->fileContentStatic['###mappingHours###'] = $this->mappingHours;
$this->fileContentStatic['###officeHours###'] = $this->officeHours;
$this->fileContentStatic['###actualHoursSpent###'] = $this->actualHoursSpent;
$this->fileContentStatic['###actualDaysSpent###'] = $this->actualDaysSpent;
$this->fileContentStatic['###projectWeekTime###'] = $this->projectWeekTime;
$this->fileContentStatic['###projectMonthTime###'] = $this->projectMonthTime;
$this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] = $this->lineCount;
$this->fileContentStatic[$this->hhh . 'FIELD_COUNT' . $this->hhh] = $this->fieldCount;
$this->fileContentStatic[$this->hhh . 'FILE_COUNT' . $this->hhh] = $this->fileCount;
$this->fileContentStatic[$this->hhh . 'FOLDER_COUNT' . $this->hhh] = $this->folderCount;
$this->fileContentStatic[$this->hhh . 'PAGE_COUNT' . $this->hhh] = $this->pageCount;
$this->fileContentStatic[$this->hhh . 'folders' . $this->hhh] = $this->folderSeconds;
$this->fileContentStatic[$this->hhh . 'foldersSeconds' . $this->hhh] = $this->folderSeconds;
$this->fileContentStatic[$this->hhh . 'files' . $this->hhh] = $this->fileSeconds;
$this->fileContentStatic[$this->hhh . 'filesSeconds' . $this->hhh] = $this->fileSeconds;
$this->fileContentStatic[$this->hhh . 'lines' . $this->hhh] = $this->lineSeconds;
$this->fileContentStatic[$this->hhh . 'linesSeconds' . $this->hhh] = $this->lineSeconds;
$this->fileContentStatic[$this->hhh . 'seconds' . $this->hhh] = $this->actualSeconds;
$this->fileContentStatic[$this->hhh . 'actualSeconds' . $this->hhh] = $this->actualSeconds;
$this->fileContentStatic[$this->hhh . 'totalHours' . $this->hhh] = $this->totalHours;
$this->fileContentStatic[$this->hhh . 'totalDays' . $this->hhh] = $this->totalDays;
$this->fileContentStatic[$this->hhh . 'debugging' . $this->hhh] = $this->secondsDebugging;
$this->fileContentStatic[$this->hhh . 'secondsDebugging' . $this->hhh] = $this->secondsDebugging;
$this->fileContentStatic[$this->hhh . 'planning' . $this->hhh] = $this->secondsPlanning;
$this->fileContentStatic[$this->hhh . 'secondsPlanning' . $this->hhh] = $this->secondsPlanning;
$this->fileContentStatic[$this->hhh . 'mapping' . $this->hhh] = $this->secondsMapping;
$this->fileContentStatic[$this->hhh . 'secondsMapping' . $this->hhh] = $this->secondsMapping;
$this->fileContentStatic[$this->hhh . 'office' . $this->hhh] = $this->secondsOffice;
$this->fileContentStatic[$this->hhh . 'secondsOffice' . $this->hhh] = $this->secondsOffice;
$this->fileContentStatic[$this->hhh . 'actualTotalHours' . $this->hhh] = $this->actualTotalHours;
$this->fileContentStatic[$this->hhh . 'actualTotalDays' . $this->hhh] = $this->actualTotalDays;
$this->fileContentStatic[$this->hhh . 'debuggingHours' . $this->hhh] = $this->debuggingHours;
$this->fileContentStatic[$this->hhh . 'planningHours' . $this->hhh] = $this->planningHours;
$this->fileContentStatic[$this->hhh . 'mappingHours' . $this->hhh] = $this->mappingHours;
$this->fileContentStatic[$this->hhh . 'officeHours' . $this->hhh] = $this->officeHours;
$this->fileContentStatic[$this->hhh . 'actualHoursSpent' . $this->hhh] = $this->actualHoursSpent;
$this->fileContentStatic[$this->hhh . 'actualDaysSpent' . $this->hhh] = $this->actualDaysSpent;
$this->fileContentStatic[$this->hhh . 'projectWeekTime' . $this->hhh] = $this->projectWeekTime;
$this->fileContentStatic[$this->hhh . 'projectMonthTime' . $this->hhh] = $this->projectMonthTime;
}
private function zipComponent()

View File

@ -18,6 +18,27 @@ defined('_JEXEC') or die('Restricted access');
class Get
{
/**
* The hash placeholder
*
* @var string
*/
public $hhh = '#' . '#' . '#';
/**
* The open bracket placeholder
*
* @var string
*/
public $bbb = '[' . '[' . '[';
/**
* The close bracket placeholder
*
* @var string
*/
public $ddd = ']' . ']' . ']';
/**
* The app
*
@ -834,12 +855,12 @@ class Get
$component = ComponentbuilderHelper::convertRepeatableFields($component, $searchRepeatables, $updater);
// set component place holders
$this->placeholders['###component###'] = ComponentbuilderHelper::safeString($component->name_code);
$this->placeholders['###Component###'] = ComponentbuilderHelper::safeString($component->name_code, 'F');
$this->placeholders['###COMPONENT###'] = ComponentbuilderHelper::safeString($component->name_code, 'U');
$this->placeholders['[[[component]]]'] = $this->placeholders['###component###'];
$this->placeholders['[[[Component]]]'] = $this->placeholders['###Component###'];
$this->placeholders['[[[COMPONENT]]]'] = $this->placeholders['###COMPONENT###'];
$this->placeholders[$this->hhh . 'component' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code);
$this->placeholders[$this->hhh . 'Component' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code, 'F');
$this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code, 'U');
$this->placeholders[$this->bbb . 'component' . $this->ddd] = $this->placeholders[$this->hhh . 'component' . $this->hhh];
$this->placeholders[$this->bbb . 'Component' . $this->ddd] = $this->placeholders[$this->hhh . 'Component' . $this->hhh];
$this->placeholders[$this->bbb . 'COMPONENT' . $this->ddd] = $this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh];
// set component sales name
$component->sales_name = ComponentbuilderHelper::safeString($component->system_name);
@ -1376,18 +1397,18 @@ class Get
$this->customScriptBuilder['token'][$name_single] = false;
$this->customScriptBuilder['token'][$name_list] = false;
// set some placeholders
$this->placeholders['###view###'] = ComponentbuilderHelper::safeString($name_single);
$this->placeholders['###views###'] = ComponentbuilderHelper::safeString($name_list);
$this->placeholders['###View###'] = ComponentbuilderHelper::safeString($name_single, 'F');
$this->placeholders['###Views###'] = ComponentbuilderHelper::safeString($name_list, 'F');
$this->placeholders['###VIEW###'] = ComponentbuilderHelper::safeString($name_single, 'U');
$this->placeholders['###VIEWS###'] = ComponentbuilderHelper::safeString($name_list, 'U');
$this->placeholders['[[[view]]]'] = $this->placeholders['###view###'];
$this->placeholders['[[[views]]]'] = $this->placeholders['###views###'];
$this->placeholders['[[[View]]]'] = $this->placeholders['###View###'];
$this->placeholders['[[[Views]]]'] = $this->placeholders['###Views###'];
$this->placeholders['[[[VIEW]]]'] = $this->placeholders['###VIEW###'];
$this->placeholders['[[[VIEWS]]]'] = $this->placeholders['###VIEWS###'];
$this->placeholders[$this->hhh . 'view' . $this->hhh] = ComponentbuilderHelper::safeString($name_single);
$this->placeholders[$this->hhh . 'views' . $this->hhh] = ComponentbuilderHelper::safeString($name_list);
$this->placeholders[$this->hhh . 'View' . $this->hhh] = ComponentbuilderHelper::safeString($name_single, 'F');
$this->placeholders[$this->hhh . 'Views' . $this->hhh] = ComponentbuilderHelper::safeString($name_list, 'F');
$this->placeholders[$this->hhh . 'VIEW' . $this->hhh] = ComponentbuilderHelper::safeString($name_single, 'U');
$this->placeholders[$this->hhh . 'VIEWS' . $this->hhh] = ComponentbuilderHelper::safeString($name_list, 'U');
$this->placeholders[$this->bbb . 'view' . $this->ddd] = $this->placeholders[$this->hhh . 'view' . $this->hhh];
$this->placeholders[$this->bbb . 'views' . $this->ddd] = $this->placeholders[$this->hhh . 'views' . $this->hhh];
$this->placeholders[$this->bbb . 'View' . $this->ddd] = $this->placeholders[$this->hhh . 'View' . $this->hhh];
$this->placeholders[$this->bbb . 'Views' . $this->ddd] = $this->placeholders[$this->hhh . 'Views' . $this->hhh];
$this->placeholders[$this->bbb . 'VIEW' . $this->ddd] = $this->placeholders[$this->hhh . 'VIEW' . $this->hhh];
$this->placeholders[$this->bbb . 'VIEWS' . $this->ddd] = $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh];
// add the tables
$view->addtables = (isset($view->addtables) && ComponentbuilderHelper::checkJson($view->addtables)) ? json_decode($view->addtables, true) : null;
if (ComponentbuilderHelper::checkArray($view->addtables))
@ -1819,18 +1840,18 @@ class Get
}
}
// clear placeholders
unset($this->placeholders['###view###']);
unset($this->placeholders['###views###']);
unset($this->placeholders['###View###']);
unset($this->placeholders['###Views###']);
unset($this->placeholders['###VIEW###']);
unset($this->placeholders['###VIEWS###']);
unset($this->placeholders['[[[view]]]']);
unset($this->placeholders['[[[views]]]']);
unset($this->placeholders['[[[View]]]']);
unset($this->placeholders['[[[Views]]]']);
unset($this->placeholders['[[[VIEW]]]']);
unset($this->placeholders['[[[VIEWS]]]']);
unset($this->placeholders[$this->hhh . 'view' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'views' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'View' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'Views' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'VIEW' . $this->hhh]);
unset($this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]);
unset($this->placeholders[$this->bbb . 'view' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'views' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'View' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'Views' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'VIEW' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'VIEWS' . $this->ddd]);
// store this view to class object
$this->_adminViewData[$id] = $view;
@ -3605,7 +3626,7 @@ class Get
if (ComponentbuilderHelper::checkArray($langStringTargets))
{
// insure string is not broken
$content = str_replace('COM_###COMPONENT###', $this->langPrefix, $content);
$content = str_replace('COM_' . $this->hhh . 'COMPONENT' . $this->hhh, $this->langPrefix, $content);
// reset some buckets
$langHolders = array();
$langCheck = array();
@ -3938,9 +3959,9 @@ class Get
$data = $this->db->loadObjectList();
// start building the MySql dump
$dump = "--";
$dump .= PHP_EOL . "-- Dumping data for table `#__[[[component]]]_" . $view . "`";
$dump .= PHP_EOL . "-- Dumping data for table `#__".$this->bbb."component".$this->ddd."_" . $view . "`";
$dump .= PHP_EOL . "--";
$dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__[[[component]]]_" . $view . "` (";
$dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__".$this->bbb."component".$this->ddd."_" . $view . "` (";
foreach ($data as $line)
{
$comaSet = 0;
@ -4442,7 +4463,7 @@ class Get
}
// check what type of place holders we should load here
$placeholderType = (int) $item['comment_type'] . '2';
if (stripos($item['code'], '[[[view') !== false || stripos($item['code'], '[[[sview') !== false || stripos($item['code'], '[[[arg') !== false)
if (stripos($item['code'], $this->bbb . 'view') !== false || stripos($item['code'], $this->bbb . 'sview') !== false || stripos($item['code'], $this->bbb . 'arg') !== false)
{
// if view is being set dynamicly then we can't update this code via IDE (TODO)
$placeholderType = 3;
@ -4472,7 +4493,7 @@ class Get
$number = 0;
foreach ($values as $value)
{
$this->placeholders['[[[' . $key . $number . ']]]'] = $value;
$this->placeholders[$this->bbb . $key . $number . $this->ddd] = $value;
$number++;
}
}
@ -5043,9 +5064,9 @@ class Get
$fileTypes = array('\.php', '\.js');
// set some local placeholders
$placeholders = array();
$placeholders[ComponentbuilderHelper::safeString($this->componentCodeName, 'F') . 'Helper::'] = '[[[Component]]]Helper::';
$placeholders['COM_' . ComponentbuilderHelper::safeString($this->componentCodeName, 'U')] = 'COM_[[[COMPONENT]]]';
$placeholders['com_' . $this->componentCodeName] = 'com_[[[component]]]';
$placeholders[ComponentbuilderHelper::safeString($this->componentCodeName, 'F') . 'Helper::'] = $this->bbb . 'Component' . $this->ddd . 'Helper::';
$placeholders['COM_' . ComponentbuilderHelper::safeString($this->componentCodeName, 'U')] = 'COM_' . $this->bbb . 'COMPONENT' . $this->ddd;
$placeholders['com_' . $this->componentCodeName] = 'com_' . $this->bbb . 'component' . $this->ddd;
foreach ($paths as $target => $path)
{
// we are changing the working directory to the componet path
@ -5760,7 +5781,7 @@ class Get
return round($val1 + $val2);
break;
// Subtract one number from the other
case 'add':
case 'sub':
return round($val1 - $val2);
break;
}

View File

@ -490,11 +490,11 @@ class Structure extends Get
if ($addLocalFolder)
{
// check if we sould add it to the media xml list
if (!isset($this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###']))
if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh]))
{
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] = '';
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] = '';
}
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL . "\t\t<folder>" . $libFolder . "</folder>";
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] .= PHP_EOL . "\t\t<folder>" . $libFolder . "</folder>";
}
}
// if config fields are found load into component config (avoiding dublicates)
@ -755,9 +755,10 @@ class Structure extends Get
// do license check
$LICENSE = false;
$licenseChecker = strtolower($this->componentData->license);
if (strpos($licenseChecker, 'gnu') !== false && strpos($licenseChecker, 'gpl') !== false)
if (strpos($licenseChecker, 'gnu') !== false && strpos($licenseChecker, '2') !== false &&
(strpos($licenseChecker, 'gpl') !== false || strpos($licenseChecker, 'general public license') !== false))
{
$LICENSE = true;
$LICENSE = true; // we only add version 2 auto at this time (TODO)
}
// do README check
$README = false;
@ -890,20 +891,20 @@ class Structure extends Get
if ($view['settings']->name_list != 'null')
{
$target = array('admin' => $view['settings']->name_list);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'list', false, $config);
}
if ($view['settings']->name_single != 'null')
{
$target = array('admin' => $view['settings']->name_single);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'single', false, $config);
}
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view'])
{
// setup the front site edit-view files
$target = array('site' => $view['settings']->name_single);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'edit', false, $config);
}
}
@ -927,14 +928,14 @@ class Structure extends Get
{
// set list view
$target = array('site' => $view['settings']->code);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'list', false, $config);
}
elseif ($view['settings']->main_get->gettype == 1)
{
// set single view
$target = array('site' => $view['settings']->code);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'single', false, $config);
}
}
@ -950,14 +951,14 @@ class Structure extends Get
{
// set list view$view
$target = array('custom_admin' => $view['settings']->code);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'list', false, $config);
}
elseif ($view['settings']->main_get->gettype == 1)
{
// set single view
$target = array('custom_admin' => $view['settings']->code);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
$config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version);
$this->buildDynamique($target, 'single', false, $config);
}
}
@ -1278,31 +1279,31 @@ class Structure extends Get
$newname = '';
}
// check if we sould add it to the media xml list
if (!isset($this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###']))
if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh]))
{
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] = '';
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] = '';
}
if (count($pathArray) == 1 && $firstFolder === 'media')
{
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL . "\t\t<folder>" . $lastFolder . "</folder>";
$this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] .= PHP_EOL . "\t\t<folder>" . $lastFolder . "</folder>";
}
// check if we sould add it to the site xml list
if (!isset($this->fileContentStatic['###EXSTRA_SITE_FOLDERS###']))
if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh]))
{
$this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'] = '';
$this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh] = '';
}
if (count($pathArray) == 1 && $firstFolder === 'site')
{
$this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'] .= PHP_EOL . "\t\t<folder>" . $lastFolder . "</folder>";
$this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh] .= PHP_EOL . "\t\t<folder>" . $lastFolder . "</folder>";
}
// check if we sould add it to the admin xml list
if (!isset($this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###']))
if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh]))
{
$this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'] = '';
$this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh] = '';
}
if (count($pathArray) == 1 && $firstFolder === 'admin')
{
$this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'] .= PHP_EOL . "\t\t\t<folder>" . $lastFolder . "</folder>";
$this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh] .= PHP_EOL . "\t\t\t<folder>" . $lastFolder . "</folder>";
}
// make we have not duplicates
$key_pointer = ComponentbuilderHelper::safeString($custom['folder']) . '_f' . $pointer_tracker;

View File

@ -384,8 +384,8 @@ class Fields extends Structure
$this->accessBuilder[$view_name_single] = $view_name_single;
}
// main lang prefix
$langView = $this->langPrefix . '_' . $this->placeholders['###VIEW###'];
$langViews = $this->langPrefix . '_' . $this->placeholders['###VIEWS###'];
$langView = $this->langPrefix . '_' . $this->placeholders[$this->hhh . 'VIEW' . $this->hhh];
$langViews = $this->langPrefix . '_' . $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh];
// set default lang
$this->langContent[$this->lang][$langView] = $view['settings']->name_single;
$this->langContent[$this->lang][$langViews] = $view['settings']->name_list;
@ -2696,17 +2696,17 @@ class Fields extends Structure
);
// make field dynamic
$replace = array(
'###TABLE###' => $data['custom']['table'],
'###ID###' => $data['custom']['id'],
'###TEXT###' => $data['custom']['text'],
'###CODE_TEXT###' => $data['code'] . '_' . $data['custom']['text'],
'###CODE###' => $data['code'],
'###component###' => $this->fileContentStatic['###component###'],
'###Component###' => $this->fileContentStatic['###Component###'],
'###view_type###' => $view_name_single . '_' . $data['type'],
'###type###' => $data['type'],
'###view###' => $view_name_single,
'###views###' => $view_name_list
$this->hhh . 'TABLE' . $this->hhh => $data['custom']['table'],
$this->hhh . 'ID' . $this->hhh => $data['custom']['id'],
$this->hhh . 'TEXT' . $this->hhh => $data['custom']['text'],
$this->hhh . 'CODE_TEXT' . $this->hhh => $data['code'] . '_' . $data['custom']['text'],
$this->hhh . 'CODE' . $this->hhh => $data['code'],
$this->hhh . 'component' . $this->hhh => $this->fileContentStatic[$this->hhh . 'component' . $this->hhh],
$this->hhh . 'Component' . $this->hhh => $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh],
$this->hhh . 'view_type' . $this->hhh => $view_name_single . '_' . $data['type'],
$this->hhh . 'type' . $this->hhh => $data['type'],
$this->hhh . 'view' . $this->hhh => $view_name_single,
$this->hhh . 'views' . $this->hhh => $view_name_list
);
// now load the php script
if (isset($data['custom']['php']) && ComponentbuilderHelper::checkArray($data['custom']['php']))
@ -2780,23 +2780,23 @@ class Fields extends Structure
$this->langContent[$this->lang][$groupLangName] = ComponentbuilderHelper::safeString($tempName, 'W');
// build the Group Control
$this->setGroupControl[$data['type']] = $groupLangName;
// ###JFORM_GETGROUPS_PHP### <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETGROUPS_PHP###'] = $phpCode;
// JFORM_GETGROUPS_PHP <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'JFORM_GETGROUPS_PHP' . $this->hhh] = $phpCode;
// ###JFORM_GETEXCLUDED_PHP### <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETEXCLUDED_PHP###'] = $phpxCode;
// JFORM_GETEXCLUDED_PHP <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'JFORM_GETEXCLUDED_PHP' . $this->hhh] = $phpxCode;
}
else
{
// ###JFORM_GETOPTIONS_PHP### <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETOPTIONS_PHP###'] = $phpCode;
// JFORM_GETOPTIONS_PHP <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'JFORM_GETOPTIONS_PHP' . $this->hhh] = $phpCode;
}
// ###Type### <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']]['###Type###'] = ComponentbuilderHelper::safeString($data['custom']['type'], 'F');
// ###type### <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']]['###type###'] = $data['custom']['type'];
// ###type### <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']]['###ADD_BUTTON###'] = $this->setAddButtonToListField($data['custom']);
// Type <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'Type' . $this->hhh] = ComponentbuilderHelper::safeString($data['custom']['type'], 'F');
// type <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'type' . $this->hhh] = $data['custom']['type'];
// type <<<DYNAMIC>>>
$this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'ADD_BUTTON' . $this->hhh] = $this->setAddButtonToListField($data['custom']);
}
}
@ -2818,15 +2818,15 @@ class Fields extends Structure
// check that the component value is set
if (!isset($fieldData['component']) || !ComponentbuilderHelper::checkString($fieldData['component']))
{
$fieldData['component'] = "com_" . $this->fileContentStatic['###component###'];
$fieldData['component'] = "com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh];
}
// check that the componet has the com_ value in it
if (strpos($fieldData['component'], 'com_') === false || strpos($fieldData['component'], '=') !== false)
{
$fieldData['component'] = "com_" . $fieldData['component'];
}
// make sure the component is update if ### or [[[ component placeholder is used
if (strpos($fieldData['component'], '###') !== false || strpos($fieldData['component'], '[[[') !== false) // should not be needed... but
// make sure the component is update if # # # or [ [ [ component placeholder is used
if (strpos($fieldData['component'], $this->hhh) !== false || strpos($fieldData['component'], $this->bbb) !== false) // should not be needed... but
{
$fieldData['component'] = $this->setPlaceholders($fieldData['component'], $this->placeholders);
}
@ -2841,7 +2841,7 @@ class Fields extends Structure
// set switch to activate easy update
$coreLoad = true;
// since the view is local to the component use this component name
$component = "com_" . $this->fileContentStatic['###component###'];
$component = "com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh];
}
else
{

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3085,15 +3085,15 @@ abstract class ComponentbuilderHelper
}
/**
* Move File to Server
*
* @param string $localPath The local path to the file
* @param string $fileName The the actual file name
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return bool true on success
* Move File to Server
*
* @param string $localPath The local path to the file
* @param string $fileName The the actual file name
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return bool true on success
**/
public static function moveToServer($localPath, $fileName, $serverID, $protocol = null, $permission = 'core.export')
{
@ -3128,23 +3128,23 @@ abstract class ComponentbuilderHelper
}
/**
* the SFTP objects
* the SFTP objects
**/
protected static $sftp = array();
/**
* the FTP objects
* the FTP objects
**/
protected static $ftp = array();
/**
* get the server object
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success server object
* get the server object
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success server object
**/
public static function getServer($serverID, $protocol = null, $permission = 'core.export')
{
@ -3167,12 +3167,12 @@ abstract class ComponentbuilderHelper
}
/**
* get the sftp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with sftp power
* get the sftp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with sftp power
**/
public static function getSftp($serverID, $permission = 'core.export')
{
@ -3326,12 +3326,12 @@ abstract class ComponentbuilderHelper
}
/**
* get the JClientFtp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with ftp power
* get the JClientFtp object
*
* @param int $serverID The server local id to use
* @param string $permission The permission validation area
*
* @return object on success with ftp power
**/
public static function getFtp($serverID, $permission)
{
@ -3417,13 +3417,13 @@ abstract class ComponentbuilderHelper
}
/**
* get the server details
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success with server details
* get the server details
*
* @param int $serverID The server local id to use
* @param int $protocol The server protocol to use
* @param string $permission The permission validation area
*
* @return object on success with server details
**/
public static function getServerDetails($serverID, $protocol = 2, $permission = 'core.export')
{