Code Duplication    Length = 6-6 lines in 2 locations

system/modules/Ui/widgets/Form/autocomplete.php 1 location

@@ 8-13 (lines=6) @@
5
echo $label !== false ? "<label>{$label}</label>" : '';
6
$value = !empty($options['value']) ? addcslashes($options['value'], "'") : (!empty($form->userDataTree[$name]) ? addcslashes($form->userDataTree[$name], "'") : '');
7
$displayValue = '';
8
if ($value && isset($options['snippet']) && is_string($options['snippet'])) {
9
    $snippets = App::$cur->Ui->getSnippets('autocomplete');
10
    if (isset($snippets[$options['snippet']])) {
11
        $displayValue = $snippets[$options['snippet']]['getValueText']($value, $options['snippetParams']);
12
    }
13
}
14
?>
15
<div style="position: relative;<?= !$value ? 'display:none' : ''; ?>" class="custominput-clear"
16
     onclick="$(this).next()[0].__inji_autocomplete.clear();$(this).next()[0].focus();">

system/Inji/Model.php 1 location

@@ 217-222 (lines=6) @@
214
        switch ($type) {
215
            case 'autocomplete':
216
                $options = $colInfo['colParams']['options'];
217
                if (isset($options['snippet']) && is_string($options['snippet'])) {
218
                    $snippets = \App::$cur->Ui->getSnippets('autocomplete');
219
                    if (isset($snippets[$options['snippet']])) {
220
                        $value = $snippets[$options['snippet']]['getValueText']($item->$colName, $options['snippetParams']);
221
                    }
222
                }
223
                break;
224
            case 'select':
225
                switch ($colInfo['colParams']['source']) {