Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe ContenthistoryHelper
+ Graphe d'héritage de ContenthistoryHelper:

Fonctions membres publiques statiques

static createObjectArray ($object)
 
static decodeFields ($jsonString)
 
static getFormValues ($object, ContentType $typesTable)
 
static getFormFile (ContentType $typesTable)
 
static getLookupValue ($lookup, $value)
 
static hideFields ($object, ContentType $typeTable)
 
static loadLanguageFiles ($typeAlias)
 
static mergeLabels ($object, $formValues)
 
static prepareData (ContentHistory $table)
 
static processLookupFields ($object, ContentType $typesTable)
 

Description détaillée

Categories helper.

Depuis
3.2

Documentation des fonctions membres

◆ createObjectArray()

static createObjectArray (   $object)
static

Method to put all field names, including nested ones, in a single array for easy lookup.

Paramètres
\stdClass$objectStandard class object that may contain one level of nested objects.
Renvoie
array Associative array of all field names, including ones in a nested object.
Depuis
3.2

Références $name, $result, $value, et null.

◆ decodeFields()

static decodeFields (   $jsonString)
static

Method to decode JSON-encoded fields in a standard object. Used to unpack JSON strings in the content history data column.

Paramètres
string$jsonStringJSON String to convert to an object.
Renvoie
Object with any JSON-encoded fields unpacked.
Depuis
3.2

Références $name, et $value.

◆ getFormFile()

static getFormFile ( ContentType  $typesTable)
static

Method to get the XML form file for this component. Used to get translated field names for history preview.

Paramètres
ContentType$typesTableTable object with content history options.
Renvoie
mixed object if successful, false if no model found.
Depuis
3.2

Références $component, $options, $path, $result, File\exists(), JPATH_ADMINISTRATOR, JPATH_ROOT, File\makeSafe(), et Folder\makeSafe().

◆ getFormValues()

static getFormValues (   $object,
ContentType  $typesTable 
)
static

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ètres
\stdClass$objectStandard class object in the format name->value.
ContentType$typesTableTable object with content history options.
Renvoie
Contains two associative arrays. $formValues->labels in the format name => label (for example, 'id' => 'Article ID'). $formValues->values in the format name => value (for example, 'state' => 'Published'. This translates the text from the selected option in the form.
Depuis
3.2

Références $field, $label, $name, $result, $xml, Text\_(), et null.

◆ getLookupValue()

static getLookupValue (   $lookup,
  $value 
)
static

Method to query the database using values from lookup objects.

Paramètres
\stdClass$lookupThe std object with the values needed to do the query.
mixed$valueThe value used to find the matching title or name. Typically the id.
Renvoie
mixed Value from database (for example, name or title) on success, false on failure.
Depuis
3.2

Références $db, $query, $result, $value, Factory\getDbo(), et ParameterType\INTEGER.

◆ hideFields()

static hideFields (   $object,
ContentType  $typeTable 
)
static

Method to remove fields from the object based on values entered in the #__content_types table.

Paramètres
\stdClass$objectObject to be passed to view layout file.
ContentType$typeTableTable object with content history options.
Renvoie
object with hidden fields removed.
Depuis
3.2

Références $field, et $options.

◆ loadLanguageFiles()

static loadLanguageFiles (   $typeAlias)
static

Method to load the language files for the component whose history is being viewed.

Paramètres
string$typeAliasThe type alias, for example 'com_content.article'.
Renvoie
void
Depuis
3.2

Loading language file from the administrator/language directory then loading language file from the administrator/components/extension/language directory

Références $component, $lang, Path\clean(), Factory\getLanguage(), et JPATH_ADMINISTRATOR.

◆ mergeLabels()

static mergeLabels (   $object,
  $formValues 
)
static

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ètres
\stdClass$objectThe std object from the JSON string. Can be nested 1 level deep.
\stdClass$formValuesStandard class of label and value in an associative array.
Renvoie
Object with translated labels where available
Depuis
3.2

Références $name, $result, $value, et null.

◆ prepareData()

static prepareData ( ContentHistory  $table)
static

Method to prepare the object for the preview and compare views.

Paramètres
ContentHistory$tableTable object loaded with data.
Renvoie
Object ready for the views.
Depuis
3.2

Références Table\getInstance().

◆ processLookupFields()

static processLookupFields (   $object,
ContentType  $typesTable 
)
static

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ètres
\stdClass$objectThe std object from the JSON string. Can be nested 1 level deep.
ContentType$typesTableTable object loaded with data.
Renvoie
Object with lookup values inserted.
Depuis
3.2

Références $options.


La documentation de cette classe a été générée à partir du fichier suivant :