Fixed the compiler to allow edit views be build even if no other site views are set. Removed all the depreciated joomla jimport statments. Update the getModel method in the controller. Updated the getRedirectToItemAppend, cancel and save method in the controller to also use the return value if internal. Added the addTablePath to the getTable method in the model to insure table is found when called from outside the in another component. Updated the diplay method in the JViewLagacy class to also use the return value if not null. Updated the component core to use JAccessExceptionNotallowed instead of JError::raiseWaring when user not have access to core.
This commit is contained in:
@ -66,7 +66,7 @@ class Compiler extends Infusion
|
||||
$this->repoPath = $this->params->get('git_folder_path', null);
|
||||
}
|
||||
// remove site folder if not needed (TODO add check if custom script was moved to site folder then we must do a more complex cleanup here)
|
||||
if ($this->removeSiteFolder)
|
||||
if ($this->removeSiteFolder && $this->removeSiteEditFolder)
|
||||
{
|
||||
// first remove the files and folders
|
||||
$this->removeFolder($this->componentPath . '/site');
|
||||
|
@ -10973,10 +10973,14 @@ class Interpretation extends Fields
|
||||
$allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Only load these values if no id is found";
|
||||
$allow[] = $this->_t(2) . "if (0 == \$id)";
|
||||
$allow[] = $this->_t(2) . "{";
|
||||
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set redirected field name";
|
||||
$allow[] = $this->_t(3) . "\$redirectedField = \$jinput->get('ref', null, 'STRING');";
|
||||
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set redirected field value";
|
||||
$allow[] = $this->_t(3) . "\$redirectedValue = \$jinput->get('refid', 0, 'INT');";
|
||||
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set redirected view name";
|
||||
$allow[] = $this->_t(3) . "\$redirectedView = \$jinput->get('ref', null, 'STRING');";
|
||||
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set field name (or fall back to view name)";
|
||||
$allow[] = $this->_t(3) . "\$redirectedField = \$jinput->get('field', \$redirectedView, 'STRING');";
|
||||
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set redirected view id";
|
||||
$allow[] = $this->_t(3) . "\$redirectedId = \$jinput->get('refid', 0, 'INT');";
|
||||
$allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set field id (or fall back to redirected view id)";
|
||||
$allow[] = $this->_t(3) . "\$redirectedValue = \$jinput->get('field_id', \$redirectedId, 'INT');";
|
||||
$allow[] = $this->_t(3) . "if (0 != \$redirectedValue && \$redirectedField)";
|
||||
$allow[] = $this->_t(3) . "{";
|
||||
$allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Now set the local-redirected field default value";
|
||||
@ -11559,7 +11563,7 @@ class Interpretation extends Fields
|
||||
$toolBar .= PHP_EOL . $this->_t(2) . "\$isNew = \$this->item->id == 0;";
|
||||
$toolBar .= PHP_EOL . PHP_EOL . $this->_t(2) . "JToolbarHelper::title( JText:" . ":_(\$isNew ? '" . $viewNameLang_new . "' : '" . $viewNameLang_edit . "'), 'pencil-2 article-add');";
|
||||
$toolBar .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Built the actions for new and existing records.";
|
||||
$toolBar .= PHP_EOL . $this->_t(2) . "if (\$this->refid || \$this->ref)";
|
||||
$toolBar .= PHP_EOL . $this->_t(2) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]. "Helper::checkString(\$this->referral))";
|
||||
$toolBar .= PHP_EOL . $this->_t(2) . "{";
|
||||
if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.create']]))
|
||||
{
|
||||
|
@ -22,6 +22,7 @@ class Infusion extends Interpretation
|
||||
public $importCustomScripts = array();
|
||||
public $langFiles = array();
|
||||
public $removeSiteFolder = false;
|
||||
public $removeSiteEditFolder = true;
|
||||
public $langNot = array();
|
||||
public $langSet = array();
|
||||
|
||||
@ -245,6 +246,8 @@ class Infusion extends Interpretation
|
||||
{
|
||||
$site_edit_view_array[] = $this->_t(4) . "'" . $viewName_single . "'";
|
||||
$this->lang = 'both';
|
||||
// insure site view does not get removed
|
||||
$this->removeSiteEditFolder = false;
|
||||
}
|
||||
// check if help is being loaded
|
||||
$this->checkHelp($viewName_single);
|
||||
@ -895,6 +898,18 @@ class Infusion extends Interpretation
|
||||
// setup the templates
|
||||
$this->setCustomViewTemplateBody($view);
|
||||
}
|
||||
// setup the layouts
|
||||
$this->setCustomViewLayouts();
|
||||
}
|
||||
else
|
||||
{
|
||||
// clear all site folder since none is needed
|
||||
$this->removeSiteFolder = true;
|
||||
}
|
||||
// load the site statics
|
||||
if (!$this->removeSiteFolder || !$this->removeSiteEditFolder)
|
||||
{
|
||||
$this->target = 'site';
|
||||
// if no default site view was set, the redirect to root
|
||||
if (!isset($this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh]))
|
||||
{
|
||||
@ -921,13 +936,6 @@ class Infusion extends Interpretation
|
||||
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_site_event'], $this->placeholders);
|
||||
$this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '}';
|
||||
}
|
||||
// setup the layouts
|
||||
$this->setCustomViewLayouts();
|
||||
}
|
||||
else
|
||||
{
|
||||
// clear all site folder since none is needed
|
||||
$this->removeSiteFolder = true;
|
||||
}
|
||||
|
||||
// PREINSTALLSCRIPT
|
||||
@ -1076,13 +1084,13 @@ class Infusion extends Interpretation
|
||||
$mainLangLoader['adminsys'] = count($this->languages[$this->langTag]['adminsys']);
|
||||
}
|
||||
// check the site lang is set
|
||||
if (!$this->removeSiteFolder && $this->setLangSite())
|
||||
if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) && $this->setLangSite())
|
||||
{
|
||||
$values[] = array_values($this->languages[$this->langTag]['site']);
|
||||
$mainLangLoader['site'] = count($this->languages[$this->langTag]['site']);
|
||||
}
|
||||
// check the site system lang is set
|
||||
if (!$this->removeSiteFolder && $this->setLangSiteSys())
|
||||
if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) && $this->setLangSiteSys())
|
||||
{
|
||||
$values[] = array_values($this->languages[$this->langTag]['sitesys']);
|
||||
$mainLangLoader['sitesys'] = count($this->languages[$this->langTag]['sitesys']);
|
||||
@ -1132,7 +1140,7 @@ class Infusion extends Interpretation
|
||||
$t = '';
|
||||
if (strpos($area, 'site') !== false)
|
||||
{
|
||||
if ($this->removeSiteFolder)
|
||||
if ($this->removeSiteFolder && $this->removeSiteEditFolder)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -1181,7 +1189,7 @@ class Infusion extends Interpretation
|
||||
{
|
||||
$replace[$this->hhh . 'ADMIN_LANGUAGES' . $this->hhh] = implode(PHP_EOL . $this->_t(3), $langXML['admin']);
|
||||
}
|
||||
if (!$this->removeSiteFolder && isset($langXML['site']) && ComponentbuilderHelper::checkArray($langXML['site']))
|
||||
if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) && isset($langXML['site']) && ComponentbuilderHelper::checkArray($langXML['site']))
|
||||
{
|
||||
$replace[$this->hhh . 'SITE_LANGUAGES' . $this->hhh] = implode(PHP_EOL . $this->_t(2), $langXML['site']);
|
||||
}
|
||||
|
@ -302,7 +302,7 @@ abstract class ComponentbuilderEmail
|
||||
$body[] = "<head>";
|
||||
$body[] = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";
|
||||
$body[] = "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>";
|
||||
$body[] = "<title>".$subject."</title>";
|
||||
$body[] = "<title>" . $subject . "</title>";
|
||||
$body[] = "<style type=\"text/css\">";
|
||||
$body[] = "#outlook a {padding:0;}";
|
||||
$body[] = ".ExternalClass {width:100%;}";
|
||||
|
Reference in New Issue
Block a user