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

@@ 186-191 (lines=6) @@
183
        switch ($type) {
184
            case 'autocomplete':
185
                $options = $colInfo['colParams']['options'];
186
                if (isset($options['snippet']) && is_string($options['snippet'])) {
187
                    $snippets = \App::$cur->Ui->getSnippets('autocomplete');
188
                    if (isset($snippets[$options['snippet']])) {
189
                        $value = $snippets[$options['snippet']]['getValueText']($item->$colName, $options['snippetParams']);
190
                    }
191
                }
192
                break;
193
            case 'select':
194
                switch ($colInfo['colParams']['source']) {