|
From: <txm...@us...> - 2014-03-23 19:52:28
|
Revision: 12402
http://sourceforge.net/p/xoops/svn/12402
Author: txmodxoops
Date: 2014-03-23 19:52:22 +0000 (Sun, 23 Mar 2014)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/logoGenerator.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/themeform.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_about.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_help.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_tables.html
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -22,7 +22,4 @@
$template_main = 'tdmcreate_about.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('about.php'));
$GLOBALS['xoopsTpl']->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false));
-if ( isset($template_main) ) {
- $GLOBALS['xoopsTpl']->display("db:{$template_main}");
-}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -57,7 +57,4 @@
$GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
}
-if ( isset($template_main) ) {
- $GLOBALS['xoopsTpl']->display("db:{$template_main}");
-}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -19,20 +19,20 @@
* @version $Id: fields.php 12258 2014-01-02 09:33:29Z timgno $
*/
include 'header.php';
-// Recovered the value of the argument op in the URL $
+// Recovered value of arguments op in the URL $
$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
-$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id', 0, 'int');
+// Get table Variables
$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id', 0, 'int');
+$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid', 0, 'int');
+$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields', 0, 'int');
+$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');
+// Get field Variables
$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id', 0, 'int');
-// Get table Variables
$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid', 0, 'int');
$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid', 0, 'int');
$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb', 0, 'int');
$field_name = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');
-/*$table_id = $_SESSION['field_tid'];
-$table_mid = $_SESSION['field_mid'];
-$table_nbfields = $_SESSION['field_numb'];
-$table_fieldname = $_SESSION['field_name'];*/
+//
switch ($op)
{
case 'list':
@@ -50,7 +50,7 @@
$GLOBALS['xoopsTpl']->assign('pathIcon32', $pathIcon32);
// Get the list of tables
$criteria = new CriteriaCompo();
- $criteria->add(new Criteria('table_mid', $_REQUEST['mod_id']));
+ $criteria->add(new Criteria('table_mid', $table_mid));
$criteria->setSort('table_id ASC, table_name');
$criteria->setOrder('ASC');
$nb_tables = $tablesHandler->getCount();
@@ -89,14 +89,14 @@
case 'new':
// Define main template
- $template_main = 'tdmcreate_tables.html';
+ $template_main = 'tdmcreate_fields.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('fields.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
$GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
$obj =& $fieldsHandler->create();
$form = $obj->getForm($table_id, $table_mid, $table_nbfields, $table_fieldname);
- $form->display();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'save':
@@ -109,24 +109,33 @@
$obj =& $fieldsHandler->create();
}
//Form fields
- $obj->setVars(array('field_mid' => $table_mid, 'field_tid' => $table_id, 'field_name' => $_POST['field_name'],
- 'field_numb' => $table_nbfields, 'field_type' => $_POST['field_type'],
- 'field_value' => $_POST['field_value'], 'field_attribute' => $_POST['field_attribute'],
- 'field_null' => $_POST['field_null'], 'field_default' => $_POST['field_default'],
- 'field_key' => $_POST['field_key'], 'field_elements' => $_POST['field_elements'],
+ $obj->setVars(array('field_mid' => $table_mid,
+ 'field_tid' => $table_id,
+ 'field_name' => $_POST['field_name'],
+ 'field_numb' => $table_nbfields,
+ 'field_type' => $_POST['field_type'],
+ 'field_value' => $_POST['field_value'],
+ 'field_attribute' => $_POST['field_attribute'],
+ 'field_null' => $_POST['field_null'],
+ 'field_default' => $_POST['field_default'],
+ 'field_key' => $_POST['field_key'],
+ 'field_elements' => $_POST['field_elements'],
'field_admin' => (($_REQUEST['field_admin'] == 1) ? '1' : '0'),
'field_user' => (($_REQUEST['field_user'] == 1) ? '1' : '0'),
'field_blocks' => (($_REQUEST['field_blocks'] == 1) ? '1' : '0'),
'field_mainfield' => (($_REQUEST['field_mainfield'] == 1) ? '1' : '0'),
'field_search' => (($_REQUEST['field_search'] == 1) ? '1' : '0'),
- 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0')));
+ 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0')),
+ 'field_fields' => $_POST['field_fields'],
+ 'field_parameters' => $_POST['field_parameters']
+ );
if ($fieldsHandler->insert($obj)) {
redirect_header('tables.php', 2, _AM_TDMCREATE_FORMOK);
}
echo $obj->getHtmlErrors();
$form = $obj->getForm();
- $form->display();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'edit':
@@ -137,11 +146,8 @@
$GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
$obj = $fieldsHandler->get($field_id);
- $form = $obj->getForm($table_id, $table_mid, $table_nbfields, $table_fieldname);
- $form->display();
+ $form = $obj->getForm($field_tid, $field_mid, $field_numb, $field_name);
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
}
-if ( isset($template_main) ) {
- $GLOBALS['xoopsTpl']->display("db:{$template_main}");
-}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/footer.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -18,7 +18,9 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: footer.php 12207 2013-10-23 02:46:52Z beckmi $
*/
-
-$xoopsTpl->assign('module_name', $xoopsModule->getVar('name'));
+$GLOBALS['xoopsTpl']->assign('module_name', $GLOBALS['xoopsModule']->getVar('name'));
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
xoops_cp_footer();
?>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -19,20 +19,15 @@
* @version $Id: index.php 11084 2013-02-23 15:44:20Z timgno $
*/
include 'header.php';
-
$criteria = new CriteriaCompo();
$count_modules = $modulesHandler->getCount($criteria);
$count_tables = $tablesHandler->getCount($criteria);
unset($criteria);
-
+$template_main = 'tdmcreate_index.html';
$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ;
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMMODULES. '</label>', $count_modules, 'Green') ;
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMTABLES. '</label>', $count_tables, 'Orange');
//$xoopsOption['template_main'] = 'tdmcreate_index.html';
$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('index.php'));
$GLOBALS['xoopsTpl']->assign('index', $adminMenu->renderIndex());
-$template_main = 'tdmcreate_index.html';
-if ( isset($template_main) ) {
- $GLOBALS['xoopsTpl']->display("db:{$template_main}");
-}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -22,7 +22,7 @@
// Recovered the value of the argument op in the URL $
$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
-switch ($op) http://localhost/xoops-2.5.7testTDMCreate1.91/Frameworks/moduleclasses/icons/32/user-icon.png
+switch ($op)
{
case 'list':
default:
@@ -177,7 +177,4 @@
}
break;
}
-if ( isset($template_main) ) {
- $GLOBALS['xoopsTpl']->display("db:{$template_main}");
-}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -19,9 +19,15 @@
* @version $Id: tables.php 12258 2014-01-02 09:33:29Z timgno $
*/
include 'header.php';
-// Recovered the value of the argument op in the URL $
+// Recovered value of arguments op in the URL $
$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
+//
$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id', 0);
+$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id', 0);
+$table_mid = TDMCreate_CleanVars($_REQUEST, 'table_mid', 0);
+$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'table_nbfields', 0);
+$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'table_fieldname', '', 'string');
+//
switch ($op)
{
case 'list':
@@ -128,23 +134,16 @@
if ( !$GLOBALS['xoopsSecurity']->check() ) {
redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
- $table_id = TDMCreate_CleanVars($_REQUEST, 'table_id', 0, 'int');
if (isset($table_id)) {
$obj =& $tablesHandler->get($table_id);
} else {
$obj =& $tablesHandler->create();
}
-
- $table_mid = intval($_REQUEST['table_mid']);
- $table_nbfields = intval($_REQUEST['table_nbfields']);
- $table_fieldname = strtolower($_REQUEST['table_fieldname']);
- $_SESSION['field_tid'] = $tid;
- $_SESSION['field_mid'] = $table_mid;
- $_SESSION['field_numb'] = $table_nbfields;
- $_SESSION['field_name'] = $table_fieldname;
//Form tables
- $obj->setVars(array('table_mid' => $table_mid, 'table_name' => $_POST['table_name'],
- 'table_nbfields' => $table_nbfields, 'table_fieldname' => $table_fieldname));
+ $obj->setVars(array('table_mid' => $table_mid,
+ 'table_name' => $_POST['table_name'],
+ 'table_nbfields' => $table_nbfields,
+ 'table_fieldname' => $table_fieldname));
//Form table_image
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
if(is_dir($pathIcon32)){
@@ -169,17 +168,17 @@
$obj->setVar('table_image', $_POST['table_image']);
}
$obj->setVars(array('table_blocks' => (($_REQUEST['table_blocks'] == 1) ? '1' : '0'),
- 'table_admin' => (($_REQUEST['table_admin'] == 1) ? '1' : '0'),
- 'table_user' => (($_REQUEST['table_user'] == 1) ? '1' : '0'),
- 'table_submenu' => (($_REQUEST['table_submenu'] == 1) ? '1' : '0'),
- 'table_search' => (($_REQUEST['table_search'] == 1) ? '1' : '0'),
- 'table_comments' => (($_REQUEST['table_comments'] == 1) ? '1' : '0'),
- 'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0')));
+ 'table_admin' => (($_REQUEST['table_admin'] == 1) ? '1' : '0'),
+ 'table_user' => (($_REQUEST['table_user'] == 1) ? '1' : '0'),
+ 'table_submenu' => (($_REQUEST['table_submenu'] == 1) ? '1' : '0'),
+ 'table_search' => (($_REQUEST['table_search'] == 1) ? '1' : '0'),
+ 'table_comments' => (($_REQUEST['table_comments'] == 1) ? '1' : '0'),
+ 'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0')));
if( $tablesHandler->insert($obj) ) {
if( $obj->isNew() ) {
- $tid = $GLOBALS['xoopsDB']->getInsertId();
- redirect_header('fields.php?op=new&field_tid='.$tid, 3, _AM_TDMCREATE_FORMOK);
+ $field_tid = $GLOBALS['xoopsDB']->getInsertId();
+ redirect_header('fields.php?op=new&field_tid='.$field_tid, 3, _AM_TDMCREATE_FORMOK);
} else {
redirect_header('tables.php', 3, _AM_TDMCREATE_FORMOK);
}
@@ -218,7 +217,4 @@
}
break;
}
-if ( isset($template_main) ) {
- $GLOBALS['xoopsTpl']->display("db:{$template_main}");
-}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -35,34 +35,24 @@
public function __construct()
{
$this->XoopsObject();
- $this->initVar('field_id', XOBJ_DTYPE_INT, null, false, 8);
- $this->initVar('field_tid', XOBJ_DTYPE_INT, null, false, 5);
- $this->initVar('field_name', XOBJ_DTYPE_TXTBOX, null, false, 255);
- $this->initVar('field_type', XOBJ_DTYPE_TXTBOX, null, false, 100);
- $this->initVar('field_value', XOBJ_DTYPE_TXTBOX, null, false, 4);
- $this->initVar('field_attribute', XOBJ_DTYPE_TXTBOX, null, false, 50);
- $this->initVar('field_null', XOBJ_DTYPE_TXTBOX, null, false, 10);
- $this->initVar('field_default', XOBJ_DTYPE_TXTBOX, null, false, 150);
- $this->initVar('field_key', XOBJ_DTYPE_TXTBOX, null, false, 10);
- $this->initVar('field_auto_increment', XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar('field_display_admin', XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar('field_display_user', XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar('field_display_block', XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar('field_mainfield', XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar('field_search', XOBJ_DTYPE_INT, null, false, 1);
- $this->initVar('field_required', XOBJ_DTYPE_INT, null, false, 1);
- // For relationship
- $this->initVar('table_id', XOBJ_DTYPE_INT, null, false, 8);
- $this->initVar('table_mid', XOBJ_DTYPE_INT, null, false, 5);
- $this->initVar('table_name', XOBJ_DTYPE_TXTBOX, null, false, 255);
- $this->initVar('table_nbfields', XOBJ_DTYPE_INT, null, false, 5);
- $this->initVar('table_fieldname', XOBJ_DTYPE_TXTBOX, null, false, 50);
- $this->initVar('table_fields', XOBJ_DTYPE_TXTAREA, null);
- $this->initVar('table_parameters', XOBJ_DTYPE_TXTAREA, null);
-
- $this->initVar('fieldtype_id', XOBJ_DTYPE_INT, null, false, 5);
- $this->initVar('fieldtype_value', XOBJ_DTYPE_TXTBOX, null, false, 25);
- $this->initVar('fieldtype_name', XOBJ_DTYPE_TXTBOX, null, false, 255);
+ $this->initVar('field_id', XOBJ_DTYPE_INT);
+ $this->initVar('field_tid', XOBJ_DTYPE_INT);
+ $this->initVar('field_name', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_type', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_value', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_attribute', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_null', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_default', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_key', XOBJ_DTYPE_TXTBOX);
+ $this->initVar('field_auto_increment', XOBJ_DTYPE_INT);
+ $this->initVar('field_display_admin', XOBJ_DTYPE_INT);
+ $this->initVar('field_display_user', XOBJ_DTYPE_INT);
+ $this->initVar('field_display_block', XOBJ_DTYPE_INT);
+ $this->initVar('field_mainfield', XOBJ_DTYPE_INT);
+ $this->initVar('field_search', XOBJ_DTYPE_INT);
+ $this->initVar('field_required', XOBJ_DTYPE_INT);
+ $this->initVar('field_fields',XOBJ_DTYPE_TXTAREA);
+ $this->initVar('field_parameters',XOBJ_DTYPE_TXTAREA);
}
/*
@@ -79,43 +69,45 @@
}
/*
- * @static function getForm
+ * @public function getForm
+ *
+ * @param integer $table_id
+ * @param integer $table_mid
+ * @param integer $table_nbfields
+ * @param string $table_fieldname
* @param mixed $action
*/
- public function getForm($action = false)
+ public function getForm($table_id = null, $table_mid = null, $table_nbfields = null, $table_fieldname = null, $action = false)
{
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
$title = $this->isNew() ? sprintf(_AM_TDMCREATE_FIELD_ADD) : sprintf(_AM_TDMCREATE_FIELD_EDIT);
-
+
+ if ($this->isNew()) {
+ $field_tid = $table_id;
+ $nb_fields = $table_nbfields;
+ } else {
+ $field_tid = $this->getVar('field_tid');
+ $nb_fields = $this->getVar('field_numb');
+ }
+
include_once(XOOPS_ROOT_PATH.'/class/xoopsformloader.php');
- include_once(XOOPS_ROOT_PATH.'/modules/TDMCreate/class/tdmcreate_themeform.php');
+ include_once(XOOPS_ROOT_PATH.'/modules/TDMCreate/class/themeform.php');
$form = new TDMCreateThemeForm($title, 'form', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
-
- if (!$this->isNew()) {
- $field_tid = $this->getVar('field_tid');
- } else {
- $field_tid = array( 1 => 0 );
- }
//$option_tray = new XoopsFormElementTray(' ');
//$option_tray->setExtra('colspan="2"');//_AM_TDMCREATE_FIELD_TYPE
-
+ $tablesHandler = xoops_getModuleHandler('tables');
// New Object HtmlTable
$tableForm = new TDMCreateHtmlTable(null, 'display outer');
// header row
$tableForm->addRow('center bgblue');
$cells = array(_AM_TDMCREATE_FIELD_NUMBER, _AM_TDMCREATE_FIELD_NAME, _AM_TDMCREATE_FIELD_TYPE, _AM_TDMCREATE_FIELD_VALUE, _AM_TDMCREATE_FIELD_ATTRIBUTE, _AM_TDMCREATE_FIELD_NULL, _AM_TDMCREATE_FIELD_DEFAULT, _AM_TDMCREATE_FIELD_KEY, _AM_TDMCREATE_FIELD_OTHERS);
$tableForm->addCells($cells, 'first', 'header');
-
- $tablesHandler = xoops_getModuleHandler('tables');
- $criteria = new CriteriaCompo(new Criteria('table_name', $this->getVar('table_name')));
- $criteria->add(new Criteria('table_nbfields', $this->getVar('table_nbfields')));
- $nb_fields = $tablesHandler->getAll($criteria);
- unset($criteria);
+
for($i = 1; $i <= count($nb_fields); $i++)
{
$field_name = $this->isNew() ? $this->getVar('table_fieldname') : $this->getVar('field_name');
@@ -161,11 +153,11 @@
$fieldelementsHandler=& xoops_getModuleHandler('fieldelements');
$field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element_name', $this->getVar('field_element_name'));
$field_elements_select->addOptionArray($fieldelementsHandler->getList());
- $criteria = new CriteriaCompo(new Criteria('table_id', $this->getVar('table_id')));
- $criteria->add(new Criteria('table_module', $this->getVar('table_module')));
+ $criteria = new CriteriaCompo(new Criteria('table_id', $table_id)));
+ $criteria->add(new Criteria('table_mid', $table_mid)));
$criteria->setSort('table_name');
$criteria->setOrder('ASC');
- $tbls_arr1 = $tablesHandler->getall($criteria);
+ $tbls_arr1 = $tablesHandler->getAll($criteria);
unset($criteria);
foreach (array_keys($tbls_arr1) as $j)
{
@@ -214,14 +206,14 @@
$tableOtherForm->addRow();
$tableOtherForm->addCell($check_field_required->render(), null, 'data');
}
- $tableForm->addCell($tableOtherForm->display(), null, 'data');
+ $tableForm->addCell($tableOtherForm->render(), null, 'data');
if (!$this->isNew()) {
$tableFormHiddenId = new XoopsFormHidden('table_id', $this->getVar('table_id'));
//$form->addElement(new XoopsFormHidden('fields_modified', true));
}
}
- $form->addElement($tableForm->display());
+ $form->addElement($tableForm->render());
/*if (!$this->isNew()) {
$form->addElement(new XoopsFormHidden('table_id', $this->getVar('table_id')));
$form->addElement(new XoopsFormHidden('fields_modified', true));
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmlform.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -0,0 +1,140 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.5
+ * @author Txmod Xoops <su...@tx...>
+ * @version $Id: 1.91 htmlform.php 11297 2014-03-22 10:19:18Z timgno $
+ */
+
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+/**
+ * Form HTML
+ *
+ */
+class HtmlForm
+{
+ /**
+ * name attribute
+ *
+ * @var string
+ */
+ private $name = null;
+
+ /**
+ * id attribute
+ *
+ * @var mixed
+ */
+ private $id = null;
+
+ /**
+ * action attribute
+ *
+ * @var mixed
+ */
+ private $action = null;
+
+ /**
+ * method attribute
+ *
+ * @var string
+ */
+ private $method = null;
+
+ /**
+ * display attribute
+ *
+ * @var bool
+ */
+ private $display = false;
+
+ /**
+ * hidden attribute
+ *
+ * @var bool
+ */
+ private $hidden = false;
+
+ /**
+ * constructor
+ *
+ */
+ public function __construct()
+ {
+ }
+
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+
+ /**
+ * Function getForm
+ *
+ * @param string $name "name" attribute for the <form> tag
+ * @param string $id "id" attribute for the <form> tag
+ * @param string $action "action" attribute for the <form> tag
+ * @param string $method "method" attribute for the <form> tag
+ * @param bool $extra whether to add a javascript to the form
+ * @param string $display "display" attribute for the <table> tag
+ * @param string $hidden "hidden" attribute for the <form> tag
+ */
+ public function getForm($name = null, $id = null, $action = false, $method = 'post', $extra = false, $display = false, $hidden = false)
+ {
+ $this->name = $name;
+ $this->id = $id;
+ $this->action = $action;
+ $this->method = $method;
+ $this->extra = $extra;
+ $this->display = $display;
+ $this->hidden = $hidden;
+ }
+
+ /**
+ * Function OpenForm
+ *
+ * @param null
+ */
+ public function getOpenForm()
+ {
+ $ret = '<form name="' . $this->name . '" id="' . $this->id . '" action="' . $this->action . '" method="' . $this->method . '" onsubmit="return xoopsFormValidate_' . $this->name . '();"' . $this->extra . '>' . NWLINE;
+ return $ret;
+ }
+
+ /**
+ * Function CloseForm
+ *
+ * @param null
+ */
+ public function getCloseForm()
+ {
+ if($this->display && $this->hidden) {
+ $ret = $this->display . NWLINE . ' ' . $this->hidden . '</form>' . NWLINE;
+ } else {
+ $ret = NWLINE . '</form>' . NWLINE;
+ }
+ return $ret;
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/htmltable.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -27,22 +27,57 @@
* @package tdmcreate
* @access public
*/
-xoops_load('XoopsFormElement');
-class TDMCreateHtmlTable extends XoopsFormElement
+//xoops_load('XoopsFormElement');
+class TDMCreateHtmlTable /*extends XoopsFormElement*/
{
/**
- * array of {@link XoopsFormElement} objects
+ * array of {@TDMCreateHtmlTable} objects
*
* @var array
*/
- var $rows = array();
+ private $rows = array();
/**
- * "tStr" string of the table
+ * array of {@link TDMCreateHtmlTable} objects
*
+ * @var array
+ */
+ private $cells = array();
+
+ /**
+ * string of {@link TDMCreateHtmlTable} objects
+ *
* @var string
*/
- var $tStr = '';
+ private $table_string = '';
+
+ /**
+ * string of {@link TDMCreateHtmlTable} objects
+ *
+ * @var string
+ */
+ private $data = '';
+
+ /**
+ * string of {@link TDMCreateHtmlTable} objects
+ *
+ * @var string
+ */
+ private $_class = '';
+
+ /**
+ * string of {@link TDMCreateHtmlTable} objects
+ *
+ * @var string
+ */
+ private $type = '';
+
+ /**
+ * array of {@link TDMCreateHtmlTable} objects
+ *
+ * @var array
+ */
+ private $attributes = array();
/**
* constructor
@@ -74,27 +109,27 @@
* @param int $border "border" attribute for the <table> tag
* @param int $cellspacing "cellspacing" attribute for the <table> tag
* @param int $cellpadding "cellpadding" attribute for the <table> tag
- * @param array $attrs attributes for the <table> tag
+ * @param array $attributes attributes for the <table> tag
*/
- public function initTable($id = '', $_class = '', $border = 0, $cellspacing = 2, $cellpadding = 0, $attrs = array() )
+ public function initTable($id = '', $_class = '', $border = 0, $cellspacing = 2, $cellpadding = 0, $attributes = array() )
{
- $this->tStr = '<table' . ( !empty($id) ? ' id="' . $id . '"' : '' );
- $this->tStr .= ( !empty($_class) ? ' class="' . $_class . '"' : '' );
- $this->tStr .= $this->addAttributes( $attrs );
- $this->tStr .= ' border="' . $border . '" cellspacing="' . $cellspacing . '" cellpadding="' . $cellpadding . '">';
+ $this->table_string = '<table' . ( !empty($id) ? ' id="' . $id . '"' : '' );
+ $this->table_string .= ( !empty($_class) ? ' class="' . $_class . '"' : '' );
+ $this->table_string .= $this->addAttributes( $attributes );
+ $this->table_string .= ' border="' . $border . '" cellspacing="' . $cellspacing . '" cellpadding="' . $cellpadding . '">';
}
/**
* return key & value of attributes
*
- * @param array $attrs
+ * @param array $attributes
* @return string
*/
- public function addAttributes( $attrs )
+ public function addAttributes( $attributes )
{
$str = '';
- if (is_array( $attrs )) {
- foreach( $attrs as $k => $v ) {
+ if (is_array( $attributes )) {
+ foreach( $attributes as $k => $v ) {
$str .= " {$k}=\"{$v}\"";
}
}
@@ -105,11 +140,12 @@
* Add an element row to the table
*
* @param string $_class
- * @param array $attrs
+ * @param array $attributes
*/
- public function addRow($class = '', $attrs = array() )
+ public function addRow($class = '', $attributes = array() )
{
- $row = self::addTableRow( $class, $attrs );
+ $row = self::getInstance();
+ $row->addTableRow( $class, $attributes );
array_push( $this->rows, $row );
}
@@ -117,16 +153,19 @@
* Add an element cell to the table
*
* @param object $data reference to a {@link XoopsFormElement}
- * @param string $_class css element
+ * @param string $class css element
* @param string $type reference to a header or data
- * @param array $attrs attributes for a cell
+ * @param array $attributes attributes for a cell
*/
- public function addCell($data, $class = '', $type = 'data', $attrs = array() )
+ public function addCell($data, $class = '', $type = 'data', $attributes = array() )
{
- $cell = self::addTableCell( $data, $class, $type, $attrs );
+ $cell = self::getInstance();
+ $cell->addTableCell( $data, $class, $type, $attributes );
// 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 );
+ if(isset($curRow->cells) && isset($cell)) {
+ array_push( $curRow->cells, $cell );
+ }
}
/**
@@ -135,13 +174,14 @@
* @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
+ * @param array $attributes attributes for a cell
*/
- public function addCells($data, $class = '', $type = 'data', $attrs = array() )
+ public function addCells($data, $class = '', $type = 'data', $attributes = array() )
{
- foreach( $data as $data_cell )
- {
- $this->addCell($data_cell, $class, $type, $attrs );
+ if (is_array($data)) {
+ foreach( $data as $data_cell ) {
+ $this->addCell($data_cell, $class, $type, $attributes );
+ }
}
}
@@ -154,11 +194,12 @@
public function getRowCells($cells)
{
$str = '';
- foreach( $cells as $cell )
+ $this->cells = $cells;
+ foreach( $this->cells as $cell )
{
$tag = ($cell->type == 'data')? 'td': 'th';
$str .= !empty($cell->_class) ? '<' . $tag . ' class="' . $cell->_class . '"' : '<' . $tag;
- $str .= $this->addAttributes( $cell->attrs ) . '>';
+ $str .= $this->addAttributes( $cell->attributes ) . '>';
$str .= $cell->data;
$str .= '</' . $tag . '>';
}
@@ -170,13 +211,15 @@
*
* @author TXMod Xoops <in...@tx...>
* @package tdmcreate
- * @access private
*/
- public function addTableRow($class = '', $attrs = array())
+ public function addTableRow($class = '', $attributes = null)
{
$this->_class = $class;
- $this->attrs = $attrs;
- $this->cells = array();
+ if(!is_array($attributes)){
+ $this->attributes[] = $attributes;
+ } else {
+ $this->attributes = $attributes;
+ }
}
/**
@@ -184,29 +227,28 @@
*
* @author TXMod Xoops <in...@tx...>
* @package tdmcreate
- * @access private
*/
- public function addTableCell( $data, $class = '', $type = '', $attrs = array())
+ public function addTableCell( $data, $class = '', $type = '', $attributes = array())
{
$this->data = $data;
$this->_class = $class;
$this->type = $type;
- $this->attrs = $attrs;
+ $this->attributes = $attributes;
}
/**
- * displays rendered table
+ * render html table
*/
- public function display()
+ public function render()
{
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->table_string .= !empty($row->_class) ? '<tr class="' . $row->_class . '"' : '<tr';
+ $this->table_string .= $this->addAttributes( $row->attributes ) . '>';
+ $this->table_string .= $this->getRowCells( $row->cells );
+ $this->table_string .= '</tr>';
}
- $this->tStr .= '</table>';
- return $this->tStr;
+ $this->table_string .= '</table>';
+ return $this->table_string;
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/logoGenerator.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/logoGenerator.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/logoGenerator.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -51,7 +51,7 @@
imagecopy($imageModule, $imageIcon, 29, 2, 0, 0, 32, 32);
- $targetImage = "/modules/" . $dirname . "/images/uploads/modules/".$moduleName."_slogo.png";
+ $targetImage = "/uploads/" . $dirname . "/images/modules/".$moduleName."_slogo.png";
imagepng($imageModule, XOOPS_ROOT_PATH . $targetImage );
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -37,42 +37,42 @@
{
$this->XoopsObject();
$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('mod_min_php',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('min_php'));
- $this->initVar('mod_min_xoops',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('min_xoops'));
- $this->initVar('mod_min_admin',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('min_admin'));
- $this->initVar('mod_min_mysql',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('min_mysql'));
- $this->initVar('mod_description',XOBJ_DTYPE_TXTAREA, xoops_getModuleOption('description'));
- $this->initVar('mod_author',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('author'));
- $this->initVar('mod_author_mail',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('author_email'));
- $this->initVar('mod_author_website_url',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('author_website_url'));
- $this->initVar('mod_author_website_name',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('author_website_name'));
- $this->initVar('mod_credits',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('credits'));
- $this->initVar('mod_license',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('license'));
- $this->initVar('mod_release_info',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('release_info'));
- $this->initVar('mod_release_file',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('release_file'));
- $this->initVar('mod_manual',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('manual'));
- $this->initVar('mod_manual_file',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('manual_file'));
+ $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_image',XOBJ_DTYPE_TXTBOX, null);
- $this->initVar('mod_demo_site_url',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('demo_site_url'));
- $this->initVar('mod_demo_site_name',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('demo_site_name'));
- $this->initVar('mod_support_url',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('support_url'));
- $this->initVar('mod_support_name',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('support_name'));
- $this->initVar('mod_website_url',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('website_url'));
- $this->initVar('mod_website_name',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('website_name'));
- $this->initVar('mod_release',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('release_date'));
- $this->initVar('mod_status',XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('status'));
- $this->initVar('mod_admin',XOBJ_DTYPE_INT,xoops_getModuleOption('display_admin'));
- $this->initVar('mod_user',XOBJ_DTYPE_INT, xoops_getModuleOption('display_user'));
- $this->initVar('mod_search',XOBJ_DTYPE_INT, xoops_getModuleOption('active_search'));
- $this->initVar('mod_comments',XOBJ_DTYPE_INT, xoops_getModuleOption('active_comments'));
- $this->initVar('mod_notifications', XOBJ_DTYPE_INT, xoops_getModuleOption('active_notifications'));
- $this->initVar('mod_permissions', XOBJ_DTYPE_INT, xoops_getModuleOption('active_permissions'));
- $this->initVar('mod_install', XOBJ_DTYPE_INT, xoops_getModuleOption('inroot_install'));
- $this->initVar('mod_donations', XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('donations'));
- $this->initVar('mod_subversion', XOBJ_DTYPE_TXTBOX, xoops_getModuleOption('subversion'));
+ $this->initVar('mod_demo_site_url',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['demo_site_url']);
+ $this->initVar('mod_demo_site_name',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['demo_site_name']);
+ $this->initVar('mod_support_url',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['support_url']);
+ $this->initVar('mod_support_name',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['support_name']);
+ $this->initVar('mod_website_url',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['website_url']);
+ $this->initVar('mod_website_name',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['website_name']);
+ $this->initVar('mod_release',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['release_date']);
+ $this->initVar('mod_status',XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['status']);
+ $this->initVar('mod_admin',XOBJ_DTYPE_INT,$GLOBALS['xoopsModuleConfig']['display_admin']);
+ $this->initVar('mod_user',XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['display_user']);
+ $this->initVar('mod_search',XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_search']);
+ $this->initVar('mod_comments',XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_comments']);
+ $this->initVar('mod_notifications', XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_notifications']);
+ $this->initVar('mod_permissions', XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_permissions']);
+ $this->initVar('mod_install', XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['inroot_install']);
+ $this->initVar('mod_donations', XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['donations']);
+ $this->initVar('mod_subversion', XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['subversion']);
}
/*
@@ -122,34 +122,34 @@
$editor_configs['cols'] = 100;
$editor_configs['width'] = '50%';
$editor_configs['height'] = '100px';
- $editor_configs['editor'] = xoops_getModuleOption('tdmcreate_editor');
+ $editor_configs['editor'] = $GLOBALS['xoopsModuleConfig']['tdmcreate_editor'];
$form->addElement( new XoopsFormEditor(_AM_TDMCREATE_MODULE_DESCRIPTION, 'mod_description', $editor_configs), true);
// Author
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, 'mod_author', 50, 255, $this->getVar('mod_author')), true);
$form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, 'mod_license', 50, 255, $this->getVar('mod_license')), true);
- $mod_admin = $this->isNew() ? xoops_getModuleOption('display_admin') : $this->getVar('mod_admin');
+ $mod_admin = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['display_admin'] : $this->getVar('mod_admin');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_ADMIN, 'mod_admin', $mod_admin, _YES, _NO));
- $mod_user = $this->isNew() ? xoops_getModuleOption('display_user') : $this->getVar('mod_user');
+ $mod_user = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['display_user'] : $this->getVar('mod_user');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_USER, 'mod_user', $mod_user, _YES, _NO));
- $mod_search = $this->isNew() ? xoops_getModuleOption('active_search') : $this->getVar('mod_search');
+ $mod_search = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_search'] : $this->getVar('mod_search');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_SEARCH, 'mod_search', $mod_search, _YES, _NO));
- $mod_comments = $this->isNew() ? xoops_getModuleOption('active_comments') : $this->getVar('mod_comments');
+ $mod_comments = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_comments'] : $this->getVar('mod_comments');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_COMMENTS, 'mod_comments', $mod_comments, _YES, _NO));
- $mod_notifications = $this->isNew() ? xoops_getModuleOption('active_notifications') : $this->getVar('mod_notifications');
+ $mod_notifications = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_notifications'] : $this->getVar('mod_notifications');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_NOTIFICATIONS, 'mod_notifications', $mod_notifications, _YES, _NO));
- $mod_permissions = $this->isNew() ? xoops_getModuleOption('active_permissions') : $this->getVar('mod_permissions');
+ $mod_permissions = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_permissions'] : $this->getVar('mod_permissions');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_PERMISSIONS, 'mod_permissions', $mod_permissions, _YES, _NO));
- $mod_install = $this->isNew() ? xoops_getModuleOption('inroot_install') : $this->getVar('mod_install');
+ $mod_install = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['inroot_install'] : $this->getVar('mod_install');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_INSTALL, 'mod_install', $mod_install, _YES, _NO));
$mod_image = $this->getVar('mod_image') ? $this->getVar('mod_image') : 'empty.png';
- $uploadirectory = '/modules/'.$xoopsModule->dirname().'/images/uploads/modules';
+ $uploadirectory = '/uploads/'.$GLOBALS['xoopsModule']->dirname().'/images/modules/';
$imgtray = new XoopsFormElementTray(_AM_TDMCREATE_MODULE_IMAGE, '<br />');
- $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './modules/' . $xoopsModule->dirname() . '/images/uploads/modules');
+ $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, '.' . strtolower($uploadirectory));
$imageselect= new XoopsFormSelect($imgpath, 'mod_image', $mod_image);
$mod_image_array = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH . $uploadirectory );
foreach( $mod_image_array as $image ) {
@@ -157,10 +157,10 @@
}
$imageselect->setExtra( "onchange='showImgSelected(\"image3\", \"mod_image\", \"" . $uploadirectory . "\", \"\", \"" . XOOPS_URL . "\")'" );
$imgtray->addElement($imageselect);
- $imgtray -> addElement( new XoopsFormLabel( '', "<br /><img src='" . XOOPS_URL . "/" . $uploadirectory . "/" . $mod_image . "' name='image3' id='image3' alt='' />" ) );
+ $imgtray->addElement( new XoopsFormLabel( '', "<br /><img src='" . XOOPS_URL . "/" . $uploadirectory . "/" . $mod_image . "' name='image3' id='image3' alt='' />" ) );
$fileseltray = new XoopsFormElementTray('', '<br />');
- $fileseltray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD, 'attachedfile', xoops_getModuleOption('maxsize')));
+ $fileseltray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD, 'attachedfile', $GLOBALS['xoopsModuleConfig']['maxsize']));
$fileseltray->addElement(new XoopsFormLabel(''));
$imgtray->addElement($fileseltray);
$form->addElement($imgtray);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -38,9 +38,7 @@
$this->initVar('table_name',XOBJ_DTYPE_TXTBOX);
$this->initVar('table_fieldname',XOBJ_DTYPE_TXTBOX);
$this->initVar('table_image',XOBJ_DTYPE_TXTBOX);
- $this->initVar('table_nbfields',XOBJ_DTYPE_INT);
- $this->initVar('table_fields',XOBJ_DTYPE_TXTBOX);
- $this->initVar('table_parameters',XOBJ_DTYPE_TXTBOX);
+ $this->initVar('table_nbfields',XOBJ_DTYPE_INT);
$this->initVar('table_blocks',XOBJ_DTYPE_INT);
$this->initVar('table_admin',XOBJ_DTYPE_INT);
$this->initVar('table_user',XOBJ_DTYPE_INT);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/themeform.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/themeform.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/themeform.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -45,7 +45,7 @@
* @param string $method "method" attribute for the <form> tag
* @param bool $addtoken whether to add a security token to the form
*/
- public function __construct($title, $tab_header = null, $name, $action, $method = 'post', $addtoken = false, $summary = '')
+ public function __construct($title, $name = null, $action = false, $method = 'post', $tab_header = null, $addtoken = false, $summary = '')
{
parent::__construct($title, $name, $action, $method = 'post', $addtoken = false, $summary = '');
$this->addHeader($tab_header);
@@ -134,7 +134,8 @@
$ret .= $tableForm->addCells($this->getHeader(), 'first', 'header');
$hidden = '';
- $class = ($class == 'even') ? 'odd' : 'even';
+ $class = '';
+ $class .= ($class == 'even') ? 'odd' : 'even';
foreach ($this->getElements() as $ele) {
if (!is_object($ele)) {
$ret .= $ele;
@@ -168,7 +169,7 @@
$hidden .= $ele->render();
}
}
- $ret .= $tableForm->display() . NWLINE . ' ' . $hidden . '</form>' . NWLINE;
+ $ret .= $tableForm->render() . NWLINE . ' ' . $hidden . '</form>' . NWLINE;
$ret .= $this->renderValidationJS(true);
return $ret;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -18,9 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: functions.php 11084 2013-02-23 15:44:20Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
function TDMCreate_CleanVars( &$global, $key, $default = '', $type = 'int' ) {
switch ( $type ) {
@@ -42,17 +40,17 @@
if (!$opening) return;
while($file=readdir($opening)) {
if ($file == '.' || $file == '..') continue;
- if (is_dir($folder."/".$file)) {
- $r=TDMCreate_clearDir($folder."/".$file);
- if (!$r) return false;
- }
- else {
- $r=@unlink($folder."/".$file);
- if (!$r) return false;
- }
+ if (is_dir($folder."/".$file)) {
+ $r=TDMCreate_clearDir($folder."/".$file);
+ if (!$r) return false;
+ }
+ else {
+ $r=@unlink($folder."/".$file);
+ if (!$r) return false;
+ }
}
-closedir($opening);
-$r=@rmdir($folder);
-if (!$r) return false;
+ closedir($opening);
+ $r=@rmdir($folder);
+ if (!$r) return false;
return true;
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/install.php 2014-03-23 19:52:22 UTC (rev 12402)
@@ -21,6 +21,7 @@
$indexFile = XOOPS_UPLOAD_PATH.'/index.html';
$blankFile = XOOPS_UPLOAD_PATH.'/blank.gif';
+$emptyFile = XOOPS_ROOT_PATH.'/modules/TDMCreate/images/empty.png';
// Making of "uploads" folder
$tdmcreate = XOOPS_UPLOAD_PATH.'/tdmcreate';
@@ -50,6 +51,7 @@
chmod($modules, 0777);
copy($indexFile, $modules.'/index.html');
copy($blankFile, $modules.'/blank.gif');
+copy($emptyFile, $modules.'/empty.png');
// Making of "tables" images folder
$tables = $images.'/tables';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/sql/mysql.sql 2014-03-23 19:52:22 UTC (rev 12402)
@@ -49,8 +49,6 @@
`table_fieldname` varchar(150) NOT NULL default '',
`table_image` varchar(150) NOT NULL default '',
`table_nbfields` int(5) unsigned NOT NULL default '0',
- `table_fields` text,
- `table_parameters` text,
`table_blocks` tinyint(1) unsigned NOT NULL default '0',
`table_admin` tinyint(1) unsigned NOT NULL default '1',
`table_user` tinyint(1) unsigned NOT NULL default '0',
@@ -89,6 +87,8 @@
`field_mainfield` tinyint (1) unsigned NOT NULL default '0',
`field_search` tinyint (1) unsigned NOT NULL default '0',
`field_required` tinyint (1) unsigned NOT NULL default '0',
+`field_fields` text,
+`field_parameters` text,
PRIMARY KEY (`field_id`),
KEY `field_tid` (`field_tid`)
) ENGINE=MyISAM;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_about.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_about.html 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_about.html 2014-03-23 19:52:22 UTC (rev 12402)
@@ -1,4 +1,6 @@
<!-- Header -->
<{includeq file="db:tdmcreate_header.html"}>
<!-- About Page -->
-<div class="top"><{$about}></div>
\ No newline at end of file
+<div class="top"><{$about}></div>
+<!-- Footer -->
+<{includeq file="db:tdmcreate_footer.html"}>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html 2014-03-23 19:52:22 UTC (rev 12402)
@@ -41,4 +41,6 @@
<{if $form}>
<{$form}>
<{/if}>
-<{/if}>
\ No newline at end of file
+<{/if}>
+<!-- Footer -->
+<{includeq file="db:tdmcreate_footer.html"}>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_fields.html 2014-03-23 19:52:22 UTC (rev 12402)
@@ -32,13 +32,13 @@
<td class='center'><{$table.notifications}></td>
<td class='xo-actions txtcenter width10'>
<a href="tables.php?op=edit&table_id=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_EDIT_TABLE}>">
- <img src="<{xoAdminIcons edit.png}>" alt="<{$smarty.const._AM_TDMCREATE_EDIT_TABLE}>" height="16" />
+ <img src="<{$xoModuleIcons edit.png}>" alt="<{$smarty.const._AM_TDMCREATE_EDIT_TABLE}>" height="16" />
</a>
<a href="fields.php?op=edit&field_tid=<{$table.id}>" title="<{$smarty.const._AM_TDMCREATE_EDIT_FIELDS}>">
- <img src="<{$tdmc_url}>/images/icons/16/editfields.png" alt="<{$smarty.const._AM_TDMCREATE_EDIT_FIELDS}>" height="16" />
+ <img src="<{$xoModuleIcons inserttable.png}>" alt="<{$smarty.const._AM_TDMCREATE_EDIT_FIELDS}>" height="16" />
</a>
<a href="tables.php?op=delete&table_id=<{$table.id}>" title="<{$smarty.const._DELETE}>">
- <img src="<{xoAdminIcons delete.png}>" alt="<{$smarty.const._DELETE}>" height="16" />
+ <img src="<{$xoModuleIcons delete.png}>" alt="<{$smarty.const._DELETE}>" height="16" />
</a>
</td>
</tr>
@@ -56,4 +56,6 @@
<!-- Display module form (add,edit) -->
<{if $form}>
<div class="spacer"><{$form}></div>
-<{/if}>
\ No newline at end of file
+<{/if}>
+<!-- Footer -->
+<{includeq file="db:tdmcreate_footer.html"}>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_footer.html 2014-03-23 19:52:22 UTC (rev 12402)
@@ -1,3 +1,4 @@
+<br />
<div class='center'><a href='http://www.xoops.org' title='Visit XOOPS' target='_blank'>
<img src="<{xoModuleIcons32 xoopsmicrobutton.gif}>" alt='XOOPS' /></a></div>
<div class='center smallsmall italic pad5'>
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_help.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_help.html 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_help.html 2014-03-23 19:52:22 UTC (rev 12402)
@@ -1 +1 @@
- <script>history.go(-1);</script>
\ No newline at end of file
+<script>history.go(-1);</script>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_index.html 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_index.html 2014-03-23 19:52:22 UTC (rev 12402)
@@ -1,4 +1,6 @@
<!-- Header -->
<{includeq file="db:tdmcreate_header.html"}>
<!-- Index Page -->
-<div class="top"><{$index}></div>
\ No newline at end of file
+<div class="top"><{$index}></div>
+<!-- Footer -->
+<{includeq file="db:tdmcreate_footer.html"}>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html 2014-03-22 12:36:09 UTC (rev 12401)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html 2014-03-23 19:52:22 UTC (rev 12402)
@@ -57,4 +57,6 @@
<div class="errorMsg">
<strong><{$error}></strong>
</div>
-<{/if}>
\ No newline at end of file
+<{/if}>
+<!-- Footer -->
+<{includeq file="db:tdmcreate_footer.html"}>
\ No newlin...
[truncated message content] |