for ($i = 0, $l = count($arMLTypes); $i < $l; $i++) { if ($arMLTypes[$i]['id'] == $id) { $curTypeInd = $i; $curType = $arMLTypes[$i]; break; } } } } if ($curType === false) { $curTypeInd = 0; $curType = $arMLTypes[0]; } ?> <script><?php $arCols = CMedialib::GetCollections($exParams); ?> </script><?php $arTypeCols = array(); for ($i = 0, $l = count($arCols); $i < $l; $i++) { $type = $arCols[$i]['ML_TYPE']; if ($curType === false || $curType['id'] == $type || $curType['code'] == "image" && $curType['system'] && !$type) { $arTypeCols[] = $arCols[$i]; } } $aContext = array(); $bCols = count($arTypeCols) > 0; if ($bCols && $exParams['arCountPerm']['new_col'] > 0 || CMedialib::CanDoOperation('medialib_new_collection', 0)) { $aContext[] = array("TEXT" => GetMessage("FM_ML_NEW_COLLECTION"), "ICON" => "btn_new_collection", "LINK" => "javascript: void(0);", "TITLE" => GetMessage("FM_ML_NEW_COLLECTION_TITLE")); } if ($bCols && $exParams['arCountPerm']['new_item'] > 0) {
public static function Start($Params) { $Params['bReadOnly'] = false; CMedialib::BuildDialog($Params); // TODO: Check access ?> #ML_SUBDIALOGS_BEGIN#<?php CMedialib::BuildAddCollectionDialog($Params); CMedialib::BuildAddItemDialog($Params); CMedialib::BuildConfirmDialog($Params); CMedialib::BuildViewItemDialog($Params); $exParams = array('types' => $Params['types']); ?> #ML_SUBDIALOGS_END# <script><?php CMedialib::GetCollections($exParams); ?> </script> <?php }
{ $curTypeInd = $i; $curType = $arMLTypes[$i]; break; } } } } if ($curType === false) { $curTypeInd = 0; $curType = $arMLTypes[0]; } ?><script><?$arCols = CMedialib::GetCollections($exParams);?></script><? $arTypeCols = array(); for ($i = 0, $l = count($arCols); $i < $l; $i++) { $type = $arCols[$i]['ML_TYPE']; if ($curType === false || $curType['id'] == $type || ($curType['code'] == "image" && $curType['system'] && !$type)) $arTypeCols[] = $arCols[$i]; } $aContext = Array(); $bCols = count($arTypeCols) > 0; if (($bCols && $exParams['arCountPerm']['new_col'] > 0) || CMedialib::CanDoOperation('medialib_new_collection', 0)) $aContext[] = Array( "TEXT" => GetMessage("FM_ML_NEW_COLLECTION"),