['name' => 'German', 'script' => 'Latn', 'native' => 'Deutsch', 'regional' => 'de_DE'], 'en' => ['name' => 'English', 'script' => 'Latn', 'native' => 'English', 'regional' => 'en_GB'], 'es' => ['name' => 'Spanish', 'script' => 'Latn', 'native' => 'espaƱol', 'regional' => 'es_ES'], ]; $ret = []; foreach ($langs as $code => $lang) { $ret[strtolower($code)] = strtolower($lang['native']); } return $ret; } public static function makeNestableList($category_id) { $tags = DcTag::where('category_id', $category_id)->orderBy('pos')->get(); $out = ''; foreach ($tags as $tag) { $out .= '
  • '.$tag->name.'
  • '; } return $out; } public static function makeNestableListCheckbox($category_id, $file_id) { $tags = DcTag::where('category_id', $category_id)->orderBy('pos')->get(); $file_tags = DcFileTag::where('file_id', $file_id)->get(); $search = []; foreach ($file_tags as $file_tag) { $search[] = $file_tag->tag_id; } $out = ''; foreach ($tags as $tag) { $out .= '
  • '; } return $out; } public static function makeFilterList($filter_list, $split = false, $chunk = false) { $out = ''; $splitOn = 0; if ($split) { $count = count($filter_list); if ($count > 0) { $splitOn = intval(ceil($count / $split)); $filter_chunk = array_chunk($filter_list, $splitOn, true); $filter_list = $filter_chunk[$chunk]; } } foreach ($filter_list as $category_id => $value) { $out .= ''; $out .= ''; } return $out; } private function getAttributesOptions($ids = [], $all = true) { $ret = ''; return $ret; } }