{foreach from=$data.movies item=movie}
  1. {/foreach}
{tr}Add Media{/tr} {tr}List Media{/tr} {foreach from=$data.extras item=entryId} {/foreach} {if $data.extras|count} +{$data.extras|count} {/if} {jq} $('.add-kaltura-media').click(function () { var link = this; $("#bootstrap-modal").hide(); $(this).serviceDialog({ title: $(link).text(), width: 710, height: 450, hideButtons: true, success: function (data) { $("#bootstrap-modal").show(); $.each(data.entries, function (k, entry) { var hidden = $('') .attr('name', $(link).data('target-name')) .attr('value', entry) ; $(link).parent().append(hidden); }); $(link).parent().find('span').remove(); $(link).parent().append($('') .text('+' + $(this).parent().find('input').size())); }, close: function () { $("#bootstrap-modal").show(); } }); return false; }); $('.list-kaltura-media').click(function () { var link = this; var $bsModal = $("#bootstrap-modal").hide(); $(this).serviceDialog({ title: $(link).text(), width: 710, height: 450, hideButtons: true, data: { targetName: $(link).data('target-name'), formId: $(this).parents('form').attr('id') }, close: function () { $bsModal.show(); } }); return false; }); {/jq}