|
From: <txm...@us...> - 2014-06-15 17:31:41
|
Revision: 12602
http://sourceforge.net/p/xoops/svn/12602
Author: txmodxoops
Date: 2014-06-15 17:31:37 +0000 (Sun, 15 Jun 2014)
Log Message:
-----------
- Solved issues for mysql.php file, now the mysql.sql file then created from building
- Fixed bugs
- Even small problems fields for new/edit when save or update,
I hope will be resolved soon, if time is.
- Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql/mysql.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/session.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tables.tpl
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-06-15 13:43:07 UTC (rev 12601)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-06-15 17:31:37 UTC (rev 12602)
@@ -22,6 +22,7 @@
// Recovered value of arguments op in the URL $
$op = XoopsRequest::getString('op', 'list');
// Get fields Variables
+$table_name = TDMCreate_CleanVars($_REQUEST, 'table_name', '', 'string');
$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid');
$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb');
@@ -29,18 +30,9 @@
/*$field_mid = XoopsRequest::getInt('field_mid');
$field_tid = XoopsRequest::getInt('field_tid');
$field_numb = XoopsRequest::getInt('field_numb');
-$field_name = XoopsRequest::getString('field_name', '');*/
-/*$session_field = TDMCreateSession::getInstance();
-$table_name = $session_field->getSession('table_name');
-$field_tid = $session_field->getSession('table_id');
-$field_mid = $session_field->getSession('table_mid');
-$field_name = $session_field->getSession('table_fieldname');
-$field_numb = $session_field->getSession('table_nbfields');*/
-if(isset($_SESSION['session_table_name']) && !empty($_SESSION['session_table_name'])) {
- $table_name = $_SESSION['session_table_name'];
-} else {
- $table_name = TDMCreate_CleanVars($_REQUEST, 'table_name', '', 'string');
-}
+$field_name = XoopsRequest::getString('field_name', '');
+$session_table = TDMCreateSession::getInstance();
+$table_name = $session_table->getSession('session_table_name');*/
//
switch ($op)
{
@@ -48,7 +40,6 @@
default:
$start = XoopsRequest::getInt('start', 0);
$limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
- //$limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('fields_adminpager'));
// Define main template
$template_main = 'fields.tpl';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' );
@@ -78,8 +69,6 @@
unset($nb_tables);
// Get the list of tables
$criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_mid', $field_mid));
- $criteria->add(new Criteria('table_id', $field_tid));
$criteria->setSort('table_id ASC, table_name');
$criteria->setOrder('ASC');
$nb_tables = $tdmcreate->getHandler('tables')->getCount($criteria);
@@ -87,22 +76,21 @@
unset($criteria);
if ($nb_tables > 0)
{
- foreach (array_keys($tables_arr) as $t)
+ foreach (array_keys($tables_arr) as $tid)
{
// Display tables list
- $table['id'] = $t;
- $table['mid'] = $tables_arr[$t]->getVar('table_mid');
- $table['name'] = ucfirst($tables_arr[$t]->getVar('table_name'));
- $table['image'] = $tables_arr[$t]->getVar('table_image');
- $table['nbfields'] = $tables_arr[$t]->getVar('table_nbfields');
- $table['blocks'] = $tables_arr[$t]->getVar('table_blocks');
- $table['admin'] = $tables_arr[$t]->getVar('table_admin');
- $table['user'] = $tables_arr[$t]->getVar('table_user');
- $table['search'] = $tables_arr[$t]->getVar('table_search');
+ $table['id'] = $tid;
+ $table['mid'] = $tables_arr[$tid]->getVar('table_mid');
+ $table['name'] = ucfirst($tables_arr[$tid]->getVar('table_name'));
+ $table['image'] = $tables_arr[$tid]->getVar('table_image');
+ $table['nbfields'] = $tables_arr[$tid]->getVar('table_nbfields');
+ $table['blocks'] = $tables_arr[$tid]->getVar('table_blocks');
+ $table['admin'] = $tables_arr[$tid]->getVar('table_admin');
+ $table['user'] = $tables_arr[$tid]->getVar('table_user');
+ $table['search'] = $tables_arr[$tid]->getVar('table_search');
// Get the list of fields
$criteria = new CriteriaCompo();
- $criteria->add(new Criteria('field_mid', $field_mid));
- $criteria->add(new Criteria('field_tid', $t));
+ $criteria->add(new Criteria('field_tid', $tid));
$criteria->setSort('field_id ASC, field_name');
$criteria->setOrder('ASC');
$nb_fields = $tdmcreate->getHandler('fields')->getCount($criteria);
@@ -113,20 +101,20 @@
$lid = 1;
if ( $nb_fields > 0 )
{
- foreach (array_keys($fields_arr) as $f)
+ foreach (array_keys($fields_arr) as $fid)
{
- $field['id'] = $f;
+ $field['id'] = $fid;
$field['lid'] = $lid;
- $field['name'] = str_replace('_', ' ', ucfirst($fields_arr[$f]->getVar('field_name')));
- $field['parent'] = $fields_arr[$f]->getVar('field_parent');
- $field['inlist'] = $fields_arr[$f]->getVar('field_inlist');
- $field['inform'] = $fields_arr[$f]->getVar('field_inform');
- $field['admin'] = $fields_arr[$f]->getVar('field_admin');
- $field['user'] = $fields_arr[$f]->getVar('field_user');
- $field['block'] = $fields_arr[$f]->getVar('field_block');
- $field['main'] = $fields_arr[$f]->getVar('field_main');
- $field['search'] = $fields_arr[$f]->getVar('field_search');
- $field['required'] = $fields_arr[$f]->getVar('field_required');
+ $field['name'] = str_replace('_', ' ', ucfirst($fields_arr[$fid]->getVar('field_name')));
+ $field['parent'] = $fields_arr[$fid]->getVar('field_parent');
+ $field['inlist'] = $fields_arr[$fid]->getVar('field_inlist');
+ $field['inform'] = $fields_arr[$fid]->getVar('field_inform');
+ $field['admin'] = $fields_arr[$fid]->getVar('field_admin');
+ $field['user'] = $fields_arr[$fid]->getVar('field_user');
+ $field['block'] = $fields_arr[$fid]->getVar('field_block');
+ $field['main'] = $fields_arr[$fid]->getVar('field_main');
+ $field['search'] = $fields_arr[$fid]->getVar('field_search');
+ $field['required'] = $fields_arr[$fid]->getVar('field_required');
$fields[] = $field;
unset($field);
$lid++;
@@ -177,23 +165,19 @@
//
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
- }
- $fieldelement_fid = XoopsRequest::getInt('fieldelement_fid');
+ }
+ $field_id = TDMCreate_CleanVars($_POST, 'field_id');
// Fields Handler
$fields = $tdmcreate->getHandler('fields');
- // Fields Elements Handler
- $fieldelements = $tdmcreate->getHandler('fieldelements');
// Set Variables
foreach ($_POST['field_id'] as $key => $value)
{
switch($value){
case 'new':
- $fieldsObj =& $fields->create();
- $fieldelementObj =& $fieldelements->create();
+ $fieldsObj =& $fields->create();
break;
case 'edit':
- $fieldsObj =& $fields->get($value);
- $fieldelementObj =& $fieldelements->get($fieldelement_fid);
+ $fieldsObj =& $fields->get($value);
break;
}
// Set Data
@@ -208,29 +192,32 @@
$fieldsObj->setVar( 'field_default', (isset($_POST['field_default'][$key]) ? $_POST['field_default'][$key] : '') );
$fieldsObj->setVar( 'field_key', (isset($_POST['field_key'][$key]) ? $_POST['field_key'][$key] : '') );
$fieldsObj->setVar( 'field_element', (isset($_POST['field_element'][$key]) ? $_POST['field_element'][$key] : '') );
- $fieldsObj->setVar( 'field_parent', (($key == isset($_REQUEST['field_parent'])) ? 1 : 0) );
- $fieldsObj->setVar( 'field_inlist', ((isset($_REQUEST['field_inlist'][$key]) == 1) ? 0 : 1) );
- $fieldsObj->setVar( 'field_inform', ((isset($_REQUEST['field_inform'][$key]) == 1) ? 0 : 1) );
- $fieldsObj->setVar( 'field_admin', ((isset($_REQUEST['field_admin'][$key]) == 1) ? 0 : 1) );
- $fieldsObj->setVar( 'field_user', ((isset($_REQUEST['field_user'][$key]) == 1) ? 0 : 1) );
- $fieldsObj->setVar( 'field_block', ((isset($_REQUEST['field_block'][$key]) == 1) ? 0 : 1) );
- $fieldsObj->setVar( 'field_main', (($key == isset($_REQUEST['field_main'])) ? 1 : 0) );
- $fieldsObj->setVar( 'field_search', ((isset($_REQUEST['field_search'][$key]) == 1) ? 0 : 1) );
- $fieldsObj->setVar( 'field_required', ((isset($_REQUEST['field_required'][$key]) == 1) ? 0 : 1) );
+ $fieldsObj->setVar( 'field_parent', (($key == isset($_REQUEST['field_parent'][$key])) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_inlist', ((isset($_REQUEST['field_inlist'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_inform', ((isset($_REQUEST['field_inform'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_admin', ((isset($_REQUEST['field_admin'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_user', ((isset($_REQUEST['field_user'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_block', ((isset($_REQUEST['field_block'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_main', (($key == isset($_REQUEST['field_main'][$key])) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_search', ((isset($_REQUEST['field_search'][$key]) == 1) ? 1 : 0) );
+ $fieldsObj->setVar( 'field_required', ((isset($_REQUEST['field_required'][$key]) == 1) ? 1 : 0) );
// Insert Data
$tdmcreate->getHandler('fields')->insert($fieldsObj);
- }
- $fieldelementObj->setVar( 'fieldelement_mid', $field_mid );
- $fieldelementObj->setVar( 'fieldelement_tid', $field_tid );
- $fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($table_name) );
- $fieldelementObj->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($table_name) );
- // Insert new field element id for table name
- if (!$tdmcreate->getHandler('fieldelements')->insert($fieldelementObj) ) {
- $GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors() . ' Field element');
- }
+ }
+
//
if ($fieldsObj->isNew()) {
- redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_SAVED_OK, $table_name));
+ // Fields Elements Handler
+ $fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create();
+ $fieldelementObj->setVar( 'fieldelement_mid', $field_mid );
+ $fieldelementObj->setVar( 'fieldelement_tid', $field_tid );
+ $fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($_SESSION['session_table_name']) );
+ $fieldelementObj->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($_SESSION['session_table_name']) );
+ // Insert new field element id for table name
+ if (!$tdmcreate->getHandler('fieldelements')->insert($fieldelementObj) ) {
+ $GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors() . ' Field element');
+ }
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_SAVED_OK, $table_name));
} else {
redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_UPDATED_OK, $table_name));
}
@@ -252,7 +239,7 @@
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$fieldsObj = $tdmcreate->getHandler('fields')->get( $field_tid );
- $form = $fieldsObj->getForm(null, $field_tid, $field_numb);
+ $form = $fieldsObj->getForm(null, $field_tid);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
var_dump($field_tid);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-06-15 13:43:07 UTC (rev 12601)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-06-15 17:31:37 UTC (rev 12602)
@@ -24,10 +24,14 @@
//
$mod_id = XoopsRequest::getInt('mod_id');
//
-$table_id = XoopsRequest::getInt('table_id');
+$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id');
+$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid');
+$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields');
+$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');
+/*$table_id = XoopsRequest::getInt('table_id');
$table_mid = XoopsRequest::getInt('table_mid');
$table_nbfields = XoopsRequest::getInt('table_nbfields');
-$table_fieldname = XoopsRequest::getString('table_fieldname', '');
+$table_fieldname = XoopsRequest::getString('table_fieldname', '');*/
//
switch ($op)
{
@@ -35,7 +39,6 @@
default:
$start = XoopsRequest::getInt('start', 0);
$limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
- //$limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
// Define main template
$template_main = 'tables.tpl';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/assets/css/admin/style.css' );
@@ -139,7 +142,7 @@
$obj =& $tdmcreate->getHandler('tables')->create();
$form = $obj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
- break;
+ break;
case 'save':
if ( !$GLOBALS['xoopsSecurity']->check() ) {
@@ -192,24 +195,18 @@
'table_comments' => (($_REQUEST['table_comments'] == 1) ? '1' : '0'),
'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0'),
'table_permissions' => (($_REQUEST['table_permissions'] == 1) ? '1' : '0')));
-
+ //$session_table = TDMCreateSession::getInstance();
+ //$session_table->setSession('session_table_name', $_POST['table_name']);
if( $tdmcreate->getHandler('tables')->insert($obj) ) {
if( $obj->isNew() ) {
$table_iid = $GLOBALS['xoopsDB']->getInsertId();
- /*$_SESSION['table_id'] = $GLOBALS['xoopsDB']->getInsertId();
- $_SESSION['table_mid'] = $table_mid;
- $_SESSION['table_name'] = $_POST['table_name'];
- $_SESSION['table_fieldname'] = $table_fieldname;
- $_SESSION['table_nbfields'] = $table_nbfields;*/
- $table_action = '&field_mid='.$table_mid.'&field_tid='.$table_iid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname;
+ $table_action='&field_mid='.$table_mid.'&field_tid='.$table_iid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname;
redirect_header('fields.php?op=new'.$table_action, 5, sprintf(_AM_TDMCREATE_TABLE_FORM_SAVED_OK, $_POST['table_name']));
} else {
redirect_header('tables.php', 5, sprintf(_AM_TDMCREATE_TABLE_FORM_UPDATED_OK, $_POST['table_name']));
}
}
-
- $_SESSION['session_table_name'] = $_POST['table_name'];
-
+
$GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
$form = $obj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-06-15 13:43:07 UTC (rev 12601)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-06-15 17:31:37 UTC (rev 12602)
@@ -41,7 +41,7 @@
$this->tdmcreate = TDMCreate::getInstance();
$this->initVar('field_id', XOBJ_DTYPE_INT);
$this->initVar('field_mid', XOBJ_DTYPE_INT);
- $this->initVar('field_tid', XOBJ_DTYPE_INT);
+ $this->initVar('field_tid', XOBJ_DTYPE_INT);
$this->initVar('field_numb', XOBJ_DTYPE_INT);
$this->initVar('field_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('field_type', XOBJ_DTYPE_TXTBOX);
@@ -106,7 +106,6 @@
$field_mid = $isNew ? $f_mid : $this->getVar('field_mid');
$field_tid = $isNew ? $f_tid : $this->getVar('field_tid');
- $field_numb = $isNew ? $f_numb : $this->getVar('field_numb');
$form = new TDMCreateThemeForm(null, 'form', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
@@ -139,7 +138,7 @@
$fields = $this->tdmcreate->getHandler('fields')->getObjects($criteria);
unset($criteria);
$i = 1;
- foreach ($fields as $field) {
+ foreach($fields as $field) {
$this->getFormElements($form, $isNew, 'edit', $i, null, $field_mid, $field_tid, $field);
$i++;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-15 13:43:07 UTC (rev 12601)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-15 17:31:37 UTC (rev 12602)
@@ -109,20 +109,18 @@
$this->structure->makeDir($targetDirectory);
// Copied of index.html file in "root module" folder
$this->structure->copyFile('', $indexFile, 'index.html');
- if(is_object($tables)) {
- if ( $table_admin == 1) {
- // Creation of "admin" folder and index.html file
- $this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html');
- }
- if ( $table_blocks == 1) {
- // Creation of "blocks" folder and index.html file
- $this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
- }
- if ( $table_name != null) {
- // Creation of "class" folder and index.html file
- $this->structure->makeDirAndCopyFile('class', $indexFile, 'index.html');
- }
+ if ( $table_admin == 1) {
+ // Creation of "admin" folder and index.html file
+ $this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html');
}
+ if ( $table_blocks == 1) {
+ // Creation of "blocks" folder and index.html file
+ $this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
+ }
+ if ( $table_name != null) {
+ // Creation of "class" folder and index.html file
+ $this->structure->makeDirAndCopyFile('class', $indexFile, 'index.html');
+ }
// Creation of "assets" folder and index.html file
$this->structure->makeDirAndCopyFile('assets', $indexFile, 'index.html');
// Creation of "css" folder and index.html file
@@ -162,24 +160,22 @@
$this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language'], $indexFile, 'index.html');
// Creation of "language/local_language/help" folder and index.html file
$this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language']. '/help', $indexFile, 'index.html');
- if(is_object($tables)) {
- if (( $table_user == 1) || ( $table_admin == 1 )) {
- // Creation of "templates" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates', $indexFile, 'index.html');
- }
- if ( $table_admin == 1 ) {
- // Creation of "templates/admin" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
- }
- if ( $table_blocks == 1 ) {
- // Creation of "templates/blocks" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
- }
- if ( $table_name != null ) {
- // Creation of "sql" folder and index.html file
- $this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html');
- }
+ if (( $table_user == 1) || ( $table_admin == 1 )) {
+ // Creation of "templates" folder and index.html file
+ $this->structure->makeDirAndCopyFile('templates', $indexFile, 'index.html');
}
+ if ( $table_admin == 1 ) {
+ // Creation of "templates/admin" folder and index.html file
+ $this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
+ }
+ if ( $table_blocks == 1 ) {
+ // Creation of "templates/blocks" folder and index.html file
+ $this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
+ }
+ if ( $table_name != null ) {
+ // Creation of "sql" folder and index.html file
+ $this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html');
+ }
}
/*
@@ -196,7 +192,7 @@
$tables = $this->tdmcreate->getHandler('tables')->getObjects($criteria_tables);
unset($criteria_tables);
$ret = array();
- //
+ //
foreach (array_keys($tables) as $t)
{
$table_mid = $tables[$t]->getVar('table_mid');
@@ -254,156 +250,136 @@
}
/*var_dump($table_name); */
}
- if(is_object($tables)) {
- // Creation of blocks language file
- if ( $table_blocks == 1) {
- // Language Blocks File
- $languageBlocks = LanguageBlocks::getInstance();
- $languageBlocks->write($module, $tables, 'blocks.php');
- $ret[] = $languageBlocks->render();
- }
- }
- if(is_object($tables)) {
- // Language Modinfo File
- $languageModinfo = LanguageModinfo::getInstance();
- $languageModinfo->write($module, $table, $tables, 'modinfo.php');
- $ret[] = $languageModinfo->render();
- } else {
- $table = null; $tables = array();
- // Language Modinfo File
- $languageModinfo = LanguageModinfo::getInstance();
- $languageModinfo->write($module, $table, $tables, 'modinfo.php');
- $ret[] = $languageModinfo->render();
- }
+ // Creation of blocks language file
+ if ( $table_blocks == 1) {
+ // Language Blocks File
+ $languageBlocks = LanguageBlocks::getInstance();
+ $languageBlocks->write($module, $tables, 'blocks.php');
+ $ret[] = $languageBlocks->render();
+ }
// Language Modinfo File
$languageModinfo = LanguageModinfo::getInstance();
$languageModinfo->write($module, $table, $tables, 'modinfo.php');
- $ret[] = $languageModinfo->render();
- if(is_object($tables)) {
- // Creation of admin files
- if ( $table_admin == 1) {
- // Admin Header File
- $adminHeader = AdminHeader::getInstance();
- $adminHeader->write($module, $table, $tables, 'header.php');
- $ret[] = $adminHeader->render();
- // Admin Index File
- $adminIndex = AdminIndex::getInstance();
- $adminIndex->write($module, $tables, 'index.php');
- $ret[] = $adminIndex->render();
- // Admin Menu File
- $adminMenu = AdminMenu::getInstance();
- $adminMenu->write($module, $tables, 'menu.php');
- $ret[] = $adminMenu->render();
- // Creation of admin permission file
- if (( $table_permissions == 1)) {
- // Admin Permissions File
- $adminPermissions = AdminPermissions::getInstance();
- $adminPermissions->write($module, $tables, 'permissions.php');
- $ret[] = $adminPermissions->render();
- }
- // Admin Aboutr File
- $adminAbout = AdminAbout::getInstance();
- $adminAbout->write($module, 'about.php');
- $ret[] = $adminAbout->render();
- // Admin Footer File
- $adminFooter = AdminFooter::getInstance();
- $adminFooter->write($module, 'footer.php');
- $ret[] = $adminFooter->render();
- // Language Admin File
- $languageAdmin = LanguageAdmin::getInstance();
- $languageAdmin->write($module, $tables, 'admin.php');
- $ret[] = $languageAdmin->render();
- }
- // Creation of notifications files
- if ( $table_notifications == 1 ) {
- // Include Notifications File
- $includeNotifications = IncludeNotifications::getInstance();
- $includeNotifications->write($module, $table, 'notifications.php');
- $ret[] = $includeNotifications->render();
+ $ret[] = $languageModinfo->render();
+ // Creation of admin files
+ if ( $table_admin == 1) {
+ // Admin Header File
+ $adminHeader = AdminHeader::getInstance();
+ $adminHeader->write($module, $table, $tables, 'header.php');
+ $ret[] = $adminHeader->render();
+ // Admin Index File
+ $adminIndex = AdminIndex::getInstance();
+ $adminIndex->write($module, $tables, 'index.php');
+ $ret[] = $adminIndex->render();
+ // Admin Menu File
+ $adminMenu = AdminMenu::getInstance();
+ $adminMenu->write($module, $tables, 'menu.php');
+ $ret[] = $adminMenu->render();
+ // Creation of admin permission file
+ if (( $table_permissions == 1)) {
+ // Admin Permissions File
+ $adminPermissions = AdminPermissions::getInstance();
+ $adminPermissions->write($module, $tables, 'permissions.php');
+ $ret[] = $adminPermissions->render();
}
+ // Admin Aboutr File
+ $adminAbout = AdminAbout::getInstance();
+ $adminAbout->write($module, 'about.php');
+ $ret[] = $adminAbout->render();
+ // Admin Footer File
+ $adminFooter = AdminFooter::getInstance();
+ $adminFooter->write($module, 'footer.php');
+ $ret[] = $adminFooter->render();
+ // Language Admin File
+ $languageAdmin = LanguageAdmin::getInstance();
+ $languageAdmin->write($module, $tables, 'admin.php');
+ $ret[] = $languageAdmin->render();
+ }
+ // Creation of notifications files
+ if ( $table_notifications == 1 ) {
+ // Include Notifications File
+ $includeNotifications = IncludeNotifications::getInstance();
+ $includeNotifications->write($module, $table, 'notifications.php');
+ $ret[] = $includeNotifications->render();
}
// Include Install File
$includeInstall = IncludeInstall::getInstance();
$includeInstall->write($module, $tables, 'install.php');
$ret[] = $includeInstall->render();
- if(is_object($tables)) {
- // Creation of sql file
- if ( $table_name != null) {
- // Sql File
- $sqlFile = SqlFile::getInstance();
- $sqlFile->write($module, $tables, 'mysql.sql');
- $ret[] = $sqlFile->render();
- }
- // Creation of search file
- if ( $table_search == 1) {
- // Include Search File
- $includeSearch = IncludeSearch::getInstance();
- $includeSearch->write($module, $table, 'search.php');
- $ret[] = $includeSearch->render();
- }
+ // Creation of sql file
+ if ( $table_name != null) {
+ // Sql File
+ $sqlFile = SqlFile::getInstance();
+ $sqlFile->write($module, $tables, 'mysql.sql');
+ $ret[] = $sqlFile->render();
}
+ // Creation of search file
+ if ( $table_search == 1) {
+ // Include Search File
+ $includeSearch = IncludeSearch::getInstance();
+ $includeSearch->write($module, $table, 'search.php');
+ $ret[] = $includeSearch->render();
+ }
// Creation of comments files
- if(is_object($tables)) {
- if ( $table->getVar('table_comments') == 1) {
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table);
- $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_edit');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table);
- $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_delete');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table);
- $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_post');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table);
- $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_reply');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table);
- $ret[] = $includeComments->renderCommentsNew($module, 'comment_new');
- }
- // Creation of user files
- if ( ($table_user == 1)){
- // Templates Index File
- $templatesIndex = TemplatesIndex::getInstance();
- $templatesIndex->write($module, 'index.tpl');
- $ret[] = $templatesIndex->render();
- // User Footer File
- $userFooter = UserFooter::getInstance();
- $userFooter->write($module, 'footer.php');
- $ret[] = $userFooter->render();
- // User Header File
- $userHeader = UserHeader::getInstance();
- $userHeader->write($module, 'header.php');
- $ret[] = $userHeader->render();
- // User Notification Update File
- if ( ($table_notifications == 1 )){
- $userNotificationUpdate = UserNotificationUpdate::getInstance();
- $userNotificationUpdate->write($module, 'notification_update.php');
- $ret[] = $userNotificationUpdate->render();
- }
- // Templates Footer File
- $templatesFooter = TemplatesFooter::getInstance();
- $templatesFooter->write($module, $table, 'footer.tpl');
- $ret[] = $templatesFooter->render();
- // Templates Header File
- $templatesHeader = TemplatesHeader::getInstance();
- $templatesHeader->write($module, $tables, 'header.tpl');
- $ret[] = $templatesHeader->render();
- // User Index File
- $userIndex = UserIndex::getInstance();
- $userIndex->write($module, 'index.php');
- $ret[] = $userIndex->render();
- // Language Main File
- $languageMain = LanguageMain::getInstance();
- $languageMain->write($module, $table, $tables, 'main.php');
- $ret[] = $languageMain->render();
- }
+ if ( $table->getVar('table_comments') == 1) {
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table);
+ $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_edit');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table);
+ $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_delete');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table);
+ $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_post');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table);
+ $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_reply');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table);
+ $ret[] = $includeComments->renderCommentsNew($module, 'comment_new');
}
+ // Creation of user files
+ if ( ($table_user == 1)){
+ // Templates Index File
+ $templatesIndex = TemplatesIndex::getInstance();
+ $templatesIndex->write($module, 'index.tpl');
+ $ret[] = $templatesIndex->render();
+ // User Footer File
+ $userFooter = UserFooter::getInstance();
+ $userFooter->write($module, 'footer.php');
+ $ret[] = $userFooter->render();
+ // User Header File
+ $userHeader = UserHeader::getInstance();
+ $userHeader->write($module, 'header.php');
+ $ret[] = $userHeader->render();
+ // User Notification Update File
+ if ( ($table_notifications == 1 )){
+ $userNotificationUpdate = UserNotificationUpdate::getInstance();
+ $userNotificationUpdate->write($module, 'notification_update.php');
+ $ret[] = $userNotificationUpdate->render();
+ }
+ // Templates Footer File
+ $templatesFooter = TemplatesFooter::getInstance();
+ $templatesFooter->write($module, $table, 'footer.tpl');
+ $ret[] = $templatesFooter->render();
+ // Templates Header File
+ $templatesHeader = TemplatesHeader::getInstance();
+ $templatesHeader->write($module, $tables, 'header.tpl');
+ $ret[] = $templatesHeader->render();
+ // User Index File
+ $userIndex = UserIndex::getInstance();
+ $userIndex->write($module, 'index.php');
+ $ret[] = $userIndex->render();
+ // Language Main File
+ $languageMain = LanguageMain::getInstance();
+ $languageMain->write($module, $table, $tables, 'main.php');
+ $ret[] = $languageMain->render();
+ }
// Class Helper File
$classHelper = ClassHelper::getInstance();
$classHelper->write($module, 'helper.php');
@@ -432,18 +408,10 @@
$includeJquery = IncludeJquery::getInstance();
$includeJquery->write($module, 'functions.js');
$ret[] = $includeJquery->render();
- if(is_object($tables)) {
- // User Xoops Version File
- $userXoopsVersion = UserXoopsVersion::getInstance();
- $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
- $ret[] = $userXoopsVersion->render();
- } else {
- $table = null; $tables = array();
- // User Xoops Version File
- $userXoopsVersion = UserXoopsVersion::getInstance();
- $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
- $ret[] = $userXoopsVersion->render();
- }
+ // User Xoops Version File
+ $userXoopsVersion = UserXoopsVersion::getInstance();
+ $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
+ $ret[] = $userXoopsVersion->render();
// Return Array
return $ret;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php 2014-06-15 13:43:07 UTC (rev 12601)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php 2014-06-15 17:31:37 UTC (rev 12602)
@@ -73,7 +73,7 @@
\$criteria = new CriteriaCompo();
array_shift(\$options);
array_shift(\$options);
- array_shift(\$options);\n
+ array_shift(\$options);\n
EOT;
if ( $table_category == 1 ) {
$ret .= <<<EOT
@@ -81,8 +81,7 @@
\$criteria->add(new Criteria('{$table_fieldname}_category', {$mod_name_lowercase}_block_addCatSelect(\$options), 'IN'));
}\n
EOT;
- }
-
+ }
$ret .= <<<EOT
if (\$type_block)
{
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/install.php 2014-06-15 13:43:07 UTC (rev 12601)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/install.php 2014-06-15 17:31:37 UTC (rev 12602)
@@ -65,10 +65,11 @@
$filename = $this->getFileName();
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
-\n\$indexFile = XOOPS_UPLOAD_PATH.'/index.html';
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+\$indexFile = XOOPS_UPLOAD_PATH.'/index.html';
\$blankFile = XOOPS_UPLOAD_PATH.'/blank.gif';
-// Making of "uploads" folder
+// Making of "uploads/{$module_name}" folder
\${$module_name} = XOOPS_UPLOAD_PATH.'/{$module_name}';
if(!is_dir(\${$module_name}))
mkdir(\${$module_name}, 0777);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php 2014-06-15 13:43:07 UTC (rev 12601)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php 2014-06-15 17:31:37 UTC (rev 12602)
@@ -56,14 +56,14 @@
$this->setTables($tables);
}
/*
- * @public function getHead
+ * @public function getMain
* @param string $language
* @param string $module
*/
- public function getHead($language, $module) {
+ public function getMain($language, $module) {
$ret = <<<EOT
-// Head
-define('{$language}NAME', "{$module->getVar('module_name')}");
+// Main
+define('{$language}NAME', "{$module->getVar('mod_name')}");
define('{$language}DESC', "{$module->getVar('mod_description')}");\n
EOT;
return $ret;
@@ -76,7 +76,7 @@
public function getMenu($language, $tables) {
$menu = 1;
$ret = <<<EOT
-//Menu
+// Menu
define('{$language}ADMENU{$menu}', "Dashboard");\n
EOT;
@@ -85,18 +85,18 @@
$menu++;
$ucf_table_name = ucfirst(str_replace('_', ' ', $tables[$i]->getVar('table_name')));
$table_permissions = $tables[$i]->getVar('table_permissions');
- $content .= <<<EOT
+ $ret .= <<<EOT
define('{$language}ADMENU{$menu}', "{$ucf_table_name}");\n
EOT;
}
if ( $table_permissions != 0 ) {
$menu++;
- $content .= <<<EOT
+ $ret .= <<<EOT
define('{$language}ADMENU{$menu}', "Permissions");\n
EOT;
}
$menu++;
- $content .= <<<EOT
+ $ret .= <<<EOT
define('{$language}ADMENU{$menu}', "About");\n
EOT;
unset( $menu );
@@ -121,16 +121,16 @@
*/
public function getBlocks($language, $tables) {
$ret = <<<EOT
-//Blocks\n
+// Blocks\n
EOT;
foreach (array_keys($tables) as $i)
{
$table_name = $tables[$i]->getVar('table_name');
- $language1 = $language.'_'.strtoupper($table_name);
+ $language1 = $language.strtoupper($table_name);
$table_name = str_replace("_", " ", ucfirst($table_name));
if ( $tables[$i]->getVar('table_blocks') == 1 ) {
$ret .= <<<EOT
-define('{$language1}BLOCK', "{$table_name} block");\n
+define('{$language1}_BLOCK', "{$table_name} block");\n
EOT;
}
}
@@ -155,7 +155,7 @@
*/
public function getConfig($language, $table) {
$ret = <<<EOT
-//Config
+// Config
define('{$language}EDITOR', "Editor");
define('{$language}EDITOR_DESC', "Select the Editor to use");
define('{$language}KEYWORDS', "Keywords");
@@ -257,13 +257,13 @@
$module_name = $module->getVar('mod_name');
$language = $this->getLanguage($module_name, 'MI');
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getHead($language, $module);
+ $content .= $this->getMain($language, $module);
$content .= $this->getAdmin($language);
$content .= $this->getUser($language);
- if(is_object($tables)) {
+ //if(is_object($tables)) {
$content .= $this->getMenu($language, $tables);
$content .= $this->getBlocks($language, $tables);
- }
+ //}
if(is_object($table)) {
$content .= $this->getConfig($language, $table);
if ( $table->getVar('table_notifications') == 1 )
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql/mysql.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql/mysql.php 2014-06-15 13:43:07 UTC (rev 12601)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql/mysql.php 2014-06-15 17:31:37 UTC (rev 12602)
@@ -129,7 +129,7 @@
*/
public function getDatabaseFields($module_name, $table_id, $table_name, $table_autoincrement, $nb_fields)
{
- $ret = null; $j = 1; $comma = array();
+ $ret = null; $j = 0; $comma = array(); $row = array();
$fields = $this->getTableFields($table_id);
foreach(array_keys($fields) as $f)
{
@@ -159,53 +159,64 @@
$type = $field_type.'('.$field_value.')';
$default = "DEFAULT '{$field_default}'";
break;
- }
- switch( $field_key ) {
- case 'PRIMARY':
- if ( ($f == 1) && ($table_autoincrement == 1) ) {
- $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, null, 'auto_increment');
- $comma[$j] = $this->getKey(1, $field_name);
- } else {
- $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
- $comma[$j] = $this->getKey(1, $field_name);
- }
- break;
- case 'UNIQUE':
- $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
- $comma[$j] = $this->getKey(2, $field_name);
- break;
- case 'INDEX':
- $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
- $comma[$j] = $this->getKey(3, $field_name);
- break;
- case 'FULLTEXT':
- $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
- $comma[$j] = $this->getKey(4, $field_name);
- break;
- default:
- $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
- break;
- }
- $j++;
+ }
+ if ( ($f == 0) && ($table_autoincrement == 1) ) {
+ $row[] = $this->getFieldRow($field_name, $type, $field_attribute, $field_null, null, 'AUTO_INCREMENT');
+ $comma[$j] = ' PRIMARY KEY (`'.$field_name.'`)';//$this->getKey(1, $field_name);
+ $j++;
+ } else {
+ if ( $field_key == 'UNIQUE' || $field_key == 'INDEX' || $field_key == 'FULLTEXT')
+ {
+ switch( $field_key ) {
+ case 'UNIQUE':
+ $row[] = $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
+ $comma[$j] = ' KEY `'.$field_name.'` (`'.$field_name.'`)';//$this->getKey(2, $field_name);
+ $j++;
+ break;
+ case 'INDEX':
+ $row[] = $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
+ $comma[$j] = ' INDEX (`'.$field_name.'`)';//$this->getKey(3, $field_name);
+ $j++;
+ break;
+ case 'FULLTEXT':
+ $row[] = $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
+ $comma[$j] = ' FULLTEXT KEY `'.$field_name.'` (`'.$field_name.'`)';//$this->getKey(4, $field_name);
+ $j++;
+ break;
+ }
+ } else {
+ $row[] = $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
+ }
+ }
}
- }
- $ret .= $this->getCommaCicle($j, $comma);
+ }
+ for ($i=0; $i < $j; $i++) {
+ if ( $i != $j - 1 ) {
+ $row[] = $comma[$i].',';
+ } else {
+ $row[] = $comma[$i];
+ }
+ }
+ // echo $key."================= KEY ========================= </br>";
+ $ret .= implode("\n", $row);
+ //$ret .= $key;
+ //$row[] = $this->getCommaCicle($j, $comma);
unset($j);
$ret .= $this->getFootDatabaseTable();
return $ret;
}
/*
- * @public function getFootDatabaseTable
+ * @private function getFootDatabaseTable
* @param null
*/
- public function getFootDatabaseTable() {
+ private function getFootDatabaseTable() {
$ret = <<<SQL
\n) ENGINE=MyISAM;\n
SQL;
return $ret;
}
/*
- * @public function getFieldRow
+ * @private function getFieldRow
* @param string $field_name
* @param string $field_type_value
* @param string $field_attribute
@@ -213,20 +224,20 @@
* @param string $field_default
* @param string $autoincrement
*/
- public function getFieldRow($field_name, $field_type_value, $field_attribute = null, $field_null = null, $field_default = null, $autoincrement = null) {
+ private function getFieldRow($field_name, $field_type_value, $field_attribute = null, $field_null = null, $field_default = null, $autoincrement = null) {
$ret_autoincrement = <<<SQL
- `{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$autoincrement}
+ `{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$autoincrement},
SQL;
$ret_field_attribute = <<<SQL
- `{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$field_default}
+ `{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$field_default},
SQL;
$ret_no_field_attribute = <<<SQL
- `{$field_name}` {$field_type_value} {$field_null} {$field_default}
+ `{$field_name}` {$field_type_value} {$field_null} {$field_default},
SQL;
$ret_short = <<<SQL
- `{$field_name}` {$field_type_value}
+ `{$field_name}` {$field_type_value},
SQL;
- if(!empty($autoincrement)) {
+ if($autoincrement != null) {
$ret = $ret_autoincrement;
} elseif($field_attribute != null) {
$ret = $ret_field_attribute;
@@ -238,30 +249,30 @@
return $ret;
}
/*
- * @public function getKey
+ * @private function getKey
* @param integer $key
* @param array $field_name
*/
- public function getKey($key, $field_name) {
+ private function getKey($key, $field_name) {
switch( $key ) {
case 1:
$ret = <<<SQL
-PRIMARY KEY (`$field_name`)
+ PRIMARY KEY (`$field_name`)
SQL;
break;
case 2: // UNIQUE KEY
$ret = <<<SQL
-KEY `$field_name` (`$field_name`)
+ KEY `$field_name` (`$field_name`)
SQL;
break;
case 3:
$ret = <<<SQL
-INDEX (`$field_name`)
+ INDEX (`$field_name`)
SQL;
break;
case 4:
$ret = <<<SQL
-FULLTEXT KEY `$field_name` (`$field_name`)
+ FULLTEXT KEY `$field_name` (`$field_name`)
SQL;
break;
}
@@ -269,21 +280,21 @@
}
/*
- * @public function getComma
+ * @private function getComma
* @param array $array
* @param string $comma
*/
- public function getComma($array = array(), $comma = null) {
+ private function getComma($array = array(), $comma = null) {
$ret = <<<SQL
{$array}{$comma}
SQL;
return $ret;
}
/*
- * @public function getCommaCicle
+ * @private function getCommaCicle
* @param integer $index
*/
- public function getCommaCicle($index, $comma = array()) {
+ private function getCommaCicle($index, $comma = array()) {
// Comma issue
$ret = '';
for ($i = 1; $i <= $index; $i++)
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-15 13:43:07 UTC (rev 12601)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-15 17:31:37 UTC (rev 12602)
@@ -89,10 +89,10 @@
{
$date = date('D Y/m/d G:i:s');
$ret = <<<EOT
-\nif (!defined('XOOPS_ROOT_PATH')){ exit(); }
-
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+//
\$dirname = basename( dirname( __FILE__ ) ) ;
-
+//
\$modversion = array(
'name' => {$language}NAME,
'version' => {$module->getVar('mod_version')},
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/session.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/session.php 2014-06-15 13:43:07 UTC (rev 12601)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/session.php 2014-06-15 17:31:37 UTC (rev 12602)
@@ -31,7 +31,9 @@
*/
protected function __construct()
{
- @session_start();
+ if(!isset($_SESSION)) {
+ session_start();
+ }
}
/*
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl 2014-06-15 13:43:07 UTC (rev 12601)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl 2014-06-15 17:31:37 UTC (rev 12602)
@@ -47,7 +47,7 @@
<a href="tables.php?op=edit&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_EDIT_TABLE}>">
<img src="<{xoModuleIcons16 edit.png}>" alt="<{$smarty.const._AM_TDMCREATE_EDIT_TABLE}>" />
</a> <!-- &field_mid=<{$table.mid}>&field_tid=<{$table.id}>&field_numb=<{$table.nbfields}> -->
- <a href="fields.php?op=edit&field_tid=<{$table.id}>&field_numb=<{$table.nbfields}>" title="<{$smarty.const._AM_TDMCREATE_EDIT_FIELDS}>">
+ <a href="fields.php?op=edit&field_tid=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_EDIT_FIELDS}>">
<img src="<{xoModuleIcons16 inserttable.png}>" alt="<{$smarty.const._AM_TDMCREATE_EDIT_FIELDS}>" />
</a>
<a href="tables.php?op=delete&table_id=<{$table.id}>" title="<{$smarty.const._DELETE}>">
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tables.tpl
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tables.tpl 2014-06-15 13:43:07 UTC (rev 12601)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tables.tpl 2014-06-15 17:31:37 UTC (rev 12602)
@@ -82,7 +82,7 @@
<a href="tables.php?op=edit&table_id=<{$table.id}>" title="<{$smarty.const._EDIT}>">
<img src="<{xoModuleIcons16 edit.png}>" alt="<{$smarty.const._EDIT}>" />
</a>
- <a href="fields.php?op=edit&field_mid=<{$table.mid}>&field_tid=<{$table.id}>&field_numb=<{$table.nbfields}>" title="<{$smarty.const._EDIT}>">
+ <a href="fields.php?op=edit&field_tid=<{$table.id}>" title="<{$smarty.const._EDIT}>">
<img src="<{$modPathIcon16}>/editfields.png" alt="<{$smarty.const._EDIT}>" />
</a>
<a href="tables.php?op=delete&table_id=<{$table.id}>" title="<{$smarty.const._DELETE}>">
|