Stable release of the automatic import of custom code, and the JCB manual placeholder implementation resolves #37 please view https://youtu.be/KiAtJawZ3oo

This commit is contained in:
2017-02-11 04:24:26 +02:00
parent 5b5599575b
commit de008d5907
200 changed files with 818 additions and 591 deletions

View File

@ -53,6 +53,7 @@ class Compiler extends Infusion
*/
public function __construct($config = array ())
{
// $time_start = microtime(true);
// first we run the perent constructor
if (parent::__construct($config))
{
@ -100,8 +101,6 @@ class Compiler extends Infusion
// get the custom code from installed files
$this->customCodeFactory($paths, $db, $userId, $today);
}
// check if we have custom code to add
$this->getCustomCode();
// now add the other custom code by placeholder
if (ComponentbuilderHelper::checkArray($this->addCustomCodeAt))
{
@ -109,6 +108,8 @@ class Compiler extends Infusion
$app = JFactory::getApplication();
$this->addCustomCodeViaPlaceholders($app);
}
// check if we have custom code to add
$this->getCustomCode();
// now insert into the new files
if (ComponentbuilderHelper::checkArray($this->customCode))
{
@ -124,6 +125,9 @@ class Compiler extends Infusion
// done
return false;
}
// $time_end = microtime(true);
// $time = $time_end - $time_start;
// var_dump("Did Test in ($time seconds)");die;
return true;
}
return false;
@ -173,7 +177,8 @@ class Compiler extends Infusion
if (strpos($string,'###BOM###') !== false)
{
list($wast,$code) = explode('###BOM###',$string);
$answer = str_replace(array_keys($this->fileContentStatic),array_values($this->fileContentStatic),$php.$bom.$code);
$string = $php.$bom.$code;
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
// add custom Code by placeholder if found
$this->getPlaceHolderKeys($static['path'], $answer);
// add to zip array
@ -181,7 +186,7 @@ class Compiler extends Infusion
}
else
{
$answer = str_replace(array_keys($this->fileContentStatic),array_values($this->fileContentStatic),$string);
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
// add custom Code by placeholder if found
$this->getPlaceHolderKeys($static['path'], $answer);
// add to zip array
@ -213,8 +218,9 @@ class Compiler extends Infusion
if (strpos($string,'###BOM###') !== false)
{
list($bin,$code) = explode('###BOM###',$string);
$answer = str_replace(array_keys($this->fileContentStatic),array_values($this->fileContentStatic),$php.$bom.$code);
$answer = str_replace(array_keys($this->fileContentDynamic[$view]),array_values($this->fileContentDynamic[$view]),$answer);
$string = $php.$bom.$code;
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
$answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3);
// add custom Code by placeholder if found
$this->getPlaceHolderKeys($file['path'], $answer, $view);
// add to zip array
@ -222,8 +228,8 @@ class Compiler extends Infusion
}
else
{
$answer = str_replace(array_keys($this->fileContentStatic),array_values($this->fileContentStatic),$string);
$answer = str_replace(array_keys($this->fileContentDynamic[$view]),array_values($this->fileContentDynamic[$view]),$answer);
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
$answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3);
// add custom Code by placeholder if found
$this->getPlaceHolderKeys($file['path'], $answer, $view);
// add to zip array
@ -267,14 +273,50 @@ class Compiler extends Infusion
{
$this->addCustomCodeAt[$file] = array();
$this->addCustomCodeAt[$file]['ids'] = array();
$this->addCustomCodeAt[$file]['replace'] = array();
$this->addCustomCodeAt[$file]['args'] = array();
$this->addCustomCodeAt[$file]['view'] = $view;
}
$found = ComponentbuilderHelper::getAllBetween($content, '[CUSTO'.'MCODE=', ']');
if (ComponentbuilderHelper::checkArray($found))
{
foreach ($found as $id)
foreach ($found as $key)
{
// check if we have args
if (is_numeric($key))
{
$id = (int) $key;
}
elseif (strpos($key, '+') !== false)
{
$array = explode('+', $key);
// set ID
$id = (int) $array[0];
// load args for this ID
if (isset($array[1]))
{
if (!isset($this->addCustomCodeAt[$file]['args'][$id]))
{
$this->addCustomCodeAt[$file]['args'][$id] = array();
}
// only load if not already loaded
if (!isset($this->addCustomCodeAt[$file]['args'][$id][$key]))
{
if (strpos($array[1], ',') !== false)
{
$this->addCustomCodeAt[$file]['args'][$id][$key] = array_map('trim', explode(',', $array[1]));
}
elseif (ComponentbuilderHelper::checkString($array[1]))
{
$this->addCustomCodeAt[$file]['args'][$id][$key] = array();
$this->addCustomCodeAt[$file]['args'][$id][$key][] = trim($array[1]);
}
}
}
}
else
{
continue;
}
$this->addCustomCodeAt[$file]['ids'][$id] = $id;
}
}
@ -293,7 +335,7 @@ class Compiler extends Infusion
unset($this->componentData->custom_admin_views);
unset($this->componentData->config);
unset($this->joomlaVersionData);
unset($this->langContent);
// unset($this->langContent);
unset($this->dbKeys);
unset($this->permissionBuilder);
unset($this->layoutBuilder);
@ -425,7 +467,7 @@ class Compiler extends Infusion
// get the file
$string = JFile::read($path);
// update the file
$answer = str_replace(array_keys($this->fileContentStatic),array_values($this->fileContentStatic),$string);
$answer = $this->setPlaceholders($string, $this->fileContentStatic);
// add to zip array
$this->writeFile($path,$answer);
}
@ -633,30 +675,7 @@ class Compiler extends Infusion
protected function addCustomCodeViaPlaceholders($app)
{
// reset all these
unset($this->placeholders['###view###']);
unset($this->placeholders['###VIEW###']);
unset($this->placeholders['###View###']);
unset($this->placeholders['[[[view]]]']);
unset($this->placeholders['[[[VIEW]]]']);
unset($this->placeholders['[[[View]]]']);
unset($this->placeholders['###views###']);
unset($this->placeholders['###VIEWS###']);
unset($this->placeholders['###Views###']);
unset($this->placeholders['[[[views]]]']);
unset($this->placeholders['[[[VIEWS]]]']);
unset($this->placeholders['[[[Views]]]']);
unset($this->placeholders['###SView###']);
unset($this->placeholders['###sview###']);
unset($this->placeholders['###SVIEW###']);
unset($this->placeholders['[[[SView]]]']);
unset($this->placeholders['[[[sview]]]']);
unset($this->placeholders['[[[SVIEW]]]']);
unset($this->placeholders['###SViews###']);
unset($this->placeholders['###sviews###']);
unset($this->placeholders['###SVIEWS###']);
unset($this->placeholders['[[[SViews]]]']);
unset($this->placeholders['[[[sviews]]]']);
unset($this->placeholders['[[[SVIEWS]]]']);
$this->clearFromPlaceHolders('view');
foreach ($this->addCustomCodeAt as $path => $item)
{
if (ComponentbuilderHelper::checkString($item['view']))
@ -670,14 +689,13 @@ class Compiler extends Infusion
if ($this->getCustomCode($item['ids']))
{
$code = array();
foreach($this->customCode as $item)
foreach($this->customCode as $dbitem)
{
$placeholder = $this->getPlaceHolder(2, $item['id']);
$code['[CUSTOM'.'CODE='.$item['id'].']'] = $placeholder['start'] . PHP_EOL . str_replace(array_keys($this->placeholders),array_values($this->placeholders),$item['code']) . $placeholder['end'];
$this->buildCustomCodeForPlaceholders($item, $dbitem, $code);
}
// now update the file
$string = JFile::read($path);
$answer = str_replace(array_keys($code),array_values($code),$string);
$answer = $this->setPlaceholders($string, $code);
$this->writeFile($path,$answer);
}
else
@ -687,8 +705,68 @@ class Compiler extends Infusion
}
}
protected function buildCustomCodeForPlaceholders(&$at, &$item, &$code)
{
// check if there is args for this code
if (isset($at['args'][$item['id']]) && ComponentbuilderHelper::checkArray($at['args'][$item['id']]))
{
// since we have args we cant update this code via editor (TODO)
$placeholder = $this->getPlaceHolder(3, null);
// we have args and so need to load each
foreach ($at['args'][$item['id']] as $key => $args)
{
$this->setThesePlaceHolders('arg', $args);
$code['[CUSTOM'.'CODE='.$key.']'] = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($item['code'], $this->placeholders). $placeholder['end'];
}
}
else
{
// check what type of place holders we should load here (if view is being updated then we can't use inserted)
$placeholderType = 2;
if (strpos($item['code'], '[[[view]]]') !== false)
{
// since we have views we can't update this code via editor (TODO)
$placeholderType = 3;
}
// if now ars were found, clear it
$this->clearFromPlaceHolders('arg');
// load args for this code
$placeholder = $this->getPlaceHolder($placeholderType, $item['id']);
$code['[CUSTOM'.'CODE='.$item['id'].']'] = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($item['code'], $this->placeholders). $placeholder['end'];
}
}
protected function setThesePlaceHolders($key, $values)
{
// aways fist reset these
$this->clearFromPlaceHolders($key);
if (ComponentbuilderHelper::checkArray($values))
{
$number = 0;
foreach ($values as $value)
{
$this->placeholders['[[['.$key.$number.']]]'] = $value;
$number++;
}
}
}
protected function clearFromPlaceHolders($like)
{
foreach ($this->placeholders as $something => $value)
{
if (stripos($something, $like) !== false)
{
unset($this->placeholders[$something]);
}
}
}
protected function addCustomCode($app)
{
// reset all these
$this->clearFromPlaceHolders('view');
$this->clearFromPlaceHolders('arg');
foreach($this->customCode as $nr => $target)
{
// reset each time per custom code
@ -718,7 +796,7 @@ class Compiler extends Infusion
$foundEnd = true;
}
$counter = 0;
// check if file is new structure
// check if file exist
if (JFile::exists($file))
{
foreach (new SplFileObject($file) as $lineNumber => $lineContent)
@ -783,7 +861,7 @@ class Compiler extends Infusion
if ($found)
{
$placeholder = $this->getPlaceHolder($target['type'], $target['id']);
$data = $placeholder['start'] . PHP_EOL . $target['code'] . $placeholder['end'];
$data = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($target['code'], $this->placeholders). $placeholder['end'];
if ($target['type'] == 2)
{
// found it now add code from the next line
@ -842,23 +920,31 @@ class Compiler extends Infusion
// Thanks to http://stackoverflow.com/a/16813550/1429677
protected function addDataToFile($file, $data, $position, $replace = null)
{
// start the process
$fpFile = fopen($file, "rw+");
$fpTemp = fopen('php://temp', "rw+");
$len = stream_copy_to_stream($fpFile, $fpTemp); // make a copy
fseek($fpFile, $position); // move to the position
// make a copy of the file
stream_copy_to_stream($fpFile, $fpTemp);
// move to the position where we should add the data
fseek($fpFile, $position);
// Add the data
fwrite($fpFile, $data);
// truncate file at the end of the data that was added
$remove = bcadd($position, mb_strlen($data, '8bit'));
ftruncate($fpFile, $remove);
// check if this was a replacement of data
if ($replace)
{
$position = bcadd($position, $replace);
}
fseek($fpTemp, $position); // move to the position
fwrite($fpFile, $data); // Add the data
// move to the position of the data that should remain below the new data
fseek($fpTemp, $position);
// copy that remaining data to the file
stream_copy_to_stream($fpTemp, $fpFile); // @Jack
fclose($fpFile); // close file
fclose($fpTemp); // close tmp
// done close both files
fclose($fpFile);
fclose($fpTemp);
// any help to improve this is welcome...
}
}

View File

@ -54,7 +54,7 @@ class Get
/* The custom script placeholders - we use the (xxx) to avoid detection it should be (***)
*
* New Insert Code = /xxx[INSERT<>$$$$]xxx/ /xxx[/INSERT<>$$$$]xxx/
* New Insert Code = /xxx[INSERT<>$$$$]xxx/ /xxx[/INSERT<>$$$$]xxx/
* New Replace Code = /xxx[REPLACE<>$$$$]xxx/ /xxx[/REPLACE<>$$$$]xxx/
*
* //////////////////////////// when JCB adds it back ///////////////////////////////
@ -2177,7 +2177,7 @@ class Get
$langHolders["JText::sprintf('".$string."',"] = "JText::sprintf('".$keyLang."',";
$langHolders['JText::sprintf("'.$string.'",'] = 'JText::sprintf("'.$keyLang.'",';
}
$content = str_replace(array_keys($langHolders),array_values($langHolders),$content);
$content = $this->setPlaceholders($content, $langHolders);
}
return $content;
}
@ -2662,6 +2662,7 @@ class Get
{
// Create a new query object.
$query = $db->getQuery(true);
$continue = false;
// Insert columns.
$columns = array('path','type','target','component','published','created','created_by','version','access','hashtarget','from_line','to_line','code','hashendtarget');
// Prepare the insert query.
@ -2672,6 +2673,7 @@ class Get
if (count($values) == 14)
{
$query->values(implode(',', $values));
$continue = true;
}
else
{
@ -2680,6 +2682,10 @@ class Get
}
// clear the values array
$this->newCustomCode = array();
if (!$continue)
{
return false; // insure we dont continue if no values were loaded
}
// Set the query using our newly populated query object and execute it.
$db->setQuery($query);
$db->execute();
@ -2729,7 +2735,12 @@ class Get
{
// we must first store the current woking directory
$joomla = getcwd();
$counter = array(1 => 0, 2 => 0);
$counter = array(1 => 0, 2 => 0);
// set some local placeholders
$placeholders = array();
$placeholders[$this->fileContentStatic['###Component###'].'Helper::'] = '[[[Component]]]Helper::';
$placeholders['com_'.$this->fileContentStatic['###component###']] = 'com_[[[component]]]';
$placeholders['COM_'.$this->fileContentStatic['###COMPONENT###']] = 'COM_[[[COMPONENT]]]';
foreach ($paths as $target => $path)
{
// we are changing the working directory to the componet path
@ -2738,7 +2749,7 @@ class Get
$files = JFolder::files('.', '\.php', true, true);
foreach ($files as $file)
{
$this->searchFileContent($counter, $file, $target, $this->customCodePlaceholders, $db, $userId, $today);
$this->searchFileContent($counter, $file, $target, $this->customCodePlaceholders, $placeholders, $db, $userId, $today);
// insert new code
if (ComponentbuilderHelper::checkArray($this->newCustomCode))
{
@ -2770,7 +2781,8 @@ class Get
*
* @param array $counter The counter for the arrays
* @param string $file The file path to search
* @param array $placeholders The values to search for
* @param array $searchArray The values to search for
* @param array $placeholders The values to replace in the code being stored
* @param object $db The database object
* @param int $userId The user id
* @param string $today The date for today
@ -2778,7 +2790,7 @@ class Get
* @return array on success
*
*/
protected function searchFileContent(&$counter, &$file, &$target, &$placeholders, &$db, &$userId, &$today)
protected function searchFileContent(&$counter, &$file, &$target, &$searchArray, &$placeholders, &$db, &$userId, &$today)
{
// reset each time per file
$loadEndFingerPrint = false;
@ -2798,7 +2810,7 @@ class Get
else
{
$path = $file;
}
}
foreach (new SplFileObject($file) as $lineNumber => $lineContent)
{
// we musk keep last few lines to dynamic find target entry later
@ -2808,15 +2820,15 @@ class Get
{
$endFingerPrint[$lineNumber] = trim($lineContent);
}
foreach ($placeholders as $type => $placeholder)
foreach ($searchArray as $type => $search)
{
$i = (int) ($type == 3 ||$type == 4) ? 2 : 1;
$_type = (int) ($type == 1 || $type == 3) ? 1 : 2;
if ($reader === 0 || $reader === $i)
{
$targetKey = $type;
$start = '/***['.$placeholder.'***/';
$end = '/***[/'.$placeholder.'***/';
$start = '/***['.$search.'***/';
$end = '/***[/'.$search.'***/';
// check if the ending place holder was found
if(isset($reading[$targetKey]) && $reading[$targetKey] && (trim($lineContent) === $end || strpos($lineContent, $end) !== false))
{
@ -2882,11 +2894,13 @@ class Get
// then read in the code
if (isset($reading[$targetKey]) && $reading[$targetKey])
{
$codeBucket[$pointer[$targetKey]][] = $lineContent;
$codeBucket[$pointer[$targetKey]][] = $this->setPlaceholders($lineContent, $placeholders, 2, 2); // <-- this could solve our placholder issue
}
// check if the starting place holder was found
if((!isset($reading[$targetKey]) || !$reading[$targetKey]) && (($i === 1 && trim($lineContent) === $start) || strpos($lineContent, $start) !== false))
{
// do a quick check to insure we have an id
$id = false;
if ($i === 2)
{
$id = $this->getSystemID($lineContent, $start);
@ -2915,8 +2929,6 @@ class Get
$hasharray = array_slice($fingerPrint, -$inFinger, $getFinger, true);
$hasleng = count($hasharray);
$hashtarget = $hasleng.'__'.md5(implode('',$hasharray));
// do a quick check to insure we have an id
$id = false;
// all new records we can do a buldk insert
if ($i === 1 || !$id)
{
@ -3019,6 +3031,87 @@ class Get
return false;
}
/**
* Update the data with the placeholders
*
* @param string $data The actual date
* @param array $placeholder The placeholders
*
* @return string
*
*/
public function setPlaceholders(&$data, &$placeholder, $action = 1, $langSwitch = 0)
{
// check if we should reverse the lang strings <-- for custom coding
if (2 == $langSwitch)
{
$langArray1 = ComponentbuilderHelper::getAllBetween($data,'JText::_("','")');
$langArray2 = ComponentbuilderHelper::getAllBetween($data,"JText::_('","')");
$langArray = ComponentbuilderHelper::mergeArrays(array($langArray1,$langArray2));
if (ComponentbuilderHelper::checkArray($langArray))
{
$_tmp = array();
$targets = array('admin','site','','sitesys','adminsys');
foreach ($langArray as $lang)
{
$found = false;
foreach ($targets as $in)
{
if (!$found && isset($this->langContent[$in][$lang]))
{
$_tmp[$lang] = $this->langContent[$in][$lang];
$found = true;
}
}
}
// now update
if (ComponentbuilderHelper::checkArray($_tmp))
{
$data = str_replace(array_keys($_tmp),array_values($_tmp),$data);
}
}
}
if (1 == $action) // <-- just replace (default)
{
return str_replace(array_keys($placeholder),array_values($placeholder),$data);
}
elseif (2 == $action) // <-- check if data string has placeholders
{
$replace = false;
foreach ($placeholder as $key => $val)
{
if (strpos($data, $key) !== FALSE)
{
$replace = true;
break;
}
}
// only replace if the data has these placeholder values
if ($replace === true)
{
return str_replace(array_keys($placeholder),array_values($placeholder),$data);
}
}
elseif (3 == $action) // <-- remove placeholders not in data string
{
$replace = $placeholder;
foreach ($replace as $key => $val)
{
if (strpos($data, $key) === FALSE)
{
unset($replace[$key]);
}
}
// only replace if the data has these placeholder values
if (ComponentbuilderHelper::checkArray($replace))
{
return str_replace(array_keys($replace),array_values($replace),$data);
}
}
return $data;
}
/**
* return the placeholders for insered and replaced code
*
@ -3028,7 +3121,7 @@ class Get
* @return array on success
*
*/
public function getPlaceHolder($type, &$id)
public function getPlaceHolder($type, $id)
{
switch ($type)
{
@ -3043,8 +3136,8 @@ class Get
else
{
return array(
'start' => "/*////////////////////////////////////////*/",
'end' => "/*////////////////////////////////////////*/");
'start' => "\t\t\t",
'end' => "\t\t\t");
}
break;
case 2:
@ -3058,10 +3151,15 @@ class Get
else
{
return array(
'start' => "/*////////////////////////////////////////*/",
'end' => "/*////////////////////////////////////////*/");
'start' => "\t\t\t",
'end' => "\t\t\t");
}
break;
case 3:
return array(
'start' => "\t\t\t",
'end' => "\t\t\t");
break;
}
return false;
}

View File

@ -1276,7 +1276,7 @@ class Fields extends Structure
{
$xmlValue = ComponentbuilderHelper::getBetween($field['settings']->xml, $property['name'] . '="', '"');
// replace the placeholders
$xmlValue = str_replace(array_keys($placeholders), array_values($placeholders), $xmlValue);
$xmlValue = $this->setPlaceholders($xmlValue, $placeholders);
}
elseif (strpos($property['name'], 'type_php_') !== false && $setCustom)
{
@ -1312,14 +1312,14 @@ class Fields extends Structure
// load the component name
$fieldAttributes['custom']['component'] = ComponentbuilderHelper::getBetween($field['settings']->xml, 'component="', '"');
// replace the placeholders
$fieldAttributes['custom']['component'] = str_replace(array_keys($placeholders), array_values($placeholders), $fieldAttributes['custom']['component']);
$fieldAttributes['custom']['component'] = $this->setPlaceholders($fieldAttributes['custom']['component'], $placeholders);
}
elseif ($property['name'] === 'table' && $setCustom)
{
// load the main table that is queried
$fieldAttributes['custom']['table'] = ComponentbuilderHelper::getBetween($field['settings']->xml, 'table="', '"');
// replace the placeholders
$fieldAttributes['custom']['table'] = str_replace(array_keys($placeholders), array_values($placeholders), $fieldAttributes['custom']['table']);
$fieldAttributes['custom']['table'] = $this->setPlaceholders($fieldAttributes['custom']['table'], $placeholders);
}
elseif ($property['name'] === 'value_field' && $setCustom)
{
@ -1382,7 +1382,7 @@ class Fields extends Structure
if (ComponentbuilderHelper::checkString($xmlValue) && $property['translatable'] == 1)
{
// replace placeholders
$xmlValue = str_replace(array_keys($placeholders), array_values($placeholders), $xmlValue);
$xmlValue = $this->setPlaceholders($xmlValue, $placeholders);
// insure custom lables dont get messed up
if ($setCustom)
{
@ -1818,16 +1818,16 @@ class Fields extends Structure
{
if ($line == 1)
{
$phpCode .= str_replace(array_keys($tabBreak),array_values($tabBreak),$code);
$phpCode .= $this->setPlaceholders($code, $tabBreak);
}
else
{
$phpCode .= PHP_EOL."\t\t".str_replace(array_keys($tabBreak),array_values($tabBreak),$code);
$phpCode .= PHP_EOL."\t\t".$this->setPlaceholders($code, $tabBreak);
}
}
}
// replace the placholders
$phpCode = str_replace(array_keys($replace),array_values($replace),$phpCode);
$phpCode = $this->setPlaceholders($phpCode, $replace);
}
else
{
@ -1851,16 +1851,16 @@ class Fields extends Structure
{
if ($line == 1)
{
$phpxCode .= str_replace(array_keys($tabBreak),array_values($tabBreak),$code);
$phpxCode .= $this->setPlaceholders($code, $tabBreak);
}
else
{
$phpxCode .= PHP_EOL."\t\t".str_replace(array_keys($tabBreak),array_values($tabBreak),$code);
$phpxCode .= PHP_EOL."\t\t".$this->setPlaceholders($code, $tabBreak);
}
}
}
// replace the placholders
$phpxCode = str_replace(array_keys($replace),array_values($replace),$phpxCode);
$phpxCode = $this->setPlaceholders($phpxCode, $replace);
}
else
{

View File

@ -2271,7 +2271,7 @@ class Interpretation extends Fields
{
foreach ($joinedChecker as $joinedString)
{
$joine .= str_replace(array_keys($placeholders),array_values($placeholders),$joinedString);
$joine .= $this->setPlaceholders($joinedString, $placeholders);
}
}
if (ComponentbuilderHelper::checkString($decoder) || ComponentbuilderHelper::checkString($uikit) || ComponentbuilderHelper::checkString($decoder_filter) || ComponentbuilderHelper::checkString($joine))
@ -2484,7 +2484,8 @@ class Interpretation extends Fields
$get->php_calculation = (array) explode(PHP_EOL,$get->php_calculation);
if (ComponentbuilderHelper::checkArray($get->php_calculation))
{
$getItem .= str_replace(array_keys($this->placeholders),array_values($this->placeholders),PHP_EOL."\t\t\t\t".implode(PHP_EOL."\t\t\t\t",$get->php_calculation));
$_tmp = PHP_EOL."\t\t\t\t".implode(PHP_EOL."\t\t\t\t",$get->php_calculation);
$getItem .= $this->setPlaceholders($_tmp, $this->placeholders);
}
}
$getItem .= PHP_EOL."\t\t\t}";
@ -2573,7 +2574,8 @@ class Interpretation extends Fields
$view['settings']->php_jview_display = (array) explode(PHP_EOL,$view['settings']->php_jview_display);
if (ComponentbuilderHelper::checkArray($view['settings']->php_jview_display))
{
$method .= str_replace(array_keys($this->placeholders),array_values($this->placeholders),PHP_EOL."\t\t".implode(PHP_EOL."\t\t",$view['settings']->php_jview_display));
$_tmp = PHP_EOL."\t\t".implode(PHP_EOL."\t\t",$view['settings']->php_jview_display);
$method .= $this->setPlaceholders($_tmp, $this->placeholders);
}
}
if ('site' === $this->target)
@ -2727,7 +2729,8 @@ class Interpretation extends Fields
$view['settings']->php_document = (array) explode(PHP_EOL,$view['settings']->php_document);
if (ComponentbuilderHelper::checkArray($view['settings']->php_document))
{
return str_replace(array_keys($this->placeholders),array_values($this->placeholders),PHP_EOL."\t\t".implode(PHP_EOL."\t\t",$view['settings']->php_document));
$_tmp = PHP_EOL."\t\t".implode(PHP_EOL."\t\t",$view['settings']->php_document);
return $this->setPlaceholders($_tmp, $this->placeholders);
}
}
return '';
@ -2790,7 +2793,7 @@ class Interpretation extends Fields
{
// set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER###
$this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_CONTROLLER###'] =
PHP_EOL.PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$view['settings']->php_controller);
PHP_EOL.PHP_EOL.$this->setPlaceholders($view['settings']->php_controller, $this->placeholders);
if ('site' === $this->target)
{
// add the controller for this view
@ -2804,7 +2807,7 @@ class Interpretation extends Fields
{
// set the custom buttons ###CUSTOM_BUTTONS_METHOD###
$this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_METHOD###'] =
PHP_EOL.PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$view['settings']->php_model);
PHP_EOL.PHP_EOL.$this->setPlaceholders($view['settings']->php_model, $this->placeholders);
}
if (isset($view['settings']->custom_buttons) && ComponentbuilderHelper::checkArray($view['settings']->custom_buttons))
{
@ -2840,7 +2843,7 @@ class Interpretation extends Fields
{
if (ComponentbuilderHelper::checkString($view['settings']->css))
{
return str_replace(array_keys($this->placeholders),array_values($this->placeholders),$view['settings']->css);
return $this->setPlaceholders($view['settings']->css, $this->placeholders);
}
}
return '';
@ -2854,8 +2857,8 @@ class Interpretation extends Fields
if (ComponentbuilderHelper::checkArray($view['settings']->css_document))
{
$script = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Set the Custom CSS script to view".PHP_EOL."\t\t".'$this->document->addStyleDeclaration("';
$cssDocument = str_replace('"', '\"', implode(PHP_EOL."\t\t\t",$view['settings']->css_document));
return $script.str_replace(array_keys($this->placeholders),array_values($this->placeholders),PHP_EOL."\t\t\t".$cssDocument).PHP_EOL."\t\t".'");';
$cssDocument = PHP_EOL."\t\t\t".str_replace('"', '\"', implode(PHP_EOL."\t\t\t",$view['settings']->css_document));
return $script.$this->setPlaceholders($cssDocument, $this->placeholders).PHP_EOL."\t\t".'");';
}
}
return '';
@ -2869,8 +2872,8 @@ class Interpretation extends Fields
if (ComponentbuilderHelper::checkArray($view['settings']->js_document))
{
$script = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Set the Custom JS script to view".PHP_EOL."\t\t".'$this->document->addScriptDeclaration("';
$jsDocument = str_replace('"', '\"', implode(PHP_EOL."\t\t\t",$view['settings']->js_document));
return $script.str_replace(array_keys($this->placeholders),array_values($this->placeholders),PHP_EOL."\t\t\t".$jsDocument).PHP_EOL."\t\t".'");';
$jsDocument = PHP_EOL."\t\t\t".str_replace('"', '\"', implode(PHP_EOL."\t\t\t",$view['settings']->js_document));
return $script.$this->setPlaceholders($jsDocument, $this->placeholders).PHP_EOL."\t\t".'");';
}
}
return '';
@ -3149,7 +3152,7 @@ class Interpretation extends Fields
{
if ($view['settings']->add_php_jview == 1)
{
return str_replace(array_keys($this->placeholders),array_values($this->placeholders),PHP_EOL.PHP_EOL.$view['settings']->php_jview);
return PHP_EOL.PHP_EOL.$this->setPlaceholders($view['settings']->php_jview, $this->placeholders);
}
return '';
}
@ -3167,7 +3170,7 @@ class Interpretation extends Fields
{
$this->placeholders['[[[LIMITBOX]]]'] = '<?php echo $this->pagination->getLimitBox(); ?>';
}
$body[] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$view['settings']->default);
$body[] = $this->setPlaceholders($view['settings']->default, $this->placeholders);
$body[] = PHP_EOL.'<?php if (isset($this->items) && '.$this->fileContentStatic['###component###'].'Helper::checkArray($this->items) && count($this->items) > 4): ?>';
$body[] = '<form name="adminForm" method="post">';
$body[] = "\t".'<div class="pagination">';
@ -3191,7 +3194,7 @@ class Interpretation extends Fields
}
else
{
return PHP_EOL. str_replace(array_keys($this->placeholders),array_values($this->placeholders),$view['settings']->default);
return PHP_EOL. $this->setPlaceholders($view['settings']->default, $this->placeholders);
}
}
@ -3233,7 +3236,8 @@ class Interpretation extends Fields
$view['settings']->php_view = (array) explode(PHP_EOL,$view['settings']->php_view);
if (ComponentbuilderHelper::checkArray($view['settings']->php_view))
{
return str_replace(array_keys($this->placeholders),array_values($this->placeholders),PHP_EOL.PHP_EOL.implode(PHP_EOL,$view['settings']->php_view));
$_tmp = PHP_EOL.PHP_EOL.implode(PHP_EOL,$view['settings']->php_view);
return $this->setPlaceholders($_tmp, $this->placeholders);
}
}
return '';
@ -3254,7 +3258,7 @@ class Interpretation extends Fields
// set the file data
$TARGET = ComponentbuilderHelper::safeString($this->target,'U');
// ###SITE_TEMPLATE_BODY### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code.'_'.$template]['###'.$TARGET.'_TEMPLATE_BODY###'] = PHP_EOL . str_replace(array_keys($this->placeholders),array_values($this->placeholders),$data['html']);
$this->fileContentDynamic[$view['settings']->code.'_'.$template]['###'.$TARGET.'_TEMPLATE_BODY###'] = PHP_EOL . $this->setPlaceholders($data['html'], $this->placeholders);
// ###SITE_TEMPLATE_CODE_BODY### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code.'_'.$template]['###'.$TARGET.'_TEMPLATE_CODE_BODY###'] = $this->setCustomViewTemplateCode($data['php_view']);
}
@ -3269,7 +3273,7 @@ class Interpretation extends Fields
if (ComponentbuilderHelper::checkArray($php_view))
{
$php_view = PHP_EOL.PHP_EOL.implode(PHP_EOL,$php_view);
return str_replace(array_keys($this->placeholders),array_values($this->placeholders),$php_view);
return $this->setPlaceholders($php_view, $this->placeholders);
}
}
return '';
@ -3291,14 +3295,14 @@ class Interpretation extends Fields
if (ComponentbuilderHelper::checkArray($php_view))
{
$php_view = PHP_EOL.PHP_EOL.implode(PHP_EOL,$php_view);
$this->fileContentDynamic[$layout]['###'.$TARGET.'_LAYOUT_CODE###'] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$php_view);
$this->fileContentDynamic[$layout]['###'.$TARGET.'_LAYOUT_CODE###'] = $this->setPlaceholders($php_view, $this->placeholders);
}
else
{
$this->fileContentDynamic[$layout]['###'.$TARGET.'_LAYOUT_CODE###'] = '';
}
// ###SITE_LAYOUT_BODY### <<<DYNAMIC>>>
$this->fileContentDynamic[$layout]['###'.$TARGET.'_LAYOUT_BODY###'] = PHP_EOL . str_replace(array_keys($this->placeholders),array_values($this->placeholders),$data['html']);
$this->fileContentDynamic[$layout]['###'.$TARGET.'_LAYOUT_BODY###'] = PHP_EOL . $this->setPlaceholders($data['html'], $this->placeholders);
}
}
@ -4934,7 +4938,7 @@ class Interpretation extends Fields
foreach ($this->customScriptBuilder['sql'] as $for => $customSql)
{
$placeholders = array('[[[component]]]' => $component, '[[[view]]]' => $for);
$db .= PHP_EOL.PHP_EOL.str_replace(array_keys($placeholders),array_values($placeholders),$customSql);
$db .= PHP_EOL.PHP_EOL.$this->setPlaceholders($customSql, $placeholders);
}
}
@ -8019,12 +8023,12 @@ class Interpretation extends Fields
{
$fileScript = '';
}
$fileScript .= PHP_EOL.PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['view_file'][$viewName]);
$fileScript .= PHP_EOL.PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['view_file'][$viewName], $this->placeholders);
}
// add custom script to footer
if (isset($this->customScriptBuilder['view_footer'][$viewName]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['view_footer'][$viewName]))
{
$customFooterScript = PHP_EOL.PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['view_footer'][$viewName]);
$customFooterScript = PHP_EOL.PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['view_footer'][$viewName], $this->placeholders);
if (strpos($customFooterScript,'<?php') === false)
{
// only add now if no php is added to the footer script
@ -8841,7 +8845,7 @@ class Interpretation extends Fields
foreach ($this->customScriptBuilder[$target]['ajax_model'] as $view => $method)
{
$methods .= PHP_EOL.PHP_EOL."\t//".$this->setLine(__LINE__)." Used in ".$view.PHP_EOL;
$methods .= str_replace(array_keys($this->placeholders),array_values($this->placeholders),$method);
$methods .= $this->setPlaceholders($method, $this->placeholders);
}
}
return $methods;
@ -8961,7 +8965,7 @@ class Interpretation extends Fields
$function[] = "\t\t\t\$model = \$this->getModel();";
}
$function[] = "\t\t\t\$results = array_unique(\$results);";
$function[] = "\t\t\t\$filter = array();";
$function[] = "\t\t\t\$_filter = array();";
$function[] = "\t\t\tforeach (\$results as \$".$filter['code'].")";
$function[] = "\t\t\t{";
@ -8971,20 +8975,20 @@ class Interpretation extends Fields
$function[] = "\t\t\t\t//".$this->setLine(__LINE__)." Translate the ".$filter['code']." selection";
$function[] = "\t\t\t\t\$text = \$model->selectionTranslation(\$".$filter['code'].",'".$filter['code']."');";
$function[] = "\t\t\t\t//".$this->setLine(__LINE__)." Now add the ".$filter['code']." and its text to the options array";
$function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$".$filter['code'].", JText::_(\$text));";
$function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$".$filter['code'].", JText::_(\$text));";
}
elseif ($filter['type'] === 'user')
{
$function[] = "\t\t\t\t//".$this->setLine(__LINE__)." Now add the ".$filter['code']." and its text to the options array";
$function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$".$filter['code'].", JFactory::getUser(\$".$filter['code'].")->name);";
$function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$".$filter['code'].", JFactory::getUser(\$".$filter['code'].")->name);";
}
else
{
$function[] = "\t\t\t\t//".$this->setLine(__LINE__)." Now add the ".$filter['code']." and its text to the options array";
$function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$".$filter['code'].", \$".$filter['code'].");";
$function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$".$filter['code'].", \$".$filter['code'].");";
}
$function[] = "\t\t\t}";
$function[] = "\t\t\treturn \$filter;";
$function[] = "\t\t\treturn \$_filter;";
$function[] = "\t\t}";
$function[] = "\t\treturn false;";
$function[] = "\t}";
@ -11138,7 +11142,7 @@ class Interpretation extends Fields
$this->DashboardGetCustomData = ComponentbuilderHelper::getAllBetween($this->componentData->php_dashboard_methods,'public function get','()');
// return the methods
return PHP_EOL.PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->componentData->php_dashboard_methods);
return PHP_EOL.PHP_EOL.$this->setPlaceholders($this->componentData->php_dashboard_methods, $this->placeholders);
}
return '';
}
@ -11176,7 +11180,7 @@ class Interpretation extends Fields
// build the tabs and accordians
foreach ($this->componentData->dashboard_tab as $data)
{
$builder[$data['name']][$data['header']] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$data['html']);
$builder[$data['name']][$data['header']] = $this->setPlaceholders($data['html'], $this->placeholders);
}
// since we have custom tabs we must load the tab structure around the cpanel
$display[] = '<div id="j-main-container" class="span12">';

