Admin Boxes Method formatAdminBox()

public function formatAdminBox(
$path, $settingGroup, &$box, &$fields, &$values, $changes
) { //...your PHP code...// }

Summary

Use this method to format the contents of an Admin Box.

Context

This method is called straight after your fillAdminBox() and validateAdminBox() methods.

Where You Can Use It

From Zenario 7.0.0 onwards.

Description

This method is called just before an administrator sees an Admin Box, i.e. after your fillAdminBox() and validateAdminBox() methods.

If you have display logic that you wish to run every time an Admin Box is displayed you can write it in this method.

Parameters

$path

The path of the Admin Box opened.

$settingGroup

When showing an Admin Box for Plugin Settings or Site Settings, this variable will contain the name of the Module or Settings Group.

$box

The TUIX that defines your Admin Box, in the form of a PHP array.

You should make changes to this array as needed.

$fields

Shortcuts to the field definitions in your Admin Box.

E.g. $fields['tab_name/field_name'] references $box['tabs']['tab_name']['fields']['field_name']

$values

Shortcuts to the field values in your Admin Box.

The shortcuts are "smart" and will reference the value property after your fillAdminBox() method, and the current_value property after your validateAdminBox() method.

E.g. $values['tab_name/field_name'] references $box['tabs']['tab_name']['fields']['field_name']['value'] after your fillAdminBox() method, and $box['tabs']['tab_name']['fields']['field_name']['current_value'] after your validateAdminBox() method.

$changes

This parameter currently deprecated and should not be used. In the future it may be replaced by something more useful.

Return Value

No return value is needed.