|
From: <txm...@us...> - 2015-06-01 11:23:00
|
Revision: 13074
http://sourceforge.net/p/xoops/svn/13074
Author: txmodxoops
Date: 2015-06-01 11:22:57 +0000 (Mon, 01 Jun 2015)
Log Message:
-----------
Fixed display toggle in modules, table & fields list
Added table_index filed to insert code in user/index.php
Needed a fresh installation
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeFunctions.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/templates/user/TemplatesUserIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserPages.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/user/UserXoopsVersion.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_modules.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_tables.tpl
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/templates/admin/tdmcreate_tables_item.tpl
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/16/rss.gif
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/index.html
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/next.png
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/previous.png
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/cache/classpaths.cache
XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/fields.php 2015-06-01 11:22:57 UTC (rev 13074)
@@ -49,81 +49,45 @@
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
// Redirect if there aren't modules
- $countModules = $tdmcreate->getHandler('modules')->getCount();
- if ( $countModules == 0 ) {
+ $modulesCount = $tdmcreate->getHandler('modules')->getCountModules();
+ if ( $modulesCount == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
- unset($countModules);
+ unset($modulesCount);
// Redirect if there aren't tables
- $handlerTables = $tdmcreate->getHandler('tables');
- $countTables = $handlerTables->getCount();
- if ($countTables == 0) {
+ $tablesCount = $tdmcreate->getHandler('tables')->getCountTables();
+ if ($tablesCount == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
- unset($countTables);
// Get the list of tables
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_mid', $handlerTables->getVar('table_mid')));
- $criteria->setStart($start);
- $criteria->setLimit($limit);
- $criteria->setSort('table_id ASC, table_order ASC, table_name');
- $criteria->setOrder('ASC');
- $countTables = $tdmcreate->getHandler('tables')->getCount($criteria);
- $tablesAll = $tdmcreate->getHandler('tables')->getAll($criteria);
- unset($criteria);
- if ($countTables > 0)
+ $tablesAll = $tdmcreate->getHandler('tables')->getAllTables($start, $limit);
+ if ($tablesCount > 0)
{
$tlid = 1;
foreach (array_keys($tablesAll) as $tid)
- {
+ {
// Display tables list
- $table['id'] = $tid;
- $table['lid'] = $tlid;
- $table['mid'] = $tablesAll[$tid]->getVar('table_mid');
- $table['name'] = ucfirst($tablesAll[$tid]->getVar('table_name'));
- $table['image'] = $tablesAll[$tid]->getVar('table_image');
- $table['nbfields'] = $tablesAll[$tid]->getVar('table_nbfields');
- $table['order'] = $tablesAll[$tid]->getVar('table_order');
- $table['autoincrement'] = $tablesAll[$tid]->getVar('table_autoincrement');
- $table['blocks'] = $tablesAll[$tid]->getVar('table_blocks');
- $table['admin'] = $tablesAll[$tid]->getVar('table_admin');
- $table['user'] = $tablesAll[$tid]->getVar('table_user');
- $table['search'] = $tablesAll[$tid]->getVar('table_search');
+ $table = $tablesAll[$tid]->getValues();
+ $talid = array('lid' => $tlid);
+ $table = array_merge($table, $talid);
// Get the list of fields
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('field_mid', $table['mid']));
- $criteria->add(new Criteria('field_tid', $tid));
- $criteria->setSort('field_order ASC, field_id ASC, field_name');
- $criteria->setOrder('ASC');
- $countFields = $tdmcreate->getHandler('fields')->getCount($criteria);
- $fieldsAll = $tdmcreate->getHandler('fields')->getObjects($criteria);
- unset($criteria);
+ $fieldsCount = $tdmcreate->getHandler('fields')->getCountFields();
+ $fieldsAll = $tdmcreate->getHandler('fields')->getAllFieldsByModuleAndTableId($table['mid'], $tid);
// Display fields list
$fields = array();
$lid = 1;
- if ( $countFields > 0 )
+ if ( $fieldsCount > 0 )
{
- foreach (array_keys($fieldsAll) as $fid)
+ foreach (array_keys($fieldsAll) as $fid)
{
- $field['id'] = $fid;
- $field['lid'] = $lid;
- $field['order'] = $fieldsAll[$fid]->getVar('field_order');
- $field['name'] = str_replace('_', ' ', ucfirst($fieldsAll[$fid]->getVar('field_name')));
- $field['parent'] = $fieldsAll[$fid]->getVar('field_parent');
- $field['inlist'] = $fieldsAll[$fid]->getVar('field_inlist');
- $field['inform'] = $fieldsAll[$fid]->getVar('field_inform');
- $field['admin'] = $fieldsAll[$fid]->getVar('field_admin');
- $field['user'] = $fieldsAll[$fid]->getVar('field_user');
- $field['block'] = $fieldsAll[$fid]->getVar('field_block');
- $field['main'] = $fieldsAll[$fid]->getVar('field_main');
- $field['search'] = $fieldsAll[$fid]->getVar('field_search');
- $field['required'] = $fieldsAll[$fid]->getVar('field_required');
- $fields[] = $field;
- unset($field);
- $lid++;
+ $field = $fieldsAll[$fid]->getValues();
+ $falid = array('lid' => $lid);
+ $fields[] = array_merge($field, $falid);
+ unset($field);
+ ++$lid;
}
}
- $tlid++;
+ ++$tlid;
unset($lid);
$table['fields'] = $fields;
$GLOBALS['xoopsTpl']->append('tables_list', $table);
@@ -131,9 +95,9 @@
}
unset($tlid);
unset($fields);
- if ( $countTables > $limit ) {
+ if ( $tablesCount > $limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($countTables, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $pagenav = new XoopsPageNav($tablesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
@@ -278,26 +242,50 @@
break;
case 'display':
- // Fields Handler
- $fields = $tdmcreate->getHandler('fields');
- //
- foreach ($_POST['field_id'] as $key => $value) {
- $fieldsObj =& $fields->get($value);
- $fieldsObj->setVar('field_parent', (1 == $_REQUEST['field_parent'][$key]) ? 0 : 1);
- $fieldsObj->setVar('field_inlist', (1 == $_REQUEST['field_inlist'][$key]) ? 0 : 1);
- $fieldsObj->setVar('field_inform', (1 == $_REQUEST['field_inform'][$key]) ? 0 : 1);
- $fieldsObj->setVar('field_admin', (1 == $_REQUEST['field_admin'][$key]) ? 0 : 1);
- $fieldsObj->setVar('field_user', (1 == $_REQUEST['field_user'][$key]) ? 0 : 1);
- $fieldsObj->setVar('field_block', (1 == $_REQUEST['field_block'][$key]) ? 0 : 1);
- $fieldsObj->setVar('field_main', ($key == $_REQUEST['field_main']) ? 0 : 1);
- $fieldsObj->setVar('field_search', (1 == $_REQUEST['field_search'][$key]) ? 0 : 1);
- $fieldsObj->setVar('field_required', (1 == $_REQUEST['field_required'][$key]) ? 0 : 1);
- }
- if ($fieldsObj->insert($fieldsObj, true)) {
- redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS);
- } else {
- redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_FAILED);
- }
+ $fieldId = tdmcreate_CleanVars($_POST, 'field_id', 0, 'int');
+ if ($fieldId > 0) {
+ $fieldsObj = $tdmcreate->getHandler('fields')->get($fieldId);
+ if (isset($_POST['field_parent'])) {
+ $field_parent = $fieldsObj->getVar('field_parent');
+ $fieldsObj->setVar('field_parent', !$field_parent);
+ }
+ if (isset($_POST['field_inlist'])) {
+ $field_inlist = $fieldsObj->getVar('field_inlist');
+ $fieldsObj->setVar('field_inlist', !$field_inlist);
+ }
+ if (isset($_POST['field_inform'])) {
+ $field_inform = $fieldsObj->getVar('field_inform');
+ $fieldsObj->setVar('field_inform', !$field_inform);
+ }
+ if (isset($_POST['field_admin'])) {
+ $field_admin = $fieldsObj->getVar('field_admin');
+ $fieldsObj->setVar('field_admin', !$field_admin);
+ }
+ if (isset($_POST['field_user'])) {
+ $field_user = $fieldsObj->getVar('field_user');
+ $fieldsObj->setVar('field_user', !$field_user);
+ }
+ if (isset($_POST['field_block'])) {
+ $field_block = $fieldsObj->getVar('field_block');
+ $fieldsObj->setVar('field_block', !$field_block);
+ }
+ if (isset($_POST['field_main'])) {
+ $field_main = $fieldsObj->getVar('field_main');
+ $fieldsObj->setVar('field_main', !$field_main);
+ }
+ if (isset($_POST['field_search'])) {
+ $field_search = $fieldsObj->getVar('field_search');
+ $fieldsObj->setVar('field_search', !$field_search);
+ }
+ if (isset($_POST['field_required'])) {
+ $field_required = $fieldsObj->getVar('field_required');
+ $fieldsObj->setVar('field_required', !$field_required);
+ }
+ if ($tdmcreate->getHandler('fields')->insert($fieldsObj)) {
+ redirect_header('fields.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS);
+ }
+ $GLOBALS['xoopsTpl']->assign('error', $fieldsObj->getHtmlErrors());
+ }
break;
}
include __DIR__ . '/footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/modules.php 2015-06-01 11:22:57 UTC (rev 13074)
@@ -40,40 +40,22 @@
$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
- $criteria = new CriteriaCompo();
- $criteria->setStart($start);
- $criteria->setLimit($limit);
- $criteria->setSort('mod_id ASC, mod_name');
- $criteria->setOrder('ASC');
- $nb_modules = $tdmcreate->getHandler('modules')->getCount($criteria);
- $mods_arr = $tdmcreate->getHandler('modules')->getAll($criteria);
- unset($criteria);
+ $modulesCount = $tdmcreate->getHandler('modules')->getCountModules();
+ $modulesAll = $tdmcreate->getHandler('modules')->getAllModules($start, $limit);
// Redirect if there aren't modules
- if (0 == $nb_modules) {
+ if (0 == $modulesCount) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES);
}
// Display modules list
- if ($nb_modules > 0) {
- foreach (array_keys($mods_arr) as $i) {
- $mod['id'] = $i;
- $mod['name'] = $mods_arr[$i]->getVar('mod_name');
- $mod['version'] = $mods_arr[$i]->getVar('mod_version');
- $mod['image'] = $mods_arr[$i]->getVar('mod_image');
- $mod['release'] = $mods_arr[$i]->getVar('mod_release');
- $mod['status'] = $mods_arr[$i]->getVar('mod_status');
- $mod['admin'] = $mods_arr[$i]->getVar('mod_admin');
- $mod['user'] = $mods_arr[$i]->getVar('mod_user');
- $mod['blocks'] = $mods_arr[$i]->getVar('mod_blocks');
- $mod['search'] = $mods_arr[$i]->getVar('mod_search');
- $mod['comments'] = $mods_arr[$i]->getVar('mod_comments');
- $mod['notifications'] = $mods_arr[$i]->getVar('mod_notifications');
- $mod['permissions'] = $mods_arr[$i]->getVar('mod_permissions');
- $GLOBALS['xoopsTpl']->append('modules_list', $mod);
- unset($mod);
+ if ($modulesCount > 0) {
+ foreach (array_keys($modulesAll) as $i) {
+ $module = $modulesAll[$i]->getValues();
+ $GLOBALS['xoopsTpl']->append('modules_list', $module);
+ unset($module);
}
- if ($nb_modules > $limit) {
+ if ($modulesCount > $limit) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($nb_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $pagenav = new XoopsPageNav($modulesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
@@ -205,48 +187,44 @@
}
break;
- case 'display':
- //if ( $modId > 0 ) {
- $mod_admin = XoopsRequest::getInt('mod_admin');
- $mod_user = XoopsRequest::getInt('mod_user');
- $mod_blocks = XoopsRequest::getInt('mod_blocks');
- $mod_search = XoopsRequest::getInt('mod_search');
- $mod_comments = XoopsRequest::getInt('mod_comments');
- $mod_notifications = XoopsRequest::getInt('mod_notifications');
- $mod_permissions = XoopsRequest::getInt('mod_permissions');
-
- //foreach($_POST['mod_id'] as $key => $value)
- //{
- /*$mod_admin = tdmcreate_CleanVars($_REQUEST, 'mod_admin');
- $mod_user = tdmcreate_CleanVars($_REQUEST, 'mod_user');
- $mod_blocks = tdmcreate_CleanVars($_REQUEST, 'mod_blocks');
- $mod_search = tdmcreate_CleanVars($_REQUEST, 'mod_search');
- $mod_comments = tdmcreate_CleanVars($_REQUEST, 'mod_comments');
- $mod_notifications = tdmcreate_CleanVars($_REQUEST, 'mod_notifications');
- $mod_permissions = tdmcreate_CleanVars($_REQUEST, 'mod_permissions'); */
-
- $modulesObj =& $tdmcreate->getHandler('modules')->get($modId);
- if (isset($mod_admin)) {
- $modulesObj->setVar('mod_admin', $mod_admin);
- } elseif (isset($mod_user)) {
- $modulesObj->setVar('mod_user', $mod_user);
- } elseif (isset($mod_blocks)) {
- $modulesObj->setVar('mod_blocks', $mod_blocks);
- } elseif (isset($mod_search)) {
- $modulesObj->setVar('mod_search', $mod_search);
- } elseif (isset($mod_comments)) {
- $modulesObj->setVar('mod_comments', $mod_comments);
- } elseif (isset($mod_notifications)) {
- $modulesObj->setVar('mod_notifications', $mod_notifications);
- } elseif (isset($mod_permissions)) {
- $modulesObj->setVar('mod_permissions', $mod_permissions);
- }
- if ($tdmcreate->getHandler('modules')->insert($modulesObj, true)) {
- redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
- } else {
- redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
- }
- //}
+ case 'display':
+ $id = tdmcreate_CleanVars($_POST, 'mod_id', 0, 'int');
+ if ($id > 0) {
+ $modulesObj = $tdmcreate->getHandler('modules')->get($id);
+ if (isset($_POST['mod_admin'])) {
+ $mod_admin = $modulesObj->getVar('mod_admin');
+ $modulesObj->setVar('mod_admin', !$mod_admin);
+ }
+ if (isset($_POST['mod_user'])) {
+ $mod_user = $modulesObj->getVar('mod_user');
+ $modulesObj->setVar('mod_user', !$mod_user);
+ }
+ if (isset($_POST['mod_blocks'])) {
+ $mod_blocks = $modulesObj->getVar('mod_blocks');
+ $modulesObj->setVar('mod_blocks', !$mod_blocks);
+ }
+ if (isset($_POST['mod_search'])) {
+ $mod_search = $modulesObj->getVar('mod_search');
+ $modulesObj->setVar('mod_search', !$mod_search);
+ }
+ if (isset($_POST['mod_comments'])) {
+ $mod_comments = $modulesObj->getVar('mod_comments');
+ $modulesObj->setVar('mod_comments', !$mod_comments);
+ }
+ if (isset($_POST['mod_notifications'])) {
+ $mod_notifications = $modulesObj->getVar('mod_notifications');
+ $modulesObj->setVar('mod_notifications', !$mod_notifications);
+ }
+ if (isset($_POST['mod_permissions'])) {
+ $mod_permissions = $modulesObj->getVar('mod_permissions');
+ $modulesObj->setVar('mod_permissions', !$mod_permissions);
+ }
+ if ($tdmcreate->getHandler('modules')->insert($modulesObj)) {
+ redirect_header('modules.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS);
+ }
+ $GLOBALS['xoopsTpl']->assign('error', $modulesObj->getHtmlErrors());
+ }
break;
}
+
include __DIR__ . '/footer.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/admin/tables.php 2015-06-01 11:22:57 UTC (rev 13074)
@@ -51,78 +51,45 @@
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
// Get the list of modules
- $criteria = new CriteriaCompo();
- $criteria->setStart($start);
- $criteria->setLimit($limit);
- $criteria->setSort('mod_id ASC, mod_name');
- $criteria->setOrder('ASC');
- $numbModules = $tdmcreate->getHandler('modules')->getCount($criteria);
+ $modulesCount = $tdmcreate->getHandler('modules')->getCountModules();
// Redirect if there aren't modules
- if (0 == $numbModules) {
+ if (0 == $modulesCount) {
redirect_header('modules.php?op=new', 10, _AM_TDMCREATE_NOTMODULES);
}
- $mods_arr = $tdmcreate->getHandler('modules')->getAll($criteria);
- unset($criteria);
- $numbTables = $tdmcreate->getHandler('tables')->getObjects(null);
+ $modulesAll = $tdmcreate->getHandler('modules')->getAllModules($start, $limit);
+ $tablesCount = $tdmcreate->getHandler('tables')->getObjects(null);
// Redirect if there aren't tables
- if (0 == $numbTables) {
+ if (0 == $tablesCount) {
redirect_header('tables.php?op=new', 10, _AM_TDMCREATE_NOTTABLES);
}
- unset($numbTables);
+ unset($tablesCount);
// Display modules list
- if ($numbModules > 0) {
- foreach (array_keys($mods_arr) as $i) {
- $mod['id'] = $i;
- $mod['name'] = $mods_arr[$i]->getVar('mod_name');
- $mod['image'] = $mods_arr[$i]->getVar('mod_image');
- $mod['admin'] = $mods_arr[$i]->getVar('mod_admin');
- $mod['user'] = $mods_arr[$i]->getVar('mod_user');
- $mod['blocks'] = $mods_arr[$i]->getVar('mod_blocks');
- $mod['search'] = $mods_arr[$i]->getVar('mod_search');
- $mod['comments'] = $mods_arr[$i]->getVar('mod_comments');
- $mod['notifications'] = $mods_arr[$i]->getVar('mod_notifications');
- $mod['permissions'] = $mods_arr[$i]->getVar('mod_permissions');
+ if ($modulesCount > 0) {
+ foreach (array_keys($modulesAll) as $i) {
+ $module = $modulesAll[$i]->getValues();
// Get the list of tables
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_mid', $i));
- $criteria->setSort('table_order ASC, table_id ASC, table_name');
- $criteria->setOrder('ASC');
- $numbTables = $tdmcreate->getHandler('tables')->getCount($criteria);
- $tables_arr = $tdmcreate->getHandler('tables')->getAll($criteria);
- unset($criteria);
+ $tablesCount = $tdmcreate->getHandler('tables')->getCountTables();
+ $tablesAll = $tdmcreate->getHandler('tables')->getAllTablesByModuleId($i);
// Display tables list
$tables = array();
$lid = 1;
- if ($numbTables > 0) {
- foreach (array_keys($tables_arr) as $t) {
- $table['id'] = $t;
- $table['lid'] = $lid;
- $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['order'] = $tables_arr[$t]->getVar('table_order');
- $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['submenu'] = $tables_arr[$t]->getVar('table_submenu');
- $table['search'] = $tables_arr[$t]->getVar('table_search');
- $table['comments'] = $tables_arr[$t]->getVar('table_comments');
- $table['notifications'] = $tables_arr[$t]->getVar('table_notifications');
- $table['permissions'] = $tables_arr[$t]->getVar('table_permissions');
- $tables[] = $table;
- unset($table);
+ if ($tablesCount > 0) {
+ foreach (array_keys($tablesAll) as $t) {
+ $table = $tablesAll[$t]->getValues();
+ $alid = array('lid' => $lid);
+ $tables[] = array_merge($table, $alid);
+ unset($table);
++$lid;
}
}
unset($lid);
- $mod['tables'] = $tables;
- $GLOBALS['xoopsTpl']->append('modules_list', $mod);
- unset($mod);
+ $module['tables'] = $tables;
+ $GLOBALS['xoopsTpl']->append('modules_list', $module);
+ unset($module);
}
- if ($numbModules > $limit) {
+ if ($modulesCount > $limit) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($numbModules, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $pagenav = new XoopsPageNav($modulesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
@@ -155,11 +122,11 @@
// Checking if table name exist in the same module
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $tableMid));
- $table_name_search = $tables->getObjects($criteria);
+ $tableNameSearch = $tables->getObjects($criteria);
unset($criteria);
//unset($criteria);
- foreach (array_keys($table_name_search) as $t) {
- if ($table_name_search[$t]->getVar('table_name') === $_POST['table_name']) {
+ foreach (array_keys($tableNameSearch) as $t) {
+ if ($tableNameSearch[$t]->getVar('table_name') === $_POST['table_name']) {
redirect_header('tables.php?op=new', 3, sprintf(_AM_TDMCREATE_ERROR_TABLE_NAME_EXIST, $_POST['table_name']));
}
}
@@ -194,7 +161,8 @@
}
$tablesObj->setVars(array(
'table_autoincrement' => ((1 == $_REQUEST['table_autoincrement']) ? 1 : 0),
- 'table_blocks' => ((1 == $_REQUEST['table_blocks']) ? 1 : 0),
+ 'table_index' => ((1 == $_REQUEST['table_index']) ? 1 : 0),
+ 'table_blocks' => ((1 == $_REQUEST['table_blocks']) ? 1 : 0),
'table_admin' => ((1 == $_REQUEST['table_admin']) ? 1 : 0),
'table_user' => ((1 == $_REQUEST['table_user']) ? 1 : 0),
'table_submenu' => ((1 == $_REQUEST['table_submenu']) ? 1 : 0),
@@ -278,47 +246,80 @@
}
break;
- case 'display_modules':
- $modules = $tdmcreate->getHandler('modules');
- foreach ($_POST['mod_id'] as $key => $value) {
- if ($key > 0) {
- $modulesObj =& $tdmcreate->getHandler('modules')->get($value);
- $modulesObj->setVar('mod_admin', (1 == $_REQUEST['mod_admin'][$key]) ? 0 : 1);
- $modulesObj->setVar('mod_user', (1 == $_REQUEST['mod_user'][$key]) ? 0 : 1);
- $modulesObj->setVar('mod_blocks', (1 == $_REQUEST['mod_blocks'][$key]) ? 0 : 1);
- $modulesObj->setVar('mod_search', (1 == $_REQUEST['mod_search'][$key]) ? 0 : 1);
- $modulesObj->setVar('mod_comments', (1 == $_REQUEST['mod_comments'][$key]) ? 0 : 1);
- $modulesObj->setVar('mod_notifications', (1 == $_REQUEST['mod_notifications'][$key]) ? 0 : 1);
- $modulesObj->setVar('mod_permissions', (1 == $_REQUEST['mod_permissions'][$key]) ? 0 : 1);
+ case 'display':
+ $modId = tdmcreate_CleanVars($_POST, 'mod_id', 0, 'int');
+ if ($modId > 0) {
+ $modulesObj = $tdmcreate->getHandler('modules')->get($modId);
+ if (isset($_POST['mod_admin'])) {
+ $mod_admin = $modulesObj->getVar('mod_admin');
+ $modulesObj->setVar('mod_admin', !$mod_admin);
+ }
+ if (isset($_POST['mod_user'])) {
+ $mod_user = $modulesObj->getVar('mod_user');
+ $modulesObj->setVar('mod_user', !$mod_user);
+ }
+ if (isset($_POST['mod_blocks'])) {
+ $mod_blocks = $modulesObj->getVar('mod_blocks');
+ $modulesObj->setVar('mod_blocks', !$mod_blocks);
+ }
+ if (isset($_POST['mod_search'])) {
+ $mod_search = $modulesObj->getVar('mod_search');
+ $modulesObj->setVar('mod_search', !$mod_search);
+ }
+ if (isset($_POST['mod_comments'])) {
+ $mod_comments = $modulesObj->getVar('mod_comments');
+ $modulesObj->setVar('mod_comments', !$mod_comments);
+ }
+ if (isset($_POST['mod_notifications'])) {
+ $mod_notifications = $modulesObj->getVar('mod_notifications');
+ $modulesObj->setVar('mod_notifications', !$mod_notifications);
+ }
+ if (isset($_POST['mod_permissions'])) {
+ $mod_permissions = $modulesObj->getVar('mod_permissions');
+ $modulesObj->setVar('mod_permissions', !$mod_permissions);
+ }
+ if ($tdmcreate->getHandler('modules')->insert($modulesObj)) {
+ redirect_header('modules.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS);
}
+ $GLOBALS['xoopsTpl']->assign('error', $modulesObj->getHtmlErrors());
}
- if ($modules->insert($modulesObj, true)) {
- redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
- } else {
- redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
- }
- break;
-
- case 'display_tables':
- $tables = $tdmcreate->getHandler('tables');
- //
- foreach ($_POST['table_id'] as $key => $value) {
- if ($key > 0) {
- $tablesObj =& $tables->get($value);
- $tablesObj->setVar('table_admin', (1 == $_REQUEST['table_admin'][$key]) ? 0 : 1);
- $tablesObj->setVar('table_user', (1 == $_REQUEST['table_user'][$key]) ? 0 : 1);
- $tablesObj->setVar('table_blocks', (1 == $_REQUEST['table_blocks'][$key]) ? 0 : 1);
- $tablesObj->setVar('table_submenu', (1 == $_REQUEST['table_submenu'][$key]) ? 0 : 1);
- $tablesObj->setVar('table_search', (1 == $_REQUEST['table_search'][$key]) ? 0 : 1);
- $tablesObj->setVar('table_comments', (1 == $_REQUEST['table_comments'][$key]) ? 0 : 1);
- $tablesObj->setVar('table_notifications', (1 == $_REQUEST['table_notifications'][$key]) ? 0 : 1);
+
+ $tableId = tdmcreate_CleanVars($_POST, 'table_id', 0, 'int');
+ if ($tableId > 0) {
+ $tablesObj = $tdmcreate->getHandler('tables')->get($tableId);
+ if (isset($_POST['table_admin'])) {
+ $table_admin = $tablesObj->getVar('table_admin');
+ $tablesObj->setVar('table_admin', !$table_admin);
+ }
+ if (isset($_POST['table_user'])) {
+ $table_user = $tablesObj->getVar('table_user');
+ $tablesObj->setVar('table_user', !$table_user);
+ }
+ if (isset($_POST['table_blocks'])) {
+ $table_blocks = $tablesObj->getVar('table_blocks');
+ $tablesObj->setVar('table_blocks', !$table_blocks);
+ }
+ if (isset($_POST['table_search'])) {
+ $table_search = $tablesObj->getVar('table_search');
+ $tablesObj->setVar('table_search', !$table_search);
+ }
+ if (isset($_POST['table_comments'])) {
+ $table_comments = $tablesObj->getVar('table_comments');
+ $tablesObj->setVar('table_comments', !$table_comments);
+ }
+ if (isset($_POST['table_notifications'])) {
+ $table_notifications = $tablesObj->getVar('table_notifications');
+ $tablesObj->setVar('table_notifications', !$table_notifications);
+ }
+ if (isset($_POST['table_permissions'])) {
+ $table_permissions = $tablesObj->getVar('table_permissions');
+ $tablesObj->setVar('table_permissions', !$table_permissions);
+ }
+ if ($tdmcreate->getHandler('tables')->insert($tablesObj)) {
+ redirect_header('tables.php', 3, _AM_TDMCREATE_TOGGLE_SUCCESS);
}
- }
- if ($tables->insert($tablesObj, true)) {
- redirect_header('tables.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
- } else {
- redirect_header('tables.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
- }
+ $GLOBALS['xoopsTpl']->assign('error', $tablesObj->getHtmlErrors());
+ }
break;
}
include __DIR__ . '/footer.php';
Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/16/rss.gif
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/16/rss.gif
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/16/rss.gif 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/16/rss.gif 2015-06-01 11:22:57 UTC (rev 13074)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/16/rss.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/index.html 2015-06-01 11:22:57 UTC (rev 13074)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/next.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/next.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/next.png 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/next.png 2015-06-01 11:22:57 UTC (rev 13074)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/next.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/previous.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/previous.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/previous.png 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/previous.png 2015-06-01 11:22:57 UTC (rev 13074)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/assets/icons/24/previous.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/cache/classpaths.cache
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/cache/classpaths.cache 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/cache/classpaths.cache 2015-06-01 11:22:57 UTC (rev 13074)
@@ -1 +0,0 @@
-a:5:{s:18:"TDMCreateStructure";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateStructure.php";s:10:"AdminPages";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminPages.php";s:18:"TDMCreateThemeForm";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\form\TDMCreateThemeForm.php";s:18:"TDMCreateFormLabel";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\html\TDMCreateFormLabel.php";s:18:"TDMCreateFormRadio";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\form\TDMCreateFormRadio.php";}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/fields.php 2015-06-01 11:22:57 UTC (rev 13074)
@@ -452,6 +452,30 @@
return $form;
}
+
+ /**
+ * Get Values
+ */
+ public function getValues($keys = null, $format = null, $maxDepth = null)
+ {
+ $ret = parent::getValues($keys, $format, $maxDepth);
+ $ret['id'] = $this->getVar('field_id');
+ $ret['mid'] = $this->getVar('field_mid');
+ $ret['tid'] = $this->getVar('field_tid');
+ $ret['order'] = $this->getVar('field_order');
+ $ret['name'] = str_replace('_', ' ', ucfirst($this->getVar('field_name')));
+ $ret['parent'] = $this->getVar('field_parent');
+ $ret['inlist'] = $this->getVar('field_inlist');
+ $ret['inform'] = $this->getVar('field_inform');
+ $ret['admin'] = $this->getVar('field_admin');
+ $ret['user'] = $this->getVar('field_user');
+ $ret['block'] = $this->getVar('field_block');
+ $ret['main'] = $this->getVar('field_main');
+ $ret['search'] = $this->getVar('field_search');
+ $ret['required'] = $this->getVar('field_required');
+
+ return $ret;
+ }
}
/*
@@ -537,4 +561,45 @@
return true;
}
+
+ /**
+ * Get Count Fields
+ */
+ public function getCountFields($start = 0, $limit = 0, $sort = 'field_id ASC, field_name', $order = 'ASC')
+ {
+ $criteria = new CriteriaCompo();
+ $criteria->setSort($sort);
+ $criteria->setOrder($order);
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ return parent::getCount($criteria);
+ }
+
+ /**
+ * Get All Fields
+ */
+ public function getAllFields($start = 0, $limit = 0, $sort = 'field_id ASC, field_name', $order = 'ASC')
+ {
+ $criteria = new CriteriaCompo();
+ $criteria->setSort($sort);
+ $criteria->setOrder($order);
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ return parent::getAll($criteria);
+ }
+
+ /**
+ * Get All Fields By Module & Table Id
+ */
+ public function getAllFieldsByModuleAndTableId($modId, $tabId, $start = 0, $limit = 0, $sort = 'field_id ASC, field_name', $order = 'ASC')
+ {
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('field_mid', $modId));
+ $criteria->add(new Criteria('field_tid', $tabId));
+ $criteria->setSort($sort);
+ $criteria->setOrder($order);
+ $criteria->setStart($start);
+ $criteria->setLimit($limit);
+ return parent::getAll($criteria);
+ }
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/TDMCreateArchitecture.php 2015-06-01 11:22:57 UTC (rev 13074)
@@ -273,8 +273,8 @@
if (1 == $tableUser) {
// User Pages File
$userPages = UserPages::getInstance();
- $userPages->write($module, $table);
- $ret[] = $userPages->renderFile($tableName . '.php');
+ $userPages->write($module, $table, $tableName . '.php');
+ $ret[] = $userPages->renderFile();
// User Templates File
$userTemplatesPages = TemplatesUserPages::getInstance();
$userTemplatesPages->write($module, $table);
@@ -532,7 +532,7 @@
}
// User Index File
$userIndex = UserIndex::getInstance();
- $userIndex->write($module, 'index.php');
+ $userIndex->write($module, $table, 'index.php');
$ret[] = $userIndex->render();
// Language Main File
$languageMain = LanguageMain::getInstance();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminObjects.php 2015-06-01 11:22:57 UTC (rev 13074)
@@ -104,8 +104,8 @@
\$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}';
\$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
\${$moduleDirname}->getConfig('maxsize'), null, null);
- if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][])) {
- \$uploader->fetchMedia(\$_POST['xoops_upload_file'][]);
+ if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) {
+ \$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]);
if (!\$uploader->upload()) {
\$errors = \$uploader->getErrors();
redirect_header('javascript:history.go(-1)', 3, \$errors);
@@ -133,9 +133,9 @@
\$uploaddir = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32';
\$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
\${$moduleDirname}->getConfig('maxsize'), null, null);
- if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][])) {
+ if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][1])) {
//\$uploader->setPrefix('{$fieldName}_');
- //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][]);
+ //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][1]);
if (!\$uploader->upload()) {
\$errors = \$uploader->getErrors();
redirect_header('javascript:history.go(-1)', 3, \$errors);
@@ -156,7 +156,7 @@
* @param string $fieldName
* @return string
*/
- public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName, $fpmf)
+ public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName, $fieldMain)
{
$stuModuleDirname = strtoupper($moduleDirname);
$ret = <<<EOT
@@ -165,11 +165,11 @@
\$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/images/{$tableName}';
\$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
\${$moduleDirname}->getConfig('maxsize'), null, null);
- if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) {
+ if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][2])) {
\$extension = preg_replace( '/^.+\.([^.]+)$/sU' , '' , \$_FILES['attachedfile']['name']);
- \$imgName = str_replace(' ', '', \$_POST['{$fpmf}']).'.'.\$extension;
+ \$imgName = str_replace(' ', '', \$_POST['{$fieldMain}']).'.'.\$extension;
\$uploader->setPrefix(\$imgName);
- \$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]);
+ \$uploader->fetchMedia(\$_POST['xoops_upload_file'][2]);
if (!\$uploader->upload()) {
\$errors = \$uploader->getErrors();
redirect_header('javascript:history.go(-1)', 3, \$errors);
@@ -199,9 +199,9 @@
\$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}';
\$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
\${$moduleDirname}->getConfig('maxsize'), null, null);
- if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][])) {
+ if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][3])) {
//\$uploader->setPrefix('{$fieldName}_') ;
- //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][]);
+ //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][3]);
if (!\$uploader->upload()) {
\$errors = \$uploader->getErrors();
redirect_header('javascript:history.go(-1)', 3, \$errors);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/admin/AdminPages.php 2015-06-01 11:22:57 UTC (rev 13074)
@@ -136,7 +136,6 @@
$ret .= <<<EOT
\${$tableName}Count = \${$tableName}Handler->getCount{$ucfTableName}();
\${$tableName}All = \${$tableName}Handler->getAll{$ucfTableName}(\$start, \$limit);
- unset(\$criteria);
\$GLOBALS['xoopsTpl']->assign('{$tableName}_count', \${$tableName}Count);
\$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_url', {$stuModuleDirname}_URL);
\$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stuModuleDirname}_UPLOAD_URL);
@@ -146,7 +145,7 @@
foreach (array_keys(\${$tableName}All) as \$i)
{
\${$tableSoleName} = \${$tableName}All[\$i]->getValues();
- \$GLOBALS['xoopsTpl']->appendByRef('{$tableName}_list', \${$tableSoleName});
+ \$GLOBALS['xoopsTpl']->append('{$tableName}_list', \${$tableSoleName});
unset(\${$tableSoleName});
}
if ( \${$tableName}Count > \$limit ) {
@@ -204,7 +203,7 @@
$ret = <<<EOT
case 'save':
if ( !\$GLOBALS['xoopsSecurity']->check() ) {
- redirect_header('{$tableName}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors()));
+ redirect_header('{$tableName}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors()));
}
if (isset(\${$fieldId})) {
\${$tableName}Obj =& \${$tableName}Handler->get(\${$fieldId});
@@ -249,7 +248,7 @@
$ret .= <<<EOT
// Insert Data
if (\${$tableName}Handler->insert(\${$tableName}Obj)) {
- redirect_header('{$tableName}.php?op=list', 2, {$language}FORMOK);
+ redirect_header('{$tableName}.php?op=list', 2, {$language}FORM_OK);
}
// Get Form
\$GLOBALS['xoopsTpl']->assign('error', \${$tableName}Obj->getHtmlErrors());
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/cache/classpaths.cache 2015-06-01 11:22:57 UTC (rev 13074)
@@ -1 +0,0 @@
-a:64:{s:18:"TDMCreateStructure";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateStructure.php";s:13:"TDMCreateFile";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\TDMCreateFile.php";s:10:"AdminPages";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminPages.php";s:12:"AdminObjects";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminObjects.php";s:19:"TemplatesAdminPages";s:118:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminPages.php";s:11:"BlocksFiles";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\blocks\BlocksFiles.php";s:15:"TemplatesBlocks";s:115:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\blocks\TemplatesBlocks.php";s:10:"ClassFiles";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\classes\ClassFiles.php";s:9:"UserPages";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserPages.php";s:18:"TemplatesUserPages";s:116:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserPages.php";s:15:"LanguageModinfo";s:107:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageModinfo.php";s:11:"AdminHeader";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminHeader.php";s:10:"AdminIndex";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminIndex.php";s:9:"AdminMenu";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminMenu.php";s:10:"AdminAbout";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminAbout.php";s:11:"AdminFooter";s:100:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminFooter.php";s:19:"TemplatesAdminAbout";s:118:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminAbout.php";s:19:"TemplatesAdminIndex";s:118:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminIndex.php";s:20:"TemplatesAdminFooter";s:119:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminFooter.php";s:20:"TemplatesAdminHeader";s:119:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminHeader.php";s:13:"LanguageAdmin";s:105:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageAdmin.php";s:11:"ClassHelper";s:102:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\classes\ClassHelper.php";s:16:"IncludeFunctions";s:107:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeFunctions.php";s:14:"IncludeInstall";s:105:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeInstall.php";s:14:"LanguageBlocks";s:106:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageBlocks.php";s:7:"SqlFile";s:94:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\sql\SqlFile.php";s:13:"IncludeUpdate";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeUpdate.php";s:13:"IncludeSearch";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeSearch.php";s:18:"TemplatesUserIndex";s:116:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserIndex.php";s:19:"TemplatesUserFooter";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserFooter.php";s:19:"TemplatesUserHeader";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserHeader.php";s:10:"UserFooter";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserFooter.php";s:10:"UserHeader";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserHeader.php";s:9:"UserIndex";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserIndex.php";s:12:"LanguageMain";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageMain.php";s:9:"CssStyles";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\css\CssStyles.php";s:13:"IncludeCommon";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeCommon.php";s:13:"DocsChangelog";s:101:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\docs\DocsChangelog.php";s:12:"LanguageHelp";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageHelp.php";s:13:"IncludeJquery";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeJquery.php";s:16:"UserXoopsVersion";s:104:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserXoopsVersion.php";s:16:"AdminPermissions";s:105:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\admin\AdminPermissions.php";s:25:"TemplatesAdminPermissions";s:124:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\admin\TemplatesAdminPermissions.php";s:20:"IncludeNotifications";s:111:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeNotifications.php";s:15:"LanguageMailTpl";s:107:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\language\LanguageMailTpl.php";s:15:"IncludeComments";s:106:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeComments.php";s:23:"IncludeCommentFunctions";s:114:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\include\IncludeCommentFunctions.php";s:22:"UserNotificationUpdate";s:110:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserNotificationUpdate.php";s:10:"UserBroken";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserBroken.php";s:19:"TemplatesUserBroken";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserBroken.php";s:9:"UserPrint";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserPrint.php";s:16:"TemplatesUserPdf";s:114:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserPdf.php";s:18:"TemplatesUserPrint";s:116:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserPrint.php";s:8:"UserRate";s:96:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserRate.php";s:17:"TemplatesUserRate";s:115:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserRate.php";s:7:"UserRss";s:95:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserRss.php";s:16:"TemplatesUserRss";s:114:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserRss.php";s:10:"UserSingle";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserSingle.php";s:19:"TemplatesUserSingle";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserSingle.php";s:10:"UserSubmit";s:98:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserSubmit.php";s:19:"TemplatesUserSubmit";s:117:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\templates\user\TemplatesUserSubmit.php";s:9:"UserVisit";s:97:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserVisit.php";s:11:"UserListTag";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserListTag.php";s:11:"UserViewTag";s:99:"D:\UwAmp\www\xoops-2.5.7testTDMCreate1.91\htdocs\modules\tdmcreate\class\files\user\UserViewTag.php";}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFiles.php 2015-06-01 11:22:57 UTC (rev 13074)
@@ -809,8 +809,9 @@
$fieldParentId = array();
$fieldElementId = array();
foreach (array_keys($fields) as $f) {
- $fieldName = $fields[$f]->getVar('field_name');
- $fieldInForm[] = $fields[$f]->getVar('field_inform');
+ $fieldName = $fields[$f]->getVar('field_name');
+ $fieldInForm[] = $fields[$f]->getVar('field_inform');
+ $fieldParentId[] = $fields[$f]->getVar('field_parent');
if ((0 == $f) && (1 == $table->getVar('table_autoincrement'))) {
$fieldId = $fieldName; // $fieldId = fields parameter index field
}
@@ -818,7 +819,7 @@
$fieldMain = $fieldName; // $fieldMain = fields parameter main field
}
if (1 == $fields[$f]->getVar('field_parent')) {
- $fieldParent = $fieldName; // $fieldParent = fields parameter parent field
+ $fieldParent = $fieldName; // $fieldParent = fields parameter parent field
}
$fieldElement = $fields[$f]->getVar('field_element');
//
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/classes/ClassFormElements.php 2015-06-01 11:22:57 UTC (rev 13074)
@@ -303,7 +303,7 @@
}
/*
- * @private function getXoopsFormTextFile
+ * @private function getXoopsFormUrlFile
* @param string $language
* @param string $moduleDirname
* @param string $fieldName
@@ -323,13 +323,13 @@
private function getXoopsFormUrlFile($language, $moduleDirname, $fieldName, $fieldDefault, $fieldElement, $required = 'false')
{
$ret = <<<EOT
- // Form Text File
- \$formTextFile = new XoopsFormElementTray({$language}FORM_FILE,'<br /><br />');
- \$field_text = \$this->isNew() ? '{$fieldDefault}' : \$this->getVar('{$fieldName}');
- \$formText = new XoopsFormText({$language}FORM_TEXT, '{$fieldName}', 75, 255, \$field_text);
- \$formTextFile->addElement(\$formText{$required} );
- \$formTextFile->addElement(new XoopsFormFile({$language}FORM_UPLOAD , 'attachedfile', \$this->{$moduleDirname}->getConfig('maxsize')){$required});
- \$form->addElement(\$formTextFile);\n
+ // Form Url Text File
+ \$formUrlFile = new XoopsFormElementTray({$language}FORM_FILE,'<br /><br />');
+ \$formFile = \$this->isNew() ? '{$fieldDefault}' : \$this->getVar('{$fieldName}');
+ \$formFormText = new XoopsFormText({$language}FORM_TEXT, '{$fieldName}', 75, 255, \$formFile);
+ \$formUrlFile->addElement(\$formFormText{$required} );
+ \$formUrlFile->addElement(new XoopsFormFile({$language}FORM_UPLOAD , 'attachedfile', \$this->{$moduleDirname}->getConfig('maxsize')){$required});
+ \$form->addElement(\$formUrlFile);\n
EOT;
return $ret;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeFunctions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeFunctions.php 2015-05-30 10:15:43 UTC (rev 13073)
+++ XoopsModules/TDMCreate/branches/timgno/1.91a2/tdmcreate/class/files/include/IncludeFunctions.php 2015-06-01 11:22:57 UTC (rev 13074)
@@ -140,7 +140,7 @@
public function getFunctionMetaKeywords($moduleDirname)
{
$ret = <<<EOT
-\nfunction {$moduleDirname}_meta_keywords(\$co...
[truncated message content] |