|
From: <txm...@us...> - 2015-06-13 22:09:39
|
Revision: 13089
http://sourceforge.net/p/xoops/svn/13089
Author: txmodxoops
Date: 2015-06-13 22:09:36 +0000 (Sat, 13 Jun 2015)
Log Message:
-----------
Merged modifies (With Goffy)
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php 2015-06-13 14:20:13 UTC (rev 13088)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/fields.php 2015-06-13 22:09:36 UTC (rev 13089)
@@ -172,7 +172,7 @@
// Set field elements
if ($fieldsObj->isNew()) {
// Fields Elements Handler
- $fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create();
+ /*$fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create();
$fieldelementObj->setVar( 'fieldelement_mid', $fieldMid );
$fieldelementObj->setVar( 'fieldelement_tid', $fieldTid );
$fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($tableName) );
@@ -180,7 +180,7 @@
// 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_FIELDS_FORM_SAVED_OK, $tableName));
} else {
// Needed code from table name by field_tid
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/index.php 2015-06-13 14:20:13 UTC (rev 13088)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/index.php 2015-06-13 22:09:36 UTC (rev 13089)
@@ -19,16 +19,17 @@
* @version $Id: index.php 11084 2013-02-23 15:44:20Z timgno $
*/
include __DIR__ . '/header.php';
-$criteria = new CriteriaCompo();
-$count_modules = $tdmcreate->getHandler('modules')->getCount($criteria);
-$count_tables = $tdmcreate->getHandler('tables')->getCount($criteria);
-$count_fields = $tdmcreate->getHandler('fields')->getCount($criteria);
+$countModules = $tdmcreate->getHandler('modules')->getCount();
+$countTables = $tdmcreate->getHandler('tables')->getCount();
+$countFields = $tdmcreate->getHandler('fields')->getCount();
+$countFiles = $tdmcreate->getHandler('morefiles')->getCount();
unset($criteria);
$templateMain = 'tdmcreate_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');
-$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMFIELDS . '</label>', $count_fields, 'Gray');
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMMODULES . '</label>', $countModules, 'Green');
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMTABLES . '</label>', $countTables, 'Orange');
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMFIELDS . '</label>', $countFields, 'Gray');
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' . _AM_TDMCREATE_THEREARE_NUMFILES . '</label>', $countFiles, 'Red');
// Upload Folders
$folder = array(
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php 2015-06-13 14:20:13 UTC (rev 13088)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/admin/tables.php 2015-06-13 22:09:36 UTC (rev 13089)
@@ -22,7 +22,7 @@
// Recovered value of arguments op in the URL $
$op = XoopsRequest::getString('op', 'list');
//
-$mod_id = XoopsRequest::getInt('mod_id');
+$modId = XoopsRequest::getInt('mod_id');
// Request vars
$tableId = XoopsRequest::getInt('table_id');
$tableMid = XoopsRequest::getInt('table_mid');
@@ -186,6 +186,16 @@
if ($tablesObj->isNew()) {
$tableTid = $GLOBALS['xoopsDB']->getInsertId();
$tableAction = '&field_mid=' . $tableMid . '&field_tid=' . $tableTid . '&field_numb=' . $tableNumbFields . '&field_name=' . $tableFieldname;
+ // Fields Elements Handler
+ $fieldelementObj =& $tdmcreate->getHandler('fieldelements')->create();
+ $fieldelementObj->setVar( 'fieldelement_mid', $tableMid );
+ $fieldelementObj->setVar( 'fieldelement_tid', $tableTid );
+ $fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($_POST['table_name']) );
+ $fieldelementObj->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($_POST['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?op=new' . $tableAction, 5, sprintf(_AM_TDMCREATE_TABLE_FORM_CREATED_OK, $_POST['table_name']));
} else {
redirect_header('tables.php', 5, sprintf(_AM_TDMCREATE_TABLE_FORM_UPDATED_OK, $_POST['table_name']));
@@ -238,9 +248,18 @@
redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
if ($tdmcreate->getHandler('tables')->delete($tablesObj)) {
+ // Delete items in table fieldelements - idea by goffy
+ $fieldelements = $tdmcreate->getHandler('fieldelements')->getAllFieldElementsByModuleAndTableId($tableMid, $tableId);
+ foreach (array_keys($fieldelements) as $fe) {
+ $fieldelementsObj =& $tdmcreate->getHandler('fieldelements')->get($fieldelements[$fe]->getVar('fieldelement_id'));
+ if (!$tdmcreate->getHandler('fieldelements')->delete($fieldelementsObj)) {
+ $GLOBALS['xoopsTpl']->assign('error', $fieldelementsObj->getHtmlErrors());
+ }
+ unset($fieldelementsObj);
+ }
redirect_header('tables.php', 3, _AM_TDMCREATE_FORMDELOK);
} else {
- echo $tablesObj->getHtmlErrors();
+ $GLOBALS['xoopsTpl']->assign('error', $tablesObj->getHtmlErrors());
}
} else {
xoops_confirm(array('ok' => 1, 'table_id' => $tableId, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $tablesObj->getVar('table_name')));
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php 2015-06-13 14:20:13 UTC (rev 13088)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php 2015-06-13 22:09:36 UTC (rev 13089)
@@ -30,6 +30,7 @@
define('_AM_TDMCREATE_THEREARE_NUMMODULES', "There are <span class='red bold'>%s</span> modules stored in the Database");
define('_AM_TDMCREATE_THEREARE_NUMTABLES', "There are <span class='red bold'>%s</span> tables stored in the Database");
define('_AM_TDMCREATE_THEREARE_NUMFIELDS', "There are <span class='red bold'>%s</span> fields stored in the Database");
+define('_AM_TDMCREATE_THEREARE_NUMFILES', "There are <span class='red bold'>%s</span> more files stored in the Database");
// General
define('_AM_TDMCREATE_FORMOK', "Successfully saved");
define('_AM_TDMCREATE_FORMDELOK', "Successfully deleted");
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/modinfo.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/modinfo.php 2015-06-13 14:20:13 UTC (rev 13088)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/modinfo.php 2015-06-13 22:09:36 UTC (rev 13089)
@@ -89,3 +89,4 @@
define('_MI_TDMCREATE_CONFIG_MODULES_ADMINPAGER', "Modules adminpager");
define('_MI_TDMCREATE_CONFIG_TABLES_ADMINPAGER', "Tables adminpager");
define('_MI_TDMCREATE_CONFIG_FIELDS_ADMINPAGER', "Fields adminpager");
+define('_MI_TDMCREATE_CONFIG_MOREFILES_ADMINPAGER', "More Files adminpager");
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/xoops_version.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/xoops_version.php 2015-06-13 14:20:13 UTC (rev 13088)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/xoops_version.php 2015-06-13 22:09:36 UTC (rev 13089)
@@ -27,7 +27,7 @@
$modversion['author'] = "Xoops TDM";
$modversion['author_website_url'] = "http://www.xoops.org/";
$modversion['author_website_name'] = "Xoops Team Developers Module";
-$modversion['credits'] = "Mamba(Xoops), Timgno(Txmod Xoops)";
+$modversion['credits'] = "Mamba(Xoops), Timgno(Txmod Xoops), Goffy(German Xoops)";
$modversion['help'] = "page=help";
$modversion['license'] = "GNU GPL 2.0 or later";
$modversion['license_url'] = "www.gnu.org/licenses/gpl-2.0.html/";
|