23require_once DOL_DOCUMENT_ROOT.
'/ecm/class/ecmdirectory.class.php';
62 public function selectAllSections($selected = 0, $select_name =
'', $module =
'ecm', $ids_to_ignore = array())
67 if ($select_name ==
'') {
68 $select_name =
"catParent";
70 if (!is_array($ids_to_ignore)) {
71 $ids_to_ignore = array($ids_to_ignore);
75 if ($module ==
'ecm') {
77 $cate_arbo = $cat->get_full_arbo();
78 } elseif ($module ==
'medias') {
79 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
80 $path =
$conf->medias->multidir_output[
$conf->entity];
81 $cate_arbo =
dol_dir_list($path,
'directories', 1,
'', array(
'(\.meta|_preview.*\.png)$',
'^\.'),
'relativename', SORT_ASC);
84 $output =
'<select class="flat minwidth100 maxwidth500" id="'.$select_name.
'" name="'.$select_name.
'">';
85 if (is_array($cate_arbo)) {
86 if (!count($cate_arbo)) {
87 $output .=
'<option value="-1" disabled>'.$langs->trans(
"NoDirectoriesFound").
'</option>';
89 $output .=
'<option value="-1"> </option>';
90 foreach ($cate_arbo as $key => $value) {
91 if (!in_array($cate_arbo[$key][
'id'], $ids_to_ignore)) {
92 $valueforoption = empty($cate_arbo[$key][
'id']) ? $cate_arbo[$key][
'relativename'] : $cate_arbo[$key][
'id'];
93 if ($selected && $valueforoption == $selected) {
98 $output .=
'<option '.$add.
'value="'.
dol_escape_htmltag($valueforoption).
'">'.(empty($cate_arbo[$key][
'fulllabel']) ? $cate_arbo[$key][
'relativename'] : $cate_arbo[$key][
'fulllabel']).
'</option>';
103 $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($utf8_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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...