<?php
/*
 * Copyright (c) 2013, webvariants GbR, http://www.webvariants.de
 *
 * This file is released under the terms of the MIT license. You can find the
 * complete text in the attached LICENSE file or online at:
 *
 * http://www.opensource.org/licenses/mit-license.php
 */

if ($this->isEmpty) {
	$colspan = 0;

	foreach ($this->columns as $col) {
		$colspan += $col->getColspan();
	}

	print '<tr><td class="center" colspan="'.$colspan.'">'.sly_html($this->emptyNotice).'</td></tr>';
}

print '</tbody></table>';
print $this->surroundingHTML;

$hasSearch = $this->hasSearch();
$hasPager  = $this->hasPager();

if ((sly_Table::isDragAndDropMode() && ($hasSearch || $hasPager)) || ($this->enableDragAndDrop && !$hasSearch && !$hasPager)) {
	sly_Util_HTML::onDOMReady('$("#'.$this->id.'").dropAndDrop('.$this->dragAndDropHandler.');');
}
