Added none as the fallback if an editor gets unpublished.

This commit is contained in:
Llewellyn van der Merwe 2018-07-07 00:27:29 +02:00
parent 2b39af94a2
commit 9fd59f2353
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
12 changed files with 84 additions and 29 deletions

View File

@ -129,7 +129,7 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Version*: 2.8.2
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **186163**
+ *Line count*: **186219**
+ *Field count*: **1058**
+ *File count*: **1238**
+ *Folder count*: **197**

View File

@ -129,7 +129,7 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo
+ *Version*: 2.8.2
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **186163**
+ *Line count*: **186219**
+ *Field count*: **1058**
+ *File count*: **1238**
+ *Folder count*: **197**

View File

@ -99,9 +99,6 @@ class Mapping
*/
public function __construct($data = false)
{
// set the app to insure messages can be set
$this->app = JFactory::getApplication();
if (ComponentbuilderHelper::checkArray($data))
{
if (isset($data['buildcomp']) && 1 == $data['buildcomp'] && isset($data['buildcompsql']))

View File

@ -36,6 +36,8 @@ class Extrusion extends Builder
*/
public function __construct(&$data)
{
// set the app to insure messages can be set
$this->app = JFactory::getApplication();
// make sure we have an id
if (isset($data['id']) && $data['id'] > 0)
{

View File

@ -508,11 +508,18 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
// update all editors to use this components global editor
$global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none');
// now get all the editor fields
$editors = $form->getXml()->xpath("//field[@type='editor']");
foreach ($editors as $editor)
// check if we found any
if (ComponentbuilderHelper::checkArray($editors))
{
$name = (string) $editor['name'];
$form->setFieldAttribute($name, 'editor', $global_editor);
foreach ($editors as $editor)
{
// get the field names
$name = (string) $editor['name'];
// set the field editor value (with none as fallback)
$form->setFieldAttribute($name, 'editor', $global_editor . '|none');
}
}
return $form;

View File

@ -329,11 +329,18 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
// update all editors to use this components global editor
$global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none');
// now get all the editor fields
$editors = $form->getXml()->xpath("//field[@type='editor']");
foreach ($editors as $editor)
// check if we found any
if (ComponentbuilderHelper::checkArray($editors))
{
$name = (string) $editor['name'];
$form->setFieldAttribute($name, 'editor', $global_editor);
foreach ($editors as $editor)
{
// get the field names
$name = (string) $editor['name'];
// set the field editor value (with none as fallback)
$form->setFieldAttribute($name, 'editor', $global_editor . '|none');
}
}
return $form;

View File

@ -186,11 +186,18 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
// update all editors to use this components global editor
$global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none');
// now get all the editor fields
$editors = $form->getXml()->xpath("//field[@type='editor']");
foreach ($editors as $editor)
// check if we found any
if (ComponentbuilderHelper::checkArray($editors))
{
$name = (string) $editor['name'];
$form->setFieldAttribute($name, 'editor', $global_editor);
foreach ($editors as $editor)
{
// get the field names
$name = (string) $editor['name'];
// set the field editor value (with none as fallback)
$form->setFieldAttribute($name, 'editor', $global_editor . '|none');
}
}
return $form;

View File

@ -336,11 +336,18 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
// update all editors to use this components global editor
$global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none');
// now get all the editor fields
$editors = $form->getXml()->xpath("//field[@type='editor']");
foreach ($editors as $editor)
// check if we found any
if (ComponentbuilderHelper::checkArray($editors))
{
$name = (string) $editor['name'];
$form->setFieldAttribute($name, 'editor', $global_editor);
foreach ($editors as $editor)
{
// get the field names
$name = (string) $editor['name'];
// set the field editor value (with none as fallback)
$form->setFieldAttribute($name, 'editor', $global_editor . '|none');
}
}
return $form;

View File

@ -364,11 +364,18 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
// update all editors to use this components global editor
$global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none');
// now get all the editor fields
$editors = $form->getXml()->xpath("//field[@type='editor']");
foreach ($editors as $editor)
// check if we found any
if (ComponentbuilderHelper::checkArray($editors))
{
$name = (string) $editor['name'];
$form->setFieldAttribute($name, 'editor', $global_editor);
foreach ($editors as $editor)
{
// get the field names
$name = (string) $editor['name'];
// set the field editor value (with none as fallback)
$form->setFieldAttribute($name, 'editor', $global_editor . '|none');
}
}
return $form;

View File

@ -224,11 +224,18 @@ class ComponentbuilderModelLayout extends JModelAdmin
// update all editors to use this components global editor
$global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none');
// now get all the editor fields
$editors = $form->getXml()->xpath("//field[@type='editor']");
foreach ($editors as $editor)
// check if we found any
if (ComponentbuilderHelper::checkArray($editors))
{
$name = (string) $editor['name'];
$form->setFieldAttribute($name, 'editor', $global_editor);
foreach ($editors as $editor)
{
// get the field names
$name = (string) $editor['name'];
// set the field editor value (with none as fallback)
$form->setFieldAttribute($name, 'editor', $global_editor . '|none');
}
}
return $form;

View File

@ -347,11 +347,18 @@ class ComponentbuilderModelSite_view extends JModelAdmin
// update all editors to use this components global editor
$global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none');
// now get all the editor fields
$editors = $form->getXml()->xpath("//field[@type='editor']");
foreach ($editors as $editor)
// check if we found any
if (ComponentbuilderHelper::checkArray($editors))
{
$name = (string) $editor['name'];
$form->setFieldAttribute($name, 'editor', $global_editor);
foreach ($editors as $editor)
{
// get the field names
$name = (string) $editor['name'];
// set the field editor value (with none as fallback)
$form->setFieldAttribute($name, 'editor', $global_editor . '|none');
}
}
return $form;

View File

@ -224,11 +224,18 @@ class ComponentbuilderModelTemplate extends JModelAdmin
// update all editors to use this components global editor
$global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none');
// now get all the editor fields
$editors = $form->getXml()->xpath("//field[@type='editor']");
foreach ($editors as $editor)
// check if we found any
if (ComponentbuilderHelper::checkArray($editors))
{
$name = (string) $editor['name'];
$form->setFieldAttribute($name, 'editor', $global_editor);
foreach ($editors as $editor)
{
// get the field names
$name = (string) $editor['name'];
// set the field editor value (with none as fallback)
$form->setFieldAttribute($name, 'editor', $global_editor . '|none');
}
}
return $form;