Joomla CMS  3.8.5 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.8.5 et du framework Joomla Platform intégré
Référence de la classe ContenthistoryHelper

Fonctions membres publiques statiques

static createObjectArray ($object)
 
static decodeFields ($jsonString)
 
static getFormValues ($object, JTableContenttype $typesTable)
 
static getFormFile (JTableContenttype $typesTable)
 
static getLookupValue ($lookup, $value)
 
static hideFields ($object, JTableContenttype $typeTable)
 
static loadLanguageFiles ($typeAlias)
 
static mergeLabels ($object, $formValues)
 
static prepareData (JTableContenthistory $table)
 
static processLookupFields ($object, JTableContenttype $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, $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
stdClass$jsonStringStandard class object that may contain one or more JSON-encoded fields.
Renvoie
stdClass Object with any JSON-encoded fields unpacked.
Depuis
3.2

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

◆ getFormFile()

static getFormFile ( JTableContenttype  $typesTable)
static

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

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

Références $aliasArray, $component, $file, $options, $path, JFile\exists(), jimport(), JPATH_ADMINISTRATOR, JPATH_ROOT, JFile\makeSafe(), et JFolder\makeSafe().

◆ getFormValues()

static getFormValues (   $object,
JTableContenttype  $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.
JTableContenttype$typesTableTable object with content history options.
Renvoie
stdClass 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, 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, et $value.

◆ hideFields()

static hideFields (   $object,
JTableContenttype  $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.
JTableContenttype$typeTableTable object with content history options.
Renvoie
stdClass 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 $aliasArray, $component, $lang, JPath\clean(), JPATH_ADMINISTRATOR, et null.

◆ 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
stdClass Object with translated labels where available
Depuis
3.2

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

◆ prepareData()

static prepareData ( JTableContenthistory  $table)
static

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

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

◆ processLookupFields()

static processLookupFields (   $object,
JTableContenttype  $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.
JTableContenttype$typesTableTable object loaded with data.
Renvoie
stdClass 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 :