[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Source view] [Print] [Project Stats]
(no description)
Copyright: | (C) 2017 Open Source Matters, Inc. |
License: | GNU General Public License version 2 or later; see LICENSE.txt |
File Size: | 363 lines (13 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
ContenthistoryHelper:: (10 methods):
createObjectArray()
decodeFields()
getFormValues()
getFormFile()
getLookupValue()
hideFields()
loadLanguageFiles()
mergeLabels()
prepareData()
processLookupFields()
Class: ContenthistoryHelper - X-Ref
Categories helper.createObjectArray($object) X-Ref |
Method to put all field names, including nested ones, in a single array for easy lookup. param: \stdClass $object Standard class object that may contain one level of nested objects. return: array Associative array of all field names, including ones in a nested object. |
decodeFields($jsonString) X-Ref |
Method to decode JSON-encoded fields in a standard object. Used to unpack JSON strings in the content history data column. param: string $jsonString JSON String to convert to an object. return: \stdClass Object with any JSON-encoded fields unpacked. |
getFormValues($object, ContentType $typesTable) X-Ref |
Method to get field labels for the fields in the JSON-encoded object. First we see if we can find translatable labels for the fields in the object. We translate any we can find and return an array in the format object->name => label. param: \stdClass $object Standard class object in the format name->value. param: ContentType $typesTable Table object with content history options. return: \stdClass Contains two associative arrays. |
getFormFile(ContentType $typesTable) X-Ref |
Method to get the XML form file for this component. Used to get translated field names for history preview. param: ContentType $typesTable Table object with content history options. return: mixed \JModel object if successful, false if no model found. |
getLookupValue($lookup, $value) X-Ref |
Method to query the database using values from lookup objects. param: \stdClass $lookup The std object with the values needed to do the query. param: mixed $value The value used to find the matching title or name. Typically the id. return: mixed Value from database (for example, name or title) on success, false on failure. |
hideFields($object, ContentType $typeTable) X-Ref |
Method to remove fields from the object based on values entered in the #__content_types table. param: \stdClass $object Object to be passed to view layout file. param: ContentType $typeTable Table object with content history options. return: \stdClass object with hidden fields removed. |
loadLanguageFiles($typeAlias) X-Ref |
Method to load the language files for the component whose history is being viewed. param: string $typeAlias The type alias, for example 'com_content.article'. return: void |
mergeLabels($object, $formValues) X-Ref |
Method to create object to pass to the layout. Format is as follows: field is std object with name, value. Value can be a std object with name, value pairs. param: \stdClass $object The std object from the JSON string. Can be nested 1 level deep. param: \stdClass $formValues Standard class of label and value in an associative array. return: \stdClass Object with translated labels where available |
prepareData(ContentHistory $table) X-Ref |
Method to prepare the object for the preview and compare views. param: ContentHistory $table Table object loaded with data. return: \stdClass Object ready for the views. |
processLookupFields($object, ContentType $typesTable) X-Ref |
Method to process any lookup values found in the content_history_options column for this table. This allows category title and user name to be displayed instead of the id column. param: \stdClass $object The std object from the JSON string. Can be nested 1 level deep. param: ContentType $typesTable Table object loaded with data. return: \stdClass Object with lookup values inserted. |
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |