componentCodeName . "_loader\" style=\"display: none;\">";
return implode(PHP_EOL, $fadein);
}
- return "
fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_loader\">";
+ return "
componentCodeName . "_loader\">";
}
/**
@@ -8276,9 +8276,9 @@ class Interpretation extends Fields
$this->fileContentDynamic[$view_name_single . '_' . $layoutCodeName][$this->hhh . 'LAYOUTITEMSTABLE' . $this->hhh] = $head . $body;
// LAYOUTITEMSHEADER <<>>
$headerscript = '//' . $this->setLine(__LINE__) . ' set the edit URL';
- $headerscript .= PHP_EOL . '$edit = "index.php?option=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '&view=' . $list . '&task=' . $single . '.edit";';
+ $headerscript .= PHP_EOL . '$edit = "index.php?option=com_' . $this->componentCodeName . '&view=' . $list . '&task=' . $single . '.edit";';
$headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' set a return value';
- $headerscript .= PHP_EOL . '$return = ($id) ? "index.php?option=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '&view=' . $view_name_single . '&layout=edit&id=" . $id : "";';
+ $headerscript .= PHP_EOL . '$return = ($id) ? "index.php?option=com_' . $this->componentCodeName . '&view=' . $view_name_single . '&layout=edit&id=" . $id : "";';
$headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' check for a return value';
$headerscript .= PHP_EOL . '$jinput = JFactory::getApplication()->input;';
$headerscript .= PHP_EOL . "if (\$_return = \$jinput->get('return', null, 'base64'))";
@@ -8301,13 +8301,13 @@ class Interpretation extends Fields
if ($addNewButon == 1 || $addNewButon == 2)
{
$headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' set the create new URL';
- $headerscript .= PHP_EOL . '$new = "index.php?option=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '&view=' . $list . '&task=' . $single . '.edit" . $ref;';
+ $headerscript .= PHP_EOL . '$new = "index.php?option=com_' . $this->componentCodeName . '&view=' . $list . '&task=' . $single . '.edit" . $ref;';
}
// and the link for close and new
if ($addNewButon == 2 || $addNewButon == 3)
{
$headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' set the create new and close URL';
- $headerscript .= PHP_EOL . '$close_new = "index.php?option=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '&view=' . $list . '&task=' . $single . '.edit";';
+ $headerscript .= PHP_EOL . '$close_new = "index.php?option=com_' . $this->componentCodeName . '&view=' . $list . '&task=' . $single . '.edit";';
}
$headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' load the action object';
$headerscript .= PHP_EOL . '$can = ' . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::getActions(' . "'" . $single . "'" . ');';
@@ -8378,22 +8378,22 @@ class Interpretation extends Fields
if (!isset($this->footableVersion) || 2 == $this->footableVersion) // loading version 2
{
$foo = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the CSS for Footable.";
- $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v2/css/footable.core.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');";
+ $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v2/css/footable.core.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');";
$foo .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Use the Metro Style";
$foo .= PHP_EOL . $this->_t(2) . "if (!isset(\$this->fooTableStyle) || 0 == \$this->fooTableStyle)";
$foo .= PHP_EOL . $this->_t(2) . "{";
- $foo .= PHP_EOL . $this->_t(3) . "\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v2/css/footable.metro.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');";
+ $foo .= PHP_EOL . $this->_t(3) . "\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v2/css/footable.metro.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');";
$foo .= PHP_EOL . $this->_t(2) . "}";
$foo .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Use the Legacy Style.";
$foo .= PHP_EOL . $this->_t(2) . "elseif (isset(\$this->fooTableStyle) && 1 == \$this->fooTableStyle)";
$foo .= PHP_EOL . $this->_t(2) . "{";
- $foo .= PHP_EOL . $this->_t(3) . "\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v2/css/footable.standalone.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');";
+ $foo .= PHP_EOL . $this->_t(3) . "\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v2/css/footable.standalone.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');";
$foo .= PHP_EOL . $this->_t(2) . "}";
$foo .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the JavaScript for Footable";
- $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v2/js/footable.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');";
- $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v2/js/footable.sort.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');";
- $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v2/js/footable.filter.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');";
- $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v2/js/footable.paginate.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');";
+ $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v2/js/footable.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');";
+ $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v2/js/footable.sort.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');";
+ $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v2/js/footable.filter.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');";
+ $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v2/js/footable.paginate.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');";
if ($init)
{
$foo .= PHP_EOL . PHP_EOL . $this->_t(2) . '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery(' . "'.footable'" . ').footable(); }); jQuery(' . "'.nav-tabs'" . ').on(' . "'click'" . ', ' . "'li'" . ', function() { setTimeout(tableFix, 10); }); }); function tableFix() { jQuery(' . "'.footable'" . ').trigger(' . "'footable_resize'" . '); }";';
@@ -8405,9 +8405,9 @@ class Interpretation extends Fields
$foo = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the CSS for Footable";
$foo .= PHP_EOL . $this->_t(2) . "\$this->document->addStyleSheet('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');";
- $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v3/css/footable.standalone.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');";
+ $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v3/css/footable.standalone.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');";
$foo .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the JavaScript for Footable (adding all funtions)";
- $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v3/js/footable.min.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');";
+ $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v3/js/footable.min.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');";
if ($init)
{
$foo .= PHP_EOL . PHP_EOL . $this->_t(2) . '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery(' . "'.footable'" . ').footable();});});";';
@@ -8741,8 +8741,8 @@ class Interpretation extends Fields
{
$query .= PHP_EOL . $this->_t(2) . "\$query->select(\$db->quoteName('c.title','category_title'));";
}
- $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . " table";
- $query .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . "', 'a'));";
+ $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " From the " . $this->componentCodeName . "_" . $viewName_single . " table";
+ $query .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__" . $this->componentCodeName . "_" . $viewName_single . "', 'a'));";
// add the category
if ($addCategory)
{
@@ -8824,7 +8824,7 @@ class Interpretation extends Fields
$query .= PHP_EOL . $this->_t(3) . "\$query->where('a.access = ' . (int) \$access);";
$query .= PHP_EOL . $this->_t(2) . "}";
$query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Implement View Level Access";
- $query .= PHP_EOL . $this->_t(2) . "if (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))";
+ $query .= PHP_EOL . $this->_t(2) . "if (!\$user->authorise('core.options', 'com_" . $this->componentCodeName . "'))";
$query .= PHP_EOL . $this->_t(2) . "{";
$query .= PHP_EOL . $this->_t(3) . "\$groups = implode(',', \$user->getAuthorisedViewLevels());";
$query .= PHP_EOL . $this->_t(3) . "\$query->where('a.access IN (' . \$groups . ')');";
@@ -9054,7 +9054,7 @@ class Interpretation extends Fields
$method[] = $this->_t(2) . "JSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if export is allowed for this user.";
$method[] = $this->_t(2) . "\$user = JFactory::getUser();";
- $method[] = $this->_t(2) . "if (\$user->authorise('" . $custom_button['link'] . ".access', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))";
+ $method[] = $this->_t(2) . "if (\$user->authorise('" . $custom_button['link'] . ".access', 'com_" . $this->componentCodeName . "'))";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the input";
$method[] = $this->_t(3) . "\$input = JFactory::getApplication()->input;";
@@ -9063,12 +9063,12 @@ class Interpretation extends Fields
$method[] = $this->_t(3) . "JArrayHelper::toInteger(\$pks);";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " convert to string";
$method[] = $this->_t(3) . "\$ids = implode('_', \$pks);";
- $method[] = $this->_t(3) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $custom_button['link'] . "&cid='.\$ids, false));";
+ $method[] = $this->_t(3) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=" . $custom_button['link'] . "&cid='.\$ids, false));";
$method[] = $this->_t(3) . "return;";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Redirect to the list screen with error.";
$method[] = $this->_t(2) . "\$message = JText:" . ":_('" . $this->langPrefix . "_ACCESS_TO_" . $custom_button['NAME'] . "_FAILED');";
- $method[] = $this->_t(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $viewName_list . "', false), \$message, 'error');";
+ $method[] = $this->_t(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=" . $viewName_list . "', false), \$message, 'error');";
$method[] = $this->_t(2) . "return;";
$method[] = $this->_t(1) . "}";
// add to lang array
@@ -9113,8 +9113,8 @@ class Interpretation extends Fields
$query .= PHP_EOL . $this->_t(3) . "\$query = \$db->getQuery(true);";
$query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Select some fields";
$query .= PHP_EOL . $this->_t(3) . "\$query->select('a.*');";
- $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . " table";
- $query .= PHP_EOL . $this->_t(3) . "\$query->from(\$db->quoteName('#__" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . "', 'a'));";
+ $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " From the " . $this->componentCodeName . "_" . $viewName_single . " table";
+ $query .= PHP_EOL . $this->_t(3) . "\$query->from(\$db->quoteName('#__" . $this->componentCodeName . "_" . $viewName_single . "', 'a'));";
$query .= PHP_EOL . $this->_t(3) . "\$query->where('a.id IN (' . implode(',',\$pks) . ')');";
// add custom filtering php
$query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL . PHP_EOL . $this->_t(1));
@@ -9122,7 +9122,7 @@ class Interpretation extends Fields
if (isset($this->accessBuilder[$viewName_single]) && ComponentbuilderHelper::checkString($this->accessBuilder[$viewName_single]))
{
$query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Implement View Level Access";
- $query .= PHP_EOL . $this->_t(3) . "if (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))";
+ $query .= PHP_EOL . $this->_t(3) . "if (!\$user->authorise('core.options', 'com_" . $this->componentCodeName . "'))";
$query .= PHP_EOL . $this->_t(3) . "{";
$query .= PHP_EOL . $this->_t(4) . "\$groups = implode(',', \$user->getAuthorisedViewLevels());";
$query .= PHP_EOL . $this->_t(4) . "\$query->where('a.access IN (' . \$groups . ')');";
@@ -9170,7 +9170,7 @@ class Interpretation extends Fields
$method[] = $this->_t(2) . "JSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if export is allowed for this user.";
$method[] = $this->_t(2) . "\$user = JFactory::getUser();";
- $method[] = $this->_t(2) . "if (\$user->authorise('" . $viewName_single . ".export', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "') && \$user->authorise('core.export', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))";
+ $method[] = $this->_t(2) . "if (\$user->authorise('" . $viewName_single . ".export', 'com_" . $this->componentCodeName . "') && \$user->authorise('core.export', 'com_" . $this->componentCodeName . "'))";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the input";
$method[] = $this->_t(3) . "\$input = JFactory::getApplication()->input;";
@@ -9190,7 +9190,7 @@ class Interpretation extends Fields
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Redirect to the list screen with error.";
$method[] = $this->_t(2) . "\$message = JText:" . ":_('" . $this->langPrefix . "_EXPORT_FAILED');";
- $method[] = $this->_t(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $viewName_list . "', false), \$message, 'error');";
+ $method[] = $this->_t(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=" . $viewName_list . "', false), \$message, 'error');";
$method[] = $this->_t(2) . "return;";
$method[] = $this->_t(1) . "}";
@@ -9201,7 +9201,7 @@ class Interpretation extends Fields
$method[] = $this->_t(2) . "JSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if import is allowed for this user.";
$method[] = $this->_t(2) . "\$user = JFactory::getUser();";
- $method[] = $this->_t(2) . "if (\$user->authorise('" . $viewName_single . ".import', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "') && \$user->authorise('core.import', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))";
+ $method[] = $this->_t(2) . "if (\$user->authorise('" . $viewName_single . ".import', 'com_" . $this->componentCodeName . "') && \$user->authorise('core.import', 'com_" . $this->componentCodeName . "'))";
$method[] = $this->_t(2) . "{";
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the import model";
$method[] = $this->_t(3) . "\$model = \$this->getModel('" . ComponentbuilderHelper::safeString($viewName_list, 'F') . "');";
@@ -9226,18 +9226,18 @@ class Interpretation extends Fields
// if this view has custom script it must have as custom import (model, veiw, controller)
if (isset($this->importCustomScripts[$viewName_list]) && $this->importCustomScripts[$viewName_list])
{
- $method[] = $this->_t(4) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=import_" . $viewName_list . "', false), \$message);";
+ $method[] = $this->_t(4) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=import_" . $viewName_list . "', false), \$message);";
}
else
{
- $method[] = $this->_t(4) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=import', false), \$message);";
+ $method[] = $this->_t(4) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=import', false), \$message);";
}
$method[] = $this->_t(4) . "return;";
$method[] = $this->_t(3) . "}";
$method[] = $this->_t(2) . "}";
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Redirect to the list screen with error.";
$method[] = $this->_t(2) . "\$message = JText:" . ":_('" . $this->langPrefix . "_IMPORT_FAILED');";
- $method[] = $this->_t(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $viewName_list . "', false), \$message, 'error');";
+ $method[] = $this->_t(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=" . $viewName_list . "', false), \$message, 'error');";
$method[] = $this->_t(2) . "return;";
$method[] = $this->_t(1) . "}";
return implode(PHP_EOL, $method);
@@ -9342,8 +9342,8 @@ class Interpretation extends Fields
{
$query .= PHP_EOL . $this->_t(2) . "\$query->select(\$db->quoteName('c.title','category_title'));";
}
- $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_item table";
- $query .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . "', 'a'));";
+ $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " From the " . $this->componentCodeName . "_item table";
+ $query .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__" . $this->componentCodeName . "_" . $viewName_single . "', 'a'));";
// add the category
if ($addCategory)
{
@@ -9374,7 +9374,7 @@ class Interpretation extends Fields
$query .= PHP_EOL . $this->_t(3) . "\$query->where('a.access = ' . (int) \$access);";
$query .= PHP_EOL . $this->_t(2) . "}";
$query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Implement View Level Access";
- $query .= PHP_EOL . $this->_t(2) . "if (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))";
+ $query .= PHP_EOL . $this->_t(2) . "if (!\$user->authorise('core.options', 'com_" . $this->componentCodeName . "'))";
$query .= PHP_EOL . $this->_t(2) . "{";
$query .= PHP_EOL . $this->_t(3) . "\$groups = implode(',', \$user->getAuthorisedViewLevels());";
$query .= PHP_EOL . $this->_t(3) . "\$query->where('a.access IN (' . \$groups . ')');";
@@ -9883,7 +9883,7 @@ class Interpretation extends Fields
$_config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $_created, $this->hhh . 'BUILDDATE' . $this->hhh => $_modified, $this->hhh . 'VERSION' . $this->hhh => $viewArray['settings']->version);
$this->buildDynamique($_target, 'javascript_file', false, $_config);
// set path
- $_path = '/administrator/components/com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '/assets/js/' . $viewName_list . '.js';
+ $_path = '/administrator/components/com_' . $this->componentCodeName . '/assets/js/' . $viewName_list . '.js';
// load the file to the list view
$this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_ADD_JAVASCRIPT_FILE' . $this->hhh] = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add List View JavaScript File" . PHP_EOL . $this->_t(2) . $this->setIncludeLibScript($_path);
}
@@ -12374,7 +12374,7 @@ class Interpretation extends Fields
$toolBar .= PHP_EOL . $this->_t(4) . "\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('" . $core['core.version'] . "'));";
$toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->state->params->get('save_history', 1) && \$this->canDo->get('" . $core['core.edit'] . "') && \$canVersion)";
$toolBar .= PHP_EOL . $this->_t(4) . "{";
- $toolBar .= PHP_EOL . $this->_t(5) . "JToolbarHelper::versions('com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $viewName . "', \$this->item->id);";
+ $toolBar .= PHP_EOL . $this->_t(5) . "JToolbarHelper::versions('com_" . $this->componentCodeName . "." . $viewName . "', \$this->item->id);";
$toolBar .= PHP_EOL . $this->_t(4) . "}";
}
}
@@ -12385,7 +12385,7 @@ class Interpretation extends Fields
$toolBar .= PHP_EOL . $this->_t(4) . "\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('" . $core['core.version'] . "'));";
$toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->state->params->get('save_history', 1) && \$this->canDo->get('core.edit') && \$canVersion)";
$toolBar .= PHP_EOL . $this->_t(4) . "{";
- $toolBar .= PHP_EOL . $this->_t(5) . "JToolbarHelper::versions('com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $viewName . "', \$this->item->id);";
+ $toolBar .= PHP_EOL . $this->_t(5) . "JToolbarHelper::versions('com_" . $this->componentCodeName . "." . $viewName . "', \$this->item->id);";
$toolBar .= PHP_EOL . $this->_t(4) . "}";
}
}
@@ -12847,9 +12847,9 @@ class Interpretation extends Fields
if (isset($item['custom']['table']))
{
// check if this is a local table
- if (strpos($item['custom']['table'], '#__' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '_') !== false)
+ if (strpos($item['custom']['table'], '#__' . $this->componentCodeName . '_') !== false)
{
- $keyTableNAme = str_replace('#__' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '_', '', $item['custom']['table']);
+ $keyTableNAme = str_replace('#__' . $this->componentCodeName . '_', '', $item['custom']['table']);
}
else
{
@@ -13365,14 +13365,14 @@ class Interpretation extends Fields
$display[] = $tab . $this->_t(2) . "";
$slidecounter++;
// build the template file
- $target = array('custom_admin' => $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]);
+ $target = array('custom_admin' => $this->componentCodeName);
$this->buildDynamique($target, 'template', $tempName);
// set the file data
$TARGET = ComponentbuilderHelper::safeString($this->target, 'U');
// SITE_TEMPLATE_BODY <<>>
- $this->fileContentDynamic[$this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '_' . $tempName][$this->hhh . 'CUSTOM_ADMIN_TEMPLATE_BODY' . $this->hhh] = PHP_EOL . $html;
+ $this->fileContentDynamic[$this->componentCodeName . '_' . $tempName][$this->hhh . 'CUSTOM_ADMIN_TEMPLATE_BODY' . $this->hhh] = PHP_EOL . $html;
// SITE_TEMPLATE_CODE_BODY <<>>
- $this->fileContentDynamic[$this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '_' . $tempName][$this->hhh . 'CUSTOM_ADMIN_TEMPLATE_CODE_BODY' . $this->hhh] = '';
+ $this->fileContentDynamic[$this->componentCodeName . '_' . $tempName][$this->hhh . 'CUSTOM_ADMIN_TEMPLATE_CODE_BODY' . $this->hhh] = '';
}
$display[] = $tab . $this->_t(1) . "";
$display[] = $tab . "
";
diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php
index faee0ef9b..2ef43f93a 100644
--- a/admin/helpers/compiler/f_Infusion.php
+++ b/admin/helpers/compiler/f_Infusion.php
@@ -270,7 +270,7 @@ class Infusion extends Interpretation
$this->setLockLicensePer($viewName_list, $this->target);
// FIELDSETS <<
>>
- $this->fileContentDynamic[$viewName_single][$this->hhh . 'FIELDSETS' . $this->hhh] = $this->setFieldSet($view, $this->fileContentStatic[$this->hhh . 'component' . $this->hhh], $viewName_single, $viewName_list);
+ $this->fileContentDynamic[$viewName_single][$this->hhh . 'FIELDSETS' . $this->hhh] = $this->setFieldSet($view, $this->componentCodeName, $viewName_single, $viewName_list);
// ACCESSCONTROL <<>>
$this->fileContentDynamic[$viewName_single][$this->hhh . 'ACCESSCONTROL' . $this->hhh] = $this->setFieldSetAccessControl($viewName_single);
@@ -396,7 +396,7 @@ class Infusion extends Interpretation
if (isset($view['checkin']) && $view['checkin'] == 1)
{
// AUTOCHECKIN <<>>
- $this->fileContentDynamic[$viewName_list][$this->hhh . 'AUTOCHECKIN' . $this->hhh] = $this->setAutoCheckin($viewName_single, $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]);
+ $this->fileContentDynamic[$viewName_list][$this->hhh . 'AUTOCHECKIN' . $this->hhh] = $this->setAutoCheckin($viewName_single, $this->componentCodeName);
// CHECKINCALL <<>>
$this->fileContentDynamic[$viewName_list][$this->hhh . 'CHECKINCALL' . $this->hhh] = $this->setCheckinCall();
}
@@ -720,22 +720,22 @@ class Infusion extends Interpretation
if (!ComponentbuilderHelper::checkString($this->dynamicDashboard))
{
// DASHBOARDVIEW
- $this->fileContentStatic[$this->hhh . 'DASHBOARDVIEW' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'component' . $this->hhh];
+ $this->fileContentStatic[$this->hhh . 'DASHBOARDVIEW' . $this->hhh] = $this->componentCodeName;
// DASHBOARDICONS
- $this->fileContentDynamic[$this->fileContentStatic[$this->hhh . 'component' . $this->hhh]][$this->hhh . 'DASHBOARDICONS' . $this->hhh] = $this->setDashboardIcons();
+ $this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASHBOARDICONS' . $this->hhh] = $this->setDashboardIcons();
// DASHBOARDICONACCESS
- $this->fileContentDynamic[$this->fileContentStatic[$this->hhh . 'component' . $this->hhh]][$this->hhh . 'DASHBOARDICONACCESS' . $this->hhh] = $this->setDashboardIconAccess();
+ $this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASHBOARDICONACCESS' . $this->hhh] = $this->setDashboardIconAccess();
// DASH_MODEL_METHODS
- $this->fileContentDynamic[$this->fileContentStatic[$this->hhh . 'component' . $this->hhh]][$this->hhh . 'DASH_MODEL_METHODS' . $this->hhh] = $this->setDashboardModelMethods();
+ $this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASH_MODEL_METHODS' . $this->hhh] = $this->setDashboardModelMethods();
// DASH_GET_CUSTOM_DATA
- $this->fileContentDynamic[$this->fileContentStatic[$this->hhh . 'component' . $this->hhh]][$this->hhh . 'DASH_GET_CUSTOM_DATA' . $this->hhh] = $this->setDashboardGetCustomData();
+ $this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASH_GET_CUSTOM_DATA' . $this->hhh] = $this->setDashboardGetCustomData();
// DASH_DISPLAY_DATA
- $this->fileContentDynamic[$this->fileContentStatic[$this->hhh . 'component' . $this->hhh]][$this->hhh . 'DASH_DISPLAY_DATA' . $this->hhh] = $this->setDashboardDisplayData();
+ $this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASH_DISPLAY_DATA' . $this->hhh] = $this->setDashboardDisplayData();
}
else
{
@@ -1223,7 +1223,7 @@ class Infusion extends Interpretation
$replace[$this->hhh . 'SITE_LANGUAGES' . $this->hhh] = implode(PHP_EOL . $this->_t(2), $langXML['site']);
}
// build xml path
- $xmlPath = $this->componentPath . '/' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '.xml';
+ $xmlPath = $this->componentPath . '/' . $this->componentCodeName . '.xml';
// get the content in xml
$componentXML = ComponentbuilderHelper::getFileContents($xmlPath);
// update the xml content
diff --git a/admin/models/fields/component.php b/admin/models/fields/component.php
index 06c94d826..9404fd994 100644
--- a/admin/models/fields/component.php
+++ b/admin/models/fields/component.php
@@ -38,15 +38,15 @@ class JFormFieldComponent extends JFormFieldList
protected function getInput()
{
// see if we should add buttons
- $setButton = $this->getAttribute('button');
+ $set_button = $this->getAttribute('button');
// get html
$html = parent::getInput();
// if true set button
- if ($setButton === 'true')
+ if ($set_button === 'true')
{
$button = array();
$script = array();
- $buttonName = $this->getAttribute('name');
+ $button_code_name = $this->getAttribute('name');
// get the input from url
$app = JFactory::getApplication();
$jinput = $app->input;
@@ -70,55 +70,52 @@ class JFormFieldComponent extends JFormFieldList
$ref .= '&return=' . $_return;
$refJ .= '&return=' . $_return;
}
+ // get button label
+ $button_label = trim($button_code_name);
+ $button_label = preg_replace('/_+/', ' ', $button_label);
+ $button_label = preg_replace('/\s+/', ' ', $button_label);
+ $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
+ $button_label = ucfirst(strtolower($button_label));
+ // get user object
$user = JFactory::getUser();
// only add if user allowed to create joomla_component
if ($user->authorise('joomla_component.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build Create button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
';
}
// only add if user allowed to edit joomla_component
- if (($buttonName === 'joomla_component' || $buttonName === 'joomla_components') && $user->authorise('joomla_component.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ if ($user->authorise('joomla_component.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build edit button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
+ $button[] = '
';
// build script
$script[] = "
jQuery(document).ready(function() {
- jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
+ jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) {
e.preventDefault();
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- function ".$buttonName."Button(value) {
+ function ".$button_code_name."Button(value) {
if (value > 0) {
// hide the create button
- jQuery('#".$buttonName."Create').hide();
+ jQuery('#".$button_code_name."Create').hide();
// show edit button
- jQuery('#".$buttonName."Edit').show();
+ jQuery('#".$button_code_name."Edit').show();
var url = 'index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit&id='+value+'".$refJ."';
- jQuery('#".$buttonName."Edit').attr('href', url);
+ jQuery('#".$button_code_name."Edit').attr('href', url);
} else {
// show the create button
- jQuery('#".$buttonName."Create').show();
+ jQuery('#".$button_code_name."Create').show();
// hide edit button
- jQuery('#".$buttonName."Edit').hide();
+ jQuery('#".$button_code_name."Edit').hide();
}
}";
}
diff --git a/admin/models/fields/dynamicget.php b/admin/models/fields/dynamicget.php
index 467b2d143..49198710e 100644
--- a/admin/models/fields/dynamicget.php
+++ b/admin/models/fields/dynamicget.php
@@ -38,15 +38,15 @@ class JFormFieldDynamicget extends JFormFieldList
protected function getInput()
{
// see if we should add buttons
- $setButton = $this->getAttribute('button');
+ $set_button = $this->getAttribute('button');
// get html
$html = parent::getInput();
// if true set button
- if ($setButton === 'true')
+ if ($set_button === 'true')
{
$button = array();
$script = array();
- $buttonName = $this->getAttribute('name');
+ $button_code_name = $this->getAttribute('name');
// get the input from url
$app = JFactory::getApplication();
$jinput = $app->input;
@@ -70,55 +70,52 @@ class JFormFieldDynamicget extends JFormFieldList
$ref .= '&return=' . $_return;
$refJ .= '&return=' . $_return;
}
+ // get button label
+ $button_label = trim($button_code_name);
+ $button_label = preg_replace('/_+/', ' ', $button_label);
+ $button_label = preg_replace('/\s+/', ' ', $button_label);
+ $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
+ $button_label = ucfirst(strtolower($button_label));
+ // get user object
$user = JFactory::getUser();
// only add if user allowed to create dynamic_get
if ($user->authorise('dynamic_get.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build Create button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
';
}
// only add if user allowed to edit dynamic_get
- if (($buttonName === 'dynamic_get' || $buttonName === 'dynamic_gets') && $user->authorise('dynamic_get.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ if ($user->authorise('dynamic_get.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build edit button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
+ $button[] = '
';
// build script
$script[] = "
jQuery(document).ready(function() {
- jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
+ jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) {
e.preventDefault();
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- function ".$buttonName."Button(value) {
+ function ".$button_code_name."Button(value) {
if (value > 0) {
// hide the create button
- jQuery('#".$buttonName."Create').hide();
+ jQuery('#".$button_code_name."Create').hide();
// show edit button
- jQuery('#".$buttonName."Edit').show();
+ jQuery('#".$button_code_name."Edit').show();
var url = 'index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_get.edit&id='+value+'".$refJ."';
- jQuery('#".$buttonName."Edit').attr('href', url);
+ jQuery('#".$button_code_name."Edit').attr('href', url);
} else {
// show the create button
- jQuery('#".$buttonName."Create').show();
+ jQuery('#".$button_code_name."Create').show();
// hide edit button
- jQuery('#".$buttonName."Edit').hide();
+ jQuery('#".$button_code_name."Edit').hide();
}
}";
}
diff --git a/admin/models/fields/fieldtypes.php b/admin/models/fields/fieldtypes.php
index 61e7d0ae6..97290a607 100644
--- a/admin/models/fields/fieldtypes.php
+++ b/admin/models/fields/fieldtypes.php
@@ -38,15 +38,15 @@ class JFormFieldFieldtypes extends JFormFieldList
protected function getInput()
{
// see if we should add buttons
- $setButton = $this->getAttribute('button');
+ $set_button = $this->getAttribute('button');
// get html
$html = parent::getInput();
// if true set button
- if ($setButton === 'true')
+ if ($set_button === 'true')
{
$button = array();
$script = array();
- $buttonName = $this->getAttribute('name');
+ $button_code_name = $this->getAttribute('name');
// get the input from url
$app = JFactory::getApplication();
$jinput = $app->input;
@@ -70,55 +70,52 @@ class JFormFieldFieldtypes extends JFormFieldList
$ref .= '&return=' . $_return;
$refJ .= '&return=' . $_return;
}
+ // get button label
+ $button_label = trim($button_code_name);
+ $button_label = preg_replace('/_+/', ' ', $button_label);
+ $button_label = preg_replace('/\s+/', ' ', $button_label);
+ $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
+ $button_label = ucfirst(strtolower($button_label));
+ // get user object
$user = JFactory::getUser();
// only add if user allowed to create fieldtype
if ($user->authorise('fieldtype.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build Create button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
';
}
// only add if user allowed to edit fieldtype
- if (($buttonName === 'fieldtype' || $buttonName === 'fieldtypes') && $user->authorise('fieldtype.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ if ($user->authorise('fieldtype.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build edit button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
+ $button[] = '
';
// build script
$script[] = "
jQuery(document).ready(function() {
- jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
+ jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) {
e.preventDefault();
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- function ".$buttonName."Button(value) {
+ function ".$button_code_name."Button(value) {
if (value > 0) {
// hide the create button
- jQuery('#".$buttonName."Create').hide();
+ jQuery('#".$button_code_name."Create').hide();
// show edit button
- jQuery('#".$buttonName."Edit').show();
+ jQuery('#".$button_code_name."Edit').show();
var url = 'index.php?option=com_componentbuilder&view=fieldtypes&task=fieldtype.edit&id='+value+'".$refJ."';
- jQuery('#".$buttonName."Edit').attr('href', url);
+ jQuery('#".$button_code_name."Edit').attr('href', url);
} else {
// show the create button
- jQuery('#".$buttonName."Create').show();
+ jQuery('#".$button_code_name."Create').show();
// hide edit button
- jQuery('#".$buttonName."Edit').hide();
+ jQuery('#".$button_code_name."Edit').hide();
}
}";
}
diff --git a/admin/models/fields/libraries.php b/admin/models/fields/libraries.php
index 48e979f9a..b3548346c 100644
--- a/admin/models/fields/libraries.php
+++ b/admin/models/fields/libraries.php
@@ -38,15 +38,15 @@ class JFormFieldLibraries extends JFormFieldList
protected function getInput()
{
// see if we should add buttons
- $setButton = $this->getAttribute('button');
+ $set_button = $this->getAttribute('button');
// get html
$html = parent::getInput();
// if true set button
- if ($setButton === 'true')
+ if ($set_button === 'true')
{
$button = array();
$script = array();
- $buttonName = $this->getAttribute('name');
+ $button_code_name = $this->getAttribute('name');
// get the input from url
$app = JFactory::getApplication();
$jinput = $app->input;
@@ -70,55 +70,52 @@ class JFormFieldLibraries extends JFormFieldList
$ref .= '&return=' . $_return;
$refJ .= '&return=' . $_return;
}
+ // get button label
+ $button_label = trim($button_code_name);
+ $button_label = preg_replace('/_+/', ' ', $button_label);
+ $button_label = preg_replace('/\s+/', ' ', $button_label);
+ $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
+ $button_label = ucfirst(strtolower($button_label));
+ // get user object
$user = JFactory::getUser();
// only add if user allowed to create library
if ($user->authorise('library.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build Create button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
';
}
// only add if user allowed to edit library
- if (($buttonName === 'library' || $buttonName === 'libraries') && $user->authorise('library.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ if ($user->authorise('library.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build edit button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
+ $button[] = '
';
// build script
$script[] = "
jQuery(document).ready(function() {
- jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
+ jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) {
e.preventDefault();
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- function ".$buttonName."Button(value) {
+ function ".$button_code_name."Button(value) {
if (value > 0) {
// hide the create button
- jQuery('#".$buttonName."Create').hide();
+ jQuery('#".$button_code_name."Create').hide();
// show edit button
- jQuery('#".$buttonName."Edit').show();
+ jQuery('#".$button_code_name."Edit').show();
var url = 'index.php?option=com_componentbuilder&view=libraries&task=library.edit&id='+value+'".$refJ."';
- jQuery('#".$buttonName."Edit').attr('href', url);
+ jQuery('#".$button_code_name."Edit').attr('href', url);
} else {
// show the create button
- jQuery('#".$buttonName."Create').show();
+ jQuery('#".$button_code_name."Create').show();
// hide edit button
- jQuery('#".$buttonName."Edit').hide();
+ jQuery('#".$button_code_name."Edit').hide();
}
}";
}
diff --git a/admin/models/fields/librariesx.php b/admin/models/fields/librariesx.php
index 4846fa031..963cf17d0 100644
--- a/admin/models/fields/librariesx.php
+++ b/admin/models/fields/librariesx.php
@@ -38,15 +38,15 @@ class JFormFieldLibrariesx extends JFormFieldList
protected function getInput()
{
// see if we should add buttons
- $setButton = $this->getAttribute('button');
+ $set_button = $this->getAttribute('button');
// get html
$html = parent::getInput();
// if true set button
- if ($setButton === 'true')
+ if ($set_button === 'true')
{
$button = array();
$script = array();
- $buttonName = $this->getAttribute('name');
+ $button_code_name = $this->getAttribute('name');
// get the input from url
$app = JFactory::getApplication();
$jinput = $app->input;
@@ -70,55 +70,52 @@ class JFormFieldLibrariesx extends JFormFieldList
$ref .= '&return=' . $_return;
$refJ .= '&return=' . $_return;
}
+ // get button label
+ $button_label = trim($button_code_name);
+ $button_label = preg_replace('/_+/', ' ', $button_label);
+ $button_label = preg_replace('/\s+/', ' ', $button_label);
+ $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
+ $button_label = ucfirst(strtolower($button_label));
+ // get user object
$user = JFactory::getUser();
// only add if user allowed to create library
if ($user->authorise('library.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build Create button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
';
}
// only add if user allowed to edit library
- if (($buttonName === 'library' || $buttonName === 'libraries') && $user->authorise('library.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ if ($user->authorise('library.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build edit button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
+ $button[] = '
';
// build script
$script[] = "
jQuery(document).ready(function() {
- jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
+ jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) {
e.preventDefault();
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- function ".$buttonName."Button(value) {
+ function ".$button_code_name."Button(value) {
if (value > 0) {
// hide the create button
- jQuery('#".$buttonName."Create').hide();
+ jQuery('#".$button_code_name."Create').hide();
// show edit button
- jQuery('#".$buttonName."Edit').show();
+ jQuery('#".$button_code_name."Edit').show();
var url = 'index.php?option=com_componentbuilder&view=libraries&task=library.edit&id='+value+'".$refJ."';
- jQuery('#".$buttonName."Edit').attr('href', url);
+ jQuery('#".$button_code_name."Edit').attr('href', url);
} else {
// show the create button
- jQuery('#".$buttonName."Create').show();
+ jQuery('#".$button_code_name."Create').show();
// hide edit button
- jQuery('#".$buttonName."Edit').hide();
+ jQuery('#".$button_code_name."Edit').hide();
}
}";
}
diff --git a/admin/models/fields/library.php b/admin/models/fields/library.php
index 98d37479b..98ae99b44 100644
--- a/admin/models/fields/library.php
+++ b/admin/models/fields/library.php
@@ -38,15 +38,15 @@ class JFormFieldLibrary extends JFormFieldList
protected function getInput()
{
// see if we should add buttons
- $setButton = $this->getAttribute('button');
+ $set_button = $this->getAttribute('button');
// get html
$html = parent::getInput();
// if true set button
- if ($setButton === 'true')
+ if ($set_button === 'true')
{
$button = array();
$script = array();
- $buttonName = $this->getAttribute('name');
+ $button_code_name = $this->getAttribute('name');
// get the input from url
$app = JFactory::getApplication();
$jinput = $app->input;
@@ -70,55 +70,52 @@ class JFormFieldLibrary extends JFormFieldList
$ref .= '&return=' . $_return;
$refJ .= '&return=' . $_return;
}
+ // get button label
+ $button_label = trim($button_code_name);
+ $button_label = preg_replace('/_+/', ' ', $button_label);
+ $button_label = preg_replace('/\s+/', ' ', $button_label);
+ $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
+ $button_label = ucfirst(strtolower($button_label));
+ // get user object
$user = JFactory::getUser();
// only add if user allowed to create library
if ($user->authorise('library.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build Create button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
';
}
// only add if user allowed to edit library
- if (($buttonName === 'library' || $buttonName === 'libraries') && $user->authorise('library.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ if ($user->authorise('library.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build edit button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
+ $button[] = '
';
// build script
$script[] = "
jQuery(document).ready(function() {
- jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
+ jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) {
e.preventDefault();
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- function ".$buttonName."Button(value) {
+ function ".$button_code_name."Button(value) {
if (value > 0) {
// hide the create button
- jQuery('#".$buttonName."Create').hide();
+ jQuery('#".$button_code_name."Create').hide();
// show edit button
- jQuery('#".$buttonName."Edit').show();
+ jQuery('#".$button_code_name."Edit').show();
var url = 'index.php?option=com_componentbuilder&view=libraries&task=library.edit&id='+value+'".$refJ."';
- jQuery('#".$buttonName."Edit').attr('href', url);
+ jQuery('#".$button_code_name."Edit').attr('href', url);
} else {
// show the create button
- jQuery('#".$buttonName."Create').show();
+ jQuery('#".$button_code_name."Create').show();
// hide edit button
- jQuery('#".$buttonName."Edit').hide();
+ jQuery('#".$button_code_name."Edit').hide();
}
}";
}
diff --git a/admin/models/fields/maingets.php b/admin/models/fields/maingets.php
index fd4dbedb8..bdf871525 100644
--- a/admin/models/fields/maingets.php
+++ b/admin/models/fields/maingets.php
@@ -38,15 +38,15 @@ class JFormFieldMaingets extends JFormFieldList
protected function getInput()
{
// see if we should add buttons
- $setButton = $this->getAttribute('button');
+ $set_button = $this->getAttribute('button');
// get html
$html = parent::getInput();
// if true set button
- if ($setButton === 'true')
+ if ($set_button === 'true')
{
$button = array();
$script = array();
- $buttonName = $this->getAttribute('name');
+ $button_code_name = $this->getAttribute('name');
// get the input from url
$app = JFactory::getApplication();
$jinput = $app->input;
@@ -70,55 +70,52 @@ class JFormFieldMaingets extends JFormFieldList
$ref .= '&return=' . $_return;
$refJ .= '&return=' . $_return;
}
+ // get button label
+ $button_label = trim($button_code_name);
+ $button_label = preg_replace('/_+/', ' ', $button_label);
+ $button_label = preg_replace('/\s+/', ' ', $button_label);
+ $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
+ $button_label = ucfirst(strtolower($button_label));
+ // get user object
$user = JFactory::getUser();
// only add if user allowed to create dynamic_get
if ($user->authorise('dynamic_get.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build Create button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
';
}
// only add if user allowed to edit dynamic_get
- if (($buttonName === 'dynamic_get' || $buttonName === 'dynamic_gets') && $user->authorise('dynamic_get.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ if ($user->authorise('dynamic_get.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build edit button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
+ $button[] = '
';
// build script
$script[] = "
jQuery(document).ready(function() {
- jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
+ jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) {
e.preventDefault();
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- function ".$buttonName."Button(value) {
+ function ".$button_code_name."Button(value) {
if (value > 0) {
// hide the create button
- jQuery('#".$buttonName."Create').hide();
+ jQuery('#".$button_code_name."Create').hide();
// show edit button
- jQuery('#".$buttonName."Edit').show();
+ jQuery('#".$button_code_name."Edit').show();
var url = 'index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_get.edit&id='+value+'".$refJ."';
- jQuery('#".$buttonName."Edit').attr('href', url);
+ jQuery('#".$button_code_name."Edit').attr('href', url);
} else {
// show the create button
- jQuery('#".$buttonName."Create').show();
+ jQuery('#".$button_code_name."Create').show();
// hide edit button
- jQuery('#".$buttonName."Edit').hide();
+ jQuery('#".$button_code_name."Edit').hide();
}
}";
}
diff --git a/admin/models/fields/servers.php b/admin/models/fields/servers.php
index 4b919abb3..8e565392d 100644
--- a/admin/models/fields/servers.php
+++ b/admin/models/fields/servers.php
@@ -38,15 +38,15 @@ class JFormFieldServers extends JFormFieldList
protected function getInput()
{
// see if we should add buttons
- $setButton = $this->getAttribute('button');
+ $set_button = $this->getAttribute('button');
// get html
$html = parent::getInput();
// if true set button
- if ($setButton === 'true')
+ if ($set_button === 'true')
{
$button = array();
$script = array();
- $buttonName = $this->getAttribute('name');
+ $button_code_name = $this->getAttribute('name');
// get the input from url
$app = JFactory::getApplication();
$jinput = $app->input;
@@ -70,55 +70,52 @@ class JFormFieldServers extends JFormFieldList
$ref .= '&return=' . $_return;
$refJ .= '&return=' . $_return;
}
+ // get button label
+ $button_label = trim($button_code_name);
+ $button_label = preg_replace('/_+/', ' ', $button_label);
+ $button_label = preg_replace('/\s+/', ' ', $button_label);
+ $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
+ $button_label = ucfirst(strtolower($button_label));
+ // get user object
$user = JFactory::getUser();
// only add if user allowed to create server
if ($user->authorise('server.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build Create button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
';
}
// only add if user allowed to edit server
- if (($buttonName === 'server' || $buttonName === 'servers') && $user->authorise('server.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ if ($user->authorise('server.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build edit button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
+ $button[] = '
';
// build script
$script[] = "
jQuery(document).ready(function() {
- jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
+ jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) {
e.preventDefault();
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- function ".$buttonName."Button(value) {
+ function ".$button_code_name."Button(value) {
if (value > 0) {
// hide the create button
- jQuery('#".$buttonName."Create').hide();
+ jQuery('#".$button_code_name."Create').hide();
// show edit button
- jQuery('#".$buttonName."Edit').show();
+ jQuery('#".$button_code_name."Edit').show();
var url = 'index.php?option=com_componentbuilder&view=servers&task=server.edit&id='+value+'".$refJ."';
- jQuery('#".$buttonName."Edit').attr('href', url);
+ jQuery('#".$button_code_name."Edit').attr('href', url);
} else {
// show the create button
- jQuery('#".$buttonName."Create').show();
+ jQuery('#".$button_code_name."Create').show();
// hide edit button
- jQuery('#".$buttonName."Edit').hide();
+ jQuery('#".$button_code_name."Edit').hide();
}
}";
}
diff --git a/admin/models/fields/snippets.php b/admin/models/fields/snippets.php
index 9ca601511..d5c46f2fb 100644
--- a/admin/models/fields/snippets.php
+++ b/admin/models/fields/snippets.php
@@ -38,15 +38,15 @@ class JFormFieldSnippets extends JFormFieldList
protected function getInput()
{
// see if we should add buttons
- $setButton = $this->getAttribute('button');
+ $set_button = $this->getAttribute('button');
// get html
$html = parent::getInput();
// if true set button
- if ($setButton === 'true')
+ if ($set_button === 'true')
{
$button = array();
$script = array();
- $buttonName = $this->getAttribute('name');
+ $button_code_name = $this->getAttribute('name');
// get the input from url
$app = JFactory::getApplication();
$jinput = $app->input;
@@ -70,55 +70,52 @@ class JFormFieldSnippets extends JFormFieldList
$ref .= '&return=' . $_return;
$refJ .= '&return=' . $_return;
}
+ // get button label
+ $button_label = trim($button_code_name);
+ $button_label = preg_replace('/_+/', ' ', $button_label);
+ $button_label = preg_replace('/\s+/', ' ', $button_label);
+ $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
+ $button_label = ucfirst(strtolower($button_label));
+ // get user object
$user = JFactory::getUser();
// only add if user allowed to create snippet
if ($user->authorise('core.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build Create button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
';
}
// only add if user allowed to edit snippet
- if (($buttonName === 'snippet' || $buttonName === 'snippets') && $user->authorise('core.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ if ($user->authorise('core.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build edit button
- $buttonNamee = trim($buttonName);
- $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
- $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
- $buttonNamee = ucfirst(strtolower($buttonNamee));
- $button[] = '
+ $button[] = '
';
// build script
$script[] = "
jQuery(document).ready(function() {
- jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
+ jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) {
e.preventDefault();
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
- ".$buttonName."Button(".$buttonName."Value);
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
});
- function ".$buttonName."Button(value) {
+ function ".$button_code_name."Button(value) {
if (value > 0) {
// hide the create button
- jQuery('#".$buttonName."Create').hide();
+ jQuery('#".$button_code_name."Create').hide();
// show edit button
- jQuery('#".$buttonName."Edit').show();
+ jQuery('#".$button_code_name."Edit').show();
var url = 'index.php?option=com_componentbuilder&view=snippets&task=snippet.edit&id='+value+'".$refJ."';
- jQuery('#".$buttonName."Edit').attr('href', url);
+ jQuery('#".$button_code_name."Edit').attr('href', url);
} else {
// show the create button
- jQuery('#".$buttonName."Create').show();
+ jQuery('#".$button_code_name."Create').show();
// hide edit button
- jQuery('#".$buttonName."Edit').hide();
+ jQuery('#".$button_code_name."Edit').hide();
}
}";
}