unset($res['Collections'][$id]); } } */ ?> <form name="ml_upload"> <div style="margin: 10px; font-size: 13px;"> <?php echo GetMessage('FM_ML_UPL_LOACATE'); ?> : <select title="<?php echo GetMessage('ML_ADD_COL2ITEM'); ?> " name="collection_id" onchange="itemColsSelChange2(this, arguments[0] || window.event);"><?php echo CMedialib::_BuildCollectionsSelectOptions($res['Collections'], $res['arColTree'], 0, intVal($_GET['col_id'])); ?> </select> </div> </form> <? include_once($_SERVER['DOCUMENT_ROOT']."/freetrix/image_uploader/version.php"); include_once($_SERVER['DOCUMENT_ROOT']."/freetrix/image_uploader/localization.php"); ?> <?php echo BeginNote() . GetMessage('FM_ML_UPL_NOTICE') . EndNote(); ?> <div style="border: 1px solid #94918C; float: left; padding: 5px;">
public static function _BuildCollectionsSelectOptions($Collections = false, $arColTree = false, $level = 0, $selected = false) { if ($Collections === false && $arColTree === false) { $res = CMedialib::GetCollectionTree(); $Collections = $res['Collections']; $arColTree = $res['arColTree']; } $str = ''; for ($i = 0, $l = count($arColTree); $i < $l; $i++) { //if ($type !== false && ) $col = $Collections[$arColTree[$i]['id']]; if (!is_array($col)) { continue; } $html = str_repeat(" . ", $level); $s = $selected !== false && $selected == $arColTree[$i]['id'] ? ' selected' : ''; $str .= '<option value="' . $arColTree[$i]['id'] . '"' . $s . '>' . $html . htmlspecialcharsex($col['NAME']) . '</option>'; if (count($arColTree[$i]['child'])) { $str .= CMedialib::_BuildCollectionsSelectOptions($Collections, $arColTree[$i]['child'], $level + 1, $selected); } } return $str; }
<tr> <td colspan="2"> <?php echo GetMessage('ML_SELECT_COLLECTION'); ?> : <select name="col_id" id="item_cols_sel_<?php echo $i; ?> " onchange="colsOnChange(this);"> <option value="0"><?php echo GetMessage('ML_ACCESS_FOR_ALL'); ?> </option> <?php echo CMedialib::_BuildCollectionsSelectOptions($ctRes['Collections'], $ctRes['arColTree'], 0, $curColId); ?> </select> </td> </tr> <tr> <td colspan="2"> <?php /* INTERNAL TABLE */ ?> <table class="internal"> <tr class="heading"> <td valign="middle" align="center" nowrap> <?php