%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/bitrix/www/bitrix/templates/UB/components/bitrix/photogallery.section/.default/
Upload File :
Create Path :
Current File : //home/bitrix/www/bitrix/templates/UB/components/bitrix/photogallery.section/.default/script.js

function delete_album(albumID) {
	if (confirm(LOC_MESS["DO_YOU_WANT_TO_DELETE_AN_ALBUM"])) {
		DropAlbum(this.href, parseInt(albumID));
		return true;
	}
	return BX.PreventDefault(arguments[0]);
}

function prof_access(id) {
	if($("#pa_inp_"+id).prop("checked")) act = 1; else act = 0;
	$.ajax({
		url: "/local/components/UB/ub.ajax.accept_portfotos/ajax.php",
		type: "GET",			
		data: {id: id, act: act},
		dataType: "html",
		success: function(html){
			$('#access_result').html(html);
			$('#access_result').show();
	  }
	});
}

function create_album(form)
{
	$('#add_album_error').hide();

	if (typeof form != "object") return false;

	if ($('#bxph_name').val().length==0) {
		$('#add_album_error').html(LOC_MESS["ALBUM_TITLE_IS_NOT_SPECIFIED"]);
		$('#add_album_error').show();
		return;
	}
	
	oData = {"AJAX_CALL" : "Y"};
	for (var ii in form.elements)
	{
		if (form.elements[ii] && form.elements[ii].name)
		{
			if (form.elements[ii].type && form.elements[ii].type.toLowerCase() == "checkbox")
			{
				if (form.elements[ii].checked == true)
					oData[form.elements[ii].name] = form.elements[ii].value;
			}
			else
				oData[form.elements[ii].name] = form.elements[ii].value;
		}
	}

	BX.showWait('photo_window_edit');
	
	BX.ajax.post(
		form.action,
		oData,
		function(data)
		{
			setTimeout(function(){
				BX.closeWait('photo_window_edit');
				result = {};

				try
				{
					eval("result = " + data + ";");
					if (result['url'] && result['url'].length > 0)
						BX.reload(result['url']);

					/* Интересно, это зачем?
					var arrId = {"NAME" : "photo_album_name_", "DATE" : "photo_album_date_", "DESCRIPTION" : "photo_album_description_"};
					for (var ID in arrId)
					{
						if (BX(arrId[ID] + result['ID']))
							BX(arrId[ID] + result['ID']).innerHTML = result[ID];
					}
					var res = BX('photo_album_info_' + result['ID']);

					if (res)
					{
						if (result['PASSWORD'].length <= 0)
							res.className = res.className.replace("photo-album-password", "");
						else
							res.className += " photo-album-password ";
					}
					*/

					$('#add_album').modal('hide'); 
				}
				catch(e)
				{
					$('#add_album_error').html(LOC_MESS["UNKNOWN_ERROR_OF_CREATING_ALBUM"]);
					$('#add_album_error').show();
				}

			}, 200);
		}
	);
}

Zerion Mini Shell 1.0