User->GetParameter('xcs_tree_name'); $cols = []; if(!empty($table)) { $columns = $app->DB->SelectArrCache( sprintf( 'SHOW COLUMNS FROM `%s` ', $table), 60, 'xcs_column' ); if(!empty($columns)) { foreach($columns as $key => $column) { $cols[] = reset($column); if($key > 74) { break; } } } } $firstCol = reset($cols); $heading = array_merge($cols, ['']); $findcols = array_merge($cols, [$firstCol]); $searchsql = $cols; $sql = sprintf( "SELECT `%s`, IFNULL(`%s`, '') FROM `%s`", $firstCol, implode("`,''), IFNULL(`", $cols), $table ); $fastcount = sprintf('SELECT COUNT(*) FROM `%s`', $table); break; } $erg = []; foreach($erlaubtevars as $k => $v) { if(isset($$v)) { $erg[$v] = $$v; } } return $erg; } /** * Databaseviewer constructor. * * @param Application $app * @param bool $intern */ public function __construct($app, $intern = false) { $this->app=$app; if($intern) { return; } $this->app->ActionHandlerInit($this); // ab hier alle Action Handler definieren die das Modul hat $this->app->ActionHandler("list", "DatabaseViewerList"); $this->app->ActionHandler("treeajax", "DatabaseViewerTreeAjax"); $this->app->ActionHandlerListen($app); } public function DatabaseViewerMenu() { $this->app->erp->MenuEintrag('index.php?module=databaseviewer&action=list', 'Übersicht'); } public function DatabaseViewerList() { $cmd = $this->app->Secure->GetGET('cmd'); if($cmd === 'filtertree') { $tableName = $this->app->Secure->GetPOST('name'); $this->app->User->SetParameter('xcs_tree_id',$this->app->Secure->GetPOST('id')); $this->app->User->SetParameter('xcs_tree_name', $tableName); $tableColumns = $this->app->DB->SelectArrCache( sprintf( 'SHOW COLUMNS FROM `%s` ', $tableName), 60, 'xcs_column' ); $html = ''; if((!empty($tableColumns)?count($tableColumns):0) > 75) { $html = '