Exemplo n.º 1
0
	$APPLICATION->SetTitle(GetMessage('FM_ML_UPL_TITLE1'));
	require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_after.php");

	$aContext = Array();
	$aContext[] = Array(
		"TEXT" => GetMessage("FM_ML_BACK_IN_ML"),
		"ICON" => "",
		"LINK" => "/freetrix/admin/fileman_medialib_admin.php?lang=".LANGUAGE_ID."&".freetrix_sessid_get(),
		"TITLE" => GetMessage("FM_ML_BACK_IN_ML")
	);

	$menu = new CAdminContextMenu($aContext);
	$menu->Show();

	$res = CMedialib::GetCollectionTree(array('checkByType' => true, 'typeId' => intVal($_GET['type'])));
	/*
	$type = intVal($_GET['type']);
	$arType = CMedialib::GetTypeById($type);

	if ($arType)
	{
		foreach ($res['Collections'] as $id => $col)
		{
			// Del collection escription if it has another type
			if (!CMedialib::CompareTypesEx($res['Collections'][$id]['ML_TYPE'], $arType))
				unset($res['Collections'][$id]);
		}
	}
	*/
	?>
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
IncludeModuleLangFile(__FILE__);
CModule::IncludeModule("fileman");
$APPLICATION->SetTitle(GetMessage('FM_ML_ACCESS_TITLE'));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
if (!CMedialib::CanDoOperation('medialib_view_collection', 0) || !CMedialib::CanDoOperation('medialib_access', 0)) {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
$aContext = array();
$aContext[] = array("TEXT" => GetMessage("FM_ML_BACK_IN_ML"), "ICON" => "", "LINK" => "/bitrix/admin/fileman_medialib_admin.php?lang=" . LANGUAGE_ID . "&" . bitrix_sessid_get(), "TITLE" => GetMessage("FM_ML_BACK_IN_ML"));
$menu = new CAdminContextMenu($aContext);
$menu->Show();
function __CanDoAccess($colId)
{
    return CMedialib::CanDoOperation('medialib_view_collection', $colId) && CMedialib::CanDoOperation('medialib_access', $colId);
}
$ctRes = CMedialib::GetCollectionTree(array('CheckAccessFunk' => '__CanDoAccess'));
$curColId = isset($col_id, $ctRes['Collections'][$col_id]) ? intVal($col_id) : 0;
//Fetch groups
$arGroups = array();
$db_groups = CGroup::GetList($order = "sort", $by = "asc", array("ACTIVE" => "Y", "ADMIN" => "N"));
while ($arRes = $db_groups->Fetch()) {
    $arGroups[] = $arRes;
}
if ($REQUEST_METHOD == "POST" && strlen($saveperm) > 0 && check_bitrix_sessid()) {
    $arTaskPerm = array();
    for ($i = 0, $l = count($arGroups); $i < $l; $i++) {
        $id = $arGroups[$i]['ID'];
        if (isset($_POST['g_' . $id]) && intVal($_POST['g_' . $id]) > 0) {
            $arTaskPerm[$id] = intVal($_POST['g_' . $id]);
        }
    }