From: <txm...@us...> - 2012-04-15 15:27:17
|
Revision: 9333 http://xoops.svn.sourceforge.net/xoops/?rev=9333&view=rev Author: txmodxoops Date: 2012-04-15 15:27:10 +0000 (Sun, 15 Apr 2012) Log Message: ----------- Updated and fixed Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/building.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/tables.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/class/tdmcreate_tables.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_admin_header.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_admin_pages.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_class.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_header.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_include_configs.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_include_functions.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_templates_header.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_templates_pages.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_user_pages.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_xoopsversion.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/include/functions_const.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/language/english/admin.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/language/italian/admin.php XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/sql/mysql.sql Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/building.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/building.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/building.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -74,7 +74,12 @@ $tbls_pending = $tbls_arr[$i]->getVar('tables_pending'); $tbls_search = $tbls_arr[$i]->getVar('tables_search'); $tbls_coms = $tbls_arr[$i]->getVar('tables_coms'); - + + //Creation of the file mysql.sql + const_sql($mods_name, $tbls_module_table, $tbls_name, $tbls_champs); + $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix("tdmcreate_tables")." WHERE tables_name = ".$mods_name."'_topic'"); + list( $topic ) = $xoopsDB->fetchRow($result); + //Fabrication //Copie of images tables $tbls_img1 = $modPath."/images/uploads/tables/".$tbls_img; @@ -86,11 +91,11 @@ //Creation of pages admin if ( $mods_display_admin == 1 ) { - const_admin_pages($mods, $mods_name, $tbls_id, $tbls_module_table, $tbls_name, $tbls_img, $tbls_champs, $tbls_parametres, $tbls_online, $tbls_pending); + const_admin_pages($mods, $mods_name, $tbls_id, $tbls_module_table, $tbls_name, $tbls_img, $tbls_champs, $tbls_parametres, $topic); } //Creation of pages and templates user if ( $mods_display_user == 1 ) { - const_user_pages($mods, $mods_name, $tbls_name, $tbls_champs, $tbls_parametres); + const_user_pages($mods, $mods_name, $tbls_name, $tbls_champs, $tbls_parametres, $topic); // Creation of templates pages const_templates_pages($mods, $mods_name, $tbls_name, $tbls_module_table, $tbls_champs, $tbls_parametres); } @@ -101,19 +106,8 @@ //Creation of the comments if ( $tbls_coms == 1 ) { const_include_coms($mods, $mods_name, $tbls_name, $tbls_module_table, $tbls_champs, $tbls_parametres); - } + } - //Creation of the file mysql.sql - const_sql($mods_name, $tbls_module_table, $tbls_name, $tbls_champs); - $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix("tdmcreate_tables"). - " WHERE tables_name = 'topic' OR tables_name = '".$tbls_name."_topic' - OR tables_name = 'cat' - OR tables_name = 'category' - OR tables_name = 'categories' - OR tables_name = '".$tbls_name."_cat' - OR tables_name = '".$tbls_name."_category' - OR tables_name = '".$tbls_name."_categories' "); - list( $topic ) = $xoopsDB->fetchRow($result); //Creation of the blocks if ( $tbls_blocks != 1 ) { const_blocks($mods, $mods_name, $tbls_module_table, $tbls_name, $tbls_champs, $tbls_parametres, $topic); Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/tables.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/tables.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/admin/tables.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -52,10 +52,12 @@ $obj->setVar('tables_display_user', 1); $obj->setVar('tables_search', 0); $obj->setVar('tables_coms', 0); - $obj->setVar('tables_nb_champs', 7); - $tables_champs = ''; - $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'; + $tables_champs = 'topic_id:int:11:unsigned:NOT NULL: :|topic_pid:int:5:unsigned:NOT NULL:0:|topic_title:varchar:255: :NOT NULL: :|topic_desc:text: : :NOT NULL: :|topic_img:varchar:255: :NOT NULL: :|topic_weight:int:5: :NOT NULL:0:|topic_color:varchar:10: :NULL: :|topic_submitter:int:10: :NOT NULL:0:|topic_created:int:10: :NOT NULL:0:|topic_online:tinyint:1: :NOT NULL:0:'; + + $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'; //Image include_once XOOPS_ROOT_PATH.'/class/uploader.php'; @@ -91,7 +93,7 @@ $obj->setVar('tables_display_user', $_REQUEST['tables_display_user']); $obj->setVar('tables_search', $_REQUEST['tables_search']); $obj->setVar('tables_coms', $_REQUEST['tables_coms']); - $obj->setVar('tables_nb_champs', $_REQUEST['tables_nb_champs']); + //$obj->setVar('tables_nb_champs', $_REQUEST['tables_nb_champs']); $tables_champs = ''; $tables_parametres = ''; @@ -123,16 +125,28 @@ if ( $i != 0 ) $tables_parametres .= '|'; } else { - /*if ( isset($_REQUEST['tables_submitter']) == 1 ) + $submit = 0; $create = 0; $online = 0; + if ( isset($_REQUEST['tables_submitter']) == 1 ) { $tables_champs .= '|'.strtolower($_REQUEST['tables_name']).'_submitter:int:10: :NOT NULL:0:'; - if ( isset($_REQUEST['tables_date_created']) == 1 ) - $tables_champs .= '|'.strtolower($_REQUEST['tables_name']).'_date_created:int:10: :NOT NULL:0:'; - if ( isset($_REQUEST['tables_online']) == 1 ) - $tables_champs .= '|'.strtolower($_REQUEST['tables_name']).'_online:tinyint:1: :NOT NULL:0:'; */ - $tables_champs .= ''; + $submit = 1; + } + if ( isset($_REQUEST['tables_created']) == 1 ) { + $tables_champs .= '|'.strtolower($_REQUEST['tables_name']).'_created:int:10: :NOT NULL:0:'; + $create = 1; + } + if ( isset($_REQUEST['tables_online']) == 1 ) { + $tables_champs .= '|'.strtolower($_REQUEST['tables_name']).'_online:tinyint:1: :NOT NULL:0:'; + $online = 1; + } + $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; + $obj->setVar('tables_nb_champs', $nb_champs); } $obj->setVar('tables_champs', $tables_champs); $obj->setVar('tables_parametres', $tables_parametres); Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/class/tdmcreate_tables.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/class/tdmcreate_tables.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/class/tdmcreate_tables.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -682,25 +682,25 @@ $modules_select = new XoopsFormSelect(_AM_TDMCREATE_TABLES_MODULES, 'tables_modules', $this->getVar('tables_modules')); $modules_select->addOptionArray($modulesHandler->getList()); $form->addElement($modules_select, true); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_TABLES_NAME, 'tables_name', 40, 255, $this->getVar('tables_name')), true); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_TABLES_NB_CHAMPS, 'tables_nb_champs', 10, 25, $this->getVar('tables_nb_champs')), true); - - $select_blocs = $this->isNew() ? 0 : $this->getVar('tables_blocs'); - $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_BLOCS, 'tables_blocs', $select_blocs, _YES, _NO)); - - $select_display_admin = $this->isNew() ? 0 : $this->getVar('tables_display_admin'); - $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_DISPLAY_ADMIN, 'tables_display_admin', $select_display_admin, _YES, _NO)); + $form->addElement(new XoopsFormText(_AM_TDMCREATE_TABLES_NAME, 'tables_name', 40, 255, $this->getVar('tables_name')), true); + $form->addElement(new XoopsFormText(_AM_TDMCREATE_TABLES_NB_CHAMPS, 'tables_nb_champs', 10, 25, $this->getVar('tables_nb_champs')), true); + + $select_blocs = $this->isNew() ? 0 : $this->getVar('tables_blocs'); + $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_BLOCS, 'tables_blocs', $select_blocs, _YES, _NO)); + + $select_display_admin = $this->isNew() ? 0 : $this->getVar('tables_display_admin'); + $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_DISPLAY_ADMIN, 'tables_display_admin', $select_display_admin, _YES, _NO)); - $select_display_user = $this->isNew() ? 0 : $this->getVar('tables_display_user'); - $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_DISPLAY_USER, 'tables_display_user', $select_display_user, _YES, _NO)); - - $form->addElement(new XoopsFormLabel(_AM_TDMCREATE_FORM_INFO_TABLE,_AM_TDMCREATE_FORM_INFO_TABLE_FIELD)); - $select_submitter = $this->isNew() ? 0 : $this->getVar('tables_submitter'); - $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_SUBMITTER, 'tables_submitter', $select_submitter, _YES, _NO)); - $select_date_created = $this->isNew() ? 0 : $this->getVar('tables_date_created'); - $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_DATE_CREATED, 'tables_date_created', $select_date_created, _YES, _NO)); - $select_online = $this->isNew() ? 0 : $this->getVar('tables_online'); - $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_ONLINE, 'tables_online', $select_online, _YES, _NO)); + $select_display_user = $this->isNew() ? 0 : $this->getVar('tables_display_user'); + $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_DISPLAY_USER, 'tables_display_user', $select_display_user, _YES, _NO)); + + $form->addElement(new XoopsFormLabel(_AM_TDMCREATE_FORM_INFO_TABLE,_AM_TDMCREATE_FORM_INFO_TABLE_FIELD)); + $select_submitter = $this->isNew() ? 0 : $this->getVar('tables_submitter'); + $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_SUBMITTER, 'tables_submitter', $select_submitter, _YES, _NO)); + $select_created = $this->isNew() ? 0 : $this->getVar('tables_created'); + $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_CREATED, 'tables_created', $select_created, _YES, _NO)); + $select_online = $this->isNew() ? 0 : $this->getVar('tables_online'); + $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_ONLINE, 'tables_online', $select_online, _YES, _NO)); $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix("tdmcreate_tables")." WHERE tables_search = '1'"); list( $active_search ) = $xoopsDB->fetchRow($result); @@ -776,13 +776,13 @@ $modules_select->addOptionArray($modulesHandler->getList()); $form->addElement($modules_select, true); - $form->addElement(new XoopsFormLabel(_AM_TDMCREATE_FORM_INFO_TABLE,_AM_TDMCREATE_FORM_INFO_TABLE_FIELD)); + /*$form->addElement(new XoopsFormLabel(_AM_TDMCREATE_FORM_INFO_TABLE,_AM_TDMCREATE_FORM_INFO_TABLE_FIELD)); $select_submitter = $this->isNew() ? 0 : $this->getVar('tables_submitter'); $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_SUBMITTER, 'tables_submitter', $select_submitter, _YES, _NO)); - $select_date_created = $this->isNew() ? 0 : $this->getVar('tables_date_created'); - $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_DATE_CREATED, 'tables_date_created', $select_date_created, _YES, _NO)); + $select_created = $this->isNew() ? 0 : $this->getVar('tables_created'); + $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_CREATED, 'tables_created', $select_created, _YES, _NO)); $select_online = $this->isNew() ? 0 : $this->getVar('tables_online'); - $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_ONLINE, 'tables_online', $select_online, _YES, _NO)); + $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_ONLINE, 'tables_online', $select_online, _YES, _NO));*/ $tables_img1 = $this->getVar('tables_img') ? $this->getVar('tables_img') : 'blank.gif'; Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_admin_header.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_admin_header.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_admin_header.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -61,15 +61,13 @@ $pathImageAdmin = XOOPS_URL .\'/\'. $moduleInfo->getInfo(\'icons32\'); '; - foreach (array_keys($tables_arr) as $i) { -$text .= '$'.$tables_arr[$i]->getVar("tables_name").'Handler=& xoops_getModuleHandler(\''.$modules_name.'_'.$tables_arr[$i]->getVar("tables_name"). '\', $dirname); - + $t_name = $tables_arr[$i]->getVar("tables_name"); +$text .= '$'.$t_name.'Handler=& xoops_getModuleHandler(\''.$modules_name.'_'.$t_name.'\', $dirname); '; } $text .=<<<'EOD' - $myts =& MyTextSanitizer::getInstance(); if ($xoopsUser) { Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_admin_pages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_admin_pages.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_admin_pages.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -20,16 +20,12 @@ include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/const/const_entete.php'; include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php'; -function const_admin_pages($modules, $modules_name, $tables_id, $tables_module_table, $tables_name, $tables_img, $tables_champs, $tables_parametres) +function const_admin_pages($modules, $modules_name, $tables_id, $tables_module_table, $tables_name, $tables_img, $tables_champs, $tables_parametres, $topic) { $language = '_AM_'.strtoupper($modules_name).''; - $language_manager = '_AM_'.strtoupper($modules_name).'_'.strtoupper($tables_name).''; - - $modules_name_minuscule = strtolower($modules_name); $file = $tables_name.".php"; $path_file = TDM_CREATE_MURL."/".$modules_name."/admin/".$file; $en_tete = const_entete($modules, 0); - $text = '<?php'.$en_tete.' include "admin_header.php"; xoops_cp_header(); @@ -90,7 +86,7 @@ $pagenav = \'\'; } '; - if ( $tables_name != 'topic' ) + if ( $topic != 1 ) { $text .=' // View Table @@ -98,66 +94,86 @@ { echo "<table class=\'outer width100\' cellspacing=\'1\'> <tr> + <th class=\'center width2\'>".'.$language.'_'.strtoupper($tables_name).'_ID."</th> '; $champs_colonne_name = const_show_champs_parametres($modules_name, $tables_name, $champs_id, $nb_champs, $champs, $champs_param_display_admin, $champs_param_type, $language, '', 0); - $text .= ''.$champs_colonne_name.' - <th class=\'center width5\'>".'.$language.'_FORMACTION."</th> + $text .= ''.$champs_colonne_name.'<th class=\'center width5\'>".'.$language.'_FORMACTION."</th> </tr>"; $class = "odd"; foreach (array_keys($'.$tables_name.'_arr) as $i) - { + { '; + if( $topic == 1) { + $text .= ' if ( $'.$tables_name.'_arr[$i]->getVar("topic_pid") == 0) { echo "<tr class=\'".$class."\'>"; $class = ($class == "even") ? "odd" : "even"; + echo "<td class=\'center\'>".$i."</td>"; '; $champs_data = const_show_champs_parametres($modules_name, $tables_name, $champs_id, $nb_champs, $champs, $champs_param_display_admin, $champs_param_type, $language, '', 1); - $text .= ''.$champs_data.' + $text .= $champs_data.' echo "<td class=\'center width5\'> - <a href=\"'.$tables_name.'.php?op=edit_'.$tables_name.'&'.$champs_id.'=".$'.$tables_name.'_arr[$i]->getVar("'.$champs_id.'")."\"><img src=".$pathImageIcon."/edit.png alt=\""._EDIT."\" title=\""._EDIT."\"></a> - <a href=\"'.$tables_name.'.php?op=delete_'.$tables_name.'&'.$champs_id.'=".$'.$tables_name.'_arr[$i]->getVar("'.$champs_id.'")."\"><img src=".$pathImageIcon."/delete.png alt=\""._DELETE."\" title=\""._DELETE."\"></a> + <a href=\''.$tables_name.'.php?op=edit_'.$tables_name.'&'.$champs_id.'=".$i."\'><img src=".$pathImageIcon."/edit.png alt=\'"._EDIT."\' title=\'"._EDIT."\'></a> + <a href=\''.$tables_name.'.php?op=delete_'.$tables_name.'&'.$champs_id.'=".$i."\'><img src=".$pathImageIcon."/delete.png alt=\'"._DELETE."\' title=\'"._DELETE."\'></a> </td>"; echo "</tr>"; - } + }'; + } else { + $text .= ' + echo "<tr class=\'".$class."\'>"; + $class = ($class == "even") ? "odd" : "even"; + echo "<td class=\'center\'>".$i."</td>"; + '; + $champs_data = const_show_champs_parametres($modules_name, $tables_name, $champs_id, $nb_champs, $champs, $champs_param_display_admin, $champs_param_type, $language, '', 1); + + $text .= $champs_data.' + echo "<td class=\'center width5\'> + <a href=\''.$tables_name.'.php?op=edit_'.$tables_name.'&'.$champs_id.'=".$i."\'><img src=".$pathImageIcon."/edit.png alt=\'"._EDIT."\' title=\'"._EDIT."\'></a> + <a href=\''.$tables_name.'.php?op=delete_'.$tables_name.'&'.$champs_id.'=".$i."\'><img src=".$pathImageIcon."/delete.png alt=\'"._DELETE."\' title=\'"._DELETE."\'></a> + </td>"; + echo "</tr>";'; + } + $text .= ' } - echo "</table><br><br>"; + echo "</table><br /><br />"; echo "<br /><div class=\'center\'>" . $pagenav . "</div><br />"; } else { echo "<table class=\'outer width100\' cellspacing=\'1\'> - <tr> - '; + <tr> + <th class=\'center width2\'>".'.$language.'_'.strtoupper($tables_name).'_ID."</th> + '; $champs_colonne_name = const_show_champs_parametres($modules_name, $tables_name, $champs_id, $nb_champs, $champs, $champs_param_display_admin, $champs_param_type, $language, '', 0); - $text .= ''.$champs_colonne_name.' - <th class=\'center width5\'>".'.$language.'_FORMACTION."</th> + $text .= ''.$champs_colonne_name.'<th class=\'center width5\'>".'.$language.'_FORMACTION."</th> </tr>"; - echo "</table><br><br>"; + echo "</table><br /><br />"; } '; } else { $text .= ' - //Fonction qui permet afficher les catégories enfants + //Function that enables display child categories function '.$modules_name.'_display_children($topic_id = 0, $topic_arr, $prefix = "", $order = "", &$class) { global $pathImageIcon; $topicHandler =& xoops_getModuleHandler("'.$tables_module_table.'", "'.$modules_name.'"); - $prefix = $prefix."<img src=\"".XOOPS_URL."/modules/'.$modules_name.'/images/deco/arrow.gif\">"; + $prefix = $prefix."<img src=\'".XOOPS_URL."/modules/'.$modules_name.'/images/deco/arrow.gif\'>"; foreach (array_keys($topic_arr) as $i) { $topic_id = $topic_arr[$i]->getVar("topic_id"); $topic_img = $topic_arr[$i]->getVar("topic_img"); $topic_title = $topic_arr[$i]->getVar("topic_title"); $topic_weight = $topic_arr[$i]->getVar("topic_weight"); - echo "<tr class=\"".$class."\">"; + echo "<tr class=\'".$class."\'>"; + echo "<td class=\'center\'>".$i."</td>"; '; $champs_data = const_show_champs_parametres($modules_name, $tables_name, $champs_id, $nb_champs, $champs, $champs_param_display_admin, $champs_param_type, $language, 1, 1); - $text .= ''.$champs_data.' - echo "<td class=\'center\' width=\"10%\"> - <a href=\"'.$tables_name.'.php?op=edit_'.$tables_name.'&'.$champs_id.'=".$'.$tables_name.'_arr[$i]->getVar("'.$champs_id.'")."\"><img src=".$pathImageIcon."/edit.png alt=\""._EDIT."\" title=\""._EDIT."\"></a> - <a href=\"'.$tables_name.'.php?op=delete_'.$tables_name.'&'.$champs_id.'=".$'.$tables_name.'_arr[$i]->getVar("'.$champs_id.'")."\"><img src=".$pathImageIcon."/delete.png alt=\""._DELETE."\" title=\""._DELETE."\"></a> + $text .= $champs_data.' + echo "<td class=\'center\' width=\'10%\'> + <a href=\''.$tables_name.'.php?op=edit_'.$tables_name.'&'.$champs_id.'=".$i."\'><img src=".$pathImageIcon."/edit.png alt=\'"._EDIT."\' title=\'"._EDIT."\'></a> + <a href=\''.$tables_name.'.php?op=delete_'.$tables_name.'&'.$champs_id.'=".$i."\'><img src=".$pathImageIcon."/delete.png alt=\'"._DELETE."\' title=\'"._DELETE."\'></a> </td> </tr>"; $class = ($class == "even") ? "odd" : "even"; @@ -179,29 +195,32 @@ { echo "<table class=\'outer width100\' cellspacing=\'1\'> <tr> - '; + <th class=\'center width2\'>".'.$language.'_'.strtoupper($tables_name).'_ID."</th> + '; $champs_colonne_name = const_show_champs_parametres($modules_name, $tables_name, $champs_id, $nb_champs, $champs, $champs_param_display_admin, $champs_param_type, $language, '', 0); - $text .= $champs_colonne_name.' - <th class=\'center width5\'>".'.$language.'_FORMACTION."</th> + $text .= $champs_colonne_name.'<th class=\'center width5\'>".'.$language.'_FORMACTION."</th> </tr>"; $class = "odd"; - $prefix = "<img src=\"".XOOPS_URL."/modules/'.$modules_name.'/images/deco/arrow.gif\">"; + $prefix = "<img src=\'".XOOPS_URL."/modules/'.$modules_name.'/images/deco/arrow.gif\'>"; foreach (array_keys($'.$tables_name.'_arr) as $i) - { + { + '; + if( $topic == 1) { + $text .= ' if ( $'.$tables_name.'_arr[$i]->getVar("topic_pid") == 0 ) { $topic_id = $'.$tables_name.'_arr[$i]->getVar("topic_id"); $topic_img = $'.$tables_name.'_arr[$i]->getVar("topic_img"); $topic_title = $'.$tables_name.'_arr[$i]->getVar("topic_title"); $topic_weight = $'.$tables_name.'_arr[$i]->getVar("topic_weight"); - echo "<tr class=\'".$class."\'>"; + echo "<tr class=\'".$class."\'>"; '; $champs_data = const_show_champs_parametres($modules_name, $tables_name, $champs_id, $nb_champs, $champs, $champs_param_display_admin, $champs_param_type, $language, 1, 1); $text .= ''.$champs_data.' echo "<td class=\'center width5\'> - <a href=\"'.$tables_name.'.php?op=edit_'.$tables_name.'&'.$champs_id.'=".$'.$tables_name.'_arr[$i]->getVar("'.$champs_id.'")."\"><img src=".$pathImageIcon."/edit.png alt=\""._EDIT."\" title=\""._EDIT."\"></a> - <a href=\"'.$tables_name.'.php?op=delete_'.$tables_name.'&'.$champs_id.'=".$'.$tables_name.'_arr[$i]->getVar("'.$champs_id.'")."\"><img src=".$pathImageIcon."/delete.png alt=\""._DELETE."\" title=\""._DELETE."\"></a> + <a href=\''.$tables_name.'.php?op=edit_'.$tables_name.'&'.$champs_id.'=".$i."\'><img src=".$pathImageIcon."/edit.png alt=\'"._EDIT."\' title=\'"._EDIT."\'></a> + <a href=\''.$tables_name.'.php?op=delete_'.$tables_name.'&'.$champs_id.'=".$i."\'><img src=".$pathImageIcon."/delete.png alt=\'"._DELETE."\' title=\'"._DELETE."\'></a> </td> </tr>"; $class = ($class == "even") ? "odd" : "even"; @@ -216,19 +235,36 @@ { '.$modules_name.'_display_children($topic_id, $topic_pid, $prefix, "topic_title", $class); } - } + }'; + } else { + $text .= ' + echo "<tr class=\'".$class."\'>"; + $class = ($class == "even") ? "odd" : "even"; + echo "<td class=\'center\'>".$i."</td>"; + '; + $champs_data = const_show_champs_parametres($modules_name, $tables_name, $champs_id, $nb_champs, $champs, $champs_param_display_admin, $champs_param_type, $language, '', 1); + + $text .= $champs_data.' + echo "<td class=\'center width5\'> + <a href=\''.$tables_name.'.php?op=edit_'.$tables_name.'&'.$champs_id.'=".$i."\'><img src=".$pathImageIcon."/edit.png alt=\'"._EDIT."\' title=\'"._EDIT."\'></a> + <a href=\''.$tables_name.'.php?op=delete_'.$tables_name.'&'.$champs_id.'=".$i."\'><img src=".$pathImageIcon."/delete.png alt=\'"._DELETE."\' title=\'"._DELETE."\'></a> + </td>"; + echo "</tr>";'; + } + $text .= ' } - echo "</table><br><br>"; + echo "</table><br /><br />"; echo "<br /><div class=\'center\'>" . $pagenav . "</div><br />"; } else { echo "<table class=\'outer width100\' cellspacing=\'1\'> <tr> - '; + <th class=\'center width2\'>".'.$language.'_'.strtoupper($tables_name).'_ID."</th> + '; $champs_colonne_name = const_show_champs_parametres($modules_name, $tables_name, $champs_id, $nb_champs, $champs, $champs_param_display_admin, $champs_param_type, $language, '', 0); $text .= ''.$champs_colonne_name.' <th class=\'center width5\'>".'.$language.'_FORMACTION."</th> </tr>"; - echo "</table><br><br>"; + echo "</table><br /><br />"; } '; } Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_class.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_class.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_class.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -23,9 +23,7 @@ function const_class($modules, $modules_name, $tables_module_table, $tables_name, $tables_champs, $tables_parametres) { $language = '_AM_'.strtoupper($modules_name).'_'; - $modules_name_minuscule = strtolower($modules_name); - $class_name = $tables_name; - $file = $modules_name.'_'.$class_name. ".php"; + $file = $modules_name.'_'.$tables_name. ".php"; $path_file = TDM_CREATE_MURL."/".$modules_name."/class/".$file; $constructor = const_champs($modules_name, $tables_module_table, $tables_name, $tables_champs, $language, 0, 0, 0, 0); $en_tete = const_entete($modules, 0); @@ -57,7 +55,7 @@ } } - $form = const_champs($modules_name, $tables_module_table, $tables_name, $tables_champs, $language, $champs_param_display_form, $champs_param_elements,$champs_param_required_field, 1); + $form = const_champs($modules_name, $tables_module_table, $tables_name, $tables_champs, $language, $champs_param_display_form, $champs_param_elements, $champs_param_required_field, 1); $text = '<?php'.$en_tete.' if (!defined("XOOPS_ROOT_PATH")) { Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_header.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_header.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_header.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -34,21 +34,12 @@ $text .= ' /** * **************************************************************************** - * - Original Copyright (TDM) - * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS - * - Licence GPL Copyright (c) (http://www.tdmxoops.net) - * - Developers TEAM TDMCreate Xoops - (http://www.xoops.org) - * - Revision By TXMod Xoops (http://www.txmodxoops.org) + * - A Project by Developers TEAM For Xoops - ( http://www.xoops.org ) * **************************************************************************** * '.strtoupper($modules_name).' - MODULE FOR XOOPS * Copyright (c) 2007 - '.date("Y").' - * '.$modules_author.' ('.$modules_author_website_url.') + * '.$modules_author.' ( '.$modules_author_website_url.' ) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * * You may not change or alter any portion of this comment or credits * of supporting developers from this source code or any supporting * source code which is considered copyrighted (c) material of the @@ -59,10 +50,10 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * --------------------------------------------------------------------------- - * @copyright '.$modules_author.' ('.$modules_author_website_url.') - * @license '.$modules_license.' - * @package '.$modules_name.' - * @author '.$modules_author.' ('.$modules_author_mail.') + * @copyright '.$modules_author.' ( '.$modules_author_website_url.' ) + * @license '.$modules_license.' + * @package '.$modules_name.' + * @author '.$modules_author.' ( '.$modules_author_mail.' ) * * Version : '.$modules_version.' '.date("D Y/m/d G:i:s").' : '.$modules_credits.' Exp $ * **************************************************************************** Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_include_configs.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_include_configs.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_include_configs.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -19,7 +19,6 @@ */ include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/const/const_entete.php'; include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php'; -include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/class/tdmcreate_modules.php'; function const_include_configs($modules, $modules_name, $modules_a_w_name, $modules_a_w_url) { $language = '_MA_'.strtoupper($modules_name).''; @@ -30,12 +29,9 @@ if( ! defined( \'XOOPS_ROOT_PATH\' ) ) exit ; define("'.strtoupper($modules_name).'_PATH", XOOPS_ROOT_PATH."/modules/'.$modules_name.'"); define("'.strtoupper($modules_name).'_URL", XOOPS_URL."/modules/'.$modules_name.'"); -define("'.strtolower($modules_name).'_url", "'.strtoupper($modules_name).'_URL"); // module information $mod_img = '.strtoupper($modules_name).'_URL."/images/'.str_replace(" ", "", strtolower($modules_a_w_name)).'_logo.png"; -// Attention: if don't have declared ( _ADMIN ) variable, you can do in languages/yourlanguage/global.php -$mod_admin = "<a href=\'".'.strtoupper($modules_name).'_URL."/admin/index.php\'><strong>".'.$language.'_ADMIN."</strong></a>"; $mod_copyright = "<a href=\''.$modules_a_w_url.'\' title=\''.$modules_a_w_name.'\' target=\'_blank\'> <img src=\'".$mod_img."\' alt=\''.$modules_a_w_name.'\' /></a>"; ?>'; Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_include_functions.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_include_functions.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_include_functions.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -92,6 +92,21 @@ $xoopsTpl->assign(\'xoops_meta_description\', strip_tags($content)); } } + +/** + * Convert StringToTime Date + * + * @param mixed $date + * @return + */ +function '.$modules_name.'_convertDate($date) +{ + if (strpos(_SHORTDATESTRING, "/")) + { + $date=str_replace("/", "-", $date); + } + return strtotime($date); +} ?>'; createFile($path_file, $text, Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_templates_header.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_templates_header.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_templates_header.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -28,8 +28,8 @@ $en_tete = const_entete($modules, 0); $text = '<div class="box-header"> - <span class="left"><b><{$smarty.const.'.$language.'TITLE}></b>: '.$modules_name.'</span><br /> - <span class="left"><{$smarty.const.'.$language.'DESC}>: '.$modules_desc.'</span> + <span class="left"><b>Title</b>: <{$smarty.const.'.$language.'TITLE}></span><br /> + <span class="left">Description: <{$smarty.const.'.$language.'DESC}></span> </div> <br /> <{if $adv != \'\'}> Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_templates_pages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_templates_pages.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_templates_pages.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -27,7 +27,7 @@ $path_file = TDM_CREATE_MURL."/".$modules_name."/templates/".$file; $en_tete = const_entete($modules, 0); - $text = '<{include file="db:'.$modules_name.'_header.html"}>'; + $text = '<{include file="db:'.strtolower($modules_name).'_header.html"}>'; if($tables_module_table != null){ $text .= ' <div class="outer"> @@ -77,7 +77,7 @@ </div>'; } $text .= ' -<{include file="db:'.$modules_name.'_footer.html"}> +<{include file="db:'.strtolower($modules_name).'_footer.html"}> '; createFile($path_file, $text, _AM_TDMCREATE_CONST_OK_TEMPLATES, Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_user_pages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_user_pages.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_user_pages.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -20,7 +20,7 @@ include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/const/const_entete.php'; include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php'; -function const_user_pages($modules, $modules_name, $tables_name, $tables_champs, $tables_parametres) +function const_user_pages($modules, $modules_name, $tables_name, $tables_champs, $tables_parametres, $topic) { $language = '_MA_'.strtoupper($modules_name).''; $file = $tables_name.".php"; @@ -97,23 +97,23 @@ $numrows = $'.$tables_name.'Handler->getCount(); $'.$tables_name.'_arr = $'.$tables_name.'Handler->getall($criteria); '; - if ( $tables_name != 'topic' ) + if ( $topic != 1 ) { $text .=' - // Table View - if ($numrows>0) - { - echo "<table width=\"100%\" cellspacing=\"1\" class=\"outer\"> - <tr> - '; - $champs_colonne_name = const_show_champs_parametres($modules_name, $tables_name, $champs_id, $nb_champs, $champs, $champs_param_display_admin, $champs_param_type, $language, '', 0); - $text .= ''.$champs_colonne_name.' - </tr>"; - - $class = "odd"; - echo "</table><br /><br />"; - } - '; + // Table View + if ($numrows>0) + { + echo "<table width=\"100%\" cellspacing=\"1\" class=\"outer\"> + <tr> + '; + $champs_colonne_name = const_show_champs_parametres($modules_name, $tables_name, $champs_id, $nb_champs, $champs, $champs_param_display_admin, $champs_param_type, $language, '', 0); + $text .= ''.$champs_colonne_name.' + </tr>"; + + $class = "odd"; + echo "</table><br /><br />"; + } + break; '; } $text .= ' } Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_xoopsversion.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_xoopsversion.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/const/const_xoopsversion.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -151,7 +151,7 @@ $language1 = $language.'_'.strtoupper($tables_name).''; $modvb = ''.$modv.'[\'blocks\'][$i]'; $text .= ' -'.$modvb.'[$i][\'file\'] = "blocks_'.$tables_name.'.php"; +'.$modvb.'[\'file\'] = "blocks_'.$tables_name.'.php"; '.$modvb.'[\'name\'] = '.$language1.'_BLOCK_RECENT; '.$modvb.'[\'description\'] = ""; '.$modvb.'[\'show_func\'] = "b_'.strtolower($tm_table).'"; @@ -198,8 +198,7 @@ '.$modvc.'[\'formtype\'] = "textbox"; '.$modvc.'[\'valuetype\'] = "text"; '.$modvc.'[\'default\'] = ""; -$i++; -'; +$i++;'; foreach (array_keys($tables_arr) as $i) { $tables_name = $tables_arr[$i]->getVar("tables_name"); @@ -232,7 +231,6 @@ '.$modvc.'[\'valuetype\'] = "int"; '.$modvc.'[\'default\'] = "10485760"; $i++; - //Uploads : mimetypes '.$structure_champs[0].' '.$modvc.'[\'name\'] = "mimetypes"; '.$modvc.'[\'title\'] = "'.$language.'_MIMETYPES"; @@ -242,8 +240,7 @@ '.$modvc.'[\'default\'] = array("image/gif", "image/jpeg", "image/png"); '.$modvc.'[\'options\'] = array("bmp" => "image/bmp","gif" => "image/gif","jpeg" => "image/pjpeg", "jpeg" => "image/jpeg","jpg" => "image/jpeg","jpe" => "image/jpeg","png" => "image/png"); -$i++; -'; +$i++;'; } else if ( $structure_parametres[0] == 'XoopsFormUploadFile' ) { $text .= ' //Uploads : size '.$structure_champs[0].' @@ -254,7 +251,6 @@ '.$modvc.'[\'valuetype\'] = "int"; '.$modvc.'[\'default\'] = "10485760"; $i++; - //Uploads : mimetypes '.$structure_champs[0].' '.$modvc.'[\'name\'] = "mimetypes"; '.$modvc.'[\'title\'] = "'.$language.'_MIMETYPES"; @@ -263,8 +259,7 @@ '.$modvc.'[\'valuetype\'] = "array"; '.$modvc.'[\'default\'] = array("image/gif", "image/jpeg", "image/png"); '.$modvc.'[\'options\'] = XoopsLists::getMimetypesList(); -$i++; -'; +$i++;'; } } } Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/include/functions_const.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/include/functions_const.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/include/functions_const.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -198,26 +198,25 @@ if ( $i == $nb_champs - 1 ) { $text .= ' - $online = $'.$tables_name.'_arr[$i]->getVar("'.$champs[$i].'"); - + $online = $'.$tables_name.'_arr[$i]->getVar("'.$champs[$i].'"); if( $online == 1 ) {'; $text .= ' - echo "<td class=\'center\'><a href=\"./'.$tables_name.'.php?op=update_online_'.$tables_name.'&'.$champs_id.'=".$'.$tables_name.'_arr[$i]->getVar("'.$champs_id.'")."&'.$tables_name.'_online=0\"><img src=".$pathImageIcon."/on.png border=\"0\" alt=\"".'.$language.'_ON."\" title=\"".'.$language.'_ON."\"></a></td>"; + echo "<td class=\'center\'><a href=\''.$tables_name.'.php?op=update_online_'.$tables_name.'&'.$champs_id.'=".$i."&'.$tables_name.'_online=0\'><img src=".$pathImageIcon."/on.png border=\'0\' alt=\'".'.$language.'_ON."\' title=\'".'.$language.'_ON."\'></a></td>"; } else {'; $text .= ' - echo "<td class=\'center\'><a href=\"./'.$tables_name.'.php?op=update_online_'.$tables_name.'&'.$champs_id.'=".$'.$tables_name.'_arr[$i]->getVar("'.$champs_id.'")."&'.$tables_name.'_online=1\"><img src=".$pathImageIcon."/off.png border=\"0\" alt=\"".'.$language.'_OFF."\" title=\"".'.$language.'_OFF."\"></a></td>"; + echo "<td class=\'center\'><a href=\''.$tables_name.'.php?op=update_online_'.$tables_name.'&'.$champs_id.'=".$i."&'.$tables_name.'_online=1\'><img src=".$pathImageIcon."/off.png border=\'0\' alt=\'".'.$language.'_OFF."\' title=\'".'.$language.'_OFF."\'></a></td>"; }'; } else if ( $champs[$i] == 'topic_title' ) { if ( $prefix == 1 ) { $text .= 'echo "<td class=\'left\'>".$prefix." ".$topic_arr[$i]->getVar("'.$champs[$i].'")."</td>"; '; } else { - $text .= 'echo "<td class=\'left\'><img src=\"".XOOPS_URL."/modules/'.$modules_name.'/images/deco/arrow.gif\"> ".$topic_arr[$i]->getVar("'.$champs[$i].'")."</td>"; + $text .= 'echo "<td class=\'left\'><img src=\'".'.strtoupper($modules_name).'_URL."/images/deco/arrow.gif\'> ".$topic_arr[$i]->getVar("'.$champs[$i].'")."</td>"; '; } } else if ( $champs_param_type[$i] == 'XoopsFormUploadImage' ) { - $text .= 'echo "<td class=\'center\'><img src=\"".XOOPS_URL."/uploads/'.$modules_name.'/'.$tables_name.'/'.$champs[$i].'/".$'.$tables_name.'_arr[$i]->getVar("'.$champs[$i].'")."\" height=\"30px\" title=\"'.$champs[$i].'\" alt=\"'.$champs[$i].'\"></td>"; + $text .= 'echo "<td class=\'center\'><img src=\'".XOOPS_UPLOAD_URL."/'.$modules_name.'/images/".$'.$tables_name.'_arr[$i]->getVar("'.$champs[$i].'")."\' height=\'30px\' title=\''.$champs[$i].'\' alt=\''.$champs[$i].'\'></td>"; '; } else if ( $champs_param_type[$i] == 'XoopsFormUploadFile' ) { @@ -225,7 +224,7 @@ '; } else if ( $champs_param_type[$i] == 'XoopsFormColorPicker' ) { - $text .= 'echo "<td class=\'center\'><span style=\"background-color:".$'.$tables_name.'_arr[$i]->getVar("'.$champs[$i].'")."\"> </span> -> ".$'.$tables_name.'_arr[$i]->getVar("'.$champs[$i].'")."</td>"; + $text .= 'echo "<td class=\'center\'><span style=\'background-color:".$'.$tables_name.'_arr[$i]->getVar("'.$champs[$i].'")."\'> </span> -> ".$'.$tables_name.'_arr[$i]->getVar("'.$champs[$i].'")."</td>"; '; } else if ( $champs_param_type[$i] == 'XoopsFormTextDateSelect' ) { @@ -284,7 +283,6 @@ } } } - $text .= ' $'.$data[1].' =& $'.$data[1].'Handler->get($'.$tables_name.'_arr[$i]->getVar("'.$champs[$i].'")); $title_'.$data[1].' = $'.$data[1].'->getVar("'.$champs_param_main_field.'"); @@ -303,7 +301,7 @@ if ( $champs_param_type[$i] == 'XoopsFormTextDateSelect' ) { $text .= '//Form '.$champs[$i].' - $obj->setVar("'.$champs[$i].'", strtotime($_REQUEST["'.$champs[$i].'"])); + $obj->setVar("'.$champs[$i].'", '.$modules_name.'_convertDate($_REQUEST["'.$champs[$i].'"])); '; } else if ( $champs_param_type[$i] == 'XoopsFormCheckBox' || $champs_param_type[$i] == 'XoopsFormRadioYN' ) { $text .= '//Form '.$champs[$i].' @@ -438,10 +436,22 @@ '; break; + case "XoopsFormSelect": + $data = explode("-", $champs_param_elements[$i]); + $text .= ' + $'.$data[1].'Handler =& xoops_getModuleHandler("'.$modules_name.'_'.$data[1].'", "'.$modules_name.'"); + $'.$data[1].'_select = new XoopsFormSelect('.$language_form.', "'.$structure0.'", $this->getVar("'.$structure0.'")); + $'.$data[1].'_select->addOptionArray($'.$data[1].'Handler->getList()); + $form->addElement($'.$data[1].'_select, '.$required_field.'); + '; + unset($data); + break; + case "XoopsFormSelectUser": $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"); @@ -464,24 +474,18 @@ break; default: - $data = explode("-", $champs_param_elements[$i]); - /*$text .= ' - $'.$data[1].'Handler =& xoops_getModuleHandler("'.$modules_name.'_'.$data[1].'", "'.$modules_name.'"); - $'.$data[1].'_select = new XoopsFormSelect('.$language_form.', "'.$structure0.'", $this->getVar("'.$structure0.'")); - $'.$data[1].'_select->addOptionArray($'.$data[1].'Handler->getList()); - $form->addElement($'.$data[1].'_select, '.$required_field.'); - '; - $data = substr($structure0, 0, strpos($structure0, '_'));*/ + $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\'); + $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; } return $text; Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/language/english/admin.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/language/english/admin.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/language/english/admin.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -48,7 +48,7 @@ define("_AM_TDMCREATE_FORMDEL", "Clear"); define("_AM_TDMCREATE_FORMCHAMPS", "Edit fields"); define("_AM_TDMCREATE_FORM_INFO_TABLE", "Information on the table"); -define("_AM_TDMCREATE_FORM_INFO_TABLE_FIELD", "You can add your choice 3 fields in this table: table_submitter, table_date_created, table_online"); +define("_AM_TDMCREATE_FORM_INFO_TABLE_FIELD", "You can add your choice 3 fields in this table: '<b>table</b>'_submitter, '<b>table</b>'_created, '<b>table</b>'_online"); define("_AM_TDMCREATE_NAME", "Name"); define("_AM_TDMCREATE_BLOCS", "Blocks"); @@ -104,9 +104,9 @@ define("_AM_TDMCREATE_TABLES_BLOCS", "Create a new block for this table (blocks: random, latest, today)"); define("_AM_TDMCREATE_TABLES_DISPLAY_ADMIN", "Use the side view of TAB Admin"); define("_AM_TDMCREATE_TABLES_DISPLAY_USER", "Use the side view of TAB Member"); -define("_AM_TDMCREATE_TABLES_SUBMITTER", "Add submitter"); -define("_AM_TDMCREATE_TABLES_DATE_CREATED", "Add date created"); -define("_AM_TDMCREATE_TABLES_ONLINE", "Add online"); +define("_AM_TDMCREATE_TABLES_SUBMITTER", "Add champ submitter?"); +define("_AM_TDMCREATE_TABLES_CREATED", "Add champ date created?"); +define("_AM_TDMCREATE_TABLES_ONLINE", "Add champ online?"); define("_AM_TDMCREATE_TABLES_SEARCH", "Active research for this table <br> <i>the form for the moment, is able to handle the search on the table <br> If you confirm the search option will be disabled</i>"); define("_AM_TDMCREATE_TABLES_EXIST", "The name specified for this table is already in use"); define("_AM_TDMCREATE_TABLES_COMS", "Enable the search in this table <br> <i>the module can manage for the moment, the coms on a table <br> Coms option will be disabled if you Confirmed</i>"); Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/language/italian/admin.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/language/italian/admin.php 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/language/italian/admin.php 2012-04-15 15:27:10 UTC (rev 9333) @@ -48,7 +48,7 @@ define("_AM_TDMCREATE_FORMDEL","Cancella"); define("_AM_TDMCREATE_FORMCHAMPS","Modifica campi"); define("_AM_TDMCREATE_FORM_INFO_TABLE","Informazione sulla tabella"); -define("_AM_TDMCREATE_FORM_INFO_TABLE_FIELD","Si possono aggiungere a scelta 3 campi in questa tabella : table_submitter, table_date_created, table_online"); +define("_AM_TDMCREATE_FORM_INFO_TABLE_FIELD","Si possono aggiungere a scelta 3 campi in questa tabella : '<b>table</b>'_submitter, '<b>table</b>'_created, '<b>table</b>'_online"); define("_AM_TDMCREATE_NAME", "Nome"); define("_AM_TDMCREATE_BLOCS", "Blocchi"); @@ -102,9 +102,9 @@ define("_AM_TDMCREATE_TABLES_BLOCS", "Crea un nuovo blocco per questa tabella (blocchi: casuali, recenti, oggi)"); define("_AM_TDMCREATE_TABLES_DISPLAY_ADMIN", "Usa vista TAB lato Admin"); define("_AM_TDMCREATE_TABLES_DISPLAY_USER", "Usa vista TAB lato Utente"); -define("_AM_TDMCREATE_TABLES_SUBMITTER", "Aggiungere utente che invia"); -define("_AM_TDMCREATE_TABLES_DATE_CREATED", "Aggiungere data creazione"); -define("_AM_TDMCREATE_TABLES_ONLINE", "Aggiungere online"); +define("_AM_TDMCREATE_TABLES_SUBMITTER", "Aggiungere campo utente che invia?"); +define("_AM_TDMCREATE_TABLES_CREATED", "Aggiungere campo data creazione?"); +define("_AM_TDMCREATE_TABLES_ONLINE", "Aggiungere campo online?"); define("_AM_TDMCREATE_TABLES_SEARCH", "Attiva la ricerca per questa tabella <br> <i>il modulo per il momento, è in grado di gestire la ricerca sulla tabella <br>Se confermi l'opzione di ricerca verrà disabilitata</i>"); define("_AM_TDMCREATE_TABLES_EXIST", "Il nome specificato per questa tabella è già in uso"); define("_AM_TDMCREATE_TABLES_COMS","Enable the search in this table <br><i>the module can manage for the moment, the coms on a table<br>Coms option will be disabled if you confirmed</i>"); Modified: XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/sql/mysql.sql =================================================================== --- XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/sql/mysql.sql 2012-04-15 15:26:28 UTC (rev 9332) +++ XoopsModules/TDMCreate/branches/timgno/modules/TDMCreate/sql/mysql.sql 2012-04-15 15:27:10 UTC (rev 9333) @@ -43,7 +43,7 @@ `tables_display_admin` tinyint(1) NOT NULL default '1', `tables_display_user` tinyint(1) NOT NULL default '0', `tables_submitter` tinyint(1) NOT NULL default '0', - `tables_date_created` tinyint(1) NOT NULL default '0', + `tables_created` tinyint(1) NOT NULL default '0', `tables_online` tinyint(1) NOT NULL default '0', `tables_search` tinyint(1) NOT NULL default '0', `tables_coms` tinyint(1) NOT NULL default '0', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |