Fixes #39 to ensure components are build even if created and modified dates are not set. Improved #37 #issuecomment-278372267 to avoid one line error in windows.

This commit is contained in:
2017-02-09 18:11:10 +02:00
parent 3497de7c28
commit 5b5599575b
253 changed files with 20214 additions and 16025 deletions

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@version 2.3.0
@created 30th April, 2015
@package Component Builder
@subpackage compiler.php
@ -95,6 +95,13 @@ class Get
*/
protected $newCustomCode = array();
/**
* The index of code already loaded
*
* @var array
*/
protected $codeAreadyDone = array();
/**
* The Language prefix
*
@ -706,7 +713,7 @@ class Get
if ($component->add_php_helper_admin == 1)
{
$this->lang = 'admin';
$this->customScriptBuilder['component_php_helper_admin'] = "\n\n".$this->setCustomContentLang(base64_decode($component->php_helper_admin));
$this->customScriptBuilder['component_php_helper_admin'] = PHP_EOL.PHP_EOL.$this->setCustomContentLang(base64_decode($component->php_helper_admin));
}
else
{
@ -728,7 +735,7 @@ class Get
if ($component->add_php_helper_both == 1)
{
$this->lang = 'both';
$this->customScriptBuilder['component_php_helper_both'] = "\n\n".$this->setCustomContentLang(base64_decode($component->php_helper_both));
$this->customScriptBuilder['component_php_helper_both'] = PHP_EOL.PHP_EOL.$this->setCustomContentLang(base64_decode($component->php_helper_both));
}
else
{
@ -738,7 +745,7 @@ class Get
if ($component->add_php_helper_site == 1)
{
$this->lang = 'site';
$this->customScriptBuilder['component_php_helper_site'] = "\n\n".$this->setCustomContentLang(base64_decode($component->php_helper_site));
$this->customScriptBuilder['component_php_helper_site'] = PHP_EOL.PHP_EOL.$this->setCustomContentLang(base64_decode($component->php_helper_site));
}
else
{
@ -1535,7 +1542,7 @@ class Get
$this->_fieldData[$id]->javascript_view_footer = $this->setCustomContentLang(base64_decode($this->_fieldData[$id]->javascript_view_footer));
$this->_fieldData[$id]->javascript_view_footer_decoded = true;
}
$this->customScriptBuilder['view_footer'][$name_single] .= "\n".$this->_fieldData[$id]->javascript_view_footer;
$this->customScriptBuilder['view_footer'][$name_single] .= PHP_EOL.$this->_fieldData[$id]->javascript_view_footer;
if (strpos($this->_fieldData[$id]->javascript_view_footer,"token") !== false && strpos($this->_fieldData[$id]->javascript_view_footer,"task=ajax") !== false)
{
if (!isset($this->customScriptBuilder['token'][$name_single]) || !$this->customScriptBuilder['token'][$name_single])
@ -1565,7 +1572,7 @@ class Get
$this->_fieldData[$id]->css_view = base64_decode($this->_fieldData[$id]->css_view);
$this->_fieldData[$id]->css_view_decoded = true;
}
$this->customScriptBuilder['css_view'][$name_single] .= "\n".$this->_fieldData[$id]->css_view;
$this->customScriptBuilder['css_view'][$name_single] .= PHP_EOL.$this->_fieldData[$id]->css_view;
}
// add this only once to view.
@ -1674,7 +1681,7 @@ class Get
{
$this->customScriptBuilder[$this->target.'_php_before_getitem'][$view_code] = '';
}
$this->customScriptBuilder[$this->target.'_php_before_getitem'][$view_code] .= "\n\n".base64_decode($result->php_before_getitem);
$this->customScriptBuilder[$this->target.'_php_before_getitem'][$view_code] .= PHP_EOL.PHP_EOL.base64_decode($result->php_before_getitem);
unset($result->php_before_getitem);
}
// add php custom scripting (php_after_getitem)
@ -1684,7 +1691,7 @@ class Get
{
$this->customScriptBuilder[$this->target.'_php_after_getitem'][$view_code] = '';
}
$this->customScriptBuilder[$this->target.'_php_after_getitem'][$view_code] .= "\n\n".base64_decode($result->php_after_getitem);
$this->customScriptBuilder[$this->target.'_php_after_getitem'][$view_code] .= PHP_EOL.PHP_EOL.base64_decode($result->php_after_getitem);
unset($result->php_after_getitem);
}
// add php custom scripting (php_before_getitems)
@ -1694,7 +1701,7 @@ class Get
{
$this->customScriptBuilder[$this->target.'_php_before_getitems'][$view_code] = '';
}
$this->customScriptBuilder[$this->target.'_php_before_getitems'][$view_code] .= "\n\n".base64_decode($result->php_before_getitems);
$this->customScriptBuilder[$this->target.'_php_before_getitems'][$view_code] .= PHP_EOL.PHP_EOL.base64_decode($result->php_before_getitems);
unset($result->php_before_getitems);
}
// add php custom scripting (php_after_getitems)
@ -1704,7 +1711,7 @@ class Get
{
$this->customScriptBuilder[$this->target.'_php_after_getitems'][$view_code] = '';
}
$this->customScriptBuilder[$this->target.'_php_after_getitems'][$view_code] .= "\n\n".base64_decode($result->php_after_getitems);
$this->customScriptBuilder[$this->target.'_php_after_getitems'][$view_code] .= PHP_EOL.PHP_EOL.base64_decode($result->php_after_getitems);
unset($result->php_after_getitems);
}
// add php custom scripting (php_getlistquery)
@ -1714,7 +1721,7 @@ class Get
{
$this->customScriptBuilder[$this->target.'_php_getlistquery'][$view_code] = '';
}
$this->customScriptBuilder[$this->target.'_php_getlistquery'][$view_code] .= "\n".base64_decode($result->php_getlistquery);
$this->customScriptBuilder[$this->target.'_php_getlistquery'][$view_code] .= PHP_EOL.base64_decode($result->php_getlistquery);
unset($result->php_getlistquery);
}
// set the getmethod code name
@ -2256,7 +2263,7 @@ class Get
}
if (ComponentbuilderHelper::checkArray($gets) && ComponentbuilderHelper::checkArray($keys))
{
$querySelect = '$query->select($db->quoteName('."\n\t\t\t".'array('.implode(',',$gets).'),'."\n\t\t\t".'array('.implode(',',$keys).')));';
$querySelect = '$query->select($db->quoteName('.PHP_EOL."\t\t\t".'array('.implode(',',$gets).'),'.PHP_EOL."\t\t\t".'array('.implode(',',$keys).')));';
$queryFrom = '$db->quoteName('.$db->quote($table).', '.$db->quote($as).')';
// return the select query
return array('select' => $querySelect, 'from' => $queryFrom, 'name' => $queryName, 'table' => $table, 'type' => $type, 'select_gets' => $gets, 'select_keys' => $keys);
@ -2390,9 +2397,9 @@ class Get
$data = $db->loadObjectList();
// start building the MySql dump
$dump = "--";
$dump .= "\n-- Dumping data for table `#__[[[component]]]_".$view."`";
$dump .= "\n--";
$dump .= "\n\nINSERT INTO `#__[[[component]]]_".$view."` (";
$dump .= PHP_EOL."-- Dumping data for table `#__[[[component]]]_".$view."`";
$dump .= PHP_EOL."--";
$dump .= PHP_EOL.PHP_EOL."INSERT INTO `#__[[[component]]]_".$view."` (";
foreach ($data as $line)
{
$comaSet = 0;
@ -2416,11 +2423,11 @@ class Get
{
if ($coma == 0)
{
$dump .= "\n(";
$dump .= PHP_EOL."(";
}
else
{
$dump .= ",\n(";
$dump .= ",".PHP_EOL."(";
}
$comaSet = 0;
foreach($line as $fieldName => $fieldValue)
@ -2596,17 +2603,27 @@ class Get
* @return void
*
*/
public function getCustomCode()
public function getCustomCode($ids = null)
{
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.code','a.component','a.from_line','a.hashtarget','a.hashendtarget','a.path','a.to_line','a.type')));
$query->from($db->quoteName('#__componentbuilder_custom_code','a'));
$query->where($db->quoteName('a.component') . ' = '. (int) $this->componentData->id);
if ($ids)
{
$query->select($db->quoteName(array('a.id','a.code')));
$query->where($db->quoteName('a.id') . ' IN (' . implode(',',$ids) . ')');
$query->where($db->quoteName('a.target') . ' = 2'); // <--- to load the correct target
}
else
{
$query->select($db->quoteName(array('a.id','a.code','a.component','a.from_line','a.hashtarget','a.hashendtarget','a.path','a.to_line','a.type')));
$query->where($db->quoteName('a.component') . ' = '. (int) $this->componentData->id);
$query->where($db->quoteName('a.target') . ' = 1'); // <--- to load the correct target
$query->order($db->quoteName('a.from_line') . ' ASC'); // <--- insrue we always add code from top of file
}
$query->where($db->quoteName('a.published') . ' >= 1');
$query->order($db->quoteName('a.from_line') . ' ASC'); // <--- insrue we always add code from top of file
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
@ -2616,12 +2633,16 @@ class Get
foreach($this->customCode as $nr => &$customCode)
{
$customCode['code'] = base64_decode($customCode['code']);
$customCode['hashtarget'] = explode("__", $customCode['hashtarget']);
if ($customCode['type'] == 1 && strpos($customCode['hashendtarget'], '__') !== false)
if (isset($customCode['hashtarget']))
{
$customCode['hashendtarget'] = explode("__", $customCode['hashendtarget']);
$customCode['hashtarget'] = explode("__", $customCode['hashtarget']);
if ($customCode['type'] == 1 && strpos($customCode['hashendtarget'], '__') !== false)
{
$customCode['hashendtarget'] = explode("__", $customCode['hashendtarget']);
}
}
}
return true;
}
return false;
}
@ -2642,12 +2663,20 @@ class Get
// Create a new query object.
$query = $db->getQuery(true);
// Insert columns.
$columns = array('path','type','component','published','created','created_by','version','access','hashtarget','from_line','to_line','code','hashendtarget');
$columns = array('path','type','target','component','published','created','created_by','version','access','hashtarget','from_line','to_line','code','hashendtarget');
// Prepare the insert query.
$query->insert($db->quoteName('#__componentbuilder_custom_code'));
$query->columns($db->quoteName($columns));
foreach($this->newCustomCode as $values){
$query->values(implode(',', $values));
foreach($this->newCustomCode as $values)
{
if (count($values) == 14)
{
$query->values(implode(',', $values));
}
else
{
// TODO line mismatch... should not happen
}
}
// clear the values array
$this->newCustomCode = array();
@ -2759,7 +2788,17 @@ class Get
$pointer = array();
$reading = array();
$reader = 0;
$path = $target . '/' . str_replace('./', '', $file);
// make sure we have the path correct (the script file is not in admin path for example)
// there may be more... will nead to keep our eye on this... since files could be moved during install
$file = str_replace('./', '', $file);
if ($file !== 'script.php')
{
$path = $target . '/' . $file;
}
else
{
$path = $file;
}
foreach (new SplFileObject($file) as $lineNumber => $lineContent)
{
// we musk keep last few lines to dynamic find target entry later
@ -2771,8 +2810,8 @@ class Get
}
foreach ($placeholders as $type => $placeholder)
{
$i = (int) ($type === 3 ||$type === 4) ? 2 : 1;
$_type = (int) ($type === 1 || $type === 3) ? 1 : 2;
$i = (int) ($type == 3 ||$type == 4) ? 2 : 1;
$_type = (int) ($type == 1 || $type == 3) ? 1 : 2;
if ($reader === 0 || $reader === $i)
{
$targetKey = $type;
@ -2793,6 +2832,7 @@ class Get
// activate fingerPrint for replacement end target
$loadEndFingerPrint = true;
$backupTargetKey = $targetKey;
$backupI = $i;
}
// all new records we can do a bulk insert
if ($i === 1)
@ -2826,12 +2866,12 @@ class Get
if ($i === 1)
{
// load the last value
$this->newCustomCode[$pointer[$backupTargetKey]][] = $db->quote($hashendtarget); // 'hashendtarget'
$this->newCustomCode[$pointer[$targetKey]][] = $db->quote($hashendtarget); // 'hashendtarget'
}
// the record already exist so we must use module to update
elseif ($i === 2)
{
$this->existingCustomCode[$pointer[$backupTargetKey]]['fields'][] = $db->quoteName('hashendtarget') . ' = ' . $db->quote($hashendtarget);
$this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $db->quoteName('hashendtarget') . ' = ' . $db->quote($hashendtarget);
}
// reset the needed values
$endFingerPrint = array();
@ -2847,6 +2887,20 @@ class Get
// check if the starting place holder was found
if((!isset($reading[$targetKey]) || !$reading[$targetKey]) && (($i === 1 && trim($lineContent) === $start) || strpos($lineContent, $start) !== false))
{
if ($i === 2)
{
$id = $this->getSystemID($lineContent, $start);
}
if ($i === 2 && $id > 0)
{
// make sure we update it only once even if found again.
if (isset($this->codeAreadyDone[$id]))
{
continue;
}
// store the id to avoid duplication
$this->codeAreadyDone[$id] = (int) $id;
}
// set active reader (to lock out other search)
$reader = $i;
// set pointer
@ -2863,10 +2917,6 @@ class Get
$hashtarget = $hasleng.'__'.md5(implode('',$hasharray));
// do a quick check to insure we have an id
$id = false;
if ($i === 2)
{
$id = $this->getSystemID($lineContent, $start);
}
// all new records we can do a buldk insert
if ($i === 1 || !$id)
{
@ -2874,6 +2924,7 @@ class Get
$this->newCustomCode[$pointer[$targetKey]] = array();
$this->newCustomCode[$pointer[$targetKey]][] = $db->quote($path); // 'path'
$this->newCustomCode[$pointer[$targetKey]][] = $db->quote((int) $_type); // 'type'
$this->newCustomCode[$pointer[$targetKey]][] = $db->quote(1); // 'target'
$this->newCustomCode[$pointer[$targetKey]][] = $db->quote((int) $this->componentData->id); // 'component'
$this->newCustomCode[$pointer[$targetKey]][] = $db->quote(1); // 'published'
$this->newCustomCode[$pointer[$targetKey]][] = $db->quote($today); // 'created'
@ -2900,6 +2951,13 @@ class Get
$this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $db->quoteName('modified_by') . ' = ' . $db->quote($userId);
$this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $db->quoteName('hashtarget') . ' = ' . $db->quote($hashtarget);
}
else // this should actualy never happen
{
// de activate the reader
$reading[$targetKey] = false;
$reader = 0;
}
// update the counter
$counter[$i]++;
}
@ -2924,13 +2982,13 @@ class Get
$hashendtarget = 0;
}
// all new records we can do a buldk insert
if ($i === 1)
if ($backupI === 1)
{
// load the last value
$this->newCustomCode[$pointer[$backupTargetKey]][] = $db->quote($hashendtarget); // 'hashendtarget'
}
// the record already exist so we must use module to update
elseif ($i === 2)
elseif ($backupI === 2)
{
$this->existingCustomCode[$pointer[$backupTargetKey]]['fields'][] = $db->quoteName('hashendtarget') . ' = ' . $db->quote($hashendtarget);
}
@ -2970,7 +3028,7 @@ class Get
* @return array on success
*
*/
public function getPlaceHolder(&$type, &$id)
public function getPlaceHolder($type, &$id)
{
switch ($type)
{
@ -2985,8 +3043,8 @@ class Get
else
{
return array(
'start' => "\t\t//////////////////////////////////////////",
'end' => "\t\t//////////////////////////////////////////");
'start' => "/*////////////////////////////////////////*/",
'end' => "/*////////////////////////////////////////*/");
}
break;
case 2:
@ -3000,8 +3058,8 @@ class Get
else
{
return array(
'start' => "\t\t//////////////////////////////////////////",
'end' => "\t\t//////////////////////////////////////////");
'start' => "/*////////////////////////////////////////*/",
'end' => "/*////////////////////////////////////////*/");
}
break;
}

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@version 2.3.0
@created 30th April, 2015
@package Component Builder
@subpackage compiler.php
@ -513,14 +513,14 @@ class Structure extends Get
{
// set list view$view
$target = array('custom_admin' => $view['settings']->code);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => JFactory::getDate($view['settings']->modified)->format('jS F, Y'),'###VERSION###' => $view['settings']->version);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified,'###VERSION###' => $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###' => JFactory::getDate($view['settings']->modified)->format('jS F, Y'),'###VERSION###' => $view['settings']->version);
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified,'###VERSION###' => $view['settings']->version);
$this->buildDynamique($target, 'single', false, $config);
}
}
@ -811,7 +811,7 @@ class Structure extends Get
}
if (count($pathArray) == 1 && $firstFolder === 'media')
{
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= "\n\t\t<folder>".$lastFolder."</folder>";
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= 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###']))
@ -820,7 +820,7 @@ class Structure extends Get
}
if (count($pathArray) == 1 && $firstFolder === 'site')
{
$this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'] .= "\n\t\t<folder>".$lastFolder."</folder>";
$this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'] .= 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###']))
@ -829,7 +829,7 @@ class Structure extends Get
}
if (count($pathArray) == 1 && $firstFolder === 'admin')
{
$this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'] .= "\n\t\t\t<folder>".$lastFolder."</folder>";
$this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'] .= PHP_EOL."\t\t\t<folder>".$lastFolder."</folder>";
}
// make we have not duplicates
$key_pointer = ComponentbuilderHelper::safeString($custom['folder']).'_f'.$pointer_tracker;

