{extends file=$smarty.const.SMARTY_LAYOUT_MAIN_GENERAL_PAGINATED_LISTING}

{block name="js" append}
	<script type="text/javascript">

		MVC.scheduleOnLoad(function(){

            // block/unblock one record
            MVC.listing.prototype.blockItemWithConfirmation = function(button){
                MVC.callbackWithConfirmation(
                    "",
                    "{$lang['block']['confirmation']}",
                    this.backend_callUpdateOperation.bind(this, 'block', {
                        'listing[selection][add][]':	MVC.listing.installedHandlers.listing.getItemId(button),
                        'listing[selection][clear]' :	'all'
                    })
                );
            }

            // block/unblock multiple items
            MVC.listing.prototype.blockItemsWithConfirmation = function(element){
                MVC.callbackWithConfirmation(
                    "",
                    "{$lang['block']['confirmation']}",
                    this.backend_callUpdateOperation.bind(this, 'block', null, element)
                );
            }

		});

	</script>
{/block}
