Further improved #37 to ensure language strings are set and reversed, also add extra buttons to the compiler page. Major restructure of custom code implementation to make it more stable. Resolved #40 by updating the default field sql values.
This commit is contained in:
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.3.2
|
||||
@build 11th February, 2017
|
||||
@version 2.3.4
|
||||
@build 13th February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage ajax.php
|
||||
@ -1262,10 +1262,6 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
return $db->loadResult();
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
protected function splitAtUpperCase($s) {
|
||||
return preg_split('/(?=[A-Z])/', $s, -1, PREG_SPLIT_NO_EMPTY);
|
||||
}
|
||||
|
||||
// Used in dynamic_get
|
||||
@ -1438,6 +1434,37 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
return false;
|
||||
}
|
||||
|
||||
// Used in custom_code
|
||||
public function checkFunctionName($name, $id)
|
||||
{
|
||||
$nameArray = (array) $this->splitAtUpperCase($name);
|
||||
$name = ComponentbuilderHelper::safeString(implode(' ', $nameArray), 'cA');
|
||||
if ($found = ComponentbuilderHelper::getVar('custom_code', $name, 'function_name', 'id'))
|
||||
{
|
||||
if ((int) $id !== (int) $found)
|
||||
{
|
||||
return array (
|
||||
'message' => JText::_('COM_COMPONENTBUILDER_SORRY_THIS_FUNCTION_NAME_IS_ALREADY_IN_USE'),
|
||||
'status' => 'danger');
|
||||
}
|
||||
}
|
||||
return array (
|
||||
'name' => $name,
|
||||
'message' => JText::_('COM_COMPONENTBUILDER_GREAT_THIS_FUNCTION_NAME_WILL_WORK'),
|
||||
'status' => 'success');
|
||||
}
|
||||
|
||||
protected function splitAtUpperCase($string)
|
||||
{
|
||||
return preg_split('/(?=[A-Z])/', $string, -1, PREG_SPLIT_NO_EMPTY);
|
||||
}
|
||||
|
||||
public function usedin($name, $id)
|
||||
{
|
||||
// search where this function is being used
|
||||
return array('in' => 'Soon we will show where this function is being used');
|
||||
}
|
||||
|
||||
// Used in field
|
||||
public function getFieldOptions($id)
|
||||
{
|
||||
|
Reference in New Issue
Block a user