View File

@ -11,7 +11,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@version 2.3.0
@created 30th April, 2015
@package Component Builder
@subpackage compiler.php
@ -382,7 +382,7 @@ class Fields extends Structure
$readOnly = "";
if ($view['settings']->type == 2)
{
$readOnly = "\t\t\t" . 'readonly="true"' . "\n\t\t\t" . 'disabled="true"';
$readOnly = "\t\t\t" . 'readonly="true"' . PHP_EOL."\t\t\t" . 'disabled="true"';
}
// main lang prefix
$langView = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($view['settings']->name_single, 'U');
@ -601,7 +601,7 @@ class Fields extends Structure
// check if metadata is added to this view
if (isset($this->metadataBuilder[$viewName]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$viewName]))
{
$fieldSet[] = "\n\t<!--" . $this->setLine(__LINE__) . " Metadata Fields. -->";
$fieldSet[] = PHP_EOL."\t<!--" . $this->setLine(__LINE__) . " Metadata Fields. -->";
$fieldSet[] = "\t<fields" . ' name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">';
$fieldSet[] = "\t\t" . '<fieldset name="vdmmetadata"';
$fieldSet[] = "\t\t\t" . 'label="JGLOBAL_FIELDSET_METADATA_OPTIONS">';
@ -634,7 +634,7 @@ class Fields extends Structure
$fieldSet[] = "\t</fields>";
}
// retunr the set
return implode("\n", $fieldSet);
return implode(PHP_EOL, $fieldSet);
}
return '';
}
@ -797,14 +797,14 @@ class Fields extends Structure
if ($setType === 'option')
{
// now add to the field set
$fieldSet .= "\n\t" . $taber . "\t<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->";
$fieldSet .= "\n\t" . $taber . "\t<field";
$fieldSet .= PHP_EOL."\t" . $taber . "\t<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->";
$fieldSet .= PHP_EOL."\t" . $taber . "\t<field";
$optionSet = '';
foreach ($fieldAttributes as $property => $value)
{
if ($property != 'option')
{
$fieldSet .= "\n\t\t" . $taber . "\t" . $property . '="' . $value . '"';
$fieldSet .= PHP_EOL."\t\t" . $taber . "\t" . $property . '="' . $value . '"';
}
elseif ($property === 'option')
{
@ -823,7 +823,7 @@ class Fields extends Structure
// add to lang array
$this->langContent[$this->lang][$langValue] = $t;
// no add to option set
$optionSet .= "\n\t" . $taber . "\t\t" . '<option value="' . $v . '">' . "\n\t" . $taber . "\t\t\t" . $langValue . '</option>';
$optionSet .= PHP_EOL."\t" . $taber . "\t\t" . '<option value="' . $v . '">' . PHP_EOL."\t" . $taber . "\t\t\t" . $langValue . '</option>';
$optionArray[$v] = $langValue;
}
else
@ -833,7 +833,7 @@ class Fields extends Structure
// add to lang array
$this->langContent[$this->lang][$langValue] = $option;
// no add to option set
$optionSet .= "\n\t\t" . $taber . "\t" . '<option value="' . $option . '">' . "\n\t\t" . $taber . "\t\t" . $langValue . '</option>';
$optionSet .= PHP_EOL."\t\t" . $taber . "\t" . '<option value="' . $option . '">' . PHP_EOL."\t\t" . $taber . "\t\t" . $langValue . '</option>';
$optionArray[$option] = $langValue;
}
}
@ -849,7 +849,7 @@ class Fields extends Structure
// add to lang array
$this->langContent[$this->lang][$langValue] = $t;
// no add to option set
$optionSet .= "\n\t\t" . $taber . "\t" . '<option value="' . $v . '">' . "\n\t\t" . $taber . "\t\t" . $langValue . '</option>';
$optionSet .= PHP_EOL."\t\t" . $taber . "\t" . '<option value="' . $v . '">' . PHP_EOL."\t\t" . $taber . "\t\t" . $langValue . '</option>';
$optionArray[$v] = $langValue;
}
else
@ -859,7 +859,7 @@ class Fields extends Structure
// add to lang array
$this->langContent[$this->lang][$langValue] = $value;
// no add to option set
$optionSet .= "\n\t\t" . $taber . "\t" . '<option value="' . $value . '">' . "\n\t\t" . $taber . "\t\t" . $langValue . '</option>';
$optionSet .= PHP_EOL."\t\t" . $taber . "\t" . '<option value="' . $value . '">' . PHP_EOL."\t\t" . $taber . "\t\t" . $langValue . '</option>';
$optionArray[$value] = $langValue;
}
}
@ -868,41 +868,41 @@ class Fields extends Structure
if (ComponentbuilderHelper::checkString($optionSet))
{
$fieldSet .= '>';
$fieldSet .= "\n\t\t\t" . $taber . "<!--" . $this->setLine(__LINE__) . " Option Set. -->";
$fieldSet .= PHP_EOL."\t\t\t" . $taber . "<!--" . $this->setLine(__LINE__) . " Option Set. -->";
$fieldSet .= $optionSet;
$fieldSet .= "\n\t\t" . $taber . "</field>";
$fieldSet .= PHP_EOL."\t\t" . $taber . "</field>";
}
elseif ($typeName === 'sql')
{
$optionArray = false;
$fieldSet .= "\n\t\t" . $taber . "/>";
$fieldSet .= PHP_EOL."\t\t" . $taber . "/>";
}
else
{
$optionArray = false;
$fieldSet .= "\n\t\t\t" . $taber . "<!--" . $this->setLine(__LINE__) . " No Manual Options Were Added In Field Settings. -->";
$fieldSet .= "\n\t\t" . $taber . "/>";
$fieldSet .= PHP_EOL."\t\t\t" . $taber . "<!--" . $this->setLine(__LINE__) . " No Manual Options Were Added In Field Settings. -->";
$fieldSet .= PHP_EOL."\t\t" . $taber . "/>";
}
}
elseif ($setType === 'plain')
{
// now add to the field set
$fieldSet .= "\n\t\t" . $taber . "<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->";
$fieldSet .= "\n\t\t" . $taber . "<field";
$fieldSet .= PHP_EOL."\t\t" . $taber . "<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->";
$fieldSet .= PHP_EOL."\t\t" . $taber . "<field";
foreach ($fieldAttributes as $property => $value)
{
if ($property != 'option')
{
$fieldSet .= "\n\t\t" . $taber . "\t" . $property . '="' . $value . '"';
$fieldSet .= PHP_EOL."\t\t" . $taber . "\t" . $property . '="' . $value . '"';
}
}
$fieldSet .= "\n\t\t" . $taber . "/>";
$fieldSet .= PHP_EOL."\t\t" . $taber . "/>";
}
elseif ($setType === 'spacer')
{
// now add to the field set
$fieldSet .= "\n\t\t<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". A None Database Field. (joomla) -->";
$fieldSet .= "\n\t\t<field";
$fieldSet .= PHP_EOL."\t\t<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". A None Database Field. (joomla) -->";
$fieldSet .= PHP_EOL."\t\t<field";
foreach ($fieldAttributes as $property => $value)
{
if ($property != 'option')
@ -918,19 +918,19 @@ class Fields extends Structure
if ($typeName === 'repeatable')
{
// now add to the field set
$fieldSet .= "\n\t\t<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->";
$fieldSet .= "\n\t\t<field";
$fieldSet .= PHP_EOL."\t\t<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (joomla) -->";
$fieldSet .= PHP_EOL."\t\t<field";
$fieldsSet = array();
foreach ($fieldAttributes as $property => $value)
{
if ($property != 'fields')
{
$fieldSet .= "\n\t\t\t" . $property . '="' . $value . '"';
$fieldSet .= PHP_EOL."\t\t\t" . $property . '="' . $value . '"';
}
}
$fieldSet .= ">";
$fieldSet .= "\n\t\t\t" . '<fields name="' . $fieldAttributes['name'] . '_fields" label="">';
$fieldSet .= "\n\t\t\t\t" . '<fieldset hidden="true" name="' . $fieldAttributes['name'] . '_modal" repeat="true">';
$fieldSet .= PHP_EOL."\t\t\t" . '<fields name="' . $fieldAttributes['name'] . '_fields" label="">';
$fieldSet .= PHP_EOL."\t\t\t\t" . '<fieldset hidden="true" name="' . $fieldAttributes['name'] . '_modal" repeat="true">';
if (strpos($fieldAttributes['fields'], ',') !== false)
{
// mulitpal fields
@ -999,24 +999,24 @@ class Fields extends Structure
}
}
}
$fieldSet .= "\n\t\t\t\t</fieldset>";
$fieldSet .= "\n\t\t\t</fields>";
$fieldSet .= "\n\t\t</field>";
$fieldSet .= PHP_EOL."\t\t\t\t</fieldset>";
$fieldSet .= PHP_EOL."\t\t\t</fields>";
$fieldSet .= PHP_EOL."\t\t</field>";
}
}
elseif ($setType === 'custom')
{
// now add to the field set
$fieldSet .= "\n\t\t" . $taber . "<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (custom) -->";
$fieldSet .= "\n\t\t" . $taber . "<field";
$fieldSet .= PHP_EOL."\t\t" . $taber . "<!--" . $this->setLine(__LINE__) . " " . ComponentbuilderHelper::safeString($name, 'F') . " Field. Type: " . ComponentbuilderHelper::safeString($typeName, 'F') . ". (custom) -->";
$fieldSet .= PHP_EOL."\t\t" . $taber . "<field";
foreach ($fieldAttributes as $property => $value)
{
if ($property != 'option')
{
$fieldSet .= "\n\t\t" . $taber . "\t" . $property . '="' . $value . '"';
$fieldSet .= PHP_EOL."\t\t" . $taber . "\t" . $property . '="' . $value . '"';
}
}
$fieldSet .= "\n\t\t" . $taber . "/>";
$fieldSet .= PHP_EOL."\t\t" . $taber . "/>";
// incase the field is in the config and has not been set
if ('config' === $viewName && 'configs' === $listViewName)
{
@ -1791,7 +1791,7 @@ class Fields extends Structure
// set tab and break replacements
$tabBreak = array(
'\t' => "\t",
'\n' => "\n"
'\n' => PHP_EOL
);
// make field dynamic
$replace = array(
@ -1822,7 +1822,7 @@ class Fields extends Structure
}
else
{
$phpCode .= "\n\t\t".str_replace(array_keys($tabBreak),array_values($tabBreak),$code);
$phpCode .= PHP_EOL."\t\t".str_replace(array_keys($tabBreak),array_values($tabBreak),$code);
}
}
}
@ -1855,7 +1855,7 @@ class Fields extends Structure
}
else
{
$phpxCode .= "\n\t\t".str_replace(array_keys($tabBreak),array_values($tabBreak),$code);
$phpxCode .= PHP_EOL."\t\t".str_replace(array_keys($tabBreak),array_values($tabBreak),$code);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.2.0
@version 2.3.0
@created 30th April, 2015
@package Component Builder
@subpackage compiler.php
@ -173,22 +173,22 @@ class Infusion extends Interpretation
if ($this->componentData->add_admin_event == 1)
{
// ###ADMIN_GLOBAL_EVENT###
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] = "\n\n".'// Triger the Global Admin Event';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] .= "\n".$this->fileContentStatic['###Component###'].'Helper::globalEvent($document);';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] = PHP_EOL.PHP_EOL.'// Triger the Global Admin Event';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] .= PHP_EOL.$this->fileContentStatic['###Component###'].'Helper::globalEvent($document);';
// ###ADMIN_GLOBAL_EVENT_HELPER###
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = "\n\n\t".'/**';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= "\n\t".'* The Global Admin Event Method.';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= "\n\t".'**/';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= "\n\t".'public static function globalEvent($document)';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= "\n\t".'{';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= "\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_php_admin_event']);
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= "\n\t".'}';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = PHP_EOL.PHP_EOL."\t".'/**';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'* The Global Admin Event Method.';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'**/';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'public static function globalEvent($document)';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'{';
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_php_admin_event']);
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'}';
}
// now load the readme file if needed
if ($this->componentData->addreadme == 1)
{
$this->fileContentStatic['###EXSTRA_ADMIN_FILES###'] .= "\n\t\t\t<filename>README.txt</filename>";
$this->fileContentStatic['###EXSTRA_ADMIN_FILES###'] .= PHP_EOL."\t\t\t<filename>README.txt</filename>";
}
// ###HELPER_CREATEUSER###
@ -254,6 +254,9 @@ class Infusion extends Interpretation
$this->placeholders['###view###'] = $viewName_single;
$this->placeholders['###VIEW###'] = $viewName_u;
$this->placeholders['###View###'] = $viewName_f;
$this->placeholders['[[[view]]]'] = $viewName_single;
$this->placeholders['[[[VIEW]]]'] = $viewName_u;
$this->placeholders['[[[View]]]'] = $viewName_f;
// set license per view if needed
$this->setLockLicensePer($viewName_single, $this->target);
@ -287,7 +290,7 @@ class Infusion extends Interpretation
{
// ###DOCUMENT_CUSTOM_PHP### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###DOCUMENT_CUSTOM_PHP###']
= "\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['php_document'][$viewName_single]);
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['php_document'][$viewName_single]);
// clear some memory
unset($this->customScriptBuilder['php_document'][$viewName_single]);
}
@ -324,16 +327,16 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$viewName_single]['###LINKEDVIEWMETHODS###'] = '';
// ###JMODELADMIN_BEFORE_DELETE### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_DELETE###'] = $this->getCustomScriptBuilder('php_before_delete', $viewName_single, "\n");
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_DELETE###'] = $this->getCustomScriptBuilder('php_before_delete', $viewName_single, PHP_EOL);
// ###JMODELADMIN_AFTER_DELETE### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_DELETE###'] = $this->getCustomScriptBuilder('php_after_delete', $viewName_single, "\n\n");
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_DELETE###'] = $this->getCustomScriptBuilder('php_after_delete', $viewName_single, PHP_EOL.PHP_EOL);
// ###JMODELADMIN_BEFORE_DELETE### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_PUBLISH###'] = $this->getCustomScriptBuilder('php_before_publish', $viewName_single, "\n");
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_PUBLISH###'] = $this->getCustomScriptBuilder('php_before_publish', $viewName_single, PHP_EOL);
// ###JMODELADMIN_AFTER_DELETE### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_PUBLISH###'] = $this->getCustomScriptBuilder('php_after_publish', $viewName_single, "\n\n");
$this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_PUBLISH###'] = $this->getCustomScriptBuilder('php_after_publish', $viewName_single, PHP_EOL.PHP_EOL);
// ###CHECKBOX_SAVE### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###CHECKBOX_SAVE###'] = $this->setCheckboxSave($viewName_single);
@ -342,7 +345,7 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$viewName_single]['###METHOD_ITEM_SAVE###'] = $this->setMethodItemSave($viewName_single);
// ###POSTSAVEHOOK### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###POSTSAVEHOOK###'] = $this->getCustomScriptBuilder('php_postsavehook', $viewName_single, "\n", null, true, "\n\t\treturn;", "\n\n\t\treturn;");
$this->fileContentDynamic[$viewName_single]['###POSTSAVEHOOK###'] = $this->getCustomScriptBuilder('php_postsavehook', $viewName_single, PHP_EOL, null, true, PHP_EOL."\t\treturn;", PHP_EOL.PHP_EOL."\t\treturn;");
if (isset($this->customScriptBuilder['css_view'][$viewName_single]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['css_view'][$viewName_single]))
{
@ -387,6 +390,9 @@ class Infusion extends Interpretation
$this->placeholders['###views###'] = $viewName_list;
$this->placeholders['###VIEWS###'] = $viewsName_u;
$this->placeholders['###Views###'] = $viewsName_f;
$this->placeholders['[[[views]]]'] = $viewName_list;
$this->placeholders['[[[VIEWS]]]'] = $viewsName_u;
$this->placeholders['[[[Views]]]'] = $viewsName_f;
// set the export/import option
if ($view['port'])
@ -424,7 +430,7 @@ class Infusion extends Interpretation
$this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_STRING_FIX###'] = $this->setGetItemsMethodStringFix($viewName_single,$this->fileContentStatic['###Component###']);
// ###GET_ITEMS_METHOD_AFTER_ALL### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_AFTER_ALL###'] = $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, "\n");
$this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_AFTER_ALL###'] = $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL);
// ###SELECTIONTRANSLATIONFIX### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###SELECTIONTRANSLATIONFIX###'] = $this->setSelectionTranslationFix($viewName_list,$this->fileContentStatic['###Component###']);
@ -554,7 +560,7 @@ class Infusion extends Interpretation
if ($view['edit_create_site_view'])
{
// add needed router stuff for front edit views
$this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] .= $this->routerParseSwitch($viewName_single);
$this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] .= $this->routerParseSwitch($viewName_single, null, false);
$this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] .= $this->routerBuildViews($viewName_single);
}
@ -661,7 +667,7 @@ class Infusion extends Interpretation
{
// ###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY###']
= "\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code]);
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code]);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code]);
}
@ -676,7 +682,7 @@ class Infusion extends Interpretation
{
// ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEMS###']
= "\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]);
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]);
}
@ -694,7 +700,7 @@ class Infusion extends Interpretation
{
// ###CUSTOM_ADMIN_AFTER_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEMS###']
= "\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]);
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]);
}
@ -730,10 +736,10 @@ class Infusion extends Interpretation
}
// ###VIEWARRAY###
$this->fileContentStatic['###VIEWARRAY###'] = "\n".implode(",\n",$viewarray);
$this->fileContentStatic['###VIEWARRAY###'] = PHP_EOL.implode(",".PHP_EOL,$viewarray);
// ###CUSTOM_ADMIN_EDIT_VIEW_ARRAY###
$this->fileContentStatic['###SITE_EDIT_VIEW_ARRAY###'] = "\n".implode(",\n",$site_edit_view_array);
$this->fileContentStatic['###SITE_EDIT_VIEW_ARRAY###'] = PHP_EOL.implode(",".PHP_EOL,$site_edit_view_array);
// ###MAINMENUS###
$this->fileContentStatic['###MAINMENUS###'] = $this->setMainMenus();
@ -930,7 +936,7 @@ class Infusion extends Interpretation
{
// ###SITE_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEMS###']
= "\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]);
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]);
}
@ -948,7 +954,7 @@ class Infusion extends Interpretation
{
// ###SITE_AFTER_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEMS###']
= "\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]);
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]);
}
@ -994,16 +1000,16 @@ class Infusion extends Interpretation
// now load the data for the global event if needed
if ($this->componentData->add_site_event == 1)
{
$this->fileContentStatic['###SITE_GLOBAL_EVENT###'] = "\n\n".'// Triger the Global Site Event';
$this->fileContentStatic['###SITE_GLOBAL_EVENT###'] .= "\n".$this->fileContentStatic['###Component###'].'Helper::globalEvent($document);';
$this->fileContentStatic['###SITE_GLOBAL_EVENT###'] = PHP_EOL.PHP_EOL.'// Triger the Global Site Event';
$this->fileContentStatic['###SITE_GLOBAL_EVENT###'] .= PHP_EOL.$this->fileContentStatic['###Component###'].'Helper::globalEvent($document);';
// ###SITE_GLOBAL_EVENT_HELPER###
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] = "\n\n\t".'/**';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= "\n\t".'* The Global Site Event Method.';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= "\n\t".'**/';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= "\n\t".'public static function globalEvent($document)';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= "\n\t".'{';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= "\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_php_site_event']);
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= "\n\t".'}';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] = PHP_EOL.PHP_EOL."\t".'/**';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'* The Global Site Event Method.';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'**/';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'public static function globalEvent($document)';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'{';
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_php_site_event']);
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'}';
}
// setup the layouts
$this->setCustomViewLayouts();
@ -1027,10 +1033,10 @@ class Infusion extends Interpretation
$this->fileContentStatic['###LANG_SITE_SYS###'] = $this->setLangSiteSys();
// ###PREINSTALLSCRIPT###
$this->fileContentStatic['###PREINSTALLSCRIPT###'] = $this->getCustomScriptBuilder('php_preflight', 'install', "\n", null, true);
$this->fileContentStatic['###PREINSTALLSCRIPT###'] = $this->getCustomScriptBuilder('php_preflight', 'install', PHP_EOL, null, true);
// ###PREUPDATESCRIPT###
$this->fileContentStatic['###PREUPDATESCRIPT###'] = $this->getCustomScriptBuilder('php_preflight', 'update', "\n", null, true);
$this->fileContentStatic['###PREUPDATESCRIPT###'] = $this->getCustomScriptBuilder('php_preflight', 'update', PHP_EOL, null, true);
// ###POSTINSTALLSCRIPT###
$this->fileContentStatic['###POSTINSTALLSCRIPT###'] = $this->setPostInstallScript();
@ -1045,7 +1051,7 @@ class Infusion extends Interpretation
$this->fileContentStatic['###HELPER_UIKIT###'] = $this->setUikitHelperMethods();
// ###CONFIG_FIELDSETS###
$this->fileContentStatic['###CONFIG_FIELDSETS###'] = implode("\n",$this->configFieldSets);
$this->fileContentStatic['###CONFIG_FIELDSETS###'] = implode(PHP_EOL,$this->configFieldSets);
// check if this has been set
if (!isset($this->fileContentStatic['###ROUTER_BUILD_VIEWS###']) || !ComponentbuilderHelper::checkString($this->fileContentStatic['###ROUTER_BUILD_VIEWS###']))