From: <txm...@us...> - 2012-04-17 15:14:55
|
Revision: 9360 http://xoops.svn.sourceforge.net/xoops/?rev=9360&view=rev Author: txmodxoops Date: 2012-04-17 14:57:39 +0000 (Tue, 17 Apr 2012) Log Message: ----------- Updated solved language bugs Modified Paths: -------------- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/building.php XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/includes.php XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/tables.php XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/class/tdmcreate_tables.php XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_admin_language.php XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_admin_pages.php XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_architecture.php XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_class.php XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_modinfo_language.php XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_xoopsversion.php XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/include/functions_const.php Modified: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/building.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/building.php 2012-04-17 05:32:30 UTC (rev 9359) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/building.php 2012-04-17 14:57:39 UTC (rev 9360) @@ -19,20 +19,17 @@ */ include 'admin_header.php'; xoops_cp_header(); - $indexAdmin = new ModuleAdmin(); echo $indexAdmin->addNavigation('building.php'); - $op = TDMCreate_CleanVars($_REQUEST, 'op', 'default', 'string'); - switch ($op) { case "creation": $mods =& $modulesHandler->get($_REQUEST['modules_name']); $mods_name = $mods->getVar('modules_name'); //$mods_fname = $mods->getVar('modules_fname'); $mods_desc = $mods->getVar('modules_description'); - $mods_author_website_name = $mods->getVar('modules_author_website_name'); - $mods_author_website_url = $mods->getVar('modules_author_website_url'); + $mods_a_w_name = $mods->getVar('modules_author_website_name'); + $mods_a_w_url = $mods->getVar('modules_author_website_url'); $mods_image = $mods->getVar('modules_image'); $mods_display_admin = $mods->getVar('modules_display_admin'); $mods_display_user = $mods->getVar('modules_display_user'); @@ -105,7 +102,7 @@ } //Creation of the comments if ( $tbls_coms == 1 ) { - const_include_coms($mods, $mods_name, $tbls_name, $tbls_module_table, $tbls_champs, $tbls_parametres); + const_user_comments($mods, $mods_name, $tbls_name, $tbls_module_table, $tbls_champs, $tbls_parametres); } //Creation of the blocks @@ -131,7 +128,7 @@ $tbls_coms = $tablesHandler->getVar('tables_coms'); //Creation of xoopsversion.php file //Xoops version set to integrate the end of the block, etc. - const_xoopsversion($mods, $mods_name, $tbls_arr, $tbls_module_table, $tbls_blocks); + const_xoopsversion($mods, $mods_name, $tbls_arr, $tbls_module_table, $tbls_blocks, $tbls_search); if($mods_display_user == 1){ // Creation of template index const_templates_index($mods, $mods_name, $tbls_name, $tbls_module_table, $tbls_champs, $tbls_parametres); @@ -149,7 +146,7 @@ //Include const_js_jquery($mods, $mods_name); //Configs - const_include_configs($mods, $mods_name, $mods_author_website_name, $mods_author_website_url); + const_include_configs($mods, $mods_name, $mods_a_w_name, $mods_a_w_url); // a_w = author_website //Style //const_css_admin($mods, $mods_name); const_css_style($mods, $mods_name); @@ -162,7 +159,7 @@ //Creation of language main.php const_main_language($mods, $mods_name, $mods_desc, $tbls_arr); //Creation of language modinfo.php - const_modinfo_language($mods, $mods_name, $tbls_arr, $mods_desc, $topic); + const_modinfo_language($mods, $mods_name, $mods_desc, $tbls_arr, $topic); //Creation of language admin.php const_admin_language($mods, $mods_name, $tbls_arr, $topic); //Creation of language blocks.php Modified: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/includes.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/includes.php 2012-04-17 05:32:30 UTC (rev 9359) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/includes.php 2012-04-17 14:57:39 UTC (rev 9360) @@ -27,7 +27,6 @@ include_once $cPath.'/const_xoopsversion.php'; include_once $cPath.'/const_changelog.php'; include_once $cPath.'/const_include_search.php'; -include_once $cPath.'/const_include_coms.php'; include_once $cPath.'/const_include_configs.php'; include_once $cPath.'/const_include_functions.php'; include_once $cPath.'/const_include_install.php'; @@ -50,6 +49,7 @@ include_once $cPath.'/const_help_language.php'; include_once $cPath.'/const_blocks_language.php'; include_once $cPath.'/const_main_language.php'; +include_once $cPath.'/const_user_comments.php'; include_once $cPath.'/const_user_header.php'; include_once $cPath.'/const_user_index.php'; include_once $cPath.'/const_user_pages.php'; Modified: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/tables.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/tables.php 2012-04-17 05:32:30 UTC (rev 9359) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/tables.php 2012-04-17 14:57:39 UTC (rev 9360) @@ -57,7 +57,7 @@ $obj->setVar('tables_nb_champs', 10 ); - $tables_parametres = 'XoopsFormTopic:0:0:0:0:0:0|XoopsFormText:1:1:0:1:0:1|XoopsFormTextArea:0:1:0:0:0:1|XoopsFormUploadImage:1:1:0:0:0:0|XoopsFormText:1:1:0:0:0:1|XoopsFormColorPicker:1:1:0:0:0:0|XoopsFormSelect:0:0:0:0:0:1|XoopsFormSelectUser:0:0:0:0:0:1|XoopsFormTextDateSelect:0:0:0:0:0:1|XoopsFormCheckBox:1:1:0:0:0:1'; + $tables_parametres = 'XoopsFormTopic:0:0:0:0:0:0|XoopsFormText:1:1:0:1:0:1|XoopsFormTextArea:0:1:0:0:0:1|XoopsFormUploadImage:1:1:0:0:0:0|XoopsFormText:1:1:0:0:0:1|XoopsFormColorPicker:1:1:0:0:0:0|XoopsFormSelectUser:0:0:0:0:0:1|XoopsFormTextDateSelect:0:0:0:0:0:1|XoopsFormCheckBox:1:1:0:0:0:1'; //Image include_once XOOPS_ROOT_PATH.'/class/uploader.php'; @@ -91,6 +91,9 @@ $obj->setVar('tables_blocs', $_REQUEST['tables_blocs']); $obj->setVar('tables_display_admin', $_REQUEST['tables_display_admin']); $obj->setVar('tables_display_user', $_REQUEST['tables_display_user']); + $obj->setVar('tables_submitter', $_REQUEST['tables_submitter']); + $obj->setVar('tables_created', $_REQUEST['tables_created']); + $obj->setVar('tables_online', $_REQUEST['tables_online']); $obj->setVar('tables_search', $_REQUEST['tables_search']); $obj->setVar('tables_coms', $_REQUEST['tables_coms']); //$obj->setVar('tables_nb_champs', $_REQUEST['tables_nb_champs']); @@ -142,10 +145,11 @@ $tables_parametres .= '|XoopsFormSelectUser:1:1:1:0:0:1|XoopsFormTextDateSelect:1:1:1:0:0:1|XoopsFormCheckBox:1:1:1:0:0:1'; } } - $nb_champs = $_REQUEST['tables_nb_champs']; - $nb_champs += $submit; - $nb_champs += $create; - $nb_champs += $online; + if($nb_champs == $_REQUEST['tables_nb_champs']) { + $nb_champs += $submit; + $nb_champs += $create; + $nb_champs += $online; + } $obj->setVar('tables_nb_champs', $nb_champs); } $obj->setVar('tables_champs', $tables_champs); @@ -175,7 +179,10 @@ $tables_blocks = (isset($_REQUEST['tables_blocs'])) ? $_REQUEST['tables_blocs'] : '0'; $tables_display_admin = (isset($_REQUEST['tables_display_admin'])) ? $_REQUEST['tables_display_admin'] : '0'; - $tables_display_user = (isset($_REQUEST['tables_display_user'])) ? $_REQUEST['tables_display_user'] : '0'; + $tables_display_user = (isset($_REQUEST['tables_display_user'])) ? $_REQUEST['tables_display_user'] : '0'; + $tables_submitter = (isset($_REQUEST['tables_submitter'])) ? $_REQUEST['tables_submitter'] : '0'; + $tables_created = (isset($_REQUEST['tables_created'])) ? $_REQUEST['tables_created'] : '0'; + $tables_online = (isset($_REQUEST['tables_online'])) ? $_REQUEST['tables_online'] : '0'; $tables_search = (isset($_REQUEST['tables_search'])) ? $_REQUEST['tables_search'] : '0'; $tables_coms = (isset($_REQUEST['tables_coms'])) ? $_REQUEST['tables_coms'] : '0'; $select = (isset($_REQUEST['select'])) ? $_REQUEST['select'] : '0'; @@ -209,6 +216,9 @@ $obj->setVar('tables_blocs', $_REQUEST['tables_blocs']); $obj->setVar('tables_display_admin', $_REQUEST['tables_display_admin']); $obj->setVar('tables_display_user', $_REQUEST['tables_display_user']); + $obj->setVar('tables_submitter', $_REQUEST['tables_submitter']); + $obj->setVar('tables_created', $_REQUEST['tables_created']); + $obj->setVar('tables_online', $_REQUEST['tables_online']); //mettre des isset pour search if ( isset($_REQUEST['tables_search']) ) $obj->setVar('tables_search', $_REQUEST['tables_search']); @@ -356,6 +366,9 @@ $tables_blocks = (isset($_REQUEST['tables_blocs'])) ? $_REQUEST['tables_blocs'] : '0'; $tables_display_admin = (isset($_REQUEST['tables_display_admin'])) ? $_REQUEST['tables_display_admin'] : '0'; $tables_display_user = (isset($_REQUEST['tables_display_user'])) ? $_REQUEST['tables_display_user'] : '0'; + $tables_submitter = (isset($_REQUEST['tables_submitter'])) ? $_REQUEST['tables_submitter'] : '0'; + $tables_created = (isset($_REQUEST['tables_created'])) ? $_REQUEST['tables_created'] : '0'; + $tables_online = (isset($_REQUEST['tables_online'])) ? $_REQUEST['tables_online'] : '0'; $tables_search = (isset($_REQUEST['tables_search'])) ? $_REQUEST['tables_search'] : '0'; $tables_coms = (isset($_REQUEST['tables_coms'])) ? $_REQUEST['tables_coms'] : '0'; $select = (isset($_REQUEST['select'])) ? $_REQUEST['select'] : '0'; @@ -385,7 +398,7 @@ } if ($tablesHandler->insert($obj)) { - $tables_id = $xoopsDB->getInsertId(); + $tables_id = $GLOBALS['xoopsDB']->getInsertId(); $obj = $tablesHandler->get($tables_id); $form = $obj->getFormChamps(false, $tables_id, intval($_REQUEST['tables_modules']), strtolower($_REQUEST['tables_name']), $tables_blocks, $tables_display_admin, $tables_display_user, $tables_submitter, $tables_created, $tables_online, $tables_search, $tables_coms, intval($_REQUEST['tables_nb_champs']), $select); } Modified: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/class/tdmcreate_tables.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/class/tdmcreate_tables.php 2012-04-17 05:32:30 UTC (rev 9359) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/class/tdmcreate_tables.php 2012-04-17 14:57:39 UTC (rev 9360) @@ -59,7 +59,7 @@ } //Formulaire de saisi de champs - function getFormChamps($action = false, $tables_id, $tables_modules, $tables_name, $tables_blocks, $tables_display_admin, $tables_display_user,$tables_submitter, $tables_created, $tables_online, $tables_search, $tables_coms, $tables_nb_champs, $select) + function getFormChamps($action = false, $tables_id, $tables_modules, $tables_name, $tables_blocks, $tables_display_admin, $tables_display_user, $tables_submitter, $tables_created, $tables_online, $tables_search, $tables_coms, $tables_nb_champs, $select) { global $xoopsDB, $xoopsModule, $xoopsModuleConfig; if ($action === false) { @@ -146,8 +146,7 @@ <OPTION VALUE='XoopsFormTextArea'>TextArea</OPTION> <OPTION VALUE='XoopsFormDhtmlTextArea'>DhtmlTextArea</OPTION> <OPTION VALUE='XoopsFormCheckBox'>CheckBox</OPTION> - <OPTION VALUE='XoopsFormRadioYN'>RadioYN</OPTION> - <OPTION VALUE='XoopsFormSelect'>SelectUser</OPTION> + <OPTION VALUE='XoopsFormRadioYN'>RadioYN</OPTION> <OPTION VALUE='XoopsFormSelectUser'>SelectUser</OPTION> <OPTION VALUE='XoopsFormColorPicker'>ColorPicker</OPTION> <OPTION VALUE='XoopsFormUploadImage'>UploadImage</OPTION> @@ -523,12 +522,7 @@ echo "<OPTION VALUE='XoopsFormRadioYN' selected>RadioYN</OPTION>"; } else { echo "<OPTION VALUE='XoopsFormRadioYN'>RadioYN</OPTION>"; - } - if ( $param_elements[$i] == 'XoopsFormSelect' ) { - echo "<OPTION VALUE='XoopsFormSelect' selected>SelectBox</OPTION>"; - } else { - echo "<OPTION VALUE='XoopsFormSelectUser'>SelectUser</OPTION>"; - } + } if ( $param_elements[$i] == 'XoopsFormSelectUser' ) { echo "<OPTION VALUE='XoopsFormSelectUser' selected>SelectUser</OPTION>"; } else { Modified: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_admin_language.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_admin_language.php 2012-04-17 05:32:30 UTC (rev 9359) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_admin_language.php 2012-04-17 14:57:39 UTC (rev 9360) @@ -62,23 +62,22 @@ define("'.$language.'OFF","Offline"); define("'.$language.'ON","Online"); '; + $verif = true; foreach (array_keys($tables_arr) as $i) { - $t_name = $tables_arr[$i]->getVar("tables_name"); //Champs + $t_name = $tables_arr[$i]->getVar("tables_name"); $champs_total = explode("|", $tables_arr[$i]->getVar("tables_champs")); - $nb_champs = count($champs_total); - $nb_caracteres = strlen($t_name); - $language1 = $language.strtoupper($t_name).''; + $nb_champs = $tables_arr[$i]->getVar("tables_nb_champs"); + $language1 = $language.strtoupper($t_name).'_'; //Recuperation des noms des tables for($j=0; $j<$nb_champs; $j++) { //Nom des champs - $champs1 = explode(":", $champs_total[$j]); - $champs[$j] = $champs1[0]; - $champs_final[$j] = substr("".$champs1[0]."", $nb_caracteres); + $champs_name = explode(":", $champs_total[$j]); + $champs_final[$j] = substr($champs_name[0], strpos($champs_name[0], "_") + 1); if ( $verif == true ) { @@ -86,17 +85,17 @@ define("'.$language1.'ADD","Add a '.UcFirstAndToLower($t_name).'"); define("'.$language1.'EDIT","Edit a '.UcFirstAndToLower($t_name).'"); define("'.$language1.'DELETE","Delete a '.UcFirstAndToLower($t_name).'"); - '; } $verif = false; - $text .= 'define("'.$language1.strtoupper($champs_final[$j]).'","'.str_ireplace("_", "", UcFirstAndToLower($champs_final[$j])).'"); + $text .= 'define("'.$language1.strtoupper($champs_final[$j]).'","'.str_ireplace("_", " ", UcFirstAndToLower($champs_final[$j])).'"); '; } $verif = true; $text .= ' '; } + $text .= '//Blocks.php'; foreach (array_keys($tables_arr) as $i) { Modified: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_admin_pages.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_admin_pages.php 2012-04-17 05:32:30 UTC (rev 9359) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_admin_pages.php 2012-04-17 14:57:39 UTC (rev 9360) @@ -54,7 +54,8 @@ $parametres = explode(":", $parametres_total[$i-1]); $champs_param_type[$i] = $parametres[0]; $champs_param_display_admin[$i] = $parametres[1]; - } + } + $online = substr($champs[$i], strpos($champs[$i], "_")); } $champs_id = $champs[0]; @@ -330,8 +331,9 @@ } else { xoops_confirm(array("ok" => 1, "'.$champs_id.'" => $_REQUEST["'.$champs_id.'"], "op" => "delete_'.$tables_name.'"), $_SERVER["REQUEST_URI"], sprintf('.$language.'_FORMSUREDEL, $obj->getVar("'.$champs_name.'"))); } - break; - + break;'; + if ( $online == 'online'){ + $text .= ' case "update_online_'.$tables_name.'": if (isset($_REQUEST["'.$champs_id.'"])) { $obj =& $'.$tables_name.'Handler->get($_REQUEST["'.$champs_id.'"]); @@ -341,7 +343,9 @@ redirect_header("'.$tables_name.'.php", 3, '.$language.'_FORMOK); } echo $obj->getHtmlErrors(); - break; + break;'; + } + $text .= ' } include "admin_footer.php"; ?>'; Modified: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_architecture.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_architecture.php 2012-04-17 05:32:30 UTC (rev 9359) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_architecture.php 2012-04-17 14:57:39 UTC (rev 9360) @@ -64,7 +64,9 @@ // Creation of "images/icons" folder and index.html file - Added in Version 1.15 echo $images_icons_index = $classArch->makeDirAndCopyFile('images/icons', $indexFile, 'index.html'); - // Creation of "on.png" file + // Creation of "arrow.gif" file + echo $module_images_arrow = $classArch->CopyFile('images/icons/', $fimages."/icons/arrow.gif", 'arrow.gif'); + // Creation of "on.png" file echo $module_images_icon_on = $classArch->CopyFile('images/icons/', $fimages."/icons/on.png", 'on.png'); // Creation of "off.png" file echo $module_images_icon_off = $classArch->CopyFile('images/icons/', $fimages."/icons/off.png", 'off.png'); Modified: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_class.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_class.php 2012-04-17 05:32:30 UTC (rev 9359) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_class.php 2012-04-17 14:57:39 UTC (rev 9360) @@ -68,8 +68,8 @@ function __construct() { $this->XoopsObject(); - '; - $text .= $constructor.' + '; + $text .= $constructor.' } function '.$tables_module_table.'() @@ -88,13 +88,10 @@ $title = $this->isNew() ? sprintf('.$language.strtoupper($tables_name).'_ADD) : sprintf('.$language.strtoupper($tables_name).'_EDIT); include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php"); - $form = new XoopsThemeForm($title, "form", $action, "post", true); - $form->setExtra(\'enctype="multipart/form-data"\'); - + $form->setExtra(\'enctype="multipart/form-data"\'); '; $text .= $form.' - $form->addElement(new XoopsFormHidden("op", "save_'.$tables_name.'")); $form->addElement(new XoopsFormButton("", "submit", _SUBMIT, "submit")); return $form; Modified: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_modinfo_language.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_modinfo_language.php 2012-04-17 05:32:30 UTC (rev 9359) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_modinfo_language.php 2012-04-17 14:57:39 UTC (rev 9360) @@ -83,8 +83,8 @@ if ( $structure_parametres[0] == 'XoopsFormUploadImage' || $structure_parametres[0] == 'XoopsFormUploadFile' ) { $text .= ' -define("'.$language1.'_MAXSIZE","Mime max size '.$structure_champs[0].'"); -define("'.$language1.'_MIMETYPES","Mime Types '.$structure_champs[0].'"); +define("'.$language.'_MAXSIZE","Mime max size '.$structure_champs[0].'"); +define("'.$language.'_MIMETYPES","Mime Types '.$structure_champs[0].'"); '; } } Modified: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_xoopsversion.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_xoopsversion.php 2012-04-17 05:32:30 UTC (rev 9359) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_xoopsversion.php 2012-04-17 14:57:39 UTC (rev 9360) @@ -19,7 +19,7 @@ */ include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php'; -function const_xoopsversion($modules, $modules_name, $tables_arr, $tables_module_table) +function const_xoopsversion($modules, $modules_name, $tables_arr, $tables_module_table, $tables_blocks, $tables_search) { $language = '_MI_'.strtoupper($modules_name).''; $file = "xoops_version.php"; @@ -85,7 +85,7 @@ '.$modv.'[\'adminmenu\'] = "admin/menu.php"; '; $j = 1; -if ( $tables_module_table != null ) { +if ( $tables_module_table == null ) { $text .= '// Mysql file '.$modv.'[\'sqlfile\'][\'mysql\'] = "sql/mysql.sql"; // Tables'; @@ -109,7 +109,7 @@ '; } -if ( $modules->getVar("modules_active_search") == 1 ) { +if ( $modules->getVar("modules_active_search") == 1 && $tables_search == 1 ) { $text .= '//Search '.$modv.'[\'hasSearch\'] = 1; '.$modv.'[\'search\'][\'file\'] = "include/search.inc.php"; @@ -139,6 +139,7 @@ '.$modvt.'[\'description\'] = "'.UcFirstAndToLower($modules_name).' footer page"; unset( $i ); '; +if ( $tables_blocks == 1 ) { $j = 1; $text .='//Blocks $i = 1;'; @@ -179,11 +180,12 @@ $j++; } } unset($j); +} $modvc = ''.$modv.'[\'config\'][$i]'; $text .= ' // Config $i = 1; -'.$modvc.'[\'name\'] = "editor"; +'.$modvc.'[\'name\'] = "'.strtolower($modules_name).'_editor"; '.$modvc.'[\'title\'] = "'.$language.'_EDITOR"; '.$modvc.'[\'description\'] = "'.$language.'_EDITOR_DESC"; '.$modvc.'[\'formtype\'] = "select"; Modified: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/include/functions_const.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/include/functions_const.php 2012-04-17 05:32:30 UTC (rev 9359) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/include/functions_const.php 2012-04-17 14:57:39 UTC (rev 9360) @@ -40,34 +40,33 @@ { $structure = explode(":", $champs[$i]); if ( $structure[1] == 'int' || $structure[1] == 'tinyint' || $structure[1] == 'mediumint' || $structure[1] == 'smallint' ) { - $text .= '$this->initVar("'.$structure[0].'", XOBJ_DTYPE_INT, null, false, '.$structure[2].'); - '; + $text .= '$this->initVar("'.$structure[0].'", XOBJ_DTYPE_INT, null, false, '.$structure[2].'); + '; } elseif ( $structure[1] == 'char' || $structure[1] == 'varchar' ) { - $text .= '$this->initVar("'.$structure[0].'", XOBJ_DTYPE_TXTBOX, null, false, '.$structure[2].'); - '; + $text .= '$this->initVar("'.$structure[0].'", XOBJ_DTYPE_TXTBOX, null, false, '.$structure[2].'); + '; } elseif ( $structure[1] == 'text' || $structure[1] == 'tinytext' || $structure[1] == 'mediumtext' || $structure[1] == 'longtext' ) { - $text .= ' $this->initVar("'.$structure[0].'", XOBJ_DTYPE_TXTAREA, null, false); - '; + $text .= '$this->initVar("'.$structure[0].'", XOBJ_DTYPE_TXTAREA, null, false); + '; } elseif ( $structure[1] == 'float' ) { - $text .= ' $this->initVar("'.$structure[0].'", XOBJ_DTYPE_FLOAT, null, false); - '; + $text .= '$this->initVar("'.$structure[0].'", XOBJ_DTYPE_FLOAT, null, false); + '; } elseif ( $structure[1] == 'decimal' || $structure[1] == 'double' ) { - $text .= ' $this->initVar("'.$structure[0].'", XOBJ_DTYPE_DECIMAL, null, false); - '; + $text .= '$this->initVar("'.$structure[0].'", XOBJ_DTYPE_DECIMAL, null, false); + '; } elseif ( $structure[1] == 'enum' ) { - $text .= ' $this->initVar("'.$structure[0].'", XOBJ_DTYPE_ENUM, null, false); - '; + $text .= '$this->initVar("'.$structure[0].'", XOBJ_DTYPE_ENUM, null, false); + '; } elseif ( $structure[1] == 'email' ) { - $text .= ' $this->initVar("'.$structure[0].'", XOBJ_DTYPE_EMAIL, null, false, '.$structure[2].'); - '; + $text .= '$this->initVar("'.$structure[0].'", XOBJ_DTYPE_EMAIL, null, false, '.$structure[2].'); + '; } elseif ( $structure[1] == 'url' ) { - $text .= ' $this->initVar("'.$structure[0].'", XOBJ_DTYPE_URL, null, false, '.$structure[2].'); - '; + $text .= '$this->initVar("'.$structure[0].'", XOBJ_DTYPE_URL, null, false, '.$structure[2].'); + '; } elseif ( $structure[1] == 'date' || $structure[1] == 'datetime' || $structure[1] == 'timestamp' || $structure[1] == 'time' || $structure[1] == 'year' ) { - $text .= '$this->initVar("'.$structure[0].'", XOBJ_DTYPE_LTIME, null, false); - '; + $text .= '$this->initVar("'.$structure[0].'", XOBJ_DTYPE_LTIME, null, false);'; }/* elseif ( $structure[1] == 'other' ) { - $text .= ' $this->initVar("'.$structure[0].'", XOBJ_DTYPE_OTHER, '.$structure[2].', false); + $text .= ' $this->initVar("'.$structure[0].'", XOBJ_DTYPE_OTHER, '.$structure[2].', false); '; }*/ } @@ -195,7 +194,8 @@ for($i=0; $i<$nb_champs; $i++) { if ( $champs_param_display_admin[$i] == 1 ) { - if ( $i == $nb_champs - 1 ) + $online = substr($champs[$i], strpos($champs[$i], "_")); + if ( $i == $nb_champs && $online == 'online' && $champs[$i] == 'topic_online') { $text .= ' $online = $'.$tables_name.'_arr[$i]->getVar("'.$champs[$i].'"); @@ -211,7 +211,7 @@ $text .= 'echo "<td class=\'left\'>".$prefix." ".$topic_arr[$i]->getVar("'.$champs[$i].'")."</td>"; '; } else { - $text .= 'echo "<td class=\'left\'><img src=\'".'.strtoupper($modules_name).'_URL."/images/deco/arrow.gif\'> ".$topic_arr[$i]->getVar("'.$champs[$i].'")."</td>"; + $text .= 'echo "<td class=\'left\'><img src=\'".'.strtoupper($modules_name).'_URL."/images/icons/arrow.gif\'> ".$topic_arr[$i]->getVar("'.$champs[$i].'")."</td>"; '; } @@ -236,10 +236,6 @@ $'.$tables_name.'_topic1 = $'.$tables_name.'1->getVar("topic_title"); echo "<td class=\'center\'>".$'.$tables_name.'_topic1."</td>"; '; - } else if ( $champs_param_type[$i] == 'XoopsFormSelect' ) - { - $text .= 'echo "<td class=\'center\'>".$'.$tables_name.'_arr[$i]->getVar("'.$champs[$i].'")."</td>"; - '; } else if ( $champs_param_type[$i] == 'XoopsFormSelectUser' ) { $text .= 'echo "<td class=\'center\'>".XoopsUser::getUnameFromId($'.$tables_name.'_arr[$i]->getVar("'.$champs[$i].'"),"S")."</td>"; @@ -371,123 +367,120 @@ break; case "XoopsFormText": - $text .= '$form->addElement(new XoopsFormText('.$language_form.', "'.$structure0.'", 50, 255, $this->getVar("'.$structure0.'")), '.$required_field.'); + $text .= ' + $form->addElement(new XoopsFormText('.$language_form.', "'.$structure0.'", 50, 255, $this->getVar("'.$structure0.'")), '.$required_field.'); '; break; case "XoopsFormTextArea": - $text .= '$form->addElement(new XoopsFormTextArea('.$language_form.', "'.$structure0.'", $this->getVar("'.$structure0.'"), 4, 47), '.$required_field.'); + $text .= ' + $form->addElement(new XoopsFormTextArea('.$language_form.', "'.$structure0.'", $this->getVar("'.$structure0.'"), 4, 47), '.$required_field.'); '; break; case "XoopsFormDhtmlTextArea": - $text .= '$editor_configs=array(); - $editor_configs["name"] ="'.$structure0.'"; - $editor_configs["value"] = $this->getVar("'.$structure0.'", "e"); - $editor_configs["rows"] = 10; - $editor_configs["cols"] = 80; - $editor_configs["width"] = "100%"; - $editor_configs["height"] = "400px"; - $editor_configs["editor"] = $GLOBALS["xoopsModuleConfig"]["editor"]; - $form->addElement( new XoopsFormEditor('.$language_form.', "'.$structure0.'", $editor_configs), true ); + $text .= ' + $editor_configs=array(); + $editor_configs["name"] ="'.$structure0.'"; + $editor_configs["value"] = $this->getVar("'.$structure0.'", "e"); + $editor_configs["rows"] = 10; + $editor_configs["cols"] = 80; + $editor_configs["width"] = "100%"; + $editor_configs["height"] = "400px"; + $editor_configs["editor"] = $GLOBALS["xoopsModuleConfig"]["'.strtolower($modules_name).'_editor"]; + $form->addElement( new XoopsFormEditor('.$language_form.', "'.$structure0.'", $editor_configs), true ); '; break; case "XoopsFormCheckBox": - $text .= ' $'.$structure0.' = $this->isNew() ? 0 : $this->getVar("'.$structure0.'"); - $check_'.$structure0.' = new XoopsFormCheckBox('.$language_form.', "'.$structure0.'", $'.$structure0.'); - $check_'.$structure0.'->addOption(1, " "); - $form->addElement($check_'.$structure0.'); + $text .= ' + $'.$structure0.' = $this->isNew() ? 0 : $this->getVar("'.$structure0.'"); + $check_'.$structure0.' = new XoopsFormCheckBox('.$language_form.', "'.$structure0.'", $'.$structure0.'); + $check_'.$structure0.'->addOption(1, " "); + $form->addElement($check_'.$structure0.'); '; break; case "XoopsFormHidden": - $text .= '$form->addElement(new XoopsFormHidden("'.$structure0.'", $this->getVar("'.$structure0.'"))); + $text .= ' + $form->addElement(new XoopsFormHidden("'.$structure0.'", $this->getVar("'.$structure0.'"))); '; break; case "XoopsFormUploadImage": $text .= ' - $'.$structure0.' = $this->getVar("'.$structure0.'") ? $this->getVar("'.$structure0.'") : \'blank.gif\'; - - $uploadirectory = \'/uploads/'.$modules_name.'/images\'; - $imgtray = new XoopsFormElementTray('.$language_form.',\'<br />\'); - $imgpath = sprintf('.$language1.'FORMIMAGE_PATH, ".".$uploadirectory."/"); - $imageselect = new XoopsFormSelect($imgpath, \''.$structure0.'\', $'.$structure0.'); - $image_array = XoopsLists :: getImgListAsArray( XOOPS_ROOT_PATH.$uploadirectory ); - foreach( $image_array as $image ) { - $imageselect->addOption("$image", $image); - } - $imageselect->setExtra( "onchange=\'showImgSelected(\"image1\", \"'.$structure0.'\", \"".$uploadirectory."\", \"\", \"".XOOPS_URL."\")\'" ); - $imgtray->addElement($imageselect, false); - $imgtray->addElement( new XoopsFormLabel( \'\', "<br /><img src=\'".XOOPS_URL."/".$uploadirectory."/".$'.$structure0.'."\' name=\'image1\' id=\'image1\' alt=\'\' />" ) ); - $fileseltray = new XoopsFormElementTray(\'\',\'<br />\'); - $fileseltray->addElement(new XoopsFormFile('.$language1.'FORMUPLOAD , "'.$structure0.'", $GLOBALS[\'xoopsModuleConfig\'][\'maxsize\']),false); - $fileseltray->addElement(new XoopsFormLabel(\'\'), false); - $imgtray->addElement($fileseltray); - $form->addElement($imgtray); - + $'.$structure0.' = $this->getVar("'.$structure0.'") ? $this->getVar("'.$structure0.'") : \'blank.gif\'; + + $uploadirectory = \'/uploads/'.$modules_name.'/images\'; + $imgtray = new XoopsFormElementTray('.$language_form.',\'<br />\'); + $imgpath = sprintf('.$language1.'FORMIMAGE_PATH, ".".$uploadirectory."/"); + $imageselect = new XoopsFormSelect($imgpath, \''.$structure0.'\', $'.$structure0.'); + $image_array = XoopsLists :: getImgListAsArray( XOOPS_ROOT_PATH.$uploadirectory ); + foreach( $image_array as $image ) { + $imageselect->addOption("$image", $image); + } + $imageselect->setExtra( "onchange=\'showImgSelected(\"image1\", \"'.$structure0.'\", \"".$uploadirectory."\", \"\", \"".XOOPS_URL."\")\'" ); + $imgtray->addElement($imageselect, false); + $imgtray->addElement( new XoopsFormLabel( \'\', "<br /><img src=\'".XOOPS_URL."/".$uploadirectory."/".$'.$structure0.'."\' name=\'image1\' id=\'image1\' alt=\'\' />" ) ); + $fileseltray = new XoopsFormElementTray(\'\',\'<br />\'); + $fileseltray->addElement(new XoopsFormFile('.$language1.'FORMUPLOAD , "'.$structure0.'", $GLOBALS[\'xoopsModuleConfig\'][\'maxsize\']),false); + $fileseltray->addElement(new XoopsFormLabel(\'\'), false); + $imgtray->addElement($fileseltray); + $form->addElement($imgtray); '; break; case "XoopsFormUploadFile": - $text .= '$form->addElement(new XoopsFormFile('.$language_form.', "'.$structure0.'", $GLOBALS[\'xoopsModuleConfig\'][\'maxsize\']), '.$required_field.'); + $text .= ' + $form->addElement(new XoopsFormFile('.$language_form.', "'.$structure0.'", $GLOBALS[\'xoopsModuleConfig\'][\'maxsize\']), '.$required_field.'); '; break; case "XoopsFormColorPicker": - $text .= '$form->addElement(new XoopsFormColorPicker('.$language_form.', "'.$structure0.'", $this->getVar("'.$structure0.'")), '.$required_field.'); - '; - break; - - case "XoopsFormSelect": - $data = explode("-", $champs_param_elements[$i]); $text .= ' - $'.$data[0].'Handler =& xoops_getModuleHandler("'.$modules_name.'_'.$data[0].'", "'.$modules_name.'"); - $'.$data[0].'_select = new XoopsFormSelect('.$language_form.', "'.$structure0.'", $this->getVar("'.$structure0.'")); - $'.$data[0].'_select->addOptionArray($'.$data[0].'Handler->getList()); - $form->addElement($'.$data[0].'_select, '.$required_field.'); + $form->addElement(new XoopsFormColorPicker('.$language_form.', "'.$structure0.'", $this->getVar("'.$structure0.'")), '.$required_field.'); '; - unset($data); - break; - + break; + case "XoopsFormSelectUser": - $text .= '$form->addElement(new XoopsFormSelectUser('.$language_form.', "'.$structure0.'", false, $this->getVar("'.$structure0.'"), 1, false), '.$required_field.'); + $text .= ' + $form->addElement(new XoopsFormSelectUser('.$language_form.', "'.$structure0.'", false, $this->getVar("'.$structure0.'"), 1, false), '.$required_field.'); '; break; case "XoopsFormTopic": $text .= ' - include_once(XOOPS_ROOT_PATH."/class/tree.php"); - $topicHandler =& xoops_getModuleHandler("'.$modules_name.'_topic", "'.$modules_name.'"); - $arr = $topicHandler->getall(); - $mytree = new XoopsObjectTree($arr, "topic_id", "topic_pid"); - $form->addElement(new XoopsFormLabel('.$language_form.', $mytree->makeSelBox("'.$structure0.'", "topic_title","-", $this->getVar("'.$structure0.'"),'.$required_field.'))); + include_once(XOOPS_ROOT_PATH."/class/tree.php"); + $topicHandler =& xoops_getModuleHandler("'.$modules_name.'_topic", "'.$modules_name.'"); + $arr = $topicHandler->getall(); + $mytree = new XoopsObjectTree($arr, "topic_id", "topic_pid"); + $form->addElement(new XoopsFormLabel('.$language_form.', $mytree->makeSelBox("'.$structure0.'", "topic_title","-", $this->getVar("'.$structure0.'"),'.$required_field.'))); '; break; case "XoopsFormRadioYN": $text .= ' $'.$structure0.' = $this->isNew() ? 0 : $this->getVar("'.$structure0.'"); - $form->addElement(new XoopsFormRadioYN('.$language_form.', "'.$structure0.'", $'.$structure0.', _YES, _NO), '.$required_field.'); + $form->addElement(new XoopsFormRadioYN('.$language_form.', "'.$structure0.'", $'.$structure0.', _YES, _NO), '.$required_field.'); '; break; case "XoopsFormTextDateSelect": - $text .= '$form->addElement(new XoopsFormTextDateSelect('.$language_form.', "'.$structure0.'", "", $this->getVar("'.$structure0.'"))); + $text .= ' + $form->addElement(new XoopsFormTextDateSelect('.$language_form.', "'.$structure0.'", "", $this->getVar("'.$structure0.'"))); '; break; default: $data = explode("-", $champs_param_elements[$i]); $text .= ' - include_once(XOOPS_ROOT_PATH."/class/tree.php"); - $'.$data[1].'Handler =& xoops_getModuleHandler("'.$modules_name.'_'.$data[1].'", "'.$modules_name.'"); - $criteria = new CriteriaCompo(); - $criteria->setSort(\''.$data[1].'_id ASC, '.$data[1].'_title\'); - $criteria->setOrder(\'ASC\'); - $'.$data[1].'_arr = $'.$data[1].'Handler->getall(); - $mytree = new XoopsObjectTree($'.$data[1].'_arr, "'.$data[1].'_id", "'.$data[1].'_pid"); - $form->addElement(new XoopsFormLabel('.$language_form.', $mytree->makeSelBox("'.$data[1].'_pid", "'.$data[1].'_title","--", $this->getVar("'.$data[1].'_pid"),'.$required_field.'))); + include_once(XOOPS_ROOT_PATH."/class/tree.php"); + $'.$data[1].'Handler =& xoops_getModuleHandler("'.$modules_name.'_'.$data[1].'", "'.$modules_name.'"); + $criteria = new CriteriaCompo(); + $criteria->setSort(\''.$data[1].'_id ASC, '.$data[1].'_title\'); + $criteria->setOrder(\'ASC\'); + $'.$data[1].'_arr = $'.$data[1].'Handler->getall(); + $mytree = new XoopsObjectTree($'.$data[1].'_arr, "'.$data[1].'_id", "'.$data[1].'_pid"); + $form->addElement(new XoopsFormLabel('.$language_form.', $mytree->makeSelBox("'.$data[1].'_pid", "'.$data[1].'_title","--", $this->getVar("'.$data[1].'_pid"),'.$required_field.'))); '; unset($data); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |