case 'files': include './inc/files.php'; break; case 'sql': include './inc/sql.php'; break; case 'home': include './inc/home/home.php'; break; case 'config': include './inc/configuration.php'; break; case 'log': include './inc/log.php'; break; default: include './inc/home/home.php'; } if ($action != 'dl') { // include menu if we didn't hand out a file include './inc/menu.php'; //render prepared templates foreach ($templateObjects as $t) { if (isset(${$t}) && is_object(${$t})) { ${$t}->pparse($t); } } unset($log); obend(); } $_SESSION['config'] = $config;
$row = $dbo->query($query, MsdDbFactory::ARRAY_ASSOC); if (false === $row || !isset($row[0])) { //TODO clean error handling echo "<h2>Keine Datensätze gefunden!</h2>"; obend(true); exit; } elseif (count($row) > 1) { // TODO clean error handling echo "<h2>Mehrere Datensätze gefunden!</h2>"; } $row = $row[0]; } elseif ($mode == 'NEW') { foreach ($tableInfos as $key => $val) { if (isset($val['field'])) { $row[$val['field']] = ''; } } } foreach ($row as $key => $value) { $keyComment = ''; if (isset($tableInfos[$key]['comment'])) { $keyComment = $tableInfos[$key]['comment']; } $templateVars = array('NAME' => htmlspecialchars($key), 'KEY' => base64_encode($key), 'KEY_COMMENT' => Html::getJsQuote($keyComment), 'VALUE' => htmlspecialchars($value)); $tplSqlbrowserTableShowTabledataEntry->assign_block_vars('FIELD_' . ($mode == 'VIEW' ? 'VIEW' : 'EDIT'), $templateVars); } $templateVars = array('RECORD_KEY' => base64_encode($rowKey)); $tplSqlbrowserTableShowTabledataEntry->assign_block_vars('FOOTER_' . $mode, $templateVars); $tplSqlbrowserTableShowTabledataEntry->pparse('tplSqlbrowserTableShowTabledataEntry'); obend(true);