added a switch to insure that one of the custom fields of the same type are seen as the prime field, so to insure that its PHP values over rule all other
This commit is contained in:
parent
9d64afe138
commit
61a8d6fe3f
@ -1512,6 +1512,11 @@ class Fields extends Structure
|
|||||||
// load the php for the custom field file
|
// load the php for the custom field file
|
||||||
$fieldAttributes['custom']['phpx'][$phpLine] = ComponentbuilderHelper::getBetween($field['settings']->xml, $property['name'] . '="', '"');
|
$fieldAttributes['custom']['phpx'][$phpLine] = ComponentbuilderHelper::getBetween($field['settings']->xml, $property['name'] . '="', '"');
|
||||||
}
|
}
|
||||||
|
elseif ($property['name'] === 'prime_php' && $setCustom)
|
||||||
|
{
|
||||||
|
// load the php for the custom field file
|
||||||
|
$fieldAttributes['custom']['prime_php'] = (int) ComponentbuilderHelper::getBetween($field['settings']->xml, $property['name'] . '="', '"');
|
||||||
|
}
|
||||||
elseif ($property['name'] === 'extends' && $setCustom)
|
elseif ($property['name'] === 'extends' && $setCustom)
|
||||||
{
|
{
|
||||||
// load the class that is being extended
|
// load the class that is being extended
|
||||||
@ -2139,8 +2144,8 @@ class Fields extends Structure
|
|||||||
|
|
||||||
public function setCustomFieldTypeFile($data, $viewName_list, $viewName_single)
|
public function setCustomFieldTypeFile($data, $viewName_list, $viewName_single)
|
||||||
{
|
{
|
||||||
// make sure it is not already been build
|
// make sure it is not already been build or if it is prime
|
||||||
if (!isset($this->fileContentDynamic['customfield_' . $data['type']]) || !ComponentbuilderHelper::checkArray($this->fileContentDynamic['customfield_' . $data['type']]))
|
if ((isset($data['custom']['prime_php']) && $data['custom']['prime_php'] == 1) || !isset($this->fileContentDynamic['customfield_' . $data['type']]) || !ComponentbuilderHelper::checkArray($this->fileContentDynamic['customfield_' . $data['type']]))
|
||||||
{
|
{
|
||||||
// first build the custom field type file
|
// first build the custom field type file
|
||||||
$target = array('admin' => 'customfield');
|
$target = array('admin' => 'customfield');
|
||||||
|
@ -151,7 +151,7 @@ class JFormFieldServers extends JFormFieldList
|
|||||||
{
|
{
|
||||||
$db = JFactory::getDBO();
|
$db = JFactory::getDBO();
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
$query->select($db->quoteName(array('a.id','a.name','a.protocol'),array('id','cronjob_backup_server_name', 'protocol')));
|
$query->select($db->quoteName(array('a.id','a.name','a.protocol'),array('id','name', 'protocol')));
|
||||||
$query->from($db->quoteName('#__componentbuilder_server', 'a'));
|
$query->from($db->quoteName('#__componentbuilder_server', 'a'));
|
||||||
$query->where($db->quoteName('a.published') . ' >= 1');
|
$query->where($db->quoteName('a.published') . ' >= 1');
|
||||||
$query->order('a.name ASC');
|
$query->order('a.name ASC');
|
||||||
@ -164,7 +164,7 @@ class JFormFieldServers extends JFormFieldList
|
|||||||
foreach($items as $item)
|
foreach($items as $item)
|
||||||
{
|
{
|
||||||
$item->protocol = ($item->protocol == 2) ? JText::_('SFTP') : JText::_('FTP');
|
$item->protocol = ($item->protocol == 2) ? JText::_('SFTP') : JText::_('FTP');
|
||||||
$options[] = JHtml::_('select.option', $item->id, $item->cronjob_backup_server_name.' ['.$item->protocol.']');
|
$options[] = JHtml::_('select.option', $item->id, $item->name.' ['.$item->protocol.']');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user