/** * Create houses list * * @return string HTML code for houses list */ private function listTables() { $db = DB::getInstance(); $tpl = new Template('poker'); $tables = PokerTable::getAll(); $tpl->assign('tables', $tables); $tpl->assign('user', $this->s->user); $tpl->assign('call', $this->s->post['call']); $tpl->assign('permissions', array('create' => $this->s->user->hasRights("poker:poker_table-create"), 'delete' => $this->s->user->hasRights("poker:poker_table-delete"), 'update' => $this->s->user->hasRights("poker:poker_table-update"), 'update_own' => $this->s->user->hasRights("poker:poker_table-own"))); return $tpl->fetch('tables_table.html'); }
/** * add table info to blackboard * * @return array * @author Elias Müller **/ private function blackboardInfo() { $tpl = new Template('poker'); $content = '<h2>Pokertische</h2>'; $tables = PokerTable::getAllForUser($this->s->user->id); if (count($tables) > 0) { $content .= '<h3>Eigene Aktivität</h3>'; $tpl->assign('active', false); $tpl->assign('tables', $tables); $content .= $tpl->fetch('table_info.html'); } $tables = PokerTable::getAll(true); if (count($tables) > 0) { $content .= '<h3>Aktive Tische</h3>'; $tpl->assign('active', true); $tpl->assign('tables', $tables); $content .= $tpl->fetch('table_info.html'); } $content .= "<script>\$(document).ready(function(){\$('#bb_tables').on('click', 'ul.table-list > li', function() { window.open('admin/poker/show/'+ \$(this).data('idtable'),'Poker_'+ \$(this).data('idtable'),'width=940,height=620'); return false;});})</script>"; return $content; }