Exemplo n.º 1
0
		}
		</script>
		<?
	}
}
elseif(isset($_GET['action']) && $_GET['action'] == 'postsave' && check_freetrix_sessid())
{
	$itemsCount = intVal($_POST['items_count']);

	if ($itemsCount > 0)
	{
		for($i = 0; $i < $itemsCount; $i++)
		{
			if (isset($_POST['item_del_'.$i]) && $_POST['item_del_'.$i])
			{
				CMedialib::DelItem(intVal($_POST['item_id_'.$i]));
				continue;
			}

			$arCols_ = explode(',', trim($_POST['item_colls_'.$i], ' ,'));
			$arCols = array();
			for ($j = 0, $n = count($arCols_); $j < $n; $j++)
			{
				if (intVal($arCols_[$j]) > 0 && CMedialib::CanDoOperation("medialib_edit_item", $arCols_[$j])) // Check access
					$arCols[] = intVal($arCols_[$j]);
			}

			if (count($arCols) > 0)
			{
				$res = CMedialibItem::Edit(array(
					'arFields' => array(
Exemplo n.º 2
0
		'lang' => isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en',
		'site' => isset($_REQUEST['site']) ? $_REQUEST['site'] : false,
		'id' => intVal($_REQUEST['id']),
		'file' => isset($_FILES["load_file"]) ? $_FILES["load_file"] : false,
		'path' => isset($_POST["item_path"]) ? $_POST["item_path"] : '',
		'path_site' => isset($_POST["item_path_site"]) ? $_POST["item_path_site"] : '',
		'source_type' => isset($_POST["source_type"]) ? $_POST["source_type"] : '',
		'name' => isset($_POST["item_name"]) ? $APPLICATION->UnJSEscape($_POST["item_name"]) : '',
		'desc' => isset($_POST["item_desc"]) ? $APPLICATION->UnJSEscape($_POST["item_desc"]) : '',
		'keywords' => isset($_POST["item_keywords"]) ? $APPLICATION->UnJSEscape($_POST["item_keywords"]) : '',
		'item_collections' => $_POST["item_collections"]
	));
}
elseif ($action == 'del_item')
{
	$res = CMedialib::DelItem(intVal($_POST['id']), $_POST['mode'] == 'current', intVal($_POST['col_id']));
	?><script>window.bx_req_res = <?php 
echo $res ? 'true' : 'false';
?>
;</script><?
}
elseif ($action == 'save_settings')
{
	CMedialib::SaveUserSettings(array(
		'width' => intVal($_POST['width']),
		'height' => intVal($_POST['height']),
		'coll_id' => intVal($_POST['coll_id'])
	));
}
elseif ($action == 'upload_form')
{