View File

@ -150,15 +150,15 @@ class Infusion extends Interpretation
$this->lang = $keepLang;
// ###ADMINCSS###
$this->fileContentStatic['###ADMINCSS###'] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_css']);
$this->fileContentStatic['###ADMINCSS###'] = $this->setPlaceholders($this->customScriptBuilder['component_css'], $this->placeholders);
// ###SITECSS###
$this->fileContentStatic['###SITECSS###'] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_css']);
$this->fileContentStatic['###SITECSS###'] = $this->setPlaceholders($this->customScriptBuilder['component_css'], $this->placeholders);
// ###CUSTOM_HELPER_SCRIPT###
$this->fileContentStatic['###CUSTOM_HELPER_SCRIPT###'] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_php_helper_admin']);
$this->fileContentStatic['###CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_admin'], $this->placeholders);
// ###BOTH_CUSTOM_HELPER_SCRIPT###
$this->fileContentStatic['###BOTH_CUSTOM_HELPER_SCRIPT###'] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_php_helper_both']);
$this->fileContentStatic['###BOTH_CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_both'], $this->placeholders);
// ###ADMIN_GLOBAL_EVENT_HELPER###
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = '';
@ -181,7 +181,7 @@ class Infusion extends Interpretation
$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.$this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders);
$this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'}';
}
@ -290,7 +290,7 @@ class Infusion extends Interpretation
{
// ###DOCUMENT_CUSTOM_PHP### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###DOCUMENT_CUSTOM_PHP###']
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['php_document'][$viewName_single]);
= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['php_document'][$viewName_single], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder['php_document'][$viewName_single]);
}
@ -351,7 +351,7 @@ class Infusion extends Interpretation
{
// ###VIEWCSS### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_single]['###VIEWCSS###']
= str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['css_view'][$viewName_single]);
= $this->setPlaceholders($this->customScriptBuilder['css_view'][$viewName_single], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder['css_view'][$viewName_single]);
}
@ -497,7 +497,7 @@ class Infusion extends Interpretation
{
// ###VIEWCSS### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###VIEWSCSS###']
= str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['css_views'][$viewName_list]);
= $this->setPlaceholders($this->customScriptBuilder['css_views'][$viewName_list], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder['css_views'][$viewName_list]);
}
@ -629,7 +629,7 @@ class Infusion extends Interpretation
{
// ###CUSTOM_ADMIN_BEFORE_GET_ITEM### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEM###']
= str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]);
= $this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]);
}
@ -647,7 +647,7 @@ class Infusion extends Interpretation
{
// ###CUSTOM_ADMIN_AFTER_GET_ITEM### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEM###']
= str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]);
= $this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]);
}
@ -667,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###']
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code]);
= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code]);
}
@ -682,7 +682,7 @@ class Infusion extends Interpretation
{
// ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEMS###']
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]);
= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]);
}
@ -700,7 +700,7 @@ class Infusion extends Interpretation
{
// ###CUSTOM_ADMIN_AFTER_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEMS###']
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]);
= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]);
}
@ -896,7 +896,7 @@ class Infusion extends Interpretation
{
// ###SITE_BEFORE_GET_ITEM### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEM###']
= str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]);
= $this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]);
}
@ -914,7 +914,7 @@ class Infusion extends Interpretation
{
// ###SITE_AFTER_GET_ITEM### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEM###']
= str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]);
= $this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]);
}
@ -936,7 +936,7 @@ class Infusion extends Interpretation
{
// ###SITE_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEMS###']
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]);
= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]);
}
@ -954,7 +954,7 @@ class Infusion extends Interpretation
{
// ###SITE_AFTER_GET_ITEMS### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEMS###']
= PHP_EOL.str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]);
= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code], $this->placeholders);
// clear some memory
unset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]);
}
@ -992,7 +992,7 @@ class Infusion extends Interpretation
}
// set site custom script to helper class
// ###SITE_CUSTOM_HELPER_SCRIPT###
$this->fileContentStatic['###SITE_CUSTOM_HELPER_SCRIPT###'] = str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['component_php_helper_site']);
$this->fileContentStatic['###SITE_CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_site'], $this->placeholders);
// ###SITE_GLOBAL_EVENT_HELPER###
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] = '';
// ###SITE_GLOBAL_EVENT###
@ -1008,7 +1008,7 @@ class Infusion extends Interpretation
$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.$this->setPlaceholders($this->customScriptBuilder['component_php_site_event'], $this->placeholders);
$this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'}';
}
// setup the layouts

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.2
@build 11th February, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.2
@build 11th February, 2017
@created 30th April, 2015
@package Component Builder
@subpackage headercheck.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.2
@build 11th February, 2017
@created 30th April, 2015
@package Component Builder
@subpackage batch_.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.2
@build 11th February, 2017
@created 30th April, 2015
@package Component Builder
@subpackage indenter.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.2
@build 11th February, 2017
@created 30th April, 2015
@package Component Builder
@subpackage js.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.1
@build 9th February, 2017
@version 2.3.2
@build 11th February, 2017
@created 30th April, 2015
@package Component Builder
@subpackage minify.php