Move the Power, Plugin and Module builders into the container. Many more PHP 8 improvments.

This commit is contained in:
2023-01-29 22:12:42 +02:00
parent e6c02a29f6
commit 7edbe20c33
68 changed files with 3443 additions and 1681 deletions

View File

@ -658,7 +658,7 @@ class Fields extends Structure
$fieldSet[] = Indent::_(3) . 'readonly="true"';
$fieldSet[] = Indent::_(2) . "/>";
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// if created is not set
if (!isset($this->fieldsNames[$nameSingleCode]['created']))
@ -681,7 +681,7 @@ class Fields extends Structure
$fieldSet[] = Indent::_(3) . "filter=" . '"user_utc"';
$fieldSet[] = Indent::_(2) . "/>";
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// if created_by is not set
if (!isset($this->fieldsNames[$nameSingleCode]['created_by']))
@ -701,7 +701,7 @@ class Fields extends Structure
. '_CREATED_BY_DESC"';
$fieldSet[] = Indent::_(2) . "/>";
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// if published is not set
if (!isset($this->fieldsNames[$nameSingleCode]['published']))
@ -728,7 +728,7 @@ class Fields extends Structure
$fieldSet[] = Indent::_(4) . "JTRASHED</option>";
$fieldSet[] = Indent::_(2) . "</field>";
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// if modified is not set
if (!isset($this->fieldsNames[$nameSingleCode]['modified']))
@ -743,7 +743,7 @@ class Fields extends Structure
$fieldSet[] = Indent::_(3)
. 'size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />';
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// if modified_by is not set
if (!isset($this->fieldsNames[$nameSingleCode]['modified_by']))
@ -761,7 +761,7 @@ class Fields extends Structure
$fieldSet[] = Indent::_(3) . 'filter="unset"';
$fieldSet[] = Indent::_(2) . "/>";
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// check if view has access
if (isset($this->accessBuilder[$nameSingleCode])
@ -784,7 +784,7 @@ class Fields extends Structure
$fieldSet[] = Indent::_(3) . 'required="false"';
$fieldSet[] = Indent::_(2) . "/>";
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// if ordering is not set
if (!isset($this->fieldsNames[$nameSingleCode]['ordering']))
@ -807,7 +807,7 @@ class Fields extends Structure
$fieldSet[] = Indent::_(3) . 'required="false"';
$fieldSet[] = Indent::_(2) . "/>";
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// if version is not set
if (!isset($this->fieldsNames[$nameSingleCode]['version']))
@ -827,7 +827,7 @@ class Fields extends Structure
$fieldSet[] = Indent::_(3) . 'filter="unset"';
$fieldSet[] = Indent::_(2) . "/>";
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// check if metadata is added to this view
if (isset($this->metadataBuilder[$nameSingleCode])
@ -851,7 +851,7 @@ class Fields extends Structure
$fieldSet[] = Indent::_(3) . 'cols="30"';
$fieldSet[] = Indent::_(2) . "/>";
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// metadesc
if (!isset($this->fieldsNames[$nameSingleCode]['metadesc']))
@ -869,7 +869,7 @@ class Fields extends Structure
$fieldSet[] = Indent::_(3) . 'cols="30"';
$fieldSet[] = Indent::_(2) . "/>";
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
}
// fix the permissions field "title" issue gh-629
@ -896,7 +896,7 @@ class Fields extends Structure
. $nameSingleCode . '"';
$fieldSet[] = Indent::_(2) . "/>";
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
// setup needed field values for layout
$field_array = array();
$field_array['order_edit'] = 0;
@ -957,7 +957,7 @@ class Fields extends Structure
. '<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>';
$fieldSet[] = Indent::_(3) . '</field>';
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// author
if (!isset($this->fieldsNames[$nameSingleCode]['author']))
@ -972,7 +972,7 @@ class Fields extends Structure
$fieldSet[] = Indent::_(4) . 'size="20"';
$fieldSet[] = Indent::_(3) . "/>";
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// rights
if (!isset($this->fieldsNames[$nameSingleCode]['rights']))
@ -987,7 +987,7 @@ class Fields extends Structure
$fieldSet[] = Indent::_(4) . 'cols="30" rows="2"';
$fieldSet[] = Indent::_(3) . "/>";
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
$fieldSet[] = Indent::_(2) . "</fieldset>";
$fieldSet[] = Indent::_(1) . "</fields>";
@ -1084,7 +1084,7 @@ class Fields extends Structure
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// if created is not set
if (!isset($this->fieldsNames[$nameSingleCode]['created']))
@ -1106,7 +1106,7 @@ class Fields extends Structure
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// if created_by is not set
if (!isset($this->fieldsNames[$nameSingleCode]['created_by']))
@ -1125,7 +1125,7 @@ class Fields extends Structure
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// if published is not set
if (!isset($this->fieldsNames[$nameSingleCode]['published']))
@ -1143,7 +1143,7 @@ class Fields extends Structure
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
foreach (
array('JPUBLISHED' => 1, 'JUNPUBLISHED' => 0, 'JARCHIVED' => 2,
'JTRASHED' => -2) as $text => $value
@ -1175,7 +1175,7 @@ class Fields extends Structure
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// if modified_by is not set
if (!isset($this->fieldsNames[$nameSingleCode]['modified_by']))
@ -1196,7 +1196,7 @@ class Fields extends Structure
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// check if view has access
if (isset($this->accessBuilder[$nameSingleCode])
@ -1221,7 +1221,7 @@ class Fields extends Structure
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// if ordering is not set
if (!isset($this->fieldsNames[$nameSingleCode]['ordering']))
@ -1244,7 +1244,7 @@ class Fields extends Structure
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// if version is not set
if (!isset($this->fieldsNames[$nameSingleCode]['version']))
@ -1266,7 +1266,7 @@ class Fields extends Structure
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// check if metadata is added to this view
if (isset($this->metadataBuilder[$nameSingleCode])
@ -1294,7 +1294,7 @@ class Fields extends Structure
$fieldXML, $attributes
);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// metadesc
if (!isset($this->fieldsNames[$nameSingleCode]['metadesc']))
@ -1311,7 +1311,7 @@ class Fields extends Structure
$fieldXML, $attributes
);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
}
// fix the permissions field "title" issue gh-629
@ -1346,7 +1346,7 @@ class Fields extends Structure
$fieldXML = $fieldSetXML->addChild('field');
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
// setup needed field values for layout
$field_array = array();
$field_array['order_edit'] = 0;
@ -1409,7 +1409,7 @@ class Fields extends Structure
$robots, $attributes
);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
$options = array(
'JGLOBAL_USE_GLOBAL' => '',
'JGLOBAL_INDEX_FOLLOW' => 'index, follow',
@ -1443,7 +1443,7 @@ class Fields extends Structure
$author, $attributes
);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
// rights
if (!isset($this->fieldsNames[$nameSingleCode]['rights']))
@ -1467,7 +1467,7 @@ class Fields extends Structure
$rights, $attributes
);
// count the static field created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
}
}
}
@ -1891,7 +1891,7 @@ class Fields extends Structure
&$optionArray, $custom = null, $taber = ''
) {
// count the dynamic fields created
CFactory::_('Counter')->field++;
CFactory::_('Utilities.Counter')->field++;
// check what type of field builder to use
if (CFactory::_('Config')->get('field_builder_type', 2) == 1)
{