|
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->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_module", 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_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('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);
}
+
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @static function getForm
+ * @param mixed $action
+ */
public function getForm($action = false)
{
if ($action === false) {
- $action = $_SERVER["REQUEST_URI"];
+ $action = $_SERVER['REQUEST_URI'];
}
$title = $this->isNew() ? sprintf(_AM_TDMCREATE_FIELD_ADD) : sprintf(_AM_TDMCREATE_FIELD_EDIT);
- include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php");
- include_once(XOOPS_ROOT_PATH."/modules/TDMCreate/class/tdmcreate_themeform.php");
- $form = new TDMCreate_XoopsThemeForm($title, "form", $action, "post", true);
+ include_once(XOOPS_ROOT_PATH.'/class/xoopsformloader.php');
+ include_once(XOOPS_ROOT_PATH.'/modules/TDMCreate/class/tdmcreate_themeform.php');
+ $form = new TDMCreateThemeForm($title, 'form', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
if (!$this->isNew()) {
- $field_table = $this->getVar('field_table');
+ $field_tid = $this->getVar('field_tid');
} else {
- $field_table = array( 1 => 0 );
+ $field_tid = array( 1 => 0 );
}
//$option_tray = new XoopsFormElementTray(' ');
//$option_tray->setExtra('colspan="2"');//_AM_TDMCREATE_FIELD_TYPE
// New Object HtmlTable
- $tableForm = new TDMCreate_HtmlTable(null, 'display outer');
+ $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('tdmcreate_tables');
+ $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");
- $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, "field_name", 15, 255, $field_name);
+ $field_name = $this->isNew() ? $this->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('tdmcreate_fieldtype');
- $fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, "field_type", $this->getVar("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
- $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', 5, 20, $this->getVar('field_value'));
// fieldattributes
- $fieldattrsHandler=& xoops_getModuleHandler('tdmcreate_fieldattributes');
- $field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, "field_attribute", $this->getVar("field_attribute"));
- $field_attributes_select->addOptionArray($fieldattrsHandler->getList());
+ $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('tdmcreate_fieldnull');
- $field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL, "field_null", $this->getVar("field_null"));
- $field_null_select->addOptionArray($fieldnullHandler->getList());
+ $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_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', 15, 25, $this->getVar('field_default'));
// fieldkey
- $fieldkeyHandler=& xoops_getModuleHandler('tdmcreate_fieldkey');
- $field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, "field_key", $this->getVar("field_key"));
- $field_key_select->addOptionArray($fieldkeyHandler->getList());
+ $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
$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');
+ $tableOtherForm = new TDMCreateHtmlTable(null, 'display');
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_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();
@@ -132,8 +158,8 @@
$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', $this->getVar("field_element_name"));
+ $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')));
@@ -151,38 +177,38 @@
// data row
$tableOtherForm->addRow();
$tableOtherForm->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);
+ $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);
// data row
$tableOtherForm->addRow();
$tableOtherForm->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);
+ $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);
// data row
$tableOtherForm->addRow();
$tableOtherForm->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);
+ $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);
// data row
$tableOtherForm->addRow();
$tableOtherForm->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_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');
- $field_search = $this->isNew() ? 0 : $this->getVar("field_search");
- $check_field_search = new XoopsFormCheckBox(" ", "field_search", $field_search);
+ $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
$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", $field_required);
+ $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();
@@ -201,13 +227,13 @@
$form->addElement(new XoopsFormHidden('fields_modified', true));
}
- $form->addElement(new XoopsFormHidden("op", "save_fields"));
- $form->addElement(new XoopsFormHidden("field_table", $this->getVar("field_table")));
- $form->addElement(new XoopsFormButton("", "submit", _SUBMIT, "submit"));*/
- $tableFormButton = new XoopsFormButton("", "submit", _SUBMIT, "submit");
+ $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(new XoopsFormHidden('op', 'save_fields'));
$form->addElement($tableForm);
$form->addElement($tableFormButton);
return $form;
@@ -217,6 +243,6 @@
{
function __construct(&$db)
{
- parent::__construct($db, "mod_tdmcreate_fields", "tdmcreatefields", "field_id", "field_table");
+ 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/fieldtype.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldtype.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fieldtype.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 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
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-19 17:46:49 UTC (rev 12397)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -74,12 +74,12 @@
* @param string $module
*/
public function getArchitectureFiles( $module )
- {
- $indexFile = $this->upload_path.'/index.html';
- $fdocs = $this->upload_path.'/docs';
- $fimages = $this->upload_path.'/images';
+ {
+ $indexFile = $this->path.'/index.html';
//Creation of the Directory of modules
- $targetDirectory = $this->upload_path.'/'. str_replace(' ', '', strtolower($module->getVar('mod_name')));
+ $targetDirectory = $this->upload_path.'/'. str_replace(' ', '', strtolower($module->getVar('mod_name')));
+ $upload_folder_docs = $targetDirectory.'/docs';
+ $upload_folder_images = $targetDirectory.'/images';
// Creation of "module" folder
$this->structure->getPath($targetDirectory);
@@ -97,7 +97,7 @@
$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.'/modules/'.$mod_image, $mod_image);
+ $this->structure->copyFile('images', $upload_folder_images.'/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');
@@ -106,13 +106,13 @@
// Creation of "images/icons/32" folder and index.html file
$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', $upload_folder_images.'/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', $upload_folder_images.'/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', $upload_folder_images.'/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', $upload_folder_images.'/txmodxoops_logo.png', 'txmodxoops_logo.png');
// Creation of 'docs' folder and index.html file
$this->structure->makeDirAndCopyFile('docs', $indexFile, 'index.html');
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-19 17:46:49 UTC (rev 12397)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -132,8 +132,8 @@
*/
public function makeDirAndCopyFile($folder_name, $from_file, $to_file)
{
- $fname = $this->folderPath($folder_name);
- $this->makeDir($fname);
+ $dname = $this->folderPath($folder_name);
+ $this->makeDir($dname);
$this->copyFile($folder_name, $from_file, $to_file);
}
/*
@@ -169,13 +169,13 @@
* @public function deleteFolders
* @param string $path
*/
- public function deleteFolders($path)
+ public function deleteFolders($path, $folders = array())
{
$deleteFolders = 0;
// folder open/read
$folderHandler = $this->xoopsfile->getHandler('folder', $path);
- foreach($log_files as $older) {
- $folderHandler->__construct($older, false);
+ foreach($folders as $folder) {
+ $folderHandler->__construct($folder, false);
if (!$folderHandler->exists()) {
$this->setErrors("({$folder}) folder not exist");
continue;
@@ -193,12 +193,12 @@
* @public function deleteFiles
* @param string $path
*/
- public function deleteFiles($path)
+ public function deleteFiles($path, $files = array())
{
$deletedFiles = 0;
// file open/read
$fileHandler = $this->xoopsfile->getHandler('file', $path);
- foreach($log_files as $file) {
+ foreach($files as $file) {
$fileHandler->__construct($file, false);
if (!$fileHandler->exists()) {
$this->setErrors("({$file}) is a folder or not exist");
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -0,0 +1,212 @@
+<?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: htmltable.php 12258 2014-01-02 09:33:29Z timgno $
+*/
+if (!defined('XOOPS_ROOT_PATH')) { die("XOOPS root path not defined"); }
+
+/**
+ * Base class for html tables
+ *
+ * @author TXMod Xoops <in...@tx...>
+ * @package tdmcreate
+ * @access public
+ */
+xoops_load('XoopsFormElement');
+class TDMCreateHtmlTable extends XoopsFormElement
+{
+ /**
+ * array of {@link XoopsFormElement} objects
+ *
+ * @var array
+ */
+ var $rows = array();
+
+ /**
+ * "tStr" string of the table
+ *
+ * @var string
+ */
+ var $tStr = '';
+
+ /**
+ * constructor
+ *
+ * @param null
+ */
+ public function __construct()
+ {
+ }
+
+ /*
+ * @public static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+
+ /**
+ * @public Function initTable
+ *
+ * @param string $id attribute of the table
+ * @param string $_class "css class" attribute for the <table> tag
+ * @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
+ */
+ public function initTable($id = '', $_class = '', $border = 0, $cellspacing = 2, $cellpadding = 0, $attrs = 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 . '">';
+ }
+
+ /**
+ * return key & value of attributes
+ *
+ * @param array $attrs
+ * @return string
+ */
+ public function addAttributes( $attrs )
+ {
+ $str = '';
+ if (is_array( $attrs )) {
+ foreach( $attrs as $k => $v ) {
+ $str .= " {$k}=\"{$v}\"";
+ }
+ }
+ return $str;
+ }
+
+ /**
+ * Add an element row to the table
+ *
+ * @param string $_class
+ * @param array $attrs
+ */
+ public function addRow($class = '', $attrs = array() )
+ {
+ $row = self::addTableRow( $class, $attrs );
+ array_push( $this->rows, $row );
+ }
+
+ /**
+ * Add an element cell to the table
+ *
+ * @param object $data reference to a {@link XoopsFormElement}
+ * @param string $_class css element
+ * @param string $type reference to a header or data
+ * @param array $attrs attributes for a cell
+ */
+ public function addCell($data, $class = '', $type = 'data', $attrs = array() )
+ {
+ $cell = self::addTableCell( $data, $class, $type, $attrs );
+ // add new cell to current row's list of cells
+ $curRow =& $this->rows[ count( $this->rows ) - 1 ]; // copy by reference
+ array_push( $curRow->cells, $cell );
+ }
+
+ /**
+ * Add an array of cells
+ *
+ * @param object $data reference to a {@link XoopsFormElement}
+ * @param string $_class css element
+ * @param string $type reference to a header or data
+ * @param array $attrs attributes for a cell
+ */
+ public function addCells($data, $class = '', $type = 'data', $attrs = array() )
+ {
+ foreach( $data as $data_cell )
+ {
+ $this->addCell($data_cell, $class, $type, $attrs );
+ }
+ }
+
+ /**
+ * get an array of row & cells
+ *
+ * @param cells $cells elements
+ * @return array - array of RowCells
+ */
+ public function getRowCells($cells)
+ {
+ $str = '';
+ foreach( $cells as $cell )
+ {
+ $tag = ($cell->type == 'data')? 'td': 'th';
+ $str .= !empty($cell->_class) ? '<' . $tag . ' class="' . $cell->_class . '"' : '<' . $tag;
+ $str .= $this->addAttributes( $cell->attrs ) . '>';
+ $str .= $cell->data;
+ $str .= '</' . $tag . '>';
+ }
+ return $str;
+ }
+
+ /**
+ * Add Row for tables
+ *
+ * @author TXMod Xoops <in...@tx...>
+ * @package tdmcreate
+ * @access private
+ */
+ public function addTableRow($class = '', $attrs = array())
+ {
+ $this->_class = $class;
+ $this->attrs = $attrs;
+ $this->cells = array();
+ }
+
+ /**
+ * Add Cell for tables
+ *
+ * @author TXMod Xoops <in...@tx...>
+ * @package tdmcreate
+ * @access private
+ */
+ public function addTableCell( $data, $class = '', $type = '', $attrs = array())
+ {
+ $this->data = $data;
+ $this->_class = $class;
+ $this->type = $type;
+ $this->attrs = $attrs;
+ }
+
+ /**
+ * displays rendered table
+ */
+ public function display()
+ {
+ foreach( $this->rows as $row )
+ {
+ $this->tStr .= !empty($row->_class) ? '<tr class="' . $row->_class . '"' : '<tr';
+ $this->tStr .= $this->addAttributes( $row->attrs ) . '>';
+ $this->tStr .= $this->getRowCells( $row->cells );
+ $this->tStr .= '</tr>';
+ }
+ $this->tStr .= '</table>';
+ return $this->tStr;
+ }
+}
\ 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-03-19 17:46:49 UTC (rev 12397)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-03-19 18:20:48 UTC (rev 12398)
@@ -23,53 +23,76 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
//include_once 'iconGenerator.php';
-
+/*
+* @Class TDMCreateModules
+* @extends XoopsObject
+*/
class TDMCreateModules extends XoopsObject
{
- // constructor
- function __construct()
+ /*
+ * @public function constructor class
+ * @param null
+ */
+ public function __construct()
{
$this->XoopsObject();
- $this->initVar('mod_id',XOBJ_DTYPE_INT, 0);
- $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_id',XOBJ_DTYPE_INT);
+ $this->initVar('mod_name',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('name'));
+ $this->initVar('mod_version',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('version'));
+ $this->initVar('mod_since',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('since'));
+ $this->initVar...
[truncated message content] |