Fixed gh-467 so that the XML build of fields will work correctly with the new groupedlist field type. Added placeholders to class comments.

This commit is contained in:
2019-08-26 08:54:16 +02:00
parent d2f94d84fa
commit 9fcc5c3930
7 changed files with 41 additions and 15 deletions

View File

@ -862,7 +862,7 @@ class Get
end($version);
$key = key($version);
// just increment the last
$version[$key] ++;
$version[$key]++;
// set the old version
$this->componentData->old_component_version = $this->componentData->component_version;
// set the new version, and set update switch
@ -5695,8 +5695,8 @@ class Get
/**
* Set a type of placeholder with set of values
*
* @param string $key The main string for placeholder key
* @param array $values The values to add
* @param string $key The main string for placeholder key
* @param array $values The values to add
*
* @return void
*/
@ -6283,6 +6283,14 @@ class Get
$plugin->file_name = strtolower($plugin->code_name);
// set official_name lang strings
$this->setLangContent($plugin->key, $this->langPrefix, $plugin->official_name);
// set some placeholder for this plugin
$this->placeholders[$this->bbb . 'Plugin_name' . $this->ddd] = $plugin->official_name;
$this->placeholders[$this->bbb . 'Plugin' . $this->ddd] = ucfirst($plugin->code_name);
$this->placeholders[$this->bbb . 'plugin' . $this->ddd] = strtolower($plugin->code_name);
$this->placeholders[$this->bbb . 'Plugin_group' . $this->ddd] = ucfirst($plugin->group);
$this->placeholders[$this->bbb . 'plugin_group' . $this->ddd] = strtolower($plugin->group);
$this->placeholders[$this->bbb . 'plugin.version' . $this->ddd] = $plugin->plugin_version;
$this->placeholders[$this->bbb . 'plugin_version' . $this->ddd] = str_replace('.', '_', $plugin->plugin_version);
// set description (TODO) add description field to plugin
if (!isset($plugin->description) || !ComponentbuilderHelper::checkString($plugin->description))
{
@ -6592,6 +6600,14 @@ class Get
$this->lang = $_backup_lang;
$this->langPrefix = $_backup_langPrefix;
unset($this->placeholders[$this->bbb . 'Plugin_name' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'Plugin' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'plugin' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'Plugin_group' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'plugin_group' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'plugin.version' . $this->ddd]);
unset($this->placeholders[$this->bbb . 'plugin_version' . $this->ddd]);
$this->joomlaPlugins[$id] = $plugin;
return true;

View File

@ -1800,7 +1800,7 @@ class Fields extends Structure
foreach ($grouped_[$key_][$_id] as $option_)
{
$groupOptionXML = $groupXML->fieldXML->addChild('option');
$groupOptionXML = $groupXML->addChild('option');
$groupOptionXML->addAttribute('value', $option_['value']);
$groupOptionXML[] = $option_['text'];
}