{extends file=$smarty.const.SMARTY_LAYOUT_MAIN_GENERAL_PAGINATED_LISTING}

{block name="js" append}

	<script type="text/javascript">

		MVC.scheduleOnLoad(function(){

			// block
			MVC.listing.prototype.blockCurrentWithConfirmation = function(element){
				MVC.callbackWithConfirmation(
					"{$lang['index']['block']['title']}",
					"{$lang['index']['block']['confirmation']}",
					this.backend_callUpdateOperation.bind(this, 'block', {
						'listing[selection][add][]':	MVC.listing.installedHandlers.listing.getItemId(element),
						'listing[selection][clear]' :	'all'
					})
				);
			}

			// unblock
			MVC.listing.prototype.unblockCurrentWithConfirmation = function(element){
				MVC.callbackWithConfirmation(
					"{$lang['index']['unblock']['title']}",
					"{$lang['index']['unblock']['confirmation']}",
					this.backend_callUpdateOperation.bind(this, 'unblock', {
						'listing[selection][add][]':	MVC.listing.installedHandlers.listing.getItemId(element),
						'listing[selection][clear]' :	'all'
					})
				);
			}
		});

	</script>
{/block}

