22require_once DOL_DOCUMENT_ROOT.
'/ecm/class/ecmdirectory.class.php';
61 public function selectAllSections($selected = 0, $select_name =
'', $module =
'ecm', $ids_to_ignore = array())
66 if ($select_name ==
'') {
67 $select_name =
"catParent";
69 if (!is_array($ids_to_ignore)) {
70 $ids_to_ignore = array($ids_to_ignore);
74 if ($module ==
'ecm') {
76 $cate_arbo = $cat->get_full_arbo();
77 } elseif ($module ==
'medias') {
78 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
79 $path = $conf->medias->multidir_output[$conf->entity];
80 $cate_arbo =
dol_dir_list($path,
'directories', 1,
'', array(
'(\.meta|_preview.*\.png)$',
'^\.'),
'relativename', SORT_ASC);
83 $output =
'<select class="flat minwidth100 maxwidth500" id="'.$select_name.
'" name="'.$select_name.
'">';
84 if (is_array($cate_arbo)) {
85 if (!count($cate_arbo)) {
86 $output .=
'<option value="-1" disabled>'.$langs->trans(
"NoDirectoriesFound").
'</option>';
88 $output .=
'<option value="-1"> </option>';
89 foreach ($cate_arbo as $key => $value) {
90 if (!in_array($cate_arbo[$key][
'id'], $ids_to_ignore)) {
91 $valueforoption = empty($cate_arbo[$key][
'id']) ? $cate_arbo[$key][
'relativename'] : $cate_arbo[$key][
'id'];
92 if ($selected && $valueforoption == $selected) {
97 $output .=
'<option '.$add.
'value="'.
dol_escape_htmltag($valueforoption).
'">'.(empty($cate_arbo[$key][
'fulllabel']) ? $cate_arbo[$key][
'relativename'] : $cate_arbo[$key][
'fulllabel']).
'</option>';
102 $output .=
'</select>';
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
Class to manage ECM directories.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...