From debe733f130b86094a34914033d094d833b9c6ea Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Fri, 21 Oct 2022 16:11:56 +0000 Subject: [PATCH] module_creator expanded now with minidetail and select in list --- tools/module_creator/module_creator.php | 11 ++++++----- tools/module_creator/module_creator_php_template.txt | 6 ++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/module_creator/module_creator.php b/tools/module_creator/module_creator.php index 267cff46..f2937e06 100644 --- a/tools/module_creator/module_creator.php +++ b/tools/module_creator/module_creator.php @@ -13,7 +13,7 @@ * PLACEHOLDER_EDIT * PLACEHOLDER_DELETE * PLACEHOLDER_SQL_LIST - * PLACEHOLDER_SQL_LIST + * PLACEHOLDER_DROPNBOX * PLACEHOLDER_GET_INPUT * PLACEHOLDER_SET_INPUT * PLACEHOLDER_COLUMNS @@ -21,9 +21,9 @@ */ $host = 'localhost'; -$user = 'openxedev'; -$passwd = 'openxedev'; -$schema = 'openxedev'; +$user = 'openxe'; +$passwd = 'openxe'; +$schema = 'openxe'; if ($argc >= 2) { @@ -152,7 +152,8 @@ if ($argc >= 2) { $php_file_contents = str_replace('PLACEHOLDER_LIST', $module_name . "_list", $php_file_contents); $php_file_contents = str_replace('PLACEHOLDER_EDIT', $module_name . "_edit", $php_file_contents); $php_file_contents = str_replace('PLACEHOLDER_DELETE', $module_name . "_delete", $php_file_contents); - $php_file_contents = str_replace('PLACEHOLDER_SQL_LIST', "SELECT SQL_CALC_FOUND_ROWS $table_short_name.id, $sql_list_of_columns, $table_short_name.id FROM $module_name $table_short_name", $php_file_contents); + $php_file_contents = str_replace('PLACEHOLDER_DROPNBOX',"'' AS `open`, CONCAT('') AS `auswahl`", $php_file_contents); + $php_file_contents = str_replace('PLACEHOLDER_SQL_LIST', "SELECT SQL_CALC_FOUND_ROWS $table_short_name.id, \$dropnbox, $sql_list_of_columns, $table_short_name.id FROM $module_name $table_short_name", $php_file_contents); $php_file_contents = str_replace('PLACEHOLDER_SQL_EDIT', "INSERT INTO $module_name ($list_of_columns, id) values ('\".implode('\', \'',\$input).\"', \$id) ON DUPLICATE KEY UPDATE SET ", $php_file_contents); $php_file_contents = str_replace('PLACEHOLDER_GET_INPUT', $get_input, $php_file_contents); $php_file_contents = str_replace('PLACEHOLDER_SET_INPUT', $set_input, $php_file_contents); diff --git a/tools/module_creator/module_creator_php_template.txt b/tools/module_creator/module_creator_php_template.txt index f74949d1..f93d1d47 100644 --- a/tools/module_creator/module_creator_php_template.txt +++ b/tools/module_creator/module_creator_php_template.txt @@ -30,8 +30,8 @@ class PLACEHOLDER_MODULECLASSNAME { switch ($name) { case "PLACEHOLDER_LIST": $allowed['PLACEHOLDER_LIST'] = array('list'); - $heading = array(PLACEHOLDER_COLUMNS, 'Menü'); - $width = array('10%'); // Fill out manually later + $heading = array('','',PLACEHOLDER_COLUMNS, 'Menü'); + $width = array('1%','1%','10%'); // Fill out manually later $findcols = array(PLACEHOLDER_SQL_COLUMNS); $searchsql = array(PLACEHOLDER_SQL_COLUMNS); @@ -39,6 +39,8 @@ class PLACEHOLDER_MODULECLASSNAME { $defaultorder = 1; $defaultorderdesc = 0; + $dropnbox = "PLACEHOLDER_DROPNBOX"; + $menu = "
" . "Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"> " . "Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\">" . "
"; $sql = "PLACEHOLDER_SQL_LIST";