LogModel::formatConfiguration PHP Method

formatConfiguration() public method

Format a configuration subtree.
public formatConfiguration ( array $Data ) : string
$Data array The data to format.
return string Returns the formatted entry.
    public function formatConfiguration($Data)
    {
        $Old = $Data;
        $New = $Data['_New'];
        unset($Old['_New']);
        $Old = Gdn_Configuration::format($Old);
        $New = Gdn_Configuration::format($New);
        $Diffs = $this->formatDiff($Old, $New, 'raw');
        $Result = [];
        foreach ($Diffs as $Diff) {
            if (is_array($Diff)) {
                if (!empty($Diff['del'])) {
                    $Result[] = '<del>' . implode("<br />\n", $Diff['del']) . '</del>';
                }
                if (!empty($Diff['ins'])) {
                    $Result[] = '<ins>' . implode("<br />\n", $Diff['ins']) . '</ins>';
                }
            }
        }
        $Result = implode("<br />\n", $Result);
        if ($Result) {
            return $Result;
        } else {
            return t('No Change');
        }
    }