From: <txm...@us...> - 2015-04-26 12:17:59
|
Revision: 13043 http://sourceforge.net/p/xoops/svn/13043 Author: txmodxoops Date: 2015-04-26 12:17:46 +0000 (Sun, 26 Apr 2015) Log Message: ----------- Sortable tables for order menu and icons in admin index.php Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/css/admin/style.css XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/js/functions.js XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/TDMCreateArchitecture.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminHeader.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminPages.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/logoGenerator.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/modules.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/include/common.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/english/admin.php XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_fields.tpl XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_fields_item.tpl XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_tables.tpl XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/xoops_version.php Added Paths: ----------- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/VeraBd.ttf XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/green.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/index.html XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/red.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/xcvLogo.txt XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/js/sortable.js Removed Paths: ------------- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/icons/32/brokenlink.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/icons/32/category.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/icons/32/download.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/icons/32/plugin.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/icons/32/stats.png XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/logo.png Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/fields.php 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/fields.php 2015-04-26 12:17:46 UTC (rev 13043) @@ -25,6 +25,7 @@ $fieldMid = XoopsRequest::getInt('field_mid'); $fieldTid = XoopsRequest::getInt('field_tid'); $fieldNumb = XoopsRequest::getInt('field_numb'); +$fieldOrder = XoopsRequest::getInt('field_order'); $fieldName = XoopsRequest::getString('field_name', ''); // switch op switch ($op) @@ -37,7 +38,7 @@ $template_main = 'tdmcreate_fields.tpl'; $GLOBALS['xoTheme']->addStylesheet( 'modules/tdmcreate/assets/css/admin/style.css' ); $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js'); - $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/fields.js'); + $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/sortable.js'); $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php')); $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add'); $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); @@ -54,30 +55,35 @@ } unset($countModules); // Redirect if there aren't tables - $countTables = $tdmcreate->getHandler('tables')->getCount(); + $handlerTables = $tdmcreate->getHandler('tables'); + $countTables = $handlerTables->getCount(); if ($countTables == 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_name'); + $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) { + $tlid = 1; foreach (array_keys($tablesAll) as $tid) { // Display tables list - $table['id'] = $tid; + $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'); @@ -87,7 +93,7 @@ $criteria = new CriteriaCompo(); $criteria->add(new Criteria('field_mid', $table['mid'])); $criteria->add(new Criteria('field_tid', $tid)); - $criteria->setSort('field_id ASC, field_name'); + $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); @@ -114,14 +120,16 @@ $field['required'] = $fieldsAll[$fid]->getVar('field_required'); $fields[] = $field; unset($field); - $lid++; + $lid++; } } + $tlid++; unset($lid); $table['fields'] = $fields; $GLOBALS['xoopsTpl']->append('tables_list', $table); unset($table); } + unset($tlid); unset($fields); if ( $countTables > $limit ) { include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; @@ -137,7 +145,6 @@ // Define main template $template_main = 'tdmcreate_fields.tpl'; $GLOBALS['xoTheme']->addStylesheet( 'modules/tdmcreate/assets/css/admin/style.css' ); - $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/fields.js'); $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'); @@ -156,7 +163,6 @@ $fieldId = XoopsRequest::getInt('field_id'); // Fields Handler $fields = $tdmcreate->getHandler('fields'); - $orderId = 1; // Set Variables foreach($_POST['field_id'] as $key => $value) { @@ -164,13 +170,14 @@ $fieldsObj =& $fields->get($value); } else { $fieldsObj =& $fields->create(); - } + } + $order = $fieldsObj->isNew() ? $fieldOrder + 1 : $fieldOrder; if (isset($fieldMid) && isset($fieldTid) && !empty($_POST['field_name'][$key])) { // Set Data $fieldsObj->setVar( 'field_mid', $fieldMid ); $fieldsObj->setVar( 'field_tid', $fieldTid ); $fieldsObj->setVar( 'field_numb', $fieldNumb ); - $fieldsObj->setVar( 'field_order', (isset($_POST['field_order'][$key]) ? $_POST['field_order'][$key] : $orderId) ); + $fieldsObj->setVar( 'field_order', (isset($_POST['field_order'][$key]) ? $_POST['field_order'][$key] : $order) ); $fieldsObj->setVar( 'field_name', (!empty($_POST['field_name'][$key]) ? $_POST['field_name'][$key] : '') ); $fieldsObj->setVar( 'field_type', (!empty($_POST['field_type'][$key]) ? $_POST['field_type'][$key] : '') ); $fieldsObj->setVar( 'field_value', (!empty($_POST['field_value'][$key]) ? $_POST['field_value'][$key] : '') ); @@ -236,7 +243,7 @@ break; case 'order': - foreach($_REQUEST['field_id'] as $order => $id) { + foreach($_REQUEST['field_order'] as $order => $id) { if( $order > 0 ) { $fieldsObj = $tdmcreate->getHandler('fields')->get( $id ); $fieldsObj->setVar('field_order', $order); @@ -267,7 +274,7 @@ // $fields = $tdmcreate->getHandler('fields'); // Fields Handler - foreach($_REQUEST['field_id'] as $key => $value) + foreach($_POST['field_id'] as $key => $value) { $fieldsObj =& $fields->get($value); $fieldsObj->setVar( 'field_parent', ((isset($_REQUEST['field_parent'][$key]) == 1) ? 1 : 0) ); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/tables.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/tables.php 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/admin/tables.php 2015-04-26 12:17:46 UTC (rev 13043) @@ -28,6 +28,7 @@ $tableMid = XoopsRequest::getInt('table_mid'); $tableName = XoopsRequest::getInt('table_name'); $tableNumbFields = XoopsRequest::getInt('table_nbfields'); +$tableOrder = XoopsRequest::getInt('table_order'); $tableFieldname = XoopsRequest::getString('table_fieldname', ''); // switch ($op) @@ -40,6 +41,7 @@ $template_main = 'tdmcreate_tables.tpl'; $GLOBALS['xoTheme']->addStylesheet( 'modules/tdmcreate/assets/css/admin/style.css' ); $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js'); + $GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/sortable.js'); $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php')); $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add'); $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton()); @@ -88,7 +90,7 @@ // Get the list of tables $criteria = new CriteriaCompo(); $criteria->add(new Criteria('table_mid', $i)); - $criteria->setSort('table_id ASC, table_name'); + $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); @@ -105,7 +107,8 @@ $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['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'); @@ -171,12 +174,14 @@ $tablesObj =& $tables->get($tableId); } else { $tablesObj =& $tables->create(); - } + } + $order = $tablesObj->isNew() ? $tableOrder + 1 : $tableOrder; // Form save tables $tablesObj->setVars(array('table_mid' => $tableMid, 'table_name' => $_POST['table_name'], 'table_category' => (($_REQUEST['table_category'] == 1) ? '1' : '0'), - 'table_nbfields' => $tableNumbFields, + 'table_nbfields' => $tableNumbFields, + 'table_order' => $order, 'table_fieldname' => $tableFieldname)); //Form table_image include_once XOOPS_ROOT_PATH.'/class/uploader.php'; @@ -248,6 +253,18 @@ $form = $tablesObj->getForm(); $GLOBALS['xoopsTpl']->assign('form', $form->render()); break; + + case 'order': + foreach($_POST['table_order'] as $order => $id) { + if( $order > 0 ) { + $tablesObj = $tdmcreate->getHandler('tables')->get( $id ); + $tablesObj->setVar('table_order', $order); + if (!$tdmcreate->getHandler('tables')->insert( $tablesObj )) { + redirect_header('tables.php', 5, _AM_TDMCREATE_FIELD_ORDER_ERROR); + } + } + } + break; case 'delete': $tablesObj =& $tdmcreate->getHandler('tables')->get($tableId); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/css/admin/style.css =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/css/admin/style.css 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/css/admin/style.css 2015-04-26 12:17:46 UTC (rev 13043) @@ -28,7 +28,7 @@ table { margin: 0; padding: 0; } -/* Sortable tables */ +/* Sortable tables & fields */ tbody tr.sortable td img.move { cursor: move; } @@ -137,8 +137,81 @@ background-color: #efefef; } -.field-list tr { margin: 0; padding: 0; /*list-style: none;*/ } +.table-list tr { margin: 0; padding: 0; } +.table-list tr td { display: block; } + +.table-list tr td img.move { + margin-right: 20px; + cursor: move; + vertical-align: middle; +} +.table-list tr td strong { + vertical-align: middle; +} + +tbody.table-list tr td { + text-align: center; +} + +tbody.table-list tr td { + text-align: center; +} + +.cell.cell-width1 { + width: 4%; +} + +.cell.cell-width2 { + width: 10%; +} + +.cell.cell-width3 { + width: 8%; +} + +.cell.cell-width4 { + width: 5%; +} + +.cell.cell-width5 { + width: 5%; +} + +.cell.cell-width6 { + width: 4%; +} + +.cell.cell-width7 { + width: 5%; +} + +.cell.cell-width8 { + width: 8%; +} + +.cell.cell-width9 { + width: 6%; +} + +.cell.cell-width10 { + width: 8%; +} + +.cell.cell-width11 { + width: 9%; +} + +.cell.cell-width12 { + width: 9%; +} + +.cell.cell-width13 { + width: 5%; +} + +.field-list tr { margin: 0; padding: 0; } + .field-list tr td { display: block; } .field-list tr td { Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/VeraBd.ttf =================================================================== (Binary files differ) Index: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/VeraBd.ttf =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/VeraBd.ttf 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/VeraBd.ttf 2015-04-26 12:17:46 UTC (rev 13043) Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/VeraBd.ttf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/green.png =================================================================== (Binary files differ) Index: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/green.png =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/green.png 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/green.png 2015-04-26 12:17:46 UTC (rev 13043) Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/green.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/index.html =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/index.html (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/index.html 2015-04-26 12:17:46 UTC (rev 13043) @@ -0,0 +1 @@ +<script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/red.png =================================================================== (Binary files differ) Index: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/red.png =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/red.png 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/red.png 2015-04-26 12:17:46 UTC (rev 13043) Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/red.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/xcvLogo.txt =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/xcvLogo.txt (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/fonts/xcvLogo.txt 2015-04-26 12:17:46 UTC (rev 13043) @@ -0,0 +1 @@ +display:table-cell; vertical-align:middle; \ No newline at end of file Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/icons/32/brokenlink.png =================================================================== (Binary files differ) Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/icons/32/category.png =================================================================== (Binary files differ) Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/icons/32/download.png =================================================================== (Binary files differ) Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/icons/32/plugin.png =================================================================== (Binary files differ) Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/icons/32/stats.png =================================================================== (Binary files differ) Deleted: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/images/logo.png =================================================================== (Binary files differ) Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/js/functions.js =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/js/functions.js 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/js/functions.js 2015-04-26 12:17:46 UTC (rev 13043) @@ -31,7 +31,7 @@ moduleImageSelected = moduleImageDom.options[moduleImageDom.selectedIndex].value; $.ajax({ type:'GET', - url:xoopsUrl + "/modules/tdmcreate/class/logoGenerator.php?f=phpFunction&iconName=" + iconName + "&caption=" + caption, + url:xoopsUrl + "/class/logoGenerator.php?f=phpFunction&iconName=" + iconName + "&caption=" + caption, // call php function , phpFunction=function Name , x= parameter data:{}, dataType:"html", @@ -48,8 +48,8 @@ fileExist=true;} } if (null == fileExist){ - var opt = document.createElement("option"); - document.getElementById("mod_image").options.add(opt); + var opt = document.createElement('option'); + document.getElementById('mod_image').options.add(opt); opt.text = mycheck; opt.value = mycheck; } Added: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/js/sortable.js =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/js/sortable.js (rev 0) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/assets/js/sortable.js 2015-04-26 12:17:46 UTC (rev 13043) @@ -0,0 +1,43 @@ +// Jquery function for order fields +// When the page is loaded define the current order and items to reorder +/* Call the container items to reorder tables */ +$(document).ready(function() { + $('.table-list').sortable({ + opacity: 0.6, + handle : '.move', + cursor: 'move', + update: function() { + var order = $(this).sortable('serialize') + '&op=order'; + $('#info').load('tables.php'); + $.post('tables.php', order, function(response) { + $('#message').html(response); + }); + } + }); +}); +/* Call the container items to reorder fields */ +$(document).ready(function() { + $('.field-list').sortable({ + opacity: 0.6, + handle : '.move', + cursor: 'move', + update: function() { + var order = $(this).sortable('serialize') + '&op=order'; + $('#info').load('fields.php'); + $.post('fields.php', order, function(response) { + $('#message').html(response); + }); + } + }); +}); +/* +$(document).ready(function() { + $('.field-list').sortable({ // definisco il contenitore di elementi da riordinare + handle : '.move', // definisco con la classe .move quali sono gli elementi trascinabili + update : function () { // aggiorno l'ordine ed eseguo una callback + // salvo una variabile che contiene l'array con il nuovo ordine degli elementi + var order = $('.field-list').sortable('serialize') + '&op=order'; + $("#info").load('fields.php'); + } + }); +});*/ \ No newline at end of file Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/TDMCreateArchitecture.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/TDMCreateArchitecture.php 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/TDMCreateArchitecture.php 2015-04-26 12:17:46 UTC (rev 13043) @@ -292,7 +292,7 @@ if( $module->getVar('mod_admin') == 1 ) { // Admin Header File $adminHeader = AdminHeader::getInstance(); - $adminHeader->write($module, $table, $tables, 'header.php'); + $adminHeader->write($module, $table, 'header.php'); $ret[] = $adminHeader->render(); // Admin Index File $adminIndex = AdminIndex::getInstance(); @@ -351,7 +351,7 @@ $languageBlocks->write($module, $tables, 'blocks.php'); $ret[] = $languageBlocks->render(); } - // Creation of admin permission file + // Creation of admin permission files if ( $table->getVar('table_permissions') == 1 ) { // Admin Permissions File $adminPermissions = AdminPermissions::getInstance(); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminHeader.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminHeader.php 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminHeader.php 2015-04-26 12:17:46 UTC (rev 13043) @@ -48,26 +48,19 @@ * @param array $tables * @param string $filename */ - public function write($module, $table, $tables, $filename) { + public function write($module, $table, $filename) { $this->setModule($module); $this->setTable($table); - $this->setTables($tables); $this->setFileName($filename); } /* - * @public function render - * @param null + * @private function getAdminPagesHeader + * @param string $moduleDirname + * @param string $tableName */ - public function render() { - $module = $this->getModule(); - $table = $this->getTable(); - $tables = $this->getTables(); - $filename = $this->getFileName(); - $moduleDirname = $module->getVar('mod_dirname'); - $ucfModuleDirname = ucfirst($moduleDirname); - $language = $this->getLanguage('AM'); - $content = $this->getHeaderFilesComments($module, $filename); - $content .= <<<EOT + private function getAdminHeader($moduleDirname, $table) { + $ucfModuleDirname = ucfirst($moduleDirname); + $ret = <<<EOT \nrequire_once dirname(dirname(dirname(dirname(__FILE__)))). '/include/cp_header.php'; \$thisPath = dirname(dirname(__FILE__)); include_once \$thisPath.'/include/common.php'; @@ -80,21 +73,13 @@ EOT; if (is_object($table)) { if ( $table->getVar('table_name') != '' ) { - $content .= <<<EOT + $ret .= <<<EOT // Get instance of module \${$moduleDirname} = {$ucfModuleDirname}Helper::getInstance();\n EOT; } - foreach (array_keys($tables) as $t) - { - $tableName = $tables[$t]->getVar('table_name'); - $content .= <<<EOT -// {$tableName} -\${$tableName}Handler =& \${$moduleDirname}->getHandler('{$tableName}');\n -EOT; - } } - $content .=<<<EOT + $ret .= <<<EOT // \$myts =& MyTextSanitizer::getInstance(); if (!isset(\$xoopsTpl) || !is_object(\$xoopsTpl)) { @@ -120,6 +105,20 @@ xoops_cp_header(); \$adminMenu = new ModuleAdmin(); EOT; + return $ret; + } + /* + * @public function render + * @param null + */ + public function render() { + $module = $this->getModule(); + $table = $this->getTable(); + $filename = $this->getFileName(); + $moduleDirname = $module->getVar('mod_dirname'); + $content = $this->getHeaderFilesComments($module, $filename); + $content .= $this->getAdminHeader($moduleDirname, $table); + $this->tdmcfile->create($moduleDirname, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED); return $this->tdmcfile->renderFile(); } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminPages.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminPages.php 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/files/admin/AdminPages.php 2015-04-26 12:17:46 UTC (rev 13043) @@ -62,13 +62,15 @@ * @param string $tableName */ public function getAdminPagesHeader($moduleDirname, $table, $fpif) { - + $ucfModuleDirname = ucfirst($moduleDirname); $ret = <<<EOT include_once 'header.php'; //It recovered the value of argument op in URL$ \$op = XoopsRequest::getString('op', 'list'); // Request {$fpif} \${$fpif} = XoopsRequest::getInt('{$fpif}'); +// Get instance of module +\${$moduleDirname} = {$ucfModuleDirname}Helper::getInstance();\n // Switch options switch (\$op) {\n Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/logoGenerator.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/logoGenerator.php 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/logoGenerator.php 2015-04-26 12:17:46 UTC (rev 13043) @@ -18,8 +18,8 @@ * @author Xoops Team Developement Modules - http://www.xoops.org * @version $Id: logoGenerator.php 12258 2014-01-02 09:33:29Z timgno $ */ -include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; -//include_once XOOPS_ROOT_PATH . '/modules/TDMCreate/include/common.php'; +/*include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; +include_once XOOPS_ROOT_PATH . '/modules/tdmcreate/include/common.php'; if(function_exists($_GET['f'])) { // get function name and parameter $_GET['f']($_GET["p"]); include_once 'logoGenerator.php'; @@ -48,23 +48,90 @@ } } } - if (!file_exists($imageBase = TDMC_IMAGE_LOGOS_PATH . "/xoops2.png") || - !file_exists($font = TDMC_IMAGE_LOGOS_PATH . "/VeraBd.ttf") || + if (!file_exists($imageBase = TDMC_IMAGE_LOGOS_PATH . "/empty.png") || + !file_exists($font = TDMC_FONTS_PATH . "/VeraBd.ttf") || !file_exists($iconFile = XOOPS_ICONS32_PATH . '/' . basename($logoIcon))) { return false; } $imageModule = imagecreatefrompng($imageBase); $imageIcon = imagecreatefrompng($iconFile); // Write text + $textColor = imagecolorallocate($imageModule, 0, 0, 0); + $spaceBorder = (92 - strlen($moduleDirname) * 7.5) / 2; + imagefttext($imageModule, 8.5, 0, $spaceBorder, 45, $textColor, $font, ucfirst($moduleDirname), array()); + imagecopy($imageModule, $imageIcon, 29, 2, 0, 0, 32, 32); + $targetImagePath = TDMC_UPLOAD_IMGMOD_PATH . "/" . $moduleDirname . "_logo.png"; + $targetImageUrl = TDMC_UPLOAD_IMGMOD_URL . "/" . $moduleDirname . "_logo.png"; + imagepng($imageModule, $targetImagePath ); + imagedestroy($imageModule); + imagedestroy($imageIcon); + + return $targetImageUrl; + } +}*/ +include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; +//include_once XOOPS_ROOT_PATH . '/modules/TDMCreate/include/common.php'; + +if(function_exists($_GET['f'])) { // get function name and parameter $_GET['f']($_GET["p"]); + include_once 'logoGenerator.php'; + $ret = logoGenerator::createLogo($_GET['iconName'], $_GET['caption']); + phpFunction($ret); +} else { + echo 'Method Not Exist'; +} + +function phpFunction($val='') +{ // create php function here + echo $val; +} + +class logoGenerator +{ + static function createLogo($logoIcon, $moduleDirname) + { + if (!extension_loaded("gd")) { + return false; + } else { + $required_functions = array("imagecreatefrompng", "imagefttext", "imagecopy", "imagepng", "imagedestroy", "imagecolorallocate"); + foreach ($required_functions as $func) { + if (!function_exists($func)) { + return false; + } + } + } + + $dirname = 'tdmcreate'; + $iconFileName = XOOPS_ROOT_PATH . "/Frameworks/moduleclasses/icons/32/".basename($logoIcon); + + //$dirFonts = TDMC_PATH . "/assets/fonts"; + //$dirLogos = TDMC_PATH . "/assets/images/logos"; + $dirFonts = XOOPS_ROOT_PATH . "/modules/" . $dirname . "/assets/fonts"; + $dirLogos = XOOPS_ROOT_PATH . "/modules/" . $dirname . "/assets/images/logos"; + + if (!file_exists($imageBase = $dirLogos . "/empty.png") || + !file_exists($font = $dirFonts . "/VeraBd.ttf") || + !file_exists($iconFile = $iconFileName)) { + return false; + } + + $imageModule = imagecreatefrompng($imageBase); + $imageIcon = imagecreatefrompng($iconFile); + + // Write text $text_color = imagecolorallocate($imageModule, 0, 0, 0); $space_to_border = (92 - strlen($moduleDirname) * 7.5) / 2; imagefttext($imageModule, 8.5, 0, $space_to_border, 45, $text_color, $font, ucfirst($moduleDirname), array()); + imagecopy($imageModule, $imageIcon, 29, 2, 0, 0, 32, 32); - $targetImage = TDMC_UPLOAD_IMGMOD_URL . "/" . $moduleDirname . "_logo.png"; + + //$targetImage = TDMC_UPLOAD_IMGMOD_URL . "/" . $moduleDirname . "_logo.png"; + $targetImage = "/uploads/" . $dirname . "/images/modules/" . $moduleDirname . "_logo.png"; + imagepng($imageModule, XOOPS_ROOT_PATH . $targetImage ); + imagedestroy($imageModule); imagedestroy($imageIcon); - + return XOOPS_URL.$targetImage; } } \ No newline at end of file Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/modules.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/modules.php 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/modules.php 2015-04-26 12:17:46 UTC (rev 13043) @@ -18,7 +18,7 @@ * @since 2.5.x * @author TDM TEAM DEV MODULE * @version $Id: modules.php 12209 2013-10-23 02:49:09Z beckmi $ - * @version $Id: modules.php 12400 2014-02-13 10:22:12Z timgno $ + * @version $Id: modules.php 13040 2015-04-25 15:12:12Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); @@ -122,7 +122,7 @@ $isNew = $this->isNew(); $title = $isNew ? sprintf(_AM_TDMCREATE_MODULE_NEW) : sprintf(_AM_TDMCREATE_MODULE_EDIT); // - include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php"); + include_once(XOOPS_ROOT_PATH.'/class/xoopsformloader.php'); // $form = new XoopsThemeForm($title, 'modulesform', $action, 'post', true); $form->setExtra('enctype="multipart/form-data"'); @@ -209,7 +209,7 @@ $this_image = $this->getVar('mod_image'); $mod_image = $this_image ? $this_image : 'empty.png'; // - $uploadirectory = 'uploads/'.$GLOBALS['xoopsModule']->dirname().'/images/repository'; + $uploadirectory = 'uploads/'.$GLOBALS['xoopsModule']->dirname().'/images/modules'; $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_MODULE_IMAGE, '<br />'); $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './' . strtolower($uploadirectory) . '/'); $imageselect= new XoopsFormSelect($imgpath, 'mod_image', $mod_image); @@ -247,7 +247,7 @@ $createLogoTray -> addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".$uploadirectory."/".$tables_img."' name='image4' id='image4' alt='' />" ) ); // Create preview and submit buttons $buttonLogoGenerator4= new XoopsFormButton('', 'button4', _AM_TDMCREATE_MODULE_CREATENEWLOGO, 'button'); - $buttonLogoGenerator4->setExtra("onclick='createNewModuleLogo(\"" . XOOPS_URL . "\")'"); + $buttonLogoGenerator4->setExtra("onclick='createNewModuleLogo(\"" . TDMC_URL . "\")'"); $createLogoTray->addElement($buttonLogoGenerator4); // $form->addElement($createLogoTray); @@ -299,51 +299,38 @@ /* * @private static function createLogo * @param mixed $logoIcon - * @param string $moduleName + * @param string $moduleDirname */ - private static function createLogo($logoIcon, $moduleName) + private static function createLogo($logoIcon, $moduleDirname) { - global $pathIcon32; - - if (!extension_loaded("gd")) { + if (!extension_loaded('gd')) { return false; } else { - $required_functions = array("imagecreatefrompng", "imagefttext", "imagecopy", "imagepng", "imagedestroy", "imagecolorallocate"); - foreach ($required_functions as $func) { + $requiredFunctions = array('imagecreatefrompng', 'imagefttext', 'imagecopy', 'imagepng', 'imagedestroy', 'imagecolorallocate'); + foreach ($requiredFunctions as $func) { if (!function_exists($func)) { return false; } } } - - // $dirname = $GLOBALS['xoopsModule']->dirname(); - $iconFileName = $pathIcon32 . '/' . basename($logoIcon); - - $dirlogos = TDMC_PATH . "/images/logos"; - if (!file_exists($imageBase = $dirlogos . "/empty.png") || - !file_exists($font = $dirlogos . "/VeraBd.ttf") || - !file_exists($iconFile = $iconFileName)) { + if (!file_exists($imageBase = TDMC_IMAGE_LOGOS_PATH . '/empty.png') || + !file_exists($font = TDMC_FONTS_PATH . '/VeraBd.ttf') || + !file_exists($iconFile = XOOPS_ICONS32_PATH . '/' . basename($logoIcon))) { return false; } - $imageModule = imagecreatefrompng($imageBase); $imageIcon = imagecreatefrompng($iconFile); - // Write text - $text_color = imagecolorallocate($imageModule, 0, 0, 0); - $space_to_border = (92 - strlen($moduleName) * 7.5) / 2; - imagefttext($imageModule, 8.5, 0, $space_to_border, 45, $text_color, $font, ucfirst($moduleName), array()); - + $textColor = imagecolorallocate($imageModule, 0, 0, 0); + $spaceBorder = (92 - strlen($moduleDirname) * 7.5) / 2; + imagefttext($imageModule, 8.5, 0, $spaceBorder, 45, $textColor, $font, ucfirst($moduleDirname), array()); imagecopy($imageModule, $imageIcon, 29, 2, 0, 0, 32, 32); - - $targetImage = TDMC_UPLOAD_IMGMOD_URL . "/" . $moduleName . "_logo.png"; - - imagepng($imageModule, $targetImage ); - + $logoImg = '/' . $moduleDirname . '_logo.png'; + imagepng($imageModule, TDMC_UPLOAD_IMGMOD_PATH . $logoImg ); imagedestroy($imageModule); imagedestroy($imageIcon); - return XOOPS_URL . $targetImage; + return TDMC_UPLOAD_IMGMOD_URL . $logoImg; } } /* Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/tables.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/tables.php 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/class/tables.php 2015-04-26 12:17:46 UTC (rev 13043) @@ -45,6 +45,7 @@ $this->initVar('table_name',XOBJ_DTYPE_TXTBOX); $this->initVar('table_fieldname',XOBJ_DTYPE_TXTBOX); $this->initVar('table_nbfields',XOBJ_DTYPE_INT); + $this->initVar('table_order',XOBJ_DTYPE_INT); $this->initVar('table_image',XOBJ_DTYPE_TXTBOX); $this->initVar('table_autoincrement',XOBJ_DTYPE_INT); $this->initVar('table_blocks',XOBJ_DTYPE_INT); @@ -141,8 +142,14 @@ // $table_nbfield = new XoopsFormText(_AM_TDMCREATE_TABLE_NBFIELDS, 'table_nbfields', 10, 25, $this->getVar('table_nbfields')); $table_nbfield->setDescription(_AM_TDMCREATE_TABLE_NBFIELDS_DESC); - $form->addElement($table_nbfield, true); + $form->addElement($table_nbfield, true); // + if(!$isNew) { + $table_order = new XoopsFormText(_AM_TDMCREATE_TABLE_ORDER, 'table_order', 5, 10, $this->getVar('table_order')); + $table_order->setDescription(_AM_TDMCREATE_TABLE_ORDER_DESC); + $form->addElement($table_order, true); + } + // $get_table_image = $this->getVar('table_image'); $table_image = $get_table_image ? $get_table_image : 'blank.gif'; $iconsdir = '/Frameworks/moduleclasses/icons/32'; @@ -163,6 +170,7 @@ $fileseltray1->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD , 'attachedfile', $this->tdmcreate->getConfig('maxsize'))); $fileseltray1->addElement(new XoopsFormLabel('')); $imgtray1->addElement($fileseltray1); + $imgtray1->setDescription(_AM_TDMCREATE_TABLE_IMAGE_DESC); $form->addElement($imgtray1); // $table_autoincrement = $this->isNew() ? 1 : $this->getVar('table_autoincrement'); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/include/common.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/include/common.php 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/include/common.php 2015-04-26 12:17:46 UTC (rev 13043) @@ -29,6 +29,8 @@ define('TDMC_CLASSES_URL', TDMC_URL . '/class' ); define('TDMC_DOCS_PATH', TDMC_PATH . '/docs' ); define('TDMC_DOCS_URL', TDMC_URL . '/docs' ); +define('TDMC_FONTS_PATH', TDMC_PATH . '/assets/fonts' ); +define('TDMC_FONTS_URL', TDMC_URL . '/assets/fonts' ); define('TDMC_IMAGE_PATH', TDMC_PATH . '/assets/images' ); define('TDMC_IMAGE_URL', TDMC_URL . '/assets/images' ); define('TDMC_IMAGE_LOGOS_PATH', TDMC_PATH . '/assets/images/logos' ); Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/english/admin.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/english/admin.php 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/language/english/admin.php 2015-04-26 12:17:46 UTC (rev 13043) @@ -140,11 +140,14 @@ 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_ORDER', "Order tables"); +define('_AM_TDMCREATE_TABLE_ORDER_DESC', "You should order the tables to view them in the right ordered on the menu and index page of your new module"); 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, doesn't appear anything in the fields of the next screen,<br />otherwise you'll see all the fields with a prefix type (i.e.: <span class='bold'>cat</span> of table <span class='bold'>categories</span>).<br /><b class='red bold'>WARNING</b>: It's recommended to use singolar word"); -define('_AM_TDMCREATE_TABLE_OPTIONS_CHECKS_DESC', "For each table created, a file is created on behalf of this.<br /> +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"); +//define('_AM_TDMCREATE_TABLE_IMAGE_DESC', "You can choose an image from the list, or upload a new one from your computer"); // Added in version 1.91 define('_AM_TDMCREATE_TABLE_AUTO_INCREMENT', " Auto Increment"); define('_AM_TDMCREATE_TABLE_AUTO_INCREMENT_OPTION', "Default checked"); @@ -172,7 +175,7 @@ define('_AM_TDMCREATE_TABLE_SINGLE', "Add in Single file"); define('_AM_TDMCREATE_TABLE_VISIT', "Add in Visit file"); // v1.38 -define('_AM_TDMCREATE_TABLE_IMAGE_DESC', "<span class='red bold'>WARNING</span>: If you want to choose a new image, is best to name it with the module name before and follow with the name of the image so as not to overwrite any images with the same name, in the <span class='bold'>Frameworks/moduleclasses/moduleadmin/icons/32/</span>. Otherwise an other solution, would be to insert the images in the module, a new folder is created, with the creation of the same module - <span class='bold'>images/32</span>."); +define('_AM_TDMCREATE_TABLE_IMAGE_DESC', "<span class='red bold'>WARNING</span>: If you want to choose a new image, is best to name it with the module name before and follow with the name of the image so as not to overwrite any images with the same name, in the <span class='bold'>Frameworks/moduleclasses/moduleadmin/icons/32/</span>. Otherwise an other solution, would be to insert the images in the module, a new folder is created, with the creation of the same module - <span class='bold'>assets/icons/32</span>."); define('_AM_TDMCREATE_TABLE_FORM_CREATED_OK', "The table <b class='green'>%s</b> is successfully created"); define('_AM_TDMCREATE_TABLE_FORM_UPDATED_OK', "The table <b class='green'>%s</b> is successfully updated"); // ------------------ Form Fields ------------------ Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_fields.tpl =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_fields.tpl 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_fields.tpl 2015-04-26 12:17:46 UTC (rev 13043) @@ -23,12 +23,12 @@ </thead> <tbody> <{foreach item=table from=$tables_list}> - <tr id="table<{$table.id}>" class="fields toggleMain"> - <td class='center bold width5'>(<{$table.id}>) + <tr id="table_<{$table.id}>" order="<{$table.order}>" class="fields toggleMain"> + <td class='center bold width5'>(<{$table.lid}>) <a href="#" title="Toggle"><img class="imageToggle" src="<{$modPathIcon16}>/toggle.png" alt="Toggle" /></a> </td> <td class='center'><u class='bold'><{$table.name}></u></td> - <td class='center'><img src="<{xoModuleIcons32}><{$table.image}>" alt="<{$table.name}>" height="22" /></td> + <td class='center'><img src="<{xoModuleIcons32}><{$table.image}>" title="<{$table.name}>" alt="<{$table.name}>" /></td> <td class='center bold'><{$table.nbfields}></td> <td class='center'><img src="<{$modPathIcon16}>/fields.png" /></td> <td class='center'><img src="<{$modPathIcon16}>/fields.png" /></td> Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_fields_item.tpl =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_fields_item.tpl 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_fields_item.tpl 2015-04-26 12:17:46 UTC (rev 13043) @@ -1,34 +1,34 @@ <table class='width100'> - <tbody class="field-list"> - <{foreach item=field from=$table.fields}> - <{if $field.id > 0}> - <tr id="fieldItem_<{$table.id}>_<{$field.id}>" order="<{$field.order}>" class="<{cycle values='even,odd'}>"> - <td class='center width5'>[<{$field.lid}>] <img class="move" src="<{$modPathIcon16}>/drag.png" alt="<{$field.name}>" /></td> - <td class='center width10'><{$field.name}></td> - <td class='center'><img src="<{$modPathIcon16}>/tables.png" alt="Empty" /></td> - <td class='center'><img src="<{$modPathIcon16}>/tables.png" alt="Empty" /></td> - <td class='center'><img id="loading_img_parent<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_parent<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_parent: <{if $field.parent}>0<{else}>1<{/if}> }, 'img_parent<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.parent}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> - </td> - <td class='center'><img id="loading_img_inlist<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_inlist<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_inlist: <{if $field.inlist}>0<{else}>1<{/if}> }, 'img_inlist<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.inlist}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> - </td> - <td class='center'><img id="loading_img_inform<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_inform<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_inform: <{if $field.inform}>0<{else}>1<{/if}> }, 'img_inform<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.inform}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> - </td> - <td class='center'><img id="loading_img_admin<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_admin<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_admin: <{if $field.admin}>0<{else}>1<{/if}> }, 'img_admin<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.admin}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> - </td> - <td class='center'><img id="loading_img_user<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_user<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_user: <{if $field.user}>0<{else}>1<{/if}> }, 'img_user<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.user}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> - </td> - <td class='center'><img id="loading_img_block<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_block<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_block: <{if $field.block}>0<{else}>1<{/if}> }, 'img_block<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.block}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> - </td> - <td class='center'><img id="loading_img_main<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_main<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_main: <{if $field.main}>0<{else}>1<{/if}> }, 'img_main<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.main}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> - </td> - <td class='center'><img id="loading_img_search<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_search<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_search: <{if $field.search}>0<{else}>1<{/if}> }, 'img_search<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.search}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> - </td> - <td class='center width10'> - <img id="loading_img_required<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_required<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_required: <{if $field.required}>0<{else}>1<{/if}> }, 'img_required<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.required}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> - </td> - <td class='center width5'><img src="<{$modPathIcon16}>/left_right.png" alt="Empty" /></td> - </tr> - <{/if}> - <{/foreach}> - </tbody> + <tbody class="field-list"> + <{foreach item=field from=$table.fields}> + <{if $field.id > 0}> + <tr id="field_<{$table.id}>_<{$field.id}>" order="<{$field.order}>" class="<{cycle values='even,odd'}>"> + <td class='center width5'>[<{$field.lid}>] <img class="move" src="<{$modPathIcon16}>/drag.png" alt="<{$field.name}>" /></td> + <td class='center width10'><{$field.name}></td> + <td class='center'><img src="<{$modPathIcon16}>/tables.png" alt="Empty" /></td> + <td class='center'><img src="<{$modPathIcon16}>/tables.png" alt="Empty" /></td> + <td class='center'><img id="loading_img_parent<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_parent<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_parent: <{if $field.parent}>0<{else}>1<{/if}> }, 'img_parent<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.parent}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> + </td> + <td class='center'><img id="loading_img_inlist<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_inlist<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_inlist: <{if $field.inlist}>0<{else}>1<{/if}> }, 'img_inlist<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.inlist}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> + </td> + <td class='center'><img id="loading_img_inform<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_inform<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_inform: <{if $field.inform}>0<{else}>1<{/if}> }, 'img_inform<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.inform}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> + </td> + <td class='center'><img id="loading_img_admin<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_admin<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_admin: <{if $field.admin}>0<{else}>1<{/if}> }, 'img_admin<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.admin}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> + </td> + <td class='center'><img id="loading_img_user<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_user<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_user: <{if $field.user}>0<{else}>1<{/if}> }, 'img_user<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.user}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> + </td> + <td class='center'><img id="loading_img_block<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_block<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_block: <{if $field.block}>0<{else}>1<{/if}> }, 'img_block<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.block}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> + </td> + <td class='center'><img id="loading_img_main<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_main<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_main: <{if $field.main}>0<{else}>1<{/if}> }, 'img_main<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.main}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> + </td> + <td class='center'><img id="loading_img_search<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_search<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_search: <{if $field.search}>0<{else}>1<{/if}> }, 'img_search<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.search}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> + </td> + <td class='center width10'> + <img id="loading_img_required<{$field.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_required<{$field.id}>" onclick="tdmcreate_setStatus( { op: 'display', field_id: <{$field.id}>, field_required: <{if $field.required}>0<{else}>1<{/if}> }, 'img_required<{$field.id}>', 'fields.php' )" src="<{xoModuleIcons16}><{$field.required}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$field.name}>" /> + </td> + <td class='center width5'><img src="<{$modPathIcon16}>/left_right.png" alt="Empty" /></td> + </tr> + <{/if}> + <{/foreach}> + </tbody> </table> \ No newline at end of file Modified: XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_tables.tpl =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_tables.tpl 2015-04-24 22:03:15 UTC (rev 13042) +++ XoopsModules/TDMCreate/branches/timgno/1.91a1/tdmcreate/templates/admin/tdmcreate_tables.tpl 2015-04-26 12:17:46 UTC (rev 13043) @@ -23,18 +23,18 @@ <tbody> <{foreach item=module from=$modules_list}> <tr id="module<{$module.id}>" class="tables toggleMain"> - <td class='center bold width5'>(<{$module.id}>) + <td class='center bold width5'>(<{$module.id}>) <a href="#" title="Toggle"><img class="imageToggle" src="<{$modPathIcon16}>/toggle.png" alt="Toggle" /></a> </td> <td class='center bold green'><{$module.name}></td> <td class='center'><img src="<{$tdmc_upload_imgmod_url}>/<{$module.image}>" alt="" height="35" /></td> - <td class='center'><img src="<{$modPathIcon16}>/fields.png" alt="16" /></td> + <td class='center'><img src="<{$modPathIcon16}>/fields.png" alt="16" /></td> <td class='center'><img id="loading_img_admin<{$module.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$smarty.const._AM_SYSTEM_LOADING}>" alt="<{$smarty.const._AM_SYSTEM_LOADING}>" /><img style="cursor:pointer;" class="tooltip" id="img_admin<{$module.id}>" onclick="tdmcreate_setStatus( { op: 'display_modules', mod_id: <{$module.id}>, mod_admin: <{if $module.admin == 1}>0<{else}>1<{/if}> }, 'img_admin<{$module.id}>', 'modules.php' )" src="<{xoModuleIcons16}><{$module.admin}>.png" alt="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$module.name}>" title="<{$smarty.const._AM_TDMCREATE_CHANGE_DISPLAY}> <{$module.name}>" /> </td> <td class='center'><img id="loading_img_user<{$module.id}>" src="<{$modPathIcon16}>/spinner.gif" style="display:none;" title="<{$s... [truncated message content] |