|
From: <txm...@us...> - 2013-05-05 21:58:49
|
Revision: 11504
http://sourceforge.net/p/xoops/svn/11504
Author: txmodxoops
Date: 2013-05-05 21:58:45 +0000 (Sun, 05 May 2013)
Log Message:
-----------
Updated
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_architecture.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_common.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_search.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_sql.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/docs/changelog.txt
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/functions_const.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/update language 1.38 to 1.39.txt
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-05-05 21:17:01 UTC (rev 11503)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-05-05 21:58:45 UTC (rev 11504)
@@ -129,7 +129,7 @@
}
// Creation of notifications
if ( isset($table_notifications) ) {
- const_include_notifications($modules, $modules_name, $table_name, $table_fieldname);
+ const_include_notifications($modules, $mod_name, $table_name, $table_fieldname);
}
// Creation of the file mysql.sql
const_sql($mod_name, $table_name, $table_fieldname, $category, $table_fields);
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php 2013-05-05 21:17:01 UTC (rev 11503)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php 2013-05-05 21:58:45 UTC (rev 11504)
@@ -23,7 +23,7 @@
echo $adminMenu->addNavigation('modules.php');
switch ($op)
{
- case "save":
+ case 'save':
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
@@ -87,26 +87,25 @@
}
break;
- case "new":
+ case 'new':
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php?op=list', 'list');
echo $adminMenu->renderButton();
$obj =& $modulesHandler->create();
$form = $obj->getForm();
break;
- case "edit":
+ case 'edit':
$obj =& $modulesHandler->get($_REQUEST['mod_id']);
$form = $obj->getForm();
break;
- case "delete":
+ case 'delete':
$obj =& $modulesHandler->get($_REQUEST['mod_id']);
if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1)
{
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- if ($modulesHandler->delete($obj)) {
- $xoopsDB->queryF("DELETE FROM ".$xoopsDB->prefix("tdmcreate_modules")." WHERE mod_id = ".$_REQUEST['mod_id']);
+ if ($modulesHandler->delete($obj)) {
redirect_header('modules.php', 3, _AM_TDMCREATE_FORMDELOK);
} else {
echo $obj->getHtmlErrors();
@@ -115,18 +114,29 @@
xoops_confirm(array('ok' => 1, 'mod_id' => $_REQUEST['mod_id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('mod_name')));
}
break;
- case "list":
+ case 'list':
default:
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_NEW, 'modules.php?op=new', 'add');
echo $adminMenu->renderButton();
+
+ $limit = $GLOBALS['xoopsModuleConfig']['adminpager'];
+ $start = TDMCreate_CleanVars( $_REQUEST, 'start', 0 );
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id');
$criteria->setOrder('ASC');
- $mod_arr = $modulesHandler->getall($criteria);
- $numrows_modules = $modulesHandler->getCount();
-
- if ( $numrows_modules > 0 )
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ $mod_arr = $modulesHandler->getall($criteria);
+ $numrows = $modulesHandler->getCount();
+ if ( $numrows > $limit ) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $pagenav = $pagenav->renderNav(4);
+ } else {
+ $pagenav = '';
+ }
+ if ( $numrows > 0 )
{
echo '<table width="100%" cellspacing="1" class="outer">';
echo '<tr class="center">';
@@ -160,7 +170,8 @@
echo '</td>';
echo '</tr>';
}
- echo '</table><br><br>';
+ echo '</table><br /><br />';
+ echo '<div class="right">'.$pagenav.'</div><br />';
} else {
echo '<table width="100%" cellspacing="1" class="outer">';
echo '<tr class="center">';
@@ -175,4 +186,4 @@
}
break;
}
-include_once "admin_footer.php";
\ No newline at end of file
+include_once 'admin_footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-05-05 21:17:01 UTC (rev 11503)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-05-05 21:58:45 UTC (rev 11504)
@@ -21,7 +21,6 @@
include_once 'admin_header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
echo $adminMenu->addNavigation('tables.php');
-$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
switch ($op) {
case 'save_table':
if (isset($_REQUEST['table_id'])) {
@@ -52,9 +51,9 @@
$obj->setVar('table_notifications', 0);
$obj->setVar('table_nbfields', 7);
- $table_fields = 'cat_id:int:8:unsigned:NOT NULL: :primary|cat_pid:int:5:unsigned:NOT NULL:0:unique|cat_title:varchar:255: :NOT NULL: :unique|cat_desc:text: : :NOT NULL: :|cat_image:varchar:255: :NOT NULL: :|cat_weight:int:5:unsigned:NOT NULL:0:|cat_color:varchar:10: :NULL: :';
+ $table_fields = 'cat_id:int:8: : :unsigned:NOT NULL: :primary|cat_pid:int:5: : :unsigned:NOT NULL:0:unique|cat_title:varchar:255: : : :NOT NULL: :unique|cat_desc:text: : : : :NOT NULL: :|cat_image:varchar:255: : : :NOT NULL: :|cat_weight:int:5: : :unsigned:NOT NULL:0:|cat_color:varchar:10: : : :NULL: :';
- $table_parameters = 'XoopsFormCategory:0:0:0:0:0:1|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:0|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';
+ $table_parameters = 'XoopsFormCategory:0:0:0:0:0:0:0:1|XoopsFormText:1:1:0:0:0:1:0:1|XoopsFormTextArea:0:1:0:0:0:0:0:1|XoopsFormUploadImage:1:1:0:0:0:0:0:0|XoopsFormText:1:1:0:0:0:0:0:0|XoopsFormColorPicker:1:1:0:0:0:0:0:0|XoopsFormSelectUser:0:0:0:0:0:0:0:1|XoopsFormTextDateSelect:0:0:0:0:0:0:0:1|XoopsFormCheckBox:1:1:0:0:0:0:0:1';
//Image
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
@@ -63,18 +62,15 @@
$uploaddir = $pathIcon32;
}else{
$uploaddir = XOOPS_ROOT_PATH . "/modules/".$xoopsModule->dirname()."/images/uploads/tables/";
- }
-
- $uploader = new XoopsMediaUploader($uploaddir, "gif|jpeg|pjpeg|png", 104857600, null, null);
-
+ }
+ $uploader = new XoopsMediaUploader($uploaddir, 'gif|jpeg|pjpeg|png', 500000, null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["attachedfile1"]['name']) ;
+ $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile1']['name']) ;
$name_img = 'category.'.$extension;
$uploader->setTargetFileName($name_img);
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
- $errors = $uploader->getErrors();
- redirect_header("javascript:history.go(-1)",3, $errors);
+ redirect_header('javascript:history.go(-1)', 3, $uploader->getErrors());
} else {
$obj->setVar('table_image', $uploader->getSavedFileName());
}
@@ -105,6 +101,8 @@
$table_parameters .= ( !empty($_REQUEST['fields_param_elements'][$i]) ) ? "".$_REQUEST['fields_param_elements'][$i].":" : " :";
$table_parameters .= ( !empty($_REQUEST['fields_param_admin'][$i]) ) ? "1:" : "0:";
$table_parameters .= ( !empty($_REQUEST['fields_param_user'][$i]) ) ? "1:" : "0:";
+ $table_parameters .= ( !empty($_REQUEST['fields_param_form'][$i]) ) ? "1:" : "0:";
+ $table_parameters .= ( !empty($_REQUEST['fields_param_list'][$i]) ) ? "1:" : "0:";
$table_parameters .= ( !empty($_REQUEST['fields_param_blocks'][$i]) ) ? "1:" : "0:";
$table_parameters .= ( $i == $_REQUEST['fields_param_main_field']) ? "1:" : "0:";
$table_parameters .= ( !empty($_REQUEST['fields_param_search_field'][$i]) ) ? "1:" : "0:";
@@ -115,6 +113,8 @@
$table_fields .= (!empty($_REQUEST['fields_name'][$i])) ? $_REQUEST['fields_name'][$i].":" : " :";
$table_fields .= (!empty($_REQUEST['fields_type'][$i])) ? $_REQUEST['fields_type'][$i].":" : " :";
$table_fields .= (!empty($_REQUEST['fields_value'][$i])) ? $_REQUEST['fields_value'][$i].":" : " :";
+ $table_fields .= (!empty($_REQUEST['fields_value_size'][$i])) ? $_REQUEST['fields_value_size'][$i].":" : " :";
+ $table_fields .= (!empty($_REQUEST['fields_value_maxlength'][$i])) ? $_REQUEST['fields_value_maxlength'][$i].":" : " :";
$table_fields .= (!empty($_REQUEST['fields_attributes'][$i])) ? $_REQUEST['fields_attributes'][$i].":" : " :";
$table_fields .= (!empty($_REQUEST['fields_null'][$i])) ? strtoupper($_REQUEST['fields_null'][$i]).":" : " :";
$table_fields .= (!empty($_REQUEST['fields_default'][$i])) ? $_REQUEST['fields_default'][$i].":" : " :";
@@ -229,14 +229,14 @@
$newname = strtolower($_REQUEST['table_fieldname']);
//echo $count_parameters;
//fields
- for($i=0; $i<$count_fields; $i++)
+ for($i = 0; $i < $count_fields; $i++)
{
- $fields = explode(":", $fields_total[$i]);
+ $fields = explode(':', $fields_total[$i]);
$fields[0] = $newname . substr($fields[0], stripos($fields[0], '_'));
$newfields[$i] = implode(":", $fields);
}
- $newTableFields=implode("|",$newfields);
+ $newTableFields=implode('|',$newfields);
$obj->setVar('table_fields', $newTableFields);
if ($tablesHandler->insert($obj)) {
@@ -273,7 +273,7 @@
case "table_fields":
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=table_list', 'list');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW, 'tables.php?op=table_fields', 'add');
- echo $adminMenu->renderButton();
+ echo $adminMenu->renderButton();
//fields existe deja ?
$criteria = new CriteriaCompo();
@@ -373,12 +373,25 @@
$xoopsDB->queryF($sql_del);
}
+ $limit = $GLOBALS['xoopsModuleConfig']['adminpager'];
+ $start = TDMCreate_CleanVars( $_REQUEST, 'start', 0 );
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/style.css' );
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
+
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id');
$criteria->setOrder('ASC');
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
$mod_arr = $modulesHandler->getall($criteria);
$numrows_modules = $modulesHandler->getCount();
-
+ if ( $numrows_modules > $limit ) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav = new XoopsPageNav($numrows_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $pagenav = $pagenav->renderNav(4);
+ } else {
+ $pagenav = '';
+ }
if ( $numrows_modules > 0 )
{
echo '<table width="100%" cellspacing="1" class="outer">';
@@ -397,16 +410,13 @@
{
$mod_id = $mod_arr[$i]->getVar('mod_id');
$mod_name = $mod_arr[$i]->getVar('mod_name');
- $mod_image = $mod_arr[$i]->getVar('mod_image');
- $mod_display_admin = ($mod_arr[$i]->getVar('mod_display_admin') == 1) ? _YES : _NO;
- $mod_display_user = ($mod_arr[$i]->getVar('mod_display_user') == 1) ? _YES : _NO;
echo '<tr class="odd center toggleTables">';
echo '<td class="width5"><b>'.$i.'</b><br /><img src="../images/icons/16/toggle.png" alt="Toggle" title="Toggle" /></td>';
$nbsps = ' ';
echo '<td class="left">'.$nbsps.'<img src="../images/icons/16/arrow.gif" alt="Arrow" />'.$nbsps.'<b>'.$mod_name.'</b></td>';
- echo '<td><img src="../images/uploads/modules/'.$mod_image.'" height="30px"></td>';
- echo '<td>'.$mod_display_admin.'</td>';
- echo '<td>'.$mod_display_user.'</td>';
+ echo '<td><img src="../images/uploads/modules/'.$mod_arr[$i]->getVar('mod_image').'" height="30px"></td>';
+ echo '<td>'.(($mod_arr[$i]->getVar('mod_display_admin') == 1) ? _YES : _NO).'</td>';
+ echo '<td>'.(($mod_arr[$i]->getVar('mod_display_user') == 1) ? _YES : _NO).'</td>';
echo '<td>~</td>';
echo '<td>~</td>';
echo '<td>';
@@ -416,7 +426,7 @@
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $mod_id));
- $criteria->setSort('table_name');
+ $criteria->setSort('table_id');
$criteria->setOrder('ASC');
$table_arr = $tablesHandler->getall($criteria);
$numrows_tables = $tablesHandler->getCount();
@@ -426,23 +436,18 @@
{
$table_name = $table_arr[$i]->getVar('table_name');
$table_image = $table_arr[$i]->getVar('table_image');
- $table_blocks = $table_arr[$i]->getVar('table_blocks');
- $table_admin = (($table_arr[$i]->getVar('table_admin') == 1) ? _YES : _NO);
- $table_user = (($table_arr[$i]->getVar('table_user') == 1) ? _YES : _NO);
- $nb_fields = $table_arr[$i]->getVar('table_nbfields');
- $blocks = ($table_blocks == 1) ? _YES : _NO;
- echo '<tr class="even center">';
+ echo '<tr class="even center toggleHidden">';
echo '<td class="center">'.$i.'</b></a></td>';
- echo '<td class="left"> <b>- '.$table_name.'</b></a></td>';
+ echo '<td class="left"> <b>» '.$table_name.'</b></a></td>';
if(file_exists($image = $pathIcon32.'/'.$table_image)) {
echo '<td><img src="'.$image.'" height="25px"></td>';
} else {
echo '<td><img src="../images/uploads/tables/'.$table_image.'" height="25px"></td>';
}
- echo '<td>'.$table_admin.'</td>';
- echo '<td>'.$table_user.'</td>';
- echo '<td>'.$blocks.'</td>';
- echo '<td>'.$nb_fields.'</td>';
+ echo '<td>'.(($table_arr[$i]->getVar('table_admin') == 1) ? _YES : _NO).'</td>';
+ echo '<td>'.(($table_arr[$i]->getVar('table_user') == 1) ? _YES : _NO).'</td>';
+ echo '<td>'.(($table_arr[$i]->getVar('table_blocks') == 1) ? _YES : _NO).'</td>';
+ echo '<td>'.$table_arr[$i]->getVar('table_nbfields').'</td>';
echo '<td>';
echo '<a href="tables.php?op=edit_table&table_id='.$i.'"><img src="'. $pathIcon16 .'/edit.png" alt="'._AM_TDMCREATE_FORMEDIT.'" title="'._AM_TDMCREATE_FORMEDIT.'"></a> <a href="tables.php?op=edit_fields&table_id='.$i.'"><img src="'. $pathIcon16 .'/inserttable.png" alt="'._AM_TDMCREATE_FORMFIELDS.'" title="'._AM_TDMCREATE_FORMFIELDS.'" /></a> <a href="tables.php?op=delete_table&table_id='.$i.'"><img src="'. $pathIcon16 .'/delete.png" alt="'._AM_TDMCREATE_FORMDEL.'" title="'._AM_TDMCREATE_FORMDEL.'"></a>';
echo '</td>';
@@ -450,7 +455,8 @@
}
}
}
- echo '</table>';
+ echo '</table><br /><br />';
+ echo '<div class="right">'.$pagenav.'</div><br />';
} else {
echo '<table width="100%" cellspacing="1" class="outer">';
echo '<tr class="center">';
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_tables.php 2013-05-05 21:17:01 UTC (rev 11503)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_tables.php 2013-05-05 21:58:45 UTC (rev 11504)
@@ -78,13 +78,15 @@
</tr>";
for($i=0; $i<$table_nbfields ; $i++)
{
- $table_id = ( $i == 0 ) ? strtolower($table_fieldname).'_id' : strtolower($table_fieldname).'_';
- $table_primary = ( $i == 0 ) ? "checked" : "";
- $table_value = ( $i == 0 ) ? "8" : "";
+ $field_id = ( $i == 0 ) ? strtolower($table_fieldname).'_id' : strtolower($table_fieldname).'_';
+ $field_primary = ( $i == 0 ) ? "checked" : "";
+ $field_value = ( $i == 0 ) ? "8" : "";
+ $field_value_size = ( $i != 0 ) ? "40" : "";
+ $field_value_maxlength = ( $i != 0 ) ? "255" : "";
$class = ($class == 'even') ? 'odd' : 'even';
echo "<tr class=".$class.">
- <td align='center'><INPUT type='text' size='10' value='".$table_id."' name='fields_name[".$i."]'></td>
+ <td align='center'><INPUT type='text' size='10' value='".$field_id."' name='fields_name[".$i."]'></td>
<td align='center'><SELECT name='fields_type[".$i."]'>
<OPTION VALUE='int'>INT</OPTION>
<OPTION VALUE='tinyint'>TINYINT</OPTION>
@@ -109,7 +111,13 @@
<OPTION VALUE='time'>TIME</OPTION>
<OPTION VALUE='year'>YEAR</OPTION>
</SELECT></td>
- <td align='center'><INPUT type='text' size='2' name='fields_value[".$i."]' value='".$table_value."'></td>
+ <td align='center'>
+ <INPUT type='text' size='2' name='fields_value[".$i."]' value='".$field_value."'>";
+ if($i != 0) {
+ echo "<br /><INPUT type='text' size='2' name='fields_value_size[".$i."]' value='".$field_value_size."'><br />
+ <INPUT type='text' size='2' name='fields_value_maxlength[".$i."]' value='".$field_value_maxlength."'>";
+ }
+ echo "</td>
<td align='center'><SELECT name='fields_attributes[".$i."]'>
<OPTION VALUE=''></OPTION>
<OPTION VALUE='unsigned'>UNSIGNED</OPTION>
@@ -174,6 +182,14 @@
<td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_DISPLAY_USER."</td>
<td align='right' class='even'><INPUT type='checkbox' size='4' name='fields_param_user[".$i."]' checked></td>
</tr>
+ <tr>
+ <td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_DISPLAY_FORM."</td>
+ <td align='right' class='even'><INPUT type='checkbox' size='4' name='fields_param_form[".$i."]' checked></td>
+ </tr>
+ <tr>
+ <td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_DISPLAY_LIST."</td>
+ <td align='right' class='even'><INPUT type='checkbox' size='4' name='fields_param_list[".$i."]' checked></td>
+ </tr>
";
//Afficher la case blocks
if ( $table_blocks == 1 )
@@ -192,19 +208,19 @@
<td align='right' class='even'><INPUT type='radio' value='".$i."' name='fields_param_main_field' ".$checked_main_field."></td>
</tr>";
- //Afficher la case blocks
- if ( $table_blocks == 1 )
+ //Afficher la case search
+ if ( $table_search == 1 )
{
echo "
<tr>
<td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_SEARCH."</td>
- <td align='right' class='even'><INPUT type='checkbox' size='4' name='fields_param_search_field[".$i."]' checked></td>
+ <td align='right' class='even'><INPUT type='checkbox' size='4' name='param_search_field[".$i."]' checked></td>
</tr>";
}
echo "
<tr>
<td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_REQUIRED."</td>
- <td align='right' class='even'><INPUT type='checkbox' size='4' name='fields_param_required_field[".$i."]' checked></td>
+ <td align='right' class='even'><INPUT type='checkbox' size='4' name='param_required_field[".$i."]' checked></td>
</tr>
</table>";
}
@@ -261,6 +277,8 @@
$fields_name[$i] = '';
$fields_type[$i] = '';
$fields_value[$i] = '';
+ $fields_value_size[$i] = '';
+ $fields_value_maxlength[$i] = '';
$fields_attributes[$i] = '';
$fields_null[$i] = '';
$fields_default[$i] = '';
@@ -271,10 +289,12 @@
$fields_name[$i] = $fields[0];
$fields_type[$i] = $fields[1];
$fields_value[$i] = $fields[2];
- $fields_attributes[$i] = $fields[3];
- $fields_null[$i] = $fields[4];
- $fields_default[$i] = $fields[5];
- $fields_index[$i] = $fields[6];
+ $fields_value_size[$i] = $fields[3];
+ $fields_value_maxlength[$i] = $fields[4];
+ $fields_attributes[$i] = $fields[5];
+ $fields_null[$i] = $fields[6];
+ $fields_default[$i] = $fields[7];
+ $fields_index[$i] = $fields[8];
}
}
//parameters
@@ -284,16 +304,20 @@
$param_elements[$i] = '0';
$param_display_admin[$i] = '0';
$param_display_user[$i] = '0';
+ $param_display_form[$i] = '0';
+ $param_display_list[$i] = '0';
$param_display_blocks[$i] = '0';
} else {
$parameters = explode(":", $parameters_total[$i-1]);
$param_elements[$i] = $parameters[0];
$param_display_admin[$i] = $parameters[1];
$param_display_user[$i] = $parameters[2];
- $param_display_blocks[$i] = $parameters[3];
- $param_display_main_field[$i] = $parameters[4];
- $fields_param_search_field[$i] = $parameters[5];
- $fields_param_required_field[$i] = $parameters[6];
+ $param_display_form[$i] = $parameters[3];
+ $param_display_list[$i] = $parameters[4];
+ $param_display_blocks[$i] = $parameters[5];
+ $param_display_main_field[$i] = $parameters[6];
+ $param_search_field[$i] = $parameters[7];
+ $param_required_field[$i] = $parameters[8];
}
}
$table_action = $table_mid.'&table_id='.$table_id.'&table_name='.$table_name.'&table_fieldname='.$table_fieldname.'&table_blocks='.$table_blocks.'&table_display_admin='.$table_admin.'&table_display_user='.$table_user.'&table_status='.$table_status.'&table_waiting='.$table_waiting.'&table_online='.$table_online.'&table_search='.$table_search.'&table_comments='.$table_comments.'&table_notifications='.$table_notifications.'&table_nbfields='.$table_nbfields.'&select='.$select;
@@ -431,7 +455,13 @@
}
echo "
</SELECT></td>
- <td align='center'><INPUT type='text' size='2' name='fields_value[".$i."]' value='".$fields_value[$i]."'></td>
+ <td align='center'>";
+ echo "<INPUT type='text' size='2' name='fields_value[".$i."]' value='".$fields_value[$i]."'>";
+ if ($i != 0) {
+ echo "<br /><INPUT type='text' size='2' name='fields_value_size[".$i."]' value='".$fields_value_size[$i]."'><br />
+ <INPUT type='text' size='2' name='fields_value_maxlength[".$i."]' value='".$fields_value_maxlength[$i]."'>";
+ }
+ echo "</td>
<td align='center'><SELECT name='fields_attributes[".$i."]'>";
if ( $fields_attributes[$i] == '' ) {
echo "<OPTION VALUE='' selected></OPTION>";
@@ -598,6 +628,26 @@
}
echo "</td>
</tr>
+ <tr>
+ <td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_DISPLAY_FORM."</td>
+ <td align='right' class='even'>";
+ if ( $param_display_user[$i] == 1 ) {
+ echo "<INPUT type='checkbox' size='4' name='fields_param_form[".$i."]' checked>";
+ } else {
+ echo "<INPUT type='checkbox' size='4' name='fields_param_form[".$i."]'>";
+ }
+ echo "</td>
+ </tr>
+ <tr>
+ <td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_DISPLAY_LIST."</td>
+ <td align='right' class='even'>";
+ if ( $param_display_user[$i] == 1 ) {
+ echo "<INPUT type='checkbox' size='4' name='fields_param_list[".$i."]' checked>";
+ } else {
+ echo "<INPUT type='checkbox' size='4' name='fields_param_list[".$i."]'>";
+ }
+ echo "</td>
+ </tr>
";
//Afficher la case blocks
if ( $table_blocks == 1 )
@@ -631,10 +681,10 @@
<tr>
<td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_SEARCH.",</td>
<td align='right' class='even'>";
- if ( $fields_param_search_field[$i] == 1 ) {
- echo "<INPUT type='checkbox' size='4' name='fields_param_search_field[".$i."]' checked>";
+ if ( $param_search_field[$i] == 1 ) {
+ echo "<INPUT type='checkbox' size='4' name='param_search_field[".$i."]' checked>";
} else {
- echo "<INPUT type='checkbox' size='4' name='fields_param_search_field[".$i."]'>";
+ echo "<INPUT type='checkbox' size='4' name='param_search_field[".$i."]'>";
}
echo "</td>
</tr>";
@@ -643,15 +693,14 @@
<tr>
<td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_REQUIRED."</td>
<td align='right' class='even'>";
- if ( $fields_param_required_field[$i] == 1 ) {
- echo "<INPUT type='checkbox' size='4' name='fields_param_required_field[".$i."]' checked>";
+ if ( $param_required_field[$i] == 1 ) {
+ echo "<INPUT type='checkbox' size='4' name='param_required_field[".$i."]' checked>";
} else {
- echo "<INPUT type='checkbox' size='4' name='fields_param_required_field[".$i."]'>";
+ echo "<INPUT type='checkbox' size='4' name='param_required_field[".$i."]'>";
}
echo "</td>
- </tr>
-
- </table>";
+ </tr>
+ </table>";
}
echo "</td></tr>";
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php 2013-05-05 21:17:01 UTC (rev 11503)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php 2013-05-05 21:58:45 UTC (rev 11504)
@@ -52,13 +52,26 @@
//Afficher dans l'admin
if( $i == 0 ) {
$fpa[$i] = '0';
+ $fpa[$i] = '0';
+ $fpu[$i] = '0';
+ $fpf[$i] = '0';
+ $fpl[$i] = '0';
+ $fpb[$i] = '0';
+ $fpm[$i] = '0';
+ $fps[$i] = '0';
+ $fpr[$i] = '0';
} else {
$param = explode(':', $parameters_total[$i-1]);
$fpt[$i] = $param[0]; // fpt = fields parameters type
- $fpa[$i] = $param[2]; // fpa = fields parameters admin
- $fprf[$i] = $param[6]; // fprf = fields parameters required field
- if ( $param[4] == 1 ) {
- $fpmf = $fields[0]; // fpmf = fields parameters main field
+ $fpa[$i] = $param[1]; // fpa = fields parameters admin
+ $fpu[$i] = $param[2]; // fpu = fields parameters user
+ $fpf[$i] = $param[3]; // fpf = fields parameters form
+ $fpl[$i] = $param[4]; // fpl = fields parameters list
+ $fpb[$i] = $param[5]; // fpb = fields parameters block
+ $fps[$i] = $param[7]; // fps = fields parameters search
+ $fpr[$i] = $param[8]; // fpr = fields parameters required field
+ if ( $param[6] == 1 ) {
+ $fpm = $fields[0]; // fpm = fields parameters main field
}
}
}
@@ -80,7 +93,7 @@
$numrows = $'.$table_name.'Handler->getCount();
$'.$table_name.'_arr = $'.$table_name.'Handler->getAll($criteria);
';
- $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 0);
+ $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpu, $fpb, $fps, $fpt, $language, '', 0);
if ( $table_category != 1 )
{
$text .='
@@ -100,7 +113,7 @@
echo "<tr class=\'".$class."\'>";
$class = ($class == "even") ? "odd" : "even";
';
- $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 1);
+ $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpu, $fpb, $fps, $fpt, $language, '', 1);
$text .= $fields_data.'
echo "<td class=\'center width5\'>
@@ -135,7 +148,7 @@
$cat_weight = $categories_arr[$i]->getVar(\'cat_weight\');
echo "<tr class=\'".$class."\'>";
';
- $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 1);
+ $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $n...
[truncated message content] |
|
From: <txm...@us...> - 2013-05-10 14:49:23
|
Revision: 11525
http://sourceforge.net/p/xoops/svn/11525
Author: txmodxoops
Date: 2013-05-10 14:49:13 +0000 (Fri, 10 May 2013)
Log Message:
-----------
Updated
Is needed reinstallation for test
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_modules.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_search.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/functions_const.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-05-10 10:40:40 UTC (rev 11524)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-05-10 14:49:13 UTC (rev 11525)
@@ -104,7 +104,7 @@
}
// Creation of classes
if ( $table_admin == 1 || $table_user == 1) {
- const_class($modules, $mod_name, $table_name, $table_fieldname, $category, $table_fields, $table_parameters, $category);
+ const_class($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters, $category);
}
// Creation of permissions
if ( $table_category == 1) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php 2013-05-10 10:40:40 UTC (rev 11524)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php 2013-05-10 14:49:13 UTC (rev 11525)
@@ -55,6 +55,10 @@
//remove all spaces from the new name
$obj->setVar('mod_name', preg_replace('/\s+/', '', $_POST['mod_name']));
$obj->setVar('mod_version', $_POST['mod_version']);
+ $obj->setVar('mod_min_php', $_POST['mod_min_php']);
+ $obj->setVar('mod_min_xoops', $_POST['mod_min_xoops']);
+ $obj->setVar('mod_min_admin', $_POST['mod_min_admin']);
+ $obj->setVar('mod_min_db', $_POST['mod_min_db']);
$obj->setVar('mod_description', $_POST['mod_description']);
$obj->setVar('mod_author', $_POST['mod_author']);
$obj->setVar('mod_author_mail', $_POST['mod_author_mail']);
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-05-10 10:40:40 UTC (rev 11524)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-05-10 14:49:13 UTC (rev 11525)
@@ -146,7 +146,7 @@
}
if ( isset($_REQUEST['table_online']) ) {
if ( $_REQUEST['table_online'] == 1 ) {
- $table_fields .= '|'.strtolower($_REQUEST['table_fieldname']).'_online:tinyint:1: unsigned:NOT NULL:0:'; $table_parameters .= '|XoopsFormCheckBox:1:1:1:0:0:1';
+ $table_fields .= '|'.strtolower($_REQUEST['table_fieldname']).'_online:tinyint:1:unsigned:NOT NULL:0:'; $table_parameters .= '|XoopsFormCheckBox:1:1:1:0:0:1';
}
} else {
$table_fields .= '';
@@ -396,14 +396,14 @@
{
echo '<table width="100%" cellspacing="1" class="outer">';
echo '<tr>';
- echo '<th align="center" width="1%">'._AM_TDMCREATE_ID.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_NAME.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_IMAGE.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_DISPLAY_USER.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_BLOCKS.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_NB_FIELDS.'</th>';
- echo '<th align="center" width="1%">'._AM_TDMCREATE_FORMACTION.'</th>';
+ echo '<th class="center width1">'._AM_TDMCREATE_ID.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_NAME.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_IMAGE.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_DISPLAY_USER.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_BLOCKS.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_NB_FIELDS.'</th>';
+ echo '<th class="center width5">'._AM_TDMCREATE_FORMACTION.'</th>';
echo '</tr>';
$class = 'odd';
foreach (array_keys($mod_arr) as $i)
@@ -460,14 +460,14 @@
} else {
echo '<table width="100%" cellspacing="1" class="outer">';
echo '<tr class="center">';
- echo '<th width="1%">'._AM_TDMCREATE_ID.'</th>';
- echo '<th width="10%">'._AM_TDMCREATE_NAME.'</th>';
- echo '<th width="10%">'._AM_TDMCREATE_IMAGE.'</th>';
- echo '<th width="15%">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>';
- echo '<th width="15%">'._AM_TDMCREATE_DISPLAY_USER.'</th>';
- echo '<th width="10%">'._AM_TDMCREATE_BLOCKS.'</th>';
- echo '<th width="10%">'._AM_TDMCREATE_NB_FIELDS.'</th>';
- echo '<th width="1%">'._AM_TDMCREATE_FORMACTION.'</th>';
+ echo '<th class="center width1">'._AM_TDMCREATE_ID.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_NAME.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_IMAGE.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_DISPLAY_USER.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_BLOCKS.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_NB_FIELDS.'</th>';
+ echo '<th class="center width5">'._AM_TDMCREATE_FORMACTION.'</th>';
echo '<tr><td class="errorMsg" colspan="8">No modules</td></tr>';
echo '</tr></table><br><br>';
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_modules.php 2013-05-10 10:40:40 UTC (rev 11524)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_modules.php 2013-05-10 14:49:13 UTC (rev 11525)
@@ -33,6 +33,10 @@
$this->initVar('mod_id',XOBJ_DTYPE_INT, 0,false,5);
$this->initVar('mod_name',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['name'],false);
$this->initVar('mod_version',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['version'],false);
+ $this->initVar('mod_min_php',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_php'],false);
+ $this->initVar('mod_min_xoops',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_xoops'],false);
+ $this->initVar('mod_min_admin',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_admin'],false);
+ $this->initVar('mod_min_db',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_db'],false);
$this->initVar('mod_description',XOBJ_DTYPE_TXTAREA, $GLOBALS['xoopsModuleConfig']['description'], false);
$this->initVar('mod_author',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['author'], false);
$this->initVar('mod_author_mail',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['author_email'],false);
@@ -78,7 +82,11 @@
$form->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULES_IMPORTANT.'</b></div>','head');
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_NAME, 'mod_name', 50, 255, $this->getVar('mod_name')), true);
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_VERSION, 'mod_version', 50, 255, $this->getVar('mod_version')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_VERSION, 'mod_version', 10, 25, $this->getVar('mod_version')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_PHP, 'mod_min_php', 10, 25, $this->getVar('mod_min_php')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_XOOPS, 'mod_min_xoops', 10, 25, $this->getVar('mod_min_xoops')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_ADMIN, 'mod_min_admin', 10, 25, $this->getVar('mod_min_admin')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_DB, 'mod_min_db', 10, 25, $this->getVar('mod_min_db')), true);
// Name description
$editor_configs=array();
$editor_configs['name'] = 'mod_description';
@@ -232,7 +240,7 @@
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_RELEASE, 'mod_release', 50, 255, $this->getVar('mod_release')));
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_STATUS, 'mod_status', 50, 255, $this->getVar('mod_status')));
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_PAYPAL_BUTTON, 'mod_donations', 50, 255, $this->getVar('mod_donations')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_SUBVERSION, 'mod_subversion', 50, 255, $this->getVar('mod_subversion')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_SUBVERSION, 'mod_subversion', 20, 25, $this->getVar('mod_subversion')));
$form->addElement(new XoopsFormHidden('op', 'save'));
$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_tables.php 2013-05-10 10:40:40 UTC (rev 11524)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_tables.php 2013-05-10 14:49:13 UTC (rev 11525)
@@ -137,7 +137,7 @@
</SELECT></td>
<td align='center'>";
if ( $i != 0 ) {
- echo "<table border='0' style='border-color:#666666'; width='100%' cellspacing='1' class='outer'>
+ echo "<table border='0' style='border-color:#555'; width='100%' cellspacing='1' class='outer'>
<tr>
<td align='left' class='head' width='95%'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_ELEMENTS."</td>
<td align='right' class='even' width='5%'>
@@ -191,34 +191,25 @@
<td align='right' class='even'><INPUT type='checkbox' size='4' name='fields_param_list[".$i."]' checked></td>
</tr>
";
- //Afficher la case blocks
- if ( $table_blocks == 1 )
- {
- //Pour l'affichage dans les blocks
- $checked_blocks = ( $i == 1 || $i == 2 ) ? "checked" : "";
- echo "<tr>
- <td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_BLOC."</td>
- <td align='right' class='even'><INPUT type='checkbox' size='4' name='fields_param_blocks[".$i."]' ".$checked_blocks."></td>
- </tr>";
- }
+ //Pour l'affichage dans les blocks
+ $checked_blocks = ( $i == 1 || $i == 2 ) ? "checked" : "";
+ echo "<tr>
+ <td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_BLOCK."</td>
+ <td align='right' class='even'><INPUT type='checkbox' size='4' name='fields_param_blocks[".$i."]' ".$checked_blocks."></td>
+ </tr>";
$checked_main_field = ( $i == 1 ) ? "checked" : "";
echo "
<tr>
<td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_MAIN_FIELD."</td>
<td align='right' class='even'><INPUT type='radio' value='".$i."' name='fields_param_main_field' ".$checked_main_field."></td>
- </tr>";
-
- //Afficher la case search
- if ( $table_search == 1 )
- {
- echo "
- <tr>
- <td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_SEARCH."</td>
- <td align='right' class='even'><INPUT type='checkbox' size='4' name='param_search_field[".$i."]' checked></td>
- </tr>";
- }
+ </tr>";
echo "
<tr>
+ <td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_SEARCH."</td>
+ <td align='right' class='even'><INPUT type='checkbox' size='4' name='param_search_field[".$i."]' checked></td>
+ </tr>";
+ echo "
+ <tr>
<td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_REQUIRED."</td>
<td align='right' class='even'><INPUT type='checkbox' size='4' name='param_required_field[".$i."]' checked></td>
</tr>
@@ -648,21 +639,17 @@
}
echo "</td>
</tr>
- ";
- //Afficher la case blocks
- if ( $table_blocks == 1 )
- {
- echo "<tr>
- <td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_BLOC."</td>
- <td align='right' class='even'>";
- if ( $param_display_blocks[$i] == 1 ) {
- echo "<INPUT type='checkbox' size='4' name='fields_param_blocks[".$i."]' checked>";
- } else {
- echo "<INPUT type='checkbox' size='4' name='fields_param_blocks[".$i."]'>";
- }
- echo "</td>
- </tr>";
+ ";
+ echo "<tr>
+ <td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_BLOCK."</td>
+ <td align='right' class='even'>";
+ if ( $param_display_blocks[$i] == 1 ) {
+ echo "<INPUT type='checkbox' size='4' name='fields_param_blocks[".$i."]' checked>";
+ } else {
+ echo "<INPUT type='checkbox' size='4' name='fields_param_blocks[".$i."]'>";
}
+ echo "</td>
+ </tr>";
echo "
<tr>
<td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_MAIN_FIELD."</td>
@@ -673,10 +660,7 @@
echo "<INPUT type='radio' value='".$i."' name='fields_param_main_field'>";
}
echo "</td>
- </tr>";
- //Afficher la case recherche
- if ( $table_search == 1 )
- {
+ </tr>";
echo "
<tr>
<td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_SEARCH.",</td>
@@ -687,8 +671,7 @@
echo "<INPUT type='checkbox' size='4' name='param_search_field[".$i."]'>";
}
echo "</td>
- </tr>";
- }
+ </tr>";
echo "
<tr>
<td align='left' class='head'>"._AM_TDMCREATE_TABLES_FIELDS_MORE_REQUIRED."</td>
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php 2013-05-10 10:40:40 UTC (rev 11524)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php 2013-05-10 14:49:13 UTC (rev 11525)
@@ -50,34 +50,34 @@
$fields1 = explode(':', $fields_total[$i]);
$fields[$i] = $fields1[0];
//Afficher dans l'admin
- if( $i == 0 ) {
- $fpa[$i] = '0';
- $fpa[$i] = '0';
- $fpu[$i] = '0';
- $fpf[$i] = '0';
- $fpl[$i] = '0';
- $fpb[$i] = '0';
- $fpm[$i] = '0';
- $fps[$i] = '0';
- $fpr[$i] = '0';
- } else {
- $param = explode(':', $parameters_total[$i-1]);
- $fpt[$i] = $param[0]; // fpt = fields parameters type
- $fpa[$i] = $param[1]; // fpa = fields parameters admin
- $fpu[$i] = $param[2]; // fpu = fields parameters user
- $fpf[$i] = $param[3]; // fpf = fields parameters form
- $fpl[$i] = $param[4]; // fpl = fields parameters list
- $fpb[$i] = $param[5]; // fpb = fields parameters block
- $fps[$i] = $param[7]; // fps = fields parameters search
- $fpr[$i] = $param[8]; // fpr = fields parameters required field
- if ( $param[6] == 1 ) {
- $fpm = $fields[0]; // fpm = fields parameters main field
- }
- }
+ if( $i == 0 ) {
+ $fpe[$i] = $fields[0];
+ $fpa[$i] = '0';
+ $fpu[$i] = '0';
+ $fpf[$i] = '0';
+ $fpl[$i] = '0';
+ $fpb[$i] = '0';
+ $fpm[$i] = '0';
+ $fps[$i] = '0';
+ $fpr[$i] = '0';
+ } else {
+ $param = explode(':', $parameters_total[$i-1]);
+ $fpe[$i] = $param[0]; // fpe = fields parameters element
+ $fpa[$i] = $param[1]; // fpa = fields parameters admin
+ $fpu[$i] = $param[2]; // fpu = fields parameters user
+ $fpf[$i] = $param[3]; // fpf = fields parameters form
+ $fpl[$i] = $param[4]; // fpl = fields parameters list
+ $fpb[$i] = $param[5]; // fpb = fields parameters block
+ if ( $param[6] == 1 ) {
+ $fpm[$i] = $fields[0]; // fpm = fields parameters main field
+ }
+ $fps[$i] = $param[7]; // fps = fields parameters search
+ $fpr[$i] = $param[8]; // fpr = fields parameters required field
+ }
}
$field_id = $fields[0];
-$fields_name = $fields[1];
+$field_name = $fields[1];
$text .= '
echo $adminMenu->addNavigation(\''.$table_name.'.php\');
@@ -93,7 +93,7 @@
$numrows = $'.$table_name.'Handler->getCount();
$'.$table_name.'_arr = $'.$table_name.'Handler->getAll($criteria);
';
- $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpu, $fpb, $fps, $fpt, $language, '', 0);
+ $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpe, $fpa, $fpu, $fpf, $fpl, $fpb, $fps, $language, '', 0);
if ( $table_category != 1 )
{
$text .='
@@ -113,7 +113,7 @@
echo "<tr class=\'".$class."\'>";
$class = ($class == "even") ? "odd" : "even";
';
- $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpu, $fpb, $fps, $fpt, $language, '', 1);
+ $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpe, $fpa, $fpu, $fpf, $fpl, $fpb, $fps, $language, '', 1);
$text .= $fields_data.'
echo "<td class=\'center width5\'>
@@ -148,7 +148,7 @@
$cat_weight = $categories_arr[$i]->getVar(\'cat_weight\');
echo "<tr class=\'".$class."\'>";
';
- $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpu, $fpb, $fps, $fpt, $language, '', 1);
+ $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpe, $fpa, $fpu, $fpf, $fpl, $fpb, $fps, $language, '', 1);
$text .= ''.$fields_data.'
echo "<td class=\'center width5\'>
@@ -175,7 +175,7 @@
{
echo "<table width=\'100%\' cellspacing=\'1\' class=\'outer\'>
<tr>';
- $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpu, $fpb, $fps, $fpt, $language, '', 0);
+ $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpe, $fpa, $fpu, $fpf, $fpl, $fpb, $fps, $language, '', 0);
$text .= $fcn.'
<th class=\'center width5\'>".'.$language.'_FORMACTION."</th>
</tr>";
@@ -191,7 +191,7 @@
$category_weight = $'.$table_name.'_arr[$i]->getVar(\''.$table_fieldname.'_weight\');
echo "<tr class=\'".$class."\'>";
';
- $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpu, $fpb, $fps, $fpt, $language, 1, 1);
+ $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpe, $fpa, $fpu, $fpf, $fpl, $fpb, $fps, $language, 1, 1);
$text .= ''.$fields_data.'
echo "<td class=\'center width5\'>
@@ -217,7 +217,7 @@
} else {
echo "<table width=\'100%\' cellspacing=\'1\' class=\'outer\'>
<tr>';
- $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpu, $fpb, $fps, $fpt, $language, '', 0);
+ $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpe, $fpa, $fpu, $fpf, $fpl, $fpb, $fps, $language, '', 0);
$text .= $fcn.'
<th class=\'center width5\'>".'.$language.'_FORMACTION."</th>
</tr>
@@ -250,7 +250,7 @@
';
- $fields_save = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpu, $fpb, $fps, $fpt, $language, '', 2);
+ $fields_save = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpe, $fpa, $fpu, $fpf, $fpl, $fpb, $fps, $language, '', 2);
$text .= ''.$fields_save.'
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php 2013-05-10 10:40:40 UTC (rev 11524)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php 2013-05-10 14:49:13 UTC (rev 11525)
@@ -19,12 +19,12 @@
* @version $Id: const_class.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_class($modules, $mod_name, $table_name, $table_fieldname, $table_category, $table_fields, $table_parameters, $category)
+function const_class($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters, $category)
{
$language = '_AM_'.strtoupper($mod_name).'_';
$file = $mod_name.'_'.$table_name. '.php';
$path_file = TDM_CREATE_MURL.'/'.$mod_name.'/class/'.$file;
- $constructor = const_fields($mod_name, $table_name, $table_fieldname, $table_category, $table_fields, $language, 0, 0, 0, 0);
+ $constructor = const_fields($mod_name, $table_name, $table_fieldname, $table_fields, $language, 0, 0, 0);
//fields
$fields_total = explode('|', $table_fields);
$nb_fields = count($fields_total);
@@ -39,23 +39,24 @@
//Afficher dans les elements du formulaire et choisir le type
if( $i == 0 ) {
$fpaif = $fields[0]; // fpaif = fields parameters auto_increment field
- $fpt[$i] = '0';
+ $fpe[$i] = '0';
$fpa[$i] = '0';
$fpu[$i] = '0';
$fpf[$i] = '0';
- $fpl[$i] = '0';
- $fpr[$i] = '0';
+ $fpl[$i] = '0';
+ $fpr[$i] = '0';
+ $fpmf[$i] = '0';
} else {
$param = explode(':', $parameters_total[$i-1]);
//print_r($param);
- $fpt[$i] = $param[0]; // fpt = fields parameters types
- $fpa[$i] = $param[1]; // fpdf = fields parameters display form
- $fpu[$i] = $param[2]; // fpdf = fields parameters display form
- $fpf[$i] = $param[3]; // fpdf = fields parameters display form
- $fpl[$i] = $param[4]; // fpdf = fields parameters display form
- $fpr[$i] = $param[8]; // fprf = fields parameters required field
+ $fpe[$i] = $param[0]; // fpe = fields parameters elements
+ $fpa[$i] = $param[1]; // fpa = fields parameters display admin
+ $fpu[$i] = $param[2]; // fpu = fields parameters display user
+ $fpf[$i] = $param[3]; // fpf = fields parameters display form
+ $fpl[$i] = $param[4]; // fpl = fields parameters display list
+ $fpr[$i] = $param[8]; // fpr = fields parameters required field
if ( $param[6] == 1 ) {
- $fpmf = $fields[0]; // fpmf = fields parameters main field
+ $fpmf[$i] = $fields[0]; // fpmf = fields parameters main field
}
}
}
@@ -90,7 +91,7 @@
$form->setExtra(\'enctype="multipart/form-data"\');
';
- $text .= const_fields($mod_name, $table_name, $table_fieldname, $table_category, $table_fields, $language, $fpt, $fpr, 1);
+ $text .= const_fields($mod_name, $table_name, $table_fieldname, $table_fields, $language, $fpe, $fpr, 1);
if( $category == 1) {
$up_mod_name = strtoupper($mod_name);
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_header.php 2013-05-10 10:40:40 UTC (rev 11524)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_header.php 2013-05-10 14:49:13 UTC (rev 11525)
@@ -23,6 +23,7 @@
$text = '';
$mod_name = $module->getVar('mod_name');
$mod_version = $module->getVar('mod_version');
+$mod_min_xoops = $module->getVar('mod_min_xoops');
$mod_revision = $module->getVar('mod_revision');
$mod_author = $module->getVar('mod_author');
$mod_credits = $module->getVar('mod_credits');
@@ -49,11 +50,10 @@
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license '.$mod_license.'
* @package '.$mod_name.'
- * @since 2.5.x
+ * @since '.$mod_min_xoops.'
* @author '.$mod_author.' <'.$mod_a_m.'> - <'.$mod_a_w_url.'>
* @version $Id: '.$mod_version.' '.$filename.' '.$mod_subversion.' '.$date.'Z '.$mod_credits.' $
*/
';
return $text;
-}
-?>
\ No newline at end of file
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_comments.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_comments.php 2013-05-10 10:40:40 UTC (rev 11524)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_comments.php 2013-05-10 14:49:13 UTC (rev 11525)
@@ -77,12 +77,13 @@
{
$fields = explode(':', $fields_total[$j]);
//Afficher dans les elements du formulaire et choisir le type
- if( $j != 0 )
- {
+ if( $j == 0 ) {
+ $fpmf = 0;
+ } else {
$parameters1 = explode(':', $parameters_total[$j-1]);
if ( $parameters1[4] == 1 )
{
- $fields_param_main_field = $fields[0];
+ $fpmf = $fields[0];
}
}
}
@@ -96,7 +97,7 @@
if ($com_itemid > 0) {
$'.$table_name.'Handler =& xoops_getModuleHandler(\''.$table_name.'\', \''.$mod_name.'\');
$'.$table_name.' = $'.$table_name.'handler->get($com_itemid);
- $com_replytitle = $'.$table_name.'->getVar(\''.$fields_param_main_field.'\');
+ $com_replytitle = $'.$table_name.'->getVar(\''.$fpmf.'\');
include XOOPS_ROOT_PATH.\'/include/comment_new.php\';
}
?>';
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_search.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_search.php 2013-05-10 10:40:40 UTC (rev 11524)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_search.php 2013-05-10 14:49:13 UTC (rev 11525)
@@ -32,20 +32,23 @@
}
//fields
- $fields_total = explode("|", $table_fields);
+ $fields_total = explode('|', $table_fields);
$nb_fields = count($fields_total);
//print_r($fields_total);
//parameters
- $parameters_total = explode("|", $table_parameters);
+ $parameters_total = explode('|', $table_parameters);
$k = 0;
//Recuperation des parameters affichage dans le formulaire
for($j=0; $j<$nb_fields; $j++)
{
- $fields = explode(":", $fields_total[$j]);
+ $fields = explode(':', $fields_total[$j]);
+
//Afficher dans les elements du formulaire et choisir le type
- if( $j != 0 )
- {
- $param = explode(":", $parameters_total[$j-1]);
+ if( $j == 0 ) {
+ $fpsf[$k] = 0;
+ $fpmf = 0;
+ } else {
+ $param = explode(':', $parameters_total[$j-1]);
if ( $param[7] == 1 )
{
$fpsf[$k] = $fields[0];
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_xoopsversion.php 2013-05-10 10:40:40 UTC (rev 11524)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_xoopsversion.php 2013-05-10 14:49:13 UTC (rev 11525)
@@ -49,10 +49,12 @@
$modversion[\'manual\'] = "'.$modules->getVar("mod_manual").'";
$modversion[\'manual_file\'] = XOOPS_URL."/modules/{$dirname}/docs/'.$modules->getVar("mod_manual_file").'";
-$modversion[\'min_php\'] = "5.2";
-$modversion[\'min_xoops\'] = "2.5.5";
-$modversion[\'min_admin\']= "1.1";
-$modversion[\'min_db\']= array(\'mysql\'=>\'5.0.7\', \'mysqli\'=>\'5.0.7\');
+$modversion[\'min_php\'] = "'.$modules->getVar("mod_min_php").'";
+$modversion[\'min_xoops\'] = "'.$modules->getVar("mod_min_xoops").'";
+$modversion[\'min_admin\']= "'.$modules->getVar("mod_min_admin").'";';
+$min_db = $modules->getVar('mod_min_db');
+$text = '
+$modversion[\'min_db\']= array(\'mysql\'=>\''.$min_db.'\', \'mysqli\'=>\''.$min_db.'\');
$modversion[\'image\'] = "images/'.strtolower($modules->getVar("mod_image")).'";
$modversion[\'dirname\'] = "{$dirname}";
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/functions_const.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/functions_const.php 2013-05-10 10:40:40 UTC (rev 11524)
+++ Xo...
[truncated message content] |
|
From: <txm...@us...> - 2013-05-12 12:45:38
|
Revision: 11534
http://sourceforge.net/p/xoops/svn/11534
Author: txmodxoops
Date: 2013-05-12 12:45:33 +0000 (Sun, 12 May 2013)
Log Message:
-----------
Updated to RC 1
Added more field:
min_php textbox in admin/modules.php
min_xoops textbox in admin/modules.php
min_admin textbox in admin/modules.php
min_mysql textbox in admin/modules.php
Is needed a new installation of the module
For more experienced users just create 4 more fields in the table txmcreate_modules after uploading the files if you overwrite the beta 4
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/constArchitecture.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_modules.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_architecture.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_search.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_sql.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/docs/changelog.txt
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/functions_const.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/update language 1.38 to 1.39.txt
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-05-12 11:37:11 UTC (rev 11533)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-05-12 12:45:33 UTC (rev 11534)
@@ -104,7 +104,7 @@
}
// Creation of classes
if ( $table_admin == 1 || $table_user == 1) {
- const_class($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters, $category);
+ const_class($modules, $mod_name, $table_name, $table_fieldname, $category, $table_fields, $table_parameters, $category);
}
// Creation of permissions
if ( $table_category == 1) {
@@ -129,7 +129,7 @@
}
// Creation of notifications
if ( isset($table_notifications) ) {
- const_include_notifications($modules, $mod_name, $table_name, $table_fieldname);
+ const_include_notifications($modules, $modules_name, $table_name, $table_fieldname);
}
// Creation of the file mysql.sql
const_sql($mod_name, $table_name, $table_fieldname, $category, $table_fields);
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php 2013-05-12 11:37:11 UTC (rev 11533)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php 2013-05-12 12:45:33 UTC (rev 11534)
@@ -23,7 +23,7 @@
echo $adminMenu->addNavigation('modules.php');
switch ($op)
{
- case 'save':
+ case "save":
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
@@ -55,10 +55,10 @@
//remove all spaces from the new name
$obj->setVar('mod_name', preg_replace('/\s+/', '', $_POST['mod_name']));
$obj->setVar('mod_version', $_POST['mod_version']);
- $obj->setVar('mod_min_php', $_POST['mod_min_php']);
- $obj->setVar('mod_min_xoops', $_POST['mod_min_xoops']);
- $obj->setVar('mod_min_admin', $_POST['mod_min_admin']);
- $obj->setVar('mod_min_db', $_POST['mod_min_db']);
+ $obj->setVar('mod_min_php', $_POST['mod_min_php']);
+ $obj->setVar('mod_min_xoops' => $_POST['mod_min_xoops']);
+ $obj->setVar('mod_min_admin' => $_POST['mod_min_admin']);
+ $obj->setVar('mod_min_mysql' => $_POST['mod_min_mysql']);
$obj->setVar('mod_description', $_POST['mod_description']);
$obj->setVar('mod_author', $_POST['mod_author']);
$obj->setVar('mod_author_mail', $_POST['mod_author_mail']);
@@ -91,25 +91,26 @@
}
break;
- case 'new':
+ case "new":
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php?op=list', 'list');
echo $adminMenu->renderButton();
$obj =& $modulesHandler->create();
$form = $obj->getForm();
break;
- case 'edit':
+ case "edit":
$obj =& $modulesHandler->get($_REQUEST['mod_id']);
$form = $obj->getForm();
break;
- case 'delete':
+ case "delete":
$obj =& $modulesHandler->get($_REQUEST['mod_id']);
if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1)
{
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- if ($modulesHandler->delete($obj)) {
+ if ($modulesHandler->delete($obj)) {
+ $xoopsDB->queryF("DELETE FROM ".$xoopsDB->prefix("tdmcreate_modules")." WHERE mod_id = ".$_REQUEST['mod_id']);
redirect_header('modules.php', 3, _AM_TDMCREATE_FORMDELOK);
} else {
echo $obj->getHtmlErrors();
@@ -118,29 +119,18 @@
xoops_confirm(array('ok' => 1, 'mod_id' => $_REQUEST['mod_id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('mod_name')));
}
break;
- case 'list':
+ case "list":
default:
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_NEW, 'modules.php?op=new', 'add');
echo $adminMenu->renderButton();
-
- $limit = $GLOBALS['xoopsModuleConfig']['adminpager'];
- $start = TDMCreate_CleanVars( $_REQUEST, 'start', 0 );
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id');
$criteria->setOrder('ASC');
- $criteria->setStart($start);
- $criteria->setLimit($limit);
- $mod_arr = $modulesHandler->getall($criteria);
- $numrows = $modulesHandler->getCount();
- if ( $numrows > $limit ) {
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list&limit=' . $limit);
- $pagenav = $pagenav->renderNav(4);
- } else {
- $pagenav = '';
- }
- if ( $numrows > 0 )
+ $mod_arr = $modulesHandler->getall($criteria);
+ $numrows_modules = $modulesHandler->getCount();
+
+ if ( $numrows_modules > 0 )
{
echo '<table width="100%" cellspacing="1" class="outer">';
echo '<tr class="center">';
@@ -174,8 +164,7 @@
echo '</td>';
echo '</tr>';
}
- echo '</table><br /><br />';
- echo '<div class="right">'.$pagenav.'</div><br />';
+ echo '</table><br><br>';
} else {
echo '<table width="100%" cellspacing="1" class="outer">';
echo '<tr class="center">';
@@ -190,4 +179,4 @@
}
break;
}
-include_once 'admin_footer.php';
\ No newline at end of file
+include_once "admin_footer.php";
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-05-12 11:37:11 UTC (rev 11533)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-05-12 12:45:33 UTC (rev 11534)
@@ -21,6 +21,7 @@
include_once 'admin_header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
echo $adminMenu->addNavigation('tables.php');
+$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
switch ($op) {
case 'save_table':
if (isset($_REQUEST['table_id'])) {
@@ -51,9 +52,9 @@
$obj->setVar('table_notifications', 0);
$obj->setVar('table_nbfields', 7);
- $table_fields = 'cat_id:int:8: : :unsigned:NOT NULL: :primary|cat_pid:int:5: : :unsigned:NOT NULL:0:unique|cat_title:varchar:255: : : :NOT NULL: :unique|cat_desc:text: : : : :NOT NULL: :|cat_image:varchar:255: : : :NOT NULL: :|cat_weight:int:5: : :unsigned:NOT NULL:0:|cat_color:varchar:10: : : :NULL: :';
+ $table_fields = 'cat_id:int:8:unsigned:NOT NULL: :primary|cat_pid:int:5:unsigned:NOT NULL:0:unique|cat_title:varchar:255: :NOT NULL: :unique|cat_desc:text: : :NOT NULL: :|cat_image:varchar:255: :NOT NULL: :|cat_weight:int:5:unsigned:NOT NULL:0:|cat_color:varchar:10: :NULL: :';
- $table_parameters = 'XoopsFormCategory:0:0:0:0:0:0:0:1|XoopsFormText:1:1:0:0:0:1:0:1|XoopsFormTextArea:0:1:0:0:0:0:0:1|XoopsFormUploadImage:1:1:0:0:0:0:0:0|XoopsFormText:1:1:0:0:0:0:0:0|XoopsFormColorPicker:1:1:0:0:0:0:0:0|XoopsFormSelectUser:0:0:0:0:0:0:0:1|XoopsFormTextDateSelect:0:0:0:0:0:0:0:1|XoopsFormCheckBox:1:1:0:0:0:0:0:1';
+ $table_parameters = 'XoopsFormCategory:0:0:0:0:0:1|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:0|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';
@@ -62,15 +63,18 @@
$uploaddir = $pathIcon32;
}else{
$uploaddir = XOOPS_ROOT_PATH . "/modules/".$xoopsModule->dirname()."/images/uploads/tables/";
- }
- $uploader = new XoopsMediaUploader($uploaddir, 'gif|jpeg|pjpeg|png', 500000, null, null);
+ }
+
+ $uploader = new XoopsMediaUploader($uploaddir, "gif|jpeg|pjpeg|png", 104857600, null, null);
+
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile1']['name']) ;
+ $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["attachedfile1"]['name']) ;
$name_img = 'category.'.$extension;
$uploader->setTargetFileName($name_img);
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
- redirect_header('javascript:history.go(-1)', 3, $uploader->getErrors());
+ $errors = $uploader->getErrors();
+ redirect_header("javascript:history.go(-1)",3, $errors);
} else {
$obj->setVar('table_image', $uploader->getSavedFileName());
}
@@ -101,8 +105,6 @@
$table_parameters .= ( !empty($_REQUEST['fields_param_elements'][$i]) ) ? "".$_REQUEST['fields_param_elements'][$i].":" : " :";
$table_parameters .= ( !empty($_REQUEST['fields_param_admin'][$i]) ) ? "1:" : "0:";
$table_parameters .= ( !empty($_REQUEST['fields_param_user'][$i]) ) ? "1:" : "0:";
- $table_parameters .= ( !empty($_REQUEST['fields_param_form'][$i]) ) ? "1:" : "0:";
- $table_parameters .= ( !empty($_REQUEST['fields_param_list'][$i]) ) ? "1:" : "0:";
$table_parameters .= ( !empty($_REQUEST['fields_param_blocks'][$i]) ) ? "1:" : "0:";
$table_parameters .= ( $i == $_REQUEST['fields_param_main_field']) ? "1:" : "0:";
$table_parameters .= ( !empty($_REQUEST['fields_param_search_field'][$i]) ) ? "1:" : "0:";
@@ -113,8 +115,6 @@
$table_fields .= (!empty($_REQUEST['fields_name'][$i])) ? $_REQUEST['fields_name'][$i].":" : " :";
$table_fields .= (!empty($_REQUEST['fields_type'][$i])) ? $_REQUEST['fields_type'][$i].":" : " :";
$table_fields .= (!empty($_REQUEST['fields_value'][$i])) ? $_REQUEST['fields_value'][$i].":" : " :";
- $table_fields .= (!empty($_REQUEST['fields_value_size'][$i])) ? $_REQUEST['fields_value_size'][$i].":" : " :";
- $table_fields .= (!empty($_REQUEST['fields_value_maxlength'][$i])) ? $_REQUEST['fields_value_maxlength'][$i].":" : " :";
$table_fields .= (!empty($_REQUEST['fields_attributes'][$i])) ? $_REQUEST['fields_attributes'][$i].":" : " :";
$table_fields .= (!empty($_REQUEST['fields_null'][$i])) ? strtoupper($_REQUEST['fields_null'][$i]).":" : " :";
$table_fields .= (!empty($_REQUEST['fields_default'][$i])) ? $_REQUEST['fields_default'][$i].":" : " :";
@@ -146,7 +146,7 @@
}
if ( isset($_REQUEST['table_online']) ) {
if ( $_REQUEST['table_online'] == 1 ) {
- $table_fields .= '|'.strtolower($_REQUEST['table_fieldname']).'_online:tinyint:1:unsigned:NOT NULL:0:'; $table_parameters .= '|XoopsFormCheckBox:1:1:1:0:0:1';
+ $table_fields .= '|'.strtolower($_REQUEST['table_fieldname']).'_online:tinyint:1: unsigned:NOT NULL:0:'; $table_parameters .= '|XoopsFormCheckBox:1:1:1:0:0:1';
}
} else {
$table_fields .= '';
@@ -229,14 +229,14 @@
$newname = strtolower($_REQUEST['table_fieldname']);
//echo $count_parameters;
//fields
- for($i = 0; $i < $count_fields; $i++)
+ for($i=0; $i<$count_fields; $i++)
{
- $fields = explode(':', $fields_total[$i]);
+ $fields = explode(":", $fields_total[$i]);
$fields[0] = $newname . substr($fields[0], stripos($fields[0], '_'));
$newfields[$i] = implode(":", $fields);
}
- $newTableFields=implode('|',$newfields);
+ $newTableFields=implode("|",$newfields);
$obj->setVar('table_fields', $newTableFields);
if ($tablesHandler->insert($obj)) {
@@ -273,7 +273,7 @@
case "table_fields":
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=table_list', 'list');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW, 'tables.php?op=table_fields', 'add');
- echo $adminMenu->renderButton();
+ echo $adminMenu->renderButton();
//fields existe deja ?
$criteria = new CriteriaCompo();
@@ -373,50 +373,40 @@
$xoopsDB->queryF($sql_del);
}
- $limit = $GLOBALS['xoopsModuleConfig']['adminpager'];
- $start = TDMCreate_CleanVars( $_REQUEST, 'start', 0 );
- $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/style.css' );
- $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
-
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id');
$criteria->setOrder('ASC');
- $criteria->setStart($start);
- $criteria->setLimit($limit);
$mod_arr = $modulesHandler->getall($criteria);
$numrows_modules = $modulesHandler->getCount();
- if ( $numrows_modules > $limit ) {
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($numrows_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
- $pagenav = $pagenav->renderNav(4);
- } else {
- $pagenav = '';
- }
+
if ( $numrows_modules > 0 )
{
echo '<table width="100%" cellspacing="1" class="outer">';
echo '<tr>';
- echo '<th class="center width1">'._AM_TDMCREATE_ID.'</th>';
- echo '<th class="center width10">'._AM_TDMCREATE_NAME.'</th>';
- echo '<th class="center width10">'._AM_TDMCREATE_IMAGE.'</th>';
- echo '<th class="center width10">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>';
- echo '<th class="center width10">'._AM_TDMCREATE_DISPLAY_USER.'</th>';
- echo '<th class="center width10">'._AM_TDMCREATE_BLOCKS.'</th>';
- echo '<th class="center width10">'._AM_TDMCREATE_NB_FIELDS.'</th>';
- echo '<th class="center width5">'._AM_TDMCREATE_FORMACTION.'</th>';
+ echo '<th align="center" width="1%">'._AM_TDMCREATE_ID.'</th>';
+ echo '<th align="center" width="10%">'._AM_TDMCREATE_NAME.'</th>';
+ echo '<th align="center" width="10%">'._AM_TDMCREATE_IMAGE.'</th>';
+ echo '<th align="center" width="10%">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>';
+ echo '<th align="center" width="10%">'._AM_TDMCREATE_DISPLAY_USER.'</th>';
+ echo '<th align="center" width="10%">'._AM_TDMCREATE_BLOCKS.'</th>';
+ echo '<th align="center" width="10%">'._AM_TDMCREATE_NB_FIELDS.'</th>';
+ echo '<th align="center" width="1%">'._AM_TDMCREATE_FORMACTION.'</th>';
echo '</tr>';
$class = 'odd';
foreach (array_keys($mod_arr) as $i)
{
$mod_id = $mod_arr[$i]->getVar('mod_id');
$mod_name = $mod_arr[$i]->getVar('mod_name');
+ $mod_image = $mod_arr[$i]->getVar('mod_image');
+ $mod_display_admin = ($mod_arr[$i]->getVar('mod_display_admin') == 1) ? _YES : _NO;
+ $mod_display_user = ($mod_arr[$i]->getVar('mod_display_user') == 1) ? _YES : _NO;
echo '<tr class="odd center toggleTables">';
echo '<td class="width5"><b>'.$i.'</b><br /><img src="../images/icons/16/toggle.png" alt="Toggle" title="Toggle" /></td>';
$nbsps = ' ';
echo '<td class="left">'.$nbsps.'<img src="../images/icons/16/arrow.gif" alt="Arrow" />'.$nbsps.'<b>'.$mod_name.'</b></td>';
- echo '<td><img src="../images/uploads/modules/'.$mod_arr[$i]->getVar('mod_image').'" height="30px"></td>';
- echo '<td>'.(($mod_arr[$i]->getVar('mod_display_admin') == 1) ? _YES : _NO).'</td>';
- echo '<td>'.(($mod_arr[$i]->getVar('mod_display_user') == 1) ? _YES : _NO).'</td>';
+ echo '<td><img src="../images/uploads/modules/'.$mod_image.'" height="30px"></td>';
+ echo '<td>'.$mod_display_admin.'</td>';
+ echo '<td>'.$mod_display_user.'</td>';
echo '<td>~</td>';
echo '<td>~</td>';
echo '<td>';
@@ -426,7 +416,7 @@
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $mod_id));
- $criteria->setSort('table_id');
+ $criteria->setSort('table_name');
$criteria->setOrder('ASC');
$table_arr = $tablesHandler->getall($criteria);
$numrows_tables = $tablesHandler->getCount();
@@ -436,18 +426,23 @@
{
$table_name = $table_arr[$i]->getVar('table_name');
$table_image = $table_arr[$i]->getVar('table_image');
- echo '<tr class="even center toggleHidden">';
+ $table_blocks = $table_arr[$i]->getVar('table_blocks');
+ $table_admin = (($table_arr[$i]->getVar('table_admin') == 1) ? _YES : _NO);
+ $table_user = (($table_arr[$i]->getVar('table_user') == 1) ? _YES : _NO);
+ $nb_fields = $table_arr[$i]->getVar('table_nbfields');
+ $blocks = ($table_blocks == 1) ? _YES : _NO;
+ echo '<tr class="even center">';
echo '<td class="center">'.$i.'</b></a></td>';
- echo '<td class="left"> <b>» '.$table_name.'</b></a></td>';
+ echo '<td class="left"> <b>- '.$table_name.'</b></a></td>';
if(file_exists($image = $pathIcon32.'/'.$table_image)) {
echo '<td><img src="'.$image.'" height="25px"></td>';
} else {
echo '<td><img src="../images/uploads/tables/'.$table_image.'" height="25px"></td>';
}
- echo '<td>'.(($table_arr[$i]->getVar('table_admin') == 1) ? _YES : _NO).'</td>';
- echo '<td>'.(($table_arr[$i]->getVar('table_user') == 1) ? _YES : _NO).'</td>';
- echo '<td>'.(($table_arr[$i]->getVar('table_blocks') == 1) ? _YES : _NO).'</td>';
- echo '<td>'.$table_arr[$i]->getVar('table_nbfields').'</td>';
+ echo '<td>'.$table_admin.'</td>';
+ echo '<td>'.$table_user.'</td>';
+ echo '<td>'.$blocks.'</td>';
+ echo '<td>'.$nb_fields.'</td>';
echo '<td>';
echo '<a href="tables.php?op=edit_table&table_id='.$i.'"><img src="'. $pathIcon16 .'/edit.png" alt="'._AM_TDMCREATE_FORMEDIT.'" title="'._AM_TDMCREATE_FORMEDIT.'"></a> <a href="tables.php?op=edit_fields&table_id='.$i.'"><img src="'. $pathIcon16 .'/inserttable.png" alt="'._AM_TDMCREATE_FORMFIELDS.'" title="'._AM_TDMCREATE_FORMFIELDS.'" /></a> <a href="tables.php?op=delete_table&table_id='.$i.'"><img src="'. $pathIcon16 .'/delete.png" alt="'._AM_TDMCREATE_FORMDEL.'" title="'._AM_TDMCREATE_FORMDEL.'"></a>';
echo '</td>';
@@ -455,19 +450,18 @@
}
}
}
- echo '</table><br /><br />';
- echo '<div class="right">'.$pagenav.'</div><br />';
+ echo '</table>';
} else {
echo '<table width="100%" cellspacing="1" class="outer">';
echo '<tr class="center">';
- echo '<th class="center width1">'._AM_TDMCREATE_ID.'</th>';
- echo '<th class="center width10">'._AM_TDMCREATE_NAME.'</th>';
- echo '<th class="center width10">'._AM_TDMCREATE_IMAGE.'</th>';
- echo '<th class="center width10">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>';
- echo '<th class="center width10">'._AM_TDMCREATE_DISPLAY_USER.'</th>';
- echo '<th class="center width10">'._AM_TDMCREATE_BLOCKS.'</th>';
- echo '<th class="center width10">'._AM_TDMCREATE_NB_FIELDS.'</th>';
- echo '<th class="center width5">'._AM_TDMCREATE_FORMACTION.'</th>';
+ echo '<th width="1%">'._AM_TDMCREATE_ID.'</th>';
+ echo '<th width="10%">'._AM_TDMCREATE_NAME.'</th>';
+ echo '<th width="10%">'._AM_TDMCREATE_IMAGE.'</th>';
+ echo '<th width="15%">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>';
+ echo '<th width="15%">'._AM_TDMCREATE_DISPLAY_USER.'</th>';
+ echo '<th width="10%">'._AM_TDMCREATE_BLOCKS.'</th>';
+ echo '<th width="10%">'._AM_TDMCREATE_NB_FIELDS.'</th>';
+ echo '<th width="1%">'._AM_TDMCREATE_FORMACTION.'</th>';
echo '<tr><td class="errorMsg" colspan="8">No modules</td></tr>';
echo '</tr></table><br><br>';
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/constArchitecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/constArchitecture.php 2013-05-12 11:37:11 UTC (rev 11533)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/constArchitecture.php 2013-05-12 12:45:33 UTC (rev 11534)
@@ -24,110 +24,109 @@
}
class constArchitecture {
- /*
- *
- *
- */
- var $module_name = '';
- /*
- *
- *
- */
- var $folder_name = null;
- /*
- *
- *
- */
- var $file_name = null;
- /*
- *
- *
- */
- var $path = null;
- /*
- *
- *
- */
- var $copieFile;
- /*
- * @pubblic function constructor class
- * @param string $path
- */
- function __construct($path) {
- $this->path = $path;
- }
- /*
- * @pubblic function class
- * @param string $path
- */
- function constArchitecture($path)
- {
- $this->__construct($path);
- }
- /*
- * @pubblic function makeDir
- * @param string $path
- */
- function makeDir($path)
- {
- $this->path = $path;
- if(!is_dir($this->path)) {
- mkdir($this->path, 0705);
- chmod($this->path, 0705);
- }
- }
- /*
- * @pubblic function makeDirModule
- * @param string $folder_name
- */
- function makeDirInModule($folder_name)
- {
- $this->folder_name = $folder_name;
- $fname = $this->path . "/" .$this->module_name. "/" .$this->folder_name;
- if(!is_dir($fname)) {
- mkdir($fname, 0705);
- chmod($fname, 0705);
- }
- }
- /*
- * @pubblic function makeDir & copy file
- * @param string $folder_name
- * @param string $copieFile
- * @param string $file
- */
- function makeDirAndCopyFile($folder_name, $copieFile, $file)
- {
- $this->file_name = $file;
- $this->folder_name = $folder_name;
- $this->copieFile = $copieFile;
- $fname = $this->path . "/" .$this->module_name. "/" .$this->folder_name;
- if(!is_dir($fname)) {
- mkdir($fname, 0705);
- chmod($fname, 0705);
- $this->copyFile($this->folder_name, $this->copieFile, $this->file_name);
- } else {
- $this->copyFile($this->folder_name, $this->copieFile, $this->file_name);
- }
- }
- /*
- * @pubblic function copy file
- * @param string $folder_name
- * @param string $copieFile
- * @param string $file
- */
- function copyFile($folder_name, $copieFile, $file)
- {
- $this->file_name = $file;
- $this->folder_name = $folder_name;
- $this->copieFile = $copieFile;
- $fname = $this->path . "/" .$this->module_name. "/" .$this->folder_name. "/". $this->file_name;
- /*if(!file_exists($fname)) {
+ /*
+ *
+ *
+ */
+ var $module_name = '';
+ /*
+ *
+ *
+ */
+ var $folder_name = null;
+ /*
+ *
+ *
+ */
+ var $file_name = null;
+ /*
+ *
+ *
+ */
+ var $path = null;
+ /*
+ *
+ *
+ */
+ var $copieFile;
+ /*
+ * @pubblic function constructor class
+ * @param string $path
+ */
+ function __construct($path) {
+ $this->path = $path;
+ }
+ /*
+ * @pubblic function class
+ * @param string $path
+ */
+ function constArchitecture($path)
+ {
+ $this->__construct($path);
+ }
+ /*
+ * @pubblic function makeDir
+ * @param string $path
+ */
+ function makeDir($path)
+ {
+ $this->path = $path;
+ if(!is_dir($this->path)) {
+ mkdir($this->path, 0755);
+ chmod($this->path, 0755);
+ }
+ }
+ /*
+ * @pubblic function makeDirModule
+ * @param string $folder_name
+ */
+ function makeDirInModule($folder_name)
+ {
+ $this->folder_name = $folder_name;
+ $fname = $this->path . "/" .$this->module_name. "/" .$this->folder_name;
+ if(!is_dir($fname)) {
+ mkdir($fname, 0755);
+ chmod($fname, 0755);
+ }
+ }
+ /*
+ * @pubblic function makeDir & copy file
+ * @param string $folder_name
+ * @param string $copieFile
+ * @param string $file
+ */
+ function makeDirAndCopyFile($folder_name, $copieFile, $file)
+ {
+ $this->file_name = $file;
+ $this->folder_name = $folder_name;
+ $this->copieFile = $copieFile;
+ $fname = $this->path . "/" .$this->module_name. "/" .$this->folder_name;
+ if(!is_dir($fname)) {
+ mkdir($fname, 0755);
+ chmod($fname, 0755);
+ $this->copyFile($this->folder_name, $this->copieFile, $this->file_name);
+ } else {
+ $this->copyFile($this->folder_name, $this->copieFile, $this->file_name);
+ }
+ }
+ /*
+ * @pubblic function copy file
+ * @param string $folder_name
+ * @param string $copieFile
+ * @param string $file
+ */
+ function copyFile($folder_name, $copieFile, $file)
+ {
+ $this->file_name = $file;
+ $this->folder_name = $folder_name;
+ $this->copieFile = $copieFile;
+ $fname = $this->path . "/" .$this->module_name. "/" .$this->folder_name. "/". $this->file_name;
+ /*if(!file_exists($fname)) {
chmod($fname, 0777);
- copy($this->copieFile, $fname);
- } else {*/
- copy($this->copieFile, $fname);
- //}
-
- }
+ copy($this->copieFile, $fname);
+ } else {*/
+ copy($this->copieFile, $fname);
+ //}
+ }
}
?>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_modules.php 2013-05-12 11:37:11 UTC (rev 11533)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_modules.php 2013-05-12 12:45:33 UTC (rev 11534)
@@ -36,7 +36,7 @@
$this->initVar('mod_min_php',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_php'],false);
$this->initVar('mod_min_xoops',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_xoops'],false);
$this->initVar('mod_min_admin',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_admin'],false);
- $this->initVar('mod_min_db',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_db'],false);
+ $this->initVar('mod_min_mysql',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_mysql'],false);
$this->initVar('mod_description',XOBJ_DTYPE_TXTAREA, $GLOBALS['xoopsModuleConfig']['description'], false);
$this->initVar('mod_author',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['author'], false);
$this->initVar('mod_author_mail',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['author_email'],false);
@@ -82,11 +82,11 @@
$form->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULES_IMPORTANT.'</b></div>','head');
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_NAME, 'mod_name', 50, 255, $this->getVar('mod_name')), true);
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_VERSION, 'mod_version', 10, 25, $this->getVar('mod_version')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_VERSION, 'mod_version', 50, 255, $this->getVar('mod_version')), true);
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_PHP, 'mod_min_php', 10, 25, $this->getVar('mod_min_php')), true);
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_XOOPS, 'mod_min_xoops', 10, 25, $this->getVar('mod_min_xoops')), true);
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_ADMIN, 'mod_min_admin', 10, 25, $this->getVar('mod_min_admin')), true);
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_DB, 'mod_min_db', 10, 25, $this->getVar('mod_min_db')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_MYSQL, 'mod_min_mysql', 10, 25, $this->getVar('mod_min_mysql')), true);
// Name description
$editor_configs=array();
$editor_configs['name'] = 'mod_description'...
[truncated message content] |
|
From: <txm...@us...> - 2013-05-28 16:19:57
|
Revision: 11599
http://sourceforge.net/p/xoops/svn/11599
Author: txmodxoops
Date: 2013-05-28 16:19:53 +0000 (Tue, 28 May 2013)
Log Message:
-----------
solved little bugs
Updated
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_modules.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_about.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_index.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_menu.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_architecture.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_blocks.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_blocks_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_changelog.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_css_style.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_help_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_common.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_functions.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_functions_comments.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_install.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_jquery.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_notifications.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_search.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_js_jquery.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_languages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_main_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_modinfo_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_sql.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_admin_about.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_admin_help.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_index.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_user_comments.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_user_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_user_index.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_waiting.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/docs/credits.txt
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/docs/readme.txt
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/functions_const.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/help/help.html
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/admin_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/admin_header.php 2013-05-28 12:18:10 UTC (rev 11598)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/admin_header.php 2013-05-28 16:19:53 UTC (rev 11599)
@@ -20,17 +20,16 @@
*/
include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php';
include_once XOOPS_ROOT_PATH . '/include/cp_header.php';
-include_once("../include/functions.php");
+include_once('../include/functions.php');
include_once 'includes.php';
//
$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
//
-
-$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
-$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
+$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
+$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
-//load class
+// Get class handler
$modulesHandler =& xoops_getModuleHandler('tdmcreate_modules', 'TDMCreate');
$tablesHandler =& xoops_getModuleHandler('tdmcreate_tables', 'TDMCreate');
//
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-05-28 12:18:10 UTC (rev 11598)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-05-28 16:19:53 UTC (rev 11599)
@@ -28,18 +28,12 @@
}
$mod_name = strtolower($modules->getVar('mod_name'));
-$mod_desc = $modules->getVar('mod_description');
$mod_author_website_name = $modules->getVar('mod_author_website_name');
$mod_author_website_url = $modules->getVar('mod_author_website_url');
-$mod_image = $modules->getVar('mod_image');
-$mod_active_search = $modules->getVar('mod_search');
-$mod_active_comments = $modules->getVar('mod_comments');
-$mod_active_notifications = $modules->getVar('mod_notifications');
-$mod_paypal_button = $modules->getVar('mod_donations');
-$mod_subversion = $modules->getVar('mod_subversion');
+$mod_permissions = $modules->getVar('mod_permissions');
if (isset($_REQUEST['table_name'])) {
- $tables =& $tablesHandler->get(isset($_REQUEST['table_name']));
+ $tables =& $tablesHandler->get($_REQUEST['table_name']);
} else {
$tables =& $tablesHandler;
}
@@ -61,14 +55,14 @@
// Effacer repertoire of nouveau module s'il existe
TDMCreate_clearDir($modPath.'/modules/'.$mod_name);
// Debut
- OpenTable();
+ TDMCreate_OpenTable(_AM_TDMCREATE_BUILDING_FILES, _AM_TDMCREATE_BUILDING_OK, _AM_TDMCREATE_BUILDING_NOTOK);
/************************************************/
/*Structure*/
/************************************************/
//Creation of architecture
- const_architecture($mod_name, $mod_image);
+ const_architecture($modules);
//Creation of changelog.txt
- const_changelog($modules, $mod_name);
+ const_changelog($modules);
$result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix('tdmcreate_tables') . " WHERE table_name = 'mod_".$mod_name."_categories'");
list( $category ) = $xoopsDB->fetchRow($result);
@@ -85,15 +79,10 @@
$table_blocks = $tables_arr[$i]->getVar('table_blocks');
$table_admin = $tables_arr[$i]->getVar('table_admin');
$table_user = $tables_arr[$i]->getVar('table_user');
- if ($mod_active_search != 0) {
- $table_search = $tables_arr[$i]->getVar('table_search');
- }
- if ($mod_active_comments != 0) {
- $table_comments = $tables_arr[$i]->getVar('table_comments');
- }
- if ($mod_active_notifications != 0) {
- $table_notifications = $tables_arr[$i]->getVar('table_notifications');
- }
+ $table_search = $tables_arr[$i]->getVar('table_search');
+ $table_comments = $tables_arr[$i]->getVar('table_comments');
+ $table_notifications = $tables_arr[$i]->getVar('table_notifications');
+ $table_permissions = $tables_arr[$i]->getVar('table_permissions');
$table_waiting = $tables_arr[$i]->getVar('table_waiting');
// Fabrication
@@ -104,114 +93,116 @@
}
// Creation of classes
if ( $table_admin == 1 || $table_user == 1) {
- const_class($modules, $mod_name, $table_name, $table_fieldname, $category, $table_fields, $table_parameters, $category);
- }
- // Creation of permissions
- if ( $table_category == 1) {
- const_admin_permissions($modules, $mod_name, $table_name, $table_fieldname);
- }
+ const_class($modules, $table_name, $table_fieldname, $category, $table_fields, $table_parameters, $category);
+ }
// Creation of pages admin
if ( $table_admin == 1 ) {
- const_admin_pages($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters, $category);
+ const_admin_pages($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $category);
}
// Creation of pages and templates user
if ( $table_user == 1 && $table_name != null ) {
- const_user_pages($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters);
- const_templates_pages($modules, $mod_name, $table_name, $table_fieldname, $table_fields);
+ const_user_pages($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
+ const_templates_pages($modules, $table_name, $table_fieldname, $table_fields);
}
// Creation of search
- if ( isset($table_search) ) {
- const_include_search($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters, $table_image);
- }
- // Creation of comments
- if ( isset($table_comments) ) {
- const_include_comments($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters);
- }
+ if ( $table_search == 1 ) {
+ const_include_search($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $table_image);
+ }
// Creation of notifications
- if ( isset($table_notifications) ) {
- const_include_notifications($modules, $modules_name, $table_name, $table_fieldname);
+ if ( $table_notifications == 1 ) {
+ const_include_notifications($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
}
// Creation of the file mysql.sql
- const_sql($mod_name, $table_name, $table_fieldname, $category, $table_fields);
+ const_sql($modules, $table_name, $table_fieldname, $category, $table_fields);
// Creation of blocks
if ( $table_blocks == 1 ) {
- const_blocks($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters, $category);
+ const_blocks($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $category);
//Creation of template per blocks
- const_blocks_templates($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters);
+ const_blocks_templates($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
+ }
+ // Creation of admin permissions.php
+ if ( $table_permissions == 1) {
+ const_admin_permissions($modules, $table_name, $table_fields, $table_parameters);
}
}
//Creation of architecture of more fields and data
//const_architecture(null, null, $table_admin, $table_blocks, $table_admin, $table_blocks );
+ // Creation of comments
+ if ( $table_comments == 1 ) {
+ const_include_comments($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
+ }
if ( $table_waiting == 1 ) {
// Creation of Waiting Plugin
- const_waiting($modules, $mod_name, $tables_arr);
+ const_waiting($modules, $tables_arr);
}
// Creation of xoopsversion.php
- const_xoopsversion($modules, $mod_name, $table_name, $table_fields, $table_parameters, $tables_arr);
+ const_xoopsversion($modules, $table_name, $table_fields, $table_parameters, $tables_arr);
if ( $table_user == 1 && $table_name != null ) {
// Creation of template index
- const_templates_index($modules, $mod_name);
+ const_templates_index($modules);
// Creation of template header
- const_templates_header($modules, $mod_name, $tables_arr);
+ const_templates_header($modules, $tables_arr);
// Creation of template footer
- const_templates_footer($modules, $mod_name, $table_comments, $table_notifications);
+ const_templates_footer($modules, $table_comments, $table_notifications);
}
if ( $table_admin == 1 ) {
// Creation of template admin about
- const_templates_admin_about($modules, $mod_name);
+ const_templates_admin_about($modules);
// Creation of template admin help
- const_templates_admin_help($modules, $mod_name);
+ const_templates_admin_help($modules);
}
// Include
///////////////////////////////////////////////////////////////////////
// Configs
- const_include_common($modules, $mod_name, $mod_author_website_name, $mod_author_website_url);
+ const_include_common($modules, $mod_author_website_name, $mod_author_website_url);
// Functions
- const_include_functions($modules, $mod_name);
+ const_include_functions($modules);
//Creation of file install per l'uploads
- const_include_install($modules, $mod_name, $tables_arr);
+ const_include_install($modules, $tables_arr);
// Language
///////////////////////////////////////////////////////////////////////
if ( $table_user == 1 ) {
//Creation of language main.php
- const_main_language($modules, $mod_name, $mod_desc, $tables_arr);
+ const_main_language($modules, $tables_arr);
}
// Creation of language modinfo.php
- const_modinfo_language($modules, $mod_name, $mod_desc, $table_name, $table_image, $tables_arr, $category);
- // Creation of language admin.php
- const_admin_language($modules, $mod_name, $tables_arr, $category);
+ const_modinfo_language($modules, $table_name, $table_image, $tables_arr, $category);
+ if ( $table_admin == 1 ) {
+ // Creation of language admin.php
+ const_admin_language($modules, $tables_arr, $category);
+ }
if ( $table_blocks == 1 ) {
// Creation of language blocks.php
- const_blocks_language($modules, $mod_name, $tables_arr);
+ const_blocks_language($modules, $tables_arr);
}
// Creation of language help/help.html
- const_help_language($modules, $mod_name, $mod_desc);
+ const_help_language($modules);
///////////////////////////////////////////////////////////////////////
//Creation of style.css
- const_css_style($modules, $mod_name);
+ const_css_style($modules);
/************************************************/
/*Admin*/
/************************************************/
// Creation of admin header.php
- const_admin_header($modules, $mod_name, $tables_arr);
+ const_admin_header($modules, $tables_arr);
// Creation of admin index.php
- const_admin_index($modules, $mod_name, $table_name, $tables_arr);
+ const_admin_index($modules, $table_name, $tables_arr);
// Creation of admin footer.php
- const_admin_footer($modules, $mod_name, $tables_arr);
+ const_admin_footer($modules);
// Creation of admin menu.php
- const_admin_menu($modules, $mod_name, $tables_arr, $category);
+ const_admin_menu($modules, $tables_arr, $category);
// Creation of admin about.php
- const_admin_about($modules, $mod_name, $mod_paypal_button);
+ const_admin_about($modules);
/************************************************/
/*User*/
/************************************************/
if ( $table_user == 1 ) {
- const_user_header($modules, $mod_name);
- const_user_index($modules, $mod_name);
+ const_user_header($modules);
+ const_user_index($modules);
}
- CloseTable();
+ TDMCreate_CloseTable();
break;
case 'default':
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php 2013-05-28 12:18:10 UTC (rev 11598)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php 2013-05-28 16:19:53 UTC (rev 11599)
@@ -83,6 +83,8 @@
$obj->setVar('mod_search', $_REQUEST['mod_search']);
$obj->setVar('mod_comments', $_REQUEST['mod_comments']);
$obj->setVar('mod_notifications', $_REQUEST['mod_notifications']);
+ $obj->setVar('mod_permissions', $_REQUEST['mod_permissions']);
+ $obj->setVar('mod_install', $_REQUEST['mod_install']);
$obj->setVar('mod_donations', $_POST['mod_donations']);
$obj->setVar('mod_subversion', $_POST['mod_subversion']);
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-05-28 12:18:10 UTC (rev 11598)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-05-28 16:19:53 UTC (rev 11599)
@@ -21,7 +21,6 @@
include_once 'admin_header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
echo $adminMenu->addNavigation('tables.php');
-$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
switch ($op) {
case 'save_table':
if (isset($_REQUEST['table_id'])) {
@@ -50,6 +49,7 @@
$obj->setVar('table_search', 0);
$obj->setVar('table_comments', 0);
$obj->setVar('table_notifications', 0);
+ $obj->setVar('table_permissions', 0);
$obj->setVar('table_nbfields', 7);
$table_fields = 'cat_id:int:8:unsigned:NOT NULL: :primary|cat_pid:int:5:unsigned:NOT NULL:0:unique|cat_title:varchar:255: :NOT NULL: :unique|cat_desc:text: : :NOT NULL: :|cat_image:varchar:255: :NOT NULL: :|cat_weight:int:5:unsigned:NOT NULL:0:|cat_color:varchar:10: :NULL: :';
@@ -94,7 +94,8 @@
$obj->setVar('table_online', $_REQUEST['table_online']);
$obj->setVar('table_search', $_REQUEST['table_search']);
$obj->setVar('table_comments', $_REQUEST['table_comments']);
- $obj->setVar('table_notifications', $_REQUEST['table_notifications']);
+ $obj->setVar('table_notifications', $_REQUEST['table_notifications']);
+ $obj->setVar('table_permissions', $_REQUEST['table_permissions']);
$table_fields = '';
$table_parameters = '';
@@ -218,7 +219,8 @@
$obj->setVar('table_online', $_REQUEST['table_online']);
$obj->setVar('table_search', $_REQUEST['table_search']);
$obj->setVar('table_comments', $_REQUEST['table_comments']);
- $obj->setVar('table_notifications', $_REQUEST['table_notifications']);
+ $obj->setVar('table_notifications', $_REQUEST['table_notifications']);
+ $obj->setVar('table_permissions', $_REQUEST['table_permissions']);
$table_fields = $obj->getVar('table_fields');
$table_nbfields=$_REQUEST['table_nbfields'];
@@ -300,6 +302,8 @@
$table_search = (isset($_REQUEST['table_search'])) ? $_REQUEST['table_search'] : '0';
$table_comments = (isset($_REQUEST['table_comments'])) ? $_REQUEST['table_comments'] : '0';
$table_notifications = (isset($_REQUEST['table_notifications'])) ? $_REQUEST['table_notifications'] : '0';
+ $table_permissions = (isset($_REQUEST['table_permissions'])) ? $_REQUEST['table_permissions'] : '0';
+
$select = (isset($_REQUEST['select'])) ? $_REQUEST['select'] : '0';
//Image
@@ -329,7 +333,7 @@
if ($tablesHandler->insert($obj)) {
$table_id = $xoopsDB->getInsertId();
$obj = $tablesHandler->get($table_id);
- $form = $obj->getFormFields(false, $table_id, intval($_REQUEST['table_mid']), strtolower($_REQUEST['table_name']), strtolower($_REQUEST['table_fieldname']), $table_blocks, $table_display_admin, $table_display_user, $table_status, $table_waiting, $table_online, $table_search, $table_comments, $table_notifications, intval($_REQUEST['table_nbfields']), $select);
+ $form = $obj->getFormFields(false, $table_id, intval($_REQUEST['table_mid']), strtolower($_REQUEST['table_name']), strtolower($_REQUEST['table_fieldname']), $table_blocks, $table_display_admin, $table_display_user, $table_status, $table_waiting, $table_online, $table_search, $table_comments, $table_notifications, $table_permissions, intval($_REQUEST['table_nbfields']), $select);
}
} else {
redirect_header('tables.php', 2, _AM_TDMCREATE_TABLES_EXIST);
@@ -363,6 +367,9 @@
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW, 'tables.php?op=create_table', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW_CATEGORY, 'tables.php?op=create_category', 'add');
echo $adminMenu->renderButton();
+
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/style.css' );
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
// Remove unnecessary tables
$sql = "SELECT table_id FROM ".$xoopsDB->prefix("tdmcreate_tables")." WHERE table_mid = 0";
@@ -383,14 +390,14 @@
{
echo '<table width="100%" cellspacing="1" class="outer">';
echo '<tr>';
- echo '<th align="center" width="1%">'._AM_TDMCREATE_ID.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_NAME.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_IMAGE.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_DISPLAY_USER.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_BLOCKS.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_NB_FIELDS.'</th>';
- echo '<th align="center" width="1%">'._AM_TDMCREATE_FORMACTION.'</th>';
+ echo '<th class="center width1">'._AM_TDMCREATE_ID.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_NAME.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_IMAGE.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_DISPLAY_USER.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_BLOCKS.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_NB_FIELDS.'</th>';
+ echo '<th class="center width5">'._AM_TDMCREATE_FORMACTION.'</th>';
echo '</tr>';
$class = 'odd';
foreach (array_keys($mod_arr) as $i)
@@ -431,7 +438,7 @@
$table_user = (($table_arr[$i]->getVar('table_user') == 1) ? _YES : _NO);
$nb_fields = $table_arr[$i]->getVar('table_nbfields');
$blocks = ($table_blocks == 1) ? _YES : _NO;
- echo '<tr class="even center">';
+ echo '<tr class="even center toggleHidden">';
echo '<td class="center">'.$i.'</b></a></td>';
echo '<td class="left"> <b>- '.$table_name.'</b></a></td>';
if(file_exists($image = $pathIcon32.'/'.$table_image)) {
@@ -443,7 +450,7 @@
echo '<td>'.$table_user.'</td>';
echo '<td>'.$blocks.'</td>';
echo '<td>'.$nb_fields.'</td>';
- echo '<td>';
+ echo '<td class="width6">';
echo '<a href="tables.php?op=edit_table&table_id='.$i.'"><img src="'. $pathIcon16 .'/edit.png" alt="'._AM_TDMCREATE_FORMEDIT.'" title="'._AM_TDMCREATE_FORMEDIT.'"></a> <a href="tables.php?op=edit_fields&table_id='.$i.'"><img src="'. $pathIcon16 .'/inserttable.png" alt="'._AM_TDMCREATE_FORMFIELDS.'" title="'._AM_TDMCREATE_FORMFIELDS.'" /></a> <a href="tables.php?op=delete_table&table_id='.$i.'"><img src="'. $pathIcon16 .'/delete.png" alt="'._AM_TDMCREATE_FORMDEL.'" title="'._AM_TDMCREATE_FORMDEL.'"></a>';
echo '</td>';
echo '</tr>';
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_modules.php 2013-05-28 12:18:10 UTC (rev 11598)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_modules.php 2013-05-28 16:19:53 UTC (rev 11599)
@@ -61,7 +61,9 @@
$this->initVar('mod_user',XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['display_user'], false, 1);
$this->initVar('mod_search',XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_search'], false, 1);
$this->initVar('mod_comments',XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_comments'], false, 1);
- $this->initVar('mod_notifications', XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_notifications'], false, 1);
+ $this->initVar('mod_notifications', XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_notifications'], false, 1);
+ $this->initVar('mod_permissions', XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_permissions'], false, 1);
+ $this->initVar('mod_install', XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['inroot_install'], false, 1);
$this->initVar('mod_donations', XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['donations'], false, 50);
$this->initVar('mod_subversion', XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['subversion'], false, 10);
}
@@ -112,6 +114,12 @@
$mod_notifications = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_notifications'] : $this->getVar('mod_notifications');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_NOTIFICATIONS, 'mod_notifications', $mod_notifications, _YES, _NO));
+ $mod_permissions = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_permissions'] : $this->getVar('mod_permissions');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_PERMISSIONS, 'mod_permissions', $mod_permissions, _YES, _NO));
+
+ $mod_install = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['inroot_install'] : $this->getVar('mod_install');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_INROOT_INSTALL, 'mod_install', $mod_install, _YES, _NO));
+
$mod_image = $this->getVar('mod_image') ? $this->getVar('mod_image') : 'empty.png';
$uploadirectory = '/modules/'.$xoopsModule->dirname().'/images/uploads/modules';
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_tables.php 2013-05-28 12:18:10 UTC (rev 11598)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_tables.php 2013-05-28 16:19:53 UTC (rev 11599)
@@ -46,11 +46,12 @@
$this->initVar('table_search',XOBJ_DTYPE_INT,null,false, 1);
$this->initVar('table_comments',XOBJ_DTYPE_INT,null,false, 1);
$this->initVar('table_notifications',XOBJ_DTYPE_INT,null,false, 1);
+ $this->initVar('table_permissions',XOBJ_DTYPE_INT,null,false, 1);
}
//Formulaire de saisi de fields
- function getFormFields($action = false, $table_id, $table_mid, $table_name, $table_fieldname, $table_blocks, $table_admin, $table_user, $table_status, $table_waiting, $table_online, $table_search, $table_comments, $table_notifications, $table_nbfields, $select)
+ function getFormFields($action = false, $table_id, $table_mid, $table_name, $table_fieldname, $table_blocks, $table_admin, $table_user, $table_status, $table_waiting, $table_online, $table_search, $table_comments, $table_notifications, $table_permissions, $table_nbfields, $select)
{
global $xoopsDB, $xoopsModule, $xoopsModuleConfig;
if ($action === false) {
@@ -59,7 +60,7 @@
$class = 'even';
$title = $this->isNew() ? sprintf(_AM_TDMCREATE_TABLES_FIELDS_ADD) : sprintf(_AM_TDMCREATE_TABLES_FIELDS_EDIT);
- $table_actions = $table_mid.'&table_id='.$table_id.'&table_name='.$table_name.'&table_fieldname='.$table_fieldname.'&table_blocks='.$table_blocks.'&table_admin='.$table_admin.'&table_user='.$table_user.'&table_status='.$table_status.'&table_waiting='.$table_waiting.'&table_online='.$table_online.'&table_search='.$table_search.'&table_comments='.$table_comments.'&table_notifications='.$table_notifications.'&table_nbfields='.$table_nbfields.'&select='.$select;
+ $table_actions = $table_mid.'&table_id='.$table_id.'&table_name='.$table_name.'&table_fieldname='.$table_fieldname.'&table_blocks='.$table_blocks.'&table_admin='.$table_admin.'&table_user='.$table_user.'&table_status='.$table_status.'&table_waiting='.$table_waiting.'&table_online='.$table_online.'&table_search='.$table_search.'&table_comments='.$table_comments.'&table_notifications='.$table_notifications.'&table_permissions='.$table_permissions.'&table_nbfields='.$table_nbfields.'&select='.$select;
echo "<FORM Method='POST' Action='".$action."?op=save_table&table_mid=".$table_actions."'>
<table border='0' width='100%' cellspacing='1' class='outer'>
@@ -245,6 +246,7 @@
$table_search = $this->getVar('table_search');
$table_comments = $this->getVar('table_comments');
$table_notifications = $this->getVar('table_notifications');
+ $table_permissions = $this->getVar('table_permissi...
[truncated message content] |
|
From: <txm...@us...> - 2013-09-22 15:56:03
|
Revision: 12082
http://sourceforge.net/p/xoops/svn/12082
Author: txmodxoops
Date: 2013-09-22 15:55:58 +0000 (Sun, 22 Sep 2013)
Log Message:
-----------
Updated to Beta 2
Now forked on GitHub
https://github.com/txmodxoops/TDMCreate-v1.39-Beta2
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/includes.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_about.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_help.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_index.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_menu.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_architecture.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_blocks.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_blocks_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_changelog.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_css_style.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_help_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_common.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_functions.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_functions_comments.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_install.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_jquery.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_include_notifications.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_main_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_modinfo_language.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_sql.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_index.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_user_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_user_index.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/My Module_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/functions_const.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class_helper.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class_request.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/about.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/about.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -18,7 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: about.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include 'admin_header.php';
+include 'header.php';
echo $adminMenu->addNavigation('about.php');
echo $adminMenu->renderabout('6KJ7RW5DR3VTJ', false);
-include 'admin_footer.php';
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -18,7 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: building.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include 'admin_header.php';
+include 'header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
if (isset($_REQUEST['mod_name'])) {
@@ -30,6 +30,8 @@
$mod_name = strtolower($modules->getVar('mod_name'));
$mod_author_website_name = $modules->getVar('mod_author_website_name');
$mod_author_website_url = $modules->getVar('mod_author_website_url');
+$mod_user = $modules->getVar('mod_user');
+$mod_notifications = $modules->getVar('mod_notifications');
$mod_permissions = $modules->getVar('mod_permissions');
if (isset($_REQUEST['table_name'])) {
@@ -55,7 +57,7 @@
// Effacer repertoire of nouveau module s'il existe
TDMCreate_clearDir($modPath.'/modules/'.$mod_name);
// Debut
- TDMCreate_OpenTable(_AM_TDMCREATE_BUILDING_FILES, _AM_TDMCREATE_BUILDING_OK, _AM_TDMCREATE_BUILDING_NOTOK);
+ TDMCreate_OpenTable(_AM_TDMCREATE_BUILDING_FILES, _AM_TDMCREATE_BUILDING_SUCCESS, _AM_TDMCREATE_BUILDING_FAILED);
/************************************************/
/*Structure*/
/************************************************/
@@ -64,13 +66,13 @@
//Creation of changelog.txt
const_changelog($modules);
- $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix('tdmcreate_tables') . " WHERE table_name = 'mod_".$mod_name."_categories'");
+ $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix('mod_tdmcreate_tables') . " WHERE table_name = 'mod_".$mod_name."_categories'");
list( $category ) = $xoopsDB->fetchRow($result);
foreach (array_keys($tables_arr) as $i)
{
// Variables
- $table_name = $tables_arr[$i]->getVar('table_name');
+ $table_name = $tables_arr[$i]->getVar('table_name');
$table_fieldname = $tables_arr[$i]->getVar('table_fieldname');
$table_category = $tables_arr[$i]->getVar('table_category');
$table_fields = $tables_arr[$i]->getVar('table_fields');
@@ -86,14 +88,14 @@
$table_waiting = $tables_arr[$i]->getVar('table_waiting');
// Fabrication
- // Copy of images tables
+ // Copy of images tables
$table_image1 = $modPath . '/images/uploads/tables/' . $table_image;
if (file_exists($table_image1)) {
copy($table_image1, $modPath . '/modules/' . $mod_name . '/images/icons/32/' . $table_image);
}
// Creation of classes
if ( $table_admin == 1 || $table_user == 1) {
- const_class($modules, $table_name, $table_fieldname, $category, $table_fields, $table_parameters, $category);
+ const_class($modules, $table_name, $table_fieldname, $category, $table_fields, $table_parameters, $table_permissions, $category);
}
// Creation of pages admin
if ( $table_admin == 1 ) {
@@ -113,7 +115,7 @@
const_include_notifications($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
}
// Creation of the file mysql.sql
- const_sql($modules, $table_name, $table_fieldname, $category, $table_fields);
+ const_sql($modules, $table_name, $table_fieldname, $category, $table_fields);
// Creation of blocks
if ( $table_blocks == 1 ) {
@@ -125,8 +127,18 @@
if ( $table_permissions == 1) {
const_admin_permissions($modules, $table_name, $table_fields, $table_parameters);
}
- }
- //Creation of architecture of more fields and data
+ }
+ $table_name = isset($table_name) ? $table_name : null;
+ $table_comments = isset($table_comments) ? $table_comments : null;
+ $table_waiting = isset($table_waiting) ? $table_waiting : null;
+ $table_parameters = isset($table_parameters) ? $table_parameters : null;
+ $table_user = isset($table_user) ? $table_user : null;
+ $table_admin = isset($table_admin) ? $table_admin : null;
+ $table_fields = isset($table_fields) ? $table_fields : null;
+ $table_blocks = isset($table_blocks) ? $table_blocks : null;
+ $table_image = isset($table_image) ? $table_image : null;
+ $table_notifications = isset($table_notifications) ? $table_notifications : null;
+ //Creation of architecture of more fields and data
//const_architecture(null, null, $table_admin, $table_blocks, $table_admin, $table_blocks );
// Creation of comments
if ( $table_comments == 1 ) {
@@ -137,16 +149,20 @@
// Creation of Waiting Plugin
const_waiting($modules, $tables_arr);
}
+ // Creation of class helper & request
+ if ( $table_name != '' ) {
+ const_class_helper($modules);
+ const_class_request($modules);
+ }
// Creation of xoopsversion.php
- const_xoopsversion($modules, $table_name, $table_fields, $table_parameters, $tables_arr);
- if ( $table_user == 1 && $table_name != null ) {
- // Creation of template index
- const_templates_index($modules);
- // Creation of template header
- const_templates_header($modules, $tables_arr);
- // Creation of template footer
- const_templates_footer($modules, $table_comments, $table_notifications);
- }
+ const_xoopsversion($modules, $table_name, $table_fields, $table_parameters, $table_image, $tables_arr);
+ // Creation of template index
+ const_templates_index($modules);
+ // Creation of template header
+ const_templates_header($modules, $tables_arr);
+ // Creation of template footer
+ const_templates_footer($modules, $table_comments, $table_notifications);
+
if ( $table_admin == 1 ) {
// Creation of template admin about
const_templates_admin_about($modules);
@@ -163,15 +179,15 @@
const_include_install($modules, $tables_arr);
// Language
///////////////////////////////////////////////////////////////////////
- if ( $table_user == 1 ) {
+ if ( $mod_user == 1 ) {
//Creation of language main.php
const_main_language($modules, $tables_arr);
}
// Creation of language modinfo.php
- const_modinfo_language($modules, $table_name, $table_image, $tables_arr, $category);
+ const_modinfo_language($modules, $table_name, $table_image, $tables_arr, $mod_notifications);
if ( $table_admin == 1 ) {
// Creation of language admin.php
- const_admin_language($modules, $tables_arr, $category);
+ const_admin_language($modules, $tables_arr, $mod_permissions);
}
if ( $table_blocks == 1 ) {
// Creation of language blocks.php
@@ -186,19 +202,19 @@
/*Admin*/
/************************************************/
// Creation of admin header.php
- const_admin_header($modules, $tables_arr);
+ const_admin_header($modules, $table_name, $tables_arr);
// Creation of admin index.php
- const_admin_index($modules, $table_name, $tables_arr);
+ const_admin_index($modules, $tables_arr);
// Creation of admin footer.php
const_admin_footer($modules);
// Creation of admin menu.php
- const_admin_menu($modules, $tables_arr, $category);
+ const_admin_menu($modules, $tables_arr, $mod_permissions);
// Creation of admin about.php
const_admin_about($modules);
/************************************************/
/*User*/
/************************************************/
- if ( $table_user == 1 ) {
+ if ( $mod_user == 1 ) {
const_user_header($modules);
const_user_index($modules);
}
@@ -217,8 +233,8 @@
$form->addElement($mod_select, true);
$form->addElement(new XoopsFormHidden('op', 'build'));
- $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
+ $form->addElement(new XoopsFormButton(_REQUIRED.' <span class="red bold">*</span>', 'submit', _SUBMIT, 'submit'));
$form->display();
break;
}
-include 'admin_footer.php';
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/footer.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/footer.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -0,0 +1,26 @@
+<?php
+/*
+ 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 original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: footer.php 11084 2013-02-23 15:44:20Z timgno $
+ */
+echo "<div align='center'><a href='http://www.xoops.org' title='Visit XOOPS' target='_blank'>
+ <img src='".$pathIcon32."/xoopsmicrobutton.gif' alt='XOOPS' /></a></div>";
+echo "<div class='center smallsmall italic pad5'>
+ <strong>" . $xoopsModule->getVar('name') . "</strong> is maintained by the
+ <a href='http://xoops.org/forums/newbb' title='Visit Support Forum' class='tooltip' rel='external'>Support Forum</a></div>";
+xoops_cp_footer();
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/header.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/header.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -0,0 +1,54 @@
+<?php
+/*
+ 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 original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: header.php 11084 2013-02-23 15:44:20Z timgno $
+ */
+include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
+include_once('../include/functions.php');
+include_once 'includes.php';
+//
+$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
+//
+$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
+$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
+$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
+
+// Get class handler
+$modulesHandler =& xoops_getModuleHandler('modules', $thisDirname);
+$tablesHandler =& xoops_getModuleHandler('tables', $thisDirname);
+//
+$myts =& MyTextSanitizer::getInstance();
+if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
+ include_once(XOOPS_ROOT_PATH."/class/template.php");
+ $xoopsTpl = new XoopsTpl();
+}
+//
+$GLOBALS['xoopsTpl']->assign('pathIcon16', $pathIcon16);
+$GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
+//Load languages
+xoops_loadLanguage('admin', $thisDirname);
+xoops_loadLanguage('modinfo', $thisDirname);
+xoops_loadLanguage('main', $thisDirname);
+// Locad admin menu class
+if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){
+ include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
+}else{
+ redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
+}
+xoops_cp_header();
+$adminMenu = new ModuleAdmin();
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/includes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/includes.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/includes.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -39,6 +39,8 @@
include_once $cPath.'/const_blocks.php';
include_once $cPath.'/const_blocks_templates.php';
include_once $cPath.'/const_class.php';
+include_once $cPath.'/const_class_helper.php';
+include_once $cPath.'/const_class_request.php';
include_once $cPath.'/const_admin_header.php';
include_once $cPath.'/const_admin_footer.php';
include_once $cPath.'/const_admin_menu.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/index.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/index.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -1,33 +1,32 @@
<?php
+/*
+ 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 original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
/**
- * ****************************************************************************
- * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS
- * - Licence GPL Copyright (c) (http://www.tdmxoops.net)
+ * tdmcreate module
*
- * Cette licence, contient des limitations!!!
- *
- * 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 original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @license TDM GPL license
- * @author TDM TEAM DEV MODULE
- *
- * ****************************************************************************
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: index.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include 'admin_header.php';
+include 'header.php';
$criteria = new CriteriaCompo();
$count_modules = $modulesHandler->getCount($criteria);
$count_tables = $tablesHandler->getCount($criteria);
$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ;
-$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, "<label>" ._AM_TDMCREATE_THEREARE_NUMMODULES. "</label>", $count_modules, 'Green') ;
-$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, "<label>" ._AM_TDMCREATE_THEREARE_NUMTABLES. "</label>", $count_tables, 'Orange');
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMMODULES. '</label>', $count_modules, 'Green') ;
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMTABLES. '</label>', $count_tables, 'Orange');
echo $adminMenu->addNavigation('index.php');
echo $adminMenu->renderIndex();
-
-include "admin_footer.php";
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/modules.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -18,12 +18,12 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: modules.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include_once 'admin_header.php';
+include_once 'header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'list', 'string' );
echo $adminMenu->addNavigation('modules.php');
switch ($op)
{
- case "save":
+ case 'save':
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
@@ -33,28 +33,30 @@
} else {
$obj =& $modulesHandler->create();
}
- //Image
+ //Image 'gif|jpeg|pjpeg|png' 500000
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
- $uploaddir = XOOPS_ROOT_PATH . "/modules/".$xoopsModule->dirname()."/images/uploads/modules/";
- $uploader = new XoopsMediaUploader($uploaddir, "gif|jpeg|pjpeg|png", 104857600, null, null);
+ $uploaddir = XOOPS_ROOT_PATH . '/modules/'.$xoopsModule->dirname().'/images/uploads/modules/';
+ $uploader = new XoopsMediaUploader($uploaddir, xoops_getModuleOption('mimetypes', $thisDirname),
+ xoops_getModuleOption('maxsize', $thisDirname), null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["attachedfile"]['name']) ;
- $name_img = $_REQUEST['mod_name'].'_slogo.'.$extension;
- $uploader->setTargetFileName($name_img);
+ $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']) ;
+ $img_name = $obj->getVar('mod_name').'_slogo.'.$extension;
+ $uploader->setTargetFileName($img_name);
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
$errors = $uploader->getErrors();
- redirect_header("javascript:history.go(-1)",3, $errors);
+ redirect_header('javascript:history.go(-1)', 3, $errors);
} else {
$obj->setVar('mod_image', $uploader->getSavedFileName());
}
} else {
$obj->setVar('mod_image', $_POST['mod_image']);
}
- //remove all spaces from the new name
- $obj->setVar('mod_name', preg_replace('/\s+/', '', $_POST['mod_name']));
+
+ $obj->setVar('mod_name', preg_replace('/\s+/', '', $_POST['mod_name'])); //remove all spaces from the new name
$obj->setVar('mod_version', $_POST['mod_version']);
+ $obj->setVar('mod_since', $_POST['mod_since']);
$obj->setVar('mod_min_php', $_POST['mod_min_php']);
$obj->setVar('mod_min_xoops', $_POST['mod_min_xoops']);
$obj->setVar('mod_min_admin', $_POST['mod_min_admin']);
@@ -93,18 +95,18 @@
}
break;
- case "new":
+ case 'new':
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php?op=list', 'list');
echo $adminMenu->renderButton();
$obj =& $modulesHandler->create();
$form = $obj->getForm();
break;
- case "edit":
+ case 'edit':
$obj =& $modulesHandler->get($_REQUEST['mod_id']);
$form = $obj->getForm();
break;
- case "delete":
+ case 'delete':
$obj =& $modulesHandler->get($_REQUEST['mod_id']);
if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1)
{
@@ -121,7 +123,7 @@
xoops_confirm(array('ok' => 1, 'mod_id' => $_REQUEST['mod_id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('mod_name')));
}
break;
- case "list":
+ case 'list':
default:
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_NEW, 'modules.php?op=new', 'add');
echo $adminMenu->renderButton();
@@ -181,4 +183,4 @@
}
break;
}
-include_once "admin_footer.php";
\ No newline at end of file
+include_once 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -18,7 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: tables.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include_once 'admin_header.php';
+include_once 'header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
echo $adminMenu->addNavigation('tables.php');
switch ($op) {
@@ -190,7 +190,7 @@
$uploader = new XoopsMediaUploader($uploaddir, 'gif|jpeg|pjpeg|png', 104857600, null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']) ;
+ $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']);
$name_img = $_REQUEST['table_name'].'.'.$extension;
$uploader->setTargetFileName($name_img);
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
@@ -247,8 +247,10 @@
break;
case "edit_table":
- $obj =& $tablesHandler->get($_REQUEST['table_id']);
- $form = $obj->getFormTable();
+ $table_id = TDMCreate_CleanVars( $_REQUEST, 'table_id', 0);
+ $table_mid = TDMCreate_CleanVars( $_REQUEST, 'table_mid', 0);
+ $obj =& $tablesHandler->get($table_id);
+ $form = $obj->getFormTable(false, $table_mid);
break;
case "edit_fields":
@@ -344,13 +346,14 @@
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW_CATEGORY, 'tables.php?op=create_category', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=table_list', 'list');
echo $adminMenu->renderButton();
-
+
+ $table_mid = TDMCreate_CleanVars( $_REQUEST, 'table_mid', 0);
$obj =& $tablesHandler->create();
- $form = $obj->getFormTable();
+ $form = $obj->getFormTable(false, $table_mid);
break;
- case "create_category":
- $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW, 'tables.php?op=create_table', 'add');
+ case "create_category":
+ $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW, 'tables.php?op=create_table', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=table_list', 'list');
echo $adminMenu->renderButton();
@@ -363,7 +366,7 @@
break;
case "table_list":
- default:
+ default:
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW, 'tables.php?op=create_table', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW_CATEGORY, 'tables.php?op=create_category', 'add');
echo $adminMenu->renderButton();
@@ -474,4 +477,4 @@
}
break;
}
-include 'admin_footer.php';
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_about.php 2013-09-21 22:06:53 UTC (rev 12081)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_about.php 2013-09-22 15:55:58 UTC (rev 12082)
@@ -25,11 +25,13 @@
$file = 'about.php';
$tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
$root_path = XOOPS_URL.'/modules/'.$mod_name.'/admin/'.$file;
- $text = '<?php'.const_header($modules, $file).'
-include \'header.php\';
-echo $adminMenu->addNavigation(\'about.php\');
-echo $adminMenu->renderabout(\''.$modules->getVar('mod_donations').'\', false);
-include \'footer.php\';';
+ $text = '<?php'.const_header($modules, $file);
+$text .= <<<EOT
+\ninclude 'header.php';
+echo \$adminMenu->addNavigation('about.php');
+echo \$adminMenu->renderAbout('{$modules->getVar('mod_do...
[truncated message content] |
|
From: <txm...@us...> - 2013-09-29 09:28:45
|
Revision: 12105
http://sourceforge.net/p/xoops/svn/12105
Author: txmodxoops
Date: 2013-09-29 09:28:39 +0000 (Sun, 29 Sep 2013)
Log Message:
-----------
Updated
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/functions_const.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-09-28 21:37:53 UTC (rev 12104)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-09-29 09:28:39 UTC (rev 12105)
@@ -104,12 +104,16 @@
// Creation of pages and templates user
if ( $table_user == 1 && $table_name != null ) {
const_user_pages($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
- const_templates_pages($modules, $table_name, $table_fieldname, $table_fields);
+ const_templates_pages($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
}
// Creation of search
if ( $table_search == 1 ) {
const_include_search($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $table_image);
- }
+ }
+ // Creation of admin permissions.php
+ if ( $table_permissions == 1) {
+ const_admin_permissions($modules, $table_name, $table_fields, $table_parameters);
+ }
// Creation of notifications
if ( $table_notifications == 1 ) {
const_include_notifications($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
@@ -122,11 +126,7 @@
const_blocks($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $category);
//Creation of template per blocks
const_blocks_templates($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
- }
- // Creation of admin permissions.php
- if ( $table_permissions == 1) {
- const_admin_permissions($modules, $table_name, $table_fields, $table_parameters);
- }
+ }
}
$table_name = isset($table_name) ? $table_name : null;
$table_comments = isset($table_comments) ? $table_comments : null;
@@ -137,14 +137,15 @@
$table_fields = isset($table_fields) ? $table_fields : null;
$table_blocks = isset($table_blocks) ? $table_blocks : null;
$table_image = isset($table_image) ? $table_image : null;
+ $table_permissions = isset($table_permissions) ? $table_permissions : null;
$table_notifications = isset($table_notifications) ? $table_notifications : null;
//Creation of architecture of more fields and data
//const_architecture(null, null, $table_admin, $table_blocks, $table_admin, $table_blocks );
// Creation of comments
if ( $table_comments == 1 ) {
const_include_comments($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
- }
-
+ }
+
if ( $table_waiting == 1 ) {
// Creation of Waiting Plugin
const_waiting($modules, $tables_arr);
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-09-28 21:37:53 UTC (rev 12104)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-09-29 09:28:39 UTC (rev 12105)
@@ -20,6 +20,7 @@
*/
include_once 'header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
+$table_id = TDMCreate_CleanVars( $_REQUEST, 'table_id', 0 );
echo $adminMenu->addNavigation('tables.php');
switch ($op) {
case 'save_table':
@@ -357,7 +358,7 @@
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=table_list', 'list');
echo $adminMenu->renderButton();
- $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix("tdmcreate_tables")." WHERE table_name = 'categories'");
+ $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix("mod_tdmcreate_tables")." WHERE table_name = 'categories'");
list( $category ) = $xoopsDB->fetchRow($result);
$obj =& $tablesHandler->get($_REQUEST['table_id']);
if ( $category >= 0 ) {
@@ -375,19 +376,24 @@
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
// Remove unnecessary tables
- $sql = "SELECT table_id FROM ".$xoopsDB->prefix("tdmcreate_tables")." WHERE table_mid = 0";
+ /*$sql = "SELECT table_id FROM ".$xoopsDB->prefix("mod_tdmcreate_tables")." WHERE table_mid = 0";
$result = $xoopsDB->queryF($sql);
while ( $myrow = $xoopsDB->fetchArray($result) )
{
- $sql_del = "DELETE FROM ".$xoopsDB->prefix("tdmcreate_tables")." WHERE table_id = ".$myrow['table_id']."";
+ $sql_del = "DELETE FROM ".$xoopsDB->prefix("mod_tdmcreate_tables")." WHERE table_id = ".$myrow['table_id']."";
$xoopsDB->queryF($sql_del);
+ }*/
+ $obj =& $tablesHandler->get($table_id);
+ if ($tablesHandler->deleteAll($obj)) {
+ redirect_header('tables.php', 3, _AM_TDMCREATE_FORMDELOK);
}
$criteria = new CriteriaCompo();
+ $criteria->add( new Criteria('mod_id', 0, '!=') );
$criteria->setSort('mod_id');
$criteria->setOrder('ASC');
- $mod_arr = $modulesHandler->getall($criteria);
- $numrows_modules = $modulesHandler->getCount();
+ $mod_arr = $modulesHandler->getAll($criteria);
+ $numrows_modules = $modulesHandler->getCount($criteria);
if ( $numrows_modules > 0 )
{
@@ -472,7 +478,7 @@
echo '<th width="10%">'._AM_TDMCREATE_BLOCKS.'</th>';
echo '<th width="10%">'._AM_TDMCREATE_NB_FIELDS.'</th>';
echo '<th width="1%">'._AM_TDMCREATE_FORMACTION.'</th>';
- echo '<tr><td class="errorMsg" colspan="8">No modules</td></tr>';
+ echo '<tr><td class="errorMsg" colspan="8">There are no modules</td></tr>';
echo '</tr></table><br><br>';
}
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php 2013-09-28 21:37:53 UTC (rev 12104)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php 2013-09-29 09:28:39 UTC (rev 12105)
@@ -88,7 +88,7 @@
\$numrows = \${$table_name}Handler->getCount();
\${$table_name}_arr = \${$table_name}Handler->getAll(\$criteria);
EOT;
- $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 0);
+ $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $fpmf, $language, '', 0);
if ( $table_category != 1 )
{
$text .= <<<EOT
@@ -110,7 +110,7 @@
echo "<tr class='".\$class."'>";
\$class = (\$class == "even") ? "odd" : "even";\n
EOT;
- $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 1);
+ $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $fpmf, $language, '', 1);
$text .= $fields_data;
$text .= <<<EOT
@@ -148,7 +148,7 @@
\$cat_weight = \$categories_arr[\$i]->getVar('cat_weight');
echo "<tr class='".\$class."'>";\n
EOT;
- $text .= const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 1);
+ $text .= const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $fpmf, $language, '', 1);
$text .= <<<EOT
\n\t\t\t\t\techo "<td class='center width5'>
<a href='{$table_name}.php?op=edit&{$field_id}=".\$i"'><img src=".\$sysPathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a>
@@ -175,7 +175,7 @@
echo "<table width='100%' cellspacing='1' class='outer'>
<tr>
EOT;
- $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 0);
+ $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $fpmf, $language, '', 0);
$text .= $fcn;
$text .= <<<EOT
\n\t\t\t\t\t<th class='center width5'>".{$language}_FORMACTION."</th>
@@ -192,7 +192,7 @@
\$category_weight = \${$table_name}_arr[\$i]->getVar('{$table_fieldname}_weight');
echo "<tr class='".\$class."'>";\n
EOT;
- $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, 1, 1);
+ $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $fpmf, $language, 1, 1);
$text .= $fields_data;
$text .= <<<EOT
@@ -220,7 +220,7 @@
echo "<table width='100%' cellspacing='1' class='outer'>
<tr>
EOT;
- $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 0);
+ $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $fpmf, $language, '', 0);
$text .= $fcn;
$text .= <<<EOT
\n\t\t\t\t\t<th class='center width5'>".{$language}_FORMACTION."</th>
@@ -252,7 +252,7 @@
\$obj =& \${$table_name}Handler->create();
}
EOT;
- $text .= const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 2);
+ $text .= const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $fpmf, $language, '', 2);
$text .= <<<EOT
\n\t\tif (\${$table_name}Handler->insert(\$obj)) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php 2013-09-28 21:37:53 UTC (rev 12104)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php 2013-09-29 09:28:39 UTC (rev 12105)
@@ -168,7 +168,6 @@
}
}
EOT;
-
createFile( $tdmcreate_path, $text,
_AM_TDMCREATE_CONST_OK_CLASSES,
_AM_TDMCREATE_CONST_NOTOK_CLASSES, $file);
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_header.php 2013-09-28 21:37:53 UTC (rev 12104)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_header.php 2013-09-29 09:28:39 UTC (rev 12105)
@@ -22,7 +22,8 @@
{
$mod_name = $module->getVar('mod_name');
$mod_version = $module->getVar('mod_version');
- $mod_min_xoops = $module->getVar('mod_min_xoops');
+ $mod_since = $module->getVar('mod_since');
+ //$mod_min_xoops = $module->getVar('mod_min_xoops');
$mod_author = $module->getVar('mod_author');
$mod_credits = $module->getVar('mod_credits');
$mod_a_m = $module->getVar('mod_author_mail');
@@ -47,11 +48,10 @@
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license {$mod_license}
* @package {$mod_name}
- * @since {$mod_min_xoops}
+ * @since {$mod_since}
* @author {$mod_author} <{$mod_a_m}> - <{$mod_a_w_url}>
* @version \$Id: {$mod_version} {$filename} {$mod_subversion} {$date}Z {$mod_credits} \$
*/
-EOT
-;
+EOT;
return $text;
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_pages.php 2013-09-28 21:37:53 UTC (rev 12104)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_pages.php 2013-09-29 09:28:39 UTC (rev 12105)
@@ -19,7 +19,7 @@
* @version $Id: const_templates_pages.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_templates_pages($modules, $table_name, $table_fieldname, $table_fields)
+function const_templates_pages($modules, $table_name, $table_fieldname, $table_fields, $table_parameters)
{
$mod_name = $modules->getVar('mod_name');
$language = '_MA_'.strtoupper($mod_name).'_';
@@ -29,32 +29,64 @@
//fields
$fields = explode('|', $table_fields);
$nb_fields = count($fields);
+ //parameters
+ $parameters_total = explode('|', $table_parameters);
+ //Recuperation des parameters affichage dans le formulaire
+ for($i=0; $i<$nb_fields; $i++)
+ {
+ $fields_list = explode(':', $fields[$i]);
+ //$fields[$i] = $fields1[0];
+ //Afficher dans les elements du formulaire et choisir le type
+ if( $i == 0 ) {
+ $fpe[$i] = '0';
+ $fpdf[$i] = '0';
+ $fpif = $fields_list[0]; // fpif = fields parameters auto_increment field
+ } else {
+ $param = explode(':', $parameters_total[$i-1]);
+ //print_r($param);
+ $fpdf[$i] = $param[3]; // fpdf = fields parameters display form
+ $fpe[$i] = $param[0]; // fpe = fields parameters elements
+ $fprf[$i] = $param[6]; // fprf = fields parameters required field
+ if ( $param[4] == 1 ) {
+ $fpmf = $fields_list[0]; // fpmf = fields parameters main field
+ }
+ }
+ }
+
$text = '<{include file="db:'.$mod_name.'_header.html"}>';
if($table_name != null)
{
$text .= '
<div class="outer">
- <table class="'.$mod_name.'" cellpadding="0" cellspacing="0" width="100%">
+ <table class="'.$table_name.'" cellpadding="0" cellspacing="0" width="100%">
<tr class="head">
';
for ($i = 0; $i < $nb_fields; $i++)
{
$structure_fields = explode(':', $fields[$i]);
-$text .= ' <th class="fields"><{$smarty.const.'.$language.strtoupper($structure_fields[0]).'}></th>
- ';
+$text .= ' <th class="center"><{$smarty.const.'.$language.strtoupper($structure_fields[0]).'}></th>
+ ';
}
$text .= '</tr>
<{foreach item='.$table_fieldname.' from=$'.$table_name.'}>
- <tr class="<{cycle values=\'odd, even\'}>">
-';
+ <tr class="<{cycle values=\'odd, even\'}>">
+ ';
for ($i = 0; $i < $nb_fields; $i++)
{
- $structure_fields = explode(':', $fields[$i]);
-$text .= ' <td class="fields"><{$'.$table_fieldname.'.'.$structure_fields[0].'}></td>
- ';
+ $structure_fields = explode(':', $fields[$i]);
+ if( $fpe[$i] == 'XoopsFormUploadImage' ) {
+$text .= ' <td class="center"><img src="<{$xoops_url}>/uploads/'.$mod_name.'/images/'.$table_name.'/<{$'.$table_fieldname.'.'.$structure_fields[0].'}>" alt="'.$table_name.'"></td>
+ ';
+ } else if( $fpe[$i] == 'XoopsFormColorPicker' ) {
+$text .= ' <td class="center"><span style="background-color: <{$'.$table_fieldname.'.'.$structure_fields[0].'}>;"> </span></td>
+ ';
+ } else {
+$text .= ' <td class="center"><{$'.$table_fieldname.'.'.$structure_fields[0].'}></td>
+ ';
+ }
}
-$text .= ' </tr>
+$text .= '</tr>
<{/foreach}>
</table>
</div>';
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/functions_const.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/functions_const.php 2013-09-28 21:37:53 UTC (rev 12104)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/functions_const.php 2013-09-29 09:28:39 UTC (rev 12105)
@@ -185,10 +185,10 @@
for ($i=0; $i < $j; $i++)
{
if ( $i != $j - 1 ) {
- $key .= ''.$comma[$i].',
+ $key .= $comma[$i].',
';
} else {
- $key .= ''.$comma[$i].'
+ $key .= $comma[$i].'
';
}
}
@@ -200,10 +200,10 @@
}
//
-function const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $fields_id, $nb_fields, $fields, $fpda, $fields_param_type, $lng, $prefix = '', $option = 0)
+function const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $fields_id, $nb_fields, $fields, $fpda, $fpt, $fpmf, $lng, $prefix = '', $option = 0)
{
$text = '';
-
+
if ( $option == 0 ) {
// Name column of the table
for($i = 0; $i < $nb_fields; $i++)
@@ -230,53 +230,51 @@
} else {
echo "<td class=\'center\'><a href=\'./'.$table_name.'.php?op=update_online&'.$fields_id.'=".$'.$table_name.'_arr[$i]->getVar("'.$fields_id.'")."&'.$table_fieldname.'_online=1\'><img src=".$pathIcon16."/off.png border=\'0\' alt=\'"._OFF."\' title=\'"._OFF."\'></a></td>";
}'; }
- } else if ( $fields[$i] == $table_fieldname.'_title' ) {
+ } else if ( $fields[$i] == $fpmf ) {
if ( $prefix != '' ) {
$text .= 'echo "<td class=\'left\'> ".$prefix." ".$'.$table_name.'_arr[$i]->getVar(\''.$fields[$i].'\')."</td>";
';
} else {
$text .= 'echo "<td class=\'left\'><img src=\'".'.strtoupper($mod_name).'_URL."/images/icons/16/arrow.gif\'> ".$'.$table_name.'_arr[$i]->getVar(\''.$fields[$i].'\')."</td>";
';
- }
-
- } else if ( $fields_param_type[$i] == 'XoopsFormUploadImage' ) {
- $text .= '$'.$table_fieldname.'_image = $'.$table_name.'_arr[$i]->getVar(\''.$fields[$i].'\');
- if(file_exists($image = XOOPS_UPLOAD_URL."/'.$mod_name.'/images/'.$table_name.'/".$'.$table_fieldname.'_image)) {
- echo "<td class=\'center\'><img src=\'".$image."\' height=\'30px\' alt=\''.$fields[$i].'\'></td>";
- } else {
- echo "<td class=\'center\'><img src=\'../images/'.$table_name.'/".$'.$table_fieldname.'_image."\' height=\'30px\' alt=\''.$fields[$i].'\'></td>";
}
+ } else if ( $fpt[$i] == 'XoopsFormUploadImage' ) {
+ $text .= '$image = XOOPS_UPLOAD_URL."/'.$mod_name.'/images/'.$table_name.'/".$'.$table_name.'_arr[$i]->getVar(\''.$fields[$i].'\');
+ echo "<td class=\'center\'><img src=\'".$image."\' height=\'30px\' alt=\''.$fields[$i].'\'></td>";
';
- } else if ( $fields_param_type[$i] == 'XoopsFormUploadFile' )
+ } else if ( $fpt[$i] == 'XoopsFormUploadFile' )
{
$text .= 'echo "<td class=\'center\'>".$'.$table_name.'_arr[$i]->getVar(\''.$fields[$i].'\')."</td>";
';
- } else if ( $fields_param_type[$i] == 'XoopsFormColorPicker' )
+ } else if ( $fpt[$i] == 'XoopsFormColorPicker' )
{
$text .= 'echo "<td class=\'center\'><span style=\'background-color:".$'.$table_name.'_arr[$i]->getVar(\''.$fields[$i].'\')."\'> </span> -> ".$'.$table_name.'_arr[$i]->getVar(\''.$fields[$i].'\')."</td>";
';
- } else if ( $fields_param_type[$i] == 'XoopsFormTextDateSelect' )
+ } else if ( $fpt[$i] == 'XoopsFormTextDateSelect' )
{
$text .= 'echo "<td class=\'center\'>".formatTimeStamp($'.$table_name.'_arr[$i]->getVar(\''.$fields[$i].'\'),"S")."</td>";
';
- } else if ( $fields_param_type[$i] == 'XoopsFormCategory' )
+ } else if ( $fpt[$i] == 'XoopsFormCategory' )
{
$text .= '$'.$table_fieldname.'1 = $categoriesHandler->get($'.$table_name.'_arr[$i]->getVar(\''.$fields[$i].'\'));
$'.$table_fieldname.'_categories1 = $'.$table_fieldname.'1->getVar(\''.$table_fieldname.'_title\');
echo "<td class=\'center\'>".$'.$table_fieldname.'_categories1."</td>";
';
- } else if ( $fields_param_type[$i] == 'XoopsFormSelectUser' )
+ } else if ( $fpt[$i] == 'XoopsFormSelectUser' )
{
$text .= 'echo "<td class=\'center\'>".XoopsUser::getUnameFromId($'.$table_name.'_arr[$i]->getVar(\''.$fields[$i].'\'),"S")."</td>";
';
- } else if ( $fields_param_type[$i] == 'XoopsFormText' || $fields_param_type[$i] == 'XoopsFormDhtmlTextArea' || $fields_param_type[$i] == 'XoopsFormTextArea' ) {
+ } else if ( $fpt[$i] == 'XoopsFormText' ) {
+ $text .= 'echo "<td class=\'center\'>".$'.$table_name.'_arr[$i]->getVar(\''.$fields[$i].'\')."</td>";
+ ';
+ } else if ( $fpt[$i] == 'XoopsFormDhtmlTextArea' || $fpt[$i] == 'XoopsFormTextArea' ) {
$text .= 'echo "<td class=\'center\'>".strip_tags($'.$table_name.'_arr[$i]->getVar(\''.$fields[$i].'\'))."</td>";
';
- } else if ( $fields_param_type[$i] == 'XoopsFormCheckBox' || $fields_param_type[$i] == 'XoopsFormRadioYN' ) {
+ } else if ( $fpt[$i] == 'XoopsFormCheckBox' || $fpt[$i] == 'XoopsFormRadioYN' ) {
$text .= 'echo "<td class=\'center\'>".( ($'.$table_name.'_arr[$i]->getVar(\''.$fields[$i].'\') == 1 ) ? _YES : _NO)."</td>";
';
} else {
- $data = explode("-", $fields_param_type[$i]);
+ $data = explode("-", $fpt[$i]);
// Handler select table
$tablesHandler =& xoops_getModuleHandler('tables', 'TDMCreate');
$criteria = new CriteriaCompo();
@@ -289,21 +287,21 @@
$tables_select_parameters = $tables_select_arr[$k]->getVar('table_parameters');
// Fields
- $fields_total_select = explode("|", $tables_select_fields);
+ $fields_total_select = explode('|', $tables_select_fields);
$nb_fields_select = count($fields_total_select);
// Parameters
- $parameters_total_select = explode("|", $tables_select_parameters);
+ $parameters_total_select = explode('|', $tables_select_parameters);
// Recovery fields names
for($l = 0; $l < $nb_fields_select; $l++)
{
// Fields names
- $fields_select1 = explode(":", $fields_total_select[$l]);
+ $fields_select1 = explode(':', $fields_total_select[$l]);
$fields_select[$l] = $fields_select1[0];
// Show in admin
if( $l != 0 ) {
- $parameters_select = explode(":", $parameters_total_select[$l-1]);
+ $parameters_select = explode(':', $parameters_total_select[$l-1]);
if ( $parameters_select[4] == 1 ) {
$fields_param_main_field = $fields_select1[0];
}
@@ -326,14 +324,14 @@
{
if ( $i != 0 )
{
- if ( $fields_param_type[$i] == 'XoopsFormTextDateSelect' )
+ if ( $fpt[$i] == 'XoopsFormTextDateSelect' )
{
$text .= '
$obj->setVar(\''.$fields[$i].'\', strtotime($_REQUEST[\''.$fields[$i].'\']));';
- } else if ( $fields_param_type[$i] == 'XoopsFormCheckBox' || $fields_param_type[$i] == 'XoopsFormRadioYN' ) {
+ } else if ( $fpt[$i] == 'XoopsFormCheckBox' || $fpt[$i] == 'XoopsFormRadioYN' ) {
$text .= '
$obj->setVar(\''.$fields[$i].'\', (($_REQUEST[\''.$fields[$i].'\'] == 1) ? \'1\' : \'0\'));';
- } else if ( $fields_param_type[$i] == 'XoopsFormUploadImage' ) {
+ } else if ( $fpt[$i] == 'XoopsFormUploadImage' ) {
$text .= '
include_once XOOPS_ROOT_PATH.\'/class/uploader.php\';
@@ -353,7 +351,7 @@
$obj->setVar(\''.$fields[$i].'\', $_REQUEST[\''.$fields[$i].'\']);
}
';
- } else if ( $fields_param_type[$i] == 'XoopsFormUploadFile' ) {
+ } else if ( $fpt[$i] == 'XoopsFormUploadFile' ) {
$text .= '
include_once XOOPS_ROOT_PATH.\'/class/uploader.php\';
$uploaddir = XOOPS_UPLOAD_PATH.\'/'.$mod_name.'/files/'.$table_name.'/\';
@@ -500,6 +498,7 @@
break;
case "default":
+ case "XoopsFormTables-".$table_name:
default:
$data = explode('-', $fpe[$i]);
$text .= '// '.ucfirst($struct0).'
@@ -513,16 +512,17 @@
return $text;
}
-function search_field($fields_param_search_field, $options)
+function search_field($fpsf, $options)
{
- $nb_fields_param_search_field = count($fields_param_search_field);
+ // fpsf = fields parameters search field
+ $nb_fpsf = count($fpsf);
$sql = '(';
- for($l=0; $l<$nb_fields_param_search_field; $l++)
+ for($l=0; $l<$nb_fpsf; $l++)
{
- if ( $l != $nb_fields_param_search_field - 1 ) {
- $sql .= ''.$fields_param_search_field[$l].' LIKE \'%$queryarray['.$options.']%\' OR ';
+ if ( $l != $nb_fpsf - 1 ) {
+ $sql .= ''.$fpsf[$l].' LIKE \'%$queryarray['.$options.']%\' OR ';
} else {
- $sql .= ''.$fields_param_search_field[$l].' LIKE \'%$queryarray[0]%\'';
+ $sql .= ''.$fpsf[$l].' LIKE \'%$queryarray[0]%\'';
}
}
$sql .= ')';
|
|
From: <txm...@us...> - 2013-10-13 19:15:44
|
Revision: 12173
http://sourceforge.net/p/xoops/svn/12173
Author: txmodxoops
Date: 2013-10-13 19:15:38 +0000 (Sun, 13 Oct 2013)
Log Message:
-----------
Updated
Added more files
Fixed bugs for edit and save table_fields
Deleted unnecessary file
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/includes.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_about.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_help.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_index.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_architecture.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class_helper.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/functions_const.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/admin.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/structure.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class_module.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/include/common.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/constArch.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/constArchitecture.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_modules.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tdmcreate_tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/32/
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/Hotel_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/My Module_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/MyShop_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/Real Estate_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/Shopper_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/Shopping_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/album_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/ams_slogo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/module1_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/moduleimport_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/realestate_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/travel_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/txmLinks_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/modules/txmrestaurant_logo.png
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/images/uploads/tables/cat.png
Deleted: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/admin_footer.php 2013-10-13 16:21:04 UTC (rev 12172)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/admin_footer.php 2013-10-13 19:15:38 UTC (rev 12173)
@@ -1,26 +0,0 @@
-<?php
-/*
- 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 original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-/**
- * tdmcreate module
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: admin_footer.php 11084 2013-02-23 15:44:20Z timgno $
- */
-echo "<div align='center'><a href='http://www.xoops.org' title='Visit XOOPS' target='_blank'>
- <img src='".$pathIcon32."/xoopsmicrobutton.gif' alt='XOOPS' /></a></div>";
-echo "<div class='center smallsmall italic pad5'>
- <strong>" . $xoopsModule->getVar('name') . "</strong> is maintained by the
- <a href='http://xoops.org/forums/newbb' title='Visit Support Forum' class='tooltip' rel='external'>Support Forum</a></div>";
-xoops_cp_footer();
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/admin_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/admin_header.php 2013-10-13 16:21:04 UTC (rev 12172)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/admin_header.php 2013-10-13 19:15:38 UTC (rev 12173)
@@ -1,55 +0,0 @@
-<?php
-/*
- 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 original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-/**
- * tdmcreate module
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: admin_header.php 11084 2013-02-23 15:44:20Z timgno $
- */
-include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php';
-include_once XOOPS_ROOT_PATH . '/include/cp_header.php';
-include_once('../include/functions.php');
-include_once 'includes.php';
-//
-$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
-//
-$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
-$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
-$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
-
-// Get class handler
-$modulesHandler =& xoops_getModuleHandler('tdmcreate_modules', 'TDMCreate');
-$tablesHandler =& xoops_getModuleHandler('tdmcreate_tables', 'TDMCreate');
-//
-$myts =& MyTextSanitizer::getInstance();
-if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
- include_once(XOOPS_ROOT_PATH."/class/template.php");
- $xoopsTpl = new XoopsTpl();
-}
-//
-$xoopsTpl->assign('pathIcon16', $pathIcon16);
-$xoopsTpl->assign('pathIcon32', $pathIcon32);
-//Load languages
-xoops_loadLanguage('admin', $thisDirname);
-xoops_loadLanguage('modinfo', $thisDirname);
-xoops_loadLanguage('main', $thisDirname);
-// Locad admin menu class
-if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){
- include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
-}else{
- redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
-}
-xoops_cp_header();
-$adminMenu = new ModuleAdmin();
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-10-13 16:21:04 UTC (rev 12172)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-10-13 19:15:38 UTC (rev 12173)
@@ -55,7 +55,7 @@
switch ($op) {
case 'build':
// Effacer repertoire of nouveau module s'il existe
- TDMCreate_clearDir($modPath.'/modules/'.$mod_name);
+ TDMCreate_clearDir($modPath.'/modules/'.strtolower($mod_name));
// Debut
TDMCreate_OpenTable(_AM_TDMCREATE_BUILDING_FILES, _AM_TDMCREATE_BUILDING_SUCCESS, _AM_TDMCREATE_BUILDING_FAILED);
/************************************************/
@@ -66,7 +66,7 @@
//Creation of changelog.txt
const_changelog($modules);
- $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix('mod_tdmcreate_tables') . " WHERE table_name = 'mod_".$mod_name."_categories'");
+ $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix('mod_tdmcreate_tables') . " WHERE table_name = 'mod_".strtolower($mod_name)."_categories'");
list( $category ) = $xoopsDB->fetchRow($result);
foreach (array_keys($tables_arr) as $i)
@@ -91,11 +91,11 @@
// Copy of images tables
$table_image1 = $modPath . '/images/uploads/tables/' . $table_image;
if (file_exists($table_image1)) {
- copy($table_image1, $modPath . '/modules/' . $mod_name . '/images/icons/32/' . $table_image);
+ copy($table_image1, $modPath . '/modules/' . strtolower($mod_name) . '/images/icons/32/' . $table_image);
}
// Creation of classes
if ( $table_admin == 1 || $table_user == 1) {
- const_class($modules, $table_name, $table_fieldname, $category, $table_fields, $table_parameters, $table_permissions, $category);
+ const_class($modules, $table_name, $table_fieldname, $table_category, $table_fields, $table_parameters, $table_permissions);
}
// Creation of pages admin
if ( $table_admin == 1 ) {
@@ -150,9 +150,10 @@
// Creation of Waiting Plugin
const_waiting($modules, $tables_arr);
}
- // Creation of class helper & request
+ // Creation of class helper, module & request
if ( $table_name != '' ) {
const_class_helper($modules);
+ const_class_module($modules);
const_class_request($modules);
}
// Creation of xoopsversion.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/includes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/includes.php 2013-10-13 16:21:04 UTC (rev 12172)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/includes.php 2013-10-13 19:15:38 UTC (rev 12173)
@@ -41,6 +41,7 @@
include_once $cPath.'/const_class.php';
include_once $cPath.'/const_class_helper.php';
include_once $cPath.'/const_class_request.php';
+include_once $cPath.'/const_class_module.php';
include_once $cPath.'/const_admin_header.php';
include_once $cPath.'/const_admin_footer.php';
include_once $cPath.'/const_admin_menu.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-10-13 16:21:04 UTC (rev 12172)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/tables.php 2013-10-13 19:15:38 UTC (rev 12173)
@@ -160,9 +160,8 @@
$obj->setVar('table_fields', $table_fields);
$obj->setVar('table_parameters', $table_parameters);
- if ($tablesHandler->insert($obj))
- {
- redirect_header('tables.php', 2, _AM_TDMCREATE_FORMOK);
+ if ($tablesHandler->insert($obj)) {
+ redirect_header('tables.php', 2, _AM_TDMCREATE_FORMOK);
}
break;
@@ -248,10 +247,8 @@
break;
case "edit_table":
- $table_id = TDMCreate_CleanVars( $_REQUEST, 'table_id', 0);
- $table_mid = TDMCreate_CleanVars( $_REQUEST, 'table_mid', 0);
- $obj =& $tablesHandler->get($table_id);
- $form = $obj->getFormTable(false, $table_mid);
+ $obj =& $tablesHandler->get($_REQUEST['table_id']);
+ $form = $obj->getFormTable(false, $_REQUEST['table_mid']);
break;
case "edit_fields":
Deleted: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/constArch.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/constArch.php 2013-10-13 16:21:04 UTC (rev 12172)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/constArch.php 2013-10-13 19:15:38 UTC (rev 12173)
@@ -1,65 +0,0 @@
-/**
- * ****************************************************************************
- * - TXModCreate By TXMod Xoops - TEAM XOOPS MODULE FOR XOOPS
- * - Licence GPL Copyright (c) (http://www.txmodxoops.org)
- *
- * Cette licence, contient des limitations!!!
- *
- * 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 original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @license TXMod Xoops GPL license
- * @author TXMod Xoops MODULE
- *
- * ****************************************************************************
- */
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
-
-class constArch {
- /**
- *
- */
- var $module_name;
- /**
- *
- */
- var $type = null;
- /**
- *
- */
- var $path = null;
- /**
- *
- */
- var $indexFile = XOOPS_ROOT_PATH."/modules/TDMCreate/include/index.html";
- /**
- *
- */
- function __construct(){
-
- }
-
- function constArch($path, $module_name, $type, $folder)
- {
- $this->path = $path;
- $this->module_name = $module_name;
- $this->type = $type;
- $this->folder = $folder;
- }
-
- function makeDir($path, $module_name, $folder)
- {
- $path = XOOPS_ROOT_PATH."/modules/TDMCreate/modules/".$modules_name."/".$folder;
- if(!is_dir($path))
- mkdir($path, 0705);
- chmod($path, 0705);
- copy($this->indexFile, XOOPS_ROOT_PATH."/modules/TDMCreate/modules/".$modules_name."/".$folder."/index.html");
- }
-
-}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/constArchitecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/constArchitecture.php 2013-10-13 16:21:04 UTC (rev 12172)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/constArchitecture.php 2013-10-13 19:15:38 UTC (rev 12173)
@@ -1,132 +0,0 @@
-<?php
-/**
- * ****************************************************************************
- * - TXModCreate By TXMod Xoops - TEAM DEV MODULE & THEMES FOR XOOPS
- * - Licence GPL Copyright (c) (http://www.txmodxoops.org)
- *
- * This license contains restrictions...!!!
- *
- * 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 original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @license TXMod Xoops GPL license
- * @author TXMod Xoops MODULE
- *
- * @Version 2.0.1 $Id Timgno <in...@tx...>
- * ****************************************************************************
- */
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
-
-class constArchitecture {
- /*
- *
- *
- */
- var $module_name = '';
- /*
- *
- *
- */
- var $folder_name = null;
- /*
- *
- *
- */
- var $file_name = null;
- /*
- *
- *
- */
- var $path = null;
- /*
- *
- *
- */
- var $copieFile;
- /*
- * @pubblic function constructor class
- * @param string $path
- */
- function __construct($path) {
- $this->path = $path;
- }
- /*
- * @pubblic function class
- * @param string $path
- */
- function constArchitecture($path)
- {
- $this->__construct($path);
- }
- /*
- * @pubblic function makeDir
- * @param string $path
- */
- function makeDir($path)
- {
- $this->path = $path;
- if(!is_dir($this->path)) {
- mkdir($this->path, 0755);
- chmod($this->path, 0755);
- }
- }
- /*
- * @pubblic function makeDirModule
- * @param string $folder_name
- */
- function makeDirInModule($folder_name)
- {
- $this->folder_name = $folder_name;
- $fname = $this->path . "/" .$this->module_name. "/" .$this->folder_name;
- if(!is_dir($fname)) {
- mkdir($fname, 0755);
- chmod($fname, 0755);
- }
- }
- /*
- * @pubblic function makeDir & copy file
- * @param string $folder_name
- * @param string $copieFile
- * @param string $file
- */
- function makeDirAndCopyFile($folder_name, $copieFile, $file)
- {
- $this->file_name = $file;
- $this->folder_name = $folder_name;
- $this->copieFile = $copieFile;
- $fname = $this->path . "/" .$this->module_name. "/" .$this->folder_name;
- if(!is_dir($fname)) {
- mkdir($fname, 0755);
- chmod($fname, 0755);
- $this->copyFile($this->folder_name, $this->copieFile, $this->file_name);
- } else {
- $this->copyFile($this->folder_name, $this->copieFile, $this->file_name);
- }
- }
- /*
- * @pubblic function copy file
- * @param string $folder_name
- * @param string $copieFile
- * @param string $file
- */
- function copyFile($folder_name, $copieFile, $file)
- {
- $this->file_name = $file;
- $this->folder_name = $folder_name;
- $this->copieFile = $copieFile;
- $fname = $this->path . "/" .$this->module_name. "/" .$this->folder_name. "/". $this->file_name;
- /*if(!file_exists($fname)) {
- chmod($fname, 0777);
- copy($this->copieFile, $fname);
- } else {*/
- copy($this->copieFile, $fname);
- //}
- }
-}
-?>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/modules.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/modules.php 2013-10-13 19:15:38 UTC (rev 12173)
@@ -0,0 +1,269 @@
+<?php
+/*
+ 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 original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+/**
+ * Xoops Javascript class
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package media
+ * @since 2.5.x
+ * @author TDM TEAM DEV MODULE
+ * @version $Id$ modules.php 11114 2013-02-13 10:22:12Z timgno $
+ */
+
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+//include_once 'iconGenerator.php';
+
+class TDMCreateModules extends XoopsObject
+{
+ // constructor
+ function __construct()
+ {
+ $this->XoopsObject();
+ $this->initVar('mod_id',XOBJ_DTYPE_INT, 0);
+ $this->initVar('mod_name',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['name']);
+ $this->initVar('mod_version',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['version']);
+ $this->initVar('mod_since',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['since']);
+ $this->initVar('mod_min_php',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_php']);
+ $this->initVar('mod_min_xoops',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_xoops']);
+ $this->initVar('mod_min_admin',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_admin']);
+ $this->initVar('mod_min_mysql',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_mysql']);
+ $this->initVar('mod_description',XOBJ_DTYPE_TXTAREA, $GLOBALS['xoopsModuleConfig']['description']);
+ $this->initVar('mod_author',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['author']);
+ $this->initVar('mod_author_mail',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['author_email']);
+ $this->initVar('mod_author_website_url',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['author_website_url']);
+ $this->initVar('mod_author_website_name',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['author_website_name']);
+ $this->initVar('mod_credits',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['credits']);
+ $this->initVar('mod_license',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['license']);
+ $this->initVar('mod_release_info',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['release_info']);
+ $this->initVar('mod_release_file',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['release_file']);
+ $this->initVar('mod_manual',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['manual']);
+ $this->initVar('mod_manual_file',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['manual_file']);
+ $this->initVar('mod_image',XOBJ_DTYPE_TXTBOX, null);
+ $this->initVar('mod_demo_site_url',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['demo_site_url']);
+ $this->initVar('mod_demo_site_name',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['demo_site_name']);
+ $this->initVar('mod_support_url',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['support_url']);
+ $this->initVar('mod_support_name',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['support_name']);
+ $this->initVar('mod_website_url',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['website_url']);
+ $this->initVar('mod_website_name',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['website_name']);
+ $this->initVar('mod_release',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['release_date']);
+ $this->initVar('mod_status',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['status']);
+ $this->initVar('mod_admin',XOBJ_DTYPE_INT,$GLOBALS['xoopsModuleConfig']['display_admin']);
+ $this->initVar('mod_user',XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['display_user']);
+ $this->initVar('mod_search',XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_search']);
+ $this->initVar('mod_comments',XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_comments']);
+ $this->initVar('mod_notifications', XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_notifications']);
+ $this->initVar('mod_permissions', XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_permissions']);
+ $this->initVar('mod_install', XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['inroot_install']);
+ $this->initVar('mod_donations', XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['donations']);
+ $this->initVar('mod_subversion', XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['subversion']);
+ }
+
+ function getForm($action = false)
+ {
+ global $xoopsModule, $pathIcon32;
+
+ if ($action === false) {
+ $action = $_SERVER['REQUEST_URI'];
+ }
+ $title = $this->isNew() ? sprintf(_AM_TDMCREATE_MODULES_ADD) : sprintf(_AM_TDMCREATE_MODULES_EDIT);
+
+ include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php");
+
+ $form = new XoopsThemeForm($title, 'modulesform', $action, 'post', true);
+ $form->setExtra('enctype="multipart/form-data"');
+
+ $form->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULES_IMPORTANT.'</b></div>','head');
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_NAME, 'mod_name', 50, 255, $this->getVar('mod_name')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_VERSION, 'mod_version', 10, 25, $this->getVar('mod_version')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_SINCE, 'mod_since', 10, 25, $this->getVar('mod_since')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_PHP, 'mod_min_php', 10, 25, $this->getVar('mod_min_php')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_XOOPS, 'mod_min_xoops', 10, 25, $this->getVar('mod_min_xoops')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_ADMIN, 'mod_min_admin', 10, 25, $this->getVar('mod_min_admin')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_MYSQL, 'mod_min_mysql', 10, 25, $this->getVar('mod_min_mysql')), true);
+ // Name description
+ $editor_configs=array();
+ $editor_configs['name'] = 'mod_description';
+ $editor_configs['value'] = $this->getVar('mod_description', 'e');
+ $editor_configs['rows'] = 5;
+ $editor_configs['cols'] = 100;
+ $editor_configs['width'] = '50%';
+ $editor_configs['height'] = '100px';
+ $editor_configs['editor'] = $GLOBALS['xoopsModuleConfig']['tdmcreate_editor'];
+ $form->addElement( new XoopsFormEditor(_AM_TDMCREATE_MODULES_DESCRIPTION, 'mod_description', $editor_configs), true);
+ // Author
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_AUTHOR, 'mod_author', 50, 255, $this->getVar('mod_author')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_LICENSE, 'mod_license', 50, 255, $this->getVar('mod_license')), true);
+ $mod_admin = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['display_admin'] : $this->getVar('mod_admin');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_DISPLAY_ADMIN, 'mod_admin', $mod_admin, _YES, _NO));
+ $mod_user = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['display_user'] : $this->getVar('mod_user');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_DISPLAY_USER, 'mod_user', $mod_user, _YES, _NO));
+ $mod_search = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_search'] : $this->getVar('mod_search');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_SEARCH, 'mod_search', $mod_search, _YES, _NO));
+ $mod_comments = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_comments'] : $this->getVar('mod_comments');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_COMMENTS, 'mod_comments', $mod_comments, _YES, _NO));
+
+ $mod_notifications = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_notifications'] : $this->getVar('mod_notifications');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_NOTIFICATIONS, 'mod_notifications', $mod_notifications, _YES, _NO));
+
+ $mod_permissions = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_permissions'] : $this->getVar('mod_permissions');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_PERMISSIONS, 'mod_permissions', $mod_permissions, _YES, _NO));
+
+ $mod_install = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['inroot_install'] : $this->getVar('mod_install');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_INROOT_INSTALL, 'mod_install', $mod_install, _YES, _NO));
+
+ $mod_image = $this->getVar('mod_image') ? $this->getVar('mod_image') : 'empty.png';
+
+ $uploadirectory = '/modules/'.$xoopsModule->dirname().'/images/uploads/modules';
+ $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_MODULES_IMAGE, '<br />');
+ $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './modules/' . $xoopsModule->dirname() . '/images/uploads/modules');
+ $imageselect= new XoopsFormSelect($imgpath, 'mod_image', $mod_image);
+ $mod_image_array = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH . $uploadirectory );
+ foreach( $mod_image_array as $image ) {
+ $imageselect->addOption("$image", $image);
+ }
+ $imageselect->setExtra( "onchange='showImgSelected(\"image3\", \"mod_image\", \"" . $uploadirectory . "\", \"\", \"" . XOOPS_URL . "\")'" );
+ $imgtray->addElement($imageselect);
+ $imgtray -> addElement( new XoopsFormLabel( '', "<br /><img src='" . XOOPS_URL . "/" . $uploadirectory . "/" . $mod_image . "' name='image3' id='image3' alt='' />" ) );
+
+ $fileseltray = new XoopsFormElementTray('', '<br />');
+ $fileseltray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD, 'attachedfile', $GLOBALS['xoopsModuleConfig']['maxsize']));
+ $fileseltray->addElement(new XoopsFormLabel(''));
+ $imgtray->addElement($fileseltray);
+ $form->addElement($imgtray);
+
+//---------- START -----------------
+ ?>
+
+ <script type="text/javascript">
+
+ function showImgSelected2(imgId, selectId, imgDir, extra, xoopsUrl) {
+ if (xoopsUrl == null) {
+ xoopsUrl = "./";
+ }
+ imgDom = xoopsGetElementById(imgId);
+ selectDom = xoopsGetElementById(selectId);
+ if (selectDom.options[selectDom.selectedIndex].value != "") {
+ imgDom.src = xoopsUrl + imgDir + "/" + selectDom.options[selectDom.selectedIndex].value + extra;
+ } else {
+ imgDom.src = xoopsUrl + "/modules/TDMCreate/images/uploads/modules/blank.gif";
+ }
+ }
+
+ function createNewModuleLogo(xoopsUrl) { // thi...
[truncated message content] |
|
From: <txm...@us...> - 2013-10-14 18:48:44
|
Revision: 12174
http://sourceforge.net/p/xoops/svn/12174
Author: txmodxoops
Date: 2013-10-14 18:48:40 +0000 (Mon, 14 Oct 2013)
Log Message:
-----------
Fixed bugs
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/admin.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tables.php 2013-10-13 19:15:38 UTC (rev 12173)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/class/tables.php 2013-10-14 18:48:40 UTC (rev 12174)
@@ -672,7 +672,7 @@
$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
if ($action === false) {
- $action = $this->isNew() ? TDMC_URL.'/admin/tables.php?op=create_table&table_mid='.$table_mid : $_SERVER['REQUEST_URI'];
+ $action = $_SERVER['REQUEST_URI'];
$sending = $this->isNew() ? 'table_fields' : 'table_save_fields';
}
$title = $this->isNew() ? sprintf(_AM_TDMCREATE_TABLES_ADD) : sprintf(_AM_TDMCREATE_TABLES_EDIT);
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/admin.php 2013-10-13 19:15:38 UTC (rev 12173)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/language/english/admin.php 2013-10-14 18:48:40 UTC (rev 12174)
@@ -213,8 +213,8 @@
define('_AM_TDMCREATE_TABLES_WAITING', "Show Table Waiting");
//1.39
-define('_AM_TDMCREATE_MODULES_MIN_PHP', "Minimum Php");
-define('_AM_TDMCREATE_MODULES_MIN_XOOPS', "Minimum Xoops");
+define('_AM_TDMCREATE_MODULES_MIN_PHP', "Minimum PHP");
+define('_AM_TDMCREATE_MODULES_MIN_XOOPS', "Minimum XOOPS");
define('_AM_TDMCREATE_MODULES_MIN_ADMIN', "Minimum Admin");
define('_AM_TDMCREATE_MODULES_MIN_MYSQL', "Minimum Database");
define('_AM_TDMCREATE_BUILDING_FILES', "Files that have been compiled");
|
|
From: <txm...@us...> - 2013-10-17 23:40:22
|
Revision: 12184
http://sourceforge.net/p/xoops/svn/12184
Author: txmodxoops
Date: 2013-10-17 23:40:19 +0000 (Thu, 17 Oct 2013)
Log Message:
-----------
Deleted unnecessary parameters
Added new line code in same files
Deleted duplicated code for table_fields, table_parameters
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php
XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_pages.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-10-17 23:19:32 UTC (rev 12183)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/admin/building.php 2013-10-17 23:40:19 UTC (rev 12184)
@@ -95,7 +95,7 @@
}
// Creation of classes
if ( $table_admin == 1 || $table_user == 1) {
- const_class($modules, $table_name, $table_fieldname, $table_category, $table_fields, $table_parameters, $table_permissions);
+ const_class($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $table_permissions);
}
// Creation of pages admin
if ( $table_admin == 1 ) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php 2013-10-17 23:19:32 UTC (rev 12183)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_admin_pages.php 2013-10-17 23:40:19 UTC (rev 12184)
@@ -28,10 +28,19 @@
$stu_mod_name = strtoupper($mod_name);
$stu_table_name = strtoupper($table_name);
$file = $table_name.'.php';
- $tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
- $root_path = XOOPS_URL.'/modules/'.$mod_name.'/admin/'.$file;
+ $tdmcreate_path = TDM_CREATE_MURL.'/'.$stl_mod_name.'/admin/'.$file;
+ $root_path = XOOPS_URL.'/modules/'.$stl_mod_name.'/admin/'.$file;
+
+ //fields
+ $fields_total = explode('|', $table_fields);
+ $nb_fields = count($fields_total);
+ list($fpif, $fpe, $fpda, $fpdu, $fpdb, $fpmf, $fpds, $fprf) = table_fields($table_fields, $table_parameters);
+
+ //$field_id = $fields[0];
+ //$field_name = $fields[1];
+
$text = '<?php'.const_header($modules, $file);
-$text .= <<<EOT
+ $text .= <<<EOT
\ninclude_once 'header.php';
//It recovered the value of argument op in URL$
\$op = {$mod_name}_CleanVars(\$_REQUEST, 'op', 'list', 'string');
@@ -44,36 +53,7 @@
\${$table_fieldname}_waiting = \${$table_name}Handler->getCount(\$criteria);
EOT;
}
-//fields
-$fields_total = explode('|', $table_fields);
-$nb_fields = count($fields_total);
-//parameters
-$parameters_total = explode('|', $table_parameters);
-
-//Recuperation des noms des tables
-for($i=0; $i<$nb_fields; $i++)
-{
- //Nom des fields
- $fields1 = explode(':', $fields_total[$i]);
- $fields[$i] = $fields1[0];
- //Afficher dans l'admin
- if( $i == 0 ) {
- $fpa[$i] = '0';
- } else {
- $param = explode(':', $parameters_total[$i-1]);
- $fpt[$i] = $param[0]; // fpt = fields parameters type
- $fpa[$i] = $param[2]; // fpa = fields parameters admin
- $fprf[$i] = $param[6]; // fprf = fields parameters required field
- if ( $param[4] == 1 ) {
- $fpmf = $fields[0]; // fpmf = fields parameters main field
- }
- }
-}
-
-$field_id = $fields[0];
-$field_name = $fields[1];
-
$text .= <<<EOT
\n\necho \$adminMenu->addNavigation('{$table_name}.php');
switch (\$op)
@@ -83,17 +63,17 @@
\$adminMenu->addItemButton({$language}_ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
echo \$adminMenu->renderButton();
\$criteria = new CriteriaCompo();
- \$criteria->setSort('{$field_id} ASC, {$fpmf}');
+ \$criteria->setSort('{$fpif} ASC, {$fpmf}');
\$criteria->setOrder('ASC');
- \$numrows = \${$table_name}Handler->getCount();
+ \${$table_name}_rows = \${$table_name}Handler->getCount();
\${$table_name}_arr = \${$table_name}Handler->getAll(\$criteria);
EOT;
- $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $fpmf, $language, '', 0);
+ $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $nb_fields, $fields_total, $fpif, $fpda, $fpe, $fpmf, $language, '', 0);
if ( $table_category != 1 )
{
$text .= <<<EOT
\n\t\t// Table view
- if (\$numrows>0)
+ if (\${$table_name}_rows > 0)
{
echo "<table width='100%' cellspacing='1' class='outer'>
<tr>
@@ -110,13 +90,13 @@
echo "<tr class='".\$class."'>";
\$class = (\$class == "even") ? "odd" : "even";\n
EOT;
- $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $fpmf, $language, '', 1);
+ $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $nb_fields, $fields_total, $fpif, $fpda, $fpe, $fpmf, $language, '', 1);
$text .= $fields_data;
$text .= <<<EOT
- \n\t\t\t\t\techo "<td class='center width5'>
- <a href='{$table_name}.php?op=edit&{$field_id}=".\$i."'><img src=".\$sysPathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a>
- <a href='{$table_name}.php?op=delete&{$field_id}=".\$i."'><img src=".\$sysPathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a>
+\n\t\t\t\t\techo "<td class='center width5'>
+ <a href='{$table_name}.php?op=edit&{$fpif}=".\$i."'><img src=".\$sysPathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a>
+ <a href='{$table_name}.php?op=delete&{$fpif}=".\$i."'><img src=".\$sysPathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a>
</td>";
echo "</tr>";
}
@@ -127,14 +107,14 @@
EOT;
$text .= $fcn;
$text .= <<<EOT
- \n\t\t\t\t\t<th class='center width5'>".{$language}_FORMACTION."</th>
+\n\t\t\t\t\t<th class='center width5'>".{$language}_FORMACTION."</th>
</tr><tr><td class='errorMsg' colspan='{$nb_fields}'>There are no {$table_name}</td></tr>";
echo "</table><br /><br />";
}
EOT;
} else {
$text .= <<<EOT
- \n\t\t// Display function that allows children categories
+\n\t\t// Display function that allows children categories
function {$mod_name}_children(\$cat_id = 0, \${$table_name}_arr, \$prefix = "", \$order = "", &\$class)
{
global \$pathIcon16;
@@ -148,11 +128,11 @@
\$cat_weight = \$categories_arr[\$i]->getVar('cat_weight');
echo "<tr class='".\$class."'>";\n
EOT;
- $text .= const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $fpmf, $language, '', 1);
+ $text .= const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $nb_fields, $fields_total, $fpif, $fpda, $fpe, $fpmf, $language, '', 1);
$text .= <<<EOT
- \n\t\t\t\t\techo "<td class='center width5'>
- <a href='{$table_name}.php?op=edit&{$field_id}=".\$i"'><img src=".\$sysPathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a>
- <a href='{$table_name}.php?op=delete&{$field_id}=".\$i"'><img src=".\$sysPathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a>
+\n\t\t\t\t\techo "<td class='center width5'>
+ <a href='{$table_name}.php?op=edit&{$fpif}=".\$i"'><img src=".\$sysPathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a>
+ <a href='{$table_name}.php?op=delete&{$fpif}=".\$i"'><img src=".\$sysPathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a>
</td>
</tr>";
\$class = (\$class == "even") ? "odd" : "even";
@@ -170,15 +150,15 @@
}
// Table view
- if (\$numrows>0)
+ if (\${$table_name}_rows > 0)
{
echo "<table width='100%' cellspacing='1' class='outer'>
<tr>
EOT;
- $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $fpmf, $language, '', 0);
+ $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $nb_fields, $fields_total, $fpif, $fpda, $fpe, $fpmf, $language, '', 0);
$text .= $fcn;
$text .= <<<EOT
- \n\t\t\t\t\t<th class='center width5'>".{$language}_FORMACTION."</th>
+\n\t\t\t\t\t<th class='center width5'>".{$language}_FORMACTION."</th>
</tr>";
\$class = "odd";
\$icon = "<img src='".{$stu_mod_name}_URL."/images/icons/16/arrow.gif'>";
@@ -192,13 +172,13 @@
\$category_weight = \${$table_name}_arr[\$i]->getVar('{$table_fieldname}_weight');
echo "<tr class='".\$class."'>";\n
EOT;
- $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $fpmf, $language, 1, 1);
+ $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $nb_fields, $fields_total, $fpif, $fpda, $fpe, $fpmf, $language, 1, 1);
$text .= $fields_data;
$text .= <<<EOT
- \n\t\t\t\t\techo "<td class='center width5'>
- <a href='{$table_name}.php?op=edit&{$field_id}=".\$i"'><img src=".\$sysPathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a>
- <a href='{$table_name}.php?op=delete&{$field_id}=".\$i"'><img src=".\$sysPathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a>
+\n\t\t\t\t\techo "<td class='center width5'>
+ <a href='{$table_name}.php?op=edit&{$fpif}=".\$i"'><img src=".\$sysPathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a>
+ <a href='{$table_name}.php?op=delete&{$fpif}=".\$i"'><img src=".\$sysPathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a>
</td>
</tr>";
\$class = (\$class == "even") ? "odd" : "even";
@@ -220,10 +200,10 @@
echo "<table width='100%' cellspacing='1' class='outer'>
<tr>
EOT;
- $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $fpmf, $language, '', 0);
+ $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $nb_fields, $fields_total, $fpif, $fpda, $fpe, $fpmf, $language, '', 0);
$text .= $fcn;
$text .= <<<EOT
- \n\t\t\t\t\t<th class='center width5'>".{$language}_FORMACTION."</th>
+\n\t\t\t\t\t<th class='center width5'>".{$language}_FORMACTION."</th>
</tr>
<tr><td class='errorMsg' colspan='{$nb_fields}'>There are no {$table_name}</td></tr>";
echo "</table><br /><br />";
@@ -237,8 +217,8 @@
\$adminMenu->addItemButton({$language}_{$stu_table_name}_LIST, '{$table_name}.php', 'list');
echo \$adminMenu->renderButton();
- \$obj =& \${$table_name}Handler->create();
- \$form = \$obj->getForm();
+ \${$table_name}_obj =& \${$table_name}Handler->create();
+ \$form = \${$table_name}_obj->getForm();
\$form->display();
break;
@@ -246,21 +226,21 @@
if ( !\$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('{$table_name}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors()));
}
- if (isset(\$_REQUEST['{$field_id}'])) {
- \$obj =& \${$table_name}Handler->get(\$_REQUEST['{$field_id}']);
+ if (isset(\$_REQUEST['{$fpif}'])) {
+ \${$table_name}_obj =& \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
} else {
- \$obj =& \${$table_name}Handler->create();
+ \${$table_name}_obj =& \${$table_name}Handler->create();
}
EOT;
- $text .= const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $fpmf, $language, '', 2);
+ $text .= const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $nb_fields, $fields_total, $fpif, $fpda, $fpe, $fpmf, $language, '', 2);
$text .= <<<EOT
- \n\t\tif (\${$table_name}Handler->insert(\$obj)) {
+\n\t\tif (\${$table_name}Handler->insert(\${$table_name}_obj)) {
redirect_header('{$table_name}.php?op=list', 2, {$language}_FORMOK);
}
- echo \$obj->getHtmlErrors();
- \$form =& \$obj->getForm();
+ echo \${$table_name}_obj->getHtmlErrors();
+ \$form =& \${$table_name}_obj->getForm();
\$form->display();
break;
@@ -268,38 +248,38 @@
\$adminMenu->addItemButton({$language}_ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
\$adminMenu->addItemButton({$language}_{$stu_table_name}_LIST, '{$table_name}.php', 'list');
echo \$adminMenu->renderButton();
- \$obj = \${$table_name}Handler->get(\$_REQUEST['{$field_id}']);
- \$form = \$obj->getForm();
+ \${$table_name}_obj = \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
+ \$form = \${$table_name}_obj->getForm();
\$form->display();
break;
case 'delete':
- \$obj =& \${$table_name}Handler->get(\$_REQUEST['{$field_id}']);
+ \${$table_name}_obj =& \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
if (isset(\$_REQUEST['ok']) && \$_REQUEST['ok'] == 1) {
if ( !\$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('{$table_name}.php', 3, implode(', ', \$GLOBALS['xoopsSecurity']->getErrors()));
}
- if (\${$table_name}Handler->delete(\$obj)) {
+ if (\${$table_name}Handler->delete(\${$table_name}_obj)) {
redirect_header('{$table_name}.php', 3, {$language}_FORMDELOK);
} else {
- echo \$obj->getHtmlErrors();
+ echo \${$table_name}_obj->getHtmlErrors();
}
} else {
- xoops_confirm(array('ok' => 1, '{$field_id}' => \$_REQUEST['{$field_id}'], 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}_FORMSUREDEL, \$obj->getVar('{$fpmf}')));
+ xoops_confirm(array('ok' => 1, '{$fpif}' => \$_REQUEST['{$fpif}'], 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}_FORMSUREDEL, \${$table_name}_obj->getVar('{$fpmf}')));
}
break;
EOT;
if(isset($_REQUEST['table_online']) == 1) {
$text .= <<<EOT
\ncase 'update_online':
- if (isset(\$_REQUEST['{$field_id}'])) {
- \$obj =& \${$table_name}Handler->get(\$_REQUEST['{$field_id}']);
+ if (isset(\$_REQUEST['{$fpif}'])) {
+ \${$table_name}_obj =& \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
}
- \$obj->setVar('{$table_fieldname}_online', \$_REQUEST['{$table_fieldname}_online']);
- if (\${$table_name}Handler->insert(\$obj)) {
+ \${$table_name}_obj->setVar('{$table_fieldname}_online', \$_REQUEST['{$table_fieldname}_online']);
+ if (\${$table_name}Handler->insert(\${$table_name}_obj)) {
redirect_header('{$table_name}.php', 3, {$language}_FORMOK);
}
- echo \$obj->getHtmlErrors();
+ echo \${$table_name}_obj->getHtmlErrors();
break;
EOT;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php 2013-10-17 23:19:32 UTC (rev 12183)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_class.php 2013-10-17 23:40:19 UTC (rev 12184)
@@ -19,46 +19,20 @@
* @version $Id: const_class.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_class($modules, $table_name, $table_fieldname, $table_category, $table_fields, $table_parameters, $table_permissions)
+function const_class($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $table_permissions)
{
$mod_name = $modules->getVar('mod_name');
+ $stl_mod_name = strtolower($mod_name);
$language = '_AM_'.strtoupper($mod_name).'_';
$file = $table_name. '.php';
- $tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/class/'.$file;
- $root_path = XOOPS_URL.'/modules/'.$mod_name.'/class/'.$file;
- $constructor = const_fields($mod_name, $table_name, $table_fieldname, $table_category, $table_fields, $language, 0, 0, 0, 0);
- //fields
- $fields_total = explode('|', $table_fields);
- $nb_fields = count($fields_total);
- //print_r($fields_total);
- //parameters
- $parameters_total = explode('|', $table_parameters);
-
- //Recuperation des parameters affichage dans le formulaire
- for($i=0; $i<$nb_fields; $i++)
- {
- $fields = explode(':', $fields_total[$i]);
- //$fields[$i] = $fields1[0];
- //Afficher dans les elements du formulaire et choisir le type
- if( $i == 0 ) {
- $fpe[$i] = '0';
- $fpdf[$i] = '0';
- $fpif = $fields[0]; // fpif = fields parameters auto_increment field
- } else {
- $param = explode(':', $parameters_total[$i-1]);
- //print_r($param);
- $fpdf[$i] = $param[3]; // fpdf = fields parameters display form
- $fpe[$i] = $param[0]; // fpe = fields parameters elements
- $fprf[$i] = $param[6]; // fprf = fields parameters required field
- if ( $param[4] == 1 ) {
- $fpmf = $fields[0]; // fpmf = fields parameters main field
- }
- }
- }
+ $tdmcreate_path = TDM_CREATE_MURL.'/'.$stl_mod_name.'/class/'.$file;
+ $root_path = XOOPS_URL.'/modules/'.$stl_mod_name.'/class/'.$file;
+ $constructor = const_fields($mod_name, $table_name, $table_fieldname, $table_fields, $language, 0, 0, 0, 0);
+ list($fpif, $fpe, $fpda, $fpdu, $fpdb, $fpmf, $fpds, $fprf) = table_fields($table_fields, $table_parameters);
//$field_id = $fields[0];
//$field_name = $fields[1];
//table_fields($table_fields);
- $form = const_fields($mod_name, $table_name, $table_fieldname, $table_category, $table_fields, $language, $fpdf, $fpe, $fprf, 1);
+ $form = const_fields($mod_name, $table_name, $table_fieldname, $table_fields, $language, $fpda, $fpe, $fprf, 1);
$ucf_mod_name_table_name = ucfirst($mod_name).ucfirst($table_name);
$lang_add = $language.strtoupper($table_fieldname).'_ADD';
$lang_edit = $language.strtoupper($table_fieldname).'_EDIT';
@@ -119,7 +93,7 @@
\$gperm_handler = &xoops_gethandler ( 'groupperm' );
\$full_list = array_keys ( \$group_list );
global \$xoopsModule;
- if (! \$this->isNew ()) {
+ if ( !\$this->isNew() ) {
\$groups_ids_approve = \$gperm_handler->getGroupIds ( '{$mod_name}_approve', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
\$groups_ids_submit = \$gperm_handler->getGroupIds ( '{$mod_name}_submit', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
\$groups_ids_view = \$gperm_handler->getGroupIds ( '{$mod_name}_view', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
Modified: XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_pages.php 2013-10-17 23:19:32 UTC (rev 12183)
+++ XoopsModules/TDMCreate/branches/timgno/1.39/TDMCreate/const/const_templates_pages.php 2013-10-17 23:40:19 UTC (rev 12184)
@@ -22,41 +22,17 @@
function const_templates_pages($modules, $table_name, $table_fieldname, $table_fields, $table_parameters)
{
$mod_name = $modules->getVar('mod_name');
+ $stl_mod_name = strtolower($mod_name);
$language = '_MA_'.strtoupper($mod_name).'_';
$file = $mod_name.'_'.$table_name.'.html';
- $tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/templates/'.$file;
- $root_path = XOOPS_URL.'/modules/'.$mod_name.'/templates/'.$file;
+ $tdmcreate_path = TDM_CREATE_MURL.'/'.$stl_mod_name.'/templates/'.$file;
+ $root_path = XOOPS_URL.'/modules/'.$stl_mod_name.'/templates/'.$file;
//fields
$fields_total = explode('|', $table_fields);
$nb_fields = count($fields_total);
- //print_r($fields_total);
- //parameters
- $parameters_total = explode('|', $table_parameters);
-
- //Recuperation des parameters affichage dans le formulaire
- for($i=0; $i<$nb_fields; $i++)
- {
- $fields = explode(':', $fields_total[$i]);
- //$fields[$i] = $fields1[0];
- //Afficher dans les elements du formulaire et choisir le type
- if( $i == 0 ) {
- $fpe[$i] = '0';
- $fpdf[$i] = '0';
- $fpif = $fields[0]; // fpif = fields parameters auto_increment field
- } else {
- $param = explode(':', $parameters_total[$i-1]);
- //print_r($param);
- $fpdf[$i] = $param[3]; // fpdf = fields parameters display form
- $fpe[$i] = $param[0]; // fpe = fields parameters elements
- $fprf[$i] = $param[6]; // fprf = fields parameters required field
- if ( $param[4] == 1 ) {
- $fpmf = $fields[0]; // fpmf = fields parameters main field
- }
- }
- }
- //table_fields($table_fields);
+ list($fpif, $fpe, $fpda, $fpdu, $fpdb, $fpmf, $fpds, $fprf) = table_fields($table_fields, $table_parameters);
- $text = '<{include file="db:'.$mod_name.'_header.html"}>';
+ $text = '<{include file="db:'.$stl_mod_name.'_header.html"}>';
if($table_name != null)
{
$text .= '
@@ -66,7 +42,7 @@
';
for ($i = 0; $i < $nb_fields; $i++)
{
- $structure_fields = explode(':', $fields[$i]);
+ $structure_fields = explode(':', $fields_total[$i]);
$text .= ' <th class="center"><{$smarty.const.'.$language.strtoupper($structure_fields[0]).'}></th>
';
}
@@ -76,7 +52,7 @@
';
for ($i = 0; $i < $nb_fields; $i++)
{
- $structure_fields = explode(':', $fields[$i]);
+ $structure_fields = explode(':', $fields_total[$i]);
if( $fpe[$i] == 'XoopsFormUploadImage' ) {
$text .= ' <td class="center"><img src="<{$xoops_url}>/uploads/'.$mod_name.'/images/'.$table_name.'/<{$'.$table_fieldname.'.'.$structure_fields[0].'}>" alt="'.$table_name.'"></td>
';
|