|
From: <txm...@us...> - 2014-05-01 16:22:48
|
Revision: 12517
http://sourceforge.net/p/xoops/svn/12517
Author: txmodxoops
Date: 2014-05-01 16:22:45 +0000 (Thu, 01 May 2014)
Log Message:
-----------
Fix issues regard saving multifields in database
Moved from fields (database table) to tables (database table)
auto_increment option
Updated - Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.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/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/fields.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/about.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/building.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/footer.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/header.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/index.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/modules.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tables.tpl
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/jq.init.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_about.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_header.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_help.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -19,7 +19,7 @@
* @version $Id: about.php 11084 2013-02-23 15:44:20Z timgno $
*/
include 'header.php';
-$template_main = 'tdmcreate_about.html';
+$template_main = 'about.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('about.php'));
$GLOBALS['xoopsTpl']->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false));
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -64,16 +64,16 @@
$template_main = 'tdmcreate_building.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
// Redirect if there aren't modules
- $nb_modules = $modulesHandler->getObjects(null);
+ $nb_modules = $modulesHandler->getCount();
if ( $nb_modules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
unset($nb_modules);
// Redirect if there aren't tables
- $nb_tables = $tablesHandler->getObjects(null);
+ $nb_tables = $tablesHandler->getCount();
if ($nb_tables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
- }
+ }
unset($nb_tables);
include_once TDMC_PATH . '/class/building.php';
$handler = TDMCreateBuilding::getInstance();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -53,7 +53,7 @@
$start = TDMCreateRequest::getInt('start', 0);
$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('fields_adminpager'));
// Define main template
- $template_main = 'tdmcreate_fields.html';
+ $template_main = 'fields.tpl';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
@@ -64,12 +64,13 @@
$GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
$GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
// Redirect if there aren't modules
- $nb_modules = $modulesHandler->getObjects(null);
+ $nb_modules = $modulesHandler->getCount();
if ( $nb_modules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
unset($nb_modules);
- $nb_tables = $tablesHandler->getObjects(null);
+ // Redirect if there aren't tables
+ $nb_tables = $tablesHandler->getCount();
if ($nb_tables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
@@ -133,13 +134,13 @@
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
- $GLOBALS['xoopsTpl']->assign('error', 'Add, Edit or List View in Fields');
+ $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_FIELDS);
}
break;
case 'new':
// Define main template
- $template_main = 'tdmcreate_fields.html';
+ $template_main = 'fields.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
$adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
@@ -160,35 +161,32 @@
$obj =& $fieldsHandler->get($field_id);
} else {
$obj =& $fieldsHandler->create();
- }
+ }
//
if ($field_numb > 0) {
- for( $i = 0; $i < $field_numb; $i++ ) {
- $datas = array('field_mid' => $table_mid[$i],
- 'field_tid' => $table_id[$i],
- 'field_numb' => $field_numb[$i],
- 'field_name' => $_POST['field_name'][$i],
- 'field_type' => $_POST['field_type'][$i],
- 'field_value' => $_POST['field_value'][$i],
- 'field_attribute' => $_POST['field_attribute'][$i],
- 'field_null' => $_POST['field_null'][$i],
- 'field_default' => $_POST['field_default'][$i],
- 'field_key' => $_POST['field_key'][$i],
- 'field_autoincrement' => (($_REQUEST['field_autoincrement'][$i] == 1) ? '1' : '0'),
- 'field_element' => $_POST['field_element'][$i],
- 'field_inlist' => (($_REQUEST['field_inlist'][$i] == 1) ? '1' : '0'),
- 'field_inform' => (($_REQUEST['field_inform'][$i] == 1) ? '1' : '0'),
- 'field_admin' => (($_REQUEST['field_admin'][$i] == 1) ? '1' : '0'),
- 'field_user' => (($_REQUEST['field_user'][$i] == 1) ? '1' : '0'),
- 'field_block' => (($_REQUEST['field_block'][$i] == 1) ? '1' : '0'),
- 'field_main' => (($i == $_REQUEST['field_main']) ? '1' : '0'),
- 'field_search' => (($_REQUEST['field_search'][$i] == 1) ? '1' : '0'),
- 'field_required' => (($_REQUEST['field_required'][$i] == 1) ? '1' : '0')
- );
- foreach ($datas as $key => $value) {
- $obj->setVars( $value );
- $fieldsHandler->insert($obj);
- }
+ for( $i = 1; $i <= $field_numb; $i++ ) {
+
+ $obj->setVar( 'field_mid', $field_mid );
+ $obj->setVar( 'field_tid', $field_tid );
+ $obj->setVar( 'field_numb', $field_numb );
+ $obj->setVar( 'field_name', (isset($_POST['field_name'][$i]) ? $_POST['field_name'][$i] : '') );
+ $obj->setVar( 'field_type', (isset($_POST['field_type'][$i]) ? $_POST['field_type'][$i] : '') );
+ $obj->setVar( 'field_value', (isset($_POST['field_value'][$i]) ? $_POST['field_value'][$i] : '') );
+ $obj->setVar( 'field_attribute', (isset($_POST['field_attribute'][$i]) ? $_POST['field_attribute'][$i] : '') );
+ $obj->setVar( 'field_null', (isset($_POST['field_null'][$i]) ? $_POST['field_null'][$i] : '') );
+ $obj->setVar( 'field_default', (isset($_POST['field_default'][$i]) ? $_POST['field_default'][$i] : '') );
+ $obj->setVar( 'field_key', (isset($_POST['field_key'][$i]) ? $_POST['field_key'][$i] : '') );
+ $obj->setVar( 'field_element', (isset($_POST['field_element'][$i]) ? $_POST['field_element'][$i] : '') );
+ $obj->setVar( 'field_inlist', ((isset($_REQUEST['field_inlist'][$i]) == 1) ? '1' : '0') );
+ $obj->setVar( 'field_inform', ((isset($_REQUEST['field_inform'][$i]) == 1) ? '1' : '0') );
+ $obj->setVar( 'field_admin', ((isset($_REQUEST['field_admin'][$i]) == 1) ? '1' : '0') );
+ $obj->setVar( 'field_user', ((isset($_REQUEST['field_user'][$i]) == 1) ? '1' : '0') );
+ $obj->setVar( 'field_block', ((isset($_REQUEST['field_block'][$i]) == 1) ? '1' : '0') );
+ $obj->setVar( 'field_main', (($i == isset($_REQUEST['field_main'])) ? '1' : '0') );
+ $obj->setVar( 'field_search', ((isset($_REQUEST['field_search'][$i]) == 1) ? '1' : '0') );
+ $obj->setVar( 'field_required', ((isset($_REQUEST['field_required'][$i]) == 1) ? '1' : '0') );
+
+ $fieldsHandler->insert($obj);
}
}
//
@@ -199,13 +197,13 @@
}
//
$GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
- $form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
+ $form = $obj->getForm($field_mid, $field_tid, $field_numb);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'edit':
// Define main template
- $template_main = 'tdmcreate_tables.html';
+ $template_main = 'tables.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -24,7 +24,7 @@
$count_tables = $tablesHandler->getCount($criteria);
$count_fields = $fieldsHandler->getCount($criteria);
unset($criteria);
-$template_main = 'tdmcreate_index.html';
+$template_main = 'index.tpl';
$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');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -22,7 +22,7 @@
// Recovered value of argument op in the URL $
//$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
//$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id');
-//$tdmcreate = TDMCreate::getInstance();
+$tdmcreate = TDMCreate::getInstance();
$op = TDMCreateRequest::getString('op', 'list');
//
$mod_id = TDMCreateRequest::getInt('mod_id');
@@ -36,7 +36,7 @@
$start = TDMCreateRequest::getInt('start', 0);
$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
// Define main template
- $template_main = 'tdmcreate_modules.html';
+ $template_main = 'modules.tpl';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
@@ -79,13 +79,13 @@
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
- $GLOBALS['xoopsTpl']->assign('error', 'There aren\'t modules');
+ $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_MODULES);
}
break;
case 'new':
// Define main template
- $template_main = 'tdmcreate_modules.html';
+ $template_main = 'modules.tpl';
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
@@ -158,6 +158,7 @@
'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'),
'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0'),
'mod_permissions' => (($_REQUEST['mod_permissions'] == 1) ? '1' : '0'),
+ 'mod_inroot_copy' => (($_REQUEST['mod_inroot_copy'] == 1) ? '1' : '0'),
'mod_donations' => $_POST['mod_donations'],
'mod_subversion' => $_POST['mod_subversion'])
);
@@ -173,7 +174,7 @@
case 'edit':
// Define main template
- $template_main = 'tdmcreate_modules.html';
+ $template_main = 'modules.tpl';
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -46,7 +46,7 @@
$start = TDMCreateRequest::getInt('start', 0);
$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
// Define main template
- $template_main = 'tdmcreate_tables.html';
+ $template_main = 'tables.tpl';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
@@ -128,13 +128,13 @@
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
- $GLOBALS['xoopsTpl']->assign('error', 'There aren\'t modules');
+ $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_TABLES);
}
break;
case 'new':
// Define main template
- $template_main = 'tdmcreate_tables.html';
+ $template_main = 'tables.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
@@ -217,7 +217,7 @@
case 'edit':
// Define main template
- $template_main = 'tdmcreate_tables.html';
+ $template_main = 'tables.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=list', 'list');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -9,11 +9,11 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
- * tdmcreate module
+ * tdmcreatereate 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
+ * @package tdmcreatereate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $
@@ -30,7 +30,7 @@
/**
* @var mixed
*/
- private $tdmc = null;
+ private $tdmcreate = null;
/**
* @var mixed
@@ -43,7 +43,7 @@
*/
public function __construct()
{
- $this->tdmc = TDMCreate::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
$this->table = TDMCreateTables::getInstance();
$this->initVar('field_id', XOBJ_DTYPE_INT);
$this->initVar('field_mid', XOBJ_DTYPE_INT);
@@ -54,9 +54,9 @@
$this->initVar('field_attribute', XOBJ_DTYPE_TXTBOX);
$this->initVar('field_null', XOBJ_DTYPE_TXTBOX);
$this->initVar('field_default', XOBJ_DTYPE_TXTBOX);
- $this->initVar('field_key', XOBJ_DTYPE_TXTBOX);
- $this->initVar('field_autoincrement', XOBJ_DTYPE_INT);
+ $this->initVar('field_key', XOBJ_DTYPE_TXTBOX);
$this->initVar('field_element', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_parent', XOBJ_DTYPE_INT);
$this->initVar('field_inlist', XOBJ_DTYPE_INT);
$this->initVar('field_inform', XOBJ_DTYPE_INT);
$this->initVar('field_admin', XOBJ_DTYPE_INT);
@@ -116,13 +116,13 @@
$form = new TDMCreateThemeForm(null, 'form', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
- $tablesHandler = $this->tdmc->getHandler('tables');
- //$fieldsHandler = $this->tdmc->getHandler('fields');
- $fieldelementsHandler =& $this->tdmc->getHandler('fieldelements');
- $fieldtypeHandler =& $this->tdmc->getHandler('fieldtype');
- $fieldattrsHandler =& $this->tdmc->getHandler('fieldattributes');
- $fieldnullHandler =& $this->tdmc->getHandler('fieldnull');
- $fieldkeyHandler =& $this->tdmc->getHandler('fieldkey');
+ $tablesHandler = $this->tdmcreate->getHandler('tables');
+ //$fieldsHandler = $this->tdmcreate->getHandler('fields');
+ $fieldelementsHandler =& $this->tdmcreate->getHandler('fieldelements');
+ $fieldtypeHandler =& $this->tdmcreate->getHandler('fieldtype');
+ $fieldattrsHandler =& $this->tdmcreate->getHandler('fieldattributes');
+ $fieldnullHandler =& $this->tdmcreate->getHandler('fieldnull');
+ $fieldkeyHandler =& $this->tdmcreate->getHandler('fieldkey');
// New Object HtmlTable
$form->addElement(new TDMCreateFormLabel('<table border="0" cellspacing="1" class="outer width100">'));
$form->addElement(new TDMCreateFormLabel('<thead class="center">'));
@@ -175,17 +175,15 @@
$field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key['.$i.']', $this->getVar('field_key'));
$field_key_select->addOptionArray($fieldkeyHandler->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_key_select->render().'</td>'));
- // Field Autoincrement
- if($i == 1) {
- $field_autoincrement = $this->isNew() ? 1 : $this->getVar('field_autoincrement');
- $check_field_autoincrement = new XoopsFormCheckBox(' ', 'field_autoincrement['.$i.']', $field_autoincrement);
- $check_field_autoincrement->addOption(1, _AM_TDMCREATE_FIELD_AUTO_INCREMENT);
- $form->addElement(new TDMCreateFormLabel('<td>'.$check_field_autoincrement->render().'</td></tr>'));
- } elseif($i > 1) {
+ // Field Void
+ $table_autoincrement = $this->tdmcreate->getHandler('tables')->get($f_tid);
+ if( ($i == 1) && ($table_autoincrement->getVar('table_autoincrement') == 1)/**/) {
+ $form->addElement(new TDMCreateFormLabel('<td> </td></tr>'));
+ } else {
// Box header row
$parameters_tray = new XoopsFormElementTray('', '<br />');
// Field Elements
- $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$i.']', $this->getVar('field_element'));
+ $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$i.']', $this->getVar('field_element'));
$field_elements_select->addOptionArray($fieldelementsHandler->getList());
$criteria = new CriteriaCompo(new Criteria('table_id', $f_tid));
$criteria->add(new Criteria('table_mid', $f_mid));
@@ -270,7 +268,7 @@
$f_tid = $this->table->getVar('table_id');
$f_numb = $this->table->getVar('table_nbfields');
//$f_name = $this->table->getVar('table_fieldname');
- $ret['edit_form'] = $this->getForm($f_mid, $f_tid, $f_numb/*, $f_name*/);
+ $ret['edit'] = $this->getForm($f_mid, $f_tid, $f_numb/*, $f_name*/);
return $ret;
}
}
@@ -279,11 +277,11 @@
* @extends XoopsPersistableObjectHandler
*/
class TDMCreateFieldsHandler extends XoopsPersistableObjectHandler
-{
+{
/**
* @var mixed
*/
- public $tdmc = null;
+ public $tdmcreate = null;
/**
* @var mixed
@@ -295,8 +293,8 @@
* @param mixed $db
*/
public function __construct(&$db)
- {
- $this->tdmc = TDMCreate::getInstance();
+ {
+ $this->tdmcreate = TDMCreate::getInstance();
$this->table = TDMCreateTables::getInstance();
parent::__construct($db, 'mod_tdmcreate_fields', 'tdmcreatefields', 'field_id', 'field_tid');
}
@@ -323,6 +321,98 @@
return parent::get($id);
}
+ /**
+ * insert a new field in the database
+ *
+ * @param object $field reference to the {@link TDMCreateFields} object
+ * @param bool $force
+ *
+ * @return bool FALSE if failed, TRUE if already present and unchanged or successful
+ */
+ public function insert(&$field, $force = false)
+ {
+ if (!parent::insert($field, $force)) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * delete fields matching a set of conditions
+ *
+ * @param object $criteria {@link CriteriaElement}
+ *
+ * @return bool FALSE if deletion failed
+ */
+ public function deleteAll($criteria = null)
+ {
+ //todo resource consuming, use get list instead?
+ $fields = $this->getObjects($criteria);
+ foreach ($fields as $field) {
+ $this->delete($field);
+ }
+ return true;
+ }
+
+ /**
+ * @param $field_tid
+ *
+ * @return bool
+ */
+ public function updateAll($field_tid)
+ {
+ $criteria = new Criteria('field_tid', $field_tid);
+ if ($this->updateAll($criteria)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * get all the fields that match the supplied parameters
+ *
+ * @param $side
+ * @param $tableid tableid (can be an array)
+ * @param $orderby order of the fields
+ * @returns array of field objects
+ */
+ public function getAllFieldsByTable($table_mid, $asobject = true, $side = null, $orderby = "f.field_mid, f.field_tid")
+ {
+ $ret = array();
+ if (!$asobject) {
+ $sql = 'SELECT f.field_mid, f.field_tid ';
+ } else {
+ $sql = 'SELECT f.* ';
+ }
+ $sql .= "FROM " . $this->db->prefix("mod_tdmcreaterate_fields") . " f LEFT JOIN " . $this->db->prefix("mod_tdmcreaterate_tables") . " t ON f.field_tid=t.table_id WHERE table_mid = ".$table_mid;
+ if (is_array($tableid)) {
+ $sql .= " AND (t.table_id=" . $tableid[0] . "";
+ $sql .= ")";
+ } else {
+ $sql .= " AND t.table_id=" . $tableid . "";
+ }
+ if (isset($side)) {
+ // get both sides in sidebox? (some themes need this)
+ $side = "f.field_side=" . $side;
+ $sql .= " AND " . $side;
+ }
+ $sql .= " ORDER BY $orderby";
+ $result = $this->db->query($sql);
+ $added = array();
+ while ($myrow = $this->db->fetchArray($result)) {
+ if (!in_array($myrow['field_id'], $added)) {
+ if (!$asobject) {
+ $ret[] = $myrow['field_id'];
+ } else {
+ $ret[] = new TDMCreateFields($myrow);
+ }
+ array_push($added, $myrow['field_id']);
+ }
+ }
+ return $ret;
+ }
+
/*
* @public function getFieldModuleId
* @param integer $field_id
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -75,7 +75,7 @@
$this->initVar('mod_comments',XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('active_comments'));
$this->initVar('mod_notifications', XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('active_notifications'));
$this->initVar('mod_permissions', XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('active_permissions'));
- $this->initVar('mod_install', XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('inroot_install'));
+ $this->initVar('mod_inroot_copy', XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('inroot_copy'));
$this->initVar('mod_donations', XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('donations'));
$this->initVar('mod_subversion', XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('subversion'));
}
@@ -139,28 +139,28 @@
$editor_configs['cols'] = 100;
$editor_configs['width'] = '50%';
$editor_configs['height'] = '100px';
- $editor_configs['editor'] = $GLOBALS['xoopsModuleConfig']['tdmcreate_editor'];
+ $editor_configs['editor'] = $this->tdmcreate->getConfig('tdmcreate_editor');
$form->addElement( new XoopsFormEditor(_AM_TDMCREATE_MODULE_DESCRIPTION, 'mod_description', $editor_configs), true);
// Author
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, 'mod_author', 50, 255, $this->getVar('mod_author')), true);
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, 'mod_license', 50, 255, $this->getVar('mod_license')), true);
- $mod_admin = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['display_admin'] : $this->getVar('mod_admin');
+ $mod_admin = $this->isNew() ? $this->tdmcreate->getConfig('display_admin') : $this->getVar('mod_admin');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_ADMIN, 'mod_admin', $mod_admin, _YES, _NO));
- $mod_user = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['display_user'] : $this->getVar('mod_user');
+ $mod_user = $this->isNew() ? $this->tdmcreate->getConfig('display_user') : $this->getVar('mod_user');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_USER, 'mod_user', $mod_user, _YES, _NO));
- $mod_search = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_search'] : $this->getVar('mod_search');
+ $mod_search = $this->isNew() ? $this->tdmcreate->getConfig('active_search') : $this->getVar('mod_search');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_SEARCH, 'mod_search', $mod_search, _YES, _NO));
- $mod_comments = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_comments'] : $this->getVar('mod_comments');
+ $mod_comments = $this->isNew() ? $this->tdmcreate->getConfig('active_comments') : $this->getVar('mod_comments');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_COMMENTS, 'mod_comments', $mod_comments, _YES, _NO));
- $mod_notifications = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_notifications'] : $this->getVar('mod_notifications');
+ $mod_notifications = $this->isNew() ? $this->tdmcreate->getConfig('active_notifications') : $this->getVar('mod_notifications');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_NOTIFICATIONS, 'mod_notifications', $mod_notifications, _YES, _NO));
- $mod_permissions = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_permissions'] : $this->getVar('mod_permissions');
+ $mod_permissions = $this->isNew() ? $this->tdmcreate->getConfig('active_permissions') : $this->getVar('mod_permissions');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_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_MODULE_INSTALL, 'mod_install', $mod_install, _YES, _NO));
+ $mod_inroot_copy = $this->isNew() ? $this->tdmcreate->getConfig('inroot_copy') : $this->getVar('mod_inroot_copy');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_INROOT_MODULES_COPY, 'mod_inroot_copy', $mod_inroot_copy, _YES, _NO));
$mod_image = $this->getVar('mod_image') ? $this->getVar('mod_image') : 'empty.png';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -26,9 +26,11 @@
class TDMCreateTables extends XoopsObject
{
/**
- * @var string
+ * Instance of TDMCreate class
+ *
+ * @var mixed
*/
- private $module = null;
+ private $tdmcreate = null;
/*
* @public function constructor class
@@ -36,14 +38,15 @@
*/
public function __construct()
{
- $this->module = TDMCreateModules::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
$this->initVar('table_id',XOBJ_DTYPE_INT);
$this->initVar('table_mid',XOBJ_DTYPE_INT);
$this->initVar('table_category',XOBJ_DTYPE_INT);
$this->initVar('table_name',XOBJ_DTYPE_TXTBOX);
$this->initVar('table_fieldname',XOBJ_DTYPE_TXTBOX);
+ $this->initVar('table_nbfields',XOBJ_DTYPE_INT);
$this->initVar('table_image',XOBJ_DTYPE_TXTBOX);
- $this->initVar('table_nbfields',XOBJ_DTYPE_INT);
+ $this->initVar('table_autoincrement',XOBJ_DTYPE_INT);
$this->initVar('table_blocks',XOBJ_DTYPE_INT);
$this->initVar('table_admin',XOBJ_DTYPE_INT);
$this->initVar('table_user',XOBJ_DTYPE_INT);
@@ -102,8 +105,7 @@
$form = new XoopsThemeForm($title, 'tableform', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
//
- $modulesHandler =& xoops_getModuleHandler('modules');
- $modules = $modulesHandler->getObjects(null);
+ $modules = $this->tdmcreate->getHandler('modules')->getObjects(null);
$mods_select = new XoopsFormSelect(_AM_TDMCREATE_TABLE_MODULES, 'table_mid', $table_mid);
//$mods_select->setExtra('onchange="window.location=\'\'+this.options[this.selectedIndex].value"');
//$mods_select->setValue('table.php?op=new&table_mid='.$table_mid);$action.'table.php?op=new&table_mid='.
@@ -118,7 +120,7 @@
$table_name_field->setDescription(_AM_TDMCREATE_TABLE_NAME_DESC);
$form->addElement($table_name_field, true);
//
- $tablesHandler =& xoops_getModuleHandler('tables');
+ $tablesHandler =& $this->tdmcreate->getHandler('tables');
$criteria = new CriteriaCompo(new Criteria('table_category', 0), 'AND');
$criteria->add(new Criteria('table_mid', $table_mid), 'AND');
$criteria->add(new Criteria('table_name', $table_name));
@@ -170,6 +172,12 @@
$imgtray1->addElement($fileseltray1);
$form->addElement($imgtray1);
//
+ $table_autoincrement = $this->isNew() ? 1 : $this->getVar('table_autoincrement');
+ $check_table_autoincrement = new XoopsFormCheckBox(_AM_TDMCREATE_TABLE_AUTO_INCREMENT, 'table_autoincrement', $table_autoincrement);
+ $check_table_autoincrement->setDescription(_AM_TDMCREATE_TABLE_AUTO_INCREMENT_DESC);
+ $check_table_autoincrement->addOption(1, _AM_TDMCREATE_TABLE_AUTO_INCREMENT_OPTION);
+ $form->addElement($check_table_autoincrement);
+ //
$options_tray = new XoopsFormElementTray(_OPTIONS, '<br />');
$table_blocks = $isNew ? 0 : $this->getVar('table_blocks');
$check_table_blocks = new XoopsFormCheckBox(' ', 'table_blocks', $table_blocks);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -39,6 +39,6 @@
define('TDMC_UPLOAD_IMGTAB_PATH', TDMC_UPLOAD_PATH . '/images/tables' );
define('TDMC_UPLOAD_IMGTAB_URL', TDMC_UPLOAD_URL . '/images/tables' );
-include_once TDMC_PATH . '/class/session.php';
include_once TDMC_PATH . '/class/helper.php';
-include_once TDMC_PATH . '/class/request.php';
\ No newline at end of file
+include_once TDMC_PATH . '/class/request.php';
+include_once TDMC_PATH . '/class/session.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -38,14 +38,14 @@
function TDMCreate_clearDir($folder) {
$opening=@opendir($folder);
if (!$opening) return;
- while($file=readdir($opening)) {
- if ($file == '.' || $file == '..') continue;
- if (is_dir($folder."/".$file)) {
- $r=TDMCreate_clearDir($folder."/".$file);
+ while($fields=readdir($opening)) {
+ if ($fields == '.' || $fields == '..') continue;
+ if (is_dir($folder."/".$fields)) {
+ $r=TDMCreate_clearDir($folder."/".$fields);
if (!$r) return false;
}
else {
- $r=@unlink($folder."/".$file);
+ $r=@unlink($folder."/".$fields);
if (!$r) return false;
}
}
@@ -56,7 +56,7 @@
}
/**
- * Copy a file, or a folder and its contents
+ * Copy a fields, or a folder and its contents
*
* @author Aidan Lister <ai...@ph...>
* @version 1.0.0
@@ -66,8 +66,8 @@
*/
function TDMCreate_copyr($source, $dest)
{
- // Simple copy for a file
- if (is_file($source)) {
+ // Simple copy for a fields
+ if (is_fields($source)) {
return copy($source, $dest);
}
@@ -97,29 +97,95 @@
return true;
}
-// copy a directory and all subdirectories and files (recursive)
-// void dircpy( str 'source directory', str 'destination directory' [, bool 'overwrite existing files'] )
-function copyInRootModules($source, $dest, $overwrite = false) {
+// copy a directory and all subdirectories and fieldss (recursive)
+// void TDMCreate_copyInRootModules( str 'source directory', str 'destination directory' [, bool 'overwrite existing fieldss'] )
+function TDMCreate_copyInRootModules($source, $dest, $overwrite = false) {
if($handle = opendir($source)){ // if the folder exploration is sucsessful, continue
- while(false !== ($file = readdir($handle))){ // as long as storing the next file to $file is successful, continue
- if($file != '.' && $file != '..') {
- $path = $source . '/' . $file;
- if(is_file($path)) {
- if(!is_file($dest . '/' . $file) || $overwrite)
- if(!@copy($path, $dest . '/' . $file)){
- echo '<div class="red">File ('.$path.') could not be copied, likely a permissions problem.</div>';
+ while(false !== ($fields = readdir($handle))){ // as long as storing the next fields to $fields is successful, continue
+ if($fields != '.' && $fields != '..') {
+ $path = $source . '/' . $fields;
+ if(is_fields($path)) {
+ if(!is_fields($dest . '/' . $fields) || $overwrite)
+ if(!@copy($path, $dest . '/' . $fields)){
+ echo '<div class="red">fields ('.$path.') could not be copied, likely a permissions problem.</div>';
}
} elseif(is_dir($path)){
- if(!is_dir($dest . '/' . $file))
- mkdir($dest . '/' . $file); // make subdirectory before subdirectory is copied
- copyInRootModules($path, $dest . '/' . $file, $overwrite); //recurse!
+ if(!is_dir($dest . '/' . $fields))
+ mkdir($dest . '/' . $fields); // make subdirectory before subdirectory is copied
+ TDMCreate_copyInRootModules($path, $dest . '/' . $fields, $overwrite); //recurse!
}
}
}
closedir($handle);
}
-} // end of dircpy()
+} // end of TDMCreate_copyInRootModules()
+/**
+ * @param bool $another
+ * @param bool $withRedirect
+ * @param $itemObj
+ * @return bool|string
+ */
+function TDMCreate_setFields($another = false, $withRedirect = true, &$tablesObj)
+{
+ $tdmcreate = TDMCreate::getInstance();
+ //
+ $field_mid = isset($_POST['table_mid']) ? intval($_POST['table_mid']) : 0;
+ $field_tid = isset($_POST['table_id']) ? intval($_POST['table_id']) : 0;
+ //
+ $session = TDMCreateSession::getInstance();
+ $session->setSession('tdmcreate_field_mid', $field_mid);
+ $session->setSession('tdmcreate_field_tid', $field_tid);
+ $session->setSession('tdmcreate_field_name', isset($_POST['table_field_name']) ? $_POST['table_field_name'] : '');
+ $session->setSession('tdmcreate_field_description', isset($_POST['table_field_description']) ? $_POST['table_field_description'] : '');
+ $session->setSession('tdmcreate_field_status', isset($_POST['table_field_status']) ? intval($_POST['table_field_status']) : 1);
+
+ //
+ if (!is_object($tablesObj)) {
+ $tablesObj = $tdmcreate->getHandler('tables')->get($field_tid);
+ }
+
+ $fieldsObj = $tdmcreate->getHandler('fields')->create();
+ $fieldsObj->setVar('name', isset($_POST['table_fields_name']) ? $_POST['table_fields_name'] : '');
+ $fieldsObj->setVar('description', isset($_POST['table_fields_description']) ? $_POST['table_fields_description'] : '');
+ $fieldsObj->setVar('status', isset($_POST['table_fields_status']) ? intval($_POST['table_fields_status']) : 1);
+ $fieldsObj->setVar('uid', $uid);
+ $fieldsObj->setVar('field_tid', $tablesObj->getVar('table_id'));
+ $fieldsObj->setVar('datesub', time());
+
+ // TODO : display the available mimetypes to the user
+ $errors = array();
+ if ($tdmcreate->getConfig('perm_upload') && is_uploaded_fields($_fieldsS['table_upload_fields']['tmp_name'])) {
+ if (!$ret = $fieldsObj->checkUpload('table_upload_fields', $allowed_mimetypes, $errors)) {
+ $errorstxt = implode('<br />', $errors);
+
+ $message = sprintf(_CO_PUBLISHER_MESSAGE_fields_ERROR, $errorstxt);
+ if ($withRedirect) {
+ redirect_header("tables.php?op=new", 5, $message);
+ } else {
+ return $message;
+ }
+ }
+ }
+
+ // Storing the fields
+ if (!$fieldsObj->store($allowed_mimetypes)) {
+ if ($withRedirect) {
+ redirect_header("fields.php?op=save&field_tid=" . $fieldsObj->itemid(), 3, _CO_PUBLISHER_fieldsUPLOAD_ERROR . publisher_formatErrors($fieldsObj->getErrors()));
+ exit;
+ } else {
+ return _CO_PUBLISHER_fieldsUPLOAD_ERROR . publisher_formatErrors($fieldsObj->getErrors());
+ }
+ }
+
+ if ($withRedirect) {
+ $redirect_page = $another ? 'tables.php' : 'fields.php';
+ redirect_header($redirect_page . "?op=save&field_tid=" . $tablesObj->table_id(), 2, _CO_PUBLISHER_fieldsUPLOAD_SUCCESS);
+ } else {
+ return true;
+ }
+}
+
/*
if(function_exists(isset($_GET['f']))) { // get function name and parameter $_GET['f']($_GET["p"]);
include_once TDMC_PATH . '/class/modules.php';
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/jq.init.js
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/jq.init.js 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/jq.init.js 2014-05-01 16:22:45 UTC (rev 12517)
@@ -1,6 +0,0 @@
-$(document).ready(function(){
- // Hide/Show Modules Tables
- $('#modtab').hide();
- $('td#modtabs').click(function(){
- $(this).next('#modtab').slideToggle('slow');});
-});
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/fields.js
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/fields.js (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/fields.js 2014-05-01 16:22:45 UTC (rev 12517)
@@ -0,0 +1,51 @@
+// Jquery function for side fields
+$(document).ready(
+ function(){
+ // Controls Drag & Drop
+ $('.tdmc-fieldsection').sortable({
+ accept: 'tdmc-field',
+ cancel: '.tdmc-fieldname',
+ items: '.tdmc-field',
+ connectWith: '.tdmc-fieldsection',
+ update: function(event, ui) {
+ var list = $(this).sortable( 'serialize');
+ $.post( 'fields.php?op=order', list );
+ },
+ receive: function(event, ui) {
+ var side = $(this).attr('side');
+ var field_id = $(ui.item).attr('field_id');
+ var list = $(this).sortable( 'serialize');
+
+ $.post( 'fields.php', { op: 'drag', field_id: field_id, side: side } );
+
+ $.post( 'fields.php?op=order', list );
+
+ }
+ }
+ );
+ $(".tdmc-fieldsection").disableSelection();
+
+ $('.tdmc-fieldhide').sortable({
+ accept: 'tdmc-field',
+ cancel: '.tdmc-fieldname',
+ items: '.tdmc-field',
+ connectWith: '.tdmc-fieldsection'/*,
+ update: function(event, ui) {
+ var list = $(this).sortable( 'serialize');
+ $.post( 'fields.php?op=order', list );
+ },
+ receive: function(event, ui) {
+ var side = $(this).attr('side');
+ var field_id = $(ui.item).attr('field_id');
+ var list = $(this).sortable( 'serialize');
+
+ $.post( 'fields.php', { op: 'drag', field_id: field_id, side: side } );
+
+ $.post( 'fields.php?op=order', list );
+
+ }*/
+ }
+ );
+ $(".tdmc-fieldhide").disableSelection();
+ }
+);
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -106,7 +106,7 @@
define('_AM_TDMCREATE_MODULE_COMMENTS', "Enable Comments");
define('_AM_TDMCREATE_MODULE_NOTIFICATIONS', "Enable Notifications");
define('_AM_TDMCREATE_MODULE_PERMISSIONS', "Enable Permissions");
-define('_AM_TDMCREATE_MODULE_INSTALL', "Install this module directly in root/modules?");
+define('_AM_TDMCREATE_MODULE_INROOT_COPY', "Copy this module also in root/modules?");
// Added in version 1.39
define('_AM_TDMCREATE_MODULE_NBFIELDS', "Fields");
define('_AM_TDMCREATE_MODULE_BLOCKS', "Blocks");
@@ -130,16 +130,21 @@
define('_AM_TDMCREATE_TABLE_EDIT', "Edit Table");
define('_AM_TDMCREATE_TABLE_MODULES', "Choose a module");
define('_AM_TDMCREATE_TABLE_NAME', "Table Name");
-define('_AM_TDMCREATE_TABLE_NAME_DESC', "Unique Name for this Table");
+define('_AM_TDMCREATE_TABLE_NAME_DESC', "Unique Name for this Table, and is automatically added the prefix <span class='bold'>mod_</span>");
define('_AM_TDMCREATE_TABLE_CATEGORY', "This table is a category or topic?");
define('_AM_TDMCREATE_TABLE_CATEGORY_DESC', "<b class='red bold'>WARNING</b>: <i>Once you have used this option for this module, and edit this table,<br />will not be displayed following the creation of other tables</i>");
define('_AM_TDMCREATE_TABLE_NBFIELDS', "Number fields");
define('_AM_TDMCREATE_TABLE_NBFIELDS_DESC', "Number of fields for this table");
define('_AM_TDMCREATE_TABLE_FIELDNAME', "Prefix Field Name");
-define('_AM_TDMCREATE_TABLE_FIELDNAME_DESC', "This is the prefix of field name (optional)<br />If you leave the field blank,<br />doesn't appear anything in the fields of the next screen,<br />otherwise you'll see all the fields with a prefix type (e.g: <span class='bold'>fieldname_</span>)");
+define('_AM_TDMCREATE_TABLE_FIELDNAME_DESC', "This is the prefix of field name (optional)<br />If you leave the field blank, doesn't appear anything in the fields of the next screen,<br />otherwise you'll see all the fields with a prefix type (e.g: <span class='bold'>cat</span> of table <span class='bold'>categories</span>)");
define('_AM_TDMCREATE_TABLE_OPTIONS_CHECKS_DESC', "For each table created, a file is created on behalf of this.<br />
Selecting one or more of these options, deciding whether to enter the name of the file to other files or you define a condition in these other files, need to be created or not.");
define('_AM_TDMCREATE_TABLE_IMAGE', "Table Logo");
+// Added in version 1.91
+define('_AM_TDMCREATE_TABLE_AUTO_INCREMENT', " Auto Increment");
+define('_AM_TDMCREATE_TABLE_AUTO_INCREMENT_OPTION', "Default checked");
+define('_AM_TDMCREATE_TABLE_AUTO_INCREMENT_DESC', "Check this option if table have the Auto Increment ID");
+//
define('_AM_TDMCREATE_TABLE_BLOCKS', "Block for this table");
define('_AM_TDMCREATE_TABLE_BLOCKS_DESC', "(blocks: random, latest, today)");
define('_AM_TDMCREATE_TABLE_ADMIN', "View in Admin Panel");
@@ -167,7 +172,6 @@
define('_AM_TDMCREATE_FIELD_NULL', "Null");
define('_AM_TDMCREATE_FIELD_DEFAULT', "Default");
define('_AM_TDMCREATE_FIELD_KEY', "Key");
-define('_AM_TDMCREATE_FIELD_AUTO_INCREMENT', " Auto Increment");
// Others
define('_AM_TDMCREATE_FIELD_PARAMETERS', "Parameters");
define('_AM_TDMCREATE_FIELD_ELEMENTS', "Options Elements");
@@ -337,6 +341,10 @@
define('_AM_TDMCREATE_NOTTABLES', "There aren't tables, pleace create one first");
define('_AM_TDMCREATE_FIELD_FORM_SAVED_OK', "Fields of table %s successfully saved");
define('_AM_TDMCREATE_FIELD_FORM_UPDATED_OK', "Fields of table %s successfully updated");
+//
+define('_AM_TDMCREATE_THEREARENT_MODULES', "There aren't modules");
+define('_AM_TDMCREATE_THEREARENT_TABLES', "There aren't tables");
+define('_AM_TDMCREATE_THEREARENT_FIELDS', "There aren't fields");
//Creation
//OK
define('_AM_TDMCREATE_OK_ARCHITECTURE', "<span class='green'>The structure of the module was created (index.html, folders, icons, docs files)</span>");
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -61,7 +61,7 @@
define('_MI_TDMCREATE_ACTIVE_COMMENTS', "Allow Comments");
define('_MI_TDMCREATE_ACTIVE_NOTIFICATIONS', "Allow notifications");
define('_MI_TDMCREATE_ACTIVE_PERMISSIONS', "Allow permissions");
-define('_MI_TDMCREATE_INROOT_INSTALL', "Install this module directly in root/modules?");
+define('_MI_TDMCREATE_INROOT_COPY', "Copy this module also in root/modules?");
define('_MI_TDMCREATE_PAYPAL_BUTTON', "Paypal Button");
define('_MI_TDMCREATE_SUBVERSION', "Subversion");
define('_MI_TDMCREATE_MODULE_DESCRIPTION', "Module Description");
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-05-01 16:22:45 UTC (rev 12517)
@@ -47,15 +47,16 @@
`table_category` tinyint(1) unsigned NOT NULL default '0',
`table_name` varchar(150) NOT NULL default '',
`table_fieldname` varchar(150) NOT NULL default '',
+ `table_nbfields` int(5) unsigned NOT NULL default '0',
`table_image` varchar(150) NOT NULL default '',
- `table_nbfields` int(5) unsigned NOT NULL default '0',
+ `table_autoincrement` tinyint(1) NOT NULL default '1',
`table_blocks` tinyint(1) unsigned NOT NULL default '0',
`table_admin` tinyint(1) unsigned NOT NULL default '1',
`table_user` tinyint(1) unsigned NOT NULL default '0',
`table_submenu` tinyint(1) unsigned NOT NULL default '0',
`table_status` tinyint(1) unsigned NOT NULL default '0',
`table_waiting` tinyint(1) unsigned NOT NULL default '0',
- `table_online` tinyint(1) unsigned NOT NULL default '0',
+ `table_display` tinyint(1) unsigned NOT NULL default '0',
`table_search` tinyint(1) unsigned NOT NULL default '0',
`table_comments` tinyint(1) unsigned NOT NULL default '0',
`table_notifications` tinyint(1) unsigned NOT NULL default '0',
@@ -73,7 +74,6 @@
`field_id` int (8) unsigned NOT NULL auto_increment,
`field_mid` int (5) unsigned NOT NULL default '0',
`field_tid` int (5) unsigned NOT NULL default '0',
-`field_sid` int (5) unsigned NOT NULL default '0',
`field_numb` int (10) unsigned NOT NULL default '0',
`field_name` varchar (255) NOT NULL default '',
`field_type` varchar (100) NOT NULL default '',
@@ -82,7 +82,8 @@
`field_null` char (10) NOT NULL default '',
`field_default` varchar (150) NOT NULL default '',
`field_key` char (10) NOT NULL default '',
-`field_autoincrement` tinyint(1) NOT NULL default '0',`field_element` varchar (150) NOT NULL default '',
+`field_element` varchar (150) NOT NULL default '',
+`field_parent` tinyint(1) NOT NULL default '0',
`field_inlist` tinyint(1) NOT NULL default '0',
`field_inform` tinyint(1) NOT NULL default '0',
`field_admin` tinyint(1) NOT NULL default '0',
@@ -93,8 +94,7 @@
`field_required` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`field_id`),
KEY `field_mid` (`field_mid`),
-KEY `field_tid` (`field_tid`),
-KEY `field_sid` (`field_sid`)
+KEY `field_tid` (`field_tid`)
) ENGINE=MyISAM;
#
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/about.tpl
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/about.tpl (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/about.tpl 2014-05-01 16:22:45 UTC (rev 12517)
@@ -0,0 +1,6 @@
+<!-- Header -->
+<{includeq file="db:tdmcreate_header.html"}>
+<!-- About Page -->
+<div class="top"><{$about}></div>
+<!-- Footer -->
+<{includeq file="db:tdmcreate_footer.html"}>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/building.tpl
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/building.tpl (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/building.tpl 2014-05-01 16:22:45 UTC (rev 12517)
@@ -0,0 +1,49 @@
+<!-- Header -->
+<{includeq file="db:header.tpl"}>
+<!-- Display building form -->
+<br />
+<{if $build_list}>
+ <table class="outer">
+ <thead>
+ <tr class="head">
+ <th width="80%"><{$smarty.const._AM_TDMCREATE_BUILDING_FILES}></th>
+ <th width="10%"><{$smarty.const._AM_TDMCREATE_BUILDING_SUCCESS}></th>
+ <th width="10%"><{$smarty.const._AM_TDMCREATE_BUILDING_FAILED}></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr class="even">
+ <{if $base_architecture}>
+ <td style="padding-left: 30px;"><{$smarty.const._AM_TDMCREATE_OK_ARCHITECTURE}></td>
+ <td class="center"><img src="<{xoModuleIcons16 on.png}>" alt="" /></td>
+ <td> </td>
+ <{else}>
+ <td style="padding-left: 30px;"><{$smarty.const._AM_TDMCREATE_NOTOK_ARCHITECTURE}></td>
+ <td> </td>
+ <td class="center"><img src="<{xoModuleIcons16 off.png}>" alt="" /></td>
+ <{/if}>
+ <tr>
+ <!-- <{foreach item=list from=$build_list}> -->
+ <tr class="<{cycle values='odd, even'}>">
+ <td class="center" colspan="3"><{$build_list}></td>
+ <!-- <td style="padding-left: 30px;"><{$list.file}></td>
+ <{if $list.on}>
+ <td style="padding-left: 30px;"><{$created}></td>
+ <td class="center"><img src="<{xoModuleIcons16 on.png}>" alt="" /></td>
+ <td> </td>
+ <{elseif $list.off}>
+ <td style="padding-left: 30px;"><{$notcreated}></td>
+ <td> </td>
+ <td class="center"><img src="<{xoModuleIcons16 off.png}>" alt="" /></td>
+ <{/if}> -->
+ <tr>
+ <!-- <{/foreach}> -->
+ </tbody>
+ </table><br />
+<{else}>
+ <{if $form}>
+ <{$form}>
+ <{/if}>
+<{/if}>
+<!-- Footer -->
+<{includeq file="db:footer.tpl"}>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl 2014-05-01 16:22:45 UTC (rev 12517)
@@ -0,0 +1,108 @@
+<!-- Header -->
+<{includeq file="db:header.tpl"}>
+<!-- Display tables list -->
+<{if $tables_list}>
+ <table id='show_rows' width='100%' cellspacing='1' class='outer'>
+ <thead>
+ <tr>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_ID}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_NAME_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_IMAGE_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_NBFIELDS_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_BLOCKS_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_ADMIN_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_USER_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_SUBMENU_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_SEARCH_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_COMMENTS_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_NOTIFICATIONS_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_PERMISSIONS_LIST}></th>
+ <th class='center width6'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th>
+ </tr>
+ </thead>
+ <tbody>
+ <{foreach item=table from=$tables_list}>
+ <tr id="table<{$table.id}>" class="fields toggleMain">
+ <td class='center'><{$table.id}><br />
+ <a href="#" title="Toggle"><img class="imageToggle" src="<{$tdmc_icons_url}>/16/toggle.png" alt="Toggle" /></a>
+ </td>
+ <td class='center'><u><{$table.name}></u></td>
+ <td class='center'><img src="<{$pathIcon32}>/<{$table.image}>" alt="<{$table.name}>" height="30" /></td>
+ <td class='center'><{$table.nbfields}></td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&table_blocks=<{$table.blocks}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$table.blocks}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&table_admin=<{$table.admin}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$table.admin}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&table_user=<{$table.user}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$table.user}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&table_submenu=<{$table.submenu}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$table.submenu}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&table_search=<{$table.search}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$table.search}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&table_comments=<{$table.comments}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$table.comments}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&table_notifications=<{$table.notifications}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$table.notifications}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&table_permiss...
[truncated message content] |