- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
<script>
if (!window.BX && top.BX)
window.BX = top.BX;
<?CMedialib::AppendLangMessages();?>
window.<?= $arConfig['event']?> = function(bLoadJS)
{
if (window.oBXMedialib && window.oBXMedialib.bOpened)
return false;
<?if(!CMedialib::CanDoOperation('medialib_view_collection', 0)):?>
return alert(ML_MESS.AccessDenied);
<?else:?>
if (!window.BXMediaLib)
{
if (bLoadJS !== false)
{
// Append CSS
BX.loadCSS("/bitrix/js/fileman/medialib/medialib.css");
var arJS = [];
if (!window.jsAjaxUtil)
arJS.push("/bitrix/js/main/ajax.js?v=<?= filemtime($_SERVER["DOCUMENT_ROOT"].'/bitrix/js/main/ajax.js')?>");
if (!window.jsUtils)
arJS.push("/bitrix/js/main/utils.js?v=<?= filemtime($_SERVER["DOCUMENT_ROOT"].'/bitrix/js/main/utils.js')?>");
if (!window.CHttpRequest)
arJS.push("/bitrix/js/main/admin_tools.js?v=<?= filemtime($_SERVER["DOCUMENT_ROOT"].'/bitrix/js/main/admin_tools.js')?>");
arJS.push("/bitrix/js/fileman/medialib/common.js?v=<?= filemtime($_SERVER["DOCUMENT_ROOT"].'/bitrix/js/fileman/medialib/common.js')?>");
arJS.push("/bitrix/js/fileman/medialib/core.js?v=<?= filemtime($_SERVER["DOCUMENT_ROOT"].'/bitrix/js/fileman/medialib/core.js')?>");
BX.loadScript(arJS);
}
return setTimeout(function(){<?=$arConfig['event']?>(false)}, 50);
}
<?CMedialib::ShowJS()?>
<?
$arSet = explode(',' , CUserOptions::GetOption("fileman", "medialib_user_set", '600,450,0'));
$width = $arSet[0] ? intVal($arSet[0]) : 600;
$height = $arSet[1] ? intVal($arSet[1]) : 450;
$coll_id = $arSet[2] ? intVal($arSet[2]) : 0;
?>
window._mlUserSettings = window._mlUserSettings || {width: <?=$width?>, height: <?=$height?>, coll_id: <?=$coll_id?>}
var oConfig =
{
sessid: "<?=bitrix_sessid()?>",
thumbWidth : <?= COption::GetOptionInt('fileman', "ml_thumb_width", 140)?>,
thumbHeight : <?= COption::GetOptionInt('fileman', "ml_thumb_height", 105) ?>,
userSettings : window._mlUserSettings,
resType: "<?= $resultDest?>",
Types : <?= CUtil::PhpToJSObject(CMedialib::GetTypes($arConfig['types']))?>,
arResultDest : <?= CUtil::PhpToJSObject($arConfig['arResultDest'])?>,
rootAccess: {
new_col: '<?= CMedialib::CanDoOperation('medialib_new_collection', 0)?>',
edit: '<?= CMedialib::CanDoOperation('medialib_edit_collection', 0)?>',
del: '<?= CMedialib::CanDoOperation('medialib_del_collection', 0)?>',
new_item: '<?= CMedialib::CanDoOperation('medialib_new_item', 0)?>',
edit_item: '<?= CMedialib::CanDoOperation('medialib_edit_item', 0)?>',
del_item: '<?= CMedialib::CanDoOperation('medialib_del_item', 0)?>',
access: '<?= CMedialib::CanDoOperation('medialib_access', 0)?>'
},
bCanUpload: <?= $USER->CanDoOperation('fileman_upload_files') ? 'true' : 'false'?>,
bCanViewStructure: <?= $USER->CanDoOperation('fileman_view_file_structure') ? 'true' : 'false'?>,
strExt : "<?= CUtil::JSEscape(CMedialib::GetMediaExtentions())?>",
lang : "<?= $arConfig['lang']?>",
description_id : '<?= CUtil::JSEscape($arConfig['description_id'])?>'
};
window.oBXMedialib = new BXMediaLib(oConfig);
oBXMedialib.Open();
<?endif;?>
};
</script>