|
From: <txm...@us...> - 2014-03-13 21:55:47
|
Revision: 12373
http://sourceforge.net/p/xoops/svn/12373
Author: txmodxoops
Date: 2014-03-13 21:55:43 +0000 (Thu, 13 Mar 2014)
Log Message:
-----------
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/headerfiles.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/htmlsmartycodes.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions_const.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/create_file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/fields_parameters.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/form_elements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/tables_fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields_parameters.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/xoopsversion_file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/form_elements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/structure.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables_fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/uploads/modules/Car_logo.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/uploads/modules/My Module_logo.png
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-12 20:19:24 UTC (rev 12372)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-13 21:55:43 UTC (rev 12373)
@@ -62,164 +62,9 @@
/*Structure*/
/************************************************/
//Creation of the structure of folders and files
- const_structure($modules);
- //Creation of changelog.txt
- const_changelog($modules);
-
- $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix('mod_tdmcreate_tables') . " WHERE table_name = 'mod_".strtolower($mod_name)."_categories'");
- list( $category ) = $xoopsDB->fetchRow($result);
-
- foreach (array_keys($tables_arr) as $i)
- {
- // Variables
- $table_name = $tables_arr[$i]->getVar('table_name');
- $table_fieldname = $tables_arr[$i]->getVar('table_fieldname');
- $table_category = $tables_arr[$i]->getVar('table_category');
- $table_fields = $tables_arr[$i]->getVar('table_fields');
- $table_parameters = $tables_arr[$i]->getVar('table_parameters');
- $table_image = $tables_arr[$i]->getVar('table_image');
- $table_blocks = $tables_arr[$i]->getVar('table_blocks');
- $table_admin = $tables_arr[$i]->getVar('table_admin');
- $table_user = $tables_arr[$i]->getVar('table_user');
- $table_search = $tables_arr[$i]->getVar('table_search');
- $table_comments = $tables_arr[$i]->getVar('table_comments');
- $table_notifications = $tables_arr[$i]->getVar('table_notifications');
- $table_permissions = $tables_arr[$i]->getVar('table_permissions');
- $table_waiting = $tables_arr[$i]->getVar('table_waiting');
-
- // Fabrication
- // Copy of images tables
- $table_image1 = $modPath . '/images/uploads/tables/' . $table_image;
- if (file_exists($table_image1)) {
- copy($table_image1, $modPath . '/modules/' . strtolower($mod_name) . '/images/icons/32/' . $table_image);
- }
- // Creation of classes
- if ( $table_admin == 1 || $table_user == 1) {
- const_class($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $table_permissions);
- }
- // Creation of pages admin
- if ( $table_admin == 1 ) {
- const_admin_pages($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $category);
- }
- // Creation of pages and templates user
- if ( $table_user == 1 && $table_name != null ) {
- const_user_pages($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
- const_templates_pages($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
- }
- // Creation of search
- if ( $table_search == 1 ) {
- const_include_search($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $table_image);
- }
- // Creation of admin permissions.php
- if ( $table_permissions == 1) {
- const_admin_permissions($modules, $table_name, $table_fields, $table_parameters);
- }
- // Creation of notifications
- if ( $table_notifications == 1 ) {
- const_include_notifications($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
- }
- // Creation of the file mysql.sql
- const_sql($modules, $table_name, $table_fieldname, $category, $table_fields);
-
- // Creation of blocks
- if ( $table_blocks == 1 ) {
- const_blocks($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $category);
- //Creation of template per blocks
- const_blocks_templates($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
- }
- }
- $table_name = isset($table_name) ? $table_name : null;
- $table_comments = isset($table_comments) ? $table_comments : null;
- $table_waiting = isset($table_waiting) ? $table_waiting : null;
- $table_parameters = isset($table_parameters) ? $table_parameters : null;
- $table_user = isset($table_user) ? $table_user : null;
- $table_admin = isset($table_admin) ? $table_admin : null;
- $table_fields = isset($table_fields) ? $table_fields : null;
- $table_blocks = isset($table_blocks) ? $table_blocks : null;
- $table_image = isset($table_image) ? $table_image : null;
- $table_permissions = isset($table_permissions) ? $table_permissions : null;
- $table_notifications = isset($table_notifications) ? $table_notifications : null;
- //Creation of architecture of more fields and data
- //const_architecture(null, null, $table_admin, $table_blocks, $table_admin, $table_blocks );
- // Creation of comments
- if ( $table_comments == 1 ) {
- const_include_comments($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
- }
-
- if ( $table_waiting == 1 ) {
- // Creation of Waiting Plugin
- const_waiting($modules, $tables_arr);
- }
- // Creation of class helper, module & request
- if ( $table_name != '' ) {
- const_class_helper($modules);
- const_class_module($modules);
- const_class_request($modules);
- }
- // Creation of xoopsversion.php
- const_xoopsversion($modules, $table_name, $table_fields, $table_parameters, $table_image, $tables_arr);
- // Creation of template index
- const_templates_index($modules);
- // Creation of template header
- const_templates_header($modules, $tables_arr);
- // Creation of template footer
- const_templates_footer($modules, $table_comments, $table_notifications);
- if ( $table_admin == 1 ) {
- // Creation of template admin about
- const_templates_admin_about($modules);
- // Creation of template admin help
- const_templates_admin_help($modules);
- }
- // Include
- ///////////////////////////////////////////////////////////////////////
- // Configs
- const_include_common($modules, $mod_author_website_name, $mod_author_website_url);
- // Functions
- const_include_functions($modules);
- //Creation of file install per l'uploads
- const_include_install($modules, $tables_arr);
- // Language
- ///////////////////////////////////////////////////////////////////////
- if ( $mod_user == 1 ) {
- //Creation of language main.php
- const_main_language($modules, $tables_arr);
- }
- // Creation of language modinfo.php
- const_modinfo_language($modules, $table_name, $table_image, $tables_arr, $mod_notifications);
- if ( $table_admin == 1 ) {
- // Creation of language admin.php
- const_admin_language($modules, $tables_arr, $mod_permissions);
- }
- if ( $table_blocks == 1 ) {
- // Creation of language blocks.php
- const_blocks_language($modules, $tables_arr);
- }
- // Creation of language help/help.html
- const_help_language($modules);
- ///////////////////////////////////////////////////////////////////////
- //Creation of style.css
- const_css_style($modules);
- /************************************************/
- /*Admin*/
- /************************************************/
- // Creation of admin header.php
- const_admin_header($modules, $table_name, $tables_arr);
- // Creation of admin index.php
- const_admin_index($modules, $tables_arr);
- // Creation of admin footer.php
- const_admin_footer($modules);
- // Creation of admin menu.php
- const_admin_menu($modules, $tables_arr, $mod_permissions);
- // Creation of admin about.php
- const_admin_about($modules);
- /************************************************/
- /*User*/
- /************************************************/
- if ( $mod_user == 1 ) {
- const_user_header($modules);
- const_user_index($modules);
- }
+ echo 'Under new construction';
+
TDMCreate_CloseTable();
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php 2014-03-12 20:19:24 UTC (rev 12372)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php 2014-03-13 21:55:43 UTC (rev 12373)
@@ -23,4 +23,5 @@
echo "<div class='center smallsmall italic pad5'>
<strong>" . $xoopsModule->getVar('name') . "</strong> is maintained by the
<a href='http://xoops.org/forums/newbb' title='Visit Support Forum' class='tooltip' rel='external'>Support Forum</a></div>";
-xoops_cp_footer();
\ No newline at end of file
+xoops_cp_footer();
+?>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-12 20:19:24 UTC (rev 12372)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-13 21:55:43 UTC (rev 12373)
@@ -1,4 +1,4 @@
-<?php
+<?php
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
@@ -14,173 +14,170 @@
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* @package tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: modules.php 11084 2013-02-23 15:44:20Z timgno $
+ * @since 2.5.5
+ * @author Txmod Xoops <su...@tx...>
+ * @version $Id: 1.59 modules.php 11297 2013-03-24 10:58:10Z timgno $
*/
-include_once 'header.php';
-$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'list', 'string' );
-echo $adminMenu->addNavigation('modules.php');
+include 'header.php';
+// Recovered the value of the argument op in the URL $
+$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
+
switch ($op)
-{
- case 'save':
- if (!$GLOBALS['xoopsSecurity']->check()) {
+{
+ case 'list':
+ default:
+ $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
+ $start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
+ // Define main template
+ $xoopsOption['template_main'] = 'tdmcreate_modules.html';
+ xoops_cp_header();
+ $xoopsTpl->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
+ $xoopsTpl->assign('button_new', $adminMenu->renderButton());
+ $xoopsTpl->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
+ $criteria = new CriteriaCompo();
+ $criteria->setSort('mod_id ASC, mod_name');
+ $criteria->setOrder('ASC');
+ $numrows = $modulesHandler->getCount();
+ $mods_arr = $modulesHandler->getAll( $criteria );
+ unset($criteria);
+ // Display modules list
+ if ($numrows>0)
+ {
+ $yes = "<img src='../images/icons/16/green.png' alt='"._YES."' title='"._YES."' />";
+ $no = "<img src='../images/icons/16/red.png' alt='"._NO."' title='"._NO."' />";
+ foreach (array_keys($mods_arr) as $i)
+ {
+ $mod['mod_id'] = $i;
+ $mod['mod_name'] = $mods_arr[$i]->getVar('mod_name');
+ $mod['mod_version'] = $mods_arr[$i]->getVar('mod_version');
+ $mod['mod_image'] = $mods_arr[$i]->getVar('mod_image');
+ $mod['mod_release'] = $mods_arr[$i]->getVar('mod_release');
+ $mod['mod_status'] = $mods_arr[$i]->getVar('mod_status');
+ $mod['mod_admin'] = ( $mods_arr[$i]->getVar('mod_admin') == 1 ) ? $yes : $no;
+ $mod['mod_user'] = ( $mods_arr[$i]->getVar('mod_user') == 1 ) ? $yes : $no;
+ $mod['mod_submenu'] = ( $mods_arr[$i]->getVar('mod_submenu') == 1 ) ? $yes : $no;
+ $mod['mod_search'] = ( $mods_arr[$i]->getVar('mod_search') == 1 ) ? $yes : $no;
+ $mod['mod_comments'] = ( $mods_arr[$i]->getVar('mod_comments') == 1 ) ? $yes : $no;
+ $mod['mod_notifications'] = ( $mods_arr[$i]->getVar('mod_notifications') == 1 ) ? $yes : $no;
+ $xoopsTpl->append('modules_list', $mod);
+ unset($mod);
+ }
+ if ( $numrows > $limit ) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $xoopsTpl->assign('pagenav', $pagenav->renderNav(4));
+ }
+ } else {
+ $xoopsTpl->assign('error', 'There aren\'t modules');
+ }
+ break;
+
+ case 'new':
+ // Define main template
+ $xoopsOption['template_main'] = 'tdmcreate_modules.html';
+ xoops_cp_header();
+ $xoopsTpl->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
+ $xoopsTpl->assign('button_list', $adminMenu->renderButton());
+
+ $obj =& $modulesHandler->create();
+ $form = $obj->getForm();
+ $xoopsTpl->assign('form', $form->render());
+ break;
+
+ case 'save':
+ if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
-
if (isset($_REQUEST['mod_id'])) {
$obj =& $modulesHandler->get($_REQUEST['mod_id']);
} else {
$obj =& $modulesHandler->create();
+ }
+ //Form module save
+ $obj->setVars(array('mod_name' => $_POST['mod_name'], 'mod_version' => $_POST['mod_version'],
+ 'mod_min_php' => $_POST['mod_min_php'], 'mod_min_xoops' => $_POST['mod_min_xoops'],
+ 'mod_min_admin' => $_POST['mod_min_admin'], 'mod_min_mysql' => $_POST['mod_min_mysql'],
+ 'mod_description' => $_POST['mod_description'], 'mod_author' => $_POST['mod_author'], 'mod_author_mail' => $_POST['mod_author_mail'],
+ 'mod_author_website_url' => $_POST['mod_author_website_url'],
+ 'mod_author_website_name' => $_POST['mod_author_website_name'],
+ 'mod_credits' => $_POST['mod_credits'], 'mod_license' => $_POST['mod_license'],
+ 'mod_release_info' => $_POST['mod_release_info'],
+ 'mod_release_file' => $_POST['mod_release_file'],
+ 'mod_manual' => $_POST['mod_manual'], 'mod_manual_file' => $_POST['mod_manual_file']));
+ //Form mod_image
+ include_once XOOPS_ROOT_PATH . '/class/uploader.php';
+ $uploaddir = TDMC_UPLOAD_PATH.'/images/modules/';
+ $uploader = new XoopsMediaUploader($uploaddir, $GLOBALS['xoopsModuleConfig']['mimetypes'],
+ $GLOBALS['xoopsModuleConfig']['maxsize'], null, null);
+ if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
+ $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attaccedFile']['name']);
+ $name_img = $_GET['mod_name'].'_slogo.'.$extension;
+ $uploader->setPrefix($name_img);
+ $uploader->fetchMedia($_POST['xoops_upload_file'][0]);
+ if (!$uploader->upload()) {
+ $errors = $uploader->getErrors();
+ redirect_header('javascript:history.go(-1)',3, $errors);
+ } else {
+ $obj->setVar('mod_image', $uploader->getSavedFileName());
+ }
+ } else {
+ $obj->setVar('mod_image', $_POST['mod_image']);
+ }
+ //Form module save
+ $obj->setVars(array('mod_demo_site_url' => $_POST['mod_demo_site_url'],
+ 'mod_demo_site_name' => $_POST['mod_demo_site_name'],
+ 'mod_support_url' => $_POST['mod_support_url'],
+ 'mod_support_name' => $_POST['mod_support_name'],
+ 'mod_website_url' => $_POST['mod_website_url'],
+ 'mod_website_name' => $_POST['mod_website_name'],
+ 'mod_release' => $_POST['mod_release'], 'mod_status' => $_POST['mod_status'],
+ 'mod_admin' => (($_REQUEST['mod_admin'] == 1) ? '1' : '0'),
+ 'mod_user' => (($_REQUEST['mod_user'] == 1) ? '1' : '0'),
+ 'mod_submenu' => (($_REQUEST['mod_submenu'] == 1) ? '1' : '0'),
+ 'mod_search' => (($_REQUEST['mod_search'] == 1) ? '1' : '0'),
+ 'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'),
+ 'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0')));
+
+ if ($modulesHandler->insert($obj)) {
+ redirect_header('modules.php', 2, _AM_TDMCREATE_FORMOK);
}
- //Image 'gif|jpeg|pjpeg|png' 500000
- include_once XOOPS_ROOT_PATH.'/class/uploader.php';
- $uploaddir = XOOPS_ROOT_PATH . '/modules/'.$xoopsModule->dirname().'/images/uploads/modules/';
- $uploader = new XoopsMediaUploader($uploaddir, xoops_getModuleOption('mimetypes', $thisDirname),
- xoops_getModuleOption('maxsize', $thisDirname), null, null);
- if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']) ;
- $img_name = $obj->getVar('mod_name').'_slogo.'.$extension;
- $uploader->setTargetFileName($img_name);
- $uploader->fetchMedia($_POST['xoops_upload_file'][0]);
- if (!$uploader->upload()) {
- $errors = $uploader->getErrors();
- redirect_header('javascript:history.go(-1)', 3, $errors);
- } else {
- $obj->setVar('mod_image', $uploader->getSavedFileName());
- }
- } else {
- $obj->setVar('mod_image', $_POST['mod_image']);
- }
-
- $obj->setVar('mod_name', preg_replace('/\s+/', '', $_POST['mod_name'])); //remove all spaces from the new name
- $obj->setVar('mod_version', $_POST['mod_version']);
- $obj->setVar('mod_since', $_POST['mod_since']);
- $obj->setVar('mod_min_php', $_POST['mod_min_php']);
- $obj->setVar('mod_min_xoops', $_POST['mod_min_xoops']);
- $obj->setVar('mod_min_admin', $_POST['mod_min_admin']);
- $obj->setVar('mod_min_mysql', $_POST['mod_min_mysql']);
- $obj->setVar('mod_description', $_POST['mod_description']);
- $obj->setVar('mod_author', $_POST['mod_author']);
- $obj->setVar('mod_author_mail', $_POST['mod_author_mail']);
- $obj->setVar('mod_author_website_url', $_POST['mod_author_website_url']);
- $obj->setVar('mod_author_website_name', $_POST['mod_author_website_name']);
- $obj->setVar('mod_credits', $_POST['mod_credits']);
- $obj->setVar('mod_license', $_POST['mod_license']);
- $obj->setVar('mod_release_info', $_POST['mod_release_info']);
- $obj->setVar('mod_release_file', $_POST['mod_release_file']);
- $obj->setVar('mod_manual', $_POST['mod_manual']);
- $obj->setVar('mod_manual_file', $_POST['mod_manual_file']);
- $obj->setVar('mod_demo_site_url', $_POST['mod_demo_site_url']);
- $obj->setVar('mod_demo_site_name', $_POST['mod_demo_site_name']);
- $obj->setVar('mod_support_url', $_POST['mod_support_url']);
- $obj->setVar('mod_support_name', $_POST['mod_support_name']);
- $obj->setVar('mod_website_url', $_POST['mod_website_url']);
- $obj->setVar('mod_website_name', $_POST['mod_website_name']);
- $obj->setVar('mod_release', $_POST['mod_release']);
- $obj->setVar('mod_status', $_POST['mod_status']);
- $obj->setVar('mod_admin', $_REQUEST['mod_admin']);
- $obj->setVar('mod_user', $_REQUEST['mod_user']);
- $obj->setVar('mod_search', $_REQUEST['mod_search']);
- $obj->setVar('mod_comments', $_REQUEST['mod_comments']);
- $obj->setVar('mod_notifications', $_REQUEST['mod_notifications']);
- $obj->setVar('mod_permissions', $_REQUEST['mod_permissions']);
- $obj->setVar('mod_install', $_REQUEST['mod_install']);
- $obj->setVar('mod_donations', $_POST['mod_donations']);
- $obj->setVar('mod_subversion', $_POST['mod_subversion']);
-
- if ($modulesHandler->insert($obj)) {
- redirect_header('modules.php?op=list', 2, _AM_TDMCREATE_FORMOK);
- }
+ $xoopsTpl->assign('error', $obj->getHtmlErrors());
+ $form =& $obj->getForm();
+ $xoopsTpl->assign('form', $form->render());
break;
-
- case 'new':
- $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php?op=list', 'list');
- echo $adminMenu->renderButton();
-
- $obj =& $modulesHandler->create();
- $form = $obj->getForm();
- break;
- case 'edit':
+
+ case 'edit':
+ // Define main template
+ $xoopsOption['template_main'] = 'tdmcreate_modules.html';
+ xoops_cp_header();
+ $xoopsTpl->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
+ $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
+ $xoopsTpl->assign('button_new', $adminMenu->renderButton());
+ $xoopsTpl->assign('button_list', $adminMenu->renderButton());
+
+ $obj = $modulesHandler->get($_REQUEST['mod_id']);
+ $form = $obj->getForm();
+ $xoopsTpl->assign('form', $form->render());
+ break;
+
+ case 'delete':
$obj =& $modulesHandler->get($_REQUEST['mod_id']);
- $form = $obj->getForm();
- break;
- case 'delete':
- $obj =& $modulesHandler->get($_REQUEST['mod_id']);
- if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1)
- {
- if (!$GLOBALS['xoopsSecurity']->check()) {
+ if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
+ if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
if ($modulesHandler->delete($obj)) {
- $xoopsDB->queryF("DELETE FROM ".$xoopsDB->prefix("tdmcreate_modules")." WHERE mod_id = ".$_REQUEST['mod_id']);
redirect_header('modules.php', 3, _AM_TDMCREATE_FORMDELOK);
} else {
- echo $obj->getHtmlErrors();
+ $xoopsTpl->assign('error', $obj->getHtmlErrors());
}
} else {
xoops_confirm(array('ok' => 1, 'mod_id' => $_REQUEST['mod_id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('mod_name')));
}
- break;
- case 'list':
- default:
- $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_NEW, 'modules.php?op=new', 'add');
- echo $adminMenu->renderButton();
-
- $criteria = new CriteriaCompo();
- $criteria->setSort('mod_id');
- $criteria->setOrder('ASC');
- $mod_arr = $modulesHandler->getall($criteria);
- $numrows_modules = $modulesHandler->getCount();
-
- if ( $numrows_modules > 0 )
- {
- echo '<table width="100%" cellspacing="1" class="outer">';
- echo '<tr class="center">';
- echo '<th width="1%">'._AM_TDMCREATE_ID.'</th>';
- echo '<th width="10%">'._AM_TDMCREATE_NAME.'</th>';
- echo '<th width="10%">'._AM_TDMCREATE_IMAGE.'</th>';
- echo '<th width="15%">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>';
- echo '<th width="15%">'._AM_TDMCREATE_DISPLAY_USER.'</th>';
- echo '<th width="1%">'._AM_TDMCREATE_FORMACTION.'</th>';
- echo '</tr>';
- $class = 'odd';
- foreach (array_keys($mod_arr) as $i)
- {
- $mod_id = $mod_arr[$i]->getVar('mod_id');
- $mod_name = $mod_arr[$i]->getVar('mod_name');
- $mod_image = $mod_arr[$i]->getVar('mod_image');
- //$mod_blocks = $mod_arr[$i]->getVar('mod_blocks');
- $mod_admin = $mod_arr[$i]->getVar('mod_admin');
- $mod_user = $mod_arr[$i]->getVar('mod_user');
- $admin = ($mod_admin == 1) ? _YES : _NO;
- $user = ($mod_user == 1) ? _YES : _NO;
- echo '<tr class="odd center">';
- echo '<td><b>'.$i.'</b></td>';
- $nbsps = ' ';
- echo '<td class="left">'.$nbsps.'<img src="../images/icons/16/arrow.gif" alt="Arrow" />'.$nbsps.'<b>'.$mod_name.'</b></td>';
- echo '<td><img src="../images/uploads/modules/'.$mod_image.'" height="30px" /></td>';
- echo '<td>'.$admin.'</td>';
- echo '<td>'.$user.'</td>';
- echo '<td>';
- echo '<a href="modules.php?op=edit&mod_id='.$mod_id.'"><img src="'. $pathIcon16 .'/edit.png" alt="'._EDIT.'" title="'._EDIT.'" /></a> <a href="modules.php?op=delete&mod_id='.$mod_id.'"><img src="'. $pathIcon16 .'/delete.png" alt="'._DELETE.'" title="'._DELETE.'" /></a>';
- echo '</td>';
- echo '</tr>';
- }
- echo '</table><br><br>';
- } else {
- echo '<table width="100%" cellspacing="1" class="outer">';
- echo '<tr class="center">';
- echo '<th width="1%">'._AM_TDMCREATE_ID.'</th>';
- echo '<th width="10%">'._AM_TDMCREATE_NAME.'</th>';
- echo '<th width="10%">'._AM_TDMCREATE_IMAGE.'</th>';
- echo '<th width="15%">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>';
- echo '<th width="15%">'._AM_TDMCREATE_DISPLAY_USER.'</th>';
- echo '<th width="1%">'._AM_TDMCREATE_FORMACTION.'</th>';
- echo '<tr><td class="errorMsg" colspan="8">No modules</td></tr>';
- echo '</tr></table><br><br>';
- }
- break;
+ break;
}
-include_once 'footer.php';
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-12 20:19:24 UTC (rev 12372)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-13 21:55:43 UTC (rev 12373)
@@ -1,198 +1,164 @@
-<?php
+<?php
/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
+You may not change or alter any portion of this comment or credits
+of supporting developers from this source code or any supporting source code
+which is considered copyrighted (c) material of the original comment or credit authors.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
/**
- * tdmcreate module
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: tables.php 11084 2013-02-23 15:44:20Z timgno $
- */
-include_once 'header.php';
-$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
-$table_id = TDMCreate_CleanVars( $_REQUEST, 'table_id', 0 );
-echo $adminMenu->addNavigation('tables.php');
-switch ($op) {
- case 'save_table':
- if (isset($_REQUEST['table_id'])) {
- $obj =& $tablesHandler->get($_REQUEST['table_id']);
- } else {
- $obj =& $tablesHandler->create();
- }
+* tdmcreate module
+*
+* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+* @license GNU GPL 2 (http://www.gnu.org/lice...
[truncated message content] |
|
From: <txm...@us...> - 2014-03-14 08:46:58
|
Revision: 12375
http://sourceforge.net/p/xoops/svn/12375
Author: txmodxoops
Date: 2014-03-14 08:46:54 +0000 (Fri, 14 Mar 2014)
Log Message:
-----------
Moved all html code in templates files
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_about.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_header.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_help.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-03-14 08:06:01 UTC (rev 12374)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-03-14 08:46:54 UTC (rev 12375)
@@ -19,6 +19,7 @@
* @version $Id: about.php 11084 2013-02-23 15:44:20Z timgno $
*/
include 'header.php';
-echo $adminMenu->addNavigation('about.php');
-echo $adminMenu->renderabout('6KJ7RW5DR3VTJ', false);
+$xoopsOption['template_main'] = 'tdmcreate_about.html';
+$xoopsTpl->assign('navigation', $adminMenu->addNavigation('about.php'));
+$xoopsTpl->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false));
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-14 08:06:01 UTC (rev 12374)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-14 08:46:54 UTC (rev 12375)
@@ -50,22 +50,20 @@
$nb_tables = $tablesHandler->getCount($criteria);
$tables_arr = $tablesHandler->getAll($criteria);
-
-echo $adminMenu->addNavigation('building.php');
+$xoopsOption['template_main'] = 'tdmcreate_building.html';
+$xoopsTpl->assign('navigation', $adminMenu->addNavigation('building.php'));
switch ($op) {
case 'build':
// Effacer repertoire of nouveau module s'il existe
TDMCreate_clearDir($modPath.'/modules/'.strtolower($mod_name));
// Debut
- TDMCreate_OpenTable(_AM_TDMCREATE_BUILDING_FILES, _AM_TDMCREATE_BUILDING_SUCCESS, _AM_TDMCREATE_BUILDING_FAILED);
+ $xoopsTpl->assign('open_table', TDMCreate_OpenTable(_AM_TDMCREATE_BUILDING_FILES, _AM_TDMCREATE_BUILDING_SUCCESS, _AM_TDMCREATE_BUILDING_FAILED));
/************************************************/
/*Structure*/
/************************************************/
//Creation of the structure of folders and files
-
- echo 'Under new construction';
-
- TDMCreate_CloseTable();
+ $xoopsTpl->assign('build_list', 'Under new construction - Temporary build');
+ $xoopsTpl->assign('close_table', TDMCreate_CloseTable());
break;
case 'default':
@@ -81,7 +79,7 @@
$form->addElement(new XoopsFormHidden('op', 'build'));
$form->addElement(new XoopsFormButton(_REQUIRED.' <span class="red bold">*</span>', 'submit', _SUBMIT, 'submit'));
- $form->display();
+ $xoopsTpl->assign('form', $form->display());
break;
}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php 2014-03-14 08:06:01 UTC (rev 12374)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php 2014-03-14 08:46:54 UTC (rev 12375)
@@ -18,10 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: footer.php 12207 2013-10-23 02:46:52Z beckmi $
*/
-echo "<div align='center'><a href='http://www.xoops.org' title='Visit XOOPS' target='_blank'>
- <img src='".$pathIcon32."/xoopsmicrobutton.gif' alt='XOOPS' /></a></div>";
-echo "<div class='center smallsmall italic pad5'>
- <strong>" . $xoopsModule->getVar('name') . "</strong> is maintained by the
- <a href='http://xoops.org/forums/newbb' title='Visit Support Forum' class='tooltip' rel='external'>Support Forum</a></div>";
+
+$xoopsTpl->assign('module_name', $xoopsModule->getVar('name'));
xoops_cp_footer();
?>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-03-14 08:06:01 UTC (rev 12374)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-03-14 08:46:54 UTC (rev 12375)
@@ -19,14 +19,16 @@
* @version $Id: index.php 11084 2013-02-23 15:44:20Z timgno $
*/
include 'header.php';
- $criteria = new CriteriaCompo();
- $count_modules = $modulesHandler->getCount($criteria);
- $count_tables = $tablesHandler->getCount($criteria);
+$criteria = new CriteriaCompo();
+$count_modules = $modulesHandler->getCount($criteria);
+$count_tables = $tablesHandler->getCount($criteria);
+unset($criteria);
+
$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ;
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMMODULES. '</label>', $count_modules, 'Green') ;
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMTABLES. '</label>', $count_tables, 'Orange');
-
- echo $adminMenu->addNavigation('index.php');
- echo $adminMenu->renderIndex();
+$xoopsOption['template_main'] = 'tdmcreate_index.html';
+$xoopsTpl->assign('navigation', $adminMenu->addNavigation('index.php'));
+$xoopsTpl->assign('index', $adminMenu->renderIndex());
include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_about.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_about.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_about.html 2014-03-14 08:46:54 UTC (rev 12375)
@@ -0,0 +1,4 @@
+<!-- Header -->
+<{includeq file="db:tdmcreate_header.html"}>
+<!-- About Page -->
+<div class="top"><{$about}></div>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html 2014-03-14 08:46:54 UTC (rev 12375)
@@ -0,0 +1,9 @@
+<!-- Header -->
+<{includeq file="db:tdmcreate_header.html"}>
+<!-- Display building form -->
+<br />
+<{if $form}>
+ <{$form}>
+<{else}>
+ <{$build_list}>
+<{/if}>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html 2014-03-14 08:46:54 UTC (rev 12375)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html 2014-03-14 08:46:54 UTC (rev 12375)
@@ -0,0 +1,5 @@
+<div class='center'><a href='http://www.xoops.org' title='Visit XOOPS' target='_blank'>
+ <img src="<{$xoModuleIcons32 xoopsmicrobutton.gif}>" alt='XOOPS' /></a></div>
+<div class='center smallsmall italic pad5'>
+ <strong><{$module_name}></strong> is maintained by the
+ <a href='http://xoops.org/forums/newbb' title='Visit Support Forum' class='tooltip' rel='external'>Support Forum</a></div>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_header.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_header.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_header.html 2014-03-14 08:46:54 UTC (rev 12375)
@@ -0,0 +1,4 @@
+<div class="top">
+<span class="left"><{$navigation}></span>
+<{if $button_new}><span class="right"><{$button_new}> </span><{/if}><{if $button_list}><span class="right"> <{$button_list}></span><{/if}>
+</div>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_help.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_help.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_help.html 2014-03-14 08:46:54 UTC (rev 12375)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_index.html 2014-03-14 08:46:54 UTC (rev 12375)
@@ -0,0 +1,4 @@
+<!-- Header -->
+<{includeq file="db:tdmcreate_header.html"}>
+<!-- Index Page -->
+<div class="top"><{$index}></div>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html 2014-03-14 08:46:54 UTC (rev 12375)
@@ -0,0 +1,60 @@
+<!-- Header -->
+<{includeq file="db:tdmcreate_header.html"}>
+<!-- Display modules list -->
+<{if $modules_list}>
+ <table width='100%' cellspacing='1' class='outer'>
+ <tr>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ID}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NAME}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_VERSION}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_RELEASE}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_STATUS}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ADMIN_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_USER_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_SUBMENU_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_SEARCH_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_COMMENTS_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NOTIFICATIONS_LIST}></th>
+ <th class='center width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th>
+ </tr>
+ <{foreach item=module from=$modules_list}>
+ <tr class="<{cycle values='odd,even'}>">
+ <td class='center'><{$module.mod_id}></td>
+ <td class='center'><{$module.mod_name}></td>
+ <td class='center'><{$module.mod_version}></td>
+ <td class='center'><img src="<{$tdmc_upload_url}>/images/modules/<{$module.mod_image}>" height="32" /></td>
+ <td class='center'><{$module.mod_release}></td>
+ <td class='center'><{$module.mod_status}></td>
+ <td class='center'><{$module.mod_admin}></td>
+ <td class='center'><{$module.mod_user}></td>
+ <td class='center'><{$module.mod_submenu}></td>
+ <td class='center'><{$module.mod_search}></td>
+ <td class='center'><{$module.mod_comments}></td>
+ <td class='center'><{$module.mod_notifications}></td>
+
+ <td class='xo-actions txtcenter width5'>
+ <a href="modules.php?op=edit&mod_id=<{$module.mod_id}>" title="<{$smarty.const._EDIT}>">
+ <img src="<{xoAdminIcons edit.png}>" alt="<{$smarty.const._EDIT}>" height="16" />
+ </a>
+ <a href="modules.php?op=delete&mod_id=<{$module.mod_id}>" title="<{$smarty.const._DELETE}>">
+ <img src="<{xoAdminIcons delete.png}>" alt="<{$smarty.const._DELETE}>" height="16" />
+ </a>
+ </td>
+ </tr>
+ <{/foreach}>
+ </table><br /><br />
+<!-- Display modules navigation -->
+<div class="clear"> </div>
+<{if $pagenav}><div class="xo-pagenav floatright"><{$pagenav}></div><div class="clear spacer"></div><{/if}>
+<{/if}>
+<{if $error}>
+<div class="errorMsg">
+ <strong><{$error}></strong>
+</div>
+<{/if}>
+<!-- Display module form (add,edit) -->
+<{if $form}>
+<div class="spacer"><{$form}></div>
+<{/if}>
+<!-- Display module images on edit page -->
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html 2014-03-14 08:46:54 UTC (rev 12375)
@@ -0,0 +1,84 @@
+<!-- Header -->
+<{includeq file="db:tdmcreate_header.html"}>
+<!-- Display modules list -->
+<{if $modules_list}>
+ <table width='100%' cellspacing='1' class='outer'>
+ <tr>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ID}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NAME}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NBFIELDS}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_BLOCKS}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ADMIN_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_USER_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_SUBMENU_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_SEARCH_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_COMMENTS_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NOTIFICATIONS_LIST}></th>
+ <th class='center width6'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th>
+ </tr>
+ <{foreach item=module from=$modules_list}>
+ <tr class="head toggleTables">
+ <td class='center'><{$module.id}><br /><img src="<{$tdmc_url}>/images/icons/16/toggle.png" alt="Toggle" title="Toggle" /></td>
+ <td class='center'><{$module.name}></td>
+ <td class='center'><img src="<{$tdmc_upload_url}>/images/modules/<{$module.image}>" height="32" /></td>
+ <td class='center'><img src="<{$tdmc_url}>/images/icons/16/nb_fields.png" height="16" /></td>
+ <td class='center'><img src="<{$tdmc_url}>/images/icons/16/blocks.png" height="16" /></td>
+ <td class='center'><{$module.admin}></td>
+ <td class='center'><{$module.user}></td>
+ <td class='center'><{$module.submenu}></td>
+ <td class='center'><{$module.search}></td>
+ <td class='center'><{$module.comments}></td>
+ <td class='center'><{$module.notifications}></td>
+
+ <td class='xo-actions txtcenter width6'>
+ <a href="modules.php?op=edit&mod_id=<{$module.id}>" title="<{$smarty.const._EDIT}>">
+ <img src="<{xoAdminIcons edit.png}>" alt="<{$smarty.const._EDIT}>" height="16" />
+ </a>
+ <a href="modules.php?op=delete&mod_id=<{$module.id}>" title="<{$smarty.const._DELETE}>">
+ <img src="<{xoAdminIcons delete.png}>" alt="<{$smarty.const._DELETE}>" height="16" />
+ </a>
+ </td>
+ </tr>
+ <{foreach item=table from=$module.tables}>
+ <tr class="<{cycle values='even,odd'}> toggleHidden">
+ <td class='center'><{$table.id}></td>
+ <td class='center'><{$table.name}></td>
+ <td class='center'><img src="<{$pathIcon32}>/<{$table.image}>" alt="<{$table.name}>" height="32" /></td>
+ <td class='center'><{$table.nbfields}></td>
+ <td class='center'><{$table.blocks}></td>
+ <td class='center'><{$table.admin}></td>
+ <td class='center'><{$table.user}></td>
+ <td class='center'><{$table.submenu}></td>
+ <td class='center'><{$table.search}></td>
+ <td class='center'><{$table.comments}></td>
+ <td class='center'><{$table.notifications}></td>
+ <td class='xo-actions txtcenter width5'>
+ <a href="tables.php?op=edit&table_id=<{$table.id}>" title="<{$smarty.const._EDIT}>">
+ <img src="<{xoAdminIcons edit.png}>" alt="<{$smarty.const._EDIT}>" height="16" />
+ </a>
+ <a href="fields.php?op=edit&field_tid=<{$table.id}>" title="<{$smarty.const._EDIT}>">
+ <img src="<{$tdmc_url}>/images/icons/16/editfields.png" alt="<{$smarty.const._EDIT}>" height="16" />
+ </a>
+ <a href="tables.php?op=delete&table_id=<{$table.id}>" title="<{$smarty.const._DELETE}>">
+ <img src="<{xoAdminIcons delete.png}>" alt="<{$smarty.const._DELETE}>" height="16" />
+ </a>
+ </td>
+ </tr>
+ <{/foreach}>
+ <{/foreach}>
+ </table><br /><br />
+<!-- Display modules navigation -->
+<div class="clear"> </div>
+<{if $pagenav}><div class="xo-pagenav floatright"><{$pagenav}></div><div class="clear spacer"></div><{/if}>
+<{/if}>
+<{if $error}>
+<div class="errorMsg">
+ <strong><{$error}></strong>
+</div>
+<{/if}>
+<!-- Display module form (add,edit) -->
+<{if $form}>
+<div class="spacer"><{$form}></div>
+<{/if}>
+<!-- Display module images on edit page -->
|
|
From: <txm...@us...> - 2014-03-14 09:32:56
|
Revision: 12376
http://sourceforge.net/p/xoops/svn/12376
Author: txmodxoops
Date: 2014-03-14 09:32:52 +0000 (Fri, 14 Mar 2014)
Log Message:
-----------
Updated
Removed unnecessary code
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-14 08:46:54 UTC (rev 12375)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-14 09:32:52 UTC (rev 12376)
@@ -57,13 +57,11 @@
// Effacer repertoire of nouveau module s'il existe
TDMCreate_clearDir($modPath.'/modules/'.strtolower($mod_name));
// Debut
- $xoopsTpl->assign('open_table', TDMCreate_OpenTable(_AM_TDMCREATE_BUILDING_FILES, _AM_TDMCREATE_BUILDING_SUCCESS, _AM_TDMCREATE_BUILDING_FAILED));
/************************************************/
/*Structure*/
/************************************************/
//Creation of the structure of folders and files
$xoopsTpl->assign('build_list', 'Under new construction - Temporary build');
- $xoopsTpl->assign('close_table', TDMCreate_CloseTable());
break;
case 'default':
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php 2014-03-14 08:46:54 UTC (rev 12375)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php 2014-03-14 09:32:52 UTC (rev 12376)
@@ -55,13 +55,4 @@
$r=@rmdir($folder);
if (!$r) return false;
return true;
-}
-
-function TDMCreate_OpenTable($file, $_ok, $_notok) {
- echo '<table class="outer"><tr><th width="70%">'.$file.'</th><th width="15%">'.$_ok.'</th><th width="15%">'.$_notok.'</th></tr>';
-}
-
-function TDMCreate_CloseTable() {
- echo '</table><br />';
-}
-?>
\ No newline at end of file
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html 2014-03-14 08:46:54 UTC (rev 12375)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html 2014-03-14 09:32:52 UTC (rev 12376)
@@ -2,8 +2,33 @@
<{includeq file="db:tdmcreate_header.html"}>
<!-- Display building form -->
<br />
-<{if $form}>
- <{$form}>
+<{if $build_list}>
+ <table class="outer">
+ <thead>
+ <tr class="head">
+ <th width="70%"><{$smarty.const._AM_TDMCREATE_BUILDING_FILES}></th>
+ <th width="15%"><{$smarty.const._AM_TDMCREATE_BUILDING_SUCCESS}></th>
+ <th width="15%"><{$smarty.const._AM_TDMCREATE_BUILDING_FAILED}></th>
+ </tr>
+ </thead>
+ <tbody>
+ <!-- <{foreach item=list from=$build_list}> -->
+ <tr class="<{cycle values='odd, even'}>">
+ <td class="center" colspan="3"><{$build_list}></td>
+ <!-- <td style="padding-left: 30px;"><{$list.file}></td>
+ <{if $list.on}>
+ <td class="center"><img src="<{xoModuleIcons16 on.png}>" alt="" /></td>
+ <td> </td>
+ <{elseif $list.off}>
+ <td> </td>
+ <td class="center"><img src="<{xoModuleIcons16 off.png}>" alt="" /></td>
+ <{/if}> -->
+ <tr>
+ <!-- <{/foreach}> -->
+ </tbody>
+ </table><br />
<{else}>
- <{$build_list}>
+ <{if $form}>
+ <{$form}>
+ <{/if}>
<{/if}>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html 2014-03-14 08:46:54 UTC (rev 12375)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html 2014-03-14 09:32:52 UTC (rev 12376)
@@ -1,5 +1,5 @@
<div class='center'><a href='http://www.xoops.org' title='Visit XOOPS' target='_blank'>
- <img src="<{$xoModuleIcons32 xoopsmicrobutton.gif}>" alt='XOOPS' /></a></div>
+ <img src="<{xoModuleIcons32 xoopsmicrobutton.gif}>" alt='XOOPS' /></a></div>
<div class='center smallsmall italic pad5'>
<strong><{$module_name}></strong> is maintained by the
<a href='http://xoops.org/forums/newbb' title='Visit Support Forum' class='tooltip' rel='external'>Support Forum</a></div>
\ No newline at end of file
|
|
From: <txm...@us...> - 2014-03-16 12:58:20
|
Revision: 12381
http://sourceforge.net/p/xoops/svn/12381
Author: txmodxoops
Date: 2014-03-16 12:58:17 +0000 (Sun, 16 Mar 2014)
Log Message:
-----------
Updated
If you test this, is needed a new installation
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions_const.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -19,7 +19,10 @@
* @version $Id: about.php 11084 2013-02-23 15:44:20Z timgno $
*/
include 'header.php';
-$xoopsOption['template_main'] = 'tdmcreate_about.html';
+$template_main = 'tdmcreate_about.html';
$xoopsTpl->assign('navigation', $adminMenu->addNavigation('about.php'));
$xoopsTpl->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false));
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -27,57 +27,37 @@
$modules =& $modulesHandler;
}
-$mod_name = strtolower($modules->getVar('mod_name'));
-$mod_author_website_name = $modules->getVar('mod_author_website_name');
-$mod_author_website_url = $modules->getVar('mod_author_website_url');
-$mod_user = $modules->getVar('mod_user');
-$mod_notifications = $modules->getVar('mod_notifications');
-$mod_permissions = $modules->getVar('mod_permissions');
-
-if (isset($_REQUEST['table_name'])) {
- $tables =& $tablesHandler->get($_REQUEST['table_name']);
-} else {
- $tables =& $tablesHandler;
-}
-
-//Name of tables
-$criteria = new CriteriaCompo();
-if (isset($_REQUEST['mod_name'])) {
- $criteria->add(new Criteria('table_mid', $_REQUEST['mod_name']));
-} else {
- $criteria->add(new Criteria('table_mid'));
-}
-
-$nb_tables = $tablesHandler->getCount($criteria);
-$tables_arr = $tablesHandler->getAll($criteria);
-$xoopsOption['template_main'] = 'tdmcreate_building.html';
-$xoopsTpl->assign('navigation', $adminMenu->addNavigation('building.php'));
switch ($op) {
- case 'build':
- // Effacer repertoire of nouveau module s'il existe
- TDMCreate_clearDir($modPath.'/modules/'.strtolower($mod_name));
+ case 'build':
+ $template_main = 'tdmcreate_building.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
+ // Clear repertory of new module if there are
+ TDMCreate_clearDir(TDMC_PATH.'/modules/'.strtolower($modules->getVar('mod_name')));
// Debut
/************************************************/
/*Structure*/
- /************************************************/
- //Creation of the structure of folders and files
- $xoopsTpl->assign('build_list', 'Under new construction - Temporary build');
+ /************************************************/
+ include_once TDMC_PATH . '/class/files/architecture.php';
+ $handler = new TDMCreateArchitecture();
+ $handler->getPath( TDMC_PATH );
+ $handler->getArchitectureFiles( $modules );
+
+ // Creation of the structure of folders and files
+ $GLOBALS['xoopsTpl']->assign('build_list', 'Under new construction - Temporary build');
break;
case 'default':
- default:
- include_once(XOOPS_ROOT_PATH . '/class/xoopsformloader.php');
- $action = $_SERVER['REQUEST_URI'];
-
- $form = new XoopsThemeForm(_AM_TDMCREATE_ADMIN_CONST, 'buildform', $action, 'post', true);
-
- $mod_select = new XoopsFormSelect(_AM_TDMCREATE_CONST_MODULES, 'mod_name', 'mod_name');
- $mod_select->addOptionArray($modulesHandler->getList());
- $form->addElement($mod_select, true);
-
- $form->addElement(new XoopsFormHidden('op', 'build'));
- $form->addElement(new XoopsFormButton(_REQUIRED.' <span class="red bold">*</span>', 'submit', _SUBMIT, 'submit'));
- $xoopsTpl->assign('form', $form->display());
+ default:
+ $template_main = 'tdmcreate_building.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
+
+ include_once(TDMC_PATH . '/class/building.php');
+ $handler = TDMCreateBuilding::getInstance();
+ $form = $handler->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
}
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -0,0 +1,134 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.5
+ * @author Txmod Xoops <su...@tx...>
+ * @version $Id: 1.59 fields.php 11297 2013-03-24 10:58:10Z timgno $
+ */
+include 'header.php';
+// Recovered the value of the argument op in the URL $
+$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
+$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id', 0, 'int');
+// Get table Variables
+$table_id = TDMCreate_CleanVars($_REQUEST, 'field_tid', 0, 'int');
+$table_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid', 0, 'int');
+$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'field_numb', 0, 'int');
+$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');
+/*$table_id = $_SESSION['field_tid'];
+$table_mid = $_SESSION['field_mid'];
+$table_nbfields = $_SESSION['field_numb'];
+$table_fieldname = $_SESSION['field_name'];*/
+switch ($op)
+{
+ case 'list':
+ default:
+ $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
+ $start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
+ // Define main template
+ $xoopsOption['template_main'] = 'tdmcreate_fields.html';
+ xoops_cp_header();
+ $xoopsTpl->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
+ $xoopsTpl->assign('button_new', $adminMenu->renderButton());
+ $xoopsTpl->assign('tdmc_url', TDMC_URL);
+ $xoopsTpl->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
+ $xoopsTpl->assign('pathIcon32', XOOPS_URL.'/Frameworks/moduleclasses/icons/32');
+ // Get the list of tables
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('table_mid', $_REQUEST['mod_id']));
+ $criteria->setSort('table_id ASC, table_name');
+ $criteria->setOrder('ASC');
+ $nb_tables = $tablesHandler->getCount();
+ $tables_arr = $tablesHandler->getAll($criteria);
+ unset($criteria);
+ if ($nb_tables > 0)
+ {
+ $_yes = "<img src='../images/icons/16/green.png' alt='"._YES."' title='"._YES."' />";
+ $_no = "<img src='../images/icons/16/red.png' alt='"._NO."' title='"._NO."' />";
+ foreach (array_keys($tables_arr) as $t)
+ {
+ $table['id'] = $t;
+ $table['mid'] = $tables_arr[$t]->getVar('table_mid');
+ $table['name'] = $tables_arr[$t]->getVar('table_name');
+ $table['image'] = $tables_arr[$t]->getVar('table_image');
+ $table['nbfields'] = $tables_arr[$t]->getVar('table_nbfields');
+ $table['blocks'] = ( $tables_arr[$t]->getVar('table_blocks') == 1 ) ? $_yes : $_no;
+ $table['admin'] = ( $tables_arr[$t]->getVar('table_admin') == 1 ) ? $_yes : $_no;
+ $table['user'] = ( $tables_arr[$t]->getVar('table_user') == 1 ) ? $_yes : $_no;
+ $table['submenu'] = ( $tables_arr[$t]->getVar('table_submenu') == 1 ) ? $_yes : $_no;
+ $table['search'] = ( $tables_arr[$t]->getVar('table_search') == 1 ) ? $_yes : $_no;
+ $table['comments'] = ( $tables_arr[$t]->getVar('table_comments') == 1 ) ? $_yes : $_no;
+ $table['notifications'] = ( $tables_arr[$t]->getVar('table_notifications') == 1 ) ? $_yes : $_no;
+ $xoopsTpl->append('tables_list', $table);
+ unset($mod);
+ }
+ if ( $nb_tables > $limit ) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav = new XoopsPageNav($nb_tables, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $xoopsTpl->assign('pagenav', $pagenav->renderNav(4));
+ }
+ } else {
+ $xoopsTpl->assign('error', 'Add, Edit or List View in Tables');
+ }
+ break;
+
+ case 'new':
+ xoops_cp_header();
+ echo $adminMenu->addNavigation('fields.php');
+ $obj =& $fieldsHandler->create();
+ $form = $obj->getForm($table_id, $table_mid, $table_nbfields, $table_fieldname);
+ $form->display();
+ break;
+
+ case 'save':
+ if ( !$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ if (isset($field_id)) {
+ $obj =& $fieldsHandler->get($field_id);
+ } else {
+ $obj =& $fieldsHandler->create();
+ }
+ //Form fields
+ $obj->setVars(array('field_mid' => $table_mid, 'field_tid' => $table_id, 'field_name' => $_POST['field_name'],
+ 'field_numb' => $table_nbfields, 'field_type' => $_POST['field_type'],
+ 'field_value' => $_POST['field_value'], 'field_attribute' => $_POST['field_attribute'],
+ 'field_null' => $_POST['field_null'], 'field_default' => $_POST['field_default'],
+ 'field_key' => $_POST['field_key'], 'field_elements' => $_POST['field_elements'],
+ 'field_admin' => (($_REQUEST['field_admin'] == 1) ? '1' : '0'),
+ 'field_user' => (($_REQUEST['field_user'] == 1) ? '1' : '0'),
+ 'field_blocks' => (($_REQUEST['field_blocks'] == 1) ? '1' : '0'),
+ 'field_mainfield' => (($_REQUEST['field_mainfield'] == 1) ? '1' : '0'),
+ 'field_search' => (($_REQUEST['field_search'] == 1) ? '1' : '0'),
+ 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0')));
+
+ if ($fieldsHandler->insert($obj)) {
+ redirect_header('tables.php', 2, _AM_TDMCREATE_FORMOK);
+ }
+ echo $obj->getHtmlErrors();
+ $form = $obj->getForm();
+ $form->display();
+ break;
+
+ case 'edit':
+ xoops_cp_header();
+ echo $adminMenu->addNavigation('fields.php');
+ $obj = $fieldsHandler->get($field_id);
+ $form = $obj->getForm($table_id, $table_mid, $table_nbfields, $table_fieldname);
+ $form->display();
+ break;
+}
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -19,8 +19,9 @@
* @version $Id: header.php 12207 2013-10-23 02:46:52Z beckmi $
*/
include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
+include_once('../include/common.php');
include_once('../include/functions.php');
-include_once 'includes.php';
+//include_once 'includes.php';
//
$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
//
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -28,7 +28,11 @@
$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ;
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMMODULES. '</label>', $count_modules, 'Green') ;
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMTABLES. '</label>', $count_tables, 'Orange');
-$xoopsOption['template_main'] = 'tdmcreate_index.html';
-$xoopsTpl->assign('navigation', $adminMenu->addNavigation('index.php'));
-$xoopsTpl->assign('index', $adminMenu->renderIndex());
+//$xoopsOption['template_main'] = 'tdmcreate_index.html';
+$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('index.php'));
+$GLOBALS['xoopsTpl']->assign('index', $adminMenu->renderIndex());
+$template_main = 'tdmcreate_index.html';
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -26,15 +26,14 @@
{
case 'list':
default:
- $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
+ $limit = $GLOBALS['xoopsModuleConfig']['mod_adminpager'];
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
- $xoopsOption['template_main'] = 'tdmcreate_modules.html';
- xoops_cp_header();
- $xoopsTpl->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $template_main = 'tdmcreate_modules.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
- $xoopsTpl->assign('button_new', $adminMenu->renderButton());
- $xoopsTpl->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
+ $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
$criteria->setOrder('ASC');
@@ -60,30 +59,29 @@
$mod['mod_search'] = ( $mods_arr[$i]->getVar('mod_search') == 1 ) ? $yes : $no;
$mod['mod_comments'] = ( $mods_arr[$i]->getVar('mod_comments') == 1 ) ? $yes : $no;
$mod['mod_notifications'] = ( $mods_arr[$i]->getVar('mod_notifications') == 1 ) ? $yes : $no;
- $xoopsTpl->append('modules_list', $mod);
+ $GLOBALS['xoopsTpl']->append('modules_list', $mod);
unset($mod);
}
if ( $numrows > $limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list&limit=' . $limit);
- $xoopsTpl->assign('pagenav', $pagenav->renderNav(4));
+ $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
- $xoopsTpl->assign('error', 'There aren\'t modules');
+ $GLOBALS['xoopsTpl']->assign('error', 'There aren\'t modules');
}
break;
case 'new':
// Define main template
- $xoopsOption['template_main'] = 'tdmcreate_modules.html';
- xoops_cp_header();
- $xoopsTpl->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $template_main = 'tdmcreate_modules.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
- $xoopsTpl->assign('button_list', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('button_list', $adminMenu->renderButton());
$obj =& $modulesHandler->create();
$form = $obj->getForm();
- $xoopsTpl->assign('form', $form->render());
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'save':
@@ -144,24 +142,23 @@
redirect_header('modules.php', 2, _AM_TDMCREATE_FORMOK);
}
- $xoopsTpl->assign('error', $obj->getHtmlErrors());
+ $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
$form =& $obj->getForm();
- $xoopsTpl->assign('form', $form->render());
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'edit':
// Define main template
- $xoopsOption['template_main'] = 'tdmcreate_modules.html';
- xoops_cp_header();
- $xoopsTpl->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $template_main = 'tdmcreate_modules.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
- $xoopsTpl->assign('button_new', $adminMenu->renderButton());
- $xoopsTpl->assign('button_list', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('button_list', $adminMenu->renderButton());
$obj = $modulesHandler->get($_REQUEST['mod_id']);
$form = $obj->getForm();
- $xoopsTpl->assign('form', $form->render());
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'delete':
@@ -173,11 +170,14 @@
if ($modulesHandler->delete($obj)) {
redirect_header('modules.php', 3, _AM_TDMCREATE_FORMDELOK);
} else {
- $xoopsTpl->assign('error', $obj->getHtmlErrors());
+ $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
}
} else {
xoops_confirm(array('ok' => 1, 'mod_id' => $_REQUEST['mod_id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('mod_name')));
}
break;
}
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -29,26 +29,25 @@
$limit = xoops_getModuleOption('adminperpage');
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
- $xoopsOption['template_main'] = 'tdmcreate_tables.html';
- xoops_cp_header();
+ $template_main = 'tdmcreate_tables.html';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/style.css' );
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
- $xoopsTpl->assign('navigation', $adminMenu->addNavigation('tables.php'));
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
- $xoopsTpl->assign('button_new', $adminMenu->renderButton());
- $xoopsTpl->assign('tdmc_url', TDMC_URL);
- $xoopsTpl->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
- $xoopsTpl->assign('pathIcon32', XOOPS_URL.'/Frameworks/moduleclasses/icons/32');
+ $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
+ $GLOBALS['xoopsTpl']->assign('pathIcon32', XOOPS_URL.'/Frameworks/moduleclasses/icons/32');
// Get the list of modules
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
$criteria->setOrder('ASC');
$numrows_modules = $modulesHandler->getCount();
// Redirect if there aren't modules
- if ( $numrows_modules == 0 ) {
+ /*if ( $numrows_modules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
- }
+ } */
$mods_arr = $modulesHandler->getAll($criteria);
unset($criteria);
// Display modules list
@@ -99,30 +98,29 @@
}
}
$mod['tables'] = $tables;
- $xoopsTpl->append('modules_list', $mod);
+ $GLOBALS['xoopsTpl']->append('modules_list', $mod);
unset($mod);
}
if ( $numrows_modules > $limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$pagenav = new XoopsPageNav($numrows_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
- $xoopsTpl->assign('pagenav', $pagenav->renderNav(4));
+ $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
- $xoopsTpl->assign('error', 'There aren\'t modules');
+ $GLOBALS['xoopsTpl']->assign('error', 'There aren\'t modules');
}
break;
case 'new':
// Define main template
- $xoopsOption['template_main'] = 'tdmcreate_tables.html';
- xoops_cp_header();
- $xoopsTpl->assign('navigation', $adminMenu->addNavigation('tables.php'));
+ $template_main = 'tdmcreate_tables.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
- $xoopsTpl->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
$obj =& $tablesHandler->create();
- $form = $obj->getForm();
- $xoopsTpl->assign('form', $form->render());
+ $form = $obj->getFormTable();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'save':
@@ -186,22 +184,21 @@
}
}
- $xoopsTpl->assign('error', $obj->getHtmlErrors());
+ $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
$form = $obj->getForm();
- $xoopsTpl->assign('form', $form->render());
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'edit':
// Define main template
- $xoopsOption['template_main'] = 'tdmcreate_tables.html';
- xoops_cp_header();
- $xoopsTpl->assign('navigation', $adminMenu->addNavigation('tables.php'));
+ $template_main = 'tdmcreate_tables.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
- $xoopsTpl->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
$obj = $tablesHandler->get($_REQUEST['table_id']);
$form = $obj->getForm();
- $xoopsTpl->assign('form', $form->render());
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'delete':
@@ -220,4 +217,7 @@
}
break;
}
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -217,6 +217,6 @@
{
function __construct(&$db)
{
- parent::__construct($db, "tdmcreate_fields", "tdmcreatefields", "field_id", "field_table");
+ parent::__construct($db, "mod_tdmcreate_fields", "tdmcreatefields", "field_id", "field_table");
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -21,90 +21,112 @@
if (!defined('XOOPS_ROOT_PATH')) {
die('XOOPS root path not defined');
}
-
-class Architecture extends Structure
+require_once 'structure.php';
+class TDMCreateArchitecture
{
/*
+ * @var mixed
+ */
+ public $structure = null;
+ /*
* @public function constructor class
+ * @param null
+ */
+ public function __construct() {
+ $this->structure = TDMCreateStructure::getInstance();
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function getPath
* @param string $path
*/
- public function __construct($path) {
+ public function getPath($path) {
$this->path = $path;
- }
+ }
/*
- * @public function isDir
- * @param string $dname
+ * @public function getArchitectureFiles
+ * @param string $module
*/
- public function ArchitectureFiles( $module, $pathName )
- {
- $indexFile = $pathName.'/index.html';
- $this->path = XOOPS_ROOT_PATH.'/modules/TDMCreate';
+ public function getArchitectureFiles( $module )
+ {
+ $indexFile = $this->path.'/index.html';
$fdocs = $this->path.'/docs';
$fimages = $this->path.'/images';
//Creation of the Directory of modules
- $targetDirectory = $pathName.'/modules/'.strtolower($module->getVar('mod_name'));
+ $targetDirectory = $this->path.'/modules/'.strtolower($module->getVar('mod_name'));
- // Making of a new object
- $classStruct = Structure::Structure($targetDirectory);
// Creation of "module" folder
- $classStruct->makeDir($targetDirectory);
+ $this->structure->getPath($targetDirectory);
+ // Creation of "module" folder
+ $this->structure->makeDir($targetDirectory);
// Creation of "admin" folder and index.html file
- $classStruct->makeDirAndCopyFile('admin/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('admin/', $indexFile, 'index.html');
// Creation of "blocks" folder and index.html file
- $classStruct->makeDirAndCopyFile('blocks/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('blocks/', $indexFile, 'index.html');
// Creation of "class" folder and index.html file
- $classStruct->makeDirAndCopyFile('class/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('class/', $indexFile, 'index.html');
// Creation of "css" folder and index.html file
- $classStruct->makeDirAndCopyFile('css/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('css/', $indexFile, 'index.html');
// Creation of "images" folder and index.html file
- $classStruct->makeDirAndCopyFile('images/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('images/', $indexFile, 'index.html');
//Copy the logo of the module
$mod_image = str_replace(' ', '', strtolower($module->getVar('mod_image')));
- $classStruct->copyFile('images/', $fimages.'/uploads/modules/'.$mod_image, $mod_image);
+ $this->structure->copyFile('images/', $fimages.'/uploads/modules/'.$mod_image, $mod_image);
// Creation of 'images/icons' folder and index.html file - Added in Version 1.15
- $classStruct->makeDirAndCopyFile('images/icons/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('images/icons/', $indexFile, 'index.html');
// Creation of "images/icons/16" folder and index.html file
- $classStruct->makeDirAndCopyFile('images/icons/16/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('images/icons/16/', $indexFile, 'index.html');
// Creation of "images/icons/32" folder and index.html file
- $classStruct->makeDirAndCopyFile('images/icons/32/', $indexFile, 'index.html');
+...
[truncated message content] |
|
From: <txm...@us...> - 2014-03-17 00:21:22
|
Revision: 12387
http://sourceforge.net/p/xoops/svn/12387
Author: txmodxoops
Date: 2014-03-17 00:21:17 +0000 (Mon, 17 Mar 2014)
Log Message:
-----------
Updated
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/empty.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/logos/empty.png
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-16 19:46:29 UTC (rev 12386)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-17 00:21:17 UTC (rev 12387)
@@ -32,14 +32,14 @@
$template_main = 'tdmcreate_building.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
// Clear repertory of new module if there are
- TDMCreate_clearDir(TDMC_PATH.'/modules/'.strtolower($modules->getVar('mod_name')));
+ TDMCreate_clearDir(TDMC_UPLOAD_MODULE_PATH . '/' . strtolower($modules->getVar('mod_name')));
// Debut
/************************************************/
/*Structure*/
/************************************************/
include_once TDMC_PATH . '/class/files/architecture.php';
- $handler = new TDMCreateArchitecture();
- $handler->getPath( TDMC_PATH );
+ $handler = TDMCreateArchitecture::getInstance();
+ $handler->getUploadPath( TDMC_UPLOAD_MODULE_PATH );
$handler->getArchitectureFiles( $modules );
// Creation of the structure of folders and files
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-03-16 19:46:29 UTC (rev 12386)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-03-17 00:21:17 UTC (rev 12387)
@@ -29,6 +29,14 @@
*/
public $structure = null;
/*
+ * @var mixed
+ */
+ public $path = null;
+ /*
+ * @var mixed
+ */
+ public $upload_path = null;
+ /*
* @public function constructor class
* @param null
*/
@@ -54,79 +62,86 @@
public function getPath($path) {
$this->path = $path;
}
+ /*
+ * @public function getUploadPath
+ * @param string $path
+ */
+ public function getUploadPath($path) {
+ $this->upload_path = $path;
+ }
/*
* @public function getArchitectureFiles
* @param string $module
*/
public function getArchitectureFiles( $module )
{
- $indexFile = $this->path.'/index.html';
- $fdocs = $this->path.'/docs';
- $fimages = $this->path.'/images';
+ $indexFile = $this->upload_path.'/index.html';
+ $fdocs = $this->upload_path.'/docs';
+ $fimages = $this->upload_path.'/images';
//Creation of the Directory of modules
- $targetDirectory = $this->path.'/modules/'.strtolower($module->getVar('mod_name'));
+ $targetDirectory = $this->upload_path.'/'. str_replace(' ', '', strtolower($module->getVar('mod_name')));
// Creation of "module" folder
$this->structure->getPath($targetDirectory);
// Creation of "module" folder
$this->structure->makeDir($targetDirectory);
// Creation of "admin" folder and index.html file
- $this->structure->makeDirAndCopyFile('admin/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html');
// Creation of "blocks" folder and index.html file
- $this->structure->makeDirAndCopyFile('blocks/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
// Creation of "class" folder and index.html file
- $this->structure->makeDirAndCopyFile('class/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('class', $indexFile, 'index.html');
// Creation of "css" folder and index.html file
- $this->structure->makeDirAndCopyFile('css/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('css', $indexFile, 'index.html');
// Creation of "images" folder and index.html file
- $this->structure->makeDirAndCopyFile('images/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('images', $indexFile, 'index.html');
//Copy the logo of the module
$mod_image = str_replace(' ', '', strtolower($module->getVar('mod_image')));
- $this->structure->copyFile('images/', $fimages.'/uploads/modules/'.$mod_image, $mod_image);
+ $this->structure->copyFile('images', $fimages.'/modules/'.$mod_image, $mod_image);
// Creation of 'images/icons' folder and index.html file - Added in Version 1.15
- $this->structure->makeDirAndCopyFile('images/icons/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('images/icons', $indexFile, 'index.html');
// Creation of "images/icons/16" folder and index.html file
- $this->structure->makeDirAndCopyFile('images/icons/16/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('images/icons/16', $indexFile, 'index.html');
// Creation of "images/icons/32" folder and index.html file
- $this->structure->makeDirAndCopyFile('images/icons/32/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('images/icons/32', $indexFile, 'index.html');
// Creation of 'on.png' file
- $this->structure->copyFile('images/icons/16/', $fimages.'/icons/16/on.png', 'on.png');
+ $this->structure->copyFile('images/icons/16', $fimages.'/icons/16/on.png', 'on.png');
// Creation of 'off.png' file
- $this->structure->copyFile('images/icons/16/', $fimages.'/icons/16/off.png', 'off.png');
+ $this->structure->copyFile('images/icons/16', $fimages.'/icons/16/off.png', 'off.png');
// Creation of 'arrow.gif' file
- $this->structure->copyFile('images/icons/16/', $fimages.'/icons/16/arrow.gif', 'arrow.gif');
+ $this->structure->copyFile('images/icons/16', $fimages.'/icons/16/arrow.gif', 'arrow.gif');
// Creation of 'txmodxoops_logo.png' file
- $this->structure->copyFile('images/', $fimages.'/txmodxoops_logo.png', 'txmodxoops_logo.png');
+ $this->structure->copyFile('images', $fimages.'/txmodxoops_logo.png', 'txmodxoops_logo.png');
// Creation of 'docs' folder and index.html file
- $this->structure->makeDirAndCopyFile('docs/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('docs', $indexFile, 'index.html');
// Creation of 'credits.txt' file
- $this->structure->copyFile('docs/', $fdocs.'/credits.txt', 'credits.txt');
+ $this->structure->copyFile('docs', $fdocs.'/credits.txt', 'credits.txt');
// Creation of 'install.txt' file
- $this->structure->copyFile('docs/', $fdocs.'/install.txt', 'install.txt');
+ $this->structure->copyFile('docs', $fdocs.'/install.txt', 'install.txt');
// Creation of 'lang_diff.txt' file
- $this->structure->copyFile('docs/', $fdocs.'/lang_diff.txt', 'lang_diff.txt');
+ $this->structure->copyFile('docs', $fdocs.'/lang_diff.txt', 'lang_diff.txt');
// Creation of 'license.txt' file
- $this->structure->copyFile('docs/', $fdocs.'/license.txt', 'license.txt');
+ $this->structure->copyFile('docs', $fdocs.'/license.txt', 'license.txt');
// Creation of 'readme.txt' file
- $this->structure->copyFile('docs/', $fdocs.'/readme.txt', 'readme.txt');
+ $this->structure->copyFile('docs', $fdocs.'/readme.txt', 'readme.txt');
// Creation of "include" folder and index.html file
- $this->structure->makeDirAndCopyFile('include/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('include', $indexFile, 'index.html');
// Creation of "language" folder and index.html file
- $this->structure->makeDirAndCopyFile('language/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('language', $indexFile, 'index.html');
// Creation of "language/local_language" folder and index.html file
- $this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language']. '/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language'], $indexFile, 'index.html');
// Creation of "language/local_language/help" folder and index.html file
- $this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language']. '/help/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language']. '/help', $indexFile, 'index.html');
// Creation of "templates" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('templates', $indexFile, 'index.html');
// Creation of "templates/admin" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates/admin/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
// Creation of "templates/blocks" folder and index.html file
- $this->structure->makeDirAndCopyFile('templates/blocks/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
// Creation of "sql" folder and index.html file
- $this->structure->makeDirAndCopyFile('sql/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html');
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php 2014-03-16 19:46:29 UTC (rev 12386)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php 2014-03-17 00:21:17 UTC (rev 12387)
@@ -147,7 +147,7 @@
$this->from_file = $from_file;
$this->to_file = $to_file;
$dname = $this->folderPath($folder_name);
- $fname = $this->folderPath($folder_name) . $this->to_file;
+ $fname = $this->folderPath($folder_name) . DIRECTORY_SEPARATOR . $this->to_file;
$this->getCopy($dname, $fname);
}
/*
@@ -157,8 +157,8 @@
*/
public function getCopy($dname, $fname)
{
- if(is_dir($fname)) {
- chmod($fname, 0777);
+ if(is_dir($dname)) {
+ chmod($dname, 0777);
copy($this->from_file, $fname);
} else {
$this->makeDir($dname);
@@ -204,7 +204,7 @@
$this->setErrors("({$file}) is a folder or not exist");
continue;
}
- if (($ret = $file_nameHandler->delete()) == false) {
+ if (($ret = $fileHandler->delete()) == false) {
$this->setErrors("Cannot delete ({$file})");
continue;
}
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/empty.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/empty.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/empty.png 2014-03-16 19:46:29 UTC (rev 12386)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/empty.png 2014-03-17 00:21:17 UTC (rev 12387)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/empty.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/logos/empty.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/logos/empty.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/logos/empty.png 2014-03-16 19:46:29 UTC (rev 12386)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/logos/empty.png 2014-03-17 00:21:17 UTC (rev 12387)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/logos/empty.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-03-16 19:46:29 UTC (rev 12386)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-03-17 00:21:17 UTC (rev 12387)
@@ -22,9 +22,13 @@
die('XOOPS root path not defined');
}
$dirname = $GLOBALS['xoopsModule']->getVar('dirname');
-define('TDMC_PATH', XOOPS_ROOT_PATH."/modules/" . $dirname );
-define('TDMC_URL', XOOPS_URL."/modules/" . $dirname );
-define('TDMC_UPLOAD_PATH', XOOPS_UPLOAD_PATH . "/" . $dirname );
-define('TDMC_UPLOAD_URL', XOOPS_UPLOAD_URL . "/" . $dirname );
-define('TDM_CREATE_URL', XOOPS_ROOT_PATH . '/modules/TDMCreate');
+define('TDMC_PATH', XOOPS_ROOT_PATH . '/modules/' . $dirname );
+define('TDMC_URL', XOOPS_URL . '/modules/' . $dirname );
+define('TDMC_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $dirname );
+define('TDMC_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $dirname );
+define('TDMC_UPLOAD_MODULE_PATH', TDMC_UPLOAD_PATH . '/modules/' );
+define('TDMC_UPLOAD_MODULE_URL', TDMC_UPLOAD_URL . '/modules/' );
+define('TDMC_UPLOAD_TABLE_PATH', TDMC_UPLOAD_PATH . '/tables/' );
+define('TDMC_UPLOAD_TABLE_URL', TDMC_UPLOAD_URL . '/tables/' );
+define('TDM_CREATE_URL', XOOPS_ROOT_PATH . '/modules/' . $dirname );
define('TDM_CREATE_MURL', TDM_CREATE_URL . '/modules');
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php 2014-03-16 19:46:29 UTC (rev 12386)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php 2014-03-17 00:21:17 UTC (rev 12387)
@@ -1,22 +1,60 @@
<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
/**
- * ****************************************************************************
- * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS
- * - Licence GPL Copyright (c) (http://www.tdmxoops.net)
+ * tdmcreate module
*
- * Cette licence, contient des limitations!!!
- *
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material of the original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @license TDM GPL license
- * @author TDM TEAM DEV MODULE
- *
- * ****************************************************************************
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: functions.php 11084 2013-02-23 15:44:20Z timgno $
*/
-?>
\ No newline at end of file
+$indexFile = XOOPS_UPLOAD_PATH.'/index.html';
+$blankFile = XOOPS_UPLOAD_PATH.'/blank.gif';
+
+// Making of "uploads" folder
+$tdmcreate = XOOPS_UPLOAD_PATH.'/tdmcreate';
+if(!is_dir($tdmcreate))
+ mkdir($tdmcreate, 0777);
+ chmod($tdmcreate, 0777);
+copy($indexFile, $tdmcreate.'/index.html');
+
+// Making of images uploads folder
+$modules = $tdmcreate.'/modules';
+if(!is_dir($modules))
+ mkdir($modules, 0777);
+ chmod($modules, 0777);
+copy($indexFile, $modules.'/index.html');
+
+// Making of images uploads folder
+$images = $tdmcreate.'/images';
+if(!is_dir($images))
+ mkdir($images, 0777);
+ chmod($images, 0777);
+copy($indexFile, $images.'/index.html');
+
+// Making of "modules" images folder
+$modules = $images.'/modules';
+if(!is_dir($modules))
+ mkdir($modules, 0777);
+ chmod($modules, 0777);
+copy($indexFile, $modules.'/index.html');
+copy($blankFile, $modules.'/blank.gif');
+
+// Making of "tables" images folder
+$tables = $images.'/tables';
+if(!is_dir($tables))
+ mkdir($tables, 0777);
+ chmod($tables, 0777);
+copy($indexFile, $tables.'/index.html');
+copy($blankFile, $tables.'/blank.gif');
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html 2014-03-16 19:46:29 UTC (rev 12386)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html 2014-03-17 00:21:17 UTC (rev 12387)
@@ -12,6 +12,16 @@
</tr>
</thead>
<tbody>
+ <tr class="even">
+ <td style="padding-left: 30px;"><{$list.file}></td>
+ <{if $architecture_created}>
+ <td class="center"><img src="<{xoModuleIcons16 on.png}>" alt="" /></td>
+ <td> </td>
+ <{else}>
+ <td> </td>
+ <td class="center"><img src="<{xoModuleIcons16 off.png}>" alt="" /></td>
+ <{/if}>
+ <tr>
<!-- <{foreach item=list from=$build_list}> -->
<tr class="<{cycle values='odd, even'}>">
<td class="center" colspan="3"><{$build_list}></td>
|
|
From: <txm...@us...> - 2014-03-19 18:20:55
|
Revision: 12398
http://sourceforge.net/p/xoops/svn/12398
Author: txmodxoops
Date: 2014-03-19 18:20:48 +0000 (Wed, 19 Mar 2014)
Log Message:
-----------
Work in progress
Updated
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin.css
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/docs/changelog.txt
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldattributes.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldkey.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldnull.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldtype.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/themeform.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/xcvLogo.txt
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-03-19 17:46:49 UTC (rev 12397)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -20,8 +20,8 @@
*/
include 'header.php';
$template_main = 'tdmcreate_about.html';
-$xoopsTpl->assign('navigation', $adminMenu->addNavigation('about.php'));
-$xoopsTpl->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false));
+$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('about.php'));
+$GLOBALS['xoopsTpl']->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false));
if ( isset($template_main) ) {
$GLOBALS['xoopsTpl']->display("db:{$template_main}");
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-19 17:46:49 UTC (rev 12397)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -16,7 +16,7 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: building.php 11084 2013-02-23 15:44:20Z timgno $
+ * @version $Id: building.php 12258 2014-01-02 09:33:29Z timgno $
*/
include 'header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-03-19 17:46:49 UTC (rev 12397)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -14,19 +14,21 @@
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* @package tdmcreate
- * @since 2.5.5
- * @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 fields.php 11297 2013-03-24 10:58:10Z timgno $
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: fields.php 12258 2014-01-02 09:33:29Z timgno $
*/
include 'header.php';
// Recovered the value of the argument op in the URL $
$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
+$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id', 0, 'int');
+$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id', 0, 'int');
$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id', 0, 'int');
// Get table Variables
-$table_id = TDMCreate_CleanVars($_REQUEST, 'field_tid', 0, 'int');
-$table_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid', 0, 'int');
-$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'field_numb', 0, 'int');
-$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');
+$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid', 0, 'int');
+$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid', 0, 'int');
+$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb', 0, 'int');
+$field_name = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');
/*$table_id = $_SESSION['field_tid'];
$table_mid = $_SESSION['field_mid'];
$table_nbfields = $_SESSION['field_numb'];
@@ -35,17 +37,17 @@
{
case 'list':
default:
- $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
+ $limit = xoops_getModuleOption('mod_adminpager');
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
- $xoopsOption['template_main'] = 'tdmcreate_fields.html';
- xoops_cp_header();
- $xoopsTpl->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $template_main = 'tdmcreate_fields.html';
+
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
- $xoopsTpl->assign('button_new', $adminMenu->renderButton());
- $xoopsTpl->assign('tdmc_url', TDMC_URL);
- $xoopsTpl->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
- $xoopsTpl->assign('pathIcon32', XOOPS_URL.'/Frameworks/moduleclasses/icons/32');
+ $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
+ $GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
// Get the list of tables
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $_REQUEST['mod_id']));
@@ -72,22 +74,26 @@
$table['search'] = ( $tables_arr[$t]->getVar('table_search') == 1 ) ? $_yes : $_no;
$table['comments'] = ( $tables_arr[$t]->getVar('table_comments') == 1 ) ? $_yes : $_no;
$table['notifications'] = ( $tables_arr[$t]->getVar('table_notifications') == 1 ) ? $_yes : $_no;
- $xoopsTpl->append('tables_list', $table);
+ $GLOBALS['xoopsTpl']->append('tables_list', $table);
unset($mod);
}
if ( $nb_tables > $limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$pagenav = new XoopsPageNav($nb_tables, $limit, $start, 'start', 'op=list&limit=' . $limit);
- $xoopsTpl->assign('pagenav', $pagenav->renderNav(4));
+ $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
- $xoopsTpl->assign('error', 'Add, Edit or List View in Tables');
+ $GLOBALS['xoopsTpl']->assign('error', 'Add, Edit or List View in Tables');
}
break;
case 'new':
- xoops_cp_header();
- echo $adminMenu->addNavigation('fields.php');
+ // Define main template
+ $template_main = 'tdmcreate_tables.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+
$obj =& $fieldsHandler->create();
$form = $obj->getForm($table_id, $table_mid, $table_nbfields, $table_fieldname);
$form->display();
@@ -124,11 +130,18 @@
break;
case 'edit':
- xoops_cp_header();
- echo $adminMenu->addNavigation('fields.php');
+ // Define main template
+ $template_main = 'tdmcreate_tables.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+
$obj = $fieldsHandler->get($field_id);
$form = $obj->getForm($table_id, $table_mid, $table_nbfields, $table_fieldname);
$form->display();
break;
}
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-03-19 17:46:49 UTC (rev 12397)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -16,8 +16,8 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: header.php 12207 2013-10-23 02:46:52Z beckmi $
- */
+ * @version $Id: header.php 12258 2014-01-02 09:33:29Z timgno $
+*/
include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
include_once('../include/common.php');
include_once('../include/functions.php');
@@ -32,6 +32,12 @@
// Get class handler
$modulesHandler =& xoops_getModuleHandler('modules', $thisDirname);
$tablesHandler =& xoops_getModuleHandler('tables', $thisDirname);
+$fieldsHandler =& xoops_getModuleHandler('fields', $thisDirname);
+$fieldtypeHandler=& xoops_getModuleHandler('fieldtype', $thisDirname);
+$fieldattributesHandler=& xoops_getModuleHandler('fieldattributes', $thisDirname);
+$fieldnullHandler=& xoops_getModuleHandler('fieldnull', $thisDirname);
+$fieldkeyHandler=& xoops_getModuleHandler('fieldkey', $thisDirname);
+$fieldelementsHandler=& xoops_getModuleHandler('fieldelements', $thisDirname);
//
$myts =& MyTextSanitizer::getInstance();
if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php 2014-03-19 17:46:49 UTC (rev 12397)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -24,23 +24,27 @@
$pathIcon32 = $moduleInfo->getInfo('icons32');
$adminmenu = array();
$i = 1;
-$adminmenu[$i]["title"] = _MI_TDMCREATE_ADMIN_INDEX;
-$adminmenu[$i]["link"] = 'admin/index.php';
-$adminmenu[$i]["icon"] = $pathIcon32.'/home.png';
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU1;
+$adminmenu[$i]['link'] = 'admin/index.php';
+$adminmenu[$i]['icon'] = $pathIcon32.'/home.png';
$i++;
-$adminmenu[$i]["title"] = _MI_TDMCREATE_ADMIN_MODULES;
-$adminmenu[$i]["link"] = 'admin/modules.php';
-$adminmenu[$i]["icon"] = 'images/icons/32/addmodule.png';
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU2;
+$adminmenu[$i]['link'] = 'admin/modules.php';
+$adminmenu[$i]['icon'] = 'images/icons/32/addmodule.png';
$i++;
-$adminmenu[$i]["title"] = _MI_TDMCREATE_ADMIN_TABLES;
-$adminmenu[$i]["link"] = 'admin/tables.php';
-$adminmenu[$i]["icon"] = 'images/icons/32/addtable.png';
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU3;
+$adminmenu[$i]['link'] = 'admin/tables.php';
+$adminmenu[$i]['icon'] = 'images/icons/32/addtable.png';
$i++;
-$adminmenu[$i]["title"] = _MI_TDMCREATE_ADMIN_CONST;
-$adminmenu[$i]["link"] = 'admin/building.php';
-$adminmenu[$i]["icon"] = 'images/icons/32/builder.png';
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU4;
+$adminmenu[$i]['link'] = 'admin/fields.php';
+$adminmenu[$i]['icon'] = 'images/icons/32/fields.png';
$i++;
-$adminmenu[$i]["title"] = _MI_TDMCREATE_ADMIN_ABOUT;
-$adminmenu[$i]["link"] = 'admin/about.php';
-$adminmenu[$i]["icon"] = $pathIcon32.'/about.png';
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU5;
+$adminmenu[$i]['link'] = 'admin/building.php';
+$adminmenu[$i]['icon'] = 'images/icons/32/builder.png';
+$i++;
+$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU6;
+$adminmenu[$i]['link'] = 'admin/about.php';
+$adminmenu[$i]['icon'] = $pathIcon32.'/about.png';
unset($i);
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-19 17:46:49 UTC (rev 12397)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -22,18 +22,18 @@
// Recovered the value of the argument op in the URL $
$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
-switch ($op)
+switch ($op) http://localhost/xoops-2.5.7testTDMCreate1.91/Frameworks/moduleclasses/icons/32/user-icon.png
{
case 'list':
default:
- $limit = $GLOBALS['xoopsModuleConfig']['mod_adminpager'];
+ $limit = xoops_getModuleOption('mod_adminpager');
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
$template_main = 'tdmcreate_modules.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
$GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
- $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
$criteria->setOrder('ASC');
@@ -107,8 +107,8 @@
//Form mod_image
include_once XOOPS_ROOT_PATH . '/class/uploader.php';
$uploaddir = TDMC_UPLOAD_PATH.'/images/modules/';
- $uploader = new XoopsMediaUploader($uploaddir, $GLOBALS['xoopsModuleConfig']['mimetypes'],
- $GLOBALS['xoopsModuleConfig']['maxsize'], null, null);
+ $uploader = new XoopsMediaUploader($uploaddir, xoops_getModuleOption('mimetypes'),
+ xoops_getModuleOption('maxsize'), null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
$extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attaccedFile']['name']);
$name_img = $_GET['mod_name'].'_slogo.'.$extension;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-19 17:46:49 UTC (rev 12397)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -1,22 +1,22 @@
<?php
/*
-You may not change or alter any portion of this comment or credits
-of supporting developers from this source code or any supporting source code
-which is considered copyrighted (c) material of the original comment or credit authors.
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-*/
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
/**
-* tdmcreate module
-*
-* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
-* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
-* @package tdmcreate
-* @since 2.5.5
-* @author Txmod Xoops <su...@tx...>
-* @version $Id: 1.59 tables.php 11297 2013-03-24 10:58:10Z timgno $
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: tables.php 12258 2014-01-02 09:33:29Z timgno $
*/
include 'header.php';
// Recovered the value of the argument op in the URL $
@@ -30,15 +30,16 @@
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
$template_main = 'tdmcreate_tables.html';
- $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/style.css' );
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin.css' );
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
- $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
- $GLOBALS['xoopsTpl']->assign('pathIcon32', XOOPS_URL.'/Frameworks/moduleclasses/icons/32');
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
+ //$GLOBALS['xoopsTpl']->assign('tdmc_upload_table_url', TDMC_UPLOAD_IMGTAB_URL);
+ $GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
// Get the list of modules
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
@@ -119,7 +120,7 @@
$GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
$obj =& $tablesHandler->create();
- $form = $obj->getFormTable();
+ $form = $obj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldattributes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldattributes.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldattributes.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -0,0 +1,46 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.5
+ * @author Txmod Xoops <su...@tx...>
+ * @version $Id: 1.59 fieldattributes.php 11297 2013-03-24 10:58:10Z timgno $
+ */
+if (!defined('XOOPS_ROOT_PATH')) { die("XOOPS root path not defined"); }
+
+class TDMCreateFieldattributes extends XoopsObject
+{
+ //Constructor
+ function __construct()
+ {
+ $this->XoopsObject();
+ $this->initVar('fieldattribute_value', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('fieldattribute_name', XOBJ_DTYPE_TXTBOX);
+ }
+
+ //Constructor
+ function TDMCreateFieldattributes()
+ {
+ $this->__construct();
+ }
+}
+
+class TDMCreateFieldattributesHandler extends XoopsPersistableObjectHandler
+{
+ function __construct(&$db)
+ {
+ parent::__construct($db, 'mod_tdmcreate_fieldattributes', 'tdmcreatefieldattributes', 'fieldattribute_value', 'fieldattribute_name');
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -0,0 +1,54 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.5
+ * @author Txmod Xoops <su...@tx...>
+ * @version $Id: 1.59 fieldelements.php 11297 2013-03-24 10:58:10Z timgno $
+ */
+if (!defined('XOOPS_ROOT_PATH')) { die("XOOPS root path not defined"); }
+
+class TDMCreateFieldelements extends XoopsObject
+{
+ //Constructor
+ function __construct()
+ {
+ $this->XoopsObject();
+ $this->initVar('fieldelement_id', XOBJ_DTYPE_INT);
+ $this->initVar('fieldelement_value', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('fieldelement_name', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('fieldelement_admin', XOBJ_DTYPE_INT);
+ $this->initVar('fieldelement_inlist', XOBJ_DTYPE_INT);
+ $this->initVar('fieldelement_pid', XOBJ_DTYPE_INT);
+ $this->initVar('fieldelement_user', XOBJ_DTYPE_INT);
+ $this->initVar('fieldelement_block', XOBJ_DTYPE_INT);
+ $this->initVar('fieldelement_mfield', XOBJ_DTYPE_INT);
+ $this->initVar('fieldelement_search', XOBJ_DTYPE_INT);
+ $this->initVar('fieldelement_required', XOBJ_DTYPE_INT);
+ }
+
+ //Constructor
+ function TDMCreateFieldelements()
+ {
+ $this->__construct();
+ }
+}
+class TDMCreateFieldelementsHandler extends XoopsPersistableObjectHandler
+{
+ function __construct(&$db)
+ {
+ parent::__construct($db, 'mod_tdmcreate_fieldelements', 'tdmcreatefieldelements', 'fieldelement_id', 'fieldelement_name');
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldkey.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldkey.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldkey.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -0,0 +1,45 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.5
+ * @author Txmod Xoops <su...@tx...>
+ * @version $Id: 1.59 fieldkey.php 11297 2013-03-24 10:58:10Z timgno $
+ */
+if (!defined('XOOPS_ROOT_PATH')) { die("XOOPS root path not defined"); }
+
+class TDMCreateFieldkey extends XoopsObject
+{
+ //Constructor
+ function __construct()
+ {
+ $this->XoopsObject();
+ $this->initVar('fieldkey_value', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('fieldkey_name', XOBJ_DTYPE_TXTBOX);
+ }
+
+ //Constructor
+ function TDMCreateFieldkey()
+ {
+ $this->__construct();
+ }
+}
+class TDMCreateFieldkeyHandler extends XoopsPersistableObjectHandler
+{
+ function __construct(&$db)
+ {
+ parent::__construct($db, 'mod_tdmcreate_fieldkey', 'tdmcreatefieldkey', 'fieldkey_value', 'fieldkey_name');
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldnull.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldnull.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldnull.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -0,0 +1,46 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.5
+ * @author Txmod Xoops <su...@tx...>
+ * @version $Id: 1.59 fieldnull.php 11297 2013-03-24 10:58:10Z timgno $
+ */
+if (!defined('XOOPS_ROOT_PATH')) { die("XOOPS root path not defined"); }
+
+class TDMCreateFieldnull extends XoopsObject
+{
+ //Constructor
+ function __construct()
+ {
+ $this->XoopsObject();
+ $this->initVar('fieldnull_value', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('fieldnull_name', XOBJ_DTYPE_TXTBOX);
+ }
+
+ //Constructor
+ function TDMCreateFieldnull()
+ {
+ $this->__construct();
+ }
+}
+
+class TDMCreateFieldnullHandler extends XoopsPersistableObjectHandler
+{
+ function __construct(&$db)
+ {
+ parent::__construct($db, 'mod_tdmcreate_fieldnull', 'tdmcreatefieldnull', 'fieldnull_value', 'fieldnull_name');
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-03-19 17:46:49 UTC (rev 12397)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -21,108 +21,134 @@
if (!defined("XOOPS_ROOT_PATH")) {
die("XOOPS root path not defined");
}
-require_once "tdmcreate_htmltable.php";
+require_once 'themeform.php';
+/*
+* @Class TDMCreateFields
+* @extends XoopsObject
+*/
class TDMCreateFields extends XoopsObject
{
- //Constructor
+ /*
+ * @public function constructor class
+ * @param null
+ */
public function __construct()
{
$this->XoopsObject();
- $this->initVar("field_id", XOBJ_DTYPE_INT, null, false, 8);
- $this->initVar("field_table", XOBJ_DTYPE_INT, null, false, 5);
- $this->initVar("field_name", XOBJ_DTYPE_TXTBOX, null, false, 255);
- $this->initVar("field_type", XOBJ_DTYPE_TXTBOX, null, false, 100);
- $this->initVar("field_value", XOBJ_DTYPE_TXTBOX, null, false, 4);
- $this->initVar("field_attribute", XOBJ_DTYPE_TXTBOX, null, false, 50);
- $this->initVar("field_null", XOBJ_DTYPE_TXTBOX, null, false, 10);
- $this->initVar("field_default", XOBJ_DTYPE_TXTBOX, null, false, 150);
- $this->initVar("field_key", XOBJ_DTYPE_TXTBOX, null, false, 10);
- $this->initVar("field_auto_increment", XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar("field_display_admin", XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar("field_display_user", XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar("field_display_block", XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar("field_mainfield", XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar("field_search", XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar("field_required", XOBJ_DTYPE_INT, null, false, 1);
+ $this->initVar('field_id', XOBJ_DTYPE_INT, null, false, 8);
+ $this->initVar('field_tid', XOBJ_DTYPE_INT, null, false, 5);
+ $this->initVar('field_name', XOBJ_DTYPE_TXTBOX, null, false, 255);
+ $this->initVar('field_type', XOBJ_DTYPE_TXTBOX, null, false, 100);
+ $this->initVar('field_value', XOBJ_DTYPE_TXTBOX, null, false, 4);
+ $this->initVar('field_attribute', XOBJ_DTYPE_TXTBOX, null, false, 50);
+ $this->initVar('field_null', XOBJ_DTYPE_TXTBOX, null, false, 10);
+ $this->...
[truncated message content] |
|
From: <txm...@us...> - 2014-03-23 19:52:28
|
Revision: 12402
http://sourceforge.net/p/xoops/svn/12402
Author: txmodxoops
Date: 2014-03-23 19:52:22 +0000 (Sun, 23 Mar 2014)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/logoGenerator.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/themeform.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_about.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_help.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -22,7 +22,4 @@
$template_main = 'tdmcreate_about.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('about.php'));
$GLOBALS['xoopsTpl']->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false));
-if ( isset($template_main) ) {
- $GLOBALS['xoopsTpl']->display("db:{$template_main}");
-}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -57,7 +57,4 @@
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
}
-if ( isset($template_main) ) {
- $GLOBALS['xoopsTpl']->display("db:{$template_main}");
-}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -19,20 +19,20 @@
* @version $Id: fields.php 12258 2014-01-02 09:33:29Z timgno $
*/
include 'header.php';
-// Recovered the value of the argument op in the URL $
+// Recovered value of arguments op in the URL $
$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
-$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id', 0, 'int');
+// Get table Variables
$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id', 0, 'int');
+$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid', 0, 'int');
+$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields', 0, 'int');
+$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');
+// Get field Variables
$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id', 0, 'int');
-// Get table Variables
$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid', 0, 'int');
$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid', 0, 'int');
$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb', 0, 'int');
$field_name = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');
-/*$table_id = $_SESSION['field_tid'];
-$table_mid = $_SESSION['field_mid'];
-$table_nbfields = $_SESSION['field_numb'];
-$table_fieldname = $_SESSION['field_name'];*/
+//
switch ($op)
{
case 'list':
@@ -50,7 +50,7 @@
$GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
// Get the list of tables
$criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_mid', $_REQUEST['mod_id']));
+ $criteria->add(new Criteria('table_mid', $table_mid));
$criteria->setSort('table_id ASC, table_name');
$criteria->setOrder('ASC');
$nb_tables = $tablesHandler->getCount();
@@ -89,14 +89,14 @@
case 'new':
// Define main template
- $template_main = 'tdmcreate_tables.html';
+ $template_main = 'tdmcreate_fields.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
$GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
$obj =& $fieldsHandler->create();
$form = $obj->getForm($table_id, $table_mid, $table_nbfields, $table_fieldname);
- $form->display();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'save':
@@ -109,24 +109,33 @@
$obj =& $fieldsHandler->create();
}
//Form fields
- $obj->setVars(array('field_mid' => $table_mid, 'field_tid' => $table_id, 'field_name' => $_POST['field_name'],
- 'field_numb' => $table_nbfields, 'field_type' => $_POST['field_type'],
- 'field_value' => $_POST['field_value'], 'field_attribute' => $_POST['field_attribute'],
- 'field_null' => $_POST['field_null'], 'field_default' => $_POST['field_default'],
- 'field_key' => $_POST['field_key'], 'field_elements' => $_POST['field_elements'],
+ $obj->setVars(array('field_mid' => $table_mid,
+ 'field_tid' => $table_id,
+ 'field_name' => $_POST['field_name'],
+ 'field_numb' => $table_nbfields,
+ 'field_type' => $_POST['field_type'],
+ 'field_value' => $_POST['field_value'],
+ 'field_attribute' => $_POST['field_attribute'],
+ 'field_null' => $_POST['field_null'],
+ 'field_default' => $_POST['field_default'],
+ 'field_key' => $_POST['field_key'],
+ 'field_elements' => $_POST['field_elements'],
'field_admin' => (($_REQUEST['field_admin'] == 1) ? '1' : '0'),
'field_user' => (($_REQUEST['field_user'] == 1) ? '1' : '0'),
'field_blocks' => (($_REQUEST['field_blocks'] == 1) ? '1' : '0'),
'field_mainfield' => (($_REQUEST['field_mainfield'] == 1) ? '1' : '0'),
'field_search' => (($_REQUEST['field_search'] == 1) ? '1' : '0'),
- 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0')));
+ 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0')),
+ 'field_fields' => $_POST['field_fields'],
+ 'field_parameters' => $_POST['field_parameters']
+ );
if ($fieldsHandler->insert($obj)) {
redirect_header('tables.php', 2, _AM_TDMCREATE_FORMOK);
}
echo $obj->getHtmlErrors();
$form = $obj->getForm();
- $form->display();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'edit':
@@ -137,11 +146,8 @@
$GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
$obj = $fieldsHandler->get($field_id);
- $form = $obj->getForm($table_id, $table_mid, $table_nbfields, $table_fieldname);
- $form->display();
+ $form = $obj->getForm($field_tid, $field_mid, $field_numb, $field_name);
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
}
-if ( isset($template_main) ) {
- $GLOBALS['xoopsTpl']->display("db:{$template_main}");
-}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -18,7 +18,9 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: footer.php 12207 2013-10-23 02:46:52Z beckmi $
*/
-
-$xoopsTpl->assign('module_name', $xoopsModule->getVar('name'));
+$GLOBALS['xoopsTpl']->assign('module_name', $GLOBALS['xoopsModule']->getVar('name'));
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
xoops_cp_footer();
?>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -19,20 +19,15 @@
* @version $Id: index.php 11084 2013-02-23 15:44:20Z timgno $
*/
include 'header.php';
-
$criteria = new CriteriaCompo();
$count_modules = $modulesHandler->getCount($criteria);
$count_tables = $tablesHandler->getCount($criteria);
unset($criteria);
-
+$template_main = 'tdmcreate_index.html';
$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ;
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMMODULES. '</label>', $count_modules, 'Green') ;
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMTABLES. '</label>', $count_tables, 'Orange');
//$xoopsOption['template_main'] = 'tdmcreate_index.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('index.php'));
$GLOBALS['xoopsTpl']->assign('index', $adminMenu->renderIndex());
-$template_main = 'tdmcreate_index.html';
-if ( isset($template_main) ) {
- $GLOBALS['xoopsTpl']->display("db:{$template_main}");
-}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -22,7 +22,7 @@
// Recovered the value of the argument op in the URL $
$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
-switch ($op) http://localhost/xoops-2.5.7testTDMCreate1.91/Frameworks/moduleclasses/icons/32/user-icon.png
+switch ($op)
{
case 'list':
default:
@@ -177,7 +177,4 @@
}
break;
}
-if ( isset($template_main) ) {
- $GLOBALS['xoopsTpl']->display("db:{$template_main}");
-}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -19,9 +19,15 @@
* @version $Id: tables.php 12258 2014-01-02 09:33:29Z timgno $
*/
include 'header.php';
-// Recovered the value of the argument op in the URL $
+// Recovered value of arguments op in the URL $
$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
+//
$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id', 0);
+$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id', 0);
+$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid', 0);
+$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields', 0);
+$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');
+//
switch ($op)
{
case 'list':
@@ -128,23 +134,16 @@
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- $table_id = TDMCreate_CleanVars($_REQUEST, 'table_id', 0, 'int');
if (isset($table_id)) {
$obj =& $tablesHandler->get($table_id);
} else {
$obj =& $tablesHandler->create();
}
-
- $table_mid = intval($_REQUEST['table_mid']);
- $table_nbfields = intval($_REQUEST['table_nbfields']);
- $table_fieldname = strtolower($_REQUEST['table_fieldname']);
- $_SESSION['field_tid'] = $tid;
- $_SESSION['field_mid'] = $table_mid;
- $_SESSION['field_numb'] = $table_nbfields;
- $_SESSION['field_name'] = $table_fieldname;
//Form tables
- $obj->setVars(array('table_mid' => $table_mid, 'table_name' => $_POST['table_name'],
- 'table_nbfields' => $table_nbfields, 'table_fieldname' => $table_fieldname));
+ $obj->setVars(array('table_mid' => $table_mid,
+ 'table_name' => $_POST['table_name'],
+ 'table_nbfields' => $table_nbfields,
+ 'table_fieldname' => $table_fieldname));
//Form table_image
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
if(is_dir($pathIcon32)){
@@ -169,17 +168,17 @@
$obj->setVar('table_image', $_POST['table_image']);
}
$obj->setVars(array('table_blocks' => (($_REQUEST['table_blocks'] == 1) ? '1' : '0'),
- 'table_admin' => (($_REQUEST['table_admin'] == 1) ? '1' : '0'),
- 'table_user' => (($_REQUEST['table_user'] == 1) ? '1' : '0'),
- 'table_submenu' => (($_REQUEST['table_submenu'] == 1) ? '1' : '0'),
- 'table_search' => (($_REQUEST['table_search'] == 1) ? '1' : '0'),
- 'table_comments' => (($_REQUEST['table_comments'] == 1) ? '1' : '0'),
- 'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0')));
+ 'table_admin' => (($_REQUEST['table_admin'] == 1) ? '1' : '0'),
+ 'table_user' => (($_REQUEST['table_user'] == 1) ? '1' : '0'),
+ 'table_submenu' => (($_REQUEST['table_submenu'] == 1) ? '1' : '0'),
+ 'table_search' => (($_REQUEST['table_search'] == 1) ? '1' : '0'),
+ 'table_comments' => (($_REQUEST['table_comments'] == 1) ? '1' : '0'),
+ 'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0')));
if( $tablesHandler->insert($obj) ) {
if( $obj->isNew() ) {
- $tid = $GLOBALS['xoopsDB']->getInsertId();
- redirect_header('fields.php?op=new&field_tid='.$tid, 3, _AM_TDMCREATE_FORMOK);
+ $field_tid = $GLOBALS['xoopsDB']->getInsertId();
+ redirect_header('fields.php?op=new&field_tid='.$field_tid, 3, _AM_TDMCREATE_FORMOK);
} else {
redirect_header('tables.php', 3, _AM_TDMCREATE_FORMOK);
}
@@ -218,7 +217,4 @@
}
break;
}
-if ( isset($template_main) ) {
- $GLOBALS['xoopsTpl']->display("db:{$template_main}");
-}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -35,34 +35,24 @@
public function __construct()
{
$this->XoopsObject();
- $this->initVar('field_id', XOBJ_DTYPE_INT, null, false, 8);
- $this->initVar('field_tid', XOBJ_DTYPE_INT, null, false, 5);
- $this->initVar('field_name', XOBJ_DTYPE_TXTBOX, null, false, 255);
- $this->initVar('field_type', XOBJ_DTYPE_TXTBOX, null, false, 100);
- $this->initVar('field_value', XOBJ_DTYPE_TXTBOX, null, false, 4);
- $this->initVar('field_attribute', XOBJ_DTYPE_TXTBOX, null, false, 50);
- $this->initVar('field_null', XOBJ_DTYPE_TXTBOX, null, false, 10);
- $this->initVar('field_default', XOBJ_DTYPE_TXTBOX, null, false, 150);
- $this->initVar('field_key', XOBJ_DTYPE_TXTBOX, null, false, 10);
- $this->initVar('field_auto_increment', XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar('field_display_admin', XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar('field_display_user', XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar('field_display_block', XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar('field_mainfield', XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar('field_search', XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar('field_required', XOBJ_DTYPE_INT, null, false, 1);
- // For relationship
- $this->initVar('table_id', XOBJ_DTYPE_INT, null, false, 8);
- $this->initVar('table_mid', XOBJ_DTYPE_INT, null, false, 5);
- $this->initVar('table_name', XOBJ_DTYPE_TXTBOX, null, false, 255);
- $this->initVar('table_nbfields', XOBJ_DTYPE_INT, null, false, 5);
- $this->initVar('table_fieldname', XOBJ_DTYPE_TXTBOX, null, false, 50);
- $this->initVar('table_fields', XOBJ_DTYPE_TXTAREA, null);
- $this->initVar('table_parameters', XOBJ_DTYPE_TXTAREA, null);
-
- $this->initVar('fieldtype_id', XOBJ_DTYPE_INT, null, false, 5);
- $this->initVar('fieldtype_value', XOBJ_DTYPE_TXTBOX, null, false, 25);
- $this->initVar('fieldtype_name', XOBJ_DTYPE_TXTBOX, null, false, 255);
+ $this->initVar('field_id', XOBJ_DTYPE_INT);
+ $this->initVar('field_tid', XOBJ_DTYPE_INT);
+ $this->initVar('field_name', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_type', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_value', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_attribute', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_null', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_default', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_key', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_auto_increment', XOBJ_DTYPE_INT);
+ $this->initVar('field_display_admin', XOBJ_DTYPE_INT);
+ $this->initVar('field_display_user', XOBJ_DTYPE_INT);
+ $this->initVar('field_display_block', XOBJ_DTYPE_INT);
+ $this->initVar('field_mainfield', XOBJ_DTYPE_INT);
+ $this->initVar('field_search', XOBJ_DTYPE_INT);
+ $this->initVar('field_required', XOBJ_DTYPE_INT);
+ $this->initVar('field_fields',XOBJ_DTYPE_TXTAREA);
+ $this->initVar('field_parameters',XOBJ_DTYPE_TXTAREA);
}
/*
@@ -79,43 +69,45 @@
}
/*
- * @static function getForm
+ * @public function getForm
+ *
+ * @param integer $table_id
+ * @param integer $table_mid
+ * @param integer $table_nbfields
+ * @param string $table_fieldname
* @param mixed $action
*/
- public function getForm($action = false)
+ public function getForm($table_id = null, $table_mid = null, $table_nbfields = null, $table_fieldname = null, $action = false)
{
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
$title = $this->isNew() ? sprintf(_AM_TDMCREATE_FIELD_ADD) : sprintf(_AM_TDMCREATE_FIELD_EDIT);
-
+
+ if ($this->isNew()) {
+ $field_tid = $table_id;
+ $nb_fields = $table_nbfields;
+ } else {
+ $field_tid = $this->getVar('field_tid');
+ $nb_fields = $this->getVar('field_numb');
+ }
+
include_once(XOOPS_ROOT_PATH.'/class/xoopsformloader.php');
- include_once(XOOPS_ROOT_PATH.'/modules/TDMCreate/class/tdmcreate_themeform.php');
+ include_once(XOOPS_ROOT_PATH.'/modules/TDMCreate/class/themeform.php');
$form = new TDMCreateThemeForm($title, 'form', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
-
- if (!$this->isNew()) {
- $field_tid = $this->getVar('field_tid');
- } else {
- $field_tid = array( 1 => 0 );
- }
//$option_tray = new XoopsFormElementTray(' ');
//$option_tray->setExtra('colspan="2"');//_AM_TDMCREATE_FIELD_TYPE
-
+ $tablesHandler = xoops_getModuleHandler('tables');
// New Object HtmlTable
$tableForm = new TDMCreateHtmlTable(null, 'display outer');
// header row
$tableForm->addRow('center bgblue');
$cells = array(_AM_TDMCREATE_FIELD_NUMBER, _AM_TDMCREATE_FIELD_NAME, _AM_TDMCREATE_FIELD_TYPE, _AM_TDMCREATE_FIELD_VALUE, _AM_TDMCREATE_FIELD_ATTRIBUTE, _AM_TDMCREATE_FIELD_NULL, _AM_TDMCREATE_FIELD_DEFAULT, _AM_TDMCREATE_FIELD_KEY, _AM_TDMCREATE_FIELD_OTHERS);
$tableForm->addCells($cells, 'first', 'header');
-
- $tablesHandler = xoops_getModuleHandler('tables');
- $criteria = new CriteriaCompo(new Criteria('table_name', $this->getVar('table_name')));
- $criteria->add(new Criteria('table_nbfields', $this->getVar('table_nbfields')));
- $nb_fields = $tablesHandler->getAll($criteria);
- unset($criteria);
+
for($i = 1; $i <= count($nb_fields); $i++)
{
$field_name = $this->isNew() ? $this->getVar('table_fieldname') : $this->getVar('field_name');
@@ -161,11 +153,11 @@
$fieldelementsHandler=& xoops_getModuleHandler('fieldelements');
$field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element_name', $this->getVar('field_element_name'));
$field_elements_select->addOptionArray($fieldelementsHandler->getList());
- $criteria = new CriteriaCompo(new Criteria('table_id', $this->getVar('table_id')));
- $criteria->add(new Criteria('table_module', $this->getVar('table_module')));
+ $criteria = new CriteriaCompo(new Criteria('table_id', $table_id)));
+ $criteria->add(new Criteria('table_mid', $table_mid)));
$criteria->setSort('table_name');
$criteria->setOrder('ASC');
- $tbls_arr1 = $tablesHandler->getall($criteria);
+ $tbls_arr1 = $tablesHandler->getAll($criteria);
unset($criteria);
foreach (array_keys($tbls_arr1) as $j)
{
@@ -214,14 +206,14 @@
$tableOtherForm->addRow();
$tableOtherForm->addCell($check_field_required->render(), null, 'data');
}
- $tableForm->addCell($tableOtherForm->display(), null, 'data');
+ $tableForm->addCell($tableOtherForm->render(), null, 'data');
if (!$this->isNew()) {
$tableFormHiddenId = new XoopsFormHidden('table_id', $this->getVar('table_id'));
//$form->addElement(new XoopsFormHidden('fields_modified', true));
}
}
- $form->addElement($tableForm->display());
+ $form->addElement($tableForm->render());
/*if (!$this->isNew()) {
$form->addElement(new XoopsFormHidden('table_id', $this->getVar('table_id')));
$form->addElement(new XoopsFormHidden('fields_modified', true));
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -0,0 +1,140 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.5
+ * @author Txmod Xoops <su...@tx...>
+ * @version $Id: 1.91 htmlform.php 11297 2014-03-22 10:19:18Z timgno $
+ */
+
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+/**
+ * Form HTML
+ *
+ */
+class HtmlForm
+{
+ /**
+ * name attribute
+ *
+ * @var string
+ */
+ private $name = null;
+
+ /**
+ * id attribute
+ *
+ * @var mixed
+ */
+ private $id = null;
+
+ /**
+ * action attribute
+ *
+ * @var mixed
+ */
+ private $action = null;
+
+ /**
+ * method attribute
+ *
+ * @var string
+ */
+ private $method = null;
+
+ /**
+ * display attribute
+ *
+ * @var bool
+ */
+ private $display = false;
+
+ /**
+ * hidden attribute
+ *
+ * @var bool
+ */
+ private $hidden = false;
+
+ /**
+ * constructor
+ *
+ */
+ public function __construct()
+ {
+ }
+
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+
+ /**
+ * Function getForm
+ *
+ * @param string $name "name" attribute for the <form> tag
+ * @param string $id "id" attribute for the <form> tag
+ * @param string $action "action" attribute for the <form> tag
+ * @param string $method "method" attribute for the <form> tag
+ * @param bool $extra whether to add a javascript to the form
+ * @param string $display "display" attribute for the <table> tag
+ * @param string $hidden "hidden" attribute for the <form> tag
+ */
+ public function getForm($name = null, $id = null, $action = false, $method = 'post', $extra = false, $display = false, $hidden = false)
+ {
+ $this->name = $name;
+ $this->id = $id;
+ $this->action = $action;
+ $this->method = $method;
+ $this->extra = $extra;
+ $this->display = $display;
+ $this->hidden = $hidden;
+ }
+
+ /**
+ * Function OpenForm
+ *
+ * @param null
+ */
+ public function getOpenForm()
+ {
+ $ret = '<form name="' . $this->name . '" id="' . $this->id . '" action="' . $this->action . '" method="' . $this->method . '" onsubmit="return xoopsFormValidate_' . $this->name . '();"' . $this->extra . '>' . NWLINE;
+ return $ret;
+ }
+
+ /**
+ * Function CloseForm
+ *
+ * @param null
+ */
+ public function getCloseForm()
+ {
+ if($this->display && $this->hidden) {
+ $ret = $this->display . NWLINE . ' ' . $this->hidden . '</form>' . NWLINE;
+ } else {
+ $ret = NWLINE . '</form>' . NWLINE;
+ }
+ return $ret;
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -27,22 +27,57 @@
* @package tdmcreate
* @access public
*/
-xoops_load('XoopsFormElement');
-class TDMCreateHtmlTable extends XoopsFormElement
+//xoops_load('XoopsFormElement');
+class TDMCreateHtmlTable /*extends XoopsFormElement*/
{
/**
- * array of {@link XoopsFormElement} objects
+ * array of {@TDMCreateHtmlTable} objects
*
* @var array
*/
- var $rows = array();
+ private $rows = array();
/**
- * "tStr" string of the table
+ * array of {@link TDMCreateHtmlTable} objects
*
+ * @var array
+ */
+ private $cells = array();
+
+ /**
+ * string of {@link TDMCreateHtmlTable} objects
+ *
* @var string
*/
- var $tStr = '';
+ private $table_string = '';
+
+ /**
+ * string of {@link TDMCreateHtmlTable} objects
+ *
+ * @var string
+ */
+ private $data = '';
+
+ /**
+ * string of {@link TDMCreateHtmlTable} objects
+ *
+ * @var string
+ */
+ private $_class = '';
+
+ /**
+ * string of {@link TDMCreateHtmlTable} objects
+ *
+ * @var string
+ */
+ private $type = '';
+
+ /**
+ * array of {@link TDMCreateHtmlTable} objects
+ *
+ * @var array
+ */
+ private $attributes = array();
/**
* constructor
@@ -74,27 +109,27 @@
* @param int $border "border" attribute for the <table> tag
* @param int $cellspacing "cellspacing" attribute for the <table> tag
* @param int $cellpadding "cellpadding" attribute for the <table> tag
- * @param array $attrs attributes for the <table> tag
+ * @param array $attributes attributes for the <table> tag
*/
- public function initTable($id = '', $_class = '', $border = 0, $cellspacing = 2, $cellpadding = 0, $attrs = array() )
+ public function initTable($id = '', $_class = '', $border = 0, $cellspacing = 2, $cellpadding = 0, $attributes = array() )
{
- $this->tStr = '<table' . ( !empty($id) ? ' id="' . $id . '"' : '' );
- $this->tStr .= ( !empty($_class) ? ' class="' . $_class . '"' : '' );
- $this->tStr .= $this->addAttributes( $attrs );
- $this->tStr .= ' border="' . $border . '" cellspacing="' . $cellspacing . '" cellpadding="' . $cellpadding . '">';
+ $this->table_string = '<table' . ( !empty($id) ? ' id="' . $id . '"' : '' );
+ $this->table_string .= ( !empty($_class) ? ' class="' . $_class . '"' : '' );
+ $this->table_string .= $this->addAttributes( $attributes );
+ $this->...
[truncated message content] |
|
From: <txm...@us...> - 2014-03-27 00:26:35
|
Revision: 12410
http://sourceforge.net/p/xoops/svn/12410
Author: txmodxoops
Date: 2014-03-27 00:26:31 +0000 (Thu, 27 Mar 2014)
Log Message:
-----------
Updated
Work in progress
The base module is created
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/logoGenerator.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/themeform.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_header.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields_class.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields_database.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin.css
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/default_slogo.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/arrow.gif
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/off.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/on.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/module_logo.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/txmodxoops_logo.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/uploads/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/xoops2.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions_const.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/modules/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-25 08:52:13 UTC (rev 12409)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-27 00:26:31 UTC (rev 12410)
@@ -32,14 +32,15 @@
$template_main = 'tdmcreate_building.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
// Clear repertory of new module if there are
- TDMCreate_clearDir(TDMC_UPLOAD_MODULE_PATH . '/' . strtolower($modules->getVar('mod_name')));
+ TDMCreate_clearDir(TDMC_UPLOAD_MODULES_PATH . '/' . $modules->getVar('mod_name'));
// Debut
/************************************************/
/*Structure*/
/************************************************/
include_once TDMC_PATH . '/class/files/architecture.php';
$handler = TDMCreateArchitecture::getInstance();
- $handler->getUploadPath( TDMC_UPLOAD_MODULE_PATH );
+ $handler->getPath( TDMC_PATH );
+ $handler->getUploadPath( TDMC_UPLOAD_PATH );
$handler->getArchitectureFiles( $modules );
// Creation of the structure of folders and files
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-03-25 08:52:13 UTC (rev 12409)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-03-27 00:26:31 UTC (rev 12410)
@@ -22,22 +22,22 @@
// Recovered value of arguments op in the URL $
$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
// Get table Variables
-$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id', 0, 'int');
-$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid', 0, 'int');
-$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields', 0, 'int');
+$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id');
+$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid');
+$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields');
$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');
// Get field Variables
-$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id', 0, 'int');
-$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid', 0, 'int');
-$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid', 0, 'int');
-$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb', 0, 'int');
+$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id');
+$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid');
+$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
+$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb');
$field_name = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');
//
switch ($op)
{
case 'list':
default:
- $limit = xoops_getModuleOption('mod_adminpager');
+ $limit = xoops_getModuleOption('fields_adminpager');
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
$template_main = 'tdmcreate_fields.html';
@@ -95,7 +95,7 @@
$GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
$obj =& $fieldsHandler->create();
- $form = $obj->getForm($table_id, $table_mid, $table_nbfields, $table_fieldname);
+ $form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
@@ -125,13 +125,13 @@
'field_blocks' => (($_REQUEST['field_blocks'] == 1) ? '1' : '0'),
'field_mainfield' => (($_REQUEST['field_mainfield'] == 1) ? '1' : '0'),
'field_search' => (($_REQUEST['field_search'] == 1) ? '1' : '0'),
- 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0')),
+ 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0'),
'field_fields' => $_POST['field_fields'],
- 'field_parameters' => $_POST['field_parameters']
+ 'field_parameters' => $_POST['field_parameters'])
);
if ($fieldsHandler->insert($obj)) {
- redirect_header('tables.php', 2, _AM_TDMCREATE_FORMOK);
+ redirect_header('fields.php', 2, _AM_TDMCREATE_FORMOK);
}
echo $obj->getHtmlErrors();
$form = $obj->getForm();
@@ -143,10 +143,12 @@
$template_main = 'tdmcreate_tables.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
- $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('button_tables_list', $adminMenu->renderButton());
+ $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('button_fields_list', $adminMenu->renderButton());
$obj = $fieldsHandler->get($field_id);
- $form = $obj->getForm($field_tid, $field_mid, $field_numb, $field_name);
+ $form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-03-25 08:52:13 UTC (rev 12409)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-03-27 00:26:31 UTC (rev 12410)
@@ -19,8 +19,8 @@
* @version $Id: header.php 12258 2014-01-02 09:33:29Z timgno $
*/
include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
-include_once('../include/common.php');
-include_once('../include/functions.php');
+include_once dirname(dirname(__FILE__)) . '/include/common.php';
+include_once dirname(dirname(__FILE__)) . '/include/functions.php';
//include_once 'includes.php';
//
$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-25 08:52:13 UTC (rev 12409)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-27 00:26:31 UTC (rev 12410)
@@ -94,16 +94,24 @@
$obj =& $modulesHandler->create();
}
//Form module save
- $obj->setVars(array('mod_name' => $_POST['mod_name'], 'mod_version' => $_POST['mod_version'],
- 'mod_min_php' => $_POST['mod_min_php'], 'mod_min_xoops' => $_POST['mod_min_xoops'],
- 'mod_min_admin' => $_POST['mod_min_admin'], 'mod_min_mysql' => $_POST['mod_min_mysql'],
- 'mod_description' => $_POST['mod_description'], 'mod_author' => $_POST['mod_author'], 'mod_author_mail' => $_POST['mod_author_mail'],
+ $obj->setVars(array('mod_name' => $_POST['mod_name'],
+ 'mod_version' => $_POST['mod_version'],
+ 'mod_since' => $_POST['mod_since'],
+ 'mod_min_php' => $_POST['mod_min_php'],
+ 'mod_min_xoops' => $_POST['mod_min_xoops'],
+ 'mod_min_admin' => $_POST['mod_min_admin'],
+ 'mod_min_mysql' => $_POST['mod_min_mysql'],
+ 'mod_description' => $_POST['mod_description'],
+ 'mod_author' => $_POST['mod_author'],
+ 'mod_author_mail' => $_POST['mod_author_mail'],
'mod_author_website_url' => $_POST['mod_author_website_url'],
'mod_author_website_name' => $_POST['mod_author_website_name'],
- 'mod_credits' => $_POST['mod_credits'], 'mod_license' => $_POST['mod_license'],
+ 'mod_credits' => $_POST['mod_credits'],
+ 'mod_license' => $_POST['mod_license'],
'mod_release_info' => $_POST['mod_release_info'],
'mod_release_file' => $_POST['mod_release_file'],
- 'mod_manual' => $_POST['mod_manual'], 'mod_manual_file' => $_POST['mod_manual_file']));
+ 'mod_manual' => $_POST['mod_manual'],
+ 'mod_manual_file' => $_POST['mod_manual_file']));
//Form mod_image
include_once XOOPS_ROOT_PATH . '/class/uploader.php';
$uploaddir = TDMC_UPLOAD_PATH.'/images/modules/';
@@ -136,7 +144,10 @@
'mod_submenu' => (($_REQUEST['mod_submenu'] == 1) ? '1' : '0'),
'mod_search' => (($_REQUEST['mod_search'] == 1) ? '1' : '0'),
'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'),
- 'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0')));
+ 'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0'),
+ 'mod_donations' => $_POST['mod_donations'],
+ 'mod_subversion' => $_POST['mod_subversion'])
+ );
if ($modulesHandler->insert($obj)) {
redirect_header('modules.php', 2, _AM_TDMCREATE_FORMOK);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-25 08:52:13 UTC (rev 12409)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-27 00:26:31 UTC (rev 12410)
@@ -22,10 +22,10 @@
// Recovered value of arguments op in the URL $
$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
//
-$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id', 0);
-$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id', 0);
-$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid', 0);
-$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields', 0);
+$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id');
+$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id');
+$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid');
+$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields');
$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');
//
switch ($op)
@@ -36,7 +36,7 @@
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
$template_main = 'tdmcreate_tables.html';
- $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin.css' );
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
@@ -141,7 +141,8 @@
}
//Form tables
$obj->setVars(array('table_mid' => $table_mid,
- 'table_name' => $_POST['table_name'],
+ 'table_name' => $_POST['table_name'],
+ 'table_category' => (($_REQUEST['table_category'] == 1) ? '1' : '0'),
'table_nbfields' => $table_nbfields,
'table_fieldname' => $table_fieldname));
//Form table_image
@@ -178,7 +179,7 @@
if( $tablesHandler->insert($obj) ) {
if( $obj->isNew() ) {
$field_tid = $GLOBALS['xoopsDB']->getInsertId();
- redirect_header('fields.php?op=new&field_tid='.$field_tid, 3, _AM_TDMCREATE_FORMOK);
+ redirect_header('fields.php?op=new&field_mid='.$table_mid.'&field_tid='.$field_tid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname, 3, _AM_TDMCREATE_FORMOK);
} else {
redirect_header('tables.php', 3, _AM_TDMCREATE_FORMOK);
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-03-25 08:52:13 UTC (rev 12409)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-03-27 00:26:31 UTC (rev 12410)
@@ -1,4 +1,4 @@
-<?php
+<?php
/*
You may not change or alter any portion of this comment or credits
of supporting developers from this source code or any supporting source code
@@ -18,23 +18,38 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: fields.php 12258 2014-01-02 09:33:29Z timgno $
*/
-if (!defined("XOOPS_ROOT_PATH")) {
- die("XOOPS root path not defined");
-}
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
require_once 'themeform.php';
/*
* @Class TDMCreateFields
-* @extends XoopsObject
+* @extends XoopsObject
*/
class TDMCreateFields extends XoopsObject
-{
+{
+ /**
+ * @var string
+ */
+ private $table = null;
+
+ /**
+ * @var string
+ */
+ private $htmltable = null;
+
+ /**
+ * @var string
+ */
+ private $htmltable_parameters = null;
+
/*
* @public function constructor class
* @param null
*/
public function __construct()
{
- $this->XoopsObject();
+ $this->table = TDMCreateTables::getInstance();
+ $this->htmltable = TDMCreateHtmlTable::getInstance();
+ $this->htmltable_parameters = TDMCreateHtmlTable::getInstance();
$this->initVar('field_id', XOBJ_DTYPE_INT);
$this->initVar('field_tid', XOBJ_DTYPE_INT);
$this->initVar('field_name', XOBJ_DTYPE_TXTBOX);
@@ -54,7 +69,7 @@
$this->initVar('field_fields',XOBJ_DTYPE_TXTAREA);
$this->initVar('field_parameters',XOBJ_DTYPE_TXTAREA);
}
-
+
/*
* @static function &getInstance
* @param null
@@ -82,9 +97,9 @@
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
-
+
$title = $this->isNew() ? sprintf(_AM_TDMCREATE_FIELD_ADD) : sprintf(_AM_TDMCREATE_FIELD_EDIT);
-
+
if ($this->isNew()) {
$field_tid = $table_id;
$nb_fields = $table_nbfields;
@@ -92,35 +107,37 @@
$field_tid = $this->getVar('field_tid');
$nb_fields = $this->getVar('field_numb');
}
-
- include_once(XOOPS_ROOT_PATH.'/class/xoopsformloader.php');
- include_once(XOOPS_ROOT_PATH.'/modules/TDMCreate/class/themeform.php');
+
+ $header_captions = array(_AM_TDMCREATE_FIELD_NUMBER, _AM_TDMCREATE_FIELD_NAME, _AM_TDMCREATE_FIELD_TYPE, _AM_TDMCREATE_FIELD_VALUE, _AM_TDMCREATE_FIELD_ATTRIBUTE, _AM_TDMCREATE_FIELD_NULL, _AM_TDMCREATE_FIELD_DEFAULT, _AM_TDMCREATE_FIELD_KEY, _AM_TDMCREATE_FIELD_OTHERS);
+ xoops_load('xoopsformloader');
$form = new TDMCreateThemeForm($title, 'form', $action, 'post', true);
- $form->setExtra('enctype="multipart/form-data"');
+ $form->setExtra('enctype="multipart/form-data"');
- //$option_tray = new XoopsFormElementTray(' ');
- //$option_tray->setExtra('colspan="2"');//_AM_TDMCREATE_FIELD_TYPE
- $tablesHandler = xoops_getModuleHandler('tables');
+ $tablesHandler = xoops_getModuleHandler('tables');
// New Object HtmlTable
- $tableForm = new TDMCreateHtmlTable(null, 'display outer');
+ //$this->htmltable->initTable(null, 'display outer');
// header row
- $tableForm->addRow('center bgblue');
- $cells = array(_AM_TDMCREATE_FIELD_NUMBER, _AM_TDMCREATE_FIELD_NAME, _AM_TDMCREATE_FIELD_TYPE, _AM_TDMCREATE_FIELD_VALUE, _AM_TDMCREATE_FIELD_ATTRIBUTE, _AM_TDMCREATE_FIELD_NULL, _AM_TDMCREATE_FIELD_DEFAULT, _AM_TDMCREATE_FIELD_KEY, _AM_TDMCREATE_FIELD_OTHERS);
- $tableForm->addCells($cells, 'first', 'header');
+ /*$this->htmltable->addRow('center bgblue');
+ $this->htmltable->addCells($cells, 'first', 'header');*/
+ $this->htmltable->initTable('display outer width100');
+ $this->htmltable->addRow() . NWLINE;
+ $this->htmltable->addCell($title, 'first', 'header', 'colspan="9"');
+ $this->htmltable->addRow('center bgblue') . NWLINE;
+ $this->htmltable->addCells($header_captions, 'first', 'header');
- for($i = 1; $i <= count($nb_fields); $i++)
- {
- $field_name = $this->isNew() ? $this->getVar('table_fieldname') : $this->getVar('field_name');
+ for($i = 1; $i <= intval($nb_fields); $i++)
+ {
+ $field_name = $this->isNew() ? $this->table->getVar('table_fieldname') : $this->getVar('field_name');
$field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name', 15, 255, $field_name);
// fieldtype
$fieldtypeHandler =& xoops_getModuleHandler('fieldtype');
$fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type', $this->getVar('field_type'));
- $fieldtype_select->addOptionArray($fieldtypeHandler->getList());
- // fieldvalue
+ $fieldtype_select->addOptionArray($fieldtypeHandler->getList());
+ // fieldvalue
$field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value', 5, 20, $this->getVar('field_value'));
// fieldattributes
- $fieldattrsHandler =& xoops_getModuleHandler('fieldattributes');
- $field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute', $this->getVar('field_attribute'));
+ $fieldattrsHandler =& xoops_getModuleHandler('fieldattributes');
+ $field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute', $this->getVar('field_attribute'));
$field_attributes_select->addOptionArray($fieldattrsHandler->getList());
// fieldnull
$fieldnullHandler =& xoops_getModuleHandler('fieldnull');
@@ -133,108 +150,99 @@
$field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key', $this->getVar('field_key'));
$field_key_select->addOptionArray($fieldkeyHandler->getList());
// render fields
- $tableFormDataArray = array($i, $field_name->render(), $fieldtype_select->render(), $field_value->render(), $field_attributes_select->render(), $field_null_select->render(), $field_default->render(), $field_key_select->render());
+ $htmltableDataArray = array($i, $field_name->render(), $fieldtype_select->render(), $field_value->render(), $field_attributes_select->render(), $field_null_select->render(), $field_default->render(), $field_key_select->render());
// data row
- $tableForm->addRow('center bgyellow');
- $tableForm->addCells($tableFormDataArray, 'first', 'data');
- $tableOtherForm = new TDMCreateHtmlTable(null, 'display');
- if($i == 1) {
+ $this->htmltable->addRow('center bgyellow');
+ $this->htmltable->addCells($htmltableDataArray, 'first', 'data');
+ $this->htmltable_parameters->initTable('display');
+ if($i == 1) {
$field_autoincrement = $this->isNew() ? 0 : $this->getVar('field_auto_increment');
$check_field_autoincrement = new XoopsFormCheckBox(' ', 'field_auto_increment', $field_autoincrement);
$check_field_autoincrement->addOption(1, _AM_TDMCREATE_FIELD_AUTO_INCREMENT);
// data row
- $tableOtherForm->addRow();
- $tableOtherForm->addCell($check_field_autoincrement->render(), null, 'data');
- } elseif($i > 1) {
+ $this->htmltable_parameters->addRow();
+ $this->htmltable_parameters->addCell($check_field_autoincrement->render(), null, 'data');
+ } elseif($i > 1) {
// Box header row
- $tableOtherForm->addRow('center bgyellow');
- $tableOtherForm->addCell(_AM_TDMCREATE_FIELD_ELEMENTS, 'first', 'header');
+ $this->htmltable_parameters->addRow('center bgyellow');
+ $this->htmltable_parameters->addCell(_AM_TDMCREATE_FIELD_ELEMENTS, 'first', 'header');
// fieldelements
$fieldelementsHandler=& xoops_getModuleHandler('fieldelements');
- $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element_name', $this->getVar('field_element_name'));
- $field_elements_select->addOptionArray($fieldelementsHandler->getList());
+ $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element_name', $this->getVar('field_element_name'));
+ $field_elements_select->addOptionArray($fieldelementsHandler->getList());
$criteria = new CriteriaCompo(new Criteria('table_id', $table_id));
- $criteria->add(new Criteria('table_mid', $table_mid));
+ $criteria->add(new Criteria('table_mid', $table_mid));
$criteria->setSort('table_name');
$criteria->setOrder('ASC');
$tbls_arr1 = $tablesHandler->getAll($criteria);
unset($criteria);
- foreach (array_keys($tbls_arr1) as $j)
- {
+ foreach (array_keys($tbls_arr1) as $j)
+ {
$tbls_name1 = $tbls_arr1[$j]->getVar('table_name');
- if ( $j[$i] == 'XoopsFormTables-'.$tbls_name1 ) {
- $field_elements_select->addOption('XoopsFormTables-'.$tbls_name1, 'Table : '.$tbls_name1);
- }
+ if ( $j[$i] == 'XoopsFormTables-'.$tbls_name1 ) {
+ $field_elements_select->addOption('XoopsFormTables-'.$tbls_name1, 'Table : '.$tbls_name1);
+ }
}
// data row
- $tableOtherForm->addRow();
- $tableOtherForm->addCell($field_elements_select->render(), null, 'data');
+ $this->htmltable_parameters->addRow();
+ $this->htmltable_parameters->addCell($field_elements_select->render(), null, 'data');
$field_display_admin = $this->isNew() ? 0 : $this->getVar('field_display_admin');
$check_field_display_admin = new XoopsFormCheckBox(' ', 'field_display_admin', $field_display_admin);
- $check_field_display_admin->addOption(1, _AM_TDMCREATE_FIELD_DISPLAY_ADMIN);
+ $check_field_display_admin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN);
// data row
- $tableOtherForm->addRow();
- $tableOtherForm->addCell($check_field_display_admin->render(), null, 'data');
+ $this->htmltable_parameters->addRow();
+ $this->htmltable_parameters->addCell($check_field_display_admin->render(), null, 'data');
$field_display_user = $this->isNew() ? 0 : $this->getVar('field_display_user');
$check_field_display_user = new XoopsFormCheckBox(' ', 'field_display_user', $field_display_user);
- $check_field_display_user->addOption(1, _AM_TDMCREATE_FIELD_DISPLAY_USER);
+ $check_field_display_user->addOption(1, _AM_TDMCREATE_FIELD_USER);
// data row
- $tableOtherForm->addRow();
- $tableOtherForm->addCell($check_field_display_user->render(), null, 'data');
+ $this->htmltable_parameters->addRow();
+ $this->htmltable_parameters->addCell($check_field_display_user->render(), null, 'data');
$field_display_block = $this->isNew() ? 0 : $this->getVar('field_display_block');
$check_field_display_block = new XoopsFormCheckBox(' ', 'field_display_block', $field_display_block);
- $check_field_display_block->addOption(1, _AM_TDMCREATE_FIELD_DISPLAY_BLOCK);
+ $check_field_display_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
// data row
- $tableOtherForm->addRow();
- $tableOtherForm->addCell($check_field_display_block->render(), null, 'data');
+ $this->htmltable_parameters->addRow();
+ $this->htmltable_parameters->addCell($check_field_display_block->render(), null, 'data');
$field_mnfield = $this->isNew() ? 0 : $this->getVar('field_mainfield');
$field_mainfield = new XoopsFormRadio(' ', 'field_mainfield', $field_mnfield);
$field_mainfield->addOption( ' ', _AM_TDMCREATE_FIELD_MAINFIELD );
// data row
- $tableOtherForm->addRow();
- $tableOtherForm->addCell($field_mainfield->render(), null, 'data');
+ $this->htmltable_parameters->addRow();
+ $this->htmltable_parameters->addCell($field_mainfield->render(), null, 'data');
$field_search = $this->isNew() ? 0 : $this->getVar('field_search');
$check_field_search = new XoopsFormCheckBox(' ', 'field_search', $field_search);
- $check_field_search->addOption(1, _AM_TDMCREATE_FIELD_SEARCH);
+ $check_field_search->addOption(1, _AM_TDMCREATE_FIELD_SEARCH);
// data row
- $tableOtherForm->addRow();
- $tableOtherForm->addCell($check_field_search->render(), null, 'data');
+ $this->htmltable_parameters->addRow();
+ $this->htmltable_parameters->addCell($check_field_search->render(), null, 'data');
$field_required = $this->isNew() ? 0 : $this->getVar('field_required');
$check_field_required = new XoopsFormCheckBox(' ', 'field_required', $field_required);
$check_field_required->addOption(1, _AM_TDMCREATE_FIELD_REQUIRED);
// data row
- $tableOtherForm->addRow();
- $tableOtherForm->addCell($check_field_required->render(), null, 'data');
- }
- $tableForm->addCell($tableOtherForm->render(), null, 'data');
-
+ $this->htmltable_parameters->addRow();
+ $this->htmltable_parameters->addCell($check_field_required->render(), null, 'data');
+ }
+ $this->htmltable->addCell($this->htmltable_parameters->render(), null, 'data');
+
if (!$this->isNew()) {
- $tableFormHiddenId = new XoopsFormHidden('table_id', $this->getVar('table_id'));
- //$form->addElement(new XoopsFormHidden('fields_modified', true));
- }
+ $tableId_Hidden = new XoopsFormHidden('table_id', $this->table->getVar('table_id'));
+ $form->addElement($tableId_Hidden);
+ //$form->addElement(new XoopsFormHidden('fields_modified', true));
+ }
}
- $form->addElement($tableForm->render());
- /*if (!$this->isNew()) {
- $form->addElement(new XoopsFormHidden('table_id', $this->getVar('table_id')));
- $form->addElement(new XoopsFormHidden('fields_modified', true));
- }
-
- $form->addElement(new XoopsFormHidden('op', 'save_fields'));
- $form->addElement(new XoopsFormHidden('field_tid', $this->getVar('field_tid')));
- $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));*/
- $tableFormButton = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
- $tableForm->addRow('right grey');
- $tableForm->addCell($tableFormButton, null, 'data');
- $form->addElement(new XoopsFormHidden('op', 'save_fields'));
- $form->addElement($tableForm);
- $form->addElement($tableFormButton);
+ $formHidden = new XoopsFormHidden('op', 'save_fields');
+ $formButton = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
+ $this->htmltable->addCell($formHidden->render(), null, 'data');
+ $this->htmltable->addCell($formButton->render(), null, 'data');
+ $form->addElement($this->htmltable->render());
return $form;
}
}
-class TDMCreateFieldsHandler extends XoopsPersistableObjectHandler
+class TDMCreateFieldsHandler extends XoopsPersistableObjectHandler
{
- function __construct(&$db)
+ function __construct(&$db)
{
parent::__construct($db, 'mod_tdmcreate_fields', 'tdmcreatefields', 'field_id', 'field_tid');
}
-}
+}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields_class.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields_class.php 2014-03-25 08:52:13 UTC (rev 12409)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields_class.php 2014-03-27 00:26:31 UTC (rev 12410)
@@ -1,249 +0,0 @@
-<?php
-/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-/**
- * tdmcreate module
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://ww...
[truncated message content] |
|
From: <txm...@us...> - 2014-03-27 14:29:02
|
Revision: 12413
http://sourceforge.net/p/xoops/svn/12413
Author: txmodxoops
Date: 2014-03-27 14:28:58 +0000 (Thu, 27 Mar 2014)
Log Message:
-----------
Updated
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/create_file.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-27 10:15:29 UTC (rev 12412)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -41,8 +41,12 @@
$handler = TDMCreateArchitecture::getInstance();
$handler->getPath( TDMC_PATH );
$handler->getUploadPath( TDMC_UPLOAD_PATH );
- $handler->getArchitectureFiles( $modules );
-
+ $base_architecture = $handler->getArchitectureFiles( $modules );
+ /*if($base_architecture !== false) { */
+ $GLOBALS['xoopsTpl']->assign('base_architecture', $base_architecture);
+ /*} else {
+ $GLOBALS['xoopsTpl']->assign('base_architecture', false);
+ }*/
// Creation of the structure of folders and files
$GLOBALS['xoopsTpl']->assign('build_list', 'Under new construction - Temporary build');
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-03-27 10:15:29 UTC (rev 12412)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -18,9 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: architecture.php 12258 2014-01-02 09:33:29Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
require_once 'structure.php';
class TDMCreateArchitecture
{
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-03-27 10:15:29 UTC (rev 12412)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -1,266 +0,0 @@
-<?php
-/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-/**
- * tdmcreate module
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: class_files.php 12258 2014-01-02 09:33:29Z timgno $
- */
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
-
-class ClassFiles extends CreateFile
-{
- /*
- * @var null
- */
- public $table = null;
- /*
- * @public function constructor
- * @param string $module
- * @param string $table
- * @param string $file_name
- */
- public function __construct($module, $table, $file_name) {
- $this->module = $module;
- $this->table = $table;
- $this->file_name = $file_name;
- }
- /*
- * @public function getInitVar
- * @param array $type
- * @param string $obj
- */
- public function getInitVar(array $type, $obj = 'INT') {
- $ret = <<<EOT
- \$this->initVar('{$type}', XOBJ_DTYPE_{$obj});
-EOT;
- return $ret;
- }
- /*
- * @public function getInitVars
- * @param array $type
- * @param array $fields
- */
- public function getInitVars($table_fields) {
- $ret = '';
- // Counts the number of fields
- $fields = explode('|', $table_fields);
- $nb_fields = count($fields);
- // Creation of the initVar functions list
- for ($i = 0; $i < $nb_fields; $i++) {
- $type = explode(':', $fields[$i]);
- switch($type[1]) {
- case 'int':
- case 'tinyint':
- case 'mediumint':
- case 'smallint':
- $ret .= $this->getInitVar($type[0], 'INT');
- break;
- case 'char':
- case 'varchar':
- $ret .= $this->getInitVar($type[0], 'TXTBOX');
- break;
- case 'text':
- case 'tinytext':
- case 'mediumtext':
- case 'longtext':
- $ret .= $this->getInitVar($type[0], 'TXTAREA');
- break;
- case 'float':
- $ret .= $this->getInitVar($type[0], 'FLOAT');
- break;
- case 'decimal':
- case 'double':
- $ret .= $this->getInitVar($type[0], 'DECIMAL');
- break;
- case 'enum':
- $ret .= $this->getInitVar($type[0], 'ENUM');
- break;
- case 'email':
- $ret .= $this->getInitVar($type[0], 'EMAIL');
- break;
- case 'url':
- $ret .= $this->getInitVar($type[0], 'URL');
- break;
- case 'date':
- case 'datetime':
- case 'timestamp':
- case 'time':
- case 'year':
- $ret .= $this->getInitVar($type[0], 'LTIME');
- break;
- }
- }
- return $ret;
- }
- /*
- * @public function getHeadClass
- * @param mixed $constructor
- */
- public function getHeadClass($mod_name, $initvar_functions) {
- $ucf_mod_name = ucfirst($mod_name);
- $ucf_table_name = ucfirst($this->table->getVar('table_name'));
- $ret = <<<EOT
-\ndefined('XOOPS_ROOT_PATH') or die("Restricted access");
-/*
- * Class Object {$ucf_mod_name}{$ucf_table_name}
- */
-class {$ucf_mod_name}{$ucf_table_name} extends XoopsObject
-{
- /*
- * Constructor
- *
- * @param null
- */
- function __construct()
- {
- \$this->XoopsObject();
- {$initvar_functions}
-\n\t}
-EOT;
- return $ret;
- }
-
- /*
- * @public function getHeadFunctionForm
- * @param string $form
- */
- public function getHeadFunctionForm($elements_form) {
- $lang_add = $this->getLanguage('_AM_', '_ADD');
- $lang_edit = $this->getLanguage('_AM_', '_EDIT');
- $ret = <<<EOT
- /*
- * Get form
- *
- * @param mixed \$action
- */
- function getForm(\$action = false)
- {
- if (\$action === false) {
- \$action = \$_SERVER['REQUEST_URI'];
- }
-
- \$title = \$this->isNew() ? sprintf({$lang_add}) : sprintf({$lang_edit});
-
- include_once(XOOPS_ROOT_PATH.'/class/xoopsformloader.php');
-
- \$form = new XoopsThemeForm(\$title, 'form', \$action, 'post', true);
- \$form->setExtra('enctype="multipart/form-data"');\n
- {$elements_form}
-EOT;
- return $ret;
- }
- /*
- * @public function getPermissionsInFunctionForm
- * @param string $fpif
- */
- public function getPermissionsInFunctionForm($mod_name, $fpif) {
- $perm_approve = $this->getLanguage('_AM_', '_PERMISSIONS_APPROVE');
- $perm_submit = $this->getLanguage('_AM_', '_PERMISSIONS_SUBMIT');
- $perm_view = $this->getLanguage('_AM_', '_PERMISSIONS_VIEW');
- $ret = <<<EOT
- \n//permissions
- \$member_handler = & xoops_gethandler ( 'member' );
- \$group_list = &\$member_handler->getGroupList();
- \$gperm_handler = &xoops_gethandler ( 'groupperm' );
- \$full_list = array_keys ( \$group_list );
- global \$xoopsModule;
- if ( !\$this->isNew() ) {
- \$groups_ids_approve = \$gperm_handler->getGroupIds ( '{$mod_name}_approve', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
- \$groups_ids_submit = \$gperm_handler->getGroupIds ( '{$mod_name}_submit', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
- \$groups_ids_view = \$gperm_handler->getGroupIds ( '{$mod_name}_view', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
- \$groups_ids_approve = array_values ( \$groups_ids_approve );
- \$groups_can_approve_checkbox = new XoopsFormCheckBox ( {$perm_approve}, 'groups_approve[]', \$groups_ids_approve );
- \$groups_ids_submit = array_values ( \$groups_ids_submit );
- \$groups_can_submit_checkbox = new XoopsFormCheckBox ( {$perm_submit}, 'groups_submit[]', \$groups_ids_submit );
- \$groups_ids_view = array_values ( \$groups_ids_view );
- \$groups_can_view_checkbox = new XoopsFormCheckBox ( {$perm_view}, 'groups_view[]', \$groups_ids_view );
- } else {
- \$groups_can_approve_checkbox = new XoopsFormCheckBox ( {$perm_approve}, 'groups_approve[]', \$full_list );
- \$groups_can_submit_checkbox = new XoopsFormCheckBox ( {$perm_submit}, 'groups_submit[]', \$full_list );
- \$groups_can_view_checkbox = new XoopsFormCheckBox ( {$perm_view}, 'groups_view[]', \$full_list );
- }
-
- // For approve
- \$groups_can_approve_checkbox->addOptionArray ( \$group_list );
- \$form->addElement ( \$groups_can_approve_checkbox );
- // For submit
- \$groups_can_submit_checkbox->addOptionArray ( \$group_list );
- \$form->addElement ( \$groups_can_submit_checkbox );
- // For view
- \$groups_can_view_checkbox->addOptionArray ( \$group_list );
- \$form->addElement ( \$groups_can_view_checkbox );
-EOT;
- return $ret;
- }
- /*
- * @public function getFootFunctionForm
- * @param null
- */
- public function getFootFunctionForm() {
- $ret = <<<EOT
- \n\$form->addElement(new XoopsFormHidden('op', 'save'));
- \$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
- return \$form;
- }
-}\n\n
-EOT;
- return $ret;
- }
- /*
- * @public function getClassHandler
- * @param string $fpif
- * @param string $fpmf
- */
- public function getClassHandler($mod_name, $fpif, $fpmf) {
- $table_name = $this->table->getVar('table_name');
- $ucf_mod_table_handler = ucfirst($mod_name).ucfirst($table_name);
- $ret = <<<EOT
-/*
- * Class Object Handler {$ucf_mod_name}{$ucf_table_name}
- */
-class {$ucf_mod_table_handler}Handler extends XoopsPersistableObjectHandler
-{
- /*
- * Constructor
- *
- * @param string \$db
- */
- function __construct(&\$db)
- {
- parent::__construct(\$db, 'mod_{$mod_name}_{$table_name}', '{$mod_name}{$table_name}', '{$fpif}', '{$fpmf}');
- }
-}
-EOT;
- return $ret;
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module_name = $this->getModuleName();
- $table_fields = $this->table->getVar('table_fields');
- $initvar = $this->getInitVars($table_fields);
- $ret = $this->getHeadClass($module_name, $initvar);
- $ret .= $this->getHeadFunctionForm($form);
- $ret .= $this->getPermissionsInFunctionForm($module_name, $fpif);
- $ret .= $this->getFootFunctionForm();
- $ret .= $this->getClassHandler($module_name, $fpif, $fpmf);
- return $ret;
- }
-}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -0,0 +1,266 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: class_files.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+if (!defined('XOOPS_ROOT_PATH')) {
+ die('XOOPS root path not defined');
+}
+
+class ClassFiles extends CreateFile
+{
+ /*
+ * @var null
+ */
+ public $table = null;
+ /*
+ * @public function constructor
+ * @param string $module
+ * @param string $table
+ * @param string $file_name
+ */
+ public function __construct($module, $table, $file_name) {
+ $this->module = $module;
+ $this->table = $table;
+ $this->file_name = $file_name;
+ }
+ /*
+ * @public function getInitVar
+ * @param array $type
+ * @param string $obj
+ */
+ public function getInitVar(array $type, $obj = 'INT') {
+ $ret = <<<EOT
+ \$this->initVar('{$type}', XOBJ_DTYPE_{$obj});
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getInitVars
+ * @param array $type
+ * @param array $fields
+ */
+ public function getInitVars($table_fields) {
+ $ret = '';
+ // Counts the number of fields
+ $fields = explode('|', $table_fields);
+ $nb_fields = count($fields);
+ // Creation of the initVar functions list
+ for ($i = 0; $i < $nb_fields; $i++) {
+ $type = explode(':', $fields[$i]);
+ switch($type[1]) {
+ case 'int':
+ case 'tinyint':
+ case 'mediumint':
+ case 'smallint':
+ $ret .= $this->getInitVar($type[0], 'INT');
+ break;
+ case 'char':
+ case 'varchar':
+ $ret .= $this->getInitVar($type[0], 'TXTBOX');
+ break;
+ case 'text':
+ case 'tinytext':
+ case 'mediumtext':
+ case 'longtext':
+ $ret .= $this->getInitVar($type[0], 'TXTAREA');
+ break;
+ case 'float':
+ $ret .= $this->getInitVar($type[0], 'FLOAT');
+ break;
+ case 'decimal':
+ case 'double':
+ $ret .= $this->getInitVar($type[0], 'DECIMAL');
+ break;
+ case 'enum':
+ $ret .= $this->getInitVar($type[0], 'ENUM');
+ break;
+ case 'email':
+ $ret .= $this->getInitVar($type[0], 'EMAIL');
+ break;
+ case 'url':
+ $ret .= $this->getInitVar($type[0], 'URL');
+ break;
+ case 'date':
+ case 'datetime':
+ case 'timestamp':
+ case 'time':
+ case 'year':
+ $ret .= $this->getInitVar($type[0], 'LTIME');
+ break;
+ }
+ }
+ return $ret;
+ }
+ /*
+ * @public function getHeadClass
+ * @param mixed $constructor
+ */
+ public function getHeadClass($mod_name, $initvar_functions) {
+ $ucf_mod_name = ucfirst($mod_name);
+ $ucf_table_name = ucfirst($this->table->getVar('table_name'));
+ $ret = <<<EOT
+\ndefined('XOOPS_ROOT_PATH') or die("Restricted access");
+/*
+ * Class Object {$ucf_mod_name}{$ucf_table_name}
+ */
+class {$ucf_mod_name}{$ucf_table_name} extends XoopsObject
+{
+ /*
+ * Constructor
+ *
+ * @param null
+ */
+ function __construct()
+ {
+ \$this->XoopsObject();
+ {$initvar_functions}
+\n\t}
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getHeadFunctionForm
+ * @param string $form
+ */
+ public function getHeadFunctionForm($elements_form) {
+ $lang_add = $this->getLanguage('_AM_', '_ADD');
+ $lang_edit = $this->getLanguage('_AM_', '_EDIT');
+ $ret = <<<EOT
+ /*
+ * Get form
+ *
+ * @param mixed \$action
+ */
+ function getForm(\$action = false)
+ {
+ if (\$action === false) {
+ \$action = \$_SERVER['REQUEST_URI'];
+ }
+
+ \$title = \$this->isNew() ? sprintf({$lang_add}) : sprintf({$lang_edit});
+
+ include_once(XOOPS_ROOT_PATH.'/class/xoopsformloader.php');
+
+ \$form = new XoopsThemeForm(\$title, 'form', \$action, 'post', true);
+ \$form->setExtra('enctype="multipart/form-data"');\n
+ {$elements_form}
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getPermissionsInFunctionForm
+ * @param string $fpif
+ */
+ public function getPermissionsInFunctionForm($mod_name, $fpif) {
+ $perm_approve = $this->getLanguage('_AM_', '_PERMISSIONS_APPROVE');
+ $perm_submit = $this->getLanguage('_AM_', '_PERMISSIONS_SUBMIT');
+ $perm_view = $this->getLanguage('_AM_', '_PERMISSIONS_VIEW');
+ $ret = <<<EOT
+ \n//permissions
+ \$member_handler = & xoops_gethandler ( 'member' );
+ \$group_list = &\$member_handler->getGroupList();
+ \$gperm_handler = &xoops_gethandler ( 'groupperm' );
+ \$full_list = array_keys ( \$group_list );
+ global \$xoopsModule;
+ if ( !\$this->isNew() ) {
+ \$groups_ids_approve = \$gperm_handler->getGroupIds ( '{$mod_name}_approve', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
+ \$groups_ids_submit = \$gperm_handler->getGroupIds ( '{$mod_name}_submit', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
+ \$groups_ids_view = \$gperm_handler->getGroupIds ( '{$mod_name}_view', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
+ \$groups_ids_approve = array_values ( \$groups_ids_approve );
+ \$groups_can_approve_checkbox = new XoopsFormCheckBox ( {$perm_approve}, 'groups_approve[]', \$groups_ids_approve );
+ \$groups_ids_submit = array_values ( \$groups_ids_submit );
+ \$groups_can_submit_checkbox = new XoopsFormCheckBox ( {$perm_submit}, 'groups_submit[]', \$groups_ids_submit );
+ \$groups_ids_view = array_values ( \$groups_ids_view );
+ \$groups_can_view_checkbox = new XoopsFormCheckBox ( {$perm_view}, 'groups_view[]', \$groups_ids_view );
+ } else {
+ \$groups_can_approve_checkbox = new XoopsFormCheckBox ( {$perm_approve}, 'groups_approve[]', \$full_list );
+ \$groups_can_submit_checkbox = new XoopsFormCheckBox ( {$perm_submit}, 'groups_submit[]', \$full_list );
+ \$groups_can_view_checkbox = new XoopsFormCheckBox ( {$perm_view}, 'groups_view[]', \$full_list );
+ }
+
+ // For approve
+ \$groups_can_approve_checkbox->addOptionArray ( \$group_list );
+ \$form->addElement ( \$groups_can_approve_checkbox );
+ // For submit
+ \$groups_can_submit_checkbox->addOptionArray ( \$group_list );
+ \$form->addElement ( \$groups_can_submit_checkbox );
+ // For view
+ \$groups_can_view_checkbox->addOptionArray ( \$group_list );
+ \$form->addElement ( \$groups_can_view_checkbox );
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getFootFunctionForm
+ * @param null
+ */
+ public function getFootFunctionForm() {
+ $ret = <<<EOT
+ \n\$form->addElement(new XoopsFormHidden('op', 'save'));
+ \$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
+ return \$form;
+ }
+}\n\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getClassHandler
+ * @param string $fpif
+ * @param string $fpmf
+ */
+ public function getClassHandler($mod_name, $fpif, $fpmf) {
+ $table_name = $this->table->getVar('table_name');
+ $ucf_mod_table_handler = ucfirst($mod_name).ucfirst($table_name);
+ $ret = <<<EOT
+/*
+ * Class Object Handler {$ucf_mod_name}{$ucf_table_name}
+ */
+class {$ucf_mod_table_handler}Handler extends XoopsPersistableObjectHandler
+{
+ /*
+ * Constructor
+ *
+ * @param string \$db
+ */
+ function __construct(&\$db)
+ {
+ parent::__construct(\$db, 'mod_{$mod_name}_{$table_name}', '{$mod_name}{$table_name}', '{$fpif}', '{$fpmf}');
+ }
+}
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module_name = $this->getModuleName();
+ $table_fields = $this->table->getVar('table_fields');
+ $initvar = $this->getInitVars($table_fields);
+ $ret = $this->getHeadClass($module_name, $initvar);
+ $ret .= $this->getHeadFunctionForm($form);
+ $ret .= $this->getPermissionsInFunctionForm($module_name, $fpif);
+ $ret .= $this->getFootFunctionForm();
+ $ret .= $this->getClassHandler($module_name, $fpif, $fpmf);
+ return $ret;
+ }
+}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/create_file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/create_file.php 2014-03-27 10:15:29 UTC (rev 12412)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/create_file.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -1,93 +0,0 @@
-<?php
-/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-/**
- * tdmcreate module
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package tdmcreate
- * @since 2.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: create_file.php 12258 2014-01-02 09:33:29Z timgno $
- */
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
-
-class CreateFile extends HeaderFile
-{
- /*
- * @var string
- */
- public $content = null;
- /*
- * @var string
- */
- public $file_path = null;
- /*
- * @public function constructor
- * @param string $content
- */
- public function __construct($path, $content, $lng_ok, $lng_notok, $file_name, $class = 'even', $mode = 'w+') {
- $this->path .= $path;
- $this->content = $content;
- $this->lng_ok = $lng_ok;
- $this->lng_notok = $lng_notok;
- $this->file_name = $file_name;
- $this->_class = $class;
- $this->mode = $mode;
- //$this->file_path = $this->getHeader($path, $module, $folder, $file_name);
- }
- /*
- * @static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function renderFile
- * @param null
- */
- public function renderFile()
- {
- $path = $this->path;
- $content = $this->content;
- $lng_ok = $this->lng_ok;
- $lng_notok = $this->lng_notok;
- $file_name = $this->file_name;
- $class = $this->_class;
- $handle = XoopsFile::getHandler();
- $handle->__construct($path, false);
- // Integration of the content of file
- if ($handle->open($this->mode) == false) {
- $GLOBALS['xoopsTpl']->assign('lng_notok', sprintf($this->lng_notok, $this->file_name));
- return false;
- }
- if ($handle->is_writable($path))
- {
- if ($handle->write($this->content) == false) {
- $GLOBALS['xoopsTpl']->assign('lng_notok', sprintf($this->lng_notok, $this->file_name));
- exit;
- }
- $GLOBALS['xoopsTpl']->assign('lng_ok', sprintf($this->lng_ok, $this->file_name));
- $handle->close();
- } else {
- $GLOBALS['xoopsTpl']->assign('lng_notok', sprintf($this->lng_notok, $this->file_name));
- }
- return $GLOBALS['xoopsTpl']->fetch("db:tdmcreate_building.html");
- }
-}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -0,0 +1,203 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: file.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class TDMCreateFile
+{
+ /*
+ * @var string
+ */
+ private $xoopsfile = null;
+
+ /*
+ * @var string
+ */
+ private $path = null;
+
+ /*
+ * @var string
+ */
+ private $folder_name = null;
+
+ /*
+ * @var string
+ */
+ private $file_name = null;
+
+ /*
+ * @var string
+ */
+ private $content = null;
+
+ /*
+ * @var mixed
+ */
+ private $created = false;
+
+ /*
+ * @var mixed
+ */
+ private $notcreated = false;
+
+ /*
+ * @var string
+ */
+ private $mode = null;
+
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ $this->xoopsfile = XoopsFile::getHandler();
+ }
+
+ /*
+ * @public static function &getInstance
+ * @param null
+ */
+ public static function &getInstance() {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+
+ /*
+ * @public function constructor
+ * @param string $content
+ */
+ public function create($path, $folder_name, $file_name, $content = '', $created = false, $notcreated = false, $mode = 'w+') {
+ $this->folder_name = $folder_name;
+ $this->file_name = $file_name;
+ $this->created = $created;
+ $this->notcreated = $notcreated;
+ $this->mode = $mode;
+ if(isset($path)){
+ $this->setPath($path);
+ }
+ if(isset($content)){
+ $this->setContent($content);
+ }
+ }
+
+ /*
+ * @private function setPath
+ * @param string $path
+ */
+ private function setPath($path) {
+ $this->path = $path;
+ }
+
+ /*
+ * @private function getPath
+ * @param null
+ */
+ private function getPath() {
+ return $this->path;
+ }
+
+ /*
+ * @private function setContent
+ * @param string $content
+ */
+ private function setContent($content) {
+ $this->content = $content;
+ }
+
+ /*
+ * @private function setContent
+ * @param null
+ */
+ private function getContent() {
+ return $this->content;
+ }
+
+ /*
+ * @private function getFolderName
+ * @param null
+ */
+ private function getFolderName() {
+ return $this->folder_name;
+ }
+
+ /*
+ * @private function getFileName
+ * @param null
+ */
+ private function getFileName() {
+ return $this->file_name;
+ }
+
+ /*
+ * @private function getCreated
+ * @param null
+ */
+ private function getCreated() {
+ return $this->created;
+ }
+
+ /*
+ * @private function getNotCreated
+ * @param null
+ */
+ private function getNotCreated() {
+ return $this->notcreated;
+ }
+
+ /*
+ * @private function getMode
+ * @param null
+ */
+ private function getMode() {
+ return $this->mode;
+ }
+
+ /*
+ * @public function renderFile
+ * @param null
+ */
+ public function renderFile() {
+ $path = $this->getPath();
+ $folder_name = $this->getFolderName();
+ $file_name = $this->getFileName();
+ $created = $this->getCreated();
+ $notcreated = $this->getNotCreated();
+ $this->xoopsfile->__construct($path);
+ // Integration of the content of file
+ if($this->xoopsfile->open($this->getMode()) == false) {
+ $GLOBALS['xoopsTpl']->assign('notcreated', sprintf($notcreated, $file_name, $folder_name));
+ return false;
+ }
+ if($this->xoopsfile->is_writable($path)) {
+ if ($this->xoopsfile->write($this->getContent()) == false) {
+ $GLOBALS['xoopsTpl']->assign('notcreated', sprintf($notcreated, $file_name, $folder_name));
+ exit;
+ }
+ $GLOBALS['xoopsTpl']->assign('created', sprintf($created, $file_name, $folder_name));
+ $this->xoopsfile->close();
+ } else {
+ $GLOBALS['xoopsTpl']->assign('notcreated', sprintf($notcreated, $file_name, $folder_name));
+ }
+ return $GLOBALS['xoopsTpl']->fetch("db:tdmcreate_building.html");
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php 2014-03-27 10:15:29 UTC (rev 12412)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -18,9 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: structure.php 12258 2014-01-02 09:33:29Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
xoops_load('XoopsFile');
class TDMCreateStructure
{
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-03-27 10:15:29 UTC (rev 12412)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -166,8 +166,7 @@
$form->addElement($imgtray);
//---------- START -----------------
- ?>
-
+ ?>
<script type="text/javascript">
function showImgSelected2(imgId, selectId, imgDir, extra, xoopsUrl) {
@@ -179,7 +178,7 @@
if (selectDom.options[selectDom.selectedIndex].value != "") {
imgDom.src = xoops...
[truncated message content] |
|
From: <txm...@us...> - 2014-03-29 00:44:44
|
Revision: 12416
http://sourceforge.net/p/xoops/svn/12416
Author: txmodxoops
Date: 2014-03-29 00:44:39 +0000 (Sat, 29 Mar 2014)
Log Message:
-----------
Updated
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-28 20:15:39 UTC (rev 12415)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-29 00:44:39 UTC (rev 12416)
@@ -42,9 +42,7 @@
unset($criteria);
// Display modules list
if ($numrows>0)
- {
- $yes = "<img src='../images/icons/16/green.png' alt='"._YES."' title='"._YES."' />";
- $no = "<img src='../images/icons/16/red.png' alt='"._NO."' title='"._NO."' />";
+ {
foreach (array_keys($mods_arr) as $i)
{
$mod['mod_id'] = $i;
@@ -53,12 +51,12 @@
$mod['mod_image'] = $mods_arr[$i]->getVar('mod_image');
$mod['mod_release'] = $mods_arr[$i]->getVar('mod_release');
$mod['mod_status'] = $mods_arr[$i]->getVar('mod_status');
- $mod['mod_admin'] = ( $mods_arr[$i]->getVar('mod_admin') == 1 ) ? $yes : $no;
- $mod['mod_user'] = ( $mods_arr[$i]->getVar('mod_user') == 1 ) ? $yes : $no;
- $mod['mod_submenu'] = ( $mods_arr[$i]->getVar('mod_submenu') == 1 ) ? $yes : $no;
- $mod['mod_search'] = ( $mods_arr[$i]->getVar('mod_search') == 1 ) ? $yes : $no;
- $mod['mod_comments'] = ( $mods_arr[$i]->getVar('mod_comments') == 1 ) ? $yes : $no;
- $mod['mod_notifications'] = ( $mods_arr[$i]->getVar('mod_notifications') == 1 ) ? $yes : $no;
+ $mod['mod_admin'] = $mods_arr[$i]->getVar('mod_admin');
+ $mod['mod_user'] = $mods_arr[$i]->getVar('mod_user');
+ $mod['mod_submenu'] = $mods_arr[$i]->getVar('mod_submenu');
+ $mod['mod_search'] = $mods_arr[$i]->getVar('mod_search');
+ $mod['mod_comments'] = $mods_arr[$i]->getVar('mod_comments');
+ $mod['mod_notifications'] = $mods_arr[$i]->getVar('mod_notifications');
$GLOBALS['xoopsTpl']->append('modules_list', $mod);
unset($mod);
}
@@ -186,6 +184,48 @@
} else {
xoops_confirm(array('ok' => 1, 'mod_id' => $_REQUEST['mod_id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('mod_name')));
}
- break;
+ break;
+
+ case 'toggle':
+ if (isset($_GET['mod_id'])) {
+ $mod_id = intval($_GET['mod_id']);
+ if (isset($_GET['mod_admin'])) {
+ $mod_admin = intval($_GET['mod_admin']);
+ $mod_admin = ($mod_admin == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj->setVar('mod_admin', $mod_admin);
+ } elseif (isset($_GET['mod_user'])) {
+ $mod_user = intval($_GET['mod_user']);
+ $mod_user = ($mod_user == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj->setVar('mod_user', $mod_user);
+ } elseif (isset($_GET['mod_submenu'])) {
+ $mod_submenu = intval($_GET['mod_submenu']);
+ $mod_submenu = ($mod_submenu == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj->setVar('mod_submenu', $mod_submenu);
+ } elseif (isset($_GET['mod_search'])) {
+ $mod_search = intval($_GET['mod_search']);
+ $mod_search = ($mod_search == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj->setVar('mod_search', $mod_search);
+ } elseif (isset($_GET['mod_comments'])) {
+ $mod_comments = intval($_GET['mod_comments']);
+ $mod_comments = ($mod_comments == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj->setVar('mod_comments', $mod_comments);
+ } elseif (isset($_GET['mod_notifications'])) {
+ $mod_notifications = intval($_GET['mod_notifications']);
+ $mod_notifications = ($mod_notifications == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj->setVar('mod_notifications', $mod_notifications);
+ }
+ if ($modulesHandler->insert($obj, true)) {
+ redirect_header('modules.php', 1, _AM_TDMCREATE_MODULE_TOGGLE_SUCCESS);
+ } else {
+ redirect_header('modules.php', 1, _AM_TDMCREATE_MODULE_TOGGLE_FAILED);
+ }
+ }
+ break;
}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-28 20:15:39 UTC (rev 12415)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-29 00:44:39 UTC (rev 12416)
@@ -59,20 +59,18 @@
unset($criteria);
// Display modules list
if ( $numrows_modules > 0 )
- {
- $_yyes = "<img src='../images/icons/16/yellow.png' alt='"._YES."' title='"._YES."' />";
- $_no = "<img src='../images/icons/16/red.png' alt='"._NO."' title='"._NO."' />";
+ {
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') == 1 ) ? $_yyes : $_no;
- $mod['user'] = ( $mods_arr[$i]->getVar('mod_user') == 1 ) ? $_yyes : $_no;
- $mod['submenu'] = ( $mods_arr[$i]->getVar('mod_submenu') == 1 ) ? $_yyes : $_no;
- $mod['search'] = ( $mods_arr[$i]->getVar('mod_search') == 1 ) ? $_yyes : $_no;
- $mod['comments'] = ( $mods_arr[$i]->getVar('mod_comments') == 1 ) ? $_yyes : $_no;
- $mod['notifications'] = ( $mods_arr[$i]->getVar('mod_notifications') == 1 ) ? $_yyes : $_no;
+ $mod['admin'] = $mods_arr[$i]->getVar('mod_admin');
+ $mod['user'] = $mods_arr[$i]->getVar('mod_user');
+ $mod['submenu'] = $mods_arr[$i]->getVar('mod_submenu');
+ $mod['search'] = $mods_arr[$i]->getVar('mod_search');
+ $mod['comments'] = $mods_arr[$i]->getVar('mod_comments');
+ $mod['notifications'] = $mods_arr[$i]->getVar('mod_notifications');
// Get the list of tables
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $i));
@@ -85,7 +83,6 @@
$tables = array();
if ( $numrows_tables > 0 )
{
- $_yes = "<img src='../images/icons/16/green.png' alt='"._YES."' title='"._YES."' />";
foreach (array_keys($tables_arr) as $t)
{
$table['id'] = $t;
@@ -93,13 +90,13 @@
$table['name'] = $tables_arr[$t]->getVar('table_name');
$table['image'] = $tables_arr[$t]->getVar('table_image');
$table['nbfields'] = $tables_arr[$t]->getVar('table_nbfields');
- $table['blocks'] = ( $tables_arr[$t]->getVar('table_blocks') == 1 ) ? $_yes : $_no;
- $table['admin'] = ( $tables_arr[$t]->getVar('table_admin') == 1 ) ? $_yes : $_no;
- $table['user'] = ( $tables_arr[$t]->getVar('table_user') == 1 ) ? $_yes : $_no;
- $table['submenu'] = ( $tables_arr[$t]->getVar('table_submenu') == 1 ) ? $_yes : $_no;
- $table['search'] = ( $tables_arr[$t]->getVar('table_search') == 1 ) ? $_yes : $_no;
- $table['comments'] = ( $tables_arr[$t]->getVar('table_comments') == 1 ) ? $_yes : $_no;
- $table['notifications'] = ( $tables_arr[$t]->getVar('table_notifications') == 1 ) ? $_yes : $_no;
+ $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');
$tables[] = $table;
unset($table);
}
@@ -216,6 +213,53 @@
} else {
xoops_confirm(array('ok' => 1, 'table_id' => $_REQUEST['table_id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('table_name')));
}
- break;
+ break;
+
+ case 'toggle':
+ if (isset($_GET['table_id'])) {
+ $table_id = intval($_GET['table_id']);
+ if (isset($_GET['table_blocks'])) {
+ $table_blocks = intval($_GET['table_blocks']);
+ $table_blocks = ($table_blocks == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj->setVar('table_blocks', $table_blocks);
+ } elseif (isset($_GET['table_admin'])) {
+ $table_admin = intval($_GET['table_admin']);
+ $table_admin = ($table_admin == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj->setVar('table_admin', $table_admin);
+ } elseif (isset($_GET['table_user'])) {
+ $table_user = intval($_GET['table_user']);
+ $table_user = ($table_user == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($_REQUEST['table_id']);
+ $obj->setVar('table_user', $table_user);
+ } elseif (isset($_GET['table_submenu'])) {
+ $table_submenu = intval($_GET['table_submenu']);
+ $table_submenu = ($table_submenu == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($_REQUEST['table_id']);
+ $obj->setVar('table_submenu', $table_submenu);
+ } elseif (isset($_GET['table_search'])) {
+ $table_search = intval($_GET['table_search']);
+ $table_search = ($table_search == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($_REQUEST['table_id']);
+ $obj->setVar('table_search', $table_search);
+ } elseif (isset($_GET['table_comments'])) {
+ $table_comments = intval($_GET['table_comments']);
+ $table_comments = ($table_comments == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($_REQUEST['table_id']);
+ $obj->setVar('table_comments', $table_comments);
+ } elseif (isset($_GET['table_notifications'])) {
+ $table_notifications = intval($_GET['table_notifications']);
+ $table_notifications = ($table_notifications == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($_REQUEST['table_id']);
+ $obj->setVar('table_notifications', $table_notifications);
+ }
+ if ($modulesHandler->insert($obj, true)) {
+ redirect_header('tables.php', 1, _AM_TDMCREATE_TABLE_TOGGLE_SUCCESS);
+ } else {
+ redirect_header('tables.php', 1, _AM_TDMCREATE_TABLE_TOGGLE_FAILED);
+ }
+ }
+ break;
}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-03-28 20:15:39 UTC (rev 12415)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-03-29 00:44:39 UTC (rev 12416)
@@ -35,11 +35,6 @@
/*
* @var string
*/
- private $folder_name = null;
-
- /*
- * @var string
- */
private $file_name = null;
/*
@@ -86,8 +81,7 @@
* @public function constructor
* @param string $content
*/
- public function create($path, $folder_name, $file_name, $content = '', $created = false, $notcreated = false, $mode = 'w+') {
- $this->folder_name = $folder_name;
+ public function create($path, $file_name, $content = '', $created = false, $notcreated = false, $mode = 'w+') {
$this->file_name = $file_name;
$this->created = $created;
$this->notcreated = $notcreated;
@@ -137,7 +131,14 @@
* @param null
*/
private function getFolderName() {
- return $this->folder_name;
+ $path = $this->path();
+ if(strrpos($path, "/"))
+ {
+ $str = strrpos($path, '/');
+ if($str !== false){
+ return substr($path, $str + 1, strlen($path));
+ }
+ }
}
/*
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin/style.css
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin/style.css 2014-03-28 20:15:39 UTC (rev 12415)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin/style.css 2014-03-29 00:44:39 UTC (rev 12416)
@@ -1,224 +1,35 @@
@charset "UTF-8";
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
/**
- * MyLinks module
+ * tdmcreate module
*
- * You may not change or alter any portion of this comment or credits
- * of supporting developers from this source code or any supporting source code
- * which is considered copyrighted (c) material of the original comment or credit authors.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @copyright:: The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license:: http://www.fsf.org/copyleft/gpl.html GNU public license
- * @package:: mylinks
- * @since:: 2.5.0
- * @author: kris <http://www.xoofoo.org>
- * @version:: $Id $
-**/
-#Slideshow_Title {
- font-size: 20px;
- color: #393e41;
- height: 50px;
- border-bottom: 1px solid #393e41;
- margin-bottom: 5px;
- line-height: 50px;
- background-position: left top;
- background-repeat: no-repeat;
- /*text-shadow: 0 1px 0 #eee,
- 0 2px 0 #e9e9e9,
- 0 3px 0 #ddd,
- 0 4px 0 #d9d9d9,
- 0 5px 0 #ccc,
- 0 6px 1px rgba(0,0,0,.1),
- 0 0 5px rgba(0,0,0,.1),
- 0 1px 3px rgba(0,0,0,.3),
- 0 3px 5px rgba(0,0,0,.2),
- 0 5px 10px rgba(0,0,0,.35),
- 0 10px 10px rgba(0,0,0,.2);*/
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: style.css 12258 2014-01-02 09:33:29Z timgno $
+ */
+/* Toggle lists */
+tr.toggleMain td {
+ display: block;
}
-.Slideshow_MediumTitle {
- font-size: 14px;
- color: #393e41;
- /*text-shadow: 0 1px 0 #eee,
- 0 2px 0 #e9e9e9,
- 0 3px 0 #ddd,
- 0 4px 0 #d9d9d9,
- 0 5px 0 #ccc,
- 0 6px 1px rgba(0,0,0,.1),
- 0 0 5px rgba(0,0,0,.1),
- 0 1px 3px rgba(0,0,0,.3),
- 0 3px 5px rgba(0,0,0,.2),
- 0 5px 10px rgba(0,0,0,.35),
- 0 10px 10px rgba(0,0,0,.2);*/
-}
-/* Index page */
-#Slideshow_Index {
- float: left;
- padding: 0 0 0 60px;
- background-image: url(../images/admin/index.png);
- background-position: left top;
- background-repeat: no-repeat;
-}
-/* Help page */
-#Slideshow_Help {
- float: left;
- padding: 0 0 0 60px;
- background-image: url(../images/admin/help.png);
- background-position: left top;
- background-repeat: no-repeat;
-}
-/* About page */
-#Slideshow_About {
- float: left;
- padding: 0 0 0 60px;
- background-image: url(../images/admin/about.png);
- background-position: left top;
- background-repeat: no-repeat;
-}
-#about fieldset {
- margin: 10px;
- padding: 5px;
-}
-#about legend {
- margin: 0 5px;
- padding: 0 5px 8px 5px;
-}
-#about label, #about text {
- display: block;
- float: left;
- margin-bottom: 12px;
-}
-#about label {
- text-align: right;
- width: 200px;
- padding-right: 20px;
-}
-#about br { clear: both;}
-#about .txtchangelog { height:350px; overflow:auto;}
-fieldset p { margin-bottom: .5em;}
-
-#myid {}
-
-/* Buttons style */
-.xo-buttons a, .xo-buttons button{
- display:block-inline;
- margin:0 5px 0 0;
- background: #e4e4e5 url('../images/admin/bg_button.gif') repeat-x;
- border:1px solid #d6d6d6;
- border-top:1px solid #dedede;
- border-left:1px solid #dedede;
- font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
- font-size:100%;
- line-height:110%;
- text-decoration:none;
- font-weight:bold;
- color:#454545;
- cursor:pointer;
- padding:3px 8px 4px 5px; /* Links */
+.toggleChild {
+ display: none;
}
-.xo-buttons a:hover, .xo-buttons button:hover {
- border:1px solid #ccc;
- border-top:1px solid #d6d6d6;
- border-left:1px solid #d6d6d6;
-}
-.xo-buttons button{
- width:auto;
- overflow:visible;
- padding:3px 8px 4px 5px; /* IE6 */
-}
-.xo-buttons button[type]{
- padding:3px 5px 4px 5px; /* Firefox */
- line-height:15px; /* Safari */
-}
-*:first-child+html button[type]{
- padding:3px 8px 4px 5px; /* IE7 */
-}
-.xo-buttons button img, .xo-buttons a img{
- margin:0 3px -3px 0 !important;
- padding:0;
- border:none;
- width:16px;
- height:16px;
-}
-.ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; }
-/* Buttons style */
-/* align */
-.floatright{ float:right; margin:0; padding:2px; border:0; }
-.floatleft{ float:left; margin:0; padding:2px; border:0; }
-.aligncenter{ text-align:center; margin:0; padding:2px; border:0; }
-/* align */
-
-/* label */
-.label{font-size: 16px; color: #2F5376; font-weight: bold;}
-
-/* label */
-
-/* menu */
-div.rmmenuicon{
- margin: 3px;
- font-family: Tahoma, Arial, Helvetica;
- text-align: center;
+img.imageToggle {
+ width: 16px;
+ height: 16px;
}
-div.rmmenuicon a {
- display: block; float: left;
- height: 75px !important;
- height: 75px;
- width: 75px !important;
- width: 75px;
- vertical-align: middle;
- text-decoration : none;
- border: 1px solid #CCCCCC;
- padding: 2px 5px 1px 5px;
- margin: 3px;
- color: #666666;
- background-color: #f0f0f0;
- -moz-border-radius: 6px;
- -webkit-border-radius: 6px;
- -khtml-border-radius: 6px;
- border-radius: 6px;
-
-
-}
-div.rmmenuicon img { margin-top: 8px; margin-bottom: 8px; }
-div.rmmenuicon a span {
- font-size: 11px;
- font-weight: bold;
- display: block;
-}
-div.rmmenuicon a:hover{
- background-color: #FFF6C1;
- border: 1px solid #FF9900;
- color: #1E90FF;
-}
-div.rmmenuicon a:hover span{
- text-decoration: none;
-}
-
-div.CPbigTitle{
- font-size: 12px;
- color: #606060;
- background: no-repeat left top;
- font-weight: bold;
- height: 30px;
- vertical-align: middle;
- padding: 5px 0 0 40px;
- border-bottom: 1px solid #393e41;
-}
-/* menu */
-
-.txtchangelog { height:350px; overflow:auto;}
-
-
-tr.toggleTables td {
- /* display: none;*/
-}
-
-.toggleHidden {
- display: none;
-}
-
.width6{ width: 6%; }
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js 2014-03-28 20:15:39 UTC (rev 12415)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js 2014-03-29 00:44:39 UTC (rev 12416)
@@ -82,10 +82,11 @@
*/
$(document).ready( function() {
- $('.toggleTables').click( function(e) {
+ $('tr').find('img.imageToggle').on('click', function(e) {
e.preventDefault();
- $(this).nextAll('tr').each( function() {
- if ($(this).is('.toggleTables')) {
+ /*$('tr.toggleChild').toggle();*/
+ $(this).nextAll('tr.toggleChild').each( function() {
+ if ($(this).is('.toggleMain')) {
return false;
}
$(this).toggle();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-03-28 20:15:39 UTC (rev 12415)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-03-29 00:44:39 UTC (rev 12416)
@@ -253,10 +253,10 @@
define('_AM_TDMCREATE_CONST_TABLES', "Select the table you want to build");
//Creation
//OK
-define('_AM_TDMCREATE_CONST_OK_ARCHITECTURE', "<span class='green'>The structure of the module was created (index.html, folders, ...)</span>");
+define('_AM_TDMCREATE_CONST_OK_ARCHITECTURE', "<span class='green'>The structure of the module was created (index.html, folders, icons, docs files)</span>");
define('_AM_TDMCREATE_CONST_OK_FILE_IN_FOLDER', "The file <b>%s</b> is created in the <span class='green bold'>%s</span> of module");
//NOTOK
-define('_AM_TDMCREATE_CONST_NOTOK_ARCHITECTURE', "<span class='red'>Problems: Creating the structure of the module (index.html, icons ,...)</span>");
+define('_AM_TDMCREATE_CONST_NOTOK_ARCHITECTURE', "<span class='red'>Problems: Creating the structure of the module (index.html, folders, icons, docs files)</span>");
define('_AM_TDMCREATE_CONST_NOTOK_FILE_IN_FOLDER', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>%s</span> of module");
//------------ new additions: Ver. 1.11 -----------------------
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html 2014-03-28 20:15:39 UTC (rev 12415)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html 2014-03-29 00:44:39 UTC (rev 12416)
@@ -3,7 +3,8 @@
<!-- Display tables list -->
<{if $tables_list}>
<table width='100%' cellspacing='1' class='outer'>
- <tr>
+ <thead>
+ <tr>
<th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_ID}></th>
<th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_NAME}></th>
<th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_IMAGE}></th>
@@ -16,12 +17,14 @@
<th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_COMMENTS_LIST}></th>
<th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_NOTIFICATIONS_LIST}></th>
<th class='center width10'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th>
- </tr>
+ </tr>
+ </thead>
+ <tbody>
<{foreach item=table from=$tables_list}>
- <tr class="<{cycle values='even,odd'}>">
- <td class='center'><{$table.id}></td>
+ <tr class="<{cycle values='even,odd'}> toggleMain">
+ <td class='center'><{$table.id}><br /><img src="<{$tdmc_url}>/images/icons/16/toggle.png" alt="Toggle" title="Toggle" /></td>
<td class='center'><{$table.name}></td>
- <td class='center'><img src="<{$pathIcon32}>/<{$table.image}>" alt="<{$table.name}>" height="32" /></td>
+ <td class='center'><img src="<{$pathIcon32}>/<{$table.image}>" alt="<{$table.name}>" height="30" /></td>
<td class='center'><{$table.nbfields}></td>
<td class='center'><{$table.blocks}></td>
<td class='center'><{$table.admin}></td>
@@ -42,7 +45,16 @@
</a>
</td>
</tr>
+ <{foreach item=field from=$table.fields}>
+ <tr class="<{cycle values='even,odd'}> toggleChild">
+ <td class='center'><{$field.id}></td>
+ <td class='center'><{$field.name}></td>
+ <td class='center'><img src="<{$pathIcon32}>/<{$field.image}>" alt="<{$field.name}>" height="30" /></td>
+ <td class='center'></td>
+ </tr>
+ <{/foreach}>
<{/foreach}>
+ </tbody>
</table><br /><br />
<!-- Display modules navigation -->
<div class="clear"> </div>
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html 2014-03-28 20:15:39 UTC (rev 12415)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html 2014-03-29 00:44:39 UTC (rev 12416)
@@ -26,13 +26,36 @@
<td class='center'><img src="<{$tdmc_upload_imgmod_url}>/<{$module.mod_image}>" height="32" /></td>
<td class='center'><{$module.mod_release}></td>
<td class='center'><{$module.mod_status}></td>
- <td class='center'><{$module.mod_admin}></td>
- <td class='center'><{$module.mod_user}></td>
- <td class='center'><{$module.mod_submenu}></td>
- <td class='center'><{$module.mod_search}></td>
- <td class='center'><{$module.mod_comments}></td>
- <td class='center'><{$module.mod_notifications}></td>
-
+ <td class='center'>
+ <a href="modules.php?op=toggle&mod_admin=<{$module.mod_admin}>&mod_id=<{$module.mod_id}>" title="<{$smarty.const._AM_TDMCREATE_MODULE_TOGGLE}>">
+ <img src="<{xoModuleIcons16}><{$module.mod_admin}>.png" alt="<{$smarty.const._AM_TDMCREATE_MODULE_TOGGLE}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="modules.php?op=toggle&mod_user=<{$module.mod_user}>&mod_id=<{$module.mod_id}>" title="<{$smarty.const._AM_TDMCREATE_MODULE_TOGGLE}>">
+ <img src="<{xoModuleIcons16}><{$module.mod_user}>.png" alt="<{$smarty.const._AM_TDMCREATE_MODULE_TOGGLE}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="modules.php?op=toggle&mod_submenu=<{$module.mod_submenu}>&mod_id=<{$module.mod_id}>" title="<{$smarty.const._AM_TDMCREATE_MODULE_TOGGLE}>">
+ <img src="<{xoModuleIcons16}><{$module.mod_submenu}>.png" alt="<{$smarty.const._AM_TDMCREATE_MODULE_TOGGLE}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="modules.php?op=toggle&mod_search=<{$module.mod_search}>&mod_id=<{$module.mod_id}>" title="<{$smarty.const._AM_TDMCREATE_MODULE_TOGGLE}>">
+ <img src="<{xoModuleIcons16}><{$module.mod_search}>.png" alt="<{$smarty.const._AM_TDMCREATE_MODULE_TOGGLE}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="modules.php?op=toggle&mod_comments=<{$module.mod_comments}>&mod_id=<{$module.mod_id}>" title="<{$smarty.const._AM_TDMCREATE_MODULE_TOGGLE}>">
+ <img src="<{xoModuleIcons16}><{$module.mod_comments}>.png" alt="<{$smarty.const._AM_TDMCREATE_MODULE_TOGGLE}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="modules.php?op=toggle&mod_notifications=<{$module.mod_notifications}>&mod_id=<{$module.mod_id}>" title="<{$smarty.const._AM_TDMCREATE_MODULE_TOGGLE}>">
+ <img src="<{xoModuleIcons16}><{$module.mod_notifications}>.png" alt="<{$smarty.const._AM_TDMCREATE_MODULE_TOGGLE}>" />
+ </a>
+ </td>
<td class='xo-actions txtcenter width5'>
<a href="modules.php?op=edit&mod_id=<{$module.mod_id}>" title="<{$smarty.const._EDIT}>">
<img src="<{xoAdminIcons edit.png}>" alt="<{$smarty.const._EDIT}>" height="16" />
@@ -59,4 +82,4 @@
</div>
<{/if}>
<!-- Footer -->
-<{includeq file="db:tdmcreate_footer.html"}>
\ No newline at end of file
+<{includeq file="db:tdmcreate_footer.html"}>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html 2014-03-28 20:15:39 UTC (rev 12415)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html 2014-03-29 00:44:39 UTC (rev 12416)
@@ -2,8 +2,9 @@
<{includeq file="db:tdmcreate_header.html"}>
<!-- Display modules list -->
<{if $modules_list}>
- <table width='100%' cellspacing='1' class='outer'>
- <tr>
+ <table id="showhide" width='100%' cellspacing='1' class='outer'>
+ <thead>
+ <tr>
<th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ID}></th>
<th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NAME}></th>
<th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE}></th>
@@ -16,21 +17,48 @@
<th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_COMMENTS_LIST}></th>
<th class='center'><{$smarty.const._AM_TDM...
[truncated message content] |
|
From: <txm...@us...> - 2014-03-29 23:12:33
|
Revision: 12417
http://sourceforge.net/p/xoops/svn/12417
Author: txmodxoops
Date: 2014-03-29 23:12:29 +0000 (Sat, 29 Mar 2014)
Log Message:
-----------
Updated work in progress
Added Toggle Change Display in lists
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-03-29 00:44:39 UTC (rev 12416)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-03-29 23:12:29 UTC (rev 12417)
@@ -58,8 +58,6 @@
unset($criteria);
if ($nb_tables > 0)
{
- $_yes = "<img src='../images/icons/16/green.png' alt='"._YES."' title='"._YES."' />";
- $_no = "<img src='../images/icons/16/red.png' alt='"._NO."' title='"._NO."' />";
foreach (array_keys($tables_arr) as $t)
{
$table['id'] = $t;
@@ -67,13 +65,13 @@
$table['name'] = $tables_arr[$t]->getVar('table_name');
$table['image'] = $tables_arr[$t]->getVar('table_image');
$table['nbfields'] = $tables_arr[$t]->getVar('table_nbfields');
- $table['blocks'] = ( $tables_arr[$t]->getVar('table_blocks') == 1 ) ? $_yes : $_no;
- $table['admin'] = ( $tables_arr[$t]->getVar('table_admin') == 1 ) ? $_yes : $_no;
- $table['user'] = ( $tables_arr[$t]->getVar('table_user') == 1 ) ? $_yes : $_no;
- $table['submenu'] = ( $tables_arr[$t]->getVar('table_submenu') == 1 ) ? $_yes : $_no;
- $table['search'] = ( $tables_arr[$t]->getVar('table_search') == 1 ) ? $_yes : $_no;
- $table['comments'] = ( $tables_arr[$t]->getVar('table_comments') == 1 ) ? $_yes : $_no;
- $table['notifications'] = ( $tables_arr[$t]->getVar('table_notifications') == 1 ) ? $_yes : $_no;
+ $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');
$GLOBALS['xoopsTpl']->append('tables_list', $table);
unset($mod);
}
@@ -151,5 +149,51 @@
$form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
+
+ case 'toggle':
+ if (isset($_GET['table_id'])) {
+ if (isset($_GET['table_blocks'])) {
+ $table_blocks = intval($_GET['table_blocks']);
+ $table_blocks = ($table_blocks == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($table_id);
+ $obj->setVar('table_blocks', $table_blocks);
+ } elseif (isset($_GET['table_admin'])) {
+ $table_admin = intval($_GET['table_admin']);
+ $table_admin = ($table_admin == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($table_id);
+ $obj->setVar('table_admin', $table_admin);
+ } elseif (isset($_GET['table_user'])) {
+ $table_user = intval($_GET['table_user']);
+ $table_user = ($table_user == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($table_id);
+ $obj->setVar('table_user', $table_user);
+ } elseif (isset($_GET['table_submenu'])) {
+ $table_submenu = intval($_GET['table_submenu']);
+ $table_submenu = ($table_submenu == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($table_id);
+ $obj->setVar('table_submenu', $table_submenu);
+ } elseif (isset($_GET['table_search'])) {
+ $table_search = intval($_GET['table_search']);
+ $table_search = ($table_search == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($table_id);
+ $obj->setVar('table_search', $table_search);
+ } elseif (isset($_GET['table_comments'])) {
+ $table_comments = intval($_GET['table_comments']);
+ $table_comments = ($table_comments == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($table_id);
+ $obj->setVar('table_comments', $table_comments);
+ } elseif (isset($_GET['table_notifications'])) {
+ $table_notifications = intval($_GET['table_notifications']);
+ $table_notifications = ($table_notifications == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($table_id);
+ $obj->setVar('table_notifications', $table_notifications);
+ }
+ if ($modulesHandler->insert($obj, true)) {
+ redirect_header('fields.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
+ } else {
+ redirect_header('fields.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
+ }
+ }
+ break;
}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-29 00:44:39 UTC (rev 12416)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-29 23:12:29 UTC (rev 12417)
@@ -21,7 +21,7 @@
include 'header.php';
// Recovered the value of the argument op in the URL $
$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
-
+$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id');
switch ($op)
{
case 'list':
@@ -32,7 +32,8 @@
$template_main = 'tdmcreate_modules.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
- $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
@@ -45,18 +46,18 @@
{
foreach (array_keys($mods_arr) as $i)
{
- $mod['mod_id'] = $i;
- $mod['mod_name'] = $mods_arr[$i]->getVar('mod_name');
- $mod['mod_version'] = $mods_arr[$i]->getVar('mod_version');
- $mod['mod_image'] = $mods_arr[$i]->getVar('mod_image');
- $mod['mod_release'] = $mods_arr[$i]->getVar('mod_release');
- $mod['mod_status'] = $mods_arr[$i]->getVar('mod_status');
- $mod['mod_admin'] = $mods_arr[$i]->getVar('mod_admin');
- $mod['mod_user'] = $mods_arr[$i]->getVar('mod_user');
- $mod['mod_submenu'] = $mods_arr[$i]->getVar('mod_submenu');
- $mod['mod_search'] = $mods_arr[$i]->getVar('mod_search');
- $mod['mod_comments'] = $mods_arr[$i]->getVar('mod_comments');
- $mod['mod_notifications'] = $mods_arr[$i]->getVar('mod_notifications');
+ $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['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);
}
@@ -86,8 +87,8 @@
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- if (isset($_REQUEST['mod_id'])) {
- $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ if (isset($mod_id)) {
+ $obj =& $modulesHandler->get($mod_id);
} else {
$obj =& $modulesHandler->create();
}
@@ -165,13 +166,13 @@
$GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
$GLOBALS['xoopsTpl']->assign('button_list', $adminMenu->renderButton());
- $obj = $modulesHandler->get($_REQUEST['mod_id']);
+ $obj = $modulesHandler->get($mod_id);
$form = $obj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'delete':
- $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj =& $modulesHandler->get($mod_id);
if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
@@ -182,48 +183,47 @@
$GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
}
} else {
- xoops_confirm(array('ok' => 1, 'mod_id' => $_REQUEST['mod_id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('mod_name')));
+ xoops_confirm(array('ok' => 1, 'mod_id' => $mod_id, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('mod_name')));
}
break;
case 'toggle':
if (isset($_GET['mod_id'])) {
- $mod_id = intval($_GET['mod_id']);
if (isset($_GET['mod_admin'])) {
$mod_admin = intval($_GET['mod_admin']);
$mod_admin = ($mod_admin == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj =& $modulesHandler->get($mod_id);
$obj->setVar('mod_admin', $mod_admin);
} elseif (isset($_GET['mod_user'])) {
$mod_user = intval($_GET['mod_user']);
$mod_user = ($mod_user == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj =& $modulesHandler->get($mod_id);
$obj->setVar('mod_user', $mod_user);
- } elseif (isset($_GET['mod_submenu'])) {
- $mod_submenu = intval($_GET['mod_submenu']);
- $mod_submenu = ($mod_submenu == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($_REQUEST['mod_id']);
- $obj->setVar('mod_submenu', $mod_submenu);
} elseif (isset($_GET['mod_search'])) {
$mod_search = intval($_GET['mod_search']);
$mod_search = ($mod_search == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj =& $modulesHandler->get($mod_id);
$obj->setVar('mod_search', $mod_search);
} elseif (isset($_GET['mod_comments'])) {
$mod_comments = intval($_GET['mod_comments']);
$mod_comments = ($mod_comments == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj =& $modulesHandler->get($mod_id);
$obj->setVar('mod_comments', $mod_comments);
} elseif (isset($_GET['mod_notifications'])) {
$mod_notifications = intval($_GET['mod_notifications']);
$mod_notifications = ($mod_notifications == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj =& $modulesHandler->get($mod_id);
$obj->setVar('mod_notifications', $mod_notifications);
+ } elseif (isset($_GET['mod_permissions'])) {
+ $mod_permissions = intval($_GET['mod_permissions']);
+ $mod_permissions = ($mod_permissions == 1) ? 0 : 1;
+ $obj =& $modulesHandler->get($mod_id);
+ $obj->setVar('mod_permissions', $mod_permissions);
}
if ($modulesHandler->insert($obj, true)) {
- redirect_header('modules.php', 1, _AM_TDMCREATE_MODULE_TOGGLE_SUCCESS);
+ redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
} else {
- redirect_header('modules.php', 1, _AM_TDMCREATE_MODULE_TOGGLE_FAILED);
+ redirect_header('modules.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
}
}
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-29 00:44:39 UTC (rev 12416)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-29 23:12:29 UTC (rev 12417)
@@ -66,11 +66,11 @@
$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['submenu'] = $mods_arr[$i]->getVar('mod_submenu');
+ $mod['user'] = $mods_arr[$i]->getVar('mod_user');
$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['notifications'] = $mods_arr[$i]->getVar('mod_notifications');
+ $mod['permissions'] = $mods_arr[$i]->getVar('mod_permissions');
// Get the list of tables
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $i));
@@ -96,7 +96,8 @@
$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['notifications'] = $tables_arr[$t]->getVar('table_notifications');
+ $table['permissions'] = $tables_arr[$t]->getVar('table_permissions');
$tables[] = $table;
unset($table);
}
@@ -171,7 +172,8 @@
'table_submenu' => (($_REQUEST['table_submenu'] == 1) ? '1' : '0'),
'table_search' => (($_REQUEST['table_search'] == 1) ? '1' : '0'),
'table_comments' => (($_REQUEST['table_comments'] == 1) ? '1' : '0'),
- 'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0')));
+ 'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0'),
+ 'table_permissions' => (($_REQUEST['table_permissions'] == 1) ? '1' : '0')));
if( $tablesHandler->insert($obj) ) {
if( $obj->isNew() ) {
@@ -194,13 +196,13 @@
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
- $obj = $tablesHandler->get($_REQUEST['table_id']);
+ $obj = $tablesHandler->get($table_id);
$form = $obj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'delete':
- $obj =& $tablesHandler->get($_REQUEST['table_id']);
+ $obj =& $tablesHandler->get($table_id);
if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
@@ -211,53 +213,57 @@
echo $obj->getHtmlErrors();
}
} else {
- xoops_confirm(array('ok' => 1, 'table_id' => $_REQUEST['table_id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('table_name')));
+ xoops_confirm(array('ok' => 1, 'table_id' => $table_id, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('table_name')));
}
break;
case 'toggle':
if (isset($_GET['table_id'])) {
- $table_id = intval($_GET['table_id']);
- if (isset($_GET['table_blocks'])) {
+ if (isset($_GET['table_blocks'])) {
$table_blocks = intval($_GET['table_blocks']);
$table_blocks = ($table_blocks == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj =& $tablesHandler->get($table_id);
$obj->setVar('table_blocks', $table_blocks);
} elseif (isset($_GET['table_admin'])) {
$table_admin = intval($_GET['table_admin']);
$table_admin = ($table_admin == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($_REQUEST['mod_id']);
+ $obj =& $tablesHandler->get($table_id);
$obj->setVar('table_admin', $table_admin);
} elseif (isset($_GET['table_user'])) {
$table_user = intval($_GET['table_user']);
$table_user = ($table_user == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($_REQUEST['table_id']);
+ $obj =& $tablesHandler->get($table_id);
$obj->setVar('table_user', $table_user);
} elseif (isset($_GET['table_submenu'])) {
$table_submenu = intval($_GET['table_submenu']);
$table_submenu = ($table_submenu == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($_REQUEST['table_id']);
+ $obj =& $tablesHandler->get($table_id);
$obj->setVar('table_submenu', $table_submenu);
} elseif (isset($_GET['table_search'])) {
$table_search = intval($_GET['table_search']);
$table_search = ($table_search == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($_REQUEST['table_id']);
+ $obj =& $tablesHandler->get($table_id);
$obj->setVar('table_search', $table_search);
} elseif (isset($_GET['table_comments'])) {
$table_comments = intval($_GET['table_comments']);
$table_comments = ($table_comments == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($_REQUEST['table_id']);
+ $obj =& $tablesHandler->get($table_id);
$obj->setVar('table_comments', $table_comments);
} elseif (isset($_GET['table_notifications'])) {
$table_notifications = intval($_GET['table_notifications']);
$table_notifications = ($table_notifications == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($_REQUEST['table_id']);
+ $obj =& $tablesHandler->get($table_id);
$obj->setVar('table_notifications', $table_notifications);
+ } elseif (isset($_GET['table_permissions'])) {
+ $table_permissions = intval($_GET['table_permissions']);
+ $table_permissions = ($table_permissions == 1) ? 0 : 1;
+ $obj =& $tablesHandler->get($table_id);
+ $obj->setVar('table_permissions', $table_permissions);
}
- if ($modulesHandler->insert($obj, true)) {
- redirect_header('tables.php', 1, _AM_TDMCREATE_TABLE_TOGGLE_SUCCESS);
+ if ($tablesHandler->insert($obj, true)) {
+ redirect_header('tables.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
} else {
- redirect_header('tables.php', 1, _AM_TDMCREATE_TABLE_TOGGLE_FAILED);
+ redirect_header('tables.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
}
}
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-03-29 00:44:39 UTC (rev 12416)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-03-29 23:12:29 UTC (rev 12417)
@@ -25,13 +25,18 @@
*/
class TDMCreateTables extends XoopsObject
{
+ /**
+ * @var string
+ */
+ private $module = null;
+
/*
* @public function constructor class
* @param null
*/
public function __construct()
{
- $this->XoopsObject();
+ $this->module = TDMCreateModules::getInstance();
$this->initVar('table_id',XOBJ_DTYPE_INT);
$this->initVar('table_mid',XOBJ_DTYPE_INT);
$this->initVar('table_category',XOBJ_DTYPE_INT);
@@ -42,9 +47,10 @@
$this->initVar('table_blocks',XOBJ_DTYPE_INT);
$this->initVar('table_admin',XOBJ_DTYPE_INT);
$this->initVar('table_user',XOBJ_DTYPE_INT);
- $this->initVar('table_status',XOBJ_DTYPE_INT);
+ $this->initVar('table_submenu',XOBJ_DTYPE_INT);
+ /*$this->initVar('table_status',XOBJ_DTYPE_INT);
$this->initVar('table_waiting',XOBJ_DTYPE_INT);
- $this->initVar('table_online',XOBJ_DTYPE_INT);
+ $this->initVar('table_online',XOBJ_DTYPE_INT); */
$this->initVar('table_search',XOBJ_DTYPE_INT);
$this->initVar('table_comments',XOBJ_DTYPE_INT);
$this->initVar('table_notifications',XOBJ_DTYPE_INT);
@@ -102,11 +108,6 @@
$form->addElement($category);
}
- /*$radio_category = $this->isNew() ? 0 : $this->getVar('table_category');
- $table_category = new XoopsFormRadioYN(_AM_TDMCREATE_TABLE_CATEGORY, 'table_category', $radio_category);
- $table_category->setDescription(_AM_TDMCREATE_TABLE_CATEGORY_DESC);
- $form->addElement($table_category);*/
-
$table_fieldname = new XoopsFormText(_AM_TDMCREATE_TABLE_FIELDNAME, 'table_fieldname', 30, 50, $this->getVar('table_fieldname'));
$table_fieldname->setDescription(_AM_TDMCREATE_TABLE_FIELDNAME_DESC);
$form->addElement($table_fieldname);
@@ -173,6 +174,11 @@
$check_table_notifications = new XoopsFormCheckBox(' ', 'table_notifications', $table_notifications);
$check_table_notifications->addOption(1, _AM_TDMCREATE_TABLE_NOTIFICATIONS);
$options_tray->addElement($check_table_notifications);
+ $table_permissions = $this->isNew() ? 0 : $this->getVar('table_permissions');
+ $check_table_permissions = new XoopsFormCheckBox(' ', 'table_permissions', $table_permissions);
+ $check_table_permissions->addOption(1, _AM_TDMCREATE_TABLE_PERMISSIONS);
+ $options_tray->addElement($check_table_permissions);
+ $options_tray->setDescription(_AM_TDMCREATE_TABLE_OPTIONS_CHECKS_DESC);
$form->addElement($options_tray);
$form->addElement(new XoopsFormHidden('op', 'save'));
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js 2014-03-29 00:44:39 UTC (rev 12416)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js 2014-03-29 23:12:29 UTC (rev 12417)
@@ -26,30 +26,6 @@
return xhr;
}
-function displayRowClass(tableId, rowClass, Nb) {
- var table = document.getElementById(tableId);
- var display = 'none';
- var ClassName = rowClass + Nb;
- for (var i in table.rows) {
- row = table.rows[i];
- if (row.className === ClassName) {
- if (row.style.display === 'none') {
- /**Test si c'est IE ou pas*/
- display = document.all !== undefined ? 'block' : 'table-row';
- } else {
- display = 'none';
- }
- row.style.display = display;
- }
- /*
- if(rowClass == 'child'){
- if(row.idName == ClassName){
- row.style.display = 'none';
- }
- }*/
- }
-}
-
function swapImg(swap) {
obj = document.getElementById(swap);
obj.src = !(obj.src == img_minus) ? img_minus : img_plus;
@@ -80,11 +56,11 @@
}
}
*/
-
+/*
$(document).ready( function() {
- $('tr').find('img.imageToggle').on('click', function(e) {
+ $('tr').find('a img.imageToggle').on('click', function(e) {
e.preventDefault();
- /*$('tr.toggleChild').toggle();*/
+ $('tr.toggleChild').toggle();
$(this).nextAll('tr.toggleChild').each( function() {
if ($(this).is('.toggleMain')) {
return false;
@@ -92,4 +68,16 @@
$(this).toggle();
});
});
+});*/
+$(document).ready( function() {
+ $('tr.toggleChild').hide();
+ $('tr.toggleMain').click( function(e) {
+ e.preventDefault();
+ $(this).nextAll().each( function() {
+ if ($(this).filter('tr.toggleMain').length) {
+ return false;
+ }
+ $(this).filter('tr.toggleChild').toggle();
+ });
+ });
});
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-03-29 00:44:39 UTC (rev 12416)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-03-29 23:12:29 UTC (rev 12417)
@@ -103,7 +103,7 @@
define('_AM_TDMCREATE_MODULE_USER', "Visible User");
define('_AM_TDMCREATE_MODULE_SEARCH', "Enable Search");
define('_AM_TDMCREATE_MODULE_COMMENTS', "Enable Comments");
-define('_AM_TDMCREATE_MODULE_NOTIFICATIONS', "Notifications");
+define('_AM_TDMCREATE_MODULE_NOTIFICATIONS', "Enable Notifications");
define('_AM_TDMCREATE_MODULE_PERMISSIONS', "Enable permissions");
define('_AM_TDMCREATE_MODULE_INSTALL', "Install this module directly in root/modules?");
// Added in version 1.39
@@ -115,6 +115,7 @@
define('_AM_TDMCREATE_MODULE_SEARCH_LIST', "Search");
define('_AM_TDMCREATE_MODULE_COMMENTS_LIST', "Comments");
define('_AM_TDMCREATE_MODULE_NOTIFICATIONS_LIST', "Notifications");
+define('_AM_TDMCREATE_MODULE_PERMISSIONS_LIST', "Permissions");
define('_AM_TDMCREATE_MODULE_MIN_PHP', "Minimum PHP");
define('_AM_TDMCREATE_MODULE_MIN_XOOPS', "Minimum XOOPS");
define('_AM_TDMCREATE_MODULE_MIN_ADMIN', "Minimum Admin");
@@ -129,12 +130,14 @@
define('_AM_TDMCREATE_TABLE_MODULES', "Choose a module");
define('_AM_TDMCREATE_TABLE_NAME', "Table Name");
define('_AM_TDMCREATE_TABLE_NAME_DESC', "Unique Name for this Table");
-define('_AM_TDMCREATE_TABLE_CATEGORY', "This table is a category?");
-define('_AM_TDMCREATE_TABLE_CATEGORY_DESC', "<i>Once you have used this field,<br />will not be displayed following the creation of other tables</i>");
+define('_AM_TDMCREATE_TABLE_CATEGORY', "This table is a category or topic?");
+define('_AM_TDMCREATE_TABLE_CATEGORY_DESC', "<b class='red bold'>ATTENTION</b>: <i>Once you have used this field,<br />will not be displayed following the creation of other tables</i>");
define('_AM_TDMCREATE_TABLE_NBFIELDS', "Number fields");
define('_AM_TDMCREATE_TABLE_NBFIELDS_DESC', "Number of fields for this table");
define('_AM_TDMCREATE_TABLE_FIELDNAME', "Prefix Field Name");
define('_AM_TDMCREATE_TABLE_FIELDNAME_DESC', "This is the prefix of field name (optional)<br />If you leave the field blank,<br />doesn't appear anything in the fields of the next screen,<br />otherwise you'll see all the fields with a prefix type (e.g: <span class='bold'>fieldname_</span>)");
+define('_AM_TDMCREATE_TABLE_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_BLOCKS', "Block for this table");
define('_AM_TDMCREATE_TABLE_BLOCKS_DESC', "(blocks: random, latest, today)");
@@ -146,7 +149,7 @@
define('_AM_TDMCREATE_TABLE_COMMENTS', "Comments for this table");
// Added in version 1.39
define('_AM_TDMCREATE_TABLE_NOTIFICATIONS', "Notifications for this table");
-
+define('_AM_TDMCREATE_TABLE_PERMISSIONS', "Permissions for this table");
// v1.38
define('_AM_TDMCREATE_TABLE_IMAGE_DESC', "<span class='red bold'>Attention</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>.");
@@ -314,9 +317,15 @@
define('_AM_TDMCREATE_TABLE_SEARCH_LIST', "Search");
define('_AM_TDMCREATE_TABLE_COMMENTS_LIST', "Comments");
define('_AM_TDMCREATE_TABLE_NOTIFICATIONS_LIST', "Notifications");
+define('_AM_TDMCREATE_TABLE_PERMISSIONS_LIST', "Permissions");
define('_AM_TDMCREATE_EDIT_TABLE', "Edit Table");
define('_AM_TDMCREATE_EDIT_FIELDS', "Edit Fields");
define('_AM_TDMCREATE_BUILD_INROOT', "Do you want to install this module in the modules root of your site?");
define('_AM_TDMCREATE_BUILD_INROOT_DESC', "<b class='red big'>ATTENTION</b>: If in the modules directory of your site is installed a module with the same name,<br />as the one you are about to create now, this will be erased with the appropriate consequences.<br />We recommend you to first check, in the root/modules of your site, if this module already exists.");
//define('_AM_TDMCREATE_MODULE_PERMISSIONS', "Enable permissions");
-//define('_AM_TDMCREATE_MODULE_INSTALL', "Install this module directly in root/modules?");
\ No newline at end of file
+//define('_AM_TDMCREATE_MODULE_INSTALL', "Install this module directly in root/modules?");
+
+// Added in version 1.91
+define('_AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY', "Toggle Change Display");
+define('_AM_TDMCREATE_TOGGLE_SUCCESS', "Successfully Changed Display");
+define('_AM_TDMCREATE_TOGGLE_FAILED', "Changing Display Failed");
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql ...
[truncated message content] |
|
From: <txm...@us...> - 2014-03-30 00:35:40
|
Revision: 12418
http://sourceforge.net/p/xoops/svn/12418
Author: txmodxoops
Date: 2014-03-30 00:35:36 +0000 (Sun, 30 Mar 2014)
Log Message:
-----------
Updated toggle table tr with image
Icons from Frameworks for Toggle Change Display
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/drag.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/submenu.png
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/green.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/off.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/on.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/red.png
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/yellow.png
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-03-29 23:12:29 UTC (rev 12417)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-03-30 00:35:36 UTC (rev 12418)
@@ -71,7 +71,8 @@
$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['notifications'] = $tables_arr[$t]->getVar('table_notifications');
+ $table['permissions'] = $tables_arr[$t]->getVar('table_permissions');
$GLOBALS['xoopsTpl']->append('tables_list', $table);
unset($mod);
}
@@ -152,43 +153,48 @@
case 'toggle':
if (isset($_GET['table_id'])) {
- if (isset($_GET['table_blocks'])) {
+ if (isset($_GET['table_blocks'])) {
$table_blocks = intval($_GET['table_blocks']);
$table_blocks = ($table_blocks == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($table_id);
+ $obj =& $tablesHandler->get($table_id);
$obj->setVar('table_blocks', $table_blocks);
} elseif (isset($_GET['table_admin'])) {
$table_admin = intval($_GET['table_admin']);
$table_admin = ($table_admin == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($table_id);
+ $obj =& $tablesHandler->get($table_id);
$obj->setVar('table_admin', $table_admin);
} elseif (isset($_GET['table_user'])) {
$table_user = intval($_GET['table_user']);
$table_user = ($table_user == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($table_id);
+ $obj =& $tablesHandler->get($table_id);
$obj->setVar('table_user', $table_user);
} elseif (isset($_GET['table_submenu'])) {
$table_submenu = intval($_GET['table_submenu']);
$table_submenu = ($table_submenu == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($table_id);
+ $obj =& $tablesHandler->get($table_id);
$obj->setVar('table_submenu', $table_submenu);
} elseif (isset($_GET['table_search'])) {
$table_search = intval($_GET['table_search']);
$table_search = ($table_search == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($table_id);
+ $obj =& $tablesHandler->get($table_id);
$obj->setVar('table_search', $table_search);
} elseif (isset($_GET['table_comments'])) {
$table_comments = intval($_GET['table_comments']);
$table_comments = ($table_comments == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($table_id);
+ $obj =& $tablesHandler->get($table_id);
$obj->setVar('table_comments', $table_comments);
} elseif (isset($_GET['table_notifications'])) {
$table_notifications = intval($_GET['table_notifications']);
$table_notifications = ($table_notifications == 1) ? 0 : 1;
- $obj =& $modulesHandler->get($table_id);
+ $obj =& $tablesHandler->get($table_id);
$obj->setVar('table_notifications', $table_notifications);
+ } elseif (isset($_GET['table_permissions'])) {
+ $table_permissions = intval($_GET['table_permissions']);
+ $table_permissions = ($table_permissions == 1) ? 0 : 1;
+ $obj =& $tablesHandler->get($table_id);
+ $obj->setVar('table_permissions', $table_permissions);
}
- if ($modulesHandler->insert($obj, true)) {
+ if ($tablesHandler->insert($obj, true)) {
redirect_header('fields.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
} else {
redirect_header('fields.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-29 23:12:29 UTC (rev 12417)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-30 00:35:36 UTC (rev 12418)
@@ -219,7 +219,7 @@
case 'toggle':
if (isset($_GET['table_id'])) {
- if (isset($_GET['table_blocks'])) {
+ if (isset($_GET['table_blocks'])) {
$table_blocks = intval($_GET['table_blocks']);
$table_blocks = ($table_blocks == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-03-29 23:12:29 UTC (rev 12417)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-03-30 00:35:36 UTC (rev 12418)
@@ -50,7 +50,7 @@
$this->initVar('table_submenu',XOBJ_DTYPE_INT);
/*$this->initVar('table_status',XOBJ_DTYPE_INT);
$this->initVar('table_waiting',XOBJ_DTYPE_INT);
- $this->initVar('table_online',XOBJ_DTYPE_INT); */
+ $this->initVar('table_online',XOBJ_DTYPE_INT);*/
$this->initVar('table_search',XOBJ_DTYPE_INT);
$this->initVar('table_comments',XOBJ_DTYPE_INT);
$this->initVar('table_notifications',XOBJ_DTYPE_INT);
@@ -115,7 +115,8 @@
$table_nbfield->setDescription(_AM_TDMCREATE_TABLE_NBFIELDS_DESC);
$form->addElement($table_nbfield, true);
- $table_image = $this->getVar('table_image') ? $this->getVar('table_image') : 'blank.gif';
+ $table_image = $this->getVar('table_image');
+ $table_image = $table_image ? $table_image : 'blank.gif';
$uploadir = '/Frameworks/moduleclasses/icons/32';
$uploads_dir = '/uploads/'.$GLOBALS['xoopsModule']->dirname().'/images/tables';
if(is_dir(XOOPS_ROOT_PATH . $uploadir)){
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/drag.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/drag.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/drag.png 2014-03-29 23:12:29 UTC (rev 12417)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/drag.png 2014-03-30 00:35:36 UTC (rev 12418)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/drag.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/green.png
===================================================================
(Binary files differ)
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/off.png
===================================================================
(Binary files differ)
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/on.png
===================================================================
(Binary files differ)
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/red.png
===================================================================
(Binary files differ)
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/submenu.png
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/submenu.png
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/submenu.png 2014-03-29 23:12:29 UTC (rev 12417)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/submenu.png 2014-03-30 00:35:36 UTC (rev 12418)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/submenu.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/images/icons/16/yellow.png
===================================================================
(Binary files differ)
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js 2014-03-29 23:12:29 UTC (rev 12417)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js 2014-03-30 00:35:36 UTC (rev 12418)
@@ -68,10 +68,10 @@
$(this).toggle();
});
});
-});*/
+});
$(document).ready( function() {
$('tr.toggleChild').hide();
- $('tr.toggleMain').click( function(e) {
+ $('tr.toggleMain').on('click', 'a img > imageToggle', function(e) {
e.preventDefault();
$(this).nextAll().each( function() {
if ($(this).filter('tr.toggleMain').length) {
@@ -80,4 +80,10 @@
$(this).filter('tr.toggleChild').toggle();
});
});
+});*/
+$(document).ready(function() {
+ $('tr.toggleMain').find('a').on('click', 'img.imageToggle', function(e){
+ e.preventDefault();
+ $('table#show_rows tr.toggleChild').toggle();
+ });
});
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html 2014-03-29 23:12:29 UTC (rev 12417)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html 2014-03-30 00:35:36 UTC (rev 12418)
@@ -2,7 +2,7 @@
<{includeq file="db:tdmcreate_header.html"}>
<!-- Display tables list -->
<{if $tables_list}>
- <table width='100%' cellspacing='1' class='outer'>
+ <table id='show_rows' width='100%' cellspacing='1' class='outer'>
<thead>
<tr>
<th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_ID}></th>
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html 2014-03-29 23:12:29 UTC (rev 12417)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html 2014-03-30 00:35:36 UTC (rev 12418)
@@ -2,7 +2,7 @@
<{includeq file="db:tdmcreate_header.html"}>
<!-- Display modules list -->
<{if $modules_list}>
- <table id="showhide" width='100%' cellspacing='1' class='outer'>
+ <table id='show_rows' width='100%' cellspacing='1' class='outer'>
<thead>
<tr>
<th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ID}></th>
@@ -24,7 +24,7 @@
<{foreach item=module from=$modules_list}>
<tr class="head toggleMain">
<td class='center'><{$module.id}><br />
- <img class="imageToggle" src="<{$tdmc_url}>/images/icons/16/toggle.png" alt="Toggle" title="Toggle" />
+ <a href="#" title="Toggle"><img class="imageToggle" src="<{$tdmc_url}>/images/icons/16/toggle.png" alt="Toggle" /></a>
</td>
<td class='center'><{$module.name}></td>
<td class='center'><img src="<{$tdmc_upload_imgmod_url}>/<{$module.image}>" height="32" /></td>
|
|
From: <txm...@us...> - 2014-04-03 13:51:10
|
Revision: 12420
http://sourceforge.net/p/xoops/svn/12420
Author: txmodxoops
Date: 2014-04-03 13:51:04 +0000 (Thu, 03 Apr 2014)
Log Message:
-----------
Updated work in progress
Added Fields Form
Pleace: if you test this, is needed new installation
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/themeform.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/simplelabel.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/style.css
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-02 12:54:37 UTC (rev 12419)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-03 13:51:04 UTC (rev 12420)
@@ -41,7 +41,8 @@
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
$template_main = 'tdmcreate_fields.html';
-
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
@@ -118,15 +119,17 @@
'field_null' => $_POST['field_null'],
'field_default' => $_POST['field_default'],
'field_key' => $_POST['field_key'],
- 'field_elements' => $_POST['field_elements'],
- 'field_admin' => (($_REQUEST['field_admin'] == 1) ? '1' : '0'),
+ 'field_autoincrement' => (($_REQUEST['field_element'] == 1) ? '1' : '0'),
+ 'field_element' => $_POST['field_element'],
+ 'field_inlist' => (($_REQUEST['field_inlist'] == 1) ? '1' : '0'),
+ 'field_inform' => (($_REQUEST['field_inform'] == 1) ? '1' : '0'),
+ 'field_admin' => (($_REQUEST['field_admin'] == 1) ? '1' : '0'),
'field_user' => (($_REQUEST['field_user'] == 1) ? '1' : '0'),
- 'field_blocks' => (($_REQUEST['field_blocks'] == 1) ? '1' : '0'),
- 'field_mainfield' => (($_REQUEST['field_mainfield'] == 1) ? '1' : '0'),
+ 'field_block' => (($_REQUEST['field_block'] == 1) ? '1' : '0'),
+ 'field_main' => (($_REQUEST['field_main'] == 1) ? '1' : '0'),
'field_search' => (($_REQUEST['field_search'] == 1) ? '1' : '0'),
- 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0'),
- 'field_fields' => $_POST['field_fields'],
- 'field_parameters' => $_POST['field_parameters'])
+ 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0')
+ )
);
if ($fieldsHandler->insert($obj)) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-04-02 12:54:37 UTC (rev 12419)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-04-03 13:51:04 UTC (rev 12420)
@@ -30,6 +30,7 @@
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
$template_main = 'tdmcreate_modules.html';
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
$GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-02 12:54:37 UTC (rev 12419)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-03 13:51:04 UTC (rev 12420)
@@ -38,7 +38,6 @@
$template_main = 'tdmcreate_tables.html';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
-
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php 2014-04-02 12:54:37 UTC (rev 12419)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php 2014-04-03 13:51:04 UTC (rev 12420)
@@ -16,39 +16,54 @@
* @package tdmcreate
* @since 2.5.5
* @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 fieldelements.php 11297 2013-03-24 10:58:10Z timgno $
+ * @version $Id: 1.91 fieldelements.php 11297 2014-03-24 09:11:10Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) { die("XOOPS root path not defined"); }
+
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
-class TDMCreateFieldelements extends XoopsObject
+/*
+* @Class TDMCreateFieldElements
+* @extends XoopsObject
+*/
+class TDMCreateFieldElements extends XoopsObject
{
- //Constructor
- function __construct()
+ /*
+ * @public function constructor class
+ * @param null
+ */
+ public function __construct()
{
- $this->XoopsObject();
- $this->initVar('fieldelement_id', XOBJ_DTYPE_INT);
- $this->initVar('fieldelement_value', XOBJ_DTYPE_TXTBOX);
- $this->initVar('fieldelement_name', XOBJ_DTYPE_TXTBOX);
- $this->initVar('fieldelement_admin', XOBJ_DTYPE_INT);
- $this->initVar('fieldelement_inlist', XOBJ_DTYPE_INT);
- $this->initVar('fieldelement_pid', XOBJ_DTYPE_INT);
- $this->initVar('fieldelement_user', XOBJ_DTYPE_INT);
- $this->initVar('fieldelement_block', XOBJ_DTYPE_INT);
- $this->initVar('fieldelement_mfield', XOBJ_DTYPE_INT);
- $this->initVar('fieldelement_search', XOBJ_DTYPE_INT);
- $this->initVar('fieldelement_required', XOBJ_DTYPE_INT);
+ $this->htmltable = TDMCreateHtmlTable::getInstance();
+ $this->initVar('fieldelement_fid', XOBJ_DTYPE_INT);
+ $this->initVar('fieldelement_value', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('fieldelement_name', XOBJ_DTYPE_TXTBOX);
}
- //Constructor
- function TDMCreateFieldelements()
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
{
- $this->__construct();
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
}
}
-class TDMCreateFieldelementsHandler extends XoopsPersistableObjectHandler
+/*
+* @Class TDMCreateFieldElementsHandler
+* @extends XoopsPersistableObjectHandler
+*/
+class TDMCreateFieldElementsHandler extends XoopsPersistableObjectHandler
{
- function __construct(&$db)
+ /*
+ * @public function constructor class
+ * @param mixed $db
+ */
+ public function __construct(&$db)
{
- parent::__construct($db, 'mod_tdmcreate_fieldelements', 'tdmcreatefieldelements', 'fieldelement_id', 'fieldelement_name');
+ parent::__construct($db, 'mod_tdmcreate_fieldelements', 'tdmcreatefieldelements', 'fieldelement_fid', 'fieldelement_name');
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-02 12:54:37 UTC (rev 12419)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-03 13:51:04 UTC (rev 12420)
@@ -19,6 +19,7 @@
* @version $Id: fields.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
+require_once 'simplelabel.php';
require_once 'themeform.php';
/*
* @Class TDMCreateFields
@@ -31,16 +32,6 @@
*/
private $table = null;
- /**
- * @var string
- */
- private $htmltable = null;
-
- /**
- * @var string
- */
- private $htmltable_parameters = null;
-
/*
* @public function constructor class
* @param null
@@ -48,9 +39,8 @@
public function __construct()
{
$this->table = TDMCreateTables::getInstance();
- $this->htmltable = TDMCreateHtmlTable::getInstance();
- $this->htmltable_parameters = TDMCreateHtmlTable::getInstance();
$this->initVar('field_id', XOBJ_DTYPE_INT);
+ $this->initVar('field_mid', XOBJ_DTYPE_INT);
$this->initVar('field_tid', XOBJ_DTYPE_INT);
$this->initVar('field_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('field_type', XOBJ_DTYPE_TXTBOX);
@@ -59,15 +49,16 @@
$this->initVar('field_null', XOBJ_DTYPE_TXTBOX);
$this->initVar('field_default', XOBJ_DTYPE_TXTBOX);
$this->initVar('field_key', XOBJ_DTYPE_TXTBOX);
- $this->initVar('field_auto_increment', XOBJ_DTYPE_INT);
- $this->initVar('field_display_admin', XOBJ_DTYPE_INT);
- $this->initVar('field_display_user', XOBJ_DTYPE_INT);
- $this->initVar('field_display_block', XOBJ_DTYPE_INT);
- $this->initVar('field_mainfield', XOBJ_DTYPE_INT);
- $this->initVar('field_search', XOBJ_DTYPE_INT);
- $this->initVar('field_required', XOBJ_DTYPE_INT);
- $this->initVar('field_fields',XOBJ_DTYPE_TXTAREA);
- $this->initVar('field_parameters',XOBJ_DTYPE_TXTAREA);
+ $this->initVar('field_autoincrement', XOBJ_DTYPE_INT);
+ $this->initVar('field_element', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_inlist', XOBJ_DTYPE_INT);
+ $this->initVar('field_inform', XOBJ_DTYPE_INT);
+ $this->initVar('field_admin', XOBJ_DTYPE_INT);
+ $this->initVar('field_user', XOBJ_DTYPE_INT);
+ $this->initVar('field_block', XOBJ_DTYPE_INT);
+ $this->initVar('field_main', XOBJ_DTYPE_INT);
+ $this->initVar('field_search', XOBJ_DTYPE_INT);
+ $this->initVar('field_required', XOBJ_DTYPE_INT);
}
/*
@@ -107,141 +98,156 @@
$field_tid = $this->getVar('field_tid');
$nb_fields = $this->getVar('field_numb');
}
-
- $header_captions = array(_AM_TDMCREATE_FIELD_NUMBER, _AM_TDMCREATE_FIELD_NAME, _AM_TDMCREATE_FIELD_TYPE, _AM_TDMCREATE_FIELD_VALUE, _AM_TDMCREATE_FIELD_ATTRIBUTE, _AM_TDMCREATE_FIELD_NULL, _AM_TDMCREATE_FIELD_DEFAULT, _AM_TDMCREATE_FIELD_KEY, _AM_TDMCREATE_FIELD_OTHERS);
- xoops_load('xoopsformloader');
+
$form = new TDMCreateThemeForm($title, 'form', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
- $tablesHandler = xoops_getModuleHandler('tables');
- // New Object HtmlTable
- //$this->htmltable->initTable(null, 'display outer');
- // header row
- /*$this->htmltable->addRow('center bgblue');
- $this->htmltable->addCells($cells, 'first', 'header');*/
- $this->htmltable->initTable('display outer width100');
- $this->htmltable->addRow() . NWLINE;
- $this->htmltable->addCell($title, 'first', 'header', 'colspan="9"');
- $this->htmltable->addRow('center bgblue') . NWLINE;
- $this->htmltable->addCells($header_captions, 'first', 'header');
-
- for($i = 1; $i <= intval($nb_fields); $i++)
+ $tablesHandler = xoops_getModuleHandler('tables');
+ $fieldelementsHandler =& xoops_getModuleHandler('fieldelements');
+ // New Object HtmlTable
+ $form->addElement(new TDMCreateFormLabel('<table class="outer">'));
+ $form->addElement(new TDMCreateFormLabel('<thead class="center"><tr class="width5">'));
+ $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_NUMBER.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_NAME.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_TYPE.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_VALUE.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_ATTRIBUTE.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_NULL.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_DEFAULT.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_KEY.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_OTHERS.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('</tr></thead>'));
+ $form->addElement(new TDMCreateFormLabel('<tbody>'));
+
+ $class = 'even';
+ for($i = 1; $i <= $nb_fields; $i++)
{
- $field_name = $this->isNew() ? $this->table->getVar('table_fieldname') : $this->getVar('field_name');
+ $class = $class ? 'odd' : 'even';
+ $form->addElement(new TDMCreateFormLabel('<tr class="'.$class.'">'));
+ // Index ID
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$i.'</td>'));
+ $field_name = $this->isNew() ? $table_fieldname : $this->getVar('field_name');
$field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name', 15, 255, $field_name);
- // fieldtype
+ // Field Name
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
+ // Field Type
$fieldtypeHandler =& xoops_getModuleHandler('fieldtype');
$fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type', $this->getVar('field_type'));
- $fieldtype_select->addOptionArray($fieldtypeHandler->getList());
- // fieldvalue
+ $fieldtype_select->addOptionArray($fieldtypeHandler->getList());
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$fieldtype_select->render().'</td>'));
+ // Field Value
$field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value', 5, 20, $this->getVar('field_value'));
- // fieldattributes
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_value->render().'</td>'));
+ // Field Attributes
$fieldattrsHandler =& xoops_getModuleHandler('fieldattributes');
$field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute', $this->getVar('field_attribute'));
$field_attributes_select->addOptionArray($fieldattrsHandler->getList());
- // fieldnull
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_attributes_select->render().'</td>'));
+ // Field Null
$fieldnullHandler =& xoops_getModuleHandler('fieldnull');
$field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL, 'field_null', $this->getVar('field_null'));
- $field_null_select->addOptionArray($fieldnullHandler->getList());
- // fielddefault
+ $field_null_select->addOptionArray($fieldnullHandler->getList());
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_null_select->render().'</td>'));
+ // Field Default
$field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT, 'field_default', 15, 25, $this->getVar('field_default'));
- // fieldkey
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_default->render().'</td>'));
+ // Field Key
$fieldkeyHandler =& xoops_getModuleHandler('fieldkey');
$field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key', $this->getVar('field_key'));
$field_key_select->addOptionArray($fieldkeyHandler->getList());
- // render fields
- $htmltableDataArray = array($i, $field_name->render(), $fieldtype_select->render(), $field_value->render(), $field_attributes_select->render(), $field_null_select->render(), $field_default->render(), $field_key_select->render());
- // data row
- $this->htmltable->addRow('center bgyellow');
- $this->htmltable->addCells($htmltableDataArray, 'first', 'data');
- $this->htmltable_parameters->initTable('display');
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_key_select->render().'</td>'));
+ // Field Autoincrement
if($i == 1) {
- $field_autoincrement = $this->isNew() ? 0 : $this->getVar('field_auto_increment');
- $check_field_autoincrement = new XoopsFormCheckBox(' ', 'field_auto_increment', $field_autoincrement);
+ $field_autoincrement = $this->isNew() ? 0 : $this->getVar('field_autoincrement');
+ $check_field_autoincrement = new XoopsFormCheckBox(' ', 'field_autoincrement', $field_autoincrement);
$check_field_autoincrement->addOption(1, _AM_TDMCREATE_FIELD_AUTO_INCREMENT);
- // data row
- $this->htmltable_parameters->addRow();
- $this->htmltable_parameters->addCell($check_field_autoincrement->render(), null, 'data');
+ $form->addElement(new TDMCreateFormLabel('<td>'.$check_field_autoincrement->render().'</td></tr>'));
} elseif($i > 1) {
- // Box header row
- $this->htmltable_parameters->addRow('center bgyellow');
- $this->htmltable_parameters->addCell(_AM_TDMCREATE_FIELD_ELEMENTS, 'first', 'header');
- // fieldelements
- $fieldelementsHandler=& xoops_getModuleHandler('fieldelements');
- $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element_name', $this->getVar('field_element_name'));
+ // Box header row
+ $parameters_tray = new XoopsFormElementTray('', '<br />');
+ // Field Elements
+ $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'fieldelement_name', $this->getVar('fieldelement_name'));
$field_elements_select->addOptionArray($fieldelementsHandler->getList());
$criteria = new CriteriaCompo(new Criteria('table_id', $table_id));
$criteria->add(new Criteria('table_mid', $table_mid));
$criteria->setSort('table_name');
$criteria->setOrder('ASC');
- $tbls_arr1 = $tablesHandler->getAll($criteria);
+ $table_arr = $tablesHandler->getAll($criteria);
unset($criteria);
- foreach (array_keys($tbls_arr1) as $j)
+ foreach (array_keys($table_arr) as $j)
{
- $tbls_name1 = $tbls_arr1[$j]->getVar('table_name');
- if ( $j[$i] == 'XoopsFormTables-'.$tbls_name1 ) {
- $field_elements_select->addOption('XoopsFormTables-'.$tbls_name1, 'Table : '.$tbls_name1);
+ $form_table_name = $table_arr[$j]->getVar('table_name');
+ if ( $j[$i] == 'XoopsFormTables-'.$form_table_name ) {
+ $field_elements_select->addOption('XoopsFormTables-'.$form_table_name, 'Table : '.$form_table_name);
}
}
- // data row
- $this->htmltable_parameters->addRow();
- $this->htmltable_parameters->addCell($field_elements_select->render(), null, 'data');
- $field_display_admin = $this->isNew() ? 0 : $this->getVar('field_display_admin');
- $check_field_display_admin = new XoopsFormCheckBox(' ', 'field_display_admin', $field_display_admin);
- $check_field_display_admin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN);
- // data row
- $this->htmltable_parameters->addRow();
- $this->htmltable_parameters->addCell($check_field_display_admin->render(), null, 'data');
- $field_display_user = $this->isNew() ? 0 : $this->getVar('field_display_user');
- $check_field_display_user = new XoopsFormCheckBox(' ', 'field_display_user', $field_display_user);
- $check_field_display_user->addOption(1, _AM_TDMCREATE_FIELD_USER);
- // data row
- $this->htmltable_parameters->addRow();
- $this->htmltable_parameters->addCell($check_field_display_user->render(), null, 'data');
- $field_display_block = $this->isNew() ? 0 : $this->getVar('field_display_block');
- $check_field_display_block = new XoopsFormCheckBox(' ', 'field_display_block', $field_display_block);
- $check_field_display_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
- // data row
- $this->htmltable_parameters->addRow();
- $this->htmltable_parameters->addCell($check_field_display_block->render(), null, 'data');
- $field_mnfield = $this->isNew() ? 0 : $this->getVar('field_mainfield');
- $field_mainfield = new XoopsFormRadio(' ', 'field_mainfield', $field_mnfield);
- $field_mainfield->addOption( ' ', _AM_TDMCREATE_FIELD_MAINFIELD );
- // data row
- $this->htmltable_parameters->addRow();
- $this->htmltable_parameters->addCell($field_mainfield->render(), null, 'data');
+ $parameters_tray->addElement($field_elements_select);
+
+ $field_inline = $this->isNew() ? 0 : $this->getVar('field_inline');
+ $check_field_inline = new XoopsFormCheckBox(' ', 'field_inline', $field_inline);
+ $check_field_inline->addOption(1, _AM_TDMCREATE_FIELD_ADMIN);
+ $parameters_tray->addElement($check_field_inline);
+
+ $field_inform = $this->isNew() ? 0 : $this->getVar('field_inform');
+ $check_field_inform = new XoopsFormCheckBox(' ', 'field_inform', $field_inform);
+ $check_field_inform->addOption(1, _AM_TDMCREATE_FIELD_ADMIN);
+ $parameters_tray->addElement($check_field_inform);
+
+ $field_admin = $this->isNew() ? 0 : $this->getVar('field_admin');
+ $check_field_admin = new XoopsFormCheckBox(' ', 'field_admin', $field_admin);
+ $check_field_admin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN);
+ $parameters_tray->addElement($check_field_admin);
+
+ $field_user = $this->isNew() ? 0 : $this->getVar('field_user');
+ $check_field_user = new XoopsFormCheckBox(' ', 'field_user', $field_user);
+ $check_field_user->addOption(1, _AM_TDMCREATE_FIELD_USER);
+ $parameters_tray->addElement($check_field_user);
+
+ $field_block = $this->isNew() ? 0 : $this->getVar('field_block');
+ $check_field_block = new XoopsFormCheckBox(' ', 'field_block', $field_block);
+ $check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
+ $parameters_tray->addElement($check_field_block);
+
+ $field_mnfield = $this->isNew() ? 0 : $this->getVar('field_main');
+ $field_main = new XoopsFormRadio(' ', 'field_main', $field_mnfield);
+ $field_main->addOption( ' ', _AM_TDMCREATE_FIELD_MAINFIELD );
+ $parameters_tray->addElement($field_main);
+
$field_search = $this->isNew() ? 0 : $this->getVar('field_search');
$check_field_search = new XoopsFormCheckBox(' ', 'field_search', $field_search);
- $check_field_search->addOption(1, _AM_TDMCREATE_FIELD_SEARCH);
- // data row
- $this->htmltable_parameters->addRow();
- $this->htmltable_parameters->addCell($check_field_search->render(), null, 'data');
+ $check_field_search->addOption(1, _AM_TDMCREATE_FIELD_SEARCH);
+ $parameters_tray->addElement($check_field_search);
+
$field_required = $this->isNew() ? 0 : $this->getVar('field_required');
$check_field_required = new XoopsFormCheckBox(' ', 'field_required', $field_required);
$check_field_required->addOption(1, _AM_TDMCREATE_FIELD_REQUIRED);
- // data row
- $this->htmltable_parameters->addRow();
- $this->htmltable_parameters->addCell($check_field_required->render(), null, 'data');
+ $parameters_tray->addElement($check_field_required);
+
+ $form->addElement(new TDMCreateFormLabel('<td>'.$parameters_tray->render().'</td></tr>'));
}
- $this->htmltable->addCell($this->htmltable_parameters->render(), null, 'data');
-
- if (!$this->isNew()) {
- $tableId_Hidden = new XoopsFormHidden('table_id', $this->table->getVar('table_id'));
- $form->addElement($tableId_Hidden);
- //$form->addElement(new XoopsFormHidden('fields_modified', true));
- }
}
- $formHidden = new XoopsFormHidden('op', 'save_fields');
- $formButton = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
- $this->htmltable->addCell($formHidden->render(), null, 'data');
- $this->htmltable->addCell($formButton->render(), null, 'data');
- $form->addElement($this->htmltable->render());
+ $form->addElement(new XoopsFormHidden('field_tid', $field_tid));
+ $form->addElement(new TDMCreateFormLabel('</tbody>'));
+ $form->addElement(new TDMCreateFormLabel('<tfoot><tr>'));
+ $form_hidden = new XoopsFormHidden('op', 'save');
+ $form_button = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
+ $form->addElement(new TDMCreateFormLabel('<td colspan="8">'.$form_hidden->render().'</td>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'.$form_button->render().'</td>'));
+ $form->addElement(new TDMCreateFormLabel('</tr></tfoot></table>'));
return $form;
}
}
+/*
+* @Class TDMCreateFieldsHandler
+* @extends XoopsPersistableObjectHandler
+*/
class TDMCreateFieldsHandler extends XoopsPersistableObjectHandler
{
- function __construct(&$db)
+ /*
+ * @public function constructor class
+ * @param mixed $db
+ */
+ public function __construct(&$db)
{
parent::__construct($db, 'mod_tdmcreate_fields', 'tdmcreatefields', 'field_id', 'field_tid');
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php 2014-04-02 12:54:37 UTC (rev 12419)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php 2014-04-03 13:51:04 UTC (rev 12420)
@@ -22,13 +22,19 @@
die('XOOPS root path not defined');
}
-class AdminFooter extends HeaderFile
+class AdminFooter extends TDMCreateFile
{
/*
+ * @var string
+ */
+ private $tdmcfile = null;
+
+ /*
* @public function constructor
* @param string $modules
*/
public function __construct($module, $file_name) {
+ $this->tdmcfile = TDMCreateFile::getInstance();
$this->module = $module;
$this->file_name = $file_name;
}
@@ -56,7 +62,8 @@
$support_name = $this->getSupportName();
$support_url = $this->getSupportUrl();
$language = $this->getLanguage('_AM_', '_');
- $ret <<<EOT
+ $content = $this->getHeaderFilesComments($module, $file_name).PHP_EOL;
+ $content .= <<<EOT
\necho "<div class='center'><a href='http://www.xoops.org' title='Visit XOOPS' target='_blank'>
<img src='".\$sysPathIcon32."/xoopsmicrobutton.gif' alt='XOOPS' /></a></div>";
echo "<div class='center smallsmall italic pad5'>
@@ -64,6 +71,7 @@
<a href='{$support_url}' title='Visit {$support_name}' class='tooltip' rel='external'>{$support_name}</a></div>";
xoops_cp_footer();
EOT;
- return $ret;
+ $this->tdmcfile->create($path, $file_name, $content, $created, $notcreated);
+ return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-04-02 12:54:37 UTC (rev 12419)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-04-03 13:51:04 UTC (rev 12420)
@@ -20,7 +20,7 @@
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-class TDMCreateFile
+class TDMCreateFile extends TDMCreateAbstractFiles
{
/*
* @var string
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php 2014-04-02 12:54:37 UTC (rev 12419)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php 2014-04-03 13:51:04 UTC (rev 12420)
@@ -21,13 +21,15 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
+require_once 'htmltable.php';
+
/**
* Form HTML
*
*/
-class HtmlForm
-{
- /**
+class TDMCreateHtmlForm
+{
+ /**
* name attribute
*
* @var string
@@ -35,13 +37,6 @@
private $name = null;
/**
- * id attribute
- *
- * @var mixed
- */
- private $id = null;
-
- /**
* action attribute
*
* @var mixed
@@ -55,21 +50,14 @@
*/
private $method = null;
- /**
- * display attribute
+ /**
+ * extra attribute
*
- * @var bool
+ * @var mixed
*/
- private $display = false;
+ private $extra = null;
/**
- * hidden attribute
- *
- * @var bool
- */
- private $hidden = false;
-
- /**
* constructor
*
*/
@@ -91,50 +79,62 @@
}
/**
- * Function getForm
+ * Function getHtmlForm
*
* @param string $name "name" attribute for the <form> tag
- * @param string $id "id" attribute for the <for...
[truncated message content] |
|
From: <txm...@us...> - 2014-04-05 13:27:52
|
Revision: 12423
http://sourceforge.net/p/xoops/svn/12423
Author: txmodxoops
Date: 2014-04-05 13:27:49 +0000 (Sat, 05 Apr 2014)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_header.html
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-04-05 02:59:29 UTC (rev 12422)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-04-05 13:27:49 UTC (rev 12423)
@@ -56,7 +56,7 @@
$template_main = 'tdmcreate_building.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
- include_once(TDMC_PATH . '/class/building.php');
+ include_once TDMC_PATH . '/class/building.php';
$handler = TDMCreateBuilding::getInstance();
$form = $handler->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-05 02:59:29 UTC (rev 12422)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-05 13:27:49 UTC (rev 12423)
@@ -45,7 +45,7 @@
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
- $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
$GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
@@ -91,8 +91,9 @@
// Define main template
$template_main = 'tdmcreate_fields.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
- $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
- $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
+ $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$obj =& $fieldsHandler->create();
$form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
@@ -119,8 +120,8 @@
'field_null' => $_POST['field_null'],
'field_default' => $_POST['field_default'],
'field_key' => $_POST['field_key'],
- 'field_autoincrement' => (($_REQUEST['field_element'] == 1) ? '1' : '0'),
- 'field_element' => $_POST['field_element'],
+ 'field_autoincrement' => (($_REQUEST['field_autoincrement'] == 1) ? '1' : '0'),
+ 'field_element' => $_REQUEST['fieldelement_name'],
'field_inlist' => (($_REQUEST['field_inlist'] == 1) ? '1' : '0'),
'field_inform' => (($_REQUEST['field_inform'] == 1) ? '1' : '0'),
'field_admin' => (($_REQUEST['field_admin'] == 1) ? '1' : '0'),
@@ -144,10 +145,10 @@
// Define main template
$template_main = 'tdmcreate_tables.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
- $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
- $GLOBALS['xoopsTpl']->assign('button_tables_list', $adminMenu->renderButton());
- $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
- $GLOBALS['xoopsTpl']->assign('button_fields_list', $adminMenu->renderButton());
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
+ $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
+ $adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$obj = $fieldsHandler->get($field_id);
$form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-04-05 02:59:29 UTC (rev 12422)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-04-05 13:27:49 UTC (rev 12423)
@@ -33,7 +33,7 @@
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
- $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
$criteria = new CriteriaCompo();
@@ -77,7 +77,7 @@
$template_main = 'tdmcreate_modules.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
- $GLOBALS['xoopsTpl']->assign('button_list', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$obj =& $modulesHandler->create();
$form = $obj->getForm();
@@ -164,8 +164,7 @@
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
- $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
- $GLOBALS['xoopsTpl']->assign('button_list', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$obj = $modulesHandler->get($mod_id);
$form = $obj->getForm();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-05 02:59:29 UTC (rev 12422)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-05 13:27:49 UTC (rev 12423)
@@ -40,7 +40,7 @@
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
- $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
//$GLOBALS['xoopsTpl']->assign('tdmc_upload_table_url', TDMC_UPLOAD_IMGTAB_URL);
@@ -120,7 +120,7 @@
$template_main = 'tdmcreate_tables.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
- $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$obj =& $tablesHandler->create();
$form = $obj->getForm();
@@ -132,11 +132,23 @@
redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
if (isset($table_id)) {
- $obj =& $tablesHandler->get($table_id);
+ $obj =& $tablesHandler->get($table_id);
} else {
$obj =& $tablesHandler->create();
- }
- //Form tables
+ }
+ // Verification if name table exist
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('table_name', $obj->getVar('table_name')));
+ $criteria->add(new Criteria('table_mid', $mod_id), 'AND');
+ $table_name_search = $tablesHandler->getAll($criteria);
+ unset($criteria);
+ foreach (array_keys($table_name_search) as $t)
+ {
+ if ( $_POST['table_name'] === $table_name_search[$t]->getVar('table_name') ) {
+ redirect_header('tables.php?op=new', 5, _AM_TDMCREATE_ERROR_TABLE_NAME_EXIST);
+ }
+ }
+ // Form save tables
$obj->setVars(array('table_mid' => $table_mid,
'table_name' => $_POST['table_name'],
'table_category' => (($_REQUEST['table_category'] == 1) ? '1' : '0'),
@@ -192,8 +204,9 @@
// Define main template
$template_main = 'tdmcreate_tables.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
- $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
- $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
+ $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=list', 'list');
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$obj = $tablesHandler->get($table_id);
$form = $obj->getForm();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-05 02:59:29 UTC (rev 12422)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-05 13:27:49 UTC (rev 12423)
@@ -126,7 +126,7 @@
$form->addElement(new TDMCreateFormLabel('<tr class="'.$class.'">'));
// Index ID
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$i.'</td>'));
- $field_name = $this->isNew() ? $table_fieldname : $this->getVar('field_name');
+ $field_name = $this->isNew() ? $table_fieldname . '_' : $this->getVar('field_name');
$field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name', 15, 255, $field_name);
// Field Name
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
@@ -183,14 +183,14 @@
}
$parameters_tray->addElement($field_elements_select);
- $field_inline = $this->isNew() ? 0 : $this->getVar('field_inline');
- $check_field_inline = new XoopsFormCheckBox(' ', 'field_inline', $field_inline);
- $check_field_inline->addOption(1, _AM_TDMCREATE_FIELD_ADMIN);
- $parameters_tray->addElement($check_field_inline);
+ $field_inlist = $this->isNew() ? 0 : $this->getVar('field_inlist');
+ $check_field_inlist = new XoopsFormCheckBox(' ', 'field_inlist', $field_inlist);
+ $check_field_inlist->addOption(1, _AM_TDMCREATE_FIELD_INLIST);
+ $parameters_tray->addElement($check_field_inlist);
$field_inform = $this->isNew() ? 0 : $this->getVar('field_inform');
$check_field_inform = new XoopsFormCheckBox(' ', 'field_inform', $field_inform);
- $check_field_inform->addOption(1, _AM_TDMCREATE_FIELD_ADMIN);
+ $check_field_inform->addOption(1, _AM_TDMCREATE_FIELD_INFORM);
$parameters_tray->addElement($check_field_inform);
$field_admin = $this->isNew() ? 0 : $this->getVar('field_admin');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-04-05 02:59:29 UTC (rev 12422)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-04-05 13:27:49 UTC (rev 12423)
@@ -80,30 +80,37 @@
$action = $_SERVER['REQUEST_URI'];
}
- $title = $this->isNew() ? sprintf(_AM_TDMCREATE_TABLE_ADD) : sprintf(_AM_TDMCREATE_TABLE_EDIT);
+ $isNew = $this->isNew(); $table_name = $this->getVar('table_name');
+ $title = $isNew ? sprintf(_AM_TDMCREATE_TABLE_ADD) : sprintf(_AM_TDMCREATE_TABLE_EDIT);
+ //$type = $isNew ? 'new' : 'edit'; $action.'&table_mid='.
xoops_load('xoopsformloader');
$form = new XoopsThemeForm($title, 'tableform', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
- $modulesHandler =& xoops_getModuleHandler('modules', 'TDMCreate');
+ $modulesHandler =& xoops_getModuleHandler('modules');
$mods_select = new XoopsFormSelect(_AM_TDMCREATE_TABLE_MODULES, 'table_mid', $this->getVar('table_mid'));
- $mods_select->addOptionArray($modulesHandler->getList());
- $mods_select->setExtra('onchange="document.forms.tableform.table_name.parentElement.parentElement;"');
+ //$mods_select->setExtra('onchange="window.location=\'\'+this.options[this.selectedIndex].value"');
+ $mods_select->addOption($action, _AM_TDMCREATE_TABLE_MODSELOPT);
+ foreach ($modulesHandler->getList() as $mod_id => $mod_name) {
+ $mods_select->addOption($mod_id, $mod_name);
+ }
+ //$mods_select->addOptionArray();
$form->addElement($mods_select, true);
$table_name = new XoopsFormText(_AM_TDMCREATE_TABLE_NAME, 'table_name', 50, 255, $this->getVar('table_name'));
$table_name->setDescription(_AM_TDMCREATE_TABLE_NAME_DESC);
$form->addElement($table_name, true);
- $tablesHandler =& xoops_getModuleHandler('tables', 'TDMCreate');
+ $tablesHandler =& xoops_getModuleHandler('tables');
$criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_mid', $this->getVar('table_mid')));
$criteria->add(new Criteria('table_category', 1), 'AND');
+ $criteria->add(new Criteria('table_mid', $this->getVar('table_mid')), 'AND');
+ $criteria->add(new Criteria('table_name', $this->getVar('table_name'), '!='));
$table_category = $tablesHandler->getCount($criteria);
unset($criteria);
- if ( $table_category == 0 ) {
- $radio_category = $this->isNew() ? 0 : $this->getVar('table_category');
+ if ( $table_category == 0 || !$this->getVar('table_name') ) {
+ $radio_category = $isNew ? 0 : $this->getVar('table_category');
$category = new XoopsFormRadioYN(_AM_TDMCREATE_TABLE_CATEGORY, 'table_category', $radio_category);
$category->setDescription(_AM_TDMCREATE_TABLE_CATEGORY_DESC);
$form->addElement($category);
@@ -148,38 +155,46 @@
$form->addElement($imgtray1);
$options_tray = new XoopsFormElementTray(_OPTIONS, '<br />');
- $table_blocks = $this->isNew() ? 0 : $this->getVar('table_blocks');
+ $table_blocks = $isNew ? 0 : $this->getVar('table_blocks');
$check_table_blocks = new XoopsFormCheckBox(' ', 'table_blocks', $table_blocks);
$check_table_blocks->addOption(1, _AM_TDMCREATE_TABLE_BLOCKS);
$options_tray->addElement($check_table_blocks);
- $table_admin = $this->isNew() ? 0 : $this->getVar('table_admin');
+ $table_admin = $isNew ? 0 : $this->getVar('table_admin');
$check_table_admin = new XoopsFormCheckBox(' ', 'table_admin', $table_admin);
$check_table_admin->addOption(1, _AM_TDMCREATE_TABLE_ADMIN);
$options_tray->addElement($check_table_admin);
- $table_user = $this->isNew() ? 0 : $this->getVar('table_user');
+ $table_user = $isNew ? 0 : $this->getVar('table_user');
$check_table_user = new XoopsFormCheckBox(' ', 'table_user', $table_user);
$check_table_user->addOption(1, _AM_TDMCREATE_TABLE_USER);
$options_tray->addElement($check_table_user);
- $table_submenu = $this->isNew() ? 0 : $this->getVar('table_submenu');
+ $table_submenu = $isNew ? 0 : $this->getVar('table_submenu');
$check_table_submenu = new XoopsFormCheckBox(' ', 'table_submenu', $table_submenu);
$check_table_submenu->addOption(1, _AM_TDMCREATE_TABLE_SUBMENU);
$options_tray->addElement($check_table_submenu);
- $table_search = $this->isNew() ? 0 : $this->getVar('table_search');
+ $table_search = $isNew ? 0 : $this->getVar('table_search');
$check_table_search = new XoopsFormCheckBox(' ', 'table_search', $table_search);
$check_table_search->addOption(1, _AM_TDMCREATE_TABLE_SEARCH);
$options_tray->addElement($check_table_search);
- $table_comments = $this->isNew() ? 0 : $this->getVar('table_comments');
+ $table_comments = $isNew ? 0 : $this->getVar('table_comments');
$check_table_comments = new XoopsFormCheckBox(' ', 'table_comments', $table_comments);
$check_table_comments->addOption(1, _AM_TDMCREATE_TABLE_COMMENTS);
$options_tray->addElement($check_table_comments);
- $table_notifications = $this->isNew() ? 0 : $this->getVar('table_notifications');
+ $table_notifications = $isNew ? 0 : $this->getVar('table_notifications');
$check_table_notifications = new XoopsFormCheckBox(' ', 'table_notifications', $table_notifications);
$check_table_notifications->addOption(1, _AM_TDMCREATE_TABLE_NOTIFICATIONS);
$options_tray->addElement($check_table_notifications);
- $table_permissions = $this->isNew() ? 0 : $this->getVar('table_permissions');
- $check_table_permissions = new XoopsFormCheckBox(' ', 'table_permissions', $table_permissions);
- $check_table_permissions->addOption(1, _AM_TDMCREATE_TABLE_PERMISSIONS);
- $options_tray->addElement($check_table_permissions);
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('table_permissions', 1), 'AND');
+ $criteria->add(new Criteria('table_mid', $this->getVar('table_mid')), 'AND');
+ $criteria->add(new Criteria('table_name', $this->getVar('table_name'), '!='));
+ $table_permissions = $tablesHandler->getCount($criteria);
+ unset($criteria);
+ if ( $table_permissions == 0 || !$this->getVar('table_name') ) {
+ $table_permissions = $isNew ? 0 : $this->getVar('table_permissions');
+ $check_table_permissions = new XoopsFormCheckBox(' ', 'table_permissions', $table_permissions);
+ $check_table_permissions->addOption(1, _AM_TDMCREATE_TABLE_PERMISSIONS);
+ $options_tray->addElement($check_table_permissions);
+ }
$options_tray->setDescription(_AM_TDMCREATE_TABLE_OPTIONS_CHECKS_DESC);
$form->addElement($options_tray);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js 2014-04-05 02:59:29 UTC (rev 12422)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js 2014-04-05 13:27:49 UTC (rev 12423)
@@ -55,4 +55,7 @@
});
$('table#show_rows tr.toggleChild').toggle();
});
+ $('tr.modules').children().css('background-color', '#fdf5f5');
+ $('tr.toggleMain, tr.tables').children().css('background-color', '#f5fdf5');
+ $('tr.toggleMain, tr.fields').children().css('background-color', '#f5f5fd');
});
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-04-05 02:59:29 UTC (rev 12422)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-04-05 13:27:49 UTC (rev 12423)
@@ -332,4 +332,8 @@
// Added in version 1.91
define('_AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY', "Toggle Change Display");
define('_AM_TDMCREATE_TOGGLE_SUCCESS', "Successfully Changed Display");
-define('_AM_TDMCREATE_TOGGLE_FAILED', "Changing Display Failed");
\ No newline at end of file
+define('_AM_TDMCREATE_TOGGLE_FAILED', "Changing Display Failed");
+define('_AM_TDMCREATE_ERROR_TABLE_NAME_EXIST', "WARNING: This category exists, create a new one with a different name");
+define('_AM_TDMCREATE_FIELD_INLIST', "Admin: Visible in list");
+define('_AM_TDMCREATE_FIELD_INFORM', "Admin: Visible in form");
+define('_AM_TDMCREATE_TABLE_MODSELOPT', "Select a Module");
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php 2014-04-05 02:59:29 UTC (rev 12422)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php 2014-04-05 13:27:49 UTC (rev 12423)
@@ -78,4 +78,5 @@
define('_MI_TDMCREATE_MODULE_MIN_ADMIN', "Minimum Admin");
define('_MI_TDMCREATE_MODULE_MIN_MYSQL', "Minimum Database");
define('_MI_TDMCREATE_MODULES_ADMINPAGER', "Modules adminpager");
-define('_MI_TDMCREATE_TABLES_ADMINPAGER', "Tables adminpager");
\ No newline at end of file
+define('_MI_TDMCREATE_TABLES_ADMINPAGER', "Tables adminpager");
+define('_MI_TDMCREATE_FIELDS_ADMINPAGER', "Fields adminpager");
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-04-05 02:59:29 UTC (rev 12422)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-04-05 13:27:49 UTC (rev 12423)
@@ -66,7 +66,7 @@
) ENGINE=MyISAM;
#
-# Table structure for table `mod_tdmcreate_fields` 19
+# Table structure for table `mod_tdmcreate_fields` 21
#
CREATE TABLE `mod_tdmcreate_fields` (
@@ -200,8 +200,8 @@
`fieldelement_fid` int(5) NOT NULL auto_increment,`fieldelement_name` varchar(100) NOT NULL default '',
`fieldelement_value` varchar(100) NOT NULL default '',
PRIMARY KEY (`fieldelement_fid`),
-KEY `fieldelement_value` (`fieldelement_value`),
-KEY `fieldelement_name` (`fieldelement_name`)
+KEY `fieldelement_name` (`fieldelement_name`),
+KEY `fieldelement_value` (`fieldelement_value`)
) ENGINE=MyISAM;
INSERT INTO `mod_tdmcreate_fieldelements` (`fieldelement_fid`, `fieldelement_name`, `fieldelement_value`) VALUES
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_header.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_header.html 2014-04-05 02:59:29 UTC (rev 12422)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_header.html 2014-04-05 13:27:49 UTC (rev 12423)
@@ -1,4 +1,4 @@
<div class="top">
<span class="left"><{$navigation}></span>
-<{if $button_new}><span class="right"><{$button_new}> </span><{/if}><{if $button_tables_list}><span class="right"> <{$button_tables_list}></span><{/if}><{if $button_fields_list}><span class="right"> <{$button_fields_list}></span><{/if}>
+<{if $buttons}><span class="right"><{$buttons}> </span><{/if}>
</div>
\ No newline at end of file
|
|
From: <txm...@us...> - 2014-04-07 23:49:40
|
Revision: 12435
http://sourceforge.net/p/xoops/svn/12435
Author: txmodxoops
Date: 2014-04-07 23:49:36 +0000 (Mon, 07 Apr 2014)
Log Message:
-----------
Updated
Work in progress
Merged script for logo generator from class/modules.php to js/functions.js
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/htmlsmartycodes.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/headerfiles.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-04-07 22:47:55 UTC (rev 12434)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-04-07 23:49:36 UTC (rev 12435)
@@ -47,8 +47,9 @@
/*} else {
$GLOBALS['xoopsTpl']->assign('base_architecture', false);
}*/
+ $mod_name = 'uploads/tdmcreate/modules/' . str_replace(' ', '', strtolower($modules->getVar('mod_name')));
// Creation of the structure of folders and files
- $GLOBALS['xoopsTpl']->assign('build_list', 'Under new construction - Temporary build');
+ $GLOBALS['xoopsTpl']->assign('build_list', 'Under new construction - Temporary build only folders of this selected module "'.$mod_name.'/"');
break;
case 'default':
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-04-07 22:47:55 UTC (rev 12434)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-04-07 23:49:36 UTC (rev 12435)
@@ -75,6 +75,7 @@
case 'new':
// Define main template
$template_main = 'tdmcreate_modules.html';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
@@ -114,11 +115,10 @@
'mod_manual_file' => $_POST['mod_manual_file']));
//Form mod_image
include_once XOOPS_ROOT_PATH . '/class/uploader.php';
- $uploaddir = TDMC_UPLOAD_PATH.'/images/modules/';
- $uploader = new XoopsMediaUploader($uploaddir, xoops_getModuleOption('mimetypes'),
- xoops_getModuleOption('maxsize'), null, null);
+ $uploader = new XoopsMediaUploader(TDMC_UPLOAD_IMGMOD_PATH, $GLOBALS['xoopsModuleConfig']['mimetypes'],
+ $GLOBALS['xoopsModuleConfig']['maxsize'], null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attaccedFile']['name']);
+ $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']);
$name_img = $_GET['mod_name'].'_slogo.'.$extension;
$uploader->setPrefix($name_img);
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
@@ -138,13 +138,15 @@
'mod_support_name' => $_POST['mod_support_name'],
'mod_website_url' => $_POST['mod_website_url'],
'mod_website_name' => $_POST['mod_website_name'],
- 'mod_release' => $_POST['mod_release'], 'mod_status' => $_POST['mod_status'],
+ 'mod_release' => $_POST['mod_release'],
+ 'mod_status' => $_POST['mod_status'],
'mod_admin' => (($_REQUEST['mod_admin'] == 1) ? '1' : '0'),
'mod_user' => (($_REQUEST['mod_user'] == 1) ? '1' : '0'),
'mod_submenu' => (($_REQUEST['mod_submenu'] == 1) ? '1' : '0'),
'mod_search' => (($_REQUEST['mod_search'] == 1) ? '1' : '0'),
'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'),
'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0'),
+ 'mod_permissions' => (($_REQUEST['mod_permissions'] == 1) ? '1' : '0'),
'mod_donations' => $_POST['mod_donations'],
'mod_subversion' => $_POST['mod_subversion'])
);
@@ -161,6 +163,7 @@
case 'edit':
// Define main template
$template_main = 'tdmcreate_modules.html';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-07 22:47:55 UTC (rev 12434)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-07 23:49:36 UTC (rev 12435)
@@ -20,7 +20,7 @@
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
require_once 'simplelabel.php';
-require_once 'themeform.php';
+require_once 'form/themeform.php';
/*
* @Class TDMCreateFields
* @extends XoopsObject
@@ -28,7 +28,7 @@
class TDMCreateFields extends XoopsObject
{
/**
- * @var string
+ * @var mixed
*/
private $table = null;
@@ -243,12 +243,18 @@
*/
class TDMCreateFieldsHandler extends XoopsPersistableObjectHandler
{
+ /**
+ * @var mixed
+ */
+ public $table = null;
+
/*
* @public function constructor class
* @param mixed $db
*/
public function __construct(&$db)
{
+ $this->table = TDMCreateTables::getInstance();
parent::__construct($db, 'mod_tdmcreate_fields', 'tdmcreatefields', 'field_id', 'field_tid');
}
}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php 2014-04-07 23:49:36 UTC (rev 12435)
@@ -0,0 +1,216 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: headerfiles.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+/**
+ * Abstract base class for files
+ */
+abstract class TDMCreateAbstractFiles
+{
+ /**
+ * "path" attribute of the files
+ *
+ * @var string
+ */
+ private $path = TDMC_PATH;
+
+ /**
+ * "upload_path" attribute of the files
+ *
+ * @var string
+ */
+ private $upload_path = TDMC_UPLOAD_MODULES_PATH;
+
+ /**
+ * "module" attribute of the files
+ *
+ * @var mixed
+ */
+ private $module = null;
+
+ /**
+ * "table" attribute of the files
+ *
+ * @var mixed
+ */
+ private $table = null;
+
+ /**
+ * "folder" attribute of the files
+ *
+ * @var mixed
+ */
+ private $folder = null;
+
+ /**
+ * "file_name" attribute of the files
+ *
+ * @var mixed
+ */
+ private $file_name = null;
+
+ /**
+ * Generates output for the files.
+ *
+ * This method is abstract and must be overwritten by the child classes.
+ *
+ * @abstract
+ */
+ abstract function render();
+
+ /*
+ * @public function getHeader
+ * @param string $path
+ * @param string $module
+ * @param string $folder
+ * @param string $file_name
+ */
+ public function getHeader($path, $module, $folder, $file_name) {
+ $this->path = $path;
+ $this->folder = $folder;
+ $this->module = $module;
+ $this->file_name = $file_name;
+ $ret = $this->path . DIRECTORY_SEPARATOR . $this->module . DIRECTORY_SEPARATOR . $this->folder . DIRECTORY_SEPARATOR . $this->file_name;
+ return $ret;
+ }
+
+ /**
+ * get the "path" attribute for the element
+ *
+ * @return string "path" attribute value
+ */
+ public function getPath()
+ {
+ return $this->path;
+ }
+
+ /**
+ * get the "upload_path" attribute for the element
+ *
+ * @return string "upload_path" attribute value
+ */
+ public function getUploadPath()
+ {
+ return $this->upload_path;
+ }
+
+ /**
+ * get the "upload_path" attribute for the element
+ *
+ * @return string "upload_path" attribute value
+ */
+ public function getUploadPath()
+ {
+ return $this->upload_path;
+ }
+
+ /**
+ * get the "file_name" attribute for the element
+ *
+ * @return string "file_name" attribute value
+ */
+ public function getFileName()
+ {
+ return $this->file_name;
+ }
+
+ /*
+ * @public function getModuleName
+ * @param null
+ */
+ public function getModuleName() {
+ $ret = $this->module->getVar('mod_name');
+ return $ret;
+ }
+
+ /*
+ * @public function getTableName
+ * @param null
+ */
+ public function getTableName() {
+ $ret = $this->table->getVar('table_name');
+ return $ret;
+ }
+
+ /*
+ * @public function getLanguage
+ * @param string $prefix
+ * @param string $postfix
+ */
+ public function getLanguage($prefix = '', $postfix = '') {
+ $lang = '_' . $prefix . '_' . strtoupper($this->module->getVar('mod_name'));
+ if(!empty($postfix)) {
+ $ret = $lang . '_' . $postfix;
+ } else {
+ $ret = $lang;
+ }
+ return $ret;
+ }
+
+ /*
+ * @public function getHeaderFilesComments
+ * @param string $module
+ * @param string $file_name
+ */
+ public function getHeaderFilesComments($module, $file_name) {
+ $this->module = $module;
+ $this->file_name = $file_name;
+
+ $mod_name = $this->module->getVar('mod_name');
+ $mod_version = $this->module->getVar('mod_version');
+ $mod_since = $this->module->getVar('mod_since');
+ $mod_min_xoops = $this->module->getVar('mod_min_xoops');
+ $mod_author = $this->module->getVar('mod_author');
+ $mod_credits = $this->module->getVar('mod_credits');
+ $mod_a_m = $this->module->getVar('mod_author_mail');
+ $mod_a_w_url = $this->module->getVar('mod_author_website_url');
+ $mod_license = $this->module->getVar('mod_license');
+ $mod_subversion = $this->module->getVar('mod_subversion');
+ $date = date('D Y/m/d G:i:s');
+ $package = strtolower($mod_name);
+
+ $ret = <<<EOT
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
+/**
+ * {$mod_name} module for xoops
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license {$mod_license}
+ * @package {$package}
+ * @since {$mod_since}
+ * @min_xoops {$mod_min_xoops}
+ * @author {$mod_author} <{$mod_a_m}> - <{$mod_a_w_url}>
+ * @version \$Id: {$mod_version} {$file_name} {$mod_subversion} {$date}Z {$mod_credits} \$
+ */\n
+EOT;
+ return $ret;
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php 2014-04-07 22:47:55 UTC (rev 12434)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php 2014-04-07 23:49:36 UTC (rev 12435)
@@ -18,18 +18,11 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: admin_footer.php 12258 2014-01-02 09:33:29Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
class AdminFooter extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
-
- /*
* @public function constructor
* @param string $modules
*/
@@ -61,7 +54,7 @@
public function render() {
$support_name = $this->getSupportName();
$support_url = $this->getSupportUrl();
- $language = $this->getLanguage('_AM_', '_');
+ $language = $this->getLanguage('AM');
$content = $this->getHeaderFilesComments($module, $file_name).PHP_EOL;
$content .= <<<EOT
\necho "<div class='center'><a href='http://www.xoops.org' title='Visit XOOPS' target='_blank'>
@@ -71,7 +64,7 @@
<a href='{$support_url}' title='Visit {$support_name}' class='tooltip' rel='external'>{$support_name}</a></div>";
xoops_cp_footer();
EOT;
- $this->tdmcfile->create($path, $file_name, $content, $created, $notcreated);
+ $this->tdmcfile->create($path, $file_name, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php 2014-04-07 22:47:55 UTC (rev 12434)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php 2014-04-07 23:49:36 UTC (rev 12435)
@@ -18,22 +18,17 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: admin_header.php 12258 2014-01-02 09:33:29Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
-class AdminHeader extends HeaderFile
-{
+class AdminHeader extends TDMCreateFile
+{
/*
- * @var mixed
- */
- public $table = null;
- /*
* @public function constructor
* @param string $module
* @param string $file_name
*/
public function __construct($module, $table, $file_name) {
+ $this->tdmcfile = TDMCreateFile::getInstance();
$this->module = $module;
$this->table = $table;
$this->file_name = $file_name;
@@ -46,21 +41,22 @@
$module_name = $this->getModuleName();
$stl_mod_name = strtolower($module_name);
$ucfmod_name = ucfirst($module_name);
- $language = $this->getLanguage('_AM_');
- $ret <<<EOT
+ $language = $this->getLanguage('AM');
+ $content = $this->getHeaderFilesComments($this->module, $this->file_name).PHP_EOL;
+ $content .= <<<EOT
\nrequire_once dirname(dirname(dirname(dirname(__FILE__)))). '/include/cp_header.php';
\$thisPath = dirname(dirname(__FILE__));
include_once \$thisPath.'/include/common.php';
include_once \$thisPath.'/include/functions.php';
EOT;
if ( $table_name != '' ) {
- $ret .= <<<EOT
+ $content .= <<<EOT
\ninclude_once \$thisPath.'/class/helper.php';
// Get instance
\${$stl_mod_name}_Helper = {$ucfmod_name}Helper::getInstance();
EOT;
}
- $ret .= <<<EOT
+ $content .= <<<EOT
\n\n\$thisModule = \$GLOBALS['xoopsModule']->getVar('dirname');
\$sysPathIcon16 = '../' . \$xoopsModule->getInfo('sysicons16');
@@ -70,12 +66,12 @@
\$modPathIcon16 = \$xoopsModule->getInfo('modicons16');
\$modPathIcon32 = \$xoopsModule->getInfo('modicons32');\n
EOT;
- foreach (array_keys($this->_table) as $i)
+ foreach (array_keys($this->table) as $i)
{
- $table_name = $this->_table[$i]->getVar('table_name');
- $ret .= '$'.$table_name.'Handler =& xoops_getModuleHandler(\''.$table_name. '\', $thisModule);'.PHP_EOL;
+ $table_name = $this->table[$i]->getVar('table_name');
+ $content .= '$'.$table_name.'Handler =& xoops_getModuleHandler(\''.$table_name. '\', $thisModule);'.PHP_EOL;
}
- $ret .=<<<EOT
+ $content .=<<<EOT
\n\n\$myts =& MyTextSanitizer::getInstance();
if (!isset(\$xoopsTpl) || !is_object(\$xoopsTpl)) {
include_once(XOOPS_ROOT_PATH."/class/template.php");
@@ -101,6 +97,7 @@
xoops_cp_header();
\$adminMenu = new ModuleAdmin();
EOT;
- return $ret;
+ $this->tdmcfile->create($path, $file_name, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php 2014-04-07 22:47:55 UTC (rev 12434)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php 2014-04-07 23:49:36 UTC (rev 12435)
@@ -18,32 +18,20 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: admin_index.php 12258 2014-01-02 09:33:29Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
-class AdminIndex extends HeaderFile
+class AdminIndex extends TDMCreateFile
{
/*
- * @var string
- */
- public $_module = '';
- /*
- * @var string
- */
- public $_table = array();
- /*
- * @var string
- */
- public $file_name = null;
- /*
* @public function constructor
* @param string $module
+ * @param mixed $table
* @param string $file_name
*/
- public function __construct($module, $_table, $file_name) {
- $this->_module = $module;
- $this->_table[] = $_table;
+ public function __construct($module, $table, $file_name) {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->module = $module;
+ $this->table = $table;
$this->file_name = $file_name;
}
/*
@@ -52,20 +40,21 @@
*/
public function render() {
$module_name = $this->getModuleName();
- $language = $this->getLanguage('_AM_');
- $ret <<<EOT
+ $language = $this->getLanguage('AM');
+ $content = $this->getHeaderFilesComments($this->module, $this->file_name).PHP_EOL;
+ $content .= <<<EOT
\ninclude_once 'header.php';
EOT;
- foreach (array_keys($this->_table) as $i)
+ foreach (array_keys($this->table) as $i)
{
- $table_name = $this->_table[$i]->getVar('table_name');
- $table_fieldname = $this->_table[$i]->getVar('table_fieldname');
- $ret .= <<<EOT
+ $table_name = $this->table[$i]->getVar('table_name');
+ $table_fieldname = $this->table[$i]->getVar('table_fieldname');
+ $content .= <<<EOT
\n//count "total {$table_name}"
\$total_{$table_name} = \${$table_name}Handler->getCount();
EOT;
if(isset($_REQUEST['table_status'])) {
- $ret .= <<<EOT
+ $content .= <<<EOT
\n//count "status"
\$criteria = new CriteriaCompo();
\$criteria->add(new Criteria("{$table_fieldname}_status", 1));
@@ -73,7 +62,7 @@
EOT;
}
if(isset($_REQUEST['table_online'])) {
- $ret .= <<<EOT
+ $content .= <<<EOT
\n//count "online"
\$criteria = new CriteriaCompo();
\$criteria->add(new Criteria("{$table_fieldname}_online", 1));
@@ -81,49 +70,50 @@
EOT;
}
if(isset($_REQUEST['table_waiting'])) {
- $ret .= <<<EOT
+ $content .= <<<EOT
\n\$criteria = new CriteriaCompo();
\$criteria->add(new Criteria("{$table_fieldname}_waiting", 1));
\${$table_fieldname}_waiting = ${$table_name}Handler->getCount(\$criteria);
EOT;
}
}
- $ret .= <<<EOT
+ $content .= <<<EOT
\n// InfoBox Statistics
\$adminMenu->addInfoBox({$language}STATISTICS);
EOT;
- foreach (array_keys($this->_table) as $i)
+ foreach (array_keys($this->table) as $i)
{
- $table_name = $this->_table[$i]->getVar('table_name');
- $table_fieldname = $this->_table[$i]->getVar('table_fieldname');
- $ta_stu_table_name = $thereare.strtoupper($table_name);
- $ta_stu_table_fieldname = $thereare.strtoupper($table_fieldname);
- $ret .= <<<EOT
+ $table_name = $this->table[$i]->getVar('table_name');
+ $table_fieldname = $this->table[$i]->getVar('table_fieldname');
+ $ta_stutable_name = $thereare.strtoupper($table_name);
+ $ta_stutable_fieldname = $thereare.strtoupper($table_fieldname);
+ $content .= <<<EOT
\n// InfoBox {$table_name}
-\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stu_table_name}, \$total_{$table_name});
+\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stutable_name}, \$total_{$table_name});
EOT;
if(isset($_REQUEST['table_status'])) {
- $ret .= <<<EOT
-\n\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stu_table_fieldname}_STATUS, \${$table_fieldname}_status);
+ $content .= <<<EOT
+\n\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stutable_fieldname}_STATUS, \${$table_fieldname}_status);
EOT;
}
if(isset($_REQUEST['table_online'])) {
- $ret .= <<<EOT
-\n\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stu_table_fieldname}_ONLINE, \${$table_fieldname}_online);
+ $content .= <<<EOT
+\n\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stutable_fieldname}_ONLINE, \${$table_fieldname}_online);
EOT;
}
if(isset($_REQUEST['table_waiting'])) {
- $ret .= <<<EOT
-\n\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stu_table_fieldname}_WAITING, \${$table_fieldname}_waiting);
+ $content .= <<<EOT
+\n\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stutable_fieldname}_WAITING, \${$table_fieldname}_waiting);
EOT;
}
}
- $ret .= <<<EOT
+ $content .= <<<EOT
\n// Render Index
echo \$adminMenu->addNavigation('index.php');
echo \$adminMenu->renderIndex();
include_once 'footer.php';
EOT;
- return $ret;
+ $this->tdmcfile->create($path, $file_name, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php 2014-04-07 22:47:55 UTC (rev 12434)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php 2014-04-07 23:49:36 UTC (rev 12435)
@@ -18,25 +18,11 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: admin_menu.php 12258 2014-01-02 09:33:29Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
-class AdminMenu extends HeaderFile
+class AdminMenu extends TDMCreateFile
{
/*
- * @var string
- */
- public $_module = '';
- /*
- * @var string
- */
- public $_table = array();
- /*
- * @var string
- */
- public $file_name = null;
- /*
* @var bool
*/
private $permissions = false;
@@ -46,8 +32,9 @@
* @param string $file_name
*/
public function __construct($module, $table, $file_name, $permissions = false) {
- $this->_module = $module;
- $this->_table[] = $table;
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->module = $module;
+ $this->table = $table;
$this->file_name = $file_name;
$this->permissions = $permissions;
}
@@ -57,9 +44,10 @@
*/
public function render() {
$module_name = $this->getModuleName();
- $language = $this->getLanguage('_MI_', '_ADMENU');
+ $language = $this->getLanguage('MI', 'ADMENU');
$menu = 1;
- $ret = <<<EOT
+ $content = $this->getHeaderFilesComments($this->module, $this->file_name).PHP_EOL;
+ $content .= <<<EOT
\n\$dirname = basename( dirname( dirname( __FILE__ ) ) ) ;
\$module_handler =& xoops_gethandler('module');
\$xoopsModule =& XoopsModule::getByDirname(\$dirname);
@@ -77,7 +65,7 @@
{
if ( $this->_table[$i]->getVar('table_admin') == 1 )
{
- $ret .= <<<EOT
+ $content .= <<<EOT
\n\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/{$this->_table[$i]->getVar('table_name')}.php';
\$adminmenu[\$i]['icon'] = \$pathIcon32.'/{$this->_table[$i]->getVar('table_image')}';
@@ -89,7 +77,7 @@
$menu--;
if( $this->permissions != false ) {
$menu++;
- $ret .= <<<EOT
+ $content .= <<<EOT
\n\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/permissions.php';
\$adminmenu[\$i]['icon'] = \$pathIcon32.'/permissions.png';
@@ -97,13 +85,15 @@
EOT;
}
$menu++;
- $ret .= <<<EOT
+ $content .= <<<EOT
\n\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/about.php';
\$adminmenu[\$i]['icon'] = \$pathIcon32.'/about.png';
unset( \$i );
EOT;
unset( $menu );
- return $ret;
+
+ $this->tdmcfile->create($path, $file_name, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-04-07 22:47:55 UTC (rev 12434)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-04-07 23:49:36 UTC (rev 12435)
@@ -18,32 +18,19 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: admin_pages.php 12258 2014-01-02 09:33:29Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
-class AdminPages extends HeaderFile
+class AdminPages extends TDMCreateFile
{
/*
- * @var string
- */
- public $_module = '';
- /*
- * @var string
- */
- public $_table = array()...
[truncated message content] |
|
From: <txm...@us...> - 2014-04-12 21:28:10
|
Revision: 12442
http://sourceforge.net/p/xoops/svn/12442
Author: txmodxoops
Date: 2014-04-12 21:28:01 +0000 (Sat, 12 Apr 2014)
Log Message:
-----------
Updated
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/form_elements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/htmlsmartycodes.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_objects.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/fields_parameters.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-04-11 11:35:06 UTC (rev 12441)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-04-12 21:28:01 UTC (rev 12442)
@@ -56,6 +56,16 @@
default:
$template_main = 'tdmcreate_building.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
+ // Redirect if there aren't modules
+ $nb_modules = $modulesHandler->getObjects(null);
+ if ( $nb_modules == 0 ) {
+ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ }
+ // Redirect if there aren't tables
+ $nb_tables = $tablesHandler->getObjects(null);
+ if ($nb_tables == 0) {
+ redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
+ }
include_once TDMC_PATH . '/class/building.php';
$handler = TDMCreateBuilding::getInstance();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-11 11:35:06 UTC (rev 12441)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-12 21:28:01 UTC (rev 12442)
@@ -27,9 +27,9 @@
$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields');
$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');
// Get field Variables
-$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id');
+$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id', 0);
+$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid');
-$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb');
$field_name = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');
//
@@ -49,21 +49,29 @@
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
$GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
+ // Redirect if there aren't modules
+ $nb_modules = $modulesHandler->getObjects(null);
+ if ( $nb_modules == 0 ) {
+ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ }
// Get the list of tables
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $table_mid));
$criteria->setSort('table_id ASC, table_name');
$criteria->setOrder('ASC');
- $nb_tables = $tablesHandler->getCount();
+ $nb_tables = $tablesHandler->getCount($criteria);
$tables_arr = $tablesHandler->getAll($criteria);
unset($criteria);
+ if ($nb_tables == 0) {
+ redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
+ }
if ($nb_tables > 0)
{
foreach (array_keys($tables_arr) as $t)
{
$table['id'] = $t;
$table['mid'] = $tables_arr[$t]->getVar('table_mid');
- $table['name'] = $tables_arr[$t]->getVar('table_name');
+ $table['name'] = ucfirst($tables_arr[$t]->getVar('table_name'));
$table['image'] = $tables_arr[$t]->getVar('table_image');
$table['nbfields'] = $tables_arr[$t]->getVar('table_nbfields');
$table['blocks'] = $tables_arr[$t]->getVar('table_blocks');
@@ -73,9 +81,33 @@
$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');
- $GLOBALS['xoopsTpl']->append('tables_list', $table);
- unset($mod);
+ $table['permissions'] = $tables_arr[$t]->getVar('table_permissions');
+ // Get the list of tables
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('field_mid', $field_mid));
+ $criteria->add(new Criteria('field_tid', $t));
+ $criteria->setSort('field_id ASC, field_name');
+ $criteria->setOrder('ASC');
+ $nb_fields = $fieldsHandler->getCount($criteria);
+ $fields_arr = $fieldsHandler->getAll($criteria);
+ unset($criteria);
+ // Display tables list
+ $fields = array();
+ if ( $nb_fields > 0 )
+ {
+ foreach (array_keys($fields_arr) as $f)
+ {
+ $field['id'] = $f;
+ $field['mid'] = $fields_arr[$f]->getVar('field_mid');
+ $field['tid'] = $fields_arr[$f]->getVar('field_tid');
+ $field['name'] = str_replace('_', ' ', ucfirst($fields_arr[$f]->getVar('field_name')));
+ $fields[] = $field;
+ unset($field);
+ }
+ }
+ $table['fields'] = $fields;
+ $GLOBALS['xoopsTpl']->append('tables_list', $table);
+ unset($table);
}
if ( $nb_tables > $limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
@@ -83,7 +115,7 @@
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
- $GLOBALS['xoopsTpl']->assign('error', 'Add, Edit or List View in Tables');
+ $GLOBALS['xoopsTpl']->assign('error', 'Add, Edit or List View in Fields');
}
break;
@@ -96,47 +128,47 @@
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$obj =& $fieldsHandler->create();
- $form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
+ $form = $obj->getForm($field_tid, $field_mid, $field_numb, $field_name);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'save':
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
- }
- if (isset($field_id)) {
- $obj =& $fieldsHandler->get($field_id);
- } else {
- $obj =& $fieldsHandler->create();
- }
- //Form fields
- $obj->setVars(array('field_mid' => $table_mid,
- 'field_tid' => $table_id,
- 'field_name' => $_POST['field_name'],
- 'field_numb' => $table_nbfields,
- 'field_type' => $_POST['field_type'],
- 'field_value' => $_POST['field_value'],
- 'field_attribute' => $_POST['field_attribute'],
- 'field_null' => $_POST['field_null'],
- 'field_default' => $_POST['field_default'],
- 'field_key' => $_POST['field_key'],
- 'field_autoincrement' => (($_REQUEST['field_autoincrement'] == 1) ? '1' : '0'),
- 'field_element' => $_REQUEST['fieldelement_name'],
- 'field_inlist' => (($_REQUEST['field_inlist'] == 1) ? '1' : '0'),
- 'field_inform' => (($_REQUEST['field_inform'] == 1) ? '1' : '0'),
- 'field_admin' => (($_REQUEST['field_admin'] == 1) ? '1' : '0'),
- 'field_user' => (($_REQUEST['field_user'] == 1) ? '1' : '0'),
- 'field_block' => (($_REQUEST['field_block'] == 1) ? '1' : '0'),
- 'field_main' => (($_REQUEST['field_main'] == 1) ? '1' : '0'),
- 'field_search' => (($_REQUEST['field_search'] == 1) ? '1' : '0'),
- 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0')
- )
- );
-
- if ($fieldsHandler->insert($obj)) {
+ }
+ if (isset($field_id)) {
+ $obj =& $fieldsHandler->get($field_id);
+ } else {
+ $obj =& $fieldsHandler->create();
+ }
+ for( $i = 0; $i < $table_nbfields; $i++ ) {
+ $obj->setVars(array('field_mid' => $table_mid[$i],
+ 'field_tid' => $table_id[$i],
+ 'field_numb' => $table_nbfields[$i],
+ 'field_name' => $_POST['field_name'][$i],
+ 'field_type' => $_POST['field_type'][$i],
+ 'field_value' => $_POST['field_value'][$i],
+ 'field_attribute' => $_POST['field_attribute'][$i],
+ 'field_null' => $_POST['field_null'][$i],
+ 'field_default' => $_POST['field_default'][$i],
+ 'field_key' => $_POST['field_key'][$i],
+ 'field_autoincrement' => (($_REQUEST['field_autoincrement'][$i] == 1) ? '1' : '0'),
+ 'field_element' => $_REQUEST['fieldelement_name'][$i],
+ 'field_inlist' => (($_REQUEST['field_inlist'][$i] == 1) ? '1' : '0'),
+ 'field_inform' => (($_REQUEST['field_inform'][$i] == 1) ? '1' : '0'),
+ 'field_admin' => (($_REQUEST['field_admin'][$i] == 1) ? '1' : '0'),
+ 'field_user' => (($_REQUEST['field_user'][$i] == 1) ? '1' : '0'),
+ 'field_block' => (($_REQUEST['field_block'][$i] == 1) ? '1' : '0'),
+ 'field_main' => (($i == $_REQUEST['field_main']) ? '1' : '0'),
+ 'field_search' => (($_REQUEST['field_search'][$i] == 1) ? '1' : '0'),
+ 'field_required' => (($_REQUEST['field_required'][$i] == 1) ? '1' : '0')
+ )
+ );
+ }
+ if ($fieldsHandler->insert($obj)) {
redirect_header('fields.php', 2, _AM_TDMCREATE_FORMOK);
}
- echo $obj->getHtmlErrors();
+ $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
$form = $obj->getForm();
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
@@ -151,7 +183,7 @@
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$obj = $fieldsHandler->get($field_id);
- $form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
+ $form = $obj->getForm($field_tid, $field_mid, $field_numb, $field_name);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-11 11:35:06 UTC (rev 12441)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-12 21:28:01 UTC (rev 12442)
@@ -49,15 +49,15 @@
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
$criteria->setOrder('ASC');
- $numrows_modules = $modulesHandler->getCount();
+ $nb_modules = $modulesHandler->getCount($criteria);
// Redirect if there aren't modules
- /*if ( $numrows_modules == 0 ) {
+ if ( $nb_modules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
- } */
+ }
$mods_arr = $modulesHandler->getAll($criteria);
unset($criteria);
// Display modules list
- if ( $numrows_modules > 0 )
+ if ( $nb_modules > 0 )
{
foreach (array_keys($mods_arr) as $i)
{
@@ -75,12 +75,12 @@
$criteria->add(new Criteria('table_mid', $i));
$criteria->setSort('table_id ASC, table_name');
$criteria->setOrder('ASC');
- $numrows_tables = $tablesHandler->getCount();
+ $nb_tables = $tablesHandler->getCount($criteria);
$tables_arr = $tablesHandler->getAll($criteria);
unset($criteria);
// Display tables list
$tables = array();
- if ( $numrows_tables > 0 )
+ if ( $nb_tables > 0 )
{
foreach (array_keys($tables_arr) as $t)
{
@@ -101,7 +101,7 @@
unset($table);
}
}
- $mod['tables'] = $tables;
+ $mod['tables'] = $tables;
$GLOBALS['xoopsTpl']->append('modules_list', $mod);
unset($mod);
}
@@ -137,15 +137,12 @@
$obj =& $tablesHandler->create();
}
// Verification if name table exist
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_name', $obj->getVar('table_name')));
- $criteria->add(new Criteria('table_mid', $mod_id), 'AND');
- $table_name_search = $tablesHandler->getAll($criteria);
- unset($criteria);
+ $table_name_search = $tablesHandler->getObjects(null);
foreach (array_keys($table_name_search) as $t)
{
- if ( $_POST['table_name'] === $table_name_search[$t]->getVar('table_name') ) {
- redirect_header('tables.php?op=new', 5, _AM_TDMCREATE_ERROR_TABLE_NAME_EXIST);
+ if( ($table_name_search[$t]->getVar('table_name') === $_POST['table_name']) &&
+ ($table_name_search[$t]->getVar('table_mid') === $table_mid)) {
+ redirect_header('tables.php?op=new', 8, sprintf(_AM_TDMCREATE_ERROR_TABLE_NAME_EXIST, $_POST['table_name']));
}
}
// Form save tables
@@ -188,8 +185,9 @@
if( $tablesHandler->insert($obj) ) {
if( $obj->isNew() ) {
- $field_tid = $GLOBALS['xoopsDB']->getInsertId();
- redirect_header('fields.php?op=new&field_mid='.$table_mid.'&field_tid='.$field_tid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname, 3, _AM_TDMCREATE_FORMOK);
+ $table_iid = $GLOBALS['xoopsDB']->getInsertId();
+ $table_action = '&field_mid='.$table_mid.'&field_tid='.$table_iid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname;
+ redirect_header('fields.php?op=new'.$table_action, 3, _AM_TDMCREATE_FORMOK);
} else {
redirect_header('tables.php', 3, _AM_TDMCREATE_FORMOK);
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-11 11:35:06 UTC (rev 12441)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-12 21:28:01 UTC (rev 12442)
@@ -41,7 +41,7 @@
$this->table = TDMCreateTables::getInstance();
$this->initVar('field_id', XOBJ_DTYPE_INT);
$this->initVar('field_mid', XOBJ_DTYPE_INT);
- $this->initVar('field_tid', XOBJ_DTYPE_INT);
+ $this->initVar('field_tid', XOBJ_DTYPE_INT);
$this->initVar('field_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('field_type', XOBJ_DTYPE_TXTBOX);
$this->initVar('field_value', XOBJ_DTYPE_TXTBOX);
@@ -83,7 +83,7 @@
* @param string $table_fieldname
* @param mixed $action
*/
- public function getForm($table_id = null, $table_mid = null, $table_nbfields = null, $table_fieldname = null, $action = false)
+ public function getForm($f_tid = null, $f_mid = null, $f_numb = null, $f_name = null, $action = false)
{
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
@@ -92,11 +92,13 @@
$title = $this->isNew() ? sprintf(_AM_TDMCREATE_FIELD_ADD) : sprintf(_AM_TDMCREATE_FIELD_EDIT);
if ($this->isNew()) {
- $field_tid = $table_id;
- $nb_fields = $table_nbfields;
+ $field_tid = $f_tid;
+ $field_mid = $f_mid;
+ $field_numb = $f_numb;
} else {
+ $field_mid = $this->getVar('field_mid');
$field_tid = $this->getVar('field_tid');
- $nb_fields = $this->getVar('field_numb');
+ $field_numb = $this->getVar('field_numb');
}
$form = new TDMCreateThemeForm($title, 'form', $action, 'post', true);
@@ -115,61 +117,61 @@
$form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_NULL.'</th>'));
$form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_DEFAULT.'</th>'));
$form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_KEY.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_OTHERS.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_PARAMETERS.'</th>'));
$form->addElement(new TDMCreateFormLabel('</tr></thead>'));
$form->addElement(new TDMCreateFormLabel('<tbody>'));
$class = 'even';
- for($i = 1; $i <= $nb_fields; $i++)
+ for($i = 1; $i <= $field_numb; $i++)
{
$class = $class ? 'odd' : 'even';
$form->addElement(new TDMCreateFormLabel('<tr class="'.$class.'">'));
// Index ID
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$i.'</td>'));
- $field_name = $this->isNew() ? $table_fieldname . '_' : $this->getVar('field_name');
- $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name', 15, 255, $field_name);
+ $field_name = $this->isNew() ? $f_name . '_' : $this->getVar('field_name');
+ $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$i.']', 15, 255, $field_name);
// Field Name
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
// Field Type
$fieldtypeHandler =& xoops_getModuleHandler('fieldtype');
- $fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type', $this->getVar('field_type'));
+ $fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type['.$i.']', $this->getVar('field_type'));
$fieldtype_select->addOptionArray($fieldtypeHandler->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$fieldtype_select->render().'</td>'));
// Field Value
- $field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value', 5, 20, $this->getVar('field_value'));
+ $field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value['.$i.']', 5, 20, $this->getVar('field_value'));
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_value->render().'</td>'));
// Field Attributes
$fieldattrsHandler =& xoops_getModuleHandler('fieldattributes');
- $field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute', $this->getVar('field_attribute'));
+ $field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute['.$i.']', $this->getVar('field_attribute'));
$field_attributes_select->addOptionArray($fieldattrsHandler->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_attributes_select->render().'</td>'));
// Field Null
$fieldnullHandler =& xoops_getModuleHandler('fieldnull');
- $field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL, 'field_null', $this->getVar('field_null'));
+ $field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL, 'field_null['.$i.']', $this->getVar('field_null'));
$field_null_select->addOptionArray($fieldnullHandler->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_null_select->render().'</td>'));
// Field Default
- $field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT, 'field_default', 15, 25, $this->getVar('field_default'));
+ $field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT, 'field_default['.$i.']', 15, 25, $this->getVar('field_default'));
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_default->render().'</td>'));
// Field Key
$fieldkeyHandler =& xoops_getModuleHandler('fieldkey');
- $field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key', $this->getVar('field_key'));
+ $field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key['.$i.']', $this->getVar('field_key'));
$field_key_select->addOptionArray($fieldkeyHandler->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_key_select->render().'</td>'));
// Field Autoincrement
if($i == 1) {
$field_autoincrement = $this->isNew() ? 0 : $this->getVar('field_autoincrement');
- $check_field_autoincrement = new XoopsFormCheckBox(' ', 'field_autoincrement', $field_autoincrement);
+ $check_field_autoincrement = new XoopsFormCheckBox(' ', 'field_autoincrement['.$i.']', $field_autoincrement);
$check_field_autoincrement->addOption(1, _AM_TDMCREATE_FIELD_AUTO_INCREMENT);
$form->addElement(new TDMCreateFormLabel('<td>'.$check_field_autoincrement->render().'</td></tr>'));
} elseif($i > 1) {
// Box header row
$parameters_tray = new XoopsFormElementTray('', '<br />');
// Field Elements
- $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'fieldelement_name', $this->getVar('fieldelement_name'));
+ $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'fieldelement_name['.$i.']', $this->getVar('fieldelement_name'));
$field_elements_select->addOptionArray($fieldelementsHandler->getList());
- $criteria = new CriteriaCompo(new Criteria('table_id', $table_id));
- $criteria->add(new Criteria('table_mid', $table_mid));
+ $criteria = new CriteriaCompo(new Criteria('table_id', $f_tid));
+ $criteria->add(new Criteria('table_mid', $f_mid));
$criteria->setSort('table_name');
$criteria->setOrder('ASC');
$table_arr = $tablesHandler->getAll($criteria);
@@ -184,49 +186,53 @@
$parameters_tray->addElement($field_elements_select);
$field_inlist = $this->isNew() ? 0 : $this->getVar('field_inlist');
- $check_field_inlist = new XoopsFormCheckBox(' ', 'field_inlist', $field_inlist);
+ $check_field_inlist = new XoopsFormCheckBox(' ', 'field_inlist['.$i.']', $field_inlist);
$check_field_inlist->addOption(1, _AM_TDMCREATE_FIELD_INLIST);
$parameters_tray->addElement($check_field_inlist);
$field_inform = $this->isNew() ? 0 : $this->getVar('field_inform');
- $check_field_inform = new XoopsFormCheckBox(' ', 'field_inform', $field_inform);
+ $check_field_inform = new XoopsFormCheckBox(' ', 'field_inform['.$i.']', $field_inform);
$check_field_inform->addOption(1, _AM_TDMCREATE_FIELD_INFORM);
$parameters_tray->addElement($check_field_inform);
$field_admin = $this->isNew() ? 0 : $this->getVar('field_admin');
- $check_field_admin = new XoopsFormCheckBox(' ', 'field_admin', $field_admin);
+ $check_field_admin = new XoopsFormCheckBox(' ', 'field_admin['.$i.']', $field_admin);
$check_field_admin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN);
$parameters_tray->addElement($check_field_admin);
$field_user = $this->isNew() ? 0 : $this->getVar('field_user');
- $check_field_user = new XoopsFormCheckBox(' ', 'field_user', $field_user);
+ $check_field_user = new XoopsFormCheckBox(' ', 'field_user['.$i.']', $field_user);
$check_field_user->addOption(1, _AM_TDMCREATE_FIELD_USER);
$parameters_tray->addElement($check_field_user);
$field_block = $this->isNew() ? 0 : $this->getVar('field_block');
- $check_field_block = new XoopsFormCheckBox(' ', 'field_block', $field_block);
+ $check_field_block = new XoopsFormCheckBox('', 'field_block['.$i.']', $field_block);
$check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
$parameters_tray->addElement($check_field_block);
$field_mnfield = $this->isNew() ? 0 : $this->getVar('field_main');
- $field_main = new XoopsFormRadio(' ', 'field_main', $field_mnfield);
- $field_main->addOption( ' ', _AM_TDMCREATE_FIELD_MAINFIELD );
+ $field_main = new XoopsFormRadio('', 'field_main['.$i.']', $field_mnfield);
+ $field_main->addOption( $i, _AM_TDMCREATE_FIELD_MAINFIELD );
$parameters_tray->addElement($field_main);
$field_search = $this->isNew() ? 0 : $this->getVar('field_search');
- $check_field_search = new XoopsFormCheckBox(' ', 'field_search', $field_search);
+ $check_field_search = new XoopsFormCheckBox(' ', 'field_search['.$i.']', $field_search);
$check_field_search->addOption(1, _AM_TDMCREATE_FIELD_SEARCH);
$parameters_tray->addElement($check_field_search);
$field_required = $this->isNew() ? 0 : $this->getVar('field_required');
- $check_field_required = new XoopsFormCheckBox(' ', 'field_required', $field_required);
+ $check_field_required = new XoopsFormCheckBox(' ', 'field_required['.$i.']', $field_required);
$check_field_required->addOption(1, _AM_TDMCREATE_FIELD_REQUIRED);
$parameters_tray->addElement($check_field_required);
$form->addElement(new TDMCreateFormLabel('<td>'.$parameters_tray->render().'</td></tr>'));
- }
+ }
+ $form->addElement(new XoopsFormHidden('field_id['.$i.']', $i));
}
- $form->addElement(new XoopsFormHidden('field_tid', $field_tid));
+
+ $form->addElement(new XoopsFormHidden('field_mid', $field_mid));
+ $form->addElement(new XoopsFormHidden('field_tid', $field_tid));
+ $form->addElement(new XoopsFormHidden('field_numb', $field_numb));
$form->addElement(new TDMCreateFormLabel('</tbody>'));
$form->addElement(new TDMCreateFormLabel('<tfoot><tr>'));
$form_hidden = new XoopsFormHidden('op', 'save');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php 2014-04-11 11:35:06 UTC (rev 12441)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php 2014-04-12 21:28:01 UTC (rev 12442)
@@ -53,6 +53,13 @@
* @var mixed
*/
private $table = null;
+
+ /**
+ * "field" attribute of the files
+ *
+ * @var mixed
+ */
+ private $fields = null;
/**
* "folder" attribute of the files
@@ -93,45 +100,88 @@
return $ret;
}
- /**
- * get the "path" attribute for the element
- *
- * @return string "path" attribute value
- */
- public function getPath()
- {
+ /*
+ * @private function setPath
+ * @param string $path
+ */
+ private function setPath($path) {
+ $this->path = $path;
+ }
+
+ /*
+ * @private function getPath
+ * @param null
+ */
+ private function getPath() {
return $this->path;
}
- /**
- * get the "upload_path" attribute for the element
- *
- *...
[truncated message content] |
|
From: <txm...@us...> - 2014-04-15 17:29:41
|
Revision: 12449
http://sourceforge.net/p/xoops/svn/12449
Author: txmodxoops
Date: 2014-04-15 17:29:33 +0000 (Tue, 15 Apr 2014)
Log Message:
-----------
Toggle temporarily disabled, display problems in the lists Table and Fields
Browsers: Firefox and Opera.
Possible conflicts with class="<{cycle values='even,odd'}>"
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tdmcreate.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/themeform.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-15 09:16:07 UTC (rev 12448)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-15 17:29:33 UTC (rev 12449)
@@ -47,6 +47,7 @@
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
$GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
// Redirect if there aren't modules
@@ -128,7 +129,7 @@
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$obj =& $fieldsHandler->create();
- $form = $obj->getForm($field_tid, $field_mid, $field_numb, $field_name);
+ $form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
@@ -140,36 +141,40 @@
$obj =& $fieldsHandler->get($field_id);
} else {
$obj =& $fieldsHandler->create();
+ }
+ $datas = array();
+ for( $i = 0; $i < $table_nbfields; $i++ ) {
+ $datas = array('field_mid' => $table_mid[$i],
+ 'field_tid' => $table_id[$i],
+ 'field_numb' => $table_nbfields[$i],
+ 'field_name' => $_POST['field_name'][$i],
+ 'field_type' => $_POST['field_type'][$i],
+ 'field_value' => $_POST['field_value'][$i],
+ 'field_attribute' => $_POST['field_attribute'][$i],
+ 'field_null' => $_POST['field_null'][$i],
+ 'field_default' => $_POST['field_default'][$i],
+ 'field_key' => $_POST['field_key'][$i],
+ 'field_autoincrement' => (($_REQUEST['field_autoincrement'][$i] == 1) ? '1' : '0'),
+ 'field_element' => $_REQUEST['fieldelement_name'][$i],
+ 'field_inlist' => (($_REQUEST['field_inlist'][$i] == 1) ? '1' : '0'),
+ 'field_inform' => (($_REQUEST['field_inform'][$i] == 1) ? '1' : '0'),
+ 'field_admin' => (($_REQUEST['field_admin'][$i] == 1) ? '1' : '0'),
+ 'field_user' => (($_REQUEST['field_user'][$i] == 1) ? '1' : '0'),
+ 'field_block' => (($_REQUEST['field_block'][$i] == 1) ? '1' : '0'),
+ 'field_main' => (($i == $_REQUEST['field_main']) ? '1' : '0'),
+ 'field_search' => (($_REQUEST['field_search'][$i] == 1) ? '1' : '0'),
+ 'field_required' => (($_REQUEST['field_required'][$i] == 1) ? '1' : '0')
+ );
+
+ }
+ foreach ($datas as $data => $value) {
+ $obj->setVars(array($data, $value));
}
- for( $i = 0; $i < $table_nbfields; $i++ ) {
- $obj->setVars(array('field_mid' => $table_mid[$i],
- 'field_tid' => $table_id[$i],
- 'field_numb' => $table_nbfields[$i],
- 'field_name' => $_POST['field_name'][$i],
- 'field_type' => $_POST['field_type'][$i],
- 'field_value' => $_POST['field_value'][$i],
- 'field_attribute' => $_POST['field_attribute'][$i],
- 'field_null' => $_POST['field_null'][$i],
- 'field_default' => $_POST['field_default'][$i],
- 'field_key' => $_POST['field_key'][$i],
- 'field_autoincrement' => (($_REQUEST['field_autoincrement'][$i] == 1) ? '1' : '0'),
- 'field_element' => $_REQUEST['fieldelement_name'][$i],
- 'field_inlist' => (($_REQUEST['field_inlist'][$i] == 1) ? '1' : '0'),
- 'field_inform' => (($_REQUEST['field_inform'][$i] == 1) ? '1' : '0'),
- 'field_admin' => (($_REQUEST['field_admin'][$i] == 1) ? '1' : '0'),
- 'field_user' => (($_REQUEST['field_user'][$i] == 1) ? '1' : '0'),
- 'field_block' => (($_REQUEST['field_block'][$i] == 1) ? '1' : '0'),
- 'field_main' => (($i == $_REQUEST['field_main']) ? '1' : '0'),
- 'field_search' => (($_REQUEST['field_search'][$i] == 1) ? '1' : '0'),
- 'field_required' => (($_REQUEST['field_required'][$i] == 1) ? '1' : '0')
- )
- );
- }
if ($fieldsHandler->insert($obj)) {
redirect_header('fields.php', 2, _AM_TDMCREATE_FORMOK);
- }
- $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
- $form = $obj->getForm();
+ }
+ $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
+ $form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
@@ -183,7 +188,7 @@
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$obj = $fieldsHandler->get($field_id);
- $form = $obj->getForm($field_tid, $field_mid, $field_numb, $field_name);
+ $form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-15 09:16:07 UTC (rev 12448)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-15 17:29:33 UTC (rev 12449)
@@ -42,6 +42,7 @@
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
//$GLOBALS['xoopsTpl']->assign('tdmc_upload_table_url', TDMC_UPLOAD_IMGTAB_URL);
$GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
@@ -105,9 +106,9 @@
$GLOBALS['xoopsTpl']->append('modules_list', $mod);
unset($mod);
}
- if ( $numrows_modules > $limit ) {
+ if ( $nb_modules > $limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($numrows_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $pagenav = new XoopsPageNav($nb_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-15 09:16:07 UTC (rev 12448)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-15 17:29:33 UTC (rev 12449)
@@ -77,13 +77,13 @@
/*
* @public function getForm
*
- * @param integer $table_id
- * @param integer $table_mid
- * @param integer $table_nbfields
- * @param string $table_fieldname
+ * @param integer $f_mid
+ * @param integer $f_tid
+ * @param integer $f_numb
+ * @param string $f_name
* @param mixed $action
*/
- public function getForm($f_tid = null, $f_mid = null, $f_numb = null, $f_name = null, $action = false)
+ public function getForm($f_mid = null, $f_tid = null, $f_numb = null, $f_name = null, $action = false)
{
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
@@ -105,7 +105,11 @@
$form->setExtra('enctype="multipart/form-data"');
$tablesHandler = xoops_getModuleHandler('tables');
- $fieldelementsHandler =& xoops_getModuleHandler('fieldelements');
+ $fieldelementsHandler =& xoops_getModuleHandler('fieldelements');
+ $fieldtypeHandler =& xoops_getModuleHandler('fieldtype');
+ $fieldattrsHandler =& xoops_getModuleHandler('fieldattributes');
+ $fieldnullHandler =& xoops_getModuleHandler('fieldnull');
+ $fieldkeyHandler =& xoops_getModuleHandler('fieldkey');
// New Object HtmlTable
$form->addElement(new TDMCreateFormLabel('<table class="outer">'));
$form->addElement(new TDMCreateFormLabel('<thead class="center"><tr class="width5">'));
@@ -132,21 +136,18 @@
$field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$i.']', 15, 255, $field_name);
// Field Name
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
- // Field Type
- $fieldtypeHandler =& xoops_getModuleHandler('fieldtype');
+ // Field Type
$fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type['.$i.']', $this->getVar('field_type'));
$fieldtype_select->addOptionArray($fieldtypeHandler->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$fieldtype_select->render().'</td>'));
// Field Value
$field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value['.$i.']', 5, 20, $this->getVar('field_value'));
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_value->render().'</td>'));
- // Field Attributes
- $fieldattrsHandler =& xoops_getModuleHandler('fieldattributes');
+ // Field Attributes
$field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute['.$i.']', $this->getVar('field_attribute'));
$field_attributes_select->addOptionArray($fieldattrsHandler->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_attributes_select->render().'</td>'));
- // Field Null
- $fieldnullHandler =& xoops_getModuleHandler('fieldnull');
+ // Field Null
$field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL, 'field_null['.$i.']', $this->getVar('field_null'));
$field_null_select->addOptionArray($fieldnullHandler->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_null_select->render().'</td>'));
@@ -154,7 +155,6 @@
$field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT, 'field_default['.$i.']', 15, 25, $this->getVar('field_default'));
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_default->render().'</td>'));
// Field Key
- $fieldkeyHandler =& xoops_getModuleHandler('fieldkey');
$field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key['.$i.']', $this->getVar('field_key'));
$field_key_select->addOptionArray($fieldkeyHandler->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_key_select->render().'</td>'));
@@ -226,7 +226,7 @@
$parameters_tray->addElement($check_field_required);
$form->addElement(new TDMCreateFormLabel('<td>'.$parameters_tray->render().'</td></tr>'));
- }
+ }
$form->addElement(new XoopsFormHidden('field_id['.$i.']', $i));
}
@@ -242,6 +242,20 @@
$form->addElement(new TDMCreateFormLabel('</tr></tfoot></table>'));
return $form;
}
+
+ /*
+ * @public function toArray
+ * @param null
+ */
+ public function toArray() {
+ $ret = parent::toArray();
+ $f_tid = $this->table->getVar('table_id');
+ $f_mid = $this->table->getVar('table_mid');
+ $f_numb = $this->table->getVar('table_nbfields');
+ $f_name = $this->table->getVar('table_fieldname');
+ $ret['edit_form'] = $this->getForm($f_tid, $f_mid, $f_numb, $f_name);
+ return $ret;
+ }
}
/*
* @Class TDMCreateFieldsHandler
@@ -263,4 +277,312 @@
$this->table = TDMCreateTables::getInstance();
parent::__construct($db, 'mod_tdmcreate_fields', 'tdmcreatefields', 'field_id', 'field_tid');
}
+
+ /*
+ * @public function getFieldModuleId
+ * @param integer $field_id
+ */
+ public function getFieldModuleId($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ return $obj[0]['field_mid'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldTableId
+ * @param integer $field_id
+ */
+ public function getFieldTableId($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ return $obj[0]['field_tid'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldName
+ * @param integer $field_id
+ */
+ public function getFieldName($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (!empty($obj[0]['field_name']))
+ return strtolower($obj[0]['field_name']);
+ else
+ return false;
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldType
+ * @param integer $field_id
+ */
+ public function getFieldType($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (isset($obj[0]['field_type']))
+ return $obj[0]['field_type'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldValue
+ * @param integer $field_id
+ */
+ public function getFieldValue($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (!empty($obj[0]['field_value']) && is_numeric($obj[0]['field_value']))
+ return intval($obj[0]['field_value']);
+ else
+ return false;
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldAttribute
+ * @param integer $field_id
+ */
+ public function getFieldAttribute($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (isset($obj[0]['field_attribute']))
+ return $obj[0]['field_attribute'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldNull
+ * @param integer $field_id
+ */
+ public function getFieldNull($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (isset($obj[0]['field_null']))
+ return $obj[0]['field_null'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldDefault
+ * @param integer $field_id
+ */
+ public function getFieldDefault($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (!empty($obj[0]['field_default']))
+ return strtolower($obj[0]['field_default']);
+ else
+ return false;
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldKey
+ * @param integer $field_id
+ */
+ public function getFieldKey($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (isset($obj[0]['field_key']))
+ return $obj[0]['field_key'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldAutoIncrement
+ * @param integer $field_id
+ */
+ public function getFieldAutoIncrement($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (isset($obj[0]['field_autoincrement']))
+ return $obj[0]['field_autoincrement'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldElement
+ * @param integer $field_id
+ */
+ public function getFieldElement($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (isset($obj[0]['field_element']))
+ return $obj[0]['field_element'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldInLst
+ * @param integer $field_id
+ */
+ public function getFieldInLst($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (isset($obj[0]['field_inlist']))
+ return $obj[0]['field_inlist'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldInForm
+ * @param integer $field_id
+ */
+ public function getFieldInForm($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (isset($obj[0]['field_inform']))
+ return $obj[0]['field_inform'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldAdmin
+ * @param integer $field_id
+ */
+ public function getFieldAdmin($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (isset($obj[0]['field_admin']))
+ return $obj[0]['field_admin'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldUser
+ * @param integer $field_id
+ */
+ public function getFieldUser($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (isset($obj[0]['field_user']))
+ return $obj[0]['field_user'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldBlock
+ * @param integer $field_id
+ */
+ public function getFieldBlock($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (isset($obj[0]['field_block']))
+ return $obj[0]['field_block'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldMain
+ * @param integer $field_id
+ */
+ public function getFieldMain($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (isset($obj[0]['field_main']))
+ return $obj[0]['field_main'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldSearch
+ * @param integer $field_id
+ */
+ public function getFieldSearch($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (isset($obj[0]['field_search']))
+ return $obj[0]['field_search'];
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @public function getFieldRequired
+ * @param integer $field_id
+ */
+ public function getFieldRequired($field_id)
+ {
+ $criteria = new Criteria('field_id', $field_id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ if (isset($obj[0]['field_required']))
+ return $obj[0]['field_required'];
+ } else {
+ return false;
+ }
+ }
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-04-15 09:16:07 UTC (rev 12448)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-04-15 17:29:33 UTC (rev 12449)
@@ -91,11 +91,13 @@
$form->setExtra('enctype="multipart/form-data"');
//
$modulesHandler =& xoops_getModuleHandler('modules');
+ $modules = $modulesHandler->getObjects(null);
$mods_select = new XoopsFormSelect(_AM_TDMCREATE_TABLE_MODULES, 'table_mid', $table_mid);
//$mods_select->setExtra('onchange="window.location=\'\'+this.options[this.selectedIndex].value"');
+ //$mods_select->setValue('table.php?op=new&table_mid='.$table_mid);$action.'table.php?op=new&table_mid='.
$mods_select->addOption($action, _AM_TDMCREATE_TABLE_MODSELOPT);
- foreach ($modulesHandler->getList() as $mod_id => $mod_name) {
- $mods_select->addOption($mod_id, $mod_name);
+ foreach ($modules as $mod) {
+ $mods_select->addOption($mod->getVar('mod_id'), $mod->getVar('mod_name'));
}
//$mods_select->addOptionArray();
$form->addElement($mods_select, true);
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tdmcreate.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tdmcreate.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tdmcreate.php 2014-04-15 17:29:33 UTC (rev 12449)
@@ -0,0 +1,173 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author trabis <lus...@gm...>
+ * @version $Id: tdmcreate.php 12258 2014-04-12 23:45:12Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class TDMCreate
+{
+ /**
+ * @var string
+ */
+ private $dirname = null;
+ /**
+ * @var string
+ */
+ private $module = null;
+ /**
+ * @var string
+ */
+ private $handler = null;
+ /**
+ * @var string
+ */
+ private $config = null;
+ /**
+ * @var string
+ */
+ private $debug = null;
+ /**
+ * @var array
+ */
+ private $debugArray = array();
+ /*
+ * @protected function constructor class
+ * @param mixed $debug
+ */
+ protected function __construct($debug)
+ {
+ $this->debug = $debug;
+ $this->dirname = basename(dirname(dirname(__FILE__)));
+ }
+ /*
+ * @static function &getInstance
+ * @param mixed $debug
+ */
+ public static function &getInstance($debug = false)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($debug);
+ }
+ return $instance;
+ }
+ /*
+ * @static function getModule
+ * @param null
+ */
+ public function &getModule()
+ {
+ if ($this->module == null) {
+ $this->initModule();
+ }
+ return $this->module;
+ }
+ /*
+ * @static function getConfig
+ * @param string $name
+ */
+ public function getConfig($name = null)
+ {
+ if ($this->config == null) {
+ $this->initConfig();
+ }
+ if (!$name) {
+ $this->addLog("Getting all config");
+ return $this->config;
+ }
+ if (!isset($this->config[$name])) {
+ $this->addLog("ERROR :: CONFIG '{$name}' does not exist");
+ return null;
+ }
+ $this->addLog("Getting config '{$name}' : " . $this->config[$name]);
+ return $this->config[$name];
+ }
+ /*
+ * @static function setConfig
+ * @param string $name
+ * @param mixed $value
+ */
+ public function setConfig($name = null, $value = null)
+ {
+ if ($this->config == null) {
+ $this->initConfig();
+ }
+ $this->config[$name] = $value;
+ $this->addLog("Setting config '{$name}' : " . $this->config[$name]);
+ return $this->config[$name];
+ }
+ /*
+ * @static function getHandler
+ * @param string $name
+ */
+ public function &getHandler($name)
+ {
+ if (!isset($this->handler[$name . '_handler'])) {
+ $this->initHandler($name);
+ }
+ $this->addLog("Getting handler '{$name}'");
+ return $this->handler[$name . '_handler'];
+ }
+ /*
+ * @static function initModule
+ * @param null
+ */
+ public function initModule()
+ {
+ global $xoopsModule;
+ if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $this->dirname) {
+ $this->module = $xoopsModule;
+ } else {
+ $hModule = xoops_gethandler('module');
+ $this->module = $hModule->getByDirname($this->dirname);
+ }
+ $this->addLog('INIT MODULE');
+ }
+ /*
+ * @static function initConfig
+ * @param null
+ */
+ public function initConfig()
+ {
+ $this->addLog('INIT CONFIG');
+ $hModConfig = xoops_gethandler('config');
+ $this->config = $hModConfig->getConfigsByCat(0, $this->getModule()->getVar('mid'));
+ }
+ /*
+ * @static function initHandler
+ * @param string $name
+ */
+ public function initHandler($name)
+ {
+ $this->addLog('INIT ' . $name . ' HANDLER');
+ $this->handler[$name . '_handler'] = xoops_getModuleHandler($name, $this->dirname);
+ }
+ /*
+ * @static function addLog
+ * @param string $log
+ */
+ public function addLog($log)
+ {
+ if ($this->debug) {
+ if (is_object($GLOBALS['xoopsLogger'])) {
+ $GLOBALS['xoopsLogger']->addExtra($this->module->name(), $log);
+ }
+ }
+ }
+}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/themeform.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/themeform.php 2014-04-15 09:16:07 UTC (rev 12448)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/themeform.php 2014-04-15 17:29:33 UTC (rev 12449)
@@ -1,65 +0,0 @@
-<?php
-/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- */
-/**
- * tdmcreate module
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package tdmcreate
- * @since 2.5.5
- * @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 themeform.php 11297 2013-03-24 10:58:10Z timgno $
- */
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-xoops_load('XoopsFormLoader');
-
-/**
- * Form that will output as a theme-enabled HTML table
- *
- * Also adds JavaScript to validate required fields
- */
-class TDMCreateThemeForm extends XoopsForm
-{
- /**
- * create HTML to output the form as a theme-enabled table with validation.
- *
- * YOU SHOULD AVOID TO USE THE FOLLOWING Nocolspan METHOD, IT WILL BE REMOVED
- *
- * To use the noColspan simply use the following example:
- *
- * $colspan = new XoopsFormDhtmlTextArea( '', 'key', $value, '100%', '100%' );
- * $colspan->setNocolspan();
- * $form->addElement( $colspan );
- *
- * @return string
- */
- public function render()
- {
- $ele_name = $this->getName();
- $ret = ($this->getTitle() ? '<div class=" center head ">' . $this->getTitle() . '</div>' : '');
- $ret .= NWLINE . '<form name="' . $ele_name . '" id="' . $ele_name . '" action="' . $this->getAction() . '" method="' . $this->getMethod() . '" onsubmit="return xoopsFormValidate_' . $ele_name . '();"' . $this->getExtra() . '>' . NWLINE;
- $hidden = '';
- $class = 'even';
- foreach ($this->getElements() as $ele) {
- if (!is_object($ele)) {
- $ret .= $ele;
- } else if (!$ele->isHidden()) {
- $ret .= $ele->render();
- } else {
- $hidden .= $ele->render();
- }
- }
- $ret .= NWLINE . ' ' . $hidden . NWLINE . '</form>';
- $ret .= $this->renderValidationJS(true);
- return $ret;
- }
-}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin/style.css
...
[truncated message content] |
|
From: <txm...@us...> - 2014-04-18 11:37:59
|
Revision: 12458
http://sourceforge.net/p/xoops/svn/12458
Author: txmodxoops
Date: 2014-04-18 11:37:54 +0000 (Fri, 18 Apr 2014)
Log Message:
-----------
Added function for copy directory of new module in root/modules
Updated -> refactoring
P.S: This is a pre-alpha, only for repository (NO TEST)
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/form_elements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/form/themeform.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-04-17 21:19:14 UTC (rev 12457)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-04-18 11:37:54 UTC (rev 12458)
@@ -26,7 +26,8 @@
} else {
$modules =& $modulesHandler;
}
-
+$from_dir = TDMC_UPLOAD_MODULES_PATH.'/'.strtolower($mod_name);
+$to_dir = XOOPS_ROOT_PATH.'/modules/'.strtolower($mod_name);
switch ($op) {
case 'build':
$template_main = 'tdmcreate_building.html';
@@ -50,6 +51,9 @@
$mod_name = 'uploads/tdmcreate/modules/' . str_replace(' ', '', strtolower($modules->getVar('mod_name')));
// Creation of the structure of folders and files
$GLOBALS['xoopsTpl']->assign('build_list', 'Under new construction - Temporary build only folders of this selected module "'.$mod_name.'/"');
+ if ( $modules->getVar('mod_install') == 1 ) {
+ copyInRootModules($from_dir, $to_dir);
+ }
break;
case 'default':
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-17 21:19:14 UTC (rev 12457)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-18 11:37:54 UTC (rev 12458)
@@ -37,7 +37,7 @@
{
case 'list':
default:
- $limit = xoops_getModuleOption('fields_adminpager');
+ $limit = $GLOBALS['xoopsModuleConfig']['fields_adminpager'];
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
$template_main = 'tdmcreate_fields.html';
@@ -155,7 +155,7 @@
'field_default' => $_POST['field_default'][$i],
'field_key' => $_POST['field_key'][$i],
'field_autoincrement' => (($_REQUEST['field_autoincrement'][$i] == 1) ? '1' : '0'),
- 'field_element' => $_REQUEST['fieldelement_name'][$i],
+ 'field_element' => $_POST['field_element'][$i],
'field_inlist' => (($_REQUEST['field_inlist'][$i] == 1) ? '1' : '0'),
'field_inform' => (($_REQUEST['field_inform'][$i] == 1) ? '1' : '0'),
'field_admin' => (($_REQUEST['field_admin'][$i] == 1) ? '1' : '0'),
@@ -188,7 +188,7 @@
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$obj = $fieldsHandler->get($field_id);
- $form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
+ $form = $obj->getForm($field_mid, $field_tid, $field_numb);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-04-17 21:19:14 UTC (rev 12457)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-04-18 11:37:54 UTC (rev 12458)
@@ -26,7 +26,7 @@
{
case 'list':
default:
- $limit = xoops_getModuleOption('mod_adminpager');
+ $limit = $GLOBALS['xoopsModuleConfig']['modules_adminpager'];
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
$template_main = 'tdmcreate_modules.html';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-17 21:19:14 UTC (rev 12457)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-18 11:37:54 UTC (rev 12458)
@@ -32,7 +32,7 @@
{
case 'list':
default:
- $limit = xoops_getModuleOption('adminperpage');
+ $limit = $GLOBALS['xoopsModuleConfig']['tables_adminpager'];
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
$template_main = 'tdmcreate_tables.html';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-17 21:19:14 UTC (rev 12457)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-18 11:37:54 UTC (rev 12458)
@@ -16,7 +16,7 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: fields.php 12258 2014-01-02 09:33:29Z timgno $
+ * @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
require_once 'simplelabel.php';
@@ -86,55 +86,54 @@
public function getForm($f_mid = null, $f_tid = null, $f_numb = null, $f_name = null, $action = false)
{
if ($action === false) {
- $action = $_SERVER['REQUEST_URI'];
+ $action = XOOPS_URL.'/modules/TDMCreate/admin/fields.php'; //$_SERVER['REQUEST_URI'];
}
+ $isNew = $this->isNew();
+ $title = $isNew ? sprintf(_AM_TDMCREATE_FIELD_ADD) : sprintf(_AM_TDMCREATE_FIELD_EDIT);
- $title = $this->isNew() ? sprintf(_AM_TDMCREATE_FIELD_ADD) : sprintf(_AM_TDMCREATE_FIELD_EDIT);
+ $field_mid = $isNew ? $f_mid : $this->getVar('field_mid');
+ $field_tid = $isNew ? $f_tid : $this->getVar('field_tid');
+ $field_numb = $isNew ? $f_numb : $this->getVar('field_numb');
- if ($this->isNew()) {
- $field_tid = $f_tid;
- $field_mid = $f_mid;
- $field_numb = $f_numb;
- } else {
- $field_mid = $this->getVar('field_mid');
- $field_tid = $this->getVar('field_tid');
- $field_numb = $this->getVar('field_numb');
- }
-
- $form = new TDMCreateThemeForm($title, 'form', $action, 'post', true);
+ $form = new TDMCreateThemeForm(null, 'form', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
$tablesHandler = xoops_getModuleHandler('tables');
+ $fieldsHandler = xoops_getModuleHandler('fields');
$fieldelementsHandler =& xoops_getModuleHandler('fieldelements');
$fieldtypeHandler =& xoops_getModuleHandler('fieldtype');
$fieldattrsHandler =& xoops_getModuleHandler('fieldattributes');
$fieldnullHandler =& xoops_getModuleHandler('fieldnull');
$fieldkeyHandler =& xoops_getModuleHandler('fieldkey');
// New Object HtmlTable
- $form->addElement(new TDMCreateFormLabel('<table class="outer">'));
- $form->addElement(new TDMCreateFormLabel('<thead class="center"><tr class="width5">'));
- $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_NUMBER.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_NAME.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_TYPE.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_VALUE.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_ATTRIBUTE.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_NULL.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_DEFAULT.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_KEY.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<th>'._AM_TDMCREATE_FIELD_PARAMETERS.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<table border="0" cellspacing="1" class="outer width100">'));
+ $form->addElement(new TDMCreateFormLabel('<thead class="center">'));
+ $form->addElement(new TDMCreateFormLabel('<tr class="head"><th colspan="9">'.$title.'</th></tr>'));
+ $form->addElement(new TDMCreateFormLabel('<tr class="head width5">'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NUMBER.'</td>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NAME.'</td>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_TYPE.'</td>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_VALUE.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_ATTRIBUTE.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NULL.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_DEFAULT.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_KEY.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_PARAMETERS.'</th>'));
$form->addElement(new TDMCreateFormLabel('</tr></thead>'));
- $form->addElement(new TDMCreateFormLabel('<tbody>'));
+ $form->addElement(new TDMCreateFormLabel('<tbody>'));
+
+ $fields = $fieldsHandler->getObjects(null);
- $class = 'even';
+ $class = '';
for($i = 1; $i <= $field_numb; $i++)
{
- $class = $class ? 'odd' : 'even';
+ $class = ($class == 'even') ? 'odd' : 'even';
$form->addElement(new TDMCreateFormLabel('<tr class="'.$class.'">'));
// Index ID
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$i.'</td>'));
- $field_name = $this->isNew() ? $f_name . '_' : $this->getVar('field_name');
- $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$i.']', 15, 255, $field_name);
- // Field Name
+ // Field Name
+ $field_name = $isNew ? $f_name . '_' : $this->getVar('field_name');
+ $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$i.']', 15, 255, $field_name);
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
// Field Type
$fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type['.$i.']', $this->getVar('field_type'));
@@ -168,7 +167,7 @@
// Box header row
$parameters_tray = new XoopsFormElementTray('', '<br />');
// Field Elements
- $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'fieldelement_name['.$i.']', $this->getVar('fieldelement_name'));
+ $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$i.']', $this->getVar('field_element'));
$field_elements_select->addOptionArray($fieldelementsHandler->getList());
$criteria = new CriteriaCompo(new Criteria('table_id', $f_tid));
$criteria->add(new Criteria('table_mid', $f_mid));
@@ -176,10 +175,10 @@
$criteria->setOrder('ASC');
$table_arr = $tablesHandler->getAll($criteria);
unset($criteria);
- foreach (array_keys($table_arr) as $j)
+ foreach (array_keys($table_arr) as $xft_other)
{
- $form_table_name = $table_arr[$j]->getVar('table_name');
- if ( $j[$i] == 'XoopsFormTables-'.$form_table_name ) {
+ $form_table_name = $table_arr[$xft_other]->getVar('table_name');
+ if ( $xft_other[$i] == 'XoopsFormTables-'.$form_table_name ) {
$field_elements_select->addOption('XoopsFormTables-'.$form_table_name, 'Table : '.$form_table_name);
}
}
@@ -210,7 +209,7 @@
$check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
$parameters_tray->addElement($check_field_block);
- $field_mnfield = $this->isNew() ? 0 : $this->getVar('field_main');
+ $field_mnfield = $this->isNew() ? 1 : $this->getVar('field_main');
$field_main = new XoopsFormRadio('', 'field_main['.$i.']', $field_mnfield);
$field_main->addOption( $i, _AM_TDMCREATE_FIELD_MAINFIELD );
$parameters_tray->addElement($field_main);
@@ -248,12 +247,12 @@
* @param null
*/
public function toArray() {
- $ret = parent::toArray();
- $f_tid = $this->table->getVar('table_id');
+ $ret = parent::toArray();
$f_mid = $this->table->getVar('table_mid');
+ $f_tid = $this->table->getVar('table_id');
$f_numb = $this->table->getVar('table_nbfields');
$f_name = $this->table->getVar('table_fieldname');
- $ret['edit_form'] = $this->getForm($f_tid, $f_mid, $f_numb, $f_name);
+ $ret['edit_form'] = $this->getForm($f_mid, $f_tid, $f_numb, $f_name);
return $ret;
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/form_elements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/form_elements.php 2014-04-17 21:19:14 UTC (rev 12457)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/form_elements.php 2014-04-18 11:37:54 UTC (rev 12458)
@@ -18,27 +18,20 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: form_elements.php 12258 2014-01-02 09:33:29Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
class FormElements
{
/*
- * @var string
- */
- private $required = '';
- /*
* @public function constructor
* @param string $module
* @param array $table
* @param string $fields
*/
- public function __construct($module, $table, $fields, $required) {
+ public function __construct($module, $table, $fields) {
$this->setModule($module);
$this->setTable($table);
$this->setFields($fields);
- $this->required = $required;
}
/**
* @param string $method
@@ -63,36 +56,36 @@
}
/*
* @public function getXoopsFormText
- * @param string $lng_form
+ * @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormText($lng_form, $field_name, $required = 'false') {
+ public function getXoopsFormText($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormText({$lng_form}, '{$field_name}', 50, 255, \$this->getVar('{$field_name}')), {$required});
+ \$form->addElement(new XoopsFormText({$language}, '{$field_name}', 50, 255, \$this->getVar('{$field_name}')), {$required});
EOT;
return $ret;
}
/*
* @public function getXoopsFormText
- * @param string $lng_form
+ * @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormTextArea($lng_form, $field_name, $required = 'false') {
+ public function getXoopsFormTextArea($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormTextArea({$lng_form}, '{$field_name}', \$this->getVar('{$field_name}'), 4, 47), {$required});
+ \$form->addElement(new XoopsFormTextArea({$language}, '{$field_name}', \$this->getVar('{$field_name}'), 4, 47), {$required});
EOT;
return $ret;
}
/*
* @public function getXoopsFormDhtmlTextArea
- * @param string $lng_form
+ * @param string $language
* @param string $module_name
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormDhtmlTextArea($lng_form, $module_name, $field_name, $required = 'false') {
+ public function getXoopsFormDhtmlTextArea($language, $module_name, $field_name, $required = 'false') {
$ret = <<<EOT
\$editor_configs = array();
\$editor_configs['name'] = '{$field_name}';
@@ -102,20 +95,20 @@
\$editor_configs['width'] = '100%';
\$editor_configs['height'] = '400px';
\$editor_configs['editor'] = xoops_getModuleOption('{$module_name}_editor', '{$module_name}');
- \$form->addElement( new XoopsFormEditor({$lng_form}, '{$field_name}', \$editor_configs), {$required} );
+ \$form->addElement( new XoopsFormEditor({$language}, '{$field_name}', \$editor_configs), {$required} );
EOT;
return $ret;
}
/*
* @public function getXoopsFormCheckBox
- * @param string $lng_form
+ * @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormCheckBox($lng_form, $field_name, $required = 'false') {
+ public function getXoopsFormCheckBox($language, $field_name, $required = 'false') {
$ret = <<<EOT
\${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
- \$check_{$field_name} = new XoopsFormCheckBox({$lng_form}, '{$field_name}', \${$field_name});
+ \$check_{$field_name} = new XoopsFormCheckBox({$language}, '{$field_name}', \${$field_name});
\$check_{$field_name}->addOption(1, " ");
\$form->addElement(\$check_{$field_name}, {$required});
EOT;
@@ -133,146 +126,188 @@
}
/*
* @public function getXoopsFormUploadFile
- * @param string $lng_form
+ * @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormUploadFile($lng_form, $field_name, $required = 'false') {
+ public function getXoopsFormUploadFile($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormUploadFile({$lng_form}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
+ \$form->addElement(new XoopsFormUploadFile({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
EOT;
return $ret;
}
/*
* @public function getXoopsFormUploadImage
- * @param string $lng_form
+ * @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormUploadImage($lng_form, $field_name, $required = 'false') {
+ public function getXoopsFormUploadImage($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormUploadImage({$lng_form}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
+ \$form->addElement(new XoopsFormUploadImage({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
EOT;
return $ret;
}
/*
* @public function getXoopsFormColorPicker
- * @param string $lng_form
+ * @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormColorPicker($lng_form, $field_name, $required = 'false') {
+ public function getXoopsFormColorPicker($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormColorPicker({$lng_form}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
+ \$form->addElement(new XoopsFormColorPicker({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});
EOT;
return $ret;
}
/*
* @public function getXoopsFormSelectUser
- * @param string $lng_form
+ * @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormSelectUser($lng_form, $field_name, $required = 'false') {
+ public function getXoopsFormSelectUser($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormSelectUser({$lng_form}, '{$field_name}', false, \$this->getVar('{$field_name}'), 1, false), {$required});
+ \$form->addElement(new XoopsFormSelectUser({$language}, '{$field_name}', false, \$this->getVar('{$field_name}'), 1, false), {$required});
EOT;
return $ret;
}
/*
* @public function getXoopsFormRadioYN
- * @param string $lng_form
+ * @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormRadioYN($lng_form, $field_name, $required = 'false') {
+ public function getXoopsFormRadioYN($language, $field_name, $required = 'false') {
$ret = <<<EOT
${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
- \$form->addElement(new XoopsFormRadioYN({$lng_form}, '{$field_name}', ${$field_name}), {$required});
+ \$form->addElement(new XoopsFormRadioYN({$language}, '{$field_name}', ${$field_name}), {$required});
EOT;
return $ret;
}
/*
* @public function getXoopsFormTextDateSelect
- * @param string $lng_form
+ * @param string $language
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormTextDateSelect($lng_form, $field_name, $required = 'false') {
+ public function getXoopsFormTextDateSelect($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormTextDateSelect({$lng_form}, '{$field_name}', '', \$this->getVar('{$field_name}')), {$required});
+ \$form->addElement(new XoopsFormTextDateSelect({$language}, '{$field_name}', '', \$this->getVar('{$field_name}')), {$required});
EOT;
return $ret;
}
/*
- * @public function getXoopsFormTables
- * @param string $lng_form
+ * @public function getXoopsFormTable
+ * @param string $language
* @param string $module_name
* @param string $table_name
* @param string $field_name
* @param string $required
*/
- public function getXoopsFormTables($lng_form, $module_name, $table_name, $field_name, $required = 'false') {
- $ret = <<<EOT
+ public function getXoopsFormTable($language, $module_name, $table_name, $field_name, $required = 'false') {
+ $ret = <<<XFT
\${$table_name}Handler =& xoops_getModuleHandler('{$table_name}', '{$module_name}');
- \${$field_name}_select = new XoopsFormSelect({$lng_form}, '{$field_name}', \$this->getVar('{$field_name}'));
+ \${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
\${$field_name}_select->addOptionArray(${$field_name}Handler->getList());
\$form->addElement(${$field_name}_select, {$required});
-EOT;
+XFT;
return $ret;
}
/*
+ * @public function getXoopsFormTopic
+ * @param string $language
+ * @param string $module_name
+ * @param string $table_name
+ * @param string $field_name
+ * @param string $required
+ */
+ public function getXoopsFormTopic($language, $module_name, $table_name, $fields, $required = 'false') {
+ //
+ //
+ // ========================== Da elaborare per field parent e field name ============================
+ //
+ //
+ if($fields->getVar('field_id') == 1) {
+ $field_id = $fields->getVar('field_name');
+ }
+ if($fields->getVar('field_main') == 1) {
+ $field_name = $fields->getVar('field_name');
+ }
+ if($fields->getVar('field_parent') == 1) {
+ $field_pid = $fields->getVar('field_name');
+ }
+ $ret = <<<XFT
+ include_once(XOOPS_ROOT_PATH . '/class/tree.php');
+ \${$table_name}Handler = xoops_getModuleHandler('{$table_name}', '\${$module_name}' );
+ \$criteria = new CriteriaCompo();
+ \${$table_name} = \${$table_name}Handler->getObjects( \$criteria );
+ if(\${$table_name}) {
+ \${$table_name}_tree = new XoopsObjectTree( \${$table_name}, '{$field_id}', '{$field_pid}' );
+ \${$field_pid} = \${$table_name}_tree->makeSelBox( '{$field_pid}', '{$field_name}','--', \$this->getVar('{$field_pid}', 'e' ), true );
+ \$form->addElement( new XoopsFormLabel ( {$language}, \${$field_pid} ) );
+ }
+XFT;
+ // ========================== Da elaborare per field parent e field name ============================
+ return $ret;
+ }
+ /*
* @public function render
* @param null
*/
public function renderElement() {
- $module = $this->getModule();
- $table_name = $this->getTable()->getVar('table_name');
- $fields = $this->getFields();
- $filename = $this->getFileName();
- $module_name = $module->getVar('module_name');
- $field_name = $fields->getVar('field_name');
+ $module = $this->getModule();
+ $module_name = $module->getVar('module_name');
+ $table = $this->getTable();
+ $table_name = $table->getVar('table_name');
+ $fields = $this->getFields();
+ $field_name = $fields->getVar('field_name');
+ $filename = $this->getFileName();
$language = $this->getLanguage('AM', '_');
- $lng_form = $language . strtoupper($table_name) . '_' . strtoupper($field_name);
+ $language = $language . strtoupper($table_name) . '_' . strtoupper($field_name);
$required = ( $fields->getVar('field_required') == 1 ) ? 'true' : 'false';
$ret = '';
switch($fields->getVar('field_element'))
{
case 1:
- $ret .= $this->getXoopsFormText($lng_form, $field_name, $required);
+ $ret .= $this->getXoopsFormText($language, $field_name, $required);
break;
case 2:
- $ret .= $this->getXoopsFormTextArea($lng_form, $field_name, $required);
+ $ret .= $this->getXoopsFormTextArea($language, $field_name, $required);
break;
case 3:
- $ret .= $this->getXoopsFormDhtmlTextArea($lng_form, $module_name, $field_name, $required);
+ $ret .= $this->getXoopsFormDhtmlTextArea($language, $module_name, $field_name, $required);
break;
case 4:
- $ret .= $this->getXoopsFormCheckBox($lng_form, $field_name, $required);
+ $ret .= $this->getXoopsFormCheckBox($language, $field_name, $required);
break;
case 5:
$ret .= $this->getXoopsFormHidden($field_name);
break;
case 6:
- $ret .= $this->getXoopsFormUploadFile($lng_form, $field_name, $required);
+ $ret .= $this->getXoopsFormUploadFile($language, $field_name, $required);
break;
case 7:
- $ret .= $this->getXoopsFormUploadImage($lng_form, $field_name, $required);
+ $ret .= $this->getXoopsFormUploadImage($language, $field_name, $required);
break;
case 8:
- $ret .= $this->getXoopsFormColorPicker($lng_form, $field_name, $required);
+ $ret .= $this->getXoopsFormColorPicker($language, $field_name, $required);
break;
case 9:
- $ret .= $this->getXoopsFormSelectUser($lng_form, $field_name, $required);
+ $ret .= $this->getXoopsFormSelectUser($language, $field_name, $required);
break;
case 10:
- $ret .= $this->getXoopsFormRadioYN($lng_form, $field_name, $required);
+ $ret .= $this->getXoopsFormRadioYN($language, $field_name, $required);
break;
case 11:
- $ret .= $this->getXoopsFormTextDateSelect($lng_form, $field_name, $required);
+ $ret .= $this->getXoopsFormTextDateSelect($language, $field_name, $required);
break;
default:
- $ret .= $this->getXoopsFormTables($lng_form, $module_name, $table_name, $field_name, $required);
+ if($table->getVar('table_category') == 0) {
+ $ret .= $this->getXoopsFormTable($language, $module_name, $table_name, $field_name, $required);
+ } else {
+ $ret .= $this->getXoopsFormTopic($language, $module_name, $table_name, $fields, $required);
+ }
break;
}
return $ret;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/form/themeform.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/form/themeform.php 2014-04-17 21:19:14 UTC (rev 12457)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/form/themeform.php 2014-04-18 11:37:54 UTC (rev 12458)
@@ -45,8 +45,8 @@
public function render()
{
$ele_name = $this->getName();
- $ret = ($this->getTitle() ? '<div class=" center head ">' . $this->getTitle() . '</div>' : '');
- $ret .= NWLINE . '<form name="' . $ele_name . '" id="' . $ele_name . '" action="' . $this->getAction() . '" method="' . $this->getMethod() . '" onsubmit="return xoopsFormValidate_' . $ele_name . '();"' . $this->getExtra() . '>' . NWLINE;
+ //$ret = ($this->getTitle() ? '<div class=" center head ">' . $this->getTitle() . '</div>' : '');
+ $ret = NWLINE . '<form name="' . $ele_name . '" id="' . $ele_name . '" action="' . $this->getAction() . '" method="' . $this->getMethod() . '" onsubmit="return xoopsFormValidate_' . $ele_name . '();"' . $this->getExtra() . '>' . NWLINE;
$hidden = '';
$class = 'even';
foreach ($this->getElements() as $ele) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-04-17 21:19:14 UTC (rev 12457)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-04-18 11:37:54 UTC (rev 12458)
@@ -16,7 +16,7 @@
* @package tdmcreate
* @since 2.5.5
* @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 tables.php 11297 2013-03-24 10:58:10Z timgno $
+ * @version $Id: 1.91 tables.php 11297 2013-03-24 10:58:10Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
/*
@@ -50,7 +50,7 @@
$this->initVar('table_submenu',XOBJ_DTYPE_INT);
/*$this->initVar('table_status',XOBJ_DTYPE_INT);
$this->initVar('table_waiting',XOBJ_DTYPE_INT);
- $this->initVar('table_online',XOBJ_DTYPE_INT);*/
+ $this->initVar('table_display',XOBJ_DTYPE_INT);*/
$this->initVar('table_search',XOBJ_DTYPE_INT);
$this->initVar('table_comments',XOBJ_DTYPE_INT);
$this->initVar('table_notifications',XOBJ_DTYPE_INT);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php 2014-04-17 21:19:14 UTC (rev 12457)
+++ XoopsModules/TDMCreate/branches/timg...
[truncated message content] |
|
From: <txm...@us...> - 2014-04-19 16:37:01
|
Revision: 12461
http://sourceforge.net/p/xoops/svn/12461
Author: txmodxoops
Date: 2014-04-19 16:36:55 +0000 (Sat, 19 Apr 2014)
Log Message:
-----------
Updated
Pleace Mamba, Test for http://xoops.org/modules/newbb/viewtopic.php?post_id=357443
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-04-18 16:11:12 UTC (rev 12460)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-04-19 16:36:55 UTC (rev 12461)
@@ -26,6 +26,7 @@
} else {
$modules =& $modulesHandler;
}
+$mod_name = $modules->getVar('mod_name');
$from_dir = TDMC_UPLOAD_MODULES_PATH.'/'.strtolower($mod_name);
$to_dir = XOOPS_ROOT_PATH.'/modules/'.strtolower($mod_name);
switch ($op) {
@@ -33,7 +34,9 @@
$template_main = 'tdmcreate_building.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
// Clear repertory of new module if there are
- TDMCreate_clearDir(TDMC_UPLOAD_MODULES_PATH . '/' . $modules->getVar('mod_name'));
+ TDMCreate_clearDir($from_dir);
+ // Clear repertory of new module if there are in root/modules
+ TDMCreate_clearDir($to_dir);
// Debut
/************************************************/
/*Structure*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-18 16:11:12 UTC (rev 12460)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-19 16:36:55 UTC (rev 12461)
@@ -27,7 +27,7 @@
$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields');
$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');
// Get field Variables
-$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id', 0);
+$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id');
$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid');
$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb');
@@ -58,6 +58,7 @@
// Get the list of tables
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $table_mid));
+ $criteria->add(new Criteria('table_id', $table_id));
$criteria->setSort('table_id ASC, table_name');
$criteria->setOrder('ASC');
$nb_tables = $tablesHandler->getCount($criteria);
@@ -85,7 +86,7 @@
$table['permissions'] = $tables_arr[$t]->getVar('table_permissions');
// Get the list of tables
$criteria = new CriteriaCompo();
- $criteria->add(new Criteria('field_mid', $field_mid));
+ $criteria->add(new Criteria('field_mid', $table_mid));
$criteria->add(new Criteria('field_tid', $t));
$criteria->setSort('field_id ASC, field_name');
$criteria->setOrder('ASC');
@@ -136,43 +137,49 @@
case 'save':
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
- }
- if (isset($field_id)) {
+ }
+
+ if (isset($field_id)) {
$obj =& $fieldsHandler->get($field_id);
} else {
$obj =& $fieldsHandler->create();
- }
- $datas = array();
- for( $i = 0; $i < $table_nbfields; $i++ ) {
- $datas = array('field_mid' => $table_mid[$i],
- 'field_tid' => $table_id[$i],
- 'field_numb' => $table_nbfields[$i],
- 'field_name' => $_POST['field_name'][$i],
- 'field_type' => $_POST['field_type'][$i],
- 'field_value' => $_POST['field_value'][$i],
- 'field_attribute' => $_POST['field_attribute'][$i],
- 'field_null' => $_POST['field_null'][$i],
- 'field_default' => $_POST['field_default'][$i],
- 'field_key' => $_POST['field_key'][$i],
- 'field_autoincrement' => (($_REQUEST['field_autoincrement'][$i] == 1) ? '1' : '0'),
- 'field_element' => $_POST['field_element'][$i],
- 'field_inlist' => (($_REQUEST['field_inlist'][$i] == 1) ? '1' : '0'),
- 'field_inform' => (($_REQUEST['field_inform'][$i] == 1) ? '1' : '0'),
- 'field_admin' => (($_REQUEST['field_admin'][$i] == 1) ? '1' : '0'),
- 'field_user' => (($_REQUEST['field_user'][$i] == 1) ? '1' : '0'),
- 'field_block' => (($_REQUEST['field_block'][$i] == 1) ? '1' : '0'),
- 'field_main' => (($i == $_REQUEST['field_main']) ? '1' : '0'),
- 'field_search' => (($_REQUEST['field_search'][$i] == 1) ? '1' : '0'),
- 'field_required' => (($_REQUEST['field_required'][$i] == 1) ? '1' : '0')
- );
-
- }
- foreach ($datas as $data => $value) {
- $obj->setVars(array($data, $value));
+ }
+ if ($table_nbfields > 0) {
+ $datas = array();
+ for( $i = 0; $i < $table_nbfields; $i++ ) {
+ $datas[$i] = array('field_mid' => $table_mid[$i],
+ 'field_tid' => $table_id[$i],
+ 'field_numb' => $table_nbfields[$i],
+ 'field_name' => $_POST['field_name'][$i],
+ 'field_type' => $_POST['field_type'][$i],
+ 'field_value' => $_POST['field_value'][$i],
+ 'field_attribute' => $_POST['field_attribute'][$i],
+ 'field_null' => $_POST['field_null'][$i],
+ 'field_default' => $_POST['field_default'][$i],
+ 'field_key' => $_POST['field_key'][$i],
+ 'field_autoincrement' => (($_REQUEST['field_autoincrement'][$i] == 1) ? '1' : '0'),
+ 'field_element' => $_POST['field_element'][$i],
+ 'field_inlist' => (($_REQUEST['field_inlist'][$i] == 1) ? '1' : '0'),
+ 'field_inform' => (($_REQUEST['field_inform'][$i] == 1) ? '1' : '0'),
+ 'field_admin' => (($_REQUEST['field_admin'][$i] == 1) ? '1' : '0'),
+ 'field_user' => (($_REQUEST['field_user'][$i] == 1) ? '1' : '0'),
+ 'field_block' => (($_REQUEST['field_block'][$i] == 1) ? '1' : '0'),
+ 'field_main' => (($i == $_REQUEST['field_main']) ? '1' : '0'),
+ 'field_search' => (($_REQUEST['field_search'][$i] == 1) ? '1' : '0'),
+ 'field_required' => (($_REQUEST['field_required'][$i] == 1) ? '1' : '0')
+ );
+ }
+ foreach ($datas as $data => $value) {
+ $obj->setVars(array($data, $value));
+ $fieldsHandler->insert($obj);
+ }
+ }
+ if ($obj->isNew()) {
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_SAVED_OK, $_REQUEST['table_name']));
+ } else {
+ redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_UPDATED_OK, $_REQUEST['table_name']));
}
- if ($fieldsHandler->insert($obj)) {
- redirect_header('fields.php', 2, _AM_TDMCREATE_FORMOK);
- }
+ //
$GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
$form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-18 16:11:12 UTC (rev 12460)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-19 16:36:55 UTC (rev 12461)
@@ -137,7 +137,7 @@
} else {
$obj =& $tablesHandler->create();
}
- // Verification if name table exist
+ // Checking if table name exist
$table_name_search = $tablesHandler->getObjects(null);
foreach (array_keys($table_name_search) as $t)
{
@@ -188,9 +188,9 @@
if( $obj->isNew() ) {
$table_iid = $GLOBALS['xoopsDB']->getInsertId();
$table_action = '&field_mid='.$table_mid.'&field_tid='.$table_iid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname;
- redirect_header('fields.php?op=new'.$table_action, 3, _AM_TDMCREATE_FORMOK);
+ redirect_header('fields.php?op=new'.$table_action, 3, sprintf(_AM_TDMCREATE_TABLE_FORM_SAVED_OK, $_POST['table_name']));
} else {
- redirect_header('tables.php', 3, _AM_TDMCREATE_FORMOK);
+ redirect_header('tables.php', 3, sprintf(_AM_TDMCREATE_TABLE_FORM_UPDATED_OK, $_POST['table_name']));
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-18 16:11:12 UTC (rev 12460)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-19 16:36:55 UTC (rev 12461)
@@ -132,7 +132,7 @@
// Index ID
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$i.'</td>'));
// Field Name
- $field_name = $isNew ? $f_name . '_' : $this->getVar('field_name');
+ $field_name = $isNew ? (!empty($f_name) ? $f_name . '_' : '') : $this->getVar('field_name');
$field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$i.']', 15, 255, $field_name);
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
// Field Type
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-04-18 16:11:12 UTC (rev 12460)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-04-19 16:36:55 UTC (rev 12461)
@@ -152,6 +152,8 @@
define('_AM_TDMCREATE_TABLE_PERMISSIONS', "Permissions for this table");
// 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_FORM_SAVED_OK', "The table <b class='green'>%s</b> is successfully saved");
+define('_AM_TDMCREATE_TABLE_FORM_UPDATED_OK', "The table <b class='green'>%s</b> is successfully updated");
//Form2
define('_AM_TDMCREATE_FIELD_ADD', "Add fields");
@@ -177,6 +179,9 @@
define('_AM_TDMCREATE_FIELD_REQUIRED', "Field: Required");
define('_AM_TDMCREATE_ADMIN_SUBMIT', "Send");
+define('_AM_TDMCREATE_FIELD_FORM_SAVED_OK', "Fields of table %s successfully saved");
+define('_AM_TDMCREATE_FIELD_FORM_UPDATED_OK', "Fields of table %s successfully updated");
+
//Modules.php
//Form
define('_AM_TDMCREATE_MODULES_ADD', "Add a new module");
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-04-18 16:11:12 UTC (rev 12460)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-04-19 16:36:55 UTC (rev 12461)
@@ -411,5 +411,5 @@
$modversion['config'][$i]['description'] = "";
$modversion['config'][$i]['formtype'] = "textbox";
$modversion['config'][$i]['valuetype'] = "text";
-$modversion['config'][$i]['default'] = '12443';
+$modversion['config'][$i]['default'] = '12458';
unset($i);
\ No newline at end of file
|
|
From: <txm...@us...> - 2014-04-21 13:26:38
|
Revision: 12465
http://sourceforge.net/p/xoops/svn/12465
Author: txmodxoops
Date: 2014-04-21 13:26:32 +0000 (Mon, 21 Apr 2014)
Log Message:
-----------
Continuous integration
Added helper.php & request.php classes
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/helper.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/request.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-04-20 09:47:08 UTC (rev 12464)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-04-21 13:26:32 UTC (rev 12465)
@@ -20,9 +20,9 @@
*/
include 'header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
-
-if (isset($_REQUEST['mod_name'])) {
- $modules =& $modulesHandler->get($_REQUEST['mod_name']);
+$mname = TDMCreate_CleanVars( $_REQUEST, 'mod_name', '', 'string' );
+if ( $mname ) {
+ $modules =& $modulesHandler->get( $mname );
} else {
$modules =& $modulesHandler;
}
@@ -51,7 +51,7 @@
/*} else {
$GLOBALS['xoopsTpl']->assign('base_architecture', false);
}*/
- $mod_name = 'uploads/tdmcreate/modules/' . str_replace(' ', '', strtolower($modules->getVar('mod_name')));
+ $mod_name = 'uploads/tdmcreate/modules/' . str_replace(' ', '', strtolower($mod_name));
// Creation of the structure of folders and files
$GLOBALS['xoopsTpl']->assign('build_list', 'Under new construction - Temporary build only folders of this selected module "'.$mod_name.'/"');
if ( $modules->getVar('mod_install') == 1 ) {
@@ -67,13 +67,14 @@
$nb_modules = $modulesHandler->getObjects(null);
if ( $nb_modules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
- }
+ }
+ unset($nb_modules);
// Redirect if there aren't tables
$nb_tables = $tablesHandler->getObjects(null);
if ($nb_tables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
-
+ unset($nb_tables);
include_once TDMC_PATH . '/class/building.php';
$handler = TDMCreateBuilding::getInstance();
$form = $handler->getForm();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-20 09:47:08 UTC (rev 12464)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-21 13:26:32 UTC (rev 12465)
@@ -20,25 +20,38 @@
*/
include 'header.php';
// Recovered value of arguments op in the URL $
-$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
+//$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
+$tdmcreate = TDMCreate::getInstance();
+$op = TDMCreateRequest::getString('op', 'list');
// Get table Variables
$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id');
$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid');
$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields');
$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');
+/*$table_id = TDMCreateRequest::getInt('table_id');
+$table_mid = TDMCreateRequest::getInt('table_mid');
+$table_nbfields = TDMCreateRequest::getInt('table_nbfields');
+$table_fieldname = TDMCreateRequest::getString('table_fieldname', '');*/
// Get field Variables
-$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id');
+/*$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id');
$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid');
$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb');
-$field_name = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');
+$field_name = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');*/
+$field_id = TDMCreateRequest::getInt('field_id');
+$field_mid = TDMCreateRequest::getInt('field_mid');
+$field_tid = TDMCreateRequest::getInt('field_tid');
+$field_numb = TDMCreateRequest::getInt('field_numb');
+$field_name = TDMCreateRequest::getString('field_name', '');
//
switch ($op)
{
case 'list':
default:
- $limit = $GLOBALS['xoopsModuleConfig']['fields_adminpager'];
- $start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
+ //$limit = $GLOBALS['xoopsModuleConfig']['fields_adminpager'];
+ //$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
+ $start = TDMCreateRequest::getInt('start', 0);
+ $limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('fields_adminpager'));
// Define main template
$template_main = 'tdmcreate_fields.html';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
@@ -54,7 +67,13 @@
$nb_modules = $modulesHandler->getObjects(null);
if ( $nb_modules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
- }
+ }
+ unset($nb_modules);
+ $nb_tables = $tablesHandler->getObjects(null);
+ if ($nb_tables == 0) {
+ redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
+ }
+ unset($nb_tables);
// Get the list of tables
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $table_mid));
@@ -63,10 +82,7 @@
$criteria->setOrder('ASC');
$nb_tables = $tablesHandler->getCount($criteria);
$tables_arr = $tablesHandler->getAll($criteria);
- unset($criteria);
- if ($nb_tables == 0) {
- redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
- }
+ unset($criteria);
if ($nb_tables > 0)
{
foreach (array_keys($tables_arr) as $t)
@@ -169,8 +185,8 @@
'field_required' => (($_REQUEST['field_required'][$i] == 1) ? '1' : '0')
);
}
- foreach ($datas as $data => $value) {
- $obj->setVars(array($data, $value));
+ foreach ($datas as $value) {
+ $obj->setVars( $value );
$fieldsHandler->insert($obj);
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-04-20 09:47:08 UTC (rev 12464)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-04-21 13:26:32 UTC (rev 12465)
@@ -22,11 +22,13 @@
$criteria = new CriteriaCompo();
$count_modules = $modulesHandler->getCount($criteria);
$count_tables = $tablesHandler->getCount($criteria);
+$count_fields = $fieldsHandler->getCount($criteria);
unset($criteria);
$template_main = 'tdmcreate_index.html';
$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ;
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMMODULES. '</label>', $count_modules, 'Green') ;
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMTABLES. '</label>', $count_tables, 'Orange');
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMFIELDS. '</label>', $count_fields, 'Gray');
//$xoopsOption['template_main'] = 'tdmcreate_index.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('index.php'));
$GLOBALS['xoopsTpl']->assign('index', $adminMenu->renderIndex());
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-04-20 09:47:08 UTC (rev 12464)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-04-21 13:26:32 UTC (rev 12465)
@@ -19,15 +19,22 @@
* @version $Id: 1.59 modules.php 11297 2013-03-24 10:58:10Z timgno $
*/
include 'header.php';
-// Recovered the value of the argument op in the URL $
-$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
-$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id');
+// Recovered value of argument op in the URL $
+//$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
+//$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id');
+$tdmcreate = TDMCreate::getInstance();
+$op = TDMCreateRequest::getString('op', 'list');
+//
+$mod_id = TDMCreateRequest::getInt('mod_id');
+//
switch ($op)
{
case 'list':
default:
- $limit = $GLOBALS['xoopsModuleConfig']['modules_adminpager'];
- $start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
+ //$limit = $GLOBALS['xoopsModuleConfig']['modules_adminpager'];
+ //$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
+ $start = TDMCreateRequest::getInt('start', 0);
+ $limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
// Define main template
$template_main = 'tdmcreate_modules.html';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
@@ -39,11 +46,15 @@
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
$criteria->setOrder('ASC');
- $numrows = $modulesHandler->getCount();
+ $nb_modules = $modulesHandler->getCount();
$mods_arr = $modulesHandler->getAll( $criteria );
- unset($criteria);
+ unset($criteria);
+ // Redirect if there aren't modules
+ if ( $nb_modules == 0 ) {
+ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ }
// Display modules list
- if ($numrows>0)
+ if ($nb_modules > 0)
{
foreach (array_keys($mods_arr) as $i)
{
@@ -62,9 +73,9 @@
$GLOBALS['xoopsTpl']->append('modules_list', $mod);
unset($mod);
}
- if ( $numrows > $limit ) {
+ if ( $nb_modules > $limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $pagenav = new XoopsPageNav($nb_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
@@ -115,8 +126,8 @@
'mod_manual_file' => $_POST['mod_manual_file']));
//Form mod_image
include_once XOOPS_ROOT_PATH . '/class/uploader.php';
- $uploader = new XoopsMediaUploader(TDMC_UPLOAD_IMGMOD_PATH, $GLOBALS['xoopsModuleConfig']['mimetypes'],
- $GLOBALS['xoopsModuleConfig']['maxsize'], null, null);
+ $uploader = new XoopsMediaUploader(TDMC_UPLOAD_IMGMOD_PATH, $tdmcreate->getConfig('mimetypes'),
+ $tdmcreate->getConfig('maxsize'), null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
$extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']);
$name_img = $_GET['mod_name'].'_slogo.'.$extension;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-20 09:47:08 UTC (rev 12464)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-21 13:26:32 UTC (rev 12465)
@@ -20,20 +20,31 @@
*/
include 'header.php';
// Recovered value of arguments op in the URL $
-$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
+//$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
+$tdmcreate = TDMCreate::getInstance();
+$op = TDMCreateRequest::getString('op', 'list');
//
-$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id');
+/*$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id');
$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id');
$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid');
$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields');
-$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');
+$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');*/
//
+$mod_id = TDMCreateRequest::getInt('mod_id');
+//
+$table_id = TDMCreateRequest::getInt('table_id');
+$table_mid = TDMCreateRequest::getInt('table_mid');
+$table_nbfields = TDMCreateRequest::getInt('table_nbfields');
+$table_fieldname = TDMCreateRequest::getString('table_fieldname', '');
+//
switch ($op)
{
case 'list':
default:
- $limit = $GLOBALS['xoopsModuleConfig']['tables_adminpager'];
- $start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
+ //$limit = $GLOBALS['xoopsModuleConfig']['tables_adminpager'];
+ //$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
+ $start = TDMCreateRequest::getInt('start', 0);
+ $limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
// Define main template
$template_main = 'tdmcreate_tables.html';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
@@ -44,7 +55,7 @@
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
- //$GLOBALS['xoopsTpl']->assign('tdmc_upload_table_url', TDMC_UPLOAD_IMGTAB_URL);
+ //$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL);
$GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
// Get the list of modules
$criteria = new CriteriaCompo();
@@ -56,7 +67,12 @@
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
$mods_arr = $modulesHandler->getAll($criteria);
- unset($criteria);
+ unset($criteria);
+ $nb_tables = $tablesHandler->getObjects(null);
+ if ($nb_tables == 0) {
+ redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
+ }
+ unset($nb_tables);
// Display modules list
if ( $nb_modules > 0 )
{
@@ -159,8 +175,8 @@
}else{
$uploaddir = TDMC_UPLOAD_PATH.'/images/tables';
}
- $uploader = new XoopsMediaUploader($uploaddir, xoops_getModuleOption('mimetypes'),
- xoops_getModuleOption('maxsize'), null, null);
+ $uploader = new XoopsMediaUploader($uploaddir, $tdmcreate->getConfig('mimetypes'),
+ $tdmcreate->getConfig('maxsize'), null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
$extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['table_image']['name']);
$name_img = $_GET['table_name'].'.'.$extension;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php 2014-04-20 09:47:08 UTC (rev 12464)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/building.php 2014-04-21 13:26:32 UTC (rev 12465)
@@ -10,24 +10,33 @@
*/
/**
- * Xoops Javascript class
+ * TDMCreateBuilding class
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package media
+ * @package tdmcreate
* @since 2.5.x
* @author TDM TEAM DEV MODULE
- * @version $Id: modules.php 12209 2013-10-23 02:49:09Z beckmi $ modules.php 11114 2013-02-13 10:22:12Z timgno $
+ * @version $Id: modules.php 12425 2014-02-23 22:40:09Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class TDMCreateBuilding extends XoopsObject
{
- // Constructor
+ /**
+ * @var mixed
+ */
+ private $tdmc = null;
+
+ /*
+ * @public function constructor class
+ * @param null
+ */
public function __construct()
{
- $this->XoopsObject();
+ $this->XoopsObject();
+ $this->tdmc = TDMCreate::getInstance();
}
/*
@@ -50,7 +59,7 @@
}
xoops_load('XoopsFormLoader');
$form = new XoopsThemeForm(_AM_TDMCREATE_ADMIN_CONST, 'buildform', $action, 'post', true);
- $modulesHandler =& xoops_getModuleHandler('modules', 'TDMCreate');
+ $modulesHandler =& $this->tdmc->getHandler('modules');
$mod_select = new XoopsFormSelect(_AM_TDMCREATE_CONST_MODULES, 'mod_name', 'mod_name');
$mod_select->addOptionArray($modulesHandler->getList());
$form->addElement($mod_select, true);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-20 09:47:08 UTC (rev 12464)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-21 13:26:32 UTC (rev 12465)
@@ -99,7 +99,7 @@
$form->setExtra('enctype="multipart/form-data"');
$tablesHandler = xoops_getModuleHandler('tables');
- $fieldsHandler = xoops_getModuleHandler('fields');
+ //$fieldsHandler = xoops_getModuleHandler('fields');
$fieldelementsHandler =& xoops_getModuleHandler('fieldelements');
$fieldtypeHandler =& xoops_getModuleHandler('fieldtype');
$fieldattrsHandler =& xoops_getModuleHandler('fieldattributes');
@@ -122,7 +122,7 @@
$form->addElement(new TDMCreateFormLabel('</tr></thead>'));
$form->addElement(new TDMCreateFormLabel('<tbody>'));
- $fields = $fieldsHandler->getObjects(null);
+ //$fields = $fieldsHandler->getObjects(null);
$class = '';
for($i = 1; $i <= $field_numb; $i++)
@@ -132,8 +132,8 @@
// Index ID
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$i.'</td>'));
// Field Name
- $field_name = $isNew ? (!empty($f_name) ? $f_name . '_' : '') : $this->getVar('field_name');
- $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$i.']', 15, 255, $field_name);
+ $this_field_name = $isNew ? (!empty($f_name) ? $f_name . '_' : '') : $this->getVar('field_name');
+ $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$i.']', 15, 255, $this_field_name);
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
// Field Type
$fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type['.$i.']', $this->getVar('field_type'));
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/helper.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/helper.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/helper.php 2014-04-21 13:26:32 UTC (rev 12465)
@@ -0,0 +1,173 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author trabis <lus...@gm...>
+ * @version $Id: tdmcreate.php 12258 2014-04-12 23:45:12Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class TDMCreate
+{
+ /**
+ * @var string
+ */
+ private $dirname = null;
+ /**
+ * @var string
+ */
+ private $module = null;
+ /**
+ * @var string
+ */
+ private $handler = null;
+ /**
+ * @var string
+ */
+ private $config = null;
+ /**
+ * @var string
+ */
+ private $debug = null;
+ /**
+ * @var array
+ */
+ private $debugArray = array();
+ /*
+ * @protected function constructor class
+ * @param mixed $debug
+ */
+ protected function __construct($debug)
+ {
+ $this->debug = $debug;
+ $this->dirname = basename(dirname(dirname(__FILE__)));
+ }
+ /*
+ * @static function &getInstance
+ * @param mixed $debug
+ */
+ public static function &getInstance($debug = false)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($debug);
+ }
+ return $instance;
+ }
+ /*
+ * @static function getModule
+ * @param null
+ */
+ public function &getModule()
+ {
+ if ($this->module == null) {
+ $this->initModule();
+ }
+ return $this->module;
+ }
+ /*
+ * @static function getConfig
+ * @param string $name
+ */
+ public function getConfig($name = null)
+ {
+ if ($this->config == null) {
+ $this->initConfig();
+ }
+ if (!$name) {
+ $this->addLog("Getting all config");
+ return $this->config;
+ }
+ if (!isset($this->config[$name])) {
+ $this->addLog("ERROR :: CONFIG '{$name}' does not exist");
+ return null;
+ }
+ $this->addLog("Getting config '{$name}' : " . $this->config[$name]);
+ return $this->config[$name];
+ }
+ /*
+ * @static function setConfig
+ * @param string $name
+ * @param mixed $value
+ */
+ public function setConfig($name = null, $value = null)
+ {
+ if ($this->config == null) {
+ $this->initConfig();
+ }
+ $this->config[$name] = $value;
+ $this->addLog("Setting config '{$name}' : " . $this->config[$name]);
+ return $this->config[$name];
+ }
+ /*
+ * @static function getHandler
+ * @param string $name
+ */
+ public function &getHandler($name)
+ {
+ if (!isset($this->handler[$name . '_handler'])) {
+ $this->initHandler($name);
+ }
+ $this->addLog("Getting handler '{$name}'");
+ return $this->handler[$name . '_handler'];
+ }
+ /*
+ * @static function initModule
+ * @param null
+ */
+ public function initModule()
+ {
+ global $xoopsModule;
+ if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $this->dirname) {
+ $this->module = $xoopsModule;
+ } else {
+ $hModule = xoops_gethandler('module');
+ $this->module = $hModule->getByDirname($this->dirname);
+ }
+ $this->addLog('INIT MODULE');
+ }
+ /*
+ * @static function initConfig
+ * @param null
+ */
+ public function initConfig()
+ {
+ $this->addLog('INIT CONFIG');
+ $hModConfig = xoops_gethandler('config');
+ $this->config = $hModConfig->getConfigsByCat(0, $this->getModule()->getVar('mid'));
+ }
+ /*
+ * @static function initHandler
+ * @param string $name
+ */
+ public function initHandler($name)
+ {
+ $this->addLog('INIT ' . $name . ' HANDLER');
+ $this->handler[$name . '_handler'] = xoops_getModuleHandler($name, $this->dirname);
+ }
+ /*
+ * @static function addLog
+ * @param string $log
+ */
+ public function addLog($log)
+ {
+ if ($this->debug) {
+ if (is_object($GLOBALS['xoopsLogger'])) {
+ $GLOBALS['xoopsLogger']->addExtra($this->module->name(), $log);
+ }
+ }
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-04-20 09:47:08 UTC (rev 12464)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-04-21 13:26:32 UTC (rev 12465)
@@ -10,11 +10,11 @@
*/
/**
- * Xoops Javascript class
+ * modules class
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package media
+ * @package tdmcreate
* @since 2.5.x
* @author TDM TEAM DEV MODULE
* @version $Id: modules.php 12209 2013-10-23 02:49:09Z beckmi $
@@ -28,50 +28,56 @@
*/
class TDMCreateModules extends XoopsObject
{
+ /**
+ * Instance of TDMCreate class
+ *
+ * @var mixed
+ */
+ private $tdmcreate = null;
/*
* @public function constructor class
* @param null
*/
public function __construct()
{
- $this->XoopsObject();
+ $this->tdmcreate = TDMCreate::getInstance();
$this->initVar('mod_id',XOBJ_DTYPE_INT);
- $this->initVar('mod_name',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['name']);
- $this->initVar('mod_version',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['version']);
- $this->initVar('mod_since',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['since']);
- $this->initVar('mod_min_php',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_php']);
- $this->initVar('mod_min_xoops',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_xoops']);
- $this->initVar('mod_min_admin',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_admin']);
- $this->initVar('mod_min_mysql',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['min_mysql']);
- $this->initVar('mod_description',XOBJ_DTYPE_TXTAREA, $GLOBALS['xoopsModuleConfig']['description']);
- $this->initVar('mod_author',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['author']);
- $this->initVar('mod_author_mail',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['author_email']);
- $this->initVar('mod_author_website_url',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['author_website_url']);
- $this->initVar('mod_author_website_name',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['author_website_name']);
- $this->initVar('mod_credits',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['credits']);
- $this->initVar('mod_license',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['license']);
- $this->initVar('mod_release_info',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['release_info']);
- $this->initVar('mod_release_file',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['release_file']);
- $this->initVar('mod_manual',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['manual']);
- $this->initVar('mod_manual_file',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['manual_file']);
+ $this->initVar('mod_name',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('name'));
+ $this->initVar('mod_version',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('version'));
+ $this->initVar('mod_since',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('since'));
+ $this->initVar('mod_min_php',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('min_php'));
+ $this->initVar('mod_min_xoops',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('min_xoops'));
+ $this->initVar('mod_min_admin',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('min_admin'));
+ $this->initVar('mod_min_mysql',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('min_mysql'));
+ $this->initVar('mod_description',XOBJ_DTYPE_TXTAREA, $this->tdmcreate->getConfig('description'));
+ $this->initVar('mod_author',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('author'));
+ $this->initVar('mod_author_mail',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('author_email'));
+ $this->initVar('mod_author_website_url',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('author_website_url'));
+ $this->initVar('mod_author_website_name',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('author_website_name'));
+ $this->initVar('mod_credits',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('credits'));
+ $this->initVar('mod_license',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('license'));
+ $this->initVar('mod_release_info',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('release_info'));
+ $this->initVar('mod_release_file',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('release_file'));
+ $this->initVar('mod_manual',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('manual'));
+ $this->initVar('mod_manual_file',XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('manual_file'));
$this->initVar('mod_image',XOBJ_DTYPE_TXTBOX, null);
- $this->initVar('mod_demo_site_url',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['demo_site_url']);
- $this->initVar('mod_demo_site_name',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['demo_site_name']);
- $this->initVar('mod_support_url',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['support_url']);
- $this->initVar('mod_support_name',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['support_name']);
- $this->initVar('mod_website_url',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['website_url']);
- $this->initVar('mod_website_name',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']...
[truncated message content] |
|
From: <txm...@us...> - 2014-04-24 18:26:07
|
Revision: 12471
http://sourceforge.net/p/xoops/svn/12471
Author: txmodxoops
Date: 2014-04-24 18:26:01 +0000 (Thu, 24 Apr 2014)
Log Message:
-----------
Added class/session.php file
Updated
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/session.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-24 09:13:13 UTC (rev 12470)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-24 18:26:01 UTC (rev 12471)
@@ -21,7 +21,7 @@
include 'header.php';
// Recovered value of arguments op in the URL $
//$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
-$tdmcreate = TDMCreate::getInstance();
+//$tdmcreate = TDMCreate::getInstance();
$op = TDMCreateRequest::getString('op', 'list');
// Get table Variables
$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id');
@@ -33,16 +33,16 @@
$table_nbfields = TDMCreateRequest::getInt('table_nbfields');
$table_fieldname = TDMCreateRequest::getString('table_fieldname', '');*/
// Get field Variables
-/*$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id');
+$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id');
$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid');
$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb');
-$field_name = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');*/
-$field_id = TDMCreateRequest::getInt('field_id');
+$field_name = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');
+/*$field_id = TDMCreateRequest::getInt('field_id');
$field_mid = TDMCreateRequest::getInt('field_mid');
$field_tid = TDMCreateRequest::getInt('field_tid');
$field_numb = TDMCreateRequest::getInt('field_numb');
-$field_name = TDMCreateRequest::getString('field_name', '');
+$field_name = TDMCreateRequest::getString('field_name', ''); */
//
switch ($op)
{
@@ -151,21 +151,22 @@
break;
case 'save':
+ //
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
-
+ //
if (isset($field_id)) {
$obj =& $fieldsHandler->get($field_id);
} else {
$obj =& $fieldsHandler->create();
}
- if ($table_nbfields > 0) {
- $datas = array();
- for( $i = 0; $i < $table_nbfields; $i++ ) {
- $datas[$i] = array('field_mid' => $table_mid[$i],
+ //
+ if ($field_numb > 0) {
+ for( $i = 0; $i < $field_numb; $i++ ) {
+ $datas = array('field_mid' => $table_mid[$i],
'field_tid' => $table_id[$i],
- 'field_numb' => $table_nbfields[$i],
+ 'field_numb' => $field_numb[$i],
'field_name' => $_POST['field_name'][$i],
'field_type' => $_POST['field_type'][$i],
'field_value' => $_POST['field_value'][$i],
@@ -183,18 +184,19 @@
'field_main' => (($i == $_REQUEST['field_main']) ? '1' : '0'),
'field_search' => (($_REQUEST['field_search'][$i] == 1) ? '1' : '0'),
'field_required' => (($_REQUEST['field_required'][$i] == 1) ? '1' : '0')
- );
- }
- foreach ($datas as $value) {
- $obj->setVars( $value );
- $fieldsHandler->insert($obj);
- }
+ );
+ foreach ($datas as $key => $value) {
+ $obj->setVars( $value );
+ $fieldsHandler->insert($obj);
+ }
+ }
}
+ //
if ($obj->isNew()) {
redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_SAVED_OK, $_REQUEST['table_name']));
} else {
redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_UPDATED_OK, $_REQUEST['table_name']));
- }
+ }
//
$GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
$form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
@@ -218,43 +220,43 @@
case 'toggle':
if (isset($_GET['table_id'])) {
if (isset($_GET['table_blocks'])) {
- $table_blocks = intval($_GET['table_blocks']);
- $table_blocks = ($table_blocks == 1) ? 0 : 1;
+ $tbl_blocks = intval($_GET['table_blocks']);
+ $table_blocks = ($tbl_blocks == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_blocks', $table_blocks);
} elseif (isset($_GET['table_admin'])) {
- $table_admin = intval($_GET['table_admin']);
- $table_admin = ($table_admin == 1) ? 0 : 1;
+ $tbl_admin = intval($_GET['table_admin']);
+ $table_admin = ($tbl_admin == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_admin', $table_admin);
} elseif (isset($_GET['table_user'])) {
- $table_user = intval($_GET['table_user']);
- $table_user = ($table_user == 1) ? 0 : 1;
+ $tbl_user = intval($_GET['table_user']);
+ $table_user = ($tbl_user == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_user', $table_user);
} elseif (isset($_GET['table_submenu'])) {
- $table_submenu = intval($_GET['table_submenu']);
- $table_submenu = ($table_submenu == 1) ? 0 : 1;
+ $tbl_submenu = intval($_GET['table_submenu']);
+ $table_submenu = ($tbl_submenu == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_submenu', $table_submenu);
} elseif (isset($_GET['table_search'])) {
- $table_search = intval($_GET['table_search']);
- $table_search = ($table_search == 1) ? 0 : 1;
+ $tbl_search = intval($_GET['table_search']);
+ $table_search = ($tbl_search == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_search', $table_search);
} elseif (isset($_GET['table_comments'])) {
- $table_comments = intval($_GET['table_comments']);
- $table_comments = ($table_comments == 1) ? 0 : 1;
+ $tbl_comments = intval($_GET['table_comments']);
+ $table_comments = ($tbl_comments == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_comments', $table_comments);
} elseif (isset($_GET['table_notifications'])) {
- $table_notifications = intval($_GET['table_notifications']);
- $table_notifications = ($table_notifications == 1) ? 0 : 1;
+ $tbl_notifications = intval($_GET['table_notifications']);
+ $table_notifications = ($tbl_notifications == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_notifications', $table_notifications);
} elseif (isset($_GET['table_permissions'])) {
- $table_permissions = intval($_GET['table_permissions']);
- $table_permissions = ($table_permissions == 1) ? 0 : 1;
+ $tbl_permissions = intval($_GET['table_permissions']);
+ $table_permissions = ($tbl_permissions == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_permissions', $table_permissions);
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-04-24 09:13:13 UTC (rev 12470)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-04-24 18:26:01 UTC (rev 12471)
@@ -29,15 +29,17 @@
$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
+$tdmcreate = TDMCreate::getInstance();
+
// Get class handler
-$modulesHandler =& xoops_getModuleHandler('modules', $thisDirname);
-$tablesHandler =& xoops_getModuleHandler('tables', $thisDirname);
-$fieldsHandler =& xoops_getModuleHandler('fields', $thisDirname);
-$fieldtypeHandler=& xoops_getModuleHandler('fieldtype', $thisDirname);
-$fieldattributesHandler=& xoops_getModuleHandler('fieldattributes', $thisDirname);
-$fieldnullHandler=& xoops_getModuleHandler('fieldnull', $thisDirname);
-$fieldkeyHandler=& xoops_getModuleHandler('fieldkey', $thisDirname);
-$fieldelementsHandler=& xoops_getModuleHandler('fieldelements', $thisDirname);
+$modulesHandler =& $tdmcreate->getHandler('modules');
+$tablesHandler =& $tdmcreate->getHandler('tables');
+$fieldsHandler =& $tdmcreate->getHandler('fields');
+$fieldtypeHandler =& $tdmcreate->getHandler('fieldtype');
+$fieldattributesHandler =& $tdmcreate->getHandler('fieldattributes');
+$fieldnullHandler =& $tdmcreate->getHandler('fieldnull');
+$fieldkeyHandler =& $tdmcreate->getHandler('fieldkey');
+$fieldelementsHandler =& $tdmcreate->getHandler('fieldelements');
//
$myts =& MyTextSanitizer::getInstance();
if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-04-24 09:13:13 UTC (rev 12470)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-04-24 18:26:01 UTC (rev 12471)
@@ -22,7 +22,7 @@
// Recovered value of argument op in the URL $
//$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
//$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id');
-$tdmcreate = TDMCreate::getInstance();
+//$tdmcreate = TDMCreate::getInstance();
$op = TDMCreateRequest::getString('op', 'list');
//
$mod_id = TDMCreateRequest::getInt('mod_id');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-24 09:13:13 UTC (rev 12470)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-24 18:26:01 UTC (rev 12471)
@@ -21,7 +21,7 @@
include 'header.php';
// Recovered value of arguments op in the URL $
//$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
-$tdmcreate = TDMCreate::getInstance();
+//$tdmcreate = TDMCreate::getInstance();
$op = TDMCreateRequest::getString('op', 'list');
//
/*$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id');
@@ -204,9 +204,9 @@
if( $obj->isNew() ) {
$table_iid = $GLOBALS['xoopsDB']->getInsertId();
$table_action = '&field_mid='.$table_mid.'&field_tid='.$table_iid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname;
- redirect_header('fields.php?op=new'.$table_action, 3, sprintf(_AM_TDMCREATE_TABLE_FORM_SAVED_OK, $_POST['table_name']));
+ redirect_header('fields.php?op=new'.$table_action, 5, sprintf(_AM_TDMCREATE_TABLE_FORM_SAVED_OK, $_POST['table_name']));
} else {
- redirect_header('tables.php', 3, sprintf(_AM_TDMCREATE_TABLE_FORM_UPDATED_OK, $_POST['table_name']));
+ redirect_header('tables.php', 5, sprintf(_AM_TDMCREATE_TABLE_FORM_UPDATED_OK, $_POST['table_name']));
}
}
@@ -247,43 +247,43 @@
case 'toggle':
if (isset($_GET['table_id'])) {
if (isset($_GET['table_blocks'])) {
- $table_blocks = intval($_GET['table_blocks']);
- $table_blocks = ($table_blocks == 1) ? 0 : 1;
+ $tbl_blocks = intval($_GET['table_blocks']);
+ $table_blocks = ($tbl_blocks == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_blocks', $table_blocks);
} elseif (isset($_GET['table_admin'])) {
- $table_admin = intval($_GET['table_admin']);
- $table_admin = ($table_admin == 1) ? 0 : 1;
+ $tbl_admin = intval($_GET['table_admin']);
+ $table_admin = ($tbl_admin == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_admin', $table_admin);
} elseif (isset($_GET['table_user'])) {
- $table_user = intval($_GET['table_user']);
- $table_user = ($table_user == 1) ? 0 : 1;
+ $tbl_user = intval($_GET['table_user']);
+ $table_user = ($tbl_user == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_user', $table_user);
} elseif (isset($_GET['table_submenu'])) {
- $table_submenu = intval($_GET['table_submenu']);
- $table_submenu = ($table_submenu == 1) ? 0 : 1;
+ $tbl_submenu = intval($_GET['table_submenu']);
+ $table_submenu = ($tbl_submenu == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_submenu', $table_submenu);
} elseif (isset($_GET['table_search'])) {
- $table_search = intval($_GET['table_search']);
- $table_search = ($table_search == 1) ? 0 : 1;
+ $tbl_search = intval($_GET['table_search']);
+ $table_search = ($tbl_search == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_search', $table_search);
} elseif (isset($_GET['table_comments'])) {
- $table_comments = intval($_GET['table_comments']);
- $table_comments = ($table_comments == 1) ? 0 : 1;
+ $tbl_comments = intval($_GET['table_comments']);
+ $table_comments = ($tbl_comments == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_comments', $table_comments);
} elseif (isset($_GET['table_notifications'])) {
- $table_notifications = intval($_GET['table_notifications']);
- $table_notifications = ($table_notifications == 1) ? 0 : 1;
+ $tbl_notifications = intval($_GET['table_notifications']);
+ $table_notifications = ($tbl_notifications == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_notifications', $table_notifications);
} elseif (isset($_GET['table_permissions'])) {
- $table_permissions = intval($_GET['table_permissions']);
- $table_permissions = ($table_permissions == 1) ? 0 : 1;
+ $tbl_permissions = intval($_GET['table_permissions']);
+ $table_permissions = ($tbl_permissions == 1) ? 0 : 1;
$obj =& $tablesHandler->get($table_id);
$obj->setVar('table_permissions', $table_permissions);
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php 2014-04-24 09:13:13 UTC (rev 12470)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php 2014-04-24 18:26:01 UTC (rev 12471)
@@ -39,6 +39,18 @@
$this->initVar('fieldelement_name', XOBJ_DTYPE_TXTBOX);
}
+ /**
+ * @param string $method
+ * @param array $args
+ *
+ * @return mixed
+ */
+ public function __call($method, $args)
+ {
+ $arg = isset($args[0]) ? $args[0] : null;
+ return $this->getVar($method, $arg);
+ }
+
/*
* @static function &getInstance
* @param null
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-24 09:13:13 UTC (rev 12470)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-24 18:26:01 UTC (rev 12471)
@@ -30,6 +30,11 @@
/**
* @var mixed
*/
+ private $tdmc = null;
+
+ /**
+ * @var mixed
+ */
private $table = null;
/*
@@ -38,6 +43,7 @@
*/
public function __construct()
{
+ $this->tdmc = TDMCreate::getInstance();
$this->table = TDMCreateTables::getInstance();
$this->initVar('field_id', XOBJ_DTYPE_INT);
$this->initVar('field_mid', XOBJ_DTYPE_INT);
@@ -61,6 +67,18 @@
$this->initVar('field_required', XOBJ_DTYPE_INT);
}
+ /**
+ * @param string $method
+ * @param array $args
+ *
+ * @return mixed
+ */
+ public function __call($method, $args)
+ {
+ $arg = isset($args[0]) ? $args[0] : null;
+ return $this->getVar($method, $arg);
+ }
+
/*
* @static function &getInstance
* @param null
@@ -86,7 +104,7 @@
public function getForm($f_mid = null, $f_tid = null, $f_numb = null, $f_name = null, $action = false)
{
if ($action === false) {
- $action = XOOPS_URL.'/modules/TDMCreate/admin/fields.php'; //$_SERVER['REQUEST_URI'];
+ $action = $_SERVER['REQUEST_URI'];
}
$isNew = $this->isNew();
$title = $isNew ? sprintf(_AM_TDMCREATE_FIELD_ADD) : sprintf(_AM_TDMCREATE_FIELD_EDIT);
@@ -98,13 +116,13 @@
$form = new TDMCreateThemeForm(null, 'form', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
- $tablesHandler = xoops_getModuleHandler('tables');
- //$fieldsHandler = xoops_getModuleHandler('fields');
- $fieldelementsHandler =& xoops_getModuleHandler('fieldelements');
- $fieldtypeHandler =& xoops_getModuleHandler('fieldtype');
- $fieldattrsHandler =& xoops_getModuleHandler('fieldattributes');
- $fieldnullHandler =& xoops_getModuleHandler('fieldnull');
- $fieldkeyHandler =& xoops_getModuleHandler('fieldkey');
+ $tablesHandler = $this->tdmc->getHandler('tables');
+ //$fieldsHandler = $this->tdmc->getHandler('fields');
+ $fieldelementsHandler =& $this->tdmc->getHandler('fieldelements');
+ $fieldtypeHandler =& $this->tdmc->getHandler('fieldtype');
+ $fieldattrsHandler =& $this->tdmc->getHandler('fieldattributes');
+ $fieldnullHandler =& $this->tdmc->getHandler('fieldnull');
+ $fieldkeyHandler =& $this->tdmc->getHandler('fieldkey');
// New Object HtmlTable
$form->addElement(new TDMCreateFormLabel('<table border="0" cellspacing="1" class="outer width100">'));
$form->addElement(new TDMCreateFormLabel('<thead class="center">'));
@@ -159,7 +177,7 @@
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_key_select->render().'</td>'));
// Field Autoincrement
if($i == 1) {
- $field_autoincrement = $this->isNew() ? 0 : $this->getVar('field_autoincrement');
+ $field_autoincrement = $this->isNew() ? 1 : $this->getVar('field_autoincrement');
$check_field_autoincrement = new XoopsFormCheckBox(' ', 'field_autoincrement['.$i.']', $field_autoincrement);
$check_field_autoincrement->addOption(1, _AM_TDMCREATE_FIELD_AUTO_INCREMENT);
$form->addElement(new TDMCreateFormLabel('<td>'.$check_field_autoincrement->render().'</td></tr>'));
@@ -209,9 +227,9 @@
$check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
$parameters_tray->addElement($check_field_block);
- $field_mnfield = $this->isNew() ? 1 : $this->getVar('field_main');
- $field_main = new XoopsFormRadio('', 'field_main['.$i.']', $field_mnfield);
- $field_main->addOption( $i, _AM_TDMCREATE_FIELD_MAINFIELD );
+ $field_mnfield = $this->isNew() ? ( $i == 1 ) : $this->getVar('field_main');
+ $field_main = new XoopsFormRadio('', 'field_main', $field_mnfield);
+ $field_main->addOption( '', _AM_TDMCREATE_FIELD_MAINFIELD );
$parameters_tray->addElement($field_main);
$field_search = $this->isNew() ? 0 : $this->getVar('field_search');
@@ -251,8 +269,8 @@
$f_mid = $this->table->getVar('table_mid');
$f_tid = $this->table->getVar('table_id');
$f_numb = $this->table->getVar('table_nbfields');
- $f_name = $this->table->getVar('table_fieldname');
- $ret['edit_form'] = $this->getForm($f_mid, $f_tid, $f_numb, $f_name);
+ //$f_name = $this->table->getVar('table_fieldname');
+ $ret['edit_form'] = $this->getForm($f_mid, $f_tid, $f_numb/*, $f_name*/);
return $ret;
}
}
@@ -265,6 +283,11 @@
/**
* @var mixed
*/
+ public $tdmc = null;
+
+ /**
+ * @var mixed
+ */
public $table = null;
/*
@@ -273,10 +296,33 @@
*/
public function __construct(&$db)
{
+ $this->tdmc = TDMCreate::getInstance();
$this->table = TDMCreateTables::getInstance();
parent::__construct($db, 'mod_tdmcreate_fields', 'tdmcreatefields', 'field_id', 'field_tid');
}
+ /**
+ * @param bool $isNew
+ *
+ * @return object
+ */
+ public function &create($isNew = true)
+ {
+ return parent::create($isNew);
+ }
+
+ /**
+ * retrieve a field
+ *
+ * @param int $id field_id
+ *
+ * @return mixed reference to the {@link TDMCreateFields} object
+ */
+ public function &get($id)
+ {
+ return parent::get($id);
+ }
+
/*
* @public function getFieldModuleId
* @param integer $field_id
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-04-24 09:13:13 UTC (rev 12470)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-04-24 18:26:01 UTC (rev 12471)
@@ -123,7 +123,7 @@
*
* @param null
*/
- function __construct()
+ public function __construct()
{
\$this->XoopsObject();
{$initvar_functions}
@@ -145,10 +145,10 @@
*
* @param mixed \$action
*/
- function getForm(\$action = false)
+ public function getForm(\$action = false)
{
if (\$action === false) {
- \$action = \$_SERVER['REQUEST_URI'];
+ \$action = filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_ENCODED);
}
\$title = \$this->isNew() ? sprintf({$lang_add}) : sprintf({$lang_edit});
@@ -223,8 +223,10 @@
* @param string $fpif
* @param string $fpmf
*/
- public function getClassHandler($module_name, $table_name, $fpif, $fpmf) {
- $ucf_mod_table_handler = ucfirst($module_name).ucfirst($table_name);
+ public function getClassHandler($module_name, $table_name, $fpif, $fpmf) {
+ $ucf_module_name = ucfirst($module_name);
+ $ucf_table_name = ucfirst($table_name);
+ $ucf_mod_table_handler = $ucf_module_name . $ucf_table_name;
$ret = <<<EOT
/*
@@ -237,7 +239,7 @@
*
* @param string \$db
*/
- function __construct(&\$db)
+ public function __construct(&\$db)
{
parent::__construct(\$db, 'mod_{$module_name}_{$table_name}', '{$module_name}{$table_name}', '{$fpif}', '{$fpmf}');
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-04-24 09:13:13 UTC (rev 12470)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-04-24 18:26:01 UTC (rev 12471)
@@ -80,6 +80,18 @@
$this->initVar('mod_subversion', XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('subversion'));
}
+ /**
+ * @param string $method
+ * @param array $args
+ *
+ * @return mixed
+ */
+ public function __call($method, $args)
+ {
+ $arg = isset($args[0]) ? $args[0] : null;
+ return $this->getVar($method, $arg);
+ }
+
/*
* @static function &getInstance
* @param null
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/session.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/session.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/session.php 2014-04-24 18:26:01 UTC (rev 12471)
@@ -0,0 +1,105 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * TDMCreate class
+ *
+ * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @package TDMCreate
+ * @since 1.0
+ * @author trabis <lus...@gm...>
+ * @author Harry Fuecks (PHP Anthology Volume II)
+ * @version $Id: 1.91 session.php 12453 2014-03-28 18:34:46Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class TDMCreateSession
+{
+ /**
+ * Session constructor<br />
+ * Starts the session with session_start()
+ * <strong>Note:</strong> that if the session has already started,
+ * session_start() does nothing
+ */
+ protected function __construct()
+ {
+ @session_start();
+ }
+
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $_sess = false;
+ if (!isset($_sess)) {
+ $_sess = new self();
+ }
+ return $_sess;
+ }
+
+ /**
+ * Sets a session variable
+ *
+ * @param string $name name of variable
+ * @param mixed $value value of variable
+ *
+ * @return void
+ * @access public
+ */
+ public function setSession($name, $value)
+ {
+ $_SESSION[$name] = $value;
+ }
+
+ /**
+ * Fetches a session variable
+ *
+ * @param string $name name of variable
+ *
+ * @return mixed value of session variable
+ * @access public
+ */
+ public function getSession($name)
+ {
+ if (isset($_SESSION[$name])) {
+ return $_SESSION[$name];
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Deletes a session variable
+ *
+ * @param string $name name of variable
+ *
+ * @return void
+ * @access public
+ */
+ public function deleteSession($name)
+ {
+ unset($_SESSION[$name]);
+ }
+
+ /**
+ * Destroys the whole session
+ *
+ * @return void
+ * @access public
+ */
+ public function destroySession()
+ {
+ $_SESSION = array();
+ session_destroy();
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-04-24 09:13:13 UTC (rev 12470)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-04-24 18:26:01 UTC (rev 12471)
@@ -57,6 +57,18 @@
$this->initVar('table_permissions',XOBJ_DTYPE_INT);
}
+ /**
+ * @param string $method
+ * @param array $args
+ *
+ * @return mixed
+ */
+ public function __call($method, $args)
+ {
+ $arg = isset($args[0]) ? $args[0] : null;
+ return $this->getVar($method, $arg);
+ }
+
/*
* @static function &getInstance
* @param null
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-04-24 09:13:13 UTC (rev 12470)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-04-24 18:26:01 UTC (rev 12471)
@@ -39,5 +39,6 @@
define('TDMC_UPLOAD_IMGTAB_PATH', TDMC_UPLOAD_PATH . '/images/tables' );
define('TDMC_UPLOAD_IMGTAB_URL', TDMC_UPLOAD_URL . '/images/tables' );
+include_once TDMC_PATH . '/class/session.php';
include_once TDMC_PATH . '/class/helper.php';
include_once TDMC_PATH . '/class/request.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-04-24 09:13:13 UTC (rev 12470)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-04-24 18:26:01 UTC (rev 12471)
@@ -411,5 +411,5 @@
$modversion['config'][$i]['description'] = "";
$modversion['config'][$i]['formtype'] = "textbox";
$modversion['config'][$i]['valuetype'] = "text";
-$modversion['config'][$i]['default'] = '12458';
+$modversion['config'][$i]['default'] = '12465';
unset($i);
\ No newline at end of file
|
|
From: <txm...@us...> - 2014-05-01 16:22:48
|
Revision: 12517
http://sourceforge.net/p/xoops/svn/12517
Author: txmodxoops
Date: 2014-05-01 16:22:45 +0000 (Thu, 01 May 2014)
Log Message:
-----------
Fix issues regard saving multifields in database
Moved from fields (database table) to tables (database table)
auto_increment option
Updated - Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/fields.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/about.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/building.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/footer.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/header.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/index.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/modules.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tables.tpl
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/jq.init.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_about.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_header.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_help.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -19,7 +19,7 @@
* @version $Id: about.php 11084 2013-02-23 15:44:20Z timgno $
*/
include 'header.php';
-$template_main = 'tdmcreate_about.html';
+$template_main = 'about.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('about.php'));
$GLOBALS['xoopsTpl']->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false));
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -64,16 +64,16 @@
$template_main = 'tdmcreate_building.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
// Redirect if there aren't modules
- $nb_modules = $modulesHandler->getObjects(null);
+ $nb_modules = $modulesHandler->getCount();
if ( $nb_modules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
unset($nb_modules);
// Redirect if there aren't tables
- $nb_tables = $tablesHandler->getObjects(null);
+ $nb_tables = $tablesHandler->getCount();
if ($nb_tables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
- }
+ }
unset($nb_tables);
include_once TDMC_PATH . '/class/building.php';
$handler = TDMCreateBuilding::getInstance();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -53,7 +53,7 @@
$start = TDMCreateRequest::getInt('start', 0);
$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('fields_adminpager'));
// Define main template
- $template_main = 'tdmcreate_fields.html';
+ $template_main = 'fields.tpl';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
@@ -64,12 +64,13 @@
$GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
$GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
// Redirect if there aren't modules
- $nb_modules = $modulesHandler->getObjects(null);
+ $nb_modules = $modulesHandler->getCount();
if ( $nb_modules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
unset($nb_modules);
- $nb_tables = $tablesHandler->getObjects(null);
+ // Redirect if there aren't tables
+ $nb_tables = $tablesHandler->getCount();
if ($nb_tables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
@@ -133,13 +134,13 @@
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
- $GLOBALS['xoopsTpl']->assign('error', 'Add, Edit or List View in Fields');
+ $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_FIELDS);
}
break;
case 'new':
// Define main template
- $template_main = 'tdmcreate_fields.html';
+ $template_main = 'fields.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
$adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
@@ -160,35 +161,32 @@
$obj =& $fieldsHandler->get($field_id);
} else {
$obj =& $fieldsHandler->create();
- }
+ }
//
if ($field_numb > 0) {
- for( $i = 0; $i < $field_numb; $i++ ) {
- $datas = array('field_mid' => $table_mid[$i],
- 'field_tid' => $table_id[$i],
- 'field_numb' => $field_numb[$i],
- 'field_name' => $_POST['field_name'][$i],
- 'field_type' => $_POST['field_type'][$i],
- 'field_value' => $_POST['field_value'][$i],
- 'field_attribute' => $_POST['field_attribute'][$i],
- 'field_null' => $_POST['field_null'][$i],
- 'field_default' => $_POST['field_default'][$i],
- 'field_key' => $_POST['field_key'][$i],
- 'field_autoincrement' => (($_REQUEST['field_autoincrement'][$i] == 1) ? '1' : '0'),
- 'field_element' => $_POST['field_element'][$i],
- 'field_inlist' => (($_REQUEST['field_inlist'][$i] == 1) ? '1' : '0'),
- 'field_inform' => (($_REQUEST['field_inform'][$i] == 1) ? '1' : '0'),
- 'field_admin' => (($_REQUEST['field_admin'][$i] == 1) ? '1' : '0'),
- 'field_user' => (($_REQUEST['field_user'][$i] == 1) ? '1' : '0'),
- 'field_block' => (($_REQUEST['field_block'][$i] == 1) ? '1' : '0'),
- 'field_main' => (($i == $_REQUEST['field_main']) ? '1' : '0'),
- 'field_search' => (($_REQUEST['field_search'][$i] == 1) ? '1' : '0'),
- 'field_required' => (($_REQUEST['field_required'][$i] == 1) ? '1' : '0')
- );
- foreach ($datas as $key => $value) {
- $obj->setVars( $value );
- $fieldsHandler->insert($obj);
- }
+ for( $i = 1; $i <= $field_numb; $i++ ) {
+
+ $obj->setVar( 'field_mid', $field_mid );
+ $obj->setVar( 'field_tid', $field_tid );
+ $obj->setVar( 'field_numb', $field_numb );
+ $obj->setVar( 'field_name', (isset($_POST['field_name'][$i]) ? $_POST['field_name'][$i] : '') );
+ $obj->setVar( 'field_type', (isset($_POST['field_type'][$i]) ? $_POST['field_type'][$i] : '') );
+ $obj->setVar( 'field_value', (isset($_POST['field_value'][$i]) ? $_POST['field_value'][$i] : '') );
+ $obj->setVar( 'field_attribute', (isset($_POST['field_attribute'][$i]) ? $_POST['field_attribute'][$i] : '') );
+ $obj->setVar( 'field_null', (isset($_POST['field_null'][$i]) ? $_POST['field_null'][$i] : '') );
+ $obj->setVar( 'field_default', (isset($_POST['field_default'][$i]) ? $_POST['field_default'][$i] : '') );
+ $obj->setVar( 'field_key', (isset($_POST['field_key'][$i]) ? $_POST['field_key'][$i] : '') );
+ $obj->setVar( 'field_element', (isset($_POST['field_element'][$i]) ? $_POST['field_element'][$i] : '') );
+ $obj->setVar( 'field_inlist', ((isset($_REQUEST['field_inlist'][$i]) == 1) ? '1' : '0') );
+ $obj->setVar( 'field_inform', ((isset($_REQUEST['field_inform'][$i]) == 1) ? '1' : '0') );
+ $obj->setVar( 'field_admin', ((isset($_REQUEST['field_admin'][$i]) == 1) ? '1' : '0') );
+ $obj->setVar( 'field_user', ((isset($_REQUEST['field_user'][$i]) == 1) ? '1' : '0') );
+ $obj->setVar( 'field_block', ((isset($_REQUEST['field_block'][$i]) == 1) ? '1' : '0') );
+ $obj->setVar( 'field_main', (($i == isset($_REQUEST['field_main'])) ? '1' : '0') );
+ $obj->setVar( 'field_search', ((isset($_REQUEST['field_search'][$i]) == 1) ? '1' : '0') );
+ $obj->setVar( 'field_required', ((isset($_REQUEST['field_required'][$i]) == 1) ? '1' : '0') );
+
+ $fieldsHandler->insert($obj);
}
}
//
@@ -199,13 +197,13 @@
}
//
$GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
- $form = $obj->getForm($field_mid, $field_tid, $field_numb, $field_name);
+ $form = $obj->getForm($field_mid, $field_tid, $field_numb);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'edit':
// Define main template
- $template_main = 'tdmcreate_tables.html';
+ $template_main = 'tables.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -24,7 +24,7 @@
$count_tables = $tablesHandler->getCount($criteria);
$count_fields = $fieldsHandler->getCount($criteria);
unset($criteria);
-$template_main = 'tdmcreate_index.html';
+$template_main = 'index.tpl';
$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ;
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMMODULES. '</label>', $count_modules, 'Green') ;
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMTABLES. '</label>', $count_tables, 'Orange');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -22,7 +22,7 @@
// Recovered value of argument op in the URL $
//$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
//$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id');
-//$tdmcreate = TDMCreate::getInstance();
+$tdmcreate = TDMCreate::getInstance();
$op = TDMCreateRequest::getString('op', 'list');
//
$mod_id = TDMCreateRequest::getInt('mod_id');
@@ -36,7 +36,7 @@
$start = TDMCreateRequest::getInt('start', 0);
$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
// Define main template
- $template_main = 'tdmcreate_modules.html';
+ $template_main = 'modules.tpl';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
@@ -79,13 +79,13 @@
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
- $GLOBALS['xoopsTpl']->assign('error', 'There aren\'t modules');
+ $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_MODULES);
}
break;
case 'new':
// Define main template
- $template_main = 'tdmcreate_modules.html';
+ $template_main = 'modules.tpl';
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
@@ -158,6 +158,7 @@
'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'),
'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0'),
'mod_permissions' => (($_REQUEST['mod_permissions'] == 1) ? '1' : '0'),
+ 'mod_inroot_copy' => (($_REQUEST['mod_inroot_copy'] == 1) ? '1' : '0'),
'mod_donations' => $_POST['mod_donations'],
'mod_subversion' => $_POST['mod_subversion'])
);
@@ -173,7 +174,7 @@
case 'edit':
// Define main template
- $template_main = 'tdmcreate_modules.html';
+ $template_main = 'modules.tpl';
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -46,7 +46,7 @@
$start = TDMCreateRequest::getInt('start', 0);
$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
// Define main template
- $template_main = 'tdmcreate_tables.html';
+ $template_main = 'tables.tpl';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
@@ -128,13 +128,13 @@
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
- $GLOBALS['xoopsTpl']->assign('error', 'There aren\'t modules');
+ $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_TABLES);
}
break;
case 'new':
// Define main template
- $template_main = 'tdmcreate_tables.html';
+ $template_main = 'tables.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
@@ -217,7 +217,7 @@
case 'edit':
// Define main template
- $template_main = 'tdmcreate_tables.html';
+ $template_main = 'tables.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=list', 'list');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -9,11 +9,11 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
- * tdmcreate module
+ * tdmcreatereate module
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- * @package tdmcreate
+ * @package tdmcreatereate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $
@@ -30,7 +30,7 @@
/**
* @var mixed
*/
- private $tdmc = null;
+ private $tdmcreate = null;
/**
* @var mixed
@@ -43,7 +43,7 @@
*/
public function __construct()
{
- $this->tdmc = TDMCreate::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
$this->table = TDMCreateTables::getInstance();
$this->initVar('field_id', XOBJ_DTYPE_INT);
$this->initVar('field_mid', XOBJ_DTYPE_INT);
@@ -54,9 +54,9 @@
$this->initVar('field_attribute', XOBJ_DTYPE_TXTBOX);
$this->initVar('field_null', XOBJ_DTYPE_TXTBOX);
$this->initVar('field_default', XOBJ_DTYPE_TXTBOX);
- $this->initVar('field_key', XOBJ_DTYPE_TXTBOX);
- $this->initVar('field_autoincrement', XOBJ_DTYPE_INT);
+ $this->initVar('field_key', XOBJ_DTYPE_TXTBOX);
$this->initVar('field_element', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_parent', XOBJ_DTYPE_INT);
$this->initVar('field_inlist', XOBJ_DTYPE_INT);
$this->initVar('field_inform', XOBJ_DTYPE_INT);
$this->initVar('field_admin', XOBJ_DTYPE_INT);
@@ -116,13 +116,13 @@
$form = new TDMCreateThemeForm(null, 'form', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
- $tablesHandler = $this->tdmc->getHandler('tables');
- //$fieldsHandler = $this->tdmc->getHandler('fields');
- $fieldelementsHandler =& $this->tdmc->getHandler('fieldelements');
- $fieldtypeHandler =& $this->tdmc->getHandler('fieldtype');
- $fieldattrsHandler =& $this->tdmc->getHandler('fieldattributes');
- $fieldnullHandler =& $this->tdmc->getHandler('fieldnull');
- $fieldkeyHandler =& $this->tdmc->getHandler('fieldkey');
+ $tablesHandler = $this->tdmcreate->getHandler('tables');
+ //$fieldsHandler = $this->tdmcreate->getHandler('fields');
+ $fieldelementsHandler =& $this->tdmcreate->getHandler('fieldelements');
+ $fieldtypeHandler =& $this->tdmcreate->getHandler('fieldtype');
+ $fieldattrsHandler =& $this->tdmcreate->getHandler('fieldattributes');
+ $fieldnullHandler =& $this->tdmcreate->getHandler('fieldnull');
+ $fieldkeyHandler =& $this->tdmcreate->getHandler('fieldkey');
// New Object HtmlTable
$form->addElement(new TDMCreateFormLabel('<table border="0" cellspacing="1" class="outer width100">'));
$form->addElement(new TDMCreateFormLabel('<thead class="center">'));
@@ -175,17 +175,15 @@
$field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key['.$i.']', $this->getVar('field_key'));
$field_key_select->addOptionArray($fieldkeyHandler->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_key_select->render().'</td>'));
- // Field Autoincrement
- if($i == 1) {
- $field_autoincrement = $this->isNew() ? 1 : $this->getVar('field_autoincrement');
- $check_field_autoincrement = new XoopsFormCheckBox(' ', 'field_autoincrement['.$i.']', $field_autoincrement);
- $check_field_autoincrement->addOption(1, _AM_TDMCREATE_FIELD_AUTO_INCREMENT);
- $form->addElement(new TDMCreateFormLabel('<td>'.$check_field_autoincrement->render().'</td></tr>'));
- } elseif($i > 1) {
+ // Field Void
+ $table_autoincrement = $this->tdmcreate->getHandler('tables')->get($f_tid);
+ if( ($i == 1) && ($table_autoincrement->getVar('table_autoincrement') == 1)/**/) {
+ $form->addElement(new TDMCreateFormLabel('<td> </td></tr>'));
+ } else {
// Box header row
$parameters_tray = new XoopsFormElementTray('', '<br />');
// Field Elements
- $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$i.']', $this->getVar('field_element'));
+ $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$i.']', $this->getVar('field_element'));
$field_elements_select->addOptionArray($fieldelementsHandler->getList());
$criteria = new CriteriaCompo(new Criteria('table_id', $f_tid));
$criteria->add(new Criteria('table_mid', $f_mid));
@@ -270,7 +268,7 @@
$f_tid = $this->table->getVar('table_id');
$f_numb = $this->table->getVar('table_nbfields');
//$f_name = $this->table->getVar('table_fieldname');
- $ret['edit_form'] = $this->getForm($f_mid, $f_tid, $f_numb/*, $f_name*/);
+ $ret['edit'] = $this->getForm($f_mid, $f_tid, $f_numb/*, $f_name*/);
return $ret;
}
}
@@ -279,11 +277,11 @@
* @extends XoopsPersistableObjectHandler
*/
class TDMCreateFieldsHandler extends XoopsPersistableObjectHandler
-{
+{
/**
* @var mixed
*/
- public $tdmc = null;
+ public $tdmcreate = null;
/**
* @var mixed
@@ -295,8 +293,8 @@
* @param mixed $db
*/
public function __construct(&$db)
- {
- $this->tdmc = TDMCreate::getInstance();
+ {
+ $this->tdmcreate = TDMCreate::getInstance();
$this->table = TDMCreateTables::getInstance();
parent::__construct($db, 'mod_tdmcreate_fields', 'tdmcreatefields', 'field_id', 'field_tid');
}
@@ -323,6 +321,98 @@
return parent::get($id);
}
+ /**
+ * insert a new field in the database
+ *
+ * @param object $field reference to the {@link TDMCreateFields} object
+ * @param bool $force
+ *
+ * @return bool FALSE if failed, TRUE if already present and unchanged or successful
+ */
+ public function insert(&$field, $force = false)
+ {
+ if (!parent::insert($field, $force)) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * delete fields matching a set of conditions
+ *
+ * @param object $criteria {@link CriteriaElement}
+ *
+ * @return bool FALSE if deletion failed
+ */
+ public function deleteAll($criteria = null)
+ {
+ //todo resource consuming, use get list instead?
+ $fields = $this->getObjects($criteria);
+ foreach ($fields as $field) {
+ $this->delete($field);
+ }
+ return true;
+ }
+
+ /**
+ * @param $field_tid
+ *
+ * @return bool
+ */
+ public function updateAll($field_tid)
+ {
+ $criteria = new Criteria('field_tid', $field_tid);
+ if ($this->updateAll($criteria)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * get all the fields that match the supplied parameters
+ *
+ * @param $side
+ * @param $tableid tableid (can be an array)
+ * @param $orderby order of the fields
+ * @returns array of field objects
+ */
+ public function getAllFieldsByTable($table_mid, $asobject = true, $side = null, $orderby = "f.field_mid, f.field_tid")
+ {
+ $ret = array();
+ if (!$asobject) {
+ $sql = 'SELECT f.field_mid, f.field_tid ';
+ } else {
+ $sql = 'SELECT f.* ';
+ }
+ $sql .= "FROM " . $this->db->prefix("mod_tdmcreaterate_fields") . " f LEFT JOIN " . $this->db->prefix("mod_tdmcreaterate_tables") . " t ON f.field_tid=t.table_id WHERE table_mid = ".$table_mid;
+ if (is_array($tableid)) {
+ $sql .= " AND (t.table_id=" . $tableid[0] . "";
+ $sql .= ")";
+ } else {
+ $sql .= " AND t.table_id=" . $tableid . "";
+ }
+ if (isset($side)) {
+ // get both sides in sidebox? (some themes need this)
+ $side = "f.field_side=" . $side;
+ $sql .= " AND " . $side;
+ }
+ $sql .= " ORDER BY $orderby";
+ $result = $this->db->query($sql);
+ $added = array();
+ while ($myrow = $this->db->fetchArray($result)) {
+ if (!in_array($myrow['field_id'], $added)) {
+ if (!$asobject) {
+ $ret[] = $myrow['field_id'];
+ } else {
+ $ret[] = new TDMCreateFields($myrow);
+ }
+ array_push($added, $myrow['field_id']);
+ }
+ }
+ return $ret;
+ }
+
/*
* @public function getFieldModuleId
* @param integer $field_id
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-04-30 14:03:37 UTC (rev 12516)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-05-01 16:22:45 UTC (rev 12517)
@@ -75,7 +75,7 @@
$this->initVar('mod_comments',XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('active_comments'));
$this->initVar('mod_notifications', XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('active_notifications'));
$this->initVar('mod_permissions', XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('active_permissions'));
- $this->initVar('mod_install', XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('inroot_install'));
+ $this->initVar('mod_inroot_copy', XOBJ_DTYPE_INT, $this->tdmcreate->getConfig('inroot_copy'));
$this->initVar('mod_donations', XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('donations'));
$this->initVar('mod_subversion', XOBJ_DTYPE_TXTBOX, $this->tdmcreate->getConfig('subversion'));
}
@@ -139,28 +139,28 @@
$editor_configs['cols'] = 100;
$editor_configs['width'] = '50%';
$editor_configs['height'] = '100px';
- $editor_configs['editor'] = $GLOBALS['xoopsModuleConfig']['tdmcreate_editor'];
+ $editor_configs['editor'] = $this->tdmcreate->getConfig('tdmcreate_editor');
$form->addElement( new XoopsFormEditor(_AM_TDMCREATE_MODULE_DESCRIPTION, 'mod_description', $editor_configs), true);
// Author
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, 'mod_author', 50, 255, $this->getVar('mod_author')), true);
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, 'mod_license', 50, 255, $this->getVar('mod_license')), true);
- $mod_admin = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['display_admin'] : $this->getVar('mod_admin');
+ $mod_admin = $this->isNew() ? $this->tdmcreate->getConfig('display_admin') : $this->getVar('mod_admin');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_ADMIN, 'mod_admin', $mod_admin, _YES, _NO));
- $mod_user = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['display_user'] : $this->getVar('mod_user');
+ $mod_user = $this->isNew() ? $this->tdmcreate->getConfig('display_user') : $this->getVar('mod_user');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_USER, 'mod_user', $mod_user, _YES, _NO));
- $mod_search = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_search'] : $this->getVar('mod_search');
+ $mod_search = $this->isNew() ? $this->tdmcreate->getConfig('active_search') : $this->getVar('mod_search');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_SEARCH, 'mod_search', $mod_search, _YES, _NO));
- $mod_comments = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_comments'] : $this->getVar('mod_comments');
+ $mod_comments = $this->isNew() ? $this->tdmcreate->getConfig('active_comments') : $this->getVar('mod_comments');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_COMMENTS, 'mod_comments', $mod_comments, _YES, _NO));
- $mod_notifications = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_notifications'] : $this->getVar('mod_notifications');
+ $mod_notifications = $this->isNew() ? $this->tdmcreate->getConfig('active_notifications') : $this->getVar('mod_notifications');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_NOTIFICATIONS, 'mod_notifications', $mod_notifications, _YES, _NO));
- $mod_permissions = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_permissions'] : $this->getVar('mod_permissions');
+ $mod_permissions = $this->isNew() ? $this->tdmcreate->getConfig('act...
[truncated message content] |
|
From: <txm...@us...> - 2014-05-03 14:15:02
|
Revision: 12519
http://sourceforge.net/p/xoops/svn/12519
Author: txmodxoops
Date: 2014-05-03 14:14:55 +0000 (Sat, 03 May 2014)
Log Message:
-----------
Fix bug in building.php
Merged extension .html to .tpl in templates files
Toggle in list for parameters of fields
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/modules.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tables.tpl
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-02 03:24:32 UTC (rev 12518)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-03 14:14:55 UTC (rev 12519)
@@ -31,7 +31,7 @@
$to_dir = XOOPS_ROOT_PATH.'/modules/'.strtolower($mod_name);
switch ($op) {
case 'build':
- $template_main = 'tdmcreate_building.html';
+ $template_main = 'building.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
// Clear repertory of new module if there are
TDMCreate_clearDir($from_dir);
@@ -61,7 +61,7 @@
case 'default':
default:
- $template_main = 'tdmcreate_building.html';
+ $template_main = 'building.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
// Redirect if there aren't modules
$nb_modules = $modulesHandler->getCount();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-02 03:24:32 UTC (rev 12518)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-03 14:14:55 UTC (rev 12519)
@@ -16,7 +16,7 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: fields.php 12258 2014-01-02 09:33:29Z timgno $
+ * @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $
*/
include 'header.php';
// Recovered value of arguments op in the URL $
@@ -88,19 +88,14 @@
{
foreach (array_keys($tables_arr) as $t)
{
- $table['id'] = $t;
- $table['mid'] = $tables_arr[$t]->getVar('table_mid');
+ $table['id'] = $t;
$table['name'] = ucfirst($tables_arr[$t]->getVar('table_name'));
$table['image'] = $tables_arr[$t]->getVar('table_image');
$table['nbfields'] = $tables_arr[$t]->getVar('table_nbfields');
$table['blocks'] = $tables_arr[$t]->getVar('table_blocks');
$table['admin'] = $tables_arr[$t]->getVar('table_admin');
- $table['user'] = $tables_arr[$t]->getVar('table_user');
- $table['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');
+ $table['user'] = $tables_arr[$t]->getVar('table_user');
+ $table['search'] = $tables_arr[$t]->getVar('table_search');
// Get the list of tables
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('field_mid', $table_mid));
@@ -112,18 +107,29 @@
unset($criteria);
// Display tables list
$fields = array();
+ $lid = 1;
if ( $nb_fields > 0 )
{
foreach (array_keys($fields_arr) as $f)
{
$field['id'] = $f;
- $field['mid'] = $fields_arr[$f]->getVar('field_mid');
- $field['tid'] = $fields_arr[$f]->getVar('field_tid');
- $field['name'] = str_replace('_', ' ', ucfirst($fields_arr[$f]->getVar('field_name')));
+ $field['lid'] = $lid;
+ $field['name'] = str_replace('_', ' ', ucfirst($fields_arr[$f]->getVar('field_name')));
+ $field['parent'] = $fields_arr[$f]->getVar('field_parent');
+ $field['inlist'] = $fields_arr[$f]->getVar('field_inlist');
+ $field['inform'] = $fields_arr[$f]->getVar('field_inform');
+ $field['admin'] = $fields_arr[$f]->getVar('field_admin');
+ $field['user'] = $fields_arr[$f]->getVar('field_user');
+ $field['block'] = $fields_arr[$f]->getVar('field_block');
+ $field['main'] = $fields_arr[$f]->getVar('field_main');
+ $field['search'] = $fields_arr[$f]->getVar('field_search');
+ $field['required'] = $fields_arr[$f]->getVar('field_required');
$fields[] = $field;
- unset($field);
+ unset($field);
+ $lid++;
}
}
+ unset($lid);
$table['fields'] = $fields;
$GLOBALS['xoopsTpl']->append('tables_list', $table);
unset($table);
@@ -210,55 +216,60 @@
$adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $obj = $fieldsHandler->get($field_id);
+ $obj = $fieldsHandler->get($field_tid);
$form = $obj->getForm($field_mid, $field_tid, $field_numb);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'toggle':
- if (isset($_GET['table_id'])) {
- if (isset($_GET['table_blocks'])) {
- $tbl_blocks = intval($_GET['table_blocks']);
- $table_blocks = ($tbl_blocks == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
- $obj->setVar('table_blocks', $table_blocks);
- } elseif (isset($_GET['table_admin'])) {
- $tbl_admin = intval($_GET['table_admin']);
- $table_admin = ($tbl_admin == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
- $obj->setVar('table_admin', $table_admin);
- } elseif (isset($_GET['table_user'])) {
- $tbl_user = intval($_GET['table_user']);
- $table_user = ($tbl_user == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
- $obj->setVar('table_user', $table_user);
- } elseif (isset($_GET['table_submenu'])) {
- $tbl_submenu = intval($_GET['table_submenu']);
- $table_submenu = ($tbl_submenu == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
- $obj->setVar('table_submenu', $table_submenu);
- } elseif (isset($_GET['table_search'])) {
- $tbl_search = intval($_GET['table_search']);
- $table_search = ($tbl_search == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
- $obj->setVar('table_search', $table_search);
- } elseif (isset($_GET['table_comments'])) {
- $tbl_comments = intval($_GET['table_comments']);
- $table_comments = ($tbl_comments == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
- $obj->setVar('table_comments', $table_comments);
- } elseif (isset($_GET['table_notifications'])) {
- $tbl_notifications = intval($_GET['table_notifications']);
- $table_notifications = ($tbl_notifications == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
- $obj->setVar('table_notifications', $table_notifications);
- } elseif (isset($_GET['table_permissions'])) {
- $tbl_permissions = intval($_GET['table_permissions']);
- $table_permissions = ($tbl_permissions == 1) ? 0 : 1;
- $obj =& $tablesHandler->get($table_id);
- $obj->setVar('table_permissions', $table_permissions);
+ if (isset($_GET['field_tid'])) {
+ if (isset($_GET['field_parent'])) {
+ $fld_parent = intval($_GET['field_parent']);
+ $field_parent = ($fld_parent == 1) ? 0 : 1;
+ $obj =& $fieldsHandler->get($field_id);
+ $obj->setVar('field_parent', $field_parent);
+ } elseif (isset($_GET['field_inlist'])) {
+ $fld_inlist = intval($_GET['field_inlist']);
+ $field_inlist = ($fld_inlist == 1) ? 0 : 1;
+ $obj =& $fieldsHandler->get($field_id);
+ $obj->setVar('field_inlist', $field_inlist);
+ } elseif (isset($_GET['field_inform'])) {
+ $fld_inform = intval($_GET['field_inform']);
+ $field_inform = ($fld_inform == 1) ? 0 : 1;
+ $obj =& $fieldsHandler->get($field_id);
+ $obj->setVar('field_inform', $field_inform);
+ } elseif (isset($_GET['field_admin'])) {
+ $fld_admin = intval($_GET['field_admin']);
+ $field_admin = ($fld_admin == 1) ? 0 : 1;
+ $obj =& $fieldsHandler->get($field_id);
+ $obj->setVar('field_admin', $field_admin);
+ } elseif (isset($_GET['field_user'])) {
+ $fld_user = intval($_GET['field_user']);
+ $field_user = ($fld_user == 1) ? 0 : 1;
+ $obj =& $fieldsHandler->get($field_id);
+ $obj->setVar('field_user', $field_user);
+ } elseif (isset($_GET['field_block'])) {
+ $fld_block = intval($_GET['field_block']);
+ $field_block = ($fld_block == 1) ? 0 : 1;
+ $obj =& $fieldsHandler->get($field_id);
+ $obj->setVar('field_block', $field_block);
+ } elseif (isset($_GET['field_main'])) {
+ $fld_main = intval($_GET['field_main']);
+ $field_main = ($fld_main == 1) ? 0 : 1;
+ $obj =& $fieldsHandler->get($field_id);
+ $obj->setVar('field_main', $field_main);
+ } elseif (isset($_GET['field_search'])) {
+ $fld_search = intval($_GET['field_search']);
+ $field_search = ($fld_search == 1) ? 0 : 1;
+ $obj =& $fieldsHandler->get($field_id);
+ $obj->setVar('field_search', $field_search);
+ } elseif (isset($_GET['field_required'])) {
+ $fld_required = intval($_GET['field_required']);
+ $field_required = ($fld_required == 1) ? 0 : 1;
+ $obj =& $fieldsHandler->get($field_id);
+ $obj->setVar('field_required', $field_required);
}
- if ($tablesHandler->insert($obj, true)) {
+ if ($fieldsHandler->insert($obj, true)) {
redirect_header('fields.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
} else {
redirect_header('fields.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-05-02 03:24:32 UTC (rev 12518)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-05-03 14:14:55 UTC (rev 12519)
@@ -97,11 +97,13 @@
unset($criteria);
// Display tables list
$tables = array();
+ $lid = 1;
if ( $nb_tables > 0 )
{
foreach (array_keys($tables_arr) as $t)
{
$table['id'] = $t;
+ $table['lid'] = $lid;
$table['mid'] = $tables_arr[$t]->getVar('table_mid');
$table['name'] = $tables_arr[$t]->getVar('table_name');
$table['image'] = $tables_arr[$t]->getVar('table_image');
@@ -116,8 +118,10 @@
$table['permissions'] = $tables_arr[$t]->getVar('table_permissions');
$tables[] = $table;
unset($table);
+ $lid++;
}
}
+ unset($lid);
$mod['tables'] = $tables;
$GLOBALS['xoopsTpl']->append('modules_list', $mod);
unset($mod);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-02 03:24:32 UTC (rev 12518)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-03 14:14:55 UTC (rev 12519)
@@ -200,6 +200,11 @@
}
$parameters_tray->addElement($field_elements_select);
+ $field_parent = $this->isNew() ? ( $i == 1 ) : $this->getVar('field_parent');
+ $check_field_parent = new XoopsFormCheckBox(' ', 'field_parent', $field_parent);
+ $check_field_parent->addOption(1, _AM_TDMCREATE_FIELD_PARENT );
+ $parameters_tray->addElement($check_field_parent);
+
$field_inlist = $this->isNew() ? 0 : $this->getVar('field_inlist');
$check_field_inlist = new XoopsFormCheckBox(' ', 'field_inlist['.$i.']', $field_inlist);
$check_field_inlist->addOption(1, _AM_TDMCREATE_FIELD_INLIST);
@@ -225,10 +230,10 @@
$check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
$parameters_tray->addElement($check_field_block);
- $field_mnfield = $this->isNew() ? ( $i == 1 ) : $this->getVar('field_main');
- $field_main = new XoopsFormRadio('', 'field_main', $field_mnfield);
- $field_main->addOption( '', _AM_TDMCREATE_FIELD_MAINFIELD );
- $parameters_tray->addElement($field_main);
+ $field_main = $this->isNew() ? ( $i == 1 ) : $this->getVar('field_main');
+ $check_field_main = new XoopsFormRadio('', 'field_main', $field_main);
+ $check_field_main->addOption('', _AM_TDMCREATE_FIELD_MAINFIELD );
+ $parameters_tray->addElement($check_field_main);
$field_search = $this->isNew() ? 0 : $this->getVar('field_search');
$check_field_search = new XoopsFormCheckBox(' ', 'field_search['.$i.']', $field_search);
@@ -312,13 +317,20 @@
/**
* retrieve a field
*
- * @param int $id field_id
+ * @param int $id tid
*
* @return mixed reference to the {@link TDMCreateFields} object
*/
public function &get($id)
- {
- return parent::get($id);
+ {
+ $criteria = new Criteria('field_id', $id );
+ if ($this->getCount($criteria) > 0) {
+ $obj = $this->getObjects($criteria, false, false );
+ return $obj[0]['field_id'];
+ } else {
+ return parent::get($tid);
+ }
+ return false;
}
/**
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin/style.css
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin/style.css 2014-05-02 03:24:32 UTC (rev 12518)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin/style.css 2014-05-03 14:14:55 UTC (rev 12519)
@@ -24,6 +24,7 @@
padding: 5px;
border-bottom: 1px solid #ccc;
background-color:rgba(200,110,20,0.3);
+ vertical-align: middle;
}
tr.tables td {
@@ -32,6 +33,7 @@
padding: 5px;
border-bottom: 1px solid #ccc;
background-color:rgba(230,130,100,0.3);
+ vertical-align: middle;
}
tr.fields td {
@@ -40,6 +42,7 @@
padding: 5px;
border-bottom: 1px solid #ccc;
background-color:rgba(0,255,0,0.3);
+ vertical-align: middle;
}
.toggleChild {
@@ -51,6 +54,22 @@
height: 16px;
}
+.even {
+ border-bottom: 1px solid #ccc;
+ background-color: #cdcdcd;
+ color: inherit;
+ padding: 5px;
+ vertical-align: middle;
+}
+
+.odd {
+ border-bottom: 1px solid #ccc;
+ background-color: #dcdcdc;
+ color: inherit;
+ padding: 5px;
+ vertical-align: middle;
+}
+
.move { cursor: move; }
.width6{ width: 6%; }
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-05-02 03:24:32 UTC (rev 12518)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-05-03 14:14:55 UTC (rev 12519)
@@ -184,6 +184,20 @@
define('_AM_TDMCREATE_FIELD_REQUIRED', "Field: Required");
define('_AM_TDMCREATE_ADMIN_SUBMIT', "Send");
+define('_AM_TDMCREATE_ID_LIST', "Id");
+define('_AM_TDMCREATE_NAME_LIST', "Name");
+define('_AM_TDMCREATE_IMAGE_LIST', "Image");
+define('_AM_TDMCREATE_NBFIELDS_LIST', "Fields");
+define('_AM_TDMCREATE_PARENT_LIST', "Parent");
+define('_AM_TDMCREATE_INLIST_LIST', "Inlist");
+define('_AM_TDMCREATE_INFORM_LIST', "Inform");
+define('_AM_TDMCREATE_ADMIN_LIST', "Admin");
+define('_AM_TDMCREATE_USER_LIST', "User");
+define('_AM_TDMCREATE_BLOCK_LIST', "Block");
+define('_AM_TDMCREATE_MAIN_LIST', "Main");
+define('_AM_TDMCREATE_SEARCH_LIST', "Search");
+define('_AM_TDMCREATE_REQUIRED_LIST', "Required");
+
//Modules.php
//Form
define('_AM_TDMCREATE_MODULES_ADD', "Add a new module");
@@ -334,6 +348,7 @@
define('_AM_TDMCREATE_TOGGLE_SUCCESS', "Successfully Changed Display");
define('_AM_TDMCREATE_TOGGLE_FAILED', "Changing Display Failed");
define('_AM_TDMCREATE_ERROR_TABLE_NAME_EXIST', "<b class='red big'>WARNING</b>: The table <b class='big red'>%s</b> exists for this module, create a new one with a different name");
+define('_AM_TDMCREATE_FIELD_PARENT', "Field: Is parent");
define('_AM_TDMCREATE_FIELD_INLIST', "Admin: Visible in list");
define('_AM_TDMCREATE_FIELD_INFORM', "Admin: Visible in form");
define('_AM_TDMCREATE_TABLE_MODSELOPT', "Select a Module");
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl 2014-05-02 03:24:32 UTC (rev 12518)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl 2014-05-03 14:14:55 UTC (rev 12519)
@@ -5,70 +5,40 @@
<table id='show_rows' width='100%' cellspacing='1' class='outer'>
<thead>
<tr>
- <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_ID}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_NAME_LIST}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_IMAGE_LIST}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_NBFIELDS_LIST}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_BLOCKS_LIST}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_ADMIN_LIST}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_USER_LIST}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_SUBMENU_LIST}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_SEARCH_LIST}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_COMMENTS_LIST}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_NOTIFICATIONS_LIST}></th>
- <th class='center'><{$smarty.const._AM_TDMCREATE_TABLE_PERMISSIONS_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_ID_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_NAME_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_IMAGE_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_NBFIELDS_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_PARENT_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_INLIST_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_INFORM_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_ADMIN_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_USER_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_BLOCK_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_MAIN_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_SEARCH_LIST}></th>
+ <th class='center'><{$smarty.const._AM_TDMCREATE_REQUIRED_LIST}></th>
<th class='center width6'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th>
</tr>
</thead>
<tbody>
<{foreach item=table from=$tables_list}>
<tr id="table<{$table.id}>" class="fields toggleMain">
- <td class='center'><{$table.id}><br />
+ <td class='center bold width5'>(<{$table.id}>)
<a href="#" title="Toggle"><img class="imageToggle" src="<{$tdmc_icons_url}>/16/toggle.png" alt="Toggle" /></a>
</td>
- <td class='center'><u><{$table.name}></u></td>
+ <td class='center'><u class='bold'><{$table.name}></u></td>
<td class='center'><img src="<{$pathIcon32}>/<{$table.image}>" alt="<{$table.name}>" height="30" /></td>
- <td class='center'><{$table.nbfields}></td>
- <td class='center'>
- <a href="fields.php?op=toggle&table_blocks=<{$table.blocks}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
- <img src="<{xoModuleIcons16}><{$table.blocks}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
- </a>
- </td>
- <td class='center'>
- <a href="fields.php?op=toggle&table_admin=<{$table.admin}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
- <img src="<{xoModuleIcons16}><{$table.admin}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
- </a>
- </td>
- <td class='center'>
- <a href="fields.php?op=toggle&table_user=<{$table.user}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
- <img src="<{xoModuleIcons16}><{$table.user}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
- </a>
- </td>
- <td class='center'>
- <a href="fields.php?op=toggle&table_submenu=<{$table.submenu}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
- <img src="<{xoModuleIcons16}><{$table.submenu}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
- </a>
- </td>
- <td class='center'>
- <a href="fields.php?op=toggle&table_search=<{$table.search}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
- <img src="<{xoModuleIcons16}><{$table.search}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
- </a>
- </td>
- <td class='center'>
- <a href="fields.php?op=toggle&table_comments=<{$table.comments}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
- <img src="<{xoModuleIcons16}><{$table.comments}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
- </a>
- </td>
- <td class='center'>
- <a href="fields.php?op=toggle&table_notifications=<{$table.notifications}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
- <img src="<{xoModuleIcons16}><{$table.notifications}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
- </a>
- </td>
- <td class='center'>
- <a href="fields.php?op=toggle&table_permissions=<{$table.permissions}>&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
- <img src="<{xoModuleIcons16}><{$table.permissions}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
- </a>
- </td>
+ <td class='center bold'><{$table.nbfields}></td>
+ <td class='center'><img src="<{$tdmc_icons_url}>/16/nb_fields.png" /></td>
+ <td class='center'><img src="<{$tdmc_icons_url}>/16/nb_fields.png" /></td>
+ <td class='center'><img src="<{$tdmc_icons_url}>/16/nb_fields.png" /></td>
+ <td class='center'><img src="<{$tdmc_icons_url}>/16/nb_fields.png" /></td>
+ <td class='center'><img src="<{$tdmc_icons_url}>/16/nb_fields.png" /></td>
+ <td class='center'><img src="<{$tdmc_icons_url}>/16/nb_fields.png" /></td>
+ <td class='center'><img src="<{$tdmc_icons_url}>/16/nb_fields.png" /></td>
+ <td class='center'><img src="<{$tdmc_icons_url}>/16/nb_fields.png" /></td>
+ <td class='center'><img src="<{$tdmc_icons_url}>/16/nb_fields.png" /></td>
<td class='xo-actions txtcenter width6'>
<a href="tables.php?op=edit&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_EDIT_TABLE}>">
<img src="<{xoModuleIcons16 edit.png}>" alt="<{$smarty.const._AM_TDMCREATE_EDIT_TABLE}>" />
@@ -83,9 +53,56 @@
</tr>
<{foreach item=field from=$table.fields}>
<tr class="<{cycle values='even,odd'}> toggleChild">
- <td class='center'><{$field.id}> <img class="move" src="<{$tdmc_icons_url}>/16/drag.png" alt="<{$field.name}>" /></td>
+ <td class='center'><{$field.lid}> <img class="move" src="<{$tdmc_icons_url}>/16/drag.png" alt="<{$field.name}>" /></td>
<td class='center'><{$field.name}></td>
- <td class='center' colspan="11"> </td>
+ <td class='center'><img src="<{$tdmc_icons_url}>/16/tables.png" alt="Empty" /></td>
+ <td class='center'><img src="<{$tdmc_icons_url}>/16/tables.png" alt="Empty" /></td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&field_parent=<{$field.parent}>&field_id=<{$field.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$field.parent}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&field_inlist=<{$field.inlist}>&field_id=<{$field.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$field.inlist}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&field_inform=<{$field.inform}>&field_id=<{$field.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$field.inform}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&field_admin=<{$field.admin}>&field_id=<{$field.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$field.admin}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&field_user=<{$field.user}>&field_id=<{$field.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$field.user}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&field_block=<{$field.block}>&field_id=<{$field.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$field.block}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&field_main=<{$field.main}>&field_id=<{$field.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$field.main}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&field_search=<{$field.search}>&field_id=<{$field.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$field.search}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'>
+ <a href="fields.php?op=toggle&field_required=<{$field.required}>&field_id=<{$field.id}>" title="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>">
+ <img src="<{xoModuleIcons16}><{$field.required}>.png" alt="<{$smarty.const._AM_TDMCREATE_TOGGLE_CHANGE_DISPLAY}>" />
+ </a>
+ </td>
+ <td class='center'><img src="<{$tdmc_icons_url}>/16/left_right.png" alt="Empty" /></td>
</tr>
<{/foreach}>
<{/foreach}>
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/modules.tpl
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/modules.tpl 2014-05-02 03:24:32 UTC (rev 12518...
[truncated message content] |
|
From: <txm...@us...> - 2014-05-08 12:08:58
|
Revision: 12521
http://sourceforge.net/p/xoops/svn/12521
Author: txmodxoops
Date: 2014-05-08 12:08:54 +0000 (Thu, 08 May 2014)
Log Message:
-----------
Updated - Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/css/admin/style.css
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/fields.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/modules.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tables.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/html/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/html/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/html/simplelabel.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/simplelabel.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-05 12:45:22 UTC (rev 12520)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-08 12:08:54 UTC (rev 12521)
@@ -20,18 +20,14 @@
*/
include 'header.php';
// Recovered value of arguments op in the URL $
-//$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
-//$tdmcreate = TDMCreate::getInstance();
$op = TDMCreateRequest::getString('op', 'list');
// Get table Variables
$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id');
$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid');
$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields');
-$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');
/*$table_id = TDMCreateRequest::getInt('table_id');
$table_mid = TDMCreateRequest::getInt('table_mid');
-$table_nbfields = TDMCreateRequest::getInt('table_nbfields');
-$table_fieldname = TDMCreateRequest::getString('table_fieldname', '');*/
+$table_nbfields = TDMCreateRequest::getInt('table_nbfields');*/
// Get field Variables
$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id');
$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
@@ -48,21 +44,20 @@
{
case 'list':
default:
- //$limit = $GLOBALS['xoopsModuleConfig']['fields_adminpager'];
- //$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
$start = TDMCreateRequest::getInt('start', 0);
$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('fields_adminpager'));
// Define main template
$template_main = 'fields.tpl';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/fields.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());
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
- $GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
+ $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
// Redirect if there aren't modules
$nb_modules = $modulesHandler->getCount();
if ( $nb_modules == 0 ) {
@@ -170,8 +165,7 @@
}
//
if ($field_numb > 0) {
- for( $i = 1; $i <= $field_numb; $i++ ) {
-
+ for( $i = 1; $i <= $field_numb; $i++ ) {
$obj->setVar( 'field_mid', $field_mid );
$obj->setVar( 'field_tid', $field_tid );
$obj->setVar( 'field_numb', $field_numb );
@@ -183,6 +177,7 @@
$obj->setVar( 'field_default', (isset($_POST['field_default'][$i]) ? $_POST['field_default'][$i] : '') );
$obj->setVar( 'field_key', (isset($_POST['field_key'][$i]) ? $_POST['field_key'][$i] : '') );
$obj->setVar( 'field_element', (isset($_POST['field_element'][$i]) ? $_POST['field_element'][$i] : '') );
+ $obj->setVar( 'field_parent', (($i == isset($_REQUEST['field_parent'])) ? '1' : '0') );
$obj->setVar( 'field_inlist', ((isset($_REQUEST['field_inlist'][$i]) == 1) ? '1' : '0') );
$obj->setVar( 'field_inform', ((isset($_REQUEST['field_inform'][$i]) == 1) ? '1' : '0') );
$obj->setVar( 'field_admin', ((isset($_REQUEST['field_admin'][$i]) == 1) ? '1' : '0') );
@@ -191,7 +186,7 @@
$obj->setVar( 'field_main', (($i == isset($_REQUEST['field_main'])) ? '1' : '0') );
$obj->setVar( 'field_search', ((isset($_REQUEST['field_search'][$i]) == 1) ? '1' : '0') );
$obj->setVar( 'field_required', ((isset($_REQUEST['field_required'][$i]) == 1) ? '1' : '0') );
-
+ // Insert Data
$fieldsHandler->insert($obj);
}
}
@@ -209,17 +204,46 @@
case 'edit':
// Define main template
- $template_main = 'tables.tpl';
+ $template_main = 'fields.tpl';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
$adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $obj = $fieldsHandler->get($field_tid);
+ $obj = $fieldsHandler->get( $field_id );
$form = $obj->getForm($field_mid, $field_tid, $field_numb);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
- break;
+ break;
+
+ case 'drag':
+ $side = TDMCreate_CleanVars( $_POST, 'field_id', 0, 'int' );
+ if ( $block_id > 0 ) {
+ $fieldsObj = $fieldsHandler->get( $field_id );
+ $fieldsObj->setVar('field_id', $side);
+ if (!$fieldsHandler->insert( $fieldsObj )) {
+ redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_SIDE_ERROR);
+ }
+ }
+ break;
+
+ case 'order':
+ if ( isset($_POST['field_id'] ) ) {
+ $i = 0;
+ foreach($_POST['field_id'] as $order) {
+ if( $order > 0 ) {
+ $fieldsObj = $fieldsHandler->get( $order );
+ $fieldsObj->setVar('field_id', $i);
+ if (!$fieldsHandler->insert( $fieldsObj )) {
+ redirect_header('fields.php', 5, _AM_TDMCREATE_FIELD_ORDER_ERROR);
+ }
+ $i++;
+ }
+ }
+ unset($i);
+ }
+ exit;
+ break;
case 'toggle':
if (isset($_GET['field_tid'])) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-05-05 12:45:22 UTC (rev 12520)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-05-08 12:08:54 UTC (rev 12521)
@@ -24,13 +24,15 @@
//include_once 'includes.php';
//
$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
-//
-$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
-$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
+// Link System Icons
+$sysPathIcon16 = '../' . $xoopsModule->getInfo('sysicons16');
+$sysPathIcon32 = '../' . $xoopsModule->getInfo('sysicons32');
+// Link Local Icons
+$modPathIcon16 = $xoopsModule->getInfo('modicons16');
+$modPathIcon32 = $xoopsModule->getInfo('modicons32');
$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
-
+// TDMCreate Instance
$tdmcreate = TDMCreate::getInstance();
-
// Get class handler
$modulesHandler =& $tdmcreate->getHandler('modules');
$tablesHandler =& $tdmcreate->getHandler('tables');
@@ -46,10 +48,13 @@
include_once(XOOPS_ROOT_PATH."/class/template.php");
$xoopsTpl = new XoopsTpl();
}
-//
-$GLOBALS['xoopsTpl']->assign('pathIcon16', $pathIcon16);
-$GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
-//Load languages
+// System Icons
+$GLOBALS['xoopsTpl']->assign('sysPathIcon16', $sysPathIcon16);
+$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
+// Local Icons
+$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
+$GLOBALS['xoopsTpl']->assign('modPathIcon32', $modPathIcon32);
+// Load languages
xoops_loadLanguage('admin', $thisDirname);
xoops_loadLanguage('modinfo', $thisDirname);
xoops_loadLanguage('main', $thisDirname);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php 2014-05-05 12:45:22 UTC (rev 12520)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/menu.php 2014-05-08 12:08:54 UTC (rev 12521)
@@ -21,12 +21,12 @@
$module_handler =& xoops_gethandler('module');
$xoopsModule =& XoopsModule::getByDirname('TDMCreate');
$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid'));
-$pathIcon32 = $moduleInfo->getInfo('icons32');
+$sysPathIcon32 = $moduleInfo->getInfo('sysicons32');
$adminmenu = array();
$i = 1;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU1;
$adminmenu[$i]['link'] = 'admin/index.php';
-$adminmenu[$i]['icon'] = $pathIcon32.'/home.png';
+$adminmenu[$i]['icon'] = $sysPathIcon32.'/home.png';
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU2;
$adminmenu[$i]['link'] = 'admin/modules.php';
@@ -46,5 +46,5 @@
$i++;
$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU6;
$adminmenu[$i]['link'] = 'admin/about.php';
-$adminmenu[$i]['icon'] = $pathIcon32.'/about.png';
+$adminmenu[$i]['icon'] = $sysPathIcon32.'/about.png';
unset($i);
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-05-05 12:45:22 UTC (rev 12520)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-05-08 12:08:54 UTC (rev 12521)
@@ -20,9 +20,6 @@
*/
include 'header.php';
// Recovered value of argument op in the URL $
-//$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
-//$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id');
-$tdmcreate = TDMCreate::getInstance();
$op = TDMCreateRequest::getString('op', 'list');
//
$mod_id = TDMCreateRequest::getInt('mod_id');
@@ -30,9 +27,7 @@
switch ($op)
{
case 'list':
- default:
- //$limit = $GLOBALS['xoopsModuleConfig']['modules_adminpager'];
- //$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
+ default:
$start = TDMCreateRequest::getInt('start', 0);
$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
// Define main template
@@ -46,7 +41,7 @@
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
$criteria->setOrder('ASC');
- $nb_modules = $modulesHandler->getCount();
+ $nb_modules = $modulesHandler->getCount( $criteria );
$mods_arr = $modulesHandler->getAll( $criteria );
unset($criteria);
// Redirect if there aren't modules
@@ -54,10 +49,8 @@
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
}
// Display modules list
- if ($nb_modules > 0)
- {
- foreach (array_keys($mods_arr) as $i)
- {
+ 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');
@@ -130,7 +123,7 @@
$tdmcreate->getConfig('maxsize'), null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
$extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']);
- $name_img = $_GET['mod_name'].'_slogo.'.$extension;
+ $name_img = strtolower($_POST['mod_name']).'_slogo.'.$extension;
$uploader->setPrefix($name_img);
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
@@ -152,8 +145,7 @@
'mod_release' => $_POST['mod_release'],
'mod_status' => $_POST['mod_status'],
'mod_admin' => (($_REQUEST['mod_admin'] == 1) ? '1' : '0'),
- 'mod_user' => (($_REQUEST['mod_user'] == 1) ? '1' : '0'),
- 'mod_submenu' => (($_REQUEST['mod_submenu'] == 1) ? '1' : '0'),
+ 'mod_user' => (($_REQUEST['mod_user'] == 1) ? '1' : '0'),
'mod_search' => (($_REQUEST['mod_search'] == 1) ? '1' : '0'),
'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'),
'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0'),
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-05-05 12:45:22 UTC (rev 12520)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-05-08 12:08:54 UTC (rev 12521)
@@ -20,16 +20,8 @@
*/
include 'header.php';
// Recovered value of arguments op in the URL $
-//$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
-//$tdmcreate = TDMCreate::getInstance();
$op = TDMCreateRequest::getString('op', 'list');
//
-/*$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id');
-$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id');
-$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid');
-$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields');
-$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');*/
-//
$mod_id = TDMCreateRequest::getInt('mod_id');
//
$table_id = TDMCreateRequest::getInt('table_id');
@@ -41,8 +33,6 @@
{
case 'list':
default:
- //$limit = $GLOBALS['xoopsModuleConfig']['tables_adminpager'];
- //$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
$start = TDMCreateRequest::getInt('start', 0);
$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('tables_adminpager'));
// Define main template
@@ -56,7 +46,8 @@
$GLOBALS['xoopsTpl']->assign('tdmc_icons_url', TDMC_ICONS_URL);
$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
//$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgtab_url', TDMC_UPLOAD_IMGTAB_URL);
- $GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
+ $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
+ $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
// Get the list of modules
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
@@ -69,6 +60,7 @@
$mods_arr = $modulesHandler->getAll($criteria);
unset($criteria);
$nb_tables = $tablesHandler->getObjects(null);
+ // Redirect if there aren't tables
if ($nb_tables == 0) {
redirect_header('tables.php?op=new', 2, _AM_TDMCREATE_NOTTABLES );
}
@@ -163,7 +155,7 @@
{
if( ($table_name_search[$t]->getVar('table_name') === $_POST['table_name']) &&
($table_name_search[$t]->getVar('table_mid') === $table_mid)) {
- redirect_header('tables.php?op=new', 8, sprintf(_AM_TDMCREATE_ERROR_TABLE_NAME_EXIST, $_POST['table_name']));
+ redirect_header('tables.php?op=new', 10, sprintf(_AM_TDMCREATE_ERROR_TABLE_NAME_EXIST, $_POST['table_name']));
}
}
// Form save tables
@@ -174,11 +166,7 @@
'table_fieldname' => $table_fieldname));
//Form table_image
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
- if(is_dir($pathIcon32)){
- $uploaddir = $pathIcon32;
- }else{
- $uploaddir = TDMC_UPLOAD_PATH.'/images/tables';
- }
+ $uploaddir = is_dir($sysPathIcon32) ? $sysPathIcon32 : TDMC_UPLOAD_IMGTAB_PATH;
$uploader = new XoopsMediaUploader($uploaddir, $tdmcreate->getConfig('mimetypes'),
$tdmcreate->getConfig('maxsize'), null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-05 12:45:22 UTC (rev 12520)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-08 12:08:54 UTC (rev 12521)
@@ -19,7 +19,7 @@
* @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-require_once 'simplelabel.php';
+require_once 'html/simplelabel.php';
require_once 'form/themeform.php';
/*
* @Class TDMCreateFields
@@ -117,7 +117,7 @@
$form->setExtra('enctype="multipart/form-data"');
$tablesHandler = $this->tdmcreate->getHandler('tables');
- //$fieldsHandler = $this->tdmcreate->getHandler('fields');
+ $fieldsHandler = $this->tdmcreate->getHandler('fields');
$fieldelementsHandler =& $this->tdmcreate->getHandler('fieldelements');
$fieldtypeHandler =& $this->tdmcreate->getHandler('fieldtype');
$fieldattrsHandler =& $this->tdmcreate->getHandler('fieldattributes');
@@ -140,11 +140,11 @@
$form->addElement(new TDMCreateFormLabel('</tr></thead>'));
$form->addElement(new TDMCreateFormLabel('<tbody>'));
- //$fields = $fieldsHandler->getObjects(null);
+ $obj = $fieldsHandler->getObjects(null);
$class = '';
for($i = 1; $i <= $field_numb; $i++)
- {
+ {
$class = ($class == 'even') ? 'odd' : 'even';
$form->addElement(new TDMCreateFormLabel('<tr class="'.$class.'">'));
// Index ID
@@ -200,59 +200,58 @@
}
$parameters_tray->addElement($field_elements_select);
- $field_parent = $this->isNew() ? ( $i == 1 ) : $this->getVar('field_parent');
- $check_field_parent = new XoopsFormCheckBox(' ', 'field_parent', $field_parent);
- $check_field_parent->addOption(1, _AM_TDMCREATE_FIELD_PARENT );
+ $field_parent = $isNew ? ( $i == 1 ) : $this->getVar('field_parent');
+ $check_field_parent = new XoopsFormRadio(' ', 'field_parent', $field_parent);
+ $check_field_parent->addOption('', _AM_TDMCREATE_FIELD_PARENT );
$parameters_tray->addElement($check_field_parent);
- $field_inlist = $this->isNew() ? 0 : $this->getVar('field_inlist');
+ $field_inlist = $isNew ? 0 : $this->getVar('field_inlist');
$check_field_inlist = new XoopsFormCheckBox(' ', 'field_inlist['.$i.']', $field_inlist);
$check_field_inlist->addOption(1, _AM_TDMCREATE_FIELD_INLIST);
$parameters_tray->addElement($check_field_inlist);
- $field_inform = $this->isNew() ? 0 : $this->getVar('field_inform');
+ $field_inform = $isNew ? 0 : $this->getVar('field_inform');
$check_field_inform = new XoopsFormCheckBox(' ', 'field_inform['.$i.']', $field_inform);
$check_field_inform->addOption(1, _AM_TDMCREATE_FIELD_INFORM);
$parameters_tray->addElement($check_field_inform);
- $field_admin = $this->isNew() ? 0 : $this->getVar('field_admin');
+ $field_admin = $isNew ? 0 : $this->getVar('field_admin');
$check_field_admin = new XoopsFormCheckBox(' ', 'field_admin['.$i.']', $field_admin);
$check_field_admin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN);
$parameters_tray->addElement($check_field_admin);
- $field_user = $this->isNew() ? 0 : $this->getVar('field_user');
+ $field_user = $isNew ? 0 : $this->getVar('field_user');
$check_field_user = new XoopsFormCheckBox(' ', 'field_user['.$i.']', $field_user);
$check_field_user->addOption(1, _AM_TDMCREATE_FIELD_USER);
$parameters_tray->addElement($check_field_user);
- $field_block = $this->isNew() ? 0 : $this->getVar('field_block');
+ $field_block = $isNew ? 0 : $this->getVar('field_block');
$check_field_block = new XoopsFormCheckBox('', 'field_block['.$i.']', $field_block);
$check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
$parameters_tray->addElement($check_field_block);
- $field_main = $this->isNew() ? ( $i == 1 ) : $this->getVar('field_main');
+ $field_main = $isNew ? ( $i == 1 ) : $this->getVar('field_main');
$check_field_main = new XoopsFormRadio('', 'field_main', $field_main);
$check_field_main->addOption('', _AM_TDMCREATE_FIELD_MAINFIELD );
$parameters_tray->addElement($check_field_main);
- $field_search = $this->isNew() ? 0 : $this->getVar('field_search');
+ $field_search = $isNew ? 0 : $this->getVar('field_search');
$check_field_search = new XoopsFormCheckBox(' ', 'field_search['.$i.']', $field_search);
$check_field_search->addOption(1, _AM_TDMCREATE_FIELD_SEARCH);
$parameters_tray->addElement($check_field_search);
- $field_required = $this->isNew() ? 0 : $this->getVar('field_required');
+ $field_required = $isNew ? 0 : $this->getVar('field_required');
$check_field_required = new XoopsFormCheckBox(' ', 'field_required['.$i.']', $field_required);
$check_field_required->addOption(1, _AM_TDMCREATE_FIELD_REQUIRED);
$parameters_tray->addElement($check_field_required);
$form->addElement(new TDMCreateFormLabel('<td>'.$parameters_tray->render().'</td></tr>'));
}
- $form->addElement(new XoopsFormHidden('field_id['.$i.']', $i));
- }
+ $form->addElement(new XoopsFormHidden('field_id['.$i.']', $i));
+ $form->addElement(new XoopsFormHidden('field_mid', $field_mid));
+ $form->addElement(new XoopsFormHidden('field_tid', $field_tid));
+ }
- $form->addElement(new XoopsFormHidden('field_mid', $field_mid));
- $form->addElement(new XoopsFormHidden('field_tid', $field_tid));
- $form->addElement(new XoopsFormHidden('field_numb', $field_numb));
$form->addElement(new TDMCreateFormLabel('</tbody>'));
$form->addElement(new TDMCreateFormLabel('<tfoot><tr>'));
$form_hidden = new XoopsFormHidden('op', 'save');
@@ -317,22 +316,15 @@
/**
* retrieve a field
*
- * @param int $id tid
+ * @param int $id field id
*
* @return mixed reference to the {@link TDMCreateFields} object
*/
public function &get($id)
{
- $criteria = new Criteria('field_id', $id );
- if ($this->getCount($criteria) > 0) {
- $obj = $this->getObjects($criteria, false, false );
- return $obj[0]['field_id'];
- } else {
- return parent::get($tid);
- }
- return false;
- }
-
+ return parent::get($id);
+ }
+
/**
* insert a new field in the database
*
@@ -347,84 +339,8 @@
return false;
}
return true;
- }
-
- /**
- * delete fields matching a set of conditions
- *
- * @param object $criteria {@link CriteriaElement}
- *
- * @return bool FALSE if deletion failed
- */
- public function deleteAll($criteria = null)
- {
- //todo resource consuming, use get list instead?
- $fields = $this->getObjects($criteria);
- foreach ($fields as $field) {
- $this->delete($field);
- }
- return true;
- }
-
- /**
- * @param $field_tid
- *
- * @return bool
- */
- public function updateAll($field_tid)
- {
- $criteria = new Criteria('field_tid', $field_tid);
- if ($this->updateAll($criteria)) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * get all the fields that match the supplied parameters
- *
- * @param $side
- * @param $tableid tableid (can be an array)
- * @param $orderby order of the fields
- * @returns array of field objects
- */
- public function getAllFieldsByTable($table_mid, $asobject = true, $side = null, $orderby = "f.field_mid, f.field_tid")
- {
- $ret = array();
- if (!$asobject) {
- $sql = 'SELECT f.field_mid, f.field_tid ';
- } else {
- $sql = 'SELECT f.* ';
- }
- $sql .= "FROM " . $this->db->prefix("mod_tdmcreaterate_fields") . " f LEFT JOIN " . $this->db->prefix("mod_tdmcreaterate_tables") . " t ON f.field_tid=t.table_id WHERE table_mid = ".$table_mid;
- if (is_array($tableid)) {
- $sql .= " AND (t.table_id=" . $tableid[0] . "";
- $sql .= ")";
- } else {
- $sql .= " AND t.table_id=" . $tableid . "";
- }
- if (isset($side)) {
- // get both sides in sidebox? (some themes need this)
- $side = "f.field_side=" . $side;
- $sql .= " AND " . $side;
- }
- $sql .= " ORDER BY $orderby";
- $result = $this->db->query($sql);
- $added = array();
- while ($myrow = $this->db->fetchArray($result)) {
- if (!in_array($myrow['field_id'], $added)) {
- if (!$asobject) {
- $ret[] = $myrow['field_id'];
- } else {
- $ret[] = new TDMCreateFields($myrow);
- }
- array_push($added, $myrow['field_id']);
- }
- }
- return $ret;
- }
-
+ }
+
/*
* @public function getFieldModuleId
* @param integer $field_id
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/html/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/html/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/html/index.html 2014-05-08 12:08:54 UTC (rev 12521)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/html/simplelabel.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/html/simplelabel.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/html/simplelabel.php 2014-05-08 12:08:54 UTC (rev 12521)
@@ -0,0 +1,47 @@
+<?php
+/**
+ * XOOPS form element
+ *
+ * You may not change or alter any portion of this comment or credits
+ * of supporting developers from this source code or any supporting source code
+ * which is considered copyrighted (c) material of the original comment or credit authors.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package kernel
+ * @subpackage form
+ * @since 2.0.0
+ * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/
+ * @version $Id: simplelabel.php 12562 2014-04-03 10:57:12Z timgno $
+ */
+
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+/**
+ * A text label
+ */
+class TDMCreateFormLabel extends XoopsFormElement
+{
+ /**
+ * Constructor
+ *
+ * @param string $caption
+ */
+ function TDMCreateFormLabel($caption = '')
+ {
+ $this->setCaption($caption);
+ }
+
+ /**
+ * Prepare HTML for output
+ *
+ * @return string
+ */
+ function render()
+ {
+ return $this->getCaption();
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-05-05 12:45:22 UTC (rev 12520)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-05-08 12:08:54 UTC (rev 12521)
@@ -116,7 +116,8 @@
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
- $title = $this->isNew() ? sprintf(_AM_TDMCREATE_MODULE_ADD) : sprintf(_AM_TDMCREATE_MODULE_EDIT);
+ $isNew = $this->isNew();
+ $title = $isNew ? sprintf(_AM_TDMCREATE_MODULE_ADD) : sprintf(_AM_TDMCREATE_MODULE_EDIT);
include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php");
@@ -144,25 +145,26 @@
// Author
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, 'mod_author', 50, 255, $this->getVar('mod_author')), true);
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, 'mod_license', 50, 255, $this->getVar('mod_license')), true);
- $mod_admin = $this->isNew() ? $this->tdmcreate->getConfig('display_admin') : $this->getVar('mod_admin');
+ $mod_admin = $isNew ? $this->tdmcreate->getConfig('display_admin') : $this->getVar('mod_admin');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_ADMIN, 'mod_admin', $mod_admin, _YES, _NO));
- $mod_...
[truncated message content] |
|
From: <txm...@us...> - 2014-05-16 14:20:35
|
Revision: 12534
http://sourceforge.net/p/xoops/svn/12534
Author: txmodxoops
Date: 2014-05-16 14:20:30 +0000 (Fri, 16 May 2014)
Log Message:
-----------
Fixed bugs
Added class/files/admin_about.php file.php
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/js/functions.js
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/building.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/fields.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/modules.tpl
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tables.tpl
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-14 20:51:54 UTC (rev 12533)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-05-16 14:20:30 UTC (rev 12534)
@@ -26,6 +26,12 @@
} else {
$modules =& $modulesHandler;
}
+$tname = TDMCreate_CleanVars( $_REQUEST, 'table_name', '', 'string' );
+if ( $tname ) {
+ $tables =& $tablesHandler->get( $tname );
+} else {
+ $tables =& $tablesHandler;
+}
$mod_name = $modules->getVar('mod_name');
$from_dir = TDMC_UPLOAD_MODULES_PATH.'/'.strtolower($mod_name);
$to_dir = XOOPS_ROOT_PATH.'/modules/'.strtolower($mod_name);
@@ -45,17 +51,23 @@
$handler = TDMCreateArchitecture::getInstance();
$handler->getPath( TDMC_PATH );
$handler->getUploadPath( TDMC_UPLOAD_PATH );
- $base_architecture = $handler->getArchitectureFiles( $modules );
- /*if($base_architecture !== false) { */
- $GLOBALS['xoopsTpl']->assign('base_architecture', $base_architecture);
- /*} else {
+ $base_architecture = $handler->createBaseFoldersFiles( $modules );
+ if($base_architecture !== false) {
+ $GLOBALS['xoopsTpl']->assign('base_architecture', true);
+ } else {
$GLOBALS['xoopsTpl']->assign('base_architecture', false);
- }*/
+ }/**/
+ //$builds = array();
+ $building_files = $handler->createBuildingFiles( $modules, $tables );
+ /*foreach($building_files as $key => $value) {$builds
+ $builds['list'] = $key;*/
+ $GLOBALS['xoopsTpl']->assign('builds', $building_files);
+ //}
$mod_name = 'uploads/tdmcreate/modules/' . str_replace(' ', '', strtolower($mod_name));
// Creation of the structure of folders and files
- $GLOBALS['xoopsTpl']->assign('build_list', 'Under new construction - Temporary build only folders of this selected module "'.$mod_name.'/"');
- if ( $modules->getVar('mod_install') == 1 ) {
- copyInRootModules($from_dir, $to_dir);
+ $GLOBALS['xoopsTpl']->assign('build_list', '<b>Under new construction</b> - Temporary build only folders of this selected module "'.$mod_name.'/"');
+ if ( $modules->getVar('mod_inroot_copy') == 1 ) {
+ TDMCreate_copyr($from_dir, $to_dir);
}
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-14 20:51:54 UTC (rev 12533)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-05-16 14:20:30 UTC (rev 12534)
@@ -22,20 +22,21 @@
// Recovered value of arguments op in the URL $
$op = TDMCreateRequest::getString('op', 'list');
// Get table Variables
-$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id');
+/*$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id');
$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid');
$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields');
-/*$table_id = TDMCreateRequest::getInt('table_id');
+$table_id = TDMCreateRequest::getInt('table_id');
$table_mid = TDMCreateRequest::getInt('table_mid');
-$table_nbfields = TDMCreateRequest::getInt('table_nbfields');*/
+$table_nbfields = TDMCreateRequest::getInt('table_nbfields');
// Get field Variables
-$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id');
+$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id');*/
+$table_name = TDMCreate_CleanVars($_REQUEST, 'table_name', '', 'string');
$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid');
$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb');
$field_name = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');
-/*$field_id = TDMCreateRequest::getInt('field_id');
-$field_mid = TDMCreateRequest::getInt('field_mid');
+$field_id = TDMCreateRequest::getInt('field_id');
+/*$field_mid = TDMCreateRequest::getInt('field_mid');
$field_tid = TDMCreateRequest::getInt('field_tid');
$field_numb = TDMCreateRequest::getInt('field_numb');
$field_name = TDMCreateRequest::getString('field_name', ''); */
@@ -72,8 +73,8 @@
unset($nb_tables);
// Get the list of tables
$criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_mid', $table_mid));
- $criteria->add(new Criteria('table_id', $table_id));
+ $criteria->add(new Criteria('table_mid', $field_mid));
+ $criteria->add(new Criteria('table_id', $field_tid));
$criteria->setSort('table_id ASC, table_name');
$criteria->setOrder('ASC');
$nb_tables = $tablesHandler->getCount($criteria);
@@ -82,25 +83,27 @@
if ($nb_tables > 0)
{
foreach (array_keys($tables_arr) as $t)
- {
+ {
+ // Display tables list
$table['id'] = $t;
- $table['name'] = ucfirst($tables_arr[$t]->getVar('table_name'));
+ $table['mid'] = $tables_arr[$t]->getVar('table_mid');
+ $table['name'] = ucfirst($tables_arr[$t]->getVar('table_name'));
$table['image'] = $tables_arr[$t]->getVar('table_image');
$table['nbfields'] = $tables_arr[$t]->getVar('table_nbfields');
$table['blocks'] = $tables_arr[$t]->getVar('table_blocks');
$table['admin'] = $tables_arr[$t]->getVar('table_admin');
$table['user'] = $tables_arr[$t]->getVar('table_user');
$table['search'] = $tables_arr[$t]->getVar('table_search');
- // Get the list of tables
+ // Get the list of fields
$criteria = new CriteriaCompo();
- $criteria->add(new Criteria('field_mid', $table_mid));
+ $criteria->add(new Criteria('field_mid', $field_mid));
$criteria->add(new Criteria('field_tid', $t));
$criteria->setSort('field_id ASC, field_name');
$criteria->setOrder('ASC');
$nb_fields = $fieldsHandler->getCount($criteria);
$fields_arr = $fieldsHandler->getAll($criteria);
unset($criteria);
- // Display tables list
+ // Display fields list
$fields = array();
$lid = 1;
if ( $nb_fields > 0 )
@@ -157,15 +160,20 @@
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
+ $fieldelement_fid = $field_id = TDMCreateRequest::getInt('fieldelement_fid');
//
- if (isset($field_id)) {
+ if (isset($field_id)) {
$obj =& $fieldsHandler->get($field_id);
+ if (isset($fieldelement_fid)) {
+ $objfieldelement =& $fieldelementsHandler->get($fieldelement_fid);
+ }
} else {
$obj =& $fieldsHandler->create();
- }
- //
+ $objfieldelement =& $fieldelementsHandler->create();
+ }
if ($field_numb > 0) {
- for( $i = 1; $i <= $field_numb; $i++ ) {
+ for( $i = 1; $i <= $field_numb; $i++ ) {
+ //
$obj->setVar( 'field_mid', $field_mid );
$obj->setVar( 'field_tid', $field_tid );
$obj->setVar( 'field_numb', $field_numb );
@@ -190,6 +198,10 @@
$fieldsHandler->insert($obj);
}
}
+ $objfieldelement->setVar( 'fieldelement_name', 'Table : '.$_REQUEST['table_name'] );
+ $objfieldelement->setVar( 'fieldelement_value', 'XoopsFormTables-'.$_REQUEST['table_name'] );
+ // Insert new table name
+ $fieldelementsHandler->insert($objfieldelement);
//
if ($obj->isNew()) {
redirect_header('fields.php', 2, sprintf(_AM_TDMCREATE_FIELD_FORM_SAVED_OK, $_REQUEST['table_name']));
@@ -209,11 +221,32 @@
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
$adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
- $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
$obj = $fieldsHandler->get( $field_id );
$form = $obj->getForm($field_mid, $field_tid, $field_numb);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
+
+ // Get the list of fields
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('field_mid', $field_mid));
+ $criteria->add(new Criteria('field_tid', $field_tid));
+ $criteria->setSort('field_id ASC, field_name');
+ $criteria->setOrder('ASC');
+ $nb_fields = $fieldsHandler->getCount($criteria);
+ $fields_arr = $fieldsHandler->getAll($criteria);
+ unset($criteria);
+ if ( $nb_fields > 0 )
+ {
+ foreach (array_keys($fields_arr) as $f)
+ {
+ $field_id = $fields_arr[$f]->getVar('field_id');
+ var_dump($field_id);
+ }
+ }
+ var_dump($field_mid);
+ var_dump($field_tid);
+ var_dump($field_numb);
break;
case 'drag':
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-05-14 20:51:54 UTC (rev 12533)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-05-16 14:20:30 UTC (rev 12534)
@@ -32,6 +32,7 @@
$limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('modules_adminpager'));
// Define main template
$template_main = 'modules.tpl';
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
@@ -197,33 +198,33 @@
case 'toggle':
if (isset($_GET['mod_id'])) {
if (isset($_GET['mod_admin'])) {
- $mod_admin = intval($_GET['mod_admin']);
- $mod_admin = ($mod_admin == 1) ? 0 : 1;
+ $madmin = intval($_GET['mod_admin']);
+ $mod_admin = ($madmin == 1) ? 0 : 1;
$obj =& $modulesHandler->get($mod_id);
$obj->setVar('mod_admin', $mod_admin);
} elseif (isset($_GET['mod_user'])) {
- $mod_user = intval($_GET['mod_user']);
- $mod_user = ($mod_user == 1) ? 0 : 1;
+ $muser = intval($_GET['mod_user']);
+ $mod_user = ($muser == 1) ? 0 : 1;
$obj =& $modulesHandler->get($mod_id);
$obj->setVar('mod_user', $mod_user);
} elseif (isset($_GET['mod_search'])) {
- $mod_search = intval($_GET['mod_search']);
- $mod_search = ($mod_search == 1) ? 0 : 1;
+ $msearch = intval($_GET['mod_search']);
+ $mod_search = ($msearch == 1) ? 0 : 1;
$obj =& $modulesHandler->get($mod_id);
$obj->setVar('mod_search', $mod_search);
} elseif (isset($_GET['mod_comments'])) {
- $mod_comments = intval($_GET['mod_comments']);
- $mod_comments = ($mod_comments == 1) ? 0 : 1;
+ $mcomments = intval($_GET['mod_comments']);
+ $mod_comments = ($mcomments == 1) ? 0 : 1;
$obj =& $modulesHandler->get($mod_id);
$obj->setVar('mod_comments', $mod_comments);
} elseif (isset($_GET['mod_notifications'])) {
- $mod_notifications = intval($_GET['mod_notifications']);
- $mod_notifications = ($mod_notifications == 1) ? 0 : 1;
+ $mnotifications = intval($_GET['mod_notifications']);
+ $mod_notifications = ($mnotifications == 1) ? 0 : 1;
$obj =& $modulesHandler->get($mod_id);
$obj->setVar('mod_notifications', $mod_notifications);
} elseif (isset($_GET['mod_permissions'])) {
- $mod_permissions = intval($_GET['mod_permissions']);
- $mod_permissions = ($mod_permissions == 1) ? 0 : 1;
+ $mpermissions = intval($_GET['mod_permissions']);
+ $mod_permissions = ($mpermissions == 1) ? 0 : 1;
$obj =& $modulesHandler->get($mod_id);
$obj->setVar('mod_permissions', $mod_permissions);
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-05-14 20:51:54 UTC (rev 12533)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-05-16 14:20:30 UTC (rev 12534)
@@ -171,7 +171,7 @@
$tdmcreate->getConfig('maxsize'), null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
$extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['table_image']['name']);
- $name_img = $_GET['table_name'].'.'.$extension;
+ $name_img = $_POST['table_name'].'.'.$extension;
$uploader->setPrefix($name_img);
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php 2014-05-14 20:51:54 UTC (rev 12533)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldelements.php 2014-05-16 14:20:30 UTC (rev 12534)
@@ -32,11 +32,10 @@
* @param null
*/
public function __construct()
- {
- $this->htmltable = TDMCreateHtmlTable::getInstance();
- $this->initVar('fieldelement_fid', XOBJ_DTYPE_INT);
+ {
+ $this->initVar('fieldelement_fid', XOBJ_DTYPE_INT);
+ $this->initVar('fieldelement_name', XOBJ_DTYPE_TXTBOX);
$this->initVar('fieldelement_value', XOBJ_DTYPE_TXTBOX);
- $this->initVar('fieldelement_name', XOBJ_DTYPE_TXTBOX);
}
/**
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-14 20:51:54 UTC (rev 12533)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-05-16 14:20:30 UTC (rev 12534)
@@ -142,22 +142,35 @@
$obj = $fieldsHandler->getObjects(null);
+ // Get the list of fields
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('field_mid', $field_mid));
+ $criteria->add(new Criteria('field_tid', $field_tid));
+ $criteria->setSort('field_id ASC, field_name');
+ $criteria->setOrder('ASC');
+ $fields_arr = $fieldsHandler->getAll($criteria);
+ unset($criteria);
+
$class = '';
for($i = 1; $i <= $field_numb; $i++)
{
+ $form->addElement(new XoopsFormHidden('field_id['.$i.']', $i));
+ $form->addElement(new XoopsFormHidden('field_mid', $field_mid));
+ $form->addElement(new XoopsFormHidden('field_tid', $field_tid));
+
$class = ($class == 'even') ? 'odd' : 'even';
$form->addElement(new TDMCreateFormLabel('<tr class="'.$class.'">'));
- // Index ID
+ // Index ID
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$i.'</td>'));
- // Field Name
+ // Field Name
$this_field_name = $isNew ? (!empty($f_name) ? $f_name . '_' : '') : $this->getVar('field_name');
$field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$i.']', 15, 255, $this_field_name);
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
// Field Type
$fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type['.$i.']', $this->getVar('field_type'));
- $fieldtype_select->addOptionArray($fieldtypeHandler->getList());
+ $fieldtype_select->addOptionArray($fieldtypeHandler->getList());
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$fieldtype_select->render().'</td>'));
- // Field Value
+ // Field Value
$field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value['.$i.']', 5, 20, $this->getVar('field_value'));
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_value->render().'</td>'));
// Field Attributes
@@ -181,10 +194,10 @@
$form->addElement(new TDMCreateFormLabel('<td> </td></tr>'));
} else {
// Box header row
- $parameters_tray = new XoopsFormElementTray('', '<br />');
+ $parameters_tray = new XoopsFormElementTray('', '<br />');
// Field Elements
$field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$i.']', $this->getVar('field_element'));
- $field_elements_select->addOptionArray($fieldelementsHandler->getList());
+ $field_elements_select->addOptionArray($fieldelementsHandler->getList());
$criteria = new CriteriaCompo(new Criteria('table_id', $f_tid));
$criteria->add(new Criteria('table_mid', $f_mid));
$criteria->setSort('table_name');
@@ -199,10 +212,10 @@
}
}
$parameters_tray->addElement($field_elements_select);
-
- $field_parent = $isNew ? ( $i == 1 ) : $this->getVar('field_parent');
- $check_field_parent = new XoopsFormRadio(' ', 'field_parent', $field_parent);
- $check_field_parent->addOption('', _AM_TDMCREATE_FIELD_PARENT );
+
+ $field_parent = $isNew ? ( $i == 1 ? 1 : 0 ) : $this->getVar('field_parent');
+ $check_field_parent = new XoopsFormCheckBox(' ', 'field_parent', $field_parent);
+ $check_field_parent->addOption($i, _AM_TDMCREATE_FIELD_PARENT );
$parameters_tray->addElement($check_field_parent);
$field_inlist = $isNew ? 0 : $this->getVar('field_inlist');
@@ -230,7 +243,7 @@
$check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
$parameters_tray->addElement($check_field_block);
- $field_main = $isNew ? ( $i == 1 ) : $this->getVar('field_main');
+ $field_main = $isNew ? ( $i == 1 ? 1 : 0 ) : $this->getVar('field_main');
$check_field_main = new XoopsFormRadio('', 'field_main', $field_main);
$check_field_main->addOption('', _AM_TDMCREATE_FIELD_MAINFIELD );
$parameters_tray->addElement($check_field_main);
@@ -246,12 +259,9 @@
$parameters_tray->addElement($check_field_required);
$form->addElement(new TDMCreateFormLabel('<td>'.$parameters_tray->render().'</td></tr>'));
- }
- $form->addElement(new XoopsFormHidden('field_id['.$i.']', $i));
- $form->addElement(new XoopsFormHidden('field_mid', $field_mid));
- $form->addElement(new XoopsFormHidden('field_tid', $field_tid));
+ }
}
-
+
$form->addElement(new TDMCreateFormLabel('</tbody>'));
$form->addElement(new TDMCreateFormLabel('<tfoot><tr>'));
$form_hidden = new XoopsFormHidden('op', 'save');
@@ -323,7 +333,18 @@
public function &get($id)
{
return parent::get($id);
- }
+ }
+
+ /**
+ * get IDs of objects matching a condition
+ *
+ * @param object $criteria {@link CriteriaElement} to match
+ * @return array of object IDs
+ */
+ function &getIds($criteria)
+ {
+ return parent::getIds($criteria);
+ }
/**
* insert a new field in the database
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php 2014-05-14 20:51:54 UTC (rev 12533)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php 2014-05-16 14:20:30 UTC (rev 12534)
@@ -16,7 +16,7 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: headerfiles.php 12258 2014-01-02 09:33:29Z timgno $
+ * @version $Id: abstractfiles.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
@@ -69,21 +69,12 @@
private $folder = null;
/**
- * "file_name" attribute of the files
+ * "filename" attribute of the files
*
* @var mixed
*/
- private $file_name = null;
-
- /**
- * Generates output for the files.
- *
- * This method is abstract and must be overwritten by the child classes.
- *
- * @abstract
- */
- abstract function render();
-
+ private $filename = null;
+
/*
* @public function getHeader
* @param string $path
@@ -91,231 +82,21 @@
* @param string $folder
* @param string $file_name
*/
- public function getHeader($path, $module, $folder, $file_name) {
+ public function getHeader($path, $module, $folder, $filename) {
$this->path = $path;
$this->folder = $folder;
$this->module = $module;
- $this->file_name = $file_name;
- $ret = $this->path . DIRECTORY_SEPARATOR . $this->module . DIRECTORY_SEPARATOR . $this->folder . DIRECTORY_SEPARATOR . $this->file_name;
+ $this->filename = $filename;
+ $ret = $this->path . DIRECTORY_SEPARATOR . $this->module . DIRECTORY_SEPARATOR . $this->folder . DIRECTORY_SEPARATOR . $this->filename;
return $ret;
- }
+ }
- /*
- * @private function setPath
- * @param string $path
- */
- private function setPath($path) {
- $this->path = $path;
- }
-
- /*
- * @private function getPath
- * @param null
- */
- private function getPath() {
- return $this->path;
- }
-
- /*
- * @public function getLocalPath
- * @param mixed $subdir
- */
- public function getLocalPath($subdir = false)
- {
- if ($subdir) {
- $ret = $this->getUploadPath() . DIRECTORY_SEPARATOR . $this->getModuleName() . DIRECTORY_SEPARATOR . $subdir;
- } else {
- $ret = $this->getUploadPath() . DIRECTORY_SEPARATOR . $this->getModuleName();
- }
- return $ret;
- }
-
- /*
- * @private function setUploadPath
- * @param string $upload_path
- */
- private function setUploadPath($upload_path) {
- $this->upload_path = $upload_path;
- }
-
- /*
- * @public function getUploadPath
- * @param null
- */
- public function getUploadPath()
- {
- return $this->upload_path;
- }
-
- /**
- * public function setFileName
- * @param mixed $module
+ /**
+ * Generates output for the files.
+ *
+ * This method is abstract and must be overwritten by the child classes.
+ *
+ * @abstract
*/
- public function setModule($module)
- {
- $this->module = $module;
- }
-
- /*
- * @public function getModule
- * @param null
- */
- public function getModule()
- {
- return $this->module;
- }
-
- /**
- * public function setFileName
- * @param mixed $file_name
- */
- public function setFileName($file_name)
- {
- $this->file_name = $file_name;
- }
-
- /*
- * @public function getFileName
- * @param null
- */
- public function getFileName()
- {
- return $this->file_name;
- }
-
- /*
- * @public function getModuleName
- * @param null
- */
- public function getModuleName() {
- $ret = $this->module->getVar('mod_name');
- return $ret;
- }
-
- /**
- * public function setTable
- * @param mixed $table
- */
- public function setTable($table)
- {
- if (is_array($table)) {
- foreach($table as $t) {
- $this->table[] = $t;
- }
- } elseif (is_array($this->table)) {
- $this->table[] = $table;
- } else {
- $this->table = $table;
- }
- }
-
- /*
- * @public function getTable
- * @param null
- */
- public function getTable() {
- if (is_array($this->table)) {
- $ret = array();
- foreach ($this->table as $table) {
- $ret[] = $table;
- }
- return $ret;
- }
- }
-
- /**
- * @public function setFields
- * @param mixed $fields
- */
- public function setFields($fields)
- {
- if (is_array($fields)) {
- foreach($fields as $f) {
- $this->fields[] = $f;
- }
- } elseif (is_array($this->fields)) {
- $this->fields[] = $fields;
- } else {
- $this->fields = $fields;
- }
- }
-
- /*
- * @public function getFields
- * @param null
- */
- public function getFields() {
- if (is_array($this->fields)) {
- $ret = array();
- foreach ($this->fields as $fields) {
- $ret[] = $fields;
- }
- return $ret;
- }
- }
-
- /*
- * @public function getLanguage
- * @param string $prefix
- * @param string $postfix
- */
- public function getLanguage($prefix = '', $postfix = '') {
- $lang = '_' . $prefix . '_' . strtoupper($this->module->getVar('mod_name'));
- if(!empty($postfix) || $postfix != '_') {
- $ret = $lang . '_' . $postfix;
- } elseif($postfix == '_') {
- $ret = $lang . '_';
- } else {
- $ret = $lang;
- }
- return $ret;
- }
-
- /*
- * @public function getHeaderFilesComments
- * @param string $module
- * @param string $file_name
- */
- public function getHeaderFilesComments($module, $file_name) {
- $this->module = $module;
- $this->file_name = $file_name;
-
- $mod_name = $this->module->getVar('mod_name');
- $mod_version = $this->module->getVar('mod_version');
- $mod_since = $this->module->getVar('mod_since');
- $mod_min_xoops = $this->module->getVar('mod_min_xoops');
- $mod_author = $this->module->getVar('mod_author');
- $mod_credits = $this->module->getVar('mod_credits');
- $mod_author_mail = $this->module->getVar('mod_author_mail');
- $mod_author_website_url = $this->module->getVar('mod_author_website_url');
- $mod_license = $this->module->getVar('mod_license');
- $mod_subversion = $this->module->getVar('mod_subversion');
- $date = date('D Y/m/d G:i:s');
- $package = strtolower($mod_name);
-
- $ret = <<<EOT
-<?php
-/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-*/
-/**
- * {$mod_name} module for xoops
- *
- * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license {$mod_license}
- * @package {$package}
- * @since {$mod_since}
- * @min_xoops {$mod_min_xoops}
- * @author {$mod_author} <{$mod_author_mail}> - <{$mod_author_website_url}>
- * @version \$Id: {$mod_version} {$file_name} {$mod_subversion} {$date}Z {$mod_credits} \$
- */\n
-EOT;
- return $ret;
- }
+ public function render() {}
}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php 2014-05-16 14:20:30 UTC (rev 12534)
@@ -0,0 +1,71 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ ...
[truncated message content] |