|
From: <txm...@us...> - 2014-03-16 12:58:20
|
Revision: 12381
http://sourceforge.net/p/xoops/svn/12381
Author: txmodxoops
Date: 2014-03-16 12:58:17 +0000 (Sun, 16 Mar 2014)
Log Message:
-----------
Updated
If you test this, is needed a new installation
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions_const.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/about.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -19,7 +19,10 @@
* @version $Id: about.php 11084 2013-02-23 15:44:20Z timgno $
*/
include 'header.php';
-$xoopsOption['template_main'] = 'tdmcreate_about.html';
+$template_main = 'tdmcreate_about.html';
$xoopsTpl->assign('navigation', $adminMenu->addNavigation('about.php'));
$xoopsTpl->assign('about', $adminMenu->renderAbout('6KJ7RW5DR3VTJ', false));
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -27,57 +27,37 @@
$modules =& $modulesHandler;
}
-$mod_name = strtolower($modules->getVar('mod_name'));
-$mod_author_website_name = $modules->getVar('mod_author_website_name');
-$mod_author_website_url = $modules->getVar('mod_author_website_url');
-$mod_user = $modules->getVar('mod_user');
-$mod_notifications = $modules->getVar('mod_notifications');
-$mod_permissions = $modules->getVar('mod_permissions');
-
-if (isset($_REQUEST['table_name'])) {
- $tables =& $tablesHandler->get($_REQUEST['table_name']);
-} else {
- $tables =& $tablesHandler;
-}
-
-//Name of tables
-$criteria = new CriteriaCompo();
-if (isset($_REQUEST['mod_name'])) {
- $criteria->add(new Criteria('table_mid', $_REQUEST['mod_name']));
-} else {
- $criteria->add(new Criteria('table_mid'));
-}
-
-$nb_tables = $tablesHandler->getCount($criteria);
-$tables_arr = $tablesHandler->getAll($criteria);
-$xoopsOption['template_main'] = 'tdmcreate_building.html';
-$xoopsTpl->assign('navigation', $adminMenu->addNavigation('building.php'));
switch ($op) {
- case 'build':
- // Effacer repertoire of nouveau module s'il existe
- TDMCreate_clearDir($modPath.'/modules/'.strtolower($mod_name));
+ case 'build':
+ $template_main = 'tdmcreate_building.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
+ // Clear repertory of new module if there are
+ TDMCreate_clearDir(TDMC_PATH.'/modules/'.strtolower($modules->getVar('mod_name')));
// Debut
/************************************************/
/*Structure*/
- /************************************************/
- //Creation of the structure of folders and files
- $xoopsTpl->assign('build_list', 'Under new construction - Temporary build');
+ /************************************************/
+ include_once TDMC_PATH . '/class/files/architecture.php';
+ $handler = new TDMCreateArchitecture();
+ $handler->getPath( TDMC_PATH );
+ $handler->getArchitectureFiles( $modules );
+
+ // Creation of the structure of folders and files
+ $GLOBALS['xoopsTpl']->assign('build_list', 'Under new construction - Temporary build');
break;
case 'default':
- default:
- include_once(XOOPS_ROOT_PATH . '/class/xoopsformloader.php');
- $action = $_SERVER['REQUEST_URI'];
-
- $form = new XoopsThemeForm(_AM_TDMCREATE_ADMIN_CONST, 'buildform', $action, 'post', true);
-
- $mod_select = new XoopsFormSelect(_AM_TDMCREATE_CONST_MODULES, 'mod_name', 'mod_name');
- $mod_select->addOptionArray($modulesHandler->getList());
- $form->addElement($mod_select, true);
-
- $form->addElement(new XoopsFormHidden('op', 'build'));
- $form->addElement(new XoopsFormButton(_REQUIRED.' <span class="red bold">*</span>', 'submit', _SUBMIT, 'submit'));
- $xoopsTpl->assign('form', $form->display());
+ default:
+ $template_main = 'tdmcreate_building.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('building.php'));
+
+ include_once(TDMC_PATH . '/class/building.php');
+ $handler = TDMCreateBuilding::getInstance();
+ $form = $handler->getForm();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
}
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -0,0 +1,134 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.5
+ * @author Txmod Xoops <su...@tx...>
+ * @version $Id: 1.59 fields.php 11297 2013-03-24 10:58:10Z timgno $
+ */
+include 'header.php';
+// Recovered the value of the argument op in the URL $
+$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
+$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id', 0, 'int');
+// Get table Variables
+$table_id = TDMCreate_CleanVars($_REQUEST, 'field_tid', 0, 'int');
+$table_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid', 0, 'int');
+$table_nbfields = TDMCreate_CleanVars($_REQUEST, 'field_numb', 0, 'int');
+$table_fieldname = TDMCreate_CleanVars($_REQUEST, 'field_name', '', 'string');
+/*$table_id = $_SESSION['field_tid'];
+$table_mid = $_SESSION['field_mid'];
+$table_nbfields = $_SESSION['field_numb'];
+$table_fieldname = $_SESSION['field_name'];*/
+switch ($op)
+{
+ case 'list':
+ default:
+ $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
+ $start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
+ // Define main template
+ $xoopsOption['template_main'] = 'tdmcreate_fields.html';
+ xoops_cp_header();
+ $xoopsTpl->assign('navigation', $adminMenu->addNavigation('fields.php'));
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
+ $xoopsTpl->assign('button_new', $adminMenu->renderButton());
+ $xoopsTpl->assign('tdmc_url', TDMC_URL);
+ $xoopsTpl->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
+ $xoopsTpl->assign('pathIcon32', XOOPS_URL.'/Frameworks/moduleclasses/icons/32');
+ // Get the list of tables
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('table_mid', $_REQUEST['mod_id']));
+ $criteria->setSort('table_id ASC, table_name');
+ $criteria->setOrder('ASC');
+ $nb_tables = $tablesHandler->getCount();
+ $tables_arr = $tablesHandler->getAll($criteria);
+ unset($criteria);
+ if ($nb_tables > 0)
+ {
+ $_yes = "<img src='../images/icons/16/green.png' alt='"._YES."' title='"._YES."' />";
+ $_no = "<img src='../images/icons/16/red.png' alt='"._NO."' title='"._NO."' />";
+ foreach (array_keys($tables_arr) as $t)
+ {
+ $table['id'] = $t;
+ $table['mid'] = $tables_arr[$t]->getVar('table_mid');
+ $table['name'] = $tables_arr[$t]->getVar('table_name');
+ $table['image'] = $tables_arr[$t]->getVar('table_image');
+ $table['nbfields'] = $tables_arr[$t]->getVar('table_nbfields');
+ $table['blocks'] = ( $tables_arr[$t]->getVar('table_blocks') == 1 ) ? $_yes : $_no;
+ $table['admin'] = ( $tables_arr[$t]->getVar('table_admin') == 1 ) ? $_yes : $_no;
+ $table['user'] = ( $tables_arr[$t]->getVar('table_user') == 1 ) ? $_yes : $_no;
+ $table['submenu'] = ( $tables_arr[$t]->getVar('table_submenu') == 1 ) ? $_yes : $_no;
+ $table['search'] = ( $tables_arr[$t]->getVar('table_search') == 1 ) ? $_yes : $_no;
+ $table['comments'] = ( $tables_arr[$t]->getVar('table_comments') == 1 ) ? $_yes : $_no;
+ $table['notifications'] = ( $tables_arr[$t]->getVar('table_notifications') == 1 ) ? $_yes : $_no;
+ $xoopsTpl->append('tables_list', $table);
+ unset($mod);
+ }
+ if ( $nb_tables > $limit ) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ $pagenav = new XoopsPageNav($nb_tables, $limit, $start, 'start', 'op=list&limit=' . $limit);
+ $xoopsTpl->assign('pagenav', $pagenav->renderNav(4));
+ }
+ } else {
+ $xoopsTpl->assign('error', 'Add, Edit or List View in Tables');
+ }
+ break;
+
+ case 'new':
+ xoops_cp_header();
+ echo $adminMenu->addNavigation('fields.php');
+ $obj =& $fieldsHandler->create();
+ $form = $obj->getForm($table_id, $table_mid, $table_nbfields, $table_fieldname);
+ $form->display();
+ break;
+
+ case 'save':
+ if ( !$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ if (isset($field_id)) {
+ $obj =& $fieldsHandler->get($field_id);
+ } else {
+ $obj =& $fieldsHandler->create();
+ }
+ //Form fields
+ $obj->setVars(array('field_mid' => $table_mid, 'field_tid' => $table_id, 'field_name' => $_POST['field_name'],
+ 'field_numb' => $table_nbfields, 'field_type' => $_POST['field_type'],
+ 'field_value' => $_POST['field_value'], 'field_attribute' => $_POST['field_attribute'],
+ 'field_null' => $_POST['field_null'], 'field_default' => $_POST['field_default'],
+ 'field_key' => $_POST['field_key'], 'field_elements' => $_POST['field_elements'],
+ 'field_admin' => (($_REQUEST['field_admin'] == 1) ? '1' : '0'),
+ 'field_user' => (($_REQUEST['field_user'] == 1) ? '1' : '0'),
+ 'field_blocks' => (($_REQUEST['field_blocks'] == 1) ? '1' : '0'),
+ 'field_mainfield' => (($_REQUEST['field_mainfield'] == 1) ? '1' : '0'),
+ 'field_search' => (($_REQUEST['field_search'] == 1) ? '1' : '0'),
+ 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0')));
+
+ if ($fieldsHandler->insert($obj)) {
+ redirect_header('tables.php', 2, _AM_TDMCREATE_FORMOK);
+ }
+ echo $obj->getHtmlErrors();
+ $form = $obj->getForm();
+ $form->display();
+ break;
+
+ case 'edit':
+ xoops_cp_header();
+ echo $adminMenu->addNavigation('fields.php');
+ $obj = $fieldsHandler->get($field_id);
+ $form = $obj->getForm($table_id, $table_mid, $table_nbfields, $table_fieldname);
+ $form->display();
+ break;
+}
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/header.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -19,8 +19,9 @@
* @version $Id: header.php 12207 2013-10-23 02:46:52Z beckmi $
*/
include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
+include_once('../include/common.php');
include_once('../include/functions.php');
-include_once 'includes.php';
+//include_once 'includes.php';
//
$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
//
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/index.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -28,7 +28,11 @@
$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ;
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMMODULES. '</label>', $count_modules, 'Green') ;
$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMTABLES. '</label>', $count_tables, 'Orange');
-$xoopsOption['template_main'] = 'tdmcreate_index.html';
-$xoopsTpl->assign('navigation', $adminMenu->addNavigation('index.php'));
-$xoopsTpl->assign('index', $adminMenu->renderIndex());
+//$xoopsOption['template_main'] = 'tdmcreate_index.html';
+$GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('index.php'));
+$GLOBALS['xoopsTpl']->assign('index', $adminMenu->renderIndex());
+$template_main = 'tdmcreate_index.html';
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/modules.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -26,15 +26,14 @@
{
case 'list':
default:
- $limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
+ $limit = $GLOBALS['xoopsModuleConfig']['mod_adminpager'];
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
- $xoopsOption['template_main'] = 'tdmcreate_modules.html';
- xoops_cp_header();
- $xoopsTpl->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $template_main = 'tdmcreate_modules.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
- $xoopsTpl->assign('button_new', $adminMenu->renderButton());
- $xoopsTpl->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
+ $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
$criteria->setOrder('ASC');
@@ -60,30 +59,29 @@
$mod['mod_search'] = ( $mods_arr[$i]->getVar('mod_search') == 1 ) ? $yes : $no;
$mod['mod_comments'] = ( $mods_arr[$i]->getVar('mod_comments') == 1 ) ? $yes : $no;
$mod['mod_notifications'] = ( $mods_arr[$i]->getVar('mod_notifications') == 1 ) ? $yes : $no;
- $xoopsTpl->append('modules_list', $mod);
+ $GLOBALS['xoopsTpl']->append('modules_list', $mod);
unset($mod);
}
if ( $numrows > $limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list&limit=' . $limit);
- $xoopsTpl->assign('pagenav', $pagenav->renderNav(4));
+ $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
- $xoopsTpl->assign('error', 'There aren\'t modules');
+ $GLOBALS['xoopsTpl']->assign('error', 'There aren\'t modules');
}
break;
case 'new':
// Define main template
- $xoopsOption['template_main'] = 'tdmcreate_modules.html';
- xoops_cp_header();
- $xoopsTpl->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $template_main = 'tdmcreate_modules.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
- $xoopsTpl->assign('button_list', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('button_list', $adminMenu->renderButton());
$obj =& $modulesHandler->create();
$form = $obj->getForm();
- $xoopsTpl->assign('form', $form->render());
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'save':
@@ -144,24 +142,23 @@
redirect_header('modules.php', 2, _AM_TDMCREATE_FORMOK);
}
- $xoopsTpl->assign('error', $obj->getHtmlErrors());
+ $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
$form =& $obj->getForm();
- $xoopsTpl->assign('form', $form->render());
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'edit':
// Define main template
- $xoopsOption['template_main'] = 'tdmcreate_modules.html';
- xoops_cp_header();
- $xoopsTpl->assign('navigation', $adminMenu->addNavigation('modules.php'));
+ $template_main = 'tdmcreate_modules.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('modules.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
- $xoopsTpl->assign('button_new', $adminMenu->renderButton());
- $xoopsTpl->assign('button_list', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('button_list', $adminMenu->renderButton());
$obj = $modulesHandler->get($_REQUEST['mod_id']);
$form = $obj->getForm();
- $xoopsTpl->assign('form', $form->render());
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'delete':
@@ -173,11 +170,14 @@
if ($modulesHandler->delete($obj)) {
redirect_header('modules.php', 3, _AM_TDMCREATE_FORMDELOK);
} else {
- $xoopsTpl->assign('error', $obj->getHtmlErrors());
+ $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
}
} else {
xoops_confirm(array('ok' => 1, 'mod_id' => $_REQUEST['mod_id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('mod_name')));
}
break;
}
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/tables.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -29,26 +29,25 @@
$limit = xoops_getModuleOption('adminperpage');
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
// Define main template
- $xoopsOption['template_main'] = 'tdmcreate_tables.html';
- xoops_cp_header();
+ $template_main = 'tdmcreate_tables.html';
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/style.css' );
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
- $xoopsTpl->assign('navigation', $adminMenu->addNavigation('tables.php'));
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
- $xoopsTpl->assign('button_new', $adminMenu->renderButton());
- $xoopsTpl->assign('tdmc_url', TDMC_URL);
- $xoopsTpl->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
- $xoopsTpl->assign('pathIcon32', XOOPS_URL.'/Frameworks/moduleclasses/icons/32');
+ $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
+ $GLOBALS['xoopsTpl']->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
+ $GLOBALS['xoopsTpl']->assign('pathIcon32', XOOPS_URL.'/Frameworks/moduleclasses/icons/32');
// Get the list of modules
$criteria = new CriteriaCompo();
$criteria->setSort('mod_id ASC, mod_name');
$criteria->setOrder('ASC');
$numrows_modules = $modulesHandler->getCount();
// Redirect if there aren't modules
- if ( $numrows_modules == 0 ) {
+ /*if ( $numrows_modules == 0 ) {
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
- }
+ } */
$mods_arr = $modulesHandler->getAll($criteria);
unset($criteria);
// Display modules list
@@ -99,30 +98,29 @@
}
}
$mod['tables'] = $tables;
- $xoopsTpl->append('modules_list', $mod);
+ $GLOBALS['xoopsTpl']->append('modules_list', $mod);
unset($mod);
}
if ( $numrows_modules > $limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$pagenav = new XoopsPageNav($numrows_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
- $xoopsTpl->assign('pagenav', $pagenav->renderNav(4));
+ $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
}
} else {
- $xoopsTpl->assign('error', 'There aren\'t modules');
+ $GLOBALS['xoopsTpl']->assign('error', 'There aren\'t modules');
}
break;
case 'new':
// Define main template
- $xoopsOption['template_main'] = 'tdmcreate_tables.html';
- xoops_cp_header();
- $xoopsTpl->assign('navigation', $adminMenu->addNavigation('tables.php'));
+ $template_main = 'tdmcreate_tables.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
- $xoopsTpl->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
$obj =& $tablesHandler->create();
- $form = $obj->getForm();
- $xoopsTpl->assign('form', $form->render());
+ $form = $obj->getFormTable();
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'save':
@@ -186,22 +184,21 @@
}
}
- $xoopsTpl->assign('error', $obj->getHtmlErrors());
+ $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
$form = $obj->getForm();
- $xoopsTpl->assign('form', $form->render());
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'edit':
// Define main template
- $xoopsOption['template_main'] = 'tdmcreate_tables.html';
- xoops_cp_header();
- $xoopsTpl->assign('navigation', $adminMenu->addNavigation('tables.php'));
+ $template_main = 'tdmcreate_tables.html';
+ $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
- $xoopsTpl->assign('button_new', $adminMenu->renderButton());
+ $GLOBALS['xoopsTpl']->assign('button_new', $adminMenu->renderButton());
$obj = $tablesHandler->get($_REQUEST['table_id']);
$form = $obj->getForm();
- $xoopsTpl->assign('form', $form->render());
+ $GLOBALS['xoopsTpl']->assign('form', $form->render());
break;
case 'delete':
@@ -220,4 +217,7 @@
}
break;
}
+if ( isset($template_main) ) {
+ $GLOBALS['xoopsTpl']->display("db:{$template_main}");
+}
include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -217,6 +217,6 @@
{
function __construct(&$db)
{
- parent::__construct($db, "tdmcreate_fields", "tdmcreatefields", "field_id", "field_table");
+ parent::__construct($db, "mod_tdmcreate_fields", "tdmcreatefields", "field_id", "field_table");
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -21,90 +21,112 @@
if (!defined('XOOPS_ROOT_PATH')) {
die('XOOPS root path not defined');
}
-
-class Architecture extends Structure
+require_once 'structure.php';
+class TDMCreateArchitecture
{
/*
+ * @var mixed
+ */
+ public $structure = null;
+ /*
* @public function constructor class
+ * @param null
+ */
+ public function __construct() {
+ $this->structure = TDMCreateStructure::getInstance();
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function getPath
* @param string $path
*/
- public function __construct($path) {
+ public function getPath($path) {
$this->path = $path;
- }
+ }
/*
- * @public function isDir
- * @param string $dname
+ * @public function getArchitectureFiles
+ * @param string $module
*/
- public function ArchitectureFiles( $module, $pathName )
- {
- $indexFile = $pathName.'/index.html';
- $this->path = XOOPS_ROOT_PATH.'/modules/TDMCreate';
+ public function getArchitectureFiles( $module )
+ {
+ $indexFile = $this->path.'/index.html';
$fdocs = $this->path.'/docs';
$fimages = $this->path.'/images';
//Creation of the Directory of modules
- $targetDirectory = $pathName.'/modules/'.strtolower($module->getVar('mod_name'));
+ $targetDirectory = $this->path.'/modules/'.strtolower($module->getVar('mod_name'));
- // Making of a new object
- $classStruct = Structure::Structure($targetDirectory);
// Creation of "module" folder
- $classStruct->makeDir($targetDirectory);
+ $this->structure->getPath($targetDirectory);
+ // Creation of "module" folder
+ $this->structure->makeDir($targetDirectory);
// Creation of "admin" folder and index.html file
- $classStruct->makeDirAndCopyFile('admin/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('admin/', $indexFile, 'index.html');
// Creation of "blocks" folder and index.html file
- $classStruct->makeDirAndCopyFile('blocks/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('blocks/', $indexFile, 'index.html');
// Creation of "class" folder and index.html file
- $classStruct->makeDirAndCopyFile('class/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('class/', $indexFile, 'index.html');
// Creation of "css" folder and index.html file
- $classStruct->makeDirAndCopyFile('css/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('css/', $indexFile, 'index.html');
// Creation of "images" folder and index.html file
- $classStruct->makeDirAndCopyFile('images/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('images/', $indexFile, 'index.html');
//Copy the logo of the module
$mod_image = str_replace(' ', '', strtolower($module->getVar('mod_image')));
- $classStruct->copyFile('images/', $fimages.'/uploads/modules/'.$mod_image, $mod_image);
+ $this->structure->copyFile('images/', $fimages.'/uploads/modules/'.$mod_image, $mod_image);
// Creation of 'images/icons' folder and index.html file - Added in Version 1.15
- $classStruct->makeDirAndCopyFile('images/icons/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('images/icons/', $indexFile, 'index.html');
// Creation of "images/icons/16" folder and index.html file
- $classStruct->makeDirAndCopyFile('images/icons/16/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('images/icons/16/', $indexFile, 'index.html');
// Creation of "images/icons/32" folder and index.html file
- $classStruct->makeDirAndCopyFile('images/icons/32/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('images/icons/32/', $indexFile, 'index.html');
// Creation of 'on.png' file
- $classStruct->copyFile('images/icons/16/', $fimages.'/icons/16/on.png', 'on.png');
+ $this->structure->copyFile('images/icons/16/', $fimages.'/icons/16/on.png', 'on.png');
// Creation of 'off.png' file
- $classStruct->copyFile('images/icons/16/', $fimages.'/icons/16/off.png', 'off.png');
+ $this->structure->copyFile('images/icons/16/', $fimages.'/icons/16/off.png', 'off.png');
// Creation of 'arrow.gif' file
- $classStruct->copyFile('images/icons/16/', $fimages.'/icons/16/arrow.gif', 'arrow.gif');
+ $this->structure->copyFile('images/icons/16/', $fimages.'/icons/16/arrow.gif', 'arrow.gif');
// Creation of 'txmodxoops_logo.png' file
- $classStruct->copyFile('images/', $fimages.'/txmodxoops_logo.png', 'txmodxoops_logo.png');
+ $this->structure->copyFile('images/', $fimages.'/txmodxoops_logo.png', 'txmodxoops_logo.png');
// Creation of 'docs' folder and index.html file
- $classStruct->makeDirAndCopyFile('docs/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('docs/', $indexFile, 'index.html');
// Creation of 'credits.txt' file
- $classStruct->copyFile('docs/', $fdocs.'/credits.txt', 'credits.txt');
+ $this->structure->copyFile('docs/', $fdocs.'/credits.txt', 'credits.txt');
// Creation of 'install.txt' file
- $classStruct->copyFile('docs/', $fdocs.'/install.txt', 'install.txt');
+ $this->structure->copyFile('docs/', $fdocs.'/install.txt', 'install.txt');
// Creation of 'lang_diff.txt' file
- $classStruct->copyFile('docs/', $fdocs.'/lang_diff.txt', 'lang_diff.txt');
+ $this->structure->copyFile('docs/', $fdocs.'/lang_diff.txt', 'lang_diff.txt');
// Creation of 'license.txt' file
- $classStruct->copyFile('docs/', $fdocs.'/license.txt', 'license.txt');
+ $this->structure->copyFile('docs/', $fdocs.'/license.txt', 'license.txt');
// Creation of 'readme.txt' file
- $classStruct->copyFile('docs/', $fdocs.'/readme.txt', 'readme.txt');
+ $this->structure->copyFile('docs/', $fdocs.'/readme.txt', 'readme.txt');
// Creation of "include" folder and index.html file
- $classStruct->makeDirAndCopyFile('include/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('include/', $indexFile, 'index.html');
// Creation of "language" folder and index.html file
- $classStruct->makeDirAndCopyFile('language/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('language/', $indexFile, 'index.html');
// Creation of "language/local_language" folder and index.html file
- $classStruct->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language']. '/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language']. '/', $indexFile, 'index.html');
// Creation of "language/local_language/help" folder and index.html file
- $classStruct->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language']. '/help/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language']. '/help/', $indexFile, 'index.html');
// Creation of "templates" folder and index.html file
- $classStruct->makeDirAndCopyFile('templates/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('templates/', $indexFile, 'index.html');
// Creation of "templates/admin" folder and index.html file
- $classStruct->makeDirAndCopyFile('templates/admin/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('templates/admin/', $indexFile, 'index.html');
// Creation of "templates/blocks" folder and index.html file
- $classStruct->makeDirAndCopyFile('templates/blocks/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('templates/blocks/', $indexFile, 'index.html');
// Creation of "sql" folder and index.html file
- $classStruct->makeDirAndCopyFile('sql/', $indexFile, 'index.html');
+ $this->structure->makeDirAndCopyFile('sql/', $indexFile, 'index.html');
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -21,14 +21,14 @@
if (!defined('XOOPS_ROOT_PATH')) {
die('XOOPS root path not defined');
}
-
-class Structure extends XoopsFile
+xoops_load('XoopsFile');
+class TDMCreateStructure
{
- /**
- * @var string
- */
- public $tdmc = null;
/*
+ * @var mixed
+ */
+ public $xoopsfile = null;
+ /*
* @var string
*/
public $module_name = null;
@@ -56,9 +56,28 @@
* @public function constructor class
* @param string $path
*/
- public function __construct($path) {
+ public function __construct() {
+ $this->xoopsfile = XoopsFile::getInstance();
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function getPath
+ * @param string $path
+ */
+ public function getPath($path) {
$this->path = $path;
- }
+ }
/*
* @public function isDir
* @param string $dname
@@ -74,15 +93,16 @@
}
/*
* @public function makeDir
- * @param string $path
+ * @param string $dir
*/
public function makeDir($dir)
{
- $this->isDir($dir);
+ $this->isDir(strtolower(trim($dir)));
}
/*
* @public function folderPath
- * @param string $folder_name
+ * @param string $folder_name
+ * @param string $file_name
*/
public function folderPath($folder_name, $file_name = null)
{
@@ -119,21 +139,29 @@
/*
* @public function copy file
* @param string $foldername
- * @param string $to_file
- * @param string $filename
+ * @param string $from_file
+ * @param string $to_file
*/
public function copyFile($folder_name, $from_file, $to_file)
{
- //$fname = $this->folderPath($folder_name, $from_file, $to_file);
- //copy($file_name, $fname);
- //$this->folder_name = $folder_name;
$this->from_file = $from_file;
$this->to_file = $to_file;
+ $dname = $this->folderPath($folder_name);
$fname = $this->folderPath($folder_name) . $this->to_file;
+ $this->getCopy($dname, $fname);
+ }
+ /*
+ * @public function copy file
+ * @param string $dname
+ * @param string $fname
+ */
+ public function getCopy($dname, $fname)
+ {
if(is_dir($fname)) {
chmod($fname, 0777);
copy($this->from_file, $fname);
} else {
+ $this->makeDir($dname);
copy($this->from_file, $fname);
}
}
@@ -145,7 +173,7 @@
{
$deleteFolders = 0;
// folder open/read
- $folderHandler = $this->getHandler('folder', $path);
+ $folderHandler = $this->xoopsfile->getHandler('folder', $path);
foreach($log_files as $older) {
$folderHandler->__construct($older, false);
if (!$folderHandler->exists()) {
@@ -169,7 +197,7 @@
{
$deletedFiles = 0;
// file open/read
- $fileHandler = $this->getHandler('file', $path);
+ $fileHandler = $this->xoopsfile->getHandler('file', $path);
foreach($log_files as $file) {
$fileHandler->__construct($file, false);
if (!$fileHandler->exists()) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -76,21 +76,21 @@
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
- $title = $this->isNew() ? sprintf(_AM_TDMCREATE_MODULES_ADD) : sprintf(_AM_TDMCREATE_MODULES_EDIT);
+ $title = $this->isNew() ? sprintf(_AM_TDMCREATE_MODULE_ADD) : sprintf(_AM_TDMCREATE_MODULE_EDIT);
include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php");
$form = new XoopsThemeForm($title, 'modulesform', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
- $form->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULES_IMPORTANT.'</b></div>','head');
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_NAME, 'mod_name', 50, 255, $this->getVar('mod_name')), true);
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_VERSION, 'mod_version', 10, 25, $this->getVar('mod_version')), true);
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_SINCE, 'mod_since', 10, 25, $this->getVar('mod_since')), true);
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_PHP, 'mod_min_php', 10, 25, $this->getVar('mod_min_php')), true);
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_XOOPS, 'mod_min_xoops', 10, 25, $this->getVar('mod_min_xoops')), true);
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_ADMIN, 'mod_min_admin', 10, 25, $this->getVar('mod_min_admin')), true);
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MIN_MYSQL, 'mod_min_mysql', 10, 25, $this->getVar('mod_min_mysql')), true);
+ $form->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULE_IMPORTANT.'</b></div>','head');
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_NAME, 'mod_name', 50, 255, $this->getVar('mod_name')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, 'mod_version', 10, 25, $this->getVar('mod_version')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SINCE, 'mod_since', 10, 25, $this->getVar('mod_since')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_PHP, 'mod_min_php', 10, 25, $this->getVar('mod_min_php')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_XOOPS, 'mod_min_xoops', 10, 25, $this->getVar('mod_min_xoops')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_ADMIN, 'mod_min_admin', 10, 25, $this->getVar('mod_min_admin')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_MYSQL, 'mod_min_mysql', 10, 25, $this->getVar('mod_min_mysql')), true);
// Name description
$editor_configs=array();
$editor_configs['name'] = 'mod_description';
@@ -100,32 +100,32 @@
$editor_configs['width'] = '50%';
$editor_configs['height'] = '100px';
$editor_configs['editor'] = $GLOBALS['xoopsModuleConfig']['tdmcreate_editor'];
- $form->addElement( new XoopsFormEditor(_AM_TDMCREATE_MODULES_DESCRIPTION, 'mod_description', $editor_configs), true);
+ $form->addElement( new XoopsFormEditor(_AM_TDMCREATE_MODULE_DESCRIPTION, 'mod_description', $editor_configs), true);
// Author
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_AUTHOR, 'mod_author', 50, 255, $this->getVar('mod_author')), true);
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_LICENSE, 'mod_license', 50, 255, $this->getVar('mod_license')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, 'mod_author', 50, 255, $this->getVar('mod_author')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, 'mod_license', 50, 255, $this->getVar('mod_license')), true);
$mod_admin = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['display_admin'] : $this->getVar('mod_admin');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_DISPLAY_ADMIN, 'mod_admin', $mod_admin, _YES, _NO));
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_ADMIN, 'mod_admin', $mod_admin, _YES, _NO));
$mod_user = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['display_user'] : $this->getVar('mod_user');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_DISPLAY_USER, 'mod_user', $mod_user, _YES, _NO));
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_USER, 'mod_user', $mod_user, _YES, _NO));
$mod_search = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_search'] : $this->getVar('mod_search');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_SEARCH, 'mod_search', $mod_search, _YES, _NO));
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_SEARCH, 'mod_search', $mod_search, _YES, _NO));
$mod_comments = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_comments'] : $this->getVar('mod_comments');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_COMMENTS, 'mod_comments', $mod_comments, _YES, _NO));
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_COMMENTS, 'mod_comments', $mod_comments, _YES, _NO));
$mod_notifications = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_notifications'] : $this->getVar('mod_notifications');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_NOTIFICATIONS, 'mod_notifications', $mod_notifications, _YES, _NO));
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_NOTIFICATIONS, 'mod_notifications', $mod_notifications, _YES, _NO));
$mod_permissions = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_permissions'] : $this->getVar('mod_permissions');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_PERMISSIONS, 'mod_permissions', $mod_permissions, _YES, _NO));
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULE_PERMISSIONS, 'mod_permissions', $mod_permissions, _YES, _NO));
$mod_install = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['inroot_install'] : $this->getVar('mod_install');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_INROOT_INSTALL, 'mod_install', $mod_install, _YES, _NO));
+ $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';
- $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_MODULES_IMAGE, '<br />');
+ $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_MODULE_IMAGE, '<br />');
$imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './modules/' . $xoopsModule->dirname() . '/images/uploads/modules');
$imageselect= new XoopsFormSelect($imgpath, 'mod_image', $mod_image);
$mod_image_array = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH . $uploadirectory );
@@ -232,29 +232,28 @@
//------------ END --------------------
- $form->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULES_NOTIMPORTANT.'</b></div>','head');
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_AUTHOR_MAIL, 'mod_author_mail', 50, 255, $this->getVar('mod_author_mail')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_AUTHOR_WEBSITE_URL, 'mod_author_website_url', 50, 255, $this->getVar('mod_author_website_url')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_AUTHOR_WEBSITE_NAME, 'mod_author_website_name', 50, 255, $this->getVar('mod_author_website_name')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_CREDITS, 'mod_credits', 50, 255, $this->getVar('mod_credits')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_RELEASE_INFO, 'mod_release_info', 50, 255, $this->getVar('mod_release_info')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_RELEASE_FILE, 'mod_release_file', 50, 255, $this->getVar('mod_release_file')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MANUAL, 'mod_manual', 50, 255, $this->getVar('mod_manual')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MANUAL_FILE, 'mod_manual_file', 50, 255, $this->getVar('mod_manual_file')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_DEMO_SITE_URL, 'mod_demo_site_url', 50, 255, $this->getVar('mod_demo_site_url')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_DEMO_SITE_NAME, 'mod_demo_site_name', 50, 255, $this->getVar('mod_demo_site_name')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_FORUM_SITE_URL, 'mod_support_url', 50, 255, $this->getVar('mod_support_url')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_FORUM_SITE_NAME, 'mod_support_name', 50, 255, $this->getVar('mod_support_name')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_WEBSITE_URL, 'mod_website_url', 50, 255, $this->getVar('mod_website_url')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_WEBSITE_NAME, 'mod_website_name', 50, 255, $this->getVar('mod_website_name')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_RELEASE, 'mod_release', 50, 255, $this->getVar('mod_release')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_STATUS, 'mod_status', 50, 255, $this->getVar('mod_status')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_PAYPAL_BUTTON, 'mod_donations', 50, 255, $this->getVar('mod_donations')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_SUBVERSION, 'mod_subversion', 50, 255, $this->getVar('mod_subversion')));
+ $form->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULE_NOTIMPORTANT.'</b></div>','head');
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_MAIL, 'mod_author_mail', 50, 255, $this->getVar('mod_author_mail')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_URL, 'mod_author_website_url', 50, 255, $this->getVar('mod_author_website_url')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_NAME, 'mod_author_website_name', 50, 255, $this->getVar('mod_author_website_name')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_CREDITS, 'mod_credits', 50, 255, $this->getVar('mod_credits')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_INFO, 'mod_release_info', 50, 255, $this->getVar('mod_release_info')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_FILE, 'mod_release_file', 50, 255, $this->getVar('mod_release_file')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL, 'mod_manual', 50, 255, $this->getVar('mod_manual')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL_FILE, 'mod_manual_file', 50, 255, $this->getVar('mod_manual_file')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_URL, 'mod_demo_site_url', 50, 255, $this->getVar('mod_demo_site_url')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_NAME, 'mod_demo_site_name', 50, 255, $this->getVar('mod_demo_site_name')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_URL, 'mod_support_url', 50, 255, $this->getVar('mod_support_url')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_NAME, 'mod_support_name', 50, 255, $this->getVar('mod_support_name')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_URL, 'mod_website_url', 50, 255, $this->getVar('mod_website_url')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_NAME, 'mod_website_name', 50, 255, $this->getVar('mod_website_name')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE, 'mod_release', 50, 255, $this->getVar('mod_release')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_STATUS, 'mod_status', 50, 255, $this->getVar('mod_status')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_PAYPAL_BUTTON, 'mod_donations', 50, 255, $this->getVar('mod_donations')));
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUBVERSION, 'mod_subversion', 50, 255, $this->getVar('mod_subversion')));
$form->addElement(new XoopsFormHidden('op', 'save'));
$form->addElement(new XoopsFormButton(_REQUIRED.' <span class="red bold">*</span>', 'submit', _SUBMIT, 'submit'));
- $form->display();
return $form;
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/tables.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -814,7 +814,6 @@
$form->addElement(new XoopsFormHidden('op', $sending));
$form->addElement(new XoopsFormButton(_REQUIRED.' <span class="red bold">*</span>', 'submit', _SUBMIT, 'submit'));
- $form->display();
return $form;
}
@@ -878,7 +877,6 @@
$form->addElement(new XoopsFormHidden('op', 'save_table'));
$form->addElement(new XoopsFormButton(_REQUIRED.' <span class="red bold">*</span>', 'submit', _SUBMIT, 'submit'));
- $form->display();
return $form;
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -21,6 +21,10 @@
if (!defined('XOOPS_ROOT_PATH')) {
die('XOOPS root path not defined');
}
-
+$dirname = $GLOBALS['xoopsModule']->getVar('dirname');
+define('TDMC_PATH', XOOPS_ROOT_PATH."/modules/" . $dirname );
+define('TDMC_URL', XOOPS_URL."/modules/" . $dirname );
+define('TDMC_UPLOAD_PATH', XOOPS_UPLOAD_PATH . "/" . $dirname );
+define('TDMC_UPLOAD_URL', XOOPS_UPLOAD_URL . "/" . $dirname );
define('TDM_CREATE_URL', XOOPS_ROOT_PATH . '/modules/TDMCreate');
define('TDM_CREATE_MURL', TDM_CREATE_URL . '/modules');
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions_const.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions_const.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions_const.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -557,7 +557,7 @@
function UcFirstAndToLower($str)
{
- return ucfirst(strtolower(trim($str)));
+ return ucfirst(strtolower(trim($str)));
}
function createFile($path, $text, $lng_ok, $lng_notok, $file, $class = 'even', $mode = 'w+')
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-03-16 03:03:00 UTC (rev 12380)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-03-16 12:58:17 UTC (rev 12381)
@@ -64,7 +64,116 @@
define('_AM_TDMCREATE_DISPLAY_USER', "Visible in User View");
//Modules.php
+//Buttons
+define('_AM_TDMCREATE_ADD_MODULE', "Add new module");
//Form
+define('_AM_TDMCREATE_MODULE_ADD', "Add a new module");
+define('_AM_TDMCREATE_MODULE_EDIT', "Edit module");
+//define('_AM_TDMCREATE_MODULE_IMPORTANT', "Required Information");
+
+define('_AM_TDMCREATE_MODULE_IMPORTANT', "Information");
+define('_AM_TDMCREATE_MODULE_NOTIMPORTANT', "Optional Information");
+define('_AM_TDMCREATE_MODULE_ID', "Id");
+define('_AM_TDMCREATE_MODULE_NAME', "Name");
+define('_AM_TDMCREATE_MODULE_VERSION', "Version");
+define('_AM_TDMCREATE_MODULE_SINCE', "Since");
+define('_AM_TDMCREATE_MODULE_DESCRIPTION', "Description");
+define('_AM_TDMCREATE_MODULE_AUTHOR', "Author");
+define('_AM_TDMCREATE_MODULE_AUTHOR_MAIL', "Author Email");
+define('_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_URL', "Author Site Url");
+define('_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_NAME', "Author Site Name");
+define('_AM_TDMCREATE_MODULE_CREDITS', "Credits");
+define('_AM_TDMCREATE_MODULE_LICENSE', "License");
+define('_AM_TDMCREATE_MODULE_RELEASE_INFO', "Release Info");
+define('_AM_TDMCREATE_MODULE_RELEASE_FILE', "Release File");
+define('_AM_TDMCREATE_MODULE_MANUAL', "Manual");
+define('_AM_TDMCREATE_MODULE_MANUAL_FILE', "Manual File");
+define('_AM_TDMCREATE_MODULE_IMAGE', "Image");
+define('_AM_TDMCREATE_MODULE_DEMO_SITE_URL', "Demo Site Url");
+define('_AM_TDMCREATE_MODULE_DEMO_SITE_NAME', "Demo Site Name");
+define('_AM_TDMCREATE_MODULE_SUPPORT_URL', "Support URL");
+define('_AM_TDMCREATE_MODULE_SUPPORT_NAME', "Support Name");
+define('_AM_TDMCREATE_MODULE_WEBSITE_URL', "Module Website URL");
+define('_AM_TDMCREATE_MODULE_WEBSITE_NAME', "Module Website Name");
+define('_AM_TDMCREATE_MODULE_RELEASE', "Release");
+define('_AM_TDMCREATE_MODULE_STATUS', "Status");
+define('_AM_TDMCREATE_MODULE_PAYPAL_BUTTON', "Button for Donations");
+define('_AM_TDMCREATE_MODULE_SUBVERSION', "Subversion module");
+define('_AM_TDMCREATE_MODULE_ADMIN', "Visible Admin");
+define('_AM_TDMCREATE_MODULE_USER', "Visible User");
+define('_AM_TDMCREATE_MODULE_SEARCH', "Enable Search");
+define('_AM_TDMCREATE_MODULE_COMMENTS', "Enable Comments");
+define('_AM_TDMCREATE_MODULE_NOTIFICATIONS', "Notifications");
+define('_AM_TDMCREATE_MODULE_PERMISSIONS', "Enable permissions");
+define('_AM_TDMCREATE_MODULE_INSTALL', "Install this module directly in root/modules?");
+// Added in version 1.39
+define('_AM_TDMCREATE_MODULE_NBFIELDS', "Fields");
+define('_AM_TDMCREATE_MODULE_BLOCKS', "Blocks");
+define('_AM_TDMCREATE_MODULE_ADMIN_LIST', "Admin");
+define('_AM_TDMCREATE_MODULE_USER_LIST', "User");
+define('_AM_TDMCREATE_MODULE_SUBMENU_LIST', "Submenu");
+define('_AM_TDMCREATE_MODULE_SEARCH_LIST', "Search");
+define('_AM_TDMCREATE_MODULE_COMMENTS_LIST', "Comments");
+define('_AM_TDMCREATE_MODULE_NOTIFICATIONS_LIST', "Notifications");
+define('_AM_TDMCREATE_MODULE_MIN_PHP', "Minimum PHP");
+define('_AM_TDMCREATE_MODULE_MIN_XOOPS', "Minimum XOOPS");
+define('_AM_TDMCREATE_MODULE_MIN_ADMIN', "Minimum Admin");
+define('_AM_TDMCREATE_MODULE_MIN_MYSQL', "Minimum Database");
+
+//Tables.php
+// Buttons
+define('_AM_TDMCREATE_ADD_TABLE', "Add new table");
+//Form1
+define('_AM_TDMCREATE_TABLE_ADD', "Add Table");
+define('_AM_TDMCREATE_TABLE_EDIT', "Edit Table");
+define('_AM_TDMCREATE_TABLE_MODULES', "Choose a module");
+define('_AM_TDMCREATE_TABLE_NAME', "Table Name");
+define('_AM_TDMCREATE_TABLE_NAME_DESC', "Unique Name for this Table");
+define('_AM_TDMCREATE_TABLE_NBFIELDS', "Number fields");
+define('_AM_TDMCREATE_TABLE_NBFIELDS_DESC', "Number of fields for this table");
+define('_AM_TDMCREATE_TABLE_FIELDNAME', "Field Name");
+define('_AM_TDMCREATE_TABLE_FIELDNAME_DESC', "This is the prefix of field name (optional)<br />If you leave the field blank,<br />doesn't appear anything in the fields of the next screen,<br />otherwise you'll see all the fields with a prefix type (e.g: <span class='bold'>fieldname_</span>)");
+define('_AM_TDMCREATE_TABLE_IMAGE', "Table Logo");
+define('_AM_TDMCREATE_TABLE_BLOCKS', "Block for this table");
+define('_AM_TDMCREATE_TABLE_BLOCKS_DESC', "(blocks: random, latest, today)");
+define('_AM_TDMCREATE_TABLE_ADMIN', "View in Admin Panel");
+define('_AM_TDMCREATE_TABLE_USER', "View in User Side");
+define('_AM_TDMCREATE_TABLE_SUBMENU', "View in Submenu");
+define('_AM_TDMCREATE_TABLE_SEARCH', "Search for this table");
+define('_AM_TDMCREATE_TABLE_EXIST', "The name specified for this table is already in use");
+define('_AM_TDMCREATE_TABLE_COMMENTS', "Comments for this table");
+// Added in version 1.39
+define('_AM_TDMCREATE_TABLE_NOTIFICATIONS', "Notifications for this table");
+
+// v1.38
+define('_AM_TDMCREATE_TABLE_IMAGE_DESC', "<span class='red bold'>Attention</span>: If you want to choose a new image, is best to name it with the module name before and follow with the name of the image so as not to overwrite any images with the same name, in the <span class='bold'>Frameworks/moduleclasses/moduleadmin/icons/32/</span>. Otherwise an other solution, would be to insert the images in the module, a new folder is created, with the creation of the same module - <span class='bold'>images/32</span>.");
+
+//Form2
+define('_AM_TDMCREATE_FIELD_ADD', "Add fields");
+define('_AM_TDMCREATE_FIELD_EDIT', "Edit fields");
+define('_AM_TDMCREATE_FIELD_NUMBER', "N°");
+define('_AM_TDMCREATE_FIELD_NAME', "Field Name");
+define('_AM_TDMCREATE_FIELD_TYPE', "Type");
+define('_AM_TDMCREATE_FIELD_VALUE', "Value");
+define('_AM_TDMCREATE_FIELD_ATTRIBUTE', "Attribute");
+define('_AM_TDMCREATE_FIELD_NULL', "Null");
+define('_AM_TDMCREATE_FIELD_DEFAULT', "Default");
+define('_AM_TDMCREATE_FIELD_KEY', "Key");
+define('_AM_TDMCREATE_FIELD_AUTO_INCREMENT', " Auto Increment");
+// Others
+define('_AM_TDMCREATE_FIELD_OTHERS', "Others");
+define('_AM_TDMCREATE_FIELD_ELEMENTS', "Options Elements");
+define('_AM_TDMCREATE_FIELD_ELEMENT_NAME', "Form: Element");
+define('_AM_TDMCREATE_FIELD_ADMIN', "Page: Show Admin Side");
+define('_AM_TDMCREATE_FIELD_USER', "Page: Show User Side");
+define('_AM_TDMCREATE_FIELD_BLOCK', "Block: View");
+define('_AM_TDMCREATE_FIELD_MAINFIELD', "Table: Main Field");
+define('_AM_TDMCREATE_FIELD_SEARCH', "Search: Index");
+define('_AM_TDMCREATE_FIELD_REQUIRED', "Field: Required");
+define('_AM_TDMCREATE_ADMIN_SUBMIT', "Send");
+
+//Modules.php
+//Form
define('_AM_TDMCREATE_MODULES_ADD', "Add a new module");
define('_AM_TDMCREATE_MODULES_EDIT', "Create a module");
define('_AM_TDMCREATE_MODULES_IMPORTANT', "Required Information");
@@ -101,6 +210,7 @@
define('_AM_TDMCREATE_MODULES_INROOT_INSTALL', "Install this module directly in root/modules?");
define('_AM_TDMCREATE_MODULES_PAYPAL_BUTTON', "Paypal Button");
define('_AM_TDMCREATE_MODULES_SUBVERSION', "Subversion");
+
//Tables.php
//Form1
define('_AM_TDMCREATE_TABLES_ADD', "Add tables to the form:");
@@ -135,7 +245,7 @@
define('_AM_TDMCREATE_TABLES_FIELDS_...
[truncated message content] |