|
From: <txm...@us...> - 2013-10-03 07:03:33
|
Revision: 12121
http://sourceforge.net/p/xoops/svn/12121
Author: txmodxoops
Date: 2013-10-03 07:03:28 +0000 (Thu, 03 Oct 2013)
Log Message:
-----------
Updated
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_architecture.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_changelog.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_header.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_include_search.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_sql.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_user_comments.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/include/functions_const.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/templates/admin/tdmcreate_tables.html
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldattributes.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldelements.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldkey.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldnull.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldtype.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/htmltable.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/structure.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/themeform.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_include_common.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_include_functions_comments.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_include_notifications.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_language_admin.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_language_blocks.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_language_help.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_language_main.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_language_modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_templates_blocks.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_waiting.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/templates/admin/tdmcreate_building.html
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tdmcreate_architecture.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tdmcreate_fieldattributes.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tdmcreate_fieldelements.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tdmcreate_fieldkey.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tdmcreate_fieldnull.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tdmcreate_fields.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tdmcreate_fields_elements.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tdmcreate_fieldtype.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tdmcreate_htmltable.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tdmcreate_languages.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tdmcreate_modules.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tdmcreate_structures.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tdmcreate_tables.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/tdmcreate_themeform.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/images/uploads/tables/broken.png
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/images/uploads/tables/contact.png
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/images/uploads/tables/links.png
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/images/uploads/tables/shoutbox.png
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/images/uploads/tables/topic.png
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/about.php 2013-10-02 16:08:49 UTC (rev 12120)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/about.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -18,8 +18,8 @@
* @author Txmod Xoops <su...@tx...>
* @version $Id: 1.59 about.php 11297 2013-03-24 10:58:10Z timgno $
*/
-include 'admin_header.php';
+include 'header.php';
xoops_cp_header();
echo $adminMenu->addNavigation('about.php');
-echo $adminMenu->renderAbout('YDRUY5QZQHAHS', false);
-include 'admin_footer.php';
\ No newline at end of file
+echo $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false);
+include 'footer.php';
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/admin_footer.php 2013-10-02 16:08:49 UTC (rev 12120)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/admin_footer.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -1,25 +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 admin_footer.php 11297 2013-03-24 10:58:10Z timgno $
- */
-$fsname = $GLOBALS['xoopsModule']->getInfo('support_name');
-echo "<div align='center'><a href='http://www.xoops.org' target='_blank'>
- <img src='".$pathIcon32."/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a></div>";
- echo "<div class='center pad5'>" . sprintf(_AM_TDMCREATE_MAINTAINEDBY, $GLOBALS['xoopsModule']->getVar('dirname'), $GLOBALS['xoopsModule']->getInfo('support_url'), $fsname, $fsname) . "</div>";
-xoops_cp_footer();
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/admin_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/admin_header.php 2013-10-02 16:08:49 UTC (rev 12120)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/admin_header.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -1,60 +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 admin_header.php 11297 2013-03-24 10:58:10Z timgno $
- */
-include_once dirname(dirname(dirname(dirname(__FILE__)))).'/include/cp_header.php';
-$dirname = $GLOBALS['xoopsModule']->getVar('dirname');
-include_once $GLOBALS['xoops']->path('modules/'.$dirname.'/include/common.php');
-include_once $GLOBALS['xoops']->path('modules/'.$dirname.'/include/functions.php');
-include_once $GLOBALS['xoops']->path('modules/'.$dirname.'/admin/includes.php');
-
-$pathIcon16 = XOOPS_URL.'/'.$GLOBALS['xoopsModule']->getInfo('icons16');
-$pathIcon32 = XOOPS_URL.'/'.$GLOBALS['xoopsModule']->getInfo('icons32');
-$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
-
-$modulesHandler=& xoops_getModuleHandler('tdmcreate_modules', $dirname);
-$tablesHandler=& xoops_getModuleHandler('tdmcreate_tables', $dirname);
-$fieldsHandler=& xoops_getModuleHandler('tdmcreate_fields', $dirname);
-$fieldtypeHandler=& xoops_getModuleHandler('tdmcreate_fieldtype', $dirname);
-$fieldattributesHandler=& xoops_getModuleHandler('tdmcreate_fieldattributes', $dirname);
-$fieldnullHandler=& xoops_getModuleHandler('tdmcreate_fieldnull', $dirname);
-$fieldkeyHandler=& xoops_getModuleHandler('tdmcreate_fieldkey', $dirname);
-$fieldelementsHandler=& xoops_getModuleHandler('tdmcreate_fieldelements', $dirname);
-
-$myts =& MyTextSanitizer::getInstance();
-
-if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
- include_once(XOOPS_ROOT_PATH . "/class/template.php");
- $xoopsTpl = new XoopsTpl();
-}
-
-$xoopsTpl->assign('pathIcon16', $pathIcon16);
-$xoopsTpl->assign('pathIcon32', $pathIcon32);
-//Load languages
-xoops_loadLanguage('admin', $dirname);
-xoops_loadLanguage('modinfo', $dirname);
-xoops_loadLanguage('main', $dirname);
-
-// Locad admin menu class
-if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){
- include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
-}else{
- redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
-}
-$adminMenu = new ModuleAdmin();
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/building.php 2013-10-02 16:08:49 UTC (rev 12120)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/building.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -18,7 +18,15 @@
* @author Txmod Xoops <su...@tx...>
* @version $Id: 1.59 building.php 11297 2013-03-24 10:58:10Z timgno $
*/
-include 'admin_header.php';
+ /*
+$table_name =& $tablesHandler->get($table_name);
+$table_fieldname =& $tablesHandler->get($table_fieldname);
+$table_blocks =& $tablesHandler->get($table_blocks);
+$table_submenu =& $tablesHandler->get($table_submenu);
+$table_search =& $tablesHandler->get($table_search);
+$table_comments =& $tablesHandler->get($table_comments);*/
+include 'header.php';
+xoops_cp_header();
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
$table_id = TDMCreate_CleanVars( $_REQUEST, 'table_id', 0 );
$table_name = TDMCreate_CleanVars( $_REQUEST, 'table_name', '', 'string' );
@@ -27,22 +35,17 @@
$table_submenu = TDMCreate_CleanVars( $_REQUEST, 'table_submenu', '', 'string' );
$table_search = TDMCreate_CleanVars( $_REQUEST, 'table_search', '', 'string' );
$table_comments = TDMCreate_CleanVars( $_REQUEST, 'table_comments', '', 'string' );
-$mod_id = TDMCreate_CleanVars( $_REQUEST, 'mod_id', 0 );
-$mod_name = TDMCreate_CleanVars( $_REQUEST, 'mod_name', '', 'string' );
+$mid = TDMCreate_CleanVars( $_REQUEST, 'mod_id', 0 );
+$mname = TDMCreate_CleanVars( $_REQUEST, 'mod_name', null, 'string' );
-if (isset($mod_name)) {
- $modules =& $modulesHandler->get($mod_name);
+/*if (isset($mod_name)) {
+ $modules =& $modulesHandler->get($mname);
} else {
$modules =& $modulesHandler;
}
-/*
-$table_name =& $tablesHandler->get($table_name);
-$table_fieldname =& $tablesHandler->get($table_fieldname);
-$table_blocks =& $tablesHandler->get($table_blocks);
-$table_submenu =& $tablesHandler->get($table_submenu);
-$table_search =& $tablesHandler->get($table_search);
-$table_comments =& $tablesHandler->get($table_comments);*/
+
+$mod_id = $modules->getVar('mod_id');
$mod_name = $modules->getVar('mod_name');
$mod_desc = $modules->getVar('mod_description');
$mod_author_website_name = $modules->getVar('mod_author_website_name');
@@ -61,18 +64,69 @@
unset($criteria);
$criteria = new CriteriaCompo();
-$criteria->add(new Criteria('field_mid', $mod_id));
+$criteria->add(new Criteria('field_mid', $mod_name));
$criteria->add(new Criteria('field_tid', $table_id));
$nb_fields = $fieldsHandler->getCount($criteria);
$fields_arr = $fieldsHandler->getAll($criteria);
+unset($criteria);*/
+
+if (isset($_REQUEST['mod_name'])) {
+ $modules =& $modulesHandler->get($_REQUEST['mod_name']);
+} else {
+ $modules =& $modulesHandler;
+}
+
+$mod_name = strtolower($modules->getVar('mod_name'));
+$mod_desc = $modules->getVar('mod_description');
+$mod_author_website_name = $modules->getVar('mod_author_website_name');
+$mod_author_website_url = $modules->getVar('mod_author_website_url');
+$mod_image = $modules->getVar('mod_image');
+$mod_active_search = $modules->getVar('mod_search');
+$mod_active_comments = $modules->getVar('mod_comments');
+$mod_active_notifications = $modules->getVar('mod_notifications');
+$mod_paypal_button = $modules->getVar('mod_donations');
+$mod_subversion = $modules->getVar('mod_subversion');
+
+if (isset($_REQUEST['table_name'])) {
+ $tables =& $tablesHandler->get(isset($_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);
unset($criteria);
+$criteria = new CriteriaCompo();
+$criteria->add(new Criteria('field_mid', $mod_name));
+$criteria->add(new Criteria('field_tid', $table_name));
+$nb_fields = $fieldsHandler->getCount($criteria);
+$fields_arr = $fieldsHandler->getAll($criteria);
+unset($criteria);
+
+$inroot_modules = TDMCreate_CleanVars( $_REQUEST, 'install_inroot', 0);
+$mpath = $modPath.'/repository/'.$mod_name;
+$rmpath = XOOPS_ROOT_PATH.'/modules/'.$mod_name;
+
switch ($op) {
- case 'build':
- xoops_cp_header();
- //Remove the new module directory if it exists
- TDMCreate_clearDir($modPath.'/repository/'.$mod_name);
-
+ case 'build':
+ $inroot = 0;
+ if($inroot_modules == 1) {
+ $inroot = 1;
+ //Remove the new module directory if it exists in root/modules
+ TDMCreate_clearDir($rmpath);
+ }
+ //Remove the new module if it exists in repository directory
+ TDMCreate_clearDir($mpath);
+
//Debut
OpenTable();
/************************************************/
@@ -106,7 +160,7 @@
//Copie of images tables
$table_img1 = $modPath.'/images/uploads/tables/'.$table_image;
if (file_exists($table_img1)) {
- copy($table_img1, $modPath.'/modules/'.$mod_name.'/images/icons/32/'.$table_image);
+ copy($table_img1, $mpath.'/images/icons/32/'.$table_image);
}
//Creation des classes
const_class($modules, $mod_name, $table_name, $table_fieldname, $fields_arr);
@@ -203,20 +257,17 @@
const_user_index($modules, $mod_name);
}
CloseTable();
-
+ var_dump($inroot);
break;
case 'default':
default:
-
- xoops_cp_header();
-
echo $adminMenu->addNavigation('building.php');
$mod_arr = $modulesHandler->getall();
$numrowsmod = count( $mod_arr );
// Redirect if there aren't modules
if ( $numrowsmod == 0 ) {
- redirect_header('modules.php?op=add_module', 3, _AM_TDMCREATE_NOTMODULES );
+ redirect_header('modules.php?op=new', 3, _AM_TDMCREATE_NOTMODULES );
}
include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php");
@@ -226,11 +277,20 @@
$mod_select = new XoopsFormSelect(_AM_TDMCREATE_CONST_MODULES, 'mod_name', 'mod_name');
$mod_select->addOptionArray($modulesHandler->getList());
- $form->addElement($mod_select, true);
+ $form->addElement($mod_select, true);
- $form->addElement(new XoopsFormHidden('op', 'build'));
+ $checked_inroot = 0;
+ $check_install_inroot = new XoopsFormCheckBox(_AM_TDMCREATE_BUILD_INROOT, 'build_inroot', $checked_inroot);
+ $check_install_inroot->setDescription(_AM_TDMCREATE_BUILD_INROOT_DESC);
+ $check_install_inroot->addOption(1, ' ');
+ $form->addElement($check_install_inroot);
+
+ $install_inroot = ($check_inroot == 1) ? 1 : 0;
+
+ $form->addElement(new XoopsFormHidden('install_inroot', $install_inroot));
+ $form->addElement(new XoopsFormHidden('op', 'build'));
$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
$form->display();
- break;
+ break;
}
-include 'admin_footer.php';
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/fields.php 2013-10-02 16:08:49 UTC (rev 12120)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/fields.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -18,7 +18,7 @@
* @author Txmod Xoops <su...@tx...>
* @version $Id: 1.59 fields.php 11297 2013-03-24 10:58:10Z timgno $
*/
-include "admin_header.php";
+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');
@@ -27,16 +27,62 @@
$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();
- echo $adminMenu->addNavigation('fields.php');
- $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
- $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
- echo $adminMenu->renderButton();
- echo '<div class="center errorMsg">Add, Edit or List View in Tables</div><br />';
+ $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':
@@ -85,4 +131,4 @@
$form->display();
break;
}
-include 'admin_footer.php';
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/footer.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/footer.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -0,0 +1,25 @@
+<?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 admin_footer.php 11297 2013-03-24 10:58:10Z timgno $
+ */
+$fsname = $GLOBALS['xoopsModule']->getInfo('support_name');
+echo "<div align='center'><a href='http://www.xoops.org' target='_blank'>
+ <img src='".$pathIcon32."/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a></div>";
+ echo "<div class='center pad5'>" . sprintf(_AM_TDMCREATE_MAINTAINEDBY, $GLOBALS['xoopsModule']->getVar('dirname'), $GLOBALS['xoopsModule']->getInfo('support_url'), $fsname, $fsname) . "</div>";
+xoops_cp_footer();
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/header.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/header.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -0,0 +1,61 @@
+<?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 admin_header.php 11297 2013-03-24 10:58:10Z timgno $
+ */
+include_once dirname(dirname(dirname(dirname(__FILE__)))).'/include/cp_header.php';
+
+$dirname = $GLOBALS['xoopsModule']->getVar('dirname');
+include_once $GLOBALS['xoops']->path('modules/'.$dirname.'/include/common.php');
+include_once $GLOBALS['xoops']->path('modules/'.$dirname.'/include/functions.php');
+include_once $GLOBALS['xoops']->path('modules/'.$dirname.'/admin/includes.php');
+
+$pathIcon16 = XOOPS_URL.'/'.$GLOBALS['xoopsModule']->getInfo('icons16');
+$pathIcon32 = XOOPS_URL.'/'.$GLOBALS['xoopsModule']->getInfo('icons32');
+$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
+
+$modulesHandler=& xoops_getModuleHandler('modules', $dirname);
+$tablesHandler=& xoops_getModuleHandler('tables', $dirname);
+$fieldsHandler=& xoops_getModuleHandler('fields', $dirname);
+$fieldtypeHandler=& xoops_getModuleHandler('fieldtype', $dirname);
+$fieldattributesHandler=& xoops_getModuleHandler('fieldattributes', $dirname);
+$fieldnullHandler=& xoops_getModuleHandler('fieldnull', $dirname);
+$fieldkeyHandler=& xoops_getModuleHandler('fieldkey', $dirname);
+$fieldelementsHandler=& xoops_getModuleHandler('fieldelements', $dirname);
+
+$myts =& MyTextSanitizer::getInstance();
+
+if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
+ include_once(XOOPS_ROOT_PATH . "/class/template.php");
+ $xoopsTpl = new XoopsTpl();
+}
+
+$xoopsTpl->assign('pathIcon16', $pathIcon16);
+$xoopsTpl->assign('pathIcon32', $pathIcon32);
+//Load languages
+xoops_loadLanguage('admin', $dirname);
+xoops_loadLanguage('modinfo', $dirname);
+xoops_loadLanguage('main', $dirname);
+
+// Locad admin menu class
+if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){
+ include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
+}else{
+ redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
+}
+$adminMenu = new ModuleAdmin();
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/index.php 2013-10-02 16:08:49 UTC (rev 12120)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/index.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -18,7 +18,7 @@
* @author Txmod Xoops <su...@tx...>
* @version $Id: 1.59 index.php 11297 2013-03-24 10:58:10Z timgno $
*/
-include "admin_header.php";
+include 'header.php';
xoops_cp_header();
//count "total modules"
$count_mods = $modulesHandler->getCount();
@@ -29,6 +29,6 @@
$adminMenu->addInfoBox(_AM_TDMCREATE_STATISTICS);
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_STATISTICS,_AM_TDMCREATE_THEREARE_NUMMODULES, $count_mods, ($count_mods == 0) ? $r : $g);
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_STATISTICS,_AM_TDMCREATE_THEREARE_NUMTABLES, $count_tbls, ($count_tbls == 0) ? $r : $g);
- echo $adminMenu->addNavigation("index.php");
+ echo $adminMenu->addNavigation('index.php');
echo $adminMenu->renderIndex();// Render Index
-include "admin_footer.php";
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/modules.php 2013-10-02 16:08:49 UTC (rev 12120)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/modules.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -18,7 +18,7 @@
* @author Txmod Xoops <su...@tx...>
* @version $Id: 1.59 modules.php 11297 2013-03-24 10:58:10Z timgno $
*/
-include 'admin_header.php';
+include 'header.php';
// Recovered the value of the argument op in the URL $
$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
@@ -30,7 +30,7 @@
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
$xoopsOption['template_main'] = 'tdmcreate_modules.html';
- xoops_cp_header();
+ 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());
@@ -40,7 +40,7 @@
$criteria->setOrder('ASC');
$numrows = $modulesHandler->getCount();
$mods_arr = $modulesHandler->getAll( $criteria );
- unset($criteria);
+ unset($criteria);
// Display modules list
if ($numrows>0)
{
@@ -96,7 +96,9 @@
$obj =& $modulesHandler->create();
}
//Form module save
- $obj->setVars(array('mod_name' => $_POST['mod_name'], 'mod_version' => $_POST['mod_version'],
+ $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'],
@@ -178,4 +180,4 @@
}
break;
}
-include 'admin_footer.php';
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/tables.php 2013-10-02 16:08:49 UTC (rev 12120)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/tables.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -18,7 +18,7 @@
* @author Txmod Xoops <su...@tx...>
* @version $Id: 1.59 tables.php 11297 2013-03-24 10:58:10Z timgno $
*/
-include 'admin_header.php';
+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);
@@ -26,7 +26,7 @@
{
case 'list':
default:
- $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
+ $limit = xoops_getModuleOption('adminperpage');
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
$xoopsOption['template_main'] = 'tdmcreate_tables.html';
@@ -54,19 +54,19 @@
// Display modules list
if ( $numrows_modules > 0 )
{
- $_yes = "<img src='../images/icons/16/yellow.png' alt='"._YES."' title='"._YES."' />";
+ $_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 ) ? $_yes : $_no;
- $mod['user'] = ( $mods_arr[$i]->getVar('mod_user') == 1 ) ? $_yes : $_no;
- $mod['submenu'] = ( $mods_arr[$i]->getVar('mod_submenu') == 1 ) ? $_yes : $_no;
- $mod['search'] = ( $mods_arr[$i]->getVar('mod_search') == 1 ) ? $_yes : $_no;
- $mod['comments'] = ( $mods_arr[$i]->getVar('mod_comments') == 1 ) ? $_yes : $_no;
- $mod['notifications'] = ( $mods_arr[$i]->getVar('mod_notifications') == 1 ) ? $_yes : $_no;
+ $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;
// Get the list of tables
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $i));
@@ -101,8 +101,7 @@
$mod['tables'] = $tables;
$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);
@@ -111,7 +110,7 @@
} else {
$xoopsTpl->assign('error', 'There aren\'t modules');
}
- break;
+ break;
case 'new':
// Define main template
@@ -122,7 +121,7 @@
$xoopsTpl->assign('button_new', $adminMenu->renderButton());
$obj =& $tablesHandler->create();
- $form = $obj->getForm();
+ $form = $obj->getForm();
$xoopsTpl->assign('form', $form->render());
break;
@@ -140,6 +139,10 @@
$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));
@@ -150,8 +153,8 @@
}else{
$uploaddir = TDMC_UPLOAD_PATH.'/images/tables';
}
- $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['table_image']['name']);
$name_img = $_GET['table_name'].'.'.$extension;
@@ -159,7 +162,7 @@
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
$errors = $uploader->getErrors();
- redirect_header('javascript:history.go(-1)',3, $errors);
+ redirect_header('javascript:history.go(-1)', 3, $errors);
} else {
$obj->setVar('table_image', $uploader->getSavedFileName());
}
@@ -177,16 +180,16 @@
if( $tablesHandler->insert($obj) ) {
if( $obj->isNew() ) {
$tid = $GLOBALS['xoopsDB']->getInsertId();
- redirect_header('fields.php?op=new&field_tid='.$tid.'&field_mid='.$table_mid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname, 3, _AM_TDMCREATE_FORMOK);
+ redirect_header('fields.php?op=new&field_tid='.$tid, 3, _AM_TDMCREATE_FORMOK);
} else {
redirect_header('tables.php', 3, _AM_TDMCREATE_FORMOK);
}
- }
+ }
$xoopsTpl->assign('error', $obj->getHtmlErrors());
$form = $obj->getForm();
$xoopsTpl->assign('form', $form->render());
- break;
+ break;
case 'edit':
// Define main template
@@ -199,7 +202,7 @@
$obj = $tablesHandler->get($_REQUEST['table_id']);
$form = $obj->getForm();
$xoopsTpl->assign('form', $form->render());
- break;
+ break;
case 'delete':
$obj =& $tablesHandler->get($_REQUEST['table_id']);
@@ -215,6 +218,6 @@
} 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;
}
-include 'admin_footer.php';
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldattributes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldattributes.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldattributes.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -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.59/TDMCreate/class/fieldelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldelements.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldelements.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -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.59/TDMCreate/class/fieldkey.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldkey.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldkey.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -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.59/TDMCreate/class/fieldnull.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldnull.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldnull.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -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
Added: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fields.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fields.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -0,0 +1,215 @@
+<?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 $
+ */
+if (!defined('XOOPS_ROOT_PATH')) { die("XOOPS root path not defined"); }
+
+class TDMCreateFields extends XoopsObject
+{
+ //Constructor
+ function __construct()
+ {
+ $this->XoopsObject();
+ $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_numb', XOBJ_DTYPE_INT);
+ $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_admin', XOBJ_DTYPE_INT);
+ $this->initVar('field_user', XOBJ_DTYPE_INT);
+ $this->initVar('field_blocks', XOBJ_DTYPE_INT);
+ $this->initVar('field_mainfield', XOBJ_DTYPE_INT);
+ $this->initVar('field_search', XOBJ_DTYPE_INT);
+ $this->initVar('field_required', XOBJ_DTYPE_INT);
+ }
+
+ function TDMCreateFields()
+ {
+ $this->__construct();
+ }
+
+ 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);
+
+ $tablesHandler = xoops_getModuleHandler('tables');
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('table_mid', $table_mid));
+ $criteria->setSort('table_name');
+ $criteria->setOrder('ASC');
+ $tables_arr = $tablesHandler->getall($criteria);
+ unset($criteria);
+
+ include_once(XOOPS_ROOT_PATH.'/class/xoopsformloader.php');
+ include_once(XOOPS_ROOT_PATH.'/modules/TDMCreate/class/themeform.php');
+
+ $headers = 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);
+ // $act = 'save&field_tid='.$tid.'&field_numb='.$tfn.'&field_name='.$tfname; .'?op='.$act
+ $form = new TDMCreateThemeForm($title, $headers, 'form', $action, 'post', true);
+ $form->setExtra('enctype="multipart/form-data"');
+
+ if (!$this->isNew()) {
+ $form->addElement(new XoopsFormHidden('field_mid', $this->getVar('field_mid')));
+ } else {
+ $form->addElement(new XoopsFormHidden('field_mid', $table_mid));
+ }
+
+ if (!$this->isNew()) {
+ $form->addElement(new XoopsFormHidden('field_tid', $this->getVar('field_tid')));
+ } else {
+ $form->addElement(new XoopsFormHidden('field_tid', $table_id));
+ }
+
+ if (!$this->isNew()) {
+ $nbfields = $this->getVar('field_numb');
+ } else {
+ $nbfields = $table_nbfields;
+ }
+ include_once(XOOPS_ROOT_PATH.'/modules/TDMCreate/class/htmltable.php');
+ // New Object HtmlTable
+ $tableForm = new TDMCreateHtmlTable(null, 'display outer');
+
+ for($i = 1; $i <= $nbfields; $i++)//3
+ {
+ $field_value = ( $i == 1 ) ? '8' : $this->getVar('field_value');
+ $fieldname = $this->isNew() ? $table_fieldname : $this->getVar('field_name');
+ $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$i.']', 10, 50, $fieldname);
+ // fieldtype
+ $fieldtypeHandler=& xoops_getModuleHandler('tdmcreate_fieldtype');
+ $fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type['.$i.']', $this->getVar('field_type'));
+ $fieldtype_select->addOptionArray($fieldtypeHandler->getList());
+ // fieldvalue
+ $field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value['.$i.']', 3, 5, $field_value);
+ // fieldattributes
+ $fieldattrsHandler=& xoops_getModuleHandler('tdmcreate_fieldattributes');
+ $field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute['.$i.']', $this->getVar('field_attribute'));
+ $field_attributes_select->addOptionArray($fieldattrsHandler->getList());
+ // fieldnull
+ $fieldnullHandler=& xoops_getModuleHandler('tdmcreate_fieldnull');
+ $field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL, 'field_null['.$i.']', $this->getVar('field_null'));
+ $field_null_select->addOptionArray($fieldnullHandler->getList());
+ // fielddefault
+ $field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT, 'field_default['.$i.']', 15, 25, $this->getVar('field_default'));
+ // fieldkey
+ $fieldkeyHandler=& xoops_getModuleHandler('tdmcreate_fieldkey');
+ $field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key['.$i.']', $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());
+ // data row
+ $tableForm->addRow('center bgyellow');
+ $tableForm->addCells($tableFormDataArray, 'first', 'data');
+ $tableOtherForm = new TDMCreate_HtmlTable(null, 'display');
+ if($i == 1) {
+ $field_autoincrement = $this->isNew() ? 0 : $this->getVar('field_auto_increment');
+ $check_field_autoincrement = new XoopsFormCheckBox(' ', 'field_auto_increment['.$i.']', $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) {
+ // Box header row
+ $tableOtherForm->addRow('center bgyellow');
+ $tableOtherForm->addCell(_AM_TDMCREATE_FIELD_ELEMENTS, 'first', 'header');
+ // fieldelements
+ $fieldelementsHandler=& xoops_getModuleHandler('tdmcreate_fieldelements');
+ $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element_name['.$i.']', $this->getVar('field_element_name'));
+ $field_elements_select->addOptionArray($fieldelementsHandler->getList());
+ foreach (array_keys($tables_arr) as $j)
+ {
+ $tables_name = $tables_arr[$j]->getVar('table_name');
+ if ( $j[$i] == 'XoopsFormTables-'.$tables_name ) {
+ $field_elements_select->addOption('XoopsFormTables-'.$tables_name, 'Table : '.$tables_name);
+ }
+ }
+ // data row
+ $tableOtherForm->addRow();
+ $tableOtherForm->addCell($field_elements_select->render(), null, 'data');
+ $field_admin = $this->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);
+ // data row
+ $tableOtherForm->addRow();
+ $tableOtherForm->addCell($check_field_admin->render(), null, 'data');
+ $field_user = $this->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);
+ // data row
+ $tableOtherForm->addRow();
+ $tableOtherForm->addCell($check_field_user->render(), null, 'data');
+ $field_blocks = $this->isNew() ? 0 : $this->getVar('field_blocks');
+ $check_field_blocks = new XoopsFormCheckBox(' ', 'field_blocks['.$i.']', $field_blocks);
+ $check_field_blocks->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
+ // data row
+ $tableOtherForm->addRow();
+ $tableOtherForm->addCell($check_field_blocks->render(), null, 'data');
+ $field_mnfield = $this->isNew() ? 0 : $this->getVar('field_mainfield');
+ $field_mainfield = new XoopsFormRadio(' ', 'field_mainfield['.$i.']', $field_mnfield);
+ $field_mainfield->addOption( $i, _AM_TDMCREATE_FIELD_MAINFIELD );
+ $checked_field_mainfield = ( $i == 1 ) ? ' checked' : '';
+ $field_mainfield->setExtra($checked_field_mainfield);
+ // data row
+ $tableOtherForm->addRow();
+ $tableOtherForm->addCell($field_mainfield->render(), null, 'data');
+ $field_search = $this->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);
+ // data row
+ $tableOtherForm->addRow();
+ $tableOtherForm->addCell($check_field_search->render(), null, 'data');
+ $field_required = $this->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);
+ // data row
+ $tableOtherForm->addRow();
+ $tableOtherForm->addCell($check_field_required->render(), null, 'data');
+ }
+ $tableForm->addCell($tableOtherForm->display(), null, 'data');
+ }
+
+ if (!$this->isNew()) {
+ $form->addElement(new XoopsFormHidden('field_id', $this->getVar('field_id')));
+ }
+
+ $form->addElement(new XoopsFormHidden('op', 'save'));
+ $tableFormButton = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
+ $tableForm->addRow('txtright grey');
+ $tableForm->addCell($tableFormButton->render(), null, 'data');
+ $form->addElement($tableForm->display());
+ return $form;
+ }
+}
+class TDMCreateFieldsHandler extends XoopsPersistableObjectHandler
+{
+ function __construct(&$db)
+ {
+ parent::__construct($db, 'mod_tdmcreate_fields', 'tdmcreatefields', 'field_id', 'field_name');
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldtype.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldtype.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/fieldtype.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -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 fieldtype.php 11297 2013-03-24 10:58:10Z timgno $
+ */
+if (!defined('XOOPS_ROOT_PATH')) { die("XOOPS root path not defined"); }
+
+class TDMCreateFieldtype extends XoopsObject
+{
+ //Constructor
+ function __construct()
+ {
+ $this->XoopsObject();
+ $this->initVar('fieldtype_value', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('fieldtype_name', XOBJ_DTYPE_TXTBOX);
+ }
+
+ //Constructor
+ function TDMCreateFieldtype()
+ {
+ $this->__construct();
+ }
+}
+class TDMCreateFieldtypeHandler extends XoopsPersistableObjectHandler
+{
+ function __construct(&$db)
+ {
+ parent::__construct($db, 'mod_tdmcreate_fieldtype', 'tdmcreatefieldtype', 'fieldtype_value', 'fieldtype_name');
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/htmltable.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/htmltable.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/class/htmltable.php 2013-10-03 07:03:28 UTC (rev 12121)
@@ -0,0 +1,192 @@
+<?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 PARTIC...
[truncated message content] |