\n";
reset($convert_cells_jquery_grid);
foreach ($this->grid['cells'] as $cell) {
switch ($this->grid['mode']) {
default:
case 'responsive':
$html .= "
\n";
break;
}
next($convert_cells_jquery_grid);
$html .= "
\n";
$html .= $cell;
$html .= "
\n";
$html .= "
\n";
}
$html .= "
\n";
$this->contentAddHtml($html);
$this->grid = array();
}
public function contentBeginCollapsible($title = " ") {
$this->endCollapsible = false;
$this->collapsible = array();
$this->collapsible['items'] = array();
$this->collapsible['title'] = $title;
}
public function contentCollapsibleAddItem($html) {
$this->collapsible['items'][] = $html;
}
public function contentEndCollapsible() {
$this->endCollapsible = true;
$html = "\n";
echo "
\n";
echo "
" . $this->header['title'] . "
\n";
echo " " . $this->header['button_left'] . "\n";
echo " " . $this->header['button_right'] . "\n";
echo " \n";
echo "
\n";
foreach ($this->content as $content) {
echo " " . $content . "\n";
}
echo "
\n";
if (!$this->noFooter) {
echo "
\n";
if (!empty($this->footer['text'])) {
echo " " . $this->footer['text'] . "\n";
}
else {
echo " " . $this->defaultFooter() . "\n";
}
}
echo "
\n";
echo "
\n";
if (!empty($this->dialogs)) {
if (!empty($this->dialogs['hidden'])) {
foreach ($this->dialogs['hidden'] as $dialog) {
echo " " . $dialog . "\n";
}
}
}
echo " \n";
echo "";
ob_end_flush();
}
//
//
}
class Table {
private $head = array();
private $rows = array();
public $id = '';
private $rowClass = array();
private $class_table = '';
private $row_heads = array();
public $row_keys_as_head_row = false;
public function __construct() {
$this->init();
}
public function init() {
$this->id = uniqid();
$this->head = array();
$this->rows = array();
$this->rowClass = array();
$this->class_table = '';
$this->row_heads = array();
$this->row_keys_as_head_row = false;
}
public function addHeader($head) {
$this->head = $head;
}
public function addRowHead($key, $head_text) {
$this->row_heads[$key] = $head_text;
}
public function addRow($row = array(), $key = false) {
if ($key !== false) {
$this->rows[$key] = $row;
}
else {
$this->rows[] = $row;
}
}
public function importFromHash($data) {
foreach ($data as $id => $row) {
$table_row = array();
foreach ($row as $key => $value) {
if (!in_array($key, $this->head)) {
$this->head[] = $key;
}
$cell_key = array_search($key, $this->head);
$table_row[$cell_key] = $value;
}
$this->rows[$id] = $table_row;
}
}
public function setClass($class = '') {
$this->class_table = $class;
}
public function setRowClass($class = '', $pos = false) {
if (is_array($class)) {
$this->rowClass = $class;
}
else {
if ($pos !== false) {
$this->rowClass[$pos] = $class;
}
else {
$this->rowClass = array_fill(0, count($this->rows), $class);
}
}
}
public function getHTML() {
$html = '';
$html